2020-06-01 17:09:32 +02:00
|
|
|
import React from 'react';
|
|
|
|
import {useActionState} from './helper';
|
|
|
|
import FieldColor from '../src/components/FieldColor';
|
|
|
|
import {Wrapper} from './ui';
|
2020-06-03 10:52:54 +02:00
|
|
|
import {withA11y} from '@storybook/addon-a11y';
|
2020-06-01 17:09:32 +02:00
|
|
|
|
|
|
|
export default {
|
|
|
|
title: 'FieldColor',
|
|
|
|
component: FieldColor,
|
2020-06-03 10:52:54 +02:00
|
|
|
decorators: [withA11y],
|
2020-06-01 17:09:32 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2020-06-03 10:52:54 +02:00
|
|
|
export const Basic = () => {
|
2020-06-01 17:09:32 +02:00
|
|
|
const [color, setColor] = useActionState("onChange", "#ff0000");
|
|
|
|
|
|
|
|
return (
|
|
|
|
<Wrapper>
|
|
|
|
<FieldColor
|
|
|
|
name="color"
|
|
|
|
value={color}
|
|
|
|
onChange={setColor}
|
|
|
|
/>
|
|
|
|
</Wrapper>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|