react-native-mantine 0.5.0 → 0.7.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 (363) hide show
  1. package/README.md +1 -358
  2. package/lib/commonjs/components/Anchor/index.js +6 -1
  3. package/lib/commonjs/components/Anchor/index.js.map +1 -1
  4. package/lib/commonjs/components/Badge/index.js +12 -13
  5. package/lib/commonjs/components/Badge/index.js.map +1 -1
  6. package/lib/commonjs/components/Blockquote/index.js +8 -12
  7. package/lib/commonjs/components/Blockquote/index.js.map +1 -1
  8. package/lib/commonjs/components/Button/Button.styles.js +4 -4
  9. package/lib/commonjs/components/Button/Button.styles.js.map +1 -1
  10. package/lib/commonjs/components/Button/index.js +17 -17
  11. package/lib/commonjs/components/Button/index.js.map +1 -1
  12. package/lib/commonjs/components/Chip/index.js +8 -9
  13. package/lib/commonjs/components/Chip/index.js.map +1 -1
  14. package/lib/commonjs/components/CloseButton/index.js +5 -30
  15. package/lib/commonjs/components/CloseButton/index.js.map +1 -1
  16. package/lib/commonjs/components/Code/index.js +13 -8
  17. package/lib/commonjs/components/Code/index.js.map +1 -1
  18. package/lib/commonjs/components/Collapse/index.js +10 -2
  19. package/lib/commonjs/components/Collapse/index.js.map +1 -1
  20. package/lib/commonjs/components/Dialog/index.js +51 -8
  21. package/lib/commonjs/components/Dialog/index.js.map +1 -1
  22. package/lib/commonjs/components/Drawer/index.js +4 -13
  23. package/lib/commonjs/components/Drawer/index.js.map +1 -1
  24. package/lib/commonjs/components/Icon/index.js +53 -0
  25. package/lib/commonjs/components/Icon/index.js.map +1 -0
  26. package/lib/commonjs/components/Kbd/index.js +7 -8
  27. package/lib/commonjs/components/Kbd/index.js.map +1 -1
  28. package/lib/commonjs/components/List/index.js +6 -5
  29. package/lib/commonjs/components/List/index.js.map +1 -1
  30. package/lib/commonjs/components/Mark/index.js +4 -0
  31. package/lib/commonjs/components/Mark/index.js.map +1 -1
  32. package/lib/commonjs/components/Menu/index.js +20 -22
  33. package/lib/commonjs/components/Menu/index.js.map +1 -1
  34. package/lib/commonjs/components/Modal/index.js +10 -16
  35. package/lib/commonjs/components/Modal/index.js.map +1 -1
  36. package/lib/commonjs/components/NavLink/index.js +7 -11
  37. package/lib/commonjs/components/NavLink/index.js.map +1 -1
  38. package/lib/commonjs/components/Notification/index.js +5 -8
  39. package/lib/commonjs/components/Notification/index.js.map +1 -1
  40. package/lib/commonjs/components/NumberInput/index.js +2 -1
  41. package/lib/commonjs/components/NumberInput/index.js.map +1 -1
  42. package/lib/commonjs/components/PasswordInput/index.js +5 -6
  43. package/lib/commonjs/components/PasswordInput/index.js.map +1 -1
  44. package/lib/commonjs/components/PinInput/index.js +7 -2
  45. package/lib/commonjs/components/PinInput/index.js.map +1 -1
  46. package/lib/commonjs/components/Popover/index.js +8 -7
  47. package/lib/commonjs/components/Popover/index.js.map +1 -1
  48. package/lib/commonjs/components/RingProgress/index.js +49 -7
  49. package/lib/commonjs/components/RingProgress/index.js.map +1 -1
  50. package/lib/commonjs/components/SegmentedControl/index.js +7 -4
  51. package/lib/commonjs/components/SegmentedControl/index.js.map +1 -1
  52. package/lib/commonjs/components/Slider/index.js +28 -3
  53. package/lib/commonjs/components/Slider/index.js.map +1 -1
  54. package/lib/commonjs/components/Stepper/index.js.map +1 -1
  55. package/lib/commonjs/components/Table/Table.example.js +131 -0
  56. package/lib/commonjs/components/Table/Table.example.js.map +1 -0
  57. package/lib/commonjs/components/Table/index.js +85 -29
  58. package/lib/commonjs/components/Table/index.js.map +1 -1
  59. package/lib/commonjs/components/TextInput/index.js +2 -2
  60. package/lib/commonjs/components/TextInput/index.js.map +1 -1
  61. package/lib/commonjs/components/Timeline/index.js +12 -5
  62. package/lib/commonjs/components/Timeline/index.js.map +1 -1
  63. package/lib/commonjs/components/Title/index.js +4 -0
  64. package/lib/commonjs/components/Title/index.js.map +1 -1
  65. package/lib/commonjs/components/Tooltip/index.js +12 -11
  66. package/lib/commonjs/components/Tooltip/index.js.map +1 -1
  67. package/lib/commonjs/components/TransferList/index.js +3 -8
  68. package/lib/commonjs/components/TransferList/index.js.map +1 -1
  69. package/lib/commonjs/components/Transition/index.js +4 -0
  70. package/lib/commonjs/components/Transition/index.js.map +1 -1
  71. package/lib/commonjs/components/UnstyledButton/UnstyledButton.js +4 -0
  72. package/lib/commonjs/components/UnstyledButton/UnstyledButton.js.map +1 -1
  73. package/lib/commonjs/components/index.js +22 -22
  74. package/lib/commonjs/components/index.js.map +1 -1
  75. package/lib/commonjs/theme/functions/attach-functions.js +3 -0
  76. package/lib/commonjs/theme/functions/attach-functions.js.map +1 -1
  77. package/lib/commonjs/theme/functions/fns/helpers.js +12 -1
  78. package/lib/commonjs/theme/functions/fns/helpers.js.map +1 -1
  79. package/lib/commonjs/theme/functions/fns/index.js +4 -0
  80. package/lib/commonjs/theme/functions/fns/index.js.map +1 -1
  81. package/lib/commonjs/theme/functions/fns/rgba.js +50 -0
  82. package/lib/commonjs/theme/functions/fns/rgba.js.map +1 -0
  83. package/lib/commonjs/theme/functions/fns/size.js +19 -0
  84. package/lib/commonjs/theme/functions/fns/size.js.map +1 -0
  85. package/lib/commonjs/theme/utils/index.js +26 -0
  86. package/lib/commonjs/theme/utils/index.js.map +1 -0
  87. package/lib/commonjs/theme/utils/withTextWrapper.js +49 -0
  88. package/lib/commonjs/theme/utils/withTextWrapper.js.map +1 -0
  89. package/lib/module/components/Anchor/index.js +6 -1
  90. package/lib/module/components/Anchor/index.js.map +1 -1
  91. package/lib/module/components/Badge/index.js +5 -6
  92. package/lib/module/components/Badge/index.js.map +1 -1
  93. package/lib/module/components/Blockquote/index.js +6 -10
  94. package/lib/module/components/Blockquote/index.js.map +1 -1
  95. package/lib/module/components/Button/Button.styles.js +4 -4
  96. package/lib/module/components/Button/Button.styles.js.map +1 -1
  97. package/lib/module/components/Button/index.js +17 -17
  98. package/lib/module/components/Button/index.js.map +1 -1
  99. package/lib/module/components/Chip/index.js +5 -6
  100. package/lib/module/components/Chip/index.js.map +1 -1
  101. package/lib/module/components/CloseButton/index.js +6 -31
  102. package/lib/module/components/CloseButton/index.js.map +1 -1
  103. package/lib/module/components/Code/index.js +13 -8
  104. package/lib/module/components/Code/index.js.map +1 -1
  105. package/lib/module/components/Collapse/index.js +10 -2
  106. package/lib/module/components/Collapse/index.js.map +1 -1
  107. package/lib/module/components/Dialog/index.js +52 -9
  108. package/lib/module/components/Dialog/index.js.map +1 -1
  109. package/lib/module/components/Drawer/index.js +4 -13
  110. package/lib/module/components/Drawer/index.js.map +1 -1
  111. package/lib/module/components/Icon/index.js +48 -0
  112. package/lib/module/components/Icon/index.js.map +1 -0
  113. package/lib/module/components/Kbd/index.js +5 -6
  114. package/lib/module/components/Kbd/index.js.map +1 -1
  115. package/lib/module/components/List/index.js +6 -5
  116. package/lib/module/components/List/index.js.map +1 -1
  117. package/lib/module/components/Mark/index.js +4 -0
  118. package/lib/module/components/Mark/index.js.map +1 -1
  119. package/lib/module/components/Menu/index.js +16 -18
  120. package/lib/module/components/Menu/index.js.map +1 -1
  121. package/lib/module/components/Modal/index.js +10 -16
  122. package/lib/module/components/Modal/index.js.map +1 -1
  123. package/lib/module/components/NavLink/index.js +5 -9
  124. package/lib/module/components/NavLink/index.js.map +1 -1
  125. package/lib/module/components/Notification/index.js +5 -8
  126. package/lib/module/components/Notification/index.js.map +1 -1
  127. package/lib/module/components/NumberInput/index.js +2 -1
  128. package/lib/module/components/NumberInput/index.js.map +1 -1
  129. package/lib/module/components/PasswordInput/index.js +5 -6
  130. package/lib/module/components/PasswordInput/index.js.map +1 -1
  131. package/lib/module/components/PinInput/index.js +7 -2
  132. package/lib/module/components/PinInput/index.js.map +1 -1
  133. package/lib/module/components/Popover/index.js +9 -8
  134. package/lib/module/components/Popover/index.js.map +1 -1
  135. package/lib/module/components/RingProgress/index.js +51 -9
  136. package/lib/module/components/RingProgress/index.js.map +1 -1
  137. package/lib/module/components/SegmentedControl/index.js +7 -4
  138. package/lib/module/components/SegmentedControl/index.js.map +1 -1
  139. package/lib/module/components/Slider/index.js +28 -3
  140. package/lib/module/components/Slider/index.js.map +1 -1
  141. package/lib/module/components/Stepper/index.js.map +1 -1
  142. package/lib/module/components/Table/Table.example.js +128 -0
  143. package/lib/module/components/Table/Table.example.js.map +1 -0
  144. package/lib/module/components/Table/index.js +86 -29
  145. package/lib/module/components/Table/index.js.map +1 -1
  146. package/lib/module/components/TextInput/index.js +2 -2
  147. package/lib/module/components/TextInput/index.js.map +1 -1
  148. package/lib/module/components/Timeline/index.js +12 -5
  149. package/lib/module/components/Timeline/index.js.map +1 -1
  150. package/lib/module/components/Title/index.js +4 -0
  151. package/lib/module/components/Title/index.js.map +1 -1
  152. package/lib/module/components/Tooltip/index.js +11 -10
  153. package/lib/module/components/Tooltip/index.js.map +1 -1
  154. package/lib/module/components/TransferList/index.js +4 -9
  155. package/lib/module/components/TransferList/index.js.map +1 -1
  156. package/lib/module/components/Transition/index.js +5 -1
  157. package/lib/module/components/Transition/index.js.map +1 -1
  158. package/lib/module/components/UnstyledButton/UnstyledButton.js +4 -0
  159. package/lib/module/components/UnstyledButton/UnstyledButton.js.map +1 -1
  160. package/lib/module/components/index.js +1 -1
  161. package/lib/module/components/index.js.map +1 -1
  162. package/lib/module/theme/functions/attach-functions.js +3 -0
  163. package/lib/module/theme/functions/attach-functions.js.map +1 -1
  164. package/lib/module/theme/functions/fns/helpers.js +10 -0
  165. package/lib/module/theme/functions/fns/helpers.js.map +1 -1
  166. package/lib/module/theme/functions/fns/index.js +4 -0
  167. package/lib/module/theme/functions/fns/index.js.map +1 -1
  168. package/lib/module/theme/functions/fns/rgba.js +46 -0
  169. package/lib/module/theme/functions/fns/rgba.js.map +1 -0
  170. package/lib/module/theme/functions/fns/size.js +15 -0
  171. package/lib/module/theme/functions/fns/size.js.map +1 -0
  172. package/lib/module/theme/utils/index.js +5 -0
  173. package/lib/module/theme/utils/index.js.map +1 -0
  174. package/lib/module/theme/utils/withTextWrapper.js +45 -0
  175. package/lib/module/theme/utils/withTextWrapper.js.map +1 -0
  176. package/lib/typescript/commonjs/src/components/Anchor/index.d.ts +2 -1
  177. package/lib/typescript/commonjs/src/components/Anchor/index.d.ts.map +1 -1
  178. package/lib/typescript/commonjs/src/components/Badge/index.d.ts +2 -1
  179. package/lib/typescript/commonjs/src/components/Badge/index.d.ts.map +1 -1
  180. package/lib/typescript/commonjs/src/components/Blockquote/index.d.ts +2 -1
  181. package/lib/typescript/commonjs/src/components/Blockquote/index.d.ts.map +1 -1
  182. package/lib/typescript/commonjs/src/components/Button/index.d.ts +2 -1
  183. package/lib/typescript/commonjs/src/components/Button/index.d.ts.map +1 -1
  184. package/lib/typescript/commonjs/src/components/Chip/index.d.ts +2 -1
  185. package/lib/typescript/commonjs/src/components/Chip/index.d.ts.map +1 -1
  186. package/lib/typescript/commonjs/src/components/CloseButton/index.d.ts.map +1 -1
  187. package/lib/typescript/commonjs/src/components/Code/index.d.ts +2 -1
  188. package/lib/typescript/commonjs/src/components/Code/index.d.ts.map +1 -1
  189. package/lib/typescript/commonjs/src/components/Collapse/index.d.ts.map +1 -1
  190. package/lib/typescript/commonjs/src/components/Dialog/index.d.ts +2 -0
  191. package/lib/typescript/commonjs/src/components/Dialog/index.d.ts.map +1 -1
  192. package/lib/typescript/commonjs/src/components/Drawer/index.d.ts.map +1 -1
  193. package/lib/typescript/commonjs/src/components/Icon/index.d.ts +26 -0
  194. package/lib/typescript/commonjs/src/components/Icon/index.d.ts.map +1 -0
  195. package/lib/typescript/commonjs/src/components/Kbd/index.d.ts +2 -1
  196. package/lib/typescript/commonjs/src/components/Kbd/index.d.ts.map +1 -1
  197. package/lib/typescript/commonjs/src/components/List/index.d.ts +2 -1
  198. package/lib/typescript/commonjs/src/components/List/index.d.ts.map +1 -1
  199. package/lib/typescript/commonjs/src/components/Mark/index.d.ts +2 -1
  200. package/lib/typescript/commonjs/src/components/Mark/index.d.ts.map +1 -1
  201. package/lib/typescript/commonjs/src/components/Menu/index.d.ts +3 -2
  202. package/lib/typescript/commonjs/src/components/Menu/index.d.ts.map +1 -1
  203. package/lib/typescript/commonjs/src/components/Modal/index.d.ts.map +1 -1
  204. package/lib/typescript/commonjs/src/components/NavLink/index.d.ts +2 -1
  205. package/lib/typescript/commonjs/src/components/NavLink/index.d.ts.map +1 -1
  206. package/lib/typescript/commonjs/src/components/Notification/index.d.ts +2 -1
  207. package/lib/typescript/commonjs/src/components/Notification/index.d.ts.map +1 -1
  208. package/lib/typescript/commonjs/src/components/NumberInput/index.d.ts.map +1 -1
  209. package/lib/typescript/commonjs/src/components/PinInput/index.d.ts.map +1 -1
  210. package/lib/typescript/commonjs/src/components/Popover/index.d.ts.map +1 -1
  211. package/lib/typescript/commonjs/src/components/RingProgress/index.d.ts.map +1 -1
  212. package/lib/typescript/commonjs/src/components/SegmentedControl/index.d.ts.map +1 -1
  213. package/lib/typescript/commonjs/src/components/Slider/index.d.ts.map +1 -1
  214. package/lib/typescript/commonjs/src/components/Stepper/index.d.ts.map +1 -1
  215. package/lib/typescript/commonjs/src/components/Table/Table.example.d.ts +3 -0
  216. package/lib/typescript/commonjs/src/components/Table/Table.example.d.ts.map +1 -0
  217. package/lib/typescript/commonjs/src/components/Table/index.d.ts +23 -9
  218. package/lib/typescript/commonjs/src/components/Table/index.d.ts.map +1 -1
  219. package/lib/typescript/commonjs/src/components/TextInput/index.d.ts.map +1 -1
  220. package/lib/typescript/commonjs/src/components/Timeline/index.d.ts.map +1 -1
  221. package/lib/typescript/commonjs/src/components/Title/index.d.ts +2 -1
  222. package/lib/typescript/commonjs/src/components/Title/index.d.ts.map +1 -1
  223. package/lib/typescript/commonjs/src/components/Tooltip/index.d.ts.map +1 -1
  224. package/lib/typescript/commonjs/src/components/TransferList/index.d.ts.map +1 -1
  225. package/lib/typescript/commonjs/src/components/Transition/index.d.ts.map +1 -1
  226. package/lib/typescript/commonjs/src/components/UnstyledButton/UnstyledButton.d.ts +2 -0
  227. package/lib/typescript/commonjs/src/components/UnstyledButton/UnstyledButton.d.ts.map +1 -1
  228. package/lib/typescript/commonjs/src/components/index.d.ts +1 -1
  229. package/lib/typescript/commonjs/src/components/index.d.ts.map +1 -1
  230. package/lib/typescript/commonjs/src/theme/functions/attach-functions.d.ts.map +1 -1
  231. package/lib/typescript/commonjs/src/theme/functions/fns/helpers.d.ts +7 -0
  232. package/lib/typescript/commonjs/src/theme/functions/fns/helpers.d.ts.map +1 -1
  233. package/lib/typescript/commonjs/src/theme/functions/fns/index.d.ts +7 -0
  234. package/lib/typescript/commonjs/src/theme/functions/fns/index.d.ts.map +1 -1
  235. package/lib/typescript/commonjs/src/theme/functions/fns/rgba.d.ts +8 -0
  236. package/lib/typescript/commonjs/src/theme/functions/fns/rgba.d.ts.map +1 -0
  237. package/lib/typescript/commonjs/src/theme/functions/fns/size.d.ts +6 -0
  238. package/lib/typescript/commonjs/src/theme/functions/fns/size.d.ts.map +1 -0
  239. package/lib/typescript/commonjs/src/theme/utils/index.d.ts +3 -0
  240. package/lib/typescript/commonjs/src/theme/utils/index.d.ts.map +1 -0
  241. package/lib/typescript/commonjs/src/theme/utils/withTextWrapper.d.ts +41 -0
  242. package/lib/typescript/commonjs/src/theme/utils/withTextWrapper.d.ts.map +1 -0
  243. package/lib/typescript/module/src/components/Anchor/index.d.ts +2 -1
  244. package/lib/typescript/module/src/components/Anchor/index.d.ts.map +1 -1
  245. package/lib/typescript/module/src/components/Badge/index.d.ts +2 -1
  246. package/lib/typescript/module/src/components/Badge/index.d.ts.map +1 -1
  247. package/lib/typescript/module/src/components/Blockquote/index.d.ts +2 -1
  248. package/lib/typescript/module/src/components/Blockquote/index.d.ts.map +1 -1
  249. package/lib/typescript/module/src/components/Button/index.d.ts +2 -1
  250. package/lib/typescript/module/src/components/Button/index.d.ts.map +1 -1
  251. package/lib/typescript/module/src/components/Chip/index.d.ts +2 -1
  252. package/lib/typescript/module/src/components/Chip/index.d.ts.map +1 -1
  253. package/lib/typescript/module/src/components/CloseButton/index.d.ts.map +1 -1
  254. package/lib/typescript/module/src/components/Code/index.d.ts +2 -1
  255. package/lib/typescript/module/src/components/Code/index.d.ts.map +1 -1
  256. package/lib/typescript/module/src/components/Collapse/index.d.ts.map +1 -1
  257. package/lib/typescript/module/src/components/Dialog/index.d.ts +2 -0
  258. package/lib/typescript/module/src/components/Dialog/index.d.ts.map +1 -1
  259. package/lib/typescript/module/src/components/Drawer/index.d.ts.map +1 -1
  260. package/lib/typescript/module/src/components/Icon/index.d.ts +26 -0
  261. package/lib/typescript/module/src/components/Icon/index.d.ts.map +1 -0
  262. package/lib/typescript/module/src/components/Kbd/index.d.ts +2 -1
  263. package/lib/typescript/module/src/components/Kbd/index.d.ts.map +1 -1
  264. package/lib/typescript/module/src/components/List/index.d.ts +2 -1
  265. package/lib/typescript/module/src/components/List/index.d.ts.map +1 -1
  266. package/lib/typescript/module/src/components/Mark/index.d.ts +2 -1
  267. package/lib/typescript/module/src/components/Mark/index.d.ts.map +1 -1
  268. package/lib/typescript/module/src/components/Menu/index.d.ts +3 -2
  269. package/lib/typescript/module/src/components/Menu/index.d.ts.map +1 -1
  270. package/lib/typescript/module/src/components/Modal/index.d.ts.map +1 -1
  271. package/lib/typescript/module/src/components/NavLink/index.d.ts +2 -1
  272. package/lib/typescript/module/src/components/NavLink/index.d.ts.map +1 -1
  273. package/lib/typescript/module/src/components/Notification/index.d.ts +2 -1
  274. package/lib/typescript/module/src/components/Notification/index.d.ts.map +1 -1
  275. package/lib/typescript/module/src/components/NumberInput/index.d.ts.map +1 -1
  276. package/lib/typescript/module/src/components/PinInput/index.d.ts.map +1 -1
  277. package/lib/typescript/module/src/components/Popover/index.d.ts.map +1 -1
  278. package/lib/typescript/module/src/components/RingProgress/index.d.ts.map +1 -1
  279. package/lib/typescript/module/src/components/SegmentedControl/index.d.ts.map +1 -1
  280. package/lib/typescript/module/src/components/Slider/index.d.ts.map +1 -1
  281. package/lib/typescript/module/src/components/Stepper/index.d.ts.map +1 -1
  282. package/lib/typescript/module/src/components/Table/Table.example.d.ts +3 -0
  283. package/lib/typescript/module/src/components/Table/Table.example.d.ts.map +1 -0
  284. package/lib/typescript/module/src/components/Table/index.d.ts +23 -9
  285. package/lib/typescript/module/src/components/Table/index.d.ts.map +1 -1
  286. package/lib/typescript/module/src/components/TextInput/index.d.ts.map +1 -1
  287. package/lib/typescript/module/src/components/Timeline/index.d.ts.map +1 -1
  288. package/lib/typescript/module/src/components/Title/index.d.ts +2 -1
  289. package/lib/typescript/module/src/components/Title/index.d.ts.map +1 -1
  290. package/lib/typescript/module/src/components/Tooltip/index.d.ts.map +1 -1
  291. package/lib/typescript/module/src/components/TransferList/index.d.ts.map +1 -1
  292. package/lib/typescript/module/src/components/Transition/index.d.ts.map +1 -1
  293. package/lib/typescript/module/src/components/UnstyledButton/UnstyledButton.d.ts +2 -0
  294. package/lib/typescript/module/src/components/UnstyledButton/UnstyledButton.d.ts.map +1 -1
  295. package/lib/typescript/module/src/components/index.d.ts +1 -1
  296. package/lib/typescript/module/src/components/index.d.ts.map +1 -1
  297. package/lib/typescript/module/src/theme/functions/attach-functions.d.ts.map +1 -1
  298. package/lib/typescript/module/src/theme/functions/fns/helpers.d.ts +7 -0
  299. package/lib/typescript/module/src/theme/functions/fns/helpers.d.ts.map +1 -1
  300. package/lib/typescript/module/src/theme/functions/fns/index.d.ts +7 -0
  301. package/lib/typescript/module/src/theme/functions/fns/index.d.ts.map +1 -1
  302. package/lib/typescript/module/src/theme/functions/fns/rgba.d.ts +8 -0
  303. package/lib/typescript/module/src/theme/functions/fns/rgba.d.ts.map +1 -0
  304. package/lib/typescript/module/src/theme/functions/fns/size.d.ts +6 -0
  305. package/lib/typescript/module/src/theme/functions/fns/size.d.ts.map +1 -0
  306. package/lib/typescript/module/src/theme/utils/index.d.ts +3 -0
  307. package/lib/typescript/module/src/theme/utils/index.d.ts.map +1 -0
  308. package/lib/typescript/module/src/theme/utils/withTextWrapper.d.ts +41 -0
  309. package/lib/typescript/module/src/theme/utils/withTextWrapper.d.ts.map +1 -0
  310. package/package.json +12 -9
  311. package/src/components/Anchor/index.tsx +8 -2
  312. package/src/components/Badge/index.tsx +5 -3
  313. package/src/components/Blockquote/index.tsx +6 -5
  314. package/src/components/Button/Button.styles.ts +3 -3
  315. package/src/components/Button/index.tsx +57 -63
  316. package/src/components/Chip/index.tsx +8 -6
  317. package/src/components/CloseButton/index.tsx +2 -23
  318. package/src/components/Code/index.tsx +19 -14
  319. package/src/components/Collapse/index.tsx +11 -2
  320. package/src/components/Dialog/index.tsx +54 -9
  321. package/src/components/Drawer/index.tsx +7 -13
  322. package/src/components/Icon/index.tsx +74 -0
  323. package/src/components/Kbd/index.tsx +5 -4
  324. package/src/components/List/index.tsx +8 -9
  325. package/src/components/Mark/index.tsx +7 -2
  326. package/src/components/Menu/index.tsx +21 -17
  327. package/src/components/Modal/index.tsx +11 -16
  328. package/src/components/NavLink/index.tsx +6 -4
  329. package/src/components/Notification/index.tsx +6 -7
  330. package/src/components/NumberInput/index.tsx +57 -15
  331. package/src/components/PasswordInput/index.tsx +2 -2
  332. package/src/components/PinInput/index.tsx +24 -9
  333. package/src/components/Popover/index.tsx +13 -10
  334. package/src/components/RingProgress/index.tsx +51 -8
  335. package/src/components/SegmentedControl/index.tsx +6 -4
  336. package/src/components/Slider/index.tsx +14 -3
  337. package/src/components/Stepper/index.tsx +5 -4
  338. package/src/components/Table/Table.example.tsx +85 -0
  339. package/src/components/Table/index.tsx +162 -43
  340. package/src/components/TextInput/index.tsx +93 -66
  341. package/src/components/Timeline/index.tsx +19 -12
  342. package/src/components/Title/index.tsx +7 -2
  343. package/src/components/Tooltip/index.tsx +13 -10
  344. package/src/components/TransferList/index.tsx +1 -5
  345. package/src/components/Transition/index.tsx +14 -2
  346. package/src/components/UnstyledButton/UnstyledButton.tsx +5 -1
  347. package/src/components/index.tsx +1 -1
  348. package/src/theme/functions/attach-functions.ts +3 -0
  349. package/src/theme/functions/fns/helpers.ts +19 -7
  350. package/src/theme/functions/fns/index.ts +4 -0
  351. package/src/theme/functions/fns/rgba.ts +45 -0
  352. package/src/theme/functions/fns/size.ts +14 -0
  353. package/src/theme/utils/index.ts +2 -0
  354. package/src/theme/utils/withTextWrapper.tsx +58 -0
  355. package/lib/commonjs/components/Portal/index.js +0 -69
  356. package/lib/commonjs/components/Portal/index.js.map +0 -1
  357. package/lib/module/components/Portal/index.js +0 -62
  358. package/lib/module/components/Portal/index.js.map +0 -1
  359. package/lib/typescript/commonjs/src/components/Portal/index.d.ts +0 -10
  360. package/lib/typescript/commonjs/src/components/Portal/index.d.ts.map +0 -1
  361. package/lib/typescript/module/src/components/Portal/index.d.ts +0 -10
  362. package/lib/typescript/module/src/components/Portal/index.d.ts.map +0 -1
  363. package/src/components/Portal/index.tsx +0 -75
