-
Notifications
You must be signed in to change notification settings - Fork 46
/
Button.stories.js
201 lines (167 loc) · 3.97 KB
/
Button.stories.js
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
import ButtonSlot from './ButtonSlot.svelte';
import { action } from '@storybook/addon-actions';
const actionsData = {
'click': action('click'),
'blur': action('blur'),
'focus': action('focus'),
}
export default {
title: 'Button',
component: ButtonSlot,
argTypes: {
// ******************** HEY! ************************
// You will need to also add these to the buttonslot:
// agnosticui-svelte/src/stories/ButtonSlot.svelte
mode: { control: 'text' },
css: { control: 'text' },
isBordered: { control: 'boolean' },
isBlock: { control: 'boolean' },
isDisabled: { control: 'boolean' },
isRaised: { control: 'boolean' },
isCircle: { control: 'boolean' },
isRounded: { control: 'boolean' },
isSkinned: { control: 'boolean' },
size: {
control: { type: 'select', options: ['small', 'large'] },
},
// on: {
// ...actionsData,
// },
},
};
const Template = ({ onClick, ...args }) => ({
Component: ButtonSlot,
props: args,
on: {
...actionsData,
},
});
export const Primary = Template.bind({});
Primary.args = {
mode: 'primary',
};
export const PrimaryBordered = Template.bind({});
PrimaryBordered.args = {
mode: 'primary',
isBordered: true,
};
export const PrimaryRounded = Template.bind({});
PrimaryRounded.args = {
mode: 'primary',
isRounded: true,
};
export const PrimaryRoundedRaised = Template.bind({});
PrimaryRoundedRaised.args = {
mode: 'primary',
isRounded: true,
isRaised: true,
};
export const PrimaryBorderedRounded = Template.bind({});
PrimaryBorderedRounded.args = {
mode: 'primary',
isBordered: true,
isRounded: true,
};
export const PrimaryTest = Template.bind({});
PrimaryTest.args = {
isCircle: true,
};
export const PrimaryCircle = Template.bind({});
PrimaryCircle.args = {
mode: 'primary',
isBordered: true,
isCircle: true,
};
export const PrimaryBlock = Template.bind({});
PrimaryBlock.args = {
mode: 'primary',
isBlock: true,
};
export const Secondary = Template.bind({});
Secondary.args = {
mode: 'secondary',
};
export const SecondaryBordered = Template.bind({});
SecondaryBordered.args = {
mode: 'secondary',
isBordered: true,
};
export const SecondaryRounded = Template.bind({});
SecondaryRounded.args = {
mode: 'secondary',
isRounded: true,
};
export const SecondaryCircle = Template.bind({});
SecondaryCircle.args = {
mode: 'secondary',
isCircle: true,
};
export const SecondaryRoundedRaised = Template.bind({});
SecondaryRoundedRaised.args = {
mode: 'secondary',
isRounded: true,
isRaised: true,
};
export const SecondaryBorderedRounded = Template.bind({});
SecondaryBorderedRounded.args = {
mode: 'secondary',
isBordered: true,
isRounded: true,
};
export const Default = Template.bind({});
Default.args = {
};
export const DefaultRaised = Template.bind({});
DefaultRaised.args = {
isRaised: true,
};
export const DefaultBordered = Template.bind({});
DefaultBordered.args = {
isBordered: true,
};
export const DefaultRounded = Template.bind({});
DefaultRounded.args = {
isRounded: true,
};
export const DefaultCircle = Template.bind({});
DefaultCircle.args = {
isRounded: true,
isCircle: true,
};
export const DefaultBorderedRounded = Template.bind({});
DefaultBorderedRounded.args = {
isBordered: true,
isRounded: true,
};
export const Disabled = Template.bind({});
Disabled.args = {
isDisabled: true,
};
export const Large = Template.bind({});
Large.args = {
size: 'large',
};
export const Small = Template.bind({});
Small.args = {
size: 'small',
};
export const ButtonTypeSubmit = Template.bind({});
ButtonTypeSubmit.args = {
type: 'submit',
};
export const ButtonTypeReset = Template.bind({});
ButtonTypeReset.args = {
type: 'reset',
};
export const ButtonOverrides = Template.bind({});
ButtonOverrides.args = {
css: 'my-custom-css-klass',
};
export const ButtonBlank = Template.bind({});
ButtonBlank.args = {
isBlank: true,
};
export const ButtonBase = Template.bind({});
ButtonBase.args = {
isSkinned: false,
};