@khanacademy/wonder-blocks-dropdown 9.1.1 → 9.1.2

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.js CHANGED
@@ -102,11 +102,6 @@ const defaultComboboxLabels = {
102
102
  unselected: labels => `${labels} not selected`
103
103
  };
104
104
 
105
- const {
106
- blue: blue$1,
107
- white: white$1,
108
- offBlack: offBlack$1
109
- } = wonderBlocksTokens.color;
110
105
  class ActionItem extends React__namespace.Component {
111
106
  static isClassOf(instance) {
112
107
  return instance && instance.type && instance.type.__IS_ACTION_ITEM__;
@@ -127,13 +122,13 @@ class ActionItem extends React__namespace.Component {
127
122
  style,
128
123
  testId
129
124
  } = this.props;
130
- const defaultStyle = [styles$c.wrapper, style];
125
+ const defaultStyle = [styles$b.wrapper, style];
131
126
  const labelComponent = typeof label === "string" ? React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
132
127
  lang: lang,
133
- style: styles$c.label
128
+ style: styles$b.label
134
129
  }, label) : (React__namespace.cloneElement(label, _extends__default["default"]({
135
130
  lang,
136
- style: styles$c.label
131
+ style: styles$b.label
137
132
  }, label.props)));
138
133
  return React__namespace.createElement(wonderBlocksCell.CompactCell, {
139
134
  disabled: disabled,
@@ -141,7 +136,7 @@ class ActionItem extends React__namespace.Component {
141
136
  rootStyle: defaultStyle,
142
137
  leftAccessory: leftAccessory,
143
138
  rightAccessory: rightAccessory,
144
- style: [styles$c.shared, indent && styles$c.indent],
139
+ style: [styles$b.shared, indent && styles$b.indent],
145
140
  role: role,
146
141
  testId: testId,
147
142
  title: labelComponent,
@@ -158,28 +153,37 @@ ActionItem.defaultProps = {
158
153
  role: "menuitem"
159
154
  };
160
155
  ActionItem.__IS_ACTION_ITEM__ = true;
161
- const styles$c = aphrodite.StyleSheet.create({
156
+ const actionType$1 = wonderBlocksTokens.semanticColor.action.primary.progressive;
157
+ const theme$7 = {
158
+ actionItem: {
159
+ color: {
160
+ hover: {
161
+ background: actionType$1.hover.background,
162
+ foreground: actionType$1.hover.foreground
163
+ },
164
+ press: {
165
+ background: actionType$1.press.background,
166
+ foreground: actionType$1.press.foreground
167
+ }
168
+ }
169
+ }
170
+ };
171
+ const styles$b = aphrodite.StyleSheet.create({
162
172
  wrapper: {
163
173
  minHeight: DROPDOWN_ITEM_HEIGHT,
164
174
  touchAction: "manipulation",
165
175
  ":focus": {
166
176
  borderRadius: wonderBlocksTokens.spacing.xxxSmall_4,
167
- outline: `${wonderBlocksTokens.spacing.xxxxSmall_2}px solid ${wonderBlocksTokens.color.blue}`,
177
+ outline: `${wonderBlocksTokens.spacing.xxxxSmall_2}px solid ${wonderBlocksTokens.semanticColor.focus.outer}`,
168
178
  outlineOffset: -wonderBlocksTokens.spacing.xxxxSmall_2
169
179
  },
170
180
  [":hover[aria-disabled=false]"]: {
171
- color: white$1,
172
- background: blue$1
173
- },
174
- ["@media not (hover: hover)"]: {
175
- [":hover[aria-disabled=false]"]: {
176
- color: white$1,
177
- background: offBlack$1
178
- }
181
+ color: theme$7.actionItem.color.hover.foreground,
182
+ background: theme$7.actionItem.color.hover.background
179
183
  },
180
184
  [":active[aria-disabled=false]"]: {
181
- color: wonderBlocksTokens.color.fadedBlue,
182
- background: wonderBlocksTokens.color.activeBlue
185
+ color: theme$7.actionItem.color.press.foreground,
186
+ background: theme$7.actionItem.color.press.background
183
187
  }
184
188
  },
185
189
  shared: {
@@ -202,10 +206,10 @@ const Check = function Check(props) {
202
206
  return React__namespace.createElement(wonderBlocksIcon.PhosphorIcon, {
203
207
  icon: checkIcon__default["default"],
204
208
  size: "small",
205
- style: [styles$b.bounds, !selected && styles$b.hide]
209
+ style: [styles$a.bounds, !selected && styles$a.hide]
206
210
  });
207
211
  };
208
- const styles$b = aphrodite.StyleSheet.create({
212
+ const styles$a = aphrodite.StyleSheet.create({
209
213
  bounds: {
210
214
  alignSelf: "center",
211
215
  height: wonderBlocksTokens.spacing.medium_16,
@@ -217,11 +221,6 @@ const styles$b = aphrodite.StyleSheet.create({
217
221
  }
218
222
  });
219
223
 
220
- const {
221
- offBlack16,
222
- offBlack50,
223
- offWhite
224
- } = wonderBlocksTokens.color;
225
224
  const Checkbox = function Checkbox(props) {
226
225
  const {
227
226
  disabled,
@@ -229,7 +228,7 @@ const Checkbox = function Checkbox(props) {
229
228
  } = props;
230
229
  return React__namespace.createElement(wonderBlocksCore.View, {
231
230
  className: "checkbox",
232
- style: [styles$a.checkbox, selected && !disabled && styles$a.noBorder, disabled && styles$a.disabledCheckbox]
231
+ style: [styles$9.checkbox, selected && !disabled && styles$9.noBorder, disabled && styles$9.disabledCheckbox]
233
232
  }, selected && React__namespace.createElement(wonderBlocksIcon.PhosphorIcon, {
234
233
  icon: checkIcon__default["default"],
235
234
  size: "small",
@@ -238,26 +237,39 @@ const Checkbox = function Checkbox(props) {
238
237
  width: wonderBlocksTokens.spacing.small_12,
239
238
  height: wonderBlocksTokens.spacing.small_12,
240
239
  margin: wonderBlocksTokens.spacing.xxxxSmall_2
241
- }, disabled && selected && styles$a.disabledCheckFormatting]
240
+ }, disabled && selected && styles$9.disabledCheckFormatting]
242
241
  }));
243
242
  };
244
- const styles$a = aphrodite.StyleSheet.create({
243
+ const theme$6 = {
244
+ checkbox: {
245
+ color: {
246
+ default: {
247
+ border: wonderBlocksTokens.semanticColor.border.strong
248
+ },
249
+ disabled: {
250
+ border: wonderBlocksTokens.semanticColor.action.secondary.disabled.border,
251
+ background: wonderBlocksTokens.semanticColor.action.secondary.disabled.background
252
+ }
253
+ }
254
+ }
255
+ };
256
+ const styles$9 = aphrodite.StyleSheet.create({
245
257
  checkbox: {
246
258
  alignSelf: "center",
247
259
  minHeight: wonderBlocksTokens.spacing.medium_16,
248
260
  minWidth: wonderBlocksTokens.spacing.medium_16,
249
261
  height: wonderBlocksTokens.spacing.medium_16,
250
- borderRadius: 3,
251
- borderWidth: 1,
262
+ borderRadius: wonderBlocksTokens.border.radius.small_3,
263
+ borderWidth: wonderBlocksTokens.border.width.hairline,
252
264
  borderStyle: "solid",
253
- borderColor: offBlack50
265
+ borderColor: theme$6.checkbox.color.default.border
254
266
  },
255
267
  noBorder: {
256
268
  borderWidth: 0
257
269
  },
258
270
  disabledCheckbox: {
259
- borderColor: offBlack16,
260
- backgroundColor: offWhite
271
+ borderColor: theme$6.checkbox.color.disabled.border,
272
+ backgroundColor: theme$6.checkbox.color.disabled.background
261
273
  },
262
274
  disabledCheckFormatting: {
263
275
  position: "absolute",
@@ -311,12 +323,12 @@ class OptionItem extends React__namespace.Component {
311
323
  } = _this$props,
312
324
  sharedProps = _objectWithoutPropertiesLoose__default["default"](_this$props, _excluded$5);
313
325
  const CheckComponent = this.getCheckComponent();
314
- const defaultStyle = [styles$9.item, style];
326
+ const defaultStyle = [styles$8.item, style];
315
327
  return React__namespace.createElement(wonderBlocksCell.DetailCell, _extends__default["default"]({
316
328
  disabled: disabled,
317
329
  horizontalRule: horizontalRule,
318
- rootStyle: parentComponent === "listbox" ? styles$9.listboxItem : defaultStyle,
319
- style: styles$9.itemContainer,
330
+ rootStyle: parentComponent === "listbox" ? styles$8.listboxItem : defaultStyle,
331
+ style: styles$8.itemContainer,
320
332
  "aria-selected": parentComponent !== "listbox" && selected ? "true" : "false",
321
333
  role: parentComponent !== "listbox" ? role : undefined,
322
334
  testId: testId,
@@ -338,7 +350,7 @@ class OptionItem extends React__namespace.Component {
338
350
  className: "subtitle"
339
351
  }, subtitle1) : undefined,
340
352
  title: React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
341
- style: styles$9.label
353
+ style: styles$8.label
342
354
  }, label),
343
355
  subtitle2: subtitle2 ? React__namespace.createElement(wonderBlocksTypography.LabelSmall, {
344
356
  className: "subtitle"
@@ -355,18 +367,19 @@ class OptionItem extends React__namespace.Component {
355
367
  selected
356
368
  } = this.props;
357
369
  if (parentComponent === "listbox") {
358
- return React__namespace.createElement(StyledLi, {
359
- onMouseDown: e => {
360
- e.preventDefault();
361
- },
362
- onClick: this.handleClick,
363
- style: [styles$9.reset, styles$9.item, focused && styles$9.itemFocused, disabled && styles$9.itemDisabled],
364
- role: role,
365
- "aria-selected": selected ? "true" : "false",
366
- "aria-disabled": disabled ? "true" : "false",
367
- id: this.props.id,
368
- tabIndex: -1
369
- }, this.renderCell());
370
+ return (React__namespace.createElement(StyledLi, {
371
+ onMouseDown: e => {
372
+ e.preventDefault();
373
+ },
374
+ onClick: this.handleClick,
375
+ style: [styles$8.reset, styles$8.item, focused && styles$8.itemFocused, disabled && styles$8.itemDisabled],
376
+ role: role,
377
+ "aria-selected": selected ? "true" : "false",
378
+ "aria-disabled": disabled ? "true" : "false",
379
+ id: this.props.id,
380
+ tabIndex: -1
381
+ }, this.renderCell())
382
+ );
370
383
  }
371
384
  return this.renderCell();
372
385
  }
@@ -380,17 +393,64 @@ OptionItem.defaultProps = {
380
393
  selected: false
381
394
  };
382
395
  OptionItem.__IS_OPTION_ITEM__ = true;
383
- const {
384
- blue,
385
- white,
386
- offBlack
387
- } = wonderBlocksTokens.color;
388
396
  const focusedStyle = {
389
397
  borderRadius: wonderBlocksTokens.spacing.xxxSmall_4,
390
- outline: `${wonderBlocksTokens.spacing.xxxxSmall_2}px solid ${wonderBlocksTokens.color.blue}`,
398
+ outline: `${wonderBlocksTokens.spacing.xxxxSmall_2}px solid ${wonderBlocksTokens.semanticColor.focus.outer}`,
391
399
  outlineOffset: -wonderBlocksTokens.spacing.xxxxSmall_2
392
400
  };
393
- const styles$9 = aphrodite.StyleSheet.create({
401
+ const actionType = wonderBlocksTokens.semanticColor.action.primary.progressive;
402
+ const theme$5 = {
403
+ optionItem: {
404
+ color: {
405
+ default: {
406
+ background: wonderBlocksTokens.semanticColor.surface.primary,
407
+ foreground: wonderBlocksTokens.semanticColor.text.primary
408
+ },
409
+ hover: {
410
+ background: actionType.hover.background,
411
+ foreground: actionType.hover.foreground
412
+ },
413
+ press: {
414
+ background: actionType.press.background,
415
+ foreground: actionType.press.foreground
416
+ },
417
+ disabled: {
418
+ background: "transparent",
419
+ foreground: wonderBlocksTokens.semanticColor.action.secondary.disabled.foreground
420
+ }
421
+ }
422
+ },
423
+ checkbox: {
424
+ color: {
425
+ hover: {
426
+ background: wonderBlocksTokens.semanticColor.action.secondary.progressive.hover.background,
427
+ foreground: wonderBlocksTokens.semanticColor.action.secondary.progressive.hover.foreground
428
+ },
429
+ press: {
430
+ background: wonderBlocksTokens.semanticColor.surface.primary,
431
+ foreground: wonderBlocksTokens.semanticColor.action.secondary.progressive.press.foreground
432
+ },
433
+ selected: {
434
+ background: actionType.default.background,
435
+ foreground: actionType.default.foreground
436
+ }
437
+ }
438
+ },
439
+ subtitle: {
440
+ color: {
441
+ default: {
442
+ foreground: wonderBlocksTokens.semanticColor.text.secondary
443
+ },
444
+ hover: {
445
+ foreground: wonderBlocksTokens.semanticColor.text.inverse
446
+ },
447
+ press: {
448
+ foreground: wonderBlocksTokens.semanticColor.text.inverse
449
+ }
450
+ }
451
+ }
452
+ };
453
+ const styles$8 = aphrodite.StyleSheet.create({
394
454
  reset: {
395
455
  margin: 0,
396
456
  padding: 0,
@@ -409,69 +469,68 @@ const styles$9 = aphrodite.StyleSheet.create({
409
469
  color: "inherit"
410
470
  },
411
471
  item: {
412
- backgroundColor: wonderBlocksTokens.color.white,
472
+ background: theme$5.optionItem.color.default.background,
473
+ color: theme$5.optionItem.color.default.foreground,
413
474
  minHeight: "unset",
414
475
  ":focus": focusedStyle,
415
476
  ":focus-visible": {
416
477
  overflow: "visible"
417
478
  },
418
479
  [":hover[aria-disabled=false]"]: {
419
- color: white,
420
- background: blue
480
+ color: theme$5.optionItem.color.hover.foreground,
481
+ background: theme$5.optionItem.color.hover.background
421
482
  },
422
483
  [":active[aria-selected=false]"]: {},
423
484
  [":hover[aria-disabled=true]"]: {
424
485
  cursor: "not-allowed"
425
486
  },
426
487
  [":is([aria-disabled=true])"]: {
427
- color: wonderBlocksTokens.color.offBlack32,
488
+ color: theme$5.optionItem.color.disabled.foreground,
428
489
  ":focus-visible": {
429
490
  outline: "none"
430
491
  }
431
492
  },
432
- ["@media not (hover: hover)"]: {
433
- [":hover[aria-disabled=false]"]: {
434
- color: white,
435
- background: offBlack
436
- }
437
- },
438
493
  [":active[aria-disabled=false]"]: {
439
- color: wonderBlocksTokens.color.fadedBlue,
440
- background: wonderBlocksTokens.color.activeBlue
494
+ color: theme$5.optionItem.color.press.foreground,
495
+ background: theme$5.optionItem.color.press.background
441
496
  },
442
497
  [":hover[aria-disabled=false] .checkbox"]: {
443
- background: white
498
+ background: theme$5.checkbox.color.hover.background
499
+ },
500
+ [":active[aria-disabled=false] .checkbox"]: {
501
+ background: theme$5.checkbox.color.press.background
444
502
  },
445
503
  [":hover[aria-disabled=false] .check"]: {
446
- color: blue
504
+ color: theme$5.checkbox.color.hover.foreground
447
505
  },
448
506
  [":active[aria-disabled=false] .check"]: {
449
- color: wonderBlocksTokens.color.activeBlue
507
+ color: theme$5.checkbox.color.press.foreground
450
508
  },
451
509
  [":is([aria-selected=true]) .checkbox"]: {
452
- background: blue
510
+ background: theme$5.checkbox.color.selected.background
453
511
  },
454
512
  [":is([aria-selected=true]) .check"]: {
455
- color: white
513
+ color: theme$5.checkbox.color.selected.foreground
456
514
  },
457
515
  [":is([aria-disabled=false]) .subtitle"]: {
458
- color: wonderBlocksTokens.color.offBlack64
516
+ color: theme$5.subtitle.color.default.foreground
459
517
  },
460
518
  [":hover[aria-disabled=false] .subtitle"]: {
461
- color: wonderBlocksTokens.color.offWhite
519
+ color: theme$5.subtitle.color.hover.foreground
462
520
  },
463
521
  [":active[aria-disabled=false] .subtitle"]: {
464
- color: wonderBlocksTokens.mix(wonderBlocksTokens.color.fadedBlue16, white)
522
+ color: theme$5.subtitle.color.press.foreground
465
523
  }
466
524
  },
467
525
  itemFocused: focusedStyle,
468
526
  itemDisabled: {
469
- outlineColor: wonderBlocksTokens.color.offBlack32
527
+ outlineColor: wonderBlocksTokens.semanticColor.focus.outer
470
528
  },
471
529
  itemContainer: {
472
530
  minHeight: "unset",
473
- padding: `${wonderBlocksTokens.spacing.xSmall_8 + wonderBlocksTokens.spacing.xxxxSmall_2}px ${wonderBlocksTokens.spacing.xSmall_8}px`,
474
- paddingRight: wonderBlocksTokens.spacing.medium_16,
531
+ paddingBlock: wonderBlocksTokens.spacing.xSmall_8 + wonderBlocksTokens.spacing.xxxxSmall_2,
532
+ paddingInlineStart: wonderBlocksTokens.spacing.xSmall_8,
533
+ paddingInlineEnd: wonderBlocksTokens.spacing.medium_16,
475
534
  whiteSpace: "nowrap"
476
535
  },
477
536
  label: {
@@ -491,16 +550,23 @@ class SeparatorItem extends React__namespace.Component {
491
550
  }
492
551
  render() {
493
552
  return (React__namespace.createElement(wonderBlocksCore.View, {
494
- style: [styles$8.separator, this.props.style],
553
+ style: [styles$7.separator, this.props.style],
495
554
  "aria-hidden": "true"
496
555
  })
497
556
  );
498
557
  }
499
558
  }
500
559
  SeparatorItem.__IS_SEPARATOR_ITEM__ = true;
501
- const styles$8 = aphrodite.StyleSheet.create({
560
+ const theme$4 = {
561
+ separator: {
562
+ color: {
563
+ border: wonderBlocksTokens.semanticColor.border.primary
564
+ }
565
+ }
566
+ };
567
+ const styles$7 = aphrodite.StyleSheet.create({
502
568
  separator: {
503
- boxShadow: `0 -1px ${wonderBlocksTokens.color.offBlack16}`,
569
+ borderTop: `1px solid ${theme$4.separator.color.border}`,
504
570
  height: 1,
505
571
  minHeight: 1,
506
572
  marginTop: wonderBlocksTokens.spacing.xxxSmall_4,
@@ -1207,7 +1273,7 @@ class DropdownCore extends React__namespace.Component {
1207
1273
  const numResults = items.length;
1208
1274
  if (numResults === 0) {
1209
1275
  return React__namespace.createElement(wonderBlocksTypography.LabelMedium, {
1210
- style: styles$7.noResult,
1276
+ style: styles$6.noResult,
1211
1277
  testId: "dropdown-core-no-results"
1212
1278
  }, noResults);
1213
1279
  }
@@ -1282,7 +1348,7 @@ class DropdownCore extends React__namespace.Component {
1282
1348
  onChange: this.handleSearchTextChanged,
1283
1349
  placeholder: labels.filter,
1284
1350
  ref: this.searchFieldRef,
1285
- style: styles$7.searchInputStyle,
1351
+ style: styles$6.searchInputStyle,
1286
1352
  value: searchText || ""
1287
1353
  });
1288
1354
  }
@@ -1300,12 +1366,12 @@ class DropdownCore extends React__namespace.Component {
1300
1366
  const minDropdownWidth = openerStyle ? openerStyle.getPropertyValue("width") : 0;
1301
1367
  return React__namespace.createElement(wonderBlocksCore.View, {
1302
1368
  onMouseUp: this.handleDropdownMouseUp,
1303
- style: [styles$7.dropdown, isReferenceHidden && styles$7.hidden, dropdownStyle],
1369
+ style: [styles$6.dropdown, isReferenceHidden && styles$6.hidden, dropdownStyle],
1304
1370
  testId: "dropdown-core-container"
1305
1371
  }, isFilterable && this.renderSearchField(), React__namespace.createElement(wonderBlocksCore.View, {
1306
1372
  id: id,
1307
1373
  role: role,
1308
- style: [styles$7.listboxOrMenu, {
1374
+ style: [styles$6.listboxOrMenu, {
1309
1375
  minWidth: minDropdownWidth
1310
1376
  }],
1311
1377
  "aria-invalid": role === "listbox" ? ariaInvalid : undefined,
@@ -1339,7 +1405,7 @@ class DropdownCore extends React__namespace.Component {
1339
1405
  "aria-live": "polite",
1340
1406
  "aria-atomic": "true",
1341
1407
  "aria-relevant": "additions text",
1342
- style: styles$7.srOnly,
1408
+ style: styles$6.srOnly,
1343
1409
  "data-testid": "dropdown-live-region"
1344
1410
  }, open && labels.someResults(totalItems));
1345
1411
  }
@@ -1354,7 +1420,7 @@ class DropdownCore extends React__namespace.Component {
1354
1420
  return React__namespace.createElement(wonderBlocksCore.View, {
1355
1421
  onKeyDown: !disabled ? this.handleKeyDown : undefined,
1356
1422
  onKeyUp: !disabled ? this.handleKeyUp : undefined,
1357
- style: [styles$7.menuWrapper, style],
1423
+ style: [styles$6.menuWrapper, style],
1358
1424
  className: className
1359
1425
  }, this.renderLiveRegion(), opener, open && this.renderDropdown());
1360
1426
  }
@@ -1371,17 +1437,32 @@ DropdownCore.defaultProps = {
1371
1437
  },
1372
1438
  selectionType: "single"
1373
1439
  };
1374
- const styles$7 = aphrodite.StyleSheet.create({
1440
+ const theme$3 = {
1441
+ dropdown: {
1442
+ color: {
1443
+ default: {
1444
+ background: wonderBlocksTokens.semanticColor.surface.primary,
1445
+ border: wonderBlocksTokens.semanticColor.border.primary
1446
+ }
1447
+ }
1448
+ },
1449
+ noResults: {
1450
+ color: {
1451
+ foreground: wonderBlocksTokens.semanticColor.text.secondary
1452
+ }
1453
+ }
1454
+ };
1455
+ const styles$6 = aphrodite.StyleSheet.create({
1375
1456
  menuWrapper: {
1376
1457
  width: "fit-content"
1377
1458
  },
1378
1459
  dropdown: {
1379
- backgroundColor: wonderBlocksTokens.color.white,
1380
- borderRadius: 4,
1460
+ backgroundColor: theme$3.dropdown.color.default.background,
1461
+ borderRadius: wonderBlocksTokens.border.radius.medium_4,
1381
1462
  paddingTop: wonderBlocksTokens.spacing.xxxSmall_4,
1382
1463
  paddingBottom: wonderBlocksTokens.spacing.xxxSmall_4,
1383
- border: `solid 1px ${wonderBlocksTokens.color.offBlack16}`,
1384
- boxShadow: `0px 8px 8px 0px ${wonderBlocksTokens.fade(wonderBlocksTokens.color.offBlack, 0.1)}`,
1464
+ border: `solid 1px ${theme$3.dropdown.color.default.border}`,
1465
+ boxShadow: `0px 8px 8px 0px ${wonderBlocksTokens.color.offBlack8}`,
1385
1466
  maxHeight: "var(--popper-max-height)"
1386
1467
  },
1387
1468
  listboxOrMenu: {
@@ -1392,7 +1473,7 @@ const styles$7 = aphrodite.StyleSheet.create({
1392
1473
  visibility: "hidden"
1393
1474
  },
1394
1475
  noResult: {
1395
- color: wonderBlocksTokens.color.offBlack64,
1476
+ color: theme$3.noResults.color.foreground,
1396
1477
  alignSelf: "center",
1397
1478
  marginTop: wonderBlocksTokens.spacing.xxSmall_6
1398
1479
  },
@@ -1431,10 +1512,8 @@ class ActionMenuOpenerCore extends React__namespace.Component {
1431
1512
  "aria-label": ariaLabel
1432
1513
  } = _this$props,
1433
1514
  restProps = _objectWithoutPropertiesLoose__default["default"](_this$props, _excluded$4);
1434
- const buttonColor = wonderBlocksTokens.color.blue;
1435
- const buttonStyles = _generateStyles$1(buttonColor);
1436
1515
  const disabled = disabledProp;
1437
- const defaultStyle = [sharedStyles.shared, disabled && sharedStyles.disabled, buttonStyles.default, disabled && buttonStyles.disabled, !disabled && pressed && buttonStyles.active];
1516
+ const defaultStyle = [sharedStyles.shared, sharedStyles.default, disabled && sharedStyles.disabled, !disabled && pressed && sharedStyles.press];
1438
1517
  const label = React__namespace.createElement(wonderBlocksTypography.LabelLarge, {
1439
1518
  style: sharedStyles.text
1440
1519
  }, children);
@@ -1448,7 +1527,7 @@ class ActionMenuOpenerCore extends React__namespace.Component {
1448
1527
  }, restProps, {
1449
1528
  "data-testid": testId
1450
1529
  }), React__namespace.createElement(wonderBlocksCore.View, {
1451
- style: !disabled && (hovered || focused) && buttonStyles.focus
1530
+ style: !disabled && (hovered || focused) && sharedStyles.focus
1452
1531
  }, label), React__namespace.createElement(wonderBlocksLayout.Strut, {
1453
1532
  size: wonderBlocksTokens.spacing.xxxSmall_4
1454
1533
  }), React__namespace.createElement(wonderBlocksIcon.PhosphorIcon, {
@@ -1459,6 +1538,22 @@ class ActionMenuOpenerCore extends React__namespace.Component {
1459
1538
  }));
1460
1539
  }
1461
1540
  }
1541
+ const theme$2 = {
1542
+ actionMenuOpener: {
1543
+ color: {
1544
+ default: {
1545
+ background: "none",
1546
+ foreground: wonderBlocksTokens.semanticColor.action.secondary.progressive.default.foreground
1547
+ },
1548
+ disabled: {
1549
+ foreground: wonderBlocksTokens.semanticColor.action.secondary.disabled.foreground
1550
+ },
1551
+ press: {
1552
+ foreground: wonderBlocksTokens.semanticColor.action.secondary.progressive.press.foreground
1553
+ }
1554
+ }
1555
+ }
1556
+ };
1462
1557
  const sharedStyles = aphrodite.StyleSheet.create({
1463
1558
  shared: {
1464
1559
  position: "relative",
@@ -1477,8 +1572,13 @@ const sharedStyles = aphrodite.StyleSheet.create({
1477
1572
  WebkitTapHighlightColor: "rgba(0,0,0,0)"
1478
1573
  }
1479
1574
  },
1575
+ default: {
1576
+ background: theme$2.actionMenuOpener.color.default.background,
1577
+ color: theme$2.actionMenuOpener.color.default.foreground
1578
+ },
1480
1579
  disabled: {
1481
- cursor: "auto"
1580
+ color: theme$2.actionMenuOpener.color.disabled.foreground,
1581
+ cursor: "not-allowed"
1482
1582
  },
1483
1583
  small: {
1484
1584
  height: wonderBlocksTokens.spacing.xLarge_32
@@ -1494,52 +1594,22 @@ const sharedStyles = aphrodite.StyleSheet.create({
1494
1594
  textOverflow: "ellipsis",
1495
1595
  pointerEvents: "none"
1496
1596
  },
1497
- hiddenText: {
1498
- visibility: "hidden"
1597
+ focus: {
1598
+ ":after": {
1599
+ content: "''",
1600
+ position: "absolute",
1601
+ height: 2,
1602
+ left: 0,
1603
+ right: 0,
1604
+ bottom: -1,
1605
+ background: "currentColor",
1606
+ borderRadius: wonderBlocksTokens.border.radius.xSmall_2
1607
+ }
1499
1608
  },
1500
- spinner: {
1501
- position: "absolute"
1609
+ press: {
1610
+ color: theme$2.actionMenuOpener.color.press.foreground
1502
1611
  }
1503
1612
  });
1504
- const styles$6 = {};
1505
- const _generateStyles$1 = localColor => {
1506
- const buttonType = localColor;
1507
- if (styles$6[buttonType]) {
1508
- return styles$6[buttonType];
1509
- }
1510
- const {
1511
- offBlack32
1512
- } = wonderBlocksTokens.color;
1513
- const activeColor = wonderBlocksTokens.color.activeBlue;
1514
- let newStyles = {};
1515
- newStyles = {
1516
- default: {
1517
- background: "none",
1518
- color: localColor
1519
- },
1520
- focus: {
1521
- ":after": {
1522
- content: "''",
1523
- position: "absolute",
1524
- height: 2,
1525
- left: 0,
1526
- right: 0,
1527
- bottom: -1,
1528
- background: "currentColor",
1529
- borderRadius: 2
1530
- }
1531
- },
1532
- active: {
1533
- color: activeColor
1534
- },
1535
- disabled: {
1536
- color: offBlack32,
1537
- cursor: "default"
1538
- }
1539
- };
1540
- styles$6[buttonType] = aphrodite.StyleSheet.create(newStyles);
1541
- return styles$6[buttonType];
1542
- };
1543
1613
 
1544
1614
  const _excluded$3 = ["text", "opened"];
1545
1615
  class ActionMenu extends React__namespace.Component {
@@ -1711,7 +1781,7 @@ const styles$5 = aphrodite.StyleSheet.create({
1711
1781
  }
1712
1782
  });
1713
1783
 
1714
- const _excluded$2 = ["children", "disabled", "error", "id", "isPlaceholder", "open", "testId", "aria-label", "aria-required", "onBlur", "onOpenChanged"];
1784
+ const _excluded$2 = ["children", "disabled", "error", "id", "isPlaceholder", "open", "testId", "aria-label", "aria-required", "aria-controls", "onBlur", "onOpenChanged"];
1715
1785
  const StyledButton = wonderBlocksCore.addStyle("button");
1716
1786
  class SelectOpener extends React__namespace.Component {
1717
1787
  constructor(props) {
@@ -1756,11 +1826,12 @@ class SelectOpener extends React__namespace.Component {
1756
1826
  testId,
1757
1827
  "aria-label": ariaLabel,
1758
1828
  "aria-required": ariaRequired,
1829
+ "aria-controls": ariaControls,
1759
1830
  onBlur
1760
1831
  } = _this$props,
1761
1832
  sharedProps = _objectWithoutPropertiesLoose__default["default"](_this$props, _excluded$2);
1762
1833
  const stateStyles = _generateStyles(isPlaceholder, error);
1763
- const iconColor = disabled ? wonderBlocksTokens.semanticColor.action.disabled.default : wonderBlocksTokens.semanticColor.icon.primary;
1834
+ const iconColor = disabled ? wonderBlocksTokens.semanticColor.icon.disabled : wonderBlocksTokens.semanticColor.icon.primary;
1764
1835
  const style = [styles$4.shared, stateStyles.default, disabled && stateStyles.disabled, !disabled && this.state.pressed && stateStyles.press];
1765
1836
  return React__namespace.createElement(StyledButton, _extends__default["default"]({}, sharedProps, {
1766
1837
  "aria-disabled": disabled,
@@ -1769,6 +1840,7 @@ class SelectOpener extends React__namespace.Component {
1769
1840
  "aria-label": ariaLabel != null ? ariaLabel : undefined,
1770
1841
  "aria-required": ariaRequired,
1771
1842
  "aria-haspopup": "listbox",
1843
+ "aria-controls": ariaControls,
1772
1844
  "data-testid": testId,
1773
1845
  id: id,
1774
1846
  role: "combobox",
@@ -1839,8 +1911,8 @@ const _generateStyles = (placeholder, error) => {
1839
1911
  foreground: wonderBlocksTokens.semanticColor.text.primary
1840
1912
  },
1841
1913
  disabled: {
1842
- border: wonderBlocksTokens.semanticColor.border.primary,
1843
- background: wonderBlocksTokens.semanticColor.action.disabled.secondary,
1914
+ border: wonderBlocksTokens.semanticColor.action.secondary.disabled.border,
1915
+ background: wonderBlocksTokens.semanticColor.action.secondary.disabled.background,
1844
1916
  foreground: wonderBlocksTokens.semanticColor.text.secondary
1845
1917
  },
1846
1918
  error: {
@@ -1850,18 +1922,21 @@ const _generateStyles = (placeholder, error) => {
1850
1922
  }
1851
1923
  };
1852
1924
  const actionType = error ? "destructive" : "progressive";
1853
- const action = wonderBlocksTokens.semanticColor.action.outlined[actionType];
1925
+ const action = wonderBlocksTokens.semanticColor.action.secondary[actionType];
1854
1926
  const sharedOutlineStyling = {
1855
1927
  outlineOffset: -wonderBlocksTokens.border.width.thin,
1856
1928
  outlineStyle: "solid",
1857
1929
  outlineWidth: wonderBlocksTokens.border.width.thin
1858
1930
  };
1859
- const focusHoverStyling = _extends__default["default"]({
1931
+ const focusStyling = _extends__default["default"]({}, sharedOutlineStyling, {
1932
+ outlineColor: wonderBlocksTokens.semanticColor.focus.outer
1933
+ });
1934
+ const hoverStyling = _extends__default["default"]({}, sharedOutlineStyling, {
1860
1935
  outlineColor: action.hover.border
1861
- }, sharedOutlineStyling);
1936
+ });
1862
1937
  const pressStyling = _extends__default["default"]({
1863
1938
  background: action.press.background,
1864
- color: placeholder ? error ? wonderBlocksTokens.semanticColor.text.secondary : wonderBlocksTokens.semanticColor.action.outlined.progressive.press.foreground : wonderBlocksTokens.semanticColor.text.primary,
1939
+ color: placeholder ? error ? wonderBlocksTokens.semanticColor.text.secondary : wonderBlocksTokens.semanticColor.action.secondary.progressive.press.foreground : wonderBlocksTokens.semanticColor.text.primary,
1865
1940
  outlineColor: action.press.border
1866
1941
  }, sharedOutlineStyling);
1867
1942
  const currentState = error ? states.error : states.default;
@@ -1871,7 +1946,7 @@ const _generateStyles = (placeholder, error) => {
1871
1946
  borderColor: currentState.border,
1872
1947
  borderWidth: wonderBlocksTokens.border.width.hairline,
1873
1948
  color: placeholder ? wonderBlocksTokens.semanticColor.text.secondary : currentState.foreground,
1874
- ":hover:not([aria-disabled=true])": focusHoverStyling,
1949
+ ":hover:not([aria-disabled=true])": hoverStyling,
1875
1950
  ["@media not (hover: hover)"]: {
1876
1951
  ":hover:not([aria-disabled=true])": {
1877
1952
  borderColor: currentState.border,
@@ -1880,7 +1955,7 @@ const _generateStyles = (placeholder, error) => {
1880
1955
  paddingRight: wonderBlocksTokens.spacing.small_12
1881
1956
  }
1882
1957
  },
1883
- ":focus-visible:not([aria-disabled=true])": focusHoverStyling,
1958
+ ":focus-visible:not([aria-disabled=true])": focusStyling,
1884
1959
  ":active:not([aria-disabled=true])": pressStyling
1885
1960
  },
1886
1961
  disabled: {
@@ -1889,7 +1964,7 @@ const _generateStyles = (placeholder, error) => {
1889
1964
  color: states.disabled.foreground,
1890
1965
  cursor: "not-allowed",
1891
1966
  ":focus-visible": _extends__default["default"]({
1892
- outlineColor: wonderBlocksTokens.semanticColor.action.disabled.default
1967
+ outlineColor: wonderBlocksTokens.semanticColor.focus.outer
1893
1968
  }, sharedOutlineStyling)
1894
1969
  },
1895
1970
  press: pressStyling
@@ -2808,7 +2883,7 @@ const styles$2 = aphrodite.StyleSheet.create({
2808
2883
  paddingInlineEnd: wonderBlocksTokens.spacing.xxxSmall_4
2809
2884
  },
2810
2885
  pillFocused: {
2811
- outline: `1px solid ${wonderBlocksTokens.color.blue}`
2886
+ outline: `1px solid ${wonderBlocksTokens.semanticColor.focus.outer}`
2812
2887
  }
2813
2888
  });
2814
2889
 
@@ -2893,12 +2968,21 @@ function Listbox(props) {
2893
2968
  "aria-multiselectable": selectionType === "multiple"
2894
2969
  }, children);
2895
2970
  }
2971
+ const theme$1 = {
2972
+ listbox: {
2973
+ color: {
2974
+ disabled: {
2975
+ foreground: wonderBlocksTokens.semanticColor.action.secondary.disabled.foreground
2976
+ }
2977
+ }
2978
+ }
2979
+ };
2896
2980
  const styles$1 = aphrodite.StyleSheet.create({
2897
2981
  listbox: {
2898
2982
  outline: "none"
2899
2983
  },
2900
2984
  disabled: {
2901
- color: wonderBlocksTokens.color.offBlack64
2985
+ color: theme$1.listbox.color.disabled.foreground
2902
2986
  }
2903
2987
  });
2904
2988
 
@@ -3066,7 +3150,7 @@ function Combobox({
3066
3150
  const startIconElement = React__namespace.cloneElement(startIcon, _extends__default["default"]({
3067
3151
  size: "small"
3068
3152
  }, startIcon.props, {
3069
- color: disabled ? wonderBlocksTokens.color.offBlack32 : (_startIcon$props$colo = startIcon.props.color) != null ? _startIcon$props$colo : wonderBlocksTokens.semanticColor.icon.primary
3153
+ color: disabled ? wonderBlocksTokens.semanticColor.icon.disabled : (_startIcon$props$colo = startIcon.props.color) != null ? _startIcon$props$colo : wonderBlocksTokens.semanticColor.icon.primary
3070
3154
  }));
3071
3155
  return React__namespace.createElement(wonderBlocksCore.View, {
3072
3156
  style: styles.iconWrapper
@@ -3175,6 +3259,38 @@ function Combobox({
3175
3259
  }, renderList));
3176
3260
  }));
3177
3261
  }
3262
+ const theme = {
3263
+ combobox: {
3264
+ color: {
3265
+ default: {
3266
+ border: wonderBlocksTokens.semanticColor.border.strong,
3267
+ background: wonderBlocksTokens.semanticColor.surface.primary
3268
+ },
3269
+ focus: {
3270
+ border: wonderBlocksTokens.semanticColor.focus.outer,
3271
+ background: wonderBlocksTokens.semanticColor.surface.primary
3272
+ },
3273
+ disabled: {
3274
+ border: wonderBlocksTokens.semanticColor.action.secondary.disabled.border,
3275
+ background: wonderBlocksTokens.semanticColor.action.secondary.disabled.background,
3276
+ foreground: wonderBlocksTokens.semanticColor.action.secondary.disabled.foreground
3277
+ },
3278
+ error: {
3279
+ border: wonderBlocksTokens.semanticColor.status.critical.foreground,
3280
+ background: wonderBlocksTokens.semanticColor.status.critical.background,
3281
+ foreground: wonderBlocksTokens.semanticColor.text.primary
3282
+ }
3283
+ }
3284
+ },
3285
+ listbox: {
3286
+ color: {
3287
+ default: {
3288
+ background: wonderBlocksTokens.semanticColor.surface.primary,
3289
+ border: wonderBlocksTokens.semanticColor.border.primary
3290
+ }
3291
+ }
3292
+ }
3293
+ };
3178
3294
  const styles = aphrodite.StyleSheet.create({
3179
3295
  wrapper: {
3180
3296
  flexDirection: "row",
@@ -3182,24 +3298,24 @@ const styles = aphrodite.StyleSheet.create({
3182
3298
  width: "100%",
3183
3299
  maxWidth: "100%",
3184
3300
  flexWrap: "wrap",
3185
- background: wonderBlocksTokens.color.white,
3301
+ background: theme.combobox.color.default.background,
3186
3302
  borderRadius: wonderBlocksTokens.border.radius.medium_4,
3187
- border: `solid 1px ${wonderBlocksTokens.color.offBlack50}`,
3303
+ border: `solid 1px ${theme.combobox.color.default.border}`,
3188
3304
  paddingInline: wonderBlocksTokens.spacing.xSmall_8
3189
3305
  },
3190
3306
  focused: {
3191
- background: wonderBlocksTokens.color.white,
3192
- border: `1px solid ${wonderBlocksTokens.color.blue}`
3307
+ background: theme.combobox.color.focus.background,
3308
+ border: `1px solid ${theme.combobox.color.focus.border}`
3193
3309
  },
3194
3310
  disabled: {
3195
- background: wonderBlocksTokens.color.offWhite,
3196
- border: `1px solid ${wonderBlocksTokens.color.offBlack16}`,
3197
- color: wonderBlocksTokens.color.offBlack64
3311
+ background: theme.combobox.color.disabled.background,
3312
+ border: `1px solid ${theme.combobox.color.disabled.border}`,
3313
+ color: theme.combobox.color.disabled.foreground
3198
3314
  },
3199
3315
  error: {
3200
- background: wonderBlocksTokens.color.fadedRed8,
3201
- border: `1px solid ${wonderBlocksTokens.color.red}`,
3202
- color: wonderBlocksTokens.color.offBlack
3316
+ background: theme.combobox.color.error.background,
3317
+ border: `1px solid ${theme.combobox.color.error.border}`,
3318
+ color: theme.combobox.color.error.foreground
3203
3319
  },
3204
3320
  combobox: {
3205
3321
  appearance: "none",
@@ -3217,9 +3333,9 @@ const styles = aphrodite.StyleSheet.create({
3217
3333
  }
3218
3334
  },
3219
3335
  listbox: {
3220
- backgroundColor: wonderBlocksTokens.color.white,
3336
+ backgroundColor: theme.listbox.color.default.background,
3221
3337
  borderRadius: wonderBlocksTokens.border.radius.medium_4,
3222
- border: `solid 1px ${wonderBlocksTokens.color.offBlack16}`,
3338
+ border: `solid ${wonderBlocksTokens.border.width.hairline}px ${theme.listbox.color.default.border}`,
3223
3339
  boxShadow: `0px ${wonderBlocksTokens.spacing.xSmall_8}px ${wonderBlocksTokens.spacing.xSmall_8}px 0px ${wonderBlocksTokens.color.offBlack8}`,
3224
3340
  maxHeight: "var(--popper-max-height)",
3225
3341
  overflowY: "auto"