@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,28 +1,38 @@
|
|
|
1
|
-
<!-- command-actions.js
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
<!-- command-actions.js shows how to register custom actions: listen for your
|
|
2
|
+
`--command` on its `commandfor` target, or for `zazz:command-select` on
|
|
3
|
+
the root. -->
|
|
4
|
+
<ui-command
|
|
5
|
+
data-command-hotkey="mod+j"
|
|
6
|
+
id="command-actions-target"
|
|
7
|
+
style="
|
|
8
|
+
--w: 100%;
|
|
9
|
+
--max-w: 96;
|
|
10
|
+
"
|
|
11
|
+
>
|
|
6
12
|
<button
|
|
7
|
-
|
|
13
|
+
data-ui="button"
|
|
8
14
|
type="button"
|
|
9
|
-
data-variant="outline"
|
|
15
|
+
data-button-variant="outline"
|
|
10
16
|
popovertarget="command-example-actions-1"
|
|
11
|
-
data-slot="
|
|
17
|
+
data-command-slot="open"
|
|
18
|
+
style="
|
|
19
|
+
--justify: space-between;
|
|
20
|
+
--w: 100%;
|
|
21
|
+
"
|
|
12
22
|
>
|
|
13
|
-
<span
|
|
23
|
+
<span style="--text: var(--color-muted-foreground)">Quick actions...</span>
|
|
14
24
|
<ui-kbd-group><kbd>⌘</kbd><kbd>J</kbd></ui-kbd-group>
|
|
15
25
|
</button>
|
|
16
26
|
<div
|
|
17
27
|
id="command-example-actions-1"
|
|
18
|
-
data-slot="
|
|
19
|
-
data-side="bottom"
|
|
20
|
-
data-align="start"
|
|
28
|
+
data-command-slot="panel"
|
|
29
|
+
data-popover-side="bottom"
|
|
30
|
+
data-popover-align="start"
|
|
21
31
|
popover="auto"
|
|
22
32
|
>
|
|
23
|
-
<header data-slot="
|
|
33
|
+
<header data-command-slot="header">
|
|
24
34
|
<input
|
|
25
|
-
data-slot="
|
|
35
|
+
data-command-slot="input"
|
|
26
36
|
type="text"
|
|
27
37
|
placeholder="Type a command..."
|
|
28
38
|
role="combobox"
|
|
@@ -32,52 +42,57 @@
|
|
|
32
42
|
aria-label="Search commands"
|
|
33
43
|
/>
|
|
34
44
|
</header>
|
|
35
|
-
<div role="listbox" data-slot="
|
|
45
|
+
<div role="listbox" data-command-slot="list" aria-label="Commands">
|
|
36
46
|
<button
|
|
37
47
|
role="option"
|
|
38
|
-
data-slot="
|
|
39
|
-
|
|
40
|
-
data-variant="ghost"
|
|
48
|
+
data-command-slot="item"
|
|
49
|
+
data-ui="button"
|
|
50
|
+
data-button-variant="ghost"
|
|
41
51
|
type="button"
|
|
42
52
|
command="--theme-toggle"
|
|
43
53
|
commandfor="command-actions-target"
|
|
44
54
|
tabindex="-1"
|
|
45
|
-
data-keywords="dark light mode appearance"
|
|
46
|
-
data-stay-open
|
|
55
|
+
data-command-keywords="dark light mode appearance"
|
|
56
|
+
data-command-stay-open
|
|
57
|
+
style="--justify: start"
|
|
47
58
|
>
|
|
48
59
|
Toggle theme
|
|
49
60
|
</button>
|
|
50
61
|
<button
|
|
51
62
|
role="option"
|
|
52
|
-
data-slot="
|
|
53
|
-
|
|
54
|
-
data-variant="ghost"
|
|
63
|
+
data-command-slot="item"
|
|
64
|
+
data-ui="button"
|
|
65
|
+
data-button-variant="ghost"
|
|
55
66
|
type="button"
|
|
56
67
|
command="--copy-link"
|
|
57
68
|
commandfor="command-actions-target"
|
|
58
69
|
tabindex="-1"
|
|
59
|
-
data-keywords="share url clipboard"
|
|
70
|
+
data-command-keywords="share url clipboard"
|
|
71
|
+
style="--justify: start"
|
|
60
72
|
>
|
|
61
73
|
Copy link
|
|
62
74
|
</button>
|
|
63
75
|
<button
|
|
64
76
|
role="option"
|
|
65
|
-
data-slot="
|
|
66
|
-
|
|
67
|
-
data-variant="ghost"
|
|
77
|
+
data-command-slot="item"
|
|
78
|
+
data-ui="button"
|
|
79
|
+
data-button-variant="ghost"
|
|
68
80
|
type="button"
|
|
69
81
|
command="--toast-success"
|
|
70
82
|
commandfor="command-actions-toaster"
|
|
71
|
-
data-title="Saved"
|
|
72
|
-
data-description="Your changes are safe."
|
|
83
|
+
data-toaster-title="Saved"
|
|
84
|
+
data-toaster-description="Your changes are safe."
|
|
73
85
|
tabindex="-1"
|
|
74
|
-
data-keywords="notify notification"
|
|
86
|
+
data-command-keywords="notify notification"
|
|
87
|
+
style="--justify: start"
|
|
75
88
|
>
|
|
76
89
|
Show a toast
|
|
77
90
|
</button>
|
|
78
91
|
</div>
|
|
79
|
-
<p data-slot="
|
|
80
|
-
|
|
92
|
+
<p data-command-slot="empty" style="--text: var(--color-muted-foreground)">
|
|
93
|
+
No commands found.
|
|
94
|
+
</p>
|
|
95
|
+
<footer data-command-slot="footer">
|
|
81
96
|
<span
|
|
82
97
|
><ui-kbd-group><kbd>↑</kbd><kbd>↓</kbd></ui-kbd-group> navigate</span
|
|
83
98
|
>
|
|
@@ -86,4 +101,4 @@
|
|
|
86
101
|
</div>
|
|
87
102
|
</ui-command>
|
|
88
103
|
|
|
89
|
-
<ui-toaster id="command-actions-toaster" data-position="bottom-end"></ui-toaster>
|
|
104
|
+
<ui-toaster id="command-actions-toaster" data-toaster-position="bottom-end"></ui-toaster>
|
|
@@ -17,18 +17,16 @@
|
|
|
17
17
|
* from the `<ui-command>` root (`detail: { item, value }`); use it for
|
|
18
18
|
* palette-wide concerns like analytics.
|
|
19
19
|
*/
|
|
20
|
-
// --- Custom invoker commands ---
|
|
21
20
|
/**
|
|
22
|
-
* @description Binds this page's custom `--command` handlers
|
|
23
|
-
*
|
|
24
|
-
* Commands contract.
|
|
21
|
+
* @description Binds this page's custom `--command` handlers on the command
|
|
22
|
+
* *target* (the `commandfor` element).
|
|
25
23
|
*/
|
|
26
24
|
function initCommandActions() {
|
|
27
25
|
const themeTarget = document.getElementById("command-actions-target");
|
|
28
26
|
if (!themeTarget)
|
|
29
27
|
return;
|
|
30
|
-
// The invokers polyfill can deliver the same command twice in one task even
|
|
31
|
-
// with native support
|
|
28
|
+
// The invokers polyfill can deliver the same command twice in one task, even
|
|
29
|
+
// with native support.
|
|
32
30
|
let lastEvent = null;
|
|
33
31
|
themeTarget.addEventListener("command", (event) => {
|
|
34
32
|
if (event === lastEvent)
|
|
@@ -36,16 +34,21 @@ function initCommandActions() {
|
|
|
36
34
|
lastEvent = event;
|
|
37
35
|
const command = event.command;
|
|
38
36
|
switch (command) {
|
|
39
|
-
case "--theme-toggle":
|
|
40
|
-
|
|
37
|
+
case "--theme-toggle": {
|
|
38
|
+
// data-ui-theme pins the scheme; unset follows the system
|
|
39
|
+
const root = document.documentElement;
|
|
40
|
+
const dark = root.dataset.uiTheme
|
|
41
|
+
? root.dataset.uiTheme === "dark"
|
|
42
|
+
: matchMedia("(prefers-color-scheme: dark)").matches;
|
|
43
|
+
root.dataset.uiTheme = dark ? "light" : "dark";
|
|
41
44
|
break;
|
|
45
|
+
}
|
|
42
46
|
case "--copy-link":
|
|
43
47
|
void navigator.clipboard?.writeText(window.location.href);
|
|
44
48
|
break;
|
|
45
49
|
}
|
|
46
50
|
});
|
|
47
51
|
}
|
|
48
|
-
// --- Palette-wide hook ---
|
|
49
52
|
/**
|
|
50
53
|
* @description Logs every command activation: swap for analytics, recents
|
|
51
54
|
* tracking, or any cross-cutting concern.
|
|
@@ -56,7 +59,6 @@ function initCommandSelectLogging() {
|
|
|
56
59
|
console.info("[command] selected:", detail.value);
|
|
57
60
|
});
|
|
58
61
|
}
|
|
59
|
-
// --- Auto-initialization ---
|
|
60
62
|
if (typeof window !== "undefined" && typeof document !== "undefined") {
|
|
61
63
|
const init = () => {
|
|
62
64
|
initCommandActions();
|
|
@@ -19,19 +19,16 @@
|
|
|
19
19
|
* palette-wide concerns like analytics.
|
|
20
20
|
*/
|
|
21
21
|
|
|
22
|
-
// --- Custom invoker commands ---
|
|
23
|
-
|
|
24
22
|
/**
|
|
25
|
-
* @description Binds this page's custom `--command` handlers
|
|
26
|
-
*
|
|
27
|
-
* Commands contract.
|
|
23
|
+
* @description Binds this page's custom `--command` handlers on the command
|
|
24
|
+
* *target* (the `commandfor` element).
|
|
28
25
|
*/
|
|
29
26
|
function initCommandActions(): void {
|
|
30
27
|
const themeTarget = document.getElementById("command-actions-target");
|
|
31
28
|
if (!themeTarget) return;
|
|
32
29
|
|
|
33
|
-
// The invokers polyfill can deliver the same command twice in one task even
|
|
34
|
-
// with native support
|
|
30
|
+
// The invokers polyfill can deliver the same command twice in one task, even
|
|
31
|
+
// with native support.
|
|
35
32
|
let lastEvent: Event | null = null;
|
|
36
33
|
|
|
37
34
|
themeTarget.addEventListener("command", (event) => {
|
|
@@ -40,9 +37,15 @@ function initCommandActions(): void {
|
|
|
40
37
|
|
|
41
38
|
const command = (event as CommandEvent).command;
|
|
42
39
|
switch (command) {
|
|
43
|
-
case "--theme-toggle":
|
|
44
|
-
|
|
40
|
+
case "--theme-toggle": {
|
|
41
|
+
// data-ui-theme pins the scheme; unset follows the system
|
|
42
|
+
const root = document.documentElement;
|
|
43
|
+
const dark = root.dataset.uiTheme
|
|
44
|
+
? root.dataset.uiTheme === "dark"
|
|
45
|
+
: matchMedia("(prefers-color-scheme: dark)").matches;
|
|
46
|
+
root.dataset.uiTheme = dark ? "light" : "dark";
|
|
45
47
|
break;
|
|
48
|
+
}
|
|
46
49
|
case "--copy-link":
|
|
47
50
|
void navigator.clipboard?.writeText(window.location.href);
|
|
48
51
|
break;
|
|
@@ -50,8 +53,6 @@ function initCommandActions(): void {
|
|
|
50
53
|
});
|
|
51
54
|
}
|
|
52
55
|
|
|
53
|
-
// --- Palette-wide hook ---
|
|
54
|
-
|
|
55
56
|
/**
|
|
56
57
|
* @description Logs every command activation: swap for analytics, recents
|
|
57
58
|
* tracking, or any cross-cutting concern.
|
|
@@ -63,8 +64,6 @@ function initCommandSelectLogging(): void {
|
|
|
63
64
|
});
|
|
64
65
|
}
|
|
65
66
|
|
|
66
|
-
// --- Auto-initialization ---
|
|
67
|
-
|
|
68
67
|
if (typeof window !== "undefined" && typeof document !== "undefined") {
|
|
69
68
|
const init = (): void => {
|
|
70
69
|
initCommandActions();
|
|
@@ -1,19 +1,29 @@
|
|
|
1
|
-
<ui-command
|
|
1
|
+
<ui-command
|
|
2
|
+
data-command-hotkey="mod+shift+k"
|
|
3
|
+
style="
|
|
4
|
+
--w: 100%;
|
|
5
|
+
--max-w: 96;
|
|
6
|
+
"
|
|
7
|
+
>
|
|
2
8
|
<button
|
|
3
|
-
|
|
9
|
+
data-ui="button"
|
|
4
10
|
type="button"
|
|
5
|
-
data-variant="outline"
|
|
11
|
+
data-button-variant="outline"
|
|
6
12
|
command="show-modal"
|
|
7
13
|
commandfor="command-example-dialog-1"
|
|
8
|
-
data-slot="
|
|
14
|
+
data-command-slot="open"
|
|
15
|
+
style="
|
|
16
|
+
--justify: space-between;
|
|
17
|
+
--w: 100%;
|
|
18
|
+
"
|
|
9
19
|
>
|
|
10
|
-
<span
|
|
20
|
+
<span style="--text: var(--color-muted-foreground)">Command palette...</span>
|
|
11
21
|
<ui-kbd-group><kbd>⌘</kbd><kbd>⇧</kbd><kbd>K</kbd></ui-kbd-group>
|
|
12
22
|
</button>
|
|
13
|
-
<dialog id="command-example-dialog-1"
|
|
14
|
-
<header data-slot="
|
|
23
|
+
<dialog id="command-example-dialog-1" data-ui="dialog" data-command-slot="panel" closedby="any">
|
|
24
|
+
<header data-command-slot="header">
|
|
15
25
|
<input
|
|
16
|
-
data-slot="
|
|
26
|
+
data-command-slot="input"
|
|
17
27
|
type="text"
|
|
18
28
|
placeholder="Type a command or search..."
|
|
19
29
|
role="combobox"
|
|
@@ -23,50 +33,64 @@
|
|
|
23
33
|
aria-label="Search commands"
|
|
24
34
|
/>
|
|
25
35
|
</header>
|
|
26
|
-
<div role="listbox" data-slot="
|
|
27
|
-
<div role="group" data-slot="
|
|
36
|
+
<div role="listbox" data-command-slot="list" aria-label="Commands">
|
|
37
|
+
<div role="group" data-command-slot="group" aria-labelledby="command-example-dialog-1-nav">
|
|
28
38
|
<span
|
|
29
|
-
|
|
30
|
-
data-slot="command-group-label"
|
|
39
|
+
data-command-slot="group-label"
|
|
31
40
|
id="command-example-dialog-1-nav"
|
|
41
|
+
style="
|
|
42
|
+
--display: inline-flex;
|
|
43
|
+
--font-size: var(--font-size-eyebrow);
|
|
44
|
+
--font-weight: strong;
|
|
45
|
+
--font-weight: var(--font-weight-eyebrow);
|
|
46
|
+
--leading: var(--leading-eyebrow);
|
|
47
|
+
--tracking: var(--tracking-eyebrow);
|
|
48
|
+
--text-transform: uppercase;
|
|
49
|
+
--text: var(--color-muted-foreground);
|
|
50
|
+
"
|
|
32
51
|
>Navigation</span
|
|
33
52
|
>
|
|
34
53
|
<a
|
|
35
54
|
role="option"
|
|
36
|
-
data-slot="
|
|
37
|
-
|
|
38
|
-
data-variant="ghost"
|
|
55
|
+
data-command-slot="item"
|
|
56
|
+
data-ui="button"
|
|
57
|
+
data-button-variant="ghost"
|
|
39
58
|
href="#home"
|
|
40
59
|
tabindex="-1"
|
|
60
|
+
style="--justify: start"
|
|
41
61
|
>
|
|
42
62
|
Go home
|
|
43
63
|
</a>
|
|
44
64
|
<a
|
|
45
65
|
role="option"
|
|
46
|
-
data-slot="
|
|
47
|
-
|
|
48
|
-
data-variant="ghost"
|
|
66
|
+
data-command-slot="item"
|
|
67
|
+
data-ui="button"
|
|
68
|
+
data-button-variant="ghost"
|
|
49
69
|
href="#projects"
|
|
50
70
|
tabindex="-1"
|
|
51
|
-
data-keywords="work portfolio"
|
|
71
|
+
data-command-keywords="work portfolio"
|
|
72
|
+
style="--justify: start"
|
|
52
73
|
>
|
|
53
74
|
Go to projects
|
|
54
75
|
</a>
|
|
55
76
|
<a
|
|
56
77
|
role="option"
|
|
57
|
-
data-slot="
|
|
58
|
-
|
|
59
|
-
data-variant="ghost"
|
|
78
|
+
data-command-slot="item"
|
|
79
|
+
data-ui="button"
|
|
80
|
+
data-button-variant="ghost"
|
|
60
81
|
href="#team"
|
|
61
82
|
tabindex="-1"
|
|
62
|
-
data-keywords="people members"
|
|
83
|
+
data-command-keywords="people members"
|
|
84
|
+
style="--justify: start"
|
|
63
85
|
>
|
|
64
86
|
Go to team
|
|
65
87
|
</a>
|
|
66
88
|
</div>
|
|
67
89
|
</div>
|
|
68
|
-
<p data-slot="
|
|
69
|
-
|
|
90
|
+
<p data-command-slot="empty" style="--text: var(--color-muted-foreground)">
|
|
91
|
+
No commands found.
|
|
92
|
+
</p>
|
|
93
|
+
<footer data-command-slot="footer">
|
|
70
94
|
<span
|
|
71
95
|
><ui-kbd-group><kbd>↑</kbd><kbd>↓</kbd></ui-kbd-group> navigate</span
|
|
72
96
|
>
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* command.css: Command (ui-command |
|
|
2
|
+
* command.css: Command (ui-command | [data-ui~="command"], [data-command-slot~="panel"])
|
|
3
3
|
*
|
|
4
4
|
* @layer variables, components
|
|
5
|
-
* @requires
|
|
5
|
+
* @requires _layers.css, _variables.css, popover.css, button.css, fields.css,
|
|
6
6
|
* dialog.css, menu.css, select.css (--ui-option-*), kbd.css (--ui-kbd-group-*)
|
|
7
7
|
* @uses popovertarget + [popover="auto"]: dropdown surface, native light dismiss
|
|
8
|
-
* @uses <dialog
|
|
8
|
+
* @uses <dialog data-ui="dialog"> + command="show-modal": focused surface
|
|
9
9
|
* @uses anchor-name, anchor-scope, position-anchor: tether the popover form
|
|
10
10
|
* @uses :has(): group + empty-state visibility without JavaScript
|
|
11
11
|
* @tokens --ui-command-* (@layer variables); items alias --ui-option-*
|
|
@@ -14,19 +14,20 @@
|
|
|
14
14
|
|
|
15
15
|
@layer variables {
|
|
16
16
|
:root {
|
|
17
|
-
--ui-command-min-
|
|
18
|
-
--ui-command-max-
|
|
17
|
+
--ui-command-min-w: calc(var(--spacing) * 96);
|
|
18
|
+
--ui-command-max-h: calc(var(--spacing) * 96);
|
|
19
19
|
--ui-command-option-gap: var(--ui-field-option-gap);
|
|
20
|
-
--ui-command-input-
|
|
21
|
-
--ui-command-input-border: 1px solid var(--border);
|
|
22
|
-
--ui-command-group-label-padding: var(--
|
|
23
|
-
|
|
24
|
-
--ui-command-footer-
|
|
20
|
+
--ui-command-input-p: calc(var(--spacing) * 3);
|
|
21
|
+
--ui-command-input-border: 1px solid var(--color-border);
|
|
22
|
+
--ui-command-group-label-padding: calc(var(--spacing) * 2) calc(var(--spacing) * 2)
|
|
23
|
+
var(--spacing);
|
|
24
|
+
--ui-command-footer-p: calc(var(--spacing) * 2);
|
|
25
|
+
--ui-command-footer-border: 1px solid var(--color-border);
|
|
25
26
|
--ui-command-shadow: var(--ui-menu-shadow);
|
|
26
27
|
}
|
|
27
28
|
}
|
|
28
29
|
|
|
29
|
-
@layer
|
|
30
|
+
@layer ui.components {
|
|
30
31
|
/* ===========================================================================
|
|
31
32
|
COMMAND: palette panel (popover or dialog) with the input inside
|
|
32
33
|
- The popover form rides popover.css's surface + placement; the dialog form
|
|
@@ -34,51 +35,54 @@
|
|
|
34
35
|
hairline, scrollable list, eyebrow group labels, hint footer.
|
|
35
36
|
=========================================================================== */
|
|
36
37
|
|
|
37
|
-
:where(ui-command,
|
|
38
|
+
:where(ui-command, [data-ui~="command"]) {
|
|
38
39
|
anchor-scope: --ui-command-trigger;
|
|
39
40
|
display: inline-flex;
|
|
40
41
|
}
|
|
41
42
|
|
|
42
|
-
:where(ui-command,
|
|
43
|
+
:where(ui-command, [data-ui~="command"]) > :where([popovertarget], [command]) {
|
|
43
44
|
anchor-name: --ui-command-trigger;
|
|
44
45
|
}
|
|
45
46
|
|
|
46
|
-
[data-
|
|
47
|
+
:where(ui-command, [data-ui~="command"]) [data-command-slot~="panel"] {
|
|
47
48
|
/* flex-direction stays ungated so the close fade (display held by the
|
|
48
49
|
allow-discrete transition) keeps the column layout to the last frame */
|
|
49
50
|
flex-direction: column;
|
|
50
|
-
|
|
51
|
+
--_min-w-len: var(--_min-w-resolved, var(--ui-command-min-w));
|
|
52
|
+
--_min-w-num: var(--_min-w-resolved, var(--ui-command-min-w));
|
|
53
|
+
min-inline-size: calc(var(--_min-w-len) + var(--_min-w-num) * var(--spacing));
|
|
51
54
|
box-shadow: var(--ui-command-shadow);
|
|
52
55
|
}
|
|
53
56
|
|
|
54
57
|
/* Only display is gated; unconditional it would defeat the UA's
|
|
55
58
|
display: none on closed popovers and dialogs */
|
|
56
|
-
[data-
|
|
59
|
+
:where(ui-command, [data-ui~="command"])
|
|
60
|
+
[data-command-slot~="panel"]:where(:popover-open, [open]) {
|
|
57
61
|
display: flex;
|
|
58
62
|
}
|
|
59
63
|
|
|
60
|
-
[data-
|
|
64
|
+
:where(ui-command, [data-ui~="command"]) [data-command-slot~="panel"]:where([popover]) {
|
|
61
65
|
position-anchor: --ui-command-trigger;
|
|
62
66
|
padding: 0;
|
|
63
67
|
}
|
|
64
68
|
|
|
65
69
|
/* Dialog form: the palette owns its interior, edge to edge */
|
|
66
|
-
[data-
|
|
67
|
-
--ui-dialog-
|
|
70
|
+
:where(ui-command, [data-ui~="command"]) [data-command-slot~="panel"]:where(dialog) {
|
|
71
|
+
--ui-dialog-w: min(var(--layout-sm), 100% - var(--gutters) * 2);
|
|
68
72
|
padding: 0;
|
|
69
73
|
}
|
|
70
74
|
|
|
71
75
|
/* Search input: borderless over a hairline; the panel is the surface */
|
|
72
|
-
[data-
|
|
76
|
+
:where(ui-command, [data-ui~="command"]) [data-command-slot~="header"] {
|
|
73
77
|
display: flex;
|
|
74
78
|
align-items: center;
|
|
75
79
|
border-block-end: var(--ui-command-input-border);
|
|
76
80
|
}
|
|
77
81
|
|
|
78
|
-
[data-
|
|
82
|
+
:where(ui-command, [data-ui~="command"]) [data-command-slot~="input"] {
|
|
79
83
|
flex: 1;
|
|
80
84
|
min-inline-size: 0;
|
|
81
|
-
padding: var(--ui-command-input-
|
|
85
|
+
padding: var(--ui-command-input-p);
|
|
82
86
|
font: inherit;
|
|
83
87
|
font-size: var(--ui-field-font-size);
|
|
84
88
|
color: inherit;
|
|
@@ -87,65 +91,71 @@
|
|
|
87
91
|
outline: none;
|
|
88
92
|
}
|
|
89
93
|
|
|
90
|
-
[data-
|
|
94
|
+
:where(ui-command, [data-ui~="command"]) [data-command-slot~="list"] {
|
|
91
95
|
display: flex;
|
|
92
96
|
flex-direction: column;
|
|
93
97
|
gap: var(--ui-command-option-gap);
|
|
94
|
-
max-block-size: var(--ui-command-max-
|
|
95
|
-
padding: var(--ui-popover-
|
|
98
|
+
max-block-size: var(--ui-command-max-h);
|
|
99
|
+
padding: var(--ui-popover-p);
|
|
96
100
|
margin: 0;
|
|
97
|
-
overflow: auto;
|
|
101
|
+
overflow-y: auto;
|
|
102
|
+
overflow-x: clip;
|
|
98
103
|
list-style: none;
|
|
99
104
|
}
|
|
100
105
|
|
|
101
|
-
[data-
|
|
106
|
+
:where(ui-command, [data-ui~="command"]) [data-command-slot~="group"] {
|
|
102
107
|
display: flex;
|
|
103
108
|
flex-direction: column;
|
|
104
109
|
gap: var(--ui-command-option-gap);
|
|
105
110
|
}
|
|
106
111
|
|
|
107
|
-
[data-
|
|
112
|
+
:where(ui-command, [data-ui~="command"]) [data-command-slot~="group-label"] {
|
|
108
113
|
padding: var(--ui-command-group-label-padding);
|
|
109
114
|
/* Score ranking writes order -1000..0 on sibling items; keep the label first */
|
|
110
115
|
order: -1001;
|
|
111
116
|
}
|
|
112
117
|
|
|
113
|
-
[data-
|
|
118
|
+
:where(ui-command, [data-ui~="command"]) [data-command-slot~="item"] {
|
|
114
119
|
cursor: pointer;
|
|
115
120
|
}
|
|
116
121
|
|
|
117
|
-
[data-
|
|
118
|
-
|
|
119
|
-
--
|
|
122
|
+
:where(ui-command, [data-ui~="command"])
|
|
123
|
+
[data-command-slot~="item"][data-command-state~="highlighted"] {
|
|
124
|
+
--_button-bg: var(--ui-button-bg--hover);
|
|
125
|
+
--_button-text: var(--ui-button-text--hover);
|
|
120
126
|
}
|
|
121
127
|
|
|
122
128
|
/* Shortcut hint: a lone <kbd> or a <ui-kbd-group> run pushes to the end;
|
|
123
129
|
spacing between keys inside a run is the group's --ui-kbd-group-gap. */
|
|
124
|
-
[data-
|
|
130
|
+
:where(ui-command, [data-ui~="command"])
|
|
131
|
+
[data-command-slot~="item"]
|
|
132
|
+
> :where(kbd, ui-kbd-group, [data-ui~="kbd-group"]) {
|
|
125
133
|
margin-inline-start: auto;
|
|
126
134
|
}
|
|
127
135
|
|
|
128
|
-
[data-
|
|
136
|
+
:where(ui-command, [data-ui~="command"]) [data-command-slot~="footer"] {
|
|
129
137
|
display: flex;
|
|
130
138
|
align-items: center;
|
|
131
|
-
gap: var(--
|
|
132
|
-
padding: var(--ui-command-footer-
|
|
139
|
+
gap: calc(var(--spacing) * 2);
|
|
140
|
+
padding: var(--ui-command-footer-p);
|
|
133
141
|
border-block-start: var(--ui-command-footer-border);
|
|
134
|
-
color: var(--muted-foreground);
|
|
142
|
+
color: var(--color-muted-foreground);
|
|
135
143
|
font-size: var(--font-size-xs);
|
|
136
144
|
}
|
|
137
145
|
|
|
138
|
-
|
|
146
|
+
:where(ui-command, [data-ui~="command"])
|
|
147
|
+
[data-command-slot~="group"]:not(:has([data-command-slot~="item"]:not([hidden]))) {
|
|
139
148
|
display: none;
|
|
140
149
|
}
|
|
141
150
|
|
|
142
|
-
[data-
|
|
151
|
+
:where(ui-command, [data-ui~="command"]) [data-command-slot~="empty"] {
|
|
143
152
|
display: none;
|
|
144
|
-
padding: var(--
|
|
153
|
+
padding: calc(var(--spacing) * 2);
|
|
145
154
|
}
|
|
146
155
|
|
|
147
|
-
|
|
148
|
-
[data-slot~="command-
|
|
156
|
+
:where(ui-command, [data-ui~="command"])
|
|
157
|
+
[data-command-slot~="panel"]:not(:has([data-command-slot~="item"]:not([hidden])))
|
|
158
|
+
[data-command-slot~="empty"] {
|
|
149
159
|
display: block;
|
|
150
160
|
}
|
|
151
161
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @fileoverview `<ui-command>`: a command menu for search and quick actions.
|
|
3
3
|
* @description Light-DOM custom element on the shared typeahead engine
|
|
4
|
-
* (`base/typeahead.ts`)
|
|
5
|
-
* dropdown or a `<dialog
|
|
4
|
+
* (`base/typeahead.ts`). The panel (a `popover="auto"`
|
|
5
|
+
* dropdown or a `<dialog data-ui="dialog">`) contains the search input;
|
|
6
6
|
* items rank by match score and the best match auto-highlights.
|
|
7
7
|
*
|
|
8
8
|
* Actions are the platform's own vocabulary: navigation items are real
|
|
@@ -15,14 +15,17 @@
|
|
|
15
15
|
*
|
|
16
16
|
* Attributes:
|
|
17
17
|
* - `data-command-hotkey` (root): global toggle shortcut, e.g. `"mod+k"`.
|
|
18
|
-
* - `data-hotkey` (item): global accelerator that activates the item, active
|
|
18
|
+
* - `data-command-hotkey` (item): global accelerator that activates the item, active
|
|
19
19
|
* while the element is connected (even with the panel closed).
|
|
20
|
-
* - `data-stay-open` (item): keep the panel open after activation.
|
|
21
|
-
* - `data-sort="document"` (root): opt out of score ranking (default: score).
|
|
20
|
+
* - `data-command-stay-open` (item): keep the panel open after activation.
|
|
21
|
+
* - `data-command-sort="document"` (root): opt out of score ranking (default: score).
|
|
22
|
+
* - `data-command-filter="none"` (root): opt out of filtering for a list another
|
|
23
|
+
* source already filtered (a search index); items added later are highlighted
|
|
24
|
+
* and navigable like typed matches.
|
|
22
25
|
*
|
|
23
26
|
* Parts: `command-open` (trigger), `command-panel`, `command-header`,
|
|
24
27
|
* `command-input`, `command-list`, `command-group` / `command-group-label`,
|
|
25
|
-
* `command-item` (`data-value`, `data-keywords`), `command-kbd`,
|
|
28
|
+
* `command-item` (`data-command-value`, `data-command-keywords`), `command-kbd`,
|
|
26
29
|
* `command-footer`, `command-empty`.
|
|
27
30
|
*
|
|
28
31
|
* For complex custom actions, see the example `command-actions.ts`: listen
|
|
@@ -34,7 +37,7 @@ declare class UiCommand extends TypeaheadElement {
|
|
|
34
37
|
protected readonly slotPrefix = "command";
|
|
35
38
|
protected readonly managesPanel: boolean;
|
|
36
39
|
protected readonly autoHighlight: boolean;
|
|
37
|
-
/**
|
|
40
|
+
/** Ranks by score unless `data-command-sort="document"`. */
|
|
38
41
|
protected get sortByScore(): boolean;
|
|
39
42
|
protected setup(signal: AbortSignal): void;
|
|
40
43
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command.d.ts","sourceRoot":"","sources":["command.ts"],"names":[],"mappings":"AAEA
|
|
1
|
+
{"version":3,"file":"command.d.ts","sourceRoot":"","sources":["command.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAI3D,cAAM,SAAU,SAAQ,gBAAgB;;IACtC,SAAS,CAAC,QAAQ,CAAC,UAAU,aAAa;IAC1C,SAAS,CAAC,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAS;IACjD,SAAS,CAAC,QAAQ,CAAC,aAAa,EAAE,OAAO,CAAQ;IAEjD,4DAA4D;IAC5D,SAAS,KAAK,WAAW,IAAI,OAAO,CAEnC;IAED,SAAS,CAAC,KAAK,CAAC,MAAM,EAAE,WAAW,GAAG,IAAI,CA2CzC;IAED;;;;;;;;OAQG;IACH,SAAS,CAAC,MAAM,CAAC,IAAI,EAAE,WAAW,EAAE,MAAM,EAAE,UAAU,GAAG,SAAS,GAAG,IAAI,CAKxE;CA6DF;AAID,OAAO,EAAE,SAAS,EAAE,CAAC"}
|