react-native-mantine 0.5.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 (248) hide show
  1. package/README.md +0 -357
  2. package/lib/commonjs/components/Button/Button.styles.js +4 -4
  3. package/lib/commonjs/components/Button/Button.styles.js.map +1 -1
  4. package/lib/commonjs/components/Button/index.js +15 -14
  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/List/index.js.map +1 -1
  18. package/lib/commonjs/components/Menu/index.js +11 -10
  19. package/lib/commonjs/components/Menu/index.js.map +1 -1
  20. package/lib/commonjs/components/Modal/index.js +10 -16
  21. package/lib/commonjs/components/Modal/index.js.map +1 -1
  22. package/lib/commonjs/components/Notification/index.js +12 -5
  23. package/lib/commonjs/components/Notification/index.js.map +1 -1
  24. package/lib/commonjs/components/NumberInput/index.js +2 -1
  25. package/lib/commonjs/components/NumberInput/index.js.map +1 -1
  26. package/lib/commonjs/components/PasswordInput/index.js +5 -6
  27. package/lib/commonjs/components/PasswordInput/index.js.map +1 -1
  28. package/lib/commonjs/components/PinInput/index.js +7 -2
  29. package/lib/commonjs/components/PinInput/index.js.map +1 -1
  30. package/lib/commonjs/components/Popover/index.js +8 -7
  31. package/lib/commonjs/components/Popover/index.js.map +1 -1
  32. package/lib/commonjs/components/RingProgress/index.js +49 -7
  33. package/lib/commonjs/components/RingProgress/index.js.map +1 -1
  34. package/lib/commonjs/components/SegmentedControl/index.js +7 -4
  35. package/lib/commonjs/components/SegmentedControl/index.js.map +1 -1
  36. package/lib/commonjs/components/Slider/index.js +28 -3
  37. package/lib/commonjs/components/Slider/index.js.map +1 -1
  38. package/lib/commonjs/components/Stepper/index.js.map +1 -1
  39. package/lib/commonjs/components/Table/index.js +22 -20
  40. package/lib/commonjs/components/Table/index.js.map +1 -1
  41. package/lib/commonjs/components/TextInput/index.js +2 -2
  42. package/lib/commonjs/components/TextInput/index.js.map +1 -1
  43. package/lib/commonjs/components/Timeline/index.js +12 -5
  44. package/lib/commonjs/components/Timeline/index.js.map +1 -1
  45. package/lib/commonjs/components/Tooltip/index.js +12 -11
  46. package/lib/commonjs/components/Tooltip/index.js.map +1 -1
  47. package/lib/commonjs/components/TransferList/index.js +3 -8
  48. package/lib/commonjs/components/TransferList/index.js.map +1 -1
  49. package/lib/commonjs/components/Transition/index.js +4 -0
  50. package/lib/commonjs/components/Transition/index.js.map +1 -1
  51. package/lib/commonjs/components/UnstyledButton/UnstyledButton.js +4 -0
  52. package/lib/commonjs/components/UnstyledButton/UnstyledButton.js.map +1 -1
  53. package/lib/commonjs/components/index.js +22 -22
  54. package/lib/commonjs/components/index.js.map +1 -1
  55. package/lib/commonjs/theme/functions/attach-functions.js +3 -0
  56. package/lib/commonjs/theme/functions/attach-functions.js.map +1 -1
  57. package/lib/commonjs/theme/functions/fns/helpers.js +12 -1
  58. package/lib/commonjs/theme/functions/fns/helpers.js.map +1 -1
  59. package/lib/commonjs/theme/functions/fns/index.js +4 -0
  60. package/lib/commonjs/theme/functions/fns/index.js.map +1 -1
  61. package/lib/commonjs/theme/functions/fns/rgba.js +50 -0
  62. package/lib/commonjs/theme/functions/fns/rgba.js.map +1 -0
  63. package/lib/commonjs/theme/functions/fns/size.js +19 -0
  64. package/lib/commonjs/theme/functions/fns/size.js.map +1 -0
  65. package/lib/module/components/Button/Button.styles.js +4 -4
  66. package/lib/module/components/Button/Button.styles.js.map +1 -1
  67. package/lib/module/components/Button/index.js +15 -14
  68. package/lib/module/components/Button/index.js.map +1 -1
  69. package/lib/module/components/Chip/index.js.map +1 -1
  70. package/lib/module/components/CloseButton/index.js +6 -31
  71. package/lib/module/components/CloseButton/index.js.map +1 -1
  72. package/lib/module/components/Collapse/index.js +10 -2
  73. package/lib/module/components/Collapse/index.js.map +1 -1
  74. package/lib/module/components/Dialog/index.js +52 -9
  75. package/lib/module/components/Dialog/index.js.map +1 -1
  76. package/lib/module/components/Drawer/index.js +4 -13
  77. package/lib/module/components/Drawer/index.js.map +1 -1
  78. package/lib/module/components/Icon/index.js +48 -0
  79. package/lib/module/components/Icon/index.js.map +1 -0
  80. package/lib/module/components/List/index.js.map +1 -1
  81. package/lib/module/components/Menu/index.js +9 -8
  82. package/lib/module/components/Menu/index.js.map +1 -1
  83. package/lib/module/components/Modal/index.js +10 -16
  84. package/lib/module/components/Modal/index.js.map +1 -1
  85. package/lib/module/components/Notification/index.js +12 -5
  86. package/lib/module/components/Notification/index.js.map +1 -1
  87. package/lib/module/components/NumberInput/index.js +2 -1
  88. package/lib/module/components/NumberInput/index.js.map +1 -1
  89. package/lib/module/components/PasswordInput/index.js +5 -6
  90. package/lib/module/components/PasswordInput/index.js.map +1 -1
  91. package/lib/module/components/PinInput/index.js +7 -2
  92. package/lib/module/components/PinInput/index.js.map +1 -1
  93. package/lib/module/components/Popover/index.js +9 -8
  94. package/lib/module/components/Popover/index.js.map +1 -1
  95. package/lib/module/components/RingProgress/index.js +51 -9
  96. package/lib/module/components/RingProgress/index.js.map +1 -1
  97. package/lib/module/components/SegmentedControl/index.js +7 -4
  98. package/lib/module/components/SegmentedControl/index.js.map +1 -1
  99. package/lib/module/components/Slider/index.js +28 -3
  100. package/lib/module/components/Slider/index.js.map +1 -1
  101. package/lib/module/components/Stepper/index.js.map +1 -1
  102. package/lib/module/components/Table/index.js +22 -19
  103. package/lib/module/components/Table/index.js.map +1 -1
  104. package/lib/module/components/TextInput/index.js +2 -2
  105. package/lib/module/components/TextInput/index.js.map +1 -1
  106. package/lib/module/components/Timeline/index.js +12 -5
  107. package/lib/module/components/Timeline/index.js.map +1 -1
  108. package/lib/module/components/Tooltip/index.js +11 -10
  109. package/lib/module/components/Tooltip/index.js.map +1 -1
  110. package/lib/module/components/TransferList/index.js +4 -9
  111. package/lib/module/components/TransferList/index.js.map +1 -1
  112. package/lib/module/components/Transition/index.js +5 -1
  113. package/lib/module/components/Transition/index.js.map +1 -1
  114. package/lib/module/components/UnstyledButton/UnstyledButton.js +4 -0
  115. package/lib/module/components/UnstyledButton/UnstyledButton.js.map +1 -1
  116. package/lib/module/components/index.js +1 -1
  117. package/lib/module/components/index.js.map +1 -1
  118. package/lib/module/theme/functions/attach-functions.js +3 -0
  119. package/lib/module/theme/functions/attach-functions.js.map +1 -1
  120. package/lib/module/theme/functions/fns/helpers.js +10 -0
  121. package/lib/module/theme/functions/fns/helpers.js.map +1 -1
  122. package/lib/module/theme/functions/fns/index.js +4 -0
  123. package/lib/module/theme/functions/fns/index.js.map +1 -1
  124. package/lib/module/theme/functions/fns/rgba.js +46 -0
  125. package/lib/module/theme/functions/fns/rgba.js.map +1 -0
  126. package/lib/module/theme/functions/fns/size.js +15 -0
  127. package/lib/module/theme/functions/fns/size.js.map +1 -0
  128. package/lib/typescript/commonjs/src/components/Button/index.d.ts +1 -0
  129. package/lib/typescript/commonjs/src/components/Button/index.d.ts.map +1 -1
  130. package/lib/typescript/commonjs/src/components/CloseButton/index.d.ts.map +1 -1
  131. package/lib/typescript/commonjs/src/components/Collapse/index.d.ts.map +1 -1
  132. package/lib/typescript/commonjs/src/components/Dialog/index.d.ts +2 -0
  133. package/lib/typescript/commonjs/src/components/Dialog/index.d.ts.map +1 -1
  134. package/lib/typescript/commonjs/src/components/Drawer/index.d.ts.map +1 -1
  135. package/lib/typescript/commonjs/src/components/Icon/index.d.ts +26 -0
  136. package/lib/typescript/commonjs/src/components/Icon/index.d.ts.map +1 -0
  137. package/lib/typescript/commonjs/src/components/Menu/index.d.ts.map +1 -1
  138. package/lib/typescript/commonjs/src/components/Modal/index.d.ts.map +1 -1
  139. package/lib/typescript/commonjs/src/components/Notification/index.d.ts.map +1 -1
  140. package/lib/typescript/commonjs/src/components/NumberInput/index.d.ts.map +1 -1
  141. package/lib/typescript/commonjs/src/components/PinInput/index.d.ts.map +1 -1
  142. package/lib/typescript/commonjs/src/components/Popover/index.d.ts.map +1 -1
  143. package/lib/typescript/commonjs/src/components/RingProgress/index.d.ts.map +1 -1
  144. package/lib/typescript/commonjs/src/components/SegmentedControl/index.d.ts.map +1 -1
  145. package/lib/typescript/commonjs/src/components/Slider/index.d.ts.map +1 -1
  146. package/lib/typescript/commonjs/src/components/Stepper/index.d.ts.map +1 -1
  147. package/lib/typescript/commonjs/src/components/Table/index.d.ts +16 -7
  148. package/lib/typescript/commonjs/src/components/Table/index.d.ts.map +1 -1
  149. package/lib/typescript/commonjs/src/components/TextInput/index.d.ts.map +1 -1
  150. package/lib/typescript/commonjs/src/components/Timeline/index.d.ts.map +1 -1
  151. package/lib/typescript/commonjs/src/components/Tooltip/index.d.ts.map +1 -1
  152. package/lib/typescript/commonjs/src/components/TransferList/index.d.ts.map +1 -1
  153. package/lib/typescript/commonjs/src/components/Transition/index.d.ts.map +1 -1
  154. package/lib/typescript/commonjs/src/components/UnstyledButton/UnstyledButton.d.ts +2 -0
  155. package/lib/typescript/commonjs/src/components/UnstyledButton/UnstyledButton.d.ts.map +1 -1
  156. package/lib/typescript/commonjs/src/components/index.d.ts +1 -1
  157. package/lib/typescript/commonjs/src/components/index.d.ts.map +1 -1
  158. package/lib/typescript/commonjs/src/theme/functions/attach-functions.d.ts.map +1 -1
  159. package/lib/typescript/commonjs/src/theme/functions/fns/helpers.d.ts +7 -0
  160. package/lib/typescript/commonjs/src/theme/functions/fns/helpers.d.ts.map +1 -1
  161. package/lib/typescript/commonjs/src/theme/functions/fns/index.d.ts +7 -0
  162. package/lib/typescript/commonjs/src/theme/functions/fns/index.d.ts.map +1 -1
  163. package/lib/typescript/commonjs/src/theme/functions/fns/rgba.d.ts +8 -0
  164. package/lib/typescript/commonjs/src/theme/functions/fns/rgba.d.ts.map +1 -0
  165. package/lib/typescript/commonjs/src/theme/functions/fns/size.d.ts +6 -0
  166. package/lib/typescript/commonjs/src/theme/functions/fns/size.d.ts.map +1 -0
  167. package/lib/typescript/module/src/components/Button/index.d.ts +1 -0
  168. package/lib/typescript/module/src/components/Button/index.d.ts.map +1 -1
  169. package/lib/typescript/module/src/components/CloseButton/index.d.ts.map +1 -1
  170. package/lib/typescript/module/src/components/Collapse/index.d.ts.map +1 -1
  171. package/lib/typescript/module/src/components/Dialog/index.d.ts +2 -0
  172. package/lib/typescript/module/src/components/Dialog/index.d.ts.map +1 -1
  173. package/lib/typescript/module/src/components/Drawer/index.d.ts.map +1 -1
  174. package/lib/typescript/module/src/components/Icon/index.d.ts +26 -0
  175. package/lib/typescript/module/src/components/Icon/index.d.ts.map +1 -0
  176. package/lib/typescript/module/src/components/Menu/index.d.ts.map +1 -1
  177. package/lib/typescript/module/src/components/Modal/index.d.ts.map +1 -1
  178. package/lib/typescript/module/src/components/Notification/index.d.ts.map +1 -1
  179. package/lib/typescript/module/src/components/NumberInput/index.d.ts.map +1 -1
  180. package/lib/typescript/module/src/components/PinInput/index.d.ts.map +1 -1
  181. package/lib/typescript/module/src/components/Popover/index.d.ts.map +1 -1
  182. package/lib/typescript/module/src/components/RingProgress/index.d.ts.map +1 -1
  183. package/lib/typescript/module/src/components/SegmentedControl/index.d.ts.map +1 -1
  184. package/lib/typescript/module/src/components/Slider/index.d.ts.map +1 -1
  185. package/lib/typescript/module/src/components/Stepper/index.d.ts.map +1 -1
  186. package/lib/typescript/module/src/components/Table/index.d.ts +16 -7
  187. package/lib/typescript/module/src/components/Table/index.d.ts.map +1 -1
  188. package/lib/typescript/module/src/components/TextInput/index.d.ts.map +1 -1
  189. package/lib/typescript/module/src/components/Timeline/index.d.ts.map +1 -1
  190. package/lib/typescript/module/src/components/Tooltip/index.d.ts.map +1 -1
  191. package/lib/typescript/module/src/components/TransferList/index.d.ts.map +1 -1
  192. package/lib/typescript/module/src/components/Transition/index.d.ts.map +1 -1
  193. package/lib/typescript/module/src/components/UnstyledButton/UnstyledButton.d.ts +2 -0
  194. package/lib/typescript/module/src/components/UnstyledButton/UnstyledButton.d.ts.map +1 -1
  195. package/lib/typescript/module/src/components/index.d.ts +1 -1
  196. package/lib/typescript/module/src/components/index.d.ts.map +1 -1
  197. package/lib/typescript/module/src/theme/functions/attach-functions.d.ts.map +1 -1
  198. package/lib/typescript/module/src/theme/functions/fns/helpers.d.ts +7 -0
  199. package/lib/typescript/module/src/theme/functions/fns/helpers.d.ts.map +1 -1
  200. package/lib/typescript/module/src/theme/functions/fns/index.d.ts +7 -0
  201. package/lib/typescript/module/src/theme/functions/fns/index.d.ts.map +1 -1
  202. package/lib/typescript/module/src/theme/functions/fns/rgba.d.ts +8 -0
  203. package/lib/typescript/module/src/theme/functions/fns/rgba.d.ts.map +1 -0
  204. package/lib/typescript/module/src/theme/functions/fns/size.d.ts +6 -0
  205. package/lib/typescript/module/src/theme/functions/fns/size.d.ts.map +1 -0
  206. package/package.json +12 -9
  207. package/src/components/Button/Button.styles.ts +3 -3
  208. package/src/components/Button/index.tsx +56 -61
  209. package/src/components/Chip/index.tsx +3 -3
  210. package/src/components/CloseButton/index.tsx +2 -23
  211. package/src/components/Collapse/index.tsx +11 -2
  212. package/src/components/Dialog/index.tsx +54 -9
  213. package/src/components/Drawer/index.tsx +7 -13
  214. package/src/components/Icon/index.tsx +74 -0
  215. package/src/components/List/index.tsx +1 -1
  216. package/src/components/Menu/index.tsx +13 -10
  217. package/src/components/Modal/index.tsx +11 -16
  218. package/src/components/Notification/index.tsx +10 -2
  219. package/src/components/NumberInput/index.tsx +57 -15
  220. package/src/components/PasswordInput/index.tsx +2 -2
  221. package/src/components/PinInput/index.tsx +24 -9
  222. package/src/components/Popover/index.tsx +13 -10
  223. package/src/components/RingProgress/index.tsx +51 -8
  224. package/src/components/SegmentedControl/index.tsx +6 -4
  225. package/src/components/Slider/index.tsx +14 -3
  226. package/src/components/Stepper/index.tsx +5 -4
  227. package/src/components/Table/index.tsx +73 -36
  228. package/src/components/TextInput/index.tsx +93 -66
  229. package/src/components/Timeline/index.tsx +19 -12
  230. package/src/components/Tooltip/index.tsx +13 -10
  231. package/src/components/TransferList/index.tsx +1 -5
  232. package/src/components/Transition/index.tsx +14 -2
  233. package/src/components/UnstyledButton/UnstyledButton.tsx +5 -1
  234. package/src/components/index.tsx +1 -1
  235. package/src/theme/functions/attach-functions.ts +3 -0
  236. package/src/theme/functions/fns/helpers.ts +19 -7
  237. package/src/theme/functions/fns/index.ts +4 -0
  238. package/src/theme/functions/fns/rgba.ts +45 -0
  239. package/src/theme/functions/fns/size.ts +14 -0
  240. package/lib/commonjs/components/Portal/index.js +0 -69
  241. package/lib/commonjs/components/Portal/index.js.map +0 -1
  242. package/lib/module/components/Portal/index.js +0 -62
  243. package/lib/module/components/Portal/index.js.map +0 -1
  244. package/lib/typescript/commonjs/src/components/Portal/index.d.ts +0 -10
  245. package/lib/typescript/commonjs/src/components/Portal/index.d.ts.map +0 -1
  246. package/lib/typescript/module/src/components/Portal/index.d.ts +0 -10
  247. package/lib/typescript/module/src/components/Portal/index.d.ts.map +0 -1
  248. package/src/components/Portal/index.tsx +0 -75
