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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. package/Button.js +3 -1
  2. package/CHANGELOG.md +4 -1
  3. package/CHANGELOG.v5.mdx +35 -0
  4. package/Card.js +163 -162
  5. package/Chip.js +171 -225
  6. package/Clickable.js +79 -76
  7. package/ComboBox.js +1 -1
  8. package/Date.js +160 -184
  9. package/DualListbox.js +439 -504
  10. package/File.js +449 -324
  11. package/FormRows.js +143 -142
  12. package/JSONTree.js +496 -521
  13. package/Layer.js +162 -97
  14. package/Link.js +20 -13
  15. package/MIGRATION.v5.mdx +47 -0
  16. package/Markdown.js +1 -1
  17. package/Message.js +119 -141
  18. package/MessageBar.js +109 -168
  19. package/Multiselect.js +595 -602
  20. package/Popover.js +194 -190
  21. package/Progress.js +68 -54
  22. package/RadioBar.js +4 -1
  23. package/RadioList.js +67 -65
  24. package/Resize.js +377 -265
  25. package/ResultsMenu.js +573 -661
  26. package/ScrollContainerContext.js +13 -9
  27. package/Search.js +1 -1
  28. package/Select.js +206 -199
  29. package/Slider.js +455 -329
  30. package/StepBar.js +2 -2
  31. package/Switch.js +88 -87
  32. package/TabBar.js +322 -317
  33. package/TabLayout.js +34 -34
  34. package/Table.js +548 -525
  35. package/Text.js +20 -19
  36. package/TextArea.js +278 -152
  37. package/Tooltip.js +173 -177
  38. package/Tree.js +2 -2
  39. package/Typography.js +30 -28
  40. package/WaitSpinner.js +6 -11
  41. package/cypress/support/commands.ts +14 -4
  42. package/cypress/support/index.d.ts +1 -1
  43. package/package.json +5 -5
  44. package/stubs-splunkui.d.ts +0 -4
  45. package/types/src/Card/Card.d.ts +3 -1
  46. package/types/src/Card/Header.d.ts +2 -0
  47. package/types/src/Card/docs/examples/HeadingTitle.d.ts +3 -0
  48. package/types/src/Clickable/Clickable.d.ts +11 -3
  49. package/types/src/Link/Link.d.ts +4 -0
  50. package/types/src/Message/Message.d.ts +1 -1
  51. package/types/src/MessageBar/MessageBar.d.ts +1 -1
  52. package/types/src/Multiselect/Multiselect.d.ts +1 -8
  53. package/types/src/Multiselect/Normal.d.ts +1 -7
  54. package/types/src/Multiselect/docs/examples/Children.d.ts +2 -9
  55. package/types/src/Multiselect/docs/examples/Controlled.d.ts +2 -9
  56. package/types/src/Multiselect/docs/examples/CustomizeSelected.d.ts +2 -9
  57. package/types/src/Multiselect/docs/examples/Disabled.d.ts +2 -9
  58. package/types/src/Multiselect/docs/examples/Error.d.ts +2 -9
  59. package/types/src/Multiselect/docs/examples/Fetching.d.ts +2 -22
  60. package/types/src/Multiselect/docs/examples/Headings.d.ts +2 -1
  61. package/types/src/Multiselect/docs/examples/LoadMoreOnScrollBottom.d.ts +2 -25
  62. package/types/src/Multiselect/docs/examples/NewValues.d.ts +2 -9
  63. package/types/src/Multiselect/docs/examples/TabInput.d.ts +2 -9
  64. package/types/src/ResultsMenu/ResultsMenu.d.ts +23 -34
  65. package/types/src/Select/SelectBase.d.ts +2 -2
  66. package/types/src/TabBar/TabBar.d.ts +8 -5
  67. package/types/src/TabBar/TabBarContext.d.ts +1 -1
  68. package/types/src/TabLayout/TabLayout.d.ts +8 -5
  69. package/types/src/Typography/Typography.d.ts +27 -22
  70. package/types/src/Date/Icon.d.ts +0 -3
  71. package/types/src/TabBar/docs/examples/IconsAbove.d.ts +0 -3
  72. package/types/src/TabBar/docs/examples/VerticalIconsAbove.d.ts +0 -3
  73. /package/types/src/TabBar/docs/examples/{IconsLeft.d.ts → Icons.d.ts} +0 -0
  74. /package/types/src/TabBar/docs/examples/{VerticalIconsLeft.d.ts → VerticalIcons.d.ts} +0 -0
