@patternfly/react-core 4.222.2 → 4.222.5

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 (68) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/dist/esm/components/AboutModal/AboutModal.d.ts +1 -1
  3. package/dist/esm/components/AboutModal/AboutModal.js.map +1 -1
  4. package/dist/esm/components/Dropdown/InternalDropdownItem.d.ts.map +1 -1
  5. package/dist/esm/components/Dropdown/InternalDropdownItem.js +3 -3
  6. package/dist/esm/components/Dropdown/InternalDropdownItem.js.map +1 -1
  7. package/dist/esm/components/DualListSelector/DualListSelector.d.ts.map +1 -1
  8. package/dist/esm/components/DualListSelector/DualListSelector.js +6 -5
  9. package/dist/esm/components/DualListSelector/DualListSelector.js.map +1 -1
  10. package/dist/esm/components/DualListSelector/DualListSelectorPane.d.ts.map +1 -1
  11. package/dist/esm/components/DualListSelector/DualListSelectorPane.js.map +1 -1
  12. package/dist/esm/components/Menu/MenuItem.js.map +1 -1
  13. package/dist/esm/components/MenuToggle/MenuToggle.js.map +1 -1
  14. package/dist/esm/components/Modal/Modal.d.ts +1 -1
  15. package/dist/esm/components/Modal/Modal.js.map +1 -1
  16. package/dist/esm/components/Select/Select.d.ts.map +1 -1
  17. package/dist/esm/components/Select/Select.js +2 -1
  18. package/dist/esm/components/Select/Select.js.map +1 -1
  19. package/dist/esm/components/Toolbar/ToolbarToggleGroup.d.ts.map +1 -1
  20. package/dist/esm/components/Toolbar/ToolbarToggleGroup.js.map +1 -1
  21. package/dist/js/components/AboutModal/AboutModal.d.ts +1 -1
  22. package/dist/js/components/AboutModal/AboutModal.js.map +1 -1
  23. package/dist/js/components/Dropdown/InternalDropdownItem.d.ts.map +1 -1
  24. package/dist/js/components/Dropdown/InternalDropdownItem.js +3 -3
  25. package/dist/js/components/Dropdown/InternalDropdownItem.js.map +1 -1
  26. package/dist/js/components/DualListSelector/DualListSelector.d.ts.map +1 -1
  27. package/dist/js/components/DualListSelector/DualListSelector.js +6 -5
  28. package/dist/js/components/DualListSelector/DualListSelector.js.map +1 -1
  29. package/dist/js/components/DualListSelector/DualListSelectorPane.d.ts.map +1 -1
  30. package/dist/js/components/DualListSelector/DualListSelectorPane.js.map +1 -1
  31. package/dist/js/components/Menu/MenuItem.js.map +1 -1
  32. package/dist/js/components/MenuToggle/MenuToggle.js.map +1 -1
  33. package/dist/js/components/Modal/Modal.d.ts +1 -1
  34. package/dist/js/components/Modal/Modal.js.map +1 -1
  35. package/dist/js/components/Select/Select.d.ts.map +1 -1
  36. package/dist/js/components/Select/Select.js +2 -1
  37. package/dist/js/components/Select/Select.js.map +1 -1
  38. package/dist/js/components/Toolbar/ToolbarToggleGroup.d.ts.map +1 -1
  39. package/dist/js/components/Toolbar/ToolbarToggleGroup.js.map +1 -1
  40. package/dist/umd/react-core.css +1 -5
  41. package/dist/umd/react-core.js +11 -9
  42. package/dist/umd/react-core.min.css +1 -5
  43. package/dist/umd/react-core.min.js +1 -1
  44. package/package.json +6 -6
  45. package/src/components/AboutModal/AboutModal.tsx +1 -1
  46. package/src/components/ApplicationLauncher/__tests__/Generated/__snapshots__/ApplicationLauncherSeparator.test.tsx.snap +1 -1
  47. package/src/components/ApplicationLauncher/__tests__/__snapshots__/ApplicationLauncher.test.tsx.snap +26 -14
  48. package/src/components/Dropdown/InternalDropdownItem.tsx +3 -2
  49. package/src/components/Dropdown/__tests__/Generated/__snapshots__/DropdownSeparator.test.tsx.snap +1 -1
  50. package/src/components/Dropdown/__tests__/__snapshots__/Dropdown.test.tsx.snap +21 -3
  51. package/src/components/Dropdown/__tests__/__snapshots__/InternalDropdownItem.test.tsx.snap +10 -0
  52. package/src/components/Dropdown/examples/DropdownBasic.tsx +4 -2
  53. package/src/components/DualListSelector/DualListSelector.tsx +57 -37
  54. package/src/components/DualListSelector/DualListSelectorPane.tsx +10 -8
  55. package/src/components/Label/examples/Label.md +5 -399
  56. package/src/components/Label/examples/LabelCompact.tsx +27 -0
  57. package/src/components/Label/examples/LabelFilled.tsx +167 -0
  58. package/src/components/Label/examples/LabelOutline.tsx +188 -0
  59. package/src/components/Label/examples/LabelRouterLink.tsx +20 -0
  60. package/src/components/Menu/MenuItem.tsx +1 -1
  61. package/src/components/MenuToggle/MenuToggle.tsx +1 -1
  62. package/src/components/Modal/Modal.tsx +1 -1
  63. package/src/components/OptionsMenu/__tests__/Generated/__snapshots__/OptionsMenuItem.test.tsx.snap +2 -1
  64. package/src/components/OptionsMenu/__tests__/__snapshots__/OptionsMenu.test.tsx.snap +12 -6
  65. package/src/components/OverflowMenu/__tests__/Generated/__snapshots__/OverflowMenuDropdownItem.test.tsx.snap +2 -1
  66. package/src/components/Select/Select.tsx +6 -3
  67. package/src/components/Toolbar/ToolbarToggleGroup.tsx +4 -1
  68. package/src/demos/Wizard/WizardDemo.md +66 -121
