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

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 (148) hide show
  1. package/package.json +1 -1
  2. package/src/generators/base/versions.d.ts +20 -20
  3. package/src/generators/base/versions.js +20 -20
  4. package/src/generators/ui/generator.js +2 -2
  5. package/src/generators/ui/generator.js.map +1 -1
  6. package/src/generators/ui/libs/ui-accordion-helm/files/lib/hlm-accordion-content.directive.ts.template +3 -8
  7. package/src/generators/ui/libs/ui-accordion-helm/files/lib/hlm-accordion-icon.directive.ts.template +6 -11
  8. package/src/generators/ui/libs/ui-accordion-helm/files/lib/hlm-accordion-item.directive.ts.template +9 -9
  9. package/src/generators/ui/libs/ui-accordion-helm/files/lib/hlm-accordion-trigger.directive.ts.template +3 -8
  10. package/src/generators/ui/libs/ui-accordion-helm/files/lib/hlm-accordion.directive.ts.template +4 -9
  11. package/src/generators/ui/libs/ui-alert-dialog-helm/files/lib/hlm-alert-dialog-cancel-button.directive.ts.template +3 -8
  12. package/src/generators/ui/libs/ui-alert-dialog-helm/files/lib/hlm-alert-dialog-content.component.ts.template +3 -8
  13. package/src/generators/ui/libs/ui-alert-dialog-helm/files/lib/hlm-alert-dialog-description.directive.ts.template +3 -8
  14. package/src/generators/ui/libs/ui-alert-dialog-helm/files/lib/hlm-alert-dialog-footer.component.ts.template +3 -7
  15. package/src/generators/ui/libs/ui-alert-dialog-helm/files/lib/hlm-alert-dialog-header.component.ts.template +3 -7
  16. package/src/generators/ui/libs/ui-alert-dialog-helm/files/lib/hlm-alert-dialog-overlay.directive.ts.template +3 -7
  17. package/src/generators/ui/libs/ui-alert-dialog-helm/files/lib/hlm-alert-dialog-title.directive.ts.template +3 -7
  18. package/src/generators/ui/libs/ui-alert-helm/files/lib/hlm-alert-description.directive.ts.template +3 -11
  19. package/src/generators/ui/libs/ui-alert-helm/files/lib/hlm-alert-title.directive.ts.template +3 -11
  20. package/src/generators/ui/libs/ui-alert-helm/files/lib/hlm-alert.directive.ts.template +3 -11
  21. package/src/generators/ui/libs/ui-aspect-ratio-helm/files/lib/helm-aspect-ratio.directive.ts.template +3 -8
  22. package/src/generators/ui/libs/ui-avatar-helm/files/lib/hlm-avatar.component.spec.ts.template +10 -6
  23. package/src/generators/ui/libs/ui-avatar-helm/files/lib/hlm-avatar.component.ts.template +5 -11
  24. package/src/generators/ui/libs/ui-avatar-helm/files/lib/image/hlm-avatar-image.directive.ts.template +3 -11
  25. package/src/generators/ui/libs/ui-badge-helm/files/lib/hlm-badge.directive.ts.template +5 -14
  26. package/src/generators/ui/libs/ui-button-helm/files/lib/hlm-button.directive.ts.template +11 -11
  27. package/src/generators/ui/libs/ui-card-helm/files/lib/hlm-card-content.directive.ts.template +3 -11
  28. package/src/generators/ui/libs/ui-card-helm/files/lib/hlm-card-description.directive.ts.template +3 -11
  29. package/src/generators/ui/libs/ui-card-helm/files/lib/hlm-card-footer.directive.ts.template +6 -16
  30. package/src/generators/ui/libs/ui-card-helm/files/lib/hlm-card-header.directive.ts.template +6 -15
  31. package/src/generators/ui/libs/ui-card-helm/files/lib/hlm-card-title.directive.ts.template +3 -11
  32. package/src/generators/ui/libs/ui-card-helm/files/lib/hlm-card.directive.ts.template +3 -11
  33. package/src/generators/ui/libs/ui-carousel-helm/files/index.ts.template +26 -0
  34. package/src/generators/ui/libs/ui-carousel-helm/files/lib/hlm-carousel-content.component.ts.template +25 -0
  35. package/src/generators/ui/libs/ui-carousel-helm/files/lib/hlm-carousel-item.component.ts.template +26 -0
  36. package/src/generators/ui/libs/ui-carousel-helm/files/lib/hlm-carousel-next.component.ts.template +62 -0
  37. package/src/generators/ui/libs/ui-carousel-helm/files/lib/hlm-carousel-previous.component.ts.template +62 -0
  38. package/src/generators/ui/libs/ui-carousel-helm/files/lib/hlm-carousel.component.ts.template +93 -0
  39. package/src/generators/ui/libs/ui-carousel-helm/generator.d.ts +3 -0
  40. package/src/generators/ui/libs/ui-carousel-helm/generator.js +12 -0
  41. package/src/generators/ui/libs/ui-carousel-helm/generator.js.map +1 -0
  42. package/src/generators/ui/libs/ui-checkbox-helm/files/lib/hlm-checkbox-checkicon.component.ts.template +14 -15
  43. package/src/generators/ui/libs/ui-checkbox-helm/files/lib/hlm-checkbox.component.ts.template +29 -17
  44. package/src/generators/ui/libs/ui-command-helm/files/lib/hlm-command-dialog-close-button.directive.ts.template +3 -11
  45. package/src/generators/ui/libs/ui-command-helm/files/lib/hlm-command-dialog.directive.ts.template +8 -14
  46. package/src/generators/ui/libs/ui-command-helm/files/lib/hlm-command-empty.directive.ts.template +3 -11
  47. package/src/generators/ui/libs/ui-command-helm/files/lib/hlm-command-group.directive.ts.template +7 -13
  48. package/src/generators/ui/libs/ui-command-helm/files/lib/hlm-command-input-wrapper.component.ts.template +5 -14
  49. package/src/generators/ui/libs/ui-command-helm/files/lib/hlm-command-input.directive.ts.template +7 -12
  50. package/src/generators/ui/libs/ui-command-helm/files/lib/hlm-command-item-icon.directive.ts.template +3 -10
  51. package/src/generators/ui/libs/ui-command-helm/files/lib/hlm-command-item.directive.ts.template +7 -12
  52. package/src/generators/ui/libs/ui-command-helm/files/lib/hlm-command-list.directive.ts.template +3 -11
  53. package/src/generators/ui/libs/ui-command-helm/files/lib/hlm-command-shortcut.component.ts.template +5 -11
  54. package/src/generators/ui/libs/ui-command-helm/files/lib/hlm-command.directive.ts.template +7 -13
  55. package/src/generators/ui/libs/ui-dialog-helm/files/lib/hlm-dialog-close.directive.ts.template +7 -13
  56. package/src/generators/ui/libs/ui-dialog-helm/files/lib/hlm-dialog-content.component.ts.template +6 -11
  57. package/src/generators/ui/libs/ui-dialog-helm/files/lib/hlm-dialog-description.directive.ts.template +3 -11
  58. package/src/generators/ui/libs/ui-dialog-helm/files/lib/hlm-dialog-footer.component.ts.template +5 -11
  59. package/src/generators/ui/libs/ui-dialog-helm/files/lib/hlm-dialog-header.component.ts.template +5 -11
  60. package/src/generators/ui/libs/ui-dialog-helm/files/lib/hlm-dialog-overlay.directive.ts.template +3 -7
  61. package/src/generators/ui/libs/ui-dialog-helm/files/lib/hlm-dialog-title.directive.ts.template +5 -11
  62. package/src/generators/ui/libs/ui-hover-card-helm/files/lib/hlm-hover-card-content.component.ts.template +2 -7
  63. package/src/generators/ui/libs/ui-icon-helm/files/lib/hlm-icon.component.spec.ts.template +3 -3
  64. package/src/generators/ui/libs/ui-input-helm/files/lib/hlm-input-error.directive.ts.template +3 -11
  65. package/src/generators/ui/libs/ui-input-helm/files/lib/hlm-input.directive.ts.template +5 -10
  66. package/src/generators/ui/libs/ui-label-helm/files/lib/hlm-label.directive.ts.template +4 -10
  67. package/src/generators/ui/libs/ui-menu-helm/files/lib/hlm-menu-bar-item.directive.ts.template +7 -13
  68. package/src/generators/ui/libs/ui-menu-helm/files/lib/hlm-menu-bar.component.ts.template +5 -11
  69. package/src/generators/ui/libs/ui-menu-helm/files/lib/hlm-menu-item-check.component.ts.template +12 -14
  70. package/src/generators/ui/libs/ui-menu-helm/files/lib/hlm-menu-item-checkbox.directive.ts.template +8 -21
  71. package/src/generators/ui/libs/ui-menu-helm/files/lib/hlm-menu-item-icon.directive.ts.template +3 -10
  72. package/src/generators/ui/libs/ui-menu-helm/files/lib/hlm-menu-item-radio.component.ts.template +12 -14
  73. package/src/generators/ui/libs/ui-menu-helm/files/lib/hlm-menu-item-radio.directive.ts.template +8 -21
  74. package/src/generators/ui/libs/ui-menu-helm/files/lib/hlm-menu-item-sub-indicator.component.ts.template +6 -14
  75. package/src/generators/ui/libs/ui-menu-helm/files/lib/hlm-menu-item.directive.ts.template +5 -15
  76. package/src/generators/ui/libs/ui-menu-helm/files/lib/hlm-menu-label.component.ts.template +5 -11
  77. package/src/generators/ui/libs/ui-menu-helm/files/lib/hlm-menu-separator.component.ts.template +3 -11
  78. package/src/generators/ui/libs/ui-menu-helm/files/lib/hlm-menu-shortcut.component.ts.template +5 -11
  79. package/src/generators/ui/libs/ui-menu-helm/files/lib/hlm-menu.component.ts.template +4 -12
  80. package/src/generators/ui/libs/ui-menu-helm/files/lib/hlm-sub-menu.component.ts.template +7 -13
  81. package/src/generators/ui/libs/ui-pagination-helm/files/index.ts.template +33 -0
  82. package/src/generators/ui/libs/ui-pagination-helm/files/lib/hlm-pagination-content.directive.ts.template +21 -0
  83. package/src/generators/ui/libs/ui-pagination-helm/files/lib/hlm-pagination-ellipsis.componet.ts.template +23 -0
  84. package/src/generators/ui/libs/ui-pagination-helm/files/lib/hlm-pagination-item.directive.ts.template +22 -0
  85. package/src/generators/ui/libs/ui-pagination-helm/files/lib/hlm-pagination-link.directive.ts.template +56 -0
  86. package/src/generators/ui/libs/ui-pagination-helm/files/lib/hlm-pagination-next.componet.ts.template +31 -0
  87. package/src/generators/ui/libs/ui-pagination-helm/files/lib/hlm-pagination-previous.componet.ts.template +31 -0
  88. package/src/generators/ui/libs/ui-pagination-helm/files/lib/hlm-pagination.directive.ts.template +25 -0
  89. package/src/generators/ui/libs/ui-pagination-helm/generator.d.ts +3 -0
  90. package/src/generators/ui/libs/ui-pagination-helm/generator.js +12 -0
  91. package/src/generators/ui/libs/ui-pagination-helm/generator.js.map +1 -0
  92. package/src/generators/ui/libs/ui-popover-helm/files/lib/hlm-popover-close.directive.ts.template +7 -13
  93. package/src/generators/ui/libs/ui-popover-helm/files/lib/hlm-popover-content.directive.ts.template +7 -13
  94. package/src/generators/ui/libs/ui-progress-helm/files/lib/hlm-progress-indicator.directive.ts.template +5 -11
  95. package/src/generators/ui/libs/ui-progress-helm/files/lib/hlm-progress.directive.ts.template +5 -11
  96. package/src/generators/ui/libs/ui-radio-group-helm/files/lib/hlm-radio-group.directive.ts.template +3 -11
  97. package/src/generators/ui/libs/ui-radio-group-helm/files/lib/hlm-radio-indicator.component.ts.template +3 -11
  98. package/src/generators/ui/libs/ui-radio-group-helm/files/lib/hlm-radio.directive.ts.template +5 -11
  99. package/src/generators/ui/libs/ui-select-helm/files/index.ts.template +38 -0
  100. package/src/generators/ui/libs/ui-select-helm/files/lib/hlm-select-content.directive.ts.template +34 -0
  101. package/src/generators/ui/libs/ui-select-helm/files/lib/hlm-select-group.directive.ts.template +22 -0
  102. package/src/generators/ui/libs/ui-select-helm/files/lib/hlm-select-label.directive.ts.template +38 -0
  103. package/src/generators/ui/libs/ui-select-helm/files/lib/hlm-select-option.component.ts.template +54 -0
  104. package/src/generators/ui/libs/ui-select-helm/files/lib/hlm-select-scroll-down.component.ts.template +17 -0
  105. package/src/generators/ui/libs/ui-select-helm/files/lib/hlm-select-scroll-up.component.ts.template +17 -0
  106. package/src/generators/ui/libs/ui-select-helm/files/lib/hlm-select-trigger.component.ts.template +44 -0
  107. package/src/generators/ui/libs/ui-select-helm/files/lib/hlm-select-value.directive.ts.template +26 -0
  108. package/src/generators/ui/libs/ui-select-helm/files/lib/hlm-select.directive.ts.template +21 -0
  109. package/src/generators/ui/libs/ui-select-helm/generator.d.ts +3 -0
  110. package/src/generators/ui/libs/ui-select-helm/generator.js +12 -0
  111. package/src/generators/ui/libs/ui-select-helm/generator.js.map +1 -0
  112. package/src/generators/ui/libs/ui-separator-helm/files/lib/hlm-separator.directive.ts.template +7 -13
  113. package/src/generators/ui/libs/ui-sheet-helm/files/lib/hlm-sheet-close.directive.ts.template +7 -13
  114. package/src/generators/ui/libs/ui-sheet-helm/files/lib/hlm-sheet-content.component.ts.template +6 -14
  115. package/src/generators/ui/libs/ui-sheet-helm/files/lib/hlm-sheet-description.directive.ts.template +3 -11
  116. package/src/generators/ui/libs/ui-sheet-helm/files/lib/hlm-sheet-footer.component.ts.template +5 -11
  117. package/src/generators/ui/libs/ui-sheet-helm/files/lib/hlm-sheet-header.component.ts.template +3 -11
  118. package/src/generators/ui/libs/ui-sheet-helm/files/lib/hlm-sheet-overlay.directive.ts.template +11 -17
  119. package/src/generators/ui/libs/ui-sheet-helm/files/lib/hlm-sheet-title.directive.ts.template +3 -11
  120. package/src/generators/ui/libs/ui-skeleton-helm/files/lib/hlm-skeleton.component.ts.template +3 -11
  121. package/src/generators/ui/libs/ui-spinner-helm/files/lib/hlm-spinner.component.ts.template +5 -11
  122. package/src/generators/ui/libs/ui-switch-helm/files/lib/hlm-switch-thumb.directive.ts.template +7 -13
  123. package/src/generators/ui/libs/ui-switch-helm/files/lib/hlm-switch.component.ts.template +19 -14
  124. package/src/generators/ui/libs/ui-table-helm/files/lib/hlm-caption.component.ts.template +10 -28
  125. package/src/generators/ui/libs/ui-table-helm/files/lib/hlm-table.component.ts.template +11 -27
  126. package/src/generators/ui/libs/ui-table-helm/files/lib/hlm-td.component.ts.template +8 -12
  127. package/src/generators/ui/libs/ui-table-helm/files/lib/hlm-th.component.ts.template +22 -23
  128. package/src/generators/ui/libs/ui-table-helm/files/lib/hlm-trow.component.ts.template +7 -24
  129. package/src/generators/ui/libs/ui-tabs-helm/files/index.ts.template +8 -1
  130. package/src/generators/ui/libs/ui-tabs-helm/files/lib/hlm-tabs-content.directive.ts.template +9 -21
  131. package/src/generators/ui/libs/ui-tabs-helm/files/lib/hlm-tabs-list.component.ts.template +5 -17
  132. package/src/generators/ui/libs/ui-tabs-helm/files/lib/hlm-tabs-trigger.directive.ts.template +9 -21
  133. package/src/generators/ui/libs/ui-tabs-helm/files/lib/hlm-tabs.component.ts.template +17 -0
  134. package/src/generators/ui/libs/ui-toggle-helm/files/lib/hlm-toggle-group.directive.ts.template +7 -13
  135. package/src/generators/ui/libs/ui-toggle-helm/files/lib/hlm-toggle.directive.ts.template +5 -11
  136. package/src/generators/ui/libs/ui-typography-helm/files/lib/hlm-blockquote.directive.ts.template +3 -11
  137. package/src/generators/ui/libs/ui-typography-helm/files/lib/hlm-code.directive.ts.template +3 -11
  138. package/src/generators/ui/libs/ui-typography-helm/files/lib/hlm-h1.directive.ts.template +3 -11
  139. package/src/generators/ui/libs/ui-typography-helm/files/lib/hlm-h2.directive.ts.template +3 -11
  140. package/src/generators/ui/libs/ui-typography-helm/files/lib/hlm-h3.directive.ts.template +3 -11
  141. package/src/generators/ui/libs/ui-typography-helm/files/lib/hlm-h4.directive.ts.template +3 -11
  142. package/src/generators/ui/libs/ui-typography-helm/files/lib/hlm-large.directive.ts.template +3 -11
  143. package/src/generators/ui/libs/ui-typography-helm/files/lib/hlm-lead.directive.ts.template +3 -11
  144. package/src/generators/ui/libs/ui-typography-helm/files/lib/hlm-muted.directive.ts.template +3 -11
  145. package/src/generators/ui/libs/ui-typography-helm/files/lib/hlm-p.directive.ts.template +3 -11
  146. package/src/generators/ui/libs/ui-typography-helm/files/lib/hlm-small.directive.ts.template +3 -11
  147. package/src/generators/ui/libs/ui-typography-helm/files/lib/hlm-ul.directive.ts.template +3 -11
  148. package/src/generators/ui/supported-ui-libraries.json +115 -82
