react-native-mantine 0.4.0 → 0.6.0

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 (280) hide show
  1. package/README.md +0 -357
  2. package/lib/commonjs/components/Button/Button.styles.js +5 -46
  3. package/lib/commonjs/components/Button/Button.styles.js.map +1 -1
  4. package/lib/commonjs/components/Button/index.js +18 -39
  5. package/lib/commonjs/components/Button/index.js.map +1 -1
  6. package/lib/commonjs/components/Chip/index.js.map +1 -1
  7. package/lib/commonjs/components/CloseButton/index.js +5 -30
  8. package/lib/commonjs/components/CloseButton/index.js.map +1 -1
  9. package/lib/commonjs/components/Collapse/index.js +10 -2
  10. package/lib/commonjs/components/Collapse/index.js.map +1 -1
  11. package/lib/commonjs/components/Dialog/index.js +51 -8
  12. package/lib/commonjs/components/Dialog/index.js.map +1 -1
  13. package/lib/commonjs/components/Drawer/index.js +4 -13
  14. package/lib/commonjs/components/Drawer/index.js.map +1 -1
  15. package/lib/commonjs/components/Icon/index.js +53 -0
  16. package/lib/commonjs/components/Icon/index.js.map +1 -0
  17. package/lib/commonjs/components/Input/Input.styles.js +2 -204
  18. package/lib/commonjs/components/Input/Input.styles.js.map +1 -1
  19. package/lib/commonjs/components/Input/index.js +1 -1
  20. package/lib/commonjs/components/List/index.js.map +1 -1
  21. package/lib/commonjs/components/Menu/index.js +11 -10
  22. package/lib/commonjs/components/Menu/index.js.map +1 -1
  23. package/lib/commonjs/components/Modal/index.js +10 -16
  24. package/lib/commonjs/components/Modal/index.js.map +1 -1
  25. package/lib/commonjs/components/Notification/index.js +12 -5
  26. package/lib/commonjs/components/Notification/index.js.map +1 -1
  27. package/lib/commonjs/components/NumberInput/index.js +2 -1
  28. package/lib/commonjs/components/NumberInput/index.js.map +1 -1
  29. package/lib/commonjs/components/PasswordInput/index.js +5 -6
  30. package/lib/commonjs/components/PasswordInput/index.js.map +1 -1
  31. package/lib/commonjs/components/PinInput/index.js +7 -2
  32. package/lib/commonjs/components/PinInput/index.js.map +1 -1
  33. package/lib/commonjs/components/Popover/index.js +8 -7
  34. package/lib/commonjs/components/Popover/index.js.map +1 -1
  35. package/lib/commonjs/components/RingProgress/index.js +49 -7
  36. package/lib/commonjs/components/RingProgress/index.js.map +1 -1
  37. package/lib/commonjs/components/SegmentedControl/index.js +7 -4
  38. package/lib/commonjs/components/SegmentedControl/index.js.map +1 -1
  39. package/lib/commonjs/components/Slider/index.js +28 -3
  40. package/lib/commonjs/components/Slider/index.js.map +1 -1
  41. package/lib/commonjs/components/Stepper/index.js.map +1 -1
  42. package/lib/commonjs/components/Table/index.js +22 -20
  43. package/lib/commonjs/components/Table/index.js.map +1 -1
  44. package/lib/commonjs/components/TextInput/index.js +2 -2
  45. package/lib/commonjs/components/TextInput/index.js.map +1 -1
  46. package/lib/commonjs/components/Timeline/index.js +12 -5
  47. package/lib/commonjs/components/Timeline/index.js.map +1 -1
  48. package/lib/commonjs/components/Tooltip/index.js +12 -11
  49. package/lib/commonjs/components/Tooltip/index.js.map +1 -1
  50. package/lib/commonjs/components/TransferList/index.js +3 -8
  51. package/lib/commonjs/components/TransferList/index.js.map +1 -1
  52. package/lib/commonjs/components/Transition/index.js +4 -0
  53. package/lib/commonjs/components/Transition/index.js.map +1 -1
  54. package/lib/commonjs/components/UnstyledButton/UnstyledButton.js +4 -0
  55. package/lib/commonjs/components/UnstyledButton/UnstyledButton.js.map +1 -1
  56. package/lib/commonjs/components/index.js +22 -22
  57. package/lib/commonjs/components/index.js.map +1 -1
  58. package/lib/commonjs/hooks/useCachedResources.js +1 -4
  59. package/lib/commonjs/hooks/useCachedResources.js.map +1 -1
  60. package/lib/commonjs/theme/functions/attach-functions.js +3 -0
  61. package/lib/commonjs/theme/functions/attach-functions.js.map +1 -1
  62. package/lib/commonjs/theme/functions/fns/helpers.js +12 -1
  63. package/lib/commonjs/theme/functions/fns/helpers.js.map +1 -1
  64. package/lib/commonjs/theme/functions/fns/index.js +4 -0
  65. package/lib/commonjs/theme/functions/fns/index.js.map +1 -1
  66. package/lib/commonjs/theme/functions/fns/rgba.js +50 -0
  67. package/lib/commonjs/theme/functions/fns/rgba.js.map +1 -0
  68. package/lib/commonjs/theme/functions/fns/size.js +19 -0
  69. package/lib/commonjs/theme/functions/fns/size.js.map +1 -0
  70. package/lib/commonjs/theme/theme-provider.js +6 -8
  71. package/lib/commonjs/theme/theme-provider.js.map +1 -1
  72. package/lib/module/components/Button/Button.styles.js +5 -46
  73. package/lib/module/components/Button/Button.styles.js.map +1 -1
  74. package/lib/module/components/Button/index.js +18 -39
  75. package/lib/module/components/Button/index.js.map +1 -1
  76. package/lib/module/components/Chip/index.js.map +1 -1
  77. package/lib/module/components/CloseButton/index.js +6 -31
  78. package/lib/module/components/CloseButton/index.js.map +1 -1
  79. package/lib/module/components/Collapse/index.js +10 -2
  80. package/lib/module/components/Collapse/index.js.map +1 -1
  81. package/lib/module/components/Dialog/index.js +52 -9
  82. package/lib/module/components/Dialog/index.js.map +1 -1
  83. package/lib/module/components/Drawer/index.js +4 -13
  84. package/lib/module/components/Drawer/index.js.map +1 -1
  85. package/lib/module/components/Icon/index.js +48 -0
  86. package/lib/module/components/Icon/index.js.map +1 -0
  87. package/lib/module/components/Input/Input.styles.js +1 -203
  88. package/lib/module/components/Input/Input.styles.js.map +1 -1
  89. package/lib/module/components/Input/index.js +1 -1
  90. package/lib/module/components/Input/index.js.map +1 -1
  91. package/lib/module/components/List/index.js.map +1 -1
  92. package/lib/module/components/Menu/index.js +9 -8
  93. package/lib/module/components/Menu/index.js.map +1 -1
  94. package/lib/module/components/Modal/index.js +10 -16
  95. package/lib/module/components/Modal/index.js.map +1 -1
  96. package/lib/module/components/Notification/index.js +12 -5
  97. package/lib/module/components/Notification/index.js.map +1 -1
  98. package/lib/module/components/NumberInput/index.js +2 -1
  99. package/lib/module/components/NumberInput/index.js.map +1 -1
  100. package/lib/module/components/PasswordInput/index.js +5 -6
  101. package/lib/module/components/PasswordInput/index.js.map +1 -1
  102. package/lib/module/components/PinInput/index.js +7 -2
  103. package/lib/module/components/PinInput/index.js.map +1 -1
  104. package/lib/module/components/Popover/index.js +9 -8
  105. package/lib/module/components/Popover/index.js.map +1 -1
  106. package/lib/module/components/RingProgress/index.js +51 -9
  107. package/lib/module/components/RingProgress/index.js.map +1 -1
  108. package/lib/module/components/SegmentedControl/index.js +7 -4
  109. package/lib/module/components/SegmentedControl/index.js.map +1 -1
  110. package/lib/module/components/Slider/index.js +28 -3
  111. package/lib/module/components/Slider/index.js.map +1 -1
  112. package/lib/module/components/Stepper/index.js.map +1 -1
  113. package/lib/module/components/Table/index.js +22 -19
  114. package/lib/module/components/Table/index.js.map +1 -1
  115. package/lib/module/components/TextInput/index.js +2 -2
  116. package/lib/module/components/TextInput/index.js.map +1 -1
  117. package/lib/module/components/Timeline/index.js +12 -5
  118. package/lib/module/components/Timeline/index.js.map +1 -1
  119. package/lib/module/components/Tooltip/index.js +11 -10
  120. package/lib/module/components/Tooltip/index.js.map +1 -1
  121. package/lib/module/components/TransferList/index.js +4 -9
  122. package/lib/module/components/TransferList/index.js.map +1 -1
  123. package/lib/module/components/Transition/index.js +5 -1
  124. package/lib/module/components/Transition/index.js.map +1 -1
  125. package/lib/module/components/UnstyledButton/UnstyledButton.js +4 -0
  126. package/lib/module/components/UnstyledButton/UnstyledButton.js.map +1 -1
  127. package/lib/module/components/index.js +1 -1
  128. package/lib/module/components/index.js.map +1 -1
  129. package/lib/module/hooks/useCachedResources.js +1 -4
  130. package/lib/module/hooks/useCachedResources.js.map +1 -1
  131. package/lib/module/theme/functions/attach-functions.js +3 -0
  132. package/lib/module/theme/functions/attach-functions.js.map +1 -1
  133. package/lib/module/theme/functions/fns/helpers.js +10 -0
  134. package/lib/module/theme/functions/fns/helpers.js.map +1 -1
  135. package/lib/module/theme/functions/fns/index.js +4 -0
  136. package/lib/module/theme/functions/fns/index.js.map +1 -1
  137. package/lib/module/theme/functions/fns/rgba.js +46 -0
  138. package/lib/module/theme/functions/fns/rgba.js.map +1 -0
  139. package/lib/module/theme/functions/fns/size.js +15 -0
  140. package/lib/module/theme/functions/fns/size.js.map +1 -0
  141. package/lib/module/theme/theme-provider.js +6 -8
  142. package/lib/module/theme/theme-provider.js.map +1 -1
  143. package/lib/typescript/commonjs/src/components/Button/Button.styles.d.ts.map +1 -1
  144. package/lib/typescript/commonjs/src/components/Button/index.d.ts +1 -0
  145. package/lib/typescript/commonjs/src/components/Button/index.d.ts.map +1 -1
  146. package/lib/typescript/commonjs/src/components/CloseButton/index.d.ts.map +1 -1
  147. package/lib/typescript/commonjs/src/components/Collapse/index.d.ts.map +1 -1
  148. package/lib/typescript/commonjs/src/components/Dialog/index.d.ts +2 -0
  149. package/lib/typescript/commonjs/src/components/Dialog/index.d.ts.map +1 -1
  150. package/lib/typescript/commonjs/src/components/Drawer/index.d.ts.map +1 -1
  151. package/lib/typescript/commonjs/src/components/Icon/index.d.ts +26 -0
  152. package/lib/typescript/commonjs/src/components/Icon/index.d.ts.map +1 -0
  153. package/lib/typescript/commonjs/src/components/Input/Input.styles.d.ts +7 -0
  154. package/lib/typescript/commonjs/src/components/Input/Input.styles.d.ts.map +1 -1
  155. package/lib/typescript/commonjs/src/components/Input/index.d.ts +1 -1
  156. package/lib/typescript/commonjs/src/components/Input/index.d.ts.map +1 -1
  157. package/lib/typescript/commonjs/src/components/Menu/index.d.ts.map +1 -1
  158. package/lib/typescript/commonjs/src/components/Modal/index.d.ts.map +1 -1
  159. package/lib/typescript/commonjs/src/components/Notification/index.d.ts.map +1 -1
  160. package/lib/typescript/commonjs/src/components/NumberInput/index.d.ts.map +1 -1
  161. package/lib/typescript/commonjs/src/components/PinInput/index.d.ts.map +1 -1
  162. package/lib/typescript/commonjs/src/components/Popover/index.d.ts.map +1 -1
  163. package/lib/typescript/commonjs/src/components/RingProgress/index.d.ts.map +1 -1
  164. package/lib/typescript/commonjs/src/components/SegmentedControl/index.d.ts.map +1 -1
  165. package/lib/typescript/commonjs/src/components/Slider/index.d.ts.map +1 -1
  166. package/lib/typescript/commonjs/src/components/Stepper/index.d.ts.map +1 -1
  167. package/lib/typescript/commonjs/src/components/Table/index.d.ts +16 -7
  168. package/lib/typescript/commonjs/src/components/Table/index.d.ts.map +1 -1
  169. package/lib/typescript/commonjs/src/components/TextInput/index.d.ts.map +1 -1
  170. package/lib/typescript/commonjs/src/components/Timeline/index.d.ts.map +1 -1
  171. package/lib/typescript/commonjs/src/components/Tooltip/index.d.ts.map +1 -1
  172. package/lib/typescript/commonjs/src/components/TransferList/index.d.ts.map +1 -1
  173. package/lib/typescript/commonjs/src/components/Transition/index.d.ts.map +1 -1
  174. package/lib/typescript/commonjs/src/components/UnstyledButton/UnstyledButton.d.ts +2 -0
  175. package/lib/typescript/commonjs/src/components/UnstyledButton/UnstyledButton.d.ts.map +1 -1
  176. package/lib/typescript/commonjs/src/components/index.d.ts +1 -1
  177. package/lib/typescript/commonjs/src/components/index.d.ts.map +1 -1
  178. package/lib/typescript/commonjs/src/hooks/useCachedResources.d.ts.map +1 -1
  179. package/lib/typescript/commonjs/src/theme/functions/attach-functions.d.ts.map +1 -1
  180. package/lib/typescript/commonjs/src/theme/functions/fns/helpers.d.ts +7 -0
  181. package/lib/typescript/commonjs/src/theme/functions/fns/helpers.d.ts.map +1 -1
  182. package/lib/typescript/commonjs/src/theme/functions/fns/index.d.ts +7 -0
  183. package/lib/typescript/commonjs/src/theme/functions/fns/index.d.ts.map +1 -1
  184. package/lib/typescript/commonjs/src/theme/functions/fns/rgba.d.ts +8 -0
  185. package/lib/typescript/commonjs/src/theme/functions/fns/rgba.d.ts.map +1 -0
  186. package/lib/typescript/commonjs/src/theme/functions/fns/size.d.ts +6 -0
  187. package/lib/typescript/commonjs/src/theme/functions/fns/size.d.ts.map +1 -0
  188. package/lib/typescript/module/src/components/Button/Button.styles.d.ts.map +1 -1
  189. package/lib/typescript/module/src/components/Button/index.d.ts +1 -0
  190. package/lib/typescript/module/src/components/Button/index.d.ts.map +1 -1
  191. package/lib/typescript/module/src/components/CloseButton/index.d.ts.map +1 -1
  192. package/lib/typescript/module/src/components/Collapse/index.d.ts.map +1 -1
  193. package/lib/typescript/module/src/components/Dialog/index.d.ts +2 -0
  194. package/lib/typescript/module/src/components/Dialog/index.d.ts.map +1 -1
  195. package/lib/typescript/module/src/components/Drawer/index.d.ts.map +1 -1
  196. package/lib/typescript/module/src/components/Icon/index.d.ts +26 -0
  197. package/lib/typescript/module/src/components/Icon/index.d.ts.map +1 -0
  198. package/lib/typescript/module/src/components/Input/Input.styles.d.ts +7 -0
  199. package/lib/typescript/module/src/components/Input/Input.styles.d.ts.map +1 -1
  200. package/lib/typescript/module/src/components/Input/index.d.ts +1 -1
  201. package/lib/typescript/module/src/components/Input/index.d.ts.map +1 -1
  202. package/lib/typescript/module/src/components/Menu/index.d.ts.map +1 -1
  203. package/lib/typescript/module/src/components/Modal/index.d.ts.map +1 -1
  204. package/lib/typescript/module/src/components/Notification/index.d.ts.map +1 -1
  205. package/lib/typescript/module/src/components/NumberInput/index.d.ts.map +1 -1
  206. package/lib/typescript/module/src/components/PinInput/index.d.ts.map +1 -1
  207. package/lib/typescript/module/src/components/Popover/index.d.ts.map +1 -1
  208. package/lib/typescript/module/src/components/RingProgress/index.d.ts.map +1 -1
  209. package/lib/typescript/module/src/components/SegmentedControl/index.d.ts.map +1 -1
  210. package/lib/typescript/module/src/components/Slider/index.d.ts.map +1 -1
  211. package/lib/typescript/module/src/components/Stepper/index.d.ts.map +1 -1
  212. package/lib/typescript/module/src/components/Table/index.d.ts +16 -7
  213. package/lib/typescript/module/src/components/Table/index.d.ts.map +1 -1
  214. package/lib/typescript/module/src/components/TextInput/index.d.ts.map +1 -1
  215. package/lib/typescript/module/src/components/Timeline/index.d.ts.map +1 -1
  216. package/lib/typescript/module/src/components/Tooltip/index.d.ts.map +1 -1
  217. package/lib/typescript/module/src/components/TransferList/index.d.ts.map +1 -1
  218. package/lib/typescript/module/src/components/Transition/index.d.ts.map +1 -1
  219. package/lib/typescript/module/src/components/UnstyledButton/UnstyledButton.d.ts +2 -0
  220. package/lib/typescript/module/src/components/UnstyledButton/UnstyledButton.d.ts.map +1 -1
  221. package/lib/typescript/module/src/components/index.d.ts +1 -1
  222. package/lib/typescript/module/src/components/index.d.ts.map +1 -1
  223. package/lib/typescript/module/src/hooks/useCachedResources.d.ts.map +1 -1
  224. package/lib/typescript/module/src/theme/functions/attach-functions.d.ts.map +1 -1
  225. package/lib/typescript/module/src/theme/functions/fns/helpers.d.ts +7 -0
  226. package/lib/typescript/module/src/theme/functions/fns/helpers.d.ts.map +1 -1
  227. package/lib/typescript/module/src/theme/functions/fns/index.d.ts +7 -0
  228. package/lib/typescript/module/src/theme/functions/fns/index.d.ts.map +1 -1
  229. package/lib/typescript/module/src/theme/functions/fns/rgba.d.ts +8 -0
  230. package/lib/typescript/module/src/theme/functions/fns/rgba.d.ts.map +1 -0
  231. package/lib/typescript/module/src/theme/functions/fns/size.d.ts +6 -0
  232. package/lib/typescript/module/src/theme/functions/fns/size.d.ts.map +1 -0
  233. package/package.json +12 -9
  234. package/src/components/Button/Button.styles.ts +5 -48
  235. package/src/components/Button/index.tsx +56 -81
  236. package/src/components/Chip/index.tsx +3 -3
  237. package/src/components/CloseButton/index.tsx +2 -23
  238. package/src/components/Collapse/index.tsx +11 -2
  239. package/src/components/Dialog/index.tsx +54 -9
  240. package/src/components/Drawer/index.tsx +7 -13
  241. package/src/components/Icon/index.tsx +74 -0
  242. package/src/components/Input/Input.styles.ts +1 -202
  243. package/src/components/Input/index.ts +1 -1
  244. package/src/components/List/index.tsx +1 -1
  245. package/src/components/Menu/index.tsx +13 -10
  246. package/src/components/Modal/index.tsx +11 -16
  247. package/src/components/Notification/index.tsx +10 -2
  248. package/src/components/NumberInput/index.tsx +57 -15
  249. package/src/components/PasswordInput/index.tsx +2 -2
  250. package/src/components/PinInput/index.tsx +24 -9
  251. package/src/components/Popover/index.tsx +13 -10
  252. package/src/components/RingProgress/index.tsx +51 -8
  253. package/src/components/SegmentedControl/index.tsx +6 -4
  254. package/src/components/Slider/index.tsx +14 -3
  255. package/src/components/Stepper/index.tsx +5 -4
  256. package/src/components/Table/index.tsx +73 -36
  257. package/src/components/TextInput/index.tsx +93 -66
  258. package/src/components/Timeline/index.tsx +19 -12
  259. package/src/components/Tooltip/index.tsx +13 -10
  260. package/src/components/TransferList/index.tsx +1 -5
  261. package/src/components/Transition/index.tsx +14 -2
  262. package/src/components/UnstyledButton/UnstyledButton.tsx +5 -1
  263. package/src/components/index.tsx +1 -1
  264. package/src/hooks/useCachedResources.ts +1 -4
  265. package/src/theme/functions/attach-functions.ts +3 -0
  266. package/src/theme/functions/fns/helpers.ts +19 -7
  267. package/src/theme/functions/fns/index.ts +4 -0
  268. package/src/theme/functions/fns/rgba.ts +45 -0
  269. package/src/theme/functions/fns/size.ts +14 -0
  270. package/src/theme/theme-provider.tsx +6 -6
  271. package/src/theme/types/MantineStyleSystem.ts +0 -53
  272. package/lib/commonjs/components/Portal/index.js +0 -69
  273. package/lib/commonjs/components/Portal/index.js.map +0 -1
  274. package/lib/module/components/Portal/index.js +0 -62
  275. package/lib/module/components/Portal/index.js.map +0 -1
  276. package/lib/typescript/commonjs/src/components/Portal/index.d.ts +0 -10
  277. package/lib/typescript/commonjs/src/components/Portal/index.d.ts.map +0 -1
  278. package/lib/typescript/module/src/components/Portal/index.d.ts +0 -10
  279. package/lib/typescript/module/src/components/Portal/index.d.ts.map +0 -1
  280. package/src/components/Portal/index.tsx +0 -75
