@particle-network/ui-native 0.0.8 → 0.0.10
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,4 +1,3 @@
|
|
|
1
|
-
import { useMemo } from "react";
|
|
2
1
|
import { ms as external_react_native_size_matters_ms } from "react-native-size-matters";
|
|
3
2
|
import { useColors, useRadius, useSpacing } from "../../../hooks/index.js";
|
|
4
3
|
const borderFunc = (value)=>{
|
|
@@ -10,132 +9,67 @@ const useBoxStyle = (props)=>{
|
|
|
10
9
|
const { getColor } = useColors();
|
|
11
10
|
const { getSpacing } = useSpacing();
|
|
12
11
|
const { getRadius } = useRadius();
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
return styleObj;
|
|
75
|
-
}, [
|
|
76
|
-
fullWidth,
|
|
77
|
-
fullHeight,
|
|
78
|
-
h,
|
|
79
|
-
minH,
|
|
80
|
-
maxH,
|
|
81
|
-
w,
|
|
82
|
-
minW,
|
|
83
|
-
maxW,
|
|
84
|
-
m,
|
|
85
|
-
mt,
|
|
86
|
-
mr,
|
|
87
|
-
mb,
|
|
88
|
-
ml,
|
|
89
|
-
ms,
|
|
90
|
-
me,
|
|
91
|
-
mh,
|
|
92
|
-
mv,
|
|
93
|
-
p,
|
|
94
|
-
pt,
|
|
95
|
-
pr,
|
|
96
|
-
pb,
|
|
97
|
-
pl,
|
|
98
|
-
ps,
|
|
99
|
-
pe,
|
|
100
|
-
ph,
|
|
101
|
-
pv,
|
|
102
|
-
borderStyle,
|
|
103
|
-
border,
|
|
104
|
-
borderTop,
|
|
105
|
-
borderRight,
|
|
106
|
-
borderBottom,
|
|
107
|
-
borderLeft,
|
|
108
|
-
borderStart,
|
|
109
|
-
borderEnd,
|
|
110
|
-
borderColor,
|
|
111
|
-
borderTopColor,
|
|
112
|
-
borderRightColor,
|
|
113
|
-
borderBottomColor,
|
|
114
|
-
borderLeftColor,
|
|
115
|
-
borderStartColor,
|
|
116
|
-
borderEndColor,
|
|
117
|
-
radius,
|
|
118
|
-
topLeftRadius,
|
|
119
|
-
topRightRadius,
|
|
120
|
-
bottomLeftRadius,
|
|
121
|
-
bottomRightRadius,
|
|
122
|
-
topStartRadius,
|
|
123
|
-
topEndRadius,
|
|
124
|
-
bottomStartRadius,
|
|
125
|
-
bottomEndRadius,
|
|
126
|
-
position,
|
|
127
|
-
top,
|
|
128
|
-
right,
|
|
129
|
-
bottom,
|
|
130
|
-
left,
|
|
131
|
-
start,
|
|
132
|
-
end,
|
|
133
|
-
bg,
|
|
134
|
-
bgOpacity,
|
|
135
|
-
opacity,
|
|
136
|
-
zIndex,
|
|
137
|
-
overflow
|
|
138
|
-
]);
|
|
12
|
+
const styleObj = {};
|
|
13
|
+
styleObj.width = fullWidth ? '100%' : getSpacing(w);
|
|
14
|
+
styleObj.height = fullHeight ? '100%' : getSpacing(h);
|
|
15
|
+
styleObj.minHeight = getSpacing(minH);
|
|
16
|
+
styleObj.maxHeight = getSpacing(maxH);
|
|
17
|
+
styleObj.minWidth = getSpacing(minW);
|
|
18
|
+
styleObj.maxWidth = getSpacing(maxW);
|
|
19
|
+
styleObj.margin = getSpacing(m);
|
|
20
|
+
styleObj.marginTop = getSpacing(mt);
|
|
21
|
+
styleObj.marginRight = getSpacing(mr);
|
|
22
|
+
styleObj.marginBottom = getSpacing(mb);
|
|
23
|
+
styleObj.marginLeft = getSpacing(ml);
|
|
24
|
+
styleObj.marginStart = getSpacing(ms);
|
|
25
|
+
styleObj.marginEnd = getSpacing(me);
|
|
26
|
+
styleObj.marginHorizontal = getSpacing(mh);
|
|
27
|
+
styleObj.marginVertical = getSpacing(mv);
|
|
28
|
+
styleObj.padding = getSpacing(p);
|
|
29
|
+
styleObj.paddingTop = getSpacing(pt);
|
|
30
|
+
styleObj.paddingRight = getSpacing(pr);
|
|
31
|
+
styleObj.paddingBottom = getSpacing(pb);
|
|
32
|
+
styleObj.paddingLeft = getSpacing(pl);
|
|
33
|
+
styleObj.paddingStart = getSpacing(ps);
|
|
34
|
+
styleObj.paddingEnd = getSpacing(pe);
|
|
35
|
+
styleObj.paddingHorizontal = getSpacing(ph);
|
|
36
|
+
styleObj.paddingVertical = getSpacing(pv);
|
|
37
|
+
styleObj.borderStyle = borderStyle;
|
|
38
|
+
styleObj.borderWidth = borderFunc(border);
|
|
39
|
+
styleObj.borderTopWidth = borderFunc(borderTop);
|
|
40
|
+
styleObj.borderRightWidth = borderFunc(borderRight);
|
|
41
|
+
styleObj.borderBottomWidth = borderFunc(borderBottom);
|
|
42
|
+
styleObj.borderLeftWidth = borderFunc(borderLeft);
|
|
43
|
+
styleObj.borderStartWidth = borderFunc(borderStart);
|
|
44
|
+
styleObj.borderEndWidth = borderFunc(borderEnd);
|
|
45
|
+
styleObj.borderColor = getColor(borderColor);
|
|
46
|
+
styleObj.borderTopColor = getColor(borderTopColor);
|
|
47
|
+
styleObj.borderRightColor = getColor(borderRightColor);
|
|
48
|
+
styleObj.borderBottomColor = getColor(borderBottomColor);
|
|
49
|
+
styleObj.borderLeftColor = getColor(borderLeftColor);
|
|
50
|
+
styleObj.borderStartColor = getColor(borderStartColor);
|
|
51
|
+
styleObj.borderEndColor = getColor(borderEndColor);
|
|
52
|
+
styleObj.borderRadius = getRadius(radius);
|
|
53
|
+
styleObj.borderTopLeftRadius = getRadius(topLeftRadius);
|
|
54
|
+
styleObj.borderTopRightRadius = getRadius(topRightRadius);
|
|
55
|
+
styleObj.borderBottomLeftRadius = getRadius(bottomLeftRadius);
|
|
56
|
+
styleObj.borderBottomRightRadius = getRadius(bottomRightRadius);
|
|
57
|
+
styleObj.borderTopStartRadius = getRadius(topStartRadius);
|
|
58
|
+
styleObj.borderTopEndRadius = getRadius(topEndRadius);
|
|
59
|
+
styleObj.borderBottomStartRadius = getRadius(bottomStartRadius);
|
|
60
|
+
styleObj.borderBottomEndRadius = getRadius(bottomEndRadius);
|
|
61
|
+
styleObj.position = position;
|
|
62
|
+
styleObj.top = getSpacing(top);
|
|
63
|
+
styleObj.right = getSpacing(right);
|
|
64
|
+
styleObj.bottom = getSpacing(bottom);
|
|
65
|
+
styleObj.left = getSpacing(left);
|
|
66
|
+
styleObj.start = getSpacing(start);
|
|
67
|
+
styleObj.end = getSpacing(end);
|
|
68
|
+
styleObj.backgroundColor = getColor(bg, bgOpacity);
|
|
69
|
+
styleObj.opacity = opacity;
|
|
70
|
+
styleObj.zIndex = zIndex;
|
|
71
|
+
styleObj.overflow = overflow;
|
|
72
|
+
const boxStyle = styleObj;
|
|
139
73
|
return boxStyle;
|
|
140
74
|
};
|
|
141
75
|
export { useBoxStyle };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@particle-network/ui-native",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.10",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "./entry.js",
|
|
6
6
|
"react-native": "./dist/index.js",
|
|
@@ -10,10 +10,10 @@
|
|
|
10
10
|
".": {
|
|
11
11
|
"types": "./dist/index.d.ts",
|
|
12
12
|
"import": "./dist/index.js",
|
|
13
|
-
"react-native": "./
|
|
14
|
-
"android": "./
|
|
15
|
-
"ios": "./
|
|
16
|
-
"default": "./
|
|
13
|
+
"react-native": "./dist/index.js",
|
|
14
|
+
"android": "./dist/index.js",
|
|
15
|
+
"ios": "./dist/index.js",
|
|
16
|
+
"default": "./dist/index.js"
|
|
17
17
|
}
|
|
18
18
|
},
|
|
19
19
|
"scripts": {
|
|
@@ -25,8 +25,8 @@
|
|
|
25
25
|
"storybook:preview": "serve storybook-static",
|
|
26
26
|
"storybook:generate": "sb-rn-get-stories",
|
|
27
27
|
"type-check": "npx tsc --noEmit -p ./tsconfig.json",
|
|
28
|
+
"dev": "rslib build --watch",
|
|
28
29
|
"build": "rslib build",
|
|
29
|
-
"build:watch": "rslib build --watch",
|
|
30
30
|
"lint": "eslint . --no-error-on-unmatched-pattern --quiet",
|
|
31
31
|
"lint:fix": "eslint . --fix --no-error-on-unmatched-pattern --quiet",
|
|
32
32
|
"clean": "rm -rf .turbo node_modules dist"
|