@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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../src/components/SectionHeader/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,4BAAwB","sourcesContent":["export { SectionHeader } from './SectionHeader';\nexport type { SectionHeaderProps } from './SectionHeader.types';\n"]}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.SegmentButton = void 0;
|
|
27
|
+
const design_system_shared_1 = require("@metamask-previews/design-system-shared");
|
|
28
|
+
const react_1 = __importStar(require("react"));
|
|
29
|
+
const ButtonBase_1 = require("../ButtonBase/index.cjs");
|
|
30
|
+
const Icon_1 = require("../Icon/index.cjs");
|
|
31
|
+
const Text_1 = require("../Text/index.cjs");
|
|
32
|
+
const SegmentButton = ({ children, textProps, startIconProps, endIconProps, value, isSelected = false, variant, isLoading = false, size = design_system_shared_1.ButtonBaseSize.Sm, twClassName = '', style, onPress, ...buttonBaseRest }) => {
|
|
33
|
+
const segmentGroup = (0, react_1.useContext)(design_system_shared_1.SegmentGroupContext);
|
|
34
|
+
const usesGroupSelection = segmentGroup !== null && value !== undefined;
|
|
35
|
+
const effectiveVariant = variant ?? segmentGroup?.variant ?? design_system_shared_1.SegmentButtonVariant.Primary;
|
|
36
|
+
const effectiveIsSelected = usesGroupSelection
|
|
37
|
+
? segmentGroup.value === value
|
|
38
|
+
: isSelected;
|
|
39
|
+
const getTextAndIconClassName = () => {
|
|
40
|
+
if (effectiveVariant === design_system_shared_1.SegmentButtonVariant.Primary &&
|
|
41
|
+
effectiveIsSelected) {
|
|
42
|
+
return 'text-primary-inverse';
|
|
43
|
+
}
|
|
44
|
+
if (effectiveVariant === design_system_shared_1.SegmentButtonVariant.Secondary &&
|
|
45
|
+
effectiveIsSelected) {
|
|
46
|
+
return 'text-default';
|
|
47
|
+
}
|
|
48
|
+
return '';
|
|
49
|
+
};
|
|
50
|
+
const handlePress = (event) => {
|
|
51
|
+
if (usesGroupSelection &&
|
|
52
|
+
segmentGroup !== null &&
|
|
53
|
+
value !== undefined &&
|
|
54
|
+
segmentGroup.value !== value) {
|
|
55
|
+
segmentGroup.onChange(value);
|
|
56
|
+
}
|
|
57
|
+
onPress?.(event);
|
|
58
|
+
};
|
|
59
|
+
return (<ButtonBase_1.ButtonBase {...buttonBaseRest} size={size} isLoading={isLoading} children={children} onPress={handlePress} textProps={{
|
|
60
|
+
...(!effectiveIsSelected ? { color: Text_1.TextColor.TextAlternative } : {}),
|
|
61
|
+
...textProps,
|
|
62
|
+
}} startIconProps={{
|
|
63
|
+
...(!effectiveIsSelected ? { color: Icon_1.IconColor.IconAlternative } : {}),
|
|
64
|
+
...startIconProps,
|
|
65
|
+
}} endIconProps={{
|
|
66
|
+
...(!effectiveIsSelected ? { color: Icon_1.IconColor.IconAlternative } : {}),
|
|
67
|
+
...endIconProps,
|
|
68
|
+
}} twClassName={(pressed) => {
|
|
69
|
+
if (effectiveVariant === design_system_shared_1.SegmentButtonVariant.Primary &&
|
|
70
|
+
effectiveIsSelected) {
|
|
71
|
+
return `${pressed || isLoading ? 'bg-icon-default-pressed' : 'bg-icon-default'} ${typeof twClassName === 'function'
|
|
72
|
+
? twClassName(pressed)
|
|
73
|
+
: twClassName}`;
|
|
74
|
+
}
|
|
75
|
+
if (effectiveVariant === design_system_shared_1.SegmentButtonVariant.Secondary &&
|
|
76
|
+
effectiveIsSelected) {
|
|
77
|
+
return `${pressed || isLoading ? 'bg-muted-pressed' : 'bg-muted'} ${typeof twClassName === 'function'
|
|
78
|
+
? twClassName(pressed)
|
|
79
|
+
: twClassName}`;
|
|
80
|
+
}
|
|
81
|
+
return `${pressed || isLoading ? 'bg-pressed' : 'bg-transparent'} border-0 ${typeof twClassName === 'function' ? twClassName(pressed) : twClassName}`;
|
|
82
|
+
}} textClassName={getTextAndIconClassName} iconClassName={getTextAndIconClassName} style={style}/>);
|
|
83
|
+
};
|
|
84
|
+
exports.SegmentButton = SegmentButton;
|
|
85
|
+
exports.SegmentButton.displayName = 'SegmentButton';
|
|
86
|
+
//# sourceMappingURL=SegmentButton.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SegmentButton.cjs","sourceRoot":"","sources":["../../../src/components/SegmentButton/SegmentButton.tsx"],"names":[],"mappings":";;;;;;;;;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,WAAW,KAAK,UAAU;oBAC/B,CAAC,CAAC,WAAW,CAAC,OAAO,CAAC;oBACtB,CAAC,CAAC,WACN,EAAE,CAAC;aACJ;YAED,OAAO,GAAG,OAAO,IAAI,SAAS,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,gBAAgB,aAC9D,OAAO,WAAW,KAAK,UAAU,CAAC,CAAC,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,WAC7D,EAAE,CAAC;QACL,CAAC,CAAC,CACF,aAAa,CAAC,CAAC,uBAAuB,CAAC,CACvC,aAAa,CAAC,CAAC,uBAAuB,CAAC,CACvC,KAAK,CAAC,CAAC,KAAK,CAAC,EACb,CACH,CAAC;AACJ,CAAC,CAAC;AAxGW,QAAA,aAAa,iBAwGxB;AAEF,qBAAa,CAAC,WAAW,GAAG,eAAe,CAAC","sourcesContent":["import {\n ButtonBaseSize,\n SegmentButtonVariant,\n SegmentGroupContext,\n} from '@metamask-previews/design-system-shared';\nimport React, { useContext } from 'react';\nimport type { GestureResponderEvent } from 'react-native';\n\nimport { ButtonBase } from '../ButtonBase';\nimport { IconColor } from '../Icon';\nimport { TextColor } from '../Text';\n\nimport type { SegmentButtonProps } from './SegmentButton.types';\n\nexport const SegmentButton = ({\n children,\n textProps,\n startIconProps,\n endIconProps,\n value,\n isSelected = false,\n variant,\n isLoading = false,\n size = ButtonBaseSize.Sm,\n twClassName = '',\n style,\n onPress,\n ...buttonBaseRest\n}: SegmentButtonProps) => {\n const segmentGroup = useContext(SegmentGroupContext);\n const usesGroupSelection = segmentGroup !== null && value !== undefined;\n\n const effectiveVariant =\n variant ?? segmentGroup?.variant ?? SegmentButtonVariant.Primary;\n\n const effectiveIsSelected = usesGroupSelection\n ? segmentGroup.value === value\n : isSelected;\n\n const getTextAndIconClassName = () => {\n if (\n effectiveVariant === SegmentButtonVariant.Primary &&\n effectiveIsSelected\n ) {\n return 'text-primary-inverse';\n }\n if (\n effectiveVariant === SegmentButtonVariant.Secondary &&\n effectiveIsSelected\n ) {\n return 'text-default';\n }\n return '';\n };\n\n const handlePress = (event: GestureResponderEvent) => {\n if (\n usesGroupSelection &&\n segmentGroup !== null &&\n value !== undefined &&\n segmentGroup.value !== value\n ) {\n segmentGroup.onChange(value);\n }\n onPress?.(event);\n };\n\n return (\n <ButtonBase\n {...buttonBaseRest}\n size={size}\n isLoading={isLoading}\n children={children}\n onPress={handlePress}\n textProps={{\n ...(!effectiveIsSelected ? { color: TextColor.TextAlternative } : {}),\n ...textProps,\n }}\n startIconProps={{\n ...(!effectiveIsSelected ? { color: IconColor.IconAlternative } : {}),\n ...startIconProps,\n }}\n endIconProps={{\n ...(!effectiveIsSelected ? { color: IconColor.IconAlternative } : {}),\n ...endIconProps,\n }}\n twClassName={(pressed) => {\n if (\n effectiveVariant === SegmentButtonVariant.Primary &&\n effectiveIsSelected\n ) {\n return `${pressed || isLoading ? 'bg-icon-default-pressed' : 'bg-icon-default'} ${\n typeof twClassName === 'function'\n ? twClassName(pressed)\n : twClassName\n }`;\n }\n\n if (\n effectiveVariant === SegmentButtonVariant.Secondary &&\n effectiveIsSelected\n ) {\n return `${pressed || isLoading ? 'bg-muted-pressed' : 'bg-muted'} ${\n typeof twClassName === 'function'\n ? twClassName(pressed)\n : twClassName\n }`;\n }\n\n return `${pressed || isLoading ? 'bg-pressed' : 'bg-transparent'} border-0 ${\n typeof twClassName === 'function' ? twClassName(pressed) : twClassName\n }`;\n }}\n textClassName={getTextAndIconClassName}\n iconClassName={getTextAndIconClassName}\n style={style}\n />\n );\n};\n\nSegmentButton.displayName = 'SegmentButton';\n"]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { SegmentButtonProps } from "./SegmentButton.types.cjs";
|
|
3
|
+
export declare const SegmentButton: {
|
|
4
|
+
({ children, textProps, startIconProps, endIconProps, value, isSelected, variant, isLoading, size, twClassName, style, onPress, ...buttonBaseRest }: SegmentButtonProps): React.JSX.Element;
|
|
5
|
+
displayName: string;
|
|
6
|
+
};
|
|
7
|
+
//# sourceMappingURL=SegmentButton.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SegmentButton.d.cts","sourceRoot":"","sources":["../../../src/components/SegmentButton/SegmentButton.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAqB,cAAc;AAO1C,OAAO,KAAK,EAAE,kBAAkB,EAAE,kCAA8B;AAEhE,eAAO,MAAM,aAAa;yJAcvB,kBAAkB;;CA0FpB,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { SegmentButtonProps } from "./SegmentButton.types.mjs";
|
|
3
|
+
export declare const SegmentButton: {
|
|
4
|
+
({ children, textProps, startIconProps, endIconProps, value, isSelected, variant, isLoading, size, twClassName, style, onPress, ...buttonBaseRest }: SegmentButtonProps): React.JSX.Element;
|
|
5
|
+
displayName: string;
|
|
6
|
+
};
|
|
7
|
+
//# sourceMappingURL=SegmentButton.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SegmentButton.d.mts","sourceRoot":"","sources":["../../../src/components/SegmentButton/SegmentButton.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAqB,cAAc;AAO1C,OAAO,KAAK,EAAE,kBAAkB,EAAE,kCAA8B;AAEhE,eAAO,MAAM,aAAa;yJAcvB,kBAAkB;;CA0FpB,CAAC"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
function $importDefault(module) {
|
|
2
|
+
if (module?.__esModule) {
|
|
3
|
+
return module.default;
|
|
4
|
+
}
|
|
5
|
+
return module;
|
|
6
|
+
}
|
|
7
|
+
import { ButtonBaseSize, SegmentButtonVariant, SegmentGroupContext } from "@metamask-previews/design-system-shared";
|
|
8
|
+
import $React, { useContext } from "react";
|
|
9
|
+
const React = $importDefault($React);
|
|
10
|
+
import { ButtonBase } from "../ButtonBase/index.mjs";
|
|
11
|
+
import { IconColor } from "../Icon/index.mjs";
|
|
12
|
+
import { TextColor } from "../Text/index.mjs";
|
|
13
|
+
export const SegmentButton = ({ children, textProps, startIconProps, endIconProps, value, isSelected = false, variant, isLoading = false, size = ButtonBaseSize.Sm, twClassName = '', style, onPress, ...buttonBaseRest }) => {
|
|
14
|
+
const segmentGroup = useContext(SegmentGroupContext);
|
|
15
|
+
const usesGroupSelection = segmentGroup !== null && value !== undefined;
|
|
16
|
+
const effectiveVariant = variant ?? segmentGroup?.variant ?? SegmentButtonVariant.Primary;
|
|
17
|
+
const effectiveIsSelected = usesGroupSelection
|
|
18
|
+
? segmentGroup.value === value
|
|
19
|
+
: isSelected;
|
|
20
|
+
const getTextAndIconClassName = () => {
|
|
21
|
+
if (effectiveVariant === SegmentButtonVariant.Primary &&
|
|
22
|
+
effectiveIsSelected) {
|
|
23
|
+
return 'text-primary-inverse';
|
|
24
|
+
}
|
|
25
|
+
if (effectiveVariant === SegmentButtonVariant.Secondary &&
|
|
26
|
+
effectiveIsSelected) {
|
|
27
|
+
return 'text-default';
|
|
28
|
+
}
|
|
29
|
+
return '';
|
|
30
|
+
};
|
|
31
|
+
const handlePress = (event) => {
|
|
32
|
+
if (usesGroupSelection &&
|
|
33
|
+
segmentGroup !== null &&
|
|
34
|
+
value !== undefined &&
|
|
35
|
+
segmentGroup.value !== value) {
|
|
36
|
+
segmentGroup.onChange(value);
|
|
37
|
+
}
|
|
38
|
+
onPress?.(event);
|
|
39
|
+
};
|
|
40
|
+
return (<ButtonBase {...buttonBaseRest} size={size} isLoading={isLoading} children={children} onPress={handlePress} textProps={{
|
|
41
|
+
...(!effectiveIsSelected ? { color: TextColor.TextAlternative } : {}),
|
|
42
|
+
...textProps,
|
|
43
|
+
}} startIconProps={{
|
|
44
|
+
...(!effectiveIsSelected ? { color: IconColor.IconAlternative } : {}),
|
|
45
|
+
...startIconProps,
|
|
46
|
+
}} endIconProps={{
|
|
47
|
+
...(!effectiveIsSelected ? { color: IconColor.IconAlternative } : {}),
|
|
48
|
+
...endIconProps,
|
|
49
|
+
}} twClassName={(pressed) => {
|
|
50
|
+
if (effectiveVariant === SegmentButtonVariant.Primary &&
|
|
51
|
+
effectiveIsSelected) {
|
|
52
|
+
return `${pressed || isLoading ? 'bg-icon-default-pressed' : 'bg-icon-default'} ${typeof twClassName === 'function'
|
|
53
|
+
? twClassName(pressed)
|
|
54
|
+
: twClassName}`;
|
|
55
|
+
}
|
|
56
|
+
if (effectiveVariant === SegmentButtonVariant.Secondary &&
|
|
57
|
+
effectiveIsSelected) {
|
|
58
|
+
return `${pressed || isLoading ? 'bg-muted-pressed' : 'bg-muted'} ${typeof twClassName === 'function'
|
|
59
|
+
? twClassName(pressed)
|
|
60
|
+
: twClassName}`;
|
|
61
|
+
}
|
|
62
|
+
return `${pressed || isLoading ? 'bg-pressed' : 'bg-transparent'} border-0 ${typeof twClassName === 'function' ? twClassName(pressed) : twClassName}`;
|
|
63
|
+
}} textClassName={getTextAndIconClassName} iconClassName={getTextAndIconClassName} style={style}/>);
|
|
64
|
+
};
|
|
65
|
+
SegmentButton.displayName = 'SegmentButton';
|
|
66
|
+
//# sourceMappingURL=SegmentButton.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SegmentButton.mjs","sourceRoot":"","sources":["../../../src/components/SegmentButton/SegmentButton.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,EACL,cAAc,EACd,oBAAoB,EACpB,mBAAmB,EACpB,gDAAgD;AACjD,OAAO,QAAO,EAAE,UAAU,EAAE,cAAc;;AAG1C,OAAO,EAAE,UAAU,EAAE,gCAAsB;AAC3C,OAAO,EAAE,SAAS,EAAE,0BAAgB;AACpC,OAAO,EAAE,SAAS,EAAE,0BAAgB;AAIpC,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,EAC5B,QAAQ,EACR,SAAS,EACT,cAAc,EACd,YAAY,EACZ,KAAK,EACL,UAAU,GAAG,KAAK,EAClB,OAAO,EACP,SAAS,GAAG,KAA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AAO,CAAC,CAAC,CAAC,CAAC,WAC7D,EAAE,CAAC;QACL,CAAC,CAAC,CACF,aAAa,CAAC,CAAC,uBAAuB,CAAC,CACvC,aAAa,CAAC,CAAC,uBAAuB,CAAC,CACvC,KAAK,CAAC,CAAC,KAAK,CAAC,EACb,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,aAAa,CAAC,WAAW,GAAG,eAAe,CAAC","sourcesContent":["import {\n ButtonBaseSize,\n SegmentButtonVariant,\n SegmentGroupContext,\n} from '@metamask-previews/design-system-shared';\nimport React, { useContext } from 'react';\nimport type { GestureResponderEvent } from 'react-native';\n\nimport { ButtonBase } from '../ButtonBase';\nimport { IconColor } from '../Icon';\nimport { TextColor } from '../Text';\n\nimport type { SegmentButtonProps } from './SegmentButton.types';\n\nexport const SegmentButton = ({\n children,\n textProps,\n startIconProps,\n endIconProps,\n value,\n isSelected = false,\n variant,\n isLoading = false,\n size = ButtonBaseSize.Sm,\n twClassName = '',\n style,\n onPress,\n ...buttonBaseRest\n}: SegmentButtonProps) => {\n const segmentGroup = useContext(SegmentGroupContext);\n const usesGroupSelection = segmentGroup !== null && value !== undefined;\n\n const effectiveVariant =\n variant ?? segmentGroup?.variant ?? SegmentButtonVariant.Primary;\n\n const effectiveIsSelected = usesGroupSelection\n ? segmentGroup.value === value\n : isSelected;\n\n const getTextAndIconClassName = () => {\n if (\n effectiveVariant === SegmentButtonVariant.Primary &&\n effectiveIsSelected\n ) {\n return 'text-primary-inverse';\n }\n if (\n effectiveVariant === SegmentButtonVariant.Secondary &&\n effectiveIsSelected\n ) {\n return 'text-default';\n }\n return '';\n };\n\n const handlePress = (event: GestureResponderEvent) => {\n if (\n usesGroupSelection &&\n segmentGroup !== null &&\n value !== undefined &&\n segmentGroup.value !== value\n ) {\n segmentGroup.onChange(value);\n }\n onPress?.(event);\n };\n\n return (\n <ButtonBase\n {...buttonBaseRest}\n size={size}\n isLoading={isLoading}\n children={children}\n onPress={handlePress}\n textProps={{\n ...(!effectiveIsSelected ? { color: TextColor.TextAlternative } : {}),\n ...textProps,\n }}\n startIconProps={{\n ...(!effectiveIsSelected ? { color: IconColor.IconAlternative } : {}),\n ...startIconProps,\n }}\n endIconProps={{\n ...(!effectiveIsSelected ? { color: IconColor.IconAlternative } : {}),\n ...endIconProps,\n }}\n twClassName={(pressed) => {\n if (\n effectiveVariant === SegmentButtonVariant.Primary &&\n effectiveIsSelected\n ) {\n return `${pressed || isLoading ? 'bg-icon-default-pressed' : 'bg-icon-default'} ${\n typeof twClassName === 'function'\n ? twClassName(pressed)\n : twClassName\n }`;\n }\n\n if (\n effectiveVariant === SegmentButtonVariant.Secondary &&\n effectiveIsSelected\n ) {\n return `${pressed || isLoading ? 'bg-muted-pressed' : 'bg-muted'} ${\n typeof twClassName === 'function'\n ? twClassName(pressed)\n : twClassName\n }`;\n }\n\n return `${pressed || isLoading ? 'bg-pressed' : 'bg-transparent'} border-0 ${\n typeof twClassName === 'function' ? twClassName(pressed) : twClassName\n }`;\n }}\n textClassName={getTextAndIconClassName}\n iconClassName={getTextAndIconClassName}\n style={style}\n />\n );\n};\n\nSegmentButton.displayName = 'SegmentButton';\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SegmentButton.types.cjs","sourceRoot":"","sources":["../../../src/components/SegmentButton/SegmentButton.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { SegmentButtonPropsShared } from '@metamask-previews/design-system-shared';\n\nimport type { ButtonBaseProps } from '../ButtonBase/ButtonBase.types';\n\n/**\n * SegmentButton component props.\n */\nexport type SegmentButtonProps = SegmentButtonPropsShared &\n Omit<ButtonBaseProps, 'onPress'> & {\n onPress?: ButtonBaseProps['onPress'];\n };\n"]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { SegmentButtonPropsShared } from "@metamask-previews/design-system-shared";
|
|
2
|
+
import type { ButtonBaseProps } from "../ButtonBase/ButtonBase.types.cjs";
|
|
3
|
+
/**
|
|
4
|
+
* SegmentButton component props.
|
|
5
|
+
*/
|
|
6
|
+
export type SegmentButtonProps = SegmentButtonPropsShared & Omit<ButtonBaseProps, 'onPress'> & {
|
|
7
|
+
onPress?: ButtonBaseProps['onPress'];
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=SegmentButton.types.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SegmentButton.types.d.cts","sourceRoot":"","sources":["../../../src/components/SegmentButton/SegmentButton.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,gDAAgD;AAExF,OAAO,KAAK,EAAE,eAAe,EAAE,2CAAuC;AAEtE;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG,wBAAwB,GACvD,IAAI,CAAC,eAAe,EAAE,SAAS,CAAC,GAAG;IACjC,OAAO,CAAC,EAAE,eAAe,CAAC,SAAS,CAAC,CAAC;CACtC,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { SegmentButtonPropsShared } from "@metamask-previews/design-system-shared";
|
|
2
|
+
import type { ButtonBaseProps } from "../ButtonBase/ButtonBase.types.mjs";
|
|
3
|
+
/**
|
|
4
|
+
* SegmentButton component props.
|
|
5
|
+
*/
|
|
6
|
+
export type SegmentButtonProps = SegmentButtonPropsShared & Omit<ButtonBaseProps, 'onPress'> & {
|
|
7
|
+
onPress?: ButtonBaseProps['onPress'];
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=SegmentButton.types.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SegmentButton.types.d.mts","sourceRoot":"","sources":["../../../src/components/SegmentButton/SegmentButton.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,gDAAgD;AAExF,OAAO,KAAK,EAAE,eAAe,EAAE,2CAAuC;AAEtE;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG,wBAAwB,GACvD,IAAI,CAAC,eAAe,EAAE,SAAS,CAAC,GAAG;IACjC,OAAO,CAAC,EAAE,eAAe,CAAC,SAAS,CAAC,CAAC;CACtC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SegmentButton.types.mjs","sourceRoot":"","sources":["../../../src/components/SegmentButton/SegmentButton.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { SegmentButtonPropsShared } from '@metamask-previews/design-system-shared';\n\nimport type { ButtonBaseProps } from '../ButtonBase/ButtonBase.types';\n\n/**\n * SegmentButton component props.\n */\nexport type SegmentButtonProps = SegmentButtonPropsShared &\n Omit<ButtonBaseProps, 'onPress'> & {\n onPress?: ButtonBaseProps['onPress'];\n };\n"]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SegmentButton = exports.SegmentButtonVariant = void 0;
|
|
4
|
+
var design_system_shared_1 = require("@metamask-previews/design-system-shared");
|
|
5
|
+
Object.defineProperty(exports, "SegmentButtonVariant", { enumerable: true, get: function () { return design_system_shared_1.SegmentButtonVariant; } });
|
|
6
|
+
var SegmentButton_1 = require("./SegmentButton.cjs");
|
|
7
|
+
Object.defineProperty(exports, "SegmentButton", { enumerable: true, get: function () { return SegmentButton_1.SegmentButton; } });
|
|
8
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../../src/components/SegmentButton/index.ts"],"names":[],"mappings":";;;AAAA,gFAA+E;AAAtE,4HAAA,oBAAoB,OAAA;AAC7B,qDAAgD;AAAvC,8GAAA,aAAa,OAAA","sourcesContent":["export { SegmentButtonVariant } from '@metamask-previews/design-system-shared';\nexport { SegmentButton } from './SegmentButton';\nexport type { SegmentButtonProps } from './SegmentButton.types';\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/components/SegmentButton/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,gDAAgD;AAC/E,OAAO,EAAE,aAAa,EAAE,4BAAwB;AAChD,YAAY,EAAE,kBAAkB,EAAE,kCAA8B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../src/components/SegmentButton/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,gDAAgD;AAC/E,OAAO,EAAE,aAAa,EAAE,4BAAwB;AAChD,YAAY,EAAE,kBAAkB,EAAE,kCAA8B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../src/components/SegmentButton/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,gDAAgD;AAC/E,OAAO,EAAE,aAAa,EAAE,4BAAwB","sourcesContent":["export { SegmentButtonVariant } from '@metamask-previews/design-system-shared';\nexport { SegmentButton } from './SegmentButton';\nexport type { SegmentButtonProps } from './SegmentButton.types';\n"]}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.SegmentGroup = void 0;
|
|
27
|
+
const design_system_shared_1 = require("@metamask-previews/design-system-shared");
|
|
28
|
+
const design_system_twrnc_preset_1 = require("@metamask-previews/design-system-twrnc-preset");
|
|
29
|
+
const react_1 = __importStar(require("react"));
|
|
30
|
+
const react_native_1 = require("react-native");
|
|
31
|
+
const Box_constants_1 = require("../Box/Box.constants.cjs");
|
|
32
|
+
const SegmentGroup = ({ value, onChange, variant, children, twClassName, style, contentContainerStyle, ...scrollRest }) => {
|
|
33
|
+
const tw = (0, design_system_twrnc_preset_1.useTailwind)();
|
|
34
|
+
const contextValue = (0, react_1.useMemo)(() => ({ value, onChange, variant }), [value, onChange, variant]);
|
|
35
|
+
const mergedContentContainerStyle = [
|
|
36
|
+
tw.style('flex', design_system_shared_1.BoxFlexDirection.Row, design_system_shared_1.BoxAlignItems.Center, Box_constants_1.TWCLASSMAP_BOX_GAP[3], twClassName),
|
|
37
|
+
contentContainerStyle,
|
|
38
|
+
];
|
|
39
|
+
return (<design_system_shared_1.SegmentGroupContext.Provider value={contextValue}>
|
|
40
|
+
<react_native_1.ScrollView {...scrollRest} horizontal showsHorizontalScrollIndicator={false} accessibilityRole="tablist" style={[tw.style('self-stretch'), style]} contentContainerStyle={mergedContentContainerStyle}>
|
|
41
|
+
{children}
|
|
42
|
+
</react_native_1.ScrollView>
|
|
43
|
+
</design_system_shared_1.SegmentGroupContext.Provider>);
|
|
44
|
+
};
|
|
45
|
+
exports.SegmentGroup = SegmentGroup;
|
|
46
|
+
exports.SegmentGroup.displayName = 'SegmentGroup';
|
|
47
|
+
//# sourceMappingURL=SegmentGroup.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SegmentGroup.cjs","sourceRoot":"","sources":["../../../src/components/SegmentGroup/SegmentGroup.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kFAIiD;AACjD,8FAA4E;AAC5E,+CAAuC;AACvC,+CAA0C;AAG1C,4DAA0D;AAInD,MAAM,YAAY,GAAG,CAAC,EAC3B,KAAK,EACL,QAAQ,EACR,OAAO,EACP,QAAQ,EACR,WAAW,EACX,KAAK,EACL,qBAAqB,EACrB,GAAG,UAAU,EACK,EAAE,EAAE;IACtB,MAAM,EAAE,GAAG,IAAA,wCAAW,GAAE,CAAC;IAEzB,MAAM,YAAY,GAAG,IAAA,eAAO,EAC1B,GAAG,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,EACpC,CAAC,KAAK,EAAE,QAAQ,EAAE,OAAO,CAAC,CAC3B,CAAC;IAEF,MAAM,2BAA2B,GAAyB;QACxD,EAAE,CAAC,KAAK,CACN,MAAM,EACN,uCAAgB,CAAC,GAAG,EACpB,oCAAa,CAAC,MAAM,EACpB,kCAAkB,CAAC,CAAC,CAAC,EACrB,WAAW,CACZ;QACD,qBAAqB;KACtB,CAAC;IAEF,OAAO,CACL,CAAC,0CAAmB,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,YAAY,CAAC,CAChD;MAAA,CAAC,yBAAU,CACT,IAAI,UAAU,CAAC,CACf,UAAU,CACV,8BAA8B,CAAC,CAAC,KAAK,CAAC,CACtC,iBAAiB,CAAC,SAAS,CAC3B,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,cAAc,CAAC,EAAE,KAAK,CAAC,CAAC,CACzC,qBAAqB,CAAC,CAAC,2BAA2B,CAAC,CAEnD;QAAA,CAAC,QAAQ,CACX;MAAA,EAAE,yBAAU,CACd;IAAA,EAAE,0CAAmB,CAAC,QAAQ,CAAC,CAChC,CAAC;AACJ,CAAC,CAAC;AA1CW,QAAA,YAAY,gBA0CvB;AAEF,oBAAY,CAAC,WAAW,GAAG,cAAc,CAAC","sourcesContent":["import {\n BoxAlignItems,\n BoxFlexDirection,\n SegmentGroupContext,\n} from '@metamask-previews/design-system-shared';\nimport { useTailwind } from '@metamask-previews/design-system-twrnc-preset';\nimport React, { useMemo } from 'react';\nimport { ScrollView } from 'react-native';\nimport type { StyleProp, ViewStyle } from 'react-native';\n\nimport { TWCLASSMAP_BOX_GAP } from '../Box/Box.constants';\n\nimport type { SegmentGroupProps } from './SegmentGroup.types';\n\nexport const SegmentGroup = ({\n value,\n onChange,\n variant,\n children,\n twClassName,\n style,\n contentContainerStyle,\n ...scrollRest\n}: SegmentGroupProps) => {\n const tw = useTailwind();\n\n const contextValue = useMemo(\n () => ({ value, onChange, variant }),\n [value, onChange, variant],\n );\n\n const mergedContentContainerStyle: StyleProp<ViewStyle> = [\n tw.style(\n 'flex',\n BoxFlexDirection.Row,\n BoxAlignItems.Center,\n TWCLASSMAP_BOX_GAP[3],\n twClassName,\n ),\n contentContainerStyle,\n ];\n\n return (\n <SegmentGroupContext.Provider value={contextValue}>\n <ScrollView\n {...scrollRest}\n horizontal\n showsHorizontalScrollIndicator={false}\n accessibilityRole=\"tablist\"\n style={[tw.style('self-stretch'), style]}\n contentContainerStyle={mergedContentContainerStyle}\n >\n {children}\n </ScrollView>\n </SegmentGroupContext.Provider>\n );\n};\n\nSegmentGroup.displayName = 'SegmentGroup';\n"]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { SegmentGroupProps } from "./SegmentGroup.types.cjs";
|
|
3
|
+
export declare const SegmentGroup: {
|
|
4
|
+
({ value, onChange, variant, children, twClassName, style, contentContainerStyle, ...scrollRest }: SegmentGroupProps): React.JSX.Element;
|
|
5
|
+
displayName: string;
|
|
6
|
+
};
|
|
7
|
+
//# sourceMappingURL=SegmentGroup.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SegmentGroup.d.cts","sourceRoot":"","sources":["../../../src/components/SegmentGroup/SegmentGroup.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAkB,cAAc;AAMvC,OAAO,KAAK,EAAE,iBAAiB,EAAE,iCAA6B;AAE9D,eAAO,MAAM,YAAY;uGAStB,iBAAiB;;CAiCnB,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { SegmentGroupProps } from "./SegmentGroup.types.mjs";
|
|
3
|
+
export declare const SegmentGroup: {
|
|
4
|
+
({ value, onChange, variant, children, twClassName, style, contentContainerStyle, ...scrollRest }: SegmentGroupProps): React.JSX.Element;
|
|
5
|
+
displayName: string;
|
|
6
|
+
};
|
|
7
|
+
//# sourceMappingURL=SegmentGroup.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SegmentGroup.d.mts","sourceRoot":"","sources":["../../../src/components/SegmentGroup/SegmentGroup.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAkB,cAAc;AAMvC,OAAO,KAAK,EAAE,iBAAiB,EAAE,iCAA6B;AAE9D,eAAO,MAAM,YAAY;uGAStB,iBAAiB;;CAiCnB,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
function $importDefault(module) {
|
|
2
|
+
if (module?.__esModule) {
|
|
3
|
+
return module.default;
|
|
4
|
+
}
|
|
5
|
+
return module;
|
|
6
|
+
}
|
|
7
|
+
import { BoxAlignItems, BoxFlexDirection, SegmentGroupContext } from "@metamask-previews/design-system-shared";
|
|
8
|
+
import { useTailwind } from "@metamask-previews/design-system-twrnc-preset";
|
|
9
|
+
import $React, { useMemo } from "react";
|
|
10
|
+
const React = $importDefault($React);
|
|
11
|
+
import { ScrollView } from "react-native";
|
|
12
|
+
import { TWCLASSMAP_BOX_GAP } from "../Box/Box.constants.mjs";
|
|
13
|
+
export const SegmentGroup = ({ value, onChange, variant, children, twClassName, style, contentContainerStyle, ...scrollRest }) => {
|
|
14
|
+
const tw = useTailwind();
|
|
15
|
+
const contextValue = useMemo(() => ({ value, onChange, variant }), [value, onChange, variant]);
|
|
16
|
+
const mergedContentContainerStyle = [
|
|
17
|
+
tw.style('flex', BoxFlexDirection.Row, BoxAlignItems.Center, TWCLASSMAP_BOX_GAP[3], twClassName),
|
|
18
|
+
contentContainerStyle,
|
|
19
|
+
];
|
|
20
|
+
return (<SegmentGroupContext.Provider value={contextValue}>
|
|
21
|
+
<ScrollView {...scrollRest} horizontal showsHorizontalScrollIndicator={false} accessibilityRole="tablist" style={[tw.style('self-stretch'), style]} contentContainerStyle={mergedContentContainerStyle}>
|
|
22
|
+
{children}
|
|
23
|
+
</ScrollView>
|
|
24
|
+
</SegmentGroupContext.Provider>);
|
|
25
|
+
};
|
|
26
|
+
SegmentGroup.displayName = 'SegmentGroup';
|
|
27
|
+
//# sourceMappingURL=SegmentGroup.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SegmentGroup.mjs","sourceRoot":"","sources":["../../../src/components/SegmentGroup/SegmentGroup.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,EACL,aAAa,EACb,gBAAgB,EAChB,mBAAmB,EACpB,gDAAgD;AACjD,OAAO,EAAE,WAAW,EAAE,sDAAsD;AAC5E,OAAO,QAAO,EAAE,OAAO,EAAE,cAAc;;AACvC,OAAO,EAAE,UAAU,EAAE,qBAAqB;AAG1C,OAAO,EAAE,kBAAkB,EAAE,iCAA6B;AAI1D,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,EAC3B,KAAK,EACL,QAAQ,EACR,OAAO,EACP,QAAQ,EACR,WAAW,EACX,KAAK,EACL,qBAAqB,EACrB,GAAG,UAAU,EACK,EAAE,EAAE;IACtB,MAAM,EAAE,GAAG,WAAW,EAAE,CAAC;IAEzB,MAAM,YAAY,GAAG,OAAO,CAC1B,GAAG,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,EACpC,CAAC,KAAK,EAAE,QAAQ,EAAE,OAAO,CAAC,CAC3B,CAAC;IAEF,MAAM,2BAA2B,GAAyB;QACxD,EAAE,CAAC,KAAK,CACN,MAAM,EACN,gBAAgB,CAAC,GAAG,EACpB,aAAa,CAAC,MAAM,EACpB,kBAAkB,CAAC,CAAC,CAAC,EACrB,WAAW,CACZ;QACD,qBAAqB;KACtB,CAAC;IAEF,OAAO,CACL,CAAC,mBAAmB,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,YAAY,CAAC,CAChD;MAAA,CAAC,UAAU,CACT,IAAI,UAAU,CAAC,CACf,UAAU,CACV,8BAA8B,CAAC,CAAC,KAAK,CAAC,CACtC,iBAAiB,CAAC,SAAS,CAC3B,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,cAAc,CAAC,EAAE,KAAK,CAAC,CAAC,CACzC,qBAAqB,CAAC,CAAC,2BAA2B,CAAC,CAEnD;QAAA,CAAC,QAAQ,CACX;MAAA,EAAE,UAAU,CACd;IAAA,EAAE,mBAAmB,CAAC,QAAQ,CAAC,CAChC,CAAC;AACJ,CAAC,CAAC;AAEF,YAAY,CAAC,WAAW,GAAG,cAAc,CAAC","sourcesContent":["import {\n BoxAlignItems,\n BoxFlexDirection,\n SegmentGroupContext,\n} from '@metamask-previews/design-system-shared';\nimport { useTailwind } from '@metamask-previews/design-system-twrnc-preset';\nimport React, { useMemo } from 'react';\nimport { ScrollView } from 'react-native';\nimport type { StyleProp, ViewStyle } from 'react-native';\n\nimport { TWCLASSMAP_BOX_GAP } from '../Box/Box.constants';\n\nimport type { SegmentGroupProps } from './SegmentGroup.types';\n\nexport const SegmentGroup = ({\n value,\n onChange,\n variant,\n children,\n twClassName,\n style,\n contentContainerStyle,\n ...scrollRest\n}: SegmentGroupProps) => {\n const tw = useTailwind();\n\n const contextValue = useMemo(\n () => ({ value, onChange, variant }),\n [value, onChange, variant],\n );\n\n const mergedContentContainerStyle: StyleProp<ViewStyle> = [\n tw.style(\n 'flex',\n BoxFlexDirection.Row,\n BoxAlignItems.Center,\n TWCLASSMAP_BOX_GAP[3],\n twClassName,\n ),\n contentContainerStyle,\n ];\n\n return (\n <SegmentGroupContext.Provider value={contextValue}>\n <ScrollView\n {...scrollRest}\n horizontal\n showsHorizontalScrollIndicator={false}\n accessibilityRole=\"tablist\"\n style={[tw.style('self-stretch'), style]}\n contentContainerStyle={mergedContentContainerStyle}\n >\n {children}\n </ScrollView>\n </SegmentGroupContext.Provider>\n );\n};\n\nSegmentGroup.displayName = 'SegmentGroup';\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SegmentGroup.types.cjs","sourceRoot":"","sources":["../../../src/components/SegmentGroup/SegmentGroup.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { SegmentGroupPropsShared } from '@metamask-previews/design-system-shared';\nimport type { ScrollViewProps } from 'react-native';\n\n/**\n * SegmentGroup component props.\n */\nexport type SegmentGroupProps = SegmentGroupPropsShared &\n Omit<ScrollViewProps, 'horizontal' | 'showsHorizontalScrollIndicator'> & {\n /**\n * Optional twrnc classes merged into `contentContainerStyle` after the default row layout.\n */\n twClassName?: string;\n };\n"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { SegmentGroupPropsShared } from "@metamask-previews/design-system-shared";
|
|
2
|
+
import type { ScrollViewProps } from "react-native";
|
|
3
|
+
/**
|
|
4
|
+
* SegmentGroup component props.
|
|
5
|
+
*/
|
|
6
|
+
export type SegmentGroupProps = SegmentGroupPropsShared & Omit<ScrollViewProps, 'horizontal' | 'showsHorizontalScrollIndicator'> & {
|
|
7
|
+
/**
|
|
8
|
+
* Optional twrnc classes merged into `contentContainerStyle` after the default row layout.
|
|
9
|
+
*/
|
|
10
|
+
twClassName?: string;
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=SegmentGroup.types.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SegmentGroup.types.d.cts","sourceRoot":"","sources":["../../../src/components/SegmentGroup/SegmentGroup.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,gDAAgD;AACvF,OAAO,KAAK,EAAE,eAAe,EAAE,qBAAqB;AAEpD;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG,uBAAuB,GACrD,IAAI,CAAC,eAAe,EAAE,YAAY,GAAG,gCAAgC,CAAC,GAAG;IACvE;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { SegmentGroupPropsShared } from "@metamask-previews/design-system-shared";
|
|
2
|
+
import type { ScrollViewProps } from "react-native";
|
|
3
|
+
/**
|
|
4
|
+
* SegmentGroup component props.
|
|
5
|
+
*/
|
|
6
|
+
export type SegmentGroupProps = SegmentGroupPropsShared & Omit<ScrollViewProps, 'horizontal' | 'showsHorizontalScrollIndicator'> & {
|
|
7
|
+
/**
|
|
8
|
+
* Optional twrnc classes merged into `contentContainerStyle` after the default row layout.
|
|
9
|
+
*/
|
|
10
|
+
twClassName?: string;
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=SegmentGroup.types.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SegmentGroup.types.d.mts","sourceRoot":"","sources":["../../../src/components/SegmentGroup/SegmentGroup.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,gDAAgD;AACvF,OAAO,KAAK,EAAE,eAAe,EAAE,qBAAqB;AAEpD;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG,uBAAuB,GACrD,IAAI,CAAC,eAAe,EAAE,YAAY,GAAG,gCAAgC,CAAC,GAAG;IACvE;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SegmentGroup.types.mjs","sourceRoot":"","sources":["../../../src/components/SegmentGroup/SegmentGroup.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { SegmentGroupPropsShared } from '@metamask-previews/design-system-shared';\nimport type { ScrollViewProps } from 'react-native';\n\n/**\n * SegmentGroup component props.\n */\nexport type SegmentGroupProps = SegmentGroupPropsShared &\n Omit<ScrollViewProps, 'horizontal' | 'showsHorizontalScrollIndicator'> & {\n /**\n * Optional twrnc classes merged into `contentContainerStyle` after the default row layout.\n */\n twClassName?: string;\n };\n"]}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SegmentGroup = void 0;
|
|
4
|
+
var SegmentGroup_1 = require("./SegmentGroup.cjs");
|
|
5
|
+
Object.defineProperty(exports, "SegmentGroup", { enumerable: true, get: function () { return SegmentGroup_1.SegmentGroup; } });
|
|
6
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../../src/components/SegmentGroup/index.ts"],"names":[],"mappings":";;;AAAA,mDAA8C;AAArC,4GAAA,YAAY,OAAA","sourcesContent":["export { SegmentGroup } from './SegmentGroup';\nexport type { SegmentGroupProps } from './SegmentGroup.types';\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/components/SegmentGroup/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,2BAAuB;AAC9C,YAAY,EAAE,iBAAiB,EAAE,iCAA6B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../src/components/SegmentGroup/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,2BAAuB;AAC9C,YAAY,EAAE,iBAAiB,EAAE,iCAA6B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../src/components/SegmentGroup/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,2BAAuB","sourcesContent":["export { SegmentGroup } from './SegmentGroup';\nexport type { SegmentGroupProps } from './SegmentGroup.types';\n"]}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.SelectButton = void 0;
|
|
7
|
+
const design_system_shared_1 = require("@metamask-previews/design-system-shared");
|
|
8
|
+
const react_1 = __importDefault(require("react"));
|
|
9
|
+
const ButtonBase_1 = require("../ButtonBase/index.cjs");
|
|
10
|
+
const Icon_1 = require("../Icon/index.cjs");
|
|
11
|
+
const Text_1 = require("../Text/index.cjs");
|
|
12
|
+
const SelectButton_constants_1 = require("./SelectButton.constants.cjs");
|
|
13
|
+
const SelectButton = ({ placeholder, value, textProps, startAccessory, endArrowDirection, endAccessory, hideEndArrow = false, isDisabled = false, endArrowDirectionIconProps, variant = design_system_shared_1.SelectButtonVariant.Primary, isLoading = false, size = design_system_shared_1.SelectButtonSize.Sm, twClassName = '', style, ...buttonBaseRest }) => {
|
|
14
|
+
const labelContent = value ?? placeholder;
|
|
15
|
+
let resolvedEndArrowDirection;
|
|
16
|
+
if (hideEndArrow) {
|
|
17
|
+
resolvedEndArrowDirection = undefined;
|
|
18
|
+
}
|
|
19
|
+
else if (endArrowDirection !== undefined && endArrowDirection !== null) {
|
|
20
|
+
resolvedEndArrowDirection = endArrowDirection;
|
|
21
|
+
}
|
|
22
|
+
else if (endAccessory) {
|
|
23
|
+
resolvedEndArrowDirection = undefined;
|
|
24
|
+
}
|
|
25
|
+
else {
|
|
26
|
+
resolvedEndArrowDirection = design_system_shared_1.SelectButtonEndArrow.Down;
|
|
27
|
+
}
|
|
28
|
+
return (<ButtonBase_1.ButtonBase {...buttonBaseRest} size={size} isDisabled={isDisabled} isLoading={isLoading} children={labelContent} textProps={{
|
|
29
|
+
...(variant === design_system_shared_1.SelectButtonVariant.Tertiary
|
|
30
|
+
? { color: Text_1.TextColor.TextAlternative }
|
|
31
|
+
: {}),
|
|
32
|
+
...textProps,
|
|
33
|
+
}} startAccessory={startAccessory} endAccessory={resolvedEndArrowDirection ? undefined : endAccessory} endIconName={resolvedEndArrowDirection
|
|
34
|
+
? SelectButton_constants_1.MAP_SELECTBUTTON_END_ARROW_DIRECTION_TO_ICON_NAME[resolvedEndArrowDirection]
|
|
35
|
+
: undefined} endIconProps={resolvedEndArrowDirection
|
|
36
|
+
? {
|
|
37
|
+
...(variant === design_system_shared_1.SelectButtonVariant.Tertiary
|
|
38
|
+
? { color: Icon_1.IconColor.IconAlternative }
|
|
39
|
+
: {}),
|
|
40
|
+
...endArrowDirectionIconProps,
|
|
41
|
+
}
|
|
42
|
+
: undefined} twClassName={(pressed) => variant === design_system_shared_1.SelectButtonVariant.Secondary ||
|
|
43
|
+
variant === design_system_shared_1.SelectButtonVariant.Tertiary
|
|
44
|
+
? `min-w-0 ${pressed || isLoading ? 'bg-pressed' : 'bg-transparent'} border-0 ${typeof twClassName === 'function'
|
|
45
|
+
? twClassName(pressed)
|
|
46
|
+
: twClassName}`
|
|
47
|
+
: `min-w-0 ${pressed || isLoading ? 'bg-muted-pressed' : 'bg-muted'} border-transparent border ${typeof twClassName === 'function'
|
|
48
|
+
? twClassName(pressed)
|
|
49
|
+
: twClassName}`} textClassName={() => variant === design_system_shared_1.SelectButtonVariant.Tertiary ? '' : 'text-default'} iconClassName={() => variant === design_system_shared_1.SelectButtonVariant.Tertiary ? '' : 'text-default'} style={style}/>);
|
|
50
|
+
};
|
|
51
|
+
exports.SelectButton = SelectButton;
|
|
52
|
+
exports.SelectButton.displayName = 'SelectButton';
|
|
53
|
+
//# sourceMappingURL=SelectButton.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SelectButton.cjs","sourceRoot":"","sources":["../../../src/components/SelectButton/SelectButton.tsx"],"names":[],"mappings":";;;;;;AAAA,kFAIiD;AACjD,kDAA0B;AAE1B,wDAA2C;AAC3C,4CAAoC;AACpC,4CAAoC;AAEpC,yEAA6F;AAGtF,MAAM,YAAY,GAAG,CAAC,EAC3B,WAAW,EACX,KAAK,EACL,SAAS,EACT,cAAc,EACd,iBAAiB,EACjB,YAAY,EACZ,YAAY,GAAG,KAAK,EACpB,UAAU,GAAG,KAAK,EAClB,0BAA0B,EAC1B,OAAO,GAAG,0CAAmB,CAAC,OAAO,EACrC,SAAS,GAAG,KAAK,EACjB,IAAI,GAAG,uCAAgB,CAAC,EAAE,EAC1B,WAAW,GAAG,EAAE,EAChB,KAAK,EACL,GAAG,cAAc,EACC,EAAE,EAAE;IACtB,MAAM,YAAY,GAAG,KAAK,IAAI,WAAW,CAAC;IAE1C,IAAI,yBAA2D,CAAC;IAChE,IAAI,YAAY,EAAE;QAChB,yBAAyB,GAAG,SAAS,CAAC;KACvC;SAAM,IAAI,iBAAiB,KAAK,SAAS,IAAI,iBAAiB,KAAK,IAAI,EAAE;QACxE,yBAAyB,GAAG,iBAAiB,CAAC;KAC/C;SAAM,IAAI,YAAY,EAAE;QACvB,yBAAyB,GAAG,SAAS,CAAC;KACvC;SAAM;QACL,yBAAyB,GAAG,2CAAoB,CAAC,IAAI,CAAC;KACvD;IAED,OAAO,CACL,CAAC,uBAAU,CACT,IAAI,cAAc,CAAC,CACnB,IAAI,CAAC,CAAC,IAAI,CAAC,CACX,UAAU,C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CAAC,CAAC,WAAW,CAAC,OAAO,CAAC;gBACtB,CAAC,CAAC,WACN,EAAE,CACP,CACD,aAAa,CAAC,CAAC,GAAG,EAAE,CAClB,OAAO,KAAK,0CAAmB,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,cAAc,CAC/D,CACD,aAAa,CAAC,CAAC,GAAG,EAAE,CAClB,OAAO,KAAK,0CAAmB,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,cAAc,CAC/D,CACD,KAAK,CAAC,CAAC,KAAK,CAAC,EACb,CACH,CAAC;AACJ,CAAC,CAAC;AArFW,QAAA,YAAY,gBAqFvB;AAEF,oBAAY,CAAC,WAAW,GAAG,cAAc,CAAC","sourcesContent":["import {\n SelectButtonEndArrow,\n SelectButtonSize,\n SelectButtonVariant,\n} from '@metamask-previews/design-system-shared';\nimport React from 'react';\n\nimport { ButtonBase } from '../ButtonBase';\nimport { IconColor } from '../Icon';\nimport { TextColor } from '../Text';\n\nimport { MAP_SELECTBUTTON_END_ARROW_DIRECTION_TO_ICON_NAME } from './SelectButton.constants';\nimport type { SelectButtonProps } from './SelectButton.types';\n\nexport const SelectButton = ({\n placeholder,\n value,\n textProps,\n startAccessory,\n endArrowDirection,\n endAccessory,\n hideEndArrow = false,\n isDisabled = false,\n endArrowDirectionIconProps,\n variant = SelectButtonVariant.Primary,\n isLoading = false,\n size = SelectButtonSize.Sm,\n twClassName = '',\n style,\n ...buttonBaseRest\n}: SelectButtonProps) => {\n const labelContent = value ?? placeholder;\n\n let resolvedEndArrowDirection: SelectButtonEndArrow | undefined;\n if (hideEndArrow) {\n resolvedEndArrowDirection = undefined;\n } else if (endArrowDirection !== undefined && endArrowDirection !== null) {\n resolvedEndArrowDirection = endArrowDirection;\n } else if (endAccessory) {\n resolvedEndArrowDirection = undefined;\n } else {\n resolvedEndArrowDirection = SelectButtonEndArrow.Down;\n }\n\n return (\n <ButtonBase\n {...buttonBaseRest}\n size={size}\n isDisabled={isDisabled}\n isLoading={isLoading}\n children={labelContent}\n textProps={{\n ...(variant === SelectButtonVariant.Tertiary\n ? { color: TextColor.TextAlternative }\n : {}),\n ...textProps,\n }}\n startAccessory={startAccessory}\n endAccessory={resolvedEndArrowDirection ? undefined : endAccessory}\n endIconName={\n resolvedEndArrowDirection\n ? MAP_SELECTBUTTON_END_ARROW_DIRECTION_TO_ICON_NAME[\n resolvedEndArrowDirection\n ]\n : undefined\n }\n endIconProps={\n resolvedEndArrowDirection\n ? {\n ...(variant === SelectButtonVariant.Tertiary\n ? { color: IconColor.IconAlternative }\n : {}),\n ...endArrowDirectionIconProps,\n }\n : undefined\n }\n twClassName={(pressed) =>\n variant === SelectButtonVariant.Secondary ||\n variant === SelectButtonVariant.Tertiary\n ? `min-w-0 ${pressed || isLoading ? 'bg-pressed' : 'bg-transparent'} border-0 ${\n typeof twClassName === 'function'\n ? twClassName(pressed)\n : twClassName\n }`\n : `min-w-0 ${pressed || isLoading ? 'bg-muted-pressed' : 'bg-muted'} border-transparent border ${\n typeof twClassName === 'function'\n ? twClassName(pressed)\n : twClassName\n }`\n }\n textClassName={() =>\n variant === SelectButtonVariant.Tertiary ? '' : 'text-default'\n }\n iconClassName={() =>\n variant === SelectButtonVariant.Tertiary ? '' : 'text-default'\n }\n style={style}\n />\n );\n};\n\nSelectButton.displayName = 'SelectButton';\n"]}
|