@patternfly/react-core 4.191.6 → 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.
Files changed (107) hide show
  1. package/CHANGELOG.md +38 -0
  2. package/dist/esm/components/DataList/DataListCheck.d.ts +1 -1
  3. package/dist/esm/components/DataList/DataListCheck.d.ts.map +1 -1
  4. package/dist/esm/components/Modal/ModalBoxCloseButton.d.ts +2 -1
  5. package/dist/esm/components/Modal/ModalBoxCloseButton.d.ts.map +1 -1
  6. package/dist/esm/components/Modal/ModalBoxCloseButton.js +2 -2
  7. package/dist/esm/components/Modal/ModalBoxCloseButton.js.map +1 -1
  8. package/dist/esm/components/Modal/ModalContent.js +1 -1
  9. package/dist/esm/components/Modal/ModalContent.js.map +1 -1
  10. package/dist/esm/components/Select/Select.d.ts.map +1 -1
  11. package/dist/esm/components/Select/Select.js +2 -2
  12. package/dist/esm/components/Select/Select.js.map +1 -1
  13. package/dist/esm/components/Select/SelectOption.d.ts +2 -0
  14. package/dist/esm/components/Select/SelectOption.d.ts.map +1 -1
  15. package/dist/esm/components/Select/SelectOption.js +70 -48
  16. package/dist/esm/components/Select/SelectOption.js.map +1 -1
  17. package/dist/esm/components/Truncate/Truncate.d.ts +21 -0
  18. package/dist/esm/components/Truncate/Truncate.d.ts.map +1 -0
  19. package/dist/esm/components/Truncate/Truncate.js +34 -0
  20. package/dist/esm/components/Truncate/Truncate.js.map +1 -0
  21. package/dist/esm/components/Truncate/index.d.ts +2 -0
  22. package/dist/esm/components/Truncate/index.d.ts.map +1 -0
  23. package/dist/esm/components/Truncate/index.js +2 -0
  24. package/dist/esm/components/Truncate/index.js.map +1 -0
  25. package/dist/esm/components/index.d.ts +1 -0
  26. package/dist/esm/components/index.d.ts.map +1 -1
  27. package/dist/esm/components/index.js +1 -0
  28. package/dist/esm/components/index.js.map +1 -1
  29. package/dist/js/components/DataList/DataListCheck.d.ts +1 -1
  30. package/dist/js/components/DataList/DataListCheck.d.ts.map +1 -1
  31. package/dist/js/components/Modal/ModalBoxCloseButton.d.ts +2 -1
  32. package/dist/js/components/Modal/ModalBoxCloseButton.d.ts.map +1 -1
  33. package/dist/js/components/Modal/ModalBoxCloseButton.js +2 -2
  34. package/dist/js/components/Modal/ModalBoxCloseButton.js.map +1 -1
  35. package/dist/js/components/Modal/ModalContent.js +1 -1
  36. package/dist/js/components/Modal/ModalContent.js.map +1 -1
  37. package/dist/js/components/Select/Select.d.ts.map +1 -1
  38. package/dist/js/components/Select/Select.js +2 -2
  39. package/dist/js/components/Select/Select.js.map +1 -1
  40. package/dist/js/components/Select/SelectOption.d.ts +2 -0
  41. package/dist/js/components/Select/SelectOption.d.ts.map +1 -1
  42. package/dist/js/components/Select/SelectOption.js +70 -48
  43. package/dist/js/components/Select/SelectOption.js.map +1 -1
  44. package/dist/js/components/Truncate/Truncate.d.ts +21 -0
  45. package/dist/js/components/Truncate/Truncate.d.ts.map +1 -0
  46. package/dist/js/components/Truncate/Truncate.js +38 -0
  47. package/dist/js/components/Truncate/Truncate.js.map +1 -0
  48. package/dist/js/components/Truncate/index.d.ts +2 -0
  49. package/dist/js/components/Truncate/index.d.ts.map +1 -0
  50. package/dist/js/components/Truncate/index.js +5 -0
  51. package/dist/js/components/Truncate/index.js.map +1 -0
  52. package/dist/js/components/index.d.ts +1 -0
  53. package/dist/js/components/index.d.ts.map +1 -1
  54. package/dist/js/components/index.js +1 -0
  55. package/dist/js/components/index.js.map +1 -1
  56. package/dist/umd/react-core.css +59 -6
  57. package/dist/umd/react-core.js +1002 -940
  58. package/dist/umd/react-core.min.css +59 -6
  59. package/dist/umd/react-core.min.js +2 -2
  60. package/index.d.ts +4 -0
  61. package/package.json +6 -6
  62. package/src/components/BackToTop/examples/BackToTop.css +3 -3
  63. package/src/components/BackToTop/examples/BackToTop.md +2 -6
  64. package/src/components/BackToTop/examples/BackToTopBasic.tsx +4 -0
  65. package/src/components/Backdrop/examples/Backdrop.md +3 -12
  66. package/src/components/Backdrop/examples/BackdropBasic.tsx +4 -0
  67. package/src/components/Backdrop/examples/BackdropSpinner.tsx +10 -0
  68. package/src/components/BackgroundImage/examples/BackgroundImage.md +2 -21
  69. package/src/components/BackgroundImage/examples/BackgroundImageBasic.tsx +15 -0
  70. package/src/components/Badge/examples/Badge.md +3 -24
  71. package/src/components/Badge/examples/BadgeRead.tsx +19 -0
  72. package/src/components/Badge/examples/BadgeUnread.tsx +8 -0
  73. package/src/components/Banner/examples/Banner.md +1 -14
  74. package/src/components/Banner/examples/BannerBasic.tsx +16 -0
  75. package/src/components/Brand/examples/Brand.md +3 -5
  76. package/src/components/Brand/examples/BrandBasic.tsx +5 -0
  77. package/src/components/Breadcrumb/examples/Breadcrumb.md +4 -105
  78. package/src/components/Breadcrumb/examples/BreadcrumbBasic.tsx +13 -0
  79. package/src/components/Breadcrumb/examples/BreadcrumbDropdown.tsx +53 -0
  80. package/src/components/Breadcrumb/examples/BreadcrumbWithHeading.tsx +12 -0
  81. package/src/components/Breadcrumb/examples/BreadcrumbWithoutHomeLink.tsx +15 -0
  82. package/src/components/Button/examples/ButtonAriaDisabled.tsx +33 -37
  83. package/src/components/Button/examples/ButtonCallToAction.tsx +8 -6
  84. package/src/components/Button/examples/ButtonDisabled.tsx +33 -37
  85. package/src/components/Button/examples/ButtonInlineSpanLink.tsx +2 -2
  86. package/src/components/Button/examples/ButtonLinks.tsx +6 -6
  87. package/src/components/Button/examples/ButtonProgress.tsx +8 -5
  88. package/src/components/Button/examples/ButtonSmall.tsx +9 -7
  89. package/src/components/Button/examples/ButtonTypes.tsx +4 -6
  90. package/src/components/Button/examples/ButtonVariations.tsx +31 -36
  91. package/src/components/DataList/DataListCheck.tsx +1 -1
  92. package/src/components/Modal/ModalBoxCloseButton.tsx +11 -2
  93. package/src/components/Modal/ModalContent.tsx +1 -1
  94. package/src/components/Modal/examples/Modal.md +3 -200
  95. package/src/components/Modal/examples/ModalWithForm.tsx +209 -0
  96. package/src/components/Select/Select.tsx +2 -1
  97. package/src/components/Select/SelectOption.tsx +188 -133
  98. package/src/components/Truncate/Truncate.tsx +63 -0
  99. package/src/components/Truncate/__tests__/Truncate.test.tsx +18 -0
  100. package/src/components/Truncate/__tests__/__snapshots__/Truncate.test.tsx.snap +58 -0
  101. package/src/components/Truncate/examples/Truncate.md +59 -0
  102. package/src/components/Truncate/examples/TruncateExamples.css +9 -0
  103. package/src/components/Truncate/index.ts +1 -0
  104. package/src/components/index.ts +1 -0
  105. package/src/demos/Tabs/NestedTabsDemo.js +3 -3
  106. package/src/demos/Tabs.md +4 -0
  107. package/src/demos/examples/Tabs/GrayTabs.tsx +158 -0
