@metamask-previews/design-system-react-native 0.24.0-preview.178e60f → 0.26.0-preview.047f96c

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 (507) hide show
  1. package/CHANGELOG.md +30 -1
  2. package/dist/components/ActionListItem/ActionListItem.cjs +1 -1
  3. package/dist/components/ActionListItem/ActionListItem.cjs.map +1 -1
  4. package/dist/components/ActionListItem/ActionListItem.mjs +1 -1
  5. package/dist/components/ActionListItem/ActionListItem.mjs.map +1 -1
  6. package/dist/components/ActionListItem/ActionListItem.types.d.cts +1 -1
  7. package/dist/components/ActionListItem/ActionListItem.types.d.cts.map +1 -1
  8. package/dist/components/ActionListItem/ActionListItem.types.d.mts +1 -1
  9. package/dist/components/ActionListItem/ActionListItem.types.d.mts.map +1 -1
  10. package/dist/components/AvatarBase/AvatarBase.cjs +1 -1
  11. package/dist/components/AvatarBase/AvatarBase.cjs.map +1 -1
  12. package/dist/components/AvatarBase/AvatarBase.mjs +1 -1
  13. package/dist/components/AvatarBase/AvatarBase.mjs.map +1 -1
  14. package/dist/components/AvatarBase/AvatarBase.types.d.cts +1 -1
  15. package/dist/components/AvatarBase/AvatarBase.types.d.cts.map +1 -1
  16. package/dist/components/AvatarBase/AvatarBase.types.d.mts +1 -1
  17. package/dist/components/AvatarBase/AvatarBase.types.d.mts.map +1 -1
  18. package/dist/components/AvatarGroup/AvatarGroup.cjs +1 -1
  19. package/dist/components/AvatarGroup/AvatarGroup.cjs.map +1 -1
  20. package/dist/components/AvatarGroup/AvatarGroup.mjs +1 -1
  21. package/dist/components/AvatarGroup/AvatarGroup.mjs.map +1 -1
  22. package/dist/components/AvatarGroup/AvatarGroup.types.d.cts +1 -1
  23. package/dist/components/AvatarGroup/AvatarGroup.types.d.cts.map +1 -1
  24. package/dist/components/AvatarGroup/AvatarGroup.types.d.mts +1 -1
  25. package/dist/components/AvatarGroup/AvatarGroup.types.d.mts.map +1 -1
  26. package/dist/components/BadgeCount/BadgeCount.cjs +1 -1
  27. package/dist/components/BadgeCount/BadgeCount.cjs.map +1 -1
  28. package/dist/components/BadgeCount/BadgeCount.mjs +1 -1
  29. package/dist/components/BadgeCount/BadgeCount.mjs.map +1 -1
  30. package/dist/components/BadgeCount/BadgeCount.types.d.cts +1 -1
  31. package/dist/components/BadgeCount/BadgeCount.types.d.cts.map +1 -1
  32. package/dist/components/BadgeCount/BadgeCount.types.d.mts +1 -1
  33. package/dist/components/BadgeCount/BadgeCount.types.d.mts.map +1 -1
  34. package/dist/components/BadgeIcon/BadgeIcon.cjs +1 -1
  35. package/dist/components/BadgeIcon/BadgeIcon.cjs.map +1 -1
  36. package/dist/components/BadgeIcon/BadgeIcon.mjs +1 -1
  37. package/dist/components/BadgeIcon/BadgeIcon.mjs.map +1 -1
  38. package/dist/components/BadgeIcon/BadgeIcon.types.d.cts +1 -1
  39. package/dist/components/BadgeIcon/BadgeIcon.types.d.cts.map +1 -1
  40. package/dist/components/BadgeIcon/BadgeIcon.types.d.mts +1 -1
  41. package/dist/components/BadgeIcon/BadgeIcon.types.d.mts.map +1 -1
  42. package/dist/components/BadgeStatus/BadgeStatus.cjs +1 -1
  43. package/dist/components/BadgeStatus/BadgeStatus.cjs.map +1 -1
  44. package/dist/components/BadgeStatus/BadgeStatus.mjs +1 -1
  45. package/dist/components/BadgeStatus/BadgeStatus.mjs.map +1 -1
  46. package/dist/components/BadgeStatus/BadgeStatus.types.d.cts +1 -1
  47. package/dist/components/BadgeStatus/BadgeStatus.types.d.cts.map +1 -1
  48. package/dist/components/BadgeStatus/BadgeStatus.types.d.mts +1 -1
  49. package/dist/components/BadgeStatus/BadgeStatus.types.d.mts.map +1 -1
  50. package/dist/components/BadgeWrapper/BadgeWrapper.cjs +1 -1
  51. package/dist/components/BadgeWrapper/BadgeWrapper.cjs.map +1 -1
  52. package/dist/components/BadgeWrapper/BadgeWrapper.mjs +1 -1
  53. package/dist/components/BadgeWrapper/BadgeWrapper.mjs.map +1 -1
  54. package/dist/components/BadgeWrapper/BadgeWrapper.types.d.cts +1 -1
  55. package/dist/components/BadgeWrapper/BadgeWrapper.types.d.cts.map +1 -1
  56. package/dist/components/BadgeWrapper/BadgeWrapper.types.d.mts +1 -1
  57. package/dist/components/BadgeWrapper/BadgeWrapper.types.d.mts.map +1 -1
  58. package/dist/components/BannerBase/BannerBase.types.d.cts +1 -1
  59. package/dist/components/BannerBase/BannerBase.types.d.cts.map +1 -1
  60. package/dist/components/BannerBase/BannerBase.types.d.mts +1 -1
  61. package/dist/components/BannerBase/BannerBase.types.d.mts.map +1 -1
  62. package/dist/components/BottomSheet/BottomSheet.cjs +6 -6
  63. package/dist/components/BottomSheet/BottomSheet.cjs.map +1 -1
  64. package/dist/components/BottomSheet/BottomSheet.d.cts +0 -35
  65. package/dist/components/BottomSheet/BottomSheet.d.cts.map +1 -1
  66. package/dist/components/BottomSheet/BottomSheet.d.mts +0 -35
  67. package/dist/components/BottomSheet/BottomSheet.d.mts.map +1 -1
  68. package/dist/components/BottomSheet/BottomSheet.mjs +6 -6
  69. package/dist/components/BottomSheet/BottomSheet.mjs.map +1 -1
  70. package/dist/components/BottomSheetDialog/BottomSheetDialog.cjs +28 -17
  71. package/dist/components/BottomSheetDialog/BottomSheetDialog.cjs.map +1 -1
  72. package/dist/components/BottomSheetDialog/BottomSheetDialog.d.cts +0 -35
  73. package/dist/components/BottomSheetDialog/BottomSheetDialog.d.cts.map +1 -1
  74. package/dist/components/BottomSheetDialog/BottomSheetDialog.d.mts +0 -35
  75. package/dist/components/BottomSheetDialog/BottomSheetDialog.d.mts.map +1 -1
  76. package/dist/components/BottomSheetDialog/BottomSheetDialog.mjs +30 -19
  77. package/dist/components/BottomSheetDialog/BottomSheetDialog.mjs.map +1 -1
  78. package/dist/components/BottomSheetDialog/BottomSheetDialog.types.cjs.map +1 -1
  79. package/dist/components/BottomSheetDialog/BottomSheetDialog.types.d.cts +1 -9
  80. package/dist/components/BottomSheetDialog/BottomSheetDialog.types.d.cts.map +1 -1
  81. package/dist/components/BottomSheetDialog/BottomSheetDialog.types.d.mts +1 -9
  82. package/dist/components/BottomSheetDialog/BottomSheetDialog.types.d.mts.map +1 -1
  83. package/dist/components/BottomSheetDialog/BottomSheetDialog.types.mjs.map +1 -1
  84. package/dist/components/BottomSheetFooter/BottomSheetFooter.cjs +1 -1
  85. package/dist/components/BottomSheetFooter/BottomSheetFooter.cjs.map +1 -1
  86. package/dist/components/BottomSheetFooter/BottomSheetFooter.mjs +1 -1
  87. package/dist/components/BottomSheetFooter/BottomSheetFooter.mjs.map +1 -1
  88. package/dist/components/BottomSheetFooter/BottomSheetFooter.types.d.cts +1 -1
  89. package/dist/components/BottomSheetFooter/BottomSheetFooter.types.d.cts.map +1 -1
  90. package/dist/components/BottomSheetFooter/BottomSheetFooter.types.d.mts +1 -1
  91. package/dist/components/BottomSheetFooter/BottomSheetFooter.types.d.mts.map +1 -1
  92. package/dist/components/BottomSheetOverlay/BottomSheetOverlay.cjs +1 -1
  93. package/dist/components/BottomSheetOverlay/BottomSheetOverlay.cjs.map +1 -1
  94. package/dist/components/BottomSheetOverlay/BottomSheetOverlay.mjs +1 -1
  95. package/dist/components/BottomSheetOverlay/BottomSheetOverlay.mjs.map +1 -1
  96. package/dist/components/BottomSheetOverlay/BottomSheetOverlay.types.d.cts +1 -1
  97. package/dist/components/BottomSheetOverlay/BottomSheetOverlay.types.d.cts.map +1 -1
  98. package/dist/components/BottomSheetOverlay/BottomSheetOverlay.types.d.mts +1 -1
  99. package/dist/components/BottomSheetOverlay/BottomSheetOverlay.types.d.mts.map +1 -1
  100. package/dist/components/Box/Box.cjs +1 -1
  101. package/dist/components/Box/Box.cjs.map +1 -1
  102. package/dist/components/Box/Box.d.cts +1 -1
  103. package/dist/components/Box/Box.d.cts.map +1 -1
  104. package/dist/components/Box/Box.d.mts +1 -1
  105. package/dist/components/Box/Box.d.mts.map +1 -1
  106. package/dist/components/Box/Box.mjs +1 -1
  107. package/dist/components/Box/Box.mjs.map +1 -1
  108. package/dist/components/Box/Box.types.d.cts +1 -1
  109. package/dist/components/Box/Box.types.d.cts.map +1 -1
  110. package/dist/components/Box/Box.types.d.mts +1 -1
  111. package/dist/components/Box/Box.types.d.mts.map +1 -1
  112. package/dist/components/ButtonBase/ButtonBase.types.d.cts +1 -2
  113. package/dist/components/ButtonBase/ButtonBase.types.d.cts.map +1 -1
  114. package/dist/components/ButtonBase/ButtonBase.types.d.mts +1 -2
  115. package/dist/components/ButtonBase/ButtonBase.types.d.mts.map +1 -1
  116. package/dist/components/ButtonIcon/ButtonIcon.types.d.cts +1 -1
  117. package/dist/components/ButtonIcon/ButtonIcon.types.d.cts.map +1 -1
  118. package/dist/components/ButtonIcon/ButtonIcon.types.d.mts +1 -1
  119. package/dist/components/ButtonIcon/ButtonIcon.types.d.mts.map +1 -1
  120. package/dist/components/Card/Card.cjs +2 -2
  121. package/dist/components/Card/Card.cjs.map +1 -1
  122. package/dist/components/Card/Card.mjs +2 -2
  123. package/dist/components/Card/Card.mjs.map +1 -1
  124. package/dist/components/Card/Card.types.cjs.map +1 -1
  125. package/dist/components/Card/Card.types.d.cts +2 -2
  126. package/dist/components/Card/Card.types.d.cts.map +1 -1
  127. package/dist/components/Card/Card.types.d.mts +2 -2
  128. package/dist/components/Card/Card.types.d.mts.map +1 -1
  129. package/dist/components/Card/Card.types.mjs.map +1 -1
  130. package/dist/components/Checkbox/Checkbox.cjs +1 -1
  131. package/dist/components/Checkbox/Checkbox.cjs.map +1 -1
  132. package/dist/components/Checkbox/Checkbox.d.cts +1 -1
  133. package/dist/components/Checkbox/Checkbox.d.cts.map +1 -1
  134. package/dist/components/Checkbox/Checkbox.d.mts +1 -1
  135. package/dist/components/Checkbox/Checkbox.d.mts.map +1 -1
  136. package/dist/components/Checkbox/Checkbox.mjs +1 -1
  137. package/dist/components/Checkbox/Checkbox.mjs.map +1 -1
  138. package/dist/components/Checkbox/Checkbox.types.d.cts +1 -1
  139. package/dist/components/Checkbox/Checkbox.types.d.cts.map +1 -1
  140. package/dist/components/Checkbox/Checkbox.types.d.mts +1 -1
  141. package/dist/components/Checkbox/Checkbox.types.d.mts.map +1 -1
  142. package/dist/components/HeaderBase/HeaderBase.cjs +1 -1
  143. package/dist/components/HeaderBase/HeaderBase.cjs.map +1 -1
  144. package/dist/components/HeaderBase/HeaderBase.mjs +1 -1
  145. package/dist/components/HeaderBase/HeaderBase.mjs.map +1 -1
  146. package/dist/components/HeaderBase/HeaderBase.types.d.cts +1 -1
  147. package/dist/components/HeaderBase/HeaderBase.types.d.cts.map +1 -1
  148. package/dist/components/HeaderBase/HeaderBase.types.d.mts +1 -1
  149. package/dist/components/HeaderBase/HeaderBase.types.d.mts.map +1 -1
  150. package/dist/components/HeaderRoot/HeaderRoot.types.d.cts +1 -1
  151. package/dist/components/HeaderRoot/HeaderRoot.types.d.cts.map +1 -1
  152. package/dist/components/HeaderRoot/HeaderRoot.types.d.mts +1 -1
  153. package/dist/components/HeaderRoot/HeaderRoot.types.d.mts.map +1 -1
  154. package/dist/components/Icon/assets/telegram.svg +1 -3
  155. package/dist/components/Input/Input.cjs +1 -1
  156. package/dist/components/Input/Input.cjs.map +1 -1
  157. package/dist/components/Input/Input.d.cts +1 -2
  158. package/dist/components/Input/Input.d.cts.map +1 -1
  159. package/dist/components/Input/Input.d.mts +1 -2
  160. package/dist/components/Input/Input.d.mts.map +1 -1
  161. package/dist/components/Input/Input.mjs +1 -1
  162. package/dist/components/Input/Input.mjs.map +1 -1
  163. package/dist/components/Input/Input.types.d.cts +1 -1
  164. package/dist/components/Input/Input.types.d.cts.map +1 -1
  165. package/dist/components/Input/Input.types.d.mts +1 -1
  166. package/dist/components/Input/Input.types.d.mts.map +1 -1
  167. package/dist/components/KeyValueColumn/KeyValueColumn.types.d.cts +1 -1
  168. package/dist/components/KeyValueColumn/KeyValueColumn.types.d.cts.map +1 -1
  169. package/dist/components/KeyValueColumn/KeyValueColumn.types.d.mts +1 -1
  170. package/dist/components/KeyValueColumn/KeyValueColumn.types.d.mts.map +1 -1
  171. package/dist/components/KeyValueRow/KeyValueRow.types.d.cts +1 -1
  172. package/dist/components/KeyValueRow/KeyValueRow.types.d.cts.map +1 -1
  173. package/dist/components/KeyValueRow/KeyValueRow.types.d.mts +1 -1
  174. package/dist/components/KeyValueRow/KeyValueRow.types.d.mts.map +1 -1
  175. package/dist/components/ListItem/ListItem.cjs +1 -1
  176. package/dist/components/ListItem/ListItem.cjs.map +1 -1
  177. package/dist/components/ListItem/ListItem.mjs +1 -1
  178. package/dist/components/ListItem/ListItem.mjs.map +1 -1
  179. package/dist/components/ListItem/ListItem.types.d.cts +1 -1
  180. package/dist/components/ListItem/ListItem.types.d.cts.map +1 -1
  181. package/dist/components/ListItem/ListItem.types.d.mts +1 -1
  182. package/dist/components/ListItem/ListItem.types.d.mts.map +1 -1
  183. package/dist/components/MainActionButton/MainActionButton.types.d.cts +1 -1
  184. package/dist/components/MainActionButton/MainActionButton.types.d.cts.map +1 -1
  185. package/dist/components/MainActionButton/MainActionButton.types.d.mts +1 -1
  186. package/dist/components/MainActionButton/MainActionButton.types.d.mts.map +1 -1
  187. package/dist/components/RadioButton/RadioButton.cjs +1 -1
  188. package/dist/components/RadioButton/RadioButton.cjs.map +1 -1
  189. package/dist/components/RadioButton/RadioButton.mjs +1 -1
  190. package/dist/components/RadioButton/RadioButton.mjs.map +1 -1
  191. package/dist/components/RadioButton/RadioButton.types.d.cts +1 -2
  192. package/dist/components/RadioButton/RadioButton.types.d.cts.map +1 -1
  193. package/dist/components/RadioButton/RadioButton.types.d.mts +1 -2
  194. package/dist/components/RadioButton/RadioButton.types.d.mts.map +1 -1
  195. package/dist/components/SectionDivider/SectionDivider.cjs +47 -0
  196. package/dist/components/SectionDivider/SectionDivider.cjs.map +1 -0
  197. package/dist/components/SectionDivider/SectionDivider.d.cts +6 -0
  198. package/dist/components/SectionDivider/SectionDivider.d.cts.map +1 -0
  199. package/dist/components/SectionDivider/SectionDivider.d.mts +6 -0
  200. package/dist/components/SectionDivider/SectionDivider.d.mts.map +1 -0
  201. package/dist/components/SectionDivider/SectionDivider.mjs +28 -0
  202. package/dist/components/SectionDivider/SectionDivider.mjs.map +1 -0
  203. package/dist/components/SectionDivider/SectionDivider.types.cjs +3 -0
  204. package/dist/components/SectionDivider/SectionDivider.types.cjs.map +1 -0
  205. package/dist/components/SectionDivider/SectionDivider.types.d.cts +3 -0
  206. package/dist/components/SectionDivider/SectionDivider.types.d.cts.map +1 -0
  207. package/dist/components/SectionDivider/SectionDivider.types.d.mts +3 -0
  208. package/dist/components/SectionDivider/SectionDivider.types.d.mts.map +1 -0
  209. package/dist/components/SectionDivider/SectionDivider.types.mjs +2 -0
  210. package/dist/components/SectionDivider/SectionDivider.types.mjs.map +1 -0
  211. package/dist/components/SectionDivider/index.cjs +6 -0
  212. package/dist/components/SectionDivider/index.cjs.map +1 -0
  213. package/dist/components/SectionDivider/index.d.cts +3 -0
  214. package/dist/components/SectionDivider/index.d.cts.map +1 -0
  215. package/dist/components/SectionDivider/index.d.mts +3 -0
  216. package/dist/components/SectionDivider/index.d.mts.map +1 -0
  217. package/dist/components/SectionDivider/index.mjs +2 -0
  218. package/dist/components/SectionDivider/index.mjs.map +1 -0
  219. package/dist/components/SectionHeader/SectionHeader.cjs +45 -0
  220. package/dist/components/SectionHeader/SectionHeader.cjs.map +1 -0
  221. package/dist/components/SectionHeader/SectionHeader.d.cts +23 -0
  222. package/dist/components/SectionHeader/SectionHeader.d.cts.map +1 -0
  223. package/dist/components/SectionHeader/SectionHeader.d.mts +23 -0
  224. package/dist/components/SectionHeader/SectionHeader.d.mts.map +1 -0
  225. package/dist/components/SectionHeader/SectionHeader.mjs +45 -0
  226. package/dist/components/SectionHeader/SectionHeader.mjs.map +1 -0
  227. package/dist/components/SectionHeader/SectionHeader.types.cjs +3 -0
  228. package/dist/components/SectionHeader/SectionHeader.types.cjs.map +1 -0
  229. package/dist/components/SectionHeader/SectionHeader.types.d.cts +32 -0
  230. package/dist/components/SectionHeader/SectionHeader.types.d.cts.map +1 -0
  231. package/dist/components/SectionHeader/SectionHeader.types.d.mts +32 -0
  232. package/dist/components/SectionHeader/SectionHeader.types.d.mts.map +1 -0
  233. package/dist/components/SectionHeader/SectionHeader.types.mjs +2 -0
  234. package/dist/components/SectionHeader/SectionHeader.types.mjs.map +1 -0
  235. package/dist/components/SectionHeader/index.cjs +6 -0
  236. package/dist/components/SectionHeader/index.cjs.map +1 -0
  237. package/dist/components/SectionHeader/index.d.cts +3 -0
  238. package/dist/components/SectionHeader/index.d.cts.map +1 -0
  239. package/dist/components/SectionHeader/index.d.mts +3 -0
  240. package/dist/components/SectionHeader/index.d.mts.map +1 -0
  241. package/dist/components/SectionHeader/index.mjs +2 -0
  242. package/dist/components/SectionHeader/index.mjs.map +1 -0
  243. package/dist/components/SegmentButton/SegmentButton.cjs +86 -0
  244. package/dist/components/SegmentButton/SegmentButton.cjs.map +1 -0
  245. package/dist/components/SegmentButton/SegmentButton.d.cts +7 -0
  246. package/dist/components/SegmentButton/SegmentButton.d.cts.map +1 -0
  247. package/dist/components/SegmentButton/SegmentButton.d.mts +7 -0
  248. package/dist/components/SegmentButton/SegmentButton.d.mts.map +1 -0
  249. package/dist/components/SegmentButton/SegmentButton.mjs +66 -0
  250. package/dist/components/SegmentButton/SegmentButton.mjs.map +1 -0
  251. package/dist/components/SegmentButton/SegmentButton.types.cjs +3 -0
  252. package/dist/components/SegmentButton/SegmentButton.types.cjs.map +1 -0
  253. package/dist/components/SegmentButton/SegmentButton.types.d.cts +9 -0
  254. package/dist/components/SegmentButton/SegmentButton.types.d.cts.map +1 -0
  255. package/dist/components/SegmentButton/SegmentButton.types.d.mts +9 -0
  256. package/dist/components/SegmentButton/SegmentButton.types.d.mts.map +1 -0
  257. package/dist/components/SegmentButton/SegmentButton.types.mjs +2 -0
  258. package/dist/components/SegmentButton/SegmentButton.types.mjs.map +1 -0
  259. package/dist/components/SegmentButton/index.cjs +8 -0
  260. package/dist/components/SegmentButton/index.cjs.map +1 -0
  261. package/dist/components/SegmentButton/index.d.cts +4 -0
  262. package/dist/components/SegmentButton/index.d.cts.map +1 -0
  263. package/dist/components/SegmentButton/index.d.mts +4 -0
  264. package/dist/components/SegmentButton/index.d.mts.map +1 -0
  265. package/dist/components/SegmentButton/index.mjs +3 -0
  266. package/dist/components/SegmentButton/index.mjs.map +1 -0
  267. package/dist/components/SegmentGroup/SegmentGroup.cjs +47 -0
  268. package/dist/components/SegmentGroup/SegmentGroup.cjs.map +1 -0
  269. package/dist/components/SegmentGroup/SegmentGroup.d.cts +7 -0
  270. package/dist/components/SegmentGroup/SegmentGroup.d.cts.map +1 -0
  271. package/dist/components/SegmentGroup/SegmentGroup.d.mts +7 -0
  272. package/dist/components/SegmentGroup/SegmentGroup.d.mts.map +1 -0
  273. package/dist/components/SegmentGroup/SegmentGroup.mjs +27 -0
  274. package/dist/components/SegmentGroup/SegmentGroup.mjs.map +1 -0
  275. package/dist/components/SegmentGroup/SegmentGroup.types.cjs +3 -0
  276. package/dist/components/SegmentGroup/SegmentGroup.types.cjs.map +1 -0
  277. package/dist/components/SegmentGroup/SegmentGroup.types.d.cts +12 -0
  278. package/dist/components/SegmentGroup/SegmentGroup.types.d.cts.map +1 -0
  279. package/dist/components/SegmentGroup/SegmentGroup.types.d.mts +12 -0
  280. package/dist/components/SegmentGroup/SegmentGroup.types.d.mts.map +1 -0
  281. package/dist/components/SegmentGroup/SegmentGroup.types.mjs +2 -0
  282. package/dist/components/SegmentGroup/SegmentGroup.types.mjs.map +1 -0
  283. package/dist/components/SegmentGroup/index.cjs +6 -0
  284. package/dist/components/SegmentGroup/index.cjs.map +1 -0
  285. package/dist/components/SegmentGroup/index.d.cts +3 -0
  286. package/dist/components/SegmentGroup/index.d.cts.map +1 -0
  287. package/dist/components/SegmentGroup/index.d.mts +3 -0
  288. package/dist/components/SegmentGroup/index.d.mts.map +1 -0
  289. package/dist/components/SegmentGroup/index.mjs +2 -0
  290. package/dist/components/SegmentGroup/index.mjs.map +1 -0
  291. package/dist/components/SelectButton/SelectButton.cjs +53 -0
  292. package/dist/components/SelectButton/SelectButton.cjs.map +1 -0
  293. package/dist/components/SelectButton/SelectButton.constants.cjs +12 -0
  294. package/dist/components/SelectButton/SelectButton.constants.cjs.map +1 -0
  295. package/dist/components/SelectButton/SelectButton.constants.d.cts +4 -0
  296. package/dist/components/SelectButton/SelectButton.constants.d.cts.map +1 -0
  297. package/dist/components/SelectButton/SelectButton.constants.d.mts +4 -0
  298. package/dist/components/SelectButton/SelectButton.constants.d.mts.map +1 -0
  299. package/dist/components/SelectButton/SelectButton.constants.mjs +9 -0
  300. package/dist/components/SelectButton/SelectButton.constants.mjs.map +1 -0
  301. package/dist/components/SelectButton/SelectButton.d.cts +7 -0
  302. package/dist/components/SelectButton/SelectButton.d.cts.map +1 -0
  303. package/dist/components/SelectButton/SelectButton.d.mts +7 -0
  304. package/dist/components/SelectButton/SelectButton.d.mts.map +1 -0
  305. package/dist/components/SelectButton/SelectButton.mjs +53 -0
  306. package/dist/components/SelectButton/SelectButton.mjs.map +1 -0
  307. package/dist/components/SelectButton/SelectButton.types.cjs +3 -0
  308. package/dist/components/SelectButton/SelectButton.types.cjs.map +1 -0
  309. package/dist/components/SelectButton/SelectButton.types.d.cts +13 -0
  310. package/dist/components/SelectButton/SelectButton.types.d.cts.map +1 -0
  311. package/dist/components/SelectButton/SelectButton.types.d.mts +13 -0
  312. package/dist/components/SelectButton/SelectButton.types.d.mts.map +1 -0
  313. package/dist/components/SelectButton/SelectButton.types.mjs +2 -0
  314. package/dist/components/SelectButton/SelectButton.types.mjs.map +1 -0
  315. package/dist/components/SelectButton/index.cjs +10 -0
  316. package/dist/components/SelectButton/index.cjs.map +1 -0
  317. package/dist/components/SelectButton/index.d.cts +4 -0
  318. package/dist/components/SelectButton/index.d.cts.map +1 -0
  319. package/dist/components/SelectButton/index.d.mts +4 -0
  320. package/dist/components/SelectButton/index.d.mts.map +1 -0
  321. package/dist/components/SelectButton/index.mjs +3 -0
  322. package/dist/components/SelectButton/index.mjs.map +1 -0
  323. package/dist/components/SensitiveText/SensitiveText.cjs +4 -4
  324. package/dist/components/SensitiveText/SensitiveText.cjs.map +1 -1
  325. package/dist/components/SensitiveText/SensitiveText.d.cts.map +1 -1
  326. package/dist/components/SensitiveText/SensitiveText.d.mts.map +1 -1
  327. package/dist/components/SensitiveText/SensitiveText.mjs +1 -1
  328. package/dist/components/SensitiveText/SensitiveText.mjs.map +1 -1
  329. package/dist/components/SensitiveText/SensitiveText.types.cjs.map +1 -1
  330. package/dist/components/SensitiveText/SensitiveText.types.d.cts +6 -34
  331. package/dist/components/SensitiveText/SensitiveText.types.d.cts.map +1 -1
  332. package/dist/components/SensitiveText/SensitiveText.types.d.mts +6 -34
  333. package/dist/components/SensitiveText/SensitiveText.types.d.mts.map +1 -1
  334. package/dist/components/SensitiveText/SensitiveText.types.mjs.map +1 -1
  335. package/dist/components/SensitiveText/index.cjs +3 -3
  336. package/dist/components/SensitiveText/index.cjs.map +1 -1
  337. package/dist/components/SensitiveText/index.d.cts +1 -1
  338. package/dist/components/SensitiveText/index.d.cts.map +1 -1
  339. package/dist/components/SensitiveText/index.d.mts +1 -1
  340. package/dist/components/SensitiveText/index.d.mts.map +1 -1
  341. package/dist/components/SensitiveText/index.mjs +1 -1
  342. package/dist/components/SensitiveText/index.mjs.map +1 -1
  343. package/dist/components/Skeleton/Skeleton.cjs +1 -1
  344. package/dist/components/Skeleton/Skeleton.cjs.map +1 -1
  345. package/dist/components/Skeleton/Skeleton.mjs +1 -1
  346. package/dist/components/Skeleton/Skeleton.mjs.map +1 -1
  347. package/dist/components/Skeleton/Skeleton.types.d.cts +1 -1
  348. package/dist/components/Skeleton/Skeleton.types.d.cts.map +1 -1
  349. package/dist/components/Skeleton/Skeleton.types.d.mts +1 -1
  350. package/dist/components/Skeleton/Skeleton.types.d.mts.map +1 -1
  351. package/dist/components/TabEmptyState/TabEmptyState.types.d.cts +1 -1
  352. package/dist/components/TabEmptyState/TabEmptyState.types.d.cts.map +1 -1
  353. package/dist/components/TabEmptyState/TabEmptyState.types.d.mts +1 -1
  354. package/dist/components/TabEmptyState/TabEmptyState.types.d.mts.map +1 -1
  355. package/dist/components/Tag/Tag.types.d.cts +1 -1
  356. package/dist/components/Tag/Tag.types.d.cts.map +1 -1
  357. package/dist/components/Tag/Tag.types.d.mts +1 -1
  358. package/dist/components/Tag/Tag.types.d.mts.map +1 -1
  359. package/dist/components/Text/Text.cjs +1 -1
  360. package/dist/components/Text/Text.cjs.map +1 -1
  361. package/dist/components/Text/Text.mjs +1 -1
  362. package/dist/components/Text/Text.mjs.map +1 -1
  363. package/dist/components/Text/Text.types.d.cts +1 -1
  364. package/dist/components/Text/Text.types.d.cts.map +1 -1
  365. package/dist/components/Text/Text.types.d.mts +1 -1
  366. package/dist/components/Text/Text.types.d.mts.map +1 -1
  367. package/dist/components/TextArea/TextArea.cjs +1 -1
  368. package/dist/components/TextArea/TextArea.cjs.map +1 -1
  369. package/dist/components/TextArea/TextArea.d.cts +20 -16
  370. package/dist/components/TextArea/TextArea.d.cts.map +1 -1
  371. package/dist/components/TextArea/TextArea.d.mts +20 -16
  372. package/dist/components/TextArea/TextArea.d.mts.map +1 -1
  373. package/dist/components/TextArea/TextArea.mjs +1 -1
  374. package/dist/components/TextArea/TextArea.mjs.map +1 -1
  375. package/dist/components/TextArea/TextArea.types.d.cts +1 -1
  376. package/dist/components/TextArea/TextArea.types.d.cts.map +1 -1
  377. package/dist/components/TextArea/TextArea.types.d.mts +1 -1
  378. package/dist/components/TextArea/TextArea.types.d.mts.map +1 -1
  379. package/dist/components/TextButton/TextButton.types.d.cts +0 -1
  380. package/dist/components/TextButton/TextButton.types.d.cts.map +1 -1
  381. package/dist/components/TextButton/TextButton.types.d.mts +0 -1
  382. package/dist/components/TextButton/TextButton.types.d.mts.map +1 -1
  383. package/dist/components/TextField/TextField.cjs +1 -1
  384. package/dist/components/TextField/TextField.cjs.map +1 -1
  385. package/dist/components/TextField/TextField.d.cts +20 -16
  386. package/dist/components/TextField/TextField.d.cts.map +1 -1
  387. package/dist/components/TextField/TextField.d.mts +20 -16
  388. package/dist/components/TextField/TextField.d.mts.map +1 -1
  389. package/dist/components/TextField/TextField.mjs +1 -1
  390. package/dist/components/TextField/TextField.mjs.map +1 -1
  391. package/dist/components/TextField/TextField.types.d.cts +1 -1
  392. package/dist/components/TextField/TextField.types.d.cts.map +1 -1
  393. package/dist/components/TextField/TextField.types.d.mts +1 -1
  394. package/dist/components/TextField/TextField.types.d.mts.map +1 -1
  395. package/dist/components/TextFieldSearch/TextFieldSearch.d.cts +20 -15
  396. package/dist/components/TextFieldSearch/TextFieldSearch.d.cts.map +1 -1
  397. package/dist/components/TextFieldSearch/TextFieldSearch.d.mts +20 -15
  398. package/dist/components/TextFieldSearch/TextFieldSearch.d.mts.map +1 -1
  399. package/dist/components/TitleAlert/TitleAlert.cjs +54 -0
  400. package/dist/components/TitleAlert/TitleAlert.cjs.map +1 -0
  401. package/dist/components/TitleAlert/TitleAlert.d.cts +21 -0
  402. package/dist/components/TitleAlert/TitleAlert.d.cts.map +1 -0
  403. package/dist/components/TitleAlert/TitleAlert.d.mts +21 -0
  404. package/dist/components/TitleAlert/TitleAlert.d.mts.map +1 -0
  405. package/dist/components/TitleAlert/TitleAlert.mjs +54 -0
  406. package/dist/components/TitleAlert/TitleAlert.mjs.map +1 -0
  407. package/dist/components/TitleAlert/TitleAlert.types.cjs +3 -0
  408. package/dist/components/TitleAlert/TitleAlert.types.cjs.map +1 -0
  409. package/dist/components/TitleAlert/TitleAlert.types.d.cts +31 -0
  410. package/dist/components/TitleAlert/TitleAlert.types.d.cts.map +1 -0
  411. package/dist/components/TitleAlert/TitleAlert.types.d.mts +31 -0
  412. package/dist/components/TitleAlert/TitleAlert.types.d.mts.map +1 -0
  413. package/dist/components/TitleAlert/TitleAlert.types.mjs +2 -0
  414. package/dist/components/TitleAlert/TitleAlert.types.mjs.map +1 -0
  415. package/dist/components/TitleAlert/index.cjs +6 -0
  416. package/dist/components/TitleAlert/index.cjs.map +1 -0
  417. package/dist/components/TitleAlert/index.d.cts +3 -0
  418. package/dist/components/TitleAlert/index.d.cts.map +1 -0
  419. package/dist/components/TitleAlert/index.d.mts +3 -0
  420. package/dist/components/TitleAlert/index.d.mts.map +1 -0
  421. package/dist/components/TitleAlert/index.mjs +2 -0
  422. package/dist/components/TitleAlert/index.mjs.map +1 -0
  423. package/dist/components/TitleHub/TitleHub.types.d.cts +1 -1
  424. package/dist/components/TitleHub/TitleHub.types.d.cts.map +1 -1
  425. package/dist/components/TitleHub/TitleHub.types.d.mts +1 -1
  426. package/dist/components/TitleHub/TitleHub.types.d.mts.map +1 -1
  427. package/dist/components/TitleStandard/TitleStandard.types.d.cts +1 -1
  428. package/dist/components/TitleStandard/TitleStandard.types.d.cts.map +1 -1
  429. package/dist/components/TitleStandard/TitleStandard.types.d.mts +1 -1
  430. package/dist/components/TitleStandard/TitleStandard.types.d.mts.map +1 -1
  431. package/dist/components/TitleSubpage/TitleSubpage.types.d.cts +1 -1
  432. package/dist/components/TitleSubpage/TitleSubpage.types.d.cts.map +1 -1
  433. package/dist/components/TitleSubpage/TitleSubpage.types.d.mts +1 -1
  434. package/dist/components/TitleSubpage/TitleSubpage.types.d.mts.map +1 -1
  435. package/dist/components/Toast/Toast.types.d.cts +1 -1
  436. package/dist/components/Toast/Toast.types.d.cts.map +1 -1
  437. package/dist/components/Toast/Toast.types.d.mts +1 -1
  438. package/dist/components/Toast/Toast.types.d.mts.map +1 -1
  439. package/dist/components/Toast/Toaster.cjs +1 -1
  440. package/dist/components/Toast/Toaster.cjs.map +1 -1
  441. package/dist/components/Toast/Toaster.mjs +1 -1
  442. package/dist/components/Toast/Toaster.mjs.map +1 -1
  443. package/dist/components/index.cjs +18 -2
  444. package/dist/components/index.cjs.map +1 -1
  445. package/dist/components/index.d.cts +12 -0
  446. package/dist/components/index.d.cts.map +1 -1
  447. package/dist/components/index.d.mts +12 -0
  448. package/dist/components/index.d.mts.map +1 -1
  449. package/dist/components/index.mjs +6 -0
  450. package/dist/components/index.mjs.map +1 -1
  451. package/dist/components/temp-components/Blockies/Blockies.cjs +1 -1
  452. package/dist/components/temp-components/Blockies/Blockies.cjs.map +1 -1
  453. package/dist/components/temp-components/Blockies/Blockies.mjs +1 -1
  454. package/dist/components/temp-components/Blockies/Blockies.mjs.map +1 -1
  455. package/dist/components/temp-components/Blockies/Blockies.types.d.cts +1 -1
  456. package/dist/components/temp-components/Blockies/Blockies.types.d.cts.map +1 -1
  457. package/dist/components/temp-components/Blockies/Blockies.types.d.mts +1 -1
  458. package/dist/components/temp-components/Blockies/Blockies.types.d.mts.map +1 -1
  459. package/dist/components/temp-components/ButtonAnimated/ButtonAnimated.cjs +1 -1
  460. package/dist/components/temp-components/ButtonAnimated/ButtonAnimated.cjs.map +1 -1
  461. package/dist/components/temp-components/ButtonAnimated/ButtonAnimated.mjs +1 -1
  462. package/dist/components/temp-components/ButtonAnimated/ButtonAnimated.mjs.map +1 -1
  463. package/dist/components/temp-components/ButtonAnimated/ButtonAnimated.types.d.cts +1 -1
  464. package/dist/components/temp-components/ButtonAnimated/ButtonAnimated.types.d.cts.map +1 -1
  465. package/dist/components/temp-components/ButtonAnimated/ButtonAnimated.types.d.mts +1 -1
  466. package/dist/components/temp-components/ButtonAnimated/ButtonAnimated.types.d.mts.map +1 -1
  467. package/dist/components/temp-components/ImageOrSvg/ImageOrSvg.cjs +1 -1
  468. package/dist/components/temp-components/ImageOrSvg/ImageOrSvg.cjs.map +1 -1
  469. package/dist/components/temp-components/ImageOrSvg/ImageOrSvg.mjs +1 -1
  470. package/dist/components/temp-components/ImageOrSvg/ImageOrSvg.mjs.map +1 -1
  471. package/dist/components/temp-components/ImageOrSvg/ImageOrSvg.types.d.cts +1 -2
  472. package/dist/components/temp-components/ImageOrSvg/ImageOrSvg.types.d.cts.map +1 -1
  473. package/dist/components/temp-components/ImageOrSvg/ImageOrSvg.types.d.mts +1 -2
  474. package/dist/components/temp-components/ImageOrSvg/ImageOrSvg.types.d.mts.map +1 -1
  475. package/dist/components/temp-components/Jazzicon/Jazzicon.cjs +1 -1
  476. package/dist/components/temp-components/Jazzicon/Jazzicon.cjs.map +1 -1
  477. package/dist/components/temp-components/Jazzicon/Jazzicon.mjs +1 -1
  478. package/dist/components/temp-components/Jazzicon/Jazzicon.mjs.map +1 -1
  479. package/dist/components/temp-components/Maskicon/Maskicon.cjs +1 -1
  480. package/dist/components/temp-components/Maskicon/Maskicon.cjs.map +1 -1
  481. package/dist/components/temp-components/Maskicon/Maskicon.mjs +1 -1
  482. package/dist/components/temp-components/Maskicon/Maskicon.mjs.map +1 -1
  483. package/dist/components/temp-components/Spinner/Spinner.cjs +1 -1
  484. package/dist/components/temp-components/Spinner/Spinner.cjs.map +1 -1
  485. package/dist/components/temp-components/Spinner/Spinner.mjs +1 -1
  486. package/dist/components/temp-components/Spinner/Spinner.mjs.map +1 -1
  487. package/dist/components/temp-components/Spinner/Spinner.types.d.cts +1 -1
  488. package/dist/components/temp-components/Spinner/Spinner.types.d.cts.map +1 -1
  489. package/dist/components/temp-components/Spinner/Spinner.types.d.mts +1 -1
  490. package/dist/components/temp-components/Spinner/Spinner.types.d.mts.map +1 -1
  491. package/dist/test-utils/createRenderer.cjs +41 -0
  492. package/dist/test-utils/createRenderer.cjs.map +1 -0
  493. package/dist/test-utils/createRenderer.d.cts +4 -0
  494. package/dist/test-utils/createRenderer.d.cts.map +1 -0
  495. package/dist/test-utils/createRenderer.d.mts +4 -0
  496. package/dist/test-utils/createRenderer.d.mts.map +1 -0
  497. package/dist/test-utils/createRenderer.mjs +18 -0
  498. package/dist/test-utils/createRenderer.mjs.map +1 -0
  499. package/package.json +19 -20
  500. package/dist/components/SensitiveText/SensitiveText.constants.cjs +0 -14
  501. package/dist/components/SensitiveText/SensitiveText.constants.cjs.map +0 -1
  502. package/dist/components/SensitiveText/SensitiveText.constants.d.cts +0 -11
  503. package/dist/components/SensitiveText/SensitiveText.constants.d.cts.map +0 -1
  504. package/dist/components/SensitiveText/SensitiveText.constants.d.mts +0 -11
  505. package/dist/components/SensitiveText/SensitiveText.constants.d.mts.map +0 -1
  506. package/dist/components/SensitiveText/SensitiveText.constants.mjs +0 -11
  507. package/dist/components/SensitiveText/SensitiveText.constants.mjs.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"BadgeStatus.mjs","sourceRoot":"","sources":["../../../src/components/BadgeStatus/BadgeStatus.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,eAAe,EAAE,gDAAgD;AAC1E,OAAO,EAAE,WAAW,EAAE,sDAAsD;AAC5E,OAAO,MAAK,cAAc;;AAC1B,OAAO,EAAE,IAAI,EAAE,8BAAqB;AAEpC,OAAO,EACL,oCAAoC,EACpC,2BAA2B,EAC5B,oCAAgC;AAGjC,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,EAC1B,MAAM,EACN,IAAI,GAAG,eAAe,CAAC,EAAE,EACzB,SAAS,GAAG,IAAI,EAChB,WAAW,EACX,KAAK,EACL,GAAG,KAAK,EACS,EAAE,EAAE;IACrB,MAAM,EAAE,GAAG,WAAW,EAAE,CAAC;IAEzB,OAAO,CACL,CAAC,IAAI,CACH,IAAI,KAAK,CAAC,CACV,KAAK,CAAC,CAAC;YACL,EAAE,CAAC,KAAK,CACN,yBAAyB,EACzB,SAAS,IAAI,oCAAoC,EACjD,WAAW,CACZ;YACD,KAAK;SACN,CAAC,CAEF;MAAA,CAAC,IAAI,CACH,KAAK,CAAC,CAAC;YACL,EAAE,CAAC,KAAK,CACN,uBAAuB,EACvB,2BAA2B,CAAC,IAAI,CAAC,EACjC,oCAAoC,CAAC,MAAM,CAAC,CAC7C;SACF,CAAC,EAEN;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { BadgeStatusSize } from '@metamask-previews/design-system-shared';\nimport { useTailwind } from '@metamask-previews/design-system-twrnc-preset';\nimport React from 'react';\nimport { View } from 'react-native';\n\nimport {\n TWCLASSMAP_BADGESTATUS_STATUS_CIRCLE,\n TWCLASSMAP_BADGESTATUS_SIZE,\n} from './BadgeStatus.constants';\nimport type { BadgeStatusProps } from './BadgeStatus.types';\n\nexport const BadgeStatus = ({\n status,\n size = BadgeStatusSize.Md,\n hasBorder = true,\n twClassName,\n style,\n ...props\n}: BadgeStatusProps) => {\n const tw = useTailwind();\n\n return (\n <View\n {...props}\n style={[\n tw.style(\n 'self-start rounded-full',\n hasBorder && 'border-2 border-background-default',\n twClassName,\n ),\n style,\n ]}\n >\n <View\n style={[\n tw.style(\n 'rounded-full border-2',\n TWCLASSMAP_BADGESTATUS_SIZE[size],\n TWCLASSMAP_BADGESTATUS_STATUS_CIRCLE[status],\n ),\n ]}\n />\n </View>\n );\n};\n"]}
