@zazz-ui/core 0.4.1 → 0.5.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/AUTHORING.md +158 -0
- package/CHANGELOG.md +331 -0
- package/README.md +55 -23
- package/dist/scroll-state-C8mA5gq6.js +1 -0
- package/dist/sri.json +124 -72
- package/dist/zazz.css +1 -1
- package/dist/zazz.js +1 -1
- package/editor/zazz.css-data.json +116794 -0
- package/editor/zazz.html-data.json +1683 -0
- package/editor/zazz.language-data.json +5001 -0
- package/editor/zazz.lint-data.json +152 -0
- package/package.json +12 -5
- package/src/base/_breakpoints.css +12 -0
- package/src/base/_layers.css +8 -9
- package/src/base/_properties-2xl.css +171 -0
- package/src/base/_properties-active.css +107 -0
- package/src/base/_properties-checked.css +107 -0
- package/src/base/_properties-current.css +107 -0
- package/src/base/_properties-disabled.css +107 -0
- package/src/base/_properties-focus-visible.css +107 -0
- package/src/base/_properties-focus-within.css +107 -0
- package/src/base/_properties-hover.css +107 -0
- package/src/base/_properties-lg.css +171 -0
- package/src/base/_properties-md.css +171 -0
- package/src/base/_properties-open.css +107 -0
- package/src/base/_properties-sm.css +171 -0
- package/src/base/_properties-starting.css +55 -0
- package/src/base/_properties-stuck.css +55 -0
- package/src/base/_properties-xl.css +171 -0
- package/src/base/_properties.css +555 -0
- package/src/base/_reset.css +67 -75
- package/src/base/_switches.css +145 -0
- package/src/base/_typography.css +437 -370
- package/src/base/_utilities-box.css +142 -0
- package/src/base/_utilities-color.css +290 -0
- package/src/base/_utilities-effects.css +235 -0
- package/src/base/_utilities-flow.css +312 -0
- package/src/base/_utilities-grid.css +143 -0
- package/src/base/_utilities-margin.css +376 -0
- package/src/base/_utilities-pseudo.css +426 -0
- package/src/base/_utilities-sizing.css +259 -0
- package/src/base/_utilities-spacing.css +190 -0
- package/src/base/_utilities-tier-2xl.css +93 -0
- package/src/base/_utilities-tier-active.css +61 -0
- package/src/base/_utilities-tier-checked.css +61 -0
- package/src/base/_utilities-tier-current.css +61 -0
- package/src/base/_utilities-tier-disabled.css +61 -0
- package/src/base/_utilities-tier-focus-visible.css +61 -0
- package/src/base/_utilities-tier-focus-within.css +61 -0
- package/src/base/_utilities-tier-hover.css +63 -0
- package/src/base/_utilities-tier-lg.css +93 -0
- package/src/base/_utilities-tier-md.css +93 -0
- package/src/base/_utilities-tier-open.css +61 -0
- package/src/base/_utilities-tier-sm.css +93 -0
- package/src/base/_utilities-tier-starting.css +35 -0
- package/src/base/_utilities-tier-stuck.css +114 -0
- package/src/base/_utilities-tier-xl.css +93 -0
- package/src/base/_utilities-typography.css +141 -0
- package/src/base/_variables.css +323 -372
- package/src/base/_view-transitions.css +10 -12
- package/src/base/command-score.d.ts.map +1 -1
- package/src/base/command-score.js +1 -2
- package/src/base/command-score.ts +1 -2
- package/src/base/dialog-lifecycle.js +1 -1
- package/src/base/dialog-lifecycle.ts +1 -1
- package/src/base/embla.d.ts +6 -7
- package/src/base/embla.d.ts.map +1 -1
- package/src/base/embla.js +89 -55
- package/src/base/embla.ts +89 -55
- package/src/base/hotkeys.d.ts +0 -5
- package/src/base/hotkeys.d.ts.map +1 -1
- package/src/base/hotkeys.ts +0 -5
- package/src/base/navigation.d.ts +12 -1
- package/src/base/navigation.d.ts.map +1 -1
- package/src/base/navigation.js +229 -86
- package/src/base/navigation.ts +224 -92
- package/src/base/reveal.js +14 -14
- package/src/base/reveal.ts +14 -14
- package/src/base/scroll-state.d.ts +21 -0
- package/src/base/scroll-state.d.ts.map +1 -0
- package/src/base/scroll-state.js +177 -0
- package/src/base/scroll-state.ts +188 -0
- package/src/base/signals.d.ts +1 -2
- package/src/base/signals.d.ts.map +1 -1
- package/src/base/signals.js +4 -6
- package/src/base/signals.ts +4 -6
- package/src/base/style-format.d.ts +33 -0
- package/src/base/style-format.d.ts.map +1 -0
- package/src/base/style-format.js +160 -0
- package/src/base/style-format.ts +180 -0
- package/src/base/typeahead.d.ts +19 -4
- package/src/base/typeahead.d.ts.map +1 -1
- package/src/base/typeahead.js +68 -21
- package/src/base/typeahead.ts +73 -23
- package/src/base/utilities.d.ts +188 -0
- package/src/base/utilities.d.ts.map +1 -0
- package/src/base/utilities.js +750 -0
- package/src/base/utilities.ts +865 -0
- package/src/base/utils.d.ts +3 -7
- package/src/base/utils.d.ts.map +1 -1
- package/src/base/utils.js +4 -8
- package/src/base/utils.ts +4 -8
- package/src/base/zazz-element.d.ts +14 -8
- package/src/base/zazz-element.d.ts.map +1 -1
- package/src/base/zazz-element.js +14 -8
- package/src/base/zazz-element.ts +15 -8
- package/src/globals.d.ts +1 -1
- package/src/head.d.ts +50 -4
- package/src/head.d.ts.map +1 -1
- package/src/head.js +119 -38
- package/src/head.ts +172 -41
- package/src/index.css +57 -14
- package/src/index.js +5 -0
- package/src/index.ts +6 -0
- package/src/manifest.d.ts +36 -5
- package/src/manifest.d.ts.map +1 -1
- package/src/manifest.js +150 -6
- package/src/manifest.ts +167 -9
- package/src/primitives/accordion/accordion.css +18 -17
- package/src/primitives/accordion/accordion.html +42 -9
- package/src/primitives/alert-dialog/alert-dialog.css +13 -13
- package/src/primitives/alert-dialog/alert-dialog.html +26 -12
- package/src/primitives/autocomplete/autocomplete-groups.html +64 -33
- package/src/primitives/autocomplete/autocomplete.css +43 -39
- package/src/primitives/autocomplete/autocomplete.d.ts +6 -5
- package/src/primitives/autocomplete/autocomplete.d.ts.map +1 -1
- package/src/primitives/autocomplete/autocomplete.html +38 -26
- package/src/primitives/autocomplete/autocomplete.js +6 -5
- package/src/primitives/autocomplete/autocomplete.ts +6 -5
- package/src/primitives/avatar/avatar.html +110 -15
- package/src/primitives/badge/badge-icon.html +22 -8
- package/src/primitives/badge/badge.css +401 -128
- package/src/primitives/badge/badge.html +12 -6
- package/src/primitives/breadcrumbs/breadcrumbs.html +25 -5
- package/src/primitives/button/button-icon-only.html +17 -11
- package/src/primitives/button/button-icon.html +9 -3
- package/src/primitives/button/button.css +408 -164
- package/src/primitives/button/button.html +14 -7
- package/src/primitives/button-group/button-group-vertical.html +5 -5
- package/src/primitives/button-group/button-group.css +53 -25
- package/src/primitives/button-group/button-group.html +18 -12
- package/src/primitives/callout/callout.css +114 -0
- package/src/primitives/callout/callout.html +188 -0
- package/src/primitives/card/card-subgrid.html +249 -34
- package/src/primitives/card/card.css +125 -0
- package/src/primitives/card/card.html +141 -20
- package/src/primitives/carousel/carousel.css +30 -20
- package/src/primitives/carousel/carousel.d.ts +7 -10
- package/src/primitives/carousel/carousel.d.ts.map +1 -1
- package/src/primitives/carousel/carousel.html +420 -84
- package/src/primitives/carousel/carousel.js +1 -1
- package/src/primitives/carousel/carousel.ts +8 -11
- package/src/primitives/checkbox/checkbox-tasklist.html +6 -6
- package/src/primitives/checkbox/checkbox.css +98 -40
- package/src/primitives/checkbox/checkbox.d.ts.map +1 -1
- package/src/primitives/checkbox/checkbox.html +13 -8
- package/src/primitives/checkbox/checkbox.js +7 -9
- package/src/primitives/checkbox/checkbox.ts +7 -15
- package/src/primitives/combobox/combobox-multiselect.html +53 -33
- package/src/primitives/combobox/combobox.css +145 -122
- package/src/primitives/combobox/combobox.d.ts +12 -11
- package/src/primitives/combobox/combobox.d.ts.map +1 -1
- package/src/primitives/combobox/combobox.html +48 -28
- package/src/primitives/combobox/combobox.js +46 -51
- package/src/primitives/combobox/combobox.ts +48 -55
- package/src/primitives/command/command-actions.d.ts +2 -3
- package/src/primitives/command/command-actions.d.ts.map +1 -1
- package/src/primitives/command/command-actions.html +48 -33
- package/src/primitives/command/command-actions.js +12 -10
- package/src/primitives/command/command-actions.ts +12 -13
- package/src/primitives/command/command-dialog.html +49 -25
- package/src/primitives/command/command.css +52 -42
- package/src/primitives/command/command.d.ts +10 -7
- package/src/primitives/command/command.d.ts.map +1 -1
- package/src/primitives/command/command.html +95 -46
- package/src/primitives/command/command.js +30 -13
- package/src/primitives/command/command.ts +30 -12
- package/src/primitives/debug/audit-core.d.ts +64 -0
- package/src/primitives/debug/audit-core.d.ts.map +1 -0
- package/src/primitives/debug/audit-core.js +356 -0
- package/src/primitives/debug/audit-core.ts +535 -0
- package/src/primitives/debug/debug.d.ts +50 -0
- package/src/primitives/debug/debug.d.ts.map +1 -0
- package/src/primitives/debug/debug.js +168 -0
- package/src/primitives/debug/debug.ts +211 -0
- package/src/primitives/dialog/dialog-with-form.html +67 -45
- package/src/primitives/dialog/dialog.css +87 -61
- package/src/primitives/dialog/dialog.html +25 -17
- package/src/primitives/fields/fields.css +108 -134
- package/src/primitives/fields/fields.html +39 -0
- package/src/primitives/input/input-icon-leading.html +3 -3
- package/src/primitives/input/input-icon-trailing.html +3 -3
- package/src/primitives/input/input.css +87 -49
- package/src/primitives/input/input.html +15 -15
- package/src/primitives/input-group/input-group-password-group.html +15 -15
- package/src/primitives/input-group/input-group.css +118 -75
- package/src/primitives/input-group/input-group.html +42 -30
- package/src/primitives/kbd/kbd-group.html +15 -2
- package/src/primitives/kbd/kbd.css +44 -31
- package/src/primitives/kbd/kbd.html +7 -1
- package/src/primitives/layout/layout.css +159 -0
- package/src/primitives/layout/layout.html +35 -0
- package/src/primitives/lightbox/lightbox.css +178 -105
- package/src/primitives/lightbox/lightbox.d.ts.map +1 -1
- package/src/primitives/lightbox/lightbox.html +138 -166
- package/src/primitives/lightbox/lightbox.js +10 -13
- package/src/primitives/lightbox/lightbox.ts +12 -13
- package/src/primitives/menu/menu-interest.html +60 -18
- package/src/primitives/menu/menu.css +22 -17
- package/src/primitives/menu/menu.d.ts +5 -5
- package/src/primitives/menu/menu.html +195 -40
- package/src/primitives/menu/menu.js +8 -8
- package/src/primitives/menu/menu.ts +8 -8
- package/src/primitives/menubar/menubar-help-search.html +78 -32
- package/src/primitives/menubar/menubar.html +166 -38
- package/src/primitives/meter/meter.css +41 -38
- package/src/primitives/meter/meter.html +44 -9
- package/src/primitives/mobile-menu/mobile-menu.css +47 -40
- package/src/primitives/mobile-menu/mobile-menu.html +1460 -179
- package/src/primitives/navigation-menu/navigation-menu-featured.html +155 -33
- package/src/primitives/navigation-menu/navigation-menu-icon-grid.html +222 -47
- package/src/primitives/navigation-menu/navigation-menu-interest.html +130 -38
- package/src/primitives/navigation-menu/navigation-menu-megamenu.html +402 -72
- package/src/primitives/navigation-menu/navigation-menu-simple.html +90 -40
- package/src/primitives/navigation-menu/navigation-menu.css +104 -106
- package/src/primitives/navigation-menu/navigation-menu.html +554 -158
- package/src/primitives/otp/otp.css +43 -44
- package/src/primitives/otp/otp.d.ts +4 -5
- package/src/primitives/otp/otp.d.ts.map +1 -1
- package/src/primitives/otp/otp.html +7 -6
- package/src/primitives/otp/otp.js +13 -18
- package/src/primitives/otp/otp.ts +12 -19
- package/src/primitives/password-group/password-group.css +132 -107
- package/src/primitives/password-group/password-group.d.ts.map +1 -1
- package/src/primitives/password-group/password-group.html +23 -16
- package/src/primitives/password-group/password-group.js +11 -12
- package/src/primitives/password-group/password-group.ts +11 -12
- package/src/primitives/popover/popover.css +88 -95
- package/src/primitives/popover/popover.html +18 -0
- package/src/primitives/progress/progress-indeterminate.html +1 -1
- package/src/primitives/progress/progress.css +34 -35
- package/src/primitives/progress/progress.html +18 -4
- package/src/primitives/prose/prose.html +19 -12
- package/src/primitives/radio/radio.css +83 -46
- package/src/primitives/radio/radio.html +16 -11
- package/src/primitives/reveal/reveal.css +37 -46
- package/src/primitives/reveal/reveal.html +15 -0
- package/src/primitives/scroll-fade/scroll-fade.css +115 -0
- package/src/primitives/scroll-fade/scroll-fade.html +69 -0
- package/src/primitives/select/multiselect.d.ts +8 -10
- package/src/primitives/select/multiselect.d.ts.map +1 -1
- package/src/primitives/select/multiselect.js +23 -27
- package/src/primitives/select/multiselect.ts +23 -29
- package/src/primitives/select/select-align.html +79 -16
- package/src/primitives/select/select-multiple.html +8 -4
- package/src/primitives/select/select-sides.html +104 -21
- package/src/primitives/select/select.css +297 -186
- package/src/primitives/select/select.html +24 -5
- package/src/primitives/separator/separator.css +15 -18
- package/src/primitives/separator/separator.html +37 -10
- package/src/primitives/slider/slider.css +48 -38
- package/src/primitives/slider/slider.html +9 -1
- package/src/primitives/style-guard/style-guard.d.ts +19 -0
- package/src/primitives/style-guard/style-guard.d.ts.map +1 -0
- package/src/primitives/style-guard/style-guard.js +125 -0
- package/src/primitives/style-guard/style-guard.ts +153 -0
- package/src/primitives/switch/switch.css +42 -33
- package/src/primitives/switch/switch.html +11 -6
- package/src/primitives/table/table-alternating.html +1 -1
- package/src/primitives/table/table-grid.html +5 -5
- package/src/primitives/table/table-size-sm.html +1 -1
- package/src/primitives/table/table.css +64 -61
- package/src/primitives/table/table.html +7 -7
- package/src/primitives/tabs/tabs.css +167 -166
- package/src/primitives/tabs/tabs.d.ts +10 -11
- package/src/primitives/tabs/tabs.d.ts.map +1 -1
- package/src/primitives/tabs/tabs.html +192 -36
- package/src/primitives/tabs/tabs.js +14 -15
- package/src/primitives/tabs/tabs.ts +14 -15
- package/src/primitives/textarea/textarea.css +69 -44
- package/src/primitives/textarea/textarea.html +3 -3
- package/src/primitives/toaster/toaster.css +90 -92
- package/src/primitives/toaster/toaster.d.ts +0 -6
- package/src/primitives/toaster/toaster.d.ts.map +1 -1
- package/src/primitives/toaster/toaster.html +22 -18
- package/src/primitives/toaster/toaster.js +64 -72
- package/src/primitives/toaster/toaster.ts +71 -87
- package/src/primitives/toggle/toggle.css +368 -153
- package/src/primitives/toggle/toggle.html +27 -9
- package/src/primitives/toggle-group/toggle-group-multiple.html +3 -3
- package/src/primitives/toggle-group/toggle-group-vertical.html +4 -4
- package/src/primitives/toggle-group/toggle-group.css +71 -23
- package/src/primitives/toggle-group/toggle-group.html +3 -3
- package/src/primitives/toolbar/toolbar.html +35 -13
- package/src/primitives/tooltip/tooltip-disabled.html +3 -3
- package/src/primitives/tooltip/tooltip-sides.html +36 -14
- package/src/primitives/tooltip/tooltip-with-kbd.html +5 -5
- package/src/primitives/tooltip/tooltip.css +111 -80
- package/src/primitives/tooltip/tooltip.html +3 -3
- package/src/primitives/utilities/aspect-ratio.html +51 -7
- package/src/primitives/utilities/basis.html +64 -11
- package/src/primitives/utilities/col-span.html +65 -9
- package/src/primitives/utilities/compose.html +48 -10
- package/src/primitives/utilities/flex-align.html +89 -19
- package/src/primitives/utilities/flex-direction.html +111 -13
- package/src/primitives/utilities/flex-grow.html +41 -7
- package/src/primitives/utilities/gap.html +158 -19
- package/src/primitives/utilities/grid-cols.html +75 -7
- package/src/primitives/utilities/grid-responsive.html +111 -12
- package/src/primitives/utilities/margin-auto.html +38 -7
- package/src/primitives/utilities/object-fit.html +75 -13
- package/src/primitives/utilities/order.html +40 -4
- package/src/primitives/utilities/overflow.html +74 -20
- package/src/primitives/utilities/padding-compose.html +67 -10
- package/src/primitives/utilities/padding.html +84 -13
- package/src/primitives/utilities/pile.html +29 -0
- package/src/primitives/utilities/position.html +65 -8
- package/src/primitives/utilities/responsive-flex.html +54 -7
- package/src/primitives/utilities/responsive-grid.html +115 -12
- package/src/primitives/utilities/size.html +120 -16
- package/src/primitives/utilities/width.html +123 -16
- package/examples/about.html +0 -583
- package/examples/components.html +0 -1028
- package/examples/forms.html +0 -504
- package/examples/index.html +0 -261
- package/examples/layout.html +0 -313
- package/examples/products.html +0 -839
- package/examples/responsive.html +0 -332
- package/src/base/_layout.css +0 -571
- package/src/base/_utilities.css +0 -6758
- package/src/primitives/utilities/grid-pile.html +0 -5
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* @fileoverview `<ui-menu>`: HTML web component for keyboard-enhanced menus.
|
|
4
4
|
* @description Light-DOM custom element that augments the CSS-only menu
|
|
5
|
-
* pattern (trigger + anchored `[data-slot~="
|
|
6
|
-
* arrow-key navigation. The
|
|
5
|
+
* pattern (trigger + anchored `[data-menu-slot~="popover"]` panel) with
|
|
6
|
+
* arrow-key navigation. The attribute form `[data-ui~="menu"]` stays fully functional
|
|
7
7
|
* without JavaScript: the Popover API provides open/close, light dismiss,
|
|
8
8
|
* and focus return on its own.
|
|
9
9
|
*
|
|
@@ -22,10 +22,10 @@
|
|
|
22
22
|
*
|
|
23
23
|
* @example
|
|
24
24
|
* <ui-menu>
|
|
25
|
-
* <button
|
|
26
|
-
* <div id="m1" data-slot="
|
|
25
|
+
* <button data-ui="button" type="button" popovertarget="m1">Open</button>
|
|
26
|
+
* <div id="m1" data-menu-slot="popover" popover="auto">
|
|
27
27
|
* <menu>
|
|
28
|
-
* <li><a href="/docs"
|
|
28
|
+
* <li><a href="/docs" data-ui="button" data-button-variant="ghost" style="--justify: start">Docs</a></li>
|
|
29
29
|
* </menu>
|
|
30
30
|
* </div>
|
|
31
31
|
* </ui-menu>
|
|
@@ -42,7 +42,7 @@ class UiMenu extends ZazzElement {
|
|
|
42
42
|
* @returns The panel element, or null when the markup is incomplete.
|
|
43
43
|
*/
|
|
44
44
|
#panel() {
|
|
45
|
-
const panel = this.querySelector(':scope > [data-slot~="
|
|
45
|
+
const panel = this.querySelector(':scope > [data-menu-slot~="popover"]');
|
|
46
46
|
return panel instanceof HTMLElement ? panel : null;
|
|
47
47
|
}
|
|
48
48
|
/**
|
|
@@ -56,7 +56,7 @@ class UiMenu extends ZazzElement {
|
|
|
56
56
|
.filter((node) => node instanceof HTMLElement)
|
|
57
57
|
.filter((item) => !item.hasAttribute("disabled") &&
|
|
58
58
|
item.getAttribute("aria-disabled") !== "true" &&
|
|
59
|
-
item.closest(
|
|
59
|
+
item.closest('ui-menu, [data-ui~="menu"]') === this);
|
|
60
60
|
}
|
|
61
61
|
/**
|
|
62
62
|
* @description Routes arrow-key, Home, and End presses: opens the panel from
|
|
@@ -71,7 +71,7 @@ class UiMenu extends ZazzElement {
|
|
|
71
71
|
if (!(target instanceof HTMLElement))
|
|
72
72
|
return;
|
|
73
73
|
// Ignore keys that belong to a nested ui-menu
|
|
74
|
-
if (target.closest(
|
|
74
|
+
if (target.closest('ui-menu, [data-ui~="menu"]') !== this)
|
|
75
75
|
return;
|
|
76
76
|
const panel = this.#panel();
|
|
77
77
|
if (!panel)
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
/**
|
|
4
4
|
* @fileoverview `<ui-menu>`: HTML web component for keyboard-enhanced menus.
|
|
5
5
|
* @description Light-DOM custom element that augments the CSS-only menu
|
|
6
|
-
* pattern (trigger + anchored `[data-slot~="
|
|
7
|
-
* arrow-key navigation. The
|
|
6
|
+
* pattern (trigger + anchored `[data-menu-slot~="popover"]` panel) with
|
|
7
|
+
* arrow-key navigation. The attribute form `[data-ui~="menu"]` stays fully functional
|
|
8
8
|
* without JavaScript: the Popover API provides open/close, light dismiss,
|
|
9
9
|
* and focus return on its own.
|
|
10
10
|
*
|
|
@@ -23,10 +23,10 @@
|
|
|
23
23
|
*
|
|
24
24
|
* @example
|
|
25
25
|
* <ui-menu>
|
|
26
|
-
* <button
|
|
27
|
-
* <div id="m1" data-slot="
|
|
26
|
+
* <button data-ui="button" type="button" popovertarget="m1">Open</button>
|
|
27
|
+
* <div id="m1" data-menu-slot="popover" popover="auto">
|
|
28
28
|
* <menu>
|
|
29
|
-
* <li><a href="/docs"
|
|
29
|
+
* <li><a href="/docs" data-ui="button" data-button-variant="ghost" style="--justify: start">Docs</a></li>
|
|
30
30
|
* </menu>
|
|
31
31
|
* </div>
|
|
32
32
|
* </ui-menu>
|
|
@@ -46,7 +46,7 @@ class UiMenu extends ZazzElement {
|
|
|
46
46
|
* @returns The panel element, or null when the markup is incomplete.
|
|
47
47
|
*/
|
|
48
48
|
#panel(): HTMLElement | null {
|
|
49
|
-
const panel = this.querySelector(':scope > [data-slot~="
|
|
49
|
+
const panel = this.querySelector(':scope > [data-menu-slot~="popover"]');
|
|
50
50
|
return panel instanceof HTMLElement ? panel : null;
|
|
51
51
|
}
|
|
52
52
|
|
|
@@ -63,7 +63,7 @@ class UiMenu extends ZazzElement {
|
|
|
63
63
|
(item) =>
|
|
64
64
|
!item.hasAttribute("disabled") &&
|
|
65
65
|
item.getAttribute("aria-disabled") !== "true" &&
|
|
66
|
-
item.closest(
|
|
66
|
+
item.closest('ui-menu, [data-ui~="menu"]') === this,
|
|
67
67
|
);
|
|
68
68
|
}
|
|
69
69
|
|
|
@@ -79,7 +79,7 @@ class UiMenu extends ZazzElement {
|
|
|
79
79
|
const target = event.target;
|
|
80
80
|
if (!(target instanceof HTMLElement)) return;
|
|
81
81
|
// Ignore keys that belong to a nested ui-menu
|
|
82
|
-
if (target.closest(
|
|
82
|
+
if (target.closest('ui-menu, [data-ui~="menu"]') !== this) return;
|
|
83
83
|
|
|
84
84
|
const panel = this.#panel();
|
|
85
85
|
if (!panel) return;
|
|
@@ -1,8 +1,19 @@
|
|
|
1
|
-
<div
|
|
1
|
+
<div
|
|
2
|
+
aria-label="Application menu"
|
|
3
|
+
style="
|
|
4
|
+
--display: flex;
|
|
5
|
+
--items: center;
|
|
6
|
+
--p: 2;
|
|
7
|
+
--gap: 1px;
|
|
8
|
+
--w: 100%;
|
|
9
|
+
--bg: var(--color-card);
|
|
10
|
+
--border-b: 1;
|
|
11
|
+
"
|
|
12
|
+
>
|
|
2
13
|
<ui-menu>
|
|
3
14
|
<button
|
|
4
|
-
|
|
5
|
-
data-variant="ghost"
|
|
15
|
+
data-ui="button"
|
|
16
|
+
data-button-variant="ghost"
|
|
6
17
|
type="button"
|
|
7
18
|
popovertarget="menubar-search-file"
|
|
8
19
|
interestfor="menubar-search-file"
|
|
@@ -11,19 +22,31 @@
|
|
|
11
22
|
</button>
|
|
12
23
|
<div
|
|
13
24
|
id="menubar-search-file"
|
|
14
|
-
data-slot="
|
|
15
|
-
data-side="bottom"
|
|
16
|
-
data-align="start"
|
|
25
|
+
data-menu-slot="popover"
|
|
26
|
+
data-popover-side="bottom"
|
|
27
|
+
data-popover-align="start"
|
|
17
28
|
popover="auto"
|
|
18
29
|
>
|
|
19
30
|
<menu>
|
|
20
31
|
<li>
|
|
21
|
-
<button
|
|
32
|
+
<button
|
|
33
|
+
data-ui="button"
|
|
34
|
+
data-button-variant="ghost"
|
|
35
|
+
type="button"
|
|
36
|
+
style="--justify: start"
|
|
37
|
+
>
|
|
22
38
|
New window
|
|
23
39
|
</button>
|
|
24
40
|
</li>
|
|
25
41
|
<li>
|
|
26
|
-
<button
|
|
42
|
+
<button
|
|
43
|
+
data-ui="button"
|
|
44
|
+
data-button-variant="ghost"
|
|
45
|
+
type="button"
|
|
46
|
+
style="--justify: start"
|
|
47
|
+
>
|
|
48
|
+
Open…
|
|
49
|
+
</button>
|
|
27
50
|
</li>
|
|
28
51
|
</menu>
|
|
29
52
|
</div>
|
|
@@ -31,8 +54,8 @@
|
|
|
31
54
|
|
|
32
55
|
<ui-menu>
|
|
33
56
|
<button
|
|
34
|
-
|
|
35
|
-
data-variant="ghost"
|
|
57
|
+
data-ui="button"
|
|
58
|
+
data-button-variant="ghost"
|
|
36
59
|
type="button"
|
|
37
60
|
popovertarget="menubar-search-help"
|
|
38
61
|
interestfor="menubar-search-help"
|
|
@@ -41,18 +64,36 @@
|
|
|
41
64
|
</button>
|
|
42
65
|
<div
|
|
43
66
|
id="menubar-search-help"
|
|
44
|
-
data-slot="
|
|
45
|
-
data-side="bottom"
|
|
46
|
-
data-align="start"
|
|
67
|
+
data-menu-slot="popover"
|
|
68
|
+
data-popover-side="bottom"
|
|
69
|
+
data-popover-align="start"
|
|
47
70
|
popover="auto"
|
|
48
71
|
>
|
|
49
|
-
<div
|
|
50
|
-
|
|
72
|
+
<div
|
|
73
|
+
style="
|
|
74
|
+
--display: flex-col;
|
|
75
|
+
--p: 2;
|
|
76
|
+
--gap: 2;
|
|
77
|
+
--min-w: 20rem;
|
|
78
|
+
"
|
|
79
|
+
>
|
|
80
|
+
<label
|
|
81
|
+
for="menubar-help-topic"
|
|
82
|
+
style="
|
|
83
|
+
--display: inline-flex;
|
|
84
|
+
--font-size: var(--font-size-eyebrow);
|
|
85
|
+
--font-weight: strong;
|
|
86
|
+
--font-weight: var(--font-weight-eyebrow);
|
|
87
|
+
--leading: var(--leading-eyebrow);
|
|
88
|
+
--tracking: var(--tracking-eyebrow);
|
|
89
|
+
--text-transform: uppercase;
|
|
90
|
+
--text: var(--color-muted-foreground);
|
|
91
|
+
"
|
|
51
92
|
>Search help topics</label
|
|
52
93
|
>
|
|
53
94
|
<ui-combobox>
|
|
54
|
-
<input type="hidden" name="help-topic" data-slot="
|
|
55
|
-
<div data-slot="
|
|
95
|
+
<input type="hidden" name="help-topic" data-combobox-slot="value" value="" />
|
|
96
|
+
<div data-combobox-slot="control">
|
|
56
97
|
<input
|
|
57
98
|
id="menubar-help-topic"
|
|
58
99
|
type="text"
|
|
@@ -64,37 +105,42 @@
|
|
|
64
105
|
/>
|
|
65
106
|
</div>
|
|
66
107
|
<!-- No [popover] = the inline variant: the list renders in flow, always open -->
|
|
67
|
-
<div data-slot="
|
|
68
|
-
<ul role="listbox" data-slot="
|
|
108
|
+
<div data-combobox-slot="panel">
|
|
109
|
+
<ul role="listbox" data-combobox-slot="list" aria-label="Help topics">
|
|
69
110
|
<li
|
|
70
111
|
role="option"
|
|
71
|
-
data-slot="
|
|
72
|
-
|
|
73
|
-
data-variant="ghost"
|
|
74
|
-
data-value="shortcuts"
|
|
112
|
+
data-combobox-slot="item"
|
|
113
|
+
data-ui="button"
|
|
114
|
+
data-button-variant="ghost"
|
|
115
|
+
data-combobox-value="shortcuts"
|
|
116
|
+
style="--justify: start"
|
|
75
117
|
>
|
|
76
118
|
Keyboard shortcuts
|
|
77
119
|
</li>
|
|
78
120
|
<li
|
|
79
121
|
role="option"
|
|
80
|
-
data-slot="
|
|
81
|
-
|
|
82
|
-
data-variant="ghost"
|
|
83
|
-
data-value="theming"
|
|
122
|
+
data-combobox-slot="item"
|
|
123
|
+
data-ui="button"
|
|
124
|
+
data-button-variant="ghost"
|
|
125
|
+
data-combobox-value="theming"
|
|
126
|
+
style="--justify: start"
|
|
84
127
|
>
|
|
85
128
|
Theming and dark mode
|
|
86
129
|
</li>
|
|
87
130
|
<li
|
|
88
131
|
role="option"
|
|
89
|
-
data-slot="
|
|
90
|
-
|
|
91
|
-
data-variant="ghost"
|
|
92
|
-
data-value="updates"
|
|
132
|
+
data-combobox-slot="item"
|
|
133
|
+
data-ui="button"
|
|
134
|
+
data-button-variant="ghost"
|
|
135
|
+
data-combobox-value="updates"
|
|
136
|
+
style="--justify: start"
|
|
93
137
|
>
|
|
94
138
|
Checking for updates
|
|
95
139
|
</li>
|
|
96
140
|
</ul>
|
|
97
|
-
<p data-slot="
|
|
141
|
+
<p data-combobox-slot="empty" style="--text: var(--color-muted-foreground)">
|
|
142
|
+
No topics found.
|
|
143
|
+
</p>
|
|
98
144
|
</div>
|
|
99
145
|
</ui-combobox>
|
|
100
146
|
</div>
|
|
@@ -1,8 +1,19 @@
|
|
|
1
|
-
<div
|
|
1
|
+
<div
|
|
2
|
+
aria-label="Application menu"
|
|
3
|
+
style="
|
|
4
|
+
--display: flex;
|
|
5
|
+
--items: center;
|
|
6
|
+
--p: 2;
|
|
7
|
+
--gap: 1px;
|
|
8
|
+
--w: 100%;
|
|
9
|
+
--bg: var(--color-card);
|
|
10
|
+
--border-b: 1;
|
|
11
|
+
"
|
|
12
|
+
>
|
|
2
13
|
<ui-menu>
|
|
3
14
|
<button
|
|
4
|
-
|
|
5
|
-
data-variant="ghost"
|
|
15
|
+
data-ui="button"
|
|
16
|
+
data-button-variant="ghost"
|
|
6
17
|
type="button"
|
|
7
18
|
popovertarget="menubar-example-file"
|
|
8
19
|
interestfor="menubar-example-file"
|
|
@@ -11,30 +22,62 @@
|
|
|
11
22
|
</button>
|
|
12
23
|
<div
|
|
13
24
|
id="menubar-example-file"
|
|
14
|
-
data-slot="
|
|
15
|
-
data-side="bottom"
|
|
16
|
-
data-align="start"
|
|
25
|
+
data-menu-slot="popover"
|
|
26
|
+
data-popover-side="bottom"
|
|
27
|
+
data-popover-align="start"
|
|
17
28
|
popover="auto"
|
|
18
29
|
>
|
|
19
30
|
<menu>
|
|
20
31
|
<li>
|
|
21
|
-
<button
|
|
32
|
+
<button
|
|
33
|
+
data-ui="button"
|
|
34
|
+
data-button-variant="ghost"
|
|
35
|
+
type="button"
|
|
36
|
+
style="
|
|
37
|
+
--justify: space-between;
|
|
38
|
+
--w: 100%;
|
|
39
|
+
"
|
|
40
|
+
>
|
|
22
41
|
New window
|
|
23
42
|
</button>
|
|
24
43
|
</li>
|
|
25
44
|
<li>
|
|
26
|
-
<button
|
|
45
|
+
<button
|
|
46
|
+
data-ui="button"
|
|
47
|
+
data-button-variant="ghost"
|
|
48
|
+
type="button"
|
|
49
|
+
style="
|
|
50
|
+
--justify: space-between;
|
|
51
|
+
--w: 100%;
|
|
52
|
+
"
|
|
53
|
+
>
|
|
27
54
|
Open...
|
|
28
55
|
</button>
|
|
29
56
|
</li>
|
|
30
57
|
<li>
|
|
31
|
-
<button
|
|
58
|
+
<button
|
|
59
|
+
data-ui="button"
|
|
60
|
+
data-button-variant="ghost"
|
|
61
|
+
type="button"
|
|
62
|
+
style="
|
|
63
|
+
--justify: space-between;
|
|
64
|
+
--w: 100%;
|
|
65
|
+
"
|
|
66
|
+
>
|
|
32
67
|
Save
|
|
33
68
|
</button>
|
|
34
69
|
</li>
|
|
35
|
-
<hr
|
|
70
|
+
<hr data-ui="separator" style="--my: 2" />
|
|
36
71
|
<li>
|
|
37
|
-
<button
|
|
72
|
+
<button
|
|
73
|
+
data-ui="button"
|
|
74
|
+
data-button-variant="ghost"
|
|
75
|
+
type="button"
|
|
76
|
+
style="
|
|
77
|
+
--justify: space-between;
|
|
78
|
+
--w: 100%;
|
|
79
|
+
"
|
|
80
|
+
>
|
|
38
81
|
Close window
|
|
39
82
|
</button>
|
|
40
83
|
</li>
|
|
@@ -44,8 +87,8 @@
|
|
|
44
87
|
|
|
45
88
|
<ui-menu>
|
|
46
89
|
<button
|
|
47
|
-
|
|
48
|
-
data-variant="ghost"
|
|
90
|
+
data-ui="button"
|
|
91
|
+
data-button-variant="ghost"
|
|
49
92
|
type="button"
|
|
50
93
|
popovertarget="menubar-example-edit"
|
|
51
94
|
interestfor="menubar-example-edit"
|
|
@@ -54,35 +97,75 @@
|
|
|
54
97
|
</button>
|
|
55
98
|
<div
|
|
56
99
|
id="menubar-example-edit"
|
|
57
|
-
data-slot="
|
|
58
|
-
data-side="bottom"
|
|
59
|
-
data-align="start"
|
|
100
|
+
data-menu-slot="popover"
|
|
101
|
+
data-popover-side="bottom"
|
|
102
|
+
data-popover-align="start"
|
|
60
103
|
popover="auto"
|
|
61
104
|
>
|
|
62
105
|
<menu>
|
|
63
106
|
<li>
|
|
64
|
-
<button
|
|
107
|
+
<button
|
|
108
|
+
data-ui="button"
|
|
109
|
+
data-button-variant="ghost"
|
|
110
|
+
type="button"
|
|
111
|
+
style="
|
|
112
|
+
--justify: space-between;
|
|
113
|
+
--w: 100%;
|
|
114
|
+
"
|
|
115
|
+
>
|
|
65
116
|
Undo
|
|
66
117
|
</button>
|
|
67
118
|
</li>
|
|
68
119
|
<li>
|
|
69
|
-
<button
|
|
120
|
+
<button
|
|
121
|
+
data-ui="button"
|
|
122
|
+
data-button-variant="ghost"
|
|
123
|
+
type="button"
|
|
124
|
+
style="
|
|
125
|
+
--justify: space-between;
|
|
126
|
+
--w: 100%;
|
|
127
|
+
"
|
|
128
|
+
>
|
|
70
129
|
Redo
|
|
71
130
|
</button>
|
|
72
131
|
</li>
|
|
73
|
-
<hr
|
|
132
|
+
<hr data-ui="separator" style="--my: 2" />
|
|
74
133
|
<li>
|
|
75
|
-
<button
|
|
134
|
+
<button
|
|
135
|
+
data-ui="button"
|
|
136
|
+
data-button-variant="ghost"
|
|
137
|
+
type="button"
|
|
138
|
+
style="
|
|
139
|
+
--justify: space-between;
|
|
140
|
+
--w: 100%;
|
|
141
|
+
"
|
|
142
|
+
>
|
|
76
143
|
Cut
|
|
77
144
|
</button>
|
|
78
145
|
</li>
|
|
79
146
|
<li>
|
|
80
|
-
<button
|
|
147
|
+
<button
|
|
148
|
+
data-ui="button"
|
|
149
|
+
data-button-variant="ghost"
|
|
150
|
+
type="button"
|
|
151
|
+
style="
|
|
152
|
+
--justify: space-between;
|
|
153
|
+
--w: 100%;
|
|
154
|
+
"
|
|
155
|
+
>
|
|
81
156
|
Copy
|
|
82
157
|
</button>
|
|
83
158
|
</li>
|
|
84
159
|
<li>
|
|
85
|
-
<button
|
|
160
|
+
<button
|
|
161
|
+
data-ui="button"
|
|
162
|
+
data-button-variant="ghost"
|
|
163
|
+
type="button"
|
|
164
|
+
style="
|
|
165
|
+
--justify: space-between;
|
|
166
|
+
--w: 100%;
|
|
167
|
+
"
|
|
168
|
+
>
|
|
86
169
|
Paste
|
|
87
170
|
</button>
|
|
88
171
|
</li>
|
|
@@ -92,8 +175,8 @@
|
|
|
92
175
|
|
|
93
176
|
<ui-menu>
|
|
94
177
|
<button
|
|
95
|
-
|
|
96
|
-
data-variant="ghost"
|
|
178
|
+
data-ui="button"
|
|
179
|
+
data-button-variant="ghost"
|
|
97
180
|
type="button"
|
|
98
181
|
popovertarget="menubar-example-view"
|
|
99
182
|
interestfor="menubar-example-view"
|
|
@@ -102,24 +185,48 @@
|
|
|
102
185
|
</button>
|
|
103
186
|
<div
|
|
104
187
|
id="menubar-example-view"
|
|
105
|
-
data-slot="
|
|
106
|
-
data-side="bottom"
|
|
107
|
-
data-align="start"
|
|
188
|
+
data-menu-slot="popover"
|
|
189
|
+
data-popover-side="bottom"
|
|
190
|
+
data-popover-align="start"
|
|
108
191
|
popover="auto"
|
|
109
192
|
>
|
|
110
193
|
<menu>
|
|
111
194
|
<li>
|
|
112
|
-
<button
|
|
195
|
+
<button
|
|
196
|
+
data-ui="button"
|
|
197
|
+
data-button-variant="ghost"
|
|
198
|
+
type="button"
|
|
199
|
+
style="
|
|
200
|
+
--justify: space-between;
|
|
201
|
+
--w: 100%;
|
|
202
|
+
"
|
|
203
|
+
>
|
|
113
204
|
Zoom in
|
|
114
205
|
</button>
|
|
115
206
|
</li>
|
|
116
207
|
<li>
|
|
117
|
-
<button
|
|
208
|
+
<button
|
|
209
|
+
data-ui="button"
|
|
210
|
+
data-button-variant="ghost"
|
|
211
|
+
type="button"
|
|
212
|
+
style="
|
|
213
|
+
--justify: space-between;
|
|
214
|
+
--w: 100%;
|
|
215
|
+
"
|
|
216
|
+
>
|
|
118
217
|
Zoom out
|
|
119
218
|
</button>
|
|
120
219
|
</li>
|
|
121
220
|
<li>
|
|
122
|
-
<button
|
|
221
|
+
<button
|
|
222
|
+
data-ui="button"
|
|
223
|
+
data-button-variant="ghost"
|
|
224
|
+
type="button"
|
|
225
|
+
style="
|
|
226
|
+
--justify: space-between;
|
|
227
|
+
--w: 100%;
|
|
228
|
+
"
|
|
229
|
+
>
|
|
123
230
|
Full screen
|
|
124
231
|
</button>
|
|
125
232
|
</li>
|
|
@@ -129,8 +236,8 @@
|
|
|
129
236
|
|
|
130
237
|
<ui-menu>
|
|
131
238
|
<button
|
|
132
|
-
|
|
133
|
-
data-variant="ghost"
|
|
239
|
+
data-ui="button"
|
|
240
|
+
data-button-variant="ghost"
|
|
134
241
|
type="button"
|
|
135
242
|
popovertarget="menubar-example-help"
|
|
136
243
|
interestfor="menubar-example-help"
|
|
@@ -139,24 +246,45 @@
|
|
|
139
246
|
</button>
|
|
140
247
|
<div
|
|
141
248
|
id="menubar-example-help"
|
|
142
|
-
data-slot="
|
|
143
|
-
data-side="bottom"
|
|
144
|
-
data-align="end"
|
|
249
|
+
data-menu-slot="popover"
|
|
250
|
+
data-popover-side="bottom"
|
|
251
|
+
data-popover-align="end"
|
|
145
252
|
popover="auto"
|
|
146
253
|
>
|
|
147
254
|
<menu>
|
|
148
255
|
<li>
|
|
149
|
-
<a
|
|
256
|
+
<a
|
|
257
|
+
href="#"
|
|
258
|
+
data-ui="button"
|
|
259
|
+
data-button-variant="ghost"
|
|
260
|
+
style="
|
|
261
|
+
--justify: space-between;
|
|
262
|
+
--w: 100%;
|
|
263
|
+
"
|
|
150
264
|
>Documentation</a
|
|
151
265
|
>
|
|
152
266
|
</li>
|
|
153
267
|
<li>
|
|
154
|
-
<a
|
|
268
|
+
<a
|
|
269
|
+
href="#"
|
|
270
|
+
data-ui="button"
|
|
271
|
+
data-button-variant="ghost"
|
|
272
|
+
style="
|
|
273
|
+
--justify: space-between;
|
|
274
|
+
--w: 100%;
|
|
275
|
+
"
|
|
155
276
|
>Keyboard shortcuts</a
|
|
156
277
|
>
|
|
157
278
|
</li>
|
|
158
279
|
<li>
|
|
159
|
-
<a
|
|
280
|
+
<a
|
|
281
|
+
href="#"
|
|
282
|
+
data-ui="button"
|
|
283
|
+
data-button-variant="ghost"
|
|
284
|
+
style="
|
|
285
|
+
--justify: space-between;
|
|
286
|
+
--w: 100%;
|
|
287
|
+
"
|
|
160
288
|
>Report an issue</a
|
|
161
289
|
>
|
|
162
290
|
</li>
|