@patternfly/react-core 4.221.6 → 4.221.9

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 (33) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/dist/esm/components/Label/Label.d.ts +1 -1
  3. package/dist/esm/components/Label/Label.d.ts.map +1 -1
  4. package/dist/esm/components/Label/Label.js +1 -0
  5. package/dist/esm/components/Label/Label.js.map +1 -1
  6. package/dist/js/components/Label/Label.d.ts +1 -1
  7. package/dist/js/components/Label/Label.d.ts.map +1 -1
  8. package/dist/js/components/Label/Label.js +1 -0
  9. package/dist/js/components/Label/Label.js.map +1 -1
  10. package/dist/umd/react-core.js +1 -0
  11. package/dist/umd/react-core.min.js +1 -1
  12. package/package.json +5 -5
  13. package/src/components/EmptyState/examples/EmptyState.md +7 -193
  14. package/src/components/EmptyState/examples/EmptyStateBasic.tsx +32 -0
  15. package/src/components/EmptyState/examples/EmptyStateExtraLarge.tsx +33 -0
  16. package/src/components/EmptyState/examples/EmptyStateExtraSmall.tsx +29 -0
  17. package/src/components/EmptyState/examples/EmptyStateLarge.tsx +33 -0
  18. package/src/components/EmptyState/examples/EmptyStateNoMatchFound.tsx +16 -0
  19. package/src/components/EmptyState/examples/EmptyStateSmall.tsx +33 -0
  20. package/src/components/EmptyState/examples/EmptyStateSpinner.tsx +11 -0
  21. package/src/components/HelperText/examples/HelperText.md +6 -153
  22. package/src/components/HelperText/examples/HelperTextDynamic.tsx +41 -0
  23. package/src/components/HelperText/examples/HelperTextDynamicList.tsx +16 -0
  24. package/src/components/HelperText/examples/HelperTextMultipleStatic.tsx +10 -0
  25. package/src/components/HelperText/examples/HelperTextStatic.tsx +22 -0
  26. package/src/components/HelperText/examples/HelperTextStaticWithCustomIcon.tsx +35 -0
  27. package/src/components/HelperText/examples/HelperTextStaticWithDefaultIcon.tsx +30 -0
  28. package/src/components/Hint/examples/Hint.md +2 -167
  29. package/src/components/Hint/examples/HintBasicWithTitle.tsx +65 -0
  30. package/src/components/Hint/examples/HintBasicWithoutTitle.tsx +74 -0
  31. package/src/components/Label/Label.tsx +2 -1
  32. package/src/components/Label/examples/Label.md +44 -0
  33. package/src/components/Tabs/examples/Tabs.md +2 -2
