@adia-ai/web-components 0.6.33 → 0.6.34
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 +22 -0
- package/components/accordion/accordion.css +2 -2
- package/components/action-list/action-list.css +2 -2
- package/components/agent-artifact/agent-artifact.css +31 -31
- package/components/agent-feedback-bar/agent-feedback-bar.css +10 -10
- package/components/agent-questions/agent-questions.css +57 -57
- package/components/agent-reasoning/agent-reasoning.css +62 -62
- package/components/agent-suggestions/agent-suggestions.css +4 -4
- package/components/agent-trace/agent-trace.css +53 -53
- package/components/alert/alert.css +41 -41
- package/components/avatar/avatar.css +27 -27
- package/components/badge/badge.css +27 -27
- package/components/block/block.css +16 -16
- package/components/breadcrumb/breadcrumb.css +23 -23
- package/components/button/button.css +101 -91
- package/components/calendar-grid/calendar-grid.a2ui.json +136 -0
- package/components/calendar-grid/calendar-grid.css +226 -0
- package/components/calendar-grid/calendar-grid.d.ts +37 -0
- package/components/calendar-grid/calendar-grid.js +17 -0
- package/components/calendar-grid/calendar-grid.yaml +116 -0
- package/components/calendar-grid/class.js +300 -0
- package/components/calendar-picker/calendar-picker.css +139 -139
- package/components/canvas/canvas.css +12 -12
- package/components/card/card.css +83 -83
- package/components/chart/chart.css +224 -224
- package/components/chart-legend/chart-legend.css +26 -26
- package/components/check/check.css +40 -40
- package/components/code/code.css +125 -125
- package/components/col/col.css +15 -15
- package/components/color-picker/color-picker.css +55 -55
- package/components/combobox/class.js +861 -0
- package/components/combobox/combobox.a2ui.json +363 -0
- package/components/combobox/combobox.css +244 -0
- package/components/combobox/combobox.d.ts +113 -0
- package/components/combobox/combobox.examples.md +59 -0
- package/components/combobox/combobox.js +17 -0
- package/components/combobox/combobox.test.js +181 -0
- package/components/combobox/combobox.yaml +369 -0
- package/components/command/command.css +90 -90
- package/components/date-range-picker/class.js +775 -0
- package/components/date-range-picker/date-range-picker.a2ui.json +300 -0
- package/components/date-range-picker/date-range-picker.css +178 -0
- package/components/date-range-picker/date-range-picker.d.ts +82 -0
- package/components/date-range-picker/date-range-picker.examples.md +37 -0
- package/components/date-range-picker/date-range-picker.js +17 -0
- package/components/date-range-picker/date-range-picker.test.js +387 -0
- package/components/date-range-picker/date-range-picker.yaml +285 -0
- package/components/datetime-picker/class.js +706 -0
- package/components/datetime-picker/datetime-picker.a2ui.json +334 -0
- package/components/datetime-picker/datetime-picker.css +150 -0
- package/components/datetime-picker/datetime-picker.d.ts +86 -0
- package/components/datetime-picker/datetime-picker.examples.md +46 -0
- package/components/datetime-picker/datetime-picker.js +17 -0
- package/components/datetime-picker/datetime-picker.test.js +454 -0
- package/components/datetime-picker/datetime-picker.yaml +332 -0
- package/components/demo-toggle/demo-toggle.css +27 -27
- package/components/description-list/description-list.css +18 -18
- package/components/divider/divider.css +24 -24
- package/components/embed/embed.css +6 -6
- package/components/empty-state/empty-state.css +27 -27
- package/components/feed/feed.css +12 -12
- package/components/field/field.css +28 -28
- package/components/fields/fields.css +5 -5
- package/components/grid/grid.css +5 -5
- package/components/heatmap/heatmap.css +63 -63
- package/components/icon/icon.css +12 -12
- package/components/image/image.css +14 -14
- package/components/index.js +8 -0
- package/components/input/input.css +66 -66
- package/components/inspector/inspector.css +6 -6
- package/components/integration-card/class.js +410 -0
- package/components/integration-card/integration-card.a2ui.json +268 -0
- package/components/integration-card/integration-card.css +169 -0
- package/components/integration-card/integration-card.d.ts +63 -0
- package/components/integration-card/integration-card.examples.md +41 -0
- package/components/integration-card/integration-card.js +17 -0
- package/components/integration-card/integration-card.test.js +306 -0
- package/components/integration-card/integration-card.yaml +280 -0
- package/components/kbd/kbd.css +32 -32
- package/components/link/link.css +12 -12
- package/components/list/list.css +8 -8
- package/components/list-window/class.js +688 -0
- package/components/list-window/list-window.a2ui.json +277 -0
- package/components/list-window/list-window.css +124 -0
- package/components/list-window/list-window.d.ts +84 -0
- package/components/list-window/list-window.examples.md +73 -0
- package/components/list-window/list-window.js +17 -0
- package/components/list-window/list-window.test.js +303 -0
- package/components/list-window/list-window.yaml +270 -0
- package/components/menu/menu.css +8 -8
- package/components/modal/modal.css +43 -43
- package/components/nav/nav.css +40 -40
- package/components/nav-group/nav-group.css +52 -52
- package/components/nav-item/nav-item.css +44 -44
- package/components/noodles/noodles.css +31 -31
- package/components/option-card/option-card.css +69 -69
- package/components/otp-input/otp-input.css +30 -30
- package/components/page/page.css +18 -18
- package/components/pagination/pagination.css +61 -61
- package/components/pane/pane.css +57 -57
- package/components/pipeline-status/pipeline-status.css +65 -65
- package/components/popover/popover.css +17 -17
- package/components/progress/progress.css +23 -23
- package/components/progress-row/progress-row.css +17 -17
- package/components/radio/radio.css +39 -39
- package/components/range/range.css +55 -55
- package/components/rating/rating.css +28 -28
- package/components/richtext/richtext.css +133 -133
- package/components/row/row.css +19 -19
- package/components/search/search.css +5 -5
- package/components/segment/segment.css +24 -24
- package/components/segmented/segmented.css +25 -25
- package/components/select/select.css +84 -84
- package/components/skeleton/skeleton.css +14 -14
- package/components/slider/slider.css +46 -46
- package/components/spinner/class.js +69 -0
- package/components/spinner/spinner.a2ui.json +197 -0
- package/components/spinner/spinner.css +165 -0
- package/components/spinner/spinner.d.ts +26 -0
- package/components/spinner/spinner.examples.md +26 -0
- package/components/spinner/spinner.js +17 -0
- package/components/spinner/spinner.test.js +234 -0
- package/components/spinner/spinner.yaml +230 -0
- package/components/stack/stack.css +11 -11
- package/components/stat/stat.css +25 -25
- package/components/step-progress/step-progress.css +20 -20
- package/components/stepper/stepper.css +29 -29
- package/components/stream/stream.css +12 -12
- package/components/swatch/swatch.css +68 -68
- package/components/swiper/swiper.css +57 -57
- package/components/switch/switch.css +52 -52
- package/components/table/table.css +162 -162
- package/components/table-toolbar/table-toolbar.css +32 -32
- package/components/tabs/tabs.css +51 -51
- package/components/tag/tag.css +48 -48
- package/components/text/text.css +44 -44
- package/components/textarea/textarea.css +46 -46
- package/components/time-picker/class.js +693 -0
- package/components/time-picker/time-picker.a2ui.json +267 -0
- package/components/time-picker/time-picker.css +122 -0
- package/components/time-picker/time-picker.d.ts +75 -0
- package/components/time-picker/time-picker.examples.md +35 -0
- package/components/time-picker/time-picker.js +17 -0
- package/components/time-picker/time-picker.test.js +287 -0
- package/components/time-picker/time-picker.yaml +256 -0
- package/components/timeline/timeline.css +50 -50
- package/components/toast/toast.css +58 -58
- package/components/toggle-group/toggle-group.css +6 -6
- package/components/toggle-scheme/toggle-scheme.css +2 -2
- package/components/toolbar/toolbar.css +17 -17
- package/components/tooltip/tooltip.css +2 -2
- package/components/tree/tree.css +37 -37
- package/components/upload/upload.css +49 -49
- package/dist/web-components.min.css +1 -1
- package/dist/web-components.min.js +121 -83
- package/package.json +1 -1
- package/styles/components.css +8 -0
|
@@ -0,0 +1,363 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://adiaui.dev/a2ui/v0_9/components/Combobox.json",
|
|
4
|
+
"title": "Combobox",
|
|
5
|
+
"description": "Typeahead-filterable single-select primitive — the constrained-choice\ncombobox per WAI-APG \"Combobox With List Autocomplete (manual\nselection)\". The committed value MUST come from the options list\nunless `[free-text]` is set. Distinct from `<select-ui searchable>`\n(button-first dropdown) and `<autocomplete-input-ui>` (free-form).\nForm-bearing via UIFormElement: `[name]`, `[value]`, `[required]`,\n`[disabled]`, fires `change`. Options via native `<option>` /\n`<optgroup>` children OR programmatic `.options` array.\n",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"allOf": [
|
|
8
|
+
{
|
|
9
|
+
"$ref": "common_types.json#/$defs/ComponentCommon"
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"$ref": "common_types.json#/$defs/CatalogComponentCommon"
|
|
13
|
+
}
|
|
14
|
+
],
|
|
15
|
+
"properties": {
|
|
16
|
+
"required": {
|
|
17
|
+
"description": "Marks the field as required for form validation",
|
|
18
|
+
"type": "boolean",
|
|
19
|
+
"default": false
|
|
20
|
+
},
|
|
21
|
+
"clearable": {
|
|
22
|
+
"description": "Renders an `x` clear button when value is set",
|
|
23
|
+
"type": "boolean",
|
|
24
|
+
"default": false
|
|
25
|
+
},
|
|
26
|
+
"component": {
|
|
27
|
+
"const": "Combobox"
|
|
28
|
+
},
|
|
29
|
+
"creatable": {
|
|
30
|
+
"description": "Implies `[free-text]`; on Enter with unmatched typed text fires a\n`create` event with detail.value so the consumer can run a\nbackend create-then-refresh-options flow.",
|
|
31
|
+
"type": "boolean",
|
|
32
|
+
"default": false
|
|
33
|
+
},
|
|
34
|
+
"disabled": {
|
|
35
|
+
"description": "Disables interaction and dims the control",
|
|
36
|
+
"type": "boolean",
|
|
37
|
+
"default": false
|
|
38
|
+
},
|
|
39
|
+
"error": {
|
|
40
|
+
"description": "Validation error message",
|
|
41
|
+
"type": "string",
|
|
42
|
+
"default": ""
|
|
43
|
+
},
|
|
44
|
+
"filter-mode": {
|
|
45
|
+
"description": "Client-side filter algorithm.",
|
|
46
|
+
"type": "string",
|
|
47
|
+
"enum": [
|
|
48
|
+
"substring",
|
|
49
|
+
"prefix",
|
|
50
|
+
"fuzzy"
|
|
51
|
+
],
|
|
52
|
+
"default": "substring"
|
|
53
|
+
},
|
|
54
|
+
"free-text": {
|
|
55
|
+
"description": "Allow typed text not in the options list. Blurs the distinction\nwith <autocomplete-input-ui>; prefer the dedicated primitive\nunless the value model truly needs both modes (tag-with-suggestions,\nemail-with-recent-recipients).",
|
|
56
|
+
"type": "boolean",
|
|
57
|
+
"default": false
|
|
58
|
+
},
|
|
59
|
+
"highlight-match": {
|
|
60
|
+
"description": "Wraps the matched substring in `<mark>` inside option labels",
|
|
61
|
+
"type": "boolean",
|
|
62
|
+
"default": true
|
|
63
|
+
},
|
|
64
|
+
"hint": {
|
|
65
|
+
"description": "Caption text below the field; wires `aria-describedby` on the host\nso screen readers announce it as a description.",
|
|
66
|
+
"type": "string",
|
|
67
|
+
"default": ""
|
|
68
|
+
},
|
|
69
|
+
"label": {
|
|
70
|
+
"description": "Inline label rendered above the field. Wrap with <field-ui> for\nproper `<label for>` association in form-row compositions.",
|
|
71
|
+
"type": "string",
|
|
72
|
+
"default": ""
|
|
73
|
+
},
|
|
74
|
+
"loading": {
|
|
75
|
+
"description": "Shows a loading spinner inside the popover; consumer drives async fetch",
|
|
76
|
+
"type": "boolean",
|
|
77
|
+
"default": false
|
|
78
|
+
},
|
|
79
|
+
"max-options": {
|
|
80
|
+
"description": "Cap on rendered options. Overflow shows a \"scroll for more\" hint",
|
|
81
|
+
"type": "number",
|
|
82
|
+
"default": 100
|
|
83
|
+
},
|
|
84
|
+
"name": {
|
|
85
|
+
"description": "Form control name for form data submission",
|
|
86
|
+
"type": "string",
|
|
87
|
+
"default": ""
|
|
88
|
+
},
|
|
89
|
+
"open": {
|
|
90
|
+
"description": "Reflects popover open / closed state",
|
|
91
|
+
"type": "boolean",
|
|
92
|
+
"default": false
|
|
93
|
+
},
|
|
94
|
+
"options": {
|
|
95
|
+
"description": "Programmatic option list. Array of {value, label, disabled?, group?} or grouped {label, options:[…]}. Alternative to declarative <option> / <optgroup> children.",
|
|
96
|
+
"type": "array",
|
|
97
|
+
"default": []
|
|
98
|
+
},
|
|
99
|
+
"placeholder": {
|
|
100
|
+
"description": "Placeholder text in the input when value is empty",
|
|
101
|
+
"type": "string",
|
|
102
|
+
"default": "Select..."
|
|
103
|
+
},
|
|
104
|
+
"readonly": {
|
|
105
|
+
"description": "Prevents selection changes while keeping the field focusable + popover-open allowed",
|
|
106
|
+
"type": "boolean",
|
|
107
|
+
"default": false
|
|
108
|
+
},
|
|
109
|
+
"size": {
|
|
110
|
+
"description": "Sizing scale via universal `[size]` attribute system. Matches Input + Select sizing tokens so a Combobox rendered alongside either feels coherent in a form row.",
|
|
111
|
+
"type": "string",
|
|
112
|
+
"enum": [
|
|
113
|
+
"sm",
|
|
114
|
+
"md",
|
|
115
|
+
"lg"
|
|
116
|
+
],
|
|
117
|
+
"default": "md"
|
|
118
|
+
},
|
|
119
|
+
"value": {
|
|
120
|
+
"description": "Currently selected option value. Must be a member of `options[].value` unless `[free-text]` is set. With declarative <option> children, a child carrying the native `selected` attribute sets the initial value when this attribute is absent.",
|
|
121
|
+
"type": "string",
|
|
122
|
+
"default": ""
|
|
123
|
+
}
|
|
124
|
+
},
|
|
125
|
+
"required": [
|
|
126
|
+
"component"
|
|
127
|
+
],
|
|
128
|
+
"unevaluatedProperties": false,
|
|
129
|
+
"x-adiaui": {
|
|
130
|
+
"anti_patterns": [
|
|
131
|
+
{
|
|
132
|
+
"fix": "{\"component\": \"Combobox\", \"value\": \"us\", \"options\": [{\"value\": \"us\", \"label\": \"United States\"}]}\n",
|
|
133
|
+
"why": "`value` is \"xx\" but only \"us\" is in options. With free-text:false (default), this is an invalid\nmid-state — set value: \"us\" or add an option with value: \"xx\".\n",
|
|
134
|
+
"wrong": "{\"component\": \"Combobox\", \"value\": \"xx\", \"options\": [{\"value\": \"us\", \"label\": \"United States\"}]}\n"
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
"fix": "{\"component\": \"SegmentedControl\", \"options\": [{\"value\": \"a\", \"label\": \"A\"}, {\"value\": \"b\", \"label\": \"B\"}]}\n",
|
|
138
|
+
"why": "Only 2 options. Combobox is overkill — use SegmentedControl or Radio.\n",
|
|
139
|
+
"wrong": "{\"component\": \"Combobox\", \"options\": [{\"value\": \"a\", \"label\": \"A\"}, {\"value\": \"b\", \"label\": \"B\"}]}\n"
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
"fix": "{\"component\": \"MultiSelect\", \"options\": [...]}\n",
|
|
143
|
+
"why": "Combobox is single-select. Multi-select goes through MultiSelect.\n",
|
|
144
|
+
"wrong": "{\"component\": \"Combobox\", \"multiple\": true, \"options\": [...]}\n"
|
|
145
|
+
}
|
|
146
|
+
],
|
|
147
|
+
"category": "input",
|
|
148
|
+
"composes": [
|
|
149
|
+
"icon-ui"
|
|
150
|
+
],
|
|
151
|
+
"events": {
|
|
152
|
+
"change": {
|
|
153
|
+
"description": "Fired when value is committed — option clicked, Enter on active\noption, or programmatic `.value =`. Detail.option resolves to the\nmatching `{label,value,...}` or null in free-text/cleared paths.",
|
|
154
|
+
"detail": {
|
|
155
|
+
"option": {
|
|
156
|
+
"description": "Resolved option object or null when free-text / cleared.",
|
|
157
|
+
"type": "object"
|
|
158
|
+
},
|
|
159
|
+
"source": {
|
|
160
|
+
"description": "One of `click` / `keyboard` / `programmatic`.",
|
|
161
|
+
"type": "string"
|
|
162
|
+
},
|
|
163
|
+
"value": {
|
|
164
|
+
"description": "Committed value.",
|
|
165
|
+
"type": "string"
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
},
|
|
169
|
+
"close": {
|
|
170
|
+
"description": "Popover closed.",
|
|
171
|
+
"detail": {
|
|
172
|
+
"reason": {
|
|
173
|
+
"description": "One of `escape` / `outside` / `select` / `blur`.",
|
|
174
|
+
"type": "string"
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
},
|
|
178
|
+
"create": {
|
|
179
|
+
"description": "Fired when `[creatable]` is set and the user presses Enter on\ntyped text that doesn't match any option. Consumer wires this to\na backend create flow and then refreshes `.options`.",
|
|
180
|
+
"detail": {
|
|
181
|
+
"value": {
|
|
182
|
+
"description": "The typed text the user is trying to create.",
|
|
183
|
+
"type": "string"
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
},
|
|
187
|
+
"input": {
|
|
188
|
+
"description": "Fired on each keystroke (filter typing); not a commit. Detail carries the typed query.",
|
|
189
|
+
"detail": {
|
|
190
|
+
"query": {
|
|
191
|
+
"description": "Lowercased filter query.",
|
|
192
|
+
"type": "string"
|
|
193
|
+
},
|
|
194
|
+
"value": {
|
|
195
|
+
"description": "Current input text (the user's typed query).",
|
|
196
|
+
"type": "string"
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
},
|
|
200
|
+
"invalid": {
|
|
201
|
+
"description": "Fired when `[free-text]` is false and the user presses Enter on\ntyped text that doesn't match any option. The value is NOT\ncommitted; the input is restored to the last committed value.",
|
|
202
|
+
"detail": {
|
|
203
|
+
"query": {
|
|
204
|
+
"description": "The unmatched typed text.",
|
|
205
|
+
"type": "string"
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
},
|
|
209
|
+
"open": {
|
|
210
|
+
"description": "Popover opened.",
|
|
211
|
+
"detail": {
|
|
212
|
+
"trigger": {
|
|
213
|
+
"description": "One of `click` / `keyboard` / `typing`.",
|
|
214
|
+
"type": "string"
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
},
|
|
219
|
+
"examples": [
|
|
220
|
+
{
|
|
221
|
+
"description": "Country picker — canonical declarative <option> children inside a <field-ui>.",
|
|
222
|
+
"a2ui": "[\n {\"id\": \"root\", \"component\": \"Card\", \"children\": [\"sec\"]},\n {\"id\": \"sec\", \"component\": \"Section\", \"children\": [\"country\"]},\n {\n \"id\": \"country\",\n \"component\": \"Combobox\",\n \"name\": \"country\",\n \"label\": \"Country\",\n \"placeholder\": \"Select country…\",\n \"options\": [\n {\"value\": \"us\", \"label\": \"United States\"},\n {\"value\": \"gb\", \"label\": \"United Kingdom\"},\n {\"value\": \"de\", \"label\": \"Germany\"},\n {\"value\": \"fr\", \"label\": \"France\"},\n {\"value\": \"es\", \"label\": \"Spain\"}\n ],\n \"value\": \"us\"\n }\n]",
|
|
223
|
+
"name": "country-picker"
|
|
224
|
+
},
|
|
225
|
+
{
|
|
226
|
+
"description": "Tag picker with create-new affordance — fires `create` event on unmatched Enter.",
|
|
227
|
+
"a2ui": "[\n {\"id\": \"root\", \"component\": \"Card\", \"children\": [\"sec\"]},\n {\"id\": \"sec\", \"component\": \"Section\", \"children\": [\"tag\"]},\n {\n \"id\": \"tag\",\n \"component\": \"Combobox\",\n \"name\": \"tag\",\n \"label\": \"Tag\",\n \"creatable\": true,\n \"placeholder\": \"Pick or create a tag…\",\n \"options\": [\n {\"value\": \"bug\", \"label\": \"bug\"},\n {\"value\": \"feature\", \"label\": \"feature\"},\n {\"value\": \"chore\", \"label\": \"chore\"}\n ]\n }\n]",
|
|
228
|
+
"name": "creatable-tag-picker"
|
|
229
|
+
}
|
|
230
|
+
],
|
|
231
|
+
"keywords": [
|
|
232
|
+
"combobox",
|
|
233
|
+
"autocomplete",
|
|
234
|
+
"typeahead",
|
|
235
|
+
"select",
|
|
236
|
+
"filter",
|
|
237
|
+
"picker",
|
|
238
|
+
"country-picker",
|
|
239
|
+
"timezone-picker",
|
|
240
|
+
"member-picker"
|
|
241
|
+
],
|
|
242
|
+
"name": "UICombobox",
|
|
243
|
+
"related": [
|
|
244
|
+
"select",
|
|
245
|
+
"search",
|
|
246
|
+
"input",
|
|
247
|
+
"field"
|
|
248
|
+
],
|
|
249
|
+
"slots": {
|
|
250
|
+
"default": {
|
|
251
|
+
"description": "Native <option> / <optgroup> children for declarative authoring"
|
|
252
|
+
},
|
|
253
|
+
"empty": {
|
|
254
|
+
"description": "Custom no-matches content (defaults to \"No matches\")"
|
|
255
|
+
},
|
|
256
|
+
"footer": {
|
|
257
|
+
"description": "Footer area inside the popover (e.g. \"Press Enter to create…\" affordance)"
|
|
258
|
+
},
|
|
259
|
+
"loading": {
|
|
260
|
+
"description": "Custom loading content (defaults to a spinner)"
|
|
261
|
+
},
|
|
262
|
+
"prefix": {
|
|
263
|
+
"description": "Leading icon / element inside the input chrome"
|
|
264
|
+
},
|
|
265
|
+
"suffix": {
|
|
266
|
+
"description": "Trailing icon / element (defaults to `caret-down`)"
|
|
267
|
+
}
|
|
268
|
+
},
|
|
269
|
+
"states": [
|
|
270
|
+
{
|
|
271
|
+
"description": "Closed; not focused.",
|
|
272
|
+
"name": "idle"
|
|
273
|
+
},
|
|
274
|
+
{
|
|
275
|
+
"description": "Input focused; popover closed.",
|
|
276
|
+
"attribute": ":focus-within",
|
|
277
|
+
"name": "focused"
|
|
278
|
+
},
|
|
279
|
+
{
|
|
280
|
+
"description": "Popover visible; filtered options listed.",
|
|
281
|
+
"attribute": "open",
|
|
282
|
+
"name": "open"
|
|
283
|
+
},
|
|
284
|
+
{
|
|
285
|
+
"description": "Spinner shown; options stale (consumer-driven async fetch).",
|
|
286
|
+
"attribute": "loading",
|
|
287
|
+
"name": "loading"
|
|
288
|
+
},
|
|
289
|
+
{
|
|
290
|
+
"description": "Non-interactive; dimmed.",
|
|
291
|
+
"attribute": "disabled",
|
|
292
|
+
"name": "disabled"
|
|
293
|
+
},
|
|
294
|
+
{
|
|
295
|
+
"description": "Focusable + popover-open allowed; commits blocked.",
|
|
296
|
+
"attribute": "readonly",
|
|
297
|
+
"name": "readonly"
|
|
298
|
+
}
|
|
299
|
+
],
|
|
300
|
+
"status": "stable",
|
|
301
|
+
"synonyms": {
|
|
302
|
+
"autocomplete": [
|
|
303
|
+
"combobox",
|
|
304
|
+
"typeahead",
|
|
305
|
+
"suggest"
|
|
306
|
+
],
|
|
307
|
+
"combobox": [
|
|
308
|
+
"autocomplete",
|
|
309
|
+
"typeahead",
|
|
310
|
+
"filter",
|
|
311
|
+
"picker"
|
|
312
|
+
],
|
|
313
|
+
"picker": [
|
|
314
|
+
"combobox",
|
|
315
|
+
"select",
|
|
316
|
+
"dropdown"
|
|
317
|
+
],
|
|
318
|
+
"typeahead": [
|
|
319
|
+
"combobox",
|
|
320
|
+
"autocomplete",
|
|
321
|
+
"search"
|
|
322
|
+
]
|
|
323
|
+
},
|
|
324
|
+
"tag": "combobox-ui",
|
|
325
|
+
"tokens": {
|
|
326
|
+
"--combobox-bg": {
|
|
327
|
+
"description": "Input background color"
|
|
328
|
+
},
|
|
329
|
+
"--combobox-fg": {
|
|
330
|
+
"description": "Input text color"
|
|
331
|
+
},
|
|
332
|
+
"--combobox-match-bg": {
|
|
333
|
+
"description": "Background for `<mark>` spans that highlight matched substrings"
|
|
334
|
+
},
|
|
335
|
+
"--combobox-option-bg-active": {
|
|
336
|
+
"description": "Background for the currently active (arrow-navigated) option"
|
|
337
|
+
},
|
|
338
|
+
"--combobox-option-bg-selected": {
|
|
339
|
+
"description": "Background for the currently committed option"
|
|
340
|
+
},
|
|
341
|
+
"--combobox-option-fg-active": {
|
|
342
|
+
"description": "Foreground for the currently active option"
|
|
343
|
+
},
|
|
344
|
+
"--combobox-popover-bg": {
|
|
345
|
+
"description": "Popover background color"
|
|
346
|
+
},
|
|
347
|
+
"--combobox-popover-border": {
|
|
348
|
+
"description": "Popover border color"
|
|
349
|
+
},
|
|
350
|
+
"--combobox-popover-radius": {
|
|
351
|
+
"description": "Popover border radius"
|
|
352
|
+
},
|
|
353
|
+
"--combobox-popover-shadow": {
|
|
354
|
+
"description": "Popover elevation shadow"
|
|
355
|
+
},
|
|
356
|
+
"--combobox-radius": {
|
|
357
|
+
"description": "Input border radius"
|
|
358
|
+
}
|
|
359
|
+
},
|
|
360
|
+
"traits": [],
|
|
361
|
+
"version": 1
|
|
362
|
+
}
|
|
363
|
+
}
|
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
@scope (combobox-ui) {
|
|
2
|
+
:where(:scope) {
|
|
3
|
+
/* ── Layout ── */
|
|
4
|
+
--combobox-gap-default: var(--a-space-2);
|
|
5
|
+
--combobox-field-gap-default: var(--a-space-1);
|
|
6
|
+
--combobox-height-default: var(--a-size);
|
|
7
|
+
--combobox-px-default: var(--a-ui-px);
|
|
8
|
+
--combobox-radius-default: var(--a-radius);
|
|
9
|
+
|
|
10
|
+
/* ── Typography ── */
|
|
11
|
+
--combobox-font-size-default: var(--a-ui-size);
|
|
12
|
+
--combobox-label-size-default: var(--a-label-size);
|
|
13
|
+
|
|
14
|
+
/* ── Colors — field ── */
|
|
15
|
+
--combobox-bg-default: var(--a-ui-bg);
|
|
16
|
+
--combobox-bg-hover-default: var(--a-ui-bg-hover);
|
|
17
|
+
--combobox-border-default: var(--a-ui-border);
|
|
18
|
+
--combobox-border-hover-default: var(--a-ui-border-hover);
|
|
19
|
+
--combobox-focus-ring-default: var(--a-focus-ring);
|
|
20
|
+
--combobox-focus-ring-invalid-default: var(--a-focus-ring-invalid);
|
|
21
|
+
--combobox-fg-default: var(--a-ui-text);
|
|
22
|
+
--combobox-fg-muted-default: var(--a-ui-text-muted);
|
|
23
|
+
--combobox-fg-subtle-default: var(--a-ui-text-subtle);
|
|
24
|
+
--combobox-fg-disabled-default: var(--a-ui-text-disabled);
|
|
25
|
+
--combobox-label-fg-default: var(--a-ui-text-muted);
|
|
26
|
+
--combobox-placeholder-fg-default: var(--a-ui-text-placeholder);
|
|
27
|
+
--combobox-caret-fg-default: var(--a-ui-text-muted);
|
|
28
|
+
|
|
29
|
+
/* ── Transition ── */
|
|
30
|
+
--combobox-duration-default: var(--a-duration-fast);
|
|
31
|
+
--combobox-easing-default: var(--a-easing);
|
|
32
|
+
|
|
33
|
+
/* ── Popover ── */
|
|
34
|
+
--combobox-popover-bg-default: var(--a-canvas-bright);
|
|
35
|
+
--combobox-popover-border-default: var(--a-ui-border);
|
|
36
|
+
--combobox-popover-radius-default: var(--a-radius);
|
|
37
|
+
--combobox-popover-shadow-default: var(--a-shadow-lg);
|
|
38
|
+
|
|
39
|
+
/* ── Options ── */
|
|
40
|
+
--combobox-option-px-default: var(--a-ui-px);
|
|
41
|
+
--combobox-option-py-default: var(--a-space-1);
|
|
42
|
+
--combobox-option-bg-active-default: var(--a-ui-bg-hover);
|
|
43
|
+
--combobox-option-fg-active-default: var(--a-ui-text-hover);
|
|
44
|
+
--combobox-option-bg-selected-default: var(--a-ui-bg-selected);
|
|
45
|
+
--combobox-option-fg-selected-default: var(--a-ui-text-selected);
|
|
46
|
+
|
|
47
|
+
/* ── Match highlight ── */
|
|
48
|
+
--combobox-match-bg-default: var(--a-accent-muted);
|
|
49
|
+
--combobox-match-fg-default: var(--a-accent-strong);
|
|
50
|
+
|
|
51
|
+
text-align: start; /* §text-align-reset — block ancestor centering */
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
:scope {
|
|
55
|
+
/* ── Base ── */
|
|
56
|
+
box-sizing: border-box;
|
|
57
|
+
display: flex;
|
|
58
|
+
flex-direction: column;
|
|
59
|
+
gap: var(--combobox-gap, var(--combobox-gap-default));
|
|
60
|
+
position: relative;
|
|
61
|
+
min-width: 0;
|
|
62
|
+
font-size: var(--combobox-font-size, var(--combobox-font-size-default));
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
:scope[disabled] {
|
|
66
|
+
pointer-events: none;
|
|
67
|
+
color: var(--combobox-fg-disabled, var(--combobox-fg-disabled-default));
|
|
68
|
+
opacity: 0.6;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/* ── Label ── */
|
|
72
|
+
[data-label] {
|
|
73
|
+
display: block;
|
|
74
|
+
font-size: var(--combobox-label-size, var(--combobox-label-size-default));
|
|
75
|
+
color: var(--combobox-label-fg, var(--combobox-label-fg-default));
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/* ── Field ── */
|
|
79
|
+
[data-field] {
|
|
80
|
+
display: flex;
|
|
81
|
+
align-items: center;
|
|
82
|
+
gap: var(--combobox-field-gap, var(--combobox-field-gap-default));
|
|
83
|
+
min-height: var(--combobox-height, var(--combobox-height-default));
|
|
84
|
+
padding: 0 var(--combobox-px, var(--combobox-px-default));
|
|
85
|
+
border: 1px solid var(--combobox-border, var(--combobox-border-default));
|
|
86
|
+
border-radius: var(--combobox-radius, var(--combobox-radius-default));
|
|
87
|
+
background: var(--combobox-bg, var(--combobox-bg-default));
|
|
88
|
+
color: var(--combobox-fg, var(--combobox-fg-default));
|
|
89
|
+
transition:
|
|
90
|
+
background var(--combobox-duration, var(--combobox-duration-default)) var(--combobox-easing, var(--combobox-easing-default)),
|
|
91
|
+
border-color var(--combobox-duration, var(--combobox-duration-default)) var(--combobox-easing, var(--combobox-easing-default)),
|
|
92
|
+
color var(--combobox-duration, var(--combobox-duration-default)) var(--combobox-easing, var(--combobox-easing-default)),
|
|
93
|
+
box-shadow var(--combobox-duration, var(--combobox-duration-default)) var(--combobox-easing, var(--combobox-easing-default));
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
:scope:not([disabled]) [data-field]:hover {
|
|
97
|
+
background: var(--combobox-bg-hover, var(--combobox-bg-hover-default));
|
|
98
|
+
border-color: var(--combobox-border-hover, var(--combobox-border-hover-default));
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
:scope:focus-within [data-field] {
|
|
102
|
+
box-shadow: var(--combobox-focus-ring, var(--combobox-focus-ring-default));
|
|
103
|
+
}
|
|
104
|
+
:scope[aria-invalid="true"]:focus-within [data-field],
|
|
105
|
+
:scope[error]:focus-within [data-field] {
|
|
106
|
+
box-shadow: var(--combobox-focus-ring-invalid, var(--combobox-focus-ring-invalid-default));
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
[data-prefix],
|
|
110
|
+
[data-suffix] {
|
|
111
|
+
display: inline-flex;
|
|
112
|
+
align-items: center;
|
|
113
|
+
flex-shrink: 0;
|
|
114
|
+
color: var(--combobox-caret-fg, var(--combobox-caret-fg-default));
|
|
115
|
+
--a-icon-size: var(--combobox-font-size, var(--combobox-font-size-default));
|
|
116
|
+
}
|
|
117
|
+
[data-prefix]:empty { display: none; }
|
|
118
|
+
[data-suffix] {
|
|
119
|
+
cursor: pointer;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
[data-input] {
|
|
123
|
+
flex: 1;
|
|
124
|
+
min-width: 0;
|
|
125
|
+
outline: none;
|
|
126
|
+
background: transparent;
|
|
127
|
+
color: var(--combobox-fg, var(--combobox-fg-default));
|
|
128
|
+
font: inherit;
|
|
129
|
+
font-size: var(--combobox-font-size, var(--combobox-font-size-default));
|
|
130
|
+
line-height: 1.4;
|
|
131
|
+
white-space: nowrap;
|
|
132
|
+
overflow: hidden;
|
|
133
|
+
}
|
|
134
|
+
[data-input][data-empty]::before {
|
|
135
|
+
content: attr(data-placeholder);
|
|
136
|
+
color: var(--combobox-placeholder-fg, var(--combobox-placeholder-fg-default));
|
|
137
|
+
pointer-events: none;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
[data-clear] {
|
|
141
|
+
display: inline-flex;
|
|
142
|
+
align-items: center;
|
|
143
|
+
justify-content: center;
|
|
144
|
+
padding: 0;
|
|
145
|
+
margin: 0;
|
|
146
|
+
border: 0;
|
|
147
|
+
background: transparent;
|
|
148
|
+
color: var(--combobox-fg-muted, var(--combobox-fg-muted-default));
|
|
149
|
+
cursor: pointer;
|
|
150
|
+
--a-icon-size: var(--combobox-font-size, var(--combobox-font-size-default));
|
|
151
|
+
}
|
|
152
|
+
[data-clear]:hover {
|
|
153
|
+
color: var(--combobox-fg, var(--combobox-fg-default));
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
/* ── Top-layer popover: cannot inherit @scope component tokens ── */
|
|
158
|
+
|
|
159
|
+
combobox-ui [data-listbox] {
|
|
160
|
+
margin: 0;
|
|
161
|
+
padding: var(--a-space-1);
|
|
162
|
+
border: 1px solid var(--a-ui-border);
|
|
163
|
+
border-radius: var(--a-radius);
|
|
164
|
+
background: var(--a-canvas-bright);
|
|
165
|
+
box-shadow: var(--a-shadow-lg);
|
|
166
|
+
max-height: 18rem;
|
|
167
|
+
overflow-y: auto;
|
|
168
|
+
font-family: inherit;
|
|
169
|
+
font-size: var(--a-ui-size);
|
|
170
|
+
color: var(--a-ui-text);
|
|
171
|
+
width: max-content;
|
|
172
|
+
|
|
173
|
+
opacity: 1;
|
|
174
|
+
translate: 0 0;
|
|
175
|
+
transition: opacity var(--a-duration-fast) var(--a-easing-out),
|
|
176
|
+
translate var(--a-duration-fast) var(--a-easing-out);
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
combobox-ui [data-listbox]:popover-open {
|
|
180
|
+
@starting-style {
|
|
181
|
+
opacity: 0;
|
|
182
|
+
translate: 0 -4px;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
@media (prefers-reduced-motion: reduce) {
|
|
187
|
+
combobox-ui [data-listbox] { transition: none; }
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
combobox-ui [data-listbox] [role="option"] {
|
|
191
|
+
display: flex;
|
|
192
|
+
align-items: center;
|
|
193
|
+
padding: var(--a-space-1) var(--a-ui-px);
|
|
194
|
+
border-radius: var(--a-radius-sm);
|
|
195
|
+
white-space: nowrap;
|
|
196
|
+
color: var(--a-ui-text-subtle);
|
|
197
|
+
cursor: pointer;
|
|
198
|
+
transition:
|
|
199
|
+
background var(--a-duration-fast) var(--a-easing),
|
|
200
|
+
color var(--a-duration-fast) var(--a-easing);
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
combobox-ui [data-listbox] [role="option"][data-active] {
|
|
204
|
+
background: var(--a-ui-bg-hover);
|
|
205
|
+
color: var(--a-ui-text-hover);
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
combobox-ui [data-listbox] [role="option"][aria-selected="true"] {
|
|
209
|
+
background: var(--a-ui-bg-selected);
|
|
210
|
+
color: var(--a-ui-text-selected);
|
|
211
|
+
font-weight: var(--a-ui-weight);
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
combobox-ui [data-listbox] [role="option"][aria-disabled="true"] {
|
|
215
|
+
color: var(--a-ui-text-disabled);
|
|
216
|
+
cursor: not-allowed;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
combobox-ui [data-listbox] [role="option"] mark {
|
|
220
|
+
background: var(--a-accent-muted);
|
|
221
|
+
color: var(--a-accent-strong);
|
|
222
|
+
padding: 0 0.1em;
|
|
223
|
+
border-radius: var(--a-radius-sm);
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
combobox-ui [data-listbox] [role="group"] [data-group-label] {
|
|
227
|
+
padding: var(--a-space-1) var(--a-ui-px);
|
|
228
|
+
font-size: var(--a-ui-tiny);
|
|
229
|
+
font-weight: var(--a-ui-weight);
|
|
230
|
+
color: var(--a-ui-text-muted);
|
|
231
|
+
text-transform: uppercase;
|
|
232
|
+
letter-spacing: 0.05em;
|
|
233
|
+
white-space: nowrap;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
combobox-ui [data-empty],
|
|
237
|
+
combobox-ui [data-loading],
|
|
238
|
+
combobox-ui [data-footer] {
|
|
239
|
+
padding: var(--a-space-2) var(--a-ui-px);
|
|
240
|
+
color: var(--a-ui-text-muted);
|
|
241
|
+
font-size: var(--a-ui-size);
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
combobox-ui [data-footer]:empty { display: none; }
|