@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,21 +1,19 @@
|
|
|
1
1
|
import { type BooleanInput } from '@angular/cdk/coercion';
|
|
2
|
-
import { booleanAttribute,
|
|
3
|
-
import {
|
|
4
|
-
import type { ClassValue } from 'clsx';
|
|
2
|
+
import { booleanAttribute, Directive, input } from '@angular/core';
|
|
3
|
+
import { classes } from '<%- importAlias %>/utils';
|
|
5
4
|
|
|
6
5
|
@Directive({
|
|
7
6
|
selector: 'button[hlmSidebarMenuAction]',
|
|
8
7
|
host: {
|
|
9
8
|
'data-slot': 'sidebar-menu-action',
|
|
10
9
|
'data-sidebar': 'menu-action',
|
|
11
|
-
'[class]': '_computedClass()',
|
|
12
10
|
},
|
|
13
11
|
})
|
|
14
12
|
export class HlmSidebarMenuAction {
|
|
15
|
-
public readonly userClass = input<ClassValue>('', { alias: 'class' });
|
|
16
13
|
public readonly showOnHover = input<boolean, BooleanInput>(false, { transform: booleanAttribute });
|
|
17
|
-
|
|
18
|
-
|
|
14
|
+
|
|
15
|
+
constructor() {
|
|
16
|
+
classes(() => [
|
|
19
17
|
'text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground peer-hover/menu-button:text-sidebar-accent-foreground absolute top-1.5 right-1 flex aspect-square w-5 items-center justify-center rounded-md p-0 transition-transform outline-none hover:cursor-pointer focus-visible:ring-2 disabled:hover:cursor-default [&>_ng-icon]:size-4 [&>_ng-icon]:shrink-0',
|
|
20
18
|
// Increases the hit area of the button on mobile.
|
|
21
19
|
'after:absolute after:-inset-2 after:md:hidden',
|
|
@@ -25,7 +23,6 @@ export class HlmSidebarMenuAction {
|
|
|
25
23
|
'group-data-[collapsible=icon]:hidden',
|
|
26
24
|
this.showOnHover() &&
|
|
27
25
|
'peer-data-[active=true]/menu-button:text-sidebar-accent-foreground group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 md:opacity-0',
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
);
|
|
26
|
+
]);
|
|
27
|
+
}
|
|
31
28
|
}
|
|
@@ -1,26 +1,22 @@
|
|
|
1
|
-
import {
|
|
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: '[hlmSidebarMenuBadge],hlm-sidebar-menu-badge',
|
|
7
6
|
host: {
|
|
8
7
|
'data-slot': 'sidebar-menu-badge',
|
|
9
8
|
'data-sidebar': 'menu-badge',
|
|
10
|
-
'[class]': '_computedClass()',
|
|
11
9
|
},
|
|
12
10
|
})
|
|
13
11
|
export class HlmSidebarMenuBadge {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
hlm(
|
|
12
|
+
constructor() {
|
|
13
|
+
classes(() => [
|
|
17
14
|
'text-sidebar-foreground pointer-events-none absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums select-none',
|
|
18
15
|
'peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground',
|
|
19
16
|
'peer-data-[size=sm]/menu-button:top-1',
|
|
20
17
|
'peer-data-[size=default]/menu-button:top-1.5',
|
|
21
18
|
'peer-data-[size=lg]/menu-button:top-2.5',
|
|
22
19
|
'group-data-[collapsible=icon]:hidden',
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
);
|
|
20
|
+
]);
|
|
21
|
+
}
|
|
26
22
|
}
|
|
@@ -2,9 +2,8 @@ import { type BooleanInput } from '@angular/cdk/coercion';
|
|
|
2
2
|
import { booleanAttribute, computed, Directive, inject, input } from '@angular/core';
|
|
3
3
|
import { BrnTooltipTrigger, provideBrnTooltipDefaultOptions } from '@spartan-ng/brain/tooltip';
|
|
4
4
|
import { DEFAULT_TOOLTIP_CONTENT_CLASSES } from '<%- importAlias %>/tooltip';
|
|
5
|
-
import {
|
|
5
|
+
import { classes } from '<%- importAlias %>/utils';
|
|
6
6
|
import { cva } from 'class-variance-authority';
|
|
7
|
-
import type { ClassValue } from 'clsx';
|
|
8
7
|
import { HlmSidebarService } from './hlm-sidebar.service';
|
|
9
8
|
|
|
10
9
|
const sidebarMenuButtonVariants = cva(
|
|
@@ -51,7 +50,6 @@ const sidebarMenuButtonVariants = cva(
|
|
|
51
50
|
'data-sidebar': 'menu-button',
|
|
52
51
|
'[attr.data-size]': 'size()',
|
|
53
52
|
'[attr.data-active]': 'isActive()',
|
|
54
|
-
'[class]': '_computedClass()',
|
|
55
53
|
},
|
|
56
54
|
})
|
|
57
55
|
export class HlmSidebarMenuButton {
|
|
@@ -60,12 +58,12 @@ export class HlmSidebarMenuButton {
|
|
|
60
58
|
public readonly variant = input<'default' | 'outline'>('default');
|
|
61
59
|
public readonly size = input<'default' | 'sm' | 'lg'>('default');
|
|
62
60
|
public readonly isActive = input<boolean, BooleanInput>(false, { transform: booleanAttribute });
|
|
63
|
-
public readonly userClass = input<ClassValue>('', { alias: 'class' });
|
|
64
61
|
|
|
65
62
|
protected readonly _isTooltipHidden = computed(
|
|
66
63
|
() => this._sidebarService.state() !== 'collapsed' || this._sidebarService.isMobile(),
|
|
67
64
|
);
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
65
|
+
|
|
66
|
+
constructor() {
|
|
67
|
+
classes(() => sidebarMenuButtonVariants({ variant: this.variant(), size: this.size() }));
|
|
68
|
+
}
|
|
71
69
|
}
|
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
import {
|
|
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: 'li[hlmSidebarMenuItem]',
|
|
7
6
|
host: {
|
|
8
7
|
'data-slot': 'sidebar-menu-item',
|
|
9
8
|
'data-sidebar': 'menu-item',
|
|
10
|
-
'[class]': '_computedClass()',
|
|
11
9
|
},
|
|
12
10
|
})
|
|
13
11
|
export class HlmSidebarMenuItem {
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
constructor() {
|
|
13
|
+
classes(() => 'group/menu-item relative');
|
|
14
|
+
}
|
|
16
15
|
}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { type BooleanInput } from '@angular/cdk/coercion';
|
|
2
|
-
import { booleanAttribute, ChangeDetectionStrategy, Component,
|
|
2
|
+
import { booleanAttribute, ChangeDetectionStrategy, Component, input } from '@angular/core';
|
|
3
3
|
import { HlmSkeletonImports } from '<%- importAlias %>/skeleton';
|
|
4
|
-
import {
|
|
5
|
-
import type { ClassValue } from 'clsx';
|
|
4
|
+
import { classes } from '<%- importAlias %>/utils';
|
|
6
5
|
|
|
7
6
|
@Component({
|
|
8
7
|
selector: 'hlm-sidebar-menu-skeleton,div[hlmSidebarMenuSkeleton]',
|
|
@@ -11,7 +10,6 @@ import type { ClassValue } from 'clsx';
|
|
|
11
10
|
host: {
|
|
12
11
|
'data-slot': 'sidebar-menu-skeleton',
|
|
13
12
|
'data-sidebar': 'menu-skeleton',
|
|
14
|
-
'[class]': '_computedClass()',
|
|
15
13
|
'[style.--skeleton-width]': '_width',
|
|
16
14
|
},
|
|
17
15
|
template: `
|
|
@@ -24,9 +22,9 @@ import type { ClassValue } from 'clsx';
|
|
|
24
22
|
})
|
|
25
23
|
export class HlmSidebarMenuSkeleton {
|
|
26
24
|
public readonly showIcon = input<boolean, BooleanInput>(false, { transform: booleanAttribute });
|
|
27
|
-
public readonly userClass = input<ClassValue>('', { alias: 'class' });
|
|
28
|
-
protected readonly _computedClass = computed(() =>
|
|
29
|
-
hlm('flex h-8 items-center gap-2 rounded-md px-2', this.userClass()),
|
|
30
|
-
);
|
|
31
25
|
protected readonly _width = `${Math.floor(Math.random() * 40) + 50}%`;
|
|
26
|
+
|
|
27
|
+
constructor() {
|
|
28
|
+
classes(() => 'flex h-8 items-center gap-2 rounded-md px-2');
|
|
29
|
+
}
|
|
32
30
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { type BooleanInput } from '@angular/cdk/coercion';
|
|
2
|
-
import { booleanAttribute,
|
|
3
|
-
import {
|
|
4
|
-
import type { ClassValue } from 'clsx';
|
|
2
|
+
import { booleanAttribute, Directive, input } from '@angular/core';
|
|
3
|
+
import { classes } from '<%- importAlias %>/utils';
|
|
5
4
|
|
|
6
5
|
@Directive({
|
|
7
6
|
selector: 'a[hlmSidebarMenuSubButton], button[hlmSidebarMenuSubButton]',
|
|
@@ -10,20 +9,17 @@ import type { ClassValue } from 'clsx';
|
|
|
10
9
|
'data-sidebar': 'menu-sub-button',
|
|
11
10
|
'[attr.data-active]': 'isActive()',
|
|
12
11
|
'[attr.data-size]': 'size()',
|
|
13
|
-
'[class]': '_computedClass()',
|
|
14
12
|
},
|
|
15
13
|
})
|
|
16
14
|
export class HlmSidebarMenuSubButton {
|
|
17
15
|
public readonly size = input<'sm' | 'md'>('md');
|
|
18
16
|
public readonly isActive = input<boolean, BooleanInput>(false, { transform: booleanAttribute });
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
hlm(
|
|
17
|
+
constructor() {
|
|
18
|
+
classes(() => [
|
|
22
19
|
`text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground [&>_ng-icon:not([class*='text-'])]:text-sidebar-accent-foreground flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 outline-none hover:cursor-pointer focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50 disabled:hover:cursor-default aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>_ng-icon]:size-4 [&>_ng-icon]:shrink-0 [&>span:last-child]:truncate`,
|
|
23
20
|
'data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground',
|
|
24
21
|
'data-[size=md]:text-sm data-[size=sm]:text-xs',
|
|
25
22
|
'group-data-[collapsible=icon]:hidden',
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
);
|
|
23
|
+
]);
|
|
24
|
+
}
|
|
29
25
|
}
|
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
import {
|
|
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: 'li[hlmSidebarMenuSubItem]',
|
|
7
6
|
host: {
|
|
8
7
|
'data-slot': 'sidebar-menu-sub-item',
|
|
9
8
|
'data-sidebar': 'menu-sub-item',
|
|
10
|
-
'[class]': '_computedClass()',
|
|
11
9
|
},
|
|
12
10
|
})
|
|
13
11
|
export class HlmSidebarMenuSubItem {
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
constructor() {
|
|
13
|
+
classes(() => 'group/menu-sub-item relative');
|
|
14
|
+
}
|
|
16
15
|
}
|
|
@@ -1,22 +1,18 @@
|
|
|
1
|
-
import {
|
|
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: 'ul[hlmSidebarMenuSub]',
|
|
7
6
|
host: {
|
|
8
7
|
'data-slot': 'sidebar-menu-sub',
|
|
9
8
|
'data-sidebar': 'menu-sub',
|
|
10
|
-
'[class]': '_computedClass()',
|
|
11
9
|
},
|
|
12
10
|
})
|
|
13
11
|
export class HlmSidebarMenuSub {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
hlm(
|
|
12
|
+
constructor() {
|
|
13
|
+
classes(() => [
|
|
17
14
|
'border-sidebar-border mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l px-2.5 py-0.5',
|
|
18
15
|
'group-data-[collapsible=icon]:hidden',
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
);
|
|
16
|
+
]);
|
|
17
|
+
}
|
|
22
18
|
}
|
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
import {
|
|
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: 'ul[hlmSidebarMenu]',
|
|
7
6
|
host: {
|
|
8
7
|
'data-slot': 'sidebar-menu',
|
|
9
8
|
'data-sidebar': 'menu',
|
|
10
|
-
'[class]': '_computedClass()',
|
|
11
9
|
},
|
|
12
10
|
})
|
|
13
11
|
export class HlmSidebarMenu {
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
constructor() {
|
|
13
|
+
classes(() => 'flex w-full min-w-0 flex-col gap-1');
|
|
14
|
+
}
|
|
16
15
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import type { ClassValue } from 'clsx';
|
|
1
|
+
import { Directive, inject, input } from '@angular/core';
|
|
2
|
+
import { classes } from '<%- importAlias %>/utils';
|
|
4
3
|
import { HlmSidebarService } from './hlm-sidebar.service';
|
|
5
4
|
|
|
6
5
|
@Directive({
|
|
@@ -10,7 +9,6 @@ import { HlmSidebarService } from './hlm-sidebar.service';
|
|
|
10
9
|
'data-slot': 'sidebar-rail',
|
|
11
10
|
'[attr.aria-label]': 'ariaLabel()',
|
|
12
11
|
tabindex: '-1',
|
|
13
|
-
'[class]': '_computedClass()',
|
|
14
12
|
'(click)': 'onClick()',
|
|
15
13
|
},
|
|
16
14
|
})
|
|
@@ -19,18 +17,16 @@ export class HlmSidebarRail {
|
|
|
19
17
|
|
|
20
18
|
public readonly ariaLabel = input<string>('Toggle Sidebar', { alias: 'aria-label' });
|
|
21
19
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
hlm(
|
|
20
|
+
constructor() {
|
|
21
|
+
classes(() => [
|
|
25
22
|
'hover:after:bg-sidebar-border absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear group-data-[side=left]:-right-4 group-data-[side=right]:left-0 after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] sm:flex',
|
|
26
23
|
'group-data-[side=left]:cursor-w-resize group-data-[side=right]:cursor-e-resize',
|
|
27
24
|
'[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize',
|
|
28
25
|
'hover:group-data-[collapsible=offcanvas]:bg-sidebar group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full',
|
|
29
26
|
'[[data-side=left][data-collapsible=offcanvas]_&]:-right-2',
|
|
30
27
|
'[[data-side=right][data-collapsible=offcanvas]_&]:-left-2',
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
);
|
|
28
|
+
]);
|
|
29
|
+
}
|
|
34
30
|
|
|
35
31
|
protected onClick(): void {
|
|
36
32
|
this._sidebarService.toggleSidebar();
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Directive } from '@angular/core';
|
|
2
2
|
import { HlmSeparator } from '<%- importAlias %>/separator';
|
|
3
|
-
import {
|
|
4
|
-
import type { ClassValue } from 'clsx';
|
|
3
|
+
import { classes } from '<%- importAlias %>/utils';
|
|
5
4
|
|
|
6
5
|
@Directive({
|
|
7
6
|
selector: '[hlmSidebarSeparator],hlm-sidebar-separator',
|
|
@@ -9,10 +8,10 @@ import type { ClassValue } from 'clsx';
|
|
|
9
8
|
host: {
|
|
10
9
|
'data-slot': 'sidebar-separator',
|
|
11
10
|
'data-sidebar': 'separator',
|
|
12
|
-
'[class]': '_computedClass()',
|
|
13
11
|
},
|
|
14
12
|
})
|
|
15
13
|
export class HlmSidebarSeparator {
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
constructor() {
|
|
15
|
+
classes(() => 'bg-sidebar-border mx-2 w-auto');
|
|
16
|
+
}
|
|
18
17
|
}
|
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import type { ClassValue } from 'clsx';
|
|
1
|
+
import { Directive, input } from '@angular/core';
|
|
2
|
+
import { classes } from '<%- importAlias %>/utils';
|
|
4
3
|
import { injectHlmSidebarConfig } from './hlm-sidebar.token';
|
|
5
4
|
|
|
6
5
|
@Directive({
|
|
7
6
|
selector: '[hlmSidebarWrapper],hlm-sidebar-wrapper',
|
|
8
7
|
host: {
|
|
9
8
|
'data-slot': 'sidebar-wrapper',
|
|
10
|
-
'[class]': '_computedClass()',
|
|
11
9
|
'[style.--sidebar-width]': 'sidebarWidth()',
|
|
12
10
|
'[style.--sidebar-width-icon]': 'sidebarWidthIcon()',
|
|
13
11
|
},
|
|
@@ -15,11 +13,10 @@ import { injectHlmSidebarConfig } from './hlm-sidebar.token';
|
|
|
15
13
|
export class HlmSidebarWrapper {
|
|
16
14
|
private readonly _config = injectHlmSidebarConfig();
|
|
17
15
|
|
|
18
|
-
public readonly userClass = input<ClassValue>('', { alias: 'class' });
|
|
19
|
-
protected readonly _computedClass = computed(() =>
|
|
20
|
-
hlm('group/sidebar-wrapper has-[[data-variant=inset]]:bg-sidebar flex min-h-svh w-full', this.userClass()),
|
|
21
|
-
);
|
|
22
|
-
|
|
23
16
|
public readonly sidebarWidth = input<string>(this._config.sidebarWidth);
|
|
24
17
|
public readonly sidebarWidthIcon = input<string>(this._config.sidebarWidthIcon);
|
|
18
|
+
|
|
19
|
+
constructor() {
|
|
20
|
+
classes(() => 'group/sidebar-wrapper has-[[data-variant=inset]]:bg-sidebar flex min-h-svh w-full');
|
|
21
|
+
}
|
|
25
22
|
}
|
|
@@ -2,7 +2,7 @@ import { NgTemplateOutlet } from '@angular/common';
|
|
|
2
2
|
import { ChangeDetectionStrategy, Component, computed, effect, inject, input } from '@angular/core';
|
|
3
3
|
import { BrnSheetImports } from '@spartan-ng/brain/sheet';
|
|
4
4
|
import { HlmSheetImports } from '<%- importAlias %>/sheet';
|
|
5
|
-
import { hlm } from '<%- importAlias %>/utils';
|
|
5
|
+
import { classes, hlm } from '<%- importAlias %>/utils';
|
|
6
6
|
import type { ClassValue } from 'clsx';
|
|
7
7
|
import { HlmSidebarService, type SidebarVariant } from './hlm-sidebar.service';
|
|
8
8
|
import { injectHlmSidebarConfig } from './hlm-sidebar.token';
|
|
@@ -13,7 +13,6 @@ import { injectHlmSidebarConfig } from './hlm-sidebar.token';
|
|
|
13
13
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
14
14
|
host: {
|
|
15
15
|
'[attr.data-slot]': '_dataSlot()',
|
|
16
|
-
'[class]': '_computedClass()',
|
|
17
16
|
'[attr.data-state]': '_dataState()',
|
|
18
17
|
'[attr.data-collapsible]': '_dataCollapsible()',
|
|
19
18
|
'[attr.data-variant]': '_dataVariant()',
|
|
@@ -63,8 +62,6 @@ import { injectHlmSidebarConfig } from './hlm-sidebar.token';
|
|
|
63
62
|
export class HlmSidebar {
|
|
64
63
|
protected readonly _sidebarService = inject(HlmSidebarService);
|
|
65
64
|
private readonly _config = injectHlmSidebarConfig();
|
|
66
|
-
|
|
67
|
-
public readonly userClass = input<ClassValue>('', { alias: 'class' });
|
|
68
65
|
public readonly sidebarWidthMobile = input<string>(this._config.sidebarWidthMobile);
|
|
69
66
|
|
|
70
67
|
public readonly side = input<'left' | 'right'>('left');
|
|
@@ -96,16 +93,6 @@ export class HlmSidebar {
|
|
|
96
93
|
),
|
|
97
94
|
);
|
|
98
95
|
|
|
99
|
-
protected readonly _computedClass = computed(() => {
|
|
100
|
-
if (this.collapsible() === 'none') {
|
|
101
|
-
return hlm('bg-sidebar text-sidebar-foreground flex h-svh w-[var(--sidebar-width)] flex-col', this.userClass());
|
|
102
|
-
} else if (this._sidebarService.isMobile()) {
|
|
103
|
-
return hlm(this.userClass());
|
|
104
|
-
} else {
|
|
105
|
-
return hlm('text-sidebar-foreground group peer hidden md:block', this.userClass());
|
|
106
|
-
}
|
|
107
|
-
});
|
|
108
|
-
|
|
109
96
|
protected readonly _dataSlot = computed(() => {
|
|
110
97
|
return !this._sidebarService.isMobile() ? 'sidebar' : undefined;
|
|
111
98
|
});
|
|
@@ -138,5 +125,15 @@ export class HlmSidebar {
|
|
|
138
125
|
effect(() => {
|
|
139
126
|
this._sidebarService.setVariant(this.variant());
|
|
140
127
|
});
|
|
128
|
+
|
|
129
|
+
classes(() => {
|
|
130
|
+
if (this.collapsible() === 'none') {
|
|
131
|
+
return hlm('bg-sidebar text-sidebar-foreground flex h-svh w-[var(--sidebar-width)] flex-col');
|
|
132
|
+
} else if (this._sidebarService.isMobile()) {
|
|
133
|
+
return '';
|
|
134
|
+
} else {
|
|
135
|
+
return hlm('text-sidebar-foreground group peer hidden md:block');
|
|
136
|
+
}
|
|
137
|
+
});
|
|
141
138
|
}
|
|
142
139
|
}
|
|
@@ -1,17 +1,14 @@
|
|
|
1
|
-
import {
|
|
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: '[hlmSkeleton],hlm-skeleton',
|
|
7
6
|
host: {
|
|
8
7
|
'data-slot': 'skeleton',
|
|
9
|
-
'[class]': '_computedClass()',
|
|
10
8
|
},
|
|
11
9
|
})
|
|
12
10
|
export class HlmSkeleton {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
);
|
|
11
|
+
constructor() {
|
|
12
|
+
classes(() => 'bg-accent block rounded-md motion-safe:animate-pulse');
|
|
13
|
+
}
|
|
17
14
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ChangeDetectionStrategy, Component
|
|
1
|
+
import { ChangeDetectionStrategy, Component } from '@angular/core';
|
|
2
2
|
import {
|
|
3
3
|
BrnSlider,
|
|
4
4
|
BrnSliderRange,
|
|
@@ -7,8 +7,7 @@ import {
|
|
|
7
7
|
BrnSliderTrack,
|
|
8
8
|
injectBrnSlider,
|
|
9
9
|
} from '@spartan-ng/brain/slider';
|
|
10
|
-
import {
|
|
11
|
-
import type { ClassValue } from 'clsx';
|
|
10
|
+
import { classes } from '<%- importAlias %>/utils';
|
|
12
11
|
|
|
13
12
|
@Component({
|
|
14
13
|
selector: 'hlm-slider, brn-slider [hlm]',
|
|
@@ -21,9 +20,6 @@ import type { ClassValue } from 'clsx';
|
|
|
21
20
|
outputs: ['valueChange'],
|
|
22
21
|
},
|
|
23
22
|
],
|
|
24
|
-
host: {
|
|
25
|
-
'[class]': '_computedClass()',
|
|
26
|
-
},
|
|
27
23
|
template: `
|
|
28
24
|
<div brnSliderTrack class="bg-muted relative h-1.5 w-full grow overflow-hidden rounded-full">
|
|
29
25
|
<div class="bg-primary absolute h-full" brnSliderRange></div>
|
|
@@ -49,12 +45,7 @@ import type { ClassValue } from 'clsx';
|
|
|
49
45
|
})
|
|
50
46
|
export class HlmSlider {
|
|
51
47
|
protected readonly _slider = injectBrnSlider();
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
'relative flex w-full touch-none items-center select-none',
|
|
56
|
-
this._slider.mutableDisabled() ? 'opacity-40' : '',
|
|
57
|
-
this.userClass(),
|
|
58
|
-
),
|
|
59
|
-
);
|
|
48
|
+
constructor() {
|
|
49
|
+
classes(() => 'relative flex w-full touch-none items-center select-none');
|
|
50
|
+
}
|
|
60
51
|
}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { ChangeDetectionStrategy, Component,
|
|
1
|
+
import { ChangeDetectionStrategy, Component, input } from '@angular/core';
|
|
2
2
|
import { NgIcon, provideIcons } from '@ng-icons/core';
|
|
3
3
|
import { lucideLoader } 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
|
selector: 'hlm-spinner',
|
|
@@ -12,10 +11,9 @@ import type { ClassValue } from 'clsx';
|
|
|
12
11
|
host: {
|
|
13
12
|
role: 'status',
|
|
14
13
|
'[attr.aria-label]': 'ariaLabel()',
|
|
15
|
-
class: 'inline-flex',
|
|
16
14
|
},
|
|
17
15
|
template: `
|
|
18
|
-
<ng-icon [name]="icon()"
|
|
16
|
+
<ng-icon [name]="icon()" />
|
|
19
17
|
`,
|
|
20
18
|
})
|
|
21
19
|
export class HlmSpinner {
|
|
@@ -28,6 +26,7 @@ export class HlmSpinner {
|
|
|
28
26
|
/** Aria label for the spinner for accessibility. */
|
|
29
27
|
public readonly ariaLabel = input<string>('Loading', { alias: 'aria-label' });
|
|
30
28
|
|
|
31
|
-
|
|
32
|
-
|
|
29
|
+
constructor() {
|
|
30
|
+
classes(() => 'inline-flex size-fit text-base motion-safe:animate-spin');
|
|
31
|
+
}
|
|
33
32
|
}
|
|
@@ -1,20 +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: 'brn-switch-thumb[hlm],[hlmSwitchThumb]',
|
|
7
|
-
host: {
|
|
8
|
-
'[class]': '_computedClass()',
|
|
9
|
-
},
|
|
10
6
|
})
|
|
11
7
|
export class HlmSwitchThumb {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
),
|
|
19
|
-
);
|
|
8
|
+
constructor() {
|
|
9
|
+
classes(
|
|
10
|
+
() =>
|
|
11
|
+
'bg-background dark:group-data-[state=unchecked]:bg-foreground dark:group-data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform group-data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0',
|
|
12
|
+
);
|
|
13
|
+
}
|
|
20
14
|
}
|