@metamask-previews/design-system-react-native 0.6.0-preview.3dc70e1 → 0.9.0-preview.694a8ed
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 +69 -1
- package/dist/components/ActionListItem/ActionListItem.cjs +86 -0
- package/dist/components/ActionListItem/ActionListItem.cjs.map +1 -0
- package/dist/components/ActionListItem/ActionListItem.d.cts +4 -0
- package/dist/components/ActionListItem/ActionListItem.d.cts.map +1 -0
- package/dist/components/ActionListItem/ActionListItem.d.mts +4 -0
- package/dist/components/ActionListItem/ActionListItem.d.mts.map +1 -0
- package/dist/components/ActionListItem/ActionListItem.mjs +66 -0
- package/dist/components/ActionListItem/ActionListItem.mjs.map +1 -0
- package/dist/components/ActionListItem/ActionListItem.types.cjs +3 -0
- package/dist/components/ActionListItem/ActionListItem.types.cjs.map +1 -0
- package/dist/components/ActionListItem/ActionListItem.types.d.cts +73 -0
- package/dist/components/ActionListItem/ActionListItem.types.d.cts.map +1 -0
- package/dist/components/ActionListItem/ActionListItem.types.d.mts +73 -0
- package/dist/components/ActionListItem/ActionListItem.types.d.mts.map +1 -0
- package/dist/components/ActionListItem/ActionListItem.types.mjs +2 -0
- package/dist/components/ActionListItem/ActionListItem.types.mjs.map +1 -0
- package/dist/components/ActionListItem/index.cjs +6 -0
- package/dist/components/ActionListItem/index.cjs.map +1 -0
- package/dist/components/ActionListItem/index.d.cts +3 -0
- package/dist/components/ActionListItem/index.d.cts.map +1 -0
- package/dist/components/ActionListItem/index.d.mts +3 -0
- package/dist/components/ActionListItem/index.d.mts.map +1 -0
- package/dist/components/ActionListItem/index.mjs +2 -0
- package/dist/components/ActionListItem/index.mjs.map +1 -0
- package/dist/components/BadgeCount/BadgeCount.cjs +3 -3
- package/dist/components/BadgeCount/BadgeCount.cjs.map +1 -1
- package/dist/components/BadgeCount/BadgeCount.constants.cjs +6 -10
- package/dist/components/BadgeCount/BadgeCount.constants.cjs.map +1 -1
- package/dist/components/BadgeCount/BadgeCount.constants.d.cts +1 -2
- package/dist/components/BadgeCount/BadgeCount.constants.d.cts.map +1 -1
- package/dist/components/BadgeCount/BadgeCount.constants.d.mts +1 -2
- package/dist/components/BadgeCount/BadgeCount.constants.d.mts.map +1 -1
- package/dist/components/BadgeCount/BadgeCount.constants.mjs +3 -7
- package/dist/components/BadgeCount/BadgeCount.constants.mjs.map +1 -1
- package/dist/components/BadgeCount/BadgeCount.d.cts.map +1 -1
- package/dist/components/BadgeCount/BadgeCount.d.mts.map +1 -1
- package/dist/components/BadgeCount/BadgeCount.mjs +3 -3
- package/dist/components/BadgeCount/BadgeCount.mjs.map +1 -1
- package/dist/components/BadgeCount/BadgeCount.types.cjs.map +1 -1
- package/dist/components/BadgeCount/BadgeCount.types.d.cts +5 -22
- package/dist/components/BadgeCount/BadgeCount.types.d.cts.map +1 -1
- package/dist/components/BadgeCount/BadgeCount.types.d.mts +5 -22
- package/dist/components/BadgeCount/BadgeCount.types.d.mts.map +1 -1
- package/dist/components/BadgeCount/BadgeCount.types.mjs.map +1 -1
- package/dist/components/BadgeCount/index.cjs +2 -2
- package/dist/components/BadgeCount/index.cjs.map +1 -1
- package/dist/components/BadgeCount/index.d.cts +1 -1
- package/dist/components/BadgeCount/index.d.cts.map +1 -1
- package/dist/components/BadgeCount/index.d.mts +1 -1
- package/dist/components/BadgeCount/index.d.mts.map +1 -1
- package/dist/components/BadgeCount/index.mjs +1 -1
- package/dist/components/BadgeCount/index.mjs.map +1 -1
- package/dist/components/BadgeStatus/BadgeStatus.types.cjs.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/BadgeStatus/BadgeStatus.types.mjs.map +1 -1
- package/dist/components/BannerBase/BannerBase.cjs +63 -0
- package/dist/components/BannerBase/BannerBase.cjs.map +1 -0
- package/dist/components/BannerBase/BannerBase.d.cts +4 -0
- package/dist/components/BannerBase/BannerBase.d.cts.map +1 -0
- package/dist/components/BannerBase/BannerBase.d.mts +4 -0
- package/dist/components/BannerBase/BannerBase.d.mts.map +1 -0
- package/dist/components/BannerBase/BannerBase.mjs +63 -0
- package/dist/components/BannerBase/BannerBase.mjs.map +1 -0
- package/dist/components/BannerBase/BannerBase.types.cjs +3 -0
- package/dist/components/BannerBase/BannerBase.types.cjs.map +1 -0
- package/dist/components/BannerBase/BannerBase.types.d.cts +53 -0
- package/dist/components/BannerBase/BannerBase.types.d.cts.map +1 -0
- package/dist/components/BannerBase/BannerBase.types.d.mts +53 -0
- package/dist/components/BannerBase/BannerBase.types.d.mts.map +1 -0
- package/dist/components/BannerBase/BannerBase.types.mjs +2 -0
- package/dist/components/BannerBase/BannerBase.types.mjs.map +1 -0
- package/dist/components/BannerBase/index.cjs +6 -0
- package/dist/components/BannerBase/index.cjs.map +1 -0
- package/dist/components/BannerBase/index.d.cts +3 -0
- package/dist/components/BannerBase/index.d.cts.map +1 -0
- package/dist/components/BannerBase/index.d.mts +3 -0
- package/dist/components/BannerBase/index.d.mts.map +1 -0
- package/dist/components/BannerBase/index.mjs +2 -0
- package/dist/components/BannerBase/index.mjs.map +1 -0
- package/dist/components/BottomSheetFooter/BottomSheetFooter.cjs +35 -0
- package/dist/components/BottomSheetFooter/BottomSheetFooter.cjs.map +1 -0
- package/dist/components/BottomSheetFooter/BottomSheetFooter.d.cts +4 -0
- package/dist/components/BottomSheetFooter/BottomSheetFooter.d.cts.map +1 -0
- package/dist/components/BottomSheetFooter/BottomSheetFooter.d.mts +4 -0
- package/dist/components/BottomSheetFooter/BottomSheetFooter.d.mts.map +1 -0
- package/dist/components/BottomSheetFooter/BottomSheetFooter.mjs +35 -0
- package/dist/components/BottomSheetFooter/BottomSheetFooter.mjs.map +1 -0
- package/dist/components/BottomSheetFooter/BottomSheetFooter.types.cjs +12 -0
- package/dist/components/BottomSheetFooter/BottomSheetFooter.types.cjs.map +1 -0
- package/dist/components/BottomSheetFooter/BottomSheetFooter.types.d.cts +41 -0
- package/dist/components/BottomSheetFooter/BottomSheetFooter.types.d.cts.map +1 -0
- package/dist/components/BottomSheetFooter/BottomSheetFooter.types.d.mts +41 -0
- package/dist/components/BottomSheetFooter/BottomSheetFooter.types.d.mts.map +1 -0
- package/dist/components/BottomSheetFooter/BottomSheetFooter.types.mjs +9 -0
- package/dist/components/BottomSheetFooter/BottomSheetFooter.types.mjs.map +1 -0
- package/dist/components/BottomSheetFooter/index.cjs +8 -0
- package/dist/components/BottomSheetFooter/index.cjs.map +1 -0
- package/dist/components/BottomSheetFooter/index.d.cts +4 -0
- package/dist/components/BottomSheetFooter/index.d.cts.map +1 -0
- package/dist/components/BottomSheetFooter/index.d.mts +4 -0
- package/dist/components/BottomSheetFooter/index.d.mts.map +1 -0
- package/dist/components/BottomSheetFooter/index.mjs +3 -0
- package/dist/components/BottomSheetFooter/index.mjs.map +1 -0
- package/dist/components/BottomSheetHeader/BottomSheetHeader.cjs +27 -0
- package/dist/components/BottomSheetHeader/BottomSheetHeader.cjs.map +1 -0
- package/dist/components/BottomSheetHeader/BottomSheetHeader.constants.cjs +15 -0
- package/dist/components/BottomSheetHeader/BottomSheetHeader.constants.cjs.map +1 -0
- package/dist/components/BottomSheetHeader/BottomSheetHeader.constants.d.cts +7 -0
- package/dist/components/BottomSheetHeader/BottomSheetHeader.constants.d.cts.map +1 -0
- package/dist/components/BottomSheetHeader/BottomSheetHeader.constants.d.mts +7 -0
- package/dist/components/BottomSheetHeader/BottomSheetHeader.constants.d.mts.map +1 -0
- package/dist/components/BottomSheetHeader/BottomSheetHeader.constants.mjs +12 -0
- package/dist/components/BottomSheetHeader/BottomSheetHeader.constants.mjs.map +1 -0
- package/dist/components/BottomSheetHeader/BottomSheetHeader.d.cts +4 -0
- package/dist/components/BottomSheetHeader/BottomSheetHeader.d.cts.map +1 -0
- package/dist/components/BottomSheetHeader/BottomSheetHeader.d.mts +4 -0
- package/dist/components/BottomSheetHeader/BottomSheetHeader.d.mts.map +1 -0
- package/dist/components/BottomSheetHeader/BottomSheetHeader.mjs +27 -0
- package/dist/components/BottomSheetHeader/BottomSheetHeader.mjs.map +1 -0
- package/dist/components/BottomSheetHeader/BottomSheetHeader.types.cjs +14 -0
- package/dist/components/BottomSheetHeader/BottomSheetHeader.types.cjs.map +1 -0
- package/dist/components/BottomSheetHeader/BottomSheetHeader.types.d.cts +50 -0
- package/dist/components/BottomSheetHeader/BottomSheetHeader.types.d.cts.map +1 -0
- package/dist/components/BottomSheetHeader/BottomSheetHeader.types.d.mts +50 -0
- package/dist/components/BottomSheetHeader/BottomSheetHeader.types.d.mts.map +1 -0
- package/dist/components/BottomSheetHeader/BottomSheetHeader.types.mjs +11 -0
- package/dist/components/BottomSheetHeader/BottomSheetHeader.types.mjs.map +1 -0
- package/dist/components/BottomSheetHeader/index.cjs +8 -0
- package/dist/components/BottomSheetHeader/index.cjs.map +1 -0
- package/dist/components/BottomSheetHeader/index.d.cts +4 -0
- package/dist/components/BottomSheetHeader/index.d.cts.map +1 -0
- package/dist/components/BottomSheetHeader/index.d.mts +4 -0
- package/dist/components/BottomSheetHeader/index.d.mts.map +1 -0
- package/dist/components/BottomSheetHeader/index.mjs +3 -0
- package/dist/components/BottomSheetHeader/index.mjs.map +1 -0
- package/dist/components/ButtonHero/ButtonHero.cjs +37 -0
- package/dist/components/ButtonHero/ButtonHero.cjs.map +1 -0
- package/dist/components/ButtonHero/ButtonHero.d.cts +13 -0
- package/dist/components/ButtonHero/ButtonHero.d.cts.map +1 -0
- package/dist/components/ButtonHero/ButtonHero.d.mts +13 -0
- package/dist/components/ButtonHero/ButtonHero.d.mts.map +1 -0
- package/dist/components/ButtonHero/ButtonHero.mjs +37 -0
- package/dist/components/ButtonHero/ButtonHero.mjs.map +1 -0
- package/dist/components/ButtonHero/ButtonHero.types.cjs +3 -0
- package/dist/components/ButtonHero/ButtonHero.types.cjs.map +1 -0
- package/dist/components/ButtonHero/ButtonHero.types.d.cts +3 -0
- package/dist/components/ButtonHero/ButtonHero.types.d.cts.map +1 -0
- package/dist/components/ButtonHero/ButtonHero.types.d.mts +3 -0
- package/dist/components/ButtonHero/ButtonHero.types.d.mts.map +1 -0
- package/dist/components/ButtonHero/ButtonHero.types.mjs +2 -0
- package/dist/components/ButtonHero/ButtonHero.types.mjs.map +1 -0
- package/dist/components/ButtonHero/index.cjs +8 -0
- package/dist/components/ButtonHero/index.cjs.map +1 -0
- package/dist/components/ButtonHero/index.d.cts +4 -0
- package/dist/components/ButtonHero/index.d.cts.map +1 -0
- package/dist/components/ButtonHero/index.d.mts +4 -0
- package/dist/components/ButtonHero/index.d.mts.map +1 -0
- package/dist/components/ButtonHero/index.mjs +3 -0
- package/dist/components/ButtonHero/index.mjs.map +1 -0
- package/dist/components/ButtonSemantic/ButtonSemantic.cjs +64 -0
- package/dist/components/ButtonSemantic/ButtonSemantic.cjs.map +1 -0
- package/dist/components/ButtonSemantic/ButtonSemantic.constants.cjs +17 -0
- package/dist/components/ButtonSemantic/ButtonSemantic.constants.cjs.map +1 -0
- package/dist/components/ButtonSemantic/ButtonSemantic.constants.d.cts +5 -0
- package/dist/components/ButtonSemantic/ButtonSemantic.constants.d.cts.map +1 -0
- package/dist/components/ButtonSemantic/ButtonSemantic.constants.d.mts +5 -0
- package/dist/components/ButtonSemantic/ButtonSemantic.constants.d.mts.map +1 -0
- package/dist/components/ButtonSemantic/ButtonSemantic.constants.mjs +14 -0
- package/dist/components/ButtonSemantic/ButtonSemantic.constants.mjs.map +1 -0
- package/dist/components/ButtonSemantic/ButtonSemantic.d.cts +4 -0
- package/dist/components/ButtonSemantic/ButtonSemantic.d.cts.map +1 -0
- package/dist/components/ButtonSemantic/ButtonSemantic.d.mts +4 -0
- package/dist/components/ButtonSemantic/ButtonSemantic.d.mts.map +1 -0
- package/dist/components/ButtonSemantic/ButtonSemantic.mjs +44 -0
- package/dist/components/ButtonSemantic/ButtonSemantic.mjs.map +1 -0
- package/dist/components/ButtonSemantic/ButtonSemantic.types.cjs +18 -0
- package/dist/components/ButtonSemantic/ButtonSemantic.types.cjs.map +1 -0
- package/dist/components/ButtonSemantic/ButtonSemantic.types.d.cts +30 -0
- package/dist/components/ButtonSemantic/ButtonSemantic.types.d.cts.map +1 -0
- package/dist/components/ButtonSemantic/ButtonSemantic.types.d.mts +30 -0
- package/dist/components/ButtonSemantic/ButtonSemantic.types.d.mts.map +1 -0
- package/dist/components/ButtonSemantic/ButtonSemantic.types.mjs +15 -0
- package/dist/components/ButtonSemantic/ButtonSemantic.types.mjs.map +1 -0
- package/dist/components/ButtonSemantic/index.cjs +8 -0
- package/dist/components/ButtonSemantic/index.cjs.map +1 -0
- package/dist/components/ButtonSemantic/index.d.cts +4 -0
- package/dist/components/ButtonSemantic/index.d.cts.map +1 -0
- package/dist/components/ButtonSemantic/index.d.mts +4 -0
- package/dist/components/ButtonSemantic/index.d.mts.map +1 -0
- package/dist/components/ButtonSemantic/index.mjs +3 -0
- package/dist/components/ButtonSemantic/index.mjs.map +1 -0
- package/dist/components/Card/Card.cjs +26 -0
- package/dist/components/Card/Card.cjs.map +1 -0
- package/dist/components/Card/Card.d.cts +4 -0
- package/dist/components/Card/Card.d.cts.map +1 -0
- package/dist/components/Card/Card.d.mts +4 -0
- package/dist/components/Card/Card.d.mts.map +1 -0
- package/dist/components/Card/Card.mjs +26 -0
- package/dist/components/Card/Card.mjs.map +1 -0
- package/dist/components/Card/Card.types.cjs +3 -0
- package/dist/components/Card/Card.types.cjs.map +1 -0
- package/dist/components/Card/Card.types.d.cts +25 -0
- package/dist/components/Card/Card.types.d.cts.map +1 -0
- package/dist/components/Card/Card.types.d.mts +25 -0
- package/dist/components/Card/Card.types.d.mts.map +1 -0
- package/dist/components/Card/Card.types.mjs +2 -0
- package/dist/components/Card/Card.types.mjs.map +1 -0
- package/dist/components/Card/index.cjs +6 -0
- package/dist/components/Card/index.cjs.map +1 -0
- package/dist/components/Card/index.d.cts +3 -0
- package/dist/components/Card/index.d.cts.map +1 -0
- package/dist/components/Card/index.d.mts +3 -0
- package/dist/components/Card/index.d.mts.map +1 -0
- package/dist/components/Card/index.mjs +2 -0
- package/dist/components/Card/index.mjs.map +1 -0
- package/dist/components/HeaderBase/HeaderBase.cjs +132 -0
- package/dist/components/HeaderBase/HeaderBase.cjs.map +1 -0
- package/dist/components/HeaderBase/HeaderBase.constants.cjs +15 -0
- package/dist/components/HeaderBase/HeaderBase.constants.cjs.map +1 -0
- package/dist/components/HeaderBase/HeaderBase.constants.d.cts +7 -0
- package/dist/components/HeaderBase/HeaderBase.constants.d.cts.map +1 -0
- package/dist/components/HeaderBase/HeaderBase.constants.d.mts +7 -0
- package/dist/components/HeaderBase/HeaderBase.constants.d.mts.map +1 -0
- package/dist/components/HeaderBase/HeaderBase.constants.mjs +12 -0
- package/dist/components/HeaderBase/HeaderBase.constants.mjs.map +1 -0
- package/dist/components/HeaderBase/HeaderBase.d.cts +4 -0
- package/dist/components/HeaderBase/HeaderBase.d.cts.map +1 -0
- package/dist/components/HeaderBase/HeaderBase.d.mts +4 -0
- package/dist/components/HeaderBase/HeaderBase.d.mts.map +1 -0
- package/dist/components/HeaderBase/HeaderBase.mjs +112 -0
- package/dist/components/HeaderBase/HeaderBase.mjs.map +1 -0
- package/dist/components/HeaderBase/HeaderBase.types.cjs +15 -0
- package/dist/components/HeaderBase/HeaderBase.types.cjs.map +1 -0
- package/dist/components/HeaderBase/HeaderBase.types.d.cts +87 -0
- package/dist/components/HeaderBase/HeaderBase.types.d.cts.map +1 -0
- package/dist/components/HeaderBase/HeaderBase.types.d.mts +87 -0
- package/dist/components/HeaderBase/HeaderBase.types.d.mts.map +1 -0
- package/dist/components/HeaderBase/HeaderBase.types.mjs +12 -0
- package/dist/components/HeaderBase/HeaderBase.types.mjs.map +1 -0
- package/dist/components/HeaderBase/index.cjs +8 -0
- package/dist/components/HeaderBase/index.cjs.map +1 -0
- package/dist/components/HeaderBase/index.d.cts +4 -0
- package/dist/components/HeaderBase/index.d.cts.map +1 -0
- package/dist/components/HeaderBase/index.d.mts +4 -0
- package/dist/components/HeaderBase/index.d.mts.map +1 -0
- package/dist/components/HeaderBase/index.mjs +3 -0
- package/dist/components/HeaderBase/index.mjs.map +1 -0
- package/dist/components/Icon/Icon.assets.cjs +2 -0
- package/dist/components/Icon/Icon.assets.cjs.map +1 -1
- package/dist/components/Icon/Icon.assets.d.cts.map +1 -1
- package/dist/components/Icon/Icon.assets.d.mts.map +1 -1
- package/dist/components/Icon/Icon.assets.mjs +2 -0
- package/dist/components/Icon/Icon.assets.mjs.map +1 -1
- package/dist/components/Icon/assets/corporate-fare.svg +1 -0
- package/dist/components/Input/Input.cjs +53 -0
- package/dist/components/Input/Input.cjs.map +1 -0
- package/dist/components/Input/Input.d.cts +10 -0
- package/dist/components/Input/Input.d.cts.map +1 -0
- package/dist/components/Input/Input.d.mts +10 -0
- package/dist/components/Input/Input.d.mts.map +1 -0
- package/dist/components/Input/Input.mjs +50 -0
- package/dist/components/Input/Input.mjs.map +1 -0
- package/dist/components/Input/Input.types.cjs +3 -0
- package/dist/components/Input/Input.types.cjs.map +1 -0
- package/dist/components/Input/Input.types.d.cts +33 -0
- package/dist/components/Input/Input.types.d.cts.map +1 -0
- package/dist/components/Input/Input.types.d.mts +33 -0
- package/dist/components/Input/Input.types.d.mts.map +1 -0
- package/dist/components/Input/Input.types.mjs +2 -0
- package/dist/components/Input/Input.types.mjs.map +1 -0
- package/dist/components/Input/index.cjs +6 -0
- package/dist/components/Input/index.cjs.map +1 -0
- package/dist/components/Input/index.d.cts +3 -0
- package/dist/components/Input/index.d.cts.map +1 -0
- package/dist/components/Input/index.d.mts +3 -0
- package/dist/components/Input/index.d.mts.map +1 -0
- package/dist/components/Input/index.mjs +2 -0
- package/dist/components/Input/index.mjs.map +1 -0
- package/dist/components/Label/Label.cjs +11 -0
- package/dist/components/Label/Label.cjs.map +1 -0
- package/dist/components/Label/Label.d.cts +4 -0
- package/dist/components/Label/Label.d.cts.map +1 -0
- package/dist/components/Label/Label.d.mts +4 -0
- package/dist/components/Label/Label.d.mts.map +1 -0
- package/dist/components/Label/Label.mjs +11 -0
- package/dist/components/Label/Label.mjs.map +1 -0
- package/dist/components/Label/Label.types.cjs +3 -0
- package/dist/components/Label/Label.types.cjs.map +1 -0
- package/dist/components/Label/Label.types.d.cts +9 -0
- package/dist/components/Label/Label.types.d.cts.map +1 -0
- package/dist/components/Label/Label.types.d.mts +9 -0
- package/dist/components/Label/Label.types.d.mts.map +1 -0
- package/dist/components/Label/Label.types.mjs +2 -0
- package/dist/components/Label/Label.types.mjs.map +1 -0
- package/dist/components/Label/index.cjs +6 -0
- package/dist/components/Label/index.cjs.map +1 -0
- package/dist/components/Label/index.d.cts +3 -0
- package/dist/components/Label/index.d.cts.map +1 -0
- package/dist/components/Label/index.d.mts +3 -0
- package/dist/components/Label/index.d.mts.map +1 -0
- package/dist/components/Label/index.mjs +2 -0
- package/dist/components/Label/index.mjs.map +1 -0
- package/dist/components/RadioButton/RadioButton.cjs +58 -0
- package/dist/components/RadioButton/RadioButton.cjs.map +1 -0
- package/dist/components/RadioButton/RadioButton.constants.cjs +12 -0
- package/dist/components/RadioButton/RadioButton.constants.cjs.map +1 -0
- package/dist/components/RadioButton/RadioButton.constants.d.cts +3 -0
- package/dist/components/RadioButton/RadioButton.constants.d.cts.map +1 -0
- package/dist/components/RadioButton/RadioButton.constants.d.mts +3 -0
- package/dist/components/RadioButton/RadioButton.constants.d.mts.map +1 -0
- package/dist/components/RadioButton/RadioButton.constants.mjs +9 -0
- package/dist/components/RadioButton/RadioButton.constants.mjs.map +1 -0
- package/dist/components/RadioButton/RadioButton.d.cts +4 -0
- package/dist/components/RadioButton/RadioButton.d.cts.map +1 -0
- package/dist/components/RadioButton/RadioButton.d.mts +4 -0
- package/dist/components/RadioButton/RadioButton.d.mts.map +1 -0
- package/dist/components/RadioButton/RadioButton.mjs +58 -0
- package/dist/components/RadioButton/RadioButton.mjs.map +1 -0
- package/dist/components/RadioButton/RadioButton.types.cjs +3 -0
- package/dist/components/RadioButton/RadioButton.types.cjs.map +1 -0
- package/dist/components/RadioButton/RadioButton.types.d.cts +64 -0
- package/dist/components/RadioButton/RadioButton.types.d.cts.map +1 -0
- package/dist/components/RadioButton/RadioButton.types.d.mts +64 -0
- package/dist/components/RadioButton/RadioButton.types.d.mts.map +1 -0
- package/dist/components/RadioButton/RadioButton.types.mjs +2 -0
- package/dist/components/RadioButton/RadioButton.types.mjs.map +1 -0
- package/dist/components/RadioButton/index.cjs +6 -0
- package/dist/components/RadioButton/index.cjs.map +1 -0
- package/dist/components/RadioButton/index.d.cts +3 -0
- package/dist/components/RadioButton/index.d.cts.map +1 -0
- package/dist/components/RadioButton/index.d.mts +3 -0
- package/dist/components/RadioButton/index.d.mts.map +1 -0
- package/dist/components/RadioButton/index.mjs +2 -0
- package/dist/components/RadioButton/index.mjs.map +1 -0
- package/dist/components/SensitiveText/SensitiveText.cjs +47 -0
- package/dist/components/SensitiveText/SensitiveText.cjs.map +1 -0
- package/dist/components/SensitiveText/SensitiveText.constants.cjs +14 -0
- package/dist/components/SensitiveText/SensitiveText.constants.cjs.map +1 -0
- package/dist/components/SensitiveText/SensitiveText.constants.d.cts +11 -0
- package/dist/components/SensitiveText/SensitiveText.constants.d.cts.map +1 -0
- package/dist/components/SensitiveText/SensitiveText.constants.d.mts +11 -0
- package/dist/components/SensitiveText/SensitiveText.constants.d.mts.map +1 -0
- package/dist/components/SensitiveText/SensitiveText.constants.mjs +11 -0
- package/dist/components/SensitiveText/SensitiveText.constants.mjs.map +1 -0
- package/dist/components/SensitiveText/SensitiveText.d.cts +4 -0
- package/dist/components/SensitiveText/SensitiveText.d.cts.map +1 -0
- package/dist/components/SensitiveText/SensitiveText.d.mts +4 -0
- package/dist/components/SensitiveText/SensitiveText.d.mts.map +1 -0
- package/dist/components/SensitiveText/SensitiveText.mjs +27 -0
- package/dist/components/SensitiveText/SensitiveText.mjs.map +1 -0
- package/dist/components/SensitiveText/SensitiveText.types.cjs +3 -0
- package/dist/components/SensitiveText/SensitiveText.types.cjs.map +1 -0
- package/dist/components/SensitiveText/SensitiveText.types.d.cts +38 -0
- package/dist/components/SensitiveText/SensitiveText.types.d.cts.map +1 -0
- package/dist/components/SensitiveText/SensitiveText.types.d.mts +38 -0
- package/dist/components/SensitiveText/SensitiveText.types.d.mts.map +1 -0
- package/dist/components/SensitiveText/SensitiveText.types.mjs +2 -0
- package/dist/components/SensitiveText/SensitiveText.types.mjs.map +1 -0
- package/dist/components/SensitiveText/index.cjs +8 -0
- package/dist/components/SensitiveText/index.cjs.map +1 -0
- package/dist/components/SensitiveText/index.d.cts +4 -0
- package/dist/components/SensitiveText/index.d.cts.map +1 -0
- package/dist/components/SensitiveText/index.d.mts +4 -0
- package/dist/components/SensitiveText/index.d.mts.map +1 -0
- package/dist/components/SensitiveText/index.mjs +3 -0
- package/dist/components/SensitiveText/index.mjs.map +1 -0
- package/dist/components/Skeleton/Skeleton.cjs +86 -0
- package/dist/components/Skeleton/Skeleton.cjs.map +1 -0
- package/dist/components/Skeleton/Skeleton.d.cts +5 -0
- package/dist/components/Skeleton/Skeleton.d.cts.map +1 -0
- package/dist/components/Skeleton/Skeleton.d.mts +5 -0
- package/dist/components/Skeleton/Skeleton.d.mts.map +1 -0
- package/dist/components/Skeleton/Skeleton.mjs +68 -0
- package/dist/components/Skeleton/Skeleton.mjs.map +1 -0
- package/dist/components/Skeleton/Skeleton.types.cjs +3 -0
- package/dist/components/Skeleton/Skeleton.types.cjs.map +1 -0
- package/dist/components/Skeleton/Skeleton.types.d.cts +51 -0
- package/dist/components/Skeleton/Skeleton.types.d.cts.map +1 -0
- package/dist/components/Skeleton/Skeleton.types.d.mts +51 -0
- package/dist/components/Skeleton/Skeleton.types.d.mts.map +1 -0
- package/dist/components/Skeleton/Skeleton.types.mjs +2 -0
- package/dist/components/Skeleton/Skeleton.types.mjs.map +1 -0
- package/dist/components/Skeleton/index.cjs +9 -0
- package/dist/components/Skeleton/index.cjs.map +1 -0
- package/dist/components/Skeleton/index.d.cts +3 -0
- package/dist/components/Skeleton/index.d.cts.map +1 -0
- package/dist/components/Skeleton/index.d.mts +3 -0
- package/dist/components/Skeleton/index.d.mts.map +1 -0
- package/dist/components/Skeleton/index.mjs +2 -0
- package/dist/components/Skeleton/index.mjs.map +1 -0
- package/dist/components/TextField/TextField.cjs +42 -0
- package/dist/components/TextField/TextField.cjs.map +1 -0
- package/dist/components/TextField/TextField.constants.cjs +13 -0
- package/dist/components/TextField/TextField.constants.cjs.map +1 -0
- package/dist/components/TextField/TextField.constants.d.cts +6 -0
- package/dist/components/TextField/TextField.constants.d.cts.map +1 -0
- package/dist/components/TextField/TextField.constants.d.mts +6 -0
- package/dist/components/TextField/TextField.constants.d.mts.map +1 -0
- package/dist/components/TextField/TextField.constants.mjs +10 -0
- package/dist/components/TextField/TextField.constants.mjs.map +1 -0
- package/dist/components/TextField/TextField.d.cts +12 -0
- package/dist/components/TextField/TextField.d.cts.map +1 -0
- package/dist/components/TextField/TextField.d.mts +12 -0
- package/dist/components/TextField/TextField.d.mts.map +1 -0
- package/dist/components/TextField/TextField.mjs +39 -0
- package/dist/components/TextField/TextField.mjs.map +1 -0
- package/dist/components/TextField/TextField.types.cjs +13 -0
- package/dist/components/TextField/TextField.types.cjs.map +1 -0
- package/dist/components/TextField/TextField.types.d.cts +49 -0
- package/dist/components/TextField/TextField.types.d.cts.map +1 -0
- package/dist/components/TextField/TextField.types.d.mts +49 -0
- package/dist/components/TextField/TextField.types.d.mts.map +1 -0
- package/dist/components/TextField/TextField.types.mjs +10 -0
- package/dist/components/TextField/TextField.types.mjs.map +1 -0
- package/dist/components/TextField/index.cjs +8 -0
- package/dist/components/TextField/index.cjs.map +1 -0
- package/dist/components/TextField/index.d.cts +4 -0
- package/dist/components/TextField/index.d.cts.map +1 -0
- package/dist/components/TextField/index.d.mts +4 -0
- package/dist/components/TextField/index.d.mts.map +1 -0
- package/dist/components/TextField/index.mjs +3 -0
- package/dist/components/TextField/index.mjs.map +1 -0
- package/dist/components/Toast/Toast.cjs +174 -0
- package/dist/components/Toast/Toast.cjs.map +1 -0
- package/dist/components/Toast/Toast.constants.cjs +12 -0
- package/dist/components/Toast/Toast.constants.cjs.map +1 -0
- package/dist/components/Toast/Toast.constants.d.cts +8 -0
- package/dist/components/Toast/Toast.constants.d.cts.map +1 -0
- package/dist/components/Toast/Toast.constants.d.mts +8 -0
- package/dist/components/Toast/Toast.constants.d.mts.map +1 -0
- package/dist/components/Toast/Toast.constants.mjs +9 -0
- package/dist/components/Toast/Toast.constants.mjs.map +1 -0
- package/dist/components/Toast/Toast.context.cjs +40 -0
- package/dist/components/Toast/Toast.context.cjs.map +1 -0
- package/dist/components/Toast/Toast.context.d.cts +7 -0
- package/dist/components/Toast/Toast.context.d.cts.map +1 -0
- package/dist/components/Toast/Toast.context.d.mts +7 -0
- package/dist/components/Toast/Toast.context.d.mts.map +1 -0
- package/dist/components/Toast/Toast.context.mjs +20 -0
- package/dist/components/Toast/Toast.context.mjs.map +1 -0
- package/dist/components/Toast/Toast.d.cts +8 -0
- package/dist/components/Toast/Toast.d.cts.map +1 -0
- package/dist/components/Toast/Toast.d.mts +8 -0
- package/dist/components/Toast/Toast.d.mts.map +1 -0
- package/dist/components/Toast/Toast.mjs +156 -0
- package/dist/components/Toast/Toast.mjs.map +1 -0
- package/dist/components/Toast/Toast.types.cjs +19 -0
- package/dist/components/Toast/Toast.types.cjs.map +1 -0
- package/dist/components/Toast/Toast.types.d.cts +123 -0
- package/dist/components/Toast/Toast.types.d.cts.map +1 -0
- package/dist/components/Toast/Toast.types.d.mts +123 -0
- package/dist/components/Toast/Toast.types.d.mts.map +1 -0
- package/dist/components/Toast/Toast.types.mjs +16 -0
- package/dist/components/Toast/Toast.types.mjs.map +1 -0
- package/dist/components/Toast/index.cjs +19 -0
- package/dist/components/Toast/index.cjs.map +1 -0
- package/dist/components/Toast/index.d.cts +6 -0
- package/dist/components/Toast/index.d.cts.map +1 -0
- package/dist/components/Toast/index.d.mts +6 -0
- package/dist/components/Toast/index.d.mts.map +1 -0
- package/dist/components/Toast/index.mjs +5 -0
- package/dist/components/Toast/index.mjs.map +1 -0
- package/dist/components/index.cjs +38 -2
- package/dist/components/index.cjs.map +1 -1
- package/dist/components/index.d.cts +28 -0
- package/dist/components/index.d.cts.map +1 -1
- package/dist/components/index.d.mts +28 -0
- package/dist/components/index.d.mts.map +1 -1
- package/dist/components/index.mjs +14 -0
- package/dist/components/index.mjs.map +1 -1
- package/dist/types/index.cjs +3 -16
- package/dist/types/index.cjs.map +1 -1
- package/dist/types/index.d.cts +2 -13
- package/dist/types/index.d.cts.map +1 -1
- package/dist/types/index.d.mts +2 -13
- package/dist/types/index.d.mts.map +1 -1
- package/dist/types/index.mjs +2 -14
- package/dist/types/index.mjs.map +1 -1
- package/package.json +5 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BadgeCount.constants.d.mts","sourceRoot":"","sources":["../../../src/components/BadgeCount/BadgeCount.constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,
|
|
1
|
+
{"version":3,"file":"BadgeCount.constants.d.mts","sourceRoot":"","sources":["../../../src/components/BadgeCount/BadgeCount.constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,gDAAgD;AAEzE,OAAO,EAAE,WAAW,EAAE,0BAAgB;AAGtC,eAAO,MAAM,+BAA+B,EAAE,MAAM,CAClD,cAAc,EACd,WAAW,CAIZ,CAAC;AAEF,eAAO,MAAM,oCAAoC,EAAE,MAAM,CACvD,cAAc,EACd,MAAM,CAIP,CAAC"}
|
|
@@ -1,16 +1,12 @@
|
|
|
1
|
-
import { BadgeCountSize } from "
|
|
1
|
+
import { BadgeCountSize } from "@metamask-previews/design-system-shared";
|
|
2
2
|
import { TextVariant } from "../Text/index.mjs";
|
|
3
3
|
// Mappings
|
|
4
4
|
export const MAP_BADGECOUNT_SIZE_TEXTVARIANT = {
|
|
5
5
|
[BadgeCountSize.Md]: TextVariant.BodyXs,
|
|
6
6
|
[BadgeCountSize.Lg]: TextVariant.BodySm,
|
|
7
7
|
};
|
|
8
|
-
export const MAP_BADGECOUNT_SIZE_LINEHEIGHT = {
|
|
9
|
-
[BadgeCountSize.Md]: 'leading-[14px]',
|
|
10
|
-
[BadgeCountSize.Lg]: 'leading-4', // line-height 16px
|
|
11
|
-
};
|
|
12
8
|
export const TWCLASSMAP_BADGECOUNT_SIZE_CONTAINER = {
|
|
13
|
-
[BadgeCountSize.Md]: 'min-w-4 h-
|
|
14
|
-
[BadgeCountSize.Lg]: 'min-w-6 h-5
|
|
9
|
+
[BadgeCountSize.Md]: 'min-w-4 h-4 px-1',
|
|
10
|
+
[BadgeCountSize.Lg]: 'min-w-6 h-5 px-1.5', // min-width 24px, height 20px, padding-horizontal 6
|
|
15
11
|
};
|
|
16
12
|
//# sourceMappingURL=BadgeCount.constants.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BadgeCount.constants.mjs","sourceRoot":"","sources":["../../../src/components/BadgeCount/BadgeCount.constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,
|
|
1
|
+
{"version":3,"file":"BadgeCount.constants.mjs","sourceRoot":"","sources":["../../../src/components/BadgeCount/BadgeCount.constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,gDAAgD;AAEzE,OAAO,EAAE,WAAW,EAAE,0BAAgB;AAEtC,WAAW;AACX,MAAM,CAAC,MAAM,+BAA+B,GAGxC;IACF,CAAC,cAAc,CAAC,EAAE,CAAC,EAAE,WAAW,CAAC,MAAM;IACvC,CAAC,cAAc,CAAC,EAAE,CAAC,EAAE,WAAW,CAAC,MAAM;CACxC,CAAC;AAEF,MAAM,CAAC,MAAM,oCAAoC,GAG7C;IACF,CAAC,cAAc,CAAC,EAAE,CAAC,EAAE,kBAAkB;IACvC,CAAC,cAAc,CAAC,EAAE,CAAC,EAAE,oBAAoB,EAAE,oDAAoD;CAChG,CAAC","sourcesContent":["import { BadgeCountSize } from '@metamask-previews/design-system-shared';\n\nimport { TextVariant } from '../Text';\n\n// Mappings\nexport const MAP_BADGECOUNT_SIZE_TEXTVARIANT: Record<\n BadgeCountSize,\n TextVariant\n> = {\n [BadgeCountSize.Md]: TextVariant.BodyXs,\n [BadgeCountSize.Lg]: TextVariant.BodySm,\n};\n\nexport const TWCLASSMAP_BADGECOUNT_SIZE_CONTAINER: Record<\n BadgeCountSize,\n string\n> = {\n [BadgeCountSize.Md]: 'min-w-4 h-4 px-1', // min-width 16px, height 14px, padding-horizontal 4\n [BadgeCountSize.Lg]: 'min-w-6 h-5 px-1.5', // min-width 24px, height 20px, padding-horizontal 6\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BadgeCount.d.cts","sourceRoot":"","sources":["../../../src/components/BadgeCount/BadgeCount.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"BadgeCount.d.cts","sourceRoot":"","sources":["../../../src/components/BadgeCount/BadgeCount.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,cAAc;AAS1B,OAAO,KAAK,EAAE,eAAe,EAAE,+BAA2B;AAE1D,eAAO,MAAM,UAAU,kEAQpB,eAAe,sBA0BjB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BadgeCount.d.mts","sourceRoot":"","sources":["../../../src/components/BadgeCount/BadgeCount.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"BadgeCount.d.mts","sourceRoot":"","sources":["../../../src/components/BadgeCount/BadgeCount.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,cAAc;AAS1B,OAAO,KAAK,EAAE,eAAe,EAAE,+BAA2B;AAE1D,eAAO,MAAM,UAAU,kEAQpB,eAAe,sBA0BjB,CAAC"}
|
|
@@ -4,20 +4,20 @@ function $importDefault(module) {
|
|
|
4
4
|
}
|
|
5
5
|
return module;
|
|
6
6
|
}
|
|
7
|
+
import { BadgeCountSize } from "@metamask-previews/design-system-shared";
|
|
7
8
|
import { useTailwind } from "@metamask-previews/design-system-twrnc-preset";
|
|
8
9
|
import $React from "react";
|
|
9
10
|
const React = $importDefault($React);
|
|
10
11
|
import { View } from "react-native/index.js";
|
|
11
|
-
import { BadgeCountSize } from "../../types/index.mjs";
|
|
12
12
|
import { Text, TextColor, FontWeight } from "../Text/index.mjs";
|
|
13
|
-
import { MAP_BADGECOUNT_SIZE_TEXTVARIANT, TWCLASSMAP_BADGECOUNT_SIZE_CONTAINER
|
|
13
|
+
import { MAP_BADGECOUNT_SIZE_TEXTVARIANT, TWCLASSMAP_BADGECOUNT_SIZE_CONTAINER } from "./BadgeCount.constants.mjs";
|
|
14
14
|
export const BadgeCount = ({ size = BadgeCountSize.Md, count, max = 99, textProps, twClassName, style, ...props }) => {
|
|
15
15
|
const tw = useTailwind();
|
|
16
16
|
return (<View {...props} style={[
|
|
17
17
|
tw.style('bg-error-default rounded-lg items-center justify-center self-start', TWCLASSMAP_BADGECOUNT_SIZE_CONTAINER[size], twClassName),
|
|
18
18
|
style,
|
|
19
19
|
]}>
|
|
20
|
-
<Text variant={MAP_BADGECOUNT_SIZE_TEXTVARIANT[size]} color={TextColor.ErrorInverse} fontWeight={FontWeight.Medium} {...textProps} twClassName={
|
|
20
|
+
<Text variant={MAP_BADGECOUNT_SIZE_TEXTVARIANT[size]} color={TextColor.ErrorInverse} fontWeight={FontWeight.Medium} {...textProps} twClassName={`leading-0 ${textProps?.twClassName || ''}`}>
|
|
21
21
|
{count > max ? `${max}+` : `${count}`}
|
|
22
22
|
</Text>
|
|
23
23
|
</View>);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BadgeCount.mjs","sourceRoot":"","sources":["../../../src/components/BadgeCount/BadgeCount.tsx"],"names":[],"mappings":";;;;;;AAAA,O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AG,GAAG,CAAC,CAAC,CAAC,GAAG,KAAK,EAAE,CACvC;MAAA,EAAE,IAAI,CACR;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { BadgeCountSize } 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 { Text, TextColor, FontWeight } from '../Text';\n\nimport {\n MAP_BADGECOUNT_SIZE_TEXTVARIANT,\n TWCLASSMAP_BADGECOUNT_SIZE_CONTAINER,\n} from './BadgeCount.constants';\nimport type { BadgeCountProps } from './BadgeCount.types';\n\nexport const BadgeCount = ({\n size = BadgeCountSize.Md,\n count,\n max = 99,\n textProps,\n twClassName,\n style,\n ...props\n}: BadgeCountProps) => {\n const tw = useTailwind();\n\n return (\n <View\n {...props}\n style={[\n tw.style(\n 'bg-error-default rounded-lg items-center justify-center self-start',\n TWCLASSMAP_BADGECOUNT_SIZE_CONTAINER[size],\n twClassName,\n ),\n style,\n ]}\n >\n <Text\n variant={MAP_BADGECOUNT_SIZE_TEXTVARIANT[size]}\n color={TextColor.ErrorInverse}\n fontWeight={FontWeight.Medium}\n {...textProps}\n twClassName={`leading-0 ${textProps?.twClassName || ''}`}\n >\n {count > max ? `${max}+` : `${count}`}\n </Text>\n </View>\n );\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BadgeCount.types.cjs","sourceRoot":"","sources":["../../../src/components/BadgeCount/BadgeCount.types.ts"],"names":[],"mappings":"","sourcesContent":["
|
|
1
|
+
{"version":3,"file":"BadgeCount.types.cjs","sourceRoot":"","sources":["../../../src/components/BadgeCount/BadgeCount.types.ts"],"names":[],"mappings":"","sourcesContent":["// Import shared type for extension\nimport type { BadgeCountPropsShared } from '@metamask-previews/design-system-shared';\nimport type { ViewProps, StyleProp, ViewStyle } from 'react-native';\n\nimport type { TextProps } from '../Text';\n\n/**\n * BadgeCount component props (React Native platform-specific)\n * Extends shared props with React Native-specific platform concerns\n */\nexport type BadgeCountProps = BadgeCountPropsShared &\n Omit<ViewProps, 'children'> & {\n /**\n * Optional props to be passed to the Text component used by count\n */\n textProps?: Partial<TextProps>;\n /**\n * Optional prop to add twrnc overriding classNames.\n */\n twClassName?: string;\n /**\n * Optional prop to control the style.\n */\n style?: StyleProp<ViewStyle>;\n };\n"]}
|
|
@@ -1,28 +1,11 @@
|
|
|
1
|
+
import type { BadgeCountPropsShared } from "@metamask-previews/design-system-shared";
|
|
1
2
|
import type { ViewProps, StyleProp, ViewStyle } from "react-native/index.js";
|
|
2
|
-
import type { BadgeCountSize } from "../../types/index.cjs";
|
|
3
3
|
import type { TextProps } from "../Text/index.cjs";
|
|
4
4
|
/**
|
|
5
|
-
* BadgeCount component props
|
|
5
|
+
* BadgeCount component props (React Native platform-specific)
|
|
6
|
+
* Extends shared props with React Native-specific platform concerns
|
|
6
7
|
*/
|
|
7
|
-
export type BadgeCountProps = {
|
|
8
|
-
/**
|
|
9
|
-
* Optional prop to control the size of the BadgeCount
|
|
10
|
-
* Different sizes map to specific height
|
|
11
|
-
*
|
|
12
|
-
* @default IconSize.Md
|
|
13
|
-
*/
|
|
14
|
-
size?: BadgeCountSize;
|
|
15
|
-
/**
|
|
16
|
-
* Required prop to show the count number
|
|
17
|
-
*/
|
|
18
|
-
count: number;
|
|
19
|
-
/**
|
|
20
|
-
* Optional prop to determine the max the count can go up to.
|
|
21
|
-
* If count > max, the count will be shown as "max+"
|
|
22
|
-
*
|
|
23
|
-
* @default 99
|
|
24
|
-
*/
|
|
25
|
-
max?: number;
|
|
8
|
+
export type BadgeCountProps = BadgeCountPropsShared & Omit<ViewProps, 'children'> & {
|
|
26
9
|
/**
|
|
27
10
|
* Optional props to be passed to the Text component used by count
|
|
28
11
|
*/
|
|
@@ -35,5 +18,5 @@ export type BadgeCountProps = {
|
|
|
35
18
|
* Optional prop to control the style.
|
|
36
19
|
*/
|
|
37
20
|
style?: StyleProp<ViewStyle>;
|
|
38
|
-
}
|
|
21
|
+
};
|
|
39
22
|
//# sourceMappingURL=BadgeCount.types.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BadgeCount.types.d.cts","sourceRoot":"","sources":["../../../src/components/BadgeCount/BadgeCount.types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"BadgeCount.types.d.cts","sourceRoot":"","sources":["../../../src/components/BadgeCount/BadgeCount.types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,qBAAqB,EAAE,gDAAgD;AACrF,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,8BAAqB;AAEpE,OAAO,KAAK,EAAE,SAAS,EAAE,0BAAgB;AAEzC;;;GAGG;AACH,MAAM,MAAM,eAAe,GAAG,qBAAqB,GACjD,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC,GAAG;IAC5B;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC;IAC/B;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B,CAAC"}
|
|
@@ -1,28 +1,11 @@
|
|
|
1
|
+
import type { BadgeCountPropsShared } from "@metamask-previews/design-system-shared";
|
|
1
2
|
import type { ViewProps, StyleProp, ViewStyle } from "react-native/index.js";
|
|
2
|
-
import type { BadgeCountSize } from "../../types/index.mjs";
|
|
3
3
|
import type { TextProps } from "../Text/index.mjs";
|
|
4
4
|
/**
|
|
5
|
-
* BadgeCount component props
|
|
5
|
+
* BadgeCount component props (React Native platform-specific)
|
|
6
|
+
* Extends shared props with React Native-specific platform concerns
|
|
6
7
|
*/
|
|
7
|
-
export type BadgeCountProps = {
|
|
8
|
-
/**
|
|
9
|
-
* Optional prop to control the size of the BadgeCount
|
|
10
|
-
* Different sizes map to specific height
|
|
11
|
-
*
|
|
12
|
-
* @default IconSize.Md
|
|
13
|
-
*/
|
|
14
|
-
size?: BadgeCountSize;
|
|
15
|
-
/**
|
|
16
|
-
* Required prop to show the count number
|
|
17
|
-
*/
|
|
18
|
-
count: number;
|
|
19
|
-
/**
|
|
20
|
-
* Optional prop to determine the max the count can go up to.
|
|
21
|
-
* If count > max, the count will be shown as "max+"
|
|
22
|
-
*
|
|
23
|
-
* @default 99
|
|
24
|
-
*/
|
|
25
|
-
max?: number;
|
|
8
|
+
export type BadgeCountProps = BadgeCountPropsShared & Omit<ViewProps, 'children'> & {
|
|
26
9
|
/**
|
|
27
10
|
* Optional props to be passed to the Text component used by count
|
|
28
11
|
*/
|
|
@@ -35,5 +18,5 @@ export type BadgeCountProps = {
|
|
|
35
18
|
* Optional prop to control the style.
|
|
36
19
|
*/
|
|
37
20
|
style?: StyleProp<ViewStyle>;
|
|
38
|
-
}
|
|
21
|
+
};
|
|
39
22
|
//# sourceMappingURL=BadgeCount.types.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BadgeCount.types.d.mts","sourceRoot":"","sources":["../../../src/components/BadgeCount/BadgeCount.types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"BadgeCount.types.d.mts","sourceRoot":"","sources":["../../../src/components/BadgeCount/BadgeCount.types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,qBAAqB,EAAE,gDAAgD;AACrF,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,8BAAqB;AAEpE,OAAO,KAAK,EAAE,SAAS,EAAE,0BAAgB;AAEzC;;;GAGG;AACH,MAAM,MAAM,eAAe,GAAG,qBAAqB,GACjD,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC,GAAG;IAC5B;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC;IAC/B;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BadgeCount.types.mjs","sourceRoot":"","sources":["../../../src/components/BadgeCount/BadgeCount.types.ts"],"names":[],"mappings":"","sourcesContent":["
|
|
1
|
+
{"version":3,"file":"BadgeCount.types.mjs","sourceRoot":"","sources":["../../../src/components/BadgeCount/BadgeCount.types.ts"],"names":[],"mappings":"","sourcesContent":["// Import shared type for extension\nimport type { BadgeCountPropsShared } from '@metamask-previews/design-system-shared';\nimport type { ViewProps, StyleProp, ViewStyle } from 'react-native';\n\nimport type { TextProps } from '../Text';\n\n/**\n * BadgeCount component props (React Native platform-specific)\n * Extends shared props with React Native-specific platform concerns\n */\nexport type BadgeCountProps = BadgeCountPropsShared &\n Omit<ViewProps, 'children'> & {\n /**\n * Optional props to be passed to the Text component used by count\n */\n textProps?: Partial<TextProps>;\n /**\n * Optional prop to add twrnc overriding classNames.\n */\n twClassName?: string;\n /**\n * Optional prop to control the style.\n */\n style?: StyleProp<ViewStyle>;\n };\n"]}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.BadgeCount = exports.BadgeCountSize = void 0;
|
|
4
|
-
var
|
|
5
|
-
Object.defineProperty(exports, "BadgeCountSize", { enumerable: true, get: function () { return
|
|
4
|
+
var design_system_shared_1 = require("@metamask-previews/design-system-shared");
|
|
5
|
+
Object.defineProperty(exports, "BadgeCountSize", { enumerable: true, get: function () { return design_system_shared_1.BadgeCountSize; } });
|
|
6
6
|
var BadgeCount_1 = require("./BadgeCount.cjs");
|
|
7
7
|
Object.defineProperty(exports, "BadgeCount", { enumerable: true, get: function () { return BadgeCount_1.BadgeCount; } });
|
|
8
8
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../../src/components/BadgeCount/index.ts"],"names":[],"mappings":";;;AAAA
|
|
1
|
+
{"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../../src/components/BadgeCount/index.ts"],"names":[],"mappings":";;;AAAA,gFAAyE;AAAhE,sHAAA,cAAc,OAAA;AACvB,+CAA0C;AAAjC,wGAAA,UAAU,OAAA","sourcesContent":["export { BadgeCountSize } from '@metamask-previews/design-system-shared';\nexport { BadgeCount } from './BadgeCount';\nexport type { BadgeCountProps } from './BadgeCount.types';\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { BadgeCountSize } from "
|
|
1
|
+
export { BadgeCountSize } from "@metamask-previews/design-system-shared";
|
|
2
2
|
export { BadgeCount } from "./BadgeCount.cjs";
|
|
3
3
|
export type { BadgeCountProps } from "./BadgeCount.types.cjs";
|
|
4
4
|
//# sourceMappingURL=index.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/components/BadgeCount/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/components/BadgeCount/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,gDAAgD;AACzE,OAAO,EAAE,UAAU,EAAE,yBAAqB;AAC1C,YAAY,EAAE,eAAe,EAAE,+BAA2B"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { BadgeCountSize } from "
|
|
1
|
+
export { BadgeCountSize } from "@metamask-previews/design-system-shared";
|
|
2
2
|
export { BadgeCount } from "./BadgeCount.mjs";
|
|
3
3
|
export type { BadgeCountProps } from "./BadgeCount.types.mjs";
|
|
4
4
|
//# sourceMappingURL=index.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../src/components/BadgeCount/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../src/components/BadgeCount/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,gDAAgD;AACzE,OAAO,EAAE,UAAU,EAAE,yBAAqB;AAC1C,YAAY,EAAE,eAAe,EAAE,+BAA2B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../src/components/BadgeCount/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../src/components/BadgeCount/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,gDAAgD;AACzE,OAAO,EAAE,UAAU,EAAE,yBAAqB","sourcesContent":["export { BadgeCountSize } from '@metamask-previews/design-system-shared';\nexport { BadgeCount } from './BadgeCount';\nexport type { BadgeCountProps } from './BadgeCount.types';\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BadgeStatus.types.cjs","sourceRoot":"","sources":["../../../src/components/BadgeStatus/BadgeStatus.types.ts"],"names":[],"mappings":"","sourcesContent":["
|
|
1
|
+
{"version":3,"file":"BadgeStatus.types.cjs","sourceRoot":"","sources":["../../../src/components/BadgeStatus/BadgeStatus.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { BadgeStatusPropsShared } from '@metamask-previews/design-system-shared';\nimport type { ViewProps } from 'react-native';\n\n/**\n * BadgeStatus component props (React Native platform-specific)\n * Extends shared props from @metamask-previews/design-system-shared with React Native specific platform concerns\n */\nexport type BadgeStatusProps = BadgeStatusPropsShared &\n Omit<ViewProps, 'children'> & {\n /**\n * Optional prop to add twrnc overriding classNames.\n */\n twClassName?: string;\n };\n"]}
|
|
@@ -2,7 +2,7 @@ import type { BadgeStatusPropsShared } from "@metamask-previews/design-system-sh
|
|
|
2
2
|
import type { ViewProps } from "react-native/index.js";
|
|
3
3
|
/**
|
|
4
4
|
* BadgeStatus component props (React Native platform-specific)
|
|
5
|
-
* Extends shared props with React Native
|
|
5
|
+
* Extends shared props from @metamask-previews/design-system-shared with React Native specific platform concerns
|
|
6
6
|
*/
|
|
7
7
|
export type BadgeStatusProps = BadgeStatusPropsShared & Omit<ViewProps, 'children'> & {
|
|
8
8
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BadgeStatus.types.d.cts","sourceRoot":"","sources":["../../../src/components/BadgeStatus/BadgeStatus.types.ts"],"names":[],"mappings":"
|
|
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,8BAAqB;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"}
|
|
@@ -2,7 +2,7 @@ import type { BadgeStatusPropsShared } from "@metamask-previews/design-system-sh
|
|
|
2
2
|
import type { ViewProps } from "react-native/index.js";
|
|
3
3
|
/**
|
|
4
4
|
* BadgeStatus component props (React Native platform-specific)
|
|
5
|
-
* Extends shared props with React Native
|
|
5
|
+
* Extends shared props from @metamask-previews/design-system-shared with React Native specific platform concerns
|
|
6
6
|
*/
|
|
7
7
|
export type BadgeStatusProps = BadgeStatusPropsShared & Omit<ViewProps, 'children'> & {
|
|
8
8
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BadgeStatus.types.d.mts","sourceRoot":"","sources":["../../../src/components/BadgeStatus/BadgeStatus.types.ts"],"names":[],"mappings":"
|
|
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,8BAAqB;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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BadgeStatus.types.mjs","sourceRoot":"","sources":["../../../src/components/BadgeStatus/BadgeStatus.types.ts"],"names":[],"mappings":"","sourcesContent":["
|
|
1
|
+
{"version":3,"file":"BadgeStatus.types.mjs","sourceRoot":"","sources":["../../../src/components/BadgeStatus/BadgeStatus.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { BadgeStatusPropsShared } from '@metamask-previews/design-system-shared';\nimport type { ViewProps } from 'react-native';\n\n/**\n * BadgeStatus component props (React Native platform-specific)\n * Extends shared props from @metamask-previews/design-system-shared with React Native specific platform concerns\n */\nexport type BadgeStatusProps = BadgeStatusPropsShared &\n Omit<ViewProps, 'children'> & {\n /**\n * Optional prop to add twrnc overriding classNames.\n */\n twClassName?: string;\n };\n"]}
|
|
@@ -0,0 +1,63 @@
|
|
|
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.BannerBase = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const types_1 = require("../../types/index.cjs");
|
|
9
|
+
const Box_1 = require("../Box/index.cjs");
|
|
10
|
+
const Button_1 = require("../Button/index.cjs");
|
|
11
|
+
const ButtonIcon_1 = require("../ButtonIcon/index.cjs");
|
|
12
|
+
const Text_1 = require("../Text/index.cjs");
|
|
13
|
+
const isTextContent = (content) => typeof content === 'string' || typeof content === 'number';
|
|
14
|
+
const hasContent = (content) => content !== null && content !== undefined;
|
|
15
|
+
const BannerBase = ({ title, titleProps, description, descriptionProps, children, childrenWrapperProps, actionButtonLabel, actionButtonOnPress, actionButtonProps, startAccessory, onClose, closeButtonProps, twClassName, ...props }) => {
|
|
16
|
+
const resolvedActionButtonProps = actionButtonProps ?? {};
|
|
17
|
+
const { accessibilityLabel: closeButtonAccessibilityLabel = 'Close banner', onPress: closeButtonPropsOnPress, twClassName: closeButtonTwClassName, ...resolvedCloseButtonProps } = closeButtonProps ?? {};
|
|
18
|
+
const shouldShowCloseButton = Boolean(onClose || closeButtonProps);
|
|
19
|
+
const shouldShowActionButton = Boolean(actionButtonOnPress);
|
|
20
|
+
const handleClosePress = onClose || closeButtonPropsOnPress
|
|
21
|
+
? (event) => {
|
|
22
|
+
if (onClose) {
|
|
23
|
+
onClose();
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
closeButtonPropsOnPress?.(event);
|
|
27
|
+
}
|
|
28
|
+
: undefined;
|
|
29
|
+
const mergedCloseButtonTwClassName = closeButtonTwClassName
|
|
30
|
+
? `ml-3 ${closeButtonTwClassName}`
|
|
31
|
+
: 'ml-3';
|
|
32
|
+
return (<Box_1.Box flexDirection={types_1.BoxFlexDirection.Row} alignItems={types_1.BoxAlignItems.Start} gap={2} backgroundColor={types_1.BoxBackgroundColor.BackgroundDefault} padding={3} twClassName={twClassName ? `rounded-sm ${twClassName}` : 'rounded-sm'} {...props}>
|
|
33
|
+
{startAccessory}
|
|
34
|
+
|
|
35
|
+
<Box_1.Box twClassName="flex-1">
|
|
36
|
+
{hasContent(title) &&
|
|
37
|
+
(isTextContent(title) ? (<Text_1.Text variant={types_1.TextVariant.BodyMd} fontWeight={types_1.FontWeight.Medium} {...titleProps}>
|
|
38
|
+
{title}
|
|
39
|
+
</Text_1.Text>) : (title))}
|
|
40
|
+
|
|
41
|
+
{hasContent(description) && (<Box_1.Box twClassName={hasContent(title) ? 'mt-1' : undefined}>
|
|
42
|
+
{isTextContent(description) ? (<Text_1.Text variant={types_1.TextVariant.BodySm} {...descriptionProps}>
|
|
43
|
+
{description}
|
|
44
|
+
</Text_1.Text>) : (description)}
|
|
45
|
+
</Box_1.Box>)}
|
|
46
|
+
|
|
47
|
+
{hasContent(children) &&
|
|
48
|
+
(isTextContent(children) ? (<Text_1.Text variant={types_1.TextVariant.BodyMd} {...childrenWrapperProps}>
|
|
49
|
+
{children}
|
|
50
|
+
</Text_1.Text>) : (children))}
|
|
51
|
+
|
|
52
|
+
{shouldShowActionButton && (<Box_1.Box twClassName="mt-4">
|
|
53
|
+
<Button_1.Button size={types_1.ButtonSize.Md} onPress={actionButtonOnPress} {...resolvedActionButtonProps}>
|
|
54
|
+
{actionButtonLabel}
|
|
55
|
+
</Button_1.Button>
|
|
56
|
+
</Box_1.Box>)}
|
|
57
|
+
</Box_1.Box>
|
|
58
|
+
|
|
59
|
+
{shouldShowCloseButton && (<ButtonIcon_1.ButtonIcon testID="banner-base-close-button" twClassName={mergedCloseButtonTwClassName} iconName={types_1.IconName.Close} size={types_1.ButtonIconSize.Sm} accessibilityLabel={closeButtonAccessibilityLabel} onPress={handleClosePress} {...resolvedCloseButtonProps}/>)}
|
|
60
|
+
</Box_1.Box>);
|
|
61
|
+
};
|
|
62
|
+
exports.BannerBase = BannerBase;
|
|
63
|
+
//# sourceMappingURL=BannerBase.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BannerBase.cjs","sourceRoot":"","sources":["../../../src/components/BannerBase/BannerBase.tsx"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAG1B,iDASqB;AACrB,0CAA6B;AAC7B,gDAAmC;AACnC,wDAA2C;AAC3C,4CAA+B;AAI/B,MAAM,aAAa,GAAG,CAAC,OAAwB,EAA8B,EAAE,CA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,CAAC,CAAC,mBAAW,CAAC,MAAM,CAAC,CAAC,IAAI,oBAAoB,CAAC,CAC1D;cAAA,CAAC,QAAQ,CACX;YAAA,EAAE,WAAI,CAAC,CACR,CAAC,CAAC,CAAC,CACF,QAAQ,CACT,CAAC,CAEJ;;QAAA,CAAC,sBAAsB,IAAI,CACzB,CAAC,SAAG,CAAC,WAAW,CAAC,MAAM,CACrB;YAAA,CAAC,eAAM,CACL,IAAI,CAAC,CAAC,kBAAU,CAAC,EAAE,CAAC,CACpB,OAAO,CAAC,CAAC,mBAAmB,CAAC,CAC7B,IAAI,yBAAyB,CAAC,CAE9B;cAAA,CAAC,iBAAiB,CACpB;YAAA,EAAE,eAAM,CACV;UAAA,EAAE,SAAG,CAAC,CACP,CACH;MAAA,EAAE,SAAG,CAEL;;MAAA,CAAC,qBAAqB,IAAI,CACxB,CAAC,uBAAU,CACT,MAAM,CAAC,0BAA0B,CACjC,WAAW,CAAC,CAAC,4BAA4B,CAAC,CAC1C,QAAQ,CAAC,CAAC,gBAAQ,CAAC,KAAK,CAAC,CACzB,IAAI,CAAC,CAAC,sBAAc,CAAC,EAAE,CAAC,CACxB,kBAAkB,CAAC,CAAC,6BAA6B,CAAC,CAClD,OAAO,CAAC,CAAC,gBAAgB,CAAC,CAC1B,IAAI,wBAAwB,CAAC,EAC7B,CACH,CACH;IAAA,EAAE,SAAG,CAAC,CACP,CAAC;AACJ,CAAC,CAAC;AApHW,QAAA,UAAU,cAoHrB","sourcesContent":["import React from 'react';\nimport { GestureResponderEvent } from 'react-native';\n\nimport {\n BoxAlignItems,\n BoxBackgroundColor,\n ButtonIconSize,\n ButtonSize,\n FontWeight,\n BoxFlexDirection,\n IconName,\n TextVariant,\n} from '../../types';\nimport { Box } from '../Box';\nimport { Button } from '../Button';\nimport { ButtonIcon } from '../ButtonIcon';\nimport { Text } from '../Text';\n\nimport type { BannerBaseProps } from './BannerBase.types';\n\nconst isTextContent = (content: React.ReactNode): content is string | number =>\n typeof content === 'string' || typeof content === 'number';\n\nconst hasContent = (content: React.ReactNode) =>\n content !== null && content !== undefined;\n\nexport const BannerBase: React.FC<BannerBaseProps> = ({\n title,\n titleProps,\n description,\n descriptionProps,\n children,\n childrenWrapperProps,\n actionButtonLabel,\n actionButtonOnPress,\n actionButtonProps,\n startAccessory,\n onClose,\n closeButtonProps,\n twClassName,\n ...props\n}) => {\n const resolvedActionButtonProps = actionButtonProps ?? {};\n\n const {\n accessibilityLabel: closeButtonAccessibilityLabel = 'Close banner',\n onPress: closeButtonPropsOnPress,\n twClassName: closeButtonTwClassName,\n ...resolvedCloseButtonProps\n } = closeButtonProps ?? {};\n\n const shouldShowCloseButton = Boolean(onClose || closeButtonProps);\n const shouldShowActionButton = Boolean(actionButtonOnPress);\n\n const handleClosePress =\n onClose || closeButtonPropsOnPress\n ? (event: GestureResponderEvent) => {\n if (onClose) {\n onClose();\n return;\n }\n closeButtonPropsOnPress?.(event);\n }\n : undefined;\n\n const mergedCloseButtonTwClassName = closeButtonTwClassName\n ? `ml-3 ${closeButtonTwClassName}`\n : 'ml-3';\n\n return (\n <Box\n flexDirection={BoxFlexDirection.Row}\n alignItems={BoxAlignItems.Start}\n gap={2}\n backgroundColor={BoxBackgroundColor.BackgroundDefault}\n padding={3}\n twClassName={twClassName ? `rounded-sm ${twClassName}` : 'rounded-sm'}\n {...props}\n >\n {startAccessory}\n\n <Box twClassName=\"flex-1\">\n {hasContent(title) &&\n (isTextContent(title) ? (\n <Text\n variant={TextVariant.BodyMd}\n fontWeight={FontWeight.Medium}\n {...titleProps}\n >\n {title}\n </Text>\n ) : (\n title\n ))}\n\n {hasContent(description) && (\n <Box twClassName={hasContent(title) ? 'mt-1' : undefined}>\n {isTextContent(description) ? (\n <Text variant={TextVariant.BodySm} {...descriptionProps}>\n {description}\n </Text>\n ) : (\n description\n )}\n </Box>\n )}\n\n {hasContent(children) &&\n (isTextContent(children) ? (\n <Text variant={TextVariant.BodyMd} {...childrenWrapperProps}>\n {children}\n </Text>\n ) : (\n children\n ))}\n\n {shouldShowActionButton && (\n <Box twClassName=\"mt-4\">\n <Button\n size={ButtonSize.Md}\n onPress={actionButtonOnPress}\n {...resolvedActionButtonProps}\n >\n {actionButtonLabel}\n </Button>\n </Box>\n )}\n </Box>\n\n {shouldShowCloseButton && (\n <ButtonIcon\n testID=\"banner-base-close-button\"\n twClassName={mergedCloseButtonTwClassName}\n iconName={IconName.Close}\n size={ButtonIconSize.Sm}\n accessibilityLabel={closeButtonAccessibilityLabel}\n onPress={handleClosePress}\n {...resolvedCloseButtonProps}\n />\n )}\n </Box>\n );\n};\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BannerBase.d.cts","sourceRoot":"","sources":["../../../src/components/BannerBase/BannerBase.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,cAAc;AAkB1B,OAAO,KAAK,EAAE,eAAe,EAAE,+BAA2B;AAQ1D,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAoHhD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BannerBase.d.mts","sourceRoot":"","sources":["../../../src/components/BannerBase/BannerBase.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,cAAc;AAkB1B,OAAO,KAAK,EAAE,eAAe,EAAE,+BAA2B;AAQ1D,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAoHhD,CAAC"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
function $importDefault(module) {
|
|
2
|
+
if (module?.__esModule) {
|
|
3
|
+
return module.default;
|
|
4
|
+
}
|
|
5
|
+
return module;
|
|
6
|
+
}
|
|
7
|
+
import $React from "react";
|
|
8
|
+
const React = $importDefault($React);
|
|
9
|
+
import { BoxAlignItems, BoxBackgroundColor, ButtonIconSize, ButtonSize, FontWeight, BoxFlexDirection, IconName, TextVariant } from "../../types/index.mjs";
|
|
10
|
+
import { Box } from "../Box/index.mjs";
|
|
11
|
+
import { Button } from "../Button/index.mjs";
|
|
12
|
+
import { ButtonIcon } from "../ButtonIcon/index.mjs";
|
|
13
|
+
import { Text } from "../Text/index.mjs";
|
|
14
|
+
const isTextContent = (content) => typeof content === 'string' || typeof content === 'number';
|
|
15
|
+
const hasContent = (content) => content !== null && content !== undefined;
|
|
16
|
+
export const BannerBase = ({ title, titleProps, description, descriptionProps, children, childrenWrapperProps, actionButtonLabel, actionButtonOnPress, actionButtonProps, startAccessory, onClose, closeButtonProps, twClassName, ...props }) => {
|
|
17
|
+
const resolvedActionButtonProps = actionButtonProps ?? {};
|
|
18
|
+
const { accessibilityLabel: closeButtonAccessibilityLabel = 'Close banner', onPress: closeButtonPropsOnPress, twClassName: closeButtonTwClassName, ...resolvedCloseButtonProps } = closeButtonProps ?? {};
|
|
19
|
+
const shouldShowCloseButton = Boolean(onClose || closeButtonProps);
|
|
20
|
+
const shouldShowActionButton = Boolean(actionButtonOnPress);
|
|
21
|
+
const handleClosePress = onClose || closeButtonPropsOnPress
|
|
22
|
+
? (event) => {
|
|
23
|
+
if (onClose) {
|
|
24
|
+
onClose();
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
closeButtonPropsOnPress?.(event);
|
|
28
|
+
}
|
|
29
|
+
: undefined;
|
|
30
|
+
const mergedCloseButtonTwClassName = closeButtonTwClassName
|
|
31
|
+
? `ml-3 ${closeButtonTwClassName}`
|
|
32
|
+
: 'ml-3';
|
|
33
|
+
return (<Box flexDirection={BoxFlexDirection.Row} alignItems={BoxAlignItems.Start} gap={2} backgroundColor={BoxBackgroundColor.BackgroundDefault} padding={3} twClassName={twClassName ? `rounded-sm ${twClassName}` : 'rounded-sm'} {...props}>
|
|
34
|
+
{startAccessory}
|
|
35
|
+
|
|
36
|
+
<Box twClassName="flex-1">
|
|
37
|
+
{hasContent(title) &&
|
|
38
|
+
(isTextContent(title) ? (<Text variant={TextVariant.BodyMd} fontWeight={FontWeight.Medium} {...titleProps}>
|
|
39
|
+
{title}
|
|
40
|
+
</Text>) : (title))}
|
|
41
|
+
|
|
42
|
+
{hasContent(description) && (<Box twClassName={hasContent(title) ? 'mt-1' : undefined}>
|
|
43
|
+
{isTextContent(description) ? (<Text variant={TextVariant.BodySm} {...descriptionProps}>
|
|
44
|
+
{description}
|
|
45
|
+
</Text>) : (description)}
|
|
46
|
+
</Box>)}
|
|
47
|
+
|
|
48
|
+
{hasContent(children) &&
|
|
49
|
+
(isTextContent(children) ? (<Text variant={TextVariant.BodyMd} {...childrenWrapperProps}>
|
|
50
|
+
{children}
|
|
51
|
+
</Text>) : (children))}
|
|
52
|
+
|
|
53
|
+
{shouldShowActionButton && (<Box twClassName="mt-4">
|
|
54
|
+
<Button size={ButtonSize.Md} onPress={actionButtonOnPress} {...resolvedActionButtonProps}>
|
|
55
|
+
{actionButtonLabel}
|
|
56
|
+
</Button>
|
|
57
|
+
</Box>)}
|
|
58
|
+
</Box>
|
|
59
|
+
|
|
60
|
+
{shouldShowCloseButton && (<ButtonIcon testID="banner-base-close-button" twClassName={mergedCloseButtonTwClassName} iconName={IconName.Close} size={ButtonIconSize.Sm} accessibilityLabel={closeButtonAccessibilityLabel} onPress={handleClosePress} {...resolvedCloseButtonProps}/>)}
|
|
61
|
+
</Box>);
|
|
62
|
+
};
|
|
63
|
+
//# sourceMappingURL=BannerBase.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BannerBase.mjs","sourceRoot":"","sources":["../../../src/components/BannerBase/BannerBase.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,MAAK,cAAc;;AAG1B,OAAO,EACL,aAAa,EACb,kBAAkB,EAClB,cAAc,EACd,UAAU,EACV,UAAU,EACV,gBAAgB,EAChB,QAAQ,EACR,WAAW,EACZ,8BAAoB;AACrB,OAAO,EAAE,GAAG,EAAE,yBAAe;AAC7B,OAAO,EAAE,MAAM,EAAE,4BAAkB;AACnC,OAAO,EAAE,UAAU,EAAE,gCAAsB;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AAC,QAAQ,CAAC;YACnB,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CACzB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,IAAI,oBAAoB,CAAC,CAC1D;cAAA,CAAC,QAAQ,CACX;YAAA,EAAE,IAAI,CAAC,CACR,CAAC,CAAC,CAAC,CACF,QAAQ,CACT,CAAC,CAEJ;;QAAA,CAAC,sBAAsB,IAAI,CACzB,CAAC,GAAG,CAAC,WAAW,CAAC,MAAM,CACrB;YAAA,CAAC,MAAM,CACL,IAAI,CAAC,CAAC,UAAU,CAAC,EAAE,CAAC,CACpB,OAAO,CAAC,CAAC,mBAAmB,CAAC,CAC7B,IAAI,yBAAyB,CAAC,CAE9B;cAAA,CAAC,iBAAiB,CACpB;YAAA,EAAE,MAAM,CACV;UAAA,EAAE,GAAG,CAAC,CACP,CACH;MAAA,EAAE,GAAG,CAEL;;MAAA,CAAC,qBAAqB,IAAI,CACxB,CAAC,UAAU,CACT,MAAM,CAAC,0BAA0B,CACjC,WAAW,CAAC,CAAC,4BAA4B,CAAC,CAC1C,QAAQ,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CACzB,IAAI,CAAC,CAAC,cAAc,CAAC,EAAE,CAAC,CACxB,kBAAkB,CAAC,CAAC,6BAA6B,CAAC,CAClD,OAAO,CAAC,CAAC,gBAAgB,CAAC,CAC1B,IAAI,wBAAwB,CAAC,EAC7B,CACH,CACH;IAAA,EAAE,GAAG,CAAC,CACP,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import React from 'react';\nimport { GestureResponderEvent } from 'react-native';\n\nimport {\n BoxAlignItems,\n BoxBackgroundColor,\n ButtonIconSize,\n ButtonSize,\n FontWeight,\n BoxFlexDirection,\n IconName,\n TextVariant,\n} from '../../types';\nimport { Box } from '../Box';\nimport { Button } from '../Button';\nimport { ButtonIcon } from '../ButtonIcon';\nimport { Text } from '../Text';\n\nimport type { BannerBaseProps } from './BannerBase.types';\n\nconst isTextContent = (content: React.ReactNode): content is string | number =>\n typeof content === 'string' || typeof content === 'number';\n\nconst hasContent = (content: React.ReactNode) =>\n content !== null && content !== undefined;\n\nexport const BannerBase: React.FC<BannerBaseProps> = ({\n title,\n titleProps,\n description,\n descriptionProps,\n children,\n childrenWrapperProps,\n actionButtonLabel,\n actionButtonOnPress,\n actionButtonProps,\n startAccessory,\n onClose,\n closeButtonProps,\n twClassName,\n ...props\n}) => {\n const resolvedActionButtonProps = actionButtonProps ?? {};\n\n const {\n accessibilityLabel: closeButtonAccessibilityLabel = 'Close banner',\n onPress: closeButtonPropsOnPress,\n twClassName: closeButtonTwClassName,\n ...resolvedCloseButtonProps\n } = closeButtonProps ?? {};\n\n const shouldShowCloseButton = Boolean(onClose || closeButtonProps);\n const shouldShowActionButton = Boolean(actionButtonOnPress);\n\n const handleClosePress =\n onClose || closeButtonPropsOnPress\n ? (event: GestureResponderEvent) => {\n if (onClose) {\n onClose();\n return;\n }\n closeButtonPropsOnPress?.(event);\n }\n : undefined;\n\n const mergedCloseButtonTwClassName = closeButtonTwClassName\n ? `ml-3 ${closeButtonTwClassName}`\n : 'ml-3';\n\n return (\n <Box\n flexDirection={BoxFlexDirection.Row}\n alignItems={BoxAlignItems.Start}\n gap={2}\n backgroundColor={BoxBackgroundColor.BackgroundDefault}\n padding={3}\n twClassName={twClassName ? `rounded-sm ${twClassName}` : 'rounded-sm'}\n {...props}\n >\n {startAccessory}\n\n <Box twClassName=\"flex-1\">\n {hasContent(title) &&\n (isTextContent(title) ? (\n <Text\n variant={TextVariant.BodyMd}\n fontWeight={FontWeight.Medium}\n {...titleProps}\n >\n {title}\n </Text>\n ) : (\n title\n ))}\n\n {hasContent(description) && (\n <Box twClassName={hasContent(title) ? 'mt-1' : undefined}>\n {isTextContent(description) ? (\n <Text variant={TextVariant.BodySm} {...descriptionProps}>\n {description}\n </Text>\n ) : (\n description\n )}\n </Box>\n )}\n\n {hasContent(children) &&\n (isTextContent(children) ? (\n <Text variant={TextVariant.BodyMd} {...childrenWrapperProps}>\n {children}\n </Text>\n ) : (\n children\n ))}\n\n {shouldShowActionButton && (\n <Box twClassName=\"mt-4\">\n <Button\n size={ButtonSize.Md}\n onPress={actionButtonOnPress}\n {...resolvedActionButtonProps}\n >\n {actionButtonLabel}\n </Button>\n </Box>\n )}\n </Box>\n\n {shouldShowCloseButton && (\n <ButtonIcon\n testID=\"banner-base-close-button\"\n twClassName={mergedCloseButtonTwClassName}\n iconName={IconName.Close}\n size={ButtonIconSize.Sm}\n accessibilityLabel={closeButtonAccessibilityLabel}\n onPress={handleClosePress}\n {...resolvedCloseButtonProps}\n />\n )}\n </Box>\n );\n};\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BannerBase.types.cjs","sourceRoot":"","sources":["../../../src/components/BannerBase/BannerBase.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { BannerBasePropsShared } from '@metamask-previews/design-system-shared';\nimport type { GestureResponderEvent } from 'react-native';\n\nimport type { BoxProps } from '../Box';\nimport type { ButtonProps } from '../Button';\nimport type { ButtonIconProps } from '../ButtonIcon';\nimport type { TextProps } from '../Text';\n\ntype BannerBaseActionButtonProps = Omit<\n Partial<ButtonProps>,\n 'children' | 'onPress' | 'variant'\n>;\n\ntype BannerBaseCloseButtonProps = Omit<\n Partial<ButtonIconProps>,\n 'iconName' | 'onPress'\n> & {\n /**\n * Optional press handler for the close button.\n */\n onPress?: (event: GestureResponderEvent) => void;\n};\n\ntype BannerBasePropsBase = BannerBasePropsShared &\n Omit<BoxProps, 'children'> & {\n /**\n * Optional props for the title `Text` when title is a string.\n */\n titleProps?: Omit<Partial<TextProps>, 'children'>;\n /**\n * Optional props for the description `Text` when description is a string.\n */\n descriptionProps?: Omit<Partial<TextProps>, 'children'>;\n /**\n * Optional props for the children wrapper `Text` when children is a string.\n */\n childrenWrapperProps?: Omit<Partial<TextProps>, 'children'>;\n /**\n * Optional callback for the close button.\n * If provided, a close button is shown.\n */\n onClose?: () => void;\n /**\n * Optional props for the close `ButtonIcon`.\n * Providing this also shows a close button.\n */\n closeButtonProps?: BannerBaseCloseButtonProps;\n };\n\ntype BannerBaseActionPropsWithHandler = {\n actionButtonOnPress: (event: GestureResponderEvent) => void;\n actionButtonLabel: string;\n actionButtonProps?: BannerBaseActionButtonProps;\n};\n\ntype BannerBaseActionPropsWithoutHandler = {\n actionButtonOnPress?: undefined;\n actionButtonLabel?: string;\n actionButtonProps?: BannerBaseActionButtonProps;\n};\n\n/**\n * BannerBase component props.\n */\nexport type BannerBaseProps = BannerBasePropsBase &\n (BannerBaseActionPropsWithHandler | BannerBaseActionPropsWithoutHandler);\n"]}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { BannerBasePropsShared } from "@metamask-previews/design-system-shared";
|
|
2
|
+
import type { GestureResponderEvent } from "react-native/index.js";
|
|
3
|
+
import type { BoxProps } from "../Box/index.cjs";
|
|
4
|
+
import type { ButtonProps } from "../Button/index.cjs";
|
|
5
|
+
import type { ButtonIconProps } from "../ButtonIcon/index.cjs";
|
|
6
|
+
import type { TextProps } from "../Text/index.cjs";
|
|
7
|
+
type BannerBaseActionButtonProps = Omit<Partial<ButtonProps>, 'children' | 'onPress' | 'variant'>;
|
|
8
|
+
type BannerBaseCloseButtonProps = Omit<Partial<ButtonIconProps>, 'iconName' | 'onPress'> & {
|
|
9
|
+
/**
|
|
10
|
+
* Optional press handler for the close button.
|
|
11
|
+
*/
|
|
12
|
+
onPress?: (event: GestureResponderEvent) => void;
|
|
13
|
+
};
|
|
14
|
+
type BannerBasePropsBase = BannerBasePropsShared & Omit<BoxProps, 'children'> & {
|
|
15
|
+
/**
|
|
16
|
+
* Optional props for the title `Text` when title is a string.
|
|
17
|
+
*/
|
|
18
|
+
titleProps?: Omit<Partial<TextProps>, 'children'>;
|
|
19
|
+
/**
|
|
20
|
+
* Optional props for the description `Text` when description is a string.
|
|
21
|
+
*/
|
|
22
|
+
descriptionProps?: Omit<Partial<TextProps>, 'children'>;
|
|
23
|
+
/**
|
|
24
|
+
* Optional props for the children wrapper `Text` when children is a string.
|
|
25
|
+
*/
|
|
26
|
+
childrenWrapperProps?: Omit<Partial<TextProps>, 'children'>;
|
|
27
|
+
/**
|
|
28
|
+
* Optional callback for the close button.
|
|
29
|
+
* If provided, a close button is shown.
|
|
30
|
+
*/
|
|
31
|
+
onClose?: () => void;
|
|
32
|
+
/**
|
|
33
|
+
* Optional props for the close `ButtonIcon`.
|
|
34
|
+
* Providing this also shows a close button.
|
|
35
|
+
*/
|
|
36
|
+
closeButtonProps?: BannerBaseCloseButtonProps;
|
|
37
|
+
};
|
|
38
|
+
type BannerBaseActionPropsWithHandler = {
|
|
39
|
+
actionButtonOnPress: (event: GestureResponderEvent) => void;
|
|
40
|
+
actionButtonLabel: string;
|
|
41
|
+
actionButtonProps?: BannerBaseActionButtonProps;
|
|
42
|
+
};
|
|
43
|
+
type BannerBaseActionPropsWithoutHandler = {
|
|
44
|
+
actionButtonOnPress?: undefined;
|
|
45
|
+
actionButtonLabel?: string;
|
|
46
|
+
actionButtonProps?: BannerBaseActionButtonProps;
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* BannerBase component props.
|
|
50
|
+
*/
|
|
51
|
+
export type BannerBaseProps = BannerBasePropsBase & (BannerBaseActionPropsWithHandler | BannerBaseActionPropsWithoutHandler);
|
|
52
|
+
export {};
|
|
53
|
+
//# sourceMappingURL=BannerBase.types.d.cts.map
|
|
@@ -0,0 +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,8BAAqB;AAE1D,OAAO,KAAK,EAAE,QAAQ,EAAE,yBAAe;AACvC,OAAO,KAAK,EAAE,WAAW,EAAE,4BAA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