@spartan-ng/cli 0.0.1-alpha.337 → 0.0.1-alpha.339

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 (129) hide show
  1. package/package.json +4 -4
  2. package/src/generators/base/generator.js +8 -3
  3. package/src/generators/base/generator.js.map +1 -1
  4. package/src/generators/base/lib/build-dependency-array.js +1 -0
  5. package/src/generators/base/lib/build-dependency-array.js.map +1 -1
  6. package/src/generators/base/versions.d.ts +1 -0
  7. package/src/generators/base/versions.js +2 -1
  8. package/src/generators/base/versions.js.map +1 -1
  9. package/src/generators/theme/libs/add-theme-to-application-styles.js.map +1 -1
  10. package/src/generators/ui/generator.js +8 -1
  11. package/src/generators/ui/generator.js.map +1 -1
  12. package/src/generators/ui/libs/ui-accordion-helm/files/lib/hlm-accordion-content.directive.ts.template +2 -2
  13. package/src/generators/ui/libs/ui-accordion-helm/files/lib/hlm-accordion-icon.directive.ts.template +3 -2
  14. package/src/generators/ui/libs/ui-accordion-helm/files/lib/hlm-accordion-item.directive.ts.template +2 -2
  15. package/src/generators/ui/libs/ui-accordion-helm/files/lib/hlm-accordion-trigger.directive.ts.template +2 -2
  16. package/src/generators/ui/libs/ui-accordion-helm/files/lib/hlm-accordion.directive.ts.template +2 -2
  17. package/src/generators/ui/libs/ui-alert-dialog-helm/files/lib/hlm-alert-dialog-cancel-button.directive.ts.template +2 -2
  18. package/src/generators/ui/libs/ui-alert-dialog-helm/files/lib/hlm-alert-dialog-content.component.ts.template +2 -2
  19. package/src/generators/ui/libs/ui-alert-dialog-helm/files/lib/hlm-alert-dialog-description.directive.ts.template +2 -2
  20. package/src/generators/ui/libs/ui-alert-dialog-helm/files/lib/hlm-alert-dialog-footer.component.ts.template +2 -2
  21. package/src/generators/ui/libs/ui-alert-dialog-helm/files/lib/hlm-alert-dialog-header.component.ts.template +2 -2
  22. package/src/generators/ui/libs/ui-alert-dialog-helm/files/lib/hlm-alert-dialog-overlay.directive.ts.template +2 -2
  23. package/src/generators/ui/libs/ui-alert-dialog-helm/files/lib/hlm-alert-dialog-title.directive.ts.template +2 -2
  24. package/src/generators/ui/libs/ui-alert-dialog-helm/files/lib/hlm-alert-dialog.component.ts.template +1 -2
  25. package/src/generators/ui/libs/ui-alert-helm/files/lib/hlm-alert-description.directive.ts.template +2 -2
  26. package/src/generators/ui/libs/ui-alert-helm/files/lib/hlm-alert-title.directive.ts.template +2 -2
  27. package/src/generators/ui/libs/ui-alert-helm/files/lib/hlm-alert.directive.ts.template +2 -2
  28. package/src/generators/ui/libs/ui-aspect-ratio-helm/files/lib/helm-aspect-ratio.directive.ts.template +2 -2
  29. package/src/generators/ui/libs/ui-avatar-helm/files/lib/hlm-avatar.component.spec.ts.template +1 -1
  30. package/src/generators/ui/libs/ui-avatar-helm/files/lib/hlm-avatar.component.ts.template +2 -2
  31. package/src/generators/ui/libs/ui-avatar-helm/files/lib/image/hlm-avatar-image.directive.ts.template +2 -2
  32. package/src/generators/ui/libs/ui-badge-helm/files/lib/hlm-badge.directive.ts.template +2 -2
  33. package/src/generators/ui/libs/ui-button-helm/files/lib/hlm-button.directive.ts.template +2 -2
  34. package/src/generators/ui/libs/ui-card-helm/files/lib/hlm-card-content.directive.ts.template +2 -2
  35. package/src/generators/ui/libs/ui-card-helm/files/lib/hlm-card-description.directive.ts.template +2 -2
  36. package/src/generators/ui/libs/ui-card-helm/files/lib/hlm-card-footer.directive.ts.template +2 -4
  37. package/src/generators/ui/libs/ui-card-helm/files/lib/hlm-card-header.directive.ts.template +3 -6
  38. package/src/generators/ui/libs/ui-card-helm/files/lib/hlm-card-title.directive.ts.template +2 -2
  39. package/src/generators/ui/libs/ui-card-helm/files/lib/hlm-card.directive.ts.template +2 -2
  40. package/src/generators/ui/libs/ui-checkbox-helm/files/lib/hlm-checkbox-checkicon.component.ts.template +5 -13
  41. package/src/generators/ui/libs/ui-checkbox-helm/files/lib/hlm-checkbox.component.ts.template +31 -39
  42. package/src/generators/ui/libs/ui-command-helm/files/lib/hlm-command-dialog-close-button.directive.ts.template +2 -2
  43. package/src/generators/ui/libs/ui-command-helm/files/lib/hlm-command-dialog.directive.ts.template +2 -2
  44. package/src/generators/ui/libs/ui-command-helm/files/lib/hlm-command-empty.directive.ts.template +2 -2
  45. package/src/generators/ui/libs/ui-command-helm/files/lib/hlm-command-group.directive.ts.template +2 -2
  46. package/src/generators/ui/libs/ui-command-helm/files/lib/hlm-command-input-wrapper.component.ts.template +2 -2
  47. package/src/generators/ui/libs/ui-command-helm/files/lib/hlm-command-input.directive.ts.template +2 -2
  48. package/src/generators/ui/libs/ui-command-helm/files/lib/hlm-command-item-icon.directive.ts.template +2 -2
  49. package/src/generators/ui/libs/ui-command-helm/files/lib/hlm-command-item.directive.ts.template +2 -2
  50. package/src/generators/ui/libs/ui-command-helm/files/lib/hlm-command-list.directive.ts.template +2 -2
  51. package/src/generators/ui/libs/ui-command-helm/files/lib/hlm-command-shortcut.component.ts.template +2 -2
  52. package/src/generators/ui/libs/ui-command-helm/files/lib/hlm-command.directive.ts.template +2 -2
  53. package/src/generators/ui/libs/ui-dialog-helm/files/index.ts.template +1 -0
  54. package/src/generators/ui/libs/ui-dialog-helm/files/lib/hlm-dialog-close.directive.ts.template +2 -2
  55. package/src/generators/ui/libs/ui-dialog-helm/files/lib/hlm-dialog-content.component.ts.template +22 -10
  56. package/src/generators/ui/libs/ui-dialog-helm/files/lib/hlm-dialog-description.directive.ts.template +2 -2
  57. package/src/generators/ui/libs/ui-dialog-helm/files/lib/hlm-dialog-footer.component.ts.template +2 -2
  58. package/src/generators/ui/libs/ui-dialog-helm/files/lib/hlm-dialog-header.component.ts.template +2 -2
  59. package/src/generators/ui/libs/ui-dialog-helm/files/lib/hlm-dialog-overlay.directive.ts.template +8 -8
  60. package/src/generators/ui/libs/ui-dialog-helm/files/lib/hlm-dialog-title.directive.ts.template +2 -4
  61. package/src/generators/ui/libs/ui-dialog-helm/files/lib/hlm-dialog.component.ts.template +1 -2
  62. package/src/generators/ui/libs/ui-dialog-helm/files/lib/hlm-dialog.service.ts.template +35 -0
  63. package/src/generators/ui/libs/ui-hover-card-helm/files/lib/hlm-hover-card-content.component.ts.template +2 -4
  64. package/src/generators/ui/libs/ui-icon-helm/files/lib/hlm-icon.component.ts.template +4 -4
  65. package/src/generators/ui/libs/ui-input-helm/files/lib/hlm-input-error.directive.ts.template +2 -2
  66. package/src/generators/ui/libs/ui-input-helm/files/lib/hlm-input.directive.ts.template +2 -2
  67. package/src/generators/ui/libs/ui-label-helm/files/lib/hlm-label.directive.ts.template +2 -2
  68. package/src/generators/ui/libs/ui-menu-helm/files/lib/hlm-menu-bar-item.directive.ts.template +2 -2
  69. package/src/generators/ui/libs/ui-menu-helm/files/lib/hlm-menu-bar.component.ts.template +2 -2
  70. package/src/generators/ui/libs/ui-menu-helm/files/lib/hlm-menu-item-check.component.ts.template +2 -2
  71. package/src/generators/ui/libs/ui-menu-helm/files/lib/hlm-menu-item-checkbox.directive.ts.template +2 -2
  72. package/src/generators/ui/libs/ui-menu-helm/files/lib/hlm-menu-item-icon.directive.ts.template +2 -2
  73. package/src/generators/ui/libs/ui-menu-helm/files/lib/hlm-menu-item-radio.component.ts.template +2 -2
  74. package/src/generators/ui/libs/ui-menu-helm/files/lib/hlm-menu-item-radio.directive.ts.template +2 -2
  75. package/src/generators/ui/libs/ui-menu-helm/files/lib/hlm-menu-item-sub-indicator.component.ts.template +2 -2
  76. package/src/generators/ui/libs/ui-menu-helm/files/lib/hlm-menu-item.directive.ts.template +2 -2
  77. package/src/generators/ui/libs/ui-menu-helm/files/lib/hlm-menu-label.component.ts.template +2 -2
  78. package/src/generators/ui/libs/ui-menu-helm/files/lib/hlm-menu-separator.component.ts.template +2 -2
  79. package/src/generators/ui/libs/ui-menu-helm/files/lib/hlm-menu-shortcut.component.ts.template +2 -2
  80. package/src/generators/ui/libs/ui-menu-helm/files/lib/hlm-menu.component.ts.template +2 -2
  81. package/src/generators/ui/libs/ui-menu-helm/files/lib/hlm-sub-menu.component.ts.template +2 -2
  82. package/src/generators/ui/libs/ui-popover-helm/files/lib/hlm-popover-close.directive.ts.template +2 -2
  83. package/src/generators/ui/libs/ui-popover-helm/files/lib/hlm-popover-content.directive.ts.template +2 -2
  84. package/src/generators/ui/libs/ui-progress-helm/files/lib/hlm-progress-indicator.directive.ts.template +2 -2
  85. package/src/generators/ui/libs/ui-progress-helm/files/lib/hlm-progress.directive.ts.template +2 -2
  86. package/src/generators/ui/libs/ui-radio-group-helm/files/lib/hlm-radio-group.directive.ts.template +2 -2
  87. package/src/generators/ui/libs/ui-radio-group-helm/files/lib/hlm-radio-indicator.component.ts.template +2 -2
  88. package/src/generators/ui/libs/ui-radio-group-helm/files/lib/hlm-radio.directive.ts.template +2 -2
  89. package/src/generators/ui/libs/ui-select-helm/files/lib/hlm-select-label.directive.ts.template +1 -1
  90. package/src/generators/ui/libs/ui-select-helm/files/lib/hlm-select-option.component.ts.template +2 -2
  91. package/src/generators/ui/libs/ui-select-helm/files/lib/hlm-select-trigger.component.ts.template +3 -3
  92. package/src/generators/ui/libs/ui-separator-helm/files/lib/hlm-separator.directive.ts.template +2 -2
  93. package/src/generators/ui/libs/ui-sheet-helm/files/lib/hlm-sheet-close.directive.ts.template +2 -2
  94. package/src/generators/ui/libs/ui-sheet-helm/files/lib/hlm-sheet-content.component.ts.template +2 -2
  95. package/src/generators/ui/libs/ui-sheet-helm/files/lib/hlm-sheet-description.directive.ts.template +2 -2
  96. package/src/generators/ui/libs/ui-sheet-helm/files/lib/hlm-sheet-footer.component.ts.template +2 -2
  97. package/src/generators/ui/libs/ui-sheet-helm/files/lib/hlm-sheet-header.component.ts.template +2 -2
  98. package/src/generators/ui/libs/ui-sheet-helm/files/lib/hlm-sheet-overlay.directive.ts.template +2 -2
  99. package/src/generators/ui/libs/ui-sheet-helm/files/lib/hlm-sheet-title.directive.ts.template +2 -2
  100. package/src/generators/ui/libs/ui-sheet-helm/files/lib/hlm-sheet.component.ts.template +1 -2
  101. package/src/generators/ui/libs/ui-skeleton-helm/files/lib/hlm-skeleton.component.ts.template +2 -2
  102. package/src/generators/ui/libs/ui-spinner-helm/files/lib/hlm-spinner.component.ts.template +2 -2
  103. package/src/generators/ui/libs/ui-switch-helm/files/lib/hlm-switch-thumb.directive.ts.template +2 -2
  104. package/src/generators/ui/libs/ui-switch-helm/files/lib/hlm-switch.component.ts.template +2 -2
  105. package/src/generators/ui/libs/ui-table-helm/files/lib/hlm-caption.component.ts.template +3 -3
  106. package/src/generators/ui/libs/ui-table-helm/files/lib/hlm-table.component.ts.template +3 -3
  107. package/src/generators/ui/libs/ui-table-helm/files/lib/hlm-td.component.ts.template +3 -3
  108. package/src/generators/ui/libs/ui-table-helm/files/lib/hlm-th.component.ts.template +3 -3
  109. package/src/generators/ui/libs/ui-table-helm/files/lib/hlm-trow.component.ts.template +2 -2
  110. package/src/generators/ui/libs/ui-tabs-helm/files/lib/hlm-tabs-content.directive.ts.template +2 -2
  111. package/src/generators/ui/libs/ui-tabs-helm/files/lib/hlm-tabs-list.component.ts.template +2 -2
  112. package/src/generators/ui/libs/ui-tabs-helm/files/lib/hlm-tabs-trigger.directive.ts.template +2 -2
  113. package/src/generators/ui/libs/ui-toggle-helm/files/lib/hlm-toggle-group.directive.ts.template +2 -2
  114. package/src/generators/ui/libs/ui-toggle-helm/files/lib/hlm-toggle.directive.ts.template +2 -2
  115. package/src/generators/ui/libs/ui-typography-helm/files/lib/hlm-blockquote.directive.ts.template +2 -2
  116. package/src/generators/ui/libs/ui-typography-helm/files/lib/hlm-code.directive.ts.template +2 -2
  117. package/src/generators/ui/libs/ui-typography-helm/files/lib/hlm-h1.directive.ts.template +2 -2
  118. package/src/generators/ui/libs/ui-typography-helm/files/lib/hlm-h2.directive.ts.template +2 -2
  119. package/src/generators/ui/libs/ui-typography-helm/files/lib/hlm-h3.directive.ts.template +2 -2
  120. package/src/generators/ui/libs/ui-typography-helm/files/lib/hlm-h4.directive.ts.template +2 -2
  121. package/src/generators/ui/libs/ui-typography-helm/files/lib/hlm-large.directive.ts.template +2 -2
  122. package/src/generators/ui/libs/ui-typography-helm/files/lib/hlm-lead.directive.ts.template +2 -2
  123. package/src/generators/ui/libs/ui-typography-helm/files/lib/hlm-muted.directive.ts.template +2 -2
  124. package/src/generators/ui/libs/ui-typography-helm/files/lib/hlm-p.directive.ts.template +2 -2
  125. package/src/generators/ui/libs/ui-typography-helm/files/lib/hlm-small.directive.ts.template +2 -2
  126. package/src/generators/ui/libs/ui-typography-helm/files/lib/hlm-ul.directive.ts.template +2 -2
  127. package/src/generators/ui/supported-ui-libraries.json +51 -50
  128. package/src/utils/get-project-names.js.map +1 -1
  129. package/src/utils/version-utils.js.map +1 -1
