@particle-network/ui-native 0.4.0-beta.9 → 0.4.0

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.
@@ -7,7 +7,7 @@ import { UXPressable } from "../UXPressable/index.js";
7
7
  import { UXSpinner } from "../UXSpinner/index.js";
8
8
  import { useStyles } from "./button.styles.js";
9
9
  const UXButton = /*#__PURE__*/ forwardRef((props, ref)=>{
10
- const { style, size, radius, color, variant, onPress, isDisabled, isLoading, startContent, endContent, fullWidth, width, w, h, ph, isIconOnly, children, ...restProps } = props;
10
+ const { style, size, radius, color, variant, onPress, isDisabled, isLoading, startContent, endContent, fullWidth, width, gap, w, h, ph, isIconOnly, children, ...restProps } = props;
11
11
  const handlePress = (e)=>{
12
12
  Keyboard.dismiss();
13
13
  triggerHapticFeedback();
@@ -23,6 +23,7 @@ const UXButton = /*#__PURE__*/ forwardRef((props, ref)=>{
23
23
  fullWidth,
24
24
  isIconOnly,
25
25
  width,
26
+ gap,
26
27
  w,
27
28
  h,
28
29
  ph
@@ -6,7 +6,7 @@ export declare const useStyles: (props: UXButtonProps) => {
6
6
  flexDirection: "row";
7
7
  alignItems: "center";
8
8
  justifyContent: "center";
9
- gap: number;
9
+ gap: number | undefined;
10
10
  paddingVertical: number;
11
11
  height: number | undefined;
12
12
  width: number | "100%" | undefined;
@@ -4,7 +4,7 @@ import { useColors, useComponentConfig, useMs, useRadius, useSpacing } from "../
4
4
  import { disabledOpacity } from "../../theme/index.js";
5
5
  const useStyles = (props)=>{
6
6
  const { button: buttonConfig } = useComponentConfig();
7
- const { size = 'md', radius = buttonConfig.defaultProps?.radius, color = 'default', variant = 'solid', isDisabled, isLoading, width, w, h, ph, fullWidth, isIconOnly } = props;
7
+ const { size = 'md', radius = buttonConfig.defaultProps?.radius, color = 'default', variant = 'solid', isDisabled, isLoading, width, gap, w, h, ph, fullWidth, isIconOnly } = props;
8
8
  const { getColor } = useColors();
9
9
  const { getRadius } = useRadius();
10
10
  const { getSpacing } = useSpacing();
@@ -29,6 +29,15 @@ const useStyles = (props)=>{
29
29
  ms,
30
30
  buttonConfig.fontSize
31
31
  ]);
32
+ const iconSizeMap = useMemo(()=>({
33
+ xs: ms(14),
34
+ sm: ms(16),
35
+ md: ms(18),
36
+ lg: ms(24),
37
+ auto: ms(16)
38
+ }), [
39
+ ms
40
+ ]);
32
41
  const radiusMap = {
33
42
  xs: 'xs',
34
43
  sm: 'sm',
@@ -37,9 +46,9 @@ const useStyles = (props)=>{
37
46
  auto: 'sm'
38
47
  };
39
48
  const paddingMap = useMemo(()=>({
40
- xs: ms(4),
41
- sm: ms(6),
42
- md: ms(10),
49
+ xs: ms(10),
50
+ sm: ms(14),
51
+ md: ms(14),
43
52
  lg: ms(14)
44
53
  }), [
45
54
  ms
@@ -70,9 +79,9 @@ const useStyles = (props)=>{
70
79
  size,
71
80
  fontSizeMap
72
81
  ]);
73
- const spinnerSize = useMemo(()=>fontSize + ms(4), [
74
- fontSize,
75
- ms
82
+ const spinnerSize = useMemo(()=>iconSizeMap[size], [
83
+ size,
84
+ iconSizeMap
76
85
  ]);
77
86
  const borderRadius = useMemo(()=>getRadius(radius ?? radiusMap[size]), [
78
87
  radius,
@@ -120,12 +129,12 @@ const useStyles = (props)=>{
120
129
  return getColor('bg-200');
121
130
  }
122
131
  if ('flat' === variant) {
123
- if (customColorConfig) return `${getColor(customColorConfig.background)}40`;
132
+ if (customColorConfig) return `${getColor(customColorConfig.background)}20`;
124
133
  if ('contrast' === color) return `${getColor('foreground')}40`;
125
134
  if ([
126
135
  'default',
127
136
  'secondary'
128
- ].includes(color)) return `${getColor('bg-200')}40`;
137
+ ].includes(color)) return getColor('bg-300');
129
138
  return `${getColor(color)}20`;
130
139
  }
131
140
  return 'transparent';
@@ -161,7 +170,7 @@ const useStyles = (props)=>{
161
170
  flexDirection: 'row',
162
171
  alignItems: 'center',
163
172
  justifyContent: 'center',
164
- gap: ms(8),
173
+ gap: gap ? getSpacing(gap) : ms(4),
165
174
  paddingVertical: 0,
166
175
  height,
167
176
  width: widthStyle,
@@ -1,9 +1,10 @@
1
1
  import React from 'react';
2
2
  import type { View } from 'react-native';
3
3
  import type { IconProps } from '../../icons/types';
4
- import { type VStackProps } from '../layout/VStack';
4
+ import { type VStackProps } from '../layout';
5
5
  export interface UXEmptyProps extends VStackProps {
6
6
  iconProps?: IconProps;
7
7
  text?: React.ReactNode;
8
+ action?: React.ReactNode;
8
9
  }
9
10
  export declare const UXEmpty: React.ForwardRefExoticComponent<UXEmptyProps & React.RefAttributes<View>>;
@@ -3,12 +3,12 @@ import { forwardRef } from "react";
3
3
  import { useI18n } from "../../hooks/useI18n.js";
4
4
  import { useMs } from "../../hooks/useMs.js";
5
5
  import { Icon } from "../../icons/index.js";
6
- import { VStack } from "../layout/VStack.js";
6
+ import { Box, VStack } from "../layout/index.js";
7
7
  import { Text } from "../Text/index.js";
8
8
  const UXEmpty = /*#__PURE__*/ forwardRef((props, ref)=>{
9
9
  const i18n = useI18n();
10
10
  const { ms } = useMs();
11
- const { text = i18n.table.emptyContent, iconProps, ...restProps } = props;
11
+ const { text = i18n.table.emptyContent, iconProps, action, ...restProps } = props;
12
12
  return /*#__PURE__*/ jsxs(VStack, {
13
13
  ref: ref,
14
14
  center: true,
@@ -26,6 +26,10 @@ const UXEmpty = /*#__PURE__*/ forwardRef((props, ref)=>{
26
26
  color: "secondary",
27
27
  fontWeight: "normal",
28
28
  children: text
29
+ }),
30
+ action && /*#__PURE__*/ jsx(Box, {
31
+ mt: "lg",
32
+ children: action
29
33
  })
30
34
  ]
31
35
  });
@@ -1,12 +1,6 @@
1
1
  export * from './date-picker';
2
2
  export * from './input';
3
- export * from './layout/Box';
4
- export * from './layout/Center';
5
- export * from './layout/Circle';
6
- export * from './layout/Flex';
7
- export * from './layout/HStack';
8
- export * from './layout/Square';
9
- export * from './layout/VStack';
3
+ export * from './layout';
10
4
  export * from './ProgressWrapper';
11
5
  export * from './Text';
12
6
  export * from './UXButton';
@@ -1,12 +1,6 @@
1
1
  export * from "./date-picker/index.js";
2
2
  export * from "./input/index.js";
3
- export * from "./layout/Box/index.js";
4
- export * from "./layout/Center.js";
5
- export * from "./layout/Circle.js";
6
- export * from "./layout/Flex/index.js";
7
- export * from "./layout/HStack.js";
8
- export * from "./layout/Square.js";
9
- export * from "./layout/VStack.js";
3
+ export * from "./layout/index.js";
10
4
  export * from "./ProgressWrapper/index.js";
11
5
  export * from "./Text/index.js";
12
6
  export * from "./UXButton/index.js";
@@ -132,7 +132,8 @@ const UXInput = /*#__PURE__*/ forwardRef((props, ref)=>{
132
132
  allowFontScaling: false,
133
133
  editable: !isDisabled && !isReadOnly,
134
134
  placeholderTextColor: getColor('tertiary'),
135
- selectionColor: isInvalid ? `${styles.container.borderColor}80` : styles.container.borderColor,
135
+ cursorColor: styles.container.borderColor,
136
+ selectionColor: `${styles.container.borderColor}90`,
136
137
  style: [
137
138
  styles.input,
138
139
  inputStyle
@@ -230,7 +230,8 @@ const UXNumberInput = /*#__PURE__*/ forwardRef((props, ref)=>{
230
230
  editable: !isDisabled && !isReadOnly,
231
231
  keyboardType: keyboardType,
232
232
  placeholderTextColor: getColor('tertiary'),
233
- selectionColor: isInvalid ? `${styles.container.borderColor}80` : styles.container.borderColor,
233
+ cursorColor: styles.container.borderColor,
234
+ selectionColor: `${styles.container.borderColor}90`,
234
235
  style: [
235
236
  styles.input,
236
237
  inputStyle
@@ -57,11 +57,7 @@ const useStyles = (props)=>{
57
57
  isInvalid,
58
58
  getColor
59
59
  ]);
60
- const backgroundColor = useMemo(()=>{
61
- if (isInvalid) return `${getColor('danger')}50`;
62
- return getColor('bg-200');
63
- }, [
64
- isInvalid,
60
+ const backgroundColor = useMemo(()=>getColor('bg-200'), [
65
61
  getColor
66
62
  ]);
67
63
  const containerPadding = useMemo(()=>{
@@ -253,7 +253,7 @@ export interface UseBoxProps {
253
253
  * | bg-200 | #1F1F23 | #F0F0F2 |
254
254
  * | bg-300 | #17171C | #F8F8FA |
255
255
  * | bg-400 | #0F0F0F | #FFFFFF |
256
- * | divider | #282828 | #E8E8ED |
256
+ * | divider | #26272D | #E8E8ED |
257
257
  * | transparent | transparent | transparent |
258
258
  *
259
259
  * - Foreground Color
@@ -0,0 +1,7 @@
1
+ export * from './Box';
2
+ export * from './Center';
3
+ export * from './Circle';
4
+ export * from './Flex';
5
+ export * from './HStack';
6
+ export * from './Square';
7
+ export * from './VStack';
@@ -0,0 +1,7 @@
1
+ export * from "./Box/index.js";
2
+ export * from "./Center.js";
3
+ export * from "./Circle.js";
4
+ export * from "./Flex/index.js";
5
+ export * from "./HStack.js";
6
+ export * from "./Square.js";
7
+ export * from "./VStack.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@particle-network/ui-native",
3
- "version": "0.4.0-beta.9",
3
+ "version": "0.4.0",
4
4
  "main": "./entry.js",
5
5
  "react-native": "./dist/index.js",
6
6
  "module": "./dist/index.js",
@@ -44,8 +44,8 @@
44
44
  "react-native-paper": "^5.14.5",
45
45
  "react-native-size-matters": "^0.4.2",
46
46
  "react-native-toast-message": "^2.3.3",
47
- "@particle-network/icons": "0.4.0-beta.8",
48
- "@particle-network/ui-shared": "0.3.0-beta.2"
47
+ "@particle-network/ui-shared": "0.3.0",
48
+ "@particle-network/icons": "0.4.0"
49
49
  },
50
50
  "devDependencies": {
51
51
  "@babel/core": "^7.24.0",
@@ -75,9 +75,9 @@
75
75
  "expo-constants": "~18.0.8",
76
76
  "expo-status-bar": "~3.0.8",
77
77
  "lucide-react-native": "^0.541.0",
78
- "react": "19.1.0",
79
- "react-dom": "19.1.0",
80
- "react-native": "0.81.4",
78
+ "react": "19.1.2",
79
+ "react-dom": "19.1.2",
80
+ "react-native": "0.81.5",
81
81
  "react-native-gesture-handler": "~2.28.0",
82
82
  "react-native-reanimated": "~4.1.0",
83
83
  "react-native-safe-area-context": "5.6.1",
@@ -85,13 +85,12 @@
85
85
  "react-native-web": "^0.21.1",
86
86
  "serve": "^14.2.5",
87
87
  "storybook": "^9.1.6",
88
- "typescript": "~5.9.2",
89
88
  "unfetch": "^4.2.0",
90
89
  "vite": "^6.3.5",
91
90
  "zustand": "^5.0.8",
92
91
  "@particle-network/eslint-config": "0.3.0",
93
- "@particle-network/icons": "0.4.0-beta.8",
94
- "@particle-network/lintstaged-config": "0.1.0"
92
+ "@particle-network/lintstaged-config": "0.1.0",
93
+ "@particle-network/icons": "0.4.0"
95
94
  },
96
95
  "overrides": {
97
96
  "react-docgen-typescript": "2.2.2",
@@ -112,7 +111,7 @@
112
111
  "storybook:build": "storybook build",
113
112
  "storybook:preview": "serve storybook-static",
114
113
  "storybook:generate": "sb-rn-get-stories",
115
- "type-check": "npx tsc --noEmit -p ./tsconfig.json",
114
+ "type-check": "npx tsgo --noEmit -p ./tsconfig.json",
116
115
  "dev": "rslib build --watch",
117
116
  "build": "rslib build",
118
117
  "lint": "eslint . --no-error-on-unmatched-pattern --quiet",