@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.
- package/package.json +1 -1
- package/src/generators/migrate-brain-imports/import-map.d.ts +0 -1
- package/src/generators/migrate-brain-imports/import-map.js +0 -1
- package/src/generators/migrate-brain-imports/import-map.js.map +1 -1
- package/src/generators/ui/libs/accordion/files/lib/hlm-accordion-content.ts.template +6 -13
- package/src/generators/ui/libs/accordion/files/lib/hlm-accordion-icon.ts.template +8 -13
- package/src/generators/ui/libs/accordion/files/lib/hlm-accordion-item.ts.template +5 -10
- package/src/generators/ui/libs/accordion/files/lib/hlm-accordion-trigger.ts.template +8 -11
- package/src/generators/ui/libs/accordion/files/lib/hlm-accordion.ts.template +5 -10
- package/src/generators/ui/libs/alert/files/lib/hlm-alert-description.ts.template +5 -13
- package/src/generators/ui/libs/alert/files/lib/hlm-alert-title.ts.template +5 -10
- package/src/generators/ui/libs/alert/files/lib/hlm-alert.ts.template +6 -7
- package/src/generators/ui/libs/alert-dialog/files/lib/hlm-alert-dialog-content.ts.template +8 -11
- package/src/generators/ui/libs/alert-dialog/files/lib/hlm-alert-dialog-description.ts.template +5 -6
- package/src/generators/ui/libs/alert-dialog/files/lib/hlm-alert-dialog-footer.ts.template +5 -8
- package/src/generators/ui/libs/alert-dialog/files/lib/hlm-alert-dialog-header.ts.template +5 -8
- package/src/generators/ui/libs/alert-dialog/files/lib/hlm-alert-dialog-title.ts.template +5 -6
- package/src/generators/ui/libs/aspect-ratio/files/lib/helm-aspect-ratio.ts.template +9 -15
- package/src/generators/ui/libs/autocomplete/files/lib/hlm-autocomplete-empty.ts.template +5 -8
- package/src/generators/ui/libs/autocomplete/files/lib/hlm-autocomplete-group.ts.template +5 -13
- package/src/generators/ui/libs/autocomplete/files/lib/hlm-autocomplete-item.ts.template +8 -16
- package/src/generators/ui/libs/autocomplete/files/lib/hlm-autocomplete-list.ts.template +5 -13
- package/src/generators/ui/libs/autocomplete/files/lib/hlm-autocomplete.ts.template +7 -13
- package/src/generators/ui/libs/avatar/files/lib/fallback/hlm-avatar-fallback.ts.template +5 -11
- package/src/generators/ui/libs/avatar/files/lib/hlm-avatar.ts.template +6 -11
- package/src/generators/ui/libs/avatar/files/lib/image/hlm-avatar-image.ts.template +6 -9
- package/src/generators/ui/libs/badge/files/lib/hlm-badge.ts.template +6 -7
- package/src/generators/ui/libs/breadcrumb/files/lib/hlm-breadcrumb-item.ts.template +5 -9
- package/src/generators/ui/libs/breadcrumb/files/lib/hlm-breadcrumb-link.ts.template +6 -9
- package/src/generators/ui/libs/breadcrumb/files/lib/hlm-breadcrumb-list.ts.template +5 -11
- package/src/generators/ui/libs/breadcrumb/files/lib/hlm-breadcrumb-page.ts.template +5 -7
- package/src/generators/ui/libs/breadcrumb/files/lib/hlm-breadcrumb-separator.ts.template +5 -7
- package/src/generators/ui/libs/breadcrumb/files/lib/hlm-breadcrumb.ts.template +1 -7
- package/src/generators/ui/libs/button/files/lib/hlm-button.ts.template +6 -9
- package/src/generators/ui/libs/button-group/files/lib/hlm-button-group-separator.ts.template +8 -12
- package/src/generators/ui/libs/button-group/files/lib/hlm-button-group-text.ts.template +8 -14
- package/src/generators/ui/libs/button-group/files/lib/hlm-button-group.ts.template +6 -9
- package/src/generators/ui/libs/card/files/lib/hlm-card-action.ts.template +5 -10
- package/src/generators/ui/libs/card/files/lib/hlm-card-content.ts.template +5 -8
- package/src/generators/ui/libs/card/files/lib/hlm-card-description.ts.template +5 -8
- package/src/generators/ui/libs/card/files/lib/hlm-card-footer.ts.template +5 -8
- package/src/generators/ui/libs/card/files/lib/hlm-card-header.ts.template +8 -13
- package/src/generators/ui/libs/card/files/lib/hlm-card-title.ts.template +5 -8
- package/src/generators/ui/libs/card/files/lib/hlm-card.ts.template +5 -8
- package/src/generators/ui/libs/carousel/files/lib/hlm-carousel-content.ts.template +5 -8
- package/src/generators/ui/libs/carousel/files/lib/hlm-carousel-item.ts.template +5 -8
- package/src/generators/ui/libs/carousel/files/lib/hlm-carousel-next.ts.template +1 -4
- package/src/generators/ui/libs/carousel/files/lib/hlm-carousel-previous.ts.template +1 -6
- package/src/generators/ui/libs/carousel/files/lib/hlm-carousel-slide-display.ts.template +0 -5
- package/src/generators/ui/libs/carousel/files/lib/hlm-carousel.ts.template +5 -6
- package/src/generators/ui/libs/collapsible/files/lib/hlm-collapsible-content.ts.template +5 -7
- package/src/generators/ui/libs/command/files/lib/hlm-command-dialog-close-button.ts.template +8 -13
- package/src/generators/ui/libs/command/files/lib/hlm-command-dialog.ts.template +7 -12
- package/src/generators/ui/libs/command/files/lib/hlm-command-empty.ts.template +5 -6
- package/src/generators/ui/libs/command/files/lib/hlm-command-group-label.ts.template +5 -11
- package/src/generators/ui/libs/command/files/lib/hlm-command-group.ts.template +5 -11
- package/src/generators/ui/libs/command/files/lib/hlm-command-icon.ts.template +5 -8
- package/src/generators/ui/libs/command/files/lib/hlm-command-item.ts.template +8 -14
- package/src/generators/ui/libs/command/files/lib/hlm-command-list.ts.template +5 -11
- package/src/generators/ui/libs/command/files/lib/hlm-command-search-input.ts.template +8 -14
- package/src/generators/ui/libs/command/files/lib/hlm-command-search.ts.template +5 -11
- package/src/generators/ui/libs/command/files/lib/hlm-command-separator.ts.template +5 -9
- package/src/generators/ui/libs/command/files/lib/hlm-command-shortcut.ts.template +5 -8
- package/src/generators/ui/libs/command/files/lib/hlm-command.ts.template +5 -11
- package/src/generators/ui/libs/dialog/files/lib/hlm-dialog-close.ts.template +8 -12
- package/src/generators/ui/libs/dialog/files/lib/hlm-dialog-content.ts.template +6 -10
- package/src/generators/ui/libs/dialog/files/lib/hlm-dialog-description.ts.template +5 -6
- package/src/generators/ui/libs/dialog/files/lib/hlm-dialog-footer.ts.template +5 -8
- package/src/generators/ui/libs/dialog/files/lib/hlm-dialog-header.ts.template +5 -8
- package/src/generators/ui/libs/dialog/files/lib/hlm-dialog-overlay.ts.template +2 -2
- package/src/generators/ui/libs/dialog/files/lib/hlm-dialog-title.ts.template +5 -6
- package/src/generators/ui/libs/dropdown-menu/files/lib/hlm-dropdown-menu-checkbox-indicator.ts.template +8 -13
- package/src/generators/ui/libs/dropdown-menu/files/lib/hlm-dropdown-menu-checkbox.ts.template +9 -13
- package/src/generators/ui/libs/dropdown-menu/files/lib/hlm-dropdown-menu-group.ts.template +5 -6
- package/src/generators/ui/libs/dropdown-menu/files/lib/hlm-dropdown-menu-item-sub-indicator.ts.template +5 -8
- package/src/generators/ui/libs/dropdown-menu/files/lib/hlm-dropdown-menu-item.ts.template +9 -12
- package/src/generators/ui/libs/dropdown-menu/files/lib/hlm-dropdown-menu-label.ts.template +5 -8
- package/src/generators/ui/libs/dropdown-menu/files/lib/hlm-dropdown-menu-radio-indicator.ts.template +8 -13
- package/src/generators/ui/libs/dropdown-menu/files/lib/hlm-dropdown-menu-radio.ts.template +9 -13
- package/src/generators/ui/libs/dropdown-menu/files/lib/hlm-dropdown-menu-separator.ts.template +5 -6
- package/src/generators/ui/libs/dropdown-menu/files/lib/hlm-dropdown-menu-shortcut.ts.template +5 -8
- package/src/generators/ui/libs/dropdown-menu/files/lib/hlm-dropdown-menu-sub.ts.template +7 -12
- package/src/generators/ui/libs/dropdown-menu/files/lib/hlm-dropdown-menu.ts.template +7 -12
- package/src/generators/ui/libs/empty/files/lib/hlm-empty-content.ts.template +5 -9
- package/src/generators/ui/libs/empty/files/lib/hlm-empty-description.ts.template +7 -12
- package/src/generators/ui/libs/empty/files/lib/hlm-empty-header.ts.template +5 -9
- package/src/generators/ui/libs/empty/files/lib/hlm-empty-media.ts.template +6 -9
- package/src/generators/ui/libs/empty/files/lib/hlm-empty-title.ts.template +5 -7
- package/src/generators/ui/libs/empty/files/lib/hlm-empty.ts.template +8 -12
- package/src/generators/ui/libs/field/files/lib/hlm-field-content.ts.template +5 -9
- package/src/generators/ui/libs/field/files/lib/hlm-field-description.ts.template +6 -11
- package/src/generators/ui/libs/field/files/lib/hlm-field-group.ts.template +8 -12
- package/src/generators/ui/libs/field/files/lib/hlm-field-label.ts.template +6 -11
- package/src/generators/ui/libs/field/files/lib/hlm-field-legend.ts.template +6 -9
- package/src/generators/ui/libs/field/files/lib/hlm-field-separator.ts.template +5 -9
- package/src/generators/ui/libs/field/files/lib/hlm-field-set.ts.template +6 -11
- package/src/generators/ui/libs/field/files/lib/hlm-field-title.ts.template +8 -12
- package/src/generators/ui/libs/field/files/lib/hlm-field.ts.template +5 -9
- package/src/generators/ui/libs/form-field/files/lib/hlm-error.ts.template +5 -10
- package/src/generators/ui/libs/form-field/files/lib/hlm-form-field.ts.template +3 -16
- package/src/generators/ui/libs/form-field/files/lib/hlm-hint.ts.template +5 -8
- package/src/generators/ui/libs/hover-card/files/lib/hlm-hover-card-content.ts.template +5 -11
- package/src/generators/ui/libs/input/files/lib/hlm-input.ts.template +4 -10
- package/src/generators/ui/libs/input-group/files/lib/hlm-input-group-addon.ts.template +5 -8
- package/src/generators/ui/libs/input-group/files/lib/hlm-input-group-button.ts.template +3 -12
- package/src/generators/ui/libs/input-group/files/lib/hlm-input-group-input.ts.template +3 -18
- package/src/generators/ui/libs/input-group/files/lib/hlm-input-group-text.ts.template +8 -14
- package/src/generators/ui/libs/input-group/files/lib/hlm-input-group-textarea.ts.template +6 -18
- package/src/generators/ui/libs/input-group/files/lib/hlm-input-group.ts.template +6 -12
- package/src/generators/ui/libs/input-otp/files/lib/hlm-input-otp-group.ts.template +5 -7
- package/src/generators/ui/libs/input-otp/files/lib/hlm-input-otp-separator.ts.template +5 -7
- package/src/generators/ui/libs/input-otp/files/lib/hlm-input-otp-slot.ts.template +6 -11
- package/src/generators/ui/libs/input-otp/files/lib/hlm-input-otp.ts.template +5 -9
- package/src/generators/ui/libs/item/files/lib/hlm-item-actions.ts.template +5 -6
- package/src/generators/ui/libs/item/files/lib/hlm-item-content.ts.template +5 -8
- package/src/generators/ui/libs/item/files/lib/hlm-item-description.ts.template +6 -10
- package/src/generators/ui/libs/item/files/lib/hlm-item-footer.ts.template +5 -8
- package/src/generators/ui/libs/item/files/lib/hlm-item-group.ts.template +6 -6
- package/src/generators/ui/libs/item/files/lib/hlm-item-header.ts.template +5 -8
- package/src/generators/ui/libs/item/files/lib/hlm-item-media.ts.template +6 -10
- package/src/generators/ui/libs/item/files/lib/hlm-item-separator.ts.template +6 -7
- package/src/generators/ui/libs/item/files/lib/hlm-item-title.ts.template +5 -8
- package/src/generators/ui/libs/item/files/lib/hlm-item.ts.template +6 -10
- package/src/generators/ui/libs/kbd/files/lib/hlm-kbd-group.ts.template +5 -6
- package/src/generators/ui/libs/kbd/files/lib/hlm-kbd.ts.template +6 -10
- package/src/generators/ui/libs/label/files/lib/hlm-label.ts.template +8 -14
- package/src/generators/ui/libs/menubar/files/lib/hlm-menubar-trigger.ts.template +6 -11
- package/src/generators/ui/libs/menubar/files/lib/hlm-menubar.ts.template +5 -8
- package/src/generators/ui/libs/navigation-menu/files/hlm-navigation-menu-content.ts.template +7 -13
- package/src/generators/ui/libs/navigation-menu/files/hlm-navigation-menu-item.ts.template +5 -8
- package/src/generators/ui/libs/navigation-menu/files/hlm-navigation-menu-link.ts.template +6 -12
- package/src/generators/ui/libs/navigation-menu/files/hlm-navigation-menu-list.ts.template +6 -12
- package/src/generators/ui/libs/navigation-menu/files/hlm-navigation-menu-trigger.ts.template +8 -13
- package/src/generators/ui/libs/navigation-menu/files/hlm-navigation-menu.ts.template +5 -10
- package/src/generators/ui/libs/pagination/files/lib/hlm-pagination-content.ts.template +5 -6
- package/src/generators/ui/libs/pagination/files/lib/hlm-pagination-ellipsis.ts.template +6 -6
- package/src/generators/ui/libs/pagination/files/lib/hlm-pagination-item.ts.template +5 -6
- package/src/generators/ui/libs/pagination/files/lib/hlm-pagination-link.ts.template +7 -12
- package/src/generators/ui/libs/pagination/files/lib/hlm-pagination-next.ts.template +5 -8
- package/src/generators/ui/libs/pagination/files/lib/hlm-pagination-previous.ts.template +4 -8
- package/src/generators/ui/libs/pagination/files/lib/hlm-pagination.ts.template +6 -7
- package/src/generators/ui/libs/popover/files/lib/hlm-popover-content.ts.template +7 -14
- package/src/generators/ui/libs/progress/files/lib/hlm-progress-indicator.ts.template +7 -15
- package/src/generators/ui/libs/progress/files/lib/hlm-progress.ts.template +5 -10
- package/src/generators/ui/libs/radio-group/files/lib/hlm-radio-group.ts.template +5 -6
- package/src/generators/ui/libs/radio-group/files/lib/hlm-radio-indicator.ts.template +8 -11
- package/src/generators/ui/libs/resizable/files/lib/hlm-resizable-group.ts.template +5 -9
- package/src/generators/ui/libs/resizable/files/lib/hlm-resizable-handle.ts.template +8 -12
- package/src/generators/ui/libs/resizable/files/lib/hlm-resizable-panel.ts.template +2 -8
- package/src/generators/ui/libs/scroll-area/files/lib/hlm-scroll-area.ts.template +5 -6
- package/src/generators/ui/libs/select/files/lib/hlm-select-content.ts.template +8 -11
- package/src/generators/ui/libs/select/files/lib/hlm-select-group.ts.template +2 -10
- package/src/generators/ui/libs/select/files/lib/hlm-select-label.ts.template +7 -12
- package/src/generators/ui/libs/select/files/lib/hlm-select-option.ts.template +8 -13
- package/src/generators/ui/libs/select/files/lib/hlm-select-scroll-down.ts.template +5 -10
- package/src/generators/ui/libs/select/files/lib/hlm-select-scroll-up.ts.template +5 -10
- package/src/generators/ui/libs/select/files/lib/hlm-select-value.ts.template +5 -10
- package/src/generators/ui/libs/select/files/lib/hlm-select.ts.template +5 -8
- package/src/generators/ui/libs/separator/files/lib/hlm-separator.ts.template +5 -8
- package/src/generators/ui/libs/sheet/files/lib/hlm-sheet-close.ts.template +8 -11
- package/src/generators/ui/libs/sheet/files/lib/hlm-sheet-content.ts.template +3 -19
- package/src/generators/ui/libs/sheet/files/lib/hlm-sheet-description.ts.template +5 -6
- package/src/generators/ui/libs/sheet/files/lib/hlm-sheet-footer.ts.template +5 -6
- package/src/generators/ui/libs/sheet/files/lib/hlm-sheet-header.ts.template +5 -6
- package/src/generators/ui/libs/sheet/files/lib/hlm-sheet-title.ts.template +5 -6
- package/src/generators/ui/libs/sidebar/files/lib/hlm-sidebar-content.ts.template +5 -11
- package/src/generators/ui/libs/sidebar/files/lib/hlm-sidebar-footer.ts.template +5 -6
- package/src/generators/ui/libs/sidebar/files/lib/hlm-sidebar-group-action.ts.template +6 -10
- package/src/generators/ui/libs/sidebar/files/lib/hlm-sidebar-group-content.ts.template +5 -6
- package/src/generators/ui/libs/sidebar/files/lib/hlm-sidebar-group-label.ts.template +6 -10
- package/src/generators/ui/libs/sidebar/files/lib/hlm-sidebar-group.ts.template +5 -8
- package/src/generators/ui/libs/sidebar/files/lib/hlm-sidebar-header.ts.template +5 -6
- package/src/generators/ui/libs/sidebar/files/lib/hlm-sidebar-input.ts.template +7 -8
- package/src/generators/ui/libs/sidebar/files/lib/hlm-sidebar-inset.ts.template +6 -10
- package/src/generators/ui/libs/sidebar/files/lib/hlm-sidebar-menu-action.ts.template +7 -10
- package/src/generators/ui/libs/sidebar/files/lib/hlm-sidebar-menu-badge.ts.template +6 -10
- package/src/generators/ui/libs/sidebar/files/lib/hlm-sidebar-menu-button.ts.template +5 -7
- package/src/generators/ui/libs/sidebar/files/lib/hlm-sidebar-menu-item.ts.template +5 -6
- package/src/generators/ui/libs/sidebar/files/lib/hlm-sidebar-menu-skeleton.ts.template +6 -8
- package/src/generators/ui/libs/sidebar/files/lib/hlm-sidebar-menu-sub-button.ts.template +6 -10
- package/src/generators/ui/libs/sidebar/files/lib/hlm-sidebar-menu-sub-item.ts.template +5 -6
- package/src/generators/ui/libs/sidebar/files/lib/hlm-sidebar-menu-sub.ts.template +6 -10
- package/src/generators/ui/libs/sidebar/files/lib/hlm-sidebar-menu.ts.template +5 -6
- package/src/generators/ui/libs/sidebar/files/lib/hlm-sidebar-rail.ts.template +6 -10
- package/src/generators/ui/libs/sidebar/files/lib/hlm-sidebar-separator.ts.template +5 -6
- package/src/generators/ui/libs/sidebar/files/lib/hlm-sidebar-wrapper.ts.template +6 -9
- package/src/generators/ui/libs/sidebar/files/lib/hlm-sidebar.ts.template +11 -14
- package/src/generators/ui/libs/skeleton/files/lib/hlm-skeleton.ts.template +5 -8
- package/src/generators/ui/libs/slider/files/lib/hlm-slider.ts.template +5 -14
- package/src/generators/ui/libs/spinner/files/lib/hlm-spinner.ts.template +6 -7
- package/src/generators/ui/libs/switch/files/lib/hlm-switch-thumb.ts.template +8 -14
- package/src/generators/ui/libs/table/files/lib/hlm-table.ts.template +39 -79
- package/src/generators/ui/libs/tabs/files/lib/hlm-tabs-content.ts.template +8 -11
- package/src/generators/ui/libs/tabs/files/lib/hlm-tabs-list.ts.template +5 -8
- package/src/generators/ui/libs/tabs/files/lib/hlm-tabs-paginated-list.ts.template +6 -7
- package/src/generators/ui/libs/tabs/files/lib/hlm-tabs-trigger.ts.template +8 -11
- package/src/generators/ui/libs/tabs/files/lib/hlm-tabs.ts.template +5 -6
- package/src/generators/ui/libs/textarea/files/lib/hlm-textarea.ts.template +4 -8
- package/src/generators/ui/libs/toggle/files/lib/hlm-toggle.ts.template +6 -11
- package/src/generators/ui/libs/toggle-group/files/lib/hlm-toggle-group-item.ts.template +7 -12
- package/src/generators/ui/libs/toggle-group/files/lib/hlm-toggle-group.ts.template +5 -11
- package/src/generators/ui/libs/typography/files/lib/hlm-blockquote.ts.template +5 -8
- package/src/generators/ui/libs/typography/files/lib/hlm-code.ts.template +5 -8
- package/src/generators/ui/libs/typography/files/lib/hlm-h1.ts.template +5 -8
- package/src/generators/ui/libs/typography/files/lib/hlm-h2.ts.template +5 -8
- package/src/generators/ui/libs/typography/files/lib/hlm-h3.ts.template +5 -8
- package/src/generators/ui/libs/typography/files/lib/hlm-h4.ts.template +5 -8
- package/src/generators/ui/libs/typography/files/lib/hlm-large.ts.template +5 -8
- package/src/generators/ui/libs/typography/files/lib/hlm-lead.ts.template +5 -8
- package/src/generators/ui/libs/typography/files/lib/hlm-muted.ts.template +5 -8
- package/src/generators/ui/libs/typography/files/lib/hlm-p.ts.template +5 -8
- package/src/generators/ui/libs/typography/files/lib/hlm-small.ts.template +5 -8
- package/src/generators/ui/libs/typography/files/lib/hlm-ul.ts.template +5 -8
- package/src/generators/ui/libs/utils/files/lib/hlm.ts.template +251 -0
- package/src/generators/ui/supported-ui-libraries.json +66 -97
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Directive
|
|
1
|
+
import { Directive } from '@angular/core';
|
|
2
2
|
import { BrnAvatarFallback } from '@spartan-ng/brain/avatar';
|
|
3
|
-
import {
|
|
3
|
+
import { classes } from '<%- importAlias %>/utils';
|
|
4
4
|
|
|
5
5
|
@Directive({
|
|
6
6
|
selector: '[hlmAvatarFallback]',
|
|
@@ -8,17 +8,11 @@ import { hlm } from '<%- importAlias %>/utils';
|
|
|
8
8
|
hostDirectives: [
|
|
9
9
|
{
|
|
10
10
|
directive: BrnAvatarFallback,
|
|
11
|
-
inputs: ['class'],
|
|
12
11
|
},
|
|
13
12
|
],
|
|
14
|
-
host: {
|
|
15
|
-
'[class]': '_computedClass()',
|
|
16
|
-
},
|
|
17
13
|
})
|
|
18
14
|
export class HlmAvatarFallback {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
return hlm('bg-muted flex size-full items-center justify-center rounded-full', this._brn?.userClass());
|
|
23
|
-
});
|
|
15
|
+
constructor() {
|
|
16
|
+
classes(() => 'bg-muted flex size-full items-center justify-center rounded-full');
|
|
17
|
+
}
|
|
24
18
|
}
|
|
@@ -1,14 +1,10 @@
|
|
|
1
|
-
import { ChangeDetectionStrategy, Component
|
|
1
|
+
import { ChangeDetectionStrategy, Component } from '@angular/core';
|
|
2
2
|
import { BrnAvatar } from '@spartan-ng/brain/avatar';
|
|
3
|
-
import {
|
|
4
|
-
import type { ClassValue } from 'clsx';
|
|
3
|
+
import { classes } from '<%- importAlias %>/utils';
|
|
5
4
|
|
|
6
5
|
@Component({
|
|
7
6
|
selector: 'hlm-avatar',
|
|
8
7
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
9
|
-
host: {
|
|
10
|
-
'[class]': '_computedClass()',
|
|
11
|
-
},
|
|
12
8
|
template: `
|
|
13
9
|
@if (_image()?.canShow()) {
|
|
14
10
|
<ng-content select="[hlmAvatarImage],[brnAvatarImage]" />
|
|
@@ -18,9 +14,8 @@ import type { ClassValue } from 'clsx';
|
|
|
18
14
|
`,
|
|
19
15
|
})
|
|
20
16
|
export class HlmAvatar extends BrnAvatar {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
);
|
|
17
|
+
constructor() {
|
|
18
|
+
super();
|
|
19
|
+
classes(() => 'relative flex size-8 shrink-0 overflow-hidden rounded-full');
|
|
20
|
+
}
|
|
26
21
|
}
|
|
@@ -1,19 +1,16 @@
|
|
|
1
|
-
import { Directive,
|
|
1
|
+
import { Directive, inject } from '@angular/core';
|
|
2
2
|
import { BrnAvatarImage } from '@spartan-ng/brain/avatar';
|
|
3
|
-
import {
|
|
4
|
-
import type { ClassValue } from 'clsx';
|
|
3
|
+
import { classes } from '<%- importAlias %>/utils';
|
|
5
4
|
|
|
6
5
|
@Directive({
|
|
7
6
|
selector: 'img[hlmAvatarImage]',
|
|
8
7
|
exportAs: 'avatarImage',
|
|
9
8
|
hostDirectives: [BrnAvatarImage],
|
|
10
|
-
host: {
|
|
11
|
-
'[class]': '_computedClass()',
|
|
12
|
-
},
|
|
13
9
|
})
|
|
14
10
|
export class HlmAvatarImage {
|
|
15
|
-
public canShow = inject(BrnAvatarImage).canShow;
|
|
11
|
+
public readonly canShow = inject(BrnAvatarImage).canShow;
|
|
16
12
|
|
|
17
|
-
|
|
18
|
-
|
|
13
|
+
constructor() {
|
|
14
|
+
classes(() => 'aspect-square size-full');
|
|
15
|
+
}
|
|
19
16
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { Directive,
|
|
2
|
-
import {
|
|
1
|
+
import { Directive, input } from '@angular/core';
|
|
2
|
+
import { classes } from '<%- importAlias %>/utils';
|
|
3
3
|
import { type VariantProps, cva } from 'class-variance-authority';
|
|
4
|
-
import type { ClassValue } from 'clsx';
|
|
5
4
|
|
|
6
5
|
const badgeVariants = cva(
|
|
7
6
|
'focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive inline-flex w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-md border px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[3px] [&_ng-icon]:pointer-events-none [&_ng-icon]:size-3',
|
|
@@ -27,12 +26,12 @@ export type BadgeVariants = VariantProps<typeof badgeVariants>;
|
|
|
27
26
|
selector: '[hlmBadge]',
|
|
28
27
|
host: {
|
|
29
28
|
'data-slot': 'badge',
|
|
30
|
-
'[class]': '_computedClass()',
|
|
31
29
|
},
|
|
32
30
|
})
|
|
33
31
|
export class HlmBadge {
|
|
34
|
-
protected readonly _computedClass = computed(() => hlm(badgeVariants({ variant: this.variant() }), this.userClass()));
|
|
35
|
-
|
|
36
|
-
public readonly userClass = input<ClassValue>('', { alias: 'class' });
|
|
37
32
|
public readonly variant = input<BadgeVariants['variant']>('default');
|
|
33
|
+
|
|
34
|
+
constructor() {
|
|
35
|
+
classes(() => badgeVariants({ variant: this.variant() }));
|
|
36
|
+
}
|
|
38
37
|
}
|
|
@@ -1,15 +1,11 @@
|
|
|
1
|
-
import { Directive
|
|
2
|
-
import {
|
|
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: '[hlmBreadcrumbItem]',
|
|
7
|
-
host: {
|
|
8
|
-
'[class]': '_computedClass()',
|
|
9
|
-
},
|
|
10
6
|
})
|
|
11
7
|
export class HlmBreadcrumbItem {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
8
|
+
constructor() {
|
|
9
|
+
classes(() => 'inline-flex items-center gap-1.5');
|
|
10
|
+
}
|
|
15
11
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { Directive,
|
|
1
|
+
import { Directive, input } from '@angular/core';
|
|
2
2
|
import { RouterLink } from '@angular/router';
|
|
3
|
-
import {
|
|
4
|
-
import type { ClassValue } from 'clsx';
|
|
3
|
+
import { classes } from '<%- importAlias %>/utils';
|
|
5
4
|
|
|
6
5
|
@Directive({
|
|
7
6
|
selector: '[hlmBreadcrumbLink]',
|
|
@@ -23,14 +22,12 @@ import type { ClassValue } from 'clsx';
|
|
|
23
22
|
],
|
|
24
23
|
},
|
|
25
24
|
],
|
|
26
|
-
host: {
|
|
27
|
-
'[class]': '_computedClass()',
|
|
28
|
-
},
|
|
29
25
|
})
|
|
30
26
|
export class HlmBreadcrumbLink {
|
|
31
|
-
|
|
27
|
+
constructor() {
|
|
28
|
+
classes(() => 'hover:text-foreground transition-colors');
|
|
29
|
+
}
|
|
30
|
+
|
|
32
31
|
/** The link to navigate to the page. */
|
|
33
32
|
public readonly link = input<RouterLink['routerLink']>();
|
|
34
|
-
|
|
35
|
-
protected readonly _computedClass = computed(() => hlm('hover:text-foreground transition-colors', this.userClass()));
|
|
36
33
|
}
|
|
@@ -1,17 +1,11 @@
|
|
|
1
|
-
import { Directive
|
|
2
|
-
import {
|
|
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: '[hlmBreadcrumbList]',
|
|
7
|
-
host: {
|
|
8
|
-
'[class]': '_computedClass()',
|
|
9
|
-
},
|
|
10
6
|
})
|
|
11
7
|
export class HlmBreadcrumbList {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
hlm('text-muted-foreground flex flex-wrap items-center gap-1.5 text-sm break-words sm:gap-2.5', this.userClass()),
|
|
16
|
-
);
|
|
8
|
+
constructor() {
|
|
9
|
+
classes(() => 'text-muted-foreground flex flex-wrap items-center gap-1.5 text-sm break-words sm:gap-2.5');
|
|
10
|
+
}
|
|
17
11
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { Directive
|
|
2
|
-
import {
|
|
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: '[hlmBreadcrumbPage]',
|
|
@@ -8,11 +7,10 @@ import type { ClassValue } from 'clsx';
|
|
|
8
7
|
role: 'link',
|
|
9
8
|
'aria-disabled': 'true',
|
|
10
9
|
'aria-current': 'page',
|
|
11
|
-
'[class]': '_computedClass()',
|
|
12
10
|
},
|
|
13
11
|
})
|
|
14
12
|
export class HlmBreadcrumbPage {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
constructor() {
|
|
14
|
+
classes(() => 'text-foreground font-normal');
|
|
15
|
+
}
|
|
18
16
|
}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { ChangeDetectionStrategy, Component
|
|
1
|
+
import { ChangeDetectionStrategy, Component } from '@angular/core';
|
|
2
2
|
import { NgIcon, provideIcons } from '@ng-icons/core';
|
|
3
3
|
import { lucideChevronRight } from '@ng-icons/lucide';
|
|
4
|
-
import {
|
|
5
|
-
import type { ClassValue } from 'clsx';
|
|
4
|
+
import { classes } from '<%- importAlias %>/utils';
|
|
6
5
|
|
|
7
6
|
@Component({
|
|
8
7
|
// eslint-disable-next-line @angular-eslint/component-selector
|
|
@@ -13,7 +12,6 @@ import type { ClassValue } from 'clsx';
|
|
|
13
12
|
host: {
|
|
14
13
|
role: 'presentation',
|
|
15
14
|
'aria-hidden': 'true',
|
|
16
|
-
'[class]': '_computedClass()',
|
|
17
15
|
},
|
|
18
16
|
template: `
|
|
19
17
|
<ng-content>
|
|
@@ -22,7 +20,7 @@ import type { ClassValue } from 'clsx';
|
|
|
22
20
|
`,
|
|
23
21
|
})
|
|
24
22
|
export class HlmBreadcrumbSeparator {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
23
|
+
constructor() {
|
|
24
|
+
classes(() => '[&_ng-icon]:block [&_ng-icon]:size-3.5');
|
|
25
|
+
}
|
|
28
26
|
}
|
|
@@ -1,18 +1,12 @@
|
|
|
1
|
-
import { Directive,
|
|
2
|
-
import { hlm } from '<%- importAlias %>/utils';
|
|
3
|
-
import type { ClassValue } from 'clsx';
|
|
1
|
+
import { Directive, input } from '@angular/core';
|
|
4
2
|
|
|
5
3
|
@Directive({
|
|
6
4
|
selector: '[hlmBreadcrumb]',
|
|
7
5
|
host: {
|
|
8
6
|
role: 'navigation',
|
|
9
|
-
'[class]': '_computedClass()',
|
|
10
7
|
'[attr.aria-label]': 'ariaLabel()',
|
|
11
8
|
},
|
|
12
9
|
})
|
|
13
10
|
export class HlmBreadcrumb {
|
|
14
|
-
public readonly userClass = input<ClassValue>('', { alias: 'class' });
|
|
15
11
|
public readonly ariaLabel = input<string>('breadcrumb', { alias: 'aria-label' });
|
|
16
|
-
|
|
17
|
-
protected readonly _computedClass = computed(() => hlm(this.userClass()));
|
|
18
12
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Directive,
|
|
1
|
+
import { Directive, input, signal } from '@angular/core';
|
|
2
2
|
import { BrnButton } from '@spartan-ng/brain/button';
|
|
3
|
-
import {
|
|
3
|
+
import { classes } from '<%- importAlias %>/utils';
|
|
4
4
|
import { type VariantProps, cva } from 'class-variance-authority';
|
|
5
5
|
import type { ClassValue } from 'clsx';
|
|
6
6
|
import { injectBrnButtonConfig } from './hlm-button.token';
|
|
@@ -43,7 +43,6 @@ export type ButtonVariants = VariantProps<typeof buttonVariants>;
|
|
|
43
43
|
hostDirectives: [{ directive: BrnButton, inputs: ['disabled'] }],
|
|
44
44
|
host: {
|
|
45
45
|
'data-slot': 'button',
|
|
46
|
-
'[class]': '_computedClass()',
|
|
47
46
|
},
|
|
48
47
|
})
|
|
49
48
|
export class HlmButton {
|
|
@@ -51,16 +50,14 @@ export class HlmButton {
|
|
|
51
50
|
|
|
52
51
|
private readonly _additionalClasses = signal<ClassValue>('');
|
|
53
52
|
|
|
54
|
-
public readonly userClass = input<ClassValue>('', { alias: 'class' });
|
|
55
|
-
|
|
56
|
-
protected readonly _computedClass = computed(() =>
|
|
57
|
-
hlm(buttonVariants({ variant: this.variant(), size: this.size() }), this.userClass(), this._additionalClasses()),
|
|
58
|
-
);
|
|
59
|
-
|
|
60
53
|
public readonly variant = input<ButtonVariants['variant']>(this._config.variant);
|
|
61
54
|
|
|
62
55
|
public readonly size = input<ButtonVariants['size']>(this._config.size);
|
|
63
56
|
|
|
57
|
+
constructor() {
|
|
58
|
+
classes(() => [buttonVariants({ variant: this.variant(), size: this.size() }), this._additionalClasses()]);
|
|
59
|
+
}
|
|
60
|
+
|
|
64
61
|
setClass(classes: string): void {
|
|
65
62
|
this._additionalClasses.set(classes);
|
|
66
63
|
}
|
package/src/generators/ui/libs/button-group/files/lib/hlm-button-group-separator.ts.template
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Directive } from '@angular/core';
|
|
2
2
|
import { BrnSeparator, provideBrnSeparatorConfig } from '@spartan-ng/brain/separator';
|
|
3
|
-
import {
|
|
4
|
-
import type { ClassValue } from 'clsx';
|
|
3
|
+
import { classes } from '<%- importAlias %>/utils';
|
|
5
4
|
|
|
6
5
|
@Directive({
|
|
7
6
|
selector: '[hlmButtonGroupSeparator],hlm-button-group-separator',
|
|
@@ -9,16 +8,13 @@ import type { ClassValue } from 'clsx';
|
|
|
9
8
|
hostDirectives: [{ directive: BrnSeparator, inputs: ['orientation', 'decorative'] }],
|
|
10
9
|
host: {
|
|
11
10
|
'data-slot': 'button-group-separator',
|
|
12
|
-
'[class]': '_computedClass()',
|
|
13
11
|
},
|
|
14
12
|
})
|
|
15
13
|
export class HlmButtonGroupSeparator {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
),
|
|
23
|
-
);
|
|
14
|
+
constructor() {
|
|
15
|
+
classes(
|
|
16
|
+
() =>
|
|
17
|
+
'bg-input relative inline-flex shrink-0 self-stretch data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-auto data-[orientation=vertical]:w-px',
|
|
18
|
+
);
|
|
19
|
+
}
|
|
24
20
|
}
|
|
@@ -1,20 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { ClassValue } from 'clsx';
|
|
1
|
+
import { Directive } from '@angular/core';
|
|
2
|
+
import { classes } from '<%- importAlias %>/utils';
|
|
4
3
|
|
|
5
4
|
@Directive({
|
|
6
5
|
selector: '[hlmButtonGroupText],hlm-button-group-text',
|
|
7
|
-
host: {
|
|
8
|
-
'[class]': '_computedClass()',
|
|
9
|
-
},
|
|
10
6
|
})
|
|
11
7
|
export class HlmButtonGroupText {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
),
|
|
19
|
-
);
|
|
8
|
+
constructor() {
|
|
9
|
+
classes(
|
|
10
|
+
() =>
|
|
11
|
+
"bg-muted flex items-center gap-2 rounded-md border px-4 text-sm font-medium shadow-xs [&_ng-icon]:pointer-events-none [&_ng-icon:not([class*='text-'])]:text-base",
|
|
12
|
+
);
|
|
13
|
+
}
|
|
20
14
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { Directive, input } from '@angular/core';
|
|
2
|
+
import { classes } from '<%- importAlias %>/utils';
|
|
3
3
|
import { cva } from 'class-variance-authority';
|
|
4
|
-
import { ClassValue } from 'clsx';
|
|
5
4
|
|
|
6
5
|
export const buttonGroupVariants = cva(
|
|
7
6
|
"flex w-fit items-stretch has-[>[data-slot=button-group]]:gap-2 [&>*]:focus-visible:relative [&>*]:focus-visible:z-10 has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-r-md [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1",
|
|
@@ -25,15 +24,13 @@ export const buttonGroupVariants = cva(
|
|
|
25
24
|
host: {
|
|
26
25
|
'data-slot': 'button-group',
|
|
27
26
|
role: 'group',
|
|
28
|
-
'[class]': '_computedClass()',
|
|
29
27
|
'[attr.data-orientation]': 'orientation()',
|
|
30
28
|
},
|
|
31
29
|
})
|
|
32
30
|
export class HlmButtonGroup {
|
|
33
|
-
|
|
34
|
-
|
|
31
|
+
constructor() {
|
|
32
|
+
classes(() => buttonGroupVariants({ orientation: this.orientation() }));
|
|
33
|
+
}
|
|
35
34
|
|
|
36
|
-
|
|
37
|
-
hlm(buttonGroupVariants({ orientation: this.orientation() }), this.userClass()),
|
|
38
|
-
);
|
|
35
|
+
public readonly orientation = input<'horizontal' | 'vertical'>('horizontal');
|
|
39
36
|
}
|
|
@@ -1,16 +1,11 @@
|
|
|
1
|
-
import { Directive
|
|
2
|
-
import {
|
|
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: '[hlmCardAction]',
|
|
7
|
-
host: {
|
|
8
|
-
'[class]': '_computedClass()',
|
|
9
|
-
},
|
|
10
6
|
})
|
|
11
7
|
export class HlmCardAction {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
);
|
|
8
|
+
constructor() {
|
|
9
|
+
classes(() => 'col-start-2 row-span-2 row-start-1 self-start justify-self-end');
|
|
10
|
+
}
|
|
16
11
|
}
|
|
@@ -1,14 +1,11 @@
|
|
|
1
|
-
import { Directive
|
|
2
|
-
import {
|
|
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: '[hlmCardContent]',
|
|
7
|
-
host: {
|
|
8
|
-
'[class]': '_computedClass()',
|
|
9
|
-
},
|
|
10
6
|
})
|
|
11
7
|
export class HlmCardContent {
|
|
12
|
-
|
|
13
|
-
|
|
8
|
+
constructor() {
|
|
9
|
+
classes(() => 'px-6');
|
|
10
|
+
}
|
|
14
11
|
}
|
|
@@ -1,14 +1,11 @@
|
|
|
1
|
-
import { Directive
|
|
2
|
-
import {
|
|
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: '[hlmCardDescription]',
|
|
7
|
-
host: {
|
|
8
|
-
'[class]': '_computedClass()',
|
|
9
|
-
},
|
|
10
6
|
})
|
|
11
7
|
export class HlmCardDescription {
|
|
12
|
-
|
|
13
|
-
|
|
8
|
+
constructor() {
|
|
9
|
+
classes(() => 'text-muted-foreground text-sm');
|
|
10
|
+
}
|
|
14
11
|
}
|
|
@@ -1,14 +1,11 @@
|
|
|
1
|
-
import { Directive
|
|
2
|
-
import {
|
|
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: '[hlmCardFooter]',
|
|
7
|
-
host: {
|
|
8
|
-
'[class]': '_computedClass()',
|
|
9
|
-
},
|
|
10
6
|
})
|
|
11
7
|
export class HlmCardFooter {
|
|
12
|
-
|
|
13
|
-
|
|
8
|
+
constructor() {
|
|
9
|
+
classes(() => 'flex items-center px-6 [.border-t]:pt-6');
|
|
10
|
+
}
|
|
14
11
|
}
|
|
@@ -1,19 +1,14 @@
|
|
|
1
|
-
import { Directive
|
|
2
|
-
import {
|
|
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: '[hlmCardHeader]',
|
|
7
|
-
host: {
|
|
8
|
-
'[class]': '_computedClass()',
|
|
9
|
-
},
|
|
10
6
|
})
|
|
11
7
|
export class HlmCardHeader {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
);
|
|
8
|
+
constructor() {
|
|
9
|
+
classes(
|
|
10
|
+
() =>
|
|
11
|
+
`@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6`,
|
|
12
|
+
);
|
|
13
|
+
}
|
|
19
14
|
}
|
|
@@ -1,14 +1,11 @@
|
|
|
1
|
-
import { Directive
|
|
2
|
-
import {
|
|
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: '[hlmCardTitle]',
|
|
7
|
-
host: {
|
|
8
|
-
'[class]': '_computedClass()',
|
|
9
|
-
},
|
|
10
6
|
})
|
|
11
7
|
export class HlmCardTitle {
|
|
12
|
-
|
|
13
|
-
|
|
8
|
+
constructor() {
|
|
9
|
+
classes(() => 'leading-none font-semibold');
|
|
10
|
+
}
|
|
14
11
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { Directive
|
|
2
|
-
import {
|
|
1
|
+
import { Directive } from '@angular/core';
|
|
2
|
+
import { classes } from '<%- importAlias %>/utils';
|
|
3
3
|
import { type VariantProps, cva } from 'class-variance-authority';
|
|
4
|
-
import type { ClassValue } from 'clsx';
|
|
5
4
|
|
|
6
5
|
export const cardVariants = cva('bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm', {
|
|
7
6
|
variants: {},
|
|
@@ -11,11 +10,9 @@ export type CardVariants = VariantProps<typeof cardVariants>;
|
|
|
11
10
|
|
|
12
11
|
@Directive({
|
|
13
12
|
selector: '[hlmCard]',
|
|
14
|
-
host: {
|
|
15
|
-
'[class]': '_computedClass()',
|
|
16
|
-
},
|
|
17
13
|
})
|
|
18
14
|
export class HlmCard {
|
|
19
|
-
|
|
20
|
-
|
|
15
|
+
constructor() {
|
|
16
|
+
classes(() => cardVariants());
|
|
17
|
+
}
|
|
21
18
|
}
|
|
@@ -1,20 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import type { ClassValue } from 'clsx';
|
|
1
|
+
import { Directive, inject } from '@angular/core';
|
|
2
|
+
import { classes } from '<%- importAlias %>/utils';
|
|
4
3
|
import { HlmCarousel } from './hlm-carousel';
|
|
5
4
|
|
|
6
5
|
@Directive({
|
|
7
6
|
selector: '[hlmCarouselContent],hlm-carousel-content',
|
|
8
7
|
host: {
|
|
9
8
|
'data-slot': 'carousel-content',
|
|
10
|
-
'[class]': '_computedClass()',
|
|
11
9
|
},
|
|
12
10
|
})
|
|
13
11
|
export class HlmCarouselContent {
|
|
14
12
|
private readonly _orientation = inject(HlmCarousel).orientation;
|
|
15
13
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
);
|
|
14
|
+
constructor() {
|
|
15
|
+
classes(() => ['flex', this._orientation() === 'horizontal' ? '-ml-4' : '-mt-4 flex-col']);
|
|
16
|
+
}
|
|
20
17
|
}
|
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import type { ClassValue } from 'clsx';
|
|
1
|
+
import { Directive, inject } from '@angular/core';
|
|
2
|
+
import { classes } from '<%- importAlias %>/utils';
|
|
4
3
|
import { HlmCarousel } from './hlm-carousel';
|
|
5
4
|
|
|
6
5
|
@Directive({
|
|
7
6
|
selector: '[hlmCarouselItem],hlm-carousel-item',
|
|
8
7
|
host: {
|
|
9
8
|
'data-slot': 'carousel-item',
|
|
10
|
-
'[class]': '_computedClass()',
|
|
11
9
|
role: 'group',
|
|
12
10
|
'aria-roledescription': 'slide',
|
|
13
11
|
},
|
|
@@ -15,8 +13,7 @@ import { HlmCarousel } from './hlm-carousel';
|
|
|
15
13
|
export class HlmCarouselItem {
|
|
16
14
|
private readonly _orientation = inject(HlmCarousel).orientation;
|
|
17
15
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
);
|
|
16
|
+
constructor() {
|
|
17
|
+
classes(() => ['min-w-0 shrink-0 grow-0 basis-full', this._orientation() === 'horizontal' ? 'pl-4' : 'pt-4']);
|
|
18
|
+
}
|
|
22
19
|
}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { ChangeDetectionStrategy, Component, computed, effect, inject,
|
|
1
|
+
import { ChangeDetectionStrategy, Component, computed, effect, inject, untracked } from '@angular/core';
|
|
2
2
|
import { NgIcon, provideIcons } from '@ng-icons/core';
|
|
3
3
|
import { lucideArrowRight } from '@ng-icons/lucide';
|
|
4
4
|
import { HlmButton, provideBrnButtonConfig } from '<%- importAlias %>/button';
|
|
5
5
|
import { HlmIcon } from '<%- importAlias %>/icon';
|
|
6
6
|
import { hlm } from '<%- importAlias %>/utils';
|
|
7
|
-
import type { ClassValue } from 'clsx';
|
|
8
7
|
import { HlmCarousel } from './hlm-carousel';
|
|
9
8
|
|
|
10
9
|
@Component({
|
|
@@ -26,14 +25,12 @@ import { HlmCarousel } from './hlm-carousel';
|
|
|
26
25
|
export class HlmCarouselNext {
|
|
27
26
|
private readonly _button = inject(HlmButton);
|
|
28
27
|
protected readonly _carousel = inject(HlmCarousel);
|
|
29
|
-
public readonly userClass = input<ClassValue>('', { alias: 'class' });
|
|
30
28
|
private readonly _computedClass = computed(() =>
|
|
31
29
|
hlm(
|
|
32
30
|
'absolute h-8 w-8 rounded-full',
|
|
33
31
|
this._carousel.orientation() === 'horizontal'
|
|
34
32
|
? 'top-1/2 -right-12 -translate-y-1/2'
|
|
35
33
|
: '-bottom-12 left-1/2 -translate-x-1/2 rotate-90',
|
|
36
|
-
this.userClass(),
|
|
37
34
|
),
|
|
38
35
|
);
|
|
39
36
|
protected readonly isDisabled = () => !this._carousel.canScrollNext();
|