@@ -27,14 +27,19 @@ export const HLM_CHECKBOX_VALUE_ACCESSOR = {
27
27
  imports: [BrnCheckboxComponent, HlmCheckboxCheckIconComponent],
28
28
  template: `
29
29
  <brn-checkbox
30
+ [id]="id()"
31
+ [name]="name()"
30
32
  [class]="_computedClass()"
31
33
  [checked]="_checked()"
34
+ [disabled]="disabled()"
35
+ [required]="required()"
36
+ [aria-label]="ariaLabel()"
37
+ [aria-labelledby]="ariaLabelledby()"
38
+ [aria-describedby]="ariaDescribedby()"
32
39
  (changed)="_handleChange()"
33
40
  (touched)="_onTouched()"
34
- [disabled]="_disabled()"
35
- [id]="id"
36
41
  >
37
- <hlm-checkbox-checkicon [class]="_checkIconClass()" [iconName]="_checkIconName()" />
42
+ <hlm-checkbox-checkicon [class]="checkIconClass()" [iconName]="checkIconName()" />
38
43
  </brn-checkbox>
39
44
  `,
40
45
  host: {
@@ -47,33 +52,41 @@ export const HLM_CHECKBOX_VALUE_ACCESSOR = {
47
52
  providers: [HLM_CHECKBOX_VALUE_ACCESSOR],
48
53
  })
49
54
  export class HlmCheckboxComponent {
50
- private readonly _userClass = input<ClassValue>('', { alias: 'class' });
55
+ public readonly userClass = input<ClassValue>('', { alias: 'class' });
51
56
  protected _computedClass = computed(() =>
52
57
  hlm(
53
58
  'group inline-flex border border-foreground shrink-0 cursor-pointer items-center rounded-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring' +
54
59
  ' focus-visible:ring-offset-2 focus-visible:ring-offset-background data-[state=checked]:text-background data-[state=checked]:bg-primary data-[state=unchecked]:bg-background',
55
- this._disabled() ? 'cursor-not-allowed opacity-50' : '',
56
- this._userClass(),
60
+ this.userClass(),
61
+ this.disabled() ? 'cursor-not-allowed opacity-50' : '',
57
62
  ),
58
63
  );
59
64
 
60
- protected readonly _checkIconName = signal<string>('lucideCheck');
61
- @Input()
62
- set checkIconName(checkIconName: string) {
63
- this._checkIconName.set(checkIconName);
64
- }
65
+ /** Used to set the id on the underlying brn element. */
66
+ public readonly id = input<string | null>(null);
65
67
 
66
- protected readonly _checkIconClass = signal<string>('');
67
- @Input()
68
- set checkIconClass(checkIconName: string) {
69
- this._checkIconClass.set(checkIconName);
70
- }
68
+ /** Used to set the aria-label attribute on the underlying brn element. */
69
+ public readonly ariaLabel = input<string | null>(null, { alias: 'aria-label' });
70
+
71
+ /** Used to set the aria-labelledby attribute on the underlying brn element. */
72
+ public readonly ariaLabelledby = input<string | null>(null, { alias: 'aria-labelledby' });
73
+
74
+ /** Used to set the aria-describedby attribute on the underlying brn element. */
75
+ public readonly ariaDescribedby = input<string | null>(null, { alias: 'aria-describedby' });
76
+
77
+ public readonly name = input<string | null>(null);
78
+ public readonly disabled = input(false, { transform: booleanAttribute });
79
+ public readonly required = input(false, { transform: booleanAttribute });
80
+
81
+ // icon inputs
82
+ public readonly checkIconName = input<string>('lucideCheck');
83
+ public readonly checkIconClass = input<string>('');
71
84
 
72
85
  @Output()
73
86
  public changed = new EventEmitter<boolean>();
74
87
 
75
88
  protected _handleChange(): void {
76
- if (this._disabled()) return;
89
+ if (this.disabled()) return;
77
90
 
78
91
  const previousChecked = this._checked();
79
92
  this._checked.set(previousChecked === 'indeterminate' ? true : !previousChecked);
@@ -81,34 +94,13 @@ export class HlmCheckboxComponent {
81
94
  this.changed.emit(!previousChecked);
82
95
  }
83
96
 
97
+ // TODO should be changed to new model input when updated to Angular 17.2
84
98
  protected _checked = signal<boolean | 'indeterminate'>(false);
85
99
  @Input({ transform: indeterminateBooleanAttribute })
86
100
  set checked(value: boolean | 'indeterminate') {
87
101
  this._checked.set(value);
88
102
  }
89
103
 
90
- protected readonly _disabled = signal(false);
91
- @Input({ transform: booleanAttribute })
92
- set disabled(value: boolean) {
93
- this._disabled.set(value);
94
- }
95
-
96
- /** Used to set the id on the underlying brn element. */
97
- @Input()
98
- id: string | null = null;
99
-
100
- /** Used to set the aria-label attribute on the underlying brn element. */
101
- @Input('aria-label')
102
- ariaLabel: string | null = null;
103
-
104
- /** Used to set the aria-labelledby attribute on the underlying brn element. */
105
- @Input('aria-labelledby')
106
- ariaLabelledby: string | null = null;
107
-
108
- /** Used to set the aria-describedby attribute on the underlying brn element. */
109
- @Input('aria-describedby')
110
- ariaDescribedby: string | null = null;
111
-
112
104
  /** CONROL VALUE ACCESSOR */
113
105
 
114
106
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -17,6 +17,6 @@ export class HlmCommandDialogCloseButtonDirective {
17
17
  this._hlmBtn.variant = 'ghost';
18
18
  }
19
19
 
20
- private readonly _userClass = input<ClassValue>('', { alias: 'class' });
21
- protected _computedClass = computed(() => hlm('!p-1 !h-5 !w-5', this._userClass()));
20
+ public readonly userClass = input<ClassValue>('', { alias: 'class' });
21
+ protected _computedClass = computed(() => hlm('!p-1 !h-5 !w-5', this.userClass()));
22
22
  }
@@ -17,11 +17,11 @@ export class HlmCommandDialogDirective {
17
17
  private _renderer = inject(Renderer2);
18
18
  private _element = inject(ElementRef);
19
19
 
20
- private readonly _userClass = input<ClassValue>('', { alias: 'class' });
20
+ public readonly userClass = input<ClassValue>('', { alias: 'class' });
21
21
  protected _computedClass = computed(() =>
22
22
  hlm(
23
23
  '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-[state=closed]:slide-out-to-top-[2%] data-[state=open]:slide-in-from-top-[2%]',
24
- this._userClass(),
24
+ this.userClass(),
25
25
  ),
26
26
  );
27
27
 
@@ -10,6 +10,6 @@ import { ClassValue } from 'clsx';
10
10
  },
11
11
  })
