From 53f37218cfab8052de6ea298e5e85e98a6131741 Mon Sep 17 00:00:00 2001 From: Rishit Gupta <74411873+Rishit30G@users.noreply.github.com> Date: Thu, 26 Dec 2024 09:41:56 +0530 Subject: [PATCH] Add Storybook for typewriter component --- .../typewriter/stories/index.story.js | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 packages/block-editor/src/components/typewriter/stories/index.story.js diff --git a/packages/block-editor/src/components/typewriter/stories/index.story.js b/packages/block-editor/src/components/typewriter/stories/index.story.js new file mode 100644 index 00000000000000..c164eaddaafdd2 --- /dev/null +++ b/packages/block-editor/src/components/typewriter/stories/index.story.js @@ -0,0 +1,43 @@ +/** + * Internal dependencies + */ +import TypewriterOrIEBypass from '../'; + +/** + * WordPress dependencies + */ +import { __ } from '@wordpress/i18n'; + +const meta = { + title: 'BlockEditor/Typewriter', + component: TypewriterOrIEBypass, + parameters: { + docs: { + description: { + component: + 'The `Typewriter` component ensures that the text selection keeps the same vertical distance from the viewport during keyboard events within this component. It provides a typewriter-like behavior for its children.', + }, + canvas: { sourceState: 'shown' }, + }, + }, + argTypes: { + children: { + control: 'text', + description: 'The children of the component.', + table: { + type: { summary: 'string' }, + }, + }, + }, +}; + +export default meta; + +export const Default = { + args: { + children: __( 'Typewriter Text' ), + }, + render( { children } ) { + return { children }; + }, +};