@metamask-previews/design-system-react-native 0.9.0-preview.694a8ed → 0.11.0-preview.23cc337

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 (371) hide show
  1. package/CHANGELOG.md +51 -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 +1 -1
  41. package/dist/components/BannerBase/BannerBase.cjs.map +1 -1
  42. package/dist/components/BannerBase/BannerBase.d.cts.map +1 -1
  43. package/dist/components/BannerBase/BannerBase.d.mts.map +1 -1
  44. package/dist/components/BannerBase/BannerBase.mjs +1 -1
  45. package/dist/components/BannerBase/BannerBase.mjs.map +1 -1
  46. package/dist/components/BottomSheet/BottomSheet.cjs +109 -0
  47. package/dist/components/BottomSheet/BottomSheet.cjs.map +1 -0
  48. package/dist/components/BottomSheet/BottomSheet.d.cts +16 -0
  49. package/dist/components/BottomSheet/BottomSheet.d.cts.map +1 -0
  50. package/dist/components/BottomSheet/BottomSheet.d.mts +16 -0
  51. package/dist/components/BottomSheet/BottomSheet.d.mts.map +1 -0
  52. package/dist/components/BottomSheet/BottomSheet.mjs +87 -0
  53. package/dist/components/BottomSheet/BottomSheet.mjs.map +1 -0
  54. package/dist/components/BottomSheet/BottomSheet.types.cjs +3 -0
  55. package/dist/components/BottomSheet/BottomSheet.types.cjs.map +1 -0
  56. package/dist/components/BottomSheet/BottomSheet.types.d.cts +28 -0
  57. package/dist/components/BottomSheet/BottomSheet.types.d.cts.map +1 -0
  58. package/dist/components/BottomSheet/BottomSheet.types.d.mts +28 -0
  59. package/dist/components/BottomSheet/BottomSheet.types.d.mts.map +1 -0
  60. package/dist/components/BottomSheet/BottomSheet.types.mjs +2 -0
  61. package/dist/components/BottomSheet/BottomSheet.types.mjs.map +1 -0
  62. package/dist/components/BottomSheet/index.cjs +6 -0
  63. package/dist/components/BottomSheet/index.cjs.map +1 -0
  64. package/dist/components/BottomSheet/index.d.cts +3 -0
  65. package/dist/components/BottomSheet/index.d.cts.map +1 -0
  66. package/dist/components/BottomSheet/index.d.mts +3 -0
  67. package/dist/components/BottomSheet/index.d.mts.map +1 -0
  68. package/dist/components/BottomSheet/index.mjs +2 -0
  69. package/dist/components/BottomSheet/index.mjs.map +1 -0
  70. package/dist/components/BottomSheetDialog/BottomSheetDialog.cjs +207 -0
  71. package/dist/components/BottomSheetDialog/BottomSheetDialog.cjs.map +1 -0
  72. package/dist/components/BottomSheetDialog/BottomSheetDialog.constants.cjs +18 -0
  73. package/dist/components/BottomSheetDialog/BottomSheetDialog.constants.cjs.map +1 -0
  74. package/dist/components/BottomSheetDialog/BottomSheetDialog.constants.d.cts +14 -0
  75. package/dist/components/BottomSheetDialog/BottomSheetDialog.constants.d.cts.map +1 -0
  76. package/dist/components/BottomSheetDialog/BottomSheetDialog.constants.d.mts +14 -0
  77. package/dist/components/BottomSheetDialog/BottomSheetDialog.constants.d.mts.map +1 -0
  78. package/dist/components/BottomSheetDialog/BottomSheetDialog.constants.mjs +15 -0
  79. package/dist/components/BottomSheetDialog/BottomSheetDialog.constants.mjs.map +1 -0
  80. package/dist/components/BottomSheetDialog/BottomSheetDialog.d.cts +13 -0
  81. package/dist/components/BottomSheetDialog/BottomSheetDialog.d.cts.map +1 -0
  82. package/dist/components/BottomSheetDialog/BottomSheetDialog.d.mts +13 -0
  83. package/dist/components/BottomSheetDialog/BottomSheetDialog.d.mts.map +1 -0
  84. package/dist/components/BottomSheetDialog/BottomSheetDialog.mjs +190 -0
  85. package/dist/components/BottomSheetDialog/BottomSheetDialog.mjs.map +1 -0
  86. package/dist/components/BottomSheetDialog/BottomSheetDialog.types.cjs +3 -0
  87. package/dist/components/BottomSheetDialog/BottomSheetDialog.types.cjs.map +1 -0
  88. package/dist/components/BottomSheetDialog/BottomSheetDialog.types.d.cts +56 -0
  89. package/dist/components/BottomSheetDialog/BottomSheetDialog.types.d.cts.map +1 -0
  90. package/dist/components/BottomSheetDialog/BottomSheetDialog.types.d.mts +56 -0
  91. package/dist/components/BottomSheetDialog/BottomSheetDialog.types.d.mts.map +1 -0
  92. package/dist/components/BottomSheetDialog/BottomSheetDialog.types.mjs +2 -0
  93. package/dist/components/BottomSheetDialog/BottomSheetDialog.types.mjs.map +1 -0
  94. package/dist/components/BottomSheetDialog/index.cjs +9 -0
  95. package/dist/components/BottomSheetDialog/index.cjs.map +1 -0
  96. package/dist/components/BottomSheetDialog/index.d.cts +3 -0
  97. package/dist/components/BottomSheetDialog/index.d.cts.map +1 -0
  98. package/dist/components/BottomSheetDialog/index.d.mts +3 -0
  99. package/dist/components/BottomSheetDialog/index.d.mts.map +1 -0
  100. package/dist/components/BottomSheetDialog/index.mjs +2 -0
  101. package/dist/components/BottomSheetDialog/index.mjs.map +1 -0
  102. package/dist/components/ButtonBase/ButtonBase.cjs +4 -11
  103. package/dist/components/ButtonBase/ButtonBase.cjs.map +1 -1
  104. package/dist/components/ButtonBase/ButtonBase.d.cts +1 -1
  105. package/dist/components/ButtonBase/ButtonBase.d.cts.map +1 -1
  106. package/dist/components/ButtonBase/ButtonBase.d.mts +1 -1
  107. package/dist/components/ButtonBase/ButtonBase.d.mts.map +1 -1
  108. package/dist/components/ButtonBase/ButtonBase.mjs +5 -12
  109. package/dist/components/ButtonBase/ButtonBase.mjs.map +1 -1
  110. package/dist/components/ButtonBase/ButtonBase.types.cjs.map +1 -1
  111. package/dist/components/ButtonBase/ButtonBase.types.d.cts +7 -0
  112. package/dist/components/ButtonBase/ButtonBase.types.d.cts.map +1 -1
  113. package/dist/components/ButtonBase/ButtonBase.types.d.mts +7 -0
  114. package/dist/components/ButtonBase/ButtonBase.types.d.mts.map +1 -1
  115. package/dist/components/ButtonBase/ButtonBase.types.mjs.map +1 -1
  116. package/dist/components/ButtonFilter/ButtonFilter.cjs +28 -0
  117. package/dist/components/ButtonFilter/ButtonFilter.cjs.map +1 -0
  118. package/dist/components/ButtonFilter/ButtonFilter.d.cts +4 -0
  119. package/dist/components/ButtonFilter/ButtonFilter.d.cts.map +1 -0
  120. package/dist/components/ButtonFilter/ButtonFilter.d.mts +4 -0
  121. package/dist/components/ButtonFilter/ButtonFilter.d.mts.map +1 -0
  122. package/dist/components/ButtonFilter/ButtonFilter.mjs +28 -0
  123. package/dist/components/ButtonFilter/ButtonFilter.mjs.map +1 -0
  124. package/dist/components/ButtonFilter/ButtonFilter.types.cjs +3 -0
  125. package/dist/components/ButtonFilter/ButtonFilter.types.cjs.map +1 -0
  126. package/dist/components/ButtonFilter/ButtonFilter.types.d.cts +9 -0
  127. package/dist/components/ButtonFilter/ButtonFilter.types.d.cts.map +1 -0
  128. package/dist/components/ButtonFilter/ButtonFilter.types.d.mts +9 -0
  129. package/dist/components/ButtonFilter/ButtonFilter.types.d.mts.map +1 -0
  130. package/dist/components/ButtonFilter/ButtonFilter.types.mjs +2 -0
  131. package/dist/components/ButtonFilter/ButtonFilter.types.mjs.map +1 -0
  132. package/dist/components/ButtonFilter/index.cjs +6 -0
  133. package/dist/components/ButtonFilter/index.cjs.map +1 -0
  134. package/dist/components/ButtonFilter/index.d.cts +3 -0
  135. package/dist/components/ButtonFilter/index.d.cts.map +1 -0
  136. package/dist/components/ButtonFilter/index.d.mts +3 -0
  137. package/dist/components/ButtonFilter/index.d.mts.map +1 -0
  138. package/dist/components/ButtonFilter/index.mjs +2 -0
  139. package/dist/components/ButtonFilter/index.mjs.map +1 -0
  140. package/dist/components/ButtonIcon/ButtonIcon.cjs +10 -4
  141. package/dist/components/ButtonIcon/ButtonIcon.cjs.map +1 -1
  142. package/dist/components/ButtonIcon/ButtonIcon.d.cts +1 -1
  143. package/dist/components/ButtonIcon/ButtonIcon.d.cts.map +1 -1
  144. package/dist/components/ButtonIcon/ButtonIcon.d.mts +1 -1
  145. package/dist/components/ButtonIcon/ButtonIcon.d.mts.map +1 -1
  146. package/dist/components/ButtonIcon/ButtonIcon.mjs +11 -5
  147. package/dist/components/ButtonIcon/ButtonIcon.mjs.map +1 -1
  148. package/dist/components/ButtonIcon/ButtonIcon.types.cjs.map +1 -1
  149. package/dist/components/ButtonIcon/ButtonIcon.types.d.cts +4 -11
  150. package/dist/components/ButtonIcon/ButtonIcon.types.d.cts.map +1 -1
  151. package/dist/components/ButtonIcon/ButtonIcon.types.d.mts +4 -11
  152. package/dist/components/ButtonIcon/ButtonIcon.types.d.mts.map +1 -1
  153. package/dist/components/ButtonIcon/ButtonIcon.types.mjs.map +1 -1
  154. package/dist/components/ButtonIcon/index.cjs +2 -1
  155. package/dist/components/ButtonIcon/index.cjs.map +1 -1
  156. package/dist/components/ButtonIcon/index.d.cts +1 -1
  157. package/dist/components/ButtonIcon/index.d.cts.map +1 -1
  158. package/dist/components/ButtonIcon/index.d.mts +1 -1
  159. package/dist/components/ButtonIcon/index.d.mts.map +1 -1
  160. package/dist/components/ButtonIcon/index.mjs +1 -1
  161. package/dist/components/ButtonIcon/index.mjs.map +1 -1
  162. package/dist/components/Icon/assets/ai.svg +1 -1
  163. package/dist/components/Input/Input.cjs +12 -2
  164. package/dist/components/Input/Input.cjs.map +1 -1
  165. package/dist/components/Input/Input.d.cts +2 -1
  166. package/dist/components/Input/Input.d.cts.map +1 -1
  167. package/dist/components/Input/Input.d.mts +2 -1
  168. package/dist/components/Input/Input.d.mts.map +1 -1
  169. package/dist/components/Input/Input.mjs +12 -2
  170. package/dist/components/Input/Input.mjs.map +1 -1
  171. package/dist/components/Input/Input.types.cjs.map +1 -1
  172. package/dist/components/Input/Input.types.d.cts +5 -1
  173. package/dist/components/Input/Input.types.d.cts.map +1 -1
  174. package/dist/components/Input/Input.types.d.mts +5 -1
  175. package/dist/components/Input/Input.types.d.mts.map +1 -1
  176. package/dist/components/Input/Input.types.mjs.map +1 -1
  177. package/dist/components/KeyValueRow/KeyValueLabel/KeyValueLabel.cjs +33 -0
  178. package/dist/components/KeyValueRow/KeyValueLabel/KeyValueLabel.cjs.map +1 -0
  179. package/dist/components/KeyValueRow/KeyValueLabel/KeyValueLabel.d.cts +14 -0
  180. package/dist/components/KeyValueRow/KeyValueLabel/KeyValueLabel.d.cts.map +1 -0
  181. package/dist/components/KeyValueRow/KeyValueLabel/KeyValueLabel.d.mts +14 -0
  182. package/dist/components/KeyValueRow/KeyValueLabel/KeyValueLabel.d.mts.map +1 -0
  183. package/dist/components/KeyValueRow/KeyValueLabel/KeyValueLabel.mjs +35 -0
  184. package/dist/components/KeyValueRow/KeyValueLabel/KeyValueLabel.mjs.map +1 -0
  185. package/dist/components/KeyValueRow/KeyValueRoot/KeyValueRoot.cjs +39 -0
  186. package/dist/components/KeyValueRow/KeyValueRoot/KeyValueRoot.cjs.map +1 -0
  187. package/dist/components/KeyValueRow/KeyValueRoot/KeyValueRoot.d.cts +25 -0
  188. package/dist/components/KeyValueRow/KeyValueRoot/KeyValueRoot.d.cts.map +1 -0
  189. package/dist/components/KeyValueRow/KeyValueRoot/KeyValueRoot.d.mts +25 -0
  190. package/dist/components/KeyValueRow/KeyValueRoot/KeyValueRoot.d.mts.map +1 -0
  191. package/dist/components/KeyValueRow/KeyValueRoot/KeyValueRoot.mjs +41 -0
  192. package/dist/components/KeyValueRow/KeyValueRoot/KeyValueRoot.mjs.map +1 -0
  193. package/dist/components/KeyValueRow/KeyValueRow.cjs +76 -0
  194. package/dist/components/KeyValueRow/KeyValueRow.cjs.map +1 -0
  195. package/dist/components/KeyValueRow/KeyValueRow.d.cts +25 -0
  196. package/dist/components/KeyValueRow/KeyValueRow.d.cts.map +1 -0
  197. package/dist/components/KeyValueRow/KeyValueRow.d.mts +25 -0
  198. package/dist/components/KeyValueRow/KeyValueRow.d.mts.map +1 -0
  199. package/dist/components/KeyValueRow/KeyValueRow.mjs +77 -0
  200. package/dist/components/KeyValueRow/KeyValueRow.mjs.map +1 -0
  201. package/dist/components/KeyValueRow/KeyValueRow.types.cjs +29 -0
  202. package/dist/components/KeyValueRow/KeyValueRow.types.cjs.map +1 -0
  203. package/dist/components/KeyValueRow/KeyValueRow.types.d.cts +177 -0
  204. package/dist/components/KeyValueRow/KeyValueRow.types.d.cts.map +1 -0
  205. package/dist/components/KeyValueRow/KeyValueRow.types.d.mts +177 -0
  206. package/dist/components/KeyValueRow/KeyValueRow.types.d.mts.map +1 -0
  207. package/dist/components/KeyValueRow/KeyValueRow.types.mjs +26 -0
  208. package/dist/components/KeyValueRow/KeyValueRow.types.mjs.map +1 -0
  209. package/dist/components/KeyValueRow/KeyValueRow.utils.cjs +6 -0
  210. package/dist/components/KeyValueRow/KeyValueRow.utils.cjs.map +1 -0
  211. package/dist/components/KeyValueRow/KeyValueRow.utils.d.cts +3 -0
  212. package/dist/components/KeyValueRow/KeyValueRow.utils.d.cts.map +1 -0
  213. package/dist/components/KeyValueRow/KeyValueRow.utils.d.mts +3 -0
  214. package/dist/components/KeyValueRow/KeyValueRow.utils.d.mts.map +1 -0
  215. package/dist/components/KeyValueRow/KeyValueRow.utils.mjs +2 -0
  216. package/dist/components/KeyValueRow/KeyValueRow.utils.mjs.map +1 -0
  217. package/dist/components/KeyValueRow/KeyValueSection/KeyValueSection.cjs +29 -0
  218. package/dist/components/KeyValueRow/KeyValueSection/KeyValueSection.cjs.map +1 -0
  219. package/dist/components/KeyValueRow/KeyValueSection/KeyValueSection.d.cts +17 -0
  220. package/dist/components/KeyValueRow/KeyValueSection/KeyValueSection.d.cts.map +1 -0
  221. package/dist/components/KeyValueRow/KeyValueSection/KeyValueSection.d.mts +17 -0
  222. package/dist/components/KeyValueRow/KeyValueSection/KeyValueSection.d.mts.map +1 -0
  223. package/dist/components/KeyValueRow/KeyValueSection/KeyValueSection.mjs +31 -0
  224. package/dist/components/KeyValueRow/KeyValueSection/KeyValueSection.mjs.map +1 -0
  225. package/dist/components/KeyValueRow/index.cjs +15 -0
  226. package/dist/components/KeyValueRow/index.cjs.map +1 -0
  227. package/dist/components/KeyValueRow/index.d.cts +3 -0
  228. package/dist/components/KeyValueRow/index.d.cts.map +1 -0
  229. package/dist/components/KeyValueRow/index.d.mts +3 -0
  230. package/dist/components/KeyValueRow/index.d.mts.map +1 -0
  231. package/dist/components/KeyValueRow/index.mjs +3 -0
  232. package/dist/components/KeyValueRow/index.mjs.map +1 -0
  233. package/dist/components/ListItem/ListItem.cjs +61 -0
  234. package/dist/components/ListItem/ListItem.cjs.map +1 -0
  235. package/dist/components/ListItem/ListItem.constants.cjs +14 -0
  236. package/dist/components/ListItem/ListItem.constants.cjs.map +1 -0
  237. package/dist/components/ListItem/ListItem.constants.d.cts +8 -0
  238. package/dist/components/ListItem/ListItem.constants.d.cts.map +1 -0
  239. package/dist/components/ListItem/ListItem.constants.d.mts +8 -0
  240. package/dist/components/ListItem/ListItem.constants.d.mts.map +1 -0
  241. package/dist/components/ListItem/ListItem.constants.mjs +11 -0
  242. package/dist/components/ListItem/ListItem.constants.mjs.map +1 -0
  243. package/dist/components/ListItem/ListItem.d.cts +4 -0
  244. package/dist/components/ListItem/ListItem.d.cts.map +1 -0
  245. package/dist/components/ListItem/ListItem.d.mts +4 -0
  246. package/dist/components/ListItem/ListItem.d.mts.map +1 -0
  247. package/dist/components/ListItem/ListItem.mjs +41 -0
  248. package/dist/components/ListItem/ListItem.mjs.map +1 -0
  249. package/dist/components/ListItem/ListItem.types.cjs +12 -0
  250. package/dist/components/ListItem/ListItem.types.cjs.map +1 -0
  251. package/dist/components/ListItem/ListItem.types.d.cts +60 -0
  252. package/dist/components/ListItem/ListItem.types.d.cts.map +1 -0
  253. package/dist/components/ListItem/ListItem.types.d.mts +60 -0
  254. package/dist/components/ListItem/ListItem.types.d.mts.map +1 -0
  255. package/dist/components/ListItem/ListItem.types.mjs +9 -0
  256. package/dist/components/ListItem/ListItem.types.mjs.map +1 -0
  257. package/dist/components/ListItem/index.cjs +8 -0
  258. package/dist/components/ListItem/index.cjs.map +1 -0
  259. package/dist/components/ListItem/index.d.cts +4 -0
  260. package/dist/components/ListItem/index.d.cts.map +1 -0
  261. package/dist/components/ListItem/index.d.mts +4 -0
  262. package/dist/components/ListItem/index.d.mts.map +1 -0
  263. package/dist/components/ListItem/index.mjs +3 -0
  264. package/dist/components/ListItem/index.mjs.map +1 -0
  265. package/dist/components/MainActionButton/MainActionButton.cjs +28 -0
  266. package/dist/components/MainActionButton/MainActionButton.cjs.map +1 -0
  267. package/dist/components/MainActionButton/MainActionButton.d.cts +4 -0
  268. package/dist/components/MainActionButton/MainActionButton.d.cts.map +1 -0
  269. package/dist/components/MainActionButton/MainActionButton.d.mts +4 -0
  270. package/dist/components/MainActionButton/MainActionButton.d.mts.map +1 -0
  271. package/dist/components/MainActionButton/MainActionButton.mjs +28 -0
  272. package/dist/components/MainActionButton/MainActionButton.mjs.map +1 -0
  273. package/dist/components/MainActionButton/MainActionButton.types.cjs +3 -0
  274. package/dist/components/MainActionButton/MainActionButton.types.cjs.map +1 -0
  275. package/dist/components/MainActionButton/MainActionButton.types.d.cts +41 -0
  276. package/dist/components/MainActionButton/MainActionButton.types.d.cts.map +1 -0
  277. package/dist/components/MainActionButton/MainActionButton.types.d.mts +41 -0
  278. package/dist/components/MainActionButton/MainActionButton.types.d.mts.map +1 -0
  279. package/dist/components/MainActionButton/MainActionButton.types.mjs +2 -0
  280. package/dist/components/MainActionButton/MainActionButton.types.mjs.map +1 -0
  281. package/dist/components/MainActionButton/index.cjs +6 -0
  282. package/dist/components/MainActionButton/index.cjs.map +1 -0
  283. package/dist/components/MainActionButton/index.d.cts +3 -0
  284. package/dist/components/MainActionButton/index.d.cts.map +1 -0
  285. package/dist/components/MainActionButton/index.d.mts +3 -0
  286. package/dist/components/MainActionButton/index.d.mts.map +1 -0
  287. package/dist/components/MainActionButton/index.mjs +2 -0
  288. package/dist/components/MainActionButton/index.mjs.map +1 -0
  289. package/dist/components/TabEmptyState/TabEmptyState.cjs +22 -0
  290. package/dist/components/TabEmptyState/TabEmptyState.cjs.map +1 -0
  291. package/dist/components/TabEmptyState/TabEmptyState.d.cts +4 -0
  292. package/dist/components/TabEmptyState/TabEmptyState.d.cts.map +1 -0
  293. package/dist/components/TabEmptyState/TabEmptyState.d.mts +4 -0
  294. package/dist/components/TabEmptyState/TabEmptyState.d.mts.map +1 -0
  295. package/dist/components/TabEmptyState/TabEmptyState.mjs +22 -0
  296. package/dist/components/TabEmptyState/TabEmptyState.mjs.map +1 -0
  297. package/dist/components/TabEmptyState/TabEmptyState.types.cjs +3 -0
  298. package/dist/components/TabEmptyState/TabEmptyState.types.cjs.map +1 -0
  299. package/dist/components/TabEmptyState/TabEmptyState.types.d.cts +45 -0
  300. package/dist/components/TabEmptyState/TabEmptyState.types.d.cts.map +1 -0
  301. package/dist/components/TabEmptyState/TabEmptyState.types.d.mts +45 -0
  302. package/dist/components/TabEmptyState/TabEmptyState.types.d.mts.map +1 -0
  303. package/dist/components/TabEmptyState/TabEmptyState.types.mjs +2 -0
  304. package/dist/components/TabEmptyState/TabEmptyState.types.mjs.map +1 -0
  305. package/dist/components/TabEmptyState/index.cjs +6 -0
  306. package/dist/components/TabEmptyState/index.cjs.map +1 -0
  307. package/dist/components/TabEmptyState/index.d.cts +3 -0
  308. package/dist/components/TabEmptyState/index.d.cts.map +1 -0
  309. package/dist/components/TabEmptyState/index.d.mts +3 -0
  310. package/dist/components/TabEmptyState/index.d.mts.map +1 -0
  311. package/dist/components/TabEmptyState/index.mjs +2 -0
  312. package/dist/components/TabEmptyState/index.mjs.map +1 -0
  313. package/dist/components/Toast/Toast.cjs +3 -2
  314. package/dist/components/Toast/Toast.cjs.map +1 -1
  315. package/dist/components/Toast/Toast.d.cts.map +1 -1
  316. package/dist/components/Toast/Toast.d.mts.map +1 -1
  317. package/dist/components/Toast/Toast.mjs +4 -3
  318. package/dist/components/Toast/Toast.mjs.map +1 -1
  319. package/dist/components/Toast/Toast.types.cjs +5 -5
  320. package/dist/components/Toast/Toast.types.cjs.map +1 -1
  321. package/dist/components/Toast/Toast.types.d.cts +5 -4
  322. package/dist/components/Toast/Toast.types.d.cts.map +1 -1
  323. package/dist/components/Toast/Toast.types.d.mts +5 -4
  324. package/dist/components/Toast/Toast.types.d.mts.map +1 -1
  325. package/dist/components/Toast/Toast.types.mjs +4 -4
  326. package/dist/components/Toast/Toast.types.mjs.map +1 -1
  327. package/dist/components/Toast/index.cjs +2 -2
  328. package/dist/components/Toast/index.cjs.map +1 -1
  329. package/dist/components/Toast/index.d.cts +1 -1
  330. package/dist/components/Toast/index.d.cts.map +1 -1
  331. package/dist/components/Toast/index.d.mts +1 -1
  332. package/dist/components/Toast/index.d.mts.map +1 -1
  333. package/dist/components/Toast/index.mjs +1 -1
  334. package/dist/components/Toast/index.mjs.map +1 -1
  335. package/dist/components/index.cjs +31 -2
  336. package/dist/components/index.cjs.map +1 -1
  337. package/dist/components/index.d.cts +25 -5
  338. package/dist/components/index.d.cts.map +1 -1
  339. package/dist/components/index.d.mts +25 -5
  340. package/dist/components/index.d.mts.map +1 -1
  341. package/dist/components/index.mjs +12 -2
  342. package/dist/components/index.mjs.map +1 -1
  343. package/dist/components/temp-components/ButtonAnimated/ButtonAnimated.cjs +5 -1
  344. package/dist/components/temp-components/ButtonAnimated/ButtonAnimated.cjs.map +1 -1
  345. package/dist/components/temp-components/ButtonAnimated/ButtonAnimated.d.cts +1 -1
  346. package/dist/components/temp-components/ButtonAnimated/ButtonAnimated.d.cts.map +1 -1
  347. package/dist/components/temp-components/ButtonAnimated/ButtonAnimated.d.mts +1 -1
  348. package/dist/components/temp-components/ButtonAnimated/ButtonAnimated.d.mts.map +1 -1
  349. package/dist/components/temp-components/ButtonAnimated/ButtonAnimated.mjs +5 -1
  350. package/dist/components/temp-components/ButtonAnimated/ButtonAnimated.mjs.map +1 -1
  351. package/dist/components/temp-components/ButtonAnimated/ButtonAnimated.types.cjs.map +1 -1
  352. package/dist/components/temp-components/ButtonAnimated/ButtonAnimated.types.d.cts +14 -1
  353. package/dist/components/temp-components/ButtonAnimated/ButtonAnimated.types.d.cts.map +1 -1
  354. package/dist/components/temp-components/ButtonAnimated/ButtonAnimated.types.d.mts +14 -1
  355. package/dist/components/temp-components/ButtonAnimated/ButtonAnimated.types.d.mts.map +1 -1
  356. package/dist/components/temp-components/ButtonAnimated/ButtonAnimated.types.mjs.map +1 -1
  357. package/dist/components/temp-components/ButtonAnimated/index.cjs.map +1 -1
  358. package/dist/components/temp-components/ButtonAnimated/index.d.cts +1 -1
  359. package/dist/components/temp-components/ButtonAnimated/index.d.cts.map +1 -1
  360. package/dist/components/temp-components/ButtonAnimated/index.d.mts +1 -1
  361. package/dist/components/temp-components/ButtonAnimated/index.d.mts.map +1 -1
  362. package/dist/components/temp-components/ButtonAnimated/index.mjs.map +1 -1
  363. package/dist/types/index.cjs +10 -1
  364. package/dist/types/index.cjs.map +1 -1
  365. package/dist/types/index.d.cts +8 -0
  366. package/dist/types/index.d.cts.map +1 -1
  367. package/dist/types/index.d.mts +8 -0
  368. package/dist/types/index.d.mts.map +1 -1
  369. package/dist/types/index.mjs +9 -0
  370. package/dist/types/index.mjs.map +1 -1
  371. package/package.json +8 -4
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BottomSheetDialog.cjs","sourceRoot":"","sources":["../../../src/components/BottomSheetDialog/BottomSheetDialog.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,8FAIuD;AACvD,oEAAyE;AACzE,mCAAkC;AAClC,+CAOe;AACf,wDAKsB;AACtB,+EAGsC;AACtC,4CAA4C;AAC5C,mFAMiC;AACjC,mFAGwC;AAExC,yBAAyB;AACzB,mFAIuC;AAMvC,MAAM,iBAAiB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AC5B,KAAK,CAAC,CAAC,kBAAkB,CAAC,CAE1B;YAAA,CAAC,cAAc,IAAI,CACjB,CAAC,mBAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,+BAA+B,CAAC,CAAC,CACrD;gBAAA,CAAC,mBAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,qCAAqC,CAAC,CAAC,EAC/D;cAAA,EAAE,mBAAI,CAAC,CACR,CACD;YAAA,CAAC,QAAQ,CACX;UAAA,EAAE,iCAAQ,CAAC,IAAI,CACjB;QAAA,EAAE,gDAAiB,CACrB;MAAA,EAAE,mCAAoB,CAAC,CACxB,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,kBAAe,iBAAiB,CAAC","sourcesContent":["import {\n Theme,\n useTailwind,\n useTheme,\n} from '@metamask-previews/design-system-twrnc-preset';\nimport { lightTheme, darkTheme } from '@metamask-previews/design-tokens';\nimport { debounce } from 'lodash';\nimport React, {\n forwardRef,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useImperativeHandle,\n} from 'react';\nimport {\n LayoutChangeEvent,\n View,\n Platform,\n KeyboardAvoidingView,\n} from 'react-native';\nimport {\n PanGestureHandler,\n PanGestureHandlerGestureEvent,\n} from 'react-native-gesture-handler';\n// eslint-disable-next-line import-x/default\nimport Animated, {\n runOnJS,\n useAnimatedGestureHandler,\n useAnimatedStyle,\n useSharedValue,\n withTiming,\n} from 'react-native-reanimated';\nimport {\n useSafeAreaFrame,\n useSafeAreaInsets,\n} from 'react-native-safe-area-context';\n\n// Internal dependencies.\nimport {\n DEFAULT_BOTTOMSHEETDIALOG_DISPLAY_DURATION,\n DEFAULT_BOTTOMSHEETDIALOG_DISMISSTHRESHOLD,\n DEFAULT_BOTTOMSHEETDIALOG_SWIPETHRESHOLD_DURATION,\n} from './BottomSheetDialog.constants';\nimport type {\n BottomSheetDialogRef,\n BottomSheetDialogProps,\n} from './BottomSheetDialog.types';\n\nconst BottomSheetDialog = forwardRef<\n BottomSheetDialogRef,\n BottomSheetDialogProps\n>(\n (\n {\n children,\n isFullscreen = false,\n isInteractable = true,\n keyboardAvoidingViewEnabled = true,\n onClose,\n onOpen,\n style,\n twClassName,\n ...props\n },\n ref,\n ) => {\n const tw = useTailwind();\n const currentTheme = useTheme();\n const shadowLg =\n currentTheme === Theme.Light\n ? lightTheme.shadows.size.lg\n : darkTheme.shadows.size.lg;\n\n const { top: screenTopPadding, bottom: screenBottomPadding } =\n useSafeAreaInsets();\n const { y: frameY, height: screenHeight } = useSafeAreaFrame();\n\n const maxSheetHeight = screenHeight - screenTopPadding;\n // X and Y values start on top left of the DIALOG\n // currentYOffset will be used to animate the Y position of the Dialog\n const currentYOffset = useSharedValue(screenHeight);\n const topOfDialogYValue = useSharedValue(0);\n const bottomOfDialogYValue = useSharedValue(screenHeight);\n const isMounted = useRef(false);\n\n const onOpenCB = useCallback(() => {\n onOpen?.();\n }, [onOpen]);\n const onCloseCB = useCallback(() => {\n onClose?.();\n }, [onClose]);\n\n const onCloseDialog = useCallback(\n (callback?: () => void) => {\n currentYOffset.value = withTiming(\n bottomOfDialogYValue.value,\n { duration: DEFAULT_BOTTOMSHEETDIALOG_DISPLAY_DURATION },\n () => {\n runOnJS(onCloseCB)();\n if (callback) {\n runOnJS(callback)();\n }\n },\n );\n // Ref values do not affect deps.\n },\n [onCloseCB],\n );\n\n const gestureHandler = useAnimatedGestureHandler<\n PanGestureHandlerGestureEvent,\n { startY: number }\n >({\n onStart: (_, ctx) => {\n // Starts tracking vertical position of gesture\n ctx.startY = currentYOffset.value;\n },\n onActive: (event, ctx) => {\n const { translationY } = event;\n currentYOffset.value = ctx.startY + translationY;\n // If gesture Y value goes above the bottom of Dialog Y value(bottom of dialog),\n // which means the gesture is currently below the bottom of the dialog,\n // sets it to bottom of Dialog Y value\n if (currentYOffset.value >= bottomOfDialogYValue.value) {\n currentYOffset.value = bottomOfDialogYValue.value;\n }\n // If gesture Y value goes below the top of Dialog Y value(top of dialog),\n // which means the gesture is currently above the top of the dialog,\n // sets it to top of Dialog Y value\n if (currentYOffset.value <= topOfDialogYValue.value) {\n currentYOffset.value = topOfDialogYValue.value;\n }\n },\n onEnd: (event, ctx) => {\n const { translationY, velocityY } = event;\n // finalYOffset is used to animate the Y position of the Dialog after the gesture event\n let finalYOffset: number;\n // Measuring dismissing swipe action\n const latestOffset = ctx.startY + translationY;\n // Check if the swipe distance reach the dismiss offset threshold,\n // which is currently 60% of sheet height\n const hasReachedDismissOffset =\n latestOffset >\n bottomOfDialogYValue.value *\n DEFAULT_BOTTOMSHEETDIALOG_DISMISSTHRESHOLD;\n // Check if the gesture's vertical speed has reached the threshold to determine a swipe action\n const hasReachedSwipeThreshold =\n Math.abs(velocityY) >\n DEFAULT_BOTTOMSHEETDIALOG_SWIPETHRESHOLD_DURATION;\n const isQuickDismissing = velocityY > 0;\n\n // If user is swiping\n if (hasReachedSwipeThreshold) {\n // Quick swipe takes priority\n if (isQuickDismissing) {\n finalYOffset = bottomOfDialogYValue.value;\n } else {\n finalYOffset = topOfDialogYValue.value;\n }\n } else if (hasReachedDismissOffset) {\n finalYOffset = bottomOfDialogYValue.value;\n } else {\n finalYOffset = topOfDialogYValue.value;\n }\n\n const isDismissed = finalYOffset === bottomOfDialogYValue.value;\n\n if (isDismissed) {\n runOnJS(onCloseDialog)();\n } else {\n // Only animate dialog to a certain Y position instead\n currentYOffset.value = withTiming(finalYOffset, {\n duration: DEFAULT_BOTTOMSHEETDIALOG_DISPLAY_DURATION,\n });\n }\n },\n });\n\n // Animate in sheet on initial render.\n const onOpenDialog = (callback?: () => void) => {\n // Starts setting the Y position of the dialog to the bottom of the dialog\n currentYOffset.value = bottomOfDialogYValue.value;\n // Animate the Y position to the top of the dialog, then call onOpenCB\n currentYOffset.value = withTiming(\n topOfDialogYValue.value,\n {\n duration: DEFAULT_BOTTOMSHEETDIALOG_DISPLAY_DURATION,\n },\n () => {\n runOnJS(onOpenCB)();\n if (callback) {\n runOnJS(callback)();\n }\n },\n );\n };\n\n const onDebouncedCloseDialog = useMemo(\n // Prevent hide from being called multiple times. Potentially caused by taps in quick succession.\n () => debounce(onCloseDialog, 2000, { leading: true }),\n [onCloseDialog],\n );\n\n useEffect(\n () =>\n // Automatically handles animation when content changes\n // Disable for now since network switches causes the screen to hang with this on.\n // LayoutAnimation.configureNext(LayoutAnimation.Presets.easeInEaseOut);\n onDebouncedCloseDialog.cancel(),\n [children, onDebouncedCloseDialog],\n );\n\n const updateSheetHeight = (e: LayoutChangeEvent) => {\n const { height } = e.nativeEvent.layout;\n bottomOfDialogYValue.value = height;\n\n if (!isMounted.current) {\n isMounted.current = true;\n onOpenDialog();\n }\n };\n\n const animatedSheetStyle = useAnimatedStyle(() => ({\n transform: [\n {\n translateY: currentYOffset.value,\n },\n ],\n }));\n\n const sheetStyle = useMemo(\n () => [\n tw.style(\n 'bg-default rounded-t-3xl overflow-hidden border border-muted',\n twClassName,\n ),\n {\n maxHeight: maxSheetHeight,\n paddingBottom: Platform.select({\n ios: screenBottomPadding,\n macos: screenBottomPadding,\n default: screenBottomPadding + 16,\n }),\n ...(isFullscreen && { height: maxSheetHeight }),\n ...shadowLg,\n },\n style,\n ],\n\n [\n tw,\n maxSheetHeight,\n screenBottomPadding,\n isFullscreen,\n shadowLg,\n style,\n twClassName,\n ],\n );\n\n const combinedSheetStyle = useMemo(\n () => [...sheetStyle, animatedSheetStyle],\n\n [sheetStyle],\n );\n\n useImperativeHandle(ref, () => ({\n onOpenDialog,\n onCloseDialog,\n }));\n\n return (\n <KeyboardAvoidingView\n style={tw.style('absolute bottom-0 inset-x-0')}\n behavior={Platform.OS === 'ios' ? 'padding' : undefined}\n keyboardVerticalOffset={\n Platform.OS === 'ios' ? -screenBottomPadding : frameY\n }\n enabled={keyboardAvoidingViewEnabled}\n {...props}\n >\n <PanGestureHandler\n enabled={isInteractable}\n onGestureEvent={gestureHandler}\n >\n <Animated.View\n onLayout={updateSheetHeight}\n style={combinedSheetStyle}\n >\n {isInteractable && (\n <View style={tw.style('self-stretch items-center p-1')}>\n <View style={tw.style('h-1 w-10 rounded-sm bg-border-muted')} />\n </View>\n )}\n {children}\n </Animated.View>\n </PanGestureHandler>\n </KeyboardAvoidingView>\n );\n },\n);\n\nexport default BottomSheetDialog;\n"]}
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DEFAULT_BOTTOMSHEETDIALOG_DISMISSTHRESHOLD = exports.DEFAULT_BOTTOMSHEETDIALOG_SWIPETHRESHOLD_DURATION = exports.DEFAULT_BOTTOMSHEETDIALOG_DISPLAY_DURATION = void 0;
4
+ const design_tokens_1 = require("@metamask-previews/design-tokens");
5
+ // Defaults
6
+ /**
7
+ * The animation duration used for initial render.
8
+ */
9
+ exports.DEFAULT_BOTTOMSHEETDIALOG_DISPLAY_DURATION = design_tokens_1.AnimationDuration.Fast;
10
+ /**
11
+ * This number represents the swipe speed to meet the velocity threshold.
12
+ */
13
+ exports.DEFAULT_BOTTOMSHEETDIALOG_SWIPETHRESHOLD_DURATION = design_tokens_1.AnimationDuration.Regularly;
14
+ /**
15
+ * This indicates that 60% of the sheet needs to be offscreen to meet the distance threshold.
16
+ */
17
+ exports.DEFAULT_BOTTOMSHEETDIALOG_DISMISSTHRESHOLD = 0.6;
18
+ //# sourceMappingURL=BottomSheetDialog.constants.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BottomSheetDialog.constants.cjs","sourceRoot":"","sources":["../../../src/components/BottomSheetDialog/BottomSheetDialog.constants.ts"],"names":[],"mappings":";;;AAAA,oEAAqE;AAErE,WAAW;AACX;;GAEG;AACU,QAAA,0CAA0C,GACrD,iCAAiB,CAAC,IAAI,CAAC;AACzB;;GAEG;AACU,QAAA,iDAAiD,GAC5D,iCAAiB,CAAC,SAAS,CAAC;AAC9B;;GAEG;AACU,QAAA,0CAA0C,GAAG,GAAG,CAAC","sourcesContent":["import { AnimationDuration } from '@metamask-previews/design-tokens';\n\n// Defaults\n/**\n * The animation duration used for initial render.\n */\nexport const DEFAULT_BOTTOMSHEETDIALOG_DISPLAY_DURATION =\n AnimationDuration.Fast;\n/**\n * This number represents the swipe speed to meet the velocity threshold.\n */\nexport const DEFAULT_BOTTOMSHEETDIALOG_SWIPETHRESHOLD_DURATION =\n AnimationDuration.Regularly;\n/**\n * This indicates that 60% of the sheet needs to be offscreen to meet the distance threshold.\n */\nexport const DEFAULT_BOTTOMSHEETDIALOG_DISMISSTHRESHOLD = 0.6;\n"]}
@@ -0,0 +1,14 @@
1
+ import { AnimationDuration } from "@metamask-previews/design-tokens";
2
+ /**
3
+ * The animation duration used for initial render.
4
+ */
5
+ export declare const DEFAULT_BOTTOMSHEETDIALOG_DISPLAY_DURATION = AnimationDuration.Fast;
6
+ /**
7
+ * This number represents the swipe speed to meet the velocity threshold.
8
+ */
9
+ export declare const DEFAULT_BOTTOMSHEETDIALOG_SWIPETHRESHOLD_DURATION = AnimationDuration.Regularly;
10
+ /**
11
+ * This indicates that 60% of the sheet needs to be offscreen to meet the distance threshold.
12
+ */
13
+ export declare const DEFAULT_BOTTOMSHEETDIALOG_DISMISSTHRESHOLD = 0.6;
14
+ //# sourceMappingURL=BottomSheetDialog.constants.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BottomSheetDialog.constants.d.cts","sourceRoot":"","sources":["../../../src/components/BottomSheetDialog/BottomSheetDialog.constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,yCAAyC;AAGrE;;GAEG;AACH,eAAO,MAAM,0CAA0C,yBAC/B,CAAC;AACzB;;GAEG;AACH,eAAO,MAAM,iDAAiD,8BACjC,CAAC;AAC9B;;GAEG;AACH,eAAO,MAAM,0CAA0C,MAAM,CAAC"}
@@ -0,0 +1,14 @@
1
+ import { AnimationDuration } from "@metamask-previews/design-tokens";
2
+ /**
3
+ * The animation duration used for initial render.
4
+ */
5
+ export declare const DEFAULT_BOTTOMSHEETDIALOG_DISPLAY_DURATION = AnimationDuration.Fast;
6
+ /**
7
+ * This number represents the swipe speed to meet the velocity threshold.
8
+ */
9
+ export declare const DEFAULT_BOTTOMSHEETDIALOG_SWIPETHRESHOLD_DURATION = AnimationDuration.Regularly;
10
+ /**
11
+ * This indicates that 60% of the sheet needs to be offscreen to meet the distance threshold.
12
+ */
13
+ export declare const DEFAULT_BOTTOMSHEETDIALOG_DISMISSTHRESHOLD = 0.6;
14
+ //# sourceMappingURL=BottomSheetDialog.constants.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BottomSheetDialog.constants.d.mts","sourceRoot":"","sources":["../../../src/components/BottomSheetDialog/BottomSheetDialog.constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,yCAAyC;AAGrE;;GAEG;AACH,eAAO,MAAM,0CAA0C,yBAC/B,CAAC;AACzB;;GAEG;AACH,eAAO,MAAM,iDAAiD,8BACjC,CAAC;AAC9B;;GAEG;AACH,eAAO,MAAM,0CAA0C,MAAM,CAAC"}
@@ -0,0 +1,15 @@
1
+ import { AnimationDuration } from "@metamask-previews/design-tokens";
2
+ // Defaults
3
+ /**
4
+ * The animation duration used for initial render.
5
+ */
6
+ export const DEFAULT_BOTTOMSHEETDIALOG_DISPLAY_DURATION = AnimationDuration.Fast;
7
+ /**
8
+ * This number represents the swipe speed to meet the velocity threshold.
9
+ */
10
+ export const DEFAULT_BOTTOMSHEETDIALOG_SWIPETHRESHOLD_DURATION = AnimationDuration.Regularly;
11
+ /**
12
+ * This indicates that 60% of the sheet needs to be offscreen to meet the distance threshold.
13
+ */
14
+ export const DEFAULT_BOTTOMSHEETDIALOG_DISMISSTHRESHOLD = 0.6;
15
+ //# sourceMappingURL=BottomSheetDialog.constants.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BottomSheetDialog.constants.mjs","sourceRoot":"","sources":["../../../src/components/BottomSheetDialog/BottomSheetDialog.constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,yCAAyC;AAErE,WAAW;AACX;;GAEG;AACH,MAAM,CAAC,MAAM,0CAA0C,GACrD,iBAAiB,CAAC,IAAI,CAAC;AACzB;;GAEG;AACH,MAAM,CAAC,MAAM,iDAAiD,GAC5D,iBAAiB,CAAC,SAAS,CAAC;AAC9B;;GAEG;AACH,MAAM,CAAC,MAAM,0CAA0C,GAAG,GAAG,CAAC","sourcesContent":["import { AnimationDuration } from '@metamask-previews/design-tokens';\n\n// Defaults\n/**\n * The animation duration used for initial render.\n */\nexport const DEFAULT_BOTTOMSHEETDIALOG_DISPLAY_DURATION =\n AnimationDuration.Fast;\n/**\n * This number represents the swipe speed to meet the velocity threshold.\n */\nexport const DEFAULT_BOTTOMSHEETDIALOG_SWIPETHRESHOLD_DURATION =\n AnimationDuration.Regularly;\n/**\n * This indicates that 60% of the sheet needs to be offscreen to meet the distance threshold.\n */\nexport const DEFAULT_BOTTOMSHEETDIALOG_DISMISSTHRESHOLD = 0.6;\n"]}
@@ -0,0 +1,13 @@
1
+ import React from "react";
2
+ import type { BottomSheetDialogRef } from "./BottomSheetDialog.types.cjs";
3
+ declare const BottomSheetDialog: React.ForwardRefExoticComponent<{
4
+ children?: React.ReactNode;
5
+ isFullscreen?: boolean | undefined;
6
+ isInteractable?: boolean | undefined;
7
+ keyboardAvoidingViewEnabled?: boolean | undefined;
8
+ onClose?: ((hasPendingAction?: boolean | undefined) => void) | undefined;
9
+ onOpen?: ((hasPendingAction?: boolean | undefined) => void) | undefined;
10
+ twClassName?: string | undefined;
11
+ } & import("react-native").ViewProps & React.RefAttributes<BottomSheetDialogRef>>;
12
+ export default BottomSheetDialog;
13
+ //# sourceMappingURL=BottomSheetDialog.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BottomSheetDialog.d.cts","sourceRoot":"","sources":["../../../src/components/BottomSheetDialog/BottomSheetDialog.tsx"],"names":[],"mappings":"AAOA,OAAO,KAON,cAAc;AA8Bf,OAAO,KAAK,EACV,oBAAoB,EAErB,sCAAkC;AAEnC,QAAA,MAAM,iBAAiB;;;;;;;;iFA4PtB,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
@@ -0,0 +1,13 @@
1
+ import React from "react";
2
+ import type { BottomSheetDialogRef } from "./BottomSheetDialog.types.mjs";
3
+ declare const BottomSheetDialog: React.ForwardRefExoticComponent<{
4
+ children?: React.ReactNode;
5
+ isFullscreen?: boolean | undefined;
6
+ isInteractable?: boolean | undefined;
7
+ keyboardAvoidingViewEnabled?: boolean | undefined;
8
+ onClose?: ((hasPendingAction?: boolean | undefined) => void) | undefined;
9
+ onOpen?: ((hasPendingAction?: boolean | undefined) => void) | undefined;
10
+ twClassName?: string | undefined;
11
+ } & import("react-native").ViewProps & React.RefAttributes<BottomSheetDialogRef>>;
12
+ export default BottomSheetDialog;
13
+ //# sourceMappingURL=BottomSheetDialog.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BottomSheetDialog.d.mts","sourceRoot":"","sources":["../../../src/components/BottomSheetDialog/BottomSheetDialog.tsx"],"names":[],"mappings":"AAOA,OAAO,KAON,cAAc;AA8Bf,OAAO,KAAK,EACV,oBAAoB,EAErB,sCAAkC;AAEnC,QAAA,MAAM,iBAAiB;;;;;;;;iFA4PtB,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
@@ -0,0 +1,190 @@
1
+ function $importDefault(module) {
2
+ if (module?.__esModule) {
3
+ return module.default;
4
+ }
5
+ return module;
6
+ }
7
+ import { Theme, useTailwind, useTheme } from "@metamask-previews/design-system-twrnc-preset";
8
+ import { lightTheme, darkTheme } from "@metamask-previews/design-tokens";
9
+ import $lodash from "lodash";
10
+ const { debounce } = $lodash;
11
+ import $React, { forwardRef, useCallback, useEffect, useMemo, useRef, useImperativeHandle } from "react";
12
+ const React = $importDefault($React);
13
+ import { View, Platform, KeyboardAvoidingView } from "react-native/index.js";
14
+ import { PanGestureHandler } from "react-native-gesture-handler";
15
+ // eslint-disable-next-line import-x/default
16
+ import Animated, { runOnJS, useAnimatedGestureHandler, useAnimatedStyle, useSharedValue, withTiming } from "react-native-reanimated";
17
+ import { useSafeAreaFrame, useSafeAreaInsets } from "react-native-safe-area-context";
18
+ // Internal dependencies.
19
+ import { DEFAULT_BOTTOMSHEETDIALOG_DISPLAY_DURATION, DEFAULT_BOTTOMSHEETDIALOG_DISMISSTHRESHOLD, DEFAULT_BOTTOMSHEETDIALOG_SWIPETHRESHOLD_DURATION } from "./BottomSheetDialog.constants.mjs";
20
+ const BottomSheetDialog = forwardRef(({ children, isFullscreen = false, isInteractable = true, keyboardAvoidingViewEnabled = true, onClose, onOpen, style, twClassName, ...props }, ref) => {
21
+ const tw = useTailwind();
22
+ const currentTheme = useTheme();
23
+ const shadowLg = currentTheme === Theme.Light
24
+ ? lightTheme.shadows.size.lg
25
+ : darkTheme.shadows.size.lg;
26
+ const { top: screenTopPadding, bottom: screenBottomPadding } = useSafeAreaInsets();
27
+ const { y: frameY, height: screenHeight } = useSafeAreaFrame();
28
+ const maxSheetHeight = screenHeight - screenTopPadding;
29
+ // X and Y values start on top left of the DIALOG
30
+ // currentYOffset will be used to animate the Y position of the Dialog
31
+ const currentYOffset = useSharedValue(screenHeight);
32
+ const topOfDialogYValue = useSharedValue(0);
33
+ const bottomOfDialogYValue = useSharedValue(screenHeight);
34
+ const isMounted = useRef(false);
35
+ const onOpenCB = useCallback(() => {
36
+ onOpen?.();
37
+ }, [onOpen]);
38
+ const onCloseCB = useCallback(() => {
39
+ onClose?.();
40
+ }, [onClose]);
41
+ const onCloseDialog = useCallback((callback) => {
42
+ currentYOffset.value = withTiming(bottomOfDialogYValue.value, { duration: DEFAULT_BOTTOMSHEETDIALOG_DISPLAY_DURATION }, () => {
43
+ runOnJS(onCloseCB)();
44
+ if (callback) {
45
+ runOnJS(callback)();
46
+ }
47
+ });
48
+ // Ref values do not affect deps.
49
+ }, [onCloseCB]);
50
+ const gestureHandler = useAnimatedGestureHandler({
51
+ onStart: (_, ctx) => {
52
+ // Starts tracking vertical position of gesture
53
+ ctx.startY = currentYOffset.value;
54
+ },
55
+ onActive: (event, ctx) => {
56
+ const { translationY } = event;
57
+ currentYOffset.value = ctx.startY + translationY;
58
+ // If gesture Y value goes above the bottom of Dialog Y value(bottom of dialog),
59
+ // which means the gesture is currently below the bottom of the dialog,
60
+ // sets it to bottom of Dialog Y value
61
+ if (currentYOffset.value >= bottomOfDialogYValue.value) {
62
+ currentYOffset.value = bottomOfDialogYValue.value;
63
+ }
64
+ // If gesture Y value goes below the top of Dialog Y value(top of dialog),
65
+ // which means the gesture is currently above the top of the dialog,
66
+ // sets it to top of Dialog Y value
67
+ if (currentYOffset.value <= topOfDialogYValue.value) {
68
+ currentYOffset.value = topOfDialogYValue.value;
69
+ }
70
+ },
71
+ onEnd: (event, ctx) => {
72
+ const { translationY, velocityY } = event;
73
+ // finalYOffset is used to animate the Y position of the Dialog after the gesture event
74
+ let finalYOffset;
75
+ // Measuring dismissing swipe action
76
+ const latestOffset = ctx.startY + translationY;
77
+ // Check if the swipe distance reach the dismiss offset threshold,
78
+ // which is currently 60% of sheet height
79
+ const hasReachedDismissOffset = latestOffset >
80
+ bottomOfDialogYValue.value *
81
+ DEFAULT_BOTTOMSHEETDIALOG_DISMISSTHRESHOLD;
82
+ // Check if the gesture's vertical speed has reached the threshold to determine a swipe action
83
+ const hasReachedSwipeThreshold = Math.abs(velocityY) >
84
+ DEFAULT_BOTTOMSHEETDIALOG_SWIPETHRESHOLD_DURATION;
85
+ const isQuickDismissing = velocityY > 0;
86
+ // If user is swiping
87
+ if (hasReachedSwipeThreshold) {
88
+ // Quick swipe takes priority
89
+ if (isQuickDismissing) {
90
+ finalYOffset = bottomOfDialogYValue.value;
91
+ }
92
+ else {
93
+ finalYOffset = topOfDialogYValue.value;
94
+ }
95
+ }
96
+ else if (hasReachedDismissOffset) {
97
+ finalYOffset = bottomOfDialogYValue.value;
98
+ }
99
+ else {
100
+ finalYOffset = topOfDialogYValue.value;
101
+ }
102
+ const isDismissed = finalYOffset === bottomOfDialogYValue.value;
103
+ if (isDismissed) {
104
+ runOnJS(onCloseDialog)();
105
+ }
106
+ else {
107
+ // Only animate dialog to a certain Y position instead
108
+ currentYOffset.value = withTiming(finalYOffset, {
109
+ duration: DEFAULT_BOTTOMSHEETDIALOG_DISPLAY_DURATION,
110
+ });
111
+ }
112
+ },
113
+ });
114
+ // Animate in sheet on initial render.
115
+ const onOpenDialog = (callback) => {
116
+ // Starts setting the Y position of the dialog to the bottom of the dialog
117
+ currentYOffset.value = bottomOfDialogYValue.value;
118
+ // Animate the Y position to the top of the dialog, then call onOpenCB
119
+ currentYOffset.value = withTiming(topOfDialogYValue.value, {
120
+ duration: DEFAULT_BOTTOMSHEETDIALOG_DISPLAY_DURATION,
121
+ }, () => {
122
+ runOnJS(onOpenCB)();
123
+ if (callback) {
124
+ runOnJS(callback)();
125
+ }
126
+ });
127
+ };
128
+ const onDebouncedCloseDialog = useMemo(
129
+ // Prevent hide from being called multiple times. Potentially caused by taps in quick succession.
130
+ () => debounce(onCloseDialog, 2000, { leading: true }), [onCloseDialog]);
131
+ useEffect(() =>
132
+ // Automatically handles animation when content changes
133
+ // Disable for now since network switches causes the screen to hang with this on.
134
+ // LayoutAnimation.configureNext(LayoutAnimation.Presets.easeInEaseOut);
135
+ onDebouncedCloseDialog.cancel(), [children, onDebouncedCloseDialog]);
136
+ const updateSheetHeight = (e) => {
137
+ const { height } = e.nativeEvent.layout;
138
+ bottomOfDialogYValue.value = height;
139
+ if (!isMounted.current) {
140
+ isMounted.current = true;
141
+ onOpenDialog();
142
+ }
143
+ };
144
+ const animatedSheetStyle = useAnimatedStyle(() => ({
145
+ transform: [
146
+ {
147
+ translateY: currentYOffset.value,
148
+ },
149
+ ],
150
+ }));
151
+ const sheetStyle = useMemo(() => [
152
+ tw.style('bg-default rounded-t-3xl overflow-hidden border border-muted', twClassName),
153
+ {
154
+ maxHeight: maxSheetHeight,
155
+ paddingBottom: Platform.select({
156
+ ios: screenBottomPadding,
157
+ macos: screenBottomPadding,
158
+ default: screenBottomPadding + 16,
159
+ }),
160
+ ...(isFullscreen && { height: maxSheetHeight }),
161
+ ...shadowLg,
162
+ },
163
+ style,
164
+ ], [
165
+ tw,
166
+ maxSheetHeight,
167
+ screenBottomPadding,
168
+ isFullscreen,
169
+ shadowLg,
170
+ style,
171
+ twClassName,
172
+ ]);
173
+ const combinedSheetStyle = useMemo(() => [...sheetStyle, animatedSheetStyle], [sheetStyle]);
174
+ useImperativeHandle(ref, () => ({
175
+ onOpenDialog,
176
+ onCloseDialog,
177
+ }));
178
+ return (<KeyboardAvoidingView style={tw.style('absolute bottom-0 inset-x-0')} behavior={Platform.OS === 'ios' ? 'padding' : undefined} keyboardVerticalOffset={Platform.OS === 'ios' ? -screenBottomPadding : frameY} enabled={keyboardAvoidingViewEnabled} {...props}>
179
+ <PanGestureHandler enabled={isInteractable} onGestureEvent={gestureHandler}>
180
+ <Animated.View onLayout={updateSheetHeight} style={combinedSheetStyle}>
181
+ {isInteractable && (<View style={tw.style('self-stretch items-center p-1')}>
182
+ <View style={tw.style('h-1 w-10 rounded-sm bg-border-muted')}/>
183
+ </View>)}
184
+ {children}
185
+ </Animated.View>
186
+ </PanGestureHandler>
187
+ </KeyboardAvoidingView>);
188
+ });
189
+ export default BottomSheetDialog;
190
+ //# sourceMappingURL=BottomSheetDialog.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BottomSheetDialog.mjs","sourceRoot":"","sources":["../../../src/components/BottomSheetDialog/BottomSheetDialog.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,EACL,KAAK,EACL,WAAW,EACX,QAAQ,EACT,sDAAsD;AACvD,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,yCAAyC;;;AAEzE,OAAO,QAAO,EACZ,UAAU,EACV,WAAW,EACX,SAAS,EACT,OAAO,EACP,MAAM,EACN,mBAAmB,EACpB,cAAc;;AACf,OAAO,EAEL,IAAI,EACJ,QAAQ,EACR,oBAAoB,EACr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AAc,CAAC,CACxB,cAAc,CAAC,CAAC,cAAc,CAAC,CAE/B;UAAA,CAAC,QAAQ,CAAC,IAAI,CACZ,QAAQ,CAAC,CAAC,iBAAiB,CAAC,CAC5B,KAAK,CAAC,CAAC,kBAAkB,CAAC,CAE1B;YAAA,CAAC,cAAc,IAAI,CACjB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,+BAA+B,CAAC,CAAC,CACrD;gBAAA,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,qCAAqC,CAAC,CAAC,EAC/D;cAAA,EAAE,IAAI,CAAC,CACR,CACD;YAAA,CAAC,QAAQ,CACX;UAAA,EAAE,QAAQ,CAAC,IAAI,CACjB;QAAA,EAAE,iBAAiB,CACrB;MAAA,EAAE,oBAAoB,CAAC,CACxB,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,iBAAiB,CAAC","sourcesContent":["import {\n Theme,\n useTailwind,\n useTheme,\n} from '@metamask-previews/design-system-twrnc-preset';\nimport { lightTheme, darkTheme } from '@metamask-previews/design-tokens';\nimport { debounce } from 'lodash';\nimport React, {\n forwardRef,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useImperativeHandle,\n} from 'react';\nimport {\n LayoutChangeEvent,\n View,\n Platform,\n KeyboardAvoidingView,\n} from 'react-native';\nimport {\n PanGestureHandler,\n PanGestureHandlerGestureEvent,\n} from 'react-native-gesture-handler';\n// eslint-disable-next-line import-x/default\nimport Animated, {\n runOnJS,\n useAnimatedGestureHandler,\n useAnimatedStyle,\n useSharedValue,\n withTiming,\n} from 'react-native-reanimated';\nimport {\n useSafeAreaFrame,\n useSafeAreaInsets,\n} from 'react-native-safe-area-context';\n\n// Internal dependencies.\nimport {\n DEFAULT_BOTTOMSHEETDIALOG_DISPLAY_DURATION,\n DEFAULT_BOTTOMSHEETDIALOG_DISMISSTHRESHOLD,\n DEFAULT_BOTTOMSHEETDIALOG_SWIPETHRESHOLD_DURATION,\n} from './BottomSheetDialog.constants';\nimport type {\n BottomSheetDialogRef,\n BottomSheetDialogProps,\n} from './BottomSheetDialog.types';\n\nconst BottomSheetDialog = forwardRef<\n BottomSheetDialogRef,\n BottomSheetDialogProps\n>(\n (\n {\n children,\n isFullscreen = false,\n isInteractable = true,\n keyboardAvoidingViewEnabled = true,\n onClose,\n onOpen,\n style,\n twClassName,\n ...props\n },\n ref,\n ) => {\n const tw = useTailwind();\n const currentTheme = useTheme();\n const shadowLg =\n currentTheme === Theme.Light\n ? lightTheme.shadows.size.lg\n : darkTheme.shadows.size.lg;\n\n const { top: screenTopPadding, bottom: screenBottomPadding } =\n useSafeAreaInsets();\n const { y: frameY, height: screenHeight } = useSafeAreaFrame();\n\n const maxSheetHeight = screenHeight - screenTopPadding;\n // X and Y values start on top left of the DIALOG\n // currentYOffset will be used to animate the Y position of the Dialog\n const currentYOffset = useSharedValue(screenHeight);\n const topOfDialogYValue = useSharedValue(0);\n const bottomOfDialogYValue = useSharedValue(screenHeight);\n const isMounted = useRef(false);\n\n const onOpenCB = useCallback(() => {\n onOpen?.();\n }, [onOpen]);\n const onCloseCB = useCallback(() => {\n onClose?.();\n }, [onClose]);\n\n const onCloseDialog = useCallback(\n (callback?: () => void) => {\n currentYOffset.value = withTiming(\n bottomOfDialogYValue.value,\n { duration: DEFAULT_BOTTOMSHEETDIALOG_DISPLAY_DURATION },\n () => {\n runOnJS(onCloseCB)();\n if (callback) {\n runOnJS(callback)();\n }\n },\n );\n // Ref values do not affect deps.\n },\n [onCloseCB],\n );\n\n const gestureHandler = useAnimatedGestureHandler<\n PanGestureHandlerGestureEvent,\n { startY: number }\n >({\n onStart: (_, ctx) => {\n // Starts tracking vertical position of gesture\n ctx.startY = currentYOffset.value;\n },\n onActive: (event, ctx) => {\n const { translationY } = event;\n currentYOffset.value = ctx.startY + translationY;\n // If gesture Y value goes above the bottom of Dialog Y value(bottom of dialog),\n // which means the gesture is currently below the bottom of the dialog,\n // sets it to bottom of Dialog Y value\n if (currentYOffset.value >= bottomOfDialogYValue.value) {\n currentYOffset.value = bottomOfDialogYValue.value;\n }\n // If gesture Y value goes below the top of Dialog Y value(top of dialog),\n // which means the gesture is currently above the top of the dialog,\n // sets it to top of Dialog Y value\n if (currentYOffset.value <= topOfDialogYValue.value) {\n currentYOffset.value = topOfDialogYValue.value;\n }\n },\n onEnd: (event, ctx) => {\n const { translationY, velocityY } = event;\n // finalYOffset is used to animate the Y position of the Dialog after the gesture event\n let finalYOffset: number;\n // Measuring dismissing swipe action\n const latestOffset = ctx.startY + translationY;\n // Check if the swipe distance reach the dismiss offset threshold,\n // which is currently 60% of sheet height\n const hasReachedDismissOffset =\n latestOffset >\n bottomOfDialogYValue.value *\n DEFAULT_BOTTOMSHEETDIALOG_DISMISSTHRESHOLD;\n // Check if the gesture's vertical speed has reached the threshold to determine a swipe action\n const hasReachedSwipeThreshold =\n Math.abs(velocityY) >\n DEFAULT_BOTTOMSHEETDIALOG_SWIPETHRESHOLD_DURATION;\n const isQuickDismissing = velocityY > 0;\n\n // If user is swiping\n if (hasReachedSwipeThreshold) {\n // Quick swipe takes priority\n if (isQuickDismissing) {\n finalYOffset = bottomOfDialogYValue.value;\n } else {\n finalYOffset = topOfDialogYValue.value;\n }\n } else if (hasReachedDismissOffset) {\n finalYOffset = bottomOfDialogYValue.value;\n } else {\n finalYOffset = topOfDialogYValue.value;\n }\n\n const isDismissed = finalYOffset === bottomOfDialogYValue.value;\n\n if (isDismissed) {\n runOnJS(onCloseDialog)();\n } else {\n // Only animate dialog to a certain Y position instead\n currentYOffset.value = withTiming(finalYOffset, {\n duration: DEFAULT_BOTTOMSHEETDIALOG_DISPLAY_DURATION,\n });\n }\n },\n });\n\n // Animate in sheet on initial render.\n const onOpenDialog = (callback?: () => void) => {\n // Starts setting the Y position of the dialog to the bottom of the dialog\n currentYOffset.value = bottomOfDialogYValue.value;\n // Animate the Y position to the top of the dialog, then call onOpenCB\n currentYOffset.value = withTiming(\n topOfDialogYValue.value,\n {\n duration: DEFAULT_BOTTOMSHEETDIALOG_DISPLAY_DURATION,\n },\n () => {\n runOnJS(onOpenCB)();\n if (callback) {\n runOnJS(callback)();\n }\n },\n );\n };\n\n const onDebouncedCloseDialog = useMemo(\n // Prevent hide from being called multiple times. Potentially caused by taps in quick succession.\n () => debounce(onCloseDialog, 2000, { leading: true }),\n [onCloseDialog],\n );\n\n useEffect(\n () =>\n // Automatically handles animation when content changes\n // Disable for now since network switches causes the screen to hang with this on.\n // LayoutAnimation.configureNext(LayoutAnimation.Presets.easeInEaseOut);\n onDebouncedCloseDialog.cancel(),\n [children, onDebouncedCloseDialog],\n );\n\n const updateSheetHeight = (e: LayoutChangeEvent) => {\n const { height } = e.nativeEvent.layout;\n bottomOfDialogYValue.value = height;\n\n if (!isMounted.current) {\n isMounted.current = true;\n onOpenDialog();\n }\n };\n\n const animatedSheetStyle = useAnimatedStyle(() => ({\n transform: [\n {\n translateY: currentYOffset.value,\n },\n ],\n }));\n\n const sheetStyle = useMemo(\n () => [\n tw.style(\n 'bg-default rounded-t-3xl overflow-hidden border border-muted',\n twClassName,\n ),\n {\n maxHeight: maxSheetHeight,\n paddingBottom: Platform.select({\n ios: screenBottomPadding,\n macos: screenBottomPadding,\n default: screenBottomPadding + 16,\n }),\n ...(isFullscreen && { height: maxSheetHeight }),\n ...shadowLg,\n },\n style,\n ],\n\n [\n tw,\n maxSheetHeight,\n screenBottomPadding,\n isFullscreen,\n shadowLg,\n style,\n twClassName,\n ],\n );\n\n const combinedSheetStyle = useMemo(\n () => [...sheetStyle, animatedSheetStyle],\n\n [sheetStyle],\n );\n\n useImperativeHandle(ref, () => ({\n onOpenDialog,\n onCloseDialog,\n }));\n\n return (\n <KeyboardAvoidingView\n style={tw.style('absolute bottom-0 inset-x-0')}\n behavior={Platform.OS === 'ios' ? 'padding' : undefined}\n keyboardVerticalOffset={\n Platform.OS === 'ios' ? -screenBottomPadding : frameY\n }\n enabled={keyboardAvoidingViewEnabled}\n {...props}\n >\n <PanGestureHandler\n enabled={isInteractable}\n onGestureEvent={gestureHandler}\n >\n <Animated.View\n onLayout={updateSheetHeight}\n style={combinedSheetStyle}\n >\n {isInteractable && (\n <View style={tw.style('self-stretch items-center p-1')}>\n <View style={tw.style('h-1 w-10 rounded-sm bg-border-muted')} />\n </View>\n )}\n {children}\n </Animated.View>\n </PanGestureHandler>\n </KeyboardAvoidingView>\n );\n },\n);\n\nexport default BottomSheetDialog;\n"]}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=BottomSheetDialog.types.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BottomSheetDialog.types.cjs","sourceRoot":"","sources":["../../../src/components/BottomSheetDialog/BottomSheetDialog.types.ts"],"names":[],"mappings":"","sourcesContent":["// Third party dependencies.\nimport type { ViewProps } from 'react-native';\n\n/**\n * BottomSheetDialog component props.\n */\nexport type BottomSheetDialogProps = {\n /**\n * Optional content to display inside the dialog.\n */\n children?: React.ReactNode;\n /**\n * Optional prop to toggle full screen state of BottomSheetDialog.\n *\n * @default false\n */\n isFullscreen?: boolean;\n /**\n * Optional boolean that indicates if the sheet is swippable.\n * This affects whether or not tapping on the overlay will dismiss\n * the sheet as well, and whether the drag handle indicator is shown.\n *\n * @default true\n */\n isInteractable?: boolean;\n /**\n * Optional boolean that indicates if the KeyboardAvoidingView is enabled.\n *\n * @default true\n */\n keyboardAvoidingViewEnabled?: boolean;\n /**\n * Optional callback that gets triggered when the sheet is closed.\n */\n onClose?: (hasPendingAction?: boolean) => void;\n /**\n * Optional callback that gets triggered when the sheet is opened.\n */\n onOpen?: (hasPendingAction?: boolean) => void;\n /**\n * Tailwind CSS classes for the dialog container.\n */\n twClassName?: string;\n} & ViewProps;\n\n/**\n * Ref handle for imperative control of the BottomSheetDialog.\n */\nexport type BottomSheetDialogRef = {\n /**\n * Imperatively close the dialog with an optional callback after animation completes.\n */\n onCloseDialog: (callback?: () => void) => void;\n /**\n * Imperatively open the dialog with an optional callback after animation completes.\n */\n onOpenDialog: (callback?: () => void) => void;\n};\n"]}
@@ -0,0 +1,56 @@
1
+ import type { ViewProps } from "react-native/index.js";
2
+ /**
3
+ * BottomSheetDialog component props.
4
+ */
5
+ export type BottomSheetDialogProps = {
6
+ /**
7
+ * Optional content to display inside the dialog.
8
+ */
9
+ children?: React.ReactNode;
10
+ /**
11
+ * Optional prop to toggle full screen state of BottomSheetDialog.
12
+ *
13
+ * @default false
14
+ */
15
+ isFullscreen?: boolean;
16
+ /**
17
+ * Optional boolean that indicates if the sheet is swippable.
18
+ * This affects whether or not tapping on the overlay will dismiss
19
+ * the sheet as well, and whether the drag handle indicator is shown.
20
+ *
21
+ * @default true
22
+ */
23
+ isInteractable?: boolean;
24
+ /**
25
+ * Optional boolean that indicates if the KeyboardAvoidingView is enabled.
26
+ *
27
+ * @default true
28
+ */
29
+ keyboardAvoidingViewEnabled?: boolean;
30
+ /**
31
+ * Optional callback that gets triggered when the sheet is closed.
32
+ */
33
+ onClose?: (hasPendingAction?: boolean) => void;
34
+ /**
35
+ * Optional callback that gets triggered when the sheet is opened.
36
+ */
37
+ onOpen?: (hasPendingAction?: boolean) => void;
38
+ /**
39
+ * Tailwind CSS classes for the dialog container.
40
+ */
41
+ twClassName?: string;
42
+ } & ViewProps;
43
+ /**
44
+ * Ref handle for imperative control of the BottomSheetDialog.
45
+ */
46
+ export type BottomSheetDialogRef = {
47
+ /**
48
+ * Imperatively close the dialog with an optional callback after animation completes.
49
+ */
50
+ onCloseDialog: (callback?: () => void) => void;
51
+ /**
52
+ * Imperatively open the dialog with an optional callback after animation completes.
53
+ */
54
+ onOpenDialog: (callback?: () => void) => void;
55
+ };
56
+ //# sourceMappingURL=BottomSheetDialog.types.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BottomSheetDialog.types.d.cts","sourceRoot":"","sources":["../../../src/components/BottomSheetDialog/BottomSheetDialog.types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,8BAAqB;AAE9C;;GAEG;AACH,MAAM,MAAM,sBAAsB,GAAG;IACnC;;OAEG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B;;;;OAIG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB;;;;;;OAMG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB;;;;OAIG;IACH,2BAA2B,CAAC,EAAE,OAAO,CAAC;IACtC;;OAEG;IACH,OAAO,CAAC,EAAE,CAAC,gBAAgB,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IAC/C;;OAEG;IACH,MAAM,CAAC,EAAE,CAAC,gBAAgB,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IAC9C;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,GAAG,SAAS,CAAC;AAEd;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAAG;IACjC;;OAEG;IACH,aAAa,EAAE,CAAC,QAAQ,CAAC,EAAE,MAAM,IAAI,KAAK,IAAI,CAAC;IAC/C;;OAEG;IACH,YAAY,EAAE,CAAC,QAAQ,CAAC,EAAE,MAAM,IAAI,KAAK,IAAI,CAAC;CAC/C,CAAC"}
@@ -0,0 +1,56 @@
1
+ import type { ViewProps } from "react-native/index.js";
2
+ /**
3
+ * BottomSheetDialog component props.
4
+ */
5
+ export type BottomSheetDialogProps = {
6
+ /**
7
+ * Optional content to display inside the dialog.
8
+ */
9
+ children?: React.ReactNode;
10
+ /**
11
+ * Optional prop to toggle full screen state of BottomSheetDialog.
12
+ *
13
+ * @default false
14
+ */
15
+ isFullscreen?: boolean;
16
+ /**
17
+ * Optional boolean that indicates if the sheet is swippable.
18
+ * This affects whether or not tapping on the overlay will dismiss
19
+ * the sheet as well, and whether the drag handle indicator is shown.
20
+ *
21
+ * @default true
22
+ */
23
+ isInteractable?: boolean;
24
+ /**
25
+ * Optional boolean that indicates if the KeyboardAvoidingView is enabled.
26
+ *
27
+ * @default true
28
+ */
29
+ keyboardAvoidingViewEnabled?: boolean;
30
+ /**
31
+ * Optional callback that gets triggered when the sheet is closed.
32
+ */
33
+ onClose?: (hasPendingAction?: boolean) => void;
34
+ /**
35
+ * Optional callback that gets triggered when the sheet is opened.
36
+ */
37
+ onOpen?: (hasPendingAction?: boolean) => void;
38
+ /**
39
+ * Tailwind CSS classes for the dialog container.
40
+ */
41
+ twClassName?: string;
42
+ } & ViewProps;
43
+ /**
44
+ * Ref handle for imperative control of the BottomSheetDialog.
45
+ */
46
+ export type BottomSheetDialogRef = {
47
+ /**
48
+ * Imperatively close the dialog with an optional callback after animation completes.
49
+ */
50
+ onCloseDialog: (callback?: () => void) => void;
51
+ /**
52
+ * Imperatively open the dialog with an optional callback after animation completes.
53
+ */
54
+ onOpenDialog: (callback?: () => void) => void;
55
+ };
56
+ //# sourceMappingURL=BottomSheetDialog.types.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BottomSheetDialog.types.d.mts","sourceRoot":"","sources":["../../../src/components/BottomSheetDialog/BottomSheetDialog.types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,8BAAqB;AAE9C;;GAEG;AACH,MAAM,MAAM,sBAAsB,GAAG;IACnC;;OAEG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B;;;;OAIG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB;;;;;;OAMG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB;;;;OAIG;IACH,2BAA2B,CAAC,EAAE,OAAO,CAAC;IACtC;;OAEG;IACH,OAAO,CAAC,EAAE,CAAC,gBAAgB,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IAC/C;;OAEG;IACH,MAAM,CAAC,EAAE,CAAC,gBAAgB,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IAC9C;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,GAAG,SAAS,CAAC;AAEd;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAAG;IACjC;;OAEG;IACH,aAAa,EAAE,CAAC,QAAQ,CAAC,EAAE,MAAM,IAAI,KAAK,IAAI,CAAC;IAC/C;;OAEG;IACH,YAAY,EAAE,CAAC,QAAQ,CAAC,EAAE,MAAM,IAAI,KAAK,IAAI,CAAC;CAC/C,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=BottomSheetDialog.types.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BottomSheetDialog.types.mjs","sourceRoot":"","sources":["../../../src/components/BottomSheetDialog/BottomSheetDialog.types.ts"],"names":[],"mappings":"","sourcesContent":["// Third party dependencies.\nimport type { ViewProps } from 'react-native';\n\n/**\n * BottomSheetDialog component props.\n */\nexport type BottomSheetDialogProps = {\n /**\n * Optional content to display inside the dialog.\n */\n children?: React.ReactNode;\n /**\n * Optional prop to toggle full screen state of BottomSheetDialog.\n *\n * @default false\n */\n isFullscreen?: boolean;\n /**\n * Optional boolean that indicates if the sheet is swippable.\n * This affects whether or not tapping on the overlay will dismiss\n * the sheet as well, and whether the drag handle indicator is shown.\n *\n * @default true\n */\n isInteractable?: boolean;\n /**\n * Optional boolean that indicates if the KeyboardAvoidingView is enabled.\n *\n * @default true\n */\n keyboardAvoidingViewEnabled?: boolean;\n /**\n * Optional callback that gets triggered when the sheet is closed.\n */\n onClose?: (hasPendingAction?: boolean) => void;\n /**\n * Optional callback that gets triggered when the sheet is opened.\n */\n onOpen?: (hasPendingAction?: boolean) => void;\n /**\n * Tailwind CSS classes for the dialog container.\n */\n twClassName?: string;\n} & ViewProps;\n\n/**\n * Ref handle for imperative control of the BottomSheetDialog.\n */\nexport type BottomSheetDialogRef = {\n /**\n * Imperatively close the dialog with an optional callback after animation completes.\n */\n onCloseDialog: (callback?: () => void) => void;\n /**\n * Imperatively open the dialog with an optional callback after animation completes.\n */\n onOpenDialog: (callback?: () => void) => void;\n};\n"]}
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.default = void 0;
7
+ var BottomSheetDialog_1 = require("./BottomSheetDialog.cjs");
8
+ Object.defineProperty(exports, "default", { enumerable: true, get: function () { return __importDefault(BottomSheetDialog_1).default; } });
9
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../../src/components/BottomSheetDialog/index.ts"],"names":[],"mappings":";;;;;;AAAA,6DAA8C;AAArC,6HAAA,OAAO,OAAA","sourcesContent":["export { default } from './BottomSheetDialog';\nexport type {\n BottomSheetDialogProps,\n BottomSheetDialogRef,\n} from './BottomSheetDialog.types';\n"]}
@@ -0,0 +1,3 @@
1
+ export { default } from "./BottomSheetDialog.cjs";
2
+ export type { BottomSheetDialogProps, BottomSheetDialogRef, } from "./BottomSheetDialog.types.cjs";
3
+ //# sourceMappingURL=index.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/components/BottomSheetDialog/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,gCAA4B;AAC9C,YAAY,EACV,sBAAsB,EACtB,oBAAoB,GACrB,sCAAkC"}
@@ -0,0 +1,3 @@
1
+ export { default } from "./BottomSheetDialog.mjs";
2
+ export type { BottomSheetDialogProps, BottomSheetDialogRef, } from "./BottomSheetDialog.types.mjs";
3
+ //# sourceMappingURL=index.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../src/components/BottomSheetDialog/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,gCAA4B;AAC9C,YAAY,EACV,sBAAsB,EACtB,oBAAoB,GACrB,sCAAkC"}
@@ -0,0 +1,2 @@
1
+ export { default } from "./BottomSheetDialog.mjs";
2
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../src/components/BottomSheetDialog/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,gCAA4B","sourcesContent":["export { default } from './BottomSheetDialog';\nexport type {\n BottomSheetDialogProps,\n BottomSheetDialogRef,\n} from './BottomSheetDialog.types';\n"]}
@@ -31,10 +31,9 @@ const types_1 = require("../../types/index.cjs");
31
31
  const Icon_1 = require("../Icon/index.cjs");
