@patternfly/react-core 4.199.1 → 4.199.4

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 (45) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/package.json +5 -5
  3. package/src/components/AboutModal/__tests__/AboutModal.test.tsx +41 -60
  4. package/src/components/Accordion/__tests__/Accordion.test.tsx +23 -17
  5. package/src/components/Alert/__tests__/Alert.test.tsx +195 -184
  6. package/src/components/Alert/__tests__/Generated/AlertActionCloseButton.test.tsx +19 -17
  7. package/src/components/Alert/__tests__/Generated/__snapshots__/AlertActionCloseButton.test.tsx.snap +26 -4
  8. package/src/components/Alert/__tests__/__snapshots__/Alert.test.tsx.snap +50 -700
  9. package/src/components/AlertGroup/__tests__/AlertGroup.test.tsx +68 -73
  10. package/src/components/AlertGroup/__tests__/__snapshots__/AlertGroup.test.tsx.snap +1 -893
  11. package/src/components/ApplicationLauncher/__tests__/Generated/ApplicationLauncherSeparator.test.tsx +13 -10
  12. package/src/components/ApplicationLauncher/__tests__/Generated/__snapshots__/ApplicationLauncherSeparator.test.tsx.snap +12 -1
  13. package/src/components/Button/__tests__/Button.test.tsx +116 -107
  14. package/src/components/Button/__tests__/__snapshots__/Button.test.tsx.snap +21 -21
  15. package/src/components/Card/__tests__/Card.test.tsx +119 -100
  16. package/src/components/Card/__tests__/CardBody.test.tsx +35 -28
  17. package/src/components/Card/__tests__/CardFooter.test.tsx +28 -24
  18. package/src/components/Card/__tests__/CardHeadMain.test.tsx +19 -14
  19. package/src/components/Card/__tests__/CardHeader.test.tsx +6 -22
  20. package/src/components/Card/__tests__/CardHeaderMain.test.tsx +19 -14
  21. package/src/components/Card/__tests__/CardTitle.test.tsx +25 -0
  22. package/src/components/Card/__tests__/__snapshots__/Card.test.tsx.snap +12 -28
  23. package/src/components/Card/__tests__/__snapshots__/CardBody.test.tsx.snap +2 -4
  24. package/src/components/Card/__tests__/__snapshots__/CardFooter.test.tsx.snap +1 -3
  25. package/src/components/Card/__tests__/__snapshots__/CardHeadMain.test.tsx.snap +1 -11
  26. package/src/components/Card/__tests__/__snapshots__/CardHeader.test.tsx.snap +1 -11
  27. package/src/components/Card/__tests__/__snapshots__/CardHeaderMain.test.tsx.snap +1 -11
  28. package/src/components/Card/__tests__/__snapshots__/CardTitle.test.tsx.snap +3 -0
  29. package/src/components/Checkbox/__tests__/Checkbox.test.tsx +66 -70
  30. package/src/components/Checkbox/__tests__/__snapshots__/Checkbox.test.tsx.snap +9 -204
  31. package/src/components/Chip/examples/Chip.md +1 -73
  32. package/src/components/Chip/examples/ChipDefault.tsx +68 -0
  33. package/src/components/ClipboardCopy/examples/ClipboardCopy.md +11 -123
  34. package/src/components/ClipboardCopy/examples/ClipboardCopyBasic.tsx +8 -0
  35. package/src/components/ClipboardCopy/examples/ClipboardCopyExpanded.tsx +9 -0
  36. package/src/components/ClipboardCopy/examples/ClipboardCopyExpandedWithArray.tsx +14 -0
  37. package/src/components/ClipboardCopy/examples/ClipboardCopyInlineCompact.tsx +7 -0
  38. package/src/components/ClipboardCopy/examples/ClipboardCopyInlineCompactCode.tsx +8 -0
  39. package/src/components/ClipboardCopy/examples/ClipboardCopyInlineCompactInSentence.tsx +36 -0
  40. package/src/components/ClipboardCopy/examples/ClipboardCopyInlineCompactWithAdditionalAction.tsx +20 -0
  41. package/src/components/ClipboardCopy/examples/ClipboardCopyJSONObject.tsx +18 -0
  42. package/src/components/ClipboardCopy/examples/ClipboardCopyReadOnly.tsx +8 -0
  43. package/src/components/ClipboardCopy/examples/ClipboardCopyReadOnlyExpanded.tsx +9 -0
  44. package/src/components/ClipboardCopy/examples/ClipboardCopyReadOnlyExpandedByDefault.tsx +9 -0
  45. package/src/layouts/Flex/examples/Flex.md +1 -1
