@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.
- package/Accordion.js +131 -153
- package/Anchor.js +50 -58
- package/Animation.js +64 -59
- package/AnimationToggle.js +59 -61
- package/Box.js +59 -67
- package/Breadcrumbs.js +113 -127
- package/Button.js +151 -169
- package/ButtonGroup.js +41 -49
- package/ButtonSimple.js +264 -295
- package/CHANGELOG.md +28 -0
- package/Calendar.js +353 -414
- package/Card.js +183 -243
- package/CardLayout.js +86 -83
- package/Chip.js +104 -122
- package/Clickable.js +180 -198
- package/CloseButton.js +52 -60
- package/Code.js +24 -31
- package/CollapsiblePanel.js +172 -202
- package/Color.js +371 -412
- package/ColumnLayout.js +72 -96
- package/ComboBox.js +266 -303
- package/Concertina.js +406 -454
- package/ControlGroup.js +165 -194
- package/Date.js +116 -131
- package/DefinitionList.js +125 -149
- package/Divider.js +81 -79
- package/Dropdown.js +226 -237
- package/DualListbox.js +150 -186
- package/EventListener.js +4 -1
- package/File.js +1032 -955
- package/FormRows.js +281 -334
- package/Heading.js +27 -35
- package/Image.js +101 -116
- package/JSONTree.js +301 -344
- package/Layer.js +118 -126
- package/Link.js +141 -159
- package/List.js +61 -77
- package/MIGRATION.mdx +92 -38
- package/Markdown.js +288 -347
- package/Menu.js +506 -532
- package/Message.js +173 -196
- package/MessageBar.js +58 -66
- package/Modal.js +241 -290
- package/ModalLayer.js +130 -148
- package/Monogram.js +138 -138
- package/Multiselect.js +1589 -1902
- package/Number.js +159 -178
- package/Paginator.js +296 -335
- package/Paragraph.js +24 -32
- package/Popover.js +448 -441
- package/Progress.js +65 -75
- package/RadioBar.js +301 -303
- package/RadioList.js +77 -119
- package/Resize.js +105 -127
- package/ResultsMenu.js +373 -385
- package/ScreenReaderContent.js +50 -58
- package/Scroll.js +209 -244
- package/Search.js +379 -391
- package/Select.js +1077 -1345
- package/SidePanel.js +122 -142
- package/Slider.js +132 -145
- package/SlidingPanels.js +238 -270
- package/SplitButton.js +222 -245
- package/StaticContent.js +68 -76
- package/StepBar.js +206 -205
- package/Switch.js +176 -205
- package/TabBar.js +222 -258
- package/TabLayout.js +114 -139
- package/Table.js +2017 -2180
- package/Text.js +379 -493
- package/TextArea.js +411 -441
- package/Tooltip.js +116 -132
- package/TransitionOpen.js +160 -178
- package/Tree.js +268 -287
- package/Typography.js +48 -52
- package/WaitSpinner.js +60 -68
- package/cypress/support/commands.ts +9 -0
- package/cypress/support/index.d.ts +6 -0
- package/cypress/tsconfig.cypress.json +1 -0
- package/docker-compose.yml +0 -1
- package/package.json +14 -14
- package/types/src/Button/Button.d.ts +5 -1
- package/types/src/ButtonSimple/ButtonSimple.d.ts +2 -2
- package/types/src/CollapsiblePanel/CollapsiblePanel.d.ts +1 -1
- package/types/src/Color/Color.d.ts +2 -2
- package/types/src/Color/Palette.d.ts +4 -2
- package/types/src/ComboBox/Option.d.ts +1 -1
- package/types/src/ControlGroup/ControlGroup.d.ts +1 -2
- package/types/src/Date/Date.d.ts +2 -2
- package/types/src/File/File.d.ts +2 -3
- package/types/src/File/Retry.d.ts +1 -2
- package/types/src/Menu/Item.d.ts +18 -5
- package/types/src/Menu/Menu.d.ts +3 -3
- package/types/src/Menu/docs/examples/Adornments.d.ts +2 -0
- package/types/src/Menu/docs/examples/SelectableWithAdornments.d.ts +2 -0
- package/types/src/ModalLayer/ModalLayer.d.ts +1 -1
- package/types/src/Multiselect/Option.d.ts +2 -0
- package/types/src/Number/Number.d.ts +3 -3
- package/types/src/Popover/Popover.d.ts +3 -4
- package/types/src/RadioBar/RadioBar.d.ts +2 -2
- package/types/src/ResultsMenu/VirtualizedResultsMenu/VirtualizedResultsMenu.d.ts +1 -1
- package/types/src/ScrollContainerContext/ScrollContainerContext.d.ts +2 -2
- package/types/src/Search/Option.d.ts +9 -3
- package/types/src/Select/Option.d.ts +3 -1
- package/types/src/Select/OptionBase.d.ts +7 -5
- package/types/src/Select/Select.d.ts +1 -1
- package/types/src/Select/SelectAllOption.d.ts +4 -4
- package/types/src/SidePanel/SidePanel.d.ts +1 -1
- package/types/src/Slider/Slider.d.ts +2 -2
- package/types/src/SlidingPanels/SlidingPanels.d.ts +1 -1
- package/types/src/StepBar/Step.d.ts +1 -2
- package/types/src/Switch/Switch.d.ts +0 -1
- package/types/src/TabBar/Tab.d.ts +1 -1
- package/types/src/TabBar/TabBar.d.ts +3 -1
- package/types/src/TabLayout/TabLayout.d.ts +2 -0
- package/types/src/Table/HeadDropdownCell.d.ts +2 -0
- package/types/src/Table/Table.d.ts +0 -1
- package/types/src/Table/docs/examples/StripeRows.d.ts +2 -0
- package/types/src/Text/IconOutlinedHide.d.ts +1 -2
- package/types/src/Text/IconOutlinedView.d.ts +1 -2
- package/types/src/Text/Text.d.ts +2 -2
- package/types/src/TextArea/TextArea.d.ts +2 -2
- package/types/src/Tooltip/Tooltip.d.ts +4 -4
- package/types/src/TransitionOpen/TransitionOpen.d.ts +1 -1
- package/useForceUpdate.js +30 -32
- package/useKeyPress.js +1 -1
- package/types/src/ButtonGroup/docs/examples/prisma/Basic.d.ts +0 -1
- package/types/src/File/docs/examples/prisma/Error.d.ts +0 -1
- package/types/src/Menu/docs/examples/Icons.d.ts +0 -2
- package/types/src/Menu/docs/examples/SelectableWithIcons.d.ts +0 -2
- package/types/src/TabBar/docs/examples/prisma/Context.d.ts +0 -2
- package/types/src/TabLayout/docs/examples/prisma/Context.d.ts +0 -2
- package/types/src/Table/docs/examples/prisma/Basic.d.ts +0 -2
- /package/types/src/Message/docs/examples/{prisma/Title.d.ts → Title.d.ts} +0 -0
- /package/types/src/StepBar/docs/examples/{prisma/Error.d.ts → Error.d.ts} +0 -0
- /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 */
|
|
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
|
|
71
|
+
var o = e.n(i);
|
|
72
72
|
// CONCATENATED MODULE: external "lodash/isString"
|
|
73
|
-
const
|
|
74
|
-
var l = e.n(
|
|
73
|
+
const a = require("lodash/isString");
|
|
74
|
+
var l = e.n(a);
|
|
75
75
|
// CONCATENATED MODULE: external "@splunk/react-ui/Dropdown"
|
|
76
|
-
const
|
|
76
|
+
const c = require("@splunk/react-ui/Dropdown");
|
|
77
77
|
// CONCATENATED MODULE: external "@splunk/react-ui/ScreenReaderContent"
|
|
78
|
-
const
|
|
79
|
-
var p = e.n(
|
|
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
|
|
89
|
+
var b = e.n(v);
|
|
90
90
|
// CONCATENATED MODULE: external "@splunk/themes"
|
|
91
|
-
const
|
|
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
|
-
|
|
97
|
+
y.pick)({
|
|
98
98
|
enterprise: "inherit",
|
|
99
99
|
prisma: {
|
|
100
100
|
comfortable: "21px",
|
|
101
101
|
compact: "16px"
|
|
102
102
|
}
|
|
103
|
-
}), (0,
|
|
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()(
|
|
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;", "}" ],
|
|
113
|
-
|
|
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
|
-
|
|
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);" ],
|
|
141
|
-
compact: (0, d.css)([ "padding:0 calc(", " / 2 - 1px);" ],
|
|
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
|
-
}),
|
|
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:", ";" ],
|
|
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
|
-
|
|
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,
|
|
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,
|
|
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
|
-
|
|
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,
|
|
200
|
+
})([ "display:inline-flex;", "" ], (0, y.pickVariant)("$disabled", {
|
|
201
201
|
false: {
|
|
202
|
-
prisma: (0,
|
|
203
|
-
true: (0, d.css)([ "color:", ";" ],
|
|
204
|
-
false: (0, d.css)([ "color:", ";", ":hover > * > &,", ":active > * > &,{color:", ";}" ],
|
|
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,
|
|
221
|
-
var
|
|
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:
|
|
228
|
-
width:
|
|
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
|
|
234
|
-
var E = e.n(
|
|
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
|
|
233
|
+
var I = e.n(P);
|
|
238
234
|
// CONCATENATED MODULE: ./src/Button/icons/External.tsx
|
|
239
|
-
function
|
|
240
|
-
var e = (0,
|
|
241
|
-
return t ? r().createElement(
|
|
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
|
|
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
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
}
|
|
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
|
|
261
|
-
|
|
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
|
-
|
|
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
|
|
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 ||
|
|
283
|
-
r.
|
|
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
|
-
|
|
290
|
-
|
|
291
|
-
|
|
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 !== "
|
|
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:
|
|
301
|
-
configurable:
|
|
282
|
+
writable: !0,
|
|
283
|
+
configurable: !0
|
|
302
284
|
}
|
|
303
|
-
})
|
|
304
|
-
|
|
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
|
|
308
|
-
|
|
309
|
-
|
|
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
|
|
316
|
-
var r = G(e)
|
|
296
|
+
return function() {
|
|
297
|
+
var n, r = G(e);
|
|
317
298
|
if (t) {
|
|
318
|
-
var
|
|
319
|
-
|
|
320
|
-
} else
|
|
321
|
-
|
|
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)
|
|
328
|
-
|
|
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 (
|
|
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
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
return
|
|
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
|
|
351
|
-
return
|
|
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
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
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
|
|
369
|
-
action:
|
|
370
|
-
appearance:
|
|
371
|
-
append:
|
|
372
|
-
children:
|
|
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:
|
|
375
|
-
disabled:
|
|
376
|
-
elementRef:
|
|
377
|
-
error:
|
|
378
|
-
icon:
|
|
379
|
-
inline:
|
|
380
|
-
isMenu:
|
|
381
|
-
label:
|
|
382
|
-
onClick:
|
|
383
|
-
openInNewContext:
|
|
384
|
-
prepend:
|
|
385
|
-
selected:
|
|
386
|
-
to:
|
|
387
|
-
value:
|
|
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
|
|
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
|
|
400
|
-
var
|
|
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
|
-
|
|
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,
|
|
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:
|
|
415
|
-
action:
|
|
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,
|
|
437
|
-
var q = this.props, $ = q.children,
|
|
438
|
-
if (!
|
|
439
|
-
|
|
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 (
|
|
426
|
+
if (y) {
|
|
445
427
|
E = true;
|
|
446
|
-
P = typeof
|
|
428
|
+
P = typeof y === "string" ? y : Y;
|
|
447
429
|
}
|
|
448
|
-
var
|
|
449
|
-
var
|
|
430
|
+
var I = !!(d && !j && !v && !$);
|
|
431
|
+
var T = O && E || v || !!d;
|
|
450
432
|
|
|
451
|
-
return r().createElement(x,
|
|
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)(
|
|
438
|
+
className: (0, f.toClassName)(a, c),
|
|
457
439
|
"data-action": n,
|
|
458
440
|
"data-inline": m || null,
|
|
459
|
-
disabled:
|
|
460
|
-
append:
|
|
441
|
+
disabled: s,
|
|
442
|
+
append: o,
|
|
461
443
|
prepend: k,
|
|
462
444
|
$inline: m,
|
|
463
|
-
$hasPrismaIcon:
|
|
464
|
-
$isIconOnly:
|
|
445
|
+
$hasPrismaIcon: T,
|
|
446
|
+
$isIconOnly: I,
|
|
465
447
|
$isMenu: v,
|
|
466
448
|
value: C,
|
|
467
|
-
onClick:
|
|
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: !
|
|
476
|
-
}, d),
|
|
457
|
+
$isStartIcon: !I
|
|
458
|
+
}, d), j && r().createElement(w, {
|
|
477
459
|
"data-test": "label",
|
|
478
460
|
$isMenu: v
|
|
479
|
-
},
|
|
480
|
-
$disabled:
|
|
461
|
+
}, j), $, v && r().createElement(S, {
|
|
462
|
+
$disabled: s,
|
|
481
463
|
$primary: i === "primary"
|
|
482
|
-
}, r().createElement(_, null)),
|
|
464
|
+
}, r().createElement(_, null)), y && r().createElement(h, {
|
|
483
465
|
$isStartIcon: false
|
|
484
|
-
}, r().createElement(
|
|
466
|
+
}, r().createElement(N, null), r().createElement(p(), null, P))));
|
|
485
467
|
}
|
|
486
468
|
} ]);
|
|
487
469
|
return n;
|
|
488
470
|
}(n.Component);
|
|
489
|
-
J(
|
|
490
|
-
J(
|
|
491
|
-
J(
|
|
492
|
-
/* harmony default export */ const
|
|
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
|
/******/})();
|