@metamask-previews/design-system-react-native 0.11.0-preview.fa05289 → 0.13.0-preview.8028c20

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 (419) hide show
  1. package/CHANGELOG.md +30 -1
  2. package/dist/components/AvatarAccount/AvatarAccount.cjs +4 -3
  3. package/dist/components/AvatarAccount/AvatarAccount.cjs.map +1 -1
  4. package/dist/components/AvatarAccount/AvatarAccount.constants.cjs +9 -1
  5. package/dist/components/AvatarAccount/AvatarAccount.constants.cjs.map +1 -1
  6. package/dist/components/AvatarAccount/AvatarAccount.constants.d.cts +2 -0
  7. package/dist/components/AvatarAccount/AvatarAccount.constants.d.cts.map +1 -1
  8. package/dist/components/AvatarAccount/AvatarAccount.constants.d.mts +2 -0
  9. package/dist/components/AvatarAccount/AvatarAccount.constants.d.mts.map +1 -1
  10. package/dist/components/AvatarAccount/AvatarAccount.constants.mjs +8 -0
  11. package/dist/components/AvatarAccount/AvatarAccount.constants.mjs.map +1 -1
  12. package/dist/components/AvatarAccount/AvatarAccount.d.cts.map +1 -1
  13. package/dist/components/AvatarAccount/AvatarAccount.d.mts.map +1 -1
  14. package/dist/components/AvatarAccount/AvatarAccount.mjs +4 -3
  15. package/dist/components/AvatarAccount/AvatarAccount.mjs.map +1 -1
  16. package/dist/components/AvatarBase/AvatarBase.cjs +3 -3
  17. package/dist/components/AvatarBase/AvatarBase.cjs.map +1 -1
  18. package/dist/components/AvatarBase/AvatarBase.constants.cjs +21 -21
  19. package/dist/components/AvatarBase/AvatarBase.constants.cjs.map +1 -1
  20. package/dist/components/AvatarBase/AvatarBase.constants.d.cts +1 -1
  21. package/dist/components/AvatarBase/AvatarBase.constants.d.cts.map +1 -1
  22. package/dist/components/AvatarBase/AvatarBase.constants.d.mts +1 -1
  23. package/dist/components/AvatarBase/AvatarBase.constants.d.mts.map +1 -1
  24. package/dist/components/AvatarBase/AvatarBase.constants.mjs +1 -1
  25. package/dist/components/AvatarBase/AvatarBase.constants.mjs.map +1 -1
  26. package/dist/components/AvatarBase/AvatarBase.d.cts.map +1 -1
  27. package/dist/components/AvatarBase/AvatarBase.d.mts.map +1 -1
  28. package/dist/components/AvatarBase/AvatarBase.mjs +1 -1
  29. package/dist/components/AvatarBase/AvatarBase.mjs.map +1 -1
  30. package/dist/components/AvatarBase/AvatarBase.types.cjs.map +1 -1
  31. package/dist/components/AvatarBase/AvatarBase.types.d.cts +3 -39
  32. package/dist/components/AvatarBase/AvatarBase.types.d.cts.map +1 -1
  33. package/dist/components/AvatarBase/AvatarBase.types.d.mts +3 -39
  34. package/dist/components/AvatarBase/AvatarBase.types.d.mts.map +1 -1
  35. package/dist/components/AvatarBase/AvatarBase.types.mjs.map +1 -1
  36. package/dist/components/AvatarBase/index.cjs +3 -3
  37. package/dist/components/AvatarBase/index.cjs.map +1 -1
  38. package/dist/components/AvatarBase/index.d.cts +1 -1
  39. package/dist/components/AvatarBase/index.d.cts.map +1 -1
  40. package/dist/components/AvatarBase/index.d.mts +1 -1
  41. package/dist/components/AvatarBase/index.d.mts.map +1 -1
  42. package/dist/components/AvatarBase/index.mjs +1 -1
  43. package/dist/components/AvatarBase/index.mjs.map +1 -1
  44. package/dist/components/AvatarNetwork/AvatarNetwork.types.cjs.map +1 -1
  45. package/dist/components/AvatarNetwork/AvatarNetwork.types.d.cts +7 -9
  46. package/dist/components/AvatarNetwork/AvatarNetwork.types.d.cts.map +1 -1
  47. package/dist/components/AvatarNetwork/AvatarNetwork.types.d.mts +7 -9
  48. package/dist/components/AvatarNetwork/AvatarNetwork.types.d.mts.map +1 -1
  49. package/dist/components/AvatarNetwork/AvatarNetwork.types.mjs.map +1 -1
  50. package/dist/components/BadgeWrapper/BadgeWrapper.cjs +8 -8
  51. package/dist/components/BadgeWrapper/BadgeWrapper.cjs.map +1 -1
  52. package/dist/components/BadgeWrapper/BadgeWrapper.d.cts.map +1 -1
  53. package/dist/components/BadgeWrapper/BadgeWrapper.d.mts.map +1 -1
  54. package/dist/components/BadgeWrapper/BadgeWrapper.mjs +1 -1
  55. package/dist/components/BadgeWrapper/BadgeWrapper.mjs.map +1 -1
  56. package/dist/components/BadgeWrapper/BadgeWrapper.types.cjs.map +1 -1
  57. package/dist/components/BadgeWrapper/BadgeWrapper.types.d.cts +4 -51
  58. package/dist/components/BadgeWrapper/BadgeWrapper.types.d.cts.map +1 -1
  59. package/dist/components/BadgeWrapper/BadgeWrapper.types.d.mts +4 -51
  60. package/dist/components/BadgeWrapper/BadgeWrapper.types.d.mts.map +1 -1
  61. package/dist/components/BadgeWrapper/BadgeWrapper.types.mjs.map +1 -1
  62. package/dist/components/BadgeWrapper/index.cjs +3 -3
  63. package/dist/components/BadgeWrapper/index.cjs.map +1 -1
  64. package/dist/components/BadgeWrapper/index.d.cts +1 -2
  65. package/dist/components/BadgeWrapper/index.d.cts.map +1 -1
  66. package/dist/components/BadgeWrapper/index.d.mts +1 -2
  67. package/dist/components/BadgeWrapper/index.d.mts.map +1 -1
  68. package/dist/components/BadgeWrapper/index.mjs +1 -1
  69. package/dist/components/BadgeWrapper/index.mjs.map +1 -1
  70. package/dist/components/BottomSheet/BottomSheet.cjs +7 -10
  71. package/dist/components/BottomSheet/BottomSheet.cjs.map +1 -1
  72. package/dist/components/BottomSheet/BottomSheet.d.cts +31 -2
  73. package/dist/components/BottomSheet/BottomSheet.d.cts.map +1 -1
  74. package/dist/components/BottomSheet/BottomSheet.d.mts +31 -2
  75. package/dist/components/BottomSheet/BottomSheet.d.mts.map +1 -1
  76. package/dist/components/BottomSheet/BottomSheet.mjs +6 -6
  77. package/dist/components/BottomSheet/BottomSheet.mjs.map +1 -1
  78. package/dist/components/BottomSheet/BottomSheet.types.cjs.map +1 -1
  79. package/dist/components/BottomSheet/BottomSheet.types.d.cts +3 -8
  80. package/dist/components/BottomSheet/BottomSheet.types.d.cts.map +1 -1
  81. package/dist/components/BottomSheet/BottomSheet.types.d.mts +3 -8
  82. package/dist/components/BottomSheet/BottomSheet.types.d.mts.map +1 -1
  83. package/dist/components/BottomSheet/BottomSheet.types.mjs.map +1 -1
  84. package/dist/components/BottomSheetDialog/BottomSheetDialog.cjs +3 -3
  85. package/dist/components/BottomSheetDialog/BottomSheetDialog.cjs.map +1 -1
  86. package/dist/components/BottomSheetDialog/BottomSheetDialog.d.cts +31 -2
  87. package/dist/components/BottomSheetDialog/BottomSheetDialog.d.cts.map +1 -1
  88. package/dist/components/BottomSheetDialog/BottomSheetDialog.d.mts +31 -2
  89. package/dist/components/BottomSheetDialog/BottomSheetDialog.d.mts.map +1 -1
  90. package/dist/components/BottomSheetDialog/BottomSheetDialog.mjs +2 -3
  91. package/dist/components/BottomSheetDialog/BottomSheetDialog.mjs.map +1 -1
  92. package/dist/components/BottomSheetDialog/BottomSheetDialog.types.cjs.map +1 -1
  93. package/dist/components/BottomSheetDialog/BottomSheetDialog.types.d.cts +7 -0
  94. package/dist/components/BottomSheetDialog/BottomSheetDialog.types.d.cts.map +1 -1
  95. package/dist/components/BottomSheetDialog/BottomSheetDialog.types.d.mts +7 -0
  96. package/dist/components/BottomSheetDialog/BottomSheetDialog.types.d.mts.map +1 -1
  97. package/dist/components/BottomSheetDialog/BottomSheetDialog.types.mjs.map +1 -1
  98. package/dist/components/BottomSheetDialog/index.cjs +2 -5
  99. package/dist/components/BottomSheetDialog/index.cjs.map +1 -1
  100. package/dist/components/BottomSheetDialog/index.d.cts +1 -1
  101. package/dist/components/BottomSheetDialog/index.d.cts.map +1 -1
  102. package/dist/components/BottomSheetDialog/index.d.mts +1 -1
  103. package/dist/components/BottomSheetDialog/index.d.mts.map +1 -1
  104. package/dist/components/BottomSheetDialog/index.mjs +1 -1
  105. package/dist/components/BottomSheetDialog/index.mjs.map +1 -1
  106. package/dist/components/BottomSheetHeader/BottomSheetHeader.cjs +2 -2
  107. package/dist/components/BottomSheetHeader/BottomSheetHeader.cjs.map +1 -1
  108. package/dist/components/BottomSheetHeader/BottomSheetHeader.mjs +2 -2
  109. package/dist/components/BottomSheetHeader/BottomSheetHeader.mjs.map +1 -1
  110. package/dist/components/BoxHorizontal/BoxHorizontal.cjs +18 -0
  111. package/dist/components/BoxHorizontal/BoxHorizontal.cjs.map +1 -0
  112. package/dist/components/BoxHorizontal/BoxHorizontal.d.cts +7 -0
  113. package/dist/components/BoxHorizontal/BoxHorizontal.d.cts.map +1 -0
  114. package/dist/components/BoxHorizontal/BoxHorizontal.d.mts +7 -0
  115. package/dist/components/BoxHorizontal/BoxHorizontal.d.mts.map +1 -0
  116. package/dist/components/BoxHorizontal/BoxHorizontal.mjs +18 -0
  117. package/dist/components/BoxHorizontal/BoxHorizontal.mjs.map +1 -0
  118. package/dist/components/BoxHorizontal/BoxHorizontal.types.cjs +3 -0
  119. package/dist/components/BoxHorizontal/BoxHorizontal.types.cjs.map +1 -0
  120. package/dist/components/BoxHorizontal/BoxHorizontal.types.d.cts +13 -0
  121. package/dist/components/BoxHorizontal/BoxHorizontal.types.d.cts.map +1 -0
  122. package/dist/components/BoxHorizontal/BoxHorizontal.types.d.mts +13 -0
  123. package/dist/components/BoxHorizontal/BoxHorizontal.types.d.mts.map +1 -0
  124. package/dist/components/BoxHorizontal/BoxHorizontal.types.mjs +2 -0
  125. package/dist/components/BoxHorizontal/BoxHorizontal.types.mjs.map +1 -0
  126. package/dist/components/BoxHorizontal/index.cjs +6 -0
  127. package/dist/components/BoxHorizontal/index.cjs.map +1 -0
  128. package/dist/components/BoxHorizontal/index.d.cts +3 -0
  129. package/dist/components/BoxHorizontal/index.d.cts.map +1 -0
  130. package/dist/components/BoxHorizontal/index.d.mts +3 -0
  131. package/dist/components/BoxHorizontal/index.d.mts.map +1 -0
  132. package/dist/components/BoxHorizontal/index.mjs +2 -0
  133. package/dist/components/BoxHorizontal/index.mjs.map +1 -0
  134. package/dist/components/BoxVertical/BoxVertical.cjs +18 -0
  135. package/dist/components/BoxVertical/BoxVertical.cjs.map +1 -0
  136. package/dist/components/BoxVertical/BoxVertical.d.cts +7 -0
  137. package/dist/components/BoxVertical/BoxVertical.d.cts.map +1 -0
  138. package/dist/components/BoxVertical/BoxVertical.d.mts +7 -0
  139. package/dist/components/BoxVertical/BoxVertical.d.mts.map +1 -0
  140. package/dist/components/BoxVertical/BoxVertical.mjs +18 -0
  141. package/dist/components/BoxVertical/BoxVertical.mjs.map +1 -0
  142. package/dist/components/BoxVertical/BoxVertical.types.cjs +3 -0
  143. package/dist/components/BoxVertical/BoxVertical.types.cjs.map +1 -0
  144. package/dist/components/BoxVertical/BoxVertical.types.d.cts +13 -0
  145. package/dist/components/BoxVertical/BoxVertical.types.d.cts.map +1 -0
  146. package/dist/components/BoxVertical/BoxVertical.types.d.mts +13 -0
  147. package/dist/components/BoxVertical/BoxVertical.types.d.mts.map +1 -0
  148. package/dist/components/BoxVertical/BoxVertical.types.mjs +2 -0
  149. package/dist/components/BoxVertical/BoxVertical.types.mjs.map +1 -0
  150. package/dist/components/BoxVertical/index.cjs +6 -0
  151. package/dist/components/BoxVertical/index.cjs.map +1 -0
  152. package/dist/components/BoxVertical/index.d.cts +3 -0
  153. package/dist/components/BoxVertical/index.d.cts.map +1 -0
  154. package/dist/components/BoxVertical/index.d.mts +3 -0
  155. package/dist/components/BoxVertical/index.d.mts.map +1 -0
  156. package/dist/components/BoxVertical/index.mjs +2 -0
  157. package/dist/components/BoxVertical/index.mjs.map +1 -0
  158. package/dist/components/HeaderRoot/HeaderRoot.cjs +61 -0
  159. package/dist/components/HeaderRoot/HeaderRoot.cjs.map +1 -0
  160. package/dist/components/HeaderRoot/HeaderRoot.d.cts +7 -0
  161. package/dist/components/HeaderRoot/HeaderRoot.d.cts.map +1 -0
  162. package/dist/components/HeaderRoot/HeaderRoot.d.mts +7 -0
  163. package/dist/components/HeaderRoot/HeaderRoot.d.mts.map +1 -0
  164. package/dist/components/HeaderRoot/HeaderRoot.mjs +61 -0
  165. package/dist/components/HeaderRoot/HeaderRoot.mjs.map +1 -0
  166. package/dist/components/HeaderRoot/HeaderRoot.types.cjs +3 -0
  167. package/dist/components/HeaderRoot/HeaderRoot.types.cjs.map +1 -0
  168. package/dist/components/HeaderRoot/HeaderRoot.types.d.cts +60 -0
  169. package/dist/components/HeaderRoot/HeaderRoot.types.d.cts.map +1 -0
  170. package/dist/components/HeaderRoot/HeaderRoot.types.d.mts +60 -0
  171. package/dist/components/HeaderRoot/HeaderRoot.types.d.mts.map +1 -0
  172. package/dist/components/HeaderRoot/HeaderRoot.types.mjs +2 -0
  173. package/dist/components/HeaderRoot/HeaderRoot.types.mjs.map +1 -0
  174. package/dist/components/HeaderRoot/index.cjs +6 -0
  175. package/dist/components/HeaderRoot/index.cjs.map +1 -0
  176. package/dist/components/HeaderRoot/index.d.cts +3 -0
  177. package/dist/components/HeaderRoot/index.d.cts.map +1 -0
  178. package/dist/components/HeaderRoot/index.d.mts +3 -0
  179. package/dist/components/HeaderRoot/index.d.mts.map +1 -0
  180. package/dist/components/HeaderRoot/index.mjs +2 -0
  181. package/dist/components/HeaderRoot/index.mjs.map +1 -0
  182. package/dist/components/HeaderStandard/HeaderStandard.cjs +101 -0
  183. package/dist/components/HeaderStandard/HeaderStandard.cjs.map +1 -0
  184. package/dist/components/HeaderStandard/HeaderStandard.d.cts +4 -0
  185. package/dist/components/HeaderStandard/HeaderStandard.d.cts.map +1 -0
  186. package/dist/components/HeaderStandard/HeaderStandard.d.mts +4 -0
  187. package/dist/components/HeaderStandard/HeaderStandard.d.mts.map +1 -0
  188. package/dist/components/HeaderStandard/HeaderStandard.mjs +81 -0
  189. package/dist/components/HeaderStandard/HeaderStandard.mjs.map +1 -0
  190. package/dist/components/HeaderStandard/HeaderStandard.types.cjs +8 -0
  191. package/dist/components/HeaderStandard/HeaderStandard.types.cjs.map +1 -0
  192. package/dist/components/HeaderStandard/HeaderStandard.types.d.cts +55 -0
  193. package/dist/components/HeaderStandard/HeaderStandard.types.d.cts.map +1 -0
  194. package/dist/components/HeaderStandard/HeaderStandard.types.d.mts +55 -0
  195. package/dist/components/HeaderStandard/HeaderStandard.types.d.mts.map +1 -0
  196. package/dist/components/HeaderStandard/HeaderStandard.types.mjs +10 -0
  197. package/dist/components/HeaderStandard/HeaderStandard.types.mjs.map +1 -0
  198. package/dist/components/HeaderStandard/index.cjs +6 -0
  199. package/dist/components/HeaderStandard/index.cjs.map +1 -0
  200. package/dist/components/HeaderStandard/index.d.cts +3 -0
  201. package/dist/components/HeaderStandard/index.d.cts.map +1 -0
  202. package/dist/components/HeaderStandard/index.d.mts +3 -0
  203. package/dist/components/HeaderStandard/index.d.mts.map +1 -0
  204. package/dist/components/HeaderStandard/index.mjs +2 -0
  205. package/dist/components/HeaderStandard/index.mjs.map +1 -0
  206. package/dist/components/Icon/assets/candlestick.svg +1 -1
  207. package/dist/components/Input/Input.cjs +4 -3
  208. package/dist/components/Input/Input.cjs.map +1 -1
  209. package/dist/components/Input/Input.constants.cjs +69 -0
  210. package/dist/components/Input/Input.constants.cjs.map +1 -0
  211. package/dist/components/Input/Input.constants.d.cts +11 -0
  212. package/dist/components/Input/Input.constants.d.cts.map +1 -0
  213. package/dist/components/Input/Input.constants.d.mts +11 -0
  214. package/dist/components/Input/Input.constants.d.mts.map +1 -0
  215. package/dist/components/Input/Input.constants.mjs +66 -0
  216. package/dist/components/Input/Input.constants.mjs.map +1 -0
  217. package/dist/components/Input/Input.d.cts.map +1 -1
  218. package/dist/components/Input/Input.d.mts.map +1 -1
  219. package/dist/components/Input/Input.mjs +4 -3
  220. package/dist/components/Input/Input.mjs.map +1 -1
  221. package/dist/components/KeyValueRow/KeyValueLabel/KeyValueLabel.cjs +34 -0
  222. package/dist/components/KeyValueRow/KeyValueLabel/KeyValueLabel.cjs.map +1 -0
  223. package/dist/components/KeyValueRow/KeyValueLabel/KeyValueLabel.d.cts +13 -0
  224. package/dist/components/KeyValueRow/KeyValueLabel/KeyValueLabel.d.cts.map +1 -0
  225. package/dist/components/KeyValueRow/KeyValueLabel/KeyValueLabel.d.mts +13 -0
  226. package/dist/components/KeyValueRow/KeyValueLabel/KeyValueLabel.d.mts.map +1 -0
  227. package/dist/components/KeyValueRow/KeyValueLabel/KeyValueLabel.mjs +34 -0
  228. package/dist/components/KeyValueRow/KeyValueLabel/KeyValueLabel.mjs.map +1 -0
  229. package/dist/components/KeyValueRow/KeyValueRoot/KeyValueRoot.cjs +40 -0
  230. package/dist/components/KeyValueRow/KeyValueRoot/KeyValueRoot.cjs.map +1 -0
  231. package/dist/components/KeyValueRow/KeyValueRoot/KeyValueRoot.d.cts +24 -0
  232. package/dist/components/KeyValueRow/KeyValueRoot/KeyValueRoot.d.cts.map +1 -0
  233. package/dist/components/KeyValueRow/KeyValueRoot/KeyValueRoot.d.mts +24 -0
  234. package/dist/components/KeyValueRow/KeyValueRoot/KeyValueRoot.d.mts.map +1 -0
  235. package/dist/components/KeyValueRow/KeyValueRoot/KeyValueRoot.mjs +40 -0
  236. package/dist/components/KeyValueRow/KeyValueRoot/KeyValueRoot.mjs.map +1 -0
  237. package/dist/components/KeyValueRow/KeyValueRow.cjs +76 -0
  238. package/dist/components/KeyValueRow/KeyValueRow.cjs.map +1 -0
  239. package/dist/components/KeyValueRow/KeyValueRow.d.cts +24 -0
  240. package/dist/components/KeyValueRow/KeyValueRow.d.cts.map +1 -0
  241. package/dist/components/KeyValueRow/KeyValueRow.d.mts +24 -0
  242. package/dist/components/KeyValueRow/KeyValueRow.d.mts.map +1 -0
  243. package/dist/components/KeyValueRow/KeyValueRow.mjs +76 -0
  244. package/dist/components/KeyValueRow/KeyValueRow.mjs.map +1 -0
  245. package/dist/components/KeyValueRow/KeyValueRow.types.cjs +29 -0
  246. package/dist/components/KeyValueRow/KeyValueRow.types.cjs.map +1 -0
  247. package/dist/components/KeyValueRow/KeyValueRow.types.d.cts +177 -0
  248. package/dist/components/KeyValueRow/KeyValueRow.types.d.cts.map +1 -0
  249. package/dist/components/KeyValueRow/KeyValueRow.types.d.mts +177 -0
  250. package/dist/components/KeyValueRow/KeyValueRow.types.d.mts.map +1 -0
  251. package/dist/components/KeyValueRow/KeyValueRow.types.mjs +26 -0
  252. package/dist/components/KeyValueRow/KeyValueRow.types.mjs.map +1 -0
  253. package/dist/components/KeyValueRow/KeyValueRow.utils.cjs +6 -0
  254. package/dist/components/KeyValueRow/KeyValueRow.utils.cjs.map +1 -0
  255. package/dist/components/KeyValueRow/KeyValueRow.utils.d.cts +3 -0
  256. package/dist/components/KeyValueRow/KeyValueRow.utils.d.cts.map +1 -0
  257. package/dist/components/KeyValueRow/KeyValueRow.utils.d.mts +3 -0
  258. package/dist/components/KeyValueRow/KeyValueRow.utils.d.mts.map +1 -0
  259. package/dist/components/KeyValueRow/KeyValueRow.utils.mjs +2 -0
  260. package/dist/components/KeyValueRow/KeyValueRow.utils.mjs.map +1 -0
  261. package/dist/components/KeyValueRow/KeyValueSection/KeyValueSection.cjs +30 -0
  262. package/dist/components/KeyValueRow/KeyValueSection/KeyValueSection.cjs.map +1 -0
  263. package/dist/components/KeyValueRow/KeyValueSection/KeyValueSection.d.cts +16 -0
  264. package/dist/components/KeyValueRow/KeyValueSection/KeyValueSection.d.cts.map +1 -0
  265. package/dist/components/KeyValueRow/KeyValueSection/KeyValueSection.d.mts +16 -0
  266. package/dist/components/KeyValueRow/KeyValueSection/KeyValueSection.d.mts.map +1 -0
  267. package/dist/components/KeyValueRow/KeyValueSection/KeyValueSection.mjs +30 -0
  268. package/dist/components/KeyValueRow/KeyValueSection/KeyValueSection.mjs.map +1 -0
  269. package/dist/components/KeyValueRow/index.cjs +12 -0
  270. package/dist/components/KeyValueRow/index.cjs.map +1 -0
  271. package/dist/components/KeyValueRow/index.d.cts +3 -0
  272. package/dist/components/KeyValueRow/index.d.cts.map +1 -0
  273. package/dist/components/KeyValueRow/index.d.mts +3 -0
  274. package/dist/components/KeyValueRow/index.d.mts.map +1 -0
  275. package/dist/components/KeyValueRow/index.mjs +3 -0
  276. package/dist/components/KeyValueRow/index.mjs.map +1 -0
  277. package/dist/components/Skeleton/Skeleton.cjs +2 -1
  278. package/dist/components/Skeleton/Skeleton.cjs.map +1 -1
  279. package/dist/components/Skeleton/Skeleton.d.cts +1 -2
  280. package/dist/components/Skeleton/Skeleton.d.cts.map +1 -1
  281. package/dist/components/Skeleton/Skeleton.d.mts +1 -2
  282. package/dist/components/Skeleton/Skeleton.d.mts.map +1 -1
  283. package/dist/components/Skeleton/Skeleton.mjs +1 -2
  284. package/dist/components/Skeleton/Skeleton.mjs.map +1 -1
  285. package/dist/components/Skeleton/index.cjs +1 -4
  286. package/dist/components/Skeleton/index.cjs.map +1 -1
  287. package/dist/components/Skeleton/index.d.cts +1 -1
  288. package/dist/components/Skeleton/index.d.cts.map +1 -1
  289. package/dist/components/Skeleton/index.d.mts +1 -1
  290. package/dist/components/Skeleton/index.d.mts.map +1 -1
  291. package/dist/components/Skeleton/index.mjs +1 -1
  292. package/dist/components/Skeleton/index.mjs.map +1 -1
  293. package/dist/components/Text/Text.types.cjs.map +1 -1
  294. package/dist/components/Text/Text.types.d.cts +1 -1
  295. package/dist/components/Text/Text.types.d.mts +1 -1
  296. package/dist/components/Text/Text.types.mjs.map +1 -1
  297. package/dist/components/TextButton/TextButton.cjs +12 -36
  298. package/dist/components/TextButton/TextButton.cjs.map +1 -1
  299. package/dist/components/TextButton/TextButton.d.cts.map +1 -1
  300. package/dist/components/TextButton/TextButton.d.mts.map +1 -1
  301. package/dist/components/TextButton/TextButton.mjs +14 -38
  302. package/dist/components/TextButton/TextButton.mjs.map +1 -1
  303. package/dist/components/TextButton/TextButton.types.cjs.map +1 -1
  304. package/dist/components/TextButton/TextButton.types.d.cts +8 -60
  305. package/dist/components/TextButton/TextButton.types.d.cts.map +1 -1
  306. package/dist/components/TextButton/TextButton.types.d.mts +8 -60
  307. package/dist/components/TextButton/TextButton.types.d.mts.map +1 -1
  308. package/dist/components/TextButton/TextButton.types.mjs.map +1 -1
  309. package/dist/components/TextButton/index.cjs +1 -3
  310. package/dist/components/TextButton/index.cjs.map +1 -1
  311. package/dist/components/TextButton/index.d.cts +0 -1
  312. package/dist/components/TextButton/index.d.cts.map +1 -1
  313. package/dist/components/TextButton/index.d.mts +0 -1
  314. package/dist/components/TextButton/index.d.mts.map +1 -1
  315. package/dist/components/TextButton/index.mjs +0 -1
  316. package/dist/components/TextButton/index.mjs.map +1 -1
  317. package/dist/components/TextField/TextField.cjs +22 -8
  318. package/dist/components/TextField/TextField.cjs.map +1 -1
  319. package/dist/components/TextField/TextField.d.cts +0 -2
  320. package/dist/components/TextField/TextField.d.cts.map +1 -1
  321. package/dist/components/TextField/TextField.d.mts +0 -2
  322. package/dist/components/TextField/TextField.d.mts.map +1 -1
  323. package/dist/components/TextField/TextField.mjs +22 -8
  324. package/dist/components/TextField/TextField.mjs.map +1 -1
  325. package/dist/components/TextField/TextField.types.cjs +0 -10
  326. package/dist/components/TextField/TextField.types.cjs.map +1 -1
  327. package/dist/components/TextField/TextField.types.d.cts +0 -14
  328. package/dist/components/TextField/TextField.types.d.cts.map +1 -1
  329. package/dist/components/TextField/TextField.types.d.mts +0 -14
  330. package/dist/components/TextField/TextField.types.d.mts.map +1 -1
  331. package/dist/components/TextField/TextField.types.mjs +1 -9
  332. package/dist/components/TextField/TextField.types.mjs.map +1 -1
  333. package/dist/components/TextField/index.cjs +1 -3
  334. package/dist/components/TextField/index.cjs.map +1 -1
  335. package/dist/components/TextField/index.d.cts +0 -1
  336. package/dist/components/TextField/index.d.cts.map +1 -1
  337. package/dist/components/TextField/index.d.mts +0 -1
  338. package/dist/components/TextField/index.d.mts.map +1 -1
  339. package/dist/components/TextField/index.mjs +0 -1
  340. package/dist/components/TextField/index.mjs.map +1 -1
  341. package/dist/components/TextFieldSearch/TextFieldSearch.cjs +45 -0
  342. package/dist/components/TextFieldSearch/TextFieldSearch.cjs.map +1 -0
  343. package/dist/components/TextFieldSearch/TextFieldSearch.d.cts +14 -0
  344. package/dist/components/TextFieldSearch/TextFieldSearch.d.cts.map +1 -0
  345. package/dist/components/TextFieldSearch/TextFieldSearch.d.mts +14 -0
  346. package/dist/components/TextFieldSearch/TextFieldSearch.d.mts.map +1 -0
  347. package/dist/components/TextFieldSearch/TextFieldSearch.mjs +26 -0
  348. package/dist/components/TextFieldSearch/TextFieldSearch.mjs.map +1 -0
  349. package/dist/components/TextFieldSearch/TextFieldSearch.types.cjs +3 -0
  350. package/dist/components/TextFieldSearch/TextFieldSearch.types.cjs.map +1 -0
  351. package/dist/components/TextFieldSearch/TextFieldSearch.types.d.cts +17 -0
  352. package/dist/components/TextFieldSearch/TextFieldSearch.types.d.cts.map +1 -0
  353. package/dist/components/TextFieldSearch/TextFieldSearch.types.d.mts +17 -0
  354. package/dist/components/TextFieldSearch/TextFieldSearch.types.d.mts.map +1 -0
  355. package/dist/components/TextFieldSearch/TextFieldSearch.types.mjs +2 -0
  356. package/dist/components/TextFieldSearch/TextFieldSearch.types.mjs.map +1 -0
  357. package/dist/components/TextFieldSearch/index.cjs +6 -0
  358. package/dist/components/TextFieldSearch/index.cjs.map +1 -0
  359. package/dist/components/TextFieldSearch/index.d.cts +3 -0
  360. package/dist/components/TextFieldSearch/index.d.cts.map +1 -0
  361. package/dist/components/TextFieldSearch/index.d.mts +3 -0
  362. package/dist/components/TextFieldSearch/index.d.mts.map +1 -0
  363. package/dist/components/TextFieldSearch/index.mjs +2 -0
  364. package/dist/components/TextFieldSearch/index.mjs.map +1 -0
  365. package/dist/components/Toast/Toast.cjs +2 -2
  366. package/dist/components/Toast/Toast.cjs.map +1 -1
  367. package/dist/components/Toast/Toast.d.cts +1 -2
  368. package/dist/components/Toast/Toast.d.cts.map +1 -1
  369. package/dist/components/Toast/Toast.d.mts +1 -2
  370. package/dist/components/Toast/Toast.d.mts.map +1 -1
  371. package/dist/components/Toast/Toast.mjs +1 -2
  372. package/dist/components/Toast/Toast.mjs.map +1 -1
  373. package/dist/components/Toast/index.cjs +1 -4
  374. package/dist/components/Toast/index.cjs.map +1 -1
  375. package/dist/components/Toast/index.d.cts +1 -1
  376. package/dist/components/Toast/index.d.cts.map +1 -1
  377. package/dist/components/Toast/index.d.mts +1 -1
  378. package/dist/components/Toast/index.d.mts.map +1 -1
  379. package/dist/components/Toast/index.mjs +1 -1
  380. package/dist/components/Toast/index.mjs.map +1 -1
  381. package/dist/components/index.cjs +14 -8
  382. package/dist/components/index.cjs.map +1 -1
  383. package/dist/components/index.d.cts +13 -3
  384. package/dist/components/index.d.cts.map +1 -1
  385. package/dist/components/index.d.mts +13 -3
  386. package/dist/components/index.d.mts.map +1 -1
  387. package/dist/components/index.mjs +8 -3
  388. package/dist/components/index.mjs.map +1 -1
  389. package/dist/components/temp-components/TextOrChildren/TextOrChildren.types.cjs.map +1 -1
  390. package/dist/components/temp-components/TextOrChildren/TextOrChildren.types.d.cts +2 -5
  391. package/dist/components/temp-components/TextOrChildren/TextOrChildren.types.d.cts.map +1 -1
  392. package/dist/components/temp-components/TextOrChildren/TextOrChildren.types.d.mts +2 -5
  393. package/dist/components/temp-components/TextOrChildren/TextOrChildren.types.d.mts.map +1 -1
  394. package/dist/components/temp-components/TextOrChildren/TextOrChildren.types.mjs.map +1 -1
  395. package/dist/types/index.cjs +20 -71
  396. package/dist/types/index.cjs.map +1 -1
  397. package/dist/types/index.d.cts +10 -82
  398. package/dist/types/index.d.cts.map +1 -1
  399. package/dist/types/index.d.mts +10 -82
  400. package/dist/types/index.d.mts.map +1 -1
  401. package/dist/types/index.mjs +10 -78
  402. package/dist/types/index.mjs.map +1 -1
  403. package/package.json +7 -8
  404. package/dist/components/TextButton/TextButton.constants.cjs +0 -12
  405. package/dist/components/TextButton/TextButton.constants.cjs.map +0 -1
  406. package/dist/components/TextButton/TextButton.constants.d.cts +0 -4
  407. package/dist/components/TextButton/TextButton.constants.d.cts.map +0 -1
  408. package/dist/components/TextButton/TextButton.constants.d.mts +0 -4
  409. package/dist/components/TextButton/TextButton.constants.d.mts.map +0 -1
  410. package/dist/components/TextButton/TextButton.constants.mjs +0 -9
  411. package/dist/components/TextButton/TextButton.constants.mjs.map +0 -1
  412. package/dist/components/TextField/TextField.constants.cjs +0 -13
  413. package/dist/components/TextField/TextField.constants.cjs.map +0 -1
  414. package/dist/components/TextField/TextField.constants.d.cts +0 -6
  415. package/dist/components/TextField/TextField.constants.d.cts.map +0 -1
  416. package/dist/components/TextField/TextField.constants.d.mts +0 -6
  417. package/dist/components/TextField/TextField.constants.d.mts.map +0 -1
  418. package/dist/components/TextField/TextField.constants.mjs +0 -10
  419. package/dist/components/TextField/TextField.constants.mjs.map +0 -1
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.AvatarBase = exports.AvatarBaseShape = exports.AvatarBaseSize = void 0;
4
- var types_1 = require("../../types/index.cjs");
5
- Object.defineProperty(exports, "AvatarBaseSize", { enumerable: true, get: function () { return types_1.AvatarBaseSize; } });
6
- Object.defineProperty(exports, "AvatarBaseShape", { enumerable: true, get: function () { return types_1.AvatarBaseShape; } });
4
+ var design_system_shared_1 = require("@metamask-previews/design-system-shared");
5
+ Object.defineProperty(exports, "AvatarBaseSize", { enumerable: true, get: function () { return design_system_shared_1.AvatarBaseSize; } });
6
+ Object.defineProperty(exports, "AvatarBaseShape", { enumerable: true, get: function () { return design_system_shared_1.AvatarBaseShape; } });
7
7
  var AvatarBase_1 = require("./AvatarBase.cjs");