32
32
  const ButtonAnimated_1 = require("../temp-components/ButtonAnimated/index.cjs");
33
33
  const Spinner_1 = require("../temp-components/Spinner/index.cjs");
34
- const TextOrChildren_1 = require("../temp-components/TextOrChildren/TextOrChildren.cjs");
35
34
  const Text_1 = require("../Text/index.cjs");
36
35
  const ButtonBase_constants_1 = require("./ButtonBase.constants.cjs");
37
- const ButtonBase = ({ children, textProps, size = types_1.ButtonBaseSize.Lg, isLoading, loadingText, spinnerProps, startIconName, startIconProps, startAccessory, endIconName, endIconProps, endAccessory, isDisabled, isFullWidth, twClassName, textClassName, iconClassName, style, accessibilityLabel, accessibilityHint, accessibilityRole = 'button', accessibilityActions, onAccessibilityAction, ...props }) => {
36
+ const ButtonBase = ({ children, textProps, size = types_1.ButtonBaseSize.Lg, isLoading, loadingText, spinnerProps, startIconName, startIconProps, startAccessory, endIconName, endIconProps, endAccessory, isDisabled, isFullWidth, twClassName, textClassName, iconClassName, style, accessibilityLabel, accessibilityHint, accessibilityRole = 'button', accessibilityActions, onAccessibilityAction, hapticFeedback, ...props }) => {
38
37
  const tw = (0, design_system_twrnc_preset_1.useTailwind)();
39
38
  const finalStartIconName = startIconName ?? startIconProps?.name;
40
39
  const finalEndIconName = endIconName ?? endIconProps?.name;
@@ -74,7 +73,7 @@ const ButtonBase = ({ children, textProps, size = types_1.ButtonBaseSize.Lg, isL
74
73
  }
75
74
  return state;
76
75
  }, [isDisabled, isLoading]);
77
- return (<ButtonAnimated_1.ButtonAnimated disabled={isDisabled || isLoading} accessibilityRole={accessibilityRole} accessibilityLabel={finalAccessibilityLabel} accessibilityHint={finalAccessibilityHint} accessibilityActions={accessibilityActions} onAccessibilityAction={onAccessibilityAction} accessibilityState={accessibilityState} accessible style={({ pressed }) => {
76
+ return (<ButtonAnimated_1.ButtonAnimated disabled={isDisabled || isLoading} hapticFeedback={hapticFeedback} accessibilityRole={accessibilityRole} accessibilityLabel={finalAccessibilityLabel} accessibilityHint={finalAccessibilityHint} accessibilityActions={accessibilityActions} onAccessibilityAction={onAccessibilityAction} accessibilityState={accessibilityState} accessible style={({ pressed }) => {
78
77
  // Evaluate custom className if it's a function
79
78
  const customClassName = typeof twClassName === 'function'
80
79
  ? twClassName(pressed)
@@ -118,15 +117,9 @@ const ButtonBase = ({ children, textProps, size = types_1.ButtonBaseSize.Lg, isL
118
117
  {startAccessory}
119
118
  </react_native_1.View>))}
120
119
 
121
- {typeof children === 'string' ? (<TextOrChildren_1.TextOrChildren textProps={{
122
- variant: Text_1.TextVariant.BodyMd,
123
- fontWeight: Text_1.FontWeight.Medium,
124
- color: Text_1.TextColor.TextDefault,
125
- twClassName: `shrink grow-0 flex-wrap text-center ${isLoading ? 'opacity-0' : ''} ${textClassName ? textClassName(pressed) : ''}`,
126
- ...textProps,
127
- }}>
120
+ {typeof children === 'string' ? (<Text_1.Text variant={Text_1.TextVariant.BodyMd} fontWeight={Text_1.FontWeight.Medium} color={Text_1.TextColor.TextDefault} {...textProps} twClassName={`shrink grow-0 flex-wrap text-center ${isLoading ? 'opacity-0' : ''} ${textClassName ? textClassName(pressed) : ''} ${textProps?.twClassName ?? ''}`}>
128
121
  {children}
129
- </TextOrChildren_1.TextOrChildren>) : (<react_native_1.View style={tw.style(isLoading && 'opacity-0')}>{children}</react_native_1.View>)}
122
+ </Text_1.Text>) : (<react_native_1.View style={tw.style(isLoading && 'opacity-0')}>{children}</react_native_1.View>)}
130
123
 
131
124
  {finalEndIconName ? (<Icon_1.Icon name={finalEndIconName} size={Icon_1.IconSize.Sm} twClassName={`shrink-0 ${isLoading ? 'opacity-0' : ''} ${iconClassName ? iconClassName(pressed) : ''}`} {...endIconProps}/>) : (endAccessory && (<react_native_1.View style={tw.style(isLoading && 'opacity-0')}>
132
125
  {endAccessory}