@spartan-ng/cli 0.0.1-alpha.583 → 0.0.1-alpha.585

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 (215) hide show
  1. package/package.json +1 -1
  2. package/src/generators/migrate-brain-imports/import-map.d.ts +0 -1
  3. package/src/generators/migrate-brain-imports/import-map.js +0 -1
  4. package/src/generators/migrate-brain-imports/import-map.js.map +1 -1
  5. package/src/generators/ui/libs/accordion/files/lib/hlm-accordion-content.ts.template +6 -13
  6. package/src/generators/ui/libs/accordion/files/lib/hlm-accordion-icon.ts.template +8 -13
  7. package/src/generators/ui/libs/accordion/files/lib/hlm-accordion-item.ts.template +5 -10
  8. package/src/generators/ui/libs/accordion/files/lib/hlm-accordion-trigger.ts.template +8 -11
  9. package/src/generators/ui/libs/accordion/files/lib/hlm-accordion.ts.template +5 -10
  10. package/src/generators/ui/libs/alert/files/lib/hlm-alert-description.ts.template +5 -13
  11. package/src/generators/ui/libs/alert/files/lib/hlm-alert-title.ts.template +5 -10
  12. package/src/generators/ui/libs/alert/files/lib/hlm-alert.ts.template +6 -7
  13. package/src/generators/ui/libs/alert-dialog/files/lib/hlm-alert-dialog-content.ts.template +8 -11
  14. package/src/generators/ui/libs/alert-dialog/files/lib/hlm-alert-dialog-description.ts.template +5 -6
  15. package/src/generators/ui/libs/alert-dialog/files/lib/hlm-alert-dialog-footer.ts.template +5 -8
  16. package/src/generators/ui/libs/alert-dialog/files/lib/hlm-alert-dialog-header.ts.template +5 -8
  17. package/src/generators/ui/libs/alert-dialog/files/lib/hlm-alert-dialog-title.ts.template +5 -6
  18. package/src/generators/ui/libs/aspect-ratio/files/lib/helm-aspect-ratio.ts.template +9 -15
  19. package/src/generators/ui/libs/autocomplete/files/lib/hlm-autocomplete-empty.ts.template +5 -8
  20. package/src/generators/ui/libs/autocomplete/files/lib/hlm-autocomplete-group.ts.template +5 -13
  21. package/src/generators/ui/libs/autocomplete/files/lib/hlm-autocomplete-item.ts.template +8 -16
  22. package/src/generators/ui/libs/autocomplete/files/lib/hlm-autocomplete-list.ts.template +5 -13
  23. package/src/generators/ui/libs/autocomplete/files/lib/hlm-autocomplete.ts.template +7 -13
  24. package/src/generators/ui/libs/avatar/files/lib/fallback/hlm-avatar-fallback.ts.template +5 -11
  25. package/src/generators/ui/libs/avatar/files/lib/hlm-avatar.ts.template +6 -11
  26. package/src/generators/ui/libs/avatar/files/lib/image/hlm-avatar-image.ts.template +6 -9
  27. package/src/generators/ui/libs/badge/files/lib/hlm-badge.ts.template +6 -7
  28. package/src/generators/ui/libs/breadcrumb/files/lib/hlm-breadcrumb-item.ts.template +5 -9
  29. package/src/generators/ui/libs/breadcrumb/files/lib/hlm-breadcrumb-link.ts.template +6 -9
  30. package/src/generators/ui/libs/breadcrumb/files/lib/hlm-breadcrumb-list.ts.template +5 -11
  31. package/src/generators/ui/libs/breadcrumb/files/lib/hlm-breadcrumb-page.ts.template +5 -7
  32. package/src/generators/ui/libs/breadcrumb/files/lib/hlm-breadcrumb-separator.ts.template +5 -7
  33. package/src/generators/ui/libs/breadcrumb/files/lib/hlm-breadcrumb.ts.template +1 -7
  34. package/src/generators/ui/libs/button/files/lib/hlm-button.ts.template +6 -9
  35. package/src/generators/ui/libs/button-group/files/lib/hlm-button-group-separator.ts.template +8 -12
  36. package/src/generators/ui/libs/button-group/files/lib/hlm-button-group-text.ts.template +8 -14
  37. package/src/generators/ui/libs/button-group/files/lib/hlm-button-group.ts.template +6 -9
  38. package/src/generators/ui/libs/card/files/lib/hlm-card-action.ts.template +5 -10
  39. package/src/generators/ui/libs/card/files/lib/hlm-card-content.ts.template +5 -8
  40. package/src/generators/ui/libs/card/files/lib/hlm-card-description.ts.template +5 -8
  41. package/src/generators/ui/libs/card/files/lib/hlm-card-footer.ts.template +5 -8
  42. package/src/generators/ui/libs/card/files/lib/hlm-card-header.ts.template +8 -13
  43. package/src/generators/ui/libs/card/files/lib/hlm-card-title.ts.template +5 -8
  44. package/src/generators/ui/libs/card/files/lib/hlm-card.ts.template +5 -8
  45. package/src/generators/ui/libs/carousel/files/lib/hlm-carousel-content.ts.template +5 -8
  46. package/src/generators/ui/libs/carousel/files/lib/hlm-carousel-item.ts.template +5 -8
  47. package/src/generators/ui/libs/carousel/files/lib/hlm-carousel-next.ts.template +1 -4
  48. package/src/generators/ui/libs/carousel/files/lib/hlm-carousel-previous.ts.template +1 -6
  49. package/src/generators/ui/libs/carousel/files/lib/hlm-carousel-slide-display.ts.template +0 -5
  50. package/src/generators/ui/libs/carousel/files/lib/hlm-carousel.ts.template +5 -6
  51. package/src/generators/ui/libs/collapsible/files/lib/hlm-collapsible-content.ts.template +5 -7
  52. package/src/generators/ui/libs/command/files/lib/hlm-command-dialog-close-button.ts.template +8 -13
  53. package/src/generators/ui/libs/command/files/lib/hlm-command-dialog.ts.template +7 -12
  54. package/src/generators/ui/libs/command/files/lib/hlm-command-empty.ts.template +5 -6
  55. package/src/generators/ui/libs/command/files/lib/hlm-command-group-label.ts.template +5 -11
  56. package/src/generators/ui/libs/command/files/lib/hlm-command-group.ts.template +5 -11
  57. package/src/generators/ui/libs/command/files/lib/hlm-command-icon.ts.template +5 -8
  58. package/src/generators/ui/libs/command/files/lib/hlm-command-item.ts.template +8 -14
  59. package/src/generators/ui/libs/command/files/lib/hlm-command-list.ts.template +5 -11
  60. package/src/generators/ui/libs/command/files/lib/hlm-command-search-input.ts.template +8 -14
  61. package/src/generators/ui/libs/command/files/lib/hlm-command-search.ts.template +5 -11
  62. package/src/generators/ui/libs/command/files/lib/hlm-command-separator.ts.template +5 -9
  63. package/src/generators/ui/libs/command/files/lib/hlm-command-shortcut.ts.template +5 -8
  64. package/src/generators/ui/libs/command/files/lib/hlm-command.ts.template +5 -11
  65. package/src/generators/ui/libs/dialog/files/lib/hlm-dialog-close.ts.template +8 -12
  66. package/src/generators/ui/libs/dialog/files/lib/hlm-dialog-content.ts.template +6 -10
  67. package/src/generators/ui/libs/dialog/files/lib/hlm-dialog-description.ts.template +5 -6
  68. package/src/generators/ui/libs/dialog/files/lib/hlm-dialog-footer.ts.template +5 -8
  69. package/src/generators/ui/libs/dialog/files/lib/hlm-dialog-header.ts.template +5 -8
  70. package/src/generators/ui/libs/dialog/files/lib/hlm-dialog-overlay.ts.template +2 -2
  71. package/src/generators/ui/libs/dialog/files/lib/hlm-dialog-title.ts.template +5 -6
  72. package/src/generators/ui/libs/dropdown-menu/files/lib/hlm-dropdown-menu-checkbox-indicator.ts.template +8 -13
  73. package/src/generators/ui/libs/dropdown-menu/files/lib/hlm-dropdown-menu-checkbox.ts.template +9 -13
  74. package/src/generators/ui/libs/dropdown-menu/files/lib/hlm-dropdown-menu-group.ts.template +5 -6
  75. package/src/generators/ui/libs/dropdown-menu/files/lib/hlm-dropdown-menu-item-sub-indicator.ts.template +5 -8
  76. package/src/generators/ui/libs/dropdown-menu/files/lib/hlm-dropdown-menu-item.ts.template +9 -12
  77. package/src/generators/ui/libs/dropdown-menu/files/lib/hlm-dropdown-menu-label.ts.template +5 -8
  78. package/src/generators/ui/libs/dropdown-menu/files/lib/hlm-dropdown-menu-radio-indicator.ts.template +8 -13
  79. package/src/generators/ui/libs/dropdown-menu/files/lib/hlm-dropdown-menu-radio.ts.template +9 -13
  80. package/src/generators/ui/libs/dropdown-menu/files/lib/hlm-dropdown-menu-separator.ts.template +5 -6
  81. package/src/generators/ui/libs/dropdown-menu/files/lib/hlm-dropdown-menu-shortcut.ts.template +5 -8
  82. package/src/generators/ui/libs/dropdown-menu/files/lib/hlm-dropdown-menu-sub.ts.template +7 -12
  83. package/src/generators/ui/libs/dropdown-menu/files/lib/hlm-dropdown-menu.ts.template +7 -12
  84. package/src/generators/ui/libs/empty/files/lib/hlm-empty-content.ts.template +5 -9
  85. package/src/generators/ui/libs/empty/files/lib/hlm-empty-description.ts.template +7 -12
  86. package/src/generators/ui/libs/empty/files/lib/hlm-empty-header.ts.template +5 -9
  87. package/src/generators/ui/libs/empty/files/lib/hlm-empty-media.ts.template +6 -9
  88. package/src/generators/ui/libs/empty/files/lib/hlm-empty-title.ts.template +5 -7
  89. package/src/generators/ui/libs/empty/files/lib/hlm-empty.ts.template +8 -12
  90. package/src/generators/ui/libs/field/files/lib/hlm-field-content.ts.template +5 -9
  91. package/src/generators/ui/libs/field/files/lib/hlm-field-description.ts.template +6 -11
  92. package/src/generators/ui/libs/field/files/lib/hlm-field-group.ts.template +8 -12
  93. package/src/generators/ui/libs/field/files/lib/hlm-field-label.ts.template +6 -11
  94. package/src/generators/ui/libs/field/files/lib/hlm-field-legend.ts.template +6 -9
  95. package/src/generators/ui/libs/field/files/lib/hlm-field-separator.ts.template +5 -9
  96. package/src/generators/ui/libs/field/files/lib/hlm-field-set.ts.template +6 -11
  97. package/src/generators/ui/libs/field/files/lib/hlm-field-title.ts.template +8 -12
  98. package/src/generators/ui/libs/field/files/lib/hlm-field.ts.template +5 -9
  99. package/src/generators/ui/libs/form-field/files/lib/hlm-error.ts.template +5 -10
  100. package/src/generators/ui/libs/form-field/files/lib/hlm-form-field.ts.template +3 -16
  101. package/src/generators/ui/libs/form-field/files/lib/hlm-hint.ts.template +5 -8
  102. package/src/generators/ui/libs/hover-card/files/lib/hlm-hover-card-content.ts.template +5 -11
  103. package/src/generators/ui/libs/input/files/lib/hlm-input.ts.template +4 -10
  104. package/src/generators/ui/libs/input-group/files/lib/hlm-input-group-addon.ts.template +5 -8
  105. package/src/generators/ui/libs/input-group/files/lib/hlm-input-group-button.ts.template +3 -12
  106. package/src/generators/ui/libs/input-group/files/lib/hlm-input-group-input.ts.template +3 -18
  107. package/src/generators/ui/libs/input-group/files/lib/hlm-input-group-text.ts.template +8 -14
  108. package/src/generators/ui/libs/input-group/files/lib/hlm-input-group-textarea.ts.template +6 -18
  109. package/src/generators/ui/libs/input-group/files/lib/hlm-input-group.ts.template +6 -12
  110. package/src/generators/ui/libs/input-otp/files/lib/hlm-input-otp-group.ts.template +5 -7
  111. package/src/generators/ui/libs/input-otp/files/lib/hlm-input-otp-separator.ts.template +5 -7
  112. package/src/generators/ui/libs/input-otp/files/lib/hlm-input-otp-slot.ts.template +6 -11
  113. package/src/generators/ui/libs/input-otp/files/lib/hlm-input-otp.ts.template +5 -9
  114. package/src/generators/ui/libs/item/files/lib/hlm-item-actions.ts.template +5 -6
  115. package/src/generators/ui/libs/item/files/lib/hlm-item-content.ts.template +5 -8
  116. package/src/generators/ui/libs/item/files/lib/hlm-item-description.ts.template +6 -10
  117. package/src/generators/ui/libs/item/files/lib/hlm-item-footer.ts.template +5 -8
  118. package/src/generators/ui/libs/item/files/lib/hlm-item-group.ts.template +6 -6
  119. package/src/generators/ui/libs/item/files/lib/hlm-item-header.ts.template +5 -8
  120. package/src/generators/ui/libs/item/files/lib/hlm-item-media.ts.template +6 -10
  121. package/src/generators/ui/libs/item/files/lib/hlm-item-separator.ts.template +6 -7
  122. package/src/generators/ui/libs/item/files/lib/hlm-item-title.ts.template +5 -8
  123. package/src/generators/ui/libs/item/files/lib/hlm-item.ts.template +6 -10
  124. package/src/generators/ui/libs/kbd/files/lib/hlm-kbd-group.ts.template +5 -6
  125. package/src/generators/ui/libs/kbd/files/lib/hlm-kbd.ts.template +6 -10
  126. package/src/generators/ui/libs/label/files/lib/hlm-label.ts.template +8 -14
  127. package/src/generators/ui/libs/menubar/files/lib/hlm-menubar-trigger.ts.template +6 -11
  128. package/src/generators/ui/libs/menubar/files/lib/hlm-menubar.ts.template +5 -8
  129. package/src/generators/ui/libs/navigation-menu/files/hlm-navigation-menu-content.ts.template +7 -13
  130. package/src/generators/ui/libs/navigation-menu/files/hlm-navigation-menu-item.ts.template +5 -8
  131. package/src/generators/ui/libs/navigation-menu/files/hlm-navigation-menu-link.ts.template +6 -12
  132. package/src/generators/ui/libs/navigation-menu/files/hlm-navigation-menu-list.ts.template +6 -12
  133. package/src/generators/ui/libs/navigation-menu/files/hlm-navigation-menu-trigger.ts.template +8 -13
  134. package/src/generators/ui/libs/navigation-menu/files/hlm-navigation-menu.ts.template +5 -10
  135. package/src/generators/ui/libs/pagination/files/lib/hlm-pagination-content.ts.template +5 -6
  136. package/src/generators/ui/libs/pagination/files/lib/hlm-pagination-ellipsis.ts.template +6 -6
  137. package/src/generators/ui/libs/pagination/files/lib/hlm-pagination-item.ts.template +5 -6
  138. package/src/generators/ui/libs/pagination/files/lib/hlm-pagination-link.ts.template +7 -12
  139. package/src/generators/ui/libs/pagination/files/lib/hlm-pagination-next.ts.template +5 -8
  140. package/src/generators/ui/libs/pagination/files/lib/hlm-pagination-previous.ts.template +4 -8
  141. package/src/generators/ui/libs/pagination/files/lib/hlm-pagination.ts.template +6 -7
  142. package/src/generators/ui/libs/popover/files/lib/hlm-popover-content.ts.template +7 -14
  143. package/src/generators/ui/libs/progress/files/lib/hlm-progress-indicator.ts.template +7 -15
  144. package/src/generators/ui/libs/progress/files/lib/hlm-progress.ts.template +5 -10
  145. package/src/generators/ui/libs/radio-group/files/lib/hlm-radio-group.ts.template +5 -6
  146. package/src/generators/ui/libs/radio-group/files/lib/hlm-radio-indicator.ts.template +8 -11
  147. package/src/generators/ui/libs/resizable/files/lib/hlm-resizable-group.ts.template +5 -9
  148. package/src/generators/ui/libs/resizable/files/lib/hlm-resizable-handle.ts.template +8 -12
  149. package/src/generators/ui/libs/resizable/files/lib/hlm-resizable-panel.ts.template +2 -8
  150. package/src/generators/ui/libs/scroll-area/files/lib/hlm-scroll-area.ts.template +5 -6
  151. package/src/generators/ui/libs/select/files/lib/hlm-select-content.ts.template +8 -11
  152. package/src/generators/ui/libs/select/files/lib/hlm-select-group.ts.template +2 -10
  153. package/src/generators/ui/libs/select/files/lib/hlm-select-label.ts.template +7 -12
  154. package/src/generators/ui/libs/select/files/lib/hlm-select-option.ts.template +8 -13
  155. package/src/generators/ui/libs/select/files/lib/hlm-select-scroll-down.ts.template +5 -10
  156. package/src/generators/ui/libs/select/files/lib/hlm-select-scroll-up.ts.template +5 -10
  157. package/src/generators/ui/libs/select/files/lib/hlm-select-value.ts.template +5 -10
  158. package/src/generators/ui/libs/select/files/lib/hlm-select.ts.template +5 -8
  159. package/src/generators/ui/libs/separator/files/lib/hlm-separator.ts.template +5 -8
  160. package/src/generators/ui/libs/sheet/files/lib/hlm-sheet-close.ts.template +8 -11
  161. package/src/generators/ui/libs/sheet/files/lib/hlm-sheet-content.ts.template +3 -19
  162. package/src/generators/ui/libs/sheet/files/lib/hlm-sheet-description.ts.template +5 -6
  163. package/src/generators/ui/libs/sheet/files/lib/hlm-sheet-footer.ts.template +5 -6
  164. package/src/generators/ui/libs/sheet/files/lib/hlm-sheet-header.ts.template +5 -6
  165. package/src/generators/ui/libs/sheet/files/lib/hlm-sheet-title.ts.template +5 -6
  166. package/src/generators/ui/libs/sidebar/files/lib/hlm-sidebar-content.ts.template +5 -11
  167. package/src/generators/ui/libs/sidebar/files/lib/hlm-sidebar-footer.ts.template +5 -6
  168. package/src/generators/ui/libs/sidebar/files/lib/hlm-sidebar-group-action.ts.template +6 -10
  169. package/src/generators/ui/libs/sidebar/files/lib/hlm-sidebar-group-content.ts.template +5 -6
  170. package/src/generators/ui/libs/sidebar/files/lib/hlm-sidebar-group-label.ts.template +6 -10
  171. package/src/generators/ui/libs/sidebar/files/lib/hlm-sidebar-group.ts.template +5 -8
  172. package/src/generators/ui/libs/sidebar/files/lib/hlm-sidebar-header.ts.template +5 -6
  173. package/src/generators/ui/libs/sidebar/files/lib/hlm-sidebar-input.ts.template +7 -8
  174. package/src/generators/ui/libs/sidebar/files/lib/hlm-sidebar-inset.ts.template +6 -10
  175. package/src/generators/ui/libs/sidebar/files/lib/hlm-sidebar-menu-action.ts.template +7 -10
  176. package/src/generators/ui/libs/sidebar/files/lib/hlm-sidebar-menu-badge.ts.template +6 -10
  177. package/src/generators/ui/libs/sidebar/files/lib/hlm-sidebar-menu-button.ts.template +5 -7
  178. package/src/generators/ui/libs/sidebar/files/lib/hlm-sidebar-menu-item.ts.template +5 -6
  179. package/src/generators/ui/libs/sidebar/files/lib/hlm-sidebar-menu-skeleton.ts.template +6 -8
  180. package/src/generators/ui/libs/sidebar/files/lib/hlm-sidebar-menu-sub-button.ts.template +6 -10
  181. package/src/generators/ui/libs/sidebar/files/lib/hlm-sidebar-menu-sub-item.ts.template +5 -6
  182. package/src/generators/ui/libs/sidebar/files/lib/hlm-sidebar-menu-sub.ts.template +6 -10
  183. package/src/generators/ui/libs/sidebar/files/lib/hlm-sidebar-menu.ts.template +5 -6
  184. package/src/generators/ui/libs/sidebar/files/lib/hlm-sidebar-rail.ts.template +6 -10
  185. package/src/generators/ui/libs/sidebar/files/lib/hlm-sidebar-separator.ts.template +5 -6
  186. package/src/generators/ui/libs/sidebar/files/lib/hlm-sidebar-wrapper.ts.template +6 -9
  187. package/src/generators/ui/libs/sidebar/files/lib/hlm-sidebar.ts.template +11 -14
  188. package/src/generators/ui/libs/skeleton/files/lib/hlm-skeleton.ts.template +5 -8
  189. package/src/generators/ui/libs/slider/files/lib/hlm-slider.ts.template +5 -14
  190. package/src/generators/ui/libs/spinner/files/lib/hlm-spinner.ts.template +6 -7
  191. package/src/generators/ui/libs/switch/files/lib/hlm-switch-thumb.ts.template +8 -14
  192. package/src/generators/ui/libs/table/files/lib/hlm-table.ts.template +39 -79
  193. package/src/generators/ui/libs/tabs/files/lib/hlm-tabs-content.ts.template +8 -11
  194. package/src/generators/ui/libs/tabs/files/lib/hlm-tabs-list.ts.template +5 -8
  195. package/src/generators/ui/libs/tabs/files/lib/hlm-tabs-paginated-list.ts.template +6 -7
  196. package/src/generators/ui/libs/tabs/files/lib/hlm-tabs-trigger.ts.template +8 -11
  197. package/src/generators/ui/libs/tabs/files/lib/hlm-tabs.ts.template +5 -6
  198. package/src/generators/ui/libs/textarea/files/lib/hlm-textarea.ts.template +4 -8
  199. package/src/generators/ui/libs/toggle/files/lib/hlm-toggle.ts.template +6 -11
  200. package/src/generators/ui/libs/toggle-group/files/lib/hlm-toggle-group-item.ts.template +7 -12
  201. package/src/generators/ui/libs/toggle-group/files/lib/hlm-toggle-group.ts.template +5 -11
  202. package/src/generators/ui/libs/typography/files/lib/hlm-blockquote.ts.template +5 -8
  203. package/src/generators/ui/libs/typography/files/lib/hlm-code.ts.template +5 -8
  204. package/src/generators/ui/libs/typography/files/lib/hlm-h1.ts.template +5 -8
  205. package/src/generators/ui/libs/typography/files/lib/hlm-h2.ts.template +5 -8
  206. package/src/generators/ui/libs/typography/files/lib/hlm-h3.ts.template +5 -8
  207. package/src/generators/ui/libs/typography/files/lib/hlm-h4.ts.template +5 -8
  208. package/src/generators/ui/libs/typography/files/lib/hlm-large.ts.template +5 -8
  209. package/src/generators/ui/libs/typography/files/lib/hlm-lead.ts.template +5 -8
  210. package/src/generators/ui/libs/typography/files/lib/hlm-muted.ts.template +5 -8
  211. package/src/generators/ui/libs/typography/files/lib/hlm-p.ts.template +5 -8
  212. package/src/generators/ui/libs/typography/files/lib/hlm-small.ts.template +5 -8
  213. package/src/generators/ui/libs/typography/files/lib/hlm-ul.ts.template +5 -8
  214. package/src/generators/ui/libs/utils/files/lib/hlm.ts.template +251 -0
  215. package/src/generators/ui/supported-ui-libraries.json +66 -97
