@splunk/react-ui 4.32.0 → 4.33.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 (37) hide show
  1. package/Button.js +42 -45
  2. package/ButtonSimple.js +372 -336
  3. package/CHANGELOG.md +23 -0
  4. package/Clickable.js +21 -19
  5. package/FormRows.js +229 -207
  6. package/MIGRATION.mdx +23 -0
  7. package/Menu.js +1 -1
  8. package/Modal.js +156 -131
  9. package/Multiselect.js +47 -33
  10. package/Select.js +236 -220
  11. package/TabBar.js +1 -1
  12. package/Text.js +13 -11
  13. package/package.json +5 -5
  14. package/types/src/Button/Button.d.ts +4 -4
  15. package/types/src/ButtonSimple/ButtonSimple.d.ts +8 -6
  16. package/types/src/ButtonSimple/mixin.d.ts +2 -2
  17. package/types/src/Clickable/Clickable.d.ts +3 -2
  18. package/types/src/Date/Date.d.ts +2 -2
  19. package/types/src/Menu/Item.d.ts +0 -1
  20. package/types/src/Number/Number.d.ts +2 -2
  21. package/types/src/Select/Select.d.ts +6 -2
  22. package/types/src/Select/SelectBase.d.ts +6 -2
  23. package/types/src/Slider/Slider.d.ts +2 -2
  24. package/types/src/Text/docs/examples/Basic.d.ts +1 -9
  25. package/types/src/Text/docs/examples/Error.d.ts +2 -10
  26. package/types/src/Text/docs/examples/Inline.d.ts +1 -9
  27. package/types/src/Text/docs/examples/Multiline.d.ts +1 -9
  28. package/types/src/Text/docs/examples/Password.d.ts +1 -9
  29. package/types/src/Text/docs/examples/Search.d.ts +1 -9
  30. package/types/src/Button/docs/examples/prisma/Basic.d.ts +0 -2
  31. package/types/src/Button/docs/examples/prisma/Block.d.ts +0 -2
  32. package/types/src/Button/docs/examples/prisma/Disabled.d.ts +0 -2
  33. package/types/src/Button/docs/examples/prisma/Icons.d.ts +0 -2
  34. package/types/src/Button/docs/examples/prisma/Menus.d.ts +0 -2
  35. package/types/src/Button/docs/examples/prisma/To.d.ts +0 -2
  36. package/types/src/Button/docs/examples/prisma/Truncated.d.ts +0 -2
  37. /package/types/src/{Button/docs/examples/prisma → Clickable/docs/examples}/Dimmed.d.ts +0 -0
package/Button.js CHANGED
@@ -73,9 +73,9 @@
73
73
  const o = require("lodash/isString");
74
74
  var l = e.n(o);
75
75
  // CONCATENATED MODULE: external "@splunk/react-ui/Dropdown"
76
- const c = require("@splunk/react-ui/Dropdown");
76
+ const s = require("@splunk/react-ui/Dropdown");
77
77
  // CONCATENATED MODULE: external "@splunk/ui-utils/style"
78
- const s = require("@splunk/ui-utils/style");
78
+ const c = require("@splunk/ui-utils/style");
79
79
  // CONCATENATED MODULE: external "styled-components"
80
80
  const p = require("styled-components");
81
81
  var u = e.n(p);
