@splunk/react-ui 4.37.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 (142) 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 +208 -219
  8. package/ButtonGroup.js +41 -49
  9. package/ButtonSimple.js +264 -295
  10. package/CHANGELOG.md +50 -1
  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 +1107 -980
  20. package/ColumnLayout.js +72 -96
  21. package/ComboBox.js +267 -305
  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 +512 -530
  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 +1600 -1923
  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 +130 -94
  57. package/Scroll.js +209 -244
  58. package/Search.js +375 -384
  59. package/Select.js +1076 -1354
  60. package/SidePanel.js +122 -142
  61. package/Slider.js +192 -222
  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 +211 -236
  67. package/TabBar.js +222 -258
  68. package/TabLayout.js +114 -139
  69. package/Table.js +2017 -2180
  70. package/Text.js +401 -512
  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 +17 -17
  82. package/types/src/Button/Button.d.ts +20 -6
  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 +5 -2
  86. package/types/src/Color/Palette.d.ts +6 -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 -3
  90. package/types/src/File/File.d.ts +2 -3
  91. package/types/src/File/Retry.d.ts +1 -2
  92. package/types/src/Link/Link.d.ts +3 -4
  93. package/types/src/Menu/Item.d.ts +24 -8
  94. package/types/src/Menu/Menu.d.ts +3 -3
  95. package/types/src/Menu/docs/examples/Adornments.d.ts +2 -0
  96. package/types/src/Menu/docs/examples/SelectableWithAdornments.d.ts +2 -0
  97. package/types/src/ModalLayer/ModalLayer.d.ts +1 -1
  98. package/types/src/Multiselect/Option.d.ts +2 -0
  99. package/types/src/Number/Number.d.ts +3 -3
  100. package/types/src/Popover/Popover.d.ts +3 -4
  101. package/types/src/RadioBar/RadioBar.d.ts +2 -2
  102. package/types/src/ResultsMenu/VirtualizedResultsMenu/VirtualizedResultsMenu.d.ts +1 -1
  103. package/types/src/ScrollContainerContext/ScrollContainerContext.d.ts +2 -2
  104. package/types/src/Search/Option.d.ts +16 -3
  105. package/types/src/Select/Option.d.ts +3 -1
  106. package/types/src/Select/OptionBase.d.ts +7 -5
  107. package/types/src/Select/Select.d.ts +2 -2
  108. package/types/src/Select/SelectAllOption.d.ts +4 -4
  109. package/types/src/Select/SelectBase.d.ts +0 -1
  110. package/types/src/SidePanel/SidePanel.d.ts +1 -1
  111. package/types/src/Slider/Slider.d.ts +2 -3
  112. package/types/src/Slider/docs/examples/Error.d.ts +2 -0
  113. package/types/src/SlidingPanels/SlidingPanels.d.ts +1 -1
  114. package/types/src/StepBar/Step.d.ts +1 -2
  115. package/types/src/TabBar/Tab.d.ts +1 -1
  116. package/types/src/TabBar/TabBar.d.ts +3 -1
  117. package/types/src/TabLayout/TabLayout.d.ts +2 -0
  118. package/types/src/Table/HeadDropdownCell.d.ts +2 -0
  119. package/types/src/Table/Table.d.ts +0 -1
  120. package/types/src/Table/docs/examples/StripeRows.d.ts +2 -0
  121. package/types/src/Text/IconOutlinedHide.d.ts +1 -2
  122. package/types/src/Text/IconOutlinedView.d.ts +1 -2
  123. package/types/src/Text/Text.d.ts +6 -4
  124. package/types/src/Text/docs/examples/Dimmed.d.ts +2 -0
  125. package/types/src/TextArea/TextArea.d.ts +2 -2
  126. package/types/src/Tooltip/Tooltip.d.ts +4 -4
  127. package/types/src/TransitionOpen/TransitionOpen.d.ts +1 -1
  128. package/useForceUpdate.js +30 -32
  129. package/useKeyPress.js +1 -1
  130. package/types/src/Button/docs/examples/Selected.d.ts +0 -2
  131. package/types/src/ButtonGroup/docs/examples/prisma/Basic.d.ts +0 -1
  132. package/types/src/File/docs/examples/prisma/Error.d.ts +0 -1
  133. package/types/src/Menu/docs/examples/Icons.d.ts +0 -2
  134. package/types/src/Menu/docs/examples/SelectableWithIcons.d.ts +0 -2
  135. package/types/src/Slider/docs/examples/prisma/Error.d.ts +0 -2
  136. package/types/src/TabBar/docs/examples/prisma/Context.d.ts +0 -2
  137. package/types/src/TabLayout/docs/examples/prisma/Context.d.ts +0 -2
  138. package/types/src/Table/docs/examples/prisma/Basic.d.ts +0 -2
  139. /package/types/src/Date/docs/examples/{prisma/WithoutCalendar.d.ts → WithoutCalendar.d.ts} +0 -0
  140. /package/types/src/Message/docs/examples/{prisma/Title.d.ts → Title.d.ts} +0 -0
  141. /package/types/src/StepBar/docs/examples/{prisma/Error.d.ts → Error.d.ts} +0 -0
  142. /package/types/src/TabBar/docs/examples/{prisma/Disabled.d.ts → Disabled.d.ts} +0 -0
