@metamask-previews/design-system-react-native 0.22.0-preview.f515a62 → 0.24.0-preview.178e60f

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 (350) hide show
  1. package/CHANGELOG.md +36 -1
  2. package/dist/components/AvatarGroup/AvatarGroup.cjs +11 -12
  3. package/dist/components/AvatarGroup/AvatarGroup.cjs.map +1 -1
  4. package/dist/components/AvatarGroup/AvatarGroup.constants.cjs +11 -12
  5. package/dist/components/AvatarGroup/AvatarGroup.constants.cjs.map +1 -1
  6. package/dist/components/AvatarGroup/AvatarGroup.constants.d.cts +1 -2
  7. package/dist/components/AvatarGroup/AvatarGroup.constants.d.cts.map +1 -1
  8. package/dist/components/AvatarGroup/AvatarGroup.constants.d.mts +1 -2
  9. package/dist/components/AvatarGroup/AvatarGroup.constants.d.mts.map +1 -1
  10. package/dist/components/AvatarGroup/AvatarGroup.constants.mjs +1 -2
  11. package/dist/components/AvatarGroup/AvatarGroup.constants.mjs.map +1 -1
  12. package/dist/components/AvatarGroup/AvatarGroup.d.cts.map +1 -1
  13. package/dist/components/AvatarGroup/AvatarGroup.d.mts.map +1 -1
  14. package/dist/components/AvatarGroup/AvatarGroup.mjs +2 -3
  15. package/dist/components/AvatarGroup/AvatarGroup.mjs.map +1 -1
  16. package/dist/components/AvatarGroup/AvatarGroup.types.cjs.map +1 -1
  17. package/dist/components/AvatarGroup/AvatarGroup.types.d.cts +7 -24
  18. package/dist/components/AvatarGroup/AvatarGroup.types.d.cts.map +1 -1
  19. package/dist/components/AvatarGroup/AvatarGroup.types.d.mts +7 -24
  20. package/dist/components/AvatarGroup/AvatarGroup.types.d.mts.map +1 -1
  21. package/dist/components/AvatarGroup/AvatarGroup.types.mjs.map +1 -1
  22. package/dist/components/AvatarGroup/index.cjs +3 -3
  23. package/dist/components/AvatarGroup/index.cjs.map +1 -1
  24. package/dist/components/AvatarGroup/index.d.cts +1 -1
  25. package/dist/components/AvatarGroup/index.d.cts.map +1 -1
  26. package/dist/components/AvatarGroup/index.d.mts +1 -1
  27. package/dist/components/AvatarGroup/index.d.mts.map +1 -1
  28. package/dist/components/AvatarGroup/index.mjs +1 -1
  29. package/dist/components/AvatarGroup/index.mjs.map +1 -1
  30. package/dist/components/AvatarIcon/AvatarIcon.cjs +1 -2
  31. package/dist/components/AvatarIcon/AvatarIcon.cjs.map +1 -1
  32. package/dist/components/AvatarIcon/AvatarIcon.constants.cjs +10 -11
  33. package/dist/components/AvatarIcon/AvatarIcon.constants.cjs.map +1 -1
  34. package/dist/components/AvatarIcon/AvatarIcon.constants.d.cts +1 -2
  35. package/dist/components/AvatarIcon/AvatarIcon.constants.d.cts.map +1 -1
  36. package/dist/components/AvatarIcon/AvatarIcon.constants.d.mts +1 -2
  37. package/dist/components/AvatarIcon/AvatarIcon.constants.d.mts.map +1 -1
  38. package/dist/components/AvatarIcon/AvatarIcon.constants.mjs +1 -2
  39. package/dist/components/AvatarIcon/AvatarIcon.constants.mjs.map +1 -1
  40. package/dist/components/AvatarIcon/AvatarIcon.d.cts.map +1 -1
  41. package/dist/components/AvatarIcon/AvatarIcon.d.mts.map +1 -1
  42. package/dist/components/AvatarIcon/AvatarIcon.mjs +1 -2
  43. package/dist/components/AvatarIcon/AvatarIcon.mjs.map +1 -1
  44. package/dist/components/BannerAlert/BannerAlert.cjs +1 -2
  45. package/dist/components/BannerAlert/BannerAlert.cjs.map +1 -1
  46. package/dist/components/BannerAlert/BannerAlert.constants.cjs +8 -9
  47. package/dist/components/BannerAlert/BannerAlert.constants.cjs.map +1 -1
  48. package/dist/components/BannerAlert/BannerAlert.constants.d.cts +1 -2
  49. package/dist/components/BannerAlert/BannerAlert.constants.d.cts.map +1 -1
  50. package/dist/components/BannerAlert/BannerAlert.constants.d.mts +1 -2
  51. package/dist/components/BannerAlert/BannerAlert.constants.d.mts.map +1 -1
  52. package/dist/components/BannerAlert/BannerAlert.constants.mjs +1 -2
  53. package/dist/components/BannerAlert/BannerAlert.constants.mjs.map +1 -1
  54. package/dist/components/BannerAlert/BannerAlert.d.cts.map +1 -1
  55. package/dist/components/BannerAlert/BannerAlert.d.mts.map +1 -1
  56. package/dist/components/BannerAlert/BannerAlert.mjs +1 -2
  57. package/dist/components/BannerAlert/BannerAlert.mjs.map +1 -1
  58. package/dist/components/BannerBase/BannerBase.cjs +3 -12
  59. package/dist/components/BannerBase/BannerBase.cjs.map +1 -1
  60. package/dist/components/BannerBase/BannerBase.d.cts.map +1 -1
  61. package/dist/components/BannerBase/BannerBase.d.mts.map +1 -1
  62. package/dist/components/BannerBase/BannerBase.mjs +3 -12
  63. package/dist/components/BannerBase/BannerBase.mjs.map +1 -1
  64. package/dist/components/BannerBase/BannerBase.types.cjs.map +1 -1
  65. package/dist/components/BannerBase/BannerBase.types.d.cts +2 -7
  66. package/dist/components/BannerBase/BannerBase.types.d.cts.map +1 -1
  67. package/dist/components/BannerBase/BannerBase.types.d.mts +2 -7
  68. package/dist/components/BannerBase/BannerBase.types.d.mts.map +1 -1
  69. package/dist/components/BannerBase/BannerBase.types.mjs.map +1 -1
  70. package/dist/components/Button/variants/ButtonPrimary/ButtonPrimary.cjs +1 -17
  71. package/dist/components/Button/variants/ButtonPrimary/ButtonPrimary.cjs.map +1 -1
  72. package/dist/components/Button/variants/ButtonPrimary/ButtonPrimary.d.cts.map +1 -1
  73. package/dist/components/Button/variants/ButtonPrimary/ButtonPrimary.d.mts.map +1 -1
  74. package/dist/components/Button/variants/ButtonPrimary/ButtonPrimary.mjs +1 -17
  75. package/dist/components/Button/variants/ButtonPrimary/ButtonPrimary.mjs.map +1 -1
  76. package/dist/components/Button/variants/ButtonSecondary/ButtonSecondary.cjs +1 -17
  77. package/dist/components/Button/variants/ButtonSecondary/ButtonSecondary.cjs.map +1 -1
  78. package/dist/components/Button/variants/ButtonSecondary/ButtonSecondary.d.cts.map +1 -1
  79. package/dist/components/Button/variants/ButtonSecondary/ButtonSecondary.d.mts.map +1 -1
  80. package/dist/components/Button/variants/ButtonSecondary/ButtonSecondary.mjs +1 -17
  81. package/dist/components/Button/variants/ButtonSecondary/ButtonSecondary.mjs.map +1 -1
  82. package/dist/components/Button/variants/ButtonTertiary/ButtonTertiary.cjs +1 -17
  83. package/dist/components/Button/variants/ButtonTertiary/ButtonTertiary.cjs.map +1 -1
  84. package/dist/components/Button/variants/ButtonTertiary/ButtonTertiary.d.cts.map +1 -1
  85. package/dist/components/Button/variants/ButtonTertiary/ButtonTertiary.d.mts.map +1 -1
  86. package/dist/components/Button/variants/ButtonTertiary/ButtonTertiary.mjs +1 -17
  87. package/dist/components/Button/variants/ButtonTertiary/ButtonTertiary.mjs.map +1 -1
  88. package/dist/components/ButtonBase/ButtonBase.cjs +42 -28
  89. package/dist/components/ButtonBase/ButtonBase.cjs.map +1 -1
  90. package/dist/components/ButtonBase/ButtonBase.constants.cjs +31 -1
  91. package/dist/components/ButtonBase/ButtonBase.constants.cjs.map +1 -1
  92. package/dist/components/ButtonBase/ButtonBase.constants.d.cts +6 -1
  93. package/dist/components/ButtonBase/ButtonBase.constants.d.cts.map +1 -1
  94. package/dist/components/ButtonBase/ButtonBase.constants.d.mts +6 -1
  95. package/dist/components/ButtonBase/ButtonBase.constants.d.mts.map +1 -1
  96. package/dist/components/ButtonBase/ButtonBase.constants.mjs +29 -1
  97. package/dist/components/ButtonBase/ButtonBase.constants.mjs.map +1 -1
  98. package/dist/components/ButtonBase/ButtonBase.d.cts +1 -1
  99. package/dist/components/ButtonBase/ButtonBase.d.cts.map +1 -1
  100. package/dist/components/ButtonBase/ButtonBase.d.mts +1 -1
  101. package/dist/components/ButtonBase/ButtonBase.d.mts.map +1 -1
  102. package/dist/components/ButtonBase/ButtonBase.mjs +45 -31
  103. package/dist/components/ButtonBase/ButtonBase.mjs.map +1 -1
  104. package/dist/components/ButtonBase/ButtonBase.types.cjs.map +1 -1
  105. package/dist/components/ButtonBase/ButtonBase.types.d.cts +12 -0
  106. package/dist/components/ButtonBase/ButtonBase.types.d.cts.map +1 -1
  107. package/dist/components/ButtonBase/ButtonBase.types.d.mts +12 -0
  108. package/dist/components/ButtonBase/ButtonBase.types.d.mts.map +1 -1
  109. package/dist/components/ButtonBase/ButtonBase.types.mjs.map +1 -1
  110. package/dist/components/ButtonSemantic/ButtonSemantic.cjs +1 -17
  111. package/dist/components/ButtonSemantic/ButtonSemantic.cjs.map +1 -1
  112. package/dist/components/ButtonSemantic/ButtonSemantic.d.cts.map +1 -1
  113. package/dist/components/ButtonSemantic/ButtonSemantic.d.mts.map +1 -1
  114. package/dist/components/ButtonSemantic/ButtonSemantic.mjs +1 -17
  115. package/dist/components/ButtonSemantic/ButtonSemantic.mjs.map +1 -1
  116. package/dist/components/HeaderStandard/HeaderStandard.cjs +2 -26
  117. package/dist/components/HeaderStandard/HeaderStandard.cjs.map +1 -1
  118. package/dist/components/HeaderStandard/HeaderStandard.d.cts.map +1 -1
  119. package/dist/components/HeaderStandard/HeaderStandard.d.mts.map +1 -1
  120. package/dist/components/HeaderStandard/HeaderStandard.mjs +2 -26
  121. package/dist/components/HeaderStandard/HeaderStandard.mjs.map +1 -1
  122. package/dist/components/HeaderStandard/HeaderStandard.types.cjs +0 -5
  123. package/dist/components/HeaderStandard/HeaderStandard.types.cjs.map +1 -1
  124. package/dist/components/HeaderStandard/HeaderStandard.types.d.cts +2 -28
  125. package/dist/components/HeaderStandard/HeaderStandard.types.d.cts.map +1 -1
  126. package/dist/components/HeaderStandard/HeaderStandard.types.d.mts +2 -28
  127. package/dist/components/HeaderStandard/HeaderStandard.types.d.mts.map +1 -1
  128. package/dist/components/HeaderStandard/HeaderStandard.types.mjs +1 -9
  129. package/dist/components/HeaderStandard/HeaderStandard.types.mjs.map +1 -1
  130. package/dist/components/HeaderStandardAnimated/HeaderStandardAnimated.cjs +63 -0
  131. package/dist/components/HeaderStandardAnimated/HeaderStandardAnimated.cjs.map +1 -0
  132. package/dist/components/HeaderStandardAnimated/HeaderStandardAnimated.d.cts +4 -0
  133. package/dist/components/HeaderStandardAnimated/HeaderStandardAnimated.d.cts.map +1 -0
  134. package/dist/components/HeaderStandardAnimated/HeaderStandardAnimated.d.mts +4 -0
  135. package/dist/components/HeaderStandardAnimated/HeaderStandardAnimated.d.mts.map +1 -0
  136. package/dist/components/HeaderStandardAnimated/HeaderStandardAnimated.mjs +40 -0
  137. package/dist/components/HeaderStandardAnimated/HeaderStandardAnimated.mjs.map +1 -0
  138. package/dist/components/HeaderStandardAnimated/HeaderStandardAnimated.types.cjs +3 -0
  139. package/dist/components/HeaderStandardAnimated/HeaderStandardAnimated.types.cjs.map +1 -0
  140. package/dist/components/HeaderStandardAnimated/HeaderStandardAnimated.types.d.cts +31 -0
  141. package/dist/components/HeaderStandardAnimated/HeaderStandardAnimated.types.d.cts.map +1 -0
  142. package/dist/components/HeaderStandardAnimated/HeaderStandardAnimated.types.d.mts +31 -0
  143. package/dist/components/HeaderStandardAnimated/HeaderStandardAnimated.types.d.mts.map +1 -0
  144. package/dist/components/HeaderStandardAnimated/HeaderStandardAnimated.types.mjs +2 -0
  145. package/dist/components/HeaderStandardAnimated/HeaderStandardAnimated.types.mjs.map +1 -0
  146. package/dist/components/HeaderStandardAnimated/index.cjs +8 -0
  147. package/dist/components/HeaderStandardAnimated/index.cjs.map +1 -0
  148. package/dist/components/HeaderStandardAnimated/index.d.cts +4 -0
  149. package/dist/components/HeaderStandardAnimated/index.d.cts.map +1 -0
  150. package/dist/components/HeaderStandardAnimated/index.d.mts +4 -0
  151. package/dist/components/HeaderStandardAnimated/index.d.mts.map +1 -0
  152. package/dist/components/HeaderStandardAnimated/index.mjs +3 -0
  153. package/dist/components/HeaderStandardAnimated/index.mjs.map +1 -0
  154. package/dist/components/HeaderStandardAnimated/useHeaderStandardAnimated.cjs +62 -0
  155. package/dist/components/HeaderStandardAnimated/useHeaderStandardAnimated.cjs.map +1 -0
  156. package/dist/components/HeaderStandardAnimated/useHeaderStandardAnimated.d.cts +39 -0
  157. package/dist/components/HeaderStandardAnimated/useHeaderStandardAnimated.d.cts.map +1 -0
  158. package/dist/components/HeaderStandardAnimated/useHeaderStandardAnimated.d.mts +39 -0
  159. package/dist/components/HeaderStandardAnimated/useHeaderStandardAnimated.d.mts.map +1 -0
  160. package/dist/components/HeaderStandardAnimated/useHeaderStandardAnimated.mjs +57 -0
  161. package/dist/components/HeaderStandardAnimated/useHeaderStandardAnimated.mjs.map +1 -0
  162. package/dist/components/Icon/Icon.assets.cjs +14 -0
  163. package/dist/components/Icon/Icon.assets.cjs.map +1 -1
  164. package/dist/components/Icon/Icon.assets.d.cts.map +1 -1
  165. package/dist/components/Icon/Icon.assets.d.mts.map +1 -1
  166. package/dist/components/Icon/Icon.assets.mjs +14 -0
  167. package/dist/components/Icon/Icon.assets.mjs.map +1 -1
  168. package/dist/components/Icon/Icon.cjs +2 -2
  169. package/dist/components/Icon/Icon.cjs.map +1 -1
  170. package/dist/components/Icon/Icon.d.cts.map +1 -1
  171. package/dist/components/Icon/Icon.d.mts.map +1 -1
  172. package/dist/components/Icon/Icon.mjs +1 -1
  173. package/dist/components/Icon/Icon.mjs.map +1 -1
  174. package/dist/components/Icon/assets/candlestick.svg +1 -1
  175. package/dist/components/Icon/assets/group.svg +1 -0
  176. package/dist/components/Icon/assets/list-arrow.svg +1 -0
  177. package/dist/components/Icon/assets/merge.svg +1 -0
  178. package/dist/components/Icon/assets/musd-filled.svg +1 -0
  179. package/dist/components/Icon/assets/musd.svg +1 -0
  180. package/dist/components/Icon/assets/pie-chart.svg +1 -0
  181. package/dist/components/Icon/assets/predictions.svg +1 -0
  182. package/dist/components/Icon/index.cjs +4 -4
  183. package/dist/components/Icon/index.cjs.map +1 -1
  184. package/dist/components/Icon/index.d.cts +1 -1
  185. package/dist/components/Icon/index.d.cts.map +1 -1
  186. package/dist/components/Icon/index.d.mts +1 -1
  187. package/dist/components/Icon/index.d.mts.map +1 -1
  188. package/dist/components/Icon/index.mjs +1 -1
  189. package/dist/components/Icon/index.mjs.map +1 -1
  190. package/dist/components/IconAlert/IconAlert.constants.cjs +8 -9
  191. package/dist/components/IconAlert/IconAlert.constants.cjs.map +1 -1
  192. package/dist/components/IconAlert/IconAlert.constants.d.cts +1 -2
  193. package/dist/components/IconAlert/IconAlert.constants.d.cts.map +1 -1
  194. package/dist/components/IconAlert/IconAlert.constants.d.mts +1 -2
  195. package/dist/components/IconAlert/IconAlert.constants.d.mts.map +1 -1
  196. package/dist/components/IconAlert/IconAlert.constants.mjs +1 -2
  197. package/dist/components/IconAlert/IconAlert.constants.mjs.map +1 -1
  198. package/dist/components/Input/Input.cjs +35 -25
  199. package/dist/components/Input/Input.cjs.map +1 -1
  200. package/dist/components/Input/Input.d.cts +1 -7
  201. package/dist/components/Input/Input.d.cts.map +1 -1
  202. package/dist/components/Input/Input.d.mts +1 -7
  203. package/dist/components/Input/Input.d.mts.map +1 -1
  204. package/dist/components/Input/Input.mjs +36 -26
  205. package/dist/components/Input/Input.mjs.map +1 -1
  206. package/dist/components/Input/Input.types.cjs.map +1 -1
  207. package/dist/components/Input/Input.types.d.cts +2 -30
  208. package/dist/components/Input/Input.types.d.cts.map +1 -1
  209. package/dist/components/Input/Input.types.d.mts +2 -30
  210. package/dist/components/Input/Input.types.d.mts.map +1 -1
  211. package/dist/components/Input/Input.types.mjs.map +1 -1
  212. package/dist/components/Tag/Tag.constants.cjs +5 -6
  213. package/dist/components/Tag/Tag.constants.cjs.map +1 -1
  214. package/dist/components/Tag/Tag.constants.d.cts +1 -2
  215. package/dist/components/Tag/Tag.constants.d.cts.map +1 -1
  216. package/dist/components/Tag/Tag.constants.d.mts +1 -2
  217. package/dist/components/Tag/Tag.constants.d.mts.map +1 -1
  218. package/dist/components/Tag/Tag.constants.mjs +1 -2
  219. package/dist/components/Tag/Tag.constants.mjs.map +1 -1
  220. package/dist/components/TextArea/TextArea.cjs +38 -0
  221. package/dist/components/TextArea/TextArea.cjs.map +1 -0
  222. package/dist/components/TextArea/TextArea.d.cts +166 -0
  223. package/dist/components/TextArea/TextArea.d.cts.map +1 -0
  224. package/dist/components/TextArea/TextArea.d.mts +166 -0
  225. package/dist/components/TextArea/TextArea.d.mts.map +1 -0
  226. package/dist/components/TextArea/TextArea.mjs +35 -0
  227. package/dist/components/TextArea/TextArea.mjs.map +1 -0
  228. package/dist/components/TextArea/TextArea.types.cjs +3 -0
  229. package/dist/components/TextArea/TextArea.types.cjs.map +1 -0
  230. package/dist/components/TextArea/TextArea.types.d.cts +63 -0
  231. package/dist/components/TextArea/TextArea.types.d.cts.map +1 -0
  232. package/dist/components/TextArea/TextArea.types.d.mts +63 -0
  233. package/dist/components/TextArea/TextArea.types.d.mts.map +1 -0
  234. package/dist/components/TextArea/TextArea.types.mjs +2 -0
  235. package/dist/components/TextArea/TextArea.types.mjs.map +1 -0
  236. package/dist/components/TextArea/index.cjs +6 -0
  237. package/dist/components/TextArea/index.cjs.map +1 -0
  238. package/dist/components/TextArea/index.d.cts +3 -0
  239. package/dist/components/TextArea/index.d.cts.map +1 -0
  240. package/dist/components/TextArea/index.d.mts +3 -0
  241. package/dist/components/TextArea/index.d.mts.map +1 -0
  242. package/dist/components/TextArea/index.mjs +2 -0
  243. package/dist/components/TextArea/index.mjs.map +1 -0
  244. package/dist/components/TextField/TextField.cjs +1 -2
  245. package/dist/components/TextField/TextField.cjs.map +1 -1
  246. package/dist/components/TextField/TextField.d.cts +8 -2
  247. package/dist/components/TextField/TextField.d.cts.map +1 -1
  248. package/dist/components/TextField/TextField.d.mts +8 -2
  249. package/dist/components/TextField/TextField.d.mts.map +1 -1
  250. package/dist/components/TextField/TextField.mjs +1 -2
  251. package/dist/components/TextField/TextField.mjs.map +1 -1
  252. package/dist/components/TextField/TextField.types.cjs.map +1 -1
  253. package/dist/components/TextField/TextField.types.d.cts +5 -1
  254. package/dist/components/TextField/TextField.types.d.cts.map +1 -1
  255. package/dist/components/TextField/TextField.types.d.mts +5 -1
  256. package/dist/components/TextField/TextField.types.d.mts.map +1 -1
  257. package/dist/components/TextField/TextField.types.mjs.map +1 -1
  258. package/dist/components/TextFieldSearch/TextFieldSearch.d.cts +8 -2
  259. package/dist/components/TextFieldSearch/TextFieldSearch.d.cts.map +1 -1
  260. package/dist/components/TextFieldSearch/TextFieldSearch.d.mts +8 -2
  261. package/dist/components/TextFieldSearch/TextFieldSearch.d.mts.map +1 -1
  262. package/dist/components/Toast/Toast.cjs +43 -52
  263. package/dist/components/Toast/Toast.cjs.map +1 -1
  264. package/dist/components/Toast/Toast.constants.cjs +8 -1
  265. package/dist/components/Toast/Toast.constants.cjs.map +1 -1
  266. package/dist/components/Toast/Toast.constants.d.cts +5 -0
  267. package/dist/components/Toast/Toast.constants.d.cts.map +1 -1
  268. package/dist/components/Toast/Toast.constants.d.mts +5 -0
  269. package/dist/components/Toast/Toast.constants.d.mts.map +1 -1
  270. package/dist/components/Toast/Toast.constants.mjs +7 -0
  271. package/dist/components/Toast/Toast.constants.mjs.map +1 -1
  272. package/dist/components/Toast/Toast.d.cts +2 -17
  273. package/dist/components/Toast/Toast.d.cts.map +1 -1
  274. package/dist/components/Toast/Toast.d.mts +2 -17
  275. package/dist/components/Toast/Toast.d.mts.map +1 -1
  276. package/dist/components/Toast/Toast.mjs +40 -30
  277. package/dist/components/Toast/Toast.mjs.map +1 -1
  278. package/dist/components/Toast/Toast.types.cjs +9 -14
  279. package/dist/components/Toast/Toast.types.cjs.map +1 -1
  280. package/dist/components/Toast/Toast.types.d.cts +29 -91
  281. package/dist/components/Toast/Toast.types.d.cts.map +1 -1
  282. package/dist/components/Toast/Toast.types.d.mts +29 -91
  283. package/dist/components/Toast/Toast.types.d.mts.map +1 -1
  284. package/dist/components/Toast/Toast.types.mjs +8 -13
  285. package/dist/components/Toast/Toast.types.mjs.map +1 -1
  286. package/dist/components/Toast/Toaster.cjs +142 -0
  287. package/dist/components/Toast/Toaster.cjs.map +1 -0
  288. package/dist/components/Toast/Toaster.d.cts +11 -0
  289. package/dist/components/Toast/Toaster.d.cts.map +1 -0
  290. package/dist/components/Toast/Toaster.d.mts +11 -0
  291. package/dist/components/Toast/Toaster.d.mts.map +1 -0
  292. package/dist/components/Toast/Toaster.mjs +123 -0
  293. package/dist/components/Toast/Toaster.mjs.map +1 -0
  294. package/dist/components/Toast/index.cjs +5 -3
  295. package/dist/components/Toast/index.cjs.map +1 -1
  296. package/dist/components/Toast/index.d.cts +3 -2
  297. package/dist/components/Toast/index.d.cts.map +1 -1
  298. package/dist/components/Toast/index.d.mts +3 -2
  299. package/dist/components/Toast/index.d.mts.map +1 -1
  300. package/dist/components/Toast/index.mjs +2 -1
  301. package/dist/components/Toast/index.mjs.map +1 -1
  302. package/dist/components/index.cjs +12 -4
  303. package/dist/components/index.cjs.map +1 -1
  304. package/dist/components/index.d.cts +8 -2
  305. package/dist/components/index.d.cts.map +1 -1
  306. package/dist/components/index.d.mts +8 -2
  307. package/dist/components/index.d.mts.map +1 -1
  308. package/dist/components/index.mjs +4 -1
  309. package/dist/components/index.mjs.map +1 -1
  310. package/dist/components/temp-components/HeaderStandardCenterColumn/HeaderStandardCenterColumn.cjs +36 -0
  311. package/dist/components/temp-components/HeaderStandardCenterColumn/HeaderStandardCenterColumn.cjs.map +1 -0
  312. package/dist/components/temp-components/HeaderStandardCenterColumn/HeaderStandardCenterColumn.d.cts +4 -0
  313. package/dist/components/temp-components/HeaderStandardCenterColumn/HeaderStandardCenterColumn.d.cts.map +1 -0
  314. package/dist/components/temp-components/HeaderStandardCenterColumn/HeaderStandardCenterColumn.d.mts +4 -0
  315. package/dist/components/temp-components/HeaderStandardCenterColumn/HeaderStandardCenterColumn.d.mts.map +1 -0
  316. package/dist/components/temp-components/HeaderStandardCenterColumn/HeaderStandardCenterColumn.mjs +36 -0
  317. package/dist/components/temp-components/HeaderStandardCenterColumn/HeaderStandardCenterColumn.mjs.map +1 -0
  318. package/dist/components/temp-components/HeaderStandardCenterColumn/HeaderStandardCenterColumn.types.cjs +8 -0
  319. package/dist/components/temp-components/HeaderStandardCenterColumn/HeaderStandardCenterColumn.types.cjs.map +1 -0
  320. package/dist/components/temp-components/HeaderStandardCenterColumn/HeaderStandardCenterColumn.types.d.cts +39 -0
  321. package/dist/components/temp-components/HeaderStandardCenterColumn/HeaderStandardCenterColumn.types.d.cts.map +1 -0
  322. package/dist/components/temp-components/HeaderStandardCenterColumn/HeaderStandardCenterColumn.types.d.mts +39 -0
  323. package/dist/components/temp-components/HeaderStandardCenterColumn/HeaderStandardCenterColumn.types.d.mts.map +1 -0
  324. package/dist/components/temp-components/HeaderStandardCenterColumn/HeaderStandardCenterColumn.types.mjs +10 -0
  325. package/dist/components/temp-components/HeaderStandardCenterColumn/HeaderStandardCenterColumn.types.mjs.map +1 -0
  326. package/dist/components/temp-components/HeaderStandardCenterColumn/index.cjs +6 -0
  327. package/dist/components/temp-components/HeaderStandardCenterColumn/index.cjs.map +1 -0
  328. package/dist/components/temp-components/HeaderStandardCenterColumn/index.d.cts +3 -0
  329. package/dist/components/temp-components/HeaderStandardCenterColumn/index.d.cts.map +1 -0
  330. package/dist/components/temp-components/HeaderStandardCenterColumn/index.d.mts +3 -0
  331. package/dist/components/temp-components/HeaderStandardCenterColumn/index.d.mts.map +1 -0
  332. package/dist/components/temp-components/HeaderStandardCenterColumn/index.mjs +2 -0
  333. package/dist/components/temp-components/HeaderStandardCenterColumn/index.mjs.map +1 -0
  334. package/dist/types/index.cjs +3 -15
  335. package/dist/types/index.cjs.map +1 -1
  336. package/dist/types/index.d.cts +0 -10
  337. package/dist/types/index.d.cts.map +1 -1
  338. package/dist/types/index.d.mts +0 -10
  339. package/dist/types/index.d.mts.map +1 -1
  340. package/dist/types/index.mjs +0 -11
  341. package/dist/types/index.mjs.map +1 -1
  342. package/package.json +4 -4
  343. package/dist/components/Toast/ToastView.cjs +0 -174
  344. package/dist/components/Toast/ToastView.cjs.map +0 -1
  345. package/dist/components/Toast/ToastView.d.cts +0 -7
  346. package/dist/components/Toast/ToastView.d.cts.map +0 -1
  347. package/dist/components/Toast/ToastView.d.mts +0 -7
  348. package/dist/components/Toast/ToastView.d.mts.map +0 -1
  349. package/dist/components/Toast/ToastView.mjs +0 -155
  350. package/dist/components/Toast/ToastView.mjs.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"TextField.types.cjs","sourceRoot":"","sources":["../../../src/components/TextField/TextField.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { TextFieldPropsShared } from '@metamask-previews/design-system-shared';\nimport type { Ref } from 'react';\nimport type { StyleProp, TextInput, ViewStyle } from 'react-native';\n\nimport type { BoxProps } from '../Box/Box.types';\nimport type { InputProps } from '../Input/Input.types';\n\n/**\n * Additional props merged onto the inner `Input` (`../Input/Input.tsx`).\n *\n * TextField owns `value`, `onChangeText`, `placeholder`, `isReadOnly`, `onFocus`,\n * `onBlur`, `isDisabled`, `autoFocus`, typography, and inner layout (merged with\n * any `twClassName` you pass here). `placeholderTextColor` is omitted (Input sets\n * it from theme).\n */\ntype TextFieldInputProps = Omit<\n InputProps,\n | 'autoFocus'\n | 'isDisabled'\n | 'isReadOnly'\n | 'isStateStylesDisabled'\n | 'onBlur'\n | 'onChangeText'\n | 'onFocus'\n | 'placeholder'\n | 'placeholderTextColor'\n | 'style'\n | 'textVariant'\n | 'value'\n>;\n\n/**\n * React Native `TextField` props between `TextFieldPropsShared` and the root\n * `Box`: typed focus/blur handlers, `inputProps`, container styling, and\n * `testID`.\n */\nexport type TextFieldBaseProps = TextFieldPropsShared & {\n /**\n * Called when the inner input receives focus (composed with TextField border state).\n */\n onFocus?: InputProps['onFocus'];\n /**\n * Called when the inner input loses focus (composed with TextField border state).\n */\n onBlur?: InputProps['onBlur'];\n /**\n * Additional props for the inner `Input`. Do not pass `placeholder`, `isReadOnly`, `onFocus`, or `onBlur` here;\n * use the TextField-level props above. For accessibility, prefer `accessibilityLabel` and `accessibilityHint` on\n * `inputProps` (for example hint text can note that a field is required). `placeholderTextColor` is omitted from the\n * type; the inner `Input` sets it from the theme.\n */\n inputProps?: TextFieldInputProps;\n /**\n * Ref to the inner `TextInput`. The component `ref` targets the root `Box` (`View`).\n */\n inputRef?: Ref<TextInput>;\n /**\n * Optional twrnc classes for the root `Box`.\n */\n twClassName?: string;\n /**\n * Optional style for the root `Box`.\n */\n style?: StyleProp<ViewStyle>;\n /**\n * Optional test id for the root `Box`.\n */\n testID?: string;\n};\n\ntype TextFieldReservedBoxKeys =\n | keyof TextFieldBaseProps\n | 'accessible'\n | 'children'\n | 'style';\n\n/**\n * TextField props: `TextFieldBaseProps` plus remaining `BoxProps` at the top\n * level, excluding keys reserved by TextField.\n */\nexport type TextFieldProps = TextFieldBaseProps &\n Omit<BoxProps, TextFieldReservedBoxKeys>;\n"]}