@@ -0,0 +1,188 @@
1
+ import React from 'react';
2
+ import { Label } from '@patternfly/react-core';
3
+ import InfoCircleIcon from '@patternfly/react-icons/dist/esm/icons/info-circle-icon';
4
+
5
+ export const LabelOutline: React.FunctionComponent = () => (
6
+ <React.Fragment>
7
+ <Label variant="outline">Grey</Label>{' '}
8
+ <Label variant="outline" icon={<InfoCircleIcon />}>
9
+ Grey icon
10
+ </Label>{' '}
11
+ <Label variant="outline" onClose={() => Function.prototype}>
12
+ Grey removable
13
+ </Label>{' '}
14
+ <Label variant="outline" icon={<InfoCircleIcon />} onClose={() => Function.prototype}>
15
+ Grey icon removable
16
+ </Label>{' '}
17
+ <Label variant="outline" href="#outline">
18
+ Grey link
19
+ </Label>{' '}
20
+ <Label variant="outline" href="#outline" onClose={() => Function.prototype}>
21
+ Grey link removable
22
+ </Label>
23
+ <Label variant="outline" icon={<InfoCircleIcon />} onClose={() => Function.prototype} isTruncated>
24
+ Grey label with icon that overflows
25
+ </Label>
26
+ <br />
27
+ <br />
28
+ <Label variant="outline" color="blue">
29
+ Blue
30
+ </Label>{' '}
31
+ <Label variant="outline" color="blue" icon={<InfoCircleIcon />}>
32
+ Blue icon
33
+ </Label>{' '}
34
+ <Label variant="outline" color="blue" onClose={() => Function.prototype}>
35
+ Blue removable
36
+ </Label>{' '}
37
+ <Label variant="outline" color="blue" icon={<InfoCircleIcon />} onClose={() => Function.prototype}>
38
+ Blue icon removable
39
+ </Label>{' '}
40
+ <Label variant="outline" color="blue" href="#outline">
41
+ Blue link
42
+ </Label>{' '}
43
+ <Label variant="outline" color="blue" href="#outline" onClose={() => Function.prototype}>
44
+ Blue link removable
45
+ </Label>
46
+ <Label variant="outline" color="blue" icon={<InfoCircleIcon />} onClose={() => Function.prototype} isTruncated>
47
+ Blue label with icon that overflows
48
+ </Label>
49
+ <br />
50
+ <br />
51
+ <Label variant="outline" color="green">
52
+ Green
53
+ </Label>{' '}
54
+ <Label variant="outline" color="green" icon={<InfoCircleIcon />}>
55
+ Green icon
56
+ </Label>{' '}
57
+ <Label variant="outline" color="green" onClose={() => Function.prototype}>
58
+ Green removable
59
+ </Label>{' '}
60
+ <Label variant="outline" color="green" icon={<InfoCircleIcon />} onClose={() => Function.prototype}>
61
+ Green icon removable
62
+ </Label>{' '}
63
+ <Label variant="outline" color="green" href="#outline">
64
+ Green link
65
+ </Label>{' '}
66
+ <Label variant="outline" color="green" href="#outline" onClose={() => Function.prototype}>
67
+ Green link removable
68
+ </Label>
69
+ <Label variant="outline" color="green" icon={<InfoCircleIcon />} onClose={() => Function.prototype} isTruncated>
70
+ Green label with icon that overflows
71
+ </Label>
72
+ <br />
73
+ <br />
74
+ <Label variant="outline" color="orange">
75
+ Orange
76
+ </Label>{' '}
77
+ <Label variant="outline" color="orange" icon={<InfoCircleIcon />}>
78
+ Orange icon
79
+ </Label>{' '}
80
+ <Label variant="outline" color="orange" onClose={() => Function.prototype}>
81
+ Orange removable
82
+ </Label>{' '}
83
+ <Label variant="outline" color="orange" icon={<InfoCircleIcon />} onClose={() => Function.prototype}>
84
+ Orange icon removable
85
+ </Label>{' '}
86
+ <Label variant="outline" color="orange" href="#outline">
87
+ Orange link
88
+ </Label>{' '}
89
+ <Label variant="outline" color="orange" href="#outline" onClose={() => Function.prototype}>
90
+ Orange link removable
91
+ </Label>
92
+ <Label variant="outline" color="orange" icon={<InfoCircleIcon />} onClose={() => Function.prototype} isTruncated>
93
+ Orange label with icon that overflows
94
+ </Label>
95
+ <br />
96
+ <br />
97
+ <Label variant="outline" color="red">
98
+ Red
99
+ </Label>{' '}
100
+ <Label variant="outline" color="red" icon={<InfoCircleIcon />}>
101
+ Red icon
102
+ </Label>{' '}
103
+ <Label variant="outline" color="red" onClose={() => Function.prototype}>
104
+ Red removable
105
+ </Label>{' '}
106
+ <Label variant="outline" color="red" icon={<InfoCircleIcon />} onClose={() => Function.prototype}>
107
+ Red icon removable
108
+ </Label>{' '}
109
+ <Label variant="outline" color="red" href="#outline">
110
+ Red link
111
+ </Label>{' '}
112
+ <Label variant="outline" color="red" href="#outline" onClose={() => Function.prototype}>
113
+ Red link removable
114
+ </Label>
115
+ <Label variant="outline" color="red" icon={<InfoCircleIcon />} onClose={() => Function.prototype} isTruncated>
116
+ Red label with icon that overflows
117
+ </Label>
118
+ <br />
119
+ <br />
120
+ <Label variant="outline" color="purple">
121
+ Purple
122
+ </Label>{' '}
123
+ <Label variant="outline" color="purple" icon={<InfoCircleIcon />}>
124
+ Purple icon
125
+ </Label>{' '}
126
+ <Label variant="outline" color="purple" onClose={() => Function.prototype}>
127
+ Purple removable
128
+ </Label>{' '}
129
+ <Label variant="outline" color="purple" icon={<InfoCircleIcon />} onClose={() => Function.prototype}>
130
+ Purple icon removable
131
+ </Label>{' '}
132
+ <Label variant="outline" color="purple" href="#outline">
133
+ Purple link
134
+ </Label>{' '}
135
+ <Label variant="outline" color="purple" href="#outline" onClose={() => Function.prototype}>
136
+ Purple link removable
137
+ </Label>
138
+ <Label variant="outline" color="purple" icon={<InfoCircleIcon />} onClose={() => Function.prototype} isTruncated>
139
+ Purple label with icon that overflows
140
+ </Label>
141
+ <br />
142
+ <br />
143
+ <Label variant="outline" color="cyan">
144
+ Cyan
145
+ </Label>{' '}
146
+ <Label variant="outline" color="cyan" icon={<InfoCircleIcon />}>
147
+ Cyan icon
148
+ </Label>{' '}
149
+ <Label variant="outline" color="cyan" onClose={() => Function.prototype}>
150
+ Cyan removable
151
+ </Label>{' '}
152
+ <Label variant="outline" color="cyan" icon={<InfoCircleIcon />} onClose={() => Function.prototype}>
153
+ Cyan icon removable
154
+ </Label>{' '}
155
+ <Label variant="outline" color="cyan" href="#outline">
156
+ Cyan link
157
+ </Label>{' '}
158
+ <Label variant="outline" color="cyan" href="#outline" onClose={() => Function.prototype}>
159
+ Cyan link removable
160
+ </Label>
161
+ <Label variant="outline" color="cyan" icon={<InfoCircleIcon />} onClose={() => Function.prototype} isTruncated>
162
+ Cyan label with icon that overflows
163
+ </Label>
164
+ <br />
165
+ <br />
166
+ <Label variant="outline" color="gold">
167
+ Gold
168
+ </Label>{' '}
169
+ <Label variant="outline" color="gold" icon={<InfoCircleIcon />}>
170
+ Gold icon
171
+ </Label>{' '}
172
+ <Label variant="outline" color="gold" onClose={() => Function.prototype}>
173
+ Gold removable
174
+ </Label>{' '}
175
+ <Label variant="outline" color="gold" icon={<InfoCircleIcon />} onClose={() => Function.prototype}>
176
+ Gold icon removable
177
+ </Label>{' '}
178
+ <Label variant="outline" color="gold" href="#outline">
179
+ Gold link
180
+ </Label>{' '}
181
+ <Label variant="outline" color="gold" href="#outline" onClose={() => Function.prototype}>
182
+ Gold link removable
183
+ </Label>
184
+ <Label variant="outline" color="gold" icon={<InfoCircleIcon />} onClose={() => Function.prototype} isTruncated>
185
+ Gold label with icon that overflows
186
+ </Label>
187
+ </React.Fragment>
188
+ );
@@ -0,0 +1,20 @@
1
+ import React from 'react';
2
+ import { Label } from '@patternfly/react-core';
3
+ import InfoCircleIcon from '@patternfly/react-icons/dist/esm/icons/info-circle-icon';
4
+ import { Link } from '@reach/router';
5
+
6
+ export const LabelRouterLink: React.FunctionComponent = () => (
7
+ <Label
8
+ color="blue"
9
+ icon={<InfoCircleIcon />}
10
+ onClose={() => Function.prototype}
11
+ isTruncated
12
+ render={({ className, content, componentRef }) => (
13
+ <Link to="/" className={className} innerRef={componentRef}>
14
+ {content}
15
+ </Link>
16
+ )}
17
+ >
18
+ Blue label router link with icon that overflows
19
+ </Label>
20
+ );
@@ -224,7 +224,7 @@ const MenuItemBase: React.FunctionComponent<MenuItemProps> = ({
224
224
  onDrillIn(
225
225
  menuId,
226
226
  typeof drilldownMenu === 'function'
227
- ? drilldownMenu().props.id
227
+ ? (drilldownMenu() as any).props.id
228
228
  : (drilldownMenu as React.ReactElement).props.id,
229
229
  itemId
230
230
  );
@@ -61,7 +61,7 @@ export class MenuToggleBase extends React.Component<MenuToggleProps> {
61
61
  <React.Fragment>
62
62
  {icon && <span className={css(styles.menuToggleIcon)}>{icon}</span>}
63
63
  <span className="pf-c-menu-toggle__text">{children}</span>
64
- {badge && <span className={css(styles.menuToggleCount)}>{badge}</span>}
64
+ {badge && <span className={css(styles.menuToggleCount)}>{badge as React.ReactNode}</span>}
65
65
  <span className={css(styles.menuToggleControls)}>
66
66
  <span className={css(styles.menuToggleToggleIcon)}>
67
67
  <CaretDownIcon aria-hidden />
@@ -243,6 +243,6 @@ export class Modal extends React.Component<ModalProps, ModalState> {
243
243
  ouiaSafe={ouiaSafe}
244
244
  />,
245
245
  container
246
- );
246
+ ) as React.ReactElement;
247
247
  }
248
248
  }
