@metamask/design-system-react-native 0.26.0 → 0.28.0
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 +38 -1
- package/dist/components/ActionListItem/ActionListItem.cjs +1 -1
- package/dist/components/ActionListItem/ActionListItem.cjs.map +1 -1
- package/dist/components/ActionListItem/ActionListItem.mjs +1 -1
- package/dist/components/ActionListItem/ActionListItem.mjs.map +1 -1
- package/dist/components/ActionListItem/ActionListItem.types.d.cts +1 -1
- package/dist/components/ActionListItem/ActionListItem.types.d.cts.map +1 -1
- package/dist/components/ActionListItem/ActionListItem.types.d.mts +1 -1
- package/dist/components/ActionListItem/ActionListItem.types.d.mts.map +1 -1
- package/dist/components/AvatarBase/AvatarBase.cjs +2 -2
- package/dist/components/AvatarBase/AvatarBase.cjs.map +1 -1
- package/dist/components/AvatarBase/AvatarBase.mjs +2 -2
- package/dist/components/AvatarBase/AvatarBase.mjs.map +1 -1
- package/dist/components/AvatarBase/AvatarBase.types.d.cts +1 -1
- package/dist/components/AvatarBase/AvatarBase.types.d.cts.map +1 -1
- package/dist/components/AvatarBase/AvatarBase.types.d.mts +1 -1
- package/dist/components/AvatarBase/AvatarBase.types.d.mts.map +1 -1
- package/dist/components/AvatarFavicon/AvatarFavicon.cjs +2 -2
- 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/AvatarFavicon/AvatarFavicon.mjs +2 -2
- package/dist/components/AvatarFavicon/AvatarFavicon.mjs.map +1 -1
- package/dist/components/AvatarGroup/AvatarGroup.cjs +1 -1
- package/dist/components/AvatarGroup/AvatarGroup.cjs.map +1 -1
- package/dist/components/AvatarGroup/AvatarGroup.mjs +1 -1
- package/dist/components/AvatarGroup/AvatarGroup.mjs.map +1 -1
- package/dist/components/AvatarGroup/AvatarGroup.types.d.cts +1 -1
- package/dist/components/AvatarGroup/AvatarGroup.types.d.cts.map +1 -1
- package/dist/components/AvatarGroup/AvatarGroup.types.d.mts +1 -1
- package/dist/components/AvatarGroup/AvatarGroup.types.d.mts.map +1 -1
- package/dist/components/AvatarNetwork/AvatarNetwork.cjs +2 -2
- 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 +2 -2
- package/dist/components/AvatarNetwork/AvatarNetwork.mjs.map +1 -1
- package/dist/components/AvatarToken/AvatarToken.cjs +2 -2
- 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 +2 -2
- package/dist/components/AvatarToken/AvatarToken.mjs.map +1 -1
- package/dist/components/BadgeCount/BadgeCount.cjs +1 -1
- package/dist/components/BadgeCount/BadgeCount.cjs.map +1 -1
- package/dist/components/BadgeCount/BadgeCount.mjs +1 -1
- package/dist/components/BadgeCount/BadgeCount.mjs.map +1 -1
- package/dist/components/BadgeCount/BadgeCount.types.d.cts +1 -1
- package/dist/components/BadgeCount/BadgeCount.types.d.cts.map +1 -1
- package/dist/components/BadgeCount/BadgeCount.types.d.mts +1 -1
- package/dist/components/BadgeCount/BadgeCount.types.d.mts.map +1 -1
- package/dist/components/BadgeIcon/BadgeIcon.cjs +1 -1
- package/dist/components/BadgeIcon/BadgeIcon.cjs.map +1 -1
- package/dist/components/BadgeIcon/BadgeIcon.mjs +1 -1
- package/dist/components/BadgeIcon/BadgeIcon.mjs.map +1 -1
- package/dist/components/BadgeIcon/BadgeIcon.types.d.cts +1 -1
- package/dist/components/BadgeIcon/BadgeIcon.types.d.cts.map +1 -1
- package/dist/components/BadgeIcon/BadgeIcon.types.d.mts +1 -1
- package/dist/components/BadgeIcon/BadgeIcon.types.d.mts.map +1 -1
- package/dist/components/BadgeStatus/BadgeStatus.cjs +1 -1
- package/dist/components/BadgeStatus/BadgeStatus.cjs.map +1 -1
- package/dist/components/BadgeStatus/BadgeStatus.mjs +1 -1
- package/dist/components/BadgeStatus/BadgeStatus.mjs.map +1 -1
- package/dist/components/BadgeStatus/BadgeStatus.types.d.cts +1 -1
- package/dist/components/BadgeStatus/BadgeStatus.types.d.cts.map +1 -1
- package/dist/components/BadgeStatus/BadgeStatus.types.d.mts +1 -1
- package/dist/components/BadgeStatus/BadgeStatus.types.d.mts.map +1 -1
- package/dist/components/BadgeWrapper/BadgeWrapper.cjs +1 -1
- package/dist/components/BadgeWrapper/BadgeWrapper.cjs.map +1 -1
- package/dist/components/BadgeWrapper/BadgeWrapper.mjs +1 -1
- package/dist/components/BadgeWrapper/BadgeWrapper.mjs.map +1 -1
- package/dist/components/BadgeWrapper/BadgeWrapper.types.d.cts +1 -1
- package/dist/components/BadgeWrapper/BadgeWrapper.types.d.cts.map +1 -1
- package/dist/components/BadgeWrapper/BadgeWrapper.types.d.mts +1 -1
- package/dist/components/BadgeWrapper/BadgeWrapper.types.d.mts.map +1 -1
- package/dist/components/BannerBase/BannerBase.types.d.cts +1 -1
- package/dist/components/BannerBase/BannerBase.types.d.cts.map +1 -1
- package/dist/components/BannerBase/BannerBase.types.d.mts +1 -1
- package/dist/components/BannerBase/BannerBase.types.d.mts.map +1 -1
- package/dist/components/BottomSheet/BottomSheet.cjs +9 -6
- package/dist/components/BottomSheet/BottomSheet.cjs.map +1 -1
- package/dist/components/BottomSheet/BottomSheet.d.cts +0 -35
- package/dist/components/BottomSheet/BottomSheet.d.cts.map +1 -1
- package/dist/components/BottomSheet/BottomSheet.d.mts +0 -35
- package/dist/components/BottomSheet/BottomSheet.d.mts.map +1 -1
- package/dist/components/BottomSheet/BottomSheet.mjs +9 -6
- package/dist/components/BottomSheet/BottomSheet.mjs.map +1 -1
- package/dist/components/BottomSheetDialog/BottomSheetDialog.cjs +28 -17
- package/dist/components/BottomSheetDialog/BottomSheetDialog.cjs.map +1 -1
- package/dist/components/BottomSheetDialog/BottomSheetDialog.d.cts +0 -35
- package/dist/components/BottomSheetDialog/BottomSheetDialog.d.cts.map +1 -1
- package/dist/components/BottomSheetDialog/BottomSheetDialog.d.mts +0 -35
- package/dist/components/BottomSheetDialog/BottomSheetDialog.d.mts.map +1 -1
- package/dist/components/BottomSheetDialog/BottomSheetDialog.mjs +30 -19
- package/dist/components/BottomSheetDialog/BottomSheetDialog.mjs.map +1 -1
- package/dist/components/BottomSheetDialog/BottomSheetDialog.types.cjs.map +1 -1
- package/dist/components/BottomSheetDialog/BottomSheetDialog.types.d.cts +1 -9
- package/dist/components/BottomSheetDialog/BottomSheetDialog.types.d.cts.map +1 -1
- package/dist/components/BottomSheetDialog/BottomSheetDialog.types.d.mts +1 -9
- package/dist/components/BottomSheetDialog/BottomSheetDialog.types.d.mts.map +1 -1
- package/dist/components/BottomSheetDialog/BottomSheetDialog.types.mjs.map +1 -1
- package/dist/components/BottomSheetFooter/BottomSheetFooter.cjs +1 -1
- package/dist/components/BottomSheetFooter/BottomSheetFooter.cjs.map +1 -1
- package/dist/components/BottomSheetFooter/BottomSheetFooter.mjs +1 -1
- package/dist/components/BottomSheetFooter/BottomSheetFooter.mjs.map +1 -1
- package/dist/components/BottomSheetFooter/BottomSheetFooter.types.d.cts +1 -1
- package/dist/components/BottomSheetFooter/BottomSheetFooter.types.d.cts.map +1 -1
- package/dist/components/BottomSheetFooter/BottomSheetFooter.types.d.mts +1 -1
- package/dist/components/BottomSheetFooter/BottomSheetFooter.types.d.mts.map +1 -1
- package/dist/components/BottomSheetHeader/BottomSheetHeader.cjs +2 -6
- package/dist/components/BottomSheetHeader/BottomSheetHeader.cjs.map +1 -1
- package/dist/components/BottomSheetHeader/BottomSheetHeader.d.cts.map +1 -1
- package/dist/components/BottomSheetHeader/BottomSheetHeader.d.mts.map +1 -1
- package/dist/components/BottomSheetHeader/BottomSheetHeader.mjs +2 -6
- package/dist/components/BottomSheetHeader/BottomSheetHeader.mjs.map +1 -1
- package/dist/components/BottomSheetHeader/BottomSheetHeader.types.cjs +0 -11
- package/dist/components/BottomSheetHeader/BottomSheetHeader.types.cjs.map +1 -1
- package/dist/components/BottomSheetHeader/BottomSheetHeader.types.d.cts +6 -20
- package/dist/components/BottomSheetHeader/BottomSheetHeader.types.d.cts.map +1 -1
- package/dist/components/BottomSheetHeader/BottomSheetHeader.types.d.mts +6 -20
- package/dist/components/BottomSheetHeader/BottomSheetHeader.types.d.mts.map +1 -1
- package/dist/components/BottomSheetHeader/BottomSheetHeader.types.mjs +1 -10
- package/dist/components/BottomSheetHeader/BottomSheetHeader.types.mjs.map +1 -1
- package/dist/components/BottomSheetHeader/index.cjs +1 -3
- package/dist/components/BottomSheetHeader/index.cjs.map +1 -1
- package/dist/components/BottomSheetHeader/index.d.cts +0 -1
- package/dist/components/BottomSheetHeader/index.d.cts.map +1 -1
- package/dist/components/BottomSheetHeader/index.d.mts +0 -1
- package/dist/components/BottomSheetHeader/index.d.mts.map +1 -1
- package/dist/components/BottomSheetHeader/index.mjs +0 -1
- package/dist/components/BottomSheetHeader/index.mjs.map +1 -1
- package/dist/components/BottomSheetOverlay/BottomSheetOverlay.cjs +2 -2
- package/dist/components/BottomSheetOverlay/BottomSheetOverlay.cjs.map +1 -1
- package/dist/components/BottomSheetOverlay/BottomSheetOverlay.d.cts.map +1 -1
- package/dist/components/BottomSheetOverlay/BottomSheetOverlay.d.mts.map +1 -1
- package/dist/components/BottomSheetOverlay/BottomSheetOverlay.mjs +3 -3
- package/dist/components/BottomSheetOverlay/BottomSheetOverlay.mjs.map +1 -1
- package/dist/components/BottomSheetOverlay/BottomSheetOverlay.types.d.cts +1 -1
- package/dist/components/BottomSheetOverlay/BottomSheetOverlay.types.d.cts.map +1 -1
- package/dist/components/BottomSheetOverlay/BottomSheetOverlay.types.d.mts +1 -1
- package/dist/components/BottomSheetOverlay/BottomSheetOverlay.types.d.mts.map +1 -1
- package/dist/components/Box/Box.cjs +1 -1
- package/dist/components/Box/Box.cjs.map +1 -1
- package/dist/components/Box/Box.d.cts +1 -1
- package/dist/components/Box/Box.d.cts.map +1 -1
- package/dist/components/Box/Box.d.mts +1 -1
- package/dist/components/Box/Box.d.mts.map +1 -1
- package/dist/components/Box/Box.mjs +1 -1
- package/dist/components/Box/Box.mjs.map +1 -1
- package/dist/components/Box/Box.types.d.cts +1 -1
- package/dist/components/Box/Box.types.d.cts.map +1 -1
- package/dist/components/Box/Box.types.d.mts +1 -1
- package/dist/components/Box/Box.types.d.mts.map +1 -1
- package/dist/components/ButtonBase/ButtonBase.types.d.cts +1 -2
- package/dist/components/ButtonBase/ButtonBase.types.d.cts.map +1 -1
- package/dist/components/ButtonBase/ButtonBase.types.d.mts +1 -2
- package/dist/components/ButtonBase/ButtonBase.types.d.mts.map +1 -1
- package/dist/components/ButtonIcon/ButtonIcon.types.d.cts +1 -1
- package/dist/components/ButtonIcon/ButtonIcon.types.d.cts.map +1 -1
- package/dist/components/ButtonIcon/ButtonIcon.types.d.mts +1 -1
- package/dist/components/ButtonIcon/ButtonIcon.types.d.mts.map +1 -1
- package/dist/components/Card/Card.cjs +2 -2
- package/dist/components/Card/Card.cjs.map +1 -1
- package/dist/components/Card/Card.mjs +2 -2
- package/dist/components/Card/Card.mjs.map +1 -1
- package/dist/components/Card/Card.types.cjs.map +1 -1
- package/dist/components/Card/Card.types.d.cts +2 -2
- package/dist/components/Card/Card.types.d.cts.map +1 -1
- package/dist/components/Card/Card.types.d.mts +2 -2
- package/dist/components/Card/Card.types.d.mts.map +1 -1
- package/dist/components/Card/Card.types.mjs.map +1 -1
- package/dist/components/Checkbox/Checkbox.cjs +1 -1
- package/dist/components/Checkbox/Checkbox.cjs.map +1 -1
- package/dist/components/Checkbox/Checkbox.d.cts +1 -1
- package/dist/components/Checkbox/Checkbox.d.cts.map +1 -1
- package/dist/components/Checkbox/Checkbox.d.mts +1 -1
- package/dist/components/Checkbox/Checkbox.d.mts.map +1 -1
- package/dist/components/Checkbox/Checkbox.mjs +1 -1
- package/dist/components/Checkbox/Checkbox.mjs.map +1 -1
- package/dist/components/Checkbox/Checkbox.types.d.cts +1 -1
- package/dist/components/Checkbox/Checkbox.types.d.cts.map +1 -1
- package/dist/components/Checkbox/Checkbox.types.d.mts +1 -1
- package/dist/components/Checkbox/Checkbox.types.d.mts.map +1 -1
- package/dist/components/Content/Content.cjs +71 -0
- package/dist/components/Content/Content.cjs.map +1 -0
- package/dist/components/Content/Content.constants.cjs +9 -0
- package/dist/components/Content/Content.constants.cjs.map +1 -0
- package/dist/components/Content/Content.constants.d.cts +3 -0
- package/dist/components/Content/Content.constants.d.cts.map +1 -0
- package/dist/components/Content/Content.constants.d.mts +3 -0
- package/dist/components/Content/Content.constants.d.mts.map +1 -0
- package/dist/components/Content/Content.constants.mjs +6 -0
- package/dist/components/Content/Content.constants.mjs.map +1 -0
- package/dist/components/Content/Content.d.cts +4 -0
- package/dist/components/Content/Content.d.cts.map +1 -0
- package/dist/components/Content/Content.d.mts +4 -0
- package/dist/components/Content/Content.d.mts.map +1 -0
- package/dist/components/Content/Content.mjs +71 -0
- package/dist/components/Content/Content.mjs.map +1 -0
- package/dist/components/Content/Content.types.cjs +3 -0
- package/dist/components/Content/Content.types.cjs.map +1 -0
- package/dist/components/Content/Content.types.d.cts +31 -0
- package/dist/components/Content/Content.types.d.cts.map +1 -0
- package/dist/components/Content/Content.types.d.mts +31 -0
- package/dist/components/Content/Content.types.d.mts.map +1 -0
- package/dist/components/Content/Content.types.mjs +2 -0
- package/dist/components/Content/Content.types.mjs.map +1 -0
- package/dist/components/Content/index.cjs +8 -0
- package/dist/components/Content/index.cjs.map +1 -0
- package/dist/components/Content/index.d.cts +4 -0
- package/dist/components/Content/index.d.cts.map +1 -0
- package/dist/components/Content/index.d.mts +4 -0
- package/dist/components/Content/index.d.mts.map +1 -0
- package/dist/components/Content/index.mjs +3 -0
- package/dist/components/Content/index.mjs.map +1 -0
- package/dist/components/HeaderBase/HeaderBase.cjs +94 -73
- package/dist/components/HeaderBase/HeaderBase.cjs.map +1 -1
- package/dist/components/HeaderBase/HeaderBase.d.cts.map +1 -1
- package/dist/components/HeaderBase/HeaderBase.d.mts.map +1 -1
- package/dist/components/HeaderBase/HeaderBase.mjs +94 -73
- package/dist/components/HeaderBase/HeaderBase.mjs.map +1 -1
- package/dist/components/HeaderBase/HeaderBase.types.cjs +0 -12
- package/dist/components/HeaderBase/HeaderBase.types.cjs.map +1 -1
- package/dist/components/HeaderBase/HeaderBase.types.d.cts +12 -20
- package/dist/components/HeaderBase/HeaderBase.types.d.cts.map +1 -1
- package/dist/components/HeaderBase/HeaderBase.types.d.mts +12 -20
- package/dist/components/HeaderBase/HeaderBase.types.d.mts.map +1 -1
- package/dist/components/HeaderBase/HeaderBase.types.mjs +1 -11
- package/dist/components/HeaderBase/HeaderBase.types.mjs.map +1 -1
- package/dist/components/HeaderBase/index.cjs +1 -3
- package/dist/components/HeaderBase/index.cjs.map +1 -1
- package/dist/components/HeaderBase/index.d.cts +0 -1
- package/dist/components/HeaderBase/index.d.cts.map +1 -1
- package/dist/components/HeaderBase/index.d.mts +0 -1
- package/dist/components/HeaderBase/index.d.mts.map +1 -1
- package/dist/components/HeaderBase/index.mjs +0 -1
- package/dist/components/HeaderBase/index.mjs.map +1 -1
- package/dist/components/HeaderRoot/HeaderRoot.types.d.cts +1 -1
- package/dist/components/HeaderRoot/HeaderRoot.types.d.cts.map +1 -1
- package/dist/components/HeaderRoot/HeaderRoot.types.d.mts +1 -1
- package/dist/components/HeaderRoot/HeaderRoot.types.d.mts.map +1 -1
- package/dist/components/HeaderStandardAnimated/useHeaderStandardAnimated.cjs +4 -12
- package/dist/components/HeaderStandardAnimated/useHeaderStandardAnimated.cjs.map +1 -1
- package/dist/components/HeaderStandardAnimated/useHeaderStandardAnimated.d.cts +0 -8
- package/dist/components/HeaderStandardAnimated/useHeaderStandardAnimated.d.cts.map +1 -1
- package/dist/components/HeaderStandardAnimated/useHeaderStandardAnimated.d.mts +0 -8
- package/dist/components/HeaderStandardAnimated/useHeaderStandardAnimated.d.mts.map +1 -1
- package/dist/components/HeaderStandardAnimated/useHeaderStandardAnimated.mjs +3 -10
- package/dist/components/HeaderStandardAnimated/useHeaderStandardAnimated.mjs.map +1 -1
- package/dist/components/Icon/Icon.assets.cjs +2 -0
- package/dist/components/Icon/Icon.assets.cjs.map +1 -1
- package/dist/components/Icon/Icon.assets.d.cts.map +1 -1
- package/dist/components/Icon/Icon.assets.d.mts.map +1 -1
- package/dist/components/Icon/Icon.assets.mjs +2 -0
- package/dist/components/Icon/Icon.assets.mjs.map +1 -1
- package/dist/components/Icon/Icon.cjs +3 -1
- package/dist/components/Icon/Icon.cjs.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/Icon.mjs +3 -1
- package/dist/components/Icon/Icon.mjs.map +1 -1
- package/dist/components/Icon/assets/flash-filled.svg +1 -0
- package/dist/components/Input/Input.cjs +1 -1
- package/dist/components/Input/Input.cjs.map +1 -1
- package/dist/components/Input/Input.d.cts +1 -2
- package/dist/components/Input/Input.d.cts.map +1 -1
- package/dist/components/Input/Input.d.mts +1 -2
- package/dist/components/Input/Input.d.mts.map +1 -1
- package/dist/components/Input/Input.mjs +1 -1
- package/dist/components/Input/Input.mjs.map +1 -1
- package/dist/components/Input/Input.types.d.cts +1 -1
- package/dist/components/Input/Input.types.d.cts.map +1 -1
- package/dist/components/Input/Input.types.d.mts +1 -1
- package/dist/components/Input/Input.types.d.mts.map +1 -1
- package/dist/components/KeyValueColumn/KeyValueColumn.types.d.cts +1 -1
- package/dist/components/KeyValueColumn/KeyValueColumn.types.d.cts.map +1 -1
- package/dist/components/KeyValueColumn/KeyValueColumn.types.d.mts +1 -1
- package/dist/components/KeyValueColumn/KeyValueColumn.types.d.mts.map +1 -1
- package/dist/components/KeyValueRow/KeyValueRow.types.d.cts +1 -1
- package/dist/components/KeyValueRow/KeyValueRow.types.d.cts.map +1 -1
- package/dist/components/KeyValueRow/KeyValueRow.types.d.mts +1 -1
- package/dist/components/KeyValueRow/KeyValueRow.types.d.mts.map +1 -1
- package/dist/components/ListItem/ListItem.cjs +1 -1
- package/dist/components/ListItem/ListItem.cjs.map +1 -1
- package/dist/components/ListItem/ListItem.mjs +1 -1
- package/dist/components/ListItem/ListItem.mjs.map +1 -1
- package/dist/components/ListItem/ListItem.types.d.cts +1 -1
- package/dist/components/ListItem/ListItem.types.d.cts.map +1 -1
- package/dist/components/ListItem/ListItem.types.d.mts +1 -1
- package/dist/components/ListItem/ListItem.types.d.mts.map +1 -1
- package/dist/components/MainActionButton/MainActionButton.types.d.cts +1 -1
- package/dist/components/MainActionButton/MainActionButton.types.d.cts.map +1 -1
- package/dist/components/MainActionButton/MainActionButton.types.d.mts +1 -1
- package/dist/components/MainActionButton/MainActionButton.types.d.mts.map +1 -1
- package/dist/components/RadioButton/RadioButton.cjs +1 -1
- package/dist/components/RadioButton/RadioButton.cjs.map +1 -1
- package/dist/components/RadioButton/RadioButton.mjs +1 -1
- package/dist/components/RadioButton/RadioButton.mjs.map +1 -1
- package/dist/components/RadioButton/RadioButton.types.d.cts +1 -2
- package/dist/components/RadioButton/RadioButton.types.d.cts.map +1 -1
- package/dist/components/RadioButton/RadioButton.types.d.mts +1 -2
- package/dist/components/RadioButton/RadioButton.types.d.mts.map +1 -1
- package/dist/components/SectionDivider/SectionDivider.d.cts +1 -1
- package/dist/components/SectionDivider/SectionDivider.d.cts.map +1 -1
- package/dist/components/SectionDivider/SectionDivider.d.mts +1 -1
- package/dist/components/SectionDivider/SectionDivider.d.mts.map +1 -1
- package/dist/components/SectionHeader/SectionHeader.cjs +47 -24
- package/dist/components/SectionHeader/SectionHeader.cjs.map +1 -1
- package/dist/components/SectionHeader/SectionHeader.d.cts +16 -13
- package/dist/components/SectionHeader/SectionHeader.d.cts.map +1 -1
- package/dist/components/SectionHeader/SectionHeader.d.mts +16 -13
- package/dist/components/SectionHeader/SectionHeader.d.mts.map +1 -1
- package/dist/components/SectionHeader/SectionHeader.mjs +48 -25
- 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 +16 -9
- package/dist/components/SectionHeader/SectionHeader.types.d.cts.map +1 -1
- package/dist/components/SectionHeader/SectionHeader.types.d.mts +16 -9
- package/dist/components/SectionHeader/SectionHeader.types.d.mts.map +1 -1
- package/dist/components/SectionHeader/SectionHeader.types.mjs.map +1 -1
- package/dist/components/SegmentGroup/SegmentGroup.cjs +5 -7
- package/dist/components/SegmentGroup/SegmentGroup.cjs.map +1 -1
- package/dist/components/SegmentGroup/SegmentGroup.d.cts.map +1 -1
- package/dist/components/SegmentGroup/SegmentGroup.d.mts.map +1 -1
- package/dist/components/SegmentGroup/SegmentGroup.mjs +6 -8
- package/dist/components/SegmentGroup/SegmentGroup.mjs.map +1 -1
- package/dist/components/SegmentGroup/SegmentGroup.types.d.cts +1 -1
- package/dist/components/SegmentGroup/SegmentGroup.types.d.cts.map +1 -1
- package/dist/components/SegmentGroup/SegmentGroup.types.d.mts +1 -1
- package/dist/components/SegmentGroup/SegmentGroup.types.d.mts.map +1 -1
- package/dist/components/SelectButton/SelectButton.cjs +1 -1
- package/dist/components/SelectButton/SelectButton.cjs.map +1 -1
- package/dist/components/SelectButton/SelectButton.mjs +2 -2
- package/dist/components/SelectButton/SelectButton.mjs.map +1 -1
- package/dist/components/SelectButton/SelectButton.types.cjs.map +1 -1
- package/dist/components/SelectButton/SelectButton.types.d.cts +1 -1
- package/dist/components/SelectButton/SelectButton.types.d.cts.map +1 -1
- package/dist/components/SelectButton/SelectButton.types.d.mts +1 -1
- package/dist/components/SelectButton/SelectButton.types.d.mts.map +1 -1
- package/dist/components/SelectButton/SelectButton.types.mjs.map +1 -1
- package/dist/components/SelectButton/index.cjs +2 -1
- package/dist/components/SelectButton/index.cjs.map +1 -1
- package/dist/components/SelectButton/index.d.cts +1 -1
- package/dist/components/SelectButton/index.d.cts.map +1 -1
- package/dist/components/SelectButton/index.d.mts +1 -1
- package/dist/components/SelectButton/index.d.mts.map +1 -1
- package/dist/components/SelectButton/index.mjs +1 -1
- package/dist/components/SelectButton/index.mjs.map +1 -1
- package/dist/components/Skeleton/Skeleton.cjs +1 -1
- package/dist/components/Skeleton/Skeleton.cjs.map +1 -1
- package/dist/components/Skeleton/Skeleton.mjs +1 -1
- package/dist/components/Skeleton/Skeleton.mjs.map +1 -1
- package/dist/components/Skeleton/Skeleton.types.d.cts +1 -1
- package/dist/components/Skeleton/Skeleton.types.d.cts.map +1 -1
- package/dist/components/Skeleton/Skeleton.types.d.mts +1 -1
- package/dist/components/Skeleton/Skeleton.types.d.mts.map +1 -1
- package/dist/components/TabEmptyState/TabEmptyState.types.d.cts +1 -1
- package/dist/components/TabEmptyState/TabEmptyState.types.d.cts.map +1 -1
- package/dist/components/TabEmptyState/TabEmptyState.types.d.mts +1 -1
- package/dist/components/TabEmptyState/TabEmptyState.types.d.mts.map +1 -1
- package/dist/components/Tag/Tag.types.d.cts +1 -1
- package/dist/components/Tag/Tag.types.d.cts.map +1 -1
- package/dist/components/Tag/Tag.types.d.mts +1 -1
- package/dist/components/Tag/Tag.types.d.mts.map +1 -1
- package/dist/components/Text/Text.cjs +1 -1
- package/dist/components/Text/Text.cjs.map +1 -1
- package/dist/components/Text/Text.mjs +1 -1
- package/dist/components/Text/Text.mjs.map +1 -1
- package/dist/components/Text/Text.types.d.cts +1 -1
- package/dist/components/Text/Text.types.d.cts.map +1 -1
- package/dist/components/Text/Text.types.d.mts +1 -1
- package/dist/components/Text/Text.types.d.mts.map +1 -1
- package/dist/components/TextArea/TextArea.cjs +4 -8
- package/dist/components/TextArea/TextArea.cjs.map +1 -1
- package/dist/components/TextArea/TextArea.d.cts +160 -161
- package/dist/components/TextArea/TextArea.d.cts.map +1 -1
- package/dist/components/TextArea/TextArea.d.mts +160 -161
- package/dist/components/TextArea/TextArea.d.mts.map +1 -1
- package/dist/components/TextArea/TextArea.mjs +4 -8
- package/dist/components/TextArea/TextArea.mjs.map +1 -1
- package/dist/components/TextArea/TextArea.types.cjs.map +1 -1
- package/dist/components/TextArea/TextArea.types.d.cts +12 -45
- package/dist/components/TextArea/TextArea.types.d.cts.map +1 -1
- package/dist/components/TextArea/TextArea.types.d.mts +12 -45
- package/dist/components/TextArea/TextArea.types.d.mts.map +1 -1
- package/dist/components/TextArea/TextArea.types.mjs.map +1 -1
- package/dist/components/TextButton/TextButton.types.d.cts +0 -1
- package/dist/components/TextButton/TextButton.types.d.cts.map +1 -1
- package/dist/components/TextButton/TextButton.types.d.mts +0 -1
- package/dist/components/TextButton/TextButton.types.d.mts.map +1 -1
- package/dist/components/TextField/TextField.cjs +1 -1
- package/dist/components/TextField/TextField.cjs.map +1 -1
- package/dist/components/TextField/TextField.d.cts +20 -16
- package/dist/components/TextField/TextField.d.cts.map +1 -1
- package/dist/components/TextField/TextField.d.mts +20 -16
- package/dist/components/TextField/TextField.d.mts.map +1 -1
- package/dist/components/TextField/TextField.mjs +1 -1
- package/dist/components/TextField/TextField.mjs.map +1 -1
- package/dist/components/TextField/TextField.types.d.cts +1 -1
- package/dist/components/TextField/TextField.types.d.cts.map +1 -1
- package/dist/components/TextField/TextField.types.d.mts +1 -1
- package/dist/components/TextField/TextField.types.d.mts.map +1 -1
- package/dist/components/TextFieldSearch/TextFieldSearch.d.cts +20 -15
- package/dist/components/TextFieldSearch/TextFieldSearch.d.cts.map +1 -1
- package/dist/components/TextFieldSearch/TextFieldSearch.d.mts +20 -15
- package/dist/components/TextFieldSearch/TextFieldSearch.d.mts.map +1 -1
- package/dist/components/TitleAlert/TitleAlert.types.d.cts +1 -1
- package/dist/components/TitleAlert/TitleAlert.types.d.cts.map +1 -1
- package/dist/components/TitleAlert/TitleAlert.types.d.mts +1 -1
- package/dist/components/TitleAlert/TitleAlert.types.d.mts.map +1 -1
- package/dist/components/TitleHub/TitleHub.types.d.cts +1 -1
- package/dist/components/TitleHub/TitleHub.types.d.cts.map +1 -1
- package/dist/components/TitleHub/TitleHub.types.d.mts +1 -1
- package/dist/components/TitleHub/TitleHub.types.d.mts.map +1 -1
- package/dist/components/TitleStandard/TitleStandard.types.d.cts +1 -1
- package/dist/components/TitleStandard/TitleStandard.types.d.cts.map +1 -1
- package/dist/components/TitleStandard/TitleStandard.types.d.mts +1 -1
- package/dist/components/TitleStandard/TitleStandard.types.d.mts.map +1 -1
- package/dist/components/TitleSubpage/TitleSubpage.types.d.cts +1 -1
- package/dist/components/TitleSubpage/TitleSubpage.types.d.cts.map +1 -1
- package/dist/components/TitleSubpage/TitleSubpage.types.d.mts +1 -1
- package/dist/components/TitleSubpage/TitleSubpage.types.d.mts.map +1 -1
- package/dist/components/Toast/Toast.types.d.cts +1 -1
- package/dist/components/Toast/Toast.types.d.cts.map +1 -1
- package/dist/components/Toast/Toast.types.d.mts +1 -1
- package/dist/components/Toast/Toast.types.d.mts.map +1 -1
- package/dist/components/Toast/Toaster.cjs +1 -1
- package/dist/components/Toast/Toaster.cjs.map +1 -1
- package/dist/components/Toast/Toaster.mjs +1 -1
- package/dist/components/Toast/Toaster.mjs.map +1 -1
- package/dist/components/index.cjs +7 -5
- package/dist/components/index.cjs.map +1 -1
- package/dist/components/index.d.cts +5 -3
- package/dist/components/index.d.cts.map +1 -1
- package/dist/components/index.d.mts +5 -3
- package/dist/components/index.d.mts.map +1 -1
- package/dist/components/index.mjs +4 -3
- package/dist/components/index.mjs.map +1 -1
- package/dist/components/temp-components/Blockies/Blockies.cjs +1 -1
- package/dist/components/temp-components/Blockies/Blockies.cjs.map +1 -1
- package/dist/components/temp-components/Blockies/Blockies.mjs +1 -1
- package/dist/components/temp-components/Blockies/Blockies.mjs.map +1 -1
- package/dist/components/temp-components/Blockies/Blockies.types.d.cts +1 -1
- package/dist/components/temp-components/Blockies/Blockies.types.d.cts.map +1 -1
- package/dist/components/temp-components/Blockies/Blockies.types.d.mts +1 -1
- package/dist/components/temp-components/Blockies/Blockies.types.d.mts.map +1 -1
- package/dist/components/temp-components/ButtonAnimated/ButtonAnimated.cjs +2 -2
- package/dist/components/temp-components/ButtonAnimated/ButtonAnimated.cjs.map +1 -1
- package/dist/components/temp-components/ButtonAnimated/ButtonAnimated.mjs +2 -2
- package/dist/components/temp-components/ButtonAnimated/ButtonAnimated.mjs.map +1 -1
- package/dist/components/temp-components/ButtonAnimated/ButtonAnimated.types.d.cts +1 -1
- package/dist/components/temp-components/ButtonAnimated/ButtonAnimated.types.d.cts.map +1 -1
- package/dist/components/temp-components/ButtonAnimated/ButtonAnimated.types.d.mts +1 -1
- package/dist/components/temp-components/ButtonAnimated/ButtonAnimated.types.d.mts.map +1 -1
- package/dist/components/temp-components/ImageOrSvg/ImageOrSvg.cjs +1 -1
- package/dist/components/temp-components/ImageOrSvg/ImageOrSvg.cjs.map +1 -1
- package/dist/components/temp-components/ImageOrSvg/ImageOrSvg.mjs +1 -1
- package/dist/components/temp-components/ImageOrSvg/ImageOrSvg.mjs.map +1 -1
- package/dist/components/temp-components/ImageOrSvg/ImageOrSvg.types.cjs.map +1 -1
- package/dist/components/temp-components/ImageOrSvg/ImageOrSvg.types.d.cts +2 -3
- package/dist/components/temp-components/ImageOrSvg/ImageOrSvg.types.d.cts.map +1 -1
- package/dist/components/temp-components/ImageOrSvg/ImageOrSvg.types.d.mts +2 -3
- package/dist/components/temp-components/ImageOrSvg/ImageOrSvg.types.d.mts.map +1 -1
- package/dist/components/temp-components/ImageOrSvg/ImageOrSvg.types.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.mjs +1 -1
- package/dist/components/temp-components/Jazzicon/Jazzicon.mjs.map +1 -1
- package/dist/components/temp-components/Maskicon/Maskicon.cjs +1 -1
- package/dist/components/temp-components/Maskicon/Maskicon.cjs.map +1 -1
- package/dist/components/temp-components/Maskicon/Maskicon.mjs +1 -1
- package/dist/components/temp-components/Maskicon/Maskicon.mjs.map +1 -1
- package/dist/components/temp-components/Spinner/Spinner.cjs +2 -2
- package/dist/components/temp-components/Spinner/Spinner.cjs.map +1 -1
- package/dist/components/temp-components/Spinner/Spinner.mjs +2 -2
- package/dist/components/temp-components/Spinner/Spinner.mjs.map +1 -1
- package/dist/components/temp-components/Spinner/Spinner.types.d.cts +1 -1
- package/dist/components/temp-components/Spinner/Spinner.types.d.cts.map +1 -1
- package/dist/components/temp-components/Spinner/Spinner.types.d.mts +1 -1
- package/dist/components/temp-components/Spinner/Spinner.types.d.mts.map +1 -1
- package/dist/test-utils/createRenderer.cjs +41 -0
- package/dist/test-utils/createRenderer.cjs.map +1 -0
- package/dist/test-utils/createRenderer.d.cts +4 -0
- package/dist/test-utils/createRenderer.d.cts.map +1 -0
- package/dist/test-utils/createRenderer.d.mts +4 -0
- package/dist/test-utils/createRenderer.d.mts.map +1 -0
- package/dist/test-utils/createRenderer.mjs +18 -0
- package/dist/test-utils/createRenderer.mjs.map +1 -0
- package/package.json +21 -22
- package/dist/components/BottomSheetHeader/BottomSheetHeader.constants.cjs +0 -15
- package/dist/components/BottomSheetHeader/BottomSheetHeader.constants.cjs.map +0 -1
- package/dist/components/BottomSheetHeader/BottomSheetHeader.constants.d.cts +0 -7
- package/dist/components/BottomSheetHeader/BottomSheetHeader.constants.d.cts.map +0 -1
- package/dist/components/BottomSheetHeader/BottomSheetHeader.constants.d.mts +0 -7
- package/dist/components/BottomSheetHeader/BottomSheetHeader.constants.d.mts.map +0 -1
- package/dist/components/BottomSheetHeader/BottomSheetHeader.constants.mjs +0 -12
- package/dist/components/BottomSheetHeader/BottomSheetHeader.constants.mjs.map +0 -1
- package/dist/components/HeaderBase/HeaderBase.constants.cjs +0 -15
- package/dist/components/HeaderBase/HeaderBase.constants.cjs.map +0 -1
- package/dist/components/HeaderBase/HeaderBase.constants.d.cts +0 -7
- package/dist/components/HeaderBase/HeaderBase.constants.d.cts.map +0 -1
- package/dist/components/HeaderBase/HeaderBase.constants.d.mts +0 -7
- package/dist/components/HeaderBase/HeaderBase.constants.d.mts.map +0 -1
- package/dist/components/HeaderBase/HeaderBase.constants.mjs +0 -12
- package/dist/components/HeaderBase/HeaderBase.constants.mjs.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,41 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.28.0]
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- Added `Content` for composing scrollable and padded content sections on React Native screens; it is closely related to the upcoming `ListItem` work ([#1192](https://github.com/MetaMask/metamask-design-system/pull/1192))
|
|
15
|
+
|
|
16
|
+
### Changed
|
|
17
|
+
|
|
18
|
+
- **BREAKING:** Dropped Node.js 18 support for the release line; consumers must run Node 20 or newer ([#1206](https://github.com/MetaMask/metamask-design-system/pull/1206))
|
|
19
|
+
- Added default padding and `isInteractive` support to `SectionHeader` so section rows match the new mobile layout patterns ([#1210](https://github.com/MetaMask/metamask-design-system/pull/1210))
|
|
20
|
+
- **BREAKING:** Flattened `TextArea` so it renders the root `TextInput` directly; pass `TextInput` props on `TextArea`, use the component `ref` for the input, and stop relying on `inputProps` or `inputElement` ([#1205](https://github.com/MetaMask/metamask-design-system/pull/1205))
|
|
21
|
+
- Updated avatar fallback handling so `AvatarToken`, `AvatarNetwork`, and `AvatarFavicon` resolve consistently when the requested image is unavailable ([#1212](https://github.com/MetaMask/metamask-design-system/pull/1212))
|
|
22
|
+
|
|
23
|
+
## [0.27.0]
|
|
24
|
+
|
|
25
|
+
### Added
|
|
26
|
+
|
|
27
|
+
- Added `FlashFilled` icon (filled lightning bolt) to `IconName` ([#1191](https://github.com/MetaMask/metamask-design-system/pull/1191))
|
|
28
|
+
- Added `SelectButtonSize` so `SelectButton` exposes a semantic size type ([#1177](https://github.com/MetaMask/metamask-design-system/pull/1177))
|
|
29
|
+
|
|
30
|
+
### Changed
|
|
31
|
+
|
|
32
|
+
- **BREAKING:** Removed `panGestureHandlerProps` from `BottomSheet` and `BottomSheetDialog` following the migration to the `react-native-gesture-handler` v2 `GestureDetector`/`Gesture.Pan()` API ([#1165](https://github.com/MetaMask/metamask-design-system/pull/1165))
|
|
33
|
+
- See [Migration Guide](./MIGRATION.md#from-version-0260-to-0270)
|
|
34
|
+
- **BREAKING:** Removed the variant-based title API from `HeaderBase` and `BottomSheetHeader` ([#1103](https://github.com/MetaMask/metamask-design-system/pull/1103))
|
|
35
|
+
- Removed `variant`, `HeaderBaseVariant`, and `BottomSheetHeaderVariant`, plus `HeaderBase`'s `titleTestID`
|
|
36
|
+
- String titles now render with a centered `HeadingSm` treatment; pass custom `children` for bespoke title layouts and use `textProps.testID` in place of `titleTestID`
|
|
37
|
+
- See [Migration Guide](./MIGRATION.md#from-version-0260-to-0270)
|
|
38
|
+
- Reduced the default `SegmentGroup` segment spacing from `gap-3` to `gap-1` for tighter grouped segments ([#1194](https://github.com/MetaMask/metamask-design-system/pull/1194))
|
|
39
|
+
|
|
40
|
+
### Fixed
|
|
41
|
+
|
|
42
|
+
- Fixed a `HeaderStandardAnimated` runtime crash under React Native Reanimated 4 by inlining the scroll-handler worklet ([#1185](https://github.com/MetaMask/metamask-design-system/pull/1185))
|
|
43
|
+
- Fixed React Native Web rendering for `BottomSheet`, `BottomSheetOverlay`, `Icon`, and the animated `ButtonAnimated` and `Spinner` components ([#1187](https://github.com/MetaMask/metamask-design-system/pull/1187))
|
|
44
|
+
|
|
10
45
|
## [0.26.0]
|
|
11
46
|
|
|
12
47
|
### Added
|
|
@@ -446,7 +481,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
446
481
|
- Full TypeScript support with type definitions and enums
|
|
447
482
|
- React Native integration with TWRNC preset support
|
|
448
483
|
|
|
449
|
-
[Unreleased]: https://github.com/MetaMask/metamask-design-system/compare/@metamask/design-system-react-native@0.
|
|
484
|
+
[Unreleased]: https://github.com/MetaMask/metamask-design-system/compare/@metamask/design-system-react-native@0.28.0...HEAD
|
|
485
|
+
[0.28.0]: https://github.com/MetaMask/metamask-design-system/compare/@metamask/design-system-react-native@0.27.0...@metamask/design-system-react-native@0.28.0
|
|
486
|
+
[0.27.0]: https://github.com/MetaMask/metamask-design-system/compare/@metamask/design-system-react-native@0.26.0...@metamask/design-system-react-native@0.27.0
|
|
450
487
|
[0.26.0]: https://github.com/MetaMask/metamask-design-system/compare/@metamask/design-system-react-native@0.25.0...@metamask/design-system-react-native@0.26.0
|
|
451
488
|
[0.25.0]: https://github.com/MetaMask/metamask-design-system/compare/@metamask/design-system-react-native@0.24.0...@metamask/design-system-react-native@0.25.0
|
|
452
489
|
[0.24.0]: https://github.com/MetaMask/metamask-design-system/compare/@metamask/design-system-react-native@0.23.0...@metamask/design-system-react-native@0.24.0
|
|
@@ -26,7 +26,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
26
26
|
exports.ActionListItem = void 0;
|
|
27
27
|
const design_system_twrnc_preset_1 = require("@metamask/design-system-twrnc-preset");
|
|
28
28
|
const react_1 = __importStar(require("react"));
|
|
29
|
-
const react_native_1 = require("react-native
|
|
29
|
+
const react_native_1 = require("react-native");
|
|
30
30
|
const Box_1 = require("../Box/index.cjs");
|
|
31
31
|
const Icon_1 = require("../Icon/index.cjs");
|
|
32
32
|
const Text_1 = require("../Text/index.cjs");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActionListItem.cjs","sourceRoot":"","sources":["../../../src/components/ActionListItem/ActionListItem.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qFAAmE;AACnE,+CAA2C;AAC3C
|
|
1
|
+
{"version":3,"file":"ActionListItem.cjs","sourceRoot":"","sources":["../../../src/components/ActionListItem/ActionListItem.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qFAAmE;AACnE,+CAA2C;AAC3C,+CAAyC;AAEzC,0CAKgB;AAChB,4CAAyC;AACzC,4CAAuD;AAIhD,MAAM,cAAc,GAAkC,CAAC,EAC5D,KAAK,EACL,WAAW,EACX,cAAc,EACd,YAAY,EACZ,QAAQ,EACR,cAAc,EACd,oBAAoB,EACpB,SAAS,EACT,UAAU,GAAG,KAAK,EAClB,OAAO,EACP,cAAc,EACd,WAAW,EACX,KAAK,EACL,GAAG,KAAK,EACT,EAAE,EAAE;IACH,MAAM,EAAE,GAAG,IAAA,wCAAW,GAAE,CAAC;IAEzB,MAAM,WAAW,GAAG,GAAG,EAAE;QACvB,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;YAC7B,OAAO,CACL,CAAC,WAAI,CAAC,OAAO,CAAC,CAAC,kBAAW,CAAC,MAAM,CAAC,CAAC,IAAI,cAAc,CAAC,CACpD;UAAA,CAAC,KAAK,CACR;QAAA,EAAE,WAAI,CAAC,CACR,CAAC;SACH;QACD,OAAO,KAAK,CAAC;IACf,CAAC,CAAC;IAEF,MAAM,iBAAiB,GAAG,GAAG,EAAE;QAC7B,IAAI,CAAC,WAAW,EAAE;YAChB,OAAO,IAAI,CAAC;SACb;QAED,IAAI,OAAO,WAAW,KAAK,QAAQ,EAAE;YACnC,OAAO,CACL,CAAC,WAAI,CACH,OAAO,CAAC,CAAC,kBAAW,CAAC,MAAM,CAAC,CAC5B,KAAK,CAAC,CAAC,gBAAS,CAAC,eAAe,CAAC,CACjC,IAAI,oBAAoB,CAAC,CAEzB;UAAA,CAAC,WAAW,CACd;QAAA,EAAE,WAAI,CAAC,CACR,CAAC;SACH;QACD,OAAO,WAAW,CAAC;IACrB,CAAC,CAAC;IAEF,MAAM,kBAAkB,GAAG,GAAG,EAAE;QAC9B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AG,CAAC,CAAC,CAAC,CAAC,CAEP;QAAA,CAAC,kEAAkE,CACnE;QAAA,CAAC,SAAG,CACF,aAAa,CAAC,CAAC,sBAAgB,CAAC,GAAG,CAAC,CACpC,UAAU,CAAC,CAAC,mBAAa,CAAC,KAAK,CAAC,CAChC,WAAW,CAAC,QAAQ,CACpB,GAAG,CAAC,CAAC,CAAC,CAAC,CAEP;UAAA,CAAC,kBAAkB,EAAE,CACrB;UAAA,CAAC,SAAG,CAAC,WAAW,CAAC,QAAQ,CACvB;YAAA,CAAC,WAAW,EAAE,CACd;YAAA,CAAC,iBAAiB,EAAE,CACtB;UAAA,EAAE,SAAG,CACP;QAAA,EAAE,SAAG,CAEL;;QAAA,CAAC,mBAAmB,CACpB;QAAA,CAAC,YAAY,IAAI,CAAC,SAAG,CAAC,CAAC,YAAY,CAAC,EAAE,SAAG,CAAC,CAC5C;MAAA,EAAE,SAAG,CACP;IAAA,EAAE,wBAAS,CAAC,CACb,CAAC;AACJ,CAAC,CAAC;AAnHW,QAAA,cAAc,kBAmHzB","sourcesContent":["import { useTailwind } from '@metamask/design-system-twrnc-preset';\nimport React, { useCallback } from 'react';\nimport { Pressable } from 'react-native';\n\nimport {\n Box,\n BoxAlignItems,\n BoxFlexDirection,\n BoxJustifyContent,\n} from '../Box';\nimport { Icon, IconSize } from '../Icon';\nimport { Text, TextColor, TextVariant } from '../Text';\n\nimport type { ActionListItemProps } from './ActionListItem.types';\n\nexport const ActionListItem: React.FC<ActionListItemProps> = ({\n label,\n description,\n startAccessory,\n endAccessory,\n iconName,\n labelTextProps,\n descriptionTextProps,\n iconProps,\n isDisabled = false,\n onPress,\n pressableProps,\n twClassName,\n style,\n ...props\n}) => {\n const tw = useTailwind();\n\n const renderLabel = () => {\n if (typeof label === 'string') {\n return (\n <Text variant={TextVariant.BodyMd} {...labelTextProps}>\n {label}\n </Text>\n );\n }\n return label;\n };\n\n const renderDescription = () => {\n if (!description) {\n return null;\n }\n\n if (typeof description === 'string') {\n return (\n <Text\n variant={TextVariant.BodySm}\n color={TextColor.TextAlternative}\n {...descriptionTextProps}\n >\n {description}\n </Text>\n );\n }\n return description;\n };\n\n const renderStartContent = () => {\n if (startAccessory) {\n return startAccessory;\n }\n\n if (iconName) {\n return (\n <Box\n alignItems={BoxAlignItems.Center}\n justifyContent={BoxJustifyContent.Center}\n twClassName=\"h-6\"\n >\n <Icon name={iconName} size={IconSize.Md} {...iconProps} />\n </Box>\n );\n }\n\n return null;\n };\n\n const getPressableStyle = useCallback(\n ({ pressed }: { pressed: boolean }) => {\n const baseStyle = tw.style(\n 'bg-default px-4 py-3',\n pressed && !isDisabled && 'bg-default-pressed',\n isDisabled && 'opacity-50',\n twClassName,\n );\n\n return style ? [baseStyle, style] : baseStyle;\n },\n [tw, isDisabled, twClassName, style],\n );\n\n return (\n <Pressable\n onPress={onPress}\n disabled={isDisabled}\n style={getPressableStyle}\n {...pressableProps}\n {...props}\n >\n <Box\n flexDirection={BoxFlexDirection.Row}\n alignItems={BoxAlignItems.Center}\n justifyContent={BoxJustifyContent.Between}\n gap={4}\n >\n {/* Left side content (start accessory/icon + label/description) */}\n <Box\n flexDirection={BoxFlexDirection.Row}\n alignItems={BoxAlignItems.Start}\n twClassName=\"flex-1\"\n gap={4}\n >\n {renderStartContent()}\n <Box twClassName=\"flex-1\">\n {renderLabel()}\n {renderDescription()}\n </Box>\n </Box>\n\n {/* End accessory */}\n {endAccessory && <Box>{endAccessory}</Box>}\n </Box>\n </Pressable>\n );\n};\n"]}
|
|
@@ -7,7 +7,7 @@ function $importDefault(module) {
|
|
|
7
7
|
import { useTailwind } from "@metamask/design-system-twrnc-preset";
|
|
8
8
|
import $React, { useCallback } from "react";
|
|
9
9
|
const React = $importDefault($React);
|
|
10
|
-
import { Pressable } from "react-native
|
|
10
|
+
import { Pressable } from "react-native";
|
|
11
11
|
import { Box, BoxAlignItems, BoxFlexDirection, BoxJustifyContent } from "../Box/index.mjs";
|
|
12
12
|
import { Icon, IconSize } from "../Icon/index.mjs";
|
|
13
13
|
import { Text, TextColor, TextVariant } from "../Text/index.mjs";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActionListItem.mjs","sourceRoot":"","sources":["../../../src/components/ActionListItem/ActionListItem.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,6CAA6C;AACnE,OAAO,QAAO,EAAE,WAAW,EAAE,cAAc;;AAC3C,OAAO,EAAE,SAAS,EAAE,
|
|
1
|
+
{"version":3,"file":"ActionListItem.mjs","sourceRoot":"","sources":["../../../src/components/ActionListItem/ActionListItem.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,6CAA6C;AACnE,OAAO,QAAO,EAAE,WAAW,EAAE,cAAc;;AAC3C,OAAO,EAAE,SAAS,EAAE,qBAAqB;AAEzC,OAAO,EACL,GAAG,EACH,aAAa,EACb,gBAAgB,EAChB,iBAAiB,EAClB,yBAAe;AAChB,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,0BAAgB;AACzC,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,0BAAgB;AAIvD,MAAM,CAAC,MAAM,cAAc,GAAkC,CAAC,EAC5D,KAAK,EACL,WAAW,EACX,cAAc,EACd,YAAY,EACZ,QAAQ,EACR,cAAc,EACd,oBAAoB,EACpB,SAAS,EACT,UAAU,GAAG,KAAK,EAClB,OAAO,EACP,cAAc,EACd,WAAW,EACX,KAAK,EACL,GAAG,KAAK,EACT,EAAE,EAAE;IACH,MAAM,EAAE,GAAG,WAAW,EAAE,CAAC;IAEzB,MAAM,WAAW,GAAG,GAAG,EAAE;QACvB,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;YAC7B,OAAO,CACL,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,IAAI,cAAc,CAAC,CACpD;UAAA,CAAC,KAAK,CACR;QAAA,EAAE,IAAI,CAAC,CAC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,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IAChD,CAAC,EACD,CAAC,EAAE,EAAE,UAAU,EAAE,WAAW,EAAE,KAAK,CAAC,CACrC,CAAC;IAEF,OAAO,CACL,CAAC,SAAS,CACR,OAAO,CAAC,CAAC,OAAO,CAAC,CACjB,QAAQ,CAAC,CAAC,UAAU,CAAC,CACrB,KAAK,CAAC,CAAC,iBAAiB,CAAC,CACzB,IAAI,cAAc,CAAC,CACnB,IAAI,KAAK,CAAC,CAEV;MAAA,CAAC,GAAG,CACF,aAAa,CAAC,CAAC,gBAAgB,CAAC,GAAG,CAAC,CACpC,UAAU,CAAC,CAAC,aAAa,CAAC,MAAM,CAAC,CACjC,cAAc,CAAC,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAC1C,GAAG,CAAC,CAAC,CAAC,CAAC,CAEP;QAAA,CAAC,kEAAkE,CACnE;QAAA,CAAC,GAAG,CACF,aAAa,CAAC,CAAC,gBAAgB,CAAC,GAAG,CAAC,CACpC,UAAU,CAAC,CAAC,aAAa,CAAC,KAAK,CAAC,CAChC,WAAW,CAAC,QAAQ,CACpB,GAAG,CAAC,CAAC,CAAC,CAAC,CAEP;UAAA,CAAC,kBAAkB,EAAE,CACrB;UAAA,CAAC,GAAG,CAAC,WAAW,CAAC,QAAQ,CACvB;YAAA,CAAC,WAAW,EAAE,CACd;YAAA,CAAC,iBAAiB,EAAE,CACtB;UAAA,EAAE,GAAG,CACP;QAAA,EAAE,GAAG,CAEL;;QAAA,CAAC,mBAAmB,CACpB;QAAA,CAAC,YAAY,IAAI,CAAC,GAAG,CAAC,CAAC,YAAY,CAAC,EAAE,GAAG,CAAC,CAC5C;MAAA,EAAE,GAAG,CACP;IAAA,EAAE,SAAS,CAAC,CACb,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { useTailwind } from '@metamask/design-system-twrnc-preset';\nimport React, { useCallback } from 'react';\nimport { Pressable } from 'react-native';\n\nimport {\n Box,\n BoxAlignItems,\n BoxFlexDirection,\n BoxJustifyContent,\n} from '../Box';\nimport { Icon, IconSize } from '../Icon';\nimport { Text, TextColor, TextVariant } from '../Text';\n\nimport type { ActionListItemProps } from './ActionListItem.types';\n\nexport const ActionListItem: React.FC<ActionListItemProps> = ({\n label,\n description,\n startAccessory,\n endAccessory,\n iconName,\n labelTextProps,\n descriptionTextProps,\n iconProps,\n isDisabled = false,\n onPress,\n pressableProps,\n twClassName,\n style,\n ...props\n}) => {\n const tw = useTailwind();\n\n const renderLabel = () => {\n if (typeof label === 'string') {\n return (\n <Text variant={TextVariant.BodyMd} {...labelTextProps}>\n {label}\n </Text>\n );\n }\n return label;\n };\n\n const renderDescription = () => {\n if (!description) {\n return null;\n }\n\n if (typeof description === 'string') {\n return (\n <Text\n variant={TextVariant.BodySm}\n color={TextColor.TextAlternative}\n {...descriptionTextProps}\n >\n {description}\n </Text>\n );\n }\n return description;\n };\n\n const renderStartContent = () => {\n if (startAccessory) {\n return startAccessory;\n }\n\n if (iconName) {\n return (\n <Box\n alignItems={BoxAlignItems.Center}\n justifyContent={BoxJustifyContent.Center}\n twClassName=\"h-6\"\n >\n <Icon name={iconName} size={IconSize.Md} {...iconProps} />\n </Box>\n );\n }\n\n return null;\n };\n\n const getPressableStyle = useCallback(\n ({ pressed }: { pressed: boolean }) => {\n const baseStyle = tw.style(\n 'bg-default px-4 py-3',\n pressed && !isDisabled && 'bg-default-pressed',\n isDisabled && 'opacity-50',\n twClassName,\n );\n\n return style ? [baseStyle, style] : baseStyle;\n },\n [tw, isDisabled, twClassName, style],\n );\n\n return (\n <Pressable\n onPress={onPress}\n disabled={isDisabled}\n style={getPressableStyle}\n {...pressableProps}\n {...props}\n >\n <Box\n flexDirection={BoxFlexDirection.Row}\n alignItems={BoxAlignItems.Center}\n justifyContent={BoxJustifyContent.Between}\n gap={4}\n >\n {/* Left side content (start accessory/icon + label/description) */}\n <Box\n flexDirection={BoxFlexDirection.Row}\n alignItems={BoxAlignItems.Start}\n twClassName=\"flex-1\"\n gap={4}\n >\n {renderStartContent()}\n <Box twClassName=\"flex-1\">\n {renderLabel()}\n {renderDescription()}\n </Box>\n </Box>\n\n {/* End accessory */}\n {endAccessory && <Box>{endAccessory}</Box>}\n </Box>\n </Pressable>\n );\n};\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ReactNode } from "react";
|
|
2
|
-
import type { PressableProps, ViewProps } from "react-native
|
|
2
|
+
import type { PressableProps, ViewProps } from "react-native";
|
|
3
3
|
import type { IconName, IconProps } from "../Icon/index.cjs";
|
|
4
4
|
import type { TextProps } from "../Text/index.cjs";
|
|
5
5
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActionListItem.types.d.cts","sourceRoot":"","sources":["../../../src/components/ActionListItem/ActionListItem.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc;AACvC,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,
|
|
1
|
+
{"version":3,"file":"ActionListItem.types.d.cts","sourceRoot":"","sources":["../../../src/components/ActionListItem/ActionListItem.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc;AACvC,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,qBAAqB;AAE9D,OAAO,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,0BAAgB;AACnD,OAAO,KAAK,EAAE,SAAS,EAAE,0BAAgB;AAEzC;;;;;;;GAOG;AACH,MAAM,MAAM,mBAAmB,GAAG;IAChC;;;;OAIG;IACH,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACjC;;;OAGG;IACH,cAAc,CAAC,EAAE,SAAS,CAAC;IAC3B;;OAEG;IACH,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB;;;OAGG;IACH,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB;;OAEG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC;IACpC;;OAEG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC;IAC1C;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC;IAC/B;;;;;OAKG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;OAEG;IACH,OAAO,CAAC,EAAE,cAAc,CAAC,SAAS,CAAC,CAAC;IACpC;;;OAGG;IACH,cAAc,CAAC,EAAE,IAAI,CAAC,cAAc,EAAE,SAAS,GAAG,UAAU,GAAG,OAAO,CAAC,CAAC;IACxE;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,GAAG,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ReactNode } from "react";
|
|
2
|
-
import type { PressableProps, ViewProps } from "react-native
|
|
2
|
+
import type { PressableProps, ViewProps } from "react-native";
|
|
3
3
|
import type { IconName, IconProps } from "../Icon/index.mjs";
|
|
4
4
|
import type { TextProps } from "../Text/index.mjs";
|
|
5
5
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActionListItem.types.d.mts","sourceRoot":"","sources":["../../../src/components/ActionListItem/ActionListItem.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc;AACvC,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,
|
|
1
|
+
{"version":3,"file":"ActionListItem.types.d.mts","sourceRoot":"","sources":["../../../src/components/ActionListItem/ActionListItem.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc;AACvC,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,qBAAqB;AAE9D,OAAO,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,0BAAgB;AACnD,OAAO,KAAK,EAAE,SAAS,EAAE,0BAAgB;AAEzC;;;;;;;GAOG;AACH,MAAM,MAAM,mBAAmB,GAAG;IAChC;;;;OAIG;IACH,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACjC;;;OAGG;IACH,cAAc,CAAC,EAAE,SAAS,CAAC;IAC3B;;OAEG;IACH,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB;;;OAGG;IACH,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB;;OAEG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC;IACpC;;OAEG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC;IAC1C;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC;IAC/B;;;;;OAKG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;OAEG;IACH,OAAO,CAAC,EAAE,cAAc,CAAC,SAAS,CAAC,CAAC;IACpC;;;OAGG;IACH,cAAc,CAAC,EAAE,IAAI,CAAC,cAAc,EAAE,SAAS,GAAG,UAAU,GAAG,OAAO,CAAC,CAAC;IACxE;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,GAAG,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC"}
|
|
@@ -7,13 +7,13 @@ exports.AvatarBase = void 0;
|
|
|
7
7
|
const design_system_shared_1 = require("@metamask/design-system-shared");
|
|
8
8
|
const design_system_twrnc_preset_1 = require("@metamask/design-system-twrnc-preset");
|
|
9
9
|
const react_1 = __importDefault(require("react"));
|
|
10
|
-
const react_native_1 = require("react-native
|
|
10
|
+
const react_native_1 = require("react-native");
|
|
11
11
|
const Text_1 = require("../Text/index.cjs");
|
|
12
12
|
const AvatarBase_constants_1 = require("./AvatarBase.constants.cjs");
|
|
13
13
|
const AvatarBase = ({ children, size = design_system_shared_1.AvatarBaseSize.Md, shape = design_system_shared_1.AvatarBaseShape.Circle, fallbackText, fallbackTextProps, hasBorder = false, twClassName, style, ...props }) => {
|
|
14
14
|
const tw = (0, design_system_twrnc_preset_1.useTailwind)();
|
|
15
15
|
return (<react_native_1.View {...props} style={[
|
|
16
|
-
tw.style('items-center justify-center overflow-hidden bg-
|
|
16
|
+
tw.style('items-center justify-center overflow-hidden bg-alternative', shape === design_system_shared_1.AvatarBaseShape.Circle
|
|
17
17
|
? 'rounded-full'
|
|
18
18
|
: AvatarBase_constants_1.TWCLASSMAP_AVATARBASE_SIZE_BORDERRADIUSS_SQUARE[size], hasBorder
|
|
19
19
|
? AvatarBase_constants_1.TWCLASSMAP_AVATARBASE_HASBORDER_SIZE_DIMENSION[size]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AvatarBase.cjs","sourceRoot":"","sources":["../../../src/components/AvatarBase/AvatarBase.tsx"],"names":[],"mappings":";;;;;;AAAA,yEAGwC;AACxC,qFAAmE;AACnE,kDAA0B;AAC1B
|
|
1
|
+
{"version":3,"file":"AvatarBase.cjs","sourceRoot":"","sources":["../../../src/components/AvatarBase/AvatarBase.tsx"],"names":[],"mappings":";;;;;;AAAA,yEAGwC;AACxC,qFAAmE;AACnE,kDAA0B;AAC1B,+CAAoC;AAEpC,4CAAmE;AAEnE,qEAKgC;AAGzB,MAAM,UAAU,GAAG,CAAC,EACzB,QAAQ,EACR,IAAI,GAAG,qCAAc,CAAC,EAAE,EACxB,KAAK,GAAG,sCAAe,CAAC,MAAM,EAC9B,YAAY,EACZ,iBAAiB,EACjB,SAAS,GAAG,KAAK,EACjB,WAAW,EACX,KAAK,EACL,GAAG,KAAK,EACQ,EAAE,EAAE;IACpB,MAAM,EAAE,GAAG,IAAA,wCAAW,GAAE,CAAC;IAEzB,OAAO,CACL,CAAC,mBAAI,CACH,IAAI,KAAK,CAAC,CACV,KAAK,CAAC,CAAC;YACL,EAAE,CAAC,KAAK,CACN,4DAA4D,EAC5D,KAAK,KAAK,sCAAe,CAAC,MAAM;gBAC9B,CAAC,CAAC,cAAc;gBAChB,CAAC,CAAC,sEAA+C,CAAC,IAAI,CAAC,EACzD,SAAS;gBACP,CAAC,CAAC,qEAA8C,CAAC,IAAI,CAAC;gBACtD,CAAC,CAAC,2DAAoC,CAAC,IAAI,CAAC,EAC9C,SAAS,IAAI,wDAAiC,CAAC,IAAI,CAAC,EACpD,WAAW,CACZ;YACD,KAAK;SACN,CAAC,CAEF;MAAA,CAAC,YAAY,CAAC,CAAC,CAAC,CACd,CAAC,WAAI,CACH,KAAK,CAAC,CAAC,gBAAS,CAAC,SAAS,CAAC,CAC3B,OAAO,CAAC,CAAC,kBAAW,CAAC,MAAM,CAAC,CAC5B,UAAU,CAAC,CAAC,iBAAU,CAAC,MAAM,CAAC,CAC9B,IAAI,iBAAiB,CAAC,CACtB,WAAW,CAAC,CAAC,aAAa,iBAAiB,EAAE,WAAW,CAAC,CAAC,CAAC,IAAI,iBAAiB,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,EAAE,CAAC,CAE7G;UAAA,CAAC,YAAY,CACf;QAAA,EAAE,WAAI,CAAC,CACR,CAAC,CAAC,CAAC,CACF,QAAQ,CACT,CACH;IAAA,EAAE,mBAAI,CAAC,CACR,CAAC;AACJ,CAAC,CAAC;AA9CW,QAAA,UAAU,cA8CrB","sourcesContent":["import {\n AvatarBaseSize,\n AvatarBaseShape,\n} from '@metamask/design-system-shared';\nimport { useTailwind } from '@metamask/design-system-twrnc-preset';\nimport React from 'react';\nimport { View } from 'react-native';\n\nimport { Text, TextColor, TextVariant, FontWeight } from '../Text';\n\nimport {\n TWCLASSMAP_AVATARBASE_SIZE_DIMENSION,\n TWCLASSMAP_AVATARBASE_HASBORDER_SIZE_DIMENSION,\n TWCLASSMAP_AVATARBASE_SIZE_BORDERRADIUSS_SQUARE,\n TWCLASSMAP_AVATARBASE_SIZE_BORDER,\n} from './AvatarBase.constants';\nimport type { AvatarBaseProps } from './AvatarBase.types';\n\nexport const AvatarBase = ({\n children,\n size = AvatarBaseSize.Md,\n shape = AvatarBaseShape.Circle,\n fallbackText,\n fallbackTextProps,\n hasBorder = false,\n twClassName,\n style,\n ...props\n}: AvatarBaseProps) => {\n const tw = useTailwind();\n\n return (\n <View\n {...props}\n style={[\n tw.style(\n 'items-center justify-center overflow-hidden bg-alternative',\n shape === AvatarBaseShape.Circle\n ? 'rounded-full'\n : TWCLASSMAP_AVATARBASE_SIZE_BORDERRADIUSS_SQUARE[size],\n hasBorder\n ? TWCLASSMAP_AVATARBASE_HASBORDER_SIZE_DIMENSION[size]\n : TWCLASSMAP_AVATARBASE_SIZE_DIMENSION[size],\n hasBorder && TWCLASSMAP_AVATARBASE_SIZE_BORDER[size],\n twClassName,\n ),\n style,\n ]}\n >\n {fallbackText ? (\n <Text\n color={TextColor.TextMuted}\n variant={TextVariant.BodySm}\n fontWeight={FontWeight.Medium}\n {...fallbackTextProps}\n twClassName={`uppercase ${fallbackTextProps?.twClassName ? ` ${fallbackTextProps.twClassName}` : ''}`.trim()}\n >\n {fallbackText}\n </Text>\n ) : (\n children\n )}\n </View>\n );\n};\n"]}
|
|
@@ -8,13 +8,13 @@ import { AvatarBaseSize, AvatarBaseShape } from "@metamask/design-system-shared"
|
|
|
8
8
|
import { useTailwind } from "@metamask/design-system-twrnc-preset";
|
|
9
9
|
import $React from "react";
|
|
10
10
|
const React = $importDefault($React);
|
|
11
|
-
import { View } from "react-native
|
|
11
|
+
import { View } from "react-native";
|
|
12
12
|
import { Text, TextColor, TextVariant, FontWeight } from "../Text/index.mjs";
|
|
13
13
|
import { TWCLASSMAP_AVATARBASE_SIZE_DIMENSION, TWCLASSMAP_AVATARBASE_HASBORDER_SIZE_DIMENSION, TWCLASSMAP_AVATARBASE_SIZE_BORDERRADIUSS_SQUARE, TWCLASSMAP_AVATARBASE_SIZE_BORDER } from "./AvatarBase.constants.mjs";
|
|
14
14
|
export const AvatarBase = ({ children, size = AvatarBaseSize.Md, shape = AvatarBaseShape.Circle, fallbackText, fallbackTextProps, hasBorder = false, twClassName, style, ...props }) => {
|
|
15
15
|
const tw = useTailwind();
|
|
16
16
|
return (<View {...props} style={[
|
|
17
|
-
tw.style('items-center justify-center overflow-hidden bg-
|
|
17
|
+
tw.style('items-center justify-center overflow-hidden bg-alternative', shape === AvatarBaseShape.Circle
|
|
18
18
|
? 'rounded-full'
|
|
19
19
|
: TWCLASSMAP_AVATARBASE_SIZE_BORDERRADIUSS_SQUARE[size], hasBorder
|
|
20
20
|
? TWCLASSMAP_AVATARBASE_HASBORDER_SIZE_DIMENSION[size]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AvatarBase.mjs","sourceRoot":"","sources":["../../../src/components/AvatarBase/AvatarBase.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,EACL,cAAc,EACd,eAAe,EAChB,uCAAuC;AACxC,OAAO,EAAE,WAAW,EAAE,6CAA6C;AACnE,OAAO,MAAK,cAAc;;AAC1B,OAAO,EAAE,IAAI,EAAE,
|
|
1
|
+
{"version":3,"file":"AvatarBase.mjs","sourceRoot":"","sources":["../../../src/components/AvatarBase/AvatarBase.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,EACL,cAAc,EACd,eAAe,EAChB,uCAAuC;AACxC,OAAO,EAAE,WAAW,EAAE,6CAA6C;AACnE,OAAO,MAAK,cAAc;;AAC1B,OAAO,EAAE,IAAI,EAAE,qBAAqB;AAEpC,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,UAAU,EAAE,0BAAgB;AAEnE,OAAO,EACL,oCAAoC,EACpC,8CAA8C,EAC9C,+CAA+C,EAC/C,iCAAiC,EAClC,mCAA+B;AAGhC,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,EACzB,QAAQ,EACR,IAAI,GAAG,cAAc,CAAC,EAAE,EACxB,KAAK,GAAG,eAAe,CAAC,MAAM,EAC9B,YAAY,EACZ,iBAAiB,EACjB,SAAS,GAAG,KAAK,EACjB,WAAW,EACX,KAAK,EACL,GAAG,KAAK,EACQ,EAAE,EAAE;IACpB,MAAM,EAAE,GAAG,WAAW,EAAE,CAAC;IAEzB,OAAO,CACL,CAAC,IAAI,CACH,IAAI,KAAK,CAAC,CACV,KAAK,CAAC,CAAC;YACL,EAAE,CAAC,KAAK,CACN,4DAA4D,EAC5D,KAAK,KAAK,eAAe,CAAC,MAAM;gBAC9B,CAAC,CAAC,cAAc;gBAChB,CAAC,CAAC,+CAA+C,CAAC,IAAI,CAAC,EACzD,SAAS;gBACP,CAAC,CAAC,8CAA8C,CAAC,IAAI,CAAC;gBACtD,CAAC,CAAC,oCAAoC,CAAC,IAAI,CAAC,EAC9C,SAAS,IAAI,iCAAiC,CAAC,IAAI,CAAC,EACpD,WAAW,CACZ;YACD,KAAK;SACN,CAAC,CAEF;MAAA,CAAC,YAAY,CAAC,CAAC,CAAC,CACd,CAAC,IAAI,CACH,KAAK,CAAC,CAAC,SAAS,CAAC,SAAS,CAAC,CAC3B,OAAO,CAAC,CAAC,WAAW,CAAC,MAAM,CAAC,CAC5B,UAAU,CAAC,CAAC,UAAU,CAAC,MAAM,CAAC,CAC9B,IAAI,iBAAiB,CAAC,CACtB,WAAW,CAAC,CAAC,aAAa,iBAAiB,EAAE,WAAW,CAAC,CAAC,CAAC,IAAI,iBAAiB,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,EAAE,CAAC,CAE7G;UAAA,CAAC,YAAY,CACf;QAAA,EAAE,IAAI,CAAC,CACR,CAAC,CAAC,CAAC,CACF,QAAQ,CACT,CACH;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import {\n AvatarBaseSize,\n AvatarBaseShape,\n} from '@metamask/design-system-shared';\nimport { useTailwind } from '@metamask/design-system-twrnc-preset';\nimport React from 'react';\nimport { View } from 'react-native';\n\nimport { Text, TextColor, TextVariant, FontWeight } from '../Text';\n\nimport {\n TWCLASSMAP_AVATARBASE_SIZE_DIMENSION,\n TWCLASSMAP_AVATARBASE_HASBORDER_SIZE_DIMENSION,\n TWCLASSMAP_AVATARBASE_SIZE_BORDERRADIUSS_SQUARE,\n TWCLASSMAP_AVATARBASE_SIZE_BORDER,\n} from './AvatarBase.constants';\nimport type { AvatarBaseProps } from './AvatarBase.types';\n\nexport const AvatarBase = ({\n children,\n size = AvatarBaseSize.Md,\n shape = AvatarBaseShape.Circle,\n fallbackText,\n fallbackTextProps,\n hasBorder = false,\n twClassName,\n style,\n ...props\n}: AvatarBaseProps) => {\n const tw = useTailwind();\n\n return (\n <View\n {...props}\n style={[\n tw.style(\n 'items-center justify-center overflow-hidden bg-alternative',\n shape === AvatarBaseShape.Circle\n ? 'rounded-full'\n : TWCLASSMAP_AVATARBASE_SIZE_BORDERRADIUSS_SQUARE[size],\n hasBorder\n ? TWCLASSMAP_AVATARBASE_HASBORDER_SIZE_DIMENSION[size]\n : TWCLASSMAP_AVATARBASE_SIZE_DIMENSION[size],\n hasBorder && TWCLASSMAP_AVATARBASE_SIZE_BORDER[size],\n twClassName,\n ),\n style,\n ]}\n >\n {fallbackText ? (\n <Text\n color={TextColor.TextMuted}\n variant={TextVariant.BodySm}\n fontWeight={FontWeight.Medium}\n {...fallbackTextProps}\n twClassName={`uppercase ${fallbackTextProps?.twClassName ? ` ${fallbackTextProps.twClassName}` : ''}`.trim()}\n >\n {fallbackText}\n </Text>\n ) : (\n children\n )}\n </View>\n );\n};\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { AvatarBasePropsShared } from "@metamask/design-system-shared";
|
|
2
|
-
import type { ViewProps, StyleProp, ViewStyle } from "react-native
|
|
2
|
+
import type { ViewProps, StyleProp, ViewStyle } from "react-native";
|
|
3
3
|
import type { TextProps } from "../Text/index.cjs";
|
|
4
4
|
/**
|
|
5
5
|
* AvatarBase component props.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AvatarBase.types.d.cts","sourceRoot":"","sources":["../../../src/components/AvatarBase/AvatarBase.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,uCAAuC;AAC5E,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,
|
|
1
|
+
{"version":3,"file":"AvatarBase.types.d.cts","sourceRoot":"","sources":["../../../src/components/AvatarBase/AvatarBase.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,uCAAuC;AAC5E,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,qBAAqB;AAEpE,OAAO,KAAK,EAAE,SAAS,EAAE,0BAAgB;AAEzC;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,qBAAqB,GACjD,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC,GAAG;IAC5B;;;OAGG;IACH,iBAAiB,CAAC,EAAE,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;IAChD;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { AvatarBasePropsShared } from "@metamask/design-system-shared";
|
|
2
|
-
import type { ViewProps, StyleProp, ViewStyle } from "react-native
|
|
2
|
+
import type { ViewProps, StyleProp, ViewStyle } from "react-native";
|
|
3
3
|
import type { TextProps } from "../Text/index.mjs";
|
|
4
4
|
/**
|
|
5
5
|
* AvatarBase component props.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AvatarBase.types.d.mts","sourceRoot":"","sources":["../../../src/components/AvatarBase/AvatarBase.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,uCAAuC;AAC5E,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,
|
|
1
|
+
{"version":3,"file":"AvatarBase.types.d.mts","sourceRoot":"","sources":["../../../src/components/AvatarBase/AvatarBase.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,uCAAuC;AAC5E,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,qBAAqB;AAEpE,OAAO,KAAK,EAAE,SAAS,EAAE,0BAAgB;AAEzC;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,qBAAqB,GACjD,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC,GAAG;IAC5B;;;OAGG;IACH,iBAAiB,CAAC,EAAE,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;IAChD;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B,CAAC"}
|
|
@@ -30,7 +30,7 @@ const AvatarBase_1 = require("../AvatarBase/index.cjs");
|
|
|
30
30
|
const ImageOrSvg_1 = require("../temp-components/ImageOrSvg/index.cjs");
|
|
31
31
|
const AvatarFavicon = ({ src, size = design_system_shared_1.AvatarFaviconSize.Md, name, fallbackText, fallbackTextProps, imageOrSvgProps, ...props }) => {
|
|
32
32
|
const [finalFallbackText, setFallbackText] = (0, react_1.useState)('');
|
|
33
|
-
const backupFallbackText = fallbackText || name?.[0] || '';
|
|
33
|
+
const backupFallbackText = fallbackText || name?.[0] || '?';
|
|
34
34
|
const onImageErrorHandler = (e) => {
|
|
35
35
|
setFallbackText(backupFallbackText);
|
|
36
36
|
imageOrSvgProps?.onImageError?.(e);
|
|
@@ -39,7 +39,7 @@ const AvatarFavicon = ({ src, size = design_system_shared_1.AvatarFaviconSize.Md
|
|
|
39
39
|
setFallbackText(backupFallbackText);
|
|
40
40
|
imageOrSvgProps?.onSvgError?.(e);
|
|
41
41
|
};
|
|
42
|
-
return (<AvatarBase_1.AvatarBase size={size} shape={design_system_shared_1.AvatarBaseShape.Circle} fallbackText={finalFallbackText} fallbackTextProps={fallbackTextProps} {...props}>
|
|
42
|
+
return (<AvatarBase_1.AvatarBase size={size} shape={design_system_shared_1.AvatarBaseShape.Circle} fallbackText={src ? finalFallbackText : backupFallbackText} fallbackTextProps={fallbackTextProps} {...props}>
|
|
43
43
|
{src && (<ImageOrSvg_1.ImageOrSvg src={src} width={'100%'} height={'100%'} {...imageOrSvgProps} imageProps={{
|
|
44
44
|
resizeMode: 'contain',
|
|
45
45
|
...imageOrSvgProps?.imageProps,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AvatarFavicon.cjs","sourceRoot":"","sources":["../../../src/components/AvatarFavicon/AvatarFavicon.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yEAGwC;AACxC,+CAAwC;AAGxC,wDAA2C;AAC3C,wEAA2D;AAIpD,MAAM,aAAa,GAAG,CAAC,EAC5B,GAAG,EACH,IAAI,GAAG,wCAAiB,CAAC,EAAE,EAC3B,IAAI,EACJ,YAAY,EACZ,iBAAiB,EACjB,eAAe,EACf,GAAG,KAAK,EACW,EAAE,EAAE;IACvB,MAAM,CAAC,iBAAiB,EAAE,eAAe,CAAC,GAAG,IAAA,gBAAQ,EAAS,EAAE,CAAC,CAAC;IAElE,MAAM,kBAAkB,GAAG,YAAY,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,
|
|
1
|
+
{"version":3,"file":"AvatarFavicon.cjs","sourceRoot":"","sources":["../../../src/components/AvatarFavicon/AvatarFavicon.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yEAGwC;AACxC,+CAAwC;AAGxC,wDAA2C;AAC3C,wEAA2D;AAIpD,MAAM,aAAa,GAAG,CAAC,EAC5B,GAAG,EACH,IAAI,GAAG,wCAAiB,CAAC,EAAE,EAC3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CAAC,CACd,CAAC;AACJ,CAAC,CAAC;AA9CW,QAAA,aAAa,iBA8CxB","sourcesContent":["import {\n AvatarBaseShape,\n AvatarFaviconSize,\n} from '@metamask/design-system-shared';\nimport React, { useState } from 'react';\nimport type { ImageErrorEvent } from 'react-native';\n\nimport { AvatarBase } from '../AvatarBase';\nimport { ImageOrSvg } from '../temp-components/ImageOrSvg';\n\nimport type { AvatarFaviconProps } from './AvatarFavicon.types';\n\nexport const AvatarFavicon = ({\n src,\n size = AvatarFaviconSize.Md,\n name,\n fallbackText,\n fallbackTextProps,\n imageOrSvgProps,\n ...props\n}: AvatarFaviconProps) => {\n const [finalFallbackText, setFallbackText] = useState<string>('');\n\n const backupFallbackText = fallbackText || name?.[0] || '?';\n const onImageErrorHandler = (e: ImageErrorEvent) => {\n setFallbackText(backupFallbackText);\n imageOrSvgProps?.onImageError?.(e);\n };\n\n const onSvgErrorHandler = (e: Error) => {\n setFallbackText(backupFallbackText);\n imageOrSvgProps?.onSvgError?.(e);\n };\n\n return (\n <AvatarBase\n size={size}\n shape={AvatarBaseShape.Circle}\n fallbackText={src ? finalFallbackText : backupFallbackText}\n fallbackTextProps={fallbackTextProps}\n {...props}\n >\n {src && (\n <ImageOrSvg\n src={src}\n width={'100%'}\n height={'100%'}\n {...imageOrSvgProps}\n imageProps={{\n resizeMode: 'contain',\n ...imageOrSvgProps?.imageProps,\n }}\n onImageError={onImageErrorHandler}\n onSvgError={onSvgErrorHandler}\n />\n )}\n </AvatarBase>\n );\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AvatarFavicon.d.cts","sourceRoot":"","sources":["../../../src/components/AvatarFavicon/AvatarFavicon.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAmB,cAAc;AAMxC,OAAO,KAAK,EAAE,kBAAkB,EAAE,kCAA8B;AAEhE,eAAO,MAAM,aAAa,oFAQvB,kBAAkB,
|
|
1
|
+
{"version":3,"file":"AvatarFavicon.d.cts","sourceRoot":"","sources":["../../../src/components/AvatarFavicon/AvatarFavicon.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAmB,cAAc;AAMxC,OAAO,KAAK,EAAE,kBAAkB,EAAE,kCAA8B;AAEhE,eAAO,MAAM,aAAa,oFAQvB,kBAAkB,sBAsCpB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AvatarFavicon.d.mts","sourceRoot":"","sources":["../../../src/components/AvatarFavicon/AvatarFavicon.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAmB,cAAc;AAMxC,OAAO,KAAK,EAAE,kBAAkB,EAAE,kCAA8B;AAEhE,eAAO,MAAM,aAAa,oFAQvB,kBAAkB,
|
|
1
|
+
{"version":3,"file":"AvatarFavicon.d.mts","sourceRoot":"","sources":["../../../src/components/AvatarFavicon/AvatarFavicon.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAmB,cAAc;AAMxC,OAAO,KAAK,EAAE,kBAAkB,EAAE,kCAA8B;AAEhE,eAAO,MAAM,aAAa,oFAQvB,kBAAkB,sBAsCpB,CAAC"}
|
|
@@ -11,7 +11,7 @@ import { AvatarBase } from "../AvatarBase/index.mjs";
|
|
|
11
11
|
import { ImageOrSvg } from "../temp-components/ImageOrSvg/index.mjs";
|
|
12
12
|
export const AvatarFavicon = ({ src, size = AvatarFaviconSize.Md, name, fallbackText, fallbackTextProps, imageOrSvgProps, ...props }) => {
|
|
13
13
|
const [finalFallbackText, setFallbackText] = useState('');
|
|
14
|
-
const backupFallbackText = fallbackText || name?.[0] || '';
|
|
14
|
+
const backupFallbackText = fallbackText || name?.[0] || '?';
|
|
15
15
|
const onImageErrorHandler = (e) => {
|
|
16
16
|
setFallbackText(backupFallbackText);
|
|
17
17
|
imageOrSvgProps?.onImageError?.(e);
|
|
@@ -20,7 +20,7 @@ export const AvatarFavicon = ({ src, size = AvatarFaviconSize.Md, name, fallback
|
|
|
20
20
|
setFallbackText(backupFallbackText);
|
|
21
21
|
imageOrSvgProps?.onSvgError?.(e);
|
|
22
22
|
};
|
|
23
|
-
return (<AvatarBase size={size} shape={AvatarBaseShape.Circle} fallbackText={finalFallbackText} fallbackTextProps={fallbackTextProps} {...props}>
|
|
23
|
+
return (<AvatarBase size={size} shape={AvatarBaseShape.Circle} fallbackText={src ? finalFallbackText : backupFallbackText} fallbackTextProps={fallbackTextProps} {...props}>
|
|
24
24
|
{src && (<ImageOrSvg src={src} width={'100%'} height={'100%'} {...imageOrSvgProps} imageProps={{
|
|
25
25
|
resizeMode: 'contain',
|
|
26
26
|
...imageOrSvgProps?.imageProps,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AvatarFavicon.mjs","sourceRoot":"","sources":["../../../src/components/AvatarFavicon/AvatarFavicon.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,EACL,eAAe,EACf,iBAAiB,EAClB,uCAAuC;AACxC,OAAO,QAAO,EAAE,QAAQ,EAAE,cAAc;;AAGxC,OAAO,EAAE,UAAU,EAAE,gCAAsB;AAC3C,OAAO,EAAE,UAAU,EAAE,gDAAsC;AAI3D,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,EAC5B,GAAG,EACH,IAAI,GAAG,iBAAiB,CAAC,EAAE,EAC3B,IAAI,EACJ,YAAY,EACZ,iBAAiB,EACjB,eAAe,EACf,GAAG,KAAK,EACW,EAAE,EAAE;IACvB,MAAM,CAAC,iBAAiB,EAAE,eAAe,CAAC,GAAG,QAAQ,CAAS,EAAE,CAAC,CAAC;IAElE,MAAM,kBAAkB,GAAG,YAAY,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,
|
|
1
|
+
{"version":3,"file":"AvatarFavicon.mjs","sourceRoot":"","sources":["../../../src/components/AvatarFavicon/AvatarFavicon.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,EACL,eAAe,EACf,iBAAiB,EAClB,uCAAuC;AACxC,OAAO,QAAO,EAAE,QAAQ,EAAE,cAAc;;AAGxC,OAAO,EAAE,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AAG,eAAe,EAAE,UAAU;aAC/B,CAAC,CACF,YAAY,CAAC,CAAC,mBAAmB,CAAC,CAClC,UAAU,CAAC,CAAC,iBAAiB,CAAC,EAC9B,CACH,CACH;IAAA,EAAE,UAAU,CAAC,CACd,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import {\n AvatarBaseShape,\n AvatarFaviconSize,\n} from '@metamask/design-system-shared';\nimport React, { useState } from 'react';\nimport type { ImageErrorEvent } from 'react-native';\n\nimport { AvatarBase } from '../AvatarBase';\nimport { ImageOrSvg } from '../temp-components/ImageOrSvg';\n\nimport type { AvatarFaviconProps } from './AvatarFavicon.types';\n\nexport const AvatarFavicon = ({\n src,\n size = AvatarFaviconSize.Md,\n name,\n fallbackText,\n fallbackTextProps,\n imageOrSvgProps,\n ...props\n}: AvatarFaviconProps) => {\n const [finalFallbackText, setFallbackText] = useState<string>('');\n\n const backupFallbackText = fallbackText || name?.[0] || '?';\n const onImageErrorHandler = (e: ImageErrorEvent) => {\n setFallbackText(backupFallbackText);\n imageOrSvgProps?.onImageError?.(e);\n };\n\n const onSvgErrorHandler = (e: Error) => {\n setFallbackText(backupFallbackText);\n imageOrSvgProps?.onSvgError?.(e);\n };\n\n return (\n <AvatarBase\n size={size}\n shape={AvatarBaseShape.Circle}\n fallbackText={src ? finalFallbackText : backupFallbackText}\n fallbackTextProps={fallbackTextProps}\n {...props}\n >\n {src && (\n <ImageOrSvg\n src={src}\n width={'100%'}\n height={'100%'}\n {...imageOrSvgProps}\n imageProps={{\n resizeMode: 'contain',\n ...imageOrSvgProps?.imageProps,\n }}\n onImageError={onImageErrorHandler}\n onSvgError={onSvgErrorHandler}\n />\n )}\n </AvatarBase>\n );\n};\n"]}
|
|
@@ -27,7 +27,7 @@ exports.AvatarGroup = void 0;
|
|
|
27
27
|
const design_system_shared_1 = require("@metamask/design-system-shared");
|
|
28
28
|
const design_system_twrnc_preset_1 = require("@metamask/design-system-twrnc-preset");
|
|
29
29
|
const react_1 = __importStar(require("react"));
|
|
30
|
-
const react_native_1 = require("react-native
|
|
30
|
+
const react_native_1 = require("react-native");
|
|
31
31
|
const AvatarAccount_1 = require("../AvatarAccount/index.cjs");
|
|
32
32
|
const AvatarBase_1 = require("../AvatarBase/index.cjs");
|
|
33
33
|
const AvatarFavicon_1 = require("../AvatarFavicon/index.cjs");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AvatarGroup.cjs","sourceRoot":"","sources":["../../../src/components/AvatarGroup/AvatarGroup.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yEAKwC;AACxC,qFAAmE;AACnE,+CAA2C;AAC3C
|
|
1
|
+
{"version":3,"file":"AvatarGroup.cjs","sourceRoot":"","sources":["../../../src/components/AvatarGroup/AvatarGroup.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yEAKwC;AACxC,qFAAmE;AACnE,+CAA2C;AAC3C,+CAAoC;AAGpC,8DAAiD;AACjD,wDAA2C;AAE3C,8DAAiD;AAEjD,8DAAiD;AAEjD,0DAA6C;AAE7C,uEAGiC;AAG1B,MAAM,WAAW,GAAG,CAAC,EAC1B,OAAO,EACP,cAAc,EACd,IAAI,GAAG,sCAAe,CAAC,EAAE,EACzB,GAAG,GAAG,CAAC,EACP,SAAS,GAAG,KAAK,EACjB,iBAAiB,EACjB,KAAK,EACL,WAAW,EACX,GAAG,KAAK,EACS,EAAE,EAAE;IACrB,MAAM,EAAE,GAAG,IAAA,wCAAW,GAAE,CAAC;IACzB,MAAM,eAAe,GAAG,cAAc,CAAC,MAAM,GAAG,GAAG,CAAC;IACpD,MAAM,2BAA2B,GAAG,eAAe,GAAG,CAAC,CAAC;IAExD,MAAM,gBAAgB,GAAG,IAAA,mBAAW,EAClC,GAAG,EAAE,CACH,cAAc,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,WAAW,EAAE,KAAK,EAAE,EAAE;QACtD,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UAAU,EAC3C,uEAA+C,CAAC,IAAI,CAAC,EACrD,WAAW,CACZ;YACD,KAAK;SACN,CAAC,CAEF;MAAA,CAAC,gBAAgB,EAAE,CACnB;MAAA,CAAC,2BAA2B,IAAI,CAC9B,CAAC,uBAAU,CACT,WAAW,CAAC,iBAAiB,CAC7B,SAAS,CACT,YAAY,CAAC,CAAC,IAAI,eAAe,EAAE,CAAC,CACpC,iBAAiB,CAAC,CAAC;gBACjB,OAAO,EAAE,qEAA6C,CAAC,IAAI,CAAC;gBAC5D,KAAK,EAAE,gCAAS,CAAC,cAAc;aAChC,CAAC,CACF,IAAI,CAAC,CAAC,IAAI,CAAC,CACX,KAAK,CAAC,CACJ,OAAO,KAAK,yCAAkB,CAAC,OAAO;gBACpC,CAAC,CAAC,sCAAe,CAAC,MAAM;gBACxB,CAAC,CAAC,sCAAe,CAAC,MAAM,CAC3B,CACD,IAAI,iBAAiB,CAAC,EACtB,CACH,CACH;IAAA,EAAE,mBAAI,CAAC,CACR,CAAC;AACJ,CAAC,CAAC;AAjGW,QAAA,WAAW,eAiGtB","sourcesContent":["import {\n AvatarBaseShape,\n AvatarGroupSize,\n AvatarGroupVariant,\n TextColor,\n} from '@metamask/design-system-shared';\nimport { useTailwind } from '@metamask/design-system-twrnc-preset';\nimport React, { useCallback } from 'react';\nimport { View } from 'react-native';\n\nimport type { AvatarAccountProps } from '../AvatarAccount';\nimport { AvatarAccount } from '../AvatarAccount';\nimport { AvatarBase } from '../AvatarBase';\nimport type { AvatarFaviconProps } from '../AvatarFavicon';\nimport { AvatarFavicon } from '../AvatarFavicon';\nimport type { AvatarNetworkProps } from '../AvatarNetwork';\nimport { AvatarNetwork } from '../AvatarNetwork';\nimport type { AvatarTokenProps } from '../AvatarToken';\nimport { AvatarToken } from '../AvatarToken';\n\nimport {\n MAP_AVATARGROUP_SIZE_OVERFLOWTEXT_TEXTVARIANT,\n TWCLASSMAP_AVATARGROUP_SIZE_SPACEBETWEENAVATARS,\n} from './AvatarGroup.constants';\nimport type { AvatarGroupProps } from './AvatarGroup.types';\n\nexport const AvatarGroup = ({\n variant,\n avatarPropsArr,\n size = AvatarGroupSize.Md,\n max = 4,\n isReverse = false,\n overflowTextProps,\n style,\n twClassName,\n ...props\n}: AvatarGroupProps) => {\n const tw = useTailwind();\n const overflowCounter = avatarPropsArr.length - max;\n const shouldRenderOverflowCounter = overflowCounter > 0;\n\n const renderAvatarList = useCallback(\n () =>\n avatarPropsArr.slice(0, max).map((avatarProps, index) => {\n switch (variant) {\n case AvatarGroupVariant.Account:\n return (\n <AvatarAccount\n key={`avatar-${index}`}\n {...(avatarProps as AvatarAccountProps)}\n size={size}\n hasBorder\n />\n );\n case AvatarGroupVariant.Favicon:\n return (\n <AvatarFavicon\n key={`avatar-${index}`}\n {...(avatarProps as AvatarFaviconProps)}\n size={size}\n hasBorder\n />\n );\n case AvatarGroupVariant.Network:\n return (\n <AvatarNetwork\n key={`avatar-${index}`}\n {...(avatarProps as AvatarNetworkProps)}\n size={size}\n hasBorder\n />\n );\n case AvatarGroupVariant.Token:\n return (\n <AvatarToken\n key={`avatar-${index}`}\n {...(avatarProps as AvatarTokenProps)}\n size={size}\n hasBorder\n />\n );\n default:\n throw new Error(\n `Invalid Avatar Variant: ${String(variant)}. Expected one of: ${Object.values(AvatarGroupVariant).join(', ')}`,\n );\n }\n }),\n [avatarPropsArr, max, size, variant],\n );\n\n return (\n <View\n {...props}\n style={[\n tw.style(\n isReverse ? 'flex-row-reverse' : 'flex-row',\n TWCLASSMAP_AVATARGROUP_SIZE_SPACEBETWEENAVATARS[size],\n twClassName,\n ),\n style,\n ]}\n >\n {renderAvatarList()}\n {shouldRenderOverflowCounter && (\n <AvatarBase\n twClassName=\"bg-icon-default\"\n hasBorder\n fallbackText={`+${overflowCounter}`}\n fallbackTextProps={{\n variant: MAP_AVATARGROUP_SIZE_OVERFLOWTEXT_TEXTVARIANT[size],\n color: TextColor.PrimaryInverse,\n }}\n size={size}\n shape={\n variant === AvatarGroupVariant.Network\n ? AvatarBaseShape.Square\n : AvatarBaseShape.Circle\n }\n {...overflowTextProps}\n />\n )}\n </View>\n );\n};\n"]}
|
|
@@ -8,7 +8,7 @@ import { AvatarBaseShape, AvatarGroupSize, AvatarGroupVariant, TextColor } from
|
|
|
8
8
|
import { useTailwind } from "@metamask/design-system-twrnc-preset";
|
|
9
9
|
import $React, { useCallback } from "react";
|
|
10
10
|
const React = $importDefault($React);
|
|
11
|
-
import { View } from "react-native
|
|
11
|
+
import { View } from "react-native";
|
|
12
12
|
import { AvatarAccount } from "../AvatarAccount/index.mjs";
|
|
13
13
|
import { AvatarBase } from "../AvatarBase/index.mjs";
|
|
14
14
|
import { AvatarFavicon } from "../AvatarFavicon/index.mjs";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AvatarGroup.mjs","sourceRoot":"","sources":["../../../src/components/AvatarGroup/AvatarGroup.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,EACL,eAAe,EACf,eAAe,EACf,kBAAkB,EAClB,SAAS,EACV,uCAAuC;AACxC,OAAO,EAAE,WAAW,EAAE,6CAA6C;AACnE,OAAO,QAAO,EAAE,WAAW,EAAE,cAAc;;AAC3C,OAAO,EAAE,IAAI,EAAE,
|
|
1
|
+
{"version":3,"file":"AvatarGroup.mjs","sourceRoot":"","sources":["../../../src/components/AvatarGroup/AvatarGroup.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,EACL,eAAe,EACf,eAAe,EACf,kBAAkB,EAClB,SAAS,EACV,uCAAuC;AACxC,OAAO,EAAE,WAAW,EAAE,6CAA6C;AACnE,OAAO,QAAO,EAAE,WAAW,EAAE,cAAc;;AAC3C,OAAO,EAAE,IAAI,EAAE,qBAAqB;AAGpC,OAAO,EAAE,aAAa,EAAE,mCAAyB;AACjD,OAAO,EAAE,UAAU,EAAE,gCAAsB;AAE3C,OAAO,EAAE,aAAa,EAAE,mCAAyB;AAEjD,OAAO,EAAE,aAAa,EAAE,mCAAyB;AAE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CACR,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import {\n AvatarBaseShape,\n AvatarGroupSize,\n AvatarGroupVariant,\n TextColor,\n} from '@metamask/design-system-shared';\nimport { useTailwind } from '@metamask/design-system-twrnc-preset';\nimport React, { useCallback } from 'react';\nimport { View } from 'react-native';\n\nimport type { AvatarAccountProps } from '../AvatarAccount';\nimport { AvatarAccount } from '../AvatarAccount';\nimport { AvatarBase } from '../AvatarBase';\nimport type { AvatarFaviconProps } from '../AvatarFavicon';\nimport { AvatarFavicon } from '../AvatarFavicon';\nimport type { AvatarNetworkProps } from '../AvatarNetwork';\nimport { AvatarNetwork } from '../AvatarNetwork';\nimport type { AvatarTokenProps } from '../AvatarToken';\nimport { AvatarToken } from '../AvatarToken';\n\nimport {\n MAP_AVATARGROUP_SIZE_OVERFLOWTEXT_TEXTVARIANT,\n TWCLASSMAP_AVATARGROUP_SIZE_SPACEBETWEENAVATARS,\n} from './AvatarGroup.constants';\nimport type { AvatarGroupProps } from './AvatarGroup.types';\n\nexport const AvatarGroup = ({\n variant,\n avatarPropsArr,\n size = AvatarGroupSize.Md,\n max = 4,\n isReverse = false,\n overflowTextProps,\n style,\n twClassName,\n ...props\n}: AvatarGroupProps) => {\n const tw = useTailwind();\n const overflowCounter = avatarPropsArr.length - max;\n const shouldRenderOverflowCounter = overflowCounter > 0;\n\n const renderAvatarList = useCallback(\n () =>\n avatarPropsArr.slice(0, max).map((avatarProps, index) => {\n switch (variant) {\n case AvatarGroupVariant.Account:\n return (\n <AvatarAccount\n key={`avatar-${index}`}\n {...(avatarProps as AvatarAccountProps)}\n size={size}\n hasBorder\n />\n );\n case AvatarGroupVariant.Favicon:\n return (\n <AvatarFavicon\n key={`avatar-${index}`}\n {...(avatarProps as AvatarFaviconProps)}\n size={size}\n hasBorder\n />\n );\n case AvatarGroupVariant.Network:\n return (\n <AvatarNetwork\n key={`avatar-${index}`}\n {...(avatarProps as AvatarNetworkProps)}\n size={size}\n hasBorder\n />\n );\n case AvatarGroupVariant.Token:\n return (\n <AvatarToken\n key={`avatar-${index}`}\n {...(avatarProps as AvatarTokenProps)}\n size={size}\n hasBorder\n />\n );\n default:\n throw new Error(\n `Invalid Avatar Variant: ${String(variant)}. Expected one of: ${Object.values(AvatarGroupVariant).join(', ')}`,\n );\n }\n }),\n [avatarPropsArr, max, size, variant],\n );\n\n return (\n <View\n {...props}\n style={[\n tw.style(\n isReverse ? 'flex-row-reverse' : 'flex-row',\n TWCLASSMAP_AVATARGROUP_SIZE_SPACEBETWEENAVATARS[size],\n twClassName,\n ),\n style,\n ]}\n >\n {renderAvatarList()}\n {shouldRenderOverflowCounter && (\n <AvatarBase\n twClassName=\"bg-icon-default\"\n hasBorder\n fallbackText={`+${overflowCounter}`}\n fallbackTextProps={{\n variant: MAP_AVATARGROUP_SIZE_OVERFLOWTEXT_TEXTVARIANT[size],\n color: TextColor.PrimaryInverse,\n }}\n size={size}\n shape={\n variant === AvatarGroupVariant.Network\n ? AvatarBaseShape.Square\n : AvatarBaseShape.Circle\n }\n {...overflowTextProps}\n />\n )}\n </View>\n );\n};\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { AvatarGroupPropsShared, AvatarGroupVariant } from "@metamask/design-system-shared";
|
|
2
|
-
import type { ViewProps } from "react-native
|
|
2
|
+
import type { ViewProps } from "react-native";
|
|
3
3
|
import type { AvatarAccountProps } from "../AvatarAccount/index.cjs";
|
|
4
4
|
import type { AvatarBaseProps } from "../AvatarBase/index.cjs";
|
|
5
5
|
import type { AvatarFaviconProps } from "../AvatarFavicon/index.cjs";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AvatarGroup.types.d.cts","sourceRoot":"","sources":["../../../src/components/AvatarGroup/AvatarGroup.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,sBAAsB,EACtB,kBAAkB,EACnB,uCAAuC;AACxC,OAAO,KAAK,EAAE,SAAS,EAAE,
|
|
1
|
+
{"version":3,"file":"AvatarGroup.types.d.cts","sourceRoot":"","sources":["../../../src/components/AvatarGroup/AvatarGroup.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,sBAAsB,EACtB,kBAAkB,EACnB,uCAAuC;AACxC,OAAO,KAAK,EAAE,SAAS,EAAE,qBAAqB;AAE9C,OAAO,KAAK,EAAE,kBAAkB,EAAE,mCAAyB;AAC3D,OAAO,KAAK,EAAE,eAAe,EAAE,gCAAsB;AACrD,OAAO,KAAK,EAAE,kBAAkB,EAAE,mCAAyB;AAC3D,OAAO,KAAK,EAAE,kBAAkB,EAAE,mCAAyB;AAC3D,OAAO,KAAK,EAAE,gBAAgB,EAAE,iCAAuB;AAEvD,KAAK,oBAAoB,GAAG,IAAI,CAAC,sBAAsB,EAAE,SAAS,CAAC,GAAG;IACpE;;OAEG;IACH,iBAAiB,CAAC,EAAE,eAAe,CAAC;IACpC;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,GAAG,SAAS,CAAC;AAEd;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,oBAAoB,GACjD,CACI;IACE,OAAO,EAAE,OAAO,kBAAkB,CAAC,OAAO,CAAC;IAC3C;;;OAGG;IACH,cAAc,EAAE,kBAAkB,EAAE,CAAC;CACtC,GACD;IACE,OAAO,EAAE,OAAO,kBAAkB,CAAC,OAAO,CAAC;IAC3C;;;OAGG;IACH,cAAc,EAAE,kBAAkB,EAAE,CAAC;CACtC,GACD;IACE,OAAO,EAAE,OAAO,kBAAkB,CAAC,OAAO,CAAC;IAC3C;;;OAGG;IACH,cAAc,EAAE,kBAAkB,EAAE,CAAC;CACtC,GACD;IACE,OAAO,EAAE,OAAO,kBAAkB,CAAC,KAAK,CAAC;IACzC;;;OAGG;IACH,cAAc,EAAE,gBAAgB,EAAE,CAAC;CACpC,CACJ,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { AvatarGroupPropsShared, AvatarGroupVariant } from "@metamask/design-system-shared";
|
|
2
|
-
import type { ViewProps } from "react-native
|
|
2
|
+
import type { ViewProps } from "react-native";
|
|
3
3
|
import type { AvatarAccountProps } from "../AvatarAccount/index.mjs";
|
|
4
4
|
import type { AvatarBaseProps } from "../AvatarBase/index.mjs";
|
|
5
5
|
import type { AvatarFaviconProps } from "../AvatarFavicon/index.mjs";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AvatarGroup.types.d.mts","sourceRoot":"","sources":["../../../src/components/AvatarGroup/AvatarGroup.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,sBAAsB,EACtB,kBAAkB,EACnB,uCAAuC;AACxC,OAAO,KAAK,EAAE,SAAS,EAAE,
|
|
1
|
+
{"version":3,"file":"AvatarGroup.types.d.mts","sourceRoot":"","sources":["../../../src/components/AvatarGroup/AvatarGroup.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,sBAAsB,EACtB,kBAAkB,EACnB,uCAAuC;AACxC,OAAO,KAAK,EAAE,SAAS,EAAE,qBAAqB;AAE9C,OAAO,KAAK,EAAE,kBAAkB,EAAE,mCAAyB;AAC3D,OAAO,KAAK,EAAE,eAAe,EAAE,gCAAsB;AACrD,OAAO,KAAK,EAAE,kBAAkB,EAAE,mCAAyB;AAC3D,OAAO,KAAK,EAAE,kBAAkB,EAAE,mCAAyB;AAC3D,OAAO,KAAK,EAAE,gBAAgB,EAAE,iCAAuB;AAEvD,KAAK,oBAAoB,GAAG,IAAI,CAAC,sBAAsB,EAAE,SAAS,CAAC,GAAG;IACpE;;OAEG;IACH,iBAAiB,CAAC,EAAE,eAAe,CAAC;IACpC;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,GAAG,SAAS,CAAC;AAEd;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,oBAAoB,GACjD,CACI;IACE,OAAO,EAAE,OAAO,kBAAkB,CAAC,OAAO,CAAC;IAC3C;;;OAGG;IACH,cAAc,EAAE,kBAAkB,EAAE,CAAC;CACtC,GACD;IACE,OAAO,EAAE,OAAO,kBAAkB,CAAC,OAAO,CAAC;IAC3C;;;OAGG;IACH,cAAc,EAAE,kBAAkB,EAAE,CAAC;CACtC,GACD;IACE,OAAO,EAAE,OAAO,kBAAkB,CAAC,OAAO,CAAC;IAC3C;;;OAGG;IACH,cAAc,EAAE,kBAAkB,EAAE,CAAC;CACtC,GACD;IACE,OAAO,EAAE,OAAO,kBAAkB,CAAC,KAAK,CAAC;IACzC;;;OAGG;IACH,cAAc,EAAE,gBAAgB,EAAE,CAAC;CACpC,CACJ,CAAC"}
|
|
@@ -31,7 +31,7 @@ const AvatarBase_1 = require("../AvatarBase/index.cjs");
|
|
|
31
31
|
const ImageOrSvg_1 = require("../temp-components/ImageOrSvg/index.cjs");
|
|
32
32
|
const AvatarNetwork = ({ src, size = types_1.AvatarNetworkSize.Md, name, fallbackText, fallbackTextProps, imageOrSvgProps, ...props }) => {
|
|
33
33
|
const [finalFallbackText, setFallbackText] = (0, react_1.useState)('');
|
|
34
|
-
const backupFallbackText = fallbackText || name?.[0] || '';
|
|
34
|
+
const backupFallbackText = fallbackText || name?.[0] || '?';
|
|
35
35
|
const onImageErrorHandler = (e) => {
|
|
36
36
|
setFallbackText(backupFallbackText);
|
|
37
37
|
imageOrSvgProps?.onImageError?.(e);
|
|
@@ -40,7 +40,7 @@ const AvatarNetwork = ({ src, size = types_1.AvatarNetworkSize.Md, name, fallbac
|
|
|
40
40
|
setFallbackText(backupFallbackText);
|
|
41
41
|
imageOrSvgProps?.onSvgError?.(e);
|
|
42
42
|
};
|
|
43
|
-
return (<AvatarBase_1.AvatarBase size={size} shape={design_system_shared_1.AvatarBaseShape.Square} fallbackText={finalFallbackText} fallbackTextProps={fallbackTextProps} {...props}>
|
|
43
|
+
return (<AvatarBase_1.AvatarBase size={size} shape={design_system_shared_1.AvatarBaseShape.Square} fallbackText={src ? finalFallbackText : backupFallbackText} fallbackTextProps={fallbackTextProps} {...props}>
|
|
44
44
|
{src && (<ImageOrSvg_1.ImageOrSvg src={src} width={'100%'} height={'100%'} {...imageOrSvgProps} imageProps={{
|
|
45
45
|
resizeMode: 'contain',
|
|
46
46
|
...imageOrSvgProps?.imageProps,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AvatarNetwork.cjs","sourceRoot":"","sources":["../../../src/components/AvatarNetwork/AvatarNetwork.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yEAAiE;AACjE,+CAAwC;AAGxC,iDAAgD;AAChD,wDAA2C;AAC3C,wEAA2D;AAIpD,MAAM,aAAa,GAAG,CAAC,EAC5B,GAAG,EACH,IAAI,GAAG,yBAAiB,CAAC,EAAE,EAC3B,IAAI,EACJ,YAAY,EACZ,iBAAiB,EACjB,eAAe,EACf,GAAG,KAAK,EACW,EAAE,EAAE;IACvB,MAAM,CAAC,iBAAiB,EAAE,eAAe,CAAC,GAAG,IAAA,gBAAQ,EAAS,EAAE,CAAC,CAAC;IAElE,MAAM,kBAAkB,GAAG,YAAY,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,
|
|
1
|
+
{"version":3,"file":"AvatarNetwork.cjs","sourceRoot":"","sources":["../../../src/components/AvatarNetwork/AvatarNetwork.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yEAAiE;AACjE,+CAAwC;AAGxC,iDAAgD;AAChD,wDAA2C;AAC3C,wEAA2D;AAIpD,MAAM,aAAa,GAAG,CAAC,EAC5B,GAAG,EACH,IAAI,GAAG,yBAAiB,CAAC,EAAE,EAC3B,IAAI,EACJ,YAAY,EACZ,iBAAiB,EACjB,eAAe,EACf,GAAG,KAAK,EACW,EAAE,EAAE;IACvB,MAAM,CAAC,iBAAiB,EAAE,eAAe,CAAC,GAAG,IAAA,gBAAQ,EAAS,EAAE,CAAC,CAAC;IAElE,MAAM,kBAAkB,GAAG,YAAY,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC;IAC5D,MAAM,mBAAmB,GAAG,CAAC,CAAkB,EAAE,EAAE;QACjD,eAAe,CAAC,kBAAkB,CAAC,CAAC;QACpC,eAAe,EAAE,YAAY,EAAE,CAAC,CAAC,CAAC,CAAC;IACrC,CAAC,CAAC;IAEF,MAAM,iBAAiB,GAAG,CAAC,CAAQ,EAAE,EAAE;QACrC,eAAe,CAAC,kBAAkB,CAAC,CAAC;QACpC,eAAe,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC,CAAC;IACnC,CAAC,CAAC;IAEF,OAAO,CACL,CAAC,uBAAU,CACT,IAAI,CAAC,CAAC,IAAI,CAAC,CACX,KAAK,CAAC,CAAC,sCAAe,CAAC,MAAM,CAAC,CAC9B,YAAY,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAC3D,iBAAiB,CAAC,CAAC,iBAAiB,CAAC,CACrC,IAAI,KAAK,CAAC,CAEV;MAAA,CAAC,GAAG,IAAI,CACN,CAAC,uBAAU,CACT,GAAG,CAAC,CAAC,GAAG,CAAC,CACT,KAAK,CAAC,CAAC,MAAM,CAAC,CACd,MAAM,CAAC,CAAC,MAAM,CAAC,CACf,IAAI,eAAe,CAAC,CACpB,UAAU,CAAC,CAAC;gBACV,UAAU,EAAE,SAAS;gBACrB,GAAG,eAAe,EAAE,UAAU;aAC/B,CAAC,CACF,YAAY,CAAC,CAAC,mBAAmB,CAAC,CAClC,UAAU,CAAC,CAAC,iBAAiB,CAAC,EAC9B,CACH,CACH;IAAA,EAAE,uBAAU,CAAC,CACd,CAAC;AACJ,CAAC,CAAC;AA9CW,QAAA,aAAa,iBA8CxB","sourcesContent":["import { AvatarBaseShape } from '@metamask/design-system-shared';\nimport React, { useState } from 'react';\nimport type { ImageErrorEvent } from 'react-native';\n\nimport { AvatarNetworkSize } from '../../types';\nimport { AvatarBase } from '../AvatarBase';\nimport { ImageOrSvg } from '../temp-components/ImageOrSvg';\n\nimport type { AvatarNetworkProps } from './AvatarNetwork.types';\n\nexport const AvatarNetwork = ({\n src,\n size = AvatarNetworkSize.Md,\n name,\n fallbackText,\n fallbackTextProps,\n imageOrSvgProps,\n ...props\n}: AvatarNetworkProps) => {\n const [finalFallbackText, setFallbackText] = useState<string>('');\n\n const backupFallbackText = fallbackText || name?.[0] || '?';\n const onImageErrorHandler = (e: ImageErrorEvent) => {\n setFallbackText(backupFallbackText);\n imageOrSvgProps?.onImageError?.(e);\n };\n\n const onSvgErrorHandler = (e: Error) => {\n setFallbackText(backupFallbackText);\n imageOrSvgProps?.onSvgError?.(e);\n };\n\n return (\n <AvatarBase\n size={size}\n shape={AvatarBaseShape.Square}\n fallbackText={src ? finalFallbackText : backupFallbackText}\n fallbackTextProps={fallbackTextProps}\n {...props}\n >\n {src && (\n <ImageOrSvg\n src={src}\n width={'100%'}\n height={'100%'}\n {...imageOrSvgProps}\n imageProps={{\n resizeMode: 'contain',\n ...imageOrSvgProps?.imageProps,\n }}\n onImageError={onImageErrorHandler}\n onSvgError={onSvgErrorHandler}\n />\n )}\n </AvatarBase>\n );\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AvatarNetwork.d.cts","sourceRoot":"","sources":["../../../src/components/AvatarNetwork/AvatarNetwork.tsx"],"names":[],"mappings":"AACA,OAAO,KAAmB,cAAc;AAOxC,OAAO,KAAK,EAAE,kBAAkB,EAAE,kCAA8B;AAEhE,eAAO,MAAM,aAAa,oFAQvB,kBAAkB,
|
|
1
|
+
{"version":3,"file":"AvatarNetwork.d.cts","sourceRoot":"","sources":["../../../src/components/AvatarNetwork/AvatarNetwork.tsx"],"names":[],"mappings":"AACA,OAAO,KAAmB,cAAc;AAOxC,OAAO,KAAK,EAAE,kBAAkB,EAAE,kCAA8B;AAEhE,eAAO,MAAM,aAAa,oFAQvB,kBAAkB,sBAsCpB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AvatarNetwork.d.mts","sourceRoot":"","sources":["../../../src/components/AvatarNetwork/AvatarNetwork.tsx"],"names":[],"mappings":"AACA,OAAO,KAAmB,cAAc;AAOxC,OAAO,KAAK,EAAE,kBAAkB,EAAE,kCAA8B;AAEhE,eAAO,MAAM,aAAa,oFAQvB,kBAAkB,
|
|
1
|
+
{"version":3,"file":"AvatarNetwork.d.mts","sourceRoot":"","sources":["../../../src/components/AvatarNetwork/AvatarNetwork.tsx"],"names":[],"mappings":"AACA,OAAO,KAAmB,cAAc;AAOxC,OAAO,KAAK,EAAE,kBAAkB,EAAE,kCAA8B;AAEhE,eAAO,MAAM,aAAa,oFAQvB,kBAAkB,sBAsCpB,CAAC"}
|
|
@@ -12,7 +12,7 @@ import { AvatarBase } from "../AvatarBase/index.mjs";
|
|
|
12
12
|
import { ImageOrSvg } from "../temp-components/ImageOrSvg/index.mjs";
|
|
13
13
|
export const AvatarNetwork = ({ src, size = AvatarNetworkSize.Md, name, fallbackText, fallbackTextProps, imageOrSvgProps, ...props }) => {
|
|
14
14
|
const [finalFallbackText, setFallbackText] = useState('');
|
|
15
|
-
const backupFallbackText = fallbackText || name?.[0] || '';
|
|
15
|
+
const backupFallbackText = fallbackText || name?.[0] || '?';
|
|
16
16
|
const onImageErrorHandler = (e) => {
|
|
17
17
|
setFallbackText(backupFallbackText);
|
|
18
18
|
imageOrSvgProps?.onImageError?.(e);
|
|
@@ -21,7 +21,7 @@ export const AvatarNetwork = ({ src, size = AvatarNetworkSize.Md, name, fallback
|
|
|
21
21
|
setFallbackText(backupFallbackText);
|
|
22
22
|
imageOrSvgProps?.onSvgError?.(e);
|
|
23
23
|
};
|
|
24
|
-
return (<AvatarBase size={size} shape={AvatarBaseShape.Square} fallbackText={finalFallbackText} fallbackTextProps={fallbackTextProps} {...props}>
|
|
24
|
+
return (<AvatarBase size={size} shape={AvatarBaseShape.Square} fallbackText={src ? finalFallbackText : backupFallbackText} fallbackTextProps={fallbackTextProps} {...props}>
|
|
25
25
|
{src && (<ImageOrSvg src={src} width={'100%'} height={'100%'} {...imageOrSvgProps} imageProps={{
|
|
26
26
|
resizeMode: 'contain',
|
|
27
27
|
...imageOrSvgProps?.imageProps,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AvatarNetwork.mjs","sourceRoot":"","sources":["../../../src/components/AvatarNetwork/AvatarNetwork.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,eAAe,EAAE,uCAAuC;AACjE,OAAO,QAAO,EAAE,QAAQ,EAAE,cAAc;;AAGxC,OAAO,EAAE,iBAAiB,EAAE,8BAAoB;AAChD,OAAO,EAAE,UAAU,EAAE,gCAAsB;AAC3C,OAAO,EAAE,UAAU,EAAE,gDAAsC;AAI3D,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,EAC5B,GAAG,EACH,IAAI,GAAG,iBAAiB,CAAC,EAAE,EAC3B,IAAI,EACJ,YAAY,EACZ,iBAAiB,EACjB,eAAe,EACf,GAAG,KAAK,EACW,EAAE,EAAE;IACvB,MAAM,CAAC,iBAAiB,EAAE,eAAe,CAAC,GAAG,QAAQ,CAAS,EAAE,CAAC,CAAC;IAElE,MAAM,kBAAkB,GAAG,YAAY,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,
|
|
1
|
+
{"version":3,"file":"AvatarNetwork.mjs","sourceRoot":"","sources":["../../../src/components/AvatarNetwork/AvatarNetwork.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,eAAe,EAAE,uCAAuC;AACjE,OAAO,QAAO,EAAE,QAAQ,EAAE,cAAc;;AAGxC,OAAO,EAAE,iBAAiB,EAAE,8BAAoB;AAChD,OAAO,EAAE,UAAU,EAAE,gCAAsB;AAC3C,OAAO,EAAE,UAAU,EAAE,gDAAsC;AAI3D,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,EAC5B,GAAG,EACH,IAAI,GAAG,iBAAiB,CAAC,EAAE,EAC3B,IAAI,EACJ,YAAY,EACZ,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esContent":["import { AvatarBaseShape } from '@metamask/design-system-shared';\nimport React, { useState } from 'react';\nimport type { ImageErrorEvent } from 'react-native';\n\nimport { AvatarNetworkSize } from '../../types';\nimport { AvatarBase } from '../AvatarBase';\nimport { ImageOrSvg } from '../temp-components/ImageOrSvg';\n\nimport type { AvatarNetworkProps } from './AvatarNetwork.types';\n\nexport const AvatarNetwork = ({\n src,\n size = AvatarNetworkSize.Md,\n name,\n fallbackText,\n fallbackTextProps,\n imageOrSvgProps,\n ...props\n}: AvatarNetworkProps) => {\n const [finalFallbackText, setFallbackText] = useState<string>('');\n\n const backupFallbackText = fallbackText || name?.[0] || '?';\n const onImageErrorHandler = (e: ImageErrorEvent) => {\n setFallbackText(backupFallbackText);\n imageOrSvgProps?.onImageError?.(e);\n };\n\n const onSvgErrorHandler = (e: Error) => {\n setFallbackText(backupFallbackText);\n imageOrSvgProps?.onSvgError?.(e);\n };\n\n return (\n <AvatarBase\n size={size}\n shape={AvatarBaseShape.Square}\n fallbackText={src ? finalFallbackText : backupFallbackText}\n fallbackTextProps={fallbackTextProps}\n {...props}\n >\n {src && (\n <ImageOrSvg\n src={src}\n width={'100%'}\n height={'100%'}\n {...imageOrSvgProps}\n imageProps={{\n resizeMode: 'contain',\n ...imageOrSvgProps?.imageProps,\n }}\n onImageError={onImageErrorHandler}\n onSvgError={onSvgErrorHandler}\n />\n )}\n </AvatarBase>\n );\n};\n"]}
|