@metamask-previews/design-system-react-native 0.24.0-preview.178e60f → 0.26.0-preview.047f96c
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 +30 -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 +1 -1
- package/dist/components/AvatarBase/AvatarBase.cjs.map +1 -1
- package/dist/components/AvatarBase/AvatarBase.mjs +1 -1
- 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/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/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 +6 -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 +6 -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/BottomSheetOverlay/BottomSheetOverlay.cjs +1 -1
- package/dist/components/BottomSheetOverlay/BottomSheetOverlay.cjs.map +1 -1
- package/dist/components/BottomSheetOverlay/BottomSheetOverlay.mjs +1 -1
- 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/HeaderBase/HeaderBase.cjs +1 -1
- package/dist/components/HeaderBase/HeaderBase.cjs.map +1 -1
- package/dist/components/HeaderBase/HeaderBase.mjs +1 -1
- package/dist/components/HeaderBase/HeaderBase.mjs.map +1 -1
- package/dist/components/HeaderBase/HeaderBase.types.d.cts +1 -1
- package/dist/components/HeaderBase/HeaderBase.types.d.cts.map +1 -1
- package/dist/components/HeaderBase/HeaderBase.types.d.mts +1 -1
- package/dist/components/HeaderBase/HeaderBase.types.d.mts.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/Icon/assets/telegram.svg +1 -3
- 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.cjs +47 -0
- package/dist/components/SectionDivider/SectionDivider.cjs.map +1 -0
- package/dist/components/SectionDivider/SectionDivider.d.cts +6 -0
- package/dist/components/SectionDivider/SectionDivider.d.cts.map +1 -0
- package/dist/components/SectionDivider/SectionDivider.d.mts +6 -0
- package/dist/components/SectionDivider/SectionDivider.d.mts.map +1 -0
- package/dist/components/SectionDivider/SectionDivider.mjs +28 -0
- package/dist/components/SectionDivider/SectionDivider.mjs.map +1 -0
- package/dist/components/SectionDivider/SectionDivider.types.cjs +3 -0
- package/dist/components/SectionDivider/SectionDivider.types.cjs.map +1 -0
- package/dist/components/SectionDivider/SectionDivider.types.d.cts +3 -0
- package/dist/components/SectionDivider/SectionDivider.types.d.cts.map +1 -0
- package/dist/components/SectionDivider/SectionDivider.types.d.mts +3 -0
- package/dist/components/SectionDivider/SectionDivider.types.d.mts.map +1 -0
- package/dist/components/SectionDivider/SectionDivider.types.mjs +2 -0
- package/dist/components/SectionDivider/SectionDivider.types.mjs.map +1 -0
- package/dist/components/SectionDivider/index.cjs +6 -0
- package/dist/components/SectionDivider/index.cjs.map +1 -0
- package/dist/components/SectionDivider/index.d.cts +3 -0
- package/dist/components/SectionDivider/index.d.cts.map +1 -0
- package/dist/components/SectionDivider/index.d.mts +3 -0
- package/dist/components/SectionDivider/index.d.mts.map +1 -0
- package/dist/components/SectionDivider/index.mjs +2 -0
- package/dist/components/SectionDivider/index.mjs.map +1 -0
- package/dist/components/SectionHeader/SectionHeader.cjs +45 -0
- package/dist/components/SectionHeader/SectionHeader.cjs.map +1 -0
- package/dist/components/SectionHeader/SectionHeader.d.cts +23 -0
- package/dist/components/SectionHeader/SectionHeader.d.cts.map +1 -0
- package/dist/components/SectionHeader/SectionHeader.d.mts +23 -0
- package/dist/components/SectionHeader/SectionHeader.d.mts.map +1 -0
- package/dist/components/SectionHeader/SectionHeader.mjs +45 -0
- package/dist/components/SectionHeader/SectionHeader.mjs.map +1 -0
- package/dist/components/SectionHeader/SectionHeader.types.cjs +3 -0
- package/dist/components/SectionHeader/SectionHeader.types.cjs.map +1 -0
- package/dist/components/SectionHeader/SectionHeader.types.d.cts +32 -0
- package/dist/components/SectionHeader/SectionHeader.types.d.cts.map +1 -0
- package/dist/components/SectionHeader/SectionHeader.types.d.mts +32 -0
- package/dist/components/SectionHeader/SectionHeader.types.d.mts.map +1 -0
- package/dist/components/SectionHeader/SectionHeader.types.mjs +2 -0
- package/dist/components/SectionHeader/SectionHeader.types.mjs.map +1 -0
- package/dist/components/SectionHeader/index.cjs +6 -0
- package/dist/components/SectionHeader/index.cjs.map +1 -0
- package/dist/components/SectionHeader/index.d.cts +3 -0
- package/dist/components/SectionHeader/index.d.cts.map +1 -0
- package/dist/components/SectionHeader/index.d.mts +3 -0
- package/dist/components/SectionHeader/index.d.mts.map +1 -0
- package/dist/components/SectionHeader/index.mjs +2 -0
- package/dist/components/SectionHeader/index.mjs.map +1 -0
- package/dist/components/SegmentButton/SegmentButton.cjs +86 -0
- package/dist/components/SegmentButton/SegmentButton.cjs.map +1 -0
- package/dist/components/SegmentButton/SegmentButton.d.cts +7 -0
- package/dist/components/SegmentButton/SegmentButton.d.cts.map +1 -0
- package/dist/components/SegmentButton/SegmentButton.d.mts +7 -0
- package/dist/components/SegmentButton/SegmentButton.d.mts.map +1 -0
- package/dist/components/SegmentButton/SegmentButton.mjs +66 -0
- package/dist/components/SegmentButton/SegmentButton.mjs.map +1 -0
- package/dist/components/SegmentButton/SegmentButton.types.cjs +3 -0
- package/dist/components/SegmentButton/SegmentButton.types.cjs.map +1 -0
- package/dist/components/SegmentButton/SegmentButton.types.d.cts +9 -0
- package/dist/components/SegmentButton/SegmentButton.types.d.cts.map +1 -0
- package/dist/components/SegmentButton/SegmentButton.types.d.mts +9 -0
- package/dist/components/SegmentButton/SegmentButton.types.d.mts.map +1 -0
- package/dist/components/SegmentButton/SegmentButton.types.mjs +2 -0
- package/dist/components/SegmentButton/SegmentButton.types.mjs.map +1 -0
- package/dist/components/SegmentButton/index.cjs +8 -0
- package/dist/components/SegmentButton/index.cjs.map +1 -0
- package/dist/components/SegmentButton/index.d.cts +4 -0
- package/dist/components/SegmentButton/index.d.cts.map +1 -0
- package/dist/components/SegmentButton/index.d.mts +4 -0
- package/dist/components/SegmentButton/index.d.mts.map +1 -0
- package/dist/components/SegmentButton/index.mjs +3 -0
- package/dist/components/SegmentButton/index.mjs.map +1 -0
- package/dist/components/SegmentGroup/SegmentGroup.cjs +47 -0
- package/dist/components/SegmentGroup/SegmentGroup.cjs.map +1 -0
- package/dist/components/SegmentGroup/SegmentGroup.d.cts +7 -0
- package/dist/components/SegmentGroup/SegmentGroup.d.cts.map +1 -0
- package/dist/components/SegmentGroup/SegmentGroup.d.mts +7 -0
- package/dist/components/SegmentGroup/SegmentGroup.d.mts.map +1 -0
- package/dist/components/SegmentGroup/SegmentGroup.mjs +27 -0
- package/dist/components/SegmentGroup/SegmentGroup.mjs.map +1 -0
- package/dist/components/SegmentGroup/SegmentGroup.types.cjs +3 -0
- package/dist/components/SegmentGroup/SegmentGroup.types.cjs.map +1 -0
- package/dist/components/SegmentGroup/SegmentGroup.types.d.cts +12 -0
- package/dist/components/SegmentGroup/SegmentGroup.types.d.cts.map +1 -0
- package/dist/components/SegmentGroup/SegmentGroup.types.d.mts +12 -0
- package/dist/components/SegmentGroup/SegmentGroup.types.d.mts.map +1 -0
- package/dist/components/SegmentGroup/SegmentGroup.types.mjs +2 -0
- package/dist/components/SegmentGroup/SegmentGroup.types.mjs.map +1 -0
- package/dist/components/SegmentGroup/index.cjs +6 -0
- package/dist/components/SegmentGroup/index.cjs.map +1 -0
- package/dist/components/SegmentGroup/index.d.cts +3 -0
- package/dist/components/SegmentGroup/index.d.cts.map +1 -0
- package/dist/components/SegmentGroup/index.d.mts +3 -0
- package/dist/components/SegmentGroup/index.d.mts.map +1 -0
- package/dist/components/SegmentGroup/index.mjs +2 -0
- package/dist/components/SegmentGroup/index.mjs.map +1 -0
- package/dist/components/SelectButton/SelectButton.cjs +53 -0
- package/dist/components/SelectButton/SelectButton.cjs.map +1 -0
- package/dist/components/SelectButton/SelectButton.constants.cjs +12 -0
- package/dist/components/SelectButton/SelectButton.constants.cjs.map +1 -0
- package/dist/components/SelectButton/SelectButton.constants.d.cts +4 -0
- package/dist/components/SelectButton/SelectButton.constants.d.cts.map +1 -0
- package/dist/components/SelectButton/SelectButton.constants.d.mts +4 -0
- package/dist/components/SelectButton/SelectButton.constants.d.mts.map +1 -0
- package/dist/components/SelectButton/SelectButton.constants.mjs +9 -0
- package/dist/components/SelectButton/SelectButton.constants.mjs.map +1 -0
- package/dist/components/SelectButton/SelectButton.d.cts +7 -0
- package/dist/components/SelectButton/SelectButton.d.cts.map +1 -0
- package/dist/components/SelectButton/SelectButton.d.mts +7 -0
- package/dist/components/SelectButton/SelectButton.d.mts.map +1 -0
- package/dist/components/SelectButton/SelectButton.mjs +53 -0
- package/dist/components/SelectButton/SelectButton.mjs.map +1 -0
- package/dist/components/SelectButton/SelectButton.types.cjs +3 -0
- package/dist/components/SelectButton/SelectButton.types.cjs.map +1 -0
- package/dist/components/SelectButton/SelectButton.types.d.cts +13 -0
- package/dist/components/SelectButton/SelectButton.types.d.cts.map +1 -0
- package/dist/components/SelectButton/SelectButton.types.d.mts +13 -0
- package/dist/components/SelectButton/SelectButton.types.d.mts.map +1 -0
- package/dist/components/SelectButton/SelectButton.types.mjs +2 -0
- package/dist/components/SelectButton/SelectButton.types.mjs.map +1 -0
- package/dist/components/SelectButton/index.cjs +10 -0
- package/dist/components/SelectButton/index.cjs.map +1 -0
- package/dist/components/SelectButton/index.d.cts +4 -0
- package/dist/components/SelectButton/index.d.cts.map +1 -0
- package/dist/components/SelectButton/index.d.mts +4 -0
- package/dist/components/SelectButton/index.d.mts.map +1 -0
- package/dist/components/SelectButton/index.mjs +3 -0
- package/dist/components/SelectButton/index.mjs.map +1 -0
- package/dist/components/SensitiveText/SensitiveText.cjs +4 -4
- package/dist/components/SensitiveText/SensitiveText.cjs.map +1 -1
- package/dist/components/SensitiveText/SensitiveText.d.cts.map +1 -1
- package/dist/components/SensitiveText/SensitiveText.d.mts.map +1 -1
- package/dist/components/SensitiveText/SensitiveText.mjs +1 -1
- package/dist/components/SensitiveText/SensitiveText.mjs.map +1 -1
- package/dist/components/SensitiveText/SensitiveText.types.cjs.map +1 -1
- package/dist/components/SensitiveText/SensitiveText.types.d.cts +6 -34
- package/dist/components/SensitiveText/SensitiveText.types.d.cts.map +1 -1
- package/dist/components/SensitiveText/SensitiveText.types.d.mts +6 -34
- package/dist/components/SensitiveText/SensitiveText.types.d.mts.map +1 -1
- package/dist/components/SensitiveText/SensitiveText.types.mjs.map +1 -1
- package/dist/components/SensitiveText/index.cjs +3 -3
- package/dist/components/SensitiveText/index.cjs.map +1 -1
- package/dist/components/SensitiveText/index.d.cts +1 -1
- package/dist/components/SensitiveText/index.d.cts.map +1 -1
- package/dist/components/SensitiveText/index.d.mts +1 -1
- package/dist/components/SensitiveText/index.d.mts.map +1 -1
- package/dist/components/SensitiveText/index.mjs +1 -1
- package/dist/components/SensitiveText/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 +1 -1
- package/dist/components/TextArea/TextArea.cjs.map +1 -1
- package/dist/components/TextArea/TextArea.d.cts +20 -16
- package/dist/components/TextArea/TextArea.d.cts.map +1 -1
- package/dist/components/TextArea/TextArea.d.mts +20 -16
- package/dist/components/TextArea/TextArea.d.mts.map +1 -1
- package/dist/components/TextArea/TextArea.mjs +1 -1
- package/dist/components/TextArea/TextArea.mjs.map +1 -1
- package/dist/components/TextArea/TextArea.types.d.cts +1 -1
- package/dist/components/TextArea/TextArea.types.d.cts.map +1 -1
- package/dist/components/TextArea/TextArea.types.d.mts +1 -1
- package/dist/components/TextArea/TextArea.types.d.mts.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.cjs +54 -0
- package/dist/components/TitleAlert/TitleAlert.cjs.map +1 -0
- package/dist/components/TitleAlert/TitleAlert.d.cts +21 -0
- package/dist/components/TitleAlert/TitleAlert.d.cts.map +1 -0
- package/dist/components/TitleAlert/TitleAlert.d.mts +21 -0
- package/dist/components/TitleAlert/TitleAlert.d.mts.map +1 -0
- package/dist/components/TitleAlert/TitleAlert.mjs +54 -0
- package/dist/components/TitleAlert/TitleAlert.mjs.map +1 -0
- package/dist/components/TitleAlert/TitleAlert.types.cjs +3 -0
- package/dist/components/TitleAlert/TitleAlert.types.cjs.map +1 -0
- package/dist/components/TitleAlert/TitleAlert.types.d.cts +31 -0
- package/dist/components/TitleAlert/TitleAlert.types.d.cts.map +1 -0
- package/dist/components/TitleAlert/TitleAlert.types.d.mts +31 -0
- package/dist/components/TitleAlert/TitleAlert.types.d.mts.map +1 -0
- package/dist/components/TitleAlert/TitleAlert.types.mjs +2 -0
- package/dist/components/TitleAlert/TitleAlert.types.mjs.map +1 -0
- package/dist/components/TitleAlert/index.cjs +6 -0
- package/dist/components/TitleAlert/index.cjs.map +1 -0
- package/dist/components/TitleAlert/index.d.cts +3 -0
- package/dist/components/TitleAlert/index.d.cts.map +1 -0
- package/dist/components/TitleAlert/index.d.mts +3 -0
- package/dist/components/TitleAlert/index.d.mts.map +1 -0
- package/dist/components/TitleAlert/index.mjs +2 -0
- package/dist/components/TitleAlert/index.mjs.map +1 -0
- 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 +18 -2
- package/dist/components/index.cjs.map +1 -1
- package/dist/components/index.d.cts +12 -0
- package/dist/components/index.d.cts.map +1 -1
- package/dist/components/index.d.mts +12 -0
- package/dist/components/index.d.mts.map +1 -1
- package/dist/components/index.mjs +6 -0
- 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 +1 -1
- package/dist/components/temp-components/ButtonAnimated/ButtonAnimated.cjs.map +1 -1
- package/dist/components/temp-components/ButtonAnimated/ButtonAnimated.mjs +1 -1
- 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.d.cts +1 -2
- package/dist/components/temp-components/ImageOrSvg/ImageOrSvg.types.d.cts.map +1 -1
- package/dist/components/temp-components/ImageOrSvg/ImageOrSvg.types.d.mts +1 -2
- package/dist/components/temp-components/ImageOrSvg/ImageOrSvg.types.d.mts.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 +1 -1
- package/dist/components/temp-components/Spinner/Spinner.cjs.map +1 -1
- package/dist/components/temp-components/Spinner/Spinner.mjs +1 -1
- 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 +19 -20
- package/dist/components/SensitiveText/SensitiveText.constants.cjs +0 -14
- package/dist/components/SensitiveText/SensitiveText.constants.cjs.map +0 -1
- package/dist/components/SensitiveText/SensitiveText.constants.d.cts +0 -11
- package/dist/components/SensitiveText/SensitiveText.constants.d.cts.map +0 -1
- package/dist/components/SensitiveText/SensitiveText.constants.d.mts +0 -11
- package/dist/components/SensitiveText/SensitiveText.constants.d.mts.map +0 -1
- package/dist/components/SensitiveText/SensitiveText.constants.mjs +0 -11
- package/dist/components/SensitiveText/SensitiveText.constants.mjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BadgeStatus.mjs","sourceRoot":"","sources":["../../../src/components/BadgeStatus/BadgeStatus.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,eAAe,EAAE,gDAAgD;AAC1E,OAAO,EAAE,WAAW,EAAE,sDAAsD;AAC5E,OAAO,MAAK,cAAc;;AAC1B,OAAO,EAAE,IAAI,EAAE,
|
|
1
|
+
{"version":3,"file":"BadgeStatus.mjs","sourceRoot":"","sources":["../../../src/components/BadgeStatus/BadgeStatus.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,eAAe,EAAE,gDAAgD;AAC1E,OAAO,EAAE,WAAW,EAAE,sDAAsD;AAC5E,OAAO,MAAK,cAAc;;AAC1B,OAAO,EAAE,IAAI,EAAE,qBAAqB;AAEpC,OAAO,EACL,oCAAoC,EACpC,2BAA2B,EAC5B,oCAAgC;AAGjC,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,EAC1B,MAAM,EACN,IAAI,GAAG,eAAe,CAAC,EAAE,EACzB,SAAS,GAAG,IAAI,EAChB,WAAW,EACX,KAAK,EACL,GAAG,KAAK,EACS,EAAE,EAAE;IACrB,MAAM,EAAE,GAAG,WAAW,EAAE,CAAC;IAEzB,OAAO,CACL,CAAC,IAAI,CACH,IAAI,KAAK,CAAC,CACV,KAAK,CAAC,CAAC;YACL,EAAE,CAAC,KAAK,CACN,yBAAyB,EACzB,SAAS,IAAI,oCAAoC,EACjD,WAAW,CACZ;YACD,KAAK;SACN,CAAC,CAEF;MAAA,CAAC,IAAI,CACH,KAAK,CAAC,CAAC;YACL,EAAE,CAAC,KAAK,CACN,uBAAuB,EACvB,2BAA2B,CAAC,IAAI,CAAC,EACjC,oCAAoC,CAAC,MAAM,CAAC,CAC7C;SACF,CAAC,EAEN;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { BadgeStatusSize } from '@metamask-previews/design-system-shared';\nimport { useTailwind } from '@metamask-previews/design-system-twrnc-preset';\nimport React from 'react';\nimport { View } from 'react-native';\n\nimport {\n TWCLASSMAP_BADGESTATUS_STATUS_CIRCLE,\n TWCLASSMAP_BADGESTATUS_SIZE,\n} from './BadgeStatus.constants';\nimport type { BadgeStatusProps } from './BadgeStatus.types';\n\nexport const BadgeStatus = ({\n status,\n size = BadgeStatusSize.Md,\n hasBorder = true,\n twClassName,\n style,\n ...props\n}: BadgeStatusProps) => {\n const tw = useTailwind();\n\n return (\n <View\n {...props}\n style={[\n tw.style(\n 'self-start rounded-full',\n hasBorder && 'border-2 border-background-default',\n twClassName,\n ),\n style,\n ]}\n >\n <View\n style={[\n tw.style(\n 'rounded-full border-2',\n TWCLASSMAP_BADGESTATUS_SIZE[size],\n TWCLASSMAP_BADGESTATUS_STATUS_CIRCLE[status],\n ),\n ]}\n />\n </View>\n );\n};\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { BadgeStatusPropsShared } from "@metamask-previews/design-system-shared";
|
|
2
|
-
import type { ViewProps } from "react-native
|
|
2
|
+
import type { ViewProps } from "react-native";
|
|
3
3
|
/**
|
|
4
4
|
* BadgeStatus component props (React Native platform-specific)
|
|
5
5
|
* Extends shared props from @metamask-previews/design-system-shared with React Native specific platform concerns
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BadgeStatus.types.d.cts","sourceRoot":"","sources":["../../../src/components/BadgeStatus/BadgeStatus.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,gDAAgD;AACtF,OAAO,KAAK,EAAE,SAAS,EAAE,
|
|
1
|
+
{"version":3,"file":"BadgeStatus.types.d.cts","sourceRoot":"","sources":["../../../src/components/BadgeStatus/BadgeStatus.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,gDAAgD;AACtF,OAAO,KAAK,EAAE,SAAS,EAAE,qBAAqB;AAE9C;;;GAGG;AACH,MAAM,MAAM,gBAAgB,GAAG,sBAAsB,GACnD,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC,GAAG;IAC5B;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { BadgeStatusPropsShared } from "@metamask-previews/design-system-shared";
|
|
2
|
-
import type { ViewProps } from "react-native
|
|
2
|
+
import type { ViewProps } from "react-native";
|
|
3
3
|
/**
|
|
4
4
|
* BadgeStatus component props (React Native platform-specific)
|
|
5
5
|
* Extends shared props from @metamask-previews/design-system-shared with React Native specific platform concerns
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BadgeStatus.types.d.mts","sourceRoot":"","sources":["../../../src/components/BadgeStatus/BadgeStatus.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,gDAAgD;AACtF,OAAO,KAAK,EAAE,SAAS,EAAE,
|
|
1
|
+
{"version":3,"file":"BadgeStatus.types.d.mts","sourceRoot":"","sources":["../../../src/components/BadgeStatus/BadgeStatus.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,gDAAgD;AACtF,OAAO,KAAK,EAAE,SAAS,EAAE,qBAAqB;AAE9C;;;GAGG;AACH,MAAM,MAAM,gBAAgB,GAAG,sBAAsB,GACnD,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC,GAAG;IAC5B;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC"}
|
|
@@ -27,7 +27,7 @@ exports.BadgeWrapper = void 0;
|
|
|
27
27
|
const design_system_shared_1 = require("@metamask-previews/design-system-shared");
|
|
28
28
|
const design_system_twrnc_preset_1 = require("@metamask-previews/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 BadgeWrapper = ({ children, childrenContainerProps, badge, badgeContainerProps, position = design_system_shared_1.BadgeWrapperPosition.BottomRight, positionAnchorShape = design_system_shared_1.BadgeWrapperPositionAnchorShape.Circular, positionXOffset = 0, positionYOffset = 0, customPosition, twClassName, style, ...props }) => {
|
|
32
32
|
const tw = (0, design_system_twrnc_preset_1.useTailwind)();
|
|
33
33
|
const [anchorWidth, setAnchorWidth] = (0, react_1.useState)(0);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BadgeWrapper.cjs","sourceRoot":"","sources":["../../../src/components/BadgeWrapper/BadgeWrapper.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kFAGiD;AACjD,8FAA4E;AAC5E,+CAA8D;AAE9D
|
|
1
|
+
{"version":3,"file":"BadgeWrapper.cjs","sourceRoot":"","sources":["../../../src/components/BadgeWrapper/BadgeWrapper.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kFAGiD;AACjD,8FAA4E;AAC5E,+CAA8D;AAE9D,+CAAoC;AAI7B,MAAM,YAAY,GAAG,CAAC,EAC3B,QAAQ,EACR,sBAAsB,EACtB,KAAK,EACL,mBAAmB,EACnB,QAAQ,GAAG,2CAAoB,CAAC,WAAW,EAC3C,mBAAmB,GAAG,sDAA+B,CAAC,QAAQ,EAC9D,eAAe,GAAG,CAAC,EACnB,eAAe,GAAG,CAAC,EACnB,cAAc,EACd,WAAW,EACX,KAAK,EACL,GAAG,KAAK,EACU,EAAE,EAAE;IACtB,MAAM,EAAE,GAAG,IAAA,wCAAW,GAAE,CAAC;IACzB,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAA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,CAAC,CACvB,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,UAAU,CAAC,EAAE,EAAE,GAAG,cAAc,EAAE,CAAC,CAAC,CACrD,IAAI,mBAAmB,CAAC,CAExB;QAAA,CAAC,KAAK,CACR;MAAA,EAAE,mBAAI,CACR;IAAA,EAAE,mBAAI,CAAC,CACR,CAAC;AACJ,CAAC,CAAC;AA3GW,QAAA,YAAY,gBA2GvB","sourcesContent":["import {\n BadgeWrapperPosition,\n BadgeWrapperPositionAnchorShape,\n} from '@metamask-previews/design-system-shared';\nimport { useTailwind } from '@metamask-previews/design-system-twrnc-preset';\nimport React, { useCallback, useState, useMemo } from 'react';\nimport type { LayoutChangeEvent } from 'react-native';\nimport { View } from 'react-native';\n\nimport type { BadgeWrapperProps } from './BadgeWrapper.types';\n\nexport const BadgeWrapper = ({\n children,\n childrenContainerProps,\n badge,\n badgeContainerProps,\n position = BadgeWrapperPosition.BottomRight,\n positionAnchorShape = BadgeWrapperPositionAnchorShape.Circular,\n positionXOffset = 0,\n positionYOffset = 0,\n customPosition,\n twClassName,\n style,\n ...props\n}: BadgeWrapperProps) => {\n const tw = useTailwind();\n const [anchorWidth, setAnchorWidth] = useState<number>(0);\n const [anchorHeight, setAnchorHeight] = useState<number>(0);\n const [badgeWidth, setbadgeWidth] = useState<number>(0);\n const [badgeHeight, setbadgeHeight] = useState<number>(0);\n\n // Fetching the dimensions of the anchor and bagde element to properly position the badge\n const getAnchorSize = useCallback((event: LayoutChangeEvent) => {\n const { width, height } = event.nativeEvent.layout;\n setAnchorWidth(width);\n setAnchorHeight(height);\n }, []);\n const getBadgeSize = useCallback((event: LayoutChangeEvent) => {\n const { width, height } = event.nativeEvent.layout;\n setbadgeWidth(width);\n setbadgeHeight(height);\n }, []);\n\n const finalPositions = useMemo(() => {\n if (customPosition) {\n return customPosition;\n }\n // 0.1464 is a mathematical coeeficient to move\n // from a 0,0 corner of a rectangular shape to the closest \"corner\"\n // of a circular shape anchor element\n const anchorShapeXOffset =\n positionAnchorShape === BadgeWrapperPositionAnchorShape.Rectangular\n ? 0\n : anchorWidth * 0.1464;\n const anchorShapeYOffset =\n positionAnchorShape === BadgeWrapperPositionAnchorShape.Rectangular\n ? 0\n : anchorHeight * 0.1464;\n // This is to center the badge in the corner of the anchor element\n const badgeCenteringXOffset = badgeWidth / 2;\n const badgeCenteringYOffset = badgeHeight / 2;\n\n const finalXOffset =\n anchorShapeXOffset - badgeCenteringXOffset + positionXOffset;\n const finalYOffset =\n anchorShapeYOffset - badgeCenteringYOffset + positionYOffset;\n switch (position) {\n case BadgeWrapperPosition.TopRight:\n return {\n top: finalYOffset,\n right: finalXOffset,\n };\n case BadgeWrapperPosition.BottomLeft:\n return {\n bottom: finalYOffset,\n left: finalXOffset,\n };\n case BadgeWrapperPosition.TopLeft:\n return {\n top: finalYOffset,\n left: finalXOffset,\n };\n case BadgeWrapperPosition.BottomRight:\n default:\n return {\n bottom: finalYOffset,\n right: finalXOffset,\n };\n }\n }, [\n position,\n positionAnchorShape,\n anchorWidth,\n anchorHeight,\n badgeWidth,\n badgeHeight,\n positionXOffset,\n positionYOffset,\n customPosition,\n ]);\n\n return (\n <View\n {...props}\n style={[tw.style('relative self-start', twClassName), style]}\n >\n <View onLayout={getAnchorSize} {...childrenContainerProps}>\n {children}\n </View>\n <View\n onLayout={getBadgeSize}\n style={[tw.style('absolute'), { ...finalPositions }]}\n {...badgeContainerProps}\n >\n {badge}\n </View>\n </View>\n );\n};\n"]}
|
|
@@ -8,7 +8,7 @@ import { BadgeWrapperPosition, BadgeWrapperPositionAnchorShape } from "@metamask
|
|
|
8
8
|
import { useTailwind } from "@metamask-previews/design-system-twrnc-preset";
|
|
9
9
|
import $React, { useCallback, useState, useMemo } from "react";
|
|
10
10
|
const React = $importDefault($React);
|
|
11
|
-
import { View } from "react-native
|
|
11
|
+
import { View } from "react-native";
|
|
12
12
|
export const BadgeWrapper = ({ children, childrenContainerProps, badge, badgeContainerProps, position = BadgeWrapperPosition.BottomRight, positionAnchorShape = BadgeWrapperPositionAnchorShape.Circular, positionXOffset = 0, positionYOffset = 0, customPosition, twClassName, style, ...props }) => {
|
|
13
13
|
const tw = useTailwind();
|
|
14
14
|
const [anchorWidth, setAnchorWidth] = useState(0);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BadgeWrapper.mjs","sourceRoot":"","sources":["../../../src/components/BadgeWrapper/BadgeWrapper.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,EACL,oBAAoB,EACpB,+BAA+B,EAChC,gDAAgD;AACjD,OAAO,EAAE,WAAW,EAAE,sDAAsD;AAC5E,OAAO,QAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,OAAO,EAAE,cAAc;;AAE9D,OAAO,EAAE,IAAI,EAAE,
|
|
1
|
+
{"version":3,"file":"BadgeWrapper.mjs","sourceRoot":"","sources":["../../../src/components/BadgeWrapper/BadgeWrapper.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,EACL,oBAAoB,EACpB,+BAA+B,EAChC,gDAAgD;AACjD,OAAO,EAAE,WAAW,EAAE,sDAAsD;AAC5E,OAAO,QAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,OAAO,EAAE,cAAc;;AAE9D,OAAO,EAAE,IAAI,EAAE,qBAAqB;AAIpC,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,EAC3B,QAAQ,EACR,sBAAsB,EACtB,KAAK,EACL,mBAAmB,EACnB,QAAQ,GAAG,oBAAoB,CAAC,WAAW,EAC3C,mBAAmB,GAAG,+BAA+B,CAAC,QAAQ,EAC9D,eAAe,GAAG,CAAC,EACnB,eAAe,GAAG,CAAC,EACnB,cAAc,EACd,WAAW,EACX,KAAK,EACL,GAAG,KAAK,EACU,EAAE,EAAE;IACtB,MAAM,EAAE,GAAG,WAAW,EAAE,CAAC;IACzB,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,QAAQ,CAAS,CAAC,CAAC,CAAC;IAC1D,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c,EAAE,CAAC,CAAC,CACrD,IAAI,mBAAmB,CAAC,CAExB;QAAA,CAAC,KAAK,CACR;MAAA,EAAE,IAAI,CACR;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import {\n BadgeWrapperPosition,\n BadgeWrapperPositionAnchorShape,\n} from '@metamask-previews/design-system-shared';\nimport { useTailwind } from '@metamask-previews/design-system-twrnc-preset';\nimport React, { useCallback, useState, useMemo } from 'react';\nimport type { LayoutChangeEvent } from 'react-native';\nimport { View } from 'react-native';\n\nimport type { BadgeWrapperProps } from './BadgeWrapper.types';\n\nexport const BadgeWrapper = ({\n children,\n childrenContainerProps,\n badge,\n badgeContainerProps,\n position = BadgeWrapperPosition.BottomRight,\n positionAnchorShape = BadgeWrapperPositionAnchorShape.Circular,\n positionXOffset = 0,\n positionYOffset = 0,\n customPosition,\n twClassName,\n style,\n ...props\n}: BadgeWrapperProps) => {\n const tw = useTailwind();\n const [anchorWidth, setAnchorWidth] = useState<number>(0);\n const [anchorHeight, setAnchorHeight] = useState<number>(0);\n const [badgeWidth, setbadgeWidth] = useState<number>(0);\n const [badgeHeight, setbadgeHeight] = useState<number>(0);\n\n // Fetching the dimensions of the anchor and bagde element to properly position the badge\n const getAnchorSize = useCallback((event: LayoutChangeEvent) => {\n const { width, height } = event.nativeEvent.layout;\n setAnchorWidth(width);\n setAnchorHeight(height);\n }, []);\n const getBadgeSize = useCallback((event: LayoutChangeEvent) => {\n const { width, height } = event.nativeEvent.layout;\n setbadgeWidth(width);\n setbadgeHeight(height);\n }, []);\n\n const finalPositions = useMemo(() => {\n if (customPosition) {\n return customPosition;\n }\n // 0.1464 is a mathematical coeeficient to move\n // from a 0,0 corner of a rectangular shape to the closest \"corner\"\n // of a circular shape anchor element\n const anchorShapeXOffset =\n positionAnchorShape === BadgeWrapperPositionAnchorShape.Rectangular\n ? 0\n : anchorWidth * 0.1464;\n const anchorShapeYOffset =\n positionAnchorShape === BadgeWrapperPositionAnchorShape.Rectangular\n ? 0\n : anchorHeight * 0.1464;\n // This is to center the badge in the corner of the anchor element\n const badgeCenteringXOffset = badgeWidth / 2;\n const badgeCenteringYOffset = badgeHeight / 2;\n\n const finalXOffset =\n anchorShapeXOffset - badgeCenteringXOffset + positionXOffset;\n const finalYOffset =\n anchorShapeYOffset - badgeCenteringYOffset + positionYOffset;\n switch (position) {\n case BadgeWrapperPosition.TopRight:\n return {\n top: finalYOffset,\n right: finalXOffset,\n };\n case BadgeWrapperPosition.BottomLeft:\n return {\n bottom: finalYOffset,\n left: finalXOffset,\n };\n case BadgeWrapperPosition.TopLeft:\n return {\n top: finalYOffset,\n left: finalXOffset,\n };\n case BadgeWrapperPosition.BottomRight:\n default:\n return {\n bottom: finalYOffset,\n right: finalXOffset,\n };\n }\n }, [\n position,\n positionAnchorShape,\n anchorWidth,\n anchorHeight,\n badgeWidth,\n badgeHeight,\n positionXOffset,\n positionYOffset,\n customPosition,\n ]);\n\n return (\n <View\n {...props}\n style={[tw.style('relative self-start', twClassName), style]}\n >\n <View onLayout={getAnchorSize} {...childrenContainerProps}>\n {children}\n </View>\n <View\n onLayout={getBadgeSize}\n style={[tw.style('absolute'), { ...finalPositions }]}\n {...badgeContainerProps}\n >\n {badge}\n </View>\n </View>\n );\n};\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { BadgeWrapperPropsShared } from "@metamask-previews/design-system-shared";
|
|
2
|
-
import type { ViewProps, StyleProp, ViewStyle } from "react-native
|
|
2
|
+
import type { ViewProps, StyleProp, ViewStyle } from "react-native";
|
|
3
3
|
/**
|
|
4
4
|
* BadgeWrapper component props (React Native platform-specific)
|
|
5
5
|
* Extends shared props from @metamask-previews/design-system-shared with React Native-specific platform concerns
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BadgeWrapper.types.d.cts","sourceRoot":"","sources":["../../../src/components/BadgeWrapper/BadgeWrapper.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,gDAAgD;AACvF,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,
|
|
1
|
+
{"version":3,"file":"BadgeWrapper.types.d.cts","sourceRoot":"","sources":["../../../src/components/BadgeWrapper/BadgeWrapper.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,gDAAgD;AACvF,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,qBAAqB;AAEpE;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GAAG,uBAAuB,GAAG;IACxD;;OAEG;IACH,sBAAsB,CAAC,EAAE,SAAS,CAAC;IACnC;;OAEG;IACH,mBAAmB,CAAC,EAAE,SAAS,CAAC;IAChC;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B,GAAG,SAAS,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { BadgeWrapperPropsShared } from "@metamask-previews/design-system-shared";
|
|
2
|
-
import type { ViewProps, StyleProp, ViewStyle } from "react-native
|
|
2
|
+
import type { ViewProps, StyleProp, ViewStyle } from "react-native";
|
|
3
3
|
/**
|
|
4
4
|
* BadgeWrapper component props (React Native platform-specific)
|
|
5
5
|
* Extends shared props from @metamask-previews/design-system-shared with React Native-specific platform concerns
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BadgeWrapper.types.d.mts","sourceRoot":"","sources":["../../../src/components/BadgeWrapper/BadgeWrapper.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,gDAAgD;AACvF,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,
|
|
1
|
+
{"version":3,"file":"BadgeWrapper.types.d.mts","sourceRoot":"","sources":["../../../src/components/BadgeWrapper/BadgeWrapper.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,gDAAgD;AACvF,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,qBAAqB;AAEpE;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GAAG,uBAAuB,GAAG;IACxD;;OAEG;IACH,sBAAsB,CAAC,EAAE,SAAS,CAAC;IACnC;;OAEG;IACH,mBAAmB,CAAC,EAAE,SAAS,CAAC;IAChC;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B,GAAG,SAAS,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { BannerBasePropsShared } from "@metamask-previews/design-system-shared";
|
|
2
|
-
import type { GestureResponderEvent } from "react-native
|
|
2
|
+
import type { GestureResponderEvent } from "react-native";
|
|
3
3
|
import type { BoxProps } from "../Box/index.cjs";
|
|
4
4
|
import type { ButtonProps } from "../Button/index.cjs";
|
|
5
5
|
import type { ButtonIconProps } from "../ButtonIcon/index.cjs";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BannerBase.types.d.cts","sourceRoot":"","sources":["../../../src/components/BannerBase/BannerBase.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,gDAAgD;AACrF,OAAO,KAAK,EAAE,qBAAqB,EAAE,
|
|
1
|
+
{"version":3,"file":"BannerBase.types.d.cts","sourceRoot":"","sources":["../../../src/components/BannerBase/BannerBase.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,gDAAgD;AACrF,OAAO,KAAK,EAAE,qBAAqB,EAAE,qBAAqB;AAE1D,OAAO,KAAK,EAAE,QAAQ,EAAE,yBAAe;AACvC,OAAO,KAAK,EAAE,WAAW,EAAE,4BAAkB;AAC7C,OAAO,KAAK,EAAE,eAAe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5 @@
|
|
|
1
1
|
import type { BannerBasePropsShared } from "@metamask-previews/design-system-shared";
|
|
2
|
-
import type { GestureResponderEvent } from "react-native
|
|
2
|
+
import type { GestureResponderEvent } from "react-native";
|
|
3
3
|
import type { BoxProps } from "../Box/index.mjs";
|
|
4
4
|
import type { ButtonProps } from "../Button/index.mjs";
|
|
5
5
|
import type { ButtonIconProps } from "../ButtonIcon/index.mjs";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BannerBase.types.d.mts","sourceRoot":"","sources":["../../../src/components/BannerBase/BannerBase.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,gDAAgD;AACrF,OAAO,KAAK,EAAE,qBAAqB,EAAE,
|
|
1
|
+
{"version":3,"file":"BannerBase.types.d.mts","sourceRoot":"","sources":["../../../src/components/BannerBase/BannerBase.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,gDAAgD;AACrF,OAAO,KAAK,EAAE,qBAAqB,EAAE,qBAAqB;AAE1D,OAAO,KAAK,EAAE,QAAQ,EAAE,yBAAe;AACvC,OAAO,KAAK,EAAE,WAAW,EAAE,4BAAkB;AAC7C,OAAO,KAAK,EAAE,eAAe,EAAE,gCAAsB;AACrD,OAAO,KAAK,EAAE,SAAS,EAAE,0BAAgB;AAEzC,KAAK,2BAA2B,GAAG,IAAI,CACrC,OAAO,CAAC,WAAW,CAAC,EACpB,UAAU,GAAG,SAAS,GAAG,SAAS,CACnC,CAAC;AAEF,KAAK,0BAA0B,GAAG,IAAI,CACpC,OAAO,CAAC,eAAe,CAAC,EACxB,UAAU,GAAG,SAAS,CACvB,CAAC;AAEF,KAAK,mBAAmB,GAAG,qBAAqB,GAC9C,IAAI,CAAC,QAAQ,EAAE,UAAU,CAAC,GAAG;IAC3B;;OAEG;IACH,UAAU,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,UAAU,CAAC,CAAC;IAClD;;OAEG;IACH,gBAAgB,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,UAAU,CAAC,CAAC;IACxD;;OAEG;IACH,oBAAoB,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,UAAU,CAAC,CAAC;IAC5D;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,0BAA0B,CAAC;CAC/C,CAAC;AAEJ,KAAK,gCAAgC,GAAG;IACtC,mBAAmB,EAAE,CAAC,KAAK,EAAE,qBAAqB,KAAK,IAAI,CAAC;IAC5D,iBAAiB,EAAE,MAAM,CAAC;IAC1B,iBAAiB,CAAC,EAAE,2BAA2B,CAAC;CACjD,CAAC;AAEF,KAAK,mCAAmC,GAAG;IACzC,mBAAmB,CAAC,EAAE,SAAS,CAAC;IAChC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,iBAAiB,CAAC,EAAE,2BAA2B,CAAC;CACjD,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,mBAAmB,GAC/C,CAAC,gCAAgC,GAAG,mCAAmC,CAAC,CAAC"}
|
|
@@ -26,15 +26,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
26
26
|
exports.BottomSheet = void 0;
|
|
27
27
|
const design_system_twrnc_preset_1 = require("@metamask-previews/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 react_native_safe_area_context_1 = require("react-native-safe-area-context");
|
|
31
31
|
const BottomSheetDialog_1 = require("../BottomSheetDialog/index.cjs");
|
|
32
32
|
const BottomSheetOverlay_1 = require("../BottomSheetOverlay/BottomSheetOverlay.cjs");
|
|
33
|
-
exports.BottomSheet = (0, react_1.forwardRef)(({ children, onClose, onOpen, goBack, style, twClassName, isInteractable = true, isFullscreen = false, keyboardAvoidingViewEnabled = true,
|
|
33
|
+
exports.BottomSheet = (0, react_1.forwardRef)(({ children, onClose, onOpen, goBack, style, twClassName, isInteractable = true, isFullscreen = false, keyboardAvoidingViewEnabled = true, ...props }, ref) => {
|
|
34
34
|
const tw = (0, design_system_twrnc_preset_1.useTailwind)();
|
|
35
35
|
const { bottom: screenBottomPadding } = (0, react_native_safe_area_context_1.useSafeAreaInsets)();
|
|
36
36
|
const { y: frameY } = (0, react_native_safe_area_context_1.useSafeAreaFrame)();
|
|
37
|
-
const postCallback = (0, react_1.useRef)();
|
|
37
|
+
const postCallback = (0, react_1.useRef)(undefined);
|
|
38
38
|
const bottomSheetDialogRef = (0, react_1.useRef)(null);
|
|
39
39
|
const didNavigateBackRef = (0, react_1.useRef)(false);
|
|
40
40
|
const closeRequestedRef = (0, react_1.useRef)(false);
|
|
@@ -71,9 +71,9 @@ exports.BottomSheet = (0, react_1.forwardRef)(({ children, onClose, onOpen, goBa
|
|
|
71
71
|
}
|
|
72
72
|
return true;
|
|
73
73
|
};
|
|
74
|
-
react_native_1.BackHandler.addEventListener('hardwareBackPress', hardwareBackPress);
|
|
74
|
+
const subscription = react_native_1.BackHandler.addEventListener('hardwareBackPress', hardwareBackPress);
|
|
75
75
|
return () => {
|
|
76
|
-
|
|
76
|
+
subscription.remove();
|
|
77
77
|
};
|
|
78
78
|
}, [isInteractable]);
|
|
79
79
|
(0, react_1.useImperativeHandle)(ref, () => ({
|
|
@@ -97,7 +97,7 @@ exports.BottomSheet = (0, react_1.forwardRef)(({ children, onClose, onOpen, goBa
|
|
|
97
97
|
<BottomSheetOverlay_1.BottomSheetOverlay onPress={isInteractable
|
|
98
98
|
? () => bottomSheetDialogRef.current?.onCloseDialog()
|
|
99
99
|
: undefined}/>
|
|
100
|
-
<BottomSheetDialog_1.BottomSheetDialog isInteractable={isInteractable} onClose={onCloseCB} onOpen={onOpenCB} ref={bottomSheetDialogRef} isFullscreen={isFullscreen} twClassName={twClassName} keyboardAvoidingViewEnabled={keyboardAvoidingViewEnabled}
|
|
100
|
+
<BottomSheetDialog_1.BottomSheetDialog isInteractable={isInteractable} onClose={onCloseCB} onOpen={onOpenCB} ref={bottomSheetDialogRef} isFullscreen={isFullscreen} twClassName={twClassName} keyboardAvoidingViewEnabled={keyboardAvoidingViewEnabled}>
|
|
101
101
|
{children}
|
|
102
102
|
</BottomSheetDialog_1.BottomSheetDialog>
|
|
103
103
|
</react_native_1.KeyboardAvoidingView>);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BottomSheet.cjs","sourceRoot":"","sources":["../../../src/components/BottomSheet/BottomSheet.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,8FAA4E;AAC5E,+CAMe;AACf
|
|
1
|
+
{"version":3,"file":"BottomSheet.cjs","sourceRoot":"","sources":["../../../src/components/BottomSheet/BottomSheet.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,8FAA4E;AAC5E,+CAMe;AACf,+CAA2E;AAC3E,mFAGwC;AAExC,sEAAyD;AAEzD,qFAA8E;AAQjE,QAAA,WAAW,GAAG,IAAA,kBAAU,EACnC,CACE,EACE,QAAQ,EACR,OAAO,EACP,MAAM,EACN,MAAM,EACN,KAAK,EACL,WAAW,EACX,cAAc,GAAG,IAAI,EACrB,YAAY,GAAG,KAAK,EACpB,2BAA2B,GAAG,IAAI,EAClC,GAAG,KAAK,EACT,EACD,GAAG,EACH,EAAE;IACF,MAAM,EAAE,GAAG,IAAA,wCAAW,GAAE,CAAC;IACzB,MAAM,EAAE,MAAM,EAAE,mBAAmB,EAAE,GAAG,IAAA,kDAAiB,GAAE,CAAC;IAC5D,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,GAAG,IAAA,iDAAgB,GAAE,CAAC;IACzC,MAAM,YAAY,GAAG,IAAA,cAAM,EAAsC,SAAS,CAAC,CAAC;IAC5E,MAAM,oBAAoB,GAAG,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AAC,CACrB,uBAAQ,CAAC,EAAE,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,MAAM,CACtD,CACD,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,8BAA8B,CAAC,EAAE,KAAK,CAAC,CAAC,CACzD,OAAO,CAAC,CAAC,2BAA2B,CAAC,CACrC,IAAI,KAAK,CAAC,CAEV;QAAA,CAAC,uCAAkB,CACjB,OAAO,CAAC,CACN,cAAc;YACZ,CAAC,CAAC,GAAG,EAAE,CAAC,oBAAoB,CAAC,OAAO,EAAE,aAAa,EAAE;YACrD,CAAC,CAAC,SAAS,CACd,EAEH;QAAA,CAAC,qCAAiB,CAChB,cAAc,CAAC,CAAC,cAAc,CAAC,CAC/B,OAAO,CAAC,CAAC,SAAS,CAAC,CACnB,MAAM,CAAC,CAAC,QAAQ,CAAC,CACjB,GAAG,CAAC,CAAC,oBAAoB,CAAC,CAC1B,YAAY,CAAC,CAAC,YAAY,CAAC,CAC3B,WAAW,CAAC,CAAC,WAAW,CAAC,CACzB,2BAA2B,CAAC,CAAC,2BAA2B,CAAC,CAEzD;UAAA,CAAC,QAAQ,CACX;QAAA,EAAE,qCAAiB,CACrB;MAAA,EAAE,mCAAoB,CAAC,CACxB,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,mBAAW,CAAC,WAAW,GAAG,aAAa,CAAC","sourcesContent":["import { useTailwind } from '@metamask-previews/design-system-twrnc-preset';\nimport React, {\n forwardRef,\n useCallback,\n useEffect,\n useImperativeHandle,\n useRef,\n} from 'react';\nimport { BackHandler, KeyboardAvoidingView, Platform } from 'react-native';\nimport {\n useSafeAreaFrame,\n useSafeAreaInsets,\n} from 'react-native-safe-area-context';\n\nimport { BottomSheetDialog } from '../BottomSheetDialog';\nimport type { BottomSheetDialogRef } from '../BottomSheetDialog';\nimport { BottomSheetOverlay } from '../BottomSheetOverlay/BottomSheetOverlay';\n\nimport type {\n BottomSheetPostCallback,\n BottomSheetProps,\n BottomSheetRef,\n} from './BottomSheet.types';\n\nexport const BottomSheet = forwardRef<BottomSheetRef, BottomSheetProps>(\n (\n {\n children,\n onClose,\n onOpen,\n goBack,\n style,\n twClassName,\n isInteractable = true,\n isFullscreen = false,\n keyboardAvoidingViewEnabled = true,\n ...props\n },\n ref,\n ) => {\n const tw = useTailwind();\n const { bottom: screenBottomPadding } = useSafeAreaInsets();\n const { y: frameY } = useSafeAreaFrame();\n const postCallback = useRef<BottomSheetPostCallback | undefined>(undefined);\n const bottomSheetDialogRef = useRef<BottomSheetDialogRef>(null);\n const didNavigateBackRef = useRef(false);\n const closeRequestedRef = useRef(false);\n const didRunPostCallbackRef = useRef(false);\n\n const onOpenCB = useCallback(() => {\n // Reset when the sheet is opened again.\n didNavigateBackRef.current = false;\n closeRequestedRef.current = false;\n didRunPostCallbackRef.current = false;\n\n onOpen?.(Boolean(postCallback.current));\n const callback = postCallback.current;\n postCallback.current = undefined;\n callback?.();\n }, [onOpen]);\n\n const onCloseCB = useCallback(() => {\n if (goBack && !didNavigateBackRef.current) {\n didNavigateBackRef.current = true;\n goBack?.();\n }\n\n const callback = postCallback.current;\n const hasCallback = Boolean(callback);\n\n onClose?.(hasCallback);\n\n if (!didRunPostCallbackRef.current && hasCallback) {\n didRunPostCallbackRef.current = true;\n postCallback.current = undefined;\n callback?.();\n }\n }, [goBack, onClose]);\n\n // Dismiss the sheet when Android back button is pressed.\n useEffect(() => {\n const hardwareBackPress = () => {\n if (isInteractable) {\n bottomSheetDialogRef.current?.onCloseDialog();\n }\n return true;\n };\n const subscription = BackHandler.addEventListener(\n 'hardwareBackPress',\n hardwareBackPress,\n );\n return () => {\n subscription.remove();\n };\n }, [isInteractable]);\n\n useImperativeHandle(ref, () => ({\n onCloseBottomSheet: (callback) => {\n if (closeRequestedRef.current) {\n return;\n }\n closeRequestedRef.current = true;\n postCallback.current = callback;\n bottomSheetDialogRef.current?.onCloseDialog();\n },\n onOpenBottomSheet: (callback) => {\n didNavigateBackRef.current = false;\n closeRequestedRef.current = false;\n didRunPostCallbackRef.current = false;\n postCallback.current = callback;\n bottomSheetDialogRef.current?.onOpenDialog();\n },\n }));\n\n return (\n <KeyboardAvoidingView\n behavior={Platform.OS === 'ios' ? 'padding' : undefined}\n keyboardVerticalOffset={\n Platform.OS === 'ios' ? -screenBottomPadding : frameY\n }\n style={[tw.style('absolute inset-0 justify-end'), style]}\n enabled={keyboardAvoidingViewEnabled}\n {...props}\n >\n <BottomSheetOverlay\n onPress={\n isInteractable\n ? () => bottomSheetDialogRef.current?.onCloseDialog()\n : undefined\n }\n />\n <BottomSheetDialog\n isInteractable={isInteractable}\n onClose={onCloseCB}\n onOpen={onOpenCB}\n ref={bottomSheetDialogRef}\n isFullscreen={isFullscreen}\n twClassName={twClassName}\n keyboardAvoidingViewEnabled={keyboardAvoidingViewEnabled}\n >\n {children}\n </BottomSheetDialog>\n </KeyboardAvoidingView>\n );\n },\n);\n\nBottomSheet.displayName = 'BottomSheet';\n"]}
|
|
@@ -10,41 +10,6 @@ export declare const BottomSheet: React.ForwardRefExoticComponent<{
|
|
|
10
10
|
keyboardAvoidingViewEnabled?: boolean | undefined;
|
|
11
11
|
onClose?: ((hasPendingAction?: boolean | undefined) => void) | undefined;
|
|
12
12
|
onOpen?: ((hasPendingAction?: boolean | undefined) => void) | undefined;
|
|
13
|
-
panGestureHandlerProps?: {
|
|
14
|
-
children?: React.ReactNode;
|
|
15
|
-
hitSlop?: import("react-native-gesture-handler/lib/typescript/handlers/gestureHandlerCommon").HitSlop;
|
|
16
|
-
id?: string | undefined;
|
|
17
|
-
testID?: string | undefined;
|
|
18
|
-
activeOffsetY?: number | [activeOffsetYStart: number, activeOffsetYEnd: number] | undefined;
|
|
19
|
-
activeOffsetX?: number | [activeOffsetXStart: number, activeOffsetXEnd: number] | undefined;
|
|
20
|
-
failOffsetY?: number | [failOffsetYStart: number, failOffsetYEnd: number] | undefined;
|
|
21
|
-
failOffsetX?: number | [failOffsetXStart: number, failOffsetXEnd: number] | undefined;
|
|
22
|
-
shouldCancelWhenOutside?: boolean | undefined;
|
|
23
|
-
userSelect?: import("react-native-gesture-handler/lib/typescript/handlers/gestureHandlerCommon").UserSelect | undefined;
|
|
24
|
-
activeCursor?: import("react-native-gesture-handler/lib/typescript/handlers/gestureHandlerCommon").ActiveCursor | undefined;
|
|
25
|
-
mouseButton?: import("react-native-gesture-handler").MouseButton | undefined;
|
|
26
|
-
enableContextMenu?: boolean | undefined;
|
|
27
|
-
touchAction?: import("react-native-gesture-handler/lib/typescript/handlers/gestureHandlerCommon").TouchAction | undefined;
|
|
28
|
-
waitFor?: React.Ref<unknown> | React.Ref<unknown>[] | undefined;
|
|
29
|
-
simultaneousHandlers?: React.Ref<unknown> | React.Ref<unknown>[] | undefined;
|
|
30
|
-
blocksHandlers?: React.Ref<unknown> | React.Ref<unknown>[] | undefined;
|
|
31
|
-
cancelsTouchesInView?: boolean | undefined;
|
|
32
|
-
onBegan?: ((event: import("react-native-gesture-handler").HandlerStateChangeEvent<Record<string, unknown>>) => void) | undefined;
|
|
33
|
-
onFailed?: ((event: import("react-native-gesture-handler").HandlerStateChangeEvent<Record<string, unknown>>) => void) | undefined;
|
|
34
|
-
onCancelled?: ((event: import("react-native-gesture-handler").HandlerStateChangeEvent<Record<string, unknown>>) => void) | undefined;
|
|
35
|
-
onActivated?: ((event: import("react-native-gesture-handler").HandlerStateChangeEvent<Record<string, unknown>>) => void) | undefined;
|
|
36
|
-
onEnded?: ((event: import("react-native-gesture-handler").HandlerStateChangeEvent<Record<string, unknown>>) => void) | undefined;
|
|
37
|
-
onHandlerStateChange?: ((event: import("react-native-gesture-handler").HandlerStateChangeEvent<import("react-native-gesture-handler").PanGestureHandlerEventPayload>) => void) | undefined;
|
|
38
|
-
minDist?: number | undefined;
|
|
39
|
-
avgTouches?: boolean | undefined;
|
|
40
|
-
enableTrackpadTwoFingerGesture?: boolean | undefined;
|
|
41
|
-
minPointers?: number | undefined;
|
|
42
|
-
maxPointers?: number | undefined;
|
|
43
|
-
minVelocity?: number | undefined;
|
|
44
|
-
minVelocityX?: number | undefined;
|
|
45
|
-
minVelocityY?: number | undefined;
|
|
46
|
-
activateAfterLongPress?: number | undefined;
|
|
47
|
-
} | undefined;
|
|
48
13
|
twClassName?: string | undefined;
|
|
49
14
|
} & import("react-native").ViewProps & React.RefAttributes<BottomSheetRef>>;
|
|
50
15
|
//# sourceMappingURL=BottomSheet.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BottomSheet.d.cts","sourceRoot":"","sources":["../../../src/components/BottomSheet/BottomSheet.tsx"],"names":[],"mappings":"AACA,OAAO,KAMN,cAAc;AAWf,OAAO,KAAK,EAGV,cAAc,EACf,gCAA4B;AAE7B,eAAO,MAAM,WAAW
|
|
1
|
+
{"version":3,"file":"BottomSheet.d.cts","sourceRoot":"","sources":["../../../src/components/BottomSheet/BottomSheet.tsx"],"names":[],"mappings":"AACA,OAAO,KAMN,cAAc;AAWf,OAAO,KAAK,EAGV,cAAc,EACf,gCAA4B;AAE7B,eAAO,MAAM,WAAW;;;;;;;;;;;2EAyHvB,CAAC"}
|
|
@@ -10,41 +10,6 @@ export declare const BottomSheet: React.ForwardRefExoticComponent<{
|
|
|
10
10
|
keyboardAvoidingViewEnabled?: boolean | undefined;
|
|
11
11
|
onClose?: ((hasPendingAction?: boolean | undefined) => void) | undefined;
|
|
12
12
|
onOpen?: ((hasPendingAction?: boolean | undefined) => void) | undefined;
|
|
13
|
-
panGestureHandlerProps?: {
|
|
14
|
-
children?: React.ReactNode;
|
|
15
|
-
hitSlop?: import("react-native-gesture-handler/lib/typescript/handlers/gestureHandlerCommon").HitSlop;
|
|
16
|
-
id?: string | undefined;
|
|
17
|
-
testID?: string | undefined;
|
|
18
|
-
activeOffsetY?: number | [activeOffsetYStart: number, activeOffsetYEnd: number] | undefined;
|
|
19
|
-
activeOffsetX?: number | [activeOffsetXStart: number, activeOffsetXEnd: number] | undefined;
|
|
20
|
-
failOffsetY?: number | [failOffsetYStart: number, failOffsetYEnd: number] | undefined;
|
|
21
|
-
failOffsetX?: number | [failOffsetXStart: number, failOffsetXEnd: number] | undefined;
|
|
22
|
-
shouldCancelWhenOutside?: boolean | undefined;
|
|
23
|
-
userSelect?: import("react-native-gesture-handler/lib/typescript/handlers/gestureHandlerCommon").UserSelect | undefined;
|
|
24
|
-
activeCursor?: import("react-native-gesture-handler/lib/typescript/handlers/gestureHandlerCommon").ActiveCursor | undefined;
|
|
25
|
-
mouseButton?: import("react-native-gesture-handler").MouseButton | undefined;
|
|
26
|
-
enableContextMenu?: boolean | undefined;
|
|
27
|
-
touchAction?: import("react-native-gesture-handler/lib/typescript/handlers/gestureHandlerCommon").TouchAction | undefined;
|
|
28
|
-
waitFor?: React.Ref<unknown> | React.Ref<unknown>[] | undefined;
|
|
29
|
-
simultaneousHandlers?: React.Ref<unknown> | React.Ref<unknown>[] | undefined;
|
|
30
|
-
blocksHandlers?: React.Ref<unknown> | React.Ref<unknown>[] | undefined;
|
|
31
|
-
cancelsTouchesInView?: boolean | undefined;
|
|
32
|
-
onBegan?: ((event: import("react-native-gesture-handler").HandlerStateChangeEvent<Record<string, unknown>>) => void) | undefined;
|
|
33
|
-
onFailed?: ((event: import("react-native-gesture-handler").HandlerStateChangeEvent<Record<string, unknown>>) => void) | undefined;
|
|
34
|
-
onCancelled?: ((event: import("react-native-gesture-handler").HandlerStateChangeEvent<Record<string, unknown>>) => void) | undefined;
|
|
35
|
-
onActivated?: ((event: import("react-native-gesture-handler").HandlerStateChangeEvent<Record<string, unknown>>) => void) | undefined;
|
|
36
|
-
onEnded?: ((event: import("react-native-gesture-handler").HandlerStateChangeEvent<Record<string, unknown>>) => void) | undefined;
|
|
37
|
-
onHandlerStateChange?: ((event: import("react-native-gesture-handler").HandlerStateChangeEvent<import("react-native-gesture-handler").PanGestureHandlerEventPayload>) => void) | undefined;
|
|
38
|
-
minDist?: number | undefined;
|
|
39
|
-
avgTouches?: boolean | undefined;
|
|
40
|
-
enableTrackpadTwoFingerGesture?: boolean | undefined;
|
|
41
|
-
minPointers?: number | undefined;
|
|
42
|
-
maxPointers?: number | undefined;
|
|
43
|
-
minVelocity?: number | undefined;
|
|
44
|
-
minVelocityX?: number | undefined;
|
|
45
|
-
minVelocityY?: number | undefined;
|
|
46
|
-
activateAfterLongPress?: number | undefined;
|
|
47
|
-
} | undefined;
|
|
48
13
|
twClassName?: string | undefined;
|
|
49
14
|
} & import("react-native").ViewProps & React.RefAttributes<BottomSheetRef>>;
|
|
50
15
|
//# sourceMappingURL=BottomSheet.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BottomSheet.d.mts","sourceRoot":"","sources":["../../../src/components/BottomSheet/BottomSheet.tsx"],"names":[],"mappings":"AACA,OAAO,KAMN,cAAc;AAWf,OAAO,KAAK,EAGV,cAAc,EACf,gCAA4B;AAE7B,eAAO,MAAM,WAAW
|
|
1
|
+
{"version":3,"file":"BottomSheet.d.mts","sourceRoot":"","sources":["../../../src/components/BottomSheet/BottomSheet.tsx"],"names":[],"mappings":"AACA,OAAO,KAMN,cAAc;AAWf,OAAO,KAAK,EAGV,cAAc,EACf,gCAA4B;AAE7B,eAAO,MAAM,WAAW;;;;;;;;;;;2EAyHvB,CAAC"}
|
|
@@ -7,15 +7,15 @@ function $importDefault(module) {
|
|
|
7
7
|
import { useTailwind } from "@metamask-previews/design-system-twrnc-preset";
|
|
8
8
|
import $React, { forwardRef, useCallback, useEffect, useImperativeHandle, useRef } from "react";
|
|
9
9
|
const React = $importDefault($React);
|
|
10
|
-
import { BackHandler, KeyboardAvoidingView, Platform } from "react-native
|
|
10
|
+
import { BackHandler, KeyboardAvoidingView, Platform } from "react-native";
|
|
11
11
|
import { useSafeAreaFrame, useSafeAreaInsets } from "react-native-safe-area-context";
|
|
12
12
|
import { BottomSheetDialog } from "../BottomSheetDialog/index.mjs";
|
|
13
13
|
import { BottomSheetOverlay } from "../BottomSheetOverlay/BottomSheetOverlay.mjs";
|
|
14
|
-
export const BottomSheet = forwardRef(({ children, onClose, onOpen, goBack, style, twClassName, isInteractable = true, isFullscreen = false, keyboardAvoidingViewEnabled = true,
|
|
14
|
+
export const BottomSheet = forwardRef(({ children, onClose, onOpen, goBack, style, twClassName, isInteractable = true, isFullscreen = false, keyboardAvoidingViewEnabled = true, ...props }, ref) => {
|
|
15
15
|
const tw = useTailwind();
|
|
16
16
|
const { bottom: screenBottomPadding } = useSafeAreaInsets();
|
|
17
17
|
const { y: frameY } = useSafeAreaFrame();
|
|
18
|
-
const postCallback = useRef();
|
|
18
|
+
const postCallback = useRef(undefined);
|
|
19
19
|
const bottomSheetDialogRef = useRef(null);
|
|
20
20
|
const didNavigateBackRef = useRef(false);
|
|
21
21
|
const closeRequestedRef = useRef(false);
|
|
@@ -52,9 +52,9 @@ export const BottomSheet = forwardRef(({ children, onClose, onOpen, goBack, styl
|
|
|
52
52
|
}
|
|
53
53
|
return true;
|
|
54
54
|
};
|
|
55
|
-
BackHandler.addEventListener('hardwareBackPress', hardwareBackPress);
|
|
55
|
+
const subscription = BackHandler.addEventListener('hardwareBackPress', hardwareBackPress);
|
|
56
56
|
return () => {
|
|
57
|
-
|
|
57
|
+
subscription.remove();
|
|
58
58
|
};
|
|
59
59
|
}, [isInteractable]);
|
|
60
60
|
useImperativeHandle(ref, () => ({
|
|
@@ -78,7 +78,7 @@ export const BottomSheet = forwardRef(({ children, onClose, onOpen, goBack, styl
|
|
|
78
78
|
<BottomSheetOverlay onPress={isInteractable
|
|
79
79
|
? () => bottomSheetDialogRef.current?.onCloseDialog()
|
|
80
80
|
: undefined}/>
|
|
81
|
-
<BottomSheetDialog isInteractable={isInteractable} onClose={onCloseCB} onOpen={onOpenCB} ref={bottomSheetDialogRef} isFullscreen={isFullscreen} twClassName={twClassName} keyboardAvoidingViewEnabled={keyboardAvoidingViewEnabled}
|
|
81
|
+
<BottomSheetDialog isInteractable={isInteractable} onClose={onCloseCB} onOpen={onOpenCB} ref={bottomSheetDialogRef} isFullscreen={isFullscreen} twClassName={twClassName} keyboardAvoidingViewEnabled={keyboardAvoidingViewEnabled}>
|
|
82
82
|
{children}
|
|
83
83
|
</BottomSheetDialog>
|
|
84
84
|
</KeyboardAvoidingView>);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BottomSheet.mjs","sourceRoot":"","sources":["../../../src/components/BottomSheet/BottomSheet.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,sDAAsD;AAC5E,OAAO,QAAO,EACZ,UAAU,EACV,WAAW,EACX,SAAS,EACT,mBAAmB,EACnB,MAAM,EACP,cAAc;;AACf,OAAO,EAAE,WAAW,EAAE,oBAAoB,EAAE,QAAQ,EAAE,
|
|
1
|
+
{"version":3,"file":"BottomSheet.mjs","sourceRoot":"","sources":["../../../src/components/BottomSheet/BottomSheet.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,sDAAsD;AAC5E,OAAO,QAAO,EACZ,UAAU,EACV,WAAW,EACX,SAAS,EACT,mBAAmB,EACnB,MAAM,EACP,cAAc;;AACf,OAAO,EAAE,WAAW,EAAE,oBAAoB,EAAE,QAAQ,EAAE,qBAAqB;AAC3E,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EAClB,uCAAuC;AAExC,OAAO,EAAE,iBAAiB,EAAE,uCAA6B;AAEzD,OAAO,EAAE,kBAAkB,EAAE,qDAAiD;AAQ9E,MAAM,CAAC,MAAM,WAAW,GAAG,UAAU,CACnC,CACE,EACE,QAAQ,EACR,OAAO,EACP,MAAM,EACN,MAAM,EACN,KAAK,EACL,WAAW,EACX,cAAc,GAAG,IAAI,EACrB,YAAY,GAAG,KAAK,EACpB,2BAA2B,GAAG,IAAI,EAClC,GAAG,KAAK,EACT,EACD,GAAG,EACH,EAAE;IACF,MAAM,EAAE,GAAG,WAAW,EAAE,CAAC;IACzB,MAAM,EAAE,MAAM,EAAE,mBAAmB,EAA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,CACnB,QAAQ,CAAC,CAAC,QAAQ,CAAC,EAAE,KAAK,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CACxD,sBAAsB,CAAC,CACrB,QAAQ,CAAC,EAAE,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,MAAM,CACtD,CACD,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,8BAA8B,CAAC,EAAE,KAAK,CAAC,CAAC,CACzD,OAAO,CAAC,CAAC,2BAA2B,CAAC,CACrC,IAAI,KAAK,CAAC,CAEV;QAAA,CAAC,kBAAkB,CACjB,OAAO,CAAC,CACN,cAAc;YACZ,CAAC,CAAC,GAAG,EAAE,CAAC,oBAAoB,CAAC,OAAO,EAAE,aAAa,EAAE;YACrD,CAAC,CAAC,SAAS,CACd,EAEH;QAAA,CAAC,iBAAiB,CAChB,cAAc,CAAC,CAAC,cAAc,CAAC,CAC/B,OAAO,CAAC,CAAC,SAAS,CAAC,CACnB,MAAM,CAAC,CAAC,QAAQ,CAAC,CACjB,GAAG,CAAC,CAAC,oBAAoB,CAAC,CAC1B,YAAY,CAAC,CAAC,YAAY,CAAC,CAC3B,WAAW,CAAC,CAAC,WAAW,CAAC,CACzB,2BAA2B,CAAC,CAAC,2BAA2B,CAAC,CAEzD;UAAA,CAAC,QAAQ,CACX;QAAA,EAAE,iBAAiB,CACrB;MAAA,EAAE,oBAAoB,CAAC,CACxB,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,WAAW,CAAC,WAAW,GAAG,aAAa,CAAC","sourcesContent":["import { useTailwind } from '@metamask-previews/design-system-twrnc-preset';\nimport React, {\n forwardRef,\n useCallback,\n useEffect,\n useImperativeHandle,\n useRef,\n} from 'react';\nimport { BackHandler, KeyboardAvoidingView, Platform } from 'react-native';\nimport {\n useSafeAreaFrame,\n useSafeAreaInsets,\n} from 'react-native-safe-area-context';\n\nimport { BottomSheetDialog } from '../BottomSheetDialog';\nimport type { BottomSheetDialogRef } from '../BottomSheetDialog';\nimport { BottomSheetOverlay } from '../BottomSheetOverlay/BottomSheetOverlay';\n\nimport type {\n BottomSheetPostCallback,\n BottomSheetProps,\n BottomSheetRef,\n} from './BottomSheet.types';\n\nexport const BottomSheet = forwardRef<BottomSheetRef, BottomSheetProps>(\n (\n {\n children,\n onClose,\n onOpen,\n goBack,\n style,\n twClassName,\n isInteractable = true,\n isFullscreen = false,\n keyboardAvoidingViewEnabled = true,\n ...props\n },\n ref,\n ) => {\n const tw = useTailwind();\n const { bottom: screenBottomPadding } = useSafeAreaInsets();\n const { y: frameY } = useSafeAreaFrame();\n const postCallback = useRef<BottomSheetPostCallback | undefined>(undefined);\n const bottomSheetDialogRef = useRef<BottomSheetDialogRef>(null);\n const didNavigateBackRef = useRef(false);\n const closeRequestedRef = useRef(false);\n const didRunPostCallbackRef = useRef(false);\n\n const onOpenCB = useCallback(() => {\n // Reset when the sheet is opened again.\n didNavigateBackRef.current = false;\n closeRequestedRef.current = false;\n didRunPostCallbackRef.current = false;\n\n onOpen?.(Boolean(postCallback.current));\n const callback = postCallback.current;\n postCallback.current = undefined;\n callback?.();\n }, [onOpen]);\n\n const onCloseCB = useCallback(() => {\n if (goBack && !didNavigateBackRef.current) {\n didNavigateBackRef.current = true;\n goBack?.();\n }\n\n const callback = postCallback.current;\n const hasCallback = Boolean(callback);\n\n onClose?.(hasCallback);\n\n if (!didRunPostCallbackRef.current && hasCallback) {\n didRunPostCallbackRef.current = true;\n postCallback.current = undefined;\n callback?.();\n }\n }, [goBack, onClose]);\n\n // Dismiss the sheet when Android back button is pressed.\n useEffect(() => {\n const hardwareBackPress = () => {\n if (isInteractable) {\n bottomSheetDialogRef.current?.onCloseDialog();\n }\n return true;\n };\n const subscription = BackHandler.addEventListener(\n 'hardwareBackPress',\n hardwareBackPress,\n );\n return () => {\n subscription.remove();\n };\n }, [isInteractable]);\n\n useImperativeHandle(ref, () => ({\n onCloseBottomSheet: (callback) => {\n if (closeRequestedRef.current) {\n return;\n }\n closeRequestedRef.current = true;\n postCallback.current = callback;\n bottomSheetDialogRef.current?.onCloseDialog();\n },\n onOpenBottomSheet: (callback) => {\n didNavigateBackRef.current = false;\n closeRequestedRef.current = false;\n didRunPostCallbackRef.current = false;\n postCallback.current = callback;\n bottomSheetDialogRef.current?.onOpenDialog();\n },\n }));\n\n return (\n <KeyboardAvoidingView\n behavior={Platform.OS === 'ios' ? 'padding' : undefined}\n keyboardVerticalOffset={\n Platform.OS === 'ios' ? -screenBottomPadding : frameY\n }\n style={[tw.style('absolute inset-0 justify-end'), style]}\n enabled={keyboardAvoidingViewEnabled}\n {...props}\n >\n <BottomSheetOverlay\n onPress={\n isInteractable\n ? () => bottomSheetDialogRef.current?.onCloseDialog()\n : undefined\n }\n />\n <BottomSheetDialog\n isInteractable={isInteractable}\n onClose={onCloseCB}\n onOpen={onOpenCB}\n ref={bottomSheetDialogRef}\n isFullscreen={isFullscreen}\n twClassName={twClassName}\n keyboardAvoidingViewEnabled={keyboardAvoidingViewEnabled}\n >\n {children}\n </BottomSheetDialog>\n </KeyboardAvoidingView>\n );\n },\n);\n\nBottomSheet.displayName = 'BottomSheet';\n"]}
|
|
@@ -28,13 +28,13 @@ const design_system_twrnc_preset_1 = require("@metamask-previews/design-system-t
|
|
|
28
28
|
const design_tokens_1 = require("@metamask-previews/design-tokens");
|
|
29
29
|
const lodash_1 = require("lodash");
|
|
30
30
|
const react_1 = __importStar(require("react"));
|
|
31
|
-
const react_native_1 = require("react-native
|
|
31
|
+
const react_native_1 = require("react-native");
|
|
32
32
|
const react_native_gesture_handler_1 = require("react-native-gesture-handler");
|
|
33
33
|
const react_native_reanimated_1 = __importStar(require("react-native-reanimated"));
|
|
34
34
|
const react_native_safe_area_context_1 = require("react-native-safe-area-context");
|
|
35
35
|
// Internal dependencies.
|
|
36
36
|
const BottomSheetDialog_constants_1 = require("./BottomSheetDialog.constants.cjs");
|
|
37
|
-
exports.BottomSheetDialog = (0, react_1.forwardRef)(({ children, isFullscreen = false, isInteractable = true, keyboardAvoidingViewEnabled = true, onClose, onOpen,
|
|
37
|
+
exports.BottomSheetDialog = (0, react_1.forwardRef)(({ children, isFullscreen = false, isInteractable = true, keyboardAvoidingViewEnabled = true, onClose, onOpen, style, twClassName, ...props }, ref) => {
|
|
38
38
|
const tw = (0, design_system_twrnc_preset_1.useTailwind)();
|
|
39
39
|
const currentTheme = (0, design_system_twrnc_preset_1.useTheme)();
|
|
40
40
|
const shadowLg = currentTheme === design_system_twrnc_preset_1.Theme.Light
|
|
@@ -48,6 +48,7 @@ exports.BottomSheetDialog = (0, react_1.forwardRef)(({ children, isFullscreen =
|
|
|
48
48
|
const currentYOffset = (0, react_native_reanimated_1.useSharedValue)(screenHeight);
|
|
49
49
|
const topOfDialogYValue = (0, react_native_reanimated_1.useSharedValue)(0);
|
|
50
50
|
const bottomOfDialogYValue = (0, react_native_reanimated_1.useSharedValue)(screenHeight);
|
|
51
|
+
const gestureStartYOffset = (0, react_native_reanimated_1.useSharedValue)(0);
|
|
51
52
|
const isMounted = (0, react_1.useRef)(false);
|
|
52
53
|
const onOpenCB = (0, react_1.useCallback)(() => {
|
|
53
54
|
onOpen?.();
|
|
@@ -64,14 +65,16 @@ exports.BottomSheetDialog = (0, react_1.forwardRef)(({ children, isFullscreen =
|
|
|
64
65
|
});
|
|
65
66
|
// Ref values do not affect deps.
|
|
66
67
|
}, [onCloseCB]);
|
|
67
|
-
const gestureHandler = (0,
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
68
|
+
const gestureHandler = (0, react_1.useMemo)(() => {
|
|
69
|
+
const gesture = react_native_gesture_handler_1.Gesture.Pan()
|
|
70
|
+
.enabled(isInteractable)
|
|
71
|
+
.onStart(() => {
|
|
72
|
+
// Starts tracking vertical position of gesture.
|
|
73
|
+
gestureStartYOffset.value = currentYOffset.value;
|
|
74
|
+
})
|
|
75
|
+
.onUpdate((event) => {
|
|
73
76
|
const { translationY } = event;
|
|
74
|
-
currentYOffset.value =
|
|
77
|
+
currentYOffset.value = gestureStartYOffset.value + translationY;
|
|
75
78
|
// If gesture Y value goes above the bottom of Dialog Y value(bottom of dialog),
|
|
76
79
|
// which means the gesture is currently below the bottom of the dialog,
|
|
77
80
|
// sets it to bottom of Dialog Y value
|
|
@@ -84,13 +87,13 @@ exports.BottomSheetDialog = (0, react_1.forwardRef)(({ children, isFullscreen =
|
|
|
84
87
|
if (currentYOffset.value <= topOfDialogYValue.value) {
|
|
85
88
|
currentYOffset.value = topOfDialogYValue.value;
|
|
86
89
|
}
|
|
87
|
-
}
|
|
88
|
-
|
|
90
|
+
})
|
|
91
|
+
.onEnd((event) => {
|
|
89
92
|
const { translationY, velocityY } = event;
|
|
90
93
|
// finalYOffset is used to animate the Y position of the Dialog after the gesture event
|
|
91
94
|
let finalYOffset;
|
|
92
95
|
// Measuring dismissing swipe action
|
|
93
|
-
const latestOffset =
|
|
96
|
+
const latestOffset = gestureStartYOffset.value + translationY;
|
|
94
97
|
// Check if the swipe distance reach the dismiss offset threshold,
|
|
95
98
|
// which is currently 60% of sheet height
|
|
96
99
|
const hasReachedDismissOffset = latestOffset >
|
|
@@ -126,8 +129,16 @@ exports.BottomSheetDialog = (0, react_1.forwardRef)(({ children, isFullscreen =
|
|
|
126
129
|
duration: BottomSheetDialog_constants_1.DEFAULT_BOTTOMSHEETDIALOG_DISPLAY_DURATION,
|
|
127
130
|
});
|
|
128
131
|
}
|
|
129
|
-
}
|
|
130
|
-
|
|
132
|
+
});
|
|
133
|
+
return gesture;
|
|
134
|
+
}, [
|
|
135
|
+
isInteractable,
|
|
136
|
+
currentYOffset,
|
|
137
|
+
gestureStartYOffset,
|
|
138
|
+
bottomOfDialogYValue,
|
|
139
|
+
topOfDialogYValue,
|
|
140
|
+
onCloseDialog,
|
|
141
|
+
]);
|
|
131
142
|
// Animate in sheet on initial render.
|
|
132
143
|
const onOpenDialog = (callback) => {
|
|
133
144
|
// Starts setting the Y position of the dialog to the bottom of the dialog
|
|
@@ -166,7 +177,7 @@ exports.BottomSheetDialog = (0, react_1.forwardRef)(({ children, isFullscreen =
|
|
|
166
177
|
],
|
|
167
178
|
}));
|
|
168
179
|
const sheetStyle = (0, react_1.useMemo)(() => [
|
|
169
|
-
tw.style('bg-
|
|
180
|
+
tw.style('bg-default rounded-t-3xl overflow-hidden border border-muted', twClassName),
|
|
170
181
|
{
|
|
171
182
|
maxHeight: maxSheetHeight,
|
|
172
183
|
paddingBottom: react_native_1.Platform.select({
|
|
@@ -193,14 +204,14 @@ exports.BottomSheetDialog = (0, react_1.forwardRef)(({ children, isFullscreen =
|
|
|
193
204
|
onCloseDialog,
|
|
194
205
|
}));
|
|
195
206
|
return (<react_native_1.KeyboardAvoidingView style={tw.style('absolute bottom-0 inset-x-0')} behavior={react_native_1.Platform.OS === 'ios' ? 'padding' : undefined} keyboardVerticalOffset={react_native_1.Platform.OS === 'ios' ? -screenBottomPadding : frameY} enabled={keyboardAvoidingViewEnabled} {...props}>
|
|
196
|
-
<react_native_gesture_handler_1.
|
|
207
|
+
<react_native_gesture_handler_1.GestureDetector gesture={gestureHandler}>
|
|
197
208
|
<react_native_reanimated_1.default.View onLayout={updateSheetHeight} style={combinedSheetStyle}>
|
|
198
209
|
{isInteractable && (<react_native_1.View style={tw.style('self-stretch items-center p-1')}>
|
|
199
210
|
<react_native_1.View style={tw.style('h-1 w-10 rounded-sm bg-border-muted')}/>
|
|
200
211
|
</react_native_1.View>)}
|
|
201
212
|
{children}
|
|
202
213
|
</react_native_reanimated_1.default.View>
|
|
203
|
-
</react_native_gesture_handler_1.
|
|
214
|
+
</react_native_gesture_handler_1.GestureDetector>
|
|
204
215
|
</react_native_1.KeyboardAvoidingView>);
|
|
205
216
|
});
|
|
206
217
|
//# sourceMappingURL=BottomSheetDialog.cjs.map
|