@splunk/react-ui 4.38.0 → 4.39.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 (136) hide show
  1. package/Accordion.js +131 -153
  2. package/Anchor.js +50 -58
  3. package/Animation.js +64 -59
  4. package/AnimationToggle.js +59 -61
  5. package/Box.js +59 -67
  6. package/Breadcrumbs.js +113 -127
  7. package/Button.js +151 -169
  8. package/ButtonGroup.js +41 -49
  9. package/ButtonSimple.js +264 -295
  10. package/CHANGELOG.md +28 -0
  11. package/Calendar.js +353 -414
  12. package/Card.js +183 -243
  13. package/CardLayout.js +86 -83
  14. package/Chip.js +104 -122
  15. package/Clickable.js +180 -198
  16. package/CloseButton.js +52 -60
  17. package/Code.js +24 -31
  18. package/CollapsiblePanel.js +172 -202
  19. package/Color.js +371 -412
  20. package/ColumnLayout.js +72 -96
  21. package/ComboBox.js +266 -303
  22. package/Concertina.js +406 -454
  23. package/ControlGroup.js +165 -194
  24. package/Date.js +116 -131
  25. package/DefinitionList.js +125 -149
  26. package/Divider.js +81 -79
  27. package/Dropdown.js +226 -237
  28. package/DualListbox.js +150 -186
  29. package/EventListener.js +4 -1
  30. package/File.js +1032 -955
  31. package/FormRows.js +281 -334
  32. package/Heading.js +27 -35
  33. package/Image.js +101 -116
  34. package/JSONTree.js +301 -344
  35. package/Layer.js +118 -126
  36. package/Link.js +141 -159
  37. package/List.js +61 -77
  38. package/MIGRATION.mdx +92 -38
  39. package/Markdown.js +288 -347
  40. package/Menu.js +506 -532
  41. package/Message.js +173 -196
  42. package/MessageBar.js +58 -66
  43. package/Modal.js +241 -290
  44. package/ModalLayer.js +130 -148
  45. package/Monogram.js +138 -138
  46. package/Multiselect.js +1589 -1902
  47. package/Number.js +159 -178
  48. package/Paginator.js +296 -335
  49. package/Paragraph.js +24 -32
  50. package/Popover.js +448 -441
  51. package/Progress.js +65 -75
  52. package/RadioBar.js +301 -303
  53. package/RadioList.js +77 -119
  54. package/Resize.js +105 -127
  55. package/ResultsMenu.js +373 -385
  56. package/ScreenReaderContent.js +50 -58
  57. package/Scroll.js +209 -244
  58. package/Search.js +379 -391
  59. package/Select.js +1077 -1345
  60. package/SidePanel.js +122 -142
  61. package/Slider.js +132 -145
  62. package/SlidingPanels.js +238 -270
  63. package/SplitButton.js +222 -245
  64. package/StaticContent.js +68 -76
  65. package/StepBar.js +206 -205
  66. package/Switch.js +176 -205
  67. package/TabBar.js +222 -258
  68. package/TabLayout.js +114 -139
  69. package/Table.js +2017 -2180
  70. package/Text.js +379 -493
  71. package/TextArea.js +411 -441
  72. package/Tooltip.js +116 -132
  73. package/TransitionOpen.js +160 -178
  74. package/Tree.js +268 -287
  75. package/Typography.js +48 -52
  76. package/WaitSpinner.js +60 -68
  77. package/cypress/support/commands.ts +9 -0
  78. package/cypress/support/index.d.ts +6 -0
  79. package/cypress/tsconfig.cypress.json +1 -0
  80. package/docker-compose.yml +0 -1
  81. package/package.json +14 -14
  82. package/types/src/Button/Button.d.ts +5 -1
  83. package/types/src/ButtonSimple/ButtonSimple.d.ts +2 -2
  84. package/types/src/CollapsiblePanel/CollapsiblePanel.d.ts +1 -1
  85. package/types/src/Color/Color.d.ts +2 -2
  86. package/types/src/Color/Palette.d.ts +4 -2
  87. package/types/src/ComboBox/Option.d.ts +1 -1
  88. package/types/src/ControlGroup/ControlGroup.d.ts +1 -2
  89. package/types/src/Date/Date.d.ts +2 -2
  90. package/types/src/File/File.d.ts +2 -3
  91. package/types/src/File/Retry.d.ts +1 -2
  92. package/types/src/Menu/Item.d.ts +18 -5
  93. package/types/src/Menu/Menu.d.ts +3 -3
  94. package/types/src/Menu/docs/examples/Adornments.d.ts +2 -0
  95. package/types/src/Menu/docs/examples/SelectableWithAdornments.d.ts +2 -0
  96. package/types/src/ModalLayer/ModalLayer.d.ts +1 -1
  97. package/types/src/Multiselect/Option.d.ts +2 -0
  98. package/types/src/Number/Number.d.ts +3 -3
  99. package/types/src/Popover/Popover.d.ts +3 -4
  100. package/types/src/RadioBar/RadioBar.d.ts +2 -2
  101. package/types/src/ResultsMenu/VirtualizedResultsMenu/VirtualizedResultsMenu.d.ts +1 -1
  102. package/types/src/ScrollContainerContext/ScrollContainerContext.d.ts +2 -2
  103. package/types/src/Search/Option.d.ts +9 -3
  104. package/types/src/Select/Option.d.ts +3 -1
  105. package/types/src/Select/OptionBase.d.ts +7 -5
  106. package/types/src/Select/Select.d.ts +1 -1
  107. package/types/src/Select/SelectAllOption.d.ts +4 -4
  108. package/types/src/SidePanel/SidePanel.d.ts +1 -1
  109. package/types/src/Slider/Slider.d.ts +2 -2
  110. package/types/src/SlidingPanels/SlidingPanels.d.ts +1 -1
  111. package/types/src/StepBar/Step.d.ts +1 -2
  112. package/types/src/Switch/Switch.d.ts +0 -1
  113. package/types/src/TabBar/Tab.d.ts +1 -1
  114. package/types/src/TabBar/TabBar.d.ts +3 -1
  115. package/types/src/TabLayout/TabLayout.d.ts +2 -0
  116. package/types/src/Table/HeadDropdownCell.d.ts +2 -0
  117. package/types/src/Table/Table.d.ts +0 -1
  118. package/types/src/Table/docs/examples/StripeRows.d.ts +2 -0
  119. package/types/src/Text/IconOutlinedHide.d.ts +1 -2
  120. package/types/src/Text/IconOutlinedView.d.ts +1 -2
  121. package/types/src/Text/Text.d.ts +2 -2
  122. package/types/src/TextArea/TextArea.d.ts +2 -2
  123. package/types/src/Tooltip/Tooltip.d.ts +4 -4
  124. package/types/src/TransitionOpen/TransitionOpen.d.ts +1 -1
  125. package/useForceUpdate.js +30 -32
  126. package/useKeyPress.js +1 -1
  127. package/types/src/ButtonGroup/docs/examples/prisma/Basic.d.ts +0 -1
  128. package/types/src/File/docs/examples/prisma/Error.d.ts +0 -1
  129. package/types/src/Menu/docs/examples/Icons.d.ts +0 -2
  130. package/types/src/Menu/docs/examples/SelectableWithIcons.d.ts +0 -2
  131. package/types/src/TabBar/docs/examples/prisma/Context.d.ts +0 -2
  132. package/types/src/TabLayout/docs/examples/prisma/Context.d.ts +0 -2
  133. package/types/src/Table/docs/examples/prisma/Basic.d.ts +0 -2
  134. /package/types/src/Message/docs/examples/{prisma/Title.d.ts → Title.d.ts} +0 -0
  135. /package/types/src/StepBar/docs/examples/{prisma/Error.d.ts → Error.d.ts} +0 -0
  136. /package/types/src/TabBar/docs/examples/{prisma/Disabled.d.ts → Disabled.d.ts} +0 -0