8
8
  Object.defineProperty(exports, "AvatarBase", { enumerable: true, get: function () { return AvatarBase_1.AvatarBase; } });
9
9
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../../src/components/AvatarBase/index.ts"],"names":[],"mappings":";;;AAAA,+CAA8D;AAArD,uGAAA,cAAc,OAAA;AAAE,wGAAA,eAAe,OAAA;AACxC,+CAA0C;AAAjC,wGAAA,UAAU,OAAA","sourcesContent":["export { AvatarBaseSize, AvatarBaseShape } from '../../types';\nexport { AvatarBase } from './AvatarBase';\nexport type { AvatarBaseProps } from './AvatarBase.types';\n"]}
1
+ {"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../../src/components/AvatarBase/index.ts"],"names":[],"mappings":";;;AAAA,gFAGiD;AAF/C,sHAAA,cAAc,OAAA;AACd,uHAAA,eAAe,OAAA;AAEjB,+CAA0C;AAAjC,wGAAA,UAAU,OAAA","sourcesContent":["export {\n AvatarBaseSize,\n AvatarBaseShape,\n} from '@metamask-previews/design-system-shared';\nexport { AvatarBase } from './AvatarBase';\nexport type { AvatarBaseProps } from './AvatarBase.types';\n"]}
@@ -1,4 +1,4 @@
1
- export { AvatarBaseSize, AvatarBaseShape } from "../../types/index.cjs";
1
+ export { AvatarBaseSize, AvatarBaseShape, } from "@metamask-previews/design-system-shared";
2
2
  export { AvatarBase } from "./AvatarBase.cjs";
