-
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 Block Canvas Component
- Loading branch information
Showing
1 changed file
with
59 additions
and
0 deletions.
There are no files selected for viewing
59 changes: 59 additions & 0 deletions
59
packages/block-editor/src/components/block-canvas/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,59 @@ | ||
/** | ||
* Internal dependencies | ||
*/ | ||
import { BlockCanvas, BlockList } from '../..'; | ||
|
||
const meta = { | ||
title: 'BlockEditor/BlockCanvas', | ||
component: BlockCanvas, | ||
parameters: { | ||
docs: { | ||
canvas: { sourceState: 'shown' }, | ||
description: { | ||
component: | ||
'The BlockCanvas component is used to render the canvas for the block editor.', | ||
}, | ||
}, | ||
}, | ||
argTypes: { | ||
children: { | ||
control: false, // Disable direct control for `children` as it defaults to `BlockList` | ||
description: 'The children to render in the canvas.', | ||
table: { | ||
type: { summary: 'node' }, | ||
defaultValue: { summary: 'BlockList' }, | ||
}, | ||
}, | ||
height: { | ||
control: 'text', | ||
description: 'The height of the canvas.', | ||
table: { | ||
type: { summary: 'string' }, | ||
defaultValue: { summary: '300px' }, | ||
}, | ||
}, | ||
styles: { | ||
control: 'object', | ||
description: 'The styles to apply to the canvas.', | ||
table: { | ||
type: { summary: 'object' }, | ||
}, | ||
}, | ||
}, | ||
}; | ||
|
||
export default meta; | ||
|
||
export const Default = { | ||
args: { | ||
height: '300px', | ||
styles: { | ||
border: '1px solid #ccc', | ||
backgroundColor: '#f9f9f9', | ||
}, | ||
children: <BlockList />, // Default `children` is `BlockList` | ||
}, | ||
render: function Template( args ) { | ||
return <BlockCanvas { ...args } />; | ||
}, | ||
}; |