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
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/theme/functions/fns/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAIvD,eAAO,MAAM,GAAG;iBAJkC,iDACrC;;;kBAGI,kDAEZ;wBAIsJ,kDAAoB;;;YAA4F,kDAAoB,MAAM,eAAkB;;;;;;;YAAsI,kDAAoB,MAAM,WAAW;mBAAuM,kDAAoB;;;;;;;qEAAlW,uCAAmB;;CAD7W,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/theme/functions/fns/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAIvD,eAAO,MAAM,GAAG;iBALG,iDACZ;;;sBAYA,iDAAmB;;;kBAAwH,kDAAoB;wBAAgM,kDAAoB;;;YAA8F,kDAAoB,MAAQ,eAAkB;;;;;;;YAAkJ,kDAAoB,MAAM,WAAW;mBAAuM,kDAAoB;;;;;;;;;qEAA3oB,uCAAmB;;CAD/R,CAAC"}
@@ -0,0 +1,8 @@
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 declare function rgba(_theme: any): (color: string, alpha: number) => string;
8
+ //# sourceMappingURL=rgba.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rgba.d.ts","sourceRoot":"","sources":["../../../../../../../src/theme/functions/fns/rgba.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,wBAAgB,IAAI,CAAC,MAAM,EAAE,GAAG,IACtB,OAAO,MAAM,EAAE,OAAO,MAAM,KAAG,MAAM,CAqC9C"}
@@ -0,0 +1,6 @@
1
+ import type { MantineNumberSize } from '../../types';
2
+ export declare function size(_theme: any): <Sizes extends Record<any, any>>({ size, sizes, }: {
3
+ size: MantineNumberSize;
4
+ sizes: Sizes;
5
+ }) => number;
6
+ //# sourceMappingURL=size.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"size.d.ts","sourceRoot":"","sources":["../../../../../../../src/theme/functions/fns/size.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAGrD,wBAAgB,IAAI,CAAC,MAAM,EAAE,GAAG,IACtB,KAAK,SAAS,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,kBAGrC;IACD,IAAI,EAAE,iBAAiB,CAAC;IACxB,KAAK,EAAE,KAAK,CAAC;CACd,KAAG,MAAM,CAGX"}
@@ -0,0 +1,3 @@
1
+ export { rem, em } from './rem';
2
+ export { withTextWrapper, type WithTextWrapperProps } from './withTextWrapper';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/theme/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,EAAE,eAAe,EAAE,KAAK,oBAAoB,EAAE,MAAM,mBAAmB,CAAC"}
@@ -0,0 +1,41 @@
1
+ import type { ReactNode } from 'react';
2
+ import type { TextProps } from '../../components/Text';
3
+ /**
4
+ * Conditionally wraps content in a Text component based on the withTextWrapper prop.
5
+ *
6
+ * In React Native, all text must be wrapped in a Text component. However, some
7
+ * components may need flexibility to render with or without this wrapper depending
8
+ * on whether their content is text or other components (like icons, views, etc.).
9
+ *
10
+ * @param children - The content to potentially wrap
11
+ * @param shouldWrap - Whether to wrap the content in a Text component
12
+ * @param textStyle - Optional style to apply to the Text wrapper
13
+ * @param textProps - Optional additional props to pass to the Text component
14
+ * @returns The children wrapped in Text if shouldWrap is true, otherwise just the children
15
+ *
16
+ * @example
17
+ * // Wrap text content
18
+ * withTextWrapper('Hello', true, styles.text)
19
+ *
20
+ * @example
21
+ * // Don't wrap components
22
+ * withTextWrapper(<Icon />, false)
23
+ *
24
+ * @example
25
+ * // Default behavior (wrap)
26
+ * withTextWrapper('Text', true, styles.text, { numberOfLines: 1 })
27
+ */
28
+ export declare function withTextWrapper(children: ReactNode, shouldWrap?: boolean, textStyle?: any, textProps?: Omit<TextProps, 'children' | 'style'>): ReactNode;
29
+ /**
30
+ * Type helper for components that support the withTextWrapper pattern.
31
+ * Add this to your component props interface.
32
+ */
33
+ export interface WithTextWrapperProps {
34
+ /**
35
+ * If false, children will not be wrapped in a Text component.
36
+ * This is useful when the children contain non-text elements like icons or custom components.
37
+ * @default true
38
+ */
39
+ withTextWrapper?: boolean;
40
+ }
41
+ //# sourceMappingURL=withTextWrapper.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"withTextWrapper.d.ts","sourceRoot":"","sources":["../../../../../../src/theme/utils/withTextWrapper.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAEvD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,eAAe,CAC7B,QAAQ,EAAE,SAAS,EACnB,UAAU,GAAE,OAAc,EAC1B,SAAS,CAAC,EAAE,GAAG,EACf,SAAS,CAAC,EAAE,IAAI,CAAC,SAAS,EAAE,UAAU,GAAG,OAAO,CAAC,GAChD,SAAS,CAUX;AAED;;;GAGG;AACH,MAAM,WAAW,oBAAoB;IACnC;;;;OAIG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-mantine",
3
- "version": "0.5.0",
3
+ "version": "0.7.0",
4
4
  "description": "Make Mantine Accessable on React Native",