@@ -4,7 +4,7 @@ exports[`OptionsMenuItem should match snapshot 1`] = `
4
4
  <DocumentFragment>
5
5
  <li
6
6
  id="''"
7
- role="menuitem"
7
+ role="none"
8
8
  >
9
9
  <button
10
10
  aria-disabled="true"
@@ -12,6 +12,7 @@ exports[`OptionsMenuItem should match snapshot 1`] = `
12
12
  data-ouia-component-id="OUIA-Generated-DropdownItem-1"
13
13
  data-ouia-component-type="PF4/DropdownItem"
14
14
  data-ouia-safe="true"
15
+ role="menuitem"
15
16
  tabindex="-1"
16
17
  type="button"
17
18
  >
@@ -61,7 +61,7 @@ exports[`optionsMenu expanded 1`] = `
61
61
  >
62
62
  <li
63
63
  id=""
64
- role="menuitem"
64
+ role="none"
65
65
  >
66
66
  <button
67
67
  aria-disabled="false"
@@ -69,6 +69,7 @@ exports[`optionsMenu expanded 1`] = `
69
69
  data-ouia-component-id="OUIA-Generated-DropdownItem-1"
70
70
  data-ouia-component-type="PF4/DropdownItem"
71
71
  data-ouia-safe="true"
