diff --git a/packages/components/src/duotone-picker/stories/duotone-picker.js b/packages/components/src/duotone-picker/stories/duotone-picker.js new file mode 100644 index 00000000000000..74607eaabbda4f --- /dev/null +++ b/packages/components/src/duotone-picker/stories/duotone-picker.js @@ -0,0 +1,64 @@ +/** + * WordPress dependencies + */ +import { useState } from '@wordpress/element'; + +/** + * Internal dependencies + */ +import { DuotonePicker } from '../'; + +export default { + title: 'Components/DuotonePicker', + component: DuotonePicker, + argTypes: { + clearable: { control: { type: 'boolean' } }, + onChange: { action: 'onChange' }, + unsetable: { control: { type: 'boolean' } }, + }, + parameters: { + controls: { expanded: true }, + docs: { source: { state: 'open' } }, + }, +}; + +const DUOTONE_PALETTE = [ + { + colors: [ '#8c00b7', '#fcff41' ], + name: 'Purple and yellow', + slug: 'purple-yellow', + }, + { + colors: [ '#000097', '#ff4747' ], + name: 'Blue and red', + slug: 'blue-red', + }, +]; + +const COLOR_PALETTE = [ + { color: '#ff4747', name: 'Red', slug: 'red' }, + { color: '#fcff41', name: 'Yellow', slug: 'yellow' }, + { color: '#000097', name: 'Blue', slug: 'blue' }, + { color: '#8c00b7', name: 'Purple', slug: 'purple' }, +]; + +const Template = ( { onChange, ...args } ) => { + const [ value, setValue ] = useState(); + + return ( + { + setValue( ...changeArgs ); + onChange( ...changeArgs ); + } } + value={ value } + /> + ); +}; + +export const Default = Template.bind( {} ); +Default.args = { + colorPalette: COLOR_PALETTE, + duotonePalette: DUOTONE_PALETTE, +}; diff --git a/packages/components/src/duotone-picker/stories/duotone-swatch.js b/packages/components/src/duotone-picker/stories/duotone-swatch.js new file mode 100644 index 00000000000000..e64b3e3c2c295f --- /dev/null +++ b/packages/components/src/duotone-picker/stories/duotone-swatch.js @@ -0,0 +1,32 @@ +/** + * Internal dependencies + */ +import { DuotoneSwatch } from '../'; + +export default { + title: 'Components/DuotoneSwatch', + component: DuotoneSwatch, + parameters: { + controls: { expanded: true }, + docs: { source: { state: 'open' } }, + }, +}; + +const Template = ( args ) => { + return ; +}; + +export const Default = Template.bind( {} ); +Default.args = { + values: [ '#000', '#fff' ], +}; + +export const SingleColor = Template.bind( {} ); +SingleColor.args = { + values: [ 'pink' ], +}; + +export const Null = Template.bind( {} ); +Null.args = { + values: null, +};