@patternfly/react-core 5.2.0-prerelease.6 → 5.2.0-prerelease.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (144) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/components/package.json +1 -1
  3. package/deprecated/package.json +1 -1
  4. package/dist/dynamic/components/AboutModal/package.json +1 -1
  5. package/dist/dynamic/components/Accordion/package.json +1 -1
  6. package/dist/dynamic/components/ActionList/package.json +1 -1
  7. package/dist/dynamic/components/Alert/package.json +1 -1
  8. package/dist/dynamic/components/Avatar/package.json +1 -1
  9. package/dist/dynamic/components/BackToTop/package.json +1 -1
  10. package/dist/dynamic/components/Backdrop/package.json +1 -1
  11. package/dist/dynamic/components/BackgroundImage/package.json +1 -1
  12. package/dist/dynamic/components/Badge/package.json +1 -1
  13. package/dist/dynamic/components/Banner/package.json +1 -1
  14. package/dist/dynamic/components/Brand/package.json +1 -1
  15. package/dist/dynamic/components/Breadcrumb/package.json +1 -1
  16. package/dist/dynamic/components/Button/package.json +1 -1
  17. package/dist/dynamic/components/CalendarMonth/package.json +1 -1
  18. package/dist/dynamic/components/Card/package.json +1 -1
  19. package/dist/dynamic/components/Checkbox/package.json +1 -1
  20. package/dist/dynamic/components/Chip/package.json +1 -1
  21. package/dist/dynamic/components/ClipboardCopy/package.json +1 -1
  22. package/dist/dynamic/components/CodeBlock/package.json +1 -1
  23. package/dist/dynamic/components/DataList/package.json +1 -1
  24. package/dist/dynamic/components/DatePicker/package.json +1 -1
  25. package/dist/dynamic/components/DescriptionList/package.json +1 -1
  26. package/dist/dynamic/components/Divider/package.json +1 -1
  27. package/dist/dynamic/components/DragDrop/package.json +1 -1
  28. package/dist/dynamic/components/Drawer/package.json +1 -1
  29. package/dist/dynamic/components/Dropdown/package.json +1 -1
  30. package/dist/dynamic/components/DualListSelector/package.json +1 -1
  31. package/dist/dynamic/components/EmptyState/package.json +1 -1
  32. package/dist/dynamic/components/ExpandableSection/package.json +1 -1
  33. package/dist/dynamic/components/FileUpload/package.json +1 -1
  34. package/dist/dynamic/components/Form/package.json +1 -1
  35. package/dist/dynamic/components/FormSelect/package.json +1 -1
  36. package/dist/dynamic/components/HelperText/package.json +1 -1
  37. package/dist/dynamic/components/Hint/package.json +1 -1
  38. package/dist/dynamic/components/Icon/package.json +1 -1
  39. package/dist/dynamic/components/InputGroup/package.json +1 -1
  40. package/dist/dynamic/components/JumpLinks/package.json +1 -1
  41. package/dist/dynamic/components/Label/package.json +1 -1
  42. package/dist/dynamic/components/List/package.json +1 -1
  43. package/dist/dynamic/components/LoginPage/package.json +1 -1
  44. package/dist/dynamic/components/Masthead/package.json +1 -1
  45. package/dist/dynamic/components/Menu/package.json +1 -1
  46. package/dist/dynamic/components/MenuToggle/package.json +1 -1
  47. package/dist/dynamic/components/Modal/package.json +1 -1
  48. package/dist/dynamic/components/MultipleFileUpload/package.json +1 -1
  49. package/dist/dynamic/components/Nav/package.json +1 -1
  50. package/dist/dynamic/components/NotificationBadge/package.json +1 -1
  51. package/dist/dynamic/components/NotificationDrawer/package.json +1 -1
  52. package/dist/dynamic/components/NumberInput/package.json +1 -1
  53. package/dist/dynamic/components/OverflowMenu/package.json +1 -1
  54. package/dist/dynamic/components/Page/package.json +1 -1
  55. package/dist/dynamic/components/Pagination/package.json +1 -1
  56. package/dist/dynamic/components/Panel/package.json +1 -1
  57. package/dist/dynamic/components/Popover/package.json +1 -1
  58. package/dist/dynamic/components/Progress/package.json +1 -1
  59. package/dist/dynamic/components/ProgressStepper/package.json +1 -1
  60. package/dist/dynamic/components/Radio/package.json +1 -1
  61. package/dist/dynamic/components/SearchInput/package.json +1 -1
  62. package/dist/dynamic/components/Select/package.json +1 -1
  63. package/dist/dynamic/components/Sidebar/package.json +1 -1
  64. package/dist/dynamic/components/SimpleList/package.json +1 -1
  65. package/dist/dynamic/components/Skeleton/package.json +1 -1
  66. package/dist/dynamic/components/SkipToContent/package.json +1 -1
  67. package/dist/dynamic/components/Slider/package.json +1 -1
  68. package/dist/dynamic/components/Spinner/package.json +1 -1
  69. package/dist/dynamic/components/Switch/package.json +1 -1
  70. package/dist/dynamic/components/Tabs/package.json +1 -1
  71. package/dist/dynamic/components/Text/package.json +1 -1
  72. package/dist/dynamic/components/TextArea/package.json +1 -1
  73. package/dist/dynamic/components/TextInput/package.json +1 -1
  74. package/dist/dynamic/components/TextInputGroup/package.json +1 -1
  75. package/dist/dynamic/components/Tile/package.json +1 -1
  76. package/dist/dynamic/components/TimePicker/package.json +1 -1
  77. package/dist/dynamic/components/Timestamp/package.json +1 -1
  78. package/dist/dynamic/components/Title/package.json +1 -1
  79. package/dist/dynamic/components/ToggleGroup/package.json +1 -1
  80. package/dist/dynamic/components/Toolbar/package.json +1 -1
  81. package/dist/dynamic/components/Tooltip/package.json +1 -1
  82. package/dist/dynamic/components/TreeView/package.json +1 -1
  83. package/dist/dynamic/components/Truncate/package.json +1 -1
  84. package/dist/dynamic/components/Wizard/hooks/package.json +1 -1
  85. package/dist/dynamic/components/Wizard/package.json +1 -1
  86. package/dist/dynamic/deprecated/components/ApplicationLauncher/package.json +1 -1
  87. package/dist/dynamic/deprecated/components/ContextSelector/package.json +1 -1
  88. package/dist/dynamic/deprecated/components/Dropdown/package.json +1 -1
  89. package/dist/dynamic/deprecated/components/OptionsMenu/package.json +1 -1
  90. package/dist/dynamic/deprecated/components/PageHeader/package.json +1 -1
  91. package/dist/dynamic/deprecated/components/Select/package.json +1 -1
  92. package/dist/dynamic/deprecated/components/Wizard/package.json +1 -1
  93. package/dist/dynamic/deprecated/components/package.json +1 -1
  94. package/dist/dynamic/helpers/FocusTrap/FocusTrap/package.json +1 -1
  95. package/dist/dynamic/helpers/GenerateId/GenerateId/package.json +1 -1
  96. package/dist/dynamic/helpers/KeyboardHandler/package.json +1 -1
  97. package/dist/dynamic/helpers/OUIA/ouia/package.json +1 -1
  98. package/dist/dynamic/helpers/Popper/Popper/package.json +1 -1
  99. package/dist/dynamic/helpers/constants/package.json +1 -1
  100. package/dist/dynamic/helpers/datetimeUtils/package.json +1 -1
  101. package/dist/dynamic/helpers/favorites/package.json +1 -1
  102. package/dist/dynamic/helpers/fileUtils/package.json +1 -1
  103. package/dist/dynamic/helpers/htmlConstants/package.json +1 -1
  104. package/dist/dynamic/helpers/package.json +1 -1
  105. package/dist/dynamic/helpers/resizeObserver/package.json +1 -1
  106. package/dist/dynamic/helpers/typeUtils/package.json +1 -1
  107. package/dist/dynamic/helpers/useInterval/package.json +1 -1
  108. package/dist/dynamic/helpers/useIsomorphicLayout/package.json +1 -1
  109. package/dist/dynamic/helpers/useUnmountEffect/package.json +1 -1
  110. package/dist/dynamic/helpers/util/package.json +1 -1
  111. package/dist/dynamic/layouts/Bullseye/package.json +1 -1
  112. package/dist/dynamic/layouts/Flex/package.json +1 -1
  113. package/dist/dynamic/layouts/Gallery/package.json +1 -1
  114. package/dist/dynamic/layouts/Grid/package.json +1 -1
  115. package/dist/dynamic/layouts/Level/package.json +1 -1
  116. package/dist/dynamic/layouts/Split/package.json +1 -1
  117. package/dist/dynamic/layouts/Stack/package.json +1 -1
  118. package/dist/dynamic/next/components/package.json +1 -1
  119. package/helpers/package.json +1 -1
  120. package/layouts/package.json +1 -1
  121. package/next/package.json +1 -1
  122. package/package.json +2 -2
  123. package/src/components/Alert/examples/Alert.md +142 -103
  124. package/src/demos/CardDemos.md +16 -2933
  125. package/src/demos/{Card/Card.md → CardView/CardView.md} +1 -1
  126. package/src/demos/{Card → CardView}/examples/CardView.tsx +1 -1
  127. package/src/demos/PrimaryDetail.md +2 -2
  128. package/src/demos/examples/Card/CardAggregateStatus.tsx +249 -0
  129. package/src/demos/examples/Card/CardDetails.tsx +95 -0
  130. package/src/demos/examples/Card/CardEventsView.tsx +154 -0
  131. package/src/demos/examples/Card/CardHorizontalGrid.tsx +240 -0
  132. package/src/demos/examples/Card/CardHorizontalSplit.tsx +30 -0
  133. package/src/demos/examples/Card/CardLogView.tsx +118 -0
  134. package/src/demos/examples/Card/CardNested.tsx +532 -0
  135. package/src/demos/examples/Card/CardStatus.tsx +262 -0
  136. package/src/demos/examples/Card/CardStatusTabbed.tsx +113 -0
  137. package/src/demos/examples/Card/CardTrendDemo1.tsx +106 -0
  138. package/src/demos/examples/Card/CardTrendDemo2.tsx +76 -0
  139. package/src/demos/examples/Card/CardUtilizationDemo1.tsx +109 -0
  140. package/src/demos/examples/Card/CardUtilizationDemo2.tsx +103 -0
  141. package/src/demos/examples/Card/CardUtilizationDemo3.tsx +174 -0
  142. package/src/demos/examples/Card/CardUtilizationDemo4.tsx +50 -0
  143. package/src/demos/examples/Card/CardWithAccordion.tsx +514 -0
  144. /package/src/demos/{Card/examples/CardData.jsx → CardView/examples/CardViewData.jsx} +0 -0
