@splunk/react-ui 4.32.0 → 4.34.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.
Files changed (80) hide show
  1. package/Button.js +59 -65
  2. package/ButtonGroup.js +20 -23
  3. package/ButtonSimple.js +374 -339
  4. package/CHANGELOG.md +54 -0
  5. package/Card.js +56 -44
  6. package/Chip.js +2 -6
  7. package/Clickable.js +21 -19
  8. package/CollapsiblePanel.js +281 -264
  9. package/Color.js +88 -86
  10. package/Concertina.js +7 -7
  11. package/ControlGroup.js +18 -18
  12. package/DualListbox.js +8 -11
  13. package/File.js +25 -30
  14. package/FormRows.js +232 -210
  15. package/Image.js +13 -13
  16. package/JSONTree.js +22 -22
  17. package/MIGRATION.mdx +99 -0
  18. package/Markdown.js +12 -12
  19. package/Menu.js +505 -719
  20. package/Message.js +205 -204
  21. package/MessageBar.js +104 -104
  22. package/Modal.js +158 -133
  23. package/Multiselect.js +81 -70
  24. package/Paginator.js +8 -8
  25. package/Popover.js +53 -54
  26. package/Progress.js +45 -46
  27. package/RadioBar.js +117 -115
  28. package/RadioList.js +8 -5
  29. package/ResultsMenu.js +256 -261
  30. package/Search.js +21 -24
  31. package/Select.js +265 -246
  32. package/Slider.js +9 -9
  33. package/SplitButton.js +1 -4
  34. package/StaticContent.js +1 -1
  35. package/StepBar.js +1 -1
  36. package/Switch.js +169 -171
  37. package/TabBar.js +14 -6
  38. package/Table.js +65 -67
  39. package/Text.js +30 -37
  40. package/TextArea.js +162 -163
  41. package/Tooltip.js +1 -1
  42. package/package.json +9 -9
  43. package/stubs-splunkui.d.ts +11 -0
  44. package/types/src/Button/Button.d.ts +4 -4
  45. package/types/src/ButtonSimple/ButtonSimple.d.ts +8 -6
  46. package/types/src/ButtonSimple/mixin.d.ts +2 -2
  47. package/types/src/Card/Card.d.ts +3 -1
  48. package/types/src/Card/Header.d.ts +22 -3
  49. package/types/src/Clickable/Clickable.d.ts +3 -2
  50. package/types/src/CollapsiblePanel/CollapsiblePanel.d.ts +5 -0
  51. package/types/src/CollapsiblePanel/icons/ExpandPanel.d.ts +1 -3
  52. package/types/src/Date/Date.d.ts +2 -2
  53. package/types/src/Menu/Item.d.ts +3 -1
  54. package/types/src/Menu/Menu.d.ts +16 -21
  55. package/types/src/Menu/MenuContext.d.ts +3 -2
  56. package/types/src/Number/Number.d.ts +2 -2
  57. package/types/src/RadioBar/Option.d.ts +4 -1
  58. package/types/src/RadioBar/RadioBar.d.ts +6 -4
  59. package/types/src/RadioBar/docs/examples/MenuBar.d.ts +2 -0
  60. package/types/src/ResultsMenu/ResultsMenu.d.ts +5 -22
  61. package/types/src/Select/Select.d.ts +8 -4
  62. package/types/src/Select/SelectBase.d.ts +8 -4
  63. package/types/src/Slider/Slider.d.ts +2 -2
  64. package/types/src/Table/Body.d.ts +0 -4
  65. package/types/src/Text/docs/examples/Basic.d.ts +1 -9
  66. package/types/src/Text/docs/examples/Error.d.ts +2 -10
  67. package/types/src/Text/docs/examples/Inline.d.ts +1 -9
  68. package/types/src/Text/docs/examples/Multiline.d.ts +1 -9
  69. package/types/src/Text/docs/examples/Password.d.ts +1 -9
  70. package/types/src/Text/docs/examples/Search.d.ts +1 -9
  71. package/useRovingFocus.js +26 -40
  72. package/types/src/Button/docs/examples/prisma/Basic.d.ts +0 -2
  73. package/types/src/Button/docs/examples/prisma/Block.d.ts +0 -2
  74. package/types/src/Button/docs/examples/prisma/Disabled.d.ts +0 -2
  75. package/types/src/Button/docs/examples/prisma/Icons.d.ts +0 -2
  76. package/types/src/Button/docs/examples/prisma/Menus.d.ts +0 -2
  77. package/types/src/Button/docs/examples/prisma/To.d.ts +0 -2
  78. package/types/src/Button/docs/examples/prisma/Truncated.d.ts +0 -2
  79. package/types/src/Select/docs/examples/prisma/Appearance.d.ts +0 -14
  80. /package/types/src/{Button/docs/examples/prisma → Clickable/docs/examples}/Dimmed.d.ts +0 -0
package/Select.js CHANGED
@@ -64,7 +64,7 @@
64
64
  Divider: () => /* reexport */ T.Divider,
65
65
  Heading: () => /* reexport */ T.Heading,
66
66
  Option: () => /* reexport */ nn,
67
- default: () => /* reexport */ wn
67
+ default: () => /* reexport */ xn
68
68
  });
69
69
  // CONCATENATED MODULE: external "react"
70
70
  const n = require("react");
@@ -76,10 +76,10 @@
76
76
  const a = require("lodash/has");
77
77
  var l = e.n(a);
78
78
  // CONCATENATED MODULE: external "@splunk/ui-utils/i18n"
79
- const c = require("@splunk/ui-utils/i18n");
79
+ const s = require("@splunk/ui-utils/i18n");
80
80
  // CONCATENATED MODULE: external "lodash/castArray"
81
- const s = require("lodash/castArray");
82
- var u = e.n(s);
81
+ const c = require("lodash/castArray");
82
+ var u = e.n(c);
83
83
  // CONCATENATED MODULE: external "lodash/find"
84
84
  const p = require("lodash/find");
85
85
  var f = e.n(p);
@@ -97,13 +97,13 @@
97
97
  var O = e.n(g);
98
98
  // CONCATENATED MODULE: external "lodash/memoize"
99
99
  const S = require("lodash/memoize");
100
- var w = e.n(S);
100
+ var x = e.n(S);
101
101
  // CONCATENATED MODULE: external "lodash/omit"
102
- const x = require("lodash/omit");
103
- var k = e.n(x);
102
+ const w = require("lodash/omit");
103
+ var C = e.n(w);
104
104
  // CONCATENATED MODULE: external "lodash/pick"
105
- const C = require("lodash/pick");
106
- var I = e.n(C);
105
+ const k = require("lodash/pick");
106
+ var I = e.n(k);
107
107
  // CONCATENATED MODULE: external "lodash/uniq"
108
108
  const _ = require("lodash/uniq");
109
109
  var A = e.n(_);
@@ -122,8 +122,8 @@
122
122
  // CONCATENATED MODULE: external "@splunk/ui-utils/filter"
123
123
  const D = require("@splunk/ui-utils/filter");
124
124
  // CONCATENATED MODULE: external "@splunk/react-ui/Link"
125
- const q = require("@splunk/react-ui/Link");
126
- var L = e.n(q);
125
+ const L = require("@splunk/react-ui/Link");
126
+ var q = e.n(L);
127
127
  // CONCATENATED MODULE: external "@splunk/react-ui/ResultsMenu"
128
128
  const N = require("@splunk/react-ui/ResultsMenu");
129
129
  var B = e.n(N);
@@ -150,17 +150,17 @@
150
150
  };
151
151
  /* harmony default export */ const J = G;
152
152
  // CONCATENATED MODULE: external "@splunk/react-icons/enterprise/Search"
153
- const Q = require("@splunk/react-icons/enterprise/Search");
154
- var X = e.n(Q);
153
+ const X = require("@splunk/react-icons/enterprise/Search");
154
+ var Y = e.n(X);
155
155
  // CONCATENATED MODULE: external "@splunk/react-icons/Magnifier"
156
- const Y = require("@splunk/react-icons/Magnifier");
157
- var Z = e.n(Y);
156
+ const Q = require("@splunk/react-icons/Magnifier");
157
+ var Z = e.n(Q);
158
158
  // CONCATENATED MODULE: ./src/Select/icons/Search.tsx
