@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
|
@@ -1,24 +1,38 @@
|
|
|
1
|
-
<ui-command
|
|
1
|
+
<ui-command
|
|
2
|
+
data-command-hotkey="mod+k"
|
|
3
|
+
style="
|
|
4
|
+
--w: 100%;
|
|
5
|
+
--max-w: 96;
|
|
6
|
+
"
|
|
7
|
+
>
|
|
2
8
|
<button
|
|
3
|
-
|
|
9
|
+
data-ui="input"
|
|
4
10
|
type="button"
|
|
5
|
-
data-variant="outline"
|
|
6
11
|
popovertarget="command-example-1"
|
|
7
|
-
data-slot="
|
|
12
|
+
data-command-slot="open"
|
|
13
|
+
style="
|
|
14
|
+
--display: inline-flex;
|
|
15
|
+
--items: center;
|
|
16
|
+
--justify: space-between;
|
|
17
|
+
--pr: 1.5;
|
|
18
|
+
--gap: 2;
|
|
19
|
+
--w: 100%;
|
|
20
|
+
--w--md: 64;
|
|
21
|
+
"
|
|
8
22
|
>
|
|
9
|
-
<span
|
|
23
|
+
<span style="--text: var(--color-muted-foreground)">Search...</span>
|
|
10
24
|
<ui-kbd-group><kbd>⌘</kbd><kbd>K</kbd></ui-kbd-group>
|
|
11
25
|
</button>
|
|
12
26
|
<div
|
|
13
27
|
id="command-example-1"
|
|
14
|
-
data-slot="
|
|
15
|
-
data-side="bottom"
|
|
16
|
-
data-align="start"
|
|
28
|
+
data-command-slot="panel"
|
|
29
|
+
data-popover-side="bottom"
|
|
30
|
+
data-popover-align="start"
|
|
17
31
|
popover="auto"
|
|
18
32
|
>
|
|
19
|
-
<header data-slot="
|
|
33
|
+
<header data-command-slot="header">
|
|
20
34
|
<input
|
|
21
|
-
data-slot="
|
|
35
|
+
data-command-slot="input"
|
|
22
36
|
type="text"
|
|
23
37
|
placeholder="Type a command or search..."
|
|
24
38
|
role="combobox"
|
|
@@ -28,65 +42,96 @@
|
|
|
28
42
|
aria-label="Search commands"
|
|
29
43
|
/>
|
|
30
44
|
</header>
|
|
31
|
-
<div role="listbox" data-slot="
|
|
32
|
-
<div role="group" data-slot="
|
|
45
|
+
<div role="listbox" data-command-slot="list" aria-label="Commands">
|
|
46
|
+
<div role="group" data-command-slot="group" aria-labelledby="command-example-1-nav">
|
|
33
47
|
<span
|
|
34
|
-
|
|
35
|
-
data-slot="command-group-label"
|
|
48
|
+
data-command-slot="group-label"
|
|
36
49
|
id="command-example-1-nav"
|
|
50
|
+
style="
|
|
51
|
+
--display: inline-flex;
|
|
52
|
+
--font-size: var(--font-size-eyebrow);
|
|
53
|
+
--font-weight: strong;
|
|
54
|
+
--font-weight: var(--font-weight-eyebrow);
|
|
55
|
+
--leading: var(--leading-eyebrow);
|
|
56
|
+
--tracking: var(--tracking-eyebrow);
|
|
57
|
+
--text-transform: uppercase;
|
|
58
|
+
--text: var(--color-muted-foreground);
|
|
59
|
+
"
|
|
37
60
|
>Navigation</span
|
|
38
61
|
>
|
|
39
62
|
<a
|
|
40
63
|
role="option"
|
|
41
|
-
data-slot="
|
|
42
|
-
|
|
43
|
-
data-variant="ghost"
|
|
64
|
+
data-command-slot="item"
|
|
65
|
+
data-ui="button"
|
|
66
|
+
data-button-variant="ghost"
|
|
44
67
|
href="#docs"
|
|
45
68
|
tabindex="-1"
|
|
46
|
-
data-keywords="documentation guides"
|
|
47
|
-
data-hotkey="mod+shift+d"
|
|
69
|
+
data-command-keywords="documentation guides"
|
|
70
|
+
data-command-hotkey="mod+shift+d"
|
|
71
|
+
style="--justify: start"
|
|
48
72
|
>
|
|
49
73
|
Go to docs
|
|
50
74
|
<ui-kbd-group><kbd>⇧</kbd><kbd>⌘</kbd><kbd>D</kbd></ui-kbd-group>
|
|
51
75
|
</a>
|
|
52
76
|
<a
|
|
53
77
|
role="option"
|
|
54
|
-
data-slot="
|
|
55
|
-
|
|
56
|
-
data-variant="ghost"
|
|
78
|
+
data-command-slot="item"
|
|
79
|
+
data-ui="button"
|
|
80
|
+
data-button-variant="ghost"
|
|
57
81
|
href="#settings"
|
|
58
82
|
tabindex="-1"
|
|
59
|
-
data-keywords="preferences options"
|
|
60
|
-
data-hotkey="mod+shift+s"
|
|
83
|
+
data-command-keywords="preferences options"
|
|
84
|
+
data-command-hotkey="mod+shift+s"
|
|
85
|
+
style="--justify: start"
|
|
61
86
|
>
|
|
62
87
|
Go to settings
|
|
63
88
|
<ui-kbd-group><kbd>⇧</kbd><kbd>⌘</kbd><kbd>S</kbd></ui-kbd-group>
|
|
64
89
|
</a>
|
|
65
90
|
</div>
|
|
66
|
-
<div role="group" data-slot="
|
|
91
|
+
<div role="group" data-command-slot="group" aria-labelledby="command-example-1-actions">
|
|
67
92
|
<span
|
|
68
|
-
|
|
69
|
-
data-slot="command-group-label"
|
|
93
|
+
data-command-slot="group-label"
|
|
70
94
|
id="command-example-1-actions"
|
|
95
|
+
style="
|
|
96
|
+
--display: inline-flex;
|
|
97
|
+
--font-size: var(--font-size-eyebrow);
|
|
98
|
+
--font-weight: strong;
|
|
99
|
+
--font-weight: var(--font-weight-eyebrow);
|
|
100
|
+
--leading: var(--leading-eyebrow);
|
|
101
|
+
--tracking: var(--tracking-eyebrow);
|
|
102
|
+
--text-transform: uppercase;
|
|
103
|
+
--text: var(--color-muted-foreground);
|
|
104
|
+
"
|
|
71
105
|
>Actions</span
|
|
72
106
|
>
|
|
73
107
|
<button
|
|
74
108
|
role="option"
|
|
75
|
-
data-slot="
|
|
76
|
-
|
|
77
|
-
data-variant="ghost"
|
|
109
|
+
data-command-slot="item"
|
|
110
|
+
data-ui="button"
|
|
111
|
+
data-button-variant="ghost"
|
|
78
112
|
type="button"
|
|
79
113
|
command="show-modal"
|
|
80
114
|
commandfor="command-example-1-dialog"
|
|
81
115
|
tabindex="-1"
|
|
82
|
-
data-keywords="modal open"
|
|
116
|
+
data-command-keywords="modal open"
|
|
117
|
+
style="--justify: start"
|
|
83
118
|
>
|
|
84
119
|
Open example dialog
|
|
85
120
|
</button>
|
|
86
121
|
</div>
|
|
87
122
|
</div>
|
|
88
|
-
<p
|
|
89
|
-
|
|
123
|
+
<p
|
|
124
|
+
data-command-slot="empty"
|
|
125
|
+
style="
|
|
126
|
+
--font-size: var(--font-size-sm);
|
|
127
|
+
--leading: var(--leading-sm);
|
|
128
|
+
--tracking: var(--tracking-sm);
|
|
129
|
+
--text: var(--color-muted-foreground);
|
|
130
|
+
"
|
|
131
|
+
>
|
|
132
|
+
No commands found.
|
|
133
|
+
</p>
|
|
134
|
+
<footer data-command-slot="footer">
|
|
90
135
|
<span
|
|
91
136
|
><ui-kbd-group><kbd>↑</kbd><kbd>↓</kbd></ui-kbd-group> navigate</span
|
|
92
137
|
>
|
|
@@ -96,23 +141,27 @@
|
|
|
96
141
|
</div>
|
|
97
142
|
</ui-command>
|
|
98
143
|
|
|
99
|
-
<dialog
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
144
|
+
<dialog id="command-example-1-dialog" data-ui="dialog" closedby="any">
|
|
145
|
+
<div data-dialog-slot="content">
|
|
146
|
+
<header data-dialog-slot="header">
|
|
147
|
+
<h2
|
|
148
|
+
style="
|
|
149
|
+
--font-size: var(--font-size-lg);
|
|
150
|
+
--font-weight: strong;
|
|
151
|
+
--font-family: var(--font-family-heading);
|
|
152
|
+
--leading: var(--leading-lg);
|
|
153
|
+
--tracking: var(--tracking-lg);
|
|
154
|
+
"
|
|
155
|
+
>
|
|
156
|
+
Opened by a command
|
|
157
|
+
</h2>
|
|
109
158
|
</header>
|
|
110
|
-
<div data-slot="
|
|
159
|
+
<div data-dialog-slot="body">
|
|
111
160
|
<p>The command item is a plain invoker button (no custom wiring).</p>
|
|
112
161
|
</div>
|
|
113
162
|
</div>
|
|
114
|
-
<footer data-slot="
|
|
115
|
-
<button
|
|
163
|
+
<footer data-dialog-slot="footer">
|
|
164
|
+
<button data-ui="button" type="button" commandfor="command-example-1-dialog" command="close">
|
|
116
165
|
Close
|
|
117
166
|
</button>
|
|
118
167
|
</footer>
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* @fileoverview `<ui-command>`: a command menu for search and quick actions.
|
|
4
4
|
* @description Light-DOM custom element on the shared typeahead engine
|
|
5
|
-
* (`base/typeahead.ts`)
|
|
6
|
-
* dropdown or a `<dialog
|
|
5
|
+
* (`base/typeahead.ts`). The panel (a `popover="auto"`
|
|
6
|
+
* dropdown or a `<dialog data-ui="dialog">`) contains the search input;
|
|
7
7
|
* items rank by match score and the best match auto-highlights.
|
|
8
8
|
*
|
|
9
9
|
* Actions are the platform's own vocabulary: navigation items are real
|
|
@@ -16,14 +16,17 @@
|
|
|
16
16
|
*
|
|
17
17
|
* Attributes:
|
|
18
18
|
* - `data-command-hotkey` (root): global toggle shortcut, e.g. `"mod+k"`.
|
|
19
|
-
* - `data-hotkey` (item): global accelerator that activates the item, active
|
|
19
|
+
* - `data-command-hotkey` (item): global accelerator that activates the item, active
|
|
20
20
|
* while the element is connected (even with the panel closed).
|
|
21
|
-
* - `data-stay-open` (item): keep the panel open after activation.
|
|
22
|
-
* - `data-sort="document"` (root): opt out of score ranking (default: score).
|
|
21
|
+
* - `data-command-stay-open` (item): keep the panel open after activation.
|
|
22
|
+
* - `data-command-sort="document"` (root): opt out of score ranking (default: score).
|
|
23
|
+
* - `data-command-filter="none"` (root): opt out of filtering for a list another
|
|
24
|
+
* source already filtered (a search index); items added later are highlighted
|
|
25
|
+
* and navigable like typed matches.
|
|
23
26
|
*
|
|
24
27
|
* Parts: `command-open` (trigger), `command-panel`, `command-header`,
|
|
25
28
|
* `command-input`, `command-list`, `command-group` / `command-group-label`,
|
|
26
|
-
* `command-item` (`data-value`, `data-keywords`), `command-kbd`,
|
|
29
|
+
* `command-item` (`data-command-value`, `data-command-keywords`), `command-kbd`,
|
|
27
30
|
* `command-footer`, `command-empty`.
|
|
28
31
|
*
|
|
29
32
|
* For complex custom actions, see the example `command-actions.ts`: listen
|
|
@@ -36,9 +39,9 @@ class UiCommand extends TypeaheadElement {
|
|
|
36
39
|
slotPrefix = "command";
|
|
37
40
|
managesPanel = false;
|
|
38
41
|
autoHighlight = true;
|
|
39
|
-
/**
|
|
42
|
+
/** Ranks by score unless `data-command-sort="document"`. */
|
|
40
43
|
get sortByScore() {
|
|
41
|
-
return this.
|
|
44
|
+
return this.config("sort") !== "document";
|
|
42
45
|
}
|
|
43
46
|
setup(signal) {
|
|
44
47
|
super.setup(signal);
|
|
@@ -53,7 +56,7 @@ class UiCommand extends TypeaheadElement {
|
|
|
53
56
|
}
|
|
54
57
|
// Per-item accelerators: global while connected, panel open or not
|
|
55
58
|
for (const item of this.items()) {
|
|
56
|
-
const spec = item.getAttribute("data-hotkey");
|
|
59
|
+
const spec = item.getAttribute("data-command-hotkey");
|
|
57
60
|
if (spec) {
|
|
58
61
|
bindHotkey(spec, () => this.#activate(item, true), { signal });
|
|
59
62
|
}
|
|
@@ -87,11 +90,17 @@ class UiCommand extends TypeaheadElement {
|
|
|
87
90
|
* @param source - How the commit happened.
|
|
88
91
|
*/
|
|
89
92
|
commit(item, source) {
|
|
93
|
+
// The synthetic click() below bubbles back here as a pointer commit:
|
|
94
|
+
// one keystroke must announce once and close once.
|
|
95
|
+
if (this.#clicking)
|
|
96
|
+
return;
|
|
90
97
|
this.#activate(item, source === "keyboard");
|
|
91
98
|
}
|
|
99
|
+
/** True while `#activate` runs an item's native activation via `click()`. */
|
|
100
|
+
#clicking = false;
|
|
92
101
|
/**
|
|
93
102
|
* @description Runs one item's activation: optional synthetic click,
|
|
94
|
-
* `zazz:command-select`, then close (unless `data-stay-open`).
|
|
103
|
+
* `zazz:command-select`, then close (unless `data-command-stay-open`).
|
|
95
104
|
*
|
|
96
105
|
* @param item - The item to activate.
|
|
97
106
|
* @param click - Whether to run the native activation via `click()`.
|
|
@@ -102,10 +111,18 @@ class UiCommand extends TypeaheadElement {
|
|
|
102
111
|
bubbles: true,
|
|
103
112
|
detail: { item, value: this.itemValue(item) },
|
|
104
113
|
}));
|
|
105
|
-
if (click)
|
|
106
|
-
|
|
107
|
-
|
|
114
|
+
if (click) {
|
|
115
|
+
this.#clicking = true;
|
|
116
|
+
try {
|
|
117
|
+
item.click();
|
|
118
|
+
}
|
|
119
|
+
finally {
|
|
120
|
+
this.#clicking = false;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
if (!item.hasAttribute("data-command-stay-open")) {
|
|
108
124
|
this.#closePanel();
|
|
125
|
+
}
|
|
109
126
|
}
|
|
110
127
|
/**
|
|
111
128
|
* @description Opens or closes the panel, branching on its surface.
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
/**
|
|
4
4
|
* @fileoverview `<ui-command>`: a command menu for search and quick actions.
|
|
5
5
|
* @description Light-DOM custom element on the shared typeahead engine
|
|
6
|
-
* (`base/typeahead.ts`)
|
|
7
|
-
* dropdown or a `<dialog
|
|
6
|
+
* (`base/typeahead.ts`). The panel (a `popover="auto"`
|
|
7
|
+
* dropdown or a `<dialog data-ui="dialog">`) contains the search input;
|
|
8
8
|
* items rank by match score and the best match auto-highlights.
|
|
9
9
|
*
|
|
10
10
|
* Actions are the platform's own vocabulary: navigation items are real
|
|
@@ -17,14 +17,17 @@
|
|
|
17
17
|
*
|
|
18
18
|
* Attributes:
|
|
19
19
|
* - `data-command-hotkey` (root): global toggle shortcut, e.g. `"mod+k"`.
|
|
20
|
-
* - `data-hotkey` (item): global accelerator that activates the item, active
|
|
20
|
+
* - `data-command-hotkey` (item): global accelerator that activates the item, active
|
|
21
21
|
* while the element is connected (even with the panel closed).
|
|
22
|
-
* - `data-stay-open` (item): keep the panel open after activation.
|
|
23
|
-
* - `data-sort="document"` (root): opt out of score ranking (default: score).
|
|
22
|
+
* - `data-command-stay-open` (item): keep the panel open after activation.
|
|
23
|
+
* - `data-command-sort="document"` (root): opt out of score ranking (default: score).
|
|
24
|
+
* - `data-command-filter="none"` (root): opt out of filtering for a list another
|
|
25
|
+
* source already filtered (a search index); items added later are highlighted
|
|
26
|
+
* and navigable like typed matches.
|
|
24
27
|
*
|
|
25
28
|
* Parts: `command-open` (trigger), `command-panel`, `command-header`,
|
|
26
29
|
* `command-input`, `command-list`, `command-group` / `command-group-label`,
|
|
27
|
-
* `command-item` (`data-value`, `data-keywords`), `command-kbd`,
|
|
30
|
+
* `command-item` (`data-command-value`, `data-command-keywords`), `command-kbd`,
|
|
28
31
|
* `command-footer`, `command-empty`.
|
|
29
32
|
*
|
|
30
33
|
* For complex custom actions, see the example `command-actions.ts`: listen
|
|
@@ -40,9 +43,9 @@ class UiCommand extends TypeaheadElement {
|
|
|
40
43
|
protected readonly managesPanel: boolean = false;
|
|
41
44
|
protected readonly autoHighlight: boolean = true;
|
|
42
45
|
|
|
43
|
-
/**
|
|
46
|
+
/** Ranks by score unless `data-command-sort="document"`. */
|
|
44
47
|
protected get sortByScore(): boolean {
|
|
45
|
-
return this.
|
|
48
|
+
return this.config("sort") !== "document";
|
|
46
49
|
}
|
|
47
50
|
|
|
48
51
|
protected setup(signal: AbortSignal): void {
|
|
@@ -59,7 +62,7 @@ class UiCommand extends TypeaheadElement {
|
|
|
59
62
|
|
|
60
63
|
// Per-item accelerators: global while connected, panel open or not
|
|
61
64
|
for (const item of this.items()) {
|
|
62
|
-
const spec = item.getAttribute("data-hotkey");
|
|
65
|
+
const spec = item.getAttribute("data-command-hotkey");
|
|
63
66
|
if (spec) {
|
|
64
67
|
bindHotkey(spec, () => this.#activate(item, true), { signal });
|
|
65
68
|
}
|
|
@@ -100,12 +103,18 @@ class UiCommand extends TypeaheadElement {
|
|
|
100
103
|
* @param source - How the commit happened.
|
|
101
104
|
*/
|
|
102
105
|
protected commit(item: HTMLElement, source: "keyboard" | "pointer"): void {
|
|
106
|
+
// The synthetic click() below bubbles back here as a pointer commit:
|
|
107
|
+
// one keystroke must announce once and close once.
|
|
108
|
+
if (this.#clicking) return;
|
|
103
109
|
this.#activate(item, source === "keyboard");
|
|
104
110
|
}
|
|
105
111
|
|
|
112
|
+
/** True while `#activate` runs an item's native activation via `click()`. */
|
|
113
|
+
#clicking = false;
|
|
114
|
+
|
|
106
115
|
/**
|
|
107
116
|
* @description Runs one item's activation: optional synthetic click,
|
|
108
|
-
* `zazz:command-select`, then close (unless `data-stay-open`).
|
|
117
|
+
* `zazz:command-select`, then close (unless `data-command-stay-open`).
|
|
109
118
|
*
|
|
110
119
|
* @param item - The item to activate.
|
|
111
120
|
* @param click - Whether to run the native activation via `click()`.
|
|
@@ -118,8 +127,17 @@ class UiCommand extends TypeaheadElement {
|
|
|
118
127
|
detail: { item, value: this.itemValue(item) },
|
|
119
128
|
}),
|
|
120
129
|
);
|
|
121
|
-
if (click)
|
|
122
|
-
|
|
130
|
+
if (click) {
|
|
131
|
+
this.#clicking = true;
|
|
132
|
+
try {
|
|
133
|
+
item.click();
|
|
134
|
+
} finally {
|
|
135
|
+
this.#clicking = false;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
if (!item.hasAttribute("data-command-stay-open")) {
|
|
139
|
+
this.#closePanel();
|
|
140
|
+
}
|
|
123
141
|
}
|
|
124
142
|
|
|
125
143
|
/**
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/** A stable name per finding, so a linter can switch each one off. */
|
|
2
|
+
export type RuleId = "unknown-utility" | "pseudo-form" | "group-needs-state" | "border-value" | "not-integer" | "tier-unsupported" | "tier-without-base" | "dual-value" | "keyword-number" | "raw-shadows-utility" | "flattens-state" | "gradient-incomplete" | "font-weight-name" | "scroll-state" | "whitespace-before-colon" | "attribute-outside-identity" | "persist";
|
|
3
|
+
export declare const RULE_IDS: readonly RuleId[];
|
|
4
|
+
/** `[start, end)` offsets into the `style` attribute's value. */
|
|
5
|
+
export type Span = [number, number];
|
|
6
|
+
export interface Suggestion {
|
|
7
|
+
description: string;
|
|
8
|
+
span: Span;
|
|
9
|
+
text: string;
|
|
10
|
+
}
|
|
11
|
+
export interface Finding {
|
|
12
|
+
rule: RuleId;
|
|
13
|
+
message: string;
|
|
14
|
+
/** The declaration the finding is about, inside `style`. */
|
|
15
|
+
span?: Span;
|
|
16
|
+
/** The attribute the finding is about, when it is not `style`. */
|
|
17
|
+
attribute?: string;
|
|
18
|
+
suggestion?: Suggestion;
|
|
19
|
+
}
|
|
20
|
+
/** The parts of an element the audit reads. */
|
|
21
|
+
export interface AuditNode {
|
|
22
|
+
getAttribute(name: string): string | null;
|
|
23
|
+
getAttributeNames(): string[];
|
|
24
|
+
/** True when this node or an ancestor carries the identity `name` (see {@link carriesIdentity}). */
|
|
25
|
+
withinIdentity(name: string, identities: readonly string[]): boolean;
|
|
26
|
+
}
|
|
27
|
+
export interface AuditContext {
|
|
28
|
+
/** State-bearing hooks per identity as `<utility>--<state>` (`bg--hover`). */
|
|
29
|
+
hooks: Record<string, string[]>;
|
|
30
|
+
/** Identity tokens the kit declares (`button`, `field-group`). */
|
|
31
|
+
identities: readonly string[];
|
|
32
|
+
/** True when `value` is a color identifier (`red`, `currentcolor`); the browser asks `CSS.supports`. */
|
|
33
|
+
isColor: (value: string) => boolean;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* True when an element with this tag and `data-ui` carries the identity `name`:
|
|
37
|
+
* a tag form or a declared token that is `name` or sits under its prefix
|
|
38
|
+
* (`field-group` and `<ui-toggle-group>` carry `field` and `toggle`).
|
|
39
|
+
*/
|
|
40
|
+
export declare function carriesIdentity(tagName: string, dataUi: string | null, name: string, identities: readonly string[]): boolean;
|
|
41
|
+
/** Audits one element's `style` and `data-*` attributes. */
|
|
42
|
+
export declare function auditNode(node: AuditNode, context: AuditContext): Finding[];
|
|
43
|
+
export interface PersistFinding<T> {
|
|
44
|
+
el: T;
|
|
45
|
+
rule: "persist";
|
|
46
|
+
message: string;
|
|
47
|
+
}
|
|
48
|
+
/** The persisted element that already carries another one (`self`: it is that element). */
|
|
49
|
+
export interface PersistOwner {
|
|
50
|
+
id: string;
|
|
51
|
+
self: boolean;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Checks `data-ui-persist` (or `data-ui-persist-scroll`) elements, in document
|
|
55
|
+
* order: each needs the swap opt-in, an id, a unique id, and no `data-ui-persist`
|
|
56
|
+
* element that already carries it (`ownerOf`: an ancestor, or for
|
|
57
|
+
* `data-ui-persist-scroll` the element itself). Returns the elements that work
|
|
58
|
+
* and the findings.
|
|
59
|
+
*/
|
|
60
|
+
export declare function auditPersistence<T>(swap: boolean, persisted: T[], idOf: (el: T) => string, ownerOf: (el: T) => PersistOwner | null, attribute?: "data-ui-persist" | "data-ui-persist-scroll"): {
|
|
61
|
+
kept: T[];
|
|
62
|
+
warnings: PersistFinding<T>[];
|
|
63
|
+
};
|
|
64
|
+
//# sourceMappingURL=audit-core.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"audit-core.d.ts","sourceRoot":"","sources":["audit-core.ts"],"names":[],"mappings":"AAyBA,sEAAsE;AACtE,MAAM,MAAM,MAAM,GACd,iBAAiB,GACjB,aAAa,GACb,mBAAmB,GACnB,cAAc,GACd,aAAa,GACb,kBAAkB,GAClB,mBAAmB,GACnB,YAAY,GACZ,gBAAgB,GAChB,qBAAqB,GACrB,gBAAgB,GAChB,qBAAqB,GACrB,kBAAkB,GAClB,cAAc,GACd,yBAAyB,GACzB,4BAA4B,GAC5B,SAAS,CAAC;AAEd,eAAO,MAAM,QAAQ,EAAE,SAAS,MAAM,EAkBrC,CAAC;AAEF,iEAAiE;AACjE,MAAM,MAAM,IAAI,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAEpC,MAAM,WAAW,UAAU;IACzB,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,IAAI,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,OAAO;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,4DAA4D;IAC5D,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,kEAAkE;IAClE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,UAAU,CAAC;CACzB;AAED,+CAA+C;AAC/C,MAAM,WAAW,SAAS;IACxB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;IAC1C,iBAAiB,IAAI,MAAM,EAAE,CAAC;IAC9B,oGAAoG;IACpG,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,MAAM,EAAE,GAAG,OAAO,CAAC;CACtE;AAED,MAAM,WAAW,YAAY;IAC3B,8EAA8E;IAC9E,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IAChC,kEAAkE;IAClE,UAAU,EAAE,SAAS,MAAM,EAAE,CAAC;IAC9B,wGAAwG;IACxG,OAAO,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC;CACrC;AAmED;;;;GAIG;AACH,wBAAgB,eAAe,CAC7B,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,MAAM,GAAG,IAAI,EACrB,IAAI,EAAE,MAAM,EACZ,UAAU,EAAE,SAAS,MAAM,EAAE,GAC5B,OAAO,CAOT;AAED,4DAA4D;AAC5D,wBAAgB,SAAS,CAAC,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,YAAY,GAAG,OAAO,EAAE,CAiR3E;AAED,MAAM,WAAW,cAAc,CAAC,CAAC;IAC/B,EAAE,EAAE,CAAC,CAAC;IACN,IAAI,EAAE,SAAS,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,2FAA2F;AAC3F,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,OAAO,CAAC;CACf;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,EAChC,IAAI,EAAE,OAAO,EACb,SAAS,EAAE,CAAC,EAAE,EACd,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,KAAK,MAAM,EACvB,OAAO,EAAE,CAAC,EAAE,EAAE,CAAC,KAAK,YAAY,GAAG,IAAI,EACvC,SAAS,GAAE,iBAAiB,GAAG,wBAA4C,GAC1E;IAAE,IAAI,EAAE,CAAC,EAAE,CAAC;IAAC,QAAQ,EAAE,cAAc,CAAC,CAAC,CAAC,EAAE,CAAA;CAAE,CAgD9C"}
|