12
12
  export class HlmCommandEmptyDirective {
13
- private readonly _userClass = input<ClassValue>('', { alias: 'class' });
14
- protected _computedClass = computed(() => hlm('py-6 text-center text-sm', this._userClass()));
13
+ public readonly userClass = input<ClassValue>('', { alias: 'class' });
14
+ protected _computedClass = computed(() => hlm('py-6 text-center text-sm', this.userClass()));
15
15
  }
@@ -10,13 +10,13 @@ import { ClassValue } from 'clsx';
10
10
  },
11
11
  })
12
12
  export class HlmCommandGroupDirective {
13
- private readonly _userClass = input<ClassValue>('', { alias: 'class' });
13
+ public readonly userClass = input<ClassValue>('', { alias: 'class' });
14
14
  protected _computedClass = computed(() =>
15
15
  hlm(
16
16
  'block [&[cmdk-hidden="true"]]:hidden\n' +
17
17
  '[&_.cmdk-group-label]:px-2 [&_.cmdk-group-label]:py-1.5 [&_.cmdk-group-label]:text-xs [&_.cmdk-group-label]:font-medium [&_.cmdk-group-label]:text-muted-foreground\n' +
18
18
  '[&_.cmdk-group-content]:flex [&_.cmdk-group-content]:flex-col [&_.cmdk-group-content]:flex-col overflow-hidden p-1 text-foreground',
19
- this._userClass(),
19
+ this.userClass(),
20
20
  ),
21
21
  );
22
22
  }
