@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.
- 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 +208 -219
- package/ButtonGroup.js +41 -49
- package/ButtonSimple.js +264 -295
- package/CHANGELOG.md +50 -1
- 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 +1107 -980
- package/ColumnLayout.js +72 -96
- package/ComboBox.js +267 -305
- 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 +512 -530
- 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 +1600 -1923
- 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 +130 -94
- package/Scroll.js +209 -244
- package/Search.js +375 -384
- package/Select.js +1076 -1354
- package/SidePanel.js +122 -142
- package/Slider.js +192 -222
- package/SlidingPanels.js +238 -270
- package/SplitButton.js +222 -245
- package/StaticContent.js +68 -76
- package/StepBar.js +206 -205
- package/Switch.js +211 -236
- package/TabBar.js +222 -258
- package/TabLayout.js +114 -139
- package/Table.js +2017 -2180
- package/Text.js +401 -512
- 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 +17 -17
- package/types/src/Button/Button.d.ts +20 -6
- 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 +5 -2
- package/types/src/Color/Palette.d.ts +6 -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 -3
- package/types/src/File/File.d.ts +2 -3
- package/types/src/File/Retry.d.ts +1 -2
- package/types/src/Link/Link.d.ts +3 -4
- package/types/src/Menu/Item.d.ts +24 -8
- 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 +16 -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 +2 -2
- package/types/src/Select/SelectAllOption.d.ts +4 -4
- package/types/src/Select/SelectBase.d.ts +0 -1
- package/types/src/SidePanel/SidePanel.d.ts +1 -1
- package/types/src/Slider/Slider.d.ts +2 -3
- package/types/src/Slider/docs/examples/Error.d.ts +2 -0
- package/types/src/SlidingPanels/SlidingPanels.d.ts +1 -1
- package/types/src/StepBar/Step.d.ts +1 -2
- 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 +6 -4
- package/types/src/Text/docs/examples/Dimmed.d.ts +2 -0
- 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/Button/docs/examples/Selected.d.ts +0 -2
- 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/Slider/docs/examples/prisma/Error.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/Date/docs/examples/{prisma/WithoutCalendar.d.ts → WithoutCalendar.d.ts} +0 -0
- /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,51 +61,56 @@
|
|
|
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
|
+
// 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
|
|
83
|
+
const f = require("@splunk/ui-utils/style");
|
|
79
84
|
// CONCATENATED MODULE: external "styled-components"
|
|
80
|
-
const
|
|
81
|
-
var
|
|
85
|
+
const d = require("styled-components");
|
|
86
|
+
var m = e.n(d);
|
|
82
87
|
// CONCATENATED MODULE: external "@splunk/react-ui/ButtonSimple"
|
|
83
|
-
const
|
|
84
|
-
var
|
|
88
|
+
const v = require("@splunk/react-ui/ButtonSimple");
|
|
89
|
+
var b = e.n(v);
|
|
85
90
|
// CONCATENATED MODULE: external "@splunk/themes"
|
|
86
|
-
const
|
|
91
|
+
const y = require("@splunk/themes");
|
|
87
92
|
// CONCATENATED MODULE: ./src/Button/ButtonStyles.ts
|
|
88
|
-
var
|
|
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
|
-
|
|
97
|
+
y.pick)({
|
|
93
98
|
enterprise: "inherit",
|
|
94
99
|
prisma: {
|
|
95
100
|
comfortable: "21px",
|
|
96
101
|
compact: "16px"
|
|
97
102
|
}
|
|
98
|
-
}), (0,
|
|
103
|
+
}), (0, y.pickVariant)("$isStartIcon", {
|
|
99
104
|
true: {
|
|
100
|
-
enterprise: (0,
|
|
101
|
-
prisma: (0,
|
|
105
|
+
enterprise: (0, d.css)([ "padding-right:3px;" ]),
|
|
106
|
+
prisma: (0, d.css)([ "padding-right:8px;" ])
|
|
102
107
|
}
|
|
103
108
|
}));
|
|
104
|
-
var
|
|
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;", "}" ],
|
|
108
|
-
|
|
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,
|
|
130
|
+
return !t && !n && !r && (0, d.css)([ "width:100%;" ]);
|
|
126
131
|
}), (function(e) {
|
|
127
132
|
var t = e.$isIconOnly;
|
|
128
|
-
return t && (0,
|
|
129
|
-
|
|
133
|
+
return t && (0, d.css)([ "box-sizing:border-box;", ";width:", ";min-width:", ";" ], (0,
|
|
134
|
+
y.pick)({
|
|
130
135
|
enterprise: {
|
|
131
|
-
comfortable: (0,
|
|
132
|
-
compact: (0,
|
|
136
|
+
comfortable: (0, d.css)([ "padding:0 5px;" ]),
|
|
137
|
+
compact: (0, d.css)([ "padding:0 2px;" ])
|
|
133
138
|
},
|
|
134
139
|
prisma: {
|
|
135
|
-
comfortable: (0,
|
|
136
|
-
compact: (0,
|
|
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
|
-
}),
|
|
143
|
+
}), y.variables.inputHeight, y.variables.inputHeight);
|
|
139
144
|
}), (function(e) {
|
|
140
145
|
var t = e.$isIconOnly;
|
|
141
|
-
return t ? null : (0,
|
|
146
|
+
return t ? null : (0, d.css)([ "width:auto;" ]);
|
|
142
147
|
}), (function(e) {
|
|
143
148
|
var t = e.prepend;
|
|
144
|
-
return !t && (0,
|
|
149
|
+
return !t && (0, d.css)([ "margin-left:", ";" ], y.variables.spacingSmall);
|
|
145
150
|
}));
|
|
146
|
-
var
|
|
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
|
-
|
|
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,
|
|
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,
|
|
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
|
|
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
|
-
|
|
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,
|
|
195
|
+
return t && (0, d.css)([ "flex:1 1 auto;text-align:left;" ]);
|
|
191
196
|
}));
|
|
192
|
-
var
|
|
197
|
+
var S = m().span.withConfig({
|
|
193
198
|
displayName: "ButtonStyles__StyledCaretWrapper",
|
|
194
199
|
componentId: "eqxqs2-4"
|
|
195
|
-
})([ "display:inline-flex;", "" ], (0,
|
|
200
|
+
})([ "display:inline-flex;", "" ], (0, y.pickVariant)("$disabled", {
|
|
196
201
|
false: {
|
|
197
|
-
prisma: (0,
|
|
198
|
-
true: (0,
|
|
199
|
-
false: (0,
|
|
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
|
|
209
|
-
var
|
|
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
|
|
212
|
-
var
|
|
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
|
|
215
|
-
var t = (0,
|
|
216
|
-
var
|
|
217
|
-
return n ? r().createElement(
|
|
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(
|
|
222
|
-
height:
|
|
223
|
-
width:
|
|
222
|
+
}) : r().createElement(O(), {
|
|
223
|
+
height: o,
|
|
224
|
+
width: o
|
|
224
225
|
});
|
|
225
226
|
};
|
|
226
|
-
/* harmony default export */ const
|
|
227
|
+
/* harmony default export */ const _ = $;
|
|
227
228
|
// CONCATENATED MODULE: external "@splunk/react-icons/ArrowSquareTopRightInset"
|
|
228
|
-
const
|
|
229
|
-
var
|
|
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
|
|
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
|
-
|
|
237
|
-
|
|
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:
|
|
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 =
|
|
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 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
|
|
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
|
-
function
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
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
|
|
294
|
-
if (typeof t !== "
|
|
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:
|
|
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
|
-
function
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
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
|
|
314
|
-
var t =
|
|
315
|
-
return function
|
|
316
|
-
var r =
|
|
294
|
+
function W(e) {
|
|
295
|
+
var t = F();
|
|
296
|
+
return function() {
|
|
297
|
+
var n, r = G(e);
|
|
317
298
|
if (t) {
|
|
318
|
-
var
|
|
319
|
-
|
|
320
|
-
} else
|
|
321
|
-
|
|
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
|
|
327
|
-
if (t && (M(t)
|
|
328
|
-
|
|
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
|
|
333
|
-
if (
|
|
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
|
|
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
|
-
|
|
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
|
-
function
|
|
350
|
-
|
|
351
|
-
return
|
|
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
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
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
|
|
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,35 +377,37 @@
|
|
|
396
377
|
openInNewContext: false,
|
|
397
378
|
prepend: false
|
|
398
379
|
};
|
|
399
|
-
var
|
|
400
|
-
|
|
401
|
-
|
|
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
|
-
|
|
408
|
-
|
|
409
|
-
var t = r.props, n = t.label, i = t.icon,
|
|
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:
|
|
414
|
-
action:
|
|
395
|
+
value: o,
|
|
396
|
+
action: a
|
|
415
397
|
});
|
|
416
398
|
}));
|
|
417
|
-
|
|
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
|
-
|
|
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,
|
|
436
|
-
var q = this.props, $ = q.children,
|
|
437
|
-
if (!
|
|
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
|
|
442
|
-
var
|
|
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(
|
|
445
|
-
"aria-haspopup":
|
|
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,
|
|
438
|
+
className: (0, f.toClassName)(a, c),
|
|
450
439
|
"data-action": n,
|
|
451
|
-
"data-inline":
|
|
452
|
-
disabled:
|
|
453
|
-
append:
|
|
454
|
-
prepend:
|
|
455
|
-
$inline:
|
|
456
|
-
$hasPrismaIcon:
|
|
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:
|
|
459
|
-
value:
|
|
460
|
-
onClick:
|
|
447
|
+
$isMenu: v,
|
|
448
|
+
value: C,
|
|
449
|
+
onClick: b ? this.handleClick : undefined,
|
|
461
450
|
ref: this.handleMount,
|
|
462
|
-
openInNewContext:
|
|
451
|
+
openInNewContext: E,
|
|
463
452
|
appearance: i
|
|
464
|
-
}), r().createElement(
|
|
453
|
+
}), r().createElement(g, {
|
|
465
454
|
$appearance: i,
|
|
466
455
|
$error: u
|
|
467
|
-
},
|
|
456
|
+
}, d && r().createElement(h, {
|
|
468
457
|
$isStartIcon: !I
|
|
469
|
-
},
|
|
458
|
+
}, d), j && r().createElement(w, {
|
|
470
459
|
"data-test": "label",
|
|
471
|
-
$isMenu:
|
|
472
|
-
},
|
|
473
|
-
$disabled:
|
|
460
|
+
$isMenu: v
|
|
461
|
+
}, j), $, v && r().createElement(S, {
|
|
462
|
+
$disabled: s,
|
|
474
463
|
$primary: i === "primary"
|
|
475
|
-
}, r().createElement(
|
|
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
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
/* 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;
|
|
486
475
|
// CONCATENATED MODULE: ./src/Button/index.ts
|
|
487
476
|
module.exports = t;
|
|
488
477
|
/******/})();
|