@metamask-previews/design-system-react-native 0.56.0-preview.12867efa → 0.56.1-preview-00dfeb8

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 (498) hide show
  1. package/CHANGELOG.md +11 -1
  2. package/dist/components/ActionListItem/ActionListItem.cjs +17 -7
  3. package/dist/components/ActionListItem/ActionListItem.cjs.map +1 -1
  4. package/dist/components/ActionListItem/ActionListItem.mjs.map +1 -1
  5. package/dist/components/AvatarAccount/AvatarAccount.cjs.map +1 -1
  6. package/dist/components/AvatarAccount/AvatarAccount.d.cts.map +1 -1
  7. package/dist/components/AvatarAccount/AvatarAccount.d.mts.map +1 -1
  8. package/dist/components/AvatarAccount/AvatarAccount.mjs.map +1 -1
  9. package/dist/components/AvatarBase/AvatarBase.constants.cjs +16 -16
  10. package/dist/components/AvatarBase/AvatarBase.constants.cjs.map +1 -1
  11. package/dist/components/AvatarBase/AvatarBase.constants.mjs +16 -16
  12. package/dist/components/AvatarBase/AvatarBase.constants.mjs.map +1 -1
  13. package/dist/components/AvatarBase/AvatarBase.d.cts.map +1 -1
  14. package/dist/components/AvatarBase/AvatarBase.d.mts.map +1 -1
  15. package/dist/components/AvatarFavicon/AvatarFavicon.cjs +17 -7
  16. package/dist/components/AvatarFavicon/AvatarFavicon.cjs.map +1 -1
  17. package/dist/components/AvatarFavicon/AvatarFavicon.d.cts.map +1 -1
  18. package/dist/components/AvatarFavicon/AvatarFavicon.d.mts.map +1 -1
  19. package/dist/components/AvatarGroup/AvatarGroup.cjs +17 -7
  20. package/dist/components/AvatarGroup/AvatarGroup.cjs.map +1 -1
  21. package/dist/components/AvatarGroup/AvatarGroup.d.cts.map +1 -1
  22. package/dist/components/AvatarGroup/AvatarGroup.d.mts.map +1 -1
  23. package/dist/components/AvatarGroup/AvatarGroup.mjs.map +1 -1
  24. package/dist/components/AvatarIcon/AvatarIcon.constants.cjs +4 -4
  25. package/dist/components/AvatarIcon/AvatarIcon.constants.cjs.map +1 -1
  26. package/dist/components/AvatarIcon/AvatarIcon.constants.mjs +4 -4
  27. package/dist/components/AvatarIcon/AvatarIcon.constants.mjs.map +1 -1
  28. package/dist/components/AvatarIcon/AvatarIcon.d.cts.map +1 -1
  29. package/dist/components/AvatarIcon/AvatarIcon.d.mts.map +1 -1
  30. package/dist/components/AvatarNetwork/AvatarNetwork.cjs +17 -7
  31. package/dist/components/AvatarNetwork/AvatarNetwork.cjs.map +1 -1
  32. package/dist/components/AvatarNetwork/AvatarNetwork.d.cts.map +1 -1
  33. package/dist/components/AvatarNetwork/AvatarNetwork.d.mts.map +1 -1
  34. package/dist/components/AvatarNetwork/AvatarNetwork.mjs.map +1 -1
  35. package/dist/components/AvatarToken/AvatarToken.cjs +17 -7
  36. package/dist/components/AvatarToken/AvatarToken.cjs.map +1 -1
  37. package/dist/components/AvatarToken/AvatarToken.d.cts.map +1 -1
  38. package/dist/components/AvatarToken/AvatarToken.d.mts.map +1 -1
  39. package/dist/components/AvatarToken/AvatarToken.mjs.map +1 -1
  40. package/dist/components/BadgeCount/BadgeCount.constants.cjs +1 -1
  41. package/dist/components/BadgeCount/BadgeCount.constants.cjs.map +1 -1
  42. package/dist/components/BadgeCount/BadgeCount.constants.mjs +1 -1
  43. package/dist/components/BadgeCount/BadgeCount.constants.mjs.map +1 -1
  44. package/dist/components/BadgeCount/BadgeCount.d.cts.map +1 -1
  45. package/dist/components/BadgeCount/BadgeCount.d.mts.map +1 -1
  46. package/dist/components/BadgeIcon/BadgeIcon.d.cts.map +1 -1
  47. package/dist/components/BadgeIcon/BadgeIcon.d.mts.map +1 -1
  48. package/dist/components/BadgeNetwork/BadgeNetwork.d.cts.map +1 -1
  49. package/dist/components/BadgeNetwork/BadgeNetwork.d.mts.map +1 -1
  50. package/dist/components/BadgeStatus/BadgeStatus.constants.cjs +1 -1
  51. package/dist/components/BadgeStatus/BadgeStatus.constants.cjs.map +1 -1
  52. package/dist/components/BadgeStatus/BadgeStatus.constants.mjs +1 -1
  53. package/dist/components/BadgeStatus/BadgeStatus.constants.mjs.map +1 -1
  54. package/dist/components/BadgeStatus/BadgeStatus.d.cts.map +1 -1
  55. package/dist/components/BadgeStatus/BadgeStatus.d.mts.map +1 -1
  56. package/dist/components/BadgeWrapper/BadgeWrapper.d.cts.map +1 -1
  57. package/dist/components/BadgeWrapper/BadgeWrapper.d.mts.map +1 -1
  58. package/dist/components/BannerAlert/BannerAlert.cjs.map +1 -1
  59. package/dist/components/BannerAlert/BannerAlert.mjs.map +1 -1
  60. package/dist/components/BannerBase/BannerBase.cjs +17 -7
  61. package/dist/components/BannerBase/BannerBase.cjs.map +1 -1
  62. package/dist/components/BannerBase/BannerBase.mjs.map +1 -1
  63. package/dist/components/BottomSheet/BottomSheet.cjs +17 -7
  64. package/dist/components/BottomSheet/BottomSheet.cjs.map +1 -1
  65. package/dist/components/BottomSheet/BottomSheet.d.cts +8 -8
  66. package/dist/components/BottomSheet/BottomSheet.d.cts.map +1 -1
  67. package/dist/components/BottomSheet/BottomSheet.d.mts +8 -8
  68. package/dist/components/BottomSheet/BottomSheet.d.mts.map +1 -1
  69. package/dist/components/BottomSheet/BottomSheet.mjs.map +1 -1
  70. package/dist/components/BottomSheetDialog/BottomSheetDialog.cjs +17 -7
  71. package/dist/components/BottomSheetDialog/BottomSheetDialog.cjs.map +1 -1
  72. package/dist/components/BottomSheetDialog/BottomSheetDialog.d.cts +6 -6
  73. package/dist/components/BottomSheetDialog/BottomSheetDialog.d.cts.map +1 -1
  74. package/dist/components/BottomSheetDialog/BottomSheetDialog.d.mts +6 -6
  75. package/dist/components/BottomSheetDialog/BottomSheetDialog.d.mts.map +1 -1
  76. package/dist/components/BottomSheetDialog/BottomSheetDialog.mjs.map +1 -1
  77. package/dist/components/BottomSheetFooter/BottomSheetFooter.cjs.map +1 -1
  78. package/dist/components/BottomSheetFooter/BottomSheetFooter.mjs.map +1 -1
  79. package/dist/components/BottomSheetOverlay/BottomSheetOverlay.cjs +17 -7
  80. package/dist/components/BottomSheetOverlay/BottomSheetOverlay.cjs.map +1 -1
  81. package/dist/components/Box/Box.cjs +17 -7
  82. package/dist/components/Box/Box.cjs.map +1 -1
  83. package/dist/components/Box/Box.d.cts +1 -1
  84. package/dist/components/Box/Box.d.mts +1 -1
  85. package/dist/components/BoxColumn/BoxColumn.cjs +13 -0
  86. package/dist/components/BoxColumn/BoxColumn.cjs.map +1 -1
  87. package/dist/components/BoxColumn/BoxColumn.d.cts +13 -0
  88. package/dist/components/BoxColumn/BoxColumn.d.cts.map +1 -1
  89. package/dist/components/BoxColumn/BoxColumn.d.mts +13 -0
  90. package/dist/components/BoxColumn/BoxColumn.d.mts.map +1 -1
  91. package/dist/components/BoxColumn/BoxColumn.mjs +13 -0
  92. package/dist/components/BoxColumn/BoxColumn.mjs.map +1 -1
  93. package/dist/components/BoxColumn/BoxColumn.types.cjs.map +1 -1
  94. package/dist/components/BoxColumn/BoxColumn.types.d.cts +2 -0
  95. package/dist/components/BoxColumn/BoxColumn.types.d.cts.map +1 -1
  96. package/dist/components/BoxColumn/BoxColumn.types.d.mts +2 -0
  97. package/dist/components/BoxColumn/BoxColumn.types.d.mts.map +1 -1
  98. package/dist/components/BoxColumn/BoxColumn.types.mjs.map +1 -1
  99. package/dist/components/BoxRow/BoxRow.cjs +13 -0
  100. package/dist/components/BoxRow/BoxRow.cjs.map +1 -1
  101. package/dist/components/BoxRow/BoxRow.d.cts +13 -0
  102. package/dist/components/BoxRow/BoxRow.d.cts.map +1 -1
  103. package/dist/components/BoxRow/BoxRow.d.mts +13 -0
  104. package/dist/components/BoxRow/BoxRow.d.mts.map +1 -1
  105. package/dist/components/BoxRow/BoxRow.mjs +13 -0
  106. package/dist/components/BoxRow/BoxRow.mjs.map +1 -1
  107. package/dist/components/BoxRow/BoxRow.types.cjs.map +1 -1
  108. package/dist/components/BoxRow/BoxRow.types.d.cts +2 -0
  109. package/dist/components/BoxRow/BoxRow.types.d.cts.map +1 -1
  110. package/dist/components/BoxRow/BoxRow.types.d.mts +2 -0
  111. package/dist/components/BoxRow/BoxRow.types.d.mts.map +1 -1
  112. package/dist/components/BoxRow/BoxRow.types.mjs.map +1 -1
  113. package/dist/components/Button/Button.cjs.map +1 -1
  114. package/dist/components/Button/Button.d.cts.map +1 -1
  115. package/dist/components/Button/Button.d.mts.map +1 -1
  116. package/dist/components/Button/Button.mjs.map +1 -1
  117. package/dist/components/Button/variants/ButtonPrimary/ButtonPrimary.cjs +17 -7
  118. package/dist/components/Button/variants/ButtonPrimary/ButtonPrimary.cjs.map +1 -1
  119. package/dist/components/Button/variants/ButtonPrimary/ButtonPrimary.d.cts.map +1 -1
  120. package/dist/components/Button/variants/ButtonPrimary/ButtonPrimary.d.mts.map +1 -1
  121. package/dist/components/Button/variants/ButtonPrimary/ButtonPrimary.mjs.map +1 -1
  122. package/dist/components/Button/variants/ButtonSecondary/ButtonSecondary.cjs +17 -7
  123. package/dist/components/Button/variants/ButtonSecondary/ButtonSecondary.cjs.map +1 -1
  124. package/dist/components/Button/variants/ButtonSecondary/ButtonSecondary.d.cts.map +1 -1
  125. package/dist/components/Button/variants/ButtonSecondary/ButtonSecondary.d.mts.map +1 -1
  126. package/dist/components/Button/variants/ButtonSecondary/ButtonSecondary.mjs.map +1 -1
  127. package/dist/components/Button/variants/ButtonTertiary/ButtonTertiary.cjs +17 -7
  128. package/dist/components/Button/variants/ButtonTertiary/ButtonTertiary.cjs.map +1 -1
  129. package/dist/components/Button/variants/ButtonTertiary/ButtonTertiary.d.cts.map +1 -1
  130. package/dist/components/Button/variants/ButtonTertiary/ButtonTertiary.d.mts.map +1 -1
  131. package/dist/components/Button/variants/ButtonTertiary/ButtonTertiary.mjs.map +1 -1
  132. package/dist/components/ButtonBase/ButtonBase.cjs +27 -13
  133. package/dist/components/ButtonBase/ButtonBase.cjs.map +1 -1
  134. package/dist/components/ButtonBase/ButtonBase.constants.cjs +2 -2
  135. package/dist/components/ButtonBase/ButtonBase.constants.cjs.map +1 -1
  136. package/dist/components/ButtonBase/ButtonBase.constants.d.cts.map +1 -1
  137. package/dist/components/ButtonBase/ButtonBase.constants.d.mts.map +1 -1
  138. package/dist/components/ButtonBase/ButtonBase.constants.mjs +2 -2
  139. package/dist/components/ButtonBase/ButtonBase.constants.mjs.map +1 -1
  140. package/dist/components/ButtonBase/ButtonBase.d.cts.map +1 -1
  141. package/dist/components/ButtonBase/ButtonBase.d.mts.map +1 -1
  142. package/dist/components/ButtonBase/ButtonBase.mjs +11 -7
  143. package/dist/components/ButtonBase/ButtonBase.mjs.map +1 -1
  144. package/dist/components/ButtonBase/ButtonBase.types.cjs.map +1 -1
  145. package/dist/components/ButtonBase/ButtonBase.types.d.cts +3 -4
  146. package/dist/components/ButtonBase/ButtonBase.types.d.cts.map +1 -1
  147. package/dist/components/ButtonBase/ButtonBase.types.d.mts +3 -4
  148. package/dist/components/ButtonBase/ButtonBase.types.d.mts.map +1 -1
  149. package/dist/components/ButtonBase/ButtonBase.types.mjs.map +1 -1
  150. package/dist/components/ButtonHero/ButtonHero.cjs.map +1 -1
  151. package/dist/components/ButtonHero/ButtonHero.mjs.map +1 -1
  152. package/dist/components/ButtonIcon/ButtonIcon.cjs +17 -7
  153. package/dist/components/ButtonIcon/ButtonIcon.cjs.map +1 -1
  154. package/dist/components/ButtonIcon/ButtonIcon.d.cts.map +1 -1
  155. package/dist/components/ButtonIcon/ButtonIcon.d.mts.map +1 -1
  156. package/dist/components/ButtonIcon/ButtonIcon.mjs.map +1 -1
  157. package/dist/components/ButtonSemantic/ButtonSemantic.cjs +17 -7
  158. package/dist/components/ButtonSemantic/ButtonSemantic.cjs.map +1 -1
  159. package/dist/components/ButtonSemantic/ButtonSemantic.d.cts.map +1 -1
  160. package/dist/components/ButtonSemantic/ButtonSemantic.d.mts.map +1 -1
  161. package/dist/components/Card/Card.cjs.map +1 -1
  162. package/dist/components/Card/Card.mjs.map +1 -1
  163. package/dist/components/Checkbox/Checkbox.cjs +17 -7
  164. package/dist/components/Checkbox/Checkbox.cjs.map +1 -1
  165. package/dist/components/Checkbox/Checkbox.d.cts +5 -6
  166. package/dist/components/Checkbox/Checkbox.d.cts.map +1 -1
  167. package/dist/components/Checkbox/Checkbox.d.mts +5 -6
  168. package/dist/components/Checkbox/Checkbox.d.mts.map +1 -1
  169. package/dist/components/Checkbox/Checkbox.mjs.map +1 -1
  170. package/dist/components/Content/Content.cjs +40 -32
  171. package/dist/components/Content/Content.cjs.map +1 -1
  172. package/dist/components/Content/Content.d.cts.map +1 -1
  173. package/dist/components/Content/Content.d.mts.map +1 -1
  174. package/dist/components/Content/Content.mjs +40 -32
  175. package/dist/components/Content/Content.mjs.map +1 -1
  176. package/dist/components/FilterButton/FilterButton.cjs +17 -7
  177. package/dist/components/FilterButton/FilterButton.cjs.map +1 -1
  178. package/dist/components/FilterButton/FilterButton.mjs.map +1 -1
  179. package/dist/components/FilterButtonGroup/FilterButtonGroup.cjs +17 -7
  180. package/dist/components/FilterButtonGroup/FilterButtonGroup.cjs.map +1 -1
  181. package/dist/components/HeaderBase/HeaderBase.cjs +17 -7
  182. package/dist/components/HeaderBase/HeaderBase.cjs.map +1 -1
  183. package/dist/components/HeaderBase/HeaderBase.mjs.map +1 -1
  184. package/dist/components/HeaderRoot/HeaderRoot.cjs +8 -5
  185. package/dist/components/HeaderRoot/HeaderRoot.cjs.map +1 -1
  186. package/dist/components/HeaderRoot/HeaderRoot.d.cts.map +1 -1
  187. package/dist/components/HeaderRoot/HeaderRoot.d.mts.map +1 -1
  188. package/dist/components/HeaderRoot/HeaderRoot.mjs +8 -5
  189. package/dist/components/HeaderRoot/HeaderRoot.mjs.map +1 -1
  190. package/dist/components/HeaderSearch/HeaderSearch.cjs.map +1 -1
  191. package/dist/components/HeaderSearch/HeaderSearch.mjs.map +1 -1
  192. package/dist/components/HeaderStandard/HeaderStandard.cjs +17 -7
  193. package/dist/components/HeaderStandard/HeaderStandard.cjs.map +1 -1
  194. package/dist/components/HeaderStandard/HeaderStandard.mjs.map +1 -1
  195. package/dist/components/HeaderStandardAnimated/HeaderStandardAnimated.cjs +17 -7
  196. package/dist/components/HeaderStandardAnimated/HeaderStandardAnimated.cjs.map +1 -1
  197. package/dist/components/HeaderStandardAnimated/useHeaderStandardAnimated.cjs +1 -2
  198. package/dist/components/HeaderStandardAnimated/useHeaderStandardAnimated.cjs.map +1 -1
  199. package/dist/components/HeaderSubpage/HeaderSubpage.cjs +17 -7
  200. package/dist/components/HeaderSubpage/HeaderSubpage.cjs.map +1 -1
  201. package/dist/components/HeaderSubpage/HeaderSubpage.mjs.map +1 -1
  202. package/dist/components/HelpText/HelpText.cjs.map +1 -1
  203. package/dist/components/HelpText/HelpText.mjs.map +1 -1
  204. package/dist/components/Icon/Icon.constants.cjs +4 -4
  205. package/dist/components/Icon/Icon.constants.cjs.map +1 -1
  206. package/dist/components/Icon/Icon.constants.mjs +4 -4
  207. package/dist/components/Icon/Icon.constants.mjs.map +1 -1
  208. package/dist/components/Icon/Icon.d.cts.map +1 -1
  209. package/dist/components/Icon/Icon.d.mts.map +1 -1
  210. package/dist/components/Icon/assets/musd-filled.svg +1 -1
  211. package/dist/components/Input/Input.cjs.map +1 -1
  212. package/dist/components/Input/Input.d.cts +1 -1
  213. package/dist/components/Input/Input.d.mts +1 -1
  214. package/dist/components/Input/Input.mjs.map +1 -1
  215. package/dist/components/KeyValueColumn/KeyValueColumn.cjs +21 -12
  216. package/dist/components/KeyValueColumn/KeyValueColumn.cjs.map +1 -1
  217. package/dist/components/KeyValueColumn/KeyValueColumn.d.cts.map +1 -1
  218. package/dist/components/KeyValueColumn/KeyValueColumn.d.mts.map +1 -1
  219. package/dist/components/KeyValueColumn/KeyValueColumn.mjs +22 -13
  220. package/dist/components/KeyValueColumn/KeyValueColumn.mjs.map +1 -1
  221. package/dist/components/KeyValueRow/KeyValueRow.cjs +19 -10
  222. package/dist/components/KeyValueRow/KeyValueRow.cjs.map +1 -1
  223. package/dist/components/KeyValueRow/KeyValueRow.d.cts.map +1 -1
  224. package/dist/components/KeyValueRow/KeyValueRow.d.mts.map +1 -1
  225. package/dist/components/KeyValueRow/KeyValueRow.mjs +20 -11
  226. package/dist/components/KeyValueRow/KeyValueRow.mjs.map +1 -1
  227. package/dist/components/KeyValueSelect/KeyValueSelect.cjs +17 -7
  228. package/dist/components/KeyValueSelect/KeyValueSelect.cjs.map +1 -1
  229. package/dist/components/KeyValueSelect/KeyValueSelect.d.cts +5 -5
  230. package/dist/components/KeyValueSelect/KeyValueSelect.d.mts +5 -5
  231. package/dist/components/KeyValueSelect/KeyValueSelect.mjs.map +1 -1
  232. package/dist/components/ListItem/ListItem.cjs +4 -3
  233. package/dist/components/ListItem/ListItem.cjs.map +1 -1
  234. package/dist/components/ListItem/ListItem.d.cts.map +1 -1
  235. package/dist/components/ListItem/ListItem.d.mts.map +1 -1
  236. package/dist/components/ListItem/ListItem.mjs +5 -4
  237. package/dist/components/ListItem/ListItem.mjs.map +1 -1
  238. package/dist/components/ListItemMultiSelect/ListItemMultiSelect.cjs.map +1 -1
  239. package/dist/components/ListItemMultiSelect/ListItemMultiSelect.mjs.map +1 -1
  240. package/dist/components/MainActionButton/MainActionButton.d.cts.map +1 -1
  241. package/dist/components/MainActionButton/MainActionButton.d.mts.map +1 -1
  242. package/dist/components/RadioButton/RadioButton.cjs.map +1 -1
  243. package/dist/components/RadioButton/RadioButton.d.cts.map +1 -1
  244. package/dist/components/RadioButton/RadioButton.d.mts.map +1 -1
  245. package/dist/components/RadioButton/RadioButton.mjs.map +1 -1
  246. package/dist/components/SectionDivider/SectionDivider.cjs +17 -7
  247. package/dist/components/SectionDivider/SectionDivider.cjs.map +1 -1
  248. package/dist/components/SectionDivider/SectionDivider.d.cts +1 -1
  249. package/dist/components/SectionDivider/SectionDivider.d.mts +1 -1
  250. package/dist/components/SectionDivider/SectionDivider.mjs.map +1 -1
  251. package/dist/components/SectionHeader/SectionHeader.cjs +17 -10
  252. package/dist/components/SectionHeader/SectionHeader.cjs.map +1 -1
  253. package/dist/components/SectionHeader/SectionHeader.d.cts +2 -2
  254. package/dist/components/SectionHeader/SectionHeader.d.cts.map +1 -1
  255. package/dist/components/SectionHeader/SectionHeader.d.mts +2 -2
  256. package/dist/components/SectionHeader/SectionHeader.d.mts.map +1 -1
  257. package/dist/components/SectionHeader/SectionHeader.mjs +18 -11
  258. package/dist/components/SectionHeader/SectionHeader.mjs.map +1 -1
  259. package/dist/components/SectionHeader/SectionHeader.types.cjs.map +1 -1
  260. package/dist/components/SectionHeader/SectionHeader.types.d.cts +5 -5
  261. package/dist/components/SectionHeader/SectionHeader.types.d.cts.map +1 -1
  262. package/dist/components/SectionHeader/SectionHeader.types.d.mts +5 -5
  263. package/dist/components/SectionHeader/SectionHeader.types.d.mts.map +1 -1
  264. package/dist/components/SectionHeader/SectionHeader.types.mjs.map +1 -1
  265. package/dist/components/SegmentedControl/SegmentedControl.cjs +17 -7
  266. package/dist/components/SegmentedControl/SegmentedControl.cjs.map +1 -1
  267. package/dist/components/SelectButton/SelectButton.cjs.map +1 -1
  268. package/dist/components/SelectButton/SelectButton.mjs.map +1 -1
  269. package/dist/components/SensitiveText/SensitiveText.cjs +17 -7
  270. package/dist/components/SensitiveText/SensitiveText.cjs.map +1 -1
  271. package/dist/components/SensitiveText/SensitiveText.mjs.map +1 -1
  272. package/dist/components/Skeleton/Skeleton.cjs +17 -7
  273. package/dist/components/Skeleton/Skeleton.cjs.map +1 -1
  274. package/dist/components/Skeleton/Skeleton.mjs.map +1 -1
  275. package/dist/components/Slider/Slider.cjs +17 -7
  276. package/dist/components/Slider/Slider.cjs.map +1 -1
  277. package/dist/components/Slider/Slider.constants.cjs +5 -6
  278. package/dist/components/Slider/Slider.constants.cjs.map +1 -1
  279. package/dist/components/Slider/Slider.constants.d.cts +5 -6
  280. package/dist/components/Slider/Slider.constants.d.cts.map +1 -1
  281. package/dist/components/Slider/Slider.constants.d.mts +5 -6
  282. package/dist/components/Slider/Slider.constants.d.mts.map +1 -1
  283. package/dist/components/Slider/Slider.constants.mjs +5 -6
  284. package/dist/components/Slider/Slider.constants.mjs.map +1 -1
  285. package/dist/components/Slider/Slider.mjs.map +1 -1
  286. package/dist/components/Slider/Slider.types.cjs.map +1 -1
  287. package/dist/components/Slider/Slider.types.d.cts +4 -5
  288. package/dist/components/Slider/Slider.types.d.cts.map +1 -1
  289. package/dist/components/Slider/Slider.types.d.mts +4 -5
  290. package/dist/components/Slider/Slider.types.d.mts.map +1 -1
  291. package/dist/components/Slider/Slider.types.mjs.map +1 -1
  292. package/dist/components/Slider/Slider.utilities.cjs +55 -26
  293. package/dist/components/Slider/Slider.utilities.cjs.map +1 -1
  294. package/dist/components/Slider/Slider.utilities.d.cts +24 -3
  295. package/dist/components/Slider/Slider.utilities.d.cts.map +1 -1
  296. package/dist/components/Slider/Slider.utilities.d.mts +24 -3
  297. package/dist/components/Slider/Slider.utilities.d.mts.map +1 -1
  298. package/dist/components/Slider/Slider.utilities.mjs +38 -8
  299. package/dist/components/Slider/Slider.utilities.mjs.map +1 -1
  300. package/dist/components/Slider/useSliderGesture.cjs +1 -2
  301. package/dist/components/Slider/useSliderGesture.cjs.map +1 -1
  302. package/dist/components/Slider/useSliderGesture.mjs.map +1 -1
  303. package/dist/components/Spinner/Spinner.cjs +95 -0
  304. package/dist/components/Spinner/Spinner.cjs.map +1 -0
  305. package/dist/components/Spinner/Spinner.d.cts.map +1 -0
  306. package/dist/components/Spinner/Spinner.d.mts.map +1 -0
  307. package/dist/components/Spinner/Spinner.mjs +65 -0
  308. package/dist/components/Spinner/Spinner.mjs.map +1 -0
  309. package/dist/components/Spinner/Spinner.types.cjs.map +1 -0
  310. package/dist/components/{temp-components/Spinner → Spinner}/Spinner.types.d.cts +2 -2
  311. package/dist/components/Spinner/Spinner.types.d.cts.map +1 -0
  312. package/dist/components/{temp-components/Spinner → Spinner}/Spinner.types.d.mts +2 -2
  313. package/dist/components/Spinner/Spinner.types.d.mts.map +1 -0
  314. package/dist/components/Spinner/Spinner.types.mjs.map +1 -0
  315. package/dist/components/Spinner/index.cjs.map +1 -0
  316. package/dist/components/Spinner/index.d.cts.map +1 -0
  317. package/dist/components/Spinner/index.d.mts.map +1 -0
  318. package/dist/components/Spinner/index.mjs.map +1 -0
  319. package/dist/components/Switch/Switch.d.cts.map +1 -1
  320. package/dist/components/Switch/Switch.d.mts.map +1 -1
  321. package/dist/components/TabEmptyState/TabEmptyState.d.cts.map +1 -1
  322. package/dist/components/TabEmptyState/TabEmptyState.d.mts.map +1 -1
  323. package/dist/components/Tag/Tag.cjs +12 -18
  324. package/dist/components/Tag/Tag.cjs.map +1 -1
  325. package/dist/components/Tag/Tag.d.cts.map +1 -1
  326. package/dist/components/Tag/Tag.d.mts.map +1 -1
  327. package/dist/components/Tag/Tag.mjs +13 -19
  328. package/dist/components/Tag/Tag.mjs.map +1 -1
  329. package/dist/components/Text/Text.cjs +17 -7
  330. package/dist/components/Text/Text.cjs.map +1 -1
  331. package/dist/components/TextArea/TextArea.cjs.map +1 -1
  332. package/dist/components/TextArea/TextArea.d.cts +131 -130
  333. package/dist/components/TextArea/TextArea.d.cts.map +1 -1
  334. package/dist/components/TextArea/TextArea.d.mts +131 -130
  335. package/dist/components/TextArea/TextArea.d.mts.map +1 -1
  336. package/dist/components/TextArea/TextArea.mjs.map +1 -1
  337. package/dist/components/TextButton/TextButton.cjs +17 -7
  338. package/dist/components/TextButton/TextButton.cjs.map +1 -1
  339. package/dist/components/TextButton/TextButton.mjs.map +1 -1
  340. package/dist/components/TextField/TextField.cjs.map +1 -1
  341. package/dist/components/TextField/TextField.d.cts +136 -135
  342. package/dist/components/TextField/TextField.d.cts.map +1 -1
  343. package/dist/components/TextField/TextField.d.mts +136 -135
  344. package/dist/components/TextField/TextField.d.mts.map +1 -1
  345. package/dist/components/TextField/TextField.mjs.map +1 -1
  346. package/dist/components/TextFieldSearch/TextFieldSearch.cjs +17 -7
  347. package/dist/components/TextFieldSearch/TextFieldSearch.cjs.map +1 -1
  348. package/dist/components/TextFieldSearch/TextFieldSearch.d.cts +136 -136
  349. package/dist/components/TextFieldSearch/TextFieldSearch.d.cts.map +1 -1
  350. package/dist/components/TextFieldSearch/TextFieldSearch.d.mts +136 -136
  351. package/dist/components/TextFieldSearch/TextFieldSearch.d.mts.map +1 -1
  352. package/dist/components/TextFieldSearch/TextFieldSearch.mjs.map +1 -1
  353. package/dist/components/TitleAlert/TitleAlert.cjs +20 -18
  354. package/dist/components/TitleAlert/TitleAlert.cjs.map +1 -1
  355. package/dist/components/TitleAlert/TitleAlert.d.cts +3 -3
  356. package/dist/components/TitleAlert/TitleAlert.d.cts.map +1 -1
  357. package/dist/components/TitleAlert/TitleAlert.d.mts +3 -3
  358. package/dist/components/TitleAlert/TitleAlert.d.mts.map +1 -1
  359. package/dist/components/TitleAlert/TitleAlert.mjs +21 -19
  360. package/dist/components/TitleAlert/TitleAlert.mjs.map +1 -1
  361. package/dist/components/TitleAlert/TitleAlert.types.cjs.map +1 -1
  362. package/dist/components/TitleAlert/TitleAlert.types.d.cts +6 -7
  363. package/dist/components/TitleAlert/TitleAlert.types.d.cts.map +1 -1
  364. package/dist/components/TitleAlert/TitleAlert.types.d.mts +6 -7
  365. package/dist/components/TitleAlert/TitleAlert.types.d.mts.map +1 -1
  366. package/dist/components/TitleAlert/TitleAlert.types.mjs.map +1 -1
  367. package/dist/components/TitleHub/TitleHub.cjs +22 -13
  368. package/dist/components/TitleHub/TitleHub.cjs.map +1 -1
  369. package/dist/components/TitleHub/TitleHub.d.cts +3 -3
  370. package/dist/components/TitleHub/TitleHub.d.cts.map +1 -1
  371. package/dist/components/TitleHub/TitleHub.d.mts +3 -3
  372. package/dist/components/TitleHub/TitleHub.d.mts.map +1 -1
  373. package/dist/components/TitleHub/TitleHub.mjs +23 -14
  374. package/dist/components/TitleHub/TitleHub.mjs.map +1 -1
  375. package/dist/components/TitleHub/TitleHub.types.cjs.map +1 -1
  376. package/dist/components/TitleHub/TitleHub.types.d.cts +10 -10
  377. package/dist/components/TitleHub/TitleHub.types.d.cts.map +1 -1
  378. package/dist/components/TitleHub/TitleHub.types.d.mts +10 -10
  379. package/dist/components/TitleHub/TitleHub.types.d.mts.map +1 -1
  380. package/dist/components/TitleHub/TitleHub.types.mjs.map +1 -1
  381. package/dist/components/TitleStandard/TitleStandard.cjs +15 -9
  382. package/dist/components/TitleStandard/TitleStandard.cjs.map +1 -1
  383. package/dist/components/TitleStandard/TitleStandard.d.cts +2 -2
  384. package/dist/components/TitleStandard/TitleStandard.d.cts.map +1 -1
  385. package/dist/components/TitleStandard/TitleStandard.d.mts +2 -2
  386. package/dist/components/TitleStandard/TitleStandard.d.mts.map +1 -1
  387. package/dist/components/TitleStandard/TitleStandard.mjs +16 -10
  388. package/dist/components/TitleStandard/TitleStandard.mjs.map +1 -1
  389. package/dist/components/TitleStandard/TitleStandard.types.cjs.map +1 -1
  390. package/dist/components/TitleStandard/TitleStandard.types.d.cts +7 -7
  391. package/dist/components/TitleStandard/TitleStandard.types.d.cts.map +1 -1
  392. package/dist/components/TitleStandard/TitleStandard.types.d.mts +7 -7
  393. package/dist/components/TitleStandard/TitleStandard.types.d.mts.map +1 -1
  394. package/dist/components/TitleStandard/TitleStandard.types.mjs.map +1 -1
  395. package/dist/components/TitleSubpage/TitleSubpage.cjs +31 -18
  396. package/dist/components/TitleSubpage/TitleSubpage.cjs.map +1 -1
  397. package/dist/components/TitleSubpage/TitleSubpage.d.cts +3 -3
  398. package/dist/components/TitleSubpage/TitleSubpage.d.cts.map +1 -1
  399. package/dist/components/TitleSubpage/TitleSubpage.d.mts +3 -3
  400. package/dist/components/TitleSubpage/TitleSubpage.d.mts.map +1 -1
  401. package/dist/components/TitleSubpage/TitleSubpage.mjs +32 -19
  402. package/dist/components/TitleSubpage/TitleSubpage.mjs.map +1 -1
  403. package/dist/components/TitleSubpage/TitleSubpage.types.cjs.map +1 -1
  404. package/dist/components/TitleSubpage/TitleSubpage.types.d.cts +8 -9
  405. package/dist/components/TitleSubpage/TitleSubpage.types.d.cts.map +1 -1
  406. package/dist/components/TitleSubpage/TitleSubpage.types.d.mts +8 -9
  407. package/dist/components/TitleSubpage/TitleSubpage.types.d.mts.map +1 -1
  408. package/dist/components/TitleSubpage/TitleSubpage.types.mjs.map +1 -1
  409. package/dist/components/Toast/Toast.cjs.map +1 -1
  410. package/dist/components/Toast/Toast.mjs.map +1 -1
  411. package/dist/components/Toast/Toaster.cjs +17 -7
  412. package/dist/components/Toast/Toaster.cjs.map +1 -1
  413. package/dist/components/Toast/Toaster.d.cts +1 -1
  414. package/dist/components/Toast/Toaster.d.cts.map +1 -1
  415. package/dist/components/Toast/Toaster.d.mts +1 -1
  416. package/dist/components/Toast/Toaster.d.mts.map +1 -1
  417. package/dist/components/Toast/Toaster.mjs.map +1 -1
  418. package/dist/components/index.cjs +1 -1
  419. package/dist/components/index.cjs.map +1 -1
  420. package/dist/components/index.d.cts +2 -2
  421. package/dist/components/index.d.cts.map +1 -1
  422. package/dist/components/index.d.mts +2 -2
  423. package/dist/components/index.d.mts.map +1 -1
  424. package/dist/components/index.mjs +1 -1
  425. package/dist/components/index.mjs.map +1 -1
  426. package/dist/components/temp-components/Blockies/Blockies.d.cts.map +1 -1
  427. package/dist/components/temp-components/Blockies/Blockies.d.mts.map +1 -1
  428. package/dist/components/temp-components/Blockies/Blockies.utilities.cjs +2 -2
  429. package/dist/components/temp-components/Blockies/Blockies.utilities.cjs.map +1 -1
  430. package/dist/components/temp-components/Blockies/Blockies.utilities.mjs.map +1 -1
  431. package/dist/components/temp-components/ButtonAnimated/ButtonAnimated.cjs +17 -7
  432. package/dist/components/temp-components/ButtonAnimated/ButtonAnimated.cjs.map +1 -1
  433. package/dist/components/temp-components/ButtonAnimated/ButtonAnimated.d.cts.map +1 -1
  434. package/dist/components/temp-components/ButtonAnimated/ButtonAnimated.d.mts.map +1 -1
  435. package/dist/components/temp-components/HeaderStandardCenterColumn/HeaderStandardCenterColumn.cjs +10 -9
  436. package/dist/components/temp-components/HeaderStandardCenterColumn/HeaderStandardCenterColumn.cjs.map +1 -1
  437. package/dist/components/temp-components/HeaderStandardCenterColumn/HeaderStandardCenterColumn.d.cts.map +1 -1
  438. package/dist/components/temp-components/HeaderStandardCenterColumn/HeaderStandardCenterColumn.d.mts.map +1 -1
  439. package/dist/components/temp-components/HeaderStandardCenterColumn/HeaderStandardCenterColumn.mjs +10 -8
  440. package/dist/components/temp-components/HeaderStandardCenterColumn/HeaderStandardCenterColumn.mjs.map +1 -1
  441. package/dist/components/temp-components/HeaderStandardCenterColumn/HeaderStandardCenterColumn.types.cjs +0 -5
  442. package/dist/components/temp-components/HeaderStandardCenterColumn/HeaderStandardCenterColumn.types.cjs.map +1 -1
  443. package/dist/components/temp-components/ImageOrSvg/ImageOrSvg.cjs +17 -7
  444. package/dist/components/temp-components/ImageOrSvg/ImageOrSvg.cjs.map +1 -1
  445. package/dist/components/temp-components/ImageOrSvg/ImageOrSvg.d.cts.map +1 -1
  446. package/dist/components/temp-components/ImageOrSvg/ImageOrSvg.d.mts.map +1 -1
  447. package/dist/components/temp-components/ImageOrSvg/ImageOrSvg.mjs.map +1 -1
  448. package/dist/components/temp-components/Jazzicon/Jazzicon.cjs +1 -1
  449. package/dist/components/temp-components/Jazzicon/Jazzicon.cjs.map +1 -1
  450. package/dist/components/temp-components/Jazzicon/Jazzicon.d.cts.map +1 -1
  451. package/dist/components/temp-components/Jazzicon/Jazzicon.d.mts.map +1 -1
  452. package/dist/components/temp-components/Jazzicon/Jazzicon.mjs +1 -1
  453. package/dist/components/temp-components/Jazzicon/Jazzicon.mjs.map +1 -1
  454. package/dist/components/temp-components/Maskicon/Maskicon.cjs +17 -7
  455. package/dist/components/temp-components/Maskicon/Maskicon.cjs.map +1 -1
  456. package/dist/components/temp-components/Maskicon/Maskicon.d.cts.map +1 -1
  457. package/dist/components/temp-components/Maskicon/Maskicon.d.mts.map +1 -1
  458. package/dist/components/temp-components/Maskicon/Maskicon.mjs.map +1 -1
  459. package/dist/components/temp-components/Maskicon/Maskicon.utilities.cjs +4 -5
  460. package/dist/components/temp-components/Maskicon/Maskicon.utilities.cjs.map +1 -1
  461. package/dist/components/temp-components/Maskicon/Maskicon.utilities.mjs.map +1 -1
  462. package/dist/components/temp-components/TextOrChildren/TextOrChildren.cjs +1 -1
  463. package/dist/components/temp-components/TextOrChildren/TextOrChildren.cjs.map +1 -1
  464. package/dist/components/temp-components/TextOrChildren/TextOrChildren.d.cts.map +1 -1
  465. package/dist/components/temp-components/TextOrChildren/TextOrChildren.d.mts.map +1 -1
  466. package/dist/components/temp-components/TextOrChildren/TextOrChildren.mjs +1 -1
  467. package/dist/components/temp-components/TextOrChildren/TextOrChildren.mjs.map +1 -1
  468. package/dist/components/temp-components/TextOrChildren/TextOrChildren.types.cjs.map +1 -1
  469. package/dist/components/temp-components/TextOrChildren/TextOrChildren.types.d.cts +1 -1
  470. package/dist/components/temp-components/TextOrChildren/TextOrChildren.types.d.mts +1 -1
  471. package/dist/components/temp-components/TextOrChildren/TextOrChildren.types.mjs.map +1 -1
  472. package/dist/test-utils/createRenderer.cjs +17 -11
  473. package/dist/test-utils/createRenderer.cjs.map +1 -1
  474. package/dist/test-utils/createRenderer.d.cts.map +1 -1
  475. package/dist/test-utils/createRenderer.d.mts.map +1 -1
  476. package/package.json +5 -5
  477. package/dist/components/temp-components/Spinner/Spinner.cjs +0 -68
  478. package/dist/components/temp-components/Spinner/Spinner.cjs.map +0 -1
  479. package/dist/components/temp-components/Spinner/Spinner.d.cts.map +0 -1
  480. package/dist/components/temp-components/Spinner/Spinner.d.mts.map +0 -1
  481. package/dist/components/temp-components/Spinner/Spinner.mjs +0 -48
  482. package/dist/components/temp-components/Spinner/Spinner.mjs.map +0 -1
  483. package/dist/components/temp-components/Spinner/Spinner.types.cjs.map +0 -1
  484. package/dist/components/temp-components/Spinner/Spinner.types.d.cts.map +0 -1
  485. package/dist/components/temp-components/Spinner/Spinner.types.d.mts.map +0 -1
  486. package/dist/components/temp-components/Spinner/Spinner.types.mjs.map +0 -1
  487. package/dist/components/temp-components/Spinner/index.cjs.map +0 -1
  488. package/dist/components/temp-components/Spinner/index.d.cts.map +0 -1
  489. package/dist/components/temp-components/Spinner/index.d.mts.map +0 -1
  490. package/dist/components/temp-components/Spinner/index.mjs.map +0 -1
  491. /package/dist/components/{temp-components/Spinner → Spinner}/Spinner.d.cts +0 -0
  492. /package/dist/components/{temp-components/Spinner → Spinner}/Spinner.d.mts +0 -0
  493. /package/dist/components/{temp-components/Spinner → Spinner}/Spinner.types.cjs +0 -0
  494. /package/dist/components/{temp-components/Spinner → Spinner}/Spinner.types.mjs +0 -0
  495. /package/dist/components/{temp-components/Spinner → Spinner}/index.cjs +0 -0
  496. /package/dist/components/{temp-components/Spinner → Spinner}/index.d.cts +0 -0
  497. /package/dist/components/{temp-components/Spinner → Spinner}/index.d.mts +0 -0
  498. /package/dist/components/{temp-components/Spinner → Spinner}/index.mjs +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"ButtonTertiary.mjs","sourceRoot":"","sources":["../../../../../src/components/Button/variants/ButtonTertiary/ButtonTertiary.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,QAAO,EAAE,WAAW,EAAE,cAAc;;AAE3C,OAAO,EAAE,UAAU,EAAE,sCAA4B;AAIjD,2BAA2B;AAC3B,gDAAgD;AAChD,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,EAC7B,QAAQ,EACR,SAAS,EACT,YAAY,EACZ,cAAc,EACd,YAAY,EACZ,QAAQ,GAAG,KAAK,EAChB,SAAS,GAAG,KAAK,EACjB,SAAS,GAAG,KAAK,EACjB,WAAW,GAAG,EAAE,EAChB,KAAK,EACL,GAAG,KAAK,EACY,EAAE,EAAE;IACxB,MAAM,qBAAqB,GAAG,WAAW,CACvC,CAAC,OAAgB,EAAU,EAAE;QAC3B,MAAM,YAAY,GAChB,OAAO,WAAW,KAAK,UAAU,CAAC,CAAC,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC;QAEzE,MAAM,WAAW,GAAG;UAChB,S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AAO,OAAO,IAAI,SAAS;gBACzB,CAAC,CAAC,4BAA4B;gBAC9B,CAAC,CAAC,oBAAoB,CAAC;SAC1B;QACD,IAAI,SAAS,EAAE;YACb,OAAO,sBAAsB,CAAC;SAC/B;QACD,oEAAoE;QACpE,OAAO,cAAc,CAAC;IACxB,CAAC,EACD,CAAC,QAAQ,EAAE,SAAS,EAAE,SAAS,CAAC,CACjC,CAAC;IAEF,OAAO,CACL,CAAC,UAAU,CACT,SAAS,CAAC,CAAC,SAAS,CAAC,CACrB,YAAY,CAAC,CAAC,YAAY,CAAC,CAC3B,cAAc,CAAC,CAAC,cAAc,CAAC,CAC/B,YAAY,CAAC,CAAC,YAAY,CAAC,CAC3B,SAAS,CAAC,CAAC,SAAS,CAAC,CACrB,WAAW,CAAC,CAAC,qBAAqB,CAAC,CACnC,aAAa,CAAC,CAAC,gBAAgB,CAAC,CAChC,aAAa,CAAC,CAAC,gBAAgB,CAAC,CAChC,KAAK,CAAC,CAAC,KAAK,CAAC,CACb,IAAI,KAAK,CAAC,CAEV;MAAA,CAAC,QAAQ,CACX;IAAA,EAAE,UAAU,CAAC,CACd,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import React, { useCallback } from 'react';\n\nimport { ButtonBase } from '../../../ButtonBase';\n\nimport type { ButtonTertiaryProps } from './ButtonTertiary.types';\n\n// Internal Button variant.\n// Consumers should use `Button` with `variant`.\nexport const ButtonTertiary = ({\n children,\n textProps,\n spinnerProps,\n startIconProps,\n endIconProps,\n isDanger = false,\n isInverse = false,\n isLoading = false,\n twClassName = '',\n style,\n ...props\n}: ButtonTertiaryProps) => {\n const getContainerClassName = useCallback(\n (pressed: boolean): string => {\n const classNameStr =\n typeof twClassName === 'function' ? twClassName(pressed) : twClassName;\n\n const baseClasses = `\n ${isInverse && !isDanger ? 'border-[1.5px]' : 'border-0'}\n ${classNameStr}\n `;\n\n let backgroundClass = '';\n let borderClass = '';\n\n if (isInverse && isDanger) {\n backgroundClass =\n pressed || isLoading ? 'bg-default-pressed' : 'bg-default';\n borderClass =\n pressed || isLoading\n ? 'border-background-default-pressed'\n : 'border-background-default';\n } else if (isDanger) {\n backgroundClass =\n pressed || isLoading ? 'bg-error-muted-pressed' : 'bg-transparent';\n borderClass =\n pressed || isLoading\n ? 'border-error-muted-pressed'\n : 'border-transparent';\n } else if (isInverse) {\n backgroundClass =\n pressed || isLoading ? 'bg-pressed' : 'bg-transparent';\n borderClass = 'border-primary-inverse';\n } else {\n backgroundClass =\n pressed || isLoading ? 'bg-pressed' : 'bg-transparent';\n borderClass =\n pressed || isLoading\n ? 'border-background-pressed'\n : 'border-transparent';\n }\n\n return `${backgroundClass} ${borderClass} ${baseClasses}`;\n },\n [isInverse, isDanger, isLoading, twClassName],\n );\n\n const getTextClassName = useCallback(\n (pressed: boolean): string => {\n if (isDanger) {\n return pressed || isLoading\n ? 'text-error-default-pressed'\n : 'text-error-default';\n }\n if (isInverse) {\n return 'text-primary-inverse';\n }\n // Use neutral text color for all states (default, pressed, loading)\n return 'text-default';\n },\n [isDanger, isInverse, isLoading],\n );\n\n return (\n <ButtonBase\n textProps={textProps}\n spinnerProps={spinnerProps}\n startIconProps={startIconProps}\n endIconProps={endIconProps}\n isLoading={isLoading}\n twClassName={getContainerClassName}\n textClassName={getTextClassName}\n iconClassName={getTextClassName}\n style={style}\n {...props}\n >\n {children}\n </ButtonBase>\n );\n};\n"]}