package/index.d.ts ADDED
@@ -0,0 +1,4 @@
1
+ declare module '*.svg' {
2
+ const content: string;
3
+ export default content;
4
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@patternfly/react-core",
3
- "version": "4.191.6",
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,16 +34,16 @@
34
34
  "generate": "node scripts/copyStyles.js"
35
35
  },
36
36
  "dependencies": {
37
- "@patternfly/react-icons": "^4.42.6",
38
- "@patternfly/react-styles": "^4.41.6",
39
- "@patternfly/react-tokens": "^4.43.6",
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",
43
43
  "tslib": "^2.0.0"
44
44
  },
45
45
  "devDependencies": {
46
- "@patternfly/patternfly": "4.167.0",
46
+ "@patternfly/patternfly": "4.171.0",
47
47
  "@rollup/plugin-commonjs": "^21.0.0",
48
48
  "@rollup/plugin-node-resolve": "^13.0.0",
49
49
  "@rollup/plugin-replace": "^3.0.0",
@@ -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": "ce80b69350209b17f274f222e03278a3d09c021f"
63
+ "gitHead": "9d4921fd3bf0859b63f2a77f576da60e497b731e"
64
64
  }
@@ -1,4 +1,4 @@
1
1
  #ws-react-c-back-to-top-basic {