@@ -0,0 +1,16 @@
1
+ import React from 'react';
2
+ import { HelperText, HelperTextItem } from '@patternfly/react-core';
3
+
4
+ export const HelperTextDynamicList: React.FunctionComponent = () => (
5
+ <HelperText component="ul">
6
+ <HelperTextItem isDynamic variant="success" component="li">
7
+ Must be at least 14 characters
8
+ </HelperTextItem>
9
+ <HelperTextItem isDynamic variant="error" component="li">
10
+ Cannot contain any variation of the word "redhat"
11
+ </HelperTextItem>
12
+ <HelperTextItem isDynamic variant="success" component="li">
13
+ Must include at least 3 of the following: lowercase letter, uppercase letters, numbers, symbols
14
+ </HelperTextItem>
15
+ </HelperText>
16
+ );
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import { HelperText, HelperTextItem } from '@patternfly/react-core';
3
+
4
+ export const HelperTextMultipleStatic: React.FunctionComponent = () => (
5
+ <HelperText>
6
+ <HelperTextItem>This is default helper text</HelperTextItem>
7
+ <HelperTextItem>This is another default helper text in the same block</HelperTextItem>
8
+ <HelperTextItem>And this is more default text in the same block</HelperTextItem>
9
+ </HelperText>
10
+ );
@@ -0,0 +1,22 @@
1
+ import React from 'react';
2
+ import { HelperText, HelperTextItem } from '@patternfly/react-core';
3
+
4
+ export const HelperTextStatic: React.FunctionComponent = () => (
5
+ <React.Fragment>
6
+ <HelperText>
7
+ <HelperTextItem>This is default helper text</HelperTextItem>
8
+ </HelperText>
9
+ <HelperText>
10
+ <HelperTextItem variant="indeterminate">This is indeterminate helper text</HelperTextItem>
11
+ </HelperText>
12
+ <HelperText>
13
+ <HelperTextItem variant="warning">This is warning helper text</HelperTextItem>
14
+ </HelperText>
15
+ <HelperText>
16
+ <HelperTextItem variant="success">This is success helper text</HelperTextItem>
17
+ </HelperText>
18
+ <HelperText>
19
+ <HelperTextItem variant="error">This is error helper text</HelperTextItem>
20
+ </HelperText>
21
+ </React.Fragment>
22
+ );
@@ -0,0 +1,35 @@
1
+ import React from 'react';
2
+ import { HelperText, HelperTextItem } from '@patternfly/react-core';
3
+ import InfoIcon from '@patternfly/react-icons/dist/esm/icons/info-icon';
4
+ import QuestionIcon from '@patternfly/react-icons/dist/esm/icons/question-icon';
5
+ import ExclamationIcon from '@patternfly/react-icons/dist/esm/icons/exclamation-icon';
6
+ import CheckIcon from '@patternfly/react-icons/dist/esm/icons/check-icon';
7
+ import TimesIcon from '@patternfly/react-icons/dist/esm/icons/times-icon';
8
+
9
+ export const HelperTextStaticWithCustomIcon: React.FunctionComponent = () => (
10
+ <React.Fragment>
11
+ <HelperText>
12
+ <HelperTextItem icon={<InfoIcon />}>This is default helper text</HelperTextItem>
13
+ </HelperText>
14
+ <HelperText>
15
+ <HelperTextItem variant="indeterminate" icon={<QuestionIcon />}>
16
+ This is indeterminate helper text
17
+ </HelperTextItem>
18
+ </HelperText>
19
+ <HelperText>
20
+ <HelperTextItem variant="warning" icon={<ExclamationIcon />}>
21
+ This is warning helper text
22
+ </HelperTextItem>
23
+ </HelperText>
24
+ <HelperText>
25
+ <HelperTextItem variant="success" icon={<CheckIcon />}>
26
+ This is success helper text
27
+ </HelperTextItem>
28
+ </HelperText>
29
+ <HelperText>
30
+ <HelperTextItem variant="error" icon={<TimesIcon />}>
31
+ This is error helper text
32
+ </HelperTextItem>
33
+ </HelperText>
34
+ </React.Fragment>
35
+ );
@@ -0,0 +1,30 @@
1
+ import React from 'react';
2
+ import { HelperText, HelperTextItem } from '@patternfly/react-core';
3
+
4
+ export const HelperTextStaticWithDefaultIcon: React.FunctionComponent = () => (
5
+ <React.Fragment>
6
+ <HelperText>
7
+ <HelperTextItem hasIcon>This is default helper text</HelperTextItem>
8
+ </HelperText>
9
+ <HelperText>
10
+ <HelperTextItem variant="indeterminate" hasIcon>
11
+ This is indeterminate helper text
12
+ </HelperTextItem>
13
+ </HelperText>
14
+ <HelperText>
15
+ <HelperTextItem variant="warning" hasIcon>
16
+ This is warning helper text
17
+ </HelperTextItem>
18
+ </HelperText>
19
+ <HelperText>
20
+ <HelperTextItem variant="success" hasIcon>
21
+ This is success helper text
22
+ </HelperTextItem>
23
+ </HelperText>
24
+ <HelperText>
25
+ <HelperTextItem variant="error" hasIcon>
26
+ This is error helper text
27
+ </HelperTextItem>
28
+ </HelperText>
29
+ </React.Fragment>
30
+ );
@@ -9,175 +9,10 @@ propComponents: ['Hint', 'HintTitle', 'HintBody', 'HintFooter']
9
9
 
10
10
  ### Basic with title
11
11
 
