@splunk/react-ui 4.32.0 → 4.33.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Button.js +42 -45
- package/ButtonSimple.js +372 -336
- package/CHANGELOG.md +23 -0
- package/Clickable.js +21 -19
- package/FormRows.js +229 -207
- package/MIGRATION.mdx +23 -0
- package/Menu.js +1 -1
- package/Modal.js +156 -131
- package/Multiselect.js +47 -33
- package/Select.js +236 -220
- package/TabBar.js +1 -1
- package/Text.js +13 -11
- package/package.json +5 -5
- package/types/src/Button/Button.d.ts +4 -4
- package/types/src/ButtonSimple/ButtonSimple.d.ts +8 -6
- package/types/src/ButtonSimple/mixin.d.ts +2 -2
- package/types/src/Clickable/Clickable.d.ts +3 -2
- package/types/src/Date/Date.d.ts +2 -2
- package/types/src/Menu/Item.d.ts +0 -1
- package/types/src/Number/Number.d.ts +2 -2
- package/types/src/Select/Select.d.ts +6 -2
- package/types/src/Select/SelectBase.d.ts +6 -2
- package/types/src/Slider/Slider.d.ts +2 -2
- package/types/src/Text/docs/examples/Basic.d.ts +1 -9
- package/types/src/Text/docs/examples/Error.d.ts +2 -10
- package/types/src/Text/docs/examples/Inline.d.ts +1 -9
- package/types/src/Text/docs/examples/Multiline.d.ts +1 -9
- package/types/src/Text/docs/examples/Password.d.ts +1 -9
- package/types/src/Text/docs/examples/Search.d.ts +1 -9
- package/types/src/Button/docs/examples/prisma/Basic.d.ts +0 -2
- package/types/src/Button/docs/examples/prisma/Block.d.ts +0 -2
- package/types/src/Button/docs/examples/prisma/Disabled.d.ts +0 -2
- package/types/src/Button/docs/examples/prisma/Icons.d.ts +0 -2
- package/types/src/Button/docs/examples/prisma/Menus.d.ts +0 -2
- package/types/src/Button/docs/examples/prisma/To.d.ts +0 -2
- package/types/src/Button/docs/examples/prisma/Truncated.d.ts +0 -2
- /package/types/src/{Button/docs/examples/prisma → Clickable/docs/examples}/Dimmed.d.ts +0 -0
package/ButtonSimple.js
CHANGED
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
r.r(e);
|
|
62
62
|
// EXPORTS
|
|
63
63
|
r.d(e, {
|
|
64
|
-
default: () => /* reexport */
|
|
64
|
+
default: () => /* reexport */ vr
|
|
65
65
|
});
|
|
66
66
|
// CONCATENATED MODULE: external "react"
|
|
67
67
|
const a = require("react");
|
|
@@ -69,41 +69,36 @@
|
|
|
69
69
|
// CONCATENATED MODULE: external "prop-types"
|
|
70
70
|
const i = require("prop-types");
|
|
71
71
|
var t = r.n(i);
|
|
72
|
-
// CONCATENATED MODULE: external "@splunk/ui-utils/i18n"
|
|
73
|
-
const l = require("@splunk/ui-utils/i18n");
|
|
74
72
|
// CONCATENATED MODULE: external "@splunk/themes"
|
|
75
|
-
const
|
|
76
|
-
// CONCATENATED MODULE: external "@splunk/react-ui/ScreenReaderContent"
|
|
77
|
-
const s = require("@splunk/react-ui/ScreenReaderContent");
|
|
78
|
-
var c = r.n(s);
|
|
73
|
+
const l = require("@splunk/themes");
|
|
79
74
|
// CONCATENATED MODULE: external "styled-components"
|
|
80
|
-
const
|
|
81
|
-
var
|
|
75
|
+
const n = require("styled-components");
|
|
76
|
+
var s = r.n(n);
|
|
82
77
|
// CONCATENATED MODULE: external "@splunk/react-ui/Clickable"
|
|
83
|
-
const
|
|
84
|
-
var
|
|
78
|
+
const c = require("@splunk/react-ui/Clickable");
|
|
79
|
+
var d = r.n(c);
|
|
85
80
|
// CONCATENATED MODULE: external "lodash/merge"
|
|
86
|
-
const
|
|
87
|
-
var
|
|
81
|
+
const v = require("lodash/merge");
|
|
82
|
+
var b = r.n(v);
|
|
88
83
|
// CONCATENATED MODULE: ./src/ButtonSimple/mixin.ts
|
|
89
|
-
function
|
|
84
|
+
function u(r) {
|
|
90
85
|
"@babel/helpers - typeof";
|
|
91
86
|
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
|
92
|
-
|
|
87
|
+
u = function r(e) {
|
|
93
88
|
return typeof e;
|
|
94
89
|
};
|
|
95
90
|
} else {
|
|
96
|
-
|
|
91
|
+
u = function r(e) {
|
|
97
92
|
return e && typeof Symbol === "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
|
|
98
93
|
};
|
|
99
94
|
}
|
|
100
|
-
return
|
|
95
|
+
return u(r);
|
|
101
96
|
}
|
|
102
|
-
var
|
|
97
|
+
var p = [ "primary", "secondary", "destructive", "subtle" ];
|
|
103
98
|
/**
|
|
104
99
|
* These enterprise... values don't exist in Enterprise @splunk/themes
|
|
105
100
|
* They're provided here for TypeScript compatibility
|
|
106
|
-
*/ var
|
|
101
|
+
*/ var f = {
|
|
107
102
|
active: {
|
|
108
103
|
dark: "rgba(0, 0, 0, 0.2)",
|
|
109
104
|
light: "rgba(0, 0, 0, 0.07)"
|
|
@@ -117,124 +112,126 @@
|
|
|
117
112
|
light: "rgba(0, 0, 0, 0.04)"
|
|
118
113
|
}
|
|
119
114
|
};
|
|
120
|
-
var
|
|
115
|
+
var g = {
|
|
121
116
|
dark: "#272a2f",
|
|
122
117
|
light: "#eeeeee"
|
|
123
118
|
};
|
|
124
|
-
var
|
|
119
|
+
var y = {
|
|
125
120
|
dark: "rgba(255, 255, 255, 0.15)",
|
|
126
121
|
light: "rgba(0, 0, 0, 0.1)"
|
|
127
122
|
};
|
|
128
|
-
function
|
|
123
|
+
function h(r) {
|
|
129
124
|
var e = "transparent";
|
|
130
125
|
var a = "transparent";
|
|
131
|
-
var o = (0,
|
|
132
|
-
enterprise:
|
|
133
|
-
prisma:
|
|
126
|
+
var o = (0, l.pick)({
|
|
127
|
+
enterprise: y,
|
|
128
|
+
prisma: l.variables.interactiveColorBackgroundDisabled
|
|
134
129
|
});
|
|
135
|
-
var i = (0,
|
|
130
|
+
var i = (0, l.pick)({
|
|
136
131
|
enterprise: {
|
|
137
|
-
dark:
|
|
138
|
-
light:
|
|
132
|
+
dark: l.mixins.overlayColors(y.dark, f.selected.dark),
|
|
133
|
+
light: l.mixins.overlayColors(y.light, f.selected.light)
|
|
139
134
|
},
|
|
140
|
-
prisma:
|
|
135
|
+
prisma: l.mixins.overlayColors(l.variables.interactiveColorBackgroundDisabled, l.variables.interactiveColorOverlaySelected)
|
|
141
136
|
});
|
|
142
137
|
var t = "transparent";
|
|
143
|
-
var
|
|
138
|
+
var n = "transparent";
|
|
144
139
|
var s;
|
|
145
140
|
var c;
|
|
146
|
-
var d =
|
|
147
|
-
var v =
|
|
141
|
+
var d = l.variables.contentColorActive;
|
|
142
|
+
var v = l.variables.contentColorDisabled;
|
|
148
143
|
switch (r) {
|
|
149
144
|
case "primary":
|
|
150
145
|
{
|
|
151
|
-
e =
|
|
152
|
-
a = (0,
|
|
146
|
+
e = l.variables.interactiveColorPrimary;
|
|
147
|
+
a = (0, l.pick)({
|
|
153
148
|
enterprise: {
|
|
154
|
-
light:
|
|
155
|
-
dark:
|
|
149
|
+
light: l.mixins.overlayColors(l.variables.interactiveColorPrimary, f.active.light),
|
|
150
|
+
dark: l.mixins.overlayColors(l.variables.interactiveColorPrimary, f.active.dark)
|
|
156
151
|
},
|
|
157
|
-
prisma:
|
|
152
|
+
prisma: l.mixins.overlayColors(l.variables.interactiveColorPrimary, l.variables.interactiveColorOverlayActive)
|
|
158
153
|
});
|
|
159
|
-
t = (0,
|
|
154
|
+
t = (0, l.pick)({
|
|
160
155
|
enterprise: {
|
|
161
|
-
light:
|
|
162
|
-
dark:
|
|
156
|
+
light: l.mixins.overlayColors(l.variables.interactiveColorPrimary, f.hover.light),
|
|
157
|
+
dark: l.mixins.overlayColors(l.variables.interactiveColorPrimary, f.hover.dark)
|
|
163
158
|
},
|
|
164
|
-
prisma:
|
|
159
|
+
prisma: l.mixins.overlayColors(l.variables.interactiveColorPrimary, l.variables.interactiveColorOverlayHover)
|
|
165
160
|
});
|
|
166
|
-
|
|
161
|
+
n = (0, l.pick)({
|
|
167
162
|
enterprise: {
|
|
168
|
-
light:
|
|
169
|
-
dark:
|
|
163
|
+
light: l.mixins.overlayColors(l.variables.interactiveColorPrimary, f.selected.light),
|
|
164
|
+
dark: l.mixins.overlayColors(l.variables.interactiveColorPrimary, f.selected.dark)
|
|
170
165
|
},
|
|
171
|
-
prisma:
|
|
166
|
+
prisma: l.mixins.overlayColors(l.variables.interactiveColorPrimary, l.variables.interactiveColorOverlaySelected)
|
|
172
167
|
});
|
|
173
|
-
d =
|
|
168
|
+
d = l.variables.contentColorInverted;
|
|
174
169
|
break;
|
|
175
170
|
}
|
|
176
171
|
|
|
177
172
|
case "destructive":
|
|
178
173
|
{
|
|
179
|
-
e =
|
|
180
|
-
a = (0,
|
|
174
|
+
e = l.variables.accentColorNegative;
|
|
175
|
+
a = (0, l.pick)({
|
|
181
176
|
enterprise: {
|
|
182
|
-
light:
|
|
183
|
-
dark:
|
|
177
|
+
light: l.mixins.overlayColors(l.variables.accentColorNegative, f.active.light),
|
|
178
|
+
dark: l.mixins.overlayColors(l.variables.accentColorNegative, f.active.dark)
|
|
184
179
|
},
|
|
185
|
-
prisma:
|
|
180
|
+
prisma: l.mixins.overlayColors(l.variables.accentColorNegative, l.variables.interactiveColorOverlayActive)
|
|
186
181
|
});
|
|
187
|
-
t = (0,
|
|
182
|
+
t = (0, l.pick)({
|
|
188
183
|
enterprise: {
|
|
189
|
-
light:
|
|
190
|
-
dark:
|
|
184
|
+
light: l.mixins.overlayColors(l.variables.accentColorNegative, f.hover.light),
|
|
185
|
+
dark: l.mixins.overlayColors(l.variables.accentColorNegative, f.hover.dark)
|
|
191
186
|
},
|
|
192
|
-
prisma:
|
|
187
|
+
prisma: l.mixins.overlayColors(l.variables.accentColorNegative, l.variables.interactiveColorOverlayHover)
|
|
193
188
|
});
|
|
194
|
-
|
|
189
|
+
n = (0, l.pick)({
|
|
195
190
|
enterprise: {
|
|
196
|
-
light:
|
|
197
|
-
dark:
|
|
191
|
+
light: l.mixins.overlayColors(l.variables.accentColorNegative, f.selected.light),
|
|
192
|
+
dark: l.mixins.overlayColors(l.variables.accentColorNegative, f.selected.dark)
|
|
198
193
|
},
|
|
199
|
-
prisma:
|
|
194
|
+
prisma: l.mixins.overlayColors(l.variables.accentColorNegative, l.variables.interactiveColorOverlaySelected)
|
|
200
195
|
});
|
|
201
|
-
d =
|
|
196
|
+
d = l.variables.contentColorInverted;
|
|
202
197
|
break;
|
|
203
198
|
}
|
|
204
199
|
|
|
205
200
|
case "secondary":
|
|
206
|
-
s =
|
|
207
|
-
c =
|
|
208
|
-
e = (0,
|
|
209
|
-
enterprise:
|
|
210
|
-
prisma:
|
|
201
|
+
s = l.variables.interactiveColorBorder;
|
|
202
|
+
c = l.variables.interactiveColorBorderDisabled;
|
|
203
|
+
e = (0, l.pick)({
|
|
204
|
+
enterprise: g,
|
|
205
|
+
prisma: l.variables.interactiveColorBackground
|
|
211
206
|
});
|
|
212
|
-
a = (0,
|
|
213
|
-
enterprise:
|
|
214
|
-
prisma:
|
|
207
|
+
a = (0, l.pick)({
|
|
208
|
+
enterprise: f.active,
|
|
209
|
+
prisma: l.variables.interactiveColorOverlayActive
|
|
215
210
|
});
|
|
216
|
-
t = (0,
|
|
217
|
-
enterprise:
|
|
218
|
-
prisma:
|
|
211
|
+
t = (0, l.pick)({
|
|
212
|
+
enterprise: f.hover,
|
|
213
|
+
prisma: l.variables.interactiveColorOverlayHover
|
|
219
214
|
});
|
|
220
|
-
|
|
221
|
-
enterprise:
|
|
222
|
-
prisma:
|
|
215
|
+
n = (0, l.pick)({
|
|
216
|
+
enterprise: f.selected,
|
|
217
|
+
prisma: l.variables.interactiveColorOverlaySelected
|
|
223
218
|
});
|
|
224
219
|
break;
|
|
225
220
|
|
|
226
|
-
case "
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
221
|
+
case "subtle":
|
|
222
|
+
// TODO: SUI-6304 this should be interactiveColorAccent once that variable is introduced in SUI 5
|
|
223
|
+
d = l.variables.interactiveColorPrimary;
|
|
224
|
+
a = (0, l.pick)({
|
|
225
|
+
enterprise: f.active,
|
|
226
|
+
prisma: l.variables.interactiveColorOverlayActive
|
|
230
227
|
});
|
|
231
|
-
t = (0,
|
|
232
|
-
enterprise:
|
|
233
|
-
prisma:
|
|
228
|
+
t = (0, l.pick)({
|
|
229
|
+
enterprise: f.hover,
|
|
230
|
+
prisma: l.variables.interactiveColorOverlayHover
|
|
234
231
|
});
|
|
235
|
-
|
|
236
|
-
enterprise:
|
|
237
|
-
prisma:
|
|
232
|
+
n = (0, l.pick)({
|
|
233
|
+
enterprise: f.selected,
|
|
234
|
+
prisma: l.variables.interactiveColorOverlaySelected
|
|
238
235
|
});
|
|
239
236
|
break;
|
|
240
237
|
|
|
@@ -246,7 +243,7 @@
|
|
|
246
243
|
backgroundDisabled: o,
|
|
247
244
|
backgroundDisabledSelected: i,
|
|
248
245
|
backgroundHover: t,
|
|
249
|
-
backgroundSelected:
|
|
246
|
+
backgroundSelected: n,
|
|
250
247
|
borderColor: s,
|
|
251
248
|
borderColorDisabled: c,
|
|
252
249
|
color: d,
|
|
@@ -254,248 +251,271 @@
|
|
|
254
251
|
};
|
|
255
252
|
return b;
|
|
256
253
|
}
|
|
257
|
-
function
|
|
258
|
-
var a = typeof r === "string" &&
|
|
254
|
+
function k(r, e) {
|
|
255
|
+
var a = typeof r === "string" && p.includes(r) ? r : undefined;
|
|
259
256
|
var o = {};
|
|
260
257
|
if (a && e !== undefined) {
|
|
261
258
|
o = e;
|
|
262
|
-
} else if (a === undefined &&
|
|
259
|
+
} else if (a === undefined && u(r) === "object" && e === undefined) {
|
|
263
260
|
o = r;
|
|
264
261
|
}
|
|
265
|
-
var i =
|
|
266
|
-
var t =
|
|
267
|
-
var x =
|
|
262
|
+
var i = h(a);
|
|
263
|
+
var t = b()(i, o), s = t.background, c = t.backgroundActive, d = t.backgroundDisabled, v = t.backgroundDisabledSelected, f = t.backgroundHover, g = t.backgroundSelected, y = t.borderColor, k = t.borderColorDisabled, m = t.color, C = t.colorDisabled;
|
|
264
|
+
var x = s != null && s !== "transparent";
|
|
268
265
|
return function() {
|
|
269
|
-
return (0,
|
|
270
|
-
return
|
|
266
|
+
return (0, n.css)([ "border-radius:", ";", ";", " ", " cursor:pointer;position:relative;&:focus,&:hover{z-index:3;}&:not([disabled],[aria-disabled='true']){background-color:", ";color:", ";transition:background-color 0.2s,box-shadow 0.2s,text-decoration 0.2s;&:hover{background-color:", ";}&:active{background-color:", ";transition:none;}", "}&:focus{box-shadow:", ";}&[disabled],&[aria-disabled='true']{border-color:", ";color:", ";cursor:not-allowed;", "}" ], l.variables.borderRadius, (function() {
|
|
267
|
+
return y && (0, n.css)([ "border:1px solid ", ";" ], y);
|
|
271
268
|
}), (function(r) {
|
|
272
269
|
var e = r.$append;
|
|
273
|
-
return e && (0,
|
|
270
|
+
return e && (0, n.css)([ "border-top-right-radius:0.1px;border-bottom-right-radius:0.1px;border-right:none;" ]);
|
|
274
271
|
}), (function(r) {
|
|
275
272
|
var e = r.$prepend;
|
|
276
|
-
return e && (0,
|
|
277
|
-
}),
|
|
273
|
+
return e && (0, n.css)([ "border-top-left-radius:0.1px;border-bottom-left-radius:0.1px;" ]);
|
|
274
|
+
}), s, m, f, c, (function(r) {
|
|
278
275
|
var e = r.$selected;
|
|
279
|
-
return e && (0,
|
|
280
|
-
}),
|
|
281
|
-
return x && (0,
|
|
282
|
-
/* TODO: this isn't defined in SUI 5 themes yet */ :
|
|
276
|
+
return e && (0, n.css)([ "background-color:", ";" ], g);
|
|
277
|
+
}), l.variables.focusShadow, k, C, (function(r) {
|
|
278
|
+
return x && (0, n.css)([ "background-color:", ";" ], r ? v
|
|
279
|
+
/* TODO: this isn't defined in SUI 5 themes yet */ : d);
|
|
283
280
|
}));
|
|
284
281
|
};
|
|
285
282
|
}
|
|
286
|
-
/* harmony default export */ const
|
|
283
|
+
/* harmony default export */ const m = k;
|
|
287
284
|
// CONCATENATED MODULE: ./src/ButtonSimple/prismaStyles.ts
|
|
288
|
-
var
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
285
|
+
var C = (0, n.css)([ "", " &:not([disabled],[aria-disabled='true']){&:focus{background-color:", ";}&:hover{border-color:", ";", "}", " ", "}&[disabled],&[aria-disabled='true']{", "}" ], (0,
|
|
286
|
+
l.pickVariant)("$variant", {
|
|
287
|
+
secondary: (0, n.css)([ "", " font-weight:", ";" ], m("subtle", {
|
|
288
|
+
color: l.variables.contentColorActive
|
|
289
|
+
}), l.variables.fontWeightSemiBold),
|
|
290
|
+
subtle: (0, n.css)([ "", " font-weight:", ";" ], m("subtle", {
|
|
291
|
+
color: l.variables.contentColorActive
|
|
292
|
+
}), l.variables.fontWeightSemiBold),
|
|
293
|
+
default: (0, n.css)([ "", " font-weight:", ";" ], m("secondary", {
|
|
292
294
|
background: "transparent"
|
|
293
|
-
}),
|
|
294
|
-
|
|
295
|
+
}), l.variables.fontWeightSemiBold),
|
|
296
|
+
toggle: (0, n.css)([ "", " font-weight:normal;" ], m("secondary", {
|
|
295
297
|
background: "transparent"
|
|
296
298
|
}))
|
|
297
|
-
}),
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
299
|
+
}), l.variables.interactiveColorOverlayHover, l.variables.interactiveColorBorderHover, (0,
|
|
300
|
+
l.pickVariant)("$variant", {
|
|
301
|
+
secondary: (0, n.css)([ "box-shadow:", ";" ], l.variables.hoverShadow),
|
|
302
|
+
default: (0, n.css)([ "box-shadow:", ";" ], l.variables.hoverShadow),
|
|
303
|
+
subtle: (0, n.css)([ "box-shadow:", ";" ], l.variables.hoverShadow)
|
|
301
304
|
}), (function(r) {
|
|
302
305
|
var e = r.$selected;
|
|
303
|
-
return e && (0,
|
|
306
|
+
return e && (0, n.css)([ "border-color:", ";&:hover{background-color:", ";}" ], l.variables.interactiveColorBorderDisabled, l.mixins.overlayColors(l.variables.interactiveColorOverlaySelected, l.variables.interactiveColorOverlayHover));
|
|
304
307
|
}), (function(r) {
|
|
305
308
|
var e = r.$error;
|
|
306
|
-
return e && (0,
|
|
309
|
+
return e && (0, n.css)([ "border-color:", ";&:hover{border-color:", ";}" ], l.variables.accentColorNegative, l.variables.accentColorNegative);
|
|
307
310
|
}), (function(r) {
|
|
308
311
|
var e = r.$selected;
|
|
309
|
-
return e && (0,
|
|
312
|
+
return e && (0, n.css)([ "background-color:", ";" ], l.mixins.overlayColors(l.variables.interactiveColorBackgroundDisabled, l.variables.interactiveColorOverlaySelected));
|
|
310
313
|
}));
|
|
311
|
-
var
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
314
|
+
var x = (0, n.css)([ "", " font-weight:", ";&:focus{background-color:", ";}&:hover{box-shadow:", ";}" ], (0,
|
|
315
|
+
l.pickVariant)("$variant", {
|
|
316
|
+
primary: m("primary"),
|
|
317
|
+
destructive: m("destructive"),
|
|
318
|
+
flat: m({
|
|
319
|
+
// this is intentional - the background had always been applying the $selected style
|
|
320
|
+
// since beccfde78f787861217353e9149ce213bee0270 so keeping this for visual consistency
|
|
321
|
+
background: l.mixins.overlayColors(l.variables.interactiveColorBackground, l.variables.interactiveColorOverlaySelected),
|
|
322
|
+
backgroundActive: l.mixins.overlayColors(l.variables.interactiveColorBackground, l.variables.interactiveColorOverlayActive),
|
|
323
|
+
backgroundHover: l.mixins.overlayColors(l.variables.interactiveColorBackground, l.variables.interactiveColorOverlayHover),
|
|
324
|
+
backgroundSelected: l.mixins.overlayColors(l.variables.interactiveColorBackground, l.variables.interactiveColorOverlaySelected)
|
|
325
|
+
})
|
|
326
|
+
}), l.variables.fontWeightSemiBold, (0, l.pickVariant)("$variant", {
|
|
327
|
+
primary: l.mixins.overlayColors(l.variables.interactiveColorPrimary, l.variables.interactiveColorOverlayHover),
|
|
328
|
+
destructive: l.mixins.overlayColors(l.variables.accentColorNegative, l.variables.interactiveColorOverlayHover),
|
|
329
|
+
flat: l.mixins.overlayColors(l.variables.interactiveColorBackground, l.variables.interactiveColorOverlayHover)
|
|
330
|
+
}), l.variables.hoverShadow);
|
|
327
331
|
// CONCATENATED MODULE: ./src/ButtonSimple/enterpriseStyles.ts
|
|
328
|
-
var
|
|
332
|
+
var w = "#1A8929";
|
|
329
333
|
// SUI-2439 to meet WCAG AA compliance
|
|
330
|
-
var
|
|
334
|
+
var S = "#235823";
|
|
331
335
|
// SUI-2439 to meet WCAG AA compliance
|
|
332
|
-
var
|
|
333
|
-
var
|
|
336
|
+
var O = (0, n.css)([ "border-radius:", ";cursor:pointer;position:relative;&:focus{z-index:3;}" ], l.variables.borderRadius);
|
|
337
|
+
var $ = (0, n.css)([ "", " ", "" ], (function(r) {
|
|
334
338
|
var e = r.$append;
|
|
335
|
-
return e && (0,
|
|
339
|
+
return e && (0, n.css)([ "border-top-right-radius:0;border-bottom-right-radius:0;border-right:none;" ]);
|
|
336
340
|
}), (function(r) {
|
|
337
341
|
var e = r.$prepend;
|
|
338
|
-
return e && (0,
|
|
342
|
+
return e && (0, n.css)([ "border-top-left-radius:0;border-bottom-left-radius:0;" ]);
|
|
339
343
|
}));
|
|
340
|
-
var
|
|
341
|
-
var
|
|
342
|
-
var
|
|
343
|
-
|
|
344
|
-
light: (0,
|
|
345
|
-
dark:
|
|
346
|
-
}),
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
}), (0,
|
|
350
|
-
light:
|
|
351
|
-
dark:
|
|
352
|
-
}), (0,
|
|
353
|
-
light:
|
|
354
|
-
dark:
|
|
355
|
-
}), (0,
|
|
356
|
-
light: (0,
|
|
357
|
-
dark: (0,
|
|
344
|
+
var D = "inset 0 -1px 0 rgba(0, 0, 0, 0.1)";
|
|
345
|
+
var P = "inset 0 1px 0 rgba(0, 0, 0, 0.1)";
|
|
346
|
+
var j = (0, n.css)([ "", ";border:", ";", ";font-weight:", ";&:not([disabled],[aria-disabled='true']){background-color:", ";color:", ";transition:background-image 0.2s,border 0.2s,box-shadow 0.2s,text-decoration 0.2s;", ";", " &:hover{background-color:", ";box-shadow:", ";}&:active{transition:none;background-color:", ";border-color:", ";", ";}&:focus{", " ", "}}&:not([disabled]){&:focus{box-shadow:", ",", ";}}&[disabled],&[aria-disabled='true']{cursor:not-allowed;color:", ";background-color:", ";border-color:", ";", "}" ], O, (0,
|
|
347
|
+
l.pick)({
|
|
348
|
+
light: (0, n.css)([ "1px solid ", "" ], l.variables.gray60),
|
|
349
|
+
dark: l.variables.border
|
|
350
|
+
}), $, (0, l.pickVariant)("$variant", {
|
|
351
|
+
default: "normal",
|
|
352
|
+
secondary: l.variables.fontWeightSemiBold
|
|
353
|
+
}), (0, l.pick)({
|
|
354
|
+
light: l.variables.gray98,
|
|
355
|
+
dark: l.variables.gray45
|
|
356
|
+
}), (0, l.pick)({
|
|
357
|
+
light: l.variables.gray45,
|
|
358
|
+
dark: l.variables.white
|
|
359
|
+
}), (0, l.pick)({
|
|
360
|
+
light: (0, n.css)([ "box-shadow:", ";" ], D),
|
|
361
|
+
dark: (0, n.css)([ "box-shadow:inset 0 -1px 0 ", ";" ], l.variables.gray30)
|
|
358
362
|
}), (function(r) {
|
|
359
363
|
var e = r.$selected;
|
|
360
|
-
return e && (0,
|
|
361
|
-
|
|
362
|
-
light:
|
|
363
|
-
dark: (0,
|
|
364
|
-
}), (0,
|
|
365
|
-
light:
|
|
366
|
-
dark:
|
|
367
|
-
}), (0,
|
|
368
|
-
light:
|
|
369
|
-
dark:
|
|
364
|
+
return e && (0, n.css)([ "box-shadow:", ";background-color:", ";border-color:", ";" ], (0,
|
|
365
|
+
l.pick)({
|
|
366
|
+
light: P,
|
|
367
|
+
dark: (0, n.css)([ "inset 0 1px 0 ", "" ], l.variables.black)
|
|
368
|
+
}), (0, l.pick)({
|
|
369
|
+
light: l.variables.gray92,
|
|
370
|
+
dark: l.variables.gray22
|
|
371
|
+
}), (0, l.pick)({
|
|
372
|
+
light: l.variables.gray60,
|
|
373
|
+
dark: l.variables.gray20
|
|
370
374
|
}));
|
|
371
|
-
}), (0,
|
|
375
|
+
}), (0, l.pick)({
|
|
372
376
|
light: "#ebeeef",
|
|
373
|
-
dark:
|
|
374
|
-
}), (0,
|
|
375
|
-
light:
|
|
376
|
-
dark: (0,
|
|
377
|
-
}), (0,
|
|
378
|
-
light:
|
|
379
|
-
dark:
|
|
380
|
-
}), (0,
|
|
381
|
-
light:
|
|
382
|
-
dark:
|
|
383
|
-
}), (0,
|
|
384
|
-
dark: (0,
|
|
377
|
+
dark: l.variables.gray30
|
|
378
|
+
}), (0, l.pick)({
|
|
379
|
+
light: D,
|
|
380
|
+
dark: (0, n.css)([ "inset 0 -1px 0 ", "" ], l.variables.gray25)
|
|
381
|
+
}), (0, l.pick)({
|
|
382
|
+
light: l.variables.gray92,
|
|
383
|
+
dark: l.variables.gray22
|
|
384
|
+
}), (0, l.pick)({
|
|
385
|
+
light: l.variables.gray60,
|
|
386
|
+
dark: l.variables.gray20
|
|
387
|
+
}), (0, l.pick)({
|
|
388
|
+
dark: (0, n.css)([ "box-shadow:inset 0 -1px 0 ", ";" ], l.variables.gray22)
|
|
385
389
|
}), (function(r) {
|
|
386
390
|
var e = r.$append;
|
|
387
|
-
return e && (0,
|
|
388
|
-
light:
|
|
389
|
-
dark: (0,
|
|
390
|
-
}),
|
|
391
|
+
return e && (0, n.css)([ "box-shadow:", ",", ",inset -1px 0 0 ", ";" ], (0, l.pick)({
|
|
392
|
+
light: D,
|
|
393
|
+
dark: (0, n.css)([ "inset 0 -1px 0 ", "" ], l.variables.gray30)
|
|
394
|
+
}), l.variables.focusShadow, l.variables.borderColor);
|
|
391
395
|
}), (function(r) {
|
|
392
396
|
var e = r.$append, a = r.$selected;
|
|
393
|
-
return e && a && (0,
|
|
394
|
-
light: (0,
|
|
395
|
-
dark: (0,
|
|
397
|
+
return e && a && (0, l.pick)({
|
|
398
|
+
light: (0, n.css)([ "box-shadow:", ",", ",", ",inset -1px 0 0 ", ";" ], D, P, l.variables.focusShadow, l.variables.borderColor),
|
|
399
|
+
dark: (0, n.css)([ "box-shadow:inset 0 1px 0 ", ",", ",inset -1px 0 0 ", ";" ], l.variables.black, l.variables.focusShadow, l.variables.borderColor)
|
|
396
400
|
});
|
|
397
|
-
}), (0,
|
|
398
|
-
light:
|
|
399
|
-
dark: (0,
|
|
400
|
-
}),
|
|
401
|
-
light:
|
|
402
|
-
dark:
|
|
403
|
-
}), (0,
|
|
404
|
-
light:
|
|
405
|
-
dark:
|
|
401
|
+
}), (0, l.pick)({
|
|
402
|
+
light: D,
|
|
403
|
+
dark: (0, n.css)([ "inset 0 -1px 0 ", "" ], l.variables.gray30)
|
|
404
|
+
}), l.variables.focusShadow, l.variables.textDisabledColor, (0, l.pick)({
|
|
405
|
+
light: l.variables.gray96,
|
|
406
|
+
dark: l.variables.gray30
|
|
407
|
+
}), (0, l.pick)({
|
|
408
|
+
light: l.variables.borderLightColor,
|
|
409
|
+
dark: l.variables.gray30
|
|
406
410
|
}), (function(r) {
|
|
407
411
|
var e = r.$selected;
|
|
408
|
-
return e && (0,
|
|
409
|
-
light: (0,
|
|
410
|
-
dark: (0,
|
|
412
|
+
return e && (0, l.pick)({
|
|
413
|
+
light: (0, n.css)([ "box-shadow:", ";background-color:", ";border-color:", ";" ], P, l.variables.gray92, l.variables.gray80),
|
|
414
|
+
dark: (0, n.css)([ "box-shadow:inset 0 1px 0 ", ";background-color:", ";border-color:", ";" ], l.variables.black, l.variables.gray22, l.variables.gray20)
|
|
411
415
|
});
|
|
412
416
|
}));
|
|
413
|
-
var
|
|
414
|
-
var
|
|
415
|
-
var
|
|
417
|
+
var A = "inset 0 -2px 0 rgba(0, 0, 0, 0.1)";
|
|
418
|
+
var B = "inset 0 2px 0 rgba(0, 0, 0, 0.1)";
|
|
419
|
+
var N = (0, n.css)([ "", ";font-weight:", ";", " &:not([disabled],[aria-disabled='true']){background-color:", ";color:", ";box-shadow:", ";transition:background-image 0.2s,border 0.2s,box-shadow 0.2s,text-decoration 0.2s;", " ", " &:hover{background-color:", ";}&:active{background-color:", ";transition:none;}&:focus{&:active{background-color:", ";transition:none;}}}&:not([disabled]){&:focus{box-shadow:", ",", ";}}&[disabled],&[aria-disabled='true']{color:", ";background-color:", ";cursor:not-allowed;", "}" ], O, l.variables.fontWeightSemiBold, $, w, l.variables.white, A, (function(r) {
|
|
416
420
|
var e = r.$selected;
|
|
417
|
-
return e && (0,
|
|
421
|
+
return e && (0, n.css)([ "box-shadow:", ";background-color:", ";" ], B, S);
|
|
418
422
|
}), (function(r) {
|
|
419
423
|
var e = r.$prepend;
|
|
420
|
-
return e && (0,
|
|
421
|
-
}),
|
|
424
|
+
return e && (0, n.css)([ "border-left:1px solid ", ";" ], w);
|
|
425
|
+
}), l.variables.brandColorD50, l.variables.brandColorD30, l.variables.brandColorD30, A, l.variables.focusShadow, l.variables.brandColorL30, l.variables.brandColorL10, (function(r) {
|
|
422
426
|
var e = r.$selected;
|
|
423
|
-
return e && (0,
|
|
427
|
+
return e && (0, n.css)([ "box-shadow:", ";background-color:", ";" ], B, l.variables.brandColorD20);
|
|
424
428
|
}));
|
|
425
|
-
var
|
|
429
|
+
var H = (0, n.css)([ "", ";font-weight:", ";", " &:not([disabled],[aria-disabled='true']){background-color:", ";color:", ";box-shadow:", ";transition:background-image 0.2s,border 0.2s,box-shadow 0.2s,text-decoration 0.2s;", " ", " &:hover{background-color:", ";}&:active{background-color:", ";transition:none;}&:focus{&:active{background-color:", ";transition:none;}}}&:not([disabled]){&:focus{box-shadow:", ",", ";}}&[disabled],&[aria-disabled='true']{color:", ";background-color:", ";cursor:not-allowed;", "}" ], O, l.variables.fontWeightSemiBold, $, l.variables.errorColorD10, l.variables.white, A, (function(r) {
|
|
426
430
|
var e = r.$selected;
|
|
427
|
-
return e && (0,
|
|
431
|
+
return e && (0, n.css)([ "box-shadow:", ";background-color:", ";" ], B, l.variables.errorColorD30);
|
|
428
432
|
}), (function(r) {
|
|
429
433
|
var e = r.$prepend;
|
|
430
|
-
return e && (0,
|
|
431
|
-
}),
|
|
434
|
+
return e && (0, n.css)([ "border-left:1px solid ", ";" ], l.variables.errorColorD30);
|
|
435
|
+
}), l.variables.errorColorD30, l.variables.errorColorD40, l.variables.errorColorD40, A, l.variables.focusShadow, l.variables.errorColorL10, l.variables.errorColorD10, (function(r) {
|
|
432
436
|
var e = r.$selected;
|
|
433
|
-
return e && (0,
|
|
437
|
+
return e && (0, n.css)([ "box-shadow:", ";background-color:", ";" ], B, l.variables.errorColorD40);
|
|
434
438
|
}));
|
|
435
|
-
var
|
|
436
|
-
|
|
437
|
-
light:
|
|
438
|
-
dark:
|
|
439
|
+
var _ = (0, n.css)([ "", ";color:", ";border:1px solid transparent;&:not([disabled],[aria-disabled='true']){transition:background-color 0.2s,border 0.2s,box-shadow 0.2s,text-decoration 0.2s;", " &:hover{color:", ";background-color:", ";border-color:", ";}", " &:focus{color:", ";}&:active,&[aria-expanded='true']{background-color:", ";transition:none;}}&:not([disabled]){&:focus{box-shadow:", ";}}&[disabled],&[aria-disabled='true']{color:", ";cursor:not-allowed;", "}" ], O, (0,
|
|
440
|
+
l.pick)({
|
|
441
|
+
light: l.variables.gray45,
|
|
442
|
+
dark: l.variables.white
|
|
439
443
|
}), (function(r) {
|
|
440
444
|
var e = r.$selected;
|
|
441
|
-
return e && (0,
|
|
442
|
-
}), (0,
|
|
443
|
-
light:
|
|
444
|
-
dark:
|
|
445
|
-
}),
|
|
446
|
-
light:
|
|
447
|
-
dark:
|
|
445
|
+
return e && (0, n.css)([ "border-color:", ";" ], l.variables.accentColor);
|
|
446
|
+
}), (0, l.pick)({
|
|
447
|
+
light: l.variables.linkColor,
|
|
448
|
+
dark: l.variables.white
|
|
449
|
+
}), l.variables.backgroundColorHover, (0, l.pick)({
|
|
450
|
+
light: l.variables.gray60,
|
|
451
|
+
dark: l.variables.borderColor
|
|
448
452
|
}), (function(r) {
|
|
449
453
|
var e = r.$error;
|
|
450
|
-
return e && (0,
|
|
451
|
-
}), (0,
|
|
452
|
-
light:
|
|
453
|
-
dark:
|
|
454
|
-
}), (0,
|
|
455
|
-
light:
|
|
456
|
-
dark:
|
|
457
|
-
}),
|
|
454
|
+
return e && (0, n.css)([ "&,&:hover{color:", ";}" ], l.variables.errorColor);
|
|
455
|
+
}), (0, l.pick)({
|
|
456
|
+
light: l.variables.linkColor,
|
|
457
|
+
dark: l.variables.white
|
|
458
|
+
}), (0, l.pick)({
|
|
459
|
+
light: l.variables.gray92,
|
|
460
|
+
dark: l.variables.gray22
|
|
461
|
+
}), l.variables.focusShadow, l.variables.textDisabledColor, (function(r) {
|
|
458
462
|
var e = r.$selected;
|
|
459
|
-
return e && (0,
|
|
463
|
+
return e && (0, n.css)([ "border-color:", ";" ], l.variables.borderLightColor);
|
|
460
464
|
}));
|
|
461
465
|
// CONCATENATED MODULE: ./src/ButtonSimple/ButtonSimpleStyles.ts
|
|
462
|
-
var
|
|
466
|
+
var T = s()(d()).withConfig({
|
|
463
467
|
displayName: "ButtonSimpleStyles__StyledClickable",
|
|
464
468
|
componentId: "vlarwe-0"
|
|
465
|
-
})([ "", " ", "" ],
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
469
|
+
})([ "", " ", "" ], (function(r) {
|
|
470
|
+
var e = r.to;
|
|
471
|
+
return e ? (0, n.css)([ "", " align-items:center;justify-content:center;" ], l.mixins.reset("flex")) : (0,
|
|
472
|
+
n.css)([ "", "" ], l.mixins.reset("block"));
|
|
473
|
+
}), (0, l.pick)({
|
|
474
|
+
enterprise: (0, l.pickVariant)("$variant", {
|
|
475
|
+
// the four main styles
|
|
476
|
+
primary: N,
|
|
477
|
+
secondary: j,
|
|
478
|
+
destructive: H,
|
|
479
|
+
subtle: _,
|
|
480
|
+
// same as "secondary"
|
|
481
|
+
default: j,
|
|
482
|
+
// "pill" is an Enterprise-only style
|
|
483
|
+
pill: _,
|
|
484
|
+
// fallbacks for styles unsupported by Enterprise
|
|
485
|
+
toggle: j,
|
|
486
|
+
flat: j
|
|
473
487
|
}),
|
|
474
|
-
prisma: (0,
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
488
|
+
prisma: (0, l.pickVariant)("$variant", {
|
|
489
|
+
// the four main styles
|
|
490
|
+
primary: x,
|
|
491
|
+
secondary: C,
|
|
492
|
+
destructive: x,
|
|
493
|
+
subtle: C,
|
|
494
|
+
// same as "secondary"
|
|
495
|
+
default: C,
|
|
496
|
+
// "toggle" and "flat" are Prisma-only styles
|
|
497
|
+
toggle: C,
|
|
498
|
+
flat: x,
|
|
499
|
+
// fallback for "pill" which is not supported by Prisma
|
|
500
|
+
pill: C
|
|
481
501
|
})
|
|
482
502
|
}));
|
|
483
503
|
// CONCATENATED MODULE: ./src/ButtonSimple/ButtonSimple.tsx
|
|
484
|
-
function
|
|
504
|
+
function I(r) {
|
|
485
505
|
"@babel/helpers - typeof";
|
|
486
506
|
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
|
487
|
-
|
|
507
|
+
I = function r(e) {
|
|
488
508
|
return typeof e;
|
|
489
509
|
};
|
|
490
510
|
} else {
|
|
491
|
-
|
|
511
|
+
I = function r(e) {
|
|
492
512
|
return e && typeof Symbol === "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
|
|
493
513
|
};
|
|
494
514
|
}
|
|
495
|
-
return
|
|
515
|
+
return I(r);
|
|
496
516
|
}
|
|
497
|
-
function
|
|
498
|
-
|
|
517
|
+
function R() {
|
|
518
|
+
R = Object.assign || function(r) {
|
|
499
519
|
for (var e = 1; e < arguments.length; e++) {
|
|
500
520
|
var a = arguments[e];
|
|
501
521
|
for (var o in a) {
|
|
@@ -506,11 +526,11 @@
|
|
|
506
526
|
}
|
|
507
527
|
return r;
|
|
508
528
|
};
|
|
509
|
-
return
|
|
529
|
+
return R.apply(this, arguments);
|
|
510
530
|
}
|
|
511
|
-
function
|
|
531
|
+
function V(r, e) {
|
|
512
532
|
if (r == null) return {};
|
|
513
|
-
var a =
|
|
533
|
+
var a = W(r, e);
|
|
514
534
|
var o, i;
|
|
515
535
|
if (Object.getOwnPropertySymbols) {
|
|
516
536
|
var t = Object.getOwnPropertySymbols(r);
|
|
@@ -523,7 +543,7 @@
|
|
|
523
543
|
}
|
|
524
544
|
return a;
|
|
525
545
|
}
|
|
526
|
-
function
|
|
546
|
+
function W(r, e) {
|
|
527
547
|
if (r == null) return {};
|
|
528
548
|
var a = {};
|
|
529
549
|
var o = Object.keys(r);
|
|
@@ -535,12 +555,12 @@
|
|
|
535
555
|
}
|
|
536
556
|
return a;
|
|
537
557
|
}
|
|
538
|
-
function
|
|
558
|
+
function q(r, e) {
|
|
539
559
|
if (!(r instanceof e)) {
|
|
540
560
|
throw new TypeError("Cannot call a class as a function");
|
|
541
561
|
}
|
|
542
562
|
}
|
|
543
|
-
function
|
|
563
|
+
function E(r, e) {
|
|
544
564
|
for (var a = 0; a < e.length; a++) {
|
|
545
565
|
var o = e[a];
|
|
546
566
|
o.enumerable = o.enumerable || false;
|
|
@@ -549,12 +569,12 @@
|
|
|
549
569
|
Object.defineProperty(r, o.key, o);
|
|
550
570
|
}
|
|
551
571
|
}
|
|
552
|
-
function
|
|
553
|
-
if (e)
|
|
554
|
-
if (a)
|
|
572
|
+
function M(r, e, a) {
|
|
573
|
+
if (e) E(r.prototype, e);
|
|
574
|
+
if (a) E(r, a);
|
|
555
575
|
return r;
|
|
556
576
|
}
|
|
557
|
-
function
|
|
577
|
+
function L(r, e) {
|
|
558
578
|
if (typeof e !== "function" && e !== null) {
|
|
559
579
|
throw new TypeError("Super expression must either be null or a function");
|
|
560
580
|
}
|
|
@@ -565,41 +585,41 @@
|
|
|
565
585
|
configurable: true
|
|
566
586
|
}
|
|
567
587
|
});
|
|
568
|
-
if (e)
|
|
588
|
+
if (e) z(r, e);
|
|
569
589
|
}
|
|
570
|
-
function
|
|
571
|
-
|
|
590
|
+
function z(r, e) {
|
|
591
|
+
z = Object.setPrototypeOf || function r(e, a) {
|
|
572
592
|
e.__proto__ = a;
|
|
573
593
|
return e;
|
|
574
594
|
};
|
|
575
|
-
return
|
|
595
|
+
return z(r, e);
|
|
576
596
|
}
|
|
577
|
-
function
|
|
578
|
-
var e =
|
|
597
|
+
function U(r) {
|
|
598
|
+
var e = J();
|
|
579
599
|
return function a() {
|
|
580
|
-
var o =
|
|
600
|
+
var o = K(r), i;
|
|
581
601
|
if (e) {
|
|
582
|
-
var t =
|
|
602
|
+
var t = K(this).constructor;
|
|
583
603
|
i = Reflect.construct(o, arguments, t);
|
|
584
604
|
} else {
|
|
585
605
|
i = o.apply(this, arguments);
|
|
586
606
|
}
|
|
587
|
-
return
|
|
607
|
+
return F(this, i);
|
|
588
608
|
};
|
|
589
609
|
}
|
|
590
|
-
function
|
|
591
|
-
if (e && (
|
|
610
|
+
function F(r, e) {
|
|
611
|
+
if (e && (I(e) === "object" || typeof e === "function")) {
|
|
592
612
|
return e;
|
|
593
613
|
}
|
|
594
|
-
return
|
|
614
|
+
return G(r);
|
|
595
615
|
}
|
|
596
|
-
function
|
|
616
|
+
function G(r) {
|
|
597
617
|
if (r === void 0) {
|
|
598
618
|
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
599
619
|
}
|
|
600
620
|
return r;
|
|
601
621
|
}
|
|
602
|
-
function
|
|
622
|
+
function J() {
|
|
603
623
|
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
604
624
|
if (Reflect.construct.sham) return false;
|
|
605
625
|
if (typeof Proxy === "function") return true;
|
|
@@ -610,13 +630,13 @@
|
|
|
610
630
|
return false;
|
|
611
631
|
}
|
|
612
632
|
}
|
|
613
|
-
function
|
|
614
|
-
|
|
633
|
+
function K(r) {
|
|
634
|
+
K = Object.setPrototypeOf ? Object.getPrototypeOf : function r(e) {
|
|
615
635
|
return e.__proto__ || Object.getPrototypeOf(e);
|
|
616
636
|
};
|
|
617
|
-
return
|
|
637
|
+
return K(r);
|
|
618
638
|
}
|
|
619
|
-
function
|
|
639
|
+
function Q(r, e, a) {
|
|
620
640
|
if (e in r) {
|
|
621
641
|
Object.defineProperty(r, e, {
|
|
622
642
|
value: a,
|
|
@@ -629,9 +649,41 @@
|
|
|
629
649
|
}
|
|
630
650
|
return r;
|
|
631
651
|
}
|
|
632
|
-
|
|
652
|
+
function X(r) {
|
|
653
|
+
return er(r) || rr(r) || Z(r) || Y();
|
|
654
|
+
}
|
|
655
|
+
function Y() {
|
|
656
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
657
|
+
}
|
|
658
|
+
function Z(r, e) {
|
|
659
|
+
if (!r) return;
|
|
660
|
+
if (typeof r === "string") return ar(r, e);
|
|
661
|
+
var a = Object.prototype.toString.call(r).slice(8, -1);
|
|
662
|
+
if (a === "Object" && r.constructor) a = r.constructor.name;
|
|
663
|
+
if (a === "Map" || a === "Set") return Array.from(r);
|
|
664
|
+
if (a === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)) return ar(r, e);
|
|
665
|
+
}
|
|
666
|
+
function rr(r) {
|
|
667
|
+
if (typeof Symbol !== "undefined" && Symbol.iterator in Object(r)) return Array.from(r);
|
|
668
|
+
}
|
|
669
|
+
function er(r) {
|
|
670
|
+
if (Array.isArray(r)) return ar(r);
|
|
671
|
+
}
|
|
672
|
+
function ar(r, e) {
|
|
673
|
+
if (e == null || e > r.length) e = r.length;
|
|
674
|
+
for (var a = 0, o = new Array(e); a < e; a++) {
|
|
675
|
+
o[a] = r[a];
|
|
676
|
+
}
|
|
677
|
+
return o;
|
|
678
|
+
}
|
|
679
|
+
var or = [ "default", "secondary", "primary", "destructive", "subtle" ];
|
|
680
|
+
var ir = [].concat(or, [ "pill" ]);
|
|
681
|
+
var tr = [].concat(or, [ "toggle", "flat" ]);
|
|
682
|
+
// Array.from(new Set... is used to de-duplicate the appearances
|
|
683
|
+
var lr = Array.from(new Set([].concat(X(ir), X(tr))));
|
|
684
|
+
var nr = {
|
|
633
685
|
action: t().string,
|
|
634
|
-
appearance: t().oneOf([ "default", "secondary", "primary", "destructive", "pill", "toggle", "flat" ]),
|
|
686
|
+
appearance: t().oneOf([ "default", "secondary", "primary", "destructive", "subtle", "pill", "toggle", "flat" ]),
|
|
635
687
|
append: t().bool,
|
|
636
688
|
children: t().node,
|
|
637
689
|
disabled: t().oneOfType([ t().bool, t().oneOf([ "dimmed" ]) ]),
|
|
@@ -644,57 +696,32 @@
|
|
|
644
696
|
splunkTheme: t().object,
|
|
645
697
|
to: t().string
|
|
646
698
|
};
|
|
647
|
-
var
|
|
699
|
+
var sr = {
|
|
648
700
|
appearance: "default",
|
|
649
701
|
append: false,
|
|
650
702
|
disabled: false,
|
|
651
703
|
error: false,
|
|
652
704
|
inline: true,
|
|
653
705
|
openInNewContext: false,
|
|
654
|
-
prepend: false
|
|
655
|
-
selected: false
|
|
656
|
-
};
|
|
657
|
-
var or = function r(e, a) {
|
|
658
|
-
var o = {
|
|
659
|
-
default: "enterpriseDefault",
|
|
660
|
-
destructive: "enterpriseError",
|
|
661
|
-
primary: "enterprisePrimary",
|
|
662
|
-
secondary: "enterpriseSecondary",
|
|
663
|
-
pill: "enterprisePill",
|
|
664
|
-
toggle: "enterpriseDefault",
|
|
665
|
-
flat: "enterpriseDefault"
|
|
666
|
-
};
|
|
667
|
-
var i = {
|
|
668
|
-
default: "prismaDefault",
|
|
669
|
-
destructive: "prismaDestructive",
|
|
670
|
-
primary: "prismaPrimary",
|
|
671
|
-
secondary: "prismaSecondary",
|
|
672
|
-
pill: "prismaSecondary",
|
|
673
|
-
toggle: "prismaToggle",
|
|
674
|
-
flat: "prismaFlat"
|
|
675
|
-
};
|
|
676
|
-
if (a === "enterprise") {
|
|
677
|
-
return o[e];
|
|
678
|
-
}
|
|
679
|
-
return i[e];
|
|
706
|
+
prepend: false
|
|
680
707
|
};
|
|
681
|
-
var
|
|
682
|
-
|
|
683
|
-
var e =
|
|
708
|
+
var cr = function(r) {
|
|
709
|
+
L(a, r);
|
|
710
|
+
var e = U(a);
|
|
684
711
|
function a() {
|
|
685
712
|
var r;
|
|
686
|
-
|
|
713
|
+
q(this, a);
|
|
687
714
|
for (var o = arguments.length, i = new Array(o), t = 0; t < o; t++) {
|
|
688
715
|
i[t] = arguments[t];
|
|
689
716
|
}
|
|
690
717
|
r = e.call.apply(e, [ this ].concat(i));
|
|
691
|
-
|
|
692
|
-
|
|
718
|
+
Q(G(r), "component", null);
|
|
719
|
+
Q(G(r), "handleMount", (function(e) {
|
|
693
720
|
r.component = e;
|
|
694
721
|
}));
|
|
695
722
|
return r;
|
|
696
723
|
}
|
|
697
|
-
|
|
724
|
+
M(a, [ {
|
|
698
725
|
key: "focus",
|
|
699
726
|
/**
|
|
700
727
|
* Places focus on the button.
|
|
@@ -704,37 +731,46 @@
|
|
|
704
731
|
(e = this.component) === null || e === void 0 ? void 0 : e.focus();
|
|
705
732
|
}
|
|
706
733
|
}, {
|
|
707
|
-
key: "
|
|
734
|
+
key: "getVariant",
|
|
708
735
|
value: function r() {
|
|
709
|
-
var e = this.props, a = e.appearance,
|
|
710
|
-
var
|
|
711
|
-
if (
|
|
712
|
-
|
|
736
|
+
var e = this.props, a = e.appearance, o = e.error, i = e.splunkTheme;
|
|
737
|
+
var t = a;
|
|
738
|
+
if (i.family === "enterprise") {
|
|
739
|
+
if (o) {
|
|
740
|
+
t = "destructive";
|
|
741
|
+
} else if (!ir.includes(a)) {
|
|
742
|
+
t = "default";
|
|
743
|
+
}
|
|
744
|
+
} else if (i.family === "prisma" && !tr.includes(a)) {
|
|
745
|
+
t = "secondary";
|
|
713
746
|
}
|
|
747
|
+
return t;
|
|
748
|
+
}
|
|
749
|
+
}, {
|
|
750
|
+
key: "render",
|
|
751
|
+
value: function r() {
|
|
752
|
+
var e = this.props, a = e.append, i = e.children, t = e.error, l = e.prepend, n = e.selected, s = V(e, [ "append", "children", "error", "prepend", "selected" ]);
|
|
714
753
|
|
|
715
|
-
return o().createElement(
|
|
716
|
-
"aria-
|
|
717
|
-
"aria-
|
|
754
|
+
return o().createElement(T, R({
|
|
755
|
+
"aria-invalid": t,
|
|
756
|
+
"aria-pressed": n,
|
|
718
757
|
"data-test": "button-simple",
|
|
719
|
-
disabled: s === true,
|
|
720
758
|
ref: this.handleMount,
|
|
721
|
-
$variant:
|
|
722
|
-
$append:
|
|
723
|
-
$prepend:
|
|
724
|
-
$selected:
|
|
725
|
-
$error:
|
|
726
|
-
},
|
|
727
|
-
onClick: n && !s ? n : undefined
|
|
728
|
-
}), t, b && o().createElement(c(), null, (0, l._)("Selected")));
|
|
759
|
+
$variant: this.getVariant(),
|
|
760
|
+
$append: a,
|
|
761
|
+
$prepend: l,
|
|
762
|
+
$selected: n || false,
|
|
763
|
+
$error: t
|
|
764
|
+
}, s), i);
|
|
729
765
|
}
|
|
730
766
|
} ]);
|
|
731
767
|
return a;
|
|
732
768
|
}(a.Component);
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
var
|
|
736
|
-
|
|
737
|
-
/* harmony default export */ const
|
|
769
|
+
Q(cr, "defaultProps", sr);
|
|
770
|
+
Q(cr, "propTypes", nr);
|
|
771
|
+
var dr = (0, l.withSplunkTheme)(cr);
|
|
772
|
+
dr.propTypes = cr.propTypes;
|
|
773
|
+
/* harmony default export */ const vr = dr;
|
|
738
774
|
// CONCATENATED MODULE: ./src/ButtonSimple/index.ts
|
|
739
775
|
module.exports = e;
|
|
740
776
|
/******/})();
|