@splunk/react-ui 4.39.0 → 4.40.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/CHANGELOG.md +21 -0
- package/Card.js +3 -1
- package/Chip.js +133 -125
- package/ControlGroup.js +27 -30
- package/MIGRATION.mdx +31 -0
- package/Message.js +136 -123
- package/Multiselect.js +3147 -3130
- package/Number.js +23 -18
- package/Popover.js +2 -1
- package/Select.js +2072 -2064
- package/SplitButton.d.ts +2 -0
- package/TabBar.js +15 -12
- package/TabLayout.js +8 -2
- package/Table.js +229 -224
- package/WaitSpinner.js +1 -1
- package/package.json +2 -2
- package/types/src/Card/Card.d.ts +1 -0
- package/types/src/Card/Footer.d.ts +1 -0
- package/types/src/Chip/Chip.d.ts +3 -6
- package/types/src/ComboBox/ComboBox.d.ts +1 -1
- package/types/src/Multiselect/Compact.d.ts +1 -1
- package/types/src/Multiselect/Multiselect.d.ts +1 -1
- package/types/src/Multiselect/Normal.d.ts +1 -1
- package/types/src/Select/Select.d.ts +3 -1
- package/types/src/Select/SelectAllOption.d.ts +2 -2
- package/types/src/Select/SelectBase.d.ts +104 -66
- package/types/src/Select/docs/examples/Appearance.d.ts +0 -2
- package/types/src/Table/Cell.d.ts +0 -2
- package/types/src/Table/HeadInner.d.ts +5 -1
- package/types/src/WaitSpinner/WaitSpinner.d.ts +0 -1
- package/types/src/useControlled/index.d.ts +2 -0
- package/types/src/useControlled/useControlled.d.ts +21 -0
- package/types/src/useResizeObserver/index.d.ts +2 -0
- package/types/src/useResizeObserver/useResizeObserver.d.ts +12 -0
- package/useControlled.js +112 -0
- package/useKeyPress.d.ts +2 -0
- package/useResizeObserver.d.ts +2 -0
- package/useResizeObserver.js +137 -0
- package/types/src/Chip/docs/examples/Basic.d.ts +0 -2
- package/types/src/Chip/docs/examples/prisma/Appearance.d.ts +0 -2
- package/types/src/Color/docs/examples/prisma/Controlled.d.ts +0 -2
- package/types/src/Color/docs/examples/prisma/ThemeVariables.d.ts +0 -1
- package/types/src/Color/docs/examples/prisma/Uncontrolled.d.ts +0 -2
- package/types/src/Dropdown/docs/examples/prisma/Basic.d.ts +0 -2
- package/types/src/Dropdown/docs/examples/prisma/BasicMenu.d.ts +0 -2
- package/types/src/Dropdown/docs/examples/prisma/ControlledDropdown.d.ts +0 -2
- package/types/src/Dropdown/docs/examples/prisma/Dialog.d.ts +0 -2
- package/types/src/Dropdown/docs/examples/prisma/OtherToggles.d.ts +0 -2
- package/types/src/Dropdown/docs/examples/prisma/ScrollingMenu.d.ts +0 -2
- package/types/src/File/docs/examples/prisma/Disabled.d.ts +0 -12
- package/types/src/Message/docs/examples/Title.d.ts +0 -2
- package/types/src/WaitSpinner/docs/examples/prisma/Basic.d.ts +0 -2
- /package/types/src/Color/docs/examples/{prisma/CustomizedPalette.d.ts → CustomizedPalette.d.ts} +0 -0
- /package/types/src/Color/docs/examples/{prisma/HideInput.d.ts → HideInput.d.ts} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,27 @@
|
|
|
1
1
|
Change Log
|
|
2
2
|
============
|
|
3
3
|
|
|
4
|
+
4.40.0 - December 3, 2024
|
|
5
|
+
----------
|
|
6
|
+
New Features:
|
|
7
|
+
* `Table` now supports clickable cells in Prisma themes (SUI-6571).
|
|
8
|
+
* `Chip` now supports all `appearance` values in all themes (SUI-6856).
|
|
9
|
+
* `Multiselect` now supports the `selectedAppearance` prop in Prisma themes (SUI-6856).
|
|
10
|
+
* `WaitSpinner` now supports `size="large"` in Enterprise themes (SUI-6902).
|
|
11
|
+
|
|
12
|
+
Bug Fixes:
|
|
13
|
+
* `Number` now has the role of `spinbutton` and adds the associated aria attributes (A11Y-2976).
|
|
14
|
+
* `useKeyPress` types are now being exported (SUI-6862).
|
|
15
|
+
* `Popover`'s fading out animation now does not allow click through (SUI-6618, SUI-6456).
|
|
16
|
+
* `Table.HeadCell` with sortable headers is now correctly announced by screen readers (SUI-6672).
|
|
17
|
+
* `Message.Title` no longer is inline with other content (SUI-6250).
|
|
18
|
+
* `TabBar.Tab` and `TabLayout.Panel` are no longer incorrectly sized if the `label` attribute is not a string (SUI-6877).
|
|
19
|
+
* `SplitButton` types are now being exported (SUI-6306).
|
|
20
|
+
|
|
21
|
+
Deprecations:
|
|
22
|
+
* `Select`'s `"primary"` value of the `appearance` prop has been deprecated and will be removed in the next major version. See the migration guide for details (SUI-6866).
|
|
23
|
+
* `Card` and `Card.Footer`'s `showBorder` prop is deprecated and will be removed in the next major version (SUI-6577).
|
|
24
|
+
|
|
4
25
|
4.39.0 - November 8, 2024
|
|
5
26
|
----------
|
|
6
27
|
New Features:
|
package/Card.js
CHANGED
|
@@ -211,7 +211,8 @@
|
|
|
211
211
|
*/ function S(e) {
|
|
212
212
|
var r = e.children, t = e.showBorder, o = t === void 0 ? true : t, i = w(e, [ "children", "showBorder" ]);
|
|
213
213
|
// @docs-props-type FooterPropsBase
|
|
214
|
-
|
|
214
|
+
if (false) {}
|
|
215
|
+
|
|
215
216
|
return n().createElement(h, g({
|
|
216
217
|
"data-test": "footer",
|
|
217
218
|
$showTopBorder: o
|
|
@@ -690,6 +691,7 @@
|
|
|
690
691
|
be(t, [ {
|
|
691
692
|
key: "render",
|
|
692
693
|
value: function e() {
|
|
694
|
+
if (false) {}
|
|
693
695
|
if (Be(this.props)) {
|
|
694
696
|
var r = Ie(this.props), t = ae(r, 2), o = t[0], i = t[1];
|
|
695
697
|
var a = o.showBorder;
|
package/Chip.js
CHANGED
|
@@ -24,11 +24,11 @@
|
|
|
24
24
|
/******/ (() => {
|
|
25
25
|
/******/ // define getter functions for harmony exports
|
|
26
26
|
/******/ e.d = (r, a) => {
|
|
27
|
-
/******/ for (var
|
|
28
|
-
/******/ if (e.o(a,
|
|
29
|
-
/******/ Object.defineProperty(r,
|
|
27
|
+
/******/ for (var o in a) {
|
|
28
|
+
/******/ if (e.o(a, o) && !e.o(r, o)) {
|
|
29
|
+
/******/ Object.defineProperty(r, o, {
|
|
30
30
|
enumerable: true,
|
|
31
|
-
get: a[
|
|
31
|
+
get: a[o]
|
|
32
32
|
});
|
|
33
33
|
/******/ }
|
|
34
34
|
/******/ }
|
|
@@ -61,14 +61,14 @@
|
|
|
61
61
|
e.r(r);
|
|
62
62
|
// EXPORTS
|
|
63
63
|
e.d(r, {
|
|
64
|
-
default: () => /* reexport */
|
|
64
|
+
default: () => /* reexport */ X
|
|
65
65
|
});
|
|
66
66
|
// CONCATENATED MODULE: external "react"
|
|
67
67
|
const a = require("react");
|
|
68
|
-
var
|
|
68
|
+
var o = e.n(a);
|
|
69
69
|
// CONCATENATED MODULE: external "lodash/omit"
|
|
70
|
-
const
|
|
71
|
-
var i = e.n(
|
|
70
|
+
const n = require("lodash/omit");
|
|
71
|
+
var i = e.n(n);
|
|
72
72
|
// CONCATENATED MODULE: external "prop-types"
|
|
73
73
|
const t = require("prop-types");
|
|
74
74
|
var l = e.n(t);
|
|
@@ -76,8 +76,8 @@
|
|
|
76
76
|
const s = require("@splunk/react-icons/Cross");
|
|
77
77
|
var c = e.n(s);
|
|
78
78
|
// CONCATENATED MODULE: external "@splunk/react-icons/enterprise/Close"
|
|
79
|
-
const
|
|
80
|
-
var
|
|
79
|
+
const u = require("@splunk/react-icons/enterprise/Close");
|
|
80
|
+
var p = e.n(u);
|
|
81
81
|
// CONCATENATED MODULE: external "@splunk/ui-utils/i18n"
|
|
82
82
|
const d = require("@splunk/ui-utils/i18n");
|
|
83
83
|
// CONCATENATED MODULE: external "@splunk/ui-utils/color"
|
|
@@ -87,52 +87,56 @@
|
|
|
87
87
|
// CONCATENATED MODULE: external "@splunk/themes"
|
|
88
88
|
const b = require("@splunk/themes");
|
|
89
89
|
// CONCATENATED MODULE: external "@splunk/react-ui/ScreenReaderContent"
|
|
90
|
-
const
|
|
91
|
-
var
|
|
90
|
+
const m = require("@splunk/react-ui/ScreenReaderContent");
|
|
91
|
+
var g = e.n(m);
|
|
92
92
|
// CONCATENATED MODULE: external "styled-components"
|
|
93
93
|
const h = require("styled-components");
|
|
94
94
|
var C = e.n(h);
|
|
95
95
|
// CONCATENATED MODULE: external "@splunk/react-ui/Clickable"
|
|
96
96
|
const y = require("@splunk/react-ui/Clickable");
|
|
97
|
-
var
|
|
97
|
+
var $ = e.n(y);
|
|
98
98
|
// CONCATENATED MODULE: ./src/Chip/ChipStyles.ts
|
|
99
|
-
var
|
|
99
|
+
var x = (0, h.css)([ "", ";background-color:", ";border:1px solid transparent;border-radius:2px;", " flex:0 1 auto;max-width:calc(100% - 3px);", " ", " ", "" ], b.mixins.reset("inline-flex"), (0,
|
|
100
100
|
b.pickVariant)("$appearance", {
|
|
101
101
|
default: {
|
|
102
|
-
enterprise:
|
|
103
|
-
dark: b.variables.gray45,
|
|
104
|
-
light: b.variables.gray92
|
|
105
|
-
},
|
|
102
|
+
enterprise: b.variables.neutral300,
|
|
106
103
|
prisma: b.variables.neutral100
|
|
107
104
|
},
|
|
108
105
|
info: {
|
|
109
|
-
enterprise: b.variables.infoColorL30
|
|
106
|
+
enterprise: b.variables.infoColorL30,
|
|
107
|
+
prisma: b.variables.statusColorInfo
|
|
110
108
|
},
|
|
111
109
|
success: {
|
|
112
|
-
enterprise: b.variables.successColorL30
|
|
110
|
+
enterprise: b.variables.successColorL30,
|
|
111
|
+
prisma: b.variables.statusColorNormal
|
|
113
112
|
},
|
|
114
113
|
warning: {
|
|
115
|
-
enterprise: b.variables.warningColorL30
|
|
114
|
+
enterprise: b.variables.warningColorL30,
|
|
115
|
+
prisma: b.variables.statusColorMedium
|
|
116
116
|
},
|
|
117
117
|
error: {
|
|
118
118
|
enterprise: b.variables.errorColorL30,
|
|
119
|
-
prisma: b.variables.
|
|
120
|
-
},
|
|
121
|
-
outline: {
|
|
122
|
-
prisma: "transparent"
|
|
119
|
+
prisma: b.variables.statusColorHigh
|
|
123
120
|
},
|
|
121
|
+
outline: "transparent",
|
|
124
122
|
custom: function e(r) {
|
|
125
123
|
var a = r.$backgroundColor;
|
|
126
124
|
return a;
|
|
127
125
|
}
|
|
126
|
+
}), (function(e) {
|
|
127
|
+
var r = e.$appearance;
|
|
128
|
+
return r === "outline" && (0, h.css)([ "border-color:", ";" ], (0, b.pick)({
|
|
129
|
+
enterprise: {
|
|
130
|
+
dark: b.variables.gray80,
|
|
131
|
+
light: b.variables.gray60
|
|
132
|
+
},
|
|
133
|
+
prisma: b.variables.interactiveColorBorder
|
|
134
|
+
}));
|
|
128
135
|
}), (0, b.pick)({
|
|
129
|
-
enterprise: (0, h.css)([ "
|
|
130
|
-
prisma: (0, h.css)([ "color:", ";line-height:16px;margin:1px;"
|
|
131
|
-
var r = e.$appearance;
|
|
132
|
-
return r === "error" ? b.variables.contentColorInverted : b.variables.contentColorDefault;
|
|
133
|
-
}), (function(e) {
|
|
136
|
+
enterprise: (0, h.css)([ "line-height:", ";margin:0 2px 2px 0;" ], b.variables.lineHeight),
|
|
137
|
+
prisma: (0, h.css)([ "color:", ";line-height:16px;margin:1px;" ], (function(e) {
|
|
134
138
|
var r = e.$appearance;
|
|
135
|
-
return r === "
|
|
139
|
+
return r === "default" || r === "outline" ? b.variables.contentColorDefault : b.variables.contentColorInverted;
|
|
136
140
|
}))
|
|
137
141
|
}), (0, b.pick)({
|
|
138
142
|
enterprise: {
|
|
@@ -154,13 +158,16 @@
|
|
|
154
158
|
prisma: b.variables.interactiveColorBackgroundDisabled
|
|
155
159
|
},
|
|
156
160
|
info: {
|
|
157
|
-
enterprise: b.mixins.colorWithAlpha(b.variables.infoColorL10, .3)
|
|
161
|
+
enterprise: b.mixins.colorWithAlpha(b.variables.infoColorL10, .3),
|
|
162
|
+
prisma: b.variables.interactiveColorBackgroundDisabled
|
|
158
163
|
},
|
|
159
164
|
success: {
|
|
160
|
-
enterprise: b.mixins.colorWithAlpha(b.variables.successColorL10, .3)
|
|
165
|
+
enterprise: b.mixins.colorWithAlpha(b.variables.successColorL10, .3),
|
|
166
|
+
prisma: b.variables.interactiveColorBackgroundDisabled
|
|
161
167
|
},
|
|
162
168
|
warning: {
|
|
163
|
-
enterprise: b.mixins.colorWithAlpha(b.variables.warningColorL10, .3)
|
|
169
|
+
enterprise: b.mixins.colorWithAlpha(b.variables.warningColorL10, .3),
|
|
170
|
+
prisma: b.variables.interactiveColorBackgroundDisabled
|
|
164
171
|
},
|
|
165
172
|
error: {
|
|
166
173
|
enterprise: b.mixins.colorWithAlpha(b.variables.errorColorL10, .3),
|
|
@@ -181,7 +188,7 @@
|
|
|
181
188
|
var k = C().div.withConfig({
|
|
182
189
|
displayName: "ChipStyles__StyledBasic",
|
|
183
190
|
componentId: "sc-1sd3tsh-0"
|
|
184
|
-
})([ "", "" ],
|
|
191
|
+
})([ "", "" ], x);
|
|
185
192
|
var S = C()(k).withConfig({
|
|
186
193
|
displayName: "ChipStyles__Styled",
|
|
187
194
|
componentId: "sc-1sd3tsh-1"
|
|
@@ -199,15 +206,15 @@
|
|
|
199
206
|
}
|
|
200
207
|
}), (function(e) {
|
|
201
208
|
var r = e.$icon, a = e.$removable;
|
|
202
|
-
var
|
|
209
|
+
var o = (0, h.css)([ "grid-template-columns:1fr;" ]);
|
|
203
210
|
if (r && a) {
|
|
204
|
-
|
|
211
|
+
o = (0, h.css)([ "grid-template-columns:0fr 1fr 0fr;" ]);
|
|
205
212
|
} else if (r) {
|
|
206
|
-
|
|
213
|
+
o = (0, h.css)([ "grid-template-columns:0fr 1fr;" ]);
|
|
207
214
|
} else if (a) {
|
|
208
|
-
|
|
215
|
+
o = (0, h.css)([ "grid-template-columns:1fr 0fr;" ]);
|
|
209
216
|
}
|
|
210
|
-
return
|
|
217
|
+
return o;
|
|
211
218
|
}))
|
|
212
219
|
}));
|
|
213
220
|
var O = C().div.withConfig({
|
|
@@ -229,8 +236,8 @@
|
|
|
229
236
|
return a || b.variables.contentColorDefault;
|
|
230
237
|
},
|
|
231
238
|
prisma: function e(r) {
|
|
232
|
-
var a = r.$foregroundColor,
|
|
233
|
-
return a || (
|
|
239
|
+
var a = r.$foregroundColor, o = r.$appearance;
|
|
240
|
+
return a || (o === "default" || o === "outline" ? b.variables.contentColorDefault : b.variables.contentColorInverted);
|
|
234
241
|
}
|
|
235
242
|
}
|
|
236
243
|
}));
|
|
@@ -243,12 +250,12 @@
|
|
|
243
250
|
true: b.variables.contentColorDisabled,
|
|
244
251
|
false: {
|
|
245
252
|
enterprise: function e(r) {
|
|
246
|
-
var a = r.$appearance,
|
|
247
|
-
return
|
|
253
|
+
var a = r.$appearance, o = r.$foregroundColor;
|
|
254
|
+
return o || (a === "default" || a === "outline" ? b.variables.contentColorDefault : b.variables.gray30);
|
|
248
255
|
},
|
|
249
256
|
prisma: function e(r) {
|
|
250
|
-
var a = r.$appearance,
|
|
251
|
-
return
|
|
257
|
+
var a = r.$appearance, o = r.$foregroundColor;
|
|
258
|
+
return o || (a === "default" || a === "outline" ? b.variables.contentColorActive : b.variables.contentColorInverted);
|
|
252
259
|
}
|
|
253
260
|
}
|
|
254
261
|
}));
|
|
@@ -264,8 +271,8 @@
|
|
|
264
271
|
true: b.variables.contentColorDisabled,
|
|
265
272
|
false: {
|
|
266
273
|
enterprise: function e(r) {
|
|
267
|
-
var a = r.$foregroundColor,
|
|
268
|
-
return a || (
|
|
274
|
+
var a = r.$foregroundColor, o = r.$appearance;
|
|
275
|
+
return a || (o === "default" || o === "outline" ? b.variables.textGray : b.variables.gray30);
|
|
269
276
|
}
|
|
270
277
|
}
|
|
271
278
|
})),
|
|
@@ -274,10 +281,10 @@
|
|
|
274
281
|
return r ? b.variables.contentColorDisabled : a || "inherit";
|
|
275
282
|
}))
|
|
276
283
|
}));
|
|
277
|
-
var
|
|
284
|
+
var I = C()($()).withConfig({
|
|
278
285
|
displayName: "ChipStyles__StyledClickable",
|
|
279
286
|
componentId: "sc-1sd3tsh-6"
|
|
280
|
-
})([ "", " flex:0 1 auto;line-height:16px;cursor:pointer;&:focus{", ";}&:not([disabled]):hover{", ";}", ";" ],
|
|
287
|
+
})([ "", " flex:0 1 auto;line-height:16px;cursor:pointer;&:focus{", ";}&:not([disabled]):hover{", ";}", ";" ], x, (0,
|
|
281
288
|
b.pick)({
|
|
282
289
|
enterprise: (0, h.css)([ "box-shadow:", ";color:", ";" ], b.variables.focusShadow, b.variables.linkColor),
|
|
283
290
|
prisma: (0, h.css)([ "color:", ";", "{background-color:", ";box-shadow:0 0 0 3px ", ";}" ], b.variables.contentColorActive, /* sc-sel */ _, b.variables.interactiveColorOverlayHover, b.variables.focusColor)
|
|
@@ -299,62 +306,62 @@
|
|
|
299
306
|
var r = e.$foregroundColor;
|
|
300
307
|
return r || b.variables.linkColor;
|
|
301
308
|
})),
|
|
302
|
-
prisma: (0, h.css)([ "
|
|
303
|
-
var r = e.$appearance;
|
|
304
|
-
return r === "
|
|
309
|
+
prisma: (0, h.css)([ "", "{background-color:", ";color:", ";}" ], /* sc-sel */ _, b.variables.interactiveColorOverlayHover, (function(e) {
|
|
310
|
+
var r = e.$appearance, a = e.$foregroundColor;
|
|
311
|
+
return a || (r === "default" || r === "outline" ? b.variables.contentColorActive : b.variables.contentColorInverted);
|
|
305
312
|
}))
|
|
306
313
|
}), (0, b.pick)({
|
|
307
314
|
prisma: (0, h.css)([ "&:not([disabled]):active ", "{background-color:", ";}" ], /* sc-sel */ _, b.variables.interactiveColorOverlayActive)
|
|
308
315
|
}));
|
|
309
316
|
// CONCATENATED MODULE: ./src/Chip/Chip.tsx
|
|
310
|
-
function
|
|
311
|
-
return
|
|
317
|
+
function q() {
|
|
318
|
+
return q = Object.assign ? Object.assign.bind() : function(e) {
|
|
312
319
|
for (var r = 1; r < arguments.length; r++) {
|
|
313
320
|
var a = arguments[r];
|
|
314
|
-
for (var
|
|
315
|
-
({}).hasOwnProperty.call(a,
|
|
321
|
+
for (var o in a) {
|
|
322
|
+
({}).hasOwnProperty.call(a, o) && (e[o] = a[o]);
|
|
316
323
|
}
|
|
317
324
|
}
|
|
318
325
|
return e;
|
|
319
|
-
},
|
|
326
|
+
}, q.apply(null, arguments);
|
|
320
327
|
}
|
|
321
|
-
function
|
|
322
|
-
return z(e) || L(e, r) ||
|
|
328
|
+
function E(e, r) {
|
|
329
|
+
return z(e) || L(e, r) || D(e, r) || j();
|
|
323
330
|
}
|
|
324
331
|
function j() {
|
|
325
332
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
326
333
|
}
|
|
327
|
-
function
|
|
334
|
+
function D(e, r) {
|
|
328
335
|
if (e) {
|
|
329
|
-
if ("string" == typeof e) return
|
|
336
|
+
if ("string" == typeof e) return A(e, r);
|
|
330
337
|
var a = {}.toString.call(e).slice(8, -1);
|
|
331
|
-
return "Object" === a && e.constructor && (a = e.constructor.name), "Map" === a || "Set" === a ? Array.from(e) : "Arguments" === a || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a) ?
|
|
338
|
+
return "Object" === a && e.constructor && (a = e.constructor.name), "Map" === a || "Set" === a ? Array.from(e) : "Arguments" === a || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a) ? A(e, r) : void 0;
|
|
332
339
|
}
|
|
333
340
|
}
|
|
334
|
-
function
|
|
341
|
+
function A(e, r) {
|
|
335
342
|
(null == r || r > e.length) && (r = e.length);
|
|
336
|
-
for (var a = 0,
|
|
337
|
-
|
|
343
|
+
for (var a = 0, o = Array(r); a < r; a++) {
|
|
344
|
+
o[a] = e[a];
|
|
338
345
|
}
|
|
339
|
-
return
|
|
346
|
+
return o;
|
|
340
347
|
}
|
|
341
348
|
function L(e, r) {
|
|
342
349
|
var a = null == e ? null : "undefined" != typeof Symbol && e[Symbol.iterator] || e["@@iterator"];
|
|
343
350
|
if (null != a) {
|
|
344
|
-
var
|
|
351
|
+
var o, n, i, t, l = [], s = !0, c = !1;
|
|
345
352
|
try {
|
|
346
353
|
if (i = (a = a.call(e)).next, 0 === r) {
|
|
347
354
|
if (Object(a) !== a) return;
|
|
348
355
|
s = !1;
|
|
349
|
-
} else for (;!(s = (
|
|
356
|
+
} else for (;!(s = (o = i.call(a)).done) && (l.push(o.value), l.length !== r); s = !0) {
|
|
350
357
|
}
|
|
351
358
|
} catch (e) {
|
|
352
|
-
c = !0,
|
|
359
|
+
c = !0, n = e;
|
|
353
360
|
} finally {
|
|
354
361
|
try {
|
|
355
362
|
if (!s && null != a["return"] && (t = a["return"](), Object(t) !== t)) return;
|
|
356
363
|
} finally {
|
|
357
|
-
if (c) throw
|
|
364
|
+
if (c) throw n;
|
|
358
365
|
}
|
|
359
366
|
}
|
|
360
367
|
return l;
|
|
@@ -363,29 +370,29 @@
|
|
|
363
370
|
function z(e) {
|
|
364
371
|
if (Array.isArray(e)) return e;
|
|
365
372
|
}
|
|
366
|
-
function
|
|
373
|
+
function B(e, r) {
|
|
367
374
|
if (null == e) return {};
|
|
368
|
-
var a,
|
|
375
|
+
var a, o, n = H(e, r);
|
|
369
376
|
if (Object.getOwnPropertySymbols) {
|
|
370
377
|
var i = Object.getOwnPropertySymbols(e);
|
|
371
|
-
for (
|
|
372
|
-
a = i[
|
|
378
|
+
for (o = 0; o < i.length; o++) {
|
|
379
|
+
a = i[o], r.includes(a) || {}.propertyIsEnumerable.call(e, a) && (n[a] = e[a]);
|
|
373
380
|
}
|
|
374
381
|
}
|
|
375
|
-
return
|
|
382
|
+
return n;
|
|
376
383
|
}
|
|
377
|
-
function
|
|
384
|
+
function H(e, r) {
|
|
378
385
|
if (null == e) return {};
|
|
379
386
|
var a = {};
|
|
380
|
-
for (var
|
|
381
|
-
if ({}.hasOwnProperty.call(e,
|
|
382
|
-
if (r.includes(
|
|
383
|
-
a[
|
|
387
|
+
for (var o in e) {
|
|
388
|
+
if ({}.hasOwnProperty.call(e, o)) {
|
|
389
|
+
if (r.includes(o)) continue;
|
|
390
|
+
a[o] = e[o];
|
|
384
391
|
}
|
|
385
392
|
}
|
|
386
393
|
return a;
|
|
387
394
|
}
|
|
388
|
-
/** @public */ var
|
|
395
|
+
/** @public */ var N = {
|
|
389
396
|
appearance: l().oneOf([ "info", "success", "warning", "error", "outline" ]),
|
|
390
397
|
backgroundColor: l().string,
|
|
391
398
|
children: l().node.isRequired,
|
|
@@ -397,92 +404,92 @@
|
|
|
397
404
|
/** Includes this value in `onRequestRemove` callbacks. */
|
|
398
405
|
value: l().any
|
|
399
406
|
};
|
|
400
|
-
function
|
|
407
|
+
function P(e) {
|
|
401
408
|
return !!e.onRequestRemove;
|
|
402
409
|
}
|
|
403
|
-
function
|
|
404
|
-
var r = e.appearance, a = e.backgroundColor,
|
|
410
|
+
function T(e) {
|
|
411
|
+
var r = e.appearance, a = e.backgroundColor, o = e.disabled, n = e.foregroundColor, i = e.icon, t = B(e, [ "appearance", "backgroundColor", "disabled", "foregroundColor", "icon" ]);
|
|
405
412
|
// Validate that the color being rendered into the CSS is restricted to only values that are of CSS type <color>.
|
|
406
|
-
var l =
|
|
413
|
+
var l = n && (0, v.isCSSColor)(n) ? n : undefined;
|
|
407
414
|
var s = a && (0, v.isCSSColor)(a) ? a : undefined;
|
|
408
415
|
var c = {
|
|
409
416
|
"data-test": "chip",
|
|
410
417
|
$appearance: r || (s ? "custom" : "default"),
|
|
411
418
|
$backgroundColor: s,
|
|
412
419
|
$foregroundColor: l,
|
|
413
|
-
disabled:
|
|
420
|
+
disabled: o,
|
|
414
421
|
icon: i
|
|
415
422
|
};
|
|
416
423
|
return [ c, t ];
|
|
417
424
|
}
|
|
418
425
|
function V(e) {
|
|
419
|
-
var r =
|
|
420
|
-
var s = t.$appearance,
|
|
421
|
-
var y = l.children,
|
|
422
|
-
var j = (0, b.useSplunkTheme)(),
|
|
423
|
-
var
|
|
424
|
-
var L =
|
|
426
|
+
var r = T(e), n = E(r, 2), t = n[0], l = n[1];
|
|
427
|
+
var s = t.$appearance, u = t.$foregroundColor, v = t.disabled, m = v === void 0 ? false : v, h = t.icon, C = B(t, [ "$appearance", "$foregroundColor", "disabled", "icon" ]);
|
|
428
|
+
var y = l.children, $ = l.elementRef, x = l.onRequestRemove, k = l.value, S = B(l, [ "children", "elementRef", "onRequestRemove", "value" ]);
|
|
429
|
+
var j = (0, b.useSplunkTheme)(), D = j.isEnterprise;
|
|
430
|
+
var A = typeof y === "string";
|
|
431
|
+
var L = A ? (0, f.sprintf)((0, d._)("Remove %(children)s"), {
|
|
425
432
|
children: y
|
|
426
433
|
}) : (0, d._)("Remove");
|
|
427
434
|
var z = (0, a.useCallback)((function(e) {
|
|
428
|
-
|
|
435
|
+
x(e, {
|
|
429
436
|
value: k
|
|
430
437
|
});
|
|
431
|
-
}), [
|
|
438
|
+
}), [ x, k ]);
|
|
432
439
|
|
|
433
|
-
return
|
|
440
|
+
return o().createElement(I, q({
|
|
434
441
|
$appearance: s,
|
|
435
|
-
$disabled:
|
|
436
|
-
$foregroundColor:
|
|
442
|
+
$disabled: m,
|
|
443
|
+
$foregroundColor: u,
|
|
437
444
|
"data-test-value": k,
|
|
438
|
-
disabled:
|
|
439
|
-
elementRef:
|
|
445
|
+
disabled: m,
|
|
446
|
+
elementRef: $,
|
|
440
447
|
onClick: z
|
|
441
|
-
}, C, i()(S, Object.keys(
|
|
448
|
+
}, C, i()(S, Object.keys(N))), o().createElement(w, {
|
|
442
449
|
$icon: !!h,
|
|
443
450
|
$removable: true
|
|
444
|
-
},
|
|
451
|
+
}, o().createElement(g(), null, L), h && o().createElement(O, {
|
|
445
452
|
$appearance: s,
|
|
446
|
-
$disabled:
|
|
447
|
-
$foregroundColor:
|
|
448
|
-
}, h),
|
|
453
|
+
$disabled: m,
|
|
454
|
+
$foregroundColor: u
|
|
455
|
+
}, h), o().createElement(R, {
|
|
449
456
|
"data-test": "label",
|
|
450
|
-
"aria-hidden":
|
|
457
|
+
"aria-hidden": A ? true : undefined,
|
|
451
458
|
$appearance: s,
|
|
452
|
-
$disabled:
|
|
453
|
-
$foregroundColor:
|
|
454
|
-
}, y),
|
|
459
|
+
$disabled: m,
|
|
460
|
+
$foregroundColor: u
|
|
461
|
+
}, y), o().createElement(_, {
|
|
455
462
|
$appearance: s,
|
|
456
|
-
$disabled:
|
|
457
|
-
$foregroundColor:
|
|
458
|
-
},
|
|
463
|
+
$disabled: m,
|
|
464
|
+
$foregroundColor: u
|
|
465
|
+
}, D ? o().createElement(p(), {
|
|
459
466
|
"data-test": "cross",
|
|
460
467
|
hideDefaultTooltip: true,
|
|
461
468
|
screenReaderText: null,
|
|
462
469
|
size: .85
|
|
463
|
-
}) :
|
|
470
|
+
}) : o().createElement(c(), {
|
|
464
471
|
"data-test": "cross",
|
|
465
472
|
height: "20px",
|
|
466
473
|
width: "20px"
|
|
467
474
|
}))));
|
|
468
475
|
}
|
|
469
476
|
function M(e) {
|
|
470
|
-
var r =
|
|
471
|
-
var l =
|
|
472
|
-
var d = t.children, v = t.elementRef, f =
|
|
477
|
+
var r = T(e), a = E(r, 2), n = a[0], t = a[1];
|
|
478
|
+
var l = n.$appearance, s = n.$foregroundColor, c = n.disabled, u = n.icon, p = B(n, [ "$appearance", "$foregroundColor", "disabled", "icon" ]);
|
|
479
|
+
var d = t.children, v = t.elementRef, f = B(t, [ "children", "elementRef" ]);
|
|
473
480
|
|
|
474
|
-
return
|
|
481
|
+
return o().createElement(S, q({
|
|
475
482
|
$appearance: l,
|
|
476
483
|
$disabled: c !== null && c !== void 0 ? c : false,
|
|
477
484
|
ref: v
|
|
478
|
-
},
|
|
479
|
-
$icon: !!
|
|
485
|
+
}, p, i()(f, Object.keys(N))), o().createElement(w, {
|
|
486
|
+
$icon: !!u,
|
|
480
487
|
$removable: false
|
|
481
|
-
},
|
|
488
|
+
}, u && o().createElement(O, {
|
|
482
489
|
$appearance: l,
|
|
483
490
|
$disabled: c !== null && c !== void 0 ? c : false,
|
|
484
491
|
$foregroundColor: s
|
|
485
|
-
},
|
|
492
|
+
}, u), o().createElement(R, {
|
|
486
493
|
"data-test": "label",
|
|
487
494
|
$appearance: l,
|
|
488
495
|
$disabled: c !== null && c !== void 0 ? c : false,
|
|
@@ -491,10 +498,11 @@
|
|
|
491
498
|
}
|
|
492
499
|
function W(e) {
|
|
493
500
|
// @docs-props-type ChipPropsBase
|
|
494
|
-
return
|
|
501
|
+
return P(e) ? o().createElement(V, e) : o().createElement(M, e);
|
|
495
502
|
}
|
|
496
|
-
W.propTypes =
|
|
497
|
-
/* harmony default export */ const
|
|
498
|
-
//
|
|
503
|
+
W.propTypes = N;
|
|
504
|
+
/* harmony default export */ const X = W;
|
|
505
|
+
// ChipInteractiveProps and ChipNonInteractiveProps are exported for Storybook
|
|
506
|
+
// CONCATENATED MODULE: ./src/Chip/index.ts
|
|
499
507
|
module.exports = r;
|
|
500
508
|
/******/})();
|
package/ControlGroup.js
CHANGED
|
@@ -547,12 +547,11 @@
|
|
|
547
547
|
var D = v.isPrisma, B = v.isCompact;
|
|
548
548
|
var V = r.Children.toArray(i).filter(r.isValidElement);
|
|
549
549
|
var $ = V.length;
|
|
550
|
-
var A =
|
|
551
|
-
var G =
|
|
552
|
-
var N =
|
|
553
|
-
var W = G || a === true;
|
|
550
|
+
var A = typeof a === "string";
|
|
551
|
+
var G = A && a !== "";
|
|
552
|
+
var N = A || a === true;
|
|
554
553
|
// Clean the Children
|
|
555
|
-
var
|
|
554
|
+
var W = function e(n, o) {
|
|
556
555
|
var i = {
|
|
557
556
|
key: n.key || o
|
|
558
557
|
};
|
|
@@ -610,34 +609,31 @@
|
|
|
610
609
|
i.id = n.props.id || t.getChildID("id", o);
|
|
611
610
|
}
|
|
612
611
|
}
|
|
613
|
-
if (
|
|
612
|
+
if (G && n.props.error === true) {
|
|
614
613
|
i["aria-errormessage"] = t.errorId;
|
|
615
614
|
}
|
|
616
615
|
|
|
617
616
|
return (0, r.cloneElement)(n, i);
|
|
618
617
|
};
|
|
619
|
-
var
|
|
620
|
-
var
|
|
621
|
-
|
|
622
|
-
A["aria-invalid"] = true;
|
|
623
|
-
}
|
|
624
|
-
var J = y === "left" ? {
|
|
618
|
+
var R = V.map(W);
|
|
619
|
+
var z = this.getLinkedId(R);
|
|
620
|
+
var F = y === "left" ? {
|
|
625
621
|
width: h
|
|
626
622
|
} : undefined;
|
|
627
|
-
var
|
|
628
|
-
var
|
|
629
|
-
var
|
|
630
|
-
marginLeft: "calc(".concat(
|
|
623
|
+
var J = p()(h) ? "".concat(h, "px") : h;
|
|
624
|
+
var H = D ? "16px" : "20px";
|
|
625
|
+
var U = y === "left" ? {
|
|
626
|
+
marginLeft: "calc(".concat(J, " + ").concat(H, ")")
|
|
631
627
|
} : undefined;
|
|
632
|
-
var
|
|
633
|
-
var
|
|
634
|
-
var
|
|
635
|
-
style:
|
|
628
|
+
var X = l === "stack" ? S : d();
|
|
629
|
+
var K = y === "left" ? I : w;
|
|
630
|
+
var Q = n().createElement(K, {
|
|
631
|
+
style: F,
|
|
636
632
|
$labelPosition: y
|
|
637
633
|
}, n().createElement(x, {
|
|
638
634
|
"data-test": "label",
|
|
639
635
|
id: this.labelId,
|
|
640
|
-
htmlFor: f ||
|
|
636
|
+
htmlFor: f || z,
|
|
641
637
|
$tooltip: !!g
|
|
642
638
|
}, m && n().createElement(P, {
|
|
643
639
|
"aria-hidden": "true"
|
|
@@ -652,22 +648,23 @@
|
|
|
652
648
|
return n().createElement(O, E({
|
|
653
649
|
"data-test": "control-group",
|
|
654
650
|
"data-test-required": m,
|
|
655
|
-
$error:
|
|
656
|
-
|
|
651
|
+
$error: N,
|
|
652
|
+
"aria-invalid": !!a || undefined
|
|
653
|
+
}, L), n().createElement(T.Provider, {
|
|
657
654
|
value: this.getContextValue()
|
|
658
|
-
}, c ? n().createElement(b(), null,
|
|
655
|
+
}, c ? n().createElement(b(), null, Q) : Q, n().createElement(X, {
|
|
659
656
|
"data-test": "controls",
|
|
660
657
|
flex: l !== "none",
|
|
661
|
-
style:
|
|
662
|
-
},
|
|
658
|
+
style: U
|
|
659
|
+
}, R), s && n().createElement(j, {
|
|
663
660
|
"data-test": "help",
|
|
664
661
|
id: this.helpId,
|
|
665
|
-
style:
|
|
666
|
-
$error:
|
|
667
|
-
}, s),
|
|
662
|
+
style: U,
|
|
663
|
+
$error: N && !G
|
|
664
|
+
}, s), G && n().createElement(k, {
|
|
668
665
|
"data-test": "error",
|
|
669
666
|
id: this.errorId,
|
|
670
|
-
style:
|
|
667
|
+
style: U,
|
|
671
668
|
$help: !!s
|
|
672
669
|
}, a)));
|
|
673
670
|
}
|