@spartan-ng/cli 0.0.1-alpha.519 → 0.0.1-alpha.520
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/base/lib/deleteFiles.d.ts +1 -1
- package/src/generators/base/lib/initialize-angular-library.js.map +1 -1
- package/src/generators/base/schema.d.ts +1 -1
- package/src/generators/healthcheck/compat.d.ts +1 -1
- package/src/generators/healthcheck/generator.d.ts +2 -2
- package/src/generators/healthcheck/generator.js.map +1 -1
- package/src/generators/healthcheck/healthchecks/brain-imports.d.ts +1 -1
- package/src/generators/healthcheck/healthchecks/brain-imports.js.map +1 -1
- package/src/generators/healthcheck/healthchecks/brn-accordion-trigger.d.ts +1 -1
- package/src/generators/healthcheck/healthchecks/brn-accordion-trigger.js.map +1 -1
- package/src/generators/healthcheck/healthchecks/brn-checkbox-changed-event-rename.d.ts +1 -1
- package/src/generators/healthcheck/healthchecks/brn-checkbox-changed-event-rename.js.map +1 -1
- package/src/generators/healthcheck/healthchecks/brn-radio.d.ts +1 -1
- package/src/generators/healthcheck/healthchecks/brn-radio.js.map +1 -1
- package/src/generators/healthcheck/healthchecks/brn-separator.d.ts +1 -1
- package/src/generators/healthcheck/healthchecks/brn-separator.js.map +1 -1
- package/src/generators/healthcheck/healthchecks/brn-switch-changed-event-rename.d.ts +1 -1
- package/src/generators/healthcheck/healthchecks/brn-switch-changed-event-rename.js.map +1 -1
- package/src/generators/healthcheck/healthchecks/brn-toggle-group.d.ts +1 -1
- package/src/generators/healthcheck/healthchecks/brn-toggle-group.js.map +1 -1
- package/src/generators/healthcheck/healthchecks/core-imports.d.ts +1 -1
- package/src/generators/healthcheck/healthchecks/core-imports.js.map +1 -1
- package/src/generators/healthcheck/healthchecks/helm-imports.d.ts +1 -1
- package/src/generators/healthcheck/healthchecks/helm-imports.js.map +1 -1
- package/src/generators/healthcheck/healthchecks/hlm-date-picker.d.ts +1 -1
- package/src/generators/healthcheck/healthchecks/hlm-date-picker.js.map +1 -1
- package/src/generators/healthcheck/healthchecks/hlm-icon.d.ts +1 -1
- package/src/generators/healthcheck/healthchecks/hlm-icon.js.map +1 -1
- package/src/generators/healthcheck/healthchecks/hlm-progress.d.ts +1 -1
- package/src/generators/healthcheck/healthchecks/hlm-progress.js.map +1 -1
- package/src/generators/healthcheck/healthchecks/hlm-scroll-area.d.ts +1 -1
- package/src/generators/healthcheck/healthchecks/hlm-scroll-area.js.map +1 -1
- package/src/generators/healthcheck/healthchecks/hlm-select.d.ts +1 -1
- package/src/generators/healthcheck/healthchecks/hlm-select.js.map +1 -1
- package/src/generators/healthcheck/healthchecks/hlm.d.ts +1 -1
- package/src/generators/healthcheck/healthchecks/hlm.js.map +1 -1
- package/src/generators/healthcheck/healthchecks/module-imports.d.ts +1 -1
- package/src/generators/healthcheck/healthchecks/module-imports.js.map +1 -1
- package/src/generators/healthcheck/healthchecks/naming-conventions.d.ts +1 -1
- package/src/generators/healthcheck/healthchecks/naming-conventions.js.map +1 -1
- package/src/generators/healthcheck/healthchecks/version.d.ts +1 -1
- package/src/generators/healthcheck/healthchecks/version.js.map +1 -1
- package/src/generators/healthcheck/healthchecks.d.ts +1 -1
- package/src/generators/healthcheck/utils/reporter.d.ts +1 -1
- package/src/generators/healthcheck/utils/reporter.js.map +1 -1
- package/src/generators/healthcheck/utils/runner.d.ts +2 -2
- package/src/generators/migrate-brain-accordion-trigger/generator.d.ts +2 -2
- package/src/generators/migrate-brain-accordion-trigger/generator.js.map +1 -1
- package/src/generators/migrate-brain-accordion-trigger/utils/html-utils.d.ts +1 -1
- package/src/generators/migrate-brain-accordion-trigger/utils/html-utils.js.map +1 -1
- package/src/generators/migrate-brain-accordion-trigger/utils/shared-utils.d.ts +2 -2
- package/src/generators/migrate-brain-accordion-trigger/utils/shared-utils.js.map +1 -1
- package/src/generators/migrate-brain-imports/generator.d.ts +2 -2
- package/src/generators/migrate-brain-imports/generator.js.map +1 -1
- package/src/generators/migrate-brn-checkbox-changed-event/generator.d.ts +2 -2
- package/src/generators/migrate-brn-checkbox-changed-event/generator.js.map +1 -1
- package/src/generators/migrate-brn-switch-changed-event/generator.d.ts +2 -2
- package/src/generators/migrate-brn-switch-changed-event/generator.js.map +1 -1
- package/src/generators/migrate-core/generator.d.ts +2 -2
- package/src/generators/migrate-core/generator.js.map +1 -1
- package/src/generators/migrate-date-picker/generator.d.ts +2 -2
- package/src/generators/migrate-date-picker/generator.js.map +1 -1
- package/src/generators/migrate-helm-imports/generator.d.ts +2 -2
- package/src/generators/migrate-helm-imports/generator.js.map +1 -1
- package/src/generators/migrate-helm-libraries/compat.d.ts +1 -1
- package/src/generators/migrate-helm-libraries/generator.d.ts +2 -2
- package/src/generators/migrate-helm-libraries/generator.js.map +1 -1
- package/src/generators/migrate-helm-libraries/schema.d.ts +1 -1
- package/src/generators/migrate-hlm/generator.d.ts +2 -2
- package/src/generators/migrate-hlm/generator.js.map +1 -1
- package/src/generators/migrate-icon/generator.d.ts +2 -2
- package/src/generators/migrate-icon/generator.js.map +1 -1
- package/src/generators/migrate-module-imports/generator.d.ts +2 -2
- package/src/generators/migrate-module-imports/generator.js.map +1 -1
- package/src/generators/migrate-naming-convention/generator.d.ts +2 -2
- package/src/generators/migrate-naming-convention/generator.js.map +1 -1
- package/src/generators/migrate-progress/generator.d.ts +2 -2
- package/src/generators/migrate-progress/generator.js.map +1 -1
- package/src/generators/migrate-radio/generator.d.ts +2 -2
- package/src/generators/migrate-radio/generator.js.map +1 -1
- package/src/generators/migrate-scroll-area/generator.d.ts +2 -2
- package/src/generators/migrate-scroll-area/generator.js.map +1 -1
- package/src/generators/migrate-select/generator.d.ts +2 -2
- package/src/generators/migrate-select/generator.js.map +1 -1
- package/src/generators/migrate-separator/generator.d.ts +2 -2
- package/src/generators/migrate-separator/generator.js.map +1 -1
- package/src/generators/migrate-toggle-group/generator.d.ts +2 -2
- package/src/generators/migrate-toggle-group/generator.js.map +1 -1
- package/src/generators/theme/generator.js.map +1 -1
- package/src/generators/theme/libs/add-theme-to-application-styles.d.ts +1 -1
- package/src/generators/theme/libs/add-theme-to-application-styles.js.map +1 -1
- package/src/generators/ui/generator.d.ts +4 -4
- package/src/generators/ui/generator.js +6 -1
- package/src/generators/ui/generator.js.map +1 -1
- package/src/generators/ui/libs/input-group/generator.d.ts +3 -0
- package/src/generators/ui/libs/input-group/generator.js +14 -0
- package/src/generators/ui/libs/input-group/generator.js.map +1 -0
- package/src/generators/ui/libs/ui-autocomplete-helm/files/lib/hlm-autocomplete-trigger.ts.template +1 -1
- package/src/generators/ui/libs/ui-autocomplete-helm/files/lib/hlm-autocomplete.token.ts.template +1 -1
- package/src/generators/ui/libs/ui-autocomplete-helm/files/lib/hlm-autocomplete.ts.template +4 -4
- package/src/generators/ui/libs/ui-avatar-helm/files/lib/image/hlm-avatar-image.ts.template +1 -1
- package/src/generators/ui/libs/ui-button-helm/files/lib/hlm-button.token.ts.template +1 -1
- package/src/generators/ui/libs/ui-calendar-helm/files/lib/hlm-calendar-multi.ts.template +2 -2
- package/src/generators/ui/libs/ui-calendar-helm/files/lib/hlm-calendar-range.ts.template +2 -2
- package/src/generators/ui/libs/ui-calendar-helm/files/lib/hlm-calendar.ts.template +2 -2
- package/src/generators/ui/libs/ui-card-helm/files/lib/hlm-card.ts.template +1 -1
- package/src/generators/ui/libs/ui-carousel-helm/files/lib/hlm-carousel-slide-display.ts.template +2 -2
- package/src/generators/ui/libs/ui-checkbox-helm/files/lib/hlm-checkbox.ts.template +2 -2
- package/src/generators/ui/libs/ui-command-helm/files/lib/hlm-command-icon.ts.template +1 -1
- package/src/generators/ui/libs/ui-command-helm/files/lib/hlm-command-shortcut.ts.template +1 -1
- package/src/generators/ui/libs/ui-date-picker-helm/files/lib/hlm-date-picker-multi.token.ts.template +1 -1
- package/src/generators/ui/libs/ui-date-picker-helm/files/lib/hlm-date-picker-multi.ts.template +4 -4
- package/src/generators/ui/libs/ui-date-picker-helm/files/lib/hlm-date-picker.token.ts.template +1 -1
- package/src/generators/ui/libs/ui-date-picker-helm/files/lib/hlm-date-picker.ts.template +4 -4
- package/src/generators/ui/libs/ui-date-picker-helm/files/lib/hlm-date-range-picker.token.ts.template +1 -1
- package/src/generators/ui/libs/ui-date-picker-helm/files/lib/hlm-date-range-picker.ts.template +4 -4
- package/src/generators/ui/libs/ui-dialog-helm/files/lib/hlm-dialog-footer.ts.template +1 -1
- package/src/generators/ui/libs/ui-dialog-helm/files/lib/hlm-dialog-header.ts.template +3 -1
- package/src/generators/ui/libs/ui-form-field-helm/files/lib/hlm-error.ts.template +1 -1
- package/src/generators/ui/libs/ui-form-field-helm/files/lib/hlm-form-field.ts.template +1 -1
- package/src/generators/ui/libs/ui-form-field-helm/files/lib/hlm-hint.ts.template +1 -1
- package/src/generators/ui/libs/ui-icon-helm/files/lib/hlm-icon.token.ts.template +1 -1
- package/src/generators/ui/libs/ui-input-group-helm/files/index.ts.template +13 -0
- package/src/generators/ui/libs/ui-input-group-helm/files/lib/hlm-input-group.ts.template +50 -0
- package/src/generators/ui/libs/ui-input-group-helm/files/lib/hlm-prefix-addon.ts.template +36 -0
- package/src/generators/ui/libs/ui-input-group-helm/files/lib/hlm-prefix.ts.template +27 -0
- package/src/generators/ui/libs/ui-input-group-helm/files/lib/hlm-suffix-addon.ts.template +36 -0
- package/src/generators/ui/libs/ui-input-group-helm/files/lib/hlm-suffix.ts.template +27 -0
- package/src/generators/ui/libs/ui-input-group-helm/generator.d.ts +3 -0
- package/src/generators/ui/libs/ui-input-group-helm/generator.js +14 -0
- package/src/generators/ui/libs/ui-input-group-helm/generator.js.map +1 -0
- package/src/generators/ui/libs/ui-input-helm/files/lib/hlm-input-error.ts.template +1 -1
- package/src/generators/ui/libs/ui-input-helm/files/lib/hlm-input.ts.template +1 -1
- package/src/generators/ui/libs/ui-input-otp-helm/files/lib/hlm-input-otp-group.ts.template +1 -1
- package/src/generators/ui/libs/ui-input-otp-helm/files/lib/hlm-input-otp-separator.ts.template +1 -1
- package/src/generators/ui/libs/ui-input-otp-helm/files/lib/hlm-input-otp-slot.ts.template +2 -2
- package/src/generators/ui/libs/ui-input-otp-helm/files/lib/hlm-input-otp.ts.template +1 -1
- package/src/generators/ui/libs/ui-menu-helm/files/lib/hlm-menu-bar.ts.template +1 -1
- package/src/generators/ui/libs/ui-menu-helm/files/lib/hlm-menu-item-check.ts.template +1 -1
- package/src/generators/ui/libs/ui-menu-helm/files/lib/hlm-menu-item-icon.ts.template +1 -1
- package/src/generators/ui/libs/ui-menu-helm/files/lib/hlm-menu-item-sub-indicator.ts.template +1 -1
- package/src/generators/ui/libs/ui-menu-helm/files/lib/hlm-menu-item.ts.template +2 -2
- package/src/generators/ui/libs/ui-menu-helm/files/lib/hlm-menu-label.ts.template +3 -3
- package/src/generators/ui/libs/ui-menu-helm/files/lib/hlm-menu-separator.ts.template +1 -1
- package/src/generators/ui/libs/ui-menu-helm/files/lib/hlm-menu-shortcut.ts.template +1 -1
- package/src/generators/ui/libs/ui-pagination-helm/files/lib/hlm-numbered-pagination-query-params.ts.template +1 -1
- package/src/generators/ui/libs/ui-pagination-helm/files/lib/hlm-numbered-pagination.ts.template +1 -1
- package/src/generators/ui/libs/ui-pagination-helm/files/lib/hlm-pagination-link.ts.template +1 -1
- package/src/generators/ui/libs/ui-pagination-helm/files/lib/hlm-pagination-next.ts.template +4 -4
- package/src/generators/ui/libs/ui-pagination-helm/files/lib/hlm-pagination-previous.ts.template +4 -4
- package/src/generators/ui/libs/ui-radio-group-helm/files/lib/hlm-radio.ts.template +2 -2
- package/src/generators/ui/libs/ui-select-helm/files/lib/hlm-select-content.ts.template +1 -1
- package/src/generators/ui/libs/ui-select-helm/files/lib/hlm-select-scroll-down.ts.template +1 -1
- package/src/generators/ui/libs/ui-select-helm/files/lib/hlm-select-scroll-up.ts.template +1 -1
- package/src/generators/ui/libs/ui-separator-helm/files/lib/hlm-separator.ts.template +1 -1
- package/src/generators/ui/libs/ui-sheet-helm/files/lib/hlm-sheet-footer.ts.template +1 -1
- package/src/generators/ui/libs/ui-sheet-helm/files/lib/hlm-sheet-header.ts.template +1 -1
- package/src/generators/ui/libs/ui-sidebar-helm/files/index.ts.template +75 -0
- package/src/generators/ui/libs/ui-sidebar-helm/files/lib/hlm-sidebar-content.ts.template +22 -0
- package/src/generators/ui/libs/ui-sidebar-helm/files/lib/hlm-sidebar-footer.ts.template +17 -0
- package/src/generators/ui/libs/ui-sidebar-helm/files/lib/hlm-sidebar-group-action.ts.template +25 -0
- package/src/generators/ui/libs/ui-sidebar-helm/files/lib/hlm-sidebar-group-content.ts.template +17 -0
- package/src/generators/ui/libs/ui-sidebar-helm/files/lib/hlm-sidebar-group-label.ts.template +23 -0
- package/src/generators/ui/libs/ui-sidebar-helm/files/lib/hlm-sidebar-group.ts.template +19 -0
- package/src/generators/ui/libs/ui-sidebar-helm/files/lib/hlm-sidebar-header.ts.template +17 -0
- package/src/generators/ui/libs/ui-sidebar-helm/files/lib/hlm-sidebar-input.ts.template +21 -0
- package/src/generators/ui/libs/ui-sidebar-helm/files/lib/hlm-sidebar-inset.ts.template +29 -0
- package/src/generators/ui/libs/ui-sidebar-helm/files/lib/hlm-sidebar-menu-action.ts.template +31 -0
- package/src/generators/ui/libs/ui-sidebar-helm/files/lib/hlm-sidebar-menu-badge.ts.template +27 -0
- package/src/generators/ui/libs/ui-sidebar-helm/files/lib/hlm-sidebar-menu-button.ts.template +72 -0
- package/src/generators/ui/libs/ui-sidebar-helm/files/lib/hlm-sidebar-menu-item.ts.template +17 -0
- package/src/generators/ui/libs/ui-sidebar-helm/files/lib/hlm-sidebar-menu-skeleton.ts.template +33 -0
- package/src/generators/ui/libs/ui-sidebar-helm/files/lib/hlm-sidebar-menu-sub-button.ts.template +30 -0
- package/src/generators/ui/libs/ui-sidebar-helm/files/lib/hlm-sidebar-menu-sub-item.ts.template +17 -0
- package/src/generators/ui/libs/ui-sidebar-helm/files/lib/hlm-sidebar-menu-sub.ts.template +23 -0
- package/src/generators/ui/libs/ui-sidebar-helm/files/lib/hlm-sidebar-menu.ts.template +17 -0
- package/src/generators/ui/libs/ui-sidebar-helm/files/lib/hlm-sidebar-rail.ts.template +39 -0
- package/src/generators/ui/libs/ui-sidebar-helm/files/lib/hlm-sidebar-separator.ts.template +20 -0
- package/src/generators/ui/libs/ui-sidebar-helm/files/lib/hlm-sidebar-trigger.ts.template +42 -0
- package/src/generators/ui/libs/ui-sidebar-helm/files/lib/hlm-sidebar-wrapper.ts.template +25 -0
- package/src/generators/ui/libs/ui-sidebar-helm/files/lib/hlm-sidebar.service.ts.template +106 -0
- package/src/generators/ui/libs/ui-sidebar-helm/files/lib/hlm-sidebar.token.ts.template +31 -0
- package/src/generators/ui/libs/ui-sidebar-helm/files/lib/hlm-sidebar.ts.template +115 -0
- package/src/generators/ui/libs/ui-sidebar-helm/generator.d.ts +3 -0
- package/src/generators/ui/libs/ui-sidebar-helm/generator.js +14 -0
- package/src/generators/ui/libs/ui-sidebar-helm/generator.js.map +1 -0
- package/src/generators/ui/libs/ui-skeleton-helm/files/lib/hlm-skeleton.ts.template +1 -1
- package/src/generators/ui/libs/ui-switch-helm/files/lib/hlm-switch.ts.template +3 -3
- package/src/generators/ui/libs/ui-table-helm/files/lib/hlm-table.ts.template +1 -1
- package/src/generators/ui/libs/ui-tabs-helm/files/lib/hlm-tabs.ts.template +1 -1
- package/src/generators/ui/libs/ui-toggle-group-helm/files/lib/hlm-toggle-group.token.ts.template +1 -1
- package/src/generators/ui/libs/ui-toggle-group-helm/files/lib/hlm-toggle-group.ts.template +2 -2
- package/src/generators/ui/libs/ui-tooltip-helm/files/lib/hlm-tooltip-trigger.ts.template +1 -1
- package/src/generators/ui/libs/ui-typography-helm/files/lib/hlm-blockquote.ts.template +1 -1
- package/src/generators/ui/libs/ui-typography-helm/files/lib/hlm-code.ts.template +1 -1
- package/src/generators/ui/libs/ui-typography-helm/files/lib/hlm-h1.ts.template +1 -1
- package/src/generators/ui/libs/ui-typography-helm/files/lib/hlm-h2.ts.template +1 -1
- package/src/generators/ui/libs/ui-typography-helm/files/lib/hlm-h3.ts.template +1 -1
- package/src/generators/ui/libs/ui-typography-helm/files/lib/hlm-large.ts.template +1 -1
- package/src/generators/ui/libs/ui-typography-helm/files/lib/hlm-lead.ts.template +1 -1
- package/src/generators/ui/libs/ui-typography-helm/files/lib/hlm-muted.ts.template +1 -1
- package/src/generators/ui/libs/ui-typography-helm/files/lib/hlm-p.ts.template +1 -1
- package/src/generators/ui/libs/ui-typography-helm/files/lib/hlm-small.ts.template +1 -1
- package/src/generators/ui/libs/ui-typography-helm/files/lib/hlm-ul.ts.template +1 -1
- package/src/generators/ui/primitive-deps.js +2 -0
- package/src/generators/ui/primitive-deps.js.map +1 -1
- package/src/generators/ui/primitives.d.ts +1 -1
- package/src/generators/ui/schema.d.ts +1 -1
- package/src/generators/ui/supported-ui-libraries.json +47 -27
- package/src/utils/config.js.map +1 -1
- package/src/utils/hlm-class.d.ts +1 -1
- package/src/utils/tsconfig.d.ts +1 -1
- package/src/utils/tsconfig.js.map +1 -1
- package/src/utils/visit-files.d.ts +1 -1
- package/src/utils/visit-files.js.map +1 -1
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { computed, Directive, inject, input } from '@angular/core';
|
|
2
|
+
import { hlm } from '<%- importAlias %>/utils';
|
|
3
|
+
|
|
4
|
+
import { HlmSidebarService } from './hlm-sidebar.service';
|
|
5
|
+
|
|
6
|
+
import type { ClassValue } from 'clsx';
|
|
7
|
+
|
|
8
|
+
@Directive({
|
|
9
|
+
selector: 'button[hlmSidebarRail]',
|
|
10
|
+
|
|
11
|
+
host: {
|
|
12
|
+
'data-sidebar': 'rail',
|
|
13
|
+
'data-slot': 'sidebar-rail',
|
|
14
|
+
'aria-label': 'Toggle Sidebar',
|
|
15
|
+
tabindex: '-1',
|
|
16
|
+
'[class]': '_computedClass()',
|
|
17
|
+
'(click)': 'onClick()',
|
|
18
|
+
},
|
|
19
|
+
})
|
|
20
|
+
export class HlmSidebarRail {
|
|
21
|
+
private readonly _sidebarService = inject(HlmSidebarService);
|
|
22
|
+
|
|
23
|
+
public readonly userClass = input<ClassValue>('', { alias: 'class' });
|
|
24
|
+
protected readonly _computedClass = computed(() =>
|
|
25
|
+
hlm(
|
|
26
|
+
'hover:after:bg-sidebar-border absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] group-data-[side=left]:-right-4 group-data-[side=right]:left-0 sm:flex',
|
|
27
|
+
'group-data-[side=left]:cursor-w-resize group-data-[side=right]:cursor-e-resize',
|
|
28
|
+
'[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize',
|
|
29
|
+
'hover:group-data-[collapsible=offcanvas]:bg-sidebar group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full',
|
|
30
|
+
'[[data-side=left][data-collapsible=offcanvas]_&]:-right-2',
|
|
31
|
+
'[[data-side=right][data-collapsible=offcanvas]_&]:-left-2',
|
|
32
|
+
this.userClass(),
|
|
33
|
+
),
|
|
34
|
+
);
|
|
35
|
+
|
|
36
|
+
protected onClick(): void {
|
|
37
|
+
this._sidebarService.toggleSidebar();
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { computed, Directive, input } from '@angular/core';
|
|
2
|
+
import { HlmSeparator } from '<%- importAlias %>/separator';
|
|
3
|
+
import { hlm } from '<%- importAlias %>/utils';
|
|
4
|
+
|
|
5
|
+
import type { ClassValue } from 'clsx';
|
|
6
|
+
|
|
7
|
+
@Directive({
|
|
8
|
+
selector: 'div[hlmSidebarSeparator]',
|
|
9
|
+
|
|
10
|
+
hostDirectives: [{ directive: HlmSeparator }],
|
|
11
|
+
host: {
|
|
12
|
+
'data-sidebar': 'separator',
|
|
13
|
+
'[class]': '_computedClass()',
|
|
14
|
+
},
|
|
15
|
+
})
|
|
16
|
+
export class HlmSidebarSeparator {
|
|
17
|
+
public readonly userClass = input<ClassValue>('', { alias: 'class' });
|
|
18
|
+
|
|
19
|
+
protected readonly _computedClass = computed(() => hlm('bg-sidebar-border w-auto', this.userClass()));
|
|
20
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { ChangeDetectionStrategy, Component, inject } from '@angular/core';
|
|
2
|
+
import { NgIcon, provideIcons } from '@ng-icons/core';
|
|
3
|
+
import { lucidePanelLeft } from '@ng-icons/lucide';
|
|
4
|
+
import { HlmButton, provideBrnButtonConfig } from '<%- importAlias %>/button';
|
|
5
|
+
|
|
6
|
+
import { HlmSidebarService } from './hlm-sidebar.service';
|
|
7
|
+
|
|
8
|
+
import { HlmIcon } from '<%- importAlias %>/icon';
|
|
9
|
+
|
|
10
|
+
@Component({
|
|
11
|
+
// eslint-disable-next-line @angular-eslint/component-selector
|
|
12
|
+
selector: 'button[hlmSidebarTrigger]',
|
|
13
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
14
|
+
|
|
15
|
+
imports: [HlmIcon, NgIcon],
|
|
16
|
+
providers: [provideIcons({ lucidePanelLeft }), provideBrnButtonConfig({ variant: 'ghost', size: 'icon' })],
|
|
17
|
+
template: `
|
|
18
|
+
<ng-icon hlm name="lucidePanelLeft" size="sm"></ng-icon>
|
|
19
|
+
`,
|
|
20
|
+
hostDirectives: [
|
|
21
|
+
{
|
|
22
|
+
directive: HlmButton,
|
|
23
|
+
},
|
|
24
|
+
],
|
|
25
|
+
host: {
|
|
26
|
+
'data-sidebar': 'trigger',
|
|
27
|
+
'data-slot': 'sidebar-trigger',
|
|
28
|
+
'(click)': '_onClick()',
|
|
29
|
+
},
|
|
30
|
+
})
|
|
31
|
+
export class HlmSidebarTrigger {
|
|
32
|
+
private readonly _hlmBtn = inject(HlmButton);
|
|
33
|
+
private readonly _sidebarService = inject(HlmSidebarService);
|
|
34
|
+
|
|
35
|
+
constructor() {
|
|
36
|
+
this._hlmBtn.setClass('h-7 w-7');
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
protected _onClick(): void {
|
|
40
|
+
this._sidebarService.toggleSidebar();
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { computed, Directive, input } from '@angular/core';
|
|
2
|
+
import { hlm } from '<%- importAlias %>/utils';
|
|
3
|
+
import type { ClassValue } from 'clsx';
|
|
4
|
+
import { injectHlmSidebarConfig } from './hlm-sidebar.token';
|
|
5
|
+
|
|
6
|
+
@Directive({
|
|
7
|
+
selector: 'div[hlmSidebarWrapper]',
|
|
8
|
+
host: {
|
|
9
|
+
'data-slot': 'sidebar-wrapper',
|
|
10
|
+
'[class]': '_computedClass()',
|
|
11
|
+
'[style.--sidebar-width]': 'sidebarWidth()',
|
|
12
|
+
'[style.--sidebar-width-icon]': 'sidebarWidthIcon()',
|
|
13
|
+
},
|
|
14
|
+
})
|
|
15
|
+
export class HlmSidebarWrapper {
|
|
16
|
+
private readonly _config = injectHlmSidebarConfig();
|
|
17
|
+
|
|
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
|
+
public readonly sidebarWidth = input(this._config.sidebarWidth);
|
|
24
|
+
public readonly sidebarWidthIcon = input(this._config.sidebarWidthIcon);
|
|
25
|
+
}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { DOCUMENT } from '@angular/common';
|
|
2
|
+
import { afterNextRender, computed, DestroyRef, inject, Injectable, type Signal, signal } from '@angular/core';
|
|
3
|
+
import { injectHlmSidebarConfig } from './hlm-sidebar.token';
|
|
4
|
+
|
|
5
|
+
export type SidebarVariant = 'sidebar' | 'floating' | 'inset';
|
|
6
|
+
|
|
7
|
+
@Injectable({ providedIn: 'root' })
|
|
8
|
+
export class HlmSidebarService {
|
|
9
|
+
private readonly _config = injectHlmSidebarConfig();
|
|
10
|
+
private readonly _document = inject(DOCUMENT);
|
|
11
|
+
private readonly _window = this._document.defaultView;
|
|
12
|
+
private readonly _open = signal<boolean>(true);
|
|
13
|
+
private readonly _openMobile = signal<boolean>(false);
|
|
14
|
+
private readonly _isMobile = signal<boolean>(false);
|
|
15
|
+
private readonly _variant = signal<SidebarVariant>('sidebar');
|
|
16
|
+
private _mediaQuery: MediaQueryList | null = null;
|
|
17
|
+
|
|
18
|
+
public readonly open: Signal<boolean> = this._open.asReadonly();
|
|
19
|
+
public readonly openMobile: Signal<boolean> = this._openMobile.asReadonly();
|
|
20
|
+
public readonly isMobile: Signal<boolean> = this._isMobile.asReadonly();
|
|
21
|
+
public readonly variant: Signal<SidebarVariant> = this._variant.asReadonly();
|
|
22
|
+
|
|
23
|
+
public readonly state = computed<'expanded' | 'collapsed'>(() => (this._open() ? 'expanded' : 'collapsed'));
|
|
24
|
+
|
|
25
|
+
constructor() {
|
|
26
|
+
const destroyRef = inject(DestroyRef);
|
|
27
|
+
afterNextRender(() => {
|
|
28
|
+
if (!this._window) return;
|
|
29
|
+
// Initialize from cookie
|
|
30
|
+
const cookie = this._document.cookie
|
|
31
|
+
.split('; ')
|
|
32
|
+
.find((row) => row.startsWith(`${this._config.sidebarCookieName}=`));
|
|
33
|
+
|
|
34
|
+
if (cookie) {
|
|
35
|
+
const value = cookie.split('=')[1];
|
|
36
|
+
this._open.set(value === 'true');
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// Initialize MediaQueryList
|
|
40
|
+
this._mediaQuery = this._window.matchMedia(`(max-width: ${this._config.mobileBreakpoint})`);
|
|
41
|
+
this._isMobile.set(this._mediaQuery.matches);
|
|
42
|
+
|
|
43
|
+
// Add media query listener
|
|
44
|
+
const mediaQueryHandler = (e: MediaQueryListEvent) => {
|
|
45
|
+
this._isMobile.set(e.matches);
|
|
46
|
+
// If switching from mobile to desktop, close mobile sidebar
|
|
47
|
+
if (!e.matches) this._openMobile.set(false);
|
|
48
|
+
};
|
|
49
|
+
this._mediaQuery.addEventListener('change', mediaQueryHandler);
|
|
50
|
+
|
|
51
|
+
// Add keyboard shortcut listener
|
|
52
|
+
const keydownHandler = (event: KeyboardEvent) => {
|
|
53
|
+
if (event.key === this._config.sidebarKeyboardShortcut && (event.ctrlKey || event.metaKey)) {
|
|
54
|
+
event.preventDefault();
|
|
55
|
+
this.toggleSidebar();
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
this._window.addEventListener('keydown', keydownHandler);
|
|
59
|
+
|
|
60
|
+
// Add resize listener with debounce
|
|
61
|
+
let resizeTimeout: number;
|
|
62
|
+
const resizeHandler = () => {
|
|
63
|
+
if (!this._window) return;
|
|
64
|
+
|
|
65
|
+
if (resizeTimeout) this._window.clearTimeout(resizeTimeout);
|
|
66
|
+
resizeTimeout = this._window.setTimeout(() => {
|
|
67
|
+
if (this._mediaQuery) this._isMobile.set(this._mediaQuery.matches);
|
|
68
|
+
}, 100);
|
|
69
|
+
};
|
|
70
|
+
this._window.addEventListener('resize', resizeHandler);
|
|
71
|
+
|
|
72
|
+
// Cleanup listeners on destroy
|
|
73
|
+
destroyRef.onDestroy(() => {
|
|
74
|
+
if (!this._window) return;
|
|
75
|
+
|
|
76
|
+
if (this._mediaQuery) this._mediaQuery.removeEventListener('change', mediaQueryHandler);
|
|
77
|
+
this._window.removeEventListener('keydown', keydownHandler);
|
|
78
|
+
this._window.removeEventListener('resize', resizeHandler);
|
|
79
|
+
if (resizeTimeout) this._window.clearTimeout(resizeTimeout);
|
|
80
|
+
});
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
public setOpen(open: boolean): void {
|
|
85
|
+
this._open.set(open);
|
|
86
|
+
this._document.cookie = `${this._config.sidebarCookieName}=${open}; path=/; max-age=${this._config.sidebarCookieMaxAge}`;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
public setOpenMobile(open: boolean): void {
|
|
90
|
+
if (this._isMobile()) {
|
|
91
|
+
this._openMobile.set(open);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
public setVariant(variant: SidebarVariant): void {
|
|
96
|
+
this._variant.set(variant);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
public toggleSidebar(): void {
|
|
100
|
+
if (this._isMobile()) {
|
|
101
|
+
this._openMobile.update((value) => !value);
|
|
102
|
+
} else {
|
|
103
|
+
this.setOpen(!this._open());
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { inject, InjectionToken, type ValueProvider } from '@angular/core';
|
|
2
|
+
|
|
3
|
+
export interface HlmSidebarConfig {
|
|
4
|
+
sidebarWidth: string;
|
|
5
|
+
sidebarWidthMobile: string;
|
|
6
|
+
sidebarWidthIcon: string;
|
|
7
|
+
sidebarCookieName: string;
|
|
8
|
+
sidebarCookieMaxAge: number;
|
|
9
|
+
sidebarKeyboardShortcut: string;
|
|
10
|
+
mobileBreakpoint: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const defaultConfig: HlmSidebarConfig = {
|
|
14
|
+
sidebarWidth: '16rem',
|
|
15
|
+
sidebarWidthMobile: '18rem',
|
|
16
|
+
sidebarWidthIcon: '3rem',
|
|
17
|
+
sidebarCookieName: 'sidebar_state',
|
|
18
|
+
sidebarCookieMaxAge: 60 * 60 * 24 * 7, // 7 days in seconds
|
|
19
|
+
sidebarKeyboardShortcut: 'b',
|
|
20
|
+
mobileBreakpoint: '768px',
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
const HlmSidebarConfigToken = new InjectionToken<HlmSidebarConfig>('HlmSidebarConfig');
|
|
24
|
+
|
|
25
|
+
export function provideHlmSidebarConfig(config: Partial<HlmSidebarConfig>): ValueProvider {
|
|
26
|
+
return { provide: HlmSidebarConfigToken, useValue: { ...defaultConfig, ...config } };
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export function injectHlmSidebarConfig(): HlmSidebarConfig {
|
|
30
|
+
return inject(HlmSidebarConfigToken, { optional: true }) ?? defaultConfig;
|
|
31
|
+
}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { ChangeDetectionStrategy, Component, computed, effect, inject, input } from '@angular/core';
|
|
2
|
+
import { BrnSheetContent } from '@spartan-ng/brain/sheet';
|
|
3
|
+
import { HlmSheet, HlmSheetContent } from '<%- importAlias %>/sheet';
|
|
4
|
+
import { hlm } from '<%- importAlias %>/utils';
|
|
5
|
+
|
|
6
|
+
import { HlmSidebarService, type SidebarVariant } from './hlm-sidebar.service';
|
|
7
|
+
|
|
8
|
+
import { NgTemplateOutlet } from '@angular/common';
|
|
9
|
+
import type { ClassValue } from 'clsx';
|
|
10
|
+
import { injectHlmSidebarConfig } from './hlm-sidebar.token';
|
|
11
|
+
|
|
12
|
+
@Component({
|
|
13
|
+
selector: 'hlm-sidebar',
|
|
14
|
+
|
|
15
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
16
|
+
imports: [HlmSheet, HlmSheetContent, NgTemplateOutlet, BrnSheetContent],
|
|
17
|
+
|
|
18
|
+
template: `
|
|
19
|
+
<ng-template #contentContainer>
|
|
20
|
+
<ng-content></ng-content>
|
|
21
|
+
</ng-template>
|
|
22
|
+
|
|
23
|
+
@if (collapsible() === 'none') {
|
|
24
|
+
<div data-slot="sidebar" [class]="_nonCollapsibleComputedClass()">
|
|
25
|
+
<ng-container *ngTemplateOutlet="contentContainer"></ng-container>
|
|
26
|
+
</div>
|
|
27
|
+
} @else if (_sidebarService.isMobile()) {
|
|
28
|
+
<hlm-sheet
|
|
29
|
+
[side]="side()"
|
|
30
|
+
[closeDelay]="0"
|
|
31
|
+
[state]="_sidebarService.openMobile() ? 'open' : 'closed'"
|
|
32
|
+
(stateChanged)="_sidebarService.setOpenMobile($event === 'open')"
|
|
33
|
+
>
|
|
34
|
+
<hlm-sheet-content
|
|
35
|
+
*brnSheetContent="let ctx"
|
|
36
|
+
data-slot="sidebar"
|
|
37
|
+
data-sidebar="sidebar"
|
|
38
|
+
data-mobile="true"
|
|
39
|
+
class="bg-sidebar text-sidebar-foreground h-screen w-[var(--sidebar-width)] p-0 [&>button]:hidden"
|
|
40
|
+
[style.--sidebar-width]="sidebarWidthMobile()"
|
|
41
|
+
>
|
|
42
|
+
<div class="flex h-full w-full flex-col">
|
|
43
|
+
<ng-container *ngTemplateOutlet="contentContainer"></ng-container>
|
|
44
|
+
</div>
|
|
45
|
+
</hlm-sheet-content>
|
|
46
|
+
</hlm-sheet>
|
|
47
|
+
} @else {
|
|
48
|
+
<div
|
|
49
|
+
class="text-sidebar-foreground group peer hidden md:block"
|
|
50
|
+
[attr.data-state]="_sidebarService.state()"
|
|
51
|
+
[attr.data-collapsible]="_sidebarService.state() === 'collapsed' ? collapsible() : ''"
|
|
52
|
+
[attr.data-variant]="variant()"
|
|
53
|
+
[attr.data-side]="side()"
|
|
54
|
+
data-slot="sidebar"
|
|
55
|
+
>
|
|
56
|
+
<!-- Sidebar gap on desktop -->
|
|
57
|
+
<div data-slot="sidebar-gap" [class]="_sidebarGapComputedClass()"></div>
|
|
58
|
+
<div data-slot="sidebar-container" [class]="_sidebarContainerComputedClass()">
|
|
59
|
+
<div
|
|
60
|
+
data-sidebar="sidebar"
|
|
61
|
+
data-slot="sidebar-inner"
|
|
62
|
+
class="bg-sidebar group-data-[variant=floating]:border-sidebar-border flex h-full w-full flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:shadow"
|
|
63
|
+
>
|
|
64
|
+
<ng-container *ngTemplateOutlet="contentContainer"></ng-container>
|
|
65
|
+
</div>
|
|
66
|
+
</div>
|
|
67
|
+
</div>
|
|
68
|
+
}
|
|
69
|
+
`,
|
|
70
|
+
})
|
|
71
|
+
export class HlmSidebar {
|
|
72
|
+
protected readonly _sidebarService = inject(HlmSidebarService);
|
|
73
|
+
private readonly _config = injectHlmSidebarConfig();
|
|
74
|
+
|
|
75
|
+
public readonly sidebarWidthMobile = input(this._config.sidebarWidthMobile);
|
|
76
|
+
|
|
77
|
+
public readonly side = input<'left' | 'right'>('left');
|
|
78
|
+
public readonly variant = input<SidebarVariant>(this._sidebarService.variant());
|
|
79
|
+
public readonly collapsible = input<'offcanvas' | 'icon' | 'none'>('offcanvas');
|
|
80
|
+
public readonly userClass = input<ClassValue>('', { alias: 'class' });
|
|
81
|
+
|
|
82
|
+
protected readonly _nonCollapsibleComputedClass = computed(() =>
|
|
83
|
+
hlm('bg-sidebar text-sidebar-foreground flex h-full w-[var(--sidebar-width)] flex-col', this.userClass()),
|
|
84
|
+
);
|
|
85
|
+
protected readonly _sidebarGapComputedClass = computed(() =>
|
|
86
|
+
hlm(
|
|
87
|
+
'relative w-[var(--sidebar-width)] bg-transparent transition-[width] duration-200 ease-linear',
|
|
88
|
+
'group-data-[collapsible=offcanvas]:w-0',
|
|
89
|
+
'group-data-[side=right]:rotate-180',
|
|
90
|
+
this.variant() === 'floating' || this.variant() === 'inset'
|
|
91
|
+
? 'group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4))]'
|
|
92
|
+
: 'group-data-[collapsible=icon]:w-[var(--sidebar-width-icon)]',
|
|
93
|
+
),
|
|
94
|
+
);
|
|
95
|
+
|
|
96
|
+
protected readonly _sidebarContainerComputedClass = computed(() =>
|
|
97
|
+
hlm(
|
|
98
|
+
'fixed inset-y-0 z-10 hidden h-svh w-[var(--sidebar-width)] transition-[left,right,width] duration-200 ease-linear md:flex',
|
|
99
|
+
this.side() === 'left'
|
|
100
|
+
? 'left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]'
|
|
101
|
+
: 'right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]',
|
|
102
|
+
this.variant() === 'floating' || this.variant() === 'inset'
|
|
103
|
+
? 'p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4)_+2px)]'
|
|
104
|
+
: 'group-data-[collapsible=icon]:w-[var(--sidebar-width-icon)] group-data-[side=left]:border-r group-data-[side=right]:border-l',
|
|
105
|
+
this.userClass(),
|
|
106
|
+
),
|
|
107
|
+
);
|
|
108
|
+
|
|
109
|
+
constructor() {
|
|
110
|
+
// Sync variant input with service
|
|
111
|
+
effect(() => {
|
|
112
|
+
this._sidebarService.setVariant(this.variant());
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.generator = generator;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const generator_1 = tslib_1.__importDefault(require("../../../base/generator"));
|
|
6
|
+
async function generator(tree, options) {
|
|
7
|
+
return await (0, generator_1.default)(tree, {
|
|
8
|
+
...options,
|
|
9
|
+
primitiveName: 'sidebar',
|
|
10
|
+
internalName: 'ui-sidebar-helm',
|
|
11
|
+
publicName: 'ui-sidebar-helm',
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=generator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../../../libs/cli/src/generators/ui/libs/ui-sidebar-helm/generator.ts"],"names":[],"mappings":";;AAIA,8BAOC;;AAVD,gFAAuD;AAGhD,KAAK,UAAU,SAAS,CAAC,IAAU,EAAE,OAA+B;IAC1E,OAAO,MAAM,IAAA,mBAAgB,EAAC,IAAI,EAAE;QACnC,GAAG,OAAO;QACV,aAAa,EAAE,SAAS;QACxB,YAAY,EAAE,iBAAiB;QAC/B,UAAU,EAAE,iBAAiB;KAC7B,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -12,5 +12,5 @@ import type { ClassValue } from 'clsx';
|
|
|
12
12
|
})
|
|
13
13
|
export class HlmSkeleton {
|
|
14
14
|
public readonly userClass = input<ClassValue>('', { alias: 'class' });
|
|
15
|
-
protected _computedClass = computed(() => hlm('bg-muted block animate-pulse rounded-md', this.userClass()));
|
|
15
|
+
protected readonly _computedClass = computed(() => hlm('bg-muted block animate-pulse rounded-md', this.userClass()));
|
|
16
16
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BooleanInput } from '@angular/cdk/coercion';
|
|
1
|
+
import type { BooleanInput } from '@angular/cdk/coercion';
|
|
2
2
|
import {
|
|
3
3
|
booleanAttribute,
|
|
4
4
|
ChangeDetectionStrategy,
|
|
@@ -10,8 +10,8 @@ import {
|
|
|
10
10
|
model,
|
|
11
11
|
output,
|
|
12
12
|
} from '@angular/core';
|
|
13
|
-
import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
14
|
-
import { ChangeFn, TouchFn } from '@spartan-ng/brain/forms';
|
|
13
|
+
import { type ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
14
|
+
import type { ChangeFn, TouchFn } from '@spartan-ng/brain/forms';
|
|
15
15
|
import { BrnSwitch, BrnSwitchThumb } from '@spartan-ng/brain/switch';
|
|
16
16
|
import { hlm } from '<%- importAlias %>/utils';
|
|
17
17
|
import type { ClassValue } from 'clsx';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// src/app/directives/hlm-table-directives.ts
|
|
2
|
-
import { computed, Directive, inject, InjectionToken, input, ValueProvider } from '@angular/core';
|
|
2
|
+
import { computed, Directive, inject, InjectionToken, input, type ValueProvider } from '@angular/core';
|
|
3
3
|
import { hlm } from '<%- importAlias %>/utils';
|
|
4
4
|
import type { ClassValue } from 'clsx';
|
|
5
5
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ChangeDetectionStrategy, Component, computed, input } from '@angular/core';
|
|
2
2
|
import { BrnTabs } from '@spartan-ng/brain/tabs';
|
|
3
3
|
import { hlm } from '<%- importAlias %>/utils';
|
|
4
|
-
import { ClassValue } from 'clsx';
|
|
4
|
+
import type { ClassValue } from 'clsx';
|
|
5
5
|
|
|
6
6
|
@Component({
|
|
7
7
|
selector: 'hlm-tabs',
|
package/src/generators/ui/libs/ui-toggle-group-helm/files/lib/hlm-toggle-group.token.ts.template
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ExistingProvider, InjectionToken, Type, inject } from '@angular/core';
|
|
1
|
+
import { type ExistingProvider, InjectionToken, type Type, inject } from '@angular/core';
|
|
2
2
|
import type { HlmToggleGroup } from './hlm-toggle-group';
|
|
3
3
|
|
|
4
4
|
const HlmToggleGroupToken = new InjectionToken<HlmToggleGroup>('HlmToggleGroupToken');
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Directive, computed, input } from '@angular/core';
|
|
2
2
|
import { hlm } from '<%- importAlias %>/utils';
|
|
3
|
-
import { VariantProps } from 'class-variance-authority';
|
|
3
|
+
import type { VariantProps } from 'class-variance-authority';
|
|
4
4
|
import type { ClassValue } from 'clsx';
|
|
5
5
|
import { provideHlmToggleGroup } from './hlm-toggle-group.token';
|
|
6
|
-
import { toggleGroupItemVariants } from './hlm-toggle-item';
|
|
6
|
+
import type { toggleGroupItemVariants } from './hlm-toggle-item';
|
|
7
7
|
|
|
8
8
|
type ToggleGroupItemVariants = VariantProps<typeof toggleGroupItemVariants>;
|
|
9
9
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Directive } from '@angular/core';
|
|
2
2
|
import { BrnTooltipTrigger, provideBrnTooltipDefaultOptions } from '@spartan-ng/brain/tooltip';
|
|
3
3
|
|
|
4
|
-
const DEFAULT_TOOLTIP_CONTENT_CLASSES =
|
|
4
|
+
export const DEFAULT_TOOLTIP_CONTENT_CLASSES =
|
|
5
5
|
'bg-primary text-primary-foreground animate-in fade-in-0 zoom-in-95 z-50 w-fit rounded-md px-3 py-1.5 text-xs text-balance ' +
|
|
6
6
|
'data-[state=open]:animate-in ' +
|
|
7
7
|
'data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 ' +
|
|
@@ -12,5 +12,5 @@ export const hlmBlockquote = 'mt-6 border-border border-l-2 pl-6 italic';
|
|
|
12
12
|
})
|
|
13
13
|
export class HlmBlockquote {
|
|
14
14
|
public readonly userClass = input<ClassValue>('', { alias: 'class' });
|
|
15
|
-
protected _computedClass = computed(() => hlm(hlmBlockquote, this.userClass()));
|
|
15
|
+
protected readonly _computedClass = computed(() => hlm(hlmBlockquote, this.userClass()));
|
|
16
16
|
}
|
|
@@ -12,5 +12,5 @@ export const hlmCode = 'relative rounded bg-muted px-[0.3rem] py-[0.2rem] font-m
|
|
|
12
12
|
})
|
|
13
13
|
export class HlmCode {
|
|
14
14
|
public readonly userClass = input<ClassValue>('', { alias: 'class' });
|
|
15
|
-
protected _computedClass = computed(() => hlm(hlmCode, this.userClass()));
|
|
15
|
+
protected readonly _computedClass = computed(() => hlm(hlmCode, this.userClass()));
|
|
16
16
|
}
|
|
@@ -12,5 +12,5 @@ export const hlmH1 = 'scroll-m-20 text-4xl font-extrabold tracking-tight lg:text
|
|
|
12
12
|
})
|
|
13
13
|
export class HlmH1 {
|
|
14
14
|
public readonly userClass = input<ClassValue>('', { alias: 'class' });
|
|
15
|
-
protected _computedClass = computed(() => hlm(hlmH1, this.userClass()));
|
|
15
|
+
protected readonly _computedClass = computed(() => hlm(hlmH1, this.userClass()));
|
|
16
16
|
}
|
|
@@ -13,5 +13,5 @@ export const hlmH2 =
|
|
|
13
13
|
})
|
|
14
14
|
export class HlmH2 {
|
|
15
15
|
public readonly userClass = input<ClassValue>('', { alias: 'class' });
|
|
16
|
-
protected _computedClass = computed(() => hlm(hlmH2, this.userClass()));
|
|
16
|
+
protected readonly _computedClass = computed(() => hlm(hlmH2, this.userClass()));
|
|
17
17
|
}
|
|
@@ -12,5 +12,5 @@ export const hlmH3 = 'scroll-m-20 text-2xl font-semibold tracking-tight';
|
|
|
12
12
|
})
|
|
13
13
|
export class HlmH3 {
|
|
14
14
|
public readonly userClass = input<ClassValue>('', { alias: 'class' });
|
|
15
|
-
protected _computedClass = computed(() => hlm(hlmH3, this.userClass()));
|
|
15
|
+
protected readonly _computedClass = computed(() => hlm(hlmH3, this.userClass()));
|
|
16
16
|
}
|
|
@@ -12,5 +12,5 @@ export const hlmLarge = 'text-lg font-semibold';
|
|
|
12
12
|
})
|
|
13
13
|
export class HlmLarge {
|
|
14
14
|
public readonly userClass = input<ClassValue>('', { alias: 'class' });
|
|
15
|
-
protected _computedClass = computed(() => hlm(hlmLarge, this.userClass()));
|
|
15
|
+
protected readonly _computedClass = computed(() => hlm(hlmLarge, this.userClass()));
|
|
16
16
|
}
|
|
@@ -12,5 +12,5 @@ export const hlmLead = 'text-xl text-muted-foreground';
|
|
|
12
12
|
})
|
|
13
13
|
export class HlmLead {
|
|
14
14
|
public readonly userClass = input<ClassValue>('', { alias: 'class' });
|
|
15
|
-
protected _computedClass = computed(() => hlm(hlmLead, this.userClass()));
|
|
15
|
+
protected readonly _computedClass = computed(() => hlm(hlmLead, this.userClass()));
|
|
16
16
|
}
|
|
@@ -12,5 +12,5 @@ export const hlmMuted = 'text-sm text-muted-foreground';
|
|
|
12
12
|
})
|
|
13
13
|
export class HlmMuted {
|
|
14
14
|
public readonly userClass = input<ClassValue>('', { alias: 'class' });
|
|
15
|
-
protected _computedClass = computed(() => hlm(hlmMuted, this.userClass()));
|
|
15
|
+
protected readonly _computedClass = computed(() => hlm(hlmMuted, this.userClass()));
|
|
16
16
|
}
|
|
@@ -12,5 +12,5 @@ export const hlmP = 'leading-7 [&:not(:first-child)]:mt-6';
|
|
|
12
12
|
})
|
|
13
13
|
export class HlmP {
|
|
14
14
|
public readonly userClass = input<ClassValue>('', { alias: 'class' });
|
|
15
|
-
protected _computedClass = computed(() => hlm(hlmP, this.userClass()));
|
|
15
|
+
protected readonly _computedClass = computed(() => hlm(hlmP, this.userClass()));
|
|
16
16
|
}
|
|
@@ -12,5 +12,5 @@ export const hlmSmall = 'text-sm font-medium leading-none';
|
|
|
12
12
|
})
|
|
13
13
|
export class HlmSmall {
|
|
14
14
|
public readonly userClass = input<ClassValue>('', { alias: 'class' });
|
|
15
|
-
protected _computedClass = computed(() => hlm(hlmSmall, this.userClass()));
|
|
15
|
+
protected readonly _computedClass = computed(() => hlm(hlmSmall, this.userClass()));
|
|
16
16
|
}
|
|
@@ -12,5 +12,5 @@ export const hlmUl = 'my-6 ml-6 list-disc [&>li]:mt-2';
|
|
|
12
12
|
})
|
|
13
13
|
export class HlmUl {
|
|
14
14
|
public readonly userClass = input<ClassValue>('', { alias: 'class' });
|
|
15
|
-
protected _computedClass = computed(() => hlm(hlmUl, this.userClass()));
|
|
15
|
+
protected readonly _computedClass = computed(() => hlm(hlmUl, this.userClass()));
|
|
16
16
|
}
|
|
@@ -24,6 +24,7 @@ exports.primitiveDependencies = {
|
|
|
24
24
|
'hover-card': ['utils'],
|
|
25
25
|
icon: ['utils'],
|
|
26
26
|
input: ['utils', 'form-field'],
|
|
27
|
+
'input-group': ['utils'],
|
|
27
28
|
'input-otp': ['utils', 'icon'],
|
|
28
29
|
label: ['utils'],
|
|
29
30
|
menu: ['utils', 'icon'],
|
|
@@ -36,6 +37,7 @@ exports.primitiveDependencies = {
|
|
|
36
37
|
select: ['utils', 'icon', 'form-field'],
|
|
37
38
|
separator: ['utils'],
|
|
38
39
|
sheet: ['utils'],
|
|
40
|
+
sidebar: ['utils', 'button', 'icon', 'input', 'separator', 'sheet', 'tooltip'],
|
|
39
41
|
skeleton: ['utils'],
|
|
40
42
|
slider: ['utils'],
|
|
41
43
|
sonner: ['utils', 'icon'],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"primitive-deps.js","sourceRoot":"","sources":["../../../../../../libs/cli/src/generators/ui/primitive-deps.ts"],"names":[],"mappings":";;;AAEa,QAAA,qBAAqB,GAAmC;IACpE,SAAS,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC;IAC5B,KAAK,EAAE,CAAC,OA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gBAC3F,mBAAmB,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;YAC9B,CAAC;QACF,CAAC;IACF,CAAC;IAED,OAAO,KAAK,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC;AACxC,CAAC,CAAC;AAdW,QAAA,sBAAsB,0BAcjC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export type Primitive = 'accordion' | 'alert' | 'alert-dialog' | 'aspect-ratio' | 'autocomplete' | 'avatar' | 'badge' | 'breadcrumb' | 'button' | 'calendar' | 'card' | 'carousel' | 'checkbox' | 'collapsible' | 'command' | 'context-menu' | 'date-picker' | 'dialog' | 'form-field' | 'hover-card' | 'icon' | 'input' | 'input-otp' | 'label' | 'menu' | 'menubar' | 'pagination' | 'popover' | 'progress' | 'radio-group' | 'scroll-area' | 'select' | 'separator' | 'sheet' | 'skeleton' | 'slider' | 'sonner' | 'spinner' | 'switch' | 'table' | 'tabs' | 'toggle' | 'toggle-group' | 'tooltip' | 'utils';
|
|
1
|
+
export type Primitive = 'accordion' | 'alert' | 'alert-dialog' | 'aspect-ratio' | 'autocomplete' | 'avatar' | 'badge' | 'breadcrumb' | 'button' | 'calendar' | 'card' | 'carousel' | 'checkbox' | 'collapsible' | 'command' | 'context-menu' | 'date-picker' | 'dialog' | 'form-field' | 'hover-card' | 'icon' | 'input' | 'input-group' | 'input-otp' | 'label' | 'menu' | 'menubar' | 'pagination' | 'popover' | 'progress' | 'radio-group' | 'scroll-area' | 'select' | 'separator' | 'sheet' | 'sidebar' | 'skeleton' | 'slider' | 'sonner' | 'spinner' | 'switch' | 'table' | 'tabs' | 'toggle' | 'toggle-group' | 'tooltip' | 'utils';
|