@@ -1,18 +1,14 @@
1
- import { computed, Directive, input } from '@angular/core';
2
- import { hlm } from '<%- importAlias %>/utils';
3
- import type { ClassValue } from 'clsx';
1
+ import { Directive } from '@angular/core';
2
+ import { classes } from '<%- importAlias %>/utils';
4
3
 
5
4
  @Directive({
6
5
  selector: '[hlmFieldContent],hlm-field-content',
7
6
  host: {
8
7
  'data-slot': 'field-content',
9
- '[class]': '_computedClass()',
10
8
  },
11
9
  })
12
10
  export class HlmFieldContent {
13
- public readonly userClass = input<ClassValue>('', { alias: 'class' });
14
-
15
- protected readonly _computedClass = computed(() =>
16
- hlm('group/field-content flex flex-1 flex-col gap-1.5 leading-snug', this.userClass()),
17
- );
11
+ constructor() {
12
+ classes(() => 'group/field-content flex flex-1 flex-col gap-1.5 leading-snug');
13
+ }
18
14
  }
@@ -1,23 +1,18 @@
1
- import { computed, Directive, input } from '@angular/core';
2
- import { hlm } from '<%- importAlias %>/utils';
3
- import type { ClassValue } from 'clsx';
1
+ import { Directive } from '@angular/core';
2
+ import { classes } from '<%- importAlias %>/utils';
4
3
 