1
+ {"version":3,"file":"TextField.types.cjs","sourceRoot":"","sources":["../../../src/components/TextField/TextField.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { TextFieldPropsShared } from '@metamask-previews/design-system-shared';\nimport type { Ref } from 'react';\nimport type { StyleProp, TextInput, ViewStyle } from 'react-native';\n\nimport type { BoxProps } from '../Box/Box.types';\nimport type { InputProps } from '../Input/Input.types';\n\n/**\n * Additional props merged onto the inner `Input` (`../Input/Input.tsx`).\n *\n * TextField owns `value`, `onChangeText`, `placeholder`, `isReadOnly`, `onFocus`,\n * `onBlur`, `isDisabled`, `autoFocus`, and inner layout (merged with\n * any `twClassName` you pass here). `placeholderTextColor` is omitted (Input sets\n * it from theme).\n */\ntype TextFieldInputProps = Omit<\n InputProps,\n | 'autoFocus'\n | 'isDisabled'\n | 'isReadOnly'\n | 'isStateStylesDisabled'\n | 'onBlur'\n | 'onChangeText'\n | 'onFocus'\n | 'placeholder'\n | 'placeholderTextColor'\n | 'style'\n | 'textVariant'\n | 'value'\n>;\n\n/**\n * React Native `TextField` props between `TextFieldPropsShared` and the root\n * `Box`: typed focus/blur handlers, `inputProps`, container styling, and\n * `testID`.\n */\nexport type TextFieldBaseProps = TextFieldPropsShared & {\n /**\n * Called when the inner `TextInput` value changes (React Native naming).\n */\n onChangeText?: (text: string) => void;\n /**\n * Called when the inner input receives focus (composed with TextField border state).\n */\n onFocus?: InputProps['onFocus'];\n /**\n * Called when the inner input loses focus (composed with TextField border state).\n */\n onBlur?: InputProps['onBlur'];\n /**\n * Additional props for the inner `Input`. Do not pass `placeholder`, `isReadOnly`, `onFocus`, or `onBlur` here;\n * use the TextField-level props above. For accessibility, prefer `accessibilityLabel` and `accessibilityHint` on\n * `inputProps` (for example hint text can note that a field is required). `placeholderTextColor` is omitted from the\n * type; the inner `Input` sets it from the theme.\n */\n inputProps?: TextFieldInputProps;\n /**\n * Ref to the inner `TextInput`. The component `ref` targets the root `Box` (`View`).\n */\n inputRef?: Ref<TextInput>;\n /**\n * Optional twrnc classes for the root `Box`.\n */\n twClassName?: string;\n /**\n * Optional style for the root `Box`.\n */\n style?: StyleProp<ViewStyle>;\n /**\n * Optional test id for the root `Box`.\n */\n testID?: string;\n};\n\ntype TextFieldReservedBoxKeys =\n | keyof TextFieldBaseProps\n | 'accessible'\n | 'children'\n | 'style';\n\n/**\n * TextField props: `TextFieldBaseProps` plus remaining `BoxProps` at the top\n * level, excluding keys reserved by TextField.\n */\nexport type TextFieldProps = TextFieldBaseProps &\n Omit<BoxProps, TextFieldReservedBoxKeys>;\n"]}
@@ -7,7 +7,7 @@ import type { InputProps } from "../Input/Input.types.cjs";
7
7
  * Additional props merged onto the inner `Input` (`../Input/Input.tsx`).