@@ -1,5 +1,5 @@
1
- import React, { forwardRef } from 'react';
2
- import { View } from 'react-native';
1
+ import React, { forwardRef, useEffect, useRef } from 'react';
2
+ import { View, Animated } from 'react-native';
3
3
  import { BoxView } from '../BoxView';
4
4
  import { Text } from '../Text';
5
5
  import type { DefaultProps, MantineColor } from '../../theme/types';
@@ -119,13 +119,41 @@ export const RingProgress = forwardRef<any, RingProgressProps>((props, ref) => {
119
119
  { name: 'RingProgress' }
120
120
  ) as any;
121
121
 
122
+ // Animation values for each section
123
+ const animatedValues = useRef(
124
+ sections.map(() => new Animated.Value(0))
125
+ ).current;
126
+
127
+ // Update animation values when sections change
128
+ useEffect(() => {
129
+ // Ensure we have the right number of animated values
130
+ while (animatedValues.length < sections.length) {
131
+ animatedValues.push(new Animated.Value(0));
132
+ }
133
+
134
+ // Animate each section
135
+ const animations = sections.map((section, index) => {
136
+ const animValue = animatedValues[index];
137
+ if (!animValue) return Animated.timing(new Animated.Value(0), { toValue: 0, duration: 0, useNativeDriver: false });
138
+
139
+ return Animated.timing(animValue, {
140
+ toValue: section.value,
141
+ duration: 1000,
142
+ useNativeDriver: false,
143
+ });
144
+ });
145
+
146
+ Animated.parallel(animations).start();
147
+ }, [sections, animatedValues]);
148
+
122
149
  // Calculate total value and normalize sections
123
- const normalizedSections = sections.map((section) => ({
150
+ const normalizedSections = sections.map((section, index) => ({
124
151
  ...section,
125
152
  percentage: (section.value / 100) * 100,
153
+ animatedValue: animatedValues[index] || new Animated.Value(0),
126
154
  }));
127
155
 
128
- // Render simplified ring using borders and transforms
156
+ // Render animated ring using borders and transforms
129
157
  // Note: This is a basic implementation. For full SVG support, use react-native-svg
130
158
  const renderSections = () => {
131
159
  let currentAngle = 0;
@@ -139,10 +167,21 @@ export const RingProgress = forwardRef<any, RingProgressProps>((props, ref) => {
139
167
  const rotation = currentAngle;
140
168
  currentAngle += angle;
141
169
 
142
- // Simplified representation - just show colored arcs
143
- // This is a placeholder implementation
170
+ // Animate the opacity for a smooth appearance
171
+ const animatedOpacity = section.animatedValue.interpolate({
172
+ inputRange: [0, section.value],
173
+ outputRange: [0, 1],
174
+ });
175
+
176
+ // Animated scale for smooth growth effect
177
+ const animatedScale = section.animatedValue.interpolate({
178
+ inputRange: [0, section.value],
179
+ outputRange: [0.8, 1],
180
+ });
181
+
182
+ // Simplified representation - just show colored arcs with animation
144
183
  return (
145
- <View
184
+ <Animated.View
146
185
  key={index}
147
186
  style={{
148
187
  position: 'absolute',
@@ -152,7 +191,11 @@ export const RingProgress = forwardRef<any, RingProgressProps>((props, ref) => {
152
191
  borderWidth: thickness,
153
192
  borderColor: 'transparent',
154
193
  borderTopColor: sectionColor,
155
- transform: [{ rotate: `${rotation}deg` }],
194
+ transform: [
195
+ { rotate: `${rotation}deg` },
196
+ { scale: animatedScale },
197
+ ],
198
+ opacity: animatedOpacity,
156
199
  }}
157
200
  />
158
201
  );
@@ -85,19 +85,20 @@ const useStyles = createStyles(
85
85
  flexDirection: orientation === 'horizontal' ? 'row' : 'column',
86
86
  backgroundColor: theme.colorScheme === 'dark' ? theme.colors.dark?.[6] : theme.colors.gray?.[1],
87
87
  borderRadius: theme.fn.radius(radius),
88
- padding: rem(4) as any,
88
+ padding: rem(3) as any,
89
89
  opacity: disabled ? 0.5 : 1,
90
90
  ...(fullWidth && { width: '100%' }),
91
91
  },
92
92
  indicator: {
93
93
  position: 'absolute',
94
94
  backgroundColor: theme.white,
95
- borderRadius: theme.fn.radius(radius),
95
+ borderRadius: (theme.fn.radius(radius) as number) - rem(1),
96
96
  shadowColor: '#000',
97
97
  shadowOffset: { width: 0, height: 1 },
98
98
  shadowOpacity: 0.05,
99
99
  shadowRadius: 1,
100
100
  elevation: 1,
101
+ margin: rem(3) as any,
101
102
  ...(theme.colorScheme === 'dark' && {
102
103
  backgroundColor: theme.colors.dark?.[5],
103
104
  }),
@@ -105,11 +106,11 @@ const useStyles = createStyles(
105
106
  segment: {
106
107
  flex: 1,
107
108
  paddingHorizontal: sizeStyles.padding as any,
108
- paddingVertical: sizeStyles.padding as any,
109
+ paddingVertical: rem(6) as any,
109
110
  minHeight: sizeStyles.height as any,
110
111
  justifyContent: 'center',
111
112
  alignItems: 'center',
112
- borderRadius: theme.fn.radius(radius),
113
+ borderRadius: (theme.fn.radius(radius) as number) - rem(1),
113
114
  zIndex: 1,
114
115
  },
115
116
  label: {
@@ -181,6 +182,7 @@ export const SegmentedControl = forwardRef<any, SegmentedControlProps>((props, r
181
182
  useEffect(() => {
182
183
  if (segmentLayouts[activeIndex]) {
183
184
  const layout = segmentLayouts[activeIndex];
185
+ // No need to adjust for margin since indicator has its own margin
184
186
 
185
187
  Animated.parallel([
186
188
  Animated.timing(indicatorPosition, {
@@ -247,19 +247,28 @@ export const Slider = forwardRef<any, SliderProps>((props, ref) => {
247
247
  [trackWidth, min, max]
248
248
  );
249
249
 
250
+ const trackLayoutRef = useRef({ x: 0, y: 0, width: 0, height: 0 });
251
+
250
252
  const panResponder = useRef(
251
253
  PanResponder.create({
252
254
  onStartShouldSetPanResponder: () => !disabled!,
253
255
  onMoveShouldSetPanResponder: () => !disabled!,
254
- onPanResponderGrant: () => {
256
+ onPanResponderGrant: (evt: GestureResponderEvent) => {
255
257
  setShowLabel(true);
256
258
  Animated.spring(scale, {
257
259
  toValue: 1.2,
258
260
  useNativeDriver: true,
259
261
  }).start();
262
+
263
+ // Handle tap to move slider
264
+ const locationX = evt.nativeEvent.locationX;
265
+ const newValue = getValueFromPosition(locationX);
266
+ updateValue(newValue);
260
267
  },
261
268
  onPanResponderMove: (_evt: GestureResponderEvent, gestureState: PanResponderGestureState) => {
262
- const newValue = getValueFromPosition(gestureState.moveX);
269
+ // Calculate position relative to track start
270
+ const relativeX = gestureState.moveX - trackLayoutRef.current.x;
271
+ const newValue = getValueFromPosition(relativeX);
263
272
  updateValue(newValue);
264
273
  },
265
274
  onPanResponderRelease: () => {
@@ -274,7 +283,9 @@ export const Slider = forwardRef<any, SliderProps>((props, ref) => {
274
283
  ).current;
275
284
 
276
285
  const handleLayout = (event: LayoutChangeEvent) => {
277
- setTrackWidth(event.nativeEvent.layout.width);
286
+ const { x, y, width, height } = event.nativeEvent.layout;
287
+ setTrackWidth(width);
288
+ trackLayoutRef.current = { x, y, width, height };
278
289
  };
279
290
 
280
291
  const percentage = ((value - min!) / (max! - min!)) * 100;
@@ -252,10 +252,11 @@ export const Stepper = forwardRef<any, StepperProps>((props, ref) => {
252
252
 
253
253
  const childrenArray = React.Children.toArray(children);
254
254
  const steps = childrenArray.filter(
255
- (child) => React.isValidElement(child) && (child as any).type === Step
255
+ (child): child is React.ReactElement<StepProps & { __stepIndex?: number; __isLast?: boolean }> =>
256
+ React.isValidElement(child) && (child.type as any) === Step
256
257
  );
257
258
  const completedStep = childrenArray.find(
258
- (child) => React.isValidElement(child) && (child as any).type === StepperCompleted
259
+ (child) => React.isValidElement(child) && (child.type as any) === StepperCompleted
259
260
  );
260
261
 
261
262
  const isStepsCompleted = active >= steps.length;
@@ -275,7 +276,7 @@ export const Stepper = forwardRef<any, StepperProps>((props, ref) => {
275
276
  <BoxView ref={ref} style={sx(styles.root, style)} {...others}>
276
277
  <BoxView style={styles.steps}>
277
278
  {steps.map((step, index) => {
278
- return React.cloneElement(step as React.ReactElement, {
279
+ return React.cloneElement<StepProps & { __stepIndex?: number; __isLast?: boolean }>(step, {
279
280
  key: index,
280
281
  __stepIndex: index,
281
282
  __isLast: index === steps.length - 1,
@@ -286,7 +287,7 @@ export const Stepper = forwardRef<any, StepperProps>((props, ref) => {
286
287
  <BoxView style={styles.content}>
287
288
  {isStepsCompleted
288
289
  ? completedStep
289
- : steps[active] && (steps[active] as React.ReactElement).props.children}
290
+ : steps[active] && steps[active].props.children}
290
291
  </BoxView>
291
292
  </BoxView>
292
293
  </StepperContext.Provider>
@@ -137,12 +137,18 @@ const useTableStyles = createStyles(
137
137
  borderCollapse: 'collapse' as any,
138
138
  ...(withBorder && {
139
139
  borderWidth: 1,
140
- borderColor: theme.colorScheme === 'dark' ? theme.colors.dark?.[4] : theme.colors.gray?.[3],
140
+ borderColor:
141
+ theme.colorScheme === 'dark'
142
+ ? theme.colors.dark?.[4]
143
+ : theme.colors.gray?.[3],
141
144
  }),
142
145
  },
143
146
  caption: {
144
147
  fontSize: theme.fontSizes.sm as number,
145
- color: theme.colorScheme === 'dark' ? theme.colors.dark?.[2] : theme.colors.gray?.[6],
148
+ color:
149
+ theme.colorScheme === 'dark'
150
+ ? theme.colors.dark?.[2]
151
+ : theme.colors.gray?.[6],
146
152
  paddingVertical: theme.spacing.xs,
147
153
  textAlign: 'center',
148
154
  ...(captionSide === 'bottom' && { order: 1 }),
@@ -153,7 +159,10 @@ const useTableStyles = createStyles(
153
159
  const useTableHeadStyles = createStyles((theme) => ({
154
160
  thead: {
155
161
  borderBottomWidth: 1,
156
- borderBottomColor: theme.colorScheme === 'dark' ? theme.colors.dark?.[4] : theme.colors.gray?.[3],
162
+ borderBottomColor:
163
+ theme.colorScheme === 'dark'
164
+ ? theme.colors.dark?.[4]
165
+ : theme.colors.gray?.[3],
157
166
  },
158
167
  }));
159
168
 
@@ -171,11 +180,16 @@ const useTableRowStyles = createStyles(
171
180
  ) => ({
172
181
  tr: {
173
182
  borderBottomWidth: 1,
174
- borderBottomColor: theme.colorScheme === 'dark' ? theme.colors.dark?.[4] : theme.colors.gray?.[3],
183
+ borderBottomColor:
184
+ theme.colorScheme === 'dark'
185
+ ? theme.colors.dark?.[4]
186
+ : theme.colors.gray?.[3],
175
187
  ...(striped &&
176
188
  isEven && {
177
189
  backgroundColor:
178
- theme.colorScheme === 'dark' ? theme.colors.dark?.[6] : theme.colors.gray?.[0],
190
+ theme.colorScheme === 'dark'
191
+ ? theme.colors.dark?.[6]
192
+ : theme.colors.gray?.[0],
179
193
  }),
180
194
  },
181
195
  })
@@ -218,7 +232,9 @@ const useTableCellStyles = createStyles(
218
232
  ...(withColumnBorders && {
219
233
  borderRightWidth: 1,
220
234
  borderRightColor:
221
- theme.colorScheme === 'dark' ? theme.colors.dark?.[4] : theme.colors.gray?.[3],
235
+ theme.colorScheme === 'dark'
236
+ ? theme.colors.dark?.[4]
237
+ : theme.colors.gray?.[3],
222
238
  }),
223
239
  ...(isHeader && {
224
240
  fontWeight: '600',
@@ -239,7 +255,7 @@ const defaultProps: Partial<TableProps> = {
239
255
  captionSide: 'top',
240
256
  };
241
257
 
242
- export const Table = forwardRef<any, TableProps>((props, ref) => {
258
+ const Table = forwardRef<any, TableProps>((props, ref) => {
243
259
  const {
244
260
  children,
245
261
  horizontalSpacing,
@@ -255,7 +271,7 @@ export const Table = forwardRef<any, TableProps>((props, ref) => {
255
271
  ...others
256
272
  } = useComponentDefaultProps('Table', defaultProps, props);
257
273
 
258
- const { styles, sx} = useTableStyles(
274
+ const { styles, sx } = useTableStyles(
259
275
  { withBorder, captionSide },
260
276
  { name: 'Table' }
261
277
  ) as any;
@@ -272,7 +288,11 @@ export const Table = forwardRef<any, TableProps>((props, ref) => {
272
288
  horizontalSpacing: horizontalSpacing!,
273
289
  }}
274
290
  >
275
- <ScrollView horizontal style={styles.wrapper} showsHorizontalScrollIndicator>
291
+ <ScrollView
292
+ horizontal
293
+ style={styles.wrapper}
294
+ showsHorizontalScrollIndicator
295
+ >
276
296
  <BoxView ref={ref} style={sx(styles.root, style)} {...others}>
277
297
  {caption && <Text style={styles.caption}>{caption}</Text>}
278
298
  {children}
@@ -282,9 +302,9 @@ export const Table = forwardRef<any, TableProps>((props, ref) => {
282
302
  );
283
303
  });
284
304
 
285
- export const Thead = forwardRef<any, TableTheadProps>((props, ref) => {
286
- const { children, style, ...others} = props;
287
- const { styles, sx} = useTableHeadStyles({}, { name: 'Thead' }) as any;
305
+ const Thead = forwardRef<any, TableTheadProps>((props, ref) => {
306
+ const { children, style, ...others } = props;
307
+ const { styles, sx } = useTableHeadStyles({}, { name: 'Thead' }) as any;
288
308
 
289
309
  return (
290
310
  <BoxView ref={ref} style={sx(styles.thead, style)} {...others}>
@@ -293,7 +313,7 @@ export const Thead = forwardRef<any, TableTheadProps>((props, ref) => {
293
313
  );
294
314
  });
295
315
 
296
- export const Tbody = forwardRef<any, TableTbodyProps>((props, ref) => {
316
+ const Tbody = forwardRef<any, TableTbodyProps>((props, ref) => {
297
317
  const { children, style, ...others } = props;
298
318
 
299
319
  const childrenArray = React.Children.toArray(children);
@@ -302,16 +322,19 @@ export const Tbody = forwardRef<any, TableTbodyProps>((props, ref) => {
302
322
  <BoxView ref={ref} style={style} {...others}>
303
323
  {childrenArray.map((child, index) => {
304
324
  if (!React.isValidElement(child)) return child;
305
- return React.cloneElement(child as React.ReactElement, {
306
- key: index,
307
- __index: index,
308
- });
325
+ return React.cloneElement<TableTrProps>(
326
+ child as React.ReactElement<TableTrProps>,
327
+ {
328
+ key: index,
329
+ __index: index,
330
+ }
331
+ );
309
332
  })}
310
333
  </BoxView>
311
334
  );
312
335
  });
313
336
 
314
- export const Tfoot = forwardRef<any, TableTfootProps>((props, ref) => {
337
+ const Tfoot = forwardRef<any, TableTfootProps>((props, ref) => {
315
338
  const { children, style, ...others } = props;
316
339
 
317
340
  return (
@@ -321,11 +344,11 @@ export const Tfoot = forwardRef<any, TableTfootProps>((props, ref) => {
321
344
  );
322
345
  });
323
346
 
324
- export const Tr = forwardRef<any, TableTrProps>((props, ref) => {
325
- const { children, style, __index, ...others} = props;
347
+ const Tr = forwardRef<any, TableTrProps>((props, ref) => {
348
+ const { children, style, __index, ...others } = props;
326
349
  const context = useTableContext();
327
350
 
328
- const { styles, sx} = useTableRowStyles(
351
+ const { styles, sx } = useTableRowStyles(
329
352
  {
330
353
  striped: context?.striped ?? false,
331
354
  highlightOnHover: context?.highlightOnHover ?? false,
@@ -341,11 +364,11 @@ export const Tr = forwardRef<any, TableTrProps>((props, ref) => {
341
364
  );
342
365
  });
343
366
 
344
- export const Th = forwardRef<any, TableThProps>((props, ref) => {
345
- const { children, style, ...others} = props;
367
+ const Th = forwardRef<any, TableThProps>((props, ref) => {
368
+ const { children, style, ...others } = props;
346
369
  const context = useTableContext();
347
370
 
348
- const { styles, sx} = useTableCellStyles(
371
+ const { styles, sx } = useTableCellStyles(
349
372
  {
350
373
  fontSize: context?.fontSize ?? 'sm',
351
374
  verticalSpacing: context?.verticalSpacing ?? 'xs',
@@ -358,16 +381,16 @@ export const Th = forwardRef<any, TableThProps>((props, ref) => {
358
381
 
359
382
  return (
360
383
  <BoxView ref={ref} style={sx(styles.cell, style)} {...others}>
361
- {typeof children === 'string' ? <Text style={styles.cell}>{children}</Text> : children}
384
+ <Text style={styles.cell}>{children}</Text>)
362
385
  </BoxView>
363
386
  );
364
387
  });
365
388
 
366
- export const Td = forwardRef<any, TableTdProps>((props, ref) => {
367
- const { children, style, ...others} = props;
389
+ const Td = forwardRef<any, TableTdProps>((props, ref) => {
390
+ const { children, style, ...others } = props;
368
391
  const context = useTableContext();
369
392
 
370
- const { styles, sx} = useTableCellStyles(
393
+ const { styles, sx } = useTableCellStyles(
371
394
  {
372
395
  fontSize: context?.fontSize ?? 'sm',
373
396
  verticalSpacing: context?.verticalSpacing ?? 'xs',
@@ -380,7 +403,7 @@ export const Td = forwardRef<any, TableTdProps>((props, ref) => {
380
403
 
381
404
  return (
382
405
  <BoxView ref={ref} style={sx(styles.cell, style)} {...others}>
383
- {typeof children === 'string' ? <Text style={styles.cell}>{children}</Text> : children}
406
+ <Text style={styles.cell}>{children}</Text>
384
407
  </BoxView>
385
408
  );
386
409
  });
@@ -393,10 +416,24 @@ Tr.displayName = 'Table.Tr';
393
416
  Th.displayName = 'Table.Th';
394
417
  Td.displayName = 'Table.Td';
395
418
 
396
- // Attach sub-components
397
- (Table as any).Thead = Thead;
398
- (Table as any).Tbody = Tbody;
399
- (Table as any).Tfoot = Tfoot;
400
- (Table as any).Tr = Tr;
401
- (Table as any).Th = Th;
402
- (Table as any).Td = Td;
419
+ // Attach sub-components with proper typing
420
+ interface TableComponent extends React.ForwardRefExoticComponent<
421
+ TableProps & React.RefAttributes<any>
422
+ > {
423
+ Thead: typeof Thead;
424
+ Tbody: typeof Tbody;
425
+ Tfoot: typeof Tfoot;
426
+ Tr: typeof Tr;
427
+ Th: typeof Th;
428
+ Td: typeof Td;
429
+ }
430
+
431
+ const TableWithSubComponents = Table as TableComponent;
432
+ TableWithSubComponents.Thead = Thead;
433
+ TableWithSubComponents.Tbody = Tbody;
434
+ TableWithSubComponents.Tfoot = Tfoot;
435
+ TableWithSubComponents.Tr = Tr;
436
+ TableWithSubComponents.Th = Th;
437
+ TableWithSubComponents.Td = Td;
438
+
439
+ export { TableWithSubComponents as Table };
@@ -1,5 +1,8 @@
1
1
  import React, { forwardRef } from 'react';
2
- import { TextInput as RNTextInput, type TextInputProps as RNTextInputProps } from 'react-native';
2
+ import {
3
+ TextInput as RNTextInput,
4
+ type TextInputProps as RNTextInputProps,
5
+ } from 'react-native';
3
6
  import { BoxView } from '../BoxView';
4
7
  import { Text } from '../Text';
5
8
  import type {
@@ -12,7 +15,8 @@ import { createStyles, getSize } from '../../theme';
12
15
  import { rem } from '../../theme/utils/rem';
13
16
  import { INPUT_SIZES } from '../Input';
14
17
 
15
- export interface TextInputProps extends DefaultProps, Omit<RNTextInputProps, 'style'> {
18
+ export interface TextInputProps
19
+ extends DefaultProps, Omit<RNTextInputProps, 'style'> {
16
20
  /** Input label */
17
21
  label?: React.ReactNode;
18
22
 
@@ -71,7 +75,10 @@ const useStyles = createStyles(
71
75
  const getVariantStyles = () => {
72
76
  if (variant === 'filled') {
73
77
  return {
74
- backgroundColor: theme.colorScheme === 'dark' ? (theme.colors.dark || [])[5] : (theme.colors.gray || [])[1],
78
+ backgroundColor:
79
+ theme.colorScheme === 'dark'
80
+ ? (theme.colors.dark || [])[5]
81
+ : (theme.colors.gray || [])[1],
75
82
  borderWidth: 1,
76
83
  borderColor: 'transparent',
77
84
  };
@@ -87,13 +94,20 @@ const useStyles = createStyles(
87
94
 
88
95
  // default variant
89
96
  return {
90
- backgroundColor: theme.colorScheme === 'dark' ? (theme.colors.dark || [])[6] : theme.white,
97
+ backgroundColor:
98
+ theme.colorScheme === 'dark'
99
+ ? (theme.colors.dark || [])[6]
100
+ : theme.white,
91
101
  borderWidth: 1,
92
- borderColor: theme.colorScheme === 'dark' ? (theme.colors.dark || [])[4] : (theme.colors.gray || [])[4],
102
+ borderColor:
103
+ theme.colorScheme === 'dark'
104
+ ? (theme.colors.dark || [])[4]
105
+ : (theme.colors.gray || [])[4],
93
106
  };
94
107
  };
95
108
 
96
- const sizeValue = INPUT_SIZES[size as keyof typeof INPUT_SIZES] || INPUT_SIZES.md;
109
+ const sizeValue =
110
+ INPUT_SIZES[size as keyof typeof INPUT_SIZES] || INPUT_SIZES.md;
97
111
 
98
112
  return {
99
113
  wrapper: {
@@ -102,7 +116,10 @@ const useStyles = createStyles(
102
116
  label: {
103
117
  fontSize: theme.fontSizes.sm as number,
104
118
  fontWeight: '500',
105
- color: theme.colorScheme === 'dark' ? (theme.colors.dark || [])[0] : theme.black,
119
+ color:
120
+ theme.colorScheme === 'dark'
121
+ ? (theme.colors.dark || [])[0]
122
+ : theme.black,
106
123
  marginBottom: theme.spacing.xs / 2,
107
124
  },
108
125
  required: {
@@ -110,7 +127,10 @@ const useStyles = createStyles(
110
127
  },
111
128
  description: {
112
129
  fontSize: theme.fontSizes.xs as number,
113
- color: theme.colorScheme === 'dark' ? (theme.colors.dark || [])[2] : (theme.colors.gray || [])[6],
130
+ color:
131
+ theme.colorScheme === 'dark'
132
+ ? (theme.colors.dark || [])[2]
133
+ : (theme.colors.gray || [])[6],
114
134
  marginTop: theme.spacing.xs / 2,
115
135
  marginBottom: theme.spacing.xs / 2,
116
136
  },
@@ -123,23 +143,30 @@ const useStyles = createStyles(
123
143
  position: 'relative',
124
144
  },
125
145
  input: {
126
- ...theme.fn.fontStyles(),
127
146
  height: sizeValue as any,
128
147
  fontSize: getSize({ size, sizes: theme.fontSizes }) as any,
129
148
  paddingHorizontal: (variant === 'unstyled' ? 0 : rem(12)) as any,
130
- paddingLeft: (withIcon ? sizeValue : variant === 'unstyled' ? 0 : rem(12)) as any,
149
+ paddingLeft: (withIcon
150
+ ? sizeValue
151
+ : variant === 'unstyled'
152
+ ? 0
153
+ : rem(12)) as any,
131
154
  paddingRight: (withRightSection
132
155
  ? rem(rightSectionWidth || sizeValue)
133
156
  : variant === 'unstyled'
134
- ? 0
135
- : rem(12)) as any,
157
+ ? 0
158
+ : rem(12)) as any,
136
159
  borderRadius: theme.fn.radius(radius),
137
- color: theme.colorScheme === 'dark' ? (theme.colors.dark || [])[0] : theme.black,
160
+ color:
161
+ theme.colorScheme === 'dark'
162
+ ? (theme.colors.dark || [])[0]
163
+ : theme.black,
138
164
  ...getVariantStyles(),
139
165
  ...(invalid && {
140
166
  borderColor: (theme.colors.red || [])[6],
141
167
  color: (theme.colors.red || [])[6],
142
168
  }),
169
+ fontFamily: theme.fontFamilyInput,
143
170
  },
144
171
  icon: {
145
172
  position: 'absolute',
@@ -171,62 +198,62 @@ const defaultProps: Partial<TextInputProps> = {
171
198
  required: false,
172
199
  };
173
200
 
174
- export const TextInput = forwardRef<RNTextInput, TextInputProps>((props, ref) => {
175
- const {
176
- label,
177
- description,
178
- error,
179
- size,
180
- radius,
181
- icon,
182
- rightSection,
183
- rightSectionWidth,
184
- required,
185
- variant,
186
- style,
187
- wrapperStyle,
188
- ...others
189
- } = useComponentDefaultProps('TextInput', defaultProps, props);
190
-
191
- const { styles, sx} = useStyles(
192
- {
201
+ export const TextInput = forwardRef<RNTextInput, TextInputProps>(
202
+ (props, ref) => {
203
+ const {
204
+ label,
205
+ description,
206
+ error,
207
+ size,
193
208
  radius,
194
- invalid: !!error,
195
- withIcon: !!icon,
196
- withRightSection: !!rightSection,
209
+ icon,
210
+ rightSection,
197
211
  rightSectionWidth,
198
- },
199
- { name: 'TextInput', variant, size }
200
- ) as any;
201
-
202
- return (
203
- <BoxView style={sx(styles.wrapper, wrapperStyle)}>
204
- {label && (
205
- <Text style={styles.label}>
206
- {label}
207
- {required && <Text style={styles.required}> *</Text>}
208
- </Text>
209
- )}
210
-
211
- {description && <Text style={styles.description}>{description}</Text>}
212
-
213
- <BoxView style={styles.inputWrapper}>
214
- {icon && <BoxView style={styles.icon}>{icon}</BoxView>}
215
-
216
- <RNTextInput
217
- ref={ref}
218
- style={sx(styles.input, style)}
219
- {...others}
220
- />
221
-
222
- {rightSection && (
223
- <BoxView style={styles.rightSectionContainer}>{rightSection}</BoxView>
212
+ required,
213
+ variant,
214
+ style,
215
+ wrapperStyle,
216
+ ...others
217
+ } = useComponentDefaultProps('TextInput', defaultProps, props);
218
+
219
+ const { styles, sx } = useStyles(
220
+ {
221
+ radius,
222
+ invalid: !!error,
223
+ withIcon: !!icon,
224
+ withRightSection: !!rightSection,
225
+ rightSectionWidth,
226
+ },
227
+ { name: 'TextInput', variant, size }
228
+ ) as any;
229
+
230
+ return (
231
+ <BoxView style={sx(styles.wrapper, wrapperStyle)}>
232
+ {label && (
233
+ <Text style={styles.label}>
234
+ {label}
235
+ {required && <Text style={styles.required}> *</Text>}
236
+ </Text>
224
237
  )}
225
- </BoxView>
226
238
 
227
- {error && <Text style={styles.error}>{error}</Text>}
228
- </BoxView>
229
- );
230
- });
239
+ {description && <Text style={styles.description}>{description}</Text>}
240
+
241
+ <BoxView style={styles.inputWrapper}>
242
+ {icon && <BoxView style={styles.icon}>{icon}</BoxView>}
243
+
244
+ <RNTextInput ref={ref} style={sx(styles.input, style)} {...others} />
245
+
246
+ {rightSection && (
247
+ <BoxView style={styles.rightSectionContainer}>
248
+ {rightSection}
249
+ </BoxView>
250
+ )}
251
+ </BoxView>
252
+
253
+ {error && <Text style={styles.error}>{error}</Text>}
254
+ </BoxView>
255
+ );
256
+ }
257
+ );
231
258
 
232
259
  TextInput.displayName = 'TextInput';