@splunk/react-ui 4.31.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.
Files changed (40) hide show
  1. package/Button.js +42 -45
  2. package/ButtonSimple.js +533 -302
  3. package/CHANGELOG.md +32 -1
  4. package/Card.js +22 -24
  5. package/Clickable.js +86 -76
  6. package/FormRows.js +229 -207
  7. package/MIGRATION.mdx +23 -0
  8. package/Menu.js +1 -1
  9. package/Modal.js +156 -131
  10. package/Multiselect.js +47 -33
  11. package/Select.js +236 -220
  12. package/TabBar.js +18 -18
  13. package/Text.js +21 -32
  14. package/package.json +6 -6
  15. package/types/src/Button/Button.d.ts +4 -4
  16. package/types/src/ButtonSimple/ButtonSimple.d.ts +8 -6
  17. package/types/src/ButtonSimple/mixin.d.ts +27 -0
  18. package/types/src/Card/Card.d.ts +13 -5
  19. package/types/src/Clickable/Clickable.d.ts +7 -10
  20. package/types/src/Clickable/NavigationProvider.d.ts +8 -1
  21. package/types/src/Date/Date.d.ts +2 -2
  22. package/types/src/Menu/Item.d.ts +0 -1
  23. package/types/src/Number/Number.d.ts +2 -2
  24. package/types/src/Select/Select.d.ts +6 -2
  25. package/types/src/Select/SelectBase.d.ts +6 -2
  26. package/types/src/Slider/Slider.d.ts +2 -2
  27. package/types/src/Text/docs/examples/Basic.d.ts +1 -9
  28. package/types/src/Text/docs/examples/Error.d.ts +2 -10
  29. package/types/src/Text/docs/examples/Inline.d.ts +1 -9
  30. package/types/src/Text/docs/examples/Multiline.d.ts +1 -9
  31. package/types/src/Text/docs/examples/Password.d.ts +1 -9
  32. package/types/src/Text/docs/examples/Search.d.ts +1 -9
  33. package/types/src/Button/docs/examples/prisma/Basic.d.ts +0 -2
  34. package/types/src/Button/docs/examples/prisma/Block.d.ts +0 -2
  35. package/types/src/Button/docs/examples/prisma/Disabled.d.ts +0 -2
  36. package/types/src/Button/docs/examples/prisma/Icons.d.ts +0 -2
  37. package/types/src/Button/docs/examples/prisma/Menus.d.ts +0 -2
  38. package/types/src/Button/docs/examples/prisma/To.d.ts +0 -2
  39. package/types/src/Button/docs/examples/prisma/Truncated.d.ts +0 -2
  40. /package/types/src/{Button/docs/examples/prisma → Clickable/docs/examples}/Dimmed.d.ts +0 -0
