Skip to content

Commit d48ee8f

Browse files
committed
align EmptyState with @wordpress/ui conventions
remove docblock comments, use semantic CSS tokens
1 parent e168934 commit d48ee8f

File tree

16 files changed

+5
-158
lines changed

16 files changed

+5
-158
lines changed

packages/ui/src/empty-state/actions.tsx

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,6 @@
1-
/**
2-
* External dependencies
3-
*/
41
import { useRender, mergeProps } from '@base-ui/react';
52
import clsx from 'clsx';
6-
7-
/**
8-
* WordPress dependencies
9-
*/
103
import { forwardRef } from '@wordpress/element';
11-
12-
/**
13-
* Internal dependencies
14-
*/
154
import type { EmptyStateActionsProps } from './types';
165
import styles from './style.module.css';
176

packages/ui/src/empty-state/description.tsx

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,6 @@
1-
/**
2-
* External dependencies
3-
*/
41
import { useRender, mergeProps } from '@base-ui/react';
52
import clsx from 'clsx';
6-
7-
/**
8-
* WordPress dependencies
9-
*/
103
import { forwardRef } from '@wordpress/element';
11-
12-
/**
13-
* Internal dependencies
14-
*/
154
import type { EmptyStateDescriptionProps } from './types';
165
import styles from './style.module.css';
176

packages/ui/src/empty-state/icon.tsx

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,5 @@
1-
/**
2-
* External dependencies
3-
*/
41
import clsx from 'clsx';
5-
6-
/**
7-
* WordPress dependencies
8-
*/
92
import { forwardRef } from '@wordpress/element';
10-
11-
/**
12-
* Internal dependencies
13-
*/
143
import { Icon as IconComponent } from '../icon';
154
import { Visual } from './visual';
165
import type { EmptyStateIconProps } from './types';

packages/ui/src/empty-state/index.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
/**
2-
* Internal dependencies
3-
*/
41
import { Root } from './root';
52
import { Visual } from './visual';
63
import { Icon } from './icon';

packages/ui/src/empty-state/root.tsx

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,6 @@
1-
/**
2-
* External dependencies
3-
*/
41
import { useRender, mergeProps } from '@base-ui/react';
52
import clsx from 'clsx';
6-
7-
/**
8-
* WordPress dependencies
9-
*/
103
import { forwardRef } from '@wordpress/element';
11-
12-
/**
13-
* Internal dependencies
14-
*/
154
import type { EmptyStateRootProps } from './types';
165
import styles from './style.module.css';
176

packages/ui/src/empty-state/stories/index.story.tsx

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,5 @@
1-
/**
2-
* External dependencies
3-
*/
41
import type { Meta, StoryObj } from '@storybook/react-vite';
5-
6-
/**
7-
* WordPress dependencies
8-
*/
92
import { search } from '@wordpress/icons';
10-
11-
/**
12-
* Internal dependencies
13-
*/
143
import { Button, EmptyState } from '../..';
154

165
const meta: Meta< typeof EmptyState.Root > = {

packages/ui/src/empty-state/style.module.css

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,23 @@
66
flex-direction: column;
77
align-items: center;
88
text-align: center;
9-
gap: calc( 2 * var( --wpds-dimension-base ) );
9+
gap: var( --wpds-dimension-gap-xs );
1010
font-family: var( --wpds-font-family-body );
1111
color: var( --wpds-color-fg-content-neutral );
1212
text-wrap: balance;
1313
}
1414

1515
.visual {
1616
display: flex;
17-
margin-block-end: calc( 2 * var( --wpds-dimension-base ) );
17+
margin-block-end: var( --wpds-dimension-gap-xs );
1818
align-items: center;
1919
justify-content: center;
2020
color: var( --wpds-color-fg-content-neutral-weak );
2121
line-height: 1;
2222
}
2323

2424
.icon {
25-
padding: calc( 2 * var( --wpds-dimension-base ) );
25+
padding: var( --wpds-dimension-padding-surface-xs );
2626
border: 1px solid var( --wpds-color-stroke-surface-neutral-weak );
2727
border-radius: 50%;
2828
background-color: var( --wpds-color-bg-surface-neutral );
@@ -45,9 +45,9 @@
4545

4646
.actions {
4747
display: flex;
48-
margin-block-start: calc( 4 * var( --wpds-dimension-base ) );
48+
margin-block-start: var( --wpds-dimension-gap-md );
4949
flex-direction: column;
50-
gap: calc( 2 * var( --wpds-dimension-base ) );
50+
gap: var( --wpds-dimension-gap-xs );
5151
align-items: center;
5252

5353
@media ( min-width: 480px ) {

packages/ui/src/empty-state/test/actions.test.tsx

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,5 @@
1-
/**
2-
* External dependencies
3-
*/
41
import { render } from '@testing-library/react';
5-
6-
/**
7-
* WordPress dependencies
8-
*/
92
import { createRef } from '@wordpress/element';
10-
11-
/**
12-
* Internal dependencies
13-
*/
143
import { Actions } from '../index';
154
import { Button } from '../../button';
165

packages/ui/src/empty-state/test/description.test.tsx

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,5 @@
1-
/**
2-
* External dependencies
3-
*/
41
import { render } from '@testing-library/react';
5-
6-
/**
7-
* WordPress dependencies
8-
*/
92
import { createRef } from '@wordpress/element';
10-
11-
/**
12-
* Internal dependencies
13-
*/
143
import { Description } from '../index';
154

165
describe( 'EmptyState.Description', () => {

packages/ui/src/empty-state/test/icon.test.tsx

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,5 @@
1-
/**
2-
* External dependencies
3-
*/
41
import { render } from '@testing-library/react';
5-
6-
/**
7-
* WordPress dependencies
8-
*/
92
import { createRef } from '@wordpress/element';
10-
11-
/**
12-
* Internal dependencies
13-
*/
143
import { Icon } from '../index';
154

165
describe( 'EmptyState.Icon', () => {

0 commit comments

Comments
 (0)