@zazz-ui/core 0.4.0 → 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 +341 -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 +45 -43
- 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 +147 -126
- 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 +89 -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 +299 -191
- 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,17 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* accordion.css: Accordion (ui-accordion |
|
|
2
|
+
* accordion.css: Accordion (ui-accordion | [data-ui~="accordion"] on <details>/<summary>)
|
|
3
3
|
*
|
|
4
4
|
* @layer variables, reset, components
|
|
5
|
-
* @requires
|
|
5
|
+
* @requires _layers.css, _variables.css, _properties.css (--_focus-ring)
|
|
6
6
|
* @uses ::details-content: native open/close block-size transition (reset layer)
|
|
7
7
|
* @uses interpolate-size: allow-keywords (from _variables.css; required for
|
|
8
8
|
* block-size: 0 -> auto transitions)
|
|
9
|
-
* @tokens --ui-accordion-* (@layer variables)
|
|
9
|
+
* @tokens --ui-accordion-* (@layer variables; none backs a utility)
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
12
|
@layer variables {
|
|
13
13
|
:root {
|
|
14
|
-
--ui-accordion-icon-size: var(--
|
|
14
|
+
--ui-accordion-icon-size: calc(var(--spacing) * 4);
|
|
15
15
|
--ui-accordion-icon-transform--open: rotate(-180deg);
|
|
16
16
|
}
|
|
17
17
|
}
|
|
@@ -19,7 +19,6 @@
|
|
|
19
19
|
@layer reset {
|
|
20
20
|
/* ===========================================================================
|
|
21
21
|
DETAILS & SUMMARY: native open/close transition + summary marker reset
|
|
22
|
-
- In the reset layer so the :where(ui-accordion, .ui-accordion) component styling below wins.
|
|
23
22
|
=========================================================================== */
|
|
24
23
|
|
|
25
24
|
:where(details)::details-content {
|
|
@@ -48,30 +47,32 @@
|
|
|
48
47
|
}
|
|
49
48
|
}
|
|
50
49
|
|
|
51
|
-
@layer
|
|
52
|
-
:where(ui-accordion,
|
|
50
|
+
@layer ui.components {
|
|
51
|
+
:where(ui-accordion, [data-ui~="accordion"]) {
|
|
53
52
|
display: grid;
|
|
54
53
|
inline-size: 100%;
|
|
55
54
|
flex: 1;
|
|
56
55
|
}
|
|
57
56
|
|
|
58
|
-
:where(ui-accordion,
|
|
57
|
+
:where(ui-accordion, [data-ui~="accordion"]) > details {
|
|
59
58
|
display: grid;
|
|
60
59
|
flex: 1 0 auto;
|
|
61
60
|
}
|
|
62
61
|
|
|
63
|
-
:where(ui-accordion,
|
|
62
|
+
:where(ui-accordion, [data-ui~="accordion"]) > details > summary {
|
|
64
63
|
display: flex;
|
|
65
64
|
align-items: center;
|
|
66
65
|
justify-content: space-between;
|
|
67
66
|
|
|
68
|
-
/* ring
|
|
69
|
-
|
|
67
|
+
/* The ring is published to --_focus-ring so a --shadow utility on the
|
|
68
|
+
summary keeps it; the ring widths grow from 0 so the ring eases in. */
|
|
70
69
|
--_ring-offset-width: 0px;
|
|
71
70
|
--_ring-width: 0px;
|
|
72
|
-
|
|
73
|
-
0 0 0 var(--_ring-offset-width) var(--ring-offset-color),
|
|
74
|
-
0 0 0 calc(var(--_ring-offset-width) + var(--_ring-width))
|
|
71
|
+
--_focus-ring:
|
|
72
|
+
0 0 0 var(--_ring-offset-width) var(--ring-offset-shadow-color),
|
|
73
|
+
0 0 0 calc(var(--_ring-offset-width) + var(--_ring-width))
|
|
74
|
+
var(--_ring-fill, var(--ring-shadow-color));
|
|
75
|
+
box-shadow: var(--_focus-ring, 0 0 #0000), var(--_shadow-resolved, 0 0 #0000);
|
|
75
76
|
|
|
76
77
|
/* transparent twin of the ring for forced-colors / high-contrast modes */
|
|
77
78
|
outline: var(--outline-width) var(--outline-style) transparent;
|
|
@@ -80,14 +81,14 @@
|
|
|
80
81
|
transition: var(--default-transition);
|
|
81
82
|
}
|
|
82
83
|
|
|
83
|
-
:where(ui-accordion,
|
|
84
|
+
:where(ui-accordion, [data-ui~="accordion"]) > details > summary:focus-visible {
|
|
84
85
|
--_ring-offset-width: var(--ring-offset-width);
|
|
85
86
|
--_ring-width: var(--ring-width);
|
|
86
87
|
|
|
87
88
|
outline-color: transparent;
|
|
88
89
|
}
|
|
89
90
|
|
|
90
|
-
:where(ui-accordion,
|
|
91
|
+
:where(ui-accordion, [data-ui~="accordion"]) summary > svg {
|
|
91
92
|
display: flex;
|
|
92
93
|
align-items: center;
|
|
93
94
|
justify-content: center;
|
|
@@ -98,7 +99,7 @@
|
|
|
98
99
|
var(--default-transition-timing-function);
|
|
99
100
|
}
|
|
100
101
|
|
|
101
|
-
:where(ui-accordion,
|
|
102
|
+
:where(ui-accordion, [data-ui~="accordion"]) > details[open] > summary > svg {
|
|
102
103
|
transform: var(--ui-accordion-icon-transform--open);
|
|
103
104
|
}
|
|
104
105
|
}
|
|
@@ -1,6 +1,17 @@
|
|
|
1
1
|
<ui-accordion>
|
|
2
|
-
<details
|
|
3
|
-
|
|
2
|
+
<details
|
|
3
|
+
style="
|
|
4
|
+
--py: 4;
|
|
5
|
+
--border-b: 1;
|
|
6
|
+
"
|
|
7
|
+
>
|
|
8
|
+
<summary
|
|
9
|
+
style="
|
|
10
|
+
--font-weight: strong;
|
|
11
|
+
--text: currentColor;
|
|
12
|
+
--text--hover: var(--color-muted-foreground);
|
|
13
|
+
"
|
|
14
|
+
>
|
|
4
15
|
What is an accordion?
|
|
5
16
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256">
|
|
6
17
|
<rect width="256" height="256" fill="none" />
|
|
@@ -14,7 +25,7 @@
|
|
|
14
25
|
/>
|
|
15
26
|
</svg>
|
|
16
27
|
</summary>
|
|
17
|
-
<div
|
|
28
|
+
<div style="--pb: 4">
|
|
18
29
|
<p>
|
|
19
30
|
A disclosure widget built from the native <code><details></code> and
|
|
20
31
|
<code><summary></code> elements. The open/close animation uses the
|
|
@@ -22,8 +33,19 @@
|
|
|
22
33
|
</p>
|
|
23
34
|
</div>
|
|
24
35
|
</details>
|
|
25
|
-
<details
|
|
26
|
-
|
|
36
|
+
<details
|
|
37
|
+
style="
|
|
38
|
+
--py: 4;
|
|
39
|
+
--border-b: 1;
|
|
40
|
+
"
|
|
41
|
+
>
|
|
42
|
+
<summary
|
|
43
|
+
style="
|
|
44
|
+
--font-weight: strong;
|
|
45
|
+
--text: currentColor;
|
|
46
|
+
--text--hover: var(--color-muted-foreground);
|
|
47
|
+
"
|
|
48
|
+
>
|
|
27
49
|
How does it work?
|
|
28
50
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256">
|
|
29
51
|
<rect width="256" height="256" fill="none" />
|
|
@@ -37,15 +59,26 @@
|
|
|
37
59
|
/>
|
|
38
60
|
</svg>
|
|
39
61
|
</summary>
|
|
40
|
-
<div
|
|
62
|
+
<div style="--pb: 4">
|
|
41
63
|
<p>
|
|
42
64
|
Each item is a separate <code><details></code>, so several can stay open at once.
|
|
43
65
|
Click a summary or focus it and press Enter to toggle.
|
|
44
66
|
</p>
|
|
45
67
|
</div>
|
|
46
68
|
</details>
|
|
47
|
-
<details
|
|
48
|
-
|
|
69
|
+
<details
|
|
70
|
+
style="
|
|
71
|
+
--py: 4;
|
|
72
|
+
--border-b: 1;
|
|
73
|
+
"
|
|
74
|
+
>
|
|
75
|
+
<summary
|
|
76
|
+
style="
|
|
77
|
+
--font-weight: strong;
|
|
78
|
+
--text: currentColor;
|
|
79
|
+
--text--hover: var(--color-muted-foreground);
|
|
80
|
+
"
|
|
81
|
+
>
|
|
49
82
|
Why use it?
|
|
50
83
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256">
|
|
51
84
|
<rect width="256" height="256" fill="none" />
|
|
@@ -59,7 +92,7 @@
|
|
|
59
92
|
/>
|
|
60
93
|
</svg>
|
|
61
94
|
</summary>
|
|
62
|
-
<div
|
|
95
|
+
<div style="--pb: 4">
|
|
63
96
|
<p>
|
|
64
97
|
Keyboard support, state, and accessibility come from the platform — Zazz only styles the
|
|
65
98
|
chrome through theme tokens.
|
|
@@ -1,38 +1,38 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* alert-dialog.css: Alert dialog (
|
|
2
|
+
* alert-dialog.css: Alert dialog ([data-ui~="alert-dialog"] on a [data-ui~="dialog"] <dialog>)
|
|
3
3
|
*
|
|
4
4
|
* @layer variables, components
|
|
5
|
-
* @requires
|
|
5
|
+
* @requires _layers.css, _variables.css, dialog.css
|
|
6
6
|
* @uses closedby="none": the alert contract: only an explicit choice closes it
|
|
7
7
|
* @uses command="show-modal" / command="close": Invoker Commands (polyfill: invokers)
|
|
8
|
-
* @tokens --ui-alert-dialog-* (@layer variables)
|
|
8
|
+
* @tokens --ui-alert-dialog-* (@layer variables; named after the utilities they back)
|
|
9
9
|
* @see dialog.css: owns the slots, motion, and backdrop this composes
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
12
|
@layer variables {
|
|
13
13
|
:root {
|
|
14
|
-
/*
|
|
15
|
-
--ui-alert-dialog-
|
|
16
|
-
--ui-alert-dialog-accent: var(--destructive);
|
|
14
|
+
/* narrower than the base dialog: an alert is a single question */
|
|
15
|
+
--ui-alert-dialog-w: min(45ch, 100% - var(--space-md) * 2);
|
|
16
|
+
--ui-alert-dialog-accent: var(--color-destructive);
|
|
17
17
|
--ui-alert-dialog-shadow: var(--ui-dialog-shadow);
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
@layer
|
|
21
|
+
@layer ui.components {
|
|
22
22
|
/* ===========================================================================
|
|
23
23
|
ALERT DIALOG: a dialog that requires an explicit response
|
|
24
|
-
- Composes
|
|
25
|
-
|
|
24
|
+
- Composes the dialog (data-ui="dialog alert-dialog"); only retunes dialog hooks
|
|
25
|
+
and colors the header accent.
|
|
26
26
|
- The contract lives in the markup: role="alertdialog", closedby="none",
|
|
27
|
-
no
|
|
27
|
+
no close slot.
|
|
28
28
|
=========================================================================== */
|
|
29
29
|
|
|
30
|
-
|
|
31
|
-
--ui-dialog-
|
|
30
|
+
:where([data-ui~="alert-dialog"]) {
|
|
31
|
+
--ui-dialog-w: var(--ui-alert-dialog-w);
|
|
32
32
|
--ui-dialog-shadow: var(--ui-alert-dialog-shadow);
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
|
|
35
|
+
:where([data-ui~="alert-dialog"]) [data-dialog-slot~="header"] {
|
|
36
36
|
color: var(--ui-alert-dialog-accent);
|
|
37
37
|
}
|
|
38
38
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<button
|
|
2
|
-
|
|
2
|
+
data-ui="button"
|
|
3
3
|
type="button"
|
|
4
|
-
data-variant="destructive"
|
|
4
|
+
data-button-variant="destructive"
|
|
5
5
|
command="show-modal"
|
|
6
6
|
commandfor="alert-dialog-example-1"
|
|
7
7
|
>
|
|
@@ -9,26 +9,40 @@
|
|
|
9
9
|
</button>
|
|
10
10
|
<dialog
|
|
11
11
|
id="alert-dialog-example-1"
|
|
12
|
-
|
|
12
|
+
data-ui="dialog alert-dialog"
|
|
13
13
|
role="alertdialog"
|
|
14
14
|
aria-labelledby="alert-dialog-example-1-title"
|
|
15
15
|
aria-describedby="alert-dialog-example-1-body"
|
|
16
16
|
closedby="none"
|
|
17
17
|
>
|
|
18
|
-
<div data-slot="
|
|
19
|
-
<header
|
|
20
|
-
|
|
18
|
+
<div data-dialog-slot="content">
|
|
19
|
+
<header
|
|
20
|
+
style="
|
|
21
|
+
--display: flex;
|
|
22
|
+
--items: center;
|
|
23
|
+
--gap: 2;
|
|
24
|
+
"
|
|
25
|
+
data-dialog-slot="header"
|
|
26
|
+
>
|
|
27
|
+
<svg style="--size: 6" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256">
|
|
21
28
|
<rect width="256" height="256" fill="none" />
|
|
22
29
|
<path
|
|
23
30
|
fill="currentColor"
|
|
24
31
|
d="M236.8,188.09,149.35,36.22h0a24.76,24.76,0,0,0-42.7,0L19.2,188.09a23.51,23.51,0,0,0,0,23.72A24.35,24.35,0,0,0,40.55,224h174.9a24.35,24.35,0,0,0,21.33-12.19A23.51,23.51,0,0,0,236.8,188.09ZM120,104a8,8,0,0,1,16,0v40a8,8,0,0,1-16,0Zm8,88a12,12,0,1,1,12-12A12,12,0,0,1,128,192Z"
|
|
25
32
|
/>
|
|
26
33
|
</svg>
|
|
27
|
-
<h2
|
|
34
|
+
<h2
|
|
35
|
+
style="
|
|
36
|
+
--font-size: var(--font-size-lg);
|
|
37
|
+
--font-weight: strong;
|
|
38
|
+
--font-family: var(--font-family-heading);
|
|
39
|
+
"
|
|
40
|
+
id="alert-dialog-example-1-title"
|
|
41
|
+
>
|
|
28
42
|
Are you absolutely sure?
|
|
29
43
|
</h2>
|
|
30
44
|
</header>
|
|
31
|
-
<div
|
|
45
|
+
<div style="--font-style: italic" data-dialog-slot="body" id="alert-dialog-example-1-body">
|
|
32
46
|
<p>
|
|
33
47
|
Alert dialogs must be closed by clicking the Cancel or Continue buttons. Changing
|
|
34
48
|
<code>closedby="none"</code> to <code>closedby="any"</code> allows the user to close the
|
|
@@ -36,13 +50,13 @@
|
|
|
36
50
|
</p>
|
|
37
51
|
</div>
|
|
38
52
|
</div>
|
|
39
|
-
<footer data-slot="
|
|
40
|
-
<button
|
|
53
|
+
<footer data-dialog-slot="footer">
|
|
54
|
+
<button data-ui="button" type="button" commandfor="alert-dialog-example-1" command="close">
|
|
41
55
|
Cancel
|
|
42
56
|
</button>
|
|
43
57
|
<button
|
|
44
|
-
|
|
45
|
-
data-variant="destructive"
|
|
58
|
+
data-ui="button"
|
|
59
|
+
data-button-variant="destructive"
|
|
46
60
|
type="button"
|
|
47
61
|
commandfor="alert-dialog-example-1"
|
|
48
62
|
command="close"
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
<div
|
|
2
|
-
<label data-slot="
|
|
3
|
-
<ui-autocomplete data-sort="score">
|
|
1
|
+
<div data-ui="field" style="--max-w: 96">
|
|
2
|
+
<label data-field-slot="label" for="ac-produce">Produce</label>
|
|
3
|
+
<ui-autocomplete data-autocomplete-sort="score">
|
|
4
4
|
<input
|
|
5
|
-
|
|
5
|
+
data-ui="input"
|
|
6
6
|
id="ac-produce"
|
|
7
7
|
name="produce"
|
|
8
8
|
type="text"
|
|
@@ -12,66 +12,97 @@
|
|
|
12
12
|
aria-autocomplete="list"
|
|
13
13
|
autocomplete="off"
|
|
14
14
|
/>
|
|
15
|
-
<div
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
<div
|
|
16
|
+
data-autocomplete-slot="panel"
|
|
17
|
+
data-popover-side="bottom"
|
|
18
|
+
data-popover-align="start"
|
|
19
|
+
popover="manual"
|
|
20
|
+
>
|
|
21
|
+
<ul role="listbox" data-autocomplete-slot="list" aria-label="Produce suggestions">
|
|
22
|
+
<li role="group" data-autocomplete-slot="group" aria-labelledby="ac-group-fruit">
|
|
18
23
|
<span
|
|
19
|
-
|
|
20
|
-
data-slot="autocomplete-group-label"
|
|
24
|
+
data-autocomplete-slot="group-label"
|
|
21
25
|
id="ac-group-fruit"
|
|
26
|
+
style="
|
|
27
|
+
--display: inline-flex;
|
|
28
|
+
--p: 2;
|
|
29
|
+
--font-size: var(--font-size-eyebrow);
|
|
30
|
+
--font-weight: strong;
|
|
31
|
+
--font-weight: var(--font-weight-eyebrow);
|
|
32
|
+
--leading: var(--leading-eyebrow);
|
|
33
|
+
--tracking: var(--tracking-eyebrow);
|
|
34
|
+
--text-transform: uppercase;
|
|
35
|
+
--text: var(--color-muted-foreground);
|
|
36
|
+
"
|
|
22
37
|
>Fruit</span
|
|
23
38
|
>
|
|
24
39
|
<div
|
|
25
40
|
role="option"
|
|
26
|
-
data-slot="
|
|
27
|
-
|
|
28
|
-
data-variant="ghost"
|
|
29
|
-
data-value="Apple"
|
|
30
|
-
data-keywords="fruit red"
|
|
41
|
+
data-autocomplete-slot="item"
|
|
42
|
+
data-ui="button"
|
|
43
|
+
data-button-variant="ghost"
|
|
44
|
+
data-autocomplete-value="Apple"
|
|
45
|
+
data-autocomplete-keywords="fruit red"
|
|
46
|
+
style="--justify: start"
|
|
31
47
|
>
|
|
32
48
|
Apple
|
|
33
49
|
</div>
|
|
34
50
|
<div
|
|
35
51
|
role="option"
|
|
36
|
-
data-slot="
|
|
37
|
-
|
|
38
|
-
data-variant="ghost"
|
|
39
|
-
data-value="Cherry"
|
|
40
|
-
data-keywords="fruit red"
|
|
52
|
+
data-autocomplete-slot="item"
|
|
53
|
+
data-ui="button"
|
|
54
|
+
data-button-variant="ghost"
|
|
55
|
+
data-autocomplete-value="Cherry"
|
|
56
|
+
data-autocomplete-keywords="fruit red"
|
|
57
|
+
style="--justify: start"
|
|
41
58
|
>
|
|
42
59
|
Cherry
|
|
43
60
|
</div>
|
|
44
61
|
</li>
|
|
45
|
-
<li role="group" data-slot="
|
|
62
|
+
<li role="group" data-autocomplete-slot="group" aria-labelledby="ac-group-veg">
|
|
46
63
|
<span
|
|
47
|
-
|
|
48
|
-
data-slot="autocomplete-group-label"
|
|
64
|
+
data-autocomplete-slot="group-label"
|
|
49
65
|
id="ac-group-veg"
|
|
66
|
+
style="
|
|
67
|
+
--display: inline-flex;
|
|
68
|
+
--p: 2;
|
|
69
|
+
--font-size: var(--font-size-eyebrow);
|
|
70
|
+
--font-weight: strong;
|
|
71
|
+
--font-weight: var(--font-weight-eyebrow);
|
|
72
|
+
--leading: var(--leading-eyebrow);
|
|
73
|
+
--tracking: var(--tracking-eyebrow);
|
|
74
|
+
--text-transform: uppercase;
|
|
75
|
+
--text: var(--color-muted-foreground);
|
|
76
|
+
"
|
|
50
77
|
>Vegetables</span
|
|
51
78
|
>
|
|
52
79
|
<div
|
|
53
80
|
role="option"
|
|
54
|
-
data-slot="
|
|
55
|
-
|
|
56
|
-
data-variant="ghost"
|
|
57
|
-
data-value="Carrot"
|
|
58
|
-
data-keywords="vegetable orange"
|
|
81
|
+
data-autocomplete-slot="item"
|
|
82
|
+
data-ui="button"
|
|
83
|
+
data-button-variant="ghost"
|
|
84
|
+
data-autocomplete-value="Carrot"
|
|
85
|
+
data-autocomplete-keywords="vegetable orange"
|
|
86
|
+
style="--justify: start"
|
|
59
87
|
>
|
|
60
88
|
Carrot
|
|
61
89
|
</div>
|
|
62
90
|
<div
|
|
63
91
|
role="option"
|
|
64
|
-
data-slot="
|
|
65
|
-
|
|
66
|
-
data-variant="ghost"
|
|
67
|
-
data-value="Cauliflower"
|
|
68
|
-
data-keywords="vegetable white"
|
|
92
|
+
data-autocomplete-slot="item"
|
|
93
|
+
data-ui="button"
|
|
94
|
+
data-button-variant="ghost"
|
|
95
|
+
data-autocomplete-value="Cauliflower"
|
|
96
|
+
data-autocomplete-keywords="vegetable white"
|
|
97
|
+
style="--justify: start"
|
|
69
98
|
>
|
|
70
99
|
Cauliflower
|
|
71
100
|
</div>
|
|
72
101
|
</li>
|
|
73
102
|
</ul>
|
|
74
|
-
<p data-slot="
|
|
103
|
+
<p data-autocomplete-slot="empty" style="--text: var(--color-muted-foreground)">
|
|
104
|
+
No results.
|
|
105
|
+
</p>
|
|
75
106
|
</div>
|
|
76
107
|
</ui-autocomplete>
|
|
77
108
|
</div>
|
|
@@ -1,114 +1,116 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* autocomplete.css — Autocomplete (ui-autocomplete |
|
|
2
|
+
* autocomplete.css — Autocomplete (ui-autocomplete | [data-ui~="autocomplete"], [data-autocomplete-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
|
* select.css (--ui-option-*), input.css
|
|
7
|
-
* @uses [popover="manual"] — panel opened/closed by autocomplete.
|
|
7
|
+
* @uses [popover="manual"] — panel opened/closed by autocomplete.ts
|
|
8
8
|
* @uses anchor-name, anchor-scope, position-anchor — tether panel to the input
|
|
9
|
-
* @uses anchor-size(width) — match panel width to the input (
|
|
9
|
+
* @uses anchor-size(width) — match panel width to the input (Baseline 2026)
|
|
10
10
|
* @uses :has() — group + empty-state visibility without JavaScript
|
|
11
|
-
* @uses data-side / data-align — maps to --ui-popover-position-* in popover.css
|
|
11
|
+
* @uses data-popover-side / data-popover-align — maps to --ui-popover-position-* in popover.css
|
|
12
12
|
* @tokens --ui-autocomplete-* (@layer variables); items alias --ui-option-*
|
|
13
13
|
* @see autocomplete.ts — filtering, ranking, and keyboard behavior
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
16
|
@layer variables {
|
|
17
17
|
:root {
|
|
18
|
-
--ui-autocomplete-panel-max-
|
|
18
|
+
--ui-autocomplete-panel-max-h: calc(var(--spacing) * 72);
|
|
19
19
|
--ui-autocomplete-shadow: var(--ui-menu-shadow);
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
@layer
|
|
23
|
+
@layer ui.components {
|
|
24
24
|
/* ===========================================================================
|
|
25
25
|
AUTOCOMPLETE — input + anchored suggestion panel
|
|
26
|
-
- The input is a plain
|
|
26
|
+
- The input is a plain [data-ui~="input"] (the no-JS baseline); the panel is a
|
|
27
27
|
manual popover the script owns, riding popover.css's surface + placement.
|
|
28
|
-
- Items are ghost buttons (
|
|
29
|
-
options and an autocomplete's suggestions read identically.
|
|
28
|
+
- Items are ghost buttons (--ui-option-*), matching a select's options.
|
|
30
29
|
=========================================================================== */
|
|
31
30
|
|
|
32
|
-
:where(ui-autocomplete,
|
|
31
|
+
:where(ui-autocomplete, [data-ui~="autocomplete"]) {
|
|
33
32
|
anchor-scope: --ui-autocomplete-trigger;
|
|
34
33
|
display: block;
|
|
35
34
|
inline-size: 100%;
|
|
36
35
|
}
|
|
37
36
|
|
|
38
|
-
:where(ui-autocomplete,
|
|
37
|
+
:where(ui-autocomplete, [data-ui~="autocomplete"]) input:where([role="combobox"]) {
|
|
39
38
|
anchor-name: --ui-autocomplete-trigger;
|
|
40
39
|
}
|
|
41
40
|
|
|
42
|
-
[data-
|
|
41
|
+
:where(ui-autocomplete, [data-ui~="autocomplete"]) [data-autocomplete-slot~="panel"] {
|
|
43
42
|
position-anchor: --ui-autocomplete-trigger;
|
|
44
|
-
/*
|
|
43
|
+
/* ungated so the close fade keeps the column layout */
|
|
45
44
|
flex-direction: column;
|
|
46
|
-
max-block-size: var(--ui-autocomplete-panel-max-
|
|
45
|
+
max-block-size: var(--_max-h-resolved, var(--ui-autocomplete-panel-max-h));
|
|
47
46
|
overflow: auto;
|
|
48
|
-
box-shadow: var(--ui-autocomplete-shadow);
|
|
47
|
+
box-shadow: var(--_shadow-resolved, var(--ui-autocomplete-shadow));
|
|
49
48
|
}
|
|
50
49
|
|
|
51
|
-
/* Only display is gated
|
|
52
|
-
[data-
|
|
50
|
+
/* Only display is gated: closed popovers stay display: none */
|
|
51
|
+
:where(ui-autocomplete, [data-ui~="autocomplete"])
|
|
52
|
+
[data-autocomplete-slot~="panel"]:popover-open {
|
|
53
53
|
display: flex;
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
-
/* Inline variant
|
|
57
|
-
without the floating surface chrome
|
|
58
|
-
[data-
|
|
56
|
+
/* Inline variant (no [popover]): the list renders in flow, always open,
|
|
57
|
+
without the floating surface chrome */
|
|
58
|
+
:where(ui-autocomplete, [data-ui~="autocomplete"])
|
|
59
|
+
[data-autocomplete-slot~="panel"]:not([popover]) {
|
|
59
60
|
display: flex;
|
|
60
61
|
box-shadow: none;
|
|
61
62
|
}
|
|
62
63
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
min-inline-size: anchor-size(width);
|
|
66
|
-
}
|
|
64
|
+
:where(ui-autocomplete, [data-ui~="autocomplete"]) [data-autocomplete-slot~="panel"] {
|
|
65
|
+
min-inline-size: anchor-size(width);
|
|
67
66
|
}
|
|
68
67
|
|
|
69
|
-
[data-
|
|
68
|
+
:where(ui-autocomplete, [data-ui~="autocomplete"]) [data-autocomplete-slot~="list"] {
|
|
70
69
|
display: flex;
|
|
71
70
|
flex-direction: column;
|
|
72
|
-
gap:
|
|
71
|
+
gap: 1px;
|
|
73
72
|
margin: 0;
|
|
74
73
|
padding: 0;
|
|
75
74
|
list-style: none;
|
|
76
75
|
}
|
|
77
76
|
|
|
78
|
-
[data-
|
|
77
|
+
:where(ui-autocomplete, [data-ui~="autocomplete"]) [data-autocomplete-slot~="group"] {
|
|
79
78
|
display: flex;
|
|
80
79
|
flex-direction: column;
|
|
81
|
-
gap:
|
|
80
|
+
gap: 1px;
|
|
82
81
|
}
|
|
83
82
|
|
|
84
|
-
/*
|
|
85
|
-
[data-
|
|
83
|
+
/* score ranking writes order -1000..0 on items: keep the label first */
|
|
84
|
+
:where(ui-autocomplete, [data-ui~="autocomplete"]) [data-autocomplete-slot~="group-label"] {
|
|
86
85
|
order: -1001;
|
|
87
86
|
}
|
|
88
87
|
|
|
89
|
-
[data-
|
|
88
|
+
:where(ui-autocomplete, [data-ui~="autocomplete"]) [data-autocomplete-slot~="item"] {
|
|
90
89
|
cursor: pointer;
|
|
91
90
|
}
|
|
92
91
|
|
|
93
|
-
/*
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
92
|
+
/* The ghost-button variant writes the --_button-* privates, so the
|
|
93
|
+
highlight writes the same ones (a hook would lose to the variant). */
|
|
94
|
+
:where(ui-autocomplete, [data-ui~="autocomplete"])
|
|
95
|
+
[data-autocomplete-slot~="item"][data-autocomplete-state~="highlighted"] {
|
|
96
|
+
--_button-bg: var(--ui-button-bg--hover);
|
|
97
|
+
--_button-text: var(--ui-button-text--hover);
|
|
97
98
|
}
|
|
98
99
|
|
|
99
|
-
/*
|
|
100
|
-
|
|
100
|
+
/* a group with no visible items disappears, label and all */
|
|
101
|
+
:where(ui-autocomplete, [data-ui~="autocomplete"])
|
|
102
|
+
[data-autocomplete-slot~="group"]:not(:has([data-autocomplete-slot~="item"]:not([hidden]))) {
|
|
101
103
|
display: none;
|
|
102
104
|
}
|
|
103
105
|
|
|
104
|
-
|
|
105
|
-
[data-slot~="autocomplete-empty"] {
|
|
106
|
+
:where(ui-autocomplete, [data-ui~="autocomplete"]) [data-autocomplete-slot~="empty"] {
|
|
106
107
|
display: none;
|
|
107
|
-
padding: var(--
|
|
108
|
+
padding: calc(var(--spacing) * 2);
|
|
108
109
|
}
|
|
109
110
|
|
|
110
|
-
|
|
111
|
-
[data-slot~="autocomplete-
|
|
111
|
+
:where(ui-autocomplete, [data-ui~="autocomplete"])
|
|
112
|
+
[data-autocomplete-slot~="panel"]:not(:has([data-autocomplete-slot~="item"]:not([hidden])))
|
|
113
|
+
[data-autocomplete-slot~="empty"] {
|
|
112
114
|
display: block;
|
|
113
115
|
}
|
|
114
116
|
}
|
|
@@ -4,15 +4,16 @@
|
|
|
4
4
|
* (`base/typeahead.ts`). The visible input is the form value (free text is
|
|
5
5
|
* allowed) and the anchored `popover="manual"` panel suggests matches ranked
|
|
6
6
|
* by the vendored cmdk scorer. Committing a suggestion (Enter or click) fills
|
|
7
|
-
* the input; without JavaScript the markup degrades to a plain
|
|
7
|
+
* the input; without JavaScript the markup degrades to a plain `[data-ui~="input"]`.
|
|
8
8
|
*
|
|
9
9
|
* Attributes on the root:
|
|
10
|
-
* - `data-sort="score"`: re-rank visually by match score (default: DOM order).
|
|
11
|
-
* - `data-
|
|
10
|
+
* - `data-autocomplete-sort="score"`: re-rank visually by match score (default: DOM order).
|
|
11
|
+
* - `data-autocomplete-filter="none"`: show every item; another source filters.
|
|
12
|
+
* - `data-autocomplete-min-length="<n>"`: query length before the panel opens (default 0).
|
|
12
13
|
*
|
|
13
14
|
* Parts: `autocomplete-panel` (popover="manual"), `autocomplete-list`
|
|
14
|
-
* ([role="listbox"]), `autocomplete-item` ([role="option"], `data-value`,
|
|
15
|
-
* optional `data-keywords`), `autocomplete-group` / `autocomplete-group-label`,
|
|
15
|
+
* ([role="listbox"]), `autocomplete-item` ([role="option"], `data-autocomplete-value`,
|
|
16
|
+
* optional `data-autocomplete-keywords`), `autocomplete-group` / `autocomplete-group-label`,
|
|
16
17
|
* `autocomplete-empty`.
|
|
17
18
|
*/
|
|
18
19
|
import { TypeaheadElement } from "../../base/typeahead.ts";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"autocomplete.d.ts","sourceRoot":"","sources":["autocomplete.ts"],"names":[],"mappings":"AAEA
|
|
1
|
+
{"version":3,"file":"autocomplete.d.ts","sourceRoot":"","sources":["autocomplete.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAG3D,cAAM,cAAe,SAAQ,gBAAgB;IAC3C,SAAS,CAAC,QAAQ,CAAC,UAAU,kBAAkB;IAE/C;;;;;OAKG;IACH,SAAS,CAAC,MAAM,CAAC,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,UAAU,GAAG,SAAS,GAAG,IAAI,CAQzE;CACF;AAID,OAAO,EAAE,cAAc,EAAE,CAAC"}
|