@spartan-ng/cli 0.0.1-alpha.584 → 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,7 +1,6 @@
1
1
  // src/app/directives/hlm-table-directives.ts
2
2
  import { computed, Directive, inject, InjectionToken, input, type ValueProvider } from '@angular/core';
3
- import { hlm } from '<%- importAlias %>/utils';
4
- import type { ClassValue } from 'clsx';
3
+ import { classes } from '<%- importAlias %>/utils';
5
4
 
6
5
  // Configuration Interface and InjectionToken
7
6
  export const HlmTableConfigToken = new InjectionToken<HlmTableVariant>('HlmTableConfig');
@@ -42,18 +41,14 @@ export function injectHlmTableConfig(): HlmTableVariant {
42
41
 
43
42
  @Directive({
44
43
  selector: 'div[hlmTableContainer]',
45
- host: {
46
- '[class]': '_computedClass()',
47
- 'data-slot': 'table-container',
48
- },
44
+ host: { 'data-slot': 'table-container' },
49
45
  })
50
46
  export class HlmTableContainer {
51
47
  private readonly _globalOrDefaultConfig = injectHlmTableConfig();
52
- public readonly userClass = input<ClassValue>('', { alias: 'class' });
53
48
 
54
- protected readonly _computedClass = computed(() =>
55
- hlm(this._globalOrDefaultConfig ? this._globalOrDefaultConfig.tableContainer.trim() : '', this.userClass()),
56
- );
49
+ constructor() {
50
+ classes(() => (this._globalOrDefaultConfig ? this._globalOrDefaultConfig.tableContainer.trim() : ''));
51
+ }
57
52
  }
58
53
 
59
54
  /**
@@ -64,15 +59,11 @@ export class HlmTableContainer {
64
59
  */
65
60
  @Directive({
66
61
  selector: 'table[hlmTable]',
67
- host: {
68
- '[class]': '_computedClass()',
69
- 'data-slot': 'table',
70
- },
62
+ host: { 'data-slot': 'table' },
71
63
  })
72
64
  export class HlmTable {
73
65
  /** Input to configure the variant of the table, this input has the highest priority. */
74
66
  public readonly userVariant = input<Partial<HlmTableVariant> | string>({}, { alias: 'hlmTable' });
75
- public readonly userClass = input<ClassValue>('', { alias: 'class' });
76
67
 
77
68
  /** Global or default configuration provided by injectHlmTableConfig() */
78
69
  private readonly _globalOrDefaultConfig = injectHlmTableConfig();
@@ -93,28 +84,27 @@ export class HlmTable {
93
84
  return globalOrDefaultConfig;
94
85
  });
95
86
 
96
- // Computed class for the host <table> element
97
- protected readonly _computedClass = computed(() => hlm(this._variant().table, this.userClass()));
87
+ constructor() {
88
+ classes(() => this._variant().table);
89
+ }
98
90
  }
99
91
 
92
+ // Computed class for the host <table> element}
93
+
100
94
  /**
101
95
  * Directive to apply Shadcn-like styling to a <thead> element
102
96
  * within an HlmTableDirective context.
103
97
  */
104
98
  @Directive({
105
99
  selector: 'thead[hlmTHead]',
106
- host: {
107
- '[class]': '_computedClass()',
108
- 'data-slot': 'table-header',
109
- },
100
+ host: { 'data-slot': 'table-header' },
110
101
  })
111
102
  export class HlmTHead {
112
103
  private readonly _globalOrDefaultConfig = injectHlmTableConfig();
113
- public readonly userClass = input<ClassValue>('', { alias: 'class' });
114
104
 
115
- protected readonly _computedClass = computed(() =>
116
- hlm(this._globalOrDefaultConfig ? this._globalOrDefaultConfig.thead.trim() : '', this.userClass()),
117
- );
105
+ constructor() {
106
+ classes(() => (this._globalOrDefaultConfig ? this._globalOrDefaultConfig.thead.trim() : ''));
107
+ }
118
108
  }
119
109
 