package/ButtonSimple.js CHANGED
@@ -9,26 +9,26 @@
9
9
  /******/ (() => {
10
10
  /******/ // getDefaultExport function for compatibility with non-harmony modules
11
11
  /******/ r.n = e => {
12
- /******/ var o = e && e.__esModule ?
12
+ /******/ var a = e && e.__esModule ?
13
13
  /******/ () => e["default"]
14
14
  /******/ : () => e
15
15
  /******/;
16
- r.d(o, {
17
- a: o
16
+ r.d(a, {
17
+ a
18
18
  });
19
- /******/ return o;
19
+ /******/ return a;
20
20
  /******/ };
21
21
  /******/ })();
22
22
  /******/
23
23
  /******/ /* webpack/runtime/define property getters */
24
24
  /******/ (() => {
25
25
  /******/ // define getter functions for harmony exports
26
- /******/ r.d = (e, o) => {
27
- /******/ for (var a in o) {
28
- /******/ if (r.o(o, a) && !r.o(e, a)) {
29
- /******/ Object.defineProperty(e, a, {
26
+ /******/ r.d = (e, a) => {
27
+ /******/ for (var o in a) {
28
+ /******/ if (r.o(a, o) && !r.o(e, o)) {
29
+ /******/ Object.defineProperty(e, o, {
30
30
  enumerable: true,
31
- get: o[a]
31
+ get: a[o]
32
32
  });
33
33
  /******/ }
34
34
  /******/ }
@@ -61,305 +61,520 @@
61
61
  r.r(e);
62
62
  // EXPORTS
63
63
  r.d(e, {
64
- default: () => /* reexport */ Z
64
+ default: () => /* reexport */ vr
65
65
  });
66
66
  // CONCATENATED MODULE: external "react"
67
- const o = require("react");
68
- var a = r.n(o);
67
+ const a = require("react");
68
+ var o = r.n(a);
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 n = require("@splunk/themes");
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 d = require("styled-components");
81
- var b = r.n(d);
75
+ const n = require("styled-components");
76
+ var s = r.n(n);
82
77
  // CONCATENATED MODULE: external "@splunk/react-ui/Clickable"
83
- const v = require("@splunk/react-ui/Clickable");
84
- var u = r.n(v);
78
+ const c = require("@splunk/react-ui/Clickable");
79
+ var d = r.n(c);
80
+ // CONCATENATED MODULE: external "lodash/merge"
81
+ const v = require("lodash/merge");
82
+ var b = r.n(v);
83
+ // CONCATENATED MODULE: ./src/ButtonSimple/mixin.ts
84
+ function u(r) {
85
+ "@babel/helpers - typeof";
86
+ if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
87
+ u = function r(e) {
88
+ return typeof e;
89
+ };
90
+ } else {
91
+ u = function r(e) {
92
+ return e && typeof Symbol === "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
93
+ };
94
+ }
95
+ return u(r);
96
+ }
97
+ var p = [ "primary", "secondary", "destructive", "subtle" ];
98
+ /**
99
+ * These enterprise... values don't exist in Enterprise @splunk/themes
100
+ * They're provided here for TypeScript compatibility
101
+ */ var f = {
102
+ active: {
103
+ dark: "rgba(0, 0, 0, 0.2)",
104
+ light: "rgba(0, 0, 0, 0.07)"
105
+ },
106
+ hover: {
107
+ dark: "rgba(255, 255, 255, 0.05)",
108
+ light: "rgba(0, 0, 0, 0.03)"
109
+ },
110
+ selected: {
111
+ dark: "rgba(255, 255, 255, 0.1)",
112
+ light: "rgba(0, 0, 0, 0.04)"
113
+ }
114
+ };
115
+ var g = {
116
+ dark: "#272a2f",
117
+ light: "#eeeeee"
118
+ };
119
+ var y = {
120
+ dark: "rgba(255, 255, 255, 0.15)",
121
+ light: "rgba(0, 0, 0, 0.1)"
122
+ };
123
+ function h(r) {
124
+ var e = "transparent";
125
+ var a = "transparent";
126
+ var o = (0, l.pick)({
127
+ enterprise: y,
128
+ prisma: l.variables.interactiveColorBackgroundDisabled
129
+ });
130
+ var i = (0, l.pick)({
131
+ enterprise: {
132
+ dark: l.mixins.overlayColors(y.dark, f.selected.dark),
133
+ light: l.mixins.overlayColors(y.light, f.selected.light)
134
+ },
135
+ prisma: l.mixins.overlayColors(l.variables.interactiveColorBackgroundDisabled, l.variables.interactiveColorOverlaySelected)
136
+ });
137
+ var t = "transparent";
138
+ var n = "transparent";
139
+ var s;
140
+ var c;
141
+ var d = l.variables.contentColorActive;
142
+ var v = l.variables.contentColorDisabled;
143
+ switch (r) {
144
+ case "primary":
145
+ {
146
+ e = l.variables.interactiveColorPrimary;
147
+ a = (0, l.pick)({
148
+ enterprise: {
149
+ light: l.mixins.overlayColors(l.variables.interactiveColorPrimary, f.active.light),
150
+ dark: l.mixins.overlayColors(l.variables.interactiveColorPrimary, f.active.dark)
151
+ },
152
+ prisma: l.mixins.overlayColors(l.variables.interactiveColorPrimary, l.variables.interactiveColorOverlayActive)
153
+ });
154
+ t = (0, l.pick)({
155
+ enterprise: {
156
+ light: l.mixins.overlayColors(l.variables.interactiveColorPrimary, f.hover.light),
157
+ dark: l.mixins.overlayColors(l.variables.interactiveColorPrimary, f.hover.dark)
158
+ },
159
+ prisma: l.mixins.overlayColors(l.variables.interactiveColorPrimary, l.variables.interactiveColorOverlayHover)
160
+ });
161
+ n = (0, l.pick)({
162
+ enterprise: {
163
+ light: l.mixins.overlayColors(l.variables.interactiveColorPrimary, f.selected.light),
164
+ dark: l.mixins.overlayColors(l.variables.interactiveColorPrimary, f.selected.dark)
165
+ },
166
+ prisma: l.mixins.overlayColors(l.variables.interactiveColorPrimary, l.variables.interactiveColorOverlaySelected)
167
+ });
168
+ d = l.variables.contentColorInverted;
169
+ break;
170
+ }
171
+
172
+ case "destructive":
173
+ {
174
+ e = l.variables.accentColorNegative;
175
+ a = (0, l.pick)({
176
+ enterprise: {
177
+ light: l.mixins.overlayColors(l.variables.accentColorNegative, f.active.light),
178
+ dark: l.mixins.overlayColors(l.variables.accentColorNegative, f.active.dark)
179
+ },
180
+ prisma: l.mixins.overlayColors(l.variables.accentColorNegative, l.variables.interactiveColorOverlayActive)
181
+ });
182
+ t = (0, l.pick)({
183
+ enterprise: {
184
+ light: l.mixins.overlayColors(l.variables.accentColorNegative, f.hover.light),
185
+ dark: l.mixins.overlayColors(l.variables.accentColorNegative, f.hover.dark)
186
+ },
187
+ prisma: l.mixins.overlayColors(l.variables.accentColorNegative, l.variables.interactiveColorOverlayHover)
188
+ });
189
+ n = (0, l.pick)({
190
+ enterprise: {
191
+ light: l.mixins.overlayColors(l.variables.accentColorNegative, f.selected.light),
192
+ dark: l.mixins.overlayColors(l.variables.accentColorNegative, f.selected.dark)
193
+ },
194
+ prisma: l.mixins.overlayColors(l.variables.accentColorNegative, l.variables.interactiveColorOverlaySelected)
195
+ });
196
+ d = l.variables.contentColorInverted;
197
+ break;
198
+ }
199
+
200
+ case "secondary":
201
+ s = l.variables.interactiveColorBorder;
202
+ c = l.variables.interactiveColorBorderDisabled;
203
+ e = (0, l.pick)({
204
+ enterprise: g,
205
+ prisma: l.variables.interactiveColorBackground
206
+ });
207
+ a = (0, l.pick)({
208
+ enterprise: f.active,
209
+ prisma: l.variables.interactiveColorOverlayActive
210
+ });
211
+ t = (0, l.pick)({
212
+ enterprise: f.hover,
213
+ prisma: l.variables.interactiveColorOverlayHover
214
+ });
215
+ n = (0, l.pick)({
216
+ enterprise: f.selected,
217
+ prisma: l.variables.interactiveColorOverlaySelected
218
+ });
219
+ break;
220
+
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
227
+ });
228
+ t = (0, l.pick)({
229
+ enterprise: f.hover,
230
+ prisma: l.variables.interactiveColorOverlayHover
231
+ });
232
+ n = (0, l.pick)({
233
+ enterprise: f.selected,
234
+ prisma: l.variables.interactiveColorOverlaySelected
235
+ });
236
+ break;
237
+
238
+ default:
239
+ }
240
+ var b = {
241
+ background: e,
242
+ backgroundActive: a,
243
+ backgroundDisabled: o,
244
+ backgroundDisabledSelected: i,
245
+ backgroundHover: t,
246
+ backgroundSelected: n,
247
+ borderColor: s,
248
+ borderColorDisabled: c,
249
+ color: d,
250
+ colorDisabled: v
251
+ };
252
+ return b;
253
+ }
254
+ function k(r, e) {
255
+ var a = typeof r === "string" && p.includes(r) ? r : undefined;
256
+ var o = {};
257
+ if (a && e !== undefined) {
258
+ o = e;
259
+ } else if (a === undefined && u(r) === "object" && e === undefined) {
260
+ o = r;
261
+ }
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";
265
+ return function() {
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);
268
+ }), (function(r) {
269
+ var e = r.$append;
270
+ return e && (0, n.css)([ "border-top-right-radius:0.1px;border-bottom-right-radius:0.1px;border-right:none;" ]);
271
+ }), (function(r) {
272
+ var e = r.$prepend;
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) {
275
+ var e = r.$selected;
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);
280
+ }));
281
+ };
282
+ }
283
+ /* harmony default export */ const m = k;
85
284
  // CONCATENATED MODULE: ./src/ButtonSimple/prismaStyles.ts
86
- var p = (0, d.css)([ "", " cursor:pointer;position:relative;border-radius:", ";&:focus,&:hover{z-index:3;}" ], n.mixins.reset("block"), n.variables.borderRadius);
87
- /* Setting border-radius to 0.1px creates a rounded shadow, */ var f = (0, d.css)([ "", " ", "" ], (function(r) {
88
- var e = r.$append;
89
- return e && (0, d.css)([ "border-top-right-radius:0.1px;border-bottom-right-radius:0.1px;border-right:none;" ]);
90
- }), (function(r) {
91
- var e = r.$prepend;
92
- return e && (0, d.css)([ "border-top-left-radius:0.1px;border-bottom-left-radius:0.1px;" ]);
93
- }));
94
- var g = (0, d.css)([ "", " ", " ", " &:not([disabled],[aria-disabled='true']){color:", ";transition:background-color 0.2s,border 0.2s,box-shadow 0.2s,text-decoration 0.2s;&:hover{background-color:", ";border-color:", ";", "}", " ", " &:active{background-color:", ";transition:none;}&:focus{background-color:", ";&:active{background-color:", ";}}}&[disabled],&[aria-disabled='true']{border-color:", ";color:", ";cursor:not-allowed;", "}&:not([disabled]){&:focus{box-shadow:", ";}}" ], p, (0,
95
- n.pickVariant)("$variant", {
96
- prismaSecondary: (0, d.css)([ "font-weight:", ";" ], n.variables.fontWeightSemiBold),
97
- prismaDefault: (0, d.css)([ "border:1px solid ", ";font-weight:", ";" ], n.variables.interactiveColorBorder, n.variables.fontWeightSemiBold),
98
- prismaToggle: (0, d.css)([ "border:1px solid ", ";font-weight:normal;" ], n.variables.interactiveColorBorder)
99
- }), f, n.variables.contentColorActive, n.variables.interactiveColorOverlayHover, n.variables.interactiveColorBorderHover, (0,
100
- n.pickVariant)("$variant", {
101
- prismaSecondary: (0, d.css)([ "box-shadow:", ";" ], n.variables.hoverShadow),
102
- prismaDefault: (0, d.css)([ "box-shadow:", ";" ], n.variables.hoverShadow)
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", {
294
+ background: "transparent"
295
+ }), l.variables.fontWeightSemiBold),
296
+ toggle: (0, n.css)([ "", " font-weight:normal;" ], m("secondary", {
297
+ background: "transparent"
298
+ }))
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)
103
304
  }), (function(r) {
104
305
  var e = r.$selected;
105
- return e && (0, d.css)([ "background-color:", ";border-color:", ";&:hover{background-color:", ";}" ], n.variables.interactiveColorOverlaySelected, n.variables.interactiveColorBorderDisabled, n.mixins.overlayColors(n.variables.interactiveColorOverlaySelected, n.variables.interactiveColorOverlayHover));
306
+ return e && (0, n.css)([ "border-color:", ";&:hover{background-color:", ";}" ], l.variables.interactiveColorBorderDisabled, l.mixins.overlayColors(l.variables.interactiveColorOverlaySelected, l.variables.interactiveColorOverlayHover));
106
307
  }), (function(r) {
107
308
  var e = r.$error;
108
- return e && (0, d.css)([ "border-color:", ";&:hover{border-color:", ";}" ], n.variables.accentColorNegative, n.variables.accentColorNegative);
109
- }), n.variables.interactiveColorOverlayActive, n.variables.interactiveColorOverlayHover, n.variables.interactiveColorOverlayActive, n.variables.interactiveColorBorderDisabled, n.variables.contentColorDisabled, (function(r) {
309
+ return e && (0, n.css)([ "border-color:", ";&:hover{border-color:", ";}" ], l.variables.accentColorNegative, l.variables.accentColorNegative);
310
+ }), (function(r) {
110
311
  var e = r.$selected;
111
- return e && (0, d.css)([ "background-color:", ";" ], n.mixins.overlayColors(n.variables.interactiveColorBackgroundDisabled, n.variables.interactiveColorOverlaySelected));
112
- }), n.variables.focusShadow);
113
- var y = (0, d.css)([ "&[disabled],&[aria-disabled='true']{border-color:", ";color:", ";background-color:", ";cursor:not-allowed;", "}" ], n.variables.interactiveColorBorderDisabled, n.variables.contentColorDisabled, n.variables.interactiveColorBackgroundDisabled, (function(r) {
114
- return r && (0, d.css)([ "background-color:", ";" ], n.mixins.overlayColors(n.variables.interactiveColorBackgroundDisabled, n.variables.interactiveColorOverlaySelected));
312
+ return e && (0, n.css)([ "background-color:", ";" ], l.mixins.overlayColors(l.variables.interactiveColorBackgroundDisabled, l.variables.interactiveColorOverlaySelected));
115
313
  }));