package/Clickable.js CHANGED
@@ -72,15 +72,15 @@
72
72
  var t = e.n(r);
73
73
  // CONCATENATED MODULE: external "prop-types"
74
74
  const i = require("prop-types");
75
- var o = e.n(i);
75
+ var a = e.n(i);
76
76
  // CONCATENATED MODULE: external "lodash/has"
77
- const a = require("lodash/has");
77
+ const o = require("lodash/has");
78
78
  // CONCATENATED MODULE: external "lodash/isString"
79
79
  const l = require("lodash/isString");
80
80
  var u = e.n(l);
81
81
  // CONCATENATED MODULE: external "lodash/omit"
82
- const c = require("lodash/omit");
83
- var d = e.n(c);
82
+ const d = require("lodash/omit");
83
+ var c = e.n(d);
84
84
  // CONCATENATED MODULE: external "styled-components"
85
85
  const s = require("styled-components");
86
86
  var f = e.n(s);
@@ -94,25 +94,25 @@
94
94
  // CONCATENATED MODULE: ./src/Clickable/NavigationProvider.tsx
95
95
  /** @public */
96
96
  var p = {
97
- children: o().node,
98
- onClick: o().func,
99
- onLinkClick: o().func,
100
- transformUrl: o().func
97
+ children: a().node,
98
+ onClick: a().func,
99
+ onLinkClick: a().func,
100
+ transformUrl: a().func
101
101
  };
102
102
  var m = t().createContext({});
103
103
  /**
104
104
  * Used to provide an override for the `onClick` for links for single page applications so that
105
105
  * internal links can navigate without a page reload.
106
106
  */ function y(e) {
107
- var n = e.children, i = e.onClick, o = e.onLinkClick, a = e.transformUrl;
107
+ var n = e.children, i = e.onClick, a = e.onLinkClick, o = e.transformUrl;
108
108
  // @docs-props-type NavigationProviderProps
109
109
  var l = (0, r.useMemo)((function() {
110
110
  return {
111
111
  onClick: i,
112
- onLinkClick: o,
113
- transformUrl: a
112
+ onLinkClick: a,
113
+ transformUrl: o
114
114
  };
115
- }), [ i, o, a ]);
115
+ }), [ i, a, o ]);
116
116
 
