@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.
Files changed (180) hide show
  1. package/README.md +2 -36
  2. package/lib/commonjs/components/Button/Button.js +6 -4
  3. package/lib/commonjs/components/Button/Button.js.map +1 -1
  4. package/lib/commonjs/components/CheckBox/CheckBox.js +2 -1
  5. package/lib/commonjs/components/CheckBox/CheckBox.js.map +1 -1
  6. package/lib/commonjs/components/Dialog/Dialog.js +1 -0
  7. package/lib/commonjs/components/Dialog/Dialog.js.map +1 -1
  8. package/lib/commonjs/components/Dialog/DialogFoot.js +5 -2
  9. package/lib/commonjs/components/Dialog/DialogFoot.js.map +1 -1
  10. package/lib/commonjs/components/Dialog/DialogHead.js +5 -3
  11. package/lib/commonjs/components/Dialog/DialogHead.js.map +1 -1
  12. package/lib/commonjs/components/Icon/Icon.js +2 -2
  13. package/lib/commonjs/components/Icon/Icon.js.map +1 -1
  14. package/lib/commonjs/components/IconButton/IconButton.js +22 -20
  15. package/lib/commonjs/components/IconButton/IconButton.js.map +1 -1
  16. package/lib/commonjs/components/Menu/Menu.js +2 -1
  17. package/lib/commonjs/components/Menu/Menu.js.map +1 -1
  18. package/lib/commonjs/components/Provider/ContextManager.js +16 -0
  19. package/lib/commonjs/components/Provider/ContextManager.js.map +1 -0
  20. package/lib/commonjs/components/Provider/NativeProvider.js +17 -7
  21. package/lib/commonjs/components/Provider/NativeProvider.js.map +1 -1
  22. package/lib/commonjs/components/StyledComponents/StyledView.js +5 -7
  23. package/lib/commonjs/components/StyledComponents/StyledView.js.map +1 -1
  24. package/lib/commonjs/components/UserInput/UserInput.js +8 -6
  25. package/lib/commonjs/components/UserInput/UserInput.js.map +1 -1
  26. package/lib/commonjs/helpers/ResponsiveCalculations.js +34 -34
  27. package/lib/commonjs/helpers/ResponsiveCalculations.js.map +1 -1
  28. package/lib/commonjs/hooks/index.js +3 -3
  29. package/lib/commonjs/hooks/index.js.map +1 -1
  30. package/lib/commonjs/hooks/{useResponsive.js → useScalingMode.js} +3 -3
  31. package/lib/commonjs/hooks/useScalingMode.js.map +1 -0
  32. package/lib/commonjs/index.d.js +2 -0
  33. package/lib/commonjs/index.d.js.map +1 -0
  34. package/lib/commonjs/index.js +8 -2
  35. package/lib/commonjs/index.js.map +1 -1
  36. package/lib/commonjs/utils/index.js +2 -0
  37. package/lib/commonjs/utils/index.js.map +1 -0
  38. package/lib/module/components/Button/Button.js +4 -3
  39. package/lib/module/components/Button/Button.js.map +1 -1
  40. package/lib/module/components/CheckBox/CheckBox.js +3 -2
  41. package/lib/module/components/CheckBox/CheckBox.js.map +1 -1
  42. package/lib/module/components/Dialog/Dialog.js +1 -0
  43. package/lib/module/components/Dialog/Dialog.js.map +1 -1
  44. package/lib/module/components/Dialog/DialogFoot.js +3 -2
  45. package/lib/module/components/Dialog/DialogFoot.js.map +1 -1
  46. package/lib/module/components/Dialog/DialogHead.js +3 -2
  47. package/lib/module/components/Dialog/DialogHead.js.map +1 -1
  48. package/lib/module/components/Icon/Icon.js +2 -2
  49. package/lib/module/components/Icon/Icon.js.map +1 -1
  50. package/lib/module/components/IconButton/IconButton.js +20 -19
  51. package/lib/module/components/IconButton/IconButton.js.map +1 -1
  52. package/lib/module/components/Menu/Menu.js +3 -2
  53. package/lib/module/components/Menu/Menu.js.map +1 -1
  54. package/lib/module/components/Provider/ContextManager.js +10 -0
  55. package/lib/module/components/Provider/ContextManager.js.map +1 -0
  56. package/lib/module/components/Provider/NativeProvider.js +17 -7
  57. package/lib/module/components/Provider/NativeProvider.js.map +1 -1
  58. package/lib/module/components/StyledComponents/StyledView.js +5 -6
  59. package/lib/module/components/StyledComponents/StyledView.js.map +1 -1
  60. package/lib/module/components/UserInput/UserInput.js +9 -7
  61. package/lib/module/components/UserInput/UserInput.js.map +1 -1
  62. package/lib/module/helpers/ResponsiveCalculations.js +33 -32
  63. package/lib/module/helpers/ResponsiveCalculations.js.map +1 -1
  64. package/lib/module/hooks/index.js +1 -1
  65. package/lib/module/hooks/index.js.map +1 -1
  66. package/lib/module/hooks/useScalingMode.js +7 -0
  67. package/lib/module/hooks/useScalingMode.js.map +1 -0
  68. package/lib/module/index.d.js +2 -0
  69. package/lib/module/index.d.js.map +1 -0
  70. package/lib/module/index.js +2 -2
  71. package/lib/module/index.js.map +1 -1
  72. package/lib/module/utils/index.js +2 -0
  73. package/lib/module/utils/index.js.map +1 -0
  74. package/lib/typescript/commonjs/scripts/generateConfig.d.ts +1 -0
  75. package/lib/typescript/commonjs/scripts/generateConfig.d.ts.map +1 -0
  76. package/lib/typescript/commonjs/scripts/readConfig.d.ts +1 -0
  77. package/lib/typescript/commonjs/scripts/readConfig.d.ts.map +1 -0
  78. package/lib/typescript/commonjs/src/components/Button/Button.d.ts.map +1 -1
  79. package/lib/typescript/commonjs/src/components/CheckBox/CheckBox.d.ts.map +1 -1
  80. package/lib/typescript/commonjs/src/components/Dialog/Dialog.d.ts.map +1 -1
  81. package/lib/typescript/commonjs/src/components/Dialog/DialogFoot.d.ts.map +1 -1
  82. package/lib/typescript/commonjs/src/components/Dialog/DialogHead.d.ts.map +1 -1
  83. package/lib/typescript/commonjs/src/components/IconButton/IconButton.d.ts +4 -2
  84. package/lib/typescript/commonjs/src/components/IconButton/IconButton.d.ts.map +1 -1
  85. package/lib/typescript/commonjs/src/components/Menu/Menu.d.ts.map +1 -1
  86. package/lib/typescript/commonjs/src/components/Provider/ContextManager.d.ts +3 -0
  87. package/lib/typescript/commonjs/src/components/Provider/ContextManager.d.ts.map +1 -0
  88. package/lib/typescript/commonjs/src/components/Provider/NativeProvider.d.ts +9 -4
  89. package/lib/typescript/commonjs/src/components/Provider/NativeProvider.d.ts.map +1 -1
  90. package/lib/typescript/commonjs/src/components/StyledComponents/StyledView.d.ts +2 -2
  91. package/lib/typescript/commonjs/src/components/StyledComponents/StyledView.d.ts.map +1 -1
  92. package/lib/typescript/commonjs/src/components/UserInput/UserInput.d.ts +2 -1
  93. package/lib/typescript/commonjs/src/components/UserInput/UserInput.d.ts.map +1 -1
  94. package/lib/typescript/commonjs/src/helpers/ResponsiveCalculations.d.ts +0 -1
  95. package/lib/typescript/commonjs/src/helpers/ResponsiveCalculations.d.ts.map +1 -1
  96. package/lib/typescript/commonjs/src/hooks/index.d.ts +1 -1
  97. package/lib/typescript/commonjs/src/hooks/index.d.ts.map +1 -1
  98. package/lib/typescript/commonjs/src/hooks/useScalingMode.d.ts +5 -0
  99. package/lib/typescript/commonjs/src/hooks/useScalingMode.d.ts.map +1 -0
  100. package/lib/typescript/commonjs/src/index.d.ts +2 -2
  101. package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
  102. package/lib/typescript/commonjs/src/types/common.type.d.ts +1 -0
  103. package/lib/typescript/commonjs/src/types/common.type.d.ts.map +1 -1
  104. package/lib/typescript/commonjs/src/types/menu.type.d.ts +2 -1
  105. package/lib/typescript/commonjs/src/types/menu.type.d.ts.map +1 -1
  106. package/lib/typescript/commonjs/src/types/styledComponents.type.d.ts +1 -1
  107. package/lib/typescript/commonjs/src/types/styledComponents.type.d.ts.map +1 -1
  108. package/lib/typescript/commonjs/src/types/userInput.type.d.ts +1 -0
  109. package/lib/typescript/commonjs/src/types/userInput.type.d.ts.map +1 -1
  110. package/lib/typescript/commonjs/src/utils/index.d.ts +1 -0
  111. package/lib/typescript/commonjs/src/utils/index.d.ts.map +1 -0
  112. package/lib/typescript/module/scripts/generateConfig.d.ts +1 -0
  113. package/lib/typescript/module/scripts/generateConfig.d.ts.map +1 -0
  114. package/lib/typescript/module/scripts/readConfig.d.ts +1 -0
  115. package/lib/typescript/module/scripts/readConfig.d.ts.map +1 -0
  116. package/lib/typescript/module/src/components/Button/Button.d.ts.map +1 -1
  117. package/lib/typescript/module/src/components/CheckBox/CheckBox.d.ts.map +1 -1
  118. package/lib/typescript/module/src/components/Dialog/Dialog.d.ts.map +1 -1
  119. package/lib/typescript/module/src/components/Dialog/DialogFoot.d.ts.map +1 -1
  120. package/lib/typescript/module/src/components/Dialog/DialogHead.d.ts.map +1 -1
  121. package/lib/typescript/module/src/components/IconButton/IconButton.d.ts +4 -2
  122. package/lib/typescript/module/src/components/IconButton/IconButton.d.ts.map +1 -1
  123. package/lib/typescript/module/src/components/Menu/Menu.d.ts.map +1 -1
  124. package/lib/typescript/module/src/components/Provider/ContextManager.d.ts +3 -0
  125. package/lib/typescript/module/src/components/Provider/ContextManager.d.ts.map +1 -0
  126. package/lib/typescript/module/src/components/Provider/NativeProvider.d.ts +9 -4
  127. package/lib/typescript/module/src/components/Provider/NativeProvider.d.ts.map +1 -1
  128. package/lib/typescript/module/src/components/StyledComponents/StyledView.d.ts +2 -2
  129. package/lib/typescript/module/src/components/StyledComponents/StyledView.d.ts.map +1 -1
  130. package/lib/typescript/module/src/components/UserInput/UserInput.d.ts +2 -1
  131. package/lib/typescript/module/src/components/UserInput/UserInput.d.ts.map +1 -1
  132. package/lib/typescript/module/src/helpers/ResponsiveCalculations.d.ts +0 -1
  133. package/lib/typescript/module/src/helpers/ResponsiveCalculations.d.ts.map +1 -1
  134. package/lib/typescript/module/src/hooks/index.d.ts +1 -1
  135. package/lib/typescript/module/src/hooks/index.d.ts.map +1 -1
  136. package/lib/typescript/module/src/hooks/useScalingMode.d.ts +5 -0
  137. package/lib/typescript/module/src/hooks/useScalingMode.d.ts.map +1 -0
  138. package/lib/typescript/module/src/index.d.ts +2 -2
  139. package/lib/typescript/module/src/index.d.ts.map +1 -1
  140. package/lib/typescript/module/src/types/common.type.d.ts +1 -0
  141. package/lib/typescript/module/src/types/common.type.d.ts.map +1 -1
  142. package/lib/typescript/module/src/types/menu.type.d.ts +2 -1
  143. package/lib/typescript/module/src/types/menu.type.d.ts.map +1 -1
  144. package/lib/typescript/module/src/types/styledComponents.type.d.ts +1 -1
  145. package/lib/typescript/module/src/types/styledComponents.type.d.ts.map +1 -1
  146. package/lib/typescript/module/src/types/userInput.type.d.ts +1 -0
  147. package/lib/typescript/module/src/types/userInput.type.d.ts.map +1 -1
  148. package/lib/typescript/module/src/utils/index.d.ts +1 -0
  149. package/lib/typescript/module/src/utils/index.d.ts.map +1 -0
  150. package/package.json +2 -2
  151. package/src/components/Button/Button.tsx +6 -3
  152. package/src/components/CheckBox/CheckBox.tsx +5 -3
  153. package/src/components/Chip/Chip.tsx +2 -1
  154. package/src/components/Dialog/Dialog.tsx +1 -0
  155. package/src/components/Dialog/DialogFoot.tsx +3 -2
  156. package/src/components/Dialog/DialogHead.tsx +3 -2
  157. package/src/components/Icon/Icon.tsx +2 -2
  158. package/src/components/IconButton/IconButton.tsx +26 -17
  159. package/src/components/Menu/Menu.tsx +3 -2
  160. package/src/components/Provider/ContextManager.tsx +9 -0
  161. package/src/components/Provider/NativeProvider.tsx +25 -10
  162. package/src/components/StyledComponents/StyledView.tsx +5 -6
  163. package/src/components/UserInput/UserInput.tsx +10 -7
  164. package/src/helpers/ResponsiveCalculations.ts +37 -32
  165. package/src/hooks/index.ts +1 -1
  166. package/src/hooks/{useResponsive.tsx → useScalingMode.tsx} +2 -2
  167. package/src/index.d.ts +3 -0
  168. package/src/index.ts +3 -2
  169. package/src/types/common.type.ts +1 -0
  170. package/src/types/menu.type.ts +2 -1
  171. package/src/types/styledComponents.type.ts +5 -5
  172. package/src/types/userInput.type.ts +1 -0
  173. package/src/utils/index.ts +0 -0
  174. package/lib/commonjs/hooks/useResponsive.js.map +0 -1
  175. package/lib/module/hooks/useResponsive.js +0 -7
  176. package/lib/module/hooks/useResponsive.js.map +0 -1
  177. package/lib/typescript/commonjs/src/hooks/useResponsive.d.ts +0 -3
  178. package/lib/typescript/commonjs/src/hooks/useResponsive.d.ts.map +0 -1
  179. package/lib/typescript/module/src/hooks/useResponsive.d.ts +0 -3
  180. 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,KAA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AS,CAAC;IAE3B;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAE7B;;;MAGE;IACF,GAAG,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,IAAI,CAAC,CAAA;CAC9B,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG,SAAS,GAAG,SAAS,GAAG;IAClD;;OAEG;IACH,OAAO,CAAC,EAAE,iBAAiB,CAAC;IAE5B;;OAEG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAE3B;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAE7B;;OAEG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC;IAEZ;;OAEG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC;IAEZ;;OAEG;IACH,EAAE,CAAC,EAAE,SAAS,CAAC,YAAY,CAAC,CAAC;IAE7B;;OAEG;IACH,GAAG,CAAC,EAAE,OAAO,CAAC;IAEd;;OAEG;IACH,KAAK,CAAC,EAAE,UAAU,CAAC;IAEnB;;OAEG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACvB,CAAC"}