116
- var h = (0, d.css)([ "", " font-weight:", ";border-radius:", ";", " &:not([disabled],[aria-disabled='true']){color:", ";transition:background-color 0.2s,box-shadow 0.2s,text-decoration 0.2s;background-color:", ";&:hover,&:focus{background-color:", ";}&:hover{box-shadow:", ";}&:active{background-color:", ";transition:none;}}&:not([disabled]){&:focus{box-shadow:", ";}}", "" ], p, n.variables.fontWeightSemiBold, n.variables.borderRadius, f, n.variables.contentColorInverted, (0,
117
- n.pickVariant)("$selected", {
118
- false: (0, n.pickVariant)("$variant", {
119
- prismaPrimary: n.variables.interactiveColorPrimary,
120
- prismaDestructive: n.variables.accentColorNegative
121
- }),
122
- true: (0, n.pickVariant)("$variant", {
123
- prismaPrimary: n.mixins.overlayColors(n.variables.interactiveColorPrimary, n.variables.interactiveColorOverlaySelected),
124
- prismaDestructive: n.mixins.overlayColors(n.variables.accentColorNegative, n.variables.interactiveColorOverlaySelected)
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)
125
325
  })
126
- }), (0, n.pickVariant)("$variant", {
127
- prismaPrimary: n.mixins.overlayColors(n.variables.interactiveColorPrimary, n.variables.interactiveColorOverlayHover),
128
- prismaDestructive: n.mixins.overlayColors(n.variables.accentColorNegative, n.variables.interactiveColorOverlayHover)
129
- }), n.variables.hoverShadow, (0, n.pickVariant)("$variant", {
130
- prismaPrimary: n.mixins.overlayColors(n.variables.interactiveColorPrimary, n.variables.interactiveColorOverlayActive),
131
- prismaDestructive: n.mixins.overlayColors(n.variables.accentColorNegative, n.variables.interactiveColorOverlayActive)
132
- }), n.variables.focusShadow, y);
133
- var k = (0, d.css)([ "", " font-weight:", ";border-radius:", ";", " &:not([disabled],[aria-disabled='true']){color:", ";background-color:", ";transition:background-color 0.2s,box-shadow 0.2s,text-decoration 0.2s;", " &:hover{background-color:", ";box-shadow:", ";}&:active{background-color:", ";transition:none;}&:focus{background-color:", ";}}&:not([disabled]){&:focus{box-shadow:", ";}}", "" ], p, n.variables.fontWeightSemiBold, n.variables.borderRadius, f, n.variables.contentColorActive, n.variables.interactiveColorBackground, (function(r) {
134
- return r && (0, d.css)([ "background-color:", ";" ], n.mixins.overlayColors(n.variables.interactiveColorBackground, n.variables.interactiveColorOverlaySelected));
135
- }), n.mixins.overlayColors(n.variables.interactiveColorBackground, n.variables.interactiveColorOverlayHover), n.variables.hoverShadow, n.mixins.overlayColors(n.variables.interactiveColorBackground, n.variables.interactiveColorOverlayActive), n.mixins.overlayColors(n.variables.interactiveColorBackground, n.variables.interactiveColorOverlayHover), n.variables.focusShadow, y);
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);
136
331
  // CONCATENATED MODULE: ./src/ButtonSimple/enterpriseStyles.ts
