@particle-network/ui-native 0.1.0 → 0.1.2

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.
@@ -27,9 +27,12 @@ const ProgressWrapper = ({ style, svgStyle, value = 0, width, height, radius = '
27
27
  height
28
28
  ]);
29
29
  const clampedProgress = Math.max(0, Math.min(100, value));
30
+ const padding = strokeWidth;
31
+ const svgWidth = widthValue + padding;
32
+ const svgHeight = heightValue + padding;
30
33
  const rectWidth = widthValue - strokeWidth;
31
34
  const rectHeight = heightValue - strokeWidth;
32
- const rectXY = strokeWidth / 2;
35
+ const rectXY = strokeWidth / 2 + padding / 2;
33
36
  const perimeter = 2 * (rectWidth + rectHeight);
34
37
  const strokeDashoffset = perimeter * (1 - clampedProgress / 100);
35
38
  const colorValue = 'transparent' === color ? 'transparent' : getColor(color);
@@ -64,8 +67,8 @@ const ProgressWrapper = ({ style, svgStyle, value = 0, width, height, radius = '
64
67
  },
65
68
  svg: {
66
69
  position: 'absolute',
67
- left: 0,
68
- top: 0
70
+ left: -padding / 2,
71
+ top: -padding / 2
69
72
  }
70
73
  });