@@ -1,4 +1,4 @@
1
- import { computed, Directive, inject, Input, signal } from '@angular/core';
1
+ import { computed, Directive, inject, input } from '@angular/core';
2
2
  import { BrnAvatarImageDirective } from '@spartan-ng/ui-avatar-brain';
3
3
  import { hlm } from '@spartan-ng/ui-core';
4
4
  import { ClassValue } from 'clsx';
@@ -15,14 +15,6 @@ import { ClassValue } from 'clsx';
15
15
  export class HlmAvatarImageDirective {
16
16
  canShow = inject(BrnAvatarImageDirective).canShow;
17
17
 
18
- private readonly _userCls = signal<ClassValue>('');
19
- @Input()
20
- set class(userCls: ClassValue) {
21
- this._userCls.set(userCls);
22
- }
23
-
24
- protected _computedClass = computed(() => this._generateClass());
25
- private _generateClass() {
26
- return hlm('aspect-square object-cover h-full w-full', this._userCls());
27
- }
18
+ private readonly _userClass = input<ClassValue>('', { alias: 'class' });
19
+ protected _computedClass = computed(() => hlm('aspect-square object-cover h-full w-full', this._userClass()));
28
20
  }
@@ -1,4 +1,4 @@
1
- import { booleanAttribute, computed, Directive, Input, signal } from '@angular/core';
1
+ import { booleanAttribute, computed, Directive, Input, input, signal } from '@angular/core';
2
2
  import { hlm } from '@spartan-ng/ui-core';