120
110
  /**
@@ -123,18 +113,13 @@ export class HlmTHead {
123
113
  */
124
114
  @Directive({
125
115
  selector: 'tbody[hlmTBody]',
126
- host: {
127
- '[class]': '_computedClass()',
128
- 'data-slot': 'table-body',
129
- },
116
+ host: { 'data-slot': 'table-body' },
130
117
  })
131
118
  export class HlmTBody {
132
119
  private readonly _globalOrDefaultConfig = injectHlmTableConfig();
133
- public readonly userClass = input<ClassValue>('', { alias: 'class' });
134
-
135
- protected readonly _computedClass = computed(() =>
136
- hlm(this._globalOrDefaultConfig ? this._globalOrDefaultConfig.tbody.trim() : '', this.userClass()),
137
- );
120
+ constructor() {
121
+ classes(() => (this._globalOrDefaultConfig ? this._globalOrDefaultConfig.tbody.trim() : ''));
122
+ }
138
123
  }
139
124
 
140
125
  /**
@@ -143,18 +128,13 @@ export class HlmTBody {
143
128
  */
144
129
  @Directive({
145
130
  selector: 'tfoot[hlmTFoot]',
146
- host: {
147
- '[class]': '_computedClass()',
148
- 'data-slot': 'table-footer',
149
- },
131
+ host: { 'data-slot': 'table-footer' },
150
132
  })
151
133
  export class HlmTFoot {
152
134
  private readonly _globalOrDefaultConfig = injectHlmTableConfig();
153
- public readonly userClass = input<ClassValue>('', { alias: 'class' });
154
-
155
- protected readonly _computedClass = computed(() =>
156
- hlm(this._globalOrDefaultConfig ? this._globalOrDefaultConfig.tfoot.trim() : '', this.userClass()),
157
- );
135
+ constructor() {
136
+ classes(() => (this._globalOrDefaultConfig ? this._globalOrDefaultConfig.tfoot.trim() : ''));
137
+ }
158
138
  }
159
139
 
160
140
  /**
@@ -163,18 +143,13 @@ export class HlmTFoot {
163
143
  */
164
144
  @Directive({
165
145
  selector: 'tr[hlmTr]',
166
- host: {
167
- '[class]': '_computedClass()',
168
- 'data-slot': 'table-row',
169
- },
146
+ host: { 'data-slot': 'table-row' },
170
147
  })
171
148
  export class HlmTr {
172
149
  private readonly _globalOrDefaultConfig = injectHlmTableConfig();
173
- public readonly userClass = input<ClassValue>('', { alias: 'class' });
174
-
175
- protected readonly _computedClass = computed(() =>
176
- hlm(this._globalOrDefaultConfig ? this._globalOrDefaultConfig.tr.trim() : '', this.userClass()),
177
- );
150
+ constructor() {
151
+ classes(() => (this._globalOrDefaultConfig ? this._globalOrDefaultConfig.tr.trim() : ''));
152
+ }
178
153
  }
179
154
 
180
155
  /**
@@ -183,18 +158,13 @@ export class HlmTr {
183
158
  */
184
159
  @Directive({
185
160
  selector: 'th[hlmTh]',
186
- host: {
187
- '[class]': '_computedClass()',
188
- 'data-slot': 'table-head',
189
- },
161
+ host: { 'data-slot': 'table-head' },
190
162
  })
191
163
  export class HlmTh {
192
164
  private readonly _globalOrDefaultConfig = injectHlmTableConfig();
193
- public readonly userClass = input<ClassValue>('', { alias: 'class' });
194
-
195
- protected readonly _computedClass = computed(() =>
196
- hlm(this._globalOrDefaultConfig ? this._globalOrDefaultConfig.th.trim() : '', this.userClass()),
197
- );
165
+ constructor() {
166
+ classes(() => (this._globalOrDefaultConfig ? this._globalOrDefaultConfig.th.trim() : ''));
167
+ }
198
168
  }
199
169
 
200
170
  /**
@@ -203,18 +173,13 @@ export class HlmTh {
203
173
  */