5
4
  @Directive({
6
5
  selector: '[hlmFieldDescription],hlm-field-description',
7
6
  host: {
8
7
  'data-slot': 'field-description',
9
- '[class]': '_computedClass()',
10
8
  },
11
9
  })
12
10
  export class HlmFieldDescription {
13
- public readonly userClass = input<ClassValue>('', { alias: 'class' });
14
-
15
- protected readonly _computedClass = computed(() =>
16
- hlm(
11
+ constructor() {
12
+ classes(() => [
17
13
  'text-muted-foreground text-sm leading-normal font-normal group-has-[[data-orientation=horizontal]]/field:text-balance',
18
14
  'last:mt-0 nth-last-2:-mt-1 [[data-variant=legend]+&]:-mt-1.5',
19
15
  '[&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4',
20
- this.userClass(),
21
- ),
22
- );
16
+ ]);
17
+ }
23
18
  }
@@ -1,21 +1,17 @@
1
- import { computed, Directive, input } from '@angular/core';
2
- import { hlm } from '<%- importAlias %>/utils';
3
- import type { ClassValue } from 'clsx';
1
+ import { Directive } from '@angular/core';
2
+ import { classes } from '<%- importAlias %>/utils';
4
3
 
5
4
  @Directive({
6
5
  selector: '[hlmFieldGroup],hlm-field-group',
7
6
  host: {
8
7
  'data-slot': 'field-group',
9
- '[class]': '_computedClass()',
10
8
  },
11
9
  })