@@ -2,8 +2,9 @@ import React, { forwardRef } from 'react';
2
2
  import { Text } from '../Text';
3
3
  import type { TextProps } from '../Text';
4
4
  import { useTheme } from '../../theme/theme-provider';
5
+ import type { WithTextWrapperProps } from '../../theme/utils/withTextWrapper';
5
6
 
6
- export interface TitleProps extends Omit<TextProps, 'size'> {
7
+ export interface TitleProps extends Omit<TextProps, 'size'>, WithTextWrapperProps {
7
8
  /** Heading order (h1-h6) */
8
9
  order?: 1 | 2 | 3 | 4 | 5 | 6;
9
10
 
@@ -16,7 +17,7 @@ export interface TitleProps extends Omit<TextProps, 'size'> {
16
17
  * Maps order prop to h1-h6 heading styles from theme
17
18
  */
18
19
  export const Title = forwardRef<any, TitleProps>((props, ref) => {
19
- const { order = 1, children, style, ...others} = props;
20
+ const { order = 1, children, style, withTextWrapper: shouldWrapInText = true, ...others} = props;
20
21
  const theme = useTheme();
21
22
 
22
23
  // Get heading styles from theme
@@ -29,6 +30,10 @@ export const Title = forwardRef<any, TitleProps>((props, ref) => {
29
30
  theme.headings.fontWeight ??
30
31
  700;
31
32
 
33
+ if (!shouldWrapInText) {
34
+ return children;
35
+ }
36
+
32
37
  return (
33
38
  <Text
34
39
  ref={ref}
@@ -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';
@@ -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
+ }
@@ -0,0 +1,2 @@
1
+ export { rem, em } from './rem';
2
+ export { withTextWrapper, type WithTextWrapperProps } from './withTextWrapper';
@@ -0,0 +1,58 @@
1
+ import type { ReactNode } from 'react';
2
+ import { Text } from '../../components/Text';
3
+ import type { TextProps } from '../../components/Text';
4
+
5
+ /**
6
+ * Conditionally wraps content in a Text component based on the withTextWrapper prop.
7
+ *
8
+ * In React Native, all text must be wrapped in a Text component. However, some
9
+ * components may need flexibility to render with or without this wrapper depending
10
+ * on whether their content is text or other components (like icons, views, etc.).
11
+ *
12
+ * @param children - The content to potentially wrap
13
+ * @param shouldWrap - Whether to wrap the content in a Text component
14
+ * @param textStyle - Optional style to apply to the Text wrapper
15
+ * @param textProps - Optional additional props to pass to the Text component
16
+ * @returns The children wrapped in Text if shouldWrap is true, otherwise just the children
17
+ *
18
+ * @example
19
+ * // Wrap text content
20
+ * withTextWrapper('Hello', true, styles.text)
21
+ *
22
+ * @example
23
+ * // Don't wrap components
24
+ * withTextWrapper(<Icon />, false)
25
+ *
26
+ * @example
27
+ * // Default behavior (wrap)
28
+ * withTextWrapper('Text', true, styles.text, { numberOfLines: 1 })
29
+ */
30
+ export function withTextWrapper(
31
+ children: ReactNode,
32
+ shouldWrap: boolean = true,
33
+ textStyle?: any,
34
+ textProps?: Omit<TextProps, 'children' | 'style'>
35
+ ): ReactNode {
36
+ if (!shouldWrap) {
37
+ return children;
38
+ }
39
+
40
+ return (
41
+ <Text style={textStyle} {...textProps}>
42
+ {children}
43
+ </Text>
44
+ );
45
+ }
46
+
47
+ /**
48
+ * Type helper for components that support the withTextWrapper pattern.
49
+ * Add this to your component props interface.
50
+ */
51
+ export interface WithTextWrapperProps {
52
+ /**
53
+ * If false, children will not be wrapped in a Text component.
54
+ * This is useful when the children contain non-text elements like icons or custom components.
55
+ * @default true
56
+ */
57
+ withTextWrapper?: boolean;
58
+ }
@@ -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;AAAgD,IAAAE,WAAA,GAAAF,OAAA;AAAA,SAAAD,wBAAAI,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAN,uBAAA,YAAAA,CAAAI,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,gBAAAP,CAAA,IAAAD,CAAA,gBAAAC,CAAA,OAAAa,cAAA,CAAAC,IAAA,CAAAf,CAAA,EAAAC,CAAA,OAAAM,CAAA,IAAAD,CAAA,GAAAU,MAAA,CAAAC,cAAA,KAAAD,MAAA,CAAAE,wBAAA,CAAAlB,CAAA,EAAAC,CAAA,OAAAM,CAAA,CAAAK,GAAA,IAAAL,CAAA,CAAAM,GAAA,IAAAP,CAAA,CAAAE,CAAA,EAAAP,CAAA,EAAAM,CAAA,IAAAC,CAAA,CAAAP,CAAA,IAAAD,CAAA,CAAAC,CAAA,WAAAO,CAAA,KAAAR,CAAA,EAAAC,CAAA;AAOhD,MAAMkB,aAAa,gBAAG,IAAAC,oBAAa,EAA4B,IAAI,CAAC;AAM7D,MAAMC,cAA6C,GAAGA,CAAC;EAAEC;AAAS,CAAC,KAAK;EAC7E,MAAM,CAACC,OAAO,EAAEC,UAAU,CAAC,GAAG,IAAAC,eAAQ,EAA+B,IAAIC,GAAG,CAAC,CAAC,CAAC;EAC/E,MAAMC,OAAO,GAAGC,cAAK,CAACC,MAAM,CAAC,CAAC,CAAC;EAE/B,MAAMC,KAAK,GAAG,IAAAC,kBAAW,EAAEC,KAAsB,IAAK;IACpD,MAAMC,GAAG,GAAGN,OAAO,CAACO,OAAO,EAAE;IAC7BV,UAAU,CAAEW,IAAI,IAAK;MACnB,MAAMC,IAAI,GAAG,IAAIV,GAAG,CAACS,IAAI,CAAC;MAC1BC,IAAI,CAACvB,GAAG,CAACoB,GAAG,EAAED,KAAK,CAAC;MACpB,OAAOI,IAAI;IACb,CAAC,CAAC;IACF,OAAOH,GAAG;EACZ,CAAC,EAAE,EAAE,CAAC;EAEN,MAAMI,OAAO,GAAG,IAAAN,kBAAW,EAAEE,GAAW,IAAK;IAC3CT,UAAU,CAAEW,IAAI,IAAK;MACnB,MAAMC,IAAI,GAAG,IAAIV,GAAG,CAACS,IAAI,CAAC;MAC1BC,IAAI,CAACE,MAAM,CAACL,GAAG,CAAC;MAChB,OAAOG,IAAI;IACb,CAAC,CAAC;EACJ,CAAC,EAAE,EAAE,CAAC;EAEN,oBACE,IAAArC,WAAA,CAAAwC,IAAA,EAACpB,aAAa,CAACqB,QAAQ;IAACC,KAAK,EAAE;MAAEX,KAAK;MAAEO;IAAQ,CAAE;IAAAf,QAAA,GAC/CA,QAAQ,eACT,IAAAvB,WAAA,CAAA2C,GAAA,EAAC5C,YAAA,CAAA6C,IAAI;MAACC,KAAK,EAAEC,uBAAU,CAACC,YAAa;MAACC,aAAa,EAAC,UAAU;MAAAzB,QAAA,EAC3D0B,KAAK,CAACC,IAAI,CAAC1B,OAAO,CAAC2B,OAAO,CAAC,CAAC,CAAC,CAACC,GAAG,CAAC,CAAC,CAAClB,GAAG,EAAED,KAAK,CAAC,kBAC9C,IAAAjC,WAAA,CAAA2C,GAAA,EAAC/C,MAAA,CAAAe,OAAK,CAAC0C,QAAQ;QAAA9B,QAAA,EAAYU;MAAK,GAAXC,GAA4B,CAClD;IAAC,CACE,CAAC;EAAA,CACe,CAAC;AAE7B,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,CAAC,CAAC,CAAC;EAC/E,MAAMC,OAAO,GAAGjB,KAAK,CAACkB,MAAM,CAAC,CAAC,CAAC;EAE/B,MAAMC,KAAK,GAAGf,WAAW,CAAEgB,KAAsB,IAAK;IACpD,MAAMC,GAAG,GAAGJ,OAAO,CAACK,OAAO,EAAE;IAC7BP,UAAU,CAAEQ,IAAI,IAAK;MACnB,MAAMC,IAAI,GAAG,IAAIR,GAAG,CAACO,IAAI,CAAC;MAC1BC,IAAI,CAACC,GAAG,CAACJ,GAAG,EAAED,KAAK,CAAC;MACpB,OAAOI,IAAI;IACb,CAAC,CAAC;IACF,OAAOH,GAAG;EACZ,CAAC,EAAE,EAAE,CAAC;EAEN,MAAMK,OAAO,GAAGtB,WAAW,CAAEiB,GAAW,IAAK;IAC3CN,UAAU,CAAEQ,IAAI,IAAK;MACnB,MAAMC,IAAI,GAAG,IAAIR,GAAG,CAACO,IAAI,CAAC;MAC1BC,IAAI,CAACG,MAAM,CAACN,GAAG,CAAC;MAChB,OAAOG,IAAI;IACb,CAAC,CAAC;EACJ,CAAC,EAAE,EAAE,CAAC;EAEN,oBACEd,KAAA,CAACC,aAAa,CAACiB,QAAQ;IAACC,KAAK,EAAE;MAAEV,KAAK;MAAEO;IAAQ,CAAE;IAAAb,QAAA,GAC/CA,QAAQ,eACTL,IAAA,CAACH,IAAI;MAACyB,KAAK,EAAExB,UAAU,CAACyB,YAAa;MAACC,aAAa,EAAC,UAAU;MAAAnB,QAAA,EAC3DoB,KAAK,CAACC,IAAI,CAACpB,OAAO,CAACqB,OAAO,CAAC,CAAC,CAAC,CAACC,GAAG,CAAC,CAAC,CAACf,GAAG,EAAED,KAAK,CAAC,kBAC9CZ,IAAA,CAACR,KAAK,CAACqC,QAAQ;QAAAxB,QAAA,EAAYO;MAAK,GAAXC,GAA4B,CAClD;IAAC,CACE,CAAC;EAAA,CACe,CAAC;AAE7B,CAAC;AAMD,OAAO,MAAMiB,MAA6B,GAAGA,CAAC;EAAEzB;AAAS,CAAC,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"}
@@ -1,75 +0,0 @@
1
- import React, { createContext, useContext, useState, useCallback } from 'react';
2
- import { View, StyleSheet } from 'react-native';
3
-
4
- interface PortalContextValue {
5
- mount: (child: React.ReactNode) => number;
6
- unmount: (key: number) => void;
7
- }
8
-
9
- const PortalContext = createContext<PortalContextValue | null>(null);
10
-
11
- export interface PortalProviderProps {
12
- children: React.ReactNode;
13
- }
14
-
15
- export const PortalProvider: React.FC<PortalProviderProps> = ({ children }) => {
16
- const [portals, setPortals] = useState<Map<number, React.ReactNode>>(new Map());
17
- const nextKey = React.useRef(0);
18
-
19
- const mount = useCallback((child: React.ReactNode) => {
20
- const key = nextKey.current++;
21
- setPortals((prev) => {
22
- const next = new Map(prev);
23
- next.set(key, child);
24
- return next;
25
- });
26
- return key;
27
- }, []);
28
-
29
- const unmount = useCallback((key: number) => {
30
- setPortals((prev) => {
31
- const next = new Map(prev);
32
- next.delete(key);
33
- return next;
34
- });
35
- }, []);
36
-
37
- return (
38
- <PortalContext.Provider value={{ mount, unmount }}>
39
- {children}
40
- <View style={StyleSheet.absoluteFill} pointerEvents="box-none">
41
- {Array.from(portals.entries()).map(([key, child]) => (
42
- <React.Fragment key={key}>{child}</React.Fragment>
43
- ))}
44
- </View>
45
- </PortalContext.Provider>
46
- );
47
- };
48
-
49
- export interface PortalProps {
50
- children: React.ReactNode;
51
- }
52
-
53
- export const Portal: React.FC<PortalProps> = ({ children }) => {
54
- const context = useContext(PortalContext);
55
- const [, setKey] = useState<number | null>(null);
56
-
57
- React.useEffect(() => {
58
- if (!context) {
59
- console.warn('Portal used without PortalProvider');
60
- return;
61
- }
62
-
63
- const portalKey = context.mount(children);
64
- setKey(portalKey);
65
-
66
- return () => {
67
- context.unmount(portalKey);
68
- };
69
- }, [children, context]);
70
-
71
- return null;
72
- };
73
-
74
- Portal.displayName = 'Portal';
75
- PortalProvider.displayName = 'PortalProvider';