@patternfly/react-core 6.0.0-alpha.37 → 6.0.0-alpha.39
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/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/Chip/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/Modal/package.json +1 -1
- package/dist/dynamic/next/components/package.json +1 -1
- package/dist/dynamic/styles/package.json +1 -1
- package/dist/esm/components/Button/Button.d.ts.map +1 -1
- package/dist/esm/components/Button/Button.js +2 -2
- package/dist/esm/components/Button/Button.js.map +1 -1
- package/dist/esm/components/Label/Label.d.ts +3 -1
- package/dist/esm/components/Label/Label.d.ts.map +1 -1
- package/dist/esm/components/Label/Label.js +23 -4
- package/dist/esm/components/Label/Label.js.map +1 -1
- package/dist/esm/components/Menu/MenuItemAction.d.ts +2 -2
- package/dist/esm/components/Menu/MenuItemAction.d.ts.map +1 -1
- package/dist/esm/components/Menu/MenuItemAction.js +4 -3
- package/dist/esm/components/Menu/MenuItemAction.js.map +1 -1
- package/dist/esm/helpers/KeyboardHandler.d.ts.map +1 -1
- package/dist/esm/helpers/KeyboardHandler.js +11 -7
- package/dist/esm/helpers/KeyboardHandler.js.map +1 -1
- package/dist/js/components/Button/Button.d.ts.map +1 -1
- package/dist/js/components/Button/Button.js +2 -2
- package/dist/js/components/Button/Button.js.map +1 -1
- package/dist/js/components/Label/Label.d.ts +3 -1
- package/dist/js/components/Label/Label.d.ts.map +1 -1
- package/dist/js/components/Label/Label.js +23 -4
- package/dist/js/components/Label/Label.js.map +1 -1
- package/dist/js/components/Menu/MenuItemAction.d.ts +2 -2
- package/dist/js/components/Menu/MenuItemAction.d.ts.map +1 -1
- package/dist/js/components/Menu/MenuItemAction.js +4 -3
- package/dist/js/components/Menu/MenuItemAction.js.map +1 -1
- package/dist/js/helpers/KeyboardHandler.d.ts.map +1 -1
- package/dist/js/helpers/KeyboardHandler.js +11 -7
- package/dist/js/helpers/KeyboardHandler.js.map +1 -1
- package/dist/umd/react-core.min.js +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/Button/Button.tsx +2 -1
- package/src/components/CalendarMonth/examples/CalendarMonth.md +3 -1
- package/src/components/Label/Label.tsx +29 -3
- package/src/components/Label/__tests__/__snapshots__/Label.test.tsx.snap +16 -16
- package/src/components/Label/__tests__/__snapshots__/LabelGroup.test.tsx.snap +7 -7
- package/src/components/Label/examples/Label.md +1 -0
- package/src/components/Label/examples/LabelCompact.tsx +7 -7
- package/src/components/Label/examples/LabelFilled.tsx +138 -28
- package/src/components/Label/examples/LabelOutline.tsx +149 -58
- package/src/components/Menu/MenuItemAction.tsx +15 -12
- package/src/helpers/KeyboardHandler.tsx +13 -7
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Label } from '@patternfly/react-core';
|
|
3
|
-
import
|
|
3
|
+
import CubeIcon from '@patternfly/react-icons/dist/esm/icons/cube-icon';
|
|
4
4
|
|
|
5
5
|
export const LabelOutline: React.FunctionComponent = () => {
|
|
6
6
|
const logColor = (color: string) => {
|
|
@@ -9,14 +9,17 @@ export const LabelOutline: React.FunctionComponent = () => {
|
|
|
9
9
|
};
|
|
10
10
|
return (
|
|
11
11
|
<React.Fragment>
|
|
12
|
+
<strong>Non-status:</strong>
|
|
13
|
+
<br />
|
|
14
|
+
<br />
|
|
12
15
|
<Label variant="outline">Grey</Label>
|
|
13
|
-
<Label variant="outline" icon={<
|
|
16
|
+
<Label variant="outline" icon={<CubeIcon />}>
|
|
14
17
|
Grey icon
|
|
15
18
|
</Label>
|
|
16
19
|
<Label variant="outline" onClose={() => Function.prototype}>
|
|
17
20
|
Grey removable
|
|
18
21
|
</Label>
|
|
19
|
-
<Label variant="outline" icon={<
|
|
22
|
+
<Label variant="outline" icon={<CubeIcon />} onClose={() => Function.prototype}>
|
|
20
23
|
Grey icon removable
|
|
21
24
|
</Label>
|
|
22
25
|
<Label variant="outline" href="#outline">
|
|
@@ -31,7 +34,7 @@ export const LabelOutline: React.FunctionComponent = () => {
|
|
|
31
34
|
<Label variant="outline" onClick={() => logColor('grey')} onClose={() => Function.prototype}>
|
|
32
35
|
Grey clickable removable
|
|
33
36
|
</Label>
|
|
34
|
-
<Label variant="outline" icon={<
|
|
37
|
+
<Label variant="outline" icon={<CubeIcon />} onClose={() => Function.prototype} textMaxWidth="16ch">
|
|
35
38
|
Grey label with icon that overflows
|
|
36
39
|
</Label>
|
|
37
40
|
<br />
|
|
@@ -39,13 +42,13 @@ export const LabelOutline: React.FunctionComponent = () => {
|
|
|
39
42
|
<Label variant="outline" color="blue">
|
|
40
43
|
Blue
|
|
41
44
|
</Label>
|
|
42
|
-
<Label variant="outline" color="blue" icon={<
|
|
45
|
+
<Label variant="outline" color="blue" icon={<CubeIcon />}>
|
|
43
46
|
Blue icon
|
|
44
47
|
</Label>
|
|
45
48
|
<Label variant="outline" color="blue" onClose={() => Function.prototype}>
|
|
46
49
|
Blue removable
|
|
47
50
|
</Label>
|
|
48
|
-
<Label variant="outline" color="blue" icon={<
|
|
51
|
+
<Label variant="outline" color="blue" icon={<CubeIcon />} onClose={() => Function.prototype}>
|
|
49
52
|
Blue icon removable
|
|
50
53
|
</Label>
|
|
51
54
|
<Label variant="outline" color="blue" href="#outline">
|
|
@@ -60,13 +63,7 @@ export const LabelOutline: React.FunctionComponent = () => {
|
|
|
60
63
|
<Label variant="outline" color="blue" onClick={() => logColor('blue')} onClose={() => Function.prototype}>
|
|
61
64
|
Blue clickable removable
|
|
62
65
|
</Label>
|
|
63
|
-
<Label
|
|
64
|
-
variant="outline"
|
|
65
|
-
color="blue"
|
|
66
|
-
icon={<InfoCircleIcon />}
|
|
67
|
-
onClose={() => Function.prototype}
|
|
68
|
-
textMaxWidth="16ch"
|
|
69
|
-
>
|
|
66
|
+
<Label variant="outline" color="blue" icon={<CubeIcon />} onClose={() => Function.prototype} textMaxWidth="16ch">
|
|
70
67
|
Blue label with icon that overflows
|
|
71
68
|
</Label>
|
|
72
69
|
<br />
|
|
@@ -74,13 +71,13 @@ export const LabelOutline: React.FunctionComponent = () => {
|
|
|
74
71
|
<Label variant="outline" color="green">
|
|
75
72
|
Green
|
|
76
73
|
</Label>
|
|
77
|
-
<Label variant="outline" color="green" icon={<
|
|
74
|
+
<Label variant="outline" color="green" icon={<CubeIcon />}>
|
|
78
75
|
Green icon
|
|
79
76
|
</Label>
|
|
80
77
|
<Label variant="outline" color="green" onClose={() => Function.prototype}>
|
|
81
78
|
Green removable
|
|
82
79
|
</Label>
|
|
83
|
-
<Label variant="outline" color="green" icon={<
|
|
80
|
+
<Label variant="outline" color="green" icon={<CubeIcon />} onClose={() => Function.prototype}>
|
|
84
81
|
Green icon removable
|
|
85
82
|
</Label>
|
|
86
83
|
<Label variant="outline" color="green" href="#outline">
|
|
@@ -95,13 +92,7 @@ export const LabelOutline: React.FunctionComponent = () => {
|
|
|
95
92
|
<Label variant="outline" color="green" onClick={() => logColor('green')} onClose={() => Function.prototype}>
|
|
96
93
|
Green clickable removable
|
|
97
94
|
</Label>
|
|
98
|
-
<Label
|
|
99
|
-
variant="outline"
|
|
100
|
-
color="green"
|
|
101
|
-
icon={<InfoCircleIcon />}
|
|
102
|
-
onClose={() => Function.prototype}
|
|
103
|
-
textMaxWidth="16ch"
|
|
104
|
-
>
|
|
95
|
+
<Label variant="outline" color="green" icon={<CubeIcon />} onClose={() => Function.prototype} textMaxWidth="16ch">
|
|
105
96
|
Green label with icon that overflows
|
|
106
97
|
</Label>
|
|
107
98
|
<br />
|
|
@@ -109,13 +100,13 @@ export const LabelOutline: React.FunctionComponent = () => {
|
|
|
109
100
|
<Label variant="outline" color="orange">
|
|
110
101
|
Orange
|
|
111
102
|
</Label>
|
|
112
|
-
<Label variant="outline" color="orange" icon={<
|
|
103
|
+
<Label variant="outline" color="orange" icon={<CubeIcon />}>
|
|
113
104
|
Orange icon
|
|
114
105
|
</Label>
|
|
115
106
|
<Label variant="outline" color="orange" onClose={() => Function.prototype}>
|
|
116
107
|
Orange removable
|
|
117
108
|
</Label>
|
|
118
|
-
<Label variant="outline" color="orange" icon={<
|
|
109
|
+
<Label variant="outline" color="orange" icon={<CubeIcon />} onClose={() => Function.prototype}>
|
|
119
110
|
Orange icon removable
|
|
120
111
|
</Label>
|
|
121
112
|
<Label variant="outline" color="orange" href="#outline">
|
|
@@ -133,7 +124,7 @@ export const LabelOutline: React.FunctionComponent = () => {
|
|
|
133
124
|
<Label
|
|
134
125
|
variant="outline"
|
|
135
126
|
color="orange"
|
|
136
|
-
icon={<
|
|
127
|
+
icon={<CubeIcon />}
|
|
137
128
|
onClose={() => Function.prototype}
|
|
138
129
|
textMaxWidth="16ch"
|
|
139
130
|
>
|
|
@@ -144,13 +135,13 @@ export const LabelOutline: React.FunctionComponent = () => {
|
|
|
144
135
|
<Label variant="outline" color="red">
|
|
145
136
|
Red
|
|
146
137
|
</Label>
|
|
147
|
-
<Label variant="outline" color="red" icon={<
|
|
138
|
+
<Label variant="outline" color="red" icon={<CubeIcon />}>
|
|
148
139
|
Red icon
|
|
149
140
|
</Label>
|
|
150
141
|
<Label variant="outline" color="red" onClose={() => Function.prototype}>
|
|
151
142
|
Red removable
|
|
152
143
|
</Label>
|
|
153
|
-
<Label variant="outline" color="red" icon={<
|
|
144
|
+
<Label variant="outline" color="red" icon={<CubeIcon />} onClose={() => Function.prototype}>
|
|
154
145
|
Red icon removable
|
|
155
146
|
</Label>
|
|
156
147
|
<Label variant="outline" color="red" href="#outline">
|
|
@@ -165,13 +156,7 @@ export const LabelOutline: React.FunctionComponent = () => {
|
|
|
165
156
|
<Label variant="outline" color="red" onClick={() => logColor('red')} onClose={() => Function.prototype}>
|
|
166
157
|
Red clickable removable
|
|
167
158
|
</Label>
|
|
168
|
-
<Label
|
|
169
|
-
variant="outline"
|
|
170
|
-
color="red"
|
|
171
|
-
icon={<InfoCircleIcon />}
|
|
172
|
-
onClose={() => Function.prototype}
|
|
173
|
-
textMaxWidth="16ch"
|
|
174
|
-
>
|
|
159
|
+
<Label variant="outline" color="red" icon={<CubeIcon />} onClose={() => Function.prototype} textMaxWidth="16ch">
|
|
175
160
|
Red label with icon that overflows
|
|
176
161
|
</Label>
|
|
177
162
|
<br />
|
|
@@ -179,13 +164,13 @@ export const LabelOutline: React.FunctionComponent = () => {
|
|
|
179
164
|
<Label variant="outline" color="orangered">
|
|
180
165
|
Orange red
|
|
181
166
|
</Label>
|
|
182
|
-
<Label variant="outline" color="orangered" icon={<
|
|
167
|
+
<Label variant="outline" color="orangered" icon={<CubeIcon />}>
|
|
183
168
|
Orange red icon
|
|
184
169
|
</Label>
|
|
185
170
|
<Label variant="outline" color="orangered" onClose={() => Function.prototype}>
|
|
186
171
|
Orange red removable
|
|
187
172
|
</Label>
|
|
188
|
-
<Label variant="outline" color="orangered" icon={<
|
|
173
|
+
<Label variant="outline" color="orangered" icon={<CubeIcon />} onClose={() => Function.prototype}>
|
|
189
174
|
Orange red icon removable
|
|
190
175
|
</Label>
|
|
191
176
|
<Label variant="outline" color="orangered" href="#outline">
|
|
@@ -208,7 +193,7 @@ export const LabelOutline: React.FunctionComponent = () => {
|
|
|
208
193
|
<Label
|
|
209
194
|
variant="outline"
|
|
210
195
|
color="orangered"
|
|
211
|
-
icon={<
|
|
196
|
+
icon={<CubeIcon />}
|
|
212
197
|
onClose={() => Function.prototype}
|
|
213
198
|
textMaxWidth="16ch"
|
|
214
199
|
>
|
|
@@ -219,13 +204,13 @@ export const LabelOutline: React.FunctionComponent = () => {
|
|
|
219
204
|
<Label variant="outline" color="purple">
|
|
220
205
|
Purple
|
|
221
206
|
</Label>
|
|
222
|
-
<Label variant="outline" color="purple" icon={<
|
|
207
|
+
<Label variant="outline" color="purple" icon={<CubeIcon />}>
|
|
223
208
|
Purple icon
|
|
224
209
|
</Label>
|
|
225
210
|
<Label variant="outline" color="purple" onClose={() => Function.prototype}>
|
|
226
211
|
Purple removable
|
|
227
212
|
</Label>
|
|
228
|
-
<Label variant="outline" color="purple" icon={<
|
|
213
|
+
<Label variant="outline" color="purple" icon={<CubeIcon />} onClose={() => Function.prototype}>
|
|
229
214
|
Purple icon removable
|
|
230
215
|
</Label>
|
|
231
216
|
<Label variant="outline" color="purple" href="#outline">
|
|
@@ -243,7 +228,7 @@ export const LabelOutline: React.FunctionComponent = () => {
|
|
|
243
228
|
<Label
|
|
244
229
|
variant="outline"
|
|
245
230
|
color="purple"
|
|
246
|
-
icon={<
|
|
231
|
+
icon={<CubeIcon />}
|
|
247
232
|
onClose={() => Function.prototype}
|
|
248
233
|
textMaxWidth="16ch"
|
|
249
234
|
>
|
|
@@ -254,13 +239,13 @@ export const LabelOutline: React.FunctionComponent = () => {
|
|
|
254
239
|
<Label variant="outline" color="cyan">
|
|
255
240
|
Cyan
|
|
256
241
|
</Label>
|
|
257
|
-
<Label variant="outline" color="cyan" icon={<
|
|
242
|
+
<Label variant="outline" color="cyan" icon={<CubeIcon />}>
|
|
258
243
|
Cyan icon
|
|
259
244
|
</Label>
|
|
260
245
|
<Label variant="outline" color="cyan" onClose={() => Function.prototype}>
|
|
261
246
|
Cyan removable
|
|
262
247
|
</Label>
|
|
263
|
-
<Label variant="outline" color="cyan" icon={<
|
|
248
|
+
<Label variant="outline" color="cyan" icon={<CubeIcon />} onClose={() => Function.prototype}>
|
|
264
249
|
Cyan icon removable
|
|
265
250
|
</Label>
|
|
266
251
|
<Label variant="outline" color="cyan" href="#outline">
|
|
@@ -275,13 +260,7 @@ export const LabelOutline: React.FunctionComponent = () => {
|
|
|
275
260
|
<Label variant="outline" color="cyan" onClick={() => logColor('cyan')} onClose={() => Function.prototype}>
|
|
276
261
|
Cyan clickable removable
|
|
277
262
|
</Label>
|
|
278
|
-
<Label
|
|
279
|
-
variant="outline"
|
|
280
|
-
color="cyan"
|
|
281
|
-
icon={<InfoCircleIcon />}
|
|
282
|
-
onClose={() => Function.prototype}
|
|
283
|
-
textMaxWidth="16ch"
|
|
284
|
-
>
|
|
263
|
+
<Label variant="outline" color="cyan" icon={<CubeIcon />} onClose={() => Function.prototype} textMaxWidth="16ch">
|
|
285
264
|
Cyan label with icon that overflows
|
|
286
265
|
</Label>
|
|
287
266
|
<br />
|
|
@@ -289,13 +268,13 @@ export const LabelOutline: React.FunctionComponent = () => {
|
|
|
289
268
|
<Label variant="outline" color="gold">
|
|
290
269
|
Gold
|
|
291
270
|
</Label>
|
|
292
|
-
<Label variant="outline" color="gold" icon={<
|
|
271
|
+
<Label variant="outline" color="gold" icon={<CubeIcon />}>
|
|
293
272
|
Gold icon
|
|
294
273
|
</Label>
|
|
295
274
|
<Label variant="outline" color="gold" onClose={() => Function.prototype}>
|
|
296
275
|
Gold removable
|
|
297
276
|
</Label>
|
|
298
|
-
<Label variant="outline" color="gold" icon={<
|
|
277
|
+
<Label variant="outline" color="gold" icon={<CubeIcon />} onClose={() => Function.prototype}>
|
|
299
278
|
Gold icon removable
|
|
300
279
|
</Label>
|
|
301
280
|
<Label variant="outline" color="gold" href="#outline">
|
|
@@ -310,15 +289,127 @@ export const LabelOutline: React.FunctionComponent = () => {
|
|
|
310
289
|
<Label variant="outline" color="gold" onClick={() => logColor('gold')} onClose={() => Function.prototype}>
|
|
311
290
|
Gold clickable removable
|
|
312
291
|
</Label>
|
|
313
|
-
<Label
|
|
314
|
-
variant="outline"
|
|
315
|
-
color="gold"
|
|
316
|
-
icon={<InfoCircleIcon />}
|
|
317
|
-
onClose={() => Function.prototype}
|
|
318
|
-
textMaxWidth="16ch"
|
|
319
|
-
>
|
|
292
|
+
<Label variant="outline" color="gold" icon={<CubeIcon />} onClose={() => Function.prototype} textMaxWidth="16ch">
|
|
320
293
|
Gold label with icon that overflows
|
|
321
294
|
</Label>
|
|
295
|
+
<br />
|
|
296
|
+
<br />
|
|
297
|
+
<strong>Status:</strong>
|
|
298
|
+
<br />
|
|
299
|
+
<br />
|
|
300
|
+
<Label status="success" variant="outline">
|
|
301
|
+
Success
|
|
302
|
+
</Label>
|
|
303
|
+
<Label status="success" variant="outline" onClose={() => Function.prototype}>
|
|
304
|
+
Success removable
|
|
305
|
+
</Label>
|
|
306
|
+
<Label status="success" variant="outline" href="#filled">
|
|
307
|
+
Success link
|
|
308
|
+
</Label>
|
|
309
|
+
<Label status="success" variant="outline" href="#filled" onClose={() => Function.prototype}>
|
|
310
|
+
Success link removable
|
|
311
|
+
</Label>
|
|
312
|
+
<Label status="success" variant="outline" onClick={() => logColor('success')}>
|
|
313
|
+
Success clickable
|
|
314
|
+
</Label>
|
|
315
|
+
<Label status="success" variant="outline" onClick={() => logColor('success')} onClose={() => Function.prototype}>
|
|
316
|
+
Success clickable removable
|
|
317
|
+
</Label>
|
|
318
|
+
<Label status="success" variant="outline" onClose={() => Function.prototype} textMaxWidth="16ch">
|
|
319
|
+
Success label with text that overflows
|
|
320
|
+
</Label>
|
|
321
|
+
<br />
|
|
322
|
+
<br />
|
|
323
|
+
<Label status="warning" variant="outline">
|
|
324
|
+
Warning
|
|
325
|
+
</Label>
|
|
326
|
+
<Label status="warning" variant="outline" onClose={() => Function.prototype}>
|
|
327
|
+
Warning removable
|
|
328
|
+
</Label>
|
|
329
|
+
<Label status="warning" variant="outline" href="#filled">
|
|
330
|
+
Warning link
|
|
331
|
+
</Label>
|
|
332
|
+
<Label status="warning" variant="outline" href="#filled" onClose={() => Function.prototype}>
|
|
333
|
+
Warning link removable
|
|
334
|
+
</Label>
|
|
335
|
+
<Label status="warning" variant="outline" onClick={() => logColor('warning')}>
|
|
336
|
+
Warning clickable
|
|
337
|
+
</Label>
|
|
338
|
+
<Label status="warning" variant="outline" onClick={() => logColor('warning')} onClose={() => Function.prototype}>
|
|
339
|
+
Warning clickable removable
|
|
340
|
+
</Label>
|
|
341
|
+
<Label status="warning" variant="outline" onClose={() => Function.prototype} textMaxWidth="16ch">
|
|
342
|
+
Warning label with text that overflows
|
|
343
|
+
</Label>
|
|
344
|
+
<br />
|
|
345
|
+
<br />
|
|
346
|
+
<Label status="danger" variant="outline">
|
|
347
|
+
Danger
|
|
348
|
+
</Label>
|
|
349
|
+
<Label status="danger" variant="outline" onClose={() => Function.prototype}>
|
|
350
|
+
Danger removable
|
|
351
|
+
</Label>
|
|
352
|
+
<Label status="danger" variant="outline" href="#filled">
|
|
353
|
+
Danger link
|
|
354
|
+
</Label>
|
|
355
|
+
<Label status="danger" variant="outline" href="#filled" onClose={() => Function.prototype}>
|
|
356
|
+
Danger link removable
|
|
357
|
+
</Label>
|
|
358
|
+
<Label status="danger" variant="outline" onClick={() => logColor('danger')}>
|
|
359
|
+
Danger clickable
|
|
360
|
+
</Label>
|
|
361
|
+
<Label status="danger" variant="outline" onClick={() => logColor('danger')} onClose={() => Function.prototype}>
|
|
362
|
+
Danger clickable removable
|
|
363
|
+
</Label>
|
|
364
|
+
<Label status="danger" variant="outline" onClose={() => Function.prototype} textMaxWidth="16ch">
|
|
365
|
+
Danger label with text that overflows
|
|
366
|
+
</Label>
|
|
367
|
+
<br />
|
|
368
|
+
<br />
|
|
369
|
+
<Label status="info" variant="outline">
|
|
370
|
+
Info
|
|
371
|
+
</Label>
|
|
372
|
+
<Label status="info" variant="outline" onClose={() => Function.prototype}>
|
|
373
|
+
Info removable
|
|
374
|
+
</Label>
|
|
375
|
+
<Label status="info" variant="outline" href="#filled">
|
|
376
|
+
Info link
|
|
377
|
+
</Label>
|
|
378
|
+
<Label status="info" variant="outline" href="#filled" onClose={() => Function.prototype}>
|
|
379
|
+
Info link removable
|
|
380
|
+
</Label>
|
|
381
|
+
<Label status="info" variant="outline" onClick={() => logColor('info')}>
|
|
382
|
+
Info clickable
|
|
383
|
+
</Label>
|
|
384
|
+
<Label status="info" variant="outline" onClick={() => logColor('info')} onClose={() => Function.prototype}>
|
|
385
|
+
Info clickable removable
|
|
386
|
+
</Label>
|
|
387
|
+
<Label status="info" variant="outline" onClose={() => Function.prototype} textMaxWidth="16ch">
|
|
388
|
+
Info label with text that overflows
|
|
389
|
+
</Label>
|
|
390
|
+
<br />
|
|
391
|
+
<br />
|
|
392
|
+
<Label status="custom" variant="outline">
|
|
393
|
+
Custom
|
|
394
|
+
</Label>
|
|
395
|
+
<Label status="custom" variant="outline" onClose={() => Function.prototype}>
|
|
396
|
+
Custom removable
|
|
397
|
+
</Label>
|
|
398
|
+
<Label status="custom" variant="outline" href="#filled">
|
|
399
|
+
Custom link
|
|
400
|
+
</Label>
|
|
401
|
+
<Label status="custom" variant="outline" href="#filled" onClose={() => Function.prototype}>
|
|
402
|
+
Custom link removable
|
|
403
|
+
</Label>
|
|
404
|
+
<Label status="custom" variant="outline" onClick={() => logColor('custom')}>
|
|
405
|
+
Custom clickable
|
|
406
|
+
</Label>
|
|
407
|
+
<Label status="custom" variant="outline" onClick={() => logColor('custom')} onClose={() => Function.prototype}>
|
|
408
|
+
Custom clickable removable
|
|
409
|
+
</Label>
|
|
410
|
+
<Label status="custom" variant="outline" onClose={() => Function.prototype} textMaxWidth="16ch">
|
|
411
|
+
Custom label with text that overflows
|
|
412
|
+
</Label>
|
|
322
413
|
</React.Fragment>
|
|
323
414
|
);
|
|
324
415
|
};
|
|
@@ -3,8 +3,8 @@ import styles from '@patternfly/react-styles/css/components/Menu/menu';
|
|
|
3
3
|
import { css } from '@patternfly/react-styles';
|
|
4
4
|
import StarIcon from '@patternfly/react-icons/dist/esm/icons/star-icon';
|
|
5
5
|
import { MenuContext, MenuItemContext } from './MenuContext';
|
|
6
|
-
|
|
7
|
-
export interface MenuItemActionProps extends
|
|
6
|
+
import { Button } from '../Button';
|
|
7
|
+
export interface MenuItemActionProps extends React.HTMLProps<HTMLDivElement> {
|
|
8
8
|
/** Additional classes added to the action button */
|
|
9
9
|
className?: string;
|
|
10
10
|
/** The action icon to use */
|
|
@@ -24,7 +24,7 @@ export interface MenuItemActionProps extends Omit<React.HTMLProps<HTMLButtonElem
|
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
const MenuItemActionBase: React.FunctionComponent<MenuItemActionProps> = ({
|
|
27
|
-
className
|
|
27
|
+
className,
|
|
28
28
|
icon,
|
|
29
29
|
onClick,
|
|
30
30
|
'aria-label': ariaLabel,
|
|
@@ -45,24 +45,27 @@ const MenuItemActionBase: React.FunctionComponent<MenuItemActionProps> = ({
|
|
|
45
45
|
onActionClick && onActionClick(event, itemId, actionId);
|
|
46
46
|
};
|
|
47
47
|
return (
|
|
48
|
-
<
|
|
48
|
+
<div
|
|
49
49
|
className={css(
|
|
50
50
|
styles.menuItemAction,
|
|
51
51
|
isFavorited !== null && 'pf-m-favorite',
|
|
52
52
|
isFavorited && styles.modifiers.favorited,
|
|
53
53
|
className
|
|
54
54
|
)}
|
|
55
|
-
aria-label={ariaLabel}
|
|
56
|
-
onClick={onClickButton}
|
|
57
|
-
{...((isDisabled === true || isDisabledContext === true) && { disabled: true })}
|
|
58
|
-
ref={innerRef}
|
|
59
|
-
tabIndex={-1}
|
|
60
55
|
{...props}
|
|
61
56
|
>
|
|
62
|
-
<
|
|
57
|
+
<Button
|
|
58
|
+
aria-label={ariaLabel}
|
|
59
|
+
onClick={onClickButton}
|
|
60
|
+
ref={innerRef}
|
|
61
|
+
role="menuitem"
|
|
62
|
+
variant="plain"
|
|
63
|
+
tabIndex={-1}
|
|
64
|
+
isDisabled={isDisabled || isDisabledContext}
|
|
65
|
+
>
|
|
63
66
|
{icon === 'favorites' || isFavorited !== null ? <StarIcon aria-hidden /> : icon}
|
|
64
|
-
</
|
|
65
|
-
</
|
|
67
|
+
</Button>
|
|
68
|
+
</div>
|
|
66
69
|
);
|
|
67
70
|
}}
|
|
68
71
|
</MenuItemContext.Consumer>
|
|
@@ -106,23 +106,30 @@ export const handleArrows = (
|
|
|
106
106
|
|
|
107
107
|
if (!activeRow.length || onlyTraverseSiblings) {
|
|
108
108
|
let nextSibling = activeElement;
|
|
109
|
-
|
|
109
|
+
|
|
110
110
|
while (nextSibling) {
|
|
111
|
-
|
|
112
|
-
|
|
111
|
+
const isDirectChildOfNavigableElement = nextSibling.parentElement === element;
|
|
112
|
+
const nextSiblingMainElement = isDirectChildOfNavigableElement ? nextSibling : nextSibling.parentElement;
|
|
113
|
+
nextSibling =
|
|
114
|
+
key === 'ArrowLeft'
|
|
115
|
+
? nextSiblingMainElement.previousElementSibling
|
|
116
|
+
: nextSiblingMainElement.nextElementSibling;
|
|
117
|
+
|
|
113
118
|
if (nextSibling) {
|
|
114
119
|
if (validSiblingTags.includes(nextSibling.tagName)) {
|
|
115
|
-
// If the sibling's tag is included in validSiblingTags, set the next target element and break the loop
|
|
116
120
|
moveTarget = nextSibling;
|
|
117
121
|
break;
|
|
118
122
|
}
|
|
119
|
-
//
|
|
123
|
+
// For cases where the validSiblingTag is inside a div wrapper
|
|
124
|
+
if (validSiblingTags.includes(nextSibling.children[0].tagName)) {
|
|
125
|
+
moveTarget = nextSibling.children[0];
|
|
126
|
+
break;
|
|
127
|
+
}
|
|
120
128
|
}
|
|
121
129
|
}
|
|
122
130
|
} else {
|
|
123
131
|
activeRow.forEach((focusableElement, index) => {
|
|
124
132
|
if (event.target === focusableElement) {
|
|
125
|
-
// Once found, move up or down the array by 1. Determined by the vertical arrow key direction
|
|
126
133
|
const increment = key === 'ArrowLeft' ? -1 : 1;
|
|
127
134
|
currentIndex = index + increment;
|
|
128
135
|
if (currentIndex >= activeRow.length) {
|
|
@@ -132,7 +139,6 @@ export const handleArrows = (
|
|
|
132
139
|
currentIndex = activeRow.length - 1;
|
|
133
140
|
}
|
|
134
141
|
|
|
135
|
-
// Set the next target element
|
|
136
142
|
moveTarget = activeRow[currentIndex];
|
|
137
143
|
}
|
|
138
144
|
});
|