12
10
  export class HlmFieldGroup {
13
- public readonly userClass = input<ClassValue>('', { alias: 'class' });
14
-
15
- protected readonly _computedClass = computed(() =>
16
- hlm(
17
- 'group/field-group @container/field-group flex w-full flex-col gap-7 data-[slot=checkbox-group]:gap-3 [&>[data-slot=field-group]]:gap-4',
18
- this.userClass(),
19
- ),
20
- );
11
+ constructor() {
12
+ classes(
13
+ () =>
14
+ 'group/field-group @container/field-group flex w-full flex-col gap-7 data-[slot=checkbox-group]:gap-3 [&>[data-slot=field-group]]:gap-4',
15
+ );
16
+ }
21
17
  }
@@ -1,26 +1,21 @@
1
- import { computed, Directive, input } from '@angular/core';
1
+ import { Directive } from '@angular/core';
2
2
  import { HlmLabel } from '<%- importAlias %>/label';
3
- import { hlm } from '<%- importAlias %>/utils';
4
- import type { ClassValue } from 'clsx';
3
+ import { classes } from '<%- importAlias %>/utils';
5
4
 
6
5
  @Directive({
7
6
  selector: '[hlmFieldLabel],hlm-field-label',
8
7
  hostDirectives: [HlmLabel],
9
8
  host: {
10
9
  'data-slot': 'field-label',
11
- '[class]': '_computedClass()',
12
10
  },
13
11
  })
