@particle-network/ui-native 0.0.9 → 0.0.11

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 boxStyle = useMemo(()=>{
14
- const styleObj = {};
15
- styleObj.width = fullWidth ? '100%' : getSpacing(w);
16
- styleObj.height = fullHeight ? '100%' : getSpacing(h);
17
- styleObj.minHeight = getSpacing(minH);
18
- styleObj.maxHeight = getSpacing(maxH);
19
- styleObj.minWidth = getSpacing(minW);
20
- styleObj.maxWidth = getSpacing(maxW);
21
- styleObj.margin = getSpacing(m);
22
- styleObj.marginTop = getSpacing(mt);
23
- styleObj.marginRight = getSpacing(mr);
24
- styleObj.marginBottom = getSpacing(mb);
25
- styleObj.marginLeft = getSpacing(ml);
26
- styleObj.marginStart = getSpacing(ms);
27
- styleObj.marginEnd = getSpacing(me);
28
- styleObj.marginHorizontal = getSpacing(mh);
29
- styleObj.marginVertical = getSpacing(mv);
30
- styleObj.padding = getSpacing(p);
31
- styleObj.paddingTop = getSpacing(pt);
32
- styleObj.paddingRight = getSpacing(pr);
33
- styleObj.paddingBottom = getSpacing(pb);
34
- styleObj.paddingLeft = getSpacing(pl);
35
- styleObj.paddingStart = getSpacing(ps);
36
- styleObj.paddingEnd = getSpacing(pe);
37
- styleObj.paddingHorizontal = getSpacing(ph);
38
- styleObj.paddingVertical = getSpacing(pv);
39
- styleObj.borderStyle = borderStyle;
40
- styleObj.borderWidth = borderFunc(border);
41
- styleObj.borderTopWidth = borderFunc(borderTop);
42
- styleObj.borderRightWidth = borderFunc(borderRight);
43
- styleObj.borderBottomWidth = borderFunc(borderBottom);
44
- styleObj.borderLeftWidth = borderFunc(borderLeft);
45
- styleObj.borderStartWidth = borderFunc(borderStart);
46
- styleObj.borderEndWidth = borderFunc(borderEnd);
47
- styleObj.borderColor = getColor(borderColor);
48
- styleObj.borderTopColor = getColor(borderTopColor);
49
- styleObj.borderRightColor = getColor(borderRightColor);
50
- styleObj.borderBottomColor = getColor(borderBottomColor);
51
- styleObj.borderLeftColor = getColor(borderLeftColor);
52
- styleObj.borderStartColor = getColor(borderStartColor);
53
- styleObj.borderEndColor = getColor(borderEndColor);
54
- styleObj.borderRadius = getRadius(radius);
55
- styleObj.borderTopLeftRadius = getRadius(topLeftRadius);
56
- styleObj.borderTopRightRadius = getRadius(topRightRadius);
57
- styleObj.borderBottomLeftRadius = getRadius(bottomLeftRadius);
58
- styleObj.borderBottomRightRadius = getRadius(bottomRightRadius);
59
- styleObj.borderTopStartRadius = getRadius(topStartRadius);
60
- styleObj.borderTopEndRadius = getRadius(topEndRadius);
61
- styleObj.borderBottomStartRadius = getRadius(bottomStartRadius);
62
- styleObj.borderBottomEndRadius = getRadius(bottomEndRadius);
63
- styleObj.position = position;
64
- styleObj.top = getSpacing(top);
65
- styleObj.right = getSpacing(right);
66
- styleObj.bottom = getSpacing(bottom);
67
- styleObj.left = getSpacing(left);
68
- styleObj.start = getSpacing(start);
69
- styleObj.end = getSpacing(end);
70
- styleObj.backgroundColor = getColor(bg, bgOpacity);
71
- styleObj.opacity = opacity;
72
- styleObj.zIndex = zIndex;
73
- styleObj.overflow = overflow;
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.9",
3
+ "version": "0.0.11",
4
4
  "license": "MIT",
5
5
  "main": "./entry.js",
6
6
  "react-native": "./dist/index.js",
@@ -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"