From 50d2e061777526d3fe0a3196ddee5a0b855be58d Mon Sep 17 00:00:00 2001 From: Eshaan Dabasiya <76681468+im3dabasia@users.noreply.github.com> Date: Sat, 4 Jan 2025 08:35:40 +0530 Subject: [PATCH] StoryBook: Add Story for ResolutionTool (#68292) * merge trunk into storybook/resolution-control * refactor: Add argtypes and description in meta Co-authored-by: im3dabasia Co-authored-by: t-hamano --- .../resolution-tool/stories/index.story.js | 54 ++++++++++++++++++- 1 file changed, 52 insertions(+), 2 deletions(-) diff --git a/packages/block-editor/src/components/resolution-tool/stories/index.story.js b/packages/block-editor/src/components/resolution-tool/stories/index.story.js index 531618b38224f..08cf9ef6c5378 100644 --- a/packages/block-editor/src/components/resolution-tool/stories/index.story.js +++ b/packages/block-editor/src/components/resolution-tool/stories/index.story.js @@ -16,9 +16,59 @@ export default { title: 'BlockEditor/ResolutionControl', component: ResolutionTool, tags: [ 'status-private' ], + parameters: { + docs: { + canvas: { sourceState: 'shown' }, + description: { + component: + 'A control for selecting image resolution with preset size options.', + }, + }, + }, argTypes: { - panelId: { control: false }, - onChange: { action: 'changed' }, + value: { + control: { type: null }, + description: 'Currently selected resolution value.', + table: { type: { summary: 'string' } }, + }, + onChange: { + action: 'onChange', + control: { type: null }, + description: 'Handles change in resolution selection.', + table: { + type: { summary: 'function' }, + }, + }, + options: { + control: 'object', + description: 'Array of resolution options to display.', + table: { + type: { summary: 'array' }, + }, + }, + defaultValue: { + control: 'radio', + options: [ 'thumbnail', 'medium', 'large', 'full' ], + description: 'Default resolution value.', + table: { + type: { summary: 'string' }, + }, + }, + isShownByDefault: { + control: 'boolean', + description: + 'Whether the control is shown by default in the panel.', + table: { + type: { summary: 'boolean' }, + }, + }, + panelId: { + control: { type: null }, + description: 'ID of the parent tools panel.', + table: { + type: { summary: 'string' }, + }, + }, }, };