@@ -11,8 +11,8 @@ import { ClassValue } from 'clsx';
11
11
  },
12
12
  })
13
13
  export class HlmCommandInputWrapperComponent {
14
- private readonly _userClass = input<ClassValue>('', { alias: 'class' });
14
+ public readonly userClass = input<ClassValue>('', { alias: 'class' });
15
15
  protected _computedClass = computed(() =>
16
- hlm('flex space-x-2 items-center border-b border-border px-3 [&_hlm-icon]:h-5 [&_hlm-icon]:w-5', this._userClass()),
16
+ hlm('flex space-x-2 items-center border-b border-border px-3 [&_hlm-icon]:h-5 [&_hlm-icon]:w-5', this.userClass()),
17
17
  );
18
18
  }
@@ -10,12 +10,12 @@ import { ClassValue } from 'clsx';
10
10
  },
11
11
  })
12
12
  export class HlmCommandInputDirective {
13
- private readonly _userClass = input<ClassValue>('', { alias: 'class' });
13
+ public readonly userClass = input<ClassValue>('', { alias: 'class' });
14
14
 
15
15
  protected _computedClass = computed(() =>
16
16
  hlm(
17
17
  'h-11 w-full bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50',
18
- this._userClass(),
18
+ this.userClass(),
19
19
  ),
20
20
  );
21
21
  }
