@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.
- package/CHANGELOG.md +11 -1
- package/dist/components/ActionListItem/ActionListItem.cjs +17 -7
- package/dist/components/ActionListItem/ActionListItem.cjs.map +1 -1
- package/dist/components/ActionListItem/ActionListItem.mjs.map +1 -1
- package/dist/components/AvatarAccount/AvatarAccount.cjs.map +1 -1
- package/dist/components/AvatarAccount/AvatarAccount.d.cts.map +1 -1
- package/dist/components/AvatarAccount/AvatarAccount.d.mts.map +1 -1
- package/dist/components/AvatarAccount/AvatarAccount.mjs.map +1 -1
- package/dist/components/AvatarBase/AvatarBase.constants.cjs +16 -16
- package/dist/components/AvatarBase/AvatarBase.constants.cjs.map +1 -1
- package/dist/components/AvatarBase/AvatarBase.constants.mjs +16 -16
- package/dist/components/AvatarBase/AvatarBase.constants.mjs.map +1 -1
- package/dist/components/AvatarBase/AvatarBase.d.cts.map +1 -1
- package/dist/components/AvatarBase/AvatarBase.d.mts.map +1 -1
- package/dist/components/AvatarFavicon/AvatarFavicon.cjs +17 -7
- package/dist/components/AvatarFavicon/AvatarFavicon.cjs.map +1 -1
- package/dist/components/AvatarFavicon/AvatarFavicon.d.cts.map +1 -1
- package/dist/components/AvatarFavicon/AvatarFavicon.d.mts.map +1 -1
- package/dist/components/AvatarGroup/AvatarGroup.cjs +17 -7
- package/dist/components/AvatarGroup/AvatarGroup.cjs.map +1 -1
- package/dist/components/AvatarGroup/AvatarGroup.d.cts.map +1 -1
- package/dist/components/AvatarGroup/AvatarGroup.d.mts.map +1 -1
- package/dist/components/AvatarGroup/AvatarGroup.mjs.map +1 -1
- package/dist/components/AvatarIcon/AvatarIcon.constants.cjs +4 -4
- package/dist/components/AvatarIcon/AvatarIcon.constants.cjs.map +1 -1
- package/dist/components/AvatarIcon/AvatarIcon.constants.mjs +4 -4
- package/dist/components/AvatarIcon/AvatarIcon.constants.mjs.map +1 -1
- package/dist/components/AvatarIcon/AvatarIcon.d.cts.map +1 -1
- package/dist/components/AvatarIcon/AvatarIcon.d.mts.map +1 -1
- package/dist/components/AvatarNetwork/AvatarNetwork.cjs +17 -7
- package/dist/components/AvatarNetwork/AvatarNetwork.cjs.map +1 -1
- package/dist/components/AvatarNetwork/AvatarNetwork.d.cts.map +1 -1
- package/dist/components/AvatarNetwork/AvatarNetwork.d.mts.map +1 -1
- package/dist/components/AvatarNetwork/AvatarNetwork.mjs.map +1 -1
- package/dist/components/AvatarToken/AvatarToken.cjs +17 -7
- package/dist/components/AvatarToken/AvatarToken.cjs.map +1 -1
- package/dist/components/AvatarToken/AvatarToken.d.cts.map +1 -1
- package/dist/components/AvatarToken/AvatarToken.d.mts.map +1 -1
- package/dist/components/AvatarToken/AvatarToken.mjs.map +1 -1
- package/dist/components/BadgeCount/BadgeCount.constants.cjs +1 -1
- package/dist/components/BadgeCount/BadgeCount.constants.cjs.map +1 -1
- package/dist/components/BadgeCount/BadgeCount.constants.mjs +1 -1
- package/dist/components/BadgeCount/BadgeCount.constants.mjs.map +1 -1
- package/dist/components/BadgeCount/BadgeCount.d.cts.map +1 -1
- package/dist/components/BadgeCount/BadgeCount.d.mts.map +1 -1
- package/dist/components/BadgeIcon/BadgeIcon.d.cts.map +1 -1
- package/dist/components/BadgeIcon/BadgeIcon.d.mts.map +1 -1
- package/dist/components/BadgeNetwork/BadgeNetwork.d.cts.map +1 -1
- package/dist/components/BadgeNetwork/BadgeNetwork.d.mts.map +1 -1
- package/dist/components/BadgeStatus/BadgeStatus.constants.cjs +1 -1
- package/dist/components/BadgeStatus/BadgeStatus.constants.cjs.map +1 -1
- package/dist/components/BadgeStatus/BadgeStatus.constants.mjs +1 -1
- package/dist/components/BadgeStatus/BadgeStatus.constants.mjs.map +1 -1
- package/dist/components/BadgeStatus/BadgeStatus.d.cts.map +1 -1
- package/dist/components/BadgeStatus/BadgeStatus.d.mts.map +1 -1
- package/dist/components/BadgeWrapper/BadgeWrapper.d.cts.map +1 -1
- package/dist/components/BadgeWrapper/BadgeWrapper.d.mts.map +1 -1
- package/dist/components/BannerAlert/BannerAlert.cjs.map +1 -1
- package/dist/components/BannerAlert/BannerAlert.mjs.map +1 -1
- package/dist/components/BannerBase/BannerBase.cjs +17 -7
- package/dist/components/BannerBase/BannerBase.cjs.map +1 -1
- package/dist/components/BannerBase/BannerBase.mjs.map +1 -1
- package/dist/components/BottomSheet/BottomSheet.cjs +17 -7
- package/dist/components/BottomSheet/BottomSheet.cjs.map +1 -1
- package/dist/components/BottomSheet/BottomSheet.d.cts +8 -8
- package/dist/components/BottomSheet/BottomSheet.d.cts.map +1 -1
- package/dist/components/BottomSheet/BottomSheet.d.mts +8 -8
- package/dist/components/BottomSheet/BottomSheet.d.mts.map +1 -1
- package/dist/components/BottomSheet/BottomSheet.mjs.map +1 -1
- package/dist/components/BottomSheetDialog/BottomSheetDialog.cjs +17 -7
- package/dist/components/BottomSheetDialog/BottomSheetDialog.cjs.map +1 -1
- package/dist/components/BottomSheetDialog/BottomSheetDialog.d.cts +6 -6
- package/dist/components/BottomSheetDialog/BottomSheetDialog.d.cts.map +1 -1
- package/dist/components/BottomSheetDialog/BottomSheetDialog.d.mts +6 -6
- package/dist/components/BottomSheetDialog/BottomSheetDialog.d.mts.map +1 -1
- package/dist/components/BottomSheetDialog/BottomSheetDialog.mjs.map +1 -1
- package/dist/components/BottomSheetFooter/BottomSheetFooter.cjs.map +1 -1
- package/dist/components/BottomSheetFooter/BottomSheetFooter.mjs.map +1 -1
- package/dist/components/BottomSheetOverlay/BottomSheetOverlay.cjs +17 -7
- package/dist/components/BottomSheetOverlay/BottomSheetOverlay.cjs.map +1 -1
- package/dist/components/Box/Box.cjs +17 -7
- package/dist/components/Box/Box.cjs.map +1 -1
- package/dist/components/Box/Box.d.cts +1 -1
- package/dist/components/Box/Box.d.mts +1 -1
- package/dist/components/BoxColumn/BoxColumn.cjs +13 -0
- package/dist/components/BoxColumn/BoxColumn.cjs.map +1 -1
- package/dist/components/BoxColumn/BoxColumn.d.cts +13 -0
- package/dist/components/BoxColumn/BoxColumn.d.cts.map +1 -1
- package/dist/components/BoxColumn/BoxColumn.d.mts +13 -0
- package/dist/components/BoxColumn/BoxColumn.d.mts.map +1 -1
- package/dist/components/BoxColumn/BoxColumn.mjs +13 -0
- package/dist/components/BoxColumn/BoxColumn.mjs.map +1 -1
- package/dist/components/BoxColumn/BoxColumn.types.cjs.map +1 -1
- package/dist/components/BoxColumn/BoxColumn.types.d.cts +2 -0
- package/dist/components/BoxColumn/BoxColumn.types.d.cts.map +1 -1
- package/dist/components/BoxColumn/BoxColumn.types.d.mts +2 -0
- package/dist/components/BoxColumn/BoxColumn.types.d.mts.map +1 -1
- package/dist/components/BoxColumn/BoxColumn.types.mjs.map +1 -1
- package/dist/components/BoxRow/BoxRow.cjs +13 -0
- package/dist/components/BoxRow/BoxRow.cjs.map +1 -1
- package/dist/components/BoxRow/BoxRow.d.cts +13 -0
- package/dist/components/BoxRow/BoxRow.d.cts.map +1 -1
- package/dist/components/BoxRow/BoxRow.d.mts +13 -0
- package/dist/components/BoxRow/BoxRow.d.mts.map +1 -1
- package/dist/components/BoxRow/BoxRow.mjs +13 -0
- package/dist/components/BoxRow/BoxRow.mjs.map +1 -1
- package/dist/components/BoxRow/BoxRow.types.cjs.map +1 -1
- package/dist/components/BoxRow/BoxRow.types.d.cts +2 -0
- package/dist/components/BoxRow/BoxRow.types.d.cts.map +1 -1
- package/dist/components/BoxRow/BoxRow.types.d.mts +2 -0
- package/dist/components/BoxRow/BoxRow.types.d.mts.map +1 -1
- package/dist/components/BoxRow/BoxRow.types.mjs.map +1 -1
- package/dist/components/Button/Button.cjs.map +1 -1
- package/dist/components/Button/Button.d.cts.map +1 -1
- package/dist/components/Button/Button.d.mts.map +1 -1
- package/dist/components/Button/Button.mjs.map +1 -1
- package/dist/components/Button/variants/ButtonPrimary/ButtonPrimary.cjs +17 -7
- package/dist/components/Button/variants/ButtonPrimary/ButtonPrimary.cjs.map +1 -1
- package/dist/components/Button/variants/ButtonPrimary/ButtonPrimary.d.cts.map +1 -1
- package/dist/components/Button/variants/ButtonPrimary/ButtonPrimary.d.mts.map +1 -1
- package/dist/components/Button/variants/ButtonPrimary/ButtonPrimary.mjs.map +1 -1
- package/dist/components/Button/variants/ButtonSecondary/ButtonSecondary.cjs +17 -7
- package/dist/components/Button/variants/ButtonSecondary/ButtonSecondary.cjs.map +1 -1
- package/dist/components/Button/variants/ButtonSecondary/ButtonSecondary.d.cts.map +1 -1
- package/dist/components/Button/variants/ButtonSecondary/ButtonSecondary.d.mts.map +1 -1
- package/dist/components/Button/variants/ButtonSecondary/ButtonSecondary.mjs.map +1 -1
- package/dist/components/Button/variants/ButtonTertiary/ButtonTertiary.cjs +17 -7
- package/dist/components/Button/variants/ButtonTertiary/ButtonTertiary.cjs.map +1 -1
- package/dist/components/Button/variants/ButtonTertiary/ButtonTertiary.d.cts.map +1 -1
- package/dist/components/Button/variants/ButtonTertiary/ButtonTertiary.d.mts.map +1 -1
- package/dist/components/Button/variants/ButtonTertiary/ButtonTertiary.mjs.map +1 -1
- package/dist/components/ButtonBase/ButtonBase.cjs +27 -13
- package/dist/components/ButtonBase/ButtonBase.cjs.map +1 -1
- package/dist/components/ButtonBase/ButtonBase.constants.cjs +2 -2
- package/dist/components/ButtonBase/ButtonBase.constants.cjs.map +1 -1
- package/dist/components/ButtonBase/ButtonBase.constants.d.cts.map +1 -1
- package/dist/components/ButtonBase/ButtonBase.constants.d.mts.map +1 -1
- package/dist/components/ButtonBase/ButtonBase.constants.mjs +2 -2
- package/dist/components/ButtonBase/ButtonBase.constants.mjs.map +1 -1
- package/dist/components/ButtonBase/ButtonBase.d.cts.map +1 -1
- package/dist/components/ButtonBase/ButtonBase.d.mts.map +1 -1
- package/dist/components/ButtonBase/ButtonBase.mjs +11 -7
- package/dist/components/ButtonBase/ButtonBase.mjs.map +1 -1
- package/dist/components/ButtonBase/ButtonBase.types.cjs.map +1 -1
- package/dist/components/ButtonBase/ButtonBase.types.d.cts +3 -4
- package/dist/components/ButtonBase/ButtonBase.types.d.cts.map +1 -1
- package/dist/components/ButtonBase/ButtonBase.types.d.mts +3 -4
- package/dist/components/ButtonBase/ButtonBase.types.d.mts.map +1 -1
- package/dist/components/ButtonBase/ButtonBase.types.mjs.map +1 -1
- package/dist/components/ButtonHero/ButtonHero.cjs.map +1 -1
- package/dist/components/ButtonHero/ButtonHero.mjs.map +1 -1
- package/dist/components/ButtonIcon/ButtonIcon.cjs +17 -7
- package/dist/components/ButtonIcon/ButtonIcon.cjs.map +1 -1
- package/dist/components/ButtonIcon/ButtonIcon.d.cts.map +1 -1
- package/dist/components/ButtonIcon/ButtonIcon.d.mts.map +1 -1
- package/dist/components/ButtonIcon/ButtonIcon.mjs.map +1 -1
- package/dist/components/ButtonSemantic/ButtonSemantic.cjs +17 -7
- package/dist/components/ButtonSemantic/ButtonSemantic.cjs.map +1 -1
- package/dist/components/ButtonSemantic/ButtonSemantic.d.cts.map +1 -1
- package/dist/components/ButtonSemantic/ButtonSemantic.d.mts.map +1 -1
- package/dist/components/Card/Card.cjs.map +1 -1
- package/dist/components/Card/Card.mjs.map +1 -1
- package/dist/components/Checkbox/Checkbox.cjs +17 -7
- package/dist/components/Checkbox/Checkbox.cjs.map +1 -1
- package/dist/components/Checkbox/Checkbox.d.cts +5 -6
- package/dist/components/Checkbox/Checkbox.d.cts.map +1 -1
- package/dist/components/Checkbox/Checkbox.d.mts +5 -6
- package/dist/components/Checkbox/Checkbox.d.mts.map +1 -1
- package/dist/components/Checkbox/Checkbox.mjs.map +1 -1
- package/dist/components/Content/Content.cjs +40 -32
- package/dist/components/Content/Content.cjs.map +1 -1
- package/dist/components/Content/Content.d.cts.map +1 -1
- package/dist/components/Content/Content.d.mts.map +1 -1
- package/dist/components/Content/Content.mjs +40 -32
- package/dist/components/Content/Content.mjs.map +1 -1
- package/dist/components/FilterButton/FilterButton.cjs +17 -7
- package/dist/components/FilterButton/FilterButton.cjs.map +1 -1
- package/dist/components/FilterButton/FilterButton.mjs.map +1 -1
- package/dist/components/FilterButtonGroup/FilterButtonGroup.cjs +17 -7
- package/dist/components/FilterButtonGroup/FilterButtonGroup.cjs.map +1 -1
- package/dist/components/HeaderBase/HeaderBase.cjs +17 -7
- package/dist/components/HeaderBase/HeaderBase.cjs.map +1 -1
- package/dist/components/HeaderBase/HeaderBase.mjs.map +1 -1
- package/dist/components/HeaderRoot/HeaderRoot.cjs +8 -5
- package/dist/components/HeaderRoot/HeaderRoot.cjs.map +1 -1
- package/dist/components/HeaderRoot/HeaderRoot.d.cts.map +1 -1
- package/dist/components/HeaderRoot/HeaderRoot.d.mts.map +1 -1
- package/dist/components/HeaderRoot/HeaderRoot.mjs +8 -5
- package/dist/components/HeaderRoot/HeaderRoot.mjs.map +1 -1
- package/dist/components/HeaderSearch/HeaderSearch.cjs.map +1 -1
- package/dist/components/HeaderSearch/HeaderSearch.mjs.map +1 -1
- package/dist/components/HeaderStandard/HeaderStandard.cjs +17 -7
- package/dist/components/HeaderStandard/HeaderStandard.cjs.map +1 -1
- package/dist/components/HeaderStandard/HeaderStandard.mjs.map +1 -1
- package/dist/components/HeaderStandardAnimated/HeaderStandardAnimated.cjs +17 -7
- package/dist/components/HeaderStandardAnimated/HeaderStandardAnimated.cjs.map +1 -1
- package/dist/components/HeaderStandardAnimated/useHeaderStandardAnimated.cjs +1 -2
- package/dist/components/HeaderStandardAnimated/useHeaderStandardAnimated.cjs.map +1 -1
- package/dist/components/HeaderSubpage/HeaderSubpage.cjs +17 -7
- package/dist/components/HeaderSubpage/HeaderSubpage.cjs.map +1 -1
- package/dist/components/HeaderSubpage/HeaderSubpage.mjs.map +1 -1
- package/dist/components/HelpText/HelpText.cjs.map +1 -1
- package/dist/components/HelpText/HelpText.mjs.map +1 -1
- package/dist/components/Icon/Icon.constants.cjs +4 -4
- package/dist/components/Icon/Icon.constants.cjs.map +1 -1
- package/dist/components/Icon/Icon.constants.mjs +4 -4
- package/dist/components/Icon/Icon.constants.mjs.map +1 -1
- package/dist/components/Icon/Icon.d.cts.map +1 -1
- package/dist/components/Icon/Icon.d.mts.map +1 -1
- package/dist/components/Icon/assets/musd-filled.svg +1 -1
- package/dist/components/Input/Input.cjs.map +1 -1
- package/dist/components/Input/Input.d.cts +1 -1
- package/dist/components/Input/Input.d.mts +1 -1
- package/dist/components/Input/Input.mjs.map +1 -1
- package/dist/components/KeyValueColumn/KeyValueColumn.cjs +21 -12
- package/dist/components/KeyValueColumn/KeyValueColumn.cjs.map +1 -1
- package/dist/components/KeyValueColumn/KeyValueColumn.d.cts.map +1 -1
- package/dist/components/KeyValueColumn/KeyValueColumn.d.mts.map +1 -1
- package/dist/components/KeyValueColumn/KeyValueColumn.mjs +22 -13
- package/dist/components/KeyValueColumn/KeyValueColumn.mjs.map +1 -1
- package/dist/components/KeyValueRow/KeyValueRow.cjs +19 -10
- package/dist/components/KeyValueRow/KeyValueRow.cjs.map +1 -1
- package/dist/components/KeyValueRow/KeyValueRow.d.cts.map +1 -1
- package/dist/components/KeyValueRow/KeyValueRow.d.mts.map +1 -1
- package/dist/components/KeyValueRow/KeyValueRow.mjs +20 -11
- package/dist/components/KeyValueRow/KeyValueRow.mjs.map +1 -1
- package/dist/components/KeyValueSelect/KeyValueSelect.cjs +17 -7
- package/dist/components/KeyValueSelect/KeyValueSelect.cjs.map +1 -1
- package/dist/components/KeyValueSelect/KeyValueSelect.d.cts +5 -5
- package/dist/components/KeyValueSelect/KeyValueSelect.d.mts +5 -5
- package/dist/components/KeyValueSelect/KeyValueSelect.mjs.map +1 -1
- package/dist/components/ListItem/ListItem.cjs +4 -3
- package/dist/components/ListItem/ListItem.cjs.map +1 -1
- package/dist/components/ListItem/ListItem.d.cts.map +1 -1
- package/dist/components/ListItem/ListItem.d.mts.map +1 -1
- package/dist/components/ListItem/ListItem.mjs +5 -4
- package/dist/components/ListItem/ListItem.mjs.map +1 -1
- package/dist/components/ListItemMultiSelect/ListItemMultiSelect.cjs.map +1 -1
- package/dist/components/ListItemMultiSelect/ListItemMultiSelect.mjs.map +1 -1
- package/dist/components/MainActionButton/MainActionButton.d.cts.map +1 -1
- package/dist/components/MainActionButton/MainActionButton.d.mts.map +1 -1
- package/dist/components/RadioButton/RadioButton.cjs.map +1 -1
- package/dist/components/RadioButton/RadioButton.d.cts.map +1 -1
- package/dist/components/RadioButton/RadioButton.d.mts.map +1 -1
- package/dist/components/RadioButton/RadioButton.mjs.map +1 -1
- package/dist/components/SectionDivider/SectionDivider.cjs +17 -7
- package/dist/components/SectionDivider/SectionDivider.cjs.map +1 -1
- package/dist/components/SectionDivider/SectionDivider.d.cts +1 -1
- package/dist/components/SectionDivider/SectionDivider.d.mts +1 -1
- package/dist/components/SectionDivider/SectionDivider.mjs.map +1 -1
- package/dist/components/SectionHeader/SectionHeader.cjs +17 -10
- package/dist/components/SectionHeader/SectionHeader.cjs.map +1 -1
- package/dist/components/SectionHeader/SectionHeader.d.cts +2 -2
- package/dist/components/SectionHeader/SectionHeader.d.cts.map +1 -1
- package/dist/components/SectionHeader/SectionHeader.d.mts +2 -2
- package/dist/components/SectionHeader/SectionHeader.d.mts.map +1 -1
- package/dist/components/SectionHeader/SectionHeader.mjs +18 -11
- package/dist/components/SectionHeader/SectionHeader.mjs.map +1 -1
- package/dist/components/SectionHeader/SectionHeader.types.cjs.map +1 -1
- package/dist/components/SectionHeader/SectionHeader.types.d.cts +5 -5
- package/dist/components/SectionHeader/SectionHeader.types.d.cts.map +1 -1
- package/dist/components/SectionHeader/SectionHeader.types.d.mts +5 -5
- package/dist/components/SectionHeader/SectionHeader.types.d.mts.map +1 -1
- package/dist/components/SectionHeader/SectionHeader.types.mjs.map +1 -1
- package/dist/components/SegmentedControl/SegmentedControl.cjs +17 -7
- package/dist/components/SegmentedControl/SegmentedControl.cjs.map +1 -1
- package/dist/components/SelectButton/SelectButton.cjs.map +1 -1
- package/dist/components/SelectButton/SelectButton.mjs.map +1 -1
- package/dist/components/SensitiveText/SensitiveText.cjs +17 -7
- package/dist/components/SensitiveText/SensitiveText.cjs.map +1 -1
- package/dist/components/SensitiveText/SensitiveText.mjs.map +1 -1
- package/dist/components/Skeleton/Skeleton.cjs +17 -7
- package/dist/components/Skeleton/Skeleton.cjs.map +1 -1
- package/dist/components/Skeleton/Skeleton.mjs.map +1 -1
- package/dist/components/Slider/Slider.cjs +17 -7
- package/dist/components/Slider/Slider.cjs.map +1 -1
- package/dist/components/Slider/Slider.constants.cjs +5 -6
- package/dist/components/Slider/Slider.constants.cjs.map +1 -1
- package/dist/components/Slider/Slider.constants.d.cts +5 -6
- package/dist/components/Slider/Slider.constants.d.cts.map +1 -1
- package/dist/components/Slider/Slider.constants.d.mts +5 -6
- package/dist/components/Slider/Slider.constants.d.mts.map +1 -1
- package/dist/components/Slider/Slider.constants.mjs +5 -6
- package/dist/components/Slider/Slider.constants.mjs.map +1 -1
- package/dist/components/Slider/Slider.mjs.map +1 -1
- package/dist/components/Slider/Slider.types.cjs.map +1 -1
- package/dist/components/Slider/Slider.types.d.cts +4 -5
- package/dist/components/Slider/Slider.types.d.cts.map +1 -1
- package/dist/components/Slider/Slider.types.d.mts +4 -5
- package/dist/components/Slider/Slider.types.d.mts.map +1 -1
- package/dist/components/Slider/Slider.types.mjs.map +1 -1
- package/dist/components/Slider/Slider.utilities.cjs +55 -26
- package/dist/components/Slider/Slider.utilities.cjs.map +1 -1
- package/dist/components/Slider/Slider.utilities.d.cts +24 -3
- package/dist/components/Slider/Slider.utilities.d.cts.map +1 -1
- package/dist/components/Slider/Slider.utilities.d.mts +24 -3
- package/dist/components/Slider/Slider.utilities.d.mts.map +1 -1
- package/dist/components/Slider/Slider.utilities.mjs +38 -8
- package/dist/components/Slider/Slider.utilities.mjs.map +1 -1
- package/dist/components/Slider/useSliderGesture.cjs +1 -2
- package/dist/components/Slider/useSliderGesture.cjs.map +1 -1
- package/dist/components/Slider/useSliderGesture.mjs.map +1 -1
- package/dist/components/Spinner/Spinner.cjs +95 -0
- package/dist/components/Spinner/Spinner.cjs.map +1 -0
- package/dist/components/Spinner/Spinner.d.cts.map +1 -0
- package/dist/components/Spinner/Spinner.d.mts.map +1 -0
- package/dist/components/Spinner/Spinner.mjs +65 -0
- package/dist/components/Spinner/Spinner.mjs.map +1 -0
- package/dist/components/Spinner/Spinner.types.cjs.map +1 -0
- package/dist/components/{temp-components/Spinner → Spinner}/Spinner.types.d.cts +2 -2
- package/dist/components/Spinner/Spinner.types.d.cts.map +1 -0
- package/dist/components/{temp-components/Spinner → Spinner}/Spinner.types.d.mts +2 -2
- package/dist/components/Spinner/Spinner.types.d.mts.map +1 -0
- package/dist/components/Spinner/Spinner.types.mjs.map +1 -0
- package/dist/components/Spinner/index.cjs.map +1 -0
- package/dist/components/Spinner/index.d.cts.map +1 -0
- package/dist/components/Spinner/index.d.mts.map +1 -0
- package/dist/components/Spinner/index.mjs.map +1 -0
- package/dist/components/Switch/Switch.d.cts.map +1 -1
- package/dist/components/Switch/Switch.d.mts.map +1 -1
- package/dist/components/TabEmptyState/TabEmptyState.d.cts.map +1 -1
- package/dist/components/TabEmptyState/TabEmptyState.d.mts.map +1 -1
- package/dist/components/Tag/Tag.cjs +12 -18
- package/dist/components/Tag/Tag.cjs.map +1 -1
- package/dist/components/Tag/Tag.d.cts.map +1 -1
- package/dist/components/Tag/Tag.d.mts.map +1 -1
- package/dist/components/Tag/Tag.mjs +13 -19
- package/dist/components/Tag/Tag.mjs.map +1 -1
- package/dist/components/Text/Text.cjs +17 -7
- package/dist/components/Text/Text.cjs.map +1 -1
- package/dist/components/TextArea/TextArea.cjs.map +1 -1
- package/dist/components/TextArea/TextArea.d.cts +131 -130
- package/dist/components/TextArea/TextArea.d.cts.map +1 -1
- package/dist/components/TextArea/TextArea.d.mts +131 -130
- package/dist/components/TextArea/TextArea.d.mts.map +1 -1
- package/dist/components/TextArea/TextArea.mjs.map +1 -1
- package/dist/components/TextButton/TextButton.cjs +17 -7
- package/dist/components/TextButton/TextButton.cjs.map +1 -1
- package/dist/components/TextButton/TextButton.mjs.map +1 -1
- package/dist/components/TextField/TextField.cjs.map +1 -1
- package/dist/components/TextField/TextField.d.cts +136 -135
- package/dist/components/TextField/TextField.d.cts.map +1 -1
- package/dist/components/TextField/TextField.d.mts +136 -135
- package/dist/components/TextField/TextField.d.mts.map +1 -1
- package/dist/components/TextField/TextField.mjs.map +1 -1
- package/dist/components/TextFieldSearch/TextFieldSearch.cjs +17 -7
- package/dist/components/TextFieldSearch/TextFieldSearch.cjs.map +1 -1
- package/dist/components/TextFieldSearch/TextFieldSearch.d.cts +136 -136
- package/dist/components/TextFieldSearch/TextFieldSearch.d.cts.map +1 -1
- package/dist/components/TextFieldSearch/TextFieldSearch.d.mts +136 -136
- package/dist/components/TextFieldSearch/TextFieldSearch.d.mts.map +1 -1
- package/dist/components/TextFieldSearch/TextFieldSearch.mjs.map +1 -1
- package/dist/components/TitleAlert/TitleAlert.cjs +20 -18
- package/dist/components/TitleAlert/TitleAlert.cjs.map +1 -1
- package/dist/components/TitleAlert/TitleAlert.d.cts +3 -3
- package/dist/components/TitleAlert/TitleAlert.d.cts.map +1 -1
- package/dist/components/TitleAlert/TitleAlert.d.mts +3 -3
- package/dist/components/TitleAlert/TitleAlert.d.mts.map +1 -1
- package/dist/components/TitleAlert/TitleAlert.mjs +21 -19
- package/dist/components/TitleAlert/TitleAlert.mjs.map +1 -1
- package/dist/components/TitleAlert/TitleAlert.types.cjs.map +1 -1
- package/dist/components/TitleAlert/TitleAlert.types.d.cts +6 -7
- package/dist/components/TitleAlert/TitleAlert.types.d.cts.map +1 -1
- package/dist/components/TitleAlert/TitleAlert.types.d.mts +6 -7
- package/dist/components/TitleAlert/TitleAlert.types.d.mts.map +1 -1
- package/dist/components/TitleAlert/TitleAlert.types.mjs.map +1 -1
- package/dist/components/TitleHub/TitleHub.cjs +22 -13
- package/dist/components/TitleHub/TitleHub.cjs.map +1 -1
- package/dist/components/TitleHub/TitleHub.d.cts +3 -3
- package/dist/components/TitleHub/TitleHub.d.cts.map +1 -1
- package/dist/components/TitleHub/TitleHub.d.mts +3 -3
- package/dist/components/TitleHub/TitleHub.d.mts.map +1 -1
- package/dist/components/TitleHub/TitleHub.mjs +23 -14
- package/dist/components/TitleHub/TitleHub.mjs.map +1 -1
- package/dist/components/TitleHub/TitleHub.types.cjs.map +1 -1
- package/dist/components/TitleHub/TitleHub.types.d.cts +10 -10
- package/dist/components/TitleHub/TitleHub.types.d.cts.map +1 -1
- package/dist/components/TitleHub/TitleHub.types.d.mts +10 -10
- package/dist/components/TitleHub/TitleHub.types.d.mts.map +1 -1
- package/dist/components/TitleHub/TitleHub.types.mjs.map +1 -1
- package/dist/components/TitleStandard/TitleStandard.cjs +15 -9
- package/dist/components/TitleStandard/TitleStandard.cjs.map +1 -1
- package/dist/components/TitleStandard/TitleStandard.d.cts +2 -2
- package/dist/components/TitleStandard/TitleStandard.d.cts.map +1 -1
- package/dist/components/TitleStandard/TitleStandard.d.mts +2 -2
- package/dist/components/TitleStandard/TitleStandard.d.mts.map +1 -1
- package/dist/components/TitleStandard/TitleStandard.mjs +16 -10
- package/dist/components/TitleStandard/TitleStandard.mjs.map +1 -1
- package/dist/components/TitleStandard/TitleStandard.types.cjs.map +1 -1
- package/dist/components/TitleStandard/TitleStandard.types.d.cts +7 -7
- package/dist/components/TitleStandard/TitleStandard.types.d.cts.map +1 -1
- package/dist/components/TitleStandard/TitleStandard.types.d.mts +7 -7
- package/dist/components/TitleStandard/TitleStandard.types.d.mts.map +1 -1
- package/dist/components/TitleStandard/TitleStandard.types.mjs.map +1 -1
- package/dist/components/TitleSubpage/TitleSubpage.cjs +31 -18
- package/dist/components/TitleSubpage/TitleSubpage.cjs.map +1 -1
- package/dist/components/TitleSubpage/TitleSubpage.d.cts +3 -3
- package/dist/components/TitleSubpage/TitleSubpage.d.cts.map +1 -1
- package/dist/components/TitleSubpage/TitleSubpage.d.mts +3 -3
- package/dist/components/TitleSubpage/TitleSubpage.d.mts.map +1 -1
- package/dist/components/TitleSubpage/TitleSubpage.mjs +32 -19
- package/dist/components/TitleSubpage/TitleSubpage.mjs.map +1 -1
- package/dist/components/TitleSubpage/TitleSubpage.types.cjs.map +1 -1
- package/dist/components/TitleSubpage/TitleSubpage.types.d.cts +8 -9
- package/dist/components/TitleSubpage/TitleSubpage.types.d.cts.map +1 -1
- package/dist/components/TitleSubpage/TitleSubpage.types.d.mts +8 -9
- package/dist/components/TitleSubpage/TitleSubpage.types.d.mts.map +1 -1
- package/dist/components/TitleSubpage/TitleSubpage.types.mjs.map +1 -1
- package/dist/components/Toast/Toast.cjs.map +1 -1
- package/dist/components/Toast/Toast.mjs.map +1 -1
- package/dist/components/Toast/Toaster.cjs +17 -7
- package/dist/components/Toast/Toaster.cjs.map +1 -1
- package/dist/components/Toast/Toaster.d.cts +1 -1
- package/dist/components/Toast/Toaster.d.cts.map +1 -1
- package/dist/components/Toast/Toaster.d.mts +1 -1
- package/dist/components/Toast/Toaster.d.mts.map +1 -1
- package/dist/components/Toast/Toaster.mjs.map +1 -1
- package/dist/components/index.cjs +1 -1
- package/dist/components/index.cjs.map +1 -1
- package/dist/components/index.d.cts +2 -2
- package/dist/components/index.d.cts.map +1 -1
- package/dist/components/index.d.mts +2 -2
- package/dist/components/index.d.mts.map +1 -1
- package/dist/components/index.mjs +1 -1
- package/dist/components/index.mjs.map +1 -1
- package/dist/components/temp-components/Blockies/Blockies.d.cts.map +1 -1
- package/dist/components/temp-components/Blockies/Blockies.d.mts.map +1 -1
- package/dist/components/temp-components/Blockies/Blockies.utilities.cjs +2 -2
- package/dist/components/temp-components/Blockies/Blockies.utilities.cjs.map +1 -1
- package/dist/components/temp-components/Blockies/Blockies.utilities.mjs.map +1 -1
- package/dist/components/temp-components/ButtonAnimated/ButtonAnimated.cjs +17 -7
- package/dist/components/temp-components/ButtonAnimated/ButtonAnimated.cjs.map +1 -1
- package/dist/components/temp-components/ButtonAnimated/ButtonAnimated.d.cts.map +1 -1
- package/dist/components/temp-components/ButtonAnimated/ButtonAnimated.d.mts.map +1 -1
- package/dist/components/temp-components/HeaderStandardCenterColumn/HeaderStandardCenterColumn.cjs +10 -9
- package/dist/components/temp-components/HeaderStandardCenterColumn/HeaderStandardCenterColumn.cjs.map +1 -1
- package/dist/components/temp-components/HeaderStandardCenterColumn/HeaderStandardCenterColumn.d.cts.map +1 -1
- package/dist/components/temp-components/HeaderStandardCenterColumn/HeaderStandardCenterColumn.d.mts.map +1 -1
- package/dist/components/temp-components/HeaderStandardCenterColumn/HeaderStandardCenterColumn.mjs +10 -8
- package/dist/components/temp-components/HeaderStandardCenterColumn/HeaderStandardCenterColumn.mjs.map +1 -1
- package/dist/components/temp-components/HeaderStandardCenterColumn/HeaderStandardCenterColumn.types.cjs +0 -5
- package/dist/components/temp-components/HeaderStandardCenterColumn/HeaderStandardCenterColumn.types.cjs.map +1 -1
- package/dist/components/temp-components/ImageOrSvg/ImageOrSvg.cjs +17 -7
- package/dist/components/temp-components/ImageOrSvg/ImageOrSvg.cjs.map +1 -1
- package/dist/components/temp-components/ImageOrSvg/ImageOrSvg.d.cts.map +1 -1
- package/dist/components/temp-components/ImageOrSvg/ImageOrSvg.d.mts.map +1 -1
- package/dist/components/temp-components/ImageOrSvg/ImageOrSvg.mjs.map +1 -1
- package/dist/components/temp-components/Jazzicon/Jazzicon.cjs +1 -1
- package/dist/components/temp-components/Jazzicon/Jazzicon.cjs.map +1 -1
- package/dist/components/temp-components/Jazzicon/Jazzicon.d.cts.map +1 -1
- package/dist/components/temp-components/Jazzicon/Jazzicon.d.mts.map +1 -1
- package/dist/components/temp-components/Jazzicon/Jazzicon.mjs +1 -1
- package/dist/components/temp-components/Jazzicon/Jazzicon.mjs.map +1 -1
- package/dist/components/temp-components/Maskicon/Maskicon.cjs +17 -7
- package/dist/components/temp-components/Maskicon/Maskicon.cjs.map +1 -1
- package/dist/components/temp-components/Maskicon/Maskicon.d.cts.map +1 -1
- package/dist/components/temp-components/Maskicon/Maskicon.d.mts.map +1 -1
- package/dist/components/temp-components/Maskicon/Maskicon.mjs.map +1 -1
- package/dist/components/temp-components/Maskicon/Maskicon.utilities.cjs +4 -5
- package/dist/components/temp-components/Maskicon/Maskicon.utilities.cjs.map +1 -1
- package/dist/components/temp-components/Maskicon/Maskicon.utilities.mjs.map +1 -1
- package/dist/components/temp-components/TextOrChildren/TextOrChildren.cjs +1 -1
- package/dist/components/temp-components/TextOrChildren/TextOrChildren.cjs.map +1 -1
- package/dist/components/temp-components/TextOrChildren/TextOrChildren.d.cts.map +1 -1
- package/dist/components/temp-components/TextOrChildren/TextOrChildren.d.mts.map +1 -1
- package/dist/components/temp-components/TextOrChildren/TextOrChildren.mjs +1 -1
- package/dist/components/temp-components/TextOrChildren/TextOrChildren.mjs.map +1 -1
- package/dist/components/temp-components/TextOrChildren/TextOrChildren.types.cjs.map +1 -1
- package/dist/components/temp-components/TextOrChildren/TextOrChildren.types.d.cts +1 -1
- package/dist/components/temp-components/TextOrChildren/TextOrChildren.types.d.mts +1 -1
- package/dist/components/temp-components/TextOrChildren/TextOrChildren.types.mjs.map +1 -1
- package/dist/test-utils/createRenderer.cjs +17 -11
- package/dist/test-utils/createRenderer.cjs.map +1 -1
- package/dist/test-utils/createRenderer.d.cts.map +1 -1
- package/dist/test-utils/createRenderer.d.mts.map +1 -1
- package/package.json +5 -5
- package/dist/components/temp-components/Spinner/Spinner.cjs +0 -68
- package/dist/components/temp-components/Spinner/Spinner.cjs.map +0 -1
- package/dist/components/temp-components/Spinner/Spinner.d.cts.map +0 -1
- package/dist/components/temp-components/Spinner/Spinner.d.mts.map +0 -1
- package/dist/components/temp-components/Spinner/Spinner.mjs +0 -48
- package/dist/components/temp-components/Spinner/Spinner.mjs.map +0 -1
- package/dist/components/temp-components/Spinner/Spinner.types.cjs.map +0 -1
- package/dist/components/temp-components/Spinner/Spinner.types.d.cts.map +0 -1
- package/dist/components/temp-components/Spinner/Spinner.types.d.mts.map +0 -1
- package/dist/components/temp-components/Spinner/Spinner.types.mjs.map +0 -1
- package/dist/components/temp-components/Spinner/index.cjs.map +0 -1
- package/dist/components/temp-components/Spinner/index.d.cts.map +0 -1
- package/dist/components/temp-components/Spinner/index.d.mts.map +0 -1
- package/dist/components/temp-components/Spinner/index.mjs.map +0 -1
- /package/dist/components/{temp-components/Spinner → Spinner}/Spinner.d.cts +0 -0
- /package/dist/components/{temp-components/Spinner → Spinner}/Spinner.d.mts +0 -0
- /package/dist/components/{temp-components/Spinner → Spinner}/Spinner.types.cjs +0 -0
- /package/dist/components/{temp-components/Spinner → Spinner}/Spinner.types.mjs +0 -0
- /package/dist/components/{temp-components/Spinner → Spinner}/index.cjs +0 -0
- /package/dist/components/{temp-components/Spinner → Spinner}/index.d.cts +0 -0
- /package/dist/components/{temp-components/Spinner → Spinner}/index.d.mts +0 -0
- /package/dist/components/{temp-components/Spinner → Spinner}/index.mjs +0 -0
|
@@ -5,22 +5,22 @@ function $importDefault(module) {
|
|
|
5
5
|
return module;
|
|
6
6
|
}
|
|
7
7
|
// Third party dependencies.
|
|
8
|
-
import { FontWeight, TextColor, TextVariant } from "@metamask-previews/design-system-shared";
|
|
8
|
+
import { BoxAlignItems, BoxFlexDirection, FontWeight, TextColor, TextVariant } from "@metamask-previews/design-system-shared";
|
|
9
9
|
import $React from "react";
|
|
10
10
|
const React = $importDefault($React);
|
|
11
11
|
// Internal dependencies.
|
|
12
12
|
import { Box } from "../Box/index.mjs";
|
|
13
|
-
import {
|
|
13
|
+
import { TextOrChildren } from "../temp-components/TextOrChildren/index.mjs";
|
|
14
14
|
/**
|
|
15
15
|
* Displays a required identity row (avatar + title stack) with optional subtitle, amount, inline accessories, and bottom rows in a left-aligned layout.
|
|
16
16
|
* Remaining `View` props are forwarded to the root `Box`.
|
|
17
17
|
*
|
|
18
18
|
* @param props - Component props
|
|
19
19
|
* @param props.title - Title row content (required)
|
|
20
|
-
* @param props.titleAvatar - Leading visual for the identity row (required);
|
|
21
|
-
* @param props.identityRowProps - Optional props spread onto the identity `
|
|
20
|
+
* @param props.titleAvatar - Leading visual for the identity row (required); rendered as the first child of the identity row so callers control layout and composition (for example badges that extend past the token)
|
|
21
|
+
* @param props.identityRowProps - Optional props spread onto the identity row `Box` after defaults (`children` is reserved)
|
|
22
22
|
* @param props.titleColumnProps - Optional props spread onto the title/subtitle column `Box` (`children` is reserved)
|
|
23
|
-
* @param props.bottomLabelWrapperProps - Optional props spread onto the bottom label `
|
|
23
|
+
* @param props.bottomLabelWrapperProps - Optional props spread onto the bottom label row `Box` after defaults (`children` is reserved)
|
|
24
24
|
* @param props.titleEndAccessory - Optional inline accessory to the right of `title`
|
|
25
25
|
* @param props.subtitle - Optional subtitle row below the title and above the amount
|
|
26
26
|
* @param props.subtitleEndAccessory - Optional inline accessory to the right of `subtitle`
|
|
@@ -40,44 +40,57 @@ import { BoxRow } from "../BoxRow/index.mjs";
|
|
|
40
40
|
export const TitleSubpage = ({ amount, amountEndAccessory, title, titleAvatar, titleEndAccessory, subtitle, subtitleEndAccessory, bottomAccessory, bottomLabel, bottomLabelEndAccessory, amountProps, titleProps, subtitleProps, bottomLabelProps, identityRowProps, titleColumnProps, bottomLabelWrapperProps, twClassName = '', ...props }) => {
|
|
41
41
|
return (<Box twClassName={twClassName} gap={1} {...props}>
|
|
42
42
|
{/* Identity Row */}
|
|
43
|
-
<
|
|
43
|
+
<Box flexDirection={BoxFlexDirection.Row} alignItems={BoxAlignItems.Center} gap={4} twClassName="h-14" {...identityRowProps}>
|
|
44
|
+
{titleAvatar}
|
|
44
45
|
{/* Title and Subtitle Column */}
|
|
45
46
|
<Box {...titleColumnProps}>
|
|
46
47
|
{/* Title Row */}
|
|
47
|
-
{title && (<
|
|
48
|
+
{title && (<Box flexDirection={BoxFlexDirection.Row} alignItems={BoxAlignItems.Center} gap={1}>
|
|
49
|
+
<TextOrChildren textProps={{
|
|
48
50
|
variant: TextVariant.HeadingSm,
|
|
49
51
|
color: TextColor.TextDefault,
|
|
50
52
|
...titleProps,
|
|
51
53
|
}}>
|
|
52
|
-
|
|
53
|
-
|
|
54
|
+
{title}
|
|
55
|
+
</TextOrChildren>
|
|
56
|
+
{titleEndAccessory}
|
|
57
|
+
</Box>)}
|
|
54
58
|
{/* Subtitle Row */}
|
|
55
|
-
{subtitle && (<
|
|
59
|
+
{subtitle && (<Box flexDirection={BoxFlexDirection.Row} alignItems={BoxAlignItems.Center} gap={1}>
|
|
60
|
+
<TextOrChildren textProps={{
|
|
56
61
|
variant: TextVariant.BodySm,
|
|
57
62
|
fontWeight: FontWeight.Medium,
|
|
58
63
|
color: TextColor.TextAlternative,
|
|
59
64
|
...subtitleProps,
|
|
60
65
|
}}>
|
|
61
|
-
|
|
62
|
-
|
|
66
|
+
{subtitle}
|
|
67
|
+
</TextOrChildren>
|
|
68
|
+
{subtitleEndAccessory}
|
|
69
|
+
</Box>)}
|
|
63
70
|
</Box>
|
|
64
|
-
</
|
|
71
|
+
</Box>
|
|
65
72
|
{/* Amount Row */}
|
|
66
|
-
{amount && (<
|
|
73
|
+
{amount && (<Box flexDirection={BoxFlexDirection.Row} alignItems={BoxAlignItems.Center} gap={1}>
|
|
74
|
+
<TextOrChildren textProps={{
|
|
67
75
|
variant: TextVariant.DisplayLg,
|
|
68
76
|
...amountProps,
|
|
69
77
|
}}>
|
|
70
|
-
|
|
71
|
-
|
|
78
|
+
{amount}
|
|
79
|
+
</TextOrChildren>
|
|
80
|
+
{amountEndAccessory}
|
|
81
|
+
</Box>)}
|
|
72
82
|
{/* Bottom Label Row */}
|
|
73
|
-
{bottomLabel && (<
|
|
83
|
+
{bottomLabel && (<Box flexDirection={BoxFlexDirection.Row} alignItems={BoxAlignItems.Center} gap={1} {...bottomLabelWrapperProps}>
|
|
84
|
+
<TextOrChildren textProps={{
|
|
74
85
|
variant: TextVariant.BodySm,
|
|
75
86
|
fontWeight: FontWeight.Medium,
|
|
76
87
|
color: TextColor.TextAlternative,
|
|
77
88
|
...bottomLabelProps,
|
|
78
89
|
}}>
|
|
79
|
-
|
|
80
|
-
|
|
90
|
+
{bottomLabel}
|
|
91
|
+
</TextOrChildren>
|
|
92
|
+
{bottomLabelEndAccessory}
|
|
93
|
+
</Box>)}
|
|
81
94
|
{!bottomLabel && bottomAccessory}
|
|
82
95
|
</Box>);
|
|
83
96
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TitleSubpage.mjs","sourceRoot":"","sources":["../../../src/components/TitleSubpage/TitleSubpage.tsx"],"names":[],"mappings":";;;;;;AAAA,4BAA4B;AAC5B,OAAO,EACL,UAAU,EACV,SAAS,EACT,WAAW,EACZ,gDAAgD;AACjD,OAAO,MAAK,cAAc;;AAE1B,yBAAyB;AACzB,OAAO,EAAE,GAAG,EAAE,yBAAe;AAC7B,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"TitleSubpage.mjs","sourceRoot":"","sources":["../../../src/components/TitleSubpage/TitleSubpage.tsx"],"names":[],"mappings":";;;;;;AAAA,4BAA4B;AAC5B,OAAO,EACL,aAAa,EACb,gBAAgB,EAChB,UAAU,EACV,SAAS,EACT,WAAW,EACZ,gDAAgD;AACjD,OAAO,MAAK,cAAc;;AAE1B,yBAAyB;AACzB,OAAO,EAAE,GAAG,EAAE,yBAAe;AAC7B,OAAO,EAAE,cAAc,EAAE,oDAA0C;AAInE;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,CAAC,MAAM,YAAY,GAAgC,CAAC,EACxD,MAAM,EACN,kBAAkB,EAClB,KAAK,EACL,WAAW,EACX,iBAAiB,EACjB,QAAQ,EACR,oBAAoB,EACpB,eAAe,EACf,WAAW,EACX,uBAAuB,EACvB,WAAW,EACX,UAAU,EACV,aAAa,EACb,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,uBAAuB,EACvB,WAAW,GAAG,EAAE,EAChB,GAAG,KAAK,EACT,EAAE,EAAE;IACH,OAAO,CACL,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,WAAW,CAAC,CAAC,GAAG,C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AC;AAEF,YAAY,CAAC,WAAW,GAAG,cAAc,CAAC","sourcesContent":["// Third party dependencies.\nimport {\n BoxAlignItems,\n BoxFlexDirection,\n FontWeight,\n TextColor,\n TextVariant,\n} from '@metamask-previews/design-system-shared';\nimport React from 'react';\n\n// Internal dependencies.\nimport { Box } from '../Box';\nimport { TextOrChildren } from '../temp-components/TextOrChildren';\n\nimport type { TitleSubpageProps } from './TitleSubpage.types';\n\n/**\n * Displays a required identity row (avatar + title stack) with optional subtitle, amount, inline accessories, and bottom rows in a left-aligned layout.\n * Remaining `View` props are forwarded to the root `Box`.\n *\n * @param props - Component props\n * @param props.title - Title row content (required)\n * @param props.titleAvatar - Leading visual for the identity row (required); rendered as the first child of the identity row so callers control layout and composition (for example badges that extend past the token)\n * @param props.identityRowProps - Optional props spread onto the identity row `Box` after defaults (`children` is reserved)\n * @param props.titleColumnProps - Optional props spread onto the title/subtitle column `Box` (`children` is reserved)\n * @param props.bottomLabelWrapperProps - Optional props spread onto the bottom label row `Box` after defaults (`children` is reserved)\n * @param props.titleEndAccessory - Optional inline accessory to the right of `title`\n * @param props.subtitle - Optional subtitle row below the title and above the amount\n * @param props.subtitleEndAccessory - Optional inline accessory to the right of `subtitle`\n * @param props.amount - Optional primary amount below the title\n * @param props.amountEndAccessory - Optional inline accessory to the right of the amount\n * @param props.bottomAccessory - Optional custom bottom row when the bottom label row is not shown\n * @param props.bottomLabel - Optional secondary label below the amount row\n * @param props.bottomLabelEndAccessory - Optional inline accessory to the right of `bottomLabel`\n * @param props.titleProps - Optional props merged into title row `Text` when `title` is a string\n * @param props.subtitleProps - Optional props merged into subtitle row `Text` when `subtitle` is a string\n * @param props.amountProps - Optional props merged into amount `Text` when `amount` is a string\n * @param props.bottomLabelProps - Optional props merged into bottom label `Text` when `bottomLabel` is a string\n * @param props.twClassName - Optional Tailwind classes on the root container\n *\n * @returns The rendered TitleSubpage layout.\n */\nexport const TitleSubpage: React.FC<TitleSubpageProps> = ({\n amount,\n amountEndAccessory,\n title,\n titleAvatar,\n titleEndAccessory,\n subtitle,\n subtitleEndAccessory,\n bottomAccessory,\n bottomLabel,\n bottomLabelEndAccessory,\n amountProps,\n titleProps,\n subtitleProps,\n bottomLabelProps,\n identityRowProps,\n titleColumnProps,\n bottomLabelWrapperProps,\n twClassName = '',\n ...props\n}) => {\n return (\n <Box twClassName={twClassName} gap={1} {...props}>\n {/* Identity Row */}\n <Box\n flexDirection={BoxFlexDirection.Row}\n alignItems={BoxAlignItems.Center}\n gap={4}\n twClassName=\"h-14\"\n {...identityRowProps}\n >\n {titleAvatar}\n {/* Title and Subtitle Column */}\n <Box {...titleColumnProps}>\n {/* Title Row */}\n {title && (\n <Box\n flexDirection={BoxFlexDirection.Row}\n alignItems={BoxAlignItems.Center}\n gap={1}\n >\n <TextOrChildren\n textProps={{\n variant: TextVariant.HeadingSm,\n color: TextColor.TextDefault,\n ...titleProps,\n }}\n >\n {title}\n </TextOrChildren>\n {titleEndAccessory}\n </Box>\n )}\n {/* Subtitle Row */}\n {subtitle && (\n <Box\n flexDirection={BoxFlexDirection.Row}\n alignItems={BoxAlignItems.Center}\n gap={1}\n >\n <TextOrChildren\n textProps={{\n variant: TextVariant.BodySm,\n fontWeight: FontWeight.Medium,\n color: TextColor.TextAlternative,\n ...subtitleProps,\n }}\n >\n {subtitle}\n </TextOrChildren>\n {subtitleEndAccessory}\n </Box>\n )}\n </Box>\n </Box>\n {/* Amount Row */}\n {amount && (\n <Box\n flexDirection={BoxFlexDirection.Row}\n alignItems={BoxAlignItems.Center}\n gap={1}\n >\n <TextOrChildren\n textProps={{\n variant: TextVariant.DisplayLg,\n ...amountProps,\n }}\n >\n {amount}\n </TextOrChildren>\n {amountEndAccessory}\n </Box>\n )}\n {/* Bottom Label Row */}\n {bottomLabel && (\n <Box\n flexDirection={BoxFlexDirection.Row}\n alignItems={BoxAlignItems.Center}\n gap={1}\n {...bottomLabelWrapperProps}\n >\n <TextOrChildren\n textProps={{\n variant: TextVariant.BodySm,\n fontWeight: FontWeight.Medium,\n color: TextColor.TextAlternative,\n ...bottomLabelProps,\n }}\n >\n {bottomLabel}\n </TextOrChildren>\n {bottomLabelEndAccessory}\n </Box>\n )}\n {!bottomLabel && bottomAccessory}\n </Box>\n );\n};\n\nTitleSubpage.displayName = 'TitleSubpage';\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TitleSubpage.types.cjs","sourceRoot":"","sources":["../../../src/components/TitleSubpage/TitleSubpage.types.ts"],"names":[],"mappings":"","sourcesContent":["// Third party dependencies.\nimport type { TitleSubpagePropsShared } from '@metamask-previews/design-system-shared';\nimport type { ViewProps } from 'react-native';\n\n// Internal dependencies.\nimport type { BoxProps } from '../Box/Box.types';\nimport type {
|
|
1
|
+
{"version":3,"file":"TitleSubpage.types.cjs","sourceRoot":"","sources":["../../../src/components/TitleSubpage/TitleSubpage.types.ts"],"names":[],"mappings":"","sourcesContent":["// Third party dependencies.\nimport type { TitleSubpagePropsShared } from '@metamask-previews/design-system-shared';\nimport type { ViewProps } from 'react-native';\n\n// Internal dependencies.\nimport type { BoxProps } from '../Box/Box.types';\nimport type { TextProps } from '../Text/Text.types';\n\n/**\n * TitleSubpage component props (React Native).\n * Extends {@link TitleSubpagePropsShared} (requires `title` and `titleAvatar`) with platform `Text` passthroughs, `twClassName`, and `View` props.\n */\nexport type TitleSubpageProps = TitleSubpagePropsShared & {\n /**\n * Optional props spread onto the identity row {@link Box} (a row with centered items, `gap={4}`, and `h-14` by default; values here override those defaults). Excludes `children`, which the component owns.\n */\n identityRowProps?: Omit<Partial<BoxProps>, 'children'>;\n /**\n * Optional props spread onto the title/subtitle column {@link Box} (excluding `children`, which the component owns).\n */\n titleColumnProps?: Omit<Partial<BoxProps>, 'children'>;\n /**\n * Optional props spread onto the bottom label row {@link Box} (a row with centered items and `gap={1}` by default; values here override those defaults). Excludes `children`, which the component owns.\n */\n bottomLabelWrapperProps?: Omit<Partial<BoxProps>, 'children'>;\n /**\n * Optional props merged into the amount `Text` when `amount` is a string.\n */\n amountProps?: Omit<Partial<TextProps>, 'children'>;\n /**\n * Optional props merged into the title `Text` when `title` is a string.\n */\n titleProps?: Omit<Partial<TextProps>, 'children'>;\n /**\n * Optional props merged into the subtitle `Text` when `subtitle` is a string.\n */\n subtitleProps?: Omit<Partial<TextProps>, 'children'>;\n /**\n * Optional props merged into the bottom label `Text` when `bottomLabel` is a string.\n */\n bottomLabelProps?: Omit<Partial<TextProps>, 'children'>;\n /**\n * Optional Tailwind class name to apply to the container.\n */\n twClassName?: string;\n} & Omit<ViewProps, 'children'>;\n"]}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { TitleSubpagePropsShared } from "@metamask-previews/design-system-shared";
|
|
2
2
|
import type { ViewProps } 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 { TextProps } from "../Text/Text.types.cjs";
|
|
6
5
|
/**
|
|
7
6
|
* TitleSubpage component props (React Native).
|
|
@@ -9,31 +8,31 @@ import type { TextProps } from "../Text/Text.types.cjs";
|
|
|
9
8
|
*/
|
|
10
9
|
export type TitleSubpageProps = TitleSubpagePropsShared & {
|
|
11
10
|
/**
|
|
12
|
-
* Optional props spread onto the identity {@link
|
|
11
|
+
* Optional props spread onto the identity row {@link Box} (a row with centered items, `gap={4}`, and `h-14` by default; values here override those defaults). Excludes `children`, which the component owns.
|
|
13
12
|
*/
|
|
14
|
-
identityRowProps?: Omit<Partial<
|
|
13
|
+
identityRowProps?: Omit<Partial<BoxProps>, 'children'>;
|
|
15
14
|
/**
|
|
16
15
|
* Optional props spread onto the title/subtitle column {@link Box} (excluding `children`, which the component owns).
|
|
17
16
|
*/
|
|
18
17
|
titleColumnProps?: Omit<Partial<BoxProps>, 'children'>;
|
|
19
18
|
/**
|
|
20
|
-
* Optional props spread onto the bottom label {@link
|
|
19
|
+
* Optional props spread onto the bottom label row {@link Box} (a row with centered items and `gap={1}` by default; values here override those defaults). Excludes `children`, which the component owns.
|
|
21
20
|
*/
|
|
22
|
-
bottomLabelWrapperProps?: Omit<Partial<
|
|
21
|
+
bottomLabelWrapperProps?: Omit<Partial<BoxProps>, 'children'>;
|
|
23
22
|
/**
|
|
24
|
-
* Optional props merged into
|
|
23
|
+
* Optional props merged into the amount `Text` when `amount` is a string.
|
|
25
24
|
*/
|
|
26
25
|
amountProps?: Omit<Partial<TextProps>, 'children'>;
|
|
27
26
|
/**
|
|
28
|
-
* Optional props merged into
|
|
27
|
+
* Optional props merged into the title `Text` when `title` is a string.
|
|
29
28
|
*/
|
|
30
29
|
titleProps?: Omit<Partial<TextProps>, 'children'>;
|
|
31
30
|
/**
|
|
32
|
-
* Optional props merged into
|
|
31
|
+
* Optional props merged into the subtitle `Text` when `subtitle` is a string.
|
|
33
32
|
*/
|
|
34
33
|
subtitleProps?: Omit<Partial<TextProps>, 'children'>;
|
|
35
34
|
/**
|
|
36
|
-
* Optional props merged into
|
|
35
|
+
* Optional props merged into the bottom label `Text` when `bottomLabel` is a string.
|
|
37
36
|
*/
|
|
38
37
|
bottomLabelProps?: Omit<Partial<TextProps>, 'children'>;
|
|
39
38
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TitleSubpage.types.d.cts","sourceRoot":"","sources":["../../../src/components/TitleSubpage/TitleSubpage.types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,uBAAuB,EAAE,gDAAgD;AACvF,OAAO,KAAK,EAAE,SAAS,EAAE,qBAAqB;AAG9C,OAAO,KAAK,EAAE,QAAQ,EAAE,6BAAyB;AACjD,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"TitleSubpage.types.d.cts","sourceRoot":"","sources":["../../../src/components/TitleSubpage/TitleSubpage.types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,uBAAuB,EAAE,gDAAgD;AACvF,OAAO,KAAK,EAAE,SAAS,EAAE,qBAAqB;AAG9C,OAAO,KAAK,EAAE,QAAQ,EAAE,6BAAyB;AACjD,OAAO,KAAK,EAAE,SAAS,EAAE,+BAA2B;AAEpD;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GAAG,uBAAuB,GAAG;IACxD;;OAEG;IACH,gBAAgB,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,UAAU,CAAC,CAAC;IACvD;;OAEG;IACH,gBAAgB,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,UAAU,CAAC,CAAC;IACvD;;OAEG;IACH,uBAAuB,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,UAAU,CAAC,CAAC;IAC9D;;OAEG;IACH,WAAW,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,UAAU,CAAC,CAAC;IACnD;;OAEG;IACH,UAAU,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,UAAU,CAAC,CAAC;IAClD;;OAEG;IACH,aAAa,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,UAAU,CAAC,CAAC;IACrD;;OAEG;IACH,gBAAgB,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,UAAU,CAAC,CAAC;IACxD;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,GAAG,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { TitleSubpagePropsShared } from "@metamask-previews/design-system-shared";
|
|
2
2
|
import type { ViewProps } 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 { TextProps } from "../Text/Text.types.mjs";
|
|
6
5
|
/**
|
|
7
6
|
* TitleSubpage component props (React Native).
|
|
@@ -9,31 +8,31 @@ import type { TextProps } from "../Text/Text.types.mjs";
|
|
|
9
8
|
*/
|
|
10
9
|
export type TitleSubpageProps = TitleSubpagePropsShared & {
|
|
11
10
|
/**
|
|
12
|
-
* Optional props spread onto the identity {@link
|
|
11
|
+
* Optional props spread onto the identity row {@link Box} (a row with centered items, `gap={4}`, and `h-14` by default; values here override those defaults). Excludes `children`, which the component owns.
|
|
13
12
|
*/
|
|
14
|
-
identityRowProps?: Omit<Partial<
|
|
13
|
+
identityRowProps?: Omit<Partial<BoxProps>, 'children'>;
|
|
15
14
|
/**
|
|
16
15
|
* Optional props spread onto the title/subtitle column {@link Box} (excluding `children`, which the component owns).
|
|
17
16
|
*/
|
|
18
17
|
titleColumnProps?: Omit<Partial<BoxProps>, 'children'>;
|
|
19
18
|
/**
|
|
20
|
-
* Optional props spread onto the bottom label {@link
|
|
19
|
+
* Optional props spread onto the bottom label row {@link Box} (a row with centered items and `gap={1}` by default; values here override those defaults). Excludes `children`, which the component owns.
|
|
21
20
|
*/
|
|
22
|
-
bottomLabelWrapperProps?: Omit<Partial<
|
|
21
|
+
bottomLabelWrapperProps?: Omit<Partial<BoxProps>, 'children'>;
|
|
23
22
|
/**
|
|
24
|
-
* Optional props merged into
|
|
23
|
+
* Optional props merged into the amount `Text` when `amount` is a string.
|
|
25
24
|
*/
|
|
26
25
|
amountProps?: Omit<Partial<TextProps>, 'children'>;
|
|
27
26
|
/**
|
|
28
|
-
* Optional props merged into
|
|
27
|
+
* Optional props merged into the title `Text` when `title` is a string.
|
|
29
28
|
*/
|
|
30
29
|
titleProps?: Omit<Partial<TextProps>, 'children'>;
|
|
31
30
|
/**
|
|
32
|
-
* Optional props merged into
|
|
31
|
+
* Optional props merged into the subtitle `Text` when `subtitle` is a string.
|
|
33
32
|
*/
|
|
34
33
|
subtitleProps?: Omit<Partial<TextProps>, 'children'>;
|
|
35
34
|
/**
|
|
36
|
-
* Optional props merged into
|
|
35
|
+
* Optional props merged into the bottom label `Text` when `bottomLabel` is a string.
|
|
37
36
|
*/
|
|
38
37
|
bottomLabelProps?: Omit<Partial<TextProps>, 'children'>;
|
|
39
38
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TitleSubpage.types.d.mts","sourceRoot":"","sources":["../../../src/components/TitleSubpage/TitleSubpage.types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,uBAAuB,EAAE,gDAAgD;AACvF,OAAO,KAAK,EAAE,SAAS,EAAE,qBAAqB;AAG9C,OAAO,KAAK,EAAE,QAAQ,EAAE,6BAAyB;AACjD,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"TitleSubpage.types.d.mts","sourceRoot":"","sources":["../../../src/components/TitleSubpage/TitleSubpage.types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,uBAAuB,EAAE,gDAAgD;AACvF,OAAO,KAAK,EAAE,SAAS,EAAE,qBAAqB;AAG9C,OAAO,KAAK,EAAE,QAAQ,EAAE,6BAAyB;AACjD,OAAO,KAAK,EAAE,SAAS,EAAE,+BAA2B;AAEpD;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GAAG,uBAAuB,GAAG;IACxD;;OAEG;IACH,gBAAgB,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,UAAU,CAAC,CAAC;IACvD;;OAEG;IACH,gBAAgB,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,UAAU,CAAC,CAAC;IACvD;;OAEG;IACH,uBAAuB,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,UAAU,CAAC,CAAC;IAC9D;;OAEG;IACH,WAAW,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,UAAU,CAAC,CAAC;IACnD;;OAEG;IACH,UAAU,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,UAAU,CAAC,CAAC;IAClD;;OAEG;IACH,aAAa,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,UAAU,CAAC,CAAC;IACrD;;OAEG;IACH,gBAAgB,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,UAAU,CAAC,CAAC;IACxD;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,GAAG,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TitleSubpage.types.mjs","sourceRoot":"","sources":["../../../src/components/TitleSubpage/TitleSubpage.types.ts"],"names":[],"mappings":"","sourcesContent":["// Third party dependencies.\nimport type { TitleSubpagePropsShared } from '@metamask-previews/design-system-shared';\nimport type { ViewProps } from 'react-native';\n\n// Internal dependencies.\nimport type { BoxProps } from '../Box/Box.types';\nimport type {
|
|
1
|
+
{"version":3,"file":"TitleSubpage.types.mjs","sourceRoot":"","sources":["../../../src/components/TitleSubpage/TitleSubpage.types.ts"],"names":[],"mappings":"","sourcesContent":["// Third party dependencies.\nimport type { TitleSubpagePropsShared } from '@metamask-previews/design-system-shared';\nimport type { ViewProps } from 'react-native';\n\n// Internal dependencies.\nimport type { BoxProps } from '../Box/Box.types';\nimport type { TextProps } from '../Text/Text.types';\n\n/**\n * TitleSubpage component props (React Native).\n * Extends {@link TitleSubpagePropsShared} (requires `title` and `titleAvatar`) with platform `Text` passthroughs, `twClassName`, and `View` props.\n */\nexport type TitleSubpageProps = TitleSubpagePropsShared & {\n /**\n * Optional props spread onto the identity row {@link Box} (a row with centered items, `gap={4}`, and `h-14` by default; values here override those defaults). Excludes `children`, which the component owns.\n */\n identityRowProps?: Omit<Partial<BoxProps>, 'children'>;\n /**\n * Optional props spread onto the title/subtitle column {@link Box} (excluding `children`, which the component owns).\n */\n titleColumnProps?: Omit<Partial<BoxProps>, 'children'>;\n /**\n * Optional props spread onto the bottom label row {@link Box} (a row with centered items and `gap={1}` by default; values here override those defaults). Excludes `children`, which the component owns.\n */\n bottomLabelWrapperProps?: Omit<Partial<BoxProps>, 'children'>;\n /**\n * Optional props merged into the amount `Text` when `amount` is a string.\n */\n amountProps?: Omit<Partial<TextProps>, 'children'>;\n /**\n * Optional props merged into the title `Text` when `title` is a string.\n */\n titleProps?: Omit<Partial<TextProps>, 'children'>;\n /**\n * Optional props merged into the subtitle `Text` when `subtitle` is a string.\n */\n subtitleProps?: Omit<Partial<TextProps>, 'children'>;\n /**\n * Optional props merged into the bottom label `Text` when `bottomLabel` is a string.\n */\n bottomLabelProps?: Omit<Partial<TextProps>, 'children'>;\n /**\n * Optional Tailwind class name to apply to the container.\n */\n twClassName?: string;\n} & Omit<ViewProps, 'children'>;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toast.cjs","sourceRoot":"","sources":["../../../src/components/Toast/Toast.tsx"],"names":[],"mappings":";;;;;;AAAA,4BAA4B;AAC5B,kFAOiD;AACjD,8FAAgF;AAChF,oEAA8D;AAC9D,kDAA0B;AAE1B,yBAAyB;AACzB,wDAA2C;AAC3C,sDAAyC;AAEzC,yBAAyB;AACzB,2DAA4D;AAC5D,mDAA8C;AAG9C,MAAM,uBAAuB,GAAG,CAAC,EAC/B,cAAc,EACd,QAAQ,EACR,cAAc,GACqD,EAAE,EAAE;IACvE,IAAI,cAAc,KAAK,IAAI,IAAI,cAAc,KAAK,SAAS,EAAE;
|
|
1
|
+
{"version":3,"file":"Toast.cjs","sourceRoot":"","sources":["../../../src/components/Toast/Toast.tsx"],"names":[],"mappings":";;;;;;AAAA,4BAA4B;AAC5B,kFAOiD;AACjD,8FAAgF;AAChF,oEAA8D;AAC9D,kDAA0B;AAE1B,yBAAyB;AACzB,wDAA2C;AAC3C,sDAAyC;AAEzC,yBAAyB;AACzB,2DAA4D;AAC5D,mDAA8C;AAG9C,MAAM,uBAAuB,GAAG,CAAC,EAC/B,cAAc,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jC,GAAG,gBAAgB;SACpB;QACH,CAAC,CAAC,SAAS,CAAC;IAEhB,OAAO,CACL,CAAC,uBAAU,CACT,IAAI,WAAW,CAAC,CAChB,IAAI,KAAK,CAAC,CACV,eAAe,CAAC,CAAC,yCAAkB,CAAC,mBAAmB,CAAC,CACxD,WAAW,CAAC,CAAC,qCAAc,CAAC,WAAW,CAAC,CACxC,WAAW,CAAC,CAAC,CAAC,CAAC,CACf,QAAQ,CAAC,CAAC,QAAQ,CAAC,CACnB,oBAAoB,CAAC,CAAC,oBAAoB,CAAC,CAC3C,gBAAgB,CAAC,CAAC,wBAAwB,CAAC,CAC3C,WAAW,CAAC,CAAC,WAAW,CAAC,CACzB,gBAAgB,CAAC,CAAC;YAChB,KAAK,EAAE,gCAAS,CAAC,eAAe;YAChC,GAAG,gBAAgB;SACpB,CAAC,CACF,OAAO,CAAC,CAAC,OAAO,CAAC,CACjB,cAAc,CAAC,CAAC,uBAAuB,CAAC;YACtC,cAAc;YACd,QAAQ;YACR,cAAc;SACf,CAAC,CAAC,CACH,KAAK,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,0BAAU,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC,CACtE,KAAK,CAAC,CAAC,KAAK,CAAC,CACb,UAAU,CAAC,CAAC,UAAU,CAAC,CACvB,WAAW,CAAC,CAAC,IAAA,uCAAgB,EAAC,aAAa,EAAE,WAAW,CAAC,CAAC,EAC1D,CACH,CAAC;AACJ,CAAC,CAAC;AArEW,QAAA,KAAK,SAqEhB","sourcesContent":["// Third party dependencies.\nimport {\n BoxBackgroundColor,\n BoxBorderColor,\n ButtonSize,\n IconSize,\n mergeTwClassName,\n TextColor,\n} from '@metamask-previews/design-system-shared';\nimport { Theme, useTheme } from '@metamask-previews/design-system-twrnc-preset';\nimport { lightTheme } from '@metamask-previews/design-tokens';\nimport React from 'react';\n\n// External dependencies.\nimport { BannerBase } from '../BannerBase';\nimport { IconAlert } from '../IconAlert';\n\n// Internal dependencies.\nimport { TOAST_SEVERITY_ICON_MAP } from './Toast.constants';\nimport { ToastSeverity } from './Toast.types';\nimport type { ToastProps } from './Toast.types';\n\nconst renderSeverityAccessory = ({\n iconAlertProps,\n severity,\n startAccessory,\n}: Pick<ToastProps, 'iconAlertProps' | 'severity' | 'startAccessory'>) => {\n if (startAccessory !== null && startAccessory !== undefined) {\n return startAccessory;\n }\n\n if (!severity || severity === ToastSeverity.Default) {\n return undefined;\n }\n\n const iconAlertSeverity = TOAST_SEVERITY_ICON_MAP[severity];\n\n return (\n <IconAlert\n severity={iconAlertSeverity}\n size={IconSize.Lg}\n {...iconAlertProps}\n />\n );\n};\n\nexport const Toast: React.FC<ToastProps> = ({\n actionButtonLabel,\n actionButtonOnPress,\n actionButtonProps,\n children,\n childrenWrapperProps,\n closeButtonProps,\n description,\n descriptionProps,\n onClose,\n iconAlertProps,\n severity = ToastSeverity.Default,\n startAccessory,\n style,\n title,\n titleProps,\n twClassName,\n ...props\n}) => {\n const theme = useTheme();\n const isLightTheme = theme === Theme.Light;\n const actionProps =\n actionButtonLabel && actionButtonOnPress\n ? {\n actionButtonLabel,\n actionButtonOnPress,\n actionButtonProps: {\n size: ButtonSize.Sm,\n ...actionButtonProps,\n },\n }\n : {};\n // TODO: Remove this conditional once BannerBase only renders a close button\n // from onClose. At that point Toast can pass closeButtonProps directly.\n const resolvedCloseButtonProps =\n onClose || closeButtonProps\n ? {\n accessibilityLabel: 'Close toast',\n ...closeButtonProps,\n }\n : undefined;\n\n return (\n <BannerBase\n {...actionProps}\n {...props}\n backgroundColor={BoxBackgroundColor.BackgroundElevated2}\n borderColor={BoxBorderColor.BorderMuted}\n borderWidth={1}\n children={children}\n childrenWrapperProps={childrenWrapperProps}\n closeButtonProps={resolvedCloseButtonProps}\n description={description}\n descriptionProps={{\n color: TextColor.TextAlternative,\n ...descriptionProps,\n }}\n onClose={onClose}\n startAccessory={renderSeverityAccessory({\n iconAlertProps,\n severity,\n startAccessory,\n })}\n style={[isLightTheme ? lightTheme.shadows.size.md : undefined, style]}\n title={title}\n titleProps={titleProps}\n twClassName={mergeTwClassName('rounded-2xl', twClassName)}\n />\n );\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toast.mjs","sourceRoot":"","sources":["../../../src/components/Toast/Toast.tsx"],"names":[],"mappings":";;;;;;AAAA,4BAA4B;AAC5B,OAAO,EACL,kBAAkB,EAClB,cAAc,EACd,UAAU,EACV,QAAQ,EACR,gBAAgB,EAChB,SAAS,EACV,gDAAgD;AACjD,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,sDAAsD;AAChF,OAAO,EAAE,UAAU,EAAE,yCAAyC;AAC9D,OAAO,MAAK,cAAc;;AAE1B,yBAAyB;AACzB,OAAO,EAAE,UAAU,EAAE,gCAAsB;AAC3C,OAAO,EAAE,SAAS,EAAE,+BAAqB;AAEzC,yBAAyB;AACzB,OAAO,EAAE,uBAAuB,EAAE,8BAA0B;AAC5D,OAAO,EAAE,aAAa,EAAE,0BAAsB;AAG9C,MAAM,uBAAuB,GAAG,CAAC,EAC/B,cAAc,EACd,QAAQ,EACR,cAAc,GACqD,EAAE,EAAE;IACvE,IAAI,cAAc,KAAK,IAAI,IAAI,cAAc,KAAK,SAAS,EAAE;
|
|
1
|
+
{"version":3,"file":"Toast.mjs","sourceRoot":"","sources":["../../../src/components/Toast/Toast.tsx"],"names":[],"mappings":";;;;;;AAAA,4BAA4B;AAC5B,OAAO,EACL,kBAAkB,EAClB,cAAc,EACd,UAAU,EACV,QAAQ,EACR,gBAAgB,EAChB,SAAS,EACV,gDAAgD;AACjD,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,sDAAsD;AAChF,OAAO,EAAE,UAAU,EAAE,yCAAyC;AAC9D,OAAO,MAAK,cAAc;;AAE1B,yBAAyB;AACzB,OAAO,EAAE,UAAU,EAAE,gCAAsB;AAC3C,OAAO,E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iB;aACrB;SACF;QACH,CAAC,CAAC,EAAE,CAAC;IACT,4EAA4E;IAC5E,wEAAwE;IACxE,MAAM,wBAAwB,GAC5B,OAAO,IAAI,gBAAgB;QACzB,CAAC,CAAC;YACE,kBAAkB,EAAE,aAAa;YACjC,GAAG,gBAAgB;SACpB;QACH,CAAC,CAAC,SAAS,CAAC;IAEhB,OAAO,CACL,CAAC,UAAU,CACT,IAAI,WAAW,CAAC,CAChB,IAAI,KAAK,CAAC,CACV,eAAe,CAAC,CAAC,kBAAkB,CAAC,mBAAmB,CAAC,CACxD,WAAW,CAAC,CAAC,cAAc,CAAC,WAAW,CAAC,CACxC,WAAW,CAAC,CAAC,CAAC,CAAC,CACf,QAAQ,CAAC,CAAC,QAAQ,CAAC,CACnB,oBAAoB,CAAC,CAAC,oBAAoB,CAAC,CAC3C,gBAAgB,CAAC,CAAC,wBAAwB,CAAC,CAC3C,WAAW,CAAC,CAAC,WAAW,CAAC,CACzB,gBAAgB,CAAC,CAAC;YAChB,KAAK,EAAE,SAAS,CAAC,eAAe;YAChC,GAAG,gBAAgB;SACpB,CAAC,CACF,OAAO,CAAC,CAAC,OAAO,CAAC,CACjB,cAAc,CAAC,CAAC,uBAAuB,CAAC;YACtC,cAAc;YACd,QAAQ;YACR,cAAc;SACf,CAAC,CAAC,CACH,KAAK,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC,CACtE,KAAK,CAAC,CAAC,KAAK,CAAC,CACb,UAAU,CAAC,CAAC,UAAU,CAAC,CACvB,WAAW,CAAC,CAAC,gBAAgB,CAAC,aAAa,EAAE,WAAW,CAAC,CAAC,EAC1D,CACH,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// Third party dependencies.\nimport {\n BoxBackgroundColor,\n BoxBorderColor,\n ButtonSize,\n IconSize,\n mergeTwClassName,\n TextColor,\n} from '@metamask-previews/design-system-shared';\nimport { Theme, useTheme } from '@metamask-previews/design-system-twrnc-preset';\nimport { lightTheme } from '@metamask-previews/design-tokens';\nimport React from 'react';\n\n// External dependencies.\nimport { BannerBase } from '../BannerBase';\nimport { IconAlert } from '../IconAlert';\n\n// Internal dependencies.\nimport { TOAST_SEVERITY_ICON_MAP } from './Toast.constants';\nimport { ToastSeverity } from './Toast.types';\nimport type { ToastProps } from './Toast.types';\n\nconst renderSeverityAccessory = ({\n iconAlertProps,\n severity,\n startAccessory,\n}: Pick<ToastProps, 'iconAlertProps' | 'severity' | 'startAccessory'>) => {\n if (startAccessory !== null && startAccessory !== undefined) {\n return startAccessory;\n }\n\n if (!severity || severity === ToastSeverity.Default) {\n return undefined;\n }\n\n const iconAlertSeverity = TOAST_SEVERITY_ICON_MAP[severity];\n\n return (\n <IconAlert\n severity={iconAlertSeverity}\n size={IconSize.Lg}\n {...iconAlertProps}\n />\n );\n};\n\nexport const Toast: React.FC<ToastProps> = ({\n actionButtonLabel,\n actionButtonOnPress,\n actionButtonProps,\n children,\n childrenWrapperProps,\n closeButtonProps,\n description,\n descriptionProps,\n onClose,\n iconAlertProps,\n severity = ToastSeverity.Default,\n startAccessory,\n style,\n title,\n titleProps,\n twClassName,\n ...props\n}) => {\n const theme = useTheme();\n const isLightTheme = theme === Theme.Light;\n const actionProps =\n actionButtonLabel && actionButtonOnPress\n ? {\n actionButtonLabel,\n actionButtonOnPress,\n actionButtonProps: {\n size: ButtonSize.Sm,\n ...actionButtonProps,\n },\n }\n : {};\n // TODO: Remove this conditional once BannerBase only renders a close button\n // from onClose. At that point Toast can pass closeButtonProps directly.\n const resolvedCloseButtonProps =\n onClose || closeButtonProps\n ? {\n accessibilityLabel: 'Close toast',\n ...closeButtonProps,\n }\n : undefined;\n\n return (\n <BannerBase\n {...actionProps}\n {...props}\n backgroundColor={BoxBackgroundColor.BackgroundElevated2}\n borderColor={BoxBorderColor.BorderMuted}\n borderWidth={1}\n children={children}\n childrenWrapperProps={childrenWrapperProps}\n closeButtonProps={resolvedCloseButtonProps}\n description={description}\n descriptionProps={{\n color: TextColor.TextAlternative,\n ...descriptionProps,\n }}\n onClose={onClose}\n startAccessory={renderSeverityAccessory({\n iconAlertProps,\n severity,\n startAccessory,\n })}\n style={[isLightTheme ? lightTheme.shadows.size.md : undefined, style]}\n title={title}\n titleProps={titleProps}\n twClassName={mergeTwClassName('rounded-2xl', twClassName)}\n />\n );\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 (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
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.toast = exports.Toaster = void 0;
|
|
27
37
|
// Third party dependencies.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toaster.cjs","sourceRoot":"","sources":["../../../src/components/Toast/Toaster.tsx"],"names":[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/B,KAAK,CAAC,CAAC,SAAS,CAAC,CACjB,IAAI,KAAK,CAAC,CAEV;UAAA,CAAC,iBAAiB,IAAI,mBAAmB,CAAC,CAAC,CAAC,CAC1C,CAAC,aAAK,CACJ,IAAI,UAAU,CAAC,CACf,iBAAiB,CAAC,CAAC,iBAAiB,CAAC,CACrC,mBAAmB,CAAC,CAAC,mBAAmB,CAAC,CACzC,OAAO,CAAC,CAAC,WAAW,CAAC,CACrB,WAAW,CAAC,CAAC,iBAAiB,CAAC,EAC/B,CACH,CAAC,CAAC,CAAC,CACF,CAAC,aAAK,CACJ,IAAI,cAAc,CAAC,CACnB,OAAO,CAAC,CAAC,WAAW,CAAC,CACrB,WAAW,CAAC,CAAC,iBAAiB,CAAC,EAC/B,CACH,CACH;QAAA,EAAE,iCAAQ,CAAC,IAAI,CACjB;MAAA,EAAE,8CAAe,CAAC,CACnB,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,gBAAgB,CAAC,WAAW,GAAG,SAAS,CAAC;AAM5B,QAAA,OAAO,GAAG,gBAAgB,CAAC;AAE3B,QAAA,KAAK,GAAG,CAAC,CAAC,OAAqB,EAAE,EAAE;IAC9C,mBAAmB,CAAC,OAAO,CAAC,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;AAClD,CAAC,CAAkB,CAAC;AAEpB,aAAK,CAAC,OAAO,GAAG,GAAG,EAAE;IACnB,mBAAmB,CAAC,SAAS,CAAC,CAAC,UAAU,EAAE,CAAC;AAC9C,CAAC,CAAC","sourcesContent":["// Third party dependencies.\nimport { useTailwind } from '@metamask-previews/design-system-twrnc-preset';\nimport React, {\n forwardRef,\n useImperativeHandle,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport type { RefObject } from 'react';\nimport { Dimensions } from 'react-native';\nimport type { LayoutChangeEvent } from 'react-native';\nimport { Gesture, GestureDetector } from 'react-native-gesture-handler';\nimport Animated, {\n cancelAnimation,\n useAnimatedStyle,\n useSharedValue,\n withSpring,\n} from 'react-native-reanimated';\nimport { useSafeAreaInsets } from 'react-native-safe-area-context';\nimport { scheduleOnRN } from 'react-native-worklets';\n\n// Internal dependencies.\nimport { Toast } from './Toast';\nimport {\n TOAST_DISMISS_DISTANCE_THRESHOLD,\n TOAST_DISMISS_MIN_DISTANCE,\n TOAST_DISMISS_VELOCITY_THRESHOLD,\n TOAST_SPRING_CONFIG,\n TOAST_SWIPE_ACTIVE_OFFSET_Y,\n TOAST_SWIPE_FAIL_OFFSET_X,\n TOAST_TOP_PADDING,\n TOAST_VISIBILITY_DURATION,\n} from './Toast.constants';\nimport type {\n ToastOptions,\n ToastProps,\n ToasterProps,\n ToasterRef,\n} from './Toast.types';\n\nconst screenHeight = Dimensions.get('window').height;\n\nlet registeredRef: RefObject<ToasterRef | null> | null = null;\n\nconst assertRegisteredRef = (method: 'dismiss' | 'toast'): ToasterRef => {\n if (!registeredRef?.current) {\n const invocation = method === 'toast' ? 'toast()' : `toast.${method}()`;\n throw new Error(\n `${invocation} called before <Toaster /> mounted. Render <Toaster /> once at the root of your app.`,\n );\n }\n return registeredRef.current;\n};\n\nconst getToastProps = ({\n hasNoTimeout: _hasNoTimeout,\n onClose: _onClose,\n topOffset: _topOffset,\n twClassName: _twClassName,\n showCloseButton: _showCloseButton,\n ...toastProps\n}: ToastOptions): Omit<ToastProps, 'twClassName'> => toastProps;\n\nconst getHiddenTranslateY = (height: number, offset: number) =>\n -(height + offset);\n\nconst ToasterComponent = forwardRef<ToasterRef, ToasterProps>(\n ({ twClassName, ...props }, ref) => {\n const tw = useTailwind();\n const [toastOptions, setToastOptions] = useState<ToastOptions | undefined>(\n undefined,\n );\n const replacementTimerRef = useRef<ReturnType<typeof setTimeout> | null>(\n null,\n );\n const autoDismissTimeoutRef = useRef<ReturnType<typeof setTimeout> | null>(\n null,\n );\n const animationStartedRef = useRef(false);\n const visibleAtRef = useRef<number | null>(null);\n const hasNoTimeoutRef = useRef(false);\n // Invalidates queued spring-back resumes after replace/dismiss. A completed\n // spring cannot be cancelled, so scheduleOnRN(resume) can still run later.\n const toastGenerationRef = useRef(0);\n const { top: topInset } = useSafeAreaInsets();\n const toastHeight = useSharedValue(screenHeight);\n const hiddenTranslateY = useSharedValue(-screenHeight);\n const visibleTranslateY = useSharedValue(0);\n const gestureStartY = useSharedValue(0);\n const translateYProgress = useSharedValue(-screenHeight);\n const isDismissing = useSharedValue(false);\n // True after onStart until onEnd/onFinalize recovers. Used so a failed pan\n // (e.g. failOffsetX after activation) still springs back and resumes dismiss.\n const isSwipeActive = useSharedValue(false);\n const toastGeneration = useSharedValue(0);\n const topOffset = toastOptions?.topOffset ?? 0;\n hasNoTimeoutRef.current = Boolean(toastOptions?.hasNoTimeout);\n const animatedStyle = useAnimatedStyle(() => ({\n transform: [{ translateY: translateYProgress.value + topOffset }],\n }));\n const baseStyle = useMemo(\n () => [tw.style('absolute left-4 right-4 top-0'), animatedStyle],\n [tw, animatedStyle],\n );\n const innerRef = useRef<ToasterRef | null>(null);\n\n const clearScheduledAutoDismiss = () => {\n if (autoDismissTimeoutRef.current !== null) {\n clearTimeout(autoDismissTimeoutRef.current);\n autoDismissTimeoutRef.current = null;\n }\n };\n\n const bumpToastGeneration = () => {\n toastGenerationRef.current += 1;\n toastGeneration.value = toastGenerationRef.current;\n };\n\n const resetState = () => {\n animationStartedRef.current = false;\n visibleAtRef.current = null;\n isDismissing.value = false;\n isSwipeActive.value = false;\n clearScheduledAutoDismiss();\n setToastOptions(undefined);\n };\n\n const startDismissAnimation = () => {\n bumpToastGeneration();\n clearScheduledAutoDismiss();\n isDismissing.value = true;\n visibleAtRef.current = null;\n translateYProgress.value = withSpring(\n hiddenTranslateY.value,\n TOAST_SPRING_CONFIG,\n (finished) => {\n if (finished) {\n scheduleOnRN(resetState);\n }\n },\n );\n };\n\n const scheduleAutoDismiss = (delayMs: number) => {\n clearScheduledAutoDismiss();\n autoDismissTimeoutRef.current = setTimeout(() => {\n autoDismissTimeoutRef.current = null;\n startDismissAnimation();\n }, delayMs);\n };\n\n const beginAutoDismiss = () => {\n visibleAtRef.current = Date.now();\n scheduleAutoDismiss(TOAST_VISIBILITY_DURATION);\n };\n\n const resumeAutoDismissAfterSwipe = () => {\n if (hasNoTimeoutRef.current || isDismissing.value) {\n return;\n }\n\n // Entrance was interrupted before auto-dismiss started — start a full timer.\n if (visibleAtRef.current === null) {\n beginAutoDismiss();\n return;\n }\n\n const elapsed = Date.now() - visibleAtRef.current;\n if (elapsed >= TOAST_VISIBILITY_DURATION) {\n startDismissAnimation();\n return;\n }\n\n scheduleAutoDismiss(TOAST_VISIBILITY_DURATION - elapsed);\n };\n\n const showToast = (options: ToastOptions) => {\n bumpToastGeneration();\n let timeoutDuration = 0;\n const normalizedOptions = {\n hasNoTimeout: false,\n ...options,\n };\n if (toastOptions) {\n // Always clear any pending auto-dismiss from the previous toast, including\n // when the replacement is persistent (hasNoTimeout). Otherwise the old\n // timer can fire and dismiss the new toast.\n clearScheduledAutoDismiss();\n cancelAnimation(translateYProgress);\n timeoutDuration = 100;\n animationStartedRef.current = false;\n visibleAtRef.current = null;\n isDismissing.value = false;\n isSwipeActive.value = false;\n setToastOptions(undefined);\n }\n if (replacementTimerRef.current !== null) {\n clearTimeout(replacementTimerRef.current);\n }\n replacementTimerRef.current = setTimeout(() => {\n replacementTimerRef.current = null;\n setToastOptions(normalizedOptions);\n }, timeoutDuration);\n };\n\n const closeToast = () => {\n if (replacementTimerRef.current !== null) {\n clearTimeout(replacementTimerRef.current);\n replacementTimerRef.current = null;\n }\n startDismissAnimation();\n };\n\n const closeToastRef = useRef(closeToast);\n const resumeAutoDismissAfterSwipeRef = useRef(resumeAutoDismissAfterSwipe);\n const clearScheduledAutoDismissRef = useRef(clearScheduledAutoDismiss);\n closeToastRef.current = closeToast;\n resumeAutoDismissAfterSwipeRef.current = resumeAutoDismissAfterSwipe;\n clearScheduledAutoDismissRef.current = clearScheduledAutoDismiss;\n\n const dismissToastFromSwipe = () => {\n closeToastRef.current();\n };\n\n const resumeAutoDismissFromSwipe = (generation: number) => {\n // Ignore resumes from a toast that was replaced or dismissed after the\n // spring-back started (completed springs cannot be cancelled).\n if (generation !== toastGenerationRef.current) {\n return;\n }\n resumeAutoDismissAfterSwipeRef.current();\n };\n\n const clearScheduledAutoDismissFromSwipe = () => {\n clearScheduledAutoDismissRef.current();\n };\n\n const swipeGesture = useMemo(() => {\n // These gesture callbacks need explicit 'worklet' directives because this\n // package ships a pre-built dist compiled by ts-bridge (tsc), which emits the\n // gesture chain as a namespaced call (react_native_gesture_handler_1.Gesture).\n // The consumer's Reanimated/Worklets Babel plugin does run over dist, but its\n // gesture auto-detection doesn't recognize that compiled namespaced form.\n const springBackAfterSwipe = () => {\n 'worklet';\n\n const generationAtSpringStart = toastGeneration.value;\n translateYProgress.value = withSpring(\n visibleTranslateY.value,\n TOAST_SPRING_CONFIG,\n (finished) => {\n // A new pan cancels this spring via cancelAnimation; only resume\n // auto-dismiss when the spring-back completed naturally.\n if (finished) {\n scheduleOnRN(resumeAutoDismissFromSwipe, generationAtSpringStart);\n }\n },\n );\n };\n\n return Gesture.Pan()\n .activeOffsetY(TOAST_SWIPE_ACTIVE_OFFSET_Y)\n .failOffsetX([-TOAST_SWIPE_FAIL_OFFSET_X, TOAST_SWIPE_FAIL_OFFSET_X])\n .onStart(() => {\n 'worklet';\n\n // Don't interrupt an in-progress dismiss animation.\n if (isDismissing.value) {\n return;\n }\n isSwipeActive.value = true;\n scheduleOnRN(clearScheduledAutoDismissFromSwipe);\n cancelAnimation(translateYProgress);\n gestureStartY.value = translateYProgress.value;\n })\n .onUpdate((event) => {\n 'worklet';\n\n if (isDismissing.value || !isSwipeActive.value) {\n return;\n }\n const nextTranslateY = gestureStartY.value + event.translationY;\n // Toast sits at the top; only allow dragging upward (more negative).\n translateYProgress.value = Math.min(\n nextTranslateY,\n visibleTranslateY.value,\n );\n })\n .onEnd((event) => {\n 'worklet';\n\n if (!isSwipeActive.value) {\n return;\n }\n isSwipeActive.value = false;\n\n if (isDismissing.value) {\n return;\n }\n const { translationY, velocityY } = event;\n const dismissDistance = Math.max(\n toastHeight.value * TOAST_DISMISS_DISTANCE_THRESHOLD,\n TOAST_DISMISS_MIN_DISTANCE,\n );\n const hasReachedDismissOffset = translationY <= -dismissDistance;\n const hasReachedSwipeThreshold =\n Math.abs(velocityY) > TOAST_DISMISS_VELOCITY_THRESHOLD;\n const isQuickDismissing = velocityY < 0;\n\n const shouldDismiss =\n hasReachedDismissOffset ||\n (hasReachedSwipeThreshold && isQuickDismissing);\n\n if (shouldDismiss) {\n scheduleOnRN(dismissToastFromSwipe);\n return;\n }\n\n springBackAfterSwipe();\n })\n .onFinalize(() => {\n 'worklet';\n\n // onEnd is skipped when the pan fails/cancels after activation\n // (e.g. horizontal travel past failOffsetX). Recover position and\n // auto-dismiss so the toast is not left stuck mid-offset.\n if (!isSwipeActive.value) {\n return;\n }\n // Clear before the dismiss check — same order as onEnd — so a pan\n // cancelled mid-dismiss cannot leave isSwipeActive stuck true for a\n // later toast (resetState alone is not enough if finalize races it).\n isSwipeActive.value = false;\n\n if (isDismissing.value) {\n return;\n }\n springBackAfterSwipe();\n });\n // Shared values and swipe JS wrappers are stable for the component lifetime.\n }, []);\n\n innerRef.current = {\n closeToast,\n showToast,\n };\n\n useImperativeHandle(ref, () => innerRef.current as ToasterRef);\n\n useLayoutEffect(() => {\n registeredRef = innerRef;\n return () => {\n if (registeredRef === innerRef) {\n registeredRef = null;\n }\n };\n }, []);\n\n if (!toastOptions) {\n return null;\n }\n\n const {\n onClose: toastOnClose,\n showCloseButton = true,\n twClassName: toastTwClassName,\n } = toastOptions;\n const toastProps = getToastProps(toastOptions);\n const { actionButtonLabel, actionButtonOnPress, ...restToastProps } =\n toastProps;\n const toastTwClassNames = [twClassName, toastTwClassName]\n .filter(Boolean)\n .join(' ');\n const handleClose = showCloseButton\n ? () => {\n closeToast();\n toastOnClose?.();\n }\n : undefined;\n\n const onAnimatedViewLayout = (e: LayoutChangeEvent) => {\n const { height } = e.nativeEvent.layout;\n const nextHiddenTranslateY = getHiddenTranslateY(height, topOffset);\n const nextVisibleTranslateY = topInset + TOAST_TOP_PADDING;\n\n hiddenTranslateY.value = nextHiddenTranslateY;\n visibleTranslateY.value = nextVisibleTranslateY;\n toastHeight.value = height;\n\n if (animationStartedRef.current) {\n return;\n }\n\n animationStartedRef.current = true;\n translateYProgress.value = nextHiddenTranslateY;\n\n if (toastOptions.hasNoTimeout) {\n translateYProgress.value = withSpring(\n nextVisibleTranslateY,\n TOAST_SPRING_CONFIG,\n );\n } else {\n translateYProgress.value = withSpring(\n nextVisibleTranslateY,\n TOAST_SPRING_CONFIG,\n (finished) => {\n if (finished) {\n scheduleOnRN(beginAutoDismiss);\n }\n },\n );\n }\n };\n\n return (\n <GestureDetector gesture={swipeGesture}>\n <Animated.View\n onLayout={onAnimatedViewLayout}\n style={baseStyle}\n {...props}\n >\n {actionButtonLabel && actionButtonOnPress ? (\n <Toast\n {...toastProps}\n actionButtonLabel={actionButtonLabel}\n actionButtonOnPress={actionButtonOnPress}\n onClose={handleClose}\n twClassName={toastTwClassNames}\n />\n ) : (\n <Toast\n {...restToastProps}\n onClose={handleClose}\n twClassName={toastTwClassNames}\n />\n )}\n </Animated.View>\n </GestureDetector>\n );\n },\n);\n\nToasterComponent.displayName = 'Toaster';\n\ntype ToastFunction = ((options: ToastOptions) => void) & {\n dismiss: () => void;\n};\n\nexport const Toaster = ToasterComponent;\n\nexport const toast = ((options: ToastOptions) => {\n assertRegisteredRef('toast').showToast(options);\n}) as ToastFunction;\n\ntoast.dismiss = () => {\n assertRegisteredRef('dismiss').closeToast();\n};\n"]}
|
|
1
|
+
{"version":3,"file":"Toaster.cjs","sourceRoot":"","sources":["../../../src/components/Toast/Toaster.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,4BAA4B;AAC5B,8FAA4E;AAC5E,+CAOe;AAEf,+CAA0C;AAE1C,+EAAwE;AACxE,mFAKiC;AACjC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,CAAC;IAEF,OAAO,CACL,CAAC,8CAAe,CAAC,OAAO,CAAC,CAAC,YAAY,CAAC,CACrC;QAAA,CAAC,iCAAQ,CAAC,IAAI,CACZ,QAAQ,CAAC,CAAC,oBAAoB,CAAC,CAC/B,KAAK,CAAC,CAAC,SAAS,CAAC,CACjB,IAAI,KAAK,CAAC,CAEV;UAAA,CAAC,iBAAiB,IAAI,mBAAmB,CAAC,CAAC,CAAC,CAC1C,CAAC,aAAK,CACJ,IAAI,UAAU,CAAC,CACf,iBAAiB,CAAC,CAAC,iBAAiB,CAAC,CACrC,mBAAmB,CAAC,CAAC,mBAAmB,CAAC,CACzC,OAAO,CAAC,CAAC,WAAW,CAAC,CACrB,WAAW,CAAC,CAAC,iBAAiB,CAAC,EAC/B,CACH,CAAC,CAAC,CAAC,CACF,CAAC,aAAK,CACJ,IAAI,cAAc,CAAC,CACnB,OAAO,CAAC,CAAC,WAAW,CAAC,CACrB,WAAW,CAAC,CAAC,iBAAiB,CAAC,EAC/B,CACH,CACH;QAAA,EAAE,iCAAQ,CAAC,IAAI,CACjB;MAAA,EAAE,8CAAe,CAAC,CACnB,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,gBAAgB,CAAC,WAAW,GAAG,SAAS,CAAC;AAM5B,QAAA,OAAO,GAAG,gBAAgB,CAAC;AAE3B,QAAA,KAAK,GAAG,CAAC,CAAC,OAAqB,EAAE,EAAE;IAC9C,mBAAmB,CAAC,OAAO,CAAC,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;AAClD,CAAC,CAAkB,CAAC;AAEpB,aAAK,CAAC,OAAO,GAAG,GAAG,EAAE;IACnB,mBAAmB,CAAC,SAAS,CAAC,CAAC,UAAU,EAAE,CAAC;AAC9C,CAAC,CAAC","sourcesContent":["// Third party dependencies.\nimport { useTailwind } from '@metamask-previews/design-system-twrnc-preset';\nimport React, {\n forwardRef,\n useImperativeHandle,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport type { RefObject } from 'react';\nimport { Dimensions } from 'react-native';\nimport type { LayoutChangeEvent } from 'react-native';\nimport { Gesture, GestureDetector } from 'react-native-gesture-handler';\nimport Animated, {\n cancelAnimation,\n useAnimatedStyle,\n useSharedValue,\n withSpring,\n} from 'react-native-reanimated';\nimport { useSafeAreaInsets } from 'react-native-safe-area-context';\nimport { scheduleOnRN } from 'react-native-worklets';\n\n// Internal dependencies.\nimport { Toast } from './Toast';\nimport {\n TOAST_DISMISS_DISTANCE_THRESHOLD,\n TOAST_DISMISS_MIN_DISTANCE,\n TOAST_DISMISS_VELOCITY_THRESHOLD,\n TOAST_SPRING_CONFIG,\n TOAST_SWIPE_ACTIVE_OFFSET_Y,\n TOAST_SWIPE_FAIL_OFFSET_X,\n TOAST_TOP_PADDING,\n TOAST_VISIBILITY_DURATION,\n} from './Toast.constants';\nimport type {\n ToastOptions,\n ToastProps,\n ToasterProps,\n ToasterRef,\n} from './Toast.types';\n\nconst screenHeight = Dimensions.get('window').height;\n\nlet registeredRef: RefObject<ToasterRef | null> | null = null;\n\nconst assertRegisteredRef = (method: 'dismiss' | 'toast'): ToasterRef => {\n if (!registeredRef?.current) {\n const invocation = method === 'toast' ? 'toast()' : `toast.${method}()`;\n throw new Error(\n `${invocation} called before <Toaster /> mounted. Render <Toaster /> once at the root of your app.`,\n );\n }\n return registeredRef.current;\n};\n\nconst getToastProps = ({\n hasNoTimeout: _hasNoTimeout,\n onClose: _onClose,\n topOffset: _topOffset,\n twClassName: _twClassName,\n showCloseButton: _showCloseButton,\n ...toastProps\n}: ToastOptions): Omit<ToastProps, 'twClassName'> => toastProps;\n\nconst getHiddenTranslateY = (height: number, offset: number) =>\n -(height + offset);\n\nconst ToasterComponent = forwardRef<ToasterRef, ToasterProps>(\n ({ twClassName, ...props }, ref) => {\n const tw = useTailwind();\n const [toastOptions, setToastOptions] = useState<ToastOptions | undefined>(\n undefined,\n );\n const replacementTimerRef = useRef<ReturnType<typeof setTimeout> | null>(\n null,\n );\n const autoDismissTimeoutRef = useRef<ReturnType<typeof setTimeout> | null>(\n null,\n );\n const animationStartedRef = useRef(false);\n const visibleAtRef = useRef<number | null>(null);\n const hasNoTimeoutRef = useRef(false);\n // Invalidates queued spring-back resumes after replace/dismiss. A completed\n // spring cannot be cancelled, so scheduleOnRN(resume) can still run later.\n const toastGenerationRef = useRef(0);\n const { top: topInset } = useSafeAreaInsets();\n const toastHeight = useSharedValue(screenHeight);\n const hiddenTranslateY = useSharedValue(-screenHeight);\n const visibleTranslateY = useSharedValue(0);\n const gestureStartY = useSharedValue(0);\n const translateYProgress = useSharedValue(-screenHeight);\n const isDismissing = useSharedValue(false);\n // True after onStart until onEnd/onFinalize recovers. Used so a failed pan\n // (e.g. failOffsetX after activation) still springs back and resumes dismiss.\n const isSwipeActive = useSharedValue(false);\n const toastGeneration = useSharedValue(0);\n const topOffset = toastOptions?.topOffset ?? 0;\n hasNoTimeoutRef.current = Boolean(toastOptions?.hasNoTimeout);\n const animatedStyle = useAnimatedStyle(() => ({\n transform: [{ translateY: translateYProgress.value + topOffset }],\n }));\n const baseStyle = useMemo(\n () => [tw.style('absolute left-4 right-4 top-0'), animatedStyle],\n [tw, animatedStyle],\n );\n const innerRef = useRef<ToasterRef | null>(null);\n\n const clearScheduledAutoDismiss = () => {\n if (autoDismissTimeoutRef.current !== null) {\n clearTimeout(autoDismissTimeoutRef.current);\n autoDismissTimeoutRef.current = null;\n }\n };\n\n const bumpToastGeneration = () => {\n toastGenerationRef.current += 1;\n toastGeneration.value = toastGenerationRef.current;\n };\n\n const resetState = () => {\n animationStartedRef.current = false;\n visibleAtRef.current = null;\n isDismissing.value = false;\n isSwipeActive.value = false;\n clearScheduledAutoDismiss();\n setToastOptions(undefined);\n };\n\n const startDismissAnimation = () => {\n bumpToastGeneration();\n clearScheduledAutoDismiss();\n isDismissing.value = true;\n visibleAtRef.current = null;\n translateYProgress.value = withSpring(\n hiddenTranslateY.value,\n TOAST_SPRING_CONFIG,\n (finished) => {\n if (finished) {\n scheduleOnRN(resetState);\n }\n },\n );\n };\n\n const scheduleAutoDismiss = (delayMs: number) => {\n clearScheduledAutoDismiss();\n autoDismissTimeoutRef.current = setTimeout(() => {\n autoDismissTimeoutRef.current = null;\n startDismissAnimation();\n }, delayMs);\n };\n\n const beginAutoDismiss = () => {\n visibleAtRef.current = Date.now();\n scheduleAutoDismiss(TOAST_VISIBILITY_DURATION);\n };\n\n const resumeAutoDismissAfterSwipe = () => {\n if (hasNoTimeoutRef.current || isDismissing.value) {\n return;\n }\n\n // Entrance was interrupted before auto-dismiss started — start a full timer.\n if (visibleAtRef.current === null) {\n beginAutoDismiss();\n return;\n }\n\n const elapsed = Date.now() - visibleAtRef.current;\n if (elapsed >= TOAST_VISIBILITY_DURATION) {\n startDismissAnimation();\n return;\n }\n\n scheduleAutoDismiss(TOAST_VISIBILITY_DURATION - elapsed);\n };\n\n const showToast = (options: ToastOptions) => {\n bumpToastGeneration();\n let timeoutDuration = 0;\n const normalizedOptions = {\n hasNoTimeout: false,\n ...options,\n };\n if (toastOptions) {\n // Always clear any pending auto-dismiss from the previous toast, including\n // when the replacement is persistent (hasNoTimeout). Otherwise the old\n // timer can fire and dismiss the new toast.\n clearScheduledAutoDismiss();\n cancelAnimation(translateYProgress);\n timeoutDuration = 100;\n animationStartedRef.current = false;\n visibleAtRef.current = null;\n isDismissing.value = false;\n isSwipeActive.value = false;\n setToastOptions(undefined);\n }\n if (replacementTimerRef.current !== null) {\n clearTimeout(replacementTimerRef.current);\n }\n replacementTimerRef.current = setTimeout(() => {\n replacementTimerRef.current = null;\n setToastOptions(normalizedOptions);\n }, timeoutDuration);\n };\n\n const closeToast = () => {\n if (replacementTimerRef.current !== null) {\n clearTimeout(replacementTimerRef.current);\n replacementTimerRef.current = null;\n }\n startDismissAnimation();\n };\n\n const closeToastRef = useRef(closeToast);\n const resumeAutoDismissAfterSwipeRef = useRef(resumeAutoDismissAfterSwipe);\n const clearScheduledAutoDismissRef = useRef(clearScheduledAutoDismiss);\n closeToastRef.current = closeToast;\n resumeAutoDismissAfterSwipeRef.current = resumeAutoDismissAfterSwipe;\n clearScheduledAutoDismissRef.current = clearScheduledAutoDismiss;\n\n const dismissToastFromSwipe = () => {\n closeToastRef.current();\n };\n\n const resumeAutoDismissFromSwipe = (generation: number) => {\n // Ignore resumes from a toast that was replaced or dismissed after the\n // spring-back started (completed springs cannot be cancelled).\n if (generation !== toastGenerationRef.current) {\n return;\n }\n resumeAutoDismissAfterSwipeRef.current();\n };\n\n const clearScheduledAutoDismissFromSwipe = () => {\n clearScheduledAutoDismissRef.current();\n };\n\n const swipeGesture = useMemo(() => {\n // These gesture callbacks need explicit 'worklet' directives because this\n // package ships a pre-built dist compiled by ts-bridge (tsc), which emits the\n // gesture chain as a namespaced call (react_native_gesture_handler_1.Gesture).\n // The consumer's Reanimated/Worklets Babel plugin does run over dist, but its\n // gesture auto-detection doesn't recognize that compiled namespaced form.\n const springBackAfterSwipe = () => {\n 'worklet';\n\n const generationAtSpringStart = toastGeneration.value;\n translateYProgress.value = withSpring(\n visibleTranslateY.value,\n TOAST_SPRING_CONFIG,\n (finished) => {\n // A new pan cancels this spring via cancelAnimation; only resume\n // auto-dismiss when the spring-back completed naturally.\n if (finished) {\n scheduleOnRN(resumeAutoDismissFromSwipe, generationAtSpringStart);\n }\n },\n );\n };\n\n return Gesture.Pan()\n .activeOffsetY(TOAST_SWIPE_ACTIVE_OFFSET_Y)\n .failOffsetX([-TOAST_SWIPE_FAIL_OFFSET_X, TOAST_SWIPE_FAIL_OFFSET_X])\n .onStart(() => {\n 'worklet';\n\n // Don't interrupt an in-progress dismiss animation.\n if (isDismissing.value) {\n return;\n }\n isSwipeActive.value = true;\n scheduleOnRN(clearScheduledAutoDismissFromSwipe);\n cancelAnimation(translateYProgress);\n gestureStartY.value = translateYProgress.value;\n })\n .onUpdate((event) => {\n 'worklet';\n\n if (isDismissing.value || !isSwipeActive.value) {\n return;\n }\n const nextTranslateY = gestureStartY.value + event.translationY;\n // Toast sits at the top; only allow dragging upward (more negative).\n translateYProgress.value = Math.min(\n nextTranslateY,\n visibleTranslateY.value,\n );\n })\n .onEnd((event) => {\n 'worklet';\n\n if (!isSwipeActive.value) {\n return;\n }\n isSwipeActive.value = false;\n\n if (isDismissing.value) {\n return;\n }\n const { translationY, velocityY } = event;\n const dismissDistance = Math.max(\n toastHeight.value * TOAST_DISMISS_DISTANCE_THRESHOLD,\n TOAST_DISMISS_MIN_DISTANCE,\n );\n const hasReachedDismissOffset = translationY <= -dismissDistance;\n const hasReachedSwipeThreshold =\n Math.abs(velocityY) > TOAST_DISMISS_VELOCITY_THRESHOLD;\n const isQuickDismissing = velocityY < 0;\n\n const shouldDismiss =\n hasReachedDismissOffset ||\n (hasReachedSwipeThreshold && isQuickDismissing);\n\n if (shouldDismiss) {\n scheduleOnRN(dismissToastFromSwipe);\n return;\n }\n\n springBackAfterSwipe();\n })\n .onFinalize(() => {\n 'worklet';\n\n // onEnd is skipped when the pan fails/cancels after activation\n // (e.g. horizontal travel past failOffsetX). Recover position and\n // auto-dismiss so the toast is not left stuck mid-offset.\n if (!isSwipeActive.value) {\n return;\n }\n // Clear before the dismiss check — same order as onEnd — so a pan\n // cancelled mid-dismiss cannot leave isSwipeActive stuck true for a\n // later toast (resetState alone is not enough if finalize races it).\n isSwipeActive.value = false;\n\n if (isDismissing.value) {\n return;\n }\n springBackAfterSwipe();\n });\n // Shared values and swipe JS wrappers are stable for the component lifetime.\n }, []);\n\n innerRef.current = {\n closeToast,\n showToast,\n };\n\n useImperativeHandle(ref, () => innerRef.current as ToasterRef);\n\n useLayoutEffect(() => {\n registeredRef = innerRef;\n return () => {\n if (registeredRef === innerRef) {\n registeredRef = null;\n }\n };\n }, []);\n\n if (!toastOptions) {\n return null;\n }\n\n const {\n onClose: toastOnClose,\n showCloseButton = true,\n twClassName: toastTwClassName,\n } = toastOptions;\n const toastProps = getToastProps(toastOptions);\n const { actionButtonLabel, actionButtonOnPress, ...restToastProps } =\n toastProps;\n const toastTwClassNames = [twClassName, toastTwClassName]\n .filter(Boolean)\n .join(' ');\n const handleClose = showCloseButton\n ? () => {\n closeToast();\n toastOnClose?.();\n }\n : undefined;\n\n const onAnimatedViewLayout = (e: LayoutChangeEvent) => {\n const { height } = e.nativeEvent.layout;\n const nextHiddenTranslateY = getHiddenTranslateY(height, topOffset);\n const nextVisibleTranslateY = topInset + TOAST_TOP_PADDING;\n\n hiddenTranslateY.value = nextHiddenTranslateY;\n visibleTranslateY.value = nextVisibleTranslateY;\n toastHeight.value = height;\n\n if (animationStartedRef.current) {\n return;\n }\n\n animationStartedRef.current = true;\n translateYProgress.value = nextHiddenTranslateY;\n\n if (toastOptions.hasNoTimeout) {\n translateYProgress.value = withSpring(\n nextVisibleTranslateY,\n TOAST_SPRING_CONFIG,\n );\n } else {\n translateYProgress.value = withSpring(\n nextVisibleTranslateY,\n TOAST_SPRING_CONFIG,\n (finished) => {\n if (finished) {\n scheduleOnRN(beginAutoDismiss);\n }\n },\n );\n }\n };\n\n return (\n <GestureDetector gesture={swipeGesture}>\n <Animated.View\n onLayout={onAnimatedViewLayout}\n style={baseStyle}\n {...props}\n >\n {actionButtonLabel && actionButtonOnPress ? (\n <Toast\n {...toastProps}\n actionButtonLabel={actionButtonLabel}\n actionButtonOnPress={actionButtonOnPress}\n onClose={handleClose}\n twClassName={toastTwClassNames}\n />\n ) : (\n <Toast\n {...restToastProps}\n onClose={handleClose}\n twClassName={toastTwClassNames}\n />\n )}\n </Animated.View>\n </GestureDetector>\n );\n },\n);\n\nToasterComponent.displayName = 'Toaster';\n\ntype ToastFunction = ((options: ToastOptions) => void) & {\n dismiss: () => void;\n};\n\nexport const Toaster = ToasterComponent;\n\nexport const toast = ((options: ToastOptions) => {\n assertRegisteredRef('toast').showToast(options);\n}) as ToastFunction;\n\ntoast.dismiss = () => {\n assertRegisteredRef('dismiss').closeToast();\n};\n"]}
|
|
@@ -4,7 +4,7 @@ type ToastFunction = ((options: ToastOptions) => void) & {
|
|
|
4
4
|
dismiss: () => void;
|
|
5
5
|
};
|
|
6
6
|
export declare const Toaster: React.ForwardRefExoticComponent<{
|
|
7
|
-
twClassName?: string
|
|
7
|
+
twClassName?: string;
|
|
8
8
|
} & Omit<import("react-native").ViewProps, "style"> & React.RefAttributes<ToasterRef>>;
|
|
9
9
|
export declare const toast: ToastFunction;
|
|
10
10
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toaster.d.cts","sourceRoot":"","sources":["../../../src/components/Toast/Toaster.tsx"],"names":[],"mappings":"AAEA,OAAO,KAON,cAAc;AA0Bf,OAAO,KAAK,EACV,YAAY,EAGZ,UAAU,EACX,0BAAsB;AAsZvB,KAAK,aAAa,GAAG,CAAC,CAAC,OAAO,EAAE,YAAY,KAAK,IAAI,CAAC,GAAG;IACvD,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB,CAAC;AAEF,eAAO,MAAM,OAAO;;sFAAmB,CAAC;AAExC,eAAO,MAAM,KAAK,
|
|
1
|
+
{"version":3,"file":"Toaster.d.cts","sourceRoot":"","sources":["../../../src/components/Toast/Toaster.tsx"],"names":[],"mappings":"AAEA,OAAO,KAON,cAAc;AA0Bf,OAAO,KAAK,EACV,YAAY,EAGZ,UAAU,EACX,0BAAsB;AAsZvB,KAAK,aAAa,GAAG,CAAC,CAAC,OAAO,EAAE,YAAY,KAAK,IAAI,CAAC,GAAG;IACvD,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB,CAAC;AAEF,eAAO,MAAM,OAAO;;sFAAmB,CAAC;AAExC,eAAO,MAAM,KAAK,EAEZ,aAAa,CAAC"}
|
|
@@ -4,7 +4,7 @@ type ToastFunction = ((options: ToastOptions) => void) & {
|
|
|
4
4
|
dismiss: () => void;
|
|
5
5
|
};
|
|
6
6
|
export declare const Toaster: React.ForwardRefExoticComponent<{
|
|
7
|
-
twClassName?: string
|
|
7
|
+
twClassName?: string;
|
|
8
8
|
} & Omit<import("react-native").ViewProps, "style"> & React.RefAttributes<ToasterRef>>;
|
|
9
9
|
export declare const toast: ToastFunction;
|
|
10
10
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toaster.d.mts","sourceRoot":"","sources":["../../../src/components/Toast/Toaster.tsx"],"names":[],"mappings":"AAEA,OAAO,KAON,cAAc;AA0Bf,OAAO,KAAK,EACV,YAAY,EAGZ,UAAU,EACX,0BAAsB;AAsZvB,KAAK,aAAa,GAAG,CAAC,CAAC,OAAO,EAAE,YAAY,KAAK,IAAI,CAAC,GAAG;IACvD,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB,CAAC;AAEF,eAAO,MAAM,OAAO;;sFAAmB,CAAC;AAExC,eAAO,MAAM,KAAK,
|
|
1
|
+
{"version":3,"file":"Toaster.d.mts","sourceRoot":"","sources":["../../../src/components/Toast/Toaster.tsx"],"names":[],"mappings":"AAEA,OAAO,KAON,cAAc;AA0Bf,OAAO,KAAK,EACV,YAAY,EAGZ,UAAU,EACX,0BAAsB;AAsZvB,KAAK,aAAa,GAAG,CAAC,CAAC,OAAO,EAAE,YAAY,KAAK,IAAI,CAAC,GAAG;IACvD,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB,CAAC;AAEF,eAAO,MAAM,OAAO;;sFAAmB,CAAC;AAExC,eAAO,MAAM,KAAK,EAEZ,aAAa,CAAC"}
|