5
5
  "source": "./src/index.tsx",
6
6
  "main": "./lib/commonjs/index.js",
@@ -74,7 +74,8 @@
74
74
  "@release-it/conventional-changelog": "^5.0.0",
75
75
  "@types/jest": "^29.5.5",
76
76
  "@types/lodash-es": "^4.17.12",
77
- "@types/react": "^18.2.44",
77
+ "@types/react": "^19.0.0",
78
+ "@types/react-native-vector-icons": "^6.4.18",
78
79
  "commitlint": "^17.0.2",
79
80
  "del-cli": "^5.1.0",
80
81
  "eslint": "^8.51.0",
@@ -83,18 +84,20 @@
83
84
  "jest": "^29.7.0",
84
85
  "prettier": "^3.0.3",
85
86
  "prettier-eslint": "^16.3.0",
86
- "react": "18.3.1",
87
- "react-native": "0.76.9",
87
+ "react": "19.1.0",
88
+ "react-native": "0.81.5",
88
89
  "react-native-builder-bob": "latest",
90
+ "react-native-vector-icons": "^10.0.0",
89
91
  "release-it": "^15.0.0",
90
92
  "typescript": "^5.2.2"
91
93
  },
92
94
  "resolutions": {
93
- "@types/react": "^18.2.44"
95
+ "@types/react": "^19.0.0"
94
96
  },
95
97
  "peerDependencies": {
96
98
  "react": "*",
97
- "react-native": "*"
99
+ "react-native": "*",
100
+ "react-native-vector-icons": "^10.0.0"
98
101
  },
99
102
  "workspaces": [
100
103
  "example"
@@ -189,9 +192,9 @@
189
192
  "version": "0.41.2"
190
193
  },
191
194
  "dependencies": {
192
- "expo-clipboard": "~7.0.0",
193
- "expo-font": "~13.0.0",
194
- "expo-linear-gradient": "~14.0.0",
195
+ "expo-clipboard": "~8.0.8",
196
+ "expo-font": "~14.0.10",
197
+ "expo-linear-gradient": "~15.0.8",
195
198
  "lodash-es": "^4.17.21"
196
199
  }
197
200
  }