@@ -18,6 +18,6 @@ export class HlmCommandItemIconDirective {
18
18
  this._menuIcon.size = 'none';
19
19
  }
20
20
 
21
- private readonly _userClass = input<ClassValue>('', { alias: 'class' });
22
- protected _computedClass = computed(() => hlm('mr-2 h-4 w-4', this._userClass()));
21
+ public readonly userClass = input<ClassValue>('', { alias: 'class' });
22
+ protected _computedClass = computed(() => hlm('mr-2 h-4 w-4', this.userClass()));
23
23
  }
@@ -14,7 +14,7 @@ import { ClassValue } from 'clsx';
14
14
  },
15
15
  })
16
16
  export class HlmCommandItemDirective {
17
- private readonly _userClass = input<ClassValue>('', { alias: 'class' });
17
+ public readonly userClass = input<ClassValue>('', { alias: 'class' });
18
18
 
19
19
  protected _computedClass = computed(() =>
20
20
  hlm(
@@ -22,7 +22,7 @@ export class HlmCommandItemDirective {
22
22
  'aria-selected:bg-accent aria-selected:text-accent-foreground\n' +
23
23
  'hover:bg-accent/50\n' +
24
24
  'disabled:pointer-events-none disabled:opacity-50',
25
- this._userClass(),
25
+ this.userClass(),
26
26
  ),
27
27
  );
28
28
  }
@@ -10,6 +10,6 @@ import { ClassValue } from 'clsx';
10
10
  },
11
11
  })
12
12
  export class HlmCommandListDirective {
13
- private readonly _userClass = input<ClassValue>('', { alias: 'class' });
14
- protected _computedClass = computed(() => hlm('max-h-[300px] overflow-y-auto overflow-x-hidden', this._userClass()));
13
+ public readonly userClass = input<ClassValue>('', { alias: 'class' });
14
+ protected _computedClass = computed(() => hlm('max-h-[300px] overflow-y-auto overflow-x-hidden', this.userClass()));
15
15
  }
@@ -13,8 +13,8 @@ import { ClassValue } from 'clsx';
13
13
  },
14
14
  })
15
15
  export class HlmCommandShortcutComponent {
16
- private readonly _userClass = input<ClassValue>('', { alias: 'class' });
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('ml-auto font-light text-xs tracking-widest opacity-60', this.userClass()),
19
19
  );
20
20
  }
@@ -10,11 +10,11 @@ import { ClassValue } from 'clsx';
10
10
  },
11
11
  })
12
12
  export class HlmCommandDirective {
13
- private readonly _userClass = input<ClassValue>('', { alias: 'class' });
13
+ public readonly userClass = input<ClassValue>('', { alias: 'class' });
14
14
  protected _computedClass = computed(() =>
15
15
  hlm(
16
16
  'flex h-full w-full flex-col overflow-hidden rounded-md border border-border bg-popover text-popover-foreground',
17
- this._userClass(),
17
+ this.userClass(),
18
18
  ),
19
19
  );
20
20
  }
@@ -17,6 +17,7 @@ export * from './lib/hlm-dialog-header.component';
17
17
  export * from './lib/hlm-dialog-overlay.directive';
18
18
  export * from './lib/hlm-dialog-title.directive';
19
19
  export * from './lib/hlm-dialog.component';
20
+ export * from './lib/hlm-dialog.service';
20
21
 
21
22
  export const HlmDialogImports = [
22
23
  HlmDialogComponent,
@@ -10,11 +10,11 @@ import { ClassValue } from 'clsx';
10
10
  },
11
11
  })
12
12
  export class HlmDialogCloseDirective {
13
- private readonly _userClass = input<ClassValue>('', { alias: 'class' });
13
+ public readonly userClass = input<ClassValue>('', { alias: 'class' });
14
14
  protected _computedClass = computed(() =>
15
15
  hlm(
16
16
  'absolute 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',
17
- this._userClass(),
17
+ this.userClass(),
18
18
  ),
19
19
  );
20
20
  }
