@splunk/react-ui 4.28.2 → 4.29.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 +13 -0
- package/Chip.js +160 -151
- package/ComboBox.js +1 -1
- package/MIGRATION.mdx +90 -0
- package/Multiselect.js +43 -42
- package/Paginator.js +291 -402
- package/WaitSpinner.js +17 -16
- package/package.json +2 -2
- package/types/src/Chip/docs/examples/RemovableWithNonStringChildren.d.ts +2 -0
- package/types/src/Markdown/Markdown.d.ts +1 -1
- package/types/src/MessageBar/docs/examples/Basic.d.ts +2 -0
- package/types/src/Paginator/Button.d.ts +14 -9
- package/types/src/WaitSpinner/WaitSpinner.d.ts +1 -0
package/MIGRATION.mdx
CHANGED
|
@@ -5,6 +5,29 @@ import Table from '@splunk/react-ui/Table';
|
|
|
5
5
|
|
|
6
6
|
This document lists migration guidance for new features and breaking changes.
|
|
7
7
|
|
|
8
|
+
## 4.29.0
|
|
9
|
+
|
|
10
|
+
### Deprecated `WaitSpinner`'s `children` prop
|
|
11
|
+
|
|
12
|
+
#### Change
|
|
13
|
+
|
|
14
|
+
`WaitSpinner`'s `children` prop has been deprecated and will be removed in the next major version.
|
|
15
|
+
|
|
16
|
+
#### Context
|
|
17
|
+
|
|
18
|
+
`WaitSpinner` does not support `children` and the prop was not applied in the render of the component. This was properly documented in the TypeScript API as: `children?: never;`. But due to a documentation bug this was not as explicit in the PropTypes documentation.
|
|
19
|
+
|
|
20
|
+
#### Migration steps
|
|
21
|
+
|
|
22
|
+
Remove all usage of `WaitSpinner`'s `children` prop. To render a message beside the wait spinner, render a sibling text element and set `screenReaderText` to `null`.
|
|
23
|
+
|
|
24
|
+
Example with a sibling text element:
|
|
25
|
+
|
|
26
|
+
```jsx
|
|
27
|
+
<WaitSpinner screenReaderText={null} />
|
|
28
|
+
<p>Loading logs</p>
|
|
29
|
+
```
|
|
30
|
+
|
|
8
31
|
## 4.27.0
|
|
9
32
|
|
|
10
33
|
### New `SingleOpenPanelGroup` API for `CollapsiblePanel`
|
|
@@ -161,6 +184,73 @@ No styling is needed.
|
|
|
161
184
|
<Heading level="ss"> is equivalent to <StyledSHeading level={5} variant="title5"/>
|
|
162
185
|
```
|
|
163
186
|
|
|
187
|
+
## 4.17.1
|
|
188
|
+
|
|
189
|
+
### `TextArea`'s `canClear` prop has been deprecated
|
|
190
|
+
|
|
191
|
+
#### Context
|
|
192
|
+
The clear button causes styling issues in TextArea that made it undesirable to support. When the scrollbar appears in a TextArea the clear button is positioned outside, which causes excessive negative space between the input border and scrollbar. This feature is supported in `Text` and `Search` but those components do not run into the styling issues because they do not have scrollbars.
|
|
193
|
+
|
|
194
|
+
Additionally, when entering text into a `TextArea` users can clear the contents using "Select all" via keyboard shortcut or mouse selection. These are natively supported actions and don't require a custom control. It was uncommon to see a clear button in other text areas when doing competitive analysis of other design systems.
|
|
195
|
+
|
|
196
|
+
#### Migration Step
|
|
197
|
+
|
|
198
|
+
Remove the `canClear` prop from `TextArea`. If supporting a one-click clear action is critical, there are two possible methods to add this feature:
|
|
199
|
+
|
|
200
|
+
1) Use the `endAdornment` prop:
|
|
201
|
+
|
|
202
|
+
```jsx
|
|
203
|
+
const [text, setText] = useState('I am clearable content.');
|
|
204
|
+
const handleChange = (e, { value }) => {
|
|
205
|
+
setText(value);
|
|
206
|
+
};
|
|
207
|
+
|
|
208
|
+
const handleClearClick = () => {
|
|
209
|
+
setText('');
|
|
210
|
+
};
|
|
211
|
+
|
|
212
|
+
return (
|
|
213
|
+
<TextArea
|
|
214
|
+
onChange={handleChange}
|
|
215
|
+
value={text}
|
|
216
|
+
endAdornment={
|
|
217
|
+
<StyledButton
|
|
218
|
+
appearance="secondary"
|
|
219
|
+
aria-label="Clear text"
|
|
220
|
+
icon={<Cross />}
|
|
221
|
+
onClick={handleClearClick}
|
|
222
|
+
/>
|
|
223
|
+
/>
|
|
224
|
+
);
|
|
225
|
+
/>
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
2) Render a clear action outside of the TextArea:
|
|
229
|
+
|
|
230
|
+
```jsx
|
|
231
|
+
const [text, setText] = useState('I am clearable content.');
|
|
232
|
+
const handleChange = (e, { value }) => {
|
|
233
|
+
setText(value);
|
|
234
|
+
};
|
|
235
|
+
|
|
236
|
+
const handleClearClick = () => {
|
|
237
|
+
setText('');
|
|
238
|
+
};
|
|
239
|
+
|
|
240
|
+
return (
|
|
241
|
+
<>
|
|
242
|
+
<TextArea onChange={handleChange} value={text} />
|
|
243
|
+
<StyledButton
|
|
244
|
+
appearance="secondary"
|
|
245
|
+
label="Clear text"
|
|
246
|
+
icon={<Cross />}
|
|
247
|
+
onClick={handleClearClick}
|
|
248
|
+
/>
|
|
249
|
+
</>
|
|
250
|
+
);
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
|
|
164
254
|
## 4.17.0
|
|
165
255
|
|
|
166
256
|
### `Typography` `weight` prop
|
package/Multiselect.js
CHANGED
|
@@ -404,7 +404,7 @@
|
|
|
404
404
|
if (n) T(e, n);
|
|
405
405
|
return e;
|
|
406
406
|
}
|
|
407
|
-
function
|
|
407
|
+
function B(e, t) {
|
|
408
408
|
if (typeof t !== "function" && t !== null) {
|
|
409
409
|
throw new TypeError("Super expression must either be null or a function");
|
|
410
410
|
}
|
|
@@ -415,14 +415,14 @@
|
|
|
415
415
|
configurable: true
|
|
416
416
|
}
|
|
417
417
|
});
|
|
418
|
-
if (t)
|
|
418
|
+
if (t) N(e, t);
|
|
419
419
|
}
|
|
420
|
-
function
|
|
421
|
-
|
|
420
|
+
function N(e, t) {
|
|
421
|
+
N = Object.setPrototypeOf || function e(t, n) {
|
|
422
422
|
t.__proto__ = n;
|
|
423
423
|
return t;
|
|
424
424
|
};
|
|
425
|
-
return
|
|
425
|
+
return N(e, t);
|
|
426
426
|
}
|
|
427
427
|
function L(e) {
|
|
428
428
|
var t = $();
|
|
@@ -519,7 +519,7 @@
|
|
|
519
519
|
* [PureComponent](https://reactjs.org/docs/react-api.html#reactpurecomponent)
|
|
520
520
|
* so any elements passed to it must also be pure.
|
|
521
521
|
*/ var G = function(e) {
|
|
522
|
-
|
|
522
|
+
B(n, e);
|
|
523
523
|
var t = L(n);
|
|
524
524
|
function n() {
|
|
525
525
|
var e;
|
|
@@ -638,7 +638,7 @@
|
|
|
638
638
|
const Te = require("@splunk/react-icons/Magnifier");
|
|
639
639
|
var qe = e.n(Te);
|
|
640
640
|
// CONCATENATED MODULE: ./src/Select/icons/Search.tsx
|
|
641
|
-
var
|
|
641
|
+
var Be = function e() {
|
|
642
642
|
var t = (0, Ae.useSplunkTheme)(), n = t.isEnterprise, o = t.isCompact;
|
|
643
643
|
var a = (0, u._)("Search");
|
|
644
644
|
var i = o ? "20px" : "24px";
|
|
@@ -655,7 +655,7 @@
|
|
|
655
655
|
});
|
|
656
656
|
return l;
|
|
657
657
|
};
|
|
658
|
-
/* harmony default export */ const
|
|
658
|
+
/* harmony default export */ const Ne = Be;
|
|
659
659
|
// CONCATENATED MODULE: external "styled-components"
|
|
660
660
|
const Le = require("styled-components");
|
|
661
661
|
var Fe = e.n(Le);
|
|
@@ -1217,12 +1217,12 @@
|
|
|
1217
1217
|
Object.defineProperty(e, r.key, r);
|
|
1218
1218
|
}
|
|
1219
1219
|
}
|
|
1220
|
-
function
|
|
1220
|
+
function Bt(e, t, n) {
|
|
1221
1221
|
if (t) qt(e.prototype, t);
|
|
1222
1222
|
if (n) qt(e, n);
|
|
1223
1223
|
return e;
|
|
1224
1224
|
}
|
|
1225
|
-
function
|
|
1225
|
+
function Nt(e, t) {
|
|
1226
1226
|
if (typeof t !== "function" && t !== null) {
|
|
1227
1227
|
throw new TypeError("Super expression must either be null or a function");
|
|
1228
1228
|
}
|
|
@@ -1427,9 +1427,9 @@
|
|
|
1427
1427
|
return "".concat(Wt(e), "-").concat(e, "-").concat(t);
|
|
1428
1428
|
}
|
|
1429
1429
|
var rn = function(e) {
|
|
1430
|
-
|
|
1430
|
+
Nt(o, e);
|
|
1431
1431
|
var t = Ft(o);
|
|
1432
|
-
|
|
1432
|
+
Bt(o, null, [ {
|
|
1433
1433
|
key: "validateAppearance",
|
|
1434
1434
|
// @docs-props-type CompactPropsBase
|
|
1435
1435
|
value: function e(t) {
|
|
@@ -2056,7 +2056,7 @@
|
|
|
2056
2056
|
a.activeItemId = (0, be.createDOMID)("active-item");
|
|
2057
2057
|
return a;
|
|
2058
2058
|
}
|
|
2059
|
-
|
|
2059
|
+
Bt(o, [ {
|
|
2060
2060
|
key: "componentDidUpdate",
|
|
2061
2061
|
value: function e(t, n) {
|
|
2062
2062
|
if (false) {}
|
|
@@ -2186,7 +2186,7 @@
|
|
|
2186
2186
|
inputRef: s,
|
|
2187
2187
|
inputId: l,
|
|
2188
2188
|
canClear: true,
|
|
2189
|
-
startAdornment: r().createElement(ht, null, r().createElement(
|
|
2189
|
+
startAdornment: r().createElement(ht, null, r().createElement(Ne, null))
|
|
2190
2190
|
})), c && n && p === "buttongroup" && v);
|
|
2191
2191
|
}
|
|
2192
2192
|
}, {
|
|
@@ -2537,10 +2537,10 @@
|
|
|
2537
2537
|
var Tn = e.n(Dn);
|
|
2538
2538
|
// CONCATENATED MODULE: external "@splunk/react-ui/Chip"
|
|
2539
2539
|
const qn = require("@splunk/react-ui/Chip");
|
|
2540
|
-
var
|
|
2540
|
+
var Bn = e.n(qn);
|
|
2541
2541
|
// CONCATENATED MODULE: external "@splunk/react-ui/Popover"
|
|
2542
|
-
const
|
|
2543
|
-
var Ln = e.n(
|
|
2542
|
+
const Nn = require("@splunk/react-ui/Popover");
|
|
2543
|
+
var Ln = e.n(Nn);
|
|
2544
2544
|
// CONCATENATED MODULE: external "@splunk/react-ui/ScreenReaderContent"
|
|
2545
2545
|
const Fn = require("@splunk/react-ui/ScreenReaderContent");
|
|
2546
2546
|
var Kn = e.n(Fn);
|
|
@@ -2599,14 +2599,14 @@
|
|
|
2599
2599
|
enterprise: Ae.variables.spacingHalf,
|
|
2600
2600
|
prisma: Ae.variables.spacingSmall
|
|
2601
2601
|
}));
|
|
2602
|
-
var Un = Fe().
|
|
2603
|
-
displayName: "
|
|
2602
|
+
var Un = Fe().span.withConfig({
|
|
2603
|
+
displayName: "NormalStyles__StyledButtonsWrapper",
|
|
2604
2604
|
componentId: "sc-1uwwpco-1"
|
|
2605
|
-
})([ "
|
|
2605
|
+
})([ "display:contents;" ]);
|
|
2606
2606
|
var Gn = Fe().input.withConfig({
|
|
2607
2607
|
displayName: "NormalStyles__StyledInput",
|
|
2608
2608
|
componentId: "sc-1uwwpco-2"
|
|
2609
|
-
})([ "", ";
|
|
2609
|
+
})([ "", ";flex:1 0 auto;max-width:100%;line-height:12px;", "" ], Ae.mixins.reset("block"), (0,
|
|
2610
2610
|
Ae.pick)({
|
|
2611
2611
|
enterprise: {
|
|
2612
2612
|
comfortable: (0, Le.css)([ "padding:", ";" ], Ae.variables.spacingQuarter),
|
|
@@ -3238,7 +3238,7 @@
|
|
|
3238
3238
|
if (o != null) {
|
|
3239
3239
|
var a = o.children, i = o.icon, l = o.label, s = o.selectedAppearance, c = o.selectedBackgroundColor, u = o.selectedForegroundColor, p = o.value;
|
|
3240
3240
|
|
|
3241
|
-
return r().createElement(
|
|
3241
|
+
return r().createElement(Bn(), {
|
|
3242
3242
|
"aria-selected": true,
|
|
3243
3243
|
disabled: n.props.disabled,
|
|
3244
3244
|
icon: i,
|
|
@@ -3253,7 +3253,7 @@
|
|
|
3253
3253
|
}, r().createElement(r().Fragment, null, a || l));
|
|
3254
3254
|
}
|
|
3255
3255
|
|
|
3256
|
-
return r().createElement(
|
|
3256
|
+
return r().createElement(Bn(), {
|
|
3257
3257
|
"aria-selected": true,
|
|
3258
3258
|
disabled: n.props.disabled,
|
|
3259
3259
|
key: (0, be.createGUID)(),
|
|
@@ -3389,18 +3389,15 @@
|
|
|
3389
3389
|
$popoverOpen: this.state.open,
|
|
3390
3390
|
flex: true,
|
|
3391
3391
|
elementRef: this.handleMount,
|
|
3392
|
-
role: "
|
|
3392
|
+
role: "group",
|
|
3393
3393
|
"aria-disabled": v || undefined,
|
|
3394
|
-
"aria-labelledby": m
|
|
3394
|
+
"aria-labelledby": m
|
|
3395
|
+
}, k), r().createElement(Un, {
|
|
3396
|
+
role: "listbox",
|
|
3395
3397
|
"aria-invalid": h,
|
|
3396
3398
|
"aria-multiselectable": "true"
|
|
3397
|
-
},
|
|
3399
|
+
}, this.renderButtons(_)), !v && r().createElement(Gn, sr({
|
|
3398
3400
|
role: "combobox",
|
|
3399
|
-
"aria-owns": this.state.open ? this.popoverId : undefined,
|
|
3400
|
-
"aria-haspopup": true,
|
|
3401
|
-
"aria-expanded": this.state.open,
|
|
3402
|
-
"aria-controls": this.state.open ? this.popoverId : undefined
|
|
3403
|
-
}, r().createElement(Gn, sr({
|
|
3404
3401
|
"data-test": "textbox",
|
|
3405
3402
|
id: y,
|
|
3406
3403
|
ref: this.handleInputMount,
|
|
@@ -3413,12 +3410,16 @@
|
|
|
3413
3410
|
autoComplete: "off",
|
|
3414
3411
|
autoCorrect: "off",
|
|
3415
3412
|
spellCheck: false,
|
|
3416
|
-
"aria-autocomplete": "list",
|
|
3417
3413
|
style: A,
|
|
3418
3414
|
placeholder: I.length ? "" : g,
|
|
3419
3415
|
required: O,
|
|
3420
|
-
"aria-activedescendant": this.state.open && this.availableOptionCount > 0 ? this.activeItemId : undefined
|
|
3421
|
-
|
|
3416
|
+
"aria-activedescendant": this.state.open && this.availableOptionCount > 0 ? this.activeItemId : undefined,
|
|
3417
|
+
"aria-autocomplete": "list",
|
|
3418
|
+
"aria-controls": this.state.open ? this.popoverId : undefined,
|
|
3419
|
+
"aria-owns": this.state.open ? this.popoverId : undefined,
|
|
3420
|
+
"aria-expanded": this.state.open,
|
|
3421
|
+
"aria-haspopup": true
|
|
3422
|
+
}, x)), r().createElement(Ln(), {
|
|
3422
3423
|
open: this.state.open && !!this.state.el,
|
|
3423
3424
|
autoCloseWhenOffScreen: true,
|
|
3424
3425
|
anchor: this.state.el,
|
|
@@ -3557,7 +3558,7 @@
|
|
|
3557
3558
|
};
|
|
3558
3559
|
return qr(e);
|
|
3559
3560
|
}
|
|
3560
|
-
function
|
|
3561
|
+
function Br(e, t, n) {
|
|
3561
3562
|
if (t in e) {
|
|
3562
3563
|
Object.defineProperty(e, t, {
|
|
3563
3564
|
value: n,
|
|
@@ -3570,7 +3571,7 @@
|
|
|
3570
3571
|
}
|
|
3571
3572
|
return e;
|
|
3572
3573
|
}
|
|
3573
|
-
var
|
|
3574
|
+
var Nr = {
|
|
3574
3575
|
allowNewValues: a().bool,
|
|
3575
3576
|
animateLoading: a().bool,
|
|
3576
3577
|
children: a().node,
|
|
@@ -3655,12 +3656,12 @@
|
|
|
3655
3656
|
} ]);
|
|
3656
3657
|
return n;
|
|
3657
3658
|
}(n.Component);
|
|
3658
|
-
|
|
3659
|
-
|
|
3660
|
-
|
|
3661
|
-
|
|
3662
|
-
|
|
3663
|
-
|
|
3659
|
+
Br(Kr, "propTypes", Nr);
|
|
3660
|
+
Br(Kr, "defaultProps", Lr);
|
|
3661
|
+
Br(Kr, "componentType", "Multiselect");
|
|
3662
|
+
Br(Kr, "Option", J);
|
|
3663
|
+
Br(Kr, "Heading", p.Heading);
|
|
3664
|
+
Br(Kr, "Divider", p.Divider);
|
|
3664
3665
|
/* harmony default export */ const $r = Kr;
|
|
3665
3666
|
// CONCATENATED MODULE: ./src/Multiselect/index.ts
|
|
3666
3667
|
module.exports = t;
|