@splunk/react-ui 5.0.0-beta.3 → 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 (181) hide show
  1. package/Accordion.js +185 -243
  2. package/Animation.js +2 -2
  3. package/Button.js +4 -2
  4. package/ButtonSimple.js +47 -41
  5. package/CHANGELOG.md +15 -2
  6. package/CHANGELOG.v5.mdx +73 -0
  7. package/Calendar.js +352 -469
  8. package/Card.js +163 -162
  9. package/Chip.js +171 -356
  10. package/Clickable.js +79 -76
  11. package/Code.js +19 -12
  12. package/Color.js +32 -32
  13. package/ComboBox.js +9 -7
  14. package/Date.js +160 -184
  15. package/DualListbox.js +549 -612
  16. package/File.js +546 -408
  17. package/FormRows.js +170 -157
  18. package/Image.js +124 -251
  19. package/JSONTree.js +496 -521
  20. package/Layer.js +162 -97
  21. package/Layout.d.ts +2 -0
  22. package/Link.js +20 -13
  23. package/MIGRATION.v5.mdx +48 -1
  24. package/Markdown.js +1 -1
  25. package/Menu.js +1 -1
  26. package/Message.js +132 -177
  27. package/MessageBar.js +121 -290
  28. package/Modal.js +2 -2
  29. package/ModalLayer.js +12 -12
  30. package/Multiselect.js +1982 -2334
  31. package/NonInteractiveCheckbox.js +29 -117
  32. package/Number.js +114 -114
  33. package/Popover.js +328 -326
  34. package/Progress.js +68 -54
  35. package/RadioBar.js +139 -136
  36. package/RadioList.js +67 -65
  37. package/Resize.js +377 -265
  38. package/ResultsMenu.js +573 -661
  39. package/Scroll.js +2 -2
  40. package/ScrollContainerContext.js +13 -9
  41. package/Search.js +1 -1
  42. package/Select.js +364 -361
  43. package/SidePanel.js +17 -21
  44. package/Slider.js +494 -372
  45. package/SlidingPanels.js +100 -102
  46. package/SplitButton.js +39 -25
  47. package/StepBar.js +3 -3
  48. package/Switch.js +136 -129
  49. package/TabBar.js +598 -466
  50. package/TabLayout.js +34 -34
  51. package/Table.js +1648 -1479
  52. package/Text.js +51 -50
  53. package/TextArea.js +280 -154
  54. package/Tooltip.js +413 -563
  55. package/TransitionOpen.js +2 -2
  56. package/Tree.js +2 -2
  57. package/Typography.js +30 -28
  58. package/WaitSpinner.js +6 -11
  59. package/cypress/support/commands.ts +14 -4
  60. package/cypress/support/index.d.ts +1 -1
  61. package/package.json +9 -11
  62. package/stubs-splunkui.d.ts +0 -4
  63. package/types/src/Accordion/Accordion.d.ts +14 -21
  64. package/types/src/Accordion/AccordionContext.d.ts +0 -1
  65. package/types/src/Animation/Animation.d.ts +2 -3
  66. package/types/src/AnimationToggle/docs/examples/Provider.d.ts +2 -2
  67. package/types/src/AnimationToggle/docs/examples/ToggleComponent.d.ts +2 -2
  68. package/types/src/AnimationToggle/useAnimationToggle.d.ts +1 -1
  69. package/types/src/Button/Button.d.ts +1 -1
  70. package/types/src/ButtonGroup/ButtonGroupContext.d.ts +0 -1
  71. package/types/src/ButtonSimple/ButtonSimple.d.ts +1 -3
  72. package/types/src/ButtonSimple/mixin.d.ts +1 -1
  73. package/types/src/Calendar/Calendar.d.ts +2 -2
  74. package/types/src/Calendar/{DateTable.d.ts → DateGrid.d.ts} +9 -9
  75. package/types/src/Calendar/Day.d.ts +8 -4
  76. package/types/src/Card/Card.d.ts +3 -1
  77. package/types/src/Card/Header.d.ts +2 -0
  78. package/types/src/Card/docs/examples/HeadingTitle.d.ts +3 -0
  79. package/types/src/CardLayout/CardLayoutContext.d.ts +0 -1
  80. package/types/src/CardLayout/docs/examples/Interactive.d.ts +2 -2
  81. package/types/src/Clickable/Clickable.d.ts +12 -4
  82. package/types/src/CollapsiblePanel/SingleOpenPanelGroupContext.d.ts +0 -1
  83. package/types/src/ComboBox/ComboBox.d.ts +3 -3
  84. package/types/src/ControlGroup/docs/examples/CustomizedLabelTarget.d.ts +2 -2
  85. package/types/src/Date/docs/examples/Controlled.d.ts +2 -2
  86. package/types/src/Date/docs/examples/HighlightToday.d.ts +2 -2
  87. package/types/src/DefinitionList/DefinitionListContext.d.ts +0 -1
  88. package/types/src/DualListbox/DualListbox.d.ts +5 -1
  89. package/types/src/File/File.d.ts +4 -4
  90. package/types/src/File/FileContext.d.ts +0 -1
  91. package/types/src/File/Item.d.ts +11 -3
  92. package/types/src/File/ItemIcon.d.ts +2 -1
  93. package/types/src/File/docs/examples/Disabled.d.ts +2 -2
  94. package/types/src/File/docs/examples/DropAnywhere.d.ts +2 -2
  95. package/types/src/File/docs/examples/Multi.d.ts +2 -2
  96. package/types/src/File/docs/examples/Single.d.ts +2 -2
  97. package/types/src/FormRows/FormRows.d.ts +4 -4
  98. package/types/src/FormRows/FormRowsContext.d.ts +1 -2
  99. package/types/src/FormRows/SortableRow.d.ts +1 -1
  100. package/types/src/FormRows/docs/examples/Basic.d.ts +2 -2
  101. package/types/src/FormRows/docs/examples/Header.d.ts +2 -2
  102. package/types/src/FormRows/docs/examples/Menu.d.ts +2 -2
  103. package/types/src/FormRows/docs/examples/ReorderOnly.d.ts +2 -2
  104. package/types/src/Image/Image.d.ts +1 -4
  105. package/types/src/JSONTree/docs/examples/Events.d.ts +2 -2
  106. package/types/src/Layout/Layout.d.ts +1 -0
  107. package/types/src/Link/Link.d.ts +4 -0
  108. package/types/src/Link/icons/External.d.ts +1 -2
  109. package/types/src/Menu/Divider.d.ts +1 -1
  110. package/types/src/Menu/MenuContext.d.ts +0 -1
  111. package/types/src/Message/Message.d.ts +1 -1
  112. package/types/src/MessageBar/MessageBar.d.ts +6 -2
  113. package/types/src/Modal/ModalContext.d.ts +0 -1
  114. package/types/src/Multiselect/Compact.d.ts +46 -21
  115. package/types/src/Multiselect/Multiselect.d.ts +69 -36
  116. package/types/src/Multiselect/Normal.d.ts +45 -62
  117. package/types/src/Multiselect/Option.d.ts +42 -18
  118. package/types/src/Multiselect/docs/examples/Children.d.ts +2 -9
  119. package/types/src/Multiselect/docs/examples/Controlled.d.ts +2 -9
  120. package/types/src/Multiselect/docs/examples/CustomizeSelected.d.ts +2 -9
  121. package/types/src/Multiselect/docs/examples/Disabled.d.ts +2 -9
  122. package/types/src/Multiselect/docs/examples/Error.d.ts +2 -9
  123. package/types/src/Multiselect/docs/examples/Fetching.d.ts +2 -22
  124. package/types/src/Multiselect/docs/examples/Headings.d.ts +2 -1
  125. package/types/src/Multiselect/docs/examples/LoadMoreOnScrollBottom.d.ts +2 -25
  126. package/types/src/Multiselect/docs/examples/NewValues.d.ts +2 -9
  127. package/types/src/Multiselect/docs/examples/TabInput.d.ts +2 -9
  128. package/types/src/NonInteractiveCheckbox/NonInteractiveCheckbox.d.ts +8 -7
  129. package/types/src/Number/docs/examples/Basic.d.ts +2 -2
  130. package/types/src/Number/docs/examples/Limits.d.ts +2 -2
  131. package/types/src/Number/docs/examples/Locale.d.ts +2 -2
  132. package/types/src/Popover/Popover.d.ts +1 -1
  133. package/types/src/Popover/PopoverMenuContext.d.ts +0 -1
  134. package/types/src/RadioBar/RadioBar.d.ts +1 -1
  135. package/types/src/RadioBar/RadioBarContext.d.ts +0 -1
  136. package/types/src/RadioList/RadioListContext.d.ts +0 -1
  137. package/types/src/ResultsMenu/ResultsMenu.d.ts +23 -34
  138. package/types/src/Scroll/Inner.d.ts +1 -1
  139. package/types/src/Scroll/docs/examples/Controlled.d.ts +2 -2
  140. package/types/src/Search/Search.d.ts +2 -2
  141. package/types/src/Select/SelectBase.d.ts +4 -4
  142. package/types/src/Slider/docs/examples/Controlled.d.ts +2 -2
  143. package/types/src/Slider/docs/examples/CustomLabels.d.ts +2 -2
  144. package/types/src/Slider/getStepMarksBackground.d.ts +8 -0
  145. package/types/src/SlidingPanels/Panel.d.ts +2 -2
  146. package/types/src/SlidingPanels/SlidingPanels.d.ts +2 -2
  147. package/types/src/SlidingPanels/docs/examples/Basic.d.ts +2 -2
  148. package/types/src/SlidingPanels/docs/examples/Dropdown.d.ts +2 -2
  149. package/types/src/SplitButton/Item.d.ts +15 -2
  150. package/types/src/StepBar/Step.d.ts +1 -1
  151. package/types/src/StepBar/StepBar.d.ts +1 -1
  152. package/types/src/StepBar/StepBarContext.d.ts +0 -1
  153. package/types/src/Switch/docs/examples/Basic.d.ts +2 -2
  154. package/types/src/Switch/docs/examples/Disabled.d.ts +2 -2
  155. package/types/src/TabBar/Tab.d.ts +12 -5
  156. package/types/src/TabBar/TabBar.d.ts +11 -7
  157. package/types/src/TabBar/TabBarContext.d.ts +8 -3
  158. package/types/src/TabLayout/TabLayout.d.ts +8 -5
  159. package/types/src/Table/Head.d.ts +4 -15
  160. package/types/src/Table/HeadCell.d.ts +23 -25
  161. package/types/src/Table/HeadDropdownCell.d.ts +23 -26
  162. package/types/src/Table/HeadInner.d.ts +4 -10
  163. package/types/src/Table/Row.d.ts +6 -6
  164. package/types/src/Table/Table.d.ts +3 -8
  165. package/types/src/Table/TableContext.d.ts +0 -1
  166. package/types/src/Tooltip/Tooltip.d.ts +26 -58
  167. package/types/src/Tooltip/docs/examples/Controlled.d.ts +2 -2
  168. package/types/src/Tree/TreeContext.d.ts +0 -1
  169. package/types/src/Typography/Typography.d.ts +27 -22
  170. package/types/src/useForceUpdate/useForceUpdate.d.ts +0 -1
  171. package/types/src/useResizeObserver/useResizeObserver.d.ts +2 -1
  172. package/types/src/utils/types.d.ts +2 -3
  173. package/useResizeObserver.js +26 -19
  174. package/types/src/Date/Icon.d.ts +0 -3
  175. package/types/src/Image/icons/Cross.d.ts +0 -3
  176. package/types/src/TabBar/docs/examples/IconsAbove.d.ts +0 -3
  177. package/types/src/TabBar/docs/examples/VerticalIconsAbove.d.ts +0 -3
  178. package/types/src/Table/docs/examples/prisma/DockedHeaderScrollbar.d.ts +0 -3
  179. package/types/src/Tooltip/InfoIcon.d.ts +0 -4
  180. /package/types/src/TabBar/docs/examples/{IconsLeft.d.ts → Icons.d.ts} +0 -0
  181. /package/types/src/TabBar/docs/examples/{VerticalIconsLeft.d.ts → VerticalIcons.d.ts} +0 -0