@@ -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';
@@ -244,12 +244,15 @@ const TimelineRoot = forwardRef<any, TimelineProps>((props, ref) => {
244
244
  ? index >= itemsCount - (active! + 1)
245
245
  : index <= active!;
246
246
 
247
- return React.cloneElement(child as React.ReactElement, {
248
- key: index,
249
- __index: index,
250
- __isLast: index === itemsCount - 1,
251
- __isActive: isActive,
252
- });
247
+ return React.cloneElement<TimelineItemProps & { __isActive?: boolean }>(
248
+ child as React.ReactElement<TimelineItemProps & { __isActive?: boolean }>,
249
+ {
250
+ key: index,
251
+ __index: index,
252
+ __isLast: index === itemsCount - 1,
253
+ __isActive: isActive,
254
+ }
255
+ );
253
256
  })}
254
257
  </BoxView>
255
258
  </TimelineContext.Provider>
@@ -304,14 +307,18 @@ export const TimelineItem = forwardRef<
304
307
 
305
308
  <BoxView style={styles.itemBody}>
306
309
  {title && (
307
- <Text style={styles.title}>
308
- {typeof title === 'string' ? title : title}
309
- </Text>
310
+ typeof title === 'string' ? (
311
+ <Text style={styles.title}>{title}</Text>
312
+ ) : (
313
+ <BoxView style={{ marginBottom: rem(4) }}>{title}</BoxView>
314
+ )
310
315
  )}