14
12
  export class HlmFieldLabel {
15
- public readonly userClass = input<ClassValue>('', { alias: 'class' });
16
-
17
- protected readonly _computedClass = computed(() =>
18
- hlm(
13
+ constructor() {
14
+ classes(() => [
19
15
  'group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50',
20
16
  'has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col has-[>[data-slot=field]]:rounded-md has-[>[data-slot=field]]:border [&>*]:data-[slot=field]:p-4',
21
17
  'has-data-[checked=true]:bg-primary/5 has-data-[checked=true]:border-primary dark:has-data-[checked=true]:bg-primary/10',
22
18
  'has-data-[state=checked]:bg-primary/5 has-data-[state=checked]:border-primary dark:has-data-[state=checked]:bg-primary/10',
23
- this.userClass(),
24
- ),
25
- );
19
+ ]);
20
+ }
26
21
  }
@@ -1,20 +1,17 @@
1
- import { computed, Directive, input } from '@angular/core';
2
- import { hlm } from '<%- importAlias %>/utils';
3
- import type { ClassValue } from 'clsx';
1
+ import { Directive, input } from '@angular/core';
2
+ import { classes } from '<%- importAlias %>/utils';
4
3
 
5
4
  @Directive({
6
5
  selector: 'legend[hlmFieldLegend]',
7
6
  host: {
8
7
  'data-slot': 'field-legend',
9
8
  '[attr.data-variant]': 'variant()',
10
- '[class]': '_computedClass()',
11
9
  },
12
10
  })
13
11
  export class HlmFieldLegend {
14
- public readonly userClass = input<ClassValue>('', { alias: 'class' });
15
- public readonly variant = input<'label' | 'legend'>('legend');
12
+ constructor() {
13
+ classes(() => 'mb-3 font-medium data-[variant=label]:text-sm data-[variant=legend]:text-base');
14
+ }
16
15
 
17
- protected readonly _computedClass = computed(() =>
18
- hlm('mb-3 font-medium data-[variant=label]:text-sm data-[variant=legend]:text-base', this.userClass()),
19
- );
16
+ public readonly variant = input<'label' | 'legend'>('legend');
20
17
  }
@@ -1,7 +1,6 @@
1
- import { ChangeDetectionStrategy, Component, computed, input } from '@angular/core';
1
+ import { ChangeDetectionStrategy, Component } from '@angular/core';
2
2
  import { HlmSeparator } from '<%- importAlias %>/separator';
3
- import { hlm } from '<%- importAlias %>/utils';
4
- import type { ClassValue } from 'clsx';
3
+ import { classes } from '<%- importAlias %>/utils';
5
4
 
6
5
  @Component({
7
6
  selector: 'hlm-field-separator',
@@ -9,7 +8,6 @@ import type { ClassValue } from 'clsx';
9
8
  changeDetection: ChangeDetectionStrategy.OnPush,
10
9
  host: {
11
10
  'data-slot': 'field-separator',
12
- '[class]': '_computedClass()',
13
11
  },
14
12
  template: `
15
13
  <hlm-separator class="absolute inset-0 top-1/2" />
@@ -22,9 +20,7 @@ import type { ClassValue } from 'clsx';
22
20
  `,
23
21
  })
24
22
  export class HlmFieldSeparator {
25
- public readonly userClass = input<ClassValue>('', { alias: 'class' });
26
-
27
- protected readonly _computedClass = computed(() =>
28
- hlm('relative -my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2', this.userClass()),
29
- );
23
+ constructor() {
24
+ classes(() => 'relative -my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2');
25
+ }
30
26
  }
@@ -1,22 +1,17 @@
1
- import { computed, Directive, input } from '@angular/core';
2
- import { hlm } from '<%- importAlias %>/utils';
3
- import type { ClassValue } from 'clsx';
1
+ import { Directive } from '@angular/core';
2
+ import { classes } from '<%- importAlias %>/utils';
4
3
 
5
4
  @Directive({
6
5
  selector: 'fieldset[hlmFieldSet]',
7
6
  host: {
8
7
  'data-slot': 'field-set',
9
- '[class]': '_computedClass()',
10
8
  },
11
9
  })
