Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Storybook: Add stories for BlockCard component #67191

Merged
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
/**
* WordPress dependencies
*/
import { box, button, cog, paragraph } from '@wordpress/icons';

/**
* Internal dependencies
*/
import BlockCard from '../';

export default {
t-hamano marked this conversation as resolved.
Show resolved Hide resolved
title: 'BlockEditor/BlockCard',
component: BlockCard,
parameters: {
docs: {
description: {
component:
'The `BlockCard` component allows to display a card which contains the title of a block, its icon and its description.',
t-hamano marked this conversation as resolved.
Show resolved Hide resolved
},
canvas: { sourceState: 'shown' },
},
},
argTypes: {
title: {
control: 'text',
description: 'The title of the block',
t-hamano marked this conversation as resolved.
Show resolved Hide resolved
table: {
type: { summary: 'string' },
},
},
description: {
control: 'text',
description: 'A description of the block functionality',
table: {
type: { summary: 'string' },
},
},
icon: {
control: 'select',
options: [ 'paragraph', 'cog', 'box', 'button' ],
mapping: {
paragraph,
cog,
box,
button,
},
description: 'The icon to display for the block',
},
name: {
control: 'text',
description: 'Optional custom name for the block',
table: {
type: { summary: 'string' },
},
},
className: {
control: 'text',
description: 'Additional CSS class names',
table: {
type: { summary: 'string' },
},
},
},
};

/**
* Default story shows the basic BlockCard with title, icon, name and description.
*/
export const Default = {
t-hamano marked this conversation as resolved.
Show resolved Hide resolved
args: {
title: 'Paragraph',
icon: paragraph,
description: 'This is a paragraph block description.',
name: 'Paragraph Block',
},
};
Loading