@spartan-ng/cli 0.0.1-alpha.710 → 0.0.1-alpha.712
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/generator.js +4 -2
- package/src/generators/base/generator.js.map +1 -1
- package/src/generators/base/lib/build-dependency-array.d.ts +1 -1
- package/src/generators/base/lib/build-dependency-array.js +2 -4
- package/src/generators/base/lib/build-dependency-array.js.map +1 -1
- package/src/generators/base/lib/initialize-angular-library.js +5 -4
- package/src/generators/base/lib/initialize-angular-library.js.map +1 -1
- package/src/generators/init/compat.d.ts +2 -1
- package/src/generators/init/compat.js +1 -1
- package/src/generators/init/compat.js.map +1 -1
- package/src/generators/init/generator.d.ts +2 -1
- package/src/generators/init/generator.js +3 -3
- package/src/generators/init/generator.js.map +1 -1
- package/src/generators/init/schema.d.ts +6 -0
- package/src/generators/init/schema.json +19 -1
- package/src/generators/migrate-core/generator.js +0 -15
- package/src/generators/migrate-core/generator.js.map +1 -1
- package/src/generators/migrate-helm-libraries/generator.js +7 -2
- package/src/generators/migrate-helm-libraries/generator.js.map +1 -1
- package/src/generators/theme/compat.d.ts +1 -1
- package/src/generators/theme/generator.d.ts +2 -1
- package/src/generators/theme/generator.js +64 -32
- package/src/generators/theme/generator.js.map +1 -1
- package/src/generators/theme/libs/add-theme-to-application-styles.d.ts +0 -1
- package/src/generators/theme/libs/add-theme-to-application-styles.js +35 -21
- package/src/generators/theme/libs/add-theme-to-application-styles.js.map +1 -1
- package/src/generators/theme/libs/colors.d.ts +0 -1
- package/src/generators/theme/libs/colors.js +1 -277
- package/src/generators/theme/libs/colors.js.map +1 -1
- package/src/generators/theme/schema.d.ts +17 -0
- package/src/generators/theme/schema.json +19 -1
- package/src/generators/ui/libs/alert-dialog/files/index.ts.template +3 -0
- package/src/generators/ui/libs/alert-dialog/files/lib/hlm-alert-dialog-action.ts.template +1 -3
- package/src/generators/ui/libs/alert-dialog/files/lib/hlm-alert-dialog-cancel.ts.template +6 -4
- package/src/generators/ui/libs/alert-dialog/files/lib/hlm-alert-dialog-content.ts.template +5 -5
- package/src/generators/ui/libs/alert-dialog/files/lib/hlm-alert-dialog-description.ts.template +2 -4
- package/src/generators/ui/libs/alert-dialog/files/lib/hlm-alert-dialog-footer.ts.template +5 -4
- package/src/generators/ui/libs/alert-dialog/files/lib/hlm-alert-dialog-header.ts.template +2 -4
- package/src/generators/ui/libs/alert-dialog/files/lib/hlm-alert-dialog-media.ts.template +12 -0
- package/src/generators/ui/libs/alert-dialog/files/lib/hlm-alert-dialog-overlay.ts.template +1 -6
- package/src/generators/ui/libs/alert-dialog/files/lib/hlm-alert-dialog-title.ts.template +2 -4
- package/src/generators/ui/libs/alert-dialog/files/lib/hlm-alert-dialog-trigger.ts.template +1 -3
- package/src/generators/ui/libs/carousel/files/lib/hlm-carousel.ts.template +2 -6
- package/src/generators/ui/libs/dialog/files/lib/hlm-dialog-close.ts.template +1 -3
- package/src/generators/ui/libs/dialog/files/lib/hlm-dialog-content.ts.template +2 -5
- package/src/generators/ui/libs/dialog/files/lib/hlm-dialog-description.ts.template +2 -4
- package/src/generators/ui/libs/dialog/files/lib/hlm-dialog-footer.ts.template +2 -4
- package/src/generators/ui/libs/dialog/files/lib/hlm-dialog-header.ts.template +2 -4
- package/src/generators/ui/libs/dialog/files/lib/hlm-dialog-overlay.ts.template +2 -3
- package/src/generators/ui/libs/dialog/files/lib/hlm-dialog-title.ts.template +2 -4
- package/src/generators/ui/libs/dialog/files/lib/hlm-dialog-trigger.ts.template +1 -3
- package/src/generators/ui/libs/sheet/files/lib/hlm-sheet-close.ts.template +1 -3
- package/src/generators/ui/libs/sheet/files/lib/hlm-sheet-content.ts.template +11 -23
- package/src/generators/ui/libs/sheet/files/lib/hlm-sheet-description.ts.template +2 -4
- package/src/generators/ui/libs/sheet/files/lib/hlm-sheet-footer.ts.template +2 -4
- package/src/generators/ui/libs/sheet/files/lib/hlm-sheet-header.ts.template +2 -4
- package/src/generators/ui/libs/sheet/files/lib/hlm-sheet-overlay.ts.template +1 -4
- package/src/generators/ui/libs/sheet/files/lib/hlm-sheet-title.ts.template +2 -4
- package/src/generators/ui/libs/sheet/files/lib/hlm-sheet-trigger.ts.template +1 -3
- package/src/generators/ui/libs/sidebar/files/lib/hlm-sidebar-content.ts.template +4 -1
- package/src/generators/ui/libs/sidebar/files/lib/hlm-sidebar-footer.ts.template +1 -1
- package/src/generators/ui/libs/sidebar/files/lib/hlm-sidebar-group-action.ts.template +4 -6
- package/src/generators/ui/libs/sidebar/files/lib/hlm-sidebar-group-content.ts.template +1 -1
- package/src/generators/ui/libs/sidebar/files/lib/hlm-sidebar-group-label.ts.template +1 -4
- package/src/generators/ui/libs/sidebar/files/lib/hlm-sidebar-group.ts.template +1 -1
- package/src/generators/ui/libs/sidebar/files/lib/hlm-sidebar-header.ts.template +1 -1
- package/src/generators/ui/libs/sidebar/files/lib/hlm-sidebar-inset.ts.template +2 -7
- package/src/generators/ui/libs/sidebar/files/lib/hlm-sidebar-menu-action.ts.template +2 -8
- package/src/generators/ui/libs/sidebar/files/lib/hlm-sidebar-menu-badge.ts.template +4 -8
- package/src/generators/ui/libs/sidebar/files/lib/hlm-sidebar-menu-button.ts.template +6 -7
- package/src/generators/ui/libs/sidebar/files/lib/hlm-sidebar-menu-skeleton.ts.template +7 -4
- package/src/generators/ui/libs/sidebar/files/lib/hlm-sidebar-menu-sub-button.ts.template +5 -6
- package/src/generators/ui/libs/sidebar/files/lib/hlm-sidebar-menu-sub.ts.template +1 -4
- package/src/generators/ui/libs/sidebar/files/lib/hlm-sidebar-menu.ts.template +1 -1
- package/src/generators/ui/libs/sidebar/files/lib/hlm-sidebar-rail.ts.template +2 -2
- package/src/generators/ui/libs/sidebar/files/lib/hlm-sidebar-trigger.ts.template +8 -15
- package/src/generators/ui/libs/sidebar/files/lib/hlm-sidebar-wrapper.ts.template +1 -1
- package/src/generators/ui/libs/sidebar/files/lib/hlm-sidebar.ts.template +11 -18
- package/src/generators/ui/libs/tooltip/files/lib/hlm-tooltip.ts.template +3 -2
- package/src/generators/ui/style-luma.css +3 -3
- package/src/generators/ui/style-lyra.css +6 -6
- package/src/generators/ui/style-maia.css +7 -7
- package/src/generators/ui/style-mira.css +6 -8
- package/src/generators/ui/style-nova.css +7 -7
- package/src/generators/ui/style-vega.css +7 -7
- package/src/generators/ui/supported-ui-libraries.json +41 -41
- package/src/registry/schema.d.ts +94 -121
- package/src/registry/schema.js +1 -10
- package/src/registry/schema.js.map +1 -1
- package/src/utils/get-tailwind-version.d.ts +0 -2
- package/src/utils/get-tailwind-version.js +0 -18
- package/src/utils/get-tailwind-version.js.map +0 -1
|
@@ -3,12 +3,10 @@ import { classes } from '<%- importAlias %>/utils';
|
|
|
3
3
|
|
|
4
4
|
@Directive({
|
|
5
5
|
selector: '[hlmDialogHeader],hlm-dialog-header',
|
|
6
|
-
host: {
|
|
7
|
-
'data-slot': 'dialog-header',
|
|
8
|
-
},
|
|
6
|
+
host: { 'data-slot': 'dialog-header' },
|
|
9
7
|
})
|
|
10
8
|
export class HlmDialogHeader {
|
|
11
9
|
constructor() {
|
|
12
|
-
classes(() => 'flex flex-col
|
|
10
|
+
classes(() => 'spartan-dialog-header flex flex-col');
|
|
13
11
|
}
|
|
14
12
|
}
|
|
@@ -2,10 +2,9 @@ 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 { ClassValue } from 'clsx';
|
|
5
|
+
import type { ClassValue } from 'clsx';
|
|
6
6
|
|
|
7
|
-
export const hlmDialogOverlayClass =
|
|
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';
|
|
7
|
+
export const hlmDialogOverlayClass = hlm('spartan-dialog-overlay');
|
|
9
8
|
|
|
10
9
|
@Directive({
|
|
11
10
|
selector: '[hlmDialogOverlay],hlm-dialog-overlay',
|
|
@@ -5,12 +5,10 @@ import { classes } from '<%- importAlias %>/utils';
|
|
|
5
5
|
@Directive({
|
|
6
6
|
selector: '[hlmDialogTitle]',
|
|
7
7
|
hostDirectives: [BrnDialogTitle],
|
|
8
|
-
host: {
|
|
9
|
-
'data-slot': 'dialog-title',
|
|
10
|
-
},
|
|
8
|
+
host: { 'data-slot': 'dialog-title' },
|
|
11
9
|
})
|
|
12
10
|
export class HlmDialogTitle {
|
|
13
11
|
constructor() {
|
|
14
|
-
classes(() => '
|
|
12
|
+
classes(() => 'spartan-dialog-title');
|
|
15
13
|
}
|
|
16
14
|
}
|
|
@@ -4,8 +4,6 @@ import { BrnDialogTrigger } from '@spartan-ng/brain/dialog';
|
|
|
4
4
|
@Directive({
|
|
5
5
|
selector: 'button[hlmDialogTrigger],button[hlmDialogTriggerFor]',
|
|
6
6
|
hostDirectives: [{ directive: BrnDialogTrigger, inputs: ['id', 'brnDialogTriggerFor: hlmDialogTriggerFor', 'type'] }],
|
|
7
|
-
host: {
|
|
8
|
-
'data-slot': 'dialog-trigger',
|
|
9
|
-
},
|
|
7
|
+
host: { 'data-slot': 'dialog-trigger' },
|
|
10
8
|
})
|
|
11
9
|
export class HlmDialogTrigger {}
|
|
@@ -4,8 +4,6 @@ import { BrnSheetClose } from '@spartan-ng/brain/sheet';
|
|
|
4
4
|
@Directive({
|
|
5
5
|
selector: 'button[hlmSheetClose]',
|
|
6
6
|
hostDirectives: [{ directive: BrnSheetClose, inputs: ['delay'] }],
|
|
7
|
-
host: {
|
|
8
|
-
'data-slot': 'sheet-close',
|
|
9
|
-
},
|
|
7
|
+
host: { 'data-slot': 'sheet-close' },
|
|
10
8
|
})
|
|
11
9
|
export class HlmSheetClose {}
|
|
@@ -16,28 +16,8 @@ import { injectExposedSideProvider, injectExposesStateProvider } from '@spartan-
|
|
|
16
16
|
import { HlmButton } from '<%- importAlias %>/button';
|
|
17
17
|
import { HlmIconImports } from '<%- importAlias %>/icon';
|
|
18
18
|
import { classes } from '<%- importAlias %>/utils';
|
|
19
|
-
import { cva } from 'class-variance-authority';
|
|
20
19
|
import { HlmSheetClose } from './hlm-sheet-close';
|
|
21
20
|
|
|
22
|
-
export const sheetVariants = cva(
|
|
23
|
-
'bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500',
|
|
24
|
-
{
|
|
25
|
-
variants: {
|
|
26
|
-
side: {
|
|
27
|
-
top: 'data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b',
|
|
28
|
-
bottom:
|
|
29
|
-
'data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t',
|
|
30
|
-
left: 'data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm',
|
|
31
|
-
right:
|
|
32
|
-
'data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm',
|
|
33
|
-
},
|
|
34
|
-
},
|
|
35
|
-
defaultVariants: {
|
|
36
|
-
side: 'right',
|
|
37
|
-
},
|
|
38
|
-
},
|
|
39
|
-
);
|
|
40
|
-
|
|
41
21
|
@Component({
|
|
42
22
|
selector: 'hlm-sheet-content',
|
|
43
23
|
imports: [HlmIconImports, HlmButton, HlmSheetClose],
|
|
@@ -45,13 +25,14 @@ export const sheetVariants = cva(
|
|
|
45
25
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
46
26
|
host: {
|
|
47
27
|
'data-slot': 'sheet-content',
|
|
28
|
+
'[attr.data-side]': '_sideProvider.side()',
|
|
48
29
|
'[attr.data-state]': 'state()',
|
|
49
30
|
},
|
|
50
31
|
template: `
|
|
51
32
|
<ng-content />
|
|
52
33
|
|
|
53
34
|
@if (showCloseButton()) {
|
|
54
|
-
<button hlmBtn variant="ghost" size="icon-sm" class="
|
|
35
|
+
<button hlmBtn variant="ghost" size="icon-sm" class="spartan-sheet-close" hlmSheetClose>
|
|
55
36
|
<span class="sr-only">Close</span>
|
|
56
37
|
<ng-icon hlm size="sm" name="lucideX" />
|
|
57
38
|
</button>
|
|
@@ -60,7 +41,7 @@ export const sheetVariants = cva(
|
|
|
60
41
|
})
|
|
61
42
|
export class HlmSheetContent {
|
|
62
43
|
private readonly _stateProvider = injectExposesStateProvider({ host: true });
|
|
63
|
-
|
|
44
|
+
protected readonly _sideProvider = injectExposedSideProvider({ host: true });
|
|
64
45
|
public readonly state = this._stateProvider.state ?? signal('closed');
|
|
65
46
|
private readonly _renderer = inject(Renderer2);
|
|
66
47
|
private readonly _element = inject(ElementRef);
|
|
@@ -68,7 +49,14 @@ export class HlmSheetContent {
|
|
|
68
49
|
public readonly showCloseButton = input<boolean, BooleanInput>(true, { transform: booleanAttribute });
|
|
69
50
|
|
|
70
51
|
constructor() {
|
|
71
|
-
classes(() =>
|
|
52
|
+
classes(() => [
|
|
53
|
+
'spartan-sheet-content',
|
|
54
|
+
'data-open:animate-in data-closed:animate-out',
|
|
55
|
+
'data-[side=top]:data-closed:slide-out-to-top data-[side=top]:data-open:slide-in-from-top',
|
|
56
|
+
'data-[side=bottom]:data-closed:slide-out-to-bottom data-[side=bottom]:data-open:slide-in-from-bottom',
|
|
57
|
+
'data-[side=left]:data-closed:slide-out-to-left data-[side=left]:data-open:slide-in-from-left',
|
|
58
|
+
'data-[side=right]:data-closed:slide-out-to-right data-[side=right]:data-open:slide-in-from-right',
|
|
59
|
+
]);
|
|
72
60
|
effect(() => {
|
|
73
61
|
this._renderer.setAttribute(this._element.nativeElement, 'data-state', this.state());
|
|
74
62
|
});
|
|
@@ -5,12 +5,10 @@ import { classes } from '<%- importAlias %>/utils';
|
|
|
5
5
|
@Directive({
|
|
6
6
|
selector: '[hlmSheetDescription]',
|
|
7
7
|
hostDirectives: [BrnSheetDescription],
|
|
8
|
-
host: {
|
|
9
|
-
'data-slot': 'sheet-description',
|
|
10
|
-
},
|
|
8
|
+
host: { 'data-slot': 'sheet-description' },
|
|
11
9
|
})
|
|
12
10
|
export class HlmSheetDescription {
|
|
13
11
|
constructor() {
|
|
14
|
-
classes(() => '
|
|
12
|
+
classes(() => 'spartan-sheet-description');
|
|
15
13
|
}
|
|
16
14
|
}
|
|
@@ -3,12 +3,10 @@ import { classes } from '<%- importAlias %>/utils';
|
|
|
3
3
|
|
|
4
4
|
@Directive({
|
|
5
5
|
selector: '[hlmSheetFooter],hlm-sheet-footer',
|
|
6
|
-
host: {
|
|
7
|
-
'data-slot': 'sheet-footer',
|
|
8
|
-
},
|
|
6
|
+
host: { 'data-slot': 'sheet-footer' },
|
|
9
7
|
})
|
|
10
8
|
export class HlmSheetFooter {
|
|
11
9
|
constructor() {
|
|
12
|
-
classes(() => 'mt-auto flex flex-col
|
|
10
|
+
classes(() => 'spartan-sheet-footer mt-auto flex flex-col');
|
|
13
11
|
}
|
|
14
12
|
}
|
|
@@ -3,12 +3,10 @@ import { classes } from '<%- importAlias %>/utils';
|
|
|
3
3
|
|
|
4
4
|
@Directive({
|
|
5
5
|
selector: '[hlmSheetHeader],hlm-sheet-header',
|
|
6
|
-
host: {
|
|
7
|
-
'data-slot': 'sheet-header',
|
|
8
|
-
},
|
|
6
|
+
host: { 'data-slot': 'sheet-header' },
|
|
9
7
|
})
|
|
10
8
|
export class HlmSheetHeader {
|
|
11
9
|
constructor() {
|
|
12
|
-
classes(() => 'flex flex-col
|
|
10
|
+
classes(() => 'spartan-sheet-header flex flex-col');
|
|
13
11
|
}
|
|
14
12
|
}
|
|
@@ -7,16 +7,13 @@ import type { ClassValue } from 'clsx';
|
|
|
7
7
|
@Directive({
|
|
8
8
|
selector: '[hlmSheetOverlay],hlm-sheet-overlay',
|
|
9
9
|
hostDirectives: [BrnSheetOverlay],
|
|
10
|
-
host: {
|
|
11
|
-
'[class]': '_computedClass()',
|
|
12
|
-
},
|
|
13
10
|
})
|
|
14
11
|
export class HlmSheetOverlay {
|
|
15
12
|
private readonly _classSettable = injectCustomClassSettable({ optional: true, host: true });
|
|
16
13
|
public readonly userClass = input<ClassValue>('', { alias: 'class' });
|
|
17
14
|
protected readonly _computedClass = computed(() =>
|
|
18
15
|
hlm(
|
|
19
|
-
'
|
|
16
|
+
'spartan-sheet-overlay transition-opacity duration-150 data-ending-style:opacity-0 data-starting-style:opacity-0',
|
|
20
17
|
this.userClass(),
|
|
21
18
|
),
|
|
22
19
|
);
|
|
@@ -5,12 +5,10 @@ import { classes } from '<%- importAlias %>/utils';
|
|
|
5
5
|
@Directive({
|
|
6
6
|
selector: '[hlmSheetTitle]',
|
|
7
7
|
hostDirectives: [BrnSheetTitle],
|
|
8
|
-
host: {
|
|
9
|
-
'data-slot': 'sheet-title',
|
|
10
|
-
},
|
|
8
|
+
host: { 'data-slot': 'sheet-title' },
|
|
11
9
|
})
|
|
12
10
|
export class HlmSheetTitle {
|
|
13
11
|
constructor() {
|
|
14
|
-
classes(() => '
|
|
12
|
+
classes(() => 'spartan-sheet-title');
|
|
15
13
|
}
|
|
16
14
|
}
|
|
@@ -4,8 +4,6 @@ import { BrnSheetTrigger } from '@spartan-ng/brain/sheet';
|
|
|
4
4
|
@Directive({
|
|
5
5
|
selector: 'button[hlmSheetTrigger]',
|
|
6
6
|
hostDirectives: [{ directive: BrnSheetTrigger, inputs: ['id', 'side', 'type'] }],
|
|
7
|
-
host: {
|
|
8
|
-
'data-slot': 'sheet-trigger',
|
|
9
|
-
},
|
|
7
|
+
host: { 'data-slot': 'sheet-trigger' },
|
|
10
8
|
})
|
|
11
9
|
export class HlmSheetTrigger {}
|
|
@@ -10,6 +10,9 @@ import { classes } from '<%- importAlias %>/utils';
|
|
|
10
10
|
})
|
|
11
11
|
export class HlmSidebarContent {
|
|
12
12
|
constructor() {
|
|
13
|
-
classes(
|
|
13
|
+
classes(
|
|
14
|
+
() =>
|
|
15
|
+
'spartan-sidebar-content flex min-h-0 flex-1 flex-col overflow-auto group-data-[collapsible=icon]:overflow-hidden',
|
|
16
|
+
);
|
|
14
17
|
}
|
|
15
18
|
}
|
|
@@ -10,11 +10,9 @@ import { classes } from '<%- importAlias %>/utils';
|
|
|
10
10
|
})
|
|
11
11
|
export class HlmSidebarGroupAction {
|
|
12
12
|
constructor() {
|
|
13
|
-
classes(
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
'group-data-[collapsible=icon]:hidden',
|
|
18
|
-
]);
|
|
13
|
+
classes(
|
|
14
|
+
() =>
|
|
15
|
+
'spartan-sidebar-group-action flex aspect-square items-center justify-center outline-hidden transition-transform group-data-[collapsible=icon]:hidden after:absolute after:-inset-2 md:after:hidden [&>ng-icon]:shrink-0',
|
|
16
|
+
);
|
|
19
17
|
}
|
|
20
18
|
}
|
|
@@ -10,9 +10,6 @@ import { classes } from '<%- importAlias %>/utils';
|
|
|
10
10
|
})
|
|
11
11
|
export class HlmSidebarGroupLabel {
|
|
12
12
|
constructor() {
|
|
13
|
-
classes(() => [
|
|
14
|
-
'text-sidebar-foreground/70 ring-sidebar-ring flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium transition-[margin,opa] duration-200 ease-linear outline-none focus-visible:ring-2 [&>_ng-icon]:size-4 [&>_ng-icon]:shrink-0',
|
|
15
|
-
'group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0',
|
|
16
|
-
]);
|
|
13
|
+
classes(() => 'spartan-sidebar-group-label flex shrink-0 items-center outline-hidden [&>ng-icon]:shrink-0');
|
|
17
14
|
}
|
|
18
15
|
}
|
|
@@ -10,6 +10,6 @@ import { classes } from '<%- importAlias %>/utils';
|
|
|
10
10
|
})
|
|
11
11
|
export class HlmSidebarGroup {
|
|
12
12
|
constructor() {
|
|
13
|
-
classes(() => 'relative flex w-full min-w-0 flex-col
|
|
13
|
+
classes(() => 'spartan-sidebar-group relative flex w-full min-w-0 flex-col');
|
|
14
14
|
}
|
|
15
15
|
}
|
|
@@ -3,15 +3,10 @@ import { classes } from '<%- importAlias %>/utils';
|
|
|
3
3
|
|
|
4
4
|
@Directive({
|
|
5
5
|
selector: 'main[hlmSidebarInset]',
|
|
6
|
-
host: {
|
|
7
|
-
'data-slot': 'sidebar-inset',
|
|
8
|
-
},
|
|
6
|
+
host: { 'data-slot': 'sidebar-inset' },
|
|
9
7
|
})
|
|
10
8
|
export class HlmSidebarInset {
|
|
11
9
|
constructor() {
|
|
12
|
-
classes(() =>
|
|
13
|
-
'bg-background relative flex w-full flex-1 flex-col',
|
|
14
|
-
'md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2',
|
|
15
|
-
]);
|
|
10
|
+
classes(() => 'spartan-sidebar-inset relative flex w-full flex-1 flex-col');
|
|
16
11
|
}
|
|
17
12
|
}
|
|
@@ -14,15 +14,9 @@ export class HlmSidebarMenuAction {
|
|
|
14
14
|
|
|
15
15
|
constructor() {
|
|
16
16
|
classes(() => [
|
|
17
|
-
'
|
|
18
|
-
// Increases the hit area of the button on mobile.
|
|
19
|
-
'after:absolute after:-inset-2 after:md:hidden',
|
|
20
|
-
'peer-data-[size=sm]/menu-button:top-1',
|
|
21
|
-
'peer-data-[size=default]/menu-button:top-1.5',
|
|
22
|
-
'peer-data-[size=lg]/menu-button:top-2.5',
|
|
23
|
-
'group-data-[collapsible=icon]:hidden',
|
|
17
|
+
'spartan-sidebar-menu-action flex items-center justify-center outline-hidden transition-transform group-data-[collapsible=icon]:hidden after:absolute after:-inset-2 md:after:hidden [&>ng-icon]:shrink-0',
|
|
24
18
|
this.showOnHover() &&
|
|
25
|
-
'peer-data-
|
|
19
|
+
'peer-data-active/menu-button:text-sidebar-accent-foreground group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 aria-expanded:opacity-100 md:opacity-0',
|
|
26
20
|
]);
|
|
27
21
|
}
|
|
28
22
|
}
|
|
@@ -10,13 +10,9 @@ import { classes } from '<%- importAlias %>/utils';
|
|
|
10
10
|
})
|
|
11
11
|
export class HlmSidebarMenuBadge {
|
|
12
12
|
constructor() {
|
|
13
|
-
classes(
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
'peer-data-[size=default]/menu-button:top-1.5',
|
|
18
|
-
'peer-data-[size=lg]/menu-button:top-2.5',
|
|
19
|
-
'group-data-[collapsible=icon]:hidden',
|
|
20
|
-
]);
|
|
13
|
+
classes(
|
|
14
|
+
() =>
|
|
15
|
+
'spartan-sidebar-menu-badge flex items-center justify-center tabular-nums select-none group-data-[collapsible=icon]:hidden',
|
|
16
|
+
);
|
|
21
17
|
}
|
|
22
18
|
}
|
|
@@ -12,18 +12,17 @@ import { HlmSidebarService } from './hlm-sidebar.service';
|
|
|
12
12
|
import { injectHlmSidebarConfig } from './hlm-sidebar.token';
|
|
13
13
|
|
|
14
14
|
const sidebarMenuButtonVariants = cva(
|
|
15
|
-
'
|
|
15
|
+
'spartan-sidebar-menu-button peer/menu-button group/menu-button flex w-full items-center overflow-hidden outline-hidden disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&_ng-icon]:shrink-0 [&_ng-icon]:text-[calc(var(--spacing)*4)] [&>span:last-child]:truncate',
|
|
16
16
|
{
|
|
17
17
|
variants: {
|
|
18
18
|
variant: {
|
|
19
|
-
default: '
|
|
20
|
-
outline:
|
|
21
|
-
'bg-background shadow-sidebar-border hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-sidebar-accent',
|
|
19
|
+
default: 'spartan-sidebar-menu-button-variant-default',
|
|
20
|
+
outline: 'spartan-sidebar-menu-button-variant-outline',
|
|
22
21
|
},
|
|
23
22
|
size: {
|
|
24
|
-
default: '
|
|
25
|
-
sm: '
|
|
26
|
-
lg: '
|
|
23
|
+
default: 'spartan-sidebar-menu-button-size-default',
|
|
24
|
+
sm: 'spartan-sidebar-menu-button-size-sm',
|
|
25
|
+
lg: 'spartan-sidebar-menu-button-size-lg',
|
|
27
26
|
},
|
|
28
27
|
},
|
|
29
28
|
defaultVariants: {
|
|
@@ -10,13 +10,16 @@ import { classes } from '<%- importAlias %>/utils';
|
|
|
10
10
|
host: {
|
|
11
11
|
'data-slot': 'sidebar-menu-skeleton',
|
|
12
12
|
'data-sidebar': 'menu-skeleton',
|
|
13
|
-
'[style.--skeleton-width]': '_width',
|
|
14
13
|
},
|
|
15
14
|
template: `
|
|
16
15
|
@if (showIcon()) {
|
|
17
|
-
<hlm-skeleton data-sidebar="menu-skeleton-icon" class="
|
|
16
|
+
<hlm-skeleton data-sidebar="menu-skeleton-icon" class="spartan-sidebar-menu-skeleton-icon" />
|
|
18
17
|
} @else {
|
|
19
|
-
<hlm-skeleton
|
|
18
|
+
<hlm-skeleton
|
|
19
|
+
data-sidebar="menu-skeleton-text"
|
|
20
|
+
class="spartan-sidebar-menu-skeleton-text max-w-(--skeleton-width) flex-1"
|
|
21
|
+
[style.--skeleton-width]="_width"
|
|
22
|
+
/>
|
|
20
23
|
}
|
|
21
24
|
`,
|
|
22
25
|
})
|
|
@@ -25,6 +28,6 @@ export class HlmSidebarMenuSkeleton {
|
|
|
25
28
|
protected readonly _width = `${Math.floor(Math.random() * 40) + 50}%`;
|
|
26
29
|
|
|
27
30
|
constructor() {
|
|
28
|
-
classes(() => '
|
|
31
|
+
classes(() => 'spartan-sidebar-menu-skeleton flex items-center');
|
|
29
32
|
}
|
|
30
33
|
}
|
|
@@ -25,13 +25,12 @@ export class HlmSidebarMenuSubButton {
|
|
|
25
25
|
|
|
26
26
|
public readonly size = input<'sm' | 'md'>('md');
|
|
27
27
|
public readonly isActive = input<boolean, BooleanInput>(false, { transform: booleanAttribute });
|
|
28
|
+
|
|
28
29
|
constructor() {
|
|
29
|
-
classes(
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
'group-data-[collapsible=icon]:hidden',
|
|
34
|
-
]);
|
|
30
|
+
classes(
|
|
31
|
+
() =>
|
|
32
|
+
'spartan-sidebar-menu-sub-button flex min-w-0 -translate-x-px items-center overflow-hidden outline-hidden group-data-[collapsible=icon]:hidden disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>ng-icon]:shrink-0 [&>span:last-child]:truncate',
|
|
33
|
+
);
|
|
35
34
|
}
|
|
36
35
|
|
|
37
36
|
protected onClick(): void {
|
|
@@ -10,9 +10,6 @@ import { classes } from '<%- importAlias %>/utils';
|
|
|
10
10
|
})
|
|
11
11
|
export class HlmSidebarMenuSub {
|
|
12
12
|
constructor() {
|
|
13
|
-
classes(() =>
|
|
14
|
-
'border-sidebar-border mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l px-2.5 py-0.5',
|
|
15
|
-
'group-data-[collapsible=icon]:hidden',
|
|
16
|
-
]);
|
|
13
|
+
classes(() => 'spartan-sidebar-menu-sub flex min-w-0 flex-col');
|
|
17
14
|
}
|
|
18
15
|
}
|
|
@@ -19,8 +19,8 @@ export class HlmSidebarRail {
|
|
|
19
19
|
|
|
20
20
|
constructor() {
|
|
21
21
|
classes(() => [
|
|
22
|
-
'
|
|
23
|
-
'
|
|
22
|
+
'spartan-sidebar-rail absolute inset-y-0 z-20 hidden w-4 transition-all ease-linear group-data-[side=left]:-right-4 group-data-[side=right]:left-0 after:absolute after:inset-y-0 after:start-1/2 after:w-[2px] sm:flex ltr:-translate-x-1/2 rtl:-translate-x-1/2',
|
|
23
|
+
'in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize',
|
|
24
24
|
'[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize',
|
|
25
25
|
'hover:group-data-[collapsible=offcanvas]:bg-sidebar group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full',
|
|
26
26
|
'[[data-side=left][data-collapsible=offcanvas]_&]:-right-2',
|
|
@@ -1,37 +1,30 @@
|
|
|
1
|
-
import { ChangeDetectionStrategy, Component, inject } from '@angular/core';
|
|
2
|
-
import { provideIcons } from '@ng-icons/core';
|
|
1
|
+
import { ChangeDetectionStrategy, Component, inject, input } from '@angular/core';
|
|
2
|
+
import { NgIcon, provideIcons } from '@ng-icons/core';
|
|
3
3
|
import { lucidePanelLeft } from '@ng-icons/lucide';
|
|
4
4
|
import { HlmButton, provideBrnButtonConfig } from '<%- importAlias %>/button';
|
|
5
|
-
import { HlmIconImports } from '<%- importAlias %>/icon';
|
|
6
5
|
import { HlmSidebarService } from './hlm-sidebar.service';
|
|
7
6
|
|
|
8
7
|
@Component({
|
|
9
8
|
// eslint-disable-next-line @angular-eslint/component-selector
|
|
10
9
|
selector: 'button[hlmSidebarTrigger]',
|
|
11
|
-
imports: [
|
|
12
|
-
providers: [provideIcons({ lucidePanelLeft }), provideBrnButtonConfig({ variant: 'ghost', size: 'icon' })],
|
|
10
|
+
imports: [NgIcon],
|
|
11
|
+
providers: [provideIcons({ lucidePanelLeft }), provideBrnButtonConfig({ variant: 'ghost', size: 'icon-sm' })],
|
|
13
12
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
14
|
-
hostDirectives: [
|
|
15
|
-
{
|
|
16
|
-
directive: HlmButton,
|
|
17
|
-
},
|
|
18
|
-
],
|
|
13
|
+
hostDirectives: [{ directive: HlmButton, inputs: ['variant', 'size'] }],
|
|
19
14
|
host: {
|
|
20
15
|
'data-slot': 'sidebar-trigger',
|
|
21
16
|
'data-sidebar': 'trigger',
|
|
22
17
|
'(click)': '_onClick()',
|
|
23
18
|
},
|
|
24
19
|
template: `
|
|
25
|
-
<ng-icon
|
|
20
|
+
<ng-icon name="lucidePanelLeft" />
|
|
21
|
+
<span class="sr-only">{{ srOnlyText() }}</span>
|
|
26
22
|
`,
|
|
27
23
|
})
|
|
28
24
|
export class HlmSidebarTrigger {
|
|
29
|
-
private readonly _hlmBtn = inject(HlmButton);
|
|
30
25
|
private readonly _sidebarService = inject(HlmSidebarService);
|
|
31
26
|
|
|
32
|
-
|
|
33
|
-
this._hlmBtn.setClass('size-7');
|
|
34
|
-
}
|
|
27
|
+
public readonly srOnlyText = input('Toggle Sidebar');
|
|
35
28
|
|
|
36
29
|
protected _onClick(): void {
|
|
37
30
|
this._sidebarService.toggleSidebar();
|
|
@@ -17,6 +17,6 @@ export class HlmSidebarWrapper {
|
|
|
17
17
|
public readonly sidebarWidthIcon = input<string>(this._config.sidebarWidthIcon);
|
|
18
18
|
|
|
19
19
|
constructor() {
|
|
20
|
-
classes(() => 'group/sidebar-wrapper has-
|
|
20
|
+
classes(() => 'group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full');
|
|
21
21
|
}
|
|
22
22
|
}
|
|
@@ -35,7 +35,7 @@ import { injectHlmSidebarConfig } from './hlm-sidebar.token';
|
|
|
35
35
|
data-slot="sidebar"
|
|
36
36
|
data-sidebar="sidebar"
|
|
37
37
|
data-mobile="true"
|
|
38
|
-
class="bg-sidebar text-sidebar-foreground h-svh w-
|
|
38
|
+
class="bg-sidebar text-sidebar-foreground h-svh w-(--sidebar-width) p-0 [&>button]:hidden"
|
|
39
39
|
[style.--sidebar-width]="sidebarWidthMobile()"
|
|
40
40
|
>
|
|
41
41
|
<div class="flex h-full w-full flex-col">
|
|
@@ -46,12 +46,8 @@ import { injectHlmSidebarConfig } from './hlm-sidebar.token';
|
|
|
46
46
|
} @else {
|
|
47
47
|
<!-- Sidebar gap on desktop -->
|
|
48
48
|
<div data-slot="sidebar-gap" [class]="_sidebarGapComputedClass()"></div>
|
|
49
|
-
<div data-slot="sidebar-container" [class]="_sidebarContainerComputedClass()">
|
|
50
|
-
<div
|
|
51
|
-
data-sidebar="sidebar"
|
|
52
|
-
data-slot="sidebar-inner"
|
|
53
|
-
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"
|
|
54
|
-
>
|
|
49
|
+
<div data-slot="sidebar-container" [attr.data-side]="_dataSide()" [class]="_sidebarContainerComputedClass()">
|
|
50
|
+
<div data-sidebar="sidebar" data-slot="sidebar-inner" class="spartan-sidebar-inner flex size-full flex-col">
|
|
55
51
|
<ng-container *ngTemplateOutlet="contentContainer" />
|
|
56
52
|
</div>
|
|
57
53
|
</div>
|
|
@@ -69,25 +65,22 @@ export class HlmSidebar {
|
|
|
69
65
|
|
|
70
66
|
protected readonly _sidebarGapComputedClass = computed(() =>
|
|
71
67
|
hlm(
|
|
72
|
-
'relative w-
|
|
68
|
+
'spartan-sidebar-gap relative w-(--sidebar-width) bg-transparent',
|
|
73
69
|
'group-data-[collapsible=offcanvas]:w-0',
|
|
74
70
|
'group-data-[side=right]:rotate-180',
|
|
75
71
|
this.variant() === 'floating' || this.variant() === 'inset'
|
|
76
|
-
? 'group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)
|
|
77
|
-
: 'group-data-[collapsible=icon]:w-
|
|
72
|
+
? 'group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]'
|
|
73
|
+
: 'group-data-[collapsible=icon]:w-(--sidebar-width-icon)',
|
|
78
74
|
),
|
|
79
75
|
);
|
|
80
76
|
|
|
81
77
|
public readonly sidebarContainerClass = input<ClassValue>('');
|
|
82
78
|
protected readonly _sidebarContainerComputedClass = computed(() =>
|
|
83
79
|
hlm(
|
|
84
|
-
'fixed inset-y-0 z-10 hidden h-svh w-
|
|
85
|
-
this.side() === 'left'
|
|
86
|
-
? 'left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]'
|
|
87
|
-
: 'right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]',
|
|
80
|
+
'fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear data-[side=left]:left-0 data-[side=left]:group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)] data-[side=right]:right-0 data-[side=right]:group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)] md:flex',
|
|
88
81
|
this.variant() === 'floating' || this.variant() === 'inset'
|
|
89
|
-
? 'p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)
|
|
90
|
-
: 'group-data-[collapsible=icon]:w-
|
|
82
|
+
? 'p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]'
|
|
83
|
+
: 'group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l',
|
|
91
84
|
this.sidebarContainerClass(),
|
|
92
85
|
),
|
|
93
86
|
);
|
|
@@ -127,11 +120,11 @@ export class HlmSidebar {
|
|
|
127
120
|
|
|
128
121
|
classes(() => {
|
|
129
122
|
if (this.collapsible() === 'none') {
|
|
130
|
-
return hlm('bg-sidebar text-sidebar-foreground flex h-svh w-
|
|
123
|
+
return hlm('bg-sidebar text-sidebar-foreground flex h-svh w-(--sidebar-width) flex-col');
|
|
131
124
|
} else if (this._sidebarService.isMobile()) {
|
|
132
125
|
return '';
|
|
133
126
|
} else {
|
|
134
|
-
return hlm('text-sidebar-foreground
|
|
127
|
+
return hlm('group peer text-sidebar-foreground hidden md:block');
|
|
135
128
|
}
|
|
136
129
|
});
|
|
137
130
|
}
|
|
@@ -6,8 +6,9 @@ import { cva } from 'class-variance-authority';
|
|
|
6
6
|
export const DEFAULT_TOOLTIP_SVG_CLASS =
|
|
7
7
|
'bg-foreground fill-foreground z-50 block size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-[2px]';
|
|
8
8
|
|
|
9
|
-
export const DEFAULT_TOOLTIP_CONTENT_CLASSES =
|
|
10
|
-
'spartan-tooltip-content bg-foreground text-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-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 w-fit origin-(--radix-tooltip-content-transform-origin) text-balance'
|
|
9
|
+
export const DEFAULT_TOOLTIP_CONTENT_CLASSES = hlm(
|
|
10
|
+
'spartan-tooltip-content bg-foreground text-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-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 w-fit origin-(--radix-tooltip-content-transform-origin) text-balance',
|
|
11
|
+
);
|
|
11
12
|
|
|
12
13
|
export const tooltipPositionVariants = cva('absolute', {
|
|
13
14
|
variants: {
|