@metamask/design-system-react-native 0.10.0 → 0.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (430) hide show
  1. package/CHANGELOG.md +53 -1
  2. package/dist/components/AvatarNetwork/AvatarNetwork.types.cjs.map +1 -1
  3. package/dist/components/AvatarNetwork/AvatarNetwork.types.d.cts +7 -9
  4. package/dist/components/AvatarNetwork/AvatarNetwork.types.d.cts.map +1 -1
  5. package/dist/components/AvatarNetwork/AvatarNetwork.types.d.mts +7 -9
  6. package/dist/components/AvatarNetwork/AvatarNetwork.types.d.mts.map +1 -1
  7. package/dist/components/AvatarNetwork/AvatarNetwork.types.mjs.map +1 -1
  8. package/dist/components/BannerAlert/BannerAlert.cjs +23 -0
  9. package/dist/components/BannerAlert/BannerAlert.cjs.map +1 -0
  10. package/dist/components/BannerAlert/BannerAlert.constants.cjs +30 -0
  11. package/dist/components/BannerAlert/BannerAlert.constants.cjs.map +1 -0
  12. package/dist/components/BannerAlert/BannerAlert.constants.d.cts +7 -0
  13. package/dist/components/BannerAlert/BannerAlert.constants.d.cts.map +1 -0
  14. package/dist/components/BannerAlert/BannerAlert.constants.d.mts +7 -0
  15. package/dist/components/BannerAlert/BannerAlert.constants.d.mts.map +1 -0
  16. package/dist/components/BannerAlert/BannerAlert.constants.mjs +27 -0
  17. package/dist/components/BannerAlert/BannerAlert.constants.mjs.map +1 -0
  18. package/dist/components/BannerAlert/BannerAlert.d.cts +4 -0
  19. package/dist/components/BannerAlert/BannerAlert.d.cts.map +1 -0
  20. package/dist/components/BannerAlert/BannerAlert.d.mts +4 -0
  21. package/dist/components/BannerAlert/BannerAlert.d.mts.map +1 -0
  22. package/dist/components/BannerAlert/BannerAlert.mjs +23 -0
  23. package/dist/components/BannerAlert/BannerAlert.mjs.map +1 -0
  24. package/dist/components/BannerAlert/BannerAlert.types.cjs +3 -0
  25. package/dist/components/BannerAlert/BannerAlert.types.cjs.map +1 -0
  26. package/dist/components/BannerAlert/BannerAlert.types.d.cts +10 -0
  27. package/dist/components/BannerAlert/BannerAlert.types.d.cts.map +1 -0
  28. package/dist/components/BannerAlert/BannerAlert.types.d.mts +10 -0
  29. package/dist/components/BannerAlert/BannerAlert.types.d.mts.map +1 -0
  30. package/dist/components/BannerAlert/BannerAlert.types.mjs +2 -0
  31. package/dist/components/BannerAlert/BannerAlert.types.mjs.map +1 -0
  32. package/dist/components/BannerAlert/index.cjs +8 -0
  33. package/dist/components/BannerAlert/index.cjs.map +1 -0
  34. package/dist/components/BannerAlert/index.d.cts +4 -0
  35. package/dist/components/BannerAlert/index.d.cts.map +1 -0
  36. package/dist/components/BannerAlert/index.d.mts +4 -0
  37. package/dist/components/BannerAlert/index.d.mts.map +1 -0
  38. package/dist/components/BannerAlert/index.mjs +3 -0
  39. package/dist/components/BannerAlert/index.mjs.map +1 -0
  40. package/dist/components/BannerBase/BannerBase.cjs +63 -0
  41. package/dist/components/BannerBase/BannerBase.cjs.map +1 -0
  42. package/dist/components/BannerBase/BannerBase.d.cts +4 -0
  43. package/dist/components/BannerBase/BannerBase.d.cts.map +1 -0
  44. package/dist/components/BannerBase/BannerBase.d.mts +4 -0
  45. package/dist/components/BannerBase/BannerBase.d.mts.map +1 -0
  46. package/dist/components/BannerBase/BannerBase.mjs +63 -0
  47. package/dist/components/BannerBase/BannerBase.mjs.map +1 -0
  48. package/dist/components/BannerBase/BannerBase.types.cjs +3 -0
  49. package/dist/components/BannerBase/BannerBase.types.cjs.map +1 -0
  50. package/dist/components/BannerBase/BannerBase.types.d.cts +53 -0
  51. package/dist/components/BannerBase/BannerBase.types.d.cts.map +1 -0
  52. package/dist/components/BannerBase/BannerBase.types.d.mts +53 -0
  53. package/dist/components/BannerBase/BannerBase.types.d.mts.map +1 -0
  54. package/dist/components/BannerBase/BannerBase.types.mjs +2 -0
  55. package/dist/components/BannerBase/BannerBase.types.mjs.map +1 -0
  56. package/dist/components/BannerBase/index.cjs +6 -0
  57. package/dist/components/BannerBase/index.cjs.map +1 -0
  58. package/dist/components/BannerBase/index.d.cts +3 -0
  59. package/dist/components/BannerBase/index.d.cts.map +1 -0
  60. package/dist/components/BannerBase/index.d.mts +3 -0
  61. package/dist/components/BannerBase/index.d.mts.map +1 -0
  62. package/dist/components/BannerBase/index.mjs +2 -0
  63. package/dist/components/BannerBase/index.mjs.map +1 -0
  64. package/dist/components/BottomSheet/BottomSheet.cjs +109 -0
  65. package/dist/components/BottomSheet/BottomSheet.cjs.map +1 -0
  66. package/dist/components/BottomSheet/BottomSheet.d.cts +16 -0
  67. package/dist/components/BottomSheet/BottomSheet.d.cts.map +1 -0
  68. package/dist/components/BottomSheet/BottomSheet.d.mts +16 -0
  69. package/dist/components/BottomSheet/BottomSheet.d.mts.map +1 -0
  70. package/dist/components/BottomSheet/BottomSheet.mjs +87 -0
  71. package/dist/components/BottomSheet/BottomSheet.mjs.map +1 -0
  72. package/dist/components/BottomSheet/BottomSheet.types.cjs +3 -0
  73. package/dist/components/BottomSheet/BottomSheet.types.cjs.map +1 -0
  74. package/dist/components/BottomSheet/BottomSheet.types.d.cts +28 -0
  75. package/dist/components/BottomSheet/BottomSheet.types.d.cts.map +1 -0
  76. package/dist/components/BottomSheet/BottomSheet.types.d.mts +28 -0
  77. package/dist/components/BottomSheet/BottomSheet.types.d.mts.map +1 -0
  78. package/dist/components/BottomSheet/BottomSheet.types.mjs +2 -0
  79. package/dist/components/BottomSheet/BottomSheet.types.mjs.map +1 -0
  80. package/dist/components/BottomSheet/index.cjs +6 -0
  81. package/dist/components/BottomSheet/index.cjs.map +1 -0
  82. package/dist/components/BottomSheet/index.d.cts +3 -0
  83. package/dist/components/BottomSheet/index.d.cts.map +1 -0
  84. package/dist/components/BottomSheet/index.d.mts +3 -0
  85. package/dist/components/BottomSheet/index.d.mts.map +1 -0
  86. package/dist/components/BottomSheet/index.mjs +2 -0
  87. package/dist/components/BottomSheet/index.mjs.map +1 -0
  88. package/dist/components/BottomSheetDialog/BottomSheetDialog.cjs +207 -0
  89. package/dist/components/BottomSheetDialog/BottomSheetDialog.cjs.map +1 -0
  90. package/dist/components/BottomSheetDialog/BottomSheetDialog.constants.cjs +18 -0
  91. package/dist/components/BottomSheetDialog/BottomSheetDialog.constants.cjs.map +1 -0
  92. package/dist/components/BottomSheetDialog/BottomSheetDialog.constants.d.cts +14 -0
  93. package/dist/components/BottomSheetDialog/BottomSheetDialog.constants.d.cts.map +1 -0
  94. package/dist/components/BottomSheetDialog/BottomSheetDialog.constants.d.mts +14 -0
  95. package/dist/components/BottomSheetDialog/BottomSheetDialog.constants.d.mts.map +1 -0
  96. package/dist/components/BottomSheetDialog/BottomSheetDialog.constants.mjs +15 -0
  97. package/dist/components/BottomSheetDialog/BottomSheetDialog.constants.mjs.map +1 -0
  98. package/dist/components/BottomSheetDialog/BottomSheetDialog.d.cts +13 -0
  99. package/dist/components/BottomSheetDialog/BottomSheetDialog.d.cts.map +1 -0
  100. package/dist/components/BottomSheetDialog/BottomSheetDialog.d.mts +13 -0
  101. package/dist/components/BottomSheetDialog/BottomSheetDialog.d.mts.map +1 -0
  102. package/dist/components/BottomSheetDialog/BottomSheetDialog.mjs +190 -0
  103. package/dist/components/BottomSheetDialog/BottomSheetDialog.mjs.map +1 -0
  104. package/dist/components/BottomSheetDialog/BottomSheetDialog.types.cjs +3 -0
  105. package/dist/components/BottomSheetDialog/BottomSheetDialog.types.cjs.map +1 -0
  106. package/dist/components/BottomSheetDialog/BottomSheetDialog.types.d.cts +56 -0
  107. package/dist/components/BottomSheetDialog/BottomSheetDialog.types.d.cts.map +1 -0
  108. package/dist/components/BottomSheetDialog/BottomSheetDialog.types.d.mts +56 -0
  109. package/dist/components/BottomSheetDialog/BottomSheetDialog.types.d.mts.map +1 -0
  110. package/dist/components/BottomSheetDialog/BottomSheetDialog.types.mjs +2 -0
  111. package/dist/components/BottomSheetDialog/BottomSheetDialog.types.mjs.map +1 -0
  112. package/dist/components/BottomSheetDialog/index.cjs +9 -0
  113. package/dist/components/BottomSheetDialog/index.cjs.map +1 -0
  114. package/dist/components/BottomSheetDialog/index.d.cts +3 -0
  115. package/dist/components/BottomSheetDialog/index.d.cts.map +1 -0
  116. package/dist/components/BottomSheetDialog/index.d.mts +3 -0
  117. package/dist/components/BottomSheetDialog/index.d.mts.map +1 -0
  118. package/dist/components/BottomSheetDialog/index.mjs +2 -0
  119. package/dist/components/BottomSheetDialog/index.mjs.map +1 -0
  120. package/dist/components/ButtonBase/ButtonBase.cjs +2 -9
  121. package/dist/components/ButtonBase/ButtonBase.cjs.map +1 -1
  122. package/dist/components/ButtonBase/ButtonBase.d.cts.map +1 -1
  123. package/dist/components/ButtonBase/ButtonBase.d.mts.map +1 -1
  124. package/dist/components/ButtonBase/ButtonBase.mjs +3 -10
  125. package/dist/components/ButtonBase/ButtonBase.mjs.map +1 -1
  126. package/dist/components/ButtonFilter/ButtonFilter.cjs +28 -0
  127. package/dist/components/ButtonFilter/ButtonFilter.cjs.map +1 -0
  128. package/dist/components/ButtonFilter/ButtonFilter.d.cts +4 -0
  129. package/dist/components/ButtonFilter/ButtonFilter.d.cts.map +1 -0
  130. package/dist/components/ButtonFilter/ButtonFilter.d.mts +4 -0
  131. package/dist/components/ButtonFilter/ButtonFilter.d.mts.map +1 -0
  132. package/dist/components/ButtonFilter/ButtonFilter.mjs +28 -0
  133. package/dist/components/ButtonFilter/ButtonFilter.mjs.map +1 -0
  134. package/dist/components/ButtonFilter/ButtonFilter.types.cjs +3 -0
  135. package/dist/components/ButtonFilter/ButtonFilter.types.cjs.map +1 -0
  136. package/dist/components/ButtonFilter/ButtonFilter.types.d.cts +9 -0
  137. package/dist/components/ButtonFilter/ButtonFilter.types.d.cts.map +1 -0
  138. package/dist/components/ButtonFilter/ButtonFilter.types.d.mts +9 -0
  139. package/dist/components/ButtonFilter/ButtonFilter.types.d.mts.map +1 -0
  140. package/dist/components/ButtonFilter/ButtonFilter.types.mjs +2 -0
  141. package/dist/components/ButtonFilter/ButtonFilter.types.mjs.map +1 -0
  142. package/dist/components/ButtonFilter/index.cjs +6 -0
  143. package/dist/components/ButtonFilter/index.cjs.map +1 -0
  144. package/dist/components/ButtonFilter/index.d.cts +3 -0
  145. package/dist/components/ButtonFilter/index.d.cts.map +1 -0
  146. package/dist/components/ButtonFilter/index.d.mts +3 -0
  147. package/dist/components/ButtonFilter/index.d.mts.map +1 -0
  148. package/dist/components/ButtonFilter/index.mjs +2 -0
  149. package/dist/components/ButtonFilter/index.mjs.map +1 -0
  150. package/dist/components/ButtonIcon/ButtonIcon.cjs +10 -4
  151. package/dist/components/ButtonIcon/ButtonIcon.cjs.map +1 -1
  152. package/dist/components/ButtonIcon/ButtonIcon.d.cts +1 -1
  153. package/dist/components/ButtonIcon/ButtonIcon.d.cts.map +1 -1
  154. package/dist/components/ButtonIcon/ButtonIcon.d.mts +1 -1
  155. package/dist/components/ButtonIcon/ButtonIcon.d.mts.map +1 -1
  156. package/dist/components/ButtonIcon/ButtonIcon.mjs +11 -5
  157. package/dist/components/ButtonIcon/ButtonIcon.mjs.map +1 -1
  158. package/dist/components/ButtonIcon/ButtonIcon.types.cjs.map +1 -1
  159. package/dist/components/ButtonIcon/ButtonIcon.types.d.cts +4 -11
  160. package/dist/components/ButtonIcon/ButtonIcon.types.d.cts.map +1 -1
  161. package/dist/components/ButtonIcon/ButtonIcon.types.d.mts +4 -11
  162. package/dist/components/ButtonIcon/ButtonIcon.types.d.mts.map +1 -1
  163. package/dist/components/ButtonIcon/ButtonIcon.types.mjs.map +1 -1
  164. package/dist/components/ButtonIcon/index.cjs +2 -1
  165. package/dist/components/ButtonIcon/index.cjs.map +1 -1
  166. package/dist/components/ButtonIcon/index.d.cts +1 -1
  167. package/dist/components/ButtonIcon/index.d.cts.map +1 -1
  168. package/dist/components/ButtonIcon/index.d.mts +1 -1
  169. package/dist/components/ButtonIcon/index.d.mts.map +1 -1
  170. package/dist/components/ButtonIcon/index.mjs +1 -1
  171. package/dist/components/ButtonIcon/index.mjs.map +1 -1
  172. package/dist/components/Icon/assets/ai.svg +1 -1
  173. package/dist/components/Icon/assets/candlestick.svg +1 -1
  174. package/dist/components/Input/Input.cjs +16 -5
  175. package/dist/components/Input/Input.cjs.map +1 -1
  176. package/dist/components/Input/Input.constants.cjs +69 -0
  177. package/dist/components/Input/Input.constants.cjs.map +1 -0
  178. package/dist/components/Input/Input.constants.d.cts +11 -0
  179. package/dist/components/Input/Input.constants.d.cts.map +1 -0
  180. package/dist/components/Input/Input.constants.d.mts +11 -0
  181. package/dist/components/Input/Input.constants.d.mts.map +1 -0
  182. package/dist/components/Input/Input.constants.mjs +66 -0
  183. package/dist/components/Input/Input.constants.mjs.map +1 -0
  184. package/dist/components/Input/Input.d.cts +2 -1
  185. package/dist/components/Input/Input.d.cts.map +1 -1
  186. package/dist/components/Input/Input.d.mts +2 -1
  187. package/dist/components/Input/Input.d.mts.map +1 -1
  188. package/dist/components/Input/Input.mjs +16 -5
  189. package/dist/components/Input/Input.mjs.map +1 -1
  190. package/dist/components/Input/Input.types.cjs.map +1 -1
  191. package/dist/components/Input/Input.types.d.cts +5 -1
  192. package/dist/components/Input/Input.types.d.cts.map +1 -1
  193. package/dist/components/Input/Input.types.d.mts +5 -1
  194. package/dist/components/Input/Input.types.d.mts.map +1 -1
  195. package/dist/components/Input/Input.types.mjs.map +1 -1
  196. package/dist/components/KeyValueRow/KeyValueLabel/KeyValueLabel.cjs +33 -0
  197. package/dist/components/KeyValueRow/KeyValueLabel/KeyValueLabel.cjs.map +1 -0
  198. package/dist/components/KeyValueRow/KeyValueLabel/KeyValueLabel.d.cts +14 -0
  199. package/dist/components/KeyValueRow/KeyValueLabel/KeyValueLabel.d.cts.map +1 -0
  200. package/dist/components/KeyValueRow/KeyValueLabel/KeyValueLabel.d.mts +14 -0
  201. package/dist/components/KeyValueRow/KeyValueLabel/KeyValueLabel.d.mts.map +1 -0
  202. package/dist/components/KeyValueRow/KeyValueLabel/KeyValueLabel.mjs +35 -0
  203. package/dist/components/KeyValueRow/KeyValueLabel/KeyValueLabel.mjs.map +1 -0
  204. package/dist/components/KeyValueRow/KeyValueRoot/KeyValueRoot.cjs +39 -0
  205. package/dist/components/KeyValueRow/KeyValueRoot/KeyValueRoot.cjs.map +1 -0
  206. package/dist/components/KeyValueRow/KeyValueRoot/KeyValueRoot.d.cts +25 -0
  207. package/dist/components/KeyValueRow/KeyValueRoot/KeyValueRoot.d.cts.map +1 -0
  208. package/dist/components/KeyValueRow/KeyValueRoot/KeyValueRoot.d.mts +25 -0
  209. package/dist/components/KeyValueRow/KeyValueRoot/KeyValueRoot.d.mts.map +1 -0
  210. package/dist/components/KeyValueRow/KeyValueRoot/KeyValueRoot.mjs +41 -0
  211. package/dist/components/KeyValueRow/KeyValueRoot/KeyValueRoot.mjs.map +1 -0
  212. package/dist/components/KeyValueRow/KeyValueRow.cjs +76 -0
  213. package/dist/components/KeyValueRow/KeyValueRow.cjs.map +1 -0
  214. package/dist/components/KeyValueRow/KeyValueRow.d.cts +25 -0
  215. package/dist/components/KeyValueRow/KeyValueRow.d.cts.map +1 -0
  216. package/dist/components/KeyValueRow/KeyValueRow.d.mts +25 -0
  217. package/dist/components/KeyValueRow/KeyValueRow.d.mts.map +1 -0
  218. package/dist/components/KeyValueRow/KeyValueRow.mjs +77 -0
  219. package/dist/components/KeyValueRow/KeyValueRow.mjs.map +1 -0
  220. package/dist/components/KeyValueRow/KeyValueRow.types.cjs +29 -0
  221. package/dist/components/KeyValueRow/KeyValueRow.types.cjs.map +1 -0
  222. package/dist/components/KeyValueRow/KeyValueRow.types.d.cts +177 -0
  223. package/dist/components/KeyValueRow/KeyValueRow.types.d.cts.map +1 -0
  224. package/dist/components/KeyValueRow/KeyValueRow.types.d.mts +177 -0
  225. package/dist/components/KeyValueRow/KeyValueRow.types.d.mts.map +1 -0
  226. package/dist/components/KeyValueRow/KeyValueRow.types.mjs +26 -0
  227. package/dist/components/KeyValueRow/KeyValueRow.types.mjs.map +1 -0
  228. package/dist/components/KeyValueRow/KeyValueRow.utils.cjs +6 -0
  229. package/dist/components/KeyValueRow/KeyValueRow.utils.cjs.map +1 -0
  230. package/dist/components/KeyValueRow/KeyValueRow.utils.d.cts +3 -0
  231. package/dist/components/KeyValueRow/KeyValueRow.utils.d.cts.map +1 -0
  232. package/dist/components/KeyValueRow/KeyValueRow.utils.d.mts +3 -0
  233. package/dist/components/KeyValueRow/KeyValueRow.utils.d.mts.map +1 -0
  234. package/dist/components/KeyValueRow/KeyValueRow.utils.mjs +2 -0
  235. package/dist/components/KeyValueRow/KeyValueRow.utils.mjs.map +1 -0
  236. package/dist/components/KeyValueRow/KeyValueSection/KeyValueSection.cjs +29 -0
  237. package/dist/components/KeyValueRow/KeyValueSection/KeyValueSection.cjs.map +1 -0
  238. package/dist/components/KeyValueRow/KeyValueSection/KeyValueSection.d.cts +17 -0
  239. package/dist/components/KeyValueRow/KeyValueSection/KeyValueSection.d.cts.map +1 -0
  240. package/dist/components/KeyValueRow/KeyValueSection/KeyValueSection.d.mts +17 -0
  241. package/dist/components/KeyValueRow/KeyValueSection/KeyValueSection.d.mts.map +1 -0
  242. package/dist/components/KeyValueRow/KeyValueSection/KeyValueSection.mjs +31 -0
  243. package/dist/components/KeyValueRow/KeyValueSection/KeyValueSection.mjs.map +1 -0
  244. package/dist/components/KeyValueRow/index.cjs +15 -0
  245. package/dist/components/KeyValueRow/index.cjs.map +1 -0
  246. package/dist/components/KeyValueRow/index.d.cts +3 -0
  247. package/dist/components/KeyValueRow/index.d.cts.map +1 -0
  248. package/dist/components/KeyValueRow/index.d.mts +3 -0
  249. package/dist/components/KeyValueRow/index.d.mts.map +1 -0
  250. package/dist/components/KeyValueRow/index.mjs +3 -0
  251. package/dist/components/KeyValueRow/index.mjs.map +1 -0
  252. package/dist/components/ListItem/ListItem.cjs +61 -0
  253. package/dist/components/ListItem/ListItem.cjs.map +1 -0
  254. package/dist/components/ListItem/ListItem.constants.cjs +14 -0
  255. package/dist/components/ListItem/ListItem.constants.cjs.map +1 -0
  256. package/dist/components/ListItem/ListItem.constants.d.cts +8 -0
  257. package/dist/components/ListItem/ListItem.constants.d.cts.map +1 -0
  258. package/dist/components/ListItem/ListItem.constants.d.mts +8 -0
  259. package/dist/components/ListItem/ListItem.constants.d.mts.map +1 -0
  260. package/dist/components/ListItem/ListItem.constants.mjs +11 -0
  261. package/dist/components/ListItem/ListItem.constants.mjs.map +1 -0
  262. package/dist/components/ListItem/ListItem.d.cts +4 -0
  263. package/dist/components/ListItem/ListItem.d.cts.map +1 -0
  264. package/dist/components/ListItem/ListItem.d.mts +4 -0
  265. package/dist/components/ListItem/ListItem.d.mts.map +1 -0
  266. package/dist/components/ListItem/ListItem.mjs +41 -0
  267. package/dist/components/ListItem/ListItem.mjs.map +1 -0
  268. package/dist/components/ListItem/ListItem.types.cjs +12 -0
  269. package/dist/components/ListItem/ListItem.types.cjs.map +1 -0
  270. package/dist/components/ListItem/ListItem.types.d.cts +60 -0
  271. package/dist/components/ListItem/ListItem.types.d.cts.map +1 -0
  272. package/dist/components/ListItem/ListItem.types.d.mts +60 -0
  273. package/dist/components/ListItem/ListItem.types.d.mts.map +1 -0
  274. package/dist/components/ListItem/ListItem.types.mjs +9 -0
  275. package/dist/components/ListItem/ListItem.types.mjs.map +1 -0
  276. package/dist/components/ListItem/index.cjs +8 -0
  277. package/dist/components/ListItem/index.cjs.map +1 -0
  278. package/dist/components/ListItem/index.d.cts +4 -0
  279. package/dist/components/ListItem/index.d.cts.map +1 -0
  280. package/dist/components/ListItem/index.d.mts +4 -0
  281. package/dist/components/ListItem/index.d.mts.map +1 -0
  282. package/dist/components/ListItem/index.mjs +3 -0
  283. package/dist/components/ListItem/index.mjs.map +1 -0
  284. package/dist/components/MainActionButton/MainActionButton.cjs +28 -0
  285. package/dist/components/MainActionButton/MainActionButton.cjs.map +1 -0
  286. package/dist/components/MainActionButton/MainActionButton.d.cts +4 -0
  287. package/dist/components/MainActionButton/MainActionButton.d.cts.map +1 -0
  288. package/dist/components/MainActionButton/MainActionButton.d.mts +4 -0
  289. package/dist/components/MainActionButton/MainActionButton.d.mts.map +1 -0
  290. package/dist/components/MainActionButton/MainActionButton.mjs +28 -0
  291. package/dist/components/MainActionButton/MainActionButton.mjs.map +1 -0
  292. package/dist/components/MainActionButton/MainActionButton.types.cjs +3 -0
  293. package/dist/components/MainActionButton/MainActionButton.types.cjs.map +1 -0
  294. package/dist/components/MainActionButton/MainActionButton.types.d.cts +41 -0
  295. package/dist/components/MainActionButton/MainActionButton.types.d.cts.map +1 -0
  296. package/dist/components/MainActionButton/MainActionButton.types.d.mts +41 -0
  297. package/dist/components/MainActionButton/MainActionButton.types.d.mts.map +1 -0
  298. package/dist/components/MainActionButton/MainActionButton.types.mjs +2 -0
  299. package/dist/components/MainActionButton/MainActionButton.types.mjs.map +1 -0
  300. package/dist/components/MainActionButton/index.cjs +6 -0
  301. package/dist/components/MainActionButton/index.cjs.map +1 -0
  302. package/dist/components/MainActionButton/index.d.cts +3 -0
  303. package/dist/components/MainActionButton/index.d.cts.map +1 -0
  304. package/dist/components/MainActionButton/index.d.mts +3 -0
  305. package/dist/components/MainActionButton/index.d.mts.map +1 -0
  306. package/dist/components/MainActionButton/index.mjs +2 -0
  307. package/dist/components/MainActionButton/index.mjs.map +1 -0
  308. package/dist/components/TabEmptyState/TabEmptyState.cjs +22 -0
  309. package/dist/components/TabEmptyState/TabEmptyState.cjs.map +1 -0
  310. package/dist/components/TabEmptyState/TabEmptyState.d.cts +4 -0
  311. package/dist/components/TabEmptyState/TabEmptyState.d.cts.map +1 -0
  312. package/dist/components/TabEmptyState/TabEmptyState.d.mts +4 -0
  313. package/dist/components/TabEmptyState/TabEmptyState.d.mts.map +1 -0
  314. package/dist/components/TabEmptyState/TabEmptyState.mjs +22 -0
  315. package/dist/components/TabEmptyState/TabEmptyState.mjs.map +1 -0
  316. package/dist/components/TabEmptyState/TabEmptyState.types.cjs +3 -0
  317. package/dist/components/TabEmptyState/TabEmptyState.types.cjs.map +1 -0
  318. package/dist/components/TabEmptyState/TabEmptyState.types.d.cts +45 -0
  319. package/dist/components/TabEmptyState/TabEmptyState.types.d.cts.map +1 -0
  320. package/dist/components/TabEmptyState/TabEmptyState.types.d.mts +45 -0
  321. package/dist/components/TabEmptyState/TabEmptyState.types.d.mts.map +1 -0
  322. package/dist/components/TabEmptyState/TabEmptyState.types.mjs +2 -0
  323. package/dist/components/TabEmptyState/TabEmptyState.types.mjs.map +1 -0
  324. package/dist/components/TabEmptyState/index.cjs +6 -0
  325. package/dist/components/TabEmptyState/index.cjs.map +1 -0
  326. package/dist/components/TabEmptyState/index.d.cts +3 -0
  327. package/dist/components/TabEmptyState/index.d.cts.map +1 -0
  328. package/dist/components/TabEmptyState/index.d.mts +3 -0
  329. package/dist/components/TabEmptyState/index.d.mts.map +1 -0
  330. package/dist/components/TabEmptyState/index.mjs +2 -0
  331. package/dist/components/TabEmptyState/index.mjs.map +1 -0
  332. package/dist/components/TextButton/TextButton.cjs +12 -36
  333. package/dist/components/TextButton/TextButton.cjs.map +1 -1
  334. package/dist/components/TextButton/TextButton.d.cts.map +1 -1
  335. package/dist/components/TextButton/TextButton.d.mts.map +1 -1
  336. package/dist/components/TextButton/TextButton.mjs +14 -38
  337. package/dist/components/TextButton/TextButton.mjs.map +1 -1
  338. package/dist/components/TextButton/TextButton.types.cjs.map +1 -1
  339. package/dist/components/TextButton/TextButton.types.d.cts +8 -60
  340. package/dist/components/TextButton/TextButton.types.d.cts.map +1 -1
  341. package/dist/components/TextButton/TextButton.types.d.mts +8 -60
  342. package/dist/components/TextButton/TextButton.types.d.mts.map +1 -1
  343. package/dist/components/TextButton/TextButton.types.mjs.map +1 -1
  344. package/dist/components/TextButton/index.cjs +1 -3
  345. package/dist/components/TextButton/index.cjs.map +1 -1
  346. package/dist/components/TextButton/index.d.cts +0 -1
  347. package/dist/components/TextButton/index.d.cts.map +1 -1
  348. package/dist/components/TextButton/index.d.mts +0 -1
  349. package/dist/components/TextButton/index.d.mts.map +1 -1
  350. package/dist/components/TextButton/index.mjs +0 -1
  351. package/dist/components/TextButton/index.mjs.map +1 -1
  352. package/dist/components/TextField/TextField.cjs +22 -8
  353. package/dist/components/TextField/TextField.cjs.map +1 -1
  354. package/dist/components/TextField/TextField.d.cts +0 -2
  355. package/dist/components/TextField/TextField.d.cts.map +1 -1
  356. package/dist/components/TextField/TextField.d.mts +0 -2
  357. package/dist/components/TextField/TextField.d.mts.map +1 -1
  358. package/dist/components/TextField/TextField.mjs +22 -8
  359. package/dist/components/TextField/TextField.mjs.map +1 -1
  360. package/dist/components/TextField/TextField.types.cjs +0 -10
  361. package/dist/components/TextField/TextField.types.cjs.map +1 -1
  362. package/dist/components/TextField/TextField.types.d.cts +0 -14
  363. package/dist/components/TextField/TextField.types.d.cts.map +1 -1
  364. package/dist/components/TextField/TextField.types.d.mts +0 -14
  365. package/dist/components/TextField/TextField.types.d.mts.map +1 -1
  366. package/dist/components/TextField/TextField.types.mjs +1 -9
  367. package/dist/components/TextField/TextField.types.mjs.map +1 -1
  368. package/dist/components/TextField/index.cjs +1 -3
  369. package/dist/components/TextField/index.cjs.map +1 -1
  370. package/dist/components/TextField/index.d.cts +0 -1
  371. package/dist/components/TextField/index.d.cts.map +1 -1
  372. package/dist/components/TextField/index.d.mts +0 -1
  373. package/dist/components/TextField/index.d.mts.map +1 -1
  374. package/dist/components/TextField/index.mjs +0 -1
  375. package/dist/components/TextField/index.mjs.map +1 -1
  376. package/dist/components/Toast/Toast.cjs +3 -2
  377. package/dist/components/Toast/Toast.cjs.map +1 -1
  378. package/dist/components/Toast/Toast.d.cts.map +1 -1
  379. package/dist/components/Toast/Toast.d.mts.map +1 -1
  380. package/dist/components/Toast/Toast.mjs +4 -3
  381. package/dist/components/Toast/Toast.mjs.map +1 -1
  382. package/dist/components/Toast/Toast.types.cjs +5 -5
  383. package/dist/components/Toast/Toast.types.cjs.map +1 -1
  384. package/dist/components/Toast/Toast.types.d.cts +5 -4
  385. package/dist/components/Toast/Toast.types.d.cts.map +1 -1
  386. package/dist/components/Toast/Toast.types.d.mts +5 -4
  387. package/dist/components/Toast/Toast.types.d.mts.map +1 -1
  388. package/dist/components/Toast/Toast.types.mjs +4 -4
  389. package/dist/components/Toast/Toast.types.mjs.map +1 -1
  390. package/dist/components/Toast/index.cjs +2 -2
  391. package/dist/components/Toast/index.cjs.map +1 -1
  392. package/dist/components/Toast/index.d.cts +1 -1
  393. package/dist/components/Toast/index.d.cts.map +1 -1
  394. package/dist/components/Toast/index.d.mts +1 -1
  395. package/dist/components/Toast/index.d.mts.map +1 -1
  396. package/dist/components/Toast/index.mjs +1 -1
  397. package/dist/components/Toast/index.mjs.map +1 -1
  398. package/dist/components/index.cjs +33 -4
  399. package/dist/components/index.cjs.map +1 -1
  400. package/dist/components/index.d.cts +28 -6
  401. package/dist/components/index.d.cts.map +1 -1
  402. package/dist/components/index.d.mts +28 -6
  403. package/dist/components/index.d.mts.map +1 -1
  404. package/dist/components/index.mjs +15 -4
  405. package/dist/components/index.mjs.map +1 -1
  406. package/dist/types/index.cjs +10 -11
  407. package/dist/types/index.cjs.map +1 -1
  408. package/dist/types/index.d.cts +8 -9
  409. package/dist/types/index.d.cts.map +1 -1
  410. package/dist/types/index.d.mts +8 -9
  411. package/dist/types/index.d.mts.map +1 -1
  412. package/dist/types/index.mjs +9 -10
  413. package/dist/types/index.mjs.map +1 -1
  414. package/package.json +2 -2
  415. package/dist/components/TextButton/TextButton.constants.cjs +0 -12
  416. package/dist/components/TextButton/TextButton.constants.cjs.map +0 -1
  417. package/dist/components/TextButton/TextButton.constants.d.cts +0 -4
  418. package/dist/components/TextButton/TextButton.constants.d.cts.map +0 -1
  419. package/dist/components/TextButton/TextButton.constants.d.mts +0 -4
  420. package/dist/components/TextButton/TextButton.constants.d.mts.map +0 -1
  421. package/dist/components/TextButton/TextButton.constants.mjs +0 -9
  422. package/dist/components/TextButton/TextButton.constants.mjs.map +0 -1
  423. package/dist/components/TextField/TextField.constants.cjs +0 -13
  424. package/dist/components/TextField/TextField.constants.cjs.map +0 -1
  425. package/dist/components/TextField/TextField.constants.d.cts +0 -6
  426. package/dist/components/TextField/TextField.constants.d.cts.map +0 -1
  427. package/dist/components/TextField/TextField.constants.d.mts +0 -6
  428. package/dist/components/TextField/TextField.constants.d.mts.map +0 -1
  429. package/dist/components/TextField/TextField.constants.mjs +0 -10
  430. package/dist/components/TextField/TextField.constants.mjs.map +0 -1
