@splunk/react-ui 5.0.0 → 5.1.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 (94) hide show
  1. package/Accordion.js +59 -59
  2. package/Avatar.js +20 -20
  3. package/Breadcrumbs.js +46 -46
  4. package/Button.js +24 -24
  5. package/CHANGELOG.md +21 -2
  6. package/Calendar.js +69 -69
  7. package/Card.js +68 -68
  8. package/Chip.js +16 -16
  9. package/Clickable.js +29 -29
  10. package/Code.js +654 -519
  11. package/CollapsiblePanel.js +112 -112
  12. package/Color.js +107 -107
  13. package/ColumnLayout.js +35 -35
  14. package/ComboBox.js +190 -206
  15. package/ControlGroup.js +128 -120
  16. package/Date.js +148 -146
  17. package/DefinitionList.js +26 -26
  18. package/DualListbox.js +701 -717
  19. package/File.js +403 -403
  20. package/FormRows.js +66 -63
  21. package/Image.js +15 -15
  22. package/JSONTree.js +458 -357
  23. package/Layer.js +60 -72
  24. package/Markdown.js +66 -66
  25. package/Menu.js +44 -44
  26. package/Modal.js +49 -49
  27. package/ModalLayer.js +6 -6
  28. package/Monogram.js +16 -16
  29. package/Multiselect.js +622 -624
  30. package/Number.js +100 -100
  31. package/Paginator.js +7 -7
  32. package/Popover.js +453 -407
  33. package/Progress.js +12 -12
  34. package/Prose.js +6 -6
  35. package/RadioBar.js +180 -166
  36. package/RadioList.js +80 -79
  37. package/ResultsMenu.js +15 -15
  38. package/Scroll.js +50 -50
  39. package/Search.js +148 -164
  40. package/Select.js +668 -670
  41. package/Slider.js +30 -30
  42. package/SlidingPanels.js +24 -24
  43. package/SplitButton.js +50 -50
  44. package/StepBar.js +100 -100
  45. package/Switch.js +45 -45
  46. package/TabBar.js +196 -196
  47. package/TabLayout.js +16 -16
  48. package/Table.js +1207 -1193
  49. package/Text.js +65 -65
  50. package/TextArea.js +108 -93
  51. package/Tooltip.js +203 -197
  52. package/Tree.js +464 -366
  53. package/package.json +6 -6
  54. package/stubs-dependencies.d.ts +0 -70
  55. package/stubs-splunkui.d.ts +4 -0
  56. package/types/src/Code/Code.d.ts +17 -1
  57. package/types/src/Code/LineHighlights.d.ts +11 -0
  58. package/types/src/Code/LineNumbers.d.ts +6 -0
  59. package/types/src/Code/docs/examples/LineHighlights.d.ts +3 -0
  60. package/types/src/Code/docs/examples/LineNumbers.d.ts +3 -0
  61. package/types/src/Code/docs/examples/LineNumbersCustomStart.d.ts +3 -0
  62. package/types/src/Date/Date.d.ts +6 -1
  63. package/types/src/DefinitionList/DefinitionList.d.ts +6 -6
  64. package/types/src/FormRows/FormRows.d.ts +1 -1
  65. package/types/src/JSONTree/JSONTreeItem.d.ts +5 -2
  66. package/types/src/Markdown/Markdown.d.ts +1 -1
  67. package/types/src/Markdown/renderers/MarkdownBlockquote.d.ts +1 -1
  68. package/types/src/Markdown/renderers/MarkdownCodeBlock.d.ts +1 -1
  69. package/types/src/Markdown/renderers/index.d.ts +1 -1
  70. package/types/src/Popover/Popover.d.ts +1 -1
  71. package/types/src/RadioBar/Option.d.ts +1 -1
  72. package/types/src/RadioBar/RadioBar.d.ts +13 -6
  73. package/types/src/RadioBar/RadioBarContext.d.ts +4 -2
  74. package/types/src/RadioList/RadioList.d.ts +2 -1
  75. package/types/src/ScreenReaderContent/docs/examples/SkipLink.d.ts +3 -0
  76. package/types/src/Scroll/Inner.d.ts +1 -1
  77. package/types/src/Select/Option.d.ts +1 -1
  78. package/types/src/Select/Select.d.ts +1 -1
  79. package/types/src/Slider/docs/examples/Controlled.d.ts +1 -1
  80. package/types/src/TabLayout/Panel.d.ts +0 -1
  81. package/types/src/Table/Head.d.ts +1 -0
  82. package/types/src/Table/HeadCell.d.ts +2 -3
  83. package/types/src/Table/HeadDropdownCell.d.ts +2 -2
  84. package/types/src/Table/HeadInner.d.ts +4 -4
  85. package/types/src/Table/KeyboardSensor.d.ts +1 -1
  86. package/types/src/Table/RowDragCell.d.ts +1 -1
  87. package/types/src/Tooltip/Tooltip.d.ts +10 -5
  88. package/types/src/Tree/Item.d.ts +63 -0
  89. package/types/src/Tree/Tree.d.ts +13 -6
  90. package/types/src/Tree/TreeContext.d.ts +1 -1
  91. package/types/src/Tree/index.d.ts +1 -1
  92. package/types/src/useControlled/useControlled.d.ts +3 -1
  93. package/useControlled.js +29 -13
  94. package/types/src/Tree/TreeItem.d.ts +0 -44
package/DualListbox.js CHANGED
@@ -61,7 +61,7 @@
61
61
  e.r(r);
62
62
  // EXPORTS
63
63
  e.d(r, {
64
- Option: () => /* reexport */ ne,
64
+ Option: () => /* reexport */ ae,
65
65
  default: () => /* reexport */ Ve
66
66
  });
67
67
  // CONCATENATED MODULE: external "react"
@@ -70,22 +70,21 @@
70
70
  // CONCATENATED MODULE: external "prop-types"
71
71
  const a = require("prop-types");
72
72
  var l = e.n(a);
73
- // CONCATENATED MODULE: external "@splunk/ui-utils/i18n"
74
- const i = require("@splunk/ui-utils/i18n");
75
73
  // CONCATENATED MODULE: external "@splunk/react-icons/ChevronLeft"
76
- const o = require("@splunk/react-icons/ChevronLeft");
77
- var u = e.n(o);
74
+ const i = require("@splunk/react-icons/ChevronLeft");
75
+ var u = e.n(i);
78
76
  // CONCATENATED MODULE: external "@splunk/react-icons/ChevronRight"
79
- const c = require("@splunk/react-icons/ChevronRight");
80
- var s = e.n(c);
81
- // CONCATENATED MODULE: external "@splunk/ui-utils/format"
82
- const v = require("@splunk/ui-utils/format");
77
+ const o = require("@splunk/react-icons/ChevronRight");
78
+ var c = e.n(o);
83
79
  // CONCATENATED MODULE: external "@splunk/react-ui/useForceUpdate"
84
- const f = require("@splunk/react-ui/useForceUpdate");
85
- var d = e.n(f);
86
- // CONCATENATED MODULE: external "@splunk/react-ui/ScreenReaderContent"
87
- const p = require("@splunk/react-ui/ScreenReaderContent");
88
- var b = e.n(p);
80
+ const s = require("@splunk/react-ui/useForceUpdate");
81
+ var v = e.n(s);
82
+ // CONCATENATED MODULE: external "@splunk/ui-utils/format"
83
+ const d = require("@splunk/ui-utils/format");
84
+ // CONCATENATED MODULE: external "@splunk/ui-utils/i18n"
85
+ const f = require("@splunk/ui-utils/i18n");
86
+ // CONCATENATED MODULE: external "@splunk/ui-utils/scroll"
87
+ const p = require("@splunk/ui-utils/scroll");
89
88
  // CONCATENATED MODULE: ./src/DualListbox/DualListboxContext.tsx
90
89
  /**
91
90
  * A React context used to inform subcomponets of DualListbox of parent component values.
@@ -93,164 +92,123 @@
93
92
  * Defaults to `'{}'`.
94
93
  * @public
95
94
  */
96
- var m = n().createContext({});
97
- /* harmony default export */ const h = m;
98
- // CONCATENATED MODULE: ./src/DualListbox/ScreenReaderWrapper.tsx
99
- function g() {
100
- return g = Object.assign ? Object.assign.bind() : function(e) {
101
- for (var r = 1; r < arguments.length; r++) {
102
- var t = arguments[r];
103
- for (var n in t) {
104
- ({}).hasOwnProperty.call(t, n) && (e[n] = t[n]);
105
- }
106
- }
107
- return e;
108
- }, g.apply(null, arguments);
109
- }
110
- function y(e) {
111
- var r = g({}, e);
112
- var a = d()();
113
- var l = (0, t.useContext)(h);
114
- var i = l.getScreenReaderMessage, o = l.updateScreenReaderRefreshHook;
95
+ var b = n().createContext({});
96
+ /* harmony default export */ const m = b;
97
+ // CONCATENATED MODULE: external "styled-components"
98
+ const h = require("styled-components");
99
+ var g = e.n(h);
100
+ // CONCATENATED MODULE: external "@splunk/react-ui/Box"
101
+ const y = require("@splunk/react-ui/Box");
102
+ var k = e.n(y);
103
+ // CONCATENATED MODULE: external "@splunk/themes"
104
+ const C = require("@splunk/themes");
105
+ // CONCATENATED MODULE: ./src/DualListbox/DualListboxStyles.ts
106
+ var S = g()(k()).withConfig({
107
+ displayName: "DualListboxStyles__StyledBox",
108
+ componentId: "sc-1te6bz0-0"
109
+ })([ "display:grid;grid-template-columns:[list0] 180px [actions] min-content [list1] 180px;grid-template-rows:[headers] min-content [lists] 160px;gap:", " ", ";", " ", "" ], C.variables.spacingXSmall, C.variables.spacingSmall, (function(e) {
110
+ var r = e.$inline;
111
+ return r && (0, h.css)([ "display:inline-grid;" ]);
112
+ }), (function(e) {
113
+ var r = e.$fill;
114
+ return r && (0, h.css)([ "height:100%;grid-template-columns:[list0] 1fr [actions] min-content [list1] 1fr;grid-template-rows:[headers] min-content [lists] 1fr;position:relative;width:100%;" ]);
115
+ }));
116
+ var w = g().div.withConfig({
117
+ displayName: "DualListboxStyles__StyledFlexColumn",
118
+ componentId: "sc-1te6bz0-1"
119
+ })([ "&::before{content:'';grid-column:headers;grid-row:lists;}align-items:center;display:flex;flex-direction:column;gap:", ";grid-column:actions;grid-row:lists;justify-content:center;" ], C.variables.spacingSmall);
120
+ // CONCATENATED MODULE: external "@splunk/ui-utils/id"
121
+ const x = require("@splunk/ui-utils/id");
122
+ // CONCATENATED MODULE: external "@splunk/react-ui/ScreenReaderContent"
123
+ const O = require("@splunk/react-ui/ScreenReaderContent");
124
+ var R = e.n(O);
125
+ // CONCATENATED MODULE: external "@splunk/react-ui/Switch"
126
+ const E = require("@splunk/react-ui/Switch");
127
+ var I = e.n(E);
128
+ // CONCATENATED MODULE: ./src/DualListbox/LabelStyles.ts
129
+ var q = g().label.withConfig({
130
+ displayName: "LabelStyles__StyledLabel",
131
+ componentId: "unwplx-0"
132
+ })([ "color:", ";flex:0 0 auto;" ], C.variables.contentColorActive);
133
+ var L = g().div.withConfig({
134
+ displayName: "LabelStyles__StyledLabelContainer",
135
+ componentId: "unwplx-1"
136
+ })([ "display:flex;flex-direction:column;" ]);
137
+ var N = g().div.withConfig({
138
+ displayName: "LabelStyles__StyledSwitchContainer",
139
+ componentId: "unwplx-2"
140
+ })([ "align-items:center;border:", " solid transparent;display:flex;gap:", ";grid-row:headers;padding:0 ", ";", "" ], C.variables.inputBorderWidth, C.variables.spacingSmall, C.variables.spacingSmall, (function(e) {
141
+ var r = e.$columnNumber;
142
+ return (0, h.css)([ "grid-column:", ";" ], "list".concat(r));
143
+ }));
144
+ // CONCATENATED MODULE: ./src/DualListbox/ListboxContext.tsx
145
+ /**
146
+ * A React context used to inform subcomponets of Listbox of parent component values.
147
+ * The context interface is `ListboxContextValue`.
148
+ * Defaults to `'{}'`.
149
+ * @public
150
+ */
151
+ var P = n().createContext({});
152
+ /* harmony default export */ const _ = P;
153
+ // CONCATENATED MODULE: ./src/DualListbox/Label.tsx
154
+ var j = {
155
+ id: l().string.isRequired,
156
+ index: l().number.isRequired,
157
+ listId: l().string.isRequired,
158
+ name: l().string.isRequired,
159
+ onSwitchClick: l().func,
160
+ value: l().string.isRequired
161
+ };
162
+ function V(e) {
163
+ var r = e.id, a = e.index, l = e.listId, i = e.name, u = e.onSwitchClick, o = e.value;
164
+ var c = (0, t.useContext)(_);
165
+ var s = v()();
166
+ var p = (0, t.useRef)((0, x.createDOMID)("switch"));
167
+ var b = c.updateLabelRefreshHookByName, m = c.getLabelState;
115
168
  (0, t.useEffect)((function() {
116
- o === null || o === void 0 ? void 0 : o(a);
169
+ b === null || b === void 0 ? void 0 : b(i, s);
117
170
  return function() {
118
- return o === null || o === void 0 ? void 0 : o();
171
+ return b === null || b === void 0 ? void 0 : b(i);
119
172
  };
120
- }), [ o, a ]);
121
- if (!i) {
173
+ }), [ i, b, s ]);
174
+ if (!m) {
122
175
  return null;
123
176
  }