3
3
  export type { AvatarBaseProps } from "./AvatarBase.types.cjs";
4
4
  //# sourceMappingURL=index.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/components/AvatarBase/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,8BAAoB;AAC9D,OAAO,EAAE,UAAU,EAAE,yBAAqB;AAC1C,YAAY,EAAE,eAAe,EAAE,+BAA2B"}
1
+ {"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/components/AvatarBase/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,eAAe,GAChB,gDAAgD;AACjD,OAAO,EAAE,UAAU,EAAE,yBAAqB;AAC1C,YAAY,EAAE,eAAe,EAAE,+BAA2B"}
@@ -1,4 +1,4 @@
1
- export { AvatarBaseSize, AvatarBaseShape } from "../../types/index.mjs";
1
+ export { AvatarBaseSize, AvatarBaseShape, } from "@metamask-previews/design-system-shared";
2
2
  export { AvatarBase } from "./AvatarBase.mjs";
3
3
  export type { AvatarBaseProps } from "./AvatarBase.types.mjs";
4
4
  //# sourceMappingURL=index.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../src/components/AvatarBase/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,8BAAoB;AAC9D,OAAO,EAAE,UAAU,EAAE,yBAAqB;AAC1C,YAAY,EAAE,eAAe,EAAE,+BAA2B"}