159
159
  var ee = function e() {
160
160
  var t = (0, U.useSplunkTheme)(), n = t.isEnterprise, o = t.isCompact;
161
- var i = (0, c._)("Search");
161
+ var i = (0, s._)("Search");
162
162
  var a = o ? "20px" : "24px";
163
- var l = n ? r().createElement(X(), {
163
+ var l = n ? r().createElement(Y(), {
164
164
  role: "presentation",
165
165
  size: "16px",
166
166
  screenReaderText: i,
@@ -243,12 +243,12 @@
243
243
  Object.defineProperty(e, r.key, r);
244
244
  }
245
245
  }
246
- function ce(e, t, n) {
246
+ function se(e, t, n) {
247
247
  if (t) le(e.prototype, t);
248
248
  if (n) le(e, n);
249
249
  return e;
250
250
  }
251
- function se(e, t) {
251
+ function ce(e, t) {
252
252
  if (typeof t !== "function" && t !== null) {
253
253
  throw new TypeError("Super expression must either be null or a function");
254
254
  }
@@ -360,7 +360,7 @@
360
360
  * [PureComponent](https://reactjs.org/docs/react-api.html#reactpurecomponent)
361
361
  * so any elements passed to it must also be pure.
362
362
  */ var ge = function(e) {
363
- se(n, e);
363
+ ce(n, e);
364
364
  var t = pe(n);
365
365
  function n() {
366
366
  var e;
@@ -383,7 +383,7 @@
383
383
  }));
384
384
  return e;
385
385
  }
386
- ce(n, [ {
386
+ se(n, [ {
387
387
  key: "scrollIntoViewIfNeeded",
388
388
  value: function e() {
389
389
  var t;
@@ -424,13 +424,13 @@
424
424
  /* harmony default export */ const Oe = ge;
425
425
  // CONCATENATED MODULE: external "styled-components"
426
426
  const Se = require("styled-components");
427
- var we = e.n(Se);
427
+ var xe = e.n(Se);
428
428
  // CONCATENATED MODULE: external "@splunk/react-ui/Clickable"
429
- const xe = require("@splunk/react-ui/Clickable");
430
- var ke = e.n(xe);
429
+ const we = require("@splunk/react-ui/Clickable");
430
+ var Ce = e.n(we);
431
431
  // CONCATENATED MODULE: external "@splunk/react-ui/Switch"
432
- const Ce = require("@splunk/react-ui/Switch");
433
- var Ie = e.n(Ce);
432
+ const ke = require("@splunk/react-ui/Switch");
433
+ var Ie = e.n(ke);
434
434
  // CONCATENATED MODULE: ./src/Menu/ItemStyles.ts
435
435
  var _e = (0, Se.css)([ "color:", ";font-size:", ";line-height:", ";overflow:inherit;white-space:inherit;text-overflow:inherit;" ], (0,
436
436
  U.pick)({
@@ -439,15 +439,18 @@
439
439
  }), U.variables.fontSizeSmall, (0, U.pick)({
440
440
  prisma: "16px"
441
441
  }));
442
- var Ae = we().span.withConfig({
442
+ var Ae = xe().span.withConfig({
443
443
  displayName: "ItemStyles__StyledItemDescriptionBottom",
444
444
  componentId: "sc-4kc053-0"
445
445
  })([ "", ";display:block;" ], _e);
446
- var je = we().span.withConfig({
446
+ var je = xe().span.withConfig({
447
447
  displayName: "ItemStyles__StyledItemDescriptionRight",
448
448
  componentId: "sc-4kc053-1"
449
- })([ "", ";float:right;padding-left:", ";max-width:50%;text-align:right;box-sizing:border-box;" ], _e, U.variables.spacing);
450
- var Ee = we().div.withConfig({
449
+ })([ "", ";float:right;", " max-width:50%;text-align:right;box-sizing:border-box;" ], _e, (0,
450
+ U.pick)({
451
+ enterprise: (0, Se.css)([ "padding-left:", ";" ], U.variables.spacingLarge)
452
+ }));
453
+ var Ee = xe().div.withConfig({
451
454
  displayName: "ItemStyles__StyledItemSelectedIcon",
452
455
  componentId: "sc-4kc053-2"
453
456
  })([ "position:absolute;", " color:", ";" ], (0, U.pick)({
@@ -457,7 +460,7 @@
457
460
  prisma: U.variables.contentColorActive,
458
461
  enterprise: U.variables.accentColorL10
459
462
  }));
460
- var Me = we().span.withConfig({
463
+ var Me = xe().span.withConfig({
461
464
  displayName: "ItemStyles__StyledItemIcon",
462
465
  componentId: "sc-4kc053-3"
463
466
  })([ "flex:0 0 auto;padding-right:", ";min-width:10px;display:inline-block;text-align:center;vertical-align:", ";", "" ], (0,
@@ -471,7 +474,7 @@
471
474
  prisma: (0, Se.css)([ "color:", ";display:inline-flex;align-items:center;min-width:20px;min-height:20px;& > svg{width:20px;height:20px;}" ], U.variables.contentColorMuted),
472
475
  enterprise: (0, Se.css)([ "transform:translateY(-1px);" ])
473
476
  }));
474
- var Te = we()(ke()).withConfig({
477
+ var Te = xe()(Ce()).withConfig({
475
478
  displayName: "ItemStyles__StyledClickable",
476
479
  componentId: "sc-4kc053-4"
477
480
  })([ "display:block;position:relative;cursor:pointer;color:", ";word-wrap:break-word;max-width:100%;width:100%;padding:", ";", " ", " ", " &:not([disabled]){&:hover{background:", ";", "}&:focus{outline:0;box-shadow:", ";", "}", " ", "}&[disabled]{color:", ";cursor:not-allowed;", ",", "{color:inherit;}", "{cursor:not-allowed;color:", ";}", "}", "" ], (0,
@@ -553,7 +556,7 @@
553
556
  Me, U.variables.contentColorActive)
554
557
  });
555
558
  }));
556
- var Pe = we()(Ie()).withConfig({
559
+ var Pe = xe()(Ie()).withConfig({
557
560
  displayName: "ItemStyles__StyledSwitch",
558
561
  componentId: "sc-4kc053-5"
559
562
  })([ "position:absolute;left:", ";top:", ";" ], (0, U.pick)({
@@ -566,25 +569,25 @@
566
569
  compact: "2px"
567
570
  }
568
571
  }));
569
- var Ve = we().span.withConfig({
572
+ var Ve = xe().span.withConfig({
570
573
  displayName: "ItemStyles__StyledInnerWrapper",
571
574
  componentId: "sc-4kc053-6"
572
575
  })([ "display:flex;align-items:flex-start;" ]);
573
- var Re = we().span.withConfig({
576
+ var Re = xe().span.withConfig({
574
577
  displayName: "ItemStyles__StyledTitleAndDescriptionWrapper",
575
578
  componentId: "sc-4kc053-7"
576
579
  })([ "display:flex;flex-wrap:wrap;flex-direction:column;max-width:100%;width:100%;align-self:center;word-break:break-word;white-space:normal;", "" ], (function(e) {
577
580
  var t = e.$truncate;
578
581
  return t && (0, Se.css)([ "white-space:nowrap;overflow:hidden;text-overflow:ellipsis;" ]);
579
582
  }));
580
- var De = we().div.withConfig({
583
+ var De = xe().div.withConfig({
581
584
  displayName: "ItemStyles__StyledLabel",
582
585
  componentId: "sc-4kc053-8"
583
586
  })([ "overflow:inherit;white-space:inherit;text-overflow:inherit;max-width:100%;min-height:20px;", "" ], (function(e) {
584
587
  var t = e.$truncate;
585
588
  return t && (0, Se.css)([ "display:block;clear:both;" ]);
586
589
  }));
587
- var qe = we().span.withConfig({
590
+ var Le = xe().span.withConfig({
588
591
  displayName: "ItemStyles__StyledMatch",
589
592
  componentId: "sc-4kc053-9"
590
593
  })([ "border-bottom:1px solid ", ";" ], (0, U.pick)({
@@ -594,7 +597,7 @@
594
597
  light: U.variables.gray45
595
598
  }
596
599
  }));
597
- var Le = we().span.withConfig({
600
+ var qe = xe().span.withConfig({
598
601
  displayName: "ItemStyles__StyledSubmenu",
599
602
  componentId: "sc-4kc053-10"
600
603
  })([ "float:right;padding-left:", ";color:", ";", "" ], U.variables.spacingSmall, (0,
@@ -605,11 +608,11 @@
605
608
  prisma: (0, Se.css)([ "& > svg{width:20px;height:20px;}" ])
606
609
  }));
607
610
  // CONCATENATED MODULE: ./src/Select/SelectAllOptionStyles.ts
608
- var Ne = we()(De).withConfig({
611
+ var Ne = xe()(De).withConfig({
609
612
  displayName: "SelectAllOptionStyles__StyledSelectAllLabel",
610
613
  componentId: "y6bn08-0"
611
614
  })([ "font-weight:", ";" ], U.variables.fontWeightBold);
612
- var Be = we()(Oe).withConfig({
615
+ var Be = xe()(Oe).withConfig({
613
616
  displayName: "SelectAllOptionStyles__StyledSelectAllOption",
614
617
  componentId: "y6bn08-1"
615
618
  })([ "padding-inline-start:", ";box-shadow:none;" ], (0, U.pick)({
@@ -628,9 +631,9 @@
628
631
  selected: i().oneOf([ false, true, "some" ])
629
632
  };
630
633
  var Fe = r().forwardRef((function(e, t) {
631
- var n = e.active, o = e.id, i = e.onClick, a = e.selectAllLabel, l = e.totalCount, s = e.changedToggle, u = e.selected;
634
+ var n = e.active, o = e.id, i = e.onClick, a = e.selectAllLabel, l = e.totalCount, c = e.changedToggle, u = e.selected;
632
635
  // When toggle is changed the total count is not displayed anymore so the count is now shown in the Select all menu item
633
- var p = s ? " (".concat(l === null || l === void 0 ? void 0 : l.toString(), ")") : "";
636
+ var p = c ? " (".concat(l === null || l === void 0 ? void 0 : l.toString(), ")") : "";
634
637
 
635
638
  return r().createElement(Be, {
636
639
  label: a,
@@ -649,12 +652,12 @@
649
652
  key: "main-checkbox",
650
653
  value: "main-checkbox",
651
654
  appearance: "checkbox",
652
- "aria-label": !u && (0, c._)("No options selected") || u === "some" && (0, c._)("Some options selected") || (0,
653
- c._)("All options selected"),
655
+ "aria-label": !u && (0, s._)("No options selected") || u === "some" && (0, s._)("Some options selected") || (0,
656
+ s._)("All options selected"),
654
657
  "data-test": "select-all-switch",
655
- selectedLabel: u === true ? (0, c._)("All options selected") : (0, c._)("Option selected"),
656
- unselectedLabel: u === true ? (0, c._)("No options selected") : (0, c._)("Option unselected"),
657
- someSelectedLabel: (0, c._)("Some options selected")
658
+ selectedLabel: u === true ? (0, s._)("All options selected") : (0, s._)("Option selected"),
659
+ unselectedLabel: u === true ? (0, s._)("No options selected") : (0, s._)("Option unselected"),
660
+ someSelectedLabel: (0, s._)("Some options selected")
658
661
  }), r().createElement(je, {
659
662
  "data-test": "description"
660
663
  }, "".concat(p, " Ctrl-a")), r().createElement(Ve, null, r().createElement(Re, {
@@ -669,7 +672,7 @@
669
672
  const $e = require("@splunk/react-ui/Button");
670
673
  var ze = e.n($e);
671
674
  // CONCATENATED MODULE: ./src/Select/SelectBaseStyles.ts
672
- var We = we()(ze()).withConfig({
675
+ var We = xe()(ze()).withConfig({
673
676
  displayName: "SelectBaseStyles__StyledButton",
674
677
  componentId: "sc-16cj7sk-0"
675
678
  })([ "&[data-inline]{width:", ";}", "" ], (function(e) {
@@ -679,22 +682,22 @@
679
682
  var t = e.$multiple;
680
683
  return !t && "flex-grow: 0;";
681
684
  }));
682
- var Ue = we().span.withConfig({
685
+ var Ue = xe().span.withConfig({
683
686
  displayName: "SelectBaseStyles__StyledLinkIcon",
684
687
  componentId: "sc-16cj7sk-1"
685
688
  })([ "padding-right:2px;" ]);
686
- var Ge = we().span.withConfig({
689
+ var Ge = xe().span.withConfig({
687
690
  displayName: "SelectBaseStyles__StyledLinkCaret",
688
691
  componentId: "sc-16cj7sk-2"
689
692
  })([ "padding-left:2px;" ]);
690
- var Je = we().div.withConfig({
693
+ var Je = xe().div.withConfig({
691
694
  displayName: "SelectBaseStyles__StyledFilter",
692
695
  componentId: "sc-16cj7sk-3"
693
696
  })([ "padding:", ";min-width:160px;" ], (0, U.pick)({
694
697
  enterprise: "8px",
695
698
  prisma: "10px 16px"
696
699
  }));
697
- var Qe = we().span.withConfig({
700
+ var Xe = xe().span.withConfig({
698
701
  displayName: "SelectBaseStyles__StyledSearchIconWrapper",
699
702
  componentId: "sc-16cj7sk-4"
700
703
  })([ "color:", ";pointer-events:none;padding:", ";" ], (0, U.pick)({
@@ -707,21 +710,18 @@
707
710
  comfortable: "0 8px",
708
711
  compact: "0 6px"
709
712
  }));
710
- var Xe = we().span.withConfig({
713
+ var Ye = xe().span.withConfig({
711
714
  displayName: "SelectBaseStyles__StyledCount",
712
715
  componentId: "sc-16cj7sk-5"
713
- })([ "padding-right:", ";" ], (0, U.pick)({
714
- enterprise: U.variables.spacingQuarter,
715
- prisma: U.variables.spacingXSmall
716
- }));
717
- var Ye = we()(L()).withConfig({
716
+ })([ "padding-right:", ";" ], U.variables.spacingXSmall);
717
+ var Qe = xe()(q()).withConfig({
718
718
  displayName: "SelectBaseStyles__StyledControlsLink",
719
719
  componentId: "sc-16cj7sk-6"
720
720
  })([ "margin-right:20px;", ";" ], (function(e) {
721
721
  var t = e.$disabled;
722
722
  return t && (0, Se.css)([ "color:", ";" ], U.variables.contentColorDisabled);
723
723
  }));
724
- var Ze = we().div.withConfig({
724
+ var Ze = xe().div.withConfig({
725
725
  displayName: "SelectBaseStyles__StyledToggleAllControls",
726
726
  componentId: "sc-16cj7sk-7"
727
727
  })([ "padding:", ";", "" ], (0, U.pick)({
@@ -911,12 +911,12 @@
911
911
  return at.apply(this, arguments);
912
912
  }
913
913
  function lt(e, t) {
914
- return ut(e) || st(e, t) || dt(e, t) || ct();
914
+ return ut(e) || ct(e, t) || dt(e, t) || st();
915
915
  }
916
- function ct() {
916
+ function st() {
917
917
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
918
918
  }
919
- function st(e, t) {
919
+ function ct(e, t) {
920
920
  if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(e))) return;
921
921
  var n = [];
922
922
  var r = true;
@@ -1008,8 +1008,8 @@
1008
1008
  };
1009
1009
  return St(e, t);
1010
1010
  }
1011
- function wt(e) {
1012
- var t = Ct();
1011
+ function xt(e) {
1012
+ var t = kt();
1013
1013
  return function n() {
1014
1014
  var r = It(e), o;
1015
1015
  if (t) {
@@ -1018,22 +1018,22 @@
1018
1018
  } else {
1019
1019
  o = r.apply(this, arguments);
1020
1020
  }
1021
- return xt(this, o);
1021
+ return wt(this, o);
1022
1022
  };
1023
1023
  }
1024
- function xt(e, t) {
1024
+ function wt(e, t) {
1025
1025
  if (t && (_t(t) === "object" || typeof t === "function")) {
1026
1026
  return t;
1027
1027
  }
1028
- return kt(e);
1028
+ return Ct(e);
1029
1029
  }
1030
- function kt(e) {
1030
+ function Ct(e) {
1031
1031
  if (e === void 0) {
1032
1032
  throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
1033
1033
  }
1034
1034
  return e;
1035
1035
  }
1036
- function Ct() {
1036
+ function kt() {
1037
1037
  if (typeof Reflect === "undefined" || !Reflect.construct) return false;
1038
1038
  if (Reflect.construct.sham) return false;
1039
1039
  if (typeof Proxy === "function") return true;
@@ -1108,7 +1108,7 @@
1108
1108
  allowKeyMatching: i().bool,
1109
1109
  allowNewValues: i().bool,
1110
1110
  animateLoading: i().bool,
1111
- appearance: i().oneOf([ "default", "link", "primary", "pill", "toggle", "flat" ]),
1111
+ appearance: i().oneOf([ "default", "link", "primary", "pill", "toggle", "flat", "subtle" ]),
1112
1112
  append: i().bool,
1113
1113
  children: i().node,
1114
1114
  defaultPlacement: i().oneOf([ "above", "below", "vertical" ]),
@@ -1146,6 +1146,7 @@
1146
1146
  showSelectedValuesFirst: i().oneOf([ "nextOpen", "immediately", "never" ]),
1147
1147
  suffixLabel: i().string,
1148
1148
  tabConfirmsNewValue: i().bool,
1149
+ toggleContent: i().oneOf([ "optionChildren", "optionLabel" ]),
1149
1150
  values: i().array,
1150
1151
  /** @private. */
1151
1152
  virtualization: i().number
@@ -1163,18 +1164,19 @@
1163
1164
  isLoadingOptions: false,
1164
1165
  menuStyle: {},
1165
1166
  multiple: false,
1166
- noOptionsMessage: (0, c._)("No matches"),
1167
- placeholder: (0, c._)("Select..."),
1167
+ noOptionsMessage: (0, s._)("No matches"),
1168
+ placeholder: (0, s._)("Select..."),
1168
1169
  prepend: false,
1169
1170
  repositionMode: "flip",
1170
1171
  selectAllAppearance: "buttongroup",
1171
- tabConfirmsNewValue: false
1172
+ tabConfirmsNewValue: false,
1173
+ toggleContent: "optionChildren"
1172
1174
  };
1173
- var Pt = w()((function(e) {
1175
+ var Pt = x()((function(e) {
1174
1176
  return [ e ];
1175
1177
  }));
1176
1178
  // preserve separate widths for single vs. multi mode
1177
- var Vt = w()((function(e) {
1179
+ var Vt = x()((function(e) {
1178
1180
  var t = e.anchorWidth, n = e.isMultiple, r = e.maxHeight, o = e.menuStyle;
1179
1181
  return n ? jt({
1180
1182
  width: Math.max(t !== null && t !== void 0 ? t : 0, 200),
@@ -1189,12 +1191,12 @@
1189
1191
  function Dt(e) {
1190
1192
  return e && l()(e.props, "value");
1191
1193
  }
1192
- function qt(e, t) {
1194
+ function Lt(e, t) {
1193
1195
  return "".concat(_t(e), "-").concat(e, "-").concat(t);
1194
1196
  }
1195
- var Lt = function(e) {
1197
+ var qt = function(e) {
1196
1198
  Ot(o, e);
1197
- var t = wt(o);
1199
+ var t = xt(o);
1198
1200
  gt(o, null, [ {
1199
1201
  key: "validateAppearance",
1200
1202
  // @docs-props-type CompactPropsBase
@@ -1206,41 +1208,41 @@
1206
1208
  var i;
1207
1209
  mt(this, o);
1208
1210
  i = t.call(this, e);
1209
- Et(kt(i), "activeItemId", void 0);
1210
- Et(kt(i), "activeValue", void 0);
1211
- Et(kt(i), "availableOptionCount", void 0);
1212
- Et(kt(i), "controlledExternally", void 0);
1213
- Et(kt(i), "displayedValues", void 0);
1214
- Et(kt(i), "dropdown", null);
1215
- Et(kt(i), "firstSelectedEnabledOption", null);
1216
- Et(kt(i), "firstSelectedOptionIndex", void 0);
1217
- Et(kt(i), "menuId", void 0);
1218
- Et(kt(i), "menuListboxId", void 0);
1219
- Et(kt(i), "previousActiveIndex", null);
1220
- Et(kt(i), "selectedOptionCount", void 0);
1221
- Et(kt(i), "optionRefsByKey", void 0);
1222
- Et(kt(i), "matchCharacter", void 0);
1223
- Et(kt(i), "matchTimeout", void 0);
1224
- Et(kt(i), "currentMatchOptions", void 0);
1225
- Et(kt(i), "availableMatchOptions", void 0);
1226
- Et(kt(i), "optionSelection", void 0);
1227
- Et(kt(i), "resetMatches", (function() {
1211
+ Et(Ct(i), "activeItemId", void 0);
1212
+ Et(Ct(i), "activeValue", void 0);
1213
+ Et(Ct(i), "availableOptionCount", void 0);
1214
+ Et(Ct(i), "controlledExternally", void 0);
1215
+ Et(Ct(i), "displayedValues", void 0);
1216
+ Et(Ct(i), "dropdown", null);
1217
+ Et(Ct(i), "firstSelectedEnabledOption", null);
1218
+ Et(Ct(i), "firstSelectedOptionIndex", void 0);
1219
+ Et(Ct(i), "menuId", void 0);
1220
+ Et(Ct(i), "menuListboxId", void 0);
1221
+ Et(Ct(i), "previousActiveIndex", null);
1222
+ Et(Ct(i), "selectedOptionCount", void 0);
1223
+ Et(Ct(i), "optionRefsByKey", void 0);
1224
+ Et(Ct(i), "matchCharacter", void 0);
1225
+ Et(Ct(i), "matchTimeout", void 0);
1226
+ Et(Ct(i), "currentMatchOptions", void 0);
1227
+ Et(Ct(i), "availableMatchOptions", void 0);
1228
+ Et(Ct(i), "optionSelection", void 0);
1229
+ Et(Ct(i), "resetMatches", (function() {
1228
1230
  i.matchCharacter = null;
1229
1231
  i.currentMatchOptions = [];
1230
1232
  if (i.matchTimeout) {
1231
1233
  clearTimeout(i.matchTimeout);
1232
1234
  }
1233
1235
  }));
1234
- Et(kt(i), "handleSelectAll", (function(e) {
1236
+ Et(Ct(i), "handleSelectAll", (function(e) {
1235
1237
  var t, n, o;
1236
- var a = i.props, l = a.name, c = a.children, s = a.multiple;
1238
+ var a = i.props, l = a.name, s = a.children, c = a.multiple;
1237
1239
  // this doesn't make sense if we can't select multiple values
1238
- if (!s) {
1240
+ if (!c) {
1239
1241
  return;
1240
1242
  }
1241
1243
  var u = (t = i.getCurrentValues()) !== null && t !== void 0 ? t : [];
1242
1244
  var p = A()(u.concat(i.displayedValues));
1243
- p = r().Children.toArray(c).filter((function(e) {
1245
+ p = r().Children.toArray(s).filter((function(e) {
1244
1246
  return Dt(e) && b()(p, e.props.value) && (!e.props.disabled || b()(u, e.props.value));
1245
1247
  })).map((function(e) {
1246
1248
  return e.props.value;
@@ -1256,17 +1258,17 @@
1256
1258
  reason: "selectAll"
1257
1259
  });
1258
1260
  }));
1259
- Et(kt(i), "handleClearAll", (function(e) {
1261
+ Et(Ct(i), "handleClearAll", (function(e) {
1260
1262
  var t, n, o;
1261
- var a = i.props, l = a.name, c = a.children, s = a.multiple;
1263
+ var a = i.props, l = a.name, s = a.children, c = a.multiple;
1262
1264
  // this doesn't make sense if we can't select multiple values
1263
- if (!s) {
1265
+ if (!c) {
1264
1266
  return;
1265
1267
  }
1266
1268
  var u = (t = i.getCurrentValues()) !== null && t !== void 0 ? t : [];
1267
1269
  var p = E().apply(void 0, [ u ].concat(pt(i.displayedValues)));
1268
1270
  // this will unselect all selected values unless those values are disabled or hidden by the filter
1269
- var f = r().Children.toArray(c).filter((function(e) {
1271
+ var f = r().Children.toArray(s).filter((function(e) {
1270
1272
  return Dt(e) && (b()(u, e.props.value) && e.props.disabled || b()(p, e.props.value));
1271
1273
  })).map((function(e) {
1272
1274
  return e.props.value;
@@ -1282,7 +1284,7 @@
1282
1284
  reason: "clearAll"
1283
1285
  });
1284
1286
  }));
1285
- Et(kt(i), "handleTextKeyDown", (function(e) {
1287
+ Et(Ct(i), "handleTextKeyDown", (function(e) {
1286
1288
  var t = i.props, r = t.children, o = t.onScrollBottom, a = t.tabConfirmsNewValue;
1287
1289
  var l = (0, R.keycode)(e.nativeEvent);
1288
1290
  if (l === "tab") {
@@ -1310,9 +1312,9 @@
1310
1312
  };
1311
1313
  }));
1312
1314
  if (r && o) {
1313
- var c;
1314
- var s = n.Children.toArray(r).length - (2 + ((c = i.getCurrentValues()) !== null && c !== void 0 ? c : []).length);
1315
- if (i.state.activeIndex === s) {
1315
+ var s;
1316
+ var c = n.Children.toArray(r).length - (2 + ((s = i.getCurrentValues()) !== null && s !== void 0 ? s : []).length);
1317
+ if (i.state.activeIndex === c) {
1316
1318
  i.handleScrollBottom(e);
1317
1319
  }
1318
1320
  }
@@ -1338,7 +1340,7 @@
1338
1340
  }
1339
1341
  }
1340
1342
  }));
1341
- Et(kt(i), "handleMenuOptionClick", (function(e, t) {
1343
+ Et(Ct(i), "handleMenuOptionClick", (function(e, t) {
1342
1344
  var n = t.value;
1343
1345
  e.preventDefault();
1344
1346
  if (!i.state.open) {
@@ -1346,7 +1348,7 @@
1346
1348
  }
1347
1349
  i.toggleValue(e, n);
1348
1350
  }));
1349
- Et(kt(i), "handleMenuOptionKeyDown", (function(e, t) {
1351
+ Et(Ct(i), "handleMenuOptionKeyDown", (function(e, t) {
1350
1352
  var n = e.nativeEvent.key;
1351
1353
  // Checking for a single character to avoid complications from double-byte languages and emojis.
1352
1354
  if (n.length === 1) {
@@ -1374,11 +1376,11 @@
1374
1376
  a = l === r.length - 1 ? 0 : l + 1;
1375
1377
  }
1376
1378
  }
1377
- var c = r[a];
1378
- var s = i.optionRefsByKey[qt(c.value, c.label)];
1379
- if (s != null) {
1379
+ var s = r[a];
1380
+ var c = i.optionRefsByKey[Lt(s.value, s.label)];
1381
+ if (c != null) {
1380
1382
  var u;
1381
- (u = s.focus) === null || u === void 0 ? void 0 : u.call(s);
1383
+ (u = c.focus) === null || u === void 0 ? void 0 : u.call(c);
1382
1384
  }
1383
1385
  }
1384
1386
  i.currentMatchOptions = r;
@@ -1391,7 +1393,7 @@
1391
1393
  e.stopPropagation();
1392
1394
  }
1393
1395
  }));
1394
- Et(kt(i), "handleTextChange", (function(e, t) {
1396
+ Et(Ct(i), "handleTextChange", (function(e, t) {
1395
1397
  var n, r;
1396
1398
  var o = t.value;
1397
1399
  i.setState({
@@ -1403,17 +1405,17 @@
1403
1405
  keyword: o
1404
1406
  });
1405
1407
  }));
1406
- Et(kt(i), "handleTextFocus", (function() {
1408
+ Et(Ct(i), "handleTextFocus", (function() {
1407
1409
  i.setState({
1408
1410
  textHasFocus: true
1409
1411
  });
1410
1412
  }));
1411
- Et(kt(i), "handleTextBlur", (function() {
1413
+ Et(Ct(i), "handleTextBlur", (function() {
1412
1414
  i.setState({
1413
1415
  textHasFocus: false
1414
1416
  });
1415
1417
  }));
1416
- Et(kt(i), "handleRequestOpen", (function(e) {
1418
+ Et(Ct(i), "handleRequestOpen", (function(e) {
1417
1419
  var t = {
1418
1420
  open: true,
1419
1421
  topValues: i.getTopValues()
@@ -1442,7 +1444,7 @@
1442
1444
  }
1443
1445
  }));
1444
1446
  }));
1445
- Et(kt(i), "handleRequestClose", (function() {
1447
+ Et(Ct(i), "handleRequestClose", (function() {
1446
1448
  i.setState({
1447
1449
  open: false,
1448
1450
  activeIndex: 0
@@ -1452,18 +1454,18 @@
1452
1454
  (e = (t = i.props).onClose) === null || e === void 0 ? void 0 : e.call(t);
1453
1455
  }));
1454
1456
  }));
1455
- Et(kt(i), "handleScrollBottom", (function(e) {
1457
+ Et(Ct(i), "handleScrollBottom", (function(e) {
1456
1458
  if (i.state.open && !i.props.isLoadingOptions) {
1457
1459
  var t, n;
1458
1460
  (t = (n = i.props).onScrollBottom) === null || t === void 0 ? void 0 : t.call(n, e);
1459
1461
  }
1460
1462
  }));
1461
- Et(kt(i), "handleActiveOptionMount", (function(e) {
1463
+ Et(Ct(i), "handleActiveOptionMount", (function(e) {
1462
1464
  if (i.previousActiveIndex !== i.state.activeIndex) {
1463
1465
  e === null || e === void 0 ? void 0 : e.scrollIntoViewIfNeeded();
1464
1466
  }
1465
1467
  }));
1466
- Et(kt(i), "handleOptionMount", (function(e, t, n) {
1468
+ Et(Ct(i), "handleOptionMount", (function(e, t, n) {
1467
1469
  if (n) {
1468
1470
  i.firstSelectedEnabledOption = e;
1469
1471
  }
@@ -1473,105 +1475,117 @@
1473
1475
  i.optionRefsByKey[t] = e;
1474
1476
  }
1475
1477
  }));
1476
- Et(kt(i), "createToggle", (function() {
1478
+ Et(Ct(i), "createToggle", (function() {
1477
1479
  var e;
1478
- var t = i.props, a = t.toggle, l = t.appearance, s = t.children, u = t.describedBy, p = t.disabled, d = t.elementRef, v = t.error, h = t.inline, b = t.labelledBy, m = t.labelText, y = t.multiple, g = t.placeholder, S = t.prefixLabel, w = t.required, x = t.suffixLabel;
1479
- var C;
1480
+ var t = i.props, a = t.toggle, l = t.appearance, c = t.children, u = t.describedBy, p = t.disabled, d = t.elementRef, v = t.error, h = t.inline, b = t.labelledBy, m = t.labelText, y = t.multiple, g = t.placeholder, S = t.prefixLabel, x = t.required, w = t.suffixLabel, k = t.toggleContent;
1480
1481
  var _;
1482
+ var A;
1483
+ var j = [];
1481
1484
  // Generate buttonLabels
1482
- var A = (e = i.getCurrentValues()) !== null && e !== void 0 ? e : [];
1483
- var j = n.Children.toArray(s);
1484
- var E = A.reduce((function(e, t, n, r) {
1485
- var o = f()(j, (function(e) {
1485
+ var E = (e = i.getCurrentValues()) !== null && e !== void 0 ? e : [];
1486
+ var M = n.Children.toArray(c);
1487
+ var T = E.reduce((function(e, t, n, r) {
1488
+ var o = f()(M, (function(e) {
1486
1489
  return Dt(e) && e.props.value === t;
1487
1490
  }));
1488
1491
  if (o) {
1489
- e.push(o.props.children || o.props.label);
1492
+ var i = k !== "optionLabel" && o.props.children ? o.props.children : o.props.label;
1493
+ e.push(i);
1494
+ j.push(o.props.label);
1490
1495
  // if not in multiple mode, add the icon
1491
- if (!y && A.length === 1) {
1492
- C = o.props.icon;
1496
+ if (!y && E.length === 1) {
1497
+ _ = o.props.icon;
1493
1498
  }
1494
1499
  } else if (y) {
1495
1500
  // only add values that don't match an option in "multiple" mode to preserve old behaviour
1496
1501
  e.push(t);
1502
+ j.push(t.toString());
1497
1503
  }
1498
1504
  if (n < r.length - 1) {
1499
- e.push((0, c._)(", "));
1505
+ e.push((0, s._)(", "));
1506
+ j.push((0, s._)(", "));
1500
1507
  }
1501
1508
  return e;
1502
1509
  }), []);
1503
- _ = E;
1510
+ A = T;
1504
1511
  // only apply prefix / suffix if the label is not empty
1505
- if (_.length > 0) {
1506
- _ = i.wrapLabel({
1512
+ if (A.length > 0) {
1513
+ A = i.wrapLabel({
1507
1514
  prefixLabel: S,
1508
- label: _,
1509
- suffixLabel: x
1515
+ label: A,
1516
+ suffixLabel: w
1510
1517
  });
1511
1518
  }
1512
1519
  // single <Select> behaviour is to show the placeholder if all parts of the the label
1513
1520
  // are empty strings so we replicate this behaviour here
1514
- if (_.length === 0 || !y && _.every((function(e) {
1521
+ if (A.length === 0 || !y && A.every((function(e) {
1515
1522
  return e === "";
1516
1523
  }))) {
1517
- _ = Pt(g);
1524
+ A = Pt(g);
1525
+ // placeholder has a default value so will not be undefined
1526
+ j = Pt(g);
1518
1527
  }
1519
- var M = _;
1520
1528
  // If there's more than one item selected, read out the selected total
1521
1529
  // rather than reading out each selected item
1522
- if (_.length > 1) {
1523
- M = i.wrapLabel({
1530
+ if (A.length > 1) {
1531
+ j = i.wrapLabel({
1532
+ prefixLabel: S,
1533
+ label: [ "".concat(E.length, " items selected") ],
1534
+ suffixLabel: w
1535
+ });
1536
+ } else {
1537
+ j = i.wrapLabel({
1524
1538
  prefixLabel: S,
1525
- label: [ "".concat(A.length, " items selected") ],
1526
- suffixLabel: x
1539
+ label: j,
1540
+ suffixLabel: w
1527
1541
  });
1528
1542
  }
1529
- var T = jt({
1543
+ var P = jt({
1530
1544
  "aria-describedby": u,
1531
- "aria-label": "".concat(m ? "".concat(m, ", ") : "").concat(M),
1545
+ "aria-label": "".concat(m ? "".concat(m, ", ") : "").concat(j.join("")),
1532
1546
  "aria-labelledby": m ? undefined : b,
1533
- "aria-required": w,
1547
+ "aria-required": x,
1534
1548
  "data-select-appearance": l,
1535
1549
  "data-test": y ? "multiselect" : "select",
1536
1550
  disabled: p,
1537
1551
  elementRef: d,
1538
1552
  error: v
1539
- }, k()(i.props, O()(o.propTypes)));
1553
+ }, C()(i.props, O()(o.propTypes)));
1540
1554
  if (y) {
1541
- T["data-test-values"] = JSON.stringify(A);
1555
+ P["data-test-values"] = JSON.stringify(E);
1542
1556
  } else {
1543
- var P = lt(A, 1), V = P[0];
1544
- T["data-test-value"] = V;
1557
+ var V = lt(E, 1), R = V[0];
1558
+ P["data-test-value"] = R;
1545
1559
  }
1546
1560
  if (a) {
1547
1561
 
1548
- return (0, n.cloneElement)(a, T);
1562
+ return (0, n.cloneElement)(a, P);
1549
1563
  }
1550
1564
  if (l === "link") {
1551
1565
 
1552
- return r().createElement(L(), at({}, T, {
1566
+ return r().createElement(q(), at({}, P, {
1553
1567
  "data-select-appearance": "link"
1554
- }), !!C && r().createElement(Ue, null, C), _ || g, r().createElement(Ge, null, r().createElement(J, null)));
1568
+ }), !!_ && r().createElement(Ue, null, _), A || g, r().createElement(Ge, null, r().createElement(J, null)));
1555
1569
  }
1556
1570
 
1557
- return r().createElement(We, at({}, T, {
1571
+ return r().createElement(We, at({}, P, {
1558
1572
  $multiple: y,
1559
1573
  appearance: l,
1560
- label: _,
1574
+ label: A,
1561
1575
  error: v,
1562
- icon: C,
1576
+ icon: _,
1563
1577
  inline: h,
1564
1578
  isMenu: true,
1565
1579
  "aria-haspopup": "listbox",
1566
1580
  "aria-owns": i.menuId,
1567
1581
  onClick: i.props.onClick
1568
- }, I()(i.props, o.invalidLinkAppearanceProps)), !!A.length && y && r().createElement(Xe, {
1582
+ }, I()(i.props, o.invalidLinkAppearanceProps)), !!E.length && y && r().createElement(Ye, {
1569
1583
  "data-role": "count"
1570
- }, "(", A.length, ")"));
1584
+ }, "(", E.length, ")"));
1571
1585
  }));
1572
- Et(kt(i), "createChildren", (function() {
1586
+ Et(Ct(i), "createChildren", (function() {
1573
1587
  var e = i.state, t = e.filterKeyword, o = e.textHasFocus, a = e.topValues;
1574
- var l = i.props, s = l.allowKeyMatching, u = l.allowNewValues, p = l.filter, d = l.multiple, h = l.selectAllAppearance, b = l.showSelectedValuesFirst, m = l.isLoadingOptions, y = l.onScrollBottom;
1588
+ var l = i.props, c = l.allowKeyMatching, u = l.allowNewValues, p = l.filter, d = l.multiple, h = l.selectAllAppearance, b = l.showSelectedValuesFirst, m = l.isLoadingOptions, y = l.onScrollBottom;
1575
1589
  var g = i.getCurrentValues();
1576
1590
  i.availableOptionCount = 0;
1577
1591
  i.firstSelectedOptionIndex = undefined;
@@ -1580,11 +1594,11 @@
1580
1594
  i.availableMatchOptions = [];
1581
1595
  var O;
1582
1596
  var S = 0;
1583
- var w = false;
1597
+ var x = false;
1584
1598
  // used to avoid overwriting the selected item ref in multiple mode
1585
- var x;
1586
- var k = b === "immediately" ? i.getTopValues() : a;
1587
- var C = n.Children.toArray(i.props.children).reduce((function(e, t, o) {
1599
+ var w;
1600
+ var C = b === "immediately" ? i.getTopValues() : a;
1601
+ var k = n.Children.toArray(i.props.children).reduce((function(e, t, o) {
1588
1602
  // ignore Headings and Dividers
1589
1603
  if (!Dt(t)) {
1590
1604
  e.push(t);
@@ -1595,11 +1609,11 @@
1595
1609
  O = true;
1596
1610
  }
1597
1611
  var a = g && g.indexOf(t.props.value) >= 0;
1598
- var l = !!a && !t.props.disabled && !x;
1599
- var c = s && !d && !p && !m && !y;
1600
- var u = qt(t.props.value, t.props.label);
1612
+ var l = !!a && !t.props.disabled && !w;
1613
+ var s = c && !d && !p && !m && !y;
1614
+ var u = Lt(t.props.value, t.props.label);
1601
1615
  var f = -1;
1602
- if (c && !t.props.disabled && !t.props.hidden) {
1616
+ if (s && !t.props.disabled && !t.props.hidden) {
1603
1617
  i.availableMatchOptions.push({
1604
1618
  label: t.props.label,
1605
1619
  value: t.props.value
@@ -1610,7 +1624,7 @@
1610
1624
  var v = (0, n.cloneElement)(t, {
1611
1625
  key: t.key || o,
1612
1626
  onClick: i.handleMenuOptionClick,
1613
- onKeyDown: c ? function(e) {
1627
+ onKeyDown: s ? function(e) {
1614
1628
  return i.handleMenuOptionKeyDown(e, f);
1615
1629
  } : undefined,
1616
1630
  selected: a,
@@ -1621,14 +1635,14 @@
1621
1635
  }
1622
1636
  });
1623
1637
  if (l) {
1624
- x = true;
1638
+ w = true;
1625
1639
  }
1626
- if (k && k.indexOf(t.props.value) >= 0) {
1640
+ if (C && C.indexOf(t.props.value) >= 0) {
1627
1641
  if (S === 0) {
1628
1642
  e.splice(S, 0, r().createElement(T.Divider, {
1629
1643
  key: "topDivider"
1630
1644
  }));
1631
- w = true;
1645
+ x = true;
1632
1646
  }
1633
1647
  e.splice(S, 0, v);
1634
1648
  S += 1;
@@ -1640,23 +1654,23 @@
1640
1654
  // In multiple mode, add missing items
1641
1655
  if (d) {
1642
1656
  v()(g, (function(e) {
1643
- var t = f()(C, (function(t) {
1657
+ var t = f()(k, (function(t) {
1644
1658
  return Dt(t) && t.props && t.props.value === e;
1645
1659
  }));
1646
1660
  if (!t) {
1647
1661
  if (e === i.state.filterKeyword) {
1648
1662
  O = true;
1649
1663
  }
1650
- var n = k && k.indexOf(e) >= 0;
1651
- var o = k.length;
1664
+ var n = C && C.indexOf(e) >= 0;
1665
+ var o = C.length;
1652
1666
  if (S === 0) {
1653
- C.splice(0, 0, r().createElement(T.Divider, {
1667
+ k.splice(0, 0, r().createElement(T.Divider, {
1654
1668
  key: "topDivider"
1655
1669
  }));
1656
1670
  S += 1;
1657
- w = true;
1671
+ x = true;
1658
1672
  }
1659
- C.splice(n ? 0 : o + 1, 0, r().createElement(Oe, {
1673
+ k.splice(n ? 0 : o + 1, 0, r().createElement(Oe, {
1660
1674
  label: String(e),
1661
1675
  value: e,
1662
1676
  key: "missing-value-".concat(e),
@@ -1673,7 +1687,7 @@
1673
1687
  var I = p === "controlled";
1674
1688
  // Filter the items
1675
1689
  var _ = (0, D.stringToKeywords)(t);
1676
- C = I ? C : C.filter((function(e) {
1690
+ k = I ? k : k.filter((function(e) {
1677
1691
  if (Dt(e)) {
1678
1692
  return (0, D.testPhrase)(e.props.label, _);
1679
1693
  }
@@ -1692,8 +1706,8 @@
1692
1706
  }));
1693
1707
  // Add the option to add the new value
1694
1708
  if (u && !O && t) {
1695
- var A = w ? S + 1 : S;
1696
- C.splice(A, 0, r().createElement(Oe, {
1709
+ var A = x ? S + 1 : S;
1710
+ k.splice(A, 0, r().createElement(Oe, {
1697
1711
  label: "".concat(t, " (new value)"),
1698
1712
  value: t,
1699
1713
  key: "newValue",
@@ -1702,10 +1716,10 @@
1702
1716
  }));
1703
1717
  }
1704
1718
  // When selectAll is a menu item, add an offset so that activeItem accounts for the extra selectAll option.
1705
- var j = h === "checkbox" && d && C.length > 1 ? 1 : 0;
1719
+ var j = h === "checkbox" && d && k.length > 1 ? 1 : 0;
1706
1720
  var E = true;
1707
1721
  // Highlight the selected Items and remove hidden
1708
- C = C.reduce((function(e, t) {
1722
+ k = k.reduce((function(e, t) {
1709
1723
  // ignore Dividers & Headings
1710
1724
  if (!Dt(t)) {
1711
1725
  e.push(t);
@@ -1747,19 +1761,19 @@
1747
1761
  var P;
1748
1762
  if (i.optionSelection === "all") {
1749
1763
  if (t === "") {
1750
- P = (0, c._)("Clear all");
1764
+ P = (0, s._)("Clear all");
1751
1765
  } else {
1752
- P = (0, c._)("Clear all matches");
1766
+ P = (0, s._)("Clear all matches");
1753
1767
  }
1754
1768
  } else if (t === "") {
1755
- P = (0, c._)("Select all");
1769
+ P = (0, s._)("Select all");
1756
1770
  } else {
1757
- P = (0, c._)("Select all matches");
1771
+ P = (0, s._)("Select all matches");
1758
1772
  }
1759
1773
  if (i.state.activeIndex === 0 && o) {
1760
1774
  i.activeValue = "selectAll";
1761
1775
  }
1762
- C.unshift( r().createElement(He, {
1776
+ k.unshift( r().createElement(He, {
1763
1777
  key: "selectAllOption",
1764
1778
  selected: i.optionSelection === "all" || i.optionSelection !== "none" && "some",
1765
1779
  selectAllLabel: P,
@@ -1774,15 +1788,15 @@
1774
1788
  key: "selectAllDivider"
1775
1789
  }));
1776
1790
  }
1777
- i.displayedValues = C.reduce((function(e, t) {
1791
+ i.displayedValues = k.reduce((function(e, t) {
1778
1792
  if (Dt(t)) {
1779
1793
  e.push(t.props.value);
1780
1794
  }
1781
1795
  return e;
1782
1796
  }), []);
1783
- return C;
1797
+ return k;
1784
1798
  }));
1785
- Et(kt(i), "wrapLabel", (function(e) {
1799
+ Et(Ct(i), "wrapLabel", (function(e) {
1786
1800
  var t = e.prefixLabel, n = e.label, r = e.suffixLabel;
1787
1801
  var o = n;
1788
1802
  if (t) {
@@ -1793,7 +1807,7 @@
1793
1807
  }
1794
1808
  return o;
1795
1809
  }));
1796
- Et(kt(i), "handleDropdownMount", (function(e) {
1810
+ Et(Ct(i), "handleDropdownMount", (function(e) {
1797
1811
  i.dropdown = e;
1798
1812
  }));
1799
1813
  i.state = {
@@ -1860,7 +1874,7 @@
1860
1874
  var r, o, i;
1861
1875
  var a = (r = this.getCurrentValues()) !== null && r !== void 0 ? r : [];
1862
1876
  var l = a.indexOf(n);
1863
- var c = this.props, s = c.name, u = c.multiple;
1877
+ var s = this.props, c = s.name, u = s.multiple;
1864
1878
  var p;
1865
1879
  if (u) {
1866
1880
  if (l >= 0) {
@@ -1895,7 +1909,7 @@
1895
1909
  }
1896
1910
  (o = (i = this.props).onChange) === null || o === void 0 ? void 0 : o.call(i, t, {
1897
1911
  values: p,
1898
- name: s,
1912
+ name: c,
1899
1913
  reason: "valueToggle"
1900
1914
  });
1901
1915
  }
@@ -1912,24 +1926,24 @@
1912
1926
  value: function e(t) {
1913
1927
  var n = t.hasChildren, o = t.placement;
1914
1928
  var i = this.state.filterKeyword;
1915
- var a = this.props, l = a.inputId, s = a.inputRef, u = a.multiple, p = a.selectAllAppearance;
1916
- var f = (0, c._)("Select all options".concat(this.optionSelection === "all" ? " disabled" : ""));
1917
- var d = (0, c._)("Clear all options".concat(this.optionSelection === "none" ? " disabled" : ""));
1929
+ var a = this.props, l = a.inputId, c = a.inputRef, u = a.multiple, p = a.selectAllAppearance;
1930
+ var f = (0, s._)("Select all options".concat(this.optionSelection === "all" ? " disabled" : ""));
1931
+ var d = (0, s._)("Clear all options".concat(this.optionSelection === "none" ? " disabled" : ""));
1918
1932
  // only visually disable these as opposed to fully disabling to avoid losing keyboard focus - see SUI-2731
1919
1933
  var v = r().createElement(Ze, {
1920
1934
  $placement: o,
1921
1935
  key: "selectAll"
1922
- }, r().createElement(Ye, {
1936
+ }, r().createElement(Qe, {
1923
1937
  $disabled: this.optionSelection === "all",
1924
1938
  "aria-label": f,
1925
1939
  onClick: this.handleSelectAll,
1926
1940
  "data-test": "select-all"
1927
- }, i ? (0, c._)("Select all Matches") : (0, c._)("Select all")), r().createElement(Ye, {
1941
+ }, i ? (0, s._)("Select all Matches") : (0, s._)("Select all")), r().createElement(Qe, {
1928
1942
  $disabled: this.optionSelection === "none",
1929
1943
  "aria-label": d,
1930
1944
  onClick: this.handleClearAll,
1931
1945
  "data-test": "clear-all"
1932
- }, i ? (0, c._)("Clear all Matches") : (0, c._)("Clear all")));
1946
+ }, i ? (0, s._)("Clear all Matches") : (0, s._)("Clear all")));
1933
1947
  return this.hasFilter() && r().createElement("div", {
1934
1948
  key: "controls"
1935
1949
  }, r().createElement(Je, {
@@ -1945,23 +1959,23 @@
1945
1959
  onKeyDown: this.handleTextKeyDown,
1946
1960
  onFocus: this.handleTextFocus,
1947
1961
  onBlur: this.handleTextBlur,
1948
- placeholder: (0, c._)("filter"),
1962
+ placeholder: (0, s._)("filter"),
1949
1963
  role: "combobox",
1950
1964
  "aria-expanded": "true",
1951
1965
  "aria-controls": this.menuListboxId,
1952
- "aria-label": (0, c._)("Filter"),
1966
+ "aria-label": (0, s._)("Filter"),
1953
1967
  "aria-activedescendant": this.state.textHasFocus && n ? this.activeItemId : undefined,
1954
- inputRef: s,
1968
+ inputRef: c,
1955
1969
  inputId: l,
1956
1970
  canClear: true,
1957
- startAdornment: r().createElement(Qe, null, r().createElement(te, null))
1971
+ startAdornment: r().createElement(Xe, null, r().createElement(te, null))
1958
1972
  })), u && n && p === "buttongroup" && v);
1959
1973
  }
1960
1974
  }, {
1961
1975
  key: "render",
1962
1976
  value: function e() {
1963
1977
  var t, o = this;
1964
- var i = this.props, a = i.children, l = i.defaultPlacement, c = i.inputId, s = i.multiple, u = i.repositionMode, p = i.virtualization;
1978
+ var i = this.props, a = i.children, l = i.defaultPlacement, s = i.inputId, c = i.multiple, u = i.repositionMode, p = i.virtualization;
1965
1979
  var d = this.hasFilter();
1966
1980
  var v = (t = this.getCurrentValues()) !== null && t !== void 0 ? t : [];
1967
1981
  var h = n.Children.toArray(a);
@@ -1981,9 +1995,9 @@
1981
1995
  maxHeight: i,
1982
1996
  menuStyle: o.props.menuStyle
1983
1997
  });
1984
- var c = v.length > 0 && !b && !o.hasFilter() ? 0 : undefined;
1998
+ var s = v.length > 0 && !b && !o.hasFilter() ? 0 : undefined;
1985
1999
  var u = jt(jt({
1986
- "aria-multiselectable": s || undefined,
2000
+ "aria-multiselectable": c || undefined,
1987
2001
  childrenStart: o.renderControls({
1988
2002
  placement: a,
1989
2003
  hasChildren: !!m.length
@@ -1997,7 +2011,7 @@
1997
2011
  menuId: o.menuListboxId
1998
2012
  }, I()(o.props, "noOptionsMessage", "footerMessage", "animateLoading", "loadingMessage", "onScroll")), {}, {
1999
2013
  style: l,
2000
- tabIndex: c
2014
+ tabIndex: s
2001
2015
  });
2002
2016
  if (p) {
2003
2017
 
@@ -2011,7 +2025,7 @@
2011
2025
 
2012
2026
  return r().createElement(V(), {
2013
2027
  closeReasons: Rt,
2014
- inputId: c,
2028
+ inputId: s,
2015
2029
  toggle: y,
2016
2030
  onRequestOpen: this.handleRequestOpen,
2017
2031
  onRequestClose: this.handleRequestClose,
@@ -2028,13 +2042,13 @@
2028
2042
  } ]);
2029
2043
  return o;
2030
2044
  }(n.Component);
2031
- Et(Lt, "propTypes", Mt);
2032
- Et(Lt, "defaultProps", Tt);
2033
- Et(Lt, "Option", Oe);
2034
- Et(Lt, "Divider", T.Divider);
2035
- Et(Lt, "Heading", T.Heading);
2036
- Et(Lt, "invalidLinkAppearanceProps", [ "append", "error", "prepend" ]);
2037
- /* harmony default export */ const Nt = Lt;
2045
+ Et(qt, "propTypes", Mt);
2046
+ Et(qt, "defaultProps", Tt);
2047
+ Et(qt, "Option", Oe);
2048
+ Et(qt, "Divider", T.Divider);
2049
+ Et(qt, "Heading", T.Heading);
2050
+ Et(qt, "invalidLinkAppearanceProps", [ "append", "error", "prepend" ]);
2051
+ /* harmony default export */ const Nt = qt;
2038
2052
  // CONCATENATED MODULE: ./src/Select/Option.tsx
2039
2053
  function Bt(e) {
2040
2054
  "@babel/helpers - typeof";
@@ -2103,11 +2117,11 @@
2103
2117
  return Wt(e, t);
2104
2118
  }
2105
2119
  function Ut(e) {
2106
- var t = Qt();
2120
+ var t = Xt();
2107
2121
  return function n() {
2108
- var r = Xt(e), o;
2122
+ var r = Yt(e), o;
2109
2123
  if (t) {
2110
- var i = Xt(this).constructor;
2124
+ var i = Yt(this).constructor;
2111
2125
  o = Reflect.construct(r, arguments, i);
2112
2126
  } else {
2113
2127
  o = r.apply(this, arguments);
@@ -2127,7 +2141,7 @@
2127
2141
  }
2128
2142
  return e;
2129
2143
  }
2130
- function Qt() {
2144
+ function Xt() {
2131
2145
  if (typeof Reflect === "undefined" || !Reflect.construct) return false;
2132
2146
  if (Reflect.construct.sham) return false;
2133
2147
  if (typeof Proxy === "function") return true;
@@ -2138,13 +2152,13 @@
2138
2152
  return false;
2139
2153
  }
2140
2154
  }
2141
- function Xt(e) {
2142
- Xt = Object.setPrototypeOf ? Object.getPrototypeOf : function e(t) {
2155
+ function Yt(e) {
2156
+ Yt = Object.setPrototypeOf ? Object.getPrototypeOf : function e(t) {
2143
2157
  return t.__proto__ || Object.getPrototypeOf(t);
2144
2158
  };
2145
- return Xt(e);
2159
+ return Yt(e);
2146
2160
  }
2147
- function Yt(e, t, n) {
2161
+ function Qt(e, t, n) {
2148
2162
  if (t in e) {
2149
2163
  Object.defineProperty(e, t, {
2150
2164
  value: n,
@@ -2200,8 +2214,8 @@
2200
2214
  o[i] = arguments[i];
2201
2215
  }
2202
2216
  e = t.call.apply(t, [ this ].concat(o));
2203
- Yt(Jt(e), "c", null);
2204
- Yt(Jt(e), "handleMount", (function(t) {
2217
+ Qt(Jt(e), "c", null);
2218
+ Qt(Jt(e), "handleMount", (function(t) {
2205
2219
  e.c = t;
2206
2220
  }));
2207
2221
  return e;
@@ -2232,8 +2246,8 @@
2232
2246
  } ]);
2233
2247
  return n;
2234
2248
  }(n.PureComponent);
2235
- Yt(tn, "propTypes", Zt);
2236
- Yt(tn, "defaultProps", en);
2249
+ Qt(tn, "propTypes", Zt);
2250
+ Qt(tn, "defaultProps", en);
2237
2251
  /* harmony default export */ const nn = tn;
2238
2252
  // CONCATENATED MODULE: ./src/Select/Select.tsx
2239
2253
  function rn(e) {
@@ -2290,12 +2304,12 @@
2290
2304
  }
2291
2305
  return n;
2292
2306
  }
2293
- function cn(e, t) {
2307
+ function sn(e, t) {
2294
2308
  if (!(e instanceof t)) {
2295
2309
  throw new TypeError("Cannot call a class as a function");
2296
2310
  }
2297
2311
  }
2298
- function sn(e, t) {
2312
+ function cn(e, t) {
2299
2313
  for (var n = 0; n < t.length; n++) {
2300
2314
  var r = t[n];
2301
2315
  r.enumerable = r.enumerable || false;
@@ -2305,8 +2319,8 @@
2305
2319
  }
2306
2320
  }
2307
2321
  function un(e, t, n) {
2308
- if (t) sn(e.prototype, t);
2309
- if (n) sn(e, n);
2322
+ if (t) cn(e.prototype, t);
2323
+ if (n) cn(e, n);
2310
2324
  return e;
2311
2325
  }
2312
2326
  function pn(e, t) {
@@ -2388,7 +2402,7 @@
2388
2402
  /** @public */ var gn = {
2389
2403
  allowKeyMatching: i().bool,
2390
2404
  animateLoading: i().bool,
2391
- appearance: i().oneOf([ "default", "link", "primary", "pill", "toggle", "flat" ]),
2405
+ appearance: i().oneOf([ "default", "link", "primary", "pill", "toggle", "flat", "subtle" ]),
2392
2406
  append: i().bool,
2393
2407
  children: i().node,
2394
2408
  defaultPlacement: i().oneOf([ "above", "below", "vertical" ]),
@@ -2419,6 +2433,7 @@
2419
2433
  prefixLabel: i().string,
2420
2434
  prepend: i().bool,
2421
2435
  suffixLabel: i().string,
2436
+ toggleContent: i().oneOf([ "optionChildren", "optionLabel" ]),
2422
2437
  /** @private. */
2423
2438
  toggle: i().node,
2424
2439
  value: i().oneOfType([ i().string, i().number, i().bool ]),
@@ -2438,9 +2453,10 @@
2438
2453
  inline: true,
2439
2454
  isLoadingOptions: false,
2440
2455
  menuStyle: {},
2441
- noOptionsMessage: (0, c._)("No matches"),
2442
- placeholder: (0, c._)("Select..."),
2443
- prepend: false
2456
+ noOptionsMessage: (0, s._)("No matches"),
2457
+ placeholder: (0, s._)("Select..."),
2458
+ prepend: false,
2459
+ toggleContent: "optionChildren"
2444
2460
  };
2445
2461
  var Sn = function(e) {
2446
2462
  pn(n, e);
@@ -2448,7 +2464,7 @@
2448
2464
  // @docs-props-type SelectPropsBase
2449
2465
  function n(e) {
2450
2466
  var r;
2451
- cn(this, n);
2467
+ sn(this, n);
2452
2468
  r = t.call(this, e);
2453
2469
  var o = {};
2454
2470
  // wrap defaultValue in an array once to avoid failing <SelectBase>'s defaultValues comparison check
@@ -2461,6 +2477,9 @@
2461
2477
  }
2462
2478
  }
2463
2479
  r.state = o;
2480
+ // `this.props.appearance === 'toggle'` is not included here because it is the default value.
2481
+ // Including it would trigger a warning for every instance of using `Select`.
2482
+ if (false) {}
2464
2483
  return r;
2465
2484
  }
2466
2485
  un(n, [ {
@@ -2472,7 +2491,7 @@
2472
2491
  key: "render",
2473
2492
  value: function e() {
2474
2493
  var t = this.props, n = t.defaultValue, o = t.onChange, i = t.value, a = an(t, [ "defaultValue", "onChange", "value" ]);
2475
- var c = {
2494
+ var s = {
2476
2495
  onChange: function e(t, n) {
2477
2496
  var r = n.name, i = n.values;
2478
2497
  o === null || o === void 0 ? void 0 : o(t, {
@@ -2484,16 +2503,16 @@
2484
2503
  // using "has" as opposed to a null check to match SelectBase
2485
2504
  if (l()(this.props, "value")) {
2486
2505
  if (i != null) {
2487
- c.values = [ i ];
2506
+ s.values = [ i ];
2488
2507
  } else {
2489
- c.values = [];
2508
+ s.values = [];
2490
2509
  }
2491
2510
  } else if (this.state.defaultValues != null) {
2492
2511
  // using defaultValues from state in order to avoid wrapping defaultValue here
2493
- c.defaultValues = this.state.defaultValues;
2512
+ s.defaultValues = this.state.defaultValues;
2494
2513
  }
2495
2514
 
2496
- return r().createElement(Nt, on({}, a, c, {
2515
+ return r().createElement(Nt, on({}, a, s, {
2497
2516
  multiple: false
2498
2517
  }));
2499
2518
  }
@@ -2505,7 +2524,7 @@
2505
2524
  yn(Sn, "Option", nn);
2506
2525
  yn(Sn, "Heading", T.Heading);
2507
2526
  yn(Sn, "Divider", T.Divider);
2508
- /* harmony default export */ const wn = Sn;
2527
+ /* harmony default export */ const xn = Sn;
2509
2528
  // CONCATENATED MODULE: ./src/Select/index.ts
2510
2529
  module.exports = t;
2511
2530
  /******/})();