@patternfly/react-core 6.0.0-alpha.13 → 6.0.0-alpha.15
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 +13 -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/package.json +1 -1
- package/dist/esm/components/Avatar/Avatar.d.ts +5 -3
- package/dist/esm/components/Avatar/Avatar.d.ts.map +1 -1
- package/dist/esm/components/Avatar/Avatar.js +2 -2
- package/dist/esm/components/Avatar/Avatar.js.map +1 -1
- package/dist/esm/components/EmptyState/EmptyState.d.ts +20 -1
- package/dist/esm/components/EmptyState/EmptyState.d.ts.map +1 -1
- package/dist/esm/components/EmptyState/EmptyState.js +17 -3
- package/dist/esm/components/EmptyState/EmptyState.js.map +1 -1
- package/dist/esm/components/EmptyState/EmptyStateHeader.d.ts +11 -6
- package/dist/esm/components/EmptyState/EmptyStateHeader.d.ts.map +1 -1
- package/dist/esm/components/EmptyState/EmptyStateHeader.js +14 -5
- package/dist/esm/components/EmptyState/EmptyStateHeader.js.map +1 -1
- package/dist/esm/components/EmptyState/EmptyStateIcon.d.ts +1 -5
- package/dist/esm/components/EmptyState/EmptyStateIcon.d.ts.map +1 -1
- package/dist/esm/components/EmptyState/EmptyStateIcon.js +2 -3
- package/dist/esm/components/EmptyState/EmptyStateIcon.js.map +1 -1
- package/dist/esm/components/Pagination/PaginationOptionsMenu.d.ts.map +1 -1
- package/dist/esm/components/Pagination/PaginationOptionsMenu.js +2 -1
- package/dist/esm/components/Pagination/PaginationOptionsMenu.js.map +1 -1
- package/dist/esm/helpers/constants.d.ts +8 -0
- package/dist/esm/helpers/constants.d.ts.map +1 -1
- package/dist/esm/helpers/constants.js +12 -0
- package/dist/esm/helpers/constants.js.map +1 -1
- package/dist/js/components/Avatar/Avatar.d.ts +5 -3
- package/dist/js/components/Avatar/Avatar.d.ts.map +1 -1
- package/dist/js/components/Avatar/Avatar.js +2 -2
- package/dist/js/components/Avatar/Avatar.js.map +1 -1
- package/dist/js/components/EmptyState/EmptyState.d.ts +20 -1
- package/dist/js/components/EmptyState/EmptyState.d.ts.map +1 -1
- package/dist/js/components/EmptyState/EmptyState.js +18 -4
- package/dist/js/components/EmptyState/EmptyState.js.map +1 -1
- package/dist/js/components/EmptyState/EmptyStateHeader.d.ts +11 -6
- package/dist/js/components/EmptyState/EmptyStateHeader.d.ts.map +1 -1
- package/dist/js/components/EmptyState/EmptyStateHeader.js +15 -6
- package/dist/js/components/EmptyState/EmptyStateHeader.js.map +1 -1
- package/dist/js/components/EmptyState/EmptyStateIcon.d.ts +1 -5
- package/dist/js/components/EmptyState/EmptyStateIcon.d.ts.map +1 -1
- package/dist/js/components/EmptyState/EmptyStateIcon.js +2 -3
- package/dist/js/components/EmptyState/EmptyStateIcon.js.map +1 -1
- package/dist/js/components/Pagination/PaginationOptionsMenu.d.ts.map +1 -1
- package/dist/js/components/Pagination/PaginationOptionsMenu.js +2 -1
- package/dist/js/components/Pagination/PaginationOptionsMenu.js.map +1 -1
- package/dist/js/helpers/constants.d.ts +8 -0
- package/dist/js/helpers/constants.d.ts.map +1 -1
- package/dist/js/helpers/constants.js +13 -1
- package/dist/js/helpers/constants.js.map +1 -1
- package/dist/umd/react-core.min.js +3 -3
- 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/Avatar/Avatar.tsx +13 -5
- package/src/components/Avatar/__tests__/Avatar.test.tsx +4 -12
- package/src/components/Avatar/examples/Avatar.md +5 -50
- package/src/components/Avatar/examples/AvatarBasic.tsx +5 -0
- package/src/components/Avatar/examples/AvatarBordered.tsx +5 -0
- package/src/components/Avatar/examples/AvatarSizeVariations.tsx +21 -0
- package/src/components/DualListSelector/examples/DualListSelectorComposable.tsx +1 -4
- package/src/components/DualListSelector/examples/DualListSelectorComposableTree.tsx +2 -9
- package/src/components/EmptyState/EmptyState.tsx +57 -17
- package/src/components/EmptyState/EmptyStateHeader.tsx +20 -18
- package/src/components/EmptyState/EmptyStateIcon.tsx +3 -13
- package/src/components/EmptyState/__tests__/EmptyState.test.tsx +6 -21
- package/src/components/EmptyState/__tests__/Generated/EmptyStateIcon.test.tsx +0 -4
- package/src/components/EmptyState/__tests__/Generated/__snapshots__/EmptyStateIcon.test.tsx.snap +0 -8
- package/src/components/EmptyState/__tests__/__snapshots__/EmptyState.test.tsx.snap +9 -0
- package/src/components/EmptyState/examples/EmptyState.md +6 -8
- package/src/components/EmptyState/examples/EmptyStateBasic.tsx +2 -11
- package/src/components/EmptyState/examples/EmptyStateExtraLarge.tsx +2 -5
- package/src/components/EmptyState/examples/EmptyStateExtraSmall.tsx +3 -7
- package/src/components/EmptyState/examples/EmptyStateLarge.tsx +2 -5
- package/src/components/EmptyState/examples/EmptyStateNoMatchFound.tsx +2 -11
- package/src/components/EmptyState/examples/EmptyStateSmall.tsx +2 -5
- package/src/components/EmptyState/examples/EmptyStateSpinner.tsx +2 -4
- package/src/components/EmptyState/examples/EmptyStateWithStatus.tsx +61 -0
- package/src/components/NotificationDrawer/examples/NotificationDrawerGroups.tsx +6 -8
- package/src/components/NotificationDrawer/examples/NotificationDrawerLightweight.tsx +7 -9
- package/src/components/Pagination/PaginationOptionsMenu.tsx +2 -1
- package/src/components/Pagination/__tests__/Generated/__snapshots__/PaginationOptionsMenu.test.tsx.snap +3 -1
- package/src/components/Pagination/__tests__/Pagination.test.tsx +0 -5
- package/src/components/Pagination/__tests__/PaginationOptionsMenu.test.tsx +23 -0
- package/src/components/Pagination/__tests__/__snapshots__/Pagination.test.tsx.snap +96 -56
- package/src/components/Wizard/examples/WizardValidateOnButtonPress.tsx +6 -8
- package/src/components/Wizard/examples/WizardWithSubmitProgress.tsx +6 -8
- package/src/demos/CardView/examples/CardView.tsx +6 -8
- package/src/demos/Filters/examples/FilterAttributeSearch.tsx +2 -5
- package/src/demos/Filters/examples/FilterFaceted.tsx +1 -4
- package/src/demos/Filters/examples/FilterMixedSelectGroup.tsx +1 -4
- package/src/demos/Filters/examples/FilterSameSelectGroup.tsx +1 -4
- package/src/demos/Filters/examples/FilterSearchInput.tsx +1 -4
- package/src/demos/NotificationDrawer/examples/NotificationDrawerBasic.tsx +1 -8
- package/src/demos/NotificationDrawer/examples/NotificationDrawerGrouped.tsx +7 -14
- package/src/demos/examples/AlertGroup/AlertGroupToastWithNotificationDrawer.tsx +6 -8
- package/src/deprecated/components/Wizard/examples/WizardFinished.tsx +6 -8
- package/src/deprecated/components/Wizard/examples/WizardValidateOnButtonPress.tsx +7 -9
- package/src/helpers/constants.ts +14 -0
- package/src/components/Avatar/examples/example.css +0 -3
- package/src/components/EmptyState/examples/EmptyStateCustomIconColor.tsx +0 -19
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.14","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.14","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.14","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.15",
|
|
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",
|
|
@@ -72,5 +72,5 @@
|
|
|
72
72
|
"react": "^17 || ^18",
|
|
73
73
|
"react-dom": "^17 || ^18"
|
|
74
74
|
},
|
|
75
|
-
"gitHead": "
|
|
75
|
+
"gitHead": "74a4f022d0cfc230145b0d6d7a3a11c65488353c"
|
|
76
76
|
}
|
|
@@ -4,23 +4,31 @@ import { css } from '@patternfly/react-styles';
|
|
|
4
4
|
|
|
5
5
|
export interface AvatarProps
|
|
6
6
|
extends React.DetailedHTMLProps<React.ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement> {
|
|
7
|
-
/** Additional classes added to the
|
|
7
|
+
/** Additional classes added to the avatar. */
|
|
8
8
|
className?: string;
|
|
9
|
-
/** Attribute that specifies the URL of the image for the
|
|
9
|
+
/** Attribute that specifies the URL of the image for the avatar. */
|
|
10
10
|
src?: string;
|
|
11
|
-
/** Attribute that specifies the alternate text of the image for the
|
|
11
|
+
/** Attribute that specifies the alternate text of the image for the avatar. */
|
|
12
12
|
alt: string;
|
|
13
|
+
/** Flag to indicate the avatar should have a border. */
|
|
14
|
+
isBordered?: boolean;
|
|
13
15
|
/** Size variant of avatar. */
|
|
14
16
|
size?: 'sm' | 'md' | 'lg' | 'xl';
|
|
15
17
|
}
|
|
16
18
|
|
|
17
19
|
export const Avatar: React.FunctionComponent<AvatarProps> = ({
|
|
18
|
-
className
|
|
20
|
+
className,
|
|
19
21
|
src = '',
|
|
20
22
|
alt,
|
|
23
|
+
isBordered,
|
|
21
24
|
size,
|
|
22
25
|
...props
|
|
23
26
|
}: AvatarProps) => (
|
|
24
|
-
<img
|
|
27
|
+
<img
|
|
28
|
+
src={src}
|
|
29
|
+
alt={alt}
|
|
30
|
+
className={css(styles.avatar, styles.modifiers[size], isBordered && styles.modifiers.bordered, className)}
|
|
31
|
+
{...props}
|
|
32
|
+
/>
|
|
25
33
|
);
|
|
26
34
|
Avatar.displayName = 'Avatar';
|
|
@@ -12,22 +12,14 @@ test('Renders simple avatar', () => {
|
|
|
12
12
|
expect(screen.getByTestId('avatar').firstChild).toBeVisible();
|
|
13
13
|
});
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
test('Renders without any modifier class when border and size props are not passed', () => {
|
|
15
|
+
test('Renders without any modifier class when isBordered and size props are not passed', () => {
|
|
17
16
|
render(<Avatar alt="avatar" />);
|
|
18
17
|
expect(screen.getByRole('img')).toHaveClass(styles.avatar, { exact: true });
|
|
19
18
|
});
|
|
20
19
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
expect(screen.getByRole('img')).toHaveClass('pf-m-light');
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
// TODO: Need to be updated/removed as part of issue #9880
|
|
28
|
-
xtest('Renders with class name pf-m-dark when "dark" is passed as border prop', () => {
|
|
29
|
-
render(<Avatar alt="avatar" />);
|
|
30
|
-
expect(screen.getByRole('img')).toHaveClass('pf-m-dark');
|
|
20
|
+
test('Renders with class name pf-m-bordered when isBordered is passed', () => {
|
|
21
|
+
render(<Avatar alt="avatar" isBordered />);
|
|
22
|
+
expect(screen.getByRole('img')).toHaveClass('pf-m-bordered');
|
|
31
23
|
});
|
|
32
24
|
|
|
33
25
|
test('Renders with class name pf-m-xl when "xl" is passed as size prop', () => {
|
|
@@ -6,65 +6,20 @@ propComponents: ['Avatar']
|
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
import avatarImg from '../../assets/avatarImg.svg';
|
|
9
|
-
import avatarImgDark from '../../assets/avatarImgDark.svg';
|
|
10
|
-
import './example.css';
|
|
11
9
|
|
|
12
10
|
## Examples
|
|
13
11
|
|
|
14
12
|
### Basic
|
|
15
13
|
|
|
16
|
-
```ts
|
|
17
|
-
import React from 'react';
|
|
18
|
-
import { Avatar } from '@patternfly/react-core';
|
|
19
|
-
import avatarImg from '../../assets/avatarImg.svg';
|
|
20
|
-
|
|
21
|
-
<Avatar src={avatarImg} alt="avatar" />;
|
|
22
|
-
```
|
|
23
|
-
|
|
24
|
-
### Size variations
|
|
25
|
-
|
|
26
|
-
```ts
|
|
27
|
-
import React from 'react';
|
|
28
|
-
import { Avatar } from '@patternfly/react-core';
|
|
29
|
-
import avatarImg from '../../assets/avatarImg.svg';
|
|
30
|
-
|
|
31
|
-
<React.Fragment>
|
|
32
|
-
Small
|
|
33
|
-
<br />
|
|
34
|
-
<Avatar src={avatarImg} alt="avatar" size="sm" />
|
|
35
|
-
<br />
|
|
36
|
-
Medium
|
|
37
|
-
<br />
|
|
38
|
-
<Avatar src={avatarImg} alt="avatar" size="md" />
|
|
39
|
-
<br />
|
|
40
|
-
Large
|
|
41
|
-
<br />
|
|
42
|
-
<Avatar src={avatarImg} alt="avatar" size="lg" />
|
|
43
|
-
<br />
|
|
44
|
-
Extra Large
|
|
45
|
-
<br />
|
|
46
|
-
<Avatar src={avatarImg} alt="avatar" size="xl" />
|
|
47
|
-
</React.Fragment>;
|
|
14
|
+
```ts file="./AvatarBasic.tsx"
|
|
48
15
|
```
|
|
49
16
|
|
|
50
|
-
### Bordered
|
|
51
|
-
|
|
52
|
-
```ts
|
|
53
|
-
import React from 'react';
|
|
54
|
-
import { Avatar } from '@patternfly/react-core';
|
|
55
|
-
import avatarImg from '../../assets/avatarImg.svg';
|
|
17
|
+
### Bordered
|
|
56
18
|
|
|
57
|
-
|
|
58
|
-
<Avatar src={avatarImg} alt="avatar" />;
|
|
19
|
+
```ts file="./AvatarBordered.tsx"
|
|
59
20
|
```
|
|
60
21
|
|
|
61
|
-
###
|
|
62
|
-
|
|
63
|
-
```ts
|
|
64
|
-
import React from 'react';
|
|
65
|
-
import { Avatar } from '@patternfly/react-core';
|
|
66
|
-
import avatarImgDark from '../../assets/avatarImgDark.svg';
|
|
22
|
+
### Size variations
|
|
67
23
|
|
|
68
|
-
|
|
69
|
-
<Avatar src={avatarImgDark} alt="avatar" />;
|
|
24
|
+
```ts file="./AvatarSizeVariations.tsx"
|
|
70
25
|
```
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Avatar } from '@patternfly/react-core';
|
|
3
|
+
import avatarImg from '../../assets/avatarImg.svg';
|
|
4
|
+
|
|
5
|
+
<React.Fragment>
|
|
6
|
+
Small
|
|
7
|
+
<br />
|
|
8
|
+
<Avatar src={avatarImg} alt="avatar" size="sm" />
|
|
9
|
+
<br />
|
|
10
|
+
Medium
|
|
11
|
+
<br />
|
|
12
|
+
<Avatar src={avatarImg} alt="avatar" size="md" />
|
|
13
|
+
<br />
|
|
14
|
+
Large
|
|
15
|
+
<br />
|
|
16
|
+
<Avatar src={avatarImg} alt="avatar" size="lg" />
|
|
17
|
+
<br />
|
|
18
|
+
Extra Large
|
|
19
|
+
<br />
|
|
20
|
+
<Avatar src={avatarImg} alt="avatar" size="xl" />
|
|
21
|
+
</React.Fragment>;
|
|
@@ -11,10 +11,8 @@ import {
|
|
|
11
11
|
SearchInput,
|
|
12
12
|
EmptyState,
|
|
13
13
|
EmptyStateVariant,
|
|
14
|
-
EmptyStateHeader,
|
|
15
14
|
EmptyStateFooter,
|
|
16
15
|
EmptyStateBody,
|
|
17
|
-
EmptyStateIcon,
|
|
18
16
|
EmptyStateActions
|
|
19
17
|
} from '@patternfly/react-core';
|
|
20
18
|
import AngleDoubleLeftIcon from '@patternfly/react-icons/dist/esm/icons/angle-double-left-icon';
|
|
@@ -139,8 +137,7 @@ export const DualListSelectorComposable: React.FunctionComponent = () => {
|
|
|
139
137
|
};
|
|
140
138
|
|
|
141
139
|
const buildEmptyState = (isAvailable: boolean) => (
|
|
142
|
-
<EmptyState variant={EmptyStateVariant.sm}>
|
|
143
|
-
<EmptyStateHeader headingLevel="h4" titleText="No results found" icon={<EmptyStateIcon icon={SearchIcon} />} />
|
|
140
|
+
<EmptyState headingLevel="h4" titleText="No results found" icon={SearchIcon} variant={EmptyStateVariant.sm}>
|
|
144
141
|
<EmptyStateBody>No results match the filter criteria. Clear all filters and try again.</EmptyStateBody>
|
|
145
142
|
<EmptyStateFooter>
|
|
146
143
|
<EmptyStateActions>
|
|
@@ -11,11 +11,9 @@ import {
|
|
|
11
11
|
Button,
|
|
12
12
|
EmptyState,
|
|
13
13
|
EmptyStateVariant,
|
|
14
|
-
EmptyStateHeader,
|
|
15
14
|
EmptyStateFooter,
|
|
16
15
|
EmptyStateBody,
|
|
17
|
-
EmptyStateActions
|
|
18
|
-
EmptyStateIcon
|
|
16
|
+
EmptyStateActions
|
|
19
17
|
} from '@patternfly/react-core';
|
|
20
18
|
import AngleDoubleLeftIcon from '@patternfly/react-icons/dist/esm/icons/angle-double-left-icon';
|
|
21
19
|
import AngleLeftIcon from '@patternfly/react-icons/dist/esm/icons/angle-left-icon';
|
|
@@ -258,12 +256,7 @@ export const DualListSelectorComposableTree: React.FunctionComponent<ExampleProp
|
|
|
258
256
|
listMinHeight="300px"
|
|
259
257
|
>
|
|
260
258
|
{filterApplied && options.length === 0 && (
|
|
261
|
-
<EmptyState variant={EmptyStateVariant.sm}>
|
|
262
|
-
<EmptyStateHeader
|
|
263
|
-
headingLevel="h4"
|
|
264
|
-
titleText="No results found"
|
|
265
|
-
icon={<EmptyStateIcon icon={SearchIcon} />}
|
|
266
|
-
/>
|
|
259
|
+
<EmptyState headingLevel="h4" titleText="No results found" icon={SearchIcon} variant={EmptyStateVariant.sm}>
|
|
267
260
|
<EmptyStateBody>No results match the filter criteria. Clear all filters and try again.</EmptyStateBody>
|
|
268
261
|
<EmptyStateFooter>
|
|
269
262
|
<EmptyStateActions>
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { css } from '@patternfly/react-styles';
|
|
3
3
|
import styles from '@patternfly/react-styles/css/components/EmptyState/empty-state';
|
|
4
|
+
import { EmptyStateHeader } from './EmptyStateHeader';
|
|
5
|
+
import { statusIcons } from '../../helpers';
|
|
4
6
|
|
|
5
7
|
export enum EmptyStateVariant {
|
|
6
8
|
'xs' = 'xs',
|
|
@@ -10,15 +12,35 @@ export enum EmptyStateVariant {
|
|
|
10
12
|
full = 'full'
|
|
11
13
|
}
|
|
12
14
|
|
|
15
|
+
export enum EmptyStateStatus {
|
|
16
|
+
danger = 'danger',
|
|
17
|
+
warning = 'warning',
|
|
18
|
+
success = 'success',
|
|
19
|
+
info = 'info',
|
|
20
|
+
custom = 'custom'
|
|
21
|
+
}
|
|
22
|
+
|
|
13
23
|
export interface EmptyStateProps extends React.HTMLProps<HTMLDivElement> {
|
|
14
24
|
/** Additional classes added to the empty state */
|
|
15
25
|
className?: string;
|
|
16
26
|
/** Content rendered inside the empty state */
|
|
17
|
-
children
|
|
27
|
+
children?: React.ReactNode;
|
|
18
28
|
/** Modifies empty state max-width and sizes of icon, title and body */
|
|
19
29
|
variant?: 'xs' | 'sm' | 'lg' | 'xl' | 'full';
|
|
20
30
|
/** Cause component to consume the available height of its container */
|
|
21
31
|
isFullHeight?: boolean;
|
|
32
|
+
/** Status of the empty state, will set a default status icon and color. Icon can be overwritten using the icon prop */
|
|
33
|
+
status?: 'danger' | 'warning' | 'success' | 'info' | 'custom';
|
|
34
|
+
/** Additional class names to apply to the empty state header */
|
|
35
|
+
headerClassName?: string;
|
|
36
|
+
/** Additional classes added to the title inside empty state header */
|
|
37
|
+
titleClassName?: string;
|
|
38
|
+
/** Text of the title inside empty state header, will be wrapped in headingLevel */
|
|
39
|
+
titleText: React.ReactNode;
|
|
40
|
+
/** Empty state icon element to be rendered. Can also be a spinner component */
|
|
41
|
+
icon?: React.ComponentType<any>;
|
|
42
|
+
/** The heading level to use, default is h1 */
|
|
43
|
+
headingLevel?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
|
|
22
44
|
}
|
|
23
45
|
|
|
24
46
|
export const EmptyState: React.FunctionComponent<EmptyStateProps> = ({
|
|
@@ -26,21 +48,39 @@ export const EmptyState: React.FunctionComponent<EmptyStateProps> = ({
|
|
|
26
48
|
className,
|
|
27
49
|
variant = EmptyStateVariant.full,
|
|
28
50
|
isFullHeight,
|
|
51
|
+
status,
|
|
52
|
+
icon: customIcon,
|
|
53
|
+
titleText,
|
|
54
|
+
titleClassName,
|
|
55
|
+
headerClassName,
|
|
56
|
+
headingLevel,
|
|
29
57
|
...props
|
|
30
|
-
}: EmptyStateProps) =>
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
)
|
|
58
|
+
}: EmptyStateProps) => {
|
|
59
|
+
const statusIcon = status && statusIcons[status];
|
|
60
|
+
const icon = customIcon || statusIcon;
|
|
61
|
+
|
|
62
|
+
return (
|
|
63
|
+
<div
|
|
64
|
+
className={css(
|
|
65
|
+
styles.emptyState,
|
|
66
|
+
variant !== 'full' && styles.modifiers[variant],
|
|
67
|
+
isFullHeight && styles.modifiers.fullHeight,
|
|
68
|
+
status && styles.modifiers[status],
|
|
69
|
+
className
|
|
70
|
+
)}
|
|
71
|
+
{...props}
|
|
72
|
+
>
|
|
73
|
+
<div className={css(styles.emptyStateContent)}>
|
|
74
|
+
<EmptyStateHeader
|
|
75
|
+
icon={icon}
|
|
76
|
+
titleText={titleText}
|
|
77
|
+
titleClassName={titleClassName}
|
|
78
|
+
className={headerClassName}
|
|
79
|
+
headingLevel={headingLevel}
|
|
80
|
+
/>
|
|
81
|
+
{children}
|
|
82
|
+
</div>
|
|
83
|
+
</div>
|
|
84
|
+
);
|
|
85
|
+
};
|
|
46
86
|
EmptyState.displayName = 'EmptyState';
|
|
@@ -1,42 +1,44 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { css } from '@patternfly/react-styles';
|
|
3
3
|
import styles from '@patternfly/react-styles/css/components/EmptyState/empty-state';
|
|
4
|
-
import {
|
|
4
|
+
import { EmptyStateIcon } from './EmptyStateIcon';
|
|
5
|
+
|
|
6
|
+
export enum EmptyStateHeadingLevel {
|
|
7
|
+
h1 = 'h1',
|
|
8
|
+
h2 = 'h2',
|
|
9
|
+
h3 = 'h3',
|
|
10
|
+
h4 = 'h4',
|
|
11
|
+
h5 = 'h5',
|
|
12
|
+
h6 = 'h6'
|
|
13
|
+
}
|
|
5
14
|
|
|
6
15
|
export interface EmptyStateHeaderProps extends React.HTMLProps<HTMLDivElement> {
|
|
7
|
-
/** Content rendered inside the empty state header, either in addition to or instead of the titleText prop */
|
|
8
|
-
children?: React.ReactNode;
|
|
9
16
|
/** Additional classes added to the empty state header */
|
|
10
17
|
className?: string;
|
|
11
18
|
/** Additional classes added to the title inside empty state header */
|
|
12
19
|
titleClassName?: string;
|
|
13
20
|
/** Text of the title inside empty state header, will be wrapped in headingLevel */
|
|
14
|
-
titleText
|
|
15
|
-
/** Empty state icon element to be rendered */
|
|
16
|
-
icon?: React.
|
|
21
|
+
titleText: React.ReactNode;
|
|
22
|
+
/** Empty state icon element to be rendered. Can also be a spinner component */
|
|
23
|
+
icon?: React.ComponentType<any>;
|
|
17
24
|
/** The heading level to use, default is h1 */
|
|
18
25
|
headingLevel?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
|
|
19
26
|
}
|
|
20
27
|
|
|
21
28
|
export const EmptyStateHeader: React.FunctionComponent<EmptyStateHeaderProps> = ({
|
|
22
|
-
children,
|
|
23
29
|
className,
|
|
24
30
|
titleClassName,
|
|
25
31
|
titleText,
|
|
26
|
-
headingLevel: HeadingLevel =
|
|
27
|
-
icon,
|
|
32
|
+
headingLevel: HeadingLevel = EmptyStateHeadingLevel.h1,
|
|
33
|
+
icon: Icon,
|
|
28
34
|
...props
|
|
29
35
|
}: EmptyStateHeaderProps) => (
|
|
30
36
|
<div className={css(`${styles.emptyState}__header`, className)} {...props}>
|
|
31
|
-
{icon}
|
|
32
|
-
{(
|
|
33
|
-
<
|
|
34
|
-
|
|
35
|
-
<HeadingLevel className={css(styles.emptyStateTitleText, titleClassName)}>{titleText}</HeadingLevel>
|
|
36
|
-
)}
|
|
37
|
-
{children}
|
|
38
|
-
</div>
|
|
39
|
-
)}
|
|
37
|
+
{Icon && <EmptyStateIcon icon={Icon} />}
|
|
38
|
+
<div className={css(`${styles.emptyState}__title`)}>
|
|
39
|
+
<HeadingLevel className={css(styles.emptyStateTitleText, titleClassName)}>{titleText}</HeadingLevel>
|
|
40
|
+
</div>
|
|
40
41
|
</div>
|
|
41
42
|
);
|
|
43
|
+
|
|
42
44
|
EmptyStateHeader.displayName = 'EmptyStateHeader';
|
|
@@ -2,14 +2,7 @@ import * as React from 'react';
|
|
|
2
2
|
import { css } from '@patternfly/react-styles';
|
|
3
3
|
import styles from '@patternfly/react-styles/css/components/EmptyState/empty-state';
|
|
4
4
|
import { Spinner } from '../Spinner';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export interface IconProps extends Omit<React.HTMLProps<SVGElement>, 'size'> {
|
|
8
|
-
/** Changes the color of the icon. */
|
|
9
|
-
color?: string;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export interface EmptyStateIconProps extends IconProps {
|
|
5
|
+
export interface EmptyStateIconProps {
|
|
13
6
|
/** Additional classes added to the empty state icon */
|
|
14
7
|
className?: string;
|
|
15
8
|
/** Icon component to be rendered. Can also be a spinner component */
|
|
@@ -21,15 +14,12 @@ const isSpinner = (icon: React.ReactElement<any>) => icon.type === Spinner;
|
|
|
21
14
|
export const EmptyStateIcon: React.FunctionComponent<EmptyStateIconProps> = ({
|
|
22
15
|
className,
|
|
23
16
|
icon: IconComponent,
|
|
24
|
-
color,
|
|
25
17
|
...props
|
|
26
18
|
}: EmptyStateIconProps) => {
|
|
27
19
|
const iconIsSpinner = isSpinner(<IconComponent />);
|
|
20
|
+
|
|
28
21
|
return (
|
|
29
|
-
<div
|
|
30
|
-
className={css(styles.emptyStateIcon)}
|
|
31
|
-
{...(color && !iconIsSpinner && { style: { [cssIconColor.name]: color } as React.CSSProperties })}
|
|
32
|
-
>
|
|
22
|
+
<div className={css(styles.emptyStateIcon)}>
|
|
33
23
|
<IconComponent className={className} aria-hidden={!iconIsSpinner} {...props} />
|
|
34
24
|
</div>
|
|
35
25
|
);
|
|
@@ -10,14 +10,12 @@ import { EmptyStateActions } from '../EmptyStateActions';
|
|
|
10
10
|
import { Button } from '../../Button';
|
|
11
11
|
import { EmptyStateHeader } from '../EmptyStateHeader';
|
|
12
12
|
import { EmptyStateFooter } from '../EmptyStateFooter';
|
|
13
|
-
import { EmptyStateIcon } from '../../../../dist/esm';
|
|
14
13
|
import styles from '@patternfly/react-styles/css/components/EmptyState/empty-state';
|
|
15
14
|
|
|
16
15
|
describe('EmptyState', () => {
|
|
17
16
|
test('Main', () => {
|
|
18
17
|
const { asFragment } = render(
|
|
19
|
-
<EmptyState>
|
|
20
|
-
<EmptyStateHeader titleText="HTTP Proxies" />
|
|
18
|
+
<EmptyState titleText="HTTP Proxies">
|
|
21
19
|
<EmptyStateBody>
|
|
22
20
|
Defining HTTP Proxies that exist on your network allows you to perform various actions through those proxies.
|
|
23
21
|
</EmptyStateBody>
|
|
@@ -38,27 +36,21 @@ describe('EmptyState', () => {
|
|
|
38
36
|
|
|
39
37
|
test('Main variant large', () => {
|
|
40
38
|
const { asFragment } = render(
|
|
41
|
-
<EmptyState variant={EmptyStateVariant.lg}>
|
|
42
|
-
<EmptyStateHeader titleText="EmptyState large" />
|
|
43
|
-
</EmptyState>
|
|
39
|
+
<EmptyState titleText="EmptyState large" variant={EmptyStateVariant.lg}></EmptyState>
|
|
44
40
|
);
|
|
45
41
|
expect(asFragment()).toMatchSnapshot();
|
|
46
42
|
});
|
|
47
43
|
|
|
48
44
|
test('Main variant small', () => {
|
|
49
45
|
const { asFragment } = render(
|
|
50
|
-
<EmptyState variant={EmptyStateVariant.sm}>
|
|
51
|
-
<EmptyStateHeader titleText="EmptyState small" />
|
|
52
|
-
</EmptyState>
|
|
46
|
+
<EmptyState titleText="EmptyState small" variant={EmptyStateVariant.sm}></EmptyState>
|
|
53
47
|
);
|
|
54
48
|
expect(asFragment()).toMatchSnapshot();
|
|
55
49
|
});
|
|
56
50
|
|
|
57
51
|
test('Main variant xs', () => {
|
|
58
52
|
const { asFragment } = render(
|
|
59
|
-
<EmptyState variant={EmptyStateVariant.xs}>
|
|
60
|
-
<EmptyStateHeader titleText="EmptyState extra small" />
|
|
61
|
-
</EmptyState>
|
|
53
|
+
<EmptyState titleText="EmptyState extra small" variant={EmptyStateVariant.xs}></EmptyState>
|
|
62
54
|
);
|
|
63
55
|
expect(asFragment()).toMatchSnapshot();
|
|
64
56
|
});
|
|
@@ -75,15 +67,13 @@ describe('EmptyState', () => {
|
|
|
75
67
|
|
|
76
68
|
test('Full height', () => {
|
|
77
69
|
const { asFragment } = render(
|
|
78
|
-
<EmptyState isFullHeight variant={EmptyStateVariant.lg}>
|
|
79
|
-
<EmptyStateHeader titleText="EmptyState large" />
|
|
80
|
-
</EmptyState>
|
|
70
|
+
<EmptyState titleText="EmptyState large" isFullHeight variant={EmptyStateVariant.lg}></EmptyState>
|
|
81
71
|
);
|
|
82
72
|
expect(asFragment()).toMatchSnapshot();
|
|
83
73
|
});
|
|
84
74
|
|
|
85
75
|
test('Header with icon', () => {
|
|
86
|
-
const { asFragment } = render(<EmptyStateHeader
|
|
76
|
+
const { asFragment } = render(<EmptyStateHeader titleText="Empty state" icon={AddressBookIcon} />);
|
|
87
77
|
expect(asFragment()).toMatchSnapshot();
|
|
88
78
|
});
|
|
89
79
|
|
|
@@ -102,11 +92,6 @@ describe('EmptyState', () => {
|
|
|
102
92
|
expect(screen.getByRole('heading', { level: 3, name: 'Empty state' })).toHaveClass(styles.emptyStateTitleText);
|
|
103
93
|
});
|
|
104
94
|
|
|
105
|
-
test('Headers render children', () => {
|
|
106
|
-
render(<EmptyStateHeader>Title text</EmptyStateHeader>);
|
|
107
|
-
expect(screen.getByText('Title text')).toBeVisible();
|
|
108
|
-
});
|
|
109
|
-
|
|
110
95
|
test('Footer', () => {
|
|
111
96
|
render(<EmptyStateFooter className="custom-empty-state-footer" data-testid="actions-test-id" />);
|
|
112
97
|
expect(screen.getByTestId('actions-test-id')).toHaveClass('custom-empty-state-footer');
|
|
@@ -11,8 +11,6 @@ import { Spinner } from '../../../Spinner/Spinner';
|
|
|
11
11
|
it('EmptyStateIcon should match snapshot (auto-generated)', () => {
|
|
12
12
|
const { asFragment } = render(
|
|
13
13
|
<EmptyStateIcon
|
|
14
|
-
color={'string'}
|
|
15
|
-
title={'string'}
|
|
16
14
|
className={"''"}
|
|
17
15
|
icon={UserIcon}
|
|
18
16
|
/>
|
|
@@ -23,8 +21,6 @@ it('EmptyStateIcon should match snapshot (auto-generated)', () => {
|
|
|
23
21
|
it('EmptyStateIcon should match snapshot for variant container', () => {
|
|
24
22
|
const { asFragment } = render(
|
|
25
23
|
<EmptyStateIcon
|
|
26
|
-
color={'string'}
|
|
27
|
-
title={'string'}
|
|
28
24
|
className={"''"}
|
|
29
25
|
icon={Spinner}
|
|
30
26
|
/>
|
package/src/components/EmptyState/__tests__/Generated/__snapshots__/EmptyStateIcon.test.tsx.snap
CHANGED
|
@@ -4,11 +4,9 @@ exports[`EmptyStateIcon should match snapshot (auto-generated) 1`] = `
|
|
|
4
4
|
<DocumentFragment>
|
|
5
5
|
<div
|
|
6
6
|
class="pf-v5-c-empty-state__icon"
|
|
7
|
-
style="--pf-v5-c-empty-state__icon--Color: string;"
|
|
8
7
|
>
|
|
9
8
|
<svg
|
|
10
9
|
aria-hidden="true"
|
|
11
|
-
aria-labelledby="icon-title-0"
|
|
12
10
|
class="pf-v5-svg ''"
|
|
13
11
|
fill="currentColor"
|
|
14
12
|
height="1em"
|
|
@@ -16,11 +14,6 @@ exports[`EmptyStateIcon should match snapshot (auto-generated) 1`] = `
|
|
|
16
14
|
viewBox="0 0 448 512"
|
|
17
15
|
width="1em"
|
|
18
16
|
>
|
|
19
|
-
<title
|
|
20
|
-
id="icon-title-0"
|
|
21
|
-
>
|
|
22
|
-
string
|
|
23
|
-
</title>
|
|
24
17
|
<path
|
|
25
18
|
d="M224 256c70.7 0 128-57.3 128-128S294.7 0 224 0 96 57.3 96 128s57.3 128 128 128zm89.6 32h-16.7c-22.2 10.2-46.9 16-72.9 16s-50.6-5.8-72.9-16h-16.7C60.2 288 0 348.2 0 422.4V464c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48v-41.6c0-74.2-60.2-134.4-134.4-134.4z"
|
|
26
19
|
/>
|
|
@@ -40,7 +33,6 @@ exports[`EmptyStateIcon should match snapshot for variant container 1`] = `
|
|
|
40
33
|
aria-valuetext="Loading..."
|
|
41
34
|
class="pf-v5-c-spinner pf-m-xl ''"
|
|
42
35
|
role="progressbar"
|
|
43
|
-
title="string"
|
|
44
36
|
viewBox="0 0 100 100"
|
|
45
37
|
>
|
|
46
38
|
<circle
|
|
@@ -48,6 +48,15 @@ exports[`EmptyState Header with icon 1`] = `
|
|
|
48
48
|
/>
|
|
49
49
|
</svg>
|
|
50
50
|
</div>
|
|
51
|
+
<div
|
|
52
|
+
class="pf-v5-c-empty-state__title"
|
|
53
|
+
>
|
|
54
|
+
<h1
|
|
55
|
+
class="pf-v5-c-empty-state__title-text"
|
|
56
|
+
>
|
|
57
|
+
Empty state
|
|
58
|
+
</h1>
|
|
59
|
+
</div>
|
|
51
60
|
</div>
|
|
52
61
|
</DocumentFragment>
|
|
53
62
|
`;
|
|
@@ -2,12 +2,11 @@
|
|
|
2
2
|
id: Empty state
|
|
3
3
|
section: components
|
|
4
4
|
cssPrefix: pf-v5-c-empty-state
|
|
5
|
-
propComponents: ['EmptyState', '
|
|
5
|
+
propComponents: ['EmptyState', 'EmptyStateBody', 'EmptyStateFooter', 'EmptyStateActions']
|
|
6
6
|
---
|
|
7
7
|
import CubesIcon from '@patternfly/react-icons/dist/esm/icons/cubes-icon';
|
|
8
8
|
import SearchIcon from '@patternfly/react-icons/dist/esm/icons/search-icon';
|
|
9
|
-
import
|
|
10
|
-
import global_success_color_100 from '@patternfly/react-tokens/dist/esm/global_success_color_100';
|
|
9
|
+
import CheckCircleIcon from '@patternfly/react-icons/dist/esm/icons/check-circle-icon';
|
|
11
10
|
|
|
12
11
|
## Examples
|
|
13
12
|
### Basic
|
|
@@ -35,6 +34,10 @@ import global_success_color_100 from '@patternfly/react-tokens/dist/esm/global_s
|
|
|
35
34
|
```ts file="EmptyStateExtraLarge.tsx"
|
|
36
35
|
```
|
|
37
36
|
|
|
37
|
+
### With status
|
|
38
|
+
```ts file="EmptyStateWithStatus.tsx"
|
|
39
|
+
```
|
|
40
|
+
|
|
38
41
|
### Spinner
|
|
39
42
|
|
|
40
43
|
```ts file="EmptyStateSpinner.tsx"
|
|
@@ -44,8 +47,3 @@ import global_success_color_100 from '@patternfly/react-tokens/dist/esm/global_s
|
|
|
44
47
|
|
|
45
48
|
```ts file="EmptyStateNoMatchFound.tsx"
|
|
46
49
|
```
|
|
47
|
-
|
|
48
|
-
### Custom icon color
|
|
49
|
-
|
|
50
|
-
```ts file="EmptyStateCustomIconColor.tsx"
|
|
51
|
-
```
|
|
@@ -1,18 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
Button,
|
|
4
|
-
EmptyState,
|
|
5
|
-
EmptyStateBody,
|
|
6
|
-
EmptyStateActions,
|
|
7
|
-
EmptyStateHeader,
|
|
8
|
-
EmptyStateFooter,
|
|
9
|
-
EmptyStateIcon
|
|
10
|
-
} from '@patternfly/react-core';
|
|
2
|
+
import { Button, EmptyState, EmptyStateBody, EmptyStateActions, EmptyStateFooter } from '@patternfly/react-core';
|
|
11
3
|
import CubesIcon from '@patternfly/react-icons/dist/esm/icons/cubes-icon';
|
|
12
4
|
|
|
13
5
|
export const EmptyStateBasic: React.FunctionComponent = () => (
|
|
14
|
-
<EmptyState>
|
|
15
|
-
<EmptyStateHeader titleText="Empty state" headingLevel="h4" icon={<EmptyStateIcon icon={CubesIcon} />} />
|
|
6
|
+
<EmptyState titleText="Empty state" headingLevel="h4" icon={CubesIcon}>
|
|
16
7
|
<EmptyStateBody>
|
|
17
8
|
This represents the empty state pattern in PatternFly. Hopefully it's simple enough to use but flexible enough to
|
|
18
9
|
meet a variety of needs.
|