1
+ {"version":3,"file":"ButtonTertiary.mjs","sourceRoot":"","sources":["../../../../../src/components/Button/variants/ButtonTertiary/ButtonTertiary.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,QAAO,EAAE,WAAW,EAAE,cAAc;;AAE3C,OAAO,EAAE,UAAU,EAAE,sCAA4B;AAIjD,2BAA2B;AAC3B,gDAAgD;AAChD,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,EAC7B,QAAQ,EACR,SAAS,EACT,YAAY,EACZ,cAAc,EACd,YAAY,EACZ,QAAQ,GAAG,KAAK,EAChB,SAAS,GAA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gBAAgB,CAAC;YACzD,WAAW;gBACT,OAAO,IAAI,SAAS;oBAClB,CAAC,CAAC,2BAA2B;oBAC7B,CAAC,CAAC,oBAAoB,CAAC;QAC7B,CAAC;QAED,OAAO,GAAG,eAAe,IAAI,WAAW,IAAI,WAAW,EAAE,CAAC;IAC5D,CAAC,EACD,CAAC,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAE,WAAW,CAAC,CAC9C,CAAC;IAEF,MAAM,gBAAgB,GAAG,WAAW,CAClC,CAAC,OAAgB,EAAU,EAAE;QAC3B,IAAI,QAAQ,EAAE,CAAC;YACb,OAAO,OAAO,IAAI,SAAS;gBACzB,CAAC,CAAC,4BAA4B;gBAC9B,CAAC,CAAC,oBAAoB,CAAC;QAC3B,CAAC;QACD,IAAI,SAAS,EAAE,CAAC;YACd,OAAO,sBAAsB,CAAC;QAChC,CAAC;QACD,oEAAoE;QACpE,OAAO,cAAc,CAAC;IACxB,CAAC,EACD,CAAC,QAAQ,EAAE,SAAS,EAAE,SAAS,CAAC,CACjC,CAAC;IAEF,OAAO,CACL,CAAC,UAAU,CACT,SAAS,CAAC,CAAC,SAAS,CAAC,CACrB,YAAY,CAAC,CAAC,YAAY,CAAC,CAC3B,cAAc,CAAC,CAAC,cAAc,CAAC,CAC/B,YAAY,CAAC,CAAC,YAAY,CAAC,CAC3B,SAAS,CAAC,CAAC,SAAS,CAAC,CACrB,WAAW,CAAC,CAAC,qBAAqB,CAAC,CACnC,aAAa,CAAC,CAAC,gBAAgB,CAAC,CAChC,aAAa,CAAC,CAAC,gBAAgB,CAAC,CAChC,KAAK,CAAC,CAAC,KAAK,CAAC,CACb,IAAI,KAAK,CAAC,CAEV;MAAA,CAAC,QAAQ,CACX;IAAA,EAAE,UAAU,CAAC,CACd,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import React, { useCallback } from 'react';\n\nimport { ButtonBase } from '../../../ButtonBase';\n\nimport type { ButtonTertiaryProps } from './ButtonTertiary.types';\n\n// Internal Button variant.\n// Consumers should use `Button` with `variant`.\nexport const ButtonTertiary = ({\n children,\n textProps,\n spinnerProps,\n startIconProps,\n endIconProps,\n isDanger = false,\n isInverse = false,\n isLoading = false,\n twClassName = '',\n style,\n ...props\n}: ButtonTertiaryProps) => {\n const getContainerClassName = useCallback(\n (pressed: boolean): string => {\n const classNameStr =\n typeof twClassName === 'function' ? twClassName(pressed) : twClassName;\n\n const baseClasses = `\n ${isInverse && !isDanger ? 'border-[1.5px]' : 'border-0'}\n ${classNameStr}\n `;\n\n let backgroundClass = '';\n let borderClass = '';\n\n if (isInverse && isDanger) {\n backgroundClass =\n pressed || isLoading ? 'bg-default-pressed' : 'bg-default';\n borderClass =\n pressed || isLoading\n ? 'border-background-default-pressed'\n : 'border-background-default';\n } else if (isDanger) {\n backgroundClass =\n pressed || isLoading ? 'bg-error-muted-pressed' : 'bg-transparent';\n borderClass =\n pressed || isLoading\n ? 'border-error-muted-pressed'\n : 'border-transparent';\n } else if (isInverse) {\n backgroundClass =\n pressed || isLoading ? 'bg-pressed' : 'bg-transparent';\n borderClass = 'border-primary-inverse';\n } else {\n backgroundClass =\n pressed || isLoading ? 'bg-pressed' : 'bg-transparent';\n borderClass =\n pressed || isLoading\n ? 'border-background-pressed'\n : 'border-transparent';\n }\n\n return `${backgroundClass} ${borderClass} ${baseClasses}`;\n },\n [isInverse, isDanger, isLoading, twClassName],\n );\n\n const getTextClassName = useCallback(\n (pressed: boolean): string => {\n if (isDanger) {\n return pressed || isLoading\n ? 'text-error-default-pressed'\n : 'text-error-default';\n }\n if (isInverse) {\n return 'text-primary-inverse';\n }\n // Use neutral text color for all states (default, pressed, loading)\n return 'text-default';\n },\n [isDanger, isInverse, isLoading],\n );\n\n return (\n <ButtonBase\n textProps={textProps}\n spinnerProps={spinnerProps}\n startIconProps={startIconProps}\n endIconProps={endIconProps}\n isLoading={isLoading}\n twClassName={getContainerClassName}\n textClassName={getTextClassName}\n iconClassName={getTextClassName}\n style={style}\n {...props}\n >\n {children}\n </ButtonBase>\n );\n};\n"]}
@@ -15,23 +15,33 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
25
35
  Object.defineProperty(exports, "__esModule", { value: true });