204
174
  @Directive({
205
175
  selector: 'td[hlmTd]',
206
- host: {
207
- '[class]': '_computedClass()',
208
- 'data-slot': 'table-cell',
209
- },
176
+ host: { 'data-slot': 'table-cell' },
210
177
  })
211
178
  export class HlmTd {
212
179
  private readonly _globalOrDefaultConfig = injectHlmTableConfig();
213
- public readonly userClass = input<ClassValue>('', { alias: 'class' });
214
-
215
- protected readonly _computedClass = computed(() =>
216
- hlm(this._globalOrDefaultConfig ? this._globalOrDefaultConfig.td.trim() : '', this.userClass()),
217
- );
180
+ constructor() {
181
+ classes(() => (this._globalOrDefaultConfig ? this._globalOrDefaultConfig.td.trim() : ''));
182
+ }
218
183
  }
219
184
 
220
185
  /**
@@ -223,16 +188,11 @@ export class HlmTd {
223
188
  */
224
189
  @Directive({
225
190
  selector: 'caption[hlmCaption]',
226
- host: {
227
- '[class]': '_computedClass()',
228
- 'data-slot': 'table-caption',
229
- },
191
+ host: { 'data-slot': 'table-caption' },
230
192
  })
231
193
  export class HlmCaption {
232
194
  private readonly _globalOrDefaultConfig = injectHlmTableConfig();
233
- public readonly userClass = input<ClassValue>('', { alias: 'class' });
234
-
235
- protected readonly _computedClass = computed(() =>
236
- hlm(this._globalOrDefaultConfig ? this._globalOrDefaultConfig.caption.trim() : '', this.userClass()),
237
- );
195
+ constructor() {
196
+ classes(() => (this._globalOrDefaultConfig ? this._globalOrDefaultConfig.caption.trim() : ''));
197
+ }
238
198
  }
@@ -1,24 +1,21 @@
1
- import { Directive, computed, input } from '@angular/core';
1
+ import { Directive, input } from '@angular/core';
2
2
  import { BrnTabsContent } from '@spartan-ng/brain/tabs';
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: '[hlmTabsContent]',
8
7
  hostDirectives: [{ directive: BrnTabsContent, inputs: ['brnTabsContent: hlmTabsContent'] }],
9
8
  host: {
10
9
  'data-slot': 'tabs-content',
11
- '[class]': '_computedClass()',
12
10
  },
13
11
  })
14
12
  export class HlmTabsContent {
15
13
  public readonly contentFor = input.required<string>({ alias: 'hlmTabsContent' });
16
14
 
17
- public readonly userClass = input<ClassValue>('', { alias: 'class' });
18
- protected readonly _computedClass = computed(() =>
19
- hlm(
20
- 'ring-offset-background focus-visible:ring-ring mt-2 focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none',
21
- this.userClass(),
22
- ),
23
- );
15
+ constructor() {
16
+ classes(
17
+ () =>
18
+ 'ring-offset-background focus-visible:ring-ring mt-2 focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none',
19
+ );
20
+ }
24
21
  }
@@ -1,8 +1,7 @@
1
- import { computed, Directive, input } from '@angular/core';
1
+ import { Directive, input } from '@angular/core';
2
2
  import { BrnTabsList } from '@spartan-ng/brain/tabs';
3
- import { hlm } from '<%- importAlias %>/utils';
3
+ import { classes } from '<%- importAlias %>/utils';
4
4
  import { type VariantProps, cva } from 'class-variance-authority';
5
- import type { ClassValue } from 'clsx';
6
5
 
7
6
  export const listVariants = cva(
8
7
  'bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-lg p-[3px]',
@@ -25,14 +24,12 @@ type ListVariants = VariantProps<typeof listVariants>;
25
24
  hostDirectives: [BrnTabsList],
26
25
  host: {
27
26
  'data-slot': 'tabs-list',
28
- '[class]': '_computedClass()',
29
27
  },
30
28
  })