1
+ {"version":3,"file":"BadgeStatus.mjs","sourceRoot":"","sources":["../../../src/components/BadgeStatus/BadgeStatus.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,eAAe,EAAE,gDAAgD;AAC1E,OAAO,EAAE,WAAW,EAAE,sDAAsD;AAC5E,OAAO,MAAK,cAAc;;AAC1B,OAAO,EAAE,IAAI,EAAE,qBAAqB;AAEpC,OAAO,EACL,oCAAoC,EACpC,2BAA2B,EAC5B,oCAAgC;AAGjC,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,EAC1B,MAAM,EACN,IAAI,GAAG,eAAe,CAAC,EAAE,EACzB,SAAS,GAAG,IAAI,EAChB,WAAW,EACX,KAAK,EACL,GAAG,KAAK,EACS,EAAE,EAAE;IACrB,MAAM,EAAE,GAAG,WAAW,EAAE,CAAC;IAEzB,OAAO,CACL,CAAC,IAAI,CACH,IAAI,KAAK,CAAC,CACV,KAAK,CAAC,CAAC;YACL,EAAE,CAAC,KAAK,CACN,yBAAyB,EACzB,SAAS,IAAI,oCAAoC,EACjD,WAAW,CACZ;YACD,KAAK;SACN,CAAC,CAEF;MAAA,CAAC,IAAI,CACH,KAAK,CAAC,CAAC;YACL,EAAE,CAAC,KAAK,CACN,uBAAuB,EACvB,2BAA2B,CAAC,IAAI,CAAC,EACjC,oCAAoC,CAAC,MAAM,CAAC,CAC7C;SACF,CAAC,EAEN;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { BadgeStatusSize } from '@metamask-previews/design-system-shared';\nimport { useTailwind } from '@metamask-previews/design-system-twrnc-preset';\nimport React from 'react';\nimport { View } from 'react-native';\n\nimport {\n TWCLASSMAP_BADGESTATUS_STATUS_CIRCLE,\n TWCLASSMAP_BADGESTATUS_SIZE,\n} from './BadgeStatus.constants';\nimport type { BadgeStatusProps } from './BadgeStatus.types';\n\nexport const BadgeStatus = ({\n status,\n size = BadgeStatusSize.Md,\n hasBorder = true,\n twClassName,\n style,\n ...props\n}: BadgeStatusProps) => {\n const tw = useTailwind();\n\n return (\n <View\n {...props}\n style={[\n tw.style(\n 'self-start rounded-full',\n hasBorder && 'border-2 border-background-default',\n twClassName,\n ),\n style,\n ]}\n >\n <View\n style={[\n tw.style(\n 'rounded-full border-2',\n TWCLASSMAP_BADGESTATUS_SIZE[size],\n TWCLASSMAP_BADGESTATUS_STATUS_CIRCLE[status],\n ),\n ]}\n />\n </View>\n );\n};\n"]}
@@ -1,5 +1,5 @@
1
1
  import type { BadgeStatusPropsShared } from "@metamask-previews/design-system-shared";
