@spartan-ng/cli 0.0.1-alpha.484 → 0.0.1-alpha.486

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (110) hide show
  1. package/package.json +1 -1
  2. package/src/generators/migrate-helm-libraries/schema.json +1 -1
  3. package/src/generators/migrate-icon/schema.json +1 -1
  4. package/src/generators/migrate-radio/schema.json +1 -1
  5. package/src/generators/migrate-select/schema.json +1 -1
  6. package/src/generators/migrate-toggle-group/schema.json +1 -1
  7. package/src/generators/theme/__snapshots__/generator.spec.ts.snap +620 -0
  8. package/src/generators/theme/generator.js +3 -12
  9. package/src/generators/theme/generator.js.map +1 -1
  10. package/src/generators/theme/libs/add-theme-to-application-styles.d.ts +2 -3
  11. package/src/generators/theme/libs/add-theme-to-application-styles.js +14 -2
  12. package/src/generators/theme/libs/add-theme-to-application-styles.js.map +1 -1
  13. package/src/generators/theme/libs/colors.d.ts +14 -0
  14. package/src/generators/theme/libs/colors.js +451 -0
  15. package/src/generators/theme/libs/colors.js.map +1 -0
  16. package/src/generators/ui/libs/ui-accordion-helm/files/lib/hlm-accordion-content.component.ts.template +1 -6
  17. package/src/generators/ui/libs/ui-accordion-helm/files/lib/hlm-accordion-icon.directive.ts.template +4 -1
  18. package/src/generators/ui/libs/ui-accordion-helm/files/lib/hlm-accordion-trigger.directive.ts.template +1 -1
  19. package/src/generators/ui/libs/ui-alert-dialog-helm/files/lib/hlm-alert-dialog-content.component.ts.template +1 -1
  20. package/src/generators/ui/libs/ui-alert-dialog-helm/files/lib/hlm-alert-dialog-description.directive.ts.template +1 -1
  21. package/src/generators/ui/libs/ui-alert-dialog-helm/files/lib/hlm-alert-dialog-footer.component.ts.template +1 -1
  22. package/src/generators/ui/libs/ui-alert-dialog-helm/files/lib/hlm-alert-dialog-header.component.ts.template +1 -1
  23. package/src/generators/ui/libs/ui-alert-dialog-helm/files/lib/hlm-alert-dialog-overlay.directive.ts.template +1 -1
  24. package/src/generators/ui/libs/ui-alert-helm/files/lib/hlm-alert-description.directive.ts.template +6 -7
  25. package/src/generators/ui/libs/ui-alert-helm/files/lib/hlm-alert-title.directive.ts.template +3 -7
  26. package/src/generators/ui/libs/ui-alert-helm/files/lib/hlm-alert.directive.ts.template +5 -4
  27. package/src/generators/ui/libs/ui-avatar-helm/files/lib/fallback/hlm-avatar-fallback.directive.ts.template +3 -18
  28. package/src/generators/ui/libs/ui-avatar-helm/files/lib/hlm-avatar.component.ts.template +1 -18
  29. package/src/generators/ui/libs/ui-avatar-helm/files/lib/image/hlm-avatar-image.directive.ts.template +1 -1
  30. package/src/generators/ui/libs/ui-badge-helm/files/index.ts.template +4 -2
  31. package/src/generators/ui/libs/ui-badge-helm/files/lib/hlm-badge.directive.ts.template +10 -37
  32. package/src/generators/ui/libs/ui-breadcrumb-helm/files/lib/hlm-breadcrumb-ellipsis.component.ts.template +1 -1
  33. package/src/generators/ui/libs/ui-breadcrumb-helm/files/lib/hlm-breadcrumb-link.directive.ts.template +1 -1
  34. package/src/generators/ui/libs/ui-breadcrumb-helm/files/lib/hlm-breadcrumb-list.directive.ts.template +1 -1
  35. package/src/generators/ui/libs/ui-breadcrumb-helm/files/lib/hlm-breadcrumb-separator.component.ts.template +4 -6
  36. package/src/generators/ui/libs/ui-button-helm/files/index.ts.template +1 -2
  37. package/src/generators/ui/libs/ui-button-helm/files/lib/hlm-button.directive.ts.template +14 -11
  38. package/src/generators/ui/libs/ui-calendar-helm/files/lib/hlm-calendar-multi.component.ts.template +3 -3
  39. package/src/generators/ui/libs/ui-calendar-helm/files/lib/hlm-calendar.component.ts.template +6 -6
  40. package/src/generators/ui/libs/ui-card-helm/files/index.ts.template +3 -0
  41. package/src/generators/ui/libs/ui-card-helm/files/lib/hlm-card-action.directive.ts.template +17 -0
  42. package/src/generators/ui/libs/ui-card-helm/files/lib/hlm-card-content.directive.ts.template +1 -8
  43. package/src/generators/ui/libs/ui-card-helm/files/lib/hlm-card-description.directive.ts.template +1 -8
  44. package/src/generators/ui/libs/ui-card-helm/files/lib/hlm-card-footer.directive.ts.template +1 -17
  45. package/src/generators/ui/libs/ui-card-helm/files/lib/hlm-card-header.directive.ts.template +6 -17
  46. package/src/generators/ui/libs/ui-card-helm/files/lib/hlm-card-title.directive.ts.template +1 -8
  47. package/src/generators/ui/libs/ui-card-helm/files/lib/hlm-card.directive.ts.template +4 -7
  48. package/src/generators/ui/libs/ui-checkbox-helm/files/lib/hlm-checkbox.component.ts.template +11 -10
  49. package/src/generators/ui/libs/ui-command-helm/files/lib/hlm-command-dialog.directive.ts.template +1 -1
  50. package/src/generators/ui/libs/ui-command-helm/files/lib/hlm-command-group-label.component.ts.template +1 -1
  51. package/src/generators/ui/libs/ui-command-helm/files/lib/hlm-command-group.component.ts.template +1 -1
  52. package/src/generators/ui/libs/ui-command-helm/files/lib/hlm-command-icon.directive.ts.template +10 -3
  53. package/src/generators/ui/libs/ui-command-helm/files/lib/hlm-command-item.component.ts.template +1 -1
  54. package/src/generators/ui/libs/ui-command-helm/files/lib/hlm-command-list.component.ts.template +1 -1
  55. package/src/generators/ui/libs/ui-command-helm/files/lib/hlm-command-search-input.component.ts.template +1 -1
  56. package/src/generators/ui/libs/ui-command-helm/files/lib/hlm-command-search.component.ts.template +1 -1
  57. package/src/generators/ui/libs/ui-command-helm/files/lib/hlm-command-separator.component.ts.template +1 -1
  58. package/src/generators/ui/libs/ui-command-helm/files/lib/hlm-command-shortcut.component.ts.template +10 -3
  59. package/src/generators/ui/libs/ui-command-helm/files/lib/hlm-command.component.ts.template +1 -4
  60. package/src/generators/ui/libs/ui-date-picker-helm/files/lib/hlm-date-picker-multi.component.ts.template +2 -2
  61. package/src/generators/ui/libs/ui-date-picker-helm/files/lib/hlm-date-picker.component.ts.template +7 -7
  62. package/src/generators/ui/libs/ui-dialog-helm/files/lib/hlm-dialog-overlay.directive.ts.template +1 -1
  63. package/src/generators/ui/libs/ui-form-field-helm/files/lib/hlm-error.directive.ts.template +10 -3
  64. package/src/generators/ui/libs/ui-form-field-helm/files/lib/hlm-form-field.component.ts.template +14 -2
  65. package/src/generators/ui/libs/ui-form-field-helm/files/lib/hlm-hint.directive.ts.template +8 -3
  66. package/src/generators/ui/libs/ui-input-helm/files/index.ts.template +2 -4
  67. package/src/generators/ui/libs/ui-input-helm/files/lib/hlm-input.directive.ts.template +10 -21
  68. package/src/generators/ui/libs/ui-input-otp-helm/files/lib/hlm-input-otp-separator.component.ts.template +4 -4
  69. package/src/generators/ui/libs/ui-input-otp-helm/files/lib/hlm-input-otp-slot.component.ts.template +2 -2
  70. package/src/generators/ui/libs/ui-input-otp-helm/files/lib/hlm-input-otp.directive.ts.template +1 -1
  71. package/src/generators/ui/libs/ui-label-helm/files/lib/hlm-label.directive.ts.template +2 -47
  72. package/src/generators/ui/libs/ui-menu-helm/files/lib/hlm-menu-bar-item.directive.ts.template +1 -1
  73. package/src/generators/ui/libs/ui-menu-helm/files/lib/hlm-menu-bar.component.ts.template +1 -1
  74. package/src/generators/ui/libs/ui-menu-helm/files/lib/hlm-menu-item-sub-indicator.component.ts.template +3 -3
  75. package/src/generators/ui/libs/ui-menu-helm/files/lib/hlm-menu-item.directive.ts.template +16 -19
  76. package/src/generators/ui/libs/ui-menu-helm/files/lib/hlm-menu-label.component.ts.template +9 -9
  77. package/src/generators/ui/libs/ui-menu-helm/files/lib/hlm-menu-separator.component.ts.template +2 -2
  78. package/src/generators/ui/libs/ui-menu-helm/files/lib/hlm-menu-shortcut.component.ts.template +1 -1
  79. package/src/generators/ui/libs/ui-menu-helm/files/lib/hlm-menu.component.ts.template +4 -8
  80. package/src/generators/ui/libs/ui-progress-helm/files/lib/hlm-progress-indicator.directive.ts.template +1 -1
  81. package/src/generators/ui/libs/ui-progress-helm/files/lib/hlm-progress.directive.ts.template +1 -1
  82. package/src/generators/ui/libs/ui-radio-group-helm/files/lib/hlm-radio-group.component.ts.template +2 -1
  83. package/src/generators/ui/libs/ui-radio-group-helm/files/lib/hlm-radio-indicator.component.ts.template +7 -8
  84. package/src/generators/ui/libs/ui-radio-group-helm/files/lib/hlm-radio.component.ts.template +2 -7
  85. package/src/generators/ui/libs/ui-select-helm/files/lib/hlm-select-label.directive.ts.template +1 -1
  86. package/src/generators/ui/libs/ui-select-helm/files/lib/hlm-select-option.component.ts.template +4 -7
  87. package/src/generators/ui/libs/ui-select-helm/files/lib/hlm-select-scroll-down.component.ts.template +10 -3
  88. package/src/generators/ui/libs/ui-select-helm/files/lib/hlm-select-scroll-up.component.ts.template +10 -3
  89. package/src/generators/ui/libs/ui-select-helm/files/lib/hlm-select-trigger.component.ts.template +8 -14
  90. package/src/generators/ui/libs/ui-select-helm/files/lib/hlm-select-value.directive.ts.template +1 -4
  91. package/src/generators/ui/libs/ui-sheet-helm/files/lib/hlm-sheet-close.directive.ts.template +1 -1
  92. package/src/generators/ui/libs/ui-sheet-helm/files/lib/hlm-sheet-content.component.ts.template +5 -5
  93. package/src/generators/ui/libs/ui-sheet-helm/files/lib/hlm-sheet-description.directive.ts.template +1 -1
  94. package/src/generators/ui/libs/ui-sheet-helm/files/lib/hlm-sheet-footer.component.ts.template +1 -3
  95. package/src/generators/ui/libs/ui-sheet-helm/files/lib/hlm-sheet-header.component.ts.template +1 -1
  96. package/src/generators/ui/libs/ui-sheet-helm/files/lib/hlm-sheet-overlay.directive.ts.template +1 -1
  97. package/src/generators/ui/libs/ui-sheet-helm/files/lib/hlm-sheet-title.directive.ts.template +1 -1
  98. package/src/generators/ui/libs/ui-slider-helm/files/lib/hlm-slider.component.ts.template +3 -3
  99. package/src/generators/ui/libs/ui-switch-helm/files/lib/hlm-switch-thumb.directive.ts.template +1 -1
  100. package/src/generators/ui/libs/ui-switch-helm/files/lib/hlm-switch.component.ts.template +1 -2
  101. package/src/generators/ui/libs/ui-tabs-helm/files/lib/hlm-tabs-list.component.ts.template +1 -1
  102. package/src/generators/ui/libs/ui-tabs-helm/files/lib/hlm-tabs-trigger.directive.ts.template +2 -2
  103. package/src/generators/ui/libs/ui-tabs-helm/files/lib/hlm-tabs.component.ts.template +9 -1
  104. package/src/generators/ui/libs/ui-toggle-group-helm/files/lib/hlm-toggle-group.directive.ts.template +8 -8
  105. package/src/generators/ui/libs/ui-toggle-group-helm/files/lib/hlm-toggle-item.directive.ts.template +15 -14
  106. package/src/generators/ui/libs/ui-tooltip-helm/files/lib/hlm-tooltip-trigger.directive.ts.template +2 -2
  107. package/src/generators/ui/supported-ui-libraries.json +47 -47
  108. package/src/generators/theme/libs/supported-theme-generator-map.d.ts +0 -17
  109. package/src/generators/theme/libs/supported-theme-generator-map.js +0 -584
  110. package/src/generators/theme/libs/supported-theme-generator-map.js.map +0 -1