@@ -88,15 +88,15 @@
88
88
  var v = u().span.withConfig({
89
89
  displayName: "ButtonStyles__StyledIcon",
90
90
  componentId: "eqxqs2-0"
91
- })([ "display:flex;align-items:center;flex-shrink:0;font-size:", ";", ";" ], (0,
91
+ })([ "display:flex;align-items:center;flex-shrink:0;font-size:", ";", "" ], (0,
92
92
  m.pick)({
93
93
  enterprise: "inherit",
94
94
  prisma: {
95
95
  comfortable: "21px",
96
96
  compact: "16px"
97
97
  }
98
- }), (0, m.pickVariant)("$isIconOnly", {
99
- false: {
98
+ }), (0, m.pickVariant)("$isStartIcon", {
99
+ true: {
100
100
  enterprise: (0, p.css)([ "padding-right:3px;" ]),
101
101
  prisma: (0, p.css)([ "padding-right:8px;" ])
102
102
  }
@@ -104,7 +104,7 @@
104
104
  var y = u()(d()).withConfig({
105
105
  displayName: "ButtonStyles__StyledButtonSimple",
106
106
  componentId: "eqxqs2-1"
107
- })([ "text-align:center;vertical-align:middle;text-decoration:none;white-space:nowrap;flex-grow:1;min-width:0;max-width:100%;line-height:", ";min-height:", ";padding:", ";", " ", " &[data-inline]{display:inline-block;vertical-align:middle;", "}[data-inline] + &&[data-inline]{margin-bottom:0;", "}" ], m.variables.lineHeight, m.variables.inputHeight, (0,
107
+ })([ "text-decoration:none;white-space:nowrap;flex-grow:1;min-width:0;max-width:100%;line-height:", ";min-height:", ";padding:", ";", " ", " &[data-inline]{:where(:not(a)){display:inline-block;}:where(a){display:inline-flex;}vertical-align:middle;", "}[data-inline] + &&[data-inline]{margin-bottom:0;", "}" ], m.variables.lineHeight, m.variables.inputHeight, (0,
108
108
  m.pick)({
109
109
  enterprise: {
110
110
  comfortable: "5px 14px",
@@ -149,7 +149,7 @@
149
149
  var b = u().span.withConfig({
150
150
  displayName: "ButtonStyles__StyledContentWrapper",
151
151
  componentId: "eqxqs2-2"
152
- })([ "display:flex;flex-direction:row;justify-content:center;align-items:center;max-width:100%;padding:", ";" ], (0,
152
+ })([ "display:flex;flex-direction:row;justify-content:center;align-items:center;flex:1 0 auto;max-width:100%;box-sizing:border-box;padding:", ";" ], (0,
153
153
  m.pick)({
154
154
  enterprise: function e(t) {
155
155
  var n = t.$error;
@@ -164,7 +164,9 @@
164
164
  pill: "0",
165
165
  toggle: "0",
166
166
  // === default
167
- flat: "0"
167
+ flat: "0",
168
+ // === default
169
+ subtle: "0"
168
170
  });
169
171
  },
170
172
  prisma: (0, m.pickVariant)("$appearance", {
@@ -175,7 +177,8 @@
175
177
  pill: "1px 0",
176
178
  // === secondary
177
179
  toggle: "0",
178
- flat: "1px 0"
180
+ flat: "1px 0",
181
+ subtle: "1px 0"
179
182
  })
180
183
  }));
181
184
  var h = u().span.withConfig({
@@ -226,27 +229,20 @@
226
229
  /* harmony default export */ const C = O;
227
230
  // CONCATENATED MODULE: external "@splunk/react-icons/ArrowSquareTopRightInset"
228
231
  const q = require("@splunk/react-icons/ArrowSquareTopRightInset");
229
- var _ = e.n(q);
232
+ var $ = e.n(q);
230
233
  // CONCATENATED MODULE: external "@splunk/react-icons/enterprise/External"
231
- const $ = require("@splunk/react-icons/enterprise/External");
232
- var I = e.n($);
234
+ const _ = require("@splunk/react-icons/enterprise/External");
235
+ var I = e.n(_);
233
236
  // CONCATENATED MODULE: external "@splunk/ui-utils/i18n"
234
237
  const E = require("@splunk/ui-utils/i18n");
235
238
  // CONCATENATED MODULE: ./src/Button/icons/External.tsx
236
239
  var P = (0, E._)("Open externally");
237
240
  function j() {
238
- var e = (0, m.useSplunkTheme)(), t = e.isEnterprise, n = e.isCompact;
239
- var i = n ? "20px" : "24px";
241
+ var e = (0, m.useSplunkTheme)(), t = e.isEnterprise;
240
242
  return t ? r().createElement(I(), {
241
- screenReaderText: P,
242
- size: .8,
243
- style: {
244
- verticalAlign: "baseline"
245
- }
246
- }) : r().createElement(_(), {
247
- "aria-label": P,
248
- height: i,
249
- width: i
243
+ screenReaderText: P
244
+ }) : r().createElement($(), {
245
+ "aria-label": P
250
246
  }, r().createElement("title", null, P));
251
247
  }
252
248
  /* harmony default export */ const N = j;
@@ -327,16 +323,16 @@
327
323
  } else {
328
324
  i = r.apply(this, arguments);
329
325
  }
330
- return A(this, i);
326
+ return W(this, i);
331
327
  };
332
328
  }
333
- function A(e, t) {
329
+ function W(e, t) {
334
330
  if (t && (M(t) === "object" || typeof t === "function")) {
335
331
  return t;
336
332
  }
337
- return W(e);
333
+ return A(e);
338
334
  }
339
- function W(e) {
335
+ function A(e) {
340
336
  if (e === void 0) {
341
337
  throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
342
338
  }
@@ -374,7 +370,7 @@
374
370
  }
375
371
  var J = {
376
372
  action: a().string,
377
- appearance: a().oneOf([ "default", "secondary", "primary", "destructive", "pill", "toggle", "flat" ]),
373
+ appearance: a().oneOf([ "default", "secondary", "primary", "destructive", "pill", "toggle", "flat", "subtle" ]),
378
374
  append: a().bool,
379
375
  children: a().node,
380
376
  /** @private An additional className to add to the button. */
@@ -401,8 +397,7 @@
401
397
  inline: true,
402
398
  isMenu: false,
403
399
  openInNewContext: false,
404
- prepend: false,
405
- selected: false
400
+ prepend: false
406
401
  };
407
402
  var Q = function(e) {
408
403
  H(n, e);
@@ -412,8 +407,8 @@
412
407
  var r;
413
408
  R(this, n);
414
409
  r = t.call(this, e);
415
- G(W(r), "component", null);
416
- G(W(r), "handleClick", (function(e) {
410
+ G(A(r), "component", null);
411
+ G(A(r), "handleClick", (function(e) {
417
412
  var t = r.props, n = t.label, i = t.icon, a = t.value, o = t.action, l = t.onClick;
418
413
  l === null || l === void 0 ? void 0 : l(e, {
419
414
  label: n,
@@ -422,7 +417,7 @@
422
417
  action: o
423
418
  });
424
419
  }));
425
- G(W(r), "handleMount", (function(e) {
420
+ G(A(r), "handleMount", (function(e) {
426
421
  r.component = e;
427
422
  }));
428
423
  if (false) {}
@@ -440,13 +435,13 @@
440
435
  }, {
441
436
  key: "render",
442
437
  value: function e() {
443
- var t = this.props, n = t.action, i = t.appearance, a = t.append, o = t.className, c = t.classNamePrivate, p = t.disabled, u = t.error, f = t.icon, d = t.inline, m = t.isMenu, g = t.onClick, w = t.openInNewContext, k = t.prepend, S = t.to, O = t.value;
444
- var q = this.props, _ = q.children, $ = q.label;
445
- if (!$ && l()(_)) {
446
- $ = _;
447
- _ = null;
438
+ var t = this.props, n = t.action, i = t.appearance, a = t.append, o = t.className, s = t.classNamePrivate, p = t.disabled, u = t.error, f = t.icon, d = t.inline, m = t.isMenu, g = t.onClick, w = t.openInNewContext, k = t.prepend, S = t.to, O = t.value;
439
+ var q = this.props, $ = q.children, _ = q.label;
440
+ if (!_ && l()($)) {
441
+ _ = $;
442
+ $ = null;
448
443
  }
449
- var I = !!(f && !$ && !m && !_);
444
+ var I = !!(f && !_ && !m && !$);
450
445
  var E = S && w || m || !!f;
451
446
 
452
447
  return r().createElement(y, T({
@@ -454,7 +449,7 @@
454
449
  "aria-invalid": u || undefined,
455
450
  "data-test": "button"
456
451
  }, this.props, {
457
- className: (0, s.toClassName)(o, c),
452
+ className: (0, c.toClassName)(o, s),
458
453
  "data-action": n,
459
454
  "data-inline": d || null,
460
455
  disabled: p,
@@ -473,21 +468,23 @@
473
468
  $appearance: i,
474
469
  $error: u
475
470
  }, f && r().createElement(v, {
476
- $isIconOnly: I
477
- }, f), $ && r().createElement(h, {
471
+ $isStartIcon: !I
472
+ }, f), _ && r().createElement(h, {
478
473
  "data-test": "label",
479
474
  $isMenu: m
480
- }, $), _, m && r().createElement(x, {
475
+ }, _), $, m && r().createElement(x, {
481
476
  $disabled: p,
482
477
  $primary: i === "primary"
483
- }, r().createElement(C, null)), w && r().createElement(N, null)));
478
+ }, r().createElement(C, null)), w && r().createElement(v, {
479
+ $isStartIcon: false
480
+ }, r().createElement(N, null))));
484
481
  }
485
482
  } ]);
486
483
  return n;
487
484
  }(n.Component);
488
485
  G(Q, "propTypes", J);
489
486
  G(Q, "defaultProps", K);
490
- G(Q, c.legacyRefMode, true);
487
+ G(Q, s.legacyRefMode, true);
491
488
  /* harmony default export */ const U = Q;
492
489
  // CONCATENATED MODULE: ./src/Button/index.ts
493
490
  module.exports = t;