@particle-network/ui-native 0.0.18 → 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 CHANGED
@@ -190,38 +190,38 @@ const customTheme = {
190
190
 
191
191
  ```bash
192
192
  # Web 版 Storybook(推荐用于开发)
193
- yarn storybook:web
193
+ pnpm storybook:web
194
194
 
195
195
  # 设备上的 Storybook
196
- yarn storybook
196
+ pnpm storybook
197
197
 
198
198
  # iOS
199
- yarn storybook:ios
199
+ pnpm storybook:ios
200
200
 
201
201
  # Android
202
- yarn storybook:android
202
+ pnpm storybook:android
203
203
  ```
204
204
 
205
205
  ### 开发命令
206
206
 
207
207
  ```bash
208
208
  # 安装依赖
209
- yarn install
209
+ pnpm install
210
210
 
211
211
  # 启动开发
212
- yarn start
212
+ pnpm start
213
213
 
214
214
  # 构建库
215
- yarn build
215
+ pnpm build
216
216
 
217
217
  # 运行测试
218
- yarn test
218
+ pnpm test
219
219
 
220
220
  # 类型检查
221
- yarn type-check
221
+ pnpm type-check
222
222
 
223
223
  # 代码检查
224
- yarn lint
224
+ pnpm lint
225
225
  ```
226
226
 
227
227
  ## 📱 平台支持
@@ -34,9 +34,9 @@ const useStyles = (props)=>{
34
34
  auto: 'sm'
35
35
  };
36
36
  const paddingMap = useMemo(()=>({
37
- sm: ms(2),
38
- md: ms(2),
39
- lg: ms(4)
37
+ sm: ms(6),
38
+ md: ms(10),
39
+ lg: ms(14)
40
40
  }), [
41
41
  ms
42
42
  ]);
@@ -86,12 +86,11 @@ const useStyles = (props)=>{
86
86
  ]);
87
87
  const textColor = useMemo(()=>{
88
88
  const customColorConfig = buttonConfig?.color?.[color];
89
- if (customColorConfig) return customColorConfig.text;
90
- if ('contrast' === color) return 'bg-default';
91
- if ('solid' === variant && ![
92
- 'default',
93
- 'secondary'
94
- ].includes(color)) return 'white';
89
+ if ('solid' === variant) {
90
+ if (customColorConfig) return customColorConfig.text;
91
+ if ('contrast' === color) return 'bg-default';
92
+ return 'white';
93
+ }
95
94
  return color;
96
95
  }, [
97
96
  color,
@@ -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';
@@ -37,10 +37,9 @@ const UXChip = /*#__PURE__*/ forwardRef((props, ref)=>{
37
37
  return /*#__PURE__*/ jsx(HStack, {
38
38
  ref: ref,
39
39
  gap: gap,
40
- ph: 4,
41
40
  radius: radius,
42
41
  style: [
43
- styles.button,
42
+ styles.chip,
44
43
  style
45
44
  ],
46
45
  ...restProps,
@@ -1,9 +1,10 @@
1
1
  import type { UXChipProps } from './types';
2
2
  export declare const useStyles: ({ size, color, variant, isDisabled }: UXChipProps) => {
3
- button: {
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
- button: {
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;
@@ -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,7 @@
1
+ import React from 'react';
2
+ export type ToastType = 'success' | 'error' | 'loading';
3
+ interface ToastIconProps {
4
+ type: ToastType;
5
+ }
6
+ export declare const ToastIcon: React.FC<ToastIconProps>;
7
+ export {};
@@ -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,3 @@
1
+ export * from './toast';
2
+ export * from './toastConfig';
3
+ export type * from './types';
@@ -0,0 +1,2 @@
1
+ export * from "./toast.js";
2
+ export * from "./toastConfig.js";
@@ -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 };
@@ -0,0 +1,7 @@
1
+ import type { ToastShowParams } from 'react-native-toast-message';
2
+ export interface ToastProps extends ToastShowParams {
3
+ btnText?: string;
4
+ colorBg?: boolean;
5
+ numberOfLines?: number;
6
+ onPress?: () => void;
7
+ }
File without changes
@@ -20,5 +20,6 @@ export * from './UXRadio';
20
20
  export * from './UXSpinner';
21
21
  export * from './UXSwitch';
22
22
  export * from './UXTabs';
23
+ export * from './UXToast';
23
24
  export * from './UXTooltip';
24
25
  export * from './UXTouchableOpacity';
@@ -20,5 +20,6 @@ export * from "./UXRadio/index.js";
20
20
  export * from "./UXSpinner/index.js";
21
21
  export * from "./UXSwitch/index.js";
22
22
  export * from "./UXTabs/index.js";
23
+ export * from "./UXToast/index.js";
23
24
  export * from "./UXTooltip/index.js";
24
25
  export * from "./UXTouchableOpacity/index.js";
@@ -50,6 +50,9 @@ const defaultComponentConfig = {
50
50
  defaultProps: {
51
51
  radius: 4
52
52
  }
53
+ },
54
+ toast: {
55
+ radius: 'lg'
53
56
  }
54
57
  };
55
58
  export { defaultComponentConfig };
@@ -56,6 +56,9 @@ const uxComponentConfig = {
56
56
  defaultProps: {
57
57
  radius: 'full'
58
58
  }
59
+ },
60
+ toast: {
61
+ radius: 'full'
59
62
  }
60
63
  };
61
64
  export { uxComponentConfig };
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import type { IconProps } from './types';
3
+ declare const DotIcon: React.FC<IconProps>;
4
+ export default DotIcon;
@@ -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 };
@@ -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 { ImpactFeedbackStyle, impactAsync } from "expo-haptics";
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
@@ -0,0 +1,5 @@
1
+ import registerRootComponent from 'expo/src/launch/registerRootComponent';
2
+
3
+ import App from './App';
4
+
5
+ registerRootComponent(App);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@particle-network/ui-native",
3
- "version": "0.0.18",
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": "^14.1.4",
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.0.0",
65
- "@expo/metro-runtime": "~5.0.4",
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.1.2",
69
- "@react-native-community/datetimepicker": "8.4.1",
70
- "@react-native-community/slider": "4.5.6",
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
- "@storybook/react-native-web-vite": "^9",
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": "~53.0.22",
87
- "expo-constants": "~17.1.6",
88
- "expo-status-bar": "~2.2.3",
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.0.0",
91
- "react-dom": "19.0.0",
92
- "react-native": "0.79.5",
93
- "react-native-gesture-handler": "~2.24.0",
94
- "react-native-reanimated": "~3.17.4",
95
- "react-native-safe-area-context": "5.4.0",
96
- "react-native-svg": "15.11.2",
97
- "react-native-web": "^0.20.0",
98
- "storybook": "^9",
99
- "typescript": "~5.8.3",
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
+ }