12
10
  export class HlmFieldSet {
13
- public readonly userClass = input<ClassValue>('', { alias: 'class' });
14
-
15
- protected readonly _computedClass = computed(() =>
16
- hlm(
11
+ constructor() {
12
+ classes(() => [
17
13
  'flex flex-col gap-6',
18
14
  'has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3',
19
- this.userClass(),
20
- ),
21
- );
15
+ ]);
16
+ }
22
17
  }
@@ -1,21 +1,17 @@
1
- import { computed, Directive, input } from '@angular/core';
2
- import { hlm } from '<%- importAlias %>/utils';
3
- import type { ClassValue } from 'clsx';
1
+ import { Directive } from '@angular/core';
2
+ import { classes } from '<%- importAlias %>/utils';
4
3
 
5
4
  @Directive({
6
5
  selector: '[hlmFieldTitle],hlm-field-title',
7
6
  host: {
8
7
  'data-slot': 'field-label',
9
- '[class]': '_computedClass()',
10
8
  },
11
9
  })
12
10
  export class HlmFieldTitle {
13
- public readonly userClass = input<ClassValue>('', { alias: 'class' });
14
-
15
- protected readonly _computedClass = computed(() =>
16
- hlm(
17
- 'flex w-fit items-center gap-2 text-sm leading-snug font-medium group-data-[disabled=true]/field:opacity-50',
18
- this.userClass(),
19
- ),
20
- );
11
+ constructor() {
12
+ classes(
13
+ () =>
14
+ 'flex w-fit items-center gap-2 text-sm leading-snug font-medium group-data-[disabled=true]/field:opacity-50',
15
+ );
16
+ }
21
17
  }
@@ -1,7 +1,6 @@
1
- import { computed, Directive, input } from '@angular/core';
2
- import { hlm } from '<%- importAlias %>/utils';
1
+ import { Directive, input } from '@angular/core';
2
+ import { classes } from '<%- importAlias %>/utils';
3
3
  import { cva, type VariantProps } from 'class-variance-authority';
4
- import type { ClassValue } from 'clsx';
5
4
 
6
5
  const fieldVariants = cva('group/field data-[invalid=true]:text-destructive flex w-full gap-3', {
7
6
  variants: {
@@ -32,14 +31,11 @@ export type FieldVariants = VariantProps<typeof fieldVariants>;
32
31
  role: 'group',
33
32
  'data-slot': 'field',
34
33
  '[attr.data-orientation]': 'orientation()',
35
- '[class]': '_computedClass()',
36
34
  },
37
35
  })
38
36
  export class HlmField {
39
37
  public readonly orientation = input<FieldVariants['orientation']>('vertical');
40
- public readonly userClass = input<ClassValue>('', { alias: 'class' });
41
-
42
- protected readonly _computedClass = computed(() =>
43
- hlm(fieldVariants({ orientation: this.orientation() }), this.userClass()),
44
- );
38
+ constructor() {
39
+ classes(() => fieldVariants({ orientation: this.orientation() }));
40
+ }
45
41
  }
@@ -1,17 +1,12 @@
1
- import { computed, Directive, input } from '@angular/core';
2
- import { hlm } from '<%- importAlias %>/utils';
3
- import type { ClassValue } from 'clsx';
1
+ import { Directive } from '@angular/core';
2
+ import { classes } from '<%- importAlias %>/utils';
4
3
 
5
4
  @Directive({
6
5
  // eslint-disable-next-line @angular-eslint/directive-selector
7
6
  selector: 'hlm-error',
8
- host: {
9
- '[class]': '_computedClass()',
10
- },
11
7
  })
12
8
  export class HlmError {
13
- public readonly userClass = input<ClassValue>('', { alias: 'class' });
14
- protected readonly _computedClass = computed(() =>
15
- hlm('text-destructive block text-sm font-medium', this.userClass()),
16
- );
9
+ constructor() {
10
+ classes(() => 'text-destructive block text-sm font-medium');
11
+ }
17
12
  }
@@ -1,23 +1,11 @@
1
- import {
2
- ChangeDetectionStrategy,
3
- Component,
4
- computed,
5
- contentChild,
6
- contentChildren,
7
- effect,
8
- input,
9
- } from '@angular/core';
1
+ import { ChangeDetectionStrategy, Component, computed, contentChild, contentChildren, effect } from '@angular/core';
10
2
  import { BrnFormFieldControl } from '@spartan-ng/brain/form-field';
11
- import { hlm } from '<%- importAlias %>/utils';
12
- import type { ClassValue } from 'clsx';
3
+ import { classes } from '<%- importAlias %>/utils';
13
4
  import { HlmError } from './hlm-error';
14
5
 
15
6
  @Component({
16
7
  selector: 'hlm-form-field',
17
8
  changeDetection: ChangeDetectionStrategy.OnPush,
18
- host: {
19
- '[class]': '_computedClass()',
20
- },
21
9
  template: `
22
10
  <ng-content />
23
11
 
@@ -32,8 +20,6 @@ import { HlmError } from './hlm-error';
32
20
  `,
33
21
  })
