@khanacademy/wonder-blocks-dropdown 11.0.3 → 12.0.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/dist/index.css ADDED
@@ -0,0 +1,917 @@
1
+ @layer shared {/**
2
+ * ActionItem styles
3
+ *
4
+ * Every rule is nested inside `.root` — the marker class ActionItem adds to
5
+ * the `DetailCell` root, which carries no declarations of its own. The root is
6
+ * a `Cell` and the label a `BodyText`; both ship rules in the same
7
+ * `@layer shared`, and this component overrides properties they set
8
+ * (`min-block-size`, padding, `border-radius`, the focus ring and the
9
+ * horizontal rule's `::after` on the cell; `font-weight` and `line-height` on
10
+ * the label). The published bundle loads this stylesheet *before* those
11
+ * packages', so at equal specificity they would win; the compound selector
12
+ * makes the outcome depend on specificity instead.
13
+ *
14
+ * The Aphrodite version was unlayered `!important`, so it beat every Cell
15
+ * state rule. Cell's most specific `border-radius` rule is
16
+ * `.clickable:focus-visible:active` (0,3,0), so the focus rule also lists
17
+ * `:focus:active` (0,4,0) to keep its radius while pressed.
18
+ *
19
+ * Rules are declared in composition order: actionItem → shared → indent.
20
+ *
21
+ * Nesting is native CSS: every `&` is explicit and resolves to the flat
22
+ * selector it replaces. The build wraps every rule in `@layer shared { … }`.
23
+ */.wb-action-item-root-4beca087 {
24
+ &.wb-action-item-actionItem-4beca087 {
25
+ /* The dropdown item height (`DROPDOWN_ITEM_HEIGHT` in JS). */
26
+ min-block-size: var(--wb-c-dropdown-item-sizing-height);
27
+
28
+ /* This removes the 300ms click delay on mobile browsers by indicating
29
+ * that "double-tap to zoom" shouldn't be used on this element. */
30
+ touch-action: manipulation;
31
+ }
32
+
33
+ /* Override the default focus state for the cell element, so that it can
34
+ * be added programmatically to the button element. */
35
+ &.wb-action-item-actionItem-4beca087:focus,
36
+ &.wb-action-item-actionItem-4beca087:focus:active {
37
+ border-radius: var(--wb-c-dropdown-item-border-radius-default);
38
+ outline: var(--wb-border-width-medium) solid
39
+ var(--wb-semanticColor-focus-outer);
40
+ outline-offset: calc(var(--wb-border-width-medium) * -1);
41
+
42
+ /* We need to use a thicker box-shadow to ensure that the inner ring
43
+ * is visible when the cell is focused. */
44
+ box-shadow: inset 0 0 0 calc(var(--wb-border-width-medium) * 2)
45
+ var(--wb-semanticColor-focus-inner);
46
+ }
47
+
48
+ /* Hide the left bar indicator when focused, so the focus ring doesn't
49
+ * overlap with it.
50
+ * @see cell-core.module.css */
51
+ &.wb-action-item-actionItem-4beca087:focus::after {
52
+ content: unset;
53
+ }
54
+
55
+ &.wb-action-item-shared-4beca087 {
56
+ min-block-size: var(--wb-c-dropdown-item-sizing-height);
57
+
58
+ /* Make sure that the item is always at least as tall as 40px. */
59
+ padding-block: var(--wb-c-dropdown-item-layout-padding-block);
60
+ }
61
+
62
+ &.wb-action-item-indent-4beca087 {
63
+ /* Cell's internal padding + checkbox width + checkbox margin */
64
+ padding-inline-start: var(--wb-sizing-size_320);
65
+ }
66
+
67
+ & .wb-action-item-label-4beca087 {
68
+ font-weight: var(--wb-c-dropdown-item-font-weight);
69
+ line-height: var(--wb-sizing-size_200);
70
+ white-space: nowrap;
71
+
72
+ /* Safari only honours the prefixed form, and the CSS pipeline has no
73
+ * autoprefixer (Aphrodite used to add it). */
74
+ /* stylelint-disable-next-line property-no-vendor-prefix -- Safari needs it */
75
+ -webkit-user-select: none;
76
+ user-select: none;
77
+ overflow: hidden;
78
+ text-overflow: ellipsis;
79
+ }
80
+ }
81
+ }
82
+
83
+ @layer shared {/**
84
+ * Check styles (the selection indicator `OptionItem` uses for single
85
+ * selection).
86
+ *
87
+ * The check is a `PhosphorIcon`, whose size class (same `@layer shared`) sets
88
+ * `block-size`. The published bundle loads this stylesheet *before* the icon
89
+ * package's, so the rules are qualified with the `.root` marker class
90
+ * (applied to the same element) to win on specificity rather than load
91
+ * order.
92
+ *
93
+ * Nesting is native CSS: every `&` is explicit and resolves to the flat
94
+ * selector it replaces. The build wraps every rule in `@layer shared { … }`.
95
+ */.wb-check-root-eeb4a0c6 {
96
+ &.wb-check-check-eeb4a0c6 {
97
+ align-self: center;
98
+ block-size: var(--wb-sizing-size_160);
99
+
100
+ /* Semantically, this are the constants for a small-sized icon */
101
+ min-block-size: var(--wb-sizing-size_160);
102
+ min-inline-size: var(--wb-sizing-size_160);
103
+ }
104
+
105
+ &.wb-check-hidden-eeb4a0c6 {
106
+ visibility: hidden;
107
+ }
108
+ }
109
+ }
110
+
111
+ @layer shared {/**
112
+ * Checkbox styles (the selection indicator `OptionItem` uses for multiple
113
+ * selection).
114
+ *
115
+ * Every rule is nested inside `.root` — the marker class on the checkbox
116
+ * `View`, which carries no declarations of its own. The box is a `View`
117
+ * (whose `.default` class resets `border`) and the check inside it a
118
+ * `PhosphorIcon`; both ship rules in the same `@layer shared`. The published
119
+ * bundle loads this stylesheet *before* those packages', so the compound
120
+ * selectors make the outcome depend on specificity instead.
121
+ *
122
+ * Rules are declared in composition order: checkbox → selected → disabled.
123
+ *
124
+ * Nesting is native CSS: every `&` is explicit and resolves to the flat
125
+ * selector it replaces. The build wraps every rule in `@layer shared { … }`.
126
+ */.wb-checkbox-root-7b154847 {
127
+ &.wb-checkbox-checkbox-7b154847 {
128
+ align-self: center;
129
+
130
+ /* Semantically, this are the constants for a small-sized icon */
131
+ min-block-size: var(--wb-sizing-size_160);
132
+ min-inline-size: var(--wb-sizing-size_160);
133
+ block-size: var(--wb-sizing-size_160);
134
+ background: var(--wb-semanticColor-input-default-background);
135
+
136
+ /* TODO(WB-1864): Use the correct token once TB is updated. */
137
+ /* stylelint-disable-next-line scale-unlimited/declaration-strict-value -- no 3px radius token yet; see the TODO above */
138
+ border-radius: 3px;
139
+ border-width: var(--wb-border-width-thin);
140
+ border-style: solid;
141
+ border-color: var(--wb-semanticColor-input-default-border);
142
+ }
143
+
144
+ &.wb-checkbox-selected-7b154847 {
145
+ border-width: 0;
146
+ background: var(--wb-semanticColor-input-checked-background);
147
+ color: var(--wb-semanticColor-input-checked-foreground);
148
+ }
149
+
150
+ &.wb-checkbox-disabled-7b154847 {
151
+ border-color: var(--wb-semanticColor-input-disabled-border);
152
+ background-color: var(--wb-semanticColor-input-disabled-background);
153
+ }
154
+
155
+ /* The border of 1px on the selected, disabled checkbox pushes the check
156
+ * out of place. Move it back. */
157
+ & .wb-checkbox-checkDisabled-7b154847 {
158
+ position: absolute;
159
+ inset-block-start: -1px;
160
+ inset-inline-start: -1px;
161
+ }
162
+ }
163
+ }
164
+
165
+ @layer shared {/**
166
+ * OptionItem styles. Its `Check` and `Checkbox` indicators have their own
167
+ * modules (`check.module.css`, `checkbox.module.css`).
168
+ *
169
+ * Every rule is nested inside `.root` — the marker class OptionItem adds to
170
+ * the `DetailCell` root, which carries no declarations of its own. The root is
171
+ * a `Cell` (`.wrapper`, `.detail`, `.clickable`, `.disabled`) and the label is
172
+ * a `BodyText`. Both ship rules in the same `@layer shared`, and this
173
+ * component overrides properties they set (padding, `min-block-size`,
174
+ * `border-radius` and the focus ring on the cell; `font-weight` and
175
+ * `line-height` on the label). The published
176
+ * bundle loads this stylesheet *before* those packages', so at equal
177
+ * specificity they would win; the compound selector makes the outcome depend
178
+ * on specificity instead.
179
+ *
180
+ * The Aphrodite version was unlayered `!important`, so it beat every Cell
181
+ * state rule. Cell's most specific `border-radius` rule is
182
+ * `.clickable:focus-visible:active` (0,3,0), so each state rule that sets
183
+ * `border-radius` also lists its `:focus-visible:active` / `:focus:active`
184
+ * combination (0,4,0) to keep winning in that state.
185
+ *
186
+ * Between the rules in this file, source order reproduces the Aphrodite
187
+ * merge order:
188
+ *
189
+ * optionItem → (press) → listbox / select variants → disabled focus reset
190
+ *
191
+ * Nesting is native CSS: every `&` is explicit and resolves to the flat
192
+ * selector it replaces. The build wraps every rule in `@layer shared { … }`.
193
+ */.wb-option-item-root-e4b75fee {
194
+ &.wb-option-item-optionItem-e4b75fee {
195
+ padding-block: var(--wb-c-dropdown-item-layout-padding-block);
196
+ padding-inline: var(--wb-c-dropdown-item-layout-padding-inlineStart)
197
+ var(--wb-c-dropdown-item-layout-padding-inlineEnd);
198
+ white-space: nowrap;
199
+
200
+ /* Make sure that the item is always at least as tall as 40px. */
201
+ min-block-size: var(--wb-sizing-size_400);
202
+ }
203
+
204
+ &.wb-option-item-optionItem-e4b75fee:active,
205
+ &.wb-option-item-optionItem-e4b75fee:focus-visible:active {
206
+ border-radius: var(--wb-c-dropdown-item-border-radius-press);
207
+ }
208
+
209
+ /**
210
+ * Specific styles for Listbox and Combobox.
211
+ */
212
+
213
+ /* This does not apply here as we use visual focus (instead of real DOM
214
+ * focus).
215
+ * @see https://www.w3.org/WAI/ARIA/apg/practices/keyboard-interface/#kbd_focus_activedescendant */
216
+ &.wb-option-item-listboxOptionItem-e4b75fee:focus-visible {
217
+ outline: none;
218
+ box-shadow: none;
219
+ }
220
+
221
+ /* Override the default focus state for the cell element, so that it can
222
+ * be added programmatically to the button element. Declared after the
223
+ * reset above, which it overrides at equal specificity. The plain
224
+ * `.listboxOptionItemFocused` selector (0,2,0) still loses to the press
225
+ * rule above, so a pressed item gets the press radius unless it is also
226
+ * focus-visible. */
227
+ &.wb-option-item-listboxOptionItemFocused-e4b75fee,
228
+ &.wb-option-item-listboxOptionItemFocused-e4b75fee:focus-visible,
229
+ &.wb-option-item-listboxOptionItemFocused-e4b75fee:focus-visible:active {
230
+ border-radius: var(--wb-c-dropdown-item-border-radius-default);
231
+ outline: var(--wb-border-width-medium) solid
232
+ var(--wb-semanticColor-focus-outer);
233
+ outline-offset: calc(var(--wb-border-width-medium) * -1);
234
+
235
+ /* We need to use a thicker box-shadow to ensure that the inner ring
236
+ * is visible when the cell is focused. */
237
+ box-shadow: inset 0 0 0 calc(var(--wb-border-width-medium) * 2)
238
+ var(--wb-semanticColor-focus-inner);
239
+ }
240
+
241
+ /**
242
+ * Specific styles for MultiSelect and SingleSelect.
243
+ */
244
+
245
+ /* Allows programmatic focus to be applied to the item. Declared after the
246
+ * press rule: a focused item keeps its focus radius while pressed. */
247
+ &.wb-option-item-selectOptionItem-e4b75fee:focus,
248
+ &.wb-option-item-selectOptionItem-e4b75fee:focus:active {
249
+ border-radius: var(--wb-c-dropdown-item-border-radius-default);
250
+ outline: var(--wb-border-width-medium) solid
251
+ var(--wb-semanticColor-focus-outer);
252
+ outline-offset: calc(var(--wb-border-width-medium) * -1);
253
+ box-shadow: inset 0 0 0 calc(var(--wb-border-width-medium) * 2)
254
+ var(--wb-semanticColor-focus-inner);
255
+ }
256
+
257
+ /* A disabled item never shows the focus ring. (0,4,0): outranks every
258
+ * focus rule above. */
259
+ &.wb-option-item-optionItem-e4b75fee[aria-disabled="true"]:focus {
260
+ outline: none;
261
+ box-shadow: none;
262
+ }
263
+
264
+ & .wb-option-item-label-e4b75fee {
265
+ font-weight: var(--wb-c-dropdown-item-font-weight);
266
+ line-height: var(--wb-sizing-size_200);
267
+ white-space: nowrap;
268
+
269
+ /* Safari only honours the prefixed form, and the CSS pipeline has no
270
+ * autoprefixer (Aphrodite used to add it). */
271
+ /* stylelint-disable-next-line property-no-vendor-prefix -- Safari needs it */
272
+ -webkit-user-select: none;
273
+ user-select: none;
274
+
275
+ /* added to truncate strings that are longer than expected */
276
+ overflow: hidden;
277
+ text-overflow: ellipsis;
278
+ }
279
+ }
280
+ }
281
+
282
+ @layer shared {/**
283
+ * SeparatorItem styles
284
+ *
285
+ * The separator is a `View`, whose own `.default` class (same
286
+ * `@layer shared`) resets `border`, `margin` and `min-block-size`. The
287
+ * published bundle loads this stylesheet *before* core's, so the rule is
288
+ * qualified with the `.root` marker class (applied to the same element) to
289
+ * win on specificity rather than load order.
290
+ *
291
+ * The build wraps every rule in `@layer shared { … }`.
292
+ */.wb-separator-item-root-91691150 {
293
+ &.wb-separator-item-separator-91691150 {
294
+ border-block-start: var(--wb-border-width-thin) solid
295
+ var(--wb-semanticColor-core-border-neutral-subtle);
296
+ block-size: 1px;
297
+ min-block-size: 1px;
298
+ margin-block: var(--wb-sizing-size_040);
299
+ }
300
+ }
301
+ }
302
+
303
+ @layer shared {/**
304
+ * DropdownCore styles
305
+ *
306
+ * The menu is portaled out of the wrapper by `DropdownPopper`, so its rules
307
+ * nest under `.menu` — a marker class on the menu container itself, which
308
+ * carries no declarations of its own. The container and the list are `View`s,
309
+ * the empty state a `BodyText` and the filter a `SearchField`; all of them
310
+ * ship rules in the same `@layer shared`, and this component overrides
311
+ * properties they set (`padding`, `border` on the container; `margin` on the
312
+ * empty state; `margin`, `min-block-size` and `position` on the search
313
+ * field). The published bundle loads this stylesheet *before* those
314
+ * packages', so the compound selectors make the outcome depend on specificity
315
+ * rather than load order.
316
+ *
317
+ * Consumer `style` / `dropdownStyle` overrides are emitted unlayered, so they
318
+ * still win over everything here.
319
+ *
320
+ * Nesting is native CSS: every `&` is explicit and resolves to the flat
321
+ * selector it replaces. The build wraps every rule in `@layer shared { … }`.
322
+ */.wb-dropdown-core-menuWrapper-a2b0ee43 {
323
+ inline-size: fit-content;
324
+ max-inline-size: 100%;
325
+ }.wb-dropdown-core-menu-a2b0ee43 {
326
+ &.wb-dropdown-core-dropdown-a2b0ee43 {
327
+ background-color: var(--wb-semanticColor-core-background-base-default);
328
+ border-radius: var(--wb-c-dropdown-listbox-border-radius);
329
+ padding-block: var(--wb-c-dropdown-listbox-layout-padding-block);
330
+ padding-inline: var(--wb-c-dropdown-listbox-layout-padding-inline);
331
+ border: solid var(--wb-border-width-thin)
332
+ var(--wb-semanticColor-core-border-neutral-subtle);
333
+ box-shadow: var(--wb-c-dropdown-listbox-shadow-default);
334
+
335
+ /* We use a custom property to set the max height of the dropdown.
336
+ * This comes from the maxHeight custom modifier.
337
+ * @see ../util/popper-max-height-modifier.ts */
338
+ /* stylelint-disable-next-line csstools/value-no-unknown-custom-properties -- set at runtime by the popper modifier, not a token */
339
+ max-block-size: var(--popper-max-height);
340
+ }
341
+
342
+ &.wb-dropdown-core-hidden-a2b0ee43 {
343
+ pointer-events: none;
344
+ visibility: hidden;
345
+ }
346
+
347
+ & .wb-dropdown-core-listboxOrMenu-a2b0ee43 {
348
+ overflow-y: auto;
349
+ }
350
+
351
+ & .wb-dropdown-core-noResult-a2b0ee43 {
352
+ color: var(--wb-semanticColor-core-foreground-neutral-default);
353
+ align-self: center;
354
+ margin-block-start: var(--wb-sizing-size_060);
355
+ }
356
+
357
+ & .wb-dropdown-core-searchField-a2b0ee43 {
358
+ margin: var(--wb-sizing-size_080);
359
+ margin-block-start: var(--wb-sizing-size_040);
360
+
361
+ /* Set `min-block-size` to "auto" to stop the search field from having
362
+ * a height of 0 and being cut off. */
363
+ min-block-size: auto;
364
+ position: sticky;
365
+ }
366
+ }
367
+ }
368
+
369
+ @layer shared {/**
370
+ * ActionMenu styles
371
+ *
372
+ * Passed to `DropdownCore` as part of `dropdownStyle`. No package this menu
373
+ * renders sets `inset-block-start`, so the class needs no extra specificity.
374
+ *
375
+ * The build wraps every rule in `@layer shared { … }`.
376
+ *//* This is to adjust the space between the menu and the opener. */.wb-action-menu-menuTopSpace-dc603e87 {
377
+ inset-block-start: calc(-1 * var(--wb-sizing-size_040));
378
+ }
379
+ }
380
+
381
+ @layer shared {/*
382
+ * Cross-package focus-visible mixin.
383
+ *
384
+ * Authors include the mixin via:
385
+ *
386
+ * @import "@khanacademy/wonder-blocks-styles/focus-styles.css";
387
+ *
388
+ * .my-component:focus-visible {
389
+ * @apply --wb-focus-visible;
390
+ * }
391
+ *
392
+ * postcss-import resolves the @import through the workspace and
393
+ * @csstools/postcss-mixins expands the @apply at build time
394
+ * (CSS Mixins Level 1 syntax — note the leading `--` on the name).
395
+ *//**
396
+ * SelectOpener styles
397
+ *
398
+ * The opener is an `addStyle("button")`, whose element reset lives in
399
+ * `@layer shared.reset`, so rules directly in `@layer shared` outrank it
400
+ * without extra specificity. Its children are a `BodyText` and a
401
+ * `PhosphorIcon`, which ship rules in the same `@layer shared` (`BodyText`
402
+ * resets `margin`); those rules nest under `.opener` so they win on
403
+ * specificity rather than stylesheet load order.
404
+ *
405
+ * Aphrodite merged the `style` array into one class, re-ordering a pseudo
406
+ * key to the end whenever a later style set it again. The modifier classes
407
+ * are declared in that array order:
408
+ *
409
+ * opener → disabled → error → placeholder → disabledPlaceholder →
410
+ * press → readOnly
411
+ *
412
+ * which reproduces the merged result for every combination, e.g. an errored,
413
+ * disabled opener keeps the press shadow in its `:focus:active` ring because
414
+ * `error` came after `disabled`.
415
+ *
416
+ * Nesting is native CSS: every `&` is explicit and resolves to the flat
417
+ * selector it replaces. The build wraps every rule in `@layer shared { … }`.
418
+ *//* TODO: Dedupe with Button styles */.wb-select-opener-opener-1732ec34 {
419
+ position: relative;
420
+ display: inline-flex;
421
+ align-items: center;
422
+ justify-content: space-between;
423
+ block-size: 40px;
424
+
425
+ /* This asymmetry arises from the Icon on the right side, which has extra
426
+ * padding built in. To have the component look more balanced, we need to
427
+ * take off some paddingRight here. */
428
+ padding-inline: var(--wb-c-dropdown-opener-layout-padding-inlineStart)
429
+ var(--wb-c-dropdown-opener-layout-padding-inlineEnd);
430
+ border-radius: var(--wb-c-dropdown-opener-border-radius-rest);
431
+ outline: none;
432
+ text-decoration: none;
433
+ box-sizing: border-box;
434
+ white-space: nowrap;
435
+
436
+ /* This removes the 300ms click delay on mobile browsers by indicating
437
+ * that "double-tap to zoom" shouldn't be used on this element. */
438
+ touch-action: manipulation;
439
+
440
+ /* Theming (default) */
441
+ background: var(--wb-semanticColor-input-default-background);
442
+ border: var(--wb-border-width-thin) solid
443
+ var(--wb-semanticColor-input-default-border);
444
+ color: var(--wb-semanticColor-input-default-foreground);
445
+ cursor: pointer;
446
+
447
+ /* Use box shadow to make the border in the press state look thicker
448
+ * without changing the border. */
449
+ &:active {
450
+ box-shadow: 0 0 0 var(--wb-border-width-thin)
451
+ var(--wb-semanticColor-input-default-border);
452
+ }
453
+
454
+ /* Using :focus instead of :focus-visible to ensure the focus ring is
455
+ * visible when the button is focused (even when clicked). This makes the
456
+ * focus behaviour more consistent with the other field components. */
457
+ &:focus {
458
+ box-shadow: 0 0 0 var(--wb-border-width-medium)
459
+ var(--wb-semanticColor-focus-inner);
460
+ outline: var(--wb-border-width-medium) solid
461
+ var(--wb-semanticColor-focus-outer);
462
+ outline-offset: var(--wb-border-width-medium);
463
+ }
464
+
465
+ &:focus:active {
466
+ box-shadow:
467
+ 0 0 0 var(--wb-border-width-thin)
468
+ var(--wb-semanticColor-input-default-border),
469
+ 0 0 0 var(--wb-border-width-medium)
470
+ var(--wb-semanticColor-focus-inner);
471
+ }
472
+
473
+ & .wb-select-opener-text-1732ec34 {
474
+ margin-inline-end: var(--wb-sizing-size_080);
475
+ white-space: nowrap;
476
+
477
+ /* Safari only honours the prefixed form, and the CSS pipeline has no
478
+ * autoprefixer (Aphrodite used to add it). */
479
+ /* stylelint-disable-next-line property-no-vendor-prefix -- Safari needs it */
480
+ -webkit-user-select: none;
481
+ user-select: none;
482
+ overflow: hidden;
483
+ text-overflow: ellipsis;
484
+ }
485
+
486
+ & .wb-select-opener-caret-1732ec34 {
487
+ min-inline-size: var(--wb-sizing-size_160);
488
+ }
489
+ }.wb-select-opener-disabled-1732ec34 {
490
+ background: var(--wb-semanticColor-input-disabled-background);
491
+ border: var(--wb-border-width-thin) solid
492
+ var(--wb-semanticColor-input-disabled-border);
493
+ color: var(--wb-semanticColor-input-disabled-foreground);
494
+ cursor: not-allowed;
495
+
496
+ &:active {
497
+ box-shadow: none;
498
+ }
499
+
500
+ &:focus:active {
501
+ box-shadow: 0 0 0 var(--wb-border-width-medium)
502
+ var(--wb-semanticColor-focus-inner);
503
+ }
504
+ }.wb-select-opener-error-1732ec34 {
505
+ background: var(--wb-semanticColor-input-error-background);
506
+ border: var(--wb-c-dropdown-opener-border-width-error) solid
507
+ var(--wb-semanticColor-input-error-border);
508
+ color: var(--wb-semanticColor-input-error-foreground);
509
+
510
+ &:focus:active {
511
+ box-shadow:
512
+ 0 0 0 var(--wb-border-width-thin)
513
+ var(--wb-semanticColor-input-default-border),
514
+ 0 0 0 var(--wb-border-width-medium)
515
+ var(--wb-semanticColor-focus-inner);
516
+ }
517
+ }.wb-select-opener-placeholder-1732ec34 {
518
+ color: var(--wb-semanticColor-input-default-placeholder);
519
+ }.wb-select-opener-disabledPlaceholder-1732ec34 {
520
+ color: var(--wb-semanticColor-input-disabled-placeholder);
521
+ }/* Applied while Enter/Space is held down (tracked in JS). */.wb-select-opener-press-1732ec34 {
522
+ box-shadow: 0 0 0 var(--wb-border-width-thin)
523
+ var(--wb-semanticColor-input-default-border);
524
+
525
+ /* We merge the focus styles with the press styles so that the focus ring
526
+ * is visible when the button is pressed. Declared after `.opener:focus`,
527
+ * which it overrides at equal specificity. */
528
+ &:focus-visible {
529
+ box-shadow:
530
+ 0 0 0 var(--wb-border-width-thin)
531
+ var(--wb-semanticColor-input-default-border),
532
+ 0 0 0 var(--wb-border-width-medium)
533
+ var(--wb-semanticColor-focus-inner);
534
+ }
535
+ }.wb-select-opener-readOnly-1732ec34 {
536
+ background: var(--wb-semanticColor-input-readOnly-background);
537
+ color: var(--wb-semanticColor-input-readOnly-text);
538
+
539
+ &:active {
540
+ box-shadow: none;
541
+ }
542
+
543
+ &:focus:active {
544
+ box-shadow: 0 0 0 var(--wb-border-width-medium)
545
+ var(--wb-semanticColor-focus-inner);
546
+ }
547
+
548
+ /* A read-only placeholder keeps the placeholder colour (the Aphrodite
549
+ * version re-applied `placeholder` after `readOnly`). (0,2,0) so it also
550
+ * beats `.disabledPlaceholder`, as the re-applied style did. */
551
+ &.wb-select-opener-placeholder-1732ec34 {
552
+ color: var(--wb-semanticColor-input-default-placeholder);
553
+ }
554
+ }
555
+ }
556
+
557
+ @layer shared {/**
558
+ * Combobox live region styles
559
+ *
560
+ * The live region is an `addStyle("span")`, which ships no styles of its own,
561
+ * so the class needs no extra specificity.
562
+ *
563
+ * The build wraps every rule in `@layer shared { … }`.
564
+ */.wb-combobox-live-region-srOnly-aac1c1e3 {
565
+ border: 0;
566
+ /* stylelint-disable-next-line property-no-deprecated -- the standard visually-hidden pattern; kept as-is from the Aphrodite version */
567
+ clip: rect(0, 0, 0, 0);
568
+ block-size: 1px;
569
+ /* stylelint-disable-next-line scale-unlimited/declaration-strict-value -- part of the standard visually-hidden pattern, not a design spacing value */
570
+ margin: -1px;
571
+ overflow: hidden;
572
+ padding: 0;
573
+ position: absolute;
574
+ inline-size: 1px;
575
+ }
576
+ }
577
+
578
+ @layer shared {/*
579
+ * Cross-package focus-visible mixin.
580
+ *
581
+ * Authors include the mixin via:
582
+ *
583
+ * @import "@khanacademy/wonder-blocks-styles/focus-styles.css";
584
+ *
585
+ * .my-component:focus-visible {
586
+ * @apply --wb-focus-visible;
587
+ * }
588
+ *
589
+ * postcss-import resolves the @import through the workspace and
590
+ * @csstools/postcss-mixins expands the @apply at build time
591
+ * (CSS Mixins Level 1 syntax — note the leading `--` on the name).
592
+ *//**
593
+ * Combobox selected-items group styles
594
+ *
595
+ * Every rule nests inside `.root` — a marker class on the group, which
596
+ * carries no declarations of its own. The group is a `View` and each item a
597
+ * `Button`; both ship rules in the same `@layer shared`, and this component
598
+ * overrides properties they set (`flex-direction` and `padding` on the view;
599
+ * `block-size`, `padding-inline` and the focus ring on the button). The
600
+ * published bundle loads this stylesheet *before* those packages', so the
601
+ * compound selectors make the outcome depend on specificity instead.
602
+ *
603
+ * Nesting is native CSS: every `&` is explicit and resolves to the flat
604
+ * selector it replaces. The build wraps every rule in `@layer shared { … }`.
605
+ */.wb-combobox-multiple-selection-root-fdcc29f0 {
606
+ &.wb-combobox-multiple-selection-container-fdcc29f0 {
607
+ flex-flow: row wrap;
608
+ gap: var(--wb-sizing-size_080);
609
+ padding-block-start: var(--wb-sizing-size_080);
610
+ }
611
+
612
+ & .wb-combobox-multiple-selection-item-fdcc29f0 {
613
+ font-size: var(--wb-font-body-size-small);
614
+ justify-content: space-between;
615
+ align-items: center;
616
+ block-size: auto;
617
+ padding-inline: var(--wb-sizing-size_080);
618
+ }
619
+
620
+ /* The item focused via the keyboard (visual focus only). The Aphrodite
621
+ * version beat every `Button` state, so this also lists the hover /
622
+ * press states (Button's hover and press rules are (0,2,0); its
623
+ * secondary focus-visible + hover / press rules are (0,3,0)). */
624
+ & .wb-combobox-multiple-selection-itemFocused-fdcc29f0,
625
+ & .wb-combobox-multiple-selection-itemFocused-fdcc29f0:hover,
626
+ & .wb-combobox-multiple-selection-itemFocused-fdcc29f0:active,
627
+ & .wb-combobox-multiple-selection-itemFocused-fdcc29f0:focus-visible:hover,
628
+ & .wb-combobox-multiple-selection-itemFocused-fdcc29f0:focus-visible:active {
629
+ box-shadow: 0 0 0 var(--wb-border-width-medium)
630
+ var(--wb-semanticColor-focus-inner);
631
+ outline: var(--wb-border-width-medium) solid
632
+ var(--wb-semanticColor-focus-outer);
633
+ outline-offset: var(--wb-border-width-medium);
634
+ }
635
+ }
636
+ }
637
+
638
+ @layer shared {/*
639
+ * Cross-package focus-visible mixin.
640
+ *
641
+ * Authors include the mixin via:
642
+ *
643
+ * @import "@khanacademy/wonder-blocks-styles/focus-styles.css";
644
+ *
645
+ * .my-component:focus-visible {
646
+ * @apply --wb-focus-visible;
647
+ * }
648
+ *
649
+ * postcss-import resolves the @import through the workspace and
650
+ * @csstools/postcss-mixins expands the @apply at build time
651
+ * (CSS Mixins Level 1 syntax — note the leading `--` on the name).
652
+ *//**
653
+ * Combobox styles
654
+ *
655
+ * The wrapper rules nest inside `.root` — a marker class on the wrapper,
656
+ * which carries no declarations of its own. The wrapper and the start-icon
657
+ * container are `View`s, the input is a `TextField` and the clear / toggle
658
+ * buttons are `IconButton`s. All of them ship rules in the same
659
+ * `@layer shared`, and this component overrides properties they set. The
660
+ * published bundle loads this stylesheet *before* those packages', so at
661
+ * equal specificity they would win; the compound selectors make the outcome
662
+ * depend on specificity instead. Where `TextField` or `IconButton` use state
663
+ * selectors, the resets below repeat the same selector under `.root`, which
664
+ * outranks it by one class.
665
+ *
666
+ * The listbox (or "no items" cell) is portaled out of the wrapper, so its
667
+ * rules nest under a separate `.menu` marker on that element.
668
+ *
669
+ * The Aphrodite version was unlayered `!important`, so it beat every rule in
670
+ * those packages; the consumer's `style` (on the input) still does.
671
+ *
672
+ * Nesting is native CSS: every `&` is explicit and resolves to the flat
673
+ * selector it replaces. The build wraps every rule in `@layer shared { … }`.
674
+ */.wb-combobox-root-93ad8b7e {
675
+ /* TODO(WB-2007): Adopt design specs */
676
+ &.wb-combobox-wrapper-93ad8b7e {
677
+ flex-flow: row wrap;
678
+ align-items: center;
679
+ inline-size: 100%;
680
+ max-inline-size: 100%;
681
+
682
+ /* The following styles are to emulate the input styles */
683
+ background: var(--wb-semanticColor-core-background-base-default);
684
+ border-radius: var(--wb-c-dropdown-opener-border-radius-rest);
685
+ border: var(--wb-border-width-thin) solid
686
+ var(--wb-semanticColor-core-border-neutral-subtle);
687
+ padding-inline: var(--wb-c-dropdown-opener-layout-padding-inline);
688
+ overflow: hidden;
689
+ }
690
+
691
+ &.wb-combobox-focused-93ad8b7e {
692
+ box-shadow: 0 0 0 var(--wb-border-width-medium)
693
+ var(--wb-semanticColor-focus-inner);
694
+ outline: var(--wb-border-width-medium) solid
695
+ var(--wb-semanticColor-focus-outer);
696
+ outline-offset: var(--wb-border-width-medium);
697
+ }
698
+
699
+ &.wb-combobox-disabled-93ad8b7e {
700
+ background: var(--wb-semanticColor-input-disabled-background);
701
+ border: var(--wb-border-width-thin) solid
702
+ var(--wb-semanticColor-input-disabled-border);
703
+ color: var(--wb-semanticColor-input-disabled-foreground);
704
+ }
705
+
706
+ &.wb-combobox-error-93ad8b7e {
707
+ background: var(--wb-semanticColor-input-error-background);
708
+ border: var(--wb-c-dropdown-opener-border-width-error) solid
709
+ var(--wb-semanticColor-input-error-border);
710
+ color: var(--wb-semanticColor-input-error-foreground);
711
+ }
712
+
713
+ /**
714
+ * Combobox input styles
715
+ */
716
+ & .wb-combobox-combobox-93ad8b7e {
717
+ /* reset input styles */
718
+ appearance: none;
719
+ background: none;
720
+ border: none;
721
+ outline: none;
722
+ padding: 0;
723
+ min-inline-size: var(--wb-sizing-size_040);
724
+ inline-size: auto;
725
+ display: inline-grid;
726
+ grid-area: 1 / 2;
727
+
728
+ /* The combobox wrapper handles the focus and press indicators, so we
729
+ * reset the TextField's own focus and press states to avoid showing a
730
+ * duplicate focus ring / press border on the inner input. */
731
+ &:focus-visible {
732
+ outline: none;
733
+ border: none;
734
+ box-shadow: none;
735
+ }
736
+
737
+ /* Matches the TextField's press selector so this reset takes
738
+ * precedence over the press box shadow it applies. */
739
+ &:active:not([aria-disabled="true"], [readonly]) {
740
+ box-shadow: none;
741
+ }
742
+
743
+ /* Matches the TextField's selector so this reset takes precedence
744
+ * over the box shadow it applies. */
745
+ &:focus-visible:active:not([aria-disabled="true"], [readonly]) {
746
+ box-shadow: none;
747
+ }
748
+ }
749
+
750
+ /**
751
+ * Arrow button styles
752
+ */
753
+ & .wb-combobox-button-93ad8b7e {
754
+ position: absolute;
755
+ inset-inline-end: var(--wb-sizing-size_0);
756
+ margin: 0;
757
+ }
758
+
759
+ & .wb-combobox-buttonOpen-93ad8b7e {
760
+ transform: rotate(180deg);
761
+ }
762
+
763
+ /**
764
+ * The dropdown toggle button is not directly focusable (`tabIndex={-1}`)
765
+ * and its state is already communicated by the combobox input, so we
766
+ * remove the IconButton's hover, focus, and press styles to keep it
767
+ * visually static. Values are reset to match the tertiary/neutral rest
768
+ * state. The `[aria-disabled="true"]` variants outrank IconButton's
769
+ * disabled state resets.
770
+ */
771
+ & .wb-combobox-openButtonResetStates-93ad8b7e:hover,
772
+ & .wb-combobox-openButtonResetStates-93ad8b7e:active,
773
+ & .wb-combobox-openButtonResetStates-93ad8b7e[aria-disabled="true"]:hover,
774
+ & .wb-combobox-openButtonResetStates-93ad8b7e[aria-disabled="true"]:active {
775
+ border-color: var(--wb-semanticColor-core-transparent);
776
+ }
777
+
778
+ & .wb-combobox-openButtonResetStates-93ad8b7e:focus-visible,
779
+ & .wb-combobox-openButtonResetStates-93ad8b7e[aria-disabled="true"]:focus-visible {
780
+ outline: none;
781
+ box-shadow: none;
782
+ }
783
+
784
+ /**
785
+ * Clear selection button. Declared after `.button`, which also sets
786
+ * `inset-inline-end`.
787
+ */
788
+ & .wb-combobox-clearButton-93ad8b7e {
789
+ /* The clear button is positioned to the left of the arrow button.
790
+ * This is calculated based on the padding + width of the arrow
791
+ * button. */
792
+ inset-inline-end: var(--wb-sizing-size_360);
793
+ }
794
+
795
+ & .wb-combobox-iconWrapper-93ad8b7e {
796
+ padding: var(--wb-sizing-size_040);
797
+
798
+ /* View has a default minInlineSize of 0, which causes the label text
799
+ * to encroach on the icon when it needs to truncate. We can fix this
800
+ * by setting the minInlineSize to auto. */
801
+ min-inline-size: auto;
802
+ }
803
+ }/**
804
+ * Listbox custom styles. Applied to the `Listbox` (or the "no items"
805
+ * `DetailCell`), which is portaled out of `.root`.
806
+ */.wb-combobox-menu-93ad8b7e {
807
+ &.wb-combobox-listbox-93ad8b7e {
808
+ background-color: var(--wb-semanticColor-core-background-base-default);
809
+ border-radius: var(--wb-c-dropdown-listbox-border-radius);
810
+ border: solid var(--wb-border-width-thin)
811
+ var(--wb-semanticColor-core-border-neutral-subtle);
812
+ box-shadow: var(--wb-c-dropdown-listbox-shadow-default);
813
+
814
+ /* We use a custom property to set the max height of the dropdown.
815
+ * This comes from the maxHeight custom modifier.
816
+ * @see ../util/popper-max-height-modifier.ts */
817
+ /* stylelint-disable-next-line csstools/value-no-unknown-custom-properties -- set at runtime by the popper modifier, not a token */
818
+ max-block-size: var(--popper-max-height);
819
+ overflow-y: auto;
820
+ }
821
+
822
+ &.wb-combobox-hidden-93ad8b7e {
823
+ pointer-events: none;
824
+ visibility: hidden;
825
+ }
826
+ }
827
+ }
828
+
829
+ @layer shared {/**
830
+ * Listbox styles
831
+ *
832
+ * The listbox is a `View`, whose own `.default` class (same `@layer shared`)
833
+ * resets `padding`. The published bundle loads this stylesheet *before*
834
+ * core's, so the rules are qualified with the `.root` marker class (applied to
835
+ * the same element) to win on specificity rather than load order.
836
+ *
837
+ * The build wraps every rule in `@layer shared { … }`.
838
+ */.wb-listbox-root-1fcff703 {
839
+ &.wb-listbox-listbox-1fcff703 {
840
+ background-color: var(--wb-semanticColor-core-background-base-default);
841
+ outline: none;
842
+
843
+ /* layout */
844
+ padding-block: var(--wb-c-dropdown-listbox-layout-padding-block);
845
+ padding-inline: var(--wb-c-dropdown-listbox-layout-padding-inline);
846
+ }
847
+
848
+ &.wb-listbox-disabled-1fcff703 {
849
+ color: var(--wb-semanticColor-action-secondary-disabled-foreground);
850
+ }
851
+ }
852
+ }
853
+
854
+ @layer shared {/*
855
+ * Cross-package focus-visible mixin.
856
+ *
857
+ * Authors include the mixin via:
858
+ *
859
+ * @import "@khanacademy/wonder-blocks-styles/focus-styles.css";
860
+ *
861
+ * .my-component:focus-visible {
862
+ * @apply --wb-focus-visible;
863
+ * }
864
+ *
865
+ * postcss-import resolves the @import through the workspace and
866
+ * @csstools/postcss-mixins expands the @apply at build time
867
+ * (CSS Mixins Level 1 syntax — note the leading `--` on the name).
868
+ *//**
869
+ * CustomOpener styles
870
+ *
871
+ * The opener is an `addStyle("button")`, whose element reset lives in
872
+ * `@layer shared.reset`, so `.reset` outranks it without extra specificity.
873
+ * The label is a `BodyText`, which sets `display: block` in the same
874
+ * `@layer shared`; its rule nests under `.reset` so it wins on specificity
875
+ * rather than stylesheet load order.
876
+ *
877
+ * The consumer's `styles.root` / `styles.label` are emitted unlayered, so
878
+ * they win over everything here.
879
+ *
880
+ * Nesting is native CSS: every `&` is explicit and resolves to the flat
881
+ * selector it replaces. The build wraps every rule in `@layer shared { … }`.
882
+ */.wb-custom-opener-reset-2d20d7fb {
883
+ /* CSS button reset — consumers start from a blank slate */
884
+ appearance: none;
885
+ background: none;
886
+ border: none;
887
+ box-sizing: border-box;
888
+ cursor: pointer;
889
+ font: inherit;
890
+ margin: 0;
891
+ padding: 0;
892
+ text-align: inherit;
893
+
894
+ /* Removes the 300ms tap delay on mobile browsers */
895
+ touch-action: manipulation;
896
+
897
+ /* WB focus ring — always applied, no need to add it yourself */
898
+ &:focus-visible {
899
+ box-shadow: 0 0 0 var(--wb-border-width-medium)
900
+ var(--wb-semanticColor-focus-inner);
901
+ outline: var(--wb-border-width-medium) solid
902
+ var(--wb-semanticColor-focus-outer);
903
+ outline-offset: var(--wb-border-width-medium);
904
+ }
905
+
906
+ & .wb-custom-opener-label-2d20d7fb {
907
+ align-items: center;
908
+ display: flex;
909
+ flex-direction: row;
910
+ gap: var(--wb-sizing-size_020);
911
+ }
912
+ }.wb-custom-opener-disabled-2d20d7fb {
913
+ cursor: not-allowed;
914
+ }
915
+ }
916
+
917
+ /*# sourceMappingURL=index.css.map */