@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
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
3
|
+
import { ClassValue } from 'clsx';
|
|
4
|
+
import * as i1 from '@angular/cdk/menu';
|
|
5
|
+
import { BooleanInput } from '@angular/cdk/coercion';
|
|
6
|
+
|
|
7
|
+
declare const menuVariants: (props?: ({
|
|
8
|
+
variant?: "default" | "menubar" | null | undefined;
|
|
9
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
10
|
+
declare class HlmMenu {
|
|
11
|
+
readonly userClass: i0.InputSignal<ClassValue>;
|
|
12
|
+
protected readonly _computedClass: i0.Signal<string>;
|
|
13
|
+
readonly variant: i0.InputSignal<"default" | "menubar" | null | undefined>;
|
|
14
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<HlmMenu, never>;
|
|
15
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<HlmMenu, "hlm-menu", never, { "userClass": { "alias": "class"; "required": false; "isSignal": true; }; "variant": { "alias": "variant"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, [{ directive: typeof i1.CdkMenu; inputs: {}; outputs: {}; }]>;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
declare class HlmMenuBar {
|
|
19
|
+
readonly userClass: i0.InputSignal<ClassValue>;
|
|
20
|
+
protected _computedClass: i0.Signal<string>;
|
|
21
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<HlmMenuBar, never>;
|
|
22
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<HlmMenuBar, "hlm-menu-bar", never, { "userClass": { "alias": "class"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, [{ directive: typeof i1.CdkMenuBar; inputs: {}; outputs: {}; }]>;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
declare class HlmMenuBarItem {
|
|
26
|
+
readonly userClass: i0.InputSignal<ClassValue>;
|
|
27
|
+
protected readonly _computedClass: i0.Signal<string>;
|
|
28
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<HlmMenuBarItem, never>;
|
|
29
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<HlmMenuBarItem, "[hlmMenuBarItem]", never, { "userClass": { "alias": "class"; "required": false; "isSignal": true; }; }, {}, never, never, true, [{ directive: typeof i1.CdkMenuItem; inputs: {}; outputs: {}; }]>;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
declare class HlmMenuGroup {
|
|
33
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<HlmMenuGroup, never>;
|
|
34
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<HlmMenuGroup, "hlm-menu-group", never, {}, {}, never, ["*"], true, [{ directive: typeof i1.CdkMenuGroup; inputs: {}; outputs: {}; }]>;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
declare class HlmMenuLabel {
|
|
38
|
+
readonly inset: i0.InputSignalWithTransform<boolean, BooleanInput>;
|
|
39
|
+
readonly userClass: i0.InputSignal<ClassValue>;
|
|
40
|
+
protected _computedClass: i0.Signal<string>;
|
|
41
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<HlmMenuLabel, never>;
|
|
42
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<HlmMenuLabel, "hlm-menu-label", never, { "inset": { "alias": "inset"; "required": false; "isSignal": true; }; "userClass": { "alias": "class"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, never>;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
declare class HlmMenuSeparator {
|
|
46
|
+
readonly userClass: i0.InputSignal<ClassValue>;
|
|
47
|
+
protected readonly _computedClass: i0.Signal<string>;
|
|
48
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<HlmMenuSeparator, never>;
|
|
49
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<HlmMenuSeparator, "hlm-menu-separator", never, { "userClass": { "alias": "class"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
declare class HlmSubMenu {
|
|
53
|
+
readonly userClass: i0.InputSignal<ClassValue>;
|
|
54
|
+
protected readonly _computedClass: i0.Signal<string>;
|
|
55
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<HlmSubMenu, never>;
|
|
56
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<HlmSubMenu, "hlm-sub-menu", never, { "userClass": { "alias": "class"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, [{ directive: typeof i1.CdkMenu; inputs: {}; outputs: {}; }]>;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
declare class HlmMenuItem {
|
|
60
|
+
readonly variant: i0.InputSignal<"default" | "destructive">;
|
|
61
|
+
readonly inset: i0.InputSignalWithTransform<boolean, BooleanInput>;
|
|
62
|
+
readonly userClass: i0.InputSignal<ClassValue>;
|
|
63
|
+
protected readonly _computedClass: i0.Signal<string>;
|
|
64
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<HlmMenuItem, never>;
|
|
65
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<HlmMenuItem, "[hlmMenuItem]", never, { "variant": { "alias": "variant"; "required": false; "isSignal": true; }; "inset": { "alias": "inset"; "required": false; "isSignal": true; }; "userClass": { "alias": "class"; "required": false; "isSignal": true; }; }, {}, never, never, true, [{ directive: typeof i1.CdkMenuItem; inputs: { "cdkMenuItemDisabled": "disabled"; }; outputs: { "cdkMenuItemTriggered": "triggered"; }; }]>;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
declare class HlmMenuItemIcon {
|
|
69
|
+
readonly userClass: i0.InputSignal<ClassValue>;
|
|
70
|
+
protected _computedClass: i0.Signal<string>;
|
|
71
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<HlmMenuItemIcon, never>;
|
|
72
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<HlmMenuItemIcon, "[hlmMenuIcon]", never, { "userClass": { "alias": "class"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
declare class HlmMenuItemSubIndicator {
|
|
76
|
+
readonly userClass: i0.InputSignal<ClassValue>;
|
|
77
|
+
protected readonly _computedClass: i0.Signal<string>;
|
|
78
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<HlmMenuItemSubIndicator, never>;
|
|
79
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<HlmMenuItemSubIndicator, "hlm-menu-item-sub-indicator", never, { "userClass": { "alias": "class"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
declare class HlmMenuItemRadioIndicator {
|
|
83
|
+
readonly userClass: i0.InputSignal<ClassValue>;
|
|
84
|
+
protected readonly _computedClass: i0.Signal<string>;
|
|
85
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<HlmMenuItemRadioIndicator, never>;
|
|
86
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<HlmMenuItemRadioIndicator, "hlm-menu-item-radio", never, { "userClass": { "alias": "class"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
declare class HlmMenuItemCheck {
|
|
90
|
+
readonly userClass: i0.InputSignal<ClassValue>;
|
|
91
|
+
protected _computedClass: i0.Signal<string>;
|
|
92
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<HlmMenuItemCheck, never>;
|
|
93
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<HlmMenuItemCheck, "hlm-menu-item-check", never, { "userClass": { "alias": "class"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
declare class HlmMenuShortcut {
|
|
97
|
+
readonly userClass: i0.InputSignal<ClassValue>;
|
|
98
|
+
protected _computedClass: i0.Signal<string>;
|
|
99
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<HlmMenuShortcut, never>;
|
|
100
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<HlmMenuShortcut, "hlm-menu-shortcut", never, { "userClass": { "alias": "class"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, never>;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
declare class HlmMenuItemCheckbox {
|
|
104
|
+
readonly userClass: i0.InputSignal<ClassValue>;
|
|
105
|
+
protected readonly _computedClass: i0.Signal<string>;
|
|
106
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<HlmMenuItemCheckbox, never>;
|
|
107
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<HlmMenuItemCheckbox, "[hlmMenuItemCheckbox]", never, { "userClass": { "alias": "class"; "required": false; "isSignal": true; }; }, {}, never, never, true, [{ directive: typeof i1.CdkMenuItemCheckbox; inputs: { "cdkMenuItemDisabled": "disabled"; "cdkMenuItemChecked": "checked"; }; outputs: { "cdkMenuItemTriggered": "triggered"; }; }]>;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
declare class HlmMenuItemRadio {
|
|
111
|
+
readonly userClass: i0.InputSignal<ClassValue>;
|
|
112
|
+
protected readonly _computedClass: i0.Signal<string>;
|
|
113
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<HlmMenuItemRadio, never>;
|
|
114
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<HlmMenuItemRadio, "[hlmMenuItemRadio]", never, { "userClass": { "alias": "class"; "required": false; "isSignal": true; }; }, {}, never, never, true, [{ directive: typeof i1.CdkMenuItemRadio; inputs: { "cdkMenuItemDisabled": "disabled"; "cdkMenuItemChecked": "checked"; }; outputs: { "cdkMenuItemTriggered": "triggered"; }; }]>;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
declare const HlmMenuItemImports: (typeof HlmMenuGroup)[];
|
|
118
|
+
declare const HlmMenuStructureImports: readonly [typeof HlmMenuLabel, typeof HlmMenuSeparator];
|
|
119
|
+
declare const HlmMenuImports: readonly [...(typeof HlmMenuGroup)[], typeof HlmMenuLabel, typeof HlmMenuSeparator, typeof HlmMenu, typeof HlmSubMenu];
|
|
120
|
+
declare const HlmMenuBarImports: readonly [...(typeof HlmMenuGroup)[], typeof HlmMenuLabel, typeof HlmMenuSeparator, typeof HlmMenu, typeof HlmSubMenu, typeof HlmMenuBar, typeof HlmMenuBarItem];
|
|
121
|
+
declare class HlmMenuItemModule {
|
|
122
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<HlmMenuItemModule, never>;
|
|
123
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<HlmMenuItemModule, never, [typeof HlmMenuItem, typeof HlmMenuItemIcon, typeof HlmMenuGroup, typeof HlmMenuItemSubIndicator, typeof HlmMenuItemRadioIndicator, typeof HlmMenuItemCheck, typeof HlmMenuShortcut, typeof HlmMenuItemCheckbox, typeof HlmMenuItemRadio], [typeof HlmMenuItem, typeof HlmMenuItemIcon, typeof HlmMenuGroup, typeof HlmMenuItemSubIndicator, typeof HlmMenuItemRadioIndicator, typeof HlmMenuItemCheck, typeof HlmMenuShortcut, typeof HlmMenuItemCheckbox, typeof HlmMenuItemRadio]>;
|
|
124
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<HlmMenuItemModule>;
|
|
125
|
+
}
|
|
126
|
+
declare class HlmMenuModule {
|
|
127
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<HlmMenuModule, never>;
|
|
128
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<HlmMenuModule, never, [typeof HlmMenuItem, typeof HlmMenuItemIcon, typeof HlmMenuGroup, typeof HlmMenuItemSubIndicator, typeof HlmMenuItemRadioIndicator, typeof HlmMenuItemCheck, typeof HlmMenuShortcut, typeof HlmMenuItemCheckbox, typeof HlmMenuItemRadio, typeof HlmMenuLabel, typeof HlmMenuSeparator, typeof HlmMenu, typeof HlmSubMenu], [typeof HlmMenuItem, typeof HlmMenuItemIcon, typeof HlmMenuGroup, typeof HlmMenuItemSubIndicator, typeof HlmMenuItemRadioIndicator, typeof HlmMenuItemCheck, typeof HlmMenuShortcut, typeof HlmMenuItemCheckbox, typeof HlmMenuItemRadio, typeof HlmMenuLabel, typeof HlmMenuSeparator, typeof HlmMenu, typeof HlmSubMenu]>;
|
|
129
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<HlmMenuModule>;
|
|
130
|
+
}
|
|
131
|
+
declare class HlmMenuBarModule {
|
|
132
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<HlmMenuBarModule, never>;
|
|
133
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<HlmMenuBarModule, never, [typeof HlmMenuItem, typeof HlmMenuItemIcon, typeof HlmMenuGroup, typeof HlmMenuItemSubIndicator, typeof HlmMenuItemRadioIndicator, typeof HlmMenuItemCheck, typeof HlmMenuShortcut, typeof HlmMenuItemCheckbox, typeof HlmMenuItemRadio, typeof HlmMenuLabel, typeof HlmMenuSeparator, typeof HlmMenu, typeof HlmSubMenu, typeof HlmMenuBar, typeof HlmMenuBarItem], [typeof HlmMenuItem, typeof HlmMenuItemIcon, typeof HlmMenuGroup, typeof HlmMenuItemSubIndicator, typeof HlmMenuItemRadioIndicator, typeof HlmMenuItemCheck, typeof HlmMenuShortcut, typeof HlmMenuItemCheckbox, typeof HlmMenuItemRadio, typeof HlmMenuLabel, typeof HlmMenuSeparator, typeof HlmMenu, typeof HlmSubMenu, typeof HlmMenuBar, typeof HlmMenuBarItem]>;
|
|
134
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<HlmMenuBarModule>;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
export { HlmMenu, HlmMenuBar, HlmMenuBarImports, HlmMenuBarItem, HlmMenuBarModule, HlmMenuGroup, HlmMenuImports, HlmMenuItem, HlmMenuItemCheck, HlmMenuItemCheckbox, HlmMenuItemIcon, HlmMenuItemImports, HlmMenuItemModule, HlmMenuItemRadio, HlmMenuItemRadioIndicator, HlmMenuItemSubIndicator, HlmMenuLabel, HlmMenuModule, HlmMenuSeparator, HlmMenuShortcut, HlmMenuStructureImports, HlmSubMenu, menuVariants };
|
package/menubar/README.md
CHANGED
|
@@ -1,11 +1,349 @@
|
|
|
1
|
-
# Menubar
|
|
1
|
+
# Menubar (`@egose/shadcn-theme-ng/menubar`)
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Desktop app-style menu bar (shadcn/ui `menubar` equivalent): a horizontal `hlm-menubar` strip whose `hlmMenubarTrigger` buttons each open a floating menu (in practice, an `hlm-menu` / `hlm-dropdown-menu` surface). The bar and trigger are thin shadcn wrappers around Angular CDK `CdkMenuBar` / `CdkMenuItem` + `CdkMenuTrigger`, with spartan-ng menu-position helpers (`align`/`side`, global config token) for popup placement.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Ships as `@egose/shadcn-theme-ng/menubar` and `@egose/shadcn-theme-ng-tw/menubar` (tw: variant). See the [package README](../../README.md) for installation, peer dependencies, Tailwind setup, and testing. Do not publish this project directory independently.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
## Installation
|
|
8
8
|
|
|
9
9
|
```bash
|
|
10
|
-
|
|
10
|
+
# Plain Tailwind (no prefix):
|
|
11
|
+
npm install @egose/shadcn-theme-ng
|
|
12
|
+
|
|
13
|
+
# Or the tw:-prefixed variant:
|
|
14
|
+
npm install @egose/shadcn-theme-ng-tw
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Peer dependencies are inherited from the package root (see [package README](../../README.md)). This subpath itself declares `@angular/common`, `@angular/core`, `@spartan-ng/brain` as peers plus a `tslib` runtime dependency; at runtime it also uses `@angular/cdk/menu` and `@spartan-ng/brain/core` position helpers, and you will typically pair it with `@egose/shadcn-theme-ng/menu` or `.../dropdown-menu` for the popup surfaces. No extra install step is needed beyond the package install above.
|
|
18
|
+
|
|
19
|
+
## Imports
|
|
20
|
+
|
|
21
|
+
Real exported symbols (from `src/public-api.ts`):
|
|
22
|
+
|
|
23
|
+
```ts
|
|
24
|
+
import {
|
|
25
|
+
HlmMenubar, // directive: [hlmMenubar],hlm-menubar
|
|
26
|
+
HlmMenubarTrigger, // directive: button[hlmMenubarTrigger]
|
|
27
|
+
HlmMenubarConfig, // interface { align, side }
|
|
28
|
+
provideHlmMenubarConfig, // (config: Partial<HlmMenubarConfig>) => ValueProvider
|
|
29
|
+
injectHlmMenubarConfig, // () => HlmMenubarConfig
|
|
30
|
+
HlmMenubarImports, // readonly [HlmMenubar, HlmMenubarTrigger]
|
|
31
|
+
HlmMenubarModule, // NgModule wrapping HlmMenubarImports
|
|
32
|
+
} from '@egose/shadcn-theme-ng/menubar';
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Standalone usage:
|
|
36
|
+
|
|
37
|
+
```ts
|
|
38
|
+
import { Component } from '@angular/core';
|
|
39
|
+
import { HlmMenubarImports } from '@egose/shadcn-theme-ng/menubar';
|
|
40
|
+
import { HlmMenuImports } from '@egose/shadcn-theme-ng/menu';
|
|
41
|
+
|
|
42
|
+
@Component({
|
|
43
|
+
selector: 'app-demo',
|
|
44
|
+
standalone: true,
|
|
45
|
+
imports: [...HlmMenubarImports, ...HlmMenuImports],
|
|
46
|
+
template: `
|
|
47
|
+
<hlm-menubar>
|
|
48
|
+
<button hlmMenubarTrigger [hlmMenubarTrigger]="fileMenu">File</button>
|
|
49
|
+
</hlm-menubar>
|
|
50
|
+
<ng-template #fileMenu>
|
|
51
|
+
<hlm-menu><button hlmMenuItem>New</button></hlm-menu>
|
|
52
|
+
</ng-template>
|
|
53
|
+
`,
|
|
54
|
+
})
|
|
55
|
+
export class DemoComponent {}
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
NgModule usage:
|
|
59
|
+
|
|
60
|
+
```ts
|
|
61
|
+
import { NgModule } from '@angular/core';
|
|
62
|
+
import { HlmMenubarModule } from '@egose/shadcn-theme-ng/menubar';
|
|
63
|
+
|
|
64
|
+
@NgModule({ imports: [HlmMenubarModule] })
|
|
65
|
+
export class DemoModule {}
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
For the `tw:` build, swap the specifier to `@egose/shadcn-theme-ng-tw/menubar`. Symbol names are identical.
|
|
69
|
+
|
|
70
|
+
## Anatomy / Structure
|
|
71
|
+
|
|
72
|
+
```html
|
|
73
|
+
<hlm-menubar>
|
|
74
|
+
<button hlmMenubarTrigger [hlmMenubarTrigger]="fileTpl">File</button>
|
|
75
|
+
<button hlmMenubarTrigger [hlmMenubarTrigger]="editTpl" [hlmMenubarTriggerData]="{ user: me }">Edit</button>
|
|
76
|
+
<button hlmMenubarTrigger [disabled]="locked()">View</button>
|
|
77
|
+
</hlm-menubar>
|
|
78
|
+
|
|
79
|
+
<ng-template #fileTpl>
|
|
80
|
+
<hlm-menu variant="menubar">
|
|
81
|
+
<button hlmMenuItem>New file</button>
|
|
82
|
+
<hlm-menu-separator />
|
|
83
|
+
<button hlmMenuItem variant="destructive">Delete</button>
|
|
84
|
+
</hlm-menu>
|
|
85
|
+
</ng-template>
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
| Class | Selector | Host requirements | Role |
|
|
89
|
+
| ------------------- | --------------------------- | ---------------------------------------- | --------------------------------------------------------------------------------------------- |
|
|
90
|
+
| `HlmMenubar` | `[hlmMenubar],hlm-menubar` | any element or the `hlm-menubar` element | Bar container (`CdkMenuBar` host directive, `data-slot="menubar"`) |
|
|
91
|
+
| `HlmMenubarTrigger` | `button[hlmMenubarTrigger]` | `<button>` only | Menu button (`CdkMenuItem` + `CdkMenuTrigger` host directives, `data-slot="menubar-trigger"`) |
|
|
92
|
+
|
|
93
|
+
The trigger wires two CDK inputs under shadcn aliases: `hlmMenubarTrigger` → `cdkMenuTriggerFor` (the template), `hlmMenubarTriggerData` → `cdkMenuTriggerData` (context passed to the template). It also re-emits `cdkMenuOpened`/`cdkMenuClosed` as `hlmDropdownMenuOpened`/`hlmDropdownMenuClosed` (names inherited from the dropdown-menu lineage — bind those names, not the `cdk*` ones).
|
|
94
|
+
|
|
95
|
+
## API reference
|
|
96
|
+
|
|
97
|
+
### `HlmMenubar` (`[hlmMenubar],hlm-menubar`)
|
|
98
|
+
|
|
99
|
+
No inputs/outputs/methods. Host directives: `CdkMenuBar`. Styling: `bg-background h-9 gap-1 rounded-md border p-1 shadow-xs flex items-center`.
|
|
100
|
+
|
|
101
|
+
### `HlmMenubarTrigger` (`button[hlmMenubarTrigger]`)
|
|
102
|
+
|
|
103
|
+
| Member | Kind | Type / Default | Notes |
|
|
104
|
+
| ----------------------- | ------------------ | -------------------------------------------------------- | --------------------------------------------------------------------------------------------------- |
|
|
105
|
+
| `disabled` | input | `boolean`, `false` (boolean coercion) | Forwarded to `CdkMenuItem` (`cdkMenuItemDisabled`); also sets host `[disabled]` and `data-disabled` |
|
|
106
|
+
| `align` | input | `MenuAlign`, default from `HlmMenubarConfig` (`'start'`) | Menu alignment; drives `menuPosition` via `createMenuPosition(align, side)` |
|
|
107
|
+
| `side` | input | `MenuSide`, default from config (`'bottom'`) | Menu side; drives `menuPosition` |
|
|
108
|
+
| `hlmMenubarTrigger` | input (CDK alias) | `Menu` template ref | `cdkMenuTriggerFor`: the popup template |
|
|
109
|
+
| `hlmMenubarTriggerData` | input (CDK alias) | `unknown` | `cdkMenuTriggerData`: context for the popup template |
|
|
110
|
+
| `hlmDropdownMenuOpened` | output (CDK alias) | `void` | Re-emits `cdkMenuOpened` |
|
|
111
|
+
| `hlmDropdownMenuClosed` | output (CDK alias) | `void` | Re-emits `cdkMenuClosed` |
|
|
112
|
+
|
|
113
|
+
The constructor sets the CDK `transformOriginSelector` to `'[data-slot="dropdown-menu"]'` and syncs `menuPosition` in an `effect`.
|
|
114
|
+
|
|
115
|
+
### `HlmMenubarConfig` + providers
|
|
116
|
+
|
|
117
|
+
| Symbol | Shape | Notes |
|
|
118
|
+
| --------------------------------- | ---------------------------------------------- | ---------------------------------------------------------------------- |
|
|
119
|
+
| `HlmMenubarConfig` | `{ align: MenuAlign; side: MenuSide }` | Defaults `{ align: 'start', side: 'bottom' }` |
|
|
120
|
+
| `provideHlmMenubarConfig(config)` | `(Partial<HlmMenubarConfig>) => ValueProvider` | Provide at component/root to change defaults for all triggers in scope |
|
|
121
|
+
| `injectHlmMenubarConfig()` | `() => HlmMenubarConfig` | Reads the token, falls back to defaults |
|
|
122
|
+
|
|
123
|
+
## Examples
|
|
124
|
+
|
|
125
|
+
### 1. Basic File/Edit bar
|
|
126
|
+
|
|
127
|
+
```ts
|
|
128
|
+
import { Component } from '@angular/core';
|
|
129
|
+
import { CdkMenuModule } from '@angular/cdk/menu';
|
|
130
|
+
import { HlmMenubarImports } from '@egose/shadcn-theme-ng/menubar';
|
|
131
|
+
import { HlmMenuImports } from '@egose/shadcn-theme-ng/menu';
|
|
132
|
+
|
|
133
|
+
@Component({
|
|
134
|
+
selector: 'app-menubar-basic',
|
|
135
|
+
standalone: true,
|
|
136
|
+
imports: [CdkMenuModule, ...HlmMenubarImports, ...HlmMenuImports],
|
|
137
|
+
template: `
|
|
138
|
+
<hlm-menubar>
|
|
139
|
+
<button hlmMenubarTrigger [hlmMenubarTrigger]="fileTpl">File</button>
|
|
140
|
+
<button hlmMenubarTrigger [hlmMenubarTrigger]="editTpl">Edit</button>
|
|
141
|
+
</hlm-menubar>
|
|
142
|
+
|
|
143
|
+
<ng-template #fileTpl>
|
|
144
|
+
<hlm-menu variant="menubar">
|
|
145
|
+
<button hlmMenuItem (cdkMenuItemTriggered)="onNew()">New file</button>
|
|
146
|
+
<button hlmMenuItem>Open…</button>
|
|
147
|
+
<hlm-menu-separator />
|
|
148
|
+
<button hlmMenuItem variant="destructive">Delete</button>
|
|
149
|
+
</hlm-menu>
|
|
150
|
+
</ng-template>
|
|
151
|
+
|
|
152
|
+
<ng-template #editTpl>
|
|
153
|
+
<hlm-menu variant="menubar">
|
|
154
|
+
<button hlmMenuItem>Undo</button>
|
|
155
|
+
<button hlmMenuItem>Redo</button>
|
|
156
|
+
</hlm-menu>
|
|
157
|
+
</ng-template>
|
|
158
|
+
`,
|
|
159
|
+
})
|
|
160
|
+
export class MenubarBasicComponent {
|
|
161
|
+
onNew(): void {
|
|
162
|
+
console.log('new file');
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
```html
|
|
168
|
+
<hlm-menubar>
|
|
169
|
+
<button hlmMenubarTrigger [hlmMenubarTrigger]="fileTpl">File</button>
|
|
170
|
+
<button hlmMenubarTrigger [hlmMenubarTrigger]="editTpl">Edit</button>
|
|
171
|
+
</hlm-menubar>
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
### 2. Disabled trigger + open/close events
|
|
175
|
+
|
|
176
|
+
```ts
|
|
177
|
+
import { Component, signal } from '@angular/core';
|
|
178
|
+
import { HlmMenubarImports } from '@egose/shadcn-theme-ng/menubar';
|
|
179
|
+
import { HlmMenuImports } from '@egose/shadcn-theme-ng/menu';
|
|
180
|
+
|
|
181
|
+
@Component({
|
|
182
|
+
selector: 'app-menubar-events',
|
|
183
|
+
standalone: true,
|
|
184
|
+
imports: [...HlmMenubarImports, ...HlmMenuImports],
|
|
185
|
+
template: `
|
|
186
|
+
<hlm-menubar>
|
|
187
|
+
<button
|
|
188
|
+
hlmMenubarTrigger
|
|
189
|
+
[hlmMenubarTrigger]="viewTpl"
|
|
190
|
+
[disabled]="locked()"
|
|
191
|
+
(hlmDropdownMenuOpened)="onOpen()"
|
|
192
|
+
(hlmDropdownMenuClosed)="onClose()"
|
|
193
|
+
>
|
|
194
|
+
View
|
|
195
|
+
</button>
|
|
196
|
+
</hlm-menubar>
|
|
197
|
+
|
|
198
|
+
<ng-template #viewTpl>
|
|
199
|
+
<hlm-menu variant="menubar">
|
|
200
|
+
<button hlmMenuItemCheckbox [cdkMenuItemChecked]="true">
|
|
201
|
+
<hlm-menu-item-check />
|
|
202
|
+
Show sidebar
|
|
203
|
+
</button>
|
|
204
|
+
</hlm-menu>
|
|
205
|
+
</ng-template>
|
|
206
|
+
|
|
207
|
+
<p class="tw:text-sm tw:text-muted-foreground">Menu is {{ open() ? 'open' : 'closed' }}.</p>
|
|
208
|
+
`,
|
|
209
|
+
})
|
|
210
|
+
export class MenubarEventsComponent {
|
|
211
|
+
readonly locked = signal(false);
|
|
212
|
+
readonly open = signal(false);
|
|
213
|
+
|
|
214
|
+
onOpen(): void {
|
|
215
|
+
this.open.set(true);
|
|
216
|
+
}
|
|
217
|
+
onClose(): void {
|
|
218
|
+
this.open.set(false);
|
|
219
|
+
}
|
|
220
|
+
}
|
|
11
221
|
```
|
|
222
|
+
|
|
223
|
+
### 3. Placement: align/side per trigger
|
|
224
|
+
|
|
225
|
+
```ts
|
|
226
|
+
import { Component } from '@angular/core';
|
|
227
|
+
import { HlmMenubarImports } from '@egose/shadcn-theme-ng/menubar';
|
|
228
|
+
import { HlmMenuImports } from '@egose/shadcn-theme-ng/menu';
|
|
229
|
+
|
|
230
|
+
@Component({
|
|
231
|
+
selector: 'app-menubar-placement',
|
|
232
|
+
standalone: true,
|
|
233
|
+
imports: [...HlmMenubarImports, ...HlmMenuImports],
|
|
234
|
+
template: `
|
|
235
|
+
<hlm-menubar>
|
|
236
|
+
<button hlmMenubarTrigger [hlmMenubarTrigger]="aTpl" align="start" side="bottom">Start/Bottom</button>
|
|
237
|
+
<button hlmMenubarTrigger [hlmMenubarTrigger]="bTpl" align="end" side="bottom">End/Bottom</button>
|
|
238
|
+
</hlm-menubar>
|
|
239
|
+
|
|
240
|
+
<ng-template #aTpl>
|
|
241
|
+
<hlm-menu variant="menubar"><button hlmMenuItem>Item A</button></hlm-menu>
|
|
242
|
+
</ng-template>
|
|
243
|
+
<ng-template #bTpl>
|
|
244
|
+
<hlm-menu variant="menubar"><button hlmMenuItem>Item B</button></hlm-menu>
|
|
245
|
+
</ng-template>
|
|
246
|
+
`,
|
|
247
|
+
})
|
|
248
|
+
export class MenubarPlacementComponent {}
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
### 4. Global defaults via `provideHlmMenubarConfig`
|
|
252
|
+
|
|
253
|
+
```ts
|
|
254
|
+
import { Component } from '@angular/core';
|
|
255
|
+
import { HlmMenubarImports, provideHlmMenubarConfig } from '@egose/shadcn-theme-ng/menubar';
|
|
256
|
+
import { HlmMenuImports } from '@egose/shadcn-theme-ng/menu';
|
|
257
|
+
|
|
258
|
+
@Component({
|
|
259
|
+
selector: 'app-menubar-config',
|
|
260
|
+
standalone: true,
|
|
261
|
+
imports: [...HlmMenubarImports, ...HlmMenuImports],
|
|
262
|
+
providers: [provideHlmMenubarConfig({ align: 'end', side: 'bottom' })],
|
|
263
|
+
template: `
|
|
264
|
+
<hlm-menubar>
|
|
265
|
+
<!-- inherits align=end from the provider; side can still be overridden per trigger -->
|
|
266
|
+
<button hlmMenubarTrigger [hlmMenubarTrigger]="tpl">File</button>
|
|
267
|
+
</hlm-menubar>
|
|
268
|
+
<ng-template #tpl>
|
|
269
|
+
<hlm-menu variant="menubar"><button hlmMenuItem>New</button></hlm-menu>
|
|
270
|
+
</ng-template>
|
|
271
|
+
`,
|
|
272
|
+
})
|
|
273
|
+
export class MenubarConfigComponent {}
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
### 5. Passing data into the menu template
|
|
277
|
+
|
|
278
|
+
```ts
|
|
279
|
+
import { Component, signal } from '@angular/core';
|
|
280
|
+
import { HlmMenubarImports } from '@egose/shadcn-theme-ng/menubar';
|
|
281
|
+
import { HlmMenuImports } from '@egose/shadcn-theme-ng/menu';
|
|
282
|
+
|
|
283
|
+
@Component({
|
|
284
|
+
selector: 'app-menubar-data',
|
|
285
|
+
standalone: true,
|
|
286
|
+
imports: [...HlmMenubarImports, ...HlmMenuImports],
|
|
287
|
+
template: `
|
|
288
|
+
<hlm-menubar>
|
|
289
|
+
<button hlmMenubarTrigger [hlmMenubarTrigger]="shareTpl" [hlmMenubarTriggerData]="{ file: file() }">Share</button>
|
|
290
|
+
</hlm-menubar>
|
|
291
|
+
|
|
292
|
+
<ng-template #shareTpl let-file="file">
|
|
293
|
+
<hlm-menu variant="menubar">
|
|
294
|
+
<hlm-menu-label>Share “{{ file }}”</hlm-menu-label>
|
|
295
|
+
<button hlmMenuItem>Email link</button>
|
|
296
|
+
<button hlmMenuItem>Copy link</button>
|
|
297
|
+
</hlm-menu>
|
|
298
|
+
</ng-template>
|
|
299
|
+
`,
|
|
300
|
+
})
|
|
301
|
+
export class MenubarDataComponent {
|
|
302
|
+
readonly file = signal('proposal.docx');
|
|
303
|
+
}
|
|
304
|
+
```
|
|
305
|
+
|
|
306
|
+
### 6. NgModule consumer + attribute selector form
|
|
307
|
+
|
|
308
|
+
```ts
|
|
309
|
+
import { NgModule, Component } from '@angular/core';
|
|
310
|
+
import { HlmMenubarModule } from '@egose/shadcn-theme-ng/menubar';
|
|
311
|
+
import { HlmMenuModule } from '@egose/shadcn-theme-ng/menu';
|
|
312
|
+
|
|
313
|
+
@Component({
|
|
314
|
+
selector: 'app-menubar-legacy',
|
|
315
|
+
template: `
|
|
316
|
+
<div hlmMenubar>
|
|
317
|
+
<button hlmMenubarTrigger [hlmMenubarTrigger]="tpl">File</button>
|
|
318
|
+
</div>
|
|
319
|
+
<ng-template #tpl>
|
|
320
|
+
<hlm-menu variant="menubar"><button hlmMenuItem>New</button></hlm-menu>
|
|
321
|
+
</ng-template>
|
|
322
|
+
`,
|
|
323
|
+
})
|
|
324
|
+
export class MenubarLegacyComponent {}
|
|
325
|
+
|
|
326
|
+
@NgModule({
|
|
327
|
+
declarations: [MenubarLegacyComponent],
|
|
328
|
+
imports: [HlmMenubarModule, HlmMenuModule],
|
|
329
|
+
exports: [MenubarLegacyComponent],
|
|
330
|
+
})
|
|
331
|
+
export class MenubarLegacyModule {}
|
|
332
|
+
```
|
|
333
|
+
|
|
334
|
+
## Accessibility notes
|
|
335
|
+
|
|
336
|
+
- `CdkMenuBar` provides the menubar role, roving tabindex across triggers, arrow-key movement, and `aria-expanded` on open triggers — keep triggers as real `<button>` elements inside the bar so the pattern holds.
|
|
337
|
+
- The trigger selector requires `<button>`; do not attach `hlmMenubarTrigger` to `<a>`/`<div>`.
|
|
338
|
+
- Disabled triggers expose `disabled` + `data-disabled` and are skipped by keyboard navigation.
|
|
339
|
+
- Popup content (`hlm-menu`) carries menu semantics; label open/close state changes if you add extra status text (see example 2) with `aria-live` where appropriate.
|
|
340
|
+
|
|
341
|
+
## Theming / CSS variables
|
|
342
|
+
|
|
343
|
+
No theming inputs. The bar uses `bg-background border shadow-xs`; triggers use `hover:bg-muted aria-expanded:bg-muted data-disabled:opacity-50`. Override placement globally with `provideHlmMenubarConfig`, per-trigger with `align`/`side`.
|
|
344
|
+
|
|
345
|
+
## Related subpaths
|
|
346
|
+
|
|
347
|
+
- `@egose/shadcn-theme-ng/menu` (`HlmMenu`, `HlmMenuItem`, …) — popup surfaces and rows for menubar templates.
|
|
348
|
+
- `@egose/shadcn-theme-ng/dropdown-menu` — alternative trigger/menu pair when you need a single button menu instead of a bar.
|
|
349
|
+
- `@egose/shadcn-theme-ng/navigation-menu` — site-navigation pattern (links + content panels) vs the menubar's action-menu pattern.
|
|
@@ -7,12 +7,12 @@ import { createMenuPosition, MENU_SIDE } from '@spartan-ng/brain/core';
|
|
|
7
7
|
|
|
8
8
|
class HlmMenubar {
|
|
9
9
|
constructor() {
|
|
10
|
-
classes(() => 'bg-background h-9 gap-1 rounded-md border p-1 shadow-xs flex items-center');
|
|
10
|
+
classes(() => 'tw:bg-background tw:h-9 tw:gap-1 tw:rounded-md tw:border tw:p-1 tw:shadow-xs tw:flex tw:items-center');
|
|
11
11
|
}
|
|
12
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.
|
|
13
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.
|
|
12
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmMenubar, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
13
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.1.3", type: HlmMenubar, isStandalone: true, selector: "[hlmMenubar],hlm-menubar", host: { attributes: { "data-slot": "menubar" } }, hostDirectives: [{ directive: i1.CdkMenuBar }], ngImport: i0 });
|
|
14
14
|
}
|
|
15
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.
|
|
15
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmMenubar, decorators: [{
|
|
16
16
|
type: Directive,
|
|
17
17
|
args: [{
|
|
18
18
|
selector: '[hlmMenubar],hlm-menubar',
|
|
@@ -54,12 +54,12 @@ class HlmMenubarTrigger {
|
|
|
54
54
|
effect(() => {
|
|
55
55
|
this._cdkTrigger.menuPosition = this._menuPosition();
|
|
56
56
|
});
|
|
57
|
-
classes(() => 'hover:bg-muted aria-expanded:bg-muted rounded-sm px-2 py-1 text-sm font-medium flex items-center outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50');
|
|
57
|
+
classes(() => 'tw:hover:bg-muted tw:aria-expanded:bg-muted tw:rounded-sm tw:px-2 tw:py-1 tw:text-sm tw:font-medium tw:flex tw:items-center tw:outline-hidden tw:select-none tw:data-disabled:pointer-events-none tw:data-disabled:opacity-50');
|
|
58
58
|
}
|
|
59
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.
|
|
60
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.
|
|
59
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmMenubarTrigger, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
60
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.3", type: HlmMenubarTrigger, isStandalone: true, selector: "button[hlmMenubarTrigger]", inputs: { disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, align: { classPropertyName: "align", publicName: "align", isSignal: true, isRequired: false, transformFunction: null }, side: { classPropertyName: "side", publicName: "side", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "data-slot": "menubar-trigger" }, properties: { "disabled": "disabled() ", "attr.data-disabled": "disabled() ? \"\" : null" } }, providers: [{ provide: MENU_SIDE, useExisting: forwardRef(() => HlmMenubarTrigger) }], hostDirectives: [{ directive: i1.CdkMenuItem, inputs: ["cdkMenuItemDisabled", "disabled"] }, { directive: i1.CdkMenuTrigger, inputs: ["cdkMenuTriggerFor", "hlmMenubarTrigger", "cdkMenuTriggerData", "hlmMenubarTriggerData"], outputs: ["cdkMenuOpened", "hlmDropdownMenuOpened", "cdkMenuClosed", "hlmDropdownMenuClosed"] }], ngImport: i0 });
|
|
61
61
|
}
|
|
62
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.
|
|
62
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmMenubarTrigger, decorators: [{
|
|
63
63
|
type: Directive,
|
|
64
64
|
args: [{
|
|
65
65
|
selector: 'button[hlmMenubarTrigger]',
|
|
@@ -88,11 +88,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImpor
|
|
|
88
88
|
*/
|
|
89
89
|
const HlmMenubarImports = [HlmMenubar, HlmMenubarTrigger];
|
|
90
90
|
class HlmMenubarModule {
|
|
91
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.
|
|
92
|
-
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "22.
|
|
93
|
-
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "22.
|
|
91
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmMenubarModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
92
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "22.1.3", ngImport: i0, type: HlmMenubarModule, imports: [HlmMenubar, HlmMenubarTrigger], exports: [HlmMenubar, HlmMenubarTrigger] });
|
|
93
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmMenubarModule });
|
|
94
94
|
}
|
|
95
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.
|
|
95
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: HlmMenubarModule, decorators: [{
|
|
96
96
|
type: NgModule,
|
|
97
97
|
args: [{
|
|
98
98
|
imports: [...HlmMenubarImports],
|
|
@@ -105,4 +105,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImpor
|
|
|
105
105
|
*/
|
|
106
106
|
|
|
107
107
|
export { HlmMenubar, HlmMenubarImports, HlmMenubarModule, HlmMenubarTrigger, injectHlmMenubarConfig, provideHlmMenubarConfig };
|
|
108
|
-
|
|
108
|
+
|