@automattic/vip-design-system 2.18.0 → 2.19.0
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/.storybook/preview-head.html +1 -0
- package/build/system/Badge/Badge.js +2 -1
- package/build/system/DescriptionList/DescriptionList.js +0 -1
- package/build/system/Form/Label.d.ts +1 -3
- package/build/system/Form/Label.js +1 -3
- package/build/system/Form/RadioBoxGroup.jsx +12 -1
- package/build/system/Form/RadioBoxGroup.stories.jsx +6 -1
- package/build/system/Heading/Heading.js +2 -3
- package/build/system/Heading/Heading.stories.js +15 -2
- package/build/system/Nav/styles/variants/menu.js +1 -2
- package/build/system/Notice/Notice.js +1 -1
- package/build/system/Pagination/Pagination.d.ts +10 -20
- package/build/system/Pagination/Pagination.js +50 -68
- package/build/system/Pagination/Pagination.stories.js +13 -11
- package/build/system/Pagination/Pagination.test.js +4 -4
- package/build/system/Pagination/PaginationLayout.d.ts +27 -0
- package/build/system/Pagination/PaginationLayout.js +63 -0
- package/build/system/Pagination/SimplePagination.d.ts +26 -0
- package/build/system/Pagination/SimplePagination.js +76 -0
- package/build/system/Pagination/SimplePagination.stories.d.ts +13 -0
- package/build/system/Pagination/SimplePagination.stories.js +130 -0
- package/build/system/Pagination/SimplePagination.test.d.ts +2 -0
- package/build/system/Pagination/SimplePagination.test.js +171 -0
- package/build/system/Pagination/index.d.ts +3 -1
- package/build/system/Pagination/index.js +2 -1
- package/build/system/Pagination/styles.js +1 -4
- package/build/system/Table/TableCell.js +1 -1
- package/build/system/Text/Text.js +0 -1
- package/build/system/Text/Text.stories.js +16 -13
- package/build/system/Toolbar/Logo.js +22 -6
- package/build/system/Wizard/Wizard.stories.js +11 -11
- package/build/system/Wizard/WizardStep.js +0 -2
- package/build/system/index.d.ts +2 -2
- package/build/system/index.js +2 -2
- package/build/system/theme/generated/valet-theme-dark.json +224 -227
- package/build/system/theme/generated/valet-theme-light.json +224 -227
- package/build/system/theme/getPropValue.js +3 -7
- package/build/system/theme/index.d.ts +20 -12
- package/build/system/theme/index.js +27 -20
- package/docs/SETUP.md +1 -1
- package/package.json +1 -1
- package/src/system/Badge/Badge.tsx +2 -1
- package/src/system/DescriptionList/DescriptionList.tsx +0 -1
- package/src/system/Form/Label.tsx +1 -3
- package/src/system/Form/RadioBoxGroup.jsx +12 -1
- package/src/system/Form/RadioBoxGroup.stories.jsx +6 -1
- package/src/system/Heading/Heading.stories.tsx +10 -1
- package/src/system/Heading/Heading.tsx +1 -2
- package/src/system/Nav/styles/variants/menu.ts +1 -2
- package/src/system/Notice/Notice.tsx +1 -1
- package/src/system/Pagination/Pagination.stories.tsx +13 -10
- package/src/system/Pagination/Pagination.test.tsx +4 -6
- package/src/system/Pagination/Pagination.tsx +36 -71
- package/src/system/Pagination/PaginationLayout.tsx +93 -0
- package/src/system/Pagination/SimplePagination.stories.tsx +127 -0
- package/src/system/Pagination/SimplePagination.test.tsx +120 -0
- package/src/system/Pagination/SimplePagination.tsx +97 -0
- package/src/system/Pagination/index.ts +3 -1
- package/src/system/Pagination/styles.ts +1 -4
- package/src/system/Table/TableCell.tsx +1 -1
- package/src/system/Text/Text.stories.tsx +7 -4
- package/src/system/Text/Text.tsx +0 -1
- package/src/system/Toolbar/Logo.tsx +19 -2
- package/src/system/Wizard/Wizard.stories.tsx +11 -11
- package/src/system/Wizard/WizardStep.tsx +0 -2
- package/src/system/index.ts +2 -1
- package/src/system/theme/generated/valet-theme-dark.json +224 -227
- package/src/system/theme/generated/valet-theme-light.json +224 -227
- package/src/system/theme/getPropValue.ts +1 -8
- package/src/system/theme/index.ts +33 -18
- package/tokens/valet-core/valet-core.json +39 -9
- package/tokens/valet-core/wpvip-product-core.json +88 -125
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
/** @jsxImportSource theme-ui */
|
|
2
|
+
|
|
3
|
+
import { useState } from 'react';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Internal dependencies
|
|
7
|
+
*/
|
|
8
|
+
import { SimplePagination } from './SimplePagination';
|
|
9
|
+
import { Badge } from '../Badge';
|
|
10
|
+
import { Flex } from '../Flex';
|
|
11
|
+
import { Text } from '../Text';
|
|
12
|
+
|
|
13
|
+
import type { StoryObj, Meta } from '@storybook/react-vite';
|
|
14
|
+
|
|
15
|
+
const meta: Meta< typeof SimplePagination > = {
|
|
16
|
+
title: 'SimplePagination',
|
|
17
|
+
component: SimplePagination,
|
|
18
|
+
parameters: {
|
|
19
|
+
docs: {
|
|
20
|
+
description: {
|
|
21
|
+
component: `
|
|
22
|
+
A pagination control with only previous/next arrow buttons.
|
|
23
|
+
Designed for cursor-based pagination APIs with custom param names (e.g., \`after\`/\`before\`).
|
|
24
|
+
|
|
25
|
+
For page-number based pagination, see \`Pagination\`.
|
|
26
|
+
|
|
27
|
+
## Component Properties
|
|
28
|
+
`,
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export default meta;
|
|
35
|
+
|
|
36
|
+
type Story = StoryObj< typeof SimplePagination >;
|
|
37
|
+
|
|
38
|
+
const pageTokens = [ 'start', 'abc123', 'def456', 'ghi789', 'jkl012', 'end' ];
|
|
39
|
+
|
|
40
|
+
const SimplePaginationWithState = ( {
|
|
41
|
+
initialIndex = 0,
|
|
42
|
+
displayItemsPerPageSelector = false,
|
|
43
|
+
}: {
|
|
44
|
+
initialIndex?: number;
|
|
45
|
+
displayItemsPerPageSelector?: boolean;
|
|
46
|
+
} ) => {
|
|
47
|
+
const [ index, setIndex ] = useState( initialIndex );
|
|
48
|
+
const [ itemsPerPage, setItemsPerPage ] = useState( 20 );
|
|
49
|
+
|
|
50
|
+
const hasPreviousPage = index > 0;
|
|
51
|
+
const hasNextPage = index < pageTokens.length - 1;
|
|
52
|
+
|
|
53
|
+
return (
|
|
54
|
+
<SimplePagination
|
|
55
|
+
hasNextPage={ hasNextPage }
|
|
56
|
+
hasPreviousPage={ hasPreviousPage }
|
|
57
|
+
nextParam={ hasNextPage ? { param: 'after', value: pageTokens[ index + 1 ] } : undefined }
|
|
58
|
+
previousParam={
|
|
59
|
+
hasPreviousPage ? { param: 'before', value: pageTokens[ index ] } : undefined
|
|
60
|
+
}
|
|
61
|
+
onNavigate={ param => {
|
|
62
|
+
if ( param === 'after' ) {
|
|
63
|
+
setIndex( i => i + 1 );
|
|
64
|
+
}
|
|
65
|
+
if ( param === 'before' ) {
|
|
66
|
+
setIndex( i => i - 1 );
|
|
67
|
+
}
|
|
68
|
+
} }
|
|
69
|
+
displayItemsPerPageSelector={ displayItemsPerPageSelector }
|
|
70
|
+
itemsPerPage={ displayItemsPerPageSelector ? itemsPerPage : undefined }
|
|
71
|
+
onItemsPerPageChange={
|
|
72
|
+
displayItemsPerPageSelector
|
|
73
|
+
? size => {
|
|
74
|
+
setItemsPerPage( size );
|
|
75
|
+
setIndex( 0 );
|
|
76
|
+
}
|
|
77
|
+
: undefined
|
|
78
|
+
}
|
|
79
|
+
>
|
|
80
|
+
<Flex sx={ { justifyContent: 'center', alignItems: 'center', verticalAlign: 'middle' } }>
|
|
81
|
+
<Badge variant="gold" sx={ { mr: 2 } }>
|
|
82
|
+
DEBUG
|
|
83
|
+
</Badge>
|
|
84
|
+
<Text>
|
|
85
|
+
Index: { index } — token: { pageTokens[ index ] }
|
|
86
|
+
</Text>
|
|
87
|
+
</Flex>
|
|
88
|
+
</SimplePagination>
|
|
89
|
+
);
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
export const Default: Story = {
|
|
93
|
+
render: () => <SimplePaginationWithState />,
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
export const FirstPage: Story = {
|
|
97
|
+
render: () => <SimplePaginationWithState />,
|
|
98
|
+
parameters: {
|
|
99
|
+
docs: {
|
|
100
|
+
description: {
|
|
101
|
+
story: 'On the first page — Previous button is disabled.',
|
|
102
|
+
},
|
|
103
|
+
},
|
|
104
|
+
},
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
export const LastPage: Story = {
|
|
108
|
+
render: () => <SimplePaginationWithState initialIndex={ pageTokens.length - 1 } />,
|
|
109
|
+
parameters: {
|
|
110
|
+
docs: {
|
|
111
|
+
description: {
|
|
112
|
+
story: 'On the last page — Next button is disabled.',
|
|
113
|
+
},
|
|
114
|
+
},
|
|
115
|
+
},
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
export const WithPageSize: Story = {
|
|
119
|
+
render: () => <SimplePaginationWithState displayItemsPerPageSelector />,
|
|
120
|
+
parameters: {
|
|
121
|
+
docs: {
|
|
122
|
+
description: {
|
|
123
|
+
story: 'With an items-per-page selector.',
|
|
124
|
+
},
|
|
125
|
+
},
|
|
126
|
+
},
|
|
127
|
+
};
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
/** @jsxImportSource theme-ui */
|
|
2
|
+
|
|
3
|
+
import { render, screen } from '@testing-library/react';
|
|
4
|
+
import userEvent from '@testing-library/user-event';
|
|
5
|
+
import { axe } from 'jest-axe';
|
|
6
|
+
import '@testing-library/jest-dom';
|
|
7
|
+
|
|
8
|
+
import { SimplePagination } from './SimplePagination';
|
|
9
|
+
|
|
10
|
+
const defaultProps = {
|
|
11
|
+
hasNextPage: true,
|
|
12
|
+
hasPreviousPage: true,
|
|
13
|
+
nextParam: { param: 'after', value: 'cursor_abc' },
|
|
14
|
+
previousParam: { param: 'before', value: 'cursor_xyz' },
|
|
15
|
+
onNavigate: jest.fn(),
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
describe( '<SimplePagination />', () => {
|
|
19
|
+
beforeEach( () => {
|
|
20
|
+
jest.clearAllMocks();
|
|
21
|
+
} );
|
|
22
|
+
|
|
23
|
+
it( 'renders a nav landmark with aria-label', () => {
|
|
24
|
+
render( <SimplePagination { ...defaultProps } /> );
|
|
25
|
+
|
|
26
|
+
expect( screen.getByRole( 'navigation', { name: 'Pagination' } ) ).toBeInTheDocument();
|
|
27
|
+
} );
|
|
28
|
+
|
|
29
|
+
it( 'renders prev and next arrow buttons', () => {
|
|
30
|
+
render( <SimplePagination { ...defaultProps } /> );
|
|
31
|
+
|
|
32
|
+
expect( screen.getByRole( 'button', { name: 'Previous page' } ) ).toBeInTheDocument();
|
|
33
|
+
expect( screen.getByRole( 'button', { name: 'Next page' } ) ).toBeInTheDocument();
|
|
34
|
+
} );
|
|
35
|
+
|
|
36
|
+
it( 'does not render page number buttons', () => {
|
|
37
|
+
render( <SimplePagination { ...defaultProps } /> );
|
|
38
|
+
|
|
39
|
+
expect( screen.queryByRole( 'button', { name: /Go to page/ } ) ).not.toBeInTheDocument();
|
|
40
|
+
} );
|
|
41
|
+
|
|
42
|
+
it( 'disables previous button when hasPreviousPage is false', () => {
|
|
43
|
+
render( <SimplePagination { ...defaultProps } hasPreviousPage={ false } /> );
|
|
44
|
+
|
|
45
|
+
expect( screen.getByRole( 'button', { name: 'Previous page' } ) ).toBeDisabled();
|
|
46
|
+
} );
|
|
47
|
+
|
|
48
|
+
it( 'disables next button when hasNextPage is false', () => {
|
|
49
|
+
render( <SimplePagination { ...defaultProps } hasNextPage={ false } /> );
|
|
50
|
+
|
|
51
|
+
expect( screen.getByRole( 'button', { name: 'Next page' } ) ).toBeDisabled();
|
|
52
|
+
} );
|
|
53
|
+
|
|
54
|
+
it( 'disables previous button when previousParam is undefined', () => {
|
|
55
|
+
render( <SimplePagination { ...defaultProps } previousParam={ undefined } /> );
|
|
56
|
+
|
|
57
|
+
expect( screen.getByRole( 'button', { name: 'Previous page' } ) ).toBeDisabled();
|
|
58
|
+
} );
|
|
59
|
+
|
|
60
|
+
it( 'disables next button when nextParam is undefined', () => {
|
|
61
|
+
render( <SimplePagination { ...defaultProps } nextParam={ undefined } /> );
|
|
62
|
+
|
|
63
|
+
expect( screen.getByRole( 'button', { name: 'Next page' } ) ).toBeDisabled();
|
|
64
|
+
} );
|
|
65
|
+
|
|
66
|
+
it( 'calls onNavigate with correct param and value when clicking next', async () => {
|
|
67
|
+
const user = userEvent.setup();
|
|
68
|
+
render( <SimplePagination { ...defaultProps } /> );
|
|
69
|
+
|
|
70
|
+
await user.click( screen.getByRole( 'button', { name: 'Next page' } ) );
|
|
71
|
+
|
|
72
|
+
expect( defaultProps.onNavigate ).toHaveBeenCalledWith( 'after', 'cursor_abc' );
|
|
73
|
+
} );
|
|
74
|
+
|
|
75
|
+
it( 'calls onNavigate with correct param and value when clicking previous', async () => {
|
|
76
|
+
const user = userEvent.setup();
|
|
77
|
+
render( <SimplePagination { ...defaultProps } /> );
|
|
78
|
+
|
|
79
|
+
await user.click( screen.getByRole( 'button', { name: 'Previous page' } ) );
|
|
80
|
+
|
|
81
|
+
expect( defaultProps.onNavigate ).toHaveBeenCalledWith( 'before', 'cursor_xyz' );
|
|
82
|
+
} );
|
|
83
|
+
|
|
84
|
+
it( 'renders children content', () => {
|
|
85
|
+
render(
|
|
86
|
+
<SimplePagination { ...defaultProps }>
|
|
87
|
+
<span>Showing results</span>
|
|
88
|
+
</SimplePagination>
|
|
89
|
+
);
|
|
90
|
+
|
|
91
|
+
expect( screen.getByText( 'Showing results' ) ).toBeInTheDocument();
|
|
92
|
+
} );
|
|
93
|
+
|
|
94
|
+
it( 'renders items-per-page selector when enabled', () => {
|
|
95
|
+
render(
|
|
96
|
+
<SimplePagination
|
|
97
|
+
{ ...defaultProps }
|
|
98
|
+
displayItemsPerPageSelector
|
|
99
|
+
itemsPerPage={ 20 }
|
|
100
|
+
onItemsPerPageChange={ jest.fn() }
|
|
101
|
+
/>
|
|
102
|
+
);
|
|
103
|
+
|
|
104
|
+
expect( screen.getByRole( 'combobox' ) ).toBeInTheDocument();
|
|
105
|
+
} );
|
|
106
|
+
|
|
107
|
+
it( 'has no accessibility violations', async () => {
|
|
108
|
+
const { container } = render( <SimplePagination { ...defaultProps } /> );
|
|
109
|
+
|
|
110
|
+
expect( await axe( container ) ).toHaveNoViolations();
|
|
111
|
+
} );
|
|
112
|
+
|
|
113
|
+
it( 'has no accessibility violations with both buttons disabled', async () => {
|
|
114
|
+
const { container } = render(
|
|
115
|
+
<SimplePagination { ...defaultProps } hasNextPage={ false } hasPreviousPage={ false } />
|
|
116
|
+
);
|
|
117
|
+
|
|
118
|
+
expect( await axe( container ) ).toHaveNoViolations();
|
|
119
|
+
} );
|
|
120
|
+
} );
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
/** @jsxImportSource theme-ui */
|
|
2
|
+
|
|
3
|
+
import { forwardRef } from 'react';
|
|
4
|
+
import { MdChevronLeft, MdChevronRight } from 'react-icons/md';
|
|
5
|
+
import { Flex } from 'theme-ui';
|
|
6
|
+
|
|
7
|
+
import { PaginationLayout, PaginationLayoutProps } from './PaginationLayout';
|
|
8
|
+
import { navigationStyles, arrowButtonStyles } from './styles';
|
|
9
|
+
import { Box } from '../Box';
|
|
10
|
+
import { Button } from '../Button';
|
|
11
|
+
|
|
12
|
+
/** A navigation parameter for SimplePagination. */
|
|
13
|
+
export interface SimpleNavigationParam {
|
|
14
|
+
/** The query parameter name (e.g., 'after', 'before'). */
|
|
15
|
+
param: string;
|
|
16
|
+
/** The parameter token value. */
|
|
17
|
+
value: string;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export interface SimplePaginationProps extends PaginationLayoutProps {
|
|
21
|
+
/** Whether there is a next page available. */
|
|
22
|
+
hasNextPage?: boolean;
|
|
23
|
+
/** Whether there is a previous page available. */
|
|
24
|
+
hasPreviousPage?: boolean;
|
|
25
|
+
/** Navigation parameter for the next page. */
|
|
26
|
+
nextParam?: SimpleNavigationParam;
|
|
27
|
+
/** Navigation parameter for the previous page. */
|
|
28
|
+
previousParam?: SimpleNavigationParam;
|
|
29
|
+
/** Callback fired when the user navigates. Receives the param name and value. */
|
|
30
|
+
onNavigate: ( param: string, value: string ) => void;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* A pagination control with only previous/next arrow buttons.
|
|
35
|
+
* Designed for cursor-based pagination APIs with custom param names (e.g., `after`/`before`).
|
|
36
|
+
*/
|
|
37
|
+
export const SimplePagination = forwardRef< HTMLElement, SimplePaginationProps >(
|
|
38
|
+
(
|
|
39
|
+
{
|
|
40
|
+
hasNextPage,
|
|
41
|
+
hasPreviousPage,
|
|
42
|
+
nextParam,
|
|
43
|
+
previousParam,
|
|
44
|
+
onNavigate,
|
|
45
|
+
displayItemsPerPageSelector,
|
|
46
|
+
itemsPerPage,
|
|
47
|
+
pageSizeOptions,
|
|
48
|
+
onItemsPerPageChange,
|
|
49
|
+
className,
|
|
50
|
+
sx,
|
|
51
|
+
children,
|
|
52
|
+
...rest
|
|
53
|
+
},
|
|
54
|
+
ref
|
|
55
|
+
) => {
|
|
56
|
+
const isPrevDisabled = ! hasPreviousPage || ! previousParam?.value;
|
|
57
|
+
const isNextDisabled = ! hasNextPage || ! nextParam?.value;
|
|
58
|
+
|
|
59
|
+
return (
|
|
60
|
+
<PaginationLayout
|
|
61
|
+
ref={ ref }
|
|
62
|
+
displayItemsPerPageSelector={ displayItemsPerPageSelector }
|
|
63
|
+
itemsPerPage={ itemsPerPage }
|
|
64
|
+
pageSizeOptions={ pageSizeOptions }
|
|
65
|
+
onItemsPerPageChange={ onItemsPerPageChange }
|
|
66
|
+
className={ className }
|
|
67
|
+
sx={ sx }
|
|
68
|
+
{ ...rest }
|
|
69
|
+
>
|
|
70
|
+
<Box sx={ { flex: 1 } }>{ children }</Box>
|
|
71
|
+
<Flex sx={ navigationStyles }>
|
|
72
|
+
<Button
|
|
73
|
+
aria-label="Previous page"
|
|
74
|
+
disabled={ isPrevDisabled }
|
|
75
|
+
onClick={ () =>
|
|
76
|
+
previousParam && onNavigate( previousParam.param, previousParam.value )
|
|
77
|
+
}
|
|
78
|
+
sx={ arrowButtonStyles }
|
|
79
|
+
>
|
|
80
|
+
<MdChevronLeft size={ 20 } />
|
|
81
|
+
</Button>
|
|
82
|
+
|
|
83
|
+
<Button
|
|
84
|
+
aria-label="Next page"
|
|
85
|
+
disabled={ isNextDisabled }
|
|
86
|
+
onClick={ () => nextParam && onNavigate( nextParam.param, nextParam.value ) }
|
|
87
|
+
sx={ arrowButtonStyles }
|
|
88
|
+
>
|
|
89
|
+
<MdChevronRight size={ 20 } />
|
|
90
|
+
</Button>
|
|
91
|
+
</Flex>
|
|
92
|
+
</PaginationLayout>
|
|
93
|
+
);
|
|
94
|
+
}
|
|
95
|
+
);
|
|
96
|
+
|
|
97
|
+
SimplePagination.displayName = 'SimplePagination';
|
|
@@ -1,2 +1,4 @@
|
|
|
1
1
|
export { Pagination, getPageNumbers } from './Pagination';
|
|
2
|
-
export
|
|
2
|
+
export { SimplePagination } from './SimplePagination';
|
|
3
|
+
export type { PaginationProps, PageNumberItem } from './Pagination';
|
|
4
|
+
export type { SimplePaginationProps, SimpleNavigationParam } from './SimplePagination';
|
|
@@ -26,8 +26,7 @@ export const pageButtonStyles: ThemeUIStyleObject = {
|
|
|
26
26
|
bg: 'transparent',
|
|
27
27
|
color: 'heading',
|
|
28
28
|
cursor: 'pointer',
|
|
29
|
-
|
|
30
|
-
fontFamily: 'body',
|
|
29
|
+
variant: 'text.default',
|
|
31
30
|
px: 2,
|
|
32
31
|
borderBottom: '3px solid',
|
|
33
32
|
borderColor: 'transparent',
|
|
@@ -89,8 +88,6 @@ export const compactTriggerStyles: ThemeUIStyleObject = {
|
|
|
89
88
|
bg: 'transparent',
|
|
90
89
|
color: 'heading',
|
|
91
90
|
cursor: 'pointer',
|
|
92
|
-
fontSize: 2,
|
|
93
|
-
fontFamily: 'body',
|
|
94
91
|
fontWeight: 'bold',
|
|
95
92
|
px: 2,
|
|
96
93
|
borderRadius: 1,
|
|
@@ -31,7 +31,7 @@ export const TableCell = ( { children, head, sx, ...rest }: TableCellProps ) =>
|
|
|
31
31
|
borderTop: head ? '1px solid' : 'none',
|
|
32
32
|
// borderColor should come after borderTop so it can override it
|
|
33
33
|
borderColor: 'table.border',
|
|
34
|
-
|
|
34
|
+
variant: 'text.default',
|
|
35
35
|
px: 3,
|
|
36
36
|
py: 2,
|
|
37
37
|
textAlign: 'left',
|
|
@@ -33,16 +33,19 @@ export const Default: Story = {
|
|
|
33
33
|
with silver.{ ' ' }
|
|
34
34
|
</Text>
|
|
35
35
|
|
|
36
|
-
<Text
|
|
36
|
+
<Text variant="default">Body Default</Text>
|
|
37
|
+
<Text variant="small">Body Small</Text>
|
|
38
|
+
<Text variant="large">Body Large</Text>
|
|
39
|
+
<Text variant="mono">Body Mono</Text>
|
|
40
|
+
<Text variant="mono-bold">Body Mono Bold</Text>
|
|
37
41
|
|
|
42
|
+
<Text sx={ { color: 'texts.accent' } }>Text Accent</Text>
|
|
38
43
|
<Text sx={ { color: 'texts.helper' } }>Text Helper</Text>
|
|
39
44
|
|
|
40
|
-
<Text sx={ { color: 'texts.helper', fontWeight: '
|
|
41
|
-
<Text sx={ { color: 'texts.helper', fontWeight: 'heading' } }>Text Helper</Text>
|
|
45
|
+
<Text sx={ { color: 'texts.helper', fontWeight: 'light' } }>Text Helper</Text>
|
|
42
46
|
<Text sx={ { color: 'texts.helper', fontWeight: 'regular' } }>Text Helper</Text>
|
|
43
47
|
<Text sx={ { color: 'texts.helper', fontWeight: 'medium' } }>Text Helper</Text>
|
|
44
48
|
<Text sx={ { color: 'texts.helper', fontWeight: 'bold' } }>Text Helper</Text>
|
|
45
|
-
<Text sx={ { color: 'texts.helper', fontWeight: 'light' } }>Text Helper</Text>
|
|
46
49
|
|
|
47
50
|
<Text sx={ { color: 'texts.secondary' } }>Text Secondary</Text>
|
|
48
51
|
|
package/src/system/Text/Text.tsx
CHANGED
|
@@ -37,11 +37,28 @@ export const Logo = ( { className, as = 'a', href }: LogoProps ) => (
|
|
|
37
37
|
<svg
|
|
38
38
|
className={ classNames( VIP_LOGO, className ) }
|
|
39
39
|
xmlns="http://www.w3.org/2000/svg"
|
|
40
|
-
viewBox="0 0
|
|
40
|
+
viewBox="0 0 393.6 176.6"
|
|
41
41
|
role="img"
|
|
42
42
|
aria-label="WordPress VIP Logo"
|
|
43
|
+
sx={ {
|
|
44
|
+
display: 'block',
|
|
45
|
+
width: '100%',
|
|
46
|
+
height: 'auto',
|
|
47
|
+
} }
|
|
43
48
|
>
|
|
44
|
-
<path
|
|
49
|
+
<path
|
|
50
|
+
fill="currentColor"
|
|
51
|
+
d="m88.3,0C39.6,0,0,39.6,0,88.3s39.6,88.3,88.3,88.3,88.3-39.5,88.3-88.3S137.1,0,88.3,0ZM8.8,88.3c0-11.5,2.5-22.5,6.8-32.4l37.8,103.8c-26-13-44.6-39.9-44.6-71.4Zm79.5,79.5c-7.7,0-15.3-1.1-22.5-3.2l23.7-69.2,24.4,66.9c.2.4.4.7.5,1.1-8.1,2.8-16.7,4.4-26.1,4.4Zm11-116.8c4.8-.4,9-.7,9-.7,4.1-.5,3.8-6.8-.5-6.5,0,0-13,.9-21.2.9-7.7,0-20.9-.9-20.9-.9-4.1-.4-4.8,6.3-.5,6.5,0,0,4.1.5,8.3.7l12.2,34-17.2,52-28.6-86c4.8-.4,9-.7,9-.7,4.1-.5,3.8-6.8-.5-6.5,0,0-13,.9-21.2.9-1.6,0-3.2,0-5.2-.2C36.1,23,60.5,8.8,88.2,8.8c20.7,0,39.5,7.9,53.6,20.9h-1.1c-7.7,0-13.3,6.8-13.3,14.2,0,6.5,3.8,12.2,7.7,18.7,2.9,5.2,6.5,12.2,6.5,21.9,0,6.8-2,15.5-6.1,25.7l-7.9,26.3-28.3-85.5Zm29.2,106l24.3-70.1c4.5-11.3,6.1-20.3,6.1-28.4,0-2.9-.2-5.5-.5-8.1,6.3,11.3,9.7,24.3,9.7,38.1-.3,29.1-16.3,54.8-39.6,68.5Z"
|
|
52
|
+
/>
|
|
53
|
+
<path
|
|
54
|
+
fill="currentColor"
|
|
55
|
+
d="m323.7,39.2h33.4c7.2,0,13.1.9,17.8,2.5,4.7,1.6,8.5,3.8,11.1,6.5,2.9,2.7,4.7,5.8,5.8,9.3,1.1,3.4,1.8,7.2,1.8,11,0,4.1-.5,8.1-1.8,11.9-1.1,3.8-3.1,7-5.8,10.1-2.7,2.9-6.5,5.1-11,6.6-4.5,1.6-10.4,2.5-17.5,2.5h-14.7v33.4h-19.2V39.2h.1Zm33.3,44.1c3.4,0,6.3-.4,8.5-1.1,2.4-.7,4.1-1.6,5.4-2.9,1.3-1.3,2.1-2.7,2.7-4.5.5-1.8.7-3.8.7-5.9s-.2-4.1-.7-5.8c-.5-1.6-1.4-3.1-2.7-4.1-1.3-1.1-3.1-2-5.4-2.7-2.1-.5-5.1-.9-8.5-.9h-14v27.8h14v.1Z"
|
|
56
|
+
/>
|
|
57
|
+
<path
|
|
58
|
+
fill="currentColor"
|
|
59
|
+
d="m197.5,39.2h21.9l22.8,66.3,23.4-66.3h21l-35.3,93.9h-18.5l-35.3-93.9Z"
|
|
60
|
+
/>
|
|
61
|
+
<path fill="currentColor" fillRule="evenodd" d="m311,39.2h-13.3l-6.3,16.9v76.9h19.6V39.2Z" />
|
|
45
62
|
</svg>
|
|
46
63
|
</Link>
|
|
47
64
|
);
|
|
@@ -30,18 +30,18 @@ export const Primary: Story = {
|
|
|
30
30
|
steps: [
|
|
31
31
|
{
|
|
32
32
|
title: 'Step One',
|
|
33
|
-
titleVariant: '
|
|
33
|
+
titleVariant: 'h3',
|
|
34
34
|
subTitle: 'First step description.',
|
|
35
35
|
children: 'Step one content',
|
|
36
36
|
},
|
|
37
37
|
{
|
|
38
38
|
title: 'Step Two',
|
|
39
|
-
titleVariant: '
|
|
39
|
+
titleVariant: 'h3',
|
|
40
40
|
subTitle: 'Second step description.',
|
|
41
41
|
},
|
|
42
42
|
{
|
|
43
43
|
title: 'Step Three',
|
|
44
|
-
titleVariant: '
|
|
44
|
+
titleVariant: 'h3',
|
|
45
45
|
},
|
|
46
46
|
],
|
|
47
47
|
},
|
|
@@ -52,7 +52,7 @@ export const Default: Story = {
|
|
|
52
52
|
const steps: WizardStepProps[] = [
|
|
53
53
|
{
|
|
54
54
|
title: 'Choose Domain',
|
|
55
|
-
titleVariant: '
|
|
55
|
+
titleVariant: 'h3',
|
|
56
56
|
subTitle: 'You can bring a domain name you already own, or buy a new one.',
|
|
57
57
|
children: (
|
|
58
58
|
<Box>
|
|
@@ -64,16 +64,16 @@ export const Default: Story = {
|
|
|
64
64
|
},
|
|
65
65
|
{
|
|
66
66
|
title: 'Configure DNS',
|
|
67
|
-
titleVariant: '
|
|
67
|
+
titleVariant: 'h3',
|
|
68
68
|
summaryTitle: 'Summary of Configure DNS',
|
|
69
69
|
},
|
|
70
70
|
{
|
|
71
71
|
title: 'Configure Certificate',
|
|
72
|
-
titleVariant: '
|
|
72
|
+
titleVariant: 'h3',
|
|
73
73
|
},
|
|
74
74
|
{
|
|
75
75
|
title: 'Verify Domain',
|
|
76
|
-
titleVariant: '
|
|
76
|
+
titleVariant: 'h3',
|
|
77
77
|
},
|
|
78
78
|
];
|
|
79
79
|
return (
|
|
@@ -99,7 +99,7 @@ export const WithTitleAutoFocus: Story = {
|
|
|
99
99
|
const steps: WizardStepProps[] = [
|
|
100
100
|
{
|
|
101
101
|
title: 'Choose Domain',
|
|
102
|
-
titleVariant: '
|
|
102
|
+
titleVariant: 'h3',
|
|
103
103
|
summary: [
|
|
104
104
|
{
|
|
105
105
|
label: 'Demo Label',
|
|
@@ -119,7 +119,7 @@ export const WithTitleAutoFocus: Story = {
|
|
|
119
119
|
},
|
|
120
120
|
{
|
|
121
121
|
title: 'Configure DNS',
|
|
122
|
-
titleVariant: '
|
|
122
|
+
titleVariant: 'h3',
|
|
123
123
|
onChange: () => setActiveStep( 1 ),
|
|
124
124
|
actionLabel: 'Edit',
|
|
125
125
|
actionDisabled: true,
|
|
@@ -136,7 +136,7 @@ export const WithTitleAutoFocus: Story = {
|
|
|
136
136
|
|
|
137
137
|
{
|
|
138
138
|
title: 'Certificate',
|
|
139
|
-
titleVariant: '
|
|
139
|
+
titleVariant: 'h3',
|
|
140
140
|
summary: [
|
|
141
141
|
{
|
|
142
142
|
label: 'Certificate status',
|
|
@@ -192,7 +192,7 @@ export const HideStepText: Story = {
|
|
|
192
192
|
const steps: WizardStepProps[] = [
|
|
193
193
|
{
|
|
194
194
|
title: 'Included Logs',
|
|
195
|
-
titleVariant: '
|
|
195
|
+
titleVariant: 'h3',
|
|
196
196
|
subTitle: '',
|
|
197
197
|
children: <Text sx={ { mb: 0 } }>Error Logs</Text>,
|
|
198
198
|
onChange: () => {
|
package/src/system/index.ts
CHANGED
|
@@ -50,7 +50,7 @@ import * as Form from './NewForm';
|
|
|
50
50
|
import { NewTooltip } from './NewTooltip';
|
|
51
51
|
import { Notice } from './Notice';
|
|
52
52
|
import { OptionRow } from './OptionRow';
|
|
53
|
-
import { Pagination } from './Pagination';
|
|
53
|
+
import { SimplePagination, Pagination } from './Pagination';
|
|
54
54
|
import { Progress } from './Progress';
|
|
55
55
|
import { ScreenReaderText } from './ScreenReaderText';
|
|
56
56
|
import { Skeleton } from './Skeleton';
|
|
@@ -99,6 +99,7 @@ export {
|
|
|
99
99
|
Flex,
|
|
100
100
|
Notice,
|
|
101
101
|
OptionRow,
|
|
102
|
+
SimplePagination,
|
|
102
103
|
Pagination,
|
|
103
104
|
Heading,
|
|
104
105
|
Hr,
|