@rabbitio/ui-kit 1.0.0-alpha.9 → 1.0.0-beta.1

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 CHANGED
@@ -1 +1 @@
1
- export * from "./stories";
1
+ export * from "./stories/index.js";
package/package.json CHANGED
@@ -1,25 +1,12 @@
1
1
  {
2
2
  "name": "@rabbitio/ui-kit",
3
- "version": "1.0.0-alpha.9",
3
+ "version": "1.0.0-beta.1",
4
4
  "description": "Rabbit.io react.js components kit",
5
5
  "type": "module",
6
- "files": [
7
- "dist",
8
- "stories",
9
- "styles",
10
- "README.md",
11
- "index.js"
12
- ],
13
6
  "exports": {
14
7
  ".": "./index.js",
15
8
  "./node": "./dist/node/index.js",
16
- "./dist/node": "./dist/node/index.js",
17
9
  "./web": "./dist/web/index.js",
18
- "./dist/web": "./dist/web/index.js",
19
- "./node1": "./dist/node",
20
- "./dist/node1": "./dist/node",
21
- "./web1": "./dist/web",
22
- "./dist/web1": "./dist/web",
23
10
  "./package.json": "./package.json"
24
11
  },
25
12
  "scripts": {
@@ -44,12 +31,13 @@
44
31
  "license": "MIT",
45
32
  "peerDependencies": {
46
33
  "react": ">=16.0.0",
47
- "react-dom": ">=16.0.0"
34
+ "react-dom": ">=16.0.0",
35
+ "react-router-dom": ">=6.21.1"
48
36
  },
49
37
  "dependencies": {
50
38
  "react": ">=16.0.0",
51
39
  "react-dom": ">=16.0.0",
52
- "react-router-dom": "6.21.1"
40
+ "react-router-dom": ">=6.21.1"
53
41
  },
54
42
  "devDependencies": {
55
43
  "@babel/core": "^7.23.7",
package/stories/index.js CHANGED
@@ -1,4 +1,2 @@
1
- // export { default as Button } from "./atoms/buttons/Button/Button.jsx";
2
- // export { default as LoadingDots } from "./atoms/LoadingDots/LoadingDots.jsx";
3
1
  export { Button } from "./atoms/buttons/Button/Button.jsx";
4
2
  export { LoadingDots } from "./atoms/LoadingDots/LoadingDots.jsx";
@@ -1,7 +0,0 @@
1
- <svg width="24" height="25" viewBox="0 0 24 25" fill="none" xmlns="http://www.w3.org/2000/svg">
2
- <path d="M19.4926 15.7679V18.5068C19.4926 19.2507 18.8422 19.8534 18.04 19.8534H5.45266C4.65042 19.8534 4 19.2507 4 18.5068V5.84658C4 5.10268 4.65042 4.5 5.45266 4.5H18.04C18.8422 4.5 19.4926 5.10268 19.4926 5.84658V8.92496" stroke="white" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
3
- <path fill-rule="evenodd" clip-rule="evenodd" d="M20.1958 15.4383H15.9518C14.1789 15.4383 12.7422 14.0016 12.7422 12.2287C12.7422 10.4558 14.1789 9.01904 15.9518 9.01904H20.1958C20.6639 9.01904 21.0431 9.39829 21.0431 9.86637V14.5904C21.0431 15.0591 20.6639 15.4383 20.1958 15.4383Z" stroke="white" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
4
- <path d="M4 7.25582H8.04903" stroke="white" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
5
- <path d="M4 17.1181H8.04903" stroke="white" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
6
- <path fill-rule="evenodd" clip-rule="evenodd" d="M17.1414 12.2284C17.1414 12.778 16.6958 13.2229 16.1469 13.2229C15.5972 13.2229 15.1523 12.778 15.1523 12.2284C15.1523 11.6794 15.5972 11.2339 16.1469 11.2339C16.6958 11.2339 17.1414 11.6794 17.1414 12.2284Z" fill="white"/>
7
- </svg>
@@ -1,47 +0,0 @@
1
- // import { LoadingDots } from "./../../../dist/index";
2
- import React from "react";
3
- import { LoadingDots } from "./LoadingDots.jsx";
4
-
5
- export default {
6
- title: "LoadingDots",
7
- component: LoadingDots,
8
- parameters: {
9
- backgrounds: {
10
- default: "dark",
11
- },
12
- },
13
- argTypes: {
14
- size: {
15
- control: {
16
- type: "select",
17
- options: ["big", "small", "extra-small"],
18
- },
19
- },
20
- align: {
21
- control: { type: "select", options: ["left", "right", false] },
22
- },
23
- isColored: { control: { type: "boolean" } },
24
- noMargins: { control: { type: "boolean" } },
25
- },
26
- tags: ["autodocs"],
27
- };
28
-
29
- const Template = (args) => <LoadingDots {...args} />;
30
-
31
- export const Default = Template.bind({});
32
- Default.args = {};
33
-
34
- export const Colored = Template.bind({});
35
- Colored.args = {
36
- isColored: true,
37
- };
38
-
39
- export const NoMargins = Template.bind({});
40
- NoMargins.args = {
41
- noMargins: true,
42
- };
43
-
44
- export const AlignRight = Template.bind({});
45
- AlignRight.args = {
46
- align: "right",
47
- };
@@ -1,289 +0,0 @@
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
- };