@splunk/react-ui 5.0.0-beta.3 → 5.0.0-beta.4

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 (149) hide show
  1. package/Accordion.js +185 -243
  2. package/Animation.js +2 -2
  3. package/Button.js +1 -1
  4. package/ButtonSimple.js +47 -41
  5. package/CHANGELOG.md +12 -2
  6. package/CHANGELOG.v5.mdx +38 -0
  7. package/Calendar.js +352 -469
  8. package/Chip.js +149 -280
  9. package/Code.js +19 -12
  10. package/Color.js +32 -32
  11. package/ComboBox.js +8 -6
  12. package/Date.js +1 -1
  13. package/DualListbox.js +298 -296
  14. package/File.js +294 -281
  15. package/FormRows.js +165 -153
  16. package/Image.js +124 -251
  17. package/Layout.d.ts +2 -0
  18. package/MIGRATION.v5.mdx +1 -1
  19. package/Menu.js +1 -1
  20. package/Message.js +77 -100
  21. package/MessageBar.js +141 -251
  22. package/Modal.js +2 -2
  23. package/ModalLayer.js +12 -12
  24. package/Multiselect.js +1978 -2323
  25. package/NonInteractiveCheckbox.js +29 -117
  26. package/Number.js +114 -114
  27. package/Popover.js +348 -350
  28. package/Progress.js +1 -1
  29. package/RadioBar.js +136 -136
  30. package/Scroll.js +2 -2
  31. package/Select.js +236 -240
  32. package/SidePanel.js +17 -21
  33. package/Slider.js +366 -370
  34. package/SlidingPanels.js +100 -102
  35. package/SplitButton.js +39 -25
  36. package/StepBar.js +1 -1
  37. package/Switch.js +70 -64
  38. package/TabBar.js +544 -417
  39. package/Table.js +1580 -1434
  40. package/Text.js +34 -34
  41. package/TextArea.js +26 -26
  42. package/Tooltip.js +416 -562
  43. package/TransitionOpen.js +2 -2
  44. package/package.json +7 -9
  45. package/types/src/Accordion/Accordion.d.ts +14 -21
  46. package/types/src/Accordion/AccordionContext.d.ts +0 -1
  47. package/types/src/Animation/Animation.d.ts +2 -3
  48. package/types/src/AnimationToggle/docs/examples/Provider.d.ts +2 -2
  49. package/types/src/AnimationToggle/docs/examples/ToggleComponent.d.ts +2 -2
  50. package/types/src/AnimationToggle/useAnimationToggle.d.ts +1 -1
  51. package/types/src/Button/Button.d.ts +1 -1
  52. package/types/src/ButtonGroup/ButtonGroupContext.d.ts +0 -1
  53. package/types/src/ButtonSimple/ButtonSimple.d.ts +1 -3
  54. package/types/src/ButtonSimple/mixin.d.ts +1 -1
  55. package/types/src/Calendar/Calendar.d.ts +2 -2
  56. package/types/src/Calendar/{DateTable.d.ts → DateGrid.d.ts} +9 -9
  57. package/types/src/Calendar/Day.d.ts +8 -4
  58. package/types/src/CardLayout/CardLayoutContext.d.ts +0 -1
  59. package/types/src/CardLayout/docs/examples/Interactive.d.ts +2 -2
  60. package/types/src/Clickable/Clickable.d.ts +1 -1
  61. package/types/src/CollapsiblePanel/SingleOpenPanelGroupContext.d.ts +0 -1
  62. package/types/src/ComboBox/ComboBox.d.ts +3 -3
  63. package/types/src/ControlGroup/docs/examples/CustomizedLabelTarget.d.ts +2 -2
  64. package/types/src/Date/docs/examples/Controlled.d.ts +2 -2
  65. package/types/src/Date/docs/examples/HighlightToday.d.ts +2 -2
  66. package/types/src/DefinitionList/DefinitionListContext.d.ts +0 -1
  67. package/types/src/DualListbox/DualListbox.d.ts +5 -1
  68. package/types/src/File/File.d.ts +4 -4
  69. package/types/src/File/FileContext.d.ts +0 -1
  70. package/types/src/File/Item.d.ts +11 -3
  71. package/types/src/File/ItemIcon.d.ts +2 -1
  72. package/types/src/File/docs/examples/Disabled.d.ts +2 -2
  73. package/types/src/File/docs/examples/DropAnywhere.d.ts +2 -2
  74. package/types/src/File/docs/examples/Multi.d.ts +2 -2
  75. package/types/src/File/docs/examples/Single.d.ts +2 -2
  76. package/types/src/FormRows/FormRows.d.ts +4 -4
  77. package/types/src/FormRows/FormRowsContext.d.ts +1 -2
  78. package/types/src/FormRows/SortableRow.d.ts +1 -1
  79. package/types/src/FormRows/docs/examples/Basic.d.ts +2 -2
  80. package/types/src/FormRows/docs/examples/Header.d.ts +2 -2
  81. package/types/src/FormRows/docs/examples/Menu.d.ts +2 -2
  82. package/types/src/FormRows/docs/examples/ReorderOnly.d.ts +2 -2
  83. package/types/src/Image/Image.d.ts +1 -4
  84. package/types/src/JSONTree/docs/examples/Events.d.ts +2 -2
  85. package/types/src/Layout/Layout.d.ts +1 -0
  86. package/types/src/Link/icons/External.d.ts +1 -2
  87. package/types/src/Menu/Divider.d.ts +1 -1
  88. package/types/src/Menu/MenuContext.d.ts +0 -1
  89. package/types/src/MessageBar/MessageBar.d.ts +5 -1
  90. package/types/src/Modal/ModalContext.d.ts +0 -1
  91. package/types/src/Multiselect/Compact.d.ts +46 -21
  92. package/types/src/Multiselect/Multiselect.d.ts +70 -30
  93. package/types/src/Multiselect/Normal.d.ts +46 -57
  94. package/types/src/Multiselect/Option.d.ts +42 -18
  95. package/types/src/Multiselect/docs/examples/Children.d.ts +2 -2
  96. package/types/src/Multiselect/docs/examples/Controlled.d.ts +2 -2
  97. package/types/src/Multiselect/docs/examples/CustomizeSelected.d.ts +2 -2
  98. package/types/src/Multiselect/docs/examples/Disabled.d.ts +2 -2
  99. package/types/src/Multiselect/docs/examples/Error.d.ts +2 -2
  100. package/types/src/Multiselect/docs/examples/Fetching.d.ts +2 -2
  101. package/types/src/Multiselect/docs/examples/LoadMoreOnScrollBottom.d.ts +2 -2
  102. package/types/src/Multiselect/docs/examples/NewValues.d.ts +2 -2
  103. package/types/src/Multiselect/docs/examples/TabInput.d.ts +2 -2
  104. package/types/src/NonInteractiveCheckbox/NonInteractiveCheckbox.d.ts +8 -7
  105. package/types/src/Number/docs/examples/Basic.d.ts +2 -2
  106. package/types/src/Number/docs/examples/Limits.d.ts +2 -2
  107. package/types/src/Number/docs/examples/Locale.d.ts +2 -2
  108. package/types/src/Popover/Popover.d.ts +1 -1
  109. package/types/src/Popover/PopoverMenuContext.d.ts +0 -1
  110. package/types/src/RadioBar/RadioBar.d.ts +1 -1
  111. package/types/src/RadioBar/RadioBarContext.d.ts +0 -1
  112. package/types/src/RadioList/RadioListContext.d.ts +0 -1
  113. package/types/src/Scroll/Inner.d.ts +1 -1
  114. package/types/src/Scroll/docs/examples/Controlled.d.ts +2 -2
  115. package/types/src/Search/Search.d.ts +2 -2
  116. package/types/src/Select/SelectBase.d.ts +2 -2
  117. package/types/src/Slider/docs/examples/Controlled.d.ts +2 -2
  118. package/types/src/Slider/docs/examples/CustomLabels.d.ts +2 -2
  119. package/types/src/Slider/getStepMarksBackground.d.ts +8 -0
  120. package/types/src/SlidingPanels/Panel.d.ts +2 -2
  121. package/types/src/SlidingPanels/SlidingPanels.d.ts +2 -2
  122. package/types/src/SlidingPanels/docs/examples/Basic.d.ts +2 -2
  123. package/types/src/SlidingPanels/docs/examples/Dropdown.d.ts +2 -2
  124. package/types/src/SplitButton/Item.d.ts +15 -2
  125. package/types/src/StepBar/Step.d.ts +1 -1
  126. package/types/src/StepBar/StepBar.d.ts +1 -1
  127. package/types/src/StepBar/StepBarContext.d.ts +0 -1
  128. package/types/src/Switch/docs/examples/Basic.d.ts +2 -2
  129. package/types/src/Switch/docs/examples/Disabled.d.ts +2 -2
  130. package/types/src/TabBar/Tab.d.ts +12 -5
  131. package/types/src/TabBar/TabBar.d.ts +3 -2
  132. package/types/src/TabBar/TabBarContext.d.ts +7 -2
  133. package/types/src/Table/Head.d.ts +4 -15
  134. package/types/src/Table/HeadCell.d.ts +23 -25
  135. package/types/src/Table/HeadDropdownCell.d.ts +23 -26
  136. package/types/src/Table/HeadInner.d.ts +4 -10
  137. package/types/src/Table/Row.d.ts +6 -6
  138. package/types/src/Table/Table.d.ts +3 -8
  139. package/types/src/Table/TableContext.d.ts +0 -1
  140. package/types/src/Tooltip/Tooltip.d.ts +26 -58
  141. package/types/src/Tooltip/docs/examples/Controlled.d.ts +2 -2
  142. package/types/src/Tree/TreeContext.d.ts +0 -1
  143. package/types/src/useForceUpdate/useForceUpdate.d.ts +0 -1
  144. package/types/src/useResizeObserver/useResizeObserver.d.ts +2 -1
  145. package/types/src/utils/types.d.ts +2 -3
  146. package/useResizeObserver.js +26 -19
  147. package/types/src/Image/icons/Cross.d.ts +0 -3
  148. package/types/src/Table/docs/examples/prisma/DockedHeaderScrollbar.d.ts +0 -3
  149. package/types/src/Tooltip/InfoIcon.d.ts +0 -4
