@splunk/react-ui 5.7.1 → 5.9.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 (152) hide show
  1. package/Accordion.js +6 -6
  2. package/Anchor.js +2 -1
  3. package/Box.js +83 -34
  4. package/CHANGELOG.md +51 -0
  5. package/Calendar.js +134 -134
  6. package/Clickable.js +131 -94
  7. package/CollapsiblePanel.js +175 -137
  8. package/ComboBox.js +32 -27
  9. package/ControlGroup.js +92 -91
  10. package/DefinitionList.js +9 -9
  11. package/Drawer.d.ts +2 -0
  12. package/Drawer.js +679 -0
  13. package/Dropdown.js +27 -18
  14. package/DualListbox.js +1 -1
  15. package/File.js +35 -35
  16. package/JSONTree.js +73 -72
  17. package/Link.js +2 -2
  18. package/MIGRATION.md +10 -0
  19. package/Menu.js +403 -261
  20. package/Modal.js +263 -252
  21. package/Monogram.js +2 -2
  22. package/Multiselect.js +551 -385
  23. package/Number.js +2 -1
  24. package/Paginator.js +14 -12
  25. package/Popover.js +4 -1
  26. package/README.md +11 -0
  27. package/RadioBar.js +1 -1
  28. package/Search.js +111 -95
  29. package/Select.js +42 -40
  30. package/SelectBase.js +819 -715
  31. package/SidePanel.js +346 -167
  32. package/SlidingPanels.js +11 -11
  33. package/StepBar.js +7 -7
  34. package/Switch.js +5 -5
  35. package/Table.js +116 -119
  36. package/Text.js +48 -48
  37. package/TextArea.js +7 -7
  38. package/TransitionOpen.js +188 -169
  39. package/docs-llm/Accordion.md +267 -0
  40. package/docs-llm/Anchor Menu.md +115 -0
  41. package/docs-llm/Anchor.md +54 -0
  42. package/docs-llm/AnimationToggle.md +254 -0
  43. package/docs-llm/Avatar.md +292 -0
  44. package/docs-llm/Badge.md +212 -0
  45. package/docs-llm/Breadcrumbs.md +306 -0
  46. package/docs-llm/Button Group.md +53 -0
  47. package/docs-llm/Button.md +361 -0
  48. package/docs-llm/Card Layout.md +286 -0
  49. package/docs-llm/Card.md +619 -0
  50. package/docs-llm/Checkbox.md +218 -0
  51. package/docs-llm/Chip.md +291 -0
  52. package/docs-llm/Clickable.md +160 -0
  53. package/docs-llm/Code.md +292 -0
  54. package/docs-llm/Collapsible Panel.md +744 -0
  55. package/docs-llm/Color.md +253 -0
  56. package/docs-llm/Column Layout.md +391 -0
  57. package/docs-llm/Combo Box.md +540 -0
  58. package/docs-llm/Control Group.md +594 -0
  59. package/docs-llm/Date.md +270 -0
  60. package/docs-llm/Definition List.md +278 -0
  61. package/docs-llm/Divider.md +216 -0
  62. package/docs-llm/Drawer.md +414 -0
  63. package/docs-llm/Dropdown.md +472 -0
  64. package/docs-llm/Dual Listbox.md +325 -0
  65. package/docs-llm/File.md +653 -0
  66. package/docs-llm/Form Rows.md +374 -0
  67. package/docs-llm/Heading.md +179 -0
  68. package/docs-llm/Image.md +109 -0
  69. package/docs-llm/JSON Tree.md +260 -0
  70. package/docs-llm/Layer.md +74 -0
  71. package/docs-llm/Layout.md +50 -0
  72. package/docs-llm/Link.md +318 -0
  73. package/docs-llm/List.md +189 -0
  74. package/docs-llm/Markdown.md +179 -0
  75. package/docs-llm/Menu.md +735 -0
  76. package/docs-llm/Message Bar.md +236 -0
  77. package/docs-llm/Message.md +248 -0
  78. package/docs-llm/Modal.md +443 -0
  79. package/docs-llm/Monogram.md +159 -0
  80. package/docs-llm/Multiselect.md +939 -0
  81. package/docs-llm/Notifications.md +46 -0
  82. package/docs-llm/Number.md +298 -0
  83. package/docs-llm/Paginator.md +395 -0
  84. package/docs-llm/Paragraph.md +148 -0
  85. package/docs-llm/Phone Number.md +254 -0
  86. package/docs-llm/Popover.md +166 -0
  87. package/docs-llm/Progress.md +141 -0
  88. package/docs-llm/Radio Bar.md +303 -0
  89. package/docs-llm/Radio List.md +350 -0
  90. package/docs-llm/Resize.md +362 -0
  91. package/docs-llm/Screen Reader Content.md +73 -0
  92. package/docs-llm/Scroll Container Context.md +155 -0
  93. package/docs-llm/Scroll.md +152 -0
  94. package/docs-llm/Search.md +381 -0
  95. package/docs-llm/Select.md +985 -0
  96. package/docs-llm/Side Panel.md +777 -0
  97. package/docs-llm/Slider.md +339 -0
  98. package/docs-llm/Sliding Panels.md +340 -0
  99. package/docs-llm/Split Button.md +295 -0
  100. package/docs-llm/Static Content.md +90 -0
  101. package/docs-llm/Step Bar.md +292 -0
  102. package/docs-llm/Switch.md +268 -0
  103. package/docs-llm/Tab Bar.md +439 -0
  104. package/docs-llm/Tab Layout.md +398 -0
  105. package/docs-llm/Table.md +2642 -0
  106. package/docs-llm/Text Area.md +253 -0
  107. package/docs-llm/Text.md +339 -0
  108. package/docs-llm/Tooltip.md +325 -0
  109. package/docs-llm/Transition Open.md +406 -0
  110. package/docs-llm/Tree.md +591 -0
  111. package/docs-llm/Typography.md +125 -0
  112. package/docs-llm/Wait Spinner.md +121 -0
  113. package/docs-llm/llms.txt +101 -0
  114. package/package.json +6 -5
  115. package/types/src/Box/Box.d.ts +2 -10
  116. package/types/src/Drawer/Body.d.ts +17 -0
  117. package/types/src/Drawer/Drawer.d.ts +114 -0
  118. package/types/src/Drawer/DrawerContext.d.ts +11 -0
  119. package/types/src/Drawer/Footer.d.ts +25 -0
  120. package/types/src/Drawer/Header.d.ts +41 -0
  121. package/types/src/Drawer/docs/examples/Basic.d.ts +6 -0
  122. package/types/src/Drawer/docs/examples/ContainerPosition.d.ts +7 -0
  123. package/types/src/Drawer/docs/examples/InitialFocus.d.ts +9 -0
  124. package/types/src/Drawer/docs/examples/InlinePosition.d.ts +7 -0
  125. package/types/src/Drawer/docs/examples/PagePosition.d.ts +7 -0
  126. package/types/src/Drawer/index.d.ts +2 -0
  127. package/types/src/JSONTree/JSONTree.d.ts +12 -5
  128. package/types/src/JSONTree/renderTreeItems.d.ts +2 -1
  129. package/types/src/Menu/Item.d.ts +2 -1
  130. package/types/src/Menu/docs/examples/SelectableCheckbox.d.ts +7 -0
  131. package/types/src/Modal/Modal.d.ts +1 -2
  132. package/types/src/Multiselect/Compact.d.ts +8 -3
  133. package/types/src/Multiselect/Multiselect.d.ts +8 -3
  134. package/types/src/Multiselect/Normal.d.ts +8 -3
  135. package/types/src/Multiselect/Option.d.ts +6 -3
  136. package/types/src/Multiselect/docs/examples/Disabled.d.ts +1 -0
  137. package/types/src/Select/Option.d.ts +6 -3
  138. package/types/src/Select/Select.d.ts +8 -5
  139. package/types/src/Select/docs/examples/Dimmed.d.ts +7 -0
  140. package/types/src/SelectBase/OptionBase.d.ts +6 -3
  141. package/types/src/SelectBase/SelectBase.d.ts +8 -3
  142. package/types/src/SidePanel/SidePanel.d.ts +43 -2
  143. package/types/src/SidePanel/docs/examples/DockLayout.d.ts +17 -0
  144. package/types/src/SidePanel/docs/examples/InitialFocus.d.ts +9 -0
  145. package/types/src/TransitionOpen/TransitionOpen.d.ts +29 -4
  146. package/types/src/useKeyPress/index.d.ts +9 -2
  147. package/types/src/useOnClickOutside/index.d.ts +2 -0
  148. package/types/src/useOnClickOutside/useOnClickOutside.d.ts +4 -0
  149. package/useKeyPress.js +23 -18
  150. package/useOnClickOutside.d.ts +2 -0
  151. package/useOnClickOutside.js +79 -0
  152. package/types/src/RadioList/docs/examples/Row.d.ts +0 -6
