@patternfly/react-core 5.0.0-alpha.31 → 5.0.0-alpha.33
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 +18 -0
- package/components/Alert/Alert.d.ts +0 -2
- package/components/Alert/Alert.d.ts.map +1 -1
- package/components/Alert/Alert.js +2 -6
- package/components/Alert/Alert.js.map +1 -1
- package/components/EmptyState/EmptyState.d.ts +6 -6
- package/components/EmptyState/EmptyState.d.ts.map +1 -1
- package/components/EmptyState/EmptyState.js +4 -4
- package/components/EmptyState/EmptyState.js.map +1 -1
- package/components/EmptyState/EmptyStateActions.d.ts +9 -0
- package/components/EmptyState/EmptyStateActions.d.ts.map +1 -0
- package/components/EmptyState/EmptyStateActions.js +10 -0
- package/components/EmptyState/EmptyStateActions.js.map +1 -0
- package/components/EmptyState/EmptyStateBody.d.ts +2 -2
- package/components/EmptyState/EmptyStateBody.d.ts.map +1 -1
- package/components/EmptyState/EmptyStateBody.js +1 -1
- package/components/EmptyState/EmptyStateBody.js.map +1 -1
- package/components/EmptyState/EmptyStateFooter.d.ts +9 -0
- package/components/EmptyState/EmptyStateFooter.d.ts.map +1 -0
- package/components/EmptyState/EmptyStateFooter.js +10 -0
- package/components/EmptyState/EmptyStateFooter.js.map +1 -0
- package/components/EmptyState/EmptyStateHeader.d.ts +18 -0
- package/components/EmptyState/EmptyStateHeader.d.ts.map +1 -0
- package/components/EmptyState/EmptyStateHeader.js +14 -0
- package/components/EmptyState/EmptyStateHeader.js.map +1 -0
- package/components/EmptyState/EmptyStateIcon.d.ts +3 -9
- package/components/EmptyState/EmptyStateIcon.d.ts.map +1 -1
- package/components/EmptyState/EmptyStateIcon.js +6 -4
- package/components/EmptyState/EmptyStateIcon.js.map +1 -1
- package/components/EmptyState/index.d.ts +4 -3
- package/components/EmptyState/index.d.ts.map +1 -1
- package/components/EmptyState/index.js +4 -3
- package/components/EmptyState/index.js.map +1 -1
- package/dist/esm/components/Alert/Alert.d.ts +0 -2
- package/dist/esm/components/Alert/Alert.d.ts.map +1 -1
- package/dist/esm/components/Alert/Alert.js +2 -6
- package/dist/esm/components/Alert/Alert.js.map +1 -1
- package/dist/esm/components/EmptyState/EmptyState.d.ts +6 -6
- package/dist/esm/components/EmptyState/EmptyState.d.ts.map +1 -1
- package/dist/esm/components/EmptyState/EmptyState.js +4 -4
- package/dist/esm/components/EmptyState/EmptyState.js.map +1 -1
- package/dist/esm/components/EmptyState/EmptyStateActions.d.ts +9 -0
- package/dist/esm/components/EmptyState/EmptyStateActions.d.ts.map +1 -0
- package/dist/esm/components/EmptyState/EmptyStateActions.js +10 -0
- package/dist/esm/components/EmptyState/EmptyStateActions.js.map +1 -0
- package/dist/esm/components/EmptyState/EmptyStateBody.d.ts +2 -2
- package/dist/esm/components/EmptyState/EmptyStateBody.d.ts.map +1 -1
- package/dist/esm/components/EmptyState/EmptyStateBody.js +1 -1
- package/dist/esm/components/EmptyState/EmptyStateBody.js.map +1 -1
- package/dist/esm/components/EmptyState/EmptyStateFooter.d.ts +9 -0
- package/dist/esm/components/EmptyState/EmptyStateFooter.d.ts.map +1 -0
- package/dist/esm/components/EmptyState/EmptyStateFooter.js +10 -0
- package/dist/esm/components/EmptyState/EmptyStateFooter.js.map +1 -0
- package/dist/esm/components/EmptyState/EmptyStateHeader.d.ts +18 -0
- package/dist/esm/components/EmptyState/EmptyStateHeader.d.ts.map +1 -0
- package/dist/esm/components/EmptyState/EmptyStateHeader.js +14 -0
- package/dist/esm/components/EmptyState/EmptyStateHeader.js.map +1 -0
- package/dist/esm/components/EmptyState/EmptyStateIcon.d.ts +3 -9
- package/dist/esm/components/EmptyState/EmptyStateIcon.d.ts.map +1 -1
- package/dist/esm/components/EmptyState/EmptyStateIcon.js +6 -4
- package/dist/esm/components/EmptyState/EmptyStateIcon.js.map +1 -1
- package/dist/esm/components/EmptyState/index.d.ts +4 -3
- package/dist/esm/components/EmptyState/index.d.ts.map +1 -1
- package/dist/esm/components/EmptyState/index.js +4 -3
- package/dist/esm/components/EmptyState/index.js.map +1 -1
- package/dist/js/components/Alert/Alert.d.ts +0 -2
- package/dist/js/components/Alert/Alert.d.ts.map +1 -1
- package/dist/js/components/Alert/Alert.js +2 -6
- package/dist/js/components/Alert/Alert.js.map +1 -1
- package/dist/js/components/EmptyState/EmptyState.d.ts +6 -6
- package/dist/js/components/EmptyState/EmptyState.d.ts.map +1 -1
- package/dist/js/components/EmptyState/EmptyState.js +4 -4
- package/dist/js/components/EmptyState/EmptyState.js.map +1 -1
- package/dist/js/components/EmptyState/EmptyStateActions.d.ts +9 -0
- package/dist/js/components/EmptyState/EmptyStateActions.d.ts.map +1 -0
- package/dist/js/components/EmptyState/EmptyStateActions.js +14 -0
- package/dist/js/components/EmptyState/EmptyStateActions.js.map +1 -0
- package/dist/js/components/EmptyState/EmptyStateBody.d.ts +2 -2
- package/dist/js/components/EmptyState/EmptyStateBody.d.ts.map +1 -1
- package/dist/js/components/EmptyState/EmptyStateBody.js +1 -1
- package/dist/js/components/EmptyState/EmptyStateBody.js.map +1 -1
- package/dist/js/components/EmptyState/EmptyStateFooter.d.ts +9 -0
- package/dist/js/components/EmptyState/EmptyStateFooter.d.ts.map +1 -0
- package/dist/js/components/EmptyState/EmptyStateFooter.js +14 -0
- package/dist/js/components/EmptyState/EmptyStateFooter.js.map +1 -0
- package/dist/js/components/EmptyState/EmptyStateHeader.d.ts +18 -0
- package/dist/js/components/EmptyState/EmptyStateHeader.d.ts.map +1 -0
- package/dist/js/components/EmptyState/EmptyStateHeader.js +18 -0
- package/dist/js/components/EmptyState/EmptyStateHeader.js.map +1 -0
- package/dist/js/components/EmptyState/EmptyStateIcon.d.ts +3 -9
- package/dist/js/components/EmptyState/EmptyStateIcon.d.ts.map +1 -1
- package/dist/js/components/EmptyState/EmptyStateIcon.js +6 -4
- package/dist/js/components/EmptyState/EmptyStateIcon.js.map +1 -1
- package/dist/js/components/EmptyState/index.d.ts +4 -3
- package/dist/js/components/EmptyState/index.d.ts.map +1 -1
- package/dist/js/components/EmptyState/index.js +4 -3
- package/dist/js/components/EmptyState/index.js.map +1 -1
- package/dist/umd/react-core.min.js +1 -1
- package/package.json +2 -2
- package/src/components/Alert/Alert.tsx +1 -10
- package/src/components/Alert/__tests__/Alert.test.tsx +2 -2
- package/src/components/DualListSelector/examples/DualListSelectorComposable.tsx +32 -30
- package/src/components/DualListSelector/examples/DualListSelectorComposableTree.tsx +38 -34
- package/src/components/EmptyState/EmptyState.tsx +9 -9
- package/src/components/EmptyState/EmptyStateActions.tsx +21 -0
- package/src/components/EmptyState/EmptyStateBody.tsx +3 -3
- package/src/components/EmptyState/EmptyStateFooter.tsx +21 -0
- package/src/components/EmptyState/EmptyStateHeader.tsx +42 -0
- package/src/components/EmptyState/EmptyStateIcon.tsx +15 -18
- package/src/components/EmptyState/__tests__/EmptyState.test.tsx +53 -60
- package/src/components/EmptyState/__tests__/Generated/{EmptyStatePrimary.test.tsx → EmptyStateActions.test.tsx} +3 -3
- package/src/components/EmptyState/__tests__/Generated/EmptyStateIcon.test.tsx +3 -6
- package/src/components/EmptyState/__tests__/Generated/__snapshots__/{EmptyStateSecondaryActions.test.tsx.snap → EmptyStateActions.test.tsx.snap} +2 -2
- package/src/components/EmptyState/__tests__/Generated/__snapshots__/EmptyStateIcon.test.tsx.snap +41 -22
- package/src/components/EmptyState/__tests__/__snapshots__/EmptyState.test.tsx.snap +115 -56
- package/src/components/EmptyState/examples/EmptyState.md +7 -3
- package/src/components/EmptyState/examples/EmptyStateBasic.tsx +20 -18
- package/src/components/EmptyState/examples/EmptyStateCustomIconColor.tsx +17 -0
- package/src/components/EmptyState/examples/EmptyStateExtraLarge.tsx +20 -18
- package/src/components/EmptyState/examples/EmptyStateExtraSmall.tsx +16 -15
- package/src/components/EmptyState/examples/EmptyStateLarge.tsx +21 -19
- package/src/components/EmptyState/examples/EmptyStateNoMatchFound.tsx +15 -8
- package/src/components/EmptyState/examples/EmptyStateSmall.tsx +21 -19
- package/src/components/EmptyState/examples/EmptyStateSpinner.tsx +2 -5
- package/src/components/EmptyState/index.ts +4 -3
- package/src/components/NotificationDrawer/examples/NotificationDrawerGroups.tsx +15 -11
- package/src/components/NotificationDrawer/examples/NotificationDrawerLightweight.tsx +14 -10
- package/src/components/Wizard/examples/Wizard.md +1 -1
- package/src/components/Wizard/examples/WizardFinished.tsx +18 -14
- package/src/components/Wizard/examples/WizardValidateOnButtonPress.tsx +20 -16
- package/src/demos/Card/Card.md +13 -8
- package/src/demos/Filters/FilterDemos.md +4 -2
- package/src/demos/Filters/examples/FilterAttributeSearch.tsx +20 -20
- package/src/demos/Filters/examples/FilterFaceted.tsx +19 -19
- package/src/demos/Filters/examples/FilterMixedSelectGroup.tsx +19 -19
- package/src/demos/Filters/examples/FilterSameSelectGroup.tsx +19 -19
- package/src/demos/Filters/examples/FilterSearchInput.tsx +18 -18
- package/src/demos/NotificationDrawer/NotificationDrawer.md +52 -39
- package/src/demos/examples/AlertGroup/AlertGroupToastWithNotificationDrawer.tsx +19 -17
- package/src/next/components/Wizard/examples/WizardValidateOnButtonPress.tsx +19 -15
- package/src/next/components/Wizard/examples/WizardWithSubmitProgress.tsx +18 -14
- package/components/EmptyState/EmptyStatePrimary.d.ts +0 -9
- package/components/EmptyState/EmptyStatePrimary.d.ts.map +0 -1
- package/components/EmptyState/EmptyStatePrimary.js +0 -9
- package/components/EmptyState/EmptyStatePrimary.js.map +0 -1
- package/components/EmptyState/EmptyStateSecondaryActions.d.ts +0 -9
- package/components/EmptyState/EmptyStateSecondaryActions.d.ts.map +0 -1
- package/components/EmptyState/EmptyStateSecondaryActions.js +0 -9
- package/components/EmptyState/EmptyStateSecondaryActions.js.map +0 -1
- package/dist/esm/components/EmptyState/EmptyStatePrimary.d.ts +0 -9
- package/dist/esm/components/EmptyState/EmptyStatePrimary.d.ts.map +0 -1
- package/dist/esm/components/EmptyState/EmptyStatePrimary.js +0 -9
- package/dist/esm/components/EmptyState/EmptyStatePrimary.js.map +0 -1
- package/dist/esm/components/EmptyState/EmptyStateSecondaryActions.d.ts +0 -9
- package/dist/esm/components/EmptyState/EmptyStateSecondaryActions.d.ts.map +0 -1
- package/dist/esm/components/EmptyState/EmptyStateSecondaryActions.js +0 -9
- package/dist/esm/components/EmptyState/EmptyStateSecondaryActions.js.map +0 -1
- package/dist/js/components/EmptyState/EmptyStatePrimary.d.ts +0 -9
- package/dist/js/components/EmptyState/EmptyStatePrimary.d.ts.map +0 -1
- package/dist/js/components/EmptyState/EmptyStatePrimary.js +0 -13
- package/dist/js/components/EmptyState/EmptyStatePrimary.js.map +0 -1
- package/dist/js/components/EmptyState/EmptyStateSecondaryActions.d.ts +0 -9
- package/dist/js/components/EmptyState/EmptyStateSecondaryActions.d.ts.map +0 -1
- package/dist/js/components/EmptyState/EmptyStateSecondaryActions.js +0 -13
- package/dist/js/components/EmptyState/EmptyStateSecondaryActions.js.map +0 -1
- package/src/components/EmptyState/EmptyStatePrimary.tsx +0 -20
- package/src/components/EmptyState/EmptyStateSecondaryActions.tsx +0 -18
- package/src/components/EmptyState/__tests__/Generated/EmptyStateSecondaryActions.test.tsx +0 -13
- package/src/components/EmptyState/__tests__/Generated/__snapshots__/EmptyStatePrimary.test.tsx.snap +0 -13
|
@@ -3,30 +3,33 @@ import React from 'react';
|
|
|
3
3
|
import { render, screen } from '@testing-library/react';
|
|
4
4
|
|
|
5
5
|
import AddressBookIcon from '@patternfly/react-icons/dist/esm/icons/address-book-icon';
|
|
6
|
+
|
|
6
7
|
import { EmptyState, EmptyStateVariant } from '../EmptyState';
|
|
7
8
|
import { EmptyStateBody } from '../EmptyStateBody';
|
|
8
|
-
import {
|
|
9
|
-
import { EmptyStateIcon } from '../EmptyStateIcon';
|
|
10
|
-
import { EmptyStatePrimary } from '../EmptyStatePrimary';
|
|
9
|
+
import { EmptyStateActions } from '../EmptyStateActions';
|
|
11
10
|
import { Button } from '../../Button';
|
|
12
|
-
import {
|
|
11
|
+
import { EmptyStateHeader } from '../EmptyStateHeader';
|
|
12
|
+
import { EmptyStateFooter } from '../EmptyStateFooter';
|
|
13
|
+
import { EmptyStateIcon } from '../../../../dist/esm';
|
|
13
14
|
|
|
14
15
|
describe('EmptyState', () => {
|
|
15
16
|
test('Main', () => {
|
|
16
17
|
const { asFragment } = render(
|
|
17
18
|
<EmptyState>
|
|
18
|
-
<
|
|
19
|
-
HTTP Proxies
|
|
20
|
-
</Title>
|
|
19
|
+
<EmptyStateHeader titleText="HTTP Proxies" />
|
|
21
20
|
<EmptyStateBody>
|
|
22
21
|
Defining HTTP Proxies that exist on your network allows you to perform various actions through those proxies.
|
|
23
22
|
</EmptyStateBody>
|
|
24
|
-
<
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
23
|
+
<EmptyStateFooter>
|
|
24
|
+
<EmptyStateActions>
|
|
25
|
+
<Button variant="primary">New HTTP Proxy</Button>
|
|
26
|
+
</EmptyStateActions>
|
|
27
|
+
<EmptyStateActions>
|
|
28
|
+
<Button variant="link" aria-label="learn more action">
|
|
29
|
+
Learn more about this in the documentation.
|
|
30
|
+
</Button>
|
|
31
|
+
</EmptyStateActions>
|
|
32
|
+
</EmptyStateFooter>
|
|
30
33
|
</EmptyState>
|
|
31
34
|
);
|
|
32
35
|
expect(asFragment()).toMatchSnapshot();
|
|
@@ -34,10 +37,8 @@ describe('EmptyState', () => {
|
|
|
34
37
|
|
|
35
38
|
test('Main variant large', () => {
|
|
36
39
|
const { asFragment } = render(
|
|
37
|
-
<EmptyState variant={EmptyStateVariant.
|
|
38
|
-
<
|
|
39
|
-
EmptyState large
|
|
40
|
-
</Title>
|
|
40
|
+
<EmptyState variant={EmptyStateVariant.lg}>
|
|
41
|
+
<EmptyStateHeader titleText="EmptyState large" />
|
|
41
42
|
</EmptyState>
|
|
42
43
|
);
|
|
43
44
|
expect(asFragment()).toMatchSnapshot();
|
|
@@ -45,10 +46,8 @@ describe('EmptyState', () => {
|
|
|
45
46
|
|
|
46
47
|
test('Main variant small', () => {
|
|
47
48
|
const { asFragment } = render(
|
|
48
|
-
<EmptyState variant={EmptyStateVariant.
|
|
49
|
-
<
|
|
50
|
-
EmptyState small
|
|
51
|
-
</Title>
|
|
49
|
+
<EmptyState variant={EmptyStateVariant.sm}>
|
|
50
|
+
<EmptyStateHeader titleText="EmptyState small" />
|
|
52
51
|
</EmptyState>
|
|
53
52
|
);
|
|
54
53
|
expect(asFragment()).toMatchSnapshot();
|
|
@@ -57,9 +56,7 @@ describe('EmptyState', () => {
|
|
|
57
56
|
test('Main variant xs', () => {
|
|
58
57
|
const { asFragment } = render(
|
|
59
58
|
<EmptyState variant={EmptyStateVariant.xs}>
|
|
60
|
-
<
|
|
61
|
-
EmptyState small
|
|
62
|
-
</Title>
|
|
59
|
+
<EmptyStateHeader titleText="EmptyState extra small" />
|
|
63
60
|
</EmptyState>
|
|
64
61
|
);
|
|
65
62
|
expect(asFragment()).toMatchSnapshot();
|
|
@@ -70,51 +67,47 @@ describe('EmptyState', () => {
|
|
|
70
67
|
expect(screen.getByTestId('body-test-id')).toHaveClass('custom-empty-state-body pf-c-empty-state__body');
|
|
71
68
|
});
|
|
72
69
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
70
|
+
test('Actions', () => {
|
|
71
|
+
render(<EmptyStateActions className="custom-empty-state-secondary" data-testid="actions-test-id" />);
|
|
72
|
+
expect(screen.getByTestId('actions-test-id')).toHaveClass('pf-c-empty-state__actions');
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
test('Full height', () => {
|
|
76
|
+
const { asFragment } = render(
|
|
77
|
+
<EmptyState isFullHeight variant={EmptyStateVariant.lg}>
|
|
78
|
+
<EmptyStateHeader titleText="EmptyState large" />
|
|
79
|
+
</EmptyState>
|
|
78
80
|
);
|
|
81
|
+
expect(asFragment()).toMatchSnapshot();
|
|
79
82
|
});
|
|
80
83
|
|
|
81
|
-
test('
|
|
82
|
-
render(<EmptyStateIcon icon={AddressBookIcon}
|
|
83
|
-
expect(
|
|
84
|
+
test('Header with icon', () => {
|
|
85
|
+
const { asFragment } = render(<EmptyStateHeader icon={<EmptyStateIcon icon={AddressBookIcon} />} />);
|
|
86
|
+
expect(asFragment()).toMatchSnapshot();
|
|
84
87
|
});
|
|
85
88
|
|
|
86
|
-
test('
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
component={AddressBookIcon}
|
|
91
|
-
className="custom-empty-state-icon"
|
|
92
|
-
id="empty-state-icon-id"
|
|
93
|
-
/>
|
|
94
|
-
);
|
|
89
|
+
test('Header with title text renders heading level 1 by default', () => {
|
|
90
|
+
render(<EmptyStateHeader titleText="Empty state" />);
|
|
91
|
+
expect(screen.getByRole('heading', { level: 1, name: 'Empty state' })).toHaveClass('pf-c-empty-state__title-text');
|
|
92
|
+
});
|
|
95
93
|
|
|
96
|
-
|
|
97
|
-
|
|
94
|
+
test('Header renders custom class passed via titleClassName', () => {
|
|
95
|
+
render(<EmptyStateHeader titleText="Empty state" titleClassName={'testTitleClassName'} />);
|
|
96
|
+
expect(screen.getByRole('heading', { level: 1, name: 'Empty state' })).toHaveClass('testTitleClassName');
|
|
98
97
|
});
|
|
99
98
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
<EmptyStatePrimary data-testid="primary-test-id">
|
|
104
|
-
<Button variant="link">Link</Button>
|
|
105
|
-
</EmptyStatePrimary>
|
|
106
|
-
);
|
|
107
|
-
expect(screen.getByTestId('primary-test-id')).toHaveClass('pf-c-empty-state__primary');
|
|
99
|
+
test('Header renders the title as other heading levels when one is passed using headingLevel', () => {
|
|
100
|
+
render(<EmptyStateHeader titleText="Empty state" headingLevel="h3" />);
|
|
101
|
+
expect(screen.getByRole('heading', { level: 3, name: 'Empty state' })).toHaveClass('pf-c-empty-state__title-text');
|
|
108
102
|
});
|
|
109
103
|
|
|
110
|
-
test('
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
);
|
|
118
|
-
expect(asFragment()).toMatchSnapshot();
|
|
104
|
+
test('Headers render children', () => {
|
|
105
|
+
render(<EmptyStateHeader>Title text</EmptyStateHeader>);
|
|
106
|
+
expect(screen.getByText('Title text')).toBeVisible();
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
test('Footer', () => {
|
|
110
|
+
render(<EmptyStateFooter className="custom-empty-state-footer" data-testid="actions-test-id" />);
|
|
111
|
+
expect(screen.getByTestId('actions-test-id')).toHaveClass('custom-empty-state-footer');
|
|
119
112
|
});
|
|
120
113
|
});
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import { render } from '@testing-library/react';
|
|
6
|
-
import {
|
|
6
|
+
import { EmptyStateActions } from '../../EmptyStateActions';
|
|
7
7
|
// any missing imports can usually be resolved by adding them here
|
|
8
8
|
import {} from '../..';
|
|
9
9
|
|
|
10
|
-
it('
|
|
11
|
-
const { asFragment } = render(<
|
|
10
|
+
it('EmptyStateActions should match snapshot (auto-generated)', () => {
|
|
11
|
+
const { asFragment } = render(<EmptyStateActions children={<>ReactNode</>} className={"''"} />);
|
|
12
12
|
expect(asFragment()).toMatchSnapshot();
|
|
13
13
|
});
|
|
@@ -6,7 +6,8 @@ import { render } from '@testing-library/react';
|
|
|
6
6
|
import { UserIcon } from '@patternfly/react-icons';
|
|
7
7
|
import { EmptyStateIcon } from '../../EmptyStateIcon';
|
|
8
8
|
// any missing imports can usually be resolved by adding them here
|
|
9
|
-
import {} from '
|
|
9
|
+
import { Spinner } from '../../../Spinner/Spinner';
|
|
10
|
+
|
|
10
11
|
it('EmptyStateIcon should match snapshot (auto-generated)', () => {
|
|
11
12
|
const { asFragment } = render(
|
|
12
13
|
<EmptyStateIcon
|
|
@@ -14,8 +15,6 @@ it('EmptyStateIcon should match snapshot (auto-generated)', () => {
|
|
|
14
15
|
title={'string'}
|
|
15
16
|
className={"''"}
|
|
16
17
|
icon={UserIcon}
|
|
17
|
-
component={null}
|
|
18
|
-
variant={'icon'}
|
|
19
18
|
/>
|
|
20
19
|
);
|
|
21
20
|
expect(asFragment()).toMatchSnapshot();
|
|
@@ -27,9 +26,7 @@ it('EmptyStateIcon should match snapshot for variant container', () => {
|
|
|
27
26
|
color={'string'}
|
|
28
27
|
title={'string'}
|
|
29
28
|
className={"''"}
|
|
30
|
-
icon={
|
|
31
|
-
component={() => <div>Component</div>}
|
|
32
|
-
variant={'container'}
|
|
29
|
+
icon={Spinner}
|
|
33
30
|
/>
|
|
34
31
|
);
|
|
35
32
|
expect(asFragment()).toMatchSnapshot();
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
|
-
exports[`
|
|
3
|
+
exports[`EmptyStateActions should match snapshot (auto-generated) 1`] = `
|
|
4
4
|
<DocumentFragment>
|
|
5
5
|
<div
|
|
6
|
-
class="''"
|
|
6
|
+
class="pf-c-empty-state__actions ''"
|
|
7
7
|
>
|
|
8
8
|
ReactNode
|
|
9
9
|
</div>
|
package/src/components/EmptyState/__tests__/Generated/__snapshots__/EmptyStateIcon.test.tsx.snap
CHANGED
|
@@ -2,37 +2,56 @@
|
|
|
2
2
|
|
|
3
3
|
exports[`EmptyStateIcon should match snapshot (auto-generated) 1`] = `
|
|
4
4
|
<DocumentFragment>
|
|
5
|
-
<
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
class="pf-c-empty-state__icon ''"
|
|
9
|
-
fill="string"
|
|
10
|
-
height="1em"
|
|
11
|
-
role="img"
|
|
12
|
-
style="vertical-align: -0.125em;"
|
|
13
|
-
viewBox="0 0 830 1024"
|
|
14
|
-
width="1em"
|
|
5
|
+
<div
|
|
6
|
+
class="pf-c-empty-state__icon"
|
|
7
|
+
style="--pf-c-empty-state__icon--Color: string;"
|
|
15
8
|
>
|
|
16
|
-
<
|
|
17
|
-
|
|
9
|
+
<svg
|
|
10
|
+
aria-hidden="true"
|
|
11
|
+
aria-labelledby="icon-title-0"
|
|
12
|
+
class="''"
|
|
13
|
+
fill="currentColor"
|
|
14
|
+
height="1em"
|
|
15
|
+
role="img"
|
|
16
|
+
style="vertical-align: -0.125em;"
|
|
17
|
+
viewBox="0 0 830 1024"
|
|
18
|
+
width="1em"
|
|
18
19
|
>
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
20
|
+
<title
|
|
21
|
+
id="icon-title-0"
|
|
22
|
+
>
|
|
23
|
+
string
|
|
24
|
+
</title>
|
|
25
|
+
<path
|
|
26
|
+
d="M0,1024 C7.8,907.1 37.3,664.2 147.8,568.3 C147.8,568.3 207.5,511.5 298.4,511.996718 L530.3,511.996718 C621.3,511.996718 680.9,568.3 680.9,568.3 C680.9,568.3 813.9,680.1 830,1024 L0,1024 Z M639.4,224 C639.4,347.7 539.1,448 415.4,448 C291.7,448 191.4,347.7 191.4,224 C191.4,100.3 291.9,0 415.6,0 C539.3,0 639.4,100.3 639.4,224 L639.4,224 Z"
|
|
27
|
+
/>
|
|
28
|
+
</svg>
|
|
29
|
+
</div>
|
|
25
30
|
</DocumentFragment>
|
|
26
31
|
`;
|
|
27
32
|
|
|
28
33
|
exports[`EmptyStateIcon should match snapshot for variant container 1`] = `
|
|
29
34
|
<DocumentFragment>
|
|
30
35
|
<div
|
|
31
|
-
class="pf-c-empty-state__icon
|
|
36
|
+
class="pf-c-empty-state__icon"
|
|
32
37
|
>
|
|
33
|
-
<
|
|
34
|
-
|
|
35
|
-
|
|
38
|
+
<svg
|
|
39
|
+
aria-hidden="false"
|
|
40
|
+
aria-label="Contents"
|
|
41
|
+
aria-valuetext="Loading..."
|
|
42
|
+
class="pf-c-spinner pf-m-xl ''"
|
|
43
|
+
role="progressbar"
|
|
44
|
+
title="string"
|
|
45
|
+
viewBox="0 0 100 100"
|
|
46
|
+
>
|
|
47
|
+
<circle
|
|
48
|
+
class="pf-c-spinner__path"
|
|
49
|
+
cx="50"
|
|
50
|
+
cy="50"
|
|
51
|
+
fill="none"
|
|
52
|
+
r="45"
|
|
53
|
+
/>
|
|
54
|
+
</svg>
|
|
36
55
|
</div>
|
|
37
56
|
</DocumentFragment>
|
|
38
57
|
`;
|
|
@@ -8,14 +8,45 @@ exports[`EmptyState Full height 1`] = `
|
|
|
8
8
|
<div
|
|
9
9
|
class="pf-c-empty-state__content"
|
|
10
10
|
>
|
|
11
|
-
<
|
|
12
|
-
class="pf-c-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
<div
|
|
12
|
+
class="pf-c-empty-state__header"
|
|
13
|
+
>
|
|
14
|
+
<div
|
|
15
|
+
class="pf-c-empty-state__title"
|
|
16
|
+
>
|
|
17
|
+
<h1
|
|
18
|
+
class="pf-c-empty-state__title-text"
|
|
19
|
+
>
|
|
20
|
+
EmptyState large
|
|
21
|
+
</h1>
|
|
22
|
+
</div>
|
|
23
|
+
</div>
|
|
24
|
+
</div>
|
|
25
|
+
</div>
|
|
26
|
+
</DocumentFragment>
|
|
27
|
+
`;
|
|
28
|
+
|
|
29
|
+
exports[`EmptyState Header with icon 1`] = `
|
|
30
|
+
<DocumentFragment>
|
|
31
|
+
<div
|
|
32
|
+
class="pf-c-empty-state__header"
|
|
33
|
+
>
|
|
34
|
+
<div
|
|
35
|
+
class="pf-c-empty-state__icon"
|
|
36
|
+
>
|
|
37
|
+
<svg
|
|
38
|
+
aria-hidden="true"
|
|
39
|
+
fill="currentColor"
|
|
40
|
+
height="1em"
|
|
41
|
+
role="img"
|
|
42
|
+
style="vertical-align: -0.125em;"
|
|
43
|
+
viewBox="0 0 448 512"
|
|
44
|
+
width="1em"
|
|
16
45
|
>
|
|
17
|
-
|
|
18
|
-
|
|
46
|
+
<path
|
|
47
|
+
d="M436 160c6.6 0 12-5.4 12-12v-40c0-6.6-5.4-12-12-12h-20V48c0-26.5-21.5-48-48-48H48C21.5 0 0 21.5 0 48v416c0 26.5 21.5 48 48 48h320c26.5 0 48-21.5 48-48v-48h20c6.6 0 12-5.4 12-12v-40c0-6.6-5.4-12-12-12h-20v-64h20c6.6 0 12-5.4 12-12v-40c0-6.6-5.4-12-12-12h-20v-64h20zm-228-32c35.3 0 64 28.7 64 64s-28.7 64-64 64-64-28.7-64-64 28.7-64 64-64zm112 236.8c0 10.6-10 19.2-22.4 19.2H118.4C106 384 96 375.4 96 364.8v-19.2c0-31.8 30.1-57.6 67.2-57.6h5c12.3 5.1 25.7 8 39.8 8s27.6-2.9 39.8-8h5c37.1 0 67.2 25.8 67.2 57.6v19.2z"
|
|
48
|
+
/>
|
|
49
|
+
</svg>
|
|
19
50
|
</div>
|
|
20
51
|
</div>
|
|
21
52
|
</DocumentFragment>
|
|
@@ -29,43 +60,56 @@ exports[`EmptyState Main 1`] = `
|
|
|
29
60
|
<div
|
|
30
61
|
class="pf-c-empty-state__content"
|
|
31
62
|
>
|
|
32
|
-
<
|
|
33
|
-
class="pf-c-
|
|
34
|
-
data-ouia-component-id="OUIA-Generated-Title-1"
|
|
35
|
-
data-ouia-component-type="PF4/Title"
|
|
36
|
-
data-ouia-safe="true"
|
|
63
|
+
<div
|
|
64
|
+
class="pf-c-empty-state__header"
|
|
37
65
|
>
|
|
38
|
-
|
|
39
|
-
|
|
66
|
+
<div
|
|
67
|
+
class="pf-c-empty-state__title"
|
|
68
|
+
>
|
|
69
|
+
<h1
|
|
70
|
+
class="pf-c-empty-state__title-text"
|
|
71
|
+
>
|
|
72
|
+
HTTP Proxies
|
|
73
|
+
</h1>
|
|
74
|
+
</div>
|
|
75
|
+
</div>
|
|
40
76
|
<div
|
|
41
77
|
class="pf-c-empty-state__body"
|
|
42
78
|
>
|
|
43
79
|
Defining HTTP Proxies that exist on your network allows you to perform various actions through those proxies.
|
|
44
80
|
</div>
|
|
45
|
-
<button
|
|
46
|
-
aria-disabled="false"
|
|
47
|
-
class="pf-c-button pf-m-primary"
|
|
48
|
-
data-ouia-component-id="OUIA-Generated-Button-primary-1"
|
|
49
|
-
data-ouia-component-type="PF4/Button"
|
|
50
|
-
data-ouia-safe="true"
|
|
51
|
-
type="button"
|
|
52
|
-
>
|
|
53
|
-
New HTTP Proxy
|
|
54
|
-
</button>
|
|
55
81
|
<div
|
|
56
|
-
class=""
|
|
82
|
+
class="pf-c-empty-state__footer"
|
|
57
83
|
>
|
|
58
|
-
<
|
|
59
|
-
|
|
60
|
-
aria-label="learn more action"
|
|
61
|
-
class="pf-c-button pf-m-link"
|
|
62
|
-
data-ouia-component-id="OUIA-Generated-Button-link-1"
|
|
63
|
-
data-ouia-component-type="PF4/Button"
|
|
64
|
-
data-ouia-safe="true"
|
|
65
|
-
type="button"
|
|
84
|
+
<div
|
|
85
|
+
class="pf-c-empty-state__actions"
|
|
66
86
|
>
|
|
67
|
-
|
|
68
|
-
|
|
87
|
+
<button
|
|
88
|
+
aria-disabled="false"
|
|
89
|
+
class="pf-c-button pf-m-primary"
|
|
90
|
+
data-ouia-component-id="OUIA-Generated-Button-primary-1"
|
|
91
|
+
data-ouia-component-type="PF4/Button"
|
|
92
|
+
data-ouia-safe="true"
|
|
93
|
+
type="button"
|
|
94
|
+
>
|
|
95
|
+
New HTTP Proxy
|
|
96
|
+
</button>
|
|
97
|
+
</div>
|
|
98
|
+
<div
|
|
99
|
+
class="pf-c-empty-state__actions"
|
|
100
|
+
>
|
|
101
|
+
<button
|
|
102
|
+
aria-disabled="false"
|
|
103
|
+
aria-label="learn more action"
|
|
104
|
+
class="pf-c-button pf-m-link"
|
|
105
|
+
data-ouia-component-id="OUIA-Generated-Button-link-1"
|
|
106
|
+
data-ouia-component-type="PF4/Button"
|
|
107
|
+
data-ouia-safe="true"
|
|
108
|
+
type="button"
|
|
109
|
+
>
|
|
110
|
+
Learn more about this in the documentation.
|
|
111
|
+
</button>
|
|
112
|
+
</div>
|
|
69
113
|
</div>
|
|
70
114
|
</div>
|
|
71
115
|
</div>
|
|
@@ -80,14 +124,19 @@ exports[`EmptyState Main variant large 1`] = `
|
|
|
80
124
|
<div
|
|
81
125
|
class="pf-c-empty-state__content"
|
|
82
126
|
>
|
|
83
|
-
<
|
|
84
|
-
class="pf-c-
|
|
85
|
-
data-ouia-component-id="OUIA-Generated-Title-2"
|
|
86
|
-
data-ouia-component-type="PF4/Title"
|
|
87
|
-
data-ouia-safe="true"
|
|
127
|
+
<div
|
|
128
|
+
class="pf-c-empty-state__header"
|
|
88
129
|
>
|
|
89
|
-
|
|
90
|
-
|
|
130
|
+
<div
|
|
131
|
+
class="pf-c-empty-state__title"
|
|
132
|
+
>
|
|
133
|
+
<h1
|
|
134
|
+
class="pf-c-empty-state__title-text"
|
|
135
|
+
>
|
|
136
|
+
EmptyState large
|
|
137
|
+
</h1>
|
|
138
|
+
</div>
|
|
139
|
+
</div>
|
|
91
140
|
</div>
|
|
92
141
|
</div>
|
|
93
142
|
</DocumentFragment>
|
|
@@ -101,14 +150,19 @@ exports[`EmptyState Main variant small 1`] = `
|
|
|
101
150
|
<div
|
|
102
151
|
class="pf-c-empty-state__content"
|
|
103
152
|
>
|
|
104
|
-
<
|
|
105
|
-
class="pf-c-
|
|
106
|
-
data-ouia-component-id="OUIA-Generated-Title-3"
|
|
107
|
-
data-ouia-component-type="PF4/Title"
|
|
108
|
-
data-ouia-safe="true"
|
|
153
|
+
<div
|
|
154
|
+
class="pf-c-empty-state__header"
|
|
109
155
|
>
|
|
110
|
-
|
|
111
|
-
|
|
156
|
+
<div
|
|
157
|
+
class="pf-c-empty-state__title"
|
|
158
|
+
>
|
|
159
|
+
<h1
|
|
160
|
+
class="pf-c-empty-state__title-text"
|
|
161
|
+
>
|
|
162
|
+
EmptyState small
|
|
163
|
+
</h1>
|
|
164
|
+
</div>
|
|
165
|
+
</div>
|
|
112
166
|
</div>
|
|
113
167
|
</div>
|
|
114
168
|
</DocumentFragment>
|
|
@@ -122,14 +176,19 @@ exports[`EmptyState Main variant xs 1`] = `
|
|
|
122
176
|
<div
|
|
123
177
|
class="pf-c-empty-state__content"
|
|
124
178
|
>
|
|
125
|
-
<
|
|
126
|
-
class="pf-c-
|
|
127
|
-
data-ouia-component-id="OUIA-Generated-Title-4"
|
|
128
|
-
data-ouia-component-type="PF4/Title"
|
|
129
|
-
data-ouia-safe="true"
|
|
179
|
+
<div
|
|
180
|
+
class="pf-c-empty-state__header"
|
|
130
181
|
>
|
|
131
|
-
|
|
132
|
-
|
|
182
|
+
<div
|
|
183
|
+
class="pf-c-empty-state__title"
|
|
184
|
+
>
|
|
185
|
+
<h1
|
|
186
|
+
class="pf-c-empty-state__title-text"
|
|
187
|
+
>
|
|
188
|
+
EmptyState extra small
|
|
189
|
+
</h1>
|
|
190
|
+
</div>
|
|
191
|
+
</div>
|
|
133
192
|
</div>
|
|
134
193
|
</div>
|
|
135
194
|
</DocumentFragment>
|
|
@@ -2,10 +2,11 @@
|
|
|
2
2
|
id: Empty state
|
|
3
3
|
section: components
|
|
4
4
|
cssPrefix: pf-c-empty-state
|
|
5
|
-
propComponents: ['EmptyState', '
|
|
5
|
+
propComponents: ['EmptyState', 'EmptyStateHeader', 'EmptyStateIcon', '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 CheckIcon from '@patternfly/react-icons/dist/esm/icons/check-icon';
|
|
9
10
|
|
|
10
11
|
## Examples
|
|
11
12
|
### Basic
|
|
@@ -40,7 +41,10 @@ import SearchIcon from '@patternfly/react-icons/dist/esm/icons/search-icon';
|
|
|
40
41
|
|
|
41
42
|
### No match found
|
|
42
43
|
|
|
43
|
-
`EmptyStatePrimary` is a container for primary actions. It can be used in lieu of using a primary button and will insure appropriate spacing of the buttons.
|
|
44
|
-
|
|
45
44
|
```ts file="EmptyStateNoMatchFound.tsx"
|
|
46
45
|
```
|
|
46
|
+
|
|
47
|
+
### Custom icon color
|
|
48
|
+
|
|
49
|
+
```ts file="EmptyStateCustomIconColor.tsx"
|
|
50
|
+
```
|
|
@@ -1,32 +1,34 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import {
|
|
3
|
-
Title,
|
|
4
3
|
Button,
|
|
5
4
|
EmptyState,
|
|
6
|
-
EmptyStateIcon,
|
|
7
5
|
EmptyStateBody,
|
|
8
|
-
|
|
6
|
+
EmptyStateActions,
|
|
7
|
+
EmptyStateHeader,
|
|
8
|
+
EmptyStateFooter,
|
|
9
|
+
EmptyStateIcon
|
|
9
10
|
} from '@patternfly/react-core';
|
|
10
11
|
import CubesIcon from '@patternfly/react-icons/dist/esm/icons/cubes-icon';
|
|
11
12
|
|
|
12
13
|
export const EmptyStateBasic: React.FunctionComponent = () => (
|
|
13
14
|
<EmptyState>
|
|
14
|
-
<EmptyStateIcon icon={CubesIcon} />
|
|
15
|
-
<Title headingLevel="h4" size="lg">
|
|
16
|
-
Empty state
|
|
17
|
-
</Title>
|
|
15
|
+
<EmptyStateHeader titleText="Empty state" headingLevel="h4" icon={<EmptyStateIcon icon={CubesIcon} />} />
|
|
18
16
|
<EmptyStateBody>
|
|
19
|
-
This represents
|
|
20
|
-
|
|
17
|
+
This represents the empty state pattern in PatternFly. Hopefully it's simple enough to use but flexible enough to
|
|
18
|
+
meet a variety of needs.
|
|
21
19
|
</EmptyStateBody>
|
|
22
|
-
<
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
<
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
20
|
+
<EmptyStateFooter>
|
|
21
|
+
<EmptyStateActions>
|
|
22
|
+
<Button variant="primary">Primary action</Button>
|
|
23
|
+
</EmptyStateActions>
|
|
24
|
+
<EmptyStateActions>
|
|
25
|
+
<Button variant="link">Multiple</Button>
|
|
26
|
+
<Button variant="link">Action Buttons</Button>
|
|
27
|
+
<Button variant="link">Can</Button>
|
|
28
|
+
<Button variant="link">Go here</Button>
|
|
29
|
+
<Button variant="link">In the secondary</Button>
|
|
30
|
+
<Button variant="link">Action area</Button>
|
|
31
|
+
</EmptyStateActions>
|
|
32
|
+
</EmptyStateFooter>
|
|
31
33
|
</EmptyState>
|
|
32
34
|
);
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { EmptyState, EmptyStateBody, EmptyStateHeader, EmptyStateIcon } from '@patternfly/react-core';
|
|
3
|
+
import CheckIcon from '@patternfly/react-icons/dist/esm/icons/check-icon';
|
|
4
|
+
|
|
5
|
+
export const EmptyStateCustomIconColor: React.FunctionComponent = () => (
|
|
6
|
+
<EmptyState>
|
|
7
|
+
<EmptyStateHeader
|
|
8
|
+
titleText="Custom icon color"
|
|
9
|
+
headingLevel="h4"
|
|
10
|
+
icon={<EmptyStateIcon icon={CheckIcon} color="var(--pf-global--success-color--100)" />}
|
|
11
|
+
/>
|
|
12
|
+
<EmptyStateBody>
|
|
13
|
+
This represents the empty state pattern in PatternFly with a custom icon color. Hopefully it's simple enough to
|
|
14
|
+
use but flexible enough to meet a variety of needs.
|
|
15
|
+
</EmptyStateBody>
|
|
16
|
+
</EmptyState>
|
|
17
|
+
);
|