12
- ```js
13
- import React from 'react';
14
- import {
15
- Hint,
16
- HintTitle,
17
- HintBody,
18
- HintFooter,
19
- Button,
20
- Dropdown,
21
- DropdownToggle,
22
- DropdownItem,
23
- DropdownSeparator,
24
- DropdownPosition,
25
- DropdownDirection,
26
- KebabToggle
27
- } from '@patternfly/react-core';
28
-
29
- class BasicHint extends React.Component {
30
- constructor(props) {
31
- super(props);
32
- this.state = {
33
- isOpen: false
34
- };
35
- this.onToggle = isOpen => {
36
- this.setState({
37
- isOpen
38
- });
39
- };
40
- this.onSelect = event => {
41
- this.setState({
42
- isOpen: !this.state.isOpen
43
- });
44
- };
45
- }
46
-
47
- render() {
48
- const { isOpen } = this.state;
49
- const dropdownItems = [
50
- <DropdownItem key="link">Link</DropdownItem>,
51
- <DropdownItem key="action" component="button">
52
- Action
53
- </DropdownItem>,
54
- <DropdownItem key="disabled link" isDisabled>
55
- Disabled Link
56
- </DropdownItem>,
57
- <DropdownItem key="disabled action" isDisabled component="button">
58
- Disabled Action
59
- </DropdownItem>,
60
- <DropdownSeparator key="separator" />,
61
- <DropdownItem key="separated link">Separated Link</DropdownItem>,
62
- <DropdownItem key="separated action" component="button">
63
- Separated Action
64
- </DropdownItem>
65
- ];
66
- const actions = (
67
- <Dropdown
68
- onSelect={this.onSelect}
69
- toggle={<KebabToggle onToggle={this.onToggle} id="hint-kebab-toggle" />}
70
- isOpen={isOpen}
71
- dropdownItems={dropdownItems}
72
- position="right"
73
- isPlain
74
- />
75
- );
76
- return (
77
- <Hint actions={actions}>
78
- <HintTitle>Do more with Find it Fix it capabilities</HintTitle>
79
- <HintBody>
80
- Upgrade to Red Hat Smart Management to remediate all your systems across regions and geographies.
81
- </HintBody>
82
- <HintFooter>
83
- <Button variant="link" isInline>
84
- Try it for 90 days
85
- </Button>
86
- </HintFooter>
87
- </Hint>
88
- );
89
- }
90
- }
12
+ ```ts file="HintBasicWithTitle.tsx"
91
13
  ```
92
14
 
93
15
  ### Basic without title
94
16
 
95
- ```js
96
- import React from 'react';
97
- import {
98
- Hint,
99
- HintBody,
100
- HintFooter,
101
- Button,
102
- Dropdown,
103
- DropdownToggle,
104
- DropdownItem,
105
- DropdownSeparator,
106
- DropdownPosition,
107
- DropdownDirection,
108
- KebabToggle
109
- } from '@patternfly/react-core';
110
-
111
- class BasicHint extends React.Component {
112
- constructor(props) {
113
- super(props);
114
- this.state = {
115
- isOpen: false
116
- };
117
- this.onToggle = isOpen => {
118
- this.setState({
119
- isOpen
120
- });
121
- };
122
- this.onSelect = event => {
123
- this.setState({
124
- isOpen: !this.state.isOpen
125
- });
126
- };
127
- }
128
-
129
- render() {
130
- const { isOpen } = this.state;
131
- const dropdownItems = [
132
- <DropdownItem key="link">Link</DropdownItem>,
133
- <DropdownItem key="action" component="button">
134
- Action
135
- </DropdownItem>,
136
- <DropdownItem key="disabled link" isDisabled>
137
- Disabled Link
138
- </DropdownItem>,
139
- <DropdownItem key="disabled action" isDisabled component="button">
140
- Disabled Action
141
- </DropdownItem>,
142
- <DropdownSeparator key="separator" />,
143
- <DropdownItem key="separated link">Separated Link</DropdownItem>,
144
- <DropdownItem key="separated action" component="button">
145
- Separated Action
146
- </DropdownItem>
147
- ];
148
- const actions = (
149
- <Dropdown
150
- onSelect={this.onSelect}
151
- toggle={<KebabToggle onToggle={this.onToggle} id="hint-notitle-kebab-toggle" />}
152
- isOpen={isOpen}
153
- dropdownItems={dropdownItems}
154
- position="right"
155
- isPlain
156
- />
157
- );
158
- return (
159
- <React.Fragment>
160
- <Hint>
161
- <HintBody>
162
- Welcome to the new documentation experience.
163
- <Button variant="link" isInline>
164
- Learn more about the improved features.
165
- </Button>
166
- </HintBody>
167
- </Hint>
168
- <br />
169
- <Hint actions={actions}>
170
- <HintBody>
171
- Upgrade to Red Hat Smart Management to remediate all your systems across regions and geographies.
172
- </HintBody>
173
- <HintFooter>
174
- <Button variant="link" isInline>
175
- Try it for 90 days
176
- </Button>
177
- </HintFooter>
178
- </Hint>
179
- </React.Fragment>
180
- );
181
- }
182
- }
17
+ ```ts file="HintBasicWithoutTitle.tsx"
183
18
  ```
