From e5f2ef20868c43c5d02772ee01a19c22de0b5595 Mon Sep 17 00:00:00 2001 From: im3dabasia Date: Fri, 22 Nov 2024 15:17:35 +0530 Subject: [PATCH] Doc: Add Storybook story for BlockFullHeightAlignmentControl component --- .../stories/index.story.js | 54 +++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 packages/block-editor/src/components/block-full-height-alignment-control/stories/index.story.js diff --git a/packages/block-editor/src/components/block-full-height-alignment-control/stories/index.story.js b/packages/block-editor/src/components/block-full-height-alignment-control/stories/index.story.js new file mode 100644 index 00000000000000..5ed1d36f89827c --- /dev/null +++ b/packages/block-editor/src/components/block-full-height-alignment-control/stories/index.story.js @@ -0,0 +1,54 @@ +/** + * WordPress dependencies + */ +import { registerCoreBlocks } from '@wordpress/block-library'; + +/** + * Internal dependencies + */ +import BlockFullHeightAlignmentControl from '../'; + +/** + * Registers core blocks for demonstration purposes. + */ +registerCoreBlocks(); + +/** + * BlockFullHeightAlignmentControl component renders a toolbar button for toggling full height alignment. + */ +const meta = { + title: 'BlockEditor/BlockFullHeightAlignmentControl', + component: BlockFullHeightAlignmentControl, + parameters: { + docs: { canvas: { sourceState: 'shown' } }, + }, + argTypes: { + isActive: { + control: 'boolean', + description: 'Whether the full height alignment is active.', + }, + label: { + control: 'text', + description: 'Label for the button in the toolbar.', + }, + onToggle: { + action: 'onToggle', + description: + 'Callback function to toggle the active state of the button.', + }, + isDisabled: { + control: 'boolean', + description: 'Whether the button is disabled.', + }, + }, +}; +export default meta; + +/** + * Default story showing BlockFullHeightAlignmentControl with active state. + */ +export const Default = { + args: { + isActive: true, + }, +};