@@ -1,7 +1,8 @@
1
- import { ChangeDetectionStrategy, Component, ViewEncapsulation, computed, input, signal } from '@angular/core';
1
+ import { NgComponentOutlet } from '@angular/common';
2
+ import { ChangeDetectionStrategy, Component, computed, inject, input, ViewEncapsulation } from '@angular/core';
2
3
  import { lucideX } from '@ng-icons/lucide';
3
- import { hlm, injectExposesStateProvider } from '@spartan-ng/ui-core';
4
- import { BrnDialogCloseDirective } from '@spartan-ng/ui-dialog-brain';
4
+ import { hlm } from '@spartan-ng/ui-core';
5
+ import { BrnDialogCloseDirective, BrnDialogRef, injectBrnDialogContext } from '@spartan-ng/ui-dialog-brain';
5
6
  import { HlmIconComponent, provideIcons } from '@spartan-ng/ui-icon-helm';
6
7
  import { ClassValue } from 'clsx';
7
8
  import { HlmDialogCloseDirective } from './hlm-dialog-close.directive';
@@ -9,31 +10,42 @@ import { HlmDialogCloseDirective } from './hlm-dialog-close.directive';
9
10
  @Component({
10
11
  selector: 'hlm-dialog-content',
11
12
  standalone: true,
12
- imports: [BrnDialogCloseDirective, HlmDialogCloseDirective, HlmIconComponent],
13
+ imports: [NgComponentOutlet, BrnDialogCloseDirective, HlmDialogCloseDirective, HlmIconComponent],
13
14
  providers: [provideIcons({ lucideX })],
14
15
  host: {
15
16
  '[class]': '_computedClass()',
16
17
  '[attr.data-state]': 'state()',
17
18
  },
18
19
  template: `
19
- <ng-content />
20
+ @if (component) {
21
+ <ng-container [ngComponentOutlet]="component" />
22
+ } @else {
23
+ <ng-content />
24
+ }
25
+
20
26
  <button brnDialogClose hlm>
21
27
  <span class="sr-only">Close</span>
22
- <hlm-icon class="flex h-4 w-4" size="100%" name="lucideX" />
28
+ <hlm-icon class="flex h-4 w-4" size="none" name="lucideX" />
23
29
  </button>
24
30
  `,
25
31
  changeDetection: ChangeDetectionStrategy.OnPush,
26
32
  encapsulation: ViewEncapsulation.None,
27
33
  })
28
34
  export class HlmDialogContentComponent {
29
- private readonly _statusProvider = injectExposesStateProvider({ host: true });
30
- public readonly state = this._statusProvider.state ?? signal('closed').asReadonly();
35
+ private readonly _dialogRef = inject(BrnDialogRef);
36
+ private readonly _dialogContext = injectBrnDialogContext({ optional: true });
37
+
38
+ public readonly state = computed(() => this._dialogRef?.state() ?? 'closed');
39
+
40
+ public readonly component = this._dialogContext?.['$component'];
41
+ private readonly _dynamicComponentClass = this._dialogContext?.['$dynamicComponentClass'];
31
42
 
32
- private readonly _userClass = input<ClassValue>('', { alias: 'class' });
43
+ public readonly userClass = input<ClassValue>('', { alias: 'class' });
33
44
  protected readonly _computedClass = computed(() =>
34
45
  hlm(
35
46
  'border-border grid w-full max-w-lg relative gap-4 border bg-background p-6 shadow-lg duration-200 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-[state=closed]:slide-out-to-top-[2%] data-[state=open]:slide-in-from-top-[2%] sm:rounded-lg md:w-full',
36
- this._userClass(),
47
+ this.userClass(),
48
+ this._dynamicComponentClass,
37
49
  ),
38
50
  );
39
51
  }
@@ -12,6 +12,6 @@ import { ClassValue } from 'clsx';
12
12
  hostDirectives: [BrnDialogDescriptionDirective],
13
13
  })
14
14
  export class HlmDialogDescriptionDirective {
15
- private readonly _userClass = input<ClassValue>('', { alias: 'class' });
16
- protected _computedClass = computed(() => hlm('text-sm text-muted-foreground', this._userClass()));
15
+ public readonly userClass = input<ClassValue>('', { alias: 'class' });
16
+ protected _computedClass = computed(() => hlm('text-sm text-muted-foreground', this.userClass()));
17
17
  }
@@ -13,8 +13,8 @@ import { ClassValue } from 'clsx';
13
13
  },
14
14
  })
15
15
  export class HlmDialogFooterComponent {
16
- private readonly _userClass = input<ClassValue>('', { alias: 'class' });
16
+ public readonly userClass = input<ClassValue>('', { alias: 'class' });
17
17
  protected _computedClass = computed(() =>
18
- hlm('flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2', this._userClass()),
18
+ hlm('flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2', this.userClass()),
19
19
  );
20
20
  }
@@ -13,8 +13,8 @@ import { ClassValue } from 'clsx';
13
13
  },
14
14
  })
15
15
  export class HlmDialogHeaderComponent {
16
- private readonly _userClass = input<ClassValue>('', { alias: 'class' });
16
+ public readonly userClass = input<ClassValue>('', { alias: 'class' });
17
17
  protected _computedClass = computed(() =>
18
- hlm('flex flex-col space-y-1.5 text-center sm:text-left', this._userClass()),
18
+ hlm('flex flex-col space-y-1.5 text-center sm:text-left', this.userClass()),
19
19
  );
20
20
  }
@@ -2,6 +2,9 @@ import { computed, Directive, effect, input } from '@angular/core';
2
2
  import { hlm, injectCustomClassSettable } from '@spartan-ng/ui-core';
