File size: 2,247 Bytes
1e92f2d | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 | import SummaryButton from '@automattic/components/src/summary-button';
import { Meta, StoryObj } from '@storybook/react';
import { Icon } from '@wordpress/components';
import { brush, home, seen } from '@wordpress/icons';
import { SummaryButtonList } from './';
const meta: Meta< typeof SummaryButtonList > = {
title: 'client/dashboard/SummaryButtonList',
component: SummaryButtonList,
tags: [ 'autodocs' ],
parameters: {
actions: { argTypesRegex: '^on.*' },
},
decorators: [
( Story ) => (
<div style={ { maxWidth: '600px', margin: '0 auto' } }>
<Story />
</div>
),
],
};
export default meta;
type Story = StoryObj< typeof SummaryButtonList >;
export const Default: Story = {
args: {
title: 'General Settings',
children: [
<SummaryButton
key="visibility"
title="Site visibility"
decoration={ <Icon icon={ seen } /> }
badges={ [ { text: 'Public', intent: 'success' } ] }
/>,
<SummaryButton
key="theme"
title="Theme"
decoration={ <Icon icon={ brush } /> }
badges={ [ { text: 'Twenty Twenty-Four' } ] }
/>,
<SummaryButton
key="home"
title="Homepage settings"
decoration={ <Icon icon={ home } /> }
badges={ [ { text: 'Latest posts' } ] }
/>,
],
},
};
export const WithDescription: Story = {
args: {
...Default.args,
description: 'Configure the basic settings for your site',
},
};
export const LowDensity: Story = {
args: {
...Default.args,
density: 'low',
},
};
export const WithDescriptionsInButtons: Story = {
args: {
title: 'General Settings',
density: 'low',
children: [
<SummaryButton
key="visibility"
title="Site visibility"
description="Control who can see your site"
decoration={ <Icon icon={ seen } /> }
badges={ [ { text: 'Public', intent: 'success' } ] }
/>,
<SummaryButton
key="theme"
title="Theme"
description="Change the look and feel of your site"
decoration={ <Icon icon={ brush } /> }
badges={ [ { text: 'Twenty Twenty-Four' } ] }
/>,
<SummaryButton
key="home"
title="Homepage settings"
description="Choose what appears on your homepage"
decoration={ <Icon icon={ home } /> }
badges={ [ { text: 'Latest posts' } ] }
/>,
],
},
};
|