@splunk/react-ui 4.42.0 → 4.44.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/ButtonGroup.js +10 -11
- package/ButtonSimple.js +209 -209
- package/CHANGELOG.md +41 -0
- package/Clickable.js +1 -1
- package/Code.js +611 -426
- package/ComboBox.js +25 -32
- package/Date.js +42 -27
- package/Dropdown.js +1 -1
- package/DualListbox.js +1 -1
- package/JSONTree.js +30 -24
- package/MIGRATION.mdx +70 -54
- package/Menu.js +13 -9
- package/Multiselect.js +1 -1
- package/Number.js +345 -317
- package/Paginator.js +269 -251
- package/Popover.js +412 -345
- package/RadioList.js +44 -43
- package/ResultsMenu.d.ts +2 -0
- package/Search.js +56 -65
- package/Select.js +1 -1
- package/Slider.js +17 -13
- package/StaticContent.js +15 -13
- package/TabBar.js +4 -0
- package/Table.js +162 -153
- package/TransitionOpen.js +16 -14
- package/Tree.d.ts +2 -0
- package/Tree.js +20 -14
- package/package.json +6 -6
- package/types/src/Button/Button.d.ts +1 -0
- package/types/src/Code/Code.d.ts +1 -1
- package/types/src/ComboBox/ComboBox.d.ts +6 -3
- package/types/src/Date/Date.d.ts +3 -3
- package/types/src/Dropdown/docs/examples/TooltipButtonToggle.d.ts +2 -0
- package/types/src/Multiselect/Multiselect.d.ts +2 -0
- package/types/src/Number/Number.d.ts +4 -10
- package/types/src/Number/utils.d.ts +29 -0
- package/types/src/Paginator/Paginator.d.ts +15 -2
- package/types/src/Paginator/docs/examples/CustomPages.d.ts +2 -0
- package/types/src/Popover/Popover.d.ts +17 -8
- package/types/src/Popover/PopoverMenuContext.d.ts +6 -0
- package/types/src/Popover/PopoverProvider.d.ts +23 -0
- package/types/src/Popover/index.d.ts +2 -1
- package/types/src/RadioList/RadioList.d.ts +1 -1
- package/types/src/Select/SelectBase.d.ts +1 -1
- package/types/src/Select/docs/examples/Appearance.d.ts +1 -11
- package/types/src/Select/docs/examples/Basic.d.ts +1 -9
- package/types/src/Select/docs/examples/Children.d.ts +1 -9
- package/types/src/Select/docs/examples/Descriptions.d.ts +1 -9
- package/types/src/Select/docs/examples/Fetching.d.ts +1 -22
- package/types/src/Select/docs/examples/Filter.d.ts +1 -9
- package/types/src/Select/docs/examples/Headings.d.ts +1 -9
- package/types/src/Select/docs/examples/LoadMoreOnScrollBottom.d.ts +1 -24
- package/types/src/Select/docs/examples/Prefix.d.ts +1 -9
- package/types/src/Select/docs/examples/Truncate.d.ts +1 -9
- package/types/src/Slider/Slider.d.ts +1 -1
- package/types/src/StaticContent/StaticContent.d.ts +3 -1
- package/types/src/Table/docs/examples/Click.d.ts +2 -16
- package/types/src/Table/docs/examples/ClickRows.d.ts +2 -16
- package/types/src/Table/docs/examples/Complex.d.ts +2 -50
- package/types/src/Table/docs/examples/FilterColumnValues.d.ts +1 -13
- package/types/src/Table/docs/examples/HeadDropdownCell.d.ts +1 -17
- package/types/src/Table/docs/examples/ReorderColumns.d.ts +2 -21
- package/types/src/Table/docs/examples/ReorderRows.d.ts +2 -21
- package/types/src/Table/docs/examples/Resizable.d.ts +2 -23
- package/types/src/Table/docs/examples/ResizableFill.d.ts +2 -23
- package/types/src/Table/docs/examples/RowActions.d.ts +2 -39
- package/types/src/Table/docs/examples/Selectable.d.ts +2 -18
- package/types/src/Table/docs/examples/SortableColumns.d.ts +1 -11
- package/useResizeObserver.js +122 -90
- package/types/src/Dropdown/docs/examples/OtherToggles.d.ts +0 -2
- package/types/src/Popover/PopoverContext.d.ts +0 -6
package/MIGRATION.mdx
CHANGED
|
@@ -5,6 +5,27 @@ 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.44.0
|
|
9
|
+
|
|
10
|
+
### `ButtonGroup` role changed to `group`
|
|
11
|
+
|
|
12
|
+
### Change
|
|
13
|
+
|
|
14
|
+
`ButtonGroup`'s `role` has changed from `menubar` to `group`.
|
|
15
|
+
Child `Button`'s `role`s have changed from `menuitem` to `button`.
|
|
16
|
+
|
|
17
|
+
#### Context
|
|
18
|
+
|
|
19
|
+
`ButtonGroup` did not implement the correct keyboard behavior for a menu bar.
|
|
20
|
+
This created an unexpected user experience for keyboard and screen reader users.
|
|
21
|
+
|
|
22
|
+
#### Migration steps
|
|
23
|
+
|
|
24
|
+
If `role="group"` is not desired:
|
|
25
|
+
* consider using `RadioBar` which supports `role="menubar"`
|
|
26
|
+
* implement either the [Menubar](https://www.w3.org/WAI/ARIA/apg/patterns/menubar/) or [Toolbar](https://www.w3.org/WAI/ARIA/apg/patterns/toolbar/) pattern according to WCAG guidelines using `ButtonGroup`
|
|
27
|
+
* contact the Design System team to make a feature request based on your use case.
|
|
28
|
+
|
|
8
29
|
## 4.40.0
|
|
9
30
|
|
|
10
31
|
### Deprecated `Select`'s `appearance="primary"` value
|
|
@@ -46,6 +67,17 @@ Remove usages of the `iconSize` prop.
|
|
|
46
67
|
|
|
47
68
|
## 4.39.0
|
|
48
69
|
|
|
70
|
+
### Deprecated `Menu.Item`'s `icon` prop
|
|
71
|
+
|
|
72
|
+
#### Change
|
|
73
|
+
`Menu.Item`'s `icon` prop is deprecated and will be removed in a future major version.
|
|
74
|
+
|
|
75
|
+
#### Context
|
|
76
|
+
The `Menu.Item` icon should not be used as `Menu.Item` as that restricted the location of the icon and it is now possible to place an adornment at the start or the end of the `Menu.Item` content.
|
|
77
|
+
|
|
78
|
+
#### Migration steps
|
|
79
|
+
Replace all usage of `Menu.Item`'s `icon` prop with `startAdornment` and/or `endAdornment`.
|
|
80
|
+
|
|
49
81
|
### Deprecated `TabBar` and `TabLayout`'s `appearance` prop
|
|
50
82
|
|
|
51
83
|
#### Change
|
|
@@ -60,7 +92,7 @@ Due to these factors, the `"context"` appearance has poor accessibility on two f
|
|
|
60
92
|
* it makes it difficult to distinguish the tabs from the content
|
|
61
93
|
* it has poor contrast between the selected and unselected tabs
|
|
62
94
|
|
|
63
|
-
The
|
|
95
|
+
The existence of this appearance has also encouraged uses of these components where tabs are not appropriate.
|
|
64
96
|
|
|
65
97
|
Additionally, this appearance has only been supported in Prisma themes, leading to visual inconsistency with Enterprise themes.
|
|
66
98
|
|
|
@@ -98,6 +130,22 @@ There are two possible use cases for a selectable `Button`:
|
|
|
98
130
|
1) If the `Button` was used as part of a `ButtonGroup`, replace it with a `RadioBar`.
|
|
99
131
|
2) If the `Button` was used standalone, replace it with a `Switch` with `appearance="toggle"`.
|
|
100
132
|
|
|
133
|
+
## 4.36.0
|
|
134
|
+
|
|
135
|
+
### Deprecated `ComboBox`, `ControlGroup`, and `StaticContent`'s `size` prop
|
|
136
|
+
|
|
137
|
+
#### Change
|
|
138
|
+
|
|
139
|
+
`ComboBox`, `ControlGroup`, and `StaticContent`'s `size` prop has been deprecated and will be removed in the next major version.
|
|
140
|
+
|
|
141
|
+
#### Context
|
|
142
|
+
|
|
143
|
+
The `size` prop currently does not do anything in `ComboBox`, `ControlGroup`, or `StaticContent`, so it will be removed in the next major version.
|
|
144
|
+
|
|
145
|
+
#### Migration steps
|
|
146
|
+
|
|
147
|
+
Remove all usage of `ComboBox`, `ControlGroup`, and `StaticContent`'s `size` prop. To change the size of components, use the `SplunkThemeProvider`'s `density` prop.
|
|
148
|
+
|
|
101
149
|
## 4.35.0
|
|
102
150
|
|
|
103
151
|
### Deprecated `Menu`'s `retainFocus` prop
|
|
@@ -142,7 +190,7 @@ For Enterprise themes:
|
|
|
142
190
|
* the `"pill"` value can be replaced with `"subtle"` with no other changes.
|
|
143
191
|
|
|
144
192
|
For Prisma themes:
|
|
145
|
-
* the `"flat"` appearance can be replaced
|
|
193
|
+
* the `"flat"` appearance can be replaced with `"subtle"`.
|
|
146
194
|
* the `"toggle"` appearance can be replaced with `"default"`.
|
|
147
195
|
|
|
148
196
|
### Improved `Card.Header` accessibility when rendering actions
|
|
@@ -201,7 +249,7 @@ For Enterprise themes:
|
|
|
201
249
|
|
|
202
250
|
For Prisma themes:
|
|
203
251
|
* the `"flat"` appearance can be replaced by `"secondary"` or `"subtle"` depending on the context in which it appears.
|
|
204
|
-
* the `"toggle"` appearance can be replaced with `"
|
|
252
|
+
* the `"toggle"` appearance can be replaced with `"secondary"`.
|
|
205
253
|
|
|
206
254
|
### Deprecated `CollapsiblePanel`'s `titleWithActions` prop
|
|
207
255
|
|
|
@@ -223,6 +271,21 @@ and move them to the new `actions` prop.
|
|
|
223
271
|
|
|
224
272
|
## 4.30.0
|
|
225
273
|
|
|
274
|
+
### Deprecated `Text`'s `appearance` prop
|
|
275
|
+
|
|
276
|
+
#### Change
|
|
277
|
+
|
|
278
|
+
`Text`'s `appearance` prop has been deprecated and will be removed in the next major version.
|
|
279
|
+
|
|
280
|
+
#### Context
|
|
281
|
+
|
|
282
|
+
`Text`'s `appearance` prop allowed the values "default" and "search".
|
|
283
|
+
With the new `Search` component optimized for user interaction, Text's `appearance` prop has become unnecessary.
|
|
284
|
+
|
|
285
|
+
#### Migration steps
|
|
286
|
+
|
|
287
|
+
Replace all usage of `Text`'s `appearance="search"` value with the `Search` component. Remove all usage of `Text`'s `appearance="default"` value.
|
|
288
|
+
|
|
226
289
|
### Deprecated `NavigationProvider`'s `prefix` prop
|
|
227
290
|
|
|
228
291
|
#### Change
|
|
@@ -397,7 +460,7 @@ const StyledSHeading = styled(Heading)`
|
|
|
397
460
|
})};
|
|
398
461
|
`;
|
|
399
462
|
|
|
400
|
-
<StyledSHeading level={
|
|
463
|
+
<StyledSHeading level={5} variant="title4"/>
|
|
401
464
|
```
|
|
402
465
|
|
|
403
466
|
`level="ss"` styling:
|
|
@@ -410,7 +473,7 @@ const StyledSSHeading = styled(Heading)`
|
|
|
410
473
|
})};
|
|
411
474
|
`;
|
|
412
475
|
|
|
413
|
-
<StyledSHeading level={
|
|
476
|
+
<StyledSHeading level={6} variant="title5"/>
|
|
414
477
|
```
|
|
415
478
|
|
|
416
479
|
*Prisma*
|
|
@@ -423,14 +486,14 @@ const StyledSHeading = styled(Heading)`
|
|
|
423
486
|
color: ${variables.contentColorDefault};
|
|
424
487
|
`;
|
|
425
488
|
|
|
426
|
-
<StyledSHeading level={
|
|
489
|
+
<StyledSHeading level={5} variant="title4"/>
|
|
427
490
|
```
|
|
428
491
|
|
|
429
492
|
`level="ss"` styling:
|
|
430
493
|
|
|
431
494
|
```jsx
|
|
432
495
|
No styling is needed.
|
|
433
|
-
<Heading level="ss"> is equivalent to <StyledSHeading level={
|
|
496
|
+
<Heading level="ss"> is equivalent to <StyledSHeading level={6} variant="title5"/>
|
|
434
497
|
```
|
|
435
498
|
|
|
436
499
|
## 4.17.1
|
|
@@ -724,50 +787,3 @@ Previously, `Tooltip` closed as soon as a user stopped hovering over the toggle.
|
|
|
724
787
|
|
|
725
788
|
#### Migration steps
|
|
726
789
|
Replace all usage of `Popover`’s `pointerEvents` prop with `possibleOpenReasons` and `possibleCloseReasons`.
|
|
727
|
-
|
|
728
|
-
## 4.30.0
|
|
729
|
-
|
|
730
|
-
### Deprecated `Text`'s `appearance` prop
|
|
731
|
-
|
|
732
|
-
#### Change
|
|
733
|
-
|
|
734
|
-
`Text`'s `appearance` prop has been deprecated and will be removed in the next major version.
|
|
735
|
-
|
|
736
|
-
#### Context
|
|
737
|
-
|
|
738
|
-
`Text`'s `appearance` prop allowed the values "default" and "search".
|
|
739
|
-
With the new `Search` component optimized for user interaction, Text's `appearance` prop has become unnecessary.
|
|
740
|
-
|
|
741
|
-
#### Migration steps
|
|
742
|
-
|
|
743
|
-
Replace all usage of `Text`'s `appearance="search"` value with the `Search` component. Remove all usage of `Text`'s `appearance="default"` value.
|
|
744
|
-
|
|
745
|
-
## 4.36.0
|
|
746
|
-
|
|
747
|
-
### Deprecated `ComboBox`, `ControlGroup`, and `StaticContent`'s `size` prop
|
|
748
|
-
|
|
749
|
-
#### Change
|
|
750
|
-
|
|
751
|
-
`ComboBox`, `ControlGroup`, and `StaticContent`'s `size` prop has been deprecated and will be removed in the next major version.
|
|
752
|
-
|
|
753
|
-
#### Context
|
|
754
|
-
|
|
755
|
-
The `size` prop currently does not do anything in `ComboBox`, `ControlGroup`, or `StaticContent`, so it will be removed in the next major version.
|
|
756
|
-
|
|
757
|
-
#### Migration steps
|
|
758
|
-
|
|
759
|
-
Remove all usage of `ComboBox`, `ControlGroup`, and `StaticContent`'s `size` prop. To change the size of components, use the `SplunkThemeProvider`'s `density` prop.
|
|
760
|
-
|
|
761
|
-
## 4.39.0
|
|
762
|
-
|
|
763
|
-
### Deprecated `Menu.Item`'s `icon` prop
|
|
764
|
-
|
|
765
|
-
#### Change
|
|
766
|
-
`Menu.Item`'s `icon` prop is deprecated and will be removed in a future major version.
|
|
767
|
-
|
|
768
|
-
#### Context
|
|
769
|
-
The `Menu.Item` icon should not be used as `Menu.Item` as that restricted the location of the icon and it is now possible to place an adornment at the start or the end of the `Menu.Item` content.
|
|
770
|
-
|
|
771
|
-
#### Migration steps
|
|
772
|
-
Replace all usage of `Menu.Item`'s `icon` prop with `startAdornment` and/or `endAdornment`.
|
|
773
|
-
|
package/Menu.js
CHANGED
|
@@ -294,8 +294,8 @@
|
|
|
294
294
|
const L = require("lodash/isString");
|
|
295
295
|
var z = e.n(L);
|
|
296
296
|
// CONCATENATED MODULE: external "@splunk/react-icons/ChevronRight"
|
|
297
|
-
const
|
|
298
|
-
var
|
|
297
|
+
const K = require("@splunk/react-icons/ChevronRight");
|
|
298
|
+
var B = e.n(K);
|
|
299
299
|
// CONCATENATED MODULE: external "@splunk/react-icons/Checkmark"
|
|
300
300
|
const W = require("@splunk/react-icons/Checkmark");
|
|
301
301
|
var G = e.n(W);
|
|
@@ -368,7 +368,7 @@
|
|
|
368
368
|
var ce = d()(te()).withConfig({
|
|
369
369
|
displayName: "ItemStyles__StyledClickable",
|
|
370
370
|
componentId: "sc-4kc053-4"
|
|
371
|
-
})([ "display:block;position:relative;cursor:pointer;color:", ";word-wrap:break-word;max-width:100%;width:100%;padding:", ";", " ", " ", " &:not([disabled],[aria-disabled='true']){&:hover{background:", ";", "}", " ", "}&:focus{outline:0;box-shadow:", ";", "}&[disabled],&[aria-disabled='true']{color:", ";
|
|
371
|
+
})([ "display:block;position:relative;cursor:pointer;color:", ";word-wrap:break-word;max-width:100%;width:100%;padding:", ";", " ", " ", " &:not([disabled],[aria-disabled='true']){&:hover{background:", ";", "}", " ", "}&:focus{outline:0;box-shadow:", ";", "}&[disabled],&[aria-disabled='true']{color:", ";", ",", "{color:inherit;}", "{color:", ";}", "}", "" ], (0,
|
|
372
372
|
m.pick)({
|
|
373
373
|
prisma: m.variables.contentColorActive,
|
|
374
374
|
enterprise: {
|
|
@@ -668,10 +668,10 @@
|
|
|
668
668
|
}) : e[t] = r, e;
|
|
669
669
|
}
|
|
670
670
|
function ze(e) {
|
|
671
|
-
var t =
|
|
671
|
+
var t = Ke(e, "string");
|
|
672
672
|
return "symbol" == Ee(t) ? t : t + "";
|
|
673
673
|
}
|
|
674
|
-
function
|
|
674
|
+
function Ke(e, t) {
|
|
675
675
|
if ("object" != Ee(e) || !e) return e;
|
|
676
676
|
var r = e[Symbol.toPrimitive];
|
|
677
677
|
if (void 0 !== r) {
|
|
@@ -681,7 +681,7 @@
|
|
|
681
681
|
}
|
|
682
682
|
return ("string" === t ? String : Number)(e);
|
|
683
683
|
}
|
|
684
|
-
var
|
|
684
|
+
var Be = {
|
|
685
685
|
active: o().bool,
|
|
686
686
|
children: o().node,
|
|
687
687
|
description: o().string,
|
|
@@ -871,7 +871,7 @@
|
|
|
871
871
|
}), o && n().createElement(me, null, S ? n().createElement(Y(), {
|
|
872
872
|
hideDefaultTooltip: true,
|
|
873
873
|
screenReaderText: null
|
|
874
|
-
}) : n().createElement(
|
|
874
|
+
}) : n().createElement(B(), null)), T && n().createElement(ae, {
|
|
875
875
|
"data-test": "description"
|
|
876
876
|
}, u), n().createElement(ue, null, x ? n().createElement(se, null, x) : p && n().createElement(se, null, p), n().createElement(de, {
|
|
877
877
|
$truncate: y
|
|
@@ -887,7 +887,7 @@
|
|
|
887
887
|
} ]);
|
|
888
888
|
return r;
|
|
889
889
|
}(r.Component);
|
|
890
|
-
Le(Ve, "propTypes",
|
|
890
|
+
Le(Ve, "propTypes", Be);
|
|
891
891
|
Le(Ve, "defaultProps", We);
|
|
892
892
|
Le(Ve, "as", void 0);
|
|
893
893
|
Le(Ve, "contextType", h);
|
|
@@ -985,7 +985,7 @@
|
|
|
985
985
|
// @docs-props-type MenuPropsBase
|
|
986
986
|
if (false) {}
|
|
987
987
|
var d = (0, r.useContext)(h), f = d.role, v = f === void 0 ? "menu" : f;
|
|
988
|
-
var m = (0, r.useContext)(s.
|
|
988
|
+
var m = (0, r.useContext)(s.PopoverMenuContext), b = m.retainFocus;
|
|
989
989
|
var y = (0, r.useRef)(null);
|
|
990
990
|
var g = true;
|
|
991
991
|
if (a != null) {
|
|
@@ -1024,6 +1024,10 @@
|
|
|
1024
1024
|
}), [ i ]);
|
|
1025
1025
|
var w = lt(g);
|
|
1026
1026
|
var S = (0, r.useCallback)((function(e) {
|
|
1027
|
+
// if command key on Mac was pressed ignore
|
|
1028
|
+
if (e.nativeEvent.metaKey) {
|
|
1029
|
+
return;
|
|
1030
|
+
}
|
|
1027
1031
|
var t = st(e);
|
|
1028
1032
|
var r = t === "tab" || t === "tabShift";
|
|
1029
1033
|
var n = t === "enter";
|
package/Multiselect.js
CHANGED
|
@@ -1176,7 +1176,7 @@
|
|
|
1176
1176
|
role: "combobox",
|
|
1177
1177
|
"aria-expanded": "true",
|
|
1178
1178
|
"aria-controls": c,
|
|
1179
|
-
"aria-owns": l ? n : undefined,
|
|
1179
|
+
"aria-owns": w && l ? n : undefined,
|
|
1180
1180
|
"aria-label": (0, s._)("Filter"),
|
|
1181
1181
|
"aria-autocomplete": "list",
|
|
1182
1182
|
"aria-activedescendant": w && l ? n : undefined,
|