-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathExample.complex.stories.tsx
52 lines (45 loc) · 1.24 KB
/
Example.complex.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 type { Meta, StoryObj } from "@storybook/react";
import { ComponentProps } from "react";
import { allModes } from "@gc-digital-talent/storybook-helpers";
import Example from "./Example";
type PagePropsAndCustomArgs = ComponentProps<typeof Example> & {
footer?: string;
};
const meta = {
component: Example,
render: ({ footer, ...args }) => (
<>
<Example {...args} />
{footer && <span>{footer}</span>}
</>
),
argTypes: {
color: {
options: ["primary", "secondary"],
control: { type: "radio" },
},
},
parameters: {
/*
Chromatic modes allow for testing themes, viewports, and locales via snapshots in Chromatic.
These should be used instead of creating multiple stories for variations of themes, viewports, or locales.
REF: https://www.chromatic.com/docs/modes/.
*/
chromatic: {
modes: {
light: allModes.light,
"light mobile": allModes["light mobile"],
dark: allModes.dark,
},
},
},
} satisfies Meta<PagePropsAndCustomArgs>;
export default meta;
type Story = StoryObj<PagePropsAndCustomArgs>;
export const Default: Story = {
args: {
footer: "CustomFooterText",
color: "primary",
showBorder: false,
},
} satisfies Story;