@zazz-ui/core 0.15.1 → 0.16.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 +29 -14
- package/CHANGELOG.md +156 -0
- package/README.md +6 -5
- package/dist/{csp-LRx1fynI.js → csp-C1f62vyT.js} +1 -1
- package/dist/sri.json +70 -65
- package/dist/zazz.css +1 -1
- package/dist/zazz.js +1 -1
- package/editor/zazz.css-data.json +74 -2
- package/editor/zazz.html-data.json +119 -79
- package/editor/zazz.language-data.json +401 -313
- package/editor/zazz.lint-data.json +1752 -1731
- package/package.json +2 -1
- package/src/base/_defaults.css +11 -11
- package/src/base/_reset.css +2 -10
- package/src/base/_typography.css +17 -568
- package/src/base/_utilities-box.css +17 -17
- package/src/base/_utilities-pseudo.css +2 -2
- package/src/base/_variables.css +142 -97
- package/src/base/carousel-scroll.d.ts +1 -1
- package/src/base/carousel-scroll.js +6 -6
- package/src/base/carousel-scroll.ts +6 -6
- package/src/base/carousel.d.ts.map +1 -1
- package/src/base/carousel.js +6 -2
- package/src/base/carousel.ts +6 -2
- package/src/base/csp.js +2 -2
- package/src/base/csp.ts +2 -2
- package/src/base/kit-styling.d.ts.map +1 -1
- package/src/base/kit-styling.js +186 -183
- package/src/base/kit-styling.ts +186 -183
- package/src/base/navigation.d.ts +2 -2
- package/src/base/navigation.d.ts.map +1 -1
- package/src/base/navigation.js +25 -21
- package/src/base/navigation.ts +27 -21
- package/src/base/utilities.d.ts +1 -1
- package/src/base/utilities.d.ts.map +1 -1
- package/src/base/utilities.js +20 -4
- package/src/base/utilities.ts +21 -5
- package/src/base/zazz-element.d.ts +1 -1
- package/src/base/zazz-element.js +1 -1
- package/src/base/zazz-element.ts +1 -1
- package/src/{base → behaviors}/gesture.d.ts +4 -3
- package/src/behaviors/gesture.d.ts.map +1 -0
- package/src/{base → behaviors}/gesture.js +1 -1
- package/src/{base → behaviors}/gesture.ts +5 -4
- package/src/{base → behaviors}/hotkeys.d.ts +2 -1
- package/src/behaviors/hotkeys.d.ts.map +1 -0
- package/src/{base → behaviors}/hotkeys.ts +2 -1
- package/src/behaviors/list-navigation.d.ts +64 -0
- package/src/behaviors/list-navigation.d.ts.map +1 -0
- package/src/behaviors/list-navigation.js +66 -0
- package/src/behaviors/list-navigation.ts +107 -0
- package/src/{base → behaviors}/typeahead.d.ts +3 -1
- package/src/behaviors/typeahead.d.ts.map +1 -0
- package/src/{base → behaviors}/typeahead.js +12 -17
- package/src/{base → behaviors}/typeahead.ts +12 -17
- package/src/css-properties.json +704 -0
- package/src/index.css +7 -0
- package/src/manifest.d.ts +20 -9
- package/src/manifest.d.ts.map +1 -1
- package/src/manifest.js +125 -37
- package/src/manifest.ts +132 -38
- package/src/primitives/accordion/accordion.json +49 -0
- package/src/primitives/alert-dialog/alert-dialog.json +35 -0
- package/src/primitives/autocomplete/autocomplete.d.ts +2 -2
- package/src/primitives/autocomplete/autocomplete.d.ts.map +1 -1
- package/src/primitives/autocomplete/autocomplete.js +2 -2
- package/src/primitives/autocomplete/autocomplete.json +65 -0
- package/src/primitives/autocomplete/autocomplete.ts +2 -2
- package/src/primitives/avatar/avatar.css +108 -0
- package/src/primitives/avatar/avatar.html +20 -74
- package/src/primitives/avatar/avatar.json +48 -0
- package/src/primitives/badge/badge.css +45 -10
- package/src/primitives/badge/badge.html +4 -0
- package/src/primitives/badge/badge.json +83 -0
- package/src/primitives/breadcrumbs/breadcrumbs.json +20 -0
- package/src/primitives/button/button.css +50 -66
- package/src/primitives/button/button.html +4 -0
- package/src/primitives/button/button.json +85 -0
- package/src/primitives/button-group/button-group.css +4 -15
- package/src/primitives/button-group/button-group.json +40 -0
- package/src/primitives/callout/callout.css +1 -1
- package/src/primitives/callout/callout.html +12 -12
- package/src/primitives/callout/callout.json +54 -0
- package/src/primitives/card/card-article.html +13 -37
- package/src/primitives/card/card-horizontal.html +11 -14
- package/src/primitives/card/card-login.html +4 -4
- package/src/primitives/card/card-product.html +3 -3
- package/src/primitives/card/card-subgrid.html +4 -4
- package/src/primitives/card/card.css +1 -1
- package/src/primitives/card/card.html +8 -8
- package/src/primitives/card/card.json +73 -0
- package/src/primitives/carousel/carousel.css +1 -1
- package/src/primitives/carousel/carousel.json +89 -0
- package/src/primitives/checkbox/checkbox.css +1 -2
- package/src/primitives/checkbox/checkbox.json +51 -0
- package/src/primitives/combobox/combobox.css +3 -2
- package/src/primitives/combobox/combobox.d.ts +2 -2
- package/src/primitives/combobox/combobox.d.ts.map +1 -1
- package/src/primitives/combobox/combobox.js +2 -2
- package/src/primitives/combobox/combobox.json +113 -0
- package/src/primitives/combobox/combobox.ts +2 -2
- package/src/primitives/command/command-actions.html +1 -1
- package/src/primitives/command/command.d.ts +4 -3
- package/src/primitives/command/command.d.ts.map +1 -1
- package/src/primitives/command/command.js +7 -6
- package/src/primitives/command/command.json +86 -0
- package/src/primitives/command/command.ts +7 -6
- package/src/primitives/debug/audit-core.d.ts +19 -12
- package/src/primitives/debug/audit-core.d.ts.map +1 -1
- package/src/primitives/debug/audit-core.js +78 -16
- package/src/primitives/debug/audit-core.ts +94 -22
- package/src/primitives/debug/debug.d.ts +6 -4
- package/src/primitives/debug/debug.d.ts.map +1 -1
- package/src/primitives/debug/debug.js +50 -21
- package/src/primitives/debug/debug.json +29 -0
- package/src/primitives/debug/debug.ts +57 -35
- package/src/primitives/dialog/dialog.css +1 -4
- package/src/primitives/dialog/dialog.json +78 -0
- package/src/primitives/drawer/drawer.css +4 -2
- package/src/primitives/drawer/drawer.d.ts.map +1 -1
- package/src/primitives/drawer/drawer.js +76 -4
- package/src/primitives/drawer/drawer.json +98 -0
- package/src/primitives/drawer/drawer.ts +78 -5
- package/src/primitives/fields/fields.css +11 -4
- package/src/primitives/fields/fields.json +92 -0
- package/src/primitives/font/font.css +188 -0
- package/src/primitives/font/font.html +14 -0
- package/src/primitives/font/font.json +39 -0
- package/src/primitives/group/group.json +25 -0
- package/src/primitives/input/input.css +1 -2
- package/src/primitives/input/input.json +56 -0
- package/src/primitives/input-group/input-group-password-group.html +1 -1
- package/src/primitives/input-group/input-group.css +32 -3
- package/src/primitives/input-group/input-group.html +5 -8
- package/src/primitives/input-group/input-group.json +69 -0
- package/src/primitives/kbd/kbd.css +1 -1
- package/src/primitives/kbd/kbd.json +52 -0
- package/src/primitives/layout/layout.json +45 -0
- package/src/primitives/lightbox/lightbox.css +4 -3
- package/src/primitives/lightbox/lightbox.html +2 -2
- package/src/primitives/lightbox/lightbox.js +1 -1
- package/src/primitives/lightbox/lightbox.json +87 -0
- package/src/primitives/lightbox/lightbox.ts +1 -1
- package/src/primitives/link/link.css +28 -0
- package/src/primitives/link/link.html +5 -0
- package/src/primitives/link/link.json +23 -0
- package/src/primitives/menu/menu.d.ts +3 -0
- package/src/primitives/menu/menu.d.ts.map +1 -1
- package/src/primitives/menu/menu.js +10 -25
- package/src/primitives/menu/menu.json +51 -0
- package/src/primitives/menu/menu.ts +10 -27
- package/src/primitives/menubar/menubar.json +23 -0
- package/src/primitives/meter/meter.css +24 -3
- package/src/primitives/meter/meter.json +41 -0
- package/src/primitives/mobile-menu/mobile-menu.html +1 -1
- package/src/primitives/mobile-menu/mobile-menu.json +64 -0
- package/src/primitives/navigation-menu/navigation-menu-featured.html +58 -58
- package/src/primitives/navigation-menu/navigation-menu-megamenu.html +6 -113
- package/src/primitives/navigation-menu/navigation-menu.css +11 -5
- package/src/primitives/navigation-menu/navigation-menu.html +1 -1
- package/src/primitives/navigation-menu/navigation-menu.json +82 -0
- package/src/primitives/otp/otp.css +1 -1
- package/src/primitives/otp/otp.d.ts +3 -3
- package/src/primitives/otp/otp.js +5 -5
- package/src/primitives/otp/otp.json +75 -0
- package/src/primitives/otp/otp.ts +5 -5
- package/src/primitives/password-group/password-group.css +32 -2
- package/src/primitives/password-group/password-group.html +1 -1
- package/src/primitives/password-group/password-group.json +74 -0
- package/src/primitives/popover/popover.css +1 -1
- package/src/primitives/popover/popover.json +64 -0
- package/src/primitives/progress/progress.css +25 -3
- package/src/primitives/progress/progress.json +41 -0
- package/src/primitives/prose/prose.css +341 -0
- package/src/primitives/prose/prose.html +11 -11
- package/src/primitives/prose/prose.json +47 -0
- package/src/primitives/radio/radio.css +1 -1
- package/src/primitives/radio/radio.json +48 -0
- package/src/primitives/reveal/reveal.json +72 -0
- package/src/primitives/scroll-fade/scroll-fade.css +0 -3
- package/src/primitives/scroll-fade/scroll-fade.json +34 -0
- package/src/primitives/select/select.css +2 -2
- package/src/primitives/select/select.json +119 -0
- package/src/primitives/separator/separator.json +34 -0
- package/src/primitives/slider/slider.css +87 -13
- package/src/primitives/slider/slider.json +49 -0
- package/src/primitives/style-guard/style-guard.js +1 -1
- package/src/primitives/style-guard/style-guard.json +22 -0
- package/src/primitives/style-guard/style-guard.ts +2 -2
- package/src/primitives/switch/switch.css +107 -18
- package/src/primitives/switch/switch.json +71 -0
- package/src/primitives/table/table.json +74 -0
- package/src/primitives/tabs/tabs.css +24 -12
- package/src/primitives/tabs/tabs.d.ts +4 -2
- package/src/primitives/tabs/tabs.d.ts.map +1 -1
- package/src/primitives/tabs/tabs.js +14 -24
- package/src/primitives/tabs/tabs.json +94 -0
- package/src/primitives/tabs/tabs.ts +14 -26
- package/src/primitives/textarea/textarea.css +1 -1
- package/src/primitives/textarea/textarea.json +48 -0
- package/src/primitives/toaster/toaster.d.ts.map +1 -1
- package/src/primitives/toaster/toaster.js +4 -4
- package/src/primitives/toaster/toaster.json +101 -0
- package/src/primitives/toaster/toaster.ts +5 -5
- package/src/primitives/toggle/toggle.css +2 -52
- package/src/primitives/toggle/toggle.json +84 -0
- package/src/primitives/toggle-group/toggle-group.css +1 -1
- package/src/primitives/toggle-group/toggle-group.json +41 -0
- package/src/primitives/toolbar/toolbar.json +26 -0
- package/src/primitives/tooltip/tooltip.css +1 -1
- package/src/primitives/tooltip/tooltip.json +85 -0
- package/src/primitives/utilities/aspect-ratio.html +3 -3
- package/src/primitives/utilities/basis.html +5 -5
- package/src/primitives/utilities/col-span.html +5 -5
- package/src/primitives/utilities/compose.html +3 -3
- package/src/primitives/utilities/flex-align.html +3 -3
- package/src/primitives/utilities/flex-direction.html +8 -8
- package/src/primitives/utilities/flex-grow.html +3 -3
- package/src/primitives/utilities/flex-reverse.html +8 -8
- package/src/primitives/utilities/gallery.html +19 -19
- package/src/primitives/utilities/gap.html +12 -12
- package/src/primitives/utilities/grid-cols.html +6 -6
- package/src/primitives/utilities/grid-responsive.html +9 -9
- package/src/primitives/utilities/inline-flex.html +2 -2
- package/src/primitives/utilities/margin-auto.html +1 -1
- package/src/primitives/utilities/object-fit.html +3 -3
- package/src/primitives/utilities/order.html +3 -3
- package/src/primitives/utilities/overflow.html +14 -14
- package/src/primitives/utilities/padding-compose.html +3 -3
- package/src/primitives/utilities/padding.html +4 -4
- package/src/primitives/utilities/position.html +1 -1
- package/src/primitives/utilities/responsive-flex.html +4 -4
- package/src/primitives/utilities/responsive-grid.html +9 -9
- package/src/primitives/utilities/size.html +5 -5
- package/src/primitives/utilities/subgrid-col.html +7 -7
- package/src/primitives/utilities/subgrid-row.html +9 -9
- package/src/primitives/utilities/subgrid.html +9 -9
- package/src/primitives/utilities/utilities.json +48 -0
- package/src/primitives/utilities/width.html +5 -5
- package/src/base/gesture.d.ts.map +0 -1
- package/src/base/hotkeys.d.ts.map +0 -1
- package/src/base/typeahead.d.ts.map +0 -1
- /package/src/{base → behaviors}/command-score.d.ts +0 -0
- /package/src/{base → behaviors}/command-score.d.ts.map +0 -0
- /package/src/{base → behaviors}/command-score.js +0 -0
- /package/src/{base → behaviors}/command-score.ts +0 -0
- /package/src/{base → behaviors}/hotkeys.js +0 -0
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
<button
|
|
44
44
|
data-ui="button"
|
|
45
45
|
data-button-variant="ghost"
|
|
46
|
-
data-button-size="icon
|
|
46
|
+
data-button-size="icon"
|
|
47
47
|
type="submit"
|
|
48
48
|
aria-label="Submit search"
|
|
49
49
|
>
|
|
@@ -98,9 +98,7 @@
|
|
|
98
98
|
<span data-input-group-slot="text">https://</span>
|
|
99
99
|
</span>
|
|
100
100
|
<span data-input-group-slot="addon" data-input-group-align="inline-end">
|
|
101
|
-
<button data-ui="button" data-button-variant="primary"
|
|
102
|
-
Apply
|
|
103
|
-
</button>
|
|
101
|
+
<button data-ui="button" data-button-variant="primary" type="submit">Apply</button>
|
|
104
102
|
</span>
|
|
105
103
|
</label>
|
|
106
104
|
<div data-field-slot="description">
|
|
@@ -123,13 +121,12 @@
|
|
|
123
121
|
<span data-input-group-slot="addon" data-input-group-align="block-end">
|
|
124
122
|
<button
|
|
125
123
|
data-ui="button"
|
|
126
|
-
data-button-size="sm"
|
|
127
124
|
type="submit"
|
|
128
125
|
style="
|
|
129
126
|
--ml: auto;
|
|
130
|
-
--bg: var(--color-background);
|
|
131
|
-
--bg--
|
|
132
|
-
--bg--
|
|
127
|
+
--ui-button-bg: var(--color-background);
|
|
128
|
+
--ui-button-bg--hover: var(--color-muted);
|
|
129
|
+
--ui-button-bg--active: var(--color-muted);
|
|
133
130
|
"
|
|
134
131
|
>
|
|
135
132
|
<span>Send</span> <kbd>↵</kbd>
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "input-group",
|
|
3
|
+
"summary": "input-group.css — Input group ([data-ui~=\"input-group\"])",
|
|
4
|
+
"identities": [
|
|
5
|
+
"input-group"
|
|
6
|
+
],
|
|
7
|
+
"tags": [],
|
|
8
|
+
"hooks": {
|
|
9
|
+
"Layout & Positioning": {
|
|
10
|
+
"--ui-input-group-display": "flex",
|
|
11
|
+
"--ui-input-group-flex-wrap": "wrap",
|
|
12
|
+
"--ui-input-group-gap": "var(--spacing)",
|
|
13
|
+
"--ui-input-group-items": "center"
|
|
14
|
+
},
|
|
15
|
+
"Box Model & Sizing": {
|
|
16
|
+
"--ui-input-group-min-h": "var(--ui-field-h)",
|
|
17
|
+
"--ui-input-group-p": "0",
|
|
18
|
+
"--ui-input-group-textarea-min-h": "3lh",
|
|
19
|
+
"--ui-input-group-textarea-px": "calc(var(--spacing) * 2)",
|
|
20
|
+
"--ui-input-group-textarea-py": "calc(var(--spacing) * 1.5)",
|
|
21
|
+
"--ui-input-group-w": "100%"
|
|
22
|
+
},
|
|
23
|
+
"Typography": {
|
|
24
|
+
"--ui-input-group-font-size": "var(--font-size-sm)",
|
|
25
|
+
"--ui-input-group-font-weight": "var(--font-weight-strong)"
|
|
26
|
+
},
|
|
27
|
+
"Color & Backgrounds": {
|
|
28
|
+
"--ui-input-group-text": "var(--color-muted-foreground)"
|
|
29
|
+
},
|
|
30
|
+
"Visual Effects": {
|
|
31
|
+
"--ui-input-group-shadow": "0 0 transparent"
|
|
32
|
+
},
|
|
33
|
+
"Interaction & UI": {
|
|
34
|
+
"--ui-input-group-cursor": "text"
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
"attributes": {
|
|
38
|
+
"data-input-group-align": [
|
|
39
|
+
"block-end",
|
|
40
|
+
"block-start",
|
|
41
|
+
"inline-end",
|
|
42
|
+
"inline-start"
|
|
43
|
+
]
|
|
44
|
+
},
|
|
45
|
+
"slots": {
|
|
46
|
+
"data-input-group-slot": [
|
|
47
|
+
"addon",
|
|
48
|
+
"text"
|
|
49
|
+
]
|
|
50
|
+
},
|
|
51
|
+
"states": {},
|
|
52
|
+
"requires": [
|
|
53
|
+
"fields",
|
|
54
|
+
"input",
|
|
55
|
+
"textarea",
|
|
56
|
+
"button"
|
|
57
|
+
],
|
|
58
|
+
"files": {
|
|
59
|
+
"css": [
|
|
60
|
+
"primitives/input-group/input-group.css"
|
|
61
|
+
],
|
|
62
|
+
"js": [],
|
|
63
|
+
"base": [],
|
|
64
|
+
"examples": [
|
|
65
|
+
"primitives/input-group/input-group.html",
|
|
66
|
+
"primitives/input-group/input-group-password-group.html"
|
|
67
|
+
]
|
|
68
|
+
}
|
|
69
|
+
}
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
--_radius-len: var(--_radius-resolved, var(--ui-kbd-radius));
|
|
72
72
|
--_radius-num: var(--_radius-resolved, var(--ui-kbd-radius));
|
|
73
73
|
border-radius: calc(
|
|
74
|
-
var(--_radius-len) + var(--_radius-num) * var(--spacing) * var(--radius-
|
|
74
|
+
var(--_radius-len) + var(--_radius-num) * var(--spacing) * var(--radius-coefficient)
|
|
75
75
|
);
|
|
76
76
|
corner-shape: var(--_corner-shape-resolved, var(--ui-kbd-corner-shape));
|
|
77
77
|
overflow: hidden;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "kbd",
|
|
3
|
+
"summary": "kbd.css: Kbd (native <kbd>) + Kbd group (ui-kbd-group | [data-ui~=\"kbd-group\"])",
|
|
4
|
+
"identities": [
|
|
5
|
+
"kbd-group"
|
|
6
|
+
],
|
|
7
|
+
"tags": [
|
|
8
|
+
"ui-kbd-group"
|
|
9
|
+
],
|
|
10
|
+
"hooks": {
|
|
11
|
+
"Layout & Positioning": {
|
|
12
|
+
"--ui-kbd-gap": "var(--spacing)",
|
|
13
|
+
"--ui-kbd-group-gap": "var(--spacing)"
|
|
14
|
+
},
|
|
15
|
+
"Box Model & Sizing": {
|
|
16
|
+
"--ui-kbd-icon-size": "calc(var(--spacing) * 3.5)",
|
|
17
|
+
"--ui-kbd-min-h": "calc(var(--spacing) * 5)",
|
|
18
|
+
"--ui-kbd-min-w": "calc(var(--spacing) * 5)",
|
|
19
|
+
"--ui-kbd-px": "var(--spacing)",
|
|
20
|
+
"--ui-kbd-py": "0"
|
|
21
|
+
},
|
|
22
|
+
"Typography": {
|
|
23
|
+
"--ui-kbd-font-family": "var(--font-family-mono)",
|
|
24
|
+
"--ui-kbd-font-size": "var(--font-size-xs)",
|
|
25
|
+
"--ui-kbd-leading": "1"
|
|
26
|
+
},
|
|
27
|
+
"Color & Backgrounds": {
|
|
28
|
+
"--ui-kbd-bg": "var(--color-muted)",
|
|
29
|
+
"--ui-kbd-text": "var(--color-muted-foreground)"
|
|
30
|
+
},
|
|
31
|
+
"Borders & Outlines": {
|
|
32
|
+
"--ui-kbd-border": "1px solid transparent",
|
|
33
|
+
"--ui-kbd-corner-shape": "var(--radius-corner-shape)",
|
|
34
|
+
"--ui-kbd-radius": "var(--radius-xs)"
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
"attributes": {},
|
|
38
|
+
"slots": {},
|
|
39
|
+
"states": {},
|
|
40
|
+
"requires": [],
|
|
41
|
+
"files": {
|
|
42
|
+
"css": [
|
|
43
|
+
"primitives/kbd/kbd.css"
|
|
44
|
+
],
|
|
45
|
+
"js": [],
|
|
46
|
+
"base": [],
|
|
47
|
+
"examples": [
|
|
48
|
+
"primitives/kbd/kbd.html",
|
|
49
|
+
"primitives/kbd/kbd-group.html"
|
|
50
|
+
]
|
|
51
|
+
}
|
|
52
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "layout",
|
|
3
|
+
"summary": "layout.css — Layout (ui-layout | [data-ui~=\"layout\"]): the band grid",
|
|
4
|
+
"identities": [
|
|
5
|
+
"layout"
|
|
6
|
+
],
|
|
7
|
+
"tags": [
|
|
8
|
+
"ui-layout"
|
|
9
|
+
],
|
|
10
|
+
"hooks": {
|
|
11
|
+
"Layout & Positioning": {
|
|
12
|
+
"--ui-layout-band": "layout-xl",
|
|
13
|
+
"--ui-layout-child-container": "inline-size",
|
|
14
|
+
"--ui-layout-gutters": "var(--gutters)",
|
|
15
|
+
"--ui-layout-template-cols": "[layout-bleed-start] var(--ui-layout-gutters) [layout-full-start] minmax(0, 1fr) [layout-2xl-start] clamp( 0rem, calc((var(--ui-layout-available) - var(--layout-xl)) / 2), calc((var(--layout-2xl) - var(--layout-xl)) / 2) ) [layout-xl-start] clamp( 0rem, calc((var(--ui-layout-available) - var(--layout-lg)) / 2), calc((var(--layout-xl) - var(--layout-lg)) / 2) ) [layout-lg-start] clamp( 0rem, calc((var(--ui-layout-available) - var(--layout-md)) / 2), calc((var(--layout-lg) - var(--layout-md)) / 2) ) [layout-md-start] clamp( 0rem, calc((var(--ui-layout-available) - var(--layout-sm)) / 2), calc((var(--layout-md) - var(--layout-sm)) / 2) ) [layout-sm-start] clamp(0rem, var(--ui-layout-available), var(--layout-sm)) [layout-sm-end] clamp( 0rem, calc((var(--ui-layout-available) - var(--layout-sm)) / 2), calc((var(--layout-md) - var(--layout-sm)) / 2) ) [layout-md-end] clamp( 0rem, calc((var(--ui-layout-available) - var(--layout-md)) / 2), calc((var(--layout-lg) - var(--layout-md)) / 2) ) [layout-lg-end] clamp( 0rem, calc((var(--ui-layout-available) - var(--layout-lg)) / 2), calc((var(--layout-xl) - var(--layout-lg)) / 2) ) [layout-xl-end] clamp( 0rem, calc((var(--ui-layout-available) - var(--layout-xl)) / 2), calc((var(--layout-2xl) - var(--layout-xl)) / 2) ) [layout-2xl-end] minmax(0, 1fr) [layout-full-end] var(--ui-layout-gutters) [layout-bleed-end]"
|
|
16
|
+
},
|
|
17
|
+
"Box Model & Sizing": {
|
|
18
|
+
"--ui-layout-available": "calc(100% - var(--ui-layout-gutters) * 2)"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"attributes": {
|
|
22
|
+
"data-layout-size": [
|
|
23
|
+
"2xl",
|
|
24
|
+
"bleed",
|
|
25
|
+
"full",
|
|
26
|
+
"lg",
|
|
27
|
+
"md",
|
|
28
|
+
"sm",
|
|
29
|
+
"xl"
|
|
30
|
+
]
|
|
31
|
+
},
|
|
32
|
+
"slots": {},
|
|
33
|
+
"states": {},
|
|
34
|
+
"requires": [],
|
|
35
|
+
"files": {
|
|
36
|
+
"css": [
|
|
37
|
+
"primitives/layout/layout.css"
|
|
38
|
+
],
|
|
39
|
+
"js": [],
|
|
40
|
+
"base": [],
|
|
41
|
+
"examples": [
|
|
42
|
+
"primitives/layout/layout.html"
|
|
43
|
+
]
|
|
44
|
+
}
|
|
45
|
+
}
|
|
@@ -524,9 +524,10 @@
|
|
|
524
524
|
:where(ui-lightbox, [data-ui~="lightbox"]) [data-lightbox-slot~="counter"] {
|
|
525
525
|
position: absolute;
|
|
526
526
|
inset-block-end: var(--space-sm);
|
|
527
|
-
/*
|
|
528
|
-
|
|
529
|
-
|
|
527
|
+
/* centered on the inline axis: full-width insets, auto margins, content width */
|
|
528
|
+
inset-inline: 0;
|
|
529
|
+
margin-inline: auto;
|
|
530
|
+
inline-size: fit-content;
|
|
530
531
|
opacity: 0.7;
|
|
531
532
|
font-size: var(--font-size-sm);
|
|
532
533
|
font-variant-numeric: tabular-nums;
|
|
@@ -129,7 +129,7 @@
|
|
|
129
129
|
data-ui="button"
|
|
130
130
|
data-lightbox-slot="thumbs-prev"
|
|
131
131
|
data-carousel-slot="prev"
|
|
132
|
-
data-button-size="icon
|
|
132
|
+
data-button-size="icon"
|
|
133
133
|
data-button-variant="ghost"
|
|
134
134
|
type="button"
|
|
135
135
|
aria-label="Previous image"
|
|
@@ -289,7 +289,7 @@
|
|
|
289
289
|
data-ui="button"
|
|
290
290
|
data-lightbox-slot="thumbs-next"
|
|
291
291
|
data-carousel-slot="next"
|
|
292
|
-
data-button-size="icon
|
|
292
|
+
data-button-size="icon"
|
|
293
293
|
data-button-variant="ghost"
|
|
294
294
|
type="button"
|
|
295
295
|
aria-label="Next image"
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* Opening and closing the dialog itself needs no JavaScript — slides carry
|
|
15
15
|
* `command="show-modal"` / `command="close"` (Invoker Commands). A mouse
|
|
16
16
|
* drag on the stage or the thumbs never also clicks: the gesture layer
|
|
17
|
-
* (
|
|
17
|
+
* (behaviors/gesture.js) swallows the click that ends a drag.
|
|
18
18
|
*
|
|
19
19
|
* @example
|
|
20
20
|
* <ui-lightbox>
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "lightbox",
|
|
3
|
+
"summary": "lightbox.css — Lightbox gallery (ui-lightbox | [data-ui~=\"lightbox\"])",
|
|
4
|
+
"identities": [
|
|
5
|
+
"lightbox"
|
|
6
|
+
],
|
|
7
|
+
"tags": [
|
|
8
|
+
"ui-lightbox"
|
|
9
|
+
],
|
|
10
|
+
"hooks": {
|
|
11
|
+
"Layout & Positioning": {
|
|
12
|
+
"--ui-lightbox-thumb-cols": "6",
|
|
13
|
+
"--ui-lightbox-thumb-gap": "calc(var(--spacing) * 1.5)"
|
|
14
|
+
},
|
|
15
|
+
"Box Model & Sizing": {
|
|
16
|
+
"--ui-lightbox-aspect": "3 / 2",
|
|
17
|
+
"--ui-lightbox-thumb-size": "calc(var(--spacing) * 16)"
|
|
18
|
+
},
|
|
19
|
+
"Borders & Outlines": {
|
|
20
|
+
"--ui-lightbox-img-border": "1px solid var(--color-faded)",
|
|
21
|
+
"--ui-lightbox-slide-corner-shape": "var(--radius-corner-shape)",
|
|
22
|
+
"--ui-lightbox-slide-radius": "var(--radius-lg)",
|
|
23
|
+
"--ui-lightbox-thumb-corner-shape": "var(--radius-corner-shape)",
|
|
24
|
+
"--ui-lightbox-thumb-radius": "var(--radius-md)"
|
|
25
|
+
},
|
|
26
|
+
"Visual Effects": {
|
|
27
|
+
"--ui-lightbox-img-opacity": "1",
|
|
28
|
+
"--ui-lightbox-object-fit": "cover",
|
|
29
|
+
"--ui-lightbox-slide-opacity--end": "1",
|
|
30
|
+
"--ui-lightbox-slide-opacity--start": "0",
|
|
31
|
+
"--ui-lightbox-thumb-opacity": "0.5",
|
|
32
|
+
"--ui-lightbox-thumb-opacity--active": "1"
|
|
33
|
+
},
|
|
34
|
+
"Transforms & Animation": {
|
|
35
|
+
"--ui-lightbox-img-scale": "1",
|
|
36
|
+
"--ui-lightbox-img-scale--active": "1",
|
|
37
|
+
"--ui-lightbox-img-scale--hover": "1.03",
|
|
38
|
+
"--ui-lightbox-img-transition-delay": "0ms",
|
|
39
|
+
"--ui-lightbox-img-transition-duration": "calc(var(--default-transition-duration) * 3)",
|
|
40
|
+
"--ui-lightbox-img-transition-property": "transform",
|
|
41
|
+
"--ui-lightbox-img-transition-timing-function": "var(--default-transition-timing-function)",
|
|
42
|
+
"--ui-lightbox-slide-scale--end": "1",
|
|
43
|
+
"--ui-lightbox-slide-scale--start": "0.9"
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
"attributes": {},
|
|
47
|
+
"slots": {
|
|
48
|
+
"data-lightbox-slot": [
|
|
49
|
+
"close",
|
|
50
|
+
"content",
|
|
51
|
+
"counter",
|
|
52
|
+
"dialog",
|
|
53
|
+
"gallery",
|
|
54
|
+
"next",
|
|
55
|
+
"prev",
|
|
56
|
+
"slide",
|
|
57
|
+
"stage",
|
|
58
|
+
"thumb",
|
|
59
|
+
"thumb-content",
|
|
60
|
+
"thumbs",
|
|
61
|
+
"thumbs-next",
|
|
62
|
+
"thumbs-prev"
|
|
63
|
+
]
|
|
64
|
+
},
|
|
65
|
+
"states": {},
|
|
66
|
+
"requires": [
|
|
67
|
+
"dialog",
|
|
68
|
+
"carousel",
|
|
69
|
+
"button"
|
|
70
|
+
],
|
|
71
|
+
"files": {
|
|
72
|
+
"css": [
|
|
73
|
+
"primitives/lightbox/lightbox.css"
|
|
74
|
+
],
|
|
75
|
+
"js": [
|
|
76
|
+
"primitives/lightbox/lightbox.js"
|
|
77
|
+
],
|
|
78
|
+
"base": [
|
|
79
|
+
"behaviors/gesture.js",
|
|
80
|
+
"base/carousel-scroll.js",
|
|
81
|
+
"base/carousel.js"
|
|
82
|
+
],
|
|
83
|
+
"examples": [
|
|
84
|
+
"primitives/lightbox/lightbox.html"
|
|
85
|
+
]
|
|
86
|
+
}
|
|
87
|
+
}
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* Opening and closing the dialog itself needs no JavaScript — slides carry
|
|
16
16
|
* `command="show-modal"` / `command="close"` (Invoker Commands). A mouse
|
|
17
17
|
* drag on the stage or the thumbs never also clicks: the gesture layer
|
|
18
|
-
* (
|
|
18
|
+
* (behaviors/gesture.js) swallows the click that ends a drag.
|
|
19
19
|
*
|
|
20
20
|
* @example
|
|
21
21
|
* <ui-lightbox>
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* link.css: Link ([data-ui~="link"])
|
|
3
|
+
*
|
|
4
|
+
* @layer components
|
|
5
|
+
* @requires _layers.css, _variables.css
|
|
6
|
+
* @uses oklch(from currentColor …): the hover underline fades with the text color
|
|
7
|
+
* @uses Decoration tokens: consumes --decoration-thickness, --decoration-offset,
|
|
8
|
+
* and the default transition tokens from _variables.css
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
@layer ui.components {
|
|
12
|
+
/* ===========================================================================
|
|
13
|
+
LINK: the underline prose gives its anchors, for a link outside prose
|
|
14
|
+
- The color is the surrounding text's; set it with the --text utility.
|
|
15
|
+
=========================================================================== */
|
|
16
|
+
|
|
17
|
+
:where([data-ui~="link"]) {
|
|
18
|
+
text-decoration: underline;
|
|
19
|
+
text-decoration-thickness: var(--decoration-thickness);
|
|
20
|
+
text-underline-offset: var(--decoration-offset);
|
|
21
|
+
transition: text-decoration-color var(--default-transition-duration)
|
|
22
|
+
var(--default-transition-timing-function);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
:where([data-ui~="link"]:hover) {
|
|
26
|
+
text-decoration-color: oklch(from currentColor l c h / 0.3);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "link",
|
|
3
|
+
"summary": "link.css: Link ([data-ui~=\"link\"])",
|
|
4
|
+
"identities": [
|
|
5
|
+
"link"
|
|
6
|
+
],
|
|
7
|
+
"tags": [],
|
|
8
|
+
"hooks": {},
|
|
9
|
+
"attributes": {},
|
|
10
|
+
"slots": {},
|
|
11
|
+
"states": {},
|
|
12
|
+
"requires": [],
|
|
13
|
+
"files": {
|
|
14
|
+
"css": [
|
|
15
|
+
"primitives/link/link.css"
|
|
16
|
+
],
|
|
17
|
+
"js": [],
|
|
18
|
+
"base": [],
|
|
19
|
+
"examples": [
|
|
20
|
+
"primitives/link/link.html"
|
|
21
|
+
]
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -14,6 +14,9 @@
|
|
|
14
14
|
* - Home / End jump to the first / last item.
|
|
15
15
|
* - Escape and light dismiss are native Popover API behavior (no code here).
|
|
16
16
|
*
|
|
17
|
+
* The key handling is the shared list navigation behavior
|
|
18
|
+
* (`behaviors/list-navigation.ts`).
|
|
19
|
+
*
|
|
17
20
|
* The menu keeps the honest disclosure posture: items are plain links and
|
|
18
21
|
* buttons, and no `role="menu"` is claimed. Add the full ARIA menu contract
|
|
19
22
|
* yourself only if every item is an action and you implement the rest of the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"menu.d.ts","sourceRoot":"","sources":["menu.ts"],"names":[],"mappings":"AAEA
|
|
1
|
+
{"version":3,"file":"menu.d.ts","sourceRoot":"","sources":["menu.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAEH,OAAO,EAAE,WAAW,EAAqB,MAAM,4BAA4B,CAAC;AAG5E,cAAM,MAAO,SAAQ,WAAW;;IAC9B,SAAS,CAAC,KAAK,CAAC,MAAM,EAAE,WAAW,GAAG,IAAI,CAEzC;CAkEF;AAID,OAAO,EAAE,MAAM,EAAE,CAAC"}
|
|
@@ -15,6 +15,9 @@
|
|
|
15
15
|
* - Home / End jump to the first / last item.
|
|
16
16
|
* - Escape and light dismiss are native Popover API behavior (no code here).
|
|
17
17
|
*
|
|
18
|
+
* The key handling is the shared list navigation behavior
|
|
19
|
+
* (`behaviors/list-navigation.ts`).
|
|
20
|
+
*
|
|
18
21
|
* The menu keeps the honest disclosure posture: items are plain links and
|
|
19
22
|
* buttons, and no `role="menu"` is claimed. Add the full ARIA menu contract
|
|
20
23
|
* yourself only if every item is an action and you implement the rest of the
|
|
@@ -31,6 +34,7 @@
|
|
|
31
34
|
* </ui-menu>
|
|
32
35
|
*/
|
|
33
36
|
import { ZazzElement, defineZazzElement } from "../../base/zazz-element.js";
|
|
37
|
+
import { isDisabledItem, listStep, stepIndex } from "../../behaviors/list-navigation.js";
|
|
34
38
|
class UiMenu extends ZazzElement {
|
|
35
39
|
setup(signal) {
|
|
36
40
|
this.addEventListener("keydown", (event) => this.#onKeydown(event), { signal });
|
|
@@ -54,9 +58,7 @@ class UiMenu extends ZazzElement {
|
|
|
54
58
|
#items(panel) {
|
|
55
59
|
return Array.from(panel.querySelectorAll("a[href], button"))
|
|
56
60
|
.filter((node) => node instanceof HTMLElement)
|
|
57
|
-
.filter((item) => !item.
|
|
58
|
-
item.getAttribute("aria-disabled") !== "true" &&
|
|
59
|
-
item.closest('ui-menu, [data-ui~="menu"]') === this);
|
|
61
|
+
.filter((item) => !isDisabledItem(item) && item.closest('ui-menu, [data-ui~="menu"]') === this);
|
|
60
62
|
}
|
|
61
63
|
/**
|
|
62
64
|
* @description Routes arrow-key, Home, and End presses: opens the panel from
|
|
@@ -65,7 +67,8 @@ class UiMenu extends ZazzElement {
|
|
|
65
67
|
* @param event - The keydown event.
|
|
66
68
|
*/
|
|
67
69
|
#onKeydown(event) {
|
|
68
|
-
|
|
70
|
+
const step = listStep(event.key);
|
|
71
|
+
if (!step)
|
|
69
72
|
return;
|
|
70
73
|
const target = event.target;
|
|
71
74
|
if (!(target instanceof HTMLElement))
|
|
@@ -79,11 +82,11 @@ class UiMenu extends ZazzElement {
|
|
|
79
82
|
const isTrigger = target.parentElement === this &&
|
|
80
83
|
(target.hasAttribute("popovertarget") || target.hasAttribute("interestfor"));
|
|
81
84
|
const open = panel.matches(":popover-open");
|
|
82
|
-
if (isTrigger && !open && (
|
|
85
|
+
if (isTrigger && !open && (step === "next" || step === "previous")) {
|
|
83
86
|
event.preventDefault();
|
|
84
87
|
panel.showPopover();
|
|
85
88
|
const items = this.#items(panel);
|
|
86
|
-
items[
|
|
89
|
+
items[stepIndex(-1, step, items.length)]?.focus();
|
|
87
90
|
return;
|
|
88
91
|
}
|
|
89
92
|
if (!open || !panel.contains(target))
|
|
@@ -91,26 +94,8 @@ class UiMenu extends ZazzElement {
|
|
|
91
94
|
const items = this.#items(panel);
|
|
92
95
|
if (items.length === 0)
|
|
93
96
|
return;
|
|
94
|
-
const index = items.indexOf(target);
|
|
95
|
-
let nextIndex;
|
|
96
|
-
switch (event.key) {
|
|
97
|
-
case "ArrowDown":
|
|
98
|
-
nextIndex = index === -1 ? 0 : (index + 1) % items.length;
|
|
99
|
-
break;
|
|
100
|
-
case "ArrowUp":
|
|
101
|
-
nextIndex = index === -1 ? items.length - 1 : (index - 1 + items.length) % items.length;
|
|
102
|
-
break;
|
|
103
|
-
case "Home":
|
|
104
|
-
nextIndex = 0;
|
|
105
|
-
break;
|
|
106
|
-
case "End":
|
|
107
|
-
nextIndex = items.length - 1;
|
|
108
|
-
break;
|
|
109
|
-
default:
|
|
110
|
-
return;
|
|
111
|
-
}
|
|
112
97
|
event.preventDefault();
|
|
113
|
-
items[
|
|
98
|
+
items[stepIndex(items.indexOf(target), step, items.length)].focus();
|
|
114
99
|
}
|
|
115
100
|
}
|
|
116
101
|
defineZazzElement("ui-menu", UiMenu);
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "menu",
|
|
3
|
+
"summary": "menu.css: Menu (ui-menu | [data-ui~=\"menu\"]; slot data-menu-slot=\"popover\")",
|
|
4
|
+
"identities": [
|
|
5
|
+
"menu"
|
|
6
|
+
],
|
|
7
|
+
"tags": [
|
|
8
|
+
"ui-menu"
|
|
9
|
+
],
|
|
10
|
+
"hooks": {
|
|
11
|
+
"Layout & Positioning": {
|
|
12
|
+
"--ui-menu-gap": "var(--ui-field-option-gap)"
|
|
13
|
+
},
|
|
14
|
+
"Box Model & Sizing": {
|
|
15
|
+
"--ui-menu-min-w": "calc(var(--spacing) * 52)"
|
|
16
|
+
},
|
|
17
|
+
"Borders & Outlines": {
|
|
18
|
+
"--ui-menu-button-corner-shape": "var(--radius-corner-shape)",
|
|
19
|
+
"--ui-menu-button-radius": "var(--radius-sm)"
|
|
20
|
+
},
|
|
21
|
+
"Visual Effects": {
|
|
22
|
+
"--ui-menu-shadow": "var(--shadow-sm)"
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"attributes": {},
|
|
26
|
+
"slots": {
|
|
27
|
+
"data-menu-slot": [
|
|
28
|
+
"popover"
|
|
29
|
+
]
|
|
30
|
+
},
|
|
31
|
+
"states": {},
|
|
32
|
+
"requires": [
|
|
33
|
+
"popover",
|
|
34
|
+
"button"
|
|
35
|
+
],
|
|
36
|
+
"files": {
|
|
37
|
+
"css": [
|
|
38
|
+
"primitives/menu/menu.css"
|
|
39
|
+
],
|
|
40
|
+
"js": [
|
|
41
|
+
"primitives/menu/menu.js"
|
|
42
|
+
],
|
|
43
|
+
"base": [
|
|
44
|
+
"behaviors/list-navigation.js"
|
|
45
|
+
],
|
|
46
|
+
"examples": [
|
|
47
|
+
"primitives/menu/menu.html",
|
|
48
|
+
"primitives/menu/menu-interest.html"
|
|
49
|
+
]
|
|
50
|
+
}
|
|
51
|
+
}
|
|
@@ -16,6 +16,9 @@
|
|
|
16
16
|
* - Home / End jump to the first / last item.
|
|
17
17
|
* - Escape and light dismiss are native Popover API behavior (no code here).
|
|
18
18
|
*
|
|
19
|
+
* The key handling is the shared list navigation behavior
|
|
20
|
+
* (`behaviors/list-navigation.ts`).
|
|
21
|
+
*
|
|
19
22
|
* The menu keeps the honest disclosure posture: items are plain links and
|
|
20
23
|
* buttons, and no `role="menu"` is claimed. Add the full ARIA menu contract
|
|
21
24
|
* yourself only if every item is an action and you implement the rest of the
|
|
@@ -33,6 +36,7 @@
|
|
|
33
36
|
*/
|
|
34
37
|
|
|
35
38
|
import { ZazzElement, defineZazzElement } from "../../base/zazz-element.ts";
|
|
39
|
+
import { isDisabledItem, listStep, stepIndex } from "../../behaviors/list-navigation.ts";
|
|
36
40
|
|
|
37
41
|
class UiMenu extends ZazzElement {
|
|
38
42
|
protected setup(signal: AbortSignal): void {
|
|
@@ -60,10 +64,7 @@ class UiMenu extends ZazzElement {
|
|
|
60
64
|
return Array.from(panel.querySelectorAll("a[href], button"))
|
|
61
65
|
.filter((node): node is HTMLElement => node instanceof HTMLElement)
|
|
62
66
|
.filter(
|
|
63
|
-
(item) =>
|
|
64
|
-
!item.hasAttribute("disabled") &&
|
|
65
|
-
item.getAttribute("aria-disabled") !== "true" &&
|
|
66
|
-
item.closest('ui-menu, [data-ui~="menu"]') === this,
|
|
67
|
+
(item) => !isDisabledItem(item) && item.closest('ui-menu, [data-ui~="menu"]') === this,
|
|
67
68
|
);
|
|
68
69
|
}
|
|
69
70
|
|
|
@@ -74,7 +75,8 @@ class UiMenu extends ZazzElement {
|
|
|
74
75
|
* @param event - The keydown event.
|
|
75
76
|
*/
|
|
76
77
|
#onKeydown(event: KeyboardEvent): void {
|
|
77
|
-
|
|
78
|
+
const step = listStep(event.key);
|
|
79
|
+
if (!step) return;
|
|
78
80
|
|
|
79
81
|
const target = event.target;
|
|
80
82
|
if (!(target instanceof HTMLElement)) return;
|
|
@@ -89,11 +91,11 @@ class UiMenu extends ZazzElement {
|
|
|
89
91
|
(target.hasAttribute("popovertarget") || target.hasAttribute("interestfor"));
|
|
90
92
|
const open = panel.matches(":popover-open");
|
|
91
93
|
|
|
92
|
-
if (isTrigger && !open && (
|
|
94
|
+
if (isTrigger && !open && (step === "next" || step === "previous")) {
|
|
93
95
|
event.preventDefault();
|
|
94
96
|
panel.showPopover();
|
|
95
97
|
const items = this.#items(panel);
|
|
96
|
-
items[
|
|
98
|
+
items[stepIndex(-1, step, items.length)]?.focus();
|
|
97
99
|
return;
|
|
98
100
|
}
|
|
99
101
|
|
|
@@ -102,27 +104,8 @@ class UiMenu extends ZazzElement {
|
|
|
102
104
|
const items = this.#items(panel);
|
|
103
105
|
if (items.length === 0) return;
|
|
104
106
|
|
|
105
|
-
const index = items.indexOf(target);
|
|
106
|
-
let nextIndex: number;
|
|
107
|
-
switch (event.key) {
|
|
108
|
-
case "ArrowDown":
|
|
109
|
-
nextIndex = index === -1 ? 0 : (index + 1) % items.length;
|
|
110
|
-
break;
|
|
111
|
-
case "ArrowUp":
|
|
112
|
-
nextIndex = index === -1 ? items.length - 1 : (index - 1 + items.length) % items.length;
|
|
113
|
-
break;
|
|
114
|
-
case "Home":
|
|
115
|
-
nextIndex = 0;
|
|
116
|
-
break;
|
|
117
|
-
case "End":
|
|
118
|
-
nextIndex = items.length - 1;
|
|
119
|
-
break;
|
|
120
|
-
default:
|
|
121
|
-
return;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
107
|
event.preventDefault();
|
|
125
|
-
items[
|
|
108
|
+
items[stepIndex(items.indexOf(target), step, items.length)].focus();
|
|
126
109
|
}
|
|
127
110
|
}
|
|
128
111
|
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "menubar",
|
|
3
|
+
"identities": [],
|
|
4
|
+
"tags": [],
|
|
5
|
+
"hooks": {},
|
|
6
|
+
"attributes": {},
|
|
7
|
+
"slots": {},
|
|
8
|
+
"states": {},
|
|
9
|
+
"requires": [
|
|
10
|
+
"menu",
|
|
11
|
+
"button",
|
|
12
|
+
"separator"
|
|
13
|
+
],
|
|
14
|
+
"files": {
|
|
15
|
+
"css": [],
|
|
16
|
+
"js": [],
|
|
17
|
+
"base": [],
|
|
18
|
+
"examples": [
|
|
19
|
+
"primitives/menubar/menubar.html",
|
|
20
|
+
"primitives/menubar/menubar-help-search.html"
|
|
21
|
+
]
|
|
22
|
+
}
|
|
23
|
+
}
|