@bigbinary/neetoui 2.0.46 → 2.0.50

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.
@@ -0,0 +1,443 @@
1
+ import React, { useState } from "react";
2
+ import { Keyboard } from "@bigbinary/neeto-icons";
3
+
4
+ import Button from "../lib/components/Button";
5
+
6
+ export default {
7
+ title: "Components/Button",
8
+ component: Button,
9
+ parameters: {
10
+ layout: "padded",
11
+ docs: {
12
+ description: {
13
+ component: '`import { Button } from "@bigbinary/neetoui";`'
14
+ }
15
+ }
16
+ },
17
+
18
+ };
19
+
20
+ const Template = (args) => <Button {...args} />;
21
+
22
+ export const Primary = Template.bind({});
23
+ Primary.args = {
24
+ style: "primary",
25
+ label: "Button",
26
+ };
27
+
28
+ export const Secondary = Template.bind({});
29
+ Secondary.args = {
30
+ style: "secondary",
31
+ label: "Button",
32
+ };
33
+
34
+ export const Danger = Template.bind({});
35
+ Danger.args = {
36
+ style: "danger",
37
+ label: "Button",
38
+ };
39
+
40
+ export const Text = Template.bind({});
41
+ Text.args = {
42
+ style: "text",
43
+ label: "Button",
44
+ };
45
+
46
+ export const Link = Template.bind({});
47
+ Link.args = {
48
+ style: "link",
49
+ label: "Button",
50
+ };
51
+
52
+ export const AllVariants = () => {
53
+ const [loading, setLoading] = useState(false);
54
+ const toggle = () => {
55
+ setLoading(!loading);
56
+ };
57
+ return (
58
+ <div className="w-full">
59
+ <div className="p-6 space-y-6">
60
+ <Button onClick={toggle} label="Toggle Loading State" />
61
+ <div className="p-4 space-y-8 border border-indigo-500 border-dashed">
62
+ <h2 className="text-xl">Styles</h2>
63
+ <div className="flex gap-10">
64
+ <div className="flex flex-col gap-6 items-start">
65
+ <Button
66
+ loading={loading}
67
+ onClick={toggle}
68
+ size="large"
69
+ label="Primary"
70
+ />
71
+ <Button
72
+ loading={loading}
73
+ onClick={toggle}
74
+ size="large"
75
+ label="Primary"
76
+ disabled
77
+ />
78
+ <Button
79
+ loading={loading}
80
+ onClick={toggle}
81
+ size="large"
82
+ label="Primary"
83
+ icon={Keyboard}
84
+ />
85
+ <Button
86
+ loading={loading}
87
+ onClick={toggle}
88
+ size="large"
89
+ label="Primary"
90
+ icon={Keyboard}
91
+ iconPosition="left"
92
+ />
93
+ <Button
94
+ loading
95
+ onClick={toggle}
96
+ size="large"
97
+ label="Primary"
98
+ icon={Keyboard}
99
+ />
100
+ <Button
101
+ loading
102
+ onClick={toggle}
103
+ size="large"
104
+ label="Primary"
105
+ icon={Keyboard}
106
+ iconPosition="left"
107
+ />
108
+ <Button loading onClick={toggle} size="large" icon={Keyboard} />
109
+ </div>
110
+ <div className="flex flex-col gap-6 items-start">
111
+ <Button
112
+ loading={loading}
113
+ onClick={toggle}
114
+ size="large"
115
+ label="Secondary"
116
+ style="secondary"
117
+ />
118
+ <Button
119
+ loading={loading}
120
+ onClick={toggle}
121
+ size="large"
122
+ label="Secondary"
123
+ style="secondary"
124
+ disabled
125
+ />
126
+ <Button
127
+ loading={loading}
128
+ onClick={toggle}
129
+ size="large"
130
+ label="Secondary"
131
+ style="secondary"
132
+ icon={Keyboard}
133
+ />
134
+ <Button
135
+ loading={loading}
136
+ onClick={toggle}
137
+ size="large"
138
+ label="Secondary"
139
+ style="secondary"
140
+ icon={Keyboard}
141
+ iconPosition="left"
142
+ />
143
+ <Button
144
+ loading
145
+ onClick={toggle}
146
+ size="large"
147
+ label="Secondary"
148
+ style="secondary"
149
+ icon={Keyboard}
150
+ />
151
+ <Button
152
+ loading
153
+ onClick={toggle}
154
+ size="large"
155
+ label="Secondary"
156
+ style="secondary"
157
+ icon={Keyboard}
158
+ iconPosition="left"
159
+ />
160
+ <Button
161
+ loading
162
+ onClick={toggle}
163
+ size="large"
164
+ style="secondary"
165
+ icon={Keyboard}
166
+ iconPosition="left"
167
+ />
168
+ </div>
169
+ <div className="flex flex-col gap-6 items-start">
170
+ <Button
171
+ loading={loading}
172
+ onClick={toggle}
173
+ size="large"
174
+ label="Danger"
175
+ style="danger"
176
+ />
177
+ <Button
178
+ loading={loading}
179
+ onClick={toggle}
180
+ size="large"
181
+ label="Danger"
182
+ style="danger"
183
+ disabled
184
+ />
185
+ <Button
186
+ loading={loading}
187
+ onClick={toggle}
188
+ size="large"
189
+ label="Danger"
190
+ style="danger"
191
+ icon={Keyboard}
192
+ />
193
+ <Button
194
+ loading={loading}
195
+ onClick={toggle}
196
+ size="large"
197
+ label="Danger"
198
+ style="danger"
199
+ icon={Keyboard}
200
+ iconPosition="left"
201
+ />
202
+ <Button
203
+ loading
204
+ onClick={toggle}
205
+ size="large"
206
+ label="Danger"
207
+ style="danger"
208
+ icon={Keyboard}
209
+ />
210
+ <Button
211
+ loading
212
+ onClick={toggle}
213
+ size="large"
214
+ label="Danger"
215
+ style="danger"
216
+ icon={Keyboard}
217
+ iconPosition="left"
218
+ />
219
+ <Button
220
+ loading
221
+ onClick={toggle}
222
+ size="large"
223
+ style="danger"
224
+ icon={Keyboard}
225
+ iconPosition="left"
226
+ />
227
+ </div>
228
+ <div className="flex flex-col gap-6 items-start">
229
+ <Button
230
+ loading={loading}
231
+ onClick={toggle}
232
+ size="large"
233
+ label="Text"
234
+ style="text"
235
+ />
236
+ <Button
237
+ loading={loading}
238
+ onClick={toggle}
239
+ size="large"
240
+ label="Text"
241
+ style="text"
242
+ disabled
243
+ />
244
+ <Button
245
+ loading={loading}
246
+ onClick={toggle}
247
+ size="large"
248
+ label="Text"
249
+ style="text"
250
+ icon={Keyboard}
251
+ />
252
+ <Button
253
+ loading={loading}
254
+ onClick={toggle}
255
+ size="large"
256
+ label="Text"
257
+ style="text"
258
+ icon={Keyboard}
259
+ iconPosition="left"
260
+ />
261
+ <Button
262
+ loading
263
+ onClick={toggle}
264
+ size="large"
265
+ label="Text"
266
+ style="text"
267
+ icon={Keyboard}
268
+ />
269
+ <Button
270
+ loading
271
+ onClick={toggle}
272
+ size="large"
273
+ label="Text"
274
+ style="text"
275
+ icon={Keyboard}
276
+ iconPosition="left"
277
+ />
278
+ <Button
279
+ loading
280
+ onClick={toggle}
281
+ size="large"
282
+ style="text"
283
+ icon={Keyboard}
284
+ />
285
+ </div>
286
+ <div className="flex flex-col gap-6 items-start">
287
+ <Button size="large" label="Link" style="link" />
288
+ <Button size="large" label="Link" style="link" disabled />
289
+ <Button size="large" label="Link" style="link" icon={Keyboard} />
290
+ <Button
291
+ size="large"
292
+ label="Link"
293
+ style="link"
294
+ icon={Keyboard}
295
+ iconPosition="left"
296
+ />
297
+ <Button
298
+ loading
299
+ size="large"
300
+ label="Link"
301
+ style="link"
302
+ icon={Keyboard}
303
+ iconPosition="left"
304
+ />
305
+ <Button
306
+ loading
307
+ size="large"
308
+ label="Link"
309
+ style="link"
310
+ icon={Keyboard}
311
+ />
312
+ <Button loading size="large" style="link" icon={Keyboard} />
313
+ </div>
314
+ </div>
315
+ </div>
316
+ <div className="p-4 space-y-8 border border-indigo-500 border-dashed">
317
+ <h2 className="text-xl">Sizes</h2>
318
+ <div className="flex flex-row flex-wrap items-center justify-start gap-4">
319
+ <Button
320
+ loading={loading}
321
+ onClick={toggle}
322
+ size="large"
323
+ label="Large"
324
+ style="primary"
325
+ />
326
+ <Button
327
+ loading={loading}
328
+ onClick={toggle}
329
+ size="large"
330
+ style="primary"
331
+ icon={Keyboard}
332
+ />
333
+ <Button
334
+ loading={loading}
335
+ onClick={toggle}
336
+ size="large"
337
+ label="Large"
338
+ style="secondary"
339
+ />
340
+ <Button
341
+ loading={loading}
342
+ onClick={toggle}
343
+ size="large"
344
+ style="secondary"
345
+ icon={Keyboard}
346
+ />
347
+ <Button
348
+ loading={loading}
349
+ onClick={toggle}
350
+ size="large"
351
+ label="Large"
352
+ style="danger"
353
+ />
354
+ <Button
355
+ loading={loading}
356
+ onClick={toggle}
357
+ size="large"
358
+ style="danger"
359
+ icon={Keyboard}
360
+ />
361
+ <Button
362
+ loading={loading}
363
+ onClick={toggle}
364
+ size="large"
365
+ label="Large"
366
+ style="text"
367
+ />
368
+ <Button
369
+ loading={loading}
370
+ onClick={toggle}
371
+ size="large"
372
+ style="text"
373
+ icon={Keyboard}
374
+ />
375
+ <Button
376
+ loading={loading}
377
+ onClick={toggle}
378
+ size="large"
379
+ label="Large"
380
+ style="link"
381
+ />
382
+ </div>
383
+ <div className="flex flex-row flex-wrap items-center justify-start gap-4">
384
+ <Button
385
+ loading={loading}
386
+ onClick={toggle}
387
+ label="Default"
388
+ style="primary"
389
+ />
390
+ <Button
391
+ loading={loading}
392
+ onClick={toggle}
393
+ style="primary"
394
+ icon={Keyboard}
395
+ />
396
+ <Button
397
+ loading={loading}
398
+ onClick={toggle}
399
+ label="Default"
400
+ style="secondary"
401
+ />
402
+ <Button
403
+ loading={loading}
404
+ onClick={toggle}
405
+ style="secondary"
406
+ icon={Keyboard}
407
+ />
408
+ <Button
409
+ loading={loading}
410
+ onClick={toggle}
411
+ label="Large"
412
+ style="danger"
413
+ />
414
+ <Button
415
+ loading={loading}
416
+ onClick={toggle}
417
+ style="danger"
418
+ icon={Keyboard}
419
+ />
420
+ <Button
421
+ loading={loading}
422
+ onClick={toggle}
423
+ label="Default"
424
+ style="text"
425
+ />
426
+ <Button
427
+ loading={loading}
428
+ onClick={toggle}
429
+ style="text"
430
+ icon={Keyboard}
431
+ />
432
+ <Button
433
+ loading={loading}
434
+ onClick={toggle}
435
+ label="Default"
436
+ style="link"
437
+ />
438
+ </div>
439
+ </div>
440
+ </div>
441
+ </div>
442
+ );
443
+ };
@@ -0,0 +1,170 @@
1
+ import { Meta } from "@storybook/addon-docs";
2
+
3
+ export const colorPalette = [
4
+ {
5
+ name: "$nui-white",
6
+ value: "#ffffff",
7
+ compiledValue: "#ffffff",
8
+ },
9
+ {
10
+ name: "$nui-black",
11
+ value: "#1b1f23",
12
+ compiledValue: "#1b1f23",
13
+ },
14
+ {
15
+ name: "$nui-gray-800",
16
+ value: "#2f3941",
17
+ compiledValue: "#2f3941",
18
+ },
19
+ {
20
+ name: "$nui-gray-700",
21
+ value: "#49545c",
22
+ compiledValue: "#49545c",
23
+ },
24
+ {
25
+ name: "$nui-gray-600",
26
+ value: "#68737d",
27
+ compiledValue: "#68737d",
28
+ },
29
+ {
30
+ name: "$nui-gray-500",
31
+ value: "#87929d",
32
+ compiledValue: "#87929d",
33
+ },
34
+ {
35
+ name: "$nui-gray-400",
36
+ value: "#c2c8cc",
37
+ compiledValue: "#c2c8cc",
38
+ },
39
+ {
40
+ name: "$nui-gray-300",
41
+ value: "#d8dcde",
42
+ compiledValue: "#d8dcde",
43
+ },
44
+ {
45
+ name: "$nui-gray-200",
46
+ value: "#e9ebed",
47
+ compiledValue: "#e9ebed",
48
+ },
49
+ {
50
+ name: "$nui-gray-100",
51
+ value: "#f8f9f9",
52
+ compiledValue: "#f8f9f9",
53
+ },
54
+ {
55
+ name: "$nui-success",
56
+ value: "#00ba88",
57
+ compiledValue: "#00ba88",
58
+ },
59
+ {
60
+ name: "$nui-info",
61
+ value: "#276ef1",
62
+ compiledValue: "#276ef1",
63
+ },
64
+ {
65
+ name: "$nui-warning",
66
+ value: "#f3cd82",
67
+ compiledValue: "#f3cd82",
68
+ },
69
+ {
70
+ name: "$nui-error",
71
+ value: "#f56a58",
72
+ compiledValue: "#f56a58",
73
+ },
74
+ {
75
+ name: "$nui-pastel-blue",
76
+ value: "#eaf3fc",
77
+ compiledValue: "#eaf3fc",
78
+ },
79
+ {
80
+ name: "$nui-pastel-green",
81
+ value: "#ebf5ec",
82
+ compiledValue: "#ebf5ec",
83
+ },
84
+ {
85
+ name: "$nui-pastel-yellow",
86
+ value: "#fff2d7",
87
+ compiledValue: "#fff2d7",
88
+ },
89
+ {
90
+ name: "$nui-pastel-red",
91
+ value: "#ffefed",
92
+ compiledValue: "#ffefed",
93
+ },
94
+ {
95
+ name: "$nui-pastel-teal",
96
+ value: "#98f3f4",
97
+ compiledValue: "#98f3f4",
98
+ },
99
+ {
100
+ name: "$nui-secondary-indigo",
101
+ value: "#5e5ce6",
102
+ compiledValue: "#5e5ce6",
103
+ },
104
+ {
105
+ name: "$nui-secondary-green",
106
+ value: "#00ba88",
107
+ compiledValue: "#00ba88",
108
+ },
109
+ {
110
+ name: "$nui-secondary-teal",
111
+ value: "#64d2ff",
112
+ compiledValue: "#64d2ff",
113
+ },
114
+ ];
115
+
116
+ <Meta title="Foundation/Colors" />
117
+
118
+ <style>{`
119
+ .story-demo-table tr{
120
+ background: transparent !important;
121
+ }
122
+
123
+ `}</style>
124
+
125
+ # Colors
126
+
127
+ <table className="story-demo-table">
128
+ <thead>
129
+ <tr>
130
+ <td></td>
131
+ <td>Hex Code</td>
132
+ <td>Variable Name</td>
133
+ <td>Text Color</td>
134
+ <td>Background Color</td>
135
+ </tr>
136
+ </thead>
137
+ <tbody>
138
+ {colorPalette.map((color) => {
139
+ return (
140
+ <tr key={color.name}>
141
+ <td>
142
+ <div
143
+ className={`w-12 h-12 cursor-pointer rounded-full shadow-xl ${color.name.replace(
144
+ "$nui",
145
+ "nui-bg"
146
+ )}`}
147
+ ></div>
148
+ </td>
149
+ <td>
150
+ <code>{color.value}</code>
151
+ </td>
152
+ <td>
153
+ <code>{color.name}</code>
154
+ </td>
155
+ <td>
156
+ <div className="flex justify-between">
157
+ <code>{`.${color.name.replace("$nui", "nui-text")}`}</code>
158
+ <b className={`ml-2 ${color.name.replace("$nui", "nui-text")}`}>
159
+ Aa
160
+ </b>
161
+ </div>
162
+ </td>
163
+ <td className={`${color.name.replace("$nui", "nui-bg")}`}>
164
+ <code>{`.${color.name.replace("$nui", "nui-bg")}`}</code>
165
+ </td>
166
+ </tr>
167
+ );
168
+ })}
169
+ </tbody>
170
+ </table>
@@ -0,0 +1,84 @@
1
+ import React, { useState } from "react";
2
+ import { Down } from "@bigbinary/neeto-icons";
3
+
4
+ import Dropdown from "../lib/components/Dropdown";
5
+
6
+ export default {
7
+ title: "Components/Dropdown",
8
+ component: Dropdown,
9
+ parameters: {
10
+ layout: "padded",
11
+ docs: {
12
+ description: {
13
+ component: '`import { Dropdown } from "@bigbinary/neetoui";`'
14
+ }
15
+ }
16
+ },
17
+ };
18
+
19
+ const listItems = ["Option 1", "Option 2", "Option 3"];
20
+
21
+ export const PrimaryDropdown = (args) => {
22
+ const [dropdownOne, setDropdownOne] = useState(false);
23
+
24
+ return (
25
+ <Dropdown
26
+ label="Primary Dropdown"
27
+ buttonStyle="primary"
28
+ position="bottom-end"
29
+ isOpen={dropdownOne}
30
+ onClose={() => {
31
+ setDropdownOne(false);
32
+ }}
33
+ buttonProps={{
34
+ onClick: () => {
35
+ setDropdownOne(!dropdownOne);
36
+ },
37
+ }}
38
+ closeOnSelect={false}
39
+ closeOnOutsideClick={false}
40
+ >
41
+ {listItems.map((item, idx) => (
42
+ <li key={idx}>{item}</li>
43
+ ))}
44
+ </Dropdown>
45
+ );
46
+ };
47
+
48
+ export const SecondaryDropdown = (args) => {
49
+ return (
50
+ <Dropdown
51
+ label="Secondary Dropdown"
52
+ buttonStyle="secondary"
53
+ position="bottom-end"
54
+ >
55
+ {listItems.map((item, idx) => (
56
+ <li key={idx}>{item}</li>
57
+ ))}
58
+ </Dropdown>
59
+ );
60
+ };
61
+
62
+ export const TextDropdown = (args) => {
63
+ return (
64
+ <Dropdown label="Text Dropdown" buttonStyle="text" position="bottom-end">
65
+ {listItems.map((item, idx) => (
66
+ <li key={idx}>{item}</li>
67
+ ))}
68
+ </Dropdown>
69
+ );
70
+ };
71
+
72
+ export const CustomIcon = (args) => {
73
+ return (
74
+ <Dropdown
75
+ label="Dropdown with custom icon"
76
+ icon="ri-send-plane-line"
77
+ position="bottom-end"
78
+ >
79
+ {listItems.map((item, idx) => (
80
+ <li key={idx}>{item}</li>
81
+ ))}
82
+ </Dropdown>
83
+ );
84
+ };