@zazz-ui/core 0.1.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/CHANGELOG.md +19 -0
- package/LICENSE +21 -0
- package/README.md +61 -0
- package/dist/sri.json +75 -0
- package/dist/zazz.css +1 -0
- package/dist/zazz.js +1 -0
- package/examples/about.html +590 -0
- package/examples/components.html +1040 -0
- package/examples/forms.html +511 -0
- package/examples/index.html +268 -0
- package/examples/layout.html +320 -0
- package/examples/products.html +846 -0
- package/examples/responsive.html +339 -0
- package/package.json +85 -0
- package/src/base/_layers.css +12 -0
- package/src/base/_layout.css +568 -0
- package/src/base/_reset.css +515 -0
- package/src/base/_typography.css +495 -0
- package/src/base/_utilities.css +6628 -0
- package/src/base/_variables.css +682 -0
- package/src/base/_view-transitions.css +103 -0
- package/src/base/command-score.d.ts +12 -0
- package/src/base/command-score.d.ts.map +1 -0
- package/src/base/command-score.js +151 -0
- package/src/base/command-score.ts +192 -0
- package/src/base/dialog-lifecycle.d.ts +11 -0
- package/src/base/dialog-lifecycle.d.ts.map +1 -0
- package/src/base/dialog-lifecycle.js +65 -0
- package/src/base/dialog-lifecycle.ts +80 -0
- package/src/base/embla.d.ts +90 -0
- package/src/base/embla.d.ts.map +1 -0
- package/src/base/embla.js +643 -0
- package/src/base/embla.ts +791 -0
- package/src/base/hotkeys.d.ts +82 -0
- package/src/base/hotkeys.d.ts.map +1 -0
- package/src/base/hotkeys.js +141 -0
- package/src/base/hotkeys.ts +195 -0
- package/src/base/navigation.d.ts +2 -0
- package/src/base/navigation.d.ts.map +1 -0
- package/src/base/navigation.js +136 -0
- package/src/base/navigation.ts +151 -0
- package/src/base/reveal.d.ts +80 -0
- package/src/base/reveal.d.ts.map +1 -0
- package/src/base/reveal.js +305 -0
- package/src/base/reveal.ts +379 -0
- package/src/base/signals.d.ts +89 -0
- package/src/base/signals.d.ts.map +1 -0
- package/src/base/signals.js +134 -0
- package/src/base/signals.ts +164 -0
- package/src/base/typeahead.d.ts +105 -0
- package/src/base/typeahead.d.ts.map +1 -0
- package/src/base/typeahead.js +411 -0
- package/src/base/typeahead.ts +500 -0
- package/src/base/utils.d.ts +56 -0
- package/src/base/utils.d.ts.map +1 -0
- package/src/base/utils.js +88 -0
- package/src/base/utils.ts +98 -0
- package/src/base/zazz-element.d.ts +44 -0
- package/src/base/zazz-element.d.ts.map +1 -0
- package/src/base/zazz-element.js +59 -0
- package/src/base/zazz-element.ts +73 -0
- package/src/globals.d.ts +148 -0
- package/src/head.d.ts +95 -0
- package/src/head.d.ts.map +1 -0
- package/src/head.js +311 -0
- package/src/head.ts +433 -0
- package/src/index.css +71 -0
- package/src/index.d.ts +36 -0
- package/src/index.d.ts.map +1 -0
- package/src/index.js +35 -0
- package/src/index.ts +36 -0
- package/src/manifest.d.ts +90 -0
- package/src/manifest.d.ts.map +1 -0
- package/src/manifest.js +614 -0
- package/src/manifest.ts +667 -0
- package/src/primitives/accordion/accordion.css +104 -0
- package/src/primitives/accordion/accordion.html +69 -0
- package/src/primitives/alert-dialog/alert-dialog.css +38 -0
- package/src/primitives/alert-dialog/alert-dialog.html +53 -0
- package/src/primitives/autocomplete/autocomplete-groups.html +77 -0
- package/src/primitives/autocomplete/autocomplete.css +114 -0
- package/src/primitives/autocomplete/autocomplete.d.ts +30 -0
- package/src/primitives/autocomplete/autocomplete.d.ts.map +1 -0
- package/src/primitives/autocomplete/autocomplete.html +66 -0
- package/src/primitives/autocomplete/autocomplete.js +41 -0
- package/src/primitives/autocomplete/autocomplete.ts +46 -0
- package/src/primitives/avatar/avatar.html +44 -0
- package/src/primitives/badge/badge-icon.html +36 -0
- package/src/primitives/badge/badge.css +251 -0
- package/src/primitives/badge/badge.html +7 -0
- package/src/primitives/breadcrumbs/breadcrumbs.html +9 -0
- package/src/primitives/button/button-icon-only.html +84 -0
- package/src/primitives/button/button-icon.html +82 -0
- package/src/primitives/button/button.css +319 -0
- package/src/primitives/button/button.html +8 -0
- package/src/primitives/button-group/button-group-vertical.html +6 -0
- package/src/primitives/button-group/button-group.css +94 -0
- package/src/primitives/button-group/button-group.html +64 -0
- package/src/primitives/card/card-subgrid.html +118 -0
- package/src/primitives/card/card.html +53 -0
- package/src/primitives/carousel/carousel.css +61 -0
- package/src/primitives/carousel/carousel.d.ts +16 -0
- package/src/primitives/carousel/carousel.d.ts.map +1 -0
- package/src/primitives/carousel/carousel.html +315 -0
- package/src/primitives/carousel/carousel.js +73 -0
- package/src/primitives/carousel/carousel.ts +84 -0
- package/src/primitives/checkbox/checkbox-tasklist.html +71 -0
- package/src/primitives/checkbox/checkbox.css +82 -0
- package/src/primitives/checkbox/checkbox.d.ts +21 -0
- package/src/primitives/checkbox/checkbox.d.ts.map +1 -0
- package/src/primitives/checkbox/checkbox.html +17 -0
- package/src/primitives/checkbox/checkbox.js +190 -0
- package/src/primitives/checkbox/checkbox.ts +219 -0
- package/src/primitives/combobox/combobox-multiselect.html +91 -0
- package/src/primitives/combobox/combobox.css +307 -0
- package/src/primitives/combobox/combobox.d.ts +100 -0
- package/src/primitives/combobox/combobox.d.ts.map +1 -0
- package/src/primitives/combobox/combobox.html +73 -0
- package/src/primitives/combobox/combobox.js +503 -0
- package/src/primitives/combobox/combobox.ts +559 -0
- package/src/primitives/command/command-actions.d.ts +31 -0
- package/src/primitives/command/command-actions.d.ts.map +1 -0
- package/src/primitives/command/command-actions.html +89 -0
- package/src/primitives/command/command-actions.js +70 -0
- package/src/primitives/command/command-actions.ts +77 -0
- package/src/primitives/command/command-dialog.html +77 -0
- package/src/primitives/command/command.css +151 -0
- package/src/primitives/command/command.d.ts +52 -0
- package/src/primitives/command/command.d.ts.map +1 -0
- package/src/primitives/command/command.html +119 -0
- package/src/primitives/command/command.js +146 -0
- package/src/primitives/command/command.ts +157 -0
- package/src/primitives/dialog/dialog-with-form.html +200 -0
- package/src/primitives/dialog/dialog.css +229 -0
- package/src/primitives/dialog/dialog.html +90 -0
- package/src/primitives/fields/fields.css +278 -0
- package/src/primitives/input/input-icon-leading.html +19 -0
- package/src/primitives/input/input-icon-trailing.html +18 -0
- package/src/primitives/input/input.css +114 -0
- package/src/primitives/input/input.html +61 -0
- package/src/primitives/input-group/input-group-password-group.html +108 -0
- package/src/primitives/input-group/input-group.css +215 -0
- package/src/primitives/input-group/input-group.html +132 -0
- package/src/primitives/kbd/kbd-group.html +18 -0
- package/src/primitives/kbd/kbd.css +87 -0
- package/src/primitives/kbd/kbd.html +7 -0
- package/src/primitives/lightbox/lightbox.css +459 -0
- package/src/primitives/lightbox/lightbox.d.ts +7 -0
- package/src/primitives/lightbox/lightbox.d.ts.map +1 -0
- package/src/primitives/lightbox/lightbox.html +665 -0
- package/src/primitives/lightbox/lightbox.js +96 -0
- package/src/primitives/lightbox/lightbox.ts +113 -0
- package/src/primitives/menu/menu-interest.html +52 -0
- package/src/primitives/menu/menu.css +55 -0
- package/src/primitives/menu/menu.d.ts +38 -0
- package/src/primitives/menu/menu.d.ts.map +1 -0
- package/src/primitives/menu/menu.html +70 -0
- package/src/primitives/menu/menu.js +117 -0
- package/src/primitives/menu/menu.ts +131 -0
- package/src/primitives/menubar/menubar-help-search.html +103 -0
- package/src/primitives/menubar/menubar.html +166 -0
- package/src/primitives/meter/meter.css +178 -0
- package/src/primitives/meter/meter.html +38 -0
- package/src/primitives/mobile-menu/mobile-menu.css +145 -0
- package/src/primitives/mobile-menu/mobile-menu.html +614 -0
- package/src/primitives/navigation-menu/navigation-menu-featured.html +76 -0
- package/src/primitives/navigation-menu/navigation-menu-icon-grid.html +158 -0
- package/src/primitives/navigation-menu/navigation-menu-interest.html +103 -0
- package/src/primitives/navigation-menu/navigation-menu-megamenu.html +141 -0
- package/src/primitives/navigation-menu/navigation-menu-simple.html +96 -0
- package/src/primitives/navigation-menu/navigation-menu.css +295 -0
- package/src/primitives/navigation-menu/navigation-menu.html +576 -0
- package/src/primitives/otp/otp.css +126 -0
- package/src/primitives/otp/otp.d.ts +89 -0
- package/src/primitives/otp/otp.d.ts.map +1 -0
- package/src/primitives/otp/otp.html +22 -0
- package/src/primitives/otp/otp.js +226 -0
- package/src/primitives/otp/otp.ts +279 -0
- package/src/primitives/password-group/password-group.css +238 -0
- package/src/primitives/password-group/password-group.d.ts +25 -0
- package/src/primitives/password-group/password-group.d.ts.map +1 -0
- package/src/primitives/password-group/password-group.html +109 -0
- package/src/primitives/password-group/password-group.js +76 -0
- package/src/primitives/password-group/password-group.ts +95 -0
- package/src/primitives/popover/popover.css +233 -0
- package/src/primitives/progress/progress-indeterminate.html +1 -0
- package/src/primitives/progress/progress.css +105 -0
- package/src/primitives/progress/progress.html +7 -0
- package/src/primitives/prose/prose.html +65 -0
- package/src/primitives/radio/radio.css +84 -0
- package/src/primitives/radio/radio.html +17 -0
- package/src/primitives/reveal/reveal.css +167 -0
- package/src/primitives/select/multiselect.d.ts +43 -0
- package/src/primitives/select/multiselect.d.ts.map +1 -0
- package/src/primitives/select/multiselect.js +147 -0
- package/src/primitives/select/multiselect.ts +188 -0
- package/src/primitives/select/select-align.html +49 -0
- package/src/primitives/select/select-multiple.html +12 -0
- package/src/primitives/select/select-sides.html +65 -0
- package/src/primitives/select/select.css +481 -0
- package/src/primitives/select/select.html +16 -0
- package/src/primitives/separator/separator.css +49 -0
- package/src/primitives/separator/separator.html +16 -0
- package/src/primitives/slider/slider.css +122 -0
- package/src/primitives/slider/slider.html +1 -0
- package/src/primitives/switch/switch.css +126 -0
- package/src/primitives/switch/switch.html +13 -0
- package/src/primitives/table/table-alternating.html +36 -0
- package/src/primitives/table/table-grid.html +30 -0
- package/src/primitives/table/table-size-sm.html +26 -0
- package/src/primitives/table/table.css +158 -0
- package/src/primitives/table/table.html +45 -0
- package/src/primitives/tabs/tabs.css +328 -0
- package/src/primitives/tabs/tabs.d.ts +35 -0
- package/src/primitives/tabs/tabs.d.ts.map +1 -0
- package/src/primitives/tabs/tabs.html +75 -0
- package/src/primitives/tabs/tabs.js +84 -0
- package/src/primitives/tabs/tabs.ts +93 -0
- package/src/primitives/textarea/textarea.css +78 -0
- package/src/primitives/textarea/textarea.html +10 -0
- package/src/primitives/toaster/toaster.css +309 -0
- package/src/primitives/toaster/toaster.d.ts +138 -0
- package/src/primitives/toaster/toaster.d.ts.map +1 -0
- package/src/primitives/toaster/toaster.html +77 -0
- package/src/primitives/toaster/toaster.js +736 -0
- package/src/primitives/toaster/toaster.ts +823 -0
- package/src/primitives/toggle/toggle.css +295 -0
- package/src/primitives/toggle/toggle.html +68 -0
- package/src/primitives/toggle-group/toggle-group-multiple.html +14 -0
- package/src/primitives/toggle-group/toggle-group-vertical.html +14 -0
- package/src/primitives/toggle-group/toggle-group.css +73 -0
- package/src/primitives/toggle-group/toggle-group.html +53 -0
- package/src/primitives/toolbar/toolbar.html +45 -0
- package/src/primitives/tooltip/tooltip-disabled.html +19 -0
- package/src/primitives/tooltip/tooltip-sides.html +57 -0
- package/src/primitives/tooltip/tooltip-with-kbd.html +31 -0
- package/src/primitives/tooltip/tooltip.css +235 -0
- package/src/primitives/tooltip/tooltip.html +12 -0
- package/src/primitives/utilities/aspect-ratio.html +17 -0
- package/src/primitives/utilities/basis.html +27 -0
- package/src/primitives/utilities/col-span.html +23 -0
- package/src/primitives/utilities/compose.html +19 -0
- package/src/primitives/utilities/flex-align.html +26 -0
- package/src/primitives/utilities/flex-direction.html +36 -0
- package/src/primitives/utilities/flex-grow.html +17 -0
- package/src/primitives/utilities/gap.html +62 -0
- package/src/primitives/utilities/grid-cols.html +20 -0
- package/src/primitives/utilities/grid-pile.html +5 -0
- package/src/primitives/utilities/grid-responsive.html +31 -0
- package/src/primitives/utilities/margin-auto.html +13 -0
- package/src/primitives/utilities/object-fit.html +41 -0
- package/src/primitives/utilities/order.html +17 -0
- package/src/primitives/utilities/overflow.html +26 -0
- package/src/primitives/utilities/padding-compose.html +23 -0
- package/src/primitives/utilities/padding.html +30 -0
- package/src/primitives/utilities/position.html +13 -0
- package/src/primitives/utilities/responsive-flex.html +22 -0
- package/src/primitives/utilities/responsive-grid.html +31 -0
- package/src/primitives/utilities/size.html +22 -0
- package/src/primitives/utilities/width.html +22 -0
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* checkbox.css — Checkbox (input[type="checkbox"]:not([role="switch"]))
|
|
3
|
+
*
|
|
4
|
+
* @layer reset
|
|
5
|
+
* @requires layers.css, _variables.css
|
|
6
|
+
* @uses appearance: none — redraws the native control from theme tokens
|
|
7
|
+
* @uses checked/indeterminate fill with --primary and layer a glyph (never colour alone)
|
|
8
|
+
* @tokens --ui-checkbox-* (size, background, border, radius, checkmark-mask, indeterminate-mask)
|
|
9
|
+
* @see checkbox.ts: derives select-all group state (data-checkbox-controls)
|
|
10
|
+
* into the JS-only indeterminate property; styling keys off :indeterminate
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
@layer reset {
|
|
14
|
+
:where(input[type="checkbox"]:not([role="switch"])) {
|
|
15
|
+
--ui-checkbox-size: var(--step-4_5);
|
|
16
|
+
--ui-checkbox-background: var(--input);
|
|
17
|
+
--ui-checkbox-border: var(--border);
|
|
18
|
+
--ui-checkbox-border--hover: var(--primary);
|
|
19
|
+
--ui-checkbox-background--checked: var(--primary);
|
|
20
|
+
--ui-checkbox-border--checked: var(--primary);
|
|
21
|
+
--ui-checkbox-radius: var(--radius-xs);
|
|
22
|
+
/* @see https://www.svgbackgrounds.com/tools/svg-to-css/
|
|
23
|
+
** Set to Legacy / URL Wrapper to update icon */
|
|
24
|
+
--ui-checkbox-checkmark-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%3Cpolyline points='40 144 96 200 224 72' fill='none' stroke='white' stroke-linecap='round' stroke-linejoin='round' stroke-width='32'/%3E%3C/svg%3E");
|
|
25
|
+
--ui-checkbox-checkmark-size: var(--step-3);
|
|
26
|
+
--ui-checkbox-indeterminate-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='40' y1='128' x2='216' y2='128' fill='none' stroke='white' stroke-linecap='round' stroke-linejoin='round' stroke-width='32'/%3E%3C/svg%3E");
|
|
27
|
+
--ui-checkbox-indeterminate-size: var(--step-3);
|
|
28
|
+
|
|
29
|
+
appearance: none;
|
|
30
|
+
flex-shrink: 0;
|
|
31
|
+
inline-size: var(--ui-checkbox-size);
|
|
32
|
+
block-size: var(--ui-checkbox-size);
|
|
33
|
+
|
|
34
|
+
background-color: var(--ui-checkbox-background);
|
|
35
|
+
border: 1px solid var(--ui-checkbox-border);
|
|
36
|
+
border-radius: var(--ui-checkbox-radius);
|
|
37
|
+
|
|
38
|
+
cursor: pointer;
|
|
39
|
+
|
|
40
|
+
/* ring renders as box-shadow; transparent outline twin keeps focus visible
|
|
41
|
+
in forced-colors / high-contrast modes */
|
|
42
|
+
--_ring-offset-width: 0px;
|
|
43
|
+
--_ring-width: 0px;
|
|
44
|
+
box-shadow:
|
|
45
|
+
0 0 0 var(--_ring-offset-width) var(--ring-offset-color),
|
|
46
|
+
0 0 0 calc(var(--_ring-offset-width) + var(--_ring-width)) var(--_ring, var(--ring));
|
|
47
|
+
outline: var(--outline-width) var(--outline-style) transparent;
|
|
48
|
+
outline-offset: var(--outline-offset);
|
|
49
|
+
|
|
50
|
+
transition: var(--default-transition);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
:where(input[type="checkbox"]:not([role="switch"]):hover) {
|
|
54
|
+
border-color: var(--ui-checkbox-border--hover);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
:where(input[type="checkbox"]:not([role="switch"]):focus-visible) {
|
|
58
|
+
--_ring-offset-width: var(--ring-offset-width);
|
|
59
|
+
--_ring-width: var(--ring-width);
|
|
60
|
+
outline-color: transparent;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
:where(
|
|
64
|
+
input[type="checkbox"]:not([role="switch"]):checked,
|
|
65
|
+
input[type="checkbox"]:not([role="switch"]):indeterminate
|
|
66
|
+
) {
|
|
67
|
+
background-color: var(--ui-checkbox-background--checked);
|
|
68
|
+
border-color: var(--ui-checkbox-border--checked);
|
|
69
|
+
background-repeat: no-repeat;
|
|
70
|
+
background-position: center;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
:where(input[type="checkbox"]:not([role="switch"]):checked) {
|
|
74
|
+
background-image: var(--ui-checkbox-checkmark-mask);
|
|
75
|
+
background-size: var(--ui-checkbox-checkmark-size);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
:where(input[type="checkbox"]:not([role="switch"]):indeterminate) {
|
|
79
|
+
background-image: var(--ui-checkbox-indeterminate-mask);
|
|
80
|
+
background-size: var(--ui-checkbox-indeterminate-size);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/** The tri-state a select-all controller derives from its members. */
|
|
2
|
+
type TriState = "all" | "some" | "none";
|
|
3
|
+
/**
|
|
4
|
+
* @description Derives a controller's tri-state from its members' checked
|
|
5
|
+
* states: `"all"` when every member is checked (and there is at least one),
|
|
6
|
+
* `"none"` when none are, `"some"` for a subset.
|
|
7
|
+
*
|
|
8
|
+
* @param checked - Each member's checked state.
|
|
9
|
+
* @returns The derived tri-state.
|
|
10
|
+
*/
|
|
11
|
+
declare function deriveTriState(checked: readonly boolean[]): TriState;
|
|
12
|
+
/**
|
|
13
|
+
* @description Initializes select-all groups in a scope: prunes groups whose
|
|
14
|
+
* controllers left the DOM (disposing their effects), creates groups for new
|
|
15
|
+
* controllers, and recounts existing ones. Idempotent: re-running is a no-op.
|
|
16
|
+
*
|
|
17
|
+
* @param scope - Root to scan; defaults to the whole document.
|
|
18
|
+
*/
|
|
19
|
+
declare function initCheckboxes(scope?: ParentNode): void;
|
|
20
|
+
export { deriveTriState, initCheckboxes };
|
|
21
|
+
//# sourceMappingURL=checkbox.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkbox.d.ts","sourceRoot":"","sources":["checkbox.ts"],"names":[],"mappings":"AAmCA,sEAAsE;AACtE,KAAK,QAAQ,GAAG,KAAK,GAAG,MAAM,GAAG,MAAM,CAAC;AAExC;;;;;;;GAOG;AACH,iBAAS,cAAc,CAAC,OAAO,EAAE,SAAS,OAAO,EAAE,GAAG,QAAQ,CAI7D;AA8HD;;;;;;GAMG;AACH,iBAAS,cAAc,CAAC,KAAK,GAAE,UAAqB,GAAG,IAAI,CAkB1D;AAiBD,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<fieldset class="ui-field-group">
|
|
2
|
+
<legend>Preferences</legend>
|
|
3
|
+
<div class="flex flex-col gap-xs">
|
|
4
|
+
<label class="ui-field" data-orientation="horizontal">
|
|
5
|
+
<input type="checkbox" data-checkbox-controls="preferences" />
|
|
6
|
+
<span data-slot="field-label">Select all</span>
|
|
7
|
+
</label>
|
|
8
|
+
<label class="ui-field" data-orientation="horizontal">
|
|
9
|
+
<input type="checkbox" name="preferences" value="newsletter" />
|
|
10
|
+
<span data-slot="field-label">Subscribe to the newsletter</span>
|
|
11
|
+
</label>
|
|
12
|
+
<label class="ui-field" data-orientation="horizontal">
|
|
13
|
+
<input type="checkbox" name="preferences" value="terms" checked />
|
|
14
|
+
<span data-slot="field-label">Accept terms & conditions</span>
|
|
15
|
+
</label>
|
|
16
|
+
</div>
|
|
17
|
+
</fieldset>
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @fileoverview Checkbox select-all groups.
|
|
4
|
+
* @description Derives a select-all checkbox's tri-state from its members.
|
|
5
|
+
* A controller declares `data-checkbox-controls="<name>"` and manages every
|
|
6
|
+
* checkbox sharing that `name` within the same form (or the document when
|
|
7
|
+
* unassociated). Checking the controller checks or unchecks all members;
|
|
8
|
+
* member changes roll back up as checked (all), unchecked (none), or
|
|
9
|
+
* indeterminate (a subset) — the mixed state is the JS-only `indeterminate`
|
|
10
|
+
* property (the platform has no content attribute for it), painted by
|
|
11
|
+
* `:indeterminate` in checkbox.css. Members inside a `<tr>` reflect their
|
|
12
|
+
* state as `data-state="selected"` on the row, lighting up the table
|
|
13
|
+
* primitive's selected-row styling.
|
|
14
|
+
*
|
|
15
|
+
* State follows the kit's signals division of labor (`base/signals.ts`): the
|
|
16
|
+
* delegated change listener is the input adapter writing member states into
|
|
17
|
+
* `state`; `deriveTriState` is the pure derived logic under `computed`; one
|
|
18
|
+
* `effect` per group writes the controller property and row attributes back
|
|
19
|
+
* to the DOM, batched to a microtask.
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* <table class="ui-table">
|
|
23
|
+
* <thead><tr><th><input type="checkbox" data-checkbox-controls="tasks" /></th>...</tr></thead>
|
|
24
|
+
* <tbody><tr><td><input type="checkbox" name="tasks" /></td>...</tr></tbody>
|
|
25
|
+
* </table>
|
|
26
|
+
*/
|
|
27
|
+
import { computed, effect, state } from "../../base/signals.js";
|
|
28
|
+
import { registerRefresh } from "../../base/zazz-element.js";
|
|
29
|
+
const CONTROLS_ATTR = "data-checkbox-controls";
|
|
30
|
+
/**
|
|
31
|
+
* @description Derives a controller's tri-state from its members' checked
|
|
32
|
+
* states: `"all"` when every member is checked (and there is at least one),
|
|
33
|
+
* `"none"` when none are, `"some"` for a subset.
|
|
34
|
+
*
|
|
35
|
+
* @param checked - Each member's checked state.
|
|
36
|
+
* @returns The derived tri-state.
|
|
37
|
+
*/
|
|
38
|
+
function deriveTriState(checked) {
|
|
39
|
+
const count = checked.filter(Boolean).length;
|
|
40
|
+
if (count === 0)
|
|
41
|
+
return "none";
|
|
42
|
+
return count === checked.length ? "all" : "some";
|
|
43
|
+
}
|
|
44
|
+
// --- Group discovery ---
|
|
45
|
+
/**
|
|
46
|
+
* @description Collects the member checkboxes a controller manages: every
|
|
47
|
+
* checkbox sharing the controlled `name` in the controller's form, or in the
|
|
48
|
+
* document when the controller has no form.
|
|
49
|
+
*
|
|
50
|
+
* @param controller - The select-all checkbox.
|
|
51
|
+
* @returns The managed member checkboxes (never the controller itself).
|
|
52
|
+
* @private
|
|
53
|
+
*/
|
|
54
|
+
function membersOf(controller) {
|
|
55
|
+
const name = controller.getAttribute(CONTROLS_ATTR);
|
|
56
|
+
if (!name)
|
|
57
|
+
return [];
|
|
58
|
+
const scope = controller.form ?? controller.ownerDocument;
|
|
59
|
+
const inputs = scope.querySelectorAll('input[type="checkbox"]');
|
|
60
|
+
return Array.from(inputs).filter((input) => input.name === name && input !== controller);
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* @description Finds the controller managing a member checkbox, if any.
|
|
64
|
+
*
|
|
65
|
+
* @param member - A checkbox that may belong to a select-all group.
|
|
66
|
+
* @returns The controller, or null when the checkbox is unmanaged.
|
|
67
|
+
* @private
|
|
68
|
+
*/
|
|
69
|
+
function controllerOf(member) {
|
|
70
|
+
if (!member.name)
|
|
71
|
+
return null;
|
|
72
|
+
const scope = member.form ?? member.ownerDocument;
|
|
73
|
+
const controllers = scope.querySelectorAll(`input[type="checkbox"][${CONTROLS_ATTR}]`);
|
|
74
|
+
for (const controller of controllers) {
|
|
75
|
+
if (controller.getAttribute(CONTROLS_ATTR) === member.name && controller !== member) {
|
|
76
|
+
return controller;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
return null;
|
|
80
|
+
}
|
|
81
|
+
/** Live groups keyed by controller; pruned in `initCheckboxes`. */
|
|
82
|
+
const groups = new Map();
|
|
83
|
+
/**
|
|
84
|
+
* @description Reads members' checked states from the DOM into a group's
|
|
85
|
+
* signal. The DOM stays the source of truth for the element list.
|
|
86
|
+
*
|
|
87
|
+
* @param controller - The group's select-all checkbox.
|
|
88
|
+
* @private
|
|
89
|
+
*/
|
|
90
|
+
function recount(controller) {
|
|
91
|
+
groups.get(controller)?.members.set(membersOf(controller).map((member) => member.checked));
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* @description Creates the reactive group for a controller: a member-state
|
|
95
|
+
* signal, the pure tri-state derivation, and one effect writing the
|
|
96
|
+
* controller's `checked`/`indeterminate` and each member row's
|
|
97
|
+
* `data-state="selected"` back to the DOM. The effect's first run is
|
|
98
|
+
* immediate; re-runs batch to a microtask.
|
|
99
|
+
*
|
|
100
|
+
* @param controller - The select-all checkbox.
|
|
101
|
+
* @private
|
|
102
|
+
*/
|
|
103
|
+
function createGroup(controller) {
|
|
104
|
+
const members = state(membersOf(controller).map((member) => member.checked));
|
|
105
|
+
const tri = computed(() => deriveTriState(members.get()));
|
|
106
|
+
const dispose = effect(() => {
|
|
107
|
+
const derived = tri.get();
|
|
108
|
+
const checked = members.get();
|
|
109
|
+
controller.checked = derived === "all";
|
|
110
|
+
controller.indeterminate = derived === "some";
|
|
111
|
+
membersOf(controller).forEach((member, index) => {
|
|
112
|
+
const row = member.closest("tr");
|
|
113
|
+
if (!row)
|
|
114
|
+
return;
|
|
115
|
+
if (checked[index]) {
|
|
116
|
+
row.setAttribute("data-state", "selected");
|
|
117
|
+
}
|
|
118
|
+
else if (row.getAttribute("data-state") === "selected") {
|
|
119
|
+
row.removeAttribute("data-state");
|
|
120
|
+
}
|
|
121
|
+
});
|
|
122
|
+
});
|
|
123
|
+
groups.set(controller, { members, dispose });
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* @description Delegated change handler (input adapter): a controller change
|
|
127
|
+
* fans out to its members imperatively then writes the group signal once; a
|
|
128
|
+
* member change recounts its group.
|
|
129
|
+
*
|
|
130
|
+
* @param event - The change event.
|
|
131
|
+
* @private
|
|
132
|
+
*/
|
|
133
|
+
function onChange(event) {
|
|
134
|
+
const target = event.target;
|
|
135
|
+
if (!(target instanceof HTMLInputElement) || target.type !== "checkbox")
|
|
136
|
+
return;
|
|
137
|
+
if (target.hasAttribute(CONTROLS_ATTR)) {
|
|
138
|
+
if (!groups.has(target))
|
|
139
|
+
createGroup(target);
|
|
140
|
+
for (const member of membersOf(target))
|
|
141
|
+
member.checked = target.checked;
|
|
142
|
+
recount(target);
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
145
|
+
const controller = controllerOf(target);
|
|
146
|
+
if (!controller)
|
|
147
|
+
return;
|
|
148
|
+
if (!groups.has(controller))
|
|
149
|
+
createGroup(controller);
|
|
150
|
+
recount(controller);
|
|
151
|
+
}
|
|
152
|
+
// --- Init ---
|
|
153
|
+
/**
|
|
154
|
+
* @description Initializes select-all groups in a scope: prunes groups whose
|
|
155
|
+
* controllers left the DOM (disposing their effects), creates groups for new
|
|
156
|
+
* controllers, and recounts existing ones. Idempotent: re-running is a no-op.
|
|
157
|
+
*
|
|
158
|
+
* @param scope - Root to scan; defaults to the whole document.
|
|
159
|
+
*/
|
|
160
|
+
function initCheckboxes(scope = document) {
|
|
161
|
+
for (const [controller, group] of groups) {
|
|
162
|
+
if (!controller.isConnected) {
|
|
163
|
+
group.dispose();
|
|
164
|
+
groups.delete(controller);
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
const controllers = scope.querySelectorAll(`input[type="checkbox"][${CONTROLS_ATTR}]`);
|
|
168
|
+
for (const controller of controllers) {
|
|
169
|
+
if (groups.has(controller)) {
|
|
170
|
+
recount(controller);
|
|
171
|
+
}
|
|
172
|
+
else {
|
|
173
|
+
createGroup(controller);
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
// Auto-initialize when DOM is ready (only in browser environment)
|
|
178
|
+
if (typeof window !== "undefined" && typeof document !== "undefined") {
|
|
179
|
+
if (document.readyState === "loading") {
|
|
180
|
+
document.addEventListener("DOMContentLoaded", () => initCheckboxes());
|
|
181
|
+
}
|
|
182
|
+
else {
|
|
183
|
+
initCheckboxes();
|
|
184
|
+
}
|
|
185
|
+
// Delegate at document level so groups work wherever checkboxes appear.
|
|
186
|
+
document.addEventListener("change", onChange);
|
|
187
|
+
// After a SPA <main> swap, re-scan the new content.
|
|
188
|
+
registerRefresh(initCheckboxes);
|
|
189
|
+
}
|
|
190
|
+
export { deriveTriState, initCheckboxes };
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @fileoverview Checkbox select-all groups.
|
|
5
|
+
* @description Derives a select-all checkbox's tri-state from its members.
|
|
6
|
+
* A controller declares `data-checkbox-controls="<name>"` and manages every
|
|
7
|
+
* checkbox sharing that `name` within the same form (or the document when
|
|
8
|
+
* unassociated). Checking the controller checks or unchecks all members;
|
|
9
|
+
* member changes roll back up as checked (all), unchecked (none), or
|
|
10
|
+
* indeterminate (a subset) — the mixed state is the JS-only `indeterminate`
|
|
11
|
+
* property (the platform has no content attribute for it), painted by
|
|
12
|
+
* `:indeterminate` in checkbox.css. Members inside a `<tr>` reflect their
|
|
13
|
+
* state as `data-state="selected"` on the row, lighting up the table
|
|
14
|
+
* primitive's selected-row styling.
|
|
15
|
+
*
|
|
16
|
+
* State follows the kit's signals division of labor (`base/signals.ts`): the
|
|
17
|
+
* delegated change listener is the input adapter writing member states into
|
|
18
|
+
* `state`; `deriveTriState` is the pure derived logic under `computed`; one
|
|
19
|
+
* `effect` per group writes the controller property and row attributes back
|
|
20
|
+
* to the DOM, batched to a microtask.
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* <table class="ui-table">
|
|
24
|
+
* <thead><tr><th><input type="checkbox" data-checkbox-controls="tasks" /></th>...</tr></thead>
|
|
25
|
+
* <tbody><tr><td><input type="checkbox" name="tasks" /></td>...</tr></tbody>
|
|
26
|
+
* </table>
|
|
27
|
+
*/
|
|
28
|
+
|
|
29
|
+
import { computed, effect, state } from "../../base/signals.ts";
|
|
30
|
+
import { registerRefresh } from "../../base/zazz-element.ts";
|
|
31
|
+
|
|
32
|
+
const CONTROLS_ATTR = "data-checkbox-controls";
|
|
33
|
+
|
|
34
|
+
// --- Pure derived logic ---
|
|
35
|
+
|
|
36
|
+
/** The tri-state a select-all controller derives from its members. */
|
|
37
|
+
type TriState = "all" | "some" | "none";
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* @description Derives a controller's tri-state from its members' checked
|
|
41
|
+
* states: `"all"` when every member is checked (and there is at least one),
|
|
42
|
+
* `"none"` when none are, `"some"` for a subset.
|
|
43
|
+
*
|
|
44
|
+
* @param checked - Each member's checked state.
|
|
45
|
+
* @returns The derived tri-state.
|
|
46
|
+
*/
|
|
47
|
+
function deriveTriState(checked: readonly boolean[]): TriState {
|
|
48
|
+
const count = checked.filter(Boolean).length;
|
|
49
|
+
if (count === 0) return "none";
|
|
50
|
+
return count === checked.length ? "all" : "some";
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
// --- Group discovery ---
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* @description Collects the member checkboxes a controller manages: every
|
|
57
|
+
* checkbox sharing the controlled `name` in the controller's form, or in the
|
|
58
|
+
* document when the controller has no form.
|
|
59
|
+
*
|
|
60
|
+
* @param controller - The select-all checkbox.
|
|
61
|
+
* @returns The managed member checkboxes (never the controller itself).
|
|
62
|
+
* @private
|
|
63
|
+
*/
|
|
64
|
+
function membersOf(controller: HTMLInputElement): HTMLInputElement[] {
|
|
65
|
+
const name = controller.getAttribute(CONTROLS_ATTR);
|
|
66
|
+
if (!name) return [];
|
|
67
|
+
const scope: ParentNode = controller.form ?? controller.ownerDocument;
|
|
68
|
+
const inputs = scope.querySelectorAll<HTMLInputElement>('input[type="checkbox"]');
|
|
69
|
+
return Array.from(inputs).filter((input) => input.name === name && input !== controller);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* @description Finds the controller managing a member checkbox, if any.
|
|
74
|
+
*
|
|
75
|
+
* @param member - A checkbox that may belong to a select-all group.
|
|
76
|
+
* @returns The controller, or null when the checkbox is unmanaged.
|
|
77
|
+
* @private
|
|
78
|
+
*/
|
|
79
|
+
function controllerOf(member: HTMLInputElement): HTMLInputElement | null {
|
|
80
|
+
if (!member.name) return null;
|
|
81
|
+
const scope: ParentNode = member.form ?? member.ownerDocument;
|
|
82
|
+
const controllers = scope.querySelectorAll<HTMLInputElement>(
|
|
83
|
+
`input[type="checkbox"][${CONTROLS_ATTR}]`,
|
|
84
|
+
);
|
|
85
|
+
for (const controller of controllers) {
|
|
86
|
+
if (controller.getAttribute(CONTROLS_ATTR) === member.name && controller !== member) {
|
|
87
|
+
return controller;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
return null;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
// --- Reactive groups ---
|
|
94
|
+
|
|
95
|
+
/** A live select-all group: the member-state signal and its effect disposer. */
|
|
96
|
+
interface Group {
|
|
97
|
+
/** Each member's checked state, recounted from the DOM (input adapter writes here). */
|
|
98
|
+
members: ReturnType<typeof state<boolean[]>>;
|
|
99
|
+
/** Disposes the group's DOM-writing effect. */
|
|
100
|
+
dispose: () => void;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/** Live groups keyed by controller; pruned in `initCheckboxes`. */
|
|
104
|
+
const groups = new Map<HTMLInputElement, Group>();
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* @description Reads members' checked states from the DOM into a group's
|
|
108
|
+
* signal. The DOM stays the source of truth for the element list.
|
|
109
|
+
*
|
|
110
|
+
* @param controller - The group's select-all checkbox.
|
|
111
|
+
* @private
|
|
112
|
+
*/
|
|
113
|
+
function recount(controller: HTMLInputElement): void {
|
|
114
|
+
groups.get(controller)?.members.set(membersOf(controller).map((member) => member.checked));
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* @description Creates the reactive group for a controller: a member-state
|
|
119
|
+
* signal, the pure tri-state derivation, and one effect writing the
|
|
120
|
+
* controller's `checked`/`indeterminate` and each member row's
|
|
121
|
+
* `data-state="selected"` back to the DOM. The effect's first run is
|
|
122
|
+
* immediate; re-runs batch to a microtask.
|
|
123
|
+
*
|
|
124
|
+
* @param controller - The select-all checkbox.
|
|
125
|
+
* @private
|
|
126
|
+
*/
|
|
127
|
+
function createGroup(controller: HTMLInputElement): void {
|
|
128
|
+
const members = state(membersOf(controller).map((member) => member.checked));
|
|
129
|
+
const tri = computed(() => deriveTriState(members.get()));
|
|
130
|
+
|
|
131
|
+
const dispose = effect(() => {
|
|
132
|
+
const derived = tri.get();
|
|
133
|
+
const checked = members.get();
|
|
134
|
+
controller.checked = derived === "all";
|
|
135
|
+
controller.indeterminate = derived === "some";
|
|
136
|
+
membersOf(controller).forEach((member, index) => {
|
|
137
|
+
const row = member.closest("tr");
|
|
138
|
+
if (!row) return;
|
|
139
|
+
if (checked[index]) {
|
|
140
|
+
row.setAttribute("data-state", "selected");
|
|
141
|
+
} else if (row.getAttribute("data-state") === "selected") {
|
|
142
|
+
row.removeAttribute("data-state");
|
|
143
|
+
}
|
|
144
|
+
});
|
|
145
|
+
});
|
|
146
|
+
|
|
147
|
+
groups.set(controller, { members, dispose });
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* @description Delegated change handler (input adapter): a controller change
|
|
152
|
+
* fans out to its members imperatively then writes the group signal once; a
|
|
153
|
+
* member change recounts its group.
|
|
154
|
+
*
|
|
155
|
+
* @param event - The change event.
|
|
156
|
+
* @private
|
|
157
|
+
*/
|
|
158
|
+
function onChange(event: Event): void {
|
|
159
|
+
const target = event.target;
|
|
160
|
+
if (!(target instanceof HTMLInputElement) || target.type !== "checkbox") return;
|
|
161
|
+
|
|
162
|
+
if (target.hasAttribute(CONTROLS_ATTR)) {
|
|
163
|
+
if (!groups.has(target)) createGroup(target);
|
|
164
|
+
for (const member of membersOf(target)) member.checked = target.checked;
|
|
165
|
+
recount(target);
|
|
166
|
+
return;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
const controller = controllerOf(target);
|
|
170
|
+
if (!controller) return;
|
|
171
|
+
if (!groups.has(controller)) createGroup(controller);
|
|
172
|
+
recount(controller);
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
// --- Init ---
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
* @description Initializes select-all groups in a scope: prunes groups whose
|
|
179
|
+
* controllers left the DOM (disposing their effects), creates groups for new
|
|
180
|
+
* controllers, and recounts existing ones. Idempotent: re-running is a no-op.
|
|
181
|
+
*
|
|
182
|
+
* @param scope - Root to scan; defaults to the whole document.
|
|
183
|
+
*/
|
|
184
|
+
function initCheckboxes(scope: ParentNode = document): void {
|
|
185
|
+
for (const [controller, group] of groups) {
|
|
186
|
+
if (!controller.isConnected) {
|
|
187
|
+
group.dispose();
|
|
188
|
+
groups.delete(controller);
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
const controllers = scope.querySelectorAll<HTMLInputElement>(
|
|
193
|
+
`input[type="checkbox"][${CONTROLS_ATTR}]`,
|
|
194
|
+
);
|
|
195
|
+
for (const controller of controllers) {
|
|
196
|
+
if (groups.has(controller)) {
|
|
197
|
+
recount(controller);
|
|
198
|
+
} else {
|
|
199
|
+
createGroup(controller);
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
// Auto-initialize when DOM is ready (only in browser environment)
|
|
205
|
+
if (typeof window !== "undefined" && typeof document !== "undefined") {
|
|
206
|
+
if (document.readyState === "loading") {
|
|
207
|
+
document.addEventListener("DOMContentLoaded", () => initCheckboxes());
|
|
208
|
+
} else {
|
|
209
|
+
initCheckboxes();
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
// Delegate at document level so groups work wherever checkboxes appear.
|
|
213
|
+
document.addEventListener("change", onChange);
|
|
214
|
+
|
|
215
|
+
// After a SPA <main> swap, re-scan the new content.
|
|
216
|
+
registerRefresh(initCheckboxes);
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
export { deriveTriState, initCheckboxes };
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
<div class="ui-field max-w-xl">
|
|
2
|
+
<label data-slot="field-label" for="cb-tags">Tags</label>
|
|
3
|
+
<ui-combobox data-variant="multiselect" data-label-remove="Remove {label}">
|
|
4
|
+
<!-- Pre-selected rows carry aria-selected="true"; the authored input holds
|
|
5
|
+
the first value and combobox.js stamps a same-name sibling per extra -->
|
|
6
|
+
<input type="hidden" name="tags" data-slot="combobox-value" value="design" />
|
|
7
|
+
<div data-slot="combobox-control">
|
|
8
|
+
<!-- Optional: the tag blueprint, cloned per selection. Omit it and the
|
|
9
|
+
kit's default applies; keep it to restyle tags in HTML -->
|
|
10
|
+
<template data-slot="combobox-tag-template">
|
|
11
|
+
<span class="ui-badge" data-slot="combobox-tag">
|
|
12
|
+
<span data-slot="combobox-tag-label"></span>
|
|
13
|
+
<button type="button" tabindex="-1" data-slot="combobox-tag-remove"></button>
|
|
14
|
+
</span>
|
|
15
|
+
</template>
|
|
16
|
+
|
|
17
|
+
<input
|
|
18
|
+
id="cb-tags"
|
|
19
|
+
type="text"
|
|
20
|
+
placeholder="Add tags..."
|
|
21
|
+
role="combobox"
|
|
22
|
+
aria-expanded="false"
|
|
23
|
+
aria-autocomplete="list"
|
|
24
|
+
autocomplete="off"
|
|
25
|
+
hidden
|
|
26
|
+
aria-hidden="true"
|
|
27
|
+
/>
|
|
28
|
+
<button
|
|
29
|
+
type="button"
|
|
30
|
+
data-slot="combobox-trigger"
|
|
31
|
+
tabindex="-1"
|
|
32
|
+
aria-label="Show options"
|
|
33
|
+
></button>
|
|
34
|
+
</div>
|
|
35
|
+
<div data-slot="combobox-panel" data-side="bottom" data-align="start" popover="manual">
|
|
36
|
+
<ul role="listbox" aria-multiselectable="true" data-slot="combobox-list" aria-label="Tags">
|
|
37
|
+
<li
|
|
38
|
+
role="option"
|
|
39
|
+
aria-selected="true"
|
|
40
|
+
data-slot="combobox-item"
|
|
41
|
+
class="ui-button justify-start"
|
|
42
|
+
data-variant="ghost"
|
|
43
|
+
data-value="design"
|
|
44
|
+
>
|
|
45
|
+
Design
|
|
46
|
+
</li>
|
|
47
|
+
<li
|
|
48
|
+
role="option"
|
|
49
|
+
aria-selected="true"
|
|
50
|
+
data-slot="combobox-item"
|
|
51
|
+
class="ui-button justify-start"
|
|
52
|
+
data-variant="ghost"
|
|
53
|
+
data-value="engineering"
|
|
54
|
+
>
|
|
55
|
+
Engineering
|
|
56
|
+
</li>
|
|
57
|
+
<li
|
|
58
|
+
role="option"
|
|
59
|
+
aria-selected="false"
|
|
60
|
+
data-slot="combobox-item"
|
|
61
|
+
class="ui-button justify-start"
|
|
62
|
+
data-variant="ghost"
|
|
63
|
+
data-value="marketing"
|
|
64
|
+
>
|
|
65
|
+
Marketing
|
|
66
|
+
</li>
|
|
67
|
+
<li
|
|
68
|
+
role="option"
|
|
69
|
+
aria-selected="false"
|
|
70
|
+
data-slot="combobox-item"
|
|
71
|
+
class="ui-button justify-start"
|
|
72
|
+
data-variant="ghost"
|
|
73
|
+
data-value="research"
|
|
74
|
+
>
|
|
75
|
+
Research
|
|
76
|
+
</li>
|
|
77
|
+
<li
|
|
78
|
+
role="option"
|
|
79
|
+
aria-selected="false"
|
|
80
|
+
data-slot="combobox-item"
|
|
81
|
+
class="ui-button justify-start"
|
|
82
|
+
data-variant="ghost"
|
|
83
|
+
data-value="support"
|
|
84
|
+
>
|
|
85
|
+
Support
|
|
86
|
+
</li>
|
|
87
|
+
</ul>
|
|
88
|
+
<p data-slot="combobox-empty" class="text-muted-foreground text-sm">No matches.</p>
|
|
89
|
+
</div>
|
|
90
|
+
</ui-combobox>
|
|
91
|
+
</div>
|