@egose/shadcn-theme-ng-tw 0.0.28 → 0.2.0
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/README.md +130 -13
- package/accordion/README.md +376 -34
- package/accordion/fesm2022/accordion.mjs +20 -20
- package/alert/README.md +343 -34
- package/alert/fesm2022/alert.mjs +18 -18
- package/alert-dialog/README.md +471 -5
- package/alert-dialog/fesm2022/alert-dialog.mjs +48 -48
- package/alert-dialog/types/alert-dialog.d.ts +1 -1
- package/aspect-ratio/README.md +272 -5
- package/aspect-ratio/fesm2022/aspect-ratio.mjs +9 -9
- package/autocomplete/README.md +473 -34
- package/autocomplete/fesm2022/autocomplete.mjs +54 -54
- package/autocomplete/types/autocomplete.d.ts +1 -1
- package/avatar/README.md +357 -5
- package/avatar/fesm2022/avatar.mjs +32 -32
- package/badge/README.md +289 -34
- package/badge/fesm2022/badge.mjs +4 -4
- package/basic-alert/README.md +324 -34
- package/basic-alert/fesm2022/basic-alert.mjs +4 -4
- package/basic-alert/types/basic-alert.d.ts +1 -1
- package/breadcrumb/README.md +406 -5
- package/breadcrumb/fesm2022/breadcrumb.mjs +34 -34
- package/button/README.md +453 -34
- package/button/fesm2022/button.mjs +96 -118
- package/button/types/button.d.ts +7 -10
- package/button-group/README.md +318 -5
- package/button-group/fesm2022/button-group.mjs +20 -20
- package/calendar/README.md +328 -34
- package/calendar/fesm2022/calendar.mjs +154 -154
- package/card/README.md +331 -5
- package/card/fesm2022/card.mjs +33 -33
- package/carousel/README.md +333 -5
- package/carousel/fesm2022/carousel.mjs +47 -44
- package/carousel/types/carousel.d.ts +1 -1
- package/checkbox/README.md +291 -34
- package/checkbox/fesm2022/checkbox.mjs +22 -20
- package/checkbox/types/checkbox.d.ts +5 -4
- package/collapsible/README.md +332 -5
- package/collapsible/fesm2022/collapsible.mjs +15 -15
- package/combobox/README.md +507 -5
- package/combobox/fesm2022/combobox.mjs +95 -92
- package/combobox/types/combobox.d.ts +1 -1
- package/command/README.md +435 -5
- package/command/fesm2022/command.mjs +56 -56
- package/confirmation-dialog/README.md +272 -34
- package/confirmation-dialog/fesm2022/confirmation-dialog.mjs +13 -12
- package/confirmation-dialog/types/confirmation-dialog.d.ts +9 -5
- package/context-menu/README.md +366 -5
- package/context-menu/fesm2022/context-menu.mjs +9 -9
- package/date-picker/README.md +436 -34
- package/date-picker/fesm2022/date-picker.mjs +79 -68
- package/date-picker/types/date-picker.d.ts +8 -4
- package/dialog/README.md +419 -34
- package/dialog/fesm2022/dialog.mjs +48 -48
- package/drawer/README.md +395 -5
- package/drawer/fesm2022/drawer.mjs +45 -45
- package/dropdown-menu/README.md +417 -5
- package/dropdown-menu/fesm2022/dropdown-menu.mjs +85 -73
- package/dropdown-menu/types/dropdown-menu.d.ts +4 -0
- package/empty/README.md +329 -5
- package/empty/fesm2022/empty.mjs +31 -31
- package/field/README.md +385 -5
- package/field/fesm2022/field.mjs +59 -59
- package/field/types/field.d.ts +1 -1
- package/form-checkbox/README.md +283 -34
- package/form-checkbox/fesm2022/form-checkbox.mjs +37 -19
- package/form-checkbox/types/form-checkbox.d.ts +7 -1
- package/form-date-picker/README.md +293 -34
- package/form-date-picker/fesm2022/form-date-picker.mjs +59 -24
- package/form-date-picker/types/form-date-picker.d.ts +7 -1
- package/form-field/README.md +327 -34
- package/form-field/fesm2022/form-field.mjs +30 -16
- package/form-field/types/form-field.d.ts +28 -20
- package/form-field-simple/README.md +311 -34
- package/form-field-simple/fesm2022/form-field-simple.mjs +4 -4
- package/form-searchable-multiselect/README.md +332 -34
- package/form-searchable-multiselect/fesm2022/form-searchable-multiselect.mjs +41 -21
- package/form-searchable-multiselect/types/form-searchable-multiselect.d.ts +8 -2
- package/form-select/README.md +321 -34
- package/form-select/fesm2022/form-select.mjs +62 -29
- package/form-select/types/form-select.d.ts +7 -1
- package/form-text-input/README.md +342 -34
- package/form-text-input/fesm2022/form-text-input.mjs +43 -55
- package/form-text-input/types/form-text-input.d.ts +9 -12
- package/form-textarea/README.md +318 -34
- package/form-textarea/fesm2022/form-textarea.mjs +42 -23
- package/form-textarea/types/form-textarea.d.ts +8 -1
- package/hover-card/README.md +256 -5
- package/hover-card/fesm2022/hover-card.mjs +19 -19
- package/icon/README.md +210 -34
- package/icon/fesm2022/icon.mjs +8 -8
- package/input/README.md +240 -34
- package/input/fesm2022/input.mjs +17 -12
- package/input/types/input.d.ts +2 -1
- package/input-group/README.md +335 -5
- package/input-group/fesm2022/input-group.mjs +37 -37
- package/input-group/types/input-group.d.ts +3 -3
- package/input-otp/README.md +375 -5
- package/input-otp/fesm2022/input-otp.mjs +27 -27
- package/item/README.md +385 -5
- package/item/fesm2022/item.mjs +54 -54
- package/kbd/README.md +291 -5
- package/kbd/fesm2022/kbd.mjs +13 -13
- package/label/README.md +243 -34
- package/label/fesm2022/label.mjs +9 -9
- package/label/types/label.d.ts +1 -1
- package/layout-simple/README.md +174 -44
- package/layout-simple/fesm2022/layout-simple.mjs +917 -398
- package/layout-simple/types/layout-simple.d.ts +180 -129
- package/menu/README.md +418 -0
- package/menu/fesm2022/menu.mjs +461 -0
- package/menu/package.json +24 -0
- package/menu/types/menu.d.ts +137 -0
- package/menubar/README.md +343 -5
- package/menubar/fesm2022/menubar.mjs +13 -13
- package/native-select/README.md +323 -5
- package/native-select/fesm2022/native-select.mjs +19 -19
- package/navigation-menu/README.md +369 -5
- package/navigation-menu/fesm2022/navigation-menu.mjs +37 -37
- package/package.json +183 -154
- package/pagination/README.md +388 -5
- package/pagination/fesm2022/pagination.mjs +63 -63
- package/popover/README.md +302 -34
- package/popover/fesm2022/popover.mjs +30 -30
- package/progress/README.md +311 -5
- package/progress/fesm2022/progress.mjs +13 -13
- package/radio-group/README.md +335 -34
- package/radio-group/fesm2022/radio-group.mjs +26 -19
- package/resizable/README.md +269 -5
- package/resizable/fesm2022/resizable.mjs +19 -19
- package/scroll-area/README.md +233 -5
- package/scroll-area/fesm2022/scroll-area.mjs +9 -9
- package/searchable-multiselect/README.md +294 -34
- package/searchable-multiselect/fesm2022/searchable-multiselect.mjs +63 -16
- package/searchable-multiselect/types/searchable-multiselect.d.ts +8 -2
- package/select/README.md +408 -34
- package/select/fesm2022/select.mjs +80 -72
- package/select/types/select.d.ts +3 -1
- package/separator/README.md +193 -34
- package/separator/fesm2022/separator.mjs +9 -9
- package/separator/types/separator.d.ts +1 -1
- package/sheet/README.md +282 -34
- package/sheet/fesm2022/sheet.mjs +30 -30
- package/sidebar/README.md +457 -5
- package/sidebar/fesm2022/sidebar.mjs +136 -134
- package/sidebar/types/sidebar.d.ts +3 -3
- package/skeleton/README.md +217 -5
- package/skeleton/fesm2022/skeleton.mjs +9 -9
- package/slider/README.md +273 -5
- package/slider/fesm2022/slider.mjs +29 -25
- package/sonner/README.md +317 -34
- package/sonner/fesm2022/sonner.mjs +9 -9
- package/spinner/README.md +255 -34
- package/spinner/fesm2022/spinner.mjs +8 -8
- package/switch/README.md +281 -34
- package/switch/fesm2022/switch.mjs +12 -14
- package/table/README.md +423 -5
- package/table/fesm2022/table.mjs +41 -41
- package/tabs/README.md +382 -34
- package/tabs/fesm2022/tabs.mjs +48 -38
- package/textarea/README.md +282 -5
- package/textarea/fesm2022/textarea.mjs +9 -9
- package/toggle/README.md +270 -5
- package/toggle/fesm2022/toggle.mjs +14 -14
- package/toggle-group/README.md +340 -5
- package/toggle-group/fesm2022/toggle-group.mjs +13 -13
- package/toggle-group/types/toggle-group.d.ts +13 -7
- package/tooltip/README.md +240 -34
- package/tooltip/fesm2022/tooltip.mjs +14 -14
- package/typography/README.md +271 -5
- package/typography/fesm2022/typography.mjs +53 -53
- package/typography/types/typography.d.ts +12 -12
- package/utils/README.md +274 -34
- package/utils/fesm2022/utils.mjs +68 -44
- package/accordion/fesm2022/accordion.mjs.map +0 -1
- package/alert/fesm2022/alert.mjs.map +0 -1
- package/alert-dialog/fesm2022/alert-dialog.mjs.map +0 -1
- package/aspect-ratio/fesm2022/aspect-ratio.mjs.map +0 -1
- package/autocomplete/fesm2022/autocomplete.mjs.map +0 -1
- package/avatar/fesm2022/avatar.mjs.map +0 -1
- package/badge/fesm2022/badge.mjs.map +0 -1
- package/basic-alert/fesm2022/basic-alert.mjs.map +0 -1
- package/breadcrumb/fesm2022/breadcrumb.mjs.map +0 -1
- package/button/fesm2022/button.mjs.map +0 -1
- package/button-group/fesm2022/button-group.mjs.map +0 -1
- package/calendar/fesm2022/calendar.mjs.map +0 -1
- package/card/fesm2022/card.mjs.map +0 -1
- package/carousel/fesm2022/carousel.mjs.map +0 -1
- package/checkbox/fesm2022/checkbox.mjs.map +0 -1
- package/collapsible/fesm2022/collapsible.mjs.map +0 -1
- package/combobox/fesm2022/combobox.mjs.map +0 -1
- package/command/fesm2022/command.mjs.map +0 -1
- package/confirmation-dialog/fesm2022/confirmation-dialog.mjs.map +0 -1
- package/context-menu/fesm2022/context-menu.mjs.map +0 -1
- package/date-picker/fesm2022/date-picker.mjs.map +0 -1
- package/dialog/fesm2022/dialog.mjs.map +0 -1
- package/drawer/fesm2022/drawer.mjs.map +0 -1
- package/dropdown-menu/fesm2022/dropdown-menu.mjs.map +0 -1
- package/empty/fesm2022/empty.mjs.map +0 -1
- package/field/fesm2022/field.mjs.map +0 -1
- package/form-checkbox/fesm2022/form-checkbox.mjs.map +0 -1
- package/form-date-picker/fesm2022/form-date-picker.mjs.map +0 -1
- package/form-field/fesm2022/form-field.mjs.map +0 -1
- package/form-field-simple/fesm2022/form-field-simple.mjs.map +0 -1
- package/form-searchable-multiselect/fesm2022/form-searchable-multiselect.mjs.map +0 -1
- package/form-select/fesm2022/form-select.mjs.map +0 -1
- package/form-text-input/fesm2022/form-text-input.mjs.map +0 -1
- package/form-textarea/fesm2022/form-textarea.mjs.map +0 -1
- package/hover-card/fesm2022/hover-card.mjs.map +0 -1
- package/icon/fesm2022/icon.mjs.map +0 -1
- package/input/fesm2022/input.mjs.map +0 -1
- package/input-group/fesm2022/input-group.mjs.map +0 -1
- package/input-otp/fesm2022/input-otp.mjs.map +0 -1
- package/item/fesm2022/item.mjs.map +0 -1
- package/kbd/fesm2022/kbd.mjs.map +0 -1
- package/label/fesm2022/label.mjs.map +0 -1
- package/layout-simple/fesm2022/layout-simple.mjs.map +0 -1
- package/menubar/fesm2022/menubar.mjs.map +0 -1
- package/native-select/fesm2022/native-select.mjs.map +0 -1
- package/navigation-menu/fesm2022/navigation-menu.mjs.map +0 -1
- package/pagination/fesm2022/pagination.mjs.map +0 -1
- package/popover/fesm2022/popover.mjs.map +0 -1
- package/progress/fesm2022/progress.mjs.map +0 -1
- package/radio-group/fesm2022/radio-group.mjs.map +0 -1
- package/resizable/fesm2022/resizable.mjs.map +0 -1
- package/scroll-area/fesm2022/scroll-area.mjs.map +0 -1
- package/searchable-multiselect/fesm2022/searchable-multiselect.mjs.map +0 -1
- package/select/fesm2022/select.mjs.map +0 -1
- package/separator/fesm2022/separator.mjs.map +0 -1
- package/sheet/fesm2022/sheet.mjs.map +0 -1
- package/sidebar/fesm2022/sidebar.mjs.map +0 -1
- package/skeleton/fesm2022/skeleton.mjs.map +0 -1
- package/slider/fesm2022/slider.mjs.map +0 -1
- package/sonner/fesm2022/sonner.mjs.map +0 -1
- package/spinner/fesm2022/spinner.mjs.map +0 -1
- package/switch/fesm2022/switch.mjs.map +0 -1
- package/table/fesm2022/table.mjs.map +0 -1
- package/tabs/fesm2022/tabs.mjs.map +0 -1
- package/textarea/fesm2022/textarea.mjs.map +0 -1
- package/toggle/fesm2022/toggle.mjs.map +0 -1
- package/toggle-group/fesm2022/toggle-group.mjs.map +0 -1
- package/tooltip/fesm2022/tooltip.mjs.map +0 -1
- package/typography/fesm2022/typography.mjs.map +0 -1
- package/utils/fesm2022/utils.mjs.map +0 -1
package/sheet/fesm2022/sheet.mjs
CHANGED
|
@@ -21,10 +21,10 @@ class HlmSheetOverlay {
|
|
|
21
21
|
untracked(() => this._classSettable?.setClassToCustomElement(classValue));
|
|
22
22
|
});
|
|
23
23
|
}
|
|
24
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.
|
|
25
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.
|
|
24
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmSheetOverlay, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
25
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.3", type: HlmSheetOverlay, isStandalone: true, selector: "[hlmSheetOverlay],brn-sheet-overlay[hlm]", inputs: { userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "_computedClass()" } }, ngImport: i0 });
|
|
26
26
|
}
|
|
27
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.
|
|
27
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmSheetOverlay, decorators: [{
|
|
28
28
|
type: Directive,
|
|
29
29
|
args: [{
|
|
30
30
|
selector: '[hlmSheetOverlay],brn-sheet-overlay[hlm]',
|
|
@@ -35,8 +35,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImpor
|
|
|
35
35
|
}], ctorParameters: () => [], propDecorators: { userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
36
36
|
|
|
37
37
|
class HlmSheet extends BrnSheet {
|
|
38
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.
|
|
39
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.
|
|
38
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmSheet, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
39
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.1.3", type: HlmSheet, isStandalone: true, selector: "hlm-sheet", providers: [
|
|
40
40
|
{
|
|
41
41
|
provide: BrnDialog,
|
|
42
42
|
useExisting: forwardRef(() => BrnSheet),
|
|
@@ -53,7 +53,7 @@ class HlmSheet extends BrnSheet {
|
|
|
53
53
|
<ng-content />
|
|
54
54
|
`, isInline: true, dependencies: [{ kind: "directive", type: BrnSheetOverlay, selector: "[brnSheetOverlay],brn-sheet-overlay" }, { kind: "directive", type: HlmSheetOverlay, selector: "[hlmSheetOverlay],brn-sheet-overlay[hlm]", inputs: ["class"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
55
55
|
}
|
|
56
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.
|
|
56
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmSheet, decorators: [{
|
|
57
57
|
type: Component,
|
|
58
58
|
args: [{
|
|
59
59
|
selector: 'hlm-sheet',
|
|
@@ -85,10 +85,10 @@ class HlmSheetClose {
|
|
|
85
85
|
userClass = input('', { ...(ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {}), alias: 'class' });
|
|
86
86
|
_computedClass = computed(() => hlm('tw:ring-offset-background tw:focus:ring-ring tw:data-[state=open]:bg-secondary tw:rounded-xs tw:focus:outline-hidden tw:absolute tw:right-4 tw:top-4 tw:opacity-70 tw:transition-opacity tw:hover:opacity-100 tw:focus:ring-2 tw:focus:ring-offset-2 tw:disabled:pointer-events-none', this.userClass()), /* @ts-ignore */
|
|
87
87
|
...(ngDevMode ? [{ debugName: "_computedClass" }] : /* istanbul ignore next */ []));
|
|
88
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.
|
|
89
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.
|
|
88
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmSheetClose, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
89
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.3", type: HlmSheetClose, isStandalone: true, selector: "[hlmSheetClose],[brnSheetClose][hlm]", inputs: { userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "_computedClass()" } }, ngImport: i0 });
|
|
90
90
|
}
|
|
91
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.
|
|
91
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmSheetClose, decorators: [{
|
|
92
92
|
type: Directive,
|
|
93
93
|
args: [{
|
|
94
94
|
selector: '[hlmSheetClose],[brnSheetClose][hlm]',
|
|
@@ -108,7 +108,7 @@ const sheetVariants = cva('tw:bg-background tw:data-[state=open]:animate-in tw:d
|
|
|
108
108
|
},
|
|
109
109
|
},
|
|
110
110
|
defaultVariants: {
|
|
111
|
-
side:
|
|
111
|
+
side: "tw:right",
|
|
112
112
|
},
|
|
113
113
|
});
|
|
114
114
|
class HlmSheetContent {
|
|
@@ -125,8 +125,8 @@ class HlmSheetContent {
|
|
|
125
125
|
userClass = input('', { ...(ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {}), alias: 'class' });
|
|
126
126
|
_computedClass = computed(() => hlm(sheetVariants({ side: this._sideProvider.side() }), this.userClass()), /* @ts-ignore */
|
|
127
127
|
...(ngDevMode ? [{ debugName: "_computedClass" }] : /* istanbul ignore next */ []));
|
|
128
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.
|
|
129
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.
|
|
128
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmSheetContent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
129
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.1.3", type: HlmSheetContent, isStandalone: true, selector: "hlm-sheet-content", inputs: { userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "_computedClass()", "attr.data-state": "state()" } }, providers: [provideIcons({ lucideX })], ngImport: i0, template: `
|
|
130
130
|
<ng-content />
|
|
131
131
|
<button brnSheetClose hlm class="tw:cursor-pointer">
|
|
132
132
|
<span class="tw:sr-only">Close</span>
|
|
@@ -134,7 +134,7 @@ class HlmSheetContent {
|
|
|
134
134
|
</button>
|
|
135
135
|
`, isInline: true, dependencies: [{ kind: "directive", type: HlmSheetClose, selector: "[hlmSheetClose],[brnSheetClose][hlm]", inputs: ["class"] }, { kind: "directive", type: BrnSheetClose, selector: "button[brnSheetClose]" }, { kind: "component", type: NgIcon, selector: "ng-icon", inputs: ["name", "svg", "size", "strokeWidth", "color"] }, { kind: "directive", type: HlmIcon, selector: "ng-icon[hlm]", inputs: ["size"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
136
136
|
}
|
|
137
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.
|
|
137
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmSheetContent, decorators: [{
|
|
138
138
|
type: Component,
|
|
139
139
|
args: [{
|
|
140
140
|
selector: 'hlm-sheet-content',
|
|
@@ -159,10 +159,10 @@ class HlmSheetDescription {
|
|
|
159
159
|
userClass = input('', { ...(ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {}), alias: 'class' });
|
|
160
160
|
_computedClass = computed(() => hlm('tw:text-muted-foreground tw:text-sm', this.userClass()), /* @ts-ignore */
|
|
161
161
|
...(ngDevMode ? [{ debugName: "_computedClass" }] : /* istanbul ignore next */ []));
|
|
162
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.
|
|
163
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.
|
|
162
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmSheetDescription, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
163
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.3", type: HlmSheetDescription, isStandalone: true, selector: "[hlmSheetDescription]", inputs: { userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "_computedClass()" } }, hostDirectives: [{ directive: i1.BrnSheetDescription }], ngImport: i0 });
|
|
164
164
|
}
|
|
165
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.
|
|
165
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmSheetDescription, decorators: [{
|
|
166
166
|
type: Directive,
|
|
167
167
|
args: [{
|
|
168
168
|
selector: '[hlmSheetDescription]',
|
|
@@ -177,10 +177,10 @@ class HlmSheetFooter {
|
|
|
177
177
|
userClass = input('', { ...(ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {}), alias: 'class' });
|
|
178
178
|
_computedClass = computed(() => hlm('tw:mt-auto tw:flex tw:flex-col tw:gap-2 tw:p-4', this.userClass()), /* @ts-ignore */
|
|
179
179
|
...(ngDevMode ? [{ debugName: "_computedClass" }] : /* istanbul ignore next */ []));
|
|
180
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.
|
|
181
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.
|
|
180
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmSheetFooter, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
181
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.1.3", type: HlmSheetFooter, isStandalone: true, selector: "hlm-sheet-footer", inputs: { userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "_computedClass()" } }, ngImport: i0, template: ` <ng-content /> `, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
182
182
|
}
|
|
183
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.
|
|
183
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmSheetFooter, decorators: [{
|
|
184
184
|
type: Component,
|
|
185
185
|
args: [{
|
|
186
186
|
selector: 'hlm-sheet-footer',
|
|
@@ -196,10 +196,10 @@ class HlmSheetHeader {
|
|
|
196
196
|
userClass = input('', { ...(ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {}), alias: 'class' });
|
|
197
197
|
_computedClass = computed(() => hlm('tw:flex tw:flex-col tw:gap-1.5 tw:p-4', this.userClass()), /* @ts-ignore */
|
|
198
198
|
...(ngDevMode ? [{ debugName: "_computedClass" }] : /* istanbul ignore next */ []));
|
|
199
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.
|
|
200
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.
|
|
199
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmSheetHeader, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
200
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.1.3", type: HlmSheetHeader, isStandalone: true, selector: "hlm-sheet-header", inputs: { userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "_computedClass()" } }, ngImport: i0, template: ` <ng-content /> `, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
201
201
|
}
|
|
202
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.
|
|
202
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmSheetHeader, decorators: [{
|
|
203
203
|
type: Component,
|
|
204
204
|
args: [{
|
|
205
205
|
selector: 'hlm-sheet-header',
|
|
@@ -215,10 +215,10 @@ class HlmSheetTitle {
|
|
|
215
215
|
userClass = input('', { ...(ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {}), alias: 'class' });
|
|
216
216
|
_computedClass = computed(() => hlm('tw:text-foreground tw:font-semibold', this.userClass()), /* @ts-ignore */
|
|
217
217
|
...(ngDevMode ? [{ debugName: "_computedClass" }] : /* istanbul ignore next */ []));
|
|
218
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.
|
|
219
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.
|
|
218
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmSheetTitle, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
219
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.3", type: HlmSheetTitle, isStandalone: true, selector: "[hlmSheetTitle]", inputs: { userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "_computedClass()" } }, hostDirectives: [{ directive: i1.BrnSheetTitle }], ngImport: i0 });
|
|
220
220
|
}
|
|
221
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.
|
|
221
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmSheetTitle, decorators: [{
|
|
222
222
|
type: Directive,
|
|
223
223
|
args: [{
|
|
224
224
|
selector: '[hlmSheetTitle]',
|
|
@@ -243,8 +243,8 @@ const HlmSheetImports = [
|
|
|
243
243
|
HlmSheetTitle,
|
|
244
244
|
];
|
|
245
245
|
class HlmSheetModule {
|
|
246
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.
|
|
247
|
-
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "22.
|
|
246
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmSheetModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
247
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "22.1.3", ngImport: i0, type: HlmSheetModule, imports: [HlmSheet,
|
|
248
248
|
HlmSheetClose,
|
|
249
249
|
HlmSheetContent,
|
|
250
250
|
HlmSheetDescription,
|
|
@@ -259,9 +259,9 @@ class HlmSheetModule {
|
|
|
259
259
|
HlmSheetHeader,
|
|
260
260
|
HlmSheetOverlay,
|
|
261
261
|
HlmSheetTitle] });
|
|
262
|
-
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "22.
|
|
262
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmSheetModule, imports: [HlmSheetContent] });
|
|
263
263
|
}
|
|
264
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.
|
|
264
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmSheetModule, decorators: [{
|
|
265
265
|
type: NgModule,
|
|
266
266
|
args: [{
|
|
267
267
|
imports: [...HlmSheetImports],
|
|
@@ -274,4 +274,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImpor
|
|
|
274
274
|
*/
|
|
275
275
|
|
|
276
276
|
export { HlmSheet, HlmSheetClose, HlmSheetContent, HlmSheetDescription, HlmSheetFooter, HlmSheetHeader, HlmSheetImports, HlmSheetModule, HlmSheetOverlay, HlmSheetTitle, sheetVariants };
|
|
277
|
-
|
|
277
|
+
|
package/sidebar/README.md
CHANGED
|
@@ -1,11 +1,463 @@
|
|
|
1
|
-
# Sidebar
|
|
1
|
+
# Sidebar (`@egose/shadcn-theme-ng/sidebar`)
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A shadcn/ui-style **Sidebar** application shell — collapsible app navigation with header/content/footer regions, grouped menus, sub-menus, badges, search input, trigger, and a hover rail. This is the Angular equivalent of shadcn/ui `Sidebar` (`SidebarProvider`, `SidebarTrigger`, `SidebarMenu`, …).
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Unlike the shadcn React version there is no `*Provider` component here: global state lives in the root-provided **`HlmSidebarService`** (open/collapsed, mobile detection, variant, cookie persistence), configured via **`provideHlmSidebarConfig`**. On desktop `HlmSidebar` renders a persistent gap + fixed container; on mobile it renders through `hlm-sheet`. Menu buttons show icon tooltips (via `BrnTooltip`) when collapsed to icon mode.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
> **Ships as:** `@egose/shadcn-theme-ng/sidebar` and `@egose/shadcn-theme-ng-tw/sidebar` (the `tw:`-prefixed Tailwind variant — same API, class strings prefixed with `tw:`).
|
|
8
|
+
> See the [package README](../../README.md) for installation, peer dependencies, and Tailwind setup. Do not publish this project directory independently.
|
|
9
|
+
|
|
10
|
+
## Installation
|
|
8
11
|
|
|
9
12
|
```bash
|
|
10
|
-
|
|
13
|
+
# Plain Tailwind (no prefix)
|
|
14
|
+
npm install @egose/shadcn-theme-ng
|
|
15
|
+
|
|
16
|
+
# Or the tw:-prefixed variant
|
|
17
|
+
npm install @egose/shadcn-theme-ng-tw
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
```ts
|
|
21
|
+
import { HlmSidebarImports } from '@egose/shadcn-theme-ng/sidebar';
|
|
22
|
+
// tw variant:
|
|
23
|
+
// import { HlmSidebarImports } from '@egose/shadcn-theme-ng-tw/sidebar';
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Peer dependencies (see [package README](../../README.md) for versions): `@angular/core`, `@angular/common`, `@spartan-ng/brain`. Icons use `@ng-icons` (`lucidePanelLeft` in the trigger), installed transitively; `HlmSidebarMenuSkeleton` depends on the `skeleton` subpath and `HlmSidebarSeparator` on the `separator` subpath.
|
|
27
|
+
|
|
28
|
+
## Imports
|
|
29
|
+
|
|
30
|
+
Real exported symbols (from `src/public-api.ts`):
|
|
31
|
+
|
|
32
|
+
| Symbol | Kind | Selector |
|
|
33
|
+
| -------------------------------------------------------------------------- | ---------------------------------- | ------------------------------------------------------------- |
|
|
34
|
+
| `HlmSidebarWrapper` | Directive | `[hlmSidebarWrapper],hlm-sidebar-wrapper` |
|
|
35
|
+
| `HlmSidebar` | Component | `hlm-sidebar` |
|
|
36
|
+
| `HlmSidebarHeader` | Directive | `[hlmSidebarHeader],hlm-sidebar-header` |
|
|
37
|
+
| `HlmSidebarContent` | Directive | `[hlmSidebarContent],hlm-sidebar-content` |
|
|
38
|
+
| `HlmSidebarFooter` | Directive | `[hlmSidebarFooter],hlm-sidebar-footer` |
|
|
39
|
+
| `HlmSidebarGroup` | Directive | `[hlmSidebarGroup],hlm-sidebar-group` |
|
|
40
|
+
| `HlmSidebarGroupLabel` | Directive | `div[hlmSidebarGroupLabel], button[hlmSidebarGroupLabel]` |
|
|
41
|
+
| `HlmSidebarGroupAction` | Directive | `button[hlmSidebarGroupAction]` |
|
|
42
|
+
| `HlmSidebarGroupContent` | Directive | `div[hlmSidebarGroupContent]` |
|
|
43
|
+
| `HlmSidebarMenu` | Directive | `ul[hlmSidebarMenu]` |
|
|
44
|
+
| `HlmSidebarMenuItem` | Directive | `li[hlmSidebarMenuItem]` |
|
|
45
|
+
| `HlmSidebarMenuButton` | Directive | `button[hlmSidebarMenuButton], a[hlmSidebarMenuButton]` |
|
|
46
|
+
| `HlmSidebarMenuAction` | Directive | `button[hlmSidebarMenuAction]` |
|
|
47
|
+
| `HlmSidebarMenuBadge` | Directive | `[hlmSidebarMenuBadge],hlm-sidebar-menu-badge` |
|
|
48
|
+
| `HlmSidebarMenuSkeleton` | Component | `hlm-sidebar-menu-skeleton,div[hlmSidebarMenuSkeleton]` |
|
|
49
|
+
| `HlmSidebarMenuSub` | Directive | `ul[hlmSidebarMenuSub]` |
|
|
50
|
+
| `HlmSidebarMenuSubItem` | Directive | `li[hlmSidebarMenuSubItem]` |
|
|
51
|
+
| `HlmSidebarMenuSubButton` | Directive | `a[hlmSidebarMenuSubButton], button[hlmSidebarMenuSubButton]` |
|
|
52
|
+
| `HlmSidebarSeparator` | Directive | `[hlmSidebarSeparator],hlm-sidebar-separator` |
|
|
53
|
+
| `HlmSidebarTrigger` | Component | `button[hlmSidebarTrigger]` |
|
|
54
|
+
| `HlmSidebarRail` | Directive | `button[hlmSidebarRail]` |
|
|
55
|
+
| `HlmSidebarInput` | Directive | `input[hlmSidebarInput]` |
|
|
56
|
+
| `HlmSidebarInset` | Directive | `main[hlmSidebarInset]` |
|
|
57
|
+
| `HlmSidebarService` | `@Injectable({providedIn:'root'})` | State store (no selector) |
|
|
58
|
+
| `HlmSidebarConfig` (+ `provideHlmSidebarConfig`, `injectHlmSidebarConfig`) | Interface + functions | Global config (no selector) |
|
|
59
|
+
| `HlmSidebarImports` | `const` array | All directives/components above, for standalone `imports` |
|
|
60
|
+
| `HlmSidebarModule` | `NgModule` | NgModule wrapper re-exporting `HlmSidebarImports` |
|
|
61
|
+
|
|
62
|
+
Standalone usage:
|
|
63
|
+
|
|
64
|
+
```ts
|
|
65
|
+
import { Component } from '@angular/core';
|
|
66
|
+
import { HlmSidebarImports } from '@egose/shadcn-theme-ng/sidebar';
|
|
67
|
+
|
|
68
|
+
@Component({
|
|
69
|
+
selector: 'app-shell',
|
|
70
|
+
standalone: true,
|
|
71
|
+
imports: [HlmSidebarImports],
|
|
72
|
+
template: `...`,
|
|
73
|
+
})
|
|
74
|
+
export class ShellComponent {}
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
NgModule usage:
|
|
78
|
+
|
|
79
|
+
```ts
|
|
80
|
+
import { NgModule } from '@angular/core';
|
|
81
|
+
import { HlmSidebarModule } from '@egose/shadcn-theme-ng/sidebar';
|
|
82
|
+
|
|
83
|
+
@NgModule({ imports: [HlmSidebarModule] })
|
|
84
|
+
export class ShellModule {}
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
## Anatomy / Structure
|
|
88
|
+
|
|
89
|
+
```html
|
|
90
|
+
<div hlmSidebarWrapper>
|
|
91
|
+
<hlm-sidebar>
|
|
92
|
+
<div hlmSidebarHeader>
|
|
93
|
+
<input hlmSidebarInput placeholder="Search…" />
|
|
94
|
+
</div>
|
|
95
|
+
|
|
96
|
+
<div hlmSidebarContent>
|
|
97
|
+
<div hlmSidebarGroup>
|
|
98
|
+
<div hlmSidebarGroupLabel>Platform</div>
|
|
99
|
+
<div hlmSidebarGroupContent>
|
|
100
|
+
<ul hlmSidebarMenu>
|
|
101
|
+
<li hlmSidebarMenuItem>
|
|
102
|
+
<button hlmSidebarMenuButton isActive tooltip="Dashboard">
|
|
103
|
+
<ng-icon name="lucideLayoutDashboard" />
|
|
104
|
+
<span>Dashboard</span>
|
|
105
|
+
</button>
|
|
106
|
+
<span hlmSidebarMenuBadge>3</span>
|
|
107
|
+
</li>
|
|
108
|
+
<li hlmSidebarMenuItem>
|
|
109
|
+
<button hlmSidebarMenuButton tooltip="Settings">
|
|
110
|
+
<ng-icon name="lucideSettings" />
|
|
111
|
+
<span>Settings</span>
|
|
112
|
+
</button>
|
|
113
|
+
<ul hlmSidebarMenuSub>
|
|
114
|
+
<li hlmSidebarMenuSubItem>
|
|
115
|
+
<a hlmSidebarMenuSubButton href="/settings/profile">Profile</a>
|
|
116
|
+
</li>
|
|
117
|
+
</ul>
|
|
118
|
+
</li>
|
|
119
|
+
</ul>
|
|
120
|
+
</div>
|
|
121
|
+
</div>
|
|
122
|
+
</div>
|
|
123
|
+
|
|
124
|
+
<div hlmSidebarFooter>…user card…</div>
|
|
125
|
+
|
|
126
|
+
<button hlmSidebarRail aria-label="Toggle Sidebar"></button>
|
|
127
|
+
</hlm-sidebar>
|
|
128
|
+
|
|
129
|
+
<main hlmSidebarInset>
|
|
130
|
+
<button hlmSidebarTrigger></button>
|
|
131
|
+
<router-outlet />
|
|
132
|
+
</main>
|
|
133
|
+
</div>
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
Host-element rules matter: menus must be `ul[hlmSidebarMenu]` / `li[hlmSidebarMenuItem]`, sub-menus `ul[hlmSidebarMenuSub]` / `li[hlmSidebarMenuSubItem]`, group content exactly `div[hlmSidebarGroupContent]`, the inset exactly `main[hlmSidebarInset]`, trigger/rail exactly `<button>`.
|
|
137
|
+
|
|
138
|
+
## API reference
|
|
139
|
+
|
|
140
|
+
### Layout: HlmSidebarWrapper / HlmSidebar / HlmSidebarInset
|
|
141
|
+
|
|
142
|
+
| Class | Inputs | Description |
|
|
143
|
+
| ------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- |
|
|
144
|
+
| `HlmSidebarWrapper` | `sidebarWidth?: string` (default from config `'16rem'`), `sidebarWidthIcon?: string` (default `'3rem'`) | Root flex shell; sets `--sidebar-width` / `--sidebar-width-icon` CSS vars |
|
|
145
|
+
| `HlmSidebar` | `side?: 'left' \| 'right'` (`'left'`), `variant?: SidebarVariant` (synced with service), `collapsible?: 'offcanvas' \| 'icon' \| 'none'` (`'offcanvas'`), `sidebarWidthMobile?: string`, `sidebarContainerClass?: ClassValue` | The sidebar itself; desktop = gap + fixed container, mobile = `hlm-sheet` |
|
|
146
|
+
| `HlmSidebarInset` | — | `main` content area beside the sidebar; inset-variant rounding/shadow via peer selectors |
|
|
147
|
+
|
|
148
|
+
`SidebarVariant = 'sidebar' | 'floating' | 'inset'`. With `collapsible="none"` the sidebar is a plain static column (no gap/container machinery, no mobile sheet). With `"icon"`, collapsing shrinks to `--sidebar-width-icon` and labels hide; with `"offcanvas"` it slides out of view.
|
|
149
|
+
|
|
150
|
+
### HlmSidebarService (state)
|
|
151
|
+
|
|
152
|
+
Readonly signals: `open`, `openMobile`, `isMobile`, `variant`, plus `state` (`'expanded' | 'collapsed'` computed from `open`).
|
|
153
|
+
|
|
154
|
+
| Method | Signature | Description |
|
|
155
|
+
| --------------- | ------------------------------------------- | ------------------------------------------------------------------- |
|
|
156
|
+
| `setOpen` | `setOpen(open: boolean): void` | Expand/collapse desktop sidebar; persists to cookie |
|
|
157
|
+
| `setOpenMobile` | `setOpenMobile(open: boolean): void` | Open/close the mobile sheet (no-op on desktop) |
|
|
158
|
+
| `setVariant` | `setVariant(variant: SidebarVariant): void` | Switch layout variant (also synced from `HlmSidebar.variant` input) |
|
|
159
|
+
| `toggleSidebar` | `toggleSidebar(): void` | Toggles mobile sheet on mobile, desktop open state otherwise |
|
|
160
|
+
|
|
161
|
+
Desktop state persists via cookie (`sidebar_state`, 7-day max-age by default) and restores on boot (server reads the request cookie when available). `Ctrl/Cmd+B` toggles the sidebar (configurable shortcut). Mobile is determined by `matchMedia('(max-width: <mobileBreakpoint>)')`.
|
|
162
|
+
|
|
163
|
+
### Global config: HlmSidebarConfig
|
|
164
|
+
|
|
165
|
+
Provide overrides once (e.g. in `app.config.ts`):
|
|
166
|
+
|
|
167
|
+
```ts
|
|
168
|
+
import { provideHlmSidebarConfig } from '@egose/shadcn-theme-ng/sidebar';
|
|
169
|
+
|
|
170
|
+
export const appConfig: ApplicationConfig = {
|
|
171
|
+
providers: [
|
|
172
|
+
provideHlmSidebarConfig({
|
|
173
|
+
sidebarWidth: '18rem',
|
|
174
|
+
sidebarWidthIcon: '3.5rem',
|
|
175
|
+
mobileBreakpoint: '1024px',
|
|
176
|
+
closeMobileSidebarOnMenuButtonClick: true,
|
|
177
|
+
}),
|
|
178
|
+
],
|
|
179
|
+
};
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
| Key | Default | Description |
|
|
183
|
+
| ------------------------------------- | ---------------------- | ----------------------------------------------------------- |
|
|
184
|
+
| `sidebarWidth` | `'16rem'` | Desktop width (`--sidebar-width`) |
|
|
185
|
+
| `sidebarWidthMobile` | `'18rem'` | Mobile sheet width |
|
|
186
|
+
| `sidebarWidthIcon` | `'3rem'` | Width when collapsed to icon |
|
|
187
|
+
| `sidebarCookieName` | `'sidebar_state'` | Persistence cookie name |
|
|
188
|
+
| `sidebarCookieMaxAge` | `604800` (7d, seconds) | Cookie max-age |
|
|
189
|
+
| `sidebarKeyboardShortcut` | `'b'` | `Ctrl/Cmd+<key>` toggle |
|
|
190
|
+
| `mobileBreakpoint` | `'768px'` | `max-width` media query for mobile mode |
|
|
191
|
+
| `closeMobileSidebarOnMenuButtonClick` | `false` | Auto-close mobile sheet when a menu (sub-)button is clicked |
|
|
192
|
+
|
|
193
|
+
`HlmSidebarMenuButton` / `HlmSidebarMenuSubButton` expose the same flag as a per-button `closeMobileSidebarOnClick` input defaulting to the config value.
|
|
194
|
+
|
|
195
|
+
### Menu pieces
|
|
196
|
+
|
|
197
|
+
| Class | Inputs | Notes |
|
|
198
|
+
| ------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- |
|
|
199
|
+
| `HlmSidebarMenuButton` | `variant?: 'default' \| 'outline'`, `size?: 'default' \| 'sm' \| 'lg'`, `isActive?: boolean`, `closeMobileSidebarOnClick?: boolean`, `tooltip` (via `BrnTooltip` host directive, `brnTooltip` alias) | Tooltip auto-shows only when collapsed to icon on desktop |
|
|
200
|
+
| `HlmSidebarMenuAction` | `showOnHover?: boolean` | Small overlay action at the row end; hidden until hover/focus when `showOnHover` |
|
|
201
|
+
| `HlmSidebarMenuBadge` | — | Count pill at the row end; hidden in icon mode |
|
|
202
|
+
| `HlmSidebarMenuSkeleton` | `showIcon?: boolean` | Loading row (icon _or_ text skeleton, random 50–90% width) |
|
|
203
|
+
| `HlmSidebarMenuSubButton` | `size?: 'sm' \| 'md'` (`'md'`), `isActive?: boolean`, `closeMobileSidebarOnClick?: boolean` | Nested link style; hidden in icon mode |
|
|
204
|
+
| `HlmSidebarGroupLabel` | — | `div` or `button` host; collapses away in icon mode |
|
|
205
|
+
| `HlmSidebarGroupAction` | — | `<button>` only; e.g. "+" affordance at group top-right |
|
|
206
|
+
| `HlmSidebarSeparator` | — (wraps `HlmSeparator`) | Sidebar-border divider |
|
|
207
|
+
| `HlmSidebarInput` | — (wraps `HlmInput`) | `<input>` only; search-style `h-8` field |
|
|
208
|
+
| `HlmSidebarTrigger` | `srOnlyText?: string` (`'Toggle Sidebar'`), plus `HlmBtn` `variant`/`size` (default ghost `icon-sm`) | `<button>` only; toggles via service |
|
|
209
|
+
| `HlmSidebarRail` | `aria-label` (`ariaLabel`, default `'Toggle Sidebar'`) | `<button>` only; invisible hover strip that toggles collapse |
|
|
210
|
+
|
|
211
|
+
Header/content/footer/group/menu/item/sub/sub-item/sub-content directives take no inputs — they are pure layout slots (`data-sidebar` attributes drive the collapse CSS).
|
|
212
|
+
|
|
213
|
+
## Examples
|
|
214
|
+
|
|
215
|
+
### 1. Minimal app shell
|
|
216
|
+
|
|
217
|
+
```ts
|
|
218
|
+
import { Component } from '@angular/core';
|
|
219
|
+
import { HlmSidebarImports } from '@egose/shadcn-theme-ng/sidebar';
|
|
220
|
+
|
|
221
|
+
@Component({
|
|
222
|
+
selector: 'app-shell',
|
|
223
|
+
standalone: true,
|
|
224
|
+
imports: [HlmSidebarImports],
|
|
225
|
+
template: `
|
|
226
|
+
<div hlmSidebarWrapper>
|
|
227
|
+
<hlm-sidebar>
|
|
228
|
+
<div hlmSidebarHeader><strong>Acme</strong></div>
|
|
229
|
+
<div hlmSidebarContent>
|
|
230
|
+
<div hlmSidebarGroup>
|
|
231
|
+
<div hlmSidebarGroupContent>
|
|
232
|
+
<ul hlmSidebarMenu>
|
|
233
|
+
<li hlmSidebarMenuItem>
|
|
234
|
+
<a hlmSidebarMenuButton isActive href="/dashboard"><span>Dashboard</span></a>
|
|
235
|
+
</li>
|
|
236
|
+
<li hlmSidebarMenuItem>
|
|
237
|
+
<a hlmSidebarMenuButton href="/reports"><span>Reports</span></a>
|
|
238
|
+
</li>
|
|
239
|
+
</ul>
|
|
240
|
+
</div>
|
|
241
|
+
</div>
|
|
242
|
+
</div>
|
|
243
|
+
<div hlmSidebarFooter><span class="tw:text-xs">v1.0</span></div>
|
|
244
|
+
</hlm-sidebar>
|
|
245
|
+
|
|
246
|
+
<main hlmSidebarInset>
|
|
247
|
+
<button hlmSidebarTrigger></button>
|
|
248
|
+
<div class="tw:p-4">Page content</div>
|
|
249
|
+
</main>
|
|
250
|
+
</div>
|
|
251
|
+
`,
|
|
252
|
+
})
|
|
253
|
+
export class ShellComponent {}
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
### 2. Icon-collapse with tooltips + toggle from code
|
|
257
|
+
|
|
258
|
+
```ts
|
|
259
|
+
import { Component, inject } from '@angular/core';
|
|
260
|
+
import { HlmSidebarImports, HlmSidebarService } from '@egose/shadcn-theme-ng/sidebar';
|
|
261
|
+
|
|
262
|
+
@Component({
|
|
263
|
+
selector: 'app-icon-sidebar',
|
|
264
|
+
standalone: true,
|
|
265
|
+
imports: [HlmSidebarImports],
|
|
266
|
+
template: `
|
|
267
|
+
<div hlmSidebarWrapper>
|
|
268
|
+
<hlm-sidebar collapsible="icon">
|
|
269
|
+
<div hlmSidebarContent>
|
|
270
|
+
<div hlmSidebarGroup>
|
|
271
|
+
<div hlmSidebarGroupContent>
|
|
272
|
+
<ul hlmSidebarMenu>
|
|
273
|
+
<li hlmSidebarMenuItem>
|
|
274
|
+
<button hlmSidebarMenuButton tooltip="Dashboard" (click)="go('/dashboard')">
|
|
275
|
+
<span aria-hidden="true">▦</span><span>Dashboard</span>
|
|
276
|
+
</button>
|
|
277
|
+
</li>
|
|
278
|
+
</ul>
|
|
279
|
+
</div>
|
|
280
|
+
</div>
|
|
281
|
+
</div>
|
|
282
|
+
<button hlmSidebarRail aria-label="Toggle Sidebar"></button>
|
|
283
|
+
</hlm-sidebar>
|
|
284
|
+
<main hlmSidebarInset>
|
|
285
|
+
<button hlmSidebarTrigger></button>
|
|
286
|
+
<p>Collapsed: {{ sidebar.open() ? 'no' : 'yes' }} (state: {{ sidebar.state() }})</p>
|
|
287
|
+
<button type="button" (click)="sidebar.toggleSidebar()">Toggle from code</button>
|
|
288
|
+
</main>
|
|
289
|
+
</div>
|
|
290
|
+
`,
|
|
291
|
+
})
|
|
292
|
+
export class IconSidebarComponent {
|
|
293
|
+
protected readonly sidebar = inject(HlmSidebarService);
|
|
294
|
+
|
|
295
|
+
go(path: string): void {
|
|
296
|
+
console.log('navigate', path);
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
```
|
|
300
|
+
|
|
301
|
+
When `state() === 'collapsed'` the button labels collapse and the `tooltip` text appears on hover via `BrnTooltip`.
|
|
302
|
+
|
|
303
|
+
### 3. Groups, sub-menus, badges, actions
|
|
304
|
+
|
|
305
|
+
```html
|
|
306
|
+
<div hlmSidebarGroup>
|
|
307
|
+
<div hlmSidebarGroupLabel>Projects</div>
|
|
308
|
+
<button hlmSidebarGroupAction aria-label="Add project">+</button>
|
|
309
|
+
<div hlmSidebarGroupContent>
|
|
310
|
+
<ul hlmSidebarMenu>
|
|
311
|
+
<li hlmSidebarMenuItem>
|
|
312
|
+
<button hlmSidebarMenuButton tooltip="Website">
|
|
313
|
+
<span>Website</span>
|
|
314
|
+
</button>
|
|
315
|
+
<span hlmSidebarMenuBadge>12</span>
|
|
316
|
+
<button hlmSidebarMenuAction showOnHover aria-label="More actions">…</button>
|
|
317
|
+
<ul hlmSidebarMenuSub>
|
|
318
|
+
<li hlmSidebarMenuSubItem>
|
|
319
|
+
<a hlmSidebarMenuSubButton href="/p/site/overview">Overview</a>
|
|
320
|
+
</li>
|
|
321
|
+
<li hlmSidebarMenuSubItem>
|
|
322
|
+
<a hlmSidebarMenuSubButton isActive href="/p/site/deploys">Deploys</a>
|
|
323
|
+
</li>
|
|
324
|
+
</ul>
|
|
325
|
+
</li>
|
|
326
|
+
</ul>
|
|
327
|
+
</div>
|
|
328
|
+
</div>
|
|
329
|
+
|
|
330
|
+
<hlm-sidebar-separator />
|
|
11
331
|
```
|
|
332
|
+
|
|
333
|
+
### 4. Search input + loading skeletons
|
|
334
|
+
|
|
335
|
+
```ts
|
|
336
|
+
import { Component, signal } from '@angular/core';
|
|
337
|
+
import { HlmSidebarImports } from '@egose/shadcn-theme-ng/sidebar';
|
|
338
|
+
|
|
339
|
+
@Component({
|
|
340
|
+
selector: 'app-search-sidebar',
|
|
341
|
+
standalone: true,
|
|
342
|
+
imports: [HlmSidebarImports],
|
|
343
|
+
template: `
|
|
344
|
+
<div hlmSidebarWrapper>
|
|
345
|
+
<hlm-sidebar>
|
|
346
|
+
<div hlmSidebarHeader>
|
|
347
|
+
<input hlmSidebarInput placeholder="Search…" [(value)]="query" aria-label="Search menu" />
|
|
348
|
+
</div>
|
|
349
|
+
<div hlmSidebarContent>
|
|
350
|
+
@if (loading()) {
|
|
351
|
+
<hlm-sidebar-menu-skeleton />
|
|
352
|
+
<hlm-sidebar-menu-skeleton />
|
|
353
|
+
<hlm-sidebar-menu-skeleton showIcon />
|
|
354
|
+
} @else {
|
|
355
|
+
<div hlmSidebarGroup>
|
|
356
|
+
<div hlmSidebarGroupContent>
|
|
357
|
+
<ul hlmSidebarMenu>
|
|
358
|
+
@for (item of filtered(); track item) {
|
|
359
|
+
<li hlmSidebarMenuItem>
|
|
360
|
+
<button hlmSidebarMenuButton>
|
|
361
|
+
<span>{{ item }}</span>
|
|
362
|
+
</button>
|
|
363
|
+
</li>
|
|
364
|
+
}
|
|
365
|
+
</ul>
|
|
366
|
+
</div>
|
|
367
|
+
</div>
|
|
368
|
+
}
|
|
369
|
+
</div>
|
|
370
|
+
</hlm-sidebar>
|
|
371
|
+
<main hlmSidebarInset>…</main>
|
|
372
|
+
</div>
|
|
373
|
+
`,
|
|
374
|
+
})
|
|
375
|
+
export class SearchSidebarComponent {
|
|
376
|
+
readonly query = signal('');
|
|
377
|
+
readonly loading = signal(false);
|
|
378
|
+
readonly filtered = signal(['Inbox', 'Sent', 'Archive']);
|
|
379
|
+
}
|
|
380
|
+
```
|
|
381
|
+
|
|
382
|
+
### 5. Right-side inset variant
|
|
383
|
+
|
|
384
|
+
```html
|
|
385
|
+
<div hlmSidebarWrapper>
|
|
386
|
+
<main hlmSidebarInset>
|
|
387
|
+
<button hlmSidebarTrigger></button>
|
|
388
|
+
Content first in DOM…
|
|
389
|
+
</main>
|
|
390
|
+
|
|
391
|
+
<hlm-sidebar side="right" variant="inset">
|
|
392
|
+
<div hlmSidebarHeader>Inspector</div>
|
|
393
|
+
<div hlmSidebarContent>…</div>
|
|
394
|
+
</hlm-sidebar>
|
|
395
|
+
</div>
|
|
396
|
+
```
|
|
397
|
+
|
|
398
|
+
`variant="inset"` (or `"floating"`) adjusts gap math, rounding, and ring styling; the input syncs to `HlmSidebarService.variant` so menu buttons and peers react consistently.
|
|
399
|
+
|
|
400
|
+
### 6. Router integration with active state
|
|
401
|
+
|
|
402
|
+
```ts
|
|
403
|
+
import { Component } from '@angular/core';
|
|
404
|
+
import { RouterLink, RouterLinkActive } from '@angular/router';
|
|
405
|
+
import { HlmSidebarImports } from '@egose/shadcn-theme-ng/sidebar';
|
|
406
|
+
|
|
407
|
+
@Component({
|
|
408
|
+
selector: 'app-router-sidebar',
|
|
409
|
+
standalone: true,
|
|
410
|
+
imports: [HlmSidebarImports, RouterLink, RouterLinkActive],
|
|
411
|
+
template: `
|
|
412
|
+
<div hlmSidebarWrapper>
|
|
413
|
+
<hlm-sidebar>
|
|
414
|
+
<div hlmSidebarContent>
|
|
415
|
+
<div hlmSidebarGroup>
|
|
416
|
+
<div hlmSidebarGroupContent>
|
|
417
|
+
<ul hlmSidebarMenu>
|
|
418
|
+
<li hlmSidebarMenuItem>
|
|
419
|
+
<a
|
|
420
|
+
hlmSidebarMenuButton
|
|
421
|
+
routerLink="/dashboard"
|
|
422
|
+
routerLinkActive
|
|
423
|
+
#rla="routerLinkActive"
|
|
424
|
+
[isActive]="rla.isActive"
|
|
425
|
+
tooltip="Dashboard"
|
|
426
|
+
>
|
|
427
|
+
<span>Dashboard</span>
|
|
428
|
+
</a>
|
|
429
|
+
</li>
|
|
430
|
+
</ul>
|
|
431
|
+
</div>
|
|
432
|
+
</div>
|
|
433
|
+
</div>
|
|
434
|
+
</hlm-sidebar>
|
|
435
|
+
<main hlmSidebarInset>
|
|
436
|
+
<router-outlet />
|
|
437
|
+
</main>
|
|
438
|
+
</div>
|
|
439
|
+
`,
|
|
440
|
+
})
|
|
441
|
+
export class RouterSidebarComponent {}
|
|
442
|
+
```
|
|
443
|
+
|
|
444
|
+
`[isActive]` drives `data-active` styling; `tooltip` keeps icon-mode navigation discoverable.
|
|
445
|
+
|
|
446
|
+
## Accessibility notes
|
|
447
|
+
|
|
448
|
+
- Landmarks: the sidebar content should read as complementary navigation — add `aria-label` to `hlm-sidebar`/nav regions when multiple navs exist; the inset `main` gives the primary content landmark.
|
|
449
|
+
- `HlmSidebarTrigger` renders an icon-only ghost button with an sr-only label (`srOnlyText`, default "Toggle Sidebar") — keep that text meaningful and don't remove it.
|
|
450
|
+
- Collapsed icon mode hides labels visually but exposes them via tooltips; ensure every icon button passes `tooltip` text, otherwise icon-mode buttons have no accessible name beyond their (hidden) `<span>`.
|
|
451
|
+
- The `Ctrl/Cmd+B` shortcut toggles the sidebar — document it in your app's keyboard-shortcut help and avoid colliding bindings.
|
|
452
|
+
- Mobile renders a real `hlm-sheet` dialog with focus trap and overlay dismissal; menu-button clicks can auto-close it via `closeMobileSidebarOnMenuButtonClick`.
|
|
453
|
+
|
|
454
|
+
## Theming / CSS variables
|
|
455
|
+
|
|
456
|
+
Sidebar tokens (`--sidebar`, `--sidebar-foreground`, `--sidebar-accent`, `--sidebar-border`, `--sidebar-ring`, …) drive all colors; geometry via `--sidebar-width` / `--sidebar-width-icon` on the wrapper. Dark mode follows the theme tokens. Menu-button density via `size` (`default`/`sm`/`lg`) and style via `variant` (`default`/`outline`).
|
|
457
|
+
|
|
458
|
+
## Related subpaths
|
|
459
|
+
|
|
460
|
+
- `@egose/shadcn-theme-ng/sheet` — the mobile sidebar renders through `hlm-sheet`
|
|
461
|
+
- `@egose/shadcn-theme-ng/separator` — wrapped by `HlmSidebarSeparator`
|
|
462
|
+
- `@egose/shadcn-theme-ng/skeleton` — used by `HlmSidebarMenuSkeleton`
|
|
463
|
+
- `@egose/shadcn-theme-ng/tooltip` — tooltip defaults reused for collapsed menu-button tooltips
|