@particle-network/ui-native 0.0.17 → 0.0.19
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/README.md +10 -10
- package/dist/components/UXButton/button.js +9 -7
- package/dist/components/UXButton/button.styles.d.ts +3 -1
- package/dist/components/UXButton/button.styles.js +20 -13
- package/dist/components/UXButton/button.types.d.ts +7 -0
- package/dist/components/UXChip/chip.js +1 -2
- package/dist/components/UXChip/styles.d.ts +2 -1
- package/dist/components/UXChip/styles.js +12 -2
- package/dist/components/UXModal/index.js +1 -1
- package/dist/components/UXSpinner/SpinnerIcon.d.ts +7 -0
- package/dist/components/UXSpinner/SpinnerIcon.js +37 -0
- package/dist/components/UXSpinner/index.d.ts +2 -0
- package/dist/components/UXSpinner/index.js +2 -0
- package/dist/components/UXSpinner/pathData.d.ts +4 -0
- package/dist/components/UXSpinner/pathData.js +51 -0
- package/dist/components/UXSpinner/spinner.d.ts +16 -0
- package/dist/components/UXSpinner/spinner.js +36 -0
- package/dist/components/UXTabs/tabs.js +1 -1
- package/dist/components/UXToast/ToastIcon.d.ts +7 -0
- package/dist/components/UXToast/ToastIcon.js +62 -0
- package/dist/components/UXToast/ToastView.d.ts +10 -0
- package/dist/components/UXToast/ToastView.js +71 -0
- package/dist/components/UXToast/fail.js +14 -0
- package/dist/components/UXToast/index.d.ts +3 -0
- package/dist/components/UXToast/index.js +2 -0
- package/dist/components/UXToast/success.js +14 -0
- package/dist/components/UXToast/toast.d.ts +7 -0
- package/dist/components/UXToast/toast.js +29 -0
- package/dist/components/UXToast/toastConfig.d.ts +16 -0
- package/dist/components/UXToast/toastConfig.js +21 -0
- package/dist/components/UXToast/types.d.ts +7 -0
- package/dist/components/UXToast/types.js +0 -0
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.js +2 -0
- package/dist/config/config.default.js +3 -0
- package/dist/config/config.ux.js +3 -0
- package/dist/icons/CloseIcon.d.ts +4 -0
- package/dist/icons/CloseIcon.js +21 -0
- package/dist/types/theme.d.ts +3 -0
- package/dist/utils/triggerHapticFeedback.js +4 -1
- package/entry.js +5 -0
- package/package.json +52 -54
package/README.md
CHANGED
|
@@ -190,38 +190,38 @@ const customTheme = {
|
|
|
190
190
|
|
|
191
191
|
```bash
|
|
192
192
|
# Web 版 Storybook(推荐用于开发)
|
|
193
|
-
|
|
193
|
+
pnpm storybook:web
|
|
194
194
|
|
|
195
195
|
# 设备上的 Storybook
|
|
196
|
-
|
|
196
|
+
pnpm storybook
|
|
197
197
|
|
|
198
198
|
# iOS
|
|
199
|
-
|
|
199
|
+
pnpm storybook:ios
|
|
200
200
|
|
|
201
201
|
# Android
|
|
202
|
-
|
|
202
|
+
pnpm storybook:android
|
|
203
203
|
```
|
|
204
204
|
|
|
205
205
|
### 开发命令
|
|
206
206
|
|
|
207
207
|
```bash
|
|
208
208
|
# 安装依赖
|
|
209
|
-
|
|
209
|
+
pnpm install
|
|
210
210
|
|
|
211
211
|
# 启动开发
|
|
212
|
-
|
|
212
|
+
pnpm start
|
|
213
213
|
|
|
214
214
|
# 构建库
|
|
215
|
-
|
|
215
|
+
pnpm build
|
|
216
216
|
|
|
217
217
|
# 运行测试
|
|
218
|
-
|
|
218
|
+
pnpm test
|
|
219
219
|
|
|
220
220
|
# 类型检查
|
|
221
|
-
|
|
221
|
+
pnpm type-check
|
|
222
222
|
|
|
223
223
|
# 代码检查
|
|
224
|
-
|
|
224
|
+
pnpm lint
|
|
225
225
|
```
|
|
226
226
|
|
|
227
227
|
## 📱 平台支持
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef, useMemo } from "react";
|
|
3
|
-
import {
|
|
3
|
+
import { Keyboard } from "react-native";
|
|
4
4
|
import { triggerHapticFeedback } from "../../utils/triggerHapticFeedback.js";
|
|
5
5
|
import { Text } from "../Text/index.js";
|
|
6
6
|
import { UXPressable } from "../UXPressable/index.js";
|
|
7
|
+
import { UXSpinner } from "../UXSpinner/index.js";
|
|
7
8
|
import { useStyles } from "./button.styles.js";
|
|
8
9
|
const UXButton = /*#__PURE__*/ forwardRef((props, ref)=>{
|
|
9
10
|
const { style, size, radius, color, variant, onPress, isDisabled, isLoading, startContent, endContent, fullWidth, width, w, h, isIconOnly, children, ...restProps } = props;
|
|
@@ -12,7 +13,7 @@ const UXButton = /*#__PURE__*/ forwardRef((props, ref)=>{
|
|
|
12
13
|
triggerHapticFeedback();
|
|
13
14
|
onPress?.(e);
|
|
14
15
|
};
|
|
15
|
-
const { styles, textColor } = useStyles({
|
|
16
|
+
const { styles, textColor, spinnerSize } = useStyles({
|
|
16
17
|
size,
|
|
17
18
|
radius,
|
|
18
19
|
color,
|
|
@@ -36,15 +37,15 @@ const UXButton = /*#__PURE__*/ forwardRef((props, ref)=>{
|
|
|
36
37
|
styles.title
|
|
37
38
|
]);
|
|
38
39
|
const renderChildren = useMemo(()=>{
|
|
39
|
-
if (isLoading && isIconOnly) return /*#__PURE__*/ jsx(
|
|
40
|
+
if (isLoading && isIconOnly) return /*#__PURE__*/ jsx(UXSpinner, {
|
|
40
41
|
color: textColor,
|
|
41
|
-
size:
|
|
42
|
+
size: spinnerSize
|
|
42
43
|
});
|
|
43
44
|
return /*#__PURE__*/ jsxs(Fragment, {
|
|
44
45
|
children: [
|
|
45
|
-
isLoading ? /*#__PURE__*/ jsx(
|
|
46
|
+
isLoading ? /*#__PURE__*/ jsx(UXSpinner, {
|
|
46
47
|
color: textColor,
|
|
47
|
-
size:
|
|
48
|
+
size: spinnerSize
|
|
48
49
|
}) : null,
|
|
49
50
|
startContent,
|
|
50
51
|
content,
|
|
@@ -57,7 +58,8 @@ const UXButton = /*#__PURE__*/ forwardRef((props, ref)=>{
|
|
|
57
58
|
textColor,
|
|
58
59
|
startContent,
|
|
59
60
|
endContent,
|
|
60
|
-
isIconOnly
|
|
61
|
+
isIconOnly,
|
|
62
|
+
spinnerSize
|
|
61
63
|
]);
|
|
62
64
|
return /*#__PURE__*/ jsx(UXPressable, {
|
|
63
65
|
ref: ref,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { UXColor } from '@particle-network/ui-shared';
|
|
1
2
|
import type { UXButtonProps } from './button.types';
|
|
2
3
|
export declare const useStyles: (props: UXButtonProps) => {
|
|
3
4
|
styles: {
|
|
@@ -30,5 +31,6 @@ export declare const useStyles: (props: UXButtonProps) => {
|
|
|
30
31
|
color: string | undefined;
|
|
31
32
|
};
|
|
32
33
|
};
|
|
33
|
-
textColor:
|
|
34
|
+
textColor: UXColor;
|
|
35
|
+
spinnerSize: number;
|
|
34
36
|
};
|
|
@@ -34,9 +34,9 @@ const useStyles = (props)=>{
|
|
|
34
34
|
auto: 'sm'
|
|
35
35
|
};
|
|
36
36
|
const paddingMap = useMemo(()=>({
|
|
37
|
-
sm: ms(
|
|
38
|
-
md: ms(
|
|
39
|
-
lg: ms(
|
|
37
|
+
sm: ms(6),
|
|
38
|
+
md: ms(10),
|
|
39
|
+
lg: ms(14)
|
|
40
40
|
}), [
|
|
41
41
|
ms
|
|
42
42
|
]);
|
|
@@ -66,6 +66,10 @@ const useStyles = (props)=>{
|
|
|
66
66
|
size,
|
|
67
67
|
fontSizeMap
|
|
68
68
|
]);
|
|
69
|
+
const spinnerSize = useMemo(()=>fontSize + ms(4), [
|
|
70
|
+
fontSize,
|
|
71
|
+
ms
|
|
72
|
+
]);
|
|
69
73
|
const borderRadius = useMemo(()=>getRadius(radius ?? radiusMap[size]), [
|
|
70
74
|
radius,
|
|
71
75
|
size,
|
|
@@ -82,19 +86,21 @@ const useStyles = (props)=>{
|
|
|
82
86
|
]);
|
|
83
87
|
const textColor = useMemo(()=>{
|
|
84
88
|
const customColorConfig = buttonConfig?.color?.[color];
|
|
85
|
-
if (
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
'
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
return getColor(color);
|
|
89
|
+
if ('solid' === variant) {
|
|
90
|
+
if (customColorConfig) return customColorConfig.text;
|
|
91
|
+
if ('contrast' === color) return 'bg-default';
|
|
92
|
+
return 'white';
|
|
93
|
+
}
|
|
94
|
+
return color;
|
|
92
95
|
}, [
|
|
93
96
|
color,
|
|
94
|
-
getColor,
|
|
95
97
|
variant,
|
|
96
98
|
buttonConfig?.color
|
|
97
99
|
]);
|
|
100
|
+
const textActualColor = useMemo(()=>getColor(textColor), [
|
|
101
|
+
textColor,
|
|
102
|
+
getColor
|
|
103
|
+
]);
|
|
98
104
|
const backgroundColor = useMemo(()=>{
|
|
99
105
|
const customColorConfig = buttonConfig?.color?.[color];
|
|
100
106
|
if ('solid' === variant) {
|
|
@@ -172,12 +178,13 @@ const useStyles = (props)=>{
|
|
|
172
178
|
fontWeight,
|
|
173
179
|
fontSize,
|
|
174
180
|
lineHeight: fontSize + ms(4),
|
|
175
|
-
color:
|
|
181
|
+
color: textActualColor
|
|
176
182
|
}
|
|
177
183
|
});
|
|
178
184
|
return {
|
|
179
185
|
styles,
|
|
180
|
-
textColor
|
|
186
|
+
textColor,
|
|
187
|
+
spinnerSize
|
|
181
188
|
};
|
|
182
189
|
};
|
|
183
190
|
export { useStyles };
|
|
@@ -13,6 +13,13 @@ export interface UXButtonProps extends Omit<UXPressableProps, 'style' | 'disable
|
|
|
13
13
|
* | sm | 24 | 40 |
|
|
14
14
|
* | md | 30 | 44 |
|
|
15
15
|
* | lg | 44 | 48 |
|
|
16
|
+
*
|
|
17
|
+
* fontSize
|
|
18
|
+
* | size | ux-pro | ux |
|
|
19
|
+
* | :----- | :----- | :----- |
|
|
20
|
+
* | sm | 10 | 14 |
|
|
21
|
+
* | md | 12 | 16 |
|
|
22
|
+
* | lg | 16 | 18 |
|
|
16
23
|
*/
|
|
17
24
|
size?: 'sm' | 'md' | 'lg' | 'auto';
|
|
18
25
|
variant?: 'solid' | 'bordered' | 'flat' | 'text' | 'light';
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import type { UXChipProps } from './types';
|
|
2
2
|
export declare const useStyles: ({ size, color, variant, isDisabled }: UXChipProps) => {
|
|
3
|
-
|
|
3
|
+
chip: {
|
|
4
4
|
height: number;
|
|
5
5
|
backgroundColor: string | undefined;
|
|
6
6
|
opacity: number;
|
|
7
|
+
paddingHorizontal: number;
|
|
7
8
|
};
|
|
8
9
|
title: {
|
|
9
10
|
fontWeight: 400;
|
|
@@ -52,11 +52,21 @@ const useStyles = ({ size = 'md', color = 'default', variant = 'flat', isDisable
|
|
|
52
52
|
getColor,
|
|
53
53
|
variant
|
|
54
54
|
]);
|
|
55
|
+
const paddingHorizontal = useMemo(()=>{
|
|
56
|
+
if ('sm' === size) return ms(4);
|
|
57
|
+
if ('md' === size) return ms(6);
|
|
58
|
+
if ('lg' === size) return ms(8);
|
|
59
|
+
return 0;
|
|
60
|
+
}, [
|
|
61
|
+
size,
|
|
62
|
+
ms
|
|
63
|
+
]);
|
|
55
64
|
const styles = StyleSheet.create({
|
|
56
|
-
|
|
65
|
+
chip: {
|
|
57
66
|
height,
|
|
58
67
|
backgroundColor,
|
|
59
|
-
opacity: isDisabled ? disabledOpacity : 1
|
|
68
|
+
opacity: isDisabled ? disabledOpacity : 1,
|
|
69
|
+
paddingHorizontal
|
|
60
70
|
},
|
|
61
71
|
title: {
|
|
62
72
|
fontWeight: 400,
|
|
@@ -3,6 +3,7 @@ import react, { forwardRef, useCallback, useEffect, useMemo, useRef, useState }
|
|
|
3
3
|
import { Animated, Dimensions, PanResponder, Platform, ScrollView, StyleSheet } from "react-native";
|
|
4
4
|
import { Modal, Portal } from "react-native-paper";
|
|
5
5
|
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
|
6
|
+
import { setColorWithOpacity } from "@particle-network/ui-shared";
|
|
6
7
|
import { useColors, useComponentConfig, useKeyboard, useMs } from "../../hooks/index.js";
|
|
7
8
|
import { Box } from "../layout/Box/index.js";
|
|
8
9
|
import { Circle } from "../layout/Circle.js";
|
|
@@ -10,7 +11,6 @@ import { Flex } from "../layout/Flex/index.js";
|
|
|
10
11
|
import { HStack } from "../layout/HStack.js";
|
|
11
12
|
import { VStack } from "../layout/VStack.js";
|
|
12
13
|
import { Text } from "../Text/index.js";
|
|
13
|
-
import { setColorWithOpacity } from "@particle-network/ui-shared";
|
|
14
14
|
const { height } = Dimensions.get('window');
|
|
15
15
|
const UXModal = /*#__PURE__*/ forwardRef((props, scrollViewRef)=>{
|
|
16
16
|
const { style, contentStyle, isOpen, title, titleAlign = 'left', onClose, onVisibleChange, children, disableCloseBySwipe, closeByLineOnly, wrapPortal, footer, modalName, tip, keyboardAvoidPosition = 'container' } = props;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import "react";
|
|
3
|
+
import react_native_svg, { Path } from "react-native-svg";
|
|
4
|
+
import { pathsData } from "./pathData.js";
|
|
5
|
+
const SpinnerIcon = ({ currentIndex, ...props })=>{
|
|
6
|
+
const opacityValues = [
|
|
7
|
+
1,
|
|
8
|
+
0.9,
|
|
9
|
+
0.85,
|
|
10
|
+
0.8,
|
|
11
|
+
0.75,
|
|
12
|
+
0.7,
|
|
13
|
+
0.65,
|
|
14
|
+
0.6,
|
|
15
|
+
0.5,
|
|
16
|
+
0.4,
|
|
17
|
+
0.3,
|
|
18
|
+
0.2
|
|
19
|
+
];
|
|
20
|
+
const getOpacity = (index)=>{
|
|
21
|
+
const distance = (currentIndex - index + 12) % 12;
|
|
22
|
+
return opacityValues[distance];
|
|
23
|
+
};
|
|
24
|
+
return /*#__PURE__*/ jsx(react_native_svg, {
|
|
25
|
+
width: 18,
|
|
26
|
+
height: 18,
|
|
27
|
+
viewBox: "0 0 18 18",
|
|
28
|
+
fill: "none",
|
|
29
|
+
...props,
|
|
30
|
+
children: pathsData.map((pathInfo, index)=>/*#__PURE__*/ jsx(Path, {
|
|
31
|
+
d: pathInfo.d,
|
|
32
|
+
fill: "currentColor",
|
|
33
|
+
opacity: getOpacity(index)
|
|
34
|
+
}, index))
|
|
35
|
+
});
|
|
36
|
+
};
|
|
37
|
+
export { SpinnerIcon };
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
const pathsData = [
|
|
2
|
+
{
|
|
3
|
+
d: 'M9.00027 1.08008C9.19123 1.08008 9.37436 1.15594 9.50939 1.29096C9.64442 1.42599 9.72027 1.60912 9.72027 1.80008V3.96008C9.72027 4.15103 9.64442 4.33417 9.50939 4.46919C9.37436 4.60422 9.19123 4.68008 9.00027 4.68008C8.80932 4.68008 8.62618 4.60422 8.49116 4.46919C8.35613 4.33417 8.28027 4.15103 8.28027 3.96008V1.80008C8.28027 1.60912 8.35613 1.42599 8.49116 1.29096C8.62618 1.15594 8.80932 1.08008 9.00027 1.08008Z',
|
|
4
|
+
opacity: 1
|
|
5
|
+
},
|
|
6
|
+
{
|
|
7
|
+
d: 'M12.9593 2.14138C13.1246 2.23686 13.2453 2.39412 13.2947 2.57857C13.3441 2.76301 13.3183 2.95953 13.2228 3.1249L12.1428 4.99582C12.0959 5.07837 12.0331 5.15081 11.958 5.20899C11.883 5.26717 11.7972 5.30993 11.7055 5.3348C11.6139 5.35968 11.5182 5.36619 11.4241 5.35395C11.3299 5.34171 11.2391 5.31097 11.1569 5.26349C11.0746 5.21601 11.0026 5.15274 10.9449 5.07731C10.8873 5.00188 10.8451 4.91579 10.8208 4.82399C10.7965 4.73219 10.7906 4.6365 10.8035 4.54242C10.8164 4.44834 10.8477 4.35774 10.8957 4.27582L11.9757 2.4049C12.0712 2.23954 12.2285 2.11887 12.4129 2.06945C12.5974 2.02004 12.7939 2.04591 12.9593 2.14138Z',
|
|
8
|
+
opacity: 0.9
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
d: 'M15.8587 5.03967C15.9542 5.20504 15.9801 5.40156 15.9307 5.586C15.8813 5.77045 15.7606 5.92771 15.5952 6.02319L13.7243 7.10319C13.559 7.19716 13.3633 7.22194 13.1798 7.17213C12.9963 7.12231 12.84 7.00194 12.7449 6.83729C12.6498 6.67263 12.6238 6.47706 12.6724 6.29325C12.721 6.10943 12.8403 5.9523 13.0043 5.85615L14.8752 4.77615C15.0406 4.68067 15.2371 4.6548 15.4216 4.70422C15.606 4.75364 15.7633 4.8743 15.8587 5.03967Z',
|
|
12
|
+
opacity: 0.85
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
d: 'M16.9203 8.9993C16.9203 9.09385 16.9017 9.18747 16.8655 9.27483C16.8293 9.36218 16.7763 9.44156 16.7094 9.50841C16.6426 9.57527 16.5632 9.62831 16.4758 9.66449C16.3885 9.70067 16.2949 9.7193 16.2003 9.7193H14.0403C13.8494 9.7193 13.6662 9.64344 13.5312 9.50841C13.3962 9.37339 13.3203 9.19025 13.3203 8.9993C13.3203 8.80834 13.3962 8.62521 13.5312 8.49018C13.6662 8.35515 13.8494 8.2793 14.0403 8.2793H16.2003C16.2949 8.2793 16.3885 8.29792 16.4758 8.3341C16.5632 8.37029 16.6426 8.42332 16.7094 8.49018C16.7763 8.55704 16.8293 8.63641 16.8655 8.72376C16.9017 8.81112 16.9203 8.90474 16.9203 8.9993Z',
|
|
16
|
+
opacity: 0.8
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
d: 'M15.8592 12.9612C15.7637 13.1266 15.6065 13.2472 15.422 13.2967C15.2376 13.3461 15.041 13.3202 14.8757 13.2247L13.0048 12.1447C12.9222 12.0978 12.8498 12.035 12.7916 11.96C12.7334 11.8849 12.6907 11.7991 12.6658 11.7075C12.6409 11.6158 12.6344 11.5202 12.6466 11.426C12.6589 11.3319 12.6896 11.2411 12.7371 11.1588C12.7846 11.0766 12.8478 11.0046 12.9233 10.9469C12.9987 10.8892 13.0848 10.847 13.1766 10.8227C13.2684 10.7985 13.3641 10.7926 13.4582 10.8055C13.5522 10.8183 13.6428 10.8497 13.7248 10.8977L15.5957 11.9777C15.761 12.0732 15.8817 12.2304 15.9311 12.4149C15.9805 12.5993 15.9547 12.7958 15.8592 12.9612Z',
|
|
20
|
+
opacity: 0.75
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
d: 'M12.9603 15.8587C12.795 15.9542 12.5985 15.9801 12.414 15.9307C12.2296 15.8813 12.0723 15.7606 11.9768 15.5952L10.8968 13.7243C10.8029 13.559 10.7781 13.3633 10.8279 13.1798C10.8777 12.9963 10.9981 12.84 11.1627 12.7449C11.3274 12.6498 11.523 12.6238 11.7068 12.6724C11.8906 12.721 12.0477 12.8403 12.1439 13.0043L13.2239 14.8752C13.3193 15.0406 13.3452 15.2371 13.2958 15.4216C13.2464 15.606 13.1257 15.7633 12.9603 15.8587Z',
|
|
24
|
+
opacity: 0.7
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
d: 'M9.00027 16.9203C8.90572 16.9203 8.8121 16.9017 8.72474 16.8655C8.63739 16.8293 8.55801 16.7763 8.49116 16.7094C8.4243 16.6426 8.37126 16.5632 8.33508 16.4758C8.2989 16.3885 8.28027 16.2949 8.28027 16.2003V14.0403C8.28027 13.8494 8.35613 13.6662 8.49116 13.5312C8.62618 13.3962 8.80932 13.3203 9.00027 13.3203C9.19123 13.3203 9.37436 13.3962 9.50939 13.5312C9.64442 13.6662 9.72027 13.8494 9.72027 14.0403V16.2003C9.72027 16.2949 9.70165 16.3885 9.66547 16.4758C9.62928 16.5632 9.57625 16.6426 9.50939 16.7094C9.44253 16.7763 9.36316 16.8293 9.27581 16.8655C9.18845 16.9017 9.09483 16.9203 9.00027 16.9203Z',
|
|
28
|
+
opacity: 0.65
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
d: 'M5.03967 15.8592C4.8743 15.7637 4.75364 15.6065 4.70422 15.422C4.6548 15.2376 4.68067 15.041 4.77615 14.8757L5.85615 13.0048C5.90308 12.9222 5.96587 12.8498 6.04092 12.7916C6.11596 12.7334 6.20177 12.6907 6.29341 12.6658C6.38505 12.6409 6.4807 12.6344 6.57486 12.6466C6.66902 12.6589 6.75983 12.6896 6.84206 12.7371C6.9243 12.7846 6.99632 12.8478 7.054 12.9233C7.11168 12.9987 7.15387 13.0848 7.17814 13.1766C7.20241 13.2684 7.20828 13.3641 7.19542 13.4582C7.18256 13.5522 7.15121 13.6428 7.10319 13.7248L6.02319 15.5957C5.92771 15.761 5.77045 15.8817 5.586 15.9311C5.40156 15.9805 5.20504 15.9547 5.03967 15.8592Z',
|
|
32
|
+
opacity: 0.6
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
d: 'M2.14041 12.9584C2.04493 12.793 2.01906 12.5965 2.06848 12.4121C2.1179 12.2276 2.23856 12.0704 2.40393 11.9749L4.27485 10.8949C4.44013 10.8009 4.63587 10.7761 4.81936 10.8259C5.00284 10.8758 5.15918 10.9961 5.25424 11.1608C5.34931 11.3254 5.37539 11.521 5.32679 11.7048C5.2782 11.8886 5.15887 12.0458 4.99485 12.1419L3.12393 13.2219C2.95856 13.3174 2.76203 13.3433 2.57759 13.2938C2.39315 13.2444 2.23589 13.1238 2.14041 12.9584Z',
|
|
36
|
+
opacity: 0.5
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
d: 'M1.08017 8.9993C1.08017 8.80834 1.15603 8.62521 1.29105 8.49018C1.42608 8.35515 1.60921 8.2793 1.80017 8.2793H3.96017C4.15113 8.2793 4.33426 8.35515 4.46929 8.49018C4.60431 8.62521 4.68017 8.80834 4.68017 8.9993C4.68017 9.19025 4.60431 9.37339 4.46929 9.50841C4.33426 9.64344 4.15113 9.7193 3.96017 9.7193H1.80017C1.60921 9.7193 1.42608 9.64344 1.29105 9.50841C1.15603 9.37339 1.08017 9.19025 1.08017 8.9993Z',
|
|
40
|
+
opacity: 0.4
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
d: 'M2.14041 5.03967C2.23589 4.8743 2.39315 4.75364 2.57759 4.70422C2.76203 4.6548 2.95856 4.68067 3.12393 4.77615L4.99485 5.85615C5.07739 5.90308 5.14984 5.96587 5.20801 6.04092C5.26619 6.11596 5.30895 6.20177 5.33383 6.29341C5.35871 6.38505 5.36521 6.4807 5.35298 6.57486C5.34074 6.66902 5.30999 6.75983 5.26252 6.84206C5.21504 6.9243 5.15176 6.99632 5.07633 7.054C5.00091 7.11168 4.91481 7.15387 4.82301 7.17814C4.73122 7.20241 4.63552 7.20828 4.54144 7.19542C4.44736 7.18256 4.35676 7.15121 4.27485 7.10319L2.40393 6.02319C2.23856 5.92771 2.1179 5.77045 2.06848 5.586C2.01906 5.40156 2.04493 5.20504 2.14041 5.03967Z',
|
|
44
|
+
opacity: 0.3
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
d: 'M5.03967 2.14138C5.20504 2.04591 5.40156 2.02004 5.586 2.06945C5.77045 2.11887 5.92771 2.23954 6.02319 2.4049L7.10319 4.27582C7.19716 4.4411 7.22194 4.63685 7.17213 4.82033C7.12231 5.00382 7.00194 5.16015 6.83729 5.25522C6.67263 5.35029 6.47706 5.37637 6.29325 5.32777C6.10943 5.27917 5.9523 5.15984 5.85615 4.99582L4.77615 3.1249C4.68067 2.95953 4.6548 2.76301 4.70422 2.57857C4.75364 2.39412 4.8743 2.23686 5.03967 2.14138Z',
|
|
48
|
+
opacity: 0.2
|
|
49
|
+
}
|
|
50
|
+
];
|
|
51
|
+
export { pathsData };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { UXColor } from '@particle-network/ui-shared';
|
|
3
|
+
import { type SquareProps } from '../layout/Square';
|
|
4
|
+
export interface UXSpinnerProps extends SquareProps {
|
|
5
|
+
/**
|
|
6
|
+
* 颜色
|
|
7
|
+
*/
|
|
8
|
+
color?: UXColor;
|
|
9
|
+
/**
|
|
10
|
+
* 动画持续时间(毫秒)
|
|
11
|
+
* @default 1000
|
|
12
|
+
*/
|
|
13
|
+
duration?: number;
|
|
14
|
+
}
|
|
15
|
+
declare const UXSpinner: React.FC<UXSpinnerProps>;
|
|
16
|
+
export default UXSpinner;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useRef, useState } from "react";
|
|
3
|
+
import { useColors } from "../../hooks/index.js";
|
|
4
|
+
import { Square } from "../layout/Square.js";
|
|
5
|
+
import { SpinnerIcon } from "./SpinnerIcon.js";
|
|
6
|
+
const UXSpinner = ({ size = 18, color = 'primary', duration = 1000, ...restProps })=>{
|
|
7
|
+
const { getColor } = useColors();
|
|
8
|
+
const [currentIndex, setCurrentIndex] = useState(0);
|
|
9
|
+
const animationRef = useRef(null);
|
|
10
|
+
const actualColor = getColor(color);
|
|
11
|
+
useEffect(()=>{
|
|
12
|
+
const stepDuration = duration / 12;
|
|
13
|
+
const animate = ()=>{
|
|
14
|
+
setCurrentIndex((prevIndex)=>(prevIndex + 1) % 12);
|
|
15
|
+
animationRef.current = setTimeout(animate, stepDuration);
|
|
16
|
+
};
|
|
17
|
+
animationRef.current = setTimeout(animate, stepDuration);
|
|
18
|
+
return ()=>{
|
|
19
|
+
if (animationRef.current) clearTimeout(animationRef.current);
|
|
20
|
+
};
|
|
21
|
+
}, [
|
|
22
|
+
duration
|
|
23
|
+
]);
|
|
24
|
+
return /*#__PURE__*/ jsx(Square, {
|
|
25
|
+
size: size,
|
|
26
|
+
...restProps,
|
|
27
|
+
children: /*#__PURE__*/ jsx(SpinnerIcon, {
|
|
28
|
+
width: size,
|
|
29
|
+
height: size,
|
|
30
|
+
color: actualColor,
|
|
31
|
+
currentIndex: currentIndex
|
|
32
|
+
})
|
|
33
|
+
});
|
|
34
|
+
};
|
|
35
|
+
const spinner = UXSpinner;
|
|
36
|
+
export { spinner as default };
|
|
@@ -48,6 +48,7 @@ const UXTabs = (props)=>{
|
|
|
48
48
|
},
|
|
49
49
|
children: /*#__PURE__*/ jsxs(VStack, {
|
|
50
50
|
gap: "md",
|
|
51
|
+
...restProps,
|
|
51
52
|
children: [
|
|
52
53
|
/*#__PURE__*/ jsx(HStack, {
|
|
53
54
|
opacity: isDisabled ? disabledOpacity : 1,
|
|
@@ -55,7 +56,6 @@ const UXTabs = (props)=>{
|
|
|
55
56
|
styles.tabsWrapper,
|
|
56
57
|
style
|
|
57
58
|
],
|
|
58
|
-
...restProps,
|
|
59
59
|
children: tabs
|
|
60
60
|
}),
|
|
61
61
|
renderSelectedTabContent()
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import * as __WEBPACK_EXTERNAL_MODULE__fail_js_ca7b5988__ from "./fail.js";
|
|
2
|
+
import * as __WEBPACK_EXTERNAL_MODULE__success_js_b4524adb__ from "./success.js";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
import "react";
|
|
5
|
+
import lottie_react_native from "lottie-react-native";
|
|
6
|
+
import { Square } from "../layout/Square.js";
|
|
7
|
+
import { UXSpinner } from "../UXSpinner/index.js";
|
|
8
|
+
import { useMs } from "../../hooks/index.js";
|
|
9
|
+
var __webpack_modules__ = {
|
|
10
|
+
"./fail.json": function(module) {
|
|
11
|
+
module.exports = __WEBPACK_EXTERNAL_MODULE__fail_js_ca7b5988__;
|
|
12
|
+
},
|
|
13
|
+
"./success.json": function(module) {
|
|
14
|
+
module.exports = __WEBPACK_EXTERNAL_MODULE__success_js_b4524adb__;
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
var __webpack_module_cache__ = {};
|
|
18
|
+
function __webpack_require__(moduleId) {
|
|
19
|
+
var cachedModule = __webpack_module_cache__[moduleId];
|
|
20
|
+
if (void 0 !== cachedModule) return cachedModule.exports;
|
|
21
|
+
var module = __webpack_module_cache__[moduleId] = {
|
|
22
|
+
exports: {}
|
|
23
|
+
};
|
|
24
|
+
__webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
|
25
|
+
return module.exports;
|
|
26
|
+
}
|
|
27
|
+
const ToastIcon = ({ type })=>{
|
|
28
|
+
const { ms } = useMs();
|
|
29
|
+
if ('loading' === type) return /*#__PURE__*/ jsx(UXSpinner, {
|
|
30
|
+
size: ms(18)
|
|
31
|
+
});
|
|
32
|
+
if ('success' === type) return /*#__PURE__*/ jsx(Square, {
|
|
33
|
+
size: ms(18),
|
|
34
|
+
children: /*#__PURE__*/ jsx(lottie_react_native, {
|
|
35
|
+
autoPlay: true,
|
|
36
|
+
source: __webpack_require__("./success.json"),
|
|
37
|
+
loop: false,
|
|
38
|
+
style: {
|
|
39
|
+
width: ms(18),
|
|
40
|
+
height: ms(18),
|
|
41
|
+
backgroundColor: 'transparent'
|
|
42
|
+
},
|
|
43
|
+
resizeMode: "contain"
|
|
44
|
+
})
|
|
45
|
+
});
|
|
46
|
+
if ('error' === type) return /*#__PURE__*/ jsx(Square, {
|
|
47
|
+
size: ms(18),
|
|
48
|
+
children: /*#__PURE__*/ jsx(lottie_react_native, {
|
|
49
|
+
autoPlay: true,
|
|
50
|
+
source: __webpack_require__("./fail.json"),
|
|
51
|
+
loop: false,
|
|
52
|
+
style: {
|
|
53
|
+
width: ms(18),
|
|
54
|
+
height: ms(18),
|
|
55
|
+
backgroundColor: 'transparent'
|
|
56
|
+
},
|
|
57
|
+
resizeMode: "contain"
|
|
58
|
+
})
|
|
59
|
+
});
|
|
60
|
+
return null;
|
|
61
|
+
};
|
|
62
|
+
export { ToastIcon };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type ToastType } from './ToastIcon';
|
|
3
|
+
import type { ToastProps } from './types';
|
|
4
|
+
interface ToastViewProps {
|
|
5
|
+
type: ToastType;
|
|
6
|
+
text: string;
|
|
7
|
+
props?: ToastProps;
|
|
8
|
+
}
|
|
9
|
+
export declare const ToastView: React.FC<ToastViewProps>;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo } from "react";
|
|
3
|
+
import react_native_toast_message from "react-native-toast-message";
|
|
4
|
+
import { Flex } from "../layout/Flex/index.js";
|
|
5
|
+
import { HStack } from "../layout/HStack.js";
|
|
6
|
+
import { Text } from "../Text/index.js";
|
|
7
|
+
import { UXButton } from "../UXButton/index.js";
|
|
8
|
+
import { useComponentConfig, useTheme } from "../../hooks/index.js";
|
|
9
|
+
import CloseIcon from "../../icons/CloseIcon.js";
|
|
10
|
+
import { ToastIcon } from "./ToastIcon.js";
|
|
11
|
+
const ToastView = ({ type, text, props: toastProps })=>{
|
|
12
|
+
const { btnText, numberOfLines = 4, colorBg, onPress = ()=>null } = toastProps ?? {};
|
|
13
|
+
const { toast: toastConfig } = useComponentConfig();
|
|
14
|
+
const { colors } = useTheme();
|
|
15
|
+
const bg = useMemo(()=>{
|
|
16
|
+
if (!colorBg) return colors.tertiary;
|
|
17
|
+
if ('success' === type) return '#0E3728';
|
|
18
|
+
if ('error' === type) return '#501D1D';
|
|
19
|
+
}, [
|
|
20
|
+
colorBg,
|
|
21
|
+
type,
|
|
22
|
+
colors
|
|
23
|
+
]);
|
|
24
|
+
return /*#__PURE__*/ jsxs(HStack, {
|
|
25
|
+
gap: "md",
|
|
26
|
+
radius: toastConfig.radius,
|
|
27
|
+
mh: 14,
|
|
28
|
+
minH: 42,
|
|
29
|
+
pv: 12,
|
|
30
|
+
ph: 14,
|
|
31
|
+
zIndex: 9999,
|
|
32
|
+
style: {
|
|
33
|
+
backgroundColor: bg
|
|
34
|
+
},
|
|
35
|
+
children: [
|
|
36
|
+
/*#__PURE__*/ jsx(ToastIcon, {
|
|
37
|
+
type: type
|
|
38
|
+
}),
|
|
39
|
+
/*#__PURE__*/ jsx(Flex, {
|
|
40
|
+
fill: true,
|
|
41
|
+
children: /*#__PURE__*/ jsx(Text, {
|
|
42
|
+
body2Bold: true,
|
|
43
|
+
color: colorBg ? 'white' : 'foreground',
|
|
44
|
+
numberOfLines: numberOfLines,
|
|
45
|
+
children: text
|
|
46
|
+
})
|
|
47
|
+
}),
|
|
48
|
+
btnText && onPress ? /*#__PURE__*/ jsx(UXButton, {
|
|
49
|
+
variant: "text",
|
|
50
|
+
onPress: ()=>{
|
|
51
|
+
react_native_toast_message.hide();
|
|
52
|
+
onPress();
|
|
53
|
+
},
|
|
54
|
+
children: /*#__PURE__*/ jsx(Text, {
|
|
55
|
+
body2Bold: true,
|
|
56
|
+
color: "primary",
|
|
57
|
+
children: btnText
|
|
58
|
+
})
|
|
59
|
+
}) : null,
|
|
60
|
+
/*#__PURE__*/ jsx(UXButton, {
|
|
61
|
+
variant: "text",
|
|
62
|
+
onPress: ()=>react_native_toast_message.hide(),
|
|
63
|
+
children: /*#__PURE__*/ jsx(CloseIcon, {
|
|
64
|
+
color: colorBg ? 'white' : 'foreground',
|
|
65
|
+
size: 18
|
|
66
|
+
})
|
|
67
|
+
})
|
|
68
|
+
]
|
|
69
|
+
});
|
|
70
|
+
};
|
|
71
|
+
export { ToastView };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
var fail_namespaceObject = JSON.parse('{"v":"5.9.4","fr":30,"ip":0,"op":22,"w":80,"h":80,"nm":"nm_a","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":3,"nm":"nm_b","sr":1,"ks":{"o":{"a":0,"k":0,"ix":11},"r":{"a":1,"k":[{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":2,"s":[0]},{"t":21,"s":[180]}],"ix":10},"p":{"a":0,"k":[40,40,0],"ix":2,"l":2},"a":{"a":0,"k":[60,60,0],"ix":1,"l":2},"s":{"a":0,"k":[100,100,100],"ix":6,"l":2}},"ao":0,"ip":2,"op":22,"st":-71,"bm":0},{"ddd":0,"ind":2,"ty":4,"nm":"nm_c","parent":1,"sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":90,"ix":10},"p":{"a":0,"k":[60,60,0],"ix":2,"l":2},"a":{"a":0,"k":[-540.031,0.344,0],"ix":1,"l":2},"s":{"a":0,"k":[100,100,100],"ix":6,"l":2}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,0],[0,0]],"o":[[0,0],[0,0]],"v":[[-555.438,-15.063],[-524.625,15.75]],"c":false},"ix":2},"nm":"nm_e","mn":"mn_b","hd":false},{"ty":"st","c":{"a":0,"k":[0.964691162109,0.266662597656,0.219604492188,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":6,"ix":5},"lc":2,"lj":1,"ml":4,"bm":0,"nm":"nm_f","mn":"mn_c","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"nm_g"}],"nm":"nm_d","np":3,"cix":2,"bm":0,"ix":1,"mn":"mn_a","hd":false},{"ty":"tm","s":{"a":1,"k":[{"i":{"x":[0.405],"y":[1.003]},"o":{"x":[0.623],"y":[0]},"t":2,"s":[50]},{"t":21,"s":[0]}],"ix":1},"e":{"a":1,"k":[{"i":{"x":[0.423],"y":[0.983]},"o":{"x":[0.604],"y":[-0.004]},"t":2,"s":[50]},{"t":21,"s":[100]}],"ix":2},"o":{"a":0,"k":0,"ix":3},"m":1,"ix":2,"nm":"nm_h","mn":"mn_d","hd":false}],"ip":2,"op":22,"st":-77,"ct":1,"bm":0},{"ddd":0,"ind":3,"ty":4,"nm":"nm_i","parent":1,"sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[60,60,0],"ix":2,"l":2},"a":{"a":0,"k":[-540.031,0.344,0],"ix":1,"l":2},"s":{"a":0,"k":[100,100,100],"ix":6,"l":2}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,0],[0,0]],"o":[[0,0],[0,0]],"v":[[-555.438,-15.063],[-524.625,15.75]],"c":false},"ix":2},"nm":"nm_e","mn":"mn_b","hd":false},{"ty":"st","c":{"a":0,"k":[0.964691162109,0.266662597656,0.219604492188,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":6,"ix":5},"lc":2,"lj":1,"ml":4,"bm":0,"nm":"nm_f","mn":"mn_c","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"nm_g"}],"nm":"nm_d","np":3,"cix":2,"bm":0,"ix":1,"mn":"mn_a","hd":false},{"ty":"tm","s":{"a":1,"k":[{"i":{"x":[0.405],"y":[1.003]},"o":{"x":[0.623],"y":[0]},"t":2,"s":[50]},{"t":21,"s":[0]}],"ix":1},"e":{"a":1,"k":[{"i":{"x":[0.423],"y":[0.983]},"o":{"x":[0.604],"y":[-0.004]},"t":2,"s":[50]},{"t":21,"s":[100]}],"ix":2},"o":{"a":0,"k":0,"ix":3},"m":1,"ix":2,"nm":"nm_h","mn":"mn_d","hd":false}],"ip":2,"op":22,"st":-77,"ct":1,"bm":0},{"ddd":0,"ind":4,"ty":4,"nm":"nm_j","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":1,"k":[{"i":{"x":[0.218],"y":[0.983]},"o":{"x":[0.682],"y":[-0.008]},"t":0,"s":[0]},{"t":21,"s":[-64]}],"ix":10},"p":{"a":0,"k":[40,40,0],"ix":2,"l":2},"a":{"a":0,"k":[-523.5,0.25,0],"ix":1,"l":2},"s":{"a":0,"k":[100,100,100],"ix":6,"l":2}},"ao":0,"shapes":[{"ty":"gr","it":[{"d":1,"ty":"el","s":{"a":0,"k":[64.5,64.5],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"nm":"nm_l","mn":"mn_e","hd":false},{"ty":"st","c":{"a":0,"k":[0.964691162109,0.266662597656,0.219604492188,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":6,"ix":5},"lc":2,"lj":1,"ml":4,"bm":0,"nm":"nm_f","mn":"mn_c","hd":false},{"ty":"tr","p":{"a":0,"k":[-523.5,0.25],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"nm_g"}],"nm":"nm_k","np":3,"cix":2,"bm":0,"ix":1,"mn":"mn_a","hd":false},{"ty":"tm","s":{"a":0,"k":100,"ix":1},"e":{"a":1,"k":[{"i":{"x":[0.256],"y":[0.999]},"o":{"x":[0.646],"y":[0.004]},"t":0,"s":[100]},{"t":21,"s":[0]}],"ix":2},"o":{"a":0,"k":0,"ix":3},"m":1,"ix":2,"nm":"nm_h","mn":"mn_d","hd":false}],"ip":0,"op":22,"st":-74,"ct":1,"bm":0}],"markers":[],"_compressed":true}');
|
|
2
|
+
var __webpack_exports___compressed = fail_namespaceObject._compressed;
|
|
3
|
+
var __webpack_exports__assets = fail_namespaceObject.assets;
|
|
4
|
+
var __webpack_exports__ddd = fail_namespaceObject.ddd;
|
|
5
|
+
var __webpack_exports__fr = fail_namespaceObject.fr;
|
|
6
|
+
var __webpack_exports__h = fail_namespaceObject.h;
|
|
7
|
+
var __webpack_exports__ip = fail_namespaceObject.ip;
|
|
8
|
+
var __webpack_exports__layers = fail_namespaceObject.layers;
|
|
9
|
+
var __webpack_exports__markers = fail_namespaceObject.markers;
|
|
10
|
+
var __webpack_exports__nm = fail_namespaceObject.nm;
|
|
11
|
+
var __webpack_exports__op = fail_namespaceObject.op;
|
|
12
|
+
var __webpack_exports__v = fail_namespaceObject.v;
|
|
13
|
+
var __webpack_exports__w = fail_namespaceObject.w;
|
|
14
|
+
export { __webpack_exports___compressed as _compressed, __webpack_exports__assets as assets, __webpack_exports__ddd as ddd, __webpack_exports__fr as fr, __webpack_exports__h as h, __webpack_exports__ip as ip, __webpack_exports__layers as layers, __webpack_exports__markers as markers, __webpack_exports__nm as nm, __webpack_exports__op as op, __webpack_exports__v as v, __webpack_exports__w as w };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
var success_namespaceObject = JSON.parse('{"v":"5.9.4","fr":30,"ip":0,"op":38,"w":80,"h":80,"nm":"nm_a","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"nm_b","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[40,40,0],"ix":2,"l":2},"a":{"a":0,"k":[-618.094,-0.5,0],"ix":1,"l":2},"s":{"a":0,"k":[100,100,100],"ix":6,"l":2}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,0],[0,0],[0,0]],"o":[[0,0],[0,0],[0,0]],"v":[[-637.75,-2.875],[-623.063,11.375],[-598.438,-12.375]],"c":false},"ix":2},"nm":"nm_d","mn":"mn_b","hd":false},{"ty":"st","c":{"a":0,"k":[0.180389404297,0.772552490234,0.329406738281,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":6,"ix":5},"lc":2,"lj":2,"bm":0,"nm":"nm_e","mn":"mn_c","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"nm_f"}],"nm":"nm_c","np":3,"cix":2,"bm":0,"ix":1,"mn":"mn_a","hd":false},{"ty":"tm","s":{"a":0,"k":0,"ix":1},"e":{"a":1,"k":[{"i":{"x":[0.265],"y":[0.998]},"o":{"x":[0.718],"y":[0]},"t":19,"s":[0]},{"t":32,"s":[100]}],"ix":2},"o":{"a":0,"k":0,"ix":3},"m":1,"ix":2,"nm":"nm_g","mn":"mn_d","hd":false}],"ip":19,"op":1091,"st":-55,"ct":1,"bm":0},{"ddd":0,"ind":2,"ty":4,"nm":"nm_h","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":1,"k":[{"i":{"x":[0.218],"y":[0.983]},"o":{"x":[0.682],"y":[-0.008]},"t":0,"s":[0]},{"t":21,"s":[-64]}],"ix":10},"p":{"a":0,"k":[40,40,0],"ix":2,"l":2},"a":{"a":0,"k":[-523.5,0.25,0],"ix":1,"l":2},"s":{"a":0,"k":[100,100,100],"ix":6,"l":2}},"ao":0,"shapes":[{"ty":"gr","it":[{"d":1,"ty":"el","s":{"a":0,"k":[64.5,64.5],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"nm":"nm_j","mn":"mn_e","hd":false},{"ty":"st","c":{"a":0,"k":[0.180389404297,0.772552490234,0.329406738281,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":6,"ix":5},"lc":2,"lj":1,"ml":4,"bm":0,"nm":"nm_e","mn":"mn_c","hd":false},{"ty":"tr","p":{"a":0,"k":[-523.5,0.25],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"nm_f"}],"nm":"nm_i","np":3,"cix":2,"bm":0,"ix":1,"mn":"mn_a","hd":false},{"ty":"tm","s":{"a":0,"k":100,"ix":1},"e":{"a":1,"k":[{"i":{"x":[0.256],"y":[0.999]},"o":{"x":[0.646],"y":[0.004]},"t":0,"s":[100]},{"t":21,"s":[0]}],"ix":2},"o":{"a":0,"k":0,"ix":3},"m":1,"ix":2,"nm":"nm_g","mn":"mn_d","hd":false}],"ip":0,"op":1072,"st":-74,"ct":1,"bm":0}],"markers":[{"tm":0,"cm":"","dr":0},{"tm":38,"cm":"","dr":0}],"_compressed":true}');
|
|
2
|
+
var __webpack_exports___compressed = success_namespaceObject._compressed;
|
|
3
|
+
var __webpack_exports__assets = success_namespaceObject.assets;
|
|
4
|
+
var __webpack_exports__ddd = success_namespaceObject.ddd;
|
|
5
|
+
var __webpack_exports__fr = success_namespaceObject.fr;
|
|
6
|
+
var __webpack_exports__h = success_namespaceObject.h;
|
|
7
|
+
var __webpack_exports__ip = success_namespaceObject.ip;
|
|
8
|
+
var __webpack_exports__layers = success_namespaceObject.layers;
|
|
9
|
+
var __webpack_exports__markers = success_namespaceObject.markers;
|
|
10
|
+
var __webpack_exports__nm = success_namespaceObject.nm;
|
|
11
|
+
var __webpack_exports__op = success_namespaceObject.op;
|
|
12
|
+
var __webpack_exports__v = success_namespaceObject.v;
|
|
13
|
+
var __webpack_exports__w = success_namespaceObject.w;
|
|
14
|
+
export { __webpack_exports___compressed as _compressed, __webpack_exports__assets as assets, __webpack_exports__ddd as ddd, __webpack_exports__fr as fr, __webpack_exports__h as h, __webpack_exports__ip as ip, __webpack_exports__layers as layers, __webpack_exports__markers as markers, __webpack_exports__nm as nm, __webpack_exports__op as op, __webpack_exports__v as v, __webpack_exports__w as w };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import Toast, { type ToastShowParams } from 'react-native-toast-message';
|
|
2
|
+
export declare const UXToast: typeof Toast;
|
|
3
|
+
export declare const toast: {
|
|
4
|
+
success: (message: string, options?: ToastShowParams) => void;
|
|
5
|
+
error: (message: string, options?: ToastShowParams) => void;
|
|
6
|
+
loading: (message: string, options?: ToastShowParams) => void;
|
|
7
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import react_native_toast_message from "react-native-toast-message";
|
|
2
|
+
const UXToast = react_native_toast_message;
|
|
3
|
+
const toast = {
|
|
4
|
+
success: (message, options)=>{
|
|
5
|
+
UXToast.show({
|
|
6
|
+
type: 'success',
|
|
7
|
+
text1: message,
|
|
8
|
+
...options
|
|
9
|
+
});
|
|
10
|
+
},
|
|
11
|
+
error: (message, options)=>{
|
|
12
|
+
UXToast.show({
|
|
13
|
+
type: 'error',
|
|
14
|
+
text1: message,
|
|
15
|
+
...options
|
|
16
|
+
});
|
|
17
|
+
},
|
|
18
|
+
loading: (message, options)=>{
|
|
19
|
+
const { visibilityTime = 0, autoHide = !!visibilityTime, ...restOptions } = options ?? {};
|
|
20
|
+
UXToast.show({
|
|
21
|
+
type: 'loading',
|
|
22
|
+
text1: message,
|
|
23
|
+
visibilityTime,
|
|
24
|
+
autoHide,
|
|
25
|
+
...restOptions
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
export { UXToast, toast };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ToastProps } from './types';
|
|
3
|
+
export declare const toastConfig: {
|
|
4
|
+
success: ({ text1, props }: {
|
|
5
|
+
text1: string;
|
|
6
|
+
props?: ToastProps;
|
|
7
|
+
}) => React.JSX.Element;
|
|
8
|
+
error: ({ text1, props }: {
|
|
9
|
+
text1: string;
|
|
10
|
+
props?: ToastProps;
|
|
11
|
+
}) => React.JSX.Element;
|
|
12
|
+
loading: ({ text1, props }: {
|
|
13
|
+
text1: string;
|
|
14
|
+
props?: ToastProps;
|
|
15
|
+
}) => React.JSX.Element;
|
|
16
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import "react";
|
|
3
|
+
import { ToastView } from "./ToastView.js";
|
|
4
|
+
const toastConfig = {
|
|
5
|
+
success: ({ text1, props })=>/*#__PURE__*/ jsx(ToastView, {
|
|
6
|
+
type: "success",
|
|
7
|
+
text: text1,
|
|
8
|
+
props: props
|
|
9
|
+
}),
|
|
10
|
+
error: ({ text1, props })=>/*#__PURE__*/ jsx(ToastView, {
|
|
11
|
+
type: "error",
|
|
12
|
+
text: text1,
|
|
13
|
+
props: props
|
|
14
|
+
}),
|
|
15
|
+
loading: ({ text1, props })=>/*#__PURE__*/ jsx(ToastView, {
|
|
16
|
+
type: "loading",
|
|
17
|
+
text: text1,
|
|
18
|
+
props: props
|
|
19
|
+
})
|
|
20
|
+
};
|
|
21
|
+
export { toastConfig };
|
|
File without changes
|
|
@@ -17,7 +17,9 @@ export * from './UXListBox';
|
|
|
17
17
|
export * from './UXModal';
|
|
18
18
|
export * from './UXPressable';
|
|
19
19
|
export * from './UXRadio';
|
|
20
|
+
export * from './UXSpinner';
|
|
20
21
|
export * from './UXSwitch';
|
|
21
22
|
export * from './UXTabs';
|
|
23
|
+
export * from './UXToast';
|
|
22
24
|
export * from './UXTooltip';
|
|
23
25
|
export * from './UXTouchableOpacity';
|
package/dist/components/index.js
CHANGED
|
@@ -17,7 +17,9 @@ export * from "./UXListBox/index.js";
|
|
|
17
17
|
export * from "./UXModal/index.js";
|
|
18
18
|
export * from "./UXPressable/index.js";
|
|
19
19
|
export * from "./UXRadio/index.js";
|
|
20
|
+
export * from "./UXSpinner/index.js";
|
|
20
21
|
export * from "./UXSwitch/index.js";
|
|
21
22
|
export * from "./UXTabs/index.js";
|
|
23
|
+
export * from "./UXToast/index.js";
|
|
22
24
|
export * from "./UXTooltip/index.js";
|
|
23
25
|
export * from "./UXTouchableOpacity/index.js";
|
package/dist/config/config.ux.js
CHANGED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import "react";
|
|
3
|
+
import react_native_svg, { Path } from "react-native-svg";
|
|
4
|
+
import { useColors } from "../hooks/index.js";
|
|
5
|
+
const DotIcon = ({ size = 16, color = 'default', ...props })=>{
|
|
6
|
+
const { getColor } = useColors();
|
|
7
|
+
const colorValue = getColor(color);
|
|
8
|
+
return /*#__PURE__*/ jsx(react_native_svg, {
|
|
9
|
+
width: size,
|
|
10
|
+
height: size,
|
|
11
|
+
viewBox: "0 0 24 24",
|
|
12
|
+
fill: "none",
|
|
13
|
+
...props,
|
|
14
|
+
children: /*#__PURE__*/ jsx(Path, {
|
|
15
|
+
d: "M5.29102 5.29102C5.47727 5.105 5.72974 5.00052 5.99298 5.00052C6.25621 5.00052 6.50868 5.105 6.69494 5.29102L11.9993 10.5941L17.3051 5.29102C17.4733 5.1228 17.6962 5.02051 17.9335 5.00277C18.1707 4.98503 18.4064 5.053 18.5977 5.19434L18.709 5.29102C18.895 5.47727 18.9995 5.72974 18.9995 5.99298C18.9995 6.25621 18.895 6.50868 18.709 6.69494L13.4046 11.9993L18.709 17.3051C18.8772 17.4733 18.9795 17.6962 18.9972 17.9335C19.015 18.1707 18.947 18.4064 18.8057 18.5977L18.709 18.709C18.5227 18.895 18.2703 18.9995 18.007 18.9995C17.7438 18.9995 17.4913 18.895 17.3051 18.709L11.9993 13.4046L6.69494 18.709C6.52675 18.8772 6.30377 18.9795 6.06655 18.9972C5.82933 19.015 5.59362 18.947 5.40228 18.8057L5.29102 18.709C5.105 18.5227 5.00052 18.2703 5.00052 18.007C5.00052 17.7438 5.105 17.4913 5.29102 17.3051L10.5941 11.9993L5.29102 6.69494C5.1228 6.52675 5.02051 6.30377 5.00277 6.06655C4.98503 5.82933 5.053 5.59362 5.19434 5.40228L5.29102 5.29102Z",
|
|
16
|
+
fill: colorValue
|
|
17
|
+
})
|
|
18
|
+
});
|
|
19
|
+
};
|
|
20
|
+
const CloseIcon = DotIcon;
|
|
21
|
+
export { CloseIcon as default };
|
package/dist/types/theme.d.ts
CHANGED
|
@@ -27,6 +27,9 @@ export interface ComponentConfig {
|
|
|
27
27
|
};
|
|
28
28
|
tabs: Pick<CommonComponentConfig, 'defaultProps' | 'fontSize'>;
|
|
29
29
|
chip: Pick<CommonComponentConfig, 'defaultProps'>;
|
|
30
|
+
toast: {
|
|
31
|
+
radius: UXRadius;
|
|
32
|
+
};
|
|
30
33
|
}
|
|
31
34
|
export interface ThemeConfig {
|
|
32
35
|
theme: ThemeMode;
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Platform } from "react-native";
|
|
2
2
|
const triggerHapticFeedback = async (style = 'light')=>{
|
|
3
|
+
if ('web' === Platform.OS) return;
|
|
4
|
+
const impactAsync = await import("expo-haptics").then((module)=>module.impactAsync);
|
|
5
|
+
const ImpactFeedbackStyle = await import("expo-haptics").then((module)=>module.ImpactFeedbackStyle);
|
|
3
6
|
try {
|
|
4
7
|
const feedbackStyleMap = {
|
|
5
8
|
light: ImpactFeedbackStyle.Light,
|
package/entry.js
ADDED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@particle-network/ui-native",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.19",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "./entry.js",
|
|
6
6
|
"react-native": "./dist/index.js",
|
|
@@ -16,22 +16,6 @@
|
|
|
16
16
|
"default": "./dist/index.js"
|
|
17
17
|
}
|
|
18
18
|
},
|
|
19
|
-
"scripts": {
|
|
20
|
-
"start": "expo start",
|
|
21
|
-
"android": "expo start --android",
|
|
22
|
-
"ios": "expo start --ios",
|
|
23
|
-
"web": "storybook dev -p 6006",
|
|
24
|
-
"storybook:build": "storybook build",
|
|
25
|
-
"storybook:preview": "serve storybook-static",
|
|
26
|
-
"storybook:generate": "sb-rn-get-stories",
|
|
27
|
-
"type-check": "npx tsc --noEmit -p ./tsconfig.json",
|
|
28
|
-
"dev": "rslib build --watch",
|
|
29
|
-
"build": "rslib build",
|
|
30
|
-
"lint": "eslint . --no-error-on-unmatched-pattern --quiet",
|
|
31
|
-
"lint:fix": "eslint . --fix --no-error-on-unmatched-pattern --quiet",
|
|
32
|
-
"clean": "rm -rf .turbo node_modules dist",
|
|
33
|
-
"deploy:dev": "sh ./scripts/deploy-dev.sh"
|
|
34
|
-
},
|
|
35
19
|
"files": [
|
|
36
20
|
"dist",
|
|
37
21
|
"README.md",
|
|
@@ -51,63 +35,61 @@
|
|
|
51
35
|
],
|
|
52
36
|
"author": "UniversalX",
|
|
53
37
|
"dependencies": {
|
|
38
|
+
"@lottiefiles/dotlottie-react": "^0.16.2",
|
|
54
39
|
"@particle-network/ui-shared": "*",
|
|
55
40
|
"ahooks": "^3.9.4",
|
|
56
41
|
"deepmerge": "^4.3.1",
|
|
57
|
-
"expo-haptics": "^
|
|
42
|
+
"expo-haptics": "^15.0.7",
|
|
43
|
+
"expo-image": "^3.0.8",
|
|
44
|
+
"lottie-react-native": "^7.3.4",
|
|
58
45
|
"react-native-paper": "^5.14.5",
|
|
59
|
-
"react-native-size-matters": "^0.4.2"
|
|
46
|
+
"react-native-size-matters": "^0.4.2",
|
|
47
|
+
"react-native-toast-message": "^2.3.3"
|
|
60
48
|
},
|
|
61
49
|
"devDependencies": {
|
|
62
50
|
"@babel/core": "^7.24.0",
|
|
63
51
|
"@babel/preset-env": "^7.25.4",
|
|
64
|
-
"@chromatic-com/storybook": "^4.
|
|
65
|
-
"@expo/metro-runtime": "~
|
|
52
|
+
"@chromatic-com/storybook": "^4.1.1",
|
|
53
|
+
"@expo/metro-runtime": "~6.1.2",
|
|
66
54
|
"@gorhom/bottom-sheet": "^5.1.2",
|
|
67
55
|
"@particle-network/eslint-config": "*",
|
|
68
|
-
"@react-native-async-storage/async-storage": "2.
|
|
69
|
-
"@react-native-community/datetimepicker": "8.4.
|
|
70
|
-
"@react-native-community/slider": "
|
|
56
|
+
"@react-native-async-storage/async-storage": "2.2.0",
|
|
57
|
+
"@react-native-community/datetimepicker": "8.4.4",
|
|
58
|
+
"@react-native-community/slider": "5.0.1",
|
|
71
59
|
"@rsbuild/core": "^1.5.0",
|
|
72
60
|
"@rsbuild/plugin-react": "^1.3.5",
|
|
73
61
|
"@rslib/core": "^0.12.2",
|
|
74
|
-
"@storybook/addon-docs": "^9",
|
|
75
|
-
"@storybook/addon-ondevice-actions": "^9",
|
|
76
|
-
"@storybook/addon-ondevice-backgrounds": "^9",
|
|
77
|
-
"@storybook/addon-ondevice-controls": "^9",
|
|
78
|
-
"@storybook/addon-ondevice-notes": "^9",
|
|
79
|
-
"@storybook/react": "^9",
|
|
80
|
-
"@storybook/react-native": "^9",
|
|
81
|
-
"@
|
|
82
|
-
"@types/react": "~19.0.10",
|
|
62
|
+
"@storybook/addon-docs": "^9.1.6",
|
|
63
|
+
"@storybook/addon-ondevice-actions": "^9.1.2",
|
|
64
|
+
"@storybook/addon-ondevice-backgrounds": "^9.1.2",
|
|
65
|
+
"@storybook/addon-ondevice-controls": "^9.1.2",
|
|
66
|
+
"@storybook/addon-ondevice-notes": "^9.1.2",
|
|
67
|
+
"@storybook/react-native": "^9.1.2",
|
|
68
|
+
"@storybook/react-native-web-vite": "^9.1.6",
|
|
69
|
+
"@types/react": "^19.1.10",
|
|
83
70
|
"babel-plugin-module-resolver": "^5.0.2",
|
|
84
71
|
"babel-plugin-react-docgen-typescript": "^1.5.1",
|
|
85
72
|
"cross-env": "^7.0.3",
|
|
86
|
-
"expo": "~
|
|
87
|
-
"expo-constants": "~
|
|
88
|
-
"expo-status-bar": "~
|
|
73
|
+
"expo": "~54.0.0",
|
|
74
|
+
"expo-constants": "~18.0.8",
|
|
75
|
+
"expo-status-bar": "~3.0.8",
|
|
89
76
|
"lucide-react-native": "^0.541.0",
|
|
90
|
-
"react": "19.
|
|
91
|
-
"react-dom": "19.
|
|
92
|
-
"react-native": "0.
|
|
93
|
-
"react-native-gesture-handler": "~2.
|
|
94
|
-
"react-native-reanimated": "~
|
|
95
|
-
"react-native-safe-area-context": "5.
|
|
96
|
-
"react-native-svg": "15.
|
|
97
|
-
"react-native-web": "^0.
|
|
98
|
-
"storybook": "^9",
|
|
99
|
-
"typescript": "~5.
|
|
77
|
+
"react": "19.1.0",
|
|
78
|
+
"react-dom": "19.1.0",
|
|
79
|
+
"react-native": "0.81.4",
|
|
80
|
+
"react-native-gesture-handler": "~2.28.0",
|
|
81
|
+
"react-native-reanimated": "~4.1.0",
|
|
82
|
+
"react-native-safe-area-context": "5.6.1",
|
|
83
|
+
"react-native-svg": "15.12.1",
|
|
84
|
+
"react-native-web": "^0.21.1",
|
|
85
|
+
"storybook": "^9.1.6",
|
|
86
|
+
"typescript": "~5.9.2",
|
|
100
87
|
"unfetch": "^4.2.0",
|
|
101
|
-
"vite": "^6.3.5"
|
|
102
|
-
|
|
103
|
-
"resolutions": {
|
|
104
|
-
"react-docgen-typescript": "2.2.2",
|
|
105
|
-
"react-native-web": "^0.20.0",
|
|
106
|
-
"unfetch": "^4.2.0"
|
|
88
|
+
"vite": "^6.3.5",
|
|
89
|
+
"zustand": "^5.0.8"
|
|
107
90
|
},
|
|
108
91
|
"overrides": {
|
|
109
92
|
"react-docgen-typescript": "2.2.2",
|
|
110
|
-
"react-native-web": "^0.20.0",
|
|
111
93
|
"unfetch": "^4.2.0"
|
|
112
94
|
},
|
|
113
95
|
"expo": {
|
|
@@ -116,5 +98,21 @@
|
|
|
116
98
|
"listUnknownPackages": false
|
|
117
99
|
}
|
|
118
100
|
}
|
|
101
|
+
},
|
|
102
|
+
"scripts": {
|
|
103
|
+
"start": "expo start",
|
|
104
|
+
"android": "expo start --android",
|
|
105
|
+
"ios": "expo start --ios",
|
|
106
|
+
"web": "storybook dev -p 6006",
|
|
107
|
+
"storybook:build": "storybook build",
|
|
108
|
+
"storybook:preview": "serve storybook-static",
|
|
109
|
+
"storybook:generate": "sb-rn-get-stories",
|
|
110
|
+
"type-check": "npx tsc --noEmit -p ./tsconfig.json",
|
|
111
|
+
"dev": "rslib build --watch",
|
|
112
|
+
"build": "rslib build",
|
|
113
|
+
"lint": "eslint . --no-error-on-unmatched-pattern --quiet",
|
|
114
|
+
"lint:fix": "eslint . --fix --no-error-on-unmatched-pattern --quiet",
|
|
115
|
+
"clean": "rm -rf .turbo node_modules dist",
|
|
116
|
+
"deploy:dev": "sh ./scripts/deploy-dev.sh"
|
|
119
117
|
}
|
|
120
|
-
}
|
|
118
|
+
}
|