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
@@ -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
 
@@ -1,4 +1,4 @@
1
- import React, { forwardRef, useEffect, useRef } from 'react';
1
+ import React, { forwardRef, useEffect, useRef, useState } from 'react';
2
2
  import { Animated, Easing } from 'react-native';
3
3
  import type { DefaultProps } from '../../theme/types';
4
4
  import { useComponentDefaultProps } from '../../theme/theme-provider';
@@ -83,6 +83,7 @@ export const Transition = forwardRef<any, TransitionProps>((props, ref) => {
83
83
 
84
84
  const animation = useRef(new Animated.Value(mounted ? 1 : 0)).current;
85
85
  const shouldRender = useRef(mounted);
86
+ const [_exited, setExited] = useState(true);
86
87
 
87
88
  useEffect(() => {
88
89
  if (mounted) {
@@ -96,6 +97,7 @@ export const Transition = forwardRef<any, TransitionProps>((props, ref) => {
96
97
  if (finished && onEntered) {
97
98
  onEntered();
98
99
  }
100
+ setExited(false);
99
101
  });
100
102
  } else {
101
103
  Animated.timing(animation, {
@@ -104,15 +106,25 @@ export const Transition = forwardRef<any, TransitionProps>((props, ref) => {
104
106
  easing: getEasing(timingFunction || 'ease'),
105
107
  useNativeDriver: true,
106
108
  }).start(({ finished }) => {
109
+ console.log('finished', finished);
107
110
  if (finished) {
108
111
  shouldRender.current = false;
109
112
  if (onExited) {
110
113
  onExited();
111
114
  }
115
+ setExited(true);
112
116
  }
113
117
  });
114
118
  }
115
- }, [mounted, duration, exitDuration, timingFunction, onEntered, onExited, animation]);
119
+ }, [
120
+ mounted,
121
+ duration,
122
+ exitDuration,
123
+ timingFunction,
124
+ onEntered,
125
+ onExited,
126
+ animation,
127
+ ]);
116
128
 
117
129
  const getTransformStyle = () => {
118
130
  switch (transition) {
@@ -8,13 +8,15 @@ export interface UnstyledButtonProps {
8
8
  variant?: string;
9
9
  children?: React.ReactNode;
10
10
  onPress?: (payload: any) => void;
11
+ disabled?: boolean;
12
+ activeOpacity?: number;
11
13
  }
12
14
 
13
15
  export const UnstyledButton = forwardRef<
14
16
  any,
15
17
  UnstyledButtonProps & { style?: any }
16
18
  >((props, ref) => {
17
- const { variant, style, children, onPress, ...others } =
19
+ const { variant, style, children, onPress, disabled, activeOpacity, ...others } =
18
20
  useComponentDefaultProps('UnstyledButton', {}, props);
19
21
 
20
22
  const { styles } = useStyles({
@@ -24,6 +26,8 @@ export const UnstyledButton = forwardRef<
24
26
  return (
25
27
  <TouchableOpacity
26
28
  onPress={typeof onPress === 'function' ? onPress : () => {}}
29
+ disabled={disabled}
30
+ activeOpacity={activeOpacity !== undefined ? activeOpacity : 0.7}
27
31
  >
28
32
  <BoxView ref={ref} style={[styles.root, style]} {...others}>
29
33
  {children}
@@ -6,6 +6,7 @@ export * from './Button';
6
6
  export * from './UnstyledButton';
7
7
  export * from './ActionIcon';
8
8
  export * from './Loader';
9
+ export * from './Icon';
9
10
 
10
11
  // Phase 1 components
11
12
  export * from './Center';
@@ -35,7 +36,6 @@ export * from './Radio';
35
36
 
36
37
  // Phase 3 components - Foundation & Utilities
37
38
  export * from './Overlay';
38
- export * from './Portal';
39
39
 
40
40
  // Phase 3 components - Interactive Components
41
41
  export * from './Modal';
@@ -8,16 +8,13 @@ export default function useCachedResources(): boolean {
8
8
  useEffect(() => {
9
9
  async function loadResourcesAndDataAsync(): Promise<void> {
10
10
  try {
11
- // SplashScreen.preventAutoHideAsync()
12
- // Load fonts
13
11
  await Font.loadAsync({
14
12
  Nunito: require('../fonts/Nunito-Regular.ttf'),
15
13
  'Nunito Bold': require('../fonts/Nunito-Bold.ttf'),
16
14
  'Nunito SemiBold': require('../fonts/Nunito-SemiBold.ttf'),
17
15
  })
18
16
  } catch (e) {
19
- // We might want to provide this error information to an error reporting service
20
- // console.warn(e)
17
+ // Error silently ignored - consider adding error reporting in production
21
18
  } finally {
22
19
  setLoadingComplete(true)
23
20
  }
@@ -5,10 +5,13 @@ export function attachFunctions(themeBase: any): any {
5
5
  ...themeBase,
6
6
  fn: {
7
7
  radius: fns.radius(themeBase),
8
+ rgba: fns.rgba(themeBase),
9
+ size: fns.size(themeBase),
8
10
  variant: fns.variant(themeBase),
9
11
  themeColor: (color: string, shade?: number) =>
10
12
  fns.themeColor({ theme: themeBase, color, shade }),
11
13
  fontStyles: fns.fontStyles(themeBase),
14
+ inputFontStyles: fns.inputFontStyles(themeBase),
12
15
  focusStyles: fns.focusStyles(themeBase),
13
16
  placeholderStyles: fns.placeholderStyles(themeBase),
14
17
  cover: fns.cover(themeBase),
@@ -4,6 +4,16 @@ export const fontStyles = (theme: MantineTheme) => () => ({
4
4
  fontFamily: theme.fontFamily,
5
5
  });
6
6
 
7
+ /**
8
+ * Returns font styles specifically for input components
9
+ * Uses fontFamilyInput if available, otherwise falls back to fontFamily
10
+ */
11
+ export const inputFontStyles = (theme: MantineTheme) => () => {
12
+ return {
13
+ fontFamily: theme.fontFamilyInput || theme.fontFamily,
14
+ };
15
+ };
16
+
7
17
  export const focusStyles = (_theme: MantineTheme) => () => ({
8
18
  // Focus styles for accessibility
9
19
  // In React Native, we typically don't use outline
@@ -15,13 +25,15 @@ export const placeholderStyles = (_theme: MantineTheme) => () => ({
15
25
  opacity: 0.6,
16
26
  });
17
27
 
18
- export const cover = (_theme: MantineTheme) => (offset: number = 0) => ({
19
- position: 'absolute' as const,
20
- top: offset,
21
- right: offset,
22
- bottom: offset,
23
- left: offset,
24
- });
28
+ export const cover =
29
+ (_theme: MantineTheme) =>
30
+ (offset: number = 0) => ({
31
+ position: 'absolute' as const,
32
+ top: offset,
33
+ right: offset,
34
+ bottom: offset,
35
+ left: offset,
36
+ });
25
37
 
26
38
  export const hover = (_theme: MantineTheme) => (styles: any) => ({
27
39
  // Hover styles (primarily for web, limited support in React Native)
@@ -1,10 +1,14 @@
1
1
  import { radius } from './radius';
2
+ import { rgba } from './rgba';
3
+ import { size } from './size';
2
4
  import { themeColor } from './theme-color/theme-color';
3
5
  import { variant } from './variant';
4
6
  import * as helpers from './helpers';
5
7
 
6
8
  export const fns = {
7
9
  radius,
10
+ rgba,
11
+ size,
8
12
  variant,
9
13
  themeColor,
10
14
  ...helpers,
@@ -0,0 +1,45 @@
1
+ /**
2
+ * Converts a hex or rgb color string to rgba with the specified alpha value
3
+ * @param color - The color string (hex or rgb)
4
+ * @param alpha - Alpha value between 0 and 1
5
+ * @returns rgba color string
6
+ */
7
+ export function rgba(_theme: any) {
8
+ return (color: string, alpha: number): string => {
9
+ // If it's already an rgba string, replace the alpha
10
+ if (color.startsWith('rgba')) {
11
+ return color.replace(/[\d.]+\)$/g, `${alpha})`);
12
+ }
13
+
14
+ // If it's an rgb string, convert to rgba
15
+ if (color.startsWith('rgb(')) {
16
+ return color.replace('rgb(', 'rgba(').replace(')', `, ${alpha})`);
17
+ }
18
+
19
+ // If it's a hex color, convert to rgba
20
+ if (color.startsWith('#')) {
21
+ const hex = color.replace('#', '');
22
+ let r = 0;
23
+ let g = 0;
24
+ let b = 0;
25
+
26
+ if (hex.length === 3) {
27
+ r = parseInt(hex[0]! + hex[0]!, 16);
28
+ g = parseInt(hex[1]! + hex[1]!, 16);
29
+ b = parseInt(hex[2]! + hex[2]!, 16);
30
+ } else if (hex.length === 6) {
31
+ r = parseInt(hex.slice(0, 2), 16);
32
+ g = parseInt(hex.slice(2, 4), 16);
33
+ b = parseInt(hex.slice(4, 6), 16);
34
+ } else {
35
+ // Invalid hex, return as is with alpha
36
+ return `rgba(0, 0, 0, ${alpha})`;
37
+ }
38
+
39
+ return `rgba(${r}, ${g}, ${b}, ${alpha})`;
40
+ }
41
+
42
+ // If we can't parse it, return as is
43
+ return color;
44
+ };
45
+ }
@@ -0,0 +1,14 @@
1
+ import type { MantineNumberSize } from '../../types';
2
+ import { getSize } from '../../get-size';
3
+
4
+ export function size(_theme: any) {
5
+ return <Sizes extends Record<any, any>>({
6
+ size,
7
+ sizes,
8
+ }: {
9
+ size: MantineNumberSize;
10
+ sizes: Sizes;
11
+ }): number => {
12
+ return getSize({ size, sizes }) as number;
13
+ };
14
+ }
@@ -6,7 +6,7 @@ import React, {
6
6
  useMemo,
7
7
  useState,
8
8
  } from 'react';
9
- import { Appearance, Platform } from 'react-native';
9
+ import { ActivityIndicator, Appearance, Platform } from 'react-native';
10
10
 
11
11
  import type { ColorSchemeName } from 'react-native';
12
12
 
@@ -17,7 +17,7 @@ import type { MantineTheme } from './default-theme';
17
17
  import { createTheme } from './create-theme';
18
18
 
19
19
  import { filterProps } from './filter-props';
20
- // import useCachedResources from '../hooks/useCachedResources';
20
+ import useCachedResources from '../hooks/useCachedResources';
21
21
 
22
22
  type ThemeProps = {
23
23
  children: ReactNode;
@@ -94,15 +94,15 @@ export const Theme = ({
94
94
  theme: themeOverwrite,
95
95
  forceMode,
96
96
  }: ThemeProps): React.ReactElement => {
97
- // const loaded = useCachedResources();
97
+ const loaded = useCachedResources();
98
98
 
99
99
  const theme = useMemo(() => {
100
100
  return createTheme(themeOverwrite);
101
101
  }, [themeOverwrite]);
102
102
 
103
- // if (!loaded) {
104
- // return <ActivityIndicator />;
105
- // }
103
+ if (!loaded) {
104
+ return <ActivityIndicator />;
105
+ }
106
106
  return (
107
107
  <ThemeProvider theme={theme} forceMode={forceMode}>
108
108
  {children}
@@ -7,56 +7,3 @@ export type SystemProp<Value> =
7
7
  export type SpacingValue = MantineNumberSize | (string & {});
8
8
 
9
9
  export type MantineStyleSystemProps = any;
10
-
11
- // export interface MantineStyleSystemProps {
12
- // m?: SystemProp<SpacingValue>;
13
- // my?: SystemProp<SpacingValue>;
14
- // mx?: SystemProp<SpacingValue>;
15
- // mt?: SystemProp<SpacingValue>;
16
- // mb?: SystemProp<SpacingValue>;
17
- // ml?: SystemProp<SpacingValue>;
18
- // mr?: SystemProp<SpacingValue>;
19
-
20
- // p?: SystemProp<SpacingValue>;
21
- // py?: SystemProp<SpacingValue>;
22
- // px?: SystemProp<SpacingValue>;
23
- // pt?: SystemProp<SpacingValue>;
24
- // pb?: SystemProp<SpacingValue>;
25
- // pl?: SystemProp<SpacingValue>;
26
- // pr?: SystemProp<SpacingValue>;
27
-
28
- // bg?: SystemProp<MantineColor>;
29
- // c?: SystemProp<MantineColor>;
30
- // opacity?: SystemProp<CSSProperties['opacity']>;
31
-
32
- // ff?: SystemProp<CSSProperties['fontFamily']>;
33
- // fz?: SystemProp<SpacingValue>;
34
- // fw?: SystemProp<CSSProperties['fontWeight']>;
35
- // lts?: SystemProp<CSSProperties['letterSpacing']>;
36
- // ta?: SystemProp<CSSProperties['textAlign']>;
37
- // lh?: SystemProp<CSSProperties['lineHeight']>;
38
- // fs?: SystemProp<CSSProperties['fontStyle']>;
39
- // tt?: SystemProp<CSSProperties['textTransform']>;
40
- // td?: SystemProp<CSSProperties['textDecoration']>;
41
-
42
- // w?: SystemProp<CSSProperties['width']>;
43
- // miw?: SystemProp<CSSProperties['minWidth']>;
44
- // maw?: SystemProp<CSSProperties['maxWidth']>;
45
- // h?: SystemProp<CSSProperties['height']>;
46
- // mih?: SystemProp<CSSProperties['minHeight']>;
47
- // mah?: SystemProp<CSSProperties['maxHeight']>;
48
-
49
- // bgsz?: SystemProp<CSSProperties['backgroundSize']>;
50
- // bgp?: SystemProp<CSSProperties['backgroundPosition']>;
51
- // bgr?: SystemProp<CSSProperties['backgroundRepeat']>;
52
- // bga?: SystemProp<CSSProperties['backgroundAttachment']>;
53
-
54
- // pos?: SystemProp<CSSProperties['position']>;
55
- // top?: SystemProp<CSSProperties['top']>;
56
- // left?: SystemProp<CSSProperties['left']>;
57
- // bottom?: SystemProp<CSSProperties['bottom']>;
58
- // right?: SystemProp<CSSProperties['right']>;
59
- // inset?: SystemProp<CSSProperties['inset']>;
60
-
61
- // display?: SystemProp<CSSProperties['display']>;
62
- // }
@@ -1,69 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.PortalProvider = exports.Portal = void 0;
7
- var _react = _interopRequireWildcard(require("react"));
8
- var _reactNative = require("react-native");
9
- var _jsxRuntime = require("react/jsx-runtime");
10
- function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
11
- const PortalContext = /*#__PURE__*/(0, _react.createContext)(null);
12
- const PortalProvider = ({
13
- children
14
- }) => {
15
- const [portals, setPortals] = (0, _react.useState)(new Map());
16
- const nextKey = _react.default.useRef(0);
17
- const mount = (0, _react.useCallback)(child => {
18
- const key = nextKey.current++;
19
- setPortals(prev => {
20
- const next = new Map(prev);
21
- next.set(key, child);
22
- return next;
23
- });
24
- return key;
25
- }, []);
26
- const unmount = (0, _react.useCallback)(key => {
27
- setPortals(prev => {
28
- const next = new Map(prev);
29
- next.delete(key);
30
- return next;
31
- });
32
- }, []);
33
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(PortalContext.Provider, {
34
- value: {
35
- mount,
36
- unmount
37
- },
38
- children: [children, /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
39
- style: _reactNative.StyleSheet.absoluteFill,
40
- pointerEvents: "box-none",
41
- children: Array.from(portals.entries()).map(([key, child]) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_react.default.Fragment, {
42
- children: child
43
- }, key))
44
- })]
45
- });
46
- };
47
- exports.PortalProvider = PortalProvider;
48
- const Portal = ({
49
- children
50
- }) => {
51
- const context = (0, _react.useContext)(PortalContext);
52
- const [, setKey] = (0, _react.useState)(null);
53
- _react.default.useEffect(() => {
54
- if (!context) {
55
- console.warn('Portal used without PortalProvider');
56
- return;
57
- }
58
- const portalKey = context.mount(children);
59
- setKey(portalKey);
60
- return () => {
61
- context.unmount(portalKey);
62
- };
63
- }, [children, context]);
64
- return null;
65
- };
66
- exports.Portal = Portal;
67
- Portal.displayName = 'Portal';
68
- PortalProvider.displayName = 'PortalProvider';
69
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_jsxRuntime","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","PortalContext","createContext","PortalProvider","children","portals","setPortals","useState","Map","nextKey","React","useRef","mount","useCallback","child","key","current","prev","next","unmount","delete","jsxs","Provider","value","jsx","View","style","StyleSheet","absoluteFill","pointerEvents","Array","from","entries","map","Fragment","exports","Portal","context","useContext","setKey","useEffect","console","warn","portalKey","displayName"],"sourceRoot":"../../../../src","sources":["components/Portal/index.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;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,CAAC;AAACoB,OAAA,CAAAhC,cAAA,GAAAA,cAAA;AAMK,MAAMiC,MAA6B,GAAGA,CAAC;EAAEhC;AAAS,CAAC,KAAK;EAC7D,MAAMiC,OAAO,GAAG,IAAAC,iBAAU,EAACrC,aAAa,CAAC;EACzC,MAAM,GAAGsC,MAAM,CAAC,GAAG,IAAAhC,eAAQ,EAAgB,IAAI,CAAC;EAEhDG,cAAK,CAAC8B,SAAS,CAAC,MAAM;IACpB,IAAI,CAACH,OAAO,EAAE;MACZI,OAAO,CAACC,IAAI,CAAC,oCAAoC,CAAC;MAClD;IACF;IAEA,MAAMC,SAAS,GAAGN,OAAO,CAACzB,KAAK,CAACR,QAAQ,CAAC;IACzCmC,MAAM,CAACI,SAAS,CAAC;IAEjB,OAAO,MAAM;MACXN,OAAO,CAAClB,OAAO,CAACwB,SAAS,CAAC;IAC5B,CAAC;EACH,CAAC,EAAE,CAACvC,QAAQ,EAAEiC,OAAO,CAAC,CAAC;EAEvB,OAAO,IAAI;AACb,CAAC;AAACF,OAAA,CAAAC,MAAA,GAAAA,MAAA;AAEFA,MAAM,CAACQ,WAAW,GAAG,QAAQ;AAC7BzC,cAAc,CAACyC,WAAW,GAAG,gBAAgB","ignoreList":[]}
@@ -1,62 +0,0 @@
1
- "use strict";
2
-
3
- import React, { createContext, useContext, useState, useCallback } from 'react';
4
- import { View, StyleSheet } from 'react-native';
5
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
6
- const PortalContext = /*#__PURE__*/createContext(null);
7
- export const PortalProvider = ({
8
- children
9
- }) => {
10
- const [portals, setPortals] = useState(new Map());
11
- const nextKey = React.useRef(0);
12
- const mount = useCallback(child => {
13
- const key = nextKey.current++;
14
- setPortals(prev => {
15
- const next = new Map(prev);
16
- next.set(key, child);
17
- return next;
18
- });
19
- return key;
20
- }, []);
21
- const unmount = useCallback(key => {
22
- setPortals(prev => {
23
- const next = new Map(prev);
24
- next.delete(key);
25
- return next;
26
- });
27
- }, []);
28
- return /*#__PURE__*/_jsxs(PortalContext.Provider, {
29
- value: {
30
- mount,
31
- unmount
32
- },
33
- children: [children, /*#__PURE__*/_jsx(View, {
34
- style: StyleSheet.absoluteFill,
35
- pointerEvents: "box-none",
36
- children: Array.from(portals.entries()).map(([key, child]) => /*#__PURE__*/_jsx(React.Fragment, {
37
- children: child
38
- }, key))
39
- })]
40
- });
41
- };
42
- export const Portal = ({
43
- children
44
- }) => {
45
- const context = useContext(PortalContext);
46
- const [, setKey] = useState(null);
47
- React.useEffect(() => {
48
- if (!context) {
49
- console.warn('Portal used without PortalProvider');
50
- return;
51
- }
52
- const portalKey = context.mount(children);
53
- setKey(portalKey);
54
- return () => {
55
- context.unmount(portalKey);
56
- };
57
- }, [children, context]);
58
- return null;
59
- };
60
- Portal.displayName = 'Portal';
61
- PortalProvider.displayName = 'PortalProvider';
62
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["React","createContext","useContext","useState","useCallback","View","StyleSheet","jsx","_jsx","jsxs","_jsxs","PortalContext","PortalProvider","children","portals","setPortals","Map","nextKey","useRef","mount","child","key","current","prev","next","set","unmount","delete","Provider","value","style","absoluteFill","pointerEvents","Array","from","entries","map","Fragment","Portal","context","setKey","useEffect","console","warn","portalKey","displayName"],"sourceRoot":"../../../../src","sources":["components/Portal/index.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,aAAa,EAAEC,UAAU,EAAEC,QAAQ,EAAEC,WAAW,QAAQ,OAAO;AAC/E,SAASC,IAAI,EAAEC,UAAU,QAAQ,cAAc;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAOhD,MAAMC,aAAa,gBAAGV,aAAa,CAA4B,IAAI,CAAC;AAMpE,OAAO,MAAMW,cAA6C,GAAGA,CAAC;EAAEC;AAAS,CAAC,KAAK;EAC7E,MAAM,CAACC,OAAO,EAAEC,UAAU,CAAC,GAAGZ,QAAQ,CAA+B,IAAIa,GAAG,C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C,KAAK;EAC7D,MAAM0B,OAAO,GAAGrC,UAAU,CAACS,aAAa,CAAC;EACzC,MAAM,GAAG6B,MAAM,CAAC,GAAGrC,QAAQ,CAAgB,IAAI,CAAC;EAEhDH,KAAK,CAACyC,SAAS,CAAC,MAAM;IACpB,IAAI,CAACF,OAAO,EAAE;MACZG,OAAO,CAACC,IAAI,CAAC,oCAAoC,CAAC;MAClD;IACF;IAEA,MAAMC,SAAS,GAAGL,OAAO,CAACpB,KAAK,CAACN,QAAQ,CAAC;IACzC2B,MAAM,CAACI,SAAS,CAAC;IAEjB,OAAO,MAAM;MACXL,OAAO,CAACb,OAAO,CAACkB,SAAS,CAAC;IAC5B,CAAC;EACH,CAAC,EAAE,CAAC/B,QAAQ,EAAE0B,OAAO,CAAC,CAAC;EAEvB,OAAO,IAAI;AACb,CAAC;AAEDD,MAAM,CAACO,WAAW,GAAG,QAAQ;AAC7BjC,cAAc,CAACiC,WAAW,GAAG,gBAAgB","ignoreList":[]}
@@ -1,10 +0,0 @@
1
- import React from 'react';
2
- export interface PortalProviderProps {
3
- children: React.ReactNode;
4
- }
5
- export declare const PortalProvider: React.FC<PortalProviderProps>;
6
- export interface PortalProps {
7
- children: React.ReactNode;
8
- }
9
- export declare const Portal: React.FC<PortalProps>;
10
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Portal/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA2D,MAAM,OAAO,CAAC;AAUhF,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CAgCxD,CAAC;AAEF,MAAM,WAAW,WAAW;IAC1B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED,eAAO,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CAmBxC,CAAC"}
@@ -1,10 +0,0 @@
1
- import React from 'react';
2
- export interface PortalProviderProps {
3
- children: React.ReactNode;
4
- }
5
- export declare const PortalProvider: React.FC<PortalProviderProps>;
6
- export interface PortalProps {
7
- children: React.ReactNode;
8
- }
9
- export declare const Portal: React.FC<PortalProps>;
10
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Portal/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA2D,MAAM,OAAO,CAAC;AAUhF,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CAgCxD,CAAC;AAEF,MAAM,WAAW,WAAW;IAC1B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED,eAAO,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CAmBxC,CAAC"}