@patternfly/react-core 4.192.2 → 4.192.3
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/index.d.ts +4 -0
- package/package.json +5 -5
- package/src/components/BackToTop/examples/BackToTop.css +3 -3
- package/src/components/BackToTop/examples/BackToTop.md +1 -5
- package/src/components/BackToTop/examples/BackToTopBasic.tsx +4 -0
- package/src/components/Backdrop/examples/Backdrop.md +3 -12
- package/src/components/Backdrop/examples/BackdropBasic.tsx +4 -0
- package/src/components/Backdrop/examples/BackdropSpinner.tsx +10 -0
- package/src/components/BackgroundImage/examples/BackgroundImage.md +2 -21
- package/src/components/BackgroundImage/examples/BackgroundImageBasic.tsx +15 -0
- package/src/components/Badge/examples/Badge.md +3 -24
- package/src/components/Badge/examples/BadgeRead.tsx +19 -0
- package/src/components/Badge/examples/BadgeUnread.tsx +8 -0
- package/src/components/Banner/examples/Banner.md +1 -14
- package/src/components/Banner/examples/BannerBasic.tsx +16 -0
- package/src/components/Brand/examples/Brand.md +3 -5
- package/src/components/Brand/examples/BrandBasic.tsx +5 -0
- package/src/components/Breadcrumb/examples/Breadcrumb.md +4 -105
- package/src/components/Breadcrumb/examples/BreadcrumbBasic.tsx +13 -0
- package/src/components/Breadcrumb/examples/BreadcrumbDropdown.tsx +53 -0
- package/src/components/Breadcrumb/examples/BreadcrumbWithHeading.tsx +12 -0
- package/src/components/Breadcrumb/examples/BreadcrumbWithoutHomeLink.tsx +15 -0
- package/src/components/Button/examples/ButtonAriaDisabled.tsx +33 -37
- package/src/components/Button/examples/ButtonCallToAction.tsx +8 -6
- package/src/components/Button/examples/ButtonDisabled.tsx +33 -37
- package/src/components/Button/examples/ButtonInlineSpanLink.tsx +2 -2
- package/src/components/Button/examples/ButtonLinks.tsx +6 -6
- package/src/components/Button/examples/ButtonProgress.tsx +8 -5
- package/src/components/Button/examples/ButtonSmall.tsx +9 -7
- package/src/components/Button/examples/ButtonTypes.tsx +4 -6
- package/src/components/Button/examples/ButtonVariations.tsx +31 -36
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,14 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## 4.192.3 (2022-01-20)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @patternfly/react-core
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
6
14
|
## 4.192.2 (2022-01-20)
|
|
7
15
|
|
|
8
16
|
|
package/index.d.ts
ADDED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@patternfly/react-core",
|
|
3
|
-
"version": "4.192.
|
|
3
|
+
"version": "4.192.3",
|
|
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",
|
|
@@ -34,9 +34,9 @@
|
|
|
34
34
|
"generate": "node scripts/copyStyles.js"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@patternfly/react-icons": "^4.43.
|
|
38
|
-
"@patternfly/react-styles": "^4.42.
|
|
39
|
-
"@patternfly/react-tokens": "^4.44.
|
|
37
|
+
"@patternfly/react-icons": "^4.43.3",
|
|
38
|
+
"@patternfly/react-styles": "^4.42.3",
|
|
39
|
+
"@patternfly/react-tokens": "^4.44.3",
|
|
40
40
|
"focus-trap": "6.2.2",
|
|
41
41
|
"react-dropzone": "9.0.0",
|
|
42
42
|
"tippy.js": "5.1.2",
|
|
@@ -60,5 +60,5 @@
|
|
|
60
60
|
"react": "^16.8.0 || ^17.0.0",
|
|
61
61
|
"react-dom": "^16.8.0 || ^17.0.0"
|
|
62
62
|
},
|
|
63
|
-
"gitHead": "
|
|
63
|
+
"gitHead": "9d4921fd3bf0859b63f2a77f576da60e497b731e"
|
|
64
64
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
#ws-react-c-back-to-top-basic {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
}
|
|
2
|
+
height: 300px;
|
|
3
|
+
position: relative;
|
|
4
|
+
}
|
|
@@ -16,9 +16,5 @@ Back to top only shows after overflowing element has been scrolled 400px.
|
|
|
16
16
|
|
|
17
17
|
### Basic
|
|
18
18
|
|
|
19
|
-
```
|
|
20
|
-
import React from 'react';
|
|
21
|
-
import { BackToTop } from '@patternfly/react-core';
|
|
22
|
-
|
|
23
|
-
<BackToTop isAlwaysVisible/>
|
|
19
|
+
```ts file="./BackToTopBasic.tsx"
|
|
24
20
|
```
|
|
@@ -6,22 +6,13 @@ propComponents: ['Backdrop']
|
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
## Examples
|
|
9
|
+
|
|
9
10
|
### Basic
|
|
10
|
-
```js isFullscreen
|
|
11
|
-
import React from 'react';
|
|
12
|
-
import { Backdrop } from '@patternfly/react-core';
|
|
13
11
|
|
|
14
|
-
|
|
12
|
+
```ts isFullscreen file="./BackdropBasic.tsx"
|
|
15
13
|
```
|
|
16
14
|
|
|
17
15
|
### With spinner
|
|
18
|
-
```js isFullscreen
|
|
19
|
-
import React from 'react';
|
|
20
|
-
import { Backdrop, Spinner, Bullseye } from '@patternfly/react-core';
|
|
21
16
|
|
|
22
|
-
|
|
23
|
-
<Bullseye>
|
|
24
|
-
<Spinner />
|
|
25
|
-
</Bullseye>
|
|
26
|
-
</Backdrop>
|
|
17
|
+
```ts isFullscreen file="./BackdropSpinner.tsx"
|
|
27
18
|
```
|
|
@@ -6,27 +6,8 @@ propComponents: ['BackgroundImage']
|
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
## Examples
|
|
9
|
+
|
|
9
10
|
### Basic
|
|
10
|
-
```js isFullscreen
|
|
11
|
-
import React from 'react';
|
|
12
|
-
import { BackgroundImage } from '@patternfly/react-core';
|
|
13
11
|
|
|
14
|
-
|
|
15
|
-
constructor(props) {
|
|
16
|
-
super(props);
|
|
17
|
-
/**
|
|
18
|
-
* Note: When using background-filter.svg, you must also include #image_overlay as the fragment identifier
|
|
19
|
-
*/
|
|
20
|
-
this.images = {
|
|
21
|
-
'xs': '/assets/images/pfbg_576.jpg',
|
|
22
|
-
'xs2x': '/assets/images/pfbg_576@2x.jpg',
|
|
23
|
-
'sm': '/assets/images/pfbg_768.jpg',
|
|
24
|
-
'sm2x': '/assets/images/pfbg_768@2x.jpg',
|
|
25
|
-
'lg': '/assets/images/pfbg_1200.jpg'
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
render() {
|
|
29
|
-
return <BackgroundImage src={this.images} />;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
12
|
+
```ts isFullscreen file="./BackgroundImageBasic.tsx"
|
|
32
13
|
```
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { BackgroundImage } from '@patternfly/react-core';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Note: When using background-filter.svg, you must also include #image_overlay as the fragment identifier
|
|
6
|
+
*/
|
|
7
|
+
const images = {
|
|
8
|
+
xs: '/assets/images/pfbg_576.jpg',
|
|
9
|
+
xs2x: '/assets/images/pfbg_576@2x.jpg',
|
|
10
|
+
sm: '/assets/images/pfbg_768.jpg',
|
|
11
|
+
sm2x: '/assets/images/pfbg_768@2x.jpg',
|
|
12
|
+
lg: '/assets/images/pfbg_1200.jpg'
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export const BackgroundImageBasic: React.FunctionComponent = () => <BackgroundImage src={images} />;
|
|
@@ -6,34 +6,13 @@ propComponents: ['Badge']
|
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
## Examples
|
|
9
|
+
|
|
9
10
|
### Read
|
|
10
|
-
```js
|
|
11
|
-
import React from 'react';
|
|
12
|
-
import { Badge } from '@patternfly/react-core';
|
|
13
11
|
|
|
14
|
-
|
|
15
|
-
<Badge key={1} isRead>7</Badge>
|
|
16
|
-
{' '}
|
|
17
|
-
<Badge key={2} isRead>24</Badge>
|
|
18
|
-
{' '}
|
|
19
|
-
<Badge key={3} isRead>240</Badge>
|
|
20
|
-
{' '}
|
|
21
|
-
<Badge key={4} isRead>999+</Badge>
|
|
22
|
-
</React.Fragment>
|
|
12
|
+
```ts file="./BadgeRead.tsx"
|
|
23
13
|
```
|
|
24
14
|
|
|
25
15
|
### Unread
|
|
26
|
-
```js
|
|
27
|
-
import React from 'react';
|
|
28
|
-
import { Badge } from '@patternfly/react-core';
|
|
29
16
|
|
|
30
|
-
|
|
31
|
-
<Badge key={1}>7</Badge>
|
|
32
|
-
{' '}
|
|
33
|
-
<Badge key={2}>24</Badge>
|
|
34
|
-
{' '}
|
|
35
|
-
<Badge key={3}>240</Badge>
|
|
36
|
-
{' '}
|
|
37
|
-
<Badge key={4}>999+</Badge>
|
|
38
|
-
</React.Fragment>
|
|
17
|
+
```ts file="./BadgeUnread.tsx"
|
|
39
18
|
```
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Badge } from '@patternfly/react-core';
|
|
3
|
+
|
|
4
|
+
export const BadgeRead: React.FunctionComponent = () => (
|
|
5
|
+
<React.Fragment>
|
|
6
|
+
<Badge key={1} isRead>
|
|
7
|
+
7
|
|
8
|
+
</Badge>{' '}
|
|
9
|
+
<Badge key={2} isRead>
|
|
10
|
+
24
|
|
11
|
+
</Badge>{' '}
|
|
12
|
+
<Badge key={3} isRead>
|
|
13
|
+
240
|
|
14
|
+
</Badge>{' '}
|
|
15
|
+
<Badge key={4} isRead>
|
|
16
|
+
999+
|
|
17
|
+
</Badge>
|
|
18
|
+
</React.Fragment>
|
|
19
|
+
);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Badge } from '@patternfly/react-core';
|
|
3
|
+
|
|
4
|
+
export const BadgeUnread: React.FunctionComponent = () => (
|
|
5
|
+
<React.Fragment>
|
|
6
|
+
<Badge key={1}>7</Badge> <Badge key={2}>24</Badge> <Badge key={3}>240</Badge> <Badge key={4}>999+</Badge>
|
|
7
|
+
</React.Fragment>
|
|
8
|
+
);
|
|
@@ -8,19 +8,6 @@ propComponents: ['Banner']
|
|
|
8
8
|
## Examples
|
|
9
9
|
|
|
10
10
|
### Basic
|
|
11
|
-
```js
|
|
12
|
-
import React from 'react';
|
|
13
|
-
import { Banner } from '@patternfly/react-core';
|
|
14
11
|
|
|
15
|
-
|
|
16
|
-
<Banner>Default banner</Banner>
|
|
17
|
-
<br />
|
|
18
|
-
<Banner variant="info">Info banner</Banner>
|
|
19
|
-
<br />
|
|
20
|
-
<Banner variant="danger">Danger banner</Banner>
|
|
21
|
-
<br />
|
|
22
|
-
<Banner variant="success">Success banner</Banner>
|
|
23
|
-
<br />
|
|
24
|
-
<Banner variant="warning">Warning banner</Banner>
|
|
25
|
-
</React.Fragment>
|
|
12
|
+
```ts file="./BannerBasic.tsx"
|
|
26
13
|
```
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Banner } from '@patternfly/react-core';
|
|
3
|
+
|
|
4
|
+
export const BannerBasic: React.FunctionComponent = () => (
|
|
5
|
+
<React.Fragment>
|
|
6
|
+
<Banner>Default banner</Banner>
|
|
7
|
+
<br />
|
|
8
|
+
<Banner variant="info">Info banner</Banner>
|
|
9
|
+
<br />
|
|
10
|
+
<Banner variant="danger">Danger banner</Banner>
|
|
11
|
+
<br />
|
|
12
|
+
<Banner variant="success">Success banner</Banner>
|
|
13
|
+
<br />
|
|
14
|
+
<Banner variant="warning">Warning banner</Banner>
|
|
15
|
+
</React.Fragment>
|
|
16
|
+
);
|
|
@@ -4,14 +4,12 @@ section: components
|
|
|
4
4
|
cssPrefix: null
|
|
5
5
|
propComponents: ['Brand']
|
|
6
6
|
---
|
|
7
|
+
|
|
7
8
|
import pfLogo from './pfLogo.svg';
|
|
8
9
|
|
|
9
10
|
## Examples
|
|
11
|
+
|
|
10
12
|
### Basic
|
|
11
|
-
```js
|
|
12
|
-
import React from 'react';
|
|
13
|
-
import { Brand } from '@patternfly/react-core';
|
|
14
|
-
import pfLogo from './examples/pfLogo.svg';
|
|
15
13
|
|
|
16
|
-
|
|
14
|
+
```ts file="./BrandBasic.tsx"
|
|
17
15
|
```
|
|
@@ -12,121 +12,20 @@ import AngleLeftIcon from '@patternfly/react-icons/dist/esm/icons/angle-left-ico
|
|
|
12
12
|
|
|
13
13
|
### Basic
|
|
14
14
|
|
|
15
|
-
```
|
|
16
|
-
import React from 'react';
|
|
17
|
-
import { Breadcrumb, BreadcrumbItem, BreadcrumbHeading } from '@patternfly/react-core';
|
|
18
|
-
|
|
19
|
-
<Breadcrumb>
|
|
20
|
-
<BreadcrumbItem to="#">Section home</BreadcrumbItem>
|
|
21
|
-
<BreadcrumbItem to="#">Section title</BreadcrumbItem>
|
|
22
|
-
<BreadcrumbItem to="#">Section title</BreadcrumbItem>
|
|
23
|
-
<BreadcrumbItem to="#" isActive>
|
|
24
|
-
Section landing
|
|
25
|
-
</BreadcrumbItem>
|
|
26
|
-
</Breadcrumb>;
|
|
15
|
+
```ts file="./BreadcrumbBasic.tsx"
|
|
27
16
|
```
|
|
28
17
|
|
|
29
18
|
### Without home link
|
|
30
19
|
|
|
31
|
-
```
|
|
32
|
-
import React from 'react';
|
|
33
|
-
import { Breadcrumb, BreadcrumbItem, BreadcrumbHeading } from '@patternfly/react-core';
|
|
34
|
-
|
|
35
|
-
<Breadcrumb>
|
|
36
|
-
<BreadcrumbItem>Section Home</BreadcrumbItem>
|
|
37
|
-
<BreadcrumbItem to="#">Section title</BreadcrumbItem>
|
|
38
|
-
<BreadcrumbItem to="#">Section title</BreadcrumbItem>
|
|
39
|
-
<BreadcrumbItem to="#">Section title</BreadcrumbItem>
|
|
40
|
-
<BreadcrumbItem to="#">Section title</BreadcrumbItem>
|
|
41
|
-
<BreadcrumbItem to="#" isActive>
|
|
42
|
-
Section landing
|
|
43
|
-
</BreadcrumbItem>
|
|
44
|
-
</Breadcrumb>;
|
|
20
|
+
```ts file="./BreadcrumbWithoutHomeLink.tsx"
|
|
45
21
|
```
|
|
46
22
|
|
|
47
23
|
### With heading
|
|
48
24
|
|
|
49
|
-
```
|
|
50
|
-
import React from 'react';
|
|
51
|
-
import { Breadcrumb, BreadcrumbItem, BreadcrumbHeading } from '@patternfly/react-core';
|
|
52
|
-
|
|
53
|
-
<Breadcrumb>
|
|
54
|
-
<BreadcrumbItem to="#">Section home</BreadcrumbItem>
|
|
55
|
-
<BreadcrumbItem to="#">Section title</BreadcrumbItem>
|
|
56
|
-
<BreadcrumbItem to="#">Section title</BreadcrumbItem>
|
|
57
|
-
<BreadcrumbItem to="#">Section title</BreadcrumbItem>
|
|
58
|
-
<BreadcrumbHeading to="#">Section title</BreadcrumbHeading>
|
|
59
|
-
</Breadcrumb>;
|
|
25
|
+
```ts file="./BreadcrumbWithHeading.tsx"
|
|
60
26
|
```
|
|
61
27
|
|
|
62
28
|
### With dropdown
|
|
63
29
|
|
|
64
|
-
```
|
|
65
|
-
import React from 'react';
|
|
66
|
-
import {
|
|
67
|
-
Breadcrumb,
|
|
68
|
-
BreadcrumbItem,
|
|
69
|
-
BreadcrumbHeading,
|
|
70
|
-
Dropdown,
|
|
71
|
-
DropdownItem,
|
|
72
|
-
BadgeToggle
|
|
73
|
-
} from '@patternfly/react-core';
|
|
74
|
-
import AngleLeftIcon from '@patternfly/react-icons/dist/esm/icons/angle-left-icon';
|
|
75
|
-
|
|
76
|
-
class BreadcrumbDropdown extends React.Component {
|
|
77
|
-
constructor(props) {
|
|
78
|
-
super(props);
|
|
79
|
-
this.state = {
|
|
80
|
-
isOpen: false
|
|
81
|
-
};
|
|
82
|
-
this.onToggle = isOpen => {
|
|
83
|
-
this.setState({
|
|
84
|
-
isOpen
|
|
85
|
-
});
|
|
86
|
-
};
|
|
87
|
-
this.onSelect = event => {
|
|
88
|
-
this.setState({
|
|
89
|
-
isOpen: !this.state.isOpen
|
|
90
|
-
});
|
|
91
|
-
this.onFocus();
|
|
92
|
-
};
|
|
93
|
-
this.onFocus = () => {
|
|
94
|
-
const element = document.getElementById('toggle-id');
|
|
95
|
-
element.focus();
|
|
96
|
-
};
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
render() {
|
|
100
|
-
const { isOpen } = this.state;
|
|
101
|
-
const dropdownItems = [
|
|
102
|
-
<DropdownItem key="edit" component="button" icon={<AngleLeftIcon />}>
|
|
103
|
-
Edit
|
|
104
|
-
</DropdownItem>,
|
|
105
|
-
<DropdownItem key="action" component="button" icon={<AngleLeftIcon />}>
|
|
106
|
-
Deployment
|
|
107
|
-
</DropdownItem>,
|
|
108
|
-
<DropdownItem key="apps" component="button" icon={<AngleLeftIcon />}>
|
|
109
|
-
Applications
|
|
110
|
-
</DropdownItem>
|
|
111
|
-
];
|
|
112
|
-
return (
|
|
113
|
-
<Breadcrumb>
|
|
114
|
-
<BreadcrumbItem comopnent="button">Section home</BreadcrumbItem>
|
|
115
|
-
<BreadcrumbItem isDropdown>
|
|
116
|
-
<Dropdown
|
|
117
|
-
onSelect={this.onSelect}
|
|
118
|
-
toggle={
|
|
119
|
-
<BadgeToggle id="toggle-id" onToggle={this.onToggle}>
|
|
120
|
-
{dropdownItems.length}
|
|
121
|
-
</BadgeToggle>
|
|
122
|
-
}
|
|
123
|
-
isOpen={isOpen}
|
|
124
|
-
dropdownItems={dropdownItems}
|
|
125
|
-
/>
|
|
126
|
-
</BreadcrumbItem>
|
|
127
|
-
<BreadcrumbHeading component="button">Section title</BreadcrumbHeading>
|
|
128
|
-
</Breadcrumb>
|
|
129
|
-
);
|
|
130
|
-
}
|
|
131
|
-
}
|
|
30
|
+
```ts file="./BreadcrumbDropdown.tsx"
|
|
132
31
|
```
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Breadcrumb, BreadcrumbItem } from '@patternfly/react-core';
|
|
3
|
+
|
|
4
|
+
export const BreadcrumbBasic: React.FunctionComponent = () => (
|
|
5
|
+
<Breadcrumb>
|
|
6
|
+
<BreadcrumbItem to="#">Section home</BreadcrumbItem>
|
|
7
|
+
<BreadcrumbItem to="#">Section title</BreadcrumbItem>
|
|
8
|
+
<BreadcrumbItem to="#">Section title</BreadcrumbItem>
|
|
9
|
+
<BreadcrumbItem to="#" isActive>
|
|
10
|
+
Section landing
|
|
11
|
+
</BreadcrumbItem>
|
|
12
|
+
</Breadcrumb>
|
|
13
|
+
);
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {
|
|
3
|
+
Breadcrumb,
|
|
4
|
+
BreadcrumbItem,
|
|
5
|
+
BreadcrumbHeading,
|
|
6
|
+
Dropdown,
|
|
7
|
+
BadgeToggle,
|
|
8
|
+
DropdownItem
|
|
9
|
+
} from '@patternfly/react-core';
|
|
10
|
+
import AngleLeftIcon from '@patternfly/react-icons/dist/esm/icons/angle-left-icon';
|
|
11
|
+
|
|
12
|
+
const dropdownItems: JSX.Element[] = [
|
|
13
|
+
<DropdownItem key="edit" component="button" icon={<AngleLeftIcon />}>
|
|
14
|
+
Edit
|
|
15
|
+
</DropdownItem>,
|
|
16
|
+
<DropdownItem key="action" component="button" icon={<AngleLeftIcon />}>
|
|
17
|
+
Deployment
|
|
18
|
+
</DropdownItem>,
|
|
19
|
+
<DropdownItem key="apps" component="button" icon={<AngleLeftIcon />}>
|
|
20
|
+
Applications
|
|
21
|
+
</DropdownItem>
|
|
22
|
+
];
|
|
23
|
+
|
|
24
|
+
export const BreadcrumbDropdown: React.FunctionComponent = () => {
|
|
25
|
+
const [isOpen, setIsOpen] = React.useState(false);
|
|
26
|
+
const badgeToggleRef = React.useRef<HTMLButtonElement>();
|
|
27
|
+
|
|
28
|
+
const onToggle = (isOpen: boolean) => setIsOpen(isOpen);
|
|
29
|
+
|
|
30
|
+
const onSelect = () => {
|
|
31
|
+
setIsOpen((prevIsOpen: boolean) => !prevIsOpen);
|
|
32
|
+
badgeToggleRef.current.focus();
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
return (
|
|
36
|
+
<Breadcrumb>
|
|
37
|
+
<BreadcrumbItem component="button">Section home</BreadcrumbItem>
|
|
38
|
+
<BreadcrumbItem isDropdown>
|
|
39
|
+
<Dropdown
|
|
40
|
+
onSelect={onSelect}
|
|
41
|
+
toggle={
|
|
42
|
+
<BadgeToggle ref={badgeToggleRef} onToggle={onToggle}>
|
|
43
|
+
{dropdownItems.length}
|
|
44
|
+
</BadgeToggle>
|
|
45
|
+
}
|
|
46
|
+
isOpen={isOpen}
|
|
47
|
+
dropdownItems={dropdownItems}
|
|
48
|
+
/>
|
|
49
|
+
</BreadcrumbItem>
|
|
50
|
+
<BreadcrumbHeading component="button">Section title</BreadcrumbHeading>
|
|
51
|
+
</Breadcrumb>
|
|
52
|
+
);
|
|
53
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Breadcrumb, BreadcrumbItem, BreadcrumbHeading } from '@patternfly/react-core';
|
|
3
|
+
|
|
4
|
+
export const BreadcrumbWithHeading: React.FunctionComponent = () => (
|
|
5
|
+
<Breadcrumb>
|
|
6
|
+
<BreadcrumbItem to="#">Section home</BreadcrumbItem>
|
|
7
|
+
<BreadcrumbItem to="#">Section title</BreadcrumbItem>
|
|
8
|
+
<BreadcrumbItem to="#">Section title</BreadcrumbItem>
|
|
9
|
+
<BreadcrumbItem to="#">Section title</BreadcrumbItem>
|
|
10
|
+
<BreadcrumbHeading to="#">Section title</BreadcrumbHeading>
|
|
11
|
+
</Breadcrumb>
|
|
12
|
+
);
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Breadcrumb, BreadcrumbItem } from '@patternfly/react-core';
|
|
3
|
+
|
|
4
|
+
export const BreadcrumbHomeLink: React.FunctionComponent = () => (
|
|
5
|
+
<Breadcrumb>
|
|
6
|
+
<BreadcrumbItem>Section Home</BreadcrumbItem>
|
|
7
|
+
<BreadcrumbItem to="#">Section title</BreadcrumbItem>
|
|
8
|
+
<BreadcrumbItem to="#">Section title</BreadcrumbItem>
|
|
9
|
+
<BreadcrumbItem to="#">Section title</BreadcrumbItem>
|
|
10
|
+
<BreadcrumbItem to="#">Section title</BreadcrumbItem>
|
|
11
|
+
<BreadcrumbItem to="#" isActive>
|
|
12
|
+
Section landing
|
|
13
|
+
</BreadcrumbItem>
|
|
14
|
+
</Breadcrumb>
|
|
15
|
+
);
|
|
@@ -1,43 +1,39 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { Button
|
|
2
|
+
import { Button } 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
|
-
<
|
|
8
|
-
<
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
Control aria disabled
|
|
40
|
-
</Button>
|
|
41
|
-
</Flex>
|
|
42
|
-
</Flex>
|
|
7
|
+
<React.Fragment>
|
|
8
|
+
<Button isAriaDisabled>Primary aria disabled</Button> <Button isAriaDisabled>Secondary aria disabled</Button>{' '}
|
|
9
|
+
<Button variant="secondary" isDanger isAriaDisabled>
|
|
10
|
+
Danger secondary aria disabled
|
|
11
|
+
</Button>{' '}
|
|
12
|
+
<Button isAriaDisabled variant="tertiary">
|
|
13
|
+
Tertiary aria disabled
|
|
14
|
+
</Button>{' '}
|
|
15
|
+
<Button isAriaDisabled variant="danger">
|
|
16
|
+
Danger disabled
|
|
17
|
+
</Button>{' '}
|
|
18
|
+
<Button isAriaDisabled variant="warning">
|
|
19
|
+
Warning disabled
|
|
20
|
+
</Button>
|
|
21
|
+
<br />
|
|
22
|
+
<br />
|
|
23
|
+
<Button isAriaDisabled variant="link" icon={<PlusCircleIcon />}>
|
|
24
|
+
Link aria disabled
|
|
25
|
+
</Button>{' '}
|
|
26
|
+
<Button isAriaDisabled variant="link" isInline>
|
|
27
|
+
Inline link aria disabled
|
|
28
|
+
</Button>{' '}
|
|
29
|
+
<Button variant="link" isDanger isAriaDisabled>
|
|
30
|
+
Danger link disabled
|
|
31
|
+
</Button>{' '}
|
|
32
|
+
<Button isAriaDisabled variant="plain" aria-label="Action">
|
|
33
|
+
<TimesIcon />
|
|
34
|
+
</Button>{' '}
|
|
35
|
+
<Button isAriaDisabled variant="control">
|
|
36
|
+
Control aria disabled
|
|
37
|
+
</Button>
|
|
38
|
+
</React.Fragment>
|
|
43
39
|
);
|
|
@@ -1,20 +1,22 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { Button
|
|
2
|
+
import { Button } from '@patternfly/react-core';
|
|
3
3
|
import ArrowRightIcon from '@patternfly/react-icons/dist/esm/icons/arrow-right-icon';
|
|
4
4
|
|
|
5
5
|
export const ButtonCallToAction: React.FunctionComponent = () => (
|
|
6
|
-
<
|
|
6
|
+
<React.Fragment>
|
|
7
7
|
<Button variant="primary" isLarge>
|
|
8
8
|
Call to action
|
|
9
|
-
</Button>
|
|
9
|
+
</Button>{' '}
|
|
10
10
|
<Button variant="secondary" isLarge>
|
|
11
11
|
Call to action
|
|
12
|
-
</Button>
|
|
12
|
+
</Button>{' '}
|
|
13
13
|
<Button variant="tertiary" isLarge>
|
|
14
14
|
Call to action
|
|
15
|
-
</Button>
|
|
15
|
+
</Button>{' '}
|
|
16
16
|
<Button variant="link" isLarge>
|
|
17
17
|
Call to action <ArrowRightIcon />
|
|
18
18
|
</Button>
|
|
19
|
-
|
|
19
|
+
<br />
|
|
20
|
+
<br />
|
|
21
|
+
</React.Fragment>
|
|
20
22
|
);
|
|
@@ -1,43 +1,39 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { Button
|
|
2
|
+
import { Button } 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 ButtonDisabled: React.FunctionComponent = () => (
|
|
7
|
-
<
|
|
8
|
-
<
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
Control disabled
|
|
40
|
-
</Button>
|
|
41
|
-
</Flex>
|
|
42
|
-
</Flex>
|
|
7
|
+
<React.Fragment>
|
|
8
|
+
<Button isDisabled>Primary disabled</Button> <Button isDisabled>Secondary disabled</Button>{' '}
|
|
9
|
+
<Button variant="secondary" isDanger isDisabled>
|
|
10
|
+
Danger secondary disabled
|
|
11
|
+
</Button>{' '}
|
|
12
|
+
<Button isDisabled variant="tertiary">
|
|
13
|
+
Tertiary disabled
|
|
14
|
+
</Button>{' '}
|
|
15
|
+
<Button isDisabled variant="danger">
|
|
16
|
+
Danger disabled
|
|
17
|
+
</Button>{' '}
|
|
18
|
+
<Button isDisabled variant="warning">
|
|
19
|
+
Warning disabled
|
|
20
|
+
</Button>
|
|
21
|
+
<br />
|
|
22
|
+
<br />
|
|
23
|
+
<Button isDisabled variant="link" icon={<PlusCircleIcon />}>
|
|
24
|
+
Link disabled
|
|
25
|
+
</Button>{' '}
|
|
26
|
+
<Button isDisabled variant="link" isInline>
|
|
27
|
+
Inline link disabled
|
|
28
|
+
</Button>{' '}
|
|
29
|
+
<Button variant="link" isDanger isDisabled>
|
|
30
|
+
Danger link disabled
|
|
31
|
+
</Button>{' '}
|
|
32
|
+
<Button isDisabled variant="plain" aria-label="Action">
|
|
33
|
+
<TimesIcon />
|
|
34
|
+
</Button>{' '}
|
|
35
|
+
<Button isDisabled variant="control">
|
|
36
|
+
Control disabled
|
|
37
|
+
</Button>
|
|
38
|
+
</React.Fragment>
|
|
43
39
|
);
|
|
@@ -13,7 +13,7 @@ const handleKeydown = (event: React.KeyboardEvent<HTMLButtonElement>) => {
|
|
|
13
13
|
};
|
|
14
14
|
|
|
15
15
|
export const ButtonInlineSpanLink: React.FunctionComponent = () => (
|
|
16
|
-
|
|
16
|
+
<React.Fragment>
|
|
17
17
|
<p>
|
|
18
18
|
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
|
|
19
19
|
<Button variant="link" isInline component="span">
|
|
@@ -32,5 +32,5 @@ export const ButtonInlineSpanLink: React.FunctionComponent = () => (
|
|
|
32
32
|
</Button>
|
|
33
33
|
Pressing the Enter or Space keys on the inline link as span above demonstrates this by triggering an alert.
|
|
34
34
|
</p>
|
|
35
|
-
|
|
35
|
+
</React.Fragment>
|
|
36
36
|
);
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { Button
|
|
2
|
+
import { Button } from '@patternfly/react-core';
|
|
3
3
|
|
|
4
4
|
export const ButtonLinks: React.FunctionComponent = () => (
|
|
5
|
-
<
|
|
5
|
+
<React.Fragment>
|
|
6
6
|
<Button component="a" href="https://pf4.patternfly.org/" target="_blank" variant="primary">
|
|
7
7
|
Link to core docs
|
|
8
|
-
</Button>
|
|
8
|
+
</Button>{' '}
|
|
9
9
|
<Button component="a" href="https://pf4.patternfly.org/" target="_blank" variant="secondary">
|
|
10
10
|
Secondary link to core docs
|
|
11
|
-
</Button>
|
|
11
|
+
</Button>{' '}
|
|
12
12
|
<Button isDisabled component="a" href="https://pf4.patternfly.org/" target="_blank" variant="tertiary">
|
|
13
13
|
Tertiary link to core docs
|
|
14
|
-
</Button>
|
|
14
|
+
</Button>{' '}
|
|
15
15
|
<Button component="a" href="https://pf4.patternfly.org/contribution/#modifiers" variant="link">
|
|
16
16
|
Jump to modifiers in contribution guidelines
|
|
17
17
|
</Button>
|
|
18
|
-
</
|
|
18
|
+
</React.Fragment>
|
|
19
19
|
);
|
|
@@ -1,22 +1,23 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { Button
|
|
2
|
+
import { Button } from '@patternfly/react-core';
|
|
3
3
|
|
|
4
4
|
export const ButtonProgress: React.FunctionComponent = () => {
|
|
5
5
|
const [isPrimaryLoading, setIsPrimaryLoading] = React.useState<boolean>(true);
|
|
6
6
|
const [isSecondaryLoading, setIsSecondaryLoading] = React.useState<boolean>(true);
|
|
7
7
|
|
|
8
8
|
return (
|
|
9
|
-
<
|
|
9
|
+
<React.Fragment>
|
|
10
10
|
<Button
|
|
11
|
+
spinnerAriaValueText={isPrimaryLoading ? 'Loading' : undefined}
|
|
11
12
|
isLoading={isPrimaryLoading}
|
|
12
13
|
variant="primary"
|
|
13
14
|
onClick={() => setIsPrimaryLoading(!isPrimaryLoading)}
|
|
14
15
|
{...(isPrimaryLoading && { spinnerAriaValueText: 'Loading' })}
|
|
15
16
|
>
|
|
16
17
|
{isPrimaryLoading ? 'Click to stop loading' : 'Click to start loading'}
|
|
17
|
-
</Button>
|
|
18
|
-
|
|
18
|
+
</Button>{' '}
|
|
19
19
|
<Button
|
|
20
|
+
spinnerAriaValueText={isSecondaryLoading ? 'Loading' : undefined}
|
|
20
21
|
isLoading={isSecondaryLoading}
|
|
21
22
|
variant="secondary"
|
|
22
23
|
onClick={() => setIsSecondaryLoading(!isSecondaryLoading)}
|
|
@@ -24,6 +25,8 @@ export const ButtonProgress: React.FunctionComponent = () => {
|
|
|
24
25
|
>
|
|
25
26
|
{isSecondaryLoading ? 'Click to stop loading' : 'Click to start loading'}
|
|
26
27
|
</Button>
|
|
27
|
-
|
|
28
|
+
<br />
|
|
29
|
+
<br />
|
|
30
|
+
</React.Fragment>
|
|
28
31
|
);
|
|
29
32
|
};
|
|
@@ -1,22 +1,24 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { Button
|
|
2
|
+
import { Button } from '@patternfly/react-core';
|
|
3
3
|
|
|
4
4
|
export const ButtonSmall: React.FunctionComponent = () => (
|
|
5
|
-
<
|
|
5
|
+
<React.Fragment>
|
|
6
6
|
<Button variant="primary" isSmall>
|
|
7
7
|
Primary
|
|
8
|
-
</Button>
|
|
8
|
+
</Button>{' '}
|
|
9
9
|
<Button variant="secondary" isSmall>
|
|
10
10
|
Secondary
|
|
11
|
-
</Button>
|
|
11
|
+
</Button>{' '}
|
|
12
12
|
<Button variant="tertiary" isSmall>
|
|
13
13
|
Tertiary
|
|
14
|
-
</Button>
|
|
14
|
+
</Button>{' '}
|
|
15
15
|
<Button variant="danger" isSmall>
|
|
16
16
|
Danger
|
|
17
|
-
</Button>
|
|
17
|
+
</Button>{' '}
|
|
18
18
|
<Button variant="warning" isSmall>
|
|
19
19
|
Warning
|
|
20
20
|
</Button>
|
|
21
|
-
|
|
21
|
+
<br />
|
|
22
|
+
<br />
|
|
23
|
+
</React.Fragment>
|
|
22
24
|
);
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { Button
|
|
2
|
+
import { Button } from '@patternfly/react-core';
|
|
3
3
|
|
|
4
4
|
export const ButtonTypes: React.FunctionComponent = () => (
|
|
5
|
-
<
|
|
6
|
-
<Button type="submit">Submit</Button>
|
|
7
|
-
|
|
8
|
-
<Button>Default</Button>
|
|
9
|
-
</Flex>
|
|
5
|
+
<React.Fragment>
|
|
6
|
+
<Button type="submit">Submit</Button> <Button type="reset">Reset</Button> <Button>Default</Button>
|
|
7
|
+
</React.Fragment>
|
|
10
8
|
);
|
|
@@ -1,47 +1,42 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { Button
|
|
2
|
+
import { Button } 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
|
import ExternalLinkSquareAltIcon from '@patternfly/react-icons/dist/esm/icons/external-link-square-alt-icon';
|
|
6
6
|
import CopyIcon from '@patternfly/react-icons/dist/esm/icons/copy-icon';
|
|
7
7
|
|
|
8
8
|
export const ButtonVariations: React.FunctionComponent = () => (
|
|
9
|
-
<
|
|
10
|
-
<
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
<
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
Danger link
|
|
33
|
-
</Button>
|
|
34
|
-
</Flex>
|
|
35
|
-
|
|
9
|
+
<React.Fragment>
|
|
10
|
+
<Button variant="primary">Primary</Button> <Button variant="secondary">Secondary</Button>{' '}
|
|
11
|
+
<Button variant="secondary" isDanger>
|
|
12
|
+
Danger Secondary
|
|
13
|
+
</Button>{' '}
|
|
14
|
+
<Button variant="tertiary">Tertiary</Button> <Button variant="danger">Danger</Button>{' '}
|
|
15
|
+
<Button variant="warning">Warning</Button>
|
|
16
|
+
<br />
|
|
17
|
+
<br />
|
|
18
|
+
<Button variant="link" icon={<PlusCircleIcon />}>
|
|
19
|
+
Link
|
|
20
|
+
</Button>{' '}
|
|
21
|
+
<Button variant="link" icon={<ExternalLinkSquareAltIcon />} iconPosition="right">
|
|
22
|
+
Link
|
|
23
|
+
</Button>{' '}
|
|
24
|
+
<Button variant="link" isInline>
|
|
25
|
+
Inline link
|
|
26
|
+
</Button>{' '}
|
|
27
|
+
<Button variant="link" isDanger>
|
|
28
|
+
Danger link
|
|
29
|
+
</Button>
|
|
30
|
+
<br />
|
|
31
|
+
<br />
|
|
36
32
|
<Button variant="plain" aria-label="Action">
|
|
37
33
|
<TimesIcon />
|
|
38
34
|
</Button>
|
|
39
|
-
|
|
40
|
-
<
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
</Flex>
|
|
35
|
+
<br />
|
|
36
|
+
<br />
|
|
37
|
+
<Button variant="control">Control</Button>{' '}
|
|
38
|
+
<Button variant="control" aria-label="Copy">
|
|
39
|
+
<CopyIcon />
|
|
40
|
+
</Button>
|
|
41
|
+
</React.Fragment>
|
|
47
42
|
);
|