@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,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: '[hlmDialogHeader],hlm-dialog-header',
|
|
7
6
|
host: {
|
|
8
7
|
'data-slot': 'dialog-header',
|
|
9
|
-
'[class]': '_computedClass()',
|
|
10
8
|
},
|
|
11
9
|
})
|
|
12
10
|
export class HlmDialogHeader {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
);
|
|
11
|
+
constructor() {
|
|
12
|
+
classes(() => 'flex flex-col gap-2 text-center sm:text-left');
|
|
13
|
+
}
|
|
17
14
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { computed, Directive, effect, input, untracked } from '@angular/core';
|
|
2
2
|
import { injectCustomClassSettable } from '@spartan-ng/brain/core';
|
|
3
3
|
import { BrnDialogOverlay } from '@spartan-ng/brain/dialog';
|
|
4
4
|
import { hlm } from '<%- importAlias %>/utils';
|
|
5
|
-
import
|
|
5
|
+
import { ClassValue } from 'clsx';
|
|
6
6
|
|
|
7
7
|
export const hlmDialogOverlayClass =
|
|
8
8
|
'data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 bg-black/50';
|
|
@@ -1,17 +1,16 @@
|
|
|
1
|
-
import { Directive
|
|
1
|
+
import { Directive } from '@angular/core';
|
|
2
2
|
import { BrnDialogTitle } from '@spartan-ng/brain/dialog';
|
|
3
|
-
import {
|
|
4
|
-
import type { ClassValue } from 'clsx';
|
|
3
|
+
import { classes } from '<%- importAlias %>/utils';
|
|
5
4
|
|
|
6
5
|
@Directive({
|
|
7
6
|
selector: '[hlmDialogTitle]',
|
|
8
7
|
hostDirectives: [BrnDialogTitle],
|
|
9
8
|
host: {
|
|
10
9
|
'data-slot': 'dialog-title',
|
|
11
|
-
'[class]': '_computedClass()',
|
|
12
10
|
},
|
|
13
11
|
})
|
|
14
12
|
export class HlmDialogTitle {
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
constructor() {
|
|
14
|
+
classes(() => 'text-lg leading-none font-semibold');
|
|
15
|
+
}
|
|
17
16
|
}
|
|
@@ -1,27 +1,22 @@
|
|
|
1
|
-
import { ChangeDetectionStrategy, Component
|
|
1
|
+
import { ChangeDetectionStrategy, Component } from '@angular/core';
|
|
2
2
|
import { NgIcon, provideIcons } from '@ng-icons/core';
|
|
3
3
|
import { lucideCheck } 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-dropdown-menu-checkbox-indicator',
|
|
9
8
|
imports: [NgIcon],
|
|
10
9
|
providers: [provideIcons({ lucideCheck })],
|
|
11
10
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
12
|
-
host: {
|
|
13
|
-
'[class]': '_computedClass()',
|
|
14
|
-
},
|
|
15
11
|
template: `
|
|
16
12
|
<ng-icon class="text-base" name="lucideCheck" />
|
|
17
13
|
`,
|
|
18
14
|
})
|
|
19
15
|
export class HlmDropdownMenuCheckboxIndicator {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
);
|
|
16
|
+
constructor() {
|
|
17
|
+
classes(
|
|
18
|
+
() =>
|
|
19
|
+
'pointer-events-none absolute left-2 flex size-3.5 items-center justify-center opacity-0 group-data-[checked]:opacity-100',
|
|
20
|
+
);
|
|
21
|
+
}
|
|
27
22
|
}
|
package/src/generators/ui/libs/dropdown-menu/files/lib/hlm-dropdown-menu-checkbox.ts.template
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { type BooleanInput } from '@angular/cdk/coercion';
|
|
2
2
|
import { CdkMenuItemCheckbox } from '@angular/cdk/menu';
|
|
3
|
-
import { Directive, booleanAttribute,
|
|
4
|
-
import {
|
|
5
|
-
import type { ClassValue } from 'clsx';
|
|
3
|
+
import { Directive, booleanAttribute, inject, input } from '@angular/core';
|
|
4
|
+
import { classes } from '<%- importAlias %>/utils';
|
|
6
5
|
|
|
7
6
|
@Directive({
|
|
8
7
|
selector: '[hlmDropdownMenuCheckbox]',
|
|
@@ -17,20 +16,17 @@ import type { ClassValue } from 'clsx';
|
|
|
17
16
|
'data-slot': 'dropdown-menu-checkbox-item',
|
|
18
17
|
'[attr.data-disabled]': 'disabled() ? "" : null',
|
|
19
18
|
'[attr.data-checked]': 'checked() ? "" : null',
|
|
20
|
-
'[class]': '_computedClass()',
|
|
21
19
|
},
|
|
22
20
|
})
|
|
23
21
|
export class HlmDropdownMenuCheckbox {
|
|
24
22
|
private readonly _cdkMenuItem = inject(CdkMenuItemCheckbox);
|
|
25
|
-
|
|
26
|
-
public readonly userClass = input<ClassValue>('', { alias: 'class' });
|
|
27
|
-
protected readonly _computedClass = computed(() =>
|
|
28
|
-
hlm(
|
|
29
|
-
'hover:bg-accent hover:text-accent-foreground focus-visible:bg-accent focus-visible:text-accent-foreground group relative flex w-full cursor-default items-center rounded-sm py-1.5 pr-2 pl-8 text-sm transition-colors outline-none select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50',
|
|
30
|
-
this.userClass(),
|
|
31
|
-
),
|
|
32
|
-
);
|
|
33
|
-
|
|
34
23
|
public readonly checked = input<boolean, BooleanInput>(this._cdkMenuItem.checked, { transform: booleanAttribute });
|
|
35
24
|
public readonly disabled = input<boolean, BooleanInput>(this._cdkMenuItem.disabled, { transform: booleanAttribute });
|
|
25
|
+
|
|
26
|
+
constructor() {
|
|
27
|
+
classes(
|
|
28
|
+
() =>
|
|
29
|
+
'hover:bg-accent hover:text-accent-foreground focus-visible:bg-accent focus-visible:text-accent-foreground group relative flex w-full cursor-default items-center rounded-sm py-1.5 pr-2 pl-8 text-sm transition-colors outline-none select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50',
|
|
30
|
+
);
|
|
31
|
+
}
|
|
36
32
|
}
|
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
import { CdkMenuGroup } from '@angular/cdk/menu';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import type { ClassValue } from 'clsx';
|
|
2
|
+
import { Directive } from '@angular/core';
|
|
3
|
+
import { classes } from '<%- importAlias %>/utils';
|
|
5
4
|
|
|
6
5
|
@Directive({
|
|
7
6
|
selector: '[hlmDropdownMenuGroup],hlm-dropdown-menu-group',
|
|
8
7
|
hostDirectives: [CdkMenuGroup],
|
|
9
8
|
host: {
|
|
10
9
|
'data-slot': 'dropdown-menu-group',
|
|
11
|
-
'[class]': '_computedClass()',
|
|
12
10
|
},
|
|
13
11
|
})
|
|
14
12
|
export class HlmDropdownMenuGroup {
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
constructor() {
|
|
14
|
+
classes(() => 'block');
|
|
15
|
+
}
|
|
17
16
|
}
|
|
@@ -1,22 +1,19 @@
|
|
|
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
|
selector: 'hlm-dropdown-menu-item-sub-indicator',
|
|
9
8
|
imports: [NgIcon],
|
|
10
9
|
providers: [provideIcons({ lucideChevronRight })],
|
|
11
10
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
12
|
-
host: {
|
|
13
|
-
'[class]': '_computedClass()',
|
|
14
|
-
},
|
|
15
11
|
template: `
|
|
16
12
|
<ng-icon name="lucideChevronRight" class="text-base" />
|
|
17
13
|
`,
|
|
18
14
|
})
|
|
19
15
|
export class HlmDropdownMenuItemSubIndicator {
|
|
20
|
-
|
|
21
|
-
|
|
16
|
+
constructor() {
|
|
17
|
+
classes(() => 'ml-auto size-4');
|
|
18
|
+
}
|
|
22
19
|
}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { type BooleanInput } from '@angular/cdk/coercion';
|
|
2
2
|
import { CdkMenuItem } from '@angular/cdk/menu';
|
|
3
|
-
import { booleanAttribute,
|
|
4
|
-
import {
|
|
5
|
-
import type { ClassValue } from 'clsx';
|
|
3
|
+
import { booleanAttribute, Directive, input } from '@angular/core';
|
|
4
|
+
import { classes } from '<%- importAlias %>/utils';
|
|
6
5
|
|
|
7
6
|
@Directive({
|
|
8
7
|
selector: 'button[hlmDropdownMenuItem]',
|
|
@@ -15,7 +14,6 @@ import type { ClassValue } from 'clsx';
|
|
|
15
14
|
],
|
|
16
15
|
host: {
|
|
17
16
|
'data-slot': 'dropdown-menu-item',
|
|
18
|
-
'[class]': '_computedClass()',
|
|
19
17
|
'[disabled]': 'disabled() || null',
|
|
20
18
|
'[attr.data-disabled]': 'disabled() ? "" : null',
|
|
21
19
|
'[attr.data-variant]': 'variant()',
|
|
@@ -23,14 +21,6 @@ import type { ClassValue } from 'clsx';
|
|
|
23
21
|
},
|
|
24
22
|
})
|
|
25
23
|
export class HlmDropdownMenuItem {
|
|
26
|
-
public readonly userClass = input<ClassValue>('', { alias: 'class' });
|
|
27
|
-
protected readonly _computedClass = computed(() =>
|
|
28
|
-
hlm(
|
|
29
|
-
"hover:bg-accent focus-visible:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[ng-icon]:!text-destructive [&_ng-icon:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_ng-icon]:pointer-events-none [&_ng-icon]:shrink-0 [&_svg:not([class*='text-'])]:text-base",
|
|
30
|
-
this.userClass(),
|
|
31
|
-
),
|
|
32
|
-
);
|
|
33
|
-
|
|
34
24
|
public readonly disabled = input<boolean, BooleanInput>(false, { transform: booleanAttribute });
|
|
35
25
|
|
|
36
26
|
public readonly variant = input<'default' | 'destructive'>('default');
|
|
@@ -38,4 +28,11 @@ export class HlmDropdownMenuItem {
|
|
|
38
28
|
public readonly inset = input<boolean, BooleanInput>(false, {
|
|
39
29
|
transform: booleanAttribute,
|
|
40
30
|
});
|
|
31
|
+
|
|
32
|
+
constructor() {
|
|
33
|
+
classes(
|
|
34
|
+
() =>
|
|
35
|
+
"hover:bg-accent focus-visible:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[ng-icon]:!text-destructive [&_ng-icon:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_ng-icon]:pointer-events-none [&_ng-icon]:shrink-0 [&_svg:not([class*='text-'])]:text-base",
|
|
36
|
+
);
|
|
37
|
+
}
|
|
41
38
|
}
|
|
@@ -1,21 +1,18 @@
|
|
|
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: '[hlmDropdownMenuLabel],hlm-dropdown-menu-label',
|
|
8
7
|
host: {
|
|
9
8
|
'data-slot': 'dropdown-menu-label',
|
|
10
|
-
'[class]': '_computedClass()',
|
|
11
9
|
'[attr.data-inset]': 'inset() ? "" : null',
|
|
12
10
|
},
|
|
13
11
|
})
|
|
14
12
|
export class HlmDropdownMenuLabel {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
);
|
|
13
|
+
constructor() {
|
|
14
|
+
classes(() => 'block px-2 py-1.5 text-sm font-medium data-[inset]:pl-8');
|
|
15
|
+
}
|
|
19
16
|
|
|
20
17
|
public readonly inset = input<boolean, BooleanInput>(false, {
|
|
21
18
|
transform: booleanAttribute,
|
package/src/generators/ui/libs/dropdown-menu/files/lib/hlm-dropdown-menu-radio-indicator.ts.template
CHANGED
|
@@ -1,27 +1,22 @@
|
|
|
1
|
-
import { ChangeDetectionStrategy, Component
|
|
1
|
+
import { ChangeDetectionStrategy, Component } from '@angular/core';
|
|
2
2
|
import { NgIcon, provideIcons } from '@ng-icons/core';
|
|
3
3
|
import { lucideCircle } 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-dropdown-menu-radio-indicator',
|
|
9
8
|
imports: [NgIcon],
|
|
10
9
|
providers: [provideIcons({ lucideCircle })],
|
|
11
10
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
12
|
-
host: {
|
|
13
|
-
'[class]': '_computedClass()',
|
|
14
|
-
},
|
|
15
11
|
template: `
|
|
16
12
|
<ng-icon name="lucideCircle" class="text-[0.5rem] *:[svg]:fill-current" />
|
|
17
13
|
`,
|
|
18
14
|
})
|
|
19
15
|
export class HlmDropdownMenuRadioIndicator {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
);
|
|
16
|
+
constructor() {
|
|
17
|
+
classes(
|
|
18
|
+
() =>
|
|
19
|
+
'pointer-events-none absolute left-2 flex size-3.5 items-center justify-center opacity-0 group-data-[checked]:opacity-100',
|
|
20
|
+
);
|
|
21
|
+
}
|
|
27
22
|
}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { type BooleanInput } from '@angular/cdk/coercion';
|
|
2
2
|
import { CdkMenuItemRadio } from '@angular/cdk/menu';
|
|
3
|
-
import { Directive, booleanAttribute,
|
|
4
|
-
import {
|
|
5
|
-
import type { ClassValue } from 'clsx';
|
|
3
|
+
import { Directive, booleanAttribute, inject, input } from '@angular/core';
|
|
4
|
+
import { classes } from '<%- importAlias %>/utils';
|
|
6
5
|
|
|
7
6
|
@Directive({
|
|
8
7
|
selector: '[hlmDropdownMenuRadio]',
|
|
@@ -17,20 +16,17 @@ import type { ClassValue } from 'clsx';
|
|
|
17
16
|
'data-slot': 'dropdown-menu-radio-item',
|
|
18
17
|
'[attr.data-disabled]': 'disabled() ? "" : null',
|
|
19
18
|
'[attr.data-checked]': 'checked() ? "" : null',
|
|
20
|
-
'[class]': '_computedClass()',
|
|
21
19
|
},
|
|
22
20
|
})
|
|
23
21
|
export class HlmDropdownMenuRadio {
|
|
24
22
|
private readonly _cdkMenuItem = inject(CdkMenuItemRadio);
|
|
25
|
-
|
|
26
|
-
public readonly userClass = input<ClassValue>('', { alias: 'class' });
|
|
27
|
-
protected readonly _computedClass = computed(() =>
|
|
28
|
-
hlm(
|
|
29
|
-
'hover:bg-accent hover:text-accent-foreground focus-visible:bg-accent focus-visible:text-accent-foreground group relative flex w-full cursor-default items-center rounded-sm py-1.5 pr-2 pl-8 text-sm transition-colors outline-none select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50',
|
|
30
|
-
this.userClass(),
|
|
31
|
-
),
|
|
32
|
-
);
|
|
33
|
-
|
|
34
23
|
public readonly checked = input<boolean, BooleanInput>(this._cdkMenuItem.checked, { transform: booleanAttribute });
|
|
35
24
|
public readonly disabled = input<boolean, BooleanInput>(this._cdkMenuItem.disabled, { transform: booleanAttribute });
|
|
25
|
+
|
|
26
|
+
constructor() {
|
|
27
|
+
classes(
|
|
28
|
+
() =>
|
|
29
|
+
'hover:bg-accent hover:text-accent-foreground focus-visible:bg-accent focus-visible:text-accent-foreground group relative flex w-full cursor-default items-center rounded-sm py-1.5 pr-2 pl-8 text-sm transition-colors outline-none select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50',
|
|
30
|
+
);
|
|
31
|
+
}
|
|
36
32
|
}
|
package/src/generators/ui/libs/dropdown-menu/files/lib/hlm-dropdown-menu-separator.ts.template
CHANGED
|
@@ -1,15 +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: '[hlmDropdownMenuSeparator],hlm-dropdown-menu-separator',
|
|
7
6
|
host: {
|
|
8
7
|
'data-slot': 'dropdown-menu-separator',
|
|
9
|
-
'[class]': '_computedClass()',
|
|
10
8
|
},
|
|
11
9
|
})
|
|
12
10
|
export class HlmDropdownMenuSeparator {
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
constructor() {
|
|
12
|
+
classes(() => 'bg-border -mx-1 my-1 block h-px');
|
|
13
|
+
}
|
|
15
14
|
}
|
package/src/generators/ui/libs/dropdown-menu/files/lib/hlm-dropdown-menu-shortcut.ts.template
CHANGED
|
@@ -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: '[hlmDropdownMenuShortcut],hlm-dropdown-menu-shortcut',
|
|
7
6
|
host: {
|
|
8
7
|
'data-slot': 'dropdown-menu-shortcut',
|
|
9
|
-
'[class]': '_computedClass()',
|
|
10
8
|
},
|
|
11
9
|
})
|
|
12
10
|
export class HlmDropdownMenuShortcut {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
);
|
|
11
|
+
constructor() {
|
|
12
|
+
classes(() => 'text-muted-foreground ml-auto text-xs tracking-widest');
|
|
13
|
+
}
|
|
17
14
|
}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { CdkMenu } from '@angular/cdk/menu';
|
|
2
|
-
import {
|
|
2
|
+
import { Directive, inject, signal } from '@angular/core';
|
|
3
3
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
4
|
-
import {
|
|
5
|
-
import type { ClassValue } from 'clsx';
|
|
4
|
+
import { classes } from '<%- importAlias %>/utils';
|
|
6
5
|
|
|
7
6
|
@Directive({
|
|
8
7
|
selector: '[hlmDropdownMenuSub],hlm-dropdown-menu-sub',
|
|
@@ -11,7 +10,6 @@ import type { ClassValue } from 'clsx';
|
|
|
11
10
|
'data-slot': 'dropdown-menu-sub',
|
|
12
11
|
'[attr.data-state]': '_state()',
|
|
13
12
|
'[attr.data-side]': '_side()',
|
|
14
|
-
'[class]': '_computedClass()',
|
|
15
13
|
},
|
|
16
14
|
})
|
|
17
15
|
export class HlmDropdownMenuSub {
|
|
@@ -20,19 +18,16 @@ export class HlmDropdownMenuSub {
|
|
|
20
18
|
protected readonly _state = signal('open');
|
|
21
19
|
protected readonly _side = signal('top');
|
|
22
20
|
|
|
23
|
-
public readonly userClass = input<ClassValue>('', { alias: 'class' });
|
|
24
|
-
protected readonly _computedClass = computed(() =>
|
|
25
|
-
hlm(
|
|
26
|
-
'bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-top overflow-hidden rounded-md border p-1 shadow-lg',
|
|
27
|
-
this.userClass(),
|
|
28
|
-
),
|
|
29
|
-
);
|
|
30
|
-
|
|
31
21
|
constructor() {
|
|
32
22
|
this.setSideWithDarkMagic();
|
|
33
23
|
// this is a best effort, but does not seem to work currently
|
|
34
24
|
// TODO: figure out a way for us to know the host is about to be closed. might not be possible with CDK
|
|
35
25
|
this._host.closed.pipe(takeUntilDestroyed()).subscribe(() => this._state.set('closed'));
|
|
26
|
+
|
|
27
|
+
classes(
|
|
28
|
+
() =>
|
|
29
|
+
'bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-top overflow-hidden rounded-md border p-1 shadow-lg',
|
|
30
|
+
);
|
|
36
31
|
}
|
|
37
32
|
|
|
38
33
|
private setSideWithDarkMagic() {
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { type NumberInput } from '@angular/cdk/coercion';
|
|
2
2
|
import { CdkMenu } from '@angular/cdk/menu';
|
|
3
|
-
import {
|
|
3
|
+
import { Directive, inject, input, numberAttribute, signal } from '@angular/core';
|
|
4
4
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
5
|
-
import {
|
|
6
|
-
import type { ClassValue } from 'clsx';
|
|
5
|
+
import { classes } from '<%- importAlias %>/utils';
|
|
7
6
|
|
|
8
7
|
@Directive({
|
|
9
8
|
selector: '[hlmDropdownMenu],hlm-dropdown-menu',
|
|
@@ -12,7 +11,6 @@ import type { ClassValue } from 'clsx';
|
|
|
12
11
|
'data-slot': 'dropdown-menu',
|
|
13
12
|
'[attr.data-state]': '_state()',
|
|
14
13
|
'[attr.data-side]': '_side()',
|
|
15
|
-
'[class]': '_computedClass()',
|
|
16
14
|
'[style.--side-offset]': 'sideOffset()',
|
|
17
15
|
},
|
|
18
16
|
})
|
|
@@ -22,17 +20,14 @@ export class HlmDropdownMenu {
|
|
|
22
20
|
protected readonly _state = signal('open');
|
|
23
21
|
protected readonly _side = signal('top');
|
|
24
22
|
|
|
25
|
-
public readonly userClass = input<ClassValue>('', { alias: 'class' });
|
|
26
|
-
protected readonly _computedClass = computed(() =>
|
|
27
|
-
hlm(
|
|
28
|
-
'bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 my-[--spacing(var(--side-offset))] min-w-[8rem] origin-top overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md',
|
|
29
|
-
this.userClass(),
|
|
30
|
-
),
|
|
31
|
-
);
|
|
32
|
-
|
|
33
23
|
public readonly sideOffset = input<number, NumberInput>(1, { transform: numberAttribute });
|
|
34
24
|
|
|
35
25
|
constructor() {
|
|
26
|
+
classes(
|
|
27
|
+
() =>
|
|
28
|
+
'bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 my-[--spacing(var(--side-offset))] min-w-[8rem] origin-top overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md',
|
|
29
|
+
);
|
|
30
|
+
|
|
36
31
|
this.setSideWithDarkMagic();
|
|
37
32
|
// this is a best effort, but does not seem to work currently
|
|
38
33
|
// TODO: figure out a way for us to know the host is about to be closed. might not be possible with CDK
|
|
@@ -1,18 +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: '[hlmEmptyContent],hlm-empty-content',
|
|
7
6
|
host: {
|
|
8
7
|
'data-slot': 'empty-content',
|
|
9
|
-
'[class]': '_computedClass()',
|
|
10
8
|
},
|
|
11
9
|
})
|
|
12
10
|
export class HlmEmptyContent {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
hlm('flex w-full max-w-sm min-w-0 flex-col items-center gap-4 text-sm text-balance', this.userClass()),
|
|
17
|
-
);
|
|
11
|
+
constructor() {
|
|
12
|
+
classes(() => 'flex w-full max-w-sm min-w-0 flex-col items-center gap-4 text-sm text-balance');
|
|
13
|
+
}
|
|
18
14
|
}
|
|
@@ -1,21 +1,16 @@
|
|
|
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: '[hlmEmptyDescription]',
|
|
7
6
|
host: {
|
|
8
7
|
'data-slot': 'empty-description',
|
|
9
|
-
'[class]': '_computedClass()',
|
|
10
8
|
},
|
|
11
9
|
})
|
|
12
10
|
export class HlmEmptyDescription {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
this.userClass(),
|
|
19
|
-
),
|
|
20
|
-
);
|
|
11
|
+
constructor() {
|
|
12
|
+
classes(
|
|
13
|
+
() => 'text-muted-foreground [&>a:hover]:text-primary text-sm/relaxed [&>a]:underline [&>a]:underline-offset-4',
|
|
14
|
+
);
|
|
15
|
+
}
|
|
21
16
|
}
|
|
@@ -1,18 +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: '[hlmEmptyHeader],hlm-empty-header',
|
|
7
6
|
host: {
|
|
8
7
|
'data-slot': 'empty-header',
|
|
9
|
-
'[class]': '_computedClass()',
|
|
10
8
|
},
|
|
11
9
|
})
|
|
12
10
|
export class HlmEmptyHeader {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
hlm('flex max-w-sm flex-col items-center gap-2 text-center', this.userClass()),
|
|
17
|
-
);
|
|
11
|
+
constructor() {
|
|
12
|
+
classes(() => 'flex max-w-sm flex-col items-center gap-2 text-center');
|
|
13
|
+
}
|
|
18
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, VariantProps } from 'class-variance-authority';
|
|
4
|
-
import type { ClassValue } from 'clsx';
|
|
5
4
|
|
|
6
5
|
const emptyMediaVariants = cva(
|
|
7
6
|
'mb-2 flex shrink-0 items-center justify-center [&_ng-icon]:pointer-events-none [&_ng-icon]:shrink-0',
|
|
@@ -24,14 +23,12 @@ export type EmptyMediaVariants = VariantProps<typeof emptyMediaVariants>;
|
|
|
24
23
|
selector: '[hlmEmptyMedia],hlm-empty-media',
|
|
25
24
|
host: {
|
|
26
25
|
'data-slot': 'empty-media',
|
|
27
|
-
'[class]': '_computedClass()',
|
|
28
26
|
},
|
|
29
27
|
})
|
|
30
28
|
export class HlmEmptyMedia {
|
|
31
|
-
|
|
32
|
-
|
|
29
|
+
constructor() {
|
|
30
|
+
classes(() => emptyMediaVariants({ variant: this.variant() }));
|
|
31
|
+
}
|
|
33
32
|
|
|
34
|
-
|
|
35
|
-
hlm(emptyMediaVariants({ variant: this.variant() }), this.userClass()),
|
|
36
|
-
);
|
|
33
|
+
public readonly variant = input<EmptyMediaVariants['variant']>();
|
|
37
34
|
}
|
|
@@ -1,16 +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: '[hlmEmptyTitle]',
|
|
7
6
|
host: {
|
|
8
7
|
'data-slot': 'empty-title',
|
|
9
|
-
'[class]': '_computedClass()',
|
|
10
8
|
},
|
|
11
9
|
})
|
|
12
10
|
export class HlmEmptyTitle {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
constructor() {
|
|
12
|
+
classes(() => 'text-lg font-medium tracking-tight');
|
|
13
|
+
}
|
|
16
14
|
}
|
|
@@ -1,21 +1,17 @@
|
|
|
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: '[hlmEmpty],hlm-empty',
|
|
7
6
|
host: {
|
|
8
7
|
'data-slot': 'empty',
|
|
9
|
-
'[class]': '_computedClass()',
|
|
10
8
|
},
|
|
11
9
|
})
|
|
12
10
|
export class HlmEmpty {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
),
|
|
20
|
-
);
|
|
11
|
+
constructor() {
|
|
12
|
+
classes(
|
|
13
|
+
() =>
|
|
14
|
+
'flex min-w-0 flex-1 flex-col items-center justify-center gap-6 rounded-lg border-dashed p-6 text-center text-balance md:p-12',
|
|
15
|
+
);
|
|
16
|
+
}
|
|
21
17
|
}
|