72
+ role="menuitem"
72
73
  tabindex="-1"
73
74
  type="button"
74
75
  >
@@ -77,7 +78,7 @@ exports[`optionsMenu expanded 1`] = `
77
78
  </li>
78
79
  <li
79
80
  id=""
80
- role="menuitem"
81
+ role="none"
81
82
  >
82
83
  <button
83
84
  aria-disabled="false"
@@ -85,6 +86,7 @@ exports[`optionsMenu expanded 1`] = `
85
86
  data-ouia-component-id="OUIA-Generated-DropdownItem-2"
86
87
  data-ouia-component-type="PF4/DropdownItem"
87
88
  data-ouia-safe="true"
89
+ role="menuitem"
88
90
  tabindex="-1"
89
91
  type="button"
90
92
  >
@@ -93,7 +95,7 @@ exports[`optionsMenu expanded 1`] = `
93
95
  </li>
94
96
  <li
95
97
  id=""
96
- role="menuitem"
98
+ role="none"
97
99
  >
98
100
  <button
99
101
  aria-disabled="true"
@@ -101,6 +103,7 @@ exports[`optionsMenu expanded 1`] = `
101
103
  data-ouia-component-id="OUIA-Generated-DropdownItem-3"
102
104
  data-ouia-component-type="PF4/DropdownItem"
