-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Storybook: Add stories for BlockCard component (#67191)
* Doc: add story file for BlockCard * Refactor: Refactor `block-card` storybook * Refactor: Remove redundant doc comment * Refactor: `BlockCard` story docs * Refactor: `BlockCard` story docs Co-authored-by: Infinite-Null <ankitkumarshah@git.wordpress.org> Co-authored-by: t-hamano <wildworks@git.wordpress.org>
- Loading branch information
1 parent
c9c6830
commit 3159fa2
Showing
1 changed file
with
79 additions
and
0 deletions.
There are no files selected for viewing
79 changes: 79 additions & 0 deletions
79
packages/block-editor/src/components/block-card/stories/index.story.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
/** | ||
* WordPress dependencies | ||
*/ | ||
import { box, button, cog, paragraph } from '@wordpress/icons'; | ||
|
||
/** | ||
* Internal dependencies | ||
*/ | ||
import BlockCard from '../'; | ||
|
||
const meta = { | ||
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.', | ||
}, | ||
canvas: { sourceState: 'shown' }, | ||
}, | ||
}, | ||
argTypes: { | ||
title: { | ||
control: 'text', | ||
description: 'The title of the block.', | ||
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 of the block. This can be any of [WordPress Dashicons](https://developer.wordpress.org/resource/dashicons/), or a custom `svg` element.', | ||
table: { | ||
type: { summary: 'string | object' }, | ||
}, | ||
}, | ||
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' }, | ||
}, | ||
}, | ||
}, | ||
}; | ||
|
||
export default meta; | ||
|
||
export const Default = { | ||
args: { | ||
title: 'Paragraph', | ||
icon: paragraph, | ||
description: 'This is a paragraph block description.', | ||
name: 'Paragraph Block', | ||
}, | ||
}; |
3159fa2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Flaky tests detected in 3159fa2.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.
🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/12394788508
📝 Reported issues:
/test/e2e/specs/editor/blocks/navigation-frontend-interactivity.spec.js