@particle-network/ui-native 0.5.1-beta.8 → 0.5.1-beta.9
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.
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useMemo } from "react";
|
|
3
3
|
import react_native_toast_message from "react-native-toast-message";
|
|
4
|
-
import {
|
|
5
|
-
import { HStack } from "../layout/HStack.js";
|
|
4
|
+
import { HStack, VStack } from "../layout/index.js";
|
|
6
5
|
import { Text } from "../Text/index.js";
|
|
7
6
|
import { UXButton } from "../UXButton/index.js";
|
|
8
7
|
import { useComponentConfig, useTheme } from "../../hooks/index.js";
|
|
9
8
|
import { Icon } from "../../icons/index.js";
|
|
10
9
|
import { ToastIcon } from "./ToastIcon.js";
|
|
11
|
-
const ToastView = ({ type, text, props: toastProps })=>{
|
|
12
|
-
const { btnText, numberOfLines =
|
|
10
|
+
const ToastView = ({ type, text, text2, props: toastProps })=>{
|
|
11
|
+
const { btnText, numberOfLines = 10, colorBg, onPress = ()=>null } = toastProps ?? {};
|
|
13
12
|
const { toast: toastConfig } = useComponentConfig();
|
|
14
13
|
const { colors } = useTheme();
|
|
15
14
|
const bg = useMemo(()=>{
|
|
@@ -39,14 +38,23 @@ const ToastView = ({ type, text, props: toastProps })=>{
|
|
|
39
38
|
/*#__PURE__*/ jsx(ToastIcon, {
|
|
40
39
|
type: type
|
|
41
40
|
}),
|
|
42
|
-
/*#__PURE__*/
|
|
41
|
+
/*#__PURE__*/ jsxs(VStack, {
|
|
43
42
|
shrink: 1,
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
43
|
+
gap: 4,
|
|
44
|
+
children: [
|
|
45
|
+
/*#__PURE__*/ jsx(Text, {
|
|
46
|
+
body2Bold: true,
|
|
47
|
+
color: colorBg ? 'white' : 'foreground',
|
|
48
|
+
numberOfLines: 2,
|
|
49
|
+
children: text
|
|
50
|
+
}),
|
|
51
|
+
text2 && /*#__PURE__*/ jsx(Text, {
|
|
52
|
+
body3: true,
|
|
53
|
+
color: "secondary",
|
|
54
|
+
numberOfLines: numberOfLines,
|
|
55
|
+
children: text2
|
|
56
|
+
})
|
|
57
|
+
]
|
|
50
58
|
}),
|
|
51
59
|
btnText && onPress ? /*#__PURE__*/ jsx(UXButton, {
|
|
52
60
|
variant: "text",
|
|
@@ -1,16 +1,19 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { ToastProps } from './types';
|
|
3
3
|
export declare const toastConfig: {
|
|
4
|
-
success: ({ text1, props }: {
|
|
4
|
+
success: ({ text1, text2, props }: {
|
|
5
5
|
text1: string;
|
|
6
|
+
text2?: string;
|
|
6
7
|
props?: ToastProps;
|
|
7
8
|
}) => React.JSX.Element;
|
|
8
|
-
error: ({ text1, props }: {
|
|
9
|
+
error: ({ text1, text2, props }: {
|
|
9
10
|
text1: string;
|
|
11
|
+
text2?: string;
|
|
10
12
|
props?: ToastProps;
|
|
11
13
|
}) => React.JSX.Element;
|
|
12
|
-
loading: ({ text1, props }: {
|
|
14
|
+
loading: ({ text1, text2, props }: {
|
|
13
15
|
text1: string;
|
|
16
|
+
text2?: string;
|
|
14
17
|
props?: ToastProps;
|
|
15
18
|
}) => React.JSX.Element;
|
|
16
19
|
};
|
|
@@ -2,19 +2,22 @@ import { jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import "react";
|
|
3
3
|
import { ToastView } from "./ToastView.js";
|
|
4
4
|
const toastConfig = {
|
|
5
|
-
success: ({ text1, props })=>/*#__PURE__*/ jsx(ToastView, {
|
|
5
|
+
success: ({ text1, text2, props })=>/*#__PURE__*/ jsx(ToastView, {
|
|
6
6
|
type: "success",
|
|
7
7
|
text: text1,
|
|
8
|
+
text2: text2,
|
|
8
9
|
props: props
|
|
9
10
|
}),
|
|
10
|
-
error: ({ text1, props })=>/*#__PURE__*/ jsx(ToastView, {
|
|
11
|
+
error: ({ text1, text2, props })=>/*#__PURE__*/ jsx(ToastView, {
|
|
11
12
|
type: "error",
|
|
12
13
|
text: text1,
|
|
14
|
+
text2: text2,
|
|
13
15
|
props: props
|
|
14
16
|
}),
|
|
15
|
-
loading: ({ text1, props })=>/*#__PURE__*/ jsx(ToastView, {
|
|
17
|
+
loading: ({ text1, text2, props })=>/*#__PURE__*/ jsx(ToastView, {
|
|
16
18
|
type: "loading",
|
|
17
19
|
text: text1,
|
|
20
|
+
text2: text2,
|
|
18
21
|
props: props
|
|
19
22
|
})
|
|
20
23
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@particle-network/ui-native",
|
|
3
|
-
"version": "0.5.1-beta.
|
|
3
|
+
"version": "0.5.1-beta.9",
|
|
4
4
|
"main": "./entry.js",
|
|
5
5
|
"react-native": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -45,8 +45,8 @@
|
|
|
45
45
|
"react-native-size-matters": "^0.4.2",
|
|
46
46
|
"react-native-toast-message": "^2.3.3",
|
|
47
47
|
"react-native-worklets": "0.5.1",
|
|
48
|
-
"@particle-network/
|
|
49
|
-
"@particle-network/
|
|
48
|
+
"@particle-network/ui-shared": "0.4.1-beta.5",
|
|
49
|
+
"@particle-network/icons": "0.5.1-beta.6"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
52
|
"@babel/core": "^7.24.0",
|
|
@@ -89,9 +89,9 @@
|
|
|
89
89
|
"unfetch": "^4.2.0",
|
|
90
90
|
"vite": "^6.3.5",
|
|
91
91
|
"zustand": "^5.0.8",
|
|
92
|
-
"@particle-network/
|
|
92
|
+
"@particle-network/icons": "0.5.1-beta.6",
|
|
93
93
|
"@particle-network/lintstaged-config": "0.1.0",
|
|
94
|
-
"@particle-network/
|
|
94
|
+
"@particle-network/eslint-config": "0.3.0"
|
|
95
95
|
},
|
|
96
96
|
"overrides": {
|
|
97
97
|
"react-docgen-typescript": "2.2.2",
|