26
36
  exports.ButtonBase = void 0;
27
37
  const design_system_shared_1 = require("@metamask-previews/design-system-shared");
28
38
  const design_system_twrnc_preset_1 = require("@metamask-previews/design-system-twrnc-preset");
29
39
  const react_1 = __importStar(require("react"));
30
40
  const Box_1 = require("../Box/index.cjs");
31
- const BoxRow_1 = require("../BoxRow/index.cjs");
32
41
  const Icon_1 = require("../Icon/index.cjs");
42
+ const Spinner_1 = require("../Spinner/index.cjs");
33
43
  const ButtonAnimated_1 = require("../temp-components/ButtonAnimated/index.cjs");
34
- const Spinner_1 = require("../temp-components/Spinner/index.cjs");
44
+ const TextOrChildren_1 = require("../temp-components/TextOrChildren/index.cjs");
35
45
  const ButtonBase_constants_1 = require("./ButtonBase.constants.cjs");
36
46
  const ButtonBase = ({ children, textProps, size = design_system_shared_1.ButtonBaseSize.Lg, isLoading, loadingText, spinnerProps, loadingWrapperProps, contentWrapperProps, startIconName, startIconProps, startAccessory, endIconName, endIconProps, endAccessory, isDisabled, isFullWidth, twClassName, textClassName, iconClassName, style, accessibilityLabel, accessibilityHint, accessibilityRole = 'button', accessibilityActions, onAccessibilityAction, ...props }) => {
37
47
  const tw = (0, design_system_twrnc_preset_1.useTailwind)();
@@ -124,9 +134,11 @@ const ButtonBase = ({ children, textProps, size = design_system_shared_1.ButtonB
124
134
  }}/>
125
135
  </Box_1.Box>)}
126
136
 
127
- <BoxRow_1.BoxRow {...restContentWrapper} twClassName={isLoading
137
+ <Box_1.Box flexDirection={design_system_shared_1.BoxFlexDirection.Row} alignItems={design_system_shared_1.BoxAlignItems.Center} gap={hasAccessories ? 1 : 0} {...restContentWrapper} twClassName={isLoading
128
138
  ? (0, design_system_shared_1.mergeTwClassName)('opacity-0', contentWrapperTw)
129
- : contentWrapperTw} gap={hasAccessories ? 1 : 0} startAccessory={finalStartIconName ? (<Icon_1.Icon name={finalStartIconName} size={iconSize} {...startIconProps} twClassName={(0, design_system_shared_1.mergeTwClassName)((0, design_system_shared_1.mergeTwClassName)('shrink-0', iconClassName ? iconClassName(pressed) : undefined), startIconProps?.twClassName)}/>) : (startAccessory)} endAccessory={finalEndIconName ? (<Icon_1.Icon name={finalEndIconName} size={iconSize} {...endIconProps} twClassName={(0, design_system_shared_1.mergeTwClassName)((0, design_system_shared_1.mergeTwClassName)('shrink-0', iconClassName ? iconClassName(pressed) : undefined), endIconProps?.twClassName)}/>) : (endAccessory)} textProps={{
139
+ : contentWrapperTw}>
140
+ {finalStartIconName ? (<Icon_1.Icon name={finalStartIconName} size={iconSize} {...startIconProps} twClassName={(0, design_system_shared_1.mergeTwClassName)((0, design_system_shared_1.mergeTwClassName)('shrink-0', iconClassName ? iconClassName(pressed) : undefined), startIconProps?.twClassName)}/>) : (startAccessory)}
141
+ <TextOrChildren_1.TextOrChildren textProps={{
130
142
  variant: labelTextVariant,
131
143
  fontWeight: design_system_shared_1.FontWeight.Medium,
132
144
  color: design_system_shared_1.TextColor.TextDefault,
@@ -135,8 +147,10 @@ const ButtonBase = ({ children, textProps, size = design_system_shared_1.ButtonB
135
147
  ...textProps,
136
148
  twClassName: (0, design_system_shared_1.mergeTwClassName)((0, design_system_shared_1.mergeTwClassName)('shrink grow-0 flex-wrap text-center', textClassName ? textClassName(pressed) : undefined), textProps?.twClassName),
137
149
  }}>
138
- {children}
139
- </BoxRow_1.BoxRow>
150
+ {children}
151
+ </TextOrChildren_1.TextOrChildren>
152
+ {finalEndIconName ? (<Icon_1.Icon name={finalEndIconName} size={iconSize} {...endIconProps} twClassName={(0, design_system_shared_1.mergeTwClassName)((0, design_system_shared_1.mergeTwClassName)('shrink-0', iconClassName ? iconClassName(pressed) : undefined), endIconProps?.twClassName)}/>) : (endAccessory)}
153
+ </Box_1.Box>
140
154
  </>);
141
155
  }}
142
156
  </ButtonAnimated_1.ButtonAnimated>);
