From 063584367ce2aa3dc9adba58229ff45e1aae15c9 Mon Sep 17 00:00:00 2001 From: Rishit Gupta <74411873+Rishit30G@users.noreply.github.com> Date: Thu, 26 Dec 2024 15:09:59 +0530 Subject: [PATCH] Add Storybook for Editable Text component --- .../editable-text/stories/index.story.js | 60 +++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 packages/block-editor/src/components/editable-text/stories/index.story.js diff --git a/packages/block-editor/src/components/editable-text/stories/index.story.js b/packages/block-editor/src/components/editable-text/stories/index.story.js new file mode 100644 index 00000000000000..740a2ef63b6cc2 --- /dev/null +++ b/packages/block-editor/src/components/editable-text/stories/index.story.js @@ -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 ( + + ); + }, + args: { + value: 'Hello World!', + }, +};