package/ComboBox.js CHANGED
@@ -128,8 +128,8 @@
128
128
  }
129
129
  }
130
130
  // CONCATENATED MODULE: ./src/ComboBox/Option.tsx
131
- function q() {
132
- return q = Object.assign ? Object.assign.bind() : function(e) {
131
+ function E() {
132
+ return E = Object.assign ? Object.assign.bind() : function(e) {
133
133
  for (var n = 1; n < arguments.length; n++) {
134
134
  var r = arguments[n];
135
135
  for (var t in r) {
@@ -137,9 +137,9 @@
137
137
  }
138
138
  }
139
139
  return e;
140
- }, q.apply(null, arguments);
140
+ }, E.apply(null, arguments);
141
141
  }
142
- function E(e, n) {
142
+ function q(e, n) {
143
143
  if (null == e) return {};
144
144
  var r, t, o = x(e, n);
145
145
  if (Object.getOwnPropertySymbols) {
@@ -182,7 +182,7 @@
182
182
  /**
183
183
  * An option within a `ComboBox`.
184
184
  */ function D(e) {
185
- var n = e.active, o = e.description, a = e.descriptionPosition, i = a === void 0 ? "bottom" : a, l = e.disabled, u = e.elementRef, c = e.icon, s = e.label, f = e.matchRanges, p = e.onClick, v = e.truncate, b = e.value, m = E(e, [ "active", "description", "descriptionPosition", "disabled", "elementRef", "icon", "label", "matchRanges", "onClick", "truncate", "value" ]);
185
+ var n = e.active, o = e.description, a = e.descriptionPosition, i = a === void 0 ? "bottom" : a, l = e.disabled, u = e.elementRef, c = e.icon, s = e.label, f = e.matchRanges, p = e.onClick, v = e.truncate, b = e.value, m = q(e, [ "active", "description", "descriptionPosition", "disabled", "elementRef", "icon", "label", "matchRanges", "onClick", "truncate", "value" ]);
186
186
  // @docs-props-type OptionPropsBase
187
187
  var y = (0, r.useCallback)((function(e) {
188
188
  if (!l) {
@@ -196,7 +196,7 @@
196
196
  }), [ u ]);
197
197
  var h = s === undefined ? b : s;
198
198
 
199
- return t().createElement(d.Item, q({
199
+ return t().createElement(d.Item, E({
200
200
  active: n,
201
201
  "data-test": "option",
202
202
  "data-test-value": b,
@@ -403,7 +403,7 @@
403
403
  * `ComboBox` allows the user to select a predefined string or enter a new value. Unlike `Select`
404
404
  * and `Multiselect`, `Option` value must always be a string.
405
405
  */ function ne(e) {
406
- var n = e.animateLoading, o = e.append, a = e.children, i = e.controlledFilter, l = e.defaultPlacement, u = l === void 0 ? "vertical" : l, s = e.defaultValue, f = e.describedBy, d = e.disabled, p = e.elementRef, y = e.error, h = e.footerMessage, S = e.inline, q = e.inputId, E = e.inputRef, x = e.isLoadingOptions, B = e.labelledBy, D = e.loadingMessage, I = e.menuStyle, L = I === void 0 ? Z : I, V = e.name, z = e.noOptionsMessage, F = e.onBlur, _ = e.onChange, N = e.onClose, W = e.onFocus, U = e.onKeyDown, X = e.onOpen, $ = e.onScroll, G = e.onScrollBottom, ne = e.onSelect, re = e.placeholder, te = re === void 0 ? ee : re, oe = e.prepend, ae = e.value, ie = e.virtualization, le = Y(e, [ "animateLoading", "append", "children", "controlledFilter", "defaultPlacement", "defaultValue", "describedBy", "disabled", "elementRef", "error", "footerMessage", "inline", "inputId", "inputRef", "isLoadingOptions", "labelledBy", "loadingMessage", "menuStyle", "name", "noOptionsMessage", "onBlur", "onChange", "onClose", "onFocus", "onKeyDown", "onOpen", "onScroll", "onScrollBottom", "onSelect", "placeholder", "prepend", "value", "virtualization" ]);
406
+ var n = e.animateLoading, o = e.append, a = e.children, i = e.controlledFilter, l = e.defaultPlacement, u = l === void 0 ? "vertical" : l, s = e.defaultValue, f = e.describedBy, d = e.disabled, p = e.elementRef, y = e.error, h = e.footerMessage, S = e.inline, E = e.inputId, q = e.inputRef, x = e.isLoadingOptions, B = e.labelledBy, D = e.loadingMessage, I = e.menuStyle, L = I === void 0 ? Z : I, V = e.name, z = e.noOptionsMessage, F = e.onBlur, _ = e.onChange, N = e.onClose, W = e.onFocus, U = e.onKeyDown, X = e.onOpen, $ = e.onScroll, G = e.onScrollBottom, ne = e.onSelect, re = e.placeholder, te = re === void 0 ? ee : re, oe = e.prepend, ae = e.value, ie = e.virtualization, le = Y(e, [ "animateLoading", "append", "children", "controlledFilter", "defaultPlacement", "defaultValue", "describedBy", "disabled", "elementRef", "error", "footerMessage", "inline", "inputId", "inputRef", "isLoadingOptions", "labelledBy", "loadingMessage", "menuStyle", "name", "noOptionsMessage", "onBlur", "onChange", "onClose", "onFocus", "onKeyDown", "onOpen", "onScroll", "onScrollBottom", "onSelect", "placeholder", "prepend", "value", "virtualization" ]);
407
407
  // @docs-props-type ComboBoxPropsBase
408
408
  var ue = O()({
409
409
  componentName: "ComboBox",
@@ -415,7 +415,7 @@
415
415
  var ye = (0, r.useState)(false), ge = K(ye, 2), he = ge[0], Oe = ge[1];
416
416
  var Se = (0, r.useState)(null), ke = K(Se, 2), Ce = ke[0], we = ke[1];
417
417
  var Pe = (0, r.useState)(), je = K(Pe, 2), Re = je[0], Me = je[1];
418
- var qe = (0, r.useState)(s || ""), Ee = K(qe, 2), xe = Ee[0], Be = Ee[1];
418
+ var Ee = (0, r.useState)(s || ""), qe = K(Ee, 2), xe = qe[0], Be = qe[1];
419
419
  var De = k()(fe);
420
420
  var Ae = (0, r.useRef)();
421
421
  var Ie = (0, r.useRef)(0);
@@ -450,8 +450,8 @@
450
450
  }), [ a, Fe, Re ]);
451
451
  var _e = (0, r.useCallback)((function(e) {
452
452
  we(e);
453
- M(E, e);
454
- }), [ E ]);
453
+ M(q, e);
454
+ }), [ q ]);
455
455
  var Ne = (0, r.useCallback)((function(e) {
456
456
  me(e);
457
457
  M(p, e);
@@ -544,29 +544,30 @@
544
544
  // ignore non-Option items such as Headings and Dividers
545
545
  return n;
546
546
  }
547
- var a = Ie.current === fe;
547
+ var a = n.props.label !== undefined ? n.props.label : n.props.value;
548
+ var l = n.props.matchRanges;
549
+ var c = !i && e && (o || t > 0) ? (0, C.keywordLocations)(a, u) || undefined : undefined;
550
+ var s = {
551
+ onClick: Ye,
552
+ matchRanges: l || c
553
+ };
554
+ if (n.props.disabled) {
555
+
556
+ return (0, r.cloneElement)(n, s);
557
+ }
558
+ var f = Ie.current === fe;
548
559
  Ie.current += 1;
549
- var l = n.props.label !== undefined ? n.props.label : n.props.value;
550
- var c = n.props.matchRanges;
551
- var s = !i && e && (o || t > 0) ? (0, C.keywordLocations)(l, u) || undefined : undefined;
552
- if (a) {
553
- if (!n.props.disabled) {
554
- Ae.current = n.props.value;
555
- }
560
+ if (f) {
561
+ Ae.current = n.props.value;
556
562
 
557
- return (0, r.cloneElement)(n, {
563
+ return (0, r.cloneElement)(n, H(H({}, s), {}, {
558
564
  elementRef: We,
559
565
  id: He,
560
- onClick: Ye,
561
- matchRanges: c || s,
562
566
  active: true
563
- });
567
+ }));
564
568
  }
565
569
 
566
- return (0, r.cloneElement)(n, {
567
- onClick: Ye,
568
- matchRanges: c || s
569
- });
570
+ return (0, r.cloneElement)(n, s);
570
571
  }));
571
572
  }), [ fe, He, a, i, Ke, Fe, We, Ye, Re ]);
572
573
  var Ze = (0, r.useCallback)((function(e) {
@@ -577,6 +578,7 @@
577
578
  switch (o) {
578
579
  case "Enter":
579
580
  {
581
+ e.preventDefault();
580
582
  if (t) {
581
583
  Ye(e, {
582
584
  value: t
@@ -590,6 +592,9 @@
590
592
  break;
591
593
 
592
594
  case "ArrowDown":
595
+ if (n <= 0) {
596
+ break;
597
+ }
593
598
  de((function(e) {
594
599
  return Math.min(e + 1, n - 1);
595
600
  }));
@@ -666,7 +671,7 @@
666
671
  elementRef: Ne,
667
672
  error: y,
668
673
  inline: S,
669
- inputId: q,
674
+ inputId: E,
670
675
  inputRef: _e,
671
676
  labelledBy: B,
672
677
  name: V,
package/ControlGroup.js CHANGED
@@ -69,10 +69,10 @@
69
69
  var n = e.n(t);
70
70
  // CONCATENATED MODULE: external "prop-types"
71
71
  const o = require("prop-types");
72
- var l = e.n(o);
72
+ var i = e.n(o);
73
73
  // CONCATENATED MODULE: external "@splunk/react-ui/ScreenReaderContent"
74
- const i = require("@splunk/react-ui/ScreenReaderContent");
75
- var a = e.n(i);
74
+ const l = require("@splunk/react-ui/ScreenReaderContent");
75
+ var a = e.n(l);
76
76
  // CONCATENATED MODULE: external "@splunk/react-ui/usePrevious"
77
77
  const s = require("@splunk/react-ui/usePrevious");
78
78
  var c = e.n(s);
@@ -110,7 +110,7 @@
110
110
  })([ "", ";word-wrap:break-word;" ], g.mixins.typography("body", {
111
111
  color: "active"
112
112
  }));
113
- var I = y()(b()).withConfig({
113
+ var x = y()(b()).withConfig({
114
114
  displayName: "ControlGroupStyles__StyledBox",
115
115
  componentId: "wjnyif-2"
116
116
  })([ "", " max-width:600px;margin-block-end:", ";&:last-child{margin-block-end:0;}", " ", "" ], g.mixins.reset("flex"), g.variables.spacingLarge, (function(e) {
@@ -122,7 +122,7 @@
122
122
  return r && (0, f.css)([ "", "{color:", ";}", "{color:", ";}" ], /* sc-sel */ S, g.variables.contentColorDisabled, /* sc-sel */ O, g.variables.contentColorDisabled);
123
123
  }));
124
124
  // Aligns label to the top for case where labelPosition="left" and StyledControlsAndMessagingWrapper is taller than label.
125
- var x = y().div.withConfig({
125
+ var I = y().div.withConfig({
126
126
  displayName: "ControlGroupStyles__StyledLabelWrapper",
127
127
  componentId: "wjnyif-3"
128
128
  })([ "display:inline-flex;align-items:flex-start;gap:", ";flex-shrink:0;" ], g.variables.spacingXSmall);
@@ -154,7 +154,8 @@
154
154
  var P = y()(b()).withConfig({
155
155
  displayName: "ControlGroupStyles__StyledControlsWrapper",
156
156
  componentId: "wjnyif-7"
157
- })([ "gap:", ";", "" ], g.variables.spacingMedium, (0, g.pickVariant)("$controlsLayout", {
157
+ })([ "position:relative;z-index:1;gap:", ";", "" ], g.variables.spacingMedium, (0,
158
+ g.pickVariant)("$controlsLayout", {
158
159
  fillJoin: (0, f.css)([ "gap:0;" ]),
159
160
  stack: (0, f.css)([ "flex-direction:column;" ])
160
161
  }));
@@ -189,9 +190,9 @@
189
190
  if (null == e) return {};
190
191
  var t, n, o = G(e, r);
191
192
  if (Object.getOwnPropertySymbols) {
192
- var l = Object.getOwnPropertySymbols(e);
193
- for (n = 0; n < l.length; n++) {
194
- t = l[n], -1 === r.indexOf(t) && {}.propertyIsEnumerable.call(e, t) && (o[t] = e[t]);
193
+ var i = Object.getOwnPropertySymbols(e);
194
+ for (n = 0; n < i.length; n++) {
195
+ t = i[n], -1 === r.indexOf(t) && {}.propertyIsEnumerable.call(e, t) && (o[t] = e[t]);
195
196
  }
196
197
  }
197
198
  return o;
@@ -209,7 +210,7 @@
209
210
  }
210
211
  var A = (0, _._)("Error: ");
211
212
  var $ = {
212
- children: l().node.isRequired
213
+ children: i().node.isRequired
213
214
  };
214
215
  function W(e) {
215
216
  var r = e.children, t = B(e, [ "children" ]);
@@ -241,18 +242,18 @@
241
242
  return e;
242
243
  }, X.apply(null, arguments);
243
244
  }
244
- function H(e, r) {
245
+ function z(e, r) {
245
246
  if (null == e) return {};
246
- var t, n, o = J(e, r);
247
+ var t, n, o = H(e, r);
247
248
  if (Object.getOwnPropertySymbols) {
248
- var l = Object.getOwnPropertySymbols(e);
249
- for (n = 0; n < l.length; n++) {
250
- t = l[n], -1 === r.indexOf(t) && {}.propertyIsEnumerable.call(e, t) && (o[t] = e[t]);
249
+ var i = Object.getOwnPropertySymbols(e);
250
+ for (n = 0; n < i.length; n++) {
251
+ t = i[n], -1 === r.indexOf(t) && {}.propertyIsEnumerable.call(e, t) && (o[t] = e[t]);
251
252
  }
252
253
  }
253
254
  return o;
254
255
  }
255
- function J(e, r) {
256
+ function H(e, r) {
256
257
  if (null == e) return {};
257
258
  var t = {};
258
259
  for (var n in e) {
@@ -263,7 +264,7 @@
263
264
  }
264
265
  return t;
265
266
  }
266
- function V(e, r) {
267
+ function J(e, r) {
267
268
  var t = Object.keys(e);
268
269
  if (Object.getOwnPropertySymbols) {
269
270
  var n = Object.getOwnPropertySymbols(e);
@@ -273,12 +274,12 @@
273
274
  }
274
275
  return t;
275
276
  }
276
- function z(e) {
277
+ function V(e) {
277
278
  for (var r = 1; r < arguments.length; r++) {
278
279
  var t = null != arguments[r] ? arguments[r] : {};
279
- r % 2 ? V(Object(t), !0).forEach((function(r) {
280
+ r % 2 ? J(Object(t), !0).forEach((function(r) {
280
281
  K(e, r, t[r]);
281
- })) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : V(Object(t)).forEach((function(r) {
282
+ })) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : J(Object(t)).forEach((function(r) {
282
283
  Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
283
284
  }));
284
285
  }
@@ -329,18 +330,18 @@
329
330
  function te(e, r) {
330
331
  var t = null == e ? null : "undefined" != typeof Symbol && e[Symbol.iterator] || e["@@iterator"];
331
332
  if (null != t) {
332
- var n, o, l, i, a = [], s = !0, c = !1;
333
+ var n, o, i, l, a = [], s = !0, c = !1;
333
334
  try {
334
- if (l = (t = t.call(e)).next, 0 === r) {
335
+ if (i = (t = t.call(e)).next, 0 === r) {
335
336
  if (Object(t) !== t) return;
336
337
  s = !1;
337
- } else for (;!(s = (n = l.call(t)).done) && (a.push(n.value), a.length !== r); s = !0) {
338
+ } else for (;!(s = (n = i.call(t)).done) && (a.push(n.value), a.length !== r); s = !0) {
338
339
  }
339
340
  } catch (e) {
340
341
  c = !0, o = e;
341
342
  } finally {
342
343
  try {
343
- if (!s && null != t["return"] && (i = t["return"](), Object(i) !== i)) return;
344
+ if (!s && null != t["return"] && (l = t["return"](), Object(l) !== l)) return;
344
345
  } finally {
345
346
  if (c) throw o;
346
347
  }
@@ -354,25 +355,25 @@
354
355
  // props ControlGroup passes to configure its children's props
355
356
  // props ControlGroup may access and/or override on children
356
357
  var oe = {
357
- children: l().node,
358
- controlsLayout: l().oneOf([ "fill", "fillJoin", "none", "stack" ]),
359
- elementRef: l().oneOfType([ l().func, l().object ]),
360
- error: l().oneOfType([ l().bool, l().string ]),
361
- help: l().node,
362
- hideLabel: l().bool,
363
- label: l().string.isRequired,
364
- labelFor: l().string,
365
- labelPosition: l().oneOf([ "left", "top" ]),
366
- labelWidth: l().oneOfType([ l().number, l().string ]),
367
- required: l().bool,
368
- tooltip: l().node,
369
- tooltipDefaultPlacement: l().oneOf([ "above", "below", "left", "right" ])
358
+ children: i().node,
359
+ controlsLayout: i().oneOf([ "fill", "fillJoin", "none", "stack" ]),
360
+ elementRef: i().oneOfType([ i().func, i().object ]),
361
+ error: i().oneOfType([ i().bool, i().string ]),
362
+ help: i().node,
363
+ hideLabel: i().bool,
364
+ label: i().string.isRequired,
365
+ labelFor: i().string,
366
+ labelPosition: i().oneOf([ "left", "top" ]),
367
+ labelWidth: i().oneOfType([ i().number, i().string ]),
368
+ required: i().bool,
369
+ tooltip: i().node,
370
+ tooltipDefaultPlacement: i().oneOf([ "above", "below", "left", "right" ])
370
371
  };
371
372
  // Style cloned onto child elements when fill behavior set.
372
- var le = {
373
+ var ie = {
373
374
  flexGrow: 1
374
375
  };
375
- function ie(e) {
376
+ function le(e) {
376
377
  return e.type && e.type.propTypes && Object.prototype.hasOwnProperty.call(e.type.propTypes, "inputId");
377
378
  }
378
379
  function ae(e, r) {
@@ -388,9 +389,9 @@
388
389
  var t = e.length;
389
390
  var n = 0;
390
391
  e.forEach((function(e, t) {
391
- if (ie(e) && e.props.inputId == null) {
392
- var o = ae("input-id", t), l = o.childKey, i = o.value;
393
- r[l] = i;
392
+ if (le(e) && e.props.inputId == null) {
393
+ var o = ae("input-id", t), i = o.childKey, l = o.value;
394
+ r[i] = l;
394
395
  } else if (e.props.id == null) {
395
396
  var a = ae("id", t), s = a.childKey, c = a.value;
396
397
  r[s] = c;
@@ -422,80 +423,80 @@
422
423
  var n = e.find((function(e) {
423
424
  return e.type && e.type.componentType === "Text";
424
425
  }));
425
- var o = ie(t);
426
- var l = t.props, i = l.id, a = l.inputId;
426
+ var o = le(t);
427
+ var i = t.props, l = i.id, a = i.inputId;
427
428
  // see function doc block for details
428
429
  if (e.length === 1 && (t === null || t === void 0 ? void 0 : t.props)) {
429
- return o ? a : i;
430
+ return o ? a : l;
430
431
  }
431
432
  if (n === null || n === void 0 ? void 0 : n.props) {
432
433
  return n.props.inputId;
433
434
  }
434
435
  if (t.props) {
435
- return o ? a : i;
436
+ return o ? a : l;
436
437
  }
437
438
  return undefined;
438
439
  }
439
440
  // Configure the Children
440
441
  function de(e, r, o) {
441
- var l = e.props, i = l.disabled, a = l.error, s = l.id, c = l.inputId, u = l.style, d = l.children;
442
- var p = o.childIds, f = o.controlsLayout, y = o.help, v = o.helpId, b = o.error, m = o.errorId, h = o.label, g = o.labelFor, w = o.labelId, O = o.numChildren, S = o.required, I = o.showErrorText;
443
- var x = {
442
+ var i = e.props, l = i.disabled, a = i.error, s = i.id, c = i.inputId, u = i.style, d = i.children;
443
+ var p = o.childIds, f = o.controlsLayout, y = o.help, v = o.helpId, b = o.error, m = o.errorId, h = o.label, g = o.labelFor, w = o.labelId, O = o.numChildren, S = o.required, x = o.showErrorText;
444
+ var I = {
444
445
  key: e.key || r,
445
446
  labelledBy: w
446
447
  };
447
448
  if (f === "fillJoin") {
448
449
  if (r > 0) {
449
- x.prepend = true;
450
+ I.prepend = true;
450
451
  }
451
452
  if (r < O - 1) {
452
- x.append = true;
453
+ I.append = true;
453
454
  }
454
- if (x.prepend || x.append) {
455
- x.inline = false;
455
+ if (I.prepend || I.append) {
456
+ I.inline = false;
456
457
  }
457
458
  }
458
459
  if (f === "fill" && O > 1) {
459
- x.inline = true;
460
+ I.inline = true;
460
461
  }
461
462
  if (f === "stack") {
462
- x.inline = false;
463
+ I.inline = false;
463
464
  }
464
465
  if (y && typeof b === "boolean") {
465
- x.describedBy = v;
466
+ I.describedBy = v;
466
467
  } else if (y && typeof b === "string") {
467
- x.describedBy = "".concat(v, " ").concat(m);
468
+ I.describedBy = "".concat(v, " ").concat(m);
468
469
  } else if (!y && typeof b === "string") {
469
- x.describedBy = m;
470
+ I.describedBy = m;
470
471
  }
471
472
  if (S) {
472
- x.required = true;
473
+ I.required = true;
473
474
  }
474
475
  // TODO: SUI-3402 refactor so that parent component doesn't have to know what it's child components are
475
476
  if (e.type.componentType === "Multiselect") {
476
477
  var C = e;
477
478
  if (!C.props.compact) {
478
- x.labelText = h;
479
+ I.labelText = h;
479
480
  }
480
481
  } else {
481
- x.labelText = h;
482
+ I.labelText = h;
482
483
  }
483
484
  if (O === 1 && (f === "fillJoin" || f === "fill")) {
484
485
  // Some controls like Select do not grow by default, so flexGrow is applied
485
486
  // The spread operator is used as css styles are not nested, so there is no need for a deep copy.
486
- x.style = u ? z(z({}, u), le) : le;
487
+ I.style = u ? V(V({}, u), ie) : ie;
487
488
  }
488
489
  if (!g && e) {
489
- if (ie(e)) {
490
- x.inputId = c || ce("input-id", r, p);
490
+ if (le(e)) {
491
+ I.inputId = c || ce("input-id", r, p);
491
492
  } else {
492
- x.id = s || ce("id", r, p);
493
+ I.id = s || ce("id", r, p);
493
494
  }
494
495
  }
495
- if (I && a === true) {
496
- x["aria-errormessage"] = m;
496
+ if (x && a === true) {
497
+ I["aria-errormessage"] = m;
497
498
  }
498
- var j = i !== null && i !== void 0 ? i : false;
499
+ var j = l !== null && l !== void 0 ? l : false;
499
500
  // RadioBar and RadioList need special handling in the case where the parent grouping component is not set to disabled
500
501
  // but all of the children are disabled.
501
502
  var E = e.type.componentType === "RadioBar" || e.type.componentType === "RadioList";
@@ -507,25 +508,25 @@
507
508
  }));
508
509
  }
509
510
  return {
510
- child: (0, t.cloneElement)(e, x),
511
+ child: (0, t.cloneElement)(e, I),
511
512
  childDisabled: j
512
513
  };
513
514
  }
514
515
  function pe(e, r) {
515
516
  var t = e.length;
516
517
  var n = 0;
517
- var o = z({
518
+ var o = V({
518
519
  numChildren: t
519
520
  }, r);
520
- var l = e.map((function(e, r) {
521
- var t = de(e, r, o), l = t.child, i = t.childDisabled;
522
- if (i === true) {
521
+ var i = e.map((function(e, r) {
522
+ var t = de(e, r, o), i = t.child, l = t.childDisabled;
523
+ if (l === true) {
523
524
  n += 1;
524
525
  }
525
- return l;
526
+ return i;
526
527
  }));
527
528
  return {
528
- childrenFormatted: l,
529
+ childrenFormatted: i,
529
530
  controlGroupDisabled: n === t
530
531
  };
531
532
  }
@@ -548,7 +549,7 @@
548
549
  * attribute. If `inputId` is supported but not set a generated id is used instead. If `inputId` isn't
549
550
  * supported `id` is used. The `labelFor` prop may be used to override the `for` attribute.
550
551
  */ function ye(e) {
551
- var r = e.children, o = e.controlsLayout, l = o === void 0 ? "fill" : o, 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" ]);
552
+ var r = e.children, o = e.controlsLayout, i = o === void 0 ? "fill" : o, l = e.error, s = l === void 0 ? false : l, 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 = z(e, [ "children", "controlsLayout", "error", "help", "hideLabel", "label", "labelFor", "labelPosition", "labelWidth", "required", "tooltip", "tooltipDefaultPlacement" ]);
552
553
  // @docs-props-type ControlGroupPropsBase
553
554
  var M = (0, t.useState)((function() {
554
555
  return {
@@ -558,11 +559,11 @@
558
559
  };
559
560
  })), L = Y(M, 1), N = L[0], B = N.errorId, G = N.helpId, A = N.labelId;
560
561
  /** Child ids need to be the same on each render because of SUI-2817 */ var $ = (0,
561
- t.useState)({}), W = Y($, 2), R = W[0], J = W[1];
562
- var V = (0, t.useState)(false), z = Y(V, 2), K = z[0], U = z[1];
562
+ t.useState)({}), W = Y($, 2), R = W[0], H = W[1];
563
+ var J = (0, t.useState)(false), V = Y(J, 2), K = V[0], U = V[1];
563
564
  var Q = c()(n().Children.count(r));
564
565
  var Z = (0, t.useCallback)((function(e) {
565
- J(e);
566
+ H(e);
566
567
  }), []);
567
568
  var ee = (0, t.useCallback)((function(e) {
568
569
  U(e);
@@ -579,12 +580,12 @@
579
580
  (0, t.useEffect)((function() {
580
581
  // If it's not the first render and the number of child elements has changed, reset childIds
581
582
  if (Q != null && n().Children.count(r) !== Q) {
582
- J({});
583
+ H({});
583
584
  }
584
585
  // 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.
585
586
  if (Object.keys(R).length === 0 && !v && !K) {
586
587
  var e = se(re), t = e.newChildIds, o = e.allChildrenHaveId;
587
- J(t);
588
+ H(t);
588
589
  U(o);
589
590
  }
590
591
  }), [ K, R, r, v, Q, Z, ee, re ]);
@@ -598,13 +599,13 @@
598
599
  }), [ y, A ]);
599
600
  var ne = typeof s === "string";
600
601
  var oe = ne && s !== "";
601
- var le = Number.isFinite(g) ? "".concat(g, "px") : g;
602
- var ie = m === "left" ? {
603
- width: le
602
+ var ie = Number.isFinite(g) ? "".concat(g, "px") : g;
603
+ var le = m === "left" ? {
604
+ width: ie
604
605
  } : undefined;
605
606
  var ae = pe(re, {
606
607
  childIds: R,
607
- controlsLayout: l,
608
+ controlsLayout: i,
608
609
  help: d,
609
610
  helpId: G,
610
611
  error: s,
@@ -618,8 +619,8 @@
618
619
  var ye = (0, t.useMemo)((function() {
619
620
  return v || ue(ce);
620
621
  }), [ ce, v ]);
621
- var ve = n().createElement(x, {
622
- style: ie,
622
+ var ve = n().createElement(I, {
623
+ style: le,
623
624
  $labelPosition: m
624
625
  }, n().createElement(C, {
625
626
  $labelPosition: m
@@ -636,7 +637,7 @@
636
637
  "aria-hidden": "true"
637
638
  })));
638
639
 
639
- return n().createElement(I, X({
640
+ return n().createElement(x, X({
640
641
  "data-test": "control-group",
641
642
  "data-test-required": _,
642
643
  "data-test-children-disabled": de,
@@ -646,11 +647,11 @@
646
647
  }, D), n().createElement(p.Provider, {
647
648
  value: te
648
649
  }, f ? n().createElement(a(), null, ve) : ve, n().createElement(E, {
649
- $controlsLayout: l
650
+ $controlsLayout: i
650
651
  }, n().createElement(P, {
651
- $controlsLayout: l,
652
+ $controlsLayout: i,
652
653
  "data-test": "controls",
653
- flex: l !== "none"
654
+ flex: i !== "none"
654
655
  }, ce), oe && n().createElement(F, {
655
656
  "data-test": "error",
656
657
  id: B
package/DefinitionList.js CHANGED
@@ -83,7 +83,7 @@
83
83
  // CONCATENATED MODULE: external "@splunk/themes"
84
84
  const d = require("@splunk/themes");
85
85
  // CONCATENATED MODULE: ./src/DefinitionList/DefinitionListStyles.ts
86
- var p = c().dt.withConfig({
86
+ var f = c().dt.withConfig({
87
87
  displayName: "DefinitionListStyles__StyledTerm",
88
88
  componentId: "sc-1pqfrgm-0"
89
89
  })([ "", "" ], (function(e) {
@@ -100,7 +100,7 @@
100
100
  }), d.variables.spacingLarge)
101
101
  });
102
102
  }));
103
- var f = c().dd.withConfig({
103
+ var p = c().dd.withConfig({
104
104
  displayName: "DefinitionListStyles__StyledDescription",
105
105
  componentId: "sc-1pqfrgm-1"
106
106
  })([ "", "" ], (function(e) {
@@ -122,8 +122,8 @@
122
122
  componentId: "sc-1pqfrgm-2"
123
123
  })([ "", "" ], (0, d.pickVariant)("$layout", {
124
124
  fixed: (0, l.css)([ "", ";", ";" ], d.mixins.reset("block"), d.mixins.typography("body")),
125
- auto: (0, l.css)([ "", ";grid-template-columns:[term] fit-content(", ") [description] fit-content(", ");column-gap:", ";row-gap:", ";" ], d.mixins.reset("grid"), d.variables.lineLength, d.variables.lineLength, d.variables.spacingXLarge, d.variables.spacingMedium),
126
- stacked: (0, l.css)([ "", ";grid-template-columns:[definitionList] fit-content(", ");row-gap:", ";" ], d.mixins.reset("grid"), d.variables.lineLength, d.variables.spacingXSmall)
125
+ auto: (0, l.css)([ "", ";grid-template-columns:[term] fit-content(", ") [description] fit-content(", ");column-gap:", ";" ], d.mixins.reset("grid"), d.variables.lineLength, d.variables.lineLength, d.variables.spacingSmall),
126
+ stacked: (0, l.css)([ "", ";grid-template-columns:[definitionList] fit-content(", ");" ], d.mixins.reset("grid"), d.variables.lineLength)
127
127
  }));
128
128
  // CONCATENATED MODULE: ./src/DefinitionList/Description.tsx
129
129
  function m() {
@@ -170,7 +170,7 @@
170
170
  // @docs-props-type DescriptionPropsBase
171
171
  var o = (0, t.useContext)(s), l = o.descriptionWidth, c = o.layout, d = o.termWidth;
172
172
 
173
- return n().createElement(f, m({
173
+ return n().createElement(p, m({
174
174
  "data-test": "description",
175
175
  ref: i,
176
176
  $descriptionWidth: l,
@@ -225,7 +225,7 @@
225
225
  // @docs-props-type TermPropsBase
226
226
  var o = (0, t.useContext)(s), l = o.layout, c = o.separatorCharacter, d = o.termWidth;
227
227
 
228
- return n().createElement(p, w({
228
+ return n().createElement(f, w({
229
229
  "data-test": "term",
230
230
  ref: i,
231
231
  $layout: l,
@@ -279,7 +279,7 @@
279
279
  };
280
280
  var L = "120px";
281
281
  function R(e) {
282
- var r = e.children, i = e.descriptionWidth, a = e.elementRef, o = e.layout, l = o === void 0 ? "fixed" : o, c = e.separatorCharacter, d = e.termWidth, p = d === void 0 ? L : d, f = W(e, [ "children", "descriptionWidth", "elementRef", "layout", "separatorCharacter", "termWidth" ]);
282
+ var r = e.children, i = e.descriptionWidth, a = e.elementRef, o = e.layout, l = o === void 0 ? "fixed" : o, c = e.separatorCharacter, d = e.termWidth, f = d === void 0 ? L : d, p = W(e, [ "children", "descriptionWidth", "elementRef", "layout", "separatorCharacter", "termWidth" ]);
283
283
  // @docs-props-type DefinitionListPropsBase
284
284
  /* eslint-disable-next-line prefer-rest-params */ var m = arguments[0];
285
285
  (0, t.useEffect)((function() {
@@ -292,7 +292,7 @@
292
292
  y = undefined;
293
293
  h = undefined;
294
294
  } else {
295
- y = l !== "fixed" && p === L ? undefined : p;
295
+ y = l !== "fixed" && f === L ? undefined : f;
296
296
  h = i;
297
297
  }
298
298
  var g = (0, t.useMemo)((function() {
@@ -308,7 +308,7 @@
308
308
  "data-test": "definition-list",
309
309
  ref: a,
310
310
  $layout: l
311
- }, f), n().createElement(s.Provider, {
311
+ }, p), n().createElement(s.Provider, {
312
312
  value: g
313
313
  }, r));
314
314
  }
package/Drawer.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ export { default } from './types/src/Drawer';
2
+ export * from './types/src/Drawer';