@rabbitio/ui-kit 1.0.0-alpha.8 → 1.0.0-alpha.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +1 -0
- package/package.json +7 -5
- package/stories/assets/icons/transactions-icon.svg +7 -0
- package/stories/atoms/LoadingDots/LoadingDots.jsx +57 -0
- package/stories/atoms/LoadingDots/LoadingDots.module.scss +83 -0
- package/stories/atoms/LoadingDots/LoadingDots.stories.jsx +47 -0
- package/stories/atoms/buttons/Button/Button.jsx +235 -0
- package/stories/atoms/buttons/Button/Button.module.scss +212 -0
- package/stories/atoms/buttons/Button/Button.stories.jsx +289 -0
- package/stories/index.js +4 -0
- package/dist/node/52a99d58a36f2b7a78b3.ttf +0 -0
- package/dist/node/662b866576cfea51dd64.ttf +0 -0
- package/dist/node/7f9eed4cca4d0ae6a772.ttf +0 -0
- package/dist/node/8268666c3b2ca2ec11c0.ttf +0 -0
- package/dist/node/87d9266583abd389ca1f.ttf +0 -0
- package/dist/node/index.js +0 -3
- package/dist/node/index.js.LICENSE.txt +0 -32
- package/dist/node/index.js.map +0 -1
- package/dist/web/52a99d58a36f2b7a78b3.ttf +0 -0
- package/dist/web/662b866576cfea51dd64.ttf +0 -0
- package/dist/web/7f9eed4cca4d0ae6a772.ttf +0 -0
- package/dist/web/8268666c3b2ca2ec11c0.ttf +0 -0
- package/dist/web/87d9266583abd389ca1f.ttf +0 -0
- package/dist/web/index.js +0 -3
- package/dist/web/index.js.LICENSE.txt +0 -32
- package/dist/web/index.js.map +0 -1
|
@@ -0,0 +1,289 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Button } from "./Button.jsx";
|
|
3
|
+
import icon from "../../../assets/icons/transactions-icon.svg";
|
|
4
|
+
|
|
5
|
+
// import { Button } from "./../../../../dist/web/index";
|
|
6
|
+
// const Button = RabbitioUiKit.Button;
|
|
7
|
+
|
|
8
|
+
const sizes = ["xl", "lg", "md", "sm"];
|
|
9
|
+
const modes = [
|
|
10
|
+
"transparent",
|
|
11
|
+
"white",
|
|
12
|
+
"primary",
|
|
13
|
+
"primary-bordered",
|
|
14
|
+
"primary-transparent",
|
|
15
|
+
"transparent-bordered",
|
|
16
|
+
"transparent-without-shadow",
|
|
17
|
+
];
|
|
18
|
+
|
|
19
|
+
export default {
|
|
20
|
+
title: "Button",
|
|
21
|
+
component: Button,
|
|
22
|
+
parameters: {
|
|
23
|
+
viewport: {
|
|
24
|
+
defaultViewport: "reset",
|
|
25
|
+
},
|
|
26
|
+
backgrounds: {
|
|
27
|
+
default: "dark",
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
argTypes: {
|
|
31
|
+
size: {
|
|
32
|
+
control: { type: "select", options: sizes },
|
|
33
|
+
},
|
|
34
|
+
content: { control: "text" },
|
|
35
|
+
className: { table: { disable: true } },
|
|
36
|
+
onClick: { table: { disable: true } },
|
|
37
|
+
to: { table: { disable: true } },
|
|
38
|
+
icon: { table: { disable: true } },
|
|
39
|
+
setClickTrigger: { table: { disable: true } },
|
|
40
|
+
isFormSubmittingButton: { table: { disable: true } },
|
|
41
|
+
propagatePrimaryButtonClick: { table: { disable: true } },
|
|
42
|
+
handleError: { table: { disable: true } },
|
|
43
|
+
},
|
|
44
|
+
tags: ["autodocs"],
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
const ModeStory = ({ mode }) => (
|
|
48
|
+
<>
|
|
49
|
+
{sizes.map((size) => (
|
|
50
|
+
<div key={size} style={{ marginBottom: "10px" }}>
|
|
51
|
+
<Button
|
|
52
|
+
size={size}
|
|
53
|
+
mode={mode}
|
|
54
|
+
content={`${
|
|
55
|
+
mode.charAt(0).toUpperCase() + mode.slice(1)
|
|
56
|
+
} ${size.toUpperCase()} Button`}
|
|
57
|
+
/>
|
|
58
|
+
</div>
|
|
59
|
+
))}
|
|
60
|
+
</>
|
|
61
|
+
);
|
|
62
|
+
|
|
63
|
+
const Template = (args) => <Button {...args} />;
|
|
64
|
+
|
|
65
|
+
export const Default = Template.bind({});
|
|
66
|
+
Default.args = { content: "Button" };
|
|
67
|
+
|
|
68
|
+
export const Transparent = () => <ModeStory mode="transparent" />;
|
|
69
|
+
|
|
70
|
+
export const White = () => <ModeStory mode="white" />;
|
|
71
|
+
|
|
72
|
+
export const Primary = () => <ModeStory mode="primary" />;
|
|
73
|
+
|
|
74
|
+
export const PrimaryBordered = () => <ModeStory mode="primary-bordered" />;
|
|
75
|
+
|
|
76
|
+
export const PrimaryTransparent = () => (
|
|
77
|
+
<ModeStory mode="primary-transparent" />
|
|
78
|
+
);
|
|
79
|
+
|
|
80
|
+
export const TransparentBordered = () => (
|
|
81
|
+
<ModeStory mode="transparent-bordered" />
|
|
82
|
+
);
|
|
83
|
+
|
|
84
|
+
export const TransparentWithoutShadow = () => (
|
|
85
|
+
<ModeStory mode="transparent-without-shadow" />
|
|
86
|
+
);
|
|
87
|
+
|
|
88
|
+
// TODO: [dev] requires fix
|
|
89
|
+
// export const LinkButton = () => (
|
|
90
|
+
// <>
|
|
91
|
+
// <h3>Link Button</h3>
|
|
92
|
+
// {sizes.map((size) => (
|
|
93
|
+
// <div key={size} style={{ marginBottom: "10px" }}>
|
|
94
|
+
// <Button
|
|
95
|
+
// size={size}
|
|
96
|
+
// mode="primary"
|
|
97
|
+
// content={`Link ${size.toUpperCase()} Button`}
|
|
98
|
+
// to="/example-path"
|
|
99
|
+
// />
|
|
100
|
+
// </div>
|
|
101
|
+
// ))}
|
|
102
|
+
// </>
|
|
103
|
+
// );
|
|
104
|
+
|
|
105
|
+
export const LoadingButton = () => (
|
|
106
|
+
<>
|
|
107
|
+
<h3>Loading Button</h3>
|
|
108
|
+
{sizes.map((size) => (
|
|
109
|
+
<div key={size} style={{ marginBottom: "10px" }}>
|
|
110
|
+
<Button
|
|
111
|
+
size={size}
|
|
112
|
+
mode="primary"
|
|
113
|
+
content={`Loading ${size.toUpperCase()} Button`}
|
|
114
|
+
loader={true}
|
|
115
|
+
loading={true}
|
|
116
|
+
/>
|
|
117
|
+
</div>
|
|
118
|
+
))}
|
|
119
|
+
</>
|
|
120
|
+
);
|
|
121
|
+
|
|
122
|
+
export const IconButton = () => (
|
|
123
|
+
<>
|
|
124
|
+
<h3>Button with Icon</h3>
|
|
125
|
+
{modes.map((mode) => (
|
|
126
|
+
<div key={mode} style={{ marginBottom: "20px" }}>
|
|
127
|
+
<h4>Mode: {mode.charAt(0).toUpperCase() + mode.slice(1)}</h4>
|
|
128
|
+
{sizes.map((size) => (
|
|
129
|
+
<div key={size} style={{ marginBottom: "10px" }}>
|
|
130
|
+
<Button
|
|
131
|
+
size={size}
|
|
132
|
+
mode={mode}
|
|
133
|
+
icon={icon}
|
|
134
|
+
content={`${
|
|
135
|
+
mode.charAt(0).toUpperCase() + mode.slice(1)
|
|
136
|
+
} ${size.toUpperCase()} Button with Icon`}
|
|
137
|
+
/>
|
|
138
|
+
</div>
|
|
139
|
+
))}
|
|
140
|
+
</div>
|
|
141
|
+
))}
|
|
142
|
+
</>
|
|
143
|
+
);
|
|
144
|
+
|
|
145
|
+
export const DisabledButton = () => (
|
|
146
|
+
<>
|
|
147
|
+
<h3>Disabled Button</h3>
|
|
148
|
+
{sizes.map((size) => (
|
|
149
|
+
<div
|
|
150
|
+
key={size}
|
|
151
|
+
style={{
|
|
152
|
+
marginBottom: "10px",
|
|
153
|
+
display: "flex",
|
|
154
|
+
justifyContent: "space-between",
|
|
155
|
+
}}
|
|
156
|
+
>
|
|
157
|
+
<Button
|
|
158
|
+
size={size}
|
|
159
|
+
mode={"primary"}
|
|
160
|
+
content={`${size.toUpperCase()} Button`}
|
|
161
|
+
isDisabled={true}
|
|
162
|
+
/>
|
|
163
|
+
<div style={{ marginRight: "10px" }} />
|
|
164
|
+
<Button
|
|
165
|
+
size={size}
|
|
166
|
+
mode={"primary"}
|
|
167
|
+
icon={icon}
|
|
168
|
+
content={`${size.toUpperCase()} Button with Icon`}
|
|
169
|
+
isDisabled={true}
|
|
170
|
+
/>
|
|
171
|
+
</div>
|
|
172
|
+
))}
|
|
173
|
+
</>
|
|
174
|
+
);
|
|
175
|
+
|
|
176
|
+
export const CheckmarkOnClickButton = () => (
|
|
177
|
+
<>
|
|
178
|
+
<h3>Button with Checkmark on Click</h3>
|
|
179
|
+
{modes.map((mode) => (
|
|
180
|
+
<div key={mode} style={{ marginBottom: "10px" }}>
|
|
181
|
+
<Button
|
|
182
|
+
size={"xl"}
|
|
183
|
+
mode={mode}
|
|
184
|
+
content={`${
|
|
185
|
+
mode.charAt(0).toUpperCase() + mode.slice(1)
|
|
186
|
+
} XL Button`}
|
|
187
|
+
checkmarkOnClick={true}
|
|
188
|
+
loader={false}
|
|
189
|
+
/>
|
|
190
|
+
</div>
|
|
191
|
+
))}
|
|
192
|
+
</>
|
|
193
|
+
);
|
|
194
|
+
|
|
195
|
+
export const BigIconButton = () => (
|
|
196
|
+
<>
|
|
197
|
+
<h3>Button with Big Icon</h3>
|
|
198
|
+
{modes.map((mode) => (
|
|
199
|
+
<div key={mode} style={{ marginBottom: "20px" }}>
|
|
200
|
+
<h4>Mode: {mode.charAt(0).toUpperCase() + mode.slice(1)}</h4>
|
|
201
|
+
{sizes.map((size) => (
|
|
202
|
+
<div key={size} style={{ marginBottom: "10px" }}>
|
|
203
|
+
<Button
|
|
204
|
+
size={size}
|
|
205
|
+
mode={mode}
|
|
206
|
+
icon={icon}
|
|
207
|
+
content={`${
|
|
208
|
+
mode.charAt(0).toUpperCase() + mode.slice(1)
|
|
209
|
+
} ${size.toUpperCase()} Button with Big Icon`}
|
|
210
|
+
bigIcon={true}
|
|
211
|
+
/>
|
|
212
|
+
</div>
|
|
213
|
+
))}
|
|
214
|
+
</div>
|
|
215
|
+
))}
|
|
216
|
+
</>
|
|
217
|
+
);
|
|
218
|
+
|
|
219
|
+
export const FullWidthOnMobiles = () => (
|
|
220
|
+
<>
|
|
221
|
+
<h3>Full Width on Mobiles</h3>
|
|
222
|
+
{modes.map((mode) => (
|
|
223
|
+
<div key={mode} style={{ marginBottom: "10px" }}>
|
|
224
|
+
<Button
|
|
225
|
+
mode={mode}
|
|
226
|
+
content={`Full Width Mobile ${
|
|
227
|
+
mode.charAt(0).toUpperCase() + mode.slice(1)
|
|
228
|
+
} Button`}
|
|
229
|
+
fullWidthOnMobiles={true}
|
|
230
|
+
/>
|
|
231
|
+
</div>
|
|
232
|
+
))}
|
|
233
|
+
</>
|
|
234
|
+
);
|
|
235
|
+
FullWidthOnMobiles.parameters = {
|
|
236
|
+
viewport: {
|
|
237
|
+
defaultViewport: "iphone14promax",
|
|
238
|
+
},
|
|
239
|
+
};
|
|
240
|
+
|
|
241
|
+
export const FullWidthOnTablets = () => (
|
|
242
|
+
<>
|
|
243
|
+
<h3>Full Width on Tablets</h3>
|
|
244
|
+
{modes.map((mode) => (
|
|
245
|
+
<div key={mode} style={{ marginBottom: "10px" }}>
|
|
246
|
+
<Button
|
|
247
|
+
mode={mode}
|
|
248
|
+
content={`Full Width Tablet ${
|
|
249
|
+
mode.charAt(0).toUpperCase() + mode.slice(1)
|
|
250
|
+
} Button`}
|
|
251
|
+
fullWidthOnTablets={true}
|
|
252
|
+
/>
|
|
253
|
+
</div>
|
|
254
|
+
))}
|
|
255
|
+
</>
|
|
256
|
+
);
|
|
257
|
+
FullWidthOnTablets.parameters = {
|
|
258
|
+
viewport: {
|
|
259
|
+
defaultViewport: "ipad",
|
|
260
|
+
},
|
|
261
|
+
};
|
|
262
|
+
|
|
263
|
+
export const SmallPaddingOnSmallMobilesButton = () => (
|
|
264
|
+
<>
|
|
265
|
+
<h3>Button with Small Padding on Small Mobiles</h3>
|
|
266
|
+
{modes.map((mode) => (
|
|
267
|
+
<div key={mode} style={{ marginBottom: "20px" }}>
|
|
268
|
+
<h4>Mode: {mode.charAt(0).toUpperCase() + mode.slice(1)}</h4>
|
|
269
|
+
{sizes.map((size) => (
|
|
270
|
+
<div key={size} style={{ marginBottom: "10px" }}>
|
|
271
|
+
<Button
|
|
272
|
+
size={size}
|
|
273
|
+
mode={mode}
|
|
274
|
+
content={`${
|
|
275
|
+
mode.charAt(0).toUpperCase() + mode.slice(1)
|
|
276
|
+
} ${size.toUpperCase()} Button`}
|
|
277
|
+
smallPaddingOnSmallMobiles={true}
|
|
278
|
+
/>
|
|
279
|
+
</div>
|
|
280
|
+
))}
|
|
281
|
+
</div>
|
|
282
|
+
))}
|
|
283
|
+
</>
|
|
284
|
+
);
|
|
285
|
+
SmallPaddingOnSmallMobilesButton.parameters = {
|
|
286
|
+
viewport: {
|
|
287
|
+
defaultViewport: "iphone14",
|
|
288
|
+
},
|
|
289
|
+
};
|
package/stories/index.js
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
// export { default as Button } from "./atoms/buttons/Button/Button.jsx";
|
|
2
|
+
// export { default as LoadingDots } from "./atoms/LoadingDots/LoadingDots.jsx";
|
|
3
|
+
export { Button } from "./atoms/buttons/Button/Button.jsx";
|
|
4
|
+
export { LoadingDots } from "./atoms/LoadingDots/LoadingDots.jsx";
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|