@@ -11,167 +11,55 @@ import PlayIcon from '@patternfly/react-icons/dist/esm/icons/play-icon';
11
11
 
12
12
  ### Basic
13
13
 
14
- ```js
15
- import React from 'react';
16
- import { ClipboardCopy } from '@patternfly/react-core';
17
-
18
- <ClipboardCopy hoverTip="Copy" clickTip="Copied">This is editable</ClipboardCopy>;
14
+ ```ts file="./ClipboardCopyBasic.tsx"
19
15
  ```
20
16
 
21
17
  ### Read Only
22
18
 
23
- ```js
24
- import React from 'react';
25
- import { ClipboardCopy } from '@patternfly/react-core';
26
-
27
- <ClipboardCopy isReadOnly hoverTip="Copy" clickTip="Copied">This is read-only</ClipboardCopy>;
19
+ ```ts file="./ClipboardCopyReadOnly.tsx"
28
20
  ```
29
21
 
30
22
  ### Expanded
31
23
 
32
- ```js
33
- import React from 'react';
34
- import { ClipboardCopy, ClipboardCopyVariant } from '@patternfly/react-core';
35
-
36
- <ClipboardCopy hoverTip="Copy" clickTip="Copied" variant={ClipboardCopyVariant.expansion} >
37
- Got a lot of text here, need to see all of it? Click that arrow on the left side and check out the resulting
38
- expansion.
39
- </ClipboardCopy>;
24
+ ```ts file="./ClipboardCopyExpanded.tsx"
40
25
  ```
41
26
 
42
27
  ### Read only expanded
43
28
 
44
- ```js
45
- import React from 'react';
46
- import { ClipboardCopy, ClipboardCopyVariant } from '@patternfly/react-core';
47
-
48
- <ClipboardCopy isReadOnly hoverTip="Copy" clickTip="Copied" variant={ClipboardCopyVariant.expansion}>
49
- Got a lot of text here, need to see all of it? Click that arrow on the left side and check out the resulting
50
- expansion.
51
- </ClipboardCopy>;
29
+ ```ts file="./ClipboardCopyReadOnlyExpanded.tsx"
52
30
  ```
53
31
 
54
32
  ### Read only expanded by default
55
33
 
56
- ```js
57
- import React from 'react';
58
- import { ClipboardCopy, ClipboardCopyVariant } from '@patternfly/react-core';
59
-
60
- <ClipboardCopy isReadOnly isExpanded hoverTip="Copy" clickTip="Copied" variant={ClipboardCopyVariant.expansion}>
61
- Got a lot of text here, need to see all of it? Click that arrow on the left side and check out the resulting
62
- expansion.
63
- </ClipboardCopy>;
34
+ ```ts file="./ClipboardCopyReadOnlyExpandedByDefault.tsx"
64
35
  ```
65
36
 
66
37
  ### Expanded with array
67
38
 
68
- ```js
69
- import React from 'react';
70
- import { ClipboardCopy, ClipboardCopyVariant } from '@patternfly/react-core';
71
-
72
- ClipboardCopyArrayOfElements = () => {
73
- let text = [
74
- 'Got a lot of text here,',
75
- 'need to see all of it?',
76
- 'Click that arrow on the left side and check out the resulting expansion.'
77
- ];
78
- return <ClipboardCopy hoverTip="Copy" clickTip="Copied" variant={ClipboardCopyVariant.expansion}>{text.join(' ')}</ClipboardCopy>;
79
- };
39
+ ```ts file="./ClipboardCopyExpandedWithArray.tsx"
80
40
  ```
81
41
 
82
42
  ### JSON object (wrap code with pre)
83
43
 