137
- var m = "#1A8929";
332
+ var w = "#1A8929";
138
333
  // SUI-2439 to meet WCAG AA compliance
139
- var C = "#235823";
334
+ var S = "#235823";
140
335
  // SUI-2439 to meet WCAG AA compliance
141
- var x = (0, d.css)([ "", " border-radius:", ";cursor:pointer;position:relative;&:focus{z-index:3;}" ], n.mixins.reset("block"), n.variables.borderRadius);
142
- var w = (0, d.css)([ "", " ", "" ], (function(r) {
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) {
143
338
  var e = r.$append;
144
- return e && (0, d.css)([ "border-top-right-radius:0;border-bottom-right-radius:0;border-right:none;" ]);
339
+ return e && (0, n.css)([ "border-top-right-radius:0;border-bottom-right-radius:0;border-right:none;" ]);
145
340
  }), (function(r) {
146
341
  var e = r.$prepend;
147
- return e && (0, d.css)([ "border-top-left-radius:0;border-bottom-left-radius:0;" ]);
342
+ return e && (0, n.css)([ "border-top-left-radius:0;border-bottom-left-radius:0;" ]);
148
343
  }));
149
- var S = "inset 0 -1px 0 rgba(0, 0, 0, 0.1)";
150
- var O = "inset 0 1px 0 rgba(0, 0, 0, 0.1)";
151
- var D = (0, d.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:", ";", "}" ], x, (0,
152
- n.pick)({
153
- light: (0, d.css)([ "1px solid ", "" ], n.variables.gray60),
154
- dark: n.variables.border
155
- }), w, (0, n.pickVariant)("$variant", {
156
- enterpriseDefault: "normal",
157
- enterpriseSecondary: n.variables.fontWeightSemiBold
158
- }), (0, n.pick)({
159
- light: n.variables.gray98,
160
- dark: n.variables.gray45
161
- }), (0, n.pick)({
162
- light: n.variables.gray45,
163
- dark: n.variables.white
164
- }), (0, n.pick)({
165
- light: (0, d.css)([ "box-shadow:", ";" ], S),
166
- dark: (0, d.css)([ "box-shadow:inset 0 -1px 0 ", ";" ], n.variables.gray30)
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)
167
362
  }), (function(r) {
168
363
  var e = r.$selected;
169
- return e && (0, d.css)([ "box-shadow:", ";background-color:", ";border-color:", ";" ], (0,
170
- n.pick)({
171
- light: O,
172
- dark: (0, d.css)([ "inset 0 1px 0 ", "" ], n.variables.black)
173
- }), (0, n.pick)({
174
- light: n.variables.gray92,
175
- dark: n.variables.gray22
176
- }), (0, n.pick)({
177
- light: n.variables.gray60,
178
- dark: n.variables.gray20
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
179
374
  }));
180
- }), (0, n.pick)({
375
+ }), (0, l.pick)({
181
376
  light: "#ebeeef",
182
- dark: n.variables.gray30
183
- }), (0, n.pick)({
184
- light: S,
185
- dark: (0, d.css)([ "inset 0 -1px 0 ", "" ], n.variables.gray25)
186
- }), (0, n.pick)({
187
- light: n.variables.gray92,
188
- dark: n.variables.gray22
189
- }), (0, n.pick)({
190
- light: n.variables.gray60,
191
- dark: n.variables.gray20
192
- }), (0, n.pick)({
193
- dark: (0, d.css)([ "box-shadow:inset 0 -1px 0 ", ";" ], n.variables.gray22)
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)
194
389
  }), (function(r) {
195
390
  var e = r.$append;
196
- return e && (0, d.css)([ "box-shadow:", ",", ",inset -1px 0 0 ", ";" ], (0, n.pick)({
197
- light: S,
198
- dark: (0, d.css)([ "inset 0 -1px 0 ", "" ], n.variables.gray30)
199
- }), n.variables.focusShadow, n.variables.borderColor);
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);
200
395
  }), (function(r) {
201
- var e = r.$append, o = r.$selected;
202
- return e && o && (0, n.pick)({
203
- light: (0, d.css)([ "box-shadow:", ",", ",", ",inset -1px 0 0 ", ";" ], S, O, n.variables.focusShadow, n.variables.borderColor),
204
- dark: (0, d.css)([ "box-shadow:inset 0 1px 0 ", ",", ",inset -1px 0 0 ", ";" ], n.variables.black, n.variables.focusShadow, n.variables.borderColor)
396
+ var e = r.$append, a = r.$selected;
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)
205
400
  });
206
- }), (0, n.pick)({
207
- light: S,
208
- dark: (0, d.css)([ "inset 0 -1px 0 ", "" ], n.variables.gray30)
209
- }), n.variables.focusShadow, n.variables.textDisabledColor, (0, n.pick)({
210
- light: n.variables.gray96,
211
- dark: n.variables.gray30
212
- }), (0, n.pick)({
213
- light: n.variables.borderLightColor,
214
- dark: n.variables.gray30
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
215
410
  }), (function(r) {
216
411
  var e = r.$selected;
217
- return e && (0, n.pick)({
218
- light: (0, d.css)([ "box-shadow:", ";background-color:", ";border-color:", ";" ], O, n.variables.gray92, n.variables.gray80),
219
- dark: (0, d.css)([ "box-shadow:inset 0 1px 0 ", ";background-color:", ";border-color:", ";" ], n.variables.black, n.variables.gray22, n.variables.gray20)
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)
220
415
  });
221
416
  }));