3
3
  import { ClassValue } from 'clsx';
4
4
 
5
+ export const hlmDialogOverlayClass =
6
+ 'bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0';
7
+
5
8
  @Directive({
6
9
  selector: '[hlmDialogOverlay],brn-dialog-overlay[hlm]',
7
10
  standalone: true,
@@ -9,15 +12,12 @@ import { ClassValue } from 'clsx';
9
12
  export class HlmDialogOverlayDirective {
10
13
  private readonly _classSettable = injectCustomClassSettable({ optional: true, host: true });
11
14
 
12
- private readonly _userClass = input<ClassValue>('', { alias: 'class' });
13
- protected readonly _computedClass = computed(() =>
14
- hlm(
15
- 'bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0',
16
- this._userClass(),
17
- ),
18
- );
15
+ public readonly userClass = input<ClassValue>('', { alias: 'class' });
16
+ protected readonly _computedClass = computed(() => hlm(hlmDialogOverlayClass, this.userClass()));
19
17
 
20
18
  constructor() {
21
- effect(() => this._classSettable?.setClassToCustomElement(this._computedClass()));
19
+ effect(() => {
20
+ this._classSettable?.setClassToCustomElement(this._computedClass());
21
+ });
22
22
  }
23
23
  }
@@ -12,8 +12,6 @@ import { ClassValue } from 'clsx';
12
12
  hostDirectives: [BrnDialogTitleDirective],
13
13
  })
14
14
  export class HlmDialogTitleDirective {
15
- private readonly _userClass = input<ClassValue>('', { alias: 'class' });
16
- protected _computedClass = computed(() =>
17
- hlm('text-lg font-semibold leading-none tracking-tight', this._userClass()),
18
- );
15
+ public readonly userClass = input<ClassValue>('', { alias: 'class' });
16
+ protected _computedClass = computed(() => hlm('text-lg font-semibold leading-none tracking-tight', this.userClass()));
19
17
  }
@@ -1,5 +1,5 @@
1
1
  import { ChangeDetectionStrategy, Component, forwardRef, ViewEncapsulation } from '@angular/core';
2
- import { BrnDialogComponent, BrnDialogOverlayComponent, provideBrnDialog } from '@spartan-ng/ui-dialog-brain';
2
+ import { BrnDialogComponent, BrnDialogOverlayComponent } from '@spartan-ng/ui-dialog-brain';
3
3
  import { HlmDialogOverlayDirective } from './hlm-dialog-overlay.directive';
4
4
 
5
5
  @Component({
@@ -7,7 +7,6 @@ import { HlmDialogOverlayDirective } from './hlm-dialog-overlay.directive';
7
7
  standalone: true,
8
8
  imports: [BrnDialogComponent, BrnDialogOverlayComponent, HlmDialogOverlayDirective],
9
9
  providers: [
10
- provideBrnDialog(),
11
10
  {
12
11
  provide: BrnDialogComponent,
13
12
  useExisting: forwardRef(() => HlmDialogComponent),
@@ -0,0 +1,35 @@
1
+ import { ComponentType } from '@angular/cdk/portal';
2
+ import { inject, Injectable, TemplateRef } from '@angular/core';
3
+ import {
4
+ BrnDialogOptions,
5
+ BrnDialogService,
6
+ cssClassesToArray,
7
+ DEFAULT_BRN_DIALOG_OPTIONS,
8
+ } from '@spartan-ng/ui-dialog-brain';
9
+ import { HlmDialogContentComponent } from './hlm-dialog-content.component';
10
+ import { hlmDialogOverlayClass } from './hlm-dialog-overlay.directive';
11
+
12
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
13
+ export type HlmDialogOptions<DialogContext = any> = BrnDialogOptions & {
14
+ contentClass?: string;
15
+ context?: DialogContext;
16
+ };
17
+
18
+ @Injectable({
19
+ providedIn: 'root',
20
+ })
21
+ export class HlmDialogService {
22
+ private readonly _brnDialogService = inject(BrnDialogService);
23
+
24
+ public open(component: ComponentType<unknown> | TemplateRef<unknown>, options?: Partial<HlmDialogOptions>) {
25
+ options = {
26
+ ...DEFAULT_BRN_DIALOG_OPTIONS,
27
+ closeDelay: 100,
28
+ ...(options ?? {}),
29
+ backdropClass: cssClassesToArray(`${hlmDialogOverlayClass} ${options?.backdropClass ?? ''}`),
30
+ context: { ...options?.context, $component: component, $dynamicComponentClass: options?.contentClass },
31
+ };
32
+
33
+ return this._brnDialogService.open(HlmDialogContentComponent, undefined, options.context, options);
34
+ }
35
+ }
@@ -16,8 +16,6 @@ export class HlmHoverCardContentComponent {
16
16
  private readonly _renderer = inject(Renderer2);
17
17
  private readonly _element = inject(ElementRef);
18
18
 
19
- private _inputs: ClassValue = '';
20
-
21
19
  public readonly state = injectExposesStateProvider({ host: true }).state ?? signal('closed').asReadonly();
22
20
  public readonly side = injectExposedSideProvider({ host: true }).side ?? signal('bottom').asReadonly();
23
21
 
@@ -28,12 +26,12 @@ export class HlmHoverCardContentComponent {
28
26
  });
29
27
  }
30
28
 
31
- private readonly _userClass = input<ClassValue>('', { alias: 'class' });
29
+ public readonly userClass = input<ClassValue>('', { alias: 'class' });
32
30
  protected readonly _computedClass = computed(() =>
33
31
  hlm(
34
32
  'z-50 w-64 rounded-md border border-border bg-popover p-4 text-popover-foreground shadow-md outline-none',
35
33
  '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',
36
- this._inputs,
34
+ this.userClass(),
37
35
  ),
38
36
  );
39
37
  }
@@ -81,11 +81,11 @@ export class HlmIconComponent implements OnDestroy {
81
81
 
82
82
  protected readonly _computedClass = computed(() => {
83
83
  const size: IconSize = this._size();
84
+ const hostClasses = this._hostClasses();
85
+ const userCls = this.userCls();
84
86
  const variant = isDefinedSize(size) ? size : 'none';
85
- const hostClasses =
86
- variant === 'none' ? this._hostClasses().replace(TAILWIND_H_W_PATTERN, '') : this._hostClasses();
87
-
88
- return hlm(iconVariants({ variant }), this.userCls(), hostClasses);
87
+ const classes = variant === 'none' && size === 'none' ? hostClasses : hostClasses.replace(TAILWIND_H_W_PATTERN, '');
88
+ return hlm(iconVariants({ variant }), userCls, classes);
89
89
  });
90
90
 
91
91
  constructor() {
@@ -17,6 +17,6 @@ export type InputErrorVariants = VariantProps<typeof inputErrorVariants>;
17
17
  },
18
18
  })
19
19
  export class HlmInputErrorDirective {
20
- private readonly _userClass = input<ClassValue>('', { alias: 'class' });
21
- protected _computedClass = computed(() => hlm(inputErrorVariants(), this._userClass()));
20
+ public readonly userClass = input<ClassValue>('', { alias: 'class' });
21
+ protected _computedClass = computed(() => hlm(inputErrorVariants(), this.userClass()));
22
22
  }
@@ -45,8 +45,8 @@ export class HlmInputDirective {
45
45
  this._error.set(value);
46
46
  }
47
47
 
48
- private readonly _userClass = input<ClassValue>('', { alias: 'class' });
48
+ public readonly userClass = input<ClassValue>('', { alias: 'class' });
49
49
  protected _computedClass = computed(() =>
50
- hlm(inputVariants({ size: this._size(), error: this._error() }), this._userClass()),
50
+ hlm(inputVariants({ size: this._size(), error: this._error() }), this.userClass()),
51
51
  );
52
52
  }