84
- ```js
85
- import React from 'react';
86
- import { ClipboardCopy, ClipboardCopyVariant } from '@patternfly/react-core';
87
-
88
- <ClipboardCopy isCode hoverTip="Copy" clickTip="Copied" variant={ClipboardCopyVariant.expansion}>
89
- {`{ "menu": {
90
- "id": "file",
91
- "value": "File",
92
- "popup": {
93
- "menuitem": [
94
- {"value": "New", "onclick": "CreateNewDoc()"},
95
- {"value": "Open", "onclick": "OpenDoc()"},
96
- {"value": "Close", "onclick": "CloseDoc()"}
97
- ]
98
- }
99
- }} `}
100
- </ClipboardCopy>;
44
+ ```ts file="./ClipboardCopyJSONObject.tsx"
101
45
  ```
102
46
 
103
47
  ### Inline compact
104
48
 
105
- ```js
106
- import React from 'react';
107
- import { ClipboardCopy } from '@patternfly/react-core';
108
-
109
- <ClipboardCopy hoverTip="Copy" clickTip="Copied" variant="inline-compact">2.3.4-2-redhat</ClipboardCopy>;
49
+ ```ts file="./ClipboardCopyInlineCompact.tsx"
110
50
  ```
111
51
 
112
52
  ### Inline compact code
113
53
 
114
- ```js
115
- import React from 'react';
116
- import { ClipboardCopy } from '@patternfly/react-core';
117
-
118
- <ClipboardCopy hoverTip="Copy" clickTip="Copied" variant="inline-compact" isCode>
119
- 2.3.4-2-redhat
120
- </ClipboardCopy>;
54
+ ```ts file="./ClipboardCopyInlineCompactCode.tsx"
121
55
  ```
122
56
 
123
57
  ### Inline compact with additional action
124
58
 
125
- ```js
126
- import React from 'react';
127
- import { ClipboardCopy, ClipboardCopyAction, Button } from '@patternfly/react-core';
128
- import PlayIcon from '@patternfly/react-icons/dist/esm/icons/play-icon';
129
-
130
- <ClipboardCopy
131
- hoverTip="Copy"
132
- clickTip="Copied"
133
- variant="inline-compact"
134
- additionalActions={
135
- <ClipboardCopyAction>
136
- <Button variant="plain" aria-label="Run in web terminal">
137
- <PlayIcon aria-hidden />
138
- </Button>
139
- </ClipboardCopyAction>
140
- }
141
- >
142
- 2.3.4-2-redhat
143
- </ClipboardCopy>;
59
+ ```ts file="./ClipboardCopyInlineCompactWithAdditionalAction.tsx"
144
60
  ```
145
61
 
146
62
  ### Inline compact in sentence
147
63
 