222
- var $ = "inset 0 -2px 0 rgba(0, 0, 0, 0.1)";
223
- var P = "inset 0 2px 0 rgba(0, 0, 0, 0.1)";
224
- var B = (0, d.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;", "}" ], x, n.variables.fontWeightSemiBold, w, m, n.variables.white, $, (function(r) {
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) {
225
420
  var e = r.$selected;
226
- return e && (0, d.css)([ "box-shadow:", ";background-color:", ";" ], P, C);
421
+ return e && (0, n.css)([ "box-shadow:", ";background-color:", ";" ], B, S);
227
422
  }), (function(r) {
228
423
  var e = r.$prepend;
229
- return e && (0, d.css)([ "border-left:1px solid ", ";" ], m);
230
- }), n.variables.brandColorD50, n.variables.brandColorD30, n.variables.brandColorD30, $, n.variables.focusShadow, n.variables.brandColorL30, n.variables.brandColorL10, (function(r) {
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) {
231
426
  var e = r.$selected;
232
- return e && (0, d.css)([ "box-shadow:", ";background-color:", ";" ], P, n.variables.brandColorD20);
427
+ return e && (0, n.css)([ "box-shadow:", ";background-color:", ";" ], B, l.variables.brandColorD20);
233
428
  }));
234
- var j = (0, d.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;", "}" ], x, n.variables.fontWeightSemiBold, w, n.variables.errorColorD10, n.variables.white, $, (function(r) {
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) {
235
430
  var e = r.$selected;
236
- return e && (0, d.css)([ "box-shadow:", ";background-color:", ";" ], P, n.variables.errorColorD30);
431
+ return e && (0, n.css)([ "box-shadow:", ";background-color:", ";" ], B, l.variables.errorColorD30);
237
432
  }), (function(r) {
238
433
  var e = r.$prepend;
239
- return e && (0, d.css)([ "border-left:1px solid ", ";" ], n.variables.errorColorD30);
240
- }), n.variables.errorColorD30, n.variables.errorColorD40, n.variables.errorColorD40, $, n.variables.focusShadow, n.variables.errorColorL10, n.variables.errorColorD10, (function(r) {
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) {
241
436
  var e = r.$selected;
242
- return e && (0, d.css)([ "box-shadow:", ";background-color:", ";" ], P, n.variables.errorColorD40);
437
+ return e && (0, n.css)([ "box-shadow:", ";background-color:", ";" ], B, l.variables.errorColorD40);
243
438
  }));
