@nexara/nativeflow 0.1.4 → 0.1.7
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/README.md +2 -36
- package/lib/commonjs/components/Button/Button.js +6 -4
- package/lib/commonjs/components/Button/Button.js.map +1 -1
- package/lib/commonjs/components/CheckBox/CheckBox.js +2 -1
- package/lib/commonjs/components/CheckBox/CheckBox.js.map +1 -1
- package/lib/commonjs/components/Dialog/Dialog.js +1 -0
- package/lib/commonjs/components/Dialog/Dialog.js.map +1 -1
- package/lib/commonjs/components/Dialog/DialogFoot.js +5 -2
- package/lib/commonjs/components/Dialog/DialogFoot.js.map +1 -1
- package/lib/commonjs/components/Dialog/DialogHead.js +5 -3
- package/lib/commonjs/components/Dialog/DialogHead.js.map +1 -1
- package/lib/commonjs/components/Icon/Icon.js +2 -2
- package/lib/commonjs/components/Icon/Icon.js.map +1 -1
- package/lib/commonjs/components/IconButton/IconButton.js +22 -20
- package/lib/commonjs/components/IconButton/IconButton.js.map +1 -1
- package/lib/commonjs/components/Menu/Menu.js +2 -1
- package/lib/commonjs/components/Menu/Menu.js.map +1 -1
- package/lib/commonjs/components/Provider/ContextManager.js +16 -0
- package/lib/commonjs/components/Provider/ContextManager.js.map +1 -0
- package/lib/commonjs/components/Provider/NativeProvider.js +17 -7
- package/lib/commonjs/components/Provider/NativeProvider.js.map +1 -1
- package/lib/commonjs/components/StyledComponents/StyledView.js +5 -7
- package/lib/commonjs/components/StyledComponents/StyledView.js.map +1 -1
- package/lib/commonjs/components/UserInput/UserInput.js +8 -6
- package/lib/commonjs/components/UserInput/UserInput.js.map +1 -1
- package/lib/commonjs/helpers/ResponsiveCalculations.js +34 -34
- package/lib/commonjs/helpers/ResponsiveCalculations.js.map +1 -1
- package/lib/commonjs/hooks/index.js +3 -3
- package/lib/commonjs/hooks/index.js.map +1 -1
- package/lib/commonjs/hooks/{useResponsive.js → useScalingMode.js} +3 -3
- package/lib/commonjs/hooks/useScalingMode.js.map +1 -0
- package/lib/commonjs/index.d.js +2 -0
- package/lib/commonjs/index.d.js.map +1 -0
- package/lib/commonjs/index.js +8 -2
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/utils/index.js +2 -0
- package/lib/commonjs/utils/index.js.map +1 -0
- package/lib/module/components/Button/Button.js +4 -3
- package/lib/module/components/Button/Button.js.map +1 -1
- package/lib/module/components/CheckBox/CheckBox.js +3 -2
- package/lib/module/components/CheckBox/CheckBox.js.map +1 -1
- package/lib/module/components/Dialog/Dialog.js +1 -0
- package/lib/module/components/Dialog/Dialog.js.map +1 -1
- package/lib/module/components/Dialog/DialogFoot.js +3 -2
- package/lib/module/components/Dialog/DialogFoot.js.map +1 -1
- package/lib/module/components/Dialog/DialogHead.js +3 -2
- package/lib/module/components/Dialog/DialogHead.js.map +1 -1
- package/lib/module/components/Icon/Icon.js +2 -2
- package/lib/module/components/Icon/Icon.js.map +1 -1
- package/lib/module/components/IconButton/IconButton.js +20 -19
- package/lib/module/components/IconButton/IconButton.js.map +1 -1
- package/lib/module/components/Menu/Menu.js +3 -2
- package/lib/module/components/Menu/Menu.js.map +1 -1
- package/lib/module/components/Provider/ContextManager.js +10 -0
- package/lib/module/components/Provider/ContextManager.js.map +1 -0
- package/lib/module/components/Provider/NativeProvider.js +17 -7
- package/lib/module/components/Provider/NativeProvider.js.map +1 -1
- package/lib/module/components/StyledComponents/StyledView.js +5 -6
- package/lib/module/components/StyledComponents/StyledView.js.map +1 -1
- package/lib/module/components/UserInput/UserInput.js +9 -7
- package/lib/module/components/UserInput/UserInput.js.map +1 -1
- package/lib/module/helpers/ResponsiveCalculations.js +33 -32
- package/lib/module/helpers/ResponsiveCalculations.js.map +1 -1
- package/lib/module/hooks/index.js +1 -1
- package/lib/module/hooks/index.js.map +1 -1
- package/lib/module/hooks/useScalingMode.js +7 -0
- package/lib/module/hooks/useScalingMode.js.map +1 -0
- package/lib/module/index.d.js +2 -0
- package/lib/module/index.d.js.map +1 -0
- package/lib/module/index.js +2 -2
- package/lib/module/index.js.map +1 -1
- package/lib/module/utils/index.js +2 -0
- package/lib/module/utils/index.js.map +1 -0
- package/lib/typescript/commonjs/scripts/generateConfig.d.ts +1 -0
- package/lib/typescript/commonjs/scripts/generateConfig.d.ts.map +1 -0
- package/lib/typescript/commonjs/scripts/readConfig.d.ts +1 -0
- package/lib/typescript/commonjs/scripts/readConfig.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/components/Button/Button.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/CheckBox/CheckBox.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/Dialog/Dialog.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/Dialog/DialogFoot.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/Dialog/DialogHead.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/IconButton/IconButton.d.ts +4 -2
- package/lib/typescript/commonjs/src/components/IconButton/IconButton.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/Menu/Menu.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/Provider/ContextManager.d.ts +3 -0
- package/lib/typescript/commonjs/src/components/Provider/ContextManager.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/components/Provider/NativeProvider.d.ts +9 -4
- package/lib/typescript/commonjs/src/components/Provider/NativeProvider.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/StyledComponents/StyledView.d.ts +2 -2
- package/lib/typescript/commonjs/src/components/StyledComponents/StyledView.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/components/UserInput/UserInput.d.ts +2 -1
- package/lib/typescript/commonjs/src/components/UserInput/UserInput.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/helpers/ResponsiveCalculations.d.ts +0 -1
- package/lib/typescript/commonjs/src/helpers/ResponsiveCalculations.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/hooks/index.d.ts +1 -1
- package/lib/typescript/commonjs/src/hooks/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/hooks/useScalingMode.d.ts +5 -0
- package/lib/typescript/commonjs/src/hooks/useScalingMode.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/index.d.ts +2 -2
- package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/types/common.type.d.ts +1 -0
- package/lib/typescript/commonjs/src/types/common.type.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/types/menu.type.d.ts +2 -1
- package/lib/typescript/commonjs/src/types/menu.type.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/types/styledComponents.type.d.ts +1 -1
- package/lib/typescript/commonjs/src/types/styledComponents.type.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/types/userInput.type.d.ts +1 -0
- package/lib/typescript/commonjs/src/types/userInput.type.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/utils/index.d.ts +1 -0
- package/lib/typescript/commonjs/src/utils/index.d.ts.map +1 -0
- package/lib/typescript/module/scripts/generateConfig.d.ts +1 -0
- package/lib/typescript/module/scripts/generateConfig.d.ts.map +1 -0
- package/lib/typescript/module/scripts/readConfig.d.ts +1 -0
- package/lib/typescript/module/scripts/readConfig.d.ts.map +1 -0
- package/lib/typescript/module/src/components/Button/Button.d.ts.map +1 -1
- package/lib/typescript/module/src/components/CheckBox/CheckBox.d.ts.map +1 -1
- package/lib/typescript/module/src/components/Dialog/Dialog.d.ts.map +1 -1
- package/lib/typescript/module/src/components/Dialog/DialogFoot.d.ts.map +1 -1
- package/lib/typescript/module/src/components/Dialog/DialogHead.d.ts.map +1 -1
- package/lib/typescript/module/src/components/IconButton/IconButton.d.ts +4 -2
- package/lib/typescript/module/src/components/IconButton/IconButton.d.ts.map +1 -1
- package/lib/typescript/module/src/components/Menu/Menu.d.ts.map +1 -1
- package/lib/typescript/module/src/components/Provider/ContextManager.d.ts +3 -0
- package/lib/typescript/module/src/components/Provider/ContextManager.d.ts.map +1 -0
- package/lib/typescript/module/src/components/Provider/NativeProvider.d.ts +9 -4
- package/lib/typescript/module/src/components/Provider/NativeProvider.d.ts.map +1 -1
- package/lib/typescript/module/src/components/StyledComponents/StyledView.d.ts +2 -2
- package/lib/typescript/module/src/components/StyledComponents/StyledView.d.ts.map +1 -1
- package/lib/typescript/module/src/components/UserInput/UserInput.d.ts +2 -1
- package/lib/typescript/module/src/components/UserInput/UserInput.d.ts.map +1 -1
- package/lib/typescript/module/src/helpers/ResponsiveCalculations.d.ts +0 -1
- package/lib/typescript/module/src/helpers/ResponsiveCalculations.d.ts.map +1 -1
- package/lib/typescript/module/src/hooks/index.d.ts +1 -1
- package/lib/typescript/module/src/hooks/index.d.ts.map +1 -1
- package/lib/typescript/module/src/hooks/useScalingMode.d.ts +5 -0
- package/lib/typescript/module/src/hooks/useScalingMode.d.ts.map +1 -0
- package/lib/typescript/module/src/index.d.ts +2 -2
- package/lib/typescript/module/src/index.d.ts.map +1 -1
- package/lib/typescript/module/src/types/common.type.d.ts +1 -0
- package/lib/typescript/module/src/types/common.type.d.ts.map +1 -1
- package/lib/typescript/module/src/types/menu.type.d.ts +2 -1
- package/lib/typescript/module/src/types/menu.type.d.ts.map +1 -1
- package/lib/typescript/module/src/types/styledComponents.type.d.ts +1 -1
- package/lib/typescript/module/src/types/styledComponents.type.d.ts.map +1 -1
- package/lib/typescript/module/src/types/userInput.type.d.ts +1 -0
- package/lib/typescript/module/src/types/userInput.type.d.ts.map +1 -1
- package/lib/typescript/module/src/utils/index.d.ts +1 -0
- package/lib/typescript/module/src/utils/index.d.ts.map +1 -0
- package/package.json +2 -2
- package/src/components/Button/Button.tsx +6 -3
- package/src/components/CheckBox/CheckBox.tsx +5 -3
- package/src/components/Chip/Chip.tsx +2 -1
- package/src/components/Dialog/Dialog.tsx +1 -0
- package/src/components/Dialog/DialogFoot.tsx +3 -2
- package/src/components/Dialog/DialogHead.tsx +3 -2
- package/src/components/Icon/Icon.tsx +2 -2
- package/src/components/IconButton/IconButton.tsx +26 -17
- package/src/components/Menu/Menu.tsx +3 -2
- package/src/components/Provider/ContextManager.tsx +9 -0
- package/src/components/Provider/NativeProvider.tsx +25 -10
- package/src/components/StyledComponents/StyledView.tsx +5 -6
- package/src/components/UserInput/UserInput.tsx +10 -7
- package/src/helpers/ResponsiveCalculations.ts +37 -32
- package/src/hooks/index.ts +1 -1
- package/src/hooks/{useResponsive.tsx → useScalingMode.tsx} +2 -2
- package/src/index.d.ts +3 -0
- package/src/index.ts +3 -2
- package/src/types/common.type.ts +1 -0
- package/src/types/menu.type.ts +2 -1
- package/src/types/styledComponents.type.ts +5 -5
- package/src/types/userInput.type.ts +1 -0
- package/src/utils/index.ts +0 -0
- package/lib/commonjs/hooks/useResponsive.js.map +0 -1
- package/lib/module/hooks/useResponsive.js +0 -7
- package/lib/module/hooks/useResponsive.js.map +0 -1
- package/lib/typescript/commonjs/src/hooks/useResponsive.d.ts +0 -3
- package/lib/typescript/commonjs/src/hooks/useResponsive.d.ts.map +0 -1
- package/lib/typescript/module/src/hooks/useResponsive.d.ts +0 -3
- package/lib/typescript/module/src/hooks/useResponsive.d.ts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styledComponents.type.d.ts","sourceRoot":"","sources":["../../../../../src/types/styledComponents.type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC5H,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,MAAM,MAAM,eAAe,GAAG,SAAS,GAAG,SAAS,GAAG;IAClD;;OAEG;IACH,CAAC,CAAC,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,OAAO,CAAC,EAAE,SAAS,CAAC,gBAAgB,CAAC,CAAC;IAEtC;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,C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AAS,CAAC,CAAA;CACnC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/utils/index.ts"],"names":[],"mappings":""}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nexara/nativeflow",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.7",
|
|
4
4
|
"description": "Beautiful, responsive, and customizable UI components for React Native – built for performance and seamless experiences.",
|
|
5
5
|
"source": "./src/index.ts",
|
|
6
6
|
"main": "./lib/commonjs/index.js",
|
|
@@ -204,4 +204,4 @@
|
|
|
204
204
|
"type": "library",
|
|
205
205
|
"version": "0.48.3"
|
|
206
206
|
}
|
|
207
|
-
}
|
|
207
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { useMemo } from 'react';
|
|
2
2
|
import type { JSX } from 'react';
|
|
3
3
|
import { StyleSheet, TouchableOpacity, type ViewStyle } from "react-native";
|
|
4
4
|
import { verticalScale, horizontalScale } from "../../helpers/ResponsiveCalculations";
|
|
@@ -44,6 +44,9 @@ const Button: React.FC<ButtonProps> = ({
|
|
|
44
44
|
strokeColor,
|
|
45
45
|
disabled
|
|
46
46
|
});
|
|
47
|
+
|
|
48
|
+
const STYLES = useMemo(Styles, []);
|
|
49
|
+
|
|
47
50
|
const dynamicStyles = {
|
|
48
51
|
BUTTON_CONT: {
|
|
49
52
|
backgroundColor: backgroundColor,
|
|
@@ -72,7 +75,7 @@ const Button: React.FC<ButtonProps> = ({
|
|
|
72
75
|
const cloneElement = (element: JSX.Element): JSX.Element | null => {
|
|
73
76
|
if (React.isValidElement<{ color?: string }>(element)) {
|
|
74
77
|
return React.cloneElement(element, {
|
|
75
|
-
color: buttonIconColor
|
|
78
|
+
color: element.props.color ?? buttonIconColor
|
|
76
79
|
})
|
|
77
80
|
}
|
|
78
81
|
return null;
|
|
@@ -165,7 +168,7 @@ const Button: React.FC<ButtonProps> = ({
|
|
|
165
168
|
export default Button;
|
|
166
169
|
export type { ButtonProps };
|
|
167
170
|
|
|
168
|
-
const
|
|
171
|
+
const Styles = () => StyleSheet.create({
|
|
169
172
|
BUTTON_CONT: {
|
|
170
173
|
maxWidth: '100%',
|
|
171
174
|
},
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useEffect, useRef, useState } from "react";
|
|
1
|
+
import React, { useEffect, useMemo, useRef, useState } from "react";
|
|
2
2
|
import { StyleSheet, TouchableWithoutFeedback, Animated, type ViewStyle } from "react-native";
|
|
3
3
|
import { StyledText, StyledView } from "../StyledComponents";
|
|
4
4
|
import { useTheme } from "../../hooks";
|
|
@@ -32,6 +32,8 @@ const CheckBox: React.FC<CheckBoxProps> = ({
|
|
|
32
32
|
setIsCheckboxChecked(defaultValue);
|
|
33
33
|
}, [defaultValue]);
|
|
34
34
|
|
|
35
|
+
const STYLES = useMemo(Styles, []);
|
|
36
|
+
|
|
35
37
|
const scaleVal = useRef(new Animated.Value(1)).current;
|
|
36
38
|
const { colors }: any = useTheme();
|
|
37
39
|
activeBgColor = disabled ? colors.disable : activeBgColor ?? colors.primary;
|
|
@@ -99,7 +101,7 @@ const CheckBox: React.FC<CheckBoxProps> = ({
|
|
|
99
101
|
export default CheckBox;
|
|
100
102
|
export type { CheckBoxProps };
|
|
101
103
|
|
|
102
|
-
const
|
|
104
|
+
const Styles = () => StyleSheet.create({
|
|
103
105
|
CONTAINER: {
|
|
104
106
|
flexDirection: 'row',
|
|
105
107
|
gap: horizontalScale(10),
|
|
@@ -111,4 +113,4 @@ const STYLES = StyleSheet.create({
|
|
|
111
113
|
justifyContent: 'center',
|
|
112
114
|
padding: verticalScale(7)
|
|
113
115
|
}
|
|
114
|
-
});
|
|
116
|
+
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { useMemo } from 'react';
|
|
2
2
|
import { StyleSheet } from 'react-native';
|
|
3
3
|
import Stack from '../Stack';
|
|
4
4
|
import { moderateScale } from '../../helpers/ResponsiveCalculations';
|
|
@@ -14,6 +14,7 @@ const DialogFoot: React.FC<props> = ({
|
|
|
14
14
|
containerStyle,
|
|
15
15
|
children
|
|
16
16
|
}) => {
|
|
17
|
+
const STYLES = useMemo(Styles, []);
|
|
17
18
|
const dynamicStyles = {
|
|
18
19
|
borderTopWidth: variant === 'default' ? 0.7 : 0,
|
|
19
20
|
padding: moderateScale(variant === 'default' ? 16 : 20),
|
|
@@ -28,7 +29,7 @@ const DialogFoot: React.FC<props> = ({
|
|
|
28
29
|
export default DialogFoot;
|
|
29
30
|
export type { DialogFootProps };
|
|
30
31
|
|
|
31
|
-
const
|
|
32
|
+
const Styles = () => StyleSheet.create({
|
|
32
33
|
CONTAINER: {
|
|
33
34
|
borderColor: '#d4d4d4',
|
|
34
35
|
justifyContent: 'flex-end',
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { useMemo } from 'react';
|
|
2
2
|
import { View, StyleSheet, TouchableOpacity } from 'react-native';
|
|
3
3
|
import { moderateScale } from '../../helpers/ResponsiveCalculations';
|
|
4
4
|
import { X } from '../../assets/svg';
|
|
@@ -19,6 +19,7 @@ const DialogHead: React.FC<props> = ({
|
|
|
19
19
|
textStyle,
|
|
20
20
|
children
|
|
21
21
|
}) => {
|
|
22
|
+
const STYLES = useMemo(Styles, []);
|
|
22
23
|
const dynamicStyles = {
|
|
23
24
|
borderBottomWidth: variant == 'default' ? 0.7 : 0,
|
|
24
25
|
padding: moderateScale(variant === 'default' ? 16 : 25),
|
|
@@ -40,7 +41,7 @@ export default DialogHead;
|
|
|
40
41
|
export type { DialogHeadProps };
|
|
41
42
|
|
|
42
43
|
|
|
43
|
-
const
|
|
44
|
+
const Styles = () => StyleSheet.create({
|
|
44
45
|
CONTAINER: {
|
|
45
46
|
borderColor: '#d4d4d4',
|
|
46
47
|
paddingBottom: moderateScale(16),
|
|
@@ -18,11 +18,11 @@ const Icon: React.FC<IconProps> = ({
|
|
|
18
18
|
return React.cloneElement(renderIcon as React.ReactElement<any>,
|
|
19
19
|
{
|
|
20
20
|
...renderIcon?.props,
|
|
21
|
-
size: verticalScale(renderIcon?.props?.size ??
|
|
21
|
+
size: verticalScale(renderIcon?.props?.size ?? 17),
|
|
22
22
|
color: color ?? (renderIcon?.props.color ?? theme?.colors.iconPrimary)
|
|
23
23
|
}
|
|
24
24
|
)
|
|
25
|
-
}, [color, theme]);
|
|
25
|
+
}, [color, theme, renderIcon.props]);
|
|
26
26
|
|
|
27
27
|
return (<>
|
|
28
28
|
{renderCallBackIcon}
|
|
@@ -1,35 +1,44 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import type {
|
|
1
|
+
import React, { isValidElement } from "react";
|
|
2
|
+
import type { ReactElement } from "react";
|
|
3
3
|
import { TouchableOpacity, type TouchableOpacityProps } from "react-native";
|
|
4
|
-
import { StyledView } from "../StyledComponents";
|
|
5
|
-
// import TouchableRipple from "../TouchableRipple/TouchableRipple";
|
|
6
4
|
import Icon from "../Icon/Icon";
|
|
7
|
-
import { verticalScale } from "../../helpers/ResponsiveCalculations";
|
|
8
5
|
|
|
9
6
|
|
|
10
7
|
type IconButtonProps = TouchableOpacityProps & {
|
|
11
8
|
rippleColor?: string;
|
|
12
|
-
children?:
|
|
9
|
+
children?: ReactElement<{ size: number }>;
|
|
13
10
|
}
|
|
14
11
|
|
|
15
12
|
const IconButton: React.FC<IconButtonProps> = ({
|
|
16
13
|
rippleColor,
|
|
17
14
|
children,
|
|
15
|
+
style,
|
|
18
16
|
...rest
|
|
19
17
|
}) => {
|
|
20
18
|
|
|
19
|
+
let size = 40;
|
|
20
|
+
|
|
21
|
+
if (!(isValidElement(children) && 'size' in children.props)) {
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
size = children.props.size * 1.5;
|
|
25
|
+
|
|
21
26
|
return (<>
|
|
22
|
-
<
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
27
|
+
<TouchableOpacity
|
|
28
|
+
// rippleColor={rippleColor}
|
|
29
|
+
style={[{
|
|
30
|
+
borderRadius: 100,
|
|
31
|
+
height: size,
|
|
32
|
+
width: size,
|
|
33
|
+
justifyContent: 'center',
|
|
34
|
+
alignItems: 'center'
|
|
35
|
+
}, style]}
|
|
36
|
+
{...rest}
|
|
37
|
+
>
|
|
38
|
+
<Icon
|
|
39
|
+
renderIcon={React.cloneElement(children as React.ReactElement<any>)}
|
|
40
|
+
/>
|
|
41
|
+
</TouchableOpacity>
|
|
33
42
|
</>)
|
|
34
43
|
}
|
|
35
44
|
export default IconButton;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useState, useRef, useCallback, useEffect, } from "react";
|
|
1
|
+
import React, { useState, useRef, useCallback, useEffect, useMemo, } from "react";
|
|
2
2
|
import { StyleSheet, Pressable, View, ScrollView, Animated } from "react-native";
|
|
3
3
|
import { StyledView } from "../StyledComponents";
|
|
4
4
|
import Portal from "../Portal/Portal";
|
|
@@ -25,6 +25,7 @@ const Menu: React.FC<MenuProps> = ({
|
|
|
25
25
|
const animatedScaleRef = useRef(new Animated.Value(1)).current;
|
|
26
26
|
|
|
27
27
|
const positions = (useCallback(() => (positionCalculations(anchorLayoutRef.current, menuLayoutRef.current, placement)), [menuLayoutRef, anchorLayoutRef, placement]))();
|
|
28
|
+
const STYLES = useMemo(Styles, []);
|
|
28
29
|
|
|
29
30
|
useEffect(() => {
|
|
30
31
|
Animated.timing(animatedScaleRef, {
|
|
@@ -119,7 +120,7 @@ const Menu: React.FC<MenuProps> = ({
|
|
|
119
120
|
export default Menu;
|
|
120
121
|
export type { MenuProps };
|
|
121
122
|
|
|
122
|
-
const
|
|
123
|
+
const Styles = () => StyleSheet.create({
|
|
123
124
|
MENU_CONT: {
|
|
124
125
|
shadowColor: "#000",
|
|
125
126
|
backgroundColor: '#fff',
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import React, { createContext, useMemo, useState } from 'react';
|
|
2
2
|
import type { ReactNode } from "react";
|
|
3
3
|
import { LightTheme, DarkTheme } from '../../themes';
|
|
4
|
-
import type { Theme, themeModeTypes, ThemeTypes } from '../../types';
|
|
4
|
+
import type { scalingModeTypes, Theme, themeModeTypes, ThemeTypes } from '../../types';
|
|
5
|
+
import { setGlobalContext } from './ContextManager';
|
|
5
6
|
|
|
6
7
|
type ProviderProps = {
|
|
7
8
|
/**
|
|
@@ -14,40 +15,54 @@ type ProviderProps = {
|
|
|
14
15
|
* Determines whether the theme should be responsive based on screen size.
|
|
15
16
|
* Default: `true`
|
|
16
17
|
*/
|
|
17
|
-
isResponsive?: boolean;
|
|
18
|
+
// isResponsive?: boolean;
|
|
18
19
|
|
|
19
20
|
/**
|
|
20
21
|
* Custom theme object that overrides the default light/dark themes.
|
|
21
22
|
* If not provided, the default themes (LightTheme/DarkTheme) will be used.
|
|
22
23
|
*/
|
|
23
24
|
theme?: Theme;
|
|
25
|
+
|
|
26
|
+
options?: {
|
|
27
|
+
defaultTheme?: themeModeTypes;
|
|
28
|
+
scalingMode?: scalingModeTypes;
|
|
29
|
+
}
|
|
24
30
|
};
|
|
25
31
|
|
|
26
32
|
type ThemeContextType = {
|
|
27
|
-
isResponsive?: boolean;
|
|
28
33
|
theme?: ThemeTypes & {
|
|
29
34
|
toggleThemeMode: () => void;
|
|
30
35
|
};
|
|
31
36
|
mode?: themeModeTypes;
|
|
37
|
+
scaling: { mode: scalingModeTypes }
|
|
32
38
|
};
|
|
33
39
|
|
|
34
40
|
|
|
35
|
-
export const Context = createContext<ThemeContextType
|
|
36
|
-
isResponsive: true,
|
|
41
|
+
export const Context = createContext<ThemeContextType>({
|
|
37
42
|
mode: 'light',
|
|
38
|
-
theme: { ...LightTheme, toggleThemeMode: () => { } }
|
|
43
|
+
theme: { ...LightTheme, toggleThemeMode: () => { } },
|
|
44
|
+
scaling: { mode: 'partial' }
|
|
39
45
|
});
|
|
40
46
|
|
|
41
47
|
const NativeProvider: React.FC<ProviderProps> = ({
|
|
42
48
|
children,
|
|
43
|
-
isResponsive = true,
|
|
44
49
|
theme,
|
|
50
|
+
options
|
|
45
51
|
}) => {
|
|
46
|
-
const [mode, setMode] = useState<themeModeTypes>('light');
|
|
47
|
-
|
|
52
|
+
const [mode, setMode] = useState<themeModeTypes>(options?.defaultTheme ?? 'light');
|
|
48
53
|
const toggleThemeMode = () => setMode((prev) => prev === 'dark' ? 'light' : 'dark');
|
|
49
54
|
const setTheme = { ...((theme && theme[mode]) || (mode === 'light' ? LightTheme : DarkTheme)), toggleThemeMode };
|
|
50
|
-
const value = useMemo(() => ({
|
|
55
|
+
const value = useMemo(() => ({
|
|
56
|
+
theme: setTheme,
|
|
57
|
+
mode,
|
|
58
|
+
scaling: { mode: options?.scalingMode ?? 'partial' }
|
|
59
|
+
}), [theme, mode, options]);
|
|
60
|
+
|
|
61
|
+
// useLayoutEffect(() => {
|
|
62
|
+
// setGlobalContext(value);
|
|
63
|
+
// }, [value]);
|
|
64
|
+
setGlobalContext(value);
|
|
65
|
+
|
|
51
66
|
return (<>
|
|
52
67
|
<Context.Provider value={value}>
|
|
53
68
|
{children}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { forwardRef } from 'react';
|
|
2
2
|
import { View } from 'react-native';
|
|
3
3
|
import { useTheme } from '../../hooks';
|
|
4
4
|
import type { StyledViewProps } from '../../types';
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
const StyledView
|
|
7
|
+
const StyledView = forwardRef<View, StyledViewProps>(({
|
|
8
8
|
f,
|
|
9
9
|
justify,
|
|
10
10
|
align,
|
|
@@ -15,9 +15,8 @@ const StyledView: React.FC<StyledViewProps> = ({
|
|
|
15
15
|
w,
|
|
16
16
|
children,
|
|
17
17
|
style,
|
|
18
|
-
ref,
|
|
19
18
|
...rest
|
|
20
|
-
}) => {
|
|
19
|
+
}, ref) => {
|
|
21
20
|
|
|
22
21
|
const theme = useTheme(themeBg);
|
|
23
22
|
|
|
@@ -34,13 +33,13 @@ const StyledView: React.FC<StyledViewProps> = ({
|
|
|
34
33
|
},
|
|
35
34
|
style
|
|
36
35
|
]}
|
|
37
|
-
ref={ref}
|
|
38
36
|
{...rest}
|
|
37
|
+
ref={ref}
|
|
39
38
|
>
|
|
40
39
|
{children}
|
|
41
40
|
</View>
|
|
42
41
|
);
|
|
43
|
-
};
|
|
42
|
+
});
|
|
44
43
|
|
|
45
44
|
export default StyledView;
|
|
46
45
|
export type { StyledViewProps };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useMemo } from 'react';
|
|
1
|
+
import { forwardRef, useMemo } from 'react';
|
|
2
2
|
import { TextInput, StyleSheet, type ViewStyle } from 'react-native';
|
|
3
3
|
import type { TextStyle } from 'react-native';
|
|
4
4
|
import { responsiveFontSize, verticalScale, horizontalScale } from '../../helpers/ResponsiveCalculations';
|
|
@@ -7,7 +7,7 @@ import { StyledText, StyledView } from '../StyledComponents';
|
|
|
7
7
|
import type { UserInputProps } from '../../types';
|
|
8
8
|
import generateColors from './generateColors';
|
|
9
9
|
|
|
10
|
-
const UserInput
|
|
10
|
+
const UserInput = forwardRef<TextInput, UserInputProps>(({
|
|
11
11
|
variant = 'standard',
|
|
12
12
|
label,
|
|
13
13
|
bg,
|
|
@@ -16,6 +16,7 @@ const UserInput: React.FC<UserInputProps> = ({
|
|
|
16
16
|
labelColor,
|
|
17
17
|
textVariant = {
|
|
18
18
|
label: 'h5',
|
|
19
|
+
inputText: 'h5',
|
|
19
20
|
helperText: 'h6',
|
|
20
21
|
},
|
|
21
22
|
inputTextColor,
|
|
@@ -33,12 +34,13 @@ const UserInput: React.FC<UserInputProps> = ({
|
|
|
33
34
|
renderLeftIcon,
|
|
34
35
|
renderRightIcon,
|
|
35
36
|
styles,
|
|
36
|
-
ref,
|
|
37
37
|
...rest
|
|
38
|
-
}) => {
|
|
38
|
+
}, ref) => {
|
|
39
39
|
|
|
40
40
|
const theme: any = useTheme();
|
|
41
41
|
|
|
42
|
+
const STYLES = useMemo(Styles, []);
|
|
43
|
+
|
|
42
44
|
const {
|
|
43
45
|
computedCursorColor,
|
|
44
46
|
computedPlaceholderColor,
|
|
@@ -58,7 +60,8 @@ const UserInput: React.FC<UserInputProps> = ({
|
|
|
58
60
|
},
|
|
59
61
|
INPUT: {
|
|
60
62
|
color: disabled ? theme.colors.textDisable : isError ? theme.colors.error : inputTextColor ?? theme.colors.textPrimary,
|
|
61
|
-
|
|
63
|
+
//@ts-ignore
|
|
64
|
+
fontSize: responsiveFontSize(theme.typography.variantSizes[textVariant.inputText] ?? inputFs),
|
|
62
65
|
textAlignVertical: (multiline ? 'top' : 'center') as TextStyle['textAlignVertical'],
|
|
63
66
|
minHeight: multiline ? 100 : undefined,
|
|
64
67
|
maxHeight: multiline ? 150 : undefined,
|
|
@@ -110,11 +113,11 @@ const UserInput: React.FC<UserInputProps> = ({
|
|
|
110
113
|
}
|
|
111
114
|
</StyledView>
|
|
112
115
|
</>)
|
|
113
|
-
};
|
|
116
|
+
});
|
|
114
117
|
export default UserInput;
|
|
115
118
|
export type { UserInputProps };
|
|
116
119
|
|
|
117
|
-
const
|
|
120
|
+
const Styles = () => StyleSheet.create({
|
|
118
121
|
INPUT_CONT: {
|
|
119
122
|
flexDirection: 'row',
|
|
120
123
|
paddingHorizontal: horizontalScale(14),
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Dimensions, PixelRatio } from 'react-native';
|
|
2
|
-
|
|
2
|
+
import { getGlobalContext } from '../components/Provider/ContextManager';
|
|
3
|
+
import type { scalingModeTypes } from '../types';
|
|
3
4
|
|
|
4
5
|
|
|
5
6
|
const {
|
|
@@ -7,58 +8,62 @@ const {
|
|
|
7
8
|
height: SCREEN_HEIGHT,
|
|
8
9
|
} = Dimensions.get('window');
|
|
9
10
|
|
|
10
|
-
// const
|
|
11
|
+
// const GetScalingMode = () => getGlobalContext();
|
|
12
|
+
// const scalingMode = useScalingMode();
|
|
13
|
+
|
|
11
14
|
const isResponsive = true;
|
|
12
15
|
const guidelineBaseWidth = 350;
|
|
13
16
|
const guidelineBaseHeight = 680;
|
|
14
17
|
const [shortDimension, longDimension] = SCREEN_WIDTH < SCREEN_HEIGHT ? [SCREEN_WIDTH, SCREEN_HEIGHT] : [SCREEN_HEIGHT, SCREEN_WIDTH];
|
|
15
18
|
|
|
16
|
-
|
|
19
|
+
type scalingCacheKey = 'hScale' | 'vScale' | 'fs';
|
|
20
|
+
|
|
21
|
+
const scalingCache = new Map<scalingCacheKey, object>();
|
|
22
|
+
|
|
23
|
+
// export const fun = () => {
|
|
24
|
+
// return scalingCache
|
|
25
|
+
// }
|
|
17
26
|
|
|
18
|
-
export const fun = () => {
|
|
19
|
-
return scalingCache
|
|
20
|
-
}
|
|
21
27
|
const checkIsPhone = (size: number): number => {
|
|
22
28
|
if (SCREEN_WIDTH <= 430 && SCREEN_WIDTH >= 375) {
|
|
23
29
|
return size;
|
|
24
30
|
}
|
|
25
31
|
return 0;
|
|
26
32
|
}
|
|
27
|
-
|
|
33
|
+
|
|
34
|
+
const scale = (size: number, cacheKey: scalingCacheKey, mode: scalingModeTypes) => {
|
|
28
35
|
if (checkIsPhone(size)) {
|
|
29
36
|
return size;
|
|
30
37
|
}
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
|
|
38
|
+
const cacheScaleValue: any = scalingCache.get(cacheKey) || {};
|
|
39
|
+
let finalSize;
|
|
40
|
+
if (cacheScaleValue?.[size]) {
|
|
41
|
+
return cacheScaleValue?.[size];
|
|
34
42
|
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
43
|
+
if (mode === 'partial') {
|
|
44
|
+
const slowDownRate = SCREEN_WIDTH < 375 ? 2 : 0.40;
|
|
45
|
+
let scale = ((cacheKey === 'hScale' ? shortDimension : longDimension) / guidelineBaseHeight);
|
|
46
|
+
scale = 1 + (scale - 1) * slowDownRate;
|
|
47
|
+
let adjustedSize = size * Math.max(scale, 0.80);
|
|
48
|
+
finalSize = Math.floor(PixelRatio.roundToNearestPixel(adjustedSize));
|
|
49
|
+
} else {
|
|
50
|
+
const baseScaleFactor = (cacheKey === 'hScale' ? (shortDimension / guidelineBaseWidth) : (longDimension / guidelineBaseHeight));
|
|
51
|
+
const clampedScaleFactor = Math.max(0.9, Math.min(baseScaleFactor, 1.2));
|
|
52
|
+
finalSize = Math.round(PixelRatio.roundToNearestPixel(size * clampedScaleFactor))
|
|
53
|
+
}
|
|
54
|
+
cacheScaleValue[size] = finalSize;
|
|
55
|
+
scalingCache.set(cacheKey, cacheScaleValue);
|
|
42
56
|
return finalSize;
|
|
43
57
|
}
|
|
44
58
|
|
|
59
|
+
export const horizontalScale = (size: number): number => {
|
|
60
|
+
const scalingMode = getGlobalContext().scaling.mode
|
|
61
|
+
return scale(size, 'hScale', scalingMode);
|
|
62
|
+
}
|
|
45
63
|
|
|
46
64
|
export const verticalScale = (size: number): number => {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
}
|
|
50
|
-
const vScaleCache: any = scalingCache.get('vScale') || {};
|
|
51
|
-
if (vScaleCache?.[size]) {
|
|
52
|
-
return vScaleCache?.[size];
|
|
53
|
-
}
|
|
54
|
-
const slowDownRate = SCREEN_WIDTH < 375 ? 2 : 0.40;
|
|
55
|
-
let scale = (longDimension / guidelineBaseHeight);
|
|
56
|
-
scale = 1 + (scale - 1) * slowDownRate;
|
|
57
|
-
let adjustedSize = size * Math.max(scale, 0.80);
|
|
58
|
-
const finalSize = Math.floor(PixelRatio.roundToNearestPixel(adjustedSize));
|
|
59
|
-
vScaleCache[size] = finalSize;
|
|
60
|
-
scalingCache.set('vScale', vScaleCache)
|
|
61
|
-
return finalSize;
|
|
65
|
+
const scalingMode = getGlobalContext().scaling.mode
|
|
66
|
+
return scale(size, 'vScale', scalingMode);
|
|
62
67
|
}
|
|
63
68
|
|
|
64
69
|
|
package/src/hooks/index.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { default as useTheme } from './useTheme';
|
|
2
|
-
export { default as
|
|
2
|
+
export { default as useScalingMode } from './useScalingMode';
|
|
3
3
|
export { default as useColorScheme } from './useColorScheme';
|
|
4
4
|
export { default as useConditionalWindowDimension } from './useConditionalWindowDimension';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useContext } from 'react';
|
|
2
2
|
import { Context } from '../components/Provider/NativeProvider';
|
|
3
3
|
|
|
4
|
-
const
|
|
4
|
+
const useScalingMode = () => useContext(Context)?.scaling;
|
|
5
5
|
|
|
6
|
-
export default
|
|
6
|
+
export default useScalingMode;
|
package/src/index.d.ts
ADDED
package/src/index.ts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
|
+
export { default as NativeProvider } from './components/Provider/NativeProvider';
|
|
2
|
+
export { horizontalScale, moderateScale, moderateVerticalScale, verticalScale, responsiveFontSize } from './helpers/ResponsiveCalculations';
|
|
1
3
|
export { default as Header } from './components/Header/Header';
|
|
2
4
|
export { default as Chip } from './components/Chip/Chip';
|
|
3
5
|
export { default as Button } from './components/Button/Button';
|
|
6
|
+
|
|
4
7
|
export { default as Stack } from './components/Stack';
|
|
5
8
|
export { StyledText, StyledView } from './components/StyledComponents';
|
|
6
9
|
export { default as UserInput } from './components/UserInput/UserInput';
|
|
7
|
-
export { default as NativeProvider } from './components/Provider/NativeProvider';
|
|
8
|
-
export { horizontalScale, moderateScale, moderateVerticalScale, verticalScale } from './helpers/ResponsiveCalculations';
|
|
9
10
|
export { default as Grid } from './components/Grid/Grid';
|
|
10
11
|
export { default as Progress } from './components/Progress/Progress';
|
|
11
12
|
export { default as Slider } from './components/Slider/Slider';
|
package/src/types/common.type.ts
CHANGED
|
@@ -5,6 +5,7 @@ export type DialogVariant = 'classic' | 'default';
|
|
|
5
5
|
export type ButtonVariant = 'outlined' | 'contained';
|
|
6
6
|
export type TypographyVariant = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'h7';
|
|
7
7
|
export type themeModeTypes = 'light' | 'dark';
|
|
8
|
+
export type scalingModeTypes = 'full' | 'partial';
|
|
8
9
|
|
|
9
10
|
export type dialogSizesTypes = {
|
|
10
11
|
xs: number,
|
package/src/types/menu.type.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { JSX, ReactNode } from "react";
|
|
2
2
|
import type { StyleProp, TextStyle, TouchableOpacityProps, View, ViewStyle } from "react-native";
|
|
3
3
|
import type { TypographyVariant } from "./common.type";
|
|
4
|
+
import type { StyledTextProps } from "./styledComponents.type";
|
|
4
5
|
|
|
5
6
|
|
|
6
7
|
export type MenuProps = {
|
|
@@ -93,7 +94,7 @@ export type MenuItemProps = TouchableOpacityProps & {
|
|
|
93
94
|
children?: ReactNode;
|
|
94
95
|
};
|
|
95
96
|
|
|
96
|
-
export type MenuItemLabelProps =
|
|
97
|
+
export type MenuItemLabelProps = StyledTextProps & {
|
|
97
98
|
/**
|
|
98
99
|
* Font size of the label text.
|
|
99
100
|
*/
|
|
@@ -53,14 +53,14 @@ export type StyledViewProps = ViewStyle & ViewProps & {
|
|
|
53
53
|
*/
|
|
54
54
|
style?: StyleProp<ViewStyle>;
|
|
55
55
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
56
|
+
/**
|
|
57
|
+
* A ref to access the underlying View component.
|
|
58
|
+
* This can be used for measuring layout, animations, or imperative interactions.
|
|
59
|
+
*/
|
|
60
60
|
ref?: React.RefObject<View>
|
|
61
61
|
};
|
|
62
62
|
|
|
63
|
-
export type StyledTextProps = TextProps & {
|
|
63
|
+
export type StyledTextProps = TextProps & TextStyle & {
|
|
64
64
|
/**
|
|
65
65
|
* Defines the typography variant for the text.
|
|
66
66
|
*/
|