@@ -45,7 +45,7 @@ export type LabelVariants = VariantProps<typeof labelVariants>;
45
45
  export class HlmLabelDirective {
46
46
  private readonly _brn = inject(BrnLabelDirective, { host: true });
47
47
 
48
- private readonly _userClass = input<ClassValue>('', { alias: 'class' });
48
+ public readonly userClass = input<ClassValue>('', { alias: 'class' });
49
49
  protected readonly _computedClass = computed(() =>
50
50
  hlm(
51
51
  labelVariants({
@@ -53,7 +53,7 @@ export class HlmLabelDirective {
53
53
  error: this._error(),
54
54
  disabled: this._brn?.dataDisabled() ?? 'auto',
55
55
  }),
56
- this._userClass(),
56
+ this.userClass(),
57
57
  ),
58
58
  );
59
59
 
@@ -12,11 +12,11 @@ import { ClassValue } from 'clsx';
12
12
  hostDirectives: [BrnMenuItemDirective],
13
13
  })
14
14
  export class HlmMenuBarItemDirective {
15
- private readonly _userClass = input<ClassValue>('', { alias: 'class' });
15
+ public readonly userClass = input<ClassValue>('', { alias: 'class' });
16
16
  protected _computedClass = computed(() =>
17
17
  hlm(
18
18
  'flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground aria-expanded:bg-accent aria-expanded:text-accent-foreground',
19
- this._userClass(),
19
+ this.userClass(),
20
20
  ),
21
21
  );
22
22
  }
@@ -13,8 +13,8 @@ import { ClassValue } from 'clsx';
13
13
  template: '<ng-content/>',
14
14
  })
15
15
  export class HlmMenuBarComponent {
16
- private readonly _userClass = input<ClassValue>('', { alias: 'class' });
16
+ public readonly userClass = input<ClassValue>('', { alias: 'class' });
17
17
  protected _computedClass = computed(() =>
18
- hlm('border-border flex h-10 items-center space-x-1 rounded-md border bg-background p-1', this._userClass()),
18
+ hlm('border-border flex h-10 items-center space-x-1 rounded-md border bg-background p-1', this.userClass()),
19
19
  );
20
20
  }
@@ -18,11 +18,11 @@ import { ClassValue } from 'clsx';
18
18
  },
19
19
  })
20
20
  export class HlmMenuItemCheckComponent {
21
- private readonly _userClass = input<ClassValue>('', { alias: 'class' });
21
+ public readonly userClass = input<ClassValue>('', { alias: 'class' });
22
22
  protected _computedClass = computed(() =>
23
23
  hlm(
24
24
  'group-[.checked]:opacity-100 opacity-0 absolute left-2 flex h-3.5 w-3.5 items-center justify-center',
25
- this._userClass(),
25
+ this.userClass(),
26
26
  ),
27
27
  );
28
28
  }
@@ -18,11 +18,11 @@ import { ClassValue } from 'clsx';
18
18
  ],
19
19
  })
20
20
  export class HlmMenuItemCheckboxDirective {
21
- private readonly _userClass = input<ClassValue>('', { alias: 'class' });
21
+ public readonly userClass = input<ClassValue>('', { alias: 'class' });
22
22
  protected _computedClass = computed(() =>
23
23
  hlm(
24
24
  'group w-full relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 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',
25
- this._userClass(),
25
+ this.userClass(),
26
26
  ),
27
27
  );
28
28
  }
@@ -18,6 +18,6 @@ export class HlmMenuItemIconDirective {
18
18
  this._menuIcon.size = 'none';
19
19
  }
20
20
 
21
- private readonly _userClass = input<ClassValue>('', { alias: 'class' });
22
- protected _computedClass = computed(() => hlm('mr-2 h-4 w-4', this._userClass()));
21
+ public readonly userClass = input<ClassValue>('', { alias: 'class' });
22
+ protected _computedClass = computed(() => hlm('mr-2 h-4 w-4', this.userClass()));
23
23
  }