This repository has been archived by the owner on Feb 23, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 219
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add stories for Chip * Add more knobs to Chip storybook Co-authored-by: Thomas Roberts <[email protected]>
- Loading branch information
Showing
1 changed file
with
42 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,42 @@ | ||
/** | ||
* External dependencies | ||
*/ | ||
import { text, select, boolean } from '@storybook/addon-knobs'; | ||
|
||
/** | ||
* Internal dependencies | ||
*/ | ||
import * as components from '../'; | ||
|
||
export default { | ||
title: 'WooCommerce Blocks/@base-components/Chip', | ||
component: Chip, | ||
}; | ||
|
||
const radii = [ 'none', 'small', 'medium', 'large' ]; | ||
|
||
export const Chip = () => ( | ||
<components.Chip | ||
text={ text( 'Text', 'example' ) } | ||
radius={ select( 'Radius', radii ) } | ||
screenReaderText={ text( | ||
'Screen reader text', | ||
'Example screen reader text' | ||
) } | ||
element={ select( 'Element', [ 'li', 'div', 'span' ], 'li' ) } | ||
/> | ||
); | ||
|
||
export const RemovableChip = () => ( | ||
<components.RemovableChip | ||
text={ text( 'Text', 'example' ) } | ||
radius={ select( 'Radius', radii ) } | ||
screenReaderText={ text( | ||
'Screen reader text', | ||
'Example screen reader text' | ||
) } | ||
disabled={ boolean( 'Disabled', false ) } | ||
removeOnAnyClick={ boolean( 'Remove on any click', false ) } | ||
element={ select( 'Element', [ 'li', 'div', 'span' ], 'li' ) } | ||
/> | ||
); |