@particle-network/ui-react 0.0.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.
Files changed (109) hide show
  1. package/README.md +23 -0
  2. package/dist/components/ProgressWrapper/index.d.ts +34 -0
  3. package/dist/components/ProgressWrapper/index.js +102 -0
  4. package/dist/components/UXButton/button-group-context.d.ts +2 -0
  5. package/dist/components/UXButton/button-group-context.js +6 -0
  6. package/dist/components/UXButton/button-group.d.ts +4 -0
  7. package/dist/components/UXButton/button-group.js +22 -0
  8. package/dist/components/UXButton/button-theme.d.ts +236 -0
  9. package/dist/components/UXButton/button-theme.js +626 -0
  10. package/dist/components/UXButton/button.d.ts +4 -0
  11. package/dist/components/UXButton/button.js +31 -0
  12. package/dist/components/UXButton/index.d.ts +8 -0
  13. package/dist/components/UXButton/index.js +6 -0
  14. package/dist/components/UXButton/use-button-group.d.ts +37 -0
  15. package/dist/components/UXButton/use-button-group.js +55 -0
  16. package/dist/components/UXButton/use-button.d.ts +65 -0
  17. package/dist/components/UXButton/use-button.js +136 -0
  18. package/dist/components/UXCheckbox/checkbox.extend.d.ts +7 -0
  19. package/dist/components/UXCheckbox/checkbox.extend.js +151 -0
  20. package/dist/components/UXCheckbox/checkbox.icon.d.ts +6 -0
  21. package/dist/components/UXCheckbox/checkbox.icon.js +46 -0
  22. package/dist/components/UXCheckbox/index.d.ts +10 -0
  23. package/dist/components/UXCheckbox/index.js +17 -0
  24. package/dist/components/UXChip/chip.extend.d.ts +299 -0
  25. package/dist/components/UXChip/chip.extend.js +236 -0
  26. package/dist/components/UXChip/index.d.ts +302 -0
  27. package/dist/components/UXChip/index.js +10 -0
  28. package/dist/components/UXDivider/divider.extend.d.ts +286 -0
  29. package/dist/components/UXDivider/divider.extend.js +15 -0
  30. package/dist/components/UXDivider/index.d.ts +4 -0
  31. package/dist/components/UXDivider/index.js +10 -0
  32. package/dist/components/UXDropdown/dropdown-item.d.ts +3 -0
  33. package/dist/components/UXDropdown/dropdown-item.js +306 -0
  34. package/dist/components/UXDropdown/dropdown-menu.d.ts +3 -0
  35. package/dist/components/UXDropdown/dropdown-menu.js +25 -0
  36. package/dist/components/UXDropdown/dropdown-section.d.ts +1 -0
  37. package/dist/components/UXDropdown/dropdown-section.js +2 -0
  38. package/dist/components/UXDropdown/dropdown.d.ts +4 -0
  39. package/dist/components/UXDropdown/dropdown.js +21 -0
  40. package/dist/components/UXDropdown/index.d.ts +6 -0
  41. package/dist/components/UXDropdown/index.js +6 -0
  42. package/dist/components/UXHint/index.d.ts +8 -0
  43. package/dist/components/UXHint/index.js +22 -0
  44. package/dist/components/UXInput/index.d.ts +346 -0
  45. package/dist/components/UXInput/index.js +10 -0
  46. package/dist/components/UXInput/input.extend.d.ts +343 -0
  47. package/dist/components/UXInput/input.extend.js +6 -0
  48. package/dist/components/UXModal/index.d.ts +10 -0
  49. package/dist/components/UXModal/index.js +89 -0
  50. package/dist/components/UXNumberInput/index.d.ts +5 -0
  51. package/dist/components/UXNumberInput/index.js +10 -0
  52. package/dist/components/UXNumberInput/number-input.extend.d.ts +8 -0
  53. package/dist/components/UXNumberInput/number-input.extend.js +6 -0
  54. package/dist/components/UXPopover/index.d.ts +6 -0
  55. package/dist/components/UXPopover/index.js +10 -0
  56. package/dist/components/UXPopover/popover.extend.d.ts +7 -0
  57. package/dist/components/UXPopover/popover.extend.js +26 -0
  58. package/dist/components/UXRadio/index.d.ts +10 -0
  59. package/dist/components/UXRadio/index.js +12 -0
  60. package/dist/components/UXRadio/radio.extend.d.ts +7 -0
  61. package/dist/components/UXRadio/radio.extend.js +97 -0
  62. package/dist/components/UXSelect/index.d.ts +6 -0
  63. package/dist/components/UXSelect/index.js +51 -0
  64. package/dist/components/UXSwitch/index.d.ts +331 -0
  65. package/dist/components/UXSwitch/index.js +10 -0
  66. package/dist/components/UXSwitch/switch.extend.d.ts +328 -0
  67. package/dist/components/UXSwitch/switch.extend.js +117 -0
  68. package/dist/components/UXTabs/index.d.ts +9 -0
  69. package/dist/components/UXTabs/index.js +11 -0
  70. package/dist/components/UXTabs/tabs.classes.d.ts +210 -0
  71. package/dist/components/UXTabs/tabs.classes.js +530 -0
  72. package/dist/components/UXTabs/tabs.extend.d.ts +8 -0
  73. package/dist/components/UXTabs/tabs.extend.js +6 -0
  74. package/dist/components/UXTooltip/index.d.ts +5 -0
  75. package/dist/components/UXTooltip/index.js +23 -0
  76. package/dist/components/UXTooltip/tooltip.extend.d.ts +314 -0
  77. package/dist/components/UXTooltip/tooltip.extend.js +27 -0
  78. package/dist/components/index.d.ts +44 -0
  79. package/dist/components/index.js +31 -0
  80. package/dist/components/layout/Center.d.ts +4 -0
  81. package/dist/components/layout/Center.js +11 -0
  82. package/dist/components/layout/Circle.d.ts +6 -0
  83. package/dist/components/layout/Circle.js +12 -0
  84. package/dist/components/layout/Flex.d.ts +29 -0
  85. package/dist/components/layout/Flex.js +24 -0
  86. package/dist/components/layout/HStack.d.ts +4 -0
  87. package/dist/components/layout/HStack.js +12 -0
  88. package/dist/components/layout/Square.d.ts +8 -0
  89. package/dist/components/layout/Square.js +13 -0
  90. package/dist/components/layout/VStack.d.ts +4 -0
  91. package/dist/components/layout/VStack.js +12 -0
  92. package/dist/components/typography/Text.d.ts +3 -0
  93. package/dist/components/typography/Text.js +12 -0
  94. package/dist/components/typography/Text.type.d.ts +103 -0
  95. package/dist/components/typography/Text.type.js +47 -0
  96. package/dist/icons/index.d.ts +6 -0
  97. package/dist/icons/index.js +58 -0
  98. package/dist/index.d.ts +2 -0
  99. package/dist/index.js +2 -0
  100. package/dist/utils/classes.d.ts +35 -0
  101. package/dist/utils/classes.js +87 -0
  102. package/dist/utils/index.d.ts +3 -0
  103. package/dist/utils/index.js +4 -0
  104. package/dist/utils/input-classes.d.ts +427 -0
  105. package/dist/utils/input-classes.js +568 -0
  106. package/dist/utils/variants.d.ts +91 -0
  107. package/dist/utils/variants.js +100 -0
  108. package/package.json +42 -0
  109. package/tailwind-preset.js +298 -0
