@patternfly/react-core 4.237.6 → 4.237.7
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 +8 -0
- package/dist/esm/components/MenuToggle/MenuToggle.d.ts.map +1 -1
- package/dist/esm/components/MenuToggle/MenuToggle.js +1 -1
- package/dist/esm/components/MenuToggle/MenuToggle.js.map +1 -1
- package/dist/js/components/MenuToggle/MenuToggle.d.ts.map +1 -1
- package/dist/js/components/MenuToggle/MenuToggle.js +1 -1
- package/dist/js/components/MenuToggle/MenuToggle.js.map +1 -1
- package/dist/umd/react-core.min.css +2174 -2174
- package/dist/umd/react-core.min.js +1 -1
- package/package.json +5 -5
- package/src/components/Button/examples/Button.md +3 -15
- package/src/components/Button/examples/ButtonAriaDisabled.tsx +15 -2
- package/src/components/MenuToggle/MenuToggle.tsx +1 -0
- package/src/components/MenuToggle/__tests__/MenuToggle.test.tsx +27 -1
- package/src/components/Button/examples/ButtonAriaDisabledLinkTooltip.tsx +0 -10
- package/src/components/Button/examples/ButtonAriaDisabledTooltip.tsx +0 -10
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@patternfly/react-core",
|
|
3
|
-
"version": "4.237.
|
|
3
|
+
"version": "4.237.7",
|
|
4
4
|
"description": "This library provides a set of common React components for use with the PatternFly reference implementation.",
|
|
5
5
|
"main": "dist/js/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -44,9 +44,9 @@
|
|
|
44
44
|
"generate": "node scripts/copyStyles.js"
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@patternfly/react-icons": "^4.88.
|
|
48
|
-
"@patternfly/react-styles": "^4.87.
|
|
49
|
-
"@patternfly/react-tokens": "^4.89.
|
|
47
|
+
"@patternfly/react-icons": "^4.88.7",
|
|
48
|
+
"@patternfly/react-styles": "^4.87.7",
|
|
49
|
+
"@patternfly/react-tokens": "^4.89.7",
|
|
50
50
|
"focus-trap": "6.9.2",
|
|
51
51
|
"react-dropzone": "9.0.0",
|
|
52
52
|
"tippy.js": "5.1.2",
|
|
@@ -70,5 +70,5 @@
|
|
|
70
70
|
"react": "^16.8.0 || ^17.0.0",
|
|
71
71
|
"react-dom": "^16.8.0 || ^17.0.0"
|
|
72
72
|
},
|
|
73
|
-
"gitHead": "
|
|
73
|
+
"gitHead": "6a8c488ab5de48d31ab8070271ebf17f9e6a625a"
|
|
74
74
|
}
|
|
@@ -96,21 +96,9 @@ Router links can be used for in-app linking in React environments to prevent pag
|
|
|
96
96
|
|
|
97
97
|
Buttons that are aria-disabled are similar to normal disabled buttons, except they can receive focus. Every button variant can be aria-disabled using the `isAriaDisabled` property.
|
|
98
98
|
|
|
99
|
-
|
|
100
|
-
```
|
|
101
|
-
|
|
102
|
-
### Aria-disabled with tooltip
|
|
103
|
-
|
|
104
|
-
Unlike normal disabled buttons, aria-disabled buttons can support tooltips.
|
|
105
|
-
|
|
106
|
-
```ts file="./ButtonAriaDisabledTooltip.tsx"
|
|
107
|
-
```
|
|
108
|
-
|
|
109
|
-
### Aria-disabled link as button with tooltip
|
|
110
|
-
|
|
111
|
-
Aria-disabled buttons can operate as links, which also support tooltips.
|
|
99
|
+
Unlike normal disabled buttons, aria-disabled buttons can support tooltips. Furthermore, aria-disabled buttons can operate as links, which also support tooltips.
|
|
112
100
|
|
|
113
|
-
```ts file="./
|
|
101
|
+
```ts file="./ButtonAriaDisabled.tsx"
|
|
114
102
|
```
|
|
115
103
|
|
|
116
104
|
### Button with count
|
|
@@ -118,4 +106,4 @@ Aria-disabled buttons can operate as links, which also support tooltips.
|
|
|
118
106
|
Buttons can display a `count` in the form of a badge to indicate some value or number by passing in the `countOptions` prop as a `BadgeCountObject` object. The `BadgeCountObject` object will handle `count`, `isRead`, and `className` props for the badge count.
|
|
119
107
|
|
|
120
108
|
```ts file="./ButtonWithCount.tsx" isBeta
|
|
121
|
-
```
|
|
109
|
+
```
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { Button } from '@patternfly/react-core';
|
|
2
|
+
import { Button, Tooltip } from '@patternfly/react-core';
|
|
3
3
|
import TimesIcon from '@patternfly/react-icons/dist/esm/icons/times-icon';
|
|
4
4
|
import PlusCircleIcon from '@patternfly/react-icons/dist/esm/icons/plus-circle-icon';
|
|
5
5
|
|
|
6
6
|
export const ButtonAriaDisabled: React.FunctionComponent = () => (
|
|
7
7
|
<React.Fragment>
|
|
8
|
-
<Button isAriaDisabled>Primary aria disabled</Button>
|
|
8
|
+
<Button isAriaDisabled>Primary aria disabled</Button>
|
|
9
|
+
<Button isAriaDisabled>Secondary aria disabled</Button>{' '}
|
|
9
10
|
<Button variant="secondary" isDanger isAriaDisabled>
|
|
10
11
|
Danger secondary aria disabled
|
|
11
12
|
</Button>{' '}
|
|
@@ -35,5 +36,17 @@ export const ButtonAriaDisabled: React.FunctionComponent = () => (
|
|
|
35
36
|
<Button isAriaDisabled variant="control">
|
|
36
37
|
Control aria disabled
|
|
37
38
|
</Button>
|
|
39
|
+
<br />
|
|
40
|
+
<br />
|
|
41
|
+
<Tooltip content="Aria-disabled buttons are like disabled buttons, but focusable. Allows for tooltip support.">
|
|
42
|
+
<Button isAriaDisabled variant="secondary">
|
|
43
|
+
Secondary button to core docs
|
|
44
|
+
</Button>
|
|
45
|
+
</Tooltip>{' '}
|
|
46
|
+
<Tooltip content="Aria-disabled link as button with tooltip">
|
|
47
|
+
<Button component="a" isAriaDisabled href="https://pf4.patternfly.org/" target="_blank" variant="tertiary">
|
|
48
|
+
Tertiary link as button to core docs
|
|
49
|
+
</Button>
|
|
50
|
+
</Tooltip>
|
|
38
51
|
</React.Fragment>
|
|
39
52
|
);
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { render } from '@testing-library/react';
|
|
3
2
|
import { MenuToggle } from '../MenuToggle';
|
|
3
|
+
import { MenuToggleCheckbox } from '../MenuToggleCheckbox';
|
|
4
4
|
import { Badge } from '../../Badge';
|
|
5
5
|
import CogIcon from '@patternfly/react-icons/dist/esm/icons/cog-icon';
|
|
6
6
|
import EllipsisVIcon from '@patternfly/react-icons/dist/esm/icons/ellipsis-v-icon';
|
|
7
|
+
import userEvent from '@testing-library/user-event';
|
|
8
|
+
import { fireEvent, render, screen } from '@testing-library/react';
|
|
7
9
|
|
|
8
10
|
describe('menu toggle', () => {
|
|
9
11
|
test('renders successfully', () => {
|
|
@@ -54,4 +56,28 @@ describe('menu toggle', () => {
|
|
|
54
56
|
const { asFragment } = render(<MenuToggle badge={<Badge>badge</Badge>}>Toggle</MenuToggle>);
|
|
55
57
|
expect(asFragment()).toMatchSnapshot();
|
|
56
58
|
});
|
|
59
|
+
|
|
60
|
+
test('split toggle passes onClick', async () => {
|
|
61
|
+
const mockClick = jest.fn();
|
|
62
|
+
const user = userEvent.setup();
|
|
63
|
+
|
|
64
|
+
render(<MenuToggle
|
|
65
|
+
onClick={mockClick}
|
|
66
|
+
splitButtonOptions={{
|
|
67
|
+
items: [
|
|
68
|
+
<MenuToggleCheckbox
|
|
69
|
+
id="split-button-checkbox-with-text-disabled-example"
|
|
70
|
+
key="split-checkbox-with-text-disabled"
|
|
71
|
+
aria-label="Select all"
|
|
72
|
+
>
|
|
73
|
+
10 selected
|
|
74
|
+
</MenuToggleCheckbox>
|
|
75
|
+
]
|
|
76
|
+
}}
|
|
77
|
+
aria-label="Menu toggle with checkbox split button and text"
|
|
78
|
+
/>);
|
|
79
|
+
|
|
80
|
+
await user.click(screen.getByRole(`button`) as Element);
|
|
81
|
+
expect(mockClick).toHaveBeenCalled();
|
|
82
|
+
});
|
|
57
83
|
});
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Button, Tooltip } from '@patternfly/react-core';
|
|
3
|
-
|
|
4
|
-
export const ButtonAriaDisabledLinkTooltip: React.FunctionComponent = () => (
|
|
5
|
-
<Tooltip content="Aria-disabled link as button with tooltip">
|
|
6
|
-
<Button component="a" isAriaDisabled href="https://pf4.patternfly.org/" target="_blank" variant="tertiary">
|
|
7
|
-
Tertiary link as button to core docs
|
|
8
|
-
</Button>
|
|
9
|
-
</Tooltip>
|
|
10
|
-
);
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Button, Tooltip } from '@patternfly/react-core';
|
|
3
|
-
|
|
4
|
-
export const ButtonAriaDisabledTooltip: React.FunctionComponent = () => (
|
|
5
|
-
<Tooltip content="Aria-disabled buttons are like disabled buttons, but focusable. Allows for tooltip support.">
|
|
6
|
-
<Button isAriaDisabled variant="secondary">
|
|
7
|
-
Secondary button to core docs
|
|
8
|
-
</Button>
|
|
9
|
-
</Tooltip>
|
|
10
|
-
);
|