-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Storybook for typewriter component
- Loading branch information
Showing
1 changed file
with
43 additions
and
0 deletions.
There are no files selected for viewing
43 changes: 43 additions & 0 deletions
43
packages/block-editor/src/components/typewriter/stories/index.story.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 <TypewriterOrIEBypass>{ children }</TypewriterOrIEBypass>; | ||
}, | ||
}; |