311
316
  {children && (
312
- <Text style={styles.content}>
313
- {typeof children === 'string' ? children : children}
314
- </Text>
317
+ typeof children === 'string' ? (
318
+ <Text style={styles.content}>{children}</Text>
319
+ ) : (
320
+ <BoxView>{children}</BoxView>
321
+ )
315
322
  )}
316
323
  </BoxView>
317
324
  </BoxView>
@@ -4,9 +4,9 @@ import {
4
4
  TouchableWithoutFeedback,
5
5
  Animated,
6
6
  Platform,
7
+ Modal,
7
8
  } from 'react-native';
8
9
  import { Text } from '../Text';
9
- import { Portal } from '../Portal';
10
10
  import type {
11
11
  DefaultProps,
12
12
  MantineColor,
@@ -210,7 +210,7 @@ export const Tooltip = forwardRef<any, TooltipProps>((props, _ref) => {
210
210
  ? { onLongPress: show }
211
211
  : { onPress: show, onPressOut: hide };
212
212
 
213
- const childWithRef = React.cloneElement(children, {
213
+ const childWithRef = React.cloneElement(children as React.ReactElement<any>, {
214
214
  ref: targetRef,
215
215
  ...triggerProps,
216
216
  });
@@ -219,16 +219,18 @@ export const Tooltip = forwardRef<any, TooltipProps>((props, _ref) => {
219
219
  <>
220
220
  {childWithRef}
221
221
  {isVisible && (
222
- <Portal>
222
+ <Modal
223
+ visible={isVisible}
224
+ transparent
225
+ animationType="none"
226
+ onRequestClose={hide}
227
+ statusBarTranslucent
228
+ >
223
229
  <TouchableWithoutFeedback onPress={hide}>
224
230
  <View
225
231
  style={{
226
- position: 'absolute',
227
- top: 0,
228
- left: 0,
229
- right: 0,
230
- bottom: 0,
231
- zIndex,
232
+ flex: 1,
233
+ backgroundColor: 'transparent',
232
234
  }}
233
235
  >
234
236
  <Animated.View
@@ -238,6 +240,7 @@ export const Tooltip = forwardRef<any, TooltipProps>((props, _ref) => {
238
240
  top: tooltipPosition.top,
239
241
  left: tooltipPosition.left,
240
242
  opacity,
243
+ zIndex,
241
244
  },
242
245
  ]}
243
246
  {...others}
@@ -250,7 +253,7 @@ export const Tooltip = forwardRef<any, TooltipProps>((props, _ref) => {
250
253
  </Animated.View>
251
254
  </View>
252
255
  </TouchableWithoutFeedback>
253
- </Portal>
256
+ </Modal>
254
257
  )}
255
258
  </>
256
259
  );
@@ -184,14 +184,10 @@ const defaultProps: Partial<TransferListProps> = {
184
184
  };
185
185
 
186
186
  const DefaultItem: React.FC<{ data: TransferListDataItem; selected: boolean }> = ({
187
- data,
188
187
  selected,
189
188
  }) => {
190
189
  return (
191
- <>
192
- <Checkbox checked={selected} onChange={() => {}} />
193
- <Text>{data.label}</Text>
194
- </>
190
+ <Checkbox checked={selected} onChange={() => {}} />
195
191
  );
196
192
  };
197
193