117
117
  return t().createElement(m.Provider, {
118
118
  value: l
@@ -152,16 +152,16 @@
152
152
  }
153
153
  function g(e, n) {
154
154
  if (null == e) return {};
155
- var r, t, i = h(e, n);
155
+ var r, t, i = O(e, n);
156
156
  if (Object.getOwnPropertySymbols) {
157
- var o = Object.getOwnPropertySymbols(e);
158
- for (t = 0; t < o.length; t++) {
159
- r = o[t], n.includes(r) || {}.propertyIsEnumerable.call(e, r) && (i[r] = e[r]);
157
+ var a = Object.getOwnPropertySymbols(e);
158
+ for (t = 0; t < a.length; t++) {
159
+ r = a[t], n.includes(r) || {}.propertyIsEnumerable.call(e, r) && (i[r] = e[r]);
160
160
  }
161
161
  }
162
162
  return i;
163
163
  }
164
- function h(e, n) {
164
+ function O(e, n) {
165
165
  if (null == e) return {};
166
166
  var r = {};
167
167
  for (var t in e) {
@@ -172,127 +172,130 @@
172
172
  }
173
173
  return r;
174
174
  }
175
- var O = /^[a-z0-9]+:/;
175
+ var h = /^[a-z0-9]+:/;
176
176
  var w = /^\/\//;
177
177
  var P = /^\//;
178
178
  var S = function e(n) {
179
179
  return n != null && P.test(n);
180
180
  };
181
181
  var j = function e(n) {
182
- return n != null && !O.test(n) && !w.test(n);
182
+ return n != null && !h.test(n) && !w.test(n);
183
183
  };
184
184
  var x = {
185
- children: o().node,
186
- disabled: o().oneOfType([ o().bool, o().oneOf([ "dimmed", "disabled" ]) ]),
187
- elementRef: o().oneOfType([ o().func, o().object ]),
188
- onClick: o().func,
189
- openInNewContext: o().bool,
190
- navigationLabel: o().string,
191
- to: o().string
185
+ children: a().node,
186
+ disabled: a().oneOfType([ a().bool, a().oneOf([ "dimmed", "disabled" ]) ]),
187
+ elementRef: a().oneOfType([ a().func, a().object ]),
188
+ onClick: a().func,
189
+ openInNewContext: a().bool,
190
+ navigationLabel: a().string,
191
+ to: a().oneOfType([ a().string, a().oneOf([ undefined ]) ])
192
192
  };
193
- function L(e, n) {
194
- return !!n && !e;
193
+ function L(e) {
194
+ return e !== undefined;
195
195
  }
196
196
  /**
197
197
  * `Clickable` renders as a `button` element, or as an `a` element if the `to` prop is set
198
198
  * and the `disabled` prop is `false`. This is called link mode.
199
- */ var I = t().forwardRef((function(e, n) {
200
- var i = e.children, o = e.disabled, a = e.elementRef, l = e.navigationLabel, c = e.onClick, s = e.openInNewContext, f = e.to, v = g(e, [ "children", "disabled", "elementRef", "navigationLabel", "onClick", "openInNewContext", "to" ]);
199
+ */ var I = t().forwardRef((function(e,
200
+ // SUI-7623 - needs to be specified for react-docgen versions less than 7.1.0
201
+ n) {
202
+ var i = e.children, a = e.disabled, o = e.elementRef, l = e.navigationLabel, d = e.onClick, s = e.openInNewContext, f = e.tag, v = e.to, p = g(e, [ "children", "disabled", "elementRef", "navigationLabel", "onClick", "openInNewContext", "tag", "to" ]);
201
203
  // @docs-props-type ClickablePropsBase
202
- var p = (0, r.useContext)(m), y = p.onClick, h = p.onLinkClick, O = p.transformUrl;
204
+ var y = (0, r.useContext)(m), O = y.onClick, h = y.onLinkClick, w = y.transformUrl;
203
205
  (0, r.useEffect)((function() {
204
206
  if (false) {}
205
207
  // this effect only runs once
206
208
  // eslint-disable-next-line react-hooks/exhaustive-deps
207
209
  }), []);
208
- var w = (0, r.useCallback)((function(e) {
209
- k(a, e);
210
+ var P = (0, r.useCallback)((function(e) {
211
+ k(o, e);
210
212
  k(n, e);
211
- }), [ a, n ]);
213
+ }), [ o, n ]);
212
214
  // memoizing this result causes TS to lose track of the type guard established by isLinkCheck
213
- var P = L(o, f);
215
+ var x = L(v);
214
216
  // ideally we wouldn't need to pass "to" as "toValue" here
215
217
  // but without doing that TS thinks the return value of this is
216
218
  // string | undefined which doesn't work for usages of this function
217
- var x = (0, r.useCallback)((function(e) {
218
- return O != null ? O(e, {
219
+ var I = (0, r.useCallback)((function(e) {
220
+ return w != null ? w(e, {
219
221
  isInternal: j(e),
220
222
  isRootRelative: S(e)
221
223
  }) : e;
222
- }), [ O ]);
223
- var I = (0, r.useCallback)((function(e) {
224
- if (P) {
224
+ }), [ w ]);
225
+ var R = (0, r.useCallback)((function(e) {
226
+ if (x) {
225
227
  // when user command-click on mac or ctrl-click on other platforms, and
226
228
  // Tag is an <a>, let the click pass through, let the <a> to achieve user's
227
229
  // intent of 'open in new context'
228
230
  // on mac, ctrl-click will be caught and open option menu even before hitting
229
231
  // the DOM, so we're safe to check both metaKey and ctrlKey here
230
232
  // without platform sniffing
231
- if ((e.metaKey || e.ctrlKey) && f) {
233
+ if ((e.metaKey || e.ctrlKey) && v) {
232
234
  return;
233
235
  }
234
236
  }
235
- c === null || c === void 0 ? void 0 : c(e);
236
- var n = c == null && y != null;
237
- if (P && (n || h != null)) {
237
+ d === null || d === void 0 ? void 0 : d(e);
238
+ var n = d == null && O != null;
239
+ if (x && (n || h != null)) {
238
240
  var r = l;
239
241
  if (!r && u()(i)) {
240
242
  r = i;
241
243
  }
242
244
  var t = {
243
- to: x(f),
244
- originalTo: f,
245
+ to: I(v),
246
+ originalTo: v,
245
247
  openInNewContext: s,
246
248
  label: r
247
249
  };
248
250
  if (n) {
249
- y(e, t);
251
+ O(e, t);
250
252
  }
251
253
  h === null || h === void 0 ? void 0 : h(e, t);
252
254
  }
253
- }), [ i, x, P, l, c, y, h, s, f ]);
254
- // Only set the href attribute when enabled, and therefore using an <a> tag
255
- if (P) {
256
- var R = s ? "_blank" : undefined;
257
- var q = s && j(f) ? "noopener noreferrer" : undefined;
255
+ }), [ i, I, x, l, d, O, h, s, v ]);
256
+ // Only set the href attribute when enabled and therefore using an <a> tag
257
+ if (x && f !== "button") {
258
+ if (a) {
259
+
260
+ return t().createElement(b, C({
261
+ "data-test": "clickable",
262
+ "data-test-disabled": a,
263
+ ref: P,
264
+ role: "link",
265
+ "aria-disabled": "true"
266
+ }, p), i);
267
+ }
268
+ var T = s ? "_blank" : undefined;
269
+ var q = s && j(v) ? "noopener noreferrer" : undefined;
258
270
 
259
271
  return t().createElement(b, C({
260
272
  "data-test": "clickable",
261
- ref: w,
262
- href: x(f),
263
- target: R,
273
+ ref: P,
274
+ href: I(v),
275
+ target: T,
264
276
  rel: q,
265
- onClick: I
266
- }, d()(v)), i);
267
- }
268
- if (o && f != null) {
269
-
270
- return t().createElement(b, C({
271
- "data-test": "clickable",
272
- ref: w,
273
- role: "link",
274
- "aria-disabled": "true"
275
- }, v), i);
277
+ onClick: R
278
+ }, c()(p)), i);
276
279
  }
277
280
  // button variant
278
- var N = o === true || o === "dimmed" || undefined;
279
- var T;
281
+ var N = a === true || a === "dimmed" || undefined;
282
+ var _;
280
283
  if (N) {
281
- T = "dimmed";
282
- } else if (o === "disabled") {
283
- T = "disabled";
284
+ _ = "dimmed";
285
+ } else if (a === "disabled") {
286
+ _ = "disabled";
284
287
  }
285
288
 
286
289
  return t().createElement(b, C({
287
290
  as: "button",
288
291
  "aria-disabled": N,
289
292
  "data-test": "clickable",
290
- "data-test-disabled": T,
291
- ref: w,
293
+ "data-test-disabled": _,
294
+ ref: P,
292
295
  type: "button",
293
- disabled: o === "disabled",
294
- onClick: c && !o ? I : undefined
295
- }, d()(v, "disabled")), i);
296
+ disabled: a === "disabled",
297
+ onClick: d && !a ? R : undefined
298
+ }, c()(p, "disabled")), i);
296
299
  }));
297
300
  I.propTypes = x;
298
301
  /* harmony default export */ const R = I;
package/ComboBox.js CHANGED
@@ -200,7 +200,7 @@
200
200
  "data-test-value": b,
201
201
  description: o,
202
202
  descriptionPosition: i,
203
- disabled: l,
203
+ disabled: l ? "disabled" : undefined,
204
204
  elementRef: g,
205
205
  startAdornment: c,
206
206
  matchRanges: f,