Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

StoryBook: Add story for BlockSettingsMenuControls #68729

Open
wants to merge 1 commit into
base: trunk
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
/**
* Internal dependencies
*/
import BlockSettingsMenuControls from '../';

/**
* Storybook metadata
*/
const meta = {
title: 'BlockEditor/BlockSettingsMenuControls',
component: BlockSettingsMenuControls,
parameters: {
docs: {
description: {
component:
'The `BlockSettingsMenuControls` component renders additional controls within the block settings menu, allowing for customization and extension of block options.',
},
canvas: { sourceState: 'shown' },
},
},
argTypes: {
clientIds: {
control: 'array',
description:
'Array of clientIds for the blocks that will be acted upon. Determines which blocks the menu controls will affect.',
table: {
type: { summary: 'Array' },
},
},
fillProps: {
control: 'object',
description:
'Additional props to pass to the Slot fill. Can include properties like `onClose` to handle menu interactions.',
table: {
type: { summary: 'Object' },
},
},
},
};

export default meta;

/**
* Default Story
*/
export const Default = {
args: {
clientIds: [ 'block-1', 'block-2' ],
fillProps: {
onClose: () => {},
},
},
render: function Template( { clientIds, fillProps } ) {
return (
<BlockSettingsMenuControls.Slot
clientIds={ clientIds }
fillProps={ fillProps }
/>
);
},
};
Loading