@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/ControlGroup.js CHANGED
@@ -100,33 +100,37 @@
100
100
  const g = require("@splunk/themes");
101
101
  // CONCATENATED MODULE: ./src/ControlGroup/ControlGroupStyles.ts
102
102
  var w = "24px";
103
- var S = y()(b()).withConfig({
104
- displayName: "ControlGroupStyles__StyledBox",
103
+ var S = y().div.withConfig({
104
+ displayName: "ControlGroupStyles__StyledHelp",
105
105
  componentId: "wjnyif-0"
106
- })([ "", " max-width:600px;margin-block-end:", ";&:last-child{margin-block-end:0;}", "" ], g.mixins.reset("flex"), g.variables.spacingLarge, (function(e) {
106
+ })([ "", ";", ";" ], g.mixins.reset("block"), g.mixins.typography("smallBody"));
107
+ var O = y().label.withConfig({
108
+ displayName: "ControlGroupStyles__StyledLabel",
109
+ componentId: "wjnyif-1"
110
+ })([ "", ";word-wrap:break-word;" ], g.mixins.typography("body", {
111
+ color: "active"
112
+ }));
113
+ var I = y()(b()).withConfig({
114
+ displayName: "ControlGroupStyles__StyledBox",
115
+ componentId: "wjnyif-2"
116
+ })([ "", " max-width:600px;margin-block-end:", ";&:last-child{margin-block-end:0;}", " ", "" ], g.mixins.reset("flex"), g.variables.spacingLarge, (function(e) {
107
117
  var r = e.$labelPosition;
108
118
  return r === "top" ? (0, f.css)([ "flex-direction:column;gap:", ";" ], g.variables.spacingXSmall) : (0,
109
119
  f.css)([ "flex-direction:row;gap:", ";" ], g.variables.spacingMedium);
120
+ }), (function(e) {
121
+ var r = e.$disabled;
122
+ return r && (0, f.css)([ "", "{color:", ";}", "{color:", ";}" ], /* sc-sel */ O, g.variables.contentColorDisabled, /* sc-sel */ S, g.variables.contentColorDisabled);
110
123
  }));
111
124
  // Aligns label to the top for case where labelPosition="left" and StyledControlsAndMessagingWrapper is taller than label.
112
- var O = y().div.withConfig({
125
+ var C = y().div.withConfig({
113
126
  displayName: "ControlGroupStyles__StyledLabelWrapper",
114
- componentId: "wjnyif-1"
127
+ componentId: "wjnyif-3"
115
128
  })([ "display:inline-flex;align-items:flex-start;gap:", ";flex-shrink:0;" ], g.variables.spacingXSmall);
116
- var I = y().label.withConfig({
117
- displayName: "ControlGroupStyles__StyledLabel",
118
- componentId: "wjnyif-2"
119
- })([ "", ";word-wrap:break-word;", ";" ], g.mixins.typography("body", {
120
- color: "active"
121
- }), (function(e) {
122
- var r = e.$disabled;
123
- return r && (0, f.css)([ "color:", ";" ], g.variables.contentColorDisabled);
124
- }));
125
129
  // Vertically centers label & tooltip.
126
- var C = y().div.withConfig({
130
+ var x = y().div.withConfig({
127
131
  displayName: "ControlGroupStyles__StyledLabelInnerWrapper",
128
- componentId: "wjnyif-3"
129
- })([ "display:inline-flex;gap:", ";align-items:center;:has(", ":not(:empty)){min-height:", ";}" ], g.variables.spacingXSmall, /* sc-sel */ I, (0,
132
+ componentId: "wjnyif-4"
133
+ })([ "display:inline-flex;gap:", ";align-items:center;:has(", ":not(:empty)){min-height:", ";}" ], g.variables.spacingXSmall, /* sc-sel */ O, (0,
130
134
  g.pickVariant)("$labelPosition", {
131
135
  /* Ensures label is vertically centered with input */
132
136
  left: g.variables.inputHeight,
@@ -136,31 +140,24 @@
136
140
  */
137
141
  top: w
138
142
  }));
139
- var x = y()(h()).withConfig({
143
+ var j = y()(h()).withConfig({
140
144
  displayName: "ControlGroupStyles__StyledTooltip",
141
- componentId: "wjnyif-4"
145
+ componentId: "wjnyif-5"
142
146
  })([ "flex-shrink:0;& button{min-width:", ";min-height:", ";width:", ";height:", ";}" ], w, w, w, w);
143
- var j = y().div.withConfig({
147
+ var E = y().div.withConfig({
144
148
  displayName: "ControlGroupStyles__StyledControlsAndMessagingWrapper",
145
- componentId: "wjnyif-5"
149
+ componentId: "wjnyif-6"
146
150
  })([ "display:flex;flex-direction:column;gap:", ";min-width:0;", "" ], g.variables.spacingXSmall, (function(e) {
147
151
  var r = e.$controlsLayout;
148
152
  return r !== "none" && (0, f.css)([ "flex-grow:1;" ]);
149
153
  }));
150
- var E = y()(b()).withConfig({
154
+ var P = y()(b()).withConfig({
151
155
  displayName: "ControlGroupStyles__StyledControlsWrapper",
152
- componentId: "wjnyif-6"
156
+ componentId: "wjnyif-7"
153
157
  })([ "gap:", ";", "" ], g.variables.spacingMedium, (0, g.pickVariant)("$controlsLayout", {
154
158
  fillJoin: (0, f.css)([ "gap:0;" ]),
155
159
  stack: (0, f.css)([ "flex-direction:column;" ])
156
160
  }));
157
- var P = y().div.withConfig({
158
- displayName: "ControlGroupStyles__StyledHelp",
159
- componentId: "wjnyif-7"
160
- })([ "", ";", ";", ";" ], g.mixins.reset("block"), g.mixins.typography("smallBody"), (function(e) {
161
- var r = e.$disabled;
162
- return r && (0, f.css)([ "color:", ";" ], g.variables.contentColorDisabled);
163
- }));
164
161
  var k = y().span.withConfig({
165
162
  displayName: "ControlGroupStyles__StyledAsterisk",
166
163
  componentId: "wjnyif-8"
@@ -168,27 +165,27 @@
168
165
  // CONCATENATED MODULE: external "@splunk/ui-utils/i18n"
169
166
  const _ = require("@splunk/ui-utils/i18n");
170
167
  // CONCATENATED MODULE: external "@splunk/react-icons/ExclamationTriangle"
171
- const q = require("@splunk/react-icons/ExclamationTriangle");
172
- var D = e.n(q);
168
+ const T = require("@splunk/react-icons/ExclamationTriangle");
169
+ var q = e.n(T);
173
170
  // CONCATENATED MODULE: external "@splunk/themes/mixins"
174
- const T = require("@splunk/themes/mixins");
171
+ const D = require("@splunk/themes/mixins");
175
172
  // CONCATENATED MODULE: ./src/ControlGroup/ErrorMessageBarStyles.ts
176
173
  var M = y().div.withConfig({
177
174
  displayName: "ErrorMessageBarStyles__StyledErrorMessageBarWrapper",
178
175
  componentId: "sc-1praezx-0"
179
176
  })([ "display:flex;gap:", ";word-break:break-word;border-radius:", ";padding:", ";background-color:", ";" ], g.variables.spacingXSmall, g.variables.borderRadius, g.variables.spacingXSmall, g.variables.notificationColorNegativeWeak);
180
- var L = y()(D()).withConfig({
177
+ var L = y()(q()).withConfig({
181
178
  displayName: "ErrorMessageBarStyles__StyledIcon",
182
179
  componentId: "sc-1praezx-1"
183
180
  })([ "position:relative;fill:", ";" ], g.variables.interactiveColorAccentError);
184
181
  var N = y().p.withConfig({
185
182
  displayName: "ErrorMessageBarStyles__StyledErrorMessage",
186
183
  componentId: "sc-1praezx-2"
187
- })([ "", ";", ";" ], g.mixins.reset("block"), (0, T.typography)("smallBody", {
184
+ })([ "", ";", ";" ], g.mixins.reset("block"), (0, D.typography)("smallBody", {
188
185
  color: "active"
189
186
  }));
190
187
  // CONCATENATED MODULE: ./src/ControlGroup/ErrorMessageBar.tsx
191
- function $(e, r) {
188
+ function B(e, r) {
192
189
  if (null == e) return {};
193
190
  var t, n, l = G(e, r);
194
191
  if (Object.getOwnPropertySymbols) {
@@ -210,30 +207,30 @@
210
207
  }
211
208
  return t;
212
209
  }
213
- var B = (0, _._)("Error: ");
214
- var A = {
210
+ var A = (0, _._)("Error: ");
211
+ var $ = {
215
212
  children: o().node.isRequired
216
213
  };
217
214
  function W(e) {
218
- var r = e.children, t = $(e, [ "children" ]);
215
+ var r = e.children, t = B(e, [ "children" ]);
219
216
 
220
217
  return n().createElement(M, t, n().createElement(L, {
221
218
  variant: "filled"
222
- }), n().createElement(a(), null, B), n().createElement(N, null, r));
219
+ }), n().createElement(a(), null, A), n().createElement(N, null, r));
223
220
  }
224
- W.propTypes = A;
221
+ W.propTypes = $;
225
222
  /* harmony default export */ const F = W;
226
223
  // CONCATENATED MODULE: ./src/ControlGroup/ControlGroup.tsx
227
- function X(e) {
224
+ function R(e) {
228
225
  "@babel/helpers - typeof";
229
- return X = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
226
+ return R = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
230
227
  return typeof e;
231
228
  } : function(e) {
232
229
  return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
233
- }, X(e);
230
+ }, R(e);
234
231
  }
235
- function R() {
236
- return R = Object.assign ? Object.assign.bind() : function(e) {
232
+ function X() {
233
+ return X = Object.assign ? Object.assign.bind() : function(e) {
237
234
  for (var r = 1; r < arguments.length; r++) {
238
235
  var t = arguments[r];
239
236
  for (var n in t) {
@@ -241,7 +238,7 @@
241
238
  }
242
239
  }
243
240
  return e;
244
- }, R.apply(null, arguments);
241
+ }, X.apply(null, arguments);
245
242
  }
246
243
  function H(e, r) {
247
244
  if (null == e) return {};
@@ -265,7 +262,7 @@
265
262
  }
266
263
  return t;
267
264
  }
268
- function z(e, r) {
265
+ function V(e, r) {
269
266
  var t = Object.keys(e);
270
267
  if (Object.getOwnPropertySymbols) {
271
268
  var n = Object.getOwnPropertySymbols(e);
@@ -275,18 +272,18 @@
275
272
  }
276
273
  return t;
277
274
  }
278
- function K(e) {
275
+ function z(e) {
279
276
  for (var r = 1; r < arguments.length; r++) {
280
277
  var t = null != arguments[r] ? arguments[r] : {};
281
- r % 2 ? z(Object(t), !0).forEach((function(r) {
282
- V(e, r, t[r]);
283
- })) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : z(Object(t)).forEach((function(r) {
278
+ r % 2 ? V(Object(t), !0).forEach((function(r) {
279
+ K(e, r, t[r]);
280
+ })) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : V(Object(t)).forEach((function(r) {
284
281
  Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
285
282
  }));
286
283
  }
287
284
  return e;
288
285
  }
289
- function V(e, r, t) {
286
+ function K(e, r, t) {
290
287
  return (r = U(r)) in e ? Object.defineProperty(e, r, {
291
288
  value: t,
292
289
  enumerable: !0,
@@ -296,14 +293,14 @@
296
293
  }
297
294
  function U(e) {
298
295
  var r = Q(e, "string");
299
- return "symbol" == X(r) ? r : r + "";
296
+ return "symbol" == R(r) ? r : r + "";
300
297
  }
301
298
  function Q(e, r) {
302
- if ("object" != X(e) || !e) return e;
299
+ if ("object" != R(e) || !e) return e;
303
300
  var t = e[Symbol.toPrimitive];
304
301
  if (void 0 !== t) {
305
302
  var n = t.call(e, r || "default");
306
- if ("object" != X(n)) return n;
303
+ if ("object" != R(n)) return n;
307
304
  throw new TypeError("@@toPrimitive must return a primitive value.");
308
305
  }
309
306
  return ("string" === r ? String : Number)(e);
@@ -439,73 +436,84 @@
439
436
  return undefined;
440
437
  }
441
438
  // Configure the Children
442
- function de(e, r, n) {
443
- var l = e.props, o = l.disabled, i = l.error, a = l.id, s = l.inputId, c = l.style;
444
- var u = n.childIds, d = n.controlsLayout, p = n.help, f = n.helpId, y = n.error, v = n.errorId, b = n.label, m = n.labelFor, h = n.labelId, g = n.numChildren, w = n.required, S = n.showErrorText;
445
- var O = {
439
+ function de(e, r, l) {
440
+ var o = e.props, i = o.disabled, a = o.error, s = o.id, c = o.inputId, u = o.style, d = o.children;
441
+ var p = l.childIds, f = l.controlsLayout, y = l.help, v = l.helpId, b = l.error, m = l.errorId, h = l.label, g = l.labelFor, w = l.labelId, S = l.numChildren, O = l.required, I = l.showErrorText;
442
+ var C = {
446
443
  key: e.key || r,
447
- labelledBy: h
444
+ labelledBy: w
448
445
  };
449
- if (d === "fillJoin") {
446
+ if (f === "fillJoin") {
450
447
  if (r > 0) {
451
- O.prepend = true;
448
+ C.prepend = true;
452
449
  }
453
- if (r < g - 1) {
454
- O.append = true;
450
+ if (r < S - 1) {
451
+ C.append = true;
455
452
  }
456
- if (O.prepend || O.append) {
457
- O.inline = false;
453
+ if (C.prepend || C.append) {
454
+ C.inline = false;
458
455
  }
459
456
  }
460
- if (d === "fill" && g > 1) {
461
- O.inline = true;
457
+ if (f === "fill" && S > 1) {
458
+ C.inline = true;
462
459
  }
463
- if (d === "stack") {
464
- O.inline = false;
460
+ if (f === "stack") {
461
+ C.inline = false;
465
462
  }
466
- if (p && typeof y === "boolean") {
467
- O.describedBy = f;
468
- } else if (p && typeof y === "string") {
469
- O.describedBy = "".concat(f, " ").concat(v);
470
- } else if (!p && typeof y === "string") {
471
- O.describedBy = v;
463
+ if (y && typeof b === "boolean") {
464
+ C.describedBy = v;
465
+ } else if (y && typeof b === "string") {
466
+ C.describedBy = "".concat(v, " ").concat(m);
467
+ } else if (!y && typeof b === "string") {
468
+ C.describedBy = m;
472
469
  }
473
- if (w) {
474
- O.required = true;
470
+ if (O) {
471
+ C.required = true;
475
472
  }
476
473
  // TODO: SUI-3402 refactor so that parent component doesn't have to know what it's child components are
477
474
  if (e.type.componentType === "Multiselect") {
478
- var I = e;
479
- if (!I.props.compact) {
480
- O.labelText = b;
475
+ var x = e;
476
+ if (!x.props.compact) {
477
+ C.labelText = h;
481
478
  }
482
479
  } else {
483
- O.labelText = b;
480
+ C.labelText = h;
484
481
  }
485
- if (g === 1 && (d === "fillJoin" || d === "fill")) {
482
+ if (S === 1 && (f === "fillJoin" || f === "fill")) {
486
483
  // Some controls like Select do not grow by default, so flexGrow is applied
487
484
  // The spread operator is used as css styles are not nested, so there is no need for a deep copy.
488
- O.style = c ? K(K({}, c), oe) : oe;
485
+ C.style = u ? z(z({}, u), oe) : oe;
489
486
  }
490
- if (!m && e) {
487
+ if (!g && e) {
491
488
  if (ie(e)) {
492
- O.inputId = s || ce("input-id", r, u);
489
+ C.inputId = c || ce("input-id", r, p);
493
490
  } else {
494
- O.id = a || ce("id", r, u);
491
+ C.id = s || ce("id", r, p);
495
492
  }
496
493
  }
497
- if (S && i === true) {
498
- O["aria-errormessage"] = v;
494
+ if (I && a === true) {
495
+ C["aria-errormessage"] = m;
496
+ }
497
+ var j = i !== null && i !== void 0 ? i : false;
498
+ // RadioBar and RadioList need special handling in the case where the parent grouping component is not set to disabled
499
+ // but all of the children are disabled.
500
+ var E = e.type.componentType === "RadioBar" || e.type.componentType === "RadioList";
501
+ if (E && !e.props.disabled) {
502
+ j = n().Children.toArray(d).every((function(e) {
503
+ var r;
504
+
505
+ return n().isValidElement(e) && ((r = e.props) === null || r === void 0 ? void 0 : r.disabled);
506
+ }));
499
507
  }
500
508
  return {
501
- child: (0, t.cloneElement)(e, O),
502
- childDisabled: o !== null && o !== void 0 ? o : false
509
+ child: (0, t.cloneElement)(e, C),
510
+ childDisabled: j
503
511
  };
504
512
  }
505
513
  function pe(e, r) {
506
514
  var t = e.length;
507
515
  var n = 0;
508
- var l = K({
516
+ var l = z({
509
517
  numChildren: t
510
518
  }, r);
511
519
  var o = e.map((function(e, r) {
@@ -539,7 +547,7 @@
539
547
  * attribute. If `inputId` is supported but not set a generated id is used instead. If `inputId` isn't
540
548
  * supported `id` is used. The `labelFor` prop may be used to override the `for` attribute.
541
549
  */ function ye(e) {
542
- var r = e.children, l = e.controlsLayout, o = l === void 0 ? "fill" : l, i = e.error, s = i === void 0 ? false : i, d = e.help, f = e.hideLabel, y = e.label, v = e.labelFor, b = e.labelPosition, m = b === void 0 ? "top" : b, h = e.labelWidth, g = h === void 0 ? fe : h, w = e.required, _ = w === void 0 ? false : w, q = e.tooltip, D = e.tooltipDefaultPlacement, T = H(e, [ "children", "controlsLayout", "error", "help", "hideLabel", "label", "labelFor", "labelPosition", "labelWidth", "required", "tooltip", "tooltipDefaultPlacement" ]);
550
+ var r = e.children, l = e.controlsLayout, o = l === void 0 ? "fill" : l, i = e.error, s = i === void 0 ? false : i, d = e.help, f = e.hideLabel, y = e.label, v = e.labelFor, b = e.labelPosition, m = b === void 0 ? "top" : b, h = e.labelWidth, g = h === void 0 ? fe : h, w = e.required, _ = w === void 0 ? false : w, T = e.tooltip, q = e.tooltipDefaultPlacement, D = H(e, [ "children", "controlsLayout", "error", "help", "hideLabel", "label", "labelFor", "labelPosition", "labelWidth", "required", "tooltip", "tooltipDefaultPlacement" ]);
543
551
  // @docs-props-type ControlGroupPropsBase
544
552
  var M = (0, t.useState)((function() {
545
553
  return {
@@ -547,10 +555,10 @@
547
555
  helpId: (0, u.createDOMID)("help"),
548
556
  labelId: (0, u.createDOMID)("label")
549
557
  };
550
- })), L = Y(M, 1), N = L[0], $ = N.errorId, G = N.helpId, B = N.labelId;
551
- /** Child ids need to be the same on each render because of SUI-2817 */ var A = (0,
552
- t.useState)({}), W = Y(A, 2), X = W[0], J = W[1];
553
- var z = (0, t.useState)(false), K = Y(z, 2), V = K[0], U = K[1];
558
+ })), L = Y(M, 1), N = L[0], B = N.errorId, G = N.helpId, A = N.labelId;
559
+ /** Child ids need to be the same on each render because of SUI-2817 */ var $ = (0,
560
+ t.useState)({}), W = Y($, 2), R = W[0], J = W[1];
561
+ var V = (0, t.useState)(false), z = Y(V, 2), K = z[0], U = z[1];
554
562
  var Q = c()(n().Children.count(r));
555
563
  var Z = (0, t.useCallback)((function(e) {
556
564
  J(e);
@@ -573,20 +581,20 @@
573
581
  J({});
574
582
  }
575
583
  // If childIds has already been populated, labelFor has a value, or if all children have ids then we don't need to make ids for the children.
576
- if (Object.keys(X).length === 0 && !v && !V) {
584
+ if (Object.keys(R).length === 0 && !v && !K) {
577
585
  var e = se(re), t = e.newChildIds, l = e.allChildrenHaveId;
578
586
  J(t);
579
587
  U(l);
580
588
  }
581
- }), [ V, X, r, v, Q, Z, ee, re ]);
589
+ }), [ K, R, r, v, Q, Z, ee, re ]);
582
590
  var te = (0, t.useMemo)((function() {
583
591
  return {
584
592
  labelAttrs: {
585
593
  text: y,
586
- id: B
594
+ id: A
587
595
  }
588
596
  };
589
- }), [ y, B ]);
597
+ }), [ y, A ]);
590
598
  var ne = typeof s === "string";
591
599
  var le = ne && s !== "";
592
600
  var oe = Number.isFinite(g) ? "".concat(g, "px") : g;
@@ -594,59 +602,59 @@
594
602
  width: oe
595
603
  } : undefined;
596
604
  var ae = pe(re, {
597
- childIds: X,
605
+ childIds: R,
598
606
  controlsLayout: o,
599
607
  help: d,
600
608
  helpId: G,
601
609
  error: s,
602
- errorId: $,
610
+ errorId: B,
603
611
  label: y,
604
612
  labelFor: v,
605
- labelId: B,
613
+ labelId: A,
606
614
  required: _,
607
615
  showErrorText: le
608
616
  }), ce = ae.childrenFormatted, de = ae.controlGroupDisabled;
609
617
  var ye = (0, t.useMemo)((function() {
610
618
  return v || ue(ce);
611
619
  }), [ ce, v ]);
612
- var ve = n().createElement(O, {
620
+ var ve = n().createElement(C, {
613
621
  style: ie,
614
622
  $labelPosition: m
615
- }, n().createElement(C, {
623
+ }, n().createElement(x, {
616
624
  $labelPosition: m
617
- }, n().createElement(I, {
625
+ }, n().createElement(O, {
618
626
  "data-test": "label",
619
- $disabled: de,
620
- id: B,
627
+ id: A,
621
628
  htmlFor: ye
622
629
  }, _ && n().createElement(k, {
623
630
  "aria-hidden": "true"
624
- }, "*"), y, !f && q && n().createElement(a(), null, q)), !f && q && n().createElement(x, {
631
+ }, "*"), y, !f && T && n().createElement(a(), null, T)), !f && T && n().createElement(j, {
625
632
  closeWhen: "notOnClick",
626
- content: q,
627
- defaultPlacement: D,
633
+ content: T,
634
+ defaultPlacement: q,
628
635
  "aria-hidden": "true"
629
636
  })));
630
637
 
631
- return n().createElement(S, R({
638
+ return n().createElement(I, X({
632
639
  "data-test": "control-group",
633
640
  "data-test-required": _,
641
+ "data-test-children-disabled": de,
634
642
  $labelPosition: m,
643
+ $disabled: de,
635
644
  "aria-invalid": !!s || undefined
636
- }, T), n().createElement(p.Provider, {
645
+ }, D), n().createElement(p.Provider, {
637
646
  value: te
638
- }, f ? n().createElement(a(), null, ve) : ve, n().createElement(j, {
647
+ }, f ? n().createElement(a(), null, ve) : ve, n().createElement(E, {
639
648
  $controlsLayout: o
640
- }, n().createElement(E, {
649
+ }, n().createElement(P, {
641
650
  $controlsLayout: o,
642
651
  "data-test": "controls",
643
652
  flex: o !== "none"
644
653
  }, ce), le && n().createElement(F, {
645
654
  "data-test": "error",
646
- id: $
647
- }, s), d && n().createElement(P, {
655
+ id: B
656
+ }, s), d && n().createElement(S, {
648
657
  "data-test": "help",
649
- $disabled: de,
650
658
  id: G
651
659
  }, d))));
652
660
  }