Skip to content

Commit

Permalink
Update control types
Browse files Browse the repository at this point in the history
  • Loading branch information
Sukhendu2002 committed Dec 4, 2024
1 parent f0f8d7f commit dd964a1
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ import { useState } from '@wordpress/element';
*/
import HeadingLevelDropdown from '../';

export default {
const meta = {
title: 'BlockEditor/HeadingLevelDropdown',
component: HeadingLevelDropdown,
argTypes: {
value: {
control: { type: 'number', min: 0, max: 6, step: 1 },
control: { type: null },
description: 'The currently selected heading level.',
},
options: {
Expand All @@ -23,6 +23,7 @@ export default {
},
onChange: {
action: 'onChange',
control: { type: null },
description:
'Callback triggered when a new heading level is selected.',
},
Expand All @@ -36,9 +37,12 @@ export default {
],
};

export default meta;

export const Default = {
render: function Template( { onChange, ...args } ) {
const [ value, setValue ] = useState( args.value );

return (
<HeadingLevelDropdown
{ ...args }
Expand Down

0 comments on commit dd964a1

Please sign in to comment.