@splunk/react-ui 5.0.0-beta.5 → 5.0.0-rc.2

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 (52) hide show
  1. package/ButtonSimple.js +92 -168
  2. package/{CHANGELOG.v5.mdx → CHANGELOG.v5.md} +43 -0
  3. package/Calendar.js +148 -151
  4. package/Card.js +139 -139
  5. package/Code.js +197 -167
  6. package/CollapsiblePanel.js +172 -164
  7. package/Color.js +584 -506
  8. package/ComboBox.js +51 -51
  9. package/ControlGroup.js +132 -127
  10. package/Date.js +137 -150
  11. package/Dropdown.js +97 -96
  12. package/DualListbox.js +468 -469
  13. package/FetchOptions.d.ts +2 -2
  14. package/FormRows.js +158 -157
  15. package/JSONTree.js +354 -360
  16. package/{MIGRATION.mdx → MIGRATION.md} +13 -43
  17. package/{MIGRATION.v5.mdx → MIGRATION.v5.md} +67 -1
  18. package/Markdown.js +3 -4
  19. package/Menu.js +194 -195
  20. package/Modal.js +18 -18
  21. package/ModalLayer.js +171 -217
  22. package/Multiselect.js +785 -778
  23. package/Number.js +103 -102
  24. package/Popover.js +48 -46
  25. package/RadioBar.js +144 -146
  26. package/Resize.js +149 -151
  27. package/ResultsMenu.js +112 -114
  28. package/Search.js +49 -49
  29. package/Select.js +455 -457
  30. package/Slider.js +328 -331
  31. package/Switch.js +251 -178
  32. package/TabBar.js +277 -280
  33. package/Table.js +1212 -1178
  34. package/Text.js +45 -46
  35. package/Tooltip.js +192 -189
  36. package/Tree.js +177 -188
  37. package/package.json +10 -9
  38. package/types/src/Code/Code.d.ts +1 -1
  39. package/types/src/Color/Color.d.ts +2 -2
  40. package/types/src/ControlGroup/ControlGroup.d.ts +1 -2
  41. package/types/src/Dropdown/Dropdown.d.ts +5 -2
  42. package/types/src/Layer/Layer.d.ts +2 -1
  43. package/types/src/Layer/index.d.ts +1 -0
  44. package/types/src/ModalLayer/ModalLayer.d.ts +16 -21
  45. package/types/src/Number/Number.d.ts +1 -1
  46. package/types/src/Popover/Popover.d.ts +5 -2
  47. package/types/src/Table/HeadCell.d.ts +6 -1
  48. package/types/src/Table/HeadInner.d.ts +3 -1
  49. package/types/src/Tooltip/Tooltip.d.ts +7 -7
  50. package/types/src/fixtures/useFetchOptions.d.ts +33 -0
  51. package/useRovingFocus.js +20 -23
  52. package/types/src/fixtures/FetchOptions.d.ts +0 -76
package/ControlGroup.js CHANGED
@@ -62,7 +62,7 @@
62
62
  // EXPORTS
63
63
  e.d(r, {
64
64
  ControlGroupContext: () => /* reexport */ p,
65
- default: () => /* reexport */ ye
65
+ default: () => /* reexport */ ve
66
66
  });
67
67
  // CONCATENATED MODULE: external "react"
68
68
  const t = require("react");
@@ -99,7 +99,8 @@
99
99
  // CONCATENATED MODULE: external "@splunk/themes"
100
100
  const g = require("@splunk/themes");
101
101
  // CONCATENATED MODULE: ./src/ControlGroup/ControlGroupStyles.ts