3
3
  import { cva, VariantProps } from 'class-variance-authority';
4
4
  import { ClassValue } from 'clsx';
@@ -53,11 +53,10 @@ type badgeVariants = VariantProps<typeof badgeVariants>;
53
53
  },
54
54
  })
55
55
  export class HlmBadgeDirective {
56
- private readonly _userCls = signal<ClassValue>('');
57
- @Input()
58
- set class(userCls: ClassValue) {
59
- this._userCls.set(userCls);
60
- }
56
+ private readonly _userClass = input<ClassValue>('', { alias: 'class' });
57
+ protected _computedClass = computed(() =>
58
+ hlm(badgeVariants({ variant: this._variant(), size: this._size(), static: this._static() }), this._userClass()),
59
+ );
61
60
 
62
61
  private readonly _variant = signal<badgeVariants['variant']>('default');
63
62
  @Input()
@@ -76,12 +75,4 @@ export class HlmBadgeDirective {
76
75
  set size(size: badgeVariants['size']) {
77
76
  this._size.set(size);
78
77
  }
79
-
80
- protected _computedClass = computed(() => this._generateClass());
81
- private _generateClass() {
82
- return hlm(
83
- badgeVariants({ variant: this._variant(), size: this._size(), static: this._static() }),
84
- this._userCls(),
85
- );
86
- }
87
78
  }
@@ -1,4 +1,4 @@
1
- import { computed, Directive, Input, signal } from '@angular/core';
1
+ import { computed, Directive, input, Input, signal } from '@angular/core';
2
2
  import { hlm } from '@spartan-ng/ui-core';
3
3
  import { cva, VariantProps } from 'class-variance-authority';
4
4
  import { ClassValue } from 'clsx';
@@ -28,7 +28,7 @@ export const buttonVariants = cva(
28
28
  },
29
29
  },
