@particle-network/ui-native 0.5.1-beta.7 → 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,9 +1,10 @@
1
1
  import React from 'react';
2
- import type { IconProps } from '../../icons/types';
2
+ import CircleQuestionIcon from '@particle-network/icons/native/CircleQuestionIcon';
3
3
  import type { SquareProps } from '../layout/Square';
4
4
  import { type UXTooltipProps } from '../UXTooltip';
5
5
  export type UXHintProps = UXTooltipProps & {
6
6
  style?: SquareProps['style'];
7
- iconStyle?: IconProps['style'];
7
+ iconStyle?: React.ComponentProps<typeof CircleQuestionIcon>['style'];
8
+ iconColor?: React.ComponentProps<typeof CircleQuestionIcon>['color'];
8
9
  };
9
10
  export declare const UXHint: React.FC<UXHintProps>;
@@ -1,11 +1,11 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import "react";
3
+ import CircleQuestionIcon from "@particle-network/icons/native/CircleQuestionIcon";
3
4
  import { useMs } from "../../hooks/index.js";
4
- import { Icon } from "../../icons/index.js";
5
5
  import { Square } from "../layout/Square.js";
6
6
  import { UXTooltip } from "../UXTooltip/index.js";
7
7
  const UXHint = (props)=>{
8
- const { content, children, iconStyle, style, ...restProps } = props;
8
+ const { content, children, iconStyle, iconColor = 'secondary', style, ...restProps } = props;
9
9
  const { ms } = useMs();
10
10
  return /*#__PURE__*/ jsx(UXTooltip, {
11
11
  content: content || children,
@@ -14,9 +14,8 @@ const UXHint = (props)=>{
14
14
  center: true,
15
15
  size: 16,
16
16
  style: style,
17
- children: /*#__PURE__*/ jsx(Icon, {
18
- name: "question",
19
- color: "secondary",
17
+ children: /*#__PURE__*/ jsx(CircleQuestionIcon, {
18
+ color: iconColor,
20
19
  size: ms(14),
21
20
  style: iconStyle
22
21
  })
@@ -4,6 +4,7 @@ import type { ToastProps } from './types';
4
4
  interface ToastViewProps {
5
5
  type: ToastType;
6
6
  text: string;
7
+ text2?: string;
7
8
  props?: ToastProps;
8
9
  }
9
10
  export declare const ToastView: React.FC<ToastViewProps>;
@@ -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 { Flex } from "../layout/Flex/index.js";
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 = 4, colorBg, onPress = ()=>null } = toastProps ?? {};
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__*/ jsx(Flex, {
41
+ /*#__PURE__*/ jsxs(VStack, {
43
42
  shrink: 1,
44
- children: /*#__PURE__*/ jsx(Text, {
45
- body2Bold: true,
46
- color: colorBg ? 'white' : 'foreground',
47
- numberOfLines: numberOfLines,
48
- children: text
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.7",
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/icons": "0.5.1-beta.6",
49
- "@particle-network/ui-shared": "0.4.1-beta.5"
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/eslint-config": "0.3.0",
93
92
  "@particle-network/icons": "0.5.1-beta.6",
94
- "@particle-network/lintstaged-config": "0.1.0"
93
+ "@particle-network/lintstaged-config": "0.1.0",
94
+ "@particle-network/eslint-config": "0.3.0"
95
95
  },
96
96
  "overrides": {
97
97
  "react-docgen-typescript": "2.2.2",