package/Layer.js CHANGED
@@ -73,28 +73,28 @@
73
73
  e.r(t);
74
74
  // EXPORTS
75
75
  e.d(t, {
76
- LayerContext: () => /* reexport */ g,
77
- LayerStackContext: () => /* reexport */ b,
78
- LayerStackGlobalProvider: () => /* reexport */ w,
79
- default: () => /* reexport */ K
76
+ LayerContext: () => /* reexport */ b,
77
+ LayerStackContext: () => /* reexport */ g,
78
+ LayerStackGlobalProvider: () => /* reexport */ E,
79
+ default: () => /* reexport */ G
80
80
  });
81
81
  // CONCATENATED MODULE: external "react"
82
82
  const n = require("react");
83
83
  var r = e.n(n);
84
84
  // CONCATENATED MODULE: external "react-dom"
85
- const a = require("react-dom");
85
+ const o = require("react-dom");
86
86
  // CONCATENATED MODULE: external "prop-types"
87
- const o = require("prop-types");
88
- var i = e.n(o);
87
+ const a = require("prop-types");
88
+ var i = e.n(a);
89
89
  // CONCATENATED MODULE: external "lodash/includes"
90
- const l = require("lodash/includes");
91
- var u = e.n(l);
90
+ const u = require("lodash/includes");
91
+ var l = e.n(u);
92
92
  // CONCATENATED MODULE: external "lodash/last"