30
30
  );
31
- type ButtonVariants = VariantProps<typeof buttonVariants>;
31
+ export type ButtonVariants = VariantProps<typeof buttonVariants>;
32
32
 
33
33
  @Directive({
34
34
  selector: '[hlmBtn]',
@@ -38,10 +38,15 @@ type ButtonVariants = VariantProps<typeof buttonVariants>;
38
38
  },
39
39
  })
40
40
  export class HlmButtonDirective {
41
- private readonly _userCls = signal<ClassValue>('');
42
- @Input()
43
- set class(userCls: ClassValue) {
44
- this._userCls.set(userCls);
41
+ private readonly _userClass = input<ClassValue>('', { alias: 'class' });
42
+ private readonly _settableClass = signal<ClassValue>('');
43
+
44
+ protected _computedClass = computed(() =>
45
+ hlm(buttonVariants({ variant: this._variant(), size: this._size() }), this._settableClass(), this._userClass()),
46
+ );
47
+
48
+ setClass(value: ClassValue) {
49
+ this._settableClass.set(value);
45
50
  }
46
51
 
47
52
  private readonly _variant = signal<ButtonVariants['variant']>('default');
@@ -55,9 +60,4 @@ export class HlmButtonDirective {
55
60
  set size(size: ButtonVariants['size']) {
56
61
  this._size.set(size);
57
62
  }
58
-
59
- protected _computedClass = computed(() => this._generateClass());
60
- private _generateClass() {
61
- return hlm(buttonVariants({ variant: this._variant(), size: this._size() }), this._userCls());
62
- }
63
63
  }
@@ -1,4 +1,4 @@
1
- import { computed, Directive, Input, signal } from '@angular/core';
1
+ import { computed, Directive, input } from '@angular/core';
2
2
  import { hlm } from '@spartan-ng/ui-core';
3
3
  import { cva, VariantProps } from 'class-variance-authority';
4
4
  import { ClassValue } from 'clsx';
@@ -17,14 +17,6 @@ export type CardContentVariants = VariantProps<typeof cardContentVariants>;
17
17
  },
18
18
  })
