@patternfly/react-core 6.5.0-prerelease.24 → 6.5.0-prerelease.26
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 +12 -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/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/ClipboardCopy/ClipboardCopy.d.ts +8 -0
- package/dist/esm/components/ClipboardCopy/ClipboardCopy.d.ts.map +1 -1
- package/dist/esm/components/ClipboardCopy/ClipboardCopy.js +4 -2
- package/dist/esm/components/ClipboardCopy/ClipboardCopy.js.map +1 -1
- package/dist/esm/components/Label/Label.js +1 -1
- package/dist/esm/components/Label/Label.js.map +1 -1
- package/dist/js/components/ClipboardCopy/ClipboardCopy.d.ts +8 -0
- package/dist/js/components/ClipboardCopy/ClipboardCopy.d.ts.map +1 -1
- package/dist/js/components/ClipboardCopy/ClipboardCopy.js +4 -2
- package/dist/js/components/ClipboardCopy/ClipboardCopy.js.map +1 -1
- package/dist/js/components/Label/Label.js +1 -1
- package/dist/js/components/Label/Label.js.map +1 -1
- package/dist/umd/assets/{output-BbsSnXfK.css → output-BOKd1GXO.css} +18528 -18528
- package/dist/umd/react-core.min.js +2 -2
- 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/ClipboardCopy/ClipboardCopy.tsx +16 -1
- package/src/components/ClipboardCopy/__tests__/ClipboardCopy.test.tsx +72 -0
- package/src/components/ClipboardCopy/__tests__/__snapshots__/ClipboardCopy.test.tsx.snap +1 -1
- package/src/components/Dropdown/examples/Dropdown.md +13 -1
- package/src/components/Dropdown/examples/DropdownWithSplit.tsx +97 -0
- package/src/components/Label/Label.tsx +1 -1
- package/src/demos/Banner.md +2 -139
- package/src/demos/DateTimePicker.md +2 -86
- package/src/demos/JumpLinks.md +2 -129
- package/src/demos/ProgressDemo.md +2 -65
- package/src/demos/ProgressStepperDemo.md +1 -72
- package/src/demos/Tabs.md +6 -417
- package/src/demos/examples/Banner/BannerBasicSticky.tsx +55 -0
- package/src/demos/examples/Banner/BannerTopBottom.tsx +81 -0
- package/src/demos/examples/DateTimePicker/DateTimeRangePicker.tsx +93 -0
- package/src/demos/examples/JumpLinks/JumpLinksScrollspy.tsx +125 -0
- package/src/demos/examples/JumpLinks/{JumpLinksWithDrawer.js → JumpLinksWithDrawer.tsx} +1 -1
- package/src/demos/examples/Progress/ProgressBasic.tsx +32 -0
- package/src/demos/examples/Progress/ProgressWithOnlyIncreasing.tsx +33 -0
- package/src/demos/examples/ProgressStepper/ProgressStepperBasic.tsx +72 -0
- package/src/demos/examples/Tabs/TabsOpen.tsx +185 -0
- package/src/demos/examples/Tabs/TabsOpenWithSecondaryTabs.tsx +228 -0
- package/src/layouts/Gallery/examples/Gallery.md +8 -99
- package/src/layouts/Gallery/examples/GalleryAdjustingMaxWidths.tsx +21 -0
- package/src/layouts/Gallery/examples/GalleryAdjustingMinMaxWidths.tsx +25 -0
- package/src/layouts/Gallery/examples/GalleryAdjustingMinWidths.tsx +22 -0
- package/src/layouts/Gallery/examples/GalleryAlternativeComponents.tsx +11 -0
- package/src/layouts/Gallery/examples/GalleryBasic.tsx +14 -0
- package/src/layouts/Gallery/examples/GalleryWithGutters.tsx +12 -0
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { useEffect, useState } from 'react';
|
|
2
|
+
import {
|
|
3
|
+
PageSection,
|
|
4
|
+
JumpLinks,
|
|
5
|
+
JumpLinksItem,
|
|
6
|
+
JumpLinksList,
|
|
7
|
+
Sidebar,
|
|
8
|
+
SidebarContent,
|
|
9
|
+
SidebarPanel,
|
|
10
|
+
Switch,
|
|
11
|
+
Title,
|
|
12
|
+
Content,
|
|
13
|
+
getResizeObserver
|
|
14
|
+
} from '@patternfly/react-core';
|
|
15
|
+
import { DashboardWrapper } from '@patternfly/react-core/dist/js/demos/DashboardWrapper';
|
|
16
|
+
import mastheadStyles from '@patternfly/react-styles/css/components/Masthead/masthead';
|
|
17
|
+
|
|
18
|
+
export const JumpLinksScrollspy: React.FunctionComponent = () => {
|
|
19
|
+
const headings = [1, 2, 3, 4, 5];
|
|
20
|
+
|
|
21
|
+
const [isVertical, setIsVertical] = useState(true);
|
|
22
|
+
const [offsetHeight, setOffsetHeight] = useState(10);
|
|
23
|
+
const offsetForPadding = 10;
|
|
24
|
+
|
|
25
|
+
// Update offset based on the masthead and jump links nav heights.
|
|
26
|
+
useEffect(() => {
|
|
27
|
+
const masthead = document.getElementsByClassName(mastheadStyles.masthead)[0];
|
|
28
|
+
|
|
29
|
+
if (isVertical) {
|
|
30
|
+
setOffsetHeight(masthead.offsetHeight + offsetForPadding);
|
|
31
|
+
} else {
|
|
32
|
+
// Append jump links nav height to the masthead height when value exists.
|
|
33
|
+
const jumpLinksHeaderHeight = document.getElementsByClassName('pf-m-sticky')[0].offsetHeight;
|
|
34
|
+
jumpLinksHeaderHeight && setOffsetHeight(masthead.offsetHeight + jumpLinksHeaderHeight + offsetForPadding);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const observer = getResizeObserver(
|
|
38
|
+
document.getElementsByClassName(mastheadStyles.masthead)[0],
|
|
39
|
+
() => {
|
|
40
|
+
if (isVertical) {
|
|
41
|
+
setOffsetHeight(masthead.offsetHeight + offsetForPadding);
|
|
42
|
+
} else {
|
|
43
|
+
// Append jump links nav height to the masthead height when value exists.
|
|
44
|
+
const jumpLinksHeaderHeight = document.getElementsByClassName('pf-m-sticky')[0].offsetHeight;
|
|
45
|
+
jumpLinksHeaderHeight && setOffsetHeight(masthead.offsetHeight + jumpLinksHeaderHeight + offsetForPadding);
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
true
|
|
49
|
+
);
|
|
50
|
+
|
|
51
|
+
return () => observer();
|
|
52
|
+
}, [isVertical]);
|
|
53
|
+
|
|
54
|
+
return (
|
|
55
|
+
<DashboardWrapper breadcrumb={null} mainContainerId="scrollable-element">
|
|
56
|
+
<PageSection aria-labelledby="main-title">
|
|
57
|
+
<Title headingLevel="h1" size="2xl" id="main-title">
|
|
58
|
+
Main title
|
|
59
|
+
</Title>
|
|
60
|
+
<Switch
|
|
61
|
+
id="is-vertical"
|
|
62
|
+
label="Vertical jump links"
|
|
63
|
+
isChecked={isVertical}
|
|
64
|
+
onChange={(_event, check) => setIsVertical(check)}
|
|
65
|
+
/>
|
|
66
|
+
</PageSection>
|
|
67
|
+
<PageSection padding={{ default: 'noPadding' }}>
|
|
68
|
+
<Sidebar hasGutter orientation={!isVertical && 'stack'}>
|
|
69
|
+
<SidebarPanel variant="sticky">
|
|
70
|
+
<PageSection aria-label="Jump links navigation">
|
|
71
|
+
<JumpLinks
|
|
72
|
+
isVertical={isVertical}
|
|
73
|
+
isCentered={!isVertical}
|
|
74
|
+
label="Jump to section"
|
|
75
|
+
scrollableSelector=".pf-v6-c-page__main-container"
|
|
76
|
+
offset={offsetHeight}
|
|
77
|
+
expandable={{ default: isVertical ? 'expandable' : 'nonExpandable', md: 'nonExpandable' }}
|
|
78
|
+
isExpanded
|
|
79
|
+
>
|
|
80
|
+
{headings.map((i) => (
|
|
81
|
+
<JumpLinksItem key={i} href={`#heading-${i}`}>
|
|
82
|
+
{`Heading ${i}`}
|
|
83
|
+
<JumpLinksList></JumpLinksList>
|
|
84
|
+
</JumpLinksItem>
|
|
85
|
+
))}
|
|
86
|
+
</JumpLinks>
|
|
87
|
+
</PageSection>
|
|
88
|
+
</SidebarPanel>
|
|
89
|
+
<SidebarContent hasNoBackground>
|
|
90
|
+
<PageSection aria-label="Main content">
|
|
91
|
+
<Content>
|
|
92
|
+
{headings.map((i) => (
|
|
93
|
+
<div key={i} style={{ maxWidth: '800px', marginBottom: '32px' }}>
|
|
94
|
+
<h2 id={`heading-${i}`} tabIndex={-1}>
|
|
95
|
+
{`Heading ${i}`}
|
|
96
|
+
</h2>
|
|
97
|
+
<p>
|
|
98
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut
|
|
99
|
+
labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris
|
|
100
|
+
nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit
|
|
101
|
+
esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt
|
|
102
|
+
in culpa qui officia deserunt mollit anim id est laborum.
|
|
103
|
+
</p>
|
|
104
|
+
<br />
|
|
105
|
+
<p>
|
|
106
|
+
At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum
|
|
107
|
+
deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non
|
|
108
|
+
provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum
|
|
109
|
+
fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta
|
|
110
|
+
nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus,
|
|
111
|
+
omnis voluptas assumenda est, omnis dolor repellendus. Temporibus autem quibusdam et aut officiis
|
|
112
|
+
debitis aut rerum necessitatibus saepe eveniet ut et voluptates repudiandae sint et molestiae non
|
|
113
|
+
recusandae. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus
|
|
114
|
+
maiores alias consequatur aut perferendis doloribus asperiores repellat.
|
|
115
|
+
</p>
|
|
116
|
+
</div>
|
|
117
|
+
))}
|
|
118
|
+
</Content>
|
|
119
|
+
</PageSection>
|
|
120
|
+
</SidebarContent>
|
|
121
|
+
</Sidebar>
|
|
122
|
+
</PageSection>
|
|
123
|
+
</DashboardWrapper>
|
|
124
|
+
);
|
|
125
|
+
};
|
|
@@ -40,7 +40,7 @@ const JumpLinksWrapper = ({ headings }) => {
|
|
|
40
40
|
);
|
|
41
41
|
};
|
|
42
42
|
|
|
43
|
-
export const JumpLinksWithDrawer = () => {
|
|
43
|
+
export const JumpLinksWithDrawer: React.FunctionComponent = () => {
|
|
44
44
|
const headings = ['First', 'Second', 'Third', 'Fourth', 'Fifth'];
|
|
45
45
|
|
|
46
46
|
const [isExpanded, setIsExpanded] = useState(false);
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { useState } from 'react';
|
|
2
|
+
import { Progress, Button, Stack, StackItem } from '@patternfly/react-core';
|
|
3
|
+
import accessibilityStyles from '@patternfly/react-styles/css/utilities/Accessibility/accessibility';
|
|
4
|
+
|
|
5
|
+
export const ProgressBasic: React.FunctionComponent = () => {
|
|
6
|
+
const [currentValue, setCurrentValue] = useState(0);
|
|
7
|
+
|
|
8
|
+
const onProgressUpdate = (nextValue) => {
|
|
9
|
+
setCurrentValue(nextValue);
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
return (
|
|
13
|
+
<Stack>
|
|
14
|
+
<StackItem>
|
|
15
|
+
<Button onClick={() => onProgressUpdate(currentValue - 10)} isDisabled={currentValue === 0}>
|
|
16
|
+
Decrease value
|
|
17
|
+
</Button>{' '}
|
|
18
|
+
<Button onClick={() => onProgressUpdate(currentValue + 10)} isDisabled={currentValue === 100}>
|
|
19
|
+
Increase value
|
|
20
|
+
</Button>
|
|
21
|
+
<br />
|
|
22
|
+
<br />
|
|
23
|
+
</StackItem>
|
|
24
|
+
<StackItem>
|
|
25
|
+
<div className={accessibilityStyles.screenReader} aria-live="polite">
|
|
26
|
+
{`Progress value is ${currentValue}%.`}
|
|
27
|
+
</div>
|
|
28
|
+
<Progress value={currentValue} title="Title" />
|
|
29
|
+
</StackItem>
|
|
30
|
+
</Stack>
|
|
31
|
+
);
|
|
32
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { useState } from 'react';
|
|
2
|
+
import { Progress, Button, Stack, StackItem } from '@patternfly/react-core';
|
|
3
|
+
|
|
4
|
+
export const ProgressWithOnlyIncreasing: React.FunctionComponent = () => {
|
|
5
|
+
const [currentValue, setCurrentValue] = useState(0);
|
|
6
|
+
|
|
7
|
+
const onProgressUpdate = (nextValue) => {
|
|
8
|
+
if (nextValue > currentValue) {
|
|
9
|
+
setCurrentValue(nextValue);
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
return (
|
|
14
|
+
<Stack>
|
|
15
|
+
<StackItem>
|
|
16
|
+
<Button onClick={() => onProgressUpdate(currentValue - 10)} isDisabled={currentValue === 0}>
|
|
17
|
+
Decrease value
|
|
18
|
+
</Button>{' '}
|
|
19
|
+
<Button onClick={() => onProgressUpdate(currentValue + 10)} isDisabled={currentValue === 100}>
|
|
20
|
+
Increase value
|
|
21
|
+
</Button>
|
|
22
|
+
<br />
|
|
23
|
+
<br />
|
|
24
|
+
</StackItem>
|
|
25
|
+
<StackItem>
|
|
26
|
+
<div className={accessibilityStyles.screenReader} aria-live="polite">
|
|
27
|
+
{`Progress value is ${currentValue}%.`}
|
|
28
|
+
</div>
|
|
29
|
+
<Progress value={currentValue} title="Title" />
|
|
30
|
+
</StackItem>
|
|
31
|
+
</Stack>
|
|
32
|
+
);
|
|
33
|
+
};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { useState } from 'react';
|
|
2
|
+
import { ProgressStepper, ProgressStep, Button, Stack, StackItem } from '@patternfly/react-core';
|
|
3
|
+
import accessibilityStyles from '@patternfly/react-styles/css/utilities/Accessibility/accessibility';
|
|
4
|
+
|
|
5
|
+
export const ProgressStepperBasic: React.FunctionComponent = () => {
|
|
6
|
+
const [currentStep, setCurrentStep] = useState(0);
|
|
7
|
+
|
|
8
|
+
const steps = [
|
|
9
|
+
{ title: 'First step', id: 'step1' },
|
|
10
|
+
{ title: 'Second step', id: 'step2' },
|
|
11
|
+
{ title: 'Third step', id: 'step3' },
|
|
12
|
+
{ title: 'Fourth step', id: 'step4' },
|
|
13
|
+
{ title: 'Fifth step', id: 'step5' }
|
|
14
|
+
];
|
|
15
|
+
|
|
16
|
+
const onStepForward = (_event) => {
|
|
17
|
+
const next = currentStep + 1;
|
|
18
|
+
setCurrentStep(next <= 5 ? next : 4);
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
const onStepBack = (_event) => {
|
|
22
|
+
const next = currentStep - 1;
|
|
23
|
+
setCurrentStep(next > 0 ? next : 0);
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
return (
|
|
27
|
+
<Stack>
|
|
28
|
+
<StackItem>
|
|
29
|
+
<Button onClick={onStepBack} isDisabled={currentStep === 0}>
|
|
30
|
+
Step back
|
|
31
|
+
</Button>{' '}
|
|
32
|
+
<Button onClick={onStepForward} isDisabled={currentStep === 5}>
|
|
33
|
+
Step forward
|
|
34
|
+
</Button>
|
|
35
|
+
<br />
|
|
36
|
+
<br />
|
|
37
|
+
</StackItem>
|
|
38
|
+
<StackItem>
|
|
39
|
+
<div className={accessibilityStyles.screenReader} aria-live="polite">
|
|
40
|
+
{steps[currentStep] && `On ${steps[currentStep].title}.`}
|
|
41
|
+
{steps[currentStep - 1] && `${steps[currentStep - 1].title} was successful.`}
|
|
42
|
+
</div>
|
|
43
|
+
<ProgressStepper>
|
|
44
|
+
{steps.map((step, index) => {
|
|
45
|
+
let variant = 'pending';
|
|
46
|
+
let ariaLabel = 'pending step';
|
|
47
|
+
if (index < currentStep) {
|
|
48
|
+
variant = 'success';
|
|
49
|
+
ariaLabel = 'completed step, step with success';
|
|
50
|
+
} else if (index === currentStep) {
|
|
51
|
+
variant = 'info';
|
|
52
|
+
ariaLabel = 'current step';
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
return (
|
|
56
|
+
<ProgressStep
|
|
57
|
+
id={index}
|
|
58
|
+
titleId={step.id}
|
|
59
|
+
key={index}
|
|
60
|
+
variant={variant}
|
|
61
|
+
isCurrent={index === currentStep}
|
|
62
|
+
aria-label={ariaLabel}
|
|
63
|
+
>
|
|
64
|
+
{step.title}
|
|
65
|
+
</ProgressStep>
|
|
66
|
+
);
|
|
67
|
+
})}
|
|
68
|
+
</ProgressStepper>
|
|
69
|
+
</StackItem>
|
|
70
|
+
</Stack>
|
|
71
|
+
);
|
|
72
|
+
};
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
import { useState } from 'react';
|
|
2
|
+
import {
|
|
3
|
+
PageSection,
|
|
4
|
+
PageBreadcrumb,
|
|
5
|
+
Breadcrumb,
|
|
6
|
+
BreadcrumbItem,
|
|
7
|
+
Tabs,
|
|
8
|
+
Tab,
|
|
9
|
+
TabContent,
|
|
10
|
+
TabContentBody,
|
|
11
|
+
TabTitleText,
|
|
12
|
+
Title,
|
|
13
|
+
DescriptionList,
|
|
14
|
+
DescriptionListGroup,
|
|
15
|
+
DescriptionListTerm,
|
|
16
|
+
DescriptionListDescription,
|
|
17
|
+
Label,
|
|
18
|
+
LabelGroup,
|
|
19
|
+
Flex,
|
|
20
|
+
FlexItem
|
|
21
|
+
} from '@patternfly/react-core';
|
|
22
|
+
import CheckCircleIcon from '@patternfly/react-icons/dist/js/icons/check-circle-icon';
|
|
23
|
+
import InfoCircleIcon from '@patternfly/react-icons/dist/js/icons/info-circle-icon';
|
|
24
|
+
import spacing from '@patternfly/react-styles/css/utilities/Spacing/spacing';
|
|
25
|
+
import { DashboardWrapper } from '@patternfly/react-core/dist/js/demos/DashboardWrapper';
|
|
26
|
+
|
|
27
|
+
export const TabsOpen: React.FunctionComponent = () => {
|
|
28
|
+
const [activeTabKey, setActiveTabKey] = useState(0);
|
|
29
|
+
|
|
30
|
+
// Toggle currently active tab
|
|
31
|
+
const handleTabClick = (_event: React.MouseEvent<HTMLElement>, tabIndex: number | string) => {
|
|
32
|
+
setActiveTabKey(tabIndex);
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
const tabsBreadcrumb = (
|
|
36
|
+
<PageBreadcrumb isWidthLimited>
|
|
37
|
+
<Breadcrumb>
|
|
38
|
+
<BreadcrumbItem to="#">Overview</BreadcrumbItem>
|
|
39
|
+
<BreadcrumbItem to="#">Pods</BreadcrumbItem>
|
|
40
|
+
<BreadcrumbItem to="#" isActive>
|
|
41
|
+
Pod details{' '}
|
|
42
|
+
</BreadcrumbItem>
|
|
43
|
+
</Breadcrumb>
|
|
44
|
+
</PageBreadcrumb>
|
|
45
|
+
);
|
|
46
|
+
|
|
47
|
+
const tabContent = (
|
|
48
|
+
<Flex direction={{ default: 'column' }}>
|
|
49
|
+
<FlexItem spacer={{ default: 'spacerLg' }}>
|
|
50
|
+
<Title headingLevel="h2" size="lg" className={spacing.mtSm} id="open-tabs-example-tabs-list-details-title">
|
|
51
|
+
Pod details
|
|
52
|
+
</Title>
|
|
53
|
+
</FlexItem>
|
|
54
|
+
<FlexItem>
|
|
55
|
+
<DescriptionList columnModifier={{ lg: '2Col' }} aria-labelledby="open-tabs-example-tabs-list-details-title">
|
|
56
|
+
<DescriptionListGroup>
|
|
57
|
+
<DescriptionListTerm>Name</DescriptionListTerm>
|
|
58
|
+
<DescriptionListDescription>3scale-control-fccb6ddb9-phyqv9</DescriptionListDescription>
|
|
59
|
+
</DescriptionListGroup>
|
|
60
|
+
<DescriptionListGroup>
|
|
61
|
+
<DescriptionListTerm>Status</DescriptionListTerm>
|
|
62
|
+
<DescriptionListDescription>
|
|
63
|
+
<Flex spacer={{ default: 'spacerLg' }}>
|
|
64
|
+
<FlexItem>
|
|
65
|
+
<CheckCircleIcon />
|
|
66
|
+
</FlexItem>
|
|
67
|
+
<FlexItem>Running</FlexItem>
|
|
68
|
+
</Flex>
|
|
69
|
+
</DescriptionListDescription>
|
|
70
|
+
</DescriptionListGroup>
|
|
71
|
+
<DescriptionListGroup>
|
|
72
|
+
<DescriptionListTerm>Namespace</DescriptionListTerm>
|
|
73
|
+
<DescriptionListDescription>
|
|
74
|
+
<Flex spaceItems={{ default: 'spaceItemsSm' }}>
|
|
75
|
+
<FlexItem>
|
|
76
|
+
<Label color="teal">NS</Label>
|
|
77
|
+
</FlexItem>
|
|
78
|
+
<FlexItem>
|
|
79
|
+
<a href="#">knative-serving-ingress</a>
|
|
80
|
+
</FlexItem>
|
|
81
|
+
</Flex>
|
|
82
|
+
</DescriptionListDescription>
|
|
83
|
+
</DescriptionListGroup>
|
|
84
|
+
<DescriptionListGroup>
|
|
85
|
+
<DescriptionListTerm>Restart policy</DescriptionListTerm>
|
|
86
|
+
<DescriptionListDescription>Always restart</DescriptionListDescription>
|
|
87
|
+
</DescriptionListGroup>
|
|
88
|
+
<DescriptionListGroup>
|
|
89
|
+
<DescriptionListTerm>Labels</DescriptionListTerm>
|
|
90
|
+
<DescriptionListDescription>
|
|
91
|
+
<LabelGroup>
|
|
92
|
+
<Label>app=3scale-gateway</Label>
|
|
93
|
+
<Label>pod-template-has=6747686899</Label>
|
|
94
|
+
</LabelGroup>
|
|
95
|
+
</DescriptionListDescription>
|
|
96
|
+
</DescriptionListGroup>
|
|
97
|
+
<DescriptionListGroup>
|
|
98
|
+
<DescriptionListTerm>Active deadline seconds</DescriptionListTerm>
|
|
99
|
+
<DescriptionListDescription>Not configured</DescriptionListDescription>
|
|
100
|
+
</DescriptionListGroup>
|
|
101
|
+
<DescriptionListGroup>
|
|
102
|
+
<DescriptionListTerm>Tolerations</DescriptionListTerm>
|
|
103
|
+
<DescriptionListDescription>stuff</DescriptionListDescription>
|
|
104
|
+
</DescriptionListGroup>
|
|
105
|
+
<DescriptionListGroup>
|
|
106
|
+
<DescriptionListTerm>Pod IP</DescriptionListTerm>
|
|
107
|
+
<DescriptionListDescription>10.345.2.197</DescriptionListDescription>
|
|
108
|
+
</DescriptionListGroup>
|
|
109
|
+
<DescriptionListGroup>
|
|
110
|
+
<DescriptionListTerm>Annotations</DescriptionListTerm>
|
|
111
|
+
<DescriptionListDescription>stuff</DescriptionListDescription>
|
|
112
|
+
</DescriptionListGroup>
|
|
113
|
+
<DescriptionListGroup>
|
|
114
|
+
<DescriptionListTerm>Node</DescriptionListTerm>
|
|
115
|
+
<DescriptionListDescription>
|
|
116
|
+
<Flex spaceItems={{ default: 'spaceItemsSm' }}>
|
|
117
|
+
<FlexItem>
|
|
118
|
+
<Label color="purple">N</Label>
|
|
119
|
+
</FlexItem>
|
|
120
|
+
<FlexItem>ip-10-0-233-118.us-east-2.computer.external</FlexItem>
|
|
121
|
+
</Flex>
|
|
122
|
+
</DescriptionListDescription>
|
|
123
|
+
</DescriptionListGroup>
|
|
124
|
+
<DescriptionListGroup>
|
|
125
|
+
<DescriptionListTerm>Created at</DescriptionListTerm>
|
|
126
|
+
<DescriptionListDescription>
|
|
127
|
+
<time>Oct 15, 1:51 pm</time>
|
|
128
|
+
</DescriptionListDescription>
|
|
129
|
+
</DescriptionListGroup>
|
|
130
|
+
</DescriptionList>
|
|
131
|
+
</FlexItem>
|
|
132
|
+
</Flex>
|
|
133
|
+
);
|
|
134
|
+
|
|
135
|
+
return (
|
|
136
|
+
<DashboardWrapper hasNoBreadcrumb>
|
|
137
|
+
{tabsBreadcrumb}
|
|
138
|
+
<PageSection isWidthLimited aria-label="Pod header">
|
|
139
|
+
<Flex
|
|
140
|
+
spaceItems={{ default: 'spaceItemsMd' }}
|
|
141
|
+
alignItems={{ default: 'alignItemsFlexStart' }}
|
|
142
|
+
flexWrap={{ default: 'noWrap' }}
|
|
143
|
+
>
|
|
144
|
+
<FlexItem>
|
|
145
|
+
<Label color="blue">N</Label>
|
|
146
|
+
</FlexItem>
|
|
147
|
+
<FlexItem>
|
|
148
|
+
<Title headingLevel="h1" size="2xl">
|
|
149
|
+
3scale-control-fccb6ddb9-phyqv9
|
|
150
|
+
</Title>
|
|
151
|
+
</FlexItem>
|
|
152
|
+
<FlexItem flex={{ default: 'flexNone' }}>
|
|
153
|
+
<Label icon={<InfoCircleIcon />}>Running</Label>
|
|
154
|
+
</FlexItem>
|
|
155
|
+
</Flex>
|
|
156
|
+
</PageSection>
|
|
157
|
+
<PageSection type="tabs" isWidthLimited aria-label="Pod navigation tabs">
|
|
158
|
+
<Tabs activeKey={activeTabKey} onSelect={handleTabClick} usePageInsets id="open-tabs-example-tabs-list">
|
|
159
|
+
<Tab eventKey={0} title={<TabTitleText>Details</TabTitleText>} tabContentId={`tabContent${0}`} />
|
|
160
|
+
<Tab eventKey={1} title={<TabTitleText>YAML</TabTitleText>} tabContentId={`tabContent${1}`} />
|
|
161
|
+
<Tab eventKey={2} title={<TabTitleText>Environment</TabTitleText>} tabContentId={`tabContent${2}`} />
|
|
162
|
+
<Tab eventKey={3} title={<TabTitleText>Events</TabTitleText>} tabContentId={`tabContent${3}`} />
|
|
163
|
+
<Tab eventKey={4} title={<TabTitleText>Terminal</TabTitleText>} tabContentId={`tabContent${4}`} />
|
|
164
|
+
</Tabs>
|
|
165
|
+
</PageSection>
|
|
166
|
+
<PageSection isWidthLimited aria-label="Pod content">
|
|
167
|
+
<TabContent key={0} eventKey={0} id={`tabContent${0}`} activeKey={activeTabKey} hidden={0 !== activeTabKey}>
|
|
168
|
+
<TabContentBody>{tabContent}</TabContentBody>
|
|
169
|
+
</TabContent>
|
|
170
|
+
<TabContent key={1} eventKey={1} id={`tabContent${1}`} activeKey={activeTabKey} hidden={1 !== activeTabKey}>
|
|
171
|
+
<TabContentBody>YAML panel</TabContentBody>
|
|
172
|
+
</TabContent>
|
|
173
|
+
<TabContent key={2} eventKey={2} id={`tabContent${2}`} activeKey={activeTabKey} hidden={2 !== activeTabKey}>
|
|
174
|
+
<TabContentBody>Environment panel</TabContentBody>
|
|
175
|
+
</TabContent>
|
|
176
|
+
<TabContent key={3} eventKey={3} id={`tabContent${3}`} activeKey={activeTabKey} hidden={3 !== activeTabKey}>
|
|
177
|
+
<TabContentBody>Events panel</TabContentBody>
|
|
178
|
+
</TabContent>
|
|
179
|
+
<TabContent key={4} eventKey={4} id={`tabContent${4}`} activeKey={activeTabKey} hidden={4 !== activeTabKey}>
|
|
180
|
+
<TabContentBody>Terminal panel</TabContentBody>
|
|
181
|
+
</TabContent>
|
|
182
|
+
</PageSection>
|
|
183
|
+
</DashboardWrapper>
|
|
184
|
+
);
|
|
185
|
+
};
|