103
105
  data-ouia-safe="true"
106
+ role="menuitem"
104
107
  tabindex="-1"
105
108
  type="button"
106
109
  >
@@ -109,7 +112,7 @@ exports[`optionsMenu expanded 1`] = `
109
112
  </li>
110
113
  <li
111
114
  id=""
112
- role="menuitem"
115
+ role="none"
113
116
  >
114
117
  <button
115
118
  aria-disabled="false"
@@ -117,6 +120,7 @@ exports[`optionsMenu expanded 1`] = `
117
120
  data-ouia-component-id="OUIA-Generated-DropdownItem-4"
118
121
  data-ouia-component-type="PF4/DropdownItem"
119
122
  data-ouia-safe="true"
123
+ role="menuitem"
120
124
  tabindex="-1"
121
125
  type="button"
122
126
  >
@@ -145,7 +149,7 @@ exports[`optionsMenu expanded 1`] = `
145
149
  >
146
150
  <li
147
151
  id=""
148
- role="menuitem"
152
+ role="none"
149
153
  >
150
154
  <button
151
155
  aria-disabled="false"
@@ -153,6 +157,7 @@ exports[`optionsMenu expanded 1`] = `
153
157
  data-ouia-component-id="OUIA-Generated-DropdownItem-5"
154
158
  data-ouia-component-type="PF4/DropdownItem"
