diff --git a/packages/components/src/range-control/stories/index.js b/packages/components/src/range-control/stories/index.js new file mode 100644 index 0000000000000..c78038fea608b --- /dev/null +++ b/packages/components/src/range-control/stories/index.js @@ -0,0 +1,99 @@ +/** + * External dependencies + */ +import { number, text } from '@storybook/addon-knobs'; + +/** + * WordPress dependencies + */ +import { useState } from '@wordpress/element'; + +/** + * Internal dependencies + */ +import RangeControl from '../'; + +export default { title: 'RangeControl', component: RangeControl }; + +const RangeControlWithState = ( { ...props } ) => { + const [ value, setValue ] = useState( 5 ); + + return ( + + ); +}; + +export const _default = () => { + const label = text( 'Label', 'How many columns should this use?' ); + + return ( + + ); +}; + +export const withHelp = () => { + const label = text( 'Label', 'How many columns should this use?' ); + const help = text( 'Help Text', 'Please select the number of columns you would like this to contain.' ); + + return ( + + ); +}; + +export const withMinimumAndMaximumLimits = () => { + const label = text( 'Label', 'How many columns should this use?' ); + const min = number( 'Min Value', 2 ); + const max = number( 'Max Value', 10 ); + + return ( + + ); +}; + +export const withIconBefore = () => { + const label = text( 'Label', 'How many columns should this use?' ); + const icon = text( 'Icon', 'wordpress' ); + + return ( + + ); +}; + +export const withIconAfter = () => { + const label = text( 'Label', 'How many columns should this use?' ); + const icon = text( 'Icon', 'wordpress' ); + + return ( + + ); +}; + +export const withReset = () => { + const label = text( 'Label', 'How many columns should this use?' ); + + return ( + + ); +};