148
- ```js
149
- import React from 'react';
150
- import { ClipboardCopy } from '@patternfly/react-core';
151
-
152
- <React.Fragment>
153
- <b>Basic</b>
154
- <br />
155
- Lorem ipsum {<ClipboardCopy hoverTip="Copy" clickTip="Copied" variant="inline-compact">2.3.4-2-redhat</ClipboardCopy>} dolor sit amet.
156
- <br /> <br />
157
- <b>Long copy string</b>
158
- <br />
159
- Lorem ipsum dolor sit amet, consectetur adipiscing elit.{' '}
160
- {
161
- <ClipboardCopy hoverTip="Copy" clickTip="Copied" variant="inline-compact">
162
- https://app.openshift.io/path/sub-path/sub-sub-path/?runtime=quarkus/12345678901234567890/abcdefghijklmnopqrstuvwxyz1234567890
163
- </ClipboardCopy>
164
- }{' '}
165
- Mauris luctus, libero nec dapibus ultricies, urna purus pretium mauris, ullamcorper pharetra lacus nibh vitae enim.
166
- <br /> <br />
167
- <b>Long copy string in block</b>
168
- <br />
169
- Lorem ipsum dolor sit amet, consectetur adipiscing elit.{' '}
170
- {
171
- <ClipboardCopy hoverTip="Copy" clickTip="Copied" variant="inline-compact" isBlock>
172
- https://app.openshift.io/path/sub-path/sub-sub-path/?runtime=quarkus/12345678901234567890/abcdefghijklmnopqrstuvwxyz1234567890
173
- </ClipboardCopy>
174
- }{' '}
175
- Mauris luctus, libero nec dapibus ultricies, urna purus pretium mauris, ullamcorper pharetra lacus nibh vitae enim.
176
- </React.Fragment>;
64
+ ```ts file="./ClipboardCopyInlineCompactInSentence.tsx"
177
65
  ```
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import { ClipboardCopy } from '@patternfly/react-core';
3
+
4
+ export const ClipboardCopyBasic: React.FunctionComponent = () => (
5
+ <ClipboardCopy hoverTip="Copy" clickTip="Copied">
6
+ This is editable
7
+ </ClipboardCopy>
8
+ );
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import { ClipboardCopy, ClipboardCopyVariant } from '@patternfly/react-core';
3
+
4
+ export const ClipboardCopyExpanded: React.FunctionComponent = () => (
5
+ <ClipboardCopy hoverTip="Copy" clickTip="Copied" variant={ClipboardCopyVariant.expansion}>
6
+ Got a lot of text here, need to see all of it? Click that arrow on the left side and check out the resulting
7
+ expansion.
8
+ </ClipboardCopy>
9
+ );
@@ -0,0 +1,14 @@
1
+ import React from 'react';
2
+ import { ClipboardCopy, ClipboardCopyVariant } from '@patternfly/react-core';
3
+
4
+ const text = [
5
+ 'Got a lot of text here,',
6
+ 'need to see all of it?',
7
+ 'Click that arrow on the left side and check out the resulting expansion.'
8
+ ];
9
+
10
+ export const ClipboardCopyExpandedWithArray: React.FunctionComponent = () => (
11
+ <ClipboardCopy hoverTip="Copy" clickTip="Copied" variant={ClipboardCopyVariant.expansion}>
12
+ {text.join(' ')}
13
+ </ClipboardCopy>
14
+ );
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ import { ClipboardCopy } from '@patternfly/react-core';
3
+ export const ClipboardCopyInlineCompact: React.FunctionComponent = () => (
4
+ <ClipboardCopy hoverTip="Copy" clickTip="Copied" variant="inline-compact">
5
+ 2.3.4-2-redhat
6
+ </ClipboardCopy>
7
+ );
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import { ClipboardCopy } from '@patternfly/react-core';
3
+
4
+ export const ClipboardCopyInlineCompactCode: React.FunctionComponent = () => (
5
+ <ClipboardCopy hoverTip="Copy" clickTip="Copied" variant="inline-compact" isCode>
6
+ 2.3.4-2-redhat
7
+ </ClipboardCopy>
8
+ );
@@ -0,0 +1,36 @@
1
+ import React from 'react';
2
+ import { ClipboardCopy } from '@patternfly/react-core';
3
+
4
+ export const ClipboardCopyInlineCompactInSentence: React.FunctionComponent = () => (
5
+ <React.Fragment>
6
+ <b>Basic</b>
7
+ <br />
8
+ Lorem ipsum{' '}
9
+ {
10
+ <ClipboardCopy hoverTip="Copy" clickTip="Copied" variant="inline-compact">
11
+ 2.3.4-2-redhat
12
+ </ClipboardCopy>
13
+ }
14
+ dolor sit amet.
15
+ <br /> <br />
16
+ <b>Long copy string</b>
17
+ <br />
18
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit.{' '}
19
+ {
20
+ <ClipboardCopy hoverTip="Copy" clickTip="Copied" variant="inline-compact">
21
+ https://app.openshift.io/path/sub-path/sub-sub-path/?runtime=quarkus/12345678901234567890/abcdefghijklmnopqrstuvwxyz1234567890
22
+ </ClipboardCopy>
23
+ }{' '}
24
+ Mauris luctus, libero nec dapibus ultricies, urna purus pretium mauris, ullamcorper pharetra lacus nibh vitae enim.
25
+ <br /> <br />
26
+ <b>Long copy string in block</b>
27
+ <br />
28
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit.{' '}
29
+ {
30
+ <ClipboardCopy hoverTip="Copy" clickTip="Copied" variant="inline-compact" isBlock>
31
+ https://app.openshift.io/path/sub-path/sub-sub-path/?runtime=quarkus/12345678901234567890/abcdefghijklmnopqrstuvwxyz1234567890
32
+ </ClipboardCopy>
33
+ }{' '}
34
+ Mauris luctus, libero nec dapibus ultricies, urna purus pretium mauris, ullamcorper pharetra lacus nibh vitae enim.
35
+ </React.Fragment>
36
+ );
@@ -0,0 +1,20 @@
1
+ import React from 'react';
2
+ import { ClipboardCopy, ClipboardCopyAction, Button } from '@patternfly/react-core';
3
+ import PlayIcon from '@patternfly/react-icons/dist/esm/icons/play-icon';
4
+
5
+ export const ClipboardCopyInlineCompactWithAdditionalAction: React.FunctionComponent = () => (
6
+ <ClipboardCopy
7
+ hoverTip="Copy"
8
+ clickTip="Copied"
9
+ variant="inline-compact"
10
+ additionalActions={
11
+ <ClipboardCopyAction>
12
+ <Button variant="plain" aria-label="Run in web terminal">
13
+ <PlayIcon aria-hidden />
14
+ </Button>
15
+ </ClipboardCopyAction>
16
+ }
17
+ >
18
+ 2.3.4-2-redhat
19
+ </ClipboardCopy>
20
+ );
@@ -0,0 +1,18 @@
1
+ import React from 'react';
2
+ import { ClipboardCopy, ClipboardCopyVariant } from '@patternfly/react-core';
3
+
4
+ export const ClipboardCopyJSONObject: React.FunctionComponent = () => (
5
+ <ClipboardCopy isCode hoverTip="Copy" clickTip="Copied" variant={ClipboardCopyVariant.expansion}>
6
+ {`{ "menu": {
7
+ "id": "file",
8
+ "value": "File",
9
+ "popup": {
10
+ "menuitem": [
11
+ {"value": "New", "onclick": "CreateNewDoc()"},
12
+ {"value": "Open", "onclick": "OpenDoc()"},
13
+ {"value": "Close", "onclick": "CloseDoc()"}
14
+ ]
15
+ }
16
+ }} `}
17
+ </ClipboardCopy>
18
+ );
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import { ClipboardCopy } from '@patternfly/react-core';
3
+
4
+ export const ClipboardCopyReadOnly: React.FunctionComponent = () => (
5
+ <ClipboardCopy isReadOnly hoverTip="Copy" clickTip="Copied">
6
+ This is read-only
7
+ </ClipboardCopy>
8
+ );
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import { ClipboardCopy, ClipboardCopyVariant } from '@patternfly/react-core';
3
+
4
+ export const ClipboardCopyReadOnlyExpanded: React.FunctionComponent = () => (
5
+ <ClipboardCopy isReadOnly hoverTip="Copy" clickTip="Copied" variant={ClipboardCopyVariant.expansion}>
6
+ Got a lot of text here, need to see all of it? Click that arrow on the left side and check out the resulting
7
+ expansion.
8
+ </ClipboardCopy>
9
+ );
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import { ClipboardCopy, ClipboardCopyVariant } from '@patternfly/react-core';
3
+
4
+ export const ClipboardCopyReadOnlyExpandedByDefault: React.FunctionComponent = () => (
5
+ <ClipboardCopy isReadOnly isExpanded hoverTip="Copy" clickTip="Copied" variant={ClipboardCopyVariant.expansion}>
6
+ Got a lot of text here, need to see all of it? Click that arrow on the left side and check out the resulting
7
+ expansion.
8
+ </ClipboardCopy>
9
+ );
@@ -81,7 +81,7 @@ import { Flex, FlexItem } from '@patternfly/react-core';
81
81
  import React from 'react';
82
82
  import { Flex, FlexItem } from '@patternfly/react-core';
83
83
 
84
- <Flex spaceItems={{ modifier: 'spaceItemsXl' }}>
84
+ <Flex spaceItems={{ default: 'spaceItemsXl' }}>
85
85
  <FlexItem>Flex item</FlexItem>
86
86
  <FlexItem>Flex item</FlexItem>
87
87
  <FlexItem>Flex item</FlexItem>