package/DualListbox.js CHANGED
@@ -95,8 +95,8 @@
95
95
  * Defaults to `'{}'`.
96
96
  * @public
97
97
  */
98
- var g = n().createContext({});
99
- /* harmony default export */ const h = g;
98
+ var h = n().createContext({});
99
+ /* harmony default export */ const g = h;
100
100
  // CONCATENATED MODULE: ./src/DualListbox/ScreenReaderWrapper.tsx
101
101
  function y() {
102
102
  return y = Object.assign ? Object.assign.bind() : function(e) {
@@ -112,7 +112,7 @@
112
112
  function k(e) {
113
113
  var r = y({}, e);
114
114
  var a = p()();
115
- var i = (0, t.useContext)(h);
115
+ var i = (0, t.useContext)(g);
116
116
  var l = i.getScreenReaderMessage, o = i.updateScreenReaderRefreshHook;
117
117
  (0, t.useEffect)((function() {
118
118
  o === null || o === void 0 ? void 0 : o(a);
@@ -242,14 +242,14 @@
242
242
  const V = require("@splunk/themes");
243
243
  // CONCATENATED MODULE: external "@splunk/react-ui/Clickable"
244
244
  const j = require("@splunk/react-ui/Clickable");
245
- var D = e.n(j);
245
+ var B = e.n(j);
246
246
  // CONCATENATED MODULE: ./src/DualListbox/ToolbarButtonStyles.ts
247
- var H = _()(D()).withConfig({
247
+ var D = _()(B()).withConfig({
248
248
  displayName: "ToolbarButtonStyles__StyledClickable",
249
249
  componentId: "k7zksz-0"
250
250
  })([ "", " border:", ";border-radius:", ";box-sizing:border-box;cursor:pointer;flex-grow:1;font-weight:", ";line-height:", ";min-height:", ";min-width:", ";max-width:100%;", ";position:relative;text-align:center;text-decoration:none;vertical-align:middle;white-space:nowrap;width:", ";&:active{transition:none;}&:focus{box-shadow:", ";}&:focus,&:hover{z-index:3;}", ";" ], V.mixins.reset("block"), (0,
251
251
  V.pick)({
252
- enterprise: "1px solid transparent"
252
+ enterprise: "".concat(V.variables.inputBorderWidth, " solid transparent")
253
253
  }), V.variables.borderRadius, (0, V.pick)({
254
254
  enterprise: V.variables.fontWeightSemiBold,
255
255
  prisma: V.variables.fontWeightSemiBold
@@ -288,7 +288,7 @@
288
288
  prisma: V.variables.contentColorDisabled
289
289
  }))
290
290
  }));
291
- var B = _().span.withConfig({
291
+ var H = _().span.withConfig({
292
292
  displayName: "ToolbarButtonStyles__StyledIcon",
293
293
  componentId: "k7zksz-1"
294
294
  })([ "align-items:center;display:flex;flex-direction:row;flex-shrink:0;font-size:", ";justify-content:center;max-width:100%;" ], (0,
@@ -358,29 +358,29 @@
358
358
  if (!d) {
359
359
  return null;
360
360
  }
361
- var g = d(l), h = g.disabled;
361
+ var h = d(l), g = h.disabled;
362
362
 
363
363
  return n().createElement(P(), {
364
364
  defaultPlacement: u,
365
365
  content: n().createElement("span", {
366
366
  "aria-hidden": true
367
367
  }, o)
368
- }, n().createElement(H, M({
368
+ }, n().createElement(D, M({
369
369
  "aria-label": r,
370
370
  "aria-keyshortcuts": a,
371
- "aria-disabled": h || undefined,
371
+ "aria-disabled": g || undefined,
372
372
  "data-test": "toolbar-button",
373
- $disabled: h,
374
- onClick: !h ? m : undefined
375
- }, c), n().createElement(B, null, i)));
373
+ $disabled: g,
374
+ onClick: !g ? m : undefined
375
+ }, c), n().createElement(H, null, i)));
376
376
  }
377
377
  $.propsTypes = K;
378
378
  /* harmony default export */ const F = $;
379
379
  // CONCATENATED MODULE: external "@splunk/react-ui/NonInteractiveCheckbox"
380
380
  const z = require("@splunk/react-ui/NonInteractiveCheckbox");
381
- var U = e.n(z);
381
+ var W = e.n(z);
382
382
  // CONCATENATED MODULE: ./src/DualListbox/OptionStyles.ts
383
- var W = _().li.withConfig({
383
+ var U = _().li.withConfig({
384
384
  displayName: "OptionStyles__StyledListItem",
385
385
  componentId: "q275d9-0"
386
386
  })([ "align-items:center;color:", ";cursor:pointer;display:flex;overflow:hidden;width:100%;word-wrap:break-word;line-height:20px;", " ", "" ], V.variables.contentColorActive, (0,
@@ -399,10 +399,10 @@
399
399
  }),
400
400
  enterprise: (0, N.css)([ "&:hover{background:", ";}" ], V.variables.backgroundColorHover)
401
401
  }));
402
- var X = _()(U()).withConfig({
402
+ var X = _()(W()).withConfig({
403
403
  displayName: "OptionStyles__StyledNonInteractiveCheckbox",
404
404
  componentId: "q275d9-1"
405
- })([ "svg{padding-left:", ";}" ], V.variables.spacingSmall);
405
+ })([ "padding-left:", ";" ], V.variables.spacingSmall);
406
406
  var G = _().div.withConfig({
407
407
  displayName: "OptionStyles__StyledDiv",
408
408
  componentId: "q275d9-2"
@@ -482,18 +482,18 @@
482
482
  if (!v) {
483
483
  return null;
484
484
  }
485
- var m = v(l), g = m.active, h = m.selected;
486
- var y = !!(f ? i : h);
485
+ var m = v(l), h = m.active, g = m.selected;
486
+ var y = !!(f ? i : g);
487
487
 
488
- return n().createElement(W, Y({
488
+ return n().createElement(U, Y({
489
489
  "aria-selected": y,
490
490
  "data-test": "option",
491
491
  "data-test-value": l,
492
- "data-test-active": g,
492
+ "data-test-active": h,
493
493
  id: r,
494
494
  onClick: b,
495
495
  role: "option",
496
- $active: g,
496
+ $active: h,
497
497
  $selected: y
498
498
  }, o), n().createElement(X, {
499
499
  selected: y
@@ -518,7 +518,7 @@
518
518
  var ce = _().div.withConfig({
519
519
  displayName: "LabelStyles__StyledSwitchContainer",
520
520
  componentId: "unwplx-2"
521
- })([ "align-items:center;border:1px solid transparent;display:flex;gap:", ";grid-row:headers;padding:0 ", ";", "" ], V.variables.spacingSmall, V.variables.spacingSmall, (function(e) {
521
+ })([ "align-items:center;border:", " solid transparent;display:flex;gap:", ";grid-row:headers;padding:0 ", ";", "" ], V.variables.inputBorderWidth, V.variables.spacingSmall, V.variables.spacingSmall, (function(e) {
522
522
  var r = e.$columnNumber;
523
523
  return (0, N.css)([ "grid-column:", ";" ], "list".concat(r));
524
524
  }));
@@ -536,17 +536,17 @@
536
536
  var s = (0, t.useContext)(Q);
537
537
  var v = p()();
538
538
  var f = (0, t.useRef)((0, ae.createDOMID)("switch"));
539
- var b = s.updateLabelRefreshHookByName, g = s.getLabelState;
539
+ var b = s.updateLabelRefreshHookByName, h = s.getLabelState;
540
540
  (0, t.useEffect)((function() {
541
541
  b === null || b === void 0 ? void 0 : b(o, v);
542
542
  return function() {
543
543
  return b === null || b === void 0 ? void 0 : b(o);
544
544
  };
545
545
  }), [ o, b, v ]);
546
- if (!g) {
546
+ if (!h) {
547
547
  return null;
548
548
  }
549
- var h = g(), y = h.disabled, k = h.selected, C = h.selectedValueCount, x = h.valueCount;
549
+ var g = h(), y = g.disabled, k = g.selected, C = g.selectedValueCount, x = g.valueCount;
550
550
 
551
551
  return n().createElement(ce, {
552
552
  $columnNumber: a
@@ -576,7 +576,7 @@
576
576
  var fe = _().ul.withConfig({
577
577
  displayName: "ListboxStyles__StyledListbox",
578
578
  componentId: "sc-11oqtd-0"
579
- })([ "background-color:", ";border:1px solid ", ";border-radius:", ";grid-row:lists;list-style:none;margin:0;min-height:0;min-width:0;overflow:auto;padding:0;position:relative;&:focus{box-shadow:", ";outline:none;}", "" ], V.variables.transparent, (0,
579
+ })([ "background-color:", ";border:", " solid ", ";border-radius:", ";grid-row:lists;list-style:none;margin:0;min-height:0;min-width:0;overflow:auto;padding:0;position:relative;&:focus{box-shadow:", ";outline:none;}", "" ], V.variables.transparent, V.variables.inputBorderWidth, (0,
580
580
  V.pick)({
581
581
  enterprise: V.variables.gray60,
582
582
  prisma: V.variables.interactiveColorBorder
@@ -618,7 +618,7 @@
618
618
  }
619
619
  return t;
620
620
  }
621
- var ge = {
621
+ var he = {
622
622
  children: i().node,
623
623
  index: i().number.isRequired,
624
624
  label: i().string.isRequired,
@@ -628,11 +628,11 @@
628
628
  onKeyDown: i().func,
629
629
  onSelectAllClick: i().func
630
630
  };
631
- function he(e) {
631
+ function ge(e) {
632
632
  var r = e.children, a = e.elementRef, i = e.index, l = e.label, o = e.name, u = e.onClick, c = e.onKeyDown, s = e.onSelectAllClick, v = be(e, [ "children", "elementRef", "index", "label", "name", "onClick", "onKeyDown", "onSelectAllClick" ]);
633
633
  var d = (0, t.useRef)((0, ae.createDOMID)("label"));
634
634
  var f = (0, t.useRef)((0, ae.createDOMID)("listbox"));
635
- var p = (0, t.useContext)(h), b = p.controlled, m = p.getSelectedStateForValue, g = p.getActiveValue, y = p.getSelectedValueCount, k = p.getValueCount, C = p.updateLabelRefreshHookByName, x = p.updateOptionRefreshHookByValue;
635
+ var p = (0, t.useContext)(g), b = p.controlled, m = p.getSelectedStateForValue, h = p.getActiveValue, y = p.getSelectedValueCount, k = p.getValueCount, C = p.updateLabelRefreshHookByName, x = p.updateOptionRefreshHookByValue;
636
636
  var S = (0, t.useCallback)((function(e, r) {
637
637
  var t = r.value;
638
638
  u === null || u === void 0 ? void 0 : u(e, {
@@ -642,10 +642,10 @@
642
642
  }), [ o, u ]);
643
643
  var w = (0, t.useCallback)((function(e) {
644
644
  return {
645
- active: (g === null || g === void 0 ? void 0 : g(o)) === e,
645
+ active: (h === null || h === void 0 ? void 0 : h(o)) === e,
646
646
  selected: !!(m === null || m === void 0 ? void 0 : m(e))
647
647
  };
648
- }), [ o, g, m ]);
648
+ }), [ o, h, m ]);
649
649
  var O = (0, t.useCallback)((function() {
650
650
  var e = (k === null || k === void 0 ? void 0 : k(o)) || 0;
651
651
  var r = (y === null || y === void 0 ? void 0 : y(o)) || 0;
@@ -712,8 +712,8 @@
712
712
  $columnNumber: i
713
713
  }, v), r));
714
714
  }
715
- he.propTypes = ge;
716
- /* harmony default export */ const ye = he;
715
+ ge.propTypes = he;
716
+ /* harmony default export */ const ye = ge;
717
717
  // CONCATENATED MODULE: external "@splunk/react-ui/Box"
718
718
  const ke = require("@splunk/react-ui/Box");
719
719
  var Ce = e.n(ke);
@@ -815,6 +815,7 @@
815
815
  /** @public */ var _e = {
816
816
  children: i().node,
817
817
  controlled: i().bool,
818
+ elementRef: i().oneOfType([ i().func, i().object ]),
818
819
  fill: i().bool,
819
820
  inline: i().bool,
820
821
  onChange: i().func,
@@ -826,85 +827,85 @@
826
827
  };
827
828
  function Ve(e) {
828
829
  var r, a, i, u;
829
- var s = e.children, f = e.controlled, b = f === void 0 ? false : f, m = e.fill, g = m === void 0 ? false : m, y = e.inline, k = y === void 0 ? false : y, R = e.onChange, I = e.onSelect, q = e.lists, P = Pe(e, [ "children", "controlled", "fill", "inline", "onChange", "onSelect", "lists" ]);
830
+ var s = e.children, f = e.controlled, b = f === void 0 ? false : f, m = e.elementRef, h = e.fill, y = h === void 0 ? false : h, k = e.inline, R = k === void 0 ? false : k, I = e.onChange, q = e.onSelect, P = e.lists, N = Pe(e, [ "children", "controlled", "elementRef", "fill", "inline", "onChange", "onSelect", "lists" ]);
830
831
  // @docs-props-type DualListboxPropsBase
831
- var N = p()();
832
- var _ = (0, t.useRef)(false);
832
+ var _ = p()();
833
+ var V = (0, t.useRef)(false);
833
834
  (0, t.useEffect)((function() {
834
- _.current = true;
835
+ V.current = true;
835
836
  }), []);
836
837
  // TODO: Implement shared isControlled hook (SUI-5283).
837
- var V = (0, t.useRef)(b);
838
+ var j = (0, t.useRef)(b);
838
839
  // List One "Available" Refs
839
- var j = (0, t.useRef)([]);
840
+ var B = (0, t.useRef)([]);
840
841
  var D = (0, t.useRef)([]);
841
842
  var H = (0, t.useRef)();
842
- var B = (0, t.useRef)(null);
843
- var M = (0, t.useRef)([]);
843
+ var M = (0, t.useRef)(null);
844
+ var T = (0, t.useRef)([]);
844
845
  // List Two "Selected" Refs
845
- var T = (0, t.useRef)([]);
846
- var A = (0, t.useRef)([]);
847
- var K = (0, t.useRef)();
848
- var $ = (0, t.useRef)(null);
849
- var z = (0, t.useRef)([]);
846
+ var A = (0, t.useRef)([]);
847
+ var K = (0, t.useRef)([]);
848
+ var $ = (0, t.useRef)();
849
+ var z = (0, t.useRef)(null);
850
+ var W = (0, t.useRef)([]);
850
851
  // Refresh Hook Stores, used to render indivual elements when uncontrolled
851
852
  var U = (0, t.useRef)({});
852
- var W = (0, t.useRef)({});
853
853
  var X = (0, t.useRef)({});
854
- var G = (0, t.useRef)();
854
+ var G = (0, t.useRef)({});
855
+ var J = (0, t.useRef)();
855
856
  // Activity Values Refs
856
- var J = (0, t.useRef)();
857
- var Q = (0, t.useRef)({});
857
+ var Q = (0, t.useRef)();
858
858
  var Y = (0, t.useRef)({});
859
859
  var Z = (0, t.useRef)({});
860
- var ee = (0, t.useRef)(0);
860
+ var ee = (0, t.useRef)({});
861
+ var re = (0, t.useRef)(0);
861
862
  // Key Match Refs
862
- var re = (0, t.useRef)();
863
- var te = (0, t.useRef)();
864
- var ne = (0, t.useRef)([]);
863
+ var te = (0, t.useRef)();
864
+ var ne = (0, t.useRef)();
865
+ var ae = (0, t.useRef)([]);
865
866
  if (false) {}
866
867
  if (false) {}
867
868
  if (false) {}
868
869
  // Unpack names and labels instead of relying on `lists` being a consistent reference
869
- var ae = (r = q[0]) === null || r === void 0 ? void 0 : r.name;
870
- var ie = (a = q[1]) === null || a === void 0 ? void 0 : a.name;
871
- var le = (i = q[0]) === null || i === void 0 ? void 0 : i.label;
872
- var oe = (u = q[1]) === null || u === void 0 ? void 0 : u.label;
870
+ var ie = (r = P[0]) === null || r === void 0 ? void 0 : r.name;
871
+ var le = (a = P[1]) === null || a === void 0 ? void 0 : a.name;
872
+ var oe = (i = P[0]) === null || i === void 0 ? void 0 : i.label;
873
+ var ue = (u = P[1]) === null || u === void 0 ? void 0 : u.label;
873
874
  // Copy previous state for uncontrolled render so it's not voided by following value reset
874
- var ue = new Set(T.current);
875
+ var ce = new Set(A.current);
875
876
  // This ensures we recapture the indexes after batch moves, but will be refactored when sorting is implemented (SUI-5270).
876
- j.current = [];
877
+ B.current = [];
878
+ A.current = [];
877
879
  T.current = [];
878
- M.current = [];
879
- z.current = [];
880
+ W.current = [];
880
881
  // Clean the data stores before we copy the references into listData
881
- if (!_.current || V.current) {
882
+ if (!V.current || j.current) {
882
883
  D.current = [];
883
- A.current = [];
884
- Q.current = {};
885
- Z.current = {};
884
+ K.current = [];
886
885
  Y.current = {};
886
+ ee.current = {};
887
+ Z.current = {};
887
888
  }
888
- var ce = [ {
889
+ var se = [ {
889
890
  options: [],
890
- matchOptions: M.current,
891
- values: j.current,
891
+ matchOptions: T.current,
892
+ values: B.current,
892
893
  selectedValues: D.current,
893
894
  activeValue: H.current,
894
895
  activeFound: !H.current
895
896
  }, {
896
897
  options: [],
897
- matchOptions: z.current,
898
- values: T.current,
899
- selectedValues: A.current,
900
- activeValue: K.current,
901
- activeFound: !K.current
898
+ matchOptions: W.current,
899
+ values: A.current,
900
+ selectedValues: K.current,
901
+ activeValue: $.current,
902
+ activeFound: !$.current
902
903
  } ];
903
- if (!_.current || V.current) {
904
+ if (!V.current || j.current) {
904
905
  t.Children.toArray(s).filter(t.isValidElement).forEach((function(e) {
905
906
  var r = e.props, t = r.value, n = r.label;
906
- var a = e.props.listName === ie;
907
- var i = ce[a ? 1 : 0];
907
+ var a = e.props.listName === le;
908
+ var i = se[a ? 1 : 0];
908
909
  // Ensure the active value is found on controlled renders
909
910
  if (!i.activeFound && i.activeValue === t) {
910
911
  i.activeFound = true;
@@ -919,128 +920,128 @@
919
920
  if (l) {
920
921
  i.selectedValues.push(t);
921
922
  }
922
- Q.current[t] = l;
923
- Z.current[t] = i.values.length - 1;
924
- Y.current[t] = e.props.id;
923
+ Y.current[t] = l;
924
+ ee.current[t] = i.values.length - 1;
925
+ Z.current[t] = e.props.id;
925
926
  }));
926
927
  } else {
927
928
  t.Children.toArray(s).filter(t.isValidElement).forEach((function(e) {
928
929
  var r = e.props, t = r.value, n = r.label;
929
- var a = ue.has(t);
930
- var i = ce[a ? 1 : 0];
930
+ var a = ce.has(t);
931
+ var i = se[a ? 1 : 0];
931
932
  i.values.push(t);
932
933
  i.options.push(e);
933
934
  i.matchOptions.push({
934
935
  value: t,
935
936
  label: n
936
937
  });
937
- Z.current[t] = i.values.length - 1;
938
+ ee.current[t] = i.values.length - 1;
938
939
  }));
939
940
  }
940
- var se = (0, t.useCallback)((function(e, r) {
941
- if (e === ae) {
941
+ var ve = (0, t.useCallback)((function(e, r) {
942
+ if (e === ie) {
942
943
  H.current = r;
943
944
  } else {
944
- K.current = r;
945
+ $.current = r;
945
946
  }
946
- }), [ ae ]);
947
- var ve = (0, t.useCallback)((function(e) {
948
- return e === ae ? H.current : K.current;
949
- }), [ ae ]);
950
- var de = (0, t.useCallback)((function(e, r) {
951
- if (e === ae) {
947
+ }), [ ie ]);
948
+ var de = (0, t.useCallback)((function(e) {
949
+ return e === ie ? H.current : $.current;
950
+ }), [ ie ]);
951
+ var fe = (0, t.useCallback)((function(e, r) {
952
+ if (e === ie) {
952
953
  D.current = r;
953
954
  } else {
954
- A.current = r;
955
+ K.current = r;
955
956
  }
956
- }), [ ae ]);
957
- var fe = (0, t.useCallback)((function(e) {
958
- return e === ae ? D.current : A.current;
959
- }), [ ae ]);
957
+ }), [ ie ]);
960
958
  var pe = (0, t.useCallback)((function(e) {
961
- return fe(e).length;
962
- }), [ fe ]);
963
- var be = (0, t.useCallback)((function() {
964
- return J.current;
959
+ return e === ie ? D.current : K.current;
960
+ }), [ ie ]);
961
+ var be = (0, t.useCallback)((function(e) {
962
+ return pe(e).length;
963
+ }), [ pe ]);
964
+ var me = (0, t.useCallback)((function() {
965
+ return Q.current;
965
966
  }), []);
966
- var me = (0, t.useCallback)((function(e) {
967
- return Q.current[e];
967
+ var he = (0, t.useCallback)((function(e) {
968
+ return Y.current[e];
968
969
  }), []);
969
970
  var ge = (0, t.useCallback)((function(e, r) {
970
- if (e === ae) {
971
- j.current = r;
971
+ if (e === ie) {
972
+ B.current = r;
972
973
  } else {
973
- T.current = r;
974
+ A.current = r;
974
975
  }
975
- }), [ ae ]);
976
- var he = (0, t.useCallback)((function(e) {
977
- return e === ae ? j.current : T.current;
978
- }), [ ae ]);
976
+ }), [ ie ]);
979
977
  var ke = (0, t.useCallback)((function(e) {
980
- return he(e).length;
981
- }), [ he ]);
978
+ return e === ie ? B.current : A.current;
979
+ }), [ ie ]);
982
980
  var Ce = (0, t.useCallback)((function(e) {
983
- var r = ke(e);
984
- return r > 0 && r === pe(e);
985
- }), [ ke, pe ]);
981
+ return ke(e).length;
982
+ }), [ ke ]);
986
983
  var Re = (0, t.useCallback)((function(e) {
987
- return e === ae ? M.current : z.current;
988
- }), [ ae ]);
984
+ var r = Ce(e);
985
+ return r > 0 && r === be(e);
986
+ }), [ Ce, be ]);
989
987
  var Ee = (0, t.useCallback)((function(e) {
990
- var r = ke(e);
991
- var t = pe(e);
988
+ return e === ie ? T.current : W.current;
989
+ }), [ ie ]);
990
+ var Ie = (0, t.useCallback)((function(e) {
991
+ var r = Ce(e);
992
+ var t = be(e);
992
993
  return {
993
994
  disabled: r < 1 || t < 1
994
995
  };
995
- }), [ ke, pe ]);
996
- var Ie = (0, t.useCallback)((function() {
997
- if (J.current && J.current.length > 0) {
996
+ }), [ Ce, be ]);
997
+ var Le = (0, t.useCallback)((function() {
998
+ if (Q.current && Q.current.length > 0) {
998
999
  var e;
999
- J.current = "";
1000
- (e = G.current) === null || e === void 0 ? void 0 : e.call(G);
1000
+ Q.current = "";
1001
+ (e = J.current) === null || e === void 0 ? void 0 : e.call(J);
1001
1002
  }
1002
1003
  }), []);
1003
- var Le = (0, t.useCallback)((function() {
1004
- re.current = undefined;
1005
- ne.current = [];
1006
- if (te.current) {
1007
- clearTimeout(te.current);
1004
+ var qe = (0, t.useCallback)((function() {
1005
+ te.current = undefined;
1006
+ ae.current = [];
1007
+ if (ne.current) {
1008
+ clearTimeout(ne.current);
1008
1009
  }
1009
1010
  }), []);
1010
- var qe = (0, t.useCallback)((function(e) {
1011
- G.current = e;
1011
+ var Ne = (0, t.useCallback)((function(e) {
1012
+ J.current = e;
1012
1013
  }), []);
1013
- var Ne = (0, t.useCallback)((function(e, r) {
1014
+ var _e = (0, t.useCallback)((function(e, r) {
1014
1015
  if (r) {
1015
- X.current[e] = r;
1016
+ G.current[e] = r;
1016
1017
  } else {
1017
- delete X.current[e];
1018
+ delete G.current[e];
1018
1019
  }
1019
1020
  }), []);
1020
- var _e = (0, t.useCallback)((function(e, r) {
1021
+ var Ve = (0, t.useCallback)((function(e, r) {
1021
1022
  if (r) {
1022
- W.current[e] = r;
1023
+ X.current[e] = r;
1023
1024
  } else {
1024
- delete W.current[e];
1025
+ delete X.current[e];
1025
1026
  }
1026
1027
  }), []);
1027
- var Ve = (0, t.useCallback)((function(e, r) {
1028
+ var je = (0, t.useCallback)((function(e, r) {
1028
1029
  if (r) {
1029
1030
  U.current[e] = r;
1030
1031
  } else {
1031
1032
  delete U.current[e];
1032
1033
  }
1033
1034
  }), []);
1034
- var je = (0, t.useCallback)((function(e) {
1035
+ var Be = (0, t.useCallback)((function(e) {
1035
1036
  if (e) {
1036
1037
  var r, t;
1037
- (r = (t = X.current)[e]) === null || r === void 0 ? void 0 : r.call(t);
1038
+ (r = (t = G.current)[e]) === null || r === void 0 ? void 0 : r.call(t);
1038
1039
  }
1039
1040
  }), []);
1040
1041
  var De = (0, t.useCallback)((function(e) {
1041
1042
  if (e) {
1042
1043
  var r, t;
1043
- (r = (t = W.current)[e]) === null || r === void 0 ? void 0 : r.call(t);
1044
+ (r = (t = X.current)[e]) === null || r === void 0 ? void 0 : r.call(t);
1044
1045
  }
1045
1046
  }), []);
1046
1047
  var He = (0, t.useCallback)((function(e) {
@@ -1049,30 +1050,30 @@
1049
1050
  (r = (t = U.current)[e]) === null || r === void 0 ? void 0 : r.call(t);
1050
1051
  }
1051
1052
  }), []);
1052
- var Be = (0, t.useCallback)((function(e) {
1053
- Ie();
1053
+ var Me = (0, t.useCallback)((function(e) {
1054
+ Le();
1054
1055
  De(e);
1055
- He(ae);
1056
1056
  He(ie);
1057
- }), [ Ie, He, De, ae, ie ]);
1058
- var Me = (0, t.useCallback)((function(e, r) {
1057
+ He(le);
1058
+ }), [ Le, He, De, ie, le ]);
1059
+ var Te = (0, t.useCallback)((function(e, r) {
1059
1060
  var t = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
1060
- var n = e === ae ? B.current : $.current;
1061
+ var n = e === ie ? M.current : z.current;
1061
1062
  if (!n) {
1062
1063
  return;
1063
1064
  }
1064
- var a = ve(e);
1065
- se(e, r);
1065
+ var a = de(e);
1066
+ ve(e, r);
1066
1067
  if (!t) {
1067
1068
  // render new
1068
- je(r);
1069
+ Be(r);
1069
1070
  }
1070
1071
  if (r !== a) {
1071
1072
  if (!t) {
1072
1073
  // render previous
1073
- je(a);
1074
+ Be(a);
1074
1075
  }
1075
- var i = r ? Y.current[r] : "";
1076
+ var i = r ? Z.current[r] : "";
1076
1077
  // update listbox via dom to avoid render + child render
1077
1078
  n.setAttribute("aria-activedescendant", i);
1078
1079
  if (!t && i.length > 0) {
@@ -1080,30 +1081,30 @@
1080
1081
  O(l);
1081
1082
  }
1082
1083
  }
1083
- }), [ ve, se, je, ae ]);
1084
- var Te = (0, t.useCallback)((function(e, r) {
1084
+ }), [ de, ve, Be, ie ]);
1085
+ var Ae = (0, t.useCallback)((function(e, r) {
1085
1086
  var t = r.value, n = r.name;
1086
- var a = Ce(n) ? he(n) : fe(n);
1087
+ var a = Re(n) ? ke(n) : pe(n);
1087
1088
  var i = x(a, t);
1088
- if (!V.current) {
1089
- Q.current[t] = !Q.current[t];
1090
- de(n, i);
1091
- Be(n);
1089
+ if (!j.current) {
1090
+ Y.current[t] = !Y.current[t];
1091
+ fe(n, i);
1092
+ Me(n);
1092
1093
  }
1093
- Me(n, t);
1094
+ Te(n, t);
1094
1095
  e.preventDefault();
1095
- I === null || I === void 0 ? void 0 : I(e, {
1096
+ q === null || q === void 0 ? void 0 : q(e, {
1096
1097
  values: i,
1097
1098
  listName: n
1098
1099
  });
1099
- }), [ Ce, fe, he, de, Me, Be, I ]);
1100
- var Ae = (0, t.useCallback)((function(e, r) {
1100
+ }), [ Re, pe, ke, fe, Te, Me, q ]);
1101
+ var Ke = (0, t.useCallback)((function(e, r) {
1101
1102
  var t = r.initialIndex, n = r.name, a = r.targetIndex;
1102
- var i = he(n);
1103
+ var i = ke(n);
1103
1104
  var l = Math.min(t, a);
1104
1105
  var o = Math.max(t, a);
1105
1106
  var u = [];
1106
- if (V.current) {
1107
+ if (j.current) {
1107
1108
  u = i.slice(l, o + 1);
1108
1109
  } else {
1109
1110
  i.forEach((function(e, r) {
@@ -1114,75 +1115,75 @@
1114
1115
  } else {
1115
1116
  t = false;
1116
1117
  }
1117
- if (Q.current[e] !== t) {
1118
- Q.current[e] = t;
1119
- je(e);
1118
+ if (Y.current[e] !== t) {
1119
+ Y.current[e] = t;
1120
+ Be(e);
1120
1121
  }
1121
1122
  }));
1122
- de(n, u);
1123
- Be(n);
1123
+ fe(n, u);
1124
+ Me(n);
1124
1125
  }
1125
- Me(n, i[a]);
1126
+ Te(n, i[a]);
1126
1127
  e.preventDefault();
1127
1128
  e.stopPropagation();
1128
- I === null || I === void 0 ? void 0 : I(e, {
1129
+ q === null || q === void 0 ? void 0 : q(e, {
1129
1130
  values: u,
1130
1131
  listName: n
1131
1132
  });
1132
- }), [ he, I, de, Me, Be, je ]);
1133
- var Ke = (0, t.useCallback)((function(e, r) {
1133
+ }), [ ke, q, fe, Te, Me, Be ]);
1134
+ var $e = (0, t.useCallback)((function(e, r) {
1134
1135
  var t = r.name, n = r.selected;
1135
- var a = he(t);
1136
+ var a = ke(t);
1136
1137
  var i = n === true ? [] : a;
1137
1138
  var l = n !== true;
1138
- if (!V.current) {
1139
+ if (!j.current) {
1139
1140
  a === null || a === void 0 ? void 0 : a.forEach((function(e) {
1140
- if (Q.current[e] !== l) {
1141
- Q.current[e] = l;
1142
- je(e);
1141
+ if (Y.current[e] !== l) {
1142
+ Y.current[e] = l;
1143
+ Be(e);
1143
1144
  }
1144
1145
  }));
1145
- de(t, i);
1146
- Be(t);
1146
+ fe(t, i);
1147
+ Me(t);
1147
1148
  }
1148
1149
  e.preventDefault();
1149
- I === null || I === void 0 ? void 0 : I(e, {
1150
+ q === null || q === void 0 ? void 0 : q(e, {
1150
1151
  values: i,
1151
1152
  listName: t
1152
1153
  });
1153
- }), [ he, I, de, Be, je ]);
1154
+ }), [ ke, q, fe, Me, Be ]);
1154
1155
  // handleMoveValues does not update the active value of the source, keyboard and mouse differ, only the target active value is updated
1155
- var $e = (0, t.useCallback)((function(e, r, t) {
1156
- var n = he(r);
1157
- var a = fe(r);
1158
- var i = Ce(r);
1159
- var o = he(t);
1160
- var u = ve(t);
1156
+ var Fe = (0, t.useCallback)((function(e, r, t) {
1157
+ var n = ke(r);
1158
+ var a = pe(r);
1159
+ var i = Re(r);
1160
+ var o = ke(t);
1161
+ var u = de(t);
1161
1162
  if (n.length === 0 || !i && a.length === 0) {
1162
1163
  return;
1163
1164
  }
1164
1165
  if (!u && a.length > 0) {
1165
1166
  // target lacks an active value, default to the first
1166
1167
  // skip the render it will be catch in batch
1167
- Me(t, a[0], true);
1168
+ Te(t, a[0], true);
1168
1169
  }
1169
1170
  var c = (0, d.sprintf)((0, l._)("Moved %(count)d items to %(listLabel)s list"), {
1170
1171
  count: a.length,
1171
- listLabel: t === ae ? le : oe
1172
+ listLabel: t === ie ? oe : ue
1172
1173
  });
1173
1174
  // These new values do not perserve sort position, may need to be refactored with sort logic (SUI-5270).
1174
1175
  var s = i ? [] : S(n, a);
1175
1176
  var v = o.concat(a);
1176
- if (!V.current) {
1177
+ if (!j.current) {
1177
1178
  a.forEach((function(e) {
1178
- Q.current[e] = false;
1179
+ Y.current[e] = false;
1179
1180
  }));
1180
1181
  ge(t, v);
1181
1182
  ge(r, s);
1182
- de(r, []);
1183
- J.current = c;
1183
+ fe(r, []);
1184
+ Q.current = c;
1184
1185
  // move is a batch update, force a full render, no internal update needed
1185
- N();
1186
+ _();
1186
1187
  }
1187
1188
  var f = {
1188
1189
  affectedValues: a,
@@ -1194,40 +1195,40 @@
1194
1195
  values: a.slice()
1195
1196
  };
1196
1197
  e.preventDefault();
1197
- R === null || R === void 0 ? void 0 : R(e, f);
1198
- }), [ N, ve, Ce, fe, he, R, de, ge, Me, ae, le, oe ]);
1199
- var Fe = (0, t.useCallback)((function(e, r) {
1198
+ I === null || I === void 0 ? void 0 : I(e, f);
1199
+ }), [ _, de, Re, pe, ke, I, fe, ge, Te, ie, oe, ue ]);
1200
+ var ze = (0, t.useCallback)((function(e, r) {
1200
1201
  var t = r.name;
1201
- var n = Ce(t);
1202
- var a = ve(t);
1203
- var i = t === ae ? ie : ae;
1204
- if (a && (n || !!Q.current[a])) {
1202
+ var n = Re(t);
1203
+ var a = de(t);
1204
+ var i = t === ie ? le : ie;
1205
+ if (a && (n || !!Y.current[a])) {
1205
1206
  // active option was present in items to be removed, clear the active option
1206
- Me(t);
1207
+ Te(t);
1207
1208
  }
1208
- $e(e, t, i);
1209
- }), [ ve, Ce, $e, Me, ae, ie ]);
1210
- var ze = (0, t.useCallback)((function(e, r) {
1209
+ Fe(e, t, i);
1210
+ }), [ de, Re, Fe, Te, ie, le ]);
1211
+ var We = (0, t.useCallback)((function(e, r) {
1211
1212
  var t = r.name, n = r.value;
1212
1213
  if (e.nativeEvent.shiftKey) {
1213
- Ae(e, {
1214
- targetIndex: Z.current[n],
1215
- initialIndex: ee.current,
1214
+ Ke(e, {
1215
+ targetIndex: ee.current[n],
1216
+ initialIndex: re.current,
1216
1217
  name: t
1217
1218
  });
1218
1219
  } else {
1219
- Te(e, {
1220
+ Ae(e, {
1220
1221
  name: t,
1221
1222
  value: n
1222
1223
  });
1223
1224
  }
1224
- }), [ Ae, Te ]);
1225
+ }), [ Ke, Ae ]);
1225
1226
  var Ue = (0, t.useCallback)((function(e, r) {
1226
- Ke(e, r);
1227
- }), [ Ke ]);
1228
- var We = (0, t.useCallback)((function(e, r) {
1227
+ $e(e, r);
1228
+ }), [ $e ]);
1229
+ var Xe = (0, t.useCallback)((function(e, r) {
1229
1230
  var t = e.nativeEvent.key;
1230
- var n = Re(r);
1231
+ var n = Ee(r);
1231
1232
  // Checking for a single character to avoid complications from double-byte languages and emojis.
1232
1233
  if (t.length === 1) {
1233
1234
  var a = [];
@@ -1235,21 +1236,21 @@
1235
1236
  index: 0,
1236
1237
  value: t
1237
1238
  };
1238
- if (!re.current) {
1239
+ if (!te.current) {
1239
1240
  if (t === " ") {
1240
- Le();
1241
+ qe();
1241
1242
  return;
1242
1243
  }
1243
1244
  a = E(n, i);
1244
- } else if (ne.current.length > 1) {
1245
- i.index = re.current.index + 1;
1246
- a = E(ne.current, i);
1245
+ } else if (ae.current.length > 1) {
1246
+ i.index = te.current.index + 1;
1247
+ a = E(ae.current, i);
1247
1248
  }
1248
1249
  if (a.length) {
1249
1250
  var l = 0;
1250
1251
  // If the active option is a first character match, cycle to the next matching option.
1251
1252
  if (i.index === 0 && a.length > 1) {
1252
- var o = ve(r);
1253
+ var o = de(r);
1253
1254
  if (o) {
1254
1255
  var u = a.findIndex((function(e) {
1255
1256
  return e.value === o;
@@ -1259,40 +1260,40 @@
1259
1260
  }
1260
1261
  }
1261
1262
  }
1262
- Me(r, a[l].value);
1263
+ Te(r, a[l].value);
1263
1264
  }
1264
- ne.current = a;
1265
- re.current = i;
1266
- if (te.current) {
1267
- clearTimeout(te.current);
1265
+ ae.current = a;
1266
+ te.current = i;
1267
+ if (ne.current) {
1268
+ clearTimeout(ne.current);
1268
1269
  }
1269
- te.current = setTimeout(Le, 500);
1270
+ ne.current = setTimeout(qe, 500);
1270
1271
  e.preventDefault();
1271
1272
  e.stopPropagation();
1272
1273
  }
1273
- }), [ ve, Re, Le, Me ]);
1274
- var Xe = (0, t.useCallback)((function(e, r) {
1274
+ }), [ de, Ee, qe, Te ]);
1275
+ var Ge = (0, t.useCallback)((function(e, r) {
1275
1276
  var t = r.name;
1276
1277
  var n = (0, o.keycode)(e.nativeEvent);
1277
- var a = he(t);
1278
- var i = fe(t);
1279
- var l = Ce(t);
1280
- var u = ve(t);
1281
- var c = u ? Z.current[u] : -1;
1282
- var s = ee.current >= 0 ? ee.current : 0;
1283
- if (J.current && J.current.length > 0) {
1284
- Ie();
1278
+ var a = ke(t);
1279
+ var i = pe(t);
1280
+ var l = Re(t);
1281
+ var u = de(t);
1282
+ var c = u ? ee.current[u] : -1;
1283
+ var s = re.current >= 0 ? re.current : 0;
1284
+ if (Q.current && Q.current.length > 0) {
1285
+ Le();
1285
1286
  }
1286
1287
  var v = u;
1287
1288
  switch (n) {
1288
1289
  case "shift":
1289
- ee.current = c;
1290
+ re.current = c;
1290
1291
  break;
1291
1292
 
1292
1293
  case "home":
1293
1294
  if (e.nativeEvent.ctrlKey && e.nativeEvent.shiftKey) {
1294
1295
  // handle select until start
1295
- Ae(e, {
1296
+ Ke(e, {
1296
1297
  targetIndex: 0,
1297
1298
  initialIndex: s,
1298
1299
  name: t
@@ -1306,7 +1307,7 @@
1306
1307
  case "end":
1307
1308
  if (e.nativeEvent.ctrlKey && e.nativeEvent.shiftKey) {
1308
1309
  // handle select until end
1309
- Ae(e, {
1310
+ Ke(e, {
1310
1311
  targetIndex: a.length - 1,
1311
1312
  initialIndex: s,
1312
1313
  name: t
@@ -1319,7 +1320,7 @@
1319
1320
  case "up":
1320
1321
  if (e.nativeEvent.shiftKey) {
1321
1322
  // handle select until previous
1322
- Ae(e, {
1323
+ Ke(e, {
1323
1324
  targetIndex: Math.max(c - 1, 0),
1324
1325
  initialIndex: s,
1325
1326
  name: t
@@ -1332,7 +1333,7 @@
1332
1333
  case "down":
1333
1334
  if (e.nativeEvent.shiftKey) {
1334
1335
  // handle select until next
1335
- Ae(e, {
1336
+ Ke(e, {
1336
1337
  targetIndex: Math.min(c + 1, a.length - 1),
1337
1338
  initialIndex: s,
1338
1339
  name: t
@@ -1344,7 +1345,7 @@
1344
1345
 
1345
1346
  case "space":
1346
1347
  if (u != null) {
1347
- Te(e, {
1348
+ Ae(e, {
1348
1349
  name: t,
1349
1350
  value: u
1350
1351
  });
@@ -1352,7 +1353,7 @@
1352
1353
  break;
1353
1354
 
1354
1355
  case "enter":
1355
- if (t === ae) {
1356
+ if (t === ie) {
1356
1357
  if (l) {
1357
1358
  // all values moved, no longer an active value
1358
1359
  v = undefined;
@@ -1360,12 +1361,12 @@
1360
1361
  // somes values moved, determine next active value
1361
1362
  v = w(c, a, i);
1362
1363
  }
1363
- $e(e, ae, ie);
1364
+ Fe(e, ie, le);
1364
1365
  }
1365
1366
  break;
1366
1367
 
1367
1368
  case "delete":
1368
- if (t === ie) {
1369
+ if (t === le) {
1369
1370
  if (l) {
1370
1371
  // all values moved, no longer an active value
1371
1372
  v = undefined;
@@ -1373,108 +1374,109 @@
1373
1374
  // somes values moved, determine next active value
1374
1375
  v = w(c, a, i);
1375
1376
  }
1376
- $e(e, ie, ae);
1377
+ Fe(e, le, ie);
1377
1378
  }
1378
1379
  break;
1379
1380
 
1380
1381
  default:
1381
1382
  if (n === "a" && (e.nativeEvent.ctrlKey || e.nativeEvent.metaKey)) {
1382
1383
  // handle control + A, otherwise let 'a' passthrough
1383
- Ke(e, {
1384
+ $e(e, {
1384
1385
  name: t,
1385
1386
  selected: l
1386
1387
  });
1387
1388
  } else {
1388
1389
  // do fuzzy match
1389
- We(e, t);
1390
+ Xe(e, t);
1390
1391
  }
1391
1392
  break;
1392
1393
  }
1393
1394
  if (v !== u) {
1394
1395
  e.preventDefault();
1395
- Me(t, v);
1396
+ Te(t, v);
1396
1397
  }
1397
- }), [ Ie, ve, Ce, fe, he, We, $e, Ae, Te, Ke, Me, ae, ie ]);
1398
- var Ge = (0, t.useMemo)((function() {
1398
+ }), [ Le, de, Re, pe, ke, Xe, Fe, Ke, Ae, $e, Te, ie, le ]);
1399
+ var Je = (0, t.useMemo)((function() {
1399
1400
  return {
1400
- onButtonClick: Fe,
1401
- updateButtonRefreshHookByName: Ve,
1402
- getButtonState: Ee
1401
+ onButtonClick: ze,
1402
+ updateButtonRefreshHookByName: je,
1403
+ getButtonState: Ie
1403
1404
  };
1404
- }), [ Fe, Ve, Ee ]);
1405
- var Je = (0, t.useMemo)((function() {
1405
+ }), [ ze, je, Ie ]);
1406
+ var Qe = (0, t.useMemo)((function() {
1406
1407
  return {
1407
- controlled: V.current,
1408
- getActiveValue: ve,
1409
- getScreenReaderMessage: be,
1410
- getSelectedStateForValue: me,
1411
- getSelectedValueCount: pe,
1412
- getValueCount: ke,
1413
- updateLabelRefreshHookByName: _e,
1414
- updateOptionRefreshHookByValue: Ne,
1415
- updateScreenReaderRefreshHook: qe
1408
+ controlled: j.current,
1409
+ getActiveValue: de,
1410
+ getScreenReaderMessage: me,
1411
+ getSelectedStateForValue: he,
1412
+ getSelectedValueCount: be,
1413
+ getValueCount: Ce,
1414
+ updateLabelRefreshHookByName: Ve,
1415
+ updateOptionRefreshHookByValue: _e,
1416
+ updateScreenReaderRefreshHook: Ne
1416
1417
  };
1417
- }), [ ve, be, me, pe, ke, _e, Ne, qe ]);
1418
- if (V.current && !ce[0].activeFound) {
1418
+ }), [ de, me, he, be, Ce, Ve, _e, Ne ]);
1419
+ if (j.current && !se[0].activeFound) {
1419
1420
  // listOne active value wasn't found, likely the result of a controlled state reset
1420
1421
  // update interal values, skip the render it will be caught in batch
1421
- Me(ae, undefined, true);
1422
+ Te(ie, undefined, true);
1422
1423
  }
1423
- if (V.current && !ce[1].activeFound) {
1424
+ if (j.current && !se[1].activeFound) {
1424
1425
  // listTwo active value wasn't found, likely the result of a controlled state reset
1425
1426
  // update interal values, skip the render it will be caught in batch
1426
- Me(ie, undefined, true);
1427
+ Te(le, undefined, true);
1427
1428
  }
1428
1429
 
1429
1430
  return n().createElement(xe, we({
1430
1431
  "data-test": "dual-listbox",
1431
- $inline: g ? false : k,
1432
- $fill: g
1433
- }, P), n().createElement(h.Provider, {
1434
- value: Je
1432
+ elementRef: m,
1433
+ $inline: y ? false : R,
1434
+ $fill: y
1435
+ }, N), n().createElement(g.Provider, {
1436
+ value: Qe
1435
1437
  }, n().createElement(ye, {
1436
1438
  index: 0,
1437
- elementRef: B,
1438
- label: le,
1439
- name: ae,
1440
- onClick: ze,
1441
- onKeyDown: Xe,
1439
+ elementRef: M,
1440
+ label: oe,
1441
+ name: ie,
1442
+ onClick: We,
1443
+ onKeyDown: Ge,
1442
1444
  onSelectAllClick: Ue
1443
- }, ce[0].options), n().createElement(Se, null, n().createElement(L.Provider, {
1444
- value: Ge
1445
+ }, se[0].options), n().createElement(Se, null, n().createElement(L.Provider, {
1446
+ value: Je
1445
1447
  }, n().createElement(F, {
1446
1448
  ariaLabel: (0, d.sprintf)((0, l._)("Move selected options to %(listLabel)s list"), {
1447
- listLabel: oe
1449
+ listLabel: ue
1448
1450
  }),
1449
1451
  ariaKeyShortcuts: "Enter",
1450
1452
  "data-test": "move-to-secondary",
1451
1453
  icon: n().createElement(v(), null),
1452
- name: ae,
1454
+ name: ie,
1453
1455
  tooltipLabel: (0, d.sprintf)((0, l._)("Move to %(listLabel)s"), {
1454
- listLabel: oe
1456
+ listLabel: ue
1455
1457
  }),
1456
1458
  tooltipPlacement: "left"
1457
1459
  }), n().createElement(F, {
1458
1460
  ariaLabel: (0, d.sprintf)((0, l._)("Move selected options to %(listLabel)s list"), {
1459
- listLabel: le
1461
+ listLabel: oe
1460
1462
  }),
1461
1463
  ariaKeyShortcuts: "Delete",
1462
1464
  "data-test": "move-to-primary",
1463
1465
  icon: n().createElement(c(), null),
1464
- name: ie,
1466
+ name: le,
1465
1467
  tooltipLabel: (0, d.sprintf)((0, l._)("Move to %(listLabel)s"), {
1466
- listLabel: le
1468
+ listLabel: oe
1467
1469
  }),
1468
1470
  tooltipPlacement: "right"
1469
1471
  }))), n().createElement(ye, {
1470
1472
  index: 1,
1471
- elementRef: $,
1472
- label: oe,
1473
- name: ie,
1474
- onClick: ze,
1475
- onKeyDown: Xe,
1473
+ elementRef: z,
1474
+ label: ue,
1475
+ name: le,
1476
+ onClick: We,
1477
+ onKeyDown: Ge,
1476
1478
  onSelectAllClick: Ue
1477
- }, ce[1].options), n().createElement(C, null)));
1479
+ }, se[1].options), n().createElement(C, null)));
1478
1480
  }
1479
1481
  Ve.propTypes = _e;
1480
1482
  Ve.Option = ne;