244
- var T = (0, d.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;", "}" ], x, (0,
245
- n.pick)({
246
- light: n.variables.gray45,
247
- dark: n.variables.white
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
248
443
  }), (function(r) {
249
444
  var e = r.$selected;
250
- return e && (0, d.css)([ "border-color:", ";" ], n.variables.accentColor);
251
- }), (0, n.pick)({
252
- light: n.variables.linkColor,
253
- dark: n.variables.white
254
- }), n.variables.backgroundColorHover, (0, n.pick)({
255
- light: n.variables.gray60,
256
- dark: n.variables.borderColor
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
257
452
  }), (function(r) {
258
453
  var e = r.$error;
259
- return e && (0, d.css)([ "&,&:hover{color:", ";}" ], n.variables.errorColor);
260
- }), (0, n.pick)({
261
- light: n.variables.linkColor,
262
- dark: n.variables.white
263
- }), (0, n.pick)({
264
- light: n.variables.gray92,
265
- dark: n.variables.gray22
266
- }), n.variables.focusShadow, n.variables.textDisabledColor, (function(r) {
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) {
267
462
  var e = r.$selected;
268
- return e && (0, d.css)([ "border-color:", ";" ], n.variables.borderLightColor);
463
+ return e && (0, n.css)([ "border-color:", ";" ], l.variables.borderLightColor);
269
464
  }));
270
465
  // CONCATENATED MODULE: ./src/ButtonSimple/ButtonSimpleStyles.ts
271
- var _ = b()(u()).withConfig({
466
+ var T = s()(d()).withConfig({
272
467
  displayName: "ButtonSimpleStyles__StyledClickable",
273
468
  componentId: "vlarwe-0"
274
- })([ "", "" ], (0, n.pickVariant)("$variant", {
275
- enterpriseDefault: D,
276
- enterpriseSecondary: D,
277
- enterprisePrimary: B,
278
- enterpriseError: j,
279
- enterpriseDestructive: j,
280
- enterprisePill: T,
281
- prismaDefault: g,
282
- prismaDestructive: h,
283
- prismaPrimary: h,
284
- prismaSecondary: g,
285
- prismaToggle: g,
286
- prismaFlat: k
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
487
+ }),
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
501
+ })
287
502
  }));
288
503
  // CONCATENATED MODULE: ./src/ButtonSimple/ButtonSimple.tsx
