@particle-network/ui-native 0.5.1-beta.1 → 0.5.1-beta.3
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/dist/components/ProgressWrapper/index.d.ts +2 -2
- package/dist/components/Text/text.types.d.ts +2 -2
- package/dist/components/UXCheckbox/types.d.ts +1 -1
- package/dist/components/UXChip/types.d.ts +2 -2
- package/dist/components/layout/Box/useBox.style.js +3 -3
- package/dist/components/layout/Box/useBox.type.d.ts +11 -9
- package/dist/hooks/useColors.d.ts +2 -2
- package/package.json +5 -5
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { type StyleProp, type ViewStyle } from 'react-native';
|
|
3
|
-
import type { UXForegroundColor, UXRadius } from '@particle-network/ui-shared';
|
|
3
|
+
import type { HexColor, UXForegroundColor, UXRadius } from '@particle-network/ui-shared';
|
|
4
4
|
import { type FlexProps } from '../layout/Flex';
|
|
5
5
|
export interface ProgressWrapperProps extends Omit<FlexProps, 'radius' | 'width' | 'height' | 'w' | 'h'> {
|
|
6
6
|
/**
|
|
@@ -26,7 +26,7 @@ export interface ProgressWrapperProps extends Omit<FlexProps, 'radius' | 'width'
|
|
|
26
26
|
/**
|
|
27
27
|
* 进度条颜色
|
|
28
28
|
*/
|
|
29
|
-
color?: UXForegroundColor | 'transparent' |
|
|
29
|
+
color?: UXForegroundColor | 'transparent' | HexColor;
|
|
30
30
|
/**
|
|
31
31
|
* SVG 样式
|
|
32
32
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { TextProps as RNTextProps, TextStyle } from 'react-native';
|
|
2
|
-
import type { UXForegroundColor } from '@particle-network/ui-shared';
|
|
2
|
+
import type { HexColor, UXForegroundColor } from '@particle-network/ui-shared';
|
|
3
3
|
import type { UseBoxProps } from '../layout/Box';
|
|
4
4
|
type TextVariant = 'h1' | 'h2' | 'h3' | 'body1' | 'body1Bold' | 'body2' | 'body2Bold' | 'body3' | 'body3Bold' | 'caption1' | 'caption1Bold';
|
|
5
5
|
type TextWeight = 'normal' | 'medium' | 'semibold' | 'bold' | 'extrabold';
|
|
@@ -76,7 +76,7 @@ export interface TextProps extends RNTextProps, UseBoxProps {
|
|
|
76
76
|
* | extrabold | 800 |
|
|
77
77
|
*/
|
|
78
78
|
fontWeight?: TextWeight;
|
|
79
|
-
color?: UXForegroundColor |
|
|
79
|
+
color?: UXForegroundColor | HexColor;
|
|
80
80
|
lineHeight?: TextLineHeight;
|
|
81
81
|
align?: TextAlign;
|
|
82
82
|
underlineStyle?: TextStyle['textDecorationStyle'];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export interface UXCheckboxCommonProps {
|
|
2
|
-
color?: 'secondary' | 'primary' | 'success' | 'danger' | 'alert' | 'warning' | '
|
|
2
|
+
color?: 'secondary' | 'primary' | 'success' | 'danger' | 'alert' | 'warning' | 'bullish' | 'bearish';
|
|
3
3
|
size?: 'sm' | 'md' | 'lg';
|
|
4
4
|
isDisabled?: boolean;
|
|
5
5
|
labelPlacement?: 'left' | 'right';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
|
-
import type { UXForegroundColor } from '@particle-network/ui-shared';
|
|
2
|
+
import type { HexColor, UXForegroundColor } from '@particle-network/ui-shared';
|
|
3
3
|
import type { HStackProps } from '../layout/HStack';
|
|
4
4
|
export interface UXChipProps extends HStackProps {
|
|
5
|
-
color?: UXForegroundColor |
|
|
5
|
+
color?: UXForegroundColor | HexColor;
|
|
6
6
|
size?: 'sm' | 'md' | 'lg';
|
|
7
7
|
variant?: 'solid' | 'flat';
|
|
8
8
|
isDisabled?: boolean;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useColors, useMs, useRadius, useSpacing } from "../../../hooks/index.js";
|
|
2
2
|
import { useShadow } from "../../../hooks/useShadow.js";
|
|
3
3
|
const useBoxStyle = (props)=>{
|
|
4
|
-
const { fullWidth, fullHeight, h, minH, maxH, w, minW, maxW, m, mt, mr, mb, ml, ms, me, mh, mv, p, pt, pr, pb, pl, ps, pe, ph, pv, borderStyle, border, borderTop, borderRight, borderBottom, borderLeft, borderStart, borderEnd, borderColor, borderTopColor, borderRightColor, borderBottomColor, borderLeftColor, borderStartColor, borderEndColor, radius, topLeftRadius, topRightRadius, bottomLeftRadius, bottomRightRadius, topStartRadius, topEndRadius, bottomStartRadius, bottomEndRadius, position, top, right, bottom, left, start, end, bg, bgOpacity, opacity, zIndex, overflow, shadow } = props;
|
|
4
|
+
const { fullWidth, fullHeight, h, minH, maxH, w, minW, maxW, m, mt, mr, mb, ml, ms, me, mh, mv, p, pt, pr, pb, pl, ps, pe, ph, px, py, pv, borderStyle, border, borderTop, borderRight, borderBottom, borderLeft, borderStart, borderEnd, borderColor, borderTopColor, borderRightColor, borderBottomColor, borderLeftColor, borderStartColor, borderEndColor, radius, topLeftRadius, topRightRadius, bottomLeftRadius, bottomRightRadius, topStartRadius, topEndRadius, bottomStartRadius, bottomEndRadius, position, top, right, bottom, left, start, end, bg, bgOpacity, opacity, zIndex, overflow, shadow } = props;
|
|
5
5
|
const { ms: uxms } = useMs();
|
|
6
6
|
const { getColor } = useColors();
|
|
7
7
|
const { getSpacing } = useSpacing();
|
|
@@ -25,8 +25,8 @@ const useBoxStyle = (props)=>{
|
|
|
25
25
|
styleObj.marginLeft = getSpacing(ml);
|
|
26
26
|
styleObj.marginStart = getSpacing(ms);
|
|
27
27
|
styleObj.marginEnd = getSpacing(me);
|
|
28
|
-
styleObj.marginHorizontal = getSpacing(mh);
|
|
29
|
-
styleObj.marginVertical = getSpacing(mv);
|
|
28
|
+
styleObj.marginHorizontal = getSpacing(mh || px);
|
|
29
|
+
styleObj.marginVertical = getSpacing(mv || py);
|
|
30
30
|
styleObj.padding = getSpacing(p);
|
|
31
31
|
styleObj.paddingTop = getSpacing(pt);
|
|
32
32
|
styleObj.paddingRight = getSpacing(pr);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ViewStyle } from 'react-native';
|
|
2
|
-
import type { RadiusType, SpacingType, UXColor } from '@particle-network/ui-shared';
|
|
2
|
+
import type { HexColor, RadiusType, SpacingType, UXColor } from '@particle-network/ui-shared';
|
|
3
3
|
export interface UseBoxProps {
|
|
4
4
|
/**
|
|
5
5
|
* Shorthand for the `width=100%` style property.
|
|
@@ -101,10 +101,12 @@ export interface UseBoxProps {
|
|
|
101
101
|
* Shorthand for the `paddingHorizontal` style property.
|
|
102
102
|
*/
|
|
103
103
|
ph?: SpacingType;
|
|
104
|
+
px?: SpacingType;
|
|
104
105
|
/**
|
|
105
106
|
* Shorthand for the `paddingVertical` style property.
|
|
106
107
|
*/
|
|
107
108
|
pv?: SpacingType;
|
|
109
|
+
py?: SpacingType;
|
|
108
110
|
/**
|
|
109
111
|
* Shorthand for the `borderStyle` style property.
|
|
110
112
|
*/
|
|
@@ -140,31 +142,31 @@ export interface UseBoxProps {
|
|
|
140
142
|
/**
|
|
141
143
|
* Shorthand for the `borderColor` style property.
|
|
142
144
|
*/
|
|
143
|
-
borderColor?: UXColor |
|
|
145
|
+
borderColor?: UXColor | HexColor;
|
|
144
146
|
/**
|
|
145
147
|
* Shorthand for the `borderTopColor` style property.
|
|
146
148
|
*/
|
|
147
|
-
borderTopColor?: UXColor |
|
|
149
|
+
borderTopColor?: UXColor | HexColor;
|
|
148
150
|
/**
|
|
149
151
|
* Shorthand for the `borderRightColor` style property.
|
|
150
152
|
*/
|
|
151
|
-
borderRightColor?: UXColor |
|
|
153
|
+
borderRightColor?: UXColor | HexColor;
|
|
152
154
|
/**
|
|
153
155
|
* Shorthand for the `borderBottomColor` style property.
|
|
154
156
|
*/
|
|
155
|
-
borderBottomColor?: UXColor |
|
|
157
|
+
borderBottomColor?: UXColor | HexColor;
|
|
156
158
|
/**
|
|
157
159
|
* Shorthand for the `borderLeftColor` style property.
|
|
158
160
|
*/
|
|
159
|
-
borderLeftColor?: UXColor |
|
|
161
|
+
borderLeftColor?: UXColor | HexColor;
|
|
160
162
|
/**
|
|
161
163
|
* Shorthand for the `borderStartColor` style property.
|
|
162
164
|
*/
|
|
163
|
-
borderStartColor?: UXColor |
|
|
165
|
+
borderStartColor?: UXColor | HexColor;
|
|
164
166
|
/**
|
|
165
167
|
* Shorthand for the `borderEndColor` style property.
|
|
166
168
|
*/
|
|
167
|
-
borderEndColor?: UXColor |
|
|
169
|
+
borderEndColor?: UXColor | HexColor;
|
|
168
170
|
/**
|
|
169
171
|
* Shorthand for the `borderRadius` style property.
|
|
170
172
|
*/
|
|
@@ -232,7 +234,7 @@ export interface UseBoxProps {
|
|
|
232
234
|
/**
|
|
233
235
|
* Shorthand for the `backgroundColor` style property.
|
|
234
236
|
*/
|
|
235
|
-
bg?: UXColor |
|
|
237
|
+
bg?: UXColor | HexColor;
|
|
236
238
|
/**
|
|
237
239
|
* 背景色透明度
|
|
238
240
|
* @example bgOpacity={0.2}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { type UXColor } from '@particle-network/ui-shared';
|
|
1
|
+
import { type HexColor, type UXColor } from '@particle-network/ui-shared';
|
|
2
2
|
/**
|
|
3
3
|
* 颜色工具 Hook
|
|
4
4
|
*/
|
|
5
5
|
export declare function useColors(): {
|
|
6
|
-
getColor: (name?: UXColor |
|
|
6
|
+
getColor: (name?: UXColor | HexColor, opacity?: number) => string | undefined;
|
|
7
7
|
};
|
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.3",
|
|
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.2",
|
|
49
|
+
"@particle-network/icons": "0.5.1-beta.3"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
52
|
"@babel/core": "^7.24.0",
|
|
@@ -90,8 +90,8 @@
|
|
|
90
90
|
"vite": "^6.3.5",
|
|
91
91
|
"zustand": "^5.0.8",
|
|
92
92
|
"@particle-network/eslint-config": "0.3.0",
|
|
93
|
-
"@particle-network/
|
|
94
|
-
"@particle-network/
|
|
93
|
+
"@particle-network/lintstaged-config": "0.1.0",
|
|
94
|
+
"@particle-network/icons": "0.5.1-beta.3"
|
|
95
95
|
},
|
|
96
96
|
"overrides": {
|
|
97
97
|
"react-docgen-typescript": "2.2.2",
|