177
+ var h = m(), g = h.disabled, y = h.selected, k = h.selectedValueCount, C = h.valueCount;
124
178
 
125
- return n().createElement(b(), g({
126
- "aria-live": "assertive"
127
- }, r), i() || "");
179
+ return n().createElement(N, {
180
+ $columnNumber: a
181
+ }, n().createElement(R(), {
182
+ "aria-hidden": true,
183
+ id: p.current
184
+ }, (0, d.sprintf)((0, f._)("Select all %(listName)s Options"), {
185
+ listName: o
186
+ })), n().createElement(I(), {
187
+ appearance: "checkbox",
188
+ "data-test": "select-all",
189
+ disabled: g,
190
+ labelledBy: p.current,
191
+ onClick: u,
192
+ selected: y,
193
+ value: o
194
+ }), n().createElement(L, null, n().createElement(q, {
195
+ id: r,
196
+ htmlFor: l
197
+ }, o), n().createElement("span", {
198
+ "aria-hidden": true
199
+ }, "".concat(k, "/").concat(C, " selected"))));
128
200
  }
129
- /* harmony default export */ const k = y;
130
- // CONCATENATED MODULE: ./src/DualListbox/listboxUtils.ts
131
- var C = function e(r, t) {
132
- var n = r.filter((function(e) {
133
- return e !== t;
134
- }));
135
- if (r.length === n.length) {
136
- n.push(t);
137
- }
138
- return n;
139
- };
140
- var S = function e(r, t) {
141
- var n = new Set(t);
142
- return r.filter((function(e) {
143
- return !n.has(e);
144
- }));
145
- };
146
- var w = function e(r, t, n) {
147
- if (r < 0) {
148
- return undefined;
149
- }
150
- var a = t[r];
151
- var l = new Set(n);
152
- if (!l.has(a)) {
153
- return a;
154
- }
155
- for (var i = r + 1; i < t.length; i += 1) {
156
- var o = t[i];
157
- if (!l.has(o)) {
158
- return o;
159
- }
160
- }
161
- for (var u = r - 1; u > 0; u -= 1) {
162
- var c = t[u];
163
- if (!l.has(c)) {
164
- return c;
165
- }
166
- }
167
- return undefined;
168
- };
169
- // CONCATENATED MODULE: ./src/utils/scrollIntoViewIfNeeded.ts
170
- // A utility that attempts to move an element into view by scrolling it's derived parent.
171
- var x = function e(r) {
172
- if (!r) {
173
- return;
174
- }
175
- var t = r.offsetParent;
176
- if (!t) {
177
- return;
178
- }
179
- // Below the bottom of the container.
180
- if (t.scrollTop + t.clientHeight < r.offsetTop + r.clientHeight) {
181
- t.scrollTop = r.offsetTop + r.clientHeight - t.clientHeight;
182
- // Above the top of the container.
183
- } else if (t.scrollTop > r.offsetTop) {
184
- t.scrollTop = r.offsetTop;
185
- }
186
- };
187
- // CONCATENATED MODULE: ./src/utils/fuzzyMatch.ts
188
- // A utility for matching keyboard characters to list values
189
- var O = function e(r, t) {
190
- return r ? r.label.charAt(t).toLowerCase() : "";
191
- };
192
- var R = function e(r, t) {
193
- if (!r.length) {
194
- return r;
195
- }
196
- var n = null;
197
- var a = false;
198
- var l = r.filter((function(e) {
199
- var r = O(e, t.index);
200
- if (r === t.value) {
201
- a = true;
202
- return true;
203
- }
204
- // If we haven't found a match yet, keep track of the next closest match.
205
- // Secondary matching looks for the closest character of a higher value, and failing that, closest of a lower value.
206
- if (!a) {
207
- var l = O(n, t.index);
208
- if (!l) {
209
- n = e;
210
- } else if (r > t.value) {
211
- if (l < t.value) {
212
- n = e;
213
- } else if (l > r) {
214
- n = e;
215
- }
216
- } else if (r > l) {
217
- n = e;
218
- }
219
- }
220
- return false;
221
- }));
222
- return l.length === 0 && n ? [ n ] : l;
223
- };
224
- // CONCATENATED MODULE: ./src/DualListbox/ToolbarContext.tsx
225
- /**
226
- * A React context used to inform subcomponets of Toolbar of parent component values.
227
- * The context interface is `ToolbarContextValue`.
228
- * Defaults to `'{}'`.
229
- * @public
230
- */
231
- var E = n().createContext({});
232
- /* harmony default export */ const I = E;
233
- // CONCATENATED MODULE: external "@splunk/react-ui/Tooltip"
234
- const L = require("@splunk/react-ui/Tooltip");
235
- var q = e.n(L);
236
- // CONCATENATED MODULE: external "styled-components"
237
- const P = require("styled-components");
238
- var N = e.n(P);
239
- // CONCATENATED MODULE: external "@splunk/react-ui/ButtonSimple"
240
- const _ = require("@splunk/react-ui/ButtonSimple");
241
- var j = e.n(_);
242
- // CONCATENATED MODULE: external "@splunk/themes"
243
- const V = require("@splunk/themes");
244
- // CONCATENATED MODULE: ./src/DualListbox/ToolbarButtonStyles.ts
245
- var B = N()(j()).withConfig({
246
- displayName: "ToolbarButtonStyles__StyledButtonSimple",
247
- componentId: "k7zksz-0"
248
- })([ "height:", ";width:", ";" ], V.variables.inputHeight, V.variables.inputHeight);
249
- var D = N().span.withConfig({
250
- displayName: "ToolbarButtonStyles__StyledIcon",
251
- componentId: "k7zksz-1"
252
- })([ "align-items:center;display:flex;flex-direction:row;flex-shrink:0;justify-content:center;max-width:100%;" ]);
253
- // CONCATENATED MODULE: ./src/DualListbox/ToolbarButton.tsx
201
+ V.propTypes = j;
202
+ /* harmony default export */ const B = V;
203
+ // CONCATENATED MODULE: ./src/DualListbox/ListboxStyles.ts
204
+ var D = g().ul.withConfig({
205
+ displayName: "ListboxStyles__StyledListbox",
206
+ componentId: "sc-11oqtd-0"
207
+ })([ "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;}", "" ], C.variables.transparent, C.variables.inputBorderWidth, C.variables.interactiveColorBorder, C.variables.borderRadius, C.variables.focusShadow, (function(e) {
208
+ var r = e.$columnNumber;
209
+ return (0, h.css)([ "grid-column:", ";" ], "list".concat(r));
210
+ }));
211
+ // CONCATENATED MODULE: ./src/DualListbox/Listbox.tsx
254
212
  function M() {
255
213
  return M = Object.assign ? Object.assign.bind() : function(e) {
256
214
  for (var r = 1; r < arguments.length; r++) {
@@ -262,9 +220,9 @@
262
220
  return e;
263
221
  }, M.apply(null, arguments);
264
222
  }
265
- function T(e, r) {
223
+ function A(e, r) {
266
224
  if (null == e) return {};
267
- var t, n, a = A(e, r);
225
+ var t, n, a = H(e, r);
268
226
  if (Object.getOwnPropertySymbols) {
269
227
  var l = Object.getOwnPropertySymbols(e);
270
228
  for (n = 0; n < l.length; n++) {
@@ -273,7 +231,7 @@
273
231
  }
274
232
  return a;
275
233
  }
276
- function A(e, r) {
234
+ function H(e, r) {
277
235
  if (null == e) return {};
278
236
  var t = {};
279
237
  for (var n in e) {
@@ -284,85 +242,167 @@
284
242
  }
285
243
  return t;
286
244
  }
287
- var H = {
288
- icon: l().node.isRequired,
245
+ var T = {
246
+ children: l().node,
247
+ index: l().number.isRequired,
248
+ label: l().string.isRequired,
249
+ multiSelect: l().bool,
289
250
  name: l().string.isRequired,
290
- tooltipLabel: l().string.isRequired,
291
- tooltipPlacement: l().oneOf([ "above", "below", "left", "right" ])
251
+ onClick: l().func,
252
+ onKeyDown: l().func,
253
+ onSelectAllClick: l().func
292
254
  };
293
255
  function K(e) {
294
- var r = e.ariaLabel, a = e.ariaKeyShortcuts, l = e.icon, i = e.name, o = e.tooltipLabel, u = e.tooltipPlacement, c = T(e, [ "ariaLabel", "ariaKeyShortcuts", "icon", "name", "tooltipLabel", "tooltipPlacement" ]);
295
- var s = (0, t.useContext)(I);
296
- var v = d()();
297
- var f = s.getButtonState, p = s.onButtonClick, b = s.updateButtonRefreshHookByName;
298
- (0, t.useEffect)((function() {
299
- b === null || b === void 0 ? void 0 : b(i, v);
300
- return function() {
301
- return b === null || b === void 0 ? void 0 : b(i);
256
+ var r = e.children, a = e.elementRef, l = e.index, i = e.label, u = e.name, o = e.onClick, c = e.onKeyDown, s = e.onSelectAllClick, v = A(e, [ "children", "elementRef", "index", "label", "name", "onClick", "onKeyDown", "onSelectAllClick" ]);
257
+ var d = (0, t.useRef)((0, x.createDOMID)("label"));
258
+ var f = (0, t.useRef)((0, x.createDOMID)("listbox"));
259
+ var p = (0, t.useContext)(m), b = p.controlled, h = p.getSelectedStateForValue, g = p.getActiveValue, y = p.getSelectedValueCount, k = p.getValueCount, C = p.updateLabelRefreshHookByName, S = p.updateOptionRefreshHookByValue;
260
+ var w = (0, t.useCallback)((function(e, r) {
261
+ var t = r.value;
262
+ o === null || o === void 0 ? void 0 : o(e, {
263
+ name: u,
264
+ value: t
265
+ });
266
+ }), [ u, o ]);
267
+ var O = (0, t.useCallback)((function(e) {
268
+ return {
269
+ active: (g === null || g === void 0 ? void 0 : g(u)) === e,
270
+ selected: !!(h === null || h === void 0 ? void 0 : h(e))
302
271
  };
303
- }), [ i, b, v ]);
304
- var m = (0, t.useCallback)((function(e) {
305
- p === null || p === void 0 ? void 0 : p(e, {
306
- name: i
272
+ }), [ u, g, h ]);
273
+ var R = (0, t.useCallback)((function() {
274
+ var e = (k === null || k === void 0 ? void 0 : k(u)) || 0;
275
+ var r = (y === null || y === void 0 ? void 0 : y(u)) || 0;
276
+ var t = false;
277
+ if (r > 0) {
278
+ t = r === e ? true : "some";
279
+ }
280
+ return {
281
+ disabled: e < 1,
282
+ selected: t,
283
+ selectedValueCount: r,
284
+ valueCount: e
285
+ };
286
+ }), [ u, y, k ]);
287
+ var E = function e(r) {
288
+ c === null || c === void 0 ? void 0 : c(r, {
289
+ name: u
307
290
  });
308
- }), [ p, i ]);
309
- if (!f) {
310
- return null;
311
- }
312
- var h = f(i), g = h.disabled;
291
+ };
292
+ var I = function e(r, t) {
293
+ var n = t.selected;
294
+ s === null || s === void 0 ? void 0 : s(r, {
295
+ name: u,
296
+ selected: n
297
+ });
298
+ };
299
+ var q = function e(r) {
300
+ // this prevents default text selection when using shift + click
301
+ if (r.shiftKey && r.target !== r.currentTarget) {
302
+ r.preventDefault();
303
+ }
304
+ };
305
+ var L = (0, t.useMemo)((function() {
306
+ return {
307
+ onOptionClick: w,
308
+ updateLabelRefreshHookByName: C,
309
+ updateOptionRefreshHookByValue: S,
310
+ getOptionStateForValue: O,
311
+ getLabelState: R,
312
+ controlled: b
313
+ };
314
+ }), [ w, C, S, O, R, b ]);
313
315
 
314
- return n().createElement(q(), {
315
- defaultPlacement: u,
316
- content: n().createElement("span", {
317
- "aria-hidden": true
318
- }, o)
319
- }, n().createElement(B, M({
320
- appearance: "subtle",
321
- "aria-label": r,
322
- "aria-keyshortcuts": a,
323
- "aria-disabled": g || undefined,
324
- "data-test": "toolbar-button",
325
- disabled: g,
326
- onClick: m
327
- }, c), n().createElement(D, null, l)));
316
+ return n().createElement(_.Provider, {
317
+ value: L
318
+ }, n().createElement(B, {
319
+ id: d.current,
320
+ index: l,
321
+ listId: f.current,
322
+ name: u,
323
+ onSwitchClick: I,
324
+ value: i
325
+ }), n().createElement(D, M({
326
+ "aria-activedescendant": "",
327
+ "aria-labelledby": d.current,
328
+ "aria-multiselectable": true,
329
+ "data-test": "listbox",
330
+ id: f.current,
331
+ onKeyDown: E,
332
+ onMouseDown: q,
333
+ ref: a,
334
+ role: "listbox",
335
+ tabIndex: 0,
336
+ $columnNumber: l
337
+ }, v), r));
328
338
  }
329
- K.propsTypes = H;
339
+ K.propTypes = T;
330
340
  /* harmony default export */ const F = K;
341
+ // CONCATENATED MODULE: ./src/DualListbox/listboxUtils.ts
342
+ var $ = function e(r, t) {
343
+ var n = r.filter((function(e) {
344
+ return e !== t;
345
+ }));
346
+ if (r.length === n.length) {
347
+ n.push(t);
348
+ }
349
+ return n;
350
+ };
351
+ var z = function e(r, t) {
352
+ var n = new Set(t);
353
+ return r.filter((function(e) {
354
+ return !n.has(e);
355
+ }));
356
+ };
357
+ var U = function e(r, t, n) {
358
+ if (r < 0) {
359
+ return undefined;
360
+ }
361
+ var a = t[r];
362
+ var l = new Set(n);
363
+ if (!l.has(a)) {
364
+ return a;
365
+ }
366
+ for (var i = r + 1; i < t.length; i += 1) {
367
+ var u = t[i];
368
+ if (!l.has(u)) {
369
+ return u;
370
+ }
371
+ }
372
+ for (var o = r - 1; o > 0; o -= 1) {
373
+ var c = t[o];
374
+ if (!l.has(c)) {
375
+ return c;
376
+ }
377
+ }
378
+ return undefined;
379
+ };
331
380
  // CONCATENATED MODULE: external "@splunk/react-ui/NonInteractiveCheckbox"
332
- const $ = require("@splunk/react-ui/NonInteractiveCheckbox");
333
- var z = e.n($);
381
+ const W = require("@splunk/react-ui/NonInteractiveCheckbox");
382
+ var X = e.n(W);
334
383
  // CONCATENATED MODULE: ./src/DualListbox/OptionStyles.ts
335
- var U = (0, P.css)([ "background:", ";font-weight:", ";" ], V.mixins.overlayColors(V.variables.interactiveColorOverlaySelected, V.variables.interactiveColorOverlayActive), V.variables.fontWeightBold);
336
- var W = N().li.withConfig({
384
+ var G = (0, h.css)([ "background:", ";font-weight:", ";" ], C.mixins.overlayColors(C.variables.interactiveColorOverlaySelected, C.variables.interactiveColorOverlayActive), C.variables.fontWeightBold);
385
+ var J = g().li.withConfig({
337
386
  displayName: "OptionStyles__StyledListItem",
338
387
  componentId: "q275d9-0"
339
- })([ "align-items:center;color:", ";cursor:pointer;display:flex;min-height:", ";overflow:hidden;padding:0 ", ";word-wrap:break-word;line-height:20px;", " &:active{", "}", "" ], V.variables.contentColorActive, V.variables.inputHeight, V.variables.spacingSmall, (function(e) {
388
+ })([ "align-items:center;color:", ";cursor:pointer;display:flex;min-height:", ";overflow:hidden;padding:0 ", ";word-wrap:break-word;line-height:20px;", " &:active{", "}", "" ], C.variables.contentColorActive, C.variables.inputHeight, C.variables.spacingSmall, (function(e) {
340
389
  var r = e.$active;
341
- return r && U;
342
- }), U, (0, V.pickVariant)("$selected", {
343
- true: (0, P.css)([ "background:", ";&:hover{background:", ";}" ], V.variables.interactiveColorOverlaySelected, V.mixins.overlayColors(V.variables.interactiveColorOverlaySelected, V.variables.interactiveColorOverlayHover)),
344
- false: (0, P.css)([ "&:hover{background:", ";}" ], V.variables.interactiveColorOverlayHover)
390
+ return r && G;
391
+ }), G, (0, C.pickVariant)("$selected", {
392
+ true: (0, h.css)([ "background:", ";&:hover{background:", ";}" ], C.variables.interactiveColorOverlaySelected, C.mixins.overlayColors(C.variables.interactiveColorOverlaySelected, C.variables.interactiveColorOverlayHover)),
393
+ false: (0, h.css)([ "&:hover{background:", ";}" ], C.variables.interactiveColorOverlayHover)
345
394
  }));
346
- var X = N()(z()).withConfig({
395
+ var Q = g()(X()).withConfig({
347
396
  displayName: "OptionStyles__StyledNonInteractiveCheckbox",
348
397
  componentId: "q275d9-1"
349
- })([ "", " padding-inline-end:", ";" ], V.mixins.reset("min-height"), V.variables.spacingSmall);
350
- var G = N().div.withConfig({
398
+ })([ "", " padding-inline-end:", ";" ], C.mixins.reset("min-height"), C.variables.spacingSmall);
399
+ var Y = g().div.withConfig({
351
400
  displayName: "OptionStyles__StyledDiv",
352
401
  componentId: "q275d9-2"
353
402
  })([ "word-break:break-word;word-wrap:break-word;" ]);
354
- // CONCATENATED MODULE: ./src/DualListbox/ListboxContext.tsx
355
- /**
356
- * A React context used to inform subcomponets of Listbox of parent component values.
357
- * The context interface is `ListboxContextValue`.
358
- * Defaults to `'{}'`.
359
- * @public
360
- */
361
- var J = n().createContext({});
362
- /* harmony default export */ const Q = J;
363
403
  // CONCATENATED MODULE: ./src/DualListbox/Option.tsx
364
- function Y() {
365
- return Y = Object.assign ? Object.assign.bind() : function(e) {
404
+ function Z() {
405
+ return Z = Object.assign ? Object.assign.bind() : function(e) {
366
406
  for (var r = 1; r < arguments.length; r++) {
367
407
  var t = arguments[r];
368
408
  for (var n in t) {
@@ -370,11 +410,11 @@
370
410
  }
371
411
  }
372
412
  return e;
373
- }, Y.apply(null, arguments);
413
+ }, Z.apply(null, arguments);
374
414
  }
375
- function Z(e, r) {
415
+ function ee(e, r) {
376
416
  if (null == e) return {};
377
- var t, n, a = ee(e, r);
417
+ var t, n, a = re(e, r);
378
418
  if (Object.getOwnPropertySymbols) {
379
419
  var l = Object.getOwnPropertySymbols(e);
380
420
  for (n = 0; n < l.length; n++) {
@@ -383,7 +423,7 @@
383
423
  }
384
424
  return a;
385
425
  }
386
- function ee(e, r) {
426
+ function re(e, r) {
387
427
  if (null == e) return {};
388
428
  var t = {};
389
429
  for (var n in e) {
@@ -394,18 +434,18 @@
394
434
  }
395
435
  return t;
396
436
  }
397
- var re = {
437
+ var te = {
398
438
  id: l().string.isRequired,
399
439
  label: l().string.isRequired,
400
440
  listName: l().string,
401
441
  selected: l().bool,
402
442
  value: l().string.isRequired
403
443
  };
404
- function te(e) {
405
- var r = e.id, a = e.label, l = e.selected, i = e.value, o = Z(e, [ "id", "label", "selected", "value" ]);
406
- var u = (0, t.useContext)(Q);
407
- var c = d()();
408
- var s = u.onOptionClick, v = u.getOptionStateForValue, f = u.updateOptionRefreshHookByValue, p = u.controlled;
444
+ function ne(e) {
445
+ var r = e.id, a = e.label, l = e.selected, i = e.value, u = ee(e, [ "id", "label", "selected", "value" ]);
446
+ var o = (0, t.useContext)(_);
447
+ var c = v()();
448
+ var s = o.onOptionClick, d = o.getOptionStateForValue, f = o.updateOptionRefreshHookByValue, p = o.controlled;
409
449
  (0, t.useEffect)((function() {
410
450
  f === null || f === void 0 ? void 0 : f(i, c);
411
451
  return function() {
@@ -417,13 +457,13 @@
417
457
  value: i
418
458
  });
419
459
  }), [ s, i ]);
420
- if (!v) {
460
+ if (!d) {
421
461
  return null;
422
462
  }
423
- var m = v(i), h = m.active, g = m.selected;
463
+ var m = d(i), h = m.active, g = m.selected;
424
464
  var y = !!(p ? l : g);
425
465
 
426
- return n().createElement(W, Y({
466
+ return n().createElement(J, Z({
427
467
  "aria-selected": y,
428
468
  "data-test": "option",
429
469
  "data-test-value": i,
@@ -433,94 +473,71 @@
433
473
  role: "option",
434
474
  $active: h,
435
475
  $selected: y
436
- }, o), n().createElement(X, {
476
+ }, u), n().createElement(Q, {
437
477
  selected: y
438
- }), n().createElement(G, null, a));
478
+ }), n().createElement(Y, null, a));
439
479
  }
440
- te.propTypes = re;
441
- /* harmony default export */ const ne = te;
442
- // CONCATENATED MODULE: external "@splunk/ui-utils/id"
443
- const ae = require("@splunk/ui-utils/id");
444
- // CONCATENATED MODULE: external "@splunk/react-ui/Switch"
445
- const le = require("@splunk/react-ui/Switch");
446
- var ie = e.n(le);
447
- // CONCATENATED MODULE: ./src/DualListbox/LabelStyles.ts
448
- var oe = N().label.withConfig({
449
- displayName: "LabelStyles__StyledLabel",
450
- componentId: "unwplx-0"
451
- })([ "color:", ";flex:0 0 auto;" ], V.variables.contentColorActive);
452
- var ue = N().div.withConfig({
453
- displayName: "LabelStyles__StyledLabelContainer",
454
- componentId: "unwplx-1"
455
- })([ "display:flex;flex-direction:column;" ]);
456
- var ce = N().div.withConfig({
457
- displayName: "LabelStyles__StyledSwitchContainer",
458
- componentId: "unwplx-2"
459
- })([ "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) {
460
- var r = e.$columnNumber;
461
- return (0, P.css)([ "grid-column:", ";" ], "list".concat(r));
462
- }));
463
- // CONCATENATED MODULE: ./src/DualListbox/Label.tsx
464
- var se = {
465
- id: l().string.isRequired,
466
- index: l().number.isRequired,
467
- listId: l().string.isRequired,
468
- name: l().string.isRequired,
469
- onSwitchClick: l().func,
470
- value: l().string.isRequired
471
- };
472
- function ve(e) {
473
- var r = e.id, a = e.index, l = e.listId, o = e.name, u = e.onSwitchClick, c = e.value;
474
- var s = (0, t.useContext)(Q);
475
- var f = d()();
476
- var p = (0, t.useRef)((0, ae.createDOMID)("switch"));
477
- var m = s.updateLabelRefreshHookByName, h = s.getLabelState;
480
+ ne.propTypes = te;
481
+ /* harmony default export */ const ae = ne;
482
+ // CONCATENATED MODULE: ./src/DualListbox/ScreenReaderWrapper.tsx
483
+ function le() {
484
+ return le = Object.assign ? Object.assign.bind() : function(e) {
485
+ for (var r = 1; r < arguments.length; r++) {
486
+ var t = arguments[r];
487
+ for (var n in t) {
488
+ ({}).hasOwnProperty.call(t, n) && (e[n] = t[n]);
489
+ }
490
+ }
491
+ return e;
492
+ }, le.apply(null, arguments);
493
+ }
494
+ function ie(e) {
495
+ var r = le({}, e);
496
+ var a = v()();
497
+ var l = (0, t.useContext)(m);
498
+ var i = l.getScreenReaderMessage, u = l.updateScreenReaderRefreshHook;
478
499
  (0, t.useEffect)((function() {
479
- m === null || m === void 0 ? void 0 : m(o, f);
500
+ u === null || u === void 0 ? void 0 : u(a);
480
501
  return function() {
481
- return m === null || m === void 0 ? void 0 : m(o);
502
+ return u === null || u === void 0 ? void 0 : u();
482
503
  };
483
- }), [ o, m, f ]);
484
- if (!h) {
504
+ }), [ u, a ]);
505
+ if (!i) {
485
506
  return null;
486
507
  }
487
- var g = h(), y = g.disabled, k = g.selected, C = g.selectedValueCount, S = g.valueCount;
488
508
 
489
- return n().createElement(ce, {
490
- $columnNumber: a
491
- }, n().createElement(b(), {
492
- "aria-hidden": true,
493
- id: p.current
494
- }, (0, v.sprintf)((0, i._)("Select all %(listName)s Options"), {
495
- listName: c
496
- })), n().createElement(ie(), {
497
- appearance: "checkbox",
498
- "data-test": "select-all",
499
- disabled: y,
500
- labelledBy: p.current,
501
- onClick: u,
502
- selected: k,
503
- value: c
504
- }), n().createElement(ue, null, n().createElement(oe, {
505
- id: r,
506
- htmlFor: l
507
- }, c), n().createElement("span", {
508
- "aria-hidden": true
509
- }, "".concat(C, "/").concat(S, " selected"))));
509
+ return n().createElement(R(), le({
510
+ "aria-live": "assertive"
511
+ }, r), i() || "");
510
512
  }
511
- ve.propTypes = se;
512
- /* harmony default export */ const fe = ve;
513
- // CONCATENATED MODULE: ./src/DualListbox/ListboxStyles.ts
514
- var de = N().ul.withConfig({
515
- displayName: "ListboxStyles__StyledListbox",
516
- componentId: "sc-11oqtd-0"
517
- })([ "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, V.variables.interactiveColorBorder, V.variables.borderRadius, V.variables.focusShadow, (function(e) {
518
- var r = e.$columnNumber;
519
- return (0, P.css)([ "grid-column:", ";" ], "list".concat(r));
520
- }));
521
- // CONCATENATED MODULE: ./src/DualListbox/Listbox.tsx
522
- function pe() {
523
- return pe = Object.assign ? Object.assign.bind() : function(e) {
513
+ /* harmony default export */ const ue = ie;
514
+ // CONCATENATED MODULE: external "@splunk/react-ui/Tooltip"
515
+ const oe = require("@splunk/react-ui/Tooltip");
516
+ var ce = e.n(oe);
517
+ // CONCATENATED MODULE: external "@splunk/react-ui/ButtonSimple"
518
+ const se = require("@splunk/react-ui/ButtonSimple");
519
+ var ve = e.n(se);
520
+ // CONCATENATED MODULE: ./src/DualListbox/ToolbarButtonStyles.ts
521
+ var de = g()(ve()).withConfig({
522
+ displayName: "ToolbarButtonStyles__StyledButtonSimple",
523
+ componentId: "k7zksz-0"
524
+ })([ "height:", ";width:", ";" ], C.variables.inputHeight, C.variables.inputHeight);
525
+ var fe = g().span.withConfig({
526
+ displayName: "ToolbarButtonStyles__StyledIcon",
527
+ componentId: "k7zksz-1"
528
+ })([ "align-items:center;display:flex;flex-direction:row;flex-shrink:0;justify-content:center;max-width:100%;" ]);
529
+ // CONCATENATED MODULE: ./src/DualListbox/ToolbarContext.tsx
530
+ /**
531
+ * A React context used to inform subcomponets of Toolbar of parent component values.
532
+ * The context interface is `ToolbarContextValue`.
533
+ * Defaults to `'{}'`.
534
+ * @public
535
+ */
536
+ var pe = n().createContext({});
537
+ /* harmony default export */ const be = pe;
538
+ // CONCATENATED MODULE: ./src/DualListbox/ToolbarButton.tsx
539
+ function me() {
540
+ return me = Object.assign ? Object.assign.bind() : function(e) {
524
541
  for (var r = 1; r < arguments.length; r++) {
525
542
  var t = arguments[r];
526
543
  for (var n in t) {
@@ -528,11 +545,11 @@
528
545
  }
529
546
  }
530
547
  return e;
531
- }, pe.apply(null, arguments);
548
+ }, me.apply(null, arguments);
532
549
  }
533
- function be(e, r) {
550
+ function he(e, r) {
534
551
  if (null == e) return {};
535
- var t, n, a = me(e, r);
552
+ var t, n, a = ge(e, r);
536
553
  if (Object.getOwnPropertySymbols) {
537
554
  var l = Object.getOwnPropertySymbols(e);
538
555
  for (n = 0; n < l.length; n++) {
@@ -541,7 +558,7 @@
541
558
  }
542
559
  return a;
543
560
  }
544
- function me(e, r) {
561
+ function ge(e, r) {
545
562
  if (null == e) return {};
546
563
  var t = {};
547
564
  for (var n in e) {
@@ -552,120 +569,87 @@
552
569
  }
553
570
  return t;
554
571
  }
555
- var he = {
556
- children: l().node,
557
- index: l().number.isRequired,
558
- label: l().string.isRequired,
559
- multiSelect: l().bool,
572
+ var ye = {
573
+ icon: l().node.isRequired,
560
574
  name: l().string.isRequired,
561
- onClick: l().func,
562
- onKeyDown: l().func,
563
- onSelectAllClick: l().func
575
+ tooltipLabel: l().string.isRequired,
576
+ tooltipPlacement: l().oneOf([ "above", "below", "left", "right" ])
564
577
  };
565
- function ge(e) {
566
- var r = e.children, a = e.elementRef, l = e.index, i = 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" ]);
567
- var f = (0, t.useRef)((0, ae.createDOMID)("label"));
568
- var d = (0, t.useRef)((0, ae.createDOMID)("listbox"));
569
- var p = (0, t.useContext)(h), b = p.controlled, m = p.getSelectedStateForValue, g = p.getActiveValue, y = p.getSelectedValueCount, k = p.getValueCount, C = p.updateLabelRefreshHookByName, S = p.updateOptionRefreshHookByValue;
570
- var w = (0, t.useCallback)((function(e, r) {
571
- var t = r.value;
572
- u === null || u === void 0 ? void 0 : u(e, {
573
- name: o,
574
- value: t
575
- });
576
- }), [ o, u ]);
577
- var x = (0, t.useCallback)((function(e) {
578
- return {
579
- active: (g === null || g === void 0 ? void 0 : g(o)) === e,
580
- selected: !!(m === null || m === void 0 ? void 0 : m(e))
581
- };
582
- }), [ o, g, m ]);
583
- var O = (0, t.useCallback)((function() {
584
- var e = (k === null || k === void 0 ? void 0 : k(o)) || 0;
585
- var r = (y === null || y === void 0 ? void 0 : y(o)) || 0;
586
- var t = false;
587
- if (r > 0) {
588
- t = r === e ? true : "some";
589
- }
590
- return {
591
- disabled: e < 1,
592
- selected: t,
593
- selectedValueCount: r,
594
- valueCount: e
578
+ function ke(e) {
579
+ var r = e.ariaLabel, a = e.ariaKeyShortcuts, l = e.icon, i = e.name, u = e.tooltipLabel, o = e.tooltipPlacement, c = he(e, [ "ariaLabel", "ariaKeyShortcuts", "icon", "name", "tooltipLabel", "tooltipPlacement" ]);
580
+ var s = (0, t.useContext)(be);
581
+ var d = v()();
582
+ var f = s.getButtonState, p = s.onButtonClick, b = s.updateButtonRefreshHookByName;
583
+ (0, t.useEffect)((function() {
584
+ b === null || b === void 0 ? void 0 : b(i, d);
585
+ return function() {
586
+ return b === null || b === void 0 ? void 0 : b(i);
595
587
  };
596
- }), [ o, y, k ]);
597
- var R = function e(r) {
598
- c === null || c === void 0 ? void 0 : c(r, {
599
- name: o
600
- });
601
- };
602
- var E = function e(r, t) {
603
- var n = t.selected;
604
- s === null || s === void 0 ? void 0 : s(r, {
605
- name: o,
606
- selected: n
588
+ }), [ i, b, d ]);
589
+ var m = (0, t.useCallback)((function(e) {
590
+ p === null || p === void 0 ? void 0 : p(e, {
591
+ name: i
607
592
  });
608
- };
609
- var I = function e(r) {
610
- // this prevents default text selection when using shift + click
611
- if (r.shiftKey && r.target !== r.currentTarget) {
612
- r.preventDefault();
613
- }
614
- };
615
- var L = (0, t.useMemo)((function() {
616
- return {
617
- onOptionClick: w,
618
- updateLabelRefreshHookByName: C,
619
- updateOptionRefreshHookByValue: S,
620
- getOptionStateForValue: x,
621
- getLabelState: O,
622
- controlled: b
623
- };
624
- }), [ w, C, S, x, O, b ]);
593
+ }), [ p, i ]);
594
+ if (!f) {
595
+ return null;
596
+ }
597
+ var h = f(i), g = h.disabled;
625
598
 
626
- return n().createElement(Q.Provider, {
627
- value: L
628
- }, n().createElement(fe, {
629
- id: f.current,
630
- index: l,
631
- listId: d.current,
632
- name: o,
633
- onSwitchClick: E,
634
- value: i
635
- }), n().createElement(de, pe({
636
- "aria-activedescendant": "",
637
- "aria-labelledby": f.current,
638
- "aria-multiselectable": true,
639
- "data-test": "listbox",
640
- id: d.current,
641
- onKeyDown: R,
642
- onMouseDown: I,
643
- ref: a,
644
- role: "listbox",
645
- tabIndex: 0,
646
- $columnNumber: l
647
- }, v), r));
599
+ return n().createElement(ce(), {
600
+ defaultPlacement: o,
601
+ content: n().createElement("span", {
602
+ "aria-hidden": true
603
+ }, u)
604
+ }, n().createElement(de, me({
605
+ appearance: "subtle",
606
+ "aria-label": r,
607
+ "aria-keyshortcuts": a,
608
+ "aria-disabled": g || undefined,
609
+ "data-test": "toolbar-button",
610
+ disabled: g,
611
+ onClick: m
612
+ }, c), n().createElement(fe, null, l)));
648
613
  }
649
- ge.propTypes = he;
650
- /* harmony default export */ const ye = ge;
651
- // CONCATENATED MODULE: external "@splunk/react-ui/Box"
652
- const ke = require("@splunk/react-ui/Box");
653
- var Ce = e.n(ke);
654
- // CONCATENATED MODULE: ./src/DualListbox/DualListboxStyles.ts
655
- var Se = N()(Ce()).withConfig({
656
- displayName: "DualListboxStyles__StyledBox",
657
- componentId: "sc-1te6bz0-0"
658
- })([ "display:grid;grid-template-columns:[list0] 180px [actions] min-content [list1] 180px;grid-template-rows:[headers] min-content [lists] 160px;gap:", " ", ";", " ", "" ], V.variables.spacingXSmall, V.variables.spacingSmall, (function(e) {
659
- var r = e.$inline;
660
- return r && (0, P.css)([ "display:inline-grid;" ]);
661
- }), (function(e) {
662
- var r = e.$fill;
663
- return r && (0, P.css)([ "height:100%;grid-template-columns:[list0] 1fr [actions] min-content [list1] 1fr;grid-template-rows:[headers] min-content [lists] 1fr;position:relative;width:100%;" ]);
664
- }));
665
- var we = N().div.withConfig({
666
- displayName: "DualListboxStyles__StyledFlexColumn",
667
- componentId: "sc-1te6bz0-1"
668
- })([ "&::before{content:'';grid-column:headers;grid-row:lists;}align-items:center;display:flex;flex-direction:column;gap:", ";grid-column:actions;grid-row:lists;justify-content:center;" ], V.variables.spacingSmall);
614
+ ke.propsTypes = ye;
615
+ /* harmony default export */ const Ce = ke;
616
+ // CONCATENATED MODULE: ./src/utils/fuzzyMatch.ts
617
+ // A utility for matching keyboard characters to list values
618
+ var Se = function e(r, t) {
619
+ return r ? r.label.charAt(t).toLowerCase() : "";
620
+ };
621
+ var we = function e(r, t) {
622
+ if (!r.length) {
623
+ return r;
624
+ }
625
+ var n = null;
626
+ var a = false;
627
+ var l = r.filter((function(e) {
628
+ var r = Se(e, t.index);
629
+ if (r === t.value) {
630
+ a = true;
631
+ return true;
632
+ }
633
+ // If we haven't found a match yet, keep track of the next closest match.
634
+ // Secondary matching looks for the closest character of a higher value, and failing that, closest of a lower value.
635
+ if (!a) {
636
+ var l = Se(n, t.index);
637
+ if (!l) {
638
+ n = e;
639
+ } else if (r > t.value) {
640
+ if (l < t.value) {
641
+ n = e;
642
+ } else if (l > r) {
643
+ n = e;
644
+ }
645
+ } else if (r > l) {
646
+ n = e;
647
+ }
648
+ }
649
+ return false;
650
+ }));
651
+ return l.length === 0 && n ? [ n ] : l;
652
+ };
669
653
  // CONCATENATED MODULE: ./src/DualListbox/DualListbox.tsx
670
654
  function xe() {
671
655
  return xe = Object.assign ? Object.assign.bind() : function(e) {
@@ -679,7 +663,7 @@
679
663
  }, xe.apply(null, arguments);
680
664
  }
681
665
  function Oe(e, r) {
682
- return qe(e) || Le(e, r) || Ee(e, r) || Re();
666
+ return Le(e) || qe(e, r) || Ee(e, r) || Re();
683
667
  }
684
668
  function Re() {
685
669
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
@@ -698,34 +682,34 @@
698
682
  }
699
683
  return n;
700
684
  }
701
- function Le(e, r) {
685
+ function qe(e, r) {
702
686
  var t = null == e ? null : "undefined" != typeof Symbol && e[Symbol.iterator] || e["@@iterator"];
703
687
  if (null != t) {
704
- var n, a, l, i, o = [], u = !0, c = !1;
688
+ var n, a, l, i, u = [], o = !0, c = !1;
705
689
  try {
706
690
  if (l = (t = t.call(e)).next, 0 === r) {
707
691
  if (Object(t) !== t) return;
708
- u = !1;
709
- } else for (;!(u = (n = l.call(t)).done) && (o.push(n.value), o.length !== r); u = !0) {
692
+ o = !1;
693
+ } else for (;!(o = (n = l.call(t)).done) && (u.push(n.value), u.length !== r); o = !0) {
710
694
  }
711
695
  } catch (e) {
712
696
  c = !0, a = e;
713
697
  } finally {
714
698
  try {
715
- if (!u && null != t["return"] && (i = t["return"](), Object(i) !== i)) return;
699
+ if (!o && null != t["return"] && (i = t["return"](), Object(i) !== i)) return;
716
700
  } finally {
717
701
  if (c) throw a;
718
702
  }
719
703
  }
720
- return o;
704
+ return u;
721
705
  }
722
706
  }
723
- function qe(e) {
707
+ function Le(e) {
724
708
  if (Array.isArray(e)) return e;
725
709
  }
726
- function Pe(e, r) {
710
+ function Ne(e, r) {
727
711
  if (null == e) return {};
728
- var t, n, a = Ne(e, r);
712
+ var t, n, a = Pe(e, r);
729
713
  if (Object.getOwnPropertySymbols) {
730
714
  var l = Object.getOwnPropertySymbols(e);
731
715
  for (n = 0; n < l.length; n++) {
@@ -734,7 +718,7 @@
734
718
  }
735
719
  return a;
736
720
  }
737
- function Ne(e, r) {
721
+ function Pe(e, r) {
738
722
  if (null == e) return {};
739
723
  var t = {};
740
724
  for (var n in e) {
@@ -760,85 +744,85 @@
760
744
  })).isRequired
761
745
  };
762
746
  function je(e) {
763
- var r, a, l, o;
764
- var c = e.children, f = e.controlled, p = f === void 0 ? false : f, b = e.elementRef, m = e.fill, g = m === void 0 ? false : m, y = e.inline, O = y === void 0 ? false : y, E = e.onChange, L = e.onSelect, q = e.lists, P = Pe(e, [ "children", "controlled", "elementRef", "fill", "inline", "onChange", "onSelect", "lists" ]);
747
+ var r, a, l, i;
748
+ var o = e.children, s = e.controlled, b = s === void 0 ? false : s, h = e.elementRef, g = e.fill, y = g === void 0 ? false : g, k = e.inline, C = k === void 0 ? false : k, x = e.onChange, O = e.onSelect, R = e.lists, E = Ne(e, [ "children", "controlled", "elementRef", "fill", "inline", "onChange", "onSelect", "lists" ]);
765
749
  // @docs-props-type DualListboxPropsBase
766
- var N = d()();
767
- var _ = (0, t.useRef)(false);
750
+ var I = v()();
751
+ var q = (0, t.useRef)(false);
768
752
  (0, t.useEffect)((function() {
769
- _.current = true;
753
+ q.current = true;
770
754
  }), []);
771
755
  // TODO: Implement shared isControlled hook (SUI-5283).
772
- var j = (0, t.useRef)(p);
756
+ var L = (0, t.useRef)(b);
773
757
  // List One "Available" Refs
774
- var V = (0, t.useRef)([]);
775
- var B = (0, t.useRef)([]);
776
- var D = (0, t.useRef)();
777
- var M = (0, t.useRef)(null);
778
- var T = (0, t.useRef)([]);
758
+ var N = (0, t.useRef)([]);
759
+ var P = (0, t.useRef)([]);
760
+ var _ = (0, t.useRef)();
761
+ var j = (0, t.useRef)(null);
762
+ var V = (0, t.useRef)([]);
779
763
  // List Two "Selected" Refs
780
- var A = (0, t.useRef)([]);
764
+ var B = (0, t.useRef)([]);
765
+ var D = (0, t.useRef)([]);
766
+ var M = (0, t.useRef)();
767
+ var A = (0, t.useRef)(null);
781
768
  var H = (0, t.useRef)([]);
782
- var K = (0, t.useRef)();
783
- var $ = (0, t.useRef)(null);
784
- var z = (0, t.useRef)([]);
785
769
  // Refresh Hook Stores, used to render indivual elements when uncontrolled
786
- var U = (0, t.useRef)({});
770
+ var T = (0, t.useRef)({});
771
+ var K = (0, t.useRef)({});
787
772
  var W = (0, t.useRef)({});
788
- var X = (0, t.useRef)({});
789
- var G = (0, t.useRef)();
773
+ var X = (0, t.useRef)();
790
774
  // Activity Values Refs
791
- var J = (0, t.useRef)();
775
+ var G = (0, t.useRef)();
776
+ var J = (0, t.useRef)({});
792
777
  var Q = (0, t.useRef)({});
793
778
  var Y = (0, t.useRef)({});
794
- var Z = (0, t.useRef)({});
795
- var ee = (0, t.useRef)(0);
779
+ var Z = (0, t.useRef)(0);
796
780
  // Key Match Refs
797
- var re = (0, t.useRef)();
798
- var te = (0, t.useRef)();
799
- var ne = (0, t.useRef)([]);
781
+ var ee = (0, t.useRef)();
782
+ var re = (0, t.useRef)();
783
+ var te = (0, t.useRef)([]);
800
784
  if (false) {}
801
785
  if (false) {}
802
786
  if (false) {}
803
787
  // Unpack names and labels instead of relying on `lists` being a consistent reference
804
- var ae = (r = q[0]) === null || r === void 0 ? void 0 : r.name;
805
- var le = (a = q[1]) === null || a === void 0 ? void 0 : a.name;
806
- var ie = (l = q[0]) === null || l === void 0 ? void 0 : l.label;
807
- var oe = (o = q[1]) === null || o === void 0 ? void 0 : o.label;
788
+ var ne = (r = R[0]) === null || r === void 0 ? void 0 : r.name;
789
+ var ae = (a = R[1]) === null || a === void 0 ? void 0 : a.name;
790
+ var le = (l = R[0]) === null || l === void 0 ? void 0 : l.label;
791
+ var ie = (i = R[1]) === null || i === void 0 ? void 0 : i.label;
808
792
  // Copy previous state for uncontrolled render so it's not voided by following value reset
809
- var ue = new Set(A.current);
793
+ var oe = new Set(B.current);
810
794
  // This ensures we recapture the indexes after batch moves, but will be refactored when sorting is implemented (SUI-5270).
811
- V.current = [];
812
- A.current = [];
813
- T.current = [];
814
- z.current = [];
795
+ N.current = [];
796
+ B.current = [];
797
+ V.current = [];
798
+ H.current = [];
815
799
  // Clean the data stores before we copy the references into listData
816
- if (!_.current || j.current) {
817
- B.current = [];
818
- H.current = [];
819
- Q.current = {};
820
- Z.current = {};
800
+ if (!q.current || L.current) {
801
+ P.current = [];
802
+ D.current = [];
803
+ J.current = {};
821
804
  Y.current = {};
805
+ Q.current = {};
822
806
  }
823
807
  var ce = [ {
824
808
  options: [],
825
- matchOptions: T.current,
826
- values: V.current,
827
- selectedValues: B.current,
828
- activeValue: D.current,
829
- activeFound: !D.current
809
+ matchOptions: V.current,
810
+ values: N.current,
811
+ selectedValues: P.current,
812
+ activeValue: _.current,
813
+ activeFound: !_.current
830
814
  }, {
831
815
  options: [],
832
- matchOptions: z.current,
833
- values: A.current,
834
- selectedValues: H.current,
835
- activeValue: K.current,
836
- activeFound: !K.current
816
+ matchOptions: H.current,
817
+ values: B.current,
818
+ selectedValues: D.current,
819
+ activeValue: M.current,
820
+ activeFound: !M.current
837
821
  } ];
838
- if (!_.current || j.current) {
839
- t.Children.toArray(c).filter(t.isValidElement).forEach((function(e) {
822
+ if (!q.current || L.current) {
823
+ t.Children.toArray(o).filter(t.isValidElement).forEach((function(e) {
840
824
  var r = e.props, t = r.value, n = r.label;
841
- var a = e.props.listName === le;
825
+ var a = e.props.listName === ae;
842
826
  var l = ce[a ? 1 : 0];
843
827
  // Ensure the active value is found on controlled renders
844
828
  if (!l.activeFound && l.activeValue === t) {
@@ -854,14 +838,14 @@
854
838
  if (i) {
855
839
  l.selectedValues.push(t);
856
840
  }
857
- Q.current[t] = i;
858
- Z.current[t] = l.values.length - 1;
859
- Y.current[t] = e.props.id;
841
+ J.current[t] = i;
842
+ Y.current[t] = l.values.length - 1;
843
+ Q.current[t] = e.props.id;
860
844
  }));
861
845
  } else {
862
- t.Children.toArray(c).filter(t.isValidElement).forEach((function(e) {
846
+ t.Children.toArray(o).filter(t.isValidElement).forEach((function(e) {
863
847
  var r = e.props, t = r.value, n = r.label;
864
- var a = ue.has(t);
848
+ var a = oe.has(t);
865
849
  var l = ce[a ? 1 : 0];
866
850
  l.values.push(t);
867
851
  l.options.push(e);
@@ -869,58 +853,58 @@
869
853
  value: t,
870
854
  label: n
871
855
  });
872
- Z.current[t] = l.values.length - 1;
856
+ Y.current[t] = l.values.length - 1;
873
857
  }));
874
858
  }
875
859
  var se = (0, t.useCallback)((function(e, r) {
876
- if (e === ae) {
877
- D.current = r;
860
+ if (e === ne) {
861
+ _.current = r;
878
862
  } else {
879
- K.current = r;
863
+ M.current = r;
880
864
  }
881
- }), [ ae ]);
865
+ }), [ ne ]);
882
866
  var ve = (0, t.useCallback)((function(e) {
883
- return e === ae ? D.current : K.current;
884
- }), [ ae ]);
885
- var fe = (0, t.useCallback)((function(e, r) {
886
- if (e === ae) {
887
- B.current = r;
867
+ return e === ne ? _.current : M.current;
868
+ }), [ ne ]);
869
+ var de = (0, t.useCallback)((function(e, r) {
870
+ if (e === ne) {
871
+ P.current = r;
888
872
  } else {
889
- H.current = r;
873
+ D.current = r;
890
874
  }
891
- }), [ ae ]);
892
- var de = (0, t.useCallback)((function(e) {
893
- return e === ae ? B.current : H.current;
894
- }), [ ae ]);
875
+ }), [ ne ]);
876
+ var fe = (0, t.useCallback)((function(e) {
877
+ return e === ne ? P.current : D.current;
878
+ }), [ ne ]);
895
879
  var pe = (0, t.useCallback)((function(e) {
896
- return de(e).length;
897
- }), [ de ]);
898
- var be = (0, t.useCallback)((function() {
899
- return J.current;
880
+ return fe(e).length;
881
+ }), [ fe ]);
882
+ var me = (0, t.useCallback)((function() {
883
+ return G.current;
900
884
  }), []);
901
- var me = (0, t.useCallback)((function(e) {
902
- return Q.current[e];
885
+ var he = (0, t.useCallback)((function(e) {
886
+ return J.current[e];
903
887
  }), []);
904
- var he = (0, t.useCallback)((function(e, r) {
905
- if (e === ae) {
906
- V.current = r;
888
+ var ge = (0, t.useCallback)((function(e, r) {
889
+ if (e === ne) {
890
+ N.current = r;
907
891
  } else {
908
- A.current = r;
892
+ B.current = r;
909
893
  }
910
- }), [ ae ]);
911
- var ge = (0, t.useCallback)((function(e) {
912
- return e === ae ? V.current : A.current;
913
- }), [ ae ]);
894
+ }), [ ne ]);
895
+ var ye = (0, t.useCallback)((function(e) {
896
+ return e === ne ? N.current : B.current;
897
+ }), [ ne ]);
914
898
  var ke = (0, t.useCallback)((function(e) {
915
- return ge(e).length;
916
- }), [ ge ]);
917
- var Ce = (0, t.useCallback)((function(e) {
899
+ return ye(e).length;
900
+ }), [ ye ]);
901
+ var Se = (0, t.useCallback)((function(e) {
918
902
  var r = ke(e);
919
903
  return r > 0 && r === pe(e);
920
904
  }), [ ke, pe ]);
921
905
  var Re = (0, t.useCallback)((function(e) {
922
- return e === ae ? T.current : z.current;
923
- }), [ ae ]);
906
+ return e === ne ? V.current : H.current;
907
+ }), [ ne ]);
924
908
  var Ee = (0, t.useCallback)((function(e) {
925
909
  var r = ke(e);
926
910
  var t = pe(e);
@@ -929,70 +913,70 @@
929
913
  };
930
914
  }), [ ke, pe ]);
931
915
  var Ie = (0, t.useCallback)((function() {
932
- if (J.current && J.current.length > 0) {
916
+ if (G.current && G.current.length > 0) {
933
917
  var e;
934
- J.current = "";
935
- (e = G.current) === null || e === void 0 ? void 0 : e.call(G);
918
+ G.current = "";
919
+ (e = X.current) === null || e === void 0 ? void 0 : e.call(X);
936
920
  }
937
921
  }), []);
938
- var Le = (0, t.useCallback)((function() {
939
- re.current = undefined;
940
- ne.current = [];
941
- if (te.current) {
942
- clearTimeout(te.current);
922
+ var qe = (0, t.useCallback)((function() {
923
+ ee.current = undefined;
924
+ te.current = [];
925
+ if (re.current) {
926
+ clearTimeout(re.current);
943
927
  }
944
928
  }), []);
945
- var qe = (0, t.useCallback)((function(e) {
946
- G.current = e;
929
+ var Le = (0, t.useCallback)((function(e) {
930
+ X.current = e;
947
931
  }), []);
948
- var Ne = (0, t.useCallback)((function(e, r) {
932
+ var Pe = (0, t.useCallback)((function(e, r) {
949
933
  if (r) {
950
- X.current[e] = r;
934
+ W.current[e] = r;
951
935
  } else {
952
- delete X.current[e];
936
+ delete W.current[e];
953
937
  }
954
938
  }), []);
955
939
  var _e = (0, t.useCallback)((function(e, r) {
956
940
  if (r) {
957
- W.current[e] = r;
941
+ K.current[e] = r;
958
942
  } else {
959
- delete W.current[e];
943
+ delete K.current[e];
960
944
  }
961
945
  }), []);
962
946
  var je = (0, t.useCallback)((function(e, r) {
963
947
  if (r) {
964
- U.current[e] = r;
948
+ T.current[e] = r;
965
949
  } else {
966
- delete U.current[e];
950
+ delete T.current[e];
967
951
  }
968
952
  }), []);
969
953
  var Ve = (0, t.useCallback)((function(e) {
970
954
  if (e) {
971
955
  var r, t;
972
- (r = (t = X.current)[e]) === null || r === void 0 ? void 0 : r.call(t);
956
+ (r = (t = W.current)[e]) === null || r === void 0 ? void 0 : r.call(t);
973
957
  }
974
958
  }), []);
975
959
  var Be = (0, t.useCallback)((function(e) {
976
960
  if (e) {
977
961
  var r, t;
978
- (r = (t = W.current)[e]) === null || r === void 0 ? void 0 : r.call(t);
962
+ (r = (t = K.current)[e]) === null || r === void 0 ? void 0 : r.call(t);
979
963
  }
980
964
  }), []);
981
965
  var De = (0, t.useCallback)((function(e) {
982
966
  if (e) {
983
967
  var r, t;
984
- (r = (t = U.current)[e]) === null || r === void 0 ? void 0 : r.call(t);
968
+ (r = (t = T.current)[e]) === null || r === void 0 ? void 0 : r.call(t);
985
969
  }
986
970
  }), []);
987
971
  var Me = (0, t.useCallback)((function(e) {
988
972
  Ie();
989
973
  Be(e);
974
+ De(ne);
990
975
  De(ae);
991
- De(le);
992
- }), [ Ie, De, Be, ae, le ]);
993
- var Te = (0, t.useCallback)((function(e, r) {
976
+ }), [ Ie, De, Be, ne, ae ]);
977
+ var Ae = (0, t.useCallback)((function(e, r) {
994
978
  var t = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
995
- var n = e === ae ? M.current : $.current;
979
+ var n = e === ne ? j.current : A.current;
996
980
  if (!n) {
997
981
  return;
998
982
  }
@@ -1007,91 +991,91 @@
1007
991
  // render previous
1008
992
  Ve(a);
1009
993
  }
1010
- var l = r ? Y.current[r] : "";
994
+ var l = r ? Q.current[r] : "";
1011
995
  // update listbox via dom to avoid render + child render
1012
996
  n.setAttribute("aria-activedescendant", l);
1013
997
  if (!t && l.length > 0) {
1014
998
  var i = n.querySelector("#".concat(l));
1015
- x(i);
999
+ (0, p.scrollIntoViewIfNeeded)(i);
1016
1000
  }
1017
1001
  }
1018
- }), [ ve, se, Ve, ae ]);
1019
- var Ae = (0, t.useCallback)((function(e, r) {
1002
+ }), [ ve, se, Ve, ne ]);
1003
+ var He = (0, t.useCallback)((function(e, r) {
1020
1004
  var t = r.value, n = r.name;
1021
- var a = Ce(n) ? ge(n) : de(n);
1022
- var l = C(a, t);
1023
- if (!j.current) {
1024
- Q.current[t] = !Q.current[t];
1025
- fe(n, l);
1005
+ var a = Se(n) ? ye(n) : fe(n);
1006
+ var l = $(a, t);
1007
+ if (!L.current) {
1008
+ J.current[t] = !J.current[t];
1009
+ de(n, l);
1026
1010
  Me(n);
1027
1011
  }
1028
- Te(n, t);
1012
+ Ae(n, t);
1029
1013
  e.preventDefault();
1030
- L === null || L === void 0 ? void 0 : L(e, {
1014
+ O === null || O === void 0 ? void 0 : O(e, {
1031
1015
  values: l,
1032
1016
  listName: n
1033
1017
  });
1034
- }), [ Ce, de, ge, fe, Te, Me, L ]);
1035
- var He = (0, t.useCallback)((function(e, r) {
1018
+ }), [ Se, fe, ye, de, Ae, Me, O ]);
1019
+ var Te = (0, t.useCallback)((function(e, r) {
1036
1020
  var t = r.initialIndex, n = r.name, a = r.targetIndex;
1037
- var l = ge(n);
1021
+ var l = ye(n);
1038
1022
  var i = Math.min(t, a);
1039
- var o = Math.max(t, a);
1040
- var u = [];
1041
- if (j.current) {
1042
- u = l.slice(i, o + 1);
1023
+ var u = Math.max(t, a);
1024
+ var o = [];
1025
+ if (L.current) {
1026
+ o = l.slice(i, u + 1);
1043
1027
  } else {
1044
1028
  l.forEach((function(e, r) {
1045
1029
  var t = false;
1046
- if (r >= i && r <= o) {
1030
+ if (r >= i && r <= u) {
1047
1031
  t = true;
1048
- u.push(e);
1032
+ o.push(e);
1049
1033
  } else {
1050
1034
  t = false;
1051
1035
  }
1052
- if (Q.current[e] !== t) {
1053
- Q.current[e] = t;
1036
+ if (J.current[e] !== t) {
1037
+ J.current[e] = t;
1054
1038
  Ve(e);
1055
1039
  }
1056
1040
  }));
1057
- fe(n, u);
1041
+ de(n, o);
1058
1042
  Me(n);
1059
1043
  }
1060
- Te(n, l[a]);
1044
+ Ae(n, l[a]);
1061
1045
  e.preventDefault();
1062
1046
  e.stopPropagation();
1063
- L === null || L === void 0 ? void 0 : L(e, {
1064
- values: u,
1047
+ O === null || O === void 0 ? void 0 : O(e, {
1048
+ values: o,
1065
1049
  listName: n
1066
1050
  });
1067
- }), [ ge, L, fe, Te, Me, Ve ]);
1051
+ }), [ ye, O, de, Ae, Me, Ve ]);
1068
1052
  var Ke = (0, t.useCallback)((function(e, r) {
1069
1053
  var t = r.name, n = r.selected;
1070
- var a = ge(t);
1054
+ var a = ye(t);
1071
1055
  var l = n === true ? [] : a;
1072
1056
  var i = n !== true;
1073
- if (!j.current) {
1057
+ if (!L.current) {
1074
1058
  a === null || a === void 0 ? void 0 : a.forEach((function(e) {
1075
- if (Q.current[e] !== i) {
1076
- Q.current[e] = i;
1059
+ if (J.current[e] !== i) {
1060
+ J.current[e] = i;
1077
1061
  Ve(e);
1078
1062
  }
1079
1063
  }));
1080
- fe(t, l);
1064
+ de(t, l);
1081
1065
  Me(t);
1082
1066
  }
1083
1067
  e.preventDefault();
1084
- L === null || L === void 0 ? void 0 : L(e, {
1068
+ O === null || O === void 0 ? void 0 : O(e, {
1085
1069
  values: l,
1086
1070
  listName: t
1087
1071
  });
1088
- }), [ ge, L, fe, Me, Ve ]);
1072
+ }), [ ye, O, de, Me, Ve ]);
1089
1073
  // handleMoveValues does not update the active value of the source, keyboard and mouse differ, only the target active value is updated
1090
1074
  var Fe = (0, t.useCallback)((function(e, r, t) {
1091
- var n = ge(r);
1092
- var a = de(r);
1093
- var l = Ce(r);
1094
- var o = ge(t);
1075
+ var n = ye(r);
1076
+ var a = fe(r);
1077
+ var l = Se(r);
1078
+ var i = ye(t);
1095
1079
  var u = ve(t);
1096
1080
  if (n.length === 0 || !l && a.length === 0) {
1097
1081
  return;
@@ -1099,64 +1083,64 @@
1099
1083
  if (!u && a.length > 0) {
1100
1084
  // target lacks an active value, default to the first
1101
1085
  // skip the render it will be catch in batch
1102
- Te(t, a[0], true);
1086
+ Ae(t, a[0], true);
1103
1087
  }
1104
- var c = (0, v.sprintf)((0, i._)("Moved %(count)d items to %(listLabel)s list"), {
1088
+ var o = (0, d.sprintf)((0, f._)("Moved %(count)d items to %(listLabel)s list"), {
1105
1089
  count: a.length,
1106
- listLabel: t === ae ? ie : oe
1090
+ listLabel: t === ne ? le : ie
1107
1091
  });
1108
1092
  // These new values do not perserve sort position, may need to be refactored with sort logic (SUI-5270).
1109
- var s = l ? [] : S(n, a);
1110
- var f = o.concat(a);
1111
- if (!j.current) {
1093
+ var c = l ? [] : z(n, a);
1094
+ var s = i.concat(a);
1095
+ if (!L.current) {
1112
1096
  a.forEach((function(e) {
1113
- Q.current[e] = false;
1097
+ J.current[e] = false;
1114
1098
  }));
1115
- he(t, f);
1116
- he(r, s);
1117
- fe(r, []);
1118
- J.current = c;
1099
+ ge(t, s);
1100
+ ge(r, c);
1101
+ de(r, []);
1102
+ G.current = o;
1119
1103
  // move is a batch update, force a full render, no internal update needed
1120
- N();
1104
+ I();
1121
1105
  }
1122
- var d = {
1106
+ var v = {
1123
1107
  affectedValues: a,
1124
1108
  sourceListName: r || "",
1125
- sourceValues: s,
1109
+ sourceValues: c,
1126
1110
  targetListName: t || "",
1127
- targetValues: f,
1128
- screenReaderMessage: c || "",
1111
+ targetValues: s,
1112
+ screenReaderMessage: o || "",
1129
1113
  values: a.slice()
1130
1114
  };
1131
1115
  e.preventDefault();
1132
- E === null || E === void 0 ? void 0 : E(e, d);
1133
- }), [ N, ve, Ce, de, ge, E, fe, he, Te, ae, ie, oe ]);
1116
+ x === null || x === void 0 ? void 0 : x(e, v);
1117
+ }), [ I, ve, Se, fe, ye, x, de, ge, Ae, ne, le, ie ]);
1134
1118
  var $e = (0, t.useCallback)((function(e, r) {
1135
1119
  var t = r.name;
1136
- var n = Ce(t);
1120
+ var n = Se(t);
1137
1121
  var a = ve(t);
1138
- var l = t === ae ? le : ae;
1139
- if (a && (n || !!Q.current[a])) {
1122
+ var l = t === ne ? ae : ne;
1123
+ if (a && (n || !!J.current[a])) {
1140
1124
  // active option was present in items to be removed, clear the active option
1141
- Te(t);
1125
+ Ae(t);
1142
1126
  }
1143
1127
  Fe(e, t, l);
1144
- }), [ ve, Ce, Fe, Te, ae, le ]);
1128
+ }), [ ve, Se, Fe, Ae, ne, ae ]);
1145
1129
  var ze = (0, t.useCallback)((function(e, r) {
1146
1130
  var t = r.name, n = r.value;
1147
1131
  if (e.nativeEvent.shiftKey) {
1148
- He(e, {
1149
- targetIndex: Z.current[n],
1150
- initialIndex: ee.current,
1132
+ Te(e, {
1133
+ targetIndex: Y.current[n],
1134
+ initialIndex: Z.current,
1151
1135
  name: t
1152
1136
  });
1153
1137
  } else {
1154
- Ae(e, {
1138
+ He(e, {
1155
1139
  name: t,
1156
1140
  value: n
1157
1141
  });
1158
1142
  }
1159
- }), [ He, Ae ]);
1143
+ }), [ Te, He ]);
1160
1144
  var Ue = (0, t.useCallback)((function(e, r) {
1161
1145
  Ke(e, r);
1162
1146
  }), [ Ke ]);
@@ -1170,116 +1154,116 @@
1170
1154
  index: 0,
1171
1155
  value: t
1172
1156
  };
1173
- if (!re.current) {
1157
+ if (!ee.current) {
1174
1158
  if (t === " ") {
1175
- Le();
1159
+ qe();
1176
1160
  return;
1177
1161
  }
1178
- a = R(n, l);
1179
- } else if (ne.current.length > 1) {
1180
- l.index = re.current.index + 1;
1181
- a = R(ne.current, l);
1162
+ a = we(n, l);
1163
+ } else if (te.current.length > 1) {
1164
+ l.index = ee.current.index + 1;
1165
+ a = we(te.current, l);
1182
1166
  }
1183
1167
  if (a.length) {
1184
1168
  var i = 0;
1185
1169
  // If the active option is a first character match, cycle to the next matching option.
1186
1170
  if (l.index === 0 && a.length > 1) {
1187
- var o = ve(r);
1188
- if (o) {
1189
- var u = a.findIndex((function(e) {
1190
- return e.value === o;
1171
+ var u = ve(r);
1172
+ if (u) {
1173
+ var o = a.findIndex((function(e) {
1174
+ return e.value === u;
1191
1175
  }));
1192
- if (u >= 0) {
1193
- i = u === a.length - 1 ? 0 : u + 1;
1176
+ if (o >= 0) {
1177
+ i = o === a.length - 1 ? 0 : o + 1;
1194
1178
  }
1195
1179
  }
1196
1180
  }
1197
- Te(r, a[i].value);
1181
+ Ae(r, a[i].value);
1198
1182
  }
1199
- ne.current = a;
1200
- re.current = l;
1201
- if (te.current) {
1202
- clearTimeout(te.current);
1183
+ te.current = a;
1184
+ ee.current = l;
1185
+ if (re.current) {
1186
+ clearTimeout(re.current);
1203
1187
  }
1204
- te.current = setTimeout(Le, 500);
1188
+ re.current = setTimeout(qe, 500);
1205
1189
  e.preventDefault();
1206
1190
  e.stopPropagation();
1207
1191
  }
1208
- }), [ ve, Re, Le, Te ]);
1192
+ }), [ ve, Re, qe, Ae ]);
1209
1193
  var Xe = (0, t.useCallback)((function(e, r) {
1210
1194
  var t = r.name;
1211
1195
  var n = e.ctrlKey, a = e.key, l = e.metaKey, i = e.shiftKey;
1212
- var o = ge(t);
1213
- var u = de(t);
1214
- var c = Ce(t);
1196
+ var u = ye(t);
1197
+ var o = fe(t);
1198
+ var c = Se(t);
1215
1199
  var s = ve(t);
1216
- var v = s ? Z.current[s] : -1;
1217
- var f = ee.current >= 0 ? ee.current : 0;
1218
- if (J.current && J.current.length > 0) {
1200
+ var v = s ? Y.current[s] : -1;
1201
+ var d = Z.current >= 0 ? Z.current : 0;
1202
+ if (G.current && G.current.length > 0) {
1219
1203
  Ie();
1220
1204
  }
1221
- var d = s;
1205
+ var f = s;
1222
1206
  switch (a) {
1223
1207
  case "Shift":
1224
- ee.current = v;
1208
+ Z.current = v;
1225
1209
  break;
1226
1210
 
1227
1211
  case "Home":
1228
1212
  if (n && i) {
1229
1213
  // handle select until start
1230
- He(e, {
1214
+ Te(e, {
1231
1215
  targetIndex: 0,
1232
- initialIndex: f,
1216
+ initialIndex: d,
1233
1217
  name: t
1234
1218
  });
1235
1219
  } else {
1236
- var p = Oe(o, 1);
1237
- d = p[0];
1220
+ var p = Oe(u, 1);
1221
+ f = p[0];
1238
1222
  }
1239
1223
  break;
1240
1224
 
1241
1225
  case "End":
1242
1226
  if (n && i) {
1243
1227
  // handle select until end
1244
- He(e, {
1245
- targetIndex: o.length - 1,
1246
- initialIndex: f,
1228
+ Te(e, {
1229
+ targetIndex: u.length - 1,
1230
+ initialIndex: d,
1247
1231
  name: t
1248
1232
  });
1249
1233
  } else {
1250
- d = o[o.length - 1];
1234
+ f = u[u.length - 1];
1251
1235
  }
1252
1236
  break;
1253
1237
 
1254
1238
  case "ArrowUp":
1255
1239
  if (i) {
1256
1240
  // handle select until previous
1257
- He(e, {
1241
+ Te(e, {
1258
1242
  targetIndex: Math.max(v - 1, 0),
1259
- initialIndex: f,
1243
+ initialIndex: d,
1260
1244
  name: t
1261
1245
  });
1262
1246
  } else {
1263
- d = o[Math.max(v - 1, 0)];
1247
+ f = u[Math.max(v - 1, 0)];
1264
1248
  }
1265
1249
  break;
1266
1250
 
1267
1251
  case "ArrowDown":
1268
1252
  if (i) {
1269
1253
  // handle select until next
1270
- He(e, {
1271
- targetIndex: Math.min(v + 1, o.length - 1),
1272
- initialIndex: f,
1254
+ Te(e, {
1255
+ targetIndex: Math.min(v + 1, u.length - 1),
1256
+ initialIndex: d,
1273
1257
  name: t
1274
1258
  });
1275
1259
  } else {
1276
- d = o[Math.min(v + 1, o.length - 1)];
1260
+ f = u[Math.min(v + 1, u.length - 1)];
1277
1261
  }
1278
1262
  break;
1279
1263
 
1280
1264
  case " ":
1281
1265
  if (s != null) {
1282
- Ae(e, {
1266
+ He(e, {
1283
1267
  name: t,
1284
1268
  value: s
1285
1269
  });
@@ -1287,28 +1271,28 @@
1287
1271
  break;
1288
1272
 
1289
1273
  case "Enter":
1290
- if (t === ae) {
1274
+ if (t === ne) {
1291
1275
  if (c) {
1292
1276
  // all values moved, no longer an active value
1293
- d = undefined;
1294
- } else if (u.length > 0) {
1277
+ f = undefined;
1278
+ } else if (o.length > 0) {
1295
1279
  // somes values moved, determine next active value
1296
- d = w(v, o, u);
1280
+ f = U(v, u, o);
1297
1281
  }
1298
- Fe(e, ae, le);
1282
+ Fe(e, ne, ae);
1299
1283
  }
1300
1284
  break;
1301
1285
 
1302
1286
  case "Delete":
1303
- if (t === le) {
1287
+ if (t === ae) {
1304
1288
  if (c) {
1305
1289
  // all values moved, no longer an active value
1306
- d = undefined;
1307
- } else if (u.length > 0) {
1290
+ f = undefined;
1291
+ } else if (o.length > 0) {
1308
1292
  // somes values moved, determine next active value
1309
- d = w(v, o, u);
1293
+ f = U(v, u, o);
1310
1294
  }
1311
- Fe(e, le, ae);
1295
+ Fe(e, ae, ne);
1312
1296
  }
1313
1297
  break;
1314
1298
 
@@ -1325,11 +1309,11 @@
1325
1309
  }
1326
1310
  break;
1327
1311
  }
1328
- if (d !== s) {
1312
+ if (f !== s) {
1329
1313
  e.preventDefault();
1330
- Te(t, d);
1314
+ Ae(t, f);
1331
1315
  }
1332
- }), [ Ie, ve, Ce, de, ge, We, Fe, He, Ae, Ke, Te, ae, le ]);
1316
+ }), [ Ie, ve, Se, fe, ye, We, Fe, Te, He, Ke, Ae, ne, ae ]);
1333
1317
  var Ge = (0, t.useMemo)((function() {
1334
1318
  return {
1335
1319
  onButtonClick: $e,
@@ -1339,81 +1323,81 @@
1339
1323
  }), [ $e, je, Ee ]);
1340
1324
  var Je = (0, t.useMemo)((function() {
1341
1325
  return {
1342
- controlled: j.current,
1326
+ controlled: L.current,
1343
1327
  getActiveValue: ve,
1344
- getScreenReaderMessage: be,
1345
- getSelectedStateForValue: me,
1328
+ getScreenReaderMessage: me,
1329
+ getSelectedStateForValue: he,
1346
1330
  getSelectedValueCount: pe,
1347
1331
  getValueCount: ke,
1348
1332
  updateLabelRefreshHookByName: _e,
1349
- updateOptionRefreshHookByValue: Ne,
1350
- updateScreenReaderRefreshHook: qe
1333
+ updateOptionRefreshHookByValue: Pe,
1334
+ updateScreenReaderRefreshHook: Le
1351
1335
  };
1352
- }), [ ve, be, me, pe, ke, _e, Ne, qe ]);
1353
- if (j.current && !ce[0].activeFound) {
1336
+ }), [ ve, me, he, pe, ke, _e, Pe, Le ]);
1337
+ if (L.current && !ce[0].activeFound) {
1354
1338
  // listOne active value wasn't found, likely the result of a controlled state reset
1355
1339
  // update interal values, skip the render it will be caught in batch
1356
- Te(ae, undefined, true);
1340
+ Ae(ne, undefined, true);
1357
1341
  }
1358
- if (j.current && !ce[1].activeFound) {
1342
+ if (L.current && !ce[1].activeFound) {
1359
1343
  // listTwo active value wasn't found, likely the result of a controlled state reset
1360
1344
  // update interal values, skip the render it will be caught in batch
1361
- Te(le, undefined, true);
1345
+ Ae(ae, undefined, true);
1362
1346
  }
1363
1347
 
1364
- return n().createElement(Se, xe({
1348
+ return n().createElement(S, xe({
1365
1349
  "data-test": "dual-listbox",
1366
- elementRef: b,
1367
- $inline: g ? false : O,
1368
- $fill: g
1369
- }, P), n().createElement(h.Provider, {
1350
+ elementRef: h,
1351
+ $inline: y ? false : C,
1352
+ $fill: y
1353
+ }, E), n().createElement(m.Provider, {
1370
1354
  value: Je
1371
- }, n().createElement(ye, {
1355
+ }, n().createElement(F, {
1372
1356
  index: 0,
1373
- elementRef: M,
1374
- label: ie,
1375
- name: ae,
1357
+ elementRef: j,
1358
+ label: le,
1359
+ name: ne,
1376
1360
  onClick: ze,
1377
1361
  onKeyDown: Xe,
1378
1362
  onSelectAllClick: Ue
1379
- }, ce[0].options), n().createElement(we, null, n().createElement(I.Provider, {
1363
+ }, ce[0].options), n().createElement(w, null, n().createElement(be.Provider, {
1380
1364
  value: Ge
1381
- }, n().createElement(F, {
1382
- ariaLabel: (0, v.sprintf)((0, i._)("Move selected options to %(listLabel)s list"), {
1383
- listLabel: oe
1365
+ }, n().createElement(Ce, {
1366
+ ariaLabel: (0, d.sprintf)((0, f._)("Move selected options to %(listLabel)s list"), {
1367
+ listLabel: ie
1384
1368
  }),
1385
1369
  ariaKeyShortcuts: "Enter",
1386
1370
  "data-test": "move-to-secondary",
1387
- icon: n().createElement(s(), null),
1388
- name: ae,
1389
- tooltipLabel: (0, v.sprintf)((0, i._)("Move to %(listLabel)s"), {
1390
- listLabel: oe
1371
+ icon: n().createElement(c(), null),
1372
+ name: ne,
1373
+ tooltipLabel: (0, d.sprintf)((0, f._)("Move to %(listLabel)s"), {
1374
+ listLabel: ie
1391
1375
  }),
1392
1376
  tooltipPlacement: "left"
1393
- }), n().createElement(F, {
1394
- ariaLabel: (0, v.sprintf)((0, i._)("Move selected options to %(listLabel)s list"), {
1395
- listLabel: ie
1377
+ }), n().createElement(Ce, {
1378
+ ariaLabel: (0, d.sprintf)((0, f._)("Move selected options to %(listLabel)s list"), {
1379
+ listLabel: le
1396
1380
  }),
1397
1381
  ariaKeyShortcuts: "Delete",
1398
1382
  "data-test": "move-to-primary",
1399
1383
  icon: n().createElement(u(), null),
1400
- name: le,
1401
- tooltipLabel: (0, v.sprintf)((0, i._)("Move to %(listLabel)s"), {
1402
- listLabel: ie
1384
+ name: ae,
1385
+ tooltipLabel: (0, d.sprintf)((0, f._)("Move to %(listLabel)s"), {
1386
+ listLabel: le
1403
1387
  }),
1404
1388
  tooltipPlacement: "right"
1405
- }))), n().createElement(ye, {
1389
+ }))), n().createElement(F, {
1406
1390
  index: 1,
1407
- elementRef: $,
1408
- label: oe,
1409
- name: le,
1391
+ elementRef: A,
1392
+ label: ie,
1393
+ name: ae,
1410
1394
  onClick: ze,
1411
1395
  onKeyDown: Xe,
1412
1396
  onSelectAllClick: Ue
1413
- }, ce[1].options), n().createElement(k, null)));
1397
+ }, ce[1].options), n().createElement(ue, null)));
1414
1398
  }
1415
1399
  je.propTypes = _e;
1416
- je.Option = ne;
1400
+ je.Option = ae;
1417
1401
  /* harmony default export */ const Ve = je;
1418
1402
  // CONCATENATED MODULE: ./src/DualListbox/index.ts
1419
1403
  module.exports = r;