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

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