34
22
  export class HlmFormField {
35
- public readonly userClass = input<ClassValue>('', { alias: 'class' });
36
- protected readonly _computedClass = computed(() => hlm('block space-y-2', this.userClass()));
37
23
  public readonly control = contentChild(BrnFormFieldControl);
38
24
 
39
25
  public readonly errorChildren = contentChildren(HlmError);
@@ -43,6 +29,7 @@ export class HlmFormField {
43
29
  );
44
30
 
45
31
  constructor() {
32
+ classes(() => 'block space-y-2');
46
33
  effect(() => {
47
34
  if (!this.control()) {
48
35
  throw new Error('hlm-form-field must contain a BrnFormFieldControl.');
@@ -1,15 +1,12 @@
1
- import { computed, Directive, input } from '@angular/core';
2
- import { hlm } from '<%- importAlias %>/utils';
3
- import type { ClassValue } from 'clsx';
1
+ import { Directive } from '@angular/core';
2
+ import { classes } from '<%- importAlias %>/utils';
4
3
 
5
4
  @Directive({
6
5
  // eslint-disable-next-line @angular-eslint/directive-selector
7
6
  selector: 'hlm-hint',
8
- host: {
9
- '[class]': '_computedClass()',
10
- },
11
7
  })
12
8
  export class HlmHint {
13
- public readonly userClass = input<ClassValue>('', { alias: 'class' });
14
- protected readonly _computedClass = computed(() => hlm('text-muted-foreground block text-sm', this.userClass()));
9
+ constructor() {
10
+ classes(() => 'text-muted-foreground block text-sm');
11
+ }
15
12
  }
@@ -1,13 +1,11 @@
1
- import { Directive, ElementRef, Renderer2, computed, effect, inject, input, signal } from '@angular/core';
1
+ import { Directive, ElementRef, Renderer2, effect, inject, signal } from '@angular/core';
2
2
  import { injectExposedSideProvider, injectExposesStateProvider } from '@spartan-ng/brain/core';
3
- import { hlm } from '<%- importAlias %>/utils';
4
- import type { ClassValue } from 'clsx';
3
+ import { classes } from '<%- importAlias %>/utils';
5
4
 
6
5
  @Directive({
7
6
  selector: '[hlmHoverCardContent],hlm-hover-card-content',
8
7
  host: {
9
8
  'data-slot': 'hover-card-content',
10
- '[class]': '_computedClass()',
11
9
  },
12
10
  })
13
11
  export class HlmHoverCardContent {
@@ -22,14 +20,10 @@ export class HlmHoverCardContent {
22
20
  this._renderer.setAttribute(this._element.nativeElement, 'data-state', this.state());
23
21
  this._renderer.setAttribute(this._element.nativeElement, 'data-side', this.side());
24
22
  });
25
- }
26
23
 
27
- public readonly userClass = input<ClassValue>('', { alias: 'class' });
28
- protected readonly _computedClass = computed(() =>
29
- hlm(
24
+ classes(() => [
30
25
  'border-border bg-popover text-popover-foreground z-50 w-64 rounded-md border p-4 shadow-md outline-none',
31
26
  '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',
32
- this.userClass(),
33
- ),
34
- );
27
+ ]);
28
+ }
35
29
  }
@@ -1,7 +1,6 @@
1
1
  import {
2
2
  computed,
3
3
  Directive,
4
- type DoCheck,
5
4
  effect,
6
5
  forwardRef,
7
6
  inject,
@@ -10,11 +9,12 @@ import {
10
9
  linkedSignal,
11
10
  signal,
12
11
  untracked,
12
+ type DoCheck,
13
13
  } from '@angular/core';
14
14
  import { FormGroupDirective, NgControl, NgForm } from '@angular/forms';
15
15
  import { BrnFormFieldControl } from '@spartan-ng/brain/form-field';
16
16
  import { ErrorStateMatcher, ErrorStateTracker } from '@spartan-ng/brain/forms';
17
- import { hlm } from '<%- importAlias %>/utils';
17
+ import { classes } from '<%- importAlias %>/utils';
18
18
  import { cva, type VariantProps } from 'class-variance-authority';
19
19
  import type { ClassValue } from 'clsx';
20
20
 
@@ -42,9 +42,6 @@ type InputVariants = VariantProps<typeof inputVariants>;
42
42
  useExisting: forwardRef(() => HlmInput),
43
43
  },
44
44
  ],
45
- host: {
46
- '[class]': '_computedClass()',
47
- },
48
45
  })