19
19
  export class HlmCardContentDirective {
20
- private readonly _userCls = signal<ClassValue>('');
21
- @Input()
22
- set class(userCls: ClassValue) {
23
- this._userCls.set(userCls);
24
- }
25
-
26
- protected _computedClass = computed(() => this._generateClass());
27
- private _generateClass() {
28
- return hlm(cardContentVariants(), this._userCls());
29
- }
20
+ private readonly _userClass = input<ClassValue>('', { alias: 'class' });
21
+ protected _computedClass = computed(() => hlm(cardContentVariants(), this._userClass()));
30
22
  }
@@ -1,4 +1,4 @@
1
- import { computed, Directive, Input, signal } from '@angular/core';
1
+ import { computed, Directive, input } from '@angular/core';
2
2
  import { hlm } from '@spartan-ng/ui-core';
3
3
  import { cva, VariantProps } from 'class-variance-authority';
4
4
  import { ClassValue } from 'clsx';
@@ -17,14 +17,6 @@ export type CardDescriptionVariants = VariantProps<typeof cardDescriptionVariant
17
17
  },
18
18
  })
19
19
  export class HlmCardDescriptionDirective {
20
- private readonly _userCls = signal<ClassValue>('');
21
- @Input()
22
- set class(userCls: ClassValue) {
23
- this._userCls.set(userCls);
24
- }
25
-
26
- protected _computedClass = computed(() => this._generateClass());
27
- private _generateClass() {
28
- return hlm(cardDescriptionVariants(), this._userCls());
29
- }
20
+ private readonly _userClass = input<ClassValue>('', { alias: 'class' });
21
+ protected _computedClass = computed(() => hlm(cardDescriptionVariants(), this._userClass()));
30
22
  }
@@ -1,4 +1,4 @@
1
- import { computed, Directive, Input, signal } from '@angular/core';
1
+ import { computed, Directive, input } from '@angular/core';
2
2
  import { hlm } from '@spartan-ng/ui-core';
3
3
  import { cva, VariantProps } from 'class-variance-authority';
4
4
  import { ClassValue } from 'clsx';
@@ -24,20 +24,10 @@ export type CardFooterVariants = VariantProps<typeof cardFooterVariants>;
24
24
  },
25
25
  })
26
26
  export class HlmCardFooterDirective {
27
- private readonly _userCls = signal<ClassValue>('');
28
- @Input()
29
- set class(userCls: ClassValue) {
30
- this._userCls.set(userCls);
31
- }
27
+ private readonly _userClass = input<ClassValue>('', { alias: 'class' });
28
+ protected _computedClass = computed(() =>
29
+ hlm(cardFooterVariants({ direction: this.direction() }), this._userClass()),
30
+ );
32
31
 
33
- private readonly _direction = signal<CardFooterVariants['direction']>('row');
34
- @Input()
35
- set direction(direction: CardFooterVariants['direction']) {
36
- this._direction.set(direction);
37
- }
38
-
39
- protected _computedClass = computed(() => this._generateClass());
40
- private _generateClass() {
41
- return hlm(cardFooterVariants({ direction: this._direction() }), this._userCls());
42
- }
32
+ public readonly direction = input<CardFooterVariants['direction']>('row');
43
33
  }
@@ -1,4 +1,4 @@
1
- import { computed, Directive, Input, signal } from '@angular/core';
1
+ import { computed, Directive, input, signal } from '@angular/core';
2
2
  import { hlm } from '@spartan-ng/ui-core';
3
3
  import { cva, VariantProps } from 'class-variance-authority';
4
4
  import { ClassValue } from 'clsx';
@@ -24,20 +24,11 @@ export type CardHeaderVariants = VariantProps<typeof cardHeaderVariants>;
24
24
  },
25
25
  })
26
26
  export class HlmCardHeaderDirective {
27
- private readonly _userCls = signal<ClassValue>('');
28
- @Input()
29
- set class(userCls: ClassValue) {
30
- this._userCls.set(userCls);
31
- }
27
+ private readonly _userClass = input<ClassValue>('', { alias: 'class' });
28
+ protected _computedClass = computed(() =>
29
+ hlm(cardHeaderVariants({ direction: this._direction() }), this._userClass()),
30
+ );
32
31
 
33
32
  private readonly _direction = signal<CardHeaderVariants['direction']>('column');
34
- @Input()
35
- set direction(direction: CardHeaderVariants['direction']) {
36
- this._direction.set(direction);
37
- }
38
-
39
- protected _computedClass = computed(() => this._generateClass());
40
- private _generateClass() {
41
- return hlm(cardHeaderVariants({ direction: this._direction() }), this._userCls());
42
- }
33
+ public readonly direction = input<CardHeaderVariants['direction']>('column');
43
34
  }
@@ -1,4 +1,4 @@
1
- import { computed, Directive, Input, signal } from '@angular/core';
1
+ import { computed, Directive, input } from '@angular/core';
2
2
  import { hlm } from '@spartan-ng/ui-core';
3
3
  import { cva, VariantProps } from 'class-variance-authority';
4
4
  import { ClassValue } from 'clsx';
@@ -17,14 +17,6 @@ export type CardTitleVariants = VariantProps<typeof cardTitleVariants>;
17
17
  },
18
18
  })
19
19
  export class HlmCardTitleDirective {
20
- private readonly _userCls = signal<ClassValue>('');
21
- @Input()
22
- set class(userCls: ClassValue) {
23
- this._userCls.set(userCls);
24
- }
25
-
26
- protected _computedClass = computed(() => this._generateClass());
27
- private _generateClass() {
28
- return hlm(cardTitleVariants(), this._userCls());
29
- }
20
+ private readonly _userClass = input<ClassValue>('', { alias: 'class' });
21
+ protected _computedClass = computed(() => hlm(cardTitleVariants(), this._userClass()));
30
22
  }
@@ -1,4 +1,4 @@
1
- import { computed, Directive, Input, signal } from '@angular/core';
1
+ import { computed, Directive, input } from '@angular/core';
2
2
  import { hlm } from '@spartan-ng/ui-core';
