File tree Expand file tree Collapse file tree 2 files changed +24
-1
lines changed
Expand file tree Collapse file tree 2 files changed +24
-1
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+
4+ const skeletonVariants = tv ( {
5+ slots : {
6+ skeleton : 'bg-accent animate-pulse rounded-md'
7+ }
8+ } ) ;
9+
10+ const { skeleton } = skeletonVariants ( ) ;
11+
12+ @Directive ( {
13+ selector : '[uiSkeleton]' ,
14+ exportAs : 'uiSkeleton' ,
15+ host : {
16+ '[class]' : 'computedClass()'
17+ }
18+ } )
19+ export class UiSkeleton {
20+ inputClass = input < string > ( '' , { alias : 'class' } ) ;
21+ computedClass = computed ( ( ) => skeleton ( { class : this . inputClass ( ) } ) ) ;
22+ }
Original file line number Diff line number Diff line change @@ -20,4 +20,5 @@ export * from './directives/breadcrumb';
2020export * from './directives/form-field' ;
2121export * from './directives/checkbox' ;
2222export * from './directives/toggle' ;
23- export * from './directives/toggle-group' ;
23+ export * from './directives/toggle-group' ;
24+ export * from './directives/skeleton' ;
You can’t perform that action at this time.
0 commit comments