@patternfly/react-core 6.2.0-prerelease.20 → 6.2.0-prerelease.21
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 +10 -0
- package/components/package.json +1 -1
- package/deprecated/package.json +1 -1
- package/dist/dynamic/components/AboutModal/package.json +1 -1
- package/dist/dynamic/components/Accordion/package.json +1 -1
- package/dist/dynamic/components/ActionList/package.json +1 -1
- package/dist/dynamic/components/Alert/package.json +1 -1
- package/dist/dynamic/components/Avatar/package.json +1 -1
- package/dist/dynamic/components/BackToTop/package.json +1 -1
- package/dist/dynamic/components/Backdrop/package.json +1 -1
- package/dist/dynamic/components/BackgroundImage/package.json +1 -1
- package/dist/dynamic/components/Badge/package.json +1 -1
- package/dist/dynamic/components/Banner/package.json +1 -1
- package/dist/dynamic/components/Brand/package.json +1 -1
- package/dist/dynamic/components/Breadcrumb/package.json +1 -1
- package/dist/dynamic/components/Button/package.json +1 -1
- package/dist/dynamic/components/CalendarMonth/package.json +1 -1
- package/dist/dynamic/components/Card/package.json +1 -1
- package/dist/dynamic/components/Checkbox/package.json +1 -1
- package/dist/dynamic/components/ClipboardCopy/package.json +1 -1
- package/dist/dynamic/components/CodeBlock/package.json +1 -1
- package/dist/dynamic/components/Content/package.json +1 -1
- package/dist/dynamic/components/DataList/package.json +1 -1
- package/dist/dynamic/components/DatePicker/package.json +1 -1
- package/dist/dynamic/components/DescriptionList/package.json +1 -1
- package/dist/dynamic/components/Divider/package.json +1 -1
- package/dist/dynamic/components/Drawer/package.json +1 -1
- package/dist/dynamic/components/Dropdown/package.json +1 -1
- package/dist/dynamic/components/DualListSelector/package.json +1 -1
- package/dist/dynamic/components/EmptyState/package.json +1 -1
- package/dist/dynamic/components/ExpandableSection/package.json +1 -1
- package/dist/dynamic/components/FileUpload/package.json +1 -1
- package/dist/dynamic/components/Form/package.json +1 -1
- package/dist/dynamic/components/FormSelect/package.json +1 -1
- package/dist/dynamic/components/HelperText/package.json +1 -1
- package/dist/dynamic/components/Hint/package.json +1 -1
- package/dist/dynamic/components/Icon/package.json +1 -1
- package/dist/dynamic/components/InputGroup/package.json +1 -1
- package/dist/dynamic/components/JumpLinks/package.json +1 -1
- package/dist/dynamic/components/Label/package.json +1 -1
- package/dist/dynamic/components/List/package.json +1 -1
- package/dist/dynamic/components/LoginPage/package.json +1 -1
- package/dist/dynamic/components/Masthead/package.json +1 -1
- package/dist/dynamic/components/Menu/package.json +1 -1
- package/dist/dynamic/components/MenuToggle/package.json +1 -1
- package/dist/dynamic/components/Modal/package.json +1 -1
- package/dist/dynamic/components/MultipleFileUpload/package.json +1 -1
- package/dist/dynamic/components/Nav/package.json +1 -1
- package/dist/dynamic/components/NotificationBadge/package.json +1 -1
- package/dist/dynamic/components/NotificationDrawer/package.json +1 -1
- package/dist/dynamic/components/NumberInput/package.json +1 -1
- package/dist/dynamic/components/OverflowMenu/package.json +1 -1
- package/dist/dynamic/components/Page/package.json +1 -1
- package/dist/dynamic/components/Pagination/package.json +1 -1
- package/dist/dynamic/components/Panel/package.json +1 -1
- package/dist/dynamic/components/Popover/package.json +1 -1
- package/dist/dynamic/components/Progress/package.json +1 -1
- package/dist/dynamic/components/ProgressStepper/package.json +1 -1
- package/dist/dynamic/components/Radio/package.json +1 -1
- package/dist/dynamic/components/SearchInput/package.json +1 -1
- package/dist/dynamic/components/Select/package.json +1 -1
- package/dist/dynamic/components/Sidebar/package.json +1 -1
- package/dist/dynamic/components/SimpleList/package.json +1 -1
- package/dist/dynamic/components/Skeleton/package.json +1 -1
- package/dist/dynamic/components/SkipToContent/package.json +1 -1
- package/dist/dynamic/components/Slider/package.json +1 -1
- package/dist/dynamic/components/Spinner/package.json +1 -1
- package/dist/dynamic/components/Switch/package.json +1 -1
- package/dist/dynamic/components/Tabs/package.json +1 -1
- package/dist/dynamic/components/TextArea/package.json +1 -1
- package/dist/dynamic/components/TextInput/package.json +1 -1
- package/dist/dynamic/components/TextInputGroup/package.json +1 -1
- package/dist/dynamic/components/TimePicker/package.json +1 -1
- package/dist/dynamic/components/Timestamp/package.json +1 -1
- package/dist/dynamic/components/Title/package.json +1 -1
- package/dist/dynamic/components/ToggleGroup/package.json +1 -1
- package/dist/dynamic/components/Toolbar/package.json +1 -1
- package/dist/dynamic/components/Tooltip/package.json +1 -1
- package/dist/dynamic/components/TreeView/package.json +1 -1
- package/dist/dynamic/components/Truncate/package.json +1 -1
- package/dist/dynamic/components/Wizard/hooks/package.json +1 -1
- package/dist/dynamic/components/Wizard/package.json +1 -1
- package/dist/dynamic/deprecated/components/Chip/package.json +1 -1
- package/dist/dynamic/deprecated/components/DragDrop/package.json +1 -1
- package/dist/dynamic/deprecated/components/DualListSelector/package.json +1 -1
- package/dist/dynamic/deprecated/components/Modal/package.json +1 -1
- package/dist/dynamic/deprecated/components/Tile/package.json +1 -1
- package/dist/dynamic/deprecated/components/Wizard/package.json +1 -1
- package/dist/dynamic/deprecated/components/package.json +1 -1
- package/dist/dynamic/helpers/FocusTrap/FocusTrap/package.json +1 -1
- package/dist/dynamic/helpers/GenerateId/GenerateId/package.json +1 -1
- package/dist/dynamic/helpers/KeyboardHandler/package.json +1 -1
- package/dist/dynamic/helpers/OUIA/ouia/package.json +1 -1
- package/dist/dynamic/helpers/Popper/Popper/package.json +1 -1
- package/dist/dynamic/helpers/constants/package.json +1 -1
- package/dist/dynamic/helpers/datetimeUtils/package.json +1 -1
- package/dist/dynamic/helpers/fileUtils/package.json +1 -1
- package/dist/dynamic/helpers/htmlConstants/package.json +1 -1
- package/dist/dynamic/helpers/package.json +1 -1
- package/dist/dynamic/helpers/resizeObserver/package.json +1 -1
- package/dist/dynamic/helpers/typeUtils/package.json +1 -1
- package/dist/dynamic/helpers/useInterval/package.json +1 -1
- package/dist/dynamic/helpers/useIsomorphicLayout/package.json +1 -1
- package/dist/dynamic/helpers/useUnmountEffect/package.json +1 -1
- package/dist/dynamic/helpers/util/package.json +1 -1
- package/dist/dynamic/layouts/Bullseye/package.json +1 -1
- package/dist/dynamic/layouts/Flex/package.json +1 -1
- package/dist/dynamic/layouts/Gallery/package.json +1 -1
- package/dist/dynamic/layouts/Grid/package.json +1 -1
- package/dist/dynamic/layouts/Level/package.json +1 -1
- package/dist/dynamic/layouts/Split/package.json +1 -1
- package/dist/dynamic/layouts/Stack/package.json +1 -1
- package/dist/dynamic/styles/package.json +1 -1
- package/dist/esm/components/DescriptionList/DescriptionListTermHelpTextButton.d.ts.map +1 -1
- package/dist/esm/components/DescriptionList/DescriptionListTermHelpTextButton.js +12 -1
- package/dist/esm/components/DescriptionList/DescriptionListTermHelpTextButton.js.map +1 -1
- package/dist/esm/components/Label/Label.d.ts +2 -0
- package/dist/esm/components/Label/Label.d.ts.map +1 -1
- package/dist/esm/components/Label/Label.js +2 -2
- package/dist/esm/components/Label/Label.js.map +1 -1
- package/dist/esm/demos/DashboardHeader.d.ts.map +1 -1
- package/dist/esm/demos/DashboardHeader.js +24 -4
- package/dist/esm/demos/DashboardHeader.js.map +1 -1
- package/dist/esm/helpers/util.d.ts.map +1 -1
- package/dist/esm/helpers/util.js +1 -3
- package/dist/esm/helpers/util.js.map +1 -1
- package/dist/js/components/DescriptionList/DescriptionListTermHelpTextButton.d.ts.map +1 -1
- package/dist/js/components/DescriptionList/DescriptionListTermHelpTextButton.js +12 -1
- package/dist/js/components/DescriptionList/DescriptionListTermHelpTextButton.js.map +1 -1
- package/dist/js/components/Label/Label.d.ts +2 -0
- package/dist/js/components/Label/Label.d.ts.map +1 -1
- package/dist/js/components/Label/Label.js +2 -2
- package/dist/js/components/Label/Label.js.map +1 -1
- package/dist/js/demos/DashboardHeader.d.ts.map +1 -1
- package/dist/js/demos/DashboardHeader.js +23 -3
- package/dist/js/demos/DashboardHeader.js.map +1 -1
- package/dist/js/helpers/util.d.ts.map +1 -1
- package/dist/js/helpers/util.js +1 -4
- package/dist/js/helpers/util.js.map +1 -1
- package/dist/umd/assets/{output-B4gERJ2D.css → output-CZVwGvhk.css} +18559 -18559
- package/dist/umd/react-core.min.js +1 -1
- package/helpers/package.json +1 -1
- package/layouts/package.json +1 -1
- package/next/package.json +1 -1
- package/package.json +2 -2
- package/src/components/Button/examples/Button.md +13 -4
- package/src/components/Button/examples/ButtonCustomComponent.tsx +8 -0
- package/src/components/DescriptionList/DescriptionListTermHelpTextButton.tsx +29 -11
- package/src/components/Label/Label.tsx +4 -1
- package/src/components/Label/examples/Label.md +20 -3
- package/src/components/Label/examples/{LabelRouterLink.tsx → LabelCustomRender.tsx} +4 -4
- package/src/components/Masthead/examples/Masthead.md +16 -4
- package/src/components/Masthead/examples/{MastheadIconRouterLink.tsx → MastheadLogoCustomComponent.tsx} +2 -3
- package/src/components/Menu/examples/Menu.md +12 -0
- package/src/demos/CustomMenus/CustomMenus.md +0 -2
- package/src/demos/DashboardHeader.tsx +46 -5
- package/src/demos/Masthead.md +0 -1
- package/src/demos/Page.md +3 -2
- package/src/demos/examples/Masthead/MastheadWithUtilitiesAndUserDropdownMenu.tsx +8 -7
- package/src/demos/examples/Page/PageContextSelector.tsx +19 -4
- package/src/demos/examples/Wizard/InModal.tsx +0 -1
- package/src/demos/examples/Wizard/InModalWithDrawer.tsx +1 -3
- package/src/demos/examples/Wizard/InModalWithDrawerInformationalStep.tsx +1 -3
- package/src/demos/examples/Wizard/InPage.tsx +1 -1
- package/src/demos/examples/Wizard/InPageWithDrawer.tsx +2 -3
- package/src/demos/examples/Wizard/InPageWithDrawerInformationalStep.tsx +2 -3
- package/src/helpers/util.ts +2 -3
- package/src/components/Button/examples/ButtonRouterLink.tsx +0 -9
package/helpers/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@patternfly/react-core-helpers","main":"../dist/js/helpers/index.js","module":"../dist/esm/helpers/index.js","typings":"../dist/esm/helpers/index.d.ts","version":"6.2.0-prerelease.
|
|
1
|
+
{"name":"@patternfly/react-core-helpers","main":"../dist/js/helpers/index.js","module":"../dist/esm/helpers/index.js","typings":"../dist/esm/helpers/index.d.ts","version":"6.2.0-prerelease.20","private":true}
|
package/layouts/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@patternfly/react-core-layouts","main":"../dist/js/layouts/index.js","module":"../dist/esm/layouts/index.js","typings":"../dist/esm/layouts/index.d.ts","version":"6.2.0-prerelease.
|
|
1
|
+
{"name":"@patternfly/react-core-layouts","main":"../dist/js/layouts/index.js","module":"../dist/esm/layouts/index.js","typings":"../dist/esm/layouts/index.d.ts","version":"6.2.0-prerelease.20","private":true}
|
package/next/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@patternfly/react-core-next","main":"../dist/js/next/index.js","module":"../dist/esm/next/index.js","typings":"../dist/esm/next/index.d.ts","version":"6.2.0-prerelease.
|
|
1
|
+
{"name":"@patternfly/react-core-next","main":"../dist/js/next/index.js","module":"../dist/esm/next/index.js","typings":"../dist/esm/next/index.d.ts","version":"6.2.0-prerelease.20","private":true}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@patternfly/react-core",
|
|
3
|
-
"version": "6.2.0-prerelease.
|
|
3
|
+
"version": "6.2.0-prerelease.21",
|
|
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",
|
|
@@ -63,5 +63,5 @@
|
|
|
63
63
|
"react": "^17 || ^18",
|
|
64
64
|
"react-dom": "^17 || ^18"
|
|
65
65
|
},
|
|
66
|
-
"gitHead": "
|
|
66
|
+
"gitHead": "a7ed28e1cb39269fe84e6ca2dd3585df0d9622b2"
|
|
67
67
|
}
|
|
@@ -14,7 +14,6 @@ import ArrowRightIcon from '@patternfly/react-icons/dist/esm/icons/arrow-right-i
|
|
|
14
14
|
import UploadIcon from '@patternfly/react-icons/dist/esm/icons/upload-icon';
|
|
15
15
|
import BellIcon from '@patternfly/react-icons/dist/esm/icons/bell-icon';
|
|
16
16
|
import QuestionCircleIcon from '@patternfly/react-icons/dist/esm/icons/question-circle-icon';
|
|
17
|
-
import { Link } from '@reach/router';
|
|
18
17
|
|
|
19
18
|
## Examples
|
|
20
19
|
|
|
@@ -86,11 +85,11 @@ Inline links should use `component="span"` and the `isInline` property to wrap i
|
|
|
86
85
|
```ts file="./ButtonInlineSpanLink.tsx"
|
|
87
86
|
```
|
|
88
87
|
|
|
89
|
-
###
|
|
88
|
+
### Custom component
|
|
90
89
|
|
|
91
|
-
|
|
90
|
+
In addition to being able to pass a string to the `component` property, you can provide more fine-tuned customization by passing a callback that returns a component.
|
|
92
91
|
|
|
93
|
-
```ts file="./
|
|
92
|
+
```ts file="./ButtonCustomComponent.tsx"
|
|
94
93
|
```
|
|
95
94
|
|
|
96
95
|
### Aria-disabled examples
|
|
@@ -124,3 +123,13 @@ Stateful buttons are ideal for displaying the state of notifications. Use `varia
|
|
|
124
123
|
|
|
125
124
|
```ts file="./ButtonStateful.tsx"
|
|
126
125
|
```
|
|
126
|
+
|
|
127
|
+
## Using router links
|
|
128
|
+
|
|
129
|
+
Router links can be used for in-app linking in React environments to prevent page reloading. To use a `Link` component from a router package, you can follow our [custom component example](#custom-component) and pass a callback to the `component` property of the `Button`:
|
|
130
|
+
|
|
131
|
+
```nolive
|
|
132
|
+
<Button variant="link" component={(props: any) => <Link {...props} to="#" />}>
|
|
133
|
+
Router link
|
|
134
|
+
</Button>
|
|
135
|
+
```
|
|
@@ -13,15 +13,33 @@ export const DescriptionListTermHelpTextButton: React.FunctionComponent<Descript
|
|
|
13
13
|
children,
|
|
14
14
|
className,
|
|
15
15
|
...props
|
|
16
|
-
}: DescriptionListTermHelpTextButtonProps) =>
|
|
17
|
-
<
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
);
|
|
16
|
+
}: DescriptionListTermHelpTextButtonProps) => {
|
|
17
|
+
const helpTextRef = React.createRef<HTMLSpanElement>();
|
|
18
|
+
|
|
19
|
+
const handleKeys = (event: React.KeyboardEvent<HTMLSpanElement>) => {
|
|
20
|
+
if (!helpTextRef.current || helpTextRef.current !== (event.target as HTMLElement)) {
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const key = event.key;
|
|
25
|
+
if (key === 'Enter' || key === ' ') {
|
|
26
|
+
event.preventDefault();
|
|
27
|
+
helpTextRef.current.click();
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
return (
|
|
32
|
+
<span
|
|
33
|
+
ref={helpTextRef}
|
|
34
|
+
className={css(className, styles.descriptionListText, styles.modifiers.helpText)}
|
|
35
|
+
role="button"
|
|
36
|
+
type="button"
|
|
37
|
+
tabIndex={0}
|
|
38
|
+
onKeyDown={(event) => handleKeys(event)}
|
|
39
|
+
{...props}
|
|
40
|
+
>
|
|
41
|
+
{children}
|
|
42
|
+
</span>
|
|
43
|
+
);
|
|
44
|
+
};
|
|
27
45
|
DescriptionListTermHelpTextButton.displayName = 'DescriptionListTermHelpTextButton';
|
|
@@ -31,6 +31,8 @@ export interface LabelProps extends React.HTMLProps<HTMLSpanElement> {
|
|
|
31
31
|
isDisabled?: boolean;
|
|
32
32
|
/** Flag indicating the label is editable. */
|
|
33
33
|
isEditable?: boolean;
|
|
34
|
+
/** Flag indicating the label is clickable. This flag will automatically be set if a href is passed, or if an onClick handler is passed and the label is not an overflow or add variant. This should be manually set when using the render prop. */
|
|
35
|
+
isClickable?: boolean;
|
|
34
36
|
/** Additional props passed to the editable label text div. Optionally passing onInput and onBlur callbacks will allow finer custom text input control. */
|
|
35
37
|
editableProps?: any;
|
|
36
38
|
/** Callback when an editable label completes an edit. */
|
|
@@ -110,6 +112,7 @@ export const Label: React.FunctionComponent<LabelProps> = ({
|
|
|
110
112
|
isCompact = false,
|
|
111
113
|
isDisabled = false,
|
|
112
114
|
isEditable = false,
|
|
115
|
+
isClickable: isClickableProp = false,
|
|
113
116
|
editableProps,
|
|
114
117
|
textMaxWidth,
|
|
115
118
|
tooltipPosition,
|
|
@@ -132,7 +135,7 @@ export const Label: React.FunctionComponent<LabelProps> = ({
|
|
|
132
135
|
|
|
133
136
|
const isOverflowLabel = variant === 'overflow';
|
|
134
137
|
const isAddLabel = variant === 'add';
|
|
135
|
-
const isClickable = (onLabelClick && !isOverflowLabel && !isAddLabel) || href;
|
|
138
|
+
const isClickable = isClickableProp || (onLabelClick && !isOverflowLabel && !isAddLabel) || href;
|
|
136
139
|
|
|
137
140
|
let _icon;
|
|
138
141
|
if (status) {
|
|
@@ -7,7 +7,6 @@ propComponents: ['Label', 'LabelGroup']
|
|
|
7
7
|
|
|
8
8
|
import CubeIcon from '@patternfly/react-icons/dist/esm/icons/cube-icon';
|
|
9
9
|
import InfoCircleIcon from '@patternfly/react-icons/dist/esm/icons/info-circle-icon';
|
|
10
|
-
import { Link } from '@reach/router';
|
|
11
10
|
import './Label.css';
|
|
12
11
|
|
|
13
12
|
## Examples
|
|
@@ -30,9 +29,11 @@ import './Label.css';
|
|
|
30
29
|
|
|
31
30
|
```
|
|
32
31
|
|
|
33
|
-
### Label with
|
|
32
|
+
### Label with custom render
|
|
34
33
|
|
|
35
|
-
|
|
34
|
+
Labels may be passed a custom renderer to display customized content or for use with router components. When using a custom render, `isClickable` may also be passed to remove the underline text decoration of anchors or router links.
|
|
35
|
+
|
|
36
|
+
```ts file="LabelCustomRender.tsx"
|
|
36
37
|
|
|
37
38
|
```
|
|
38
39
|
|
|
@@ -97,3 +98,19 @@ The contents of a label group can be modified by removing labels or adding new o
|
|
|
97
98
|
```ts file="LabelGroupEditableAdd.tsx"
|
|
98
99
|
|
|
99
100
|
```
|
|
101
|
+
|
|
102
|
+
## Using router links
|
|
103
|
+
|
|
104
|
+
Router links can be used for in-app linking in React environments to prevent page reloading. To use a `Link` component from a router package, you can use the `render` property of the `Label`:
|
|
105
|
+
|
|
106
|
+
```nolive
|
|
107
|
+
<Label
|
|
108
|
+
render={({ className, content, componentRef }) => (
|
|
109
|
+
<Link to="/" className={className} innerRef={componentRef}>
|
|
110
|
+
{content}
|
|
111
|
+
</Link>
|
|
112
|
+
)}
|
|
113
|
+
>
|
|
114
|
+
Label router link
|
|
115
|
+
</Label>
|
|
116
|
+
```
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Label } from '@patternfly/react-core';
|
|
3
3
|
import InfoCircleIcon from '@patternfly/react-icons/dist/esm/icons/info-circle-icon';
|
|
4
|
-
import { Link } from '@reach/router';
|
|
5
4
|
|
|
6
|
-
export const
|
|
5
|
+
export const LabelCustomRender: React.FunctionComponent = () => (
|
|
7
6
|
<Label
|
|
8
7
|
color="blue"
|
|
9
8
|
icon={<InfoCircleIcon />}
|
|
10
9
|
onClose={() => Function.prototype}
|
|
11
10
|
render={({ className, content, componentRef }) => (
|
|
12
|
-
<
|
|
11
|
+
<a className={className} ref={componentRef}>
|
|
13
12
|
{content}
|
|
14
|
-
</
|
|
13
|
+
</a>
|
|
15
14
|
)}
|
|
16
15
|
textMaxWidth="16ch"
|
|
16
|
+
isClickable
|
|
17
17
|
>
|
|
18
18
|
Blue label router link with icon that overflows
|
|
19
19
|
</Label>
|
|
@@ -6,12 +6,11 @@ propComponents: ['Masthead', 'MastheadToggle', 'MastheadMain', 'MastheadBrand',
|
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
import BarsIcon from '@patternfly/react-icons/dist/js/icons/bars-icon';
|
|
9
|
-
import { Link } from '@reach/router';
|
|
10
9
|
import pfIcon from '../../assets/PF-HorizontalLogo-Color.svg';
|
|
11
10
|
|
|
12
11
|
To maintain proper layout and formatting, a `<Masthead>` should contain both a `<MastheadMain>` and `<MastheadContent>` component.
|
|
13
12
|
|
|
14
|
-
|
|
13
|
+
Mastheads contain the `<MastheadMain>` that wraps a `<PageToggleButton>` and `<MastheadBrand>`. The `<MastheadBrand>` wraps `<MastheadLogo>`. The masthead also contains the page's header toolbar within `<MastheadContent>`.
|
|
15
14
|
|
|
16
15
|
## Examples
|
|
17
16
|
|
|
@@ -45,7 +44,20 @@ To maintain proper layout and formatting, a `<Masthead>` should contain both a `
|
|
|
45
44
|
```ts file="./MastheadInsets.tsx"
|
|
46
45
|
```
|
|
47
46
|
|
|
48
|
-
###
|
|
47
|
+
### Custom logo component
|
|
49
48
|
|
|
50
|
-
|
|
49
|
+
In addition to being able to pass a string to the `component` property of `MastheadLogo`, you can provide more fine-tuned customization by passing a callback that returns a component.
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
```ts file="./MastheadLogoCustomComponent.tsx"
|
|
51
53
|
```
|
|
54
|
+
|
|
55
|
+
## Using router links
|
|
56
|
+
|
|
57
|
+
Router links can be used for in-app linking in React environments to prevent page reloading. To use a `Link` component from a router package, you can follow our [custom logo component example](#custom-logo-component) and pass a callback to the `component` property of the `MastheadLogo`:
|
|
58
|
+
|
|
59
|
+
```nolive
|
|
60
|
+
<MastheadLogo component={(props) => <Link {...props} to="#" />}>
|
|
61
|
+
<Brand ...brandProps />
|
|
62
|
+
</MastheadLogo>
|
|
63
|
+
```
|
|
@@ -10,17 +10,16 @@ import {
|
|
|
10
10
|
Brand
|
|
11
11
|
} from '@patternfly/react-core';
|
|
12
12
|
import BarsIcon from '@patternfly/react-icons/dist/js/icons/bars-icon';
|
|
13
|
-
import { Link } from '@reach/router';
|
|
14
13
|
import pfIcon from '../../assets/PF-HorizontalLogo-Color.svg';
|
|
15
14
|
|
|
16
|
-
export const
|
|
15
|
+
export const MastheadLogoCustomComponent: React.FunctionComponent = () => (
|
|
17
16
|
<Masthead id="icon-router-link">
|
|
18
17
|
<MastheadMain>
|
|
19
18
|
<MastheadToggle>
|
|
20
19
|
<Button variant="plain" onClick={() => {}} aria-label="Global navigation" icon={<BarsIcon />} />
|
|
21
20
|
</MastheadToggle>
|
|
22
21
|
<MastheadBrand>
|
|
23
|
-
<MastheadLogo component={(props) => <
|
|
22
|
+
<MastheadLogo component={(props) => <a {...props} href="#" />}>
|
|
24
23
|
<Brand src={pfIcon} alt="PatternFly" heights={{ default: '36px' }} />
|
|
25
24
|
</MastheadLogo>
|
|
26
25
|
</MastheadBrand>
|
|
@@ -229,3 +229,15 @@ To control the height of a menu, use the `maxMenuHeight` property. Selecting the
|
|
|
229
229
|
```ts file="MenuFilterDrilldown.tsx"
|
|
230
230
|
|
|
231
231
|
```
|
|
232
|
+
|
|
233
|
+
## Using router links
|
|
234
|
+
|
|
235
|
+
Router links can be used for in-app linking in React environments to prevent page reloading. To use a `Link` component from a router package, you can pass a callback to the `component` property of the `MenuItem`:
|
|
236
|
+
|
|
237
|
+
```nolive
|
|
238
|
+
<MenuItem
|
|
239
|
+
component={(props) => <Link {...props} to="#" />}
|
|
240
|
+
>
|
|
241
|
+
{...Link Content}
|
|
242
|
+
</MenuItem>
|
|
243
|
+
```
|
|
@@ -4,8 +4,6 @@ section: components
|
|
|
4
4
|
subsection: menus
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
import { Link } from '@reach/router';
|
|
8
|
-
|
|
9
7
|
import CogIcon from '@patternfly/react-icons/dist/esm/icons/cog-icon';
|
|
10
8
|
import EllipsisVIcon from '@patternfly/react-icons/dist/esm/icons/ellipsis-v-icon';
|
|
11
9
|
import TableIcon from '@patternfly/react-icons/dist/esm/icons/table-icon';
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React, { useState } from 'react';
|
|
2
2
|
import {
|
|
3
3
|
Avatar,
|
|
4
|
-
Brand,
|
|
5
4
|
Button,
|
|
6
5
|
ButtonVariant,
|
|
7
6
|
Divider,
|
|
@@ -30,7 +29,6 @@ import HelpIcon from '@patternfly/react-icons/dist/esm/icons/help-icon';
|
|
|
30
29
|
import QuestionCircleIcon from '@patternfly/react-icons/dist/esm/icons/question-circle-icon';
|
|
31
30
|
import EllipsisVIcon from '@patternfly/react-icons/dist/esm/icons/ellipsis-v-icon';
|
|
32
31
|
import imgAvatar from '@patternfly/react-core/src/components/assets/avatarImg.svg';
|
|
33
|
-
import pfLogo from '@patternfly/react-core/src/demos/assets/PF-HorizontalLogo-Color.svg';
|
|
34
32
|
|
|
35
33
|
interface DashboardHeaderProps {
|
|
36
34
|
/** Render custom notification badge */
|
|
@@ -42,6 +40,51 @@ export const DashboardHeader: React.FC<DashboardHeaderProps> = ({ notificationBa
|
|
|
42
40
|
const [isKebabDropdownOpen, setIsKebabDropdownOpen] = useState(false);
|
|
43
41
|
const [isFullKebabDropdownOpen, setIsFullKebabDropdownOpen] = useState(false);
|
|
44
42
|
|
|
43
|
+
const patternflyLogo = (
|
|
44
|
+
<svg height="40px" viewBox="0 0 679 158">
|
|
45
|
+
<title>PatternFly</title>
|
|
46
|
+
<defs>
|
|
47
|
+
<linearGradient x1="68%" y1="2.25860997e-13%" x2="32%" y2="100%" id="linearGradient-website-masthead">
|
|
48
|
+
<stop stopColor="#2B9AF3" offset="0%"></stop>
|
|
49
|
+
<stop stopColor="#73BCF7" stopOpacity="0.502212631" offset="100%"></stop>
|
|
50
|
+
</linearGradient>
|
|
51
|
+
</defs>
|
|
52
|
+
<g stroke="none" strokeWidth="1" fill="none" fillRule="evenodd">
|
|
53
|
+
<g
|
|
54
|
+
transform="translate(206.000000, 45.750000)"
|
|
55
|
+
fill="var(--pf-t--global--text--color--regular)"
|
|
56
|
+
fillRule="nonzero"
|
|
57
|
+
>
|
|
58
|
+
<path d="M0,65.25 L0,2.25 L33.21,2.25 C37.35,2.25 41.025,3.135 44.235,4.905 C47.445,6.675 49.98,9.09 51.84,12.15 C53.7,15.21 54.63,18.72 54.63,22.68 C54.63,26.46 53.7,29.865 51.84,32.895 C49.98,35.925 47.43,38.31 44.19,40.05 C40.95,41.79 37.29,42.66 33.21,42.66 L15.48,42.66 L15.48,65.25 L0,65.25 Z M15.48,29.88 L31.41,29.88 C33.69,29.88 35.52,29.22 36.9,27.9 C38.28,26.58 38.97,24.87 38.97,22.77 C38.97,20.61 38.28,18.855 36.9,17.505 C35.52,16.155 33.69,15.48 31.41,15.48 L15.48,15.48 L15.48,29.88 Z"></path>
|
|
59
|
+
<path d="M77.04,66.06 C73.68,66.06 70.695,65.43 68.085,64.17 C65.475,62.91 63.435,61.17 61.965,58.95 C60.495,56.73 59.76,54.18 59.76,51.3 C59.76,46.74 61.485,43.215 64.935,40.725 C68.385,38.235 73.2,36.99 79.38,36.99 C83.1,36.99 86.7,37.44 90.18,38.34 L90.18,36 C90.18,31.26 87.15,28.89 81.09,28.89 C77.49,28.89 72.69,30.15 66.69,32.67 L61.47,21.96 C69.15,18.48 76.56,16.74 83.7,16.74 C90.3,16.74 95.43,18.315 99.09,21.465 C102.75,24.615 104.58,29.04 104.58,34.74 L104.58,65.25 L90.18,65.25 L90.18,62.37 C88.26,63.69 86.235,64.635 84.105,65.205 C81.975,65.775 79.62,66.06 77.04,66.06 Z M73.62,51.03 C73.62,52.53 74.28,53.7 75.6,54.54 C76.92,55.38 78.75,55.8 81.09,55.8 C84.69,55.8 87.72,55.05 90.18,53.55 L90.18,47.43 C87.42,46.71 84.54,46.35 81.54,46.35 C79.02,46.35 77.07,46.755 75.69,47.565 C74.31,48.375 73.62,49.53 73.62,51.03 Z"></path>
|
|
60
|
+
<path d="M137.25,65.88 C125.73,65.88 119.97,60.84 119.97,50.76 L119.97,29.79 L110.34,29.79 L110.34,17.64 L119.97,17.64 L119.97,5.4 L134.55,2.25 L134.55,17.64 L147.87,17.64 L147.87,29.79 L134.55,29.79 L134.55,47.88 C134.55,49.98 135.015,51.465 135.945,52.335 C136.875,53.205 138.51,53.64 140.85,53.64 C143.01,53.64 145.2,53.31 147.42,52.65 L147.42,64.44 C146.1,64.86 144.42,65.205 142.38,65.475 C140.34,65.745 138.63,65.88 137.25,65.88 Z"></path>
|
|
61
|
+
<path d="M177.57,65.88 C166.05,65.88 160.29,60.84 160.29,50.76 L160.29,29.79 L150.66,29.79 L150.66,17.64 L160.29,17.64 L160.29,5.4 L174.87,2.25 L174.87,17.64 L188.19,17.64 L188.19,29.79 L174.87,29.79 L174.87,47.88 C174.87,49.98 175.335,51.465 176.265,52.335 C177.195,53.205 178.83,53.64 181.17,53.64 C183.33,53.64 185.52,53.31 187.74,52.65 L187.74,64.44 C186.42,64.86 184.74,65.205 182.7,65.475 C180.66,65.745 178.95,65.88 177.57,65.88 Z"></path>
|
|
62
|
+
<path d="M217.62,66.15 C212.76,66.15 208.365,65.055 204.435,62.865 C200.505,60.675 197.4,57.72 195.12,54 C192.84,50.28 191.7,46.11 191.7,41.49 C191.7,36.87 192.795,32.7 194.985,28.98 C197.175,25.26 200.16,22.305 203.94,20.115 C207.72,17.925 211.92,16.83 216.54,16.83 C221.22,16.83 225.36,17.955 228.96,20.205 C232.56,22.455 235.395,25.53 237.465,29.43 C239.535,33.33 240.57,37.8 240.57,42.84 L240.57,46.44 L206.64,46.44 C207.6,48.66 209.1,50.475 211.14,51.885 C213.18,53.295 215.58,54 218.34,54 C222.42,54 225.6,52.8 227.88,50.4 L237.51,58.95 C234.51,61.47 231.435,63.3 228.285,64.44 C225.135,65.58 221.58,66.15 217.62,66.15 Z M206.37,36.27 L226.26,36.27 C225.48,33.99 224.205,32.16 222.435,30.78 C220.665,29.4 218.61,28.71 216.27,28.71 C213.87,28.71 211.8,29.37 210.06,30.69 C208.32,32.01 207.09,33.87 206.37,36.27 Z"></path>
|
|
63
|
+
<path d="M247.41,65.25 L247.41,17.64 L261.99,17.64 L261.99,22.41 C265.23,18.51 269.4,16.56 274.5,16.56 C277.08,16.62 278.91,17.01 279.99,17.73 L279.99,30.42 C277.95,29.46 275.64,28.98 273.06,28.98 C270.78,28.98 268.665,29.505 266.715,30.555 C264.765,31.605 263.19,33.09 261.99,35.01 L261.99,65.25 L247.41,65.25 Z"></path>
|
|
64
|
+
<path d="M286.29,65.25 L286.29,17.64 L300.87,17.64 L300.87,20.88 C304.47,18.12 308.73,16.74 313.65,16.74 C317.37,16.74 320.655,17.55 323.505,19.17 C326.355,20.79 328.59,23.04 330.21,25.92 C331.83,28.8 332.64,32.13 332.64,35.91 L332.64,65.25 L318.06,65.25 L318.06,37.89 C318.06,35.25 317.28,33.15 315.72,31.59 C314.16,30.03 312.06,29.25 309.42,29.25 C305.76,29.25 302.91,30.51 300.87,33.03 L300.87,65.25 L286.29,65.25 Z"></path>
|
|
65
|
+
<polygon points="342 65.25 342 2.25 392.04 2.25 392.04 15.66 357.48 15.66 357.48 27.45 380.52 27.45 380.52 40.41 357.48 40.41 357.48 65.25"></polygon>
|
|
66
|
+
<polygon points="399.96 65.25 399.96 2.25 414.54 0 414.54 65.25"></polygon>
|
|
67
|
+
<path d="M429.21,84.69 C428.07,84.69 426.96,84.645 425.88,84.555 C424.8,84.465 423.9,84.33 423.18,84.15 L423.18,71.73 C424.38,71.97 425.88,72.09 427.68,72.09 C432.36,72.09 435.51,70.05 437.13,65.97 L437.13,65.88 L418.86,17.64 L434.97,17.64 L445.5,47.61 L457.74,17.64 L473.49,17.64 L452.16,67.68 C450.42,71.82 448.5,75.135 446.4,77.625 C444.3,80.115 441.87,81.915 439.11,83.025 C436.35,84.135 433.05,84.69 429.21,84.69 Z"></path>
|
|
68
|
+
</g>
|
|
69
|
+
<g transform="translate(0.000000, 0.000000)">
|
|
70
|
+
<path
|
|
71
|
+
d="M61.826087,0 L158,0 L158,96.173913 L147.695652,96.173913 C100.271201,96.173913 61.826087,57.7287992 61.826087,10.3043478 L61.826087,0 L61.826087,0 Z"
|
|
72
|
+
fill="var(--pf-t--color--blue--50)"
|
|
73
|
+
></path>
|
|
74
|
+
<path
|
|
75
|
+
d="M158,3.43478261 L65.2608696,158 L138,158 C149.045695,158 158,149.045695 158,138 L158,3.43478261 L158,3.43478261 Z"
|
|
76
|
+
fill="url(#linearGradient-website-masthead)"
|
|
77
|
+
></path>
|
|
78
|
+
<path
|
|
79
|
+
d="M123.652174,-30.9130435 L30.9130435,123.652174 L103.652174,123.652174 C114.697869,123.652174 123.652174,114.697869 123.652174,103.652174 L123.652174,-30.9130435 L123.652174,-30.9130435 Z"
|
|
80
|
+
fill="url(#linearGradient-website-masthead)"
|
|
81
|
+
transform="translate(77.282609, 46.369565) scale(1, -1) rotate(90.000000) translate(-77.282609, -46.369565) "
|
|
82
|
+
></path>
|
|
83
|
+
</g>
|
|
84
|
+
</g>
|
|
85
|
+
</svg>
|
|
86
|
+
);
|
|
87
|
+
|
|
45
88
|
const kebabDropdownItems = (
|
|
46
89
|
<>
|
|
47
90
|
<DropdownItem>
|
|
@@ -94,9 +137,7 @@ export const DashboardHeader: React.FC<DashboardHeaderProps> = ({ notificationBa
|
|
|
94
137
|
</PageToggleButton>
|
|
95
138
|
</MastheadToggle>
|
|
96
139
|
<MastheadBrand>
|
|
97
|
-
<MastheadLogo>
|
|
98
|
-
<Brand src={pfLogo} alt="PatternFly" heights={{ default: '36px' }} />
|
|
99
|
-
</MastheadLogo>
|
|
140
|
+
<MastheadLogo>{patternflyLogo}</MastheadLogo>
|
|
100
141
|
</MastheadBrand>
|
|
101
142
|
</MastheadMain>
|
|
102
143
|
<MastheadContent>
|
package/src/demos/Masthead.md
CHANGED
|
@@ -13,7 +13,6 @@ import ThIcon from '@patternfly/react-icons/dist/esm/icons/th-icon';
|
|
|
13
13
|
import imgAvatar from '@patternfly/react-core/src/components/assets/avatarImg.svg';
|
|
14
14
|
import pfIcon from './assets/pf-logo-small.svg';
|
|
15
15
|
import pfLogo from './assets/PF-HorizontalLogo-Color.svg';
|
|
16
|
-
import { Link } from '@reach/router';
|
|
17
16
|
|
|
18
17
|
## Demos
|
|
19
18
|
|
package/src/demos/Page.md
CHANGED
|
@@ -14,7 +14,6 @@ import LightbulbIcon from '@patternfly/react-icons/dist/esm/icons/lightbulb-icon
|
|
|
14
14
|
import EllipsisVIcon from '@patternfly/react-icons/dist/esm/icons/ellipsis-v-icon';
|
|
15
15
|
import pfLogo from '@patternfly/react-core/src/demos/assets/PF-HorizontalLogo-Color.svg';
|
|
16
16
|
|
|
17
|
-
|
|
18
17
|
- All examples set the `isManagedSidebar` prop on the Page component to have the sidebar automatically close for smaller screen widths. You can also manually control this behavior by not adding the `isManagedSidebar` prop and instead:
|
|
19
18
|
|
|
20
19
|
1. Add an onNavToggle callback to PageHeader
|
|
@@ -44,6 +43,8 @@ This demonstrates a variety of navigation patterns in the context of a full page
|
|
|
44
43
|
|
|
45
44
|
### Context selector/perspective switcher in sidebar
|
|
46
45
|
|
|
46
|
+
When adding a context selector/perspective switcher in a `PageSidebar`, you must manually control the open state of the `PageSidebar` as well as ensure any interactive menu toggles or buttons cannot receive focus. This demo adds a `tabIndex` of `-1` when the sidebar is not expanded to achieve this.
|
|
47
|
+
|
|
47
48
|
```ts file='./examples/Page/PageContextSelector.tsx' isFullscreen
|
|
48
49
|
|
|
49
|
-
```
|
|
50
|
+
```
|
|
@@ -49,7 +49,6 @@ import {
|
|
|
49
49
|
SearchInput,
|
|
50
50
|
Tooltip
|
|
51
51
|
} from '@patternfly/react-core';
|
|
52
|
-
import { Link } from '@reach/router';
|
|
53
52
|
import BarsIcon from '@patternfly/react-icons/dist/esm/icons/bars-icon';
|
|
54
53
|
import EllipsisVIcon from '@patternfly/react-icons/dist/esm/icons/ellipsis-v-icon';
|
|
55
54
|
import CogIcon from '@patternfly/react-icons/dist/esm/icons/cog-icon';
|
|
@@ -185,9 +184,10 @@ export const MastheadWithUtilitiesAndUserDropdownMenu: React.FunctionComponent =
|
|
|
185
184
|
itemId="2"
|
|
186
185
|
id="2"
|
|
187
186
|
isFavorited={favorites.includes('2')}
|
|
188
|
-
|
|
187
|
+
to="#default-link3"
|
|
188
|
+
onClick={(ev) => ev.preventDefault()}
|
|
189
189
|
>
|
|
190
|
-
|
|
190
|
+
Application 3
|
|
191
191
|
</MenuItem>
|
|
192
192
|
<MenuItem
|
|
193
193
|
itemId="3"
|
|
@@ -195,17 +195,18 @@ export const MastheadWithUtilitiesAndUserDropdownMenu: React.FunctionComponent =
|
|
|
195
195
|
isFavorited={favorites.includes('3')}
|
|
196
196
|
isExternalLink
|
|
197
197
|
icon={<img src={pfIcon} />}
|
|
198
|
-
|
|
198
|
+
to="#default-link4"
|
|
199
|
+
onClick={(ev) => ev.preventDefault()}
|
|
199
200
|
>
|
|
200
|
-
|
|
201
|
+
Application 4 with icon
|
|
201
202
|
</MenuItem>
|
|
202
203
|
</MenuList>
|
|
203
204
|
</MenuGroup>,
|
|
204
205
|
<Divider key="group2-divider" />,
|
|
205
206
|
<MenuList key="other-items">
|
|
206
207
|
<MenuItem key="tooltip-app" isFavorited={favorites.includes('4')} itemId="4" id="4">
|
|
207
|
-
<Tooltip content={<div>Launch Application
|
|
208
|
-
<span>Application
|
|
208
|
+
<Tooltip content={<div>Launch Application 4</div>} position="right">
|
|
209
|
+
<span>Application 4 with tooltip</span>
|
|
209
210
|
</Tooltip>
|
|
210
211
|
</MenuItem>
|
|
211
212
|
<MenuItem key="disabled-app" itemId="5" id="5" isDisabled>
|
|
@@ -59,6 +59,11 @@ export const PageStickySectionBreadcrumb: React.FunctionComponent = () => {
|
|
|
59
59
|
const [isFullKebabDropdownOpen, setIsFullKebabDropdownOpen] = React.useState(false);
|
|
60
60
|
const [isContextSelectorOpen, setIsContextSelectorOpen] = React.useState(false);
|
|
61
61
|
const [activeItem, setActiveItem] = React.useState(1);
|
|
62
|
+
const [isSidebarOpen, setIsSidebarOpen] = React.useState(true);
|
|
63
|
+
|
|
64
|
+
const onSidebarToggle = () => {
|
|
65
|
+
setIsSidebarOpen(!isSidebarOpen);
|
|
66
|
+
};
|
|
62
67
|
|
|
63
68
|
const onNavSelect = (_event: React.FormEvent<HTMLInputElement>, selectedItem: NavOnSelectProps) => {
|
|
64
69
|
typeof selectedItem.itemId === 'number' && setActiveItem(selectedItem.itemId);
|
|
@@ -225,7 +230,12 @@ export const PageStickySectionBreadcrumb: React.FunctionComponent = () => {
|
|
|
225
230
|
<Masthead>
|
|
226
231
|
<MastheadMain>
|
|
227
232
|
<MastheadToggle>
|
|
228
|
-
<PageToggleButton
|
|
233
|
+
<PageToggleButton
|
|
234
|
+
variant="plain"
|
|
235
|
+
aria-label="Global navigation"
|
|
236
|
+
isSidebarOpen={isSidebarOpen}
|
|
237
|
+
onSidebarToggle={onSidebarToggle}
|
|
238
|
+
>
|
|
229
239
|
<BarsIcon />
|
|
230
240
|
</PageToggleButton>
|
|
231
241
|
</MastheadToggle>
|
|
@@ -267,7 +277,13 @@ export const PageStickySectionBreadcrumb: React.FunctionComponent = () => {
|
|
|
267
277
|
onSelect={onContextSelectorSelect}
|
|
268
278
|
onOpenChange={(isOpen: boolean) => setIsContextSelectorOpen(isOpen)}
|
|
269
279
|
toggle={(toggleRef: React.Ref<MenuToggleElement>) => (
|
|
270
|
-
<MenuToggle
|
|
280
|
+
<MenuToggle
|
|
281
|
+
tabIndex={isSidebarOpen ? undefined : -1}
|
|
282
|
+
ref={toggleRef}
|
|
283
|
+
onClick={onContextSelectorToggle}
|
|
284
|
+
isExpanded={isContextSelectorOpen}
|
|
285
|
+
isFullWidth
|
|
286
|
+
>
|
|
271
287
|
Developer
|
|
272
288
|
</MenuToggle>
|
|
273
289
|
)}
|
|
@@ -277,7 +293,7 @@ export const PageStickySectionBreadcrumb: React.FunctionComponent = () => {
|
|
|
277
293
|
);
|
|
278
294
|
|
|
279
295
|
const sidebar = (
|
|
280
|
-
<PageSidebar>
|
|
296
|
+
<PageSidebar isSidebarOpen={isSidebarOpen}>
|
|
281
297
|
<PageSidebarBody isContextSelector>{pageContextSelector}</PageSidebarBody>
|
|
282
298
|
<PageSidebarBody>{pageNav}</PageSidebarBody>
|
|
283
299
|
</PageSidebar>
|
|
@@ -304,7 +320,6 @@ export const PageStickySectionBreadcrumb: React.FunctionComponent = () => {
|
|
|
304
320
|
<Page
|
|
305
321
|
masthead={masthead}
|
|
306
322
|
sidebar={sidebar}
|
|
307
|
-
isManagedSidebar
|
|
308
323
|
skipToContent={pageSkipToContent}
|
|
309
324
|
breadcrumb={dashboardBreadcrumb}
|
|
310
325
|
mainContainerId={mainContainerId}
|
|
@@ -4,7 +4,6 @@ import {
|
|
|
4
4
|
Drawer,
|
|
5
5
|
DrawerContent,
|
|
6
6
|
DrawerPanelContent,
|
|
7
|
-
DrawerColorVariant,
|
|
8
7
|
DrawerHead,
|
|
9
8
|
DrawerActions,
|
|
10
9
|
DrawerCloseButton,
|
|
@@ -38,7 +37,7 @@ export const WizardModalWithDrawerDemo: React.FunctionComponent = () => {
|
|
|
38
37
|
<Drawer isInline isExpanded={isDrawerExpanded} onExpand={onExpand}>
|
|
39
38
|
<DrawerContent
|
|
40
39
|
panelContent={
|
|
41
|
-
<DrawerPanelContent widths={{ default: 'width_33' }}
|
|
40
|
+
<DrawerPanelContent widths={{ default: 'width_33' }}>
|
|
42
41
|
<DrawerHead>
|
|
43
42
|
<span tabIndex={isDrawerExpanded ? 0 : -1} ref={drawerRef}>
|
|
44
43
|
Drawer content: {stepName}
|
|
@@ -86,7 +85,6 @@ export const WizardModalWithDrawerDemo: React.FunctionComponent = () => {
|
|
|
86
85
|
descriptionId="wiz-modal-demo-description"
|
|
87
86
|
/>
|
|
88
87
|
}
|
|
89
|
-
height={400}
|
|
90
88
|
>
|
|
91
89
|
<WizardStep body={{ hasNoPadding: true }} name="Information" id="wizard-step-1">
|
|
92
90
|
{createStepContentWithDrawer('Information step')}
|
|
@@ -7,7 +7,6 @@ import {
|
|
|
7
7
|
DrawerCloseButton,
|
|
8
8
|
DrawerContent,
|
|
9
9
|
DrawerPanelContent,
|
|
10
|
-
DrawerColorVariant,
|
|
11
10
|
DrawerHead,
|
|
12
11
|
Flex,
|
|
13
12
|
Modal,
|
|
@@ -39,7 +38,7 @@ export const WizardModalWithDrawerInfoStepDemo: React.FunctionComponent = () =>
|
|
|
39
38
|
<Drawer isInline isExpanded={isDrawerExpanded} onExpand={onExpand}>
|
|
40
39
|
<DrawerContent
|
|
41
40
|
panelContent={
|
|
42
|
-
<DrawerPanelContent widths={{ default: 'width_33' }}
|
|
41
|
+
<DrawerPanelContent widths={{ default: 'width_33' }}>
|
|
43
42
|
<DrawerHead>
|
|
44
43
|
<span tabIndex={isDrawerExpanded ? 0 : -1} ref={drawerRef}>
|
|
45
44
|
Drawer content: {stepName}
|
|
@@ -91,7 +90,6 @@ export const WizardModalWithDrawerInfoStepDemo: React.FunctionComponent = () =>
|
|
|
91
90
|
descriptionId="wiz-modal-demo-description"
|
|
92
91
|
/>
|
|
93
92
|
}
|
|
94
|
-
height={400}
|
|
95
93
|
>
|
|
96
94
|
<WizardStep body={{ hasNoPadding: true }} name="Information" id="wizard-step-1">
|
|
97
95
|
{createStepContentWithDrawer('Information step')}
|
|
@@ -5,7 +5,7 @@ import { DashboardWrapper } from '@patternfly/react-core/src/demos/DashboardWrap
|
|
|
5
5
|
export const WizardFullPage: React.FunctionComponent = () => (
|
|
6
6
|
<React.Fragment>
|
|
7
7
|
<DashboardWrapper hasPageTemplateTitle>
|
|
8
|
-
<PageSection type={PageSectionTypes.wizard}>
|
|
8
|
+
<PageSection hasBodyWrapper={false} type={PageSectionTypes.wizard}>
|
|
9
9
|
<Wizard>
|
|
10
10
|
<WizardStep name="Information" id="wizard-step-1">
|
|
11
11
|
<p>Step 1 content</p>
|
|
@@ -10,7 +10,6 @@ import {
|
|
|
10
10
|
DrawerCloseButton,
|
|
11
11
|
DrawerContent,
|
|
12
12
|
DrawerPanelContent,
|
|
13
|
-
DrawerColorVariant,
|
|
14
13
|
DrawerHead,
|
|
15
14
|
Flex,
|
|
16
15
|
Nav,
|
|
@@ -135,7 +134,7 @@ export const WizardFullPageWithDrawerDemo: React.FunctionComponent = () => {
|
|
|
135
134
|
<Drawer isInline isExpanded={isDrawerExpanded} onExpand={onExpand}>
|
|
136
135
|
<DrawerContent
|
|
137
136
|
panelContent={
|
|
138
|
-
<DrawerPanelContent widths={{ default: 'width_33' }}
|
|
137
|
+
<DrawerPanelContent widths={{ default: 'width_33' }}>
|
|
139
138
|
<DrawerHead>
|
|
140
139
|
<span tabIndex={isDrawerExpanded ? 0 : -1} ref={drawerRef}>
|
|
141
140
|
Drawer content: {stepName}
|
|
@@ -180,7 +179,7 @@ export const WizardFullPageWithDrawerDemo: React.FunctionComponent = () => {
|
|
|
180
179
|
<p>A demo of a wizard in a page.</p>
|
|
181
180
|
</Content>
|
|
182
181
|
</PageSection>
|
|
183
|
-
<PageSection type={PageSectionTypes.wizard}>
|
|
182
|
+
<PageSection hasBodyWrapper={false} type={PageSectionTypes.wizard}>
|
|
184
183
|
<Wizard>
|
|
185
184
|
<WizardStep body={{ hasNoPadding: true }} name="Information" id="wizard-step-1">
|
|
186
185
|
{createStepContentWithDrawer('Information step')}
|
|
@@ -11,7 +11,6 @@ import {
|
|
|
11
11
|
DrawerContent,
|
|
12
12
|
DrawerHead,
|
|
13
13
|
DrawerPanelContent,
|
|
14
|
-
DrawerColorVariant,
|
|
15
14
|
Flex,
|
|
16
15
|
Nav,
|
|
17
16
|
NavItem,
|
|
@@ -135,7 +134,7 @@ export const WizardFullPageWithDrawerInfoStepDemo: React.FunctionComponent = ()
|
|
|
135
134
|
<Drawer isInline isExpanded={isDrawerExpanded} onExpand={onExpand}>
|
|
136
135
|
<DrawerContent
|
|
137
136
|
panelContent={
|
|
138
|
-
<DrawerPanelContent widths={{ default: 'width_33' }}
|
|
137
|
+
<DrawerPanelContent widths={{ default: 'width_33' }}>
|
|
139
138
|
<DrawerHead>
|
|
140
139
|
<span tabIndex={isDrawerExpanded ? 0 : -1} ref={drawerRef}>
|
|
141
140
|
Drawer content: {stepName}
|
|
@@ -184,7 +183,7 @@ export const WizardFullPageWithDrawerInfoStepDemo: React.FunctionComponent = ()
|
|
|
184
183
|
<p>A demo of a wizard in a page.</p>
|
|
185
184
|
</Content>
|
|
186
185
|
</PageSection>
|
|
187
|
-
<PageSection type={PageSectionTypes.wizard} ß>
|
|
186
|
+
<PageSection hasBodyWrapper={false} type={PageSectionTypes.wizard} ß>
|
|
188
187
|
<Wizard>
|
|
189
188
|
<WizardStep body={{ hasNoPadding: true }} name="Information" id="wizard-step-1">
|
|
190
189
|
{createStepContentWithDrawer('Information step')}
|