@@ -1,22 +1,15 @@
1
- import { Directive, Input, booleanAttribute, computed, input, signal } from '@angular/core';
1
+ import { BooleanInput } from '@angular/cdk/coercion';
2
+ import { booleanAttribute, computed, Directive, input } from '@angular/core';
2
3
  import { hlm } from '@spartan-ng/brain/core';
3
4
  import { BrnMenuItemDirective } from '@spartan-ng/brain/menu';
4
- import { type VariantProps, cva } from 'class-variance-authority';
5
- import type { ClassValue } from 'clsx';
6
-
7
- export const hlmMenuItemVariants = cva(
8
- 'group w-full relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:bg-accent focus-visible:text-accent-foreground disabled:pointer-events-none disabled:opacity-50',
9
- {
10
- variants: { inset: { true: 'pl-8', false: '' } },
11
- defaultVariants: { inset: false },
12
- },
13
- );
14
- export type HlmMenuItemVariants = VariantProps<typeof hlmMenuItemVariants>;
5
+ import { ClassValue } from 'clsx';
15
6
 
16
7
  @Directive({
17
8
  selector: '[hlmMenuItem]',
18
9
  host: {
19
10
  '[class]': '_computedClass()',
11
+ '[attr.data-variant]': 'variant()',
12
+ '[attr.data-inset]': 'inset() ? "" : null',
20
13
  },
21
14
  hostDirectives: [
22
15
  {
@@ -27,13 +20,17 @@ export type HlmMenuItemVariants = VariantProps<typeof hlmMenuItemVariants>;
27
20
  ],
28
21
  })
29
22
  export class HlmMenuItemDirective {
30
- private readonly _inset = signal<boolean>(false);
23
+ public readonly variant = input<'default' | 'destructive'>('default');
31
24
 
32
- public readonly userClass = input<ClassValue>('', { alias: 'class' });
33
- protected _computedClass = computed(() => hlm(hlmMenuItemVariants({ inset: this._inset() }), this.userClass()));
25
+ public readonly inset = input<boolean, BooleanInput>(false, {
26
+ transform: booleanAttribute,
27
+ });
34
28
 
35
- @Input({ transform: booleanAttribute })
36
- public set inset(value: boolean) {
37
- this._inset.set(value);
38
- }
29
+ public readonly userClass = input<ClassValue>('', { alias: 'class' });
30
+ protected _computedClass = computed(() =>
31
+ hlm(
32
+ `hover:bg-accent focus-visible:bg-accent w-full focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[ng-icon]:!text-destructive [&_ng-icon:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_ng-icon]:pointer-events-none [&_ng-icon]:shrink-0`,
33
+ this.userClass(),
34
+ ),
35
+ );
39
36
  }
@@ -1,6 +1,7 @@
1
- import { ChangeDetectionStrategy, Component, Input, booleanAttribute, computed, input, signal } from '@angular/core';
1
+ import { BooleanInput } from '@angular/cdk/coercion';
2
+ import { booleanAttribute, ChangeDetectionStrategy, Component, computed, input } from '@angular/core';
2
3
  import { hlm } from '@spartan-ng/brain/core';
3
- import type { ClassValue } from 'clsx';
4
+ import { ClassValue } from 'clsx';
4
5
 
5
6
  @Component({
6
7
  selector: 'hlm-menu-label',
@@ -9,18 +10,17 @@ import type { ClassValue } from 'clsx';
9
10
  `,
10
11
  host: {
11
12
  '[class]': '_computedClass()',
13
+ '[attr.data-inset]': 'inset() ? "" : null',
12
14
  },
13
15
  changeDetection: ChangeDetectionStrategy.OnPush,
14
16
  })
15
17
  export class HlmMenuLabelComponent {
18
+ public readonly inset = input<boolean, BooleanInput>(false, {
19
+ transform: booleanAttribute,
20
+ });
21
+
16
22
  public readonly userClass = input<ClassValue>('', { alias: 'class' });
17
23
  protected _computedClass = computed(() =>
18
- hlm('block px-2 py-1.5 text-sm font-semibold', this._inset() && 'pl-8', this.userClass()),
24
+ hlm('block px-2 py-1.5 text-sm font-medium data-[inset]:pl-8', this.userClass()),
19
25
  );
20
-
21
- private readonly _inset = signal<ClassValue>(false);
22
- @Input({ transform: booleanAttribute })
23
- public set inset(value: boolean) {
24
- this._inset.set(value);
25
- }
26
26
  }
@@ -1,6 +1,6 @@
1
1
  import { ChangeDetectionStrategy, Component, computed, input } from '@angular/core';
2
2
  import { hlm } from '@spartan-ng/brain/core';
3
- import type { ClassValue } from 'clsx';
3
+ import { ClassValue } from 'clsx';
4
4
 
5
5
  @Component({
6
6
  selector: 'hlm-menu-separator',
@@ -12,5 +12,5 @@ import type { ClassValue } from 'clsx';
12
12
  })
13
13
  export class HlmMenuSeparatorComponent {
14
14
  public readonly userClass = input<ClassValue>('', { alias: 'class' });
15
- protected _computedClass = computed(() => hlm('block -mx-1 my-1 h-px bg-muted', this.userClass()));
15
+ protected readonly _computedClass = computed(() => hlm('block bg-border -mx-1 my-1 h-px', this.userClass()));
16
16
  }
@@ -15,6 +15,6 @@ import type { ClassValue } from 'clsx';
15
15
  export class HlmMenuShortcutComponent {
16
16
  public readonly userClass = input<ClassValue>('', { alias: 'class' });
17
17
  protected _computedClass = computed(() =>
18
- hlm('ml-auto font-light text-xs tracking-widest opacity-60', this.userClass()),
18
+ hlm('text-muted-foreground ml-auto text-xs tracking-widest', this.userClass()),
19
19
  );
20
20
  }
@@ -1,11 +1,11 @@
1
- import { ChangeDetectionStrategy, Component, Input, computed, input, signal } from '@angular/core';
1
+ import { ChangeDetectionStrategy, Component, computed, input } from '@angular/core';
2
2
  import { hlm } from '@spartan-ng/brain/core';
3
3
  import { BrnMenuDirective } from '@spartan-ng/brain/menu';
4
4
  import { type VariantProps, cva } from 'class-variance-authority';
5
5
  import type { ClassValue } from 'clsx';
6
6
 
7
7
  export const menuVariants = cva(
8
- 'block border-border min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2',
8
+ 'bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-top overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md',
9
9
  {
10
10
  variants: {
11
11
  variant: {
@@ -33,11 +33,7 @@ type MenuVariants = VariantProps<typeof menuVariants>;
33
33
  })
34
34
  export class HlmMenuComponent {
35
35
  public readonly userClass = input<ClassValue>('', { alias: 'class' });
36
- protected _computedClass = computed(() => hlm(menuVariants({ variant: this._variant() }), this.userClass()));
36
+ protected _computedClass = computed(() => hlm(menuVariants({ variant: this.variant() }), this.userClass()));
37
37
 
38
- private readonly _variant = signal<MenuVariants['variant']>('default');
39
- @Input()
40
- public set variant(value: MenuVariants['variant']) {
41
- this._variant.set(value);
42
- }
38
+ public readonly variant = input<MenuVariants['variant']>('default');
43
39
  }
@@ -16,7 +16,7 @@ export class HlmProgressIndicatorDirective {
16
16
  public readonly userClass = input<ClassValue>('', { alias: 'class' });
17
17
 
18
18
  protected readonly _computedClass = computed(() =>
19
- hlm('inline-flex transform-gpu h-full w-full flex-1 bg-primary transition-all', this.userClass()),
19
+ hlm('bg-primary h-full w-full flex-1 transition-all', this.userClass()),
20
20
  );
21
21
 
22
22
  protected readonly transform = computed(() => `translateX(-${100 - (this._progress.value() ?? 100)}%)`);
@@ -11,6 +11,6 @@ import type { ClassValue } from 'clsx';
11
11
  export class HlmProgressDirective {
12
12
  public readonly userClass = input<ClassValue>('', { alias: 'class' });
13
13
  protected readonly _computedClass = computed(() =>
14
- hlm('inline-flex relative h-4 w-full overflow-hidden rounded-full bg-secondary', this.userClass()),
14
+ hlm('inline-flex bg-primary/20 relative h-2 w-full overflow-hidden rounded-full', this.userClass()),
15
15
  );
16
16
  }
@@ -9,6 +9,7 @@ import type { ClassValue } from 'clsx';
9
9
  {
10
10
  directive: BrnRadioGroupDirective,
11
11
  inputs: ['name', 'value', 'disabled', 'required', 'direction'],
12
+ outputs: ['valueChange'],
12
13
  },
13
14
  ],
14
15
  host: {
@@ -19,5 +20,5 @@ import type { ClassValue } from 'clsx';
19
20
  })
20
21
  export class HlmRadioGroupComponent {
21
22
  public readonly userClass = input<ClassValue>('', { alias: 'class' });
22
- protected _computedClass = computed(() => hlm('grid gap-2', this.userClass()));
23
+ protected readonly _computedClass = computed(() => hlm('grid gap-3', this.userClass()));
23
24
  }
@@ -2,23 +2,22 @@ import { ChangeDetectionStrategy, Component, computed, input } from '@angular/co
2
2
  import { hlm } from '@spartan-ng/brain/core';
3
3
  import type { ClassValue } from 'clsx';
4
4
 
5
- const btnLike =
6
- 'aspect-square rounded-full ring-offset-background group-[.cdk-keyboard-focused]:ring-2 group-[.cdk-keyboard-focused]:ring-ring group-[.cdk-keyboard-focused]:ring-offset-2 group-[.brn-radio-disabled]:cursor-not-allowed group-[.brn-radio-disabled]:opacity-50';
7
-
8
5
  @Component({
9
6
  selector: 'hlm-radio-indicator',
10
7
  host: {
11
8
  '[class]': '_computedClass()',
12
9
  },
13
10
  template: `
14
- <div
15
- class="bg-foreground absolute inset-0 hidden scale-[55%] rounded-full group-[.brn-radio-checked]:inline-block"
16
- ></div>
17
- <div class="border-primary ${btnLike} rounded-full border"></div>
11
+ <div class="group-data-[checked=true]:bg-primary size-2 rounded-full bg-transparent"></div>
18
12
  `,
19
13
  changeDetection: ChangeDetectionStrategy.OnPush,
20
14
  })
21
15
  export class HlmRadioIndicatorComponent {
22
16
  public readonly userClass = input<ClassValue>('', { alias: 'class' });
23
- protected _computedClass = computed(() => hlm('relative inline-flex h-4 w-4', this.userClass()));
17
+ protected _computedClass = computed(() =>
18
+ hlm(
19
+ 'relative flex items-center justify-center border-input text-primary group-has-[:focus-visible]:border-ring group-has-[:focus-visible]:ring-ring/50 dark:bg-input/30 aspect-square size-4 shrink-0 rounded-full border shadow-xs transition-[color,box-shadow] outline-none group-has-[:focus-visible]:ring-[3px] group-data=[disabled=true]:cursor-not-allowed group-data=[disabled=true]:opacity-50',
20
+ this.userClass(),
21
+ ),
22
+ );
24
23
  }
@@ -32,7 +32,7 @@ import { ClassValue } from 'clsx';
32
32
  [aria-describedby]="ariaDescribedby()"
33
33
  (change)="change.emit($event)"
34
34
  >
35
- <ng-content select="[target],[indicator]" indicator />
35
+ <ng-content select="[target],[indicator],hlm-radio-indicator" indicator />
36
36
  <ng-content />
37
37
  </brn-radio>
38
38
  `,
@@ -45,12 +45,7 @@ export class HlmRadioComponent<T = unknown> {
45
45
  private readonly _isBrowser = isPlatformBrowser(inject(PLATFORM_ID));
46
46
 
47
47
  public readonly userClass = input<ClassValue>('', { alias: 'class' });
48
- protected _computedClass = computed(() =>
49
- hlm(
50
- 'group [&.brn-radio-disabled]:text-muted-foreground flex items-center space-x-2 rtl:space-x-reverse',
51
- this.userClass(),
52
- ),
53
- );
48
+ protected readonly _computedClass = computed(() => hlm('group flex items-center gap-x-3', this.userClass()));
54
49
 
55
50
  /** Used to set the id on the underlying brn element. */
56
51
  public readonly id = input<string | undefined>(undefined);
@@ -17,7 +17,7 @@ export class HlmSelectLabelDirective {
17
17
  public readonly userClass = input<ClassValue>('', { alias: 'class' });
18
18
  protected _computedClass = computed(() =>
19
19
  hlm(
20
- 'pl-8 pr-2 text-sm font-semibold rtl:pl-2 rtl:pr-8',
20
+ 'text-muted-foreground px-2 py-1.5 text-xs',
21
21
  this._stickyLabels() ? 'sticky top-0 bg-popover block z-[2]' : '',
22
22
  this.userClass(),
23
23
  ),
@@ -15,16 +15,13 @@ import type { ClassValue } from 'clsx';
15
15
  '[class]': '_computedClass()',
16
16
  },
17
17
  template: `
18
- <ng-content />
19
- <span
20
- [attr.dir]="_brnSelectOption.dir()"
21
- class="absolute left-2 flex h-3.5 w-3.5 items-center justify-center rtl:left-auto rtl:right-2"
22
- [attr.data-state]="this._brnSelectOption.checkedState()"
23
- >
18
+ <span class="absolute right-2 flex size-3.5 items-center justify-center">
24
19
  @if (this._brnSelectOption.selected()) {
25
20
  <ng-icon hlm size="sm" aria-hidden="true" name="lucideCheck" />
26
21
  }
27
22
  </span>
23
+
24
+ <ng-content />
28
25
  `,
29
26
  imports: [NgIcon, HlmIconDirective],
30
27
  })
@@ -33,7 +30,7 @@ export class HlmSelectOptionComponent {
33
30
  public readonly userClass = input<ClassValue>('', { alias: 'class' });
34
31
  protected readonly _computedClass = computed(() =>
35
32
  hlm(
36
- 'relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 rtl:flex-reverse rtl:pr-8 rtl:pl-2 text-sm outline-none data-[active]:bg-accent data-[active]:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50',
33
+ 'data-[active]:bg-accent data-[active]:text-accent-foreground [&>ng-icon]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>ng-icon]:pointer-events-none [&>ng-icon]:shrink-0 [&>ng-icon]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2',
37
34
  this.userClass(),
38
35
  ),
39
36
  );
@@ -1,18 +1,25 @@
1
- import { ChangeDetectionStrategy, Component } from '@angular/core';
1
+ import { ChangeDetectionStrategy, Component, computed, input } from '@angular/core';
2
2
  import { NgIcon, provideIcons } from '@ng-icons/core';
3
3
  import { lucideChevronDown } from '@ng-icons/lucide';
4
+ import { hlm } from '@spartan-ng/brain/core';
4
5
  import { HlmIconDirective } from '@spartan-ng/helm/icon';
6
+ import { ClassValue } from 'clsx';
5
7
 
6
8
  @Component({
7
9
  selector: 'hlm-select-scroll-down',
8
10
  imports: [NgIcon, HlmIconDirective],
9
11
  providers: [provideIcons({ lucideChevronDown })],
10
12
  host: {
11
- class: 'flex cursor-default items-center justify-center py-1',
13
+ '[class]': '_computedClass()',
12
14
  },
13
15
  template: `
14
16
  <ng-icon hlm size="sm" class="ml-2" name="lucideChevronDown" />
15
17
  `,
16
18
  changeDetection: ChangeDetectionStrategy.OnPush,
17
19
  })
18
- export class HlmSelectScrollDownComponent {}
20
+ export class HlmSelectScrollDownComponent {
21
+ public readonly userClass = input<ClassValue>('', { alias: 'class' });
22
+ protected readonly _computedClass = computed(() =>
23
+ hlm('flex cursor-default items-center justify-center py-1', this.userClass()),
24
+ );
25
+ }
@@ -1,18 +1,25 @@
1
- import { ChangeDetectionStrategy, Component } from '@angular/core';
1
+ import { ChangeDetectionStrategy, Component, computed, input } from '@angular/core';
2
2
  import { NgIcon, provideIcons } from '@ng-icons/core';
3
3
  import { lucideChevronUp } from '@ng-icons/lucide';
4
+ import { hlm } from '@spartan-ng/brain/core';
4
5
  import { HlmIconDirective } from '@spartan-ng/helm/icon';
6
+ import { ClassValue } from 'clsx';
5
7
 
6
8
  @Component({
7
9
  selector: 'hlm-select-scroll-up',
8
10
  imports: [NgIcon, HlmIconDirective],
9
11
  providers: [provideIcons({ lucideChevronUp })],
10
12
  host: {
11
- class: 'flex cursor-default items-center justify-center py-1',
13
+ '[class]': '_computedClass()',
12
14
  },
13
15
  template: `
14
16
  <ng-icon hlm size="sm" class="ml-2" name="lucideChevronUp" />
15
17
  `,
16
18
  changeDetection: ChangeDetectionStrategy.OnPush,
17
19
  })
18
- export class HlmSelectScrollUpComponent {}
20
+ export class HlmSelectScrollUpComponent {
21
+ public readonly userClass = input<ClassValue>('', { alias: 'class' });
22
+ protected readonly _computedClass = computed(() =>
23
+ hlm('flex cursor-default items-center justify-center py-1', this.userClass()),
24
+ );
25
+ }
@@ -4,37 +4,30 @@ import { lucideChevronDown } from '@ng-icons/lucide';
4
4
  import { hlm } from '@spartan-ng/brain/core';
5
5
  import { BrnSelectComponent, BrnSelectTriggerDirective } from '@spartan-ng/brain/select';
6
6
  import { HlmIconDirective } from '@spartan-ng/helm/icon';
7
- import { type VariantProps, cva } from 'class-variance-authority';
7
+ import { cva } from 'class-variance-authority';
8
8
  import type { ClassValue } from 'clsx';
9
9
 
10
10
  export const selectTriggerVariants = cva(
11
- 'flex items-center justify-between rounded-md border border-input bg-background text-sm ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50',
11
+ `border-input [&>ng-icon]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 [&>ng-icon]:pointer-events-none [&>ng-icon]:shrink-0 [&>ng-icon]:size-4`,
12
12
  {
13
13
  variants: {
14
- size: {
15
- default: 'h-10 py-2 px-4',
16
- sm: 'h-9 px-3',
17
- lg: 'h-11 px-8',
18
- },
19
14
  error: {
20
- auto: '[&.ng-invalid.ng-touched]:text-destructive [&.ng-invalid.ng-touched]:border-destructive [&.ng-invalid.ng-touched]:focus-visible:ring-destructive',
21
- true: 'text-destructive border-destructive focus-visible:ring-destructive',
15
+ auto: '[&.ng-invalid.ng-touched]:text-destructive [&.ng-invalid.ng-touched]:border-destructive [&.ng-invalid.ng-touched]:focus-visible:ring-destructive/20 dark:[&.ng-invalid.ng-touched]:focus-visible:ring-destructive/40',
16
+ true: 'text-destructive border-destructive focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40',
22
17
  },
23
18
  },
24
19
  defaultVariants: {
25
- size: 'default',
26
20
  error: 'auto',
27
21
  },
28
22
  },
29
23
  );
30
- type SelectTriggerVariants = VariantProps<typeof selectTriggerVariants>;
31
24
 
32
25
  @Component({
33
26
  selector: 'hlm-select-trigger',
34
27
  imports: [BrnSelectTriggerDirective, NgIcon, HlmIconDirective],
35
28
  providers: [provideIcons({ lucideChevronDown })],
36
29
  template: `
37
- <button [class]="_computedClass()" #button hlmInput brnSelectTrigger type="button">
30
+ <button [class]="_computedClass()" #button hlmInput brnSelectTrigger type="button" [attr.data-size]="size()">
38
31
  <ng-content />
39
32
  @if (icon()) {
40
33
  <ng-content select="ng-icon" />
@@ -50,10 +43,11 @@ export class HlmSelectTriggerComponent {
50
43
 
51
44
  protected readonly brnSelect = inject(BrnSelectComponent, { optional: true });
52
45
 
53
- public readonly _size = input<SelectTriggerVariants['size']>('default');
54
46
  public readonly userClass = input<ClassValue>('', { alias: 'class' });
55
47
 
48
+ public readonly size = input<'default' | 'sm'>('default');
49
+
56
50
  protected _computedClass = computed(() =>
57
- hlm(selectTriggerVariants({ size: this._size(), error: this.brnSelect?.errorState() }), this.userClass()),
51
+ hlm(selectTriggerVariants({ error: this.brnSelect?.errorState() }), this.userClass()),
58
52
  );
59
53
  }
@@ -11,9 +11,6 @@ import type { ClassValue } from 'clsx';
11
11
  export class HlmSelectValueDirective {
12
12
  public readonly userClass = input<ClassValue>('', { alias: 'class' });
13
13
  protected readonly _computedClass = computed(() =>
14
- hlm(
15
- '!inline-block ltr:text-left rtl:text-right border-border w-[calc(100%)]] min-w-0 pointer-events-none truncate data-[placeholder]:text-muted-foreground',
16
- this.userClass(),
17
- ),
14
+ hlm('line-clamp-1 flex items-center gap-2 data-[placeholder]:text-muted-foreground', this.userClass()),
18
15
  );
19
16
  }
@@ -12,7 +12,7 @@ export class HlmSheetCloseDirective {
12
12
  public readonly userClass = input<ClassValue>('', { alias: 'class' });
13
13
  protected _computedClass = computed(() =>
14
14
  hlm(
15
- 'absolute flex h-4 w-4 right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground',
15
+ 'ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none',
16
16
  this.userClass(),
17
17
  ),
18
18
  );
@@ -19,16 +19,16 @@ import type { ClassValue } from 'clsx';
19
19
  import { HlmSheetCloseDirective } from './hlm-sheet-close.directive';
20
20
 
21
21
  export const sheetVariants = cva(
22
- 'fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500',
22
+ 'bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500',
23
23
  {
24
24
  variants: {
25
25
  side: {
26
- top: 'border-border inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top',
26
+ top: 'data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b',
27
27
  bottom:
28
- 'border-border inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom',
29
- left: 'border-border inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm',
28
+ 'data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t',
29
+ left: 'data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm',
30
30
  right:
31
- 'border-border inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm',
31
+ 'inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right',
32
32
  },
33
33
  },
34
34
  defaultVariants: {
@@ -12,5 +12,5 @@ import type { ClassValue } from 'clsx';
12
12
  })
13
13
  export class HlmSheetDescriptionDirective {
14
14
  public readonly userClass = input<ClassValue>('', { alias: 'class' });
15
- protected _computedClass = computed(() => hlm('text-sm text-muted-foreground', this.userClass()));
15
+ protected _computedClass = computed(() => hlm('text-muted-foreground text-sm', this.userClass()));
16
16
  }
@@ -14,7 +14,5 @@ import type { ClassValue } from 'clsx';
14
14
  })
15
15
  export class HlmSheetFooterComponent {
16
16
  public readonly userClass = input<ClassValue>('', { alias: 'class' });
17
- protected _computedClass = computed(() =>
18
- hlm('flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2', this.userClass()),
19
- );
17
+ protected _computedClass = computed(() => hlm('mt-auto flex flex-col gap-2 p-4', this.userClass()));
20
18
  }
@@ -14,5 +14,5 @@ import type { ClassValue } from 'clsx';
14
14
  })
15
15
  export class HlmSheetHeaderComponent {
16
16
  public readonly userClass = input<ClassValue>('', { alias: 'class' });
17
- protected _computedClass = computed(() => hlm('flex flex-col space-y-2 text-center sm:text-left', this.userClass()));
17
+ protected _computedClass = computed(() => hlm('flex flex-col gap-1.5 p-4', this.userClass()));
18
18
  }
@@ -13,7 +13,7 @@ export class HlmSheetOverlayDirective {
13
13
  public readonly userClass = input<ClassValue>('', { alias: 'class' });
14
14
  protected _computedClass = computed(() =>
15
15
  hlm(
16
- 'bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0',
16
+ 'bg-black/50 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0',
17
17
  this.userClass(),
18
18
  ),
19
19
  );
@@ -12,5 +12,5 @@ import type { ClassValue } from 'clsx';
12
12
  })
13
13
  export class HlmSheetTitleDirective {
14
14
  public readonly userClass = input<ClassValue>('', { alias: 'class' });
15
- protected _computedClass = computed(() => hlm('text-lg font-semibold', this.userClass()));
15
+ protected _computedClass = computed(() => hlm('text-foreground font-semibold', this.userClass()));
16
16
  }
@@ -21,7 +21,7 @@ import type { ClassValue } from 'clsx';
21
21
  },
22
22
  ],
23
23
  template: `
24
- <div brnSliderTrack class="bg-secondary relative h-2 w-full grow overflow-hidden rounded-full">
24
+ <div brnSliderTrack class="bg-muted relative h-1.5 w-full grow overflow-hidden rounded-full">
25
25
  <div class="bg-primary absolute h-full" brnSliderRange></div>
26
26
  </div>
27
27
 
@@ -38,7 +38,7 @@ import type { ClassValue } from 'clsx';
38
38
  }
39
39
 
40
40
  <span
41
- class="border-primary bg-background ring-offset-background focus-visible:ring-ring absolute block h-5 w-5 -translate-x-1/2 rounded-full border-2 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50"
41
+ class="border-primary bg-background ring-ring/50 focus-visible:outline-hidden absolute block size-4 shrink-0 -translate-x-1/2 rounded-full border shadow-sm transition-[color,box-shadow] hover:ring-4 focus-visible:ring-4 disabled:pointer-events-none disabled:opacity-50"
42
42
  brnSliderThumb
43
43
  ></span>
44
44
  `,
@@ -52,7 +52,7 @@ export class HlmSliderComponent {
52
52
  public readonly userClass = input<ClassValue>('', { alias: 'class' });
53
53
  protected readonly _computedClass = computed(() =>
54
54
  hlm(
55
- 'w-full h-5 flex relative select-none items-center touch-none',
55
+ 'relative flex w-full touch-none select-none items-center',
56
56
  this.slider.disabled() ? 'opacity-40' : '',
57
57
  this.userClass(),
58
58
  ),
@@ -13,7 +13,7 @@ export class HlmSwitchThumbDirective {
13
13
 
14
14
  protected readonly _computedClass = computed(() =>
15
15
  hlm(
16
- 'block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform group-data-[state=checked]:translate-x-5 group-data-[state=unchecked]:translate-x-0',
16
+ 'bg-background dark:group-data-[state=unchecked]:bg-foreground dark:group-data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform group-data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0',
17
17
  this.userClass(),
18
18
  ),
19
19
  );
@@ -54,8 +54,7 @@ export class HlmSwitchComponent implements ControlValueAccessor {
54
54
  public readonly userClass = input<ClassValue>('', { alias: 'class' });
55
55
  protected readonly _computedClass = computed(() =>
56
56
  hlm(
57
- 'group inline-flex h-[24px] w-[44px] shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input',
58
- this.disabled() ? 'cursor-not-allowed opacity-50' : '',
57
+ 'group data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] data-[disabled=true]:cursor-not-allowed data-[disabled=true]:opacity-50',
59
58
  this.userClass(),
60
59
  ),
61
60
  );
@@ -5,7 +5,7 @@ import { type VariantProps, cva } from 'class-variance-authority';
5
5
  import type { ClassValue } from 'clsx';
6
6
 
7
7
  export const listVariants = cva(
8
- 'inline-flex items-center justify-center rounded-md bg-muted p-1 text-muted-foreground',
8
+ 'inline-flex h-9 w-fit items-center justify-center rounded-lg bg-muted p-[3px] text-muted-foreground',
9
9
  {
10
10
  variants: {
11
11
  orientation: {
@@ -14,9 +14,9 @@ export class HlmTabsTriggerDirective {
14
14
  public readonly triggerFor = input.required<string>({ alias: 'hlmTabsTrigger' });
15
15
 
16
16
  public readonly userClass = input<ClassValue>('', { alias: 'class' });
17
- protected _computedClass = computed(() =>
17
+ protected readonly _computedClass = computed(() =>
18
18
  hlm(
19
- 'inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm',
19
+ 'data-[state=active]:bg-background dark:data-[state=active]:text-foreground focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 text-foreground dark:text-muted-foreground inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm [&_ng-icon]:pointer-events-none [&_ng-icon]:shrink-0 [&_ng-icon]:text-base',
20
20
  this.userClass(),
21
21
  ),
22
22
  );
@@ -1,5 +1,7 @@
1
- import { ChangeDetectionStrategy, Component, input } from '@angular/core';
1
+ import { ChangeDetectionStrategy, Component, computed, input } from '@angular/core';
2
+ import { hlm } from '@spartan-ng/brain/core';
2
3
  import { BrnTabsDirective } from '@spartan-ng/brain/tabs';
4
+ import { ClassValue } from 'clsx';
3
5
 
4
6
  @Component({
5
7
  selector: 'hlm-tabs',
@@ -12,7 +14,13 @@ import { BrnTabsDirective } from '@spartan-ng/brain/tabs';
12
14
  ],
13
15
  template: '<ng-content/>',
14
16
  changeDetection: ChangeDetectionStrategy.OnPush,
17
+ host: {
18
+ '[class]': '_computedClass()',
19
+ },
15
20
  })
16
21
  export class HlmTabsComponent {
17
22
  public readonly tab = input.required<string>();
23
+
24
+ public readonly userClass = input<ClassValue>('', { alias: 'class' });
25
+ protected readonly _computedClass = computed(() => hlm('flex flex-col gap-2', this.userClass()));
18
26
  }
@@ -6,23 +6,23 @@ import { provideHlmToggleGroup } from './hlm-toggle-group.token';
6
6
  import { toggleGroupItemVariants } from './hlm-toggle-item.directive';
7
7
 
8
8
  type ToggleGroupItemVariants = VariantProps<typeof toggleGroupItemVariants>;
9
+
9
10
  @Directive({
10
11
  selector: 'brn-toggle-group[hlm],[hlmToggleGroup]',
11
12
  host: {
12
13
  '[class]': '_computedClass()',
14
+ '[attr.data-variant]': 'variant()',
13
15
  },
14
16
  providers: [provideHlmToggleGroup(HlmToggleGroupDirective)],
15
17
  })
16
18
  export class HlmToggleGroupDirective {
17
- public readonly variant = input<ToggleGroupItemVariants['variant']>('default');
18
- public readonly size = input<ToggleGroupItemVariants['size']>('default');
19
+ public readonly variant = input<ToggleGroupItemVariants['variant']>('outline');
20
+ public readonly size = input<ToggleGroupItemVariants['size']>('sm');
19
21
  public readonly userClass = input<ClassValue>('', { alias: 'class' });
20
-
21
22
  protected readonly _computedClass = computed(() =>
22
- hlm('inline-flex items-center gap-x-2 focus:[&>[hlm][brnToggle]]:z-10', {
23
- 'gap-x-0 rounded-md first-of-type:[&>[hlmToggleGroupItem]]:rounded-l-md last-of-type:[&>[hlmToggleGroupItem]]:rounded-r-md [&>[hlmToggleGroupItem][variant="outline"]]:-mx-[0.5px] [&>[hlmToggleGroupItem]]:rounded-none':
24
- this.variant() === 'merged',
25
- [String(this.userClass())]: !!this.userClass(),
26
- }),
23
+ hlm(
24
+ 'group/toggle-group flex w-fit items-center rounded-md data-[variant=outline]:shadow-xs focus:[&>[hlm][brnToggle]]:z-10',
25
+ this.userClass(),
26
+ ),
27
27
  );
28
28
  }