8
8
  *
9
9
  * TextField owns `value`, `onChangeText`, `placeholder`, `isReadOnly`, `onFocus`,
10
- * `onBlur`, `isDisabled`, `autoFocus`, typography, and inner layout (merged with
10
+ * `onBlur`, `isDisabled`, `autoFocus`, and inner layout (merged with
11
11
  * any `twClassName` you pass here). `placeholderTextColor` is omitted (Input sets
12
12
  * it from theme).
13
13
  */
@@ -18,6 +18,10 @@ type TextFieldInputProps = Omit<InputProps, 'autoFocus' | 'isDisabled' | 'isRead
18
18
  * `testID`.
19
19
  */
20
20
  export type TextFieldBaseProps = TextFieldPropsShared & {
21
+ /**
22
+ * Called when the inner `TextInput` value changes (React Native naming).
23
+ */
24
+ onChangeText?: (text: string) => void;
21
25
  /**
22
26
  * Called when the inner input receives focus (composed with TextField border state).
23
27
  */
@@ -1 +1 @@
1
- {"version":3,"file":"TextField.types.d.cts","sourceRoot":"","sources":["../../../src/components/TextField/TextField.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,gDAAgD;AACpF,OAAO,KAAK,EAAE,GAAG,EAAE,cAAc;AACjC,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,8BAAqB;AAEpE,OAAO,KAAK,EAAE,QAAQ,EAAE,6BAAyB;AACjD,OAAO,KAAK,EAAE,UAAU,EAAE,iCAA6B;AAEvD;;;;;;;GAOG;AACH,KAAK,mBAAmB,GAAG,IAAI,CAC7B,UAAU,EACR,WAAW,GACX,YAAY,GACZ,YAAY,GACZ,uBAAuB,GACvB,QAAQ,GACR,cAAc,GACd,SAAS,GACT,aAAa,GACb,sBAAsB,GACtB,OAAO,GACP,aAAa,GACb,OAAO,CACV,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,kBAAkB,GAAG,oBAAoB,GAAG;IACtD;;OAEG;IACH,OAAO,CAAC,EAAE,UAAU,CAAC,SAAS,CAAC,CAAC;IAChC;;OAEG;IACH,MAAM,CAAC,EAAE,UAAU,CAAC,QAAQ,CAAC,CAAC;IAC9B;;;;;OAKG;IACH,UAAU,CAAC,EAAE,mBAAmB,CAAC;IACjC;;OAEG;IACH,QAAQ,CAAC,EAAE,GAAG,CAAC,SAAS,CAAC,CAAC;IAC1B;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,KAAK,wBAAwB,GACzB,MAAM,kBAAkB,GACxB,YAAY,GACZ,UAAU,GACV,OAAO,CAAC;AAEZ;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG,kBAAkB,GAC7C,IAAI,CAAC,QAAQ,EAAE,wBAAwB,CAAC,CAAC"}
1
+ {"version":3,"file":"TextField.types.d.cts","sourceRoot":"","sources":["../../../src/components/TextField/TextField.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,gDAAgD;AACpF,OAAO,KAAK,EAAE,GAAG,EAAE,cAAc;AACjC,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,8BAAqB;AAEpE,OAAO,KAAK,EAAE,QAAQ,EAAE,6BAAyB;AACjD,OAAO,KAAK,EAAE,UAAU,EAAE,iCAA6B;AAEvD;;;;;;;GAOG;AACH,KAAK,mBAAmB,GAAG,IAAI,CAC7B,UAAU,EACR,WAAW,GACX,YAAY,GACZ,YAAY,GACZ,uBAAuB,GACvB,QAAQ,GACR,cAAc,GACd,SAAS,GACT,aAAa,GACb,sBAAsB,GACtB,OAAO,GACP,aAAa,GACb,OAAO,CACV,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,kBAAkB,GAAG,oBAAoB,GAAG;IACtD;;OAEG;IACH,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC;;OAEG;IACH,OAAO,CAAC,EAAE,UAAU,CAAC,SAAS,CAAC,CAAC;IAChC;;OAEG;IACH,MAAM,CAAC,EAAE,UAAU,CAAC,QAAQ,CAAC,CAAC;IAC9B;;;;;OAKG;IACH,UAAU,CAAC,EAAE,mBAAmB,CAAC;IACjC;;OAEG;IACH,QAAQ,CAAC,EAAE,GAAG,CAAC,SAAS,CAAC,CAAC;IAC1B;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,KAAK,wBAAwB,GACzB,MAAM,kBAAkB,GACxB,YAAY,GACZ,UAAU,GACV,OAAO,CAAC;AAEZ;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG,kBAAkB,GAC7C,IAAI,CAAC,QAAQ,EAAE,wBAAwB,CAAC,CAAC"}
@@ -7,7 +7,7 @@ import type { InputProps } from "../Input/Input.types.mjs";
7
7
  * Additional props merged onto the inner `Input` (`../Input/Input.tsx`).
8
8
  *
9
9
  * TextField owns `value`, `onChangeText`, `placeholder`, `isReadOnly`, `onFocus`,
10
- * `onBlur`, `isDisabled`, `autoFocus`, typography, and inner layout (merged with
10
+ * `onBlur`, `isDisabled`, `autoFocus`, and inner layout (merged with
11
11
  * any `twClassName` you pass here). `placeholderTextColor` is omitted (Input sets
12
12
  * it from theme).
13
13
  */
@@ -18,6 +18,10 @@ type TextFieldInputProps = Omit<InputProps, 'autoFocus' | 'isDisabled' | 'isRead
18
18
  * `testID`.
19
19
  */
20
20
  export type TextFieldBaseProps = TextFieldPropsShared & {
21
+ /**
22
+ * Called when the inner `TextInput` value changes (React Native naming).
23
+ */
24
+ onChangeText?: (text: string) => void;
21
25
  /**
22
26
  * Called when the inner input receives focus (composed with TextField border state).
23
27
  */
@@ -1 +1 @@
1
- {"version":3,"file":"TextField.types.d.mts","sourceRoot":"","sources":["../../../src/components/TextField/TextField.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,gDAAgD;AACpF,OAAO,KAAK,EAAE,GAAG,EAAE,cAAc;AACjC,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,8BAAqB;AAEpE,OAAO,KAAK,EAAE,QAAQ,EAAE,6BAAyB;AACjD,OAAO,KAAK,EAAE,UAAU,EAAE,iCAA6B;AAEvD;;;;;;;GAOG;AACH,KAAK,mBAAmB,GAAG,IAAI,CAC7B,UAAU,EACR,WAAW,GACX,YAAY,GACZ,YAAY,GACZ,uBAAuB,GACvB,QAAQ,GACR,cAAc,GACd,SAAS,GACT,aAAa,GACb,sBAAsB,GACtB,OAAO,GACP,aAAa,GACb,OAAO,CACV,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,kBAAkB,GAAG,oBAAoB,GAAG;IACtD;;OAEG;IACH,OAAO,CAAC,EAAE,UAAU,CAAC,SAAS,CAAC,CAAC;IAChC;;OAEG;IACH,MAAM,CAAC,EAAE,UAAU,CAAC,QAAQ,CAAC,CAAC;IAC9B;;;;;OAKG;IACH,UAAU,CAAC,EAAE,mBAAmB,CAAC;IACjC;;OAEG;IACH,QAAQ,CAAC,EAAE,GAAG,CAAC,SAAS,CAAC,CAAC;IAC1B;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,KAAK,wBAAwB,GACzB,MAAM,kBAAkB,GACxB,YAAY,GACZ,UAAU,GACV,OAAO,CAAC;AAEZ;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG,kBAAkB,GAC7C,IAAI,CAAC,QAAQ,EAAE,wBAAwB,CAAC,CAAC"}
1
+ {"version":3,"file":"TextField.types.d.mts","sourceRoot":"","sources":["../../../src/components/TextField/TextField.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,gDAAgD;AACpF,OAAO,KAAK,EAAE,GAAG,EAAE,cAAc;AACjC,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,8BAAqB;AAEpE,OAAO,KAAK,EAAE,QAAQ,EAAE,6BAAyB;AACjD,OAAO,KAAK,EAAE,UAAU,EAAE,iCAA6B;AAEvD;;;;;;;GAOG;AACH,KAAK,mBAAmB,GAAG,IAAI,CAC7B,UAAU,EACR,WAAW,GACX,YAAY,GACZ,YAAY,GACZ,uBAAuB,GACvB,QAAQ,GACR,cAAc,GACd,SAAS,GACT,aAAa,GACb,sBAAsB,GACtB,OAAO,GACP,aAAa,GACb,OAAO,CACV,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,kBAAkB,GAAG,oBAAoB,GAAG;IACtD;;OAEG;IACH,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC;;OAEG;IACH,OAAO,CAAC,EAAE,UAAU,CAAC,SAAS,CAAC,CAAC;IAChC;;OAEG;IACH,MAAM,CAAC,EAAE,UAAU,CAAC,QAAQ,CAAC,CAAC;IAC9B;;;;;OAKG;IACH,UAAU,CAAC,EAAE,mBAAmB,CAAC;IACjC;;OAEG;IACH,QAAQ,CAAC,EAAE,GAAG,CAAC,SAAS,CAAC,CAAC;IAC1B;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,KAAK,wBAAwB,GACzB,MAAM,kBAAkB,GACxB,YAAY,GACZ,UAAU,GACV,OAAO,CAAC;AAEZ;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG,kBAAkB,GAC7C,IAAI,CAAC,QAAQ,EAAE,wBAAwB,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"TextField.types.mjs","sourceRoot":"","sources":["../../../src/components/TextField/TextField.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { TextFieldPropsShared } from '@metamask-previews/design-system-shared';\nimport type { Ref } from 'react';\nimport type { StyleProp, TextInput, ViewStyle } from 'react-native';\n\nimport type { BoxProps } from '../Box/Box.types';\nimport type { InputProps } from '../Input/Input.types';\n\n/**\n * Additional props merged onto the inner `Input` (`../Input/Input.tsx`).\n *\n * TextField owns `value`, `onChangeText`, `placeholder`, `isReadOnly`, `onFocus`,\n * `onBlur`, `isDisabled`, `autoFocus`, typography, and inner layout (merged with\n * any `twClassName` you pass here). `placeholderTextColor` is omitted (Input sets\n * it from theme).\n */\ntype TextFieldInputProps = Omit<\n InputProps,\n | 'autoFocus'\n | 'isDisabled'\n | 'isReadOnly'\n | 'isStateStylesDisabled'\n | 'onBlur'\n | 'onChangeText'\n | 'onFocus'\n | 'placeholder'\n | 'placeholderTextColor'\n | 'style'\n | 'textVariant'\n | 'value'\n>;\n\n/**\n * React Native `TextField` props between `TextFieldPropsShared` and the root\n * `Box`: typed focus/blur handlers, `inputProps`, container styling, and\n * `testID`.\n */\nexport type TextFieldBaseProps = TextFieldPropsShared & {\n /**\n * Called when the inner input receives focus (composed with TextField border state).\n */\n onFocus?: InputProps['onFocus'];\n /**\n * Called when the inner input loses focus (composed with TextField border state).\n */\n onBlur?: InputProps['onBlur'];\n /**\n * Additional props for the inner `Input`. Do not pass `placeholder`, `isReadOnly`, `onFocus`, or `onBlur` here;\n * use the TextField-level props above. For accessibility, prefer `accessibilityLabel` and `accessibilityHint` on\n * `inputProps` (for example hint text can note that a field is required). `placeholderTextColor` is omitted from the\n * type; the inner `Input` sets it from the theme.\n */\n inputProps?: TextFieldInputProps;\n /**\n * Ref to the inner `TextInput`. The component `ref` targets the root `Box` (`View`).\n */\n inputRef?: Ref<TextInput>;\n /**\n * Optional twrnc classes for the root `Box`.\n */\n twClassName?: string;\n /**\n * Optional style for the root `Box`.\n */\n style?: StyleProp<ViewStyle>;\n /**\n * Optional test id for the root `Box`.\n */\n testID?: string;\n};\n\ntype TextFieldReservedBoxKeys =\n | keyof TextFieldBaseProps\n | 'accessible'\n | 'children'\n | 'style';\n\n/**\n * TextField props: `TextFieldBaseProps` plus remaining `BoxProps` at the top\n * level, excluding keys reserved by TextField.\n */\nexport type TextFieldProps = TextFieldBaseProps &\n Omit<BoxProps, TextFieldReservedBoxKeys>;\n"]}
1
+ {"version":3,"file":"TextField.types.mjs","sourceRoot":"","sources":["../../../src/components/TextField/TextField.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { TextFieldPropsShared } from '@metamask-previews/design-system-shared';\nimport type { Ref } from 'react';\nimport type { StyleProp, TextInput, ViewStyle } from 'react-native';\n\nimport type { BoxProps } from '../Box/Box.types';\nimport type { InputProps } from '../Input/Input.types';\n\n/**\n * Additional props merged onto the inner `Input` (`../Input/Input.tsx`).\n *\n * TextField owns `value`, `onChangeText`, `placeholder`, `isReadOnly`, `onFocus`,\n * `onBlur`, `isDisabled`, `autoFocus`, and inner layout (merged with\n * any `twClassName` you pass here). `placeholderTextColor` is omitted (Input sets\n * it from theme).\n */\ntype TextFieldInputProps = Omit<\n InputProps,\n | 'autoFocus'\n | 'isDisabled'\n | 'isReadOnly'\n | 'isStateStylesDisabled'\n | 'onBlur'\n | 'onChangeText'\n | 'onFocus'\n | 'placeholder'\n | 'placeholderTextColor'\n | 'style'\n | 'textVariant'\n | 'value'\n>;\n\n/**\n * React Native `TextField` props between `TextFieldPropsShared` and the root\n * `Box`: typed focus/blur handlers, `inputProps`, container styling, and\n * `testID`.\n */\nexport type TextFieldBaseProps = TextFieldPropsShared & {\n /**\n * Called when the inner `TextInput` value changes (React Native naming).\n */\n onChangeText?: (text: string) => void;\n /**\n * Called when the inner input receives focus (composed with TextField border state).\n */\n onFocus?: InputProps['onFocus'];\n /**\n * Called when the inner input loses focus (composed with TextField border state).\n */\n onBlur?: InputProps['onBlur'];\n /**\n * Additional props for the inner `Input`. Do not pass `placeholder`, `isReadOnly`, `onFocus`, or `onBlur` here;\n * use the TextField-level props above. For accessibility, prefer `accessibilityLabel` and `accessibilityHint` on\n * `inputProps` (for example hint text can note that a field is required). `placeholderTextColor` is omitted from the\n * type; the inner `Input` sets it from the theme.\n */\n inputProps?: TextFieldInputProps;\n /**\n * Ref to the inner `TextInput`. The component `ref` targets the root `Box` (`View`).\n */\n inputRef?: Ref<TextInput>;\n /**\n * Optional twrnc classes for the root `Box`.\n */\n twClassName?: string;\n /**\n * Optional style for the root `Box`.\n */\n style?: StyleProp<ViewStyle>;\n /**\n * Optional test id for the root `Box`.\n */\n testID?: string;\n};\n\ntype TextFieldReservedBoxKeys =\n | keyof TextFieldBaseProps\n | 'accessible'\n | 'children'\n | 'style';\n\n/**\n * TextField props: `TextFieldBaseProps` plus remaining `BoxProps` at the top\n * level, excluding keys reserved by TextField.\n */\nexport type TextFieldProps = TextFieldBaseProps &\n Omit<BoxProps, TextFieldReservedBoxKeys>;\n"]}
@@ -1,6 +1,12 @@
1
1
  import React from "react";
2
2
  import type { View } from "react-native/index.js";
3
- export declare const TextFieldSearch: React.ForwardRefExoticComponent<import("@metamask-previews/design-system-shared").TextFieldPropsShared & {
3
+ export declare const TextFieldSearch: React.ForwardRefExoticComponent<Omit<import("@metamask-previews/design-system-shared").InputPropsShared, "textVariant" | "isStateStylesDisabled"> & {
4
+ isError?: boolean | undefined;
5
+ startAccessory?: React.ReactNode;
6
+ endAccessory?: React.ReactNode;
7
+ inputElement?: React.ReactNode;
8
+ } & {
9
+ onChangeText?: ((text: string) => void) | undefined;
4
10
  onFocus?: ((e: import("react-native").NativeSyntheticEvent<import("react-native").TextInputFocusEventData>) => void) | undefined;
5
11
  onBlur?: ((e: import("react-native").NativeSyntheticEvent<import("react-native").TextInputFocusEventData>) => void) | undefined;
6
12
  inputProps?: {
@@ -159,7 +165,7 @@ export declare const TextFieldSearch: React.ForwardRefExoticComponent<import("@m
159
165
  twClassName?: string | undefined;
160
166
  style?: import("react-native").StyleProp<import("react-native").ViewStyle>;
161
167
  testID?: string | undefined;
162
- } & Omit<import("../index.cjs").BoxProps, "children" | "style" | "testID" | "accessible" | "twClassName" | "onBlur" | "onFocus" | keyof import("@metamask-previews/design-system-shared").TextFieldPropsShared | "inputProps" | "inputRef"> & {
168
+ } & Omit<import("../index.cjs").BoxProps, "children" | "style" | "testID" | "accessible" | "twClassName" | "onBlur" | "onFocus" | "startAccessory" | "endAccessory" | "isDisabled" | "value" | "autoFocus" | "onChangeText" | "placeholder" | "isReadOnly" | "isError" | "inputElement" | "inputProps" | "inputRef"> & {
163
169
  clearButtonProps?: Partial<import("../ButtonIcon/index.cjs").ButtonIconProps> | undefined;
164
170
  onPressClearButton: () => void;
165
171
  } & React.RefAttributes<View>>;
@@ -1 +1 @@
1
- {"version":3,"file":"TextFieldSearch.d.cts","sourceRoot":"","sources":["../../../src/components/TextFieldSearch/TextFieldSearch.tsx"],"names":[],"mappings":"AACA,OAAO,KAAkC,cAAc;AACvD,OAAO,KAAK,EAAE,IAAI,EAAE,8BAAqB;AAQzC,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8BAwD3B,CAAC"}
1
+ {"version":3,"file":"TextFieldSearch.d.cts","sourceRoot":"","sources":["../../../src/components/TextFieldSearch/TextFieldSearch.tsx"],"names":[],"mappings":"AACA,OAAO,KAAkC,cAAc;AACvD,OAAO,KAAK,EAAE,IAAI,EAAE,8BAAqB;AAQzC,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8BAwD3B,CAAC"}
@@ -1,6 +1,12 @@
1
1
  import React from "react";
2
2
  import type { View } from "react-native/index.js";
3
- export declare const TextFieldSearch: React.ForwardRefExoticComponent<import("@metamask-previews/design-system-shared").TextFieldPropsShared & {
3
+ export declare const TextFieldSearch: React.ForwardRefExoticComponent<Omit<import("@metamask-previews/design-system-shared").InputPropsShared, "textVariant" | "isStateStylesDisabled"> & {
4
+ isError?: boolean | undefined;
5
+ startAccessory?: React.ReactNode;
6
+ endAccessory?: React.ReactNode;
7
+ inputElement?: React.ReactNode;
8
+ } & {
9
+ onChangeText?: ((text: string) => void) | undefined;
4
10
  onFocus?: ((e: import("react-native").NativeSyntheticEvent<import("react-native").TextInputFocusEventData>) => void) | undefined;
5
11
  onBlur?: ((e: import("react-native").NativeSyntheticEvent<import("react-native").TextInputFocusEventData>) => void) | undefined;
6
12
  inputProps?: {
@@ -159,7 +165,7 @@ export declare const TextFieldSearch: React.ForwardRefExoticComponent<import("@m
159
165
  twClassName?: string | undefined;
160
166
  style?: import("react-native").StyleProp<import("react-native").ViewStyle>;
161
167
  testID?: string | undefined;
162
- } & Omit<import("../index.mjs").BoxProps, "children" | "style" | "testID" | "accessible" | "twClassName" | "onBlur" | "onFocus" | keyof import("@metamask-previews/design-system-shared").TextFieldPropsShared | "inputProps" | "inputRef"> & {
168
+ } & Omit<import("../index.mjs").BoxProps, "children" | "style" | "testID" | "accessible" | "twClassName" | "onBlur" | "onFocus" | "startAccessory" | "endAccessory" | "isDisabled" | "value" | "autoFocus" | "onChangeText" | "placeholder" | "isReadOnly" | "isError" | "inputElement" | "inputProps" | "inputRef"> & {
163
169
  clearButtonProps?: Partial<import("../ButtonIcon/index.mjs").ButtonIconProps> | undefined;
164
170
  onPressClearButton: () => void;
165
171
  } & React.RefAttributes<View>>;
@@ -1 +1 @@
1
- {"version":3,"file":"TextFieldSearch.d.mts","sourceRoot":"","sources":["../../../src/components/TextFieldSearch/TextFieldSearch.tsx"],"names":[],"mappings":"AACA,OAAO,KAAkC,cAAc;AACvD,OAAO,KAAK,EAAE,IAAI,EAAE,8BAAqB;AAQzC,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8BAwD3B,CAAC"}
1
+ {"version":3,"file":"TextFieldSearch.d.mts","sourceRoot":"","sources":["../../../src/components/TextFieldSearch/TextFieldSearch.tsx"],"names":[],"mappings":"AACA,OAAO,KAAkC,cAAc;AACvD,OAAO,KAAK,EAAE,IAAI,EAAE,8BAAqB;AAQzC,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8BAwD3B,CAAC"}
@@ -1,61 +1,52 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
24
4
  };
25
5
  Object.defineProperty(exports, "__esModule", { value: true });
26
6
  exports.Toast = void 0;
27
7
  // Third party dependencies.
28
- const react_1 = __importStar(require("react"));
29
- const ToastView_1 = require("./ToastView.cjs");
30
- let registeredRef = null;
31
- const assertRegisteredRef = (method) => {
32
- if (!registeredRef?.current) {
33
- throw new Error(`Toast.${method}() called before <Toast /> mounted. Render <Toast /> once at the root of your app.`);
8
+ const design_system_shared_1 = require("@metamask-previews/design-system-shared");
9
+ const react_1 = __importDefault(require("react"));
10
+ // External dependencies.
11
+ const BannerBase_1 = require("../BannerBase/index.cjs");
12
+ const IconAlert_1 = require("../IconAlert/index.cjs");
13
+ // Internal dependencies.
14
+ const Toast_constants_1 = require("./Toast.constants.cjs");
15
+ const Toast_types_1 = require("./Toast.types.cjs");
16
+ const renderSeverityAccessory = ({ iconAlertProps, severity, startAccessory, }) => {
17
+ if (startAccessory !== null && startAccessory !== undefined) {
18
+ return startAccessory;
34
19
  }
35
- return registeredRef.current;
36
- };
37
- const ToastComponent = (0, react_1.forwardRef)((props, ref) => {
38
- const innerRef = (0, react_1.useRef)(null);
39
- (0, react_1.useImperativeHandle)(ref, () => ({
40
- showToast: (options) => innerRef.current?.showToast(options),
41
- closeToast: () => innerRef.current?.closeToast(),
42
- }), []);
43
- (0, react_1.useEffect)(() => {
44
- registeredRef = innerRef;
45
- return () => {
46
- if (registeredRef === innerRef) {
47
- registeredRef = null;
48
- }
49
- };
50
- }, []);
51
- return <ToastView_1.ToastView ref={innerRef} {...props}/>;
52
- });
53
- ToastComponent.displayName = 'Toast';
54
- exports.Toast = ToastComponent;
55
- exports.Toast.show = (options) => {
56
- assertRegisteredRef('show').showToast(options);
20
+ if (!severity || severity === Toast_types_1.ToastSeverity.Default) {
21
+ return undefined;
22
+ }
23
+ const iconAlertSeverity = Toast_constants_1.TOAST_SEVERITY_ICON_MAP[severity];
24
+ return (<IconAlert_1.IconAlert severity={iconAlertSeverity} size={design_system_shared_1.IconSize.Lg} {...iconAlertProps}/>);
57
25
  };
58
- exports.Toast.hide = () => {
59
- assertRegisteredRef('hide').closeToast();
26
+ const Toast = ({ actionButtonLabel, actionButtonOnPress, actionButtonProps, children, childrenWrapperProps, closeButtonProps, description, descriptionProps, onClose, iconAlertProps, severity = Toast_types_1.ToastSeverity.Default, startAccessory, title, titleProps, twClassName, ...props }) => {
27
+ const actionProps = actionButtonLabel && actionButtonOnPress
28
+ ? {
29
+ actionButtonLabel,
30
+ actionButtonOnPress,
31
+ actionButtonProps: {
32
+ size: design_system_shared_1.ButtonSize.Sm,
33
+ ...actionButtonProps,
34
+ },
35
+ }
36
+ : {};
37
+ // TODO: Remove this conditional once BannerBase only renders a close button
38
+ // from onClose. At that point Toast can pass closeButtonProps directly.
39
+ const resolvedCloseButtonProps = onClose || closeButtonProps
40
+ ? {
41
+ accessibilityLabel: 'Close toast',
42
+ ...closeButtonProps,
43
+ }
44
+ : undefined;
45
+ return (<BannerBase_1.BannerBase {...actionProps} {...props} backgroundColor={design_system_shared_1.BoxBackgroundColor.BackgroundSection} borderColor={design_system_shared_1.BoxBorderColor.BorderMuted} borderWidth={1} children={children} childrenWrapperProps={childrenWrapperProps} closeButtonProps={resolvedCloseButtonProps} description={description} descriptionProps={descriptionProps} onClose={onClose} startAccessory={renderSeverityAccessory({
46
+ iconAlertProps,
47
+ severity,
48
+ startAccessory,
49
+ })} title={title} titleProps={titleProps} twClassName={twClassName ? `rounded-xl ${twClassName}` : 'rounded-xl'}/>);
60
50
  };
51
+ exports.Toast = Toast;
61
52
  //# sourceMappingURL=Toast.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"Toast.cjs","sourceRoot":"","sources":["../../../src/components/Toast/Toast.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,4BAA4B;AAC5B,+CAKe;AAKf,+CAAwC;AAExC,IAAI,aAAa,GAA+B,IAAI,CAAC;AAErD,MAAM,mBAAmB,GAAG,CAAC,MAAc,EAAY,EAAE;IACvD,IAAI,CAAC,aAAa,EAAE,OAAO,EAAE;QAC3B,MAAM,IAAI,KAAK,CACb,SAAS,MAAM,oFAAoF,CACpG,CAAC;KACH;IACD,OAAO,aAAa,CAAC,OAAO,CAAC;AAC/B,CAAC,CAAC;AAEF,MAAM,cAAc,GAAG,IAAA,kBAAU,EAAuB,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;IACrE,MAAM,QAAQ,GAAG,IAAA,cAAM,EAAW,IAAI,CAAC,CAAC;IAExC,IAAA,2BAAmB,EACjB,GAAG,EACH,GAAG,EAAE,CAAC,CAAC;QACL,SAAS,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,QAAQ,CAAC,OAAO,EAAE,SAAS,CAAC,OAAO,CAAC;QAC5D,UAAU,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,OAAO,EAAE,UAAU,EAAE;KACjD,CAAC,EACF,EAAE,CACH,CAAC;IAEF,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,aAAa,GAAG,QAAQ,CAAC;QACzB,OAAO,GAAG,EAAE;YACV,IAAI,aAAa,KAAK,QAAQ,EAAE;gBAC9B,aAAa,GAAG,IAAI,CAAC;aACtB;QACH,CAAC,CAAC;IACJ,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,CAAC,qBAAS,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,CAAC,IAAI,KAAK,CAAC,EAAG,CAAC;AACjD,CAAC,CAAC,CAAC;AAEH,cAAc,CAAC,WAAW,GAAG,OAAO,CAAC;AAaxB,QAAA,KAAK,GAAG,cAAkC,CAAC;AAExD,aAAK,CAAC,IAAI,GAAG,CAAC,OAAO,EAAE,EAAE;IACvB,mBAAmB,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;AACjD,CAAC,CAAC;AAEF,aAAK,CAAC,IAAI,GAAG,GAAG,EAAE;IAChB,mBAAmB,CAAC,MAAM,CAAC,CAAC,UAAU,EAAE,CAAC;AAC3C,CAAC,CAAC","sourcesContent":["// Third party dependencies.\nimport React, {\n forwardRef,\n useEffect,\n useImperativeHandle,\n useRef,\n} from 'react';\nimport type { RefObject } from 'react';\n\n// Internal dependencies.\nimport type { ToastOptions, ToastProps, ToastRef } from './Toast.types';\nimport { ToastView } from './ToastView';\n\nlet registeredRef: RefObject<ToastRef> | null = null;\n\nconst assertRegisteredRef = (method: string): ToastRef => {\n if (!registeredRef?.current) {\n throw new Error(\n `Toast.${method}() called before <Toast /> mounted. Render <Toast /> once at the root of your app.`,\n );\n }\n return registeredRef.current;\n};\n\nconst ToastComponent = forwardRef<ToastRef, ToastProps>((props, ref) => {\n const innerRef = useRef<ToastRef>(null);\n\n useImperativeHandle(\n ref,\n () => ({\n showToast: (options) => innerRef.current?.showToast(options),\n closeToast: () => innerRef.current?.closeToast(),\n }),\n [],\n );\n\n useEffect(() => {\n registeredRef = innerRef;\n return () => {\n if (registeredRef === innerRef) {\n registeredRef = null;\n }\n };\n }, []);\n\n return <ToastView ref={innerRef} {...props} />;\n});\n\nToastComponent.displayName = 'Toast';\n\ntype ToastWithStatics = typeof ToastComponent & {\n /**\n * Show a toast notification. Requires `<Toast />` to be mounted.\n */\n show: (options: ToastOptions) => void;\n /**\n * Hide the currently visible toast, if any.\n */\n hide: () => void;\n};\n\nexport const Toast = ToastComponent as ToastWithStatics;\n\nToast.show = (options) => {\n assertRegisteredRef('show').showToast(options);\n};\n\nToast.hide = () => {\n assertRegisteredRef('hide').closeToast();\n};\n"]}
1
+ {"version":3,"file":"Toast.cjs","sourceRoot":"","sources":["../../../src/components/Toast/Toast.tsx"],"names":[],"mappings":";;;;;;AAAA,4BAA4B;AAC5B,kFAKiD;AACjD,kDAA0B;AAE1B,yBAAyB;AACzB,wDAA2C;AAC3C,sDAAyC;AAEzC,yBAAyB;AACzB,2DAA4D;AAC5D,mDAA8C;AAG9C,MAAM,uBAAuB,GAAG,CAAC,EAC/B,cAAc,EACd,QAAQ,EACR,cAAc,GACqD,EAAE,EAAE;IACvE,IAAI,cAAc,KAAK,IAAI,IAAI,cAAc,KAAK,SAAS,EAAE;QAC3D,OAAO,cAAc,CAAC;KACvB;IAED,IAAI,CAAC,QAAQ,IAAI,QAAQ,KAAK,2BAAa,CAAC,OAAO,EAAE;QACnD,OAAO,SAAS,CAAC;KAClB;IAED,MAAM,iBAAiB,GAAG,yCAAuB,CAAC,QAAQ,CAAC,CAAC;IAE5D,OAAO,CACL,CAAC,qBAAS,CACR,QAAQ,CAAC,CAAC,iBAAiB,CAAC,CAC5B,IAAI,CAAC,CAAC,+BAAQ,CAAC,EAAE,CAAC,CAClB,IAAI,cAAc,CAAC,EACnB,CACH,CAAC;AACJ,CAAC,CAAC;AAEK,MAAM,KAAK,GAAyB,CAAC,EAC1C,iBAAiB,EACjB,mBAAmB,EACnB,iBAAiB,EACjB,QAAQ,EACR,oBAAoB,EACpB,gBAAgB,EAChB,WAAW,EACX,gBAAgB,EAChB,OAAO,EACP,cAAc,EACd,QAAQ,GAAG,2BAAa,CAAC,OAAO,EAChC,cAAc,EACd,KAAK,EACL,UAAU,EACV,WAAW,EACX,GAAG,KAAK,EACT,EAAE,EAAE;IACH,MAAM,WAAW,GACf,iBAAiB,IAAI,mBAAmB;QACtC,CAAC,CAAC;YACE,iBAAiB;YACjB,mBAAmB;YACnB,iBAAiB,EAAE;gBACjB,IAAI,EAAE,iCAAU,CAAC,EAAE;gBACnB,GAAG,iBAAiB;aACrB;SACF;QACH,CAAC,CAAC,EAAE,CAAC;IACT,4EAA4E;IAC5E,wEAAwE;IACxE,MAAM,wBAAwB,GAC5B,OAAO,IAAI,gBAAgB;QACzB,CAAC,CAAC;YACE,kBAAkB,EAAE,aAAa;YACjC,GAAG,gBAAgB;SACpB;QACH,CAAC,CAAC,SAAS,CAAC;IAEhB,OAAO,CACL,CAAC,uBAAU,CACT,IAAI,WAAW,CAAC,CAChB,IAAI,KAAK,CAAC,CACV,eAAe,CAAC,CAAC,yCAAkB,CAAC,iBAAiB,CAAC,CACtD,WAAW,CAAC,CAAC,qCAAc,CAAC,WAAW,CAAC,CACxC,WAAW,CAAC,CAAC,CAAC,CAAC,CACf,QAAQ,CAAC,CAAC,QAAQ,CAAC,CACnB,oBAAoB,CAAC,CAAC,oBAAoB,CAAC,CAC3C,gBAAgB,CAAC,CAAC,wBAAwB,CAAC,CAC3C,WAAW,CAAC,CAAC,WAAW,CAAC,CACzB,gBAAgB,CAAC,CAAC,gBAAgB,CAAC,CACnC,OAAO,CAAC,CAAC,OAAO,CAAC,CACjB,cAAc,CAAC,CAAC,uBAAuB,CAAC;YACtC,cAAc;YACd,QAAQ;YACR,cAAc;SACf,CAAC,CAAC,CACH,KAAK,CAAC,CAAC,KAAK,CAAC,CACb,UAAU,CAAC,CAAC,UAAU,CAAC,CACvB,WAAW,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,cAAc,WAAW,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC,EACtE,CACH,CAAC;AACJ,CAAC,CAAC;AA9DW,QAAA,KAAK,SA8DhB","sourcesContent":["// Third party dependencies.\nimport {\n BoxBackgroundColor,\n BoxBorderColor,\n ButtonSize,\n IconSize,\n} from '@metamask-previews/design-system-shared';\nimport React from 'react';\n\n// External dependencies.\nimport { BannerBase } from '../BannerBase';\nimport { IconAlert } from '../IconAlert';\n\n// Internal dependencies.\nimport { TOAST_SEVERITY_ICON_MAP } from './Toast.constants';\nimport { ToastSeverity } from './Toast.types';\nimport type { ToastProps } from './Toast.types';\n\nconst renderSeverityAccessory = ({\n iconAlertProps,\n severity,\n startAccessory,\n}: Pick<ToastProps, 'iconAlertProps' | 'severity' | 'startAccessory'>) => {\n if (startAccessory !== null && startAccessory !== undefined) {\n return startAccessory;\n }\n\n if (!severity || severity === ToastSeverity.Default) {\n return undefined;\n }\n\n const iconAlertSeverity = TOAST_SEVERITY_ICON_MAP[severity];\n\n return (\n <IconAlert\n severity={iconAlertSeverity}\n size={IconSize.Lg}\n {...iconAlertProps}\n />\n );\n};\n\nexport const Toast: React.FC<ToastProps> = ({\n actionButtonLabel,\n actionButtonOnPress,\n actionButtonProps,\n children,\n childrenWrapperProps,\n closeButtonProps,\n description,\n descriptionProps,\n onClose,\n iconAlertProps,\n severity = ToastSeverity.Default,\n startAccessory,\n title,\n titleProps,\n twClassName,\n ...props\n}) => {\n const actionProps =\n actionButtonLabel && actionButtonOnPress\n ? {\n actionButtonLabel,\n actionButtonOnPress,\n actionButtonProps: {\n size: ButtonSize.Sm,\n ...actionButtonProps,\n },\n }\n : {};\n // TODO: Remove this conditional once BannerBase only renders a close button\n // from onClose. At that point Toast can pass closeButtonProps directly.\n const resolvedCloseButtonProps =\n onClose || closeButtonProps\n ? {\n accessibilityLabel: 'Close toast',\n ...closeButtonProps,\n }\n : undefined;\n\n return (\n <BannerBase\n {...actionProps}\n {...props}\n backgroundColor={BoxBackgroundColor.BackgroundSection}\n borderColor={BoxBorderColor.BorderMuted}\n borderWidth={1}\n children={children}\n childrenWrapperProps={childrenWrapperProps}\n closeButtonProps={resolvedCloseButtonProps}\n description={description}\n descriptionProps={descriptionProps}\n onClose={onClose}\n startAccessory={renderSeverityAccessory({\n iconAlertProps,\n severity,\n startAccessory,\n })}\n title={title}\n titleProps={titleProps}\n twClassName={twClassName ? `rounded-xl ${twClassName}` : 'rounded-xl'}\n />\n );\n};\n"]}
@@ -1,12 +1,19 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.TOAST_BOTTOM_PADDING = exports.TOAST_ANIMATION_DURATION = exports.TOAST_VISIBILITY_DURATION = void 0;
3
+ exports.TOAST_SEVERITY_ICON_MAP = exports.TOAST_BOTTOM_PADDING = exports.TOAST_ANIMATION_DURATION = exports.TOAST_VISIBILITY_DURATION = void 0;
4
4
  // External dependencies.
5
+ const design_system_shared_1 = require("@metamask-previews/design-system-shared");
5
6
  const design_tokens_1 = require("@metamask-previews/design-tokens");
7
+ const Toast_types_1 = require("./Toast.types.cjs");
6
8
  /**
7
9
  * Animation constants.
8
10
  */
9
11
  exports.TOAST_VISIBILITY_DURATION = 2750;
10
12
  exports.TOAST_ANIMATION_DURATION = design_tokens_1.AnimationDuration.Regularly;
11
13
  exports.TOAST_BOTTOM_PADDING = 36;
14
+ exports.TOAST_SEVERITY_ICON_MAP = {
15
+ [Toast_types_1.ToastSeverity.Success]: design_system_shared_1.IconAlertSeverity.Success,
16
+ [Toast_types_1.ToastSeverity.Warning]: design_system_shared_1.IconAlertSeverity.Warning,
17
+ [Toast_types_1.ToastSeverity.Danger]: design_system_shared_1.IconAlertSeverity.Error,
18
+ };
12
19
  //# sourceMappingURL=Toast.constants.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"Toast.constants.cjs","sourceRoot":"","sources":["../../../src/components/Toast/Toast.constants.ts"],"names":[],"mappings":";;;AAAA,yBAAyB;AACzB,oEAAqE;AAErE;;GAEG;AACU,QAAA,yBAAyB,GAAG,IAAI,CAAC;AACjC,QAAA,wBAAwB,GAAG,iCAAiB,CAAC,SAAS,CAAC;AACvD,QAAA,oBAAoB,GAAG,EAAE,CAAC","sourcesContent":["// External dependencies.\nimport { AnimationDuration } from '@metamask-previews/design-tokens';\n\n/**\n * Animation constants.\n */\nexport const TOAST_VISIBILITY_DURATION = 2750;\nexport const TOAST_ANIMATION_DURATION = AnimationDuration.Regularly;\nexport const TOAST_BOTTOM_PADDING = 36;\n"]}
1
+ {"version":3,"file":"Toast.constants.cjs","sourceRoot":"","sources":["../../../src/components/Toast/Toast.constants.ts"],"names":[],"mappings":";;;AAAA,yBAAyB;AACzB,kFAA4E;AAC5E,oEAAqE;AAErE,mDAA8C;AAE9C;;GAEG;AACU,QAAA,yBAAyB,GAAG,IAAI,CAAC;AACjC,QAAA,wBAAwB,GAAG,iCAAiB,CAAC,SAAS,CAAC;AACvD,QAAA,oBAAoB,GAAG,EAAE,CAAC;AAE1B,QAAA,uBAAuB,GAAG;IACrC,CAAC,2BAAa,CAAC,OAAO,CAAC,EAAE,wCAAiB,CAAC,OAAO;IAClD,CAAC,2BAAa,CAAC,OAAO,CAAC,EAAE,wCAAiB,CAAC,OAAO;IAClD,CAAC,2BAAa,CAAC,MAAM,CAAC,EAAE,wCAAiB,CAAC,KAAK;CACvC,CAAC","sourcesContent":["// External dependencies.\nimport { IconAlertSeverity } from '@metamask-previews/design-system-shared';\nimport { AnimationDuration } from '@metamask-previews/design-tokens';\n\nimport { ToastSeverity } from './Toast.types';\n\n/**\n * Animation constants.\n */\nexport const TOAST_VISIBILITY_DURATION = 2750;\nexport const TOAST_ANIMATION_DURATION = AnimationDuration.Regularly;\nexport const TOAST_BOTTOM_PADDING = 36;\n\nexport const TOAST_SEVERITY_ICON_MAP = {\n [ToastSeverity.Success]: IconAlertSeverity.Success,\n [ToastSeverity.Warning]: IconAlertSeverity.Warning,\n [ToastSeverity.Danger]: IconAlertSeverity.Error,\n} as const;\n"]}
@@ -5,4 +5,9 @@ import { AnimationDuration } from "@metamask-previews/design-tokens";
5
5
  export declare const TOAST_VISIBILITY_DURATION = 2750;
6
6
  export declare const TOAST_ANIMATION_DURATION = AnimationDuration.Regularly;
7
7
  export declare const TOAST_BOTTOM_PADDING = 36;
8
+ export declare const TOAST_SEVERITY_ICON_MAP: {
9
+ readonly success: "success";
10
+ readonly warning: "warning";
11
+ readonly danger: "error";
12
+ };
8
13
  //# sourceMappingURL=Toast.constants.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Toast.constants.d.cts","sourceRoot":"","sources":["../../../src/components/Toast/Toast.constants.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,yCAAyC;AAErE;;GAEG;AACH,eAAO,MAAM,yBAAyB,OAAO,CAAC;AAC9C,eAAO,MAAM,wBAAwB,8BAA8B,CAAC;AACpE,eAAO,MAAM,oBAAoB,KAAK,CAAC"}
1
+ {"version":3,"file":"Toast.constants.d.cts","sourceRoot":"","sources":["../../../src/components/Toast/Toast.constants.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,yCAAyC;AAIrE;;GAEG;AACH,eAAO,MAAM,yBAAyB,OAAO,CAAC;AAC9C,eAAO,MAAM,wBAAwB,8BAA8B,CAAC;AACpE,eAAO,MAAM,oBAAoB,KAAK,CAAC;AAEvC,eAAO,MAAM,uBAAuB;;;;CAI1B,CAAC"}
@@ -5,4 +5,9 @@ import { AnimationDuration } from "@metamask-previews/design-tokens";
5
5
  export declare const TOAST_VISIBILITY_DURATION = 2750;
6
6
  export declare const TOAST_ANIMATION_DURATION = AnimationDuration.Regularly;
7
7
  export declare const TOAST_BOTTOM_PADDING = 36;
8
+ export declare const TOAST_SEVERITY_ICON_MAP: {
9
+ readonly success: "success";
10
+ readonly warning: "warning";
11
+ readonly danger: "error";
12
+ };
8
13
  //# sourceMappingURL=Toast.constants.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Toast.constants.d.mts","sourceRoot":"","sources":["../../../src/components/Toast/Toast.constants.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,yCAAyC;AAErE;;GAEG;AACH,eAAO,MAAM,yBAAyB,OAAO,CAAC;AAC9C,eAAO,MAAM,wBAAwB,8BAA8B,CAAC;AACpE,eAAO,MAAM,oBAAoB,KAAK,CAAC"}
1
+ {"version":3,"file":"Toast.constants.d.mts","sourceRoot":"","sources":["../../../src/components/Toast/Toast.constants.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,yCAAyC;AAIrE;;GAEG;AACH,eAAO,MAAM,yBAAyB,OAAO,CAAC;AAC9C,eAAO,MAAM,wBAAwB,8BAA8B,CAAC;AACpE,eAAO,MAAM,oBAAoB,KAAK,CAAC;AAEvC,eAAO,MAAM,uBAAuB;;;;CAI1B,CAAC"}
@@ -1,9 +1,16 @@
1
1
  // External dependencies.
2
+ import { IconAlertSeverity } from "@metamask-previews/design-system-shared";
2
3
  import { AnimationDuration } from "@metamask-previews/design-tokens";
4
+ import { ToastSeverity } from "./Toast.types.mjs";
3
5
  /**
4
6
  * Animation constants.
5
7
  */
6
8
  export const TOAST_VISIBILITY_DURATION = 2750;
7
9
  export const TOAST_ANIMATION_DURATION = AnimationDuration.Regularly;
8
10
  export const TOAST_BOTTOM_PADDING = 36;
11
+ export const TOAST_SEVERITY_ICON_MAP = {
12
+ [ToastSeverity.Success]: IconAlertSeverity.Success,
13
+ [ToastSeverity.Warning]: IconAlertSeverity.Warning,
14
+ [ToastSeverity.Danger]: IconAlertSeverity.Error,
15
+ };
9
16
  //# sourceMappingURL=Toast.constants.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"Toast.constants.mjs","sourceRoot":"","sources":["../../../src/components/Toast/Toast.constants.ts"],"names":[],"mappings":"AAAA,yBAAyB;AACzB,OAAO,EAAE,iBAAiB,EAAE,yCAAyC;AAErE;;GAEG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,IAAI,CAAC;AAC9C,MAAM,CAAC,MAAM,wBAAwB,GAAG,iBAAiB,CAAC,SAAS,CAAC;AACpE,MAAM,CAAC,MAAM,oBAAoB,GAAG,EAAE,CAAC","sourcesContent":["// External dependencies.\nimport { AnimationDuration } from '@metamask-previews/design-tokens';\n\n/**\n * Animation constants.\n */\nexport const TOAST_VISIBILITY_DURATION = 2750;\nexport const TOAST_ANIMATION_DURATION = AnimationDuration.Regularly;\nexport const TOAST_BOTTOM_PADDING = 36;\n"]}
1
+ {"version":3,"file":"Toast.constants.mjs","sourceRoot":"","sources":["../../../src/components/Toast/Toast.constants.ts"],"names":[],"mappings":"AAAA,yBAAyB;AACzB,OAAO,EAAE,iBAAiB,EAAE,gDAAgD;AAC5E,OAAO,EAAE,iBAAiB,EAAE,yCAAyC;AAErE,OAAO,EAAE,aAAa,EAAE,0BAAsB;AAE9C;;GAEG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,IAAI,CAAC;AAC9C,MAAM,CAAC,MAAM,wBAAwB,GAAG,iBAAiB,CAAC,SAAS,CAAC;AACpE,MAAM,CAAC,MAAM,oBAAoB,GAAG,EAAE,CAAC;AAEvC,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACrC,CAAC,aAAa,CAAC,OAAO,CAAC,EAAE,iBAAiB,CAAC,OAAO;IAClD,CAAC,aAAa,CAAC,OAAO,CAAC,EAAE,iBAAiB,CAAC,OAAO;IAClD,CAAC,aAAa,CAAC,MAAM,CAAC,EAAE,iBAAiB,CAAC,KAAK;CACvC,CAAC","sourcesContent":["// External dependencies.\nimport { IconAlertSeverity } from '@metamask-previews/design-system-shared';\nimport { AnimationDuration } from '@metamask-previews/design-tokens';\n\nimport { ToastSeverity } from './Toast.types';\n\n/**\n * Animation constants.\n */\nexport const TOAST_VISIBILITY_DURATION = 2750;\nexport const TOAST_ANIMATION_DURATION = AnimationDuration.Regularly;\nexport const TOAST_BOTTOM_PADDING = 36;\n\nexport const TOAST_SEVERITY_ICON_MAP = {\n [ToastSeverity.Success]: IconAlertSeverity.Success,\n [ToastSeverity.Warning]: IconAlertSeverity.Warning,\n [ToastSeverity.Danger]: IconAlertSeverity.Error,\n} as const;\n"]}
@@ -1,19 +1,4 @@
1
1
  import React from "react";
2
- import type { ToastOptions, ToastRef } from "./Toast.types.cjs";
3
- declare const ToastComponent: React.ForwardRefExoticComponent<{
4
- twClassName?: string | undefined;
5
- labelsContainerProps?: Omit<import("react-native").ViewProps, "children" | "style"> | undefined;
6
- } & Omit<import("react-native").ViewProps, "style"> & React.RefAttributes<ToastRef>>;
7
- type ToastWithStatics = typeof ToastComponent & {
8
- /**
9
- * Show a toast notification. Requires `<Toast />` to be mounted.
10
- */
11
- show: (options: ToastOptions) => void;
12
- /**
13
- * Hide the currently visible toast, if any.
14
- */
15
- hide: () => void;
16
- };
17
- export declare const Toast: ToastWithStatics;
18
- export {};
2
+ import type { ToastProps } from "./Toast.types.cjs";
3
+ export declare const Toast: React.FC<ToastProps>;
19
4
  //# sourceMappingURL=Toast.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Toast.d.cts","sourceRoot":"","sources":["../../../src/components/Toast/Toast.tsx"],"names":[],"mappings":"AACA,OAAO,KAKN,cAAc;AAIf,OAAO,KAAK,EAAE,YAAY,EAAc,QAAQ,EAAE,0BAAsB;AAcxE,QAAA,MAAM,cAAc;;;oFAsBlB,CAAC;AAIH,KAAK,gBAAgB,GAAG,OAAO,cAAc,GAAG;IAC9C;;OAEG;IACH,IAAI,EAAE,CAAC,OAAO,EAAE,YAAY,KAAK,IAAI,CAAC;IACtC;;OAEG;IACH,IAAI,EAAE,MAAM,IAAI,CAAC;CAClB,CAAC;AAEF,eAAO,MAAM,KAAK,kBAAqC,CAAC"}
1
+ {"version":3,"file":"Toast.d.cts","sourceRoot":"","sources":["../../../src/components/Toast/Toast.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,cAAc;AAS1B,OAAO,KAAK,EAAE,UAAU,EAAE,0BAAsB;AA0BhD,eAAO,MAAM,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC,UAAU,CA8DtC,CAAC"}
@@ -1,19 +1,4 @@
1
1
  import React from "react";
2
- import type { ToastOptions, ToastRef } from "./Toast.types.mjs";
3
- declare const ToastComponent: React.ForwardRefExoticComponent<{
4
- twClassName?: string | undefined;
5
- labelsContainerProps?: Omit<import("react-native").ViewProps, "children" | "style"> | undefined;
6
- } & Omit<import("react-native").ViewProps, "style"> & React.RefAttributes<ToastRef>>;
7
- type ToastWithStatics = typeof ToastComponent & {
8
- /**
9
- * Show a toast notification. Requires `<Toast />` to be mounted.
10
- */
11
- show: (options: ToastOptions) => void;
12
- /**
13
- * Hide the currently visible toast, if any.
14
- */
15
- hide: () => void;
16
- };
17
- export declare const Toast: ToastWithStatics;
18
- export {};
2
+ import type { ToastProps } from "./Toast.types.mjs";
3
+ export declare const Toast: React.FC<ToastProps>;
19
4
  //# sourceMappingURL=Toast.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Toast.d.mts","sourceRoot":"","sources":["../../../src/components/Toast/Toast.tsx"],"names":[],"mappings":"AACA,OAAO,KAKN,cAAc;AAIf,OAAO,KAAK,EAAE,YAAY,EAAc,QAAQ,EAAE,0BAAsB;AAcxE,QAAA,MAAM,cAAc;;;oFAsBlB,CAAC;AAIH,KAAK,gBAAgB,GAAG,OAAO,cAAc,GAAG;IAC9C;;OAEG;IACH,IAAI,EAAE,CAAC,OAAO,EAAE,YAAY,KAAK,IAAI,CAAC;IACtC;;OAEG;IACH,IAAI,EAAE,MAAM,IAAI,CAAC;CAClB,CAAC;AAEF,eAAO,MAAM,KAAK,kBAAqC,CAAC"}
1
+ {"version":3,"file":"Toast.d.mts","sourceRoot":"","sources":["../../../src/components/Toast/Toast.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,cAAc;AAS1B,OAAO,KAAK,EAAE,UAAU,EAAE,0BAAsB;AA0BhD,eAAO,MAAM,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC,UAAU,CA8DtC,CAAC"}
@@ -5,38 +5,48 @@ function $importDefault(module) {
5
5
  return module;
6
6
  }
7
7
  // Third party dependencies.
8
- import $React, { forwardRef, useEffect, useImperativeHandle, useRef } from "react";
8
+ import { BoxBackgroundColor, BoxBorderColor, ButtonSize, IconSize } from "@metamask-previews/design-system-shared";
9
+ import $React from "react";
9
10
  const React = $importDefault($React);
10
- import { ToastView } from "./ToastView.mjs";
11
- let registeredRef = null;
12
- const assertRegisteredRef = (method) => {
13
- if (!registeredRef?.current) {
14
- throw new Error(`Toast.${method}() called before <Toast /> mounted. Render <Toast /> once at the root of your app.`);
11
+ // External dependencies.
12
+ import { BannerBase } from "../BannerBase/index.mjs";
13
+ import { IconAlert } from "../IconAlert/index.mjs";
14
+ // Internal dependencies.
15
+ import { TOAST_SEVERITY_ICON_MAP } from "./Toast.constants.mjs";
16
+ import { ToastSeverity } from "./Toast.types.mjs";
17
+ const renderSeverityAccessory = ({ iconAlertProps, severity, startAccessory, }) => {
18
+ if (startAccessory !== null && startAccessory !== undefined) {
19
+ return startAccessory;
15
20
  }
16
- return registeredRef.current;
17
- };
18
- const ToastComponent = forwardRef((props, ref) => {
19
- const innerRef = useRef(null);
20
- useImperativeHandle(ref, () => ({
21
- showToast: (options) => innerRef.current?.showToast(options),
22
- closeToast: () => innerRef.current?.closeToast(),
23
- }), []);
24
- useEffect(() => {
25
- registeredRef = innerRef;
26
- return () => {
27
- if (registeredRef === innerRef) {
28
- registeredRef = null;
29
- }
30
- };
31
- }, []);
32
- return <ToastView ref={innerRef} {...props}/>;
33
- });
34
- ToastComponent.displayName = 'Toast';
35
- export const Toast = ToastComponent;
36
- Toast.show = (options) => {
37
- assertRegisteredRef('show').showToast(options);
21
+ if (!severity || severity === ToastSeverity.Default) {
22
+ return undefined;
23
+ }
24
+ const iconAlertSeverity = TOAST_SEVERITY_ICON_MAP[severity];
25
+ return (<IconAlert severity={iconAlertSeverity} size={IconSize.Lg} {...iconAlertProps}/>);
38
26
  };
39
- Toast.hide = () => {
40
- assertRegisteredRef('hide').closeToast();
27
+ export const Toast = ({ actionButtonLabel, actionButtonOnPress, actionButtonProps, children, childrenWrapperProps, closeButtonProps, description, descriptionProps, onClose, iconAlertProps, severity = ToastSeverity.Default, startAccessory, title, titleProps, twClassName, ...props }) => {
28
+ const actionProps = actionButtonLabel && actionButtonOnPress
29
+ ? {
30
+ actionButtonLabel,
31
+ actionButtonOnPress,
32
+ actionButtonProps: {
33
+ size: ButtonSize.Sm,
34
+ ...actionButtonProps,
35
+ },
36
+ }
37
+ : {};
38
+ // TODO: Remove this conditional once BannerBase only renders a close button
39
+ // from onClose. At that point Toast can pass closeButtonProps directly.
40
+ const resolvedCloseButtonProps = onClose || closeButtonProps
41
+ ? {
42
+ accessibilityLabel: 'Close toast',
43
+ ...closeButtonProps,
44
+ }
45
+ : undefined;
46
+ return (<BannerBase {...actionProps} {...props} backgroundColor={BoxBackgroundColor.BackgroundSection} borderColor={BoxBorderColor.BorderMuted} borderWidth={1} children={children} childrenWrapperProps={childrenWrapperProps} closeButtonProps={resolvedCloseButtonProps} description={description} descriptionProps={descriptionProps} onClose={onClose} startAccessory={renderSeverityAccessory({
47
+ iconAlertProps,
48
+ severity,
49
+ startAccessory,
50
+ })} title={title} titleProps={titleProps} twClassName={twClassName ? `rounded-xl ${twClassName}` : 'rounded-xl'}/>);
41
51
  };
42
52
  //# sourceMappingURL=Toast.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"Toast.mjs","sourceRoot":"","sources":["../../../src/components/Toast/Toast.tsx"],"names":[],"mappings":";;;;;;AAAA,4BAA4B;AAC5B,OAAO,QAAO,EACZ,UAAU,EACV,SAAS,EACT,mBAAmB,EACnB,MAAM,EACP,cAAc;;AAKf,OAAO,EAAE,SAAS,EAAE,wBAAoB;AAExC,IAAI,aAAa,GAA+B,IAAI,CAAC;AAErD,MAAM,mBAAmB,GAAG,CAAC,MAAc,EAAY,EAAE;IACvD,IAAI,CAAC,aAAa,EAAE,OAAO,EAAE;QAC3B,MAAM,IAAI,KAAK,CACb,SAAS,MAAM,oFAAoF,CACpG,CAAC;KACH;IACD,OAAO,aAAa,CAAC,OAAO,CAAC;AAC/B,CAAC,CAAC;AAEF,MAAM,cAAc,GAAG,UAAU,CAAuB,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;IACrE,MAAM,QAAQ,GAAG,MAAM,CAAW,IAAI,CAAC,CAAC;IAExC,mBAAmB,CACjB,GAAG,EACH,GAAG,EAAE,CAAC,CAAC;QACL,SAAS,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,QAAQ,CAAC,OAAO,EAAE,SAAS,CAAC,OAAO,CAAC;QAC5D,UAAU,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,OAAO,EAAE,UAAU,EAAE;KACjD,CAAC,EACF,EAAE,CACH,CAAC;IAEF,SAAS,CAAC,GAAG,EAAE;QACb,aAAa,GAAG,QAAQ,CAAC;QACzB,OAAO,GAAG,EAAE;YACV,IAAI,aAAa,KAAK,QAAQ,EAAE;gBAC9B,aAAa,GAAG,IAAI,CAAC;aACtB;QACH,CAAC,CAAC;IACJ,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,CAAC,IAAI,KAAK,CAAC,EAAG,CAAC;AACjD,CAAC,CAAC,CAAC;AAEH,cAAc,CAAC,WAAW,GAAG,OAAO,CAAC;AAarC,MAAM,CAAC,MAAM,KAAK,GAAG,cAAkC,CAAC;AAExD,KAAK,CAAC,IAAI,GAAG,CAAC,OAAO,EAAE,EAAE;IACvB,mBAAmB,CAAC,MAAM,CAAC,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;AACjD,CAAC,CAAC;AAEF,KAAK,CAAC,IAAI,GAAG,GAAG,EAAE;IAChB,mBAAmB,CAAC,MAAM,CAAC,CAAC,UAAU,EAAE,CAAC;AAC3C,CAAC,CAAC","sourcesContent":["// Third party dependencies.\nimport React, {\n forwardRef,\n useEffect,\n useImperativeHandle,\n useRef,\n} from 'react';\nimport type { RefObject } from 'react';\n\n// Internal dependencies.\nimport type { ToastOptions, ToastProps, ToastRef } from './Toast.types';\nimport { ToastView } from './ToastView';\n\nlet registeredRef: RefObject<ToastRef> | null = null;\n\nconst assertRegisteredRef = (method: string): ToastRef => {\n if (!registeredRef?.current) {\n throw new Error(\n `Toast.${method}() called before <Toast /> mounted. Render <Toast /> once at the root of your app.`,\n );\n }\n return registeredRef.current;\n};\n\nconst ToastComponent = forwardRef<ToastRef, ToastProps>((props, ref) => {\n const innerRef = useRef<ToastRef>(null);\n\n useImperativeHandle(\n ref,\n () => ({\n showToast: (options) => innerRef.current?.showToast(options),\n closeToast: () => innerRef.current?.closeToast(),\n }),\n [],\n );\n\n useEffect(() => {\n registeredRef = innerRef;\n return () => {\n if (registeredRef === innerRef) {\n registeredRef = null;\n }\n };\n }, []);\n\n return <ToastView ref={innerRef} {...props} />;\n});\n\nToastComponent.displayName = 'Toast';\n\ntype ToastWithStatics = typeof ToastComponent & {\n /**\n * Show a toast notification. Requires `<Toast />` to be mounted.\n */\n show: (options: ToastOptions) => void;\n /**\n * Hide the currently visible toast, if any.\n */\n hide: () => void;\n};\n\nexport const Toast = ToastComponent as ToastWithStatics;\n\nToast.show = (options) => {\n assertRegisteredRef('show').showToast(options);\n};\n\nToast.hide = () => {\n assertRegisteredRef('hide').closeToast();\n};\n"]}
1
+ {"version":3,"file":"Toast.mjs","sourceRoot":"","sources":["../../../src/components/Toast/Toast.tsx"],"names":[],"mappings":";;;;;;AAAA,4BAA4B;AAC5B,OAAO,EACL,kBAAkB,EAClB,cAAc,EACd,UAAU,EACV,QAAQ,EACT,gDAAgD;AACjD,OAAO,MAAK,cAAc;;AAE1B,yBAAyB;AACzB,OAAO,EAAE,UAAU,EAAE,gCAAsB;AAC3C,OAAO,EAAE,SAAS,EAAE,+BAAqB;AAEzC,yBAAyB;AACzB,OAAO,EAAE,uBAAuB,EAAE,8BAA0B;AAC5D,OAAO,EAAE,aAAa,EAAE,0BAAsB;AAG9C,MAAM,uBAAuB,GAAG,CAAC,EAC/B,cAAc,EACd,QAAQ,EACR,cAAc,GACqD,EAAE,EAAE;IACvE,IAAI,cAAc,KAAK,IAAI,IAAI,cAAc,KAAK,SAAS,EAAE;QAC3D,OAAO,cAAc,CAAC;KACvB;IAED,IAAI,CAAC,QAAQ,IAAI,QAAQ,KAAK,aAAa,CAAC,OAAO,EAAE;QACnD,OAAO,SAAS,CAAC;KAClB;IAED,MAAM,iBAAiB,GAAG,uBAAuB,CAAC,QAAQ,CAAC,CAAC;IAE5D,OAAO,CACL,CAAC,SAAS,CACR,QAAQ,CAAC,CAAC,iBAAiB,CAAC,CAC5B,IAAI,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAClB,IAAI,cAAc,CAAC,EACnB,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,KAAK,GAAyB,CAAC,EAC1C,iBAAiB,EACjB,mBAAmB,EACnB,iBAAiB,EACjB,QAAQ,EACR,oBAAoB,EACpB,gBAAgB,EAChB,WAAW,EACX,gBAAgB,EAChB,OAAO,EACP,cAAc,EACd,QAAQ,GAAG,aAAa,CAAC,OAAO,EAChC,cAAc,EACd,KAAK,EACL,UAAU,EACV,WAAW,EACX,GAAG,KAAK,EACT,EAAE,EAAE;IACH,MAAM,WAAW,GACf,iBAAiB,IAAI,mBAAmB;QACtC,CAAC,CAAC;YACE,iBAAiB;YACjB,mBAAmB;YACnB,iBAAiB,EAAE;gBACjB,IAAI,EAAE,UAAU,CAAC,EAAE;gBACnB,GAAG,iBAAiB;aACrB;SACF;QACH,CAAC,CAAC,EAAE,CAAC;IACT,4EAA4E;IAC5E,wEAAwE;IACxE,MAAM,wBAAwB,GAC5B,OAAO,IAAI,gBAAgB;QACzB,CAAC,CAAC;YACE,kBAAkB,EAAE,aAAa;YACjC,GAAG,gBAAgB;SACpB;QACH,CAAC,CAAC,SAAS,CAAC;IAEhB,OAAO,CACL,CAAC,UAAU,CACT,IAAI,WAAW,CAAC,CAChB,IAAI,KAAK,CAAC,CACV,eAAe,CAAC,CAAC,kBAAkB,CAAC,iBAAiB,CAAC,CACtD,WAAW,CAAC,CAAC,cAAc,CAAC,WAAW,CAAC,CACxC,WAAW,CAAC,CAAC,CAAC,CAAC,CACf,QAAQ,CAAC,CAAC,QAAQ,CAAC,CACnB,oBAAoB,CAAC,CAAC,oBAAoB,CAAC,CAC3C,gBAAgB,CAAC,CAAC,wBAAwB,CAAC,CAC3C,WAAW,CAAC,CAAC,WAAW,CAAC,CACzB,gBAAgB,CAAC,CAAC,gBAAgB,CAAC,CACnC,OAAO,CAAC,CAAC,OAAO,CAAC,CACjB,cAAc,CAAC,CAAC,uBAAuB,CAAC;YACtC,cAAc;YACd,QAAQ;YACR,cAAc;SACf,CAAC,CAAC,CACH,KAAK,CAAC,CAAC,KAAK,CAAC,CACb,UAAU,CAAC,CAAC,UAAU,CAAC,CACvB,WAAW,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,cAAc,WAAW,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC,EACtE,CACH,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// Third party dependencies.\nimport {\n BoxBackgroundColor,\n BoxBorderColor,\n ButtonSize,\n IconSize,\n} from '@metamask-previews/design-system-shared';\nimport React from 'react';\n\n// External dependencies.\nimport { BannerBase } from '../BannerBase';\nimport { IconAlert } from '../IconAlert';\n\n// Internal dependencies.\nimport { TOAST_SEVERITY_ICON_MAP } from './Toast.constants';\nimport { ToastSeverity } from './Toast.types';\nimport type { ToastProps } from './Toast.types';\n\nconst renderSeverityAccessory = ({\n iconAlertProps,\n severity,\n startAccessory,\n}: Pick<ToastProps, 'iconAlertProps' | 'severity' | 'startAccessory'>) => {\n if (startAccessory !== null && startAccessory !== undefined) {\n return startAccessory;\n }\n\n if (!severity || severity === ToastSeverity.Default) {\n return undefined;\n }\n\n const iconAlertSeverity = TOAST_SEVERITY_ICON_MAP[severity];\n\n return (\n <IconAlert\n severity={iconAlertSeverity}\n size={IconSize.Lg}\n {...iconAlertProps}\n />\n );\n};\n\nexport const Toast: React.FC<ToastProps> = ({\n actionButtonLabel,\n actionButtonOnPress,\n actionButtonProps,\n children,\n childrenWrapperProps,\n closeButtonProps,\n description,\n descriptionProps,\n onClose,\n iconAlertProps,\n severity = ToastSeverity.Default,\n startAccessory,\n title,\n titleProps,\n twClassName,\n ...props\n}) => {\n const actionProps =\n actionButtonLabel && actionButtonOnPress\n ? {\n actionButtonLabel,\n actionButtonOnPress,\n actionButtonProps: {\n size: ButtonSize.Sm,\n ...actionButtonProps,\n },\n }\n : {};\n // TODO: Remove this conditional once BannerBase only renders a close button\n // from onClose. At that point Toast can pass closeButtonProps directly.\n const resolvedCloseButtonProps =\n onClose || closeButtonProps\n ? {\n accessibilityLabel: 'Close toast',\n ...closeButtonProps,\n }\n : undefined;\n\n return (\n <BannerBase\n {...actionProps}\n {...props}\n backgroundColor={BoxBackgroundColor.BackgroundSection}\n borderColor={BoxBorderColor.BorderMuted}\n borderWidth={1}\n children={children}\n childrenWrapperProps={childrenWrapperProps}\n closeButtonProps={resolvedCloseButtonProps}\n description={description}\n descriptionProps={descriptionProps}\n onClose={onClose}\n startAccessory={renderSeverityAccessory({\n iconAlertProps,\n severity,\n startAccessory,\n })}\n title={title}\n titleProps={titleProps}\n twClassName={twClassName ? `rounded-xl ${twClassName}` : 'rounded-xl'}\n />\n );\n};\n"]}
@@ -1,19 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ToastCloseButtonVariant = exports.ToastVariant = void 0;
3
+ exports.ToastSeverity = void 0;
4
4
  /**
5
- * Toast variants.
5
+ * Toast severity variants.
6
+ * `Default` renders no built-in leading icon.
6
7
  */
7
- var ToastVariant;
8
- (function (ToastVariant) {
9
- ToastVariant["Plain"] = "Plain";
10
- ToastVariant["Account"] = "Account";
11
- ToastVariant["Network"] = "Network";
12
- ToastVariant["App"] = "App";
13
- ToastVariant["Icon"] = "Icon";
14
- })(ToastVariant || (exports.ToastVariant = ToastVariant = {}));
15
- var ToastCloseButtonVariant;
16
- (function (ToastCloseButtonVariant) {
17
- ToastCloseButtonVariant["Icon"] = "Icon";
18
- })(ToastCloseButtonVariant || (exports.ToastCloseButtonVariant = ToastCloseButtonVariant = {}));
8
+ exports.ToastSeverity = {
9
+ Default: 'default',
10
+ Success: 'success',
11
+ Warning: 'warning',
12
+ Danger: 'danger',
13
+ };
19
14
  //# sourceMappingURL=Toast.types.cjs.map