@@ -16,7 +16,7 @@ import swaggerIcon from '../assets/camel-swagger-java_200x150.png';
16
16
  import azureIcon from '../assets/FuseConnector_Icons_AzureServices.png';
17
17
  import restIcon from '../assets/FuseConnector_Icons_REST.png';
18
18
  import EllipsisVIcon from '@patternfly/react-icons/dist/esm/icons/ellipsis-v-icon';
19
- import { data } from '@patternfly/react-core/src/demos/Card/examples/CardData.jsx';
19
+ import { data } from '@patternfly/react-core/src/demos/CardView/examples/CardViewData.jsx';
20
20
 
21
21
  ## Demos
22
22
 
@@ -52,7 +52,7 @@ import azureIcon from './assets/FuseConnector_Icons_AzureServices.png';
52
52
  import restIcon from './assets/FuseConnector_Icons_REST.png';
53
53
  import EllipsisVIcon from '@patternfly/react-icons/dist/esm/icons/ellipsis-v-icon';
54
54
  import { DashboardWrapper } from '@patternfly/react-core/src/demos/DashboardWrapper';
55
- import { data } from '@patternfly/react-core/src/demos/Card/examples/CardData.jsx';
55
+ import { data } from '@patternfly/react-core/src/demos/CardView/examples/CardViewData.jsx';
56
56
 
