Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Commit

Permalink
Add storybook demo for Chip (#3029)
Browse files Browse the repository at this point in the history
* add stories for Chip

* Add more knobs to Chip storybook

Co-authored-by: Thomas Roberts <[email protected]>
  • Loading branch information
haszari and opr authored Jun 14, 2021
1 parent 9e4f4f0 commit ca6f4ea
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions assets/js/base/components/chip/stories/index.js
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' ) }
/>
);

0 comments on commit ca6f4ea

Please sign in to comment.