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 Editable Text component #68314

Closed
Closed
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,60 @@
/**
* Internal dependencies
*/
import EditableText from '../';

const meta = {
component: EditableText,
title: 'BlockEditor/EditableText',
parameters: {
docs: {
description: {
component:
'The `EditableText` component allows to display a text that can be edited by the user.',
},
canvas: { sourceState: 'shown' },
},
},
argTypes: {
value: {
control: 'text',
description: 'The value of the editable text.',
table: {
type: { summary: 'string' },
},
},
onChange: {
action: 'onChange',
control: { type: null },
description:
'Called when a selection is made. If `null`, _Default_ is selected.',
table: {
type: { summary: 'function' },
},
},
className: {
control: 'text',
description: 'The class name of the editable text.',
table: {
type: { summary: 'string' },
},
},
},
};

export default meta;

export const Default = {
render: function Template( props ) {
return (
<EditableText
className={ props.className }
value={ props.value }
onChange={ props.onChange }
/>
);
},
args: {
value: 'Hello World!',
},
};
Loading