155
159
  data-ouia-safe="true"
160
+ role="menuitem"
156
161
  tabindex="-1"
157
162
  type="button"
158
163
  >
@@ -161,7 +166,7 @@ exports[`optionsMenu expanded 1`] = `
161
166
  </li>
162
167
  <li
163
168
  id=""
164
- role="menuitem"
169
+ role="none"
165
170
  >
166
171
  <button
167
172
  aria-disabled="false"
@@ -169,6 +174,7 @@ exports[`optionsMenu expanded 1`] = `
169
174
  data-ouia-component-id="OUIA-Generated-DropdownItem-6"
170
175
  data-ouia-component-type="PF4/DropdownItem"
171
176
  data-ouia-safe="true"
177
+ role="menuitem"
172
178
  tabindex="-1"
173
179
  type="button"
174
180
  >
@@ -3,7 +3,7 @@
3
3
  exports[`OverflowMenuDropdownItem should match snapshot 1`] = `
4
4
  <DocumentFragment>
5
5
  <li
6
- role="menuitem"
6
+ role="none"
7
7
  >
8
8
  <button
9
9
  aria-disabled="false"
@@ -11,6 +11,7 @@ exports[`OverflowMenuDropdownItem should match snapshot 1`] = `
11
11
  data-ouia-component-id="OUIA-Generated-DropdownItem-1"
12
12
  data-ouia-component-type="PF4/DropdownItem"
13
13
  data-ouia-safe="true"
14
+ role="menuitem"
14
15
  tabindex="-1"
15
16
  type="button"
16
17
  >
@@ -447,7 +447,10 @@ export class Select extends React.Component<SelectProps & OUIAProps, SelectState
447
447
  typeaheadFilteredChildren =
448
448
  typeaheadInputValue.toString() !== ''