package/Button.js CHANGED
@@ -61,51 +61,56 @@
61
61
  e.r(t);
62
62
  // EXPORTS
63
63
  e.d(t, {
64
- default: () => /* reexport */ U
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
+ // CONCATENATED MODULE: external "@splunk/react-ui/ScreenReaderContent"
78
+ const s = require("@splunk/react-ui/ScreenReaderContent");
79
+ var p = e.n(s);
80
+ // CONCATENATED MODULE: external "@splunk/ui-utils/i18n"
81
+ const u = require("@splunk/ui-utils/i18n");
77
82
  // CONCATENATED MODULE: external "@splunk/ui-utils/style"
78
- const c = require("@splunk/ui-utils/style");
83
+ const f = require("@splunk/ui-utils/style");
79
84
  // CONCATENATED MODULE: external "styled-components"
80
- const p = require("styled-components");
81
- var u = e.n(p);
85
+ const d = require("styled-components");
86
+ var m = e.n(d);
82
87
  // CONCATENATED MODULE: external "@splunk/react-ui/ButtonSimple"
83
- const f = require("@splunk/react-ui/ButtonSimple");
84
- var d = e.n(f);
88
+ const v = require("@splunk/react-ui/ButtonSimple");
89
+ var b = e.n(v);
85
90
  // CONCATENATED MODULE: external "@splunk/themes"
86
- const m = require("@splunk/themes");
91
+ const y = require("@splunk/themes");
87
92
  // CONCATENATED MODULE: ./src/Button/ButtonStyles.ts
88
- var y = u().span.withConfig({
93
+ var h = m().span.withConfig({
89
94
  displayName: "ButtonStyles__StyledIcon",
90
95
  componentId: "eqxqs2-0"
91
96
  })([ "display:flex;align-items:center;flex-shrink:0;font-size:", ";", "" ], (0,
92
- m.pick)({
97
+ y.pick)({
93
98
  enterprise: "inherit",
94
99
  prisma: {
95
100
  comfortable: "21px",
96
101
  compact: "16px"
97
102
  }
98
- }), (0, m.pickVariant)("$isStartIcon", {
103
+ }), (0, y.pickVariant)("$isStartIcon", {
99
104
  true: {
100
- enterprise: (0, p.css)([ "padding-right:3px;" ]),
101
- prisma: (0, p.css)([ "padding-right:8px;" ])
105
+ enterprise: (0, d.css)([ "padding-right:3px;" ]),
106
+ prisma: (0, d.css)([ "padding-right:8px;" ])
102
107
  }
103
108
  }));
104
- var v = u()(d()).withConfig({
109
+ var x = m()(b()).withConfig({
105
110
  displayName: "ButtonStyles__StyledButtonSimple",
106
111
  componentId: "eqxqs2-1"
107
- })([ "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;", "}" ], m.variables.lineHeight, m.variables.inputHeight, (0,
108
- m.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)({
109
114
  enterprise: {
110
115
  comfortable: "5px 14px",
111
116
  compact: "2px 14px"
@@ -122,38 +127,38 @@
122
127
  }
123
128
  }), (function(e) {
124
129
  var t = e.$inline, n = e.append, r = e.prepend;
125
- return !t && !n && !r && (0, p.css)([ "width:100%;" ]);
130
+ return !t && !n && !r && (0, d.css)([ "width:100%;" ]);
126
131
  }), (function(e) {
127
132
  var t = e.$isIconOnly;
128
- return t && (0, p.css)([ "box-sizing:border-box;", ";width:", ";min-width:", ";" ], (0,
129
- m.pick)({
133
+ return t && (0, d.css)([ "box-sizing:border-box;", ";width:", ";min-width:", ";" ], (0,
134
+ y.pick)({
130
135
  enterprise: {
131
- comfortable: (0, p.css)([ "padding:0 5px;" ]),
132
- compact: (0, p.css)([ "padding:0 2px;" ])
136
+ comfortable: (0, d.css)([ "padding:0 5px;" ]),
137
+ compact: (0, d.css)([ "padding:0 2px;" ])
133
138
  },
134
139
  prisma: {
135
- comfortable: (0, p.css)([ "padding:0 calc(", " / 2 - 1px);" ], m.variables.inputHeight),
136
- compact: (0, p.css)([ "padding:0 calc(", " / 2 - 1px);" ], m.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)
137
142
  }
138
- }), m.variables.inputHeight, m.variables.inputHeight);
143
+ }), y.variables.inputHeight, y.variables.inputHeight);
139
144
  }), (function(e) {
140
145
  var t = e.$isIconOnly;
141
- return t ? null : (0, p.css)([ "width:auto;" ]);
146
+ return t ? null : (0, d.css)([ "width:auto;" ]);
142
147
  }), (function(e) {
143
148
  var t = e.prepend;
144
- return !t && (0, p.css)([ "margin-left:", ";" ], m.variables.spacingSmall);
149
+ return !t && (0, d.css)([ "margin-left:", ";" ], y.variables.spacingSmall);
145
150
  }));
146
- var b = u().span.withConfig({
151
+ var g = m().span.withConfig({
147
152
  displayName: "ButtonStyles__StyledContentWrapper",
148
153
  componentId: "eqxqs2-2"
149
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,
150
- m.pick)({
155
+ y.pick)({
151
156
  enterprise: function e(t) {
152
157
  var n = t.$error;
153
158
  if (n) {
154
159
  return "1px";
155
160
  }
156
- return (0, m.pickVariant)("$appearance", {
161
+ return (0, y.pickVariant)("$appearance", {
157
162
  default: "0",
158
163
  secondary: "0",
159
164
  destructive: "1px",
@@ -166,7 +171,7 @@
166
171
  subtle: "0"
167
172
  });
168
173
  },
169
- prisma: (0, m.pickVariant)("$appearance", {
174
+ prisma: (0, y.pickVariant)("$appearance", {
170
175
  default: 0,
171
176
  secondary: "1px 0",
172
177
  primary: "1px 0",
@@ -178,215 +183,191 @@
178
183
  subtle: "1px 0"
179
184
  })
180
185
  }));
181
- var h = u().span.withConfig({
186
+ var w = m().span.withConfig({
182
187
  displayName: "ButtonStyles__StyledLabel",
183
188
  componentId: "eqxqs2-3"
184
189
  })([ "text-overflow:ellipsis;overflow:hidden;flex:0 1 auto;&:not(:last-child){padding-right:", ";}", "" ], (0,
185
- m.pick)({
190
+ y.pick)({
186
191
  enterprise: "3px",
187
192
  prisma: "10px"
188
193
  }), (function(e) {
189
194
  var t = e.$isMenu;
190
- return t && (0, p.css)([ "flex:1 1 auto;text-align:left;" ]);
195
+ return t && (0, d.css)([ "flex:1 1 auto;text-align:left;" ]);
191
196
  }));
192
- var x = u().span.withConfig({
197
+ var S = m().span.withConfig({
193
198
  displayName: "ButtonStyles__StyledCaretWrapper",
194
199
  componentId: "eqxqs2-4"
195
- })([ "display:inline-flex;", "" ], (0, m.pickVariant)("$disabled", {
200
+ })([ "display:inline-flex;", "" ], (0, y.pickVariant)("$disabled", {
196
201
  false: {
197
- prisma: (0, m.pickVariant)("$primary", {
198
- true: (0, p.css)([ "color:", ";" ], m.variables.contentColorInverted),
199
- false: (0, p.css)([ "color:", ";", ":hover > * > &,", ":active > * > &,{color:", ";}" ], m.variables.contentColorDefault,
200
- /* sc-sel */
201
- v,
202
- /* sc-sel */
203
- v, m.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)
204
205
  })
205
206
  }
206
207
  }));
207
208
  // CONCATENATED MODULE: external "@splunk/react-icons/CaretSmallDown"
208
- const g = require("@splunk/react-icons/CaretSmallDown");
209
- var w = e.n(g);
209
+ const k = require("@splunk/react-icons/CaretSmallDown");
210
+ var O = e.n(k);
210
211
  // CONCATENATED MODULE: external "@splunk/react-icons/enterprise/Caret"
211
- const S = require("@splunk/react-icons/enterprise/Caret");
212
- var k = e.n(S);
212
+ const C = require("@splunk/react-icons/enterprise/Caret");
213
+ var q = e.n(C);
213
214
  // CONCATENATED MODULE: ./src/Button/icons/CaretSmallDown.tsx
214
- var O = function e() {
215
- var t = (0, m.useSplunkTheme)(), n = t.isEnterprise, i = t.isCompact;
216
- var a = i ? "20px" : "24px";
217
- return n ? r().createElement(k(), {
215
+ var $ = function e() {
216
+ var t = (0, y.useSplunkTheme)(), n = t.isEnterprise, i = t.isCompact;
217
+ var o = i ? "20px" : "24px";
218
+ return n ? r().createElement(q(), {
218
219
  screenReaderText: null,
219
220
  hideDefaultTooltip: true,
220
221
  size: .5
221
- }) : r().createElement(w(), {
222
- height: a,
223
- width: a
222
+ }) : r().createElement(O(), {
223
+ height: o,
224
+ width: o
224
225
  });
225
226
  };
226
- /* harmony default export */ const C = O;
227
+ /* harmony default export */ const _ = $;
227
228
  // CONCATENATED MODULE: external "@splunk/react-icons/ArrowSquareTopRightInset"
228
- const q = require("@splunk/react-icons/ArrowSquareTopRightInset");
229
- var $ = e.n(q);
229
+ const j = require("@splunk/react-icons/ArrowSquareTopRightInset");
230
+ var E = e.n(j);
230
231
  // CONCATENATED MODULE: external "@splunk/react-icons/enterprise/External"
231
- const _ = require("@splunk/react-icons/enterprise/External");
232
- var I = e.n(_);
233
- // CONCATENATED MODULE: external "@splunk/ui-utils/i18n"
234
- const E = require("@splunk/ui-utils/i18n");
232
+ const P = require("@splunk/react-icons/enterprise/External");
233
+ var I = e.n(P);
235
234
  // CONCATENATED MODULE: ./src/Button/icons/External.tsx
236
- var P = (0, E._)("Open externally");
237
- function j() {
238
- var e = (0, m.useSplunkTheme)(), t = e.isEnterprise;
235
+ function T() {
236
+ var e = (0, y.useSplunkTheme)(), t = e.isEnterprise;
239
237
  return t ? r().createElement(I(), {
240
- screenReaderText: P
241
- }) : r().createElement($(), {
242
- "aria-label": P
243
- }, r().createElement("title", null, P));
238
+ screenReaderText: null
239
+ }) : r().createElement(E(), null);
244
240
  }
245
- /* harmony default export */ const N = j;
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 T() {
261
- T = 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 T.apply(this, arguments);
260
+ }, B.apply(null, arguments);
273
261
  }
274
262
  function R(e, t) {
275
- if (!(e instanceof t)) {
276
- throw new TypeError("Cannot call a class as a function");
277
- }
263
+ if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function");
278
264
  }
279
- function B(e, t) {
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
- function D(e, t, n) {
289
- if (t) B(e.prototype, t);
290
- if (n) B(e, n);
291
- return e;
272
+ function H(e, t, n) {
273
+ return t && D(e.prototype, t), n && D(e, n), Object.defineProperty(e, "prototype", {
274
+ writable: !1
275
+ }), e;
292
276
  }
293
- function H(e, t) {
294
- if (typeof t !== "function" && t !== null) {
295
- throw new TypeError("Super expression must either be null or a function");
296
- }
277
+ function V(e, t) {
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) V(e, t);
285
+ }), Object.defineProperty(e, "prototype", {
286
+ writable: !1
287
+ }), t && z(e, t);
305
288
  }
306
- function V(e, t) {
307
- V = Object.setPrototypeOf || function e(t, n) {
308
- t.__proto__ = n;
309
- return t;
310
- };
311
- return V(e, t);
289
+ function 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
- function z(e) {
314
- var t = L();
315
- return function n() {
316
- var r = F(e), i;
294
+ function W(e) {
295
+ var t = F();
296
+ return function() {
297
+ var n, r = G(e);
317
298
  if (t) {
318
- var a = F(this).constructor;
319
- i = Reflect.construct(r, arguments, a);
320
- } else {
321
- i = r.apply(this, arguments);
322
- }
323
- return W(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
- function W(e, t) {
327
- if (t && (M(t) === "object" || typeof t === "function")) {
328
- return t;
329
- }
330
- return A(e);
305
+ function A(e, t) {
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");
308
+ return L(e);
331
309
  }
332
- function A(e) {
333
- if (e === void 0) {
334
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
335
- }
310
+ function L(e) {
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
- function L() {
339
- if (typeof Reflect === "undefined" || !Reflect.construct) return false;
340
- if (Reflect.construct.sham) return false;
341
- if (typeof Proxy === "function") return true;
314
+ function F() {
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
- function F(e) {
350
- F = Object.setPrototypeOf ? Object.getPrototypeOf : function e(t) {
351
- return t.__proto__ || Object.getPrototypeOf(t);
352
- };
353
- return F(e);
322
+ function 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
- function G(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;
327
+ function J(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 J = {
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().bool,
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 K = {
370
+ var X = {
390
371
  appearance: "default",
391
372
  append: false,
392
373
  disabled: false,
@@ -396,35 +377,37 @@
396
377
  openInNewContext: false,
397
378
  prepend: false
398
379
  };
399
- var Q = function(e) {
400
- H(n, e);
401
- var t = z(n);
380
+ var Y = (0, u._)("(Opens new window)");
381
+ var Z = function(e) {
382
+ V(n, e);
383
+ var t = W(n);
402
384
  // @docs-props-type ButtonPropsBase
403
385
  function n(e) {
404
386
  var r;
405
387
  R(this, n);
406
388
  r = t.call(this, e);
407
- G(A(r), "component", null);
408
- G(A(r), "handleClick", (function(e) {
409
- var t = r.props, n = t.label, i = t.icon, a = t.value, o = t.action, l = t.onClick;
389
+ J(L(r), "component", null);
390
+ J(L(r), "handleClick", (function(e) {
391
+ var t = r.props, n = t.label, i = t.icon, o = t.value, a = t.action, l = t.onClick;
410
392
  l === null || l === void 0 ? void 0 : l(e, {
411
393
  label: n,
412
394
  icon: i,
413
- value: a,
414
- action: o
395
+ value: o,
396
+ action: a
415
397
  });
416
398
  }));
417
- G(A(r), "handleMount", (function(e) {
399
+ J(L(r), "handleMount", (function(e) {
418
400
  r.component = e;
419
401
  }));
420
402
  if (false) {}
421
403
  return r;
422
404
  }
423
- D(n, [ {
405
+ H(n, [ {
424
406
  key: "focus",
425
407
  /**
426
408
  * Places focus on the button.
427
409
  */
410
+ // eslint-disable-next-line react/no-unused-class-component-methods
428
411
  value: function e() {
429
412
  var t;
430
413
  (t = this.component) === null || t === void 0 ? void 0 : t.focus();
@@ -432,57 +415,63 @@
432
415
  }, {
433
416
  key: "render",
434
417
  value: function e() {
435
- 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, S = t.prepend, k = t.to, O = t.value;
436
- var q = this.props, $ = q.children, _ = q.label;
437
- if (!_ && l()($)) {
438
- _ = $;
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 = $;
439
422
  $ = null;
440
423
  }
441
- var I = !!(f && !_ && !m && !$);
442
- var E = k && w || m || !!f;
424
+ var E = false;
425
+ var P;
426
+ if (y) {
427
+ E = true;
428
+ P = typeof y === "string" ? y : Y;
429
+ }
430
+ var I = !!(d && !j && !v && !$);
431
+ var T = O && E || v || !!d;
443
432
 
444
- return r().createElement(v, T({
445
- "aria-haspopup": m || undefined,
433
+ return r().createElement(x, B({
434
+ "aria-haspopup": v || undefined,
446
435
  "aria-invalid": u || undefined,
447
436
  "data-test": "button"
448
437
  }, this.props, {
449
- className: (0, c.toClassName)(o, s),
438
+ className: (0, f.toClassName)(a, c),
450
439
  "data-action": n,
451
- "data-inline": d || null,
452
- disabled: p,
453
- append: a,
454
- prepend: S,
455
- $inline: d,
456
- $hasPrismaIcon: E,
440
+ "data-inline": m || null,
441
+ disabled: s,
442
+ append: o,
443
+ prepend: k,
444
+ $inline: m,
445
+ $hasPrismaIcon: T,
457
446
  $isIconOnly: I,
458
- $isMenu: m,
459
- value: O,
460
- onClick: g ? this.handleClick : undefined,
447
+ $isMenu: v,
448
+ value: C,
449
+ onClick: b ? this.handleClick : undefined,
461
450
  ref: this.handleMount,
462
- openInNewContext: w,
451
+ openInNewContext: E,
463
452
  appearance: i
464
- }), r().createElement(b, {
453
+ }), r().createElement(g, {
465
454
  $appearance: i,
466
455
  $error: u
467
- }, f && r().createElement(y, {
456
+ }, d && r().createElement(h, {
468
457
  $isStartIcon: !I
469
- }, f), _ && r().createElement(h, {
458
+ }, d), j && r().createElement(w, {
470
459
  "data-test": "label",
471
- $isMenu: m
472
- }, _), $, m && r().createElement(x, {
473
- $disabled: p,
460
+ $isMenu: v
461
+ }, j), $, v && r().createElement(S, {
462
+ $disabled: s,
474
463
  $primary: i === "primary"
475
- }, r().createElement(C, null)), w && r().createElement(y, {
464
+ }, r().createElement(_, null)), y && r().createElement(h, {
476
465
  $isStartIcon: false
477
- }, r().createElement(N, null))));
466
+ }, r().createElement(N, null), r().createElement(p(), null, P))));
478
467
  }
479
468
  } ]);
480
469
  return n;
481
470
  }(n.Component);
482
- G(Q, "propTypes", J);
483
- G(Q, "defaultProps", K);
484
- G(Q, s.legacyRefMode, true);
485
- /* harmony default export */ const U = Q;
471
+ J(Z, "propTypes", U);
472
+ J(Z, "defaultProps", X);
473
+ J(Z, c.legacyRefMode, true);
474
+ /* harmony default export */ const ee = Z;
486
475
  // CONCATENATED MODULE: ./src/Button/index.ts
487
476
  module.exports = t;
488
477
  /******/})();