31
29
  export class HlmTabsList {
32
30
  public readonly orientation = input<ListVariants['orientation']>('horizontal');
33
31
 
34
- public readonly userClass = input<ClassValue>('', { alias: 'class' });
35
- protected readonly _computedClass = computed(() =>
36
- hlm(listVariants({ orientation: this.orientation() }), this.userClass()),
37
- );
32
+ constructor() {
33
+ classes(() => listVariants({ orientation: this.orientation() }));
34
+ }
38
35
  }
@@ -14,7 +14,7 @@ import { lucideChevronLeft, lucideChevronRight } from '@ng-icons/lucide';
14
14
  import { type BrnPaginatedTabHeaderItem, BrnTabsPaginatedList, BrnTabsTrigger } from '@spartan-ng/brain/tabs';
15
15
  import { buttonVariants } from '<%- importAlias %>/button';
16
16
  import { HlmIcon } from '<%- importAlias %>/icon';
17
- import { hlm } from '<%- importAlias %>/utils';
17
+ import { classes, hlm } from '<%- importAlias %>/utils';
18
18
  import type { ClassValue } from 'clsx';
19
19
  import type { Observable } from 'rxjs';
20
20
  import { listVariants } from './hlm-tabs-list';
@@ -26,7 +26,6 @@ import { listVariants } from './hlm-tabs-list';
26
26
  changeDetection: ChangeDetectionStrategy.OnPush,
27
27
  host: {
28
28
  'data-slot': 'tabs-paginated-list',
29
- '[class]': '_computedClass()',
30
29
  },
31
30
  template: `
32
31
  <button
@@ -73,6 +72,11 @@ import { listVariants } from './hlm-tabs-list';
73
72
  `,
74
73
  })
75
74
  export class HlmTabsPaginatedList extends BrnTabsPaginatedList {
75
+ constructor() {
76
+ super();
77
+ classes(() => 'relative flex flex-shrink-0 gap-1 overflow-hidden');
78
+ }
79
+
76
80
  public readonly items = contentChildren(BrnTabsTrigger, { descendants: false });
77
81
  /** Explicitly annotating type to avoid non-portable inferred type */
78
82
  public readonly itemsChanges: Observable<ReadonlyArray<BrnPaginatedTabHeaderItem>> = toObservable(this.items);
@@ -83,11 +87,6 @@ export class HlmTabsPaginatedList extends BrnTabsPaginatedList {
83
87
  public readonly nextPaginator = viewChild.required<ElementRef<HTMLElement>>('nextPaginator');
84
88
  public readonly previousPaginator = viewChild.required<ElementRef<HTMLElement>>('previousPaginator');
85
89
 
86
- public readonly userClass = input<ClassValue>('', { alias: 'class' });
87
- protected readonly _computedClass = computed(() =>
88
- hlm('relative flex flex-shrink-0 gap-1 overflow-hidden', this.userClass()),
89
- );
90
-
91
90
  public readonly tabListClass = input<ClassValue>('', { alias: 'tabListClass' });
92
91
  protected readonly _tabListClass = computed(() => hlm(listVariants(), this.tabListClass()));
93
92
 
@@ -1,23 +1,20 @@
1
- import { computed, Directive, input } from '@angular/core';
1
+ import { Directive, input } from '@angular/core';
2
2
  import { BrnTabsTrigger } from '@spartan-ng/brain/tabs';
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: '[hlmTabsTrigger]',
8
7
  hostDirectives: [{ directive: BrnTabsTrigger, inputs: ['brnTabsTrigger: hlmTabsTrigger', 'disabled'] }],
9
8
  host: {
10
9
  'data-slot': 'tabs-trigger',
11
- '[class]': '_computedClass()',
12
10
  },
13
11
  })