1
+ {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../src/components/AvatarBase/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,eAAe,GAChB,gDAAgD;AACjD,OAAO,EAAE,UAAU,EAAE,yBAAqB;AAC1C,YAAY,EAAE,eAAe,EAAE,+BAA2B"}
@@ -1,3 +1,3 @@
1
- export { AvatarBaseSize, AvatarBaseShape } from "../../types/index.mjs";
1
+ export { AvatarBaseSize, AvatarBaseShape } from "@metamask-previews/design-system-shared";
2
2
  export { AvatarBase } from "./AvatarBase.mjs";
3
3
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../src/components/AvatarBase/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,8BAAoB;AAC9D,OAAO,EAAE,UAAU,EAAE,yBAAqB","sourcesContent":["export { AvatarBaseSize, AvatarBaseShape } from '../../types';\nexport { AvatarBase } from './AvatarBase';\nexport type { AvatarBaseProps } from './AvatarBase.types';\n"]}
1
+ {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../src/components/AvatarBase/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,eAAe,EAChB,gDAAgD;AACjD,OAAO,EAAE,UAAU,EAAE,yBAAqB","sourcesContent":["export {\n AvatarBaseSize,\n AvatarBaseShape,\n} from '@metamask-previews/design-system-shared';\nexport { AvatarBase } from './AvatarBase';\nexport type { AvatarBaseProps } from './AvatarBase.types';\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"AvatarNetwork.types.cjs","sourceRoot":"","sources":["../../../src/components/AvatarNetwork/AvatarNetwork.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { AvatarBaseProps } from '../AvatarBase';\nimport type {\n ImageOrSvgProps,\n ImageOrSvgSrc,\n} from '../temp-components/ImageOrSvg';\n\n/**\n * AvatarNetwork component props.\n */\nexport type AvatarNetworkProps = {\n /**\n * Optional prop for the source of the image or SVG.\n */\n src?: ImageOrSvgSrc;\n /**\n * Optional props for network name, to be used to calculate the fallbackText.\n */\n name?: string;\n /**\n * Optional prop to pass to the underlying ImageOrSvg element\n * Useful for overriding the default alt text which is the dapp name\n */\n imageOrSvgProps?: Partial<ImageOrSvgProps>;\n} & Omit<AvatarBaseProps, 'children'>;\n"]}
1
+ {"version":3,"file":"AvatarNetwork.types.cjs","sourceRoot":"","sources":["../../../src/components/AvatarNetwork/AvatarNetwork.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { AvatarNetworkPropsShared } from '@metamask-previews/design-system-shared';\n\nimport type { AvatarBaseProps } from '../AvatarBase';\nimport type {\n ImageOrSvgProps,\n ImageOrSvgSrc,\n} from '../temp-components/ImageOrSvg';\n\n/**\n * AvatarNetwork component props (React Native platform-specific)\n * Extends shared props from @metamask-previews/design-system-shared with React Native-specific platform concerns\n */\nexport type AvatarNetworkProps = AvatarNetworkPropsShared &\n Omit<AvatarBaseProps, 'children'> & {\n /**\n * Optional prop for the source of the image or SVG.\n */\n src?: ImageOrSvgSrc;\n /**\n * Optional prop to pass to the underlying ImageOrSvg element.\n * Useful for overriding the default alt text which is the network name.\n */\n imageOrSvgProps?: Partial<ImageOrSvgProps>;\n };\n"]}
@@ -1,21 +1,19 @@
1
+ import type { AvatarNetworkPropsShared } from "@metamask-previews/design-system-shared";
1
2
  import type { AvatarBaseProps } from "../AvatarBase/index.cjs";
2
3
  import type { ImageOrSvgProps, ImageOrSvgSrc } from "../temp-components/ImageOrSvg/index.cjs";
3
4
  /**
4
- * AvatarNetwork component props.
5
+ * AvatarNetwork component props (React Native platform-specific)
6
+ * Extends shared props from @metamask-previews/design-system-shared with React Native-specific platform concerns
5
7
  */
6
- export type AvatarNetworkProps = {
8
+ export type AvatarNetworkProps = AvatarNetworkPropsShared & Omit<AvatarBaseProps, 'children'> & {
7
9
  /**
8
10
  * Optional prop for the source of the image or SVG.
9
11
  */
10
12
  src?: ImageOrSvgSrc;
11
13
  /**
12
- * Optional props for network name, to be used to calculate the fallbackText.
13
- */
14
- name?: string;
15
- /**
16
- * Optional prop to pass to the underlying ImageOrSvg element
17
- * Useful for overriding the default alt text which is the dapp name
14
+ * Optional prop to pass to the underlying ImageOrSvg element.
15
+ * Useful for overriding the default alt text which is the network name.
18
16
  */
19
17
  imageOrSvgProps?: Partial<ImageOrSvgProps>;
20
- } & Omit<AvatarBaseProps, 'children'>;
18
+ };
21
19
  //# sourceMappingURL=AvatarNetwork.types.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"AvatarNetwork.types.d.cts","sourceRoot":"","sources":["../../../src/components/AvatarNetwork/AvatarNetwork.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,gCAAsB;AACrD,OAAO,KAAK,EACV,eAAe,EACf,aAAa,EACd,gDAAsC;AAEvC;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG;IAC/B;;OAEG;IACH,GAAG,CAAC,EAAE,aAAa,CAAC;IACpB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,CAAC;CAC5C,GAAG,IAAI,CAAC,eAAe,EAAE,UAAU,CAAC,CAAC"}
1
+ {"version":3,"file":"AvatarNetwork.types.d.cts","sourceRoot":"","sources":["../../../src/components/AvatarNetwork/AvatarNetwork.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,gDAAgD;AAExF,OAAO,KAAK,EAAE,eAAe,EAAE,gCAAsB;AACrD,OAAO,KAAK,EACV,eAAe,EACf,aAAa,EACd,gDAAsC;AAEvC;;;GAGG;AACH,MAAM,MAAM,kBAAkB,GAAG,wBAAwB,GACvD,IAAI,CAAC,eAAe,EAAE,UAAU,CAAC,GAAG;IAClC;;OAEG;IACH,GAAG,CAAC,EAAE,aAAa,CAAC;IACpB;;;OAGG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,CAAC;CAC5C,CAAC"}
@@ -1,21 +1,19 @@
1
+ import type { AvatarNetworkPropsShared } from "@metamask-previews/design-system-shared";
1
2
  import type { AvatarBaseProps } from "../AvatarBase/index.mjs";
2
3
  import type { ImageOrSvgProps, ImageOrSvgSrc } from "../temp-components/ImageOrSvg/index.mjs";
3
4
  /**
4
- * AvatarNetwork component props.
5
+ * AvatarNetwork component props (React Native platform-specific)
6
+ * Extends shared props from @metamask-previews/design-system-shared with React Native-specific platform concerns
5
7
  */
6
- export type AvatarNetworkProps = {
8
+ export type AvatarNetworkProps = AvatarNetworkPropsShared & Omit<AvatarBaseProps, 'children'> & {
7
9
  /**
8
10
  * Optional prop for the source of the image or SVG.
9
11
  */
10
12
  src?: ImageOrSvgSrc;
11
13
  /**
12
- * Optional props for network name, to be used to calculate the fallbackText.
13
- */
14
- name?: string;
15
- /**
16
- * Optional prop to pass to the underlying ImageOrSvg element
17
- * Useful for overriding the default alt text which is the dapp name
14
+ * Optional prop to pass to the underlying ImageOrSvg element.
15
+ * Useful for overriding the default alt text which is the network name.
18
16
  */
19
17
  imageOrSvgProps?: Partial<ImageOrSvgProps>;
20
- } & Omit<AvatarBaseProps, 'children'>;
18
+ };
21
19
  //# sourceMappingURL=AvatarNetwork.types.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"AvatarNetwork.types.d.mts","sourceRoot":"","sources":["../../../src/components/AvatarNetwork/AvatarNetwork.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,gCAAsB;AACrD,OAAO,KAAK,EACV,eAAe,EACf,aAAa,EACd,gDAAsC;AAEvC;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG;IAC/B;;OAEG;IACH,GAAG,CAAC,EAAE,aAAa,CAAC;IACpB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,CAAC;CAC5C,GAAG,IAAI,CAAC,eAAe,EAAE,UAAU,CAAC,CAAC"}
1
+ {"version":3,"file":"AvatarNetwork.types.d.mts","sourceRoot":"","sources":["../../../src/components/AvatarNetwork/AvatarNetwork.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,gDAAgD;AAExF,OAAO,KAAK,EAAE,eAAe,EAAE,gCAAsB;AACrD,OAAO,KAAK,EACV,eAAe,EACf,aAAa,EACd,gDAAsC;AAEvC;;;GAGG;AACH,MAAM,MAAM,kBAAkB,GAAG,wBAAwB,GACvD,IAAI,CAAC,eAAe,EAAE,UAAU,CAAC,GAAG;IAClC;;OAEG;IACH,GAAG,CAAC,EAAE,aAAa,CAAC;IACpB;;;OAGG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,CAAC;CAC5C,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"AvatarNetwork.types.mjs","sourceRoot":"","sources":["../../../src/components/AvatarNetwork/AvatarNetwork.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { AvatarBaseProps } from '../AvatarBase';\nimport type {\n ImageOrSvgProps,\n ImageOrSvgSrc,\n} from '../temp-components/ImageOrSvg';\n\n/**\n * AvatarNetwork component props.\n */\nexport type AvatarNetworkProps = {\n /**\n * Optional prop for the source of the image or SVG.\n */\n src?: ImageOrSvgSrc;\n /**\n * Optional props for network name, to be used to calculate the fallbackText.\n */\n name?: string;\n /**\n * Optional prop to pass to the underlying ImageOrSvg element\n * Useful for overriding the default alt text which is the dapp name\n */\n imageOrSvgProps?: Partial<ImageOrSvgProps>;\n} & Omit<AvatarBaseProps, 'children'>;\n"]}
1
+ {"version":3,"file":"AvatarNetwork.types.mjs","sourceRoot":"","sources":["../../../src/components/AvatarNetwork/AvatarNetwork.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { AvatarNetworkPropsShared } from '@metamask-previews/design-system-shared';\n\nimport type { AvatarBaseProps } from '../AvatarBase';\nimport type {\n ImageOrSvgProps,\n ImageOrSvgSrc,\n} from '../temp-components/ImageOrSvg';\n\n/**\n * AvatarNetwork component props (React Native platform-specific)\n * Extends shared props from @metamask-previews/design-system-shared with React Native-specific platform concerns\n */\nexport type AvatarNetworkProps = AvatarNetworkPropsShared &\n Omit<AvatarBaseProps, 'children'> & {\n /**\n * Optional prop for the source of the image or SVG.\n */\n src?: ImageOrSvgSrc;\n /**\n * Optional prop to pass to the underlying ImageOrSvg element.\n * Useful for overriding the default alt text which is the network name.\n */\n imageOrSvgProps?: Partial<ImageOrSvgProps>;\n };\n"]}
@@ -24,11 +24,11 @@ var __importStar = (this && this.__importStar) || function (mod) {
24
24
  };
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
26
  exports.BadgeWrapper = void 0;
27
+ const design_system_shared_1 = require("@metamask-previews/design-system-shared");
27
28
  const design_system_twrnc_preset_1 = require("@metamask-previews/design-system-twrnc-preset");
28
29
  const react_1 = __importStar(require("react"));
29
30
  const react_native_1 = require("react-native/index.js");
30
- const types_1 = require("../../types/index.cjs");
31
- const BadgeWrapper = ({ children, childrenContainerProps, badge, badgeContainerProps, position = types_1.BadgeWrapperPosition.BottomRight, positionAnchorShape = types_1.BadgeWrapperPositionAnchorShape.Circular, positionXOffset = 0, positionYOffset = 0, customPosition, twClassName, style, ...props }) => {
31
+ const BadgeWrapper = ({ children, childrenContainerProps, badge, badgeContainerProps, position = design_system_shared_1.BadgeWrapperPosition.BottomRight, positionAnchorShape = design_system_shared_1.BadgeWrapperPositionAnchorShape.Circular, positionXOffset = 0, positionYOffset = 0, customPosition, twClassName, style, ...props }) => {
32
32
  const tw = (0, design_system_twrnc_preset_1.useTailwind)();
33
33
  const [anchorWidth, setAnchorWidth] = (0, react_1.useState)(0);
34
34
  const [anchorHeight, setAnchorHeight] = (0, react_1.useState)(0);
@@ -52,10 +52,10 @@ const BadgeWrapper = ({ children, childrenContainerProps, badge, badgeContainerP
52
52
  // 0.1464 is a mathematical coeeficient to move
53
53
  // from a 0,0 corner of a rectangular shape to the closest "corner"
54
54
  // of a circular shape anchor element
55
- const anchorShapeXOffset = positionAnchorShape === types_1.BadgeWrapperPositionAnchorShape.Rectangular
55
+ const anchorShapeXOffset = positionAnchorShape === design_system_shared_1.BadgeWrapperPositionAnchorShape.Rectangular
56
56
  ? 0
57
57
  : anchorWidth * 0.1464;
58
- const anchorShapeYOffset = positionAnchorShape === types_1.BadgeWrapperPositionAnchorShape.Rectangular
58
+ const anchorShapeYOffset = positionAnchorShape === design_system_shared_1.BadgeWrapperPositionAnchorShape.Rectangular
59
59
  ? 0
60
60
  : anchorHeight * 0.1464;
61
61
  // This is to center the badge in the corner of the anchor element
@@ -64,22 +64,22 @@ const BadgeWrapper = ({ children, childrenContainerProps, badge, badgeContainerP
64
64
  const finalXOffset = anchorShapeXOffset - badgeCenteringXOffset + positionXOffset;
65
65
  const finalYOffset = anchorShapeYOffset - badgeCenteringYOffset + positionYOffset;
66
66
  switch (position) {
67
- case types_1.BadgeWrapperPosition.TopRight:
67
+ case design_system_shared_1.BadgeWrapperPosition.TopRight:
68
68
  return {
69
69
  top: finalYOffset,
70
70
  right: finalXOffset,
71
71
  };
72
- case types_1.BadgeWrapperPosition.BottomLeft:
72
+ case design_system_shared_1.BadgeWrapperPosition.BottomLeft:
73
73
  return {
74
74
  bottom: finalYOffset,
75
75
  left: finalXOffset,
76
76
  };
77
- case types_1.BadgeWrapperPosition.TopLeft:
77
+ case design_system_shared_1.BadgeWrapperPosition.TopLeft:
78
78
  return {
79
79
  top: finalYOffset,
80
80
  left: finalXOffset,
81
81
  };
82
- case types_1.BadgeWrapperPosition.BottomRight:
82
+ case design_system_shared_1.BadgeWrapperPosition.BottomRight:
83
83
  default:
84
84
  return {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K,4BAAoB,CAAC,WAAW,CAAC;YACtC;gBACE,OAAO;oBACL,MAAM,EAAE,YAAY;oBACpB,KAAK,EAAE,YAAY;iBACpB,CAAC;SACL;IACH,CAAC,EAAE;QACD,QAAQ;QACR,mBAAmB;QACnB,WAAW;QACX,YAAY;QACZ,UAAU;QACV,WAAW;QACX,eAAe;QACf,eAAe;QACf,cAAc;KACf,CAAC,CAAC;IAEH,OAAO,CACL,CAAC,mBAAI,CACH,IAAI,KAAK,CAAC,CACV,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,qBAAqB,EAAE,WAAW,CAAC,EAAE,KAAK,CAAC,CAAC,CAE7D;MAAA,CAAC,mBAAI,CAAC,QAAQ,CAAC,CAAC,aAAa,CAAC,CAAC,IAAI,sBAAsB,CAAC,CACxD;QAAA,CAAC,QAAQ,CACX;MAAA,EAAE,mBAAI,CACN;MAAA,CAAC,mBAAI,CACH,QAAQ,CAAC,CAAC,YAAY,CAAC,CACvB,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,UAAU,CAAC,EAAE,EAAE,GAAG,cAAc,EAAE,CAAC,CAAC,CACrD,IAAI,mBAAmB,CAAC,CAExB;QAAA,CAAC,KAAK,CACR;MAAA,EAAE,mBAAI,CACR;IAAA,EAAE,mBAAI,CAAC,CACR,CAAC;AACJ,CAAC,CAAC;AA3GW,QAAA,YAAY,gBA2GvB","sourcesContent":["import { useTailwind } from '@metamask-previews/design-system-twrnc-preset';\nimport React, { useCallback, useState, useMemo } from 'react';\nimport type { LayoutChangeEvent } from 'react-native';\nimport { View } from 'react-native';\n\nimport {\n BadgeWrapperPosition,\n BadgeWrapperPositionAnchorShape,\n} from '../../types';\n\nimport type { BadgeWrapperProps } from './BadgeWrapper.types';\n\nexport const BadgeWrapper = ({\n children,\n childrenContainerProps,\n badge,\n badgeContainerProps,\n position = BadgeWrapperPosition.BottomRight,\n positionAnchorShape = BadgeWrapperPositionAnchorShape.Circular,\n positionXOffset = 0,\n positionYOffset = 0,\n customPosition,\n twClassName,\n style,\n ...props\n}: BadgeWrapperProps) => {\n const tw = useTailwind();\n const [anchorWidth, setAnchorWidth] = useState<number>(0);\n const [anchorHeight, setAnchorHeight] = useState<number>(0);\n const [badgeWidth, setbadgeWidth] = useState<number>(0);\n const [badgeHeight, setbadgeHeight] = useState<number>(0);\n\n // Fetching the dimensions of the anchor and bagde element to properly position the badge\n const getAnchorSize = useCallback((event: LayoutChangeEvent) => {\n const { width, height } = event.nativeEvent.layout;\n setAnchorWidth(width);\n setAnchorHeight(height);\n }, []);\n const getBadgeSize = useCallback((event: LayoutChangeEvent) => {\n const { width, height } = event.nativeEvent.layout;\n setbadgeWidth(width);\n setbadgeHeight(height);\n }, []);\n\n const finalPositions = useMemo(() => {\n if (customPosition) {\n return customPosition;\n }\n // 0.1464 is a mathematical coeeficient to move\n // from a 0,0 corner of a rectangular shape to the closest \"corner\"\n // of a circular shape anchor element\n const anchorShapeXOffset =\n positionAnchorShape === BadgeWrapperPositionAnchorShape.Rectangular\n ? 0\n : anchorWidth * 0.1464;\n const anchorShapeYOffset =\n positionAnchorShape === BadgeWrapperPositionAnchorShape.Rectangular\n ? 0\n : anchorHeight * 0.1464;\n // This is to center the badge in the corner of the anchor element\n const badgeCenteringXOffset = badgeWidth / 2;\n const badgeCenteringYOffset = badgeHeight / 2;\n\n const finalXOffset =\n anchorShapeXOffset - badgeCenteringXOffset + positionXOffset;\n const finalYOffset =\n anchorShapeYOffset - badgeCenteringYOffset + positionYOffset;\n switch (position) {\n case BadgeWrapperPosition.TopRight:\n return {\n top: finalYOffset,\n right: finalXOffset,\n };\n case BadgeWrapperPosition.BottomLeft:\n return {\n bottom: finalYOffset,\n left: finalXOffset,\n };\n case BadgeWrapperPosition.TopLeft:\n return {\n top: finalYOffset,\n left: finalXOffset,\n };\n case BadgeWrapperPosition.BottomRight:\n default:\n return {\n bottom: finalYOffset,\n right: finalXOffset,\n };\n }\n }, [\n position,\n positionAnchorShape,\n anchorWidth,\n anchorHeight,\n badgeWidth,\n badgeHeight,\n positionXOffset,\n positionYOffset,\n customPosition,\n ]);\n\n return (\n <View\n {...props}\n style={[tw.style('relative self-start', twClassName), style]}\n >\n <View onLayout={getAnchorSize} {...childrenContainerProps}>\n {children}\n </View>\n <View\n onLayout={getBadgeSize}\n style={[tw.style('absolute'), { ...finalPositions }]}\n {...badgeContainerProps}\n >\n {badge}\n </View>\n </View>\n );\n};\n"]}
1
+ {"version":3,"file":"BadgeWrapper.cjs","sourceRoot":"","sources":["../../../src/components/BadgeWrapper/BadgeWrapper.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kFAGiD;AACjD,8FAA4E;AAC5E,+CAA8D;AAE9D,wDAAoC;AAI7B,MAAM,YAAY,GAAG,CAAC,EAC3B,QAAQ,EACR,sBAAsB,EACtB,KAAK,EACL,mBAAmB,EACnB,QAAQ,GAAG,2CAAoB,CAAC,WAAW,EAC3C,mBAAmB,GAAG,sDAA+B,CAAC,QAAQ,EAC9D,eAAe,GAAG,CAAC,EACnB,eAAe,GAAG,CAAC,EACnB,cAAc,EACd,WAAW,EACX,KAAK,EACL,GAAG,KAAK,EACU,EAAE,EAAE;IACtB,MAAM,EAAE,GAAG,IAAA,wCAAW,GAAE,CAAC;IACzB,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,IAAA,gBAAQ,EAAS,CAAC,CAAC,CAAC;IAC1D,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,IAAA,gBAAQ,EAAS,CAAC,CAAC,CAAC;IAC5D,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,IAAA,gBAAQ,EAAS,CAAC,CAAC,CAAC;IACxD,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,IAAA,gBAAQ,EAAS,CAAC,CAAC,CAAC;IAE1D,yFAAyF;IACzF,MAAM,aAAa,GAAG,IAAA,mBAAW,EAAC,CAAC,KAAwB,EAAE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AAE,YAAY;iBACpB,CAAC;YACJ,KAAK,2CAAoB,CAAC,UAAU;gBAClC,OAAO;oBACL,MAAM,EAAE,YAAY;oBACpB,IAAI,EAAE,YAAY;iBACnB,CAAC;YACJ,KAAK,2CAAoB,CAAC,OAAO;gBAC/B,OAAO;oBACL,GAAG,EAAE,YAAY;oBACjB,IAAI,EAAE,YAAY;iBACnB,CAAC;YACJ,KAAK,2CAAoB,CAAC,WAAW,CAAC;YACtC;gBACE,OAAO;oBACL,MAAM,EAAE,YAAY;oBACpB,KAAK,EAAE,YAAY;iBACpB,CAAC;SACL;IACH,CAAC,EAAE;QACD,QAAQ;QACR,mBAAmB;QACnB,WAAW;QACX,YAAY;QACZ,UAAU;QACV,WAAW;QACX,eAAe;QACf,eAAe;QACf,cAAc;KACf,CAAC,CAAC;IAEH,OAAO,CACL,CAAC,mBAAI,CACH,IAAI,KAAK,CAAC,CACV,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,qBAAqB,EAAE,WAAW,CAAC,EAAE,KAAK,CAAC,CAAC,CAE7D;MAAA,CAAC,mBAAI,CAAC,QAAQ,CAAC,CAAC,aAAa,CAAC,CAAC,IAAI,sBAAsB,CAAC,CACxD;QAAA,CAAC,QAAQ,CACX;MAAA,EAAE,mBAAI,CACN;MAAA,CAAC,mBAAI,CACH,QAAQ,CAAC,CAAC,YAAY,CAAC,CACvB,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,UAAU,CAAC,EAAE,EAAE,GAAG,cAAc,EAAE,CAAC,CAAC,CACrD,IAAI,mBAAmB,CAAC,CAExB;QAAA,CAAC,KAAK,CACR;MAAA,EAAE,mBAAI,CACR;IAAA,EAAE,mBAAI,CAAC,CACR,CAAC;AACJ,CAAC,CAAC;AA3GW,QAAA,YAAY,gBA2GvB","sourcesContent":["import {\n BadgeWrapperPosition,\n BadgeWrapperPositionAnchorShape,\n} from '@metamask-previews/design-system-shared';\nimport { useTailwind } from '@metamask-previews/design-system-twrnc-preset';\nimport React, { useCallback, useState, useMemo } from 'react';\nimport type { LayoutChangeEvent } from 'react-native';\nimport { View } from 'react-native';\n\nimport type { BadgeWrapperProps } from './BadgeWrapper.types';\n\nexport const BadgeWrapper = ({\n children,\n childrenContainerProps,\n badge,\n badgeContainerProps,\n position = BadgeWrapperPosition.BottomRight,\n positionAnchorShape = BadgeWrapperPositionAnchorShape.Circular,\n positionXOffset = 0,\n positionYOffset = 0,\n customPosition,\n twClassName,\n style,\n ...props\n}: BadgeWrapperProps) => {\n const tw = useTailwind();\n const [anchorWidth, setAnchorWidth] = useState<number>(0);\n const [anchorHeight, setAnchorHeight] = useState<number>(0);\n const [badgeWidth, setbadgeWidth] = useState<number>(0);\n const [badgeHeight, setbadgeHeight] = useState<number>(0);\n\n // Fetching the dimensions of the anchor and bagde element to properly position the badge\n const getAnchorSize = useCallback((event: LayoutChangeEvent) => {\n const { width, height } = event.nativeEvent.layout;\n setAnchorWidth(width);\n setAnchorHeight(height);\n }, []);\n const getBadgeSize = useCallback((event: LayoutChangeEvent) => {\n const { width, height } = event.nativeEvent.layout;\n setbadgeWidth(width);\n setbadgeHeight(height);\n }, []);\n\n const finalPositions = useMemo(() => {\n if (customPosition) {\n return customPosition;\n }\n // 0.1464 is a mathematical coeeficient to move\n // from a 0,0 corner of a rectangular shape to the closest \"corner\"\n // of a circular shape anchor element\n const anchorShapeXOffset =\n positionAnchorShape === BadgeWrapperPositionAnchorShape.Rectangular\n ? 0\n : anchorWidth * 0.1464;\n const anchorShapeYOffset =\n positionAnchorShape === BadgeWrapperPositionAnchorShape.Rectangular\n ? 0\n : anchorHeight * 0.1464;\n // This is to center the badge in the corner of the anchor element\n const badgeCenteringXOffset = badgeWidth / 2;\n const badgeCenteringYOffset = badgeHeight / 2;\n\n const finalXOffset =\n anchorShapeXOffset - badgeCenteringXOffset + positionXOffset;\n const finalYOffset =\n anchorShapeYOffset - badgeCenteringYOffset + positionYOffset;\n switch (position) {\n case BadgeWrapperPosition.TopRight:\n return {\n top: finalYOffset,\n right: finalXOffset,\n };\n case BadgeWrapperPosition.BottomLeft:\n return {\n bottom: finalYOffset,\n left: finalXOffset,\n };\n case BadgeWrapperPosition.TopLeft:\n return {\n top: finalYOffset,\n left: finalXOffset,\n };\n case BadgeWrapperPosition.BottomRight:\n default:\n return {\n bottom: finalYOffset,\n right: finalXOffset,\n };\n }\n }, [\n position,\n positionAnchorShape,\n anchorWidth,\n anchorHeight,\n badgeWidth,\n badgeHeight,\n positionXOffset,\n positionYOffset,\n customPosition,\n ]);\n\n return (\n <View\n {...props}\n style={[tw.style('relative self-start', twClassName), style]}\n >\n <View onLayout={getAnchorSize} {...childrenContainerProps}>\n {children}\n </View>\n <View\n onLayout={getBadgeSize}\n style={[tw.style('absolute'), { ...finalPositions }]}\n {...badgeContainerProps}\n >\n {badge}\n </View>\n </View>\n );\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"BadgeWrapper.d.cts","sourceRoot":"","sources":["../../../src/components/BadgeWrapper/BadgeWrapper.tsx"],"names":[],"mappings":"AACA,OAAO,KAAyC,cAAc;AAS9D,OAAO,KAAK,EAAE,iBAAiB,EAAE,iCAA6B;AAE9D,eAAO,MAAM,YAAY,oLAatB,iBAAiB,sBA8FnB,CAAC"}
1
+ {"version":3,"file":"BadgeWrapper.d.cts","sourceRoot":"","sources":["../../../src/components/BadgeWrapper/BadgeWrapper.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAyC,cAAc;AAI9D,OAAO,KAAK,EAAE,iBAAiB,EAAE,iCAA6B;AAE9D,eAAO,MAAM,YAAY,oLAatB,iBAAiB,sBA8FnB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"BadgeWrapper.d.mts","sourceRoot":"","sources":["../../../src/components/BadgeWrapper/BadgeWrapper.tsx"],"names":[],"mappings":"AACA,OAAO,KAAyC,cAAc;AAS9D,OAAO,KAAK,EAAE,iBAAiB,EAAE,iCAA6B;AAE9D,eAAO,MAAM,YAAY,oLAatB,iBAAiB,sBA8FnB,CAAC"}
1
+ {"version":3,"file":"BadgeWrapper.d.mts","sourceRoot":"","sources":["../../../src/components/BadgeWrapper/BadgeWrapper.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAyC,cAAc;AAI9D,OAAO,KAAK,EAAE,iBAAiB,EAAE,iCAA6B;AAE9D,eAAO,MAAM,YAAY,oLAatB,iBAAiB,sBA8FnB,CAAC"}
@@ -4,11 +4,11 @@ function $importDefault(module) {
4
4
  }
5
5
  return module;
6
6
  }
7
+ import { BadgeWrapperPosition, BadgeWrapperPositionAnchorShape } from "@metamask-previews/design-system-shared";
7
8
  import { useTailwind } from "@metamask-previews/design-system-twrnc-preset";
8
9
  import $React, { useCallback, useState, useMemo } from "react";
9
10
  const React = $importDefault($React);
10
11
  import { View } from "react-native/index.js";
11
- import { BadgeWrapperPosition, BadgeWrapperPositionAnchorShape } from "../../types/index.mjs";
12
12
  export const BadgeWrapper = ({ children, childrenContainerProps, badge, badgeContainerProps, position = BadgeWrapperPosition.BottomRight, positionAnchorShape = BadgeWrapperPositionAnchorShape.Circular, positionXOffset = 0, positionYOffset = 0, customPosition, twClassName, style, ...props }) => {
13
13
  const tw = useTailwind();
14
14
  const [anchorWidth, setAnchorWidth] = useState(0);
@@ -1 +1 @@
1
- {"version":3,"file":"BadgeWrapper.mjs","sourceRoot":"","sources":["../../../src/components/BadgeWrapper/BadgeWrapper.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,sDAAsD;AAC5E,OAAO,QAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,OAAO,EAAE,cAAc;;AAE9D,OAAO,EAAE,IAAI,EAAE,8BAAqB;AAEpC,OAAO,EACL,oBAAoB,EACpB,+BAA+B,EAChC,8BAAoB;AAIrB,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,EAC3B,QAAQ,EACR,sBAAsB,EACtB,KAAK,EACL,mBAAmB,EACnB,QAAQ,GAAG,oBAAoB,CAAC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CAAC,CAAC,CAE7D;MAAA,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,aAAa,CAAC,CAAC,IAAI,sBAAsB,CAAC,CACxD;QAAA,CAAC,QAAQ,CACX;MAAA,EAAE,IAAI,CACN;MAAA,CAAC,IAAI,CACH,QAAQ,CAAC,CAAC,YAAY,CAAC,CACvB,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,UAAU,CAAC,EAAE,EAAE,GAAG,cAAc,EAAE,CAAC,CAAC,CACrD,IAAI,mBAAmB,CAAC,CAExB;QAAA,CAAC,KAAK,CACR;MAAA,EAAE,IAAI,CACR;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { useTailwind } from '@metamask-previews/design-system-twrnc-preset';\nimport React, { useCallback, useState, useMemo } from 'react';\nimport type { LayoutChangeEvent } from 'react-native';\nimport { View } from 'react-native';\n\nimport {\n BadgeWrapperPosition,\n BadgeWrapperPositionAnchorShape,\n} from '../../types';\n\nimport type { BadgeWrapperProps } from './BadgeWrapper.types';\n\nexport const BadgeWrapper = ({\n children,\n childrenContainerProps,\n badge,\n badgeContainerProps,\n position = BadgeWrapperPosition.BottomRight,\n positionAnchorShape = BadgeWrapperPositionAnchorShape.Circular,\n positionXOffset = 0,\n positionYOffset = 0,\n customPosition,\n twClassName,\n style,\n ...props\n}: BadgeWrapperProps) => {\n const tw = useTailwind();\n const [anchorWidth, setAnchorWidth] = useState<number>(0);\n const [anchorHeight, setAnchorHeight] = useState<number>(0);\n const [badgeWidth, setbadgeWidth] = useState<number>(0);\n const [badgeHeight, setbadgeHeight] = useState<number>(0);\n\n // Fetching the dimensions of the anchor and bagde element to properly position the badge\n const getAnchorSize = useCallback((event: LayoutChangeEvent) => {\n const { width, height } = event.nativeEvent.layout;\n setAnchorWidth(width);\n setAnchorHeight(height);\n }, []);\n const getBadgeSize = useCallback((event: LayoutChangeEvent) => {\n const { width, height } = event.nativeEvent.layout;\n setbadgeWidth(width);\n setbadgeHeight(height);\n }, []);\n\n const finalPositions = useMemo(() => {\n if (customPosition) {\n return customPosition;\n }\n // 0.1464 is a mathematical coeeficient to move\n // from a 0,0 corner of a rectangular shape to the closest \"corner\"\n // of a circular shape anchor element\n const anchorShapeXOffset =\n positionAnchorShape === BadgeWrapperPositionAnchorShape.Rectangular\n ? 0\n : anchorWidth * 0.1464;\n const anchorShapeYOffset =\n positionAnchorShape === BadgeWrapperPositionAnchorShape.Rectangular\n ? 0\n : anchorHeight * 0.1464;\n // This is to center the badge in the corner of the anchor element\n const badgeCenteringXOffset = badgeWidth / 2;\n const badgeCenteringYOffset = badgeHeight / 2;\n\n const finalXOffset =\n anchorShapeXOffset - badgeCenteringXOffset + positionXOffset;\n const finalYOffset =\n anchorShapeYOffset - badgeCenteringYOffset + positionYOffset;\n switch (position) {\n case BadgeWrapperPosition.TopRight:\n return {\n top: finalYOffset,\n right: finalXOffset,\n };\n case BadgeWrapperPosition.BottomLeft:\n return {\n bottom: finalYOffset,\n left: finalXOffset,\n };\n case BadgeWrapperPosition.TopLeft:\n return {\n top: finalYOffset,\n left: finalXOffset,\n };\n case BadgeWrapperPosition.BottomRight:\n default:\n return {\n bottom: finalYOffset,\n right: finalXOffset,\n };\n }\n }, [\n position,\n positionAnchorShape,\n anchorWidth,\n anchorHeight,\n badgeWidth,\n badgeHeight,\n positionXOffset,\n positionYOffset,\n customPosition,\n ]);\n\n return (\n <View\n {...props}\n style={[tw.style('relative self-start', twClassName), style]}\n >\n <View onLayout={getAnchorSize} {...childrenContainerProps}>\n {children}\n </View>\n <View\n onLayout={getBadgeSize}\n style={[tw.style('absolute'), { ...finalPositions }]}\n {...badgeContainerProps}\n >\n {badge}\n </View>\n </View>\n );\n};\n"]}
1
+ {"version":3,"file":"BadgeWrapper.mjs","sourceRoot":"","sources":["../../../src/components/BadgeWrapper/BadgeWrapper.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,EACL,oBAAoB,EACpB,+BAA+B,EA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AC;SACL;IACH,CAAC,EAAE;QACD,QAAQ;QACR,mBAAmB;QACnB,WAAW;QACX,YAAY;QACZ,UAAU;QACV,WAAW;QACX,eAAe;QACf,eAAe;QACf,cAAc;KACf,CAAC,CAAC;IAEH,OAAO,CACL,CAAC,IAAI,CACH,IAAI,KAAK,CAAC,CACV,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,qBAAqB,EAAE,WAAW,CAAC,EAAE,KAAK,CAAC,CAAC,CAE7D;MAAA,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,aAAa,CAAC,CAAC,IAAI,sBAAsB,CAAC,CACxD;QAAA,CAAC,QAAQ,CACX;MAAA,EAAE,IAAI,CACN;MAAA,CAAC,IAAI,CACH,QAAQ,CAAC,CAAC,YAAY,CAAC,CACvB,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,UAAU,CAAC,EAAE,EAAE,GAAG,cAAc,EAAE,CAAC,CAAC,CACrD,IAAI,mBAAmB,CAAC,CAExB;QAAA,CAAC,KAAK,CACR;MAAA,EAAE,IAAI,CACR;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import {\n BadgeWrapperPosition,\n BadgeWrapperPositionAnchorShape,\n} from '@metamask-previews/design-system-shared';\nimport { useTailwind } from '@metamask-previews/design-system-twrnc-preset';\nimport React, { useCallback, useState, useMemo } from 'react';\nimport type { LayoutChangeEvent } from 'react-native';\nimport { View } from 'react-native';\n\nimport type { BadgeWrapperProps } from './BadgeWrapper.types';\n\nexport const BadgeWrapper = ({\n children,\n childrenContainerProps,\n badge,\n badgeContainerProps,\n position = BadgeWrapperPosition.BottomRight,\n positionAnchorShape = BadgeWrapperPositionAnchorShape.Circular,\n positionXOffset = 0,\n positionYOffset = 0,\n customPosition,\n twClassName,\n style,\n ...props\n}: BadgeWrapperProps) => {\n const tw = useTailwind();\n const [anchorWidth, setAnchorWidth] = useState<number>(0);\n const [anchorHeight, setAnchorHeight] = useState<number>(0);\n const [badgeWidth, setbadgeWidth] = useState<number>(0);\n const [badgeHeight, setbadgeHeight] = useState<number>(0);\n\n // Fetching the dimensions of the anchor and bagde element to properly position the badge\n const getAnchorSize = useCallback((event: LayoutChangeEvent) => {\n const { width, height } = event.nativeEvent.layout;\n setAnchorWidth(width);\n setAnchorHeight(height);\n }, []);\n const getBadgeSize = useCallback((event: LayoutChangeEvent) => {\n const { width, height } = event.nativeEvent.layout;\n setbadgeWidth(width);\n setbadgeHeight(height);\n }, []);\n\n const finalPositions = useMemo(() => {\n if (customPosition) {\n return customPosition;\n }\n // 0.1464 is a mathematical coeeficient to move\n // from a 0,0 corner of a rectangular shape to the closest \"corner\"\n // of a circular shape anchor element\n const anchorShapeXOffset =\n positionAnchorShape === BadgeWrapperPositionAnchorShape.Rectangular\n ? 0\n : anchorWidth * 0.1464;\n const anchorShapeYOffset =\n positionAnchorShape === BadgeWrapperPositionAnchorShape.Rectangular\n ? 0\n : anchorHeight * 0.1464;\n // This is to center the badge in the corner of the anchor element\n const badgeCenteringXOffset = badgeWidth / 2;\n const badgeCenteringYOffset = badgeHeight / 2;\n\n const finalXOffset =\n anchorShapeXOffset - badgeCenteringXOffset + positionXOffset;\n const finalYOffset =\n anchorShapeYOffset - badgeCenteringYOffset + positionYOffset;\n switch (position) {\n case BadgeWrapperPosition.TopRight:\n return {\n top: finalYOffset,\n right: finalXOffset,\n };\n case BadgeWrapperPosition.BottomLeft:\n return {\n bottom: finalYOffset,\n left: finalXOffset,\n };\n case BadgeWrapperPosition.TopLeft:\n return {\n top: finalYOffset,\n left: finalXOffset,\n };\n case BadgeWrapperPosition.BottomRight:\n default:\n return {\n bottom: finalYOffset,\n right: finalXOffset,\n };\n }\n }, [\n position,\n positionAnchorShape,\n anchorWidth,\n anchorHeight,\n badgeWidth,\n badgeHeight,\n positionXOffset,\n positionYOffset,\n customPosition,\n ]);\n\n return (\n <View\n {...props}\n style={[tw.style('relative self-start', twClassName), style]}\n >\n <View onLayout={getAnchorSize} {...childrenContainerProps}>\n {children}\n </View>\n <View\n onLayout={getBadgeSize}\n style={[tw.style('absolute'), { ...finalPositions }]}\n {...badgeContainerProps}\n >\n {badge}\n </View>\n </View>\n );\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"BadgeWrapper.types.cjs","sourceRoot":"","sources":["../../../src/components/BadgeWrapper/BadgeWrapper.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ViewProps, StyleProp, ViewStyle } from 'react-native';\n\nimport type {\n BadgeWrapperPosition,\n BadgeWrapperCustomPosition,\n BadgeWrapperPositionAnchorShape,\n} from '../../types';\n\n/**\n * Badge component props.\n */\nexport type BadgeWrapperProps = {\n /**\n * Optional prop to determine the shape of the anchoring element.\n * This prop gets used along with position, positionXOffset, and positionYOffset\n * to determine the final position.\n * Possible values:\n * BadgeWrapperPositionAnchorShape.Circular,\n * - BadgeWrapperPositionAnchorShape.Rectangular,\n *\n * @default BadgeWrapperPositionAnchorShape.Circular\n */\n positionAnchorShape?: BadgeWrapperPositionAnchorShape;\n /**\n * Optional prop to control the preset position of the badge.\n * This prop gets used along with positionAnchorShape, positionXOffset, and positionYOffset\n * to determine the final position.\n *\n * @default BadgeWrapperPosition.TopRight\n */\n position?: BadgeWrapperPosition;\n /**\n * Optional prop to move the preset position horizontally.\n * This prop gets used along with position, positionAnchorShape, and positionYOffset\n * to determine the final position.\n *\n * @default 0\n */\n positionXOffset?: number;\n /**\n * Optional prop to move the preset position vertically.\n * This prop gets used along with position, positionAnchorShape, and positionXOffset\n * to determine the final position.\n *\n * @default 0\n */\n positionYOffset?: number;\n /**\n * Optional prop to customize the position through the position object.\n * Position object - {top: 0, right: 0, bottom: 0, left: 0}\n */\n customPosition?: BadgeWrapperCustomPosition;\n /**\n * The element that the badge will attach itself to.\n */\n children: React.ReactNode;\n /**\n * Optional prop to pass additional props to the children container\n */\n childrenContainerProps?: ViewProps;\n /**\n * Any element that will be placed in the position of the badge.\n */\n badge: React.ReactNode;\n /**\n * Optional prop to pass additional props to the badge container\n */\n badgeContainerProps?: ViewProps;\n /**\n * Optional prop to add twrnc overriding classNames.\n */\n twClassName?: string;\n /**\n * Optional prop to control the style.\n */\n style?: StyleProp<ViewStyle>;\n} & ViewProps;\n"]}
1
+ {"version":3,"file":"BadgeWrapper.types.cjs","sourceRoot":"","sources":["../../../src/components/BadgeWrapper/BadgeWrapper.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { BadgeWrapperPropsShared } from '@metamask-previews/design-system-shared';\nimport type { ViewProps, StyleProp, ViewStyle } from 'react-native';\n\n/**\n * BadgeWrapper component props (React Native platform-specific)\n * Extends shared props from @metamask-previews/design-system-shared with React Native-specific platform concerns\n */\nexport type BadgeWrapperProps = BadgeWrapperPropsShared & {\n /**\n * Optional prop to pass additional props to the children container\n */\n childrenContainerProps?: ViewProps;\n /**\n * Optional prop to pass additional props to the badge container\n */\n badgeContainerProps?: ViewProps;\n /**\n * Optional prop to add twrnc overriding classNames.\n */\n twClassName?: string;\n /**\n * Optional prop to control the style.\n */\n style?: StyleProp<ViewStyle>;\n} & ViewProps;\n"]}
@@ -1,61 +1,14 @@
1
+ import type { BadgeWrapperPropsShared } from "@metamask-previews/design-system-shared";
1
2
  import type { ViewProps, StyleProp, ViewStyle } from "react-native/index.js";
2
- import type { BadgeWrapperPosition, BadgeWrapperCustomPosition, BadgeWrapperPositionAnchorShape } from "../../types/index.cjs";
3
3
  /**
4
- * Badge component props.
4
+ * BadgeWrapper component props (React Native platform-specific)
5
+ * Extends shared props from @metamask-previews/design-system-shared with React Native-specific platform concerns
5
6
  */
6
- export type BadgeWrapperProps = {
7
- /**
8
- * Optional prop to determine the shape of the anchoring element.
9
- * This prop gets used along with position, positionXOffset, and positionYOffset
10
- * to determine the final position.
11
- * Possible values:
12
- * BadgeWrapperPositionAnchorShape.Circular,
13
- * - BadgeWrapperPositionAnchorShape.Rectangular,
14
- *
15
- * @default BadgeWrapperPositionAnchorShape.Circular
16
- */
17
- positionAnchorShape?: BadgeWrapperPositionAnchorShape;
18
- /**
19
- * Optional prop to control the preset position of the badge.
20
- * This prop gets used along with positionAnchorShape, positionXOffset, and positionYOffset
21
- * to determine the final position.
22
- *
23
- * @default BadgeWrapperPosition.TopRight
24
- */
25
- position?: BadgeWrapperPosition;
26
- /**
27
- * Optional prop to move the preset position horizontally.
28
- * This prop gets used along with position, positionAnchorShape, and positionYOffset
29
- * to determine the final position.
30
- *
31
- * @default 0
32
- */
33
- positionXOffset?: number;
34
- /**
35
- * Optional prop to move the preset position vertically.
36
- * This prop gets used along with position, positionAnchorShape, and positionXOffset
37
- * to determine the final position.
38
- *
39
- * @default 0
40
- */
41
- positionYOffset?: number;
42
- /**
43
- * Optional prop to customize the position through the position object.
44
- * Position object - {top: 0, right: 0, bottom: 0, left: 0}
45
- */
46
- customPosition?: BadgeWrapperCustomPosition;
47
- /**
48
- * The element that the badge will attach itself to.
49
- */
50
- children: React.ReactNode;
7
+ export type BadgeWrapperProps = BadgeWrapperPropsShared & {
51
8
  /**
52
9
  * Optional prop to pass additional props to the children container
53
10
  */
54
11
  childrenContainerProps?: ViewProps;
55
- /**
56
- * Any element that will be placed in the position of the badge.
57
- */
58
- badge: React.ReactNode;
59
12
  /**
60
13
  * Optional prop to pass additional props to the badge container
61
14
  */
@@ -1 +1 @@
1
- {"version":3,"file":"BadgeWrapper.types.d.cts","sourceRoot":"","sources":["../../../src/components/BadgeWrapper/BadgeWrapper.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,8BAAqB;AAEpE,OAAO,KAAK,EACV,oBAAoB,EACpB,0BAA0B,EAC1B,+BAA+B,EAChC,8BAAoB;AAErB;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC9B;;;;;;;;;OASG;IACH,mBAAmB,CAAC,EAAE,+BAA+B,CAAC;IACtD;;;;;;OAMG;IACH,QAAQ,CAAC,EAAE,oBAAoB,CAAC;IAChC;;;;;;OAMG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;;;;;OAMG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;;OAGG;IACH,cAAc,CAAC,EAAE,0BAA0B,CAAC;IAC5C;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B;;OAEG;IACH,sBAAsB,CAAC,EAAE,SAAS,CAAC;IACnC;;OAEG;IACH,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB;;OAEG;IACH,mBAAmB,CAAC,EAAE,SAAS,CAAC;IAChC;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B,GAAG,SAAS,CAAC"}
1
+ {"version":3,"file":"BadgeWrapper.types.d.cts","sourceRoot":"","sources":["../../../src/components/BadgeWrapper/BadgeWrapper.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,gDAAgD;AACvF,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,8BAAqB;AAEpE;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GAAG,uBAAuB,GAAG;IACxD;;OAEG;IACH,sBAAsB,CAAC,EAAE,SAAS,CAAC;IACnC;;OAEG;IACH,mBAAmB,CAAC,EAAE,SAAS,CAAC;IAChC;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B,GAAG,SAAS,CAAC"}
@@ -1,61 +1,14 @@
1
+ import type { BadgeWrapperPropsShared } from "@metamask-previews/design-system-shared";
1
2
  import type { ViewProps, StyleProp, ViewStyle } from "react-native/index.js";
2
- import type { BadgeWrapperPosition, BadgeWrapperCustomPosition, BadgeWrapperPositionAnchorShape } from "../../types/index.mjs";
3
3
  /**
4
- * Badge component props.
4
+ * BadgeWrapper component props (React Native platform-specific)
5
+ * Extends shared props from @metamask-previews/design-system-shared with React Native-specific platform concerns
5
6
  */
6
- export type BadgeWrapperProps = {
7
- /**
8
- * Optional prop to determine the shape of the anchoring element.
9
- * This prop gets used along with position, positionXOffset, and positionYOffset
10
- * to determine the final position.
11
- * Possible values:
12
- * BadgeWrapperPositionAnchorShape.Circular,
13
- * - BadgeWrapperPositionAnchorShape.Rectangular,
14
- *
15
- * @default BadgeWrapperPositionAnchorShape.Circular
16
- */
17
- positionAnchorShape?: BadgeWrapperPositionAnchorShape;
18
- /**
19
- * Optional prop to control the preset position of the badge.
20
- * This prop gets used along with positionAnchorShape, positionXOffset, and positionYOffset
21
- * to determine the final position.
22
- *
23
- * @default BadgeWrapperPosition.TopRight
24
- */
25
- position?: BadgeWrapperPosition;
26
- /**
27
- * Optional prop to move the preset position horizontally.
28
- * This prop gets used along with position, positionAnchorShape, and positionYOffset
29
- * to determine the final position.
30
- *
31
- * @default 0
32
- */
33
- positionXOffset?: number;
34
- /**
35
- * Optional prop to move the preset position vertically.
36
- * This prop gets used along with position, positionAnchorShape, and positionXOffset
37
- * to determine the final position.
38
- *
39
- * @default 0
40
- */
41
- positionYOffset?: number;
42
- /**
43
- * Optional prop to customize the position through the position object.
44
- * Position object - {top: 0, right: 0, bottom: 0, left: 0}
45
- */
46
- customPosition?: BadgeWrapperCustomPosition;
47
- /**
48
- * The element that the badge will attach itself to.
49
- */
50
- children: React.ReactNode;
7
+ export type BadgeWrapperProps = BadgeWrapperPropsShared & {
51
8
  /**
52
9
  * Optional prop to pass additional props to the children container
53
10
  */
54
11
  childrenContainerProps?: ViewProps;
55
- /**
56
- * Any element that will be placed in the position of the badge.
57
- */
58
- badge: React.ReactNode;
59
12
  /**
60
13
  * Optional prop to pass additional props to the badge container
61
14
  */
@@ -1 +1 @@
1
- {"version":3,"file":"BadgeWrapper.types.d.mts","sourceRoot":"","sources":["../../../src/components/BadgeWrapper/BadgeWrapper.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,8BAAqB;AAEpE,OAAO,KAAK,EACV,oBAAoB,EACpB,0BAA0B,EAC1B,+BAA+B,EAChC,8BAAoB;AAErB;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC9B;;;;;;;;;OASG;IACH,mBAAmB,CAAC,EAAE,+BAA+B,CAAC;IACtD;;;;;;OAMG;IACH,QAAQ,CAAC,EAAE,oBAAoB,CAAC;IAChC;;;;;;OAMG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;;;;;OAMG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;;OAGG;IACH,cAAc,CAAC,EAAE,0BAA0B,CAAC;IAC5C;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B;;OAEG;IACH,sBAAsB,CAAC,EAAE,SAAS,CAAC;IACnC;;OAEG;IACH,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB;;OAEG;IACH,mBAAmB,CAAC,EAAE,SAAS,CAAC;IAChC;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B,GAAG,SAAS,CAAC"}
1
+ {"version":3,"file":"BadgeWrapper.types.d.mts","sourceRoot":"","sources":["../../../src/components/BadgeWrapper/BadgeWrapper.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,gDAAgD;AACvF,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,8BAAqB;AAEpE;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GAAG,uBAAuB,GAAG;IACxD;;OAEG;IACH,sBAAsB,CAAC,EAAE,SAAS,CAAC;IACnC;;OAEG;IACH,mBAAmB,CAAC,EAAE,SAAS,CAAC;IAChC;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B,GAAG,SAAS,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"BadgeWrapper.types.mjs","sourceRoot":"","sources":["../../../src/components/BadgeWrapper/BadgeWrapper.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ViewProps, StyleProp, ViewStyle } from 'react-native';\n\nimport type {\n BadgeWrapperPosition,\n BadgeWrapperCustomPosition,\n BadgeWrapperPositionAnchorShape,\n} from '../../types';\n\n/**\n * Badge component props.\n */\nexport type BadgeWrapperProps = {\n /**\n * Optional prop to determine the shape of the anchoring element.\n * This prop gets used along with position, positionXOffset, and positionYOffset\n * to determine the final position.\n * Possible values:\n * BadgeWrapperPositionAnchorShape.Circular,\n * - BadgeWrapperPositionAnchorShape.Rectangular,\n *\n * @default BadgeWrapperPositionAnchorShape.Circular\n */\n positionAnchorShape?: BadgeWrapperPositionAnchorShape;\n /**\n * Optional prop to control the preset position of the badge.\n * This prop gets used along with positionAnchorShape, positionXOffset, and positionYOffset\n * to determine the final position.\n *\n * @default BadgeWrapperPosition.TopRight\n */\n position?: BadgeWrapperPosition;\n /**\n * Optional prop to move the preset position horizontally.\n * This prop gets used along with position, positionAnchorShape, and positionYOffset\n * to determine the final position.\n *\n * @default 0\n */\n positionXOffset?: number;\n /**\n * Optional prop to move the preset position vertically.\n * This prop gets used along with position, positionAnchorShape, and positionXOffset\n * to determine the final position.\n *\n * @default 0\n */\n positionYOffset?: number;\n /**\n * Optional prop to customize the position through the position object.\n * Position object - {top: 0, right: 0, bottom: 0, left: 0}\n */\n customPosition?: BadgeWrapperCustomPosition;\n /**\n * The element that the badge will attach itself to.\n */\n children: React.ReactNode;\n /**\n * Optional prop to pass additional props to the children container\n */\n childrenContainerProps?: ViewProps;\n /**\n * Any element that will be placed in the position of the badge.\n */\n badge: React.ReactNode;\n /**\n * Optional prop to pass additional props to the badge container\n */\n badgeContainerProps?: ViewProps;\n /**\n * Optional prop to add twrnc overriding classNames.\n */\n twClassName?: string;\n /**\n * Optional prop to control the style.\n */\n style?: StyleProp<ViewStyle>;\n} & ViewProps;\n"]}
1
+ {"version":3,"file":"BadgeWrapper.types.mjs","sourceRoot":"","sources":["../../../src/components/BadgeWrapper/BadgeWrapper.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { BadgeWrapperPropsShared } from '@metamask-previews/design-system-shared';\nimport type { ViewProps, StyleProp, ViewStyle } from 'react-native';\n\n/**\n * BadgeWrapper component props (React Native platform-specific)\n * Extends shared props from @metamask-previews/design-system-shared with React Native-specific platform concerns\n */\nexport type BadgeWrapperProps = BadgeWrapperPropsShared & {\n /**\n * Optional prop to pass additional props to the children container\n */\n childrenContainerProps?: ViewProps;\n /**\n * Optional prop to pass additional props to the badge container\n */\n badgeContainerProps?: ViewProps;\n /**\n * Optional prop to add twrnc overriding classNames.\n */\n twClassName?: string;\n /**\n * Optional prop to control the style.\n */\n style?: StyleProp<ViewStyle>;\n} & ViewProps;\n"]}
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.BadgeWrapper = exports.BadgeWrapperPositionAnchorShape = exports.BadgeWrapperPosition = void 0;
4
- var types_1 = require("../../types/index.cjs");
5
- Object.defineProperty(exports, "BadgeWrapperPosition", { enumerable: true, get: function () { return types_1.BadgeWrapperPosition; } });
6
- Object.defineProperty(exports, "BadgeWrapperPositionAnchorShape", { enumerable: true, get: function () { return types_1.BadgeWrapperPositionAnchorShape; } });
4
+ var design_system_shared_1 = require("@metamask-previews/design-system-shared");
5
+ Object.defineProperty(exports, "BadgeWrapperPosition", { enumerable: true, get: function () { return design_system_shared_1.BadgeWrapperPosition; } });
6
+ Object.defineProperty(exports, "BadgeWrapperPositionAnchorShape", { enumerable: true, get: function () { return design_system_shared_1.BadgeWrapperPositionAnchorShape; } });
7
7
  var BadgeWrapper_1 = require("./BadgeWrapper.cjs");
8
8
  Object.defineProperty(exports, "BadgeWrapper", { enumerable: true, get: function () { return BadgeWrapper_1.BadgeWrapper; } });
9
9
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../../src/components/BadgeWrapper/index.ts"],"names":[],"mappings":";;;AAAA,+CAGqB;AAFnB,6GAAA,oBAAoB,OAAA;AACpB,wHAAA,+BAA+B,OAAA;AAGjC,mDAA8C;AAArC,4GAAA,YAAY,OAAA","sourcesContent":["export {\n BadgeWrapperPosition,\n BadgeWrapperPositionAnchorShape,\n} from '../../types';\nexport type { BadgeWrapperCustomPosition } from '../../types';\nexport { BadgeWrapper } from './BadgeWrapper';\nexport type { BadgeWrapperProps } from './BadgeWrapper.types';\n"]}
1
+ {"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../../src/components/BadgeWrapper/index.ts"],"names":[],"mappings":";;;AAAA,gFAIiD;AAH/C,4HAAA,oBAAoB,OAAA;AACpB,uIAAA,+BAA+B,OAAA;AAGjC,mDAA8C;AAArC,4GAAA,YAAY,OAAA","sourcesContent":["export {\n BadgeWrapperPosition,\n BadgeWrapperPositionAnchorShape,\n type BadgeWrapperCustomPosition,\n} from '@metamask-previews/design-system-shared';\nexport { BadgeWrapper } from './BadgeWrapper';\nexport type { BadgeWrapperProps } from './BadgeWrapper.types';\n"]}
@@ -1,5 +1,4 @@
1
- export { BadgeWrapperPosition, BadgeWrapperPositionAnchorShape, } from "../../types/index.cjs";
2
- export type { BadgeWrapperCustomPosition } from "../../types/index.cjs";
1
+ export { BadgeWrapperPosition, BadgeWrapperPositionAnchorShape, type BadgeWrapperCustomPosition, } from "@metamask-previews/design-system-shared";
3
2
  export { BadgeWrapper } from "./BadgeWrapper.cjs";
4
3
  export type { BadgeWrapperProps } from "./BadgeWrapper.types.cjs";
5
4
  //# sourceMappingURL=index.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/components/BadgeWrapper/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,+BAA+B,GAChC,8BAAoB;AACrB,YAAY,EAAE,0BAA0B,EAAE,8BAAoB;AAC9D,OAAO,EAAE,YAAY,EAAE,2BAAuB;AAC9C,YAAY,EAAE,iBAAiB,EAAE,iCAA6B"}
1
+ {"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/components/BadgeWrapper/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,+BAA+B,EAC/B,KAAK,0BAA0B,GAChC,gDAAgD;AACjD,OAAO,EAAE,YAAY,EAAE,2BAAuB;AAC9C,YAAY,EAAE,iBAAiB,EAAE,iCAA6B"}
@@ -1,5 +1,4 @@
1
- export { BadgeWrapperPosition, BadgeWrapperPositionAnchorShape, } from "../../types/index.mjs";
2
- export type { BadgeWrapperCustomPosition } from "../../types/index.mjs";
1
+ export { BadgeWrapperPosition, BadgeWrapperPositionAnchorShape, type BadgeWrapperCustomPosition, } from "@metamask-previews/design-system-shared";
3
2
  export { BadgeWrapper } from "./BadgeWrapper.mjs";
4
3
  export type { BadgeWrapperProps } from "./BadgeWrapper.types.mjs";
5
4
  //# sourceMappingURL=index.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../src/components/BadgeWrapper/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,+BAA+B,GAChC,8BAAoB;AACrB,YAAY,EAAE,0BAA0B,EAAE,8BAAoB;AAC9D,OAAO,EAAE,YAAY,EAAE,2BAAuB;AAC9C,YAAY,EAAE,iBAAiB,EAAE,iCAA6B"}
1
+ {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../src/components/BadgeWrapper/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,+BAA+B,EAC/B,KAAK,0BAA0B,GAChC,gDAAgD;AACjD,OAAO,EAAE,YAAY,EAAE,2BAAuB;AAC9C,YAAY,EAAE,iBAAiB,EAAE,iCAA6B"}
@@ -1,3 +1,3 @@
1
- export { BadgeWrapperPosition, BadgeWrapperPositionAnchorShape } from "../../types/index.mjs";
1
+ export { BadgeWrapperPosition, BadgeWrapperPositionAnchorShape } from "@metamask-previews/design-system-shared";
2
2
  export { BadgeWrapper } from "./BadgeWrapper.mjs";
3
3
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../src/components/BadgeWrapper/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,+BAA+B,EAChC,8BAAoB;AAErB,OAAO,EAAE,YAAY,EAAE,2BAAuB","sourcesContent":["export {\n BadgeWrapperPosition,\n BadgeWrapperPositionAnchorShape,\n} from '../../types';\nexport type { BadgeWrapperCustomPosition } from '../../types';\nexport { BadgeWrapper } from './BadgeWrapper';\nexport type { BadgeWrapperProps } from './BadgeWrapper.types';\n"]}
1
+ {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../src/components/BadgeWrapper/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,+BAA+B,EAEhC,gDAAgD;AACjD,OAAO,EAAE,YAAY,EAAE,2BAAuB","sourcesContent":["export {\n BadgeWrapperPosition,\n BadgeWrapperPositionAnchorShape,\n type BadgeWrapperCustomPosition,\n} from '@metamask-previews/design-system-shared';\nexport { BadgeWrapper } from './BadgeWrapper';\nexport type { BadgeWrapperProps } from './BadgeWrapper.types';\n"]}
@@ -22,18 +22,15 @@ var __importStar = (this && this.__importStar) || function (mod) {
22
22
  __setModuleDefault(result, mod);
23
23
  return result;
24
24
  };
25
- var __importDefault = (this && this.__importDefault) || function (mod) {
26
- return (mod && mod.__esModule) ? mod : { "default": mod };
27
- };
28
25
  Object.defineProperty(exports, "__esModule", { value: true });
29
26
  exports.BottomSheet = void 0;
30
27
  const design_system_twrnc_preset_1 = require("@metamask-previews/design-system-twrnc-preset");
31
28
  const react_1 = __importStar(require("react"));
32
29
  const react_native_1 = require("react-native/index.js");
33
30
  const react_native_safe_area_context_1 = require("react-native-safe-area-context");
34
- const BottomSheetDialog_1 = __importDefault(require("../BottomSheetDialog/index.cjs"));
31
+ const BottomSheetDialog_1 = require("../BottomSheetDialog/index.cjs");
35
32
  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) => {
33
+ exports.BottomSheet = (0, react_1.forwardRef)(({ children, onClose, onOpen, goBack, style, twClassName, isInteractable = true, isFullscreen = false, keyboardAvoidingViewEnabled = true, panGestureHandlerProps, ...props }, ref) => {
37
34
  const tw = (0, design_system_twrnc_preset_1.useTailwind)();
38
35
  const { bottom: screenBottomPadding } = (0, react_native_safe_area_context_1.useSafeAreaInsets)();
39
36
  const { y: frameY } = (0, react_native_safe_area_context_1.useSafeAreaFrame)();
@@ -53,9 +50,9 @@ exports.BottomSheet = (0, react_1.forwardRef)(({ children, onClose, onOpen, goBa
53
50
  callback?.();
54
51
  }, [onOpen]);
55
52
  const onCloseCB = (0, react_1.useCallback)(() => {
56
- if (shouldNavigateBack && !didNavigateBackRef.current) {
53
+ if (goBack && !didNavigateBackRef.current) {
57
54
  didNavigateBackRef.current = true;
58
- goBack();
55
+ goBack?.();
59
56
  }
60
57
  const callback = postCallback.current;
61
58
  const hasCallback = Boolean(callback);
@@ -65,7 +62,7 @@ exports.BottomSheet = (0, react_1.forwardRef)(({ children, onClose, onOpen, goBa
65
62
  postCallback.current = undefined;
66
63
  callback?.();
67
64
  }
68
- }, [goBack, onClose, shouldNavigateBack]);
65
+ }, [goBack, onClose]);
69
66
  // Dismiss the sheet when Android back button is pressed.
70
67
  (0, react_1.useEffect)(() => {
71
68
  const hardwareBackPress = () => {
@@ -100,9 +97,9 @@ exports.BottomSheet = (0, react_1.forwardRef)(({ children, onClose, onOpen, goBa
100
97
  <BottomSheetOverlay_1.BottomSheetOverlay onPress={isInteractable
101
98
  ? () => bottomSheetDialogRef.current?.onCloseDialog()
102
99
  : undefined}/>
103
- <BottomSheetDialog_1.default isInteractable={isInteractable} onClose={onCloseCB} onOpen={onOpenCB} ref={bottomSheetDialogRef} isFullscreen={isFullscreen} twClassName={twClassName} keyboardAvoidingViewEnabled={keyboardAvoidingViewEnabled}>
100
+ <BottomSheetDialog_1.BottomSheetDialog isInteractable={isInteractable} onClose={onCloseCB} onOpen={onOpenCB} ref={bottomSheetDialogRef} isFullscreen={isFullscreen} twClassName={twClassName} keyboardAvoidingViewEnabled={keyboardAvoidingViewEnabled} panGestureHandlerProps={panGestureHandlerProps}>
104
101
  {children}
105
- </BottomSheetDialog_1.default>
102
+ </BottomSheetDialog_1.BottomSheetDialog>
106
103
  </react_native_1.KeyboardAvoidingView>);
107
104
  });
108
105
  exports.BottomSheet.displayName = 'BottomSheet';