102
- var w = y()(b()).withConfig({
102
+ var w = "24px";
103
+ var S = y()(b()).withConfig({
103
104
  displayName: "ControlGroupStyles__StyledBox",
104
105
  componentId: "wjnyif-0"
105
106
  })([ "", " max-width:600px;margin-block-end:", ";&:last-child{margin-block-end:0;}", "" ], g.mixins.reset("flex"), g.variables.spacingLarge, (function(e) {
@@ -108,84 +109,88 @@
108
109
  f.css)([ "flex-direction:row;gap:", ";" ], g.variables.spacingMedium);
109
110
  }));
110
111
  // Aligns label to the top for case where labelPosition="left" and StyledControlsAndMessagingWrapper is taller than label.
111
- var S = y().div.withConfig({
112
+ var O = y().div.withConfig({
112
113
  displayName: "ControlGroupStyles__StyledLabelWrapper",
113
114
  componentId: "wjnyif-1"
114
115
  })([ "display:inline-flex;align-items:flex-start;gap:", ";flex-shrink:0;" ], g.variables.spacingXSmall);
115
- // Vertically centers label & tooltip.
116
- var O = y().div.withConfig({
117
- displayName: "ControlGroupStyles__StyledLabelInnerWrapper",
118
- componentId: "wjnyif-2"
119
- })([ "display:inline-flex;gap:", ";align-items:center;", "" ], g.variables.spacingXSmall, (function(e) {
120
- var r = e.$labelPosition;
121
- return r === "left" && (0, f.css)([ "min-height:", ";" ], g.variables.inputHeight);
122
- }));
123
116
  var I = y().label.withConfig({
124
117
  displayName: "ControlGroupStyles__StyledLabel",
125
- componentId: "wjnyif-3"
126
- })([ "", ";flex-shrink:2;word-wrap:break-word;", ";" ], g.mixins.typography("body", {
118
+ componentId: "wjnyif-2"
119
+ })([ "", ";word-wrap:break-word;", ";" ], g.mixins.typography("body", {
127
120
  color: "active"
128
121
  }), (function(e) {
129
122
  var r = e.$disabled;
130
123
  return r && (0, f.css)([ "color:", ";" ], g.variables.contentColorDisabled);
131
124
  }));
132
- var C = y()(h()).withConfig({
125
+ // Vertically centers label & tooltip.
126
+ var C = y().div.withConfig({
127
+ 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,
130
+ g.pickVariant)("$labelPosition", {
131
+ /* Ensures label is vertically centered with input */
132
+ left: g.variables.inputHeight,
133
+ /**
134
+ * Ensures inputs in ControlGroups next to each other are vertically aligned regardless of Tooltip presence.
135
+ * Checked by HorizontalLabelTopLayout story.
136
+ */
137
+ top: w
138
+ }));
139
+ var x = y()(h()).withConfig({
133
140
  displayName: "ControlGroupStyles__StyledTooltip",
134
141
  componentId: "wjnyif-4"
135
- })([ "& button{", "}" ], (0, g.pick)({
136
- prisma: (0, f.css)([ "position:relative;top:-2px;padding:0;svg{width:16px;height:16px;}" ])
137
- }));
138
- var x = y().div.withConfig({
142
+ })([ "flex-shrink:0;& button{min-width:", ";min-height:", ";width:", ";height:", ";}" ], w, w, w, w);
143
+ var j = y().div.withConfig({
139
144
  displayName: "ControlGroupStyles__StyledControlsAndMessagingWrapper",
140
145
  componentId: "wjnyif-5"
141
146
  })([ "display:flex;flex-direction:column;gap:", ";min-width:0;", "" ], g.variables.spacingXSmall, (function(e) {
142
147
  var r = e.$controlsLayout;
143
148
  return r !== "none" && (0, f.css)([ "flex-grow:1;" ]);
144
149
  }));
145
- var j = y()(b()).withConfig({
150
+ var E = y()(b()).withConfig({
146
151
  displayName: "ControlGroupStyles__StyledControlsWrapper",
147
152
  componentId: "wjnyif-6"
148
153
  })([ "gap:", ";", "" ], g.variables.spacingMedium, (0, g.pickVariant)("$controlsLayout", {
149
154
  fillJoin: (0, f.css)([ "gap:0;" ]),
150
155
  stack: (0, f.css)([ "flex-direction:column;" ])
151
156
  }));
152
- var E = y().div.withConfig({
157
+ var P = y().div.withConfig({
153
158
  displayName: "ControlGroupStyles__StyledHelp",
154
159
  componentId: "wjnyif-7"
155
160
  })([ "", ";", ";", ";" ], g.mixins.reset("block"), g.mixins.typography("smallBody"), (function(e) {
156
161
  var r = e.$disabled;
157
162
  return r && (0, f.css)([ "color:", ";" ], g.variables.contentColorDisabled);
158
163
  }));
159
- var P = y().span.withConfig({
164
+ var k = y().span.withConfig({
160
165
  displayName: "ControlGroupStyles__StyledAsterisk",
161
166
  componentId: "wjnyif-8"
162
167
  })([ "color:", ";margin-right:2px;" ], g.variables.contentColorNegative);
163
168
  // CONCATENATED MODULE: external "@splunk/ui-utils/i18n"
164
- const k = require("@splunk/ui-utils/i18n");
169
+ const _ = require("@splunk/ui-utils/i18n");
165
170
  // CONCATENATED MODULE: external "@splunk/react-icons/ExclamationTriangle"
166
- const _ = require("@splunk/react-icons/ExclamationTriangle");
167
- var q = e.n(_);
171
+ const q = require("@splunk/react-icons/ExclamationTriangle");
172
+ var D = e.n(q);
168
173
  // CONCATENATED MODULE: external "@splunk/themes/mixins"
169
- const D = require("@splunk/themes/mixins");
174
+ const T = require("@splunk/themes/mixins");
170
175
  // CONCATENATED MODULE: ./src/ControlGroup/ErrorMessageBarStyles.ts
171
- var T = y().div.withConfig({
176
+ var M = y().div.withConfig({
172
177
  displayName: "ErrorMessageBarStyles__StyledErrorMessageBarWrapper",
173
178
  componentId: "sc-1praezx-0"
174
- })([ "display:flex;gap:", ";word-break:break-word;border-radius:", ";padding:", ";background-color:", ";" ], g.variables.spacingXSmall, g.variables.borderRadius, g.variables.spacingXSmall, g.variables.contentBackgroundColorNegativeWeak);
175
- var M = y()(q()).withConfig({
179
+ })([ "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({
176
181
  displayName: "ErrorMessageBarStyles__StyledIcon",
177
182
  componentId: "sc-1praezx-1"
178
183
  })([ "position:relative;fill:", ";" ], g.variables.interactiveColorAccentError);
179
- var L = y().p.withConfig({
184
+ var N = y().p.withConfig({
180
185
  displayName: "ErrorMessageBarStyles__StyledErrorMessage",
181
186
  componentId: "sc-1praezx-2"
182
- })([ "", ";", ";" ], g.mixins.reset("block"), (0, D.typography)("smallBody", {
187
+ })([ "", ";", ";" ], g.mixins.reset("block"), (0, T.typography)("smallBody", {
183
188
  color: "active"
184
189
  }));
185
190
  // CONCATENATED MODULE: ./src/ControlGroup/ErrorMessageBar.tsx
186
- function N(e, r) {
191
+ function $(e, r) {
187
192
  if (null == e) return {};
188
- var t, n, l = $(e, r);
193
+ var t, n, l = G(e, r);
189
194
  if (Object.getOwnPropertySymbols) {
190
195
  var o = Object.getOwnPropertySymbols(e);
191
196
  for (n = 0; n < o.length; n++) {
@@ -194,7 +199,7 @@
194
199
  }
195
200
  return l;
196
201
  }
197
- function $(e, r) {
202
+ function G(e, r) {
198
203
  if (null == e) return {};
199
204
  var t = {};
200
205
  for (var n in e) {
@@ -205,30 +210,30 @@
205
210
  }
206
211
  return t;
207
212
  }
208
- var B = (0, k._)("Error: ");
209
- var G = {
213
+ var B = (0, _._)("Error: ");
214
+ var A = {
210
215
  children: o().node.isRequired
211
216
  };
212
- function A(e) {
213
- var r = e.children, t = N(e, [ "children" ]);
217
+ function W(e) {
218
+ var r = e.children, t = $(e, [ "children" ]);
214
219
 
215
- return n().createElement(T, t, n().createElement(M, {
220
+ return n().createElement(M, t, n().createElement(L, {
216
221
  variant: "filled"
217
- }), n().createElement(a(), null, B), n().createElement(L, null, r));
222
+ }), n().createElement(a(), null, B), n().createElement(N, null, r));
218
223
  }
219
- A.propTypes = G;
220
- /* harmony default export */ const W = A;
224
+ W.propTypes = A;
225
+ /* harmony default export */ const F = W;
221
226
  // CONCATENATED MODULE: ./src/ControlGroup/ControlGroup.tsx
222
- function F(e) {
227
+ function X(e) {
223
228
  "@babel/helpers - typeof";
224
- return F = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
229
+ return X = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
225
230
  return typeof e;
226
231
  } : function(e) {
227
232
  return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
228
- }, F(e);
233
+ }, X(e);
229
234
  }
230
- function X() {
231
- return X = Object.assign ? Object.assign.bind() : function(e) {
235
+ function R() {
236
+ return R = Object.assign ? Object.assign.bind() : function(e) {
232
237
  for (var r = 1; r < arguments.length; r++) {
233
238
  var t = arguments[r];
234
239
  for (var n in t) {
@@ -236,11 +241,11 @@
236
241
  }
237
242
  }
238
243
  return e;
239
- }, X.apply(null, arguments);
244
+ }, R.apply(null, arguments);
240
245
  }
241
- function R(e, r) {
246
+ function H(e, r) {
242
247
  if (null == e) return {};
243
- var t, n, l = H(e, r);
248
+ var t, n, l = J(e, r);
244
249
  if (Object.getOwnPropertySymbols) {
245
250
  var o = Object.getOwnPropertySymbols(e);
246
251
  for (n = 0; n < o.length; n++) {
@@ -249,7 +254,7 @@
249
254
  }
250
255
  return l;
251
256
  }
252
- function H(e, r) {
257
+ function J(e, r) {
253
258
  if (null == e) return {};
254
259
  var t = {};
255
260
  for (var n in e) {
@@ -260,7 +265,7 @@
260
265
  }
261
266
  return t;
262
267
  }
263
- function J(e, r) {
268
+ function z(e, r) {
264
269
  var t = Object.keys(e);
265
270
  if (Object.getOwnPropertySymbols) {
266
271
  var n = Object.getOwnPropertySymbols(e);
@@ -270,60 +275,60 @@
270
275
  }
271
276
  return t;
272
277
  }
273
- function z(e) {
278
+ function K(e) {
274
279
  for (var r = 1; r < arguments.length; r++) {
275
280
  var t = null != arguments[r] ? arguments[r] : {};
276
- r % 2 ? J(Object(t), !0).forEach((function(r) {
277
- K(e, r, t[r]);
278
- })) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : J(Object(t)).forEach((function(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) {
279
284
  Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
280
285
  }));
281
286
  }
282
287
  return e;
283
288
  }
284
- function K(e, r, t) {
285
- return (r = V(r)) in e ? Object.defineProperty(e, r, {
289
+ function V(e, r, t) {
290
+ return (r = U(r)) in e ? Object.defineProperty(e, r, {
286
291
  value: t,
287
292
  enumerable: !0,
288
293
  configurable: !0,
289
294
  writable: !0
290
295
  }) : e[r] = t, e;
291
296
  }
292
- function V(e) {
293
- var r = U(e, "string");
294
- return "symbol" == F(r) ? r : r + "";
297
+ function U(e) {
298
+ var r = Q(e, "string");
299
+ return "symbol" == X(r) ? r : r + "";
295
300
  }
296
- function U(e, r) {
297
- if ("object" != F(e) || !e) return e;
301
+ function Q(e, r) {
302
+ if ("object" != X(e) || !e) return e;
298
303
  var t = e[Symbol.toPrimitive];
299
304
  if (void 0 !== t) {
300
305
  var n = t.call(e, r || "default");
301
- if ("object" != F(n)) return n;
306
+ if ("object" != X(n)) return n;
302
307
  throw new TypeError("@@toPrimitive must return a primitive value.");
303
308
  }
304
309
  return ("string" === r ? String : Number)(e);
305
310
  }
306
- function Q(e, r) {
307
- return te(e) || re(e, r) || Z(e, r) || Y();
311
+ function Y(e, r) {
312
+ return ne(e) || te(e, r) || ee(e, r) || Z();
308
313
  }
309
- function Y() {
314
+ function Z() {
310
315
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
311
316
  }
312
- function Z(e, r) {
317
+ function ee(e, r) {
313
318
  if (e) {
314
- if ("string" == typeof e) return ee(e, r);
319
+ if ("string" == typeof e) return re(e, r);
315
320
  var t = {}.toString.call(e).slice(8, -1);
316
- return "Object" === t && e.constructor && (t = e.constructor.name), "Map" === t || "Set" === t ? Array.from(e) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? ee(e, r) : void 0;
321
+ return "Object" === t && e.constructor && (t = e.constructor.name), "Map" === t || "Set" === t ? Array.from(e) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? re(e, r) : void 0;
317
322
  }
318
323
  }
319
- function ee(e, r) {
324
+ function re(e, r) {
320
325
  (null == r || r > e.length) && (r = e.length);
321
326
  for (var t = 0, n = Array(r); t < r; t++) {
322
327
  n[t] = e[t];
323
328
  }
324
329
  return n;
325
330
  }
326
- function re(e, r) {
331
+ function te(e, r) {
327
332
  var t = null == e ? null : "undefined" != typeof Symbol && e[Symbol.iterator] || e["@@iterator"];
328
333
  if (null != t) {
329
334
  var n, l, o, i, a = [], s = !0, c = !1;
@@ -345,12 +350,12 @@
345
350
  return a;
346
351
  }
347
352
  }
348
- function te(e) {
353
+ function ne(e) {
349
354
  if (Array.isArray(e)) return e;
350
355
  }
351
356
  // props ControlGroup passes to configure its children's props
352
357
  // props ControlGroup may access and/or override on children
353
- var ne = {
358
+ var le = {
354
359
  children: o().node,
355
360
  controlsLayout: o().oneOf([ "fill", "fillJoin", "none", "stack" ]),
356
361
  elementRef: o().oneOfType([ o().func, o().object ]),
@@ -366,13 +371,13 @@
366
371
  tooltipDefaultPlacement: o().oneOf([ "above", "below", "left", "right" ])
367
372
  };
368
373
  // Style cloned onto child elements when fill behavior set.
369
- var le = {
374
+ var oe = {
370
375
  flexGrow: 1
371
376
  };
372
- function oe(e) {
377
+ function ie(e) {
373
378
  return e.type && e.type.propTypes && Object.prototype.hasOwnProperty.call(e.type.propTypes, "inputId");
374
379
  }
375
- function ie(e, r) {
380
+ function ae(e, r) {
376
381
  var t = "".concat(e, "-").concat(r);
377
382
  var n = (0, u.createDOMID)(e);
378
383
  return {
@@ -380,16 +385,16 @@
380
385
  value: n
381
386
  };
382
387
  }
383
- function ae(e) {
388
+ function se(e) {
384
389
  var r = {};
385
390
  var t = e.length;
386
391
  var n = 0;
387
392
  e.forEach((function(e, t) {
388
- if (oe(e) && e.props.inputId == null) {
389
- var l = ie("input-id", t), o = l.childKey, i = l.value;
393
+ if (ie(e) && e.props.inputId == null) {
394
+ var l = ae("input-id", t), o = l.childKey, i = l.value;
390
395
  r[o] = i;
391
396
  } else if (e.props.id == null) {
392
- var a = ie("id", t), s = a.childKey, c = a.value;
397
+ var a = ae("id", t), s = a.childKey, c = a.value;
393
398
  r[s] = c;
394
399
  } else {
395
400
  // child already has an inputId or id, so we don't need to make a childId for it
@@ -401,7 +406,7 @@
401
406
  allChildrenHaveId: n === t
402
407
  };
403
408
  }
404
- function se(e, r, t) {
409
+ function ce(e, r, t) {
405
410
  var n = "".concat(e, "-").concat(r);
406
411
  var l = t[n];
407
412
  if (!l || !l.length) {
@@ -411,15 +416,15 @@
411
416
  }
412
417
  return l;
413
418
  }
414
- function ce(e) {
419
+ function ue(e) {
415
420
  if (e.length === 0) {
416
421
  return undefined;
417
422
  }
418
- var r = Q(e, 1), t = r[0];
423
+ var r = Y(e, 1), t = r[0];
419
424
  var n = e.find((function(e) {
420
425
  return e.type && e.type.componentType === "Text";
421
426
  }));
422
- var l = oe(t);
427
+ var l = ie(t);
423
428
  var o = t.props, i = o.id, a = o.inputId;
424
429
  // see function doc block for details
425
430
  if (e.length === 1 && (t === null || t === void 0 ? void 0 : t.props)) {
@@ -434,7 +439,7 @@
434
439
  return undefined;
435
440
  }
436
441
  // Configure the Children
437
- function ue(e, r, n) {
442
+ function de(e, r, n) {
438
443
  var l = e.props, o = l.disabled, i = l.error, a = l.id, s = l.inputId, c = l.style;
439
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;
440
445
  var O = {
@@ -480,13 +485,13 @@
480
485
  if (g === 1 && (d === "fillJoin" || d === "fill")) {
481
486
  // Some controls like Select do not grow by default, so flexGrow is applied
482
487
  // The spread operator is used as css styles are not nested, so there is no need for a deep copy.
483
- O.style = c ? z(z({}, c), le) : le;
488
+ O.style = c ? K(K({}, c), oe) : oe;
484
489
  }
485
490
  if (!m && e) {
486
- if (oe(e)) {
487
- O.inputId = s || se("input-id", r, u);
491
+ if (ie(e)) {
492
+ O.inputId = s || ce("input-id", r, u);
488
493
  } else {
489
- O.id = a || se("id", r, u);
494
+ O.id = a || ce("id", r, u);
490
495
  }
491
496
  }
492
497
  if (S && i === true) {
@@ -497,14 +502,14 @@
497
502
  childDisabled: o !== null && o !== void 0 ? o : false
498
503
  };
499
504
  }
500
- function de(e, r) {
505
+ function pe(e, r) {
501
506
  var t = e.length;
502
507
  var n = 0;
503
- var l = z({
508
+ var l = K({
504
509
  numChildren: t
505
510
  }, r);
506
511
  var o = e.map((function(e, r) {
507
- var t = ue(e, r, l), o = t.child, i = t.childDisabled;
512
+ var t = de(e, r, l), o = t.child, i = t.childDisabled;
508
513
  if (i) {
509
514
  n += 1;
510
515
  }
@@ -515,7 +520,7 @@
515
520
  controlGroupDisabled: n === t
516
521
  };
517
522
  }
518
- var pe = 120;
523
+ var fe = 120;
519
524
  /**
520
525
  * `ControlGroup` places a label and optional help text around one or more controls. The `ControlGroup`
521
526
  * will automatically add aria attributes to associate the controls with the labels and help text to
@@ -533,8 +538,8 @@
533
538
  * If the linked child supports an `inputId` prop and it's set, its value is used for the label's `for`
534
539
  * attribute. If `inputId` is supported but not set a generated id is used instead. If `inputId` isn't
535
540
  * supported `id` is used. The `labelFor` prop may be used to override the `for` attribute.
536
- */ function fe(e) {
537
- 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 ? pe : h, k = e.required, _ = k === void 0 ? false : k, q = e.tooltip, D = e.tooltipDefaultPlacement, T = R(e, [ "children", "controlsLayout", "error", "help", "hideLabel", "label", "labelFor", "labelPosition", "labelWidth", "required", "tooltip", "tooltipDefaultPlacement" ]);
541
+ */ 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" ]);
538
543
  // @docs-props-type ControlGroupPropsBase
539
544
  var M = (0, t.useState)((function() {
540
545
  return {
@@ -542,11 +547,11 @@
542
547
  helpId: (0, u.createDOMID)("help"),
543
548
  labelId: (0, u.createDOMID)("label")
544
549
  };
545
- })), L = Q(M, 1), N = L[0], $ = N.errorId, B = N.helpId, G = N.labelId;
550
+ })), L = Y(M, 1), N = L[0], $ = N.errorId, G = N.helpId, B = N.labelId;
546
551
  /** Child ids need to be the same on each render because of SUI-2817 */ var A = (0,
547
- t.useState)({}), F = Q(A, 2), H = F[0], J = F[1];
548
- var z = (0, t.useState)(false), K = Q(z, 2), V = K[0], U = K[1];
549
- var Y = c()(n().Children.count(r));
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];
554
+ var Q = c()(n().Children.count(r));
550
555
  var Z = (0, t.useCallback)((function(e) {
551
556
  J(e);
552
557
  }), []);
@@ -564,89 +569,89 @@
564
569
  }), [ m, g ]);
565
570
  (0, t.useEffect)((function() {
566
571
  // If it's not the first render and the number of child elements has changed, reset childIds
567
- if (Y != null && n().Children.count(r) !== Y) {
572
+ if (Q != null && n().Children.count(r) !== Q) {
568
573
  J({});
569
574
  }
570
575
  // 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.
571
- if (Object.keys(H).length === 0 && !v && !V) {
572
- var e = ae(re), t = e.newChildIds, l = e.allChildrenHaveId;
576
+ if (Object.keys(X).length === 0 && !v && !V) {
577
+ var e = se(re), t = e.newChildIds, l = e.allChildrenHaveId;
573
578
  J(t);
574
579
  U(l);
575
580
  }
576
- }), [ V, H, r, v, Y, Z, ee, re ]);
581
+ }), [ V, X, r, v, Q, Z, ee, re ]);
577
582
  var te = (0, t.useMemo)((function() {
578
583
  return {
579
584
  labelAttrs: {
580
585
  text: y,
581
- id: G
586
+ id: B
582
587
  }
583
588
  };
584
- }), [ y, G ]);
589
+ }), [ y, B ]);
585
590
  var ne = typeof s === "string";
586
591
  var le = ne && s !== "";
587
592
  var oe = Number.isFinite(g) ? "".concat(g, "px") : g;
588
593
  var ie = m === "left" ? {
589
594
  width: oe
590
595
  } : undefined;
591
- var se = de(re, {
592
- childIds: H,
596
+ var ae = pe(re, {
597
+ childIds: X,
593
598
  controlsLayout: o,
594
599
  help: d,
595
- helpId: B,
600
+ helpId: G,
596
601
  error: s,
597
602
  errorId: $,
598
603
  label: y,
599
604
  labelFor: v,
600
- labelId: G,
605
+ labelId: B,
601
606
  required: _,
602
607
  showErrorText: le
603
- }), ue = se.childrenFormatted, fe = se.controlGroupDisabled;
608
+ }), ce = ae.childrenFormatted, de = ae.controlGroupDisabled;
604
609
  var ye = (0, t.useMemo)((function() {
605
- return v || ce(ue);
606
- }), [ ue, v ]);
607
- var ve = n().createElement(S, {
610
+ return v || ue(ce);
611
+ }), [ ce, v ]);
612
+ var ve = n().createElement(O, {
608
613
  style: ie,
609
614
  $labelPosition: m
610
- }, n().createElement(O, {
615
+ }, n().createElement(C, {
611
616
  $labelPosition: m
612
617
  }, n().createElement(I, {
613
618
  "data-test": "label",
614
- $disabled: fe,
615
- id: G,
619
+ $disabled: de,
620
+ id: B,
616
621
  htmlFor: ye
617
- }, _ && n().createElement(P, {
622
+ }, _ && n().createElement(k, {
618
623
  "aria-hidden": "true"
619
- }, "*"), y, !f && q && n().createElement(a(), null, q)), !f && q && n().createElement(C, {
624
+ }, "*"), y, !f && q && n().createElement(a(), null, q)), !f && q && n().createElement(x, {
620
625
  closeWhen: "notOnClick",
621
626
  content: q,
622
627
  defaultPlacement: D,
623
628
  "aria-hidden": "true"
624
629
  })));
625
630
 
626
- return n().createElement(w, X({
631
+ return n().createElement(S, R({
627
632
  "data-test": "control-group",
628
633
  "data-test-required": _,
629
634
  $labelPosition: m,
630
635
  "aria-invalid": !!s || undefined
631
636
  }, T), n().createElement(p.Provider, {
632
637
  value: te
633
- }, f ? n().createElement(a(), null, ve) : ve, n().createElement(x, {
638
+ }, f ? n().createElement(a(), null, ve) : ve, n().createElement(j, {
634
639
  $controlsLayout: o
635
- }, n().createElement(j, {
640
+ }, n().createElement(E, {
636
641
  $controlsLayout: o,
637
642
  "data-test": "controls",
638
643
  flex: o !== "none"
639
- }, ue), le && n().createElement(W, {
644
+ }, ce), le && n().createElement(F, {
640
645
  "data-test": "error",
641
646
  id: $
642
- }, s), d && n().createElement(E, {
647
+ }, s), d && n().createElement(P, {
643
648
  "data-test": "help",
644
- $disabled: fe,
645
- id: B
649
+ $disabled: de,
650
+ id: G
646
651
  }, d))));
647
652
  }
648
- fe.propTypes = ne;
649
- /* harmony default export */ const ye = fe;
653
+ ye.propTypes = le;
654
+ /* harmony default export */ const ve = ye;
650
655
  // CONCATENATED MODULE: ./src/ControlGroup/index.ts
651
656
  module.exports = r;
652
657
  /******/})();