3
3
  import { cva, VariantProps } from 'class-variance-authority';
4
4
  import { ClassValue } from 'clsx';
@@ -20,14 +20,6 @@ export type CardVariants = VariantProps<typeof cardVariants>;
20
20
  },
21
21
  })
22
22
  export class HlmCardDirective {
23
- private readonly _userCls = signal<ClassValue>('');
24
- @Input()
25
- set class(userCls: ClassValue) {
26
- this._userCls.set(userCls);
27
- }
28
-
29
- protected _computedClass = computed(() => this._generateClass());
30
- private _generateClass() {
31
- return hlm(cardVariants(), this._userCls());
32
- }
23
+ private readonly _userClass = input<ClassValue>('', { alias: 'class' });
24
+ protected _computedClass = computed(() => hlm(cardVariants(), this._userClass()));
33
25
  }
@@ -0,0 +1,26 @@
1
+ import { NgModule } from '@angular/core';
2
+ import { HlmCarouselContentComponent } from './lib/hlm-carousel-content.component';
3
+ import { HlmCarouselItemComponent } from './lib/hlm-carousel-item.component';
4
+ import { HlmCarouselNextComponent } from './lib/hlm-carousel-next.component';
5
+ import { HlmCarouselPreviousComponent } from './lib/hlm-carousel-previous.component';
6
+ import { HlmCarouselComponent } from './lib/hlm-carousel.component';
7
+
8
+ export * from './lib/hlm-carousel-content.component';
9
+ export * from './lib/hlm-carousel-item.component';
10
+ export * from './lib/hlm-carousel-next.component';
11
+ export * from './lib/hlm-carousel-previous.component';
12
+ export * from './lib/hlm-carousel.component';
13
+
14
+ export const HlmCarouselImports = [
15
+ HlmCarouselComponent,
16
+ HlmCarouselContentComponent,
17
+ HlmCarouselItemComponent,
18
+ HlmCarouselPreviousComponent,
19
+ HlmCarouselNextComponent,
20
+ ] as const;
21
+
22
+ @NgModule({
23
+ imports: [...HlmCarouselImports],
24
+ exports: [...HlmCarouselImports],
25
+ })
26
+ export class HlmCarouselModule {}
@@ -0,0 +1,25 @@
1
+ import { ChangeDetectionStrategy, Component, ViewEncapsulation, computed, inject, input } from '@angular/core';
2
+ import { hlm } from '@spartan-ng/ui-core';
3
+ import { ClassValue } from 'clsx';
4
+ import { HlmCarouselComponent } from './hlm-carousel.component';
5
+
6
+ @Component({
7
+ selector: 'hlm-carousel-content',
8
+ standalone: true,
9
+ changeDetection: ChangeDetectionStrategy.OnPush,
10
+ encapsulation: ViewEncapsulation.None,
11
+ host: {
12
+ '[class]': '_computedClass()',
13
+ },
14
+ template: `
15
+ <ng-content />
16
+ `,
17
+ })
18
+ export class HlmCarouselContentComponent {
19
+ private orientation = inject(HlmCarouselComponent).orientation;
20
+
21
+ _userClass = input<ClassValue>('', { alias: 'class' });
22
+ protected _computedClass = computed(() =>
23
+ hlm('flex', this.orientation() === 'horizontal' ? '-ml-4' : '-mt-4 flex-col', this._userClass()),
24
+ );
25
+ }
@@ -0,0 +1,26 @@
1
+ import { ChangeDetectionStrategy, Component, ViewEncapsulation, computed, inject, input } from '@angular/core';
2
+ import { hlm } from '@spartan-ng/ui-core';
3
+ import { ClassValue } from 'clsx';
4
+ import { HlmCarouselComponent } from './hlm-carousel.component';
5
+
6
+ @Component({
7
+ selector: 'hlm-carousel-item',
8
+ standalone: true,
9
+ changeDetection: ChangeDetectionStrategy.OnPush,
10
+ encapsulation: ViewEncapsulation.None,
11
+ host: {
12
+ '[class]': '_computedClass()',
13
+ role: 'group',
14
+ 'aria-roledescription': 'slide',
15
+ },
16
+ template: `
17
+ <ng-content />
18
+ `,
19
+ })
20
+ export class HlmCarouselItemComponent {
21
+ _userClass = input<ClassValue>('', { alias: 'class' });
22
+ private orientation = inject(HlmCarouselComponent).orientation;
23
+ protected _computedClass = computed(() =>
24
+ hlm('min-w-0 shrink-0 grow-0 basis-full', this.orientation() === 'horizontal' ? 'pl-4' : 'pt-4', this._userClass()),
25
+ );
26
+ }
@@ -0,0 +1,62 @@
1
+ import {
2
+ ChangeDetectionStrategy,
3
+ Component,
4
+ ViewEncapsulation,
5
+ computed,
6
+ effect,
7
+ inject,
8
+ input,
9
+ untracked,
10
+ } from '@angular/core';
11
+ import { lucideArrowRight } from '@ng-icons/lucide';
12
+ import { HlmButtonDirective } from '@spartan-ng/ui-button-helm';
13
+ import { hlm } from '@spartan-ng/ui-core';
14
+ import { HlmIconComponent, provideIcons } from '@spartan-ng/ui-icon-helm';
15
+ import { ClassValue } from 'clsx';
16
+ import { HlmCarouselComponent } from './hlm-carousel.component';
17
+
18
+ @Component({
19
+ // eslint-disable-next-line @angular-eslint/component-selector
20
+ selector: 'button[hlm-carousel-next], button[hlmCarouselNext]',
21
+ standalone: true,
22
+ changeDetection: ChangeDetectionStrategy.OnPush,
23
+ encapsulation: ViewEncapsulation.None,
24
+ host: {
25
+ '[disabled]': 'isDisabled()',
26
+ '(click)': 'carousel.scrollNext()',
27
+ },
28
+ hostDirectives: [{ directive: HlmButtonDirective, inputs: ['variant', 'size'] }],
29
+ providers: [provideIcons({ lucideArrowRight })],
30
+ imports: [HlmIconComponent],
31
+ template: `
32
+ <hlm-icon size="sm" name="lucideArrowRight" />
33
+ <span class="sr-only">Next slide</span>
34
+ `,
35
+ })
36
+ export class HlmCarouselNextComponent {
37
+ protected carousel = inject(HlmCarouselComponent);
38
+ _userClass = input<ClassValue>('', { alias: 'class' });
39
+ protected _computedClass = computed(() =>
40
+ hlm(
41
+ 'absolute h-8 w-8 rounded-full',
42
+ this.carousel.orientation() === 'horizontal'
43
+ ? '-right-12 top-1/2 -translate-y-1/2'
44
+ : '-bottom-12 left-1/2 -translate-x-1/2 rotate-90',
45
+ this._userClass(),
46
+ ),
47
+ );
48
+ protected isDisabled = () => !this.carousel.canScrollNext();
49
+
50
+ constructor() {
51
+ const button = inject(HlmButtonDirective);
52
+
53
+ button.variant = 'outline';
54
+ button.size = 'icon';
55
+
56
+ effect(() => {
57
+ const computedClass = this._computedClass();
58
+
59
+ untracked(() => button.setClass(computedClass));
60
+ });
61
+ }
62
+ }
@@ -0,0 +1,62 @@
1
+ import {
2
+ ChangeDetectionStrategy,
3
+ Component,
4
+ ViewEncapsulation,
5
+ computed,
6
+ effect,
7
+ inject,
8
+ input,
9
+ untracked,
10
+ } from '@angular/core';
11
+ import { lucideArrowLeft } from '@ng-icons/lucide';
12
+ import { HlmButtonDirective } from '@spartan-ng/ui-button-helm';
13
+ import { hlm } from '@spartan-ng/ui-core';
14
+ import { HlmIconComponent, provideIcons } from '@spartan-ng/ui-icon-helm';
15
+ import { ClassValue } from 'clsx';
16
+ import { HlmCarouselComponent } from './hlm-carousel.component';
17
+
18
+ @Component({
19
+ // eslint-disable-next-line @angular-eslint/component-selector
20
+ selector: 'button[hlm-carousel-previous], button[hlmCarouselPrevious]',
21
+ standalone: true,
22
+ changeDetection: ChangeDetectionStrategy.OnPush,
23
+ encapsulation: ViewEncapsulation.None,
24
+ host: {
25
+ '[disabled]': 'isDisabled()',
26
+ '(click)': 'carousel.scrollPrev()',
27
+ },
28
+ hostDirectives: [{ directive: HlmButtonDirective, inputs: ['variant', 'size'] }],
29
+ providers: [provideIcons({ lucideArrowLeft })],
30
+ imports: [HlmIconComponent],
31
+ template: `
32
+ <hlm-icon size="sm" name="lucideArrowLeft" />
33
+ <span class="sr-only">Previous slide</span>
34
+ `,
35
+ })
36
+ export class HlmCarouselPreviousComponent {
37
+ protected carousel = inject(HlmCarouselComponent);
38
+ _userClass = input<ClassValue>('', { alias: 'class' });
39
+ protected _computedClass = computed(() =>
40
+ hlm(
41
+ 'absolute h-8 w-8 rounded-full',
42
+ this.carousel.orientation() === 'horizontal'
43
+ ? '-left-12 top-1/2 -translate-y-1/2'
44
+ : '-top-12 left-1/2 -translate-x-1/2 rotate-90',
45
+ this._userClass(),
46
+ ),
47
+ );
48
+ protected isDisabled = () => !this.carousel.canScrollPrev();
49
+
50
+ constructor() {
51
+ const button = inject(HlmButtonDirective);
52
+
53
+ button.variant = 'outline';
54
+ button.size = 'icon';
55
+
56
+ effect(() => {
57
+ const computedClass = this._computedClass();
58
+
59
+ untracked(() => button.setClass(computedClass));
60
+ });
61
+ }
62
+ }
@@ -0,0 +1,93 @@
1
+ import {
2
+ ChangeDetectionStrategy,
3
+ Component,
4
+ HostListener,
5
+ InputSignal,
6
+ Signal,
7
+ ViewChild,
8
+ ViewEncapsulation,
9
+ computed,
10
+ input,
11
+ signal,
12
+ } from '@angular/core';
13
+ import { hlm } from '@spartan-ng/ui-core';
14
+ import { ClassValue } from 'clsx';
15
+ import { EmblaCarouselDirective, EmblaEventType, EmblaPluginType, type EmblaOptionsType } from 'embla-carousel-angular';
16
+
17
+ @Component({
18
+ selector: 'hlm-carousel',
19
+ standalone: true,
20
+ changeDetection: ChangeDetectionStrategy.OnPush,
21
+ encapsulation: ViewEncapsulation.None,
22
+ host: {
23
+ '[class]': '_computedClass()',
24
+ role: 'region',
25
+ 'aria-roledescription': 'carousel',
26
+ },
27
+ imports: [EmblaCarouselDirective],
28
+ template: `
29
+ <div
30
+ emblaCarousel
31
+ class="overflow-hidden"
32
+ [plugins]="plugins()"
33
+ [options]="emblaOptions()"
34
+ [subscribeToEvents]="['init', 'select', 'reInit']"
35
+ (emblaChange)="onEmblaEvent($event)"
36
+ >
37
+ <ng-content select="hlm-carousel-content" />
38
+ </div>
39
+ <ng-content />
40
+ `,
41
+ })
42
+ export class HlmCarouselComponent {
43
+ @ViewChild(EmblaCarouselDirective) protected emblaCarousel?: EmblaCarouselDirective;
44
+
45
+ _userClass = input<ClassValue>('', { alias: 'class' });
46
+ protected _computedClass = computed(() => hlm('relative', this._userClass()));
47
+
48
+ orientation = input<'horizontal' | 'vertical'>('horizontal');
49
+ options: InputSignal<Omit<EmblaOptionsType, 'axis'> | undefined> = input();
50
+ plugins: InputSignal<EmblaPluginType[]> = input([] as EmblaPluginType[]);
51
+
52
+ protected emblaOptions: Signal<EmblaOptionsType> = computed(() => ({
53
+ ...this.options(),
54
+ axis: this.orientation() === 'horizontal' ? 'x' : 'y',
55
+ }));
56
+
57
+ private _canScrollPrev = signal(false);
58
+ canScrollPrev = this._canScrollPrev.asReadonly();
59
+ private _canScrollNext = signal(false);
60
+ canScrollNext = this._canScrollNext.asReadonly();
61
+
62
+ protected onEmblaEvent(event: EmblaEventType) {
63
+ const emblaApi = this.emblaCarousel?.emblaApi;
64
+
65
+ if (!emblaApi) {
66
+ return;
67
+ }
68
+
69
+ if (event === 'select' || event === 'init' || event === 'reInit') {
70
+ this._canScrollPrev.set(emblaApi.canScrollPrev());
71
+ this._canScrollNext.set(emblaApi.canScrollNext());
72
+ }
73
+ }
74
+
75
+ @HostListener('keydown', ['$event'])
76
+ protected onKeydown(event: KeyboardEvent) {
77
+ if (event.key === 'ArrowLeft') {
78
+ event.preventDefault();
79
+ this.emblaCarousel?.scrollPrev();
80
+ } else if (event.key === 'ArrowRight') {
81
+ event.preventDefault();
82
+ this.emblaCarousel?.scrollNext();
83
+ }
84
+ }
85
+
86
+ scrollPrev() {
87
+ this.emblaCarousel?.scrollPrev();
88
+ }
89
+
90
+ scrollNext() {
91
+ this.emblaCarousel?.scrollNext();
92
+ }
93
+ }
@@ -0,0 +1,3 @@
1
+ import { Tree } from '@nx/devkit';
2
+ import { HlmBaseGeneratorSchema } from '../../../base/schema';
3
+ export declare function generator(tree: Tree, options: HlmBaseGeneratorSchema): Promise<import("@nx/devkit").GeneratorCallback>;
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.generator = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const generator_1 = require("../../../base/generator");
6
+ function generator(tree, options) {
7
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
8
+ return yield (0, generator_1.default)(tree, Object.assign(Object.assign({}, options), { primitiveName: 'carousel', internalName: 'ui-carousel-helm', publicName: 'ui-carousel-helm' }));
9
+ });
10
+ }
11
+ exports.generator = generator;
12
+ //# sourceMappingURL=generator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../../../libs/cli/src/generators/ui/libs/ui-carousel-helm/generator.ts"],"names":[],"mappings":";;;;AACA,uDAAuD;AAGvD,SAAsB,SAAS,CAAC,IAAU,EAAE,OAA+B;;QAC1E,OAAO,MAAM,IAAA,mBAAgB,EAAC,IAAI,kCAC9B,OAAO,KACV,aAAa,EAAE,UAAU,EACzB,YAAY,EAAE,kBAAkB,EAChC,UAAU,EAAE,kBAAkB,IAC7B,CAAC;IACJ,CAAC;CAAA;AAPD,8BAOC"}
@@ -1,5 +1,5 @@
1
- import { Component, computed, inject, Input, signal } from '@angular/core';
2
- import { radixCheck } from '@ng-icons/radix-icons';
1
+ import { Component, computed, inject, input, Input, signal } from '@angular/core';
2
+ import { lucideCheck } from '@ng-icons/lucide';
3
3
  import { BrnCheckboxComponent } from '@spartan-ng/ui-checkbox-brain';
