Skip to content

Commit

Permalink
StoryBook: Add Story for ResolutionTool (#68292)
Browse files Browse the repository at this point in the history
* merge trunk into storybook/resolution-control

* refactor: Add argtypes and description in meta

Co-authored-by: im3dabasia <[email protected]>
Co-authored-by: t-hamano <[email protected]>
  • Loading branch information
3 people authored Jan 4, 2025
1 parent 19043c9 commit 50d2e06
Showing 1 changed file with 52 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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' },
},
},
},
};

Expand Down

0 comments on commit 50d2e06

Please sign in to comment.