@@ -0,0 +1,530 @@
1
+ import { colorVariants } from "../../utils/index.js";
2
+ const tabsClasses = {
3
+ variants: {
4
+ variant: {
5
+ solid: {
6
+ tabList: 'gap-0 bg-background-400',
7
+ tab: 'py-0',
8
+ cursor: 'shadow-none inset-0',
9
+ tabContent: 'text-foreground-300 font-medium'
10
+ },
11
+ switch: {
12
+ tabList: 'p-0 gap-0 bg-background-200',
13
+ tab: 'py-0',
14
+ cursor: 'shadow-none inset-0',
15
+ tabContent: 'text-foreground-300 font-medium'
16
+ },
17
+ light: {
18
+ tabList: 'p-0 gap-md rounded-none bg-transparent dark:bg-transparent',
19
+ tab: 'py-0 h-full',
20
+ cursor: 'shadow-none',
21
+ tabContent: 'text-foreground-300 font-medium'
22
+ },
23
+ text: {
24
+ tabList: 'p-0 rounded-none bg-transparent dark:bg-transparent',
25
+ tab: 'font-medium p-0 h-fit rounded-none',
26
+ tabContent: 'text-foreground-300 font-medium',
27
+ cursor: 'hidden'
28
+ }
29
+ },
30
+ size: {
31
+ sm: {},
32
+ md: {},
33
+ lg: {}
34
+ },
35
+ color: {
36
+ default: {},
37
+ primary: {},
38
+ secondary: {},
39
+ success: {},
40
+ alert: {},
41
+ warning: {},
42
+ danger: {},
43
+ bullish: {},
44
+ bearish: {}
45
+ },
46
+ radius: {
47
+ none: {
48
+ tabList: 'rounded-none',
49
+ tab: 'rounded-none',
50
+ cursor: 'rounded-none'
51
+ },
52
+ sm: {
53
+ tabList: 'rounded-medium',
54
+ tab: 'rounded-small',
55
+ cursor: 'rounded-small'
56
+ },
57
+ md: {
58
+ tabList: 'rounded-medium',
59
+ tab: 'rounded-small',
60
+ cursor: 'rounded-small'
61
+ },
62
+ lg: {
63
+ tabList: 'rounded-large',
64
+ tab: 'rounded-medium',
65
+ cursor: 'rounded-medium'
66
+ },
67
+ full: {
68
+ tabList: 'rounded-full',
69
+ tab: 'rounded-full',
70
+ cursor: 'rounded-full'
71
+ }
72
+ },
73
+ fullWidth: {
74
+ true: {
75
+ base: 'w-full',
76
+ tabList: 'w-full'
77
+ }
78
+ },
79
+ isDisabled: {
80
+ true: {
81
+ tabList: 'opacity-disabled pointer-events-none'
82
+ }
83
+ },
84
+ disableAnimation: {
85
+ true: {
86
+ tab: 'transition-none',
87
+ tabContent: 'transition-none'
88
+ }
89
+ },
90
+ placement: {
91
+ top: {
92
+ panel: 'py-3 px-0'
93
+ },
94
+ start: {
95
+ tabList: 'flex-col',
96
+ panel: 'py-0 px-3',
97
+ tabWrapper: 'flex'
98
+ },
99
+ end: {
100
+ tabList: 'flex-col',
101
+ panel: 'py-0 px-3',
102
+ tabWrapper: 'flex flex-row-reverse'
103
+ },
104
+ bottom: {
105
+ tabWrapper: 'flex flex-col-reverse'
106
+ }
107
+ }
108
+ },
109
+ defaultVariants: {
110
+ color: 'default',
111
+ variant: 'solid',
112
+ size: 'md',
113
+ fullWidth: false,
114
+ isDisabled: false,
115
+ placement: 'top'
116
+ },
117
+ compoundVariants: [
118
+ {
119
+ variant: [
120
+ 'text'
121
+ ],
122
+ size: 'sm',
123
+ class: {
124
+ tabList: 'gap-lg',
125
+ tab: 'text-body2'
126
+ }
127
+ },
128
+ {
129
+ variant: [
130
+ 'text'
131
+ ],
132
+ size: 'md',
133
+ class: {
134
+ tabList: 'gap-5',
135
+ tab: 'text-body1'
136
+ }
137
+ },
138
+ {
139
+ variant: [
140
+ 'text'
141
+ ],
142
+ size: 'lg',
143
+ class: {
144
+ tabList: 'gap-6',
145
+ tab: 'text-h3'
146
+ }
147
+ },
148
+ {
149
+ variant: [
150
+ 'light'
151
+ ],
152
+ size: 'sm',
153
+ class: {
154
+ tabList: 'h-6',
155
+ tab: 'text-tiny rounded-small px-2',
156
+ cursor: 'rounded-small'
157
+ }
158
+ },
159
+ {
160
+ variant: [
161
+ 'light'
162
+ ],
163
+ size: 'md',
164
+ class: {
165
+ tabList: 'h-[30px]',
166
+ tab: 'text-small rounded-none px-md',
167
+ cursor: 'rounded-small'
168
+ }
169
+ },
170
+ {
171
+ variant: [
172
+ 'light'
173
+ ],
174
+ size: 'lg',
175
+ class: {
176
+ tabList: 'h-[34px]',
177
+ tab: 'text-medium rounded-small',
178
+ cursor: 'rounded-small'
179
+ }
180
+ },
181
+ {
182
+ variant: [
183
+ 'solid'
184
+ ],
185
+ size: 'sm',
186
+ class: {
187
+ tabList: 'rounded-small p-0.5',
188
+ tab: 'h-5 text-tiny rounded-none',
189
+ cursor: 'rounded-small'
190
+ }
191
+ },
192
+ {
193
+ variant: [
194
+ 'solid'
195
+ ],
196
+ size: 'md',
197
+ class: {
198
+ tabList: 'rounded-small p-0.5',
199
+ tab: 'h-[30px] text-medium rounded-none',
200
+ cursor: 'rounded-small'
201
+ }
202
+ },
203
+ {
204
+ variant: [
205
+ 'solid'
206
+ ],
207
+ size: 'lg',
208
+ class: {
209
+ tabList: 'rounded-medium',
210
+ tab: 'h-9 text-medium',
211
+ cursor: 'rounded-small'
212
+ }
213
+ },
214
+ {
215
+ variant: [
216
+ 'switch'
217
+ ],
218
+ size: 'sm',
219
+ class: {
220
+ tabList: 'rounded-small',
221
+ tab: 'h-6 text-tiny rounded-none',
222
+ cursor: 'rounded-small'
223
+ }
224
+ },
225
+ {
226
+ variant: [
227
+ 'switch'
228
+ ],
229
+ size: 'md',
230
+ class: {
231
+ tabList: 'rounded-small',
232
+ tab: 'h-[30px] text-medium rounded-none',
233
+ cursor: 'rounded-small'
234
+ }
235
+ },
236
+ {
237
+ variant: [
238
+ 'switch'
239
+ ],
240
+ size: 'lg',
241
+ class: {
242
+ tabList: 'rounded-medium',
243
+ tab: 'h-[34px] text-medium',
244
+ cursor: 'rounded-small'
245
+ }
246
+ },
247
+ {
248
+ variant: [
249
+ 'solid'
250
+ ],
251
+ color: 'default',
252
+ class: {
253
+ cursor: [
254
+ 'bg-background-200'
255
+ ],
256
+ tabContent: 'group-data-[selected=true]:text-default-foreground'
257
+ }
258
+ },
259
+ {
260
+ variant: [
261
+ 'switch'
262
+ ],
263
+ color: 'default',
264
+ class: {
265
+ cursor: [
266
+ 'bg-foreground-100'
267
+ ],
268
+ tabContent: 'group-data-[selected=true]:text-default-foreground'
269
+ }
270
+ },
271
+ {
272
+ variant: [
273
+ 'light'
274
+ ],
275
+ color: 'default',
276
+ class: {
277
+ cursor: [
278
+ 'bg-background-300'
279
+ ],
280
+ tabContent: 'group-data-[selected=true]:text-default-foreground'
281
+ }
282
+ },
283
+ {
284
+ variant: [
285
+ 'solid',
286
+ 'switch',
287
+ 'light'
288
+ ],
289
+ color: 'primary',
290
+ class: {
291
+ cursor: colorVariants.solid.primary,
292
+ tabContent: 'group-data-[selected=true]:text-primary-foreground'
293
+ }
294
+ },
295
+ {
296
+ variant: [
297
+ 'solid',
298
+ 'switch',
299
+ 'light'
300
+ ],
301
+ color: 'success',
302
+ class: {
303
+ cursor: colorVariants.solid.success,
304
+ tabContent: 'group-data-[selected=true]:text-success-foreground'
305
+ }
306
+ },
307
+ {
308
+ variant: [
309
+ 'solid',
310
+ 'switch',
311
+ 'light'
312
+ ],
313
+ color: 'warning',
314
+ class: {
315
+ cursor: colorVariants.solid.warning,
316
+ tabContent: 'group-data-[selected=true]:text-warning-foreground'
317
+ }
318
+ },
319
+ {
320
+ variant: [
321
+ 'solid',
322
+ 'switch',
323
+ 'light'
324
+ ],
325
+ color: 'danger',
326
+ class: {
327
+ cursor: colorVariants.solid.danger,
328
+ tabContent: 'group-data-[selected=true]:text-danger-foreground'
329
+ }
330
+ },
331
+ {
332
+ variant: [
333
+ 'solid',
334
+ 'switch',
335
+ 'light'
336
+ ],
337
+ color: 'bullish',
338
+ class: {
339
+ cursor: colorVariants.solid.bullish,
340
+ tabContent: 'group-data-[selected=true]:text-bullish-foreground'
341
+ }
342
+ },
343
+ {
344
+ variant: [
345
+ 'solid',
346
+ 'switch',
347
+ 'light'
348
+ ],
349
+ color: 'bearish',
350
+ class: {
351
+ cursor: colorVariants.solid.bearish,
352
+ tabContent: 'group-data-[selected=true]:text-bearish-foreground'
353
+ }
354
+ },
355
+ {
356
+ variant: 'text',
357
+ color: 'default',
358
+ class: {
359
+ tabContent: 'group-data-[selected=true]:text-foreground'
360
+ }
361
+ },
362
+ {
363
+ variant: 'text',
364
+ color: 'primary',
365
+ class: {
366
+ tabContent: 'group-data-[selected=true]:text-primary'
367
+ }
368
+ },
369
+ {
370
+ variant: 'text',
371
+ color: 'success',
372
+ class: {
373
+ tabContent: 'group-data-[selected=true]:text-success'
374
+ }
375
+ },
376
+ {
377
+ variant: 'text',
378
+ color: 'warning',
379
+ class: {
380
+ tabContent: 'group-data-[selected=true]:text-warning'
381
+ }
382
+ },
383
+ {
384
+ variant: 'text',
385
+ color: 'danger',
386
+ class: {
387
+ tabContent: 'group-data-[selected=true]:text-danger'
388
+ }
389
+ },
390
+ {
391
+ variant: 'text',
392
+ color: 'bullish',
393
+ class: {
394
+ tabContent: 'group-data-[selected=true]:text-bullish'
395
+ }
396
+ },
397
+ {
398
+ variant: 'text',
399
+ color: 'bearish',
400
+ class: {
401
+ tabContent: 'group-data-[selected=true]:text-bearish'
402
+ }
403
+ },
404
+ {
405
+ disableAnimation: true,
406
+ variant: 'text',
407
+ class: {
408
+ tab: [
409
+ "after:content-['']",
410
+ 'after:absolute',
411
+ 'after:bottom-0',
412
+ 'after:h-[2px]',
413
+ 'after:w-[80%]',
414
+ 'after:opacity-0',
415
+ 'after:shadow-[0_1px_0px_0_rgba(0,0,0,0.05)]',
416
+ 'data-[selected=true]:after:opacity-100'
417
+ ]
418
+ }
419
+ },
420
+ {
421
+ disableAnimation: true,
422
+ color: 'default',
423
+ variant: [
424
+ 'solid',
425
+ 'light'
426
+ ],
427
+ class: {
428
+ tab: 'data-[selected=true]:bg-default data-[selected=true]:text-default-foreground'
429
+ }
430
+ },
431
+ {
432
+ disableAnimation: true,
433
+ color: 'primary',
434
+ variant: [
435
+ 'solid',
436
+ 'light'
437
+ ],
438
+ class: {
439
+ tab: 'data-[selected=true]:bg-primary data-[selected=true]:text-primary-foreground'
440
+ }
441
+ },
442
+ {
443
+ disableAnimation: true,
444
+ color: 'success',
445
+ variant: [
446
+ 'solid',
447
+ 'light'
448
+ ],
449
+ class: {
450
+ tab: 'data-[selected=true]:bg-success data-[selected=true]:text-success-foreground'
451
+ }
452
+ },
453
+ {
454
+ disableAnimation: true,
455
+ color: 'warning',
456
+ variant: [
457
+ 'solid',
458
+ 'light'
459
+ ],
460
+ class: {
461
+ tab: 'data-[selected=true]:bg-warning data-[selected=true]:text-warning-foreground'
462
+ }
463
+ },
464
+ {
465
+ disableAnimation: true,
466
+ color: 'danger',
467
+ variant: [
468
+ 'solid',
469
+ 'light'
470
+ ],
471
+ class: {
472
+ tab: 'data-[selected=true]:bg-danger data-[selected=true]:text-danger-foreground'
473
+ }
474
+ },
475
+ {
476
+ disableAnimation: true,
477
+ color: 'default',
478
+ variant: 'text',
479
+ class: {
480
+ tab: 'data-[selected=true]:after:bg-foreground'
481
+ }
482
+ },
483
+ {
484
+ disableAnimation: true,
485
+ color: 'primary',
486
+ variant: 'text',
487
+ class: {
488
+ tab: 'data-[selected=true]:after:bg-primary'
489
+ }
490
+ },
491
+ {
492
+ disableAnimation: true,
493
+ color: 'success',
494
+ variant: 'text',
495
+ class: {
496
+ tab: 'data-[selected=true]:after:bg-success'
497
+ }
498
+ },
499
+ {
500
+ disableAnimation: true,
501
+ color: 'warning',
502
+ variant: 'text',
503
+ class: {
504
+ tab: 'data-[selected=true]:after:bg-warning'
505
+ }
506
+ },
507
+ {
508
+ disableAnimation: true,
509
+ color: 'danger',
510
+ variant: 'text',
511
+ class: {
512
+ tab: 'data-[selected=true]:after:bg-danger'
513
+ }
514
+ }
515
+ ],
516
+ compoundSlots: [
517
+ {
518
+ variant: 'text',
519
+ slots: [
520
+ 'tab',
521
+ 'tabList',
522
+ 'cursor'
523
+ ],
524
+ class: [
525
+ 'rounded-none'
526
+ ]
527
+ }
528
+ ]
529
+ };
530
+ export { tabsClasses };
@@ -0,0 +1,8 @@
1
+ import type React from 'react';
2
+ import { type TabsProps } from '@heroui/tabs';
3
+ type ExtendedTabsProps = Omit<TabsProps, 'variant' | 'color'> & {
4
+ variant?: 'solid' | 'light' | 'text' | 'switch';
5
+ color?: 'default' | 'primary' | 'success' | 'warning' | 'danger' | 'bullish' | 'bearish';
6
+ };
7
+ declare const ExtendedTabs: React.ForwardRefExoticComponent<ExtendedTabsProps>;
8
+ export default ExtendedTabs;
@@ -0,0 +1,6 @@
1
+ import { extendVariants } from "@heroui/system-rsc";
2
+ import { Tabs } from "@heroui/tabs";
3
+ import { tabsClasses } from "./tabs.classes.js";
4
+ const ExtendedTabs = extendVariants(Tabs, tabsClasses);
5
+ const tabs_extend = ExtendedTabs;
6
+ export { tabs_extend as default };
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import ExtendedTooltip from './tooltip.extend';
3
+ export type UXTooltipProps = React.ComponentPropsWithRef<typeof ExtendedTooltip>;
4
+ declare const UXTooltip: React.FC<UXTooltipProps>;
5
+ export default UXTooltip;
@@ -0,0 +1,23 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import "react";
3
+ import tooltip_extend from "./tooltip.extend.js";
4
+ const renderContent = (content)=>{
5
+ if (!content || 'string' != typeof content) return null;
6
+ if (!content.includes('\n')) return content;
7
+ return content.split('\n').flatMap((x, i, arr)=>i < arr.length - 1 ? [
8
+ x,
9
+ /*#__PURE__*/ jsx("br", {}, i)
10
+ ] : [
11
+ x
12
+ ]);
13
+ };
14
+ const UXTooltip_UXTooltip = (props)=>{
15
+ const { content, ...restProps } = props;
16
+ return /*#__PURE__*/ jsx(tooltip_extend, {
17
+ content: renderContent(content),
18
+ ...restProps
19
+ });
20
+ };
21
+ UXTooltip_UXTooltip.displayName = 'UX.Tooltip';
22
+ const UXTooltip = UXTooltip_UXTooltip;
23
+ export { UXTooltip as default };