@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,19 +1,19 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* combobox.css: Combobox (ui-combobox |
|
|
2
|
+
* combobox.css: Combobox (ui-combobox | [data-ui~="combobox"], [data-combobox-slot~="control"])
|
|
3
3
|
*
|
|
4
4
|
* @layer variables, components
|
|
5
|
-
* @requires
|
|
6
|
-
* badge.css (--ui-badge-* for the default tag template
|
|
5
|
+
* @requires _layers.css, _variables.css, popover.css, button.css, fields.css,
|
|
6
|
+
* badge.css (--ui-badge-* for the default tag template [data-ui~="badge"]),
|
|
7
7
|
* select.css (--ui-option-*, --ui-select-picker-icon-*)
|
|
8
|
-
* @uses [popover="manual"]: panel opened/closed by combobox.
|
|
8
|
+
* @uses [popover="manual"]: panel opened/closed by combobox.ts
|
|
9
9
|
* @uses anchor-name, anchor-scope, position-anchor: tether panel to the control
|
|
10
10
|
* @uses anchor-size(width): match panel width to the control (Baseline 2026)
|
|
11
11
|
* @uses :has(): chevron rotation, group + empty-state visibility
|
|
12
12
|
* @uses mask: chevron and tag-remove icons; wiped in forced-colors mode,
|
|
13
13
|
* matching the rest of the kit (option checkmark, picker icon)
|
|
14
|
-
* @uses data-side / data-align: maps to --ui-popover-position-* in popover.css
|
|
15
|
-
* @uses data-variant="multiselect": tag variant; combobox.
|
|
16
|
-
* <template data-slot="
|
|
14
|
+
* @uses data-popover-side / data-popover-align: maps to --ui-popover-position-* in popover.css
|
|
15
|
+
* @uses data-combobox-variant="multiselect": tag variant; combobox.ts clones a
|
|
16
|
+
* <template data-combobox-slot="tag-template"> (or its muted-badge
|
|
17
17
|
* default) per option carrying aria-selected="true". Tag rules key
|
|
18
18
|
* off the slots, so a custom template keeps this styling.
|
|
19
19
|
* @tokens --ui-combobox-* (@layer variables); control mirrors --ui-select-*,
|
|
@@ -23,125 +23,145 @@
|
|
|
23
23
|
|
|
24
24
|
@layer variables {
|
|
25
25
|
:root {
|
|
26
|
-
/*
|
|
26
|
+
/* control mirrors the select trigger */
|
|
27
27
|
--ui-combobox-option-gap: var(--ui-field-option-gap);
|
|
28
|
-
--ui-combobox-
|
|
29
|
-
--ui-combobox-min-
|
|
30
|
-
--ui-combobox-
|
|
31
|
-
--ui-combobox-
|
|
28
|
+
--ui-combobox-w: var(--ui-select-w);
|
|
29
|
+
--ui-combobox-min-w: var(--ui-select-min-w);
|
|
30
|
+
--ui-combobox-pl: var(--ui-select-pl);
|
|
31
|
+
--ui-combobox-pr: var(--ui-select-pr);
|
|
32
32
|
--ui-combobox-border-width: var(--ui-select-border-width);
|
|
33
33
|
--ui-combobox-border-style: var(--ui-select-border-style);
|
|
34
34
|
--ui-combobox-border-color: var(--ui-select-border-color);
|
|
35
|
-
--ui-combobox-
|
|
35
|
+
--ui-combobox-rounded: var(--ui-select-rounded);
|
|
36
36
|
--ui-combobox-icon-mask: var(--ui-select-picker-icon-mask);
|
|
37
37
|
--ui-combobox-icon-size: var(--ui-select-picker-icon-size);
|
|
38
38
|
--ui-combobox-icon-color: var(--ui-select-picker-icon-color);
|
|
39
|
-
--ui-combobox-panel-max-
|
|
39
|
+
--ui-combobox-panel-max-h: calc(var(--spacing) * 72);
|
|
40
40
|
--ui-combobox-shadow: var(--ui-menu-shadow);
|
|
41
41
|
|
|
42
42
|
/* Control box: the multiselect variant swaps these to wrap into rows */
|
|
43
|
-
--ui-combobox-control-
|
|
43
|
+
--ui-combobox-control-items: center;
|
|
44
44
|
--ui-combobox-control-flex-wrap: nowrap;
|
|
45
45
|
--ui-combobox-control-gap: var(--ui-field-gap);
|
|
46
|
-
--ui-combobox-control-
|
|
47
|
-
--ui-combobox-control-min-
|
|
48
|
-
--ui-combobox-control-
|
|
49
|
-
--ui-combobox-input-min-
|
|
50
|
-
--ui-combobox-input-min-
|
|
51
|
-
|
|
52
|
-
/*
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
--ui-combobox-tag-
|
|
58
|
-
--ui-combobox-tag-padding-block: var(--step-1);
|
|
59
|
-
--ui-combobox-tag-max-inline-size: 100%;
|
|
46
|
+
--ui-combobox-control-h: var(--ui-field-h);
|
|
47
|
+
--ui-combobox-control-min-h: auto;
|
|
48
|
+
--ui-combobox-control-py: 0;
|
|
49
|
+
--ui-combobox-input-min-w: 0;
|
|
50
|
+
--ui-combobox-input-min-h: auto;
|
|
51
|
+
|
|
52
|
+
/* selection tags (multiselect). The remove icon is re-declared: the identical
|
|
53
|
+
--search-cancel-mask sits inside ::-webkit-search-cancel-button in
|
|
54
|
+
_reset.css, out of reach. */
|
|
55
|
+
--ui-combobox-tag-gap: var(--spacing);
|
|
56
|
+
--ui-combobox-tag-py: var(--spacing);
|
|
57
|
+
--ui-combobox-tag-max-w: 100%;
|
|
60
58
|
--ui-combobox-tag-remove-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 256'%3E%3Crect width='256' height='256' fill='none'/%3E%3Cline x1='200' y1='56' x2='56' y2='200' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='16'/%3E%3Cline x1='200' y1='200' x2='56' y2='56' stroke='currentColor' stroke-linecap='round' stroke-linejoin='round' stroke-width='16'/%3E%3C/svg%3E");
|
|
61
59
|
--ui-combobox-tag-remove-size: var(--ui-badge-icon-size);
|
|
62
60
|
--ui-combobox-tag-remove-color: currentColor;
|
|
63
|
-
--ui-combobox-tag-remove-
|
|
61
|
+
--ui-combobox-tag-remove-rounded: var(--radius-sm);
|
|
64
62
|
--ui-combobox-tag-remove-opacity: 0.65;
|
|
65
63
|
--ui-combobox-tag-remove-opacity--hover: 1;
|
|
66
64
|
}
|
|
67
65
|
}
|
|
68
66
|
|
|
69
|
-
@layer
|
|
67
|
+
@layer ui.components {
|
|
70
68
|
/* ===========================================================================
|
|
71
69
|
COMBOBOX: select-look control + anchored filterable panel
|
|
72
|
-
- The control shell carries the field surface
|
|
73
|
-
|
|
74
|
-
popover.css's surface + placement like autocomplete's.
|
|
70
|
+
- The control shell carries the field surface; the inner input is bare so
|
|
71
|
+
nothing double-borders. The panel rides popover.css like autocomplete's.
|
|
75
72
|
=========================================================================== */
|
|
76
73
|
|
|
77
|
-
:where(ui-combobox,
|
|
74
|
+
:where(ui-combobox, [data-ui~="combobox"]) {
|
|
78
75
|
anchor-scope: --ui-combobox-trigger;
|
|
79
76
|
display: flex;
|
|
80
77
|
flex-direction: column;
|
|
81
|
-
gap:
|
|
82
|
-
inline-size: var(--ui-combobox-
|
|
78
|
+
gap: 1px;
|
|
79
|
+
inline-size: var(--ui-combobox-w);
|
|
83
80
|
}
|
|
84
81
|
|
|
85
|
-
[data-
|
|
82
|
+
:where(ui-combobox, [data-ui~="combobox"]) [data-combobox-slot~="control"] {
|
|
86
83
|
anchor-name: --ui-combobox-trigger;
|
|
87
84
|
display: flex;
|
|
88
|
-
flex-wrap: var(--ui-combobox-control-flex-wrap);
|
|
89
|
-
align-items: var(--ui-combobox-control-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
85
|
+
flex-wrap: var(--_flex-wrap-resolved, var(--ui-combobox-control-flex-wrap));
|
|
86
|
+
align-items: var(--_items-resolved, var(--ui-combobox-control-items));
|
|
87
|
+
--_gap-len: var(--_gap-resolved, var(--ui-combobox-control-gap));
|
|
88
|
+
--_gap-num: var(--_gap-resolved, var(--ui-combobox-control-gap));
|
|
89
|
+
gap: calc(var(--_gap-len) + var(--_gap-num) * var(--spacing));
|
|
90
|
+
|
|
91
|
+
--_w-len: var(--_w-resolved, var(--ui-combobox-w));
|
|
92
|
+
--_w-num: var(--_w-resolved, var(--ui-combobox-w));
|
|
93
|
+
inline-size: calc(var(--_w-len) + var(--_w-num) * var(--spacing));
|
|
94
|
+
--_min-w-len: var(--_min-w-resolved, var(--ui-combobox-min-w));
|
|
95
|
+
--_min-w-num: var(--_min-w-resolved, var(--ui-combobox-min-w));
|
|
96
|
+
min-inline-size: calc(var(--_min-w-len) + var(--_min-w-num) * var(--spacing));
|
|
97
|
+
--_h-len: var(--_h-resolved, var(--ui-combobox-control-h));
|
|
98
|
+
--_h-num: var(--_h-resolved, var(--ui-combobox-control-h));
|
|
99
|
+
block-size: calc(var(--_h-len) + var(--_h-num) * var(--spacing));
|
|
100
|
+
--_min-h-len: var(--_min-h-resolved, var(--ui-combobox-control-min-h));
|
|
101
|
+
--_min-h-num: var(--_min-h-resolved, var(--ui-combobox-control-min-h));
|
|
102
|
+
min-block-size: calc(var(--_min-h-len) + var(--_min-h-num) * var(--spacing));
|
|
103
|
+
--_py-len: var(--_py-resolved, var(--ui-combobox-control-py));
|
|
104
|
+
--_py-num: var(--_py-resolved, var(--ui-combobox-control-py));
|
|
105
|
+
padding-block: calc(var(--_py-len) + var(--_py-num) * var(--spacing));
|
|
106
|
+
--_pl-len: var(--_pl-resolved, var(--ui-combobox-pl));
|
|
107
|
+
--_pl-num: var(--_pl-resolved, var(--ui-combobox-pl));
|
|
108
|
+
padding-inline-start: calc(var(--_pl-len) + var(--_pl-num) * var(--spacing));
|
|
109
|
+
--_pr-len: var(--_pr-resolved, var(--ui-combobox-pr));
|
|
110
|
+
--_pr-num: var(--_pr-resolved, var(--ui-combobox-pr));
|
|
111
|
+
padding-inline-end: calc(var(--_pr-len) + var(--_pr-num) * var(--spacing));
|
|
112
|
+
|
|
113
|
+
font-size: var(--_font-size-resolved, var(--ui-field-font-size));
|
|
114
|
+
line-height: var(--_leading-resolved, var(--ui-field-leading));
|
|
115
|
+
color: var(--_text-resolved, var(--ui-field-text));
|
|
116
|
+
background-color: var(--_bg-resolved, var(--ui-field-bg));
|
|
117
|
+
|
|
118
|
+
border-width: var(--_border-width-resolved, var(--ui-combobox-border-width));
|
|
119
|
+
border-style: var(--_border-style-resolved, var(--ui-combobox-border-style));
|
|
120
|
+
border-color: var(--_border-color-resolved, var(--ui-combobox-border-color));
|
|
121
|
+
border-radius: var(--_rounded-resolved, var(--ui-combobox-rounded));
|
|
122
|
+
|
|
123
|
+
/* Same ring recipe as [data-ui~="select"]: transparent outline twin keeps focus
|
|
109
124
|
visible in forced-colors mode */
|
|
110
125
|
--_ring-offset-width: 0px;
|
|
111
126
|
--_ring-width: 0px;
|
|
112
|
-
--_ring: color-mix(in oklch, var(--ui-field-ring-color) var(--ring-opacity), transparent);
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
0 0 0
|
|
127
|
+
--_ring-fill: color-mix(in oklch, var(--ui-field-ring-color) var(--ring-opacity), transparent);
|
|
128
|
+
/* The ring is published to --_focus-ring so a --shadow utility keeps it */
|
|
129
|
+
--_focus-ring:
|
|
130
|
+
0 0 0 var(--_ring-offset-width) var(--ring-offset-shadow-color),
|
|
131
|
+
0 0 0 calc(var(--_ring-offset-width) + var(--_ring-width))
|
|
132
|
+
var(--_ring-fill, var(--ring-shadow-color));
|
|
133
|
+
box-shadow: var(--_focus-ring, 0 0 #0000), var(--_shadow-resolved, 0 0 #0000);
|
|
116
134
|
outline: var(--outline-width) var(--outline-style) transparent;
|
|
117
135
|
outline-offset: var(--outline-offset);
|
|
118
136
|
|
|
119
137
|
transition: var(--default-transition);
|
|
120
138
|
}
|
|
121
139
|
|
|
122
|
-
|
|
123
|
-
|
|
140
|
+
@media (hover: hover) {
|
|
141
|
+
:where(ui-combobox, [data-ui~="combobox"]) [data-combobox-slot~="control"]:hover {
|
|
142
|
+
border-color: var(--ui-field-border-color--hover);
|
|
143
|
+
}
|
|
124
144
|
}
|
|
125
145
|
|
|
126
|
-
[data-
|
|
127
|
-
border-color: var(--ui-field-border-color--focus);
|
|
128
|
-
background-color: var(--ui-field-
|
|
146
|
+
:where(ui-combobox, [data-ui~="combobox"]) [data-combobox-slot~="control"]:focus-within {
|
|
147
|
+
border-color: var(--ui-field-border-color--focus-within);
|
|
148
|
+
background-color: var(--ui-field-bg--focus-within);
|
|
129
149
|
--_ring-offset-width: var(--ring-offset-width);
|
|
130
150
|
--_ring-width: var(--ring-width);
|
|
131
151
|
outline-color: transparent;
|
|
132
152
|
}
|
|
133
153
|
|
|
134
|
-
|
|
135
|
-
|
|
154
|
+
:where(ui-combobox, [data-ui~="combobox"])
|
|
155
|
+
[data-combobox-slot~="control"]:has(> [data-combobox-slot~="tag"]) {
|
|
156
|
+
padding-inline-start: calc(var(--spacing) * 1.5);
|
|
136
157
|
}
|
|
137
158
|
|
|
138
|
-
/* The
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
min-
|
|
144
|
-
min-block-size: var(--ui-combobox-input-min-block-size);
|
|
159
|
+
/* The shell owns the surface. The minimum width makes the multiselect variant
|
|
160
|
+
wrap the input onto its own row instead of collapsing. */
|
|
161
|
+
:where(ui-combobox, [data-ui~="combobox"]) [data-combobox-slot~="control"] input {
|
|
162
|
+
flex: 1 1 var(--ui-combobox-input-min-w);
|
|
163
|
+
min-inline-size: var(--ui-combobox-input-min-w);
|
|
164
|
+
min-block-size: var(--ui-combobox-input-min-h);
|
|
145
165
|
font: inherit;
|
|
146
166
|
color: inherit;
|
|
147
167
|
background: none;
|
|
@@ -149,7 +169,7 @@
|
|
|
149
169
|
outline: none;
|
|
150
170
|
}
|
|
151
171
|
|
|
152
|
-
[data-
|
|
172
|
+
:where(ui-combobox, [data-ui~="combobox"]) [data-combobox-slot~="trigger"] {
|
|
153
173
|
display: grid;
|
|
154
174
|
place-items: center;
|
|
155
175
|
inline-size: var(--ui-combobox-icon-size);
|
|
@@ -159,7 +179,7 @@
|
|
|
159
179
|
margin-inline-start: auto;
|
|
160
180
|
}
|
|
161
181
|
|
|
162
|
-
[data-
|
|
182
|
+
:where(ui-combobox, [data-ui~="combobox"]) [data-combobox-slot~="trigger"]::before {
|
|
163
183
|
content: "";
|
|
164
184
|
inline-size: var(--ui-combobox-icon-size);
|
|
165
185
|
block-size: var(--ui-combobox-icon-size);
|
|
@@ -168,33 +188,32 @@
|
|
|
168
188
|
transition: var(--default-transition);
|
|
169
189
|
}
|
|
170
190
|
|
|
171
|
-
|
|
172
|
-
[data-slot~="combobox-panel"] {
|
|
191
|
+
:where(ui-combobox, [data-ui~="combobox"]) [data-combobox-slot~="panel"] {
|
|
173
192
|
position-anchor: --ui-combobox-trigger;
|
|
174
|
-
/*
|
|
193
|
+
/* ungated so the close fade keeps the column layout */
|
|
175
194
|
flex-direction: column;
|
|
176
|
-
max-block-size: var(--ui-combobox-panel-max-
|
|
195
|
+
max-block-size: var(--ui-combobox-panel-max-h);
|
|
177
196
|
overflow: auto;
|
|
178
197
|
box-shadow: var(--ui-combobox-shadow);
|
|
179
198
|
}
|
|
180
199
|
|
|
181
|
-
/* Only display is gated
|
|
182
|
-
[data-
|
|
200
|
+
/* Only display is gated: closed popovers stay display: none */
|
|
201
|
+
:where(ui-combobox, [data-ui~="combobox"]) [data-combobox-slot~="panel"]:popover-open {
|
|
183
202
|
display: flex;
|
|
184
203
|
}
|
|
185
204
|
|
|
186
|
-
/* Inline variant
|
|
187
|
-
without the floating surface chrome
|
|
188
|
-
[data-
|
|
205
|
+
/* Inline variant (no [popover]): the list renders in flow, always open,
|
|
206
|
+
without the floating surface chrome */
|
|
207
|
+
:where(ui-combobox, [data-ui~="combobox"]) [data-combobox-slot~="panel"]:not([popover]) {
|
|
189
208
|
display: flex;
|
|
190
209
|
box-shadow: none;
|
|
191
210
|
}
|
|
192
211
|
|
|
193
|
-
[data-
|
|
212
|
+
:where(ui-combobox, [data-ui~="combobox"]) [data-combobox-slot~="panel"] {
|
|
194
213
|
min-inline-size: anchor-size(width);
|
|
195
214
|
}
|
|
196
215
|
|
|
197
|
-
[data-
|
|
216
|
+
:where(ui-combobox, [data-ui~="combobox"]) [data-combobox-slot~="list"] {
|
|
198
217
|
display: flex;
|
|
199
218
|
flex-direction: column;
|
|
200
219
|
gap: var(--ui-combobox-option-gap);
|
|
@@ -203,28 +222,29 @@
|
|
|
203
222
|
list-style: none;
|
|
204
223
|
}
|
|
205
224
|
|
|
206
|
-
[data-
|
|
225
|
+
:where(ui-combobox, [data-ui~="combobox"]) [data-combobox-slot~="group"] {
|
|
207
226
|
display: flex;
|
|
208
227
|
flex-direction: column;
|
|
209
228
|
gap: var(--ui-combobox-option-gap);
|
|
210
229
|
}
|
|
211
230
|
|
|
212
|
-
/*
|
|
213
|
-
[data-
|
|
231
|
+
/* score ranking writes order -1000..0 on items: keep the label first */
|
|
232
|
+
:where(ui-combobox, [data-ui~="combobox"]) [data-combobox-slot~="group-label"] {
|
|
214
233
|
order: -1001;
|
|
215
234
|
}
|
|
216
235
|
|
|
217
|
-
[data-
|
|
236
|
+
:where(ui-combobox, [data-ui~="combobox"]) [data-combobox-slot~="item"] {
|
|
218
237
|
cursor: pointer;
|
|
219
238
|
}
|
|
220
239
|
|
|
221
|
-
[data-
|
|
222
|
-
|
|
223
|
-
--
|
|
240
|
+
:where(ui-combobox, [data-ui~="combobox"])
|
|
241
|
+
[data-combobox-slot~="item"][data-combobox-state~="highlighted"] {
|
|
242
|
+
--_button-bg: var(--ui-button-bg--hover);
|
|
243
|
+
--_button-text: var(--ui-button-text--hover);
|
|
224
244
|
}
|
|
225
245
|
|
|
226
|
-
|
|
227
|
-
|
|
246
|
+
:where(ui-combobox, [data-ui~="combobox"])
|
|
247
|
+
[data-combobox-slot~="item"][aria-selected="true"]::after {
|
|
228
248
|
content: "";
|
|
229
249
|
order: 1;
|
|
230
250
|
margin-inline-start: auto;
|
|
@@ -234,66 +254,67 @@
|
|
|
234
254
|
mask: var(--ui-option-checkmark-mask) center / contain no-repeat;
|
|
235
255
|
}
|
|
236
256
|
|
|
237
|
-
|
|
257
|
+
:where(ui-combobox, [data-ui~="combobox"])
|
|
258
|
+
[data-combobox-slot~="group"]:not(:has([data-combobox-slot~="item"]:not([hidden]))) {
|
|
238
259
|
display: none;
|
|
239
260
|
}
|
|
240
261
|
|
|
241
|
-
[data-
|
|
262
|
+
:where(ui-combobox, [data-ui~="combobox"]) [data-combobox-slot~="empty"] {
|
|
242
263
|
display: none;
|
|
243
|
-
padding: var(--
|
|
264
|
+
padding: calc(var(--spacing) * 2);
|
|
244
265
|
}
|
|
245
266
|
|
|
246
|
-
|
|
247
|
-
[data-slot~="combobox-
|
|
267
|
+
:where(ui-combobox, [data-ui~="combobox"])
|
|
268
|
+
[data-combobox-slot~="panel"]:not(:has([data-combobox-slot~="item"]:not([hidden])))
|
|
269
|
+
[data-combobox-slot~="empty"] {
|
|
248
270
|
display: block;
|
|
249
271
|
}
|
|
250
272
|
|
|
251
273
|
/* ===========================================================================
|
|
252
274
|
COMBOBOX MULTISELECT: selected values as removable tags inside the control
|
|
253
275
|
- The variant only swaps tokens: the control wraps into rows and grows from a
|
|
254
|
-
fixed height into a minimum one.
|
|
255
|
-
|
|
256
|
-
so a selection tag and a badge read as one thing.
|
|
276
|
+
fixed height into a minimum one. Tags are stamped from items carrying
|
|
277
|
+
aria-selected="true", dressed as a muted badge.
|
|
257
278
|
=========================================================================== */
|
|
258
279
|
|
|
259
|
-
:where(ui-combobox,
|
|
280
|
+
:where(ui-combobox, [data-ui~="combobox"])[data-combobox-variant="multiselect"] {
|
|
260
281
|
--ui-combobox-control-flex-wrap: wrap;
|
|
261
282
|
--ui-combobox-control-gap: var(--ui-combobox-tag-gap);
|
|
262
|
-
--ui-combobox-control-
|
|
263
|
-
--ui-combobox-control-min-
|
|
264
|
-
--ui-combobox-control-
|
|
265
|
-
--ui-combobox-input-min-
|
|
266
|
-
--ui-combobox-input-min-
|
|
283
|
+
--ui-combobox-control-h: auto;
|
|
284
|
+
--ui-combobox-control-min-h: var(--ui-field-h);
|
|
285
|
+
--ui-combobox-control-py: var(--ui-combobox-tag-py);
|
|
286
|
+
--ui-combobox-input-min-w: calc(var(--spacing) * 16);
|
|
287
|
+
--ui-combobox-input-min-h: var(--ui-badge-h);
|
|
267
288
|
}
|
|
268
289
|
|
|
269
290
|
/* Overrides badge.css min-width: max-content (same layer, same
|
|
270
291
|
specificity, and combobox.css imports after badge.css) */
|
|
271
|
-
[data-
|
|
292
|
+
:where(ui-combobox, [data-ui~="combobox"]) [data-combobox-slot~="tag"] {
|
|
272
293
|
min-inline-size: 0;
|
|
273
|
-
max-inline-size: var(--ui-combobox-tag-max-
|
|
294
|
+
max-inline-size: var(--ui-combobox-tag-max-w);
|
|
274
295
|
}
|
|
275
296
|
|
|
276
297
|
/* The label wears its own box because text-overflow ignores a flex
|
|
277
|
-
container's own text, and
|
|
278
|
-
[data-
|
|
298
|
+
container's own text, and [data-ui~="badge"] is display: flex */
|
|
299
|
+
:where(ui-combobox, [data-ui~="combobox"]) [data-combobox-slot~="tag-label"] {
|
|
279
300
|
overflow: hidden;
|
|
280
301
|
text-overflow: ellipsis;
|
|
281
302
|
white-space: nowrap;
|
|
282
303
|
}
|
|
283
304
|
|
|
284
|
-
[data-
|
|
305
|
+
:where(ui-combobox, [data-ui~="combobox"]) [data-combobox-slot~="tag-remove"] {
|
|
285
306
|
display: grid;
|
|
286
307
|
place-items: center;
|
|
287
308
|
flex-shrink: 0;
|
|
288
309
|
inline-size: var(--ui-combobox-tag-remove-size);
|
|
289
310
|
block-size: var(--ui-combobox-tag-remove-size);
|
|
290
|
-
border-radius: var(--ui-combobox-tag-remove-
|
|
311
|
+
border-radius: var(--ui-combobox-tag-remove-rounded);
|
|
291
312
|
opacity: var(--ui-combobox-tag-remove-opacity);
|
|
292
313
|
cursor: pointer;
|
|
293
314
|
transition: var(--default-transition);
|
|
294
315
|
}
|
|
295
316
|
|
|
296
|
-
[data-
|
|
317
|
+
:where(ui-combobox, [data-ui~="combobox"]) [data-combobox-slot~="tag-remove"]::before {
|
|
297
318
|
content: "";
|
|
298
319
|
inline-size: 100%;
|
|
299
320
|
block-size: 100%;
|
|
@@ -301,7 +322,9 @@
|
|
|
301
322
|
mask: var(--ui-combobox-tag-remove-mask) center / contain no-repeat;
|
|
302
323
|
}
|
|
303
324
|
|
|
304
|
-
|
|
305
|
-
|
|
325
|
+
@media (hover: hover) {
|
|
326
|
+
:where(ui-combobox, [data-ui~="combobox"]) [data-combobox-slot~="tag-remove"]:hover {
|
|
327
|
+
opacity: var(--ui-combobox-tag-remove-opacity--hover);
|
|
328
|
+
}
|
|
306
329
|
}
|
|
307
330
|
}
|
|
@@ -3,34 +3,35 @@
|
|
|
3
3
|
* @description Light-DOM custom element on the shared typeahead engine
|
|
4
4
|
* (`base/typeahead.ts`). A relative of select: the panel filters as you type,
|
|
5
5
|
* but free text can never submit. The form value lives in an authored hidden
|
|
6
|
-
* input (`data-slot="
|
|
6
|
+
* input (`data-combobox-slot="value"`), synced whenever the selection changes.
|
|
7
7
|
*
|
|
8
8
|
* The visible input carries a **display value, not the filter**. Committing
|
|
9
9
|
* writes the option label into it and clears the query, so reopening shows
|
|
10
|
-
* the full list with the committed row checked, matching
|
|
10
|
+
* the full list with the committed row checked, matching `[data-ui~="select"]`.
|
|
11
11
|
* Opening selects that label so the first keystroke replaces it, and focus
|
|
12
12
|
* alone never opens the panel (a click, the chevron, an arrow key or typing
|
|
13
13
|
* does). On blur, stray text reverts to the committed label and cleared text
|
|
14
14
|
* clears the selection.
|
|
15
15
|
*
|
|
16
|
-
* `data-variant="multiselect"` selects a set instead: committing toggles a row
|
|
16
|
+
* `data-combobox-variant="multiselect"` selects a set instead: committing toggles a row
|
|
17
17
|
* and keeps the panel open, and every selected value renders as a removable
|
|
18
18
|
* tag stamped inside the control. The tag markup is HTML, not script: author
|
|
19
|
-
* a `<template data-slot="
|
|
19
|
+
* a `<template data-combobox-slot="tag-template">` to control its classes and
|
|
20
20
|
* structure, and this file fills in the label, the value, and the remove
|
|
21
|
-
* button accessible name. Without one, the
|
|
21
|
+
* button accessible name. Without one, the badge default below applies.
|
|
22
22
|
* Backspace on an empty input drops the last tag. Options carrying
|
|
23
23
|
* `aria-selected="true"` are the single source of truth: the tags and the
|
|
24
24
|
* hidden inputs are both derived from them in DOM order so nothing can drift.
|
|
25
25
|
* The form submits repeated `name` pairs like `<select multiple>`: the authored
|
|
26
26
|
* hidden input carries the first value, and stamped siblings carry the rest.
|
|
27
27
|
*
|
|
28
|
-
* Where a no-JS fallback matters, prefer
|
|
28
|
+
* Where a no-JS fallback matters, prefer `[data-ui~="select"]` / `<ui-multiselect>`:
|
|
29
29
|
* this control is inert without its script (the hidden input still submits a
|
|
30
30
|
* server-set value, but no tags render).
|
|
31
31
|
*
|
|
32
|
-
* Attributes on the root: `data-variant="multiselect"`, `data-sort="score"`,
|
|
33
|
-
* `data-
|
|
32
|
+
* Attributes on the root: `data-combobox-variant="multiselect"`, `data-combobox-sort="score"`,
|
|
33
|
+
* `data-combobox-filter="none"` (another source filters; the engine only navigates),
|
|
34
|
+
* `data-combobox-min-length="<n>"`, `data-combobox-label-remove="Remove {label}"`.
|
|
34
35
|
* Parts: `combobox-value` (hidden input), `combobox-control` (select-look
|
|
35
36
|
* shell), `combobox-tag-template` (authored `<template>`), `combobox-tag` /
|
|
36
37
|
* `combobox-tag-label` / `combobox-tag-remove` (cloned from it),
|
|
@@ -58,7 +59,7 @@ interface BlurOutcome {
|
|
|
58
59
|
*/
|
|
59
60
|
declare function resolveBlur(typed: string, committedLabel: string, multiselect: boolean): BlurOutcome;
|
|
60
61
|
/**
|
|
61
|
-
* @description Fills the remove-button label template (`data-label-remove`).
|
|
62
|
+
* @description Fills the remove-button label template (`data-combobox-label-remove`).
|
|
62
63
|
*
|
|
63
64
|
* @param template - Template with a `{label}` placeholder.
|
|
64
65
|
* @param label - The tag's visible label.
|
|
@@ -74,7 +75,7 @@ declare class UiCombobox extends TypeaheadElement {
|
|
|
74
75
|
protected teardown(): void;
|
|
75
76
|
/**
|
|
76
77
|
* @description Combobox items match against what the user sees (the label)
|
|
77
|
-
* not the machine `data-value`.
|
|
78
|
+
* not the machine `data-combobox-value`.
|
|
78
79
|
*
|
|
79
80
|
* @param item - The item element.
|
|
80
81
|
* @returns The trimmed visible label.
|
|
@@ -87,7 +88,7 @@ declare class UiCombobox extends TypeaheadElement {
|
|
|
87
88
|
*/
|
|
88
89
|
protected clearQuery(): void;
|
|
89
90
|
/**
|
|
90
|
-
* @description Committing shows the item's label, stores its `data-value` in
|
|
91
|
+
* @description Committing shows the item's label, stores its `data-combobox-value` in
|
|
91
92
|
* the hidden input, and moves `aria-selected`. The multiselect variant
|
|
92
93
|
* toggles the row instead and keeps the panel open so picking can continue.
|
|
93
94
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"combobox.d.ts","sourceRoot":"","sources":["combobox.ts"],"names":[],"mappings":"AAEA
|
|
1
|
+
{"version":3,"file":"combobox.d.ts","sourceRoot":"","sources":["combobox.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AA0B3D,2EAA2E;AAC3E,UAAU,WAAW;IACnB,oDAAoD;IACpD,KAAK,EAAE,MAAM,CAAC;IACd,kDAAkD;IAClD,KAAK,EAAE,OAAO,CAAC;CAChB;AAED;;;;;;;;;;GAUG;AACH,iBAAS,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,WAAW,EAAE,OAAO,GAAG,WAAW,CAI7F;AAED;;;;;;GAMG;AACH,iBAAS,kBAAkB,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAEnE;AAED,cAAM,UAAW,SAAQ,gBAAgB;;IACvC,SAAS,CAAC,QAAQ,CAAC,UAAU,cAAc;IAC3C,gFAAgF;IAChF,SAAS,CAAC,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAS;IAOhD,SAAS,CAAC,KAAK,CAAC,MAAM,EAAE,WAAW,GAAG,IAAI,CAgIzC;IAED,SAAS,CAAC,QAAQ,IAAI,IAAI,CAOzB;IAED;;;;;;OAMG;IACH,SAAS,CAAC,SAAS,CAAC,IAAI,EAAE,WAAW,GAAG,MAAM,CAE7C;IAED;;;;OAIG;IACH,SAAS,CAAC,UAAU,IAAI,IAAI,CAK3B;IAED;;;;;;OAMG;IACH,SAAS,CAAC,MAAM,CAAC,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,UAAU,GAAG,SAAS,GAAG,IAAI,CA+BzE;CAuOF;AAID,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,kBAAkB,EAAE,CAAC;AACvD,YAAY,EAAE,WAAW,EAAE,CAAC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
<div
|
|
2
|
-
<label data-slot="
|
|
1
|
+
<div data-ui="field" style="--max-w: 96">
|
|
2
|
+
<label data-field-slot="label" for="cb-country">Country</label>
|
|
3
3
|
<ui-combobox>
|
|
4
|
-
<input type="hidden" name="country" data-slot="
|
|
5
|
-
<div data-slot="
|
|
4
|
+
<input type="hidden" name="country" data-combobox-slot="value" value="" />
|
|
5
|
+
<div data-combobox-slot="control">
|
|
6
6
|
<input
|
|
7
7
|
id="cb-country"
|
|
8
8
|
type="text"
|
|
@@ -14,60 +14,80 @@
|
|
|
14
14
|
/>
|
|
15
15
|
<button
|
|
16
16
|
type="button"
|
|
17
|
-
data-slot="
|
|
17
|
+
data-combobox-slot="trigger"
|
|
18
18
|
tabindex="-1"
|
|
19
19
|
aria-label="Show options"
|
|
20
20
|
></button>
|
|
21
21
|
</div>
|
|
22
|
-
<div
|
|
23
|
-
|
|
22
|
+
<div
|
|
23
|
+
data-combobox-slot="panel"
|
|
24
|
+
data-popover-side="bottom"
|
|
25
|
+
data-popover-align="start"
|
|
26
|
+
popover="manual"
|
|
27
|
+
>
|
|
28
|
+
<ul role="listbox" data-combobox-slot="list" aria-label="Countries">
|
|
24
29
|
<li
|
|
25
30
|
role="option"
|
|
26
|
-
data-slot="
|
|
27
|
-
|
|
28
|
-
data-variant="ghost"
|
|
29
|
-
data-value="au"
|
|
31
|
+
data-combobox-slot="item"
|
|
32
|
+
data-ui="button"
|
|
33
|
+
data-button-variant="ghost"
|
|
34
|
+
data-combobox-value="au"
|
|
35
|
+
style="--justify: start"
|
|
30
36
|
>
|
|
31
37
|
Australia
|
|
32
38
|
</li>
|
|
33
39
|
<li
|
|
34
40
|
role="option"
|
|
35
|
-
data-slot="
|
|
36
|
-
|
|
37
|
-
data-variant="ghost"
|
|
38
|
-
data-value="ca"
|
|
41
|
+
data-combobox-slot="item"
|
|
42
|
+
data-ui="button"
|
|
43
|
+
data-button-variant="ghost"
|
|
44
|
+
data-combobox-value="ca"
|
|
45
|
+
style="--justify: start"
|
|
39
46
|
>
|
|
40
47
|
Canada
|
|
41
48
|
</li>
|
|
42
49
|
<li
|
|
43
50
|
role="option"
|
|
44
|
-
data-slot="
|
|
45
|
-
|
|
46
|
-
data-variant="ghost"
|
|
47
|
-
data-value="jp"
|
|
51
|
+
data-combobox-slot="item"
|
|
52
|
+
data-ui="button"
|
|
53
|
+
data-button-variant="ghost"
|
|
54
|
+
data-combobox-value="jp"
|
|
55
|
+
style="--justify: start"
|
|
48
56
|
>
|
|
49
57
|
Japan
|
|
50
58
|
</li>
|
|
51
59
|
<li
|
|
52
60
|
role="option"
|
|
53
|
-
data-slot="
|
|
54
|
-
|
|
55
|
-
data-variant="ghost"
|
|
56
|
-
data-value="nz"
|
|
61
|
+
data-combobox-slot="item"
|
|
62
|
+
data-ui="button"
|
|
63
|
+
data-button-variant="ghost"
|
|
64
|
+
data-combobox-value="nz"
|
|
65
|
+
style="--justify: start"
|
|
57
66
|
>
|
|
58
67
|
New Zealand
|
|
59
68
|
</li>
|
|
60
69
|
<li
|
|
61
70
|
role="option"
|
|
62
|
-
data-slot="
|
|
63
|
-
|
|
64
|
-
data-variant="ghost"
|
|
65
|
-
data-value="us"
|
|
71
|
+
data-combobox-slot="item"
|
|
72
|
+
data-ui="button"
|
|
73
|
+
data-button-variant="ghost"
|
|
74
|
+
data-combobox-value="us"
|
|
75
|
+
style="--justify: start"
|
|
66
76
|
>
|
|
67
77
|
United States
|
|
68
78
|
</li>
|
|
69
79
|
</ul>
|
|
70
|
-
<p
|
|
80
|
+
<p
|
|
81
|
+
data-combobox-slot="empty"
|
|
82
|
+
style="
|
|
83
|
+
--font-size: var(--font-size-sm);
|
|
84
|
+
--leading: var(--leading-sm);
|
|
85
|
+
--tracking: var(--tracking-sm);
|
|
86
|
+
--text: var(--color-muted-foreground);
|
|
87
|
+
"
|
|
88
|
+
>
|
|
89
|
+
No matches.
|
|
90
|
+
</p>
|
|
71
91
|
</div>
|
|
72
92
|
</ui-combobox>
|
|
73
93
|
</div>
|