@patternfly/react-core 6.0.0-alpha.20 → 6.0.0-alpha.22
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 +15 -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/Chip/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/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/Icon/Icon.d.ts +4 -3
- package/dist/esm/components/Icon/Icon.d.ts.map +1 -1
- package/dist/esm/components/Icon/Icon.js.map +1 -1
- package/dist/esm/components/Label/Label.d.ts +2 -4
- package/dist/esm/components/Label/Label.d.ts.map +1 -1
- package/dist/esm/components/Label/Label.js +10 -6
- package/dist/esm/components/Label/Label.js.map +1 -1
- package/dist/esm/components/Label/LabelGroup.d.ts.map +1 -1
- package/dist/esm/components/Label/LabelGroup.js +2 -2
- package/dist/esm/components/Label/LabelGroup.js.map +1 -1
- package/dist/esm/components/MultipleFileUpload/MultipleFileUploadStatus.js +2 -2
- package/dist/esm/components/MultipleFileUpload/MultipleFileUploadStatus.js.map +1 -1
- package/dist/esm/components/MultipleFileUpload/MultipleFileUploadStatusItem.d.ts.map +1 -1
- package/dist/esm/components/MultipleFileUpload/MultipleFileUploadStatusItem.js +3 -3
- package/dist/esm/components/MultipleFileUpload/MultipleFileUploadStatusItem.js.map +1 -1
- package/dist/esm/components/NotificationBadge/NotificationBadge.d.ts.map +1 -1
- package/dist/esm/components/NotificationBadge/NotificationBadge.js +7 -13
- package/dist/esm/components/NotificationBadge/NotificationBadge.js.map +1 -1
- package/dist/esm/components/Sidebar/Sidebar.d.ts +4 -0
- package/dist/esm/components/Sidebar/Sidebar.d.ts.map +1 -1
- package/dist/esm/components/Sidebar/Sidebar.js +5 -0
- package/dist/esm/components/Sidebar/Sidebar.js.map +1 -1
- package/dist/esm/components/Sidebar/SidebarContent.d.ts +2 -0
- package/dist/esm/components/Sidebar/SidebarContent.d.ts.map +1 -1
- package/dist/esm/components/Sidebar/SidebarContent.js +2 -2
- package/dist/esm/components/Sidebar/SidebarContent.js.map +1 -1
- package/dist/esm/components/Sidebar/SidebarPanel.d.ts +2 -0
- package/dist/esm/components/Sidebar/SidebarPanel.d.ts.map +1 -1
- package/dist/esm/components/Sidebar/SidebarPanel.js +2 -2
- package/dist/esm/components/Sidebar/SidebarPanel.js.map +1 -1
- package/dist/js/components/Icon/Icon.d.ts +4 -3
- package/dist/js/components/Icon/Icon.d.ts.map +1 -1
- package/dist/js/components/Icon/Icon.js.map +1 -1
- package/dist/js/components/Label/Label.d.ts +2 -4
- package/dist/js/components/Label/Label.d.ts.map +1 -1
- package/dist/js/components/Label/Label.js +10 -6
- package/dist/js/components/Label/Label.js.map +1 -1
- package/dist/js/components/Label/LabelGroup.d.ts.map +1 -1
- package/dist/js/components/Label/LabelGroup.js +2 -2
- package/dist/js/components/Label/LabelGroup.js.map +1 -1
- package/dist/js/components/MultipleFileUpload/MultipleFileUploadStatus.js +2 -2
- package/dist/js/components/MultipleFileUpload/MultipleFileUploadStatus.js.map +1 -1
- package/dist/js/components/MultipleFileUpload/MultipleFileUploadStatusItem.d.ts.map +1 -1
- package/dist/js/components/MultipleFileUpload/MultipleFileUploadStatusItem.js +3 -3
- package/dist/js/components/MultipleFileUpload/MultipleFileUploadStatusItem.js.map +1 -1
- package/dist/js/components/NotificationBadge/NotificationBadge.d.ts.map +1 -1
- package/dist/js/components/NotificationBadge/NotificationBadge.js +7 -13
- package/dist/js/components/NotificationBadge/NotificationBadge.js.map +1 -1
- package/dist/js/components/Sidebar/Sidebar.d.ts +4 -0
- package/dist/js/components/Sidebar/Sidebar.d.ts.map +1 -1
- package/dist/js/components/Sidebar/Sidebar.js +6 -1
- package/dist/js/components/Sidebar/Sidebar.js.map +1 -1
- package/dist/js/components/Sidebar/SidebarContent.d.ts +2 -0
- package/dist/js/components/Sidebar/SidebarContent.d.ts.map +1 -1
- package/dist/js/components/Sidebar/SidebarContent.js +2 -2
- package/dist/js/components/Sidebar/SidebarContent.js.map +1 -1
- package/dist/js/components/Sidebar/SidebarPanel.d.ts +2 -0
- package/dist/js/components/Sidebar/SidebarPanel.d.ts.map +1 -1
- package/dist/js/components/Sidebar/SidebarPanel.js +2 -2
- package/dist/js/components/Sidebar/SidebarPanel.js.map +1 -1
- package/dist/umd/react-core.min.js +2 -2
- package/helpers/package.json +1 -1
- package/layouts/package.json +1 -1
- package/next/package.json +1 -1
- package/package.json +3 -2
- package/src/components/Icon/Icon.tsx +20 -3
- package/src/components/Icon/__tests__/Icon.test.tsx +49 -30
- package/src/components/Icon/examples/BodyIconSizes.tsx +17 -0
- package/src/components/Icon/examples/HeadingIconSizes.tsx +26 -0
- package/src/components/Icon/examples/Icon.md +18 -2
- package/src/components/Icon/examples/IconContentSizes.tsx +4 -4
- package/src/components/Icon/examples/{IconSizes.tsx → StandaloneIconSizes.tsx} +7 -1
- package/src/components/Label/Label.tsx +14 -9
- package/src/components/Label/LabelGroup.tsx +2 -1
- package/src/components/Label/__tests__/__snapshots__/Label.test.tsx.snap +7 -7
- package/src/components/Label/__tests__/__snapshots__/LabelGroup.test.tsx.snap +1 -1
- package/src/components/Label/examples/Label.css +6 -0
- package/src/components/Label/examples/Label.md +19 -3
- package/src/components/Label/examples/LabelCompact.tsx +35 -5
- package/src/components/Label/examples/LabelFilled.tsx +75 -47
- package/src/components/Label/examples/LabelGroupEditableAdd.tsx +1 -1
- package/src/components/Label/examples/LabelGroupEditableAddDropdown.tsx +1 -1
- package/src/components/Label/examples/LabelGroupEditableAddModal.tsx +1 -1
- package/src/components/Label/examples/LabelOutline.tsx +88 -48
- package/src/components/MultipleFileUpload/MultipleFileUploadStatus.tsx +2 -2
- package/src/components/MultipleFileUpload/MultipleFileUploadStatusItem.tsx +3 -4
- package/src/components/MultipleFileUpload/__tests__/__snapshots__/MultipleFileUploadStatus.test.tsx.snap +4 -4
- package/src/components/MultipleFileUpload/__tests__/__snapshots__/MultipleFileUploadStatusItem.test.tsx.snap +40 -24
- package/src/components/NotificationBadge/NotificationBadge.tsx +19 -15
- package/src/components/NotificationBadge/__tests__/NotificationBadge.test.tsx +4 -4
- package/src/components/NotificationBadge/__tests__/__snapshots__/NotificationBadge.test.tsx.snap +10 -22
- package/src/components/NotificationBadge/examples/NotificationBadge.md +0 -1
- package/src/components/NotificationBadge/examples/NotificationBadgeBasic.tsx +2 -2
- package/src/components/NotificationBadge/examples/NotificationBadgeWithCount.tsx +2 -2
- package/src/components/Sidebar/Sidebar.tsx +5 -0
- package/src/components/Sidebar/SidebarContent.tsx +4 -0
- package/src/components/Sidebar/SidebarPanel.tsx +4 -0
- package/src/components/Sidebar/__tests__/SidebarContent.test.tsx +5 -0
- package/src/components/Sidebar/__tests__/SidebarPanel.test.tsx +5 -0
- package/src/components/NotificationBadge/examples/notificationBadge.css +0 -4
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.21","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.21","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.21","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.22",
|
|
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",
|
|
@@ -58,6 +58,7 @@
|
|
|
58
58
|
"@rollup/plugin-commonjs": "^25.0.0",
|
|
59
59
|
"@rollup/plugin-node-resolve": "^15.0.2",
|
|
60
60
|
"@rollup/plugin-replace": "^5.0.2",
|
|
61
|
+
"case-anything": "^2.1.13",
|
|
61
62
|
"css": "^2.2.3",
|
|
62
63
|
"fs-extra": "^11.1.1",
|
|
63
64
|
"glob": "^7.1.2",
|
|
@@ -72,5 +73,5 @@
|
|
|
72
73
|
"react": "^17 || ^18",
|
|
73
74
|
"react-dom": "^17 || ^18"
|
|
74
75
|
},
|
|
75
|
-
"gitHead": "
|
|
76
|
+
"gitHead": "86a75d22746d3f69d3fe8aec947d39213e8b60d4"
|
|
76
77
|
}
|
|
@@ -3,6 +3,23 @@ import styles from '@patternfly/react-styles/css/components/Icon/icon';
|
|
|
3
3
|
import { css } from '@patternfly/react-styles';
|
|
4
4
|
import { Spinner } from '../Spinner';
|
|
5
5
|
|
|
6
|
+
export type IconSize =
|
|
7
|
+
| 'sm'
|
|
8
|
+
| 'md'
|
|
9
|
+
| 'lg'
|
|
10
|
+
| 'xl'
|
|
11
|
+
| '2xl'
|
|
12
|
+
| '3xl'
|
|
13
|
+
| 'headingSm'
|
|
14
|
+
| 'headingMd'
|
|
15
|
+
| 'headingLg'
|
|
16
|
+
| 'headingXl'
|
|
17
|
+
| 'heading_2xl'
|
|
18
|
+
| 'heading_3xl'
|
|
19
|
+
| 'bodySm'
|
|
20
|
+
| 'bodyDefault'
|
|
21
|
+
| 'bodyLg';
|
|
22
|
+
|
|
6
23
|
export interface IconComponentProps extends Omit<React.HTMLProps<HTMLSpanElement>, 'size'> {
|
|
7
24
|
/** Icon content */
|
|
8
25
|
children?: React.ReactNode;
|
|
@@ -11,11 +28,11 @@ export interface IconComponentProps extends Omit<React.HTMLProps<HTMLSpanElement
|
|
|
11
28
|
/** Additional classes applied to the icon container */
|
|
12
29
|
className?: string;
|
|
13
30
|
/** Size of the icon component container and icon. */
|
|
14
|
-
size?:
|
|
31
|
+
size?: IconSize;
|
|
15
32
|
/** Size of icon. Overrides the icon size set by the size property. */
|
|
16
|
-
iconSize?:
|
|
33
|
+
iconSize?: IconSize;
|
|
17
34
|
/** Size of progress icon. Overrides the icon size set by the size property. */
|
|
18
|
-
progressIconSize?:
|
|
35
|
+
progressIconSize?: IconSize;
|
|
19
36
|
/** Status color of the icon */
|
|
20
37
|
status?: 'custom' | 'info' | 'success' | 'warning' | 'danger';
|
|
21
38
|
/** Indicates the icon is inline and should inherit the text font size and color. Overriden by size and iconSize properties. */
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { render, screen } from '@testing-library/react';
|
|
3
|
-
import {
|
|
3
|
+
import { kebabCase } from 'case-anything';
|
|
4
|
+
import { Icon, IconSize } from '../Icon';
|
|
4
5
|
import CheckIcon from '@patternfly/react-icons/dist/esm/icons/check-icon';
|
|
5
6
|
import styles from '@patternfly/react-styles/css/components/Icon/icon';
|
|
6
7
|
|
|
@@ -41,16 +42,60 @@ test('sets additional custom class successfully', () => {
|
|
|
41
42
|
expect(iconContainer).toHaveClass('test');
|
|
42
43
|
});
|
|
43
44
|
|
|
44
|
-
Object.values([
|
|
45
|
+
Object.values([
|
|
46
|
+
'sm',
|
|
47
|
+
'md',
|
|
48
|
+
'lg',
|
|
49
|
+
'xl',
|
|
50
|
+
'2xl',
|
|
51
|
+
'3xl',
|
|
52
|
+
'headingSm',
|
|
53
|
+
'headingMd',
|
|
54
|
+
'headingLg',
|
|
55
|
+
'headingXl',
|
|
56
|
+
'heading_2xl',
|
|
57
|
+
'heading_3xl',
|
|
58
|
+
'bodySm',
|
|
59
|
+
'bodyDefault',
|
|
60
|
+
'bodyLg'
|
|
61
|
+
]).forEach((size) => {
|
|
45
62
|
test(`sets icon size modifier successfully - ${size}`, () => {
|
|
46
63
|
render(
|
|
47
|
-
<Icon iconSize={size as
|
|
64
|
+
<Icon iconSize={size as IconSize} title={`content-${size}-icon`}>
|
|
48
65
|
<CheckIcon />
|
|
49
66
|
</Icon>
|
|
50
67
|
);
|
|
51
68
|
const iconContainer = screen.getByTitle(`content-${size}-icon`).querySelector(`.${styles.iconContent}`);
|
|
52
69
|
|
|
53
|
-
|
|
70
|
+
const formattedSize = kebabCase(size).replace(/(\d)(-)/, '$1');
|
|
71
|
+
|
|
72
|
+
expect(iconContainer).toHaveClass(`pf-m-${formattedSize}`);
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
test(`sets progress icon size modifier successfully - ${size}`, () => {
|
|
76
|
+
render(
|
|
77
|
+
<Icon isInProgress progressIconSize={size as IconSize} title={`progress-content-${size}-icon`}>
|
|
78
|
+
<CheckIcon />
|
|
79
|
+
</Icon>
|
|
80
|
+
);
|
|
81
|
+
const iconContainer = screen.getByTitle(`progress-content-${size}-icon`).querySelector(`.${styles.iconProgress}`);
|
|
82
|
+
|
|
83
|
+
const formattedSize = kebabCase(size).replace(/(\d)(-)/, '$1');
|
|
84
|
+
|
|
85
|
+
expect(iconContainer).toHaveClass(`pf-m-${formattedSize}`);
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
test(`sets size modifier successfully - ${size}`, () => {
|
|
89
|
+
render(
|
|
90
|
+
<Icon size={size as IconSize} title={`${size}-icon`}>
|
|
91
|
+
<CheckIcon />
|
|
92
|
+
</Icon>
|
|
93
|
+
);
|
|
94
|
+
const iconContainer = screen.getByTitle(`${size}-icon`);
|
|
95
|
+
|
|
96
|
+
const formattedSize = kebabCase(size).replace(/(\d)(-)/, '$1');
|
|
97
|
+
|
|
98
|
+
expect(iconContainer).toHaveClass(`pf-m-${formattedSize}`);
|
|
54
99
|
});
|
|
55
100
|
});
|
|
56
101
|
|
|
@@ -64,19 +109,6 @@ test('check icon without iconSize', () => {
|
|
|
64
109
|
expect(Array.from(iconContainer?.classList || []).some((c) => /pf-m-*/.test(c))); // Check no modifier classes have been added
|
|
65
110
|
});
|
|
66
111
|
|
|
67
|
-
Object.values(['sm', 'md', 'lg', 'xl']).forEach((size) => {
|
|
68
|
-
test(`sets progress icon size modifier successfully - ${size}`, () => {
|
|
69
|
-
render(
|
|
70
|
-
<Icon isInProgress progressIconSize={size as 'sm' | 'md' | 'lg' | 'xl'} title={`progress-content-${size}-icon`}>
|
|
71
|
-
<CheckIcon />
|
|
72
|
-
</Icon>
|
|
73
|
-
);
|
|
74
|
-
const iconContainer = screen.getByTitle(`progress-content-${size}-icon`).querySelector(`.${styles.iconProgress}`);
|
|
75
|
-
|
|
76
|
-
expect(iconContainer).toHaveClass(`pf-m-${size}`);
|
|
77
|
-
});
|
|
78
|
-
});
|
|
79
|
-
|
|
80
112
|
test('check icon without progress icon size', () => {
|
|
81
113
|
render(
|
|
82
114
|
<Icon title="no-progress-icon-size">
|
|
@@ -87,19 +119,6 @@ test('check icon without progress icon size', () => {
|
|
|
87
119
|
expect(Array.from(iconContainer?.classList || []).some((c) => /pf-m-*/.test(c))); // Check no modifier classes have been added
|
|
88
120
|
});
|
|
89
121
|
|
|
90
|
-
Object.values(['sm', 'md', 'lg', 'xl']).forEach((size) => {
|
|
91
|
-
test(`sets size modifier successfully - ${size}`, () => {
|
|
92
|
-
render(
|
|
93
|
-
<Icon size={size as 'sm' | 'md' | 'lg' | 'xl'} title={`${size}-icon`}>
|
|
94
|
-
<CheckIcon />
|
|
95
|
-
</Icon>
|
|
96
|
-
);
|
|
97
|
-
const iconContainer = screen.getByTitle(`${size}-icon`);
|
|
98
|
-
|
|
99
|
-
expect(iconContainer).toHaveClass(`pf-m-${size}`);
|
|
100
|
-
});
|
|
101
|
-
});
|
|
102
|
-
|
|
103
122
|
test('check icon without size', () => {
|
|
104
123
|
render(
|
|
105
124
|
<Icon title="no-size">
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Icon } from '@patternfly/react-core';
|
|
3
|
+
import PlusCircleIcon from '@patternfly/react-icons/dist/esm/icons/plus-circle-icon';
|
|
4
|
+
|
|
5
|
+
export const BodyIconSizes: React.FunctionComponent = () => (
|
|
6
|
+
<React.Fragment>
|
|
7
|
+
<Icon size="bodySm">
|
|
8
|
+
<PlusCircleIcon />
|
|
9
|
+
</Icon>
|
|
10
|
+
<Icon size="bodyDefault">
|
|
11
|
+
<PlusCircleIcon />
|
|
12
|
+
</Icon>
|
|
13
|
+
<Icon size="bodyLg">
|
|
14
|
+
<PlusCircleIcon />
|
|
15
|
+
</Icon>
|
|
16
|
+
</React.Fragment>
|
|
17
|
+
);
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Icon } from '@patternfly/react-core';
|
|
3
|
+
import PlusCircleIcon from '@patternfly/react-icons/dist/esm/icons/plus-circle-icon';
|
|
4
|
+
|
|
5
|
+
export const HeadingIconSizes: React.FunctionComponent = () => (
|
|
6
|
+
<React.Fragment>
|
|
7
|
+
<Icon size="headingSm">
|
|
8
|
+
<PlusCircleIcon />
|
|
9
|
+
</Icon>
|
|
10
|
+
<Icon size="headingMd">
|
|
11
|
+
<PlusCircleIcon />
|
|
12
|
+
</Icon>
|
|
13
|
+
<Icon size="headingLg">
|
|
14
|
+
<PlusCircleIcon />
|
|
15
|
+
</Icon>
|
|
16
|
+
<Icon size="headingXl">
|
|
17
|
+
<PlusCircleIcon />
|
|
18
|
+
</Icon>
|
|
19
|
+
<Icon size="heading_2xl">
|
|
20
|
+
<PlusCircleIcon />
|
|
21
|
+
</Icon>
|
|
22
|
+
<Icon size="heading_3xl">
|
|
23
|
+
<PlusCircleIcon />
|
|
24
|
+
</Icon>
|
|
25
|
+
</React.Fragment>
|
|
26
|
+
);
|
|
@@ -23,9 +23,25 @@ import BellIcon from '@patternfly/react-icons/dist/esm/icons/bell-icon';
|
|
|
23
23
|
```ts file="IconBasic.tsx"
|
|
24
24
|
```
|
|
25
25
|
|
|
26
|
-
###
|
|
26
|
+
### Standalone icon sizes
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
These are the standard options for sizing icons.
|
|
29
|
+
|
|
30
|
+
```ts file="StandaloneIconSizes.tsx"
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### Body sizes
|
|
34
|
+
|
|
35
|
+
These size options are meant to make icons match the size of body text.
|
|
36
|
+
|
|
37
|
+
```ts file="BodyIconSizes.tsx"
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### Heading sizes
|
|
41
|
+
|
|
42
|
+
These size options are meant to make icons match the size of heading text.
|
|
43
|
+
|
|
44
|
+
```ts file="HeadingIconSizes.tsx"
|
|
29
45
|
```
|
|
30
46
|
|
|
31
47
|
### Status colors
|
|
@@ -4,16 +4,16 @@ import PlusCircleIcon from '@patternfly/react-icons/dist/esm/icons/plus-circle-i
|
|
|
4
4
|
|
|
5
5
|
export const IconContentSizes: React.FunctionComponent = () => (
|
|
6
6
|
<React.Fragment>
|
|
7
|
-
<Icon size="
|
|
7
|
+
<Icon size="3xl" iconSize="lg">
|
|
8
8
|
<PlusCircleIcon />
|
|
9
9
|
</Icon>
|
|
10
|
-
<Icon size="
|
|
10
|
+
<Icon size="3xl" iconSize="xl">
|
|
11
11
|
<PlusCircleIcon />
|
|
12
12
|
</Icon>
|
|
13
|
-
<Icon size="
|
|
13
|
+
<Icon size="3xl" iconSize="2xl">
|
|
14
14
|
<PlusCircleIcon />
|
|
15
15
|
</Icon>
|
|
16
|
-
<Icon size="
|
|
16
|
+
<Icon size="3xl">
|
|
17
17
|
<PlusCircleIcon />
|
|
18
18
|
</Icon>
|
|
19
19
|
</React.Fragment>
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { Icon } from '@patternfly/react-core';
|
|
3
3
|
import PlusCircleIcon from '@patternfly/react-icons/dist/esm/icons/plus-circle-icon';
|
|
4
4
|
|
|
5
|
-
export const
|
|
5
|
+
export const StandaloneIconSizes: React.FunctionComponent = () => (
|
|
6
6
|
<React.Fragment>
|
|
7
7
|
<Icon size="sm">
|
|
8
8
|
<PlusCircleIcon />
|
|
@@ -16,5 +16,11 @@ export const IconSizes: React.FunctionComponent = () => (
|
|
|
16
16
|
<Icon size="xl">
|
|
17
17
|
<PlusCircleIcon />
|
|
18
18
|
</Icon>
|
|
19
|
+
<Icon size="2xl">
|
|
20
|
+
<PlusCircleIcon />
|
|
21
|
+
</Icon>
|
|
22
|
+
<Icon size="3xl">
|
|
23
|
+
<PlusCircleIcon />
|
|
24
|
+
</Icon>
|
|
19
25
|
</React.Fragment>
|
|
20
26
|
);
|
|
@@ -15,9 +15,9 @@ export interface LabelProps extends React.HTMLProps<HTMLSpanElement> {
|
|
|
15
15
|
/** Additional classes added to the label. */
|
|
16
16
|
className?: string;
|
|
17
17
|
/** Color of the label. */
|
|
18
|
-
color?: 'blue' | 'cyan' | 'green' | 'orange' | 'purple' | 'red' | 'grey' | 'gold';
|
|
18
|
+
color?: 'blue' | 'cyan' | 'green' | 'orange' | 'purple' | 'red' | 'orangered' | 'grey' | 'gold';
|
|
19
19
|
/** Variant of the label. */
|
|
20
|
-
variant?: 'outline' | 'filled';
|
|
20
|
+
variant?: 'outline' | 'filled' | 'overflow' | 'add';
|
|
21
21
|
/** Flag indicating the label is compact. */
|
|
22
22
|
isCompact?: boolean;
|
|
23
23
|
/** @beta Flag indicating the label is editable. */
|
|
@@ -58,8 +58,6 @@ export interface LabelProps extends React.HTMLProps<HTMLSpanElement> {
|
|
|
58
58
|
closeBtnProps?: any;
|
|
59
59
|
/** Href for a label that is a link. If present, the label will change to an anchor element. This should not be passed in if the onClick prop is also passed in. */
|
|
60
60
|
href?: string;
|
|
61
|
-
/** Flag indicating if the label is an overflow label. */
|
|
62
|
-
isOverflowLabel?: boolean;
|
|
63
61
|
/** Callback for when the label is clicked. This should not be passed in if the href or isEditable props are also passed in. */
|
|
64
62
|
onClick?: (event: React.MouseEvent) => void;
|
|
65
63
|
/** Forwards the label content and className to rendered function. Use this prop for react router support.*/
|
|
@@ -81,6 +79,7 @@ const colorStyles = {
|
|
|
81
79
|
orange: styles.modifiers.orange,
|
|
82
80
|
purple: styles.modifiers.purple,
|
|
83
81
|
red: styles.modifiers.red,
|
|
82
|
+
orangered: styles.modifiers.orangered,
|
|
84
83
|
gold: styles.modifiers.gold,
|
|
85
84
|
grey: ''
|
|
86
85
|
};
|
|
@@ -104,7 +103,6 @@ export const Label: React.FunctionComponent<LabelProps> = ({
|
|
|
104
103
|
closeBtnAriaLabel,
|
|
105
104
|
closeBtnProps,
|
|
106
105
|
href,
|
|
107
|
-
isOverflowLabel,
|
|
108
106
|
render,
|
|
109
107
|
...props
|
|
110
108
|
}: LabelProps) => {
|
|
@@ -113,6 +111,10 @@ export const Label: React.FunctionComponent<LabelProps> = ({
|
|
|
113
111
|
const editableButtonRef = React.useRef<HTMLButtonElement>();
|
|
114
112
|
const editableInputRef = React.useRef<HTMLInputElement>();
|
|
115
113
|
|
|
114
|
+
const isOverflowLabel = variant === 'overflow';
|
|
115
|
+
const isAddLabel = variant === 'add';
|
|
116
|
+
const isClickable = (onLabelClick && !isOverflowLabel && !isAddLabel) || href;
|
|
117
|
+
|
|
116
118
|
React.useEffect(() => {
|
|
117
119
|
document.addEventListener('mousedown', onDocMouseDown);
|
|
118
120
|
document.addEventListener('keydown', onKeyDown);
|
|
@@ -198,12 +200,13 @@ export const Label: React.FunctionComponent<LabelProps> = ({
|
|
|
198
200
|
}
|
|
199
201
|
};
|
|
200
202
|
|
|
201
|
-
const LabelComponent = (isOverflowLabel ? 'button' : 'span') as any;
|
|
203
|
+
const LabelComponent = (isOverflowLabel || isAddLabel ? 'button' : 'span') as any;
|
|
202
204
|
|
|
203
205
|
const defaultButton = (
|
|
204
206
|
<Button
|
|
205
207
|
type="button"
|
|
206
208
|
variant="plain"
|
|
209
|
+
hasNoPadding
|
|
207
210
|
onClick={onClose}
|
|
208
211
|
aria-label={closeBtnAriaLabel || `Close ${children}`}
|
|
209
212
|
{...closeBtnProps}
|
|
@@ -253,7 +256,7 @@ export const Label: React.FunctionComponent<LabelProps> = ({
|
|
|
253
256
|
let LabelComponentChildElement = 'span';
|
|
254
257
|
if (href) {
|
|
255
258
|
LabelComponentChildElement = 'a';
|
|
256
|
-
} else if (isEditable || (onLabelClick && !isOverflowLabel)) {
|
|
259
|
+
} else if (isEditable || (onLabelClick && !isOverflowLabel && !isAddLabel)) {
|
|
257
260
|
LabelComponentChildElement = 'button';
|
|
258
261
|
}
|
|
259
262
|
|
|
@@ -265,7 +268,7 @@ export const Label: React.FunctionComponent<LabelProps> = ({
|
|
|
265
268
|
const isButton = LabelComponentChildElement === 'button';
|
|
266
269
|
|
|
267
270
|
const labelComponentChildProps = {
|
|
268
|
-
className: css(styles.labelContent),
|
|
271
|
+
className: css(styles.labelContent, isClickable && styles.modifiers.clickable),
|
|
269
272
|
...(isTooltipVisible && { tabIndex: 0 }),
|
|
270
273
|
...(href && { href }),
|
|
271
274
|
...(isButton && clickableLabelProps),
|
|
@@ -313,9 +316,11 @@ export const Label: React.FunctionComponent<LabelProps> = ({
|
|
|
313
316
|
isCompact && styles.modifiers.compact,
|
|
314
317
|
isEditable && labelGrpStyles.modifiers.editable,
|
|
315
318
|
isEditableActive && styles.modifiers.editableActive,
|
|
319
|
+
isClickable && styles.modifiers.clickable,
|
|
320
|
+
isAddLabel && styles.modifiers.add,
|
|
316
321
|
className
|
|
317
322
|
)}
|
|
318
|
-
onClick={isOverflowLabel ? onLabelClick : undefined}
|
|
323
|
+
onClick={isOverflowLabel || isAddLabel ? onLabelClick : undefined}
|
|
319
324
|
>
|
|
320
325
|
{!isEditableActive && labelComponentChild}
|
|
321
326
|
{!isEditableActive && onClose && button}
|
|
@@ -183,7 +183,7 @@ class LabelGroup extends React.Component<LabelGroupProps, LabelGroupState> {
|
|
|
183
183
|
{numChildren > numLabels && (
|
|
184
184
|
<li className={css(styles.labelGroupListItem)}>
|
|
185
185
|
<Label
|
|
186
|
-
|
|
186
|
+
variant="overflow"
|
|
187
187
|
onClick={this.toggleCollapse}
|
|
188
188
|
className={css(isCompact && labelStyles.modifiers.compact)}
|
|
189
189
|
>
|
|
@@ -205,6 +205,7 @@ class LabelGroup extends React.Component<LabelGroupProps, LabelGroupState> {
|
|
|
205
205
|
<div className={css(styles.labelGroupClose)}>
|
|
206
206
|
<Button
|
|
207
207
|
variant="plain"
|
|
208
|
+
hasNoPadding
|
|
208
209
|
aria-label={closeBtnAriaLabel}
|
|
209
210
|
onClick={onClick}
|
|
210
211
|
id={`remove_group_${id}`}
|
|
@@ -21,7 +21,7 @@ exports[`Label editable label 1`] = `
|
|
|
21
21
|
<button
|
|
22
22
|
aria-disabled="false"
|
|
23
23
|
aria-label="Close Something"
|
|
24
|
-
class="pf-v5-c-button pf-m-plain"
|
|
24
|
+
class="pf-v5-c-button pf-m-plain pf-m-no-padding"
|
|
25
25
|
data-ouia-component-id="OUIA-Generated-Button-plain-3"
|
|
26
26
|
data-ouia-component-type="PF5/Button"
|
|
27
27
|
data-ouia-safe="true"
|
|
@@ -155,7 +155,7 @@ exports[`Label label with close button 1`] = `
|
|
|
155
155
|
<button
|
|
156
156
|
aria-disabled="false"
|
|
157
157
|
aria-label="Close Something"
|
|
158
|
-
class="pf-v5-c-button pf-m-plain"
|
|
158
|
+
class="pf-v5-c-button pf-m-plain pf-m-no-padding"
|
|
159
159
|
data-ouia-component-id="OUIA-Generated-Button-plain-1"
|
|
160
160
|
data-ouia-component-type="PF5/Button"
|
|
161
161
|
data-ouia-safe="true"
|
|
@@ -200,7 +200,7 @@ exports[`Label label with close button and outline variant 1`] = `
|
|
|
200
200
|
<button
|
|
201
201
|
aria-disabled="false"
|
|
202
202
|
aria-label="Close Something"
|
|
203
|
-
class="pf-v5-c-button pf-m-plain"
|
|
203
|
+
class="pf-v5-c-button pf-m-plain pf-m-no-padding"
|
|
204
204
|
data-ouia-component-id="OUIA-Generated-Button-plain-2"
|
|
205
205
|
data-ouia-component-type="PF5/Button"
|
|
206
206
|
data-ouia-safe="true"
|
|
@@ -336,10 +336,10 @@ 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-v5-c-label"
|
|
339
|
+
class="pf-v5-c-label pf-m-clickable"
|
|
340
340
|
>
|
|
341
341
|
<a
|
|
342
|
-
class="pf-v5-c-label__content"
|
|
342
|
+
class="pf-v5-c-label__content pf-m-clickable"
|
|
343
343
|
href="#"
|
|
344
344
|
>
|
|
345
345
|
<span
|
|
@@ -355,10 +355,10 @@ exports[`Label label with href 1`] = `
|
|
|
355
355
|
exports[`Label label with href with outline variant 1`] = `
|
|
356
356
|
<DocumentFragment>
|
|
357
357
|
<span
|
|
358
|
-
class="pf-v5-c-label pf-m-outline"
|
|
358
|
+
class="pf-v5-c-label pf-m-outline pf-m-clickable"
|
|
359
359
|
>
|
|
360
360
|
<a
|
|
361
|
-
class="pf-v5-c-label__content"
|
|
361
|
+
class="pf-v5-c-label__content pf-m-clickable"
|
|
362
362
|
href="#"
|
|
363
363
|
>
|
|
364
364
|
<span
|
|
@@ -255,7 +255,7 @@ exports[`LabelGroup label group with closable category 1`] = `
|
|
|
255
255
|
aria-disabled="false"
|
|
256
256
|
aria-label="Close label group"
|
|
257
257
|
aria-labelledby="remove_group_pf-random-id-2 pf-random-id-2"
|
|
258
|
-
class="pf-v5-c-button pf-m-plain"
|
|
258
|
+
class="pf-v5-c-button pf-m-plain pf-m-no-padding"
|
|
259
259
|
data-ouia-component-id="OUIA-Generated-Button-plain-1"
|
|
260
260
|
data-ouia-component-type="PF5/Button"
|
|
261
261
|
data-ouia-safe="true"
|
|
@@ -7,71 +7,86 @@ propComponents: ['Label', 'LabelGroup']
|
|
|
7
7
|
|
|
8
8
|
import InfoCircleIcon from '@patternfly/react-icons/dist/esm/icons/info-circle-icon';
|
|
9
9
|
import { Link } from '@reach/router';
|
|
10
|
+
import './Label.css';
|
|
10
11
|
|
|
11
12
|
## Examples
|
|
12
13
|
|
|
13
14
|
### Filled labels
|
|
14
15
|
|
|
15
16
|
```ts file="LabelFilled.tsx"
|
|
17
|
+
|
|
16
18
|
```
|
|
17
19
|
|
|
18
20
|
### Outlined labels
|
|
19
21
|
|
|
20
22
|
```ts file="LabelOutline.tsx"
|
|
23
|
+
|
|
21
24
|
```
|
|
22
25
|
|
|
23
26
|
### Compact labels
|
|
24
27
|
|
|
25
28
|
```ts file="LabelCompact.tsx"
|
|
29
|
+
|
|
26
30
|
```
|
|
27
31
|
|
|
28
32
|
### Label with router link
|
|
29
33
|
|
|
30
34
|
```ts file="LabelRouterLink.tsx"
|
|
35
|
+
|
|
31
36
|
```
|
|
32
37
|
|
|
33
38
|
### Editable labels
|
|
34
39
|
|
|
35
|
-
Click or press either enter or space to begin editing a label. After editing, click outside the label or press enter again to complete the edit. To cancel an edit, press escape.
|
|
40
|
+
Click or press either enter or space to begin editing a label. After editing, click outside the label or press enter again to complete the edit. To cancel an edit, press escape.
|
|
36
41
|
|
|
37
42
|
You can also customize any Label's close button aria-label as this example shows with `closeBtnAriaLabel`.
|
|
38
43
|
|
|
39
44
|
```ts file="LabelEditable.tsx" isBeta
|
|
40
|
-
```
|
|
41
45
|
|
|
46
|
+
```
|
|
42
47
|
|
|
43
48
|
### Basic label group
|
|
44
|
-
|
|
49
|
+
|
|
50
|
+
Use a label group when you have multiple labels to display at once.
|
|
45
51
|
|
|
46
52
|
```ts file="LabelGroupBasic.tsx"
|
|
53
|
+
|
|
47
54
|
```
|
|
48
55
|
|
|
49
56
|
### Label group with overflow
|
|
57
|
+
|
|
50
58
|
An overflow label can be added to the end of a group to save space when the number of labels exceeds some threshold. Click the overflow label to expand and collapse the group.
|
|
51
59
|
|
|
52
60
|
```ts file="LabelGroupOverflow.tsx"
|
|
61
|
+
|
|
53
62
|
```
|
|
54
63
|
|
|
55
64
|
### Label group with categories
|
|
65
|
+
|
|
56
66
|
Use a category name to organize a set of labels
|
|
57
67
|
|
|
58
68
|
```ts file="LabelGroupCategory.tsx"
|
|
69
|
+
|
|
59
70
|
```
|
|
60
71
|
|
|
61
72
|
### Label group with removable categories
|
|
62
73
|
|
|
63
74
|
```ts file="LabelGroupCategoryRemovable.tsx"
|
|
75
|
+
|
|
64
76
|
```
|
|
65
77
|
|
|
66
78
|
### Vertical label group
|
|
79
|
+
|
|
67
80
|
Labels in a group can also be stacked vertically. This example shows a verical label group with a category name and overflow.
|
|
68
81
|
|
|
69
82
|
```ts file="LabelGroupVerticalCategoryOverflowRemovable.tsx"
|
|
83
|
+
|
|
70
84
|
```
|
|
71
85
|
|
|
72
86
|
### Editable label group
|
|
73
87
|
|
|
74
88
|
```ts isBeta file="LabelGroupEditableLabels.tsx"
|
|
89
|
+
|
|
75
90
|
```
|
|
76
91
|
|
|
77
92
|
### Editable label group with add button
|
|
@@ -79,4 +94,5 @@ Labels in a group can also be stacked vertically. This example shows a verical l
|
|
|
79
94
|
The contents of a label group can be modified by removing labels or adding new ones using the add button. For additional documentation that showcases adding a new label, see [label demos](/components/label/react-demos).
|
|
80
95
|
|
|
81
96
|
```ts isBeta file="LabelGroupEditableAdd.tsx"
|
|
97
|
+
|
|
82
98
|
```
|
|
@@ -4,24 +4,54 @@ import InfoCircleIcon from '@patternfly/react-icons/dist/esm/icons/info-circle-i
|
|
|
4
4
|
|
|
5
5
|
export const LabelCompact: React.FunctionComponent = () => (
|
|
6
6
|
<React.Fragment>
|
|
7
|
-
<Label isCompact>
|
|
7
|
+
<Label isCompact>Compact</Label>
|
|
8
8
|
<Label isCompact icon={<InfoCircleIcon />}>
|
|
9
9
|
Compact icon
|
|
10
|
-
</Label>
|
|
10
|
+
</Label>
|
|
11
11
|
<Label isCompact onClose={() => Function.prototype}>
|
|
12
12
|
Compact removable
|
|
13
|
-
</Label>
|
|
13
|
+
</Label>
|
|
14
14
|
<Label isCompact icon={<InfoCircleIcon />} onClose={() => Function.prototype}>
|
|
15
15
|
Compact icon removable
|
|
16
|
-
</Label>
|
|
16
|
+
</Label>
|
|
17
17
|
<Label isCompact href="#compact">
|
|
18
18
|
Compact link
|
|
19
|
-
</Label>
|
|
19
|
+
</Label>
|
|
20
20
|
<Label isCompact href="#compact" onClose={() => Function.prototype}>
|
|
21
21
|
Compact link removable
|
|
22
22
|
</Label>
|
|
23
23
|
<Label isCompact icon={<InfoCircleIcon />} onClose={() => Function.prototype} textMaxWidth="16ch">
|
|
24
24
|
Compact label with icon that overflows
|
|
25
25
|
</Label>
|
|
26
|
+
<br />
|
|
27
|
+
<br />
|
|
28
|
+
<Label variant="outline" color="blue" isCompact>
|
|
29
|
+
Compact
|
|
30
|
+
</Label>
|
|
31
|
+
<Label variant="outline" color="blue" isCompact icon={<InfoCircleIcon />}>
|
|
32
|
+
Compact icon
|
|
33
|
+
</Label>
|
|
34
|
+
<Label variant="outline" color="blue" isCompact onClose={() => Function.prototype}>
|
|
35
|
+
Compact removable
|
|
36
|
+
</Label>
|
|
37
|
+
<Label variant="outline" color="blue" isCompact icon={<InfoCircleIcon />} onClose={() => Function.prototype}>
|
|
38
|
+
Compact icon removable
|
|
39
|
+
</Label>
|
|
40
|
+
<Label variant="outline" color="blue" isCompact href="#compact">
|
|
41
|
+
Compact link
|
|
42
|
+
</Label>
|
|
43
|
+
<Label variant="outline" color="blue" isCompact href="#compact" onClose={() => Function.prototype}>
|
|
44
|
+
Compact link removable
|
|
45
|
+
</Label>
|
|
46
|
+
<Label
|
|
47
|
+
variant="outline"
|
|
48
|
+
color="blue"
|
|
49
|
+
isCompact
|
|
50
|
+
icon={<InfoCircleIcon />}
|
|
51
|
+
onClose={() => Function.prototype}
|
|
52
|
+
textMaxWidth="16ch"
|
|
53
|
+
>
|
|
54
|
+
Compact label with icon that overflows
|
|
55
|
+
</Label>
|
|
26
56
|
</React.Fragment>
|
|
27
57
|
);
|