|
1
|
import type { Meta, StoryObj } from "@storybook/react" |
|
2
|
import * as React from "react" |
|
3
|
|
|
4
|
import { PlusMini } from "@medusajs/icons" |
|
5
|
import { Button } from "./button" |
|
6
|
|
|
7
|
const meta: Meta<typeof Button> = { |
|
8
|
title: "Components/Button", |
|
9
|
component: Button, |
|
10
|
parameters: { |
|
11
|
layout: "centered", |
|
12
|
}, |
|
13
|
} |
|
14
|
|
|
15
|
export default meta |
|
16
|
|
|
17
|
type Story = StoryObj<typeof Button> |
|
18
|
|
|
19
|
export const Primary: Story = { |
|
20
|
args: { |
|
21
|
children: "Action", |
|
22
|
}, |
|
23
|
} |
|
24
|
|
|
25
|
export const Secondary: Story = { |
|
26
|
args: { |
|
27
|
children: "Action", |
|
28
|
variant: "secondary", |
|
29
|
}, |
|
30
|
} |
|
31
|
|
|
32
|
export const Transparent: Story = { |
|
33
|
args: { |
|
34
|
children: "Action", |
|
35
|
variant: "transparent", |
|
36
|
}, |
|
37
|
} |
|
38
|
|
|
39
|
export const Danger: Story = { |
|
40
|
args: { |
|
41
|
children: "Action", |
|
42
|
variant: "danger", |
|
43
|
}, |
|
44
|
} |
|
45
|
|
|
46
|
export const Disabled: Story = { |
|
47
|
args: { |
|
48
|
children: "Action", |
|
49
|
disabled: true, |
|
50
|
}, |
|
51
|
} |
|
52
|
|
|
53
|
export const WithIcon: Story = { |
|
54
|
args: { |
|
55
|
children: ["Action", <PlusMini key={1} />], |
|
56
|
}, |
|
57
|
} |
|
58
|
|
|
59
|
export const Loading: Story = { |
|
60
|
args: { |
|
61
|
children: "Action", |
|
62
|
isLoading: true, |
|
63
|
}, |
|
64
|
} |
|
65
|
|
|
66
|
export const Large: Story = { |
|
67
|
args: { |
|
68
|
children: "Action", |
|
69
|
size: "large", |
|
70
|
}, |
|
71
|
} |
|
72
|
|
|
73
|
export const XLarge: Story = { |
|
74
|
args: { |
|
75
|
children: "Action", |
|
76
|
size: "xlarge", |
|
77
|
}, |
|
78
|
} |