289
- function R(r) {
504
+ function I(r) {
290
505
  "@babel/helpers - typeof";
291
506
  if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
292
- R = function r(e) {
507
+ I = function r(e) {
293
508
  return typeof e;
294
509
  };
295
510
  } else {
296
- R = function r(e) {
511
+ I = function r(e) {
297
512
  return e && typeof Symbol === "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
298
513
  };
299
514
  }
300
- return R(r);
515
+ return I(r);
301
516
  }
302
- function A() {
303
- A = Object.assign || function(r) {
517
+ function R() {
518
+ R = Object.assign || function(r) {
304
519
  for (var e = 1; e < arguments.length; e++) {
305
- var o = arguments[e];
306
- for (var a in o) {
307
- if (Object.prototype.hasOwnProperty.call(o, a)) {
308
- r[a] = o[a];
520
+ var a = arguments[e];
521
+ for (var o in a) {
522
+ if (Object.prototype.hasOwnProperty.call(a, o)) {
523
+ r[o] = a[o];
309
524
  }
310
525
  }
311
526
  }
312
527
  return r;
313
528
  };
314
- return A.apply(this, arguments);
529
+ return R.apply(this, arguments);
315
530
  }
316
- function E(r, e) {
531
+ function V(r, e) {
317
532
  if (r == null) return {};
318
- var o = H(r, e);
319
- var a, i;
533
+ var a = W(r, e);
534
+ var o, i;
320
535
  if (Object.getOwnPropertySymbols) {
321
536
  var t = Object.getOwnPropertySymbols(r);
322
537
  for (i = 0; i < t.length; i++) {
323
- a = t[i];
324
- if (e.indexOf(a) >= 0) continue;
325
- if (!Object.prototype.propertyIsEnumerable.call(r, a)) continue;
326
- o[a] = r[a];
538
+ o = t[i];
539
+ if (e.indexOf(o) >= 0) continue;
540
+ if (!Object.prototype.propertyIsEnumerable.call(r, o)) continue;
541
+ a[o] = r[o];
327
542
  }
328
543
  }
329
- return o;
544
+ return a;
330
545
  }
331
- function H(r, e) {
546
+ function W(r, e) {
332
547
  if (r == null) return {};
333
- var o = {};
334
- var a = Object.keys(r);
548
+ var a = {};
549
+ var o = Object.keys(r);
335
550
  var i, t;
336
- for (t = 0; t < a.length; t++) {
337
- i = a[t];
551
+ for (t = 0; t < o.length; t++) {
552
+ i = o[t];
338
553
  if (e.indexOf(i) >= 0) continue;
339
- o[i] = r[i];
554
+ a[i] = r[i];
340
555
  }
341
- return o;
556
+ return a;
342
557
  }
343
- function N(r, e) {
558
+ function q(r, e) {
344
559
  if (!(r instanceof e)) {
345
560
  throw new TypeError("Cannot call a class as a function");
346
561
  }
347
562
  }
348
- function V(r, e) {
349
- for (var o = 0; o < e.length; o++) {
350
- var a = e[o];
351
- a.enumerable = a.enumerable || false;
352
- a.configurable = true;
353
- if ("value" in a) a.writable = true;
354
- Object.defineProperty(r, a.key, a);
563
+ function E(r, e) {
564
+ for (var a = 0; a < e.length; a++) {
565
+ var o = e[a];
566
+ o.enumerable = o.enumerable || false;
567
+ o.configurable = true;
568
+ if ("value" in o) o.writable = true;
569
+ Object.defineProperty(r, o.key, o);
355
570
  }
356
571
  }
357
- function q(r, e, o) {
358
- if (e) V(r.prototype, e);
359
- if (o) V(r, o);
572
+ function M(r, e, a) {
573
+ if (e) E(r.prototype, e);
574
+ if (a) E(r, a);
360
575
  return r;
361
576
  }
362
- function W(r, e) {
577
+ function L(r, e) {
363
578
  if (typeof e !== "function" && e !== null) {
364
579
  throw new TypeError("Super expression must either be null or a function");
365
580
  }
@@ -370,41 +585,41 @@
370
585
  configurable: true
371
586
  }
372
587
  });
373
- if (e) I(r, e);
588
+ if (e) z(r, e);
374
589
  }
375
- function I(r, e) {
376
- I = Object.setPrototypeOf || function r(e, o) {
377
- e.__proto__ = o;
590
+ function z(r, e) {
591
+ z = Object.setPrototypeOf || function r(e, a) {
592
+ e.__proto__ = a;
378
593
  return e;
379
594
  };
380
- return I(r, e);
595
+ return z(r, e);
381
596
  }
382
- function L(r) {
383
- var e = F();
384
- return function o() {
385
- var a = G(r), i;
597
+ function U(r) {
598
+ var e = J();
599
+ return function a() {
600
+ var o = K(r), i;
386
601
  if (e) {
387
- var t = G(this).constructor;
388
- i = Reflect.construct(a, arguments, t);
602
+ var t = K(this).constructor;
603
+ i = Reflect.construct(o, arguments, t);
389
604
  } else {
390
- i = a.apply(this, arguments);
605
+ i = o.apply(this, arguments);
391
606
  }
392
- return M(this, i);
607
+ return F(this, i);
393
608
  };
394
609
  }
395
- function M(r, e) {
396
- if (e && (R(e) === "object" || typeof e === "function")) {
610
+ function F(r, e) {
611
+ if (e && (I(e) === "object" || typeof e === "function")) {
397
612
  return e;
398
613
  }
399
- return z(r);
614
+ return G(r);
400
615
  }
401
- function z(r) {
616
+ function G(r) {
402
617
  if (r === void 0) {
403
618
  throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
404
619
  }
405
620
  return r;
406
621
  }
407
- function F() {
622
+ function J() {
408
623
  if (typeof Reflect === "undefined" || !Reflect.construct) return false;
409
624
  if (Reflect.construct.sham) return false;
410
625
  if (typeof Proxy === "function") return true;
@@ -415,28 +630,60 @@
415
630
  return false;
416
631
  }
417
632
  }
418
- function G(r) {
419
- G = Object.setPrototypeOf ? Object.getPrototypeOf : function r(e) {
633
+ function K(r) {
634
+ K = Object.setPrototypeOf ? Object.getPrototypeOf : function r(e) {
420
635
  return e.__proto__ || Object.getPrototypeOf(e);
421
636
  };
422
- return G(r);
637
+ return K(r);
423
638
  }
424
- function J(r, e, o) {
639
+ function Q(r, e, a) {
425
640
  if (e in r) {
426
641
  Object.defineProperty(r, e, {
427
- value: o,
642
+ value: a,
428
643
  enumerable: true,
429
644
  configurable: true,
430
645
  writable: true
431
646
  });
432
647
  } else {
433
- r[e] = o;
648
+ r[e] = a;
434
649
  }
435
650
  return r;
436
651
  }
437
- var K = {
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 = {
438
685
  action: t().string,
439
- appearance: t().oneOf([ "default", "secondary", "primary", "destructive", "pill", "toggle", "flat" ]),
686
+ appearance: t().oneOf([ "default", "secondary", "primary", "destructive", "subtle", "pill", "toggle", "flat" ]),
440
687
  append: t().bool,
441
688
  children: t().node,
442
689
  disabled: t().oneOfType([ t().bool, t().oneOf([ "dimmed" ]) ]),
@@ -449,57 +696,32 @@
449
696
  splunkTheme: t().object,
450
697
  to: t().string
451
698
  };
452
- var Q = {
699
+ var sr = {
453
700
  appearance: "default",
454
701
  append: false,
455
702
  disabled: false,
456
703
  error: false,
457
704
  inline: true,
458
705
  openInNewContext: false,
459
- prepend: false,
460
- selected: false
706
+ prepend: false
461
707
  };
462
- var U = function r(e, o) {
463
- var a = {
464
- default: "enterpriseDefault",
465
- destructive: "enterpriseError",
466
- primary: "enterprisePrimary",
467
- secondary: "enterpriseSecondary",
468
- pill: "enterprisePill",
469
- toggle: "enterpriseDefault",
470
- flat: "enterpriseDefault"
471
- };
472
- var i = {
473
- default: "prismaDefault",
474
- destructive: "prismaDestructive",
475
- primary: "prismaPrimary",
476
- secondary: "prismaSecondary",
477
- pill: "prismaSecondary",
478
- toggle: "prismaToggle",
479
- flat: "prismaFlat"
480
- };
481
- if (o === "enterprise") {
482
- return a[e];
483
- }
484
- return i[e];
485
- };
486
- var X = function(r) {
487
- W(o, r);
488
- var e = L(o);
489
- function o() {
708
+ var cr = function(r) {
709
+ L(a, r);
710
+ var e = U(a);
711
+ function a() {
490
712
  var r;
491
- N(this, o);
492
- for (var a = arguments.length, i = new Array(a), t = 0; t < a; t++) {
713
+ q(this, a);
714
+ for (var o = arguments.length, i = new Array(o), t = 0; t < o; t++) {
493
715
  i[t] = arguments[t];
494
716
  }
495
717
  r = e.call.apply(e, [ this ].concat(i));
496
- J(z(r), "component", null);
497
- J(z(r), "handleMount", (function(e) {
718
+ Q(G(r), "component", null);
719
+ Q(G(r), "handleMount", (function(e) {
498
720
  r.component = e;
499
721
  }));
500
722
  return r;
501
723
  }
502
- q(o, [ {
724
+ M(a, [ {
503
725
  key: "focus",
504
726
  /**
505
727
  * Places focus on the button.
@@ -509,37 +731,46 @@
509
731
  (e = this.component) === null || e === void 0 ? void 0 : e.focus();
510
732
  }
511
733
  }, {
512
- key: "render",
734
+ key: "getVariant",
513
735
  value: function r() {
514
- var e = this.props, o = e.appearance, i = e.append, t = e.children, n = e.onClick, s = e.disabled, d = e.error, b = e.prepend, v = e.selected, u = e.splunkTheme, p = E(e, [ "appearance", "append", "children", "onClick", "disabled", "error", "prepend", "selected", "splunkTheme" ]);
515
- var f = o;
516
- if (u.isEnterprise) {
517
- f = d ? "destructive" : o;
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";
518
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" ]);
519
753
 
520
- return a().createElement(_, A({
521
- "aria-disabled": s === "dimmed" || undefined,
522
- "aria-invalid": d,
754
+ return o().createElement(T, R({
755
+ "aria-invalid": t,
756
+ "aria-pressed": n,
523
757
  "data-test": "button-simple",
524
- disabled: s === true,
525
758
  ref: this.handleMount,
526
- $variant: U(f, u.family),
527
- $append: i,
528
- $prepend: b,
529
- $selected: v,
530
- $error: d
531
- }, p, {
532
- onClick: n && !s ? n : undefined
533
- }), t, v && a().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);
534
765
  }
535
766
  } ]);
536
- return o;
537
- }(o.Component);
538
- J(X, "defaultProps", Q);
539
- J(X, "propTypes", K);
540
- var Y = (0, n.withSplunkTheme)(X);
541
- Y.propTypes = X.propTypes;
542
- /* harmony default export */ const Z = Y;
767
+ return a;
768
+ }(a.Component);
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;
543
774
  // CONCATENATED MODULE: ./src/ButtonSimple/index.ts
544
775
  module.exports = e;
545
776
  /******/})();