71
74
  const handleLayout = (event)=>{
@@ -84,12 +87,12 @@ const ProgressWrapper = ({ style, svgStyle, value = 0, width, height, radius = '
84
87
  ...restProps,
85
88
  children: [
86
89
  /*#__PURE__*/ jsxs(react_native_svg, {
87
- height: heightValue,
90
+ height: svgHeight,
88
91
  style: [
89
92
  styles.svg,
90
93
  svgStyle
91
94
  ],
92
- width: widthValue,
95
+ width: svgWidth,
93
96
  children: [
94
97
  /*#__PURE__*/ jsx(Path, {
95
98
  d: pathData,
@@ -103,8 +106,8 @@ const ProgressWrapper = ({ style, svgStyle, value = 0, width, height, radius = '
103
106
  stroke: colorValue,
104
107
  strokeDasharray: perimeter,
105
108
  strokeDashoffset: strokeDashoffset,
106
- strokeLinecap: "round",
107
- strokeLinejoin: "round",
109
+ strokeLinecap: "butt",
110
+ strokeLinejoin: "miter",
108
111
  strokeWidth: strokeWidth
109
112
  })
110
113
  ]
@@ -21,52 +21,55 @@ const ToastView = ({ type, text, props: toastProps })=>{
21
21
  type,
22
22
  colors
23
23
  ]);
24
- return /*#__PURE__*/ jsxs(HStack, {
25
- gap: "md",
26
- radius: toastConfig.radius,
24
+ return /*#__PURE__*/ jsx(HStack, {
25
+ center: true,
27
26
  mh: 14,
28
- minH: 42,
29
- pv: 12,
30
- ph: 14,
31
27
  mt: 20,
32
28
  zIndex: 9999,
33
- style: {
34
- backgroundColor: bg
35
- },
36
- children: [
37
- /*#__PURE__*/ jsx(ToastIcon, {
38
- type: type
39
- }),
40
- /*#__PURE__*/ jsx(Flex, {
41
- fill: true,
42
- children: /*#__PURE__*/ jsx(Text, {
43
- body2Bold: true,
44
- color: colorBg ? 'white' : 'foreground',
45
- numberOfLines: numberOfLines,
46
- children: text
29
+ children: /*#__PURE__*/ jsxs(HStack, {
30
+ minH: 42,
31
+ pv: 12,
32
+ ph: 14,
33
+ gap: "md",
34
+ radius: toastConfig.radius,
35
+ style: {
36
+ backgroundColor: bg
37
+ },
38
+ children: [
39
+ /*#__PURE__*/ jsx(ToastIcon, {
40
+ type: type
41
+ }),
42
+ /*#__PURE__*/ jsx(Flex, {
43
+ shrink: 1,
44
+ children: /*#__PURE__*/ jsx(Text, {
45
+ body2Bold: true,
46
+ color: colorBg ? 'white' : 'foreground',
47
+ numberOfLines: numberOfLines,
48
+ children: text
49
+ })
50
+ }),
51
+ btnText && onPress ? /*#__PURE__*/ jsx(UXButton, {
52
+ variant: "text",
53
+ onPress: ()=>{
54
+ react_native_toast_message.hide();
55
+ onPress();
56
+ },
57
+ children: /*#__PURE__*/ jsx(Text, {
58
+ body2Bold: true,
59
+ color: "primary",
60
+ children: btnText
61
+ })
62
+ }) : null,
63
+ /*#__PURE__*/ jsx(UXButton, {
64
+ variant: "text",
65
+ onPress: ()=>react_native_toast_message.hide(),
66
+ children: /*#__PURE__*/ jsx(CloseIcon, {
67
+ color: colorBg ? 'white' : 'foreground',
68
+ size: 18
69
+ })
47
70
  })
48
- }),
49
- btnText && onPress ? /*#__PURE__*/ jsx(UXButton, {
50
- variant: "text",
51
- onPress: ()=>{
52
- react_native_toast_message.hide();
53
- onPress();
54
- },
55
- children: /*#__PURE__*/ jsx(Text, {
56
- body2Bold: true,
57
- color: "primary",
58
- children: btnText
59
- })
60
- }) : null,
61
- /*#__PURE__*/ jsx(UXButton, {
62
- variant: "text",
63
- onPress: ()=>react_native_toast_message.hide(),
64
- children: /*#__PURE__*/ jsx(CloseIcon, {
65
- color: colorBg ? 'white' : 'foreground',
66
- size: 18
67
- })
68
- })
69
- ]
71
+ ]
72
+ })
70
73
  });
71
74
  };
72
75
  export { ToastView };
@@ -15,7 +15,7 @@ export declare const useStyles: (props: UseStylesProps) => {
15
15
  opacity: number;
16
16
  };
17
17
  input: {
18
- height: "100%";
18
+ height: "auto" | "100%";
19
19
  flex: number;
20
20
  paddingTop: number;
21
21
  paddingBottom: number;
@@ -1,5 +1,5 @@
1
1
  import { useMemo } from "react";
2
- import { StyleSheet } from "react-native";
2
+ import { Platform, StyleSheet } from "react-native";
3
3
  import { useColors, useComponentConfig, useMs, useRadius } from "../../hooks/index.js";
4
4
  import { disabledOpacity } from "../../theme/index.js";
5
5
  const useStyles = (props)=>{
@@ -90,7 +90,7 @@ const useStyles = (props)=>{
90
90
  opacity: isDisabled ? disabledOpacity : 1
91
91
  },
92
92
  input: {
93
- height: '100%',
93
+ height: 'android' === Platform.OS ? '100%' : 'auto',
94
94
  flex: 1,
95
95
  paddingTop: 0,
96
96
  paddingBottom: 0,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@particle-network/ui-native",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "license": "MIT",
5
5
  "main": "./entry.js",
6
6
  "react-native": "./dist/index.js",
@@ -16,6 +16,22 @@
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
+ },
19
35
  "files": [
20
36
  "dist",
21
37
  "README.md",
@@ -36,6 +52,7 @@
36
52
  "author": "UniversalX",
37
53
  "dependencies": {
38
54
  "@lottiefiles/dotlottie-react": "^0.16.2",
55
+ "@particle-network/ui-shared": "workspace:*",
39
56
  "ahooks": "^3.9.4",
40
57
  "deepmerge": "^4.3.1",
41
58
  "expo-haptics": "^15.0.7",
@@ -43,8 +60,7 @@
43
60
  "lottie-react-native": "^7.3.4",
44
61
  "react-native-paper": "^5.14.5",
45
62
  "react-native-size-matters": "^0.4.2",
46
- "react-native-toast-message": "^2.3.3",
47
- "@particle-network/ui-shared": "0.1.0"
63
+ "react-native-toast-message": "^2.3.3"
48
64
  },
49
65
  "devDependencies": {
50
66
  "@babel/core": "^7.24.0",
@@ -52,6 +68,9 @@
52
68
  "@chromatic-com/storybook": "^4.1.1",
53
69
  "@expo/metro-runtime": "~6.1.2",
54
70
  "@gorhom/bottom-sheet": "^5.1.2",
71
+ "@particle-network/eslint-config": "workspace:*",
72
+ "@particle-network/icons": "workspace:*",
73
+ "@particle-network/lintstaged-config": "workspace:*",
55
74
  "@react-native-async-storage/async-storage": "2.2.0",
56
75
  "@react-native-community/datetimepicker": "8.4.4",
57
76
  "@react-native-community/slider": "5.0.1",
@@ -85,9 +104,7 @@
85
104
  "typescript": "~5.9.2",
86
105
  "unfetch": "^4.2.0",
87
106
  "vite": "^6.3.5",
88
- "zustand": "^5.0.8",
89
- "@particle-network/icons": "0.1.0",
90
- "@particle-network/eslint-config": "0.1.0"
107
+ "zustand": "^5.0.8"
91
108
  },
92
109
  "overrides": {
93
110
  "react-docgen-typescript": "2.2.2",
@@ -99,21 +116,5 @@
99
116
  "listUnknownPackages": false
100
117
  }
101
118
  }
102
- },
103
- "scripts": {
104
- "start": "expo start",
105
- "android": "expo start --android",
106
- "ios": "expo start --ios",
107
- "web": "storybook dev -p 6006",
108
- "storybook:build": "storybook build",
109
- "storybook:preview": "serve storybook-static",
110
- "storybook:generate": "sb-rn-get-stories",
111
- "type-check": "npx tsc --noEmit -p ./tsconfig.json",
112
- "dev": "rslib build --watch",
113
- "build": "rslib build",
114
- "lint": "eslint . --no-error-on-unmatched-pattern --quiet",
115
- "lint:fix": "eslint . --fix --no-error-on-unmatched-pattern --quiet",
116
- "clean": "rm -rf .turbo node_modules dist",
117
- "deploy:dev": "sh ./scripts/deploy-dev.sh"
118
119
  }
119
- }
120
+ }
package/entry.js DELETED
@@ -1,5 +0,0 @@
1
- import registerRootComponent from 'expo/src/launch/registerRootComponent';
2
-
3
- import App from './App';
4
-
5
- registerRootComponent(App);