package/Button.js CHANGED
@@ -61,22 +61,22 @@
61
61
  e.r(t);
62
62
  // EXPORTS
63
63
  e.d(t, {
64
- default: () => /* reexport */ Y
64
+ default: () => /* reexport */ ee
65
65
  });
66
66
  // CONCATENATED MODULE: external "react"
67
67
  const n = require("react");
68
68
  var r = e.n(n);
69
69
  // CONCATENATED MODULE: external "prop-types"
70
70
  const i = require("prop-types");
71
- var a = e.n(i);
71
+ var o = e.n(i);
72
72
  // CONCATENATED MODULE: external "lodash/isString"
73
- const o = require("lodash/isString");
74
- var l = e.n(o);
73
+ const a = require("lodash/isString");
74
+ var l = e.n(a);
75
75
  // CONCATENATED MODULE: external "@splunk/react-ui/Dropdown"
76
- const s = require("@splunk/react-ui/Dropdown");
76
+ const c = require("@splunk/react-ui/Dropdown");
77
77
  // CONCATENATED MODULE: external "@splunk/react-ui/ScreenReaderContent"
78
- const c = require("@splunk/react-ui/ScreenReaderContent");
79
- var p = e.n(c);
78
+ const s = require("@splunk/react-ui/ScreenReaderContent");
79
+ var p = e.n(s);
80
80
  // CONCATENATED MODULE: external "@splunk/ui-utils/i18n"
