@patternfly/react-core 6.0.0-alpha.36 → 6.0.0-alpha.38
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/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/TreeView/TreeViewListItem.d.ts.map +1 -1
- package/dist/esm/components/TreeView/TreeViewListItem.js +1 -1
- package/dist/esm/components/TreeView/TreeViewListItem.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/TreeView/TreeViewListItem.d.ts.map +1 -1
- package/dist/js/components/TreeView/TreeViewListItem.js +1 -1
- package/dist/js/components/TreeView/TreeViewListItem.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/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/TreeView/TreeViewListItem.tsx +0 -1
- package/src/components/TreeView/__tests__/TreeViewListItem.test.tsx +0 -32
package/helpers/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@patternfly/react-core-helpers","main":"../dist/js/helpers/index.js","module":"../dist/esm/helpers/index.js","typings":"../dist/esm/helpers/index.d.ts","version":"6.0.0-alpha.
|
|
1
|
+
{"name":"@patternfly/react-core-helpers","main":"../dist/js/helpers/index.js","module":"../dist/esm/helpers/index.js","typings":"../dist/esm/helpers/index.d.ts","version":"6.0.0-alpha.37","private":true}
|
package/layouts/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@patternfly/react-core-layouts","main":"../dist/js/layouts/index.js","module":"../dist/esm/layouts/index.js","typings":"../dist/esm/layouts/index.d.ts","version":"6.0.0-alpha.
|
|
1
|
+
{"name":"@patternfly/react-core-layouts","main":"../dist/js/layouts/index.js","module":"../dist/esm/layouts/index.js","typings":"../dist/esm/layouts/index.d.ts","version":"6.0.0-alpha.37","private":true}
|
package/next/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@patternfly/react-core-next","main":"../dist/js/next/index.js","module":"../dist/esm/next/index.js","typings":"../dist/esm/next/index.d.ts","version":"6.0.0-alpha.
|
|
1
|
+
{"name":"@patternfly/react-core-next","main":"../dist/js/next/index.js","module":"../dist/esm/next/index.js","typings":"../dist/esm/next/index.d.ts","version":"6.0.0-alpha.37","private":true}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@patternfly/react-core",
|
|
3
|
-
"version": "6.0.0-alpha.
|
|
3
|
+
"version": "6.0.0-alpha.38",
|
|
4
4
|
"description": "This library provides a set of common React components for use with the PatternFly reference implementation.",
|
|
5
5
|
"main": "dist/js/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -73,5 +73,5 @@
|
|
|
73
73
|
"react": "^17 || ^18",
|
|
74
74
|
"react-dom": "^17 || ^18"
|
|
75
75
|
},
|
|
76
|
-
"gitHead": "
|
|
76
|
+
"gitHead": "3a88c11a91941fd01688e978a5c07b947f3a078a"
|
|
77
77
|
}
|
|
@@ -5,9 +5,14 @@ import labelGrpStyles from '@patternfly/react-styles/css/components/Label/label-
|
|
|
5
5
|
import { Button } from '../Button';
|
|
6
6
|
import { Tooltip, TooltipPosition } from '../Tooltip';
|
|
7
7
|
import { css } from '@patternfly/react-styles';
|
|
8
|
-
import TimesIcon from '@patternfly/react-icons/dist/esm/icons/times-icon';
|
|
9
8
|
import { useIsomorphicLayoutEffect } from '../../helpers';
|
|
10
9
|
import cssTextMaxWidth from '@patternfly/react-tokens/dist/esm/c_label__text_MaxWidth';
|
|
10
|
+
import TimesIcon from '@patternfly/react-icons/dist/esm/icons/times-icon';
|
|
11
|
+
import CheckCircleIcon from '@patternfly/react-icons/dist/esm/icons/check-circle-icon';
|
|
12
|
+
import BellIcon from '@patternfly/react-icons/dist/esm/icons/bell-icon';
|
|
13
|
+
import ExclamationCircleIcon from '@patternfly/react-icons/dist/esm/icons/exclamation-circle-icon';
|
|
14
|
+
import ExclamationTriangleIcon from '@patternfly/react-icons/dist/esm/icons/exclamation-triangle-icon';
|
|
15
|
+
import InfoCircleIcon from '@patternfly/react-icons/dist/esm/icons/info-circle-icon';
|
|
11
16
|
|
|
12
17
|
export interface LabelProps extends React.HTMLProps<HTMLSpanElement> {
|
|
13
18
|
/** Content rendered inside the label. */
|
|
@@ -18,6 +23,8 @@ export interface LabelProps extends React.HTMLProps<HTMLSpanElement> {
|
|
|
18
23
|
color?: 'blue' | 'cyan' | 'green' | 'orange' | 'purple' | 'red' | 'orangered' | 'grey' | 'gold';
|
|
19
24
|
/** Variant of the label. */
|
|
20
25
|
variant?: 'outline' | 'filled' | 'overflow' | 'add';
|
|
26
|
+
/** Status of the label with a respective icon and color. Overrides the color set by the color property. */
|
|
27
|
+
status?: 'success' | 'warning' | 'danger' | 'info' | 'custom';
|
|
21
28
|
/** Flag indicating the label is compact. */
|
|
22
29
|
isCompact?: boolean;
|
|
23
30
|
/** @beta Flag indicating the label is editable. */
|
|
@@ -46,7 +53,7 @@ export interface LabelProps extends React.HTMLProps<HTMLSpanElement> {
|
|
|
46
53
|
| 'left-end'
|
|
47
54
|
| 'right-start'
|
|
48
55
|
| 'right-end';
|
|
49
|
-
/** Icon added to the left of the label text. */
|
|
56
|
+
/** Icon added to the left of the label text. Overrides the icon set by the status property. */
|
|
50
57
|
icon?: React.ReactNode;
|
|
51
58
|
/** Close click callback for removable labels. If present, label will have a close button. */
|
|
52
59
|
onClose?: (event: React.MouseEvent) => void;
|
|
@@ -84,11 +91,20 @@ const colorStyles = {
|
|
|
84
91
|
grey: ''
|
|
85
92
|
};
|
|
86
93
|
|
|
94
|
+
const statusIcons = {
|
|
95
|
+
success: <CheckCircleIcon />,
|
|
96
|
+
warning: <ExclamationTriangleIcon />,
|
|
97
|
+
danger: <ExclamationCircleIcon />,
|
|
98
|
+
info: <InfoCircleIcon />,
|
|
99
|
+
custom: <BellIcon />
|
|
100
|
+
};
|
|
101
|
+
|
|
87
102
|
export const Label: React.FunctionComponent<LabelProps> = ({
|
|
88
103
|
children,
|
|
89
104
|
className = '',
|
|
90
105
|
color = 'grey',
|
|
91
106
|
variant = 'filled',
|
|
107
|
+
status,
|
|
92
108
|
isCompact = false,
|
|
93
109
|
isEditable = false,
|
|
94
110
|
editableProps,
|
|
@@ -115,6 +131,14 @@ export const Label: React.FunctionComponent<LabelProps> = ({
|
|
|
115
131
|
const isAddLabel = variant === 'add';
|
|
116
132
|
const isClickable = (onLabelClick && !isOverflowLabel && !isAddLabel) || href;
|
|
117
133
|
|
|
134
|
+
let _icon;
|
|
135
|
+
if (status) {
|
|
136
|
+
_icon = statusIcons[status];
|
|
137
|
+
}
|
|
138
|
+
if (icon) {
|
|
139
|
+
_icon = icon;
|
|
140
|
+
}
|
|
141
|
+
|
|
118
142
|
React.useEffect(() => {
|
|
119
143
|
document.addEventListener('mousedown', onDocMouseDown);
|
|
120
144
|
document.addEventListener('keydown', onKeyDown);
|
|
@@ -235,7 +259,7 @@ export const Label: React.FunctionComponent<LabelProps> = ({
|
|
|
235
259
|
}, [isEditableActive]);
|
|
236
260
|
const content = (
|
|
237
261
|
<React.Fragment>
|
|
238
|
-
{
|
|
262
|
+
{_icon && <span className={css(styles.labelIcon)}>{_icon}</span>}
|
|
239
263
|
<span
|
|
240
264
|
ref={textRef}
|
|
241
265
|
className={css(styles.labelText)}
|
|
@@ -318,7 +342,9 @@ export const Label: React.FunctionComponent<LabelProps> = ({
|
|
|
318
342
|
className={css(
|
|
319
343
|
styles.label,
|
|
320
344
|
colorStyles[color],
|
|
345
|
+
variant === 'filled' && styles.modifiers.filled,
|
|
321
346
|
variant === 'outline' && styles.modifiers.outline,
|
|
347
|
+
status && styles.modifiers[status],
|
|
322
348
|
isOverflowLabel && styles.modifiers.overflow,
|
|
323
349
|
isCompact && styles.modifiers.compact,
|
|
324
350
|
isEditable && labelGrpStyles.modifiers.editable,
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
exports[`Label editable label 1`] = `
|
|
4
4
|
<DocumentFragment>
|
|
5
5
|
<span
|
|
6
|
-
class="pf-v6-c-label pf-m-editable"
|
|
6
|
+
class="pf-v6-c-label pf-m-filled pf-m-editable"
|
|
7
7
|
>
|
|
8
8
|
<button
|
|
9
9
|
class="pf-v6-c-label__content"
|
|
@@ -49,7 +49,7 @@ exports[`Label editable label 1`] = `
|
|
|
49
49
|
exports[`Label editable label 2`] = `
|
|
50
50
|
<DocumentFragment>
|
|
51
51
|
<span
|
|
52
|
-
class="pf-v6-c-label pf-m-editable pf-m-editable-active"
|
|
52
|
+
class="pf-v6-c-label pf-m-filled pf-m-editable pf-m-editable-active"
|
|
53
53
|
>
|
|
54
54
|
<input
|
|
55
55
|
class="pf-v6-c-label__content"
|
|
@@ -64,7 +64,7 @@ exports[`Label editable label 2`] = `
|
|
|
64
64
|
exports[`Label label with additional class name 1`] = `
|
|
65
65
|
<DocumentFragment>
|
|
66
66
|
<span
|
|
67
|
-
class="pf-v6-c-label klass1"
|
|
67
|
+
class="pf-v6-c-label pf-m-filled klass1"
|
|
68
68
|
>
|
|
69
69
|
<span
|
|
70
70
|
class="pf-v6-c-label__content"
|
|
@@ -82,7 +82,7 @@ exports[`Label label with additional class name 1`] = `
|
|
|
82
82
|
exports[`Label label with additional class name and props 1`] = `
|
|
83
83
|
<DocumentFragment>
|
|
84
84
|
<span
|
|
85
|
-
class="pf-v6-c-label class-1"
|
|
85
|
+
class="pf-v6-c-label pf-m-filled class-1"
|
|
86
86
|
data-label-name="something"
|
|
87
87
|
id="label-1"
|
|
88
88
|
>
|
|
@@ -102,7 +102,7 @@ exports[`Label label with additional class name and props 1`] = `
|
|
|
102
102
|
exports[`Label label with blue color 1`] = `
|
|
103
103
|
<DocumentFragment>
|
|
104
104
|
<span
|
|
105
|
-
class="pf-v6-c-label pf-m-blue"
|
|
105
|
+
class="pf-v6-c-label pf-m-blue pf-m-filled"
|
|
106
106
|
>
|
|
107
107
|
<span
|
|
108
108
|
class="pf-v6-c-label__content"
|
|
@@ -138,7 +138,7 @@ exports[`Label label with blue color with outline variant 1`] = `
|
|
|
138
138
|
exports[`Label label with close button 1`] = `
|
|
139
139
|
<DocumentFragment>
|
|
140
140
|
<span
|
|
141
|
-
class="pf-v6-c-label"
|
|
141
|
+
class="pf-v6-c-label pf-m-filled"
|
|
142
142
|
>
|
|
143
143
|
<span
|
|
144
144
|
class="pf-v6-c-label__content"
|
|
@@ -228,7 +228,7 @@ exports[`Label label with close button and outline variant 1`] = `
|
|
|
228
228
|
exports[`Label label with cyan color 1`] = `
|
|
229
229
|
<DocumentFragment>
|
|
230
230
|
<span
|
|
231
|
-
class="pf-v6-c-label pf-m-cyan"
|
|
231
|
+
class="pf-v6-c-label pf-m-cyan pf-m-filled"
|
|
232
232
|
>
|
|
233
233
|
<span
|
|
234
234
|
class="pf-v6-c-label__content"
|
|
@@ -264,7 +264,7 @@ exports[`Label label with cyan color with outline variant 1`] = `
|
|
|
264
264
|
exports[`Label label with green color 1`] = `
|
|
265
265
|
<DocumentFragment>
|
|
266
266
|
<span
|
|
267
|
-
class="pf-v6-c-label pf-m-green"
|
|
267
|
+
class="pf-v6-c-label pf-m-green pf-m-filled"
|
|
268
268
|
>
|
|
269
269
|
<span
|
|
270
270
|
class="pf-v6-c-label__content"
|
|
@@ -300,7 +300,7 @@ exports[`Label label with green color with outline variant 1`] = `
|
|
|
300
300
|
exports[`Label label with grey color 1`] = `
|
|
301
301
|
<DocumentFragment>
|
|
302
302
|
<span
|
|
303
|
-
class="pf-v6-c-label"
|
|
303
|
+
class="pf-v6-c-label pf-m-filled"
|
|
304
304
|
>
|
|
305
305
|
<span
|
|
306
306
|
class="pf-v6-c-label__content"
|
|
@@ -336,7 +336,7 @@ exports[`Label label with grey color with outline variant 1`] = `
|
|
|
336
336
|
exports[`Label label with href 1`] = `
|
|
337
337
|
<DocumentFragment>
|
|
338
338
|
<span
|
|
339
|
-
class="pf-v6-c-label pf-m-clickable"
|
|
339
|
+
class="pf-v6-c-label pf-m-filled pf-m-clickable"
|
|
340
340
|
>
|
|
341
341
|
<a
|
|
342
342
|
class="pf-v6-c-label__content pf-m-clickable"
|
|
@@ -374,7 +374,7 @@ exports[`Label label with href with outline variant 1`] = `
|
|
|
374
374
|
exports[`Label label with orange color 1`] = `
|
|
375
375
|
<DocumentFragment>
|
|
376
376
|
<span
|
|
377
|
-
class="pf-v6-c-label pf-m-orange"
|
|
377
|
+
class="pf-v6-c-label pf-m-orange pf-m-filled"
|
|
378
378
|
>
|
|
379
379
|
<span
|
|
380
380
|
class="pf-v6-c-label__content"
|
|
@@ -410,7 +410,7 @@ exports[`Label label with orange color with outline variant 1`] = `
|
|
|
410
410
|
exports[`Label label with purple color 1`] = `
|
|
411
411
|
<DocumentFragment>
|
|
412
412
|
<span
|
|
413
|
-
class="pf-v6-c-label pf-m-purple"
|
|
413
|
+
class="pf-v6-c-label pf-m-purple pf-m-filled"
|
|
414
414
|
>
|
|
415
415
|
<span
|
|
416
416
|
class="pf-v6-c-label__content"
|
|
@@ -446,7 +446,7 @@ exports[`Label label with purple color with outline variant 1`] = `
|
|
|
446
446
|
exports[`Label label with red color 1`] = `
|
|
447
447
|
<DocumentFragment>
|
|
448
448
|
<span
|
|
449
|
-
class="pf-v6-c-label pf-m-red"
|
|
449
|
+
class="pf-v6-c-label pf-m-red pf-m-filled"
|
|
450
450
|
>
|
|
451
451
|
<span
|
|
452
452
|
class="pf-v6-c-label__content"
|
|
@@ -482,7 +482,7 @@ exports[`Label label with red color with outline variant 1`] = `
|
|
|
482
482
|
exports[`Label label with truncation 1`] = `
|
|
483
483
|
<DocumentFragment>
|
|
484
484
|
<span
|
|
485
|
-
class="pf-v6-c-label"
|
|
485
|
+
class="pf-v6-c-label pf-m-filled"
|
|
486
486
|
>
|
|
487
487
|
<span
|
|
488
488
|
class="pf-v6-c-label__content"
|
|
@@ -501,7 +501,7 @@ exports[`Label label with truncation 1`] = `
|
|
|
501
501
|
exports[`Label renders 1`] = `
|
|
502
502
|
<DocumentFragment>
|
|
503
503
|
<span
|
|
504
|
-
class="pf-v6-c-label"
|
|
504
|
+
class="pf-v6-c-label pf-m-filled"
|
|
505
505
|
>
|
|
506
506
|
<span
|
|
507
507
|
class="pf-v6-c-label__content"
|
|
@@ -519,7 +519,7 @@ exports[`Label renders 1`] = `
|
|
|
519
519
|
exports[`Label renders with isCompact 1`] = `
|
|
520
520
|
<DocumentFragment>
|
|
521
521
|
<span
|
|
522
|
-
class="pf-v6-c-label pf-m-compact"
|
|
522
|
+
class="pf-v6-c-label pf-m-filled pf-m-compact"
|
|
523
523
|
>
|
|
524
524
|
<span
|
|
525
525
|
class="pf-v6-c-label__content"
|
|
@@ -17,7 +17,7 @@ exports[`LabelGroup label group compact 1`] = `
|
|
|
17
17
|
class="pf-v6-c-label-group__list-item"
|
|
18
18
|
>
|
|
19
19
|
<span
|
|
20
|
-
class="pf-v6-c-label pf-m-compact"
|
|
20
|
+
class="pf-v6-c-label pf-m-filled pf-m-compact"
|
|
21
21
|
>
|
|
22
22
|
<span
|
|
23
23
|
class="pf-v6-c-label__content"
|
|
@@ -34,7 +34,7 @@ exports[`LabelGroup label group compact 1`] = `
|
|
|
34
34
|
class="pf-v6-c-label-group__list-item"
|
|
35
35
|
>
|
|
36
36
|
<span
|
|
37
|
-
class="pf-v6-c-label pf-m-compact"
|
|
37
|
+
class="pf-v6-c-label pf-m-filled pf-m-compact"
|
|
38
38
|
>
|
|
39
39
|
<span
|
|
40
40
|
class="pf-v6-c-label__content"
|
|
@@ -51,7 +51,7 @@ exports[`LabelGroup label group compact 1`] = `
|
|
|
51
51
|
class="pf-v6-c-label-group__list-item"
|
|
52
52
|
>
|
|
53
53
|
<span
|
|
54
|
-
class="pf-v6-c-label pf-m-compact"
|
|
54
|
+
class="pf-v6-c-label pf-m-filled pf-m-compact"
|
|
55
55
|
>
|
|
56
56
|
<span
|
|
57
57
|
class="pf-v6-c-label__content"
|
|
@@ -104,7 +104,7 @@ exports[`LabelGroup label group default 1`] = `
|
|
|
104
104
|
class="pf-v6-c-label-group__list-item"
|
|
105
105
|
>
|
|
106
106
|
<span
|
|
107
|
-
class="pf-v6-c-label"
|
|
107
|
+
class="pf-v6-c-label pf-m-filled"
|
|
108
108
|
>
|
|
109
109
|
<span
|
|
110
110
|
class="pf-v6-c-label__content"
|
|
@@ -147,7 +147,7 @@ exports[`LabelGroup label group with category 1`] = `
|
|
|
147
147
|
class="pf-v6-c-label-group__list-item"
|
|
148
148
|
>
|
|
149
149
|
<span
|
|
150
|
-
class="pf-v6-c-label"
|
|
150
|
+
class="pf-v6-c-label pf-m-filled"
|
|
151
151
|
>
|
|
152
152
|
<span
|
|
153
153
|
class="pf-v6-c-label__content"
|
|
@@ -190,7 +190,7 @@ exports[`LabelGroup label group with category and tooltip 1`] = `
|
|
|
190
190
|
class="pf-v6-c-label-group__list-item"
|
|
191
191
|
>
|
|
192
192
|
<span
|
|
193
|
-
class="pf-v6-c-label"
|
|
193
|
+
class="pf-v6-c-label pf-m-filled"
|
|
194
194
|
>
|
|
195
195
|
<span
|
|
196
196
|
class="pf-v6-c-label__content"
|
|
@@ -233,7 +233,7 @@ exports[`LabelGroup label group with closable category 1`] = `
|
|
|
233
233
|
class="pf-v6-c-label-group__list-item"
|
|
234
234
|
>
|
|
235
235
|
<span
|
|
236
|
-
class="pf-v6-c-label"
|
|
236
|
+
class="pf-v6-c-label pf-m-filled"
|
|
237
237
|
>
|
|
238
238
|
<span
|
|
239
239
|
class="pf-v6-c-label__content"
|
|
@@ -5,6 +5,7 @@ cssPrefix: ['pf-v5-c-label', 'pf-v5-c-label-group']
|
|
|
5
5
|
propComponents: ['Label', 'LabelGroup']
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
+
import CubeIcon from '@patternfly/react-icons/dist/esm/icons/cube-icon';
|
|
8
9
|
import InfoCircleIcon from '@patternfly/react-icons/dist/esm/icons/info-circle-icon';
|
|
9
10
|
import { Link } from '@reach/router';
|
|
10
11
|
import './Label.css';
|
|
@@ -1,17 +1,17 @@
|
|
|
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 LabelCompact: React.FunctionComponent = () => (
|
|
6
6
|
<React.Fragment>
|
|
7
7
|
<Label isCompact>Compact</Label>
|
|
8
|
-
<Label isCompact icon={<
|
|
8
|
+
<Label isCompact icon={<CubeIcon />}>
|
|
9
9
|
Compact icon
|
|
10
10
|
</Label>
|
|
11
11
|
<Label isCompact onClose={() => Function.prototype}>
|
|
12
12
|
Compact removable
|
|
13
13
|
</Label>
|
|
14
|
-
<Label isCompact icon={<
|
|
14
|
+
<Label isCompact icon={<CubeIcon />} onClose={() => Function.prototype}>
|
|
15
15
|
Compact icon removable
|
|
16
16
|
</Label>
|
|
17
17
|
<Label isCompact href="#compact">
|
|
@@ -20,7 +20,7 @@ export const LabelCompact: React.FunctionComponent = () => (
|
|
|
20
20
|
<Label isCompact href="#compact" onClose={() => Function.prototype}>
|
|
21
21
|
Compact link removable
|
|
22
22
|
</Label>
|
|
23
|
-
<Label isCompact icon={<
|
|
23
|
+
<Label isCompact icon={<CubeIcon />} onClose={() => Function.prototype} textMaxWidth="16ch">
|
|
24
24
|
Compact label with icon that overflows
|
|
25
25
|
</Label>
|
|
26
26
|
<br />
|
|
@@ -28,13 +28,13 @@ export const LabelCompact: React.FunctionComponent = () => (
|
|
|
28
28
|
<Label variant="outline" color="blue" isCompact>
|
|
29
29
|
Compact
|
|
30
30
|
</Label>
|
|
31
|
-
<Label variant="outline" color="blue" isCompact icon={<
|
|
31
|
+
<Label variant="outline" color="blue" isCompact icon={<CubeIcon />}>
|
|
32
32
|
Compact icon
|
|
33
33
|
</Label>
|
|
34
34
|
<Label variant="outline" color="blue" isCompact onClose={() => Function.prototype}>
|
|
35
35
|
Compact removable
|
|
36
36
|
</Label>
|
|
37
|
-
<Label variant="outline" color="blue" isCompact icon={<
|
|
37
|
+
<Label variant="outline" color="blue" isCompact icon={<CubeIcon />} onClose={() => Function.prototype}>
|
|
38
38
|
Compact icon removable
|
|
39
39
|
</Label>
|
|
40
40
|
<Label variant="outline" color="blue" isCompact href="#compact">
|
|
@@ -47,7 +47,7 @@ export const LabelCompact: React.FunctionComponent = () => (
|
|
|
47
47
|
variant="outline"
|
|
48
48
|
color="blue"
|
|
49
49
|
isCompact
|
|
50
|
-
icon={<
|
|
50
|
+
icon={<CubeIcon />}
|
|
51
51
|
onClose={() => Function.prototype}
|
|
52
52
|
textMaxWidth="16ch"
|
|
53
53
|
>
|