449
449
  ? React.Children.map(children, group => {
450
- if (React.isValidElement(group) && group.type === SelectGroup) {
450
+ if (
451
+ React.isValidElement<React.ComponentProps<typeof SelectGroup>>(group) &&
452
+ group.type === SelectGroup
453
+ ) {
451
454
  const filteredGroupChildren = (React.Children.toArray(group.props.children) as React.ReactElement<
452
455
  SelectGroupProps
453
456
  >[]).filter(childFilter);
@@ -635,8 +638,8 @@ export class Select extends React.Component<SelectProps & OUIAProps, SelectState
635
638
  optionContainerRef: React.ReactNode,
636
639
  index: number
637
640
  ) => {
638
- this.refCollection[index] = [optionRef as HTMLElement, favoriteRef as HTMLElement];
639
- this.optionContainerRefCollection[index] = optionContainerRef as HTMLElement;
641
+ this.refCollection[index] = [(optionRef as unknown) as HTMLElement, (favoriteRef as unknown) as HTMLElement];
642
+ this.optionContainerRefCollection[index] = (optionContainerRef as unknown) as HTMLElement;
640
643
  };
641
644
 
642
645
  handleMenuKeys = (index: number, innerIndex: number, position: string) => {
@@ -144,7 +144,10 @@ export class ToolbarToggleGroup extends React.Component<ToolbarToggleGroupProps>
144
144
  </Button>
145
145
  </div>
146
146
  {isExpanded
147
- ? ReactDOM.createPortal(children, expandableContentRef.current.firstElementChild)
147
+ ? (ReactDOM.createPortal(
148
+ children,
149
+ expandableContentRef.current.firstElementChild
150
+ ) as React.ReactElement)
148
151
  : children}
149
152
  </div>
150
153
  );
@@ -3,30 +3,9 @@ id: Wizard
3
3
  section: components
4
4
  ---
5
5
 
6
- import {
7
- Brand,
8
- Breadcrumb,
9
- BreadcrumbItem,
10
- Modal,
11
- ModalVariant,
12
- Nav,
13
- NavItem,
14
- NavList,
15
- Page,
16
- PageToggleButton,
17
- PageSection,
18
- PageSectionTypes,
19
- PageSectionVariants,
20
- PageSidebar,
21
- Progress,
22
- SkipToContent,
23
- Text,
24
- TextContent,
25
- Title,
26
- Wizard
27
- } from '@patternfly/react-core';
28
6
  import imgBrand from './imgBrand.svg';
29
7
  import BarsIcon from '@patternfly/react-icons/dist/js/icons/bars-icon';
8
+ import DashboardWrapper from '../examples/DashboardWrapper';
30
9
 
31
10
  ## Demos
32
11
 
@@ -34,10 +13,36 @@ import BarsIcon from '@patternfly/react-icons/dist/js/icons/bars-icon';
34
13
 
35
14
  ```js isFullscreen
36
15
  import React from 'react';
37
- import { Modal, ModalVariant, Wizard } from '@patternfly/react-core';
16
+ import {
17
+ Card,
18
+ CardBody,
19
+ Gallery,
20
+ GalleryItem,
21
+ Nav,
22
+ NavItem,
23
+ NavList,
24
+ PageSection,
25
+ Wizard,
26
+ Modal,
27
+ ModalVariant
28
+ } from '@patternfly/react-core';
29
+ import DashboardWrapper from '../examples/DashboardWrapper';
38
30
 
39
31
  class BasicWizardDemo extends React.Component {
32
+ constructor(props) {
33
+ super(props);
34
+ this.state = {
35
+ activeItem: 0
36
+ };
37
+ this.onNavSelect = result => {
38
+ this.setState({
39
+ activeItem: result.itemId
40
+ });
41
+ };
42
+ }
40
43
  render() {
44
+ const { activeItem } = this.state;
45
+
41
46
  const steps = [
42
47
  { id: 0, name: 'Information', component: <p>Step 1 content</p> },
43
48
  {
@@ -62,25 +67,40 @@ class BasicWizardDemo extends React.Component {
62
67
  ];
63
68
  const title = 'Basic wizard';
64
69
  return (
65
- <Modal
66
- isOpen
67
- variant={ModalVariant.large}
68
- showClose={false}
69
- hasNoBodyWrapper
70
- aria-describedby="wiz-modal-demo-description"
71
- aria-labelledby="wiz-modal-demo-title"
72
- >
73
- <Wizard
74
- navAriaLabel={`${title} steps`}
75
- mainAriaLabel={`${title} content`}
76
- titleId="wiz-modal-demo-title"
77
- descriptionId="wiz-modal-demo-description"
78
- title="Simple wizard in modal"
79
- description="Simple wizard description"
80
- steps={steps}
81
- height={400}
82
- />
83
- </Modal>
70
+ <React.Fragment>
71
+ <DashboardWrapper hasPageTemplateTitle>
72
+ <PageSection isWidthLimited>
73
+ <Gallery hasGutter>
74
+ {Array.apply(0, Array(10)).map((x, i) => (
75
+ <GalleryItem key={i}>
76
+ <Card>
77
+ <CardBody>This is a card</CardBody>
78
+ </Card>
79
+ </GalleryItem>
80
+ ))}
81
+ </Gallery>
82
+ </PageSection>
83
+ </DashboardWrapper>
84
+ <Modal
85
+ isOpen
86
+ variant={ModalVariant.large}
87
+ showClose={false}
88
+ hasNoBodyWrapper
89
+ aria-describedby="wiz-modal-demo-description"
90
+ aria-labelledby="wiz-modal-demo-title"
91
+ >
92
+ <Wizard
93
+ navAriaLabel={`${title} steps`}
94
+ mainAriaLabel={`${title} content`}
95
+ titleId="wiz-modal-demo-title"
96
+ descriptionId="wiz-modal-demo-description"
97
+ title="Simple wizard in modal"
98
+ description="Simple wizard description"
99
+ steps={steps}
100
+ height={400}
101
+ />
102
+ </Modal>
103
+ </React.Fragment>
84
104
  );
85
105
  }
86
106
  }
@@ -91,31 +111,17 @@ class BasicWizardDemo extends React.Component {
91
111
  ```js isFullscreen
92
112
  import React from 'react';
93
113
  import {
94
- Brand,
95
- Breadcrumb,
96
- BreadcrumbItem,
97
114
  Nav,
98
115
  NavItem,
99
116
  NavList,
100
- Page,
101
117
  PageSection,
102
118
  PageSectionTypes,
103
119
  PageSectionVariants,
104
- PageSidebar,
105
- Progress,
106
- SkipToContent,
107
- Text,
108
- TextContent,
109
- Title,
110
- Wizard,
111
- Masthead,
112
- PageToggleButton,
113
- MastheadToggle,
114
- MastheadMain,
115
- MastheadBrand
120
+ Wizard
116
121
  } from '@patternfly/react-core';
117
122
  import imgBrand from './imgBrand.svg';
118
123
  import BarsIcon from '@patternfly/react-icons/dist/js/icons/bars-icon';
124
+ import DashboardWrapper from '../examples/DashboardWrapper';
119
125
 
120
126
  class FullPageWizard extends React.Component {
121
127
  constructor(props) {
@@ -131,54 +137,6 @@ class FullPageWizard extends React.Component {
131
137
  }
132
138
  render() {
133
139
  const { activeItem } = this.state;
134
- const PageNav = (
135
- <Nav onSelect={this.onNavSelect} aria-label="Nav">
136
- <NavList>
137
- <NavItem itemId={0} isActive={activeItem === 0}>
138
- System Panel
139
- </NavItem>
140
- <NavItem itemId={1} isActive={activeItem === 1}>
141
- Policy
142
- </NavItem>
143
- <NavItem itemId={2} isActive={activeItem === 2}>
144
- Authentication
145
- </NavItem>
146
- <NavItem itemId={3} isActive={activeItem === 3}>
147
- Network Services
148
- </NavItem>
149
- <NavItem itemId={4} isActive={activeItem === 4}>
150
- Server
151
- </NavItem>
152
- </NavList>
153
- </Nav>
154
- );
155
- const Header = (
156
- <Masthead id="basic">
157
- <MastheadToggle>
158
- <PageToggleButton variant="plain" aria-label="Global navigation">
159
- <BarsIcon />
160
- </PageToggleButton>
161
- </MastheadToggle>
162
- <MastheadMain>
163
- <MastheadBrand>
164
- <Brand src={imgBrand} alt="Patternfly logo" />
165
- </MastheadBrand>
166
- </MastheadMain>
167
- </Masthead>
168
- );
169
- const Sidebar = <PageSidebar nav={PageNav} />;
170
- const pageId = 'main-content-page-layout-default-nav';
171
- const PageSkipToContent = <SkipToContent href={`#${pageId}`}>Skip to content</SkipToContent>;
172
- const PageBreadcrumb = (
173
- <Breadcrumb>
174
- <BreadcrumbItem>Section home</BreadcrumbItem>
175
- <BreadcrumbItem to="#">Section title</BreadcrumbItem>
176
- <BreadcrumbItem to="#">Section title</BreadcrumbItem>
177
- <BreadcrumbItem to="#" isActive>
178
- Section landing
179
- </BreadcrumbItem>
180
- </Breadcrumb>
181
- );
182
140
 
183
141
  const steps = [
184
142
  { id: 0, name: 'Information', component: <p>Step 1 content</p> },
@@ -206,24 +164,11 @@ class FullPageWizard extends React.Component {
206
164
 
207
165
  return (
208
166
  <React.Fragment>
209
- <Page
210
- header={Header}
211
- sidebar={Sidebar}
212
- isManagedSidebar
213
- skipToContent={PageSkipToContent}
214
- breadcrumb={PageBreadcrumb}
215
- mainContainerId={pageId}
216
- >
217
- <PageSection variant={PageSectionVariants.light}>
218
- <TextContent>
219
- <Text component="h1">Main title</Text>
220
- <Text component="p">A demo of a wizard in a page.</Text>
221
- </TextContent>
222
- </PageSection>
167
+ <DashboardWrapper hasPageTemplateTitle>
223
168
  <PageSection type={PageSectionTypes.wizard} variant={PageSectionVariants.light}>
224
169
  <Wizard navAriaLabel={`${title} steps`} mainAriaLabel={`${title} content`} steps={steps} />
225
170
  </PageSection>
226
- </Page>
171
+ </DashboardWrapper>
227
172
  </React.Fragment>
228
173
  );
229
174
  }