-
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.
Storybook: Add Placeholder component story (#19734)
* Add Placeholder story for storybook * Update storybook test snapshot
- Loading branch information
Showing
2 changed files
with
114 additions
and
0 deletions.
There are no files selected for viewing
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,35 @@ | ||
/** | ||
* External dependencies | ||
*/ | ||
import { boolean, text } from '@storybook/addon-knobs'; | ||
|
||
/** | ||
* Internal dependencies | ||
*/ | ||
import Placeholder from '../'; | ||
import TextControl from '../../text-control'; | ||
|
||
export default { title: 'Components/Placeholder', component: Placeholder }; | ||
|
||
export const _default = () => { | ||
const icon = text( 'Icon', 'smiley' ); | ||
const instructions = text( 'Instructions', 'Here are instructions you should follow' ); | ||
const label = text( 'Label', 'My Placeholder Label' ); | ||
const isColumnLayout = boolean( 'isColumnLayout', false ); | ||
|
||
return ( | ||
<Placeholder | ||
icon={ icon } | ||
instructions={ instructions } | ||
label={ label } | ||
isColumnLayout={ isColumnLayout } | ||
> | ||
<div> | ||
<TextControl | ||
label="Sample Field" | ||
placeholder="Enter something here" | ||
/> | ||
</div> | ||
</Placeholder> | ||
); | ||
}; |
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