57
57
  export const CardViewBasic: React.FunctionComponent = () => {
58
58
  const totalItemCount = 10;
@@ -23,7 +23,7 @@ import swaggerIcon from './assets/camel-swagger-java_200x150.png';
23
23
  import azureIcon from './assets/FuseConnector_Icons_AzureServices.png';
24
24
  import restIcon from './assets/FuseConnector_Icons_REST.png';
25
25
  import EllipsisVIcon from '@patternfly/react-icons/dist/esm/icons/ellipsis-v-icon';
26
- import { data } from '@patternfly/react-core/src/demos/Card/examples/CardData.jsx';
26
+ import { data } from '@patternfly/react-core/src/demos/CardView/examples/CardViewData.jsx';
27
27
 
28
28
  ## Demos
29
29
 
@@ -89,7 +89,7 @@ import azureIcon from './assets/FuseConnector_Icons_AzureServices.png';
89
89
  import restIcon from './assets/FuseConnector_Icons_REST.png';
90
90
  import EllipsisVIcon from '@patternfly/react-icons/dist/esm/icons/ellipsis-v-icon';
91
91
  import { DashboardWrapper } from '@patternfly/react-core/src/demos/DashboardWrapper';
92
- import { data } from '@patternfly/react-core/src/demos/Card/examples/CardData.jsx';
92
+ import { data } from '@patternfly/react-core/src/demos/CardView/examples/CardViewData.jsx';
93
93
 
94
94
  class PrimaryDetailCardView extends React.Component {
95
95
  constructor(props) {
@@ -0,0 +1,249 @@
1
+ /* eslint-disable camelcase */
2
+ import * as React from 'react';
3
+ import {
4
+ Card,
5
+ CardBody,
6
+ CardTitle,
7
+ Divider,
8
+ Flex,
9
+ FlexItem,
10
+ Gallery,
11
+ Grid,
12
+ GridItem,
13
+ Stack
14
+ } from '@patternfly/react-core';
15
+ import CheckCircleIcon from '@patternfly/react-icons/dist/js/icons/check-circle-icon';
16
+ import ExclamationCircleIcon from '@patternfly/react-icons/dist/js/icons/exclamation-circle-icon';
17
+ import ExclamationTriangleIcon from '@patternfly/react-icons/dist/js/icons/exclamation-triangle-icon';
18
+ import TimesCircleIcon from '@patternfly/react-icons/dist/js/icons/times-circle-icon';
19
+ import global_success_color_100 from '@patternfly/react-tokens/dist/esm/global_success_color_100';
20
+ import global_warning_color_100 from '@patternfly/react-tokens/dist/esm/global_warning_color_100';
21
+ import global_danger_color_100 from '@patternfly/react-tokens/dist/esm/global_danger_color_100';
22
+ import l_gallery_GridTemplateColumns_min from '@patternfly/react-tokens/dist/esm/l_gallery_GridTemplateColumns_min';
23
+
24
+ interface ContentType {
25
+ icon?: React.ReactNode;
26
+ count?: number;
27
+ status?: string;
28
+ subtitle?: string;
29
+ }
30
+ interface CardData {
31
+ [attribute: string]: {
32
+ title: string;
33
+ content: {
34
+ icon: JSX.Element;
35
+ count?: number;
36
+ status?: string;
37
+ subtitle?: string;
38
+ }[];
39
+ layout: string;
40
+ }[];
41
+ }
42
+
43
+ const cardData: CardData = {
44
+ iconOnly: [
45
+ {
46
+ title: '5 Clusters',
47
+ content: [
48
+ {
49
+ icon: <CheckCircleIcon color={global_success_color_100.var} />
50
+ }
51
+ ],
52
+ layout: 'icon'
53
+ },
54
+ {
55
+ title: '15 Clusters',
56
+ content: [
57
+ {
58
+ icon: <ExclamationTriangleIcon color={global_warning_color_100.var} />
59
+ }
60
+ ],
61
+ layout: 'icon'
62
+ },
63
+ {
64
+ title: '3 Clusters',
65
+ content: [
66
+ {
67
+ icon: <TimesCircleIcon color={global_danger_color_100.var} />
68
+ }
69
+ ],
70
+ layout: 'icon'
71
+ }
72
+ ],
73
+ iconWithCount: [
74
+ {
75
+ title: '10 Hosts',
76
+ content: [
77
+ {
78
+ icon: <ExclamationCircleIcon color={global_success_color_100.var} />,
79
+ count: 2
80
+ },
81
+ {
82
+ icon: <ExclamationTriangleIcon color={global_warning_color_100.var} />,
83
+ count: 1
84
+ }
85
+ ],
86
+ layout: 'multiIcon'
87
+ },
88
+ {
89
+ title: '50 Hosts',
90
+ content: [
91
+ {
92
+ icon: <CheckCircleIcon color={global_success_color_100.var} />,
93
+ count: 5
94
+ },
95
+ {
96
+ icon: <TimesCircleIcon color={global_danger_color_100.var} />,
97
+ count: 12
98
+ }
99
+ ],
100
+ layout: 'multiIcon'
101
+ },
102
+ {
103
+ title: '12 Hosts',
104
+ content: [
105
+ {
106
+ icon: <ExclamationTriangleIcon color={global_warning_color_100.var} />,
107
+ count: 3
108
+ },
109
+ {
110
+ icon: <TimesCircleIcon color={global_danger_color_100.var} />,
111
+ count: 7
112
+ }
113
+ ],
114
+ layout: 'multiIcon'
115
+ }
116
+ ],
117
+ withSubtitle: [
118
+ {
119
+ title: '13 Hosts',
120
+ content: [
121
+ {
122
+ icon: <TimesCircleIcon color={global_danger_color_100.var} />,
123
+ status: '2 errors',
124
+ subtitle: 'subtitle'
125
+ },
126
+ {
127
+ icon: <ExclamationTriangleIcon color={global_warning_color_100.var} />,
128
+ status: '1 warning',
129
+ subtitle: 'subtitle'
130
+ }
131
+ ],
132
+ layout: 'withSubtitle'
133
+ },
134
+ {
135
+ title: '3 Hosts',
136
+ content: [
137
+ {
138
+ icon: <CheckCircleIcon color={global_success_color_100.var} />,
139
+ status: '2 successes',
140
+ subtitle: 'subtitle'
141
+ },
142
+ {
143
+ icon: <ExclamationTriangleIcon color={global_warning_color_100.var} />,
144
+ status: '3 warnings',
145
+ subtitle: 'subtitle'
146
+ }
147
+ ],
148
+ layout: 'withSubtitle'
149
+ },
150
+ {
151
+ title: '50 Hosts',
152
+ content: [
153
+ {
154
+ icon: <ExclamationTriangleIcon color={global_warning_color_100.var} />,
155
+ status: '7 warnings',
156
+ subtitle: 'subtitle'
157
+ },
158
+ {
159
+ icon: <TimesCircleIcon color={global_danger_color_100.var} />,
160
+ status: '1 error',
161
+ subtitle: 'subtitle'
162
+ }
163
+ ],
164
+ layout: 'withSubtitle'
165
+ }
166
+ ]
167
+ };
168
+
169
+ export const CardAggregateStatus: React.FunctionComponent = () => {
170
+ const renderContent = (content: ContentType[], layout: string) => {
171
+ if (layout === 'icon') {
172
+ return content[0].icon;
173
+ }
174
+ if (layout === 'multiIcon') {
175
+ return (
176
+ <Flex display={{ default: 'inlineFlex' }}>
177
+ {content.map(({ icon, count }, index: number) => (
178
+ <React.Fragment key={index}>
179
+ <Flex spaceItems={{ default: 'spaceItemsSm' }}>
180
+ <FlexItem>{icon}</FlexItem>
181
+ <FlexItem>
182
+ <a href="#">{count}</a>
183
+ </FlexItem>
184
+ </Flex>
185
+ {content.length > 1 && index === 0 && (
186
+ <Divider
187
+ key={`${index}_d`}
188
+ orientation={{
189
+ default: 'vertical'
190
+ }}
191
+ />
192
+ )}
193
+ </React.Fragment>
194
+ ))}
195
+ </Flex>
196
+ );
197
+ }
198
+ if (layout === 'withSubtitle') {
199
+ return (
200
+ <Flex justifyContent={{ default: 'justifyContentSpaceAround' }}>
201
+ {content.map(({ icon, status, subtitle }, index: number) => (
202
+ <Flex key={index}>
203
+ <FlexItem>{icon}</FlexItem>
204
+ <Stack>
205
+ <a href="#">{status}</a>
206
+ <span>{subtitle}</span>
207
+ </Stack>
208
+ </Flex>
209
+ ))}
210
+ </Flex>
211
+ );
212
+ }
213
+ };
214
+ return (
215
+ <Grid hasGutter>
216
+ {Object.keys(cardData).map((cardGroup, groupIndex) => {
217
+ let galleryWidth: string = '';
218
+ let cardAlign: string;
219
+ let titleAlign: string;
220
+ if (cardGroup === 'withSubtitle') {
221
+ galleryWidth = '260px';
222
+ cardAlign = '';
223
+ titleAlign = 'center';
224
+ } else {
225
+ cardAlign = 'center';
226
+ }
227
+ return (
228
+ <GridItem key={groupIndex}>
229
+ <Gallery
230
+ hasGutter
231
+ style={{ [l_gallery_GridTemplateColumns_min.name]: galleryWidth } as React.CSSProperties}
232
+ >
233
+ {cardData[cardGroup].map(({ title, content, layout }, cardIndex: number) => (
234
+ <Card
235
+ style={{ textAlign: cardAlign } as React.CSSProperties}
236
+ key={`${groupIndex}${cardIndex}`}
237
+ component="div"
238
+ >
239
+ <CardTitle style={{ textAlign: titleAlign } as React.CSSProperties}>{title}</CardTitle>
240
+ <CardBody>{renderContent(content, layout)}</CardBody>
241
+ </Card>
242
+ ))}
243
+ </Gallery>
244
+ </GridItem>
245
+ );
246
+ })}
247
+ </Grid>
248
+ );
249
+ };
@@ -0,0 +1,95 @@
1
+ /* eslint-disable camelcase */
2
+ import React from 'react';
3
+ import {
4
+ Card,
5
+ CardTitle,
6
+ CardBody,
7
+ CardFooter,
8
+ Gallery,
9
+ Title,
10
+ DescriptionList,
11
+ DescriptionListGroup,
12
+ DescriptionListTerm,
13
+ DescriptionListDescription,
14
+ Divider
15
+ } from '@patternfly/react-core';
16
+ import l_gallery_GridTemplateColumns_min from '@patternfly/react-tokens/dist/esm/l_gallery_GridTemplateColumns_min';
17
+
18
+ export const CardDetailsDemo: React.FunctionComponent = () => (
19
+ <Gallery hasGutter style={{ [l_gallery_GridTemplateColumns_min.name]: '260px' } as React.CSSProperties}>
20
+ <Card>
21
+ <CardTitle>
22
+ <Title headingLevel="h4" size="xl">
23
+ Details
24
+ </Title>
25
+ </CardTitle>
26
+ <CardBody>
27
+ <DescriptionList>
28
+ <DescriptionListGroup>
29
+ <DescriptionListTerm>Cluster API Address</DescriptionListTerm>
30
+ <DescriptionListDescription>
31
+ <a href="#">https://api1.devcluster.openshift.com</a>
32
+ </DescriptionListDescription>
33
+ </DescriptionListGroup>
34
+ <DescriptionListGroup>
35
+ <DescriptionListTerm>Cluster ID</DescriptionListTerm>
36
+ <DescriptionListDescription>63b97ac1-b850-41d9-8820-239becde9e86</DescriptionListDescription>
37
+ </DescriptionListGroup>
38
+ <DescriptionListGroup>
39
+ <DescriptionListTerm>Provide</DescriptionListTerm>
40
+ <DescriptionListDescription>AWS</DescriptionListDescription>
41
+ </DescriptionListGroup>
42
+ <DescriptionListGroup>
43
+ <DescriptionListTerm>OpenShift Version</DescriptionListTerm>
44
+ <DescriptionListDescription>4.5.0.ci-2020-06-16-015028</DescriptionListDescription>
45
+ </DescriptionListGroup>
46
+ <DescriptionListGroup>
47
+ <DescriptionListTerm>Update Channel</DescriptionListTerm>
48
+ <DescriptionListDescription>stable-4.5</DescriptionListDescription>
49
+ </DescriptionListGroup>
50
+ </DescriptionList>
51
+ </CardBody>
52
+ <Divider />
53
+ <CardFooter>
54
+ <a href="#">View Settings</a>
55
+ </CardFooter>
56
+ </Card>
57
+ <Card>
58
+ <CardTitle>
59
+ <Title headingLevel="h4" size="xl">
60
+ Details
61
+ </Title>
62
+ </CardTitle>
63
+ <CardBody>
64
+ <DescriptionList>
65
+ <DescriptionListGroup>
66
+ <DescriptionListTerm>Cluster API Address</DescriptionListTerm>
67
+ <DescriptionListDescription>
68
+ <a href="#">https://api2.devcluster.openshift.com</a>
69
+ </DescriptionListDescription>
70
+ </DescriptionListGroup>
71
+ <DescriptionListGroup>
72
+ <DescriptionListTerm>Cluster ID</DescriptionListTerm>
73
+ <DescriptionListDescription>08908908-b850-41d9-8820-239becde9e86</DescriptionListDescription>
74
+ </DescriptionListGroup>
75
+ <DescriptionListGroup>
76
+ <DescriptionListTerm>Provider</DescriptionListTerm>
77
+ <DescriptionListDescription>Azure</DescriptionListDescription>
78
+ </DescriptionListGroup>
79
+ <DescriptionListGroup>
80
+ <DescriptionListTerm>OpenShift Version</DescriptionListTerm>
81
+ <DescriptionListDescription>4.5.0.ci-2020-06-16-015026</DescriptionListDescription>
82
+ </DescriptionListGroup>
83
+ <DescriptionListGroup>
84
+ <DescriptionListTerm>Update Channel</DescriptionListTerm>
85
+ <DescriptionListDescription>stable-4.4</DescriptionListDescription>
86
+ </DescriptionListGroup>
87
+ </DescriptionList>
88
+ </CardBody>
89
+ <Divider />
90
+ <CardFooter>
91
+ <a href="#">View Settings</a>
92
+ </CardFooter>
93
+ </Card>
94
+ </Gallery>
95
+ );
@@ -0,0 +1,154 @@
1
+ /* eslint-disable camelcase */
2
+ import React from 'react';
3
+ import {
4
+ Card,
5
+ CardHeader,
6
+ CardTitle,
7
+ CardBody,
8
+ CardFooter,
9
+ Gallery,
10
+ Flex,
11
+ FlexItem,
12
+ Title,
13
+ DescriptionList,
14
+ DescriptionListGroup,
15
+ DescriptionListTerm,
16
+ DescriptionListDescription,
17
+ Spinner,
18
+ Select,
19
+ SelectList,
20
+ SelectOption,
21
+ Divider,
22
+ MenuToggle
23
+ } from '@patternfly/react-core';
24
+ import ExclamationCircleIcon from '@patternfly/react-icons/dist/esm/icons/exclamation-circle-icon';
25
+ import CheckCircleIcon from '@patternfly/react-icons/dist/esm/icons/check-circle-icon';
26
+ import flex from '@patternfly/react-styles/css/utilities/Flex/flex';
27
+ import text from '@patternfly/react-styles/css/utilities/Text/text';
28
+ import l_gallery_GridTemplateColumns_min from '@patternfly/react-tokens/dist/esm/l_gallery_GridTemplateColumns_min';
29
+
30
+ export const CardEventsView: React.FunctionComponent = () => {
31
+ const [isOpen, setIsOpen] = React.useState(false);
32
+
33
+ const selectItems = (
34
+ <SelectList>
35
+ <SelectOption value="Success" key="option1">
36
+ Success
37
+ </SelectOption>
38
+ <SelectOption value="Error" key="option2">
39
+ Error
40
+ </SelectOption>
41
+ <SelectOption value="Warning" key="option3">
42
+ Error
43
+ </SelectOption>
44
+ </SelectList>
45
+ );
46
+
47
+ const toggle = (toggleRef) => (
48
+ <MenuToggle ref={toggleRef} onClick={() => setIsOpen(!isOpen)} isExpanded={isOpen} variant="plainText">
49
+ Status
50
+ </MenuToggle>
51
+ );
52
+
53
+ const headerActions = (
54
+ <Select onSelect={() => setIsOpen(!isOpen)} onOpenChange={setIsOpen} isOpen={isOpen} toggle={toggle}>
55
+ {selectItems}
56
+ </Select>
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-events-view-example">
66
+ <CardHeader className={flex.alignItemsFlexStart} actions={{ actions: headerActions, hasNoOffset: true }}>
67
+ <CardTitle>
68
+ <Title headingLevel="h4" size="xl" style={{ paddingTop: '3px' }}>
69
+ Events
70
+ </Title>
71
+ </CardTitle>
72
+ </CardHeader>
73
+ <CardBody>
74
+ <DescriptionList>
75
+ <DescriptionListGroup>
76
+ <DescriptionListTerm>
77
+ <Flex flexWrap={{ default: 'nowrap' }}>
78
+ <FlexItem>
79
+ <ExclamationCircleIcon className={text.dangerColor_100} aria-hidden="true" />
80
+ </FlexItem>
81
+ <FlexItem>
82
+ <span>Readiness probe failed</span>
83
+ </FlexItem>
84
+ </Flex>
85
+ </DescriptionListTerm>
86
+ <DescriptionListDescription>
87
+ Readiness probe failed: Get https://10.131.0.7:5000/healthz: dial tcp 10.131.0.7:5000: connect:
88
+ connection refused
89
+ </DescriptionListDescription>
90
+ <DescriptionListDescription>
91
+ <time className={`${text.color_200} ${text.fontSizeSm}`}>Jun 17, 11:02 am</time>
92
+ </DescriptionListDescription>
93
+ </DescriptionListGroup>
94
+ <DescriptionListGroup>
95
+ <DescriptionListTerm>
96
+ <Flex flexWrap={{ default: 'nowrap' }}>
97
+ <FlexItem>
98
+ <CheckCircleIcon className={text.successColor_100} aria-hidden="true" />
99
+ </FlexItem>
100
+ <FlexItem>
101
+ <span>Successful assignment</span>
102
+ </FlexItem>
103
+ </Flex>
104
+ </DescriptionListTerm>
105
+ <DescriptionListDescription>
106
+ Successfully assigned default/example to ip-10-0-130-149.ec2.internal
107
+ </DescriptionListDescription>
108
+ <DescriptionListDescription>
109
+ <time className={`${text.color_200} ${text.fontSizeSm}`}>Jun 17, 11:13 am</time>
110
+ </DescriptionListDescription>
111
+ </DescriptionListGroup>
112
+ <DescriptionListGroup>
113
+ <DescriptionListTerm>
114
+ <Flex flexWrap={{ default: 'nowrap' }}>
115
+ <FlexItem>
116
+ <Spinner size="md" aria-label="loading spinner" />
117
+ </FlexItem>
118
+ <FlexItem>
119
+ <span>Pulling image</span>
120
+ </FlexItem>
121
+ </Flex>
122
+ </DescriptionListTerm>
123
+ <DescriptionListDescription>Pulling image "openshift/hello-openshift"</DescriptionListDescription>
124
+ <DescriptionListDescription>
125
+ <time className={`${text.color_200} ${text.fontSizeSm}`}>Jun 17, 10:59 am</time>
126
+ </DescriptionListDescription>
127
+ </DescriptionListGroup>
128
+ <DescriptionListGroup>
129
+ <DescriptionListTerm>
130
+ <Flex flexWrap={{ default: 'nowrap' }}>
131
+ <FlexItem>
132
+ <CheckCircleIcon className={text.successColor_100} aria-hidden="true" />
133
+ </FlexItem>
134
+ <FlexItem>
135
+ <span>Created container</span>
136
+ </FlexItem>
137
+ </Flex>
138
+ </DescriptionListTerm>
139
+ <DescriptionListDescription>Created container hello-openshift</DescriptionListDescription>
140
+ <DescriptionListDescription>
141
+ <time className={`${text.color_200} ${text.fontSizeSm}`}>Jun 17, 10:45 am</time>
142
+ </DescriptionListDescription>
143
+ </DescriptionListGroup>
144
+ </DescriptionList>
145
+ </CardBody>
146
+ <Divider />
147
+ <CardFooter>
148
+ <a href="#">View all events</a>
149
+ </CardFooter>
150
+ </Card>
151
+ </Gallery>
152
+ </React.Fragment>
153
+ );
154
+ };