49
46
  export class HlmInput implements BrnFormFieldControl, DoCheck {
50
47
  private readonly _injector = inject(Injector);
@@ -56,11 +53,6 @@ export class HlmInput implements BrnFormFieldControl, DoCheck {
56
53
  private readonly _parentForm = inject(NgForm, { optional: true });
57
54
  private readonly _parentFormGroup = inject(FormGroupDirective, { optional: true });
58
55
 
59
- public readonly userClass = input<ClassValue>('', { alias: 'class' });
60
- protected readonly _computedClass = computed(() =>
61
- hlm(inputVariants({ error: this._state().error }), this.userClass(), this._additionalClasses()),
62
- );
63
-
64
56
  public readonly error = input<InputVariants['error']>('auto');
65
57
 
66
58
  protected readonly _state = linkedSignal(() => ({ error: this.error() }));
@@ -77,6 +69,8 @@ export class HlmInput implements BrnFormFieldControl, DoCheck {
77
69
  this._parentForm,
78
70
  );
79
71
 
72
+ classes(() => [inputVariants({ error: this._state().error }), this._additionalClasses()]);
73
+
80
74
  effect(() => {
81
75
  const error = this._errorStateTracker.errorState();
82
76
  untracked(() => {
@@ -1,7 +1,6 @@
1
- import { computed, Directive, input } from '@angular/core';
2
- import { hlm } from '<%- importAlias %>/utils';
1
+ import { Directive, input } from '@angular/core';
2
+ import { classes } from '<%- importAlias %>/utils';
3
3
  import { cva, type VariantProps } from 'class-variance-authority';
4
- import type { ClassValue } from 'clsx';
5
4
 
6
5
  const inputGroupAddonVariants = cva(
7
6
  "text-muted-foreground flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium select-none group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>ng-icon:not([class*='text-'])]:text-base",
@@ -29,14 +28,12 @@ type InputGroupAddonVariants = VariantProps<typeof inputGroupAddonVariants>;
29
28
  role: 'group',
30
29
  'data-slot': 'input-group-addon',
31
30
  '[attr.data-align]': 'align()',
32
- '[class]': '_computedClass()',
33
31
  },
34
32
  })
35
33
  export class HlmInputGroupAddon {
36
34
  public readonly align = input<InputGroupAddonVariants['align']>('inline-start');
37
- public readonly userClass = input<ClassValue>('', { alias: 'class' });
38
35
 
39
- protected readonly _computedClass = computed(() =>
40
- hlm(inputGroupAddonVariants({ align: this.align() }), this.userClass()),
41
- );
36
+ constructor() {
37
+ classes(() => inputGroupAddonVariants({ align: this.align() }));
38
+ }
42
39
  }
@@ -1,8 +1,7 @@
1
- import { computed, Directive, effect, inject, input } from '@angular/core';
1
+ import { Directive, input } from '@angular/core';
2
2
  import { HlmButton, provideBrnButtonConfig } from '<%- importAlias %>/button';
3
- import { hlm } from '<%- importAlias %>/utils';
3
+ import { classes } from '<%- importAlias %>/utils';
4
4
  import { cva, type VariantProps } from 'class-variance-authority';
5
- import type { ClassValue } from 'clsx';
6
5
 
7
6
  const inputGroupAddonVariants = cva('flex items-center gap-2 text-sm shadow-none', {
8
7
  variants: {
@@ -39,18 +38,10 @@ type InputGroupAddonVariants = VariantProps<typeof inputGroupAddonVariants>;
39
38
  },
40
39
  })
41
40
  export class HlmInputGroupButton {
42
- private readonly _hlmButton = inject(HlmButton);
43
41
  public readonly size = input<InputGroupAddonVariants['size']>('xs');
44
- public readonly userClass = input<ClassValue>('', { alias: 'class' });
45
42
  public readonly type = input<'button' | 'submit' | 'reset'>('button');
46
43
 
47
- protected readonly _computedClass = computed(() =>
48
- hlm(inputGroupAddonVariants({ size: this.size() }), this.userClass()),
49
- );
50
-
51
44
  constructor() {
52
- effect(() => {
53
- this._hlmButton.setClass(this._computedClass());
54
- });
45
+ classes(() => inputGroupAddonVariants({ size: this.size() }));
55
46
  }
56
47
  }
@@ -1,31 +1,16 @@
1
- import { computed, Directive, effect, inject, input } from '@angular/core';
1
+ import { Directive } from '@angular/core';
2
2
  import { HlmInput } from '<%- importAlias %>/input';
3
- import { hlm } from '<%- importAlias %>/utils';
4
- import type { ClassValue } from 'clsx';
3
+ import { classes } from '<%- importAlias %>/utils';
5
4
 
6
5
  @Directive({
7
6
  selector: 'input[hlmInputGroupInput]',
8
7
  hostDirectives: [HlmInput],
9
8
  host: {
10
9
  'data-slot': 'input-group-control',
11
- '[class]': '_computedClass()',
12
10
  },
13
11
  })
14
12
  export class HlmInputGroupInput {
15
- private readonly _hlmInput = inject(HlmInput);
16
-
17
- public readonly userClass = input<ClassValue>('', { alias: 'class' });
18
-
19
- protected readonly _computedClass = computed(() =>
20
- hlm(
21
- 'flex-1 rounded-none border-0 bg-transparent shadow-none focus-visible:ring-0 dark:bg-transparent',
22
- this.userClass(),
23
- ),
24
- );
25
-
26
13
  constructor() {
27
- effect(() => {
28
- this._hlmInput.setClass(this._computedClass());
29
- });
14
+ classes(() => `flex-1 rounded-none border-0 bg-transparent shadow-none focus-visible:ring-0 dark:bg-transparent`);
30
15
  }
31
16
  }
@@ -1,20 +1,14 @@
1
- import { computed, Directive, input } from '@angular/core';
2
- import { hlm } from '<%- importAlias %>/utils';
3
- import type { ClassValue } from 'clsx';
1
+ import { Directive } from '@angular/core';
2
+ import { classes } from '<%- importAlias %>/utils';
4
3
 
5
4
  @Directive({
6
5
  selector: 'span[hlmInputGroupText]',
7
- host: {
8
- '[class]': '_computedClass()',
9
- },
10
6
  })
11
7
  export class HlmInputGroupText {
12
- public readonly userClass = input<ClassValue>('', { alias: 'class' });
13
-
14
- protected readonly _computedClass = computed(() =>
15
- hlm(
16
- `text-muted-foreground flex items-center gap-2 text-sm [&_ng-icon]:pointer-events-none [&_ng-icon:not([class*='text-'])]:text-base`,
17
- this.userClass(),
18
- ),
19
- );
8
+ constructor() {
9
+ classes(
10
+ () =>
11
+ `text-muted-foreground flex items-center gap-2 text-sm [&_ng-icon]:pointer-events-none [&_ng-icon:not([class*='text-'])]:text-base`,
12
+ );
13
+ }
20
14
  }
@@ -1,31 +1,19 @@
1
- import { computed, Directive, effect, inject, input } from '@angular/core';
1
+ import { Directive } from '@angular/core';
2
2
  import { HlmTextarea } from '<%- importAlias %>/textarea';
3
- import { hlm } from '<%- importAlias %>/utils';
4
- import type { ClassValue } from 'clsx';
3
+ import { classes } from '<%- importAlias %>/utils';
5
4
 
6
5
  @Directive({
7
6
  selector: 'textarea[hlmInputGroupTextarea]',
8
7
  hostDirectives: [HlmTextarea],
9
8
  host: {
10
9
  'data-slot': 'input-group-control',
11
- '[class]': '_computedClass()',
12
10
  },
13
11
  })
14
12
  export class HlmInputGroupTextarea {
15
- private readonly _hlmInput = inject(HlmTextarea);
16
-
17
- public readonly userClass = input<ClassValue>('', { alias: 'class' });
18
-
19
- protected readonly _computedClass = computed(() =>
20
- hlm(
21
- 'flex-1 resize-none rounded-none border-0 bg-transparent py-3 shadow-none focus-visible:ring-0 dark:bg-transparent',
22
- this.userClass(),
23
- ),
24
- );
25
-
26
13
  constructor() {
27
- effect(() => {
28
- this._hlmInput.setClass(this._computedClass());
29
- });
14
+ classes(
15
+ () =>
16
+ 'flex-1 resize-none rounded-none border-0 bg-transparent py-3 shadow-none focus-visible:ring-0 dark:bg-transparent',
17
+ );
30
18
  }
31
19
  }
@@ -1,20 +1,16 @@
1
- import { computed, Directive, input } from '@angular/core';
2
- import { hlm } from '<%- importAlias %>/utils';
3
- import type { ClassValue } from 'clsx';
1
+ import { Directive } from '@angular/core';
2
+ import { classes } from '<%- importAlias %>/utils';
4
3
 
5
4
  @Directive({
6
5
  selector: '[hlmInputGroup],hlm-input-group',
7
6
  host: {
8
7
  'data-slot': 'input-group',
9
8
  role: 'group',
10
- '[class]': '_computedClass()',
11
9
  },
12
10
  })
13
11
  export class HlmInputGroup {
14
- public readonly userClass = input<ClassValue>('', { alias: 'class' });
15
-
16
- protected readonly _computedClass = computed(() =>
17
- hlm(
12
+ constructor() {
13
+ classes(() => [
18
14
  'group/input-group border-input dark:bg-input/30 relative flex w-full items-center rounded-md border shadow-xs transition-[color,box-shadow] outline-none',
19
15
  'h-9 min-w-0 has-[>textarea]:h-auto',
20
16
  // Variants based on alignment.
@@ -26,8 +22,6 @@ export class HlmInputGroup {
26
22
  'has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 has-[[data-slot=input-group-control]:focus-visible]:ring-[3px]',
27
23
  // Error state.
28
24
  'has-[>.ng-invalid.ng-touched]:ring-destructive/20 has-[>.ng-invalid.ng-touched]:border-destructive dark:has-[>.ng-invalid.ng-touched]:ring-destructive/40',
29
-
30
- this.userClass(),
31
- ),
32
- );
25
+ ]);
26
+ }
33
27
  }