@patternfly/react-core 5.2.0-prerelease.6 → 5.2.0-prerelease.8
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 +8 -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/Chip/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/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/DragDrop/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/Text/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/Tile/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/ApplicationLauncher/package.json +1 -1
- package/dist/dynamic/deprecated/components/ContextSelector/package.json +1 -1
- package/dist/dynamic/deprecated/components/Dropdown/package.json +1 -1
- package/dist/dynamic/deprecated/components/OptionsMenu/package.json +1 -1
- package/dist/dynamic/deprecated/components/PageHeader/package.json +1 -1
- package/dist/dynamic/deprecated/components/Select/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/favorites/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/next/components/package.json +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/Alert/examples/Alert.md +142 -103
- package/src/components/Button/examples/Button.md +1 -1
- package/src/demos/CardDemos.md +16 -2933
- package/src/demos/{Card/Card.md → CardView/CardView.md} +1 -1
- package/src/demos/{Card → CardView}/examples/CardView.tsx +1 -1
- package/src/demos/PrimaryDetail.md +2 -2
- package/src/demos/examples/Card/CardAggregateStatus.tsx +249 -0
- package/src/demos/examples/Card/CardDetails.tsx +95 -0
- package/src/demos/examples/Card/CardEventsView.tsx +154 -0
- package/src/demos/examples/Card/CardHorizontalGrid.tsx +240 -0
- package/src/demos/examples/Card/CardHorizontalSplit.tsx +30 -0
- package/src/demos/examples/Card/CardLogView.tsx +118 -0
- package/src/demos/examples/Card/CardNested.tsx +532 -0
- package/src/demos/examples/Card/CardStatus.tsx +262 -0
- package/src/demos/examples/Card/CardStatusTabbed.tsx +113 -0
- package/src/demos/examples/Card/CardTrendDemo1.tsx +106 -0
- package/src/demos/examples/Card/CardTrendDemo2.tsx +76 -0
- package/src/demos/examples/Card/CardUtilizationDemo1.tsx +109 -0
- package/src/demos/examples/Card/CardUtilizationDemo2.tsx +103 -0
- package/src/demos/examples/Card/CardUtilizationDemo3.tsx +174 -0
- package/src/demos/examples/Card/CardUtilizationDemo4.tsx +50 -0
- package/src/demos/examples/Card/CardWithAccordion.tsx +514 -0
- /package/src/demos/{Card/examples/CardData.jsx → CardView/examples/CardViewData.jsx} +0 -0
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {
|
|
3
|
+
Card,
|
|
4
|
+
CardHeader,
|
|
5
|
+
CardTitle,
|
|
6
|
+
CardBody,
|
|
7
|
+
CardExpandableContent,
|
|
8
|
+
Level,
|
|
9
|
+
LabelGroup,
|
|
10
|
+
Label,
|
|
11
|
+
Grid,
|
|
12
|
+
Flex,
|
|
13
|
+
List,
|
|
14
|
+
ListItem,
|
|
15
|
+
Button,
|
|
16
|
+
Dropdown,
|
|
17
|
+
DropdownList,
|
|
18
|
+
DropdownItem,
|
|
19
|
+
MenuToggle,
|
|
20
|
+
MenuToggleElement
|
|
21
|
+
} from '@patternfly/react-core';
|
|
22
|
+
import InfoCircleIcon from '@patternfly/react-icons/dist/esm/icons/info-circle-icon';
|
|
23
|
+
import ArrowRightIcon from '@patternfly/react-icons/dist/esm/icons/arrow-right-icon';
|
|
24
|
+
import ExternalLinkAltIcon from '@patternfly/react-icons/dist/esm/icons/external-link-alt-icon';
|
|
25
|
+
import EllipsisVIcon from '@patternfly/react-icons/dist/esm/icons/ellipsis-v-icon';
|
|
26
|
+
|
|
27
|
+
export const CardHorizontalGrid: React.FunctionComponent = () => {
|
|
28
|
+
const [isCardExpanded, setIsCardExpanded] = React.useState(false);
|
|
29
|
+
const [isDropdownOpen, setIsDropdownOpen] = React.useState(false);
|
|
30
|
+
|
|
31
|
+
const onCardExpand = () => {
|
|
32
|
+
setIsCardExpanded(!isCardExpanded);
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
const onActionToggle = () => {
|
|
36
|
+
setIsDropdownOpen(!isDropdownOpen);
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
const onActionSelect = () => {
|
|
40
|
+
setIsDropdownOpen(false);
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
const dropdownItems = (
|
|
44
|
+
<>
|
|
45
|
+
<DropdownItem key="action1">Action 1</DropdownItem>
|
|
46
|
+
<DropdownItem key="action2">Action 2</DropdownItem>
|
|
47
|
+
<DropdownItem key="disabled action3" isDisabled>
|
|
48
|
+
Disabled Action 3
|
|
49
|
+
</DropdownItem>
|
|
50
|
+
<DropdownItem key="action4">Action 4</DropdownItem>
|
|
51
|
+
</>
|
|
52
|
+
);
|
|
53
|
+
const headerActions = (
|
|
54
|
+
<Dropdown
|
|
55
|
+
onSelect={onActionSelect}
|
|
56
|
+
isOpen={isDropdownOpen}
|
|
57
|
+
popperProps={{ position: 'right' }}
|
|
58
|
+
onOpenChange={(isOpen: boolean) => setIsDropdownOpen(isOpen)}
|
|
59
|
+
toggle={(toggleRef: React.Ref<MenuToggleElement>) => (
|
|
60
|
+
<MenuToggle
|
|
61
|
+
ref={toggleRef}
|
|
62
|
+
isExpanded={isDropdownOpen}
|
|
63
|
+
onClick={onActionToggle}
|
|
64
|
+
variant="plain"
|
|
65
|
+
aria-label="Horizontal card grid demo kebab toggle"
|
|
66
|
+
>
|
|
67
|
+
<EllipsisVIcon aria-hidden="true" />
|
|
68
|
+
</MenuToggle>
|
|
69
|
+
)}
|
|
70
|
+
>
|
|
71
|
+
<DropdownList>{dropdownItems}</DropdownList>
|
|
72
|
+
</Dropdown>
|
|
73
|
+
);
|
|
74
|
+
|
|
75
|
+
return (
|
|
76
|
+
<Card id="horizontal card" isExpanded={isCardExpanded}>
|
|
77
|
+
<CardHeader
|
|
78
|
+
actions={{ actions: headerActions }}
|
|
79
|
+
onExpand={onCardExpand}
|
|
80
|
+
toggleButtonProps={{
|
|
81
|
+
id: 'toggle-button',
|
|
82
|
+
'aria-label': 'Actions',
|
|
83
|
+
'aria-labelledby': 'titleId toggle-button',
|
|
84
|
+
'aria-expanded': isCardExpanded
|
|
85
|
+
}}
|
|
86
|
+
>
|
|
87
|
+
{isCardExpanded && <CardTitle id="titleId">Getting Started</CardTitle>}
|
|
88
|
+
{!isCardExpanded && (
|
|
89
|
+
<Level hasGutter>
|
|
90
|
+
<CardTitle id="titleId">Getting Started</CardTitle>
|
|
91
|
+
<LabelGroup isCompact>
|
|
92
|
+
<Label isCompact icon={<InfoCircleIcon />} color="blue">
|
|
93
|
+
Set up your cluster
|
|
94
|
+
</Label>
|
|
95
|
+
<Label isCompact icon={<InfoCircleIcon />} color="purple">
|
|
96
|
+
Guided tours
|
|
97
|
+
</Label>
|
|
98
|
+
<Label isCompact icon={<InfoCircleIcon />} color="green">
|
|
99
|
+
Quick starts
|
|
100
|
+
</Label>
|
|
101
|
+
<Label isCompact icon={<InfoCircleIcon />} color="orange">
|
|
102
|
+
Learning resources
|
|
103
|
+
</Label>
|
|
104
|
+
</LabelGroup>
|
|
105
|
+
</Level>
|
|
106
|
+
)}
|
|
107
|
+
</CardHeader>
|
|
108
|
+
<CardExpandableContent>
|
|
109
|
+
<CardBody>
|
|
110
|
+
<Grid md={6} lg={3} hasGutter>
|
|
111
|
+
<Flex
|
|
112
|
+
spaceItems={{ default: 'spaceItemsLg' }}
|
|
113
|
+
alignItems={{ default: 'alignItemsFlexStart' }}
|
|
114
|
+
direction={{ default: 'column' }}
|
|
115
|
+
>
|
|
116
|
+
<Flex
|
|
117
|
+
spaceItems={{ default: 'spaceItemsSm' }}
|
|
118
|
+
alignItems={{ default: 'alignItemsFlexStart' }}
|
|
119
|
+
direction={{ default: 'column' }}
|
|
120
|
+
grow={{ default: 'grow' }}
|
|
121
|
+
>
|
|
122
|
+
<Label icon={<InfoCircleIcon />} color="blue">
|
|
123
|
+
Set up your cluster
|
|
124
|
+
</Label>
|
|
125
|
+
<p>Continue setting up your cluster to access all you cain in the Console</p>
|
|
126
|
+
<List isPlain>
|
|
127
|
+
<ListItem>
|
|
128
|
+
<a href="#">Add identity provider</a>
|
|
129
|
+
</ListItem>
|
|
130
|
+
<ListItem>
|
|
131
|
+
<a href="#">Configure alert receivers</a>
|
|
132
|
+
</ListItem>
|
|
133
|
+
<ListItem>
|
|
134
|
+
<a href="#">Configure default ingress certificate</a>
|
|
135
|
+
</ListItem>
|
|
136
|
+
</List>
|
|
137
|
+
</Flex>
|
|
138
|
+
<Button href="#" component="a" variant="link" isInline icon={<ArrowRightIcon />} iconPosition="right">
|
|
139
|
+
View all set up cluster steps
|
|
140
|
+
</Button>
|
|
141
|
+
</Flex>
|
|
142
|
+
<Flex
|
|
143
|
+
spaceItems={{ default: 'spaceItemsLg' }}
|
|
144
|
+
alignItems={{ default: 'alignItemsFlexStart' }}
|
|
145
|
+
direction={{ default: 'column' }}
|
|
146
|
+
>
|
|
147
|
+
<Flex
|
|
148
|
+
spaceItems={{ default: 'spaceItemsSm' }}
|
|
149
|
+
alignItems={{ default: 'alignItemsFlexStart' }}
|
|
150
|
+
direction={{ default: 'column' }}
|
|
151
|
+
grow={{ default: 'grow' }}
|
|
152
|
+
>
|
|
153
|
+
<Label icon={<InfoCircleIcon />} color="purple">
|
|
154
|
+
Guided tours
|
|
155
|
+
</Label>
|
|
156
|
+
<p>Tour some of the key features around the console</p>
|
|
157
|
+
<List isPlain>
|
|
158
|
+
<ListItem>
|
|
159
|
+
<a href="#">Tour the console</a>
|
|
160
|
+
</ListItem>
|
|
161
|
+
<ListItem>
|
|
162
|
+
<a href="#">Getting started with Serverless</a>
|
|
163
|
+
</ListItem>
|
|
164
|
+
</List>
|
|
165
|
+
</Flex>
|
|
166
|
+
<Button href="#" component="a" variant="link" isInline icon={<ArrowRightIcon />} iconPosition="right">
|
|
167
|
+
View all guided tours
|
|
168
|
+
</Button>
|
|
169
|
+
</Flex>
|
|
170
|
+
<Flex
|
|
171
|
+
spaceItems={{ default: 'spaceItemsLg' }}
|
|
172
|
+
alignItems={{ default: 'alignItemsFlexStart' }}
|
|
173
|
+
direction={{ default: 'column' }}
|
|
174
|
+
>
|
|
175
|
+
<Flex
|
|
176
|
+
spaceItems={{ default: 'spaceItemsSm' }}
|
|
177
|
+
alignItems={{ default: 'alignItemsFlexStart' }}
|
|
178
|
+
direction={{ default: 'column' }}
|
|
179
|
+
grow={{ default: 'grow' }}
|
|
180
|
+
>
|
|
181
|
+
<Label icon={<InfoCircleIcon />} color="green">
|
|
182
|
+
Quick starts
|
|
183
|
+
</Label>
|
|
184
|
+
<p>Get started with features using our step-by-step documentation</p>
|
|
185
|
+
<List isPlain>
|
|
186
|
+
<ListItem>
|
|
187
|
+
<a href="#">Getting started with Serverless</a>
|
|
188
|
+
</ListItem>
|
|
189
|
+
<ListItem>
|
|
190
|
+
<a href="#">Explore virtualization</a>
|
|
191
|
+
</ListItem>
|
|
192
|
+
<ListItem>
|
|
193
|
+
<a href="#">Build pipelines</a>
|
|
194
|
+
</ListItem>
|
|
195
|
+
</List>
|
|
196
|
+
</Flex>
|
|
197
|
+
<Button href="#" component="a" variant="link" isInline icon={<ArrowRightIcon />} iconPosition="right">
|
|
198
|
+
View all quick starts
|
|
199
|
+
</Button>
|
|
200
|
+
</Flex>
|
|
201
|
+
<Flex
|
|
202
|
+
spaceItems={{ default: 'spaceItemsLg' }}
|
|
203
|
+
alignItems={{ default: 'alignItemsFlexStart' }}
|
|
204
|
+
direction={{ default: 'column' }}
|
|
205
|
+
>
|
|
206
|
+
<Flex
|
|
207
|
+
spaceItems={{ default: 'spaceItemsSm' }}
|
|
208
|
+
alignItems={{ default: 'alignItemsFlexStart' }}
|
|
209
|
+
direction={{ default: 'column' }}
|
|
210
|
+
grow={{ default: 'grow' }}
|
|
211
|
+
>
|
|
212
|
+
<Label icon={<InfoCircleIcon />} color="orange">
|
|
213
|
+
Learning resources
|
|
214
|
+
</Label>
|
|
215
|
+
<p>Learn about new features within the Console and get started with demo apps</p>
|
|
216
|
+
<List isPlain>
|
|
217
|
+
<ListItem>
|
|
218
|
+
<a href="#">See what's possible with the Explore page</a>
|
|
219
|
+
</ListItem>
|
|
220
|
+
<ListItem>
|
|
221
|
+
<a href="#">
|
|
222
|
+
OpenShift 4.5: Top Tasks
|
|
223
|
+
<ExternalLinkAltIcon />
|
|
224
|
+
</a>
|
|
225
|
+
</ListItem>
|
|
226
|
+
<ListItem>
|
|
227
|
+
<a href="#">Try a demo app</a>
|
|
228
|
+
</ListItem>
|
|
229
|
+
</List>
|
|
230
|
+
</Flex>
|
|
231
|
+
<Button href="#" component="a" variant="link" isInline icon={<ArrowRightIcon />} iconPosition="right">
|
|
232
|
+
View all learning resources
|
|
233
|
+
</Button>
|
|
234
|
+
</Flex>
|
|
235
|
+
</Grid>
|
|
236
|
+
</CardBody>
|
|
237
|
+
</CardExpandableContent>
|
|
238
|
+
</Card>
|
|
239
|
+
);
|
|
240
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Card, CardTitle, CardBody, CardFooter, Grid, GridItem, Button } from '@patternfly/react-core';
|
|
3
|
+
|
|
4
|
+
export const CardHorizontalSplitDemo: React.FunctionComponent = () => (
|
|
5
|
+
<Card id="card-demo-horizontal-split-example" isFlat>
|
|
6
|
+
<Grid md={6}>
|
|
7
|
+
<GridItem
|
|
8
|
+
style={{
|
|
9
|
+
minHeight: '200px',
|
|
10
|
+
backgroundPosition: 'center',
|
|
11
|
+
backgroundSize: 'cover',
|
|
12
|
+
backgroundImage:
|
|
13
|
+
'url(https://raw.githubusercontent.com/patternfly/patternfly-react/main/packages/react-integration/demo-app-ts/src/assets/images/pfbg_992.jpg)'
|
|
14
|
+
}}
|
|
15
|
+
/>
|
|
16
|
+
<GridItem>
|
|
17
|
+
<CardTitle>Headline</CardTitle>
|
|
18
|
+
<CardBody>
|
|
19
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse arcu purus, lobortis nec euismod eu,
|
|
20
|
+
tristique ut sapien. Nullam turpis lectus, aliquet sit amet volutpat eu, semper eget quam. Maecenas in tempus
|
|
21
|
+
diam. Aenean interdum velit sed massa aliquet, sit amet malesuada nulla hendrerit. Aenean non faucibus odio.
|
|
22
|
+
Etiam non metus turpis. Praesent sollicitudin elit neque, id ullamcorper nibh faucibus eget.
|
|
23
|
+
</CardBody>
|
|
24
|
+
<CardFooter>
|
|
25
|
+
<Button variant="tertiary">Call to action</Button>
|
|
26
|
+
</CardFooter>
|
|
27
|
+
</GridItem>
|
|
28
|
+
</Grid>
|
|
29
|
+
</Card>
|
|
30
|
+
);
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
/* eslint-disable camelcase */
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import {
|
|
4
|
+
Card,
|
|
5
|
+
CardHeader,
|
|
6
|
+
CardTitle,
|
|
7
|
+
CardBody,
|
|
8
|
+
CardFooter,
|
|
9
|
+
Gallery,
|
|
10
|
+
Title,
|
|
11
|
+
DescriptionList,
|
|
12
|
+
DescriptionListGroup,
|
|
13
|
+
DescriptionListTerm,
|
|
14
|
+
DescriptionListDescription,
|
|
15
|
+
Select,
|
|
16
|
+
SelectList,
|
|
17
|
+
SelectOption,
|
|
18
|
+
Divider,
|
|
19
|
+
MenuToggle,
|
|
20
|
+
MenuToggleElement
|
|
21
|
+
} from '@patternfly/react-core';
|
|
22
|
+
import text from '@patternfly/react-styles/css/utilities/Text/text';
|
|
23
|
+
import flex from '@patternfly/react-styles/css/utilities/Flex/flex';
|
|
24
|
+
import l_gallery_GridTemplateColumns_min from '@patternfly/react-tokens/dist/esm/l_gallery_GridTemplateColumns_min';
|
|
25
|
+
|
|
26
|
+
export const CardLogView: React.FunctionComponent = () => {
|
|
27
|
+
const [isOpen, setIsOpen] = React.useState(false);
|
|
28
|
+
|
|
29
|
+
const selectItems = (
|
|
30
|
+
<SelectList>
|
|
31
|
+
<SelectOption key="option1" value="Last hour">
|
|
32
|
+
Last hour
|
|
33
|
+
</SelectOption>
|
|
34
|
+
<SelectOption key="option2" value="Last 6 hours">
|
|
35
|
+
Last 6 hours
|
|
36
|
+
</SelectOption>
|
|
37
|
+
<SelectOption key="option3" value="Last 24 hours">
|
|
38
|
+
Last 24 hours
|
|
39
|
+
</SelectOption>
|
|
40
|
+
<SelectOption key="option4" value="Last 7 days">
|
|
41
|
+
Last 7 days
|
|
42
|
+
</SelectOption>
|
|
43
|
+
</SelectList>
|
|
44
|
+
);
|
|
45
|
+
|
|
46
|
+
const toggle = (toggleRef: React.Ref<MenuToggleElement>) => (
|
|
47
|
+
<MenuToggle ref={toggleRef} onClick={() => setIsOpen(!isOpen)} isExpanded={isOpen} variant="plainText">
|
|
48
|
+
Filter
|
|
49
|
+
</MenuToggle>
|
|
50
|
+
);
|
|
51
|
+
|
|
52
|
+
const headerActions = (
|
|
53
|
+
<Select onSelect={() => setIsOpen(!isOpen)} onOpenChange={setIsOpen} isOpen={isOpen} toggle={toggle}>
|
|
54
|
+
{selectItems}
|
|
55
|
+
</Select>
|
|
56
|
+
);
|
|
57
|
+
|
|
58
|
+
return (
|
|
59
|
+
<React.Fragment>
|
|
60
|
+
<b>Note:</b> Custom CSS is used in this demo to align the card title and select toggle text to{' '}
|
|
61
|
+
<code>baseline</code> alignment.
|
|
62
|
+
<br />
|
|
63
|
+
<br />
|
|
64
|
+
<Gallery hasGutter style={{ [l_gallery_GridTemplateColumns_min.name]: '360px' } as React.CSSProperties}>
|
|
65
|
+
<Card id="card-log-view-example">
|
|
66
|
+
<CardHeader className={flex.alignItemsFlexStart} actions={{ actions: headerActions, hasNoOffset: true }}>
|
|
67
|
+
<CardTitle>
|
|
68
|
+
<Title headingLevel="h4" size="xl" style={{ paddingTop: '3px' }}>
|
|
69
|
+
Activity
|
|
70
|
+
</Title>
|
|
71
|
+
</CardTitle>
|
|
72
|
+
</CardHeader>
|
|
73
|
+
<CardBody>
|
|
74
|
+
<DescriptionList>
|
|
75
|
+
<DescriptionListGroup>
|
|
76
|
+
<DescriptionListTerm>Readiness probe failed</DescriptionListTerm>
|
|
77
|
+
<DescriptionListDescription>
|
|
78
|
+
Readiness probe failed: Get https://10.131.0.7:5000/healthz: dial tcp 10.131.0.7:5000: connect:
|
|
79
|
+
connection refused
|
|
80
|
+
</DescriptionListDescription>
|
|
81
|
+
<DescriptionListDescription>
|
|
82
|
+
<time className={`${text.color_200} ${text.fontSizeSm}`}>Jun 17, 11:02 am</time>
|
|
83
|
+
</DescriptionListDescription>
|
|
84
|
+
</DescriptionListGroup>
|
|
85
|
+
<DescriptionListGroup>
|
|
86
|
+
<DescriptionListTerm>Successful assignment</DescriptionListTerm>
|
|
87
|
+
<DescriptionListDescription>
|
|
88
|
+
Successfully assigned default/example to ip-10-0-130-149.ec2.internal
|
|
89
|
+
</DescriptionListDescription>
|
|
90
|
+
<DescriptionListDescription>
|
|
91
|
+
<time className={`${text.color_200} ${text.fontSizeSm}`}>Jun 17, 11:13 am</time>
|
|
92
|
+
</DescriptionListDescription>
|
|
93
|
+
</DescriptionListGroup>
|
|
94
|
+
<DescriptionListGroup>
|
|
95
|
+
<DescriptionListTerm>Pulling image</DescriptionListTerm>
|
|
96
|
+
<DescriptionListDescription>Pulling image "openshift/hello-openshift"</DescriptionListDescription>
|
|
97
|
+
<DescriptionListDescription>
|
|
98
|
+
<time className={`${text.color_200} ${text.fontSizeSm}`}>Jun 17, 10:59 am</time>
|
|
99
|
+
</DescriptionListDescription>
|
|
100
|
+
</DescriptionListGroup>
|
|
101
|
+
<DescriptionListGroup>
|
|
102
|
+
<DescriptionListTerm>Created container</DescriptionListTerm>
|
|
103
|
+
<DescriptionListDescription>Created container hello-openshift</DescriptionListDescription>
|
|
104
|
+
<DescriptionListDescription>
|
|
105
|
+
<time className={`${text.color_200} ${text.fontSizeSm}`}>Jun 17, 10:45 am</time>
|
|
106
|
+
</DescriptionListDescription>
|
|
107
|
+
</DescriptionListGroup>
|
|
108
|
+
</DescriptionList>
|
|
109
|
+
</CardBody>
|
|
110
|
+
<Divider />
|
|
111
|
+
<CardFooter>
|
|
112
|
+
<a href="#">View all activity</a>
|
|
113
|
+
</CardFooter>
|
|
114
|
+
</Card>
|
|
115
|
+
</Gallery>
|
|
116
|
+
</React.Fragment>
|
|
117
|
+
);
|
|
118
|
+
};
|