aboutsummaryrefslogtreecommitdiffstats
path: root/uidev/src/stories/toggle.stories.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'uidev/src/stories/toggle.stories.tsx')
-rw-r--r--uidev/src/stories/toggle.stories.tsx19
1 files changed, 10 insertions, 9 deletions
diff --git a/uidev/src/stories/toggle.stories.tsx b/uidev/src/stories/toggle.stories.tsx
index 091342496..af6b282bc 100644
--- a/uidev/src/stories/toggle.stories.tsx
+++ b/uidev/src/stories/toggle.stories.tsx
@@ -16,17 +16,14 @@ interface IStoreArgs {
16 error?: string; 16 error?: string;
17} 17}
18 18
19const createStore = (args?: IStoreArgs) => { 19const createStore = (args?: IStoreArgs) => observable({ id: `element-${uuid()}`,
20 return observable(Object.assign({
21 id: `element-${uuid()}`,
22 name: 'toggle', 20 name: 'toggle',
23 label: 'Label', 21 label: 'Label',
24 value: true, 22 value: true,
25 checked: false, 23 checked: false,
26 disabled: false, 24 disabled: false,
27 error: '', 25 error: '',
28 }, args)); 26...args });
29};
30 27
31const WithStoreToggle = observer(({ store }: { store: any }) => ( 28const WithStoreToggle = observer(({ store }: { store: any }) => (
32 <> 29 <>
@@ -50,21 +47,25 @@ storiesOf('Toggle')
50 .add('Checked', () => ( 47 .add('Checked', () => (
51 <WithStoreToggle store={createStore({ 48 <WithStoreToggle store={createStore({
52 checked: true, 49 checked: true,
53 })} /> 50 })}
51 />
54 )) 52 ))
55 .add('Disabled', () => ( 53 .add('Disabled', () => (
56 <WithStoreToggle store={createStore({ 54 <WithStoreToggle store={createStore({
57 checked: true, 55 checked: true,
58 disabled: true, 56 disabled: true,
59 })} /> 57 })}
58 />
60 )) 59 ))
61 .add('Long label', () => ( 60 .add('Long label', () => (
62 <WithStoreToggle store={createStore({ 61 <WithStoreToggle store={createStore({
63 label: 'Hello world, this is an insanely long label for this toggle. We need to make sure that it will be displayed correctly.', 62 label: 'Hello world, this is an insanely long label for this toggle. We need to make sure that it will be displayed correctly.',
64 })} /> 63 })}
64 />
65 )) 65 ))
66 .add('With error', () => ( 66 .add('With error', () => (
67 <WithStoreToggle store={createStore({ 67 <WithStoreToggle store={createStore({
68 error: 'Something went wrong', 68 error: 'Something went wrong',
69 })} /> 69 })}
70 />
70 )); 71 ));