@@ -0,0 +1,63 @@
1
+ function $importDefault(module) {
2
+ if (module?.__esModule) {
3
+ return module.default;
4
+ }
5
+ return module;
6
+ }
7
+ import $React from "react";
8
+ const React = $importDefault($React);
9
+ import { BoxAlignItems, BoxBackgroundColor, ButtonIconSize, ButtonSize, FontWeight, BoxFlexDirection, IconName, TextVariant } from "../../types/index.mjs";
10
+ import { Box } from "../Box/index.mjs";
11
+ import { Button } from "../Button/index.mjs";
12
+ import { ButtonIcon } from "../ButtonIcon/index.mjs";
13
+ import { Text } from "../Text/index.mjs";
14
+ const isTextContent = (content) => typeof content === 'string' || typeof content === 'number';
15
+ const hasContent = (content) => content !== null && content !== undefined;
16
+ export const BannerBase = ({ title, titleProps, description, descriptionProps, children, childrenWrapperProps, actionButtonLabel, actionButtonOnPress, actionButtonProps, startAccessory, onClose, closeButtonProps, twClassName, ...props }) => {
17
+ const resolvedActionButtonProps = actionButtonProps ?? {};
18
+ const { accessibilityLabel: closeButtonAccessibilityLabel = 'Close banner', onPress: closeButtonPropsOnPress, twClassName: closeButtonTwClassName, ...resolvedCloseButtonProps } = closeButtonProps ?? {};
19
+ const shouldShowCloseButton = Boolean(onClose || closeButtonProps);
20
+ const shouldShowActionButton = Boolean(actionButtonOnPress);
21
+ const handleClosePress = onClose || closeButtonPropsOnPress
22
+ ? (event) => {
23
+ if (onClose) {
24
+ onClose();
25
+ return;
26
+ }
27
+ closeButtonPropsOnPress?.(event);
28
+ }
29
+ : undefined;
30
+ const mergedCloseButtonTwClassName = closeButtonTwClassName
31
+ ? `ml-3 ${closeButtonTwClassName}`
32
+ : 'ml-3';
33
+ return (<Box flexDirection={BoxFlexDirection.Row} alignItems={BoxAlignItems.Start} gap={2} backgroundColor={BoxBackgroundColor.BackgroundDefault} padding={3} twClassName={twClassName ? `rounded-sm ${twClassName}` : 'rounded-sm'} {...props}>
34
+ {startAccessory}
35
+
36
+ <Box twClassName="flex-1">
37
+ {hasContent(title) &&
38
+ (isTextContent(title) ? (<Text variant={TextVariant.BodyMd} fontWeight={FontWeight.Medium} {...titleProps}>
39
+ {title}
40
+ </Text>) : (title))}
41
+
42
+ {hasContent(description) && (<Box twClassName={hasContent(title) ? 'mt-1' : undefined}>
43
+ {isTextContent(description) ? (<Text variant={TextVariant.BodySm} {...descriptionProps}>
44
+ {description}
45
+ </Text>) : (description)}
46
+ </Box>)}
47
+
48
+ {hasContent(children) &&
49
+ (isTextContent(children) ? (<Text variant={TextVariant.BodyMd} {...childrenWrapperProps}>
50
+ {children}
51
+ </Text>) : (children))}
52
+
53
+ {shouldShowActionButton && (<Box twClassName="mt-4">
54
+ <Button size={ButtonSize.Md} onPress={actionButtonOnPress} {...resolvedActionButtonProps}>
55
+ {actionButtonLabel}
56
+ </Button>
57
+ </Box>)}
58
+ </Box>
59
+
60
+ {shouldShowCloseButton && (<ButtonIcon twClassName={mergedCloseButtonTwClassName} iconName={IconName.Close} size={ButtonIconSize.Sm} accessibilityLabel={closeButtonAccessibilityLabel} onPress={handleClosePress} {...resolvedCloseButtonProps}/>)}
61
+ </Box>);
62
+ };
63
+ //# sourceMappingURL=BannerBase.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BannerBase.mjs","sourceRoot":"","sources":["../../../src/components/BannerBase/BannerBase.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,MAAK,cAAc;;AAG1B,OAAO,EACL,aAAa,EACb,kBAAkB,EAClB,cAAc,EACd,UAAU,EACV,UAAU,EACV,gBAAgB,EAChB,QAAQ,EACR,WAAW,EACZ,8BAAoB;AACrB,OAAO,EAAE,GAAG,EAAE,yBAAe;AAC7B,OAAO,EAA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,CACH;UAAA,EAAE,GAAG,CAAC,CACP,CAED;;QAAA,CAAC,UAAU,CAAC,QAAQ,CAAC;YACnB,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CACzB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,IAAI,oBAAoB,CAAC,CAC1D;cAAA,CAAC,QAAQ,CACX;YAAA,EAAE,IAAI,CAAC,CACR,CAAC,CAAC,CAAC,CACF,QAAQ,CACT,CAAC,CAEJ;;QAAA,CAAC,sBAAsB,IAAI,CACzB,CAAC,GAAG,CAAC,WAAW,CAAC,MAAM,CACrB;YAAA,CAAC,MAAM,CACL,IAAI,CAAC,CAAC,UAAU,CAAC,EAAE,CAAC,CACpB,OAAO,CAAC,CAAC,mBAAmB,CAAC,CAC7B,IAAI,yBAAyB,CAAC,CAE9B;cAAA,CAAC,iBAAiB,CACpB;YAAA,EAAE,MAAM,CACV;UAAA,EAAE,GAAG,CAAC,CACP,CACH;MAAA,EAAE,GAAG,CAEL;;MAAA,CAAC,qBAAqB,IAAI,CACxB,CAAC,UAAU,CACT,WAAW,CAAC,CAAC,4BAA4B,CAAC,CAC1C,QAAQ,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CACzB,IAAI,CAAC,CAAC,cAAc,CAAC,EAAE,CAAC,CACxB,kBAAkB,CAAC,CAAC,6BAA6B,CAAC,CAClD,OAAO,CAAC,CAAC,gBAAgB,CAAC,CAC1B,IAAI,wBAAwB,CAAC,EAC7B,CACH,CACH;IAAA,EAAE,GAAG,CAAC,CACP,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import React from 'react';\nimport { GestureResponderEvent } from 'react-native';\n\nimport {\n BoxAlignItems,\n BoxBackgroundColor,\n ButtonIconSize,\n ButtonSize,\n FontWeight,\n BoxFlexDirection,\n IconName,\n TextVariant,\n} from '../../types';\nimport { Box } from '../Box';\nimport { Button } from '../Button';\nimport { ButtonIcon } from '../ButtonIcon';\nimport { Text } from '../Text';\n\nimport type { BannerBaseProps } from './BannerBase.types';\n\nconst isTextContent = (content: React.ReactNode): content is string | number =>\n typeof content === 'string' || typeof content === 'number';\n\nconst hasContent = (content: React.ReactNode) =>\n content !== null && content !== undefined;\n\nexport const BannerBase: React.FC<BannerBaseProps> = ({\n title,\n titleProps,\n description,\n descriptionProps,\n children,\n childrenWrapperProps,\n actionButtonLabel,\n actionButtonOnPress,\n actionButtonProps,\n startAccessory,\n onClose,\n closeButtonProps,\n twClassName,\n ...props\n}) => {\n const resolvedActionButtonProps = actionButtonProps ?? {};\n\n const {\n accessibilityLabel: closeButtonAccessibilityLabel = 'Close banner',\n onPress: closeButtonPropsOnPress,\n twClassName: closeButtonTwClassName,\n ...resolvedCloseButtonProps\n } = closeButtonProps ?? {};\n\n const shouldShowCloseButton = Boolean(onClose || closeButtonProps);\n const shouldShowActionButton = Boolean(actionButtonOnPress);\n\n const handleClosePress =\n onClose || closeButtonPropsOnPress\n ? (event: GestureResponderEvent) => {\n if (onClose) {\n onClose();\n return;\n }\n closeButtonPropsOnPress?.(event);\n }\n : undefined;\n\n const mergedCloseButtonTwClassName = closeButtonTwClassName\n ? `ml-3 ${closeButtonTwClassName}`\n : 'ml-3';\n\n return (\n <Box\n flexDirection={BoxFlexDirection.Row}\n alignItems={BoxAlignItems.Start}\n gap={2}\n backgroundColor={BoxBackgroundColor.BackgroundDefault}\n padding={3}\n twClassName={twClassName ? `rounded-sm ${twClassName}` : 'rounded-sm'}\n {...props}\n >\n {startAccessory}\n\n <Box twClassName=\"flex-1\">\n {hasContent(title) &&\n (isTextContent(title) ? (\n <Text\n variant={TextVariant.BodyMd}\n fontWeight={FontWeight.Medium}\n {...titleProps}\n >\n {title}\n </Text>\n ) : (\n title\n ))}\n\n {hasContent(description) && (\n <Box twClassName={hasContent(title) ? 'mt-1' : undefined}>\n {isTextContent(description) ? (\n <Text variant={TextVariant.BodySm} {...descriptionProps}>\n {description}\n </Text>\n ) : (\n description\n )}\n </Box>\n )}\n\n {hasContent(children) &&\n (isTextContent(children) ? (\n <Text variant={TextVariant.BodyMd} {...childrenWrapperProps}>\n {children}\n </Text>\n ) : (\n children\n ))}\n\n {shouldShowActionButton && (\n <Box twClassName=\"mt-4\">\n <Button\n size={ButtonSize.Md}\n onPress={actionButtonOnPress}\n {...resolvedActionButtonProps}\n >\n {actionButtonLabel}\n </Button>\n </Box>\n )}\n </Box>\n\n {shouldShowCloseButton && (\n <ButtonIcon\n twClassName={mergedCloseButtonTwClassName}\n iconName={IconName.Close}\n size={ButtonIconSize.Sm}\n accessibilityLabel={closeButtonAccessibilityLabel}\n onPress={handleClosePress}\n {...resolvedCloseButtonProps}\n />\n )}\n </Box>\n );\n};\n"]}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=BannerBase.types.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BannerBase.types.cjs","sourceRoot":"","sources":["../../../src/components/BannerBase/BannerBase.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { BannerBasePropsShared } from '@metamask/design-system-shared';\nimport type { GestureResponderEvent } from 'react-native';\n\nimport type { BoxProps } from '../Box';\nimport type { ButtonProps } from '../Button';\nimport type { ButtonIconProps } from '../ButtonIcon';\nimport type { TextProps } from '../Text';\n\ntype BannerBaseActionButtonProps = Omit<\n Partial<ButtonProps>,\n 'children' | 'onPress' | 'variant'\n>;\n\ntype BannerBaseCloseButtonProps = Omit<\n Partial<ButtonIconProps>,\n 'iconName' | 'onPress'\n> & {\n /**\n * Optional press handler for the close button.\n */\n onPress?: (event: GestureResponderEvent) => void;\n};\n\ntype BannerBasePropsBase = BannerBasePropsShared &\n Omit<BoxProps, 'children'> & {\n /**\n * Optional props for the title `Text` when title is a string.\n */\n titleProps?: Omit<Partial<TextProps>, 'children'>;\n /**\n * Optional props for the description `Text` when description is a string.\n */\n descriptionProps?: Omit<Partial<TextProps>, 'children'>;\n /**\n * Optional props for the children wrapper `Text` when children is a string.\n */\n childrenWrapperProps?: Omit<Partial<TextProps>, 'children'>;\n /**\n * Optional callback for the close button.\n * If provided, a close button is shown.\n */\n onClose?: () => void;\n /**\n * Optional props for the close `ButtonIcon`.\n * Providing this also shows a close button.\n */\n closeButtonProps?: BannerBaseCloseButtonProps;\n };\n\ntype BannerBaseActionPropsWithHandler = {\n actionButtonOnPress: (event: GestureResponderEvent) => void;\n actionButtonLabel: string;\n actionButtonProps?: BannerBaseActionButtonProps;\n};\n\ntype BannerBaseActionPropsWithoutHandler = {\n actionButtonOnPress?: undefined;\n actionButtonLabel?: string;\n actionButtonProps?: BannerBaseActionButtonProps;\n};\n\n/**\n * BannerBase component props.\n */\nexport type BannerBaseProps = BannerBasePropsBase &\n (BannerBaseActionPropsWithHandler | BannerBaseActionPropsWithoutHandler);\n"]}
@@ -0,0 +1,53 @@
1
+ import type { BannerBasePropsShared } from "@metamask/design-system-shared";
2
+ import type { GestureResponderEvent } from "react-native/index.js";
3
+ import type { BoxProps } from "../Box/index.cjs";
4
+ import type { ButtonProps } from "../Button/index.cjs";
5
+ import type { ButtonIconProps } from "../ButtonIcon/index.cjs";
6
+ import type { TextProps } from "../Text/index.cjs";
7
+ type BannerBaseActionButtonProps = Omit<Partial<ButtonProps>, 'children' | 'onPress' | 'variant'>;
8
+ type BannerBaseCloseButtonProps = Omit<Partial<ButtonIconProps>, 'iconName' | 'onPress'> & {
9
+ /**
10
+ * Optional press handler for the close button.
11
+ */
12
+ onPress?: (event: GestureResponderEvent) => void;
13
+ };
14
+ type BannerBasePropsBase = BannerBasePropsShared & Omit<BoxProps, 'children'> & {
15
+ /**
16
+ * Optional props for the title `Text` when title is a string.
17
+ */
18
+ titleProps?: Omit<Partial<TextProps>, 'children'>;
19
+ /**
20
+ * Optional props for the description `Text` when description is a string.
21
+ */
22
+ descriptionProps?: Omit<Partial<TextProps>, 'children'>;
23
+ /**
24
+ * Optional props for the children wrapper `Text` when children is a string.
25
+ */
26
+ childrenWrapperProps?: Omit<Partial<TextProps>, 'children'>;
27
+ /**
28
+ * Optional callback for the close button.
29
+ * If provided, a close button is shown.
30
+ */
31
+ onClose?: () => void;
32
+ /**
33
+ * Optional props for the close `ButtonIcon`.
34
+ * Providing this also shows a close button.
35
+ */
36
+ closeButtonProps?: BannerBaseCloseButtonProps;
37
+ };
38
+ type BannerBaseActionPropsWithHandler = {
39
+ actionButtonOnPress: (event: GestureResponderEvent) => void;
40
+ actionButtonLabel: string;
41
+ actionButtonProps?: BannerBaseActionButtonProps;
42
+ };
43
+ type BannerBaseActionPropsWithoutHandler = {
44
+ actionButtonOnPress?: undefined;
45
+ actionButtonLabel?: string;
46
+ actionButtonProps?: BannerBaseActionButtonProps;
47
+ };
48
+ /**
49
+ * BannerBase component props.
50
+ */
51
+ export type BannerBaseProps = BannerBasePropsBase & (BannerBaseActionPropsWithHandler | BannerBaseActionPropsWithoutHandler);
52
+ export {};
53
+ //# sourceMappingURL=BannerBase.types.d.cts.map
@@ -0,0 +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,uCAAuC;AAC5E,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,GAAG;IACF;;OAEG;IACH,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,qBAAqB,KAAK,IAAI,CAAC;CAClD,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,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"}
@@ -0,0 +1,53 @@
1
+ import type { BannerBasePropsShared } from "@metamask/design-system-shared";
2
+ import type { GestureResponderEvent } from "react-native/index.js";
3
+ import type { BoxProps } from "../Box/index.mjs";
4
+ import type { ButtonProps } from "../Button/index.mjs";
5
+ import type { ButtonIconProps } from "../ButtonIcon/index.mjs";
6
+ import type { TextProps } from "../Text/index.mjs";
7
+ type BannerBaseActionButtonProps = Omit<Partial<ButtonProps>, 'children' | 'onPress' | 'variant'>;
8
+ type BannerBaseCloseButtonProps = Omit<Partial<ButtonIconProps>, 'iconName' | 'onPress'> & {
9
+ /**
10
+ * Optional press handler for the close button.
11
+ */
12
+ onPress?: (event: GestureResponderEvent) => void;
13
+ };
14
+ type BannerBasePropsBase = BannerBasePropsShared & Omit<BoxProps, 'children'> & {
15
+ /**
16
+ * Optional props for the title `Text` when title is a string.
17
+ */
18
+ titleProps?: Omit<Partial<TextProps>, 'children'>;
19
+ /**
20
+ * Optional props for the description `Text` when description is a string.
21
+ */
22
+ descriptionProps?: Omit<Partial<TextProps>, 'children'>;
23
+ /**
24
+ * Optional props for the children wrapper `Text` when children is a string.
25
+ */
26
+ childrenWrapperProps?: Omit<Partial<TextProps>, 'children'>;
27
+ /**
28
+ * Optional callback for the close button.
29
+ * If provided, a close button is shown.
30
+ */
31
+ onClose?: () => void;
32
+ /**
33
+ * Optional props for the close `ButtonIcon`.
34
+ * Providing this also shows a close button.
35
+ */
36
+ closeButtonProps?: BannerBaseCloseButtonProps;
37
+ };
38
+ type BannerBaseActionPropsWithHandler = {
39
+ actionButtonOnPress: (event: GestureResponderEvent) => void;
40
+ actionButtonLabel: string;
41
+ actionButtonProps?: BannerBaseActionButtonProps;
42
+ };
43
+ type BannerBaseActionPropsWithoutHandler = {
44
+ actionButtonOnPress?: undefined;
45
+ actionButtonLabel?: string;
46
+ actionButtonProps?: BannerBaseActionButtonProps;
47
+ };
48
+ /**
49
+ * BannerBase component props.
50
+ */
51
+ export type BannerBaseProps = BannerBasePropsBase & (BannerBaseActionPropsWithHandler | BannerBaseActionPropsWithoutHandler);
52
+ export {};
53
+ //# sourceMappingURL=BannerBase.types.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BannerBase.types.d.mts","sourceRoot":"","sources":["../../../src/components/BannerBase/BannerBase.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAA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C;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"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=BannerBase.types.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BannerBase.types.mjs","sourceRoot":"","sources":["../../../src/components/BannerBase/BannerBase.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { BannerBasePropsShared } from '@metamask/design-system-shared';\nimport type { GestureResponderEvent } from 'react-native';\n\nimport type { BoxProps } from '../Box';\nimport type { ButtonProps } from '../Button';\nimport type { ButtonIconProps } from '../ButtonIcon';\nimport type { TextProps } from '../Text';\n\ntype BannerBaseActionButtonProps = Omit<\n Partial<ButtonProps>,\n 'children' | 'onPress' | 'variant'\n>;\n\ntype BannerBaseCloseButtonProps = Omit<\n Partial<ButtonIconProps>,\n 'iconName' | 'onPress'\n> & {\n /**\n * Optional press handler for the close button.\n */\n onPress?: (event: GestureResponderEvent) => void;\n};\n\ntype BannerBasePropsBase = BannerBasePropsShared &\n Omit<BoxProps, 'children'> & {\n /**\n * Optional props for the title `Text` when title is a string.\n */\n titleProps?: Omit<Partial<TextProps>, 'children'>;\n /**\n * Optional props for the description `Text` when description is a string.\n */\n descriptionProps?: Omit<Partial<TextProps>, 'children'>;\n /**\n * Optional props for the children wrapper `Text` when children is a string.\n */\n childrenWrapperProps?: Omit<Partial<TextProps>, 'children'>;\n /**\n * Optional callback for the close button.\n * If provided, a close button is shown.\n */\n onClose?: () => void;\n /**\n * Optional props for the close `ButtonIcon`.\n * Providing this also shows a close button.\n */\n closeButtonProps?: BannerBaseCloseButtonProps;\n };\n\ntype BannerBaseActionPropsWithHandler = {\n actionButtonOnPress: (event: GestureResponderEvent) => void;\n actionButtonLabel: string;\n actionButtonProps?: BannerBaseActionButtonProps;\n};\n\ntype BannerBaseActionPropsWithoutHandler = {\n actionButtonOnPress?: undefined;\n actionButtonLabel?: string;\n actionButtonProps?: BannerBaseActionButtonProps;\n};\n\n/**\n * BannerBase component props.\n */\nexport type BannerBaseProps = BannerBasePropsBase &\n (BannerBaseActionPropsWithHandler | BannerBaseActionPropsWithoutHandler);\n"]}
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BannerBase = void 0;
4
+ var BannerBase_1 = require("./BannerBase.cjs");
5
+ Object.defineProperty(exports, "BannerBase", { enumerable: true, get: function () { return BannerBase_1.BannerBase; } });
6
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../../src/components/BannerBase/index.ts"],"names":[],"mappings":";;;AAAA,+CAA0C;AAAjC,wGAAA,UAAU,OAAA","sourcesContent":["export { BannerBase } from './BannerBase';\nexport type { BannerBaseProps } from './BannerBase.types';\n"]}
@@ -0,0 +1,3 @@
1
+ export { BannerBase } from "./BannerBase.cjs";
2
+ export type { BannerBaseProps } from "./BannerBase.types.cjs";
3
+ //# sourceMappingURL=index.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/components/BannerBase/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,yBAAqB;AAC1C,YAAY,EAAE,eAAe,EAAE,+BAA2B"}
@@ -0,0 +1,3 @@
1
+ export { BannerBase } from "./BannerBase.mjs";
2
+ export type { BannerBaseProps } from "./BannerBase.types.mjs";
3
+ //# sourceMappingURL=index.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../src/components/BannerBase/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,yBAAqB;AAC1C,YAAY,EAAE,eAAe,EAAE,+BAA2B"}
@@ -0,0 +1,2 @@
1
+ export { BannerBase } from "./BannerBase.mjs";
2
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../src/components/BannerBase/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,yBAAqB","sourcesContent":["export { BannerBase } from './BannerBase';\nexport type { BannerBaseProps } from './BannerBase.types';\n"]}
@@ -0,0 +1,109 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ var __importDefault = (this && this.__importDefault) || function (mod) {
26
+ return (mod && mod.__esModule) ? mod : { "default": mod };
27
+ };
28
+ Object.defineProperty(exports, "__esModule", { value: true });
29
+ exports.BottomSheet = void 0;
30
+ const design_system_twrnc_preset_1 = require("@metamask/design-system-twrnc-preset");
31
+ const react_1 = __importStar(require("react"));
32
+ const react_native_1 = require("react-native/index.js");
33
+ const react_native_safe_area_context_1 = require("react-native-safe-area-context");
34
+ const BottomSheetDialog_1 = __importDefault(require("../BottomSheetDialog/index.cjs"));
35
+ const BottomSheetOverlay_1 = require("../BottomSheetOverlay/BottomSheetOverlay.cjs");
36
+ exports.BottomSheet = (0, react_1.forwardRef)(({ children, onClose, onOpen, goBack, style, twClassName, isInteractable = true, shouldNavigateBack = true, isFullscreen = false, keyboardAvoidingViewEnabled = true, ...props }, ref) => {
37
+ const tw = (0, design_system_twrnc_preset_1.useTailwind)();
38
+ const { bottom: screenBottomPadding } = (0, react_native_safe_area_context_1.useSafeAreaInsets)();
39
+ const { y: frameY } = (0, react_native_safe_area_context_1.useSafeAreaFrame)();
40
+ const postCallback = (0, react_1.useRef)();
41
+ const bottomSheetDialogRef = (0, react_1.useRef)(null);
42
+ const didNavigateBackRef = (0, react_1.useRef)(false);
43
+ const closeRequestedRef = (0, react_1.useRef)(false);
44
+ const didRunPostCallbackRef = (0, react_1.useRef)(false);
45
+ const onOpenCB = (0, react_1.useCallback)(() => {
46
+ // Reset when the sheet is opened again.
47
+ didNavigateBackRef.current = false;
48
+ closeRequestedRef.current = false;
49
+ didRunPostCallbackRef.current = false;
50
+ onOpen?.(Boolean(postCallback.current));
51
+ const callback = postCallback.current;
52
+ postCallback.current = undefined;
53
+ callback?.();
54
+ }, [onOpen]);
55
+ const onCloseCB = (0, react_1.useCallback)(() => {
56
+ if (shouldNavigateBack && !didNavigateBackRef.current) {
57
+ didNavigateBackRef.current = true;
58
+ goBack();
59
+ }
60
+ const callback = postCallback.current;
61
+ const hasCallback = Boolean(callback);
62
+ onClose?.(hasCallback);
63
+ if (!didRunPostCallbackRef.current && hasCallback) {
64
+ didRunPostCallbackRef.current = true;
65
+ postCallback.current = undefined;
66
+ callback?.();
67
+ }
68
+ }, [goBack, onClose, shouldNavigateBack]);
69
+ // Dismiss the sheet when Android back button is pressed.
70
+ (0, react_1.useEffect)(() => {
71
+ const hardwareBackPress = () => {
72
+ if (isInteractable) {
73
+ bottomSheetDialogRef.current?.onCloseDialog();
74
+ }
75
+ return true;
76
+ };
77
+ react_native_1.BackHandler.addEventListener('hardwareBackPress', hardwareBackPress);
78
+ return () => {
79
+ react_native_1.BackHandler.removeEventListener('hardwareBackPress', hardwareBackPress);
80
+ };
81
+ }, [isInteractable]);
82
+ (0, react_1.useImperativeHandle)(ref, () => ({
83
+ onCloseBottomSheet: (callback) => {
84
+ if (closeRequestedRef.current) {
85
+ return;
86
+ }
87
+ closeRequestedRef.current = true;
88
+ postCallback.current = callback;
89
+ bottomSheetDialogRef.current?.onCloseDialog();
90
+ },
91
+ onOpenBottomSheet: (callback) => {
92
+ didNavigateBackRef.current = false;
93
+ closeRequestedRef.current = false;
94
+ didRunPostCallbackRef.current = false;
95
+ postCallback.current = callback;
96
+ bottomSheetDialogRef.current?.onOpenDialog();
97
+ },
98
+ }));
99
+ return (<react_native_1.KeyboardAvoidingView behavior={react_native_1.Platform.OS === 'ios' ? 'padding' : undefined} keyboardVerticalOffset={react_native_1.Platform.OS === 'ios' ? -screenBottomPadding : frameY} style={[tw.style('absolute inset-0 justify-end'), style]} enabled={keyboardAvoidingViewEnabled} {...props}>
100
+ <BottomSheetOverlay_1.BottomSheetOverlay onPress={isInteractable
101
+ ? () => bottomSheetDialogRef.current?.onCloseDialog()
102
+ : undefined}/>
103
+ <BottomSheetDialog_1.default isInteractable={isInteractable} onClose={onCloseCB} onOpen={onOpenCB} ref={bottomSheetDialogRef} isFullscreen={isFullscreen} twClassName={twClassName} keyboardAvoidingViewEnabled={keyboardAvoidingViewEnabled}>
104
+ {children}
105
+ </BottomSheetDialog_1.default>
106
+ </react_native_1.KeyboardAvoidingView>);
107
+ });
108
+ exports.BottomSheet.displayName = 'BottomSheet';
109
+ //# sourceMappingURL=BottomSheet.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BottomSheet.cjs","sourceRoot":"","sources":["../../../src/components/BottomSheet/BottomShe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,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,2BAAiB,CACrB;MAAA,EAAE,mCAAoB,CAAC,CACxB,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,mBAAW,CAAC,WAAW,GAAG,aAAa,CAAC","sourcesContent":["import { useTailwind } from '@metamask/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 shouldNavigateBack = 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>();\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 (shouldNavigateBack && !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, shouldNavigateBack]);\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 >\n {children}\n </BottomSheetDialog>\n </KeyboardAvoidingView>\n );\n },\n);\n\nBottomSheet.displayName = 'BottomSheet';\n"]}
@@ -0,0 +1,16 @@
1
+ import React from "react";
2
+ import type { BottomSheetRef } from "./BottomSheet.types.cjs";
3
+ export declare const BottomSheet: React.ForwardRefExoticComponent<{
4
+ shouldNavigateBack?: boolean | undefined;
5
+ goBack: () => void;
6
+ keyboardAvoidingViewEnabled?: boolean | undefined;
7
+ } & {
8
+ children?: React.ReactNode;
9
+ isFullscreen?: boolean | undefined;
10
+ isInteractable?: boolean | undefined;
11
+ keyboardAvoidingViewEnabled?: boolean | undefined;
12
+ onClose?: ((hasPendingAction?: boolean | undefined) => void) | undefined;
13
+ onOpen?: ((hasPendingAction?: boolean | undefined) => void) | undefined;
14
+ twClassName?: string | undefined;
15
+ } & import("react-native").ViewProps & React.RefAttributes<BottomSheetRef>>;
16
+ //# sourceMappingURL=BottomSheet.d.cts.map
@@ -0,0 +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;;;;;;;;;;;;2EAuHvB,CAAC"}
@@ -0,0 +1,16 @@
1
+ import React from "react";
2
+ import type { BottomSheetRef } from "./BottomSheet.types.mjs";
3
+ export declare const BottomSheet: React.ForwardRefExoticComponent<{
4
+ shouldNavigateBack?: boolean | undefined;
5
+ goBack: () => void;
6
+ keyboardAvoidingViewEnabled?: boolean | undefined;
7
+ } & {
8
+ children?: React.ReactNode;
9
+ isFullscreen?: boolean | undefined;
10
+ isInteractable?: boolean | undefined;
11
+ keyboardAvoidingViewEnabled?: boolean | undefined;
12
+ onClose?: ((hasPendingAction?: boolean | undefined) => void) | undefined;
13
+ onOpen?: ((hasPendingAction?: boolean | undefined) => void) | undefined;
14
+ twClassName?: string | undefined;
15
+ } & import("react-native").ViewProps & React.RefAttributes<BottomSheetRef>>;
16
+ //# sourceMappingURL=BottomSheet.d.mts.map
@@ -0,0 +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;;;;;;;;;;;;2EAuHvB,CAAC"}
@@ -0,0 +1,87 @@
1
+ function $importDefault(module) {
2
+ if (module?.__esModule) {
3
+ return module.default;
4
+ }
5
+ return module;
6
+ }
7
+ import { useTailwind } from "@metamask/design-system-twrnc-preset";
8
+ import $React, { forwardRef, useCallback, useEffect, useImperativeHandle, useRef } from "react";
9
+ const React = $importDefault($React);
10
+ import { BackHandler, KeyboardAvoidingView, Platform } from "react-native/index.js";
11
+ import { useSafeAreaFrame, useSafeAreaInsets } from "react-native-safe-area-context";
12
+ import BottomSheetDialog from "../BottomSheetDialog/index.mjs";
13
+ import { BottomSheetOverlay } from "../BottomSheetOverlay/BottomSheetOverlay.mjs";
14
+ export const BottomSheet = forwardRef(({ children, onClose, onOpen, goBack, style, twClassName, isInteractable = true, shouldNavigateBack = true, isFullscreen = false, keyboardAvoidingViewEnabled = true, ...props }, ref) => {
15
+ const tw = useTailwind();
16
+ const { bottom: screenBottomPadding } = useSafeAreaInsets();
17
+ const { y: frameY } = useSafeAreaFrame();
18
+ const postCallback = useRef();
19
+ const bottomSheetDialogRef = useRef(null);
20
+ const didNavigateBackRef = useRef(false);
21
+ const closeRequestedRef = useRef(false);
22
+ const didRunPostCallbackRef = useRef(false);
23
+ const onOpenCB = useCallback(() => {
24
+ // Reset when the sheet is opened again.
25
+ didNavigateBackRef.current = false;
26
+ closeRequestedRef.current = false;
27
+ didRunPostCallbackRef.current = false;
28
+ onOpen?.(Boolean(postCallback.current));
29
+ const callback = postCallback.current;
30
+ postCallback.current = undefined;
31
+ callback?.();
32
+ }, [onOpen]);
33
+ const onCloseCB = useCallback(() => {
34
+ if (shouldNavigateBack && !didNavigateBackRef.current) {
35
+ didNavigateBackRef.current = true;
36
+ goBack();
37
+ }
38
+ const callback = postCallback.current;
39
+ const hasCallback = Boolean(callback);
40
+ onClose?.(hasCallback);
41
+ if (!didRunPostCallbackRef.current && hasCallback) {
42
+ didRunPostCallbackRef.current = true;
43
+ postCallback.current = undefined;
44
+ callback?.();
45
+ }
46
+ }, [goBack, onClose, shouldNavigateBack]);
47
+ // Dismiss the sheet when Android back button is pressed.
48
+ useEffect(() => {
49
+ const hardwareBackPress = () => {
50
+ if (isInteractable) {
51
+ bottomSheetDialogRef.current?.onCloseDialog();
52
+ }
53
+ return true;
54
+ };
55
+ BackHandler.addEventListener('hardwareBackPress', hardwareBackPress);
56
+ return () => {
57
+ BackHandler.removeEventListener('hardwareBackPress', hardwareBackPress);
58
+ };
59
+ }, [isInteractable]);
60
+ useImperativeHandle(ref, () => ({
61
+ onCloseBottomSheet: (callback) => {
62
+ if (closeRequestedRef.current) {
63
+ return;
64
+ }
65
+ closeRequestedRef.current = true;
66
+ postCallback.current = callback;
67
+ bottomSheetDialogRef.current?.onCloseDialog();
68
+ },
69
+ onOpenBottomSheet: (callback) => {
70
+ didNavigateBackRef.current = false;
71
+ closeRequestedRef.current = false;
72
+ didRunPostCallbackRef.current = false;
73
+ postCallback.current = callback;
74
+ bottomSheetDialogRef.current?.onOpenDialog();
75
+ },
76
+ }));
77
+ return (<KeyboardAvoidingView behavior={Platform.OS === 'ios' ? 'padding' : undefined} keyboardVerticalOffset={Platform.OS === 'ios' ? -screenBottomPadding : frameY} style={[tw.style('absolute inset-0 justify-end'), style]} enabled={keyboardAvoidingViewEnabled} {...props}>
78
+ <BottomSheetOverlay onPress={isInteractable
79
+ ? () => bottomSheetDialogRef.current?.onCloseDialog()
80
+ : undefined}/>
81
+ <BottomSheetDialog isInteractable={isInteractable} onClose={onCloseCB} onOpen={onOpenCB} ref={bottomSheetDialogRef} isFullscreen={isFullscreen} twClassName={twClassName} keyboardAvoidingViewEnabled={keyboardAvoidingViewEnabled}>
82
+ {children}
83
+ </BottomSheetDialog>
84
+ </KeyboardAvoidingView>);
85
+ });
86
+ BottomSheet.displayName = 'BottomSheet';
87
+ //# sourceMappingURL=BottomSheet.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BottomSheet.mjs","sourceRoot":"","sources":["../../../src/components/BottomSheet/BottomSheet.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,6CAA6C;AACnE,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,iBAAiB,uCAA6B;AAErD,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,kBAAkB,GAAG,IAAI,EACzB,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,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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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/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 shouldNavigateBack = 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>();\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 (shouldNavigateBack && !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, shouldNavigateBack]);\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 >\n {children}\n </BottomSheetDialog>\n </KeyboardAvoidingView>\n );\n },\n);\n\nBottomSheet.displayName = 'BottomSheet';\n"]}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=BottomSheet.types.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BottomSheet.types.cjs","sourceRoot":"","sources":["../../../src/components/BottomSheet/BottomSheet.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { BottomSheetDialogProps } from '../BottomSheetDialog/BottomSheetDialog.types';\n\n/**\n * BottomSheet component props.\n */\nexport type BottomSheetProps = {\n /**\n * Optional boolean that indicates if sheet is unmounted from the stack or not when closed.\n *\n * @default true\n */\n shouldNavigateBack?: boolean;\n\n /**\n * Callback invoked to navigate back when shouldNavigateBack is true and the sheet closes.\n */\n goBack: () => void;\n\n /**\n * Optional boolean that indicates if the KeyboardAvoidingView is enabled.\n *\n * @default true\n */\n keyboardAvoidingViewEnabled?: boolean;\n} & BottomSheetDialogProps;\n\nexport type BottomSheetPostCallback = () => void;\n\nexport type BottomSheetRef = {\n onOpenBottomSheet: (callback?: BottomSheetPostCallback) => void;\n onCloseBottomSheet: (callback?: BottomSheetPostCallback) => void;\n};\n"]}
@@ -0,0 +1,28 @@
1
+ import type { BottomSheetDialogProps } from "../BottomSheetDialog/BottomSheetDialog.types.cjs";
2
+ /**
3
+ * BottomSheet component props.
4
+ */
5
+ export type BottomSheetProps = {
6
+ /**
7
+ * Optional boolean that indicates if sheet is unmounted from the stack or not when closed.
8
+ *
9
+ * @default true
10
+ */
11
+ shouldNavigateBack?: boolean;
12
+ /**
13
+ * Callback invoked to navigate back when shouldNavigateBack is true and the sheet closes.
14
+ */
15
+ goBack: () => void;
16
+ /**
17
+ * Optional boolean that indicates if the KeyboardAvoidingView is enabled.
18
+ *
19
+ * @default true
20
+ */
21
+ keyboardAvoidingViewEnabled?: boolean;
22
+ } & BottomSheetDialogProps;
23
+ export type BottomSheetPostCallback = () => void;
24
+ export type BottomSheetRef = {
25
+ onOpenBottomSheet: (callback?: BottomSheetPostCallback) => void;
26
+ onCloseBottomSheet: (callback?: BottomSheetPostCallback) => void;
27
+ };
28
+ //# sourceMappingURL=BottomSheet.types.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BottomSheet.types.d.cts","sourceRoot":"","sources":["../../../src/components/BottomSheet/BottomSheet.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,yDAAqD;AAE3F;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAE7B;;OAEG;IACH,MAAM,EAAE,MAAM,IAAI,CAAC;IAEnB;;;;OAIG;IACH,2BAA2B,CAAC,EAAE,OAAO,CAAC;CACvC,GAAG,sBAAsB,CAAC;AAE3B,MAAM,MAAM,uBAAuB,GAAG,MAAM,IAAI,CAAC;AAEjD,MAAM,MAAM,cAAc,GAAG;IAC3B,iBAAiB,EAAE,CAAC,QAAQ,CAAC,EAAE,uBAAuB,KAAK,IAAI,CAAC;IAChE,kBAAkB,EAAE,CAAC,QAAQ,CAAC,EAAE,uBAAuB,KAAK,IAAI,CAAC;CAClE,CAAC"}
@@ -0,0 +1,28 @@
1
+ import type { BottomSheetDialogProps } from "../BottomSheetDialog/BottomSheetDialog.types.mjs";
2
+ /**
3
+ * BottomSheet component props.
4
+ */
5
+ export type BottomSheetProps = {
6
+ /**
7
+ * Optional boolean that indicates if sheet is unmounted from the stack or not when closed.
8
+ *
9
+ * @default true
10
+ */
11
+ shouldNavigateBack?: boolean;
12
+ /**
13
+ * Callback invoked to navigate back when shouldNavigateBack is true and the sheet closes.
14
+ */
15
+ goBack: () => void;
16
+ /**
17
+ * Optional boolean that indicates if the KeyboardAvoidingView is enabled.
18
+ *
19
+ * @default true
20
+ */
21
+ keyboardAvoidingViewEnabled?: boolean;
22
+ } & BottomSheetDialogProps;
23
+ export type BottomSheetPostCallback = () => void;
24
+ export type BottomSheetRef = {
25
+ onOpenBottomSheet: (callback?: BottomSheetPostCallback) => void;
26
+ onCloseBottomSheet: (callback?: BottomSheetPostCallback) => void;
27
+ };
28
+ //# sourceMappingURL=BottomSheet.types.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BottomSheet.types.d.mts","sourceRoot":"","sources":["../../../src/components/BottomSheet/BottomSheet.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,yDAAqD;AAE3F;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAE7B;;OAEG;IACH,MAAM,EAAE,MAAM,IAAI,CAAC;IAEnB;;;;OAIG;IACH,2BAA2B,CAAC,EAAE,OAAO,CAAC;CACvC,GAAG,sBAAsB,CAAC;AAE3B,MAAM,MAAM,uBAAuB,GAAG,MAAM,IAAI,CAAC;AAEjD,MAAM,MAAM,cAAc,GAAG;IAC3B,iBAAiB,EAAE,CAAC,QAAQ,CAAC,EAAE,uBAAuB,KAAK,IAAI,CAAC;IAChE,kBAAkB,EAAE,CAAC,QAAQ,CAAC,EAAE,uBAAuB,KAAK,IAAI,CAAC;CAClE,CAAC"}