@particle-network/ui-react 0.4.0-beta.13 → 0.4.0-beta.15
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/dist/components/UXAutocomplete/index.d.ts +5 -0
- package/dist/components/UXAutocomplete/index.js +72 -0
- package/dist/components/UXEmpty/index.d.ts +1 -1
- package/dist/components/UXHint/index.d.ts +1 -1
- package/dist/components/UXInput/index.d.ts +28 -28
- package/dist/components/UXInput/input.extend.d.ts +28 -28
- package/dist/components/UXSwitch/index.d.ts +17 -17
- package/dist/components/UXSwitch/switch.extend.d.ts +17 -17
- package/dist/components/UXTable/index.d.ts +17 -17
- package/dist/components/UXTable/table.extend.d.ts +17 -17
- package/dist/components/UXThemeSwitch/index.d.ts +0 -1
- package/dist/components/UXThemeSwitch/index.js +0 -1
- package/dist/components/UXThemeSwitch/theme-item.d.ts +1 -1
- package/dist/components/UXThemeSwitch/theme-switch.js +1 -1
- package/dist/components/UXThemeSwitch/use-color-scheme.d.ts +1 -1
- package/dist/components/UXThemeSwitch/use-theme-store.d.ts +1 -1
- package/dist/components/UXThemeSwitch/use-theme-store.js +1 -1
- package/dist/components/UXThemeSwitch/use-theme.d.ts +1 -1
- package/dist/components/UXThemeSwitch/use-theme.js +1 -1
- package/dist/components/UXToast/index.d.ts +6 -4
- package/dist/components/UXToast/index.js +19 -15
- package/dist/components/UXTooltip/tooltip.extend.d.ts +19 -19
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +1 -0
- package/package.json +3 -3
- package/tailwind-preset.js +108 -36
- package/dist/components/UXThemeSwitch/theme-data.d.ts +0 -12
- package/dist/components/UXThemeSwitch/theme-data.js +0 -340
|
@@ -9,33 +9,35 @@ const UXToastProvider = ()=>/*#__PURE__*/ jsx(ToastProvider, {
|
|
|
9
9
|
disableAnimation: true,
|
|
10
10
|
placement: "top-center",
|
|
11
11
|
maxVisibleToasts: 4,
|
|
12
|
-
toastOffset: 40,
|
|
13
12
|
toastProps: {
|
|
14
13
|
timeout: 4000
|
|
15
14
|
},
|
|
16
15
|
regionProps: {
|
|
17
|
-
className: 'items-center
|
|
16
|
+
className: 'items-center mt-12 p-0 gap-2'
|
|
18
17
|
}
|
|
19
18
|
});
|
|
20
19
|
const getIcon = (type)=>{
|
|
21
20
|
if ('success' === type) return /*#__PURE__*/ jsx(CircleCheckIcon, {
|
|
22
|
-
size: 18
|
|
21
|
+
size: 18,
|
|
22
|
+
color: "success"
|
|
23
23
|
});
|
|
24
24
|
if ('error' === type) return /*#__PURE__*/ jsx(CircleCloseIcon, {
|
|
25
|
-
size: 18
|
|
25
|
+
size: 18,
|
|
26
|
+
color: "danger"
|
|
26
27
|
});
|
|
27
28
|
if ('loading' === type) return /*#__PURE__*/ jsx(UXSpinner, {
|
|
29
|
+
color: "primary",
|
|
28
30
|
size: 18
|
|
29
31
|
});
|
|
30
32
|
return null;
|
|
31
33
|
};
|
|
32
34
|
const show = (props)=>{
|
|
33
|
-
const { type, hideCloseButton, variant, classNames, description, ...toastProps } = props ?? {};
|
|
34
|
-
const { base, description: descriptionClassName, icon, loadingComponent, content, closeButton, ...restClassNames } = classNames ?? {};
|
|
35
|
+
const { type, hideCloseButton, icon, variant, classNames, description, ...toastProps } = props ?? {};
|
|
36
|
+
const { base, description: descriptionClassName, icon: iconClassName, loadingComponent, content, closeButton, ...restClassNames } = classNames ?? {};
|
|
35
37
|
return addToast({
|
|
36
38
|
classNames: {
|
|
37
39
|
base: [
|
|
38
|
-
'bg-tertiary rounded-xl px-3.5 py-3 shadow-none border-none !w-fit max-w-[90vw] md:max-w-[400px]',
|
|
40
|
+
'bg-tertiary rounded-xl px-3.5 py-3 shadow-none border-none !w-fit max-w-[90vw] md:max-w-[400px] m-0',
|
|
39
41
|
!hideCloseButton && 'pr-12',
|
|
40
42
|
'flat' === variant && 'success' === type && 'bg-[#0E3728]',
|
|
41
43
|
'flat' === variant && 'error' === type && 'bg-[#501D1D]',
|
|
@@ -48,11 +50,8 @@ const show = (props)=>{
|
|
|
48
50
|
descriptionClassName
|
|
49
51
|
],
|
|
50
52
|
icon: [
|
|
51
|
-
'
|
|
52
|
-
|
|
53
|
-
'error' === type && 'text-danger',
|
|
54
|
-
'loading' === type && 'text-primary',
|
|
55
|
-
icon
|
|
53
|
+
'h-fit w-fit shrink-0',
|
|
54
|
+
iconClassName
|
|
56
55
|
],
|
|
57
56
|
loadingComponent: [
|
|
58
57
|
'text-primary h-5 w-5',
|
|
@@ -70,18 +69,24 @@ const show = (props)=>{
|
|
|
70
69
|
...restClassNames
|
|
71
70
|
},
|
|
72
71
|
description,
|
|
73
|
-
icon: getIcon(type),
|
|
72
|
+
icon: icon ?? getIcon(type),
|
|
73
|
+
hideIcon: !icon && !getIcon(type),
|
|
74
74
|
closeIcon: /*#__PURE__*/ jsx(CloseIcon, {
|
|
75
75
|
className: 'flat' === variant ? 'text-white' : 'text-foreground'
|
|
76
76
|
}),
|
|
77
77
|
loadingComponent: /*#__PURE__*/ jsx(UXSpinner, {
|
|
78
78
|
size: 18
|
|
79
79
|
}),
|
|
80
|
-
timeout: 'loading' === type ? 1 / 0 :
|
|
80
|
+
timeout: 'loading' === type ? 1 / 0 : 4000,
|
|
81
81
|
...toastProps
|
|
82
82
|
});
|
|
83
83
|
};
|
|
84
84
|
const toast = {
|
|
85
|
+
info: (message, props)=>show({
|
|
86
|
+
type: 'info',
|
|
87
|
+
description: message,
|
|
88
|
+
...props
|
|
89
|
+
}),
|
|
85
90
|
success: (message, props)=>show({
|
|
86
91
|
type: 'success',
|
|
87
92
|
description: message,
|
|
@@ -95,7 +100,6 @@ const toast = {
|
|
|
95
100
|
loading: (message, props)=>show({
|
|
96
101
|
type: 'loading',
|
|
97
102
|
description: message,
|
|
98
|
-
timeout: 1 / 0,
|
|
99
103
|
...props
|
|
100
104
|
}),
|
|
101
105
|
show,
|
|
@@ -39,7 +39,7 @@ declare const ExtendedTooltip: import("react").ForwardRefExoticComponent<Omit<{
|
|
|
39
39
|
vocab?: string | undefined;
|
|
40
40
|
autoCorrect?: string | undefined;
|
|
41
41
|
autoSave?: string | undefined;
|
|
42
|
-
color?: "default" | "
|
|
42
|
+
color?: "default" | "success" | "foreground" | "secondary" | "primary" | "danger" | "warning" | undefined;
|
|
43
43
|
itemProp?: string | undefined;
|
|
44
44
|
itemScope?: boolean | undefined;
|
|
45
45
|
itemType?: string | undefined;
|
|
@@ -284,31 +284,31 @@ declare const ExtendedTooltip: import("react").ForwardRefExoticComponent<Omit<{
|
|
|
284
284
|
radius?: "sm" | "md" | "lg" | "none" | "full" | undefined;
|
|
285
285
|
offset?: number | undefined;
|
|
286
286
|
key?: import("react").Key | null | undefined;
|
|
287
|
-
|
|
287
|
+
classNames?: import("@heroui/theme").SlotsToClasses<"content" | "base" | "arrow"> | undefined;
|
|
288
288
|
isDisabled?: boolean | undefined;
|
|
289
|
-
|
|
289
|
+
disableAnimation?: boolean | undefined;
|
|
290
290
|
as?: import("@heroui/system-rsc").As<any> | undefined;
|
|
291
|
+
onOpenChange?: ((isOpen: boolean) => void) | undefined;
|
|
292
|
+
shouldCloseOnBlur?: boolean | undefined;
|
|
291
293
|
onClose?: ((() => void) & (() => void)) | undefined;
|
|
292
|
-
|
|
294
|
+
isOpen?: boolean | undefined;
|
|
293
295
|
placement?: import("@heroui/aria-utils").OverlayPlacement | undefined;
|
|
294
|
-
|
|
295
|
-
|
|
296
|
+
containerPadding?: number | undefined;
|
|
297
|
+
crossOffset?: number | undefined;
|
|
298
|
+
shouldFlip?: boolean | undefined;
|
|
299
|
+
isKeyboardDismissDisabled?: boolean | undefined;
|
|
300
|
+
shouldCloseOnInteractOutside?: ((element: Element) => boolean) | undefined;
|
|
301
|
+
isDismissable?: boolean | undefined;
|
|
302
|
+
showArrow?: boolean | undefined;
|
|
303
|
+
updatePositionDeps?: any[] | undefined;
|
|
304
|
+
shadow?: "sm" | "md" | "lg" | "none" | undefined;
|
|
296
305
|
triggerScaleOnOpen?: boolean | undefined;
|
|
297
306
|
isTriggerDisabled?: boolean | undefined;
|
|
298
|
-
|
|
299
|
-
trigger?: "focus" | undefined;
|
|
307
|
+
motionProps?: Omit<import("framer-motion").HTMLMotionProps<"div">, "ref"> | undefined;
|
|
300
308
|
portalContainer?: Element | undefined;
|
|
301
|
-
updatePositionDeps?: any[] | undefined;
|
|
302
|
-
isOpen?: boolean | undefined;
|
|
303
|
-
isDismissable?: boolean | undefined;
|
|
304
|
-
shouldCloseOnBlur?: boolean | undefined;
|
|
305
|
-
isKeyboardDismissDisabled?: boolean | undefined;
|
|
306
|
-
shouldCloseOnInteractOutside?: ((element: Element) => boolean) | undefined;
|
|
307
309
|
defaultOpen?: boolean | undefined;
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
shouldFlip?: boolean | undefined;
|
|
312
|
-
containerPadding?: number | undefined;
|
|
310
|
+
trigger?: "focus" | undefined;
|
|
311
|
+
delay?: number | undefined;
|
|
312
|
+
closeDelay?: number | undefined;
|
|
313
313
|
}, "ref"> & import("react").RefAttributes<import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>>>;
|
|
314
314
|
export default ExtendedTooltip;
|
package/dist/components/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * from "./layout/index.js";
|
|
2
2
|
export * from "./ProgressWrapper/index.js";
|
|
3
3
|
export * from "./typography/Text.js";
|
|
4
|
+
export * from "./UXAutocomplete/index.js";
|
|
4
5
|
export * from "./UXButton/index.js";
|
|
5
6
|
export * from "./UXCalendar/index.js";
|
|
6
7
|
export * from "./UXCheckbox/index.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@particle-network/ui-react",
|
|
3
|
-
"version": "0.4.0-beta.
|
|
3
|
+
"version": "0.4.0-beta.15",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
@@ -50,8 +50,8 @@
|
|
|
50
50
|
"ahooks": "^3.9.4",
|
|
51
51
|
"copy-to-clipboard": "^3.3.3",
|
|
52
52
|
"zustand": "^5.0.8",
|
|
53
|
-
"@particle-network/
|
|
54
|
-
"@particle-network/
|
|
53
|
+
"@particle-network/icons": "0.4.0-beta.8",
|
|
54
|
+
"@particle-network/ui-shared": "0.3.0-beta.2"
|
|
55
55
|
},
|
|
56
56
|
"scripts": {
|
|
57
57
|
"build": "rslib build",
|
package/tailwind-preset.js
CHANGED
|
@@ -127,9 +127,15 @@ module.exports = {
|
|
|
127
127
|
foreground: '#FFFFFF',
|
|
128
128
|
},
|
|
129
129
|
primary: {
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
130
|
+
100: '#F6EDF7',
|
|
131
|
+
200: '#EBCCF0',
|
|
132
|
+
300: '#E2A5EF',
|
|
133
|
+
400: '#DC78F4',
|
|
134
|
+
500: '#D745FF',
|
|
135
|
+
600: '#C10DF9',
|
|
136
|
+
700: '#900ABE',
|
|
137
|
+
800: '#5F0A80',
|
|
138
|
+
900: '#330845',
|
|
133
139
|
DEFAULT: '#D745FF',
|
|
134
140
|
foreground: '#FFFFFF',
|
|
135
141
|
},
|
|
@@ -204,9 +210,15 @@ module.exports = {
|
|
|
204
210
|
foreground: '#000000',
|
|
205
211
|
},
|
|
206
212
|
primary: {
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
213
|
+
100: '#F6EDF7',
|
|
214
|
+
200: '#EBCCF0',
|
|
215
|
+
300: '#E2A5EF',
|
|
216
|
+
400: '#DC78F4',
|
|
217
|
+
500: '#D745FF',
|
|
218
|
+
600: '#C10DF9',
|
|
219
|
+
700: '#900ABE',
|
|
220
|
+
800: '#5F0A80',
|
|
221
|
+
900: '#330845',
|
|
210
222
|
DEFAULT: '#D745FF',
|
|
211
223
|
foreground: '#FFFFFF',
|
|
212
224
|
},
|
|
@@ -281,9 +293,15 @@ module.exports = {
|
|
|
281
293
|
foreground: '#FFFFFF',
|
|
282
294
|
},
|
|
283
295
|
primary: {
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
296
|
+
100: '#F6EDF7',
|
|
297
|
+
200: '#EBCCF0',
|
|
298
|
+
300: '#E2A5EF',
|
|
299
|
+
400: '#DC78F4',
|
|
300
|
+
500: '#D745FF',
|
|
301
|
+
600: '#C10DF9',
|
|
302
|
+
700: '#900ABE',
|
|
303
|
+
800: '#5F0A80',
|
|
304
|
+
900: '#330845',
|
|
287
305
|
DEFAULT: '#D745FF',
|
|
288
306
|
foreground: '#FFFFFF',
|
|
289
307
|
},
|
|
@@ -358,9 +376,15 @@ module.exports = {
|
|
|
358
376
|
foreground: '#000000',
|
|
359
377
|
},
|
|
360
378
|
primary: {
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
379
|
+
100: '#F6EDF7',
|
|
380
|
+
200: '#EBCCF0',
|
|
381
|
+
300: '#E2A5EF',
|
|
382
|
+
400: '#DC78F4',
|
|
383
|
+
500: '#D745FF',
|
|
384
|
+
600: '#C10DF9',
|
|
385
|
+
700: '#900ABE',
|
|
386
|
+
800: '#5F0A80',
|
|
387
|
+
900: '#330845',
|
|
364
388
|
DEFAULT: '#D745FF',
|
|
365
389
|
foreground: '#FFFFFF',
|
|
366
390
|
},
|
|
@@ -435,9 +459,15 @@ module.exports = {
|
|
|
435
459
|
foreground: '#FDFDFE',
|
|
436
460
|
},
|
|
437
461
|
primary: {
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
462
|
+
100: '#F6EDF7',
|
|
463
|
+
200: '#EBCCF0',
|
|
464
|
+
300: '#E2A5EF',
|
|
465
|
+
400: '#DC78F4',
|
|
466
|
+
500: '#D745FF',
|
|
467
|
+
600: '#C10DF9',
|
|
468
|
+
700: '#900ABE',
|
|
469
|
+
800: '#5F0A80',
|
|
470
|
+
900: '#330845',
|
|
441
471
|
DEFAULT: '#D745FF',
|
|
442
472
|
foreground: '#FFFFFF',
|
|
443
473
|
},
|
|
@@ -512,9 +542,15 @@ module.exports = {
|
|
|
512
542
|
foreground: '#0C0C0F',
|
|
513
543
|
},
|
|
514
544
|
primary: {
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
545
|
+
100: '#F6EDF7',
|
|
546
|
+
200: '#EBCCF0',
|
|
547
|
+
300: '#E2A5EF',
|
|
548
|
+
400: '#DC78F4',
|
|
549
|
+
500: '#D745FF',
|
|
550
|
+
600: '#C10DF9',
|
|
551
|
+
700: '#900ABE',
|
|
552
|
+
800: '#5F0A80',
|
|
553
|
+
900: '#330845',
|
|
518
554
|
DEFAULT: '#D745FF',
|
|
519
555
|
foreground: '#FFFFFF',
|
|
520
556
|
},
|
|
@@ -589,9 +625,15 @@ module.exports = {
|
|
|
589
625
|
foreground: '#F0F5F5',
|
|
590
626
|
},
|
|
591
627
|
primary: {
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
628
|
+
100: '#F0F5F2',
|
|
629
|
+
200: '#D9EADF',
|
|
630
|
+
300: '#C0E2CC',
|
|
631
|
+
400: '#A4DCB6',
|
|
632
|
+
500: '#86D99F',
|
|
633
|
+
600: '#55C674',
|
|
634
|
+
700: '#399D53',
|
|
635
|
+
800: '#286938',
|
|
636
|
+
900: '#16361D',
|
|
595
637
|
DEFAULT: '#86D99F',
|
|
596
638
|
foreground: '#000000',
|
|
597
639
|
},
|
|
@@ -666,9 +708,15 @@ module.exports = {
|
|
|
666
708
|
foreground: '#FCFCFC',
|
|
667
709
|
},
|
|
668
710
|
primary: {
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
711
|
+
100: '#EDEEF7',
|
|
712
|
+
200: '#CFD2F1',
|
|
713
|
+
300: '#ABB3F0',
|
|
714
|
+
400: '#8192F5',
|
|
715
|
+
500: '#526FFF',
|
|
716
|
+
600: '#1741F9',
|
|
717
|
+
700: '#0A31C4',
|
|
718
|
+
800: '#0B2683',
|
|
719
|
+
900: '#081745',
|
|
672
720
|
DEFAULT: '#526FFF',
|
|
673
721
|
foreground: '#000000',
|
|
674
722
|
},
|
|
@@ -743,9 +791,15 @@ module.exports = {
|
|
|
743
791
|
foreground: '#F6FEFD',
|
|
744
792
|
},
|
|
745
793
|
primary: {
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
794
|
+
100: '#EFF5F5',
|
|
795
|
+
200: '#CEE6E4',
|
|
796
|
+
300: '#A8DBD6',
|
|
797
|
+
400: '#7ED4CB',
|
|
798
|
+
500: '#50D2C1',
|
|
799
|
+
600: '#34B9A5',
|
|
800
|
+
700: '#2B8C7C',
|
|
801
|
+
800: '#206255',
|
|
802
|
+
900: '#143831',
|
|
749
803
|
DEFAULT: '#50D2C1',
|
|
750
804
|
foreground: '#000000',
|
|
751
805
|
},
|
|
@@ -820,9 +874,15 @@ module.exports = {
|
|
|
820
874
|
foreground: '#FFFFFF',
|
|
821
875
|
},
|
|
822
876
|
primary: {
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
877
|
+
100: '#F0EEF6',
|
|
878
|
+
200: '#E2DEF2',
|
|
879
|
+
300: '#D2CBEF',
|
|
880
|
+
400: '#C0B6EF',
|
|
881
|
+
500: '#AB9FF2',
|
|
882
|
+
600: '#6C5BE5',
|
|
883
|
+
700: '#3626C9',
|
|
884
|
+
800: '#241C82',
|
|
885
|
+
900: '#120F3E',
|
|
826
886
|
DEFAULT: '#AB9FF2',
|
|
827
887
|
foreground: '#000000',
|
|
828
888
|
},
|
|
@@ -897,9 +957,15 @@ module.exports = {
|
|
|
897
957
|
foreground: '#EAECEF',
|
|
898
958
|
},
|
|
899
959
|
primary: {
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
960
|
+
100: '#F7F6ED',
|
|
961
|
+
200: '#EFEAC9',
|
|
962
|
+
300: '#EDE09E',
|
|
963
|
+
400: '#F1DA6D',
|
|
964
|
+
500: '#FCD535',
|
|
965
|
+
600: '#EEBD0A',
|
|
966
|
+
700: '#B38B0C',
|
|
967
|
+
800: '#7A5D0C',
|
|
968
|
+
900: '#443309',
|
|
903
969
|
DEFAULT: '#FCD535',
|
|
904
970
|
foreground: '#000000',
|
|
905
971
|
},
|
|
@@ -974,9 +1040,15 @@ module.exports = {
|
|
|
974
1040
|
foreground: '#E9E9E9',
|
|
975
1041
|
},
|
|
976
1042
|
primary: {
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
1043
|
+
100: '#EFF6F3',
|
|
1044
|
+
200: '#D2E9DE',
|
|
1045
|
+
300: '#B0E1C9',
|
|
1046
|
+
400: '#8BDCB3',
|
|
1047
|
+
500: '#61DC9B',
|
|
1048
|
+
600: '#34CD79',
|
|
1049
|
+
700: '#2A9B5A',
|
|
1050
|
+
800: '#1F693E',
|
|
1051
|
+
900: '#133A22',
|
|
980
1052
|
DEFAULT: '#61DC9B',
|
|
981
1053
|
foreground: '#000000',
|
|
982
1054
|
},
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { UXColor } from '@particle-network/ui-shared';
|
|
2
|
-
export type ThemeId = 'ux-purple-gold-dark' | 'ux-purple-gold-light' | 'ux-green-red-dark' | 'ux-green-red-light' | 'ux-green-red-soft-dark' | 'ux-green-red-soft-light' | 'gmgn-dark' | 'axiom-dark' | 'hyperliquid-dark' | 'phantom-dark' | 'binance-dark' | 'bullx-dark';
|
|
3
|
-
export type ColorScheme = 'dark' | 'light';
|
|
4
|
-
export interface ThemeItemType {
|
|
5
|
-
id: ThemeId;
|
|
6
|
-
zhName: string;
|
|
7
|
-
enName: string;
|
|
8
|
-
colorScheme: ColorScheme;
|
|
9
|
-
colorVariables: Record<UXColor, string>;
|
|
10
|
-
}
|
|
11
|
-
export declare const themeData: ThemeItemType[];
|
|
12
|
-
export declare const themeKeys: ThemeId[];
|