@patternfly/react-core 6.5.0-prerelease.62 → 6.5.0-prerelease.64
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 +14 -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/Compass/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/Hero/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/AnimationsProvider/AnimationsProvider/package.json +1 -1
- package/dist/dynamic/helpers/AnimationsProvider/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/SSRSafeIds/SSRSafeIds/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/useSSRSafeId/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/dynamic-modules.json +2 -0
- package/dist/esm/components/Compass/Compass.d.ts +9 -1
- package/dist/esm/components/Compass/Compass.d.ts.map +1 -1
- package/dist/esm/components/Compass/Compass.js +2 -2
- package/dist/esm/components/Compass/Compass.js.map +1 -1
- package/dist/esm/components/Compass/CompassDockMain.d.ts +9 -0
- package/dist/esm/components/Compass/CompassDockMain.d.ts.map +1 -0
- package/dist/esm/components/Compass/CompassDockMain.js +10 -0
- package/dist/esm/components/Compass/CompassDockMain.js.map +1 -0
- package/dist/esm/components/Compass/index.d.ts +1 -0
- package/dist/esm/components/Compass/index.d.ts.map +1 -1
- package/dist/esm/components/Compass/index.js +1 -0
- package/dist/esm/components/Compass/index.js.map +1 -1
- package/dist/esm/components/OverflowMenu/OverflowMenu.d.ts +7 -1
- package/dist/esm/components/OverflowMenu/OverflowMenu.d.ts.map +1 -1
- package/dist/esm/components/OverflowMenu/OverflowMenu.js +33 -3
- package/dist/esm/components/OverflowMenu/OverflowMenu.js.map +1 -1
- package/dist/esm/components/Page/Page.d.ts +3 -3
- package/dist/esm/components/Page/Page.d.ts.map +1 -1
- package/dist/esm/components/Toolbar/Toolbar.d.ts +5 -1
- package/dist/esm/components/Toolbar/Toolbar.d.ts.map +1 -1
- package/dist/esm/components/Toolbar/Toolbar.js +2 -2
- package/dist/esm/components/Toolbar/Toolbar.js.map +1 -1
- package/dist/esm/components/Toolbar/ToolbarContent.d.ts +9 -1
- package/dist/esm/components/Toolbar/ToolbarContent.d.ts.map +1 -1
- package/dist/esm/components/Toolbar/ToolbarContent.js +2 -2
- package/dist/esm/components/Toolbar/ToolbarContent.js.map +1 -1
- package/dist/esm/components/Toolbar/ToolbarGroup.d.ts +9 -1
- package/dist/esm/components/Toolbar/ToolbarGroup.d.ts.map +1 -1
- package/dist/esm/components/Toolbar/ToolbarGroup.js +3 -3
- package/dist/esm/components/Toolbar/ToolbarGroup.js.map +1 -1
- package/dist/esm/components/Toolbar/ToolbarItem.d.ts +9 -1
- package/dist/esm/components/Toolbar/ToolbarItem.d.ts.map +1 -1
- package/dist/esm/components/Toolbar/ToolbarItem.js +2 -2
- package/dist/esm/components/Toolbar/ToolbarItem.js.map +1 -1
- package/dist/js/components/Compass/Compass.d.ts +9 -1
- package/dist/js/components/Compass/Compass.d.ts.map +1 -1
- package/dist/js/components/Compass/Compass.js +2 -2
- package/dist/js/components/Compass/Compass.js.map +1 -1
- package/dist/js/components/Compass/CompassDockMain.d.ts +9 -0
- package/dist/js/components/Compass/CompassDockMain.d.ts.map +1 -0
- package/dist/js/components/Compass/CompassDockMain.js +14 -0
- package/dist/js/components/Compass/CompassDockMain.js.map +1 -0
- package/dist/js/components/Compass/index.d.ts +1 -0
- package/dist/js/components/Compass/index.d.ts.map +1 -1
- package/dist/js/components/Compass/index.js +1 -0
- package/dist/js/components/Compass/index.js.map +1 -1
- package/dist/js/components/OverflowMenu/OverflowMenu.d.ts +7 -1
- package/dist/js/components/OverflowMenu/OverflowMenu.d.ts.map +1 -1
- package/dist/js/components/OverflowMenu/OverflowMenu.js +32 -2
- package/dist/js/components/OverflowMenu/OverflowMenu.js.map +1 -1
- package/dist/js/components/Page/Page.d.ts +3 -3
- package/dist/js/components/Page/Page.d.ts.map +1 -1
- package/dist/js/components/Toolbar/Toolbar.d.ts +5 -1
- package/dist/js/components/Toolbar/Toolbar.d.ts.map +1 -1
- package/dist/js/components/Toolbar/Toolbar.js +2 -2
- package/dist/js/components/Toolbar/Toolbar.js.map +1 -1
- package/dist/js/components/Toolbar/ToolbarContent.d.ts +9 -1
- package/dist/js/components/Toolbar/ToolbarContent.d.ts.map +1 -1
- package/dist/js/components/Toolbar/ToolbarContent.js +2 -2
- package/dist/js/components/Toolbar/ToolbarContent.js.map +1 -1
- package/dist/js/components/Toolbar/ToolbarGroup.d.ts +9 -1
- package/dist/js/components/Toolbar/ToolbarGroup.d.ts.map +1 -1
- package/dist/js/components/Toolbar/ToolbarGroup.js +3 -3
- package/dist/js/components/Toolbar/ToolbarGroup.js.map +1 -1
- package/dist/js/components/Toolbar/ToolbarItem.d.ts +9 -1
- package/dist/js/components/Toolbar/ToolbarItem.d.ts.map +1 -1
- package/dist/js/components/Toolbar/ToolbarItem.js +2 -2
- package/dist/js/components/Toolbar/ToolbarItem.js.map +1 -1
- package/dist/umd/assets/{output-C2ilqqsl.css → output-BwoQb44a.css} +22943 -22734
- 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 +6 -6
- package/src/components/Compass/Compass.tsx +24 -2
- package/src/components/Compass/CompassDockMain.tsx +21 -0
- package/src/components/Compass/__tests__/Compass.test.tsx +30 -0
- package/src/components/Compass/__tests__/CompassDockMain.test.tsx +41 -0
- package/src/components/Compass/__tests__/__snapshots__/CompassDockMain.test.tsx.snap +13 -0
- package/src/components/Compass/index.ts +1 -0
- package/src/components/EmptyState/__tests__/EmptyState.test.tsx +2 -2
- package/src/components/EmptyState/__tests__/__snapshots__/EmptyState.test.tsx.snap +2 -2
- package/src/components/MenuToggle/__tests__/__snapshots__/MenuToggle.test.tsx.snap +1 -1
- package/src/components/OverflowMenu/OverflowMenu.tsx +42 -4
- package/src/components/OverflowMenu/__tests__/OverflowMenu.test.tsx +18 -0
- package/src/components/OverflowMenu/examples/OverflowMenu.md +17 -1
- package/src/components/OverflowMenu/examples/OverflowMenuBreakpointOnContainerHeight.tsx +109 -0
- package/src/components/OverflowMenu/examples/OverflowMenuSimpleVertical.tsx +76 -0
- package/src/components/Page/Page.tsx +3 -3
- package/src/components/Toolbar/Toolbar.tsx +9 -1
- package/src/components/Toolbar/ToolbarContent.tsx +12 -2
- package/src/components/Toolbar/ToolbarGroup.tsx +12 -2
- package/src/components/Toolbar/ToolbarItem.tsx +12 -2
- package/src/components/Toolbar/__tests__/Toolbar.test.tsx +63 -2
- package/src/components/Toolbar/__tests__/ToolbarGroup.test.tsx +26 -0
- package/src/components/Toolbar/__tests__/ToolbarItem.test.tsx +26 -0
- package/src/components/Toolbar/examples/Toolbar.md +19 -1
- package/src/components/Toolbar/examples/ToolbarDynamicSticky.tsx +75 -0
- package/src/components/Toolbar/examples/ToolbarVertical.tsx +22 -0
- package/src/demos/Compass/Compass.md +4 -1
- package/src/demos/Compass/examples/CompassDockDemo.tsx +311 -130
- package/src/demos/Nav.md +2 -1
- package/src/demos/examples/Nav/NavDockedNav.tsx +32 -10
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { useRef, useState } from 'react';
|
|
1
|
+
import { useRef, useState, useEffect } from 'react';
|
|
2
2
|
import {
|
|
3
3
|
Compass,
|
|
4
4
|
CompassContent,
|
|
5
5
|
CompassMainHeader,
|
|
6
|
+
CompassDockMain,
|
|
6
7
|
Panel,
|
|
7
8
|
PanelMain,
|
|
8
9
|
PanelMainBody,
|
|
@@ -15,28 +16,27 @@ import {
|
|
|
15
16
|
MastheadBrand,
|
|
16
17
|
MastheadContent,
|
|
17
18
|
MastheadMain,
|
|
19
|
+
MastheadToggle,
|
|
18
20
|
Masthead,
|
|
19
21
|
Toolbar,
|
|
20
22
|
ToolbarContent,
|
|
21
23
|
ToolbarItem,
|
|
22
24
|
ToolbarGroup,
|
|
23
|
-
Dropdown,
|
|
24
|
-
DropdownList,
|
|
25
25
|
MenuToggle,
|
|
26
|
-
DropdownItem,
|
|
27
26
|
Button,
|
|
28
|
-
ButtonVariant,
|
|
29
|
-
Avatar,
|
|
30
27
|
Tooltip,
|
|
31
|
-
Divider
|
|
28
|
+
Divider,
|
|
29
|
+
PageToggleButton
|
|
32
30
|
} from '@patternfly/react-core';
|
|
33
31
|
import CubeIcon from '@patternfly/react-icons/dist/esm/icons/cube-icon';
|
|
34
32
|
import FolderIcon from '@patternfly/react-icons/dist/esm/icons/folder-icon';
|
|
35
33
|
import RhUiQuestionMarkCircleFillIcon from '@patternfly/react-icons/dist/esm/icons/rh-ui-question-mark-circle-fill-icon';
|
|
36
34
|
import CloudIcon from '@patternfly/react-icons/dist/esm/icons/cloud-icon';
|
|
37
35
|
import CodeIcon from '@patternfly/react-icons/dist/esm/icons/code-icon';
|
|
36
|
+
import SearchIcon from '@patternfly/react-icons/dist/esm/icons/search-icon';
|
|
38
37
|
import pfLogo from '../../assets/PF-IconLogo-color.svg';
|
|
39
|
-
import
|
|
38
|
+
import ThIcon from '@patternfly/react-icons/dist/esm/icons/th-icon';
|
|
39
|
+
import globalBreakpointLg from '@patternfly/react-tokens/dist/esm/t_global_breakpoint_lg';
|
|
40
40
|
|
|
41
41
|
interface NavOnSelectProps {
|
|
42
42
|
groupId: number | string;
|
|
@@ -46,27 +46,26 @@ interface NavOnSelectProps {
|
|
|
46
46
|
|
|
47
47
|
export const CompassDockDemo: React.FunctionComponent = () => {
|
|
48
48
|
const [activeItem, setActiveItem] = useState<number>(0);
|
|
49
|
-
const [
|
|
49
|
+
const [isDockExpanded, setIsDockExpanded] = useState(false);
|
|
50
|
+
const [isDockTextExpanded, setIsDockTextExpanded] = useState(false);
|
|
51
|
+
const [isMobile, setIsMobile] = useState(false);
|
|
50
52
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
53
|
+
useEffect(() => {
|
|
54
|
+
const mobileBreakpoint = Number.parseInt(globalBreakpointLg.value) * 16;
|
|
55
|
+
const mediaQuery = window.matchMedia(`(max-width: ${mobileBreakpoint}px)`);
|
|
56
|
+
const handleResize = (e: MediaQueryListEvent | MediaQueryList) => {
|
|
57
|
+
setIsMobile(e.matches);
|
|
58
|
+
};
|
|
54
59
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
};
|
|
60
|
+
handleResize(mediaQuery);
|
|
61
|
+
mediaQuery.addEventListener('change', handleResize);
|
|
58
62
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
};
|
|
63
|
+
return () => mediaQuery.removeEventListener('change', handleResize);
|
|
64
|
+
}, []);
|
|
62
65
|
|
|
63
|
-
const
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
<DropdownItem key="group 2 user">User management</DropdownItem>
|
|
67
|
-
<DropdownItem key="group 2 logout">Logout</DropdownItem>
|
|
68
|
-
</>
|
|
69
|
-
];
|
|
66
|
+
const onNavSelect = (_event: React.FormEvent<HTMLInputElement>, selectedItem: NavOnSelectProps) => {
|
|
67
|
+
typeof selectedItem.itemId === 'number' && setActiveItem(selectedItem.itemId);
|
|
68
|
+
};
|
|
70
69
|
|
|
71
70
|
const navItem1Ref = useRef<HTMLAnchorElement>(null);
|
|
72
71
|
const navItem2Ref = useRef<HTMLAnchorElement>(null);
|
|
@@ -74,127 +73,306 @@ export const CompassDockDemo: React.FunctionComponent = () => {
|
|
|
74
73
|
const navItem4Ref = useRef<HTMLAnchorElement>(null);
|
|
75
74
|
const settingsRef = useRef<HTMLButtonElement>(null);
|
|
76
75
|
const helpRef = useRef<HTMLButtonElement>(null);
|
|
77
|
-
const
|
|
76
|
+
const appsRef = useRef<HTMLButtonElement>(null);
|
|
77
|
+
const mobileToggleRef = useRef<HTMLButtonElement>(null);
|
|
78
|
+
const dockedToggleRef = useRef<HTMLButtonElement>(null);
|
|
78
79
|
|
|
79
|
-
const
|
|
80
|
-
|
|
80
|
+
const onMobileToggle = () => {
|
|
81
|
+
setIsDockExpanded(!isDockExpanded);
|
|
82
|
+
|
|
83
|
+
setTimeout(() => {
|
|
84
|
+
dockedToggleRef.current?.focus();
|
|
85
|
+
}, 200);
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
const onToggleDock = () => {
|
|
89
|
+
if (isMobile) {
|
|
90
|
+
setIsDockExpanded(!isDockExpanded);
|
|
91
|
+
|
|
92
|
+
if (isDockExpanded) {
|
|
93
|
+
setTimeout(() => {
|
|
94
|
+
mobileToggleRef.current?.focus();
|
|
95
|
+
}, 200);
|
|
96
|
+
}
|
|
97
|
+
} else {
|
|
98
|
+
setIsDockTextExpanded(!isDockTextExpanded);
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
const mobileTextLogo = (
|
|
103
|
+
<svg height="37px" viewBox="0 0 679 158">
|
|
104
|
+
<title>PatternFly</title>
|
|
105
|
+
<defs>
|
|
106
|
+
<linearGradient x1="68%" y1="2.25860997e-13%" x2="32%" y2="100%" id="linearGradient-">
|
|
107
|
+
<stop stopColor="#2B9AF3" offset="0%"></stop>
|
|
108
|
+
<stop stopColor="#73BCF7" stopOpacity="0.502212631" offset="100%"></stop>
|
|
109
|
+
</linearGradient>
|
|
110
|
+
</defs>
|
|
111
|
+
<g stroke="none" strokeWidth="1" fill="none" fillRule="evenodd">
|
|
112
|
+
<g
|
|
113
|
+
transform="translate(206.000000, 45.750000)"
|
|
114
|
+
fill="var(--pf-t--global--text--color--regular)"
|
|
115
|
+
fillRule="nonzero"
|
|
116
|
+
>
|
|
117
|
+
<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>
|
|
118
|
+
<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>
|
|
119
|
+
<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>
|
|
120
|
+
<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>
|
|
121
|
+
<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>
|
|
122
|
+
<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>
|
|
123
|
+
<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>
|
|
124
|
+
<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>
|
|
125
|
+
<polygon points="399.96 65.25 399.96 2.25 414.54 0 414.54 65.25"></polygon>
|
|
126
|
+
<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>
|
|
127
|
+
</g>
|
|
128
|
+
<g transform="translate(0.000000, 0.000000)">
|
|
129
|
+
<path
|
|
130
|
+
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"
|
|
131
|
+
fill="#0066CC"
|
|
132
|
+
></path>
|
|
133
|
+
<path
|
|
134
|
+
d="M158,3.43478261 L65.2608696,158 L138,158 C149.045695,158 158,149.045695 158,138 L158,3.43478261 L158,3.43478261 Z"
|
|
135
|
+
fill="url(#linearGradient-)"
|
|
136
|
+
></path>
|
|
137
|
+
<path
|
|
138
|
+
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"
|
|
139
|
+
fill="url(#linearGradient-)"
|
|
140
|
+
transform="translate(77.282609, 46.369565) scale(1, -1) rotate(90.000000) translate(-77.282609, -46.369565) "
|
|
141
|
+
></path>
|
|
142
|
+
</g>
|
|
143
|
+
</g>
|
|
144
|
+
</svg>
|
|
145
|
+
);
|
|
146
|
+
|
|
147
|
+
const dockTextLogo = (
|
|
148
|
+
<svg height="37px" viewBox="0 0 679 158">
|
|
149
|
+
<title>PatternFly</title>
|
|
150
|
+
<defs>
|
|
151
|
+
<linearGradient x1="68%" y1="2.25860997e-13%" x2="32%" y2="100%" id="linearGradient-compass-docked-demo">
|
|
152
|
+
<stop stopColor="#2B9AF3" offset="0%"></stop>
|
|
153
|
+
<stop stopColor="#73BCF7" stopOpacity="0.502212631" offset="100%"></stop>
|
|
154
|
+
</linearGradient>
|
|
155
|
+
</defs>
|
|
156
|
+
<g stroke="none" strokeWidth="1" fill="none" fillRule="evenodd">
|
|
157
|
+
<g
|
|
158
|
+
transform="translate(206.000000, 45.750000)"
|
|
159
|
+
fill="var(--pf-t--global--text--color--regular)"
|
|
160
|
+
fillRule="nonzero"
|
|
161
|
+
>
|
|
162
|
+
<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>
|
|
163
|
+
<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>
|
|
164
|
+
<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>
|
|
165
|
+
<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>
|
|
166
|
+
<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>
|
|
167
|
+
<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>
|
|
168
|
+
<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>
|
|
169
|
+
<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>
|
|
170
|
+
<polygon points="399.96 65.25 399.96 2.25 414.54 0 414.54 65.25"></polygon>
|
|
171
|
+
<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>
|
|
172
|
+
</g>
|
|
173
|
+
<g transform="translate(0.000000, 0.000000)">
|
|
174
|
+
<path
|
|
175
|
+
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"
|
|
176
|
+
fill="#0066CC"
|
|
177
|
+
></path>
|
|
178
|
+
<path
|
|
179
|
+
d="M158,3.43478261 L65.2608696,158 L138,158 C149.045695,158 158,149.045695 158,138 L158,3.43478261 L158,3.43478261 Z"
|
|
180
|
+
fill="url(#linearGradient-compass-docked-demo)"
|
|
181
|
+
></path>
|
|
182
|
+
<path
|
|
183
|
+
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"
|
|
184
|
+
fill="url(#linearGradient-compass-docked-demo)"
|
|
185
|
+
transform="translate(77.282609, 46.369565) scale(1, -1) rotate(90.000000) translate(-77.282609, -46.369565) "
|
|
186
|
+
></path>
|
|
187
|
+
</g>
|
|
188
|
+
</g>
|
|
189
|
+
</svg>
|
|
190
|
+
);
|
|
191
|
+
|
|
192
|
+
// Mobile masthead - shown on mobile viewports only, hidden on desktop
|
|
193
|
+
const mobileMasthead = (
|
|
194
|
+
<Masthead display={{ default: 'inline' }} id="mobile-masthead">
|
|
81
195
|
<MastheadMain>
|
|
196
|
+
<MastheadToggle>
|
|
197
|
+
<PageToggleButton
|
|
198
|
+
innerRef={mobileToggleRef}
|
|
199
|
+
variant="plain"
|
|
200
|
+
aria-label="Global navigation"
|
|
201
|
+
isSidebarOpen={isDockExpanded}
|
|
202
|
+
onSidebarToggle={onMobileToggle}
|
|
203
|
+
isHamburgerButton
|
|
204
|
+
/>
|
|
205
|
+
</MastheadToggle>
|
|
82
206
|
<MastheadBrand>
|
|
83
|
-
<MastheadLogo component={(props) => <a {...props} href="#" />}>
|
|
84
|
-
<Brand src={pfLogo} alt="PatternFly" heights={{ default: '37px' }} />
|
|
85
|
-
</MastheadLogo>
|
|
207
|
+
<MastheadLogo component={(props) => <a {...props} href="#" />}>{mobileTextLogo}</MastheadLogo>
|
|
86
208
|
</MastheadBrand>
|
|
87
209
|
</MastheadMain>
|
|
88
|
-
<Divider />
|
|
89
210
|
<MastheadContent>
|
|
90
|
-
<Toolbar id="toolbar"
|
|
211
|
+
<Toolbar isStatic id="mobile-toolbar">
|
|
91
212
|
<ToolbarContent>
|
|
92
|
-
<ToolbarItem>
|
|
93
|
-
<
|
|
94
|
-
<NavList>
|
|
95
|
-
<NavItem
|
|
96
|
-
key="nav-icon-link1"
|
|
97
|
-
preventDefault
|
|
98
|
-
id="nav-icon-link1"
|
|
99
|
-
to="#nav-icon-link1"
|
|
100
|
-
itemId={0}
|
|
101
|
-
isActive={activeItem === 0}
|
|
102
|
-
icon={<CubeIcon />}
|
|
103
|
-
anchorRef={navItem1Ref}
|
|
104
|
-
aria-label="Link 1"
|
|
105
|
-
/>
|
|
106
|
-
<NavItem
|
|
107
|
-
key="nav-icon-link2"
|
|
108
|
-
preventDefault
|
|
109
|
-
id="nav-icon-link2"
|
|
110
|
-
to="#nav-icon-link2"
|
|
111
|
-
itemId={1}
|
|
112
|
-
isActive={activeItem === 1}
|
|
113
|
-
icon={<FolderIcon />}
|
|
114
|
-
anchorRef={navItem2Ref}
|
|
115
|
-
aria-label="Link 2"
|
|
116
|
-
/>
|
|
117
|
-
<NavItem
|
|
118
|
-
key="nav-icon-link3"
|
|
119
|
-
preventDefault
|
|
120
|
-
id="nav-icon-link3"
|
|
121
|
-
to="#nav-icon-link3"
|
|
122
|
-
itemId={2}
|
|
123
|
-
isActive={activeItem === 2}
|
|
124
|
-
icon={<CloudIcon />}
|
|
125
|
-
anchorRef={navItem3Ref}
|
|
126
|
-
aria-label="Link 3"
|
|
127
|
-
/>
|
|
128
|
-
<NavItem
|
|
129
|
-
key="nav-icon-link4"
|
|
130
|
-
preventDefault
|
|
131
|
-
id="nav-icon-link4"
|
|
132
|
-
to="#nav-icon-link4"
|
|
133
|
-
itemId={3}
|
|
134
|
-
isActive={activeItem === 3}
|
|
135
|
-
icon={<CodeIcon />}
|
|
136
|
-
anchorRef={navItem4Ref}
|
|
137
|
-
aria-label="Link 4"
|
|
138
|
-
/>
|
|
139
|
-
</NavList>
|
|
140
|
-
</Nav>
|
|
141
|
-
<Tooltip aria="none" aria-live="off" triggerRef={navItem1Ref} content="Link 1"></Tooltip>
|
|
142
|
-
<Tooltip aria="none" aria-live="off" triggerRef={navItem2Ref} content="Link 2"></Tooltip>
|
|
143
|
-
<Tooltip aria="none" aria-live="off" triggerRef={navItem3Ref} content="Link 3"></Tooltip>
|
|
144
|
-
<Tooltip aria="none" aria-live="off" triggerRef={navItem4Ref} content="Link 4"></Tooltip>
|
|
213
|
+
<ToolbarItem align={{ default: 'alignEnd' }}>
|
|
214
|
+
<Button variant="plain" icon={<SearchIcon />} aria-label="Search" />
|
|
145
215
|
</ToolbarItem>
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
216
|
+
</ToolbarContent>
|
|
217
|
+
</Toolbar>
|
|
218
|
+
</MastheadContent>
|
|
219
|
+
</Masthead>
|
|
220
|
+
);
|
|
221
|
+
|
|
222
|
+
// Docked masthead - vertical navigation sidebar
|
|
223
|
+
const dockContent = (
|
|
224
|
+
<CompassDockMain {...(isMobile && !isDockExpanded && { inert: '' })}>
|
|
225
|
+
<Masthead display={{ default: undefined }} id="docked-masthead" variant="docked">
|
|
226
|
+
<MastheadMain>
|
|
227
|
+
<MastheadToggle>
|
|
228
|
+
<Button
|
|
229
|
+
ref={dockedToggleRef}
|
|
230
|
+
variant="plain"
|
|
231
|
+
isHamburger
|
|
232
|
+
onClick={onToggleDock}
|
|
233
|
+
aria-label="Global navigation"
|
|
234
|
+
isExpanded={isDockTextExpanded}
|
|
235
|
+
/>
|
|
236
|
+
</MastheadToggle>
|
|
237
|
+
<MastheadBrand>
|
|
238
|
+
<MastheadLogo component={(props) => <a {...props} href="#" />} isCompact>
|
|
239
|
+
<Brand src={pfLogo} alt="PatternFly" heights={{ default: '37px' }} />
|
|
240
|
+
</MastheadLogo>
|
|
241
|
+
<MastheadLogo component={(props) => <a {...props} href="#" />}>{dockTextLogo}</MastheadLogo>
|
|
242
|
+
</MastheadBrand>
|
|
243
|
+
</MastheadMain>
|
|
244
|
+
<Divider />
|
|
245
|
+
<MastheadContent>
|
|
246
|
+
<Toolbar id="toolbar" isVertical>
|
|
247
|
+
<ToolbarContent>
|
|
248
|
+
<ToolbarItem>
|
|
249
|
+
<Nav onSelect={onNavSelect} variant="docked" aria-label="Global" ouiaId="IconNav">
|
|
250
|
+
<NavList>
|
|
251
|
+
<NavItem
|
|
252
|
+
key="nav-icon-link1"
|
|
253
|
+
preventDefault
|
|
254
|
+
id="nav-icon-link1"
|
|
255
|
+
to="#nav-icon-link1"
|
|
256
|
+
itemId={0}
|
|
257
|
+
isActive={activeItem === 0}
|
|
258
|
+
icon={<CubeIcon />}
|
|
259
|
+
anchorRef={navItem1Ref}
|
|
260
|
+
aria-label="System panel"
|
|
261
|
+
>
|
|
262
|
+
System panel
|
|
263
|
+
</NavItem>
|
|
264
|
+
<NavItem
|
|
265
|
+
key="nav-icon-link2"
|
|
266
|
+
preventDefault
|
|
267
|
+
id="nav-icon-link2"
|
|
268
|
+
to="#nav-icon-link2"
|
|
269
|
+
itemId={1}
|
|
270
|
+
isActive={activeItem === 1}
|
|
271
|
+
icon={<FolderIcon />}
|
|
272
|
+
anchorRef={navItem2Ref}
|
|
273
|
+
aria-label="Policy"
|
|
274
|
+
>
|
|
275
|
+
Policy
|
|
276
|
+
</NavItem>
|
|
277
|
+
<NavItem
|
|
278
|
+
key="nav-icon-link3"
|
|
279
|
+
preventDefault
|
|
280
|
+
id="nav-icon-link3"
|
|
281
|
+
to="#nav-icon-link3"
|
|
282
|
+
itemId={2}
|
|
283
|
+
isActive={activeItem === 2}
|
|
284
|
+
icon={<CloudIcon />}
|
|
285
|
+
anchorRef={navItem3Ref}
|
|
286
|
+
aria-label="Authentication"
|
|
287
|
+
>
|
|
288
|
+
Authentication
|
|
289
|
+
</NavItem>
|
|
290
|
+
<NavItem
|
|
291
|
+
key="nav-icon-link4"
|
|
292
|
+
preventDefault
|
|
293
|
+
id="nav-icon-link4"
|
|
294
|
+
to="#nav-icon-link4"
|
|
295
|
+
itemId={3}
|
|
296
|
+
isActive={activeItem === 3}
|
|
297
|
+
icon={<CodeIcon />}
|
|
298
|
+
anchorRef={navItem4Ref}
|
|
299
|
+
aria-label="Network services"
|
|
300
|
+
>
|
|
301
|
+
Network services
|
|
302
|
+
</NavItem>
|
|
303
|
+
</NavList>
|
|
304
|
+
</Nav>
|
|
305
|
+
{!isDockTextExpanded && !isDockExpanded && (
|
|
306
|
+
<>
|
|
307
|
+
<Tooltip aria="none" aria-live="off" triggerRef={navItem1Ref} content="System panel"></Tooltip>
|
|
308
|
+
<Tooltip aria="none" aria-live="off" triggerRef={navItem2Ref} content="Policy"></Tooltip>
|
|
309
|
+
<Tooltip aria="none" aria-live="off" triggerRef={navItem3Ref} content="Authentication"></Tooltip>
|
|
310
|
+
<Tooltip aria="none" aria-live="off" triggerRef={navItem4Ref} content="Network services"></Tooltip>
|
|
311
|
+
</>
|
|
312
|
+
)}
|
|
313
|
+
</ToolbarItem>
|
|
314
|
+
<ToolbarGroup
|
|
315
|
+
variant="action-group-plain"
|
|
316
|
+
align={{ default: 'alignEnd' }}
|
|
317
|
+
gap={{ default: 'gapNone', md: 'gapMd' }}
|
|
318
|
+
>
|
|
152
319
|
<ToolbarItem>
|
|
153
|
-
|
|
154
|
-
<
|
|
155
|
-
|
|
320
|
+
{isDockTextExpanded || isDockExpanded ? (
|
|
321
|
+
<MenuToggle ref={appsRef} variant="plain" icon={<ThIcon />} isDocked aria-label="Applications">
|
|
322
|
+
Applications
|
|
323
|
+
</MenuToggle>
|
|
324
|
+
) : (
|
|
325
|
+
<Tooltip aria="none" aria-live="off" triggerRef={appsRef} content="Applications">
|
|
326
|
+
<MenuToggle ref={appsRef} variant="plain" icon={<ThIcon />} isDocked aria-label="Applications">
|
|
327
|
+
Applications
|
|
328
|
+
</MenuToggle>
|
|
329
|
+
</Tooltip>
|
|
330
|
+
)}
|
|
156
331
|
</ToolbarItem>
|
|
157
332
|
<ToolbarItem>
|
|
158
|
-
|
|
159
|
-
<Button
|
|
333
|
+
{isDockTextExpanded || isDockExpanded ? (
|
|
334
|
+
<Button ref={settingsRef} aria-label="Settings" isSettings variant="plain" isDocked>
|
|
335
|
+
Settings
|
|
336
|
+
</Button>
|
|
337
|
+
) : (
|
|
338
|
+
<Tooltip aria="none" aria-live="off" triggerRef={settingsRef} content="Settings">
|
|
339
|
+
<Button ref={settingsRef} aria-label="Settings" isSettings variant="plain" isDocked>
|
|
340
|
+
Settings
|
|
341
|
+
</Button>
|
|
342
|
+
</Tooltip>
|
|
343
|
+
)}
|
|
344
|
+
</ToolbarItem>
|
|
345
|
+
<ToolbarItem>
|
|
346
|
+
{isDockTextExpanded || isDockExpanded ? (
|
|
347
|
+
<MenuToggle
|
|
160
348
|
ref={helpRef}
|
|
161
|
-
|
|
162
|
-
variant={ButtonVariant.plain}
|
|
349
|
+
variant="plain"
|
|
163
350
|
icon={<RhUiQuestionMarkCircleFillIcon />}
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
isOpen={isDropdownOpen}
|
|
172
|
-
shouldFocusToggleOnSelect
|
|
173
|
-
onSelect={onDropdownSelect}
|
|
174
|
-
onOpenChange={(isOpen: boolean) => setIsDropdownOpen(isOpen)}
|
|
175
|
-
toggle={{
|
|
176
|
-
toggleNode: (
|
|
177
|
-
<Tooltip content="User menu" aria="none" aria-live="off" triggerRef={userMenuRef}>
|
|
351
|
+
isDocked
|
|
352
|
+
aria-label="Help"
|
|
353
|
+
>
|
|
354
|
+
Help
|
|
355
|
+
</MenuToggle>
|
|
356
|
+
) : (
|
|
357
|
+
<Tooltip aria="none" aria-live="off" triggerRef={helpRef} content="Help">
|
|
178
358
|
<MenuToggle
|
|
179
|
-
ref={
|
|
180
|
-
onClick={onDropdownToggle}
|
|
181
|
-
isExpanded={isDropdownOpen}
|
|
182
|
-
icon={<Avatar src={imgAvatar} alt="" size="sm" />}
|
|
359
|
+
ref={helpRef}
|
|
183
360
|
variant="plain"
|
|
184
|
-
|
|
185
|
-
|
|
361
|
+
icon={<RhUiQuestionMarkCircleFillIcon />}
|
|
362
|
+
isDocked
|
|
363
|
+
aria-label="Help"
|
|
364
|
+
>
|
|
365
|
+
Help
|
|
366
|
+
</MenuToggle>
|
|
186
367
|
</Tooltip>
|
|
187
|
-
)
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
</Toolbar>
|
|
196
|
-
</MastheadContent>
|
|
197
|
-
</Masthead>
|
|
368
|
+
)}
|
|
369
|
+
</ToolbarItem>
|
|
370
|
+
</ToolbarGroup>
|
|
371
|
+
</ToolbarContent>
|
|
372
|
+
</Toolbar>
|
|
373
|
+
</MastheadContent>
|
|
374
|
+
</Masthead>
|
|
375
|
+
</CompassDockMain>
|
|
198
376
|
);
|
|
199
377
|
|
|
200
378
|
const mainContent = (
|
|
@@ -212,7 +390,10 @@ export const CompassDockDemo: React.FunctionComponent = () => {
|
|
|
212
390
|
|
|
213
391
|
return (
|
|
214
392
|
<Compass
|
|
393
|
+
masthead={mobileMasthead}
|
|
215
394
|
dock={dockContent}
|
|
395
|
+
isDockExpanded={isDockExpanded}
|
|
396
|
+
isDockTextExpanded={isDockTextExpanded}
|
|
216
397
|
main={mainContent}
|
|
217
398
|
backgroundSrcDark="/assets/images/pf-background.svg"
|
|
218
399
|
backgroundSrcLight="/assets/images/pf-background.svg"
|
package/src/demos/Nav.md
CHANGED
|
@@ -3,7 +3,7 @@ id: Navigation
|
|
|
3
3
|
section: components
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
import { Fragment, useState, useRef } from 'react';
|
|
6
|
+
import { Fragment, useState, useRef, useEffect } from 'react';
|
|
7
7
|
import RhUiSettingsFillIcon from '@patternfly/react-icons/dist/esm/icons/rh-ui-settings-fill-icon';
|
|
8
8
|
import HelpIcon from '@patternfly/react-icons/dist/esm/icons/help-icon';
|
|
9
9
|
import RhUiQuestionMarkCircleFillIcon from '@patternfly/react-icons/dist/esm/icons/rh-ui-question-mark-circle-fill-icon';
|
|
@@ -21,6 +21,7 @@ import SearchIcon from '@patternfly/react-icons/dist/esm/icons/search-icon';
|
|
|
21
21
|
import pfIconLogo from '@patternfly/react-core/src/demos/assets/PF-IconLogo-color.svg';
|
|
22
22
|
import { DashboardBreadcrumb } from '@patternfly/react-core/dist/js/demos/DashboardWrapper';
|
|
23
23
|
import { DashboardHeader } from '@patternfly/react-core/dist/js/demos/DashboardHeader';
|
|
24
|
+
import globalBreakpointXl from '@patternfly/react-tokens/dist/esm/t_global_breakpoint_xl';
|
|
24
25
|
|
|
25
26
|
## Demos
|
|
26
27
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useRef, useState } from 'react';
|
|
1
|
+
import { useRef, useState, useEffect } from 'react';
|
|
2
2
|
import {
|
|
3
3
|
Brand,
|
|
4
4
|
Breadcrumb,
|
|
@@ -38,6 +38,7 @@ import CodeIcon from '@patternfly/react-icons/dist/esm/icons/code-icon';
|
|
|
38
38
|
import ThIcon from '@patternfly/react-icons/dist/esm/icons/th-icon';
|
|
39
39
|
import SearchIcon from '@patternfly/react-icons/dist/esm/icons/search-icon';
|
|
40
40
|
import pfIconLogo from '@patternfly/react-core/src/demos/assets/PF-IconLogo-color.svg';
|
|
41
|
+
import globalBreakpointXl from '@patternfly/react-tokens/dist/esm/t_global_breakpoint_xl';
|
|
41
42
|
|
|
42
43
|
interface NavOnSelectProps {
|
|
43
44
|
groupId: number | string;
|
|
@@ -49,6 +50,20 @@ export const NavDockedNav: React.FunctionComponent = () => {
|
|
|
49
50
|
const [activeItem, setActiveItem] = useState(1);
|
|
50
51
|
const [isDockExpanded, setIsDockExpanded] = useState(false);
|
|
51
52
|
const [isDockTextExpanded, setIsDockTextExpanded] = useState(false);
|
|
53
|
+
const [isMobile, setIsMobile] = useState(false);
|
|
54
|
+
|
|
55
|
+
useEffect(() => {
|
|
56
|
+
const mobileBreakpoint = Number.parseInt(globalBreakpointXl.value) * 16;
|
|
57
|
+
const mediaQuery = window.matchMedia(`(max-width: ${mobileBreakpoint}px)`);
|
|
58
|
+
const handleResize = (e: MediaQueryListEvent | MediaQueryList) => {
|
|
59
|
+
setIsMobile(e.matches);
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
handleResize(mediaQuery);
|
|
63
|
+
mediaQuery.addEventListener('change', handleResize);
|
|
64
|
+
|
|
65
|
+
return () => mediaQuery.removeEventListener('change', handleResize);
|
|
66
|
+
}, []);
|
|
52
67
|
|
|
53
68
|
const onNavSelect = (_event: React.FormEvent<HTMLInputElement>, selectedItem: NavOnSelectProps) => {
|
|
54
69
|
typeof selectedItem.itemId === 'number' && setActiveItem(selectedItem.itemId);
|
|
@@ -180,12 +195,14 @@ export const NavDockedNav: React.FunctionComponent = () => {
|
|
|
180
195
|
};
|
|
181
196
|
|
|
182
197
|
const onToggleDock = () => {
|
|
183
|
-
if (
|
|
198
|
+
if (isMobile) {
|
|
184
199
|
setIsDockExpanded(!isDockExpanded);
|
|
185
200
|
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
201
|
+
if (isDockExpanded) {
|
|
202
|
+
setTimeout(() => {
|
|
203
|
+
mobileToggleRef.current?.focus();
|
|
204
|
+
}, 200);
|
|
205
|
+
}
|
|
189
206
|
} else {
|
|
190
207
|
setIsDockTextExpanded(!isDockTextExpanded);
|
|
191
208
|
}
|
|
@@ -223,7 +240,12 @@ export const NavDockedNav: React.FunctionComponent = () => {
|
|
|
223
240
|
|
|
224
241
|
// Docked masthead - vertical navigation sidebar
|
|
225
242
|
const dockedMasthead = (
|
|
226
|
-
<Masthead
|
|
243
|
+
<Masthead
|
|
244
|
+
{...(isMobile && !isDockExpanded && { inert: '' })}
|
|
245
|
+
display={{ default: undefined }}
|
|
246
|
+
id="docked-masthead"
|
|
247
|
+
variant="docked"
|
|
248
|
+
>
|
|
227
249
|
<MastheadMain>
|
|
228
250
|
<MastheadToggle>
|
|
229
251
|
<Button
|
|
@@ -299,7 +321,7 @@ export const NavDockedNav: React.FunctionComponent = () => {
|
|
|
299
321
|
</NavItem>
|
|
300
322
|
</NavList>
|
|
301
323
|
</Nav>
|
|
302
|
-
{!isDockTextExpanded && (
|
|
324
|
+
{!isDockTextExpanded && !isDockExpanded && (
|
|
303
325
|
<>
|
|
304
326
|
<Tooltip aria="none" aria-live="off" triggerRef={navItem1Ref} content="System panel"></Tooltip>
|
|
305
327
|
<Tooltip aria="none" aria-live="off" triggerRef={navItem2Ref} content="Policy"></Tooltip>
|
|
@@ -314,7 +336,7 @@ export const NavDockedNav: React.FunctionComponent = () => {
|
|
|
314
336
|
gap={{ default: 'gapNone', md: 'gapMd' }}
|
|
315
337
|
>
|
|
316
338
|
<ToolbarItem>
|
|
317
|
-
{isDockTextExpanded ? (
|
|
339
|
+
{isDockTextExpanded || isDockExpanded ? (
|
|
318
340
|
<MenuToggle ref={appsRef} variant="plain" icon={<ThIcon />} isDocked aria-label="Applications">
|
|
319
341
|
Applications
|
|
320
342
|
</MenuToggle>
|
|
@@ -327,7 +349,7 @@ export const NavDockedNav: React.FunctionComponent = () => {
|
|
|
327
349
|
)}
|
|
328
350
|
</ToolbarItem>
|
|
329
351
|
<ToolbarItem>
|
|
330
|
-
{isDockTextExpanded ? (
|
|
352
|
+
{isDockTextExpanded || isDockExpanded ? (
|
|
331
353
|
<Button ref={settingsRef} aria-label="Settings" isSettings variant="plain" isDocked>
|
|
332
354
|
Settings
|
|
333
355
|
</Button>
|
|
@@ -340,7 +362,7 @@ export const NavDockedNav: React.FunctionComponent = () => {
|
|
|
340
362
|
)}
|
|
341
363
|
</ToolbarItem>
|
|
342
364
|
<ToolbarItem>
|
|
343
|
-
{isDockTextExpanded ? (
|
|
365
|
+
{isDockTextExpanded || isDockExpanded ? (
|
|
344
366
|
<MenuToggle
|
|
345
367
|
ref={helpRef}
|
|
346
368
|
variant="plain"
|