@particle-network/ui-native 0.0.15 → 0.0.17
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/Text/text.js +1 -1
- package/dist/components/UXTabs/styles.d.ts +3 -1
- package/dist/components/UXTabs/styles.js +11 -7
- package/dist/components/UXTabs/tab.js +0 -3
- package/dist/components/input/styles.d.ts +3 -1
- package/dist/components/input/styles.js +24 -4
- package/dist/components/layout/Box/box.js +1 -1
- package/dist/components/layout/Center.js +1 -1
- package/dist/components/layout/Circle.js +1 -1
- package/dist/components/layout/Flex/flex.js +1 -1
- package/dist/components/layout/HStack.js +1 -1
- package/dist/components/layout/Square.js +1 -1
- package/dist/components/layout/VStack.js +1 -1
- package/package.json +1 -1
|
@@ -8,15 +8,17 @@ export declare const useStyles: (props: Partial<UXTabsProps> & {
|
|
|
8
8
|
flex: number;
|
|
9
9
|
justifyContent: "flex-start" | "space-between";
|
|
10
10
|
borderRadius: number | undefined;
|
|
11
|
-
height: number
|
|
11
|
+
height: number;
|
|
12
12
|
padding: number;
|
|
13
13
|
opacity: number;
|
|
14
14
|
};
|
|
15
15
|
tab: {
|
|
16
|
+
flexDirection: "column";
|
|
16
17
|
flexGrow: number;
|
|
17
18
|
height: "100%";
|
|
18
19
|
alignItems: "center";
|
|
19
20
|
justifyContent: "center";
|
|
21
|
+
gap: number;
|
|
20
22
|
paddingHorizontal: number;
|
|
21
23
|
borderRadius: number | undefined;
|
|
22
24
|
backgroundColor: string | undefined;
|
|
@@ -8,8 +8,14 @@ const useStyles = (props)=>{
|
|
|
8
8
|
const { getColor } = useColors();
|
|
9
9
|
const { getRadius } = useRadius();
|
|
10
10
|
const { ms } = useMs();
|
|
11
|
+
const fontSize = useMemo(()=>ms(tabsConfig.fontSize[size]), [
|
|
12
|
+
size,
|
|
13
|
+
ms,
|
|
14
|
+
tabsConfig.fontSize
|
|
15
|
+
]);
|
|
11
16
|
const height = useMemo(()=>{
|
|
12
|
-
if ('text' === variant
|
|
17
|
+
if ('text' === variant) return fontSize + ms(4);
|
|
18
|
+
if ('underlined' === variant) return fontSize + ms(4) + ms(2) + fontSize / 2;
|
|
13
19
|
if ('solid' === variant) switch(size){
|
|
14
20
|
case 'sm':
|
|
15
21
|
return ms(24);
|
|
@@ -27,14 +33,10 @@ const useStyles = (props)=>{
|
|
|
27
33
|
return ms(30);
|
|
28
34
|
}
|
|
29
35
|
}, [
|
|
30
|
-
size,
|
|
31
36
|
variant,
|
|
32
|
-
ms
|
|
33
|
-
]);
|
|
34
|
-
const fontSize = useMemo(()=>ms(tabsConfig.fontSize[size]), [
|
|
35
37
|
size,
|
|
36
|
-
|
|
37
|
-
|
|
38
|
+
fontSize,
|
|
39
|
+
ms
|
|
38
40
|
]);
|
|
39
41
|
const paddingHorizontal = useMemo(()=>{
|
|
40
42
|
if ('text' === variant || 'underlined' === variant) return 0;
|
|
@@ -151,6 +153,7 @@ const useStyles = (props)=>{
|
|
|
151
153
|
opacity: isDisabled ? disabledOpacity : 1
|
|
152
154
|
},
|
|
153
155
|
tab: {
|
|
156
|
+
flexDirection: 'column',
|
|
154
157
|
flexGrow: [
|
|
155
158
|
'text',
|
|
156
159
|
'light',
|
|
@@ -159,6 +162,7 @@ const useStyles = (props)=>{
|
|
|
159
162
|
height: '100%',
|
|
160
163
|
alignItems: 'center',
|
|
161
164
|
justifyContent: 'center',
|
|
165
|
+
gap: fontSize / 2,
|
|
162
166
|
paddingHorizontal,
|
|
163
167
|
borderRadius: tabBorderRadius,
|
|
164
168
|
backgroundColor: tabBg
|
|
@@ -27,9 +27,6 @@ const UXTab = ({ tabKey = '', title, icon, style, notification })=>{
|
|
|
27
27
|
return /*#__PURE__*/ jsxs(UXTouchableOpacity, {
|
|
28
28
|
activeOpacity: 0.7,
|
|
29
29
|
disabled: isDisabled,
|
|
30
|
-
gap: 8,
|
|
31
|
-
direction: "column",
|
|
32
|
-
items: "center",
|
|
33
30
|
style: [
|
|
34
31
|
styles.tab,
|
|
35
32
|
style
|
|
@@ -5,7 +5,9 @@ type UseStylesProps = UXInputCommonProps & {
|
|
|
5
5
|
export declare const useStyles: (props: UseStylesProps) => {
|
|
6
6
|
container: {
|
|
7
7
|
width: number | import("react-native").Animated.AnimatedNode | "auto" | `${number}%`;
|
|
8
|
-
height: number;
|
|
8
|
+
height: number | undefined;
|
|
9
|
+
paddingTop: number;
|
|
10
|
+
paddingBottom: number;
|
|
9
11
|
borderRadius: number | undefined;
|
|
10
12
|
borderColor: string | undefined;
|
|
11
13
|
backgroundColor: string | undefined;
|
|
@@ -4,7 +4,7 @@ import { useColors, useComponentConfig, useMs, useRadius } from "../../hooks/ind
|
|
|
4
4
|
import { disabledOpacity } from "../../theme/index.js";
|
|
5
5
|
const useStyles = (props)=>{
|
|
6
6
|
const { input: inputConfig } = useComponentConfig();
|
|
7
|
-
const { isInvalid, isDisabled, fullWidth, isFocused, color = 'primary', size = 'md', variant = 'flat', radius = inputConfig.defaultProps?.radius, width: widthProp, textAlign = 'left' } = props;
|
|
7
|
+
const { isInvalid, isDisabled, fullWidth, isFocused, color = 'primary', size = 'md', variant = 'flat', multiline, radius = multiline ? void 0 : inputConfig.defaultProps?.radius, width: widthProp, textAlign = 'left' } = props;
|
|
8
8
|
const { getColor } = useColors();
|
|
9
9
|
const { getRadius } = useRadius();
|
|
10
10
|
const { ms } = useMs();
|
|
@@ -21,10 +21,13 @@ const useStyles = (props)=>{
|
|
|
21
21
|
fullWidth,
|
|
22
22
|
widthProp
|
|
23
23
|
]);
|
|
24
|
-
const height = useMemo(()=>
|
|
24
|
+
const height = useMemo(()=>{
|
|
25
|
+
if (!multiline) return ms(inputConfig.size[size]);
|
|
26
|
+
}, [
|
|
25
27
|
size,
|
|
26
28
|
inputConfig.size,
|
|
27
|
-
ms
|
|
29
|
+
ms,
|
|
30
|
+
multiline
|
|
28
31
|
]);
|
|
29
32
|
const fontSize = useMemo(()=>inputConfig.fontSize[size], [
|
|
30
33
|
size,
|
|
@@ -61,10 +64,25 @@ const useStyles = (props)=>{
|
|
|
61
64
|
isInvalid,
|
|
62
65
|
getColor
|
|
63
66
|
]);
|
|
67
|
+
const containerPadding = useMemo(()=>{
|
|
68
|
+
if (multiline) return {
|
|
69
|
+
paddingTop: ms(12),
|
|
70
|
+
paddingBottom: ms(12)
|
|
71
|
+
};
|
|
72
|
+
return {
|
|
73
|
+
paddingTop: 0,
|
|
74
|
+
paddingBottom: 0
|
|
75
|
+
};
|
|
76
|
+
}, [
|
|
77
|
+
multiline,
|
|
78
|
+
ms
|
|
79
|
+
]);
|
|
64
80
|
const styles = useMemo(()=>StyleSheet.create({
|
|
65
81
|
container: {
|
|
66
82
|
width,
|
|
67
83
|
height,
|
|
84
|
+
paddingTop: containerPadding.paddingTop,
|
|
85
|
+
paddingBottom: containerPadding.paddingBottom,
|
|
68
86
|
borderRadius,
|
|
69
87
|
borderColor,
|
|
70
88
|
backgroundColor,
|
|
@@ -95,7 +113,9 @@ const useStyles = (props)=>{
|
|
|
95
113
|
fontSize,
|
|
96
114
|
inputTextColor,
|
|
97
115
|
textAlign,
|
|
98
|
-
backgroundColor
|
|
116
|
+
backgroundColor,
|
|
117
|
+
containerPadding,
|
|
118
|
+
ms
|
|
99
119
|
]);
|
|
100
120
|
return styles;
|
|
101
121
|
};
|