@@ -1 +1 @@
1
- {"version":3,"file":"ButtonBase.cjs","sourceRoot":"","sources":["../../../src/components/ButtonBase/ButtonBase.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kFAKiD;AACjD,8FAA4E;AAC5E,+CAAuC;AAGvC,0CAA6B;AAC7B,gDAAmC;AACnC,4CAA0C;AAC1C,gFAAmE;AACnE,kEAAqD;AAErD,qEAKgC;AAGzB,MAAM,UAAU,GAAG,CAAC,EACzB,QAAQ,EACR,SAAS,EACT,IAAI,GAAG,qCAAc,CAAC,EAAE,EACxB,SAAS,EACT,WAAW,EACX,YAAY,EACZ,mBAAmB,EACnB,mBAAmB,EACnB,aAAa,EACb,cAAc,EACd,cAAc,EACd,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,UAAU,EACV,WAAW,EACX,WAAW,EACX,aAAa,EACb,aAAa,EACb,KAAK,EACL,kBAAkB,EAClB,iBAAiB,EACjB,iBAAiB,GAAG,QAAQ,EAC5B,oBAAoB,EACpB,qB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S,CAAC,CAAC;oBACT,OAAO,EAAE,gBAAgB;oBACzB,UAAU,EAAE,iCAAU,CAAC,MAAM;oBAC7B,KAAK,EAAE,gCAAS,CAAC,WAAW;oBAC5B,aAAa,EAAE,CAAC;oBAChB,aAAa,EAAE,MAAM;oBACrB,GAAG,SAAS;oBACZ,WAAW,EAAE,IAAA,uCAAgB,EAC3B,IAAA,uCAAgB,EACd,qCAAqC,EACrC,aAAa,CAAC,CAAC,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,SAAS,CACnD,EACD,SAAS,EAAE,WAAW,CACvB;iBACF,CAAC,CAEF;cAAA,CAAC,QAAQ,CACX;YAAA,EAAE,eAAM,CACV;UAAA,GAAG,CACJ,CAAC;QACJ,CAAC,CACH;IAAA,EAAE,+BAAc,CAAC,CAClB,CAAC;AACJ,CAAC,CAAC;AAjPW,QAAA,UAAU,cAiPrB","sourcesContent":["import {\n ButtonBaseSize,\n FontWeight,\n mergeTwClassName,\n TextColor,\n} from '@metamask-previews/design-system-shared';\nimport { useTailwind } from '@metamask-previews/design-system-twrnc-preset';\nimport React, { useMemo } from 'react';\nimport type { StyleProp, ViewStyle } from 'react-native';\n\nimport { Box } from '../Box';\nimport { BoxRow } from '../BoxRow';\nimport { Icon, IconColor } from '../Icon';\nimport { ButtonAnimated } from '../temp-components/ButtonAnimated';\nimport { Spinner } from '../temp-components/Spinner';\n\nimport {\n MAP_BUTTONBASE_SIZE_ICONSIZE,\n MAP_BUTTONBASE_SIZE_TEXT_VARIANT,\n getButtonBaseHorizontalPaddingTwClasses,\n TWCLASSMAP_BUTTONBASE_SIZE_DIMENSION,\n} from './ButtonBase.constants';\nimport type { ButtonBaseProps } from './ButtonBase.types';\n\nexport const ButtonBase = ({\n children,\n textProps,\n size = ButtonBaseSize.Lg,\n isLoading,\n loadingText,\n spinnerProps,\n loadingWrapperProps,\n contentWrapperProps,\n startIconName,\n startIconProps,\n startAccessory,\n endIconName,\n endIconProps,\n endAccessory,\n isDisabled,\n isFullWidth,\n twClassName,\n textClassName,\n iconClassName,\n style,\n accessibilityLabel,\n accessibilityHint,\n accessibilityRole = 'button',\n accessibilityActions,\n onAccessibilityAction,\n ...props\n}: ButtonBaseProps) => {\n const tw = useTailwind();\n\n const finalStartIconName = startIconName ?? startIconProps?.name;\n const finalEndIconName = endIconName ?? endIconProps?.name;\n\n const hasStart = Boolean(finalStartIconName || startAccessory);\n const hasEnd = Boolean(finalEndIconName || endAccessory);\n const hasAccessories = hasStart || hasEnd;\n\n const iconSize = MAP_BUTTONBASE_SIZE_ICONSIZE[size];\n const labelTextVariant = MAP_BUTTONBASE_SIZE_TEXT_VARIANT[size];\n\n // Generate accessibility label if not provided\n const finalAccessibilityLabel = useMemo(() => {\n if (accessibilityLabel) {\n return accessibilityLabel;\n }\n\n // For loading state with loadingText, prioritize loadingText\n if (isLoading && loadingText) {\n return loadingText;\n }\n\n // If children is a string, use it as the label\n if (typeof children === 'string') {\n return children;\n }\n\n return undefined;\n }, [accessibilityLabel, children, isLoading, loadingText]);\n\n // Generate accessibility hint for loading state if not provided\n const finalAccessibilityHint = useMemo(() => {\n if (accessibilityHint) {\n return accessibilityHint;\n }\n\n if (isLoading) {\n return 'Button is currently loading';\n }\n\n return undefined;\n }, [accessibilityHint, isLoading]);\n\n // Create accessibilityState object with only truthy values\n const accessibilityState = useMemo(() => {\n const state: { disabled?: boolean; busy?: boolean } = {};\n\n if (isDisabled || isLoading) {\n state.disabled = true;\n }\n\n if (isLoading) {\n state.busy = true;\n }\n\n return state;\n }, [isDisabled, isLoading]);\n\n return (\n <ButtonAnimated\n disabled={isDisabled || isLoading}\n accessibilityRole={accessibilityRole}\n accessibilityLabel={finalAccessibilityLabel}\n accessibilityHint={finalAccessibilityHint}\n accessibilityActions={accessibilityActions}\n onAccessibilityAction={onAccessibilityAction}\n accessibilityState={accessibilityState}\n accessible\n style={({ pressed }) => {\n // Evaluate custom className if it's a function\n const customClassName =\n typeof twClassName === 'function'\n ? twClassName(pressed)\n : twClassName;\n\n // Build button container styles\n const buttonStyles = tw.style(\n // Base layout - flex container for button content\n 'flex-row items-center justify-center rounded-full',\n // Visual styling\n 'bg-muted overflow-hidden',\n getButtonBaseHorizontalPaddingTwClasses(hasStart, hasEnd),\n // Size\n TWCLASSMAP_BUTTONBASE_SIZE_DIMENSION[size],\n // State-based opacity\n isDisabled ? 'opacity-50' : 'opacity-100',\n // Width - use self-start to prevent stretching when not full width\n isFullWidth ? 'w-full' : 'self-start',\n // Custom classes\n customClassName,\n );\n\n // Merge with additional styles if provided\n const computedStyle: StyleProp<ViewStyle>[] = [buttonStyles];\n\n const additionalStyle =\n typeof style === 'function' ? style({ pressed }) : style;\n\n if (additionalStyle) {\n computedStyle.push(additionalStyle);\n }\n\n return computedStyle;\n }}\n {...props}\n >\n {({ pressed }) => {\n const { twClassName: loadingWrapperTw, ...restLoadingWrapper } =\n loadingWrapperProps ?? {};\n const { twClassName: contentWrapperTw, ...restContentWrapper } =\n contentWrapperProps ?? {};\n\n return (\n <>\n {/* Loading spinner overlay */}\n {isLoading && (\n <Box\n {...restLoadingWrapper}\n twClassName={mergeTwClassName(\n 'absolute inset-0 flex items-center justify-center',\n loadingWrapperTw,\n )}\n >\n <Spinner\n color={\n textClassName\n ? (textClassName(pressed) as IconColor)\n : IconColor.IconDefault\n }\n loadingText={loadingText}\n {...spinnerProps}\n spinnerIconProps={{\n size: iconSize,\n ...spinnerProps?.spinnerIconProps,\n }}\n loadingTextProps={{\n numberOfLines: 1,\n variant: labelTextVariant,\n twClassName: textClassName ? textClassName(pressed) : '',\n ...spinnerProps?.loadingTextProps,\n }}\n />\n </Box>\n )}\n\n <BoxRow\n {...restContentWrapper}\n twClassName={\n isLoading\n ? mergeTwClassName('opacity-0', contentWrapperTw)\n : contentWrapperTw\n }\n gap={hasAccessories ? 1 : 0}\n startAccessory={\n finalStartIconName ? (\n <Icon\n name={finalStartIconName}\n size={iconSize}\n {...startIconProps}\n twClassName={mergeTwClassName(\n mergeTwClassName(\n 'shrink-0',\n iconClassName ? iconClassName(pressed) : undefined,\n ),\n startIconProps?.twClassName,\n )}\n />\n ) : (\n startAccessory\n )\n }\n endAccessory={\n finalEndIconName ? (\n <Icon\n name={finalEndIconName}\n size={iconSize}\n {...endIconProps}\n twClassName={mergeTwClassName(\n mergeTwClassName(\n 'shrink-0',\n iconClassName ? iconClassName(pressed) : undefined,\n ),\n endIconProps?.twClassName,\n )}\n />\n ) : (\n endAccessory\n )\n }\n textProps={{\n variant: labelTextVariant,\n fontWeight: FontWeight.Medium,\n color: TextColor.TextDefault,\n numberOfLines: 1,\n ellipsizeMode: 'clip',\n ...textProps,\n twClassName: mergeTwClassName(\n mergeTwClassName(\n 'shrink grow-0 flex-wrap text-center',\n textClassName ? textClassName(pressed) : undefined,\n ),\n textProps?.twClassName,\n ),\n }}\n >\n {children}\n </BoxRow>\n </>\n );\n }}\n </ButtonAnimated>\n );\n};\n"]}
1
+ {"version":3,"file":"ButtonBase.cjs","sourceRoot":"","sources":["../../../src/components/ButtonBase/ButtonBase.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kFAOiD;AACjD,8FAA4E;AAC5E,+CAAuC;AAGvC,0CAA6B;AAC7B,4CAA0C;AAC1C,kDAAqC;AACrC,gFAAmE;AACnE,gFAAmE;AAEnE,qEAKgC;AAGzB,MAAM,UAAU,GAAG,CAAC,EACzB,QAAQ,EACR,SAAS,EACT,IAAI,GAAG,qCAAc,CAAC,EAAE,EACxB,SAAS,EACT,WAAW,EACX,YAAY,EACZ,mBAAmB,EACnB,mBAAmB,EACnB,aAAa,EACb,cAAc,EACd,cAAc,EACd,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,UAAU,EACV,WAAW,EACX,WAAW,EACX,aAAa,EACb,aAAa,EACb,KAAK,EACL,kBAAkB,EAClB,iBAAiB,EACjB,iBAAiB,GAAG,QAAQ,EAC5B,oBAAoB,EACpB,qBAAqB,EACrB,GAAG,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A,uCAAgB,EAC3B,IAAA,uCAAgB,EACd,qCAAqC,EACrC,aAAa,CAAC,CAAC,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,SAAS,CACnD,EACD,SAAS,EAAE,WAAW,CACvB;iBACF,CAAC,CAEF;gBAAA,CAAC,QAAQ,CACX;cAAA,EAAE,+BAAc,CAChB;cAAA,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAClB,CAAC,WAAI,CACH,IAAI,CAAC,CAAC,gBAAgB,CAAC,CACvB,IAAI,CAAC,CAAC,QAAQ,CAAC,CACf,IAAI,YAAY,CAAC,CACjB,WAAW,CAAC,CAAC,IAAA,uCAAgB,EAC3B,IAAA,uCAAgB,EACd,UAAU,EACV,aAAa,CAAC,CAAC,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,SAAS,CACnD,EACD,YAAY,EAAE,WAAW,CAC1B,CAAC,EACF,CACH,CAAC,CAAC,CAAC,CACF,YAAY,CACb,CACH;YAAA,EAAE,SAAG,CACP;UAAA,GAAG,CACJ,CAAC;QACJ,CAAC,CACH;IAAA,EAAE,+BAAc,CAAC,CAClB,CAAC;AACJ,CAAC,CAAC;AAlPW,QAAA,UAAU,cAkPrB","sourcesContent":["import {\n BoxAlignItems,\n BoxFlexDirection,\n ButtonBaseSize,\n FontWeight,\n mergeTwClassName,\n TextColor,\n} from '@metamask-previews/design-system-shared';\nimport { useTailwind } from '@metamask-previews/design-system-twrnc-preset';\nimport React, { useMemo } from 'react';\nimport type { StyleProp, ViewStyle } from 'react-native';\n\nimport { Box } from '../Box';\nimport { Icon, IconColor } from '../Icon';\nimport { Spinner } from '../Spinner';\nimport { ButtonAnimated } from '../temp-components/ButtonAnimated';\nimport { TextOrChildren } from '../temp-components/TextOrChildren';\n\nimport {\n MAP_BUTTONBASE_SIZE_ICONSIZE,\n MAP_BUTTONBASE_SIZE_TEXT_VARIANT,\n getButtonBaseHorizontalPaddingTwClasses,\n TWCLASSMAP_BUTTONBASE_SIZE_DIMENSION,\n} from './ButtonBase.constants';\nimport type { ButtonBaseProps } from './ButtonBase.types';\n\nexport const ButtonBase = ({\n children,\n textProps,\n size = ButtonBaseSize.Lg,\n isLoading,\n loadingText,\n spinnerProps,\n loadingWrapperProps,\n contentWrapperProps,\n startIconName,\n startIconProps,\n startAccessory,\n endIconName,\n endIconProps,\n endAccessory,\n isDisabled,\n isFullWidth,\n twClassName,\n textClassName,\n iconClassName,\n style,\n accessibilityLabel,\n accessibilityHint,\n accessibilityRole = 'button',\n accessibilityActions,\n onAccessibilityAction,\n ...props\n}: ButtonBaseProps) => {\n const tw = useTailwind();\n\n const finalStartIconName = startIconName ?? startIconProps?.name;\n const finalEndIconName = endIconName ?? endIconProps?.name;\n\n const hasStart = Boolean(finalStartIconName || startAccessory);\n const hasEnd = Boolean(finalEndIconName || endAccessory);\n const hasAccessories = hasStart || hasEnd;\n\n const iconSize = MAP_BUTTONBASE_SIZE_ICONSIZE[size];\n const labelTextVariant = MAP_BUTTONBASE_SIZE_TEXT_VARIANT[size];\n\n // Generate accessibility label if not provided\n const finalAccessibilityLabel = useMemo(() => {\n if (accessibilityLabel) {\n return accessibilityLabel;\n }\n\n // For loading state with loadingText, prioritize loadingText\n if (isLoading && loadingText) {\n return loadingText;\n }\n\n // If children is a string, use it as the label\n if (typeof children === 'string') {\n return children;\n }\n\n return undefined;\n }, [accessibilityLabel, children, isLoading, loadingText]);\n\n // Generate accessibility hint for loading state if not provided\n const finalAccessibilityHint = useMemo(() => {\n if (accessibilityHint) {\n return accessibilityHint;\n }\n\n if (isLoading) {\n return 'Button is currently loading';\n }\n\n return undefined;\n }, [accessibilityHint, isLoading]);\n\n // Create accessibilityState object with only truthy values\n const accessibilityState = useMemo(() => {\n const state: { disabled?: boolean; busy?: boolean } = {};\n\n if (isDisabled || isLoading) {\n state.disabled = true;\n }\n\n if (isLoading) {\n state.busy = true;\n }\n\n return state;\n }, [isDisabled, isLoading]);\n\n return (\n <ButtonAnimated\n disabled={isDisabled || isLoading}\n accessibilityRole={accessibilityRole}\n accessibilityLabel={finalAccessibilityLabel}\n accessibilityHint={finalAccessibilityHint}\n accessibilityActions={accessibilityActions}\n onAccessibilityAction={onAccessibilityAction}\n accessibilityState={accessibilityState}\n accessible\n style={({ pressed }) => {\n // Evaluate custom className if it's a function\n const customClassName =\n typeof twClassName === 'function'\n ? twClassName(pressed)\n : twClassName;\n\n // Build button container styles\n const buttonStyles = tw.style(\n // Base layout - flex container for button content\n 'flex-row items-center justify-center rounded-full',\n // Visual styling\n 'bg-muted overflow-hidden',\n getButtonBaseHorizontalPaddingTwClasses(hasStart, hasEnd),\n // Size\n TWCLASSMAP_BUTTONBASE_SIZE_DIMENSION[size],\n // State-based opacity\n isDisabled ? 'opacity-50' : 'opacity-100',\n // Width - use self-start to prevent stretching when not full width\n isFullWidth ? 'w-full' : 'self-start',\n // Custom classes\n customClassName,\n );\n\n // Merge with additional styles if provided\n const computedStyle: StyleProp<ViewStyle>[] = [buttonStyles];\n\n const additionalStyle =\n typeof style === 'function' ? style({ pressed }) : style;\n\n if (additionalStyle) {\n computedStyle.push(additionalStyle);\n }\n\n return computedStyle;\n }}\n {...props}\n >\n {({ pressed }) => {\n const { twClassName: loadingWrapperTw, ...restLoadingWrapper } =\n loadingWrapperProps ?? {};\n const { twClassName: contentWrapperTw, ...restContentWrapper } =\n contentWrapperProps ?? {};\n\n return (\n <>\n {/* Loading spinner overlay */}\n {isLoading && (\n <Box\n {...restLoadingWrapper}\n twClassName={mergeTwClassName(\n 'absolute inset-0 flex items-center justify-center',\n loadingWrapperTw,\n )}\n >\n <Spinner\n color={\n textClassName\n ? (textClassName(pressed) as IconColor)\n : IconColor.IconDefault\n }\n loadingText={loadingText}\n {...spinnerProps}\n spinnerIconProps={{\n size: iconSize,\n ...spinnerProps?.spinnerIconProps,\n }}\n loadingTextProps={{\n numberOfLines: 1,\n variant: labelTextVariant,\n twClassName: textClassName ? textClassName(pressed) : '',\n ...spinnerProps?.loadingTextProps,\n }}\n />\n </Box>\n )}\n\n <Box\n flexDirection={BoxFlexDirection.Row}\n alignItems={BoxAlignItems.Center}\n gap={hasAccessories ? 1 : 0}\n {...restContentWrapper}\n twClassName={\n isLoading\n ? mergeTwClassName('opacity-0', contentWrapperTw)\n : contentWrapperTw\n }\n >\n {finalStartIconName ? (\n <Icon\n name={finalStartIconName}\n size={iconSize}\n {...startIconProps}\n twClassName={mergeTwClassName(\n mergeTwClassName(\n 'shrink-0',\n iconClassName ? iconClassName(pressed) : undefined,\n ),\n startIconProps?.twClassName,\n )}\n />\n ) : (\n startAccessory\n )}\n <TextOrChildren\n textProps={{\n variant: labelTextVariant,\n fontWeight: FontWeight.Medium,\n color: TextColor.TextDefault,\n numberOfLines: 1,\n ellipsizeMode: 'clip',\n ...textProps,\n twClassName: mergeTwClassName(\n mergeTwClassName(\n 'shrink grow-0 flex-wrap text-center',\n textClassName ? textClassName(pressed) : undefined,\n ),\n textProps?.twClassName,\n ),\n }}\n >\n {children}\n </TextOrChildren>\n {finalEndIconName ? (\n <Icon\n name={finalEndIconName}\n size={iconSize}\n {...endIconProps}\n twClassName={mergeTwClassName(\n mergeTwClassName(\n 'shrink-0',\n iconClassName ? iconClassName(pressed) : undefined,\n ),\n endIconProps?.twClassName,\n )}\n />\n ) : (\n endAccessory\n )}\n </Box>\n </>\n );\n }}\n </ButtonAnimated>\n );\n};\n"]}
@@ -3,8 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getButtonBaseHorizontalPaddingTwClasses = exports.MAP_BUTTONBASE_SIZE_TEXT_VARIANT = exports.MAP_BUTTONBASE_SIZE_ICONSIZE = exports.TWCLASSMAP_BUTTONBASE_SIZE_DIMENSION = void 0;
4
4
  const design_system_shared_1 = require("@metamask-previews/design-system-shared");
5
5
  exports.TWCLASSMAP_BUTTONBASE_SIZE_DIMENSION = {
6
- [design_system_shared_1.ButtonBaseSize.Sm]: 'h-8',
7
- [design_system_shared_1.ButtonBaseSize.Md]: 'h-10',
6
+ [design_system_shared_1.ButtonBaseSize.Sm]: 'h-8', // size (32px).
7
+ [design_system_shared_1.ButtonBaseSize.Md]: 'h-10', // size (40px).
8
8
  [design_system_shared_1.ButtonBaseSize.Lg]: 'h-12', // size (48px).
9
9
  };
10
10
  exports.MAP_BUTTONBASE_SIZE_ICONSIZE = {
@@ -1 +1 @@
1
- {"version":3,"file":"ButtonBase.constants.cjs","sourceRoot":"","sources":["../../../src/components/ButtonBase/ButtonBase.constants.ts"],"names":[],"mappings":";;;AAAA,kFAIiD;AAEpC,QAAA,oCAAoC,GAG7C;IACF,CAAC,qCAAc,CAAC,EAAE,CAAC,EAAE,KAAK;IAC1B,CAAC,qCAAc,CAAC,EAAE,CAAC,EAAE,MAAM;IAC3B,CAAC,qCAAc,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,eAAe;CAC7C,CAAC;AAEW,QAAA,4BAA4B,GAAqC;IAC5E,CAAC,qCAAc,CAAC,EAAE,CAAC,EAAE,+BAAQ,CAAC,EAAE;IAChC,CAAC,qCAAc,CAAC,EAAE,CAAC,EAAE,+BAAQ,CAAC,EAAE;IAChC,CAAC,qCAAc,CAAC,EAAE,CAAC,EAAE,+BAAQ,CAAC,EAAE;CACjC,CAAC;AAEW,QAAA,gCAAgC,GAGzC;IACF,CAAC,qCAAc,CAAC,EAAE,CAAC,EAAE,kCAAW,CAAC,MAAM;IACvC,CAAC,qCAAc,CAAC,EAAE,CAAC,EAAE,kCAAW,CAAC,MAAM;IACvC,CAAC,qCAAc,CAAC,EAAE,CAAC,EAAE,kCAAW,CAAC,MAAM;CACxC,CAAC;AAEK,MAAM,uCAAuC,GAAG,CACrD,QAAiB,EACjB,MAAe,EACP,EAAE;IACV,6EAA6E;IAC7E,6BAA6B;IAC7B,IAAI,QAAQ,IAAI,MAAM,EAAE;QACtB,OAAO,MAAM,CAAC;KACf;IACD,IAAI,QAAQ,EAAE;QACZ,OAAO,WAAW,CAAC;KACpB;IACD,IAAI,MAAM,EAAE;QACV,OAAO,WAAW,CAAC;KACpB;IACD,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC;AAhBW,QAAA,uCAAuC,2CAgBlD","sourcesContent":["import {\n ButtonBaseSize,\n IconSize,\n TextVariant,\n} from '@metamask-previews/design-system-shared';\n\nexport const TWCLASSMAP_BUTTONBASE_SIZE_DIMENSION: Record<\n ButtonBaseSize,\n string\n> = {\n [ButtonBaseSize.Sm]: 'h-8', // size (32px).\n [ButtonBaseSize.Md]: 'h-10', // size (40px).\n [ButtonBaseSize.Lg]: 'h-12', // size (48px).\n};\n\nexport const MAP_BUTTONBASE_SIZE_ICONSIZE: Record<ButtonBaseSize, IconSize> = {\n [ButtonBaseSize.Sm]: IconSize.Sm,\n [ButtonBaseSize.Md]: IconSize.Sm,\n [ButtonBaseSize.Lg]: IconSize.Md,\n};\n\nexport const MAP_BUTTONBASE_SIZE_TEXT_VARIANT: Record<\n ButtonBaseSize,\n TextVariant\n> = {\n [ButtonBaseSize.Sm]: TextVariant.BodySm,\n [ButtonBaseSize.Md]: TextVariant.BodyMd,\n [ButtonBaseSize.Lg]: TextVariant.BodyMd,\n};\n\nexport const getButtonBaseHorizontalPaddingTwClasses = (\n hasStart: boolean,\n hasEnd: boolean,\n): string => {\n // Icons sit closer to the edge than a label, so each accessory pulls its own\n // side in from 16px to 12px.\n if (hasStart && hasEnd) {\n return 'px-3';\n }\n if (hasStart) {\n return 'pl-3 pr-4';\n }\n if (hasEnd) {\n return 'pl-4 pr-3';\n }\n return 'px-4';\n};\n"]}
1
+ {"version":3,"file":"ButtonBase.constants.cjs","sourceRoot":"","sources":["../../../src/components/ButtonBase/ButtonBase.constants.ts"],"names":[],"mappings":";;;AAAA,kFAIiD;AAEpC,QAAA,oCAAoC,GAG7C;IACF,CAAC,qCAAc,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,eAAe;IAC3C,CAAC,qCAAc,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,eAAe;IAC5C,CAAC,qCAAc,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,eAAe;CAC7C,CAAC;AAEW,QAAA,4BAA4B,GAAqC;IAC5E,CAAC,qCAAc,CAAC,EAAE,CAAC,EAAE,+BAAQ,CAAC,EAAE;IAChC,CAAC,qCAAc,CAAC,EAAE,CAAC,EAAE,+BAAQ,CAAC,EAAE;IAChC,CAAC,qCAAc,CAAC,EAAE,CAAC,EAAE,+BAAQ,CAAC,EAAE;CACjC,CAAC;AAEW,QAAA,gCAAgC,GAGzC;IACF,CAAC,qCAAc,CAAC,EAAE,CAAC,EAAE,kCAAW,CAAC,MAAM;IACvC,CAAC,qCAAc,CAAC,EAAE,CAAC,EAAE,kCAAW,CAAC,MAAM;IACvC,CAAC,qCAAc,CAAC,EAAE,CAAC,EAAE,kCAAW,CAAC,MAAM;CACxC,CAAC;AAEK,MAAM,uCAAuC,GAAG,CACrD,QAAiB,EACjB,MAAe,EACP,EAAE;IACV,6EAA6E;IAC7E,6BAA6B;IAC7B,IAAI,QAAQ,IAAI,MAAM,EAAE,CAAC;QACvB,OAAO,MAAM,CAAC;IAChB,CAAC;IACD,IAAI,QAAQ,EAAE,CAAC;QACb,OAAO,WAAW,CAAC;IACrB,CAAC;IACD,IAAI,MAAM,EAAE,CAAC;QACX,OAAO,WAAW,CAAC;IACrB,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC;AAhBW,QAAA,uCAAuC,2CAgBlD","sourcesContent":["import {\n ButtonBaseSize,\n IconSize,\n TextVariant,\n} from '@metamask-previews/design-system-shared';\n\nexport const TWCLASSMAP_BUTTONBASE_SIZE_DIMENSION: Record<\n ButtonBaseSize,\n string\n> = {\n [ButtonBaseSize.Sm]: 'h-8', // size (32px).\n [ButtonBaseSize.Md]: 'h-10', // size (40px).\n [ButtonBaseSize.Lg]: 'h-12', // size (48px).\n};\n\nexport const MAP_BUTTONBASE_SIZE_ICONSIZE: Record<ButtonBaseSize, IconSize> = {\n [ButtonBaseSize.Sm]: IconSize.Sm,\n [ButtonBaseSize.Md]: IconSize.Sm,\n [ButtonBaseSize.Lg]: IconSize.Md,\n};\n\nexport const MAP_BUTTONBASE_SIZE_TEXT_VARIANT: Record<\n ButtonBaseSize,\n TextVariant\n> = {\n [ButtonBaseSize.Sm]: TextVariant.BodySm,\n [ButtonBaseSize.Md]: TextVariant.BodyMd,\n [ButtonBaseSize.Lg]: TextVariant.BodyMd,\n};\n\nexport const getButtonBaseHorizontalPaddingTwClasses = (\n hasStart: boolean,\n hasEnd: boolean,\n): string => {\n // Icons sit closer to the edge than a label, so each accessory pulls its own\n // side in from 16px to 12px.\n if (hasStart && hasEnd) {\n return 'px-3';\n }\n if (hasStart) {\n return 'pl-3 pr-4';\n }\n if (hasEnd) {\n return 'pl-4 pr-3';\n }\n return 'px-4';\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"ButtonBase.constants.d.cts","sourceRoot":"","sources":["../../../src/components/ButtonBase/ButtonBase.constants.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,QAAQ,EACR,WAAW,EACZ,gDAAgD;AAEjD,eAAO,MAAM,oCAAoC,EAAE,MAAM,CACvD,cAAc,EACd,MAAM,CAKP,CAAC;AAEF,eAAO,MAAM,4BAA4B,EAAE,MAAM,CAAC,cAAc,EAAE,QAAQ,CAIzE,CAAC;AAEF,eAAO,MAAM,gCAAgC,EAAE,MAAM,CACnD,cAAc,EACd,WAAW,CAKZ,CAAC;AAEF,eAAO,MAAM,uCAAuC,aACxC,OAAO,UACT,OAAO,KACd,MAaF,CAAC"}
1
+ {"version":3,"file":"ButtonBase.constants.d.cts","sourceRoot":"","sources":["../../../src/components/ButtonBase/ButtonBase.constants.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,QAAQ,EACR,WAAW,EACZ,gDAAgD;AAEjD,eAAO,MAAM,oCAAoC,EAAE,MAAM,CACvD,cAAc,EACd,MAAM,CAKP,CAAC;AAEF,eAAO,MAAM,4BAA4B,EAAE,MAAM,CAAC,cAAc,EAAE,QAAQ,CAIzE,CAAC;AAEF,eAAO,MAAM,gCAAgC,EAAE,MAAM,CACnD,cAAc,EACd,WAAW,CAKZ,CAAC;AAEF,eAAO,MAAM,uCAAuC,GAClD,UAAU,OAAO,EACjB,QAAQ,OAAO,KACd,MAaF,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"ButtonBase.constants.d.mts","sourceRoot":"","sources":["../../../src/components/ButtonBase/ButtonBase.constants.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,QAAQ,EACR,WAAW,EACZ,gDAAgD;AAEjD,eAAO,MAAM,oCAAoC,EAAE,MAAM,CACvD,cAAc,EACd,MAAM,CAKP,CAAC;AAEF,eAAO,MAAM,4BAA4B,EAAE,MAAM,CAAC,cAAc,EAAE,QAAQ,CAIzE,CAAC;AAEF,eAAO,MAAM,gCAAgC,EAAE,MAAM,CACnD,cAAc,EACd,WAAW,CAKZ,CAAC;AAEF,eAAO,MAAM,uCAAuC,aACxC,OAAO,UACT,OAAO,KACd,MAaF,CAAC"}
1
+ {"version":3,"file":"ButtonBase.constants.d.mts","sourceRoot":"","sources":["../../../src/components/ButtonBase/ButtonBase.constants.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,QAAQ,EACR,WAAW,EACZ,gDAAgD;AAEjD,eAAO,MAAM,oCAAoC,EAAE,MAAM,CACvD,cAAc,EACd,MAAM,CAKP,CAAC;AAEF,eAAO,MAAM,4BAA4B,EAAE,MAAM,CAAC,cAAc,EAAE,QAAQ,CAIzE,CAAC;AAEF,eAAO,MAAM,gCAAgC,EAAE,MAAM,CACnD,cAAc,EACd,WAAW,CAKZ,CAAC;AAEF,eAAO,MAAM,uCAAuC,GAClD,UAAU,OAAO,EACjB,QAAQ,OAAO,KACd,MAaF,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import { ButtonBaseSize, IconSize, TextVariant } from "@metamask-previews/design-system-shared";
2
2
  export const TWCLASSMAP_BUTTONBASE_SIZE_DIMENSION = {
3
- [ButtonBaseSize.Sm]: 'h-8',
4
- [ButtonBaseSize.Md]: 'h-10',
3
+ [ButtonBaseSize.Sm]: 'h-8', // size (32px).
4
+ [ButtonBaseSize.Md]: 'h-10', // size (40px).
5
5
  [ButtonBaseSize.Lg]: 'h-12', // size (48px).
6
6
  };
7
7
  export const MAP_BUTTONBASE_SIZE_ICONSIZE = {
@@ -1 +1 @@
1
- {"version":3,"file":"ButtonBase.constants.mjs","sourceRoot":"","sources":["../../../src/components/ButtonBase/ButtonBase.constants.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,QAAQ,EACR,WAAW,EACZ,gDAAgD;AAEjD,MAAM,CAAC,MAAM,oCAAoC,GAG7C;IACF,CAAC,cAAc,CAAC,EAAE,CAAC,EAAE,KAAK;IAC1B,CAAC,cAAc,CAAC,EAAE,CAAC,EAAE,MAAM;IAC3B,CAAC,cAAc,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,eAAe;CAC7C,CAAC;AAEF,MAAM,CAAC,MAAM,4BAA4B,GAAqC;IAC5E,CAAC,cAAc,CAAC,EAAE,CAAC,EAAE,QAAQ,CAAC,EAAE;IAChC,CAAC,cAAc,CAAC,EAAE,CAAC,EAAE,QAAQ,CAAC,EAAE;IAChC,CAAC,cAAc,CAAC,EAAE,CAAC,EAAE,QAAQ,CAAC,EAAE;CACjC,CAAC;AAEF,MAAM,CAAC,MAAM,gCAAgC,GAGzC;IACF,CAAC,cAAc,CAAC,EAAE,CAAC,EAAE,WAAW,CAAC,MAAM;IACvC,CAAC,cAAc,CAAC,EAAE,CAAC,EAAE,WAAW,CAAC,MAAM;IACvC,CAAC,cAAc,CAAC,EAAE,CAAC,EAAE,WAAW,CAAC,MAAM;CACxC,CAAC;AAEF,MAAM,CAAC,MAAM,uCAAuC,GAAG,CACrD,QAAiB,EACjB,MAAe,EACP,EAAE;IACV,6EAA6E;IAC7E,6BAA6B;IAC7B,IAAI,QAAQ,IAAI,MAAM,EAAE;QACtB,OAAO,MAAM,CAAC;KACf;IACD,IAAI,QAAQ,EAAE;QACZ,OAAO,WAAW,CAAC;KACpB;IACD,IAAI,MAAM,EAAE;QACV,OAAO,WAAW,CAAC;KACpB;IACD,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC","sourcesContent":["import {\n ButtonBaseSize,\n IconSize,\n TextVariant,\n} from '@metamask-previews/design-system-shared';\n\nexport const TWCLASSMAP_BUTTONBASE_SIZE_DIMENSION: Record<\n ButtonBaseSize,\n string\n> = {\n [ButtonBaseSize.Sm]: 'h-8', // size (32px).\n [ButtonBaseSize.Md]: 'h-10', // size (40px).\n [ButtonBaseSize.Lg]: 'h-12', // size (48px).\n};\n\nexport const MAP_BUTTONBASE_SIZE_ICONSIZE: Record<ButtonBaseSize, IconSize> = {\n [ButtonBaseSize.Sm]: IconSize.Sm,\n [ButtonBaseSize.Md]: IconSize.Sm,\n [ButtonBaseSize.Lg]: IconSize.Md,\n};\n\nexport const MAP_BUTTONBASE_SIZE_TEXT_VARIANT: Record<\n ButtonBaseSize,\n TextVariant\n> = {\n [ButtonBaseSize.Sm]: TextVariant.BodySm,\n [ButtonBaseSize.Md]: TextVariant.BodyMd,\n [ButtonBaseSize.Lg]: TextVariant.BodyMd,\n};\n\nexport const getButtonBaseHorizontalPaddingTwClasses = (\n hasStart: boolean,\n hasEnd: boolean,\n): string => {\n // Icons sit closer to the edge than a label, so each accessory pulls its own\n // side in from 16px to 12px.\n if (hasStart && hasEnd) {\n return 'px-3';\n }\n if (hasStart) {\n return 'pl-3 pr-4';\n }\n if (hasEnd) {\n return 'pl-4 pr-3';\n }\n return 'px-4';\n};\n"]}
1
+ {"version":3,"file":"ButtonBase.constants.mjs","sourceRoot":"","sources":["../../../src/components/ButtonBase/ButtonBase.constants.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,QAAQ,EACR,WAAW,EACZ,gDAAgD;AAEjD,MAAM,CAAC,MAAM,oCAAoC,GAG7C;IACF,CAAC,cAAc,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,eAAe;IAC3C,CAAC,cAAc,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,eAAe;IAC5C,CAAC,cAAc,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,eAAe;CAC7C,CAAC;AAEF,MAAM,CAAC,MAAM,4BAA4B,GAAqC;IAC5E,CAAC,cAAc,CAAC,EAAE,CAAC,EAAE,QAAQ,CAAC,EAAE;IAChC,CAAC,cAAc,CAAC,EAAE,CAAC,EAAE,QAAQ,CAAC,EAAE;IAChC,CAAC,cAAc,CAAC,EAAE,CAAC,EAAE,QAAQ,CAAC,EAAE;CACjC,CAAC;AAEF,MAAM,CAAC,MAAM,gCAAgC,GAGzC;IACF,CAAC,cAAc,CAAC,EAAE,CAAC,EAAE,WAAW,CAAC,MAAM;IACvC,CAAC,cAAc,CAAC,EAAE,CAAC,EAAE,WAAW,CAAC,MAAM;IACvC,CAAC,cAAc,CAAC,EAAE,CAAC,EAAE,WAAW,CAAC,MAAM;CACxC,CAAC;AAEF,MAAM,CAAC,MAAM,uCAAuC,GAAG,CACrD,QAAiB,EACjB,MAAe,EACP,EAAE;IACV,6EAA6E;IAC7E,6BAA6B;IAC7B,IAAI,QAAQ,IAAI,MAAM,EAAE,CAAC;QACvB,OAAO,MAAM,CAAC;IAChB,CAAC;IACD,IAAI,QAAQ,EAAE,CAAC;QACb,OAAO,WAAW,CAAC;IACrB,CAAC;IACD,IAAI,MAAM,EAAE,CAAC;QACX,OAAO,WAAW,CAAC;IACrB,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC","sourcesContent":["import {\n ButtonBaseSize,\n IconSize,\n TextVariant,\n} from '@metamask-previews/design-system-shared';\n\nexport const TWCLASSMAP_BUTTONBASE_SIZE_DIMENSION: Record<\n ButtonBaseSize,\n string\n> = {\n [ButtonBaseSize.Sm]: 'h-8', // size (32px).\n [ButtonBaseSize.Md]: 'h-10', // size (40px).\n [ButtonBaseSize.Lg]: 'h-12', // size (48px).\n};\n\nexport const MAP_BUTTONBASE_SIZE_ICONSIZE: Record<ButtonBaseSize, IconSize> = {\n [ButtonBaseSize.Sm]: IconSize.Sm,\n [ButtonBaseSize.Md]: IconSize.Sm,\n [ButtonBaseSize.Lg]: IconSize.Md,\n};\n\nexport const MAP_BUTTONBASE_SIZE_TEXT_VARIANT: Record<\n ButtonBaseSize,\n TextVariant\n> = {\n [ButtonBaseSize.Sm]: TextVariant.BodySm,\n [ButtonBaseSize.Md]: TextVariant.BodyMd,\n [ButtonBaseSize.Lg]: TextVariant.BodyMd,\n};\n\nexport const getButtonBaseHorizontalPaddingTwClasses = (\n hasStart: boolean,\n hasEnd: boolean,\n): string => {\n // Icons sit closer to the edge than a label, so each accessory pulls its own\n // side in from 16px to 12px.\n if (hasStart && hasEnd) {\n return 'px-3';\n }\n if (hasStart) {\n return 'pl-3 pr-4';\n }\n if (hasEnd) {\n return 'pl-4 pr-3';\n }\n return 'px-4';\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"ButtonBase.d.cts","sourceRoot":"","sources":["../../../src/components/ButtonBase/ButtonBase.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAkB,cAAc;AAevC,OAAO,KAAK,EAAE,eAAe,EAAE,+BAA2B;AAE1D,eAAO,MAAM,UAAU,sYA2BpB,eAAe,sBAsNjB,CAAC"}
1
+ {"version":3,"file":"ButtonBase.d.cts","sourceRoot":"","sources":["../../../src/components/ButtonBase/ButtonBase.tsx"],"names":[],"mappings":"AASA,OAAO,KAAkB,cAAc;AAevC,OAAO,KAAK,EAAE,eAAe,EAAE,+BAA2B;AAE1D,eAAO,MAAM,UAAU,GAAI,mYA2BxB,eAAe,sBAuNjB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"ButtonBase.d.mts","sourceRoot":"","sources":["../../../src/components/ButtonBase/ButtonBase.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAkB,cAAc;AAevC,OAAO,KAAK,EAAE,eAAe,EAAE,+BAA2B;AAE1D,eAAO,MAAM,UAAU,sYA2BpB,eAAe,sBAsNjB,CAAC"}
1
+ {"version":3,"file":"ButtonBase.d.mts","sourceRoot":"","sources":["../../../src/components/ButtonBase/ButtonBase.tsx"],"names":[],"mappings":"AASA,OAAO,KAAkB,cAAc;AAevC,OAAO,KAAK,EAAE,eAAe,EAAE,+BAA2B;AAE1D,eAAO,MAAM,UAAU,GAAI,mYA2BxB,eAAe,sBAuNjB,CAAC"}
@@ -4,15 +4,15 @@ function $importDefault(module) {
4
4
  }
5
5
  return module;
6
6
  }
7
- import { ButtonBaseSize, FontWeight, mergeTwClassName, TextColor } from "@metamask-previews/design-system-shared";
7
+ import { BoxAlignItems, BoxFlexDirection, ButtonBaseSize, FontWeight, mergeTwClassName, TextColor } from "@metamask-previews/design-system-shared";
8
8
  import { useTailwind } from "@metamask-previews/design-system-twrnc-preset";
9
9
  import $React, { useMemo } from "react";
10
10
  const React = $importDefault($React);
11
11
  import { Box } from "../Box/index.mjs";
12
- import { BoxRow } from "../BoxRow/index.mjs";
13
12
  import { Icon, IconColor } from "../Icon/index.mjs";
13
+ import { Spinner } from "../Spinner/index.mjs";
14
14
  import { ButtonAnimated } from "../temp-components/ButtonAnimated/index.mjs";
15
- import { Spinner } from "../temp-components/Spinner/index.mjs";
15
+ import { TextOrChildren } from "../temp-components/TextOrChildren/index.mjs";
16
16
  import { MAP_BUTTONBASE_SIZE_ICONSIZE, MAP_BUTTONBASE_SIZE_TEXT_VARIANT, getButtonBaseHorizontalPaddingTwClasses, TWCLASSMAP_BUTTONBASE_SIZE_DIMENSION } from "./ButtonBase.constants.mjs";
17
17
  export const ButtonBase = ({ children, textProps, size = ButtonBaseSize.Lg, isLoading, loadingText, spinnerProps, loadingWrapperProps, contentWrapperProps, startIconName, startIconProps, startAccessory, endIconName, endIconProps, endAccessory, isDisabled, isFullWidth, twClassName, textClassName, iconClassName, style, accessibilityLabel, accessibilityHint, accessibilityRole = 'button', accessibilityActions, onAccessibilityAction, ...props }) => {
18
18
  const tw = useTailwind();
@@ -105,9 +105,11 @@ export const ButtonBase = ({ children, textProps, size = ButtonBaseSize.Lg, isLo
105
105
  }}/>
106
106
  </Box>)}
107
107
 
108
- <BoxRow {...restContentWrapper} twClassName={isLoading
108
+ <Box flexDirection={BoxFlexDirection.Row} alignItems={BoxAlignItems.Center} gap={hasAccessories ? 1 : 0} {...restContentWrapper} twClassName={isLoading
109
109
  ? mergeTwClassName('opacity-0', contentWrapperTw)
110
- : contentWrapperTw} gap={hasAccessories ? 1 : 0} startAccessory={finalStartIconName ? (<Icon name={finalStartIconName} size={iconSize} {...startIconProps} twClassName={mergeTwClassName(mergeTwClassName('shrink-0', iconClassName ? iconClassName(pressed) : undefined), startIconProps?.twClassName)}/>) : (startAccessory)} endAccessory={finalEndIconName ? (<Icon name={finalEndIconName} size={iconSize} {...endIconProps} twClassName={mergeTwClassName(mergeTwClassName('shrink-0', iconClassName ? iconClassName(pressed) : undefined), endIconProps?.twClassName)}/>) : (endAccessory)} textProps={{
110
+ : contentWrapperTw}>
111
+ {finalStartIconName ? (<Icon name={finalStartIconName} size={iconSize} {...startIconProps} twClassName={mergeTwClassName(mergeTwClassName('shrink-0', iconClassName ? iconClassName(pressed) : undefined), startIconProps?.twClassName)}/>) : (startAccessory)}
112
+ <TextOrChildren textProps={{
111
113
  variant: labelTextVariant,
112
114
  fontWeight: FontWeight.Medium,
113
115
  color: TextColor.TextDefault,
@@ -116,8 +118,10 @@ export const ButtonBase = ({ children, textProps, size = ButtonBaseSize.Lg, isLo
116
118
  ...textProps,
117
119
  twClassName: mergeTwClassName(mergeTwClassName('shrink grow-0 flex-wrap text-center', textClassName ? textClassName(pressed) : undefined), textProps?.twClassName),
118
120
  }}>
119
- {children}
120
- </BoxRow>
121
+ {children}
122
+ </TextOrChildren>
123
+ {finalEndIconName ? (<Icon name={finalEndIconName} size={iconSize} {...endIconProps} twClassName={mergeTwClassName(mergeTwClassName('shrink-0', iconClassName ? iconClassName(pressed) : undefined), endIconProps?.twClassName)}/>) : (endAccessory)}
124
+ </Box>
121
125
  </>);
122
126
  }}
123
127
  </ButtonAnimated>);
@@ -1 +1 @@
1
- {"version":3,"file":"ButtonBase.mjs","sourceRoot":"","sources":["../../../src/components/ButtonBase/ButtonBase.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,EACL,cAAc,EACd,UAAU,EACV,gBAAgB,EAChB,SAAS,EACV,gDAAgD;AACjD,OAAO,EAAE,WAAW,EAAE,sDAAsD;AAC5E,OAAO,QAAO,EAAE,OAAO,EAAE,cAAc;;AAGvC,OAAO,EAAE,GAAG,EAAE,yBAAe;AAC7B,OAAO,EAAE,MAAM,EAAE,4BAAkB;AACnC,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,0BAAgB;AAC1C,OAAO,EAAE,cAAc,EAAE,oDAA0C;AACnE,OAAO,EAAE,OAAO,EAAE,6CAAmC;AAErD,OAAO,EACL,4BAA4B,EAC5B,gCAAgC,EAChC,uCAAuC,EACvC,oCAAoC,EACrC,mCAA+B;AAGhC,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,EACzB,QAAQ,EACR,SAAS,EACT,IAAI,GAAG,cAAc,CAAC,EAAE,EACxB,SAAS,EACT,WAAW,EACX,YAAY,EACZ,mBAAmB,EACnB,mBAAmB,EACnB,aAAa,EACb,cAAc,EACd,cAAc,EACd,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,UAAU,EACV,WAAW,EACX,WAAW,EACX,aAAa,EACb,aAAa,EACb,KAAK,EACL,kBAAkB,EAClB,iBAAiB,EACjB,iBAAiB,GAAG,QAAQ,EAC5B,oBAAoB,EACpB,qBAAqB,EACrB,GAAG,KAAK,EACQ,EAAE,EAAE;IACpB,MAAM,EAAE,GAAG,WAAW,EAAE,CAAC;IAEzB,MAAM,kBAAkB,GAAG,aAAa,IAAI,cAAc,EAAE,IAAI,CAAC;IACjE,MAAM,gBAAgB,GAAG,WAAW,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AAa,CAAC,CAAC,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,SAAS,CACnD,EACD,SAAS,EAAE,WAAW,CACvB;iBACF,CAAC,CAEF;cAAA,CAAC,QAAQ,CACX;YAAA,EAAE,MAAM,CACV;UAAA,GAAG,CACJ,CAAC;QACJ,CAAC,CACH;IAAA,EAAE,cAAc,CAAC,CAClB,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import {\n ButtonBaseSize,\n FontWeight,\n mergeTwClassName,\n TextColor,\n} from '@metamask-previews/design-system-shared';\nimport { useTailwind } from '@metamask-previews/design-system-twrnc-preset';\nimport React, { useMemo } from 'react';\nimport type { StyleProp, ViewStyle } from 'react-native';\n\nimport { Box } from '../Box';\nimport { BoxRow } from '../BoxRow';\nimport { Icon, IconColor } from '../Icon';\nimport { ButtonAnimated } from '../temp-components/ButtonAnimated';\nimport { Spinner } from '../temp-components/Spinner';\n\nimport {\n MAP_BUTTONBASE_SIZE_ICONSIZE,\n MAP_BUTTONBASE_SIZE_TEXT_VARIANT,\n getButtonBaseHorizontalPaddingTwClasses,\n TWCLASSMAP_BUTTONBASE_SIZE_DIMENSION,\n} from './ButtonBase.constants';\nimport type { ButtonBaseProps } from './ButtonBase.types';\n\nexport const ButtonBase = ({\n children,\n textProps,\n size = ButtonBaseSize.Lg,\n isLoading,\n loadingText,\n spinnerProps,\n loadingWrapperProps,\n contentWrapperProps,\n startIconName,\n startIconProps,\n startAccessory,\n endIconName,\n endIconProps,\n endAccessory,\n isDisabled,\n isFullWidth,\n twClassName,\n textClassName,\n iconClassName,\n style,\n accessibilityLabel,\n accessibilityHint,\n accessibilityRole = 'button',\n accessibilityActions,\n onAccessibilityAction,\n ...props\n}: ButtonBaseProps) => {\n const tw = useTailwind();\n\n const finalStartIconName = startIconName ?? startIconProps?.name;\n const finalEndIconName = endIconName ?? endIconProps?.name;\n\n const hasStart = Boolean(finalStartIconName || startAccessory);\n const hasEnd = Boolean(finalEndIconName || endAccessory);\n const hasAccessories = hasStart || hasEnd;\n\n const iconSize = MAP_BUTTONBASE_SIZE_ICONSIZE[size];\n const labelTextVariant = MAP_BUTTONBASE_SIZE_TEXT_VARIANT[size];\n\n // Generate accessibility label if not provided\n const finalAccessibilityLabel = useMemo(() => {\n if (accessibilityLabel) {\n return accessibilityLabel;\n }\n\n // For loading state with loadingText, prioritize loadingText\n if (isLoading && loadingText) {\n return loadingText;\n }\n\n // If children is a string, use it as the label\n if (typeof children === 'string') {\n return children;\n }\n\n return undefined;\n }, [accessibilityLabel, children, isLoading, loadingText]);\n\n // Generate accessibility hint for loading state if not provided\n const finalAccessibilityHint = useMemo(() => {\n if (accessibilityHint) {\n return accessibilityHint;\n }\n\n if (isLoading) {\n return 'Button is currently loading';\n }\n\n return undefined;\n }, [accessibilityHint, isLoading]);\n\n // Create accessibilityState object with only truthy values\n const accessibilityState = useMemo(() => {\n const state: { disabled?: boolean; busy?: boolean } = {};\n\n if (isDisabled || isLoading) {\n state.disabled = true;\n }\n\n if (isLoading) {\n state.busy = true;\n }\n\n return state;\n }, [isDisabled, isLoading]);\n\n return (\n <ButtonAnimated\n disabled={isDisabled || isLoading}\n accessibilityRole={accessibilityRole}\n accessibilityLabel={finalAccessibilityLabel}\n accessibilityHint={finalAccessibilityHint}\n accessibilityActions={accessibilityActions}\n onAccessibilityAction={onAccessibilityAction}\n accessibilityState={accessibilityState}\n accessible\n style={({ pressed }) => {\n // Evaluate custom className if it's a function\n const customClassName =\n typeof twClassName === 'function'\n ? twClassName(pressed)\n : twClassName;\n\n // Build button container styles\n const buttonStyles = tw.style(\n // Base layout - flex container for button content\n 'flex-row items-center justify-center rounded-full',\n // Visual styling\n 'bg-muted overflow-hidden',\n getButtonBaseHorizontalPaddingTwClasses(hasStart, hasEnd),\n // Size\n TWCLASSMAP_BUTTONBASE_SIZE_DIMENSION[size],\n // State-based opacity\n isDisabled ? 'opacity-50' : 'opacity-100',\n // Width - use self-start to prevent stretching when not full width\n isFullWidth ? 'w-full' : 'self-start',\n // Custom classes\n customClassName,\n );\n\n // Merge with additional styles if provided\n const computedStyle: StyleProp<ViewStyle>[] = [buttonStyles];\n\n const additionalStyle =\n typeof style === 'function' ? style({ pressed }) : style;\n\n if (additionalStyle) {\n computedStyle.push(additionalStyle);\n }\n\n return computedStyle;\n }}\n {...props}\n >\n {({ pressed }) => {\n const { twClassName: loadingWrapperTw, ...restLoadingWrapper } =\n loadingWrapperProps ?? {};\n const { twClassName: contentWrapperTw, ...restContentWrapper } =\n contentWrapperProps ?? {};\n\n return (\n <>\n {/* Loading spinner overlay */}\n {isLoading && (\n <Box\n {...restLoadingWrapper}\n twClassName={mergeTwClassName(\n 'absolute inset-0 flex items-center justify-center',\n loadingWrapperTw,\n )}\n >\n <Spinner\n color={\n textClassName\n ? (textClassName(pressed) as IconColor)\n : IconColor.IconDefault\n }\n loadingText={loadingText}\n {...spinnerProps}\n spinnerIconProps={{\n size: iconSize,\n ...spinnerProps?.spinnerIconProps,\n }}\n loadingTextProps={{\n numberOfLines: 1,\n variant: labelTextVariant,\n twClassName: textClassName ? textClassName(pressed) : '',\n ...spinnerProps?.loadingTextProps,\n }}\n />\n </Box>\n )}\n\n <BoxRow\n {...restContentWrapper}\n twClassName={\n isLoading\n ? mergeTwClassName('opacity-0', contentWrapperTw)\n : contentWrapperTw\n }\n gap={hasAccessories ? 1 : 0}\n startAccessory={\n finalStartIconName ? (\n <Icon\n name={finalStartIconName}\n size={iconSize}\n {...startIconProps}\n twClassName={mergeTwClassName(\n mergeTwClassName(\n 'shrink-0',\n iconClassName ? iconClassName(pressed) : undefined,\n ),\n startIconProps?.twClassName,\n )}\n />\n ) : (\n startAccessory\n )\n }\n endAccessory={\n finalEndIconName ? (\n <Icon\n name={finalEndIconName}\n size={iconSize}\n {...endIconProps}\n twClassName={mergeTwClassName(\n mergeTwClassName(\n 'shrink-0',\n iconClassName ? iconClassName(pressed) : undefined,\n ),\n endIconProps?.twClassName,\n )}\n />\n ) : (\n endAccessory\n )\n }\n textProps={{\n variant: labelTextVariant,\n fontWeight: FontWeight.Medium,\n color: TextColor.TextDefault,\n numberOfLines: 1,\n ellipsizeMode: 'clip',\n ...textProps,\n twClassName: mergeTwClassName(\n mergeTwClassName(\n 'shrink grow-0 flex-wrap text-center',\n textClassName ? textClassName(pressed) : undefined,\n ),\n textProps?.twClassName,\n ),\n }}\n >\n {children}\n </BoxRow>\n </>\n );\n }}\n </ButtonAnimated>\n );\n};\n"]}
1
+ {"version":3,"file":"ButtonBase.mjs","sourceRoot":"","sources":["../../../src/components/ButtonBase/ButtonBase.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,EACL,aAAa,EACb,gBAAgB,EAChB,cAAc,EACd,UAAU,EACV,gBAAgB,EAChB,SAAS,EACV,gDAAgD;AACjD,OAAO,EAAE,WAAW,EAAE,sDAAsD;AAC5E,OAAO,QAAO,EAAE,OAAO,EAAE,cAAc;;AAGvC,OAAO,EAAE,GAAG,EAAE,yBAAe;AAC7B,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,0BAAgB;AAC1C,OAAO,EAAE,OAAO,EAAE,6BAAmB;AACrC,OAAO,EAAE,cAAc,EAAE,oDAA0C;AACnE,OAAO,EAAE,cAAc,EAAE,oDAA0C;AAEnE,OAAO,EACL,4BAA4B,EAC5B,gCAAgC,EAChC,uCAAuC,EACvC,oCAAoC,EACrC,mCAA+B;AAGhC,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,EACzB,QAAQ,EACR,SAAS,EACT,IAAI,GAAG,cAAc,CAAC,EAAE,EACxB,SAAS,EACT,WAAW,EACX,YAAY,EACZ,mBAAmB,EACnB,mBAAmB,EACnB,aAAa,EACb,cAAc,EACd,cAAc,EACd,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,UAAU,EACV,WAAW,EACX,WAAW,EACX,aAAa,EACb,aAAa,EACb,KAAK,EACL,kBAAkB,EAClB,iBAAiB,EACjB,iBAAiB,GAAG,QAAQ,EAC5B,oBAAoB,EACpB,qBA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AAC,CAAC,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,SAAS,CACnD,EACD,SAAS,EAAE,WAAW,CACvB;iBACF,CAAC,CAEF;gBAAA,CAAC,QAAQ,CACX;cAAA,EAAE,cAAc,CAChB;cAAA,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAClB,CAAC,IAAI,CACH,IAAI,CAAC,CAAC,gBAAgB,CAAC,CACvB,IAAI,CAAC,CAAC,QAAQ,CAAC,CACf,IAAI,YAAY,CAAC,CACjB,WAAW,CAAC,CAAC,gBAAgB,CAC3B,gBAAgB,CACd,UAAU,EACV,aAAa,CAAC,CAAC,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,SAAS,CACnD,EACD,YAAY,EAAE,WAAW,CAC1B,CAAC,EACF,CACH,CAAC,CAAC,CAAC,CACF,YAAY,CACb,CACH;YAAA,EAAE,GAAG,CACP;UAAA,GAAG,CACJ,CAAC;QACJ,CAAC,CACH;IAAA,EAAE,cAAc,CAAC,CAClB,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import {\n BoxAlignItems,\n BoxFlexDirection,\n ButtonBaseSize,\n FontWeight,\n mergeTwClassName,\n TextColor,\n} from '@metamask-previews/design-system-shared';\nimport { useTailwind } from '@metamask-previews/design-system-twrnc-preset';\nimport React, { useMemo } from 'react';\nimport type { StyleProp, ViewStyle } from 'react-native';\n\nimport { Box } from '../Box';\nimport { Icon, IconColor } from '../Icon';\nimport { Spinner } from '../Spinner';\nimport { ButtonAnimated } from '../temp-components/ButtonAnimated';\nimport { TextOrChildren } from '../temp-components/TextOrChildren';\n\nimport {\n MAP_BUTTONBASE_SIZE_ICONSIZE,\n MAP_BUTTONBASE_SIZE_TEXT_VARIANT,\n getButtonBaseHorizontalPaddingTwClasses,\n TWCLASSMAP_BUTTONBASE_SIZE_DIMENSION,\n} from './ButtonBase.constants';\nimport type { ButtonBaseProps } from './ButtonBase.types';\n\nexport const ButtonBase = ({\n children,\n textProps,\n size = ButtonBaseSize.Lg,\n isLoading,\n loadingText,\n spinnerProps,\n loadingWrapperProps,\n contentWrapperProps,\n startIconName,\n startIconProps,\n startAccessory,\n endIconName,\n endIconProps,\n endAccessory,\n isDisabled,\n isFullWidth,\n twClassName,\n textClassName,\n iconClassName,\n style,\n accessibilityLabel,\n accessibilityHint,\n accessibilityRole = 'button',\n accessibilityActions,\n onAccessibilityAction,\n ...props\n}: ButtonBaseProps) => {\n const tw = useTailwind();\n\n const finalStartIconName = startIconName ?? startIconProps?.name;\n const finalEndIconName = endIconName ?? endIconProps?.name;\n\n const hasStart = Boolean(finalStartIconName || startAccessory);\n const hasEnd = Boolean(finalEndIconName || endAccessory);\n const hasAccessories = hasStart || hasEnd;\n\n const iconSize = MAP_BUTTONBASE_SIZE_ICONSIZE[size];\n const labelTextVariant = MAP_BUTTONBASE_SIZE_TEXT_VARIANT[size];\n\n // Generate accessibility label if not provided\n const finalAccessibilityLabel = useMemo(() => {\n if (accessibilityLabel) {\n return accessibilityLabel;\n }\n\n // For loading state with loadingText, prioritize loadingText\n if (isLoading && loadingText) {\n return loadingText;\n }\n\n // If children is a string, use it as the label\n if (typeof children === 'string') {\n return children;\n }\n\n return undefined;\n }, [accessibilityLabel, children, isLoading, loadingText]);\n\n // Generate accessibility hint for loading state if not provided\n const finalAccessibilityHint = useMemo(() => {\n if (accessibilityHint) {\n return accessibilityHint;\n }\n\n if (isLoading) {\n return 'Button is currently loading';\n }\n\n return undefined;\n }, [accessibilityHint, isLoading]);\n\n // Create accessibilityState object with only truthy values\n const accessibilityState = useMemo(() => {\n const state: { disabled?: boolean; busy?: boolean } = {};\n\n if (isDisabled || isLoading) {\n state.disabled = true;\n }\n\n if (isLoading) {\n state.busy = true;\n }\n\n return state;\n }, [isDisabled, isLoading]);\n\n return (\n <ButtonAnimated\n disabled={isDisabled || isLoading}\n accessibilityRole={accessibilityRole}\n accessibilityLabel={finalAccessibilityLabel}\n accessibilityHint={finalAccessibilityHint}\n accessibilityActions={accessibilityActions}\n onAccessibilityAction={onAccessibilityAction}\n accessibilityState={accessibilityState}\n accessible\n style={({ pressed }) => {\n // Evaluate custom className if it's a function\n const customClassName =\n typeof twClassName === 'function'\n ? twClassName(pressed)\n : twClassName;\n\n // Build button container styles\n const buttonStyles = tw.style(\n // Base layout - flex container for button content\n 'flex-row items-center justify-center rounded-full',\n // Visual styling\n 'bg-muted overflow-hidden',\n getButtonBaseHorizontalPaddingTwClasses(hasStart, hasEnd),\n // Size\n TWCLASSMAP_BUTTONBASE_SIZE_DIMENSION[size],\n // State-based opacity\n isDisabled ? 'opacity-50' : 'opacity-100',\n // Width - use self-start to prevent stretching when not full width\n isFullWidth ? 'w-full' : 'self-start',\n // Custom classes\n customClassName,\n );\n\n // Merge with additional styles if provided\n const computedStyle: StyleProp<ViewStyle>[] = [buttonStyles];\n\n const additionalStyle =\n typeof style === 'function' ? style({ pressed }) : style;\n\n if (additionalStyle) {\n computedStyle.push(additionalStyle);\n }\n\n return computedStyle;\n }}\n {...props}\n >\n {({ pressed }) => {\n const { twClassName: loadingWrapperTw, ...restLoadingWrapper } =\n loadingWrapperProps ?? {};\n const { twClassName: contentWrapperTw, ...restContentWrapper } =\n contentWrapperProps ?? {};\n\n return (\n <>\n {/* Loading spinner overlay */}\n {isLoading && (\n <Box\n {...restLoadingWrapper}\n twClassName={mergeTwClassName(\n 'absolute inset-0 flex items-center justify-center',\n loadingWrapperTw,\n )}\n >\n <Spinner\n color={\n textClassName\n ? (textClassName(pressed) as IconColor)\n : IconColor.IconDefault\n }\n loadingText={loadingText}\n {...spinnerProps}\n spinnerIconProps={{\n size: iconSize,\n ...spinnerProps?.spinnerIconProps,\n }}\n loadingTextProps={{\n numberOfLines: 1,\n variant: labelTextVariant,\n twClassName: textClassName ? textClassName(pressed) : '',\n ...spinnerProps?.loadingTextProps,\n }}\n />\n </Box>\n )}\n\n <Box\n flexDirection={BoxFlexDirection.Row}\n alignItems={BoxAlignItems.Center}\n gap={hasAccessories ? 1 : 0}\n {...restContentWrapper}\n twClassName={\n isLoading\n ? mergeTwClassName('opacity-0', contentWrapperTw)\n : contentWrapperTw\n }\n >\n {finalStartIconName ? (\n <Icon\n name={finalStartIconName}\n size={iconSize}\n {...startIconProps}\n twClassName={mergeTwClassName(\n mergeTwClassName(\n 'shrink-0',\n iconClassName ? iconClassName(pressed) : undefined,\n ),\n startIconProps?.twClassName,\n )}\n />\n ) : (\n startAccessory\n )}\n <TextOrChildren\n textProps={{\n variant: labelTextVariant,\n fontWeight: FontWeight.Medium,\n color: TextColor.TextDefault,\n numberOfLines: 1,\n ellipsizeMode: 'clip',\n ...textProps,\n twClassName: mergeTwClassName(\n mergeTwClassName(\n 'shrink grow-0 flex-wrap text-center',\n textClassName ? textClassName(pressed) : undefined,\n ),\n textProps?.twClassName,\n ),\n }}\n >\n {children}\n </TextOrChildren>\n {finalEndIconName ? (\n <Icon\n name={finalEndIconName}\n size={iconSize}\n {...endIconProps}\n twClassName={mergeTwClassName(\n mergeTwClassName(\n 'shrink-0',\n iconClassName ? iconClassName(pressed) : undefined,\n ),\n endIconProps?.twClassName,\n )}\n />\n ) : (\n endAccessory\n )}\n </Box>\n </>\n );\n }}\n </ButtonAnimated>\n );\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"ButtonBase.types.cjs","sourceRoot":"","sources":["../../../src/components/ButtonBase/ButtonBase.types.ts"],"names":[],"mappings":"","sourcesContent":["import type {\n ButtonBasePropsShared,\n IconName,\n} from '@metamask-previews/design-system-shared';\nimport type { PressableProps, StyleProp, ViewStyle } from 'react-native';\n\nimport type { BoxProps } from '../Box/Box.types';\nimport type { BoxRowProps } from '../BoxRow/BoxRow.types';\nimport type { IconProps } from '../Icon';\nimport type { SpinnerProps } from '../temp-components/Spinner';\nimport type { TextProps } from '../Text';\n\n/**\n * ButtonBase component props.\n */\nexport type ButtonBaseProps = ButtonBasePropsShared & {\n /**\n * Required prop for the content to be rendered within the ButtonBase\n */\n children: React.ReactNode | string;\n /**\n * Optional props to be passed to the Text component when children is a string\n */\n textProps?: Omit<Partial<TextProps>, 'children'>;\n /**\n * Optional prop to pass additional properties to the end icon\n */\n spinnerProps?: Partial<SpinnerProps>;\n /**\n * Props passed to the loading overlay wrapper (`Box` around the spinner).\n * Defaults include `twClassName` for full-area centered layout; merge your own `twClassName` to extend.\n * Pass `testID` here for tests — there is no default test id on this wrapper.\n */\n loadingWrapperProps?: Omit<Partial<BoxProps>, 'children'>;\n /**\n * Props passed to the label row (`BoxRow`). Label typography remains controlled via `textProps` on ButtonBase.\n */\n contentWrapperProps?: Omit<Partial<BoxRowProps>, 'children' | 'textProps'>;\n /**\n * Optional prop to specify an icon to show at the start of the button\n */\n startIconName?: IconName;\n /**\n * Optional prop to pass additional properties to the start icon\n */\n startIconProps?: Partial<IconProps>;\n /**\n * Optional prop for a custom element to show at the start of the button\n */\n startAccessory?: React.ReactNode;\n /**\n * Optional prop to specify an icon to show at the end of the button\n */\n endIconName?: IconName;\n /**\n * Optional prop to pass additional properties to the end icon\n */\n endIconProps?: Partial<IconProps>;\n /**\n * Optional prop for a custom element to show at the end of the button\n */\n endAccessory?: React.ReactNode;\n /**\n * Optional prop to add twrnc overriding classNames.\n * Can be a string or a function that receives pressed state and returns a string.\n */\n twClassName?: string | ((pressed: boolean) => string);\n /**\n * Optional prop to control text className based on pressed state.\n */\n textClassName?: (pressed: boolean) => string;\n /**\n * Optional prop to control icon className based on pressed state.\n */\n iconClassName?: (pressed: boolean) => string;\n /**\n * Optional prop to control the style.\n */\n style?: StyleProp<ViewStyle>;\n /**\n * Optional accessibility label to describe the button for screen readers.\n * If not provided, the button content will be used as the label.\n */\n accessibilityLabel?: string;\n /**\n * Optional accessibility hint to provide additional context about the button's action.\n * Should describe what happens when the button is pressed.\n */\n accessibilityHint?: string;\n /**\n * Optional accessibility role. Defaults to 'button'.\n * Can be overridden for specific use cases.\n */\n accessibilityRole?: 'button' | 'link' | 'menuitem' | 'tab' | 'none';\n /**\n * Optional accessibility actions for custom interactions.\n * Use sparingly and only when default button behavior is insufficient.\n */\n accessibilityActions?: {\n name: string;\n label?: string;\n }[];\n /**\n * Optional callback for handling accessibility action events.\n */\n onAccessibilityAction?: (event: {\n nativeEvent: { actionName: string };\n }) => void;\n} & Omit<\n PressableProps,\n | 'accessibilityRole'\n | 'accessibilityLabel'\n | 'accessibilityHint'\n | 'accessibilityActions'\n | 'onAccessibilityAction'\n >;\n"]}
1
+ {"version":3,"file":"ButtonBase.types.cjs","sourceRoot":"","sources":["../../../src/components/ButtonBase/ButtonBase.types.ts"],"names":[],"mappings":"","sourcesContent":["import type {\n ButtonBasePropsShared,\n IconName,\n} from '@metamask-previews/design-system-shared';\nimport type { PressableProps, StyleProp, ViewStyle } from 'react-native';\n\nimport type { BoxProps } from '../Box/Box.types';\nimport type { IconProps } from '../Icon';\nimport type { SpinnerProps } from '../Spinner';\nimport type { TextProps } from '../Text';\n\n/**\n * ButtonBase component props.\n */\nexport type ButtonBaseProps = ButtonBasePropsShared & {\n /**\n * Required prop for the content to be rendered within the ButtonBase\n */\n children: React.ReactNode | string;\n /**\n * Optional props to be passed to the Text component when children is a string\n */\n textProps?: Omit<Partial<TextProps>, 'children'>;\n /**\n * Optional prop to pass additional properties to the end icon\n */\n spinnerProps?: Partial<SpinnerProps>;\n /**\n * Props passed to the loading overlay wrapper (`Box` around the spinner).\n * Defaults include `twClassName` for full-area centered layout; merge your own `twClassName` to extend.\n * Pass `testID` here for tests — there is no default test id on this wrapper.\n */\n loadingWrapperProps?: Omit<Partial<BoxProps>, 'children'>;\n /**\n * Props passed to the label row (`Box`). Defaults to a row with centered items and `gap={1}` when accessories are present; values here override those defaults. Label typography remains controlled via `textProps` on ButtonBase.\n */\n contentWrapperProps?: Omit<Partial<BoxProps>, 'children'>;\n /**\n * Optional prop to specify an icon to show at the start of the button\n */\n startIconName?: IconName;\n /**\n * Optional prop to pass additional properties to the start icon\n */\n startIconProps?: Partial<IconProps>;\n /**\n * Optional prop for a custom element to show at the start of the button\n */\n startAccessory?: React.ReactNode;\n /**\n * Optional prop to specify an icon to show at the end of the button\n */\n endIconName?: IconName;\n /**\n * Optional prop to pass additional properties to the end icon\n */\n endIconProps?: Partial<IconProps>;\n /**\n * Optional prop for a custom element to show at the end of the button\n */\n endAccessory?: React.ReactNode;\n /**\n * Optional prop to add twrnc overriding classNames.\n * Can be a string or a function that receives pressed state and returns a string.\n */\n twClassName?: string | ((pressed: boolean) => string);\n /**\n * Optional prop to control text className based on pressed state.\n */\n textClassName?: (pressed: boolean) => string;\n /**\n * Optional prop to control icon className based on pressed state.\n */\n iconClassName?: (pressed: boolean) => string;\n /**\n * Optional prop to control the style.\n */\n style?: StyleProp<ViewStyle>;\n /**\n * Optional accessibility label to describe the button for screen readers.\n * If not provided, the button content will be used as the label.\n */\n accessibilityLabel?: string;\n /**\n * Optional accessibility hint to provide additional context about the button's action.\n * Should describe what happens when the button is pressed.\n */\n accessibilityHint?: string;\n /**\n * Optional accessibility role. Defaults to 'button'.\n * Can be overridden for specific use cases.\n */\n accessibilityRole?: 'button' | 'link' | 'menuitem' | 'tab' | 'none';\n /**\n * Optional accessibility actions for custom interactions.\n * Use sparingly and only when default button behavior is insufficient.\n */\n accessibilityActions?: {\n name: string;\n label?: string;\n }[];\n /**\n * Optional callback for handling accessibility action events.\n */\n onAccessibilityAction?: (event: {\n nativeEvent: { actionName: string };\n }) => void;\n} & Omit<\n PressableProps,\n | 'accessibilityRole'\n | 'accessibilityLabel'\n | 'accessibilityHint'\n | 'accessibilityActions'\n | 'onAccessibilityAction'\n >;\n"]}
@@ -1,9 +1,8 @@
1
1
  import type { ButtonBasePropsShared, IconName } from "@metamask-previews/design-system-shared";
2
2
  import type { PressableProps, StyleProp, ViewStyle } from "react-native";
3
3
  import type { BoxProps } from "../Box/Box.types.cjs";
4
- import type { BoxRowProps } from "../BoxRow/BoxRow.types.cjs";
5
4
  import type { IconProps } from "../Icon/index.cjs";
6
- import type { SpinnerProps } from "../temp-components/Spinner/index.cjs";
5
+ import type { SpinnerProps } from "../Spinner/index.cjs";
7
6
  import type { TextProps } from "../Text/index.cjs";
8
7
  /**
9
8
  * ButtonBase component props.
@@ -28,9 +27,9 @@ export type ButtonBaseProps = ButtonBasePropsShared & {
28
27
  */
29
28
  loadingWrapperProps?: Omit<Partial<BoxProps>, 'children'>;
30
29
  /**
31
- * Props passed to the label row (`BoxRow`). Label typography remains controlled via `textProps` on ButtonBase.
30
+ * Props passed to the label row (`Box`). Defaults to a row with centered items and `gap={1}` when accessories are present; values here override those defaults. Label typography remains controlled via `textProps` on ButtonBase.
32
31
  */
33
- contentWrapperProps?: Omit<Partial<BoxRowProps>, 'children' | 'textProps'>;
32
+ contentWrapperProps?: Omit<Partial<BoxProps>, 'children'>;
34
33
  /**
35
34
  * Optional prop to specify an icon to show at the start of the button
36
35
  */
@@ -1 +1 @@
1
- {"version":3,"file":"ButtonBase.types.d.cts","sourceRoot":"","sources":["../../../src/components/ButtonBase/ButtonBase.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,qBAAqB,EACrB,QAAQ,EACT,gDAAgD;AACjD,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,SAAS,EAAE,qBAAqB;AAEzE,OAAO,KAAK,EAAE,QAAQ,EAAE,6BAAyB;AACjD,OAAO,KAAK,EAAE,WAAW,EAAE,mCAA+B;AAC1D,OAAO,KAAK,EAAE,SAAS,EAAE,0BAAgB;AACzC,OAAO,KAAK,EAAE,YAAY,EAAE,6CAAmC;AAC/D,OAAO,KAAK,EAAE,SAAS,EAAE,0BAAgB;AAEzC;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,qBAAqB,GAAG;IACpD;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAC,SAAS,GAAG,MAAM,CAAC;IACnC;;OAEG;IACH,SAAS,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,UAAU,CAAC,CAAC;IACjD;;OAEG;IACH,YAAY,CAAC,EAAE,OA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 @@
1
1
  import type { ButtonBasePropsShared, IconName } from "@metamask-previews/design-system-shared";
2
2
  import type { PressableProps, StyleProp, ViewStyle } from "react-native";
3
3
  import type { BoxProps } from "../Box/Box.types.mjs";
4
- import type { BoxRowProps } from "../BoxRow/BoxRow.types.mjs";
5
4
  import type { IconProps } from "../Icon/index.mjs";
6
- import type { SpinnerProps } from "../temp-components/Spinner/index.mjs";
5
+ import type { SpinnerProps } from "../Spinner/index.mjs";
7
6
  import type { TextProps } from "../Text/index.mjs";
8
7
  /**
9
8
  * ButtonBase component props.
@@ -28,9 +27,9 @@ export type ButtonBaseProps = ButtonBasePropsShared & {
28
27
  */
29
28
  loadingWrapperProps?: Omit<Partial<BoxProps>, 'children'>;
30
29
  /**
31
- * Props passed to the label row (`BoxRow`). Label typography remains controlled via `textProps` on ButtonBase.
30
+ * Props passed to the label row (`Box`). Defaults to a row with centered items and `gap={1}` when accessories are present; values here override those defaults. Label typography remains controlled via `textProps` on ButtonBase.
32
31
  */
33
- contentWrapperProps?: Omit<Partial<BoxRowProps>, 'children' | 'textProps'>;
32
+ contentWrapperProps?: Omit<Partial<BoxProps>, 'children'>;
34
33
  /**
35
34
  * Optional prop to specify an icon to show at the start of the button
36
35
  */
@@ -1 +1 @@
1
- {"version":3,"file":"ButtonBase.types.d.mts","sourceRoot":"","sources":["../../../src/components/ButtonBase/ButtonBase.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,qBAAqB,EACrB,QAAQ,EACT,gDAAgD;AACjD,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,SAAS,EAAE,qBAAqB;AAEzE,OAAO,KAAK,EAAE,QAAQ,EAAE,6BAAyB;AACjD,OAAO,KAAK,EAAE,WAAW,EAAE,mCAA+B;AAC1D,OAAO,KAAK,EAAE,SAAS,EAAE,0BAAgB;AACzC,OAAO,KAAK,EAAE,YAAY,EAAE,6CAAmC;AAC/D,OAAO,KAAK,EAAE,SAAS,EAAE,0BAAgB;AAEzC;;G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B,CAAC,EAAE,CAAC,KAAK,EAAE;QAC9B,WAAW,EAAE;YAAE,UAAU,EAAE,MAAM,CAAA;SAAE,CAAC;KACrC,KAAK,IAAI,CAAC;CACZ,GAAG,IAAI,CACJ,cAAc,EACZ,mBAAmB,GACnB,oBAAoB,GACpB,mBAAmB,GACnB,sBAAsB,GACtB,uBAAuB,CAC1B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"ButtonBase.types.mjs","sourceRoot":"","sources":["../../../src/components/ButtonBase/ButtonBase.types.ts"],"names":[],"mappings":"","sourcesContent":["import type {\n ButtonBasePropsShared,\n IconName,\n} from '@metamask-previews/design-system-shared';\nimport type { PressableProps, StyleProp, ViewStyle } from 'react-native';\n\nimport type { BoxProps } from '../Box/Box.types';\nimport type { BoxRowProps } from '../BoxRow/BoxRow.types';\nimport type { IconProps } from '../Icon';\nimport type { SpinnerProps } from '../temp-components/Spinner';\nimport type { TextProps } from '../Text';\n\n/**\n * ButtonBase component props.\n */\nexport type ButtonBaseProps = ButtonBasePropsShared & {\n /**\n * Required prop for the content to be rendered within the ButtonBase\n */\n children: React.ReactNode | string;\n /**\n * Optional props to be passed to the Text component when children is a string\n */\n textProps?: Omit<Partial<TextProps>, 'children'>;\n /**\n * Optional prop to pass additional properties to the end icon\n */\n spinnerProps?: Partial<SpinnerProps>;\n /**\n * Props passed to the loading overlay wrapper (`Box` around the spinner).\n * Defaults include `twClassName` for full-area centered layout; merge your own `twClassName` to extend.\n * Pass `testID` here for tests — there is no default test id on this wrapper.\n */\n loadingWrapperProps?: Omit<Partial<BoxProps>, 'children'>;\n /**\n * Props passed to the label row (`BoxRow`). Label typography remains controlled via `textProps` on ButtonBase.\n */\n contentWrapperProps?: Omit<Partial<BoxRowProps>, 'children' | 'textProps'>;\n /**\n * Optional prop to specify an icon to show at the start of the button\n */\n startIconName?: IconName;\n /**\n * Optional prop to pass additional properties to the start icon\n */\n startIconProps?: Partial<IconProps>;\n /**\n * Optional prop for a custom element to show at the start of the button\n */\n startAccessory?: React.ReactNode;\n /**\n * Optional prop to specify an icon to show at the end of the button\n */\n endIconName?: IconName;\n /**\n * Optional prop to pass additional properties to the end icon\n */\n endIconProps?: Partial<IconProps>;\n /**\n * Optional prop for a custom element to show at the end of the button\n */\n endAccessory?: React.ReactNode;\n /**\n * Optional prop to add twrnc overriding classNames.\n * Can be a string or a function that receives pressed state and returns a string.\n */\n twClassName?: string | ((pressed: boolean) => string);\n /**\n * Optional prop to control text className based on pressed state.\n */\n textClassName?: (pressed: boolean) => string;\n /**\n * Optional prop to control icon className based on pressed state.\n */\n iconClassName?: (pressed: boolean) => string;\n /**\n * Optional prop to control the style.\n */\n style?: StyleProp<ViewStyle>;\n /**\n * Optional accessibility label to describe the button for screen readers.\n * If not provided, the button content will be used as the label.\n */\n accessibilityLabel?: string;\n /**\n * Optional accessibility hint to provide additional context about the button's action.\n * Should describe what happens when the button is pressed.\n */\n accessibilityHint?: string;\n /**\n * Optional accessibility role. Defaults to 'button'.\n * Can be overridden for specific use cases.\n */\n accessibilityRole?: 'button' | 'link' | 'menuitem' | 'tab' | 'none';\n /**\n * Optional accessibility actions for custom interactions.\n * Use sparingly and only when default button behavior is insufficient.\n */\n accessibilityActions?: {\n name: string;\n label?: string;\n }[];\n /**\n * Optional callback for handling accessibility action events.\n */\n onAccessibilityAction?: (event: {\n nativeEvent: { actionName: string };\n }) => void;\n} & Omit<\n PressableProps,\n | 'accessibilityRole'\n | 'accessibilityLabel'\n | 'accessibilityHint'\n | 'accessibilityActions'\n | 'onAccessibilityAction'\n >;\n"]}
1
+ {"version":3,"file":"ButtonBase.types.mjs","sourceRoot":"","sources":["../../../src/components/ButtonBase/ButtonBase.types.ts"],"names":[],"mappings":"","sourcesContent":["import type {\n ButtonBasePropsShared,\n IconName,\n} from '@metamask-previews/design-system-shared';\nimport type { PressableProps, StyleProp, ViewStyle } from 'react-native';\n\nimport type { BoxProps } from '../Box/Box.types';\nimport type { IconProps } from '../Icon';\nimport type { SpinnerProps } from '../Spinner';\nimport type { TextProps } from '../Text';\n\n/**\n * ButtonBase component props.\n */\nexport type ButtonBaseProps = ButtonBasePropsShared & {\n /**\n * Required prop for the content to be rendered within the ButtonBase\n */\n children: React.ReactNode | string;\n /**\n * Optional props to be passed to the Text component when children is a string\n */\n textProps?: Omit<Partial<TextProps>, 'children'>;\n /**\n * Optional prop to pass additional properties to the end icon\n */\n spinnerProps?: Partial<SpinnerProps>;\n /**\n * Props passed to the loading overlay wrapper (`Box` around the spinner).\n * Defaults include `twClassName` for full-area centered layout; merge your own `twClassName` to extend.\n * Pass `testID` here for tests — there is no default test id on this wrapper.\n */\n loadingWrapperProps?: Omit<Partial<BoxProps>, 'children'>;\n /**\n * Props passed to the label row (`Box`). Defaults to a row with centered items and `gap={1}` when accessories are present; values here override those defaults. Label typography remains controlled via `textProps` on ButtonBase.\n */\n contentWrapperProps?: Omit<Partial<BoxProps>, 'children'>;\n /**\n * Optional prop to specify an icon to show at the start of the button\n */\n startIconName?: IconName;\n /**\n * Optional prop to pass additional properties to the start icon\n */\n startIconProps?: Partial<IconProps>;\n /**\n * Optional prop for a custom element to show at the start of the button\n */\n startAccessory?: React.ReactNode;\n /**\n * Optional prop to specify an icon to show at the end of the button\n */\n endIconName?: IconName;\n /**\n * Optional prop to pass additional properties to the end icon\n */\n endIconProps?: Partial<IconProps>;\n /**\n * Optional prop for a custom element to show at the end of the button\n */\n endAccessory?: React.ReactNode;\n /**\n * Optional prop to add twrnc overriding classNames.\n * Can be a string or a function that receives pressed state and returns a string.\n */\n twClassName?: string | ((pressed: boolean) => string);\n /**\n * Optional prop to control text className based on pressed state.\n */\n textClassName?: (pressed: boolean) => string;\n /**\n * Optional prop to control icon className based on pressed state.\n */\n iconClassName?: (pressed: boolean) => string;\n /**\n * Optional prop to control the style.\n */\n style?: StyleProp<ViewStyle>;\n /**\n * Optional accessibility label to describe the button for screen readers.\n * If not provided, the button content will be used as the label.\n */\n accessibilityLabel?: string;\n /**\n * Optional accessibility hint to provide additional context about the button's action.\n * Should describe what happens when the button is pressed.\n */\n accessibilityHint?: string;\n /**\n * Optional accessibility role. Defaults to 'button'.\n * Can be overridden for specific use cases.\n */\n accessibilityRole?: 'button' | 'link' | 'menuitem' | 'tab' | 'none';\n /**\n * Optional accessibility actions for custom interactions.\n * Use sparingly and only when default button behavior is insufficient.\n */\n accessibilityActions?: {\n name: string;\n label?: string;\n }[];\n /**\n * Optional callback for handling accessibility action events.\n */\n onAccessibilityAction?: (event: {\n nativeEvent: { actionName: string };\n }) => void;\n} & Omit<\n PressableProps,\n | 'accessibilityRole'\n | 'accessibilityLabel'\n | 'accessibilityHint'\n | 'accessibilityActions'\n | 'onAccessibilityAction'\n >;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"ButtonHero.cjs","sourceRoot":"","sources":["../../../src/components/ButtonHero/ButtonHero.tsx"],"names":[],"mappings":";;;;;;AAAA,8FAAqF;AACrF,kDAA0B;AAE1B,wDAA2C;AAI3C;;;;;;;;;;;;GAYG;AACH,MAAM,eAAe,GAA8B,CAAC,EAClD,UAAU,EACV,SAAS,EACT,WAAW,EAAE,YAAY,EACzB,aAAa,EAAE,cAAc,EAC7B,aAAa,EAAE,cAAc,EAC7B,GAAG,KAAK,EACT,EAAE,EAAE,CAAC,CACJ,CAAC,uBAAU,CACT,WAAW,CAAC,CAAC,CAAC,OAAO,EAAE,EAAE,CACvB,sBACE,OAAO,IAAI,CAAC,UAAU,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,4BAA4B,CAAC,CAAC,CAAC,EACxE,EAAE,CACH,CACD,aAAa,CAAC,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,sBAAsB,CAAC,CACpD,aAAa,CAAC,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,sBAAsB,CAAC,CACpD,UAAU,CAAC,CAAC,UAAU,CAAC,CACvB,SAAS,CAAC,CAAC,SAAS,CAAC,CACrB,IAAI,KAAK,CAAC,EACV,CACH,CAAC;AAEF;;;;;;;;;;;GAWG;AACI,MAAM,UAAU,GAA8B,CAAC,KAAK,EAAE,EAAE,CAAC,CAC9D,CAAC,0CAAa,CAAC,KAAK,CAAC,CAAC,kCAAK,CAAC,KAAK,CAAC,CAChC;IAAA,CAAC,eAAe,CAAC,IAAI,KAAK,CAAC,EAC7B;EAAA,EAAE,0CAAa,CAAC,CACjB,CAAC;AAJW,QAAA,UAAU,cAIrB","sourcesContent":["import { Theme, ThemeProvider } from '@metamask-previews/design-system-twrnc-preset';\nimport React from 'react';\n\nimport { ButtonBase } from '../ButtonBase';\n\nimport type { ButtonHeroProps } from './ButtonHero.types';\n\n/**\n * Inner component that uses the locked light theme from ThemeProvider.\n * Destructures and ignores twClassName, textClassName, and iconClassName to prevent\n * overriding the hero-specific styling (light theme lock).\n *\n * @param props - Component props destructured below\n * @param props.isDisabled - Whether the button is disabled\n * @param props.isLoading - Whether the button is in a loading state\n * @param props.twClassName - Ignored to prevent override of hero styling\n * @param props.textClassName - Ignored to prevent override of hero styling\n * @param props.iconClassName - Ignored to prevent override of hero styling\n * @returns ButtonBase component with locked light theme styles\n */\nconst ButtonHeroInner: React.FC<ButtonHeroProps> = ({\n isDisabled,\n isLoading,\n twClassName: _twClassName,\n textClassName: _textClassName,\n iconClassName: _iconClassName,\n ...props\n}) => (\n <ButtonBase\n twClassName={(pressed) =>\n `bg-primary-default ${\n pressed && !isDisabled && !isLoading ? 'bg-primary-default-pressed' : ''\n }`\n }\n textClassName={(_pressed) => 'text-primary-inverse'}\n iconClassName={(_pressed) => 'text-primary-inverse'}\n isDisabled={isDisabled}\n isLoading={isLoading}\n {...props}\n />\n);\n\n/**\n * ButtonHero component - Hero button with locked light theme\n *\n * Used for primary marketing and call-to-action use cases.\n * The button is locked to light theme colors regardless of the app's theme setting.\n *\n * @deprecated Use `Button` with `variant={ButtonVariant.Primary}` instead.\n * This component will be removed in a future major version of the design system.\n *\n * @param props - ButtonHero props extending ButtonBaseProps\n * @returns ButtonHero component wrapped in light ThemeProvider\n */\nexport const ButtonHero: React.FC<ButtonHeroProps> = (props) => (\n <ThemeProvider theme={Theme.Light}>\n <ButtonHeroInner {...props} />\n </ThemeProvider>\n);\n"]}
1
+ {"version":3,"file":"ButtonHero.cjs","sourceRoot":"","sources":["../../../src/components/ButtonHero/ButtonHero.tsx"],"names":[],"mappings":";;;;;;AAAA,8FAAqF;AACrF,kDAA0B;AAE1B,wDAA2C;AAI3C;;;;;;;;;;;;GAYG;AACH,MAAM,eAAe,GAA8B,CAAC,EAClD,UAAU,EACV,SAAS,EACT,WAAW,EAAE,YAAY,EACzB,aAAa,EAAE,cAAc,EAC7B,aAAa,EAAE,cAAc,EAC7B,GAAG,KAAK,EACT,EAAE,EAAE,CAAC,CACJ,CAAC,uBAAU,CACT,WAAW,CAAC,CAAC,CAAC,OAAO,EAAE,EAAE,CACvB,sBACE,OAAO,IAAI,CAAC,UAAU,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,4BAA4B,CAAC,CAAC,CAAC,EACxE,EACF,CAAC,CACD,aAAa,CAAC,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,sBAAsB,CAAC,CACpD,aAAa,CAAC,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,sBAAsB,CAAC,CACpD,UAAU,CAAC,CAAC,UAAU,CAAC,CACvB,SAAS,CAAC,CAAC,SAAS,CAAC,CACrB,IAAI,KAAK,CAAC,EACV,CACH,CAAC;AAEF;;;;;;;;;;;GAWG;AACI,MAAM,UAAU,GAA8B,CAAC,KAAK,EAAE,EAAE,CAAC,CAC9D,CAAC,0CAAa,CAAC,KAAK,CAAC,CAAC,kCAAK,CAAC,KAAK,CAAC,CAChC;IAAA,CAAC,eAAe,CAAC,IAAI,KAAK,CAAC,EAC7B;EAAA,EAAE,0CAAa,CAAC,CACjB,CAAC;AAJW,QAAA,UAAU,cAIrB","sourcesContent":["import { Theme, ThemeProvider } from '@metamask-previews/design-system-twrnc-preset';\nimport React from 'react';\n\nimport { ButtonBase } from '../ButtonBase';\n\nimport type { ButtonHeroProps } from './ButtonHero.types';\n\n/**\n * Inner component that uses the locked light theme from ThemeProvider.\n * Destructures and ignores twClassName, textClassName, and iconClassName to prevent\n * overriding the hero-specific styling (light theme lock).\n *\n * @param props - Component props destructured below\n * @param props.isDisabled - Whether the button is disabled\n * @param props.isLoading - Whether the button is in a loading state\n * @param props.twClassName - Ignored to prevent override of hero styling\n * @param props.textClassName - Ignored to prevent override of hero styling\n * @param props.iconClassName - Ignored to prevent override of hero styling\n * @returns ButtonBase component with locked light theme styles\n */\nconst ButtonHeroInner: React.FC<ButtonHeroProps> = ({\n isDisabled,\n isLoading,\n twClassName: _twClassName,\n textClassName: _textClassName,\n iconClassName: _iconClassName,\n ...props\n}) => (\n <ButtonBase\n twClassName={(pressed) =>\n `bg-primary-default ${\n pressed && !isDisabled && !isLoading ? 'bg-primary-default-pressed' : ''\n }`\n }\n textClassName={(_pressed) => 'text-primary-inverse'}\n iconClassName={(_pressed) => 'text-primary-inverse'}\n isDisabled={isDisabled}\n isLoading={isLoading}\n {...props}\n />\n);\n\n/**\n * ButtonHero component - Hero button with locked light theme\n *\n * Used for primary marketing and call-to-action use cases.\n * The button is locked to light theme colors regardless of the app's theme setting.\n *\n * @deprecated Use `Button` with `variant={ButtonVariant.Primary}` instead.\n * This component will be removed in a future major version of the design system.\n *\n * @param props - ButtonHero props extending ButtonBaseProps\n * @returns ButtonHero component wrapped in light ThemeProvider\n */\nexport const ButtonHero: React.FC<ButtonHeroProps> = (props) => (\n <ThemeProvider theme={Theme.Light}>\n <ButtonHeroInner {...props} />\n </ThemeProvider>\n);\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"ButtonHero.mjs","sourceRoot":"","sources":["../../../src/components/ButtonHero/ButtonHero.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,sDAAsD;AACrF,OAAO,MAAK,cAAc;;AAE1B,OAAO,EAAE,UAAU,EAAE,gCAAsB;AAI3C;;;;;;;;;;;;GAYG;AACH,MAAM,eAAe,GAA8B,CAAC,EAClD,UAAU,EACV,SAAS,EACT,WAAW,EAAE,YAAY,EACzB,aAAa,EAAE,cAAc,EAC7B,aAAa,EAAE,cAAc,EAC7B,GAAG,KAAK,EACT,EAAE,EAAE,CAAC,CACJ,CAAC,UAAU,CACT,WAAW,CAAC,CAAC,CAAC,OAAO,EAAE,EAAE,CACvB,sBACE,OAAO,IAAI,CAAC,UAAU,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,4BAA4B,CAAC,CAAC,CAAC,EACxE,EAAE,CACH,CACD,aAAa,CAAC,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,sBAAsB,CAAC,CACpD,aAAa,CAAC,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,sBAAsB,CAAC,CACpD,UAAU,CAAC,CAAC,UAAU,CAAC,CACvB,SAAS,CAAC,CAAC,SAAS,CAAC,CACrB,IAAI,KAAK,CAAC,EACV,CACH,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,UAAU,GAA8B,CAAC,KAAK,EAAE,EAAE,CAAC,CAC9D,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAChC;IAAA,CAAC,eAAe,CAAC,IAAI,KAAK,CAAC,EAC7B;EAAA,EAAE,aAAa,CAAC,CACjB,CAAC","sourcesContent":["import { Theme, ThemeProvider } from '@metamask-previews/design-system-twrnc-preset';\nimport React from 'react';\n\nimport { ButtonBase } from '../ButtonBase';\n\nimport type { ButtonHeroProps } from './ButtonHero.types';\n\n/**\n * Inner component that uses the locked light theme from ThemeProvider.\n * Destructures and ignores twClassName, textClassName, and iconClassName to prevent\n * overriding the hero-specific styling (light theme lock).\n *\n * @param props - Component props destructured below\n * @param props.isDisabled - Whether the button is disabled\n * @param props.isLoading - Whether the button is in a loading state\n * @param props.twClassName - Ignored to prevent override of hero styling\n * @param props.textClassName - Ignored to prevent override of hero styling\n * @param props.iconClassName - Ignored to prevent override of hero styling\n * @returns ButtonBase component with locked light theme styles\n */\nconst ButtonHeroInner: React.FC<ButtonHeroProps> = ({\n isDisabled,\n isLoading,\n twClassName: _twClassName,\n textClassName: _textClassName,\n iconClassName: _iconClassName,\n ...props\n}) => (\n <ButtonBase\n twClassName={(pressed) =>\n `bg-primary-default ${\n pressed && !isDisabled && !isLoading ? 'bg-primary-default-pressed' : ''\n }`\n }\n textClassName={(_pressed) => 'text-primary-inverse'}\n iconClassName={(_pressed) => 'text-primary-inverse'}\n isDisabled={isDisabled}\n isLoading={isLoading}\n {...props}\n />\n);\n\n/**\n * ButtonHero component - Hero button with locked light theme\n *\n * Used for primary marketing and call-to-action use cases.\n * The button is locked to light theme colors regardless of the app's theme setting.\n *\n * @deprecated Use `Button` with `variant={ButtonVariant.Primary}` instead.\n * This component will be removed in a future major version of the design system.\n *\n * @param props - ButtonHero props extending ButtonBaseProps\n * @returns ButtonHero component wrapped in light ThemeProvider\n */\nexport const ButtonHero: React.FC<ButtonHeroProps> = (props) => (\n <ThemeProvider theme={Theme.Light}>\n <ButtonHeroInner {...props} />\n </ThemeProvider>\n);\n"]}
1
+ {"version":3,"file":"ButtonHero.mjs","sourceRoot":"","sources":["../../../src/components/ButtonHero/ButtonHero.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,sDAAsD;AACrF,OAAO,MAAK,cAAc;;AAE1B,OAAO,EAAE,UAAU,EAAE,gCAAsB;AAI3C;;;;;;;;;;;;GAYG;AACH,MAAM,eAAe,GAA8B,CAAC,EAClD,UAAU,EACV,SAAS,EACT,WAAW,EAAE,YAAY,EACzB,aAAa,EAAE,cAAc,EAC7B,aAAa,EAAE,cAAc,EAC7B,GAAG,KAAK,EACT,EAAE,EAAE,CAAC,CACJ,CAAC,UAAU,CACT,WAAW,CAAC,CAAC,CAAC,OAAO,EAAE,EAAE,CACvB,sBACE,OAAO,IAAI,CAAC,UAAU,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,4BAA4B,CAAC,CAAC,CAAC,EACxE,EACF,CAAC,CACD,aAAa,CAAC,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,sBAAsB,CAAC,CACpD,aAAa,CAAC,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,sBAAsB,CAAC,CACpD,UAAU,CAAC,CAAC,UAAU,CAAC,CACvB,SAAS,CAAC,CAAC,SAAS,CAAC,CACrB,IAAI,KAAK,CAAC,EACV,CACH,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,UAAU,GAA8B,CAAC,KAAK,EAAE,EAAE,CAAC,CAC9D,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAChC;IAAA,CAAC,eAAe,CAAC,IAAI,KAAK,CAAC,EAC7B;EAAA,EAAE,aAAa,CAAC,CACjB,CAAC","sourcesContent":["import { Theme, ThemeProvider } from '@metamask-previews/design-system-twrnc-preset';\nimport React from 'react';\n\nimport { ButtonBase } from '../ButtonBase';\n\nimport type { ButtonHeroProps } from './ButtonHero.types';\n\n/**\n * Inner component that uses the locked light theme from ThemeProvider.\n * Destructures and ignores twClassName, textClassName, and iconClassName to prevent\n * overriding the hero-specific styling (light theme lock).\n *\n * @param props - Component props destructured below\n * @param props.isDisabled - Whether the button is disabled\n * @param props.isLoading - Whether the button is in a loading state\n * @param props.twClassName - Ignored to prevent override of hero styling\n * @param props.textClassName - Ignored to prevent override of hero styling\n * @param props.iconClassName - Ignored to prevent override of hero styling\n * @returns ButtonBase component with locked light theme styles\n */\nconst ButtonHeroInner: React.FC<ButtonHeroProps> = ({\n isDisabled,\n isLoading,\n twClassName: _twClassName,\n textClassName: _textClassName,\n iconClassName: _iconClassName,\n ...props\n}) => (\n <ButtonBase\n twClassName={(pressed) =>\n `bg-primary-default ${\n pressed && !isDisabled && !isLoading ? 'bg-primary-default-pressed' : ''\n }`\n }\n textClassName={(_pressed) => 'text-primary-inverse'}\n iconClassName={(_pressed) => 'text-primary-inverse'}\n isDisabled={isDisabled}\n isLoading={isLoading}\n {...props}\n />\n);\n\n/**\n * ButtonHero component - Hero button with locked light theme\n *\n * Used for primary marketing and call-to-action use cases.\n * The button is locked to light theme colors regardless of the app's theme setting.\n *\n * @deprecated Use `Button` with `variant={ButtonVariant.Primary}` instead.\n * This component will be removed in a future major version of the design system.\n *\n * @param props - ButtonHero props extending ButtonBaseProps\n * @returns ButtonHero component wrapped in light ThemeProvider\n */\nexport const ButtonHero: React.FC<ButtonHeroProps> = (props) => (\n <ThemeProvider theme={Theme.Light}>\n <ButtonHeroInner {...props} />\n </ThemeProvider>\n);\n"]}
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
25
35
  Object.defineProperty(exports, "__esModule", { value: true });
26
36
  exports.ButtonIcon = void 0;
27
37
  const design_system_shared_1 = require("@metamask-previews/design-system-shared");