2
- height: 300px;
3
- position: relative;
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
- ```js
20
- import React from 'react';
21
- import { BackToTop } from '@patternfly/react-core';
22
-
23
- <BackToTop isAlwaysVisible/>
24
- ```
19
+ ```ts file="./BackToTopBasic.tsx"
20
+ ```
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import { BackToTop } from '@patternfly/react-core';
3
+
4
+ export const BackToTopBasic: React.FunctionComponent = () => <BackToTop isAlwaysVisible />;
@@ -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
- <Backdrop />
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
- <Backdrop>
23
- <Bullseye>
24
- <Spinner />
25
- </Bullseye>
26
- </Backdrop>
17
+ ```ts isFullscreen file="./BackdropSpinner.tsx"
27
18
  ```
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import { Backdrop } from '@patternfly/react-core';
3
+
4
+ export const BackdropBasic: React.FunctionComponent = () => <Backdrop />;
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import { Backdrop, Spinner, Bullseye } from '@patternfly/react-core';
3
+
4
+ export const BackdropSpinner: React.FunctionComponent = () => (
5
+ <Backdrop>
6
+ <Bullseye>
7
+ <Spinner />
8
+ </Bullseye>
9
+ </Backdrop>
10
+ );
@@ -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
- class SimpleBackgroundImage extends React.Component {
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
- <React.Fragment>
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
- <React.Fragment>
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
- <React.Fragment>
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
- <Brand src={pfLogo} alt="Patternfly Logo" />
14
+ ```ts file="./BrandBasic.tsx"
17
15
  ```
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import { Brand } from '@patternfly/react-core';
3
+ import pfLogo from './pfLogo.svg';
4
+
5
+ export const BrandBasic: React.FunctionComponent = () => <Brand src={pfLogo} alt="Patternfly Logo" />;
@@ -12,121 +12,20 @@ import AngleLeftIcon from '@patternfly/react-icons/dist/esm/icons/angle-left-ico
12
12
 
13
13
  ### Basic
14
14
 
15
- ```js
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
- ```js
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
- ```js
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
- ```js
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, Flex } from '@patternfly/react-core';
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
- <Flex direction={{ default: 'column' }}>
8
- <Flex>
9
- <Button isAriaDisabled>Primary aria disabled</Button>
10
- <Button isAriaDisabled>Secondary aria disabled</Button>
11
- <Button variant="secondary" isDanger isAriaDisabled>
12
- Danger secondary aria disabled
13
- </Button>
14
- <Button isAriaDisabled variant="tertiary">
15
- Tertiary aria disabled
16
- </Button>
17
- <Button isAriaDisabled variant="danger">
18
- Danger disabled
19
- </Button>
20
- <Button isAriaDisabled variant="warning">
21
- Warning disabled
22
- </Button>
23
- </Flex>
24
-
25
- <Flex>
26
- <Button isAriaDisabled variant="link" icon={<PlusCircleIcon />}>
27
- Link aria disabled
28
- </Button>
29
- <Button isAriaDisabled variant="link" isInline>
30
- Inline link aria disabled
31
- </Button>
32
- <Button variant="link" isDanger isAriaDisabled>
33
- Danger link disabled
34
- </Button>
35
- <Button isAriaDisabled variant="plain" aria-label="Action">
36
- <TimesIcon />
37
- </Button>
38
- <Button isAriaDisabled variant="control">
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, Flex } from '@patternfly/react-core';
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
- <Flex>
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
- </Flex>
19
+ <br />
20
+ <br />
21
+ </React.Fragment>
20
22
  );