93
93
  const c = require("lodash/last");
94
94
  var s = e.n(c);
95
95
  // CONCATENATED MODULE: external "lodash/pull"
96
- const d = require("lodash/pull");
97
- var f = e.n(d);
96
+ const f = require("lodash/pull");
97
+ var d = e.n(f);
98
98
  // CONCATENATED MODULE: external "@splunk/react-ui/EventListener"
99
99
  const v = require("@splunk/react-ui/EventListener");
100
100
  var y = e.n(v);
@@ -109,8 +109,8 @@
109
109
  * depend on it, such as `Modal`) uses to determine the order of open layers.
110
110
  * @public
111
111
  */
112
- var b = r().createContext([]);
113
- var g = r().createContext({});
112
+ var g = r().createContext([]);
113
+ var b = r().createContext({});
114
114
  var C = {
115
115
  children: i().node,
116
116
  name: i().string,
@@ -122,37 +122,37 @@
122
122
  * A `LayerStackContext` provider that stores a shared layer stack using a global variable.
123
123
  * Applications should only use this provider if there's a known need to support multiple
124
124
  * instances of this library on the same page.
125
- */ function w(t) {
126
- var a = t.children, o = t.name, i = o === void 0 ? "__splunkui_layer_instances__" : o, l = t.scope, u = l === void 0 ? typeof window !== "undefined" ? window : e.g : l, c = t.separateStackingContexts, s = c === void 0 ? false : c;
127
- if (!u[i]) {
128
- u[i] = [];
125
+ */ function E(t) {
126
+ var o = t.children, a = t.name, i = a === void 0 ? "__splunkui_layer_instances__" : a, u = t.scope, l = u === void 0 ? typeof window !== "undefined" ? window : e.g : u, c = t.separateStackingContexts, s = c === void 0 ? false : c;
127
+ if (!l[i]) {
128
+ l[i] = [];
129
129
  // eslint-disable-line no-param-reassign
130
130
  }
131
- var d = (0, n.useMemo)((function() {
131
+ var f = (0, n.useMemo)((function() {
132
132
  return {
133
133
  separateStackingContexts: s
134
134
  };
135
135
  }), [ s ]);
136
136
 
137
- return r().createElement(b.Provider, {
138
- value: u[i]
139
- }, r().createElement(g.Provider, {
140
- value: d
141
- }, a));
137
+ return r().createElement(g.Provider, {
138
+ value: l[i]
139
+ }, r().createElement(b.Provider, {
140
+ value: f
141
+ }, o));
142
142
  }
143
- w.propTypes = C;
143
+ E.propTypes = C;
144
144
  // CONCATENATED MODULE: external "styled-components"
145
- const E = require("styled-components");
146
- var S = e.n(E);
145
+ const S = require("styled-components");
146
+ var k = e.n(S);
147
147
  // CONCATENATED MODULE: external "@splunk/themes"
148
- const k = require("@splunk/themes");
148
+ const w = require("@splunk/themes");
149
149
  // CONCATENATED MODULE: ./src/Layer/LayerStyles.ts
150
- var x = S().div.withConfig({
150
+ var T = k().div.withConfig({
151
151
  displayName: "LayerStyles__StyledLayer",
152
152
  componentId: "ii6psl-0"
153
153
  })([ "", "" ], (function(e) {
154
154
  var t = e.$separateStackingContexts;
155
- return t && (0, E.css)([ "isolation:isolate;z-index:", ";" ], k.variables.zindexLayer);
155
+ return t && (0, S.css)([ "isolation:isolate;position:relative;z-index:", ";" ], w.variables.zindexLayer);
156
156
  }));
157
157
  // CONCATENATED MODULE: ./src/utils/ssrDocument.ts
158
158
  /* eslint-disable @typescript-eslint/no-empty-function */
@@ -210,102 +210,167 @@
210
210
  search: ""
211
211
  }
212
212
  };
213
- function T() {
213
+ function x() {
214
214
  var e = typeof document !== "undefined" ? document : q;
215
215
  return e;
216
216
  }
217
+ var A = x();
218
+ /* harmony default export */ const L = /* unused pure expression or super */ null && A;
219
+ // CONCATENATED MODULE: ./src/utils/ssrWindow.ts
220
+ /* eslint-disable @typescript-eslint/no-empty-function */
221
+ var _ = {
222
+ document: q,
223
+ navigator: {
224
+ userAgent: ""
225
+ },
226
+ location: {
227
+ hash: "",
228
+ host: "",
229
+ hostname: "",
230
+ href: "",
231
+ origin: "",
232
+ pathname: "",
233
+ protocol: "",
234
+ search: ""
235
+ },
236
+ history: {
237
+ replaceState: function e() {},
238
+ pushState: function e() {},
239
+ go: function e() {},
240
+ back: function e() {}
241
+ },
242
+ CustomEvent: function e() {
243
+ return this;
244
+ },
245
+ addEventListener: function e() {},
246
+ removeEventListener: function e() {},
247
+ getComputedStyle: function e() {
248
+ return {
249
+ getPropertyValue: function e() {
250
+ return "";
251
+ }
252
+ };
253
+ },
254
+ Image: function e() {},
255
+ Date: function e() {},
256
+ screen: {},
257
+ setTimeout: function e() {},
258
+ clearTimeout: function e() {},
259
+ matchMedia: function e() {
260
+ return {};
261
+ },
262
+ requestAnimationFrame: function e(t) {
263
+ if (typeof setTimeout === "undefined") {
264
+ t();
265
+ return null;
266
+ }
267
+ return setTimeout(t, 0);
268
+ },
269
+ cancelAnimationFrame: function e(t) {
270
+ if (typeof setTimeout === "undefined") {
271
+ return;
272
+ }
273
+ clearTimeout(t);
274
+ }
275
+ };
276
+ function j() {
277
+ var e = typeof window !== "undefined" ? window : _;
278
+ return e;
279
+ }
280
+ var O = j();
281
+ /* harmony default export */ const P = O;
217
282
  // CONCATENATED MODULE: ./src/Layer/Layer.tsx
218
- function A(e, t) {
219
- return P(e) || O(e, t) || _(e, t) || L();
283
+ function M(e, t) {
284
+ return D(e) || F(e, t) || N(e, t) || I();
220
285
  }
221
- function L() {
286
+ function I() {
222
287
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
223
288
  }
224
- function _(e, t) {
289
+ function N(e, t) {
225
290
  if (e) {
226
- if ("string" == typeof e) return j(e, t);
291
+ if ("string" == typeof e) return R(e, t);
227
292
  var n = {}.toString.call(e).slice(8, -1);
228
- return "Object" === n && e.constructor && (n = e.constructor.name), "Map" === n || "Set" === n ? Array.from(e) : "Arguments" === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? j(e, t) : void 0;
293
+ return "Object" === n && e.constructor && (n = e.constructor.name), "Map" === n || "Set" === n ? Array.from(e) : "Arguments" === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? R(e, t) : void 0;
229
294
  }
230
295
  }
231
- function j(e, t) {
296
+ function R(e, t) {
232
297
  (null == t || t > e.length) && (t = e.length);
233
298
  for (var n = 0, r = Array(t); n < t; n++) {
234
299
  r[n] = e[n];
235
300
  }
236
301
  return r;
237
302
  }
238
- function O(e, t) {
303
+ function F(e, t) {
239
304
  var n = null == e ? null : "undefined" != typeof Symbol && e[Symbol.iterator] || e["@@iterator"];
240
305
  if (null != n) {
241
- var r, a, o, i, l = [], u = !0, c = !1;
306
+ var r, o, a, i, u = [], l = !0, c = !1;
242
307
  try {
243
- if (o = (n = n.call(e)).next, 0 === t) {
308
+ if (a = (n = n.call(e)).next, 0 === t) {
244
309
  if (Object(n) !== n) return;
245
- u = !1;
246
- } else for (;!(u = (r = o.call(n)).done) && (l.push(r.value), l.length !== t); u = !0) {
310
+ l = !1;
311
+ } else for (;!(l = (r = a.call(n)).done) && (u.push(r.value), u.length !== t); l = !0) {
247
312
  }
248
313
  } catch (e) {
249
- c = !0, a = e;
314
+ c = !0, o = e;
250
315
  } finally {
251
316
  try {
252
- if (!u && null != n["return"] && (i = n["return"](), Object(i) !== i)) return;
317
+ if (!l && null != n["return"] && (i = n["return"](), Object(i) !== i)) return;
253
318
  } finally {
254
- if (c) throw a;
319
+ if (c) throw o;
255
320
  }
256
321
  }
257
- return l;
322
+ return u;
258
323
  }
259
324
  }
260
- function P(e) {
325
+ function D(e) {
261
326
  if (Array.isArray(e)) return e;
262
327
  }
263
328
  /** @public */
264
- /** @public */ var M = [ "clickAway", "escapeKey" ];
265
- var I = {
329
+ /** @public */ var K = [ "clickAway", "escapeKey" ];
330
+ var $ = {
266
331
  children: i().node,
267
- closeReasons: i().arrayOf(i().oneOf(M)),
332
+ closeReasons: i().arrayOf(i().oneOf(K)),
268
333
  onRequestClose: i().func,
269
334
  open: i().bool
270
335
  };
271
- var N = {
336
+ var z = {
272
337
  passive: true
273
338
  };
274
339
  // we need a custom type here in order to set layerContainer as a property
275
- var R = function e(t) {
276
- var o = t.children, i = t.closeReasons, l = i === void 0 ? M : i, c = t.open, d = t.onRequestClose;
277
- var v = (0, n.useContext)(g), p = v.separateStackingContexts;
278
- var C = (0, n.useContext)(b);
279
- var w = (0, n.useRef)(null);
280
- var E = (0, n.useState)((0, h.createGUID)()), S = A(E, 1), k = S[0];
340
+ var B = function e(t) {
341
+ var a = t.children, i = t.closeReasons, u = i === void 0 ? K : i, c = t.open, f = t.onRequestClose;
342
+ var v = (0, n.useContext)(b), p = v.separateStackingContexts;
343
+ var C = (0, n.useContext)(g);
344
+ var E = (0, n.useRef)(null);
345
+ var S = (0, n.useState)((0, h.createGUID)()), k = M(S, 1), w = k[0];
281
346
  var q = m()(c);
282
347
  (0, n.useEffect)((function() {
283
348
  if (c && !q) {
284
- C.push(k);
349
+ C.push(w);
285
350
  } else if (q && !c) {
286
- f()(C, k);
351
+ d()(C, w);
287
352
  }
288
- }), [ k, C, c, q ]);
353
+ }), [ w, C, c, q ]);
289
354
  // it is not part of the previous useEffect because it needs to be equivalent to componentWillUnmount
290
355
  // the previous useEffect will get re-run every time open and prevOpen change which is not what we want
291
356
  (0, n.useEffect)((function() {
292
357
  return function() {
293
- f()(C, k);
358
+ d()(C, w);
294
359
  };
295
- }), [ k, C ]);
360
+ }), [ w, C ]);
296
361
  if (!e.layerContainer) {
297
- var L = T();
298
- var _ = L.createElement("div");
299
- _.setAttribute("data-test", "layer-container");
300
- L.body.appendChild(_);
301
- e.layerContainer = _;
362
+ var A = x();
363
+ var L = A.createElement("div");
364
+ L.setAttribute("data-test", "layer-container");
365
+ A.body.appendChild(L);
366
+ e.layerContainer = L;
302
367
  }
303
368
  // the fullscreen API does not render elements outside the fullscreen element
304
369
  // Layer renders in document.body, which means that anything using Layer will not render in fullscreen
305
370
  // this code moves the layer container into the fullscreen element, ensuring that it will render
306
- var j = (0, n.useCallback)((function() {
371
+ var _ = (0, n.useCallback)((function() {
307
372
  if (e.layerContainer) {
308
- var t = T();
373
+ var t = x();
309
374
  if (t.fullscreenElement != null) {
310
375
  t.fullscreenElement.appendChild(e.layerContainer);
311
376
  } else {
@@ -313,69 +378,69 @@
313
378
  }
314
379
  }
315
380
  }), []);
316
- var O = (0, n.useCallback)((function(e) {
381
+ var j = (0, n.useCallback)((function(e) {
317
382
  var t = e.nativeEvent;
318
- w.current = t;
383
+ E.current = t;
319
384
  }), []);
320
- var P = (0, n.useCallback)((function(e) {
385
+ var O = (0, n.useCallback)((function(e) {
321
386
  // clicks inside the layer should not be considered clickAways
322
- if (!c || !u()(l, "clickAway") || w.current === e) {
387
+ if (!c || !l()(u, "clickAway") || E.current === e) {
323
388
  return;
324
389
  }
325
- d === null || d === void 0 ? void 0 : d({
390
+ f === null || f === void 0 ? void 0 : f({
326
391
  event: e,
327
392
  reason: "clickAway"
328
393
  });
329
- }), [ l, c, d ]);
394
+ }), [ u, c, f ]);
330
395
  var I = (0, n.useCallback)((function(e) {
331
- if (c && e.key === "Escape" && s()(C) === k && u()(l, "escapeKey")) {
332
- d === null || d === void 0 ? void 0 : d({
396
+ if (c && e.key === "Escape" && s()(C) === w && l()(u, "escapeKey")) {
397
+ f === null || f === void 0 ? void 0 : f({
333
398
  event: e,
334
399
  reason: "escapeKey"
335
400
  });
336
401
  }
337
- }), [ l, k, C, c, d ]);
338
- var R = r().createElement(y(), {
339
- target: window,
402
+ }), [ u, w, C, c, f ]);
403
+ var N = r().createElement(y(), {
404
+ target: P,
340
405
  eventType: "fullscreenchange",
341
- listener: j,
406
+ listener: _,
342
407
  key: "fullScreenChange"
343
408
  });
344
409
  if (c) {
345
- var K = (0, a.createPortal)( r().createElement(x, {
410
+ var R = (0, o.createPortal)( r().createElement(T, {
346
411
  $separateStackingContexts: p,
347
412
  "data-test": "layer",
348
- onMouseDown: O,
349
- onTouchStart: O
350
- }, o), e.layerContainer);
413
+ onMouseDown: j,
414
+ onTouchStart: j
415
+ }, a), e.layerContainer);
351
416
 
352
417
  return r().createElement(r().Fragment, null, r().createElement(y(), {
353
- target: window,
418
+ target: P,
354
419
  eventType: "keydown",
355
420
  listener: I,
356
421
  key: "eventListenerKeydown"
357
422
  }), r().createElement(y(), {
358
- target: window,
423
+ target: P,
359
424
  eventType: "mousedown",
360
- listener: P,
425
+ listener: O,
361
426
  key: "eventListenerMouseDown"
362
427
  }), r().createElement(y(), {
363
- target: window,
428
+ target: P,
364
429
  eventType: "touchstart",
365
- listener: P,
430
+ listener: O,
366
431
  key: "eventListenerTouchStart",
367
- options: N
368
- }), R, K);
432
+ options: z
433
+ }), N, R);
369
434
  }
370
435
  // the fragment has to be present to avoid type issues with React 18
371
436
  // eslint-disable-next-line react/jsx-no-useless-fragment
372
437
 
373
- return r().createElement(r().Fragment, null, R);
438
+ return r().createElement(r().Fragment, null, N);
374
439
  };
375
- R.propTypes = I;
376
- R.layerContainer = null;
377
- R.possibleCloseReasons = M;
378
- /* harmony default export */ const K = R;
440
+ B.propTypes = $;
441
+ B.layerContainer = null;
442
+ B.possibleCloseReasons = K;
443
+ /* harmony default export */ const G = B;
379
444
  // CONCATENATED MODULE: ./src/Layer/index.ts
380
445
  module.exports = t;
381
446
  /******/})();
package/Layout.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ export { default } from './types/src/Layout';
2
+ export * from './types/src/Layout';
package/Link.js CHANGED
@@ -89,10 +89,10 @@
89
89
  })([ "vertical-align:text-bottom;margin-left:", ";" ], f.variables.spacingXSmall);
90
90
  /* harmony default export */ const v = b;
91
91
  // CONCATENATED MODULE: external "@splunk/react-ui/Clickable"
92
- const m = require("@splunk/react-ui/Clickable");
93
- var h = e.n(m);
92
+ const g = require("@splunk/react-ui/Clickable");
93
+ var m = e.n(g);
94
94
  // CONCATENATED MODULE: ./src/Link/LinkStyles.ts
95
- var y = d()(h()).withConfig({
95
+ var h = d()(m()).withConfig({
96
96
  displayName: "LinkStyles__StyledClickable",
97
97
  componentId: "sc-1hhltcf-0"
98
98
  })([ "", ";text-decoration:none;font-size:inherit;font-weight:inherit;line-height:inherit;color:", ";", " &:not([disabled],[aria-disabled='true']){cursor:pointer;&:hover,&:active,&:focus{color:", ";text-decoration:underline;text-decoration-thickness:2px;}&:focus{box-shadow:", ";outline:0;&:active{box-shadow:none;}}}&[disabled],&[aria-disabled='true']{color:", ";}" ], f.mixins.reset("inline"), f.variables.contentColorLink, (0,
@@ -101,8 +101,8 @@
101
101
  standalone: (0, c.css)([ "font-weight:", ";" ], f.variables.fontWeightSemiBold)
102
102
  }), f.variables.contentColorLink, f.variables.focusShadow, f.variables.contentColorDisabled);
103
103
  // CONCATENATED MODULE: ./src/Link/Link.tsx
104
- function g() {
105
- return g = Object.assign ? Object.assign.bind() : function(e) {
104
+ function y() {
105
+ return y = Object.assign ? Object.assign.bind() : function(e) {
106
106
  for (var n = 1; n < arguments.length; n++) {
107
107
  var t = arguments[n];
108
108
  for (var r in t) {
@@ -110,7 +110,7 @@
110
110
  }
111
111
  }
112
112
  return e;
113
- }, g.apply(null, arguments);
113
+ }, y.apply(null, arguments);
114
114
  }
115
115
  function w(e, n) {
116
116
  if (null == e) return {};
@@ -146,20 +146,27 @@
146
146
  /**
147
147
  * `Link` is a simple method for configuring `Button` for inline links. For more complex behaviors,
148
148
  * see the `Button` documentation.
149
- */ var k = r().forwardRef((function(e, n) {
150
- var t = e.appearance, o = t === void 0 ? "inline" : t, a = e.children, i = e.disabled, s = i === void 0 ? false : i, c = e.elementRef, d = e.openInNewContext, u = d === void 0 ? false : d, p = e.to, f = w(e, [ "appearance", "children", "disabled", "elementRef", "openInNewContext", "to" ]);
149
+ */ var k = r().forwardRef((function(e,
150
+ // SUI-7623 - needs to be specified for react-docgen versions less than 7.1.0
151
+ n) {
152
+ var t = e.appearance, o = t === void 0 ? "inline" : t, a = e.children, i = e.disabled, s = i === void 0 ? false : i, c = e.elementRef, d = e.openInNewContext, u = d === void 0 ? false : d, p = e.tag, f = p === void 0 ? "a" : p, b = e.to, g = w(e, [ "appearance", "children", "disabled", "elementRef", "openInNewContext", "tag", "to" ]);
151
153
  // @docs-props-type LinkPropsBase
152
- var b = typeof u === "string" ? u : S;
154
+ var m = typeof u === "string" ? u : S;
155
+ // Ensure `Link` always renders as an `a` (unless overriden by `tag`) by passing a value to Clickable,
156
+ // using '' if disabled or the to is not passed.
157
+ var O = s && "" || b && b || "";
153
158
 
154
- return r().createElement(y, g({
159
+ return r().createElement(h, y({
155
160
  "data-test": "link",
156
- disabled: s,
161
+ disabled: s ? "disabled" : undefined,
157
162
  elementRef: c,
158
163
  openInNewContext: !!u,
159
164
  $appearance: o,
160
165
  ref: n,
161
- to: s ? "" : p
162
- }, f), a, u && r().createElement(r().Fragment, null, r().createElement(v, null), r().createElement(l(), null, b)));
166
+ to: O
167
+ }, g, {
168
+ tag: f
169
+ }), a, u && r().createElement(r().Fragment, null, r().createElement(v, null), r().createElement(l(), null, m)));
163
170
  }));
164
171
  k.propTypes = x;
165
172
  /* harmony default export */ const C = k;
package/MIGRATION.v5.mdx CHANGED
@@ -207,7 +207,7 @@ Components that formerly supported class focus methods (`Color`, `Link`, `Menu`,
207
207
  ### Migration steps
208
208
  - Convert all usage of `ref` to `elementRef`.
209
209
  - For `Number` and `Text`: Replace all usage of the class `focus` method with passing a `ref` to the `inputRef` prop and calling `inputRef.current.focus()`.
210
- - For `Button`, `Color`, `Link`, `Menu`, `Select.Option`, `SplitButton.Item`, and `TabBar.Tab`: Replace all usage of the class `focus` method with passing a `ref` to the `elementRef` prop and calling `elementRef.current.focus()`.
210
+ - For `Button`, `Color`, `Link`, `Menu`, `Multiselect.Option`, `Select.Option`, `SplitButton.Item`, and `TabBar.Tab`: Replace all usage of the class `focus` method with passing a `ref` to the `elementRef` prop and calling `elementRef.current.focus()`.
211
211
  - For `Table.HeadDropdownCell`: Replace all usage of the class `focus` method with passing a `ref` to the `buttonRef` prop and calling `buttonRef.current.focus()`.
212
212
  - For `Switch`: Replace all usage of the class `focus` method with passing a `ref` to the `toggleRef` prop and calling `toggleRef.current.focus()`.
213
213
  - For `Slider`: Replace all usage of the class `focus` method with passing a `ref` to the `thumbRef` prop and calling `thumbRef.current.focus()`.
@@ -261,6 +261,18 @@ This difference can cause confusion and conflict with accessibility expectations
261
261
  #### Migration steps
262
262
  - Replace Select with appearance="link" by using either appearance="default" or appearance="subtle", depending on design requirements.
263
263
 
264
+ ### Deprecated `TabBar` and `TabLayout`'s `iconPosition` prop
265
+
266
+ #### Change
267
+ `TabBar` and `TabLayouts`'s `iconPosition` prop is deprecated and will be removed in the next major version.
268
+
269
+ #### Context
270
+ `TabBar`'s `iconPosition="above"` value is deprecated because stacking an icon above text creates a vertical layout that’s harder to scan quickly, especially when multiple `Tab`s are present. The added vertical space can make the `TabBar` taller and more visually crowded, reducing the clarity and simplicity that `TabBar`s are supposed to offer.
271
+ Due to this `TabBar`'s `iconPosition` would only have the value of `left` remaining thus there is no longer a need for the `iconPosition` prop to specify icon positioning. Because `TabLayout` uses `TabBar` its matching prop is deprecated as well.
272
+
273
+ #### Migration steps
274
+ - Remove any setting of `TabBar` or `TabLayout`'s `iconPosition` prop and instead allow its default behavior of left icon positioning to take effect when icons are passed.
275
+
264
276
  ### Deprecated `Multiselect`'s `selectAllAppearance="buttongroup"` value
265
277
 
266
278
  #### Change
@@ -437,3 +449,38 @@ Pass a `ref` that refers to an HTML Element to the `anchor` prop.
437
449
  ### Migration steps
438
450
 
439
451
  Replace all usage of `Switch`'s test hook `[data-test="button"]` with `[data-test="toggle"]`.
452
+
453
+ ## `TabBar`'s `tabWidth` prop has been removed
454
+
455
+ ### Change
456
+ `TabBar`'s `tabWidth` prop has been removed. A new `maxTabWidth` prop has been added to support some use cases previously supported by the `tabWidth` prop.
457
+
458
+ ### Context
459
+ In previous versions `TabBar.Tab`s could have their width statically set by passing the `tabWidth` prop to the `TabBar`. However, the updated design for `TabBar` has responsive widths for `TabBar.Tab`s so setting a static tab width is no longer supported.
460
+
461
+ ### Migration steps
462
+ There are were two possible use cases for `tabWidth`:
463
+
464
+ 1) If you desire each `Tab` to not exceed a certain width, use `maxTabWidth`.
465
+ 2) If you desire each `Tab` to be the exact same width, we recommend against this - please reach out to us if you have a specific use case in mind.
466
+
467
+ ## Deprecated `Card.Header`'s `anchor` prop
468
+
469
+ ### Change
470
+
471
+ `Card.Header`'s `anchor` prop has been deprecated and will be removed in the next major version.
472
+
473
+ ### Context
474
+
475
+ Card titles need to be headings when there is content underneath to satisfy accessibility requirement WCAG 1.3.1.
476
+ The recommended way to do this is to pass the `Heading` component into the `title` prop.
477
+
478
+ The anchor prop leads to visual issues when non-text content (such as a Heading is passed to the `title` attribute).
479
+ To avoid this and because the functionality of the `anchor` prop can be achieved by passing the `Anchor` component to the `title` prop,
480
+ we have deprecated the `anchor` prop.
481
+
482
+ ### Migration steps
483
+ Replace all usage of the `anchor` prop with passing in the `Anchor` component to the `title` prop:
484
+ ```jsx
485
+ <Card.Header title={<Anchor name="Title">Title</Anchor>} />
486
+ ```
package/Markdown.js CHANGED
@@ -179,7 +179,7 @@
179
179
  var E = a().code.withConfig({
180
180
  displayName: "MarkdownStyles__StyledCodeInline",
181
181
  componentId: "sc-1xadih-1"
182
- })([ "", ";font-family:", ";background-color:", ";" ], k.mixins.reset("inline"), k.variables.monoFontFamily, k.variables.neutral100);
182
+ })([ "", ";font-size:inherit;font-family:", ";background-color:", ";" ], k.mixins.reset("inline"), k.variables.monoFontFamily, k.variables.neutral100);
183
183
  var R = a().blockquote.withConfig({
184
184
  displayName: "MarkdownStyles__StyledHint",
185
185
  componentId: "sc-1xadih-2"
package/Menu.js CHANGED
@@ -119,7 +119,7 @@
119
119
  var C = d()(g()).withConfig({
120
120
  displayName: "ItemStyles__StyledNonInteractiveCheckbox",
121
121
  componentId: "sc-4kc053-4"
122
- })([ "padding-right:", ";" ], f.variables.spacingSmall);
122
+ })([ "min-height:0;padding-right:", ";" ], f.variables.spacingSmall);
123
123
  var I = d()(b()).withConfig({
124
124
  displayName: "ItemStyles__StyledClickable",
125
125
  componentId: "sc-4kc053-5"