@splunk/react-ui 5.0.0-beta.5 → 5.0.0-rc.1
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/ButtonSimple.js +92 -168
- package/CHANGELOG.v5.mdx +24 -0
- package/Card.js +139 -139
- package/CollapsiblePanel.js +172 -164
- package/Color.js +584 -506
- package/ControlGroup.js +132 -127
- package/Date.js +90 -101
- package/Dropdown.js +97 -99
- package/FormRows.js +158 -157
- package/JSONTree.js +354 -360
- package/MIGRATION.v5.mdx +52 -1
- package/Menu.js +194 -195
- package/ModalLayer.js +171 -217
- package/Number.js +103 -102
- package/Popover.js +2 -1
- package/RadioBar.js +144 -146
- package/ResultsMenu.js +112 -114
- package/Search.js +49 -49
- package/Slider.js +45 -46
- package/Switch.js +251 -178
- package/TabBar.js +277 -280
- package/Table.js +1128 -1144
- package/Text.js +45 -46
- package/Tree.js +177 -188
- package/package.json +5 -5
- package/types/src/Color/Color.d.ts +2 -2
- package/types/src/Layer/Layer.d.ts +2 -1
- package/types/src/Layer/index.d.ts +1 -0
- package/types/src/ModalLayer/ModalLayer.d.ts +16 -21
- package/types/src/Popover/Popover.d.ts +4 -2
- package/useRovingFocus.js +20 -23
package/MIGRATION.v5.mdx
CHANGED
|
@@ -483,4 +483,55 @@ we have deprecated the `anchor` prop.
|
|
|
483
483
|
Replace all usage of the `anchor` prop with passing in the `Anchor` component to the `title` prop:
|
|
484
484
|
```jsx
|
|
485
485
|
<Card.Header title={<Anchor name="Title">Title</Anchor>} />
|
|
486
|
-
```
|
|
486
|
+
```
|
|
487
|
+
|
|
488
|
+
## Deprecated `Popover`'s `"inverted"` value of the `appearance` prop
|
|
489
|
+
|
|
490
|
+
### Change
|
|
491
|
+
|
|
492
|
+
`Popover`'s `"inverted"` value of the `appearance` prop has been deprecated and will be removed in the next major version.
|
|
493
|
+
|
|
494
|
+
### Context
|
|
495
|
+
|
|
496
|
+
The inverted appearance was deprecated to ensure the Popover background aligns with the color scheme, i.e. Popover should be light in light mode and dark in dark mode.
|
|
497
|
+
|
|
498
|
+
### Migration steps
|
|
499
|
+
Replace all usage of Popover's `appearance="inverted"` with `appearance="normal"` (default).
|
|
500
|
+
If teams need to keep inverted Popovers they can use `backgroundColorFloating` and `contentColorInverted`. Otherwise Popover uses `backgroundColorPopup`.
|
|
501
|
+
```jsx
|
|
502
|
+
const StyledContent = styled.div`
|
|
503
|
+
background-color: ${variables.backgroundColorFloating};
|
|
504
|
+
color: ${variables.contentColorInverted};
|
|
505
|
+
`;
|
|
506
|
+
|
|
507
|
+
return (
|
|
508
|
+
<Popover>
|
|
509
|
+
<StyledContent>Popover content</StyledContent>
|
|
510
|
+
</Popover>
|
|
511
|
+
)
|
|
512
|
+
```
|
|
513
|
+
|
|
514
|
+
## `Button`'s `label` prop no longer sets `label` attribute
|
|
515
|
+
|
|
516
|
+
### Change
|
|
517
|
+
`Button`'s `label` prop no longer sets HTML attribute `label` on the underlying button element.
|
|
518
|
+
|
|
519
|
+
### Context
|
|
520
|
+
In previous versions, the `label` prop, which sets the text on the Button, was also passed as a `label` HTML attribute which is invalid HTML for a `<button>`. This has been removed.
|
|
521
|
+
|
|
522
|
+
### Migration steps
|
|
523
|
+
Replace usages of `label` selector in tests with a different suitable query e.g. replace `querySelector('[label="Save"]')` with `getByText('Save')`.
|
|
524
|
+
|
|
525
|
+
## `Color`'s test hook `[data-test="color"]` moved to root and `[data-test="toggle-swatch"]` added to toggle swatch
|
|
526
|
+
|
|
527
|
+
### Change
|
|
528
|
+
|
|
529
|
+
`Color`'s test hook `[data-test="color"]` has been moved to the root `div` element and a new test hook `[data-test="toggle-swatch"]` has been added to the toggle swatch.
|
|
530
|
+
|
|
531
|
+
### Context
|
|
532
|
+
|
|
533
|
+
`Color`'s test hook `[data-test="color"]` was incorrectly documented as the root of the component but was actually set on the toggle swatch.
|
|
534
|
+
|
|
535
|
+
### Migration steps
|
|
536
|
+
If the test hook needs to be on the root element of `Color`, use `[data-test="color"]`.
|
|
537
|
+
If the test hook was being used to interact with the toggle swatch, replace usage of `[data-test="color"]` with `[data-test="toggle-swatch"]`.
|