14
12
  export class HlmTabsTrigger {
15
13
  public readonly triggerFor = input.required<string>({ alias: 'hlmTabsTrigger' });
16
- public readonly userClass = input<ClassValue>('', { alias: 'class' });
17
- protected readonly _computedClass = computed(() =>
18
- hlm(
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:not([class*='text-'])]:text-base`,
20
- this.userClass(),
21
- ),
22
- );
14
+ constructor() {
15
+ classes(
16
+ () =>
17
+ `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:not([class*='text-'])]:text-base`,
18
+ );
19
+ }
23
20
  }
@@ -1,7 +1,6 @@
1
- import { computed, Directive, input } from '@angular/core';
1
+ import { Directive, input } from '@angular/core';
2
2
  import { BrnTabs } from '@spartan-ng/brain/tabs';
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: '[hlmTabs],hlm-tabs',
@@ -14,12 +13,12 @@ import type { ClassValue } from 'clsx';
14
13
  ],
15
14
  host: {
16
15
  'data-slot': 'tabs',
17
- '[class]': '_computedClass()',
18
16
  },
19
17
  })
20
18
  export class HlmTabs {
21
19
  public readonly tab = input.required<string>();
22
20
 
23
- public readonly userClass = input<ClassValue>('', { alias: 'class' });
24
- protected readonly _computedClass = computed(() => hlm('flex flex-col gap-2', this.userClass()));
21
+ constructor() {
22
+ classes(() => 'flex flex-col gap-2');
23
+ }
25
24
  }
@@ -14,9 +14,9 @@ import {
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
- import type { ClassValue } from 'clsx';
19
+ import { ClassValue } from 'clsx';
20
20
 
21
21
  export const textareaVariants = cva(
22
22
  'border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 dark:bg-input/30 flex [field-sizing:content] min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm',
@@ -44,7 +44,6 @@ type TextareaVariants = VariantProps<typeof textareaVariants>;
44
44
  ],
45
45
  host: {
46
46
  'data-slot': 'textarea',
47
- '[class]': '_computedClass()',
48
47
  },
49
48
  })
50
49
  export class HlmTextarea implements BrnFormFieldControl, DoCheck {
@@ -57,11 +56,6 @@ export class HlmTextarea implements BrnFormFieldControl, DoCheck {
57
56
  private readonly _parentForm = inject(NgForm, { optional: true });
58
57
  private readonly _parentFormGroup = inject(FormGroupDirective, { optional: true });
59
58
 
60
- public readonly userClass = input<ClassValue>('', { alias: 'class' });
61
- protected readonly _computedClass = computed(() =>
62
- hlm(textareaVariants({ error: this._state().error }), this.userClass(), this._additionalClasses()),
63
- );
64
-
65
59
  public readonly error = input<TextareaVariants['error']>('auto');
66
60
 
67
61
  protected readonly _state = linkedSignal(() => ({ error: this.error() }));
@@ -71,6 +65,8 @@ export class HlmTextarea implements BrnFormFieldControl, DoCheck {
71
65
  public readonly errorState = computed(() => this._errorStateTracker.errorState());
72
66
 
73
67
  constructor() {
68
+ classes(() => [textareaVariants({ error: this._state().error }), this._additionalClasses()]);
69
+
74
70
  this._errorStateTracker = new ErrorStateTracker(
75
71
  this._defaultErrorStateMatcher,
76
72
  this.ngControl,
@@ -1,8 +1,7 @@
1
- import { Directive, computed, input } from '@angular/core';
1
+ import { Directive, input } from '@angular/core';
2
2
  import { BrnToggle } from '@spartan-ng/brain/toggle';
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
  // TODO invalid styles uses aria-invalid
8
7
  // aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive
@@ -39,21 +38,17 @@ export type ToggleVariants = VariantProps<typeof toggleVariants>;
39
38
  ],
40
39
  host: {
41
40
  'data-slot': 'toggle',
42
- '[class]': '_computedClass()',
43
41
  },
44
42
  })
45
43
  export class HlmToggle {
46
44
  public readonly variant = input<ToggleVariants['variant']>('default');
47
45
  public readonly size = input<ToggleVariants['size']>('default');
48
- public readonly userClass = input<ClassValue>('', { alias: 'class' });
49
-
50
- protected readonly _computedClass = computed(() =>
51
- hlm(
46
+ constructor() {
47
+ classes(() =>
52
48
  toggleVariants({
53
49
  variant: this.variant(),
54
50
  size: this.size(),
55
51
  }),
56
- this.userClass(),
57
- ),
58
- );
52
+ );
53
+ }
59
54
  }
@@ -1,8 +1,7 @@
1
- import { Directive, computed, input } from '@angular/core';
1
+ import { computed, Directive, input } from '@angular/core';
2
2
  import { BrnToggleGroupItem } from '@spartan-ng/brain/toggle-group';
3
- import { ToggleVariants, toggleVariants } from '<%- importAlias %>/toggle';
4
- import { hlm } from '<%- importAlias %>/utils';
5
- import type { ClassValue } from 'clsx';
3
+ import { toggleVariants, ToggleVariants } from '<%- importAlias %>/toggle';
4
+ import { classes } from '<%- importAlias %>/utils';
6
5
  import { injectHlmToggleGroup } from './hlm-toggle-group.token';
7
6
 
8
7
  @Directive({
@@ -16,7 +15,6 @@ import { injectHlmToggleGroup } from './hlm-toggle-group.token';
16
15
  ],
17
16
  host: {
18
17
  'data-slot': 'toggle-group-item',
19
- '[class]': '_computedClass()',
20
18
  '[attr.data-variant]': '_variant()',
21
19
  '[attr.data-size]': '_size()',
22
20
  '[attr.data-spacing]': '_toggleGroup.spacing()',
@@ -31,17 +29,14 @@ export class HlmToggleGroupItem {
31
29
  protected readonly _variant = computed(() => this._toggleGroup.variant() || this.variant());
32
30
  protected readonly _size = computed(() => this._toggleGroup.size() || this.size());
33
31
 
34
- public readonly userClass = input<ClassValue>('', { alias: 'class' });
35
-
36
- protected readonly _computedClass = computed(() =>
37
- hlm(
32
+ constructor() {
33
+ classes(() => [
38
34
  toggleVariants({
39
35
  variant: this._variant(),
40
36
  size: this._size(),
41
37
  }),
42
38
  'w-auto min-w-0 shrink-0 px-3 focus:z-10 focus-visible:z-10',
43
39
  'data-[spacing=0]:rounded-none data-[spacing=0]:shadow-none data-[spacing=0]:first:rounded-l-md data-[spacing=0]:last:rounded-r-md data-[spacing=0]:data-[variant=outline]:border-l-0 data-[spacing=0]:data-[variant=outline]:first:border-l',
44
- this.userClass(),
45
- ),
46
- );
40
+ ]);
41
+ }
47
42
  }
@@ -1,9 +1,8 @@
1
1
  import { NumberInput } from '@angular/cdk/coercion';
2
- import { Directive, computed, input, numberAttribute } from '@angular/core';
2
+ import { Directive, input, numberAttribute } from '@angular/core';
3
3
  import { BrnToggleGroup } from '@spartan-ng/brain/toggle-group';
4
4
  import { ToggleVariants } from '<%- importAlias %>/toggle';
5
- import { hlm } from '<%- importAlias %>/utils';
6
- import type { ClassValue } from 'clsx';
5
+ import { classes } from '<%- importAlias %>/utils';
7
6
  import { provideHlmToggleGroup } from './hlm-toggle-group.token';
8
7
 
9
8
  @Directive({
@@ -18,7 +17,6 @@ import { provideHlmToggleGroup } from './hlm-toggle-group.token';
18
17
  ],
19
18
  host: {
20
19
  'data-slot': 'toggle-group',
21
- '[class]': '_computedClass()',
22
20
  '[attr.data-variant]': 'variant()',
23
21
  '[attr.data-size]': 'size()',
24
22
  '[attr.data-spacing]': 'spacing()',
@@ -30,11 +28,7 @@ export class HlmToggleGroup {
30
28
  public readonly size = input<ToggleVariants['size']>('default');
31
29
  public readonly spacing = input<number, NumberInput>(0, { transform: numberAttribute });
32
30
 
33
- public readonly userClass = input<ClassValue>('', { alias: 'class' });
34
- protected readonly _computedClass = computed(() =>
35
- hlm(
36
- 'group/toggle-group flex w-fit items-center gap-[--spacing(var(--gap))] rounded-md data-[spacing=default]:data-[variant=outline]:shadow-xs',
37
- this.userClass(),
38
- ),
39
- );
31
+ constructor() {
32
+ classes(() => 'group/toggle-group flex w-fit items-center gap-[--spacing(var(--gap))]');
33
+ }
40
34
  }
@@ -1,16 +1,13 @@
1
- import { Directive, computed, 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
  export const hlmBlockquote = 'mt-6 border-border border-l-2 pl-6 italic';
6
5
 
7
6
  @Directive({
8
7
  selector: '[hlmBlockquote]',
9
- host: {
10
- '[class]': '_computedClass()',
11
- },
12
8
  })
13
9
  export class HlmBlockquote {
14
- public readonly userClass = input<ClassValue>('', { alias: 'class' });
15
- protected readonly _computedClass = computed(() => hlm(hlmBlockquote, this.userClass()));
10
+ constructor() {
11
+ classes(() => hlmBlockquote);
12
+ }
16
13
  }
@@ -1,16 +1,13 @@
1
- import { Directive, computed, 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
  export const hlmCode = 'relative rounded bg-muted px-[0.3rem] py-[0.2rem] font-mono text-sm font-semibold';
6
5
 
7
6
  @Directive({
8
7
  selector: '[hlmCode]',
9
- host: {
10
- '[class]': '_computedClass()',
11
- },
12
8
  })
13
9
  export class HlmCode {
14
- public readonly userClass = input<ClassValue>('', { alias: 'class' });
15
- protected readonly _computedClass = computed(() => hlm(hlmCode, this.userClass()));
10
+ constructor() {
11
+ classes(() => hlmCode);
12
+ }
16
13
  }
@@ -1,16 +1,13 @@
1
- import { Directive, computed, 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
  export const hlmH1 = 'scroll-m-20 text-4xl font-extrabold tracking-tight lg:text-5xl';
6
5
 
7
6
  @Directive({
8
7
  selector: '[hlmH1]',
9
- host: {
10
- '[class]': '_computedClass()',
11
- },
12
8
  })
13
9
  export class HlmH1 {
14
- public readonly userClass = input<ClassValue>('', { alias: 'class' });
15
- protected readonly _computedClass = computed(() => hlm(hlmH1, this.userClass()));
10
+ constructor() {
11
+ classes(() => hlmH1);
12
+ }
16
13
  }
@@ -1,17 +1,14 @@
1
- import { Directive, computed, 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
  export const hlmH2 =
6
5
  'scroll-m-20 border-border border-b pb-2 text-3xl font-semibold tracking-tight transition-colors first:mt-0';
7
6
 
8
7
  @Directive({
9
8
  selector: '[hlmH2]',
10
- host: {
11
- '[class]': '_computedClass()',
12
- },
13
9
  })
14
10
  export class HlmH2 {
15
- public readonly userClass = input<ClassValue>('', { alias: 'class' });
16
- protected readonly _computedClass = computed(() => hlm(hlmH2, this.userClass()));
11
+ constructor() {
12
+ classes(() => hlmH2);
13
+ }
17
14
  }
@@ -1,16 +1,13 @@
1
- import { Directive, computed, 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
  export const hlmH3 = 'scroll-m-20 text-2xl font-semibold tracking-tight';
6
5
 
7
6
  @Directive({
8
7
  selector: '[hlmH3]',
9
- host: {
10
- '[class]': '_computedClass()',
11
- },
12
8
  })
13
9
  export class HlmH3 {
14
- public readonly userClass = input<ClassValue>('', { alias: 'class' });
15
- protected readonly _computedClass = computed(() => hlm(hlmH3, this.userClass()));
10
+ constructor() {
11
+ classes(() => hlmH3);
12
+ }
16
13
  }