@@ -10,8 +10,9 @@ import type {
10
10
  import { useComponentDefaultProps } from '../../theme/theme-provider';
11
11
  import { createStyles } from '../../theme';
12
12
  import { rem } from '../../theme/utils/rem';
13
+ import type { WithTextWrapperProps } from '../../theme/utils/withTextWrapper';
13
14
 
14
- export interface AnchorProps extends DefaultProps {
15
+ export interface AnchorProps extends DefaultProps, WithTextWrapperProps {
15
16
  /** Anchor text color from theme */
16
17
  color?: MantineColor;
17
18
 
@@ -103,10 +104,11 @@ const defaultProps: Partial<AnchorProps> = {
103
104
  weight: '400',
104
105
  underline: true,
105
106
  variant: 'link',
107
+ withTextWrapper: true,
106
108
  };
107
109
 
108
110
  export const Anchor = forwardRef<RNText, AnchorProps>((props, ref) => {
109
- const { color, size, weight, underline, variant, href, onPress, children, style, ...others} =
111
+ const { color, size, weight, underline, variant, href, onPress, children, style, withTextWrapper: shouldWrapInText, ...others} =
110
112
  useComponentDefaultProps('Anchor', defaultProps, props);
111
113
 
112
114
  const { styles, sx} = useStyles(
@@ -124,6 +126,10 @@ export const Anchor = forwardRef<RNText, AnchorProps>((props, ref) => {
124
126
  }
125
127
  };
126
128
 
129
+ if (!shouldWrapInText) {
130
+ return children;
131
+ }
132
+
127
133
  return (
128
134
  <Text
129
135
  ref={ref}
@@ -1,5 +1,4 @@
1
1
  import React, { forwardRef } from 'react';
2
- import { Text } from '../Text';
3
2
  import { BoxView } from '../BoxView';
4
3
  import type {
5
4
  DefaultProps,
@@ -11,8 +10,9 @@ import type {
11
10
  import { useComponentDefaultProps } from '../../theme/theme-provider';
12
11
  import { createStyles } from '../../theme';
13
12
  import { rem } from '../../theme/utils/rem';
13
+ import { withTextWrapper, type WithTextWrapperProps } from '../../theme/utils/withTextWrapper';
14
14
 
15
- export interface BadgeProps extends DefaultProps {
15
+ export interface BadgeProps extends DefaultProps, WithTextWrapperProps {
16
16
  /** Badge color from theme */
17
17
  color?: MantineColor;
18
18
 
@@ -157,6 +157,7 @@ const defaultProps: Partial<BadgeProps> = {
157
157
  size: 'md',
158
158
  radius: 'xl',
159
159
  fullWidth: false,
160
+ withTextWrapper: true,
160
161
  };
161
162
 
162
163
  export const Badge = forwardRef<any, BadgeProps>((props, ref) => {
@@ -170,6 +171,7 @@ export const Badge = forwardRef<any, BadgeProps>((props, ref) => {
170
171
  rightSection,
171
172
  children,
172
173
  style,
174
+ withTextWrapper: shouldWrapInText,
173
175
  ...others
174
176
  } = useComponentDefaultProps('Badge', defaultProps, props);
175
177
 
@@ -183,7 +185,7 @@ export const Badge = forwardRef<any, BadgeProps>((props, ref) => {
183
185
  <BoxView style={styles.inner}>
184
186
  {variant === 'dot' && <BoxView style={styles.dot} />}
185
187
  {leftSection && <BoxView style={styles.leftSection}>{leftSection}</BoxView>}
186
- <Text style={styles.label}>{children}</Text>
188
+ {withTextWrapper(children, shouldWrapInText, styles.label)}
187
189
  {rightSection && <BoxView style={styles.rightSection}>{rightSection}</BoxView>}
188
190
  </BoxView>
189
191
  </BoxView>
@@ -1,6 +1,5 @@
1
1
  import React, { forwardRef } from 'react';
2
2
  import { BoxView } from '../BoxView';
3
- import { Text } from '../Text';
4
3
  import type {
5
4
  DefaultProps,
6
5
  MantineColor,
@@ -9,8 +8,9 @@ import type {
9
8
  import { useComponentDefaultProps } from '../../theme/theme-provider';
10
9
  import { createStyles } from '../../theme';
11
10
  import { rem } from '../../theme/utils/rem';
11
+ import { withTextWrapper, type WithTextWrapperProps } from '../../theme/utils/withTextWrapper';
12
12
 
13
- export interface BlockquoteProps extends DefaultProps {
13
+ export interface BlockquoteProps extends DefaultProps, WithTextWrapperProps {
14
14
  /** Blockquote color from theme */
15
15
  color?: MantineColor;
16
16
 
@@ -80,10 +80,11 @@ const useStyles = createStyles(
80
80
  const defaultProps: Partial<BlockquoteProps> = {
81
81
  color: 'blue',
82
82
  radius: 'sm',
83
+ withTextWrapper: true,
83
84
  };
84
85
 
85
86
  export const Blockquote = forwardRef<any, BlockquoteProps>((props, ref) => {
86
- const { color, icon, cite, radius, children, style} =
87
+ const { color, icon, cite, radius, children, style, withTextWrapper: shouldWrapInText} =
87
88
  useComponentDefaultProps('Blockquote', defaultProps, props);
88
89
 
89
90
  const { styles, sx, ...others} = useStyles({ color, radius}, { name: 'Blockquote' }) as any;
@@ -93,8 +94,8 @@ export const Blockquote = forwardRef<any, BlockquoteProps>((props, ref) => {
93
94
  <BoxView style={styles.inner}>
94
95
  {icon && <BoxView style={styles.icon}>{icon}</BoxView>}
95
96
  <BoxView style={styles.body}>
96
- <Text style={styles.content}>{children}</Text>
97
- {cite && <Text style={styles.cite}>{cite}</Text>}
97
+ {withTextWrapper(children, shouldWrapInText, styles.content)}
98
+ {cite && withTextWrapper(cite, shouldWrapInText, styles.cite)}
98
99
  </BoxView>
99
100
  </BoxView>
100
101
  </BoxView>
@@ -189,10 +189,8 @@ const useStyles = createStyles(
189
189
 
190
190
  inner: {
191
191
  display: 'flex',
192
- alignItems: 'center',
193
- justifyContent: 'center',
194
192
  height: '100%',
195
- overflow: 'visible',
193
+ flex: 1,
196
194
  },
197
195
 
198
196
  label: {
@@ -202,6 +200,8 @@ const useStyles = createStyles(
202
200
  display: 'flex',
203
201
  alignItems: 'center',
204
202
  justifyContent: 'center',
203
+ flexDirection: 'row',
204
+ flex: 1,
205
205
  },
206
206
  };
207
207
  }
@@ -13,11 +13,11 @@ import { ActivityIndicator, View } from 'react-native';
13
13
  import { useComponentDefaultProps } from '../../theme/theme-provider';
14
14
  import useStyles from './Button.styles';
15
15
  import { BoxView } from '../BoxView';
16
- import { Text } from '../Text';
16
+ import { withTextWrapper, type WithTextWrapperProps } from '../../theme/utils/withTextWrapper';
17
17
 
18
18
  export type ButtonStylesNames = any;
19
19
 
20
- export interface ButtonProps extends DefaultProps {
20
+ export interface ButtonProps extends DefaultProps, WithTextWrapperProps {
21
21
  /** Predefined button size */
22
22
  size?: MantineSize;
23
23
 
@@ -76,60 +76,62 @@ const defaultProps: Partial<ButtonProps> = {
76
76
  type: 'button',
77
77
  variant: 'filled',
78
78
  loaderPosition: 'left',
79
+ withTextWrapper: true,
79
80
  };
80
81
 
81
- export const _Button = forwardRef<View, ButtonProps>(
82
- (props, ref) => {
83
- const {
84
- size,
82
+ export const _Button = forwardRef<View, ButtonProps>((props, ref) => {
83
+ const {
84
+ size,
85
+ color,
86
+ type,
87
+ disabled,
88
+ children,
89
+ leftIcon,
90
+ rightIcon,
91
+ fullWidth,
92
+ variant,
93
+ radius,
94
+ uppercase,
95
+ compact,
96
+ loading,
97
+ loaderPosition,
98
+ loaderProps,
99
+ gradient,
100
+ style,
101
+ withTextWrapper: shouldWrapInText,
102
+ ...others
103
+ } = useComponentDefaultProps('Button', defaultProps, props);
104
+
105
+ const { styles, sx } = useStyles(
106
+ {
107
+ radius,
85
108
  color,
86
- type,
87
- disabled,
88
- children,
89
- leftIcon,
90
- rightIcon,
91
109
  fullWidth,
92
- variant,
93
- radius,
94
- uppercase,
95
110
  compact,
96
- loading,
97
- loaderPosition,
98
- loaderProps,
99
111
  gradient,
100
- style,
101
- ...others
102
- } = useComponentDefaultProps('Button', defaultProps, props);
103
-
104
- const { styles, sx} = useStyles(
105
- {
106
- radius,
107
- color,
108
- fullWidth,
109
- compact,
110
- gradient,
111
- withLeftIcon: !!leftIcon,
112
- withRightIcon: !!rightIcon,
113
- },
114
- {
115
- name: 'Button',
116
- variant,
117
- size,
118
- }
119
- );
120
-
121
- const loader = <ActivityIndicator />;
122
-
123
- return (
124
- <UnstyledButton
125
- style={sx(styles.root, style)}
126
- data-button
127
- data-disabled={disabled || undefined}
128
- data-loading={loading || undefined}
129
- ref={ref}
130
- {...others}
131
- >
132
- <BoxView style={styles.inner}>
112
+ withLeftIcon: !!leftIcon,
113
+ withRightIcon: !!rightIcon,
114
+ },
115
+ {
116
+ name: 'Button',
117
+ variant,
118
+ size,
119
+ }
120
+ );
121
+
122
+ const loader = <ActivityIndicator />;
123
+
124
+ return (
125
+ <UnstyledButton
126
+ style={sx(styles.root, style)}
127
+ data-button
128
+ data-disabled={disabled || undefined}
129
+ data-loading={loading || undefined}
130
+ ref={ref}
131
+ {...others}
132
+ >
133
+ <BoxView style={styles.inner}>
134
+ <BoxView style={styles.label}>
133
135
  {(leftIcon || (loading && loaderPosition === 'left')) && (
134
136
  <BoxView style={sx(styles.icon, styles.leftIcon)}>
135
137
  {loading && loaderPosition === 'left' ? loader : leftIcon}
@@ -139,24 +141,16 @@ export const _Button = forwardRef<View, ButtonProps>(
139
141
  {loading && loaderPosition === 'center' && (
140
142
  <BoxView style={styles.centerLoader}>{loader}</BoxView>
141
143
  )}
142
-
143
- <BoxView style={styles.label}>
144
- {typeof children === 'string' || typeof children === 'number' ? (
145
- <Text>{children}</Text>
146
- ) : (
147
- children
148
- )}
149
- </BoxView>
150
-
144
+ {withTextWrapper(children, shouldWrapInText)}
151
145
  {(rightIcon || (loading && loaderPosition === 'right')) && (
152
146
  <BoxView style={sx(styles.icon, styles.rightIcon)}>
153
147
  {loading && loaderPosition === 'right' ? loader : rightIcon}
154
148
  </BoxView>
155
149
  )}
156
150
  </BoxView>
157
- </UnstyledButton>
158
- );
159
- }
160
- ) as any;
151
+ </BoxView>
152
+ </UnstyledButton>
153
+ );
154
+ }) as any;
161
155
 
162
156
  export const Button = _Button;
@@ -1,7 +1,6 @@
1
1
  import React, { forwardRef } from 'react';
2
2
  import { TouchableOpacity } from 'react-native';
3
3
  import { BoxView } from '../BoxView';
4
- import { Text } from '../Text';
5
4
  import type {
6
5
  DefaultProps,
7
6
  MantineColor,
@@ -12,8 +11,9 @@ import type {
12
11
  import { useComponentDefaultProps } from '../../theme/theme-provider';
13
12
  import { createStyles } from '../../theme';
14
13
  import { rem } from '../../theme/utils/rem';
14
+ import { withTextWrapper, type WithTextWrapperProps } from '../../theme/utils/withTextWrapper';
15
15
 
16
- export interface ChipProps extends DefaultProps {
16
+ export interface ChipProps extends DefaultProps, WithTextWrapperProps {
17
17
  /** Chip label */
18
18
  children: React.ReactNode;
19
19
 
@@ -174,6 +174,7 @@ const defaultProps: Partial<ChipProps> = {
174
174
  variant: 'filled',
175
175
  disabled: false,
176
176
  type: 'checkbox',
177
+ withTextWrapper: true,
177
178
  };
178
179
 
179
180
  export const Chip = forwardRef<any, ChipProps>((props, ref) => {
@@ -192,6 +193,7 @@ export const Chip = forwardRef<any, ChipProps>((props, ref) => {
192
193
  textStyle,
193
194
  value,
194
195
  type,
196
+ withTextWrapper: shouldWrapInText,
195
197
  ...others
196
198
  } = useComponentDefaultProps('Chip', defaultProps, props);
197
199
 
@@ -226,7 +228,7 @@ export const Chip = forwardRef<any, ChipProps>((props, ref) => {
226
228
  {...others}
227
229
  >
228
230
  {showIcon && <BoxView style={styles.icon}>{icon}</BoxView>}
229
- <Text style={sx(styles.text, textStyle)}>{children}</Text>
231
+ {withTextWrapper(children, shouldWrapInText, sx(styles.text, textStyle))}
230
232
  </TouchableOpacity>
231
233
  );
232
234
  });
@@ -325,10 +327,10 @@ export const ChipGroup = forwardRef<any, ChipGroupProps>((props, ref) => {
325
327
  };
326
328
 
327
329
  const enhancedChildren = React.Children.map(children, (child) => {
328
- if (React.isValidElement(child) && child.type === Chip) {
329
- const chipValue = child.props.value;
330
+ if (React.isValidElement(child) && (child.type as any) === Chip) {
331
+ const chipValue = (child.props as ChipProps).value;
330
332
  if (chipValue !== undefined) {
331
- return React.cloneElement(child as React.ReactElement<ChipProps>, {
333
+ return React.cloneElement<ChipProps>(child as React.ReactElement<ChipProps>, {
332
334
  checked: isChecked(chipValue),
333
335
  onChange: (checked: boolean) => handleChipChange(chipValue, checked),
334
336
  });
@@ -1,6 +1,6 @@
1
1
  import React, { forwardRef } from 'react';
2
2
  import { TouchableOpacity } from 'react-native';
3
- import { BoxView } from '../BoxView';
3
+ import { Icon } from '../Icon';
4
4
  import type { DefaultProps, MantineSize } from '../../theme/types';
5
5
  import { useComponentDefaultProps } from '../../theme/theme-provider';
6
6
  import { createStyles } from '../../theme';
@@ -81,28 +81,7 @@ const useStyles = createStyles(
81
81
  );
82
82
 
83
83
  const CloseIcon = ({ size, color }: { size: number; color: string }) => (
84
- <BoxView style={{ width: size, height: size, position: 'relative' }}>
85
- <BoxView
86
- style={{
87
- position: 'absolute',
88
- width: size,
89
- height: 2,
90
- backgroundColor: color,
91
- top: (size - 2) / 2,
92
- transform: [{ rotate: '45deg' }],
93
- }}
94
- />
95
- <BoxView
96
- style={{
97
- position: 'absolute',
98
- width: size,
99
- height: 2,
100
- backgroundColor: color,
101
- top: (size - 2) / 2,
102
- transform: [{ rotate: '-45deg' }],
103
- }}
104
- />
105
- </BoxView>
84
+ <Icon name="times" size={size} color={color} />
106
85
  );
107
86
 
108
87
  const defaultProps: Partial<CloseButtonProps> = {
@@ -3,8 +3,9 @@ import { Text } from '../Text';
3
3
  import type { TextProps } from '../Text';
4
4
  import { useTheme } from '../../theme/theme-provider';
5
5
  import { BoxView } from '../BoxView';
6
+ import { withTextWrapper, type WithTextWrapperProps } from '../../theme/utils/withTextWrapper';
6
7
 
7
- export interface CodeProps extends Omit<TextProps, 'children'> {
8
+ export interface CodeProps extends Omit<TextProps, 'children'>, WithTextWrapperProps {
8
9
  /** Code content */
9
10
  children?: React.ReactNode;
10
11
 
@@ -19,7 +20,7 @@ export interface CodeProps extends Omit<TextProps, 'children'> {
19
20
  * Code component renders inline code or code blocks with monospace font
20
21
  */
21
22
  export const Code = forwardRef<any, CodeProps>((props, ref) => {
22
- const { children, color, block = false, style, ...others} = props;
23
+ const { children, color, block = false, style, withTextWrapper: shouldWrapInText = true, ...others} = props;
23
24
 
24
25
  const theme = useTheme();
25
26
 
@@ -52,23 +53,27 @@ export const Code = forwardRef<any, CodeProps>((props, ref) => {
52
53
  },
53
54
  style,
54
55
  ]}
56
+ {...others}
55
57
  >
56
- <Text
57
- style={[
58
- {
59
- fontFamily: 'Courier',
60
- fontSize: theme.fontSizes.sm as number || 14,
61
- color: textColor,
62
- },
63
- ]}
64
- {...others}
65
- >
66
- {children}
67
- </Text>
58
+ {withTextWrapper(
59
+ children,
60
+ shouldWrapInText,
61
+ {
62
+ fontFamily: 'Courier',
63
+ fontSize: theme.fontSizes.sm as number || 14,
64
+ color: textColor,
65
+ }
66
+ )}
68
67
  </BoxView>
69
68
  );
70
69
  }
71
70
 
71
+ // For inline code, we need to return a component that can accept the ref
72
+ // So we wrap in a View-like Text component
73
+ if (!shouldWrapInText) {
74
+ return children;
75
+ }
76
+
72
77
  return (
73
78
  <Text
74
79
  ref={ref}
@@ -46,6 +46,7 @@ export const Collapse = forwardRef<any, CollapseProps>((props, ref) => {
46
46
  } = useComponentDefaultProps('Collapse', defaultProps, props);
47
47
 
48
48
  const [contentHeight, setContentHeight] = useState<number>(0);
49
+ const [isFirstLayout, setIsFirstLayout] = useState(true);
49
50
  const heightAnim = useRef(new Animated.Value(opened ? 1 : 0)).current;
50
51
  const opacityAnim = useRef(new Animated.Value(opened ? 1 : 0)).current;
51
52
 
@@ -53,10 +54,18 @@ export const Collapse = forwardRef<any, CollapseProps>((props, ref) => {
53
54
  const { height } = event.nativeEvent.layout;
54
55
  if (height > 0 && height !== contentHeight) {
55
56
  setContentHeight(height);
57
+ if (isFirstLayout) {
58
+ setIsFirstLayout(false);
59
+ }
56
60
  }
57
61
  };
58
62
 
59
63
  useEffect(() => {
64
+ // Don't animate on first render or if content height hasn't been measured yet
65
+ if (isFirstLayout || contentHeight === 0) {
66
+ return;
67
+ }
68
+
60
69
  const animations = [
61
70
  Animated.timing(heightAnim, {
62
71
  toValue: opened ? 1 : 0,
@@ -80,11 +89,11 @@ export const Collapse = forwardRef<any, CollapseProps>((props, ref) => {
80
89
  onTransitionEnd();
81
90
  }
82
91
  });
83
- }, [opened, heightAnim, opacityAnim, transitionDuration, animateOpacity, onTransitionEnd]);
92
+ }, [opened, heightAnim, opacityAnim, transitionDuration, animateOpacity, onTransitionEnd, contentHeight, isFirstLayout]);
84
93
 
85
94
  const animatedHeight = heightAnim.interpolate({
86
95
  inputRange: [0, 1],
87
- outputRange: [0, contentHeight || 0],
96
+ outputRange: [0, contentHeight],
88
97
  });
89
98
 
90
99
  return (