@@ -27,6 +27,7 @@ export type UserInputProps = TextInputProps & {
27
27
  textVariant?: {
28
28
  label?: TypographyVariant;
29
29
  helperText?: TypographyVariant;
30
+ inputText?: TypographyVariant;
30
31
  };
31
32
  /** Color of the text inside the input field. */
32
33
  inputTextColor?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"userInput.type.d.ts","sourceRoot":"","sources":["../../../../../src/types/userInput.type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,cAAc,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC/F,OAAO,KAAK,EAAE,iBAAiB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,EAAE,KAAK,CAAC,SAAS,CAAC,SAAS,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.4",
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 STYLES = StyleSheet.create({
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 STYLES = StyleSheet.create({
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
+ });
@@ -86,4 +86,5 @@ const Chip: React.FC<ChipProps> = ({
86
86
  </>);
87
87
  }
88
88
  export default Chip;
89
- export type { ChipProps };
89
+ export type { ChipProps };
90
+
@@ -12,6 +12,7 @@ const Dialog = forwardRef<DialogRefProps, DialogProps>(({
12
12
  size = 'lg',
13
13
  fullScreen,
14
14
  backdropColor = 'rgba(0, 0, 0, 0.5)',
15
+ // backdropColor = 'red',
15
16
  // animationDuration = 800,
16
17
  onClose,
17
18
  containerStyle,
@@ -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 STYLES = StyleSheet.create({
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 STYLES = StyleSheet.create({
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 ?? 15),
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 { ReactNode } from "react";
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?: ReactNode;
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
- <StyledView style={{ alignSelf: 'flex-start' }}>
23
- <TouchableOpacity
24
- // rippleColor={rippleColor}
25
- style={{ borderRadius: 100, padding: verticalScale(8) }}
26
- {...rest}
27
- >
28
- <Icon
29
- renderIcon={React.cloneElement(children as React.ReactElement<any>)}
30
- />
31
- </TouchableOpacity>
32
- </StyledView>
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 STYLES = StyleSheet.create({
123
+ const Styles = () => StyleSheet.create({
123
124
  MENU_CONT: {
124
125
  shadowColor: "#000",
125
126
  backgroundColor: '#fff',
@@ -0,0 +1,9 @@
1
+ let _contextValue: any = null
2
+
3
+ export const setGlobalContext = (ctx: any) => {
4
+ _contextValue = ctx;
5
+ };
6
+
7
+ export const getGlobalContext = () => {
8
+ return _contextValue;
9
+ };
@@ -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 | undefined>({
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(() => ({ theme: setTheme, isResponsive, mode }), [theme, mode]);
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 React from 'react';
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: React.FC<StyledViewProps> = ({
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: React.FC<UserInputProps> = ({
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
- fontSize: responsiveFontSize(inputFs),
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 STYLES = StyleSheet.create({
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
- // import { useResponsive } from '../hooks';
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 isResponsive = useResponsive();
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
- const scalingCache = new Map<'hScale' | 'vScale' | 'fs', object>();
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
- export const horizontalScale = (size: number): number => {
33
+
34
+ const scale = (size: number, cacheKey: scalingCacheKey, mode: scalingModeTypes) => {
28
35
  if (checkIsPhone(size)) {
29
36
  return size;
30
37
  }
31
- const hScaleCache: any = scalingCache.get('hScale') || {};
32
- if (hScaleCache?.[size]) {
33
- return hScaleCache?.[size];
38
+ const cacheScaleValue: any = scalingCache.get(cacheKey) || {};
39
+ let finalSize;
40
+ if (cacheScaleValue?.[size]) {
41
+ return cacheScaleValue?.[size];
34
42
  }
35
- const slowDownRate = SCREEN_WIDTH < 375 ? 2 : 0.40;
36
- let scale = (shortDimension / guidelineBaseHeight);
37
- scale = 1 + (scale - 1) * slowDownRate;
38
- let adjustedSize = size * Math.max(scale, 0.80);
39
- const finalSize = Math.floor(PixelRatio.roundToNearestPixel(adjustedSize));
40
- hScaleCache[size] = finalSize;
41
- scalingCache.set('hScale', hScaleCache)
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
- if (checkIsPhone(size)) {
48
- return size;
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
 
@@ -1,4 +1,4 @@
1
1
  export { default as useTheme } from './useTheme';
2
- export { default as useResponsive } from './useResponsive';
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 useResponsive = () => useContext(Context)?.isResponsive;
4
+ const useScalingMode = () => useContext(Context)?.scaling;
5
5
 
6
- export default useResponsive;
6
+ export default useScalingMode;
package/src/index.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ declare module '@nexara/nativeflow' {
2
+ export { Button } from 'components/Button/Button';
3
+ }
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';
@@ -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,
@@ -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 = TextStyle & {
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
- * A ref to access the underlying View component.
58
- * This can be used for measuring layout, animations, or imperative interactions.
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
  */