File tree Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Original file line number Diff line number Diff line change
1
+ import { computed , Directive , input } from "@angular/core" ;
2
+ import { tv } from "tailwind-variants" ;
3
+ import { NgpLabel } from "ng-primitives/form-field" ;
4
+
5
+ const labelVariants = tv ( {
6
+ base : 'flex items-center gap-2 text-sm leading-none font-medium select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50'
7
+ } ) ;
8
+
9
+ @Directive ( {
10
+ selector : '[uiLabel]' ,
11
+ exportAs : 'uiLabel' ,
12
+ host : {
13
+ '[class]' : 'computedClass()'
14
+ } ,
15
+ hostDirectives : [ NgpLabel ] ,
16
+ } )
17
+ export class UiLabel {
18
+ inputClass = input < string > ( '' , { alias : 'class' } ) ;
19
+ computedClass = computed ( ( ) => labelVariants ( { class : this . inputClass ( ) } ) ) ;
20
+ }
Original file line number Diff line number Diff line change @@ -11,5 +11,6 @@ export * from './lib/tooltip';
11
11
export * from './lib/card' ;
12
12
export * from './lib/toast' ;
13
13
export * from './lib/separator' ;
14
+ export * from './lib/label' ;
14
15
export * from './lib/input' ;
15
16
export * from './lib/form-field' ;
You can’t perform that action at this time.
0 commit comments