2
- import type { ViewProps } from "react-native/index.js";
2
+ import type { ViewProps } from "react-native";
3
3
  /**
4
4
  * BadgeStatus component props (React Native platform-specific)
5
5
  * Extends shared props from @metamask-previews/design-system-shared with React Native specific platform concerns
@@ -1 +1 @@
1
- {"version":3,"file":"BadgeStatus.types.d.cts","sourceRoot":"","sources":["../../../src/components/BadgeStatus/BadgeStatus.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,gDAAgD;AACtF,OAAO,KAAK,EAAE,SAAS,EAAE,8BAAqB;AAE9C;;;GAGG;AACH,MAAM,MAAM,gBAAgB,GAAG,sBAAsB,GACnD,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC,GAAG;IAC5B;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC"}
1
+ {"version":3,"file":"BadgeStatus.types.d.cts","sourceRoot":"","sources":["../../../src/components/BadgeStatus/BadgeStatus.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,gDAAgD;AACtF,OAAO,KAAK,EAAE,SAAS,EAAE,qBAAqB;AAE9C;;;GAGG;AACH,MAAM,MAAM,gBAAgB,GAAG,sBAAsB,GACnD,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC,GAAG;IAC5B;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import type { BadgeStatusPropsShared } from "@metamask-previews/design-system-shared";
2
- import type { ViewProps } from "react-native/index.js";
2
+ import type { ViewProps } from "react-native";
3
3
  /**
4
4
  * BadgeStatus component props (React Native platform-specific)
5
5
  * Extends shared props from @metamask-previews/design-system-shared with React Native specific platform concerns
@@ -1 +1 @@
1
- {"version":3,"file":"BadgeStatus.types.d.mts","sourceRoot":"","sources":["../../../src/components/BadgeStatus/BadgeStatus.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,gDAAgD;AACtF,OAAO,KAAK,EAAE,SAAS,EAAE,8BAAqB;AAE9C;;;GAGG;AACH,MAAM,MAAM,gBAAgB,GAAG,sBAAsB,GACnD,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC,GAAG;IAC5B;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC"}
1
+ {"version":3,"file":"BadgeStatus.types.d.mts","sourceRoot":"","sources":["../../../src/components/BadgeStatus/BadgeStatus.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,gDAAgD;AACtF,OAAO,KAAK,EAAE,SAAS,EAAE,qBAAqB;AAE9C;;;GAGG;AACH,MAAM,MAAM,gBAAgB,GAAG,sBAAsB,GACnD,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC,GAAG;IAC5B;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC"}
@@ -27,7 +27,7 @@ exports.BadgeWrapper = void 0;
27
27
  const design_system_shared_1 = require("@metamask-previews/design-system-shared");
28
28
  const design_system_twrnc_preset_1 = require("@metamask-previews/design-system-twrnc-preset");
29
29
  const react_1 = __importStar(require("react"));
30
- const react_native_1 = require("react-native/index.js");
30
+ const react_native_1 = require("react-native");
31
31
  const BadgeWrapper = ({ children, childrenContainerProps, badge, badgeContainerProps, position = design_system_shared_1.BadgeWrapperPosition.BottomRight, positionAnchorShape = design_system_shared_1.BadgeWrapperPositionAnchorShape.Circular, positionXOffset = 0, positionYOffset = 0, customPosition, twClassName, style, ...props }) => {
32
32
  const tw = (0, design_system_twrnc_preset_1.useTailwind)();
33
33
  const [anchorWidth, setAnchorWidth] = (0, react_1.useState)(0);
@@ -1 +1 @@
1
- {"version":3,"file":"BadgeWrapper.cjs","sourceRoot":"","sources":["../../../src/components/BadgeWrapper/BadgeWrapper.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kFAGiD;AACjD,8FAA4E;AAC5E,+CAA8D;AAE9D,wDAAoC;AAI7B,MAAM,YAAY,GAAG,CAAC,EAC3B,QAAQ,EACR,sBAAsB,EACtB,KAAK,EACL,mBAAmB,EACnB,QAAQ,GAAG,2CAAoB,CAAC,WAAW,EAC3C,mBAAmB,GAAG,sDAA+B,CAAC,QAAQ,EAC9D,eAAe,GAAG,CAAC,EACnB,eAAe,GAAG,CAAC,EACnB,cAAc,EACd,WAAW,EACX,KAAK,EACL,GAAG,KAAK,EACU,EAAE,EAAE;IACtB,MAAM,EAAE,GAAG,IAAA,wCAAW,GAAE,CAAC;IACzB,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG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CAAC,CACvB,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,UAAU,CAAC,EAAE,EAAE,GAAG,cAAc,EAAE,CAAC,CAAC,CACrD,IAAI,mBAAmB,CAAC,CAExB;QAAA,CAAC,KAAK,CACR;MAAA,EAAE,mBAAI,CACR;IAAA,EAAE,mBAAI,CAAC,CACR,CAAC;AACJ,CAAC,CAAC;AA3GW,QAAA,YAAY,gBA2GvB","sourcesContent":["import {\n BadgeWrapperPosition,\n BadgeWrapperPositionAnchorShape,\n} from '@metamask-previews/design-system-shared';\nimport { useTailwind } from '@metamask-previews/design-system-twrnc-preset';\nimport React, { useCallback, useState, useMemo } from 'react';\nimport type { LayoutChangeEvent } from 'react-native';\nimport { View } from 'react-native';\n\nimport type { BadgeWrapperProps } from './BadgeWrapper.types';\n\nexport const BadgeWrapper = ({\n children,\n childrenContainerProps,\n badge,\n badgeContainerProps,\n position = BadgeWrapperPosition.BottomRight,\n positionAnchorShape = BadgeWrapperPositionAnchorShape.Circular,\n positionXOffset = 0,\n positionYOffset = 0,\n customPosition,\n twClassName,\n style,\n ...props\n}: BadgeWrapperProps) => {\n const tw = useTailwind();\n const [anchorWidth, setAnchorWidth] = useState<number>(0);\n const [anchorHeight, setAnchorHeight] = useState<number>(0);\n const [badgeWidth, setbadgeWidth] = useState<number>(0);\n const [badgeHeight, setbadgeHeight] = useState<number>(0);\n\n // Fetching the dimensions of the anchor and bagde element to properly position the badge\n const getAnchorSize = useCallback((event: LayoutChangeEvent) => {\n const { width, height } = event.nativeEvent.layout;\n setAnchorWidth(width);\n setAnchorHeight(height);\n }, []);\n const getBadgeSize = useCallback((event: LayoutChangeEvent) => {\n const { width, height } = event.nativeEvent.layout;\n setbadgeWidth(width);\n setbadgeHeight(height);\n }, []);\n\n const finalPositions = useMemo(() => {\n if (customPosition) {\n return customPosition;\n }\n // 0.1464 is a mathematical coeeficient to move\n // from a 0,0 corner of a rectangular shape to the closest \"corner\"\n // of a circular shape anchor element\n const anchorShapeXOffset =\n positionAnchorShape === BadgeWrapperPositionAnchorShape.Rectangular\n ? 0\n : anchorWidth * 0.1464;\n const anchorShapeYOffset =\n positionAnchorShape === BadgeWrapperPositionAnchorShape.Rectangular\n ? 0\n : anchorHeight * 0.1464;\n // This is to center the badge in the corner of the anchor element\n const badgeCenteringXOffset = badgeWidth / 2;\n const badgeCenteringYOffset = badgeHeight / 2;\n\n const finalXOffset =\n anchorShapeXOffset - badgeCenteringXOffset + positionXOffset;\n const finalYOffset =\n anchorShapeYOffset - badgeCenteringYOffset + positionYOffset;\n switch (position) {\n case BadgeWrapperPosition.TopRight:\n return {\n top: finalYOffset,\n right: finalXOffset,\n };\n case BadgeWrapperPosition.BottomLeft:\n return {\n bottom: finalYOffset,\n left: finalXOffset,\n };\n case BadgeWrapperPosition.TopLeft:\n return {\n top: finalYOffset,\n left: finalXOffset,\n };\n case BadgeWrapperPosition.BottomRight:\n default:\n return {\n bottom: finalYOffset,\n right: finalXOffset,\n };\n }\n }, [\n position,\n positionAnchorShape,\n anchorWidth,\n anchorHeight,\n badgeWidth,\n badgeHeight,\n positionXOffset,\n positionYOffset,\n customPosition,\n ]);\n\n return (\n <View\n {...props}\n style={[tw.style('relative self-start', twClassName), style]}\n >\n <View onLayout={getAnchorSize} {...childrenContainerProps}>\n {children}\n </View>\n <View\n onLayout={getBadgeSize}\n style={[tw.style('absolute'), { ...finalPositions }]}\n {...badgeContainerProps}\n >\n {badge}\n </View>\n </View>\n );\n};\n"]}
1
+ {"version":3,"file":"BadgeWrapper.cjs","sourceRoot":"","sources":["../../../src/components/BadgeWrapper/BadgeWrapper.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kFAGiD;AACjD,8FAA4E;AAC5E,+CAA8D;AAE9D,+CAAoC;AAI7B,MAAM,YAAY,GAAG,CAAC,EAC3B,QAAQ,EACR,sBAAsB,EACtB,KAAK,EACL,mBAAmB,EACnB,QAAQ,GAAG,2CAAoB,CAAC,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CAAC,KAAK,CAAC,qBAAqB,EAAE,WAAW,CAAC,EAAE,KAAK,CAAC,CAAC,CAE7D;MAAA,CAAC,mBAAI,CAAC,QAAQ,CAAC,CAAC,aAAa,CAAC,CAAC,IAAI,sBAAsB,CAAC,CACxD;QAAA,CAAC,QAAQ,CACX;MAAA,EAAE,mBAAI,CACN;MAAA,CAAC,mBAAI,CACH,QAAQ,CAAC,CAAC,YAAY,CAAC,CACvB,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,UAAU,CAAC,EAAE,EAAE,GAAG,cAAc,EAAE,CAAC,CAAC,CACrD,IAAI,mBAAmB,CAAC,CAExB;QAAA,CAAC,KAAK,CACR;MAAA,EAAE,mBAAI,CACR;IAAA,EAAE,mBAAI,CAAC,CACR,CAAC;AACJ,CAAC,CAAC;AA3GW,QAAA,YAAY,gBA2GvB","sourcesContent":["import {\n BadgeWrapperPosition,\n BadgeWrapperPositionAnchorShape,\n} from '@metamask-previews/design-system-shared';\nimport { useTailwind } from '@metamask-previews/design-system-twrnc-preset';\nimport React, { useCallback, useState, useMemo } from 'react';\nimport type { LayoutChangeEvent } from 'react-native';\nimport { View } from 'react-native';\n\nimport type { BadgeWrapperProps } from './BadgeWrapper.types';\n\nexport const BadgeWrapper = ({\n children,\n childrenContainerProps,\n badge,\n badgeContainerProps,\n position = BadgeWrapperPosition.BottomRight,\n positionAnchorShape = BadgeWrapperPositionAnchorShape.Circular,\n positionXOffset = 0,\n positionYOffset = 0,\n customPosition,\n twClassName,\n style,\n ...props\n}: BadgeWrapperProps) => {\n const tw = useTailwind();\n const [anchorWidth, setAnchorWidth] = useState<number>(0);\n const [anchorHeight, setAnchorHeight] = useState<number>(0);\n const [badgeWidth, setbadgeWidth] = useState<number>(0);\n const [badgeHeight, setbadgeHeight] = useState<number>(0);\n\n // Fetching the dimensions of the anchor and bagde element to properly position the badge\n const getAnchorSize = useCallback((event: LayoutChangeEvent) => {\n const { width, height } = event.nativeEvent.layout;\n setAnchorWidth(width);\n setAnchorHeight(height);\n }, []);\n const getBadgeSize = useCallback((event: LayoutChangeEvent) => {\n const { width, height } = event.nativeEvent.layout;\n setbadgeWidth(width);\n setbadgeHeight(height);\n }, []);\n\n const finalPositions = useMemo(() => {\n if (customPosition) {\n return customPosition;\n }\n // 0.1464 is a mathematical coeeficient to move\n // from a 0,0 corner of a rectangular shape to the closest \"corner\"\n // of a circular shape anchor element\n const anchorShapeXOffset =\n positionAnchorShape === BadgeWrapperPositionAnchorShape.Rectangular\n ? 0\n : anchorWidth * 0.1464;\n const anchorShapeYOffset =\n positionAnchorShape === BadgeWrapperPositionAnchorShape.Rectangular\n ? 0\n : anchorHeight * 0.1464;\n // This is to center the badge in the corner of the anchor element\n const badgeCenteringXOffset = badgeWidth / 2;\n const badgeCenteringYOffset = badgeHeight / 2;\n\n const finalXOffset =\n anchorShapeXOffset - badgeCenteringXOffset + positionXOffset;\n const finalYOffset =\n anchorShapeYOffset - badgeCenteringYOffset + positionYOffset;\n switch (position) {\n case BadgeWrapperPosition.TopRight:\n return {\n top: finalYOffset,\n right: finalXOffset,\n };\n case BadgeWrapperPosition.BottomLeft:\n return {\n bottom: finalYOffset,\n left: finalXOffset,\n };\n case BadgeWrapperPosition.TopLeft:\n return {\n top: finalYOffset,\n left: finalXOffset,\n };\n case BadgeWrapperPosition.BottomRight:\n default:\n return {\n bottom: finalYOffset,\n right: finalXOffset,\n };\n }\n }, [\n position,\n positionAnchorShape,\n anchorWidth,\n anchorHeight,\n badgeWidth,\n badgeHeight,\n positionXOffset,\n positionYOffset,\n customPosition,\n ]);\n\n return (\n <View\n {...props}\n style={[tw.style('relative self-start', twClassName), style]}\n >\n <View onLayout={getAnchorSize} {...childrenContainerProps}>\n {children}\n </View>\n <View\n onLayout={getBadgeSize}\n style={[tw.style('absolute'), { ...finalPositions }]}\n {...badgeContainerProps}\n >\n {badge}\n </View>\n </View>\n );\n};\n"]}
@@ -8,7 +8,7 @@ import { BadgeWrapperPosition, BadgeWrapperPositionAnchorShape } from "@metamask
8
8
  import { useTailwind } from "@metamask-previews/design-system-twrnc-preset";
9
9
  import $React, { useCallback, useState, useMemo } from "react";
10
10
  const React = $importDefault($React);
11
- import { View } from "react-native/index.js";
11
+ import { View } from "react-native";
12
12
  export const BadgeWrapper = ({ children, childrenContainerProps, badge, badgeContainerProps, position = BadgeWrapperPosition.BottomRight, positionAnchorShape = BadgeWrapperPositionAnchorShape.Circular, positionXOffset = 0, positionYOffset = 0, customPosition, twClassName, style, ...props }) => {
13
13
  const tw = useTailwind();
14
14
  const [anchorWidth, setAnchorWidth] = useState(0);
@@ -1 +1 @@
1
- {"version":3,"file":"BadgeWrapper.mjs","sourceRoot":"","sources":["../../../src/components/BadgeWrapper/BadgeWrapper.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,EACL,oBAAoB,EACpB,+BAA+B,EAChC,gDAAgD;AACjD,OAAO,EAAE,WAAW,EAAE,sDAAsD;AAC5E,OAAO,QAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,OAAO,EAAE,cAAc;;AAE9D,OAAO,EAAE,IAAI,EAAE,8BAAqB;AAIpC,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,EAC3B,QAAQ,EACR,sBAAsB,EACtB,KAAK,EACL,mBAAmB,EACnB,QAAQ,GAAG,oBAAoB,CAAC,WAAW,EAC3C,mBAAmB,GAAG,+BAA+B,CAAC,QAAQ,EAC9D,eAAe,GAAG,CAAC,EACnB,eAAe,GAAG,CAAC,EACnB,cAAc,EACd,WAAW,EACX,KAAK,EACL,GAAG,KAAK,EACU,EAAE,EAAE;IACtB,MAAM,EAAE,GAAG,WAAW,EAAE,CAAC;IACzB,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,QAAQ,CAAS,CAAC,CAAC,CAAC;IAC1D,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,QAAQ,CAAS,CAAC,CAAC,CAAC;IAC5D,MAAM,CAAC,UAAU,EAAE,aAAa,CA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AI,CAAC,CACR,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import {\n BadgeWrapperPosition,\n BadgeWrapperPositionAnchorShape,\n} from '@metamask-previews/design-system-shared';\nimport { useTailwind } from '@metamask-previews/design-system-twrnc-preset';\nimport React, { useCallback, useState, useMemo } from 'react';\nimport type { LayoutChangeEvent } from 'react-native';\nimport { View } from 'react-native';\n\nimport type { BadgeWrapperProps } from './BadgeWrapper.types';\n\nexport const BadgeWrapper = ({\n children,\n childrenContainerProps,\n badge,\n badgeContainerProps,\n position = BadgeWrapperPosition.BottomRight,\n positionAnchorShape = BadgeWrapperPositionAnchorShape.Circular,\n positionXOffset = 0,\n positionYOffset = 0,\n customPosition,\n twClassName,\n style,\n ...props\n}: BadgeWrapperProps) => {\n const tw = useTailwind();\n const [anchorWidth, setAnchorWidth] = useState<number>(0);\n const [anchorHeight, setAnchorHeight] = useState<number>(0);\n const [badgeWidth, setbadgeWidth] = useState<number>(0);\n const [badgeHeight, setbadgeHeight] = useState<number>(0);\n\n // Fetching the dimensions of the anchor and bagde element to properly position the badge\n const getAnchorSize = useCallback((event: LayoutChangeEvent) => {\n const { width, height } = event.nativeEvent.layout;\n setAnchorWidth(width);\n setAnchorHeight(height);\n }, []);\n const getBadgeSize = useCallback((event: LayoutChangeEvent) => {\n const { width, height } = event.nativeEvent.layout;\n setbadgeWidth(width);\n setbadgeHeight(height);\n }, []);\n\n const finalPositions = useMemo(() => {\n if (customPosition) {\n return customPosition;\n }\n // 0.1464 is a mathematical coeeficient to move\n // from a 0,0 corner of a rectangular shape to the closest \"corner\"\n // of a circular shape anchor element\n const anchorShapeXOffset =\n positionAnchorShape === BadgeWrapperPositionAnchorShape.Rectangular\n ? 0\n : anchorWidth * 0.1464;\n const anchorShapeYOffset =\n positionAnchorShape === BadgeWrapperPositionAnchorShape.Rectangular\n ? 0\n : anchorHeight * 0.1464;\n // This is to center the badge in the corner of the anchor element\n const badgeCenteringXOffset = badgeWidth / 2;\n const badgeCenteringYOffset = badgeHeight / 2;\n\n const finalXOffset =\n anchorShapeXOffset - badgeCenteringXOffset + positionXOffset;\n const finalYOffset =\n anchorShapeYOffset - badgeCenteringYOffset + positionYOffset;\n switch (position) {\n case BadgeWrapperPosition.TopRight:\n return {\n top: finalYOffset,\n right: finalXOffset,\n };\n case BadgeWrapperPosition.BottomLeft:\n return {\n bottom: finalYOffset,\n left: finalXOffset,\n };\n case BadgeWrapperPosition.TopLeft:\n return {\n top: finalYOffset,\n left: finalXOffset,\n };\n case BadgeWrapperPosition.BottomRight:\n default:\n return {\n bottom: finalYOffset,\n right: finalXOffset,\n };\n }\n }, [\n position,\n positionAnchorShape,\n anchorWidth,\n anchorHeight,\n badgeWidth,\n badgeHeight,\n positionXOffset,\n positionYOffset,\n customPosition,\n ]);\n\n return (\n <View\n {...props}\n style={[tw.style('relative self-start', twClassName), style]}\n >\n <View onLayout={getAnchorSize} {...childrenContainerProps}>\n {children}\n </View>\n <View\n onLayout={getBadgeSize}\n style={[tw.style('absolute'), { ...finalPositions }]}\n {...badgeContainerProps}\n >\n {badge}\n </View>\n </View>\n );\n};\n"]}
1
+ {"version":3,"file":"BadgeWrapper.mjs","sourceRoot":"","sources":["../../../src/components/BadgeWrapper/BadgeWrapper.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,EACL,oBAAoB,EACpB,+BAA+B,EAChC,gDAAgD;AACjD,OAAO,EAAE,WAAW,EAAE,sDAAsD;AAC5E,OAAO,QAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,OAAO,EAAE,cAAc;;AAE9D,OAAO,EAAE,IAAI,EAAE,qBAAqB;AAIpC,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,EAC3B,QAAQ,EACR,sBAAsB,EACtB,KAAK,EACL,mBAAmB,EACnB,QAAQ,GAAG,oBAAoB,CAAC,WAAW,EAC3C,mBAAmB,GAAG,+BAA+B,CAAC,QAAQ,EAC9D,eAAe,GAAG,CAAC,EACnB,eAAe,GAAG,CAAC,EACnB,cAA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AA,CAAC,QAAQ,CACX;MAAA,EAAE,IAAI,CACN;MAAA,CAAC,IAAI,CACH,QAAQ,CAAC,CAAC,YAAY,CAAC,CACvB,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,UAAU,CAAC,EAAE,EAAE,GAAG,cAAc,EAAE,CAAC,CAAC,CACrD,IAAI,mBAAmB,CAAC,CAExB;QAAA,CAAC,KAAK,CACR;MAAA,EAAE,IAAI,CACR;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import {\n BadgeWrapperPosition,\n BadgeWrapperPositionAnchorShape,\n} from '@metamask-previews/design-system-shared';\nimport { useTailwind } from '@metamask-previews/design-system-twrnc-preset';\nimport React, { useCallback, useState, useMemo } from 'react';\nimport type { LayoutChangeEvent } from 'react-native';\nimport { View } from 'react-native';\n\nimport type { BadgeWrapperProps } from './BadgeWrapper.types';\n\nexport const BadgeWrapper = ({\n children,\n childrenContainerProps,\n badge,\n badgeContainerProps,\n position = BadgeWrapperPosition.BottomRight,\n positionAnchorShape = BadgeWrapperPositionAnchorShape.Circular,\n positionXOffset = 0,\n positionYOffset = 0,\n customPosition,\n twClassName,\n style,\n ...props\n}: BadgeWrapperProps) => {\n const tw = useTailwind();\n const [anchorWidth, setAnchorWidth] = useState<number>(0);\n const [anchorHeight, setAnchorHeight] = useState<number>(0);\n const [badgeWidth, setbadgeWidth] = useState<number>(0);\n const [badgeHeight, setbadgeHeight] = useState<number>(0);\n\n // Fetching the dimensions of the anchor and bagde element to properly position the badge\n const getAnchorSize = useCallback((event: LayoutChangeEvent) => {\n const { width, height } = event.nativeEvent.layout;\n setAnchorWidth(width);\n setAnchorHeight(height);\n }, []);\n const getBadgeSize = useCallback((event: LayoutChangeEvent) => {\n const { width, height } = event.nativeEvent.layout;\n setbadgeWidth(width);\n setbadgeHeight(height);\n }, []);\n\n const finalPositions = useMemo(() => {\n if (customPosition) {\n return customPosition;\n }\n // 0.1464 is a mathematical coeeficient to move\n // from a 0,0 corner of a rectangular shape to the closest \"corner\"\n // of a circular shape anchor element\n const anchorShapeXOffset =\n positionAnchorShape === BadgeWrapperPositionAnchorShape.Rectangular\n ? 0\n : anchorWidth * 0.1464;\n const anchorShapeYOffset =\n positionAnchorShape === BadgeWrapperPositionAnchorShape.Rectangular\n ? 0\n : anchorHeight * 0.1464;\n // This is to center the badge in the corner of the anchor element\n const badgeCenteringXOffset = badgeWidth / 2;\n const badgeCenteringYOffset = badgeHeight / 2;\n\n const finalXOffset =\n anchorShapeXOffset - badgeCenteringXOffset + positionXOffset;\n const finalYOffset =\n anchorShapeYOffset - badgeCenteringYOffset + positionYOffset;\n switch (position) {\n case BadgeWrapperPosition.TopRight:\n return {\n top: finalYOffset,\n right: finalXOffset,\n };\n case BadgeWrapperPosition.BottomLeft:\n return {\n bottom: finalYOffset,\n left: finalXOffset,\n };\n case BadgeWrapperPosition.TopLeft:\n return {\n top: finalYOffset,\n left: finalXOffset,\n };\n case BadgeWrapperPosition.BottomRight:\n default:\n return {\n bottom: finalYOffset,\n right: finalXOffset,\n };\n }\n }, [\n position,\n positionAnchorShape,\n anchorWidth,\n anchorHeight,\n badgeWidth,\n badgeHeight,\n positionXOffset,\n positionYOffset,\n customPosition,\n ]);\n\n return (\n <View\n {...props}\n style={[tw.style('relative self-start', twClassName), style]}\n >\n <View onLayout={getAnchorSize} {...childrenContainerProps}>\n {children}\n </View>\n <View\n onLayout={getBadgeSize}\n style={[tw.style('absolute'), { ...finalPositions }]}\n {...badgeContainerProps}\n >\n {badge}\n </View>\n </View>\n );\n};\n"]}
@@ -1,5 +1,5 @@
1
1
  import type { BadgeWrapperPropsShared } from "@metamask-previews/design-system-shared";
2
- import type { ViewProps, StyleProp, ViewStyle } from "react-native/index.js";
2
+ import type { ViewProps, StyleProp, ViewStyle } from "react-native";
3
3
  /**
4
4
  * BadgeWrapper component props (React Native platform-specific)
5
5
  * Extends shared props from @metamask-previews/design-system-shared with React Native-specific platform concerns
@@ -1 +1 @@
1
- {"version":3,"file":"BadgeWrapper.types.d.cts","sourceRoot":"","sources":["../../../src/components/BadgeWrapper/BadgeWrapper.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,gDAAgD;AACvF,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,8BAAqB;AAEpE;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GAAG,uBAAuB,GAAG;IACxD;;OAEG;IACH,sBAAsB,CAAC,EAAE,SAAS,CAAC;IACnC;;OAEG;IACH,mBAAmB,CAAC,EAAE,SAAS,CAAC;IAChC;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B,GAAG,SAAS,CAAC"}
1
+ {"version":3,"file":"BadgeWrapper.types.d.cts","sourceRoot":"","sources":["../../../src/components/BadgeWrapper/BadgeWrapper.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,gDAAgD;AACvF,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,qBAAqB;AAEpE;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GAAG,uBAAuB,GAAG;IACxD;;OAEG;IACH,sBAAsB,CAAC,EAAE,SAAS,CAAC;IACnC;;OAEG;IACH,mBAAmB,CAAC,EAAE,SAAS,CAAC;IAChC;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B,GAAG,SAAS,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import type { BadgeWrapperPropsShared } from "@metamask-previews/design-system-shared";
2
- import type { ViewProps, StyleProp, ViewStyle } from "react-native/index.js";
2
+ import type { ViewProps, StyleProp, ViewStyle } from "react-native";
3
3
  /**
4
4
  * BadgeWrapper component props (React Native platform-specific)
5
5
  * Extends shared props from @metamask-previews/design-system-shared with React Native-specific platform concerns
@@ -1 +1 @@
1
- {"version":3,"file":"BadgeWrapper.types.d.mts","sourceRoot":"","sources":["../../../src/components/BadgeWrapper/BadgeWrapper.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,gDAAgD;AACvF,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,8BAAqB;AAEpE;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GAAG,uBAAuB,GAAG;IACxD;;OAEG;IACH,sBAAsB,CAAC,EAAE,SAAS,CAAC;IACnC;;OAEG;IACH,mBAAmB,CAAC,EAAE,SAAS,CAAC;IAChC;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B,GAAG,SAAS,CAAC"}
1
+ {"version":3,"file":"BadgeWrapper.types.d.mts","sourceRoot":"","sources":["../../../src/components/BadgeWrapper/BadgeWrapper.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,gDAAgD;AACvF,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,qBAAqB;AAEpE;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GAAG,uBAAuB,GAAG;IACxD;;OAEG;IACH,sBAAsB,CAAC,EAAE,SAAS,CAAC;IACnC;;OAEG;IACH,mBAAmB,CAAC,EAAE,SAAS,CAAC;IAChC;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B,GAAG,SAAS,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import type { BannerBasePropsShared } from "@metamask-previews/design-system-shared";
2
- import type { GestureResponderEvent } from "react-native/index.js";
2
+ import type { GestureResponderEvent } from "react-native";
3
3
  import type { BoxProps } from "../Box/index.cjs";
4
4
  import type { ButtonProps } from "../Button/index.cjs";
5
5
  import type { ButtonIconProps } from "../ButtonIcon/index.cjs";
@@ -1 +1 @@
1
- {"version":3,"file":"BannerBase.types.d.cts","sourceRoot":"","sources":["../../../src/components/BannerBase/BannerBase.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,gDAAgD;AACrF,OAAO,KAAK,EAAE,qBAAqB,EAAE,8BAAqB;AAE1D,OAAO,KAAK,EAAE,QAAQ,EAAE,yBAAe;AACvC,OAAO,KAAK,EAAE,WAAW,EAAE,4BAAkB;AAC7C,OAAO,KAAK,EAAE,eAAe,EAAE,gCAAsB;AACrD,OAAO,KAAK,EAAE,SAAS,EAAE,0BAAgB;AAEzC,KAAK,2BAA2B,GAAG,IAAI,CACrC,OAAO,CAAC,WAAW,CAAC,EACpB,UAAU,GAAG,SAAS,GAAG,SAAS,CACnC,CAAC;AAEF,KAAK,0BAA0B,GAAG,IAAI,CACpC,OAAO,CAAC,eAAe,CAAC,EACxB,UAAU,GAAG,SAAS,CACvB,CAAC;AAEF,KAAK,mBAAmB,GAAG,qBAAqB,GAC9C,IAAI,CAAC,QAAQ,EAAE,UAAU,CAAC,GAAG;IAC3B;;OAEG;IACH,UAAU,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,UAAU,CAAC,CAAC;IAClD;;OAEG;IACH,gBAAgB,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,UAAU,CAAC,CAAC;IACxD;;OAEG;IACH,oBAAoB,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,UAAU,CAAC,CAAC;IAC5D;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,0BAA0B,CAAC;CAC/C,CAAC;AAEJ,KAAK,gCA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OAAO,CAAC,SAAS,CAAC,EAAE,UAAU,CAAC,CAAC;IACxD;;OAEG;IACH,oBAAoB,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,UAAU,CAAC,CAAC;IAC5D;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,0BAA0B,CAAC;CAC/C,CAAC;AAEJ,KAAK,gCAAgC,GAAG;IACtC,mBAAmB,EAAE,CAAC,KAAK,EAAE,qBAAqB,KAAK,IAAI,CAAC;IAC5D,iBAAiB,EAAE,MAAM,CAAC;IAC1B,iBAAiB,CAAC,EAAE,2BAA2B,CAAC;CACjD,CAAC;AAEF,KAAK,mCAAmC,GAAG;IACzC,mBAAmB,CAAC,EAAE,SAAS,CAAC;IAChC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,iBAAiB,CAAC,EAAE,2BAA2B,CAAC;CACjD,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,mBAAmB,GAC/C,CAAC,gCAAgC,GAAG,mCAAmC,CAAC,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import type { BannerBasePropsShared } from "@metamask-previews/design-system-shared";
2
- import type { GestureResponderEvent } from "react-native/index.js";
2
+ import type { GestureResponderEvent } from "react-native";
3
3
  import type { BoxProps } from "../Box/index.mjs";
4
4
  import type { ButtonProps } from "../Button/index.mjs";
5
5
  import type { ButtonIconProps } from "../ButtonIcon/index.mjs";
@@ -1 +1 @@
1
- {"version":3,"file":"BannerBase.types.d.mts","sourceRoot":"","sources":["../../../src/components/BannerBase/BannerBase.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,gDAAgD;AACrF,OAAO,KAAK,EAAE,qBAAqB,EAAE,8BAAqB;AAE1D,OAAO,KAAK,EAAE,QAAQ,EAAE,yBAAe;AACvC,OAAO,KAAK,EAAE,WAAW,EAAE,4BAAkB;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B,CAAC,EAAE,2BAA2B,CAAC;CACjD,CAAC;AAEF,KAAK,mCAAmC,GAAG;IACzC,mBAAmB,CAAC,EAAE,SAAS,CAAC;IAChC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,iBAAiB,CAAC,EAAE,2BAA2B,CAAC;CACjD,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,mBAAmB,GAC/C,CAAC,gCAAgC,GAAG,mCAAmC,CAAC,CAAC"}
@@ -26,15 +26,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
26
26
  exports.BottomSheet = void 0;
27
27
  const design_system_twrnc_preset_1 = require("@metamask-previews/design-system-twrnc-preset");
28
28
  const react_1 = __importStar(require("react"));
29
- const react_native_1 = require("react-native/index.js");
29
+ const react_native_1 = require("react-native");
30
30
  const react_native_safe_area_context_1 = require("react-native-safe-area-context");
31
31
  const BottomSheetDialog_1 = require("../BottomSheetDialog/index.cjs");
32
32
  const BottomSheetOverlay_1 = require("../BottomSheetOverlay/BottomSheetOverlay.cjs");
33
- exports.BottomSheet = (0, react_1.forwardRef)(({ children, onClose, onOpen, goBack, style, twClassName, isInteractable = true, isFullscreen = false, keyboardAvoidingViewEnabled = true, panGestureHandlerProps, ...props }, ref) => {
33
+ exports.BottomSheet = (0, react_1.forwardRef)(({ children, onClose, onOpen, goBack, style, twClassName, isInteractable = true, isFullscreen = false, keyboardAvoidingViewEnabled = true, ...props }, ref) => {
34
34
  const tw = (0, design_system_twrnc_preset_1.useTailwind)();
35
35
  const { bottom: screenBottomPadding } = (0, react_native_safe_area_context_1.useSafeAreaInsets)();
36
36
  const { y: frameY } = (0, react_native_safe_area_context_1.useSafeAreaFrame)();
37
- const postCallback = (0, react_1.useRef)();
37
+ const postCallback = (0, react_1.useRef)(undefined);
38
38
  const bottomSheetDialogRef = (0, react_1.useRef)(null);
39
39
  const didNavigateBackRef = (0, react_1.useRef)(false);
40
40
  const closeRequestedRef = (0, react_1.useRef)(false);
@@ -71,9 +71,9 @@ exports.BottomSheet = (0, react_1.forwardRef)(({ children, onClose, onOpen, goBa
71
71
  }
72
72
  return true;
73
73
  };
74
- react_native_1.BackHandler.addEventListener('hardwareBackPress', hardwareBackPress);
74
+ const subscription = react_native_1.BackHandler.addEventListener('hardwareBackPress', hardwareBackPress);
75
75
  return () => {
76
- react_native_1.BackHandler.removeEventListener('hardwareBackPress', hardwareBackPress);
76
+ subscription.remove();
77
77
  };
78
78
  }, [isInteractable]);
79
79
  (0, react_1.useImperativeHandle)(ref, () => ({
@@ -97,7 +97,7 @@ exports.BottomSheet = (0, react_1.forwardRef)(({ children, onClose, onOpen, goBa
97
97
  <BottomSheetOverlay_1.BottomSheetOverlay onPress={isInteractable
98
98
  ? () => bottomSheetDialogRef.current?.onCloseDialog()
99
99
  : undefined}/>
100
- <BottomSheetDialog_1.BottomSheetDialog isInteractable={isInteractable} onClose={onCloseCB} onOpen={onOpenCB} ref={bottomSheetDialogRef} isFullscreen={isFullscreen} twClassName={twClassName} keyboardAvoidingViewEnabled={keyboardAvoidingViewEnabled} panGestureHandlerProps={panGestureHandlerProps}>
100
+ <BottomSheetDialog_1.BottomSheetDialog isInteractable={isInteractable} onClose={onCloseCB} onOpen={onOpenCB} ref={bottomSheetDialogRef} isFullscreen={isFullscreen} twClassName={twClassName} keyboardAvoidingViewEnabled={keyboardAvoidingViewEnabled}>
101
101
  {children}
102
102
  </BottomSheetDialog_1.BottomSheetDialog>
103
103
  </react_native_1.KeyboardAvoidingView>);
@@ -1 +1 @@
1
- {"version":3,"file":"BottomSheet.cjs","sourceRoot":"","sources":["../../../src/components/BottomSheet/BottomSheet.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,8FAA4E;AAC5E,+CAMe;AACf,wDAA2E;AAC3E,mFAGwC;AAExC,sEAAyD;AAEzD,qFAA8E;AAQjE,QAAA,WAAW,GAAG,IAAA,kBAAU,EACnC,CACE,EACE,QAAQ,EACR,OAAO,EACP,MAAM,EACN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ACX;QAAA,EAAE,qCAAiB,CACrB;MAAA,EAAE,mCAAoB,CAAC,CACxB,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,mBAAW,CAAC,WAAW,GAAG,aAAa,CAAC","sourcesContent":["import { useTailwind } from '@metamask-previews/design-system-twrnc-preset';\nimport React, {\n forwardRef,\n useCallback,\n useEffect,\n useImperativeHandle,\n useRef,\n} from 'react';\nimport { BackHandler, KeyboardAvoidingView, Platform } from 'react-native';\nimport {\n useSafeAreaFrame,\n useSafeAreaInsets,\n} from 'react-native-safe-area-context';\n\nimport { BottomSheetDialog } from '../BottomSheetDialog';\nimport type { BottomSheetDialogRef } from '../BottomSheetDialog';\nimport { BottomSheetOverlay } from '../BottomSheetOverlay/BottomSheetOverlay';\n\nimport type {\n BottomSheetPostCallback,\n BottomSheetProps,\n BottomSheetRef,\n} from './BottomSheet.types';\n\nexport const BottomSheet = forwardRef<BottomSheetRef, BottomSheetProps>(\n (\n {\n children,\n onClose,\n onOpen,\n goBack,\n style,\n twClassName,\n isInteractable = true,\n isFullscreen = false,\n keyboardAvoidingViewEnabled = true,\n panGestureHandlerProps,\n ...props\n },\n ref,\n ) => {\n const tw = useTailwind();\n const { bottom: screenBottomPadding } = useSafeAreaInsets();\n const { y: frameY } = useSafeAreaFrame();\n const postCallback = useRef<BottomSheetPostCallback>();\n const bottomSheetDialogRef = useRef<BottomSheetDialogRef>(null);\n const didNavigateBackRef = useRef(false);\n const closeRequestedRef = useRef(false);\n const didRunPostCallbackRef = useRef(false);\n\n const onOpenCB = useCallback(() => {\n // Reset when the sheet is opened again.\n didNavigateBackRef.current = false;\n closeRequestedRef.current = false;\n didRunPostCallbackRef.current = false;\n\n onOpen?.(Boolean(postCallback.current));\n const callback = postCallback.current;\n postCallback.current = undefined;\n callback?.();\n }, [onOpen]);\n\n const onCloseCB = useCallback(() => {\n if (goBack && !didNavigateBackRef.current) {\n didNavigateBackRef.current = true;\n goBack?.();\n }\n\n const callback = postCallback.current;\n const hasCallback = Boolean(callback);\n\n onClose?.(hasCallback);\n\n if (!didRunPostCallbackRef.current && hasCallback) {\n didRunPostCallbackRef.current = true;\n postCallback.current = undefined;\n callback?.();\n }\n }, [goBack, onClose]);\n\n // Dismiss the sheet when Android back button is pressed.\n useEffect(() => {\n const hardwareBackPress = () => {\n if (isInteractable) {\n bottomSheetDialogRef.current?.onCloseDialog();\n }\n return true;\n };\n BackHandler.addEventListener('hardwareBackPress', hardwareBackPress);\n return () => {\n BackHandler.removeEventListener('hardwareBackPress', hardwareBackPress);\n };\n }, [isInteractable]);\n\n useImperativeHandle(ref, () => ({\n onCloseBottomSheet: (callback) => {\n if (closeRequestedRef.current) {\n return;\n }\n closeRequestedRef.current = true;\n postCallback.current = callback;\n bottomSheetDialogRef.current?.onCloseDialog();\n },\n onOpenBottomSheet: (callback) => {\n didNavigateBackRef.current = false;\n closeRequestedRef.current = false;\n didRunPostCallbackRef.current = false;\n postCallback.current = callback;\n bottomSheetDialogRef.current?.onOpenDialog();\n },\n }));\n\n return (\n <KeyboardAvoidingView\n behavior={Platform.OS === 'ios' ? 'padding' : undefined}\n keyboardVerticalOffset={\n Platform.OS === 'ios' ? -screenBottomPadding : frameY\n }\n style={[tw.style('absolute inset-0 justify-end'), style]}\n enabled={keyboardAvoidingViewEnabled}\n {...props}\n >\n <BottomSheetOverlay\n onPress={\n isInteractable\n ? () => bottomSheetDialogRef.current?.onCloseDialog()\n : undefined\n }\n />\n <BottomSheetDialog\n isInteractable={isInteractable}\n onClose={onCloseCB}\n onOpen={onOpenCB}\n ref={bottomSheetDialogRef}\n isFullscreen={isFullscreen}\n twClassName={twClassName}\n keyboardAvoidingViewEnabled={keyboardAvoidingViewEnabled}\n panGestureHandlerProps={panGestureHandlerProps}\n >\n {children}\n </BottomSheetDialog>\n </KeyboardAvoidingView>\n );\n },\n);\n\nBottomSheet.displayName = 'BottomSheet';\n"]}
1
+ {"version":3,"file":"BottomSheet.cjs","sourceRoot":"","sources":["../../../src/components/BottomSheet/Bottom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,CAAC,CAAC,oBAAoB,CAAC,CAC1B,YAAY,CAAC,CAAC,YAAY,CAAC,CAC3B,WAAW,CAAC,CAAC,WAAW,CAAC,CACzB,2BAA2B,CAAC,CAAC,2BAA2B,CAAC,CAEzD;UAAA,CAAC,QAAQ,CACX;QAAA,EAAE,qCAAiB,CACrB;MAAA,EAAE,mCAAoB,CAAC,CACxB,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,mBAAW,CAAC,WAAW,GAAG,aAAa,CAAC","sourcesContent":["import { useTailwind } from '@metamask-previews/design-system-twrnc-preset';\nimport React, {\n forwardRef,\n useCallback,\n useEffect,\n useImperativeHandle,\n useRef,\n} from 'react';\nimport { BackHandler, KeyboardAvoidingView, Platform } from 'react-native';\nimport {\n useSafeAreaFrame,\n useSafeAreaInsets,\n} from 'react-native-safe-area-context';\n\nimport { BottomSheetDialog } from '../BottomSheetDialog';\nimport type { BottomSheetDialogRef } from '../BottomSheetDialog';\nimport { BottomSheetOverlay } from '../BottomSheetOverlay/BottomSheetOverlay';\n\nimport type {\n BottomSheetPostCallback,\n BottomSheetProps,\n BottomSheetRef,\n} from './BottomSheet.types';\n\nexport const BottomSheet = forwardRef<BottomSheetRef, BottomSheetProps>(\n (\n {\n children,\n onClose,\n onOpen,\n goBack,\n style,\n twClassName,\n isInteractable = true,\n isFullscreen = false,\n keyboardAvoidingViewEnabled = true,\n ...props\n },\n ref,\n ) => {\n const tw = useTailwind();\n const { bottom: screenBottomPadding } = useSafeAreaInsets();\n const { y: frameY } = useSafeAreaFrame();\n const postCallback = useRef<BottomSheetPostCallback | undefined>(undefined);\n const bottomSheetDialogRef = useRef<BottomSheetDialogRef>(null);\n const didNavigateBackRef = useRef(false);\n const closeRequestedRef = useRef(false);\n const didRunPostCallbackRef = useRef(false);\n\n const onOpenCB = useCallback(() => {\n // Reset when the sheet is opened again.\n didNavigateBackRef.current = false;\n closeRequestedRef.current = false;\n didRunPostCallbackRef.current = false;\n\n onOpen?.(Boolean(postCallback.current));\n const callback = postCallback.current;\n postCallback.current = undefined;\n callback?.();\n }, [onOpen]);\n\n const onCloseCB = useCallback(() => {\n if (goBack && !didNavigateBackRef.current) {\n didNavigateBackRef.current = true;\n goBack?.();\n }\n\n const callback = postCallback.current;\n const hasCallback = Boolean(callback);\n\n onClose?.(hasCallback);\n\n if (!didRunPostCallbackRef.current && hasCallback) {\n didRunPostCallbackRef.current = true;\n postCallback.current = undefined;\n callback?.();\n }\n }, [goBack, onClose]);\n\n // Dismiss the sheet when Android back button is pressed.\n useEffect(() => {\n const hardwareBackPress = () => {\n if (isInteractable) {\n bottomSheetDialogRef.current?.onCloseDialog();\n }\n return true;\n };\n const subscription = BackHandler.addEventListener(\n 'hardwareBackPress',\n hardwareBackPress,\n );\n return () => {\n subscription.remove();\n };\n }, [isInteractable]);\n\n useImperativeHandle(ref, () => ({\n onCloseBottomSheet: (callback) => {\n if (closeRequestedRef.current) {\n return;\n }\n closeRequestedRef.current = true;\n postCallback.current = callback;\n bottomSheetDialogRef.current?.onCloseDialog();\n },\n onOpenBottomSheet: (callback) => {\n didNavigateBackRef.current = false;\n closeRequestedRef.current = false;\n didRunPostCallbackRef.current = false;\n postCallback.current = callback;\n bottomSheetDialogRef.current?.onOpenDialog();\n },\n }));\n\n return (\n <KeyboardAvoidingView\n behavior={Platform.OS === 'ios' ? 'padding' : undefined}\n keyboardVerticalOffset={\n Platform.OS === 'ios' ? -screenBottomPadding : frameY\n }\n style={[tw.style('absolute inset-0 justify-end'), style]}\n enabled={keyboardAvoidingViewEnabled}\n {...props}\n >\n <BottomSheetOverlay\n onPress={\n isInteractable\n ? () => bottomSheetDialogRef.current?.onCloseDialog()\n : undefined\n }\n />\n <BottomSheetDialog\n isInteractable={isInteractable}\n onClose={onCloseCB}\n onOpen={onOpenCB}\n ref={bottomSheetDialogRef}\n isFullscreen={isFullscreen}\n twClassName={twClassName}\n keyboardAvoidingViewEnabled={keyboardAvoidingViewEnabled}\n >\n {children}\n </BottomSheetDialog>\n </KeyboardAvoidingView>\n );\n },\n);\n\nBottomSheet.displayName = 'BottomSheet';\n"]}
@@ -10,41 +10,6 @@ export declare const BottomSheet: React.ForwardRefExoticComponent<{
10
10
  keyboardAvoidingViewEnabled?: boolean | undefined;
11
11
  onClose?: ((hasPendingAction?: boolean | undefined) => void) | undefined;
12
12
  onOpen?: ((hasPendingAction?: boolean | undefined) => void) | undefined;
13
- panGestureHandlerProps?: {
14
- children?: React.ReactNode;
15
- hitSlop?: import("react-native-gesture-handler/lib/typescript/handlers/gestureHandlerCommon").HitSlop;
16
- id?: string | undefined;
17
- testID?: string | undefined;
18
- activeOffsetY?: number | [activeOffsetYStart: number, activeOffsetYEnd: number] | undefined;
19
- activeOffsetX?: number | [activeOffsetXStart: number, activeOffsetXEnd: number] | undefined;
20
- failOffsetY?: number | [failOffsetYStart: number, failOffsetYEnd: number] | undefined;
21
- failOffsetX?: number | [failOffsetXStart: number, failOffsetXEnd: number] | undefined;
22
- shouldCancelWhenOutside?: boolean | undefined;
23
- userSelect?: import("react-native-gesture-handler/lib/typescript/handlers/gestureHandlerCommon").UserSelect | undefined;
24
- activeCursor?: import("react-native-gesture-handler/lib/typescript/handlers/gestureHandlerCommon").ActiveCursor | undefined;
25
- mouseButton?: import("react-native-gesture-handler").MouseButton | undefined;
26
- enableContextMenu?: boolean | undefined;
27
- touchAction?: import("react-native-gesture-handler/lib/typescript/handlers/gestureHandlerCommon").TouchAction | undefined;
28
- waitFor?: React.Ref<unknown> | React.Ref<unknown>[] | undefined;
29
- simultaneousHandlers?: React.Ref<unknown> | React.Ref<unknown>[] | undefined;
30
- blocksHandlers?: React.Ref<unknown> | React.Ref<unknown>[] | undefined;
31
- cancelsTouchesInView?: boolean | undefined;
32
- onBegan?: ((event: import("react-native-gesture-handler").HandlerStateChangeEvent<Record<string, unknown>>) => void) | undefined;
33
- onFailed?: ((event: import("react-native-gesture-handler").HandlerStateChangeEvent<Record<string, unknown>>) => void) | undefined;
34
- onCancelled?: ((event: import("react-native-gesture-handler").HandlerStateChangeEvent<Record<string, unknown>>) => void) | undefined;
35
- onActivated?: ((event: import("react-native-gesture-handler").HandlerStateChangeEvent<Record<string, unknown>>) => void) | undefined;
36
- onEnded?: ((event: import("react-native-gesture-handler").HandlerStateChangeEvent<Record<string, unknown>>) => void) | undefined;
37
- onHandlerStateChange?: ((event: import("react-native-gesture-handler").HandlerStateChangeEvent<import("react-native-gesture-handler").PanGestureHandlerEventPayload>) => void) | undefined;
38
- minDist?: number | undefined;
39
- avgTouches?: boolean | undefined;
40
- enableTrackpadTwoFingerGesture?: boolean | undefined;
41
- minPointers?: number | undefined;
42
- maxPointers?: number | undefined;
43
- minVelocity?: number | undefined;
44
- minVelocityX?: number | undefined;
45
- minVelocityY?: number | undefined;
46
- activateAfterLongPress?: number | undefined;
47
- } | undefined;
48
13
  twClassName?: string | undefined;
49
14
  } & import("react-native").ViewProps & React.RefAttributes<BottomSheetRef>>;
50
15
  //# sourceMappingURL=BottomSheet.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"BottomSheet.d.cts","sourceRoot":"","sources":["../../../src/components/BottomSheet/BottomSheet.tsx"],"names":[],"mappings":"AACA,OAAO,KAMN,cAAc;AAWf,OAAO,KAAK,EAGV,cAAc,EACf,gCAA4B;AAE7B,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2EAwHvB,CAAC"}
1
+ {"version":3,"file":"BottomSheet.d.cts","sourceRoot":"","sources":["../../../src/components/BottomSheet/BottomSheet.tsx"],"names":[],"mappings":"AACA,OAAO,KAMN,cAAc;AAWf,OAAO,KAAK,EAGV,cAAc,EACf,gCAA4B;AAE7B,eAAO,MAAM,WAAW;;;;;;;;;;;2EAyHvB,CAAC"}
@@ -10,41 +10,6 @@ export declare const BottomSheet: React.ForwardRefExoticComponent<{
10
10
  keyboardAvoidingViewEnabled?: boolean | undefined;
11
11
  onClose?: ((hasPendingAction?: boolean | undefined) => void) | undefined;
12
12
  onOpen?: ((hasPendingAction?: boolean | undefined) => void) | undefined;
13
- panGestureHandlerProps?: {
14
- children?: React.ReactNode;
15
- hitSlop?: import("react-native-gesture-handler/lib/typescript/handlers/gestureHandlerCommon").HitSlop;
16
- id?: string | undefined;
17
- testID?: string | undefined;
18
- activeOffsetY?: number | [activeOffsetYStart: number, activeOffsetYEnd: number] | undefined;
19
- activeOffsetX?: number | [activeOffsetXStart: number, activeOffsetXEnd: number] | undefined;
20
- failOffsetY?: number | [failOffsetYStart: number, failOffsetYEnd: number] | undefined;
21
- failOffsetX?: number | [failOffsetXStart: number, failOffsetXEnd: number] | undefined;
22
- shouldCancelWhenOutside?: boolean | undefined;
23
- userSelect?: import("react-native-gesture-handler/lib/typescript/handlers/gestureHandlerCommon").UserSelect | undefined;
24
- activeCursor?: import("react-native-gesture-handler/lib/typescript/handlers/gestureHandlerCommon").ActiveCursor | undefined;
25
- mouseButton?: import("react-native-gesture-handler").MouseButton | undefined;
26
- enableContextMenu?: boolean | undefined;
27
- touchAction?: import("react-native-gesture-handler/lib/typescript/handlers/gestureHandlerCommon").TouchAction | undefined;
28
- waitFor?: React.Ref<unknown> | React.Ref<unknown>[] | undefined;
29
- simultaneousHandlers?: React.Ref<unknown> | React.Ref<unknown>[] | undefined;
30
- blocksHandlers?: React.Ref<unknown> | React.Ref<unknown>[] | undefined;
31
- cancelsTouchesInView?: boolean | undefined;
32
- onBegan?: ((event: import("react-native-gesture-handler").HandlerStateChangeEvent<Record<string, unknown>>) => void) | undefined;
33
- onFailed?: ((event: import("react-native-gesture-handler").HandlerStateChangeEvent<Record<string, unknown>>) => void) | undefined;
34
- onCancelled?: ((event: import("react-native-gesture-handler").HandlerStateChangeEvent<Record<string, unknown>>) => void) | undefined;
35
- onActivated?: ((event: import("react-native-gesture-handler").HandlerStateChangeEvent<Record<string, unknown>>) => void) | undefined;
36
- onEnded?: ((event: import("react-native-gesture-handler").HandlerStateChangeEvent<Record<string, unknown>>) => void) | undefined;
37
- onHandlerStateChange?: ((event: import("react-native-gesture-handler").HandlerStateChangeEvent<import("react-native-gesture-handler").PanGestureHandlerEventPayload>) => void) | undefined;
38
- minDist?: number | undefined;
39
- avgTouches?: boolean | undefined;
40
- enableTrackpadTwoFingerGesture?: boolean | undefined;
41
- minPointers?: number | undefined;
42
- maxPointers?: number | undefined;
43
- minVelocity?: number | undefined;
44
- minVelocityX?: number | undefined;
45
- minVelocityY?: number | undefined;
46
- activateAfterLongPress?: number | undefined;
47
- } | undefined;
48
13
  twClassName?: string | undefined;
49
14
  } & import("react-native").ViewProps & React.RefAttributes<BottomSheetRef>>;
50
15
  //# sourceMappingURL=BottomSheet.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"BottomSheet.d.mts","sourceRoot":"","sources":["../../../src/components/BottomSheet/BottomSheet.tsx"],"names":[],"mappings":"AACA,OAAO,KAMN,cAAc;AAWf,OAAO,KAAK,EAGV,cAAc,EACf,gCAA4B;AAE7B,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2EAwHvB,CAAC"}
1
+ {"version":3,"file":"BottomSheet.d.mts","sourceRoot":"","sources":["../../../src/components/BottomSheet/BottomSheet.tsx"],"names":[],"mappings":"AACA,OAAO,KAMN,cAAc;AAWf,OAAO,KAAK,EAGV,cAAc,EACf,gCAA4B;AAE7B,eAAO,MAAM,WAAW;;;;;;;;;;;2EAyHvB,CAAC"}
@@ -7,15 +7,15 @@ function $importDefault(module) {
7
7
  import { useTailwind } from "@metamask-previews/design-system-twrnc-preset";
8
8
  import $React, { forwardRef, useCallback, useEffect, useImperativeHandle, useRef } from "react";
9
9
  const React = $importDefault($React);
10
- import { BackHandler, KeyboardAvoidingView, Platform } from "react-native/index.js";
10
+ import { BackHandler, KeyboardAvoidingView, Platform } from "react-native";
11
11
  import { useSafeAreaFrame, useSafeAreaInsets } from "react-native-safe-area-context";
12
12
  import { BottomSheetDialog } from "../BottomSheetDialog/index.mjs";
13
13
  import { BottomSheetOverlay } from "../BottomSheetOverlay/BottomSheetOverlay.mjs";
14
- export const BottomSheet = forwardRef(({ children, onClose, onOpen, goBack, style, twClassName, isInteractable = true, isFullscreen = false, keyboardAvoidingViewEnabled = true, panGestureHandlerProps, ...props }, ref) => {
14
+ export const BottomSheet = forwardRef(({ children, onClose, onOpen, goBack, style, twClassName, isInteractable = true, isFullscreen = false, keyboardAvoidingViewEnabled = true, ...props }, ref) => {
15
15
  const tw = useTailwind();
16
16
  const { bottom: screenBottomPadding } = useSafeAreaInsets();
17
17
  const { y: frameY } = useSafeAreaFrame();
18
- const postCallback = useRef();
18
+ const postCallback = useRef(undefined);
19
19
  const bottomSheetDialogRef = useRef(null);
20
20
  const didNavigateBackRef = useRef(false);
21
21
  const closeRequestedRef = useRef(false);
@@ -52,9 +52,9 @@ export const BottomSheet = forwardRef(({ children, onClose, onOpen, goBack, styl
52
52
  }
53
53
  return true;
54
54
  };
55
- BackHandler.addEventListener('hardwareBackPress', hardwareBackPress);
55
+ const subscription = BackHandler.addEventListener('hardwareBackPress', hardwareBackPress);
56
56
  return () => {
57
- BackHandler.removeEventListener('hardwareBackPress', hardwareBackPress);
57
+ subscription.remove();
58
58
  };
59
59
  }, [isInteractable]);
60
60
  useImperativeHandle(ref, () => ({
@@ -78,7 +78,7 @@ export const BottomSheet = forwardRef(({ children, onClose, onOpen, goBack, styl
78
78
  <BottomSheetOverlay onPress={isInteractable
79
79
  ? () => bottomSheetDialogRef.current?.onCloseDialog()
80
80
  : undefined}/>
81
- <BottomSheetDialog isInteractable={isInteractable} onClose={onCloseCB} onOpen={onOpenCB} ref={bottomSheetDialogRef} isFullscreen={isFullscreen} twClassName={twClassName} keyboardAvoidingViewEnabled={keyboardAvoidingViewEnabled} panGestureHandlerProps={panGestureHandlerProps}>
81
+ <BottomSheetDialog isInteractable={isInteractable} onClose={onCloseCB} onOpen={onOpenCB} ref={bottomSheetDialogRef} isFullscreen={isFullscreen} twClassName={twClassName} keyboardAvoidingViewEnabled={keyboardAvoidingViewEnabled}>
82
82
  {children}
83
83
  </BottomSheetDialog>
84
84
  </KeyboardAvoidingView>);
@@ -1 +1 @@
1
- {"version":3,"file":"BottomSheet.mjs","sourceRoot":"","sources":["../../../src/components/BottomSheet/BottomSheet.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,sDAAsD;AAC5E,OAAO,QAAO,EACZ,UAAU,EACV,WAAW,EACX,SAAS,EACT,mBAAmB,EACnB,MAAM,EACP,cAAc;;AACf,OAAO,EAAE,WAAW,EAAE,oBAAoB,EAAE,QAAQ,EAAE,8BAAqB;AAC3E,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EAClB,uCAAuC;AAExC,OAAO,EAAE,iBAAiB,EAAE,uCAA6B;AAEzD,OAAO,EAAE,kBAAkB,EAAE,qDAAiD;AAQ9E,MAAM,CAAC,MAAM,WAAW,GAAG,UAAU,CACnC,CACE,EACE,QAAQ,EACR,OAAO,EACP,MAAM,EACN,MAAM,EACN,KAAK,EACL,WAAW,EACX,cAAc,GAAG,IAAI,EACrB,YAAY,GAAG,KAAK,EACpB,2BAA2B,GAAG,IAAI,EAClC,sBAAsB,EACtB,GAAG,KAAK,EACT,EACD,GAAG,EACH,EAAE;IACF,MAAM,EAAE,GAAG,WAAW,EAAE,CAAC;IACzB,MAAM,EAAE,MAAM,EAAE,mBAAmB,EAAE,GAAG,iBAAiB,EAAE,CAAC;IAC5D,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,GAAG,gBAAgB,EAAE,CAAC;IACzC,MAAM,YAAY,GAAG,MAAM,EAA2B,CAAC;IACvD,MAAM,oBAAoB,GAAG,MAAM,CAAuB,IAAI,CAAC,CAAC;IAChE,MAAM,kBAAkB,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;IACzC,MAAM,iBAAiB,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;IACxC,MAAM,qBAAqB,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;I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AAI,KAAK,CAAC,CAEV;QAAA,CAAC,kBAAkB,CACjB,OAAO,CAAC,CACN,cAAc;YACZ,CAAC,CAAC,GAAG,EAAE,CAAC,oBAAoB,CAAC,OAAO,EAAE,aAAa,EAAE;YACrD,CAAC,CAAC,SAAS,CACd,EAEH;QAAA,CAAC,iBAAiB,CAChB,cAAc,CAAC,CAAC,cAAc,CAAC,CAC/B,OAAO,CAAC,CAAC,SAAS,CAAC,CACnB,MAAM,CAAC,CAAC,QAAQ,CAAC,CACjB,GAAG,CAAC,CAAC,oBAAoB,CAAC,CAC1B,YAAY,CAAC,CAAC,YAAY,CAAC,CAC3B,WAAW,CAAC,CAAC,WAAW,CAAC,CACzB,2BAA2B,CAAC,CAAC,2BAA2B,CAAC,CACzD,sBAAsB,CAAC,CAAC,sBAAsB,CAAC,CAE/C;UAAA,CAAC,QAAQ,CACX;QAAA,EAAE,iBAAiB,CACrB;MAAA,EAAE,oBAAoB,CAAC,CACxB,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,WAAW,CAAC,WAAW,GAAG,aAAa,CAAC","sourcesContent":["import { useTailwind } from '@metamask-previews/design-system-twrnc-preset';\nimport React, {\n forwardRef,\n useCallback,\n useEffect,\n useImperativeHandle,\n useRef,\n} from 'react';\nimport { BackHandler, KeyboardAvoidingView, Platform } from 'react-native';\nimport {\n useSafeAreaFrame,\n useSafeAreaInsets,\n} from 'react-native-safe-area-context';\n\nimport { BottomSheetDialog } from '../BottomSheetDialog';\nimport type { BottomSheetDialogRef } from '../BottomSheetDialog';\nimport { BottomSheetOverlay } from '../BottomSheetOverlay/BottomSheetOverlay';\n\nimport type {\n BottomSheetPostCallback,\n BottomSheetProps,\n BottomSheetRef,\n} from './BottomSheet.types';\n\nexport const BottomSheet = forwardRef<BottomSheetRef, BottomSheetProps>(\n (\n {\n children,\n onClose,\n onOpen,\n goBack,\n style,\n twClassName,\n isInteractable = true,\n isFullscreen = false,\n keyboardAvoidingViewEnabled = true,\n panGestureHandlerProps,\n ...props\n },\n ref,\n ) => {\n const tw = useTailwind();\n const { bottom: screenBottomPadding } = useSafeAreaInsets();\n const { y: frameY } = useSafeAreaFrame();\n const postCallback = useRef<BottomSheetPostCallback>();\n const bottomSheetDialogRef = useRef<BottomSheetDialogRef>(null);\n const didNavigateBackRef = useRef(false);\n const closeRequestedRef = useRef(false);\n const didRunPostCallbackRef = useRef(false);\n\n const onOpenCB = useCallback(() => {\n // Reset when the sheet is opened again.\n didNavigateBackRef.current = false;\n closeRequestedRef.current = false;\n didRunPostCallbackRef.current = false;\n\n onOpen?.(Boolean(postCallback.current));\n const callback = postCallback.current;\n postCallback.current = undefined;\n callback?.();\n }, [onOpen]);\n\n const onCloseCB = useCallback(() => {\n if (goBack && !didNavigateBackRef.current) {\n didNavigateBackRef.current = true;\n goBack?.();\n }\n\n const callback = postCallback.current;\n const hasCallback = Boolean(callback);\n\n onClose?.(hasCallback);\n\n if (!didRunPostCallbackRef.current && hasCallback) {\n didRunPostCallbackRef.current = true;\n postCallback.current = undefined;\n callback?.();\n }\n }, [goBack, onClose]);\n\n // Dismiss the sheet when Android back button is pressed.\n useEffect(() => {\n const hardwareBackPress = () => {\n if (isInteractable) {\n bottomSheetDialogRef.current?.onCloseDialog();\n }\n return true;\n };\n BackHandler.addEventListener('hardwareBackPress', hardwareBackPress);\n return () => {\n BackHandler.removeEventListener('hardwareBackPress', hardwareBackPress);\n };\n }, [isInteractable]);\n\n useImperativeHandle(ref, () => ({\n onCloseBottomSheet: (callback) => {\n if (closeRequestedRef.current) {\n return;\n }\n closeRequestedRef.current = true;\n postCallback.current = callback;\n bottomSheetDialogRef.current?.onCloseDialog();\n },\n onOpenBottomSheet: (callback) => {\n didNavigateBackRef.current = false;\n closeRequestedRef.current = false;\n didRunPostCallbackRef.current = false;\n postCallback.current = callback;\n bottomSheetDialogRef.current?.onOpenDialog();\n },\n }));\n\n return (\n <KeyboardAvoidingView\n behavior={Platform.OS === 'ios' ? 'padding' : undefined}\n keyboardVerticalOffset={\n Platform.OS === 'ios' ? -screenBottomPadding : frameY\n }\n style={[tw.style('absolute inset-0 justify-end'), style]}\n enabled={keyboardAvoidingViewEnabled}\n {...props}\n >\n <BottomSheetOverlay\n onPress={\n isInteractable\n ? () => bottomSheetDialogRef.current?.onCloseDialog()\n : undefined\n }\n />\n <BottomSheetDialog\n isInteractable={isInteractable}\n onClose={onCloseCB}\n onOpen={onOpenCB}\n ref={bottomSheetDialogRef}\n isFullscreen={isFullscreen}\n twClassName={twClassName}\n keyboardAvoidingViewEnabled={keyboardAvoidingViewEnabled}\n panGestureHandlerProps={panGestureHandlerProps}\n >\n {children}\n </BottomSheetDialog>\n </KeyboardAvoidingView>\n );\n },\n);\n\nBottomSheet.displayName = 'BottomSheet';\n"]}
1
+ {"version":3,"file":"BottomSheet.mjs","sourceRoot":"","sources":["../../../src/components/BottomSheet/BottomSheet.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,sDAAsD;AAC5E,OAAO,QAAO,EACZ,UAAU,EACV,WAAW,EACX,SAAS,EACT,mBAAmB,EACnB,MAAM,EACP,cAAc;;AACf,OAAO,EAAE,WAAW,EAAE,oBAAoB,EAAE,QAAQ,EAAE,qBAAqB;AAC3E,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EAClB,uCAAuC;AAExC,OAAO,EAAE,iBAAiB,EAAE,uCAA6B;AAEzD,OAAO,EAAE,kBAAkB,EAAE,qDAAiD;AAQ9E,MAAM,CAAC,MAAM,WAAW,GAAG,UAAU,CACnC,CACE,EACE,QAAQ,EACR,OAAO,EACP,MAAM,EACN,MAAM,EACN,KAAK,EACL,WAAW,EACX,cAAc,GAAG,IAAI,EACrB,YAAY,GAAG,KAAK,EACpB,2BAA2B,GAAG,IAAI,EAClC,GAAG,KAAK,EACT,EACD,GAAG,EACH,EAAE;IACF,MAAM,EAAE,GAAG,WAAW,EAAE,CAAC;IACzB,MAAM,EAAE,MAAM,EAAE,mBAAmB,EAAE,GAAG,iBAA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,CAAC,CAAC,QAAQ,CAAC,EAAE,KAAK,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CACxD,sBAAsB,CAAC,CACrB,QAAQ,CAAC,EAAE,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,MAAM,CACtD,CACD,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,8BAA8B,CAAC,EAAE,KAAK,CAAC,CAAC,CACzD,OAAO,CAAC,CAAC,2BAA2B,CAAC,CACrC,IAAI,KAAK,CAAC,CAEV;QAAA,CAAC,kBAAkB,CACjB,OAAO,CAAC,CACN,cAAc;YACZ,CAAC,CAAC,GAAG,EAAE,CAAC,oBAAoB,CAAC,OAAO,EAAE,aAAa,EAAE;YACrD,CAAC,CAAC,SAAS,CACd,EAEH;QAAA,CAAC,iBAAiB,CAChB,cAAc,CAAC,CAAC,cAAc,CAAC,CAC/B,OAAO,CAAC,CAAC,SAAS,CAAC,CACnB,MAAM,CAAC,CAAC,QAAQ,CAAC,CACjB,GAAG,CAAC,CAAC,oBAAoB,CAAC,CAC1B,YAAY,CAAC,CAAC,YAAY,CAAC,CAC3B,WAAW,CAAC,CAAC,WAAW,CAAC,CACzB,2BAA2B,CAAC,CAAC,2BAA2B,CAAC,CAEzD;UAAA,CAAC,QAAQ,CACX;QAAA,EAAE,iBAAiB,CACrB;MAAA,EAAE,oBAAoB,CAAC,CACxB,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,WAAW,CAAC,WAAW,GAAG,aAAa,CAAC","sourcesContent":["import { useTailwind } from '@metamask-previews/design-system-twrnc-preset';\nimport React, {\n forwardRef,\n useCallback,\n useEffect,\n useImperativeHandle,\n useRef,\n} from 'react';\nimport { BackHandler, KeyboardAvoidingView, Platform } from 'react-native';\nimport {\n useSafeAreaFrame,\n useSafeAreaInsets,\n} from 'react-native-safe-area-context';\n\nimport { BottomSheetDialog } from '../BottomSheetDialog';\nimport type { BottomSheetDialogRef } from '../BottomSheetDialog';\nimport { BottomSheetOverlay } from '../BottomSheetOverlay/BottomSheetOverlay';\n\nimport type {\n BottomSheetPostCallback,\n BottomSheetProps,\n BottomSheetRef,\n} from './BottomSheet.types';\n\nexport const BottomSheet = forwardRef<BottomSheetRef, BottomSheetProps>(\n (\n {\n children,\n onClose,\n onOpen,\n goBack,\n style,\n twClassName,\n isInteractable = true,\n isFullscreen = false,\n keyboardAvoidingViewEnabled = true,\n ...props\n },\n ref,\n ) => {\n const tw = useTailwind();\n const { bottom: screenBottomPadding } = useSafeAreaInsets();\n const { y: frameY } = useSafeAreaFrame();\n const postCallback = useRef<BottomSheetPostCallback | undefined>(undefined);\n const bottomSheetDialogRef = useRef<BottomSheetDialogRef>(null);\n const didNavigateBackRef = useRef(false);\n const closeRequestedRef = useRef(false);\n const didRunPostCallbackRef = useRef(false);\n\n const onOpenCB = useCallback(() => {\n // Reset when the sheet is opened again.\n didNavigateBackRef.current = false;\n closeRequestedRef.current = false;\n didRunPostCallbackRef.current = false;\n\n onOpen?.(Boolean(postCallback.current));\n const callback = postCallback.current;\n postCallback.current = undefined;\n callback?.();\n }, [onOpen]);\n\n const onCloseCB = useCallback(() => {\n if (goBack && !didNavigateBackRef.current) {\n didNavigateBackRef.current = true;\n goBack?.();\n }\n\n const callback = postCallback.current;\n const hasCallback = Boolean(callback);\n\n onClose?.(hasCallback);\n\n if (!didRunPostCallbackRef.current && hasCallback) {\n didRunPostCallbackRef.current = true;\n postCallback.current = undefined;\n callback?.();\n }\n }, [goBack, onClose]);\n\n // Dismiss the sheet when Android back button is pressed.\n useEffect(() => {\n const hardwareBackPress = () => {\n if (isInteractable) {\n bottomSheetDialogRef.current?.onCloseDialog();\n }\n return true;\n };\n const subscription = BackHandler.addEventListener(\n 'hardwareBackPress',\n hardwareBackPress,\n );\n return () => {\n subscription.remove();\n };\n }, [isInteractable]);\n\n useImperativeHandle(ref, () => ({\n onCloseBottomSheet: (callback) => {\n if (closeRequestedRef.current) {\n return;\n }\n closeRequestedRef.current = true;\n postCallback.current = callback;\n bottomSheetDialogRef.current?.onCloseDialog();\n },\n onOpenBottomSheet: (callback) => {\n didNavigateBackRef.current = false;\n closeRequestedRef.current = false;\n didRunPostCallbackRef.current = false;\n postCallback.current = callback;\n bottomSheetDialogRef.current?.onOpenDialog();\n },\n }));\n\n return (\n <KeyboardAvoidingView\n behavior={Platform.OS === 'ios' ? 'padding' : undefined}\n keyboardVerticalOffset={\n Platform.OS === 'ios' ? -screenBottomPadding : frameY\n }\n style={[tw.style('absolute inset-0 justify-end'), style]}\n enabled={keyboardAvoidingViewEnabled}\n {...props}\n >\n <BottomSheetOverlay\n onPress={\n isInteractable\n ? () => bottomSheetDialogRef.current?.onCloseDialog()\n : undefined\n }\n />\n <BottomSheetDialog\n isInteractable={isInteractable}\n onClose={onCloseCB}\n onOpen={onOpenCB}\n ref={bottomSheetDialogRef}\n isFullscreen={isFullscreen}\n twClassName={twClassName}\n keyboardAvoidingViewEnabled={keyboardAvoidingViewEnabled}\n >\n {children}\n </BottomSheetDialog>\n </KeyboardAvoidingView>\n );\n },\n);\n\nBottomSheet.displayName = 'BottomSheet';\n"]}
@@ -28,13 +28,13 @@ const design_system_twrnc_preset_1 = require("@metamask-previews/design-system-t
28
28
  const design_tokens_1 = require("@metamask-previews/design-tokens");
29
29
  const lodash_1 = require("lodash");
30
30
  const react_1 = __importStar(require("react"));
31
- const react_native_1 = require("react-native/index.js");
31
+ const react_native_1 = require("react-native");
32
32
  const react_native_gesture_handler_1 = require("react-native-gesture-handler");
33
33
  const react_native_reanimated_1 = __importStar(require("react-native-reanimated"));
34
34
  const react_native_safe_area_context_1 = require("react-native-safe-area-context");
35
35
  // Internal dependencies.
36
36
  const BottomSheetDialog_constants_1 = require("./BottomSheetDialog.constants.cjs");
37
- exports.BottomSheetDialog = (0, react_1.forwardRef)(({ children, isFullscreen = false, isInteractable = true, keyboardAvoidingViewEnabled = true, onClose, onOpen, panGestureHandlerProps, style, twClassName, ...props }, ref) => {
37
+ exports.BottomSheetDialog = (0, react_1.forwardRef)(({ children, isFullscreen = false, isInteractable = true, keyboardAvoidingViewEnabled = true, onClose, onOpen, style, twClassName, ...props }, ref) => {
38
38
  const tw = (0, design_system_twrnc_preset_1.useTailwind)();
39
39
  const currentTheme = (0, design_system_twrnc_preset_1.useTheme)();
40
40
  const shadowLg = currentTheme === design_system_twrnc_preset_1.Theme.Light
@@ -48,6 +48,7 @@ exports.BottomSheetDialog = (0, react_1.forwardRef)(({ children, isFullscreen =
48
48
  const currentYOffset = (0, react_native_reanimated_1.useSharedValue)(screenHeight);
49
49
  const topOfDialogYValue = (0, react_native_reanimated_1.useSharedValue)(0);
50
50
  const bottomOfDialogYValue = (0, react_native_reanimated_1.useSharedValue)(screenHeight);
51
+ const gestureStartYOffset = (0, react_native_reanimated_1.useSharedValue)(0);
51
52
  const isMounted = (0, react_1.useRef)(false);
52
53
  const onOpenCB = (0, react_1.useCallback)(() => {
53
54
  onOpen?.();
@@ -64,14 +65,16 @@ exports.BottomSheetDialog = (0, react_1.forwardRef)(({ children, isFullscreen =
64
65
  });
65
66
  // Ref values do not affect deps.
66
67
  }, [onCloseCB]);
67
- const gestureHandler = (0, react_native_reanimated_1.useAnimatedGestureHandler)({
68
- onStart: (_, ctx) => {
69
- // Starts tracking vertical position of gesture
70
- ctx.startY = currentYOffset.value;
71
- },
72
- onActive: (event, ctx) => {
68
+ const gestureHandler = (0, react_1.useMemo)(() => {
69
+ const gesture = react_native_gesture_handler_1.Gesture.Pan()
70
+ .enabled(isInteractable)
71
+ .onStart(() => {
72
+ // Starts tracking vertical position of gesture.
73
+ gestureStartYOffset.value = currentYOffset.value;
74
+ })
75
+ .onUpdate((event) => {
73
76
  const { translationY } = event;
74
- currentYOffset.value = ctx.startY + translationY;
77
+ currentYOffset.value = gestureStartYOffset.value + translationY;
75
78
  // If gesture Y value goes above the bottom of Dialog Y value(bottom of dialog),
76
79
  // which means the gesture is currently below the bottom of the dialog,
77
80
  // sets it to bottom of Dialog Y value
@@ -84,13 +87,13 @@ exports.BottomSheetDialog = (0, react_1.forwardRef)(({ children, isFullscreen =
84
87
  if (currentYOffset.value <= topOfDialogYValue.value) {
85
88
  currentYOffset.value = topOfDialogYValue.value;
86
89
  }
87
- },
88
- onEnd: (event, ctx) => {
90
+ })
91
+ .onEnd((event) => {
89
92
  const { translationY, velocityY } = event;
90
93
  // finalYOffset is used to animate the Y position of the Dialog after the gesture event
91
94
  let finalYOffset;
92
95
  // Measuring dismissing swipe action
93
- const latestOffset = ctx.startY + translationY;
96
+ const latestOffset = gestureStartYOffset.value + translationY;
94
97
  // Check if the swipe distance reach the dismiss offset threshold,
95
98
  // which is currently 60% of sheet height
96
99
  const hasReachedDismissOffset = latestOffset >
@@ -126,8 +129,16 @@ exports.BottomSheetDialog = (0, react_1.forwardRef)(({ children, isFullscreen =
126
129
  duration: BottomSheetDialog_constants_1.DEFAULT_BOTTOMSHEETDIALOG_DISPLAY_DURATION,
127
130
  });
128
131
  }
129
- },
130
- });
132
+ });
133
+ return gesture;
134
+ }, [
135
+ isInteractable,
136
+ currentYOffset,
137
+ gestureStartYOffset,
138
+ bottomOfDialogYValue,
139
+ topOfDialogYValue,
140
+ onCloseDialog,
141
+ ]);
131
142
  // Animate in sheet on initial render.
132
143
  const onOpenDialog = (callback) => {
133
144
  // Starts setting the Y position of the dialog to the bottom of the dialog
@@ -166,7 +177,7 @@ exports.BottomSheetDialog = (0, react_1.forwardRef)(({ children, isFullscreen =
166
177
  ],
167
178
  }));
168
179
  const sheetStyle = (0, react_1.useMemo)(() => [
169
- tw.style('bg-alternative rounded-t-3xl overflow-hidden border border-muted', twClassName),
180
+ tw.style('bg-default rounded-t-3xl overflow-hidden border border-muted', twClassName),
170
181
  {
171
182
  maxHeight: maxSheetHeight,
172
183
  paddingBottom: react_native_1.Platform.select({
@@ -193,14 +204,14 @@ exports.BottomSheetDialog = (0, react_1.forwardRef)(({ children, isFullscreen =
193
204
  onCloseDialog,
194
205
  }));
195
206
  return (<react_native_1.KeyboardAvoidingView style={tw.style('absolute bottom-0 inset-x-0')} behavior={react_native_1.Platform.OS === 'ios' ? 'padding' : undefined} keyboardVerticalOffset={react_native_1.Platform.OS === 'ios' ? -screenBottomPadding : frameY} enabled={keyboardAvoidingViewEnabled} {...props}>
196
- <react_native_gesture_handler_1.PanGestureHandler {...panGestureHandlerProps} enabled={isInteractable} onGestureEvent={gestureHandler}>
207
+ <react_native_gesture_handler_1.GestureDetector gesture={gestureHandler}>
197
208
  <react_native_reanimated_1.default.View onLayout={updateSheetHeight} style={combinedSheetStyle}>
198
209
  {isInteractable && (<react_native_1.View style={tw.style('self-stretch items-center p-1')}>
199
210
  <react_native_1.View style={tw.style('h-1 w-10 rounded-sm bg-border-muted')}/>
200
211
  </react_native_1.View>)}
201
212
  {children}
202
213
  </react_native_reanimated_1.default.View>
203
- </react_native_gesture_handler_1.PanGestureHandler>
214
+ </react_native_gesture_handler_1.GestureDetector>
204
215
  </react_native_1.KeyboardAvoidingView>);
205
216
  });
206
217
  //# sourceMappingURL=BottomSheetDialog.cjs.map