81
81
  const u = require("@splunk/ui-utils/i18n");
82
82
  // CONCATENATED MODULE: external "@splunk/ui-utils/style"
@@ -86,31 +86,31 @@
86
86
  var m = e.n(d);
87
87
  // CONCATENATED MODULE: external "@splunk/react-ui/ButtonSimple"
88
88
  const v = require("@splunk/react-ui/ButtonSimple");
89
- var y = e.n(v);
89
+ var b = e.n(v);
90
90
  // CONCATENATED MODULE: external "@splunk/themes"
91
- const b = require("@splunk/themes");
91
+ const y = require("@splunk/themes");
92
92
  // CONCATENATED MODULE: ./src/Button/ButtonStyles.ts
93
93
  var h = m().span.withConfig({
94
94
  displayName: "ButtonStyles__StyledIcon",
95
95
  componentId: "eqxqs2-0"
96
96
  })([ "display:flex;align-items:center;flex-shrink:0;font-size:", ";", "" ], (0,
97
- b.pick)({
97
+ y.pick)({
98
98
  enterprise: "inherit",
99
99
  prisma: {
100
100
  comfortable: "21px",
101
101
  compact: "16px"
102
102
  }
103
- }), (0, b.pickVariant)("$isStartIcon", {
103
+ }), (0, y.pickVariant)("$isStartIcon", {
104
104
  true: {
105
105
  enterprise: (0, d.css)([ "padding-right:3px;" ]),
106
106
  prisma: (0, d.css)([ "padding-right:8px;" ])
107
107
  }
108
108
  }));
109
- var x = m()(y()).withConfig({
109
+ var x = m()(b()).withConfig({
110
110
  displayName: "ButtonStyles__StyledButtonSimple",
111
111
  componentId: "eqxqs2-1"
112
- })([ "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]{:where(:not(a)){display:inline-block;}:where(a){display:inline-flex;}", "}[data-inline] + &&[data-inline]{margin-bottom:0;", "}" ], b.variables.lineHeight, b.variables.inputHeight, (0,
113
- b.pick)({
112
+ })([ "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]{:where(:not(a)){display:inline-block;}:where(a){display:inline-flex;}", "}[data-inline] + &&[data-inline]{margin-bottom:0;", "}" ], y.variables.lineHeight, y.variables.inputHeight, (0,
113
+ y.pick)({
114
114
  enterprise: {
115
115
  comfortable: "5px 14px",
116
116
  compact: "2px 14px"
@@ -131,34 +131,34 @@
131
131
  }), (function(e) {
132
132
  var t = e.$isIconOnly;
133
133
  return t && (0, d.css)([ "box-sizing:border-box;", ";width:", ";min-width:", ";" ], (0,
134
- b.pick)({
134
+ y.pick)({
135
135
  enterprise: {
136
136
  comfortable: (0, d.css)([ "padding:0 5px;" ]),
137
137
  compact: (0, d.css)([ "padding:0 2px;" ])
138
138
  },
139
139
  prisma: {
140
- comfortable: (0, d.css)([ "padding:0 calc(", " / 2 - 1px);" ], b.variables.inputHeight),
141
- compact: (0, d.css)([ "padding:0 calc(", " / 2 - 1px);" ], b.variables.inputHeight)
140
+ comfortable: (0, d.css)([ "padding:0 calc(", " / 2 - 1px);" ], y.variables.inputHeight),
141
+ compact: (0, d.css)([ "padding:0 calc(", " / 2 - 1px);" ], y.variables.inputHeight)
142
142
  }
143
- }), b.variables.inputHeight, b.variables.inputHeight);
143
+ }), y.variables.inputHeight, y.variables.inputHeight);
144
144
  }), (function(e) {
145
145
  var t = e.$isIconOnly;
146
146
  return t ? null : (0, d.css)([ "width:auto;" ]);
147
147
  }), (function(e) {
148
148
  var t = e.prepend;
149
- return !t && (0, d.css)([ "margin-left:", ";" ], b.variables.spacingSmall);
149
+ return !t && (0, d.css)([ "margin-left:", ";" ], y.variables.spacingSmall);
150
150
  }));
151
151
  var g = m().span.withConfig({
152
152
  displayName: "ButtonStyles__StyledContentWrapper",
153
153
  componentId: "eqxqs2-2"
154
154
  })([ "display:flex;flex-direction:row;justify-content:center;align-items:center;flex:1 0 auto;max-width:100%;box-sizing:border-box;padding:", ";" ], (0,
155
- b.pick)({
155
+ y.pick)({
156
156
  enterprise: function e(t) {
157
157
  var n = t.$error;
158
158
  if (n) {
159
159
  return "1px";
160
160
  }
161
- return (0, b.pickVariant)("$appearance", {
161
+ return (0, y.pickVariant)("$appearance", {
162
162
  default: "0",
163
163
  secondary: "0",
164
164
  destructive: "1px",
@@ -171,7 +171,7 @@
171
171
  subtle: "0"
172
172
  });
173
173
  },
174
- prisma: (0, b.pickVariant)("$appearance", {
174
+ prisma: (0, y.pickVariant)("$appearance", {
175
175
  default: 0,
176
176
  secondary: "1px 0",
177
177
  primary: "1px 0",
@@ -187,7 +187,7 @@
187
187
  displayName: "ButtonStyles__StyledLabel",
188
188
  componentId: "eqxqs2-3"
189
189
  })([ "text-overflow:ellipsis;overflow:hidden;flex:0 1 auto;&:not(:last-child){padding-right:", ";}", "" ], (0,
190
- b.pick)({
190
+ y.pick)({
191
191
  enterprise: "3px",
192
192
  prisma: "10px"
193
193
  }), (function(e) {
@@ -197,15 +197,11 @@
197
197
  var S = m().span.withConfig({
198
198
  displayName: "ButtonStyles__StyledCaretWrapper",
199
199
  componentId: "eqxqs2-4"
200
- })([ "display:inline-flex;", "" ], (0, b.pickVariant)("$disabled", {
200
+ })([ "display:inline-flex;", "" ], (0, y.pickVariant)("$disabled", {
201
201
  false: {
202
- prisma: (0, b.pickVariant)("$primary", {
203
- true: (0, d.css)([ "color:", ";" ], b.variables.contentColorInverted),
204
- false: (0, d.css)([ "color:", ";", ":hover > * > &,", ":active > * > &,{color:", ";}" ], b.variables.contentColorDefault,
205
- /* sc-sel */
206
- x,
207
- /* sc-sel */
208
- x, b.variables.contentColorDefault)
202
+ prisma: (0, y.pickVariant)("$primary", {
203
+ true: (0, d.css)([ "color:", ";" ], y.variables.contentColorInverted),
204
+ false: (0, d.css)([ "color:", ";", ":hover > * > &,", ":active > * > &,{color:", ";}" ], y.variables.contentColorDefault, /* sc-sel */ x, /* sc-sel */ x, y.variables.contentColorDefault)
209
205
  })
210
206
  }
211
207
  }));
@@ -217,176 +213,161 @@
217
213
  var q = e.n(C);
218
214
  // CONCATENATED MODULE: ./src/Button/icons/CaretSmallDown.tsx
219
215
  var $ = function e() {
220
- var t = (0, b.useSplunkTheme)(), n = t.isEnterprise, i = t.isCompact;
221
- var a = i ? "20px" : "24px";
216
+ var t = (0, y.useSplunkTheme)(), n = t.isEnterprise, i = t.isCompact;
217
+ var o = i ? "20px" : "24px";
222
218
  return n ? r().createElement(q(), {
223
219
  screenReaderText: null,
224
220
  hideDefaultTooltip: true,
225
221
  size: .5
226
222
  }) : r().createElement(O(), {
227
- height: a,
228
- width: a
223
+ height: o,
224
+ width: o
229
225
  });
230
226
  };
231
227
  /* harmony default export */ const _ = $;
232
228
  // CONCATENATED MODULE: external "@splunk/react-icons/ArrowSquareTopRightInset"
233
- const I = require("@splunk/react-icons/ArrowSquareTopRightInset");
234
- var E = e.n(I);
229
+ const j = require("@splunk/react-icons/ArrowSquareTopRightInset");
230
+ var E = e.n(j);
235
231
  // CONCATENATED MODULE: external "@splunk/react-icons/enterprise/External"
236
232
  const P = require("@splunk/react-icons/enterprise/External");
237
- var j = e.n(P);
233
+ var I = e.n(P);
238
234
  // CONCATENATED MODULE: ./src/Button/icons/External.tsx
239
- function N() {
240
- var e = (0, b.useSplunkTheme)(), t = e.isEnterprise;
241
- return t ? r().createElement(j(), {
235
+ function T() {
236
+ var e = (0, y.useSplunkTheme)(), t = e.isEnterprise;
237
+ return t ? r().createElement(I(), {
242
238
  screenReaderText: null
243
239
  }) : r().createElement(E(), null);
244
240
  }
245
- /* harmony default export */ const T = N;
241
+ /* harmony default export */ const N = T;
246
242
  // CONCATENATED MODULE: ./src/Button/Button.tsx
247
243
  function M(e) {
248
244
  "@babel/helpers - typeof";
249
- if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
250
- M = function e(t) {
251
- return typeof t;
252
- };
253
- } else {
254
- M = function e(t) {
255
- return t && typeof Symbol === "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
256
- };
257
- }
258
- return M(e);
245
+ return M = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e) {
246
+ return typeof e;
247
+ } : function(e) {
248
+ return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
249
+ }, M(e);
259
250
  }
260
- function R() {
261
- R = Object.assign || function(e) {
251
+ function B() {
252
+ return B = Object.assign ? Object.assign.bind() : function(e) {
262
253
  for (var t = 1; t < arguments.length; t++) {
263
254
  var n = arguments[t];
264
255
  for (var r in n) {
265
- if (Object.prototype.hasOwnProperty.call(n, r)) {
266
- e[r] = n[r];
267
- }
256
+ ({}).hasOwnProperty.call(n, r) && (e[r] = n[r]);
268
257
  }
269
258
  }
270
259
  return e;
271
- };
272
- return R.apply(this, arguments);
260
+ }, B.apply(null, arguments);
273
261
  }
274
- function B(e, t) {
275
- if (!(e instanceof t)) {
276
- throw new TypeError("Cannot call a class as a function");
277
- }
262
+ function R(e, t) {
263
+ if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function");
278
264
  }
279
265
  function D(e, t) {
280
266
  for (var n = 0; n < t.length; n++) {
281
267
  var r = t[n];
282
- r.enumerable = r.enumerable || false;
283
- r.configurable = true;
284
- if ("value" in r) r.writable = true;
285
- Object.defineProperty(e, r.key, r);
268
+ r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0),
269
+ Object.defineProperty(e, K(r.key), r);
286
270
  }
287
271
  }
288
272
  function H(e, t, n) {
289
- if (t) D(e.prototype, t);
290
- if (n) D(e, n);
291
- return e;
273
+ return t && D(e.prototype, t), n && D(e, n), Object.defineProperty(e, "prototype", {
274
+ writable: !1
275
+ }), e;
292
276
  }
293
277
  function V(e, t) {
294
- if (typeof t !== "function" && t !== null) {
295
- throw new TypeError("Super expression must either be null or a function");
296
- }
278
+ if ("function" != typeof t && null !== t) throw new TypeError("Super expression must either be null or a function");
297
279
  e.prototype = Object.create(t && t.prototype, {
298
280
  constructor: {
299
281
  value: e,
300
- writable: true,
301
- configurable: true
282
+ writable: !0,
283
+ configurable: !0
302
284
  }
303
- });
304
- if (t) z(e, t);
285
+ }), Object.defineProperty(e, "prototype", {
286
+ writable: !1
287
+ }), t && z(e, t);
305
288
  }
306
289
  function z(e, t) {
307
- z = Object.setPrototypeOf || function e(t, n) {
308
- t.__proto__ = n;
309
- return t;
310
- };
311
- return z(e, t);
290
+ return z = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(e, t) {
291
+ return e.__proto__ = t, e;
292
+ }, z(e, t);
312
293
  }
313
294
  function W(e) {
314
295
  var t = F();
315
- return function n() {
316
- var r = G(e), i;
296
+ return function() {
297
+ var n, r = G(e);
317
298
  if (t) {
318
- var a = G(this).constructor;
319
- i = Reflect.construct(r, arguments, a);
320
- } else {
321
- i = r.apply(this, arguments);
322
- }
323
- return A(this, i);
299
+ var i = G(this).constructor;
300
+ n = Reflect.construct(r, arguments, i);
301
+ } else n = r.apply(this, arguments);
302
+ return A(this, n);
324
303
  };
325
304
  }
326
305
  function A(e, t) {
327
- if (t && (M(t) === "object" || typeof t === "function")) {
328
- return t;
329
- }
306
+ if (t && ("object" == M(t) || "function" == typeof t)) return t;
307
+ if (void 0 !== t) throw new TypeError("Derived constructors may only return object or undefined");
330
308
  return L(e);
331
309
  }
332
310
  function L(e) {
333
- if (e === void 0) {
334
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
335
- }
311
+ if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
336
312
  return e;
337
313
  }
338
314
  function F() {
339
- if (typeof Reflect === "undefined" || !Reflect.construct) return false;
340
- if (Reflect.construct.sham) return false;
341
- if (typeof Proxy === "function") return true;
342
315
  try {
343
- Date.prototype.toString.call(Reflect.construct(Date, [], (function() {})));
344
- return true;
345
- } catch (e) {
346
- return false;
347
- }
316
+ var e = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], (function() {})));
317
+ } catch (e) {}
318
+ return (F = function t() {
319
+ return !!e;
320
+ })();
348
321
  }
349
322
  function G(e) {
350
- G = Object.setPrototypeOf ? Object.getPrototypeOf : function e(t) {
351
- return t.__proto__ || Object.getPrototypeOf(t);
352
- };
353
- return G(e);
323
+ return G = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(e) {
324
+ return e.__proto__ || Object.getPrototypeOf(e);
325
+ }, G(e);
354
326
  }
355
327
  function J(e, t, n) {
356
- if (t in e) {
357
- Object.defineProperty(e, t, {
358
- value: n,
359
- enumerable: true,
360
- configurable: true,
361
- writable: true
362
- });
363
- } else {
364
- e[t] = n;
328
+ return (t = K(t)) in e ? Object.defineProperty(e, t, {
329
+ value: n,
330
+ enumerable: !0,
331
+ configurable: !0,
332
+ writable: !0
333
+ }) : e[t] = n, e;
334
+ }
335
+ function K(e) {
336
+ var t = Q(e, "string");
337
+ return "symbol" == M(t) ? t : t + "";
338
+ }
339
+ function Q(e, t) {
340
+ if ("object" != M(e) || !e) return e;
341
+ var n = e[Symbol.toPrimitive];
342
+ if (void 0 !== n) {
343
+ var r = n.call(e, t || "default");
344
+ if ("object" != M(r)) return r;
345
+ throw new TypeError("@@toPrimitive must return a primitive value.");
365
346
  }
366
- return e;
347
+ return ("string" === t ? String : Number)(e);
367
348
  }
368
- var K = {
369
- action: a().string,
370
- appearance: a().oneOf([ "default", "secondary", "primary", "destructive", "pill", "toggle", "flat", "subtle" ]),
371
- append: a().bool,
372
- children: a().node,
349
+ /** @public */ var U = {
350
+ action: o().string,
351
+ appearance: o().oneOf([ "default", "secondary", "primary", "destructive", "pill", "toggle", "flat", "subtle" ]),
352
+ append: o().bool,
353
+ children: o().node,
373
354
  /** @private An additional className to add to the button. */
374
- classNamePrivate: a().string,
375
- disabled: a().oneOfType([ a().bool, a().oneOf([ "dimmed" ]) ]),
376
- elementRef: a().oneOfType([ a().func, a().object ]),
377
- error: a().bool,
378
- icon: a().node,
379
- inline: a().bool,
380
- isMenu: a().bool,
381
- label: a().node,
382
- onClick: a().func,
383
- openInNewContext: a().oneOfType([ a().bool, a().string ]),
384
- prepend: a().bool,
385
- selected: a().bool,
386
- to: a().string,
387
- value: a().any
355
+ classNamePrivate: o().string,
356
+ disabled: o().oneOfType([ o().bool, o().oneOf([ "dimmed" ]) ]),
357
+ elementRef: o().oneOfType([ o().func, o().object ]),
358
+ error: o().bool,
359
+ icon: o().node,
360
+ inline: o().bool,
361
+ isMenu: o().bool,
362
+ label: o().node,
363
+ onClick: o().func,
364
+ openInNewContext: o().oneOfType([ o().bool, o().string ]),
365
+ prepend: o().bool,
366
+ selected: o().bool,
367
+ to: o().string,
368
+ value: o().any
388
369
  };
389
- var Q = {
370
+ var X = {
390
371
  appearance: "default",
391
372
  append: false,
392
373
  disabled: false,
@@ -396,23 +377,23 @@
396
377
  openInNewContext: false,
397
378
  prepend: false
398
379
  };
399
- var U = (0, u._)("(Opens new window)");
400
- var X = function(e) {
380
+ var Y = (0, u._)("(Opens new window)");
381
+ var Z = function(e) {
401
382
  V(n, e);
402
383
  var t = W(n);
403
384
  // @docs-props-type ButtonPropsBase
404
385
  function n(e) {
405
386
  var r;
406
- B(this, n);
387
+ R(this, n);
407
388
  r = t.call(this, e);
408
389
  J(L(r), "component", null);
409
390
  J(L(r), "handleClick", (function(e) {
410
- var t = r.props, n = t.label, i = t.icon, a = t.value, o = t.action, l = t.onClick;
391
+ var t = r.props, n = t.label, i = t.icon, o = t.value, a = t.action, l = t.onClick;
411
392
  l === null || l === void 0 ? void 0 : l(e, {
412
393
  label: n,
413
394
  icon: i,
414
- value: a,
415
- action: o
395
+ value: o,
396
+ action: a
416
397
  });
417
398
  }));
418
399
  J(L(r), "handleMount", (function(e) {
@@ -426,6 +407,7 @@
426
407
  /**
427
408
  * Places focus on the button.
428
409
  */
410
+ // eslint-disable-next-line react/no-unused-class-component-methods
429
411
  value: function e() {
430
412
  var t;
431
413
  (t = this.component) === null || t === void 0 ? void 0 : t.focus();
@@ -433,38 +415,38 @@
433
415
  }, {
434
416
  key: "render",
435
417
  value: function e() {
436
- var t = this.props, n = t.action, i = t.appearance, a = t.append, o = t.className, s = t.classNamePrivate, c = t.disabled, u = t.error, d = t.icon, m = t.inline, v = t.isMenu, y = t.onClick, b = t.openInNewContext, k = t.prepend, O = t.to, C = t.value;
437
- var q = this.props, $ = q.children, I = q.label;
438
- if (!I && l()($)) {
439
- I = $;
418
+ var t = this.props, n = t.action, i = t.appearance, o = t.append, a = t.className, c = t.classNamePrivate, s = t.disabled, u = t.error, d = t.icon, m = t.inline, v = t.isMenu, b = t.onClick, y = t.openInNewContext, k = t.prepend, O = t.to, C = t.value;
419
+ var q = this.props, $ = q.children, j = q.label;
420
+ if (!j && l()($)) {
421
+ j = $;
440
422
  $ = null;
441
423
  }
442
424
  var E = false;
443
425
  var P;
444
- if (b) {
426
+ if (y) {
445
427
  E = true;
446
- P = typeof b === "string" ? b : U;
428
+ P = typeof y === "string" ? y : Y;
447
429
  }
448
- var j = !!(d && !I && !v && !$);
449
- var N = O && E || v || !!d;
430
+ var I = !!(d && !j && !v && !$);
431
+ var T = O && E || v || !!d;
450
432
 
451
- return r().createElement(x, R({
433
+ return r().createElement(x, B({
452
434
  "aria-haspopup": v || undefined,
453
435
  "aria-invalid": u || undefined,
454
436
  "data-test": "button"
455
437
  }, this.props, {
456
- className: (0, f.toClassName)(o, s),
438
+ className: (0, f.toClassName)(a, c),
457
439
  "data-action": n,
458
440
  "data-inline": m || null,
459
- disabled: c,
460
- append: a,
441
+ disabled: s,
442
+ append: o,
461
443
  prepend: k,
462
444
  $inline: m,
463
- $hasPrismaIcon: N,
464
- $isIconOnly: j,
445
+ $hasPrismaIcon: T,
446
+ $isIconOnly: I,
465
447
  $isMenu: v,
466
448
  value: C,
467
- onClick: y ? this.handleClick : undefined,
449
+ onClick: b ? this.handleClick : undefined,
468
450
  ref: this.handleMount,
469
451
  openInNewContext: E,
470
452
  appearance: i
@@ -472,24 +454,24 @@
472
454
  $appearance: i,
473
455
  $error: u
474
456
  }, d && r().createElement(h, {
475
- $isStartIcon: !j
476
- }, d), I && r().createElement(w, {
457
+ $isStartIcon: !I
458
+ }, d), j && r().createElement(w, {
477
459
  "data-test": "label",
478
460
  $isMenu: v
479
- }, I), $, v && r().createElement(S, {
480
- $disabled: c,
461
+ }, j), $, v && r().createElement(S, {
462
+ $disabled: s,
481
463
  $primary: i === "primary"
482
- }, r().createElement(_, null)), b && r().createElement(h, {
464
+ }, r().createElement(_, null)), y && r().createElement(h, {
483
465
  $isStartIcon: false
484
- }, r().createElement(T, null), r().createElement(p(), null, P))));
466
+ }, r().createElement(N, null), r().createElement(p(), null, P))));
485
467
  }
486
468
  } ]);
487
469
  return n;
488
470
  }(n.Component);
489
- J(X, "propTypes", K);
490
- J(X, "defaultProps", Q);
491
- J(X, s.legacyRefMode, true);
492
- /* harmony default export */ const Y = X;
471
+ J(Z, "propTypes", U);
472
+ J(Z, "defaultProps", X);
473
+ J(Z, c.legacyRefMode, true);
474
+ /* harmony default export */ const ee = Z;
493
475
  // CONCATENATED MODULE: ./src/Button/index.ts
494
476
  module.exports = t;
495
477
  /******/})();