@@ -0,0 +1,65 @@
1
+ import React from 'react';
2
+ import {
3
+ Hint,
4
+ HintTitle,
5
+ HintBody,
6
+ HintFooter,
7
+ Button,
8
+ Dropdown,
9
+ DropdownItem,
10
+ DropdownSeparator,
11
+ KebabToggle
12
+ } from '@patternfly/react-core';
13
+
14
+ export const HintBasicWithTitle: React.FunctionComponent = () => {
15
+ const [isOpen, setIsOpen] = React.useState<boolean>(false);
16
+
17
+ const onToggle = (isOpen: boolean) => {
18
+ setIsOpen(isOpen);
19
+ };
20
+
21
+ const onSelect = () => {
22
+ setIsOpen(!isOpen);
23
+ };
24
+
25
+ const dropdownItems = [
26
+ <DropdownItem key="link">Link</DropdownItem>,
27
+ <DropdownItem key="action" component="button">
28
+ Action
29
+ </DropdownItem>,
30
+ <DropdownItem key="disabled link" isDisabled>
31
+ Disabled Link
32
+ </DropdownItem>,
33
+ <DropdownItem key="disabled action" isDisabled component="button">
34
+ Disabled Action
35
+ </DropdownItem>,
36
+ <DropdownSeparator key="separator" />,
37
+ <DropdownItem key="separated link">Separated Link</DropdownItem>,
38
+ <DropdownItem key="separated action" component="button">
39
+ Separated Action
40
+ </DropdownItem>
41
+ ];
42
+ const actions = (
43
+ <Dropdown
44
+ onSelect={onSelect}
45
+ toggle={<KebabToggle onToggle={onToggle} id="hint-kebab-toggle" />}
46
+ isOpen={isOpen}
47
+ dropdownItems={dropdownItems}
48
+ position="right"
49
+ isPlain
50
+ />
51
+ );
52
+ return (
53
+ <Hint actions={actions}>
54
+ <HintTitle>Do more with Find it Fix it capabilities</HintTitle>
55
+ <HintBody>
56
+ Upgrade to Red Hat Smart Management to remediate all your systems across regions and geographies.
57
+ </HintBody>
58
+ <HintFooter>
59
+ <Button variant="link" isInline>
60
+ Try it for 90 days
61
+ </Button>
62
+ </HintFooter>
63
+ </Hint>
64
+ );
65
+ };
@@ -0,0 +1,74 @@
1
+ import React from 'react';
2
+ import {
3
+ Hint,
4
+ HintBody,
5
+ HintFooter,
6
+ Button,
7
+ Dropdown,
8
+ DropdownItem,
9
+ DropdownSeparator,
10
+ KebabToggle
11
+ } from '@patternfly/react-core';
12
+
13
+ export const HintBasicWithoutTitle: React.FunctionComponent = () => {
14
+ const [isOpen, setIsOpen] = React.useState<boolean>(false);
15
+
16
+ const onToggle = (isOpen: boolean) => {
17
+ setIsOpen(isOpen);
18
+ };
19
+
20
+ const onSelect = () => {
21
+ setIsOpen(!isOpen);
22
+ };
23
+
24
+ const dropdownItems = [
25
+ <DropdownItem key="link">Link</DropdownItem>,
26
+ <DropdownItem key="action" component="button">
27
+ Action
28
+ </DropdownItem>,
29
+ <DropdownItem key="disabled link" isDisabled>
30
+ Disabled Link
31
+ </DropdownItem>,
32
+ <DropdownItem key="disabled action" isDisabled component="button">
33
+ Disabled Action
34
+ </DropdownItem>,
35
+ <DropdownSeparator key="separator" />,
36
+ <DropdownItem key="separated link">Separated Link</DropdownItem>,
37
+ <DropdownItem key="separated action" component="button">
38
+ Separated Action
39
+ </DropdownItem>
40
+ ];
41
+ const actions = (
42
+ <Dropdown
43
+ onSelect={onSelect}
44
+ toggle={<KebabToggle onToggle={onToggle} id="hint-notitle-kebab-toggle" />}
45
+ isOpen={isOpen}
46
+ dropdownItems={dropdownItems}
47
+ position="right"
48
+ isPlain
49
+ />
50
+ );
51
+ return (
52
+ <React.Fragment>
53
+ <Hint>
54
+ <HintBody>
55
+ Welcome to the new documentation experience.
56
+ <Button variant="link" isInline>
57
+ Learn more about the improved features.
58
+ </Button>
59
+ </HintBody>
60
+ </Hint>
61
+ <br />
62
+ <Hint actions={actions}>
63
+ <HintBody>
64
+ Upgrade to Red Hat Smart Management to remediate all your systems across regions and geographies.
65
+ </HintBody>
66
+ <HintFooter>
67
+ <Button variant="link" isInline>
68
+ Try it for 90 days
69
+ </Button>
70
+ </HintFooter>
71
+ </Hint>
72
+ </React.Fragment>
73
+ );
74
+ };
@@ -14,7 +14,7 @@ export interface LabelProps extends React.HTMLProps<HTMLSpanElement> {
14
14
  /** Additional classes added to the label. */
15
15
  className?: string;
16
16
  /** Color of the label. */
17
- color?: 'blue' | 'cyan' | 'green' | 'orange' | 'purple' | 'red' | 'grey';
17
+ color?: 'blue' | 'cyan' | 'green' | 'orange' | 'purple' | 'red' | 'grey' | 'gold';
18
18
  /** Variant of the label. */
19
19
  variant?: 'outline' | 'filled';
20
20
  /** Flag indicating the label is compact. */
@@ -78,6 +78,7 @@ const colorStyles = {
78
78
  orange: styles.modifiers.orange,
79
79
  purple: styles.modifiers.purple,
80
80
  red: styles.modifiers.red,
81
+ gold: styles.modifiers.gold,
81
82
  grey: ''
82
83
  };
83
84
 
@@ -156,6 +156,27 @@ import InfoCircleIcon from '@patternfly/react-icons/dist/esm/icons/info-circle-i
156
156
  <Label color="cyan" icon={<InfoCircleIcon />} onClose={Function.prototype} isTruncated>
157
157
  Cyan label with icon that overflows
158
158
  </Label>
159
+ <br />
160
+ <br />
161
+ <Label color="gold">Gold</Label>{' '}
162
+ <Label color="gold" icon={<InfoCircleIcon />}>
163
+ Gold icon
164
+ </Label>{' '}
165
+ <Label color="gold" onClose={Function.prototype}>
166
+ Gold removable
167
+ </Label>{' '}
168
+ <Label color="gold" icon={<InfoCircleIcon />} onClose={Function.prototype}>
169
+ Gold icon removable
170
+ </Label>{' '}
171
+ <Label color="gold" href="#filled">
172
+ Gold link
173
+ </Label>{' '}
174
+ <Label color="gold" href="#filled" onClose={Function.prototype}>
175
+ Gold link removable
176
+ </Label>
177
+ <Label color="gold" icon={<InfoCircleIcon />} onClose={Function.prototype} isTruncated>
178
+ Gold label with icon that overflows
179
+ </Label>
159
180
  </React.Fragment>;
160
181
  ```
161
182
 
@@ -324,6 +345,29 @@ import InfoCircleIcon from '@patternfly/react-icons/dist/esm/icons/info-circle-i
324
345
  <Label variant="outline" color="cyan" icon={<InfoCircleIcon />} onClose={Function.prototype} isTruncated>
325
346
  Cyan label with icon that overflows
326
347
  </Label>
348
+ <br />
349
+ <br />
350
+ <Label variant="outline" color="gold">
351
+ Gold
352
+ </Label>{' '}
353
+ <Label variant="outline" color="gold" icon={<InfoCircleIcon />}>
354
+ Gold icon
355
+ </Label>{' '}
356
+ <Label variant="outline" color="gold" onClose={Function.prototype}>
357
+ Gold removable
358
+ </Label>{' '}
359
+ <Label variant="outline" color="gold" icon={<InfoCircleIcon />} onClose={Function.prototype}>
360
+ Gold icon removable
361
+ </Label>{' '}
362
+ <Label variant="outline" color="gold" href="#outline">
363
+ Gold link
364
+ </Label>{' '}
365
+ <Label variant="outline" color="gold" href="#outline" onClose={Function.prototype}>
366
+ Gold link removable
367
+ </Label>
368
+ <Label variant="outline" color="gold" icon={<InfoCircleIcon />} onClose={Function.prototype} isTruncated>
369
+ Gold label with icon that overflows
370
+ </Label>
327
371
  </React.Fragment>;
328
372
  ```
329
373
 
@@ -640,8 +640,8 @@ class InsetTabs extends React.Component {
640
640
  inset={{
641
641
  default: 'insetNone',
642
642
  md: 'insetSm',
643
- xl: 'inset2xl',
644
- '2xl': 'insetLg'
643
+ xl: 'insetLg',
644
+ '2xl': 'inset2xl'
645
645
  }}
646
646
  isBox={isBox}
647
647
  aria-label="Tabs in the inset example"