@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.
@@ -166,5 +166,5 @@ const text_Text = /*#__PURE__*/ forwardRef((props, ref)=>{
166
166
  ...restProps
167
167
  });
168
168
  });
169
- text_Text.displayName = 'UXText';
169
+ text_Text.displayName = 'Text';
170
170
  export { text_Text as Text };
@@ -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 | undefined;
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 || 'underlined' === variant) return;
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
- ms,
37
- tabsConfig.fontSize
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(()=>ms(inputConfig.size[size]), [
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
  };
@@ -85,5 +85,5 @@ const Box = /*#__PURE__*/ forwardRef((props, ref)=>{
85
85
  ...restProps
86
86
  });
87
87
  });
88
- Box.displayName = 'UXBox';
88
+ Box.displayName = 'Box';
89
89
  export { Box };
@@ -6,5 +6,5 @@ const Center = /*#__PURE__*/ forwardRef((props, ref)=>/*#__PURE__*/ jsx(Flex, {
6
6
  center: true,
7
7
  ...props
8
8
  }));
9
- Center.displayName = 'UXCenter';
9
+ Center.displayName = 'Center';
10
10
  export { Center };
@@ -10,5 +10,5 @@ const Circle = /*#__PURE__*/ forwardRef((props, ref)=>{
10
10
  ...restProps
11
11
  });
12
12
  });
13
- Circle.displayName = 'UXCircle';
13
+ Circle.displayName = 'Circle';
14
14
  export { Circle };
@@ -29,5 +29,5 @@ const Flex = /*#__PURE__*/ forwardRef((props, ref)=>{
29
29
  ...restProps
30
30
  });
31
31
  });
32
- Flex.displayName = 'UXFlex';
32
+ Flex.displayName = 'Flex';
33
33
  export { Flex };
@@ -7,5 +7,5 @@ const HStack = /*#__PURE__*/ forwardRef((props, ref)=>/*#__PURE__*/ jsx(Flex, {
7
7
  items: "center",
8
8
  ...props
9
9
  }));
10
- HStack.displayName = 'UXHStack';
10
+ HStack.displayName = 'HStack';
11
11
  export { HStack };
@@ -10,5 +10,5 @@ const Square = /*#__PURE__*/ forwardRef((props, ref)=>{
10
10
  ...restProps
11
11
  });
12
12
  });
13
- Square.displayName = 'UXSquare';
13
+ Square.displayName = 'Square';
14
14
  export { Square };
@@ -10,5 +10,5 @@ const VStack = /*#__PURE__*/ forwardRef((props, ref)=>{
10
10
  ...restProps
11
11
  });
12
12
  });
13
- VStack.displayName = 'UXVStack';
13
+ VStack.displayName = 'VStack';
14
14
  export { VStack };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@particle-network/ui-native",
3
- "version": "0.0.15",
3
+ "version": "0.0.17",
4
4
  "license": "MIT",
5
5
  "main": "./entry.js",
6
6
  "react-native": "./dist/index.js",