4
4
  import { hlm } from '@spartan-ng/ui-core';
5
5
  import { HlmIconComponent, provideIcons } from '@spartan-ng/ui-icon-helm';
@@ -9,7 +9,7 @@ import { ClassValue } from 'clsx';
9
9
  selector: 'hlm-checkbox-checkicon',
10
10
  standalone: true,
11
11
  imports: [HlmIconComponent],
12
- providers: [provideIcons({ radixCheck })],
12
+ providers: [provideIcons({ lucideCheck })],
13
13
  host: {
14
14
  '[class]': '_computedClass()',
15
15
  },
@@ -20,24 +20,23 @@ import { ClassValue } from 'clsx';
20
20
  export class HlmCheckboxCheckIconComponent {
21
21
  private _brnCheckbox = inject(BrnCheckboxComponent);
22
22
  protected _checked = this._brnCheckbox?.isChecked;
23
- private readonly _userCls = signal<ClassValue>('');
24
- @Input()
25
- set class(userCls: ClassValue) {
26
- this._userCls.set(userCls);
27
- }
23
+ // TODO - this cannot be private for some reason
24
+ // build fails because hlm-checkbox.component.ts is giving the following error:
25
+ // Property '_userClass' is private and only accessible within class 'HlmCheckboxCheckIconComponent'.
26
+ // it should work as private but it doesn't
27
+ readonly _userClass = input<ClassValue>('', { alias: 'class' });
28
28
 
29
- protected readonly _iconName = signal<string>('radixCheck');
29
+ protected readonly _iconName = signal<string>('lucideCheck');
30
30
  @Input()
31
31
  set iconName(iconName: string) {
32
32
  this._iconName.set(iconName);
33
33
  }
34
34
 
35
- protected _computedClass = computed(() => this._generateClass());
36
- private _generateClass() {
37
- return hlm(
35
+ protected _computedClass = computed(() =>
36
+ hlm(
38
37
  'h-4 w-4 leading-none group-data-[state=unchecked]:opacity-0',
39
38
  this._checked() === 'indeterminate' ? 'opacity-50' : '',
40
- this._userCls(),
41
- );
42
- }
39
+ this._userClass(),
40
+ ),
41
+ );
43
42
  }