-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathFormBanner.stories.tsx
52 lines (46 loc) · 1.3 KB
/
FormBanner.stories.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import { Meta, StoryFn } from '@storybook/react';
import { formBanner } from '@tablecheck/tablekit-core';
import * as emotion from '@tablecheck/tablekit-react';
import * as css from '@tablecheck/tablekit-react-css';
import * as React from 'react';
const contentVariants: emotion.FormBannerProps['data-variant'][] = [
'success',
'info',
'error',
'warning',
'neutral',
'purple',
'orange'
];
type LayoutComponents = Record<'FormBanner', React.ElementType>;
export default {
title: 'Components/FormBanner',
component: emotion.FormBanner,
parameters: {
...formBanner,
variants: contentVariants,
auxiliaryComponents: [
emotion.FormBannerIconWrapper,
emotion.FormBannerMessage
]
}
} as Meta;
const Template: StoryFn = ({ FormBanner }) => (
<>
{contentVariants.map((variant) => (
<FormBanner key={variant} data-variant={variant}>
Important message to explain a form or a section of a form.
</FormBanner>
))}
</>
);
export const Emotion: StoryFn = Template.bind({});
Emotion.args = {
FormBanner: emotion.FormBanner
} satisfies LayoutComponents;
Emotion.parameters = { useEmotion: true };
export const Class: StoryFn = Template.bind({});
Class.args = {
FormBanner: css.FormBanner
} satisfies LayoutComponents;
Class.parameters = { useEmotion: false };