@metamask-previews/design-system-react-native 0.19.0-preview.1679aa9 → 0.24.0-preview.178e60f
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 +84 -3
- package/dist/components/AvatarGroup/AvatarGroup.cjs +11 -12
- package/dist/components/AvatarGroup/AvatarGroup.cjs.map +1 -1
- package/dist/components/AvatarGroup/AvatarGroup.constants.cjs +11 -12
- package/dist/components/AvatarGroup/AvatarGroup.constants.cjs.map +1 -1
- package/dist/components/AvatarGroup/AvatarGroup.constants.d.cts +1 -2
- package/dist/components/AvatarGroup/AvatarGroup.constants.d.cts.map +1 -1
- package/dist/components/AvatarGroup/AvatarGroup.constants.d.mts +1 -2
- package/dist/components/AvatarGroup/AvatarGroup.constants.d.mts.map +1 -1
- package/dist/components/AvatarGroup/AvatarGroup.constants.mjs +1 -2
- package/dist/components/AvatarGroup/AvatarGroup.constants.mjs.map +1 -1
- package/dist/components/AvatarGroup/AvatarGroup.d.cts.map +1 -1
- package/dist/components/AvatarGroup/AvatarGroup.d.mts.map +1 -1
- package/dist/components/AvatarGroup/AvatarGroup.mjs +2 -3
- package/dist/components/AvatarGroup/AvatarGroup.mjs.map +1 -1
- package/dist/components/AvatarGroup/AvatarGroup.types.cjs.map +1 -1
- package/dist/components/AvatarGroup/AvatarGroup.types.d.cts +7 -24
- package/dist/components/AvatarGroup/AvatarGroup.types.d.cts.map +1 -1
- package/dist/components/AvatarGroup/AvatarGroup.types.d.mts +7 -24
- package/dist/components/AvatarGroup/AvatarGroup.types.d.mts.map +1 -1
- package/dist/components/AvatarGroup/AvatarGroup.types.mjs.map +1 -1
- package/dist/components/AvatarGroup/index.cjs +3 -3
- package/dist/components/AvatarGroup/index.cjs.map +1 -1
- package/dist/components/AvatarGroup/index.d.cts +1 -1
- package/dist/components/AvatarGroup/index.d.cts.map +1 -1
- package/dist/components/AvatarGroup/index.d.mts +1 -1
- package/dist/components/AvatarGroup/index.d.mts.map +1 -1
- package/dist/components/AvatarGroup/index.mjs +1 -1
- package/dist/components/AvatarGroup/index.mjs.map +1 -1
- package/dist/components/AvatarIcon/AvatarIcon.cjs +2 -2
- package/dist/components/AvatarIcon/AvatarIcon.cjs.map +1 -1
- package/dist/components/AvatarIcon/AvatarIcon.constants.cjs +16 -17
- package/dist/components/AvatarIcon/AvatarIcon.constants.cjs.map +1 -1
- package/dist/components/AvatarIcon/AvatarIcon.constants.d.cts +1 -2
- package/dist/components/AvatarIcon/AvatarIcon.constants.d.cts.map +1 -1
- package/dist/components/AvatarIcon/AvatarIcon.constants.d.mts +1 -2
- package/dist/components/AvatarIcon/AvatarIcon.constants.d.mts.map +1 -1
- package/dist/components/AvatarIcon/AvatarIcon.constants.mjs +1 -2
- package/dist/components/AvatarIcon/AvatarIcon.constants.mjs.map +1 -1
- package/dist/components/AvatarIcon/AvatarIcon.d.cts.map +1 -1
- package/dist/components/AvatarIcon/AvatarIcon.d.mts.map +1 -1
- package/dist/components/AvatarIcon/AvatarIcon.mjs +1 -1
- package/dist/components/AvatarIcon/AvatarIcon.mjs.map +1 -1
- package/dist/components/AvatarIcon/AvatarIcon.types.cjs.map +1 -1
- package/dist/components/AvatarIcon/AvatarIcon.types.d.cts +3 -13
- package/dist/components/AvatarIcon/AvatarIcon.types.d.cts.map +1 -1
- package/dist/components/AvatarIcon/AvatarIcon.types.d.mts +3 -13
- package/dist/components/AvatarIcon/AvatarIcon.types.d.mts.map +1 -1
- package/dist/components/AvatarIcon/AvatarIcon.types.mjs.map +1 -1
- package/dist/components/AvatarIcon/index.cjs +4 -4
- package/dist/components/AvatarIcon/index.cjs.map +1 -1
- package/dist/components/AvatarIcon/index.d.cts +1 -1
- package/dist/components/AvatarIcon/index.d.cts.map +1 -1
- package/dist/components/AvatarIcon/index.d.mts +1 -1
- package/dist/components/AvatarIcon/index.d.mts.map +1 -1
- package/dist/components/AvatarIcon/index.mjs +1 -1
- package/dist/components/AvatarIcon/index.mjs.map +1 -1
- package/dist/components/BadgeIcon/BadgeIcon.cjs +2 -1
- package/dist/components/BadgeIcon/BadgeIcon.cjs.map +1 -1
- package/dist/components/BadgeIcon/BadgeIcon.d.cts.map +1 -1
- package/dist/components/BadgeIcon/BadgeIcon.d.mts.map +1 -1
- package/dist/components/BadgeIcon/BadgeIcon.mjs +2 -1
- package/dist/components/BadgeIcon/BadgeIcon.mjs.map +1 -1
- package/dist/components/BadgeIcon/BadgeIcon.types.cjs.map +1 -1
- package/dist/components/BadgeIcon/BadgeIcon.types.d.cts +5 -7
- package/dist/components/BadgeIcon/BadgeIcon.types.d.cts.map +1 -1
- package/dist/components/BadgeIcon/BadgeIcon.types.d.mts +5 -7
- package/dist/components/BadgeIcon/BadgeIcon.types.d.mts.map +1 -1
- package/dist/components/BadgeIcon/BadgeIcon.types.mjs.map +1 -1
- package/dist/components/BannerAlert/BannerAlert.cjs +1 -2
- package/dist/components/BannerAlert/BannerAlert.cjs.map +1 -1
- package/dist/components/BannerAlert/BannerAlert.constants.cjs +16 -17
- package/dist/components/BannerAlert/BannerAlert.constants.cjs.map +1 -1
- package/dist/components/BannerAlert/BannerAlert.constants.d.cts +1 -2
- package/dist/components/BannerAlert/BannerAlert.constants.d.cts.map +1 -1
- package/dist/components/BannerAlert/BannerAlert.constants.d.mts +1 -2
- package/dist/components/BannerAlert/BannerAlert.constants.d.mts.map +1 -1
- package/dist/components/BannerAlert/BannerAlert.constants.mjs +1 -2
- package/dist/components/BannerAlert/BannerAlert.constants.mjs.map +1 -1
- package/dist/components/BannerAlert/BannerAlert.d.cts.map +1 -1
- package/dist/components/BannerAlert/BannerAlert.d.mts.map +1 -1
- package/dist/components/BannerAlert/BannerAlert.mjs +1 -2
- package/dist/components/BannerAlert/BannerAlert.mjs.map +1 -1
- package/dist/components/BannerBase/BannerBase.cjs +5 -15
- package/dist/components/BannerBase/BannerBase.cjs.map +1 -1
- package/dist/components/BannerBase/BannerBase.d.cts.map +1 -1
- package/dist/components/BannerBase/BannerBase.d.mts.map +1 -1
- package/dist/components/BannerBase/BannerBase.mjs +4 -14
- package/dist/components/BannerBase/BannerBase.mjs.map +1 -1
- package/dist/components/BannerBase/BannerBase.types.cjs.map +1 -1
- package/dist/components/BannerBase/BannerBase.types.d.cts +2 -7
- package/dist/components/BannerBase/BannerBase.types.d.cts.map +1 -1
- package/dist/components/BannerBase/BannerBase.types.d.mts +2 -7
- package/dist/components/BannerBase/BannerBase.types.d.mts.map +1 -1
- package/dist/components/BannerBase/BannerBase.types.mjs.map +1 -1
- package/dist/components/BottomSheetDialog/BottomSheetDialog.cjs +1 -1
- package/dist/components/BottomSheetDialog/BottomSheetDialog.cjs.map +1 -1
- package/dist/components/BottomSheetDialog/BottomSheetDialog.mjs +1 -1
- package/dist/components/BottomSheetDialog/BottomSheetDialog.mjs.map +1 -1
- package/dist/components/Box/Box.cjs +35 -12
- package/dist/components/Box/Box.cjs.map +1 -1
- package/dist/components/Box/Box.constants.cjs.map +1 -1
- package/dist/components/Box/Box.constants.d.cts +1 -1
- package/dist/components/Box/Box.constants.d.cts.map +1 -1
- package/dist/components/Box/Box.constants.d.mts +1 -1
- package/dist/components/Box/Box.constants.d.mts.map +1 -1
- package/dist/components/Box/Box.constants.mjs.map +1 -1
- package/dist/components/Box/Box.d.cts +4 -2
- package/dist/components/Box/Box.d.cts.map +1 -1
- package/dist/components/Box/Box.d.mts +4 -2
- package/dist/components/Box/Box.d.mts.map +1 -1
- package/dist/components/Box/Box.mjs +13 -9
- package/dist/components/Box/Box.mjs.map +1 -1
- package/dist/components/Box/Box.types.cjs.map +1 -1
- package/dist/components/Box/Box.types.d.cts +3 -107
- package/dist/components/Box/Box.types.d.cts.map +1 -1
- package/dist/components/Box/Box.types.d.mts +3 -107
- package/dist/components/Box/Box.types.d.mts.map +1 -1
- package/dist/components/Box/Box.types.mjs.map +1 -1
- package/dist/components/Box/index.cjs +7 -7
- package/dist/components/Box/index.cjs.map +1 -1
- package/dist/components/Box/index.d.cts +1 -2
- package/dist/components/Box/index.d.cts.map +1 -1
- package/dist/components/Box/index.d.mts +1 -2
- package/dist/components/Box/index.d.mts.map +1 -1
- package/dist/components/Box/index.mjs +1 -1
- package/dist/components/Box/index.mjs.map +1 -1
- package/dist/components/BoxColumn/BoxColumn.cjs +2 -2
- package/dist/components/BoxColumn/BoxColumn.cjs.map +1 -1
- package/dist/components/BoxColumn/BoxColumn.d.cts.map +1 -1
- package/dist/components/BoxColumn/BoxColumn.d.mts.map +1 -1
- package/dist/components/BoxColumn/BoxColumn.mjs +1 -1
- package/dist/components/BoxColumn/BoxColumn.mjs.map +1 -1
- package/dist/components/BoxRow/BoxRow.cjs +2 -2
- package/dist/components/BoxRow/BoxRow.cjs.map +1 -1
- package/dist/components/BoxRow/BoxRow.d.cts.map +1 -1
- package/dist/components/BoxRow/BoxRow.d.mts.map +1 -1
- package/dist/components/BoxRow/BoxRow.mjs +1 -1
- package/dist/components/BoxRow/BoxRow.mjs.map +1 -1
- package/dist/components/Button/Button.cjs +6 -6
- package/dist/components/Button/Button.cjs.map +1 -1
- package/dist/components/Button/Button.d.cts.map +1 -1
- package/dist/components/Button/Button.d.mts.map +1 -1
- package/dist/components/Button/Button.mjs +1 -1
- package/dist/components/Button/Button.mjs.map +1 -1
- package/dist/components/Button/Button.types.cjs.map +1 -1
- package/dist/components/Button/Button.types.d.cts +2 -7
- package/dist/components/Button/Button.types.d.cts.map +1 -1
- package/dist/components/Button/Button.types.d.mts +2 -7
- package/dist/components/Button/Button.types.d.mts.map +1 -1
- package/dist/components/Button/Button.types.mjs.map +1 -1
- package/dist/components/Button/index.cjs +3 -3
- package/dist/components/Button/index.cjs.map +1 -1
- package/dist/components/Button/index.d.cts +1 -1
- package/dist/components/Button/index.d.cts.map +1 -1
- package/dist/components/Button/index.d.mts +1 -1
- package/dist/components/Button/index.d.mts.map +1 -1
- package/dist/components/Button/index.mjs +1 -1
- package/dist/components/Button/index.mjs.map +1 -1
- package/dist/components/Button/variants/ButtonPrimary/ButtonPrimary.cjs +3 -17
- package/dist/components/Button/variants/ButtonPrimary/ButtonPrimary.cjs.map +1 -1
- package/dist/components/Button/variants/ButtonPrimary/ButtonPrimary.d.cts.map +1 -1
- package/dist/components/Button/variants/ButtonPrimary/ButtonPrimary.d.mts.map +1 -1
- package/dist/components/Button/variants/ButtonPrimary/ButtonPrimary.mjs +3 -17
- package/dist/components/Button/variants/ButtonPrimary/ButtonPrimary.mjs.map +1 -1
- package/dist/components/Button/variants/ButtonPrimary/index.cjs +1 -3
- package/dist/components/Button/variants/ButtonPrimary/index.cjs.map +1 -1
- package/dist/components/Button/variants/ButtonPrimary/index.d.cts +0 -1
- package/dist/components/Button/variants/ButtonPrimary/index.d.cts.map +1 -1
- package/dist/components/Button/variants/ButtonPrimary/index.d.mts +0 -1
- package/dist/components/Button/variants/ButtonPrimary/index.d.mts.map +1 -1
- package/dist/components/Button/variants/ButtonPrimary/index.mjs +0 -1
- package/dist/components/Button/variants/ButtonPrimary/index.mjs.map +1 -1
- package/dist/components/Button/variants/ButtonSecondary/ButtonSecondary.cjs +3 -17
- package/dist/components/Button/variants/ButtonSecondary/ButtonSecondary.cjs.map +1 -1
- package/dist/components/Button/variants/ButtonSecondary/ButtonSecondary.d.cts.map +1 -1
- package/dist/components/Button/variants/ButtonSecondary/ButtonSecondary.d.mts.map +1 -1
- package/dist/components/Button/variants/ButtonSecondary/ButtonSecondary.mjs +3 -17
- package/dist/components/Button/variants/ButtonSecondary/ButtonSecondary.mjs.map +1 -1
- package/dist/components/Button/variants/ButtonSecondary/index.cjs +1 -3
- package/dist/components/Button/variants/ButtonSecondary/index.cjs.map +1 -1
- package/dist/components/Button/variants/ButtonSecondary/index.d.cts +0 -1
- package/dist/components/Button/variants/ButtonSecondary/index.d.cts.map +1 -1
- package/dist/components/Button/variants/ButtonSecondary/index.d.mts +0 -1
- package/dist/components/Button/variants/ButtonSecondary/index.d.mts.map +1 -1
- package/dist/components/Button/variants/ButtonSecondary/index.mjs +0 -1
- package/dist/components/Button/variants/ButtonSecondary/index.mjs.map +1 -1
- package/dist/components/Button/variants/ButtonTertiary/ButtonTertiary.cjs +5 -20
- package/dist/components/Button/variants/ButtonTertiary/ButtonTertiary.cjs.map +1 -1
- package/dist/components/Button/variants/ButtonTertiary/ButtonTertiary.d.cts.map +1 -1
- package/dist/components/Button/variants/ButtonTertiary/ButtonTertiary.d.mts.map +1 -1
- package/dist/components/Button/variants/ButtonTertiary/ButtonTertiary.mjs +5 -20
- package/dist/components/Button/variants/ButtonTertiary/ButtonTertiary.mjs.map +1 -1
- package/dist/components/Button/variants/ButtonTertiary/index.cjs +1 -3
- package/dist/components/Button/variants/ButtonTertiary/index.cjs.map +1 -1
- package/dist/components/Button/variants/ButtonTertiary/index.d.cts +0 -1
- package/dist/components/Button/variants/ButtonTertiary/index.d.cts.map +1 -1
- package/dist/components/Button/variants/ButtonTertiary/index.d.mts +0 -1
- package/dist/components/Button/variants/ButtonTertiary/index.d.mts.map +1 -1
- package/dist/components/Button/variants/ButtonTertiary/index.mjs +0 -1
- package/dist/components/Button/variants/ButtonTertiary/index.mjs.map +1 -1
- package/dist/components/ButtonBase/ButtonBase.cjs +43 -29
- package/dist/components/ButtonBase/ButtonBase.cjs.map +1 -1
- package/dist/components/ButtonBase/ButtonBase.constants.cjs +35 -5
- package/dist/components/ButtonBase/ButtonBase.constants.cjs.map +1 -1
- package/dist/components/ButtonBase/ButtonBase.constants.d.cts +6 -1
- package/dist/components/ButtonBase/ButtonBase.constants.d.cts.map +1 -1
- package/dist/components/ButtonBase/ButtonBase.constants.d.mts +6 -1
- package/dist/components/ButtonBase/ButtonBase.constants.d.mts.map +1 -1
- package/dist/components/ButtonBase/ButtonBase.constants.mjs +29 -1
- package/dist/components/ButtonBase/ButtonBase.constants.mjs.map +1 -1
- package/dist/components/ButtonBase/ButtonBase.d.cts +1 -1
- package/dist/components/ButtonBase/ButtonBase.d.cts.map +1 -1
- package/dist/components/ButtonBase/ButtonBase.d.mts +1 -1
- package/dist/components/ButtonBase/ButtonBase.d.mts.map +1 -1
- package/dist/components/ButtonBase/ButtonBase.mjs +45 -31
- package/dist/components/ButtonBase/ButtonBase.mjs.map +1 -1
- package/dist/components/ButtonBase/ButtonBase.types.cjs.map +1 -1
- package/dist/components/ButtonBase/ButtonBase.types.d.cts +13 -30
- package/dist/components/ButtonBase/ButtonBase.types.d.cts.map +1 -1
- package/dist/components/ButtonBase/ButtonBase.types.d.mts +13 -30
- package/dist/components/ButtonBase/ButtonBase.types.d.mts.map +1 -1
- package/dist/components/ButtonBase/ButtonBase.types.mjs.map +1 -1
- package/dist/components/ButtonBase/index.cjs +2 -2
- package/dist/components/ButtonBase/index.cjs.map +1 -1
- package/dist/components/ButtonBase/index.d.cts +1 -1
- package/dist/components/ButtonBase/index.d.cts.map +1 -1
- package/dist/components/ButtonBase/index.d.mts +1 -1
- package/dist/components/ButtonBase/index.d.mts.map +1 -1
- package/dist/components/ButtonBase/index.mjs +1 -1
- package/dist/components/ButtonBase/index.mjs.map +1 -1
- package/dist/components/ButtonHero/index.cjs +2 -2
- package/dist/components/ButtonHero/index.cjs.map +1 -1
- package/dist/components/ButtonHero/index.d.cts +1 -1
- package/dist/components/ButtonHero/index.d.cts.map +1 -1
- package/dist/components/ButtonHero/index.d.mts +1 -1
- package/dist/components/ButtonHero/index.d.mts.map +1 -1
- package/dist/components/ButtonHero/index.mjs +1 -1
- package/dist/components/ButtonHero/index.mjs.map +1 -1
- package/dist/components/ButtonIcon/ButtonIcon.cjs +6 -6
- package/dist/components/ButtonIcon/ButtonIcon.cjs.map +1 -1
- package/dist/components/ButtonIcon/ButtonIcon.constants.cjs +7 -8
- package/dist/components/ButtonIcon/ButtonIcon.constants.cjs.map +1 -1
- package/dist/components/ButtonIcon/ButtonIcon.constants.d.cts +1 -2
- package/dist/components/ButtonIcon/ButtonIcon.constants.d.cts.map +1 -1
- package/dist/components/ButtonIcon/ButtonIcon.constants.d.mts +1 -2
- package/dist/components/ButtonIcon/ButtonIcon.constants.d.mts.map +1 -1
- package/dist/components/ButtonIcon/ButtonIcon.constants.mjs +1 -2
- package/dist/components/ButtonIcon/ButtonIcon.constants.mjs.map +1 -1
- package/dist/components/ButtonIcon/ButtonIcon.d.cts.map +1 -1
- package/dist/components/ButtonIcon/ButtonIcon.d.mts.map +1 -1
- package/dist/components/ButtonIcon/ButtonIcon.mjs +1 -1
- package/dist/components/ButtonIcon/ButtonIcon.mjs.map +1 -1
- package/dist/components/ButtonIcon/ButtonIcon.types.cjs.map +1 -1
- package/dist/components/ButtonIcon/ButtonIcon.types.d.cts +3 -26
- package/dist/components/ButtonIcon/ButtonIcon.types.d.cts.map +1 -1
- package/dist/components/ButtonIcon/ButtonIcon.types.d.mts +3 -26
- package/dist/components/ButtonIcon/ButtonIcon.types.d.mts.map +1 -1
- package/dist/components/ButtonIcon/ButtonIcon.types.mjs.map +1 -1
- package/dist/components/ButtonIcon/index.cjs +3 -3
- package/dist/components/ButtonIcon/index.cjs.map +1 -1
- package/dist/components/ButtonIcon/index.d.cts +1 -1
- package/dist/components/ButtonIcon/index.d.cts.map +1 -1
- package/dist/components/ButtonIcon/index.d.mts +1 -1
- package/dist/components/ButtonIcon/index.d.mts.map +1 -1
- package/dist/components/ButtonIcon/index.mjs +1 -1
- package/dist/components/ButtonIcon/index.mjs.map +1 -1
- package/dist/components/ButtonSemantic/ButtonSemantic.cjs +1 -17
- package/dist/components/ButtonSemantic/ButtonSemantic.cjs.map +1 -1
- package/dist/components/ButtonSemantic/ButtonSemantic.d.cts.map +1 -1
- package/dist/components/ButtonSemantic/ButtonSemantic.d.mts.map +1 -1
- package/dist/components/ButtonSemantic/ButtonSemantic.mjs +1 -17
- package/dist/components/ButtonSemantic/ButtonSemantic.mjs.map +1 -1
- package/dist/components/HeaderStandard/HeaderStandard.cjs +2 -26
- package/dist/components/HeaderStandard/HeaderStandard.cjs.map +1 -1
- package/dist/components/HeaderStandard/HeaderStandard.d.cts.map +1 -1
- package/dist/components/HeaderStandard/HeaderStandard.d.mts.map +1 -1
- package/dist/components/HeaderStandard/HeaderStandard.mjs +2 -26
- package/dist/components/HeaderStandard/HeaderStandard.mjs.map +1 -1
- package/dist/components/HeaderStandard/HeaderStandard.types.cjs +0 -5
- package/dist/components/HeaderStandard/HeaderStandard.types.cjs.map +1 -1
- package/dist/components/HeaderStandard/HeaderStandard.types.d.cts +2 -28
- package/dist/components/HeaderStandard/HeaderStandard.types.d.cts.map +1 -1
- package/dist/components/HeaderStandard/HeaderStandard.types.d.mts +2 -28
- package/dist/components/HeaderStandard/HeaderStandard.types.d.mts.map +1 -1
- package/dist/components/HeaderStandard/HeaderStandard.types.mjs +1 -9
- package/dist/components/HeaderStandard/HeaderStandard.types.mjs.map +1 -1
- package/dist/components/HeaderStandardAnimated/HeaderStandardAnimated.cjs +63 -0
- package/dist/components/HeaderStandardAnimated/HeaderStandardAnimated.cjs.map +1 -0
- package/dist/components/HeaderStandardAnimated/HeaderStandardAnimated.d.cts +4 -0
- package/dist/components/HeaderStandardAnimated/HeaderStandardAnimated.d.cts.map +1 -0
- package/dist/components/HeaderStandardAnimated/HeaderStandardAnimated.d.mts +4 -0
- package/dist/components/HeaderStandardAnimated/HeaderStandardAnimated.d.mts.map +1 -0
- package/dist/components/HeaderStandardAnimated/HeaderStandardAnimated.mjs +40 -0
- package/dist/components/HeaderStandardAnimated/HeaderStandardAnimated.mjs.map +1 -0
- package/dist/components/HeaderStandardAnimated/HeaderStandardAnimated.types.cjs +3 -0
- package/dist/components/HeaderStandardAnimated/HeaderStandardAnimated.types.cjs.map +1 -0
- package/dist/components/HeaderStandardAnimated/HeaderStandardAnimated.types.d.cts +31 -0
- package/dist/components/HeaderStandardAnimated/HeaderStandardAnimated.types.d.cts.map +1 -0
- package/dist/components/HeaderStandardAnimated/HeaderStandardAnimated.types.d.mts +31 -0
- package/dist/components/HeaderStandardAnimated/HeaderStandardAnimated.types.d.mts.map +1 -0
- package/dist/components/HeaderStandardAnimated/HeaderStandardAnimated.types.mjs +2 -0
- package/dist/components/HeaderStandardAnimated/HeaderStandardAnimated.types.mjs.map +1 -0
- package/dist/components/HeaderStandardAnimated/index.cjs +8 -0
- package/dist/components/HeaderStandardAnimated/index.cjs.map +1 -0
- package/dist/components/HeaderStandardAnimated/index.d.cts +4 -0
- package/dist/components/HeaderStandardAnimated/index.d.cts.map +1 -0
- package/dist/components/HeaderStandardAnimated/index.d.mts +4 -0
- package/dist/components/HeaderStandardAnimated/index.d.mts.map +1 -0
- package/dist/components/HeaderStandardAnimated/index.mjs +3 -0
- package/dist/components/HeaderStandardAnimated/index.mjs.map +1 -0
- package/dist/components/HeaderStandardAnimated/useHeaderStandardAnimated.cjs +62 -0
- package/dist/components/HeaderStandardAnimated/useHeaderStandardAnimated.cjs.map +1 -0
- package/dist/components/HeaderStandardAnimated/useHeaderStandardAnimated.d.cts +39 -0
- package/dist/components/HeaderStandardAnimated/useHeaderStandardAnimated.d.cts.map +1 -0
- package/dist/components/HeaderStandardAnimated/useHeaderStandardAnimated.d.mts +39 -0
- package/dist/components/HeaderStandardAnimated/useHeaderStandardAnimated.d.mts.map +1 -0
- package/dist/components/HeaderStandardAnimated/useHeaderStandardAnimated.mjs +57 -0
- package/dist/components/HeaderStandardAnimated/useHeaderStandardAnimated.mjs.map +1 -0
- package/dist/components/Icon/Icon.assets.cjs +298 -283
- 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 +298 -283
- package/dist/components/Icon/Icon.assets.mjs.map +1 -1
- package/dist/components/Icon/Icon.cjs +2 -2
- package/dist/components/Icon/Icon.cjs.map +1 -1
- package/dist/components/Icon/Icon.d.cts.map +1 -1
- package/dist/components/Icon/Icon.d.mts.map +1 -1
- package/dist/components/Icon/Icon.mjs +1 -1
- package/dist/components/Icon/Icon.mjs.map +1 -1
- package/dist/components/Icon/Icon.types.cjs.map +1 -1
- package/dist/components/Icon/Icon.types.d.cts +2 -19
- package/dist/components/Icon/Icon.types.d.cts.map +1 -1
- package/dist/components/Icon/Icon.types.d.mts +2 -19
- package/dist/components/Icon/Icon.types.d.mts.map +1 -1
- package/dist/components/Icon/Icon.types.mjs.map +1 -1
- package/dist/components/Icon/assets/after-hours.svg +1 -1
- package/dist/components/Icon/assets/candlestick.svg +1 -1
- package/dist/components/Icon/assets/group.svg +1 -0
- package/dist/components/Icon/assets/list-arrow.svg +1 -0
- package/dist/components/Icon/assets/merge.svg +1 -0
- package/dist/components/Icon/assets/musd-filled.svg +1 -0
- package/dist/components/Icon/assets/musd.svg +1 -0
- package/dist/components/Icon/assets/pie-chart.svg +1 -0
- package/dist/components/Icon/assets/predictions.svg +1 -0
- package/dist/components/Icon/assets/telegram.svg +3 -0
- package/dist/components/Icon/index.cjs +4 -4
- package/dist/components/Icon/index.cjs.map +1 -1
- package/dist/components/Icon/index.d.cts +1 -1
- package/dist/components/Icon/index.d.cts.map +1 -1
- package/dist/components/Icon/index.d.mts +1 -1
- package/dist/components/Icon/index.d.mts.map +1 -1
- package/dist/components/Icon/index.mjs +1 -1
- package/dist/components/Icon/index.mjs.map +1 -1
- package/dist/components/IconAlert/IconAlert.constants.cjs +8 -9
- package/dist/components/IconAlert/IconAlert.constants.cjs.map +1 -1
- package/dist/components/IconAlert/IconAlert.constants.d.cts +1 -2
- package/dist/components/IconAlert/IconAlert.constants.d.cts.map +1 -1
- package/dist/components/IconAlert/IconAlert.constants.d.mts +1 -2
- package/dist/components/IconAlert/IconAlert.constants.d.mts.map +1 -1
- package/dist/components/IconAlert/IconAlert.constants.mjs +1 -2
- package/dist/components/IconAlert/IconAlert.constants.mjs.map +1 -1
- package/dist/components/Input/Input.cjs +35 -25
- package/dist/components/Input/Input.cjs.map +1 -1
- package/dist/components/Input/Input.d.cts +1 -7
- package/dist/components/Input/Input.d.cts.map +1 -1
- package/dist/components/Input/Input.d.mts +1 -7
- package/dist/components/Input/Input.d.mts.map +1 -1
- package/dist/components/Input/Input.mjs +36 -26
- package/dist/components/Input/Input.mjs.map +1 -1
- package/dist/components/Input/Input.types.cjs.map +1 -1
- package/dist/components/Input/Input.types.d.cts +2 -30
- package/dist/components/Input/Input.types.d.cts.map +1 -1
- package/dist/components/Input/Input.types.d.mts +2 -30
- package/dist/components/Input/Input.types.d.mts.map +1 -1
- package/dist/components/Input/Input.types.mjs.map +1 -1
- package/dist/components/KeyValueColumn/KeyValueColumn.cjs +2 -2
- package/dist/components/KeyValueColumn/KeyValueColumn.cjs.map +1 -1
- package/dist/components/KeyValueColumn/KeyValueColumn.d.cts.map +1 -1
- package/dist/components/KeyValueColumn/KeyValueColumn.d.mts.map +1 -1
- package/dist/components/KeyValueColumn/KeyValueColumn.mjs +2 -2
- package/dist/components/KeyValueColumn/KeyValueColumn.mjs.map +1 -1
- package/dist/components/KeyValueRow/KeyValueRow.cjs +2 -2
- package/dist/components/KeyValueRow/KeyValueRow.cjs.map +1 -1
- package/dist/components/KeyValueRow/KeyValueRow.d.cts.map +1 -1
- package/dist/components/KeyValueRow/KeyValueRow.d.mts.map +1 -1
- package/dist/components/KeyValueRow/KeyValueRow.mjs +2 -2
- package/dist/components/KeyValueRow/KeyValueRow.mjs.map +1 -1
- package/dist/components/TabEmptyState/TabEmptyState.cjs +1 -1
- package/dist/components/TabEmptyState/TabEmptyState.cjs.map +1 -1
- package/dist/components/TabEmptyState/TabEmptyState.d.cts.map +1 -1
- package/dist/components/TabEmptyState/TabEmptyState.d.mts.map +1 -1
- package/dist/components/TabEmptyState/TabEmptyState.mjs +1 -1
- package/dist/components/TabEmptyState/TabEmptyState.mjs.map +1 -1
- package/dist/components/Tag/Tag.constants.cjs +10 -11
- package/dist/components/Tag/Tag.constants.cjs.map +1 -1
- package/dist/components/Tag/Tag.constants.d.cts +1 -2
- package/dist/components/Tag/Tag.constants.d.cts.map +1 -1
- package/dist/components/Tag/Tag.constants.d.mts +1 -2
- package/dist/components/Tag/Tag.constants.d.mts.map +1 -1
- package/dist/components/Tag/Tag.constants.mjs +1 -2
- package/dist/components/Tag/Tag.constants.mjs.map +1 -1
- package/dist/components/TextArea/TextArea.cjs +38 -0
- package/dist/components/TextArea/TextArea.cjs.map +1 -0
- package/dist/components/TextArea/TextArea.d.cts +166 -0
- package/dist/components/TextArea/TextArea.d.cts.map +1 -0
- package/dist/components/TextArea/TextArea.d.mts +166 -0
- package/dist/components/TextArea/TextArea.d.mts.map +1 -0
- package/dist/components/TextArea/TextArea.mjs +35 -0
- package/dist/components/TextArea/TextArea.mjs.map +1 -0
- package/dist/components/TextArea/TextArea.types.cjs +3 -0
- package/dist/components/TextArea/TextArea.types.cjs.map +1 -0
- package/dist/components/TextArea/TextArea.types.d.cts +63 -0
- package/dist/components/TextArea/TextArea.types.d.cts.map +1 -0
- package/dist/components/TextArea/TextArea.types.d.mts +63 -0
- package/dist/components/TextArea/TextArea.types.d.mts.map +1 -0
- package/dist/components/TextArea/TextArea.types.mjs +2 -0
- package/dist/components/TextArea/TextArea.types.mjs.map +1 -0
- package/dist/components/TextArea/index.cjs +6 -0
- package/dist/components/TextArea/index.cjs.map +1 -0
- package/dist/components/TextArea/index.d.cts +3 -0
- package/dist/components/TextArea/index.d.cts.map +1 -0
- package/dist/components/TextArea/index.d.mts +3 -0
- package/dist/components/TextArea/index.d.mts.map +1 -0
- package/dist/components/TextArea/index.mjs +2 -0
- package/dist/components/TextArea/index.mjs.map +1 -0
- package/dist/components/TextField/TextField.cjs +10 -31
- package/dist/components/TextField/TextField.cjs.map +1 -1
- package/dist/components/TextField/TextField.d.cts +162 -4
- package/dist/components/TextField/TextField.d.cts.map +1 -1
- package/dist/components/TextField/TextField.d.mts +162 -4
- package/dist/components/TextField/TextField.d.mts.map +1 -1
- package/dist/components/TextField/TextField.mjs +12 -33
- package/dist/components/TextField/TextField.mjs.map +1 -1
- package/dist/components/TextField/TextField.types.cjs.map +1 -1
- package/dist/components/TextField/TextField.types.d.cts +45 -16
- package/dist/components/TextField/TextField.types.d.cts.map +1 -1
- package/dist/components/TextField/TextField.types.d.mts +45 -16
- package/dist/components/TextField/TextField.types.d.mts.map +1 -1
- package/dist/components/TextField/TextField.types.mjs.map +1 -1
- package/dist/components/TextFieldSearch/TextFieldSearch.cjs.map +1 -1
- package/dist/components/TextFieldSearch/TextFieldSearch.d.cts +163 -5
- package/dist/components/TextFieldSearch/TextFieldSearch.d.cts.map +1 -1
- package/dist/components/TextFieldSearch/TextFieldSearch.d.mts +163 -5
- package/dist/components/TextFieldSearch/TextFieldSearch.d.mts.map +1 -1
- package/dist/components/TextFieldSearch/TextFieldSearch.mjs.map +1 -1
- package/dist/components/TitleStandard/TitleStandard.cjs +58 -0
- package/dist/components/TitleStandard/TitleStandard.cjs.map +1 -0
- package/dist/components/TitleStandard/TitleStandard.d.cts +23 -0
- package/dist/components/TitleStandard/TitleStandard.d.cts.map +1 -0
- package/dist/components/TitleStandard/TitleStandard.d.mts +23 -0
- package/dist/components/TitleStandard/TitleStandard.d.mts.map +1 -0
- package/dist/components/TitleStandard/TitleStandard.mjs +58 -0
- package/dist/components/TitleStandard/TitleStandard.mjs.map +1 -0
- package/dist/components/TitleStandard/TitleStandard.types.cjs +3 -0
- package/dist/components/TitleStandard/TitleStandard.types.cjs.map +1 -0
- package/dist/components/TitleStandard/TitleStandard.types.d.cts +31 -0
- package/dist/components/TitleStandard/TitleStandard.types.d.cts.map +1 -0
- package/dist/components/TitleStandard/TitleStandard.types.d.mts +31 -0
- package/dist/components/TitleStandard/TitleStandard.types.d.mts.map +1 -0
- package/dist/components/TitleStandard/TitleStandard.types.mjs +2 -0
- package/dist/components/TitleStandard/TitleStandard.types.mjs.map +1 -0
- package/dist/components/TitleStandard/index.cjs +6 -0
- package/dist/components/TitleStandard/index.cjs.map +1 -0
- package/dist/components/TitleStandard/index.d.cts +3 -0
- package/dist/components/TitleStandard/index.d.cts.map +1 -0
- package/dist/components/TitleStandard/index.d.mts +3 -0
- package/dist/components/TitleStandard/index.d.mts.map +1 -0
- package/dist/components/TitleStandard/index.mjs +2 -0
- package/dist/components/TitleStandard/index.mjs.map +1 -0
- package/dist/components/TitleSubpage/TitleSubpage.cjs +85 -0
- package/dist/components/TitleSubpage/TitleSubpage.cjs.map +1 -0
- package/dist/components/TitleSubpage/TitleSubpage.d.cts +30 -0
- package/dist/components/TitleSubpage/TitleSubpage.d.cts.map +1 -0
- package/dist/components/TitleSubpage/TitleSubpage.d.mts +30 -0
- package/dist/components/TitleSubpage/TitleSubpage.d.mts.map +1 -0
- package/dist/components/TitleSubpage/TitleSubpage.mjs +85 -0
- package/dist/components/TitleSubpage/TitleSubpage.mjs.map +1 -0
- package/dist/components/TitleSubpage/TitleSubpage.types.cjs +3 -0
- package/dist/components/TitleSubpage/TitleSubpage.types.cjs.map +1 -0
- package/dist/components/TitleSubpage/TitleSubpage.types.d.cts +44 -0
- package/dist/components/TitleSubpage/TitleSubpage.types.d.cts.map +1 -0
- package/dist/components/TitleSubpage/TitleSubpage.types.d.mts +44 -0
- package/dist/components/TitleSubpage/TitleSubpage.types.d.mts.map +1 -0
- package/dist/components/TitleSubpage/TitleSubpage.types.mjs +2 -0
- package/dist/components/TitleSubpage/TitleSubpage.types.mjs.map +1 -0
- package/dist/components/TitleSubpage/index.cjs +6 -0
- package/dist/components/TitleSubpage/index.cjs.map +1 -0
- package/dist/components/TitleSubpage/index.d.cts +3 -0
- package/dist/components/TitleSubpage/index.d.cts.map +1 -0
- package/dist/components/TitleSubpage/index.d.mts +3 -0
- package/dist/components/TitleSubpage/index.d.mts.map +1 -0
- package/dist/components/TitleSubpage/index.mjs +2 -0
- package/dist/components/TitleSubpage/index.mjs.map +1 -0
- package/dist/components/Toast/Toast.cjs +40 -162
- package/dist/components/Toast/Toast.cjs.map +1 -1
- package/dist/components/Toast/Toast.constants.cjs +8 -1
- package/dist/components/Toast/Toast.constants.cjs.map +1 -1
- package/dist/components/Toast/Toast.constants.d.cts +5 -0
- package/dist/components/Toast/Toast.constants.d.cts.map +1 -1
- package/dist/components/Toast/Toast.constants.d.mts +5 -0
- package/dist/components/Toast/Toast.constants.d.mts.map +1 -1
- package/dist/components/Toast/Toast.constants.mjs +7 -0
- package/dist/components/Toast/Toast.constants.mjs.map +1 -1
- package/dist/components/Toast/Toast.d.cts +2 -5
- package/dist/components/Toast/Toast.d.cts.map +1 -1
- package/dist/components/Toast/Toast.d.mts +2 -5
- package/dist/components/Toast/Toast.d.mts.map +1 -1
- package/dist/components/Toast/Toast.mjs +39 -142
- package/dist/components/Toast/Toast.mjs.map +1 -1
- package/dist/components/Toast/Toast.types.cjs +9 -14
- package/dist/components/Toast/Toast.types.cjs.map +1 -1
- package/dist/components/Toast/Toast.types.d.cts +29 -98
- package/dist/components/Toast/Toast.types.d.cts.map +1 -1
- package/dist/components/Toast/Toast.types.d.mts +29 -98
- package/dist/components/Toast/Toast.types.d.mts.map +1 -1
- package/dist/components/Toast/Toast.types.mjs +8 -13
- package/dist/components/Toast/Toast.types.mjs.map +1 -1
- package/dist/components/Toast/Toaster.cjs +142 -0
- package/dist/components/Toast/Toaster.cjs.map +1 -0
- package/dist/components/Toast/Toaster.d.cts +11 -0
- package/dist/components/Toast/Toaster.d.cts.map +1 -0
- package/dist/components/Toast/Toaster.d.mts +11 -0
- package/dist/components/Toast/Toaster.d.mts.map +1 -0
- package/dist/components/Toast/Toaster.mjs +123 -0
- package/dist/components/Toast/Toaster.mjs.map +1 -0
- package/dist/components/Toast/index.cjs +5 -6
- package/dist/components/Toast/index.cjs.map +1 -1
- package/dist/components/Toast/index.d.cts +3 -3
- package/dist/components/Toast/index.d.cts.map +1 -1
- package/dist/components/Toast/index.d.mts +3 -3
- package/dist/components/Toast/index.d.mts.map +1 -1
- package/dist/components/Toast/index.mjs +2 -2
- package/dist/components/Toast/index.mjs.map +1 -1
- package/dist/components/index.cjs +16 -6
- package/dist/components/index.cjs.map +1 -1
- package/dist/components/index.d.cts +12 -2
- package/dist/components/index.d.cts.map +1 -1
- package/dist/components/index.d.mts +12 -2
- package/dist/components/index.d.mts.map +1 -1
- package/dist/components/index.mjs +6 -1
- package/dist/components/index.mjs.map +1 -1
- package/dist/components/temp-components/HeaderStandardCenterColumn/HeaderStandardCenterColumn.cjs +36 -0
- package/dist/components/temp-components/HeaderStandardCenterColumn/HeaderStandardCenterColumn.cjs.map +1 -0
- package/dist/components/temp-components/HeaderStandardCenterColumn/HeaderStandardCenterColumn.d.cts +4 -0
- package/dist/components/temp-components/HeaderStandardCenterColumn/HeaderStandardCenterColumn.d.cts.map +1 -0
- package/dist/components/temp-components/HeaderStandardCenterColumn/HeaderStandardCenterColumn.d.mts +4 -0
- package/dist/components/temp-components/HeaderStandardCenterColumn/HeaderStandardCenterColumn.d.mts.map +1 -0
- package/dist/components/temp-components/HeaderStandardCenterColumn/HeaderStandardCenterColumn.mjs +36 -0
- package/dist/components/temp-components/HeaderStandardCenterColumn/HeaderStandardCenterColumn.mjs.map +1 -0
- package/dist/components/temp-components/HeaderStandardCenterColumn/HeaderStandardCenterColumn.types.cjs +8 -0
- package/dist/components/temp-components/HeaderStandardCenterColumn/HeaderStandardCenterColumn.types.cjs.map +1 -0
- package/dist/components/temp-components/HeaderStandardCenterColumn/HeaderStandardCenterColumn.types.d.cts +39 -0
- package/dist/components/temp-components/HeaderStandardCenterColumn/HeaderStandardCenterColumn.types.d.cts.map +1 -0
- package/dist/components/temp-components/HeaderStandardCenterColumn/HeaderStandardCenterColumn.types.d.mts +39 -0
- package/dist/components/temp-components/HeaderStandardCenterColumn/HeaderStandardCenterColumn.types.d.mts.map +1 -0
- package/dist/components/temp-components/HeaderStandardCenterColumn/HeaderStandardCenterColumn.types.mjs +10 -0
- package/dist/components/temp-components/HeaderStandardCenterColumn/HeaderStandardCenterColumn.types.mjs.map +1 -0
- package/dist/components/temp-components/HeaderStandardCenterColumn/index.cjs +6 -0
- package/dist/components/temp-components/HeaderStandardCenterColumn/index.cjs.map +1 -0
- package/dist/components/temp-components/HeaderStandardCenterColumn/index.d.cts +3 -0
- package/dist/components/temp-components/HeaderStandardCenterColumn/index.d.cts.map +1 -0
- package/dist/components/temp-components/HeaderStandardCenterColumn/index.d.mts +3 -0
- package/dist/components/temp-components/HeaderStandardCenterColumn/index.d.mts.map +1 -0
- package/dist/components/temp-components/HeaderStandardCenterColumn/index.mjs +2 -0
- package/dist/components/temp-components/HeaderStandardCenterColumn/index.mjs.map +1 -0
- package/dist/types/index.cjs +9 -609
- package/dist/types/index.cjs.map +1 -1
- package/dist/types/index.d.cts +4 -596
- package/dist/types/index.d.cts.map +1 -1
- package/dist/types/index.d.mts +4 -596
- package/dist/types/index.d.mts.map +1 -1
- package/dist/types/index.mjs +4 -610
- package/dist/types/index.mjs.map +1 -1
- package/package.json +5 -6
- package/dist/components/Toast/Toast.context.cjs +0 -40
- package/dist/components/Toast/Toast.context.cjs.map +0 -1
- package/dist/components/Toast/Toast.context.d.cts +0 -7
- package/dist/components/Toast/Toast.context.d.cts.map +0 -1
- package/dist/components/Toast/Toast.context.d.mts +0 -7
- package/dist/components/Toast/Toast.context.d.mts.map +0 -1
- package/dist/components/Toast/Toast.context.mjs +0 -20
- package/dist/components/Toast/Toast.context.mjs.map +0 -1
|
@@ -8,10 +8,11 @@ const react_1 = require("react");
|
|
|
8
8
|
const react_native_1 = require("react-native/index.js");
|
|
9
9
|
const Text_constants_1 = require("../Text/Text.constants.cjs");
|
|
10
10
|
const Input_constants_1 = require("./Input.constants.cjs");
|
|
11
|
-
exports.Input = (0, react_1.forwardRef)(({ style, textVariant = design_system_shared_1.TextVariant.BodyMd, isStateStylesDisabled, isDisabled = false,
|
|
11
|
+
exports.Input = (0, react_1.forwardRef)(({ style, textVariant = design_system_shared_1.TextVariant.BodyMd, isStateStylesDisabled, isDisabled = false, isReadOnly = false, value, placeholder, twClassName, onBlur, onFocus, autoFocus = false, multiline, ...props }, ref) => {
|
|
12
12
|
const [isFocused, setIsFocused] = (0, react_1.useState)(autoFocus);
|
|
13
13
|
const tw = (0, design_system_twrnc_preset_1.useTailwind)();
|
|
14
14
|
const theme = (0, design_system_twrnc_preset_1.useTheme)();
|
|
15
|
+
const isMultiline = multiline === true;
|
|
15
16
|
const placeholderTextColor = (0, react_1.useMemo)(() => theme === design_system_twrnc_preset_1.Theme.Light
|
|
16
17
|
? design_tokens_1.lightTheme.colors.text.alternative
|
|
17
18
|
: design_tokens_1.darkTheme.colors.text.alternative, [theme]);
|
|
@@ -23,7 +24,14 @@ exports.Input = (0, react_1.forwardRef)(({ style, textVariant = design_system_sh
|
|
|
23
24
|
// the controlled value is empty. This keeps the iOS lineHeight workaround
|
|
24
25
|
// scoped to the placeholder-visible state without affecting typed text.
|
|
25
26
|
const isPlaceholderVisible = hasPlaceholder && value === '';
|
|
26
|
-
|
|
27
|
+
// Multiline field styles
|
|
28
|
+
const multilineChromeStyle = (0, react_1.useMemo)(() => tw.style('text-default', 'bg-default', 'border', 'border-transparent', !isStateStylesDisabled && isDisabled && 'opacity-50', !isStateStylesDisabled &&
|
|
29
|
+
!isDisabled &&
|
|
30
|
+
isFocused &&
|
|
31
|
+
'border-primary-default', twClassName), [isStateStylesDisabled, isDisabled, isFocused, twClassName, tw]);
|
|
32
|
+
const multilineTypographyStyle = (0, react_1.useMemo)(() => tw.style(`text-${textVariant}`, fontClass), [textVariant, fontClass, tw]);
|
|
33
|
+
// Single-line field styles
|
|
34
|
+
const singleLineChromeStyle = (0, react_1.useMemo)(() => tw.style(fontClass, 'text-default', 'bg-default', 'border', 'border-transparent', !isStateStylesDisabled && isDisabled && 'opacity-50', !isStateStylesDisabled &&
|
|
27
35
|
!isDisabled &&
|
|
28
36
|
isFocused &&
|
|
29
37
|
'border-primary-default', twClassName), [
|
|
@@ -34,31 +42,33 @@ exports.Input = (0, react_1.forwardRef)(({ style, textVariant = design_system_sh
|
|
|
34
42
|
twClassName,
|
|
35
43
|
tw,
|
|
36
44
|
]);
|
|
37
|
-
const
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
45
|
+
const singleLineTypographyStyle = (0, react_1.useMemo)(() => Input_constants_1.MAP_TEXT_VARIANT_INPUT_METRICS[textVariant], [textVariant]);
|
|
46
|
+
// iOS-only single-line placeholder fix: native TextInput can render
|
|
47
|
+
// placeholder text vertically offset. Do not use on Android (lineHeight 0
|
|
48
|
+
// collapses text) or on multiline (breaks paragraph layout).
|
|
49
|
+
const iosSingleLinePlaceholderLineHeightFix = react_native_1.Platform.OS === 'ios' &&
|
|
50
|
+
isPlaceholderVisible && { lineHeight: 0 };
|
|
51
|
+
const resolvedStyle = (isMultiline
|
|
52
|
+
? [multilineChromeStyle, multilineTypographyStyle, style]
|
|
53
|
+
: [
|
|
54
|
+
singleLineChromeStyle,
|
|
55
|
+
singleLineTypographyStyle,
|
|
56
|
+
iosSingleLinePlaceholderLineHeightFix,
|
|
57
|
+
style,
|
|
58
|
+
]).filter(Boolean);
|
|
59
|
+
(0, react_1.useEffect)(() => {
|
|
60
|
+
if (isDisabled || isReadOnly) {
|
|
41
61
|
setIsFocused(false);
|
|
42
|
-
onBlur?.(e);
|
|
43
62
|
}
|
|
44
|
-
}, [isDisabled,
|
|
45
|
-
|
|
63
|
+
}, [isDisabled, isReadOnly]);
|
|
64
|
+
const onBlurHandler = (0, react_1.useCallback)((e) => {
|
|
65
|
+
setIsFocused(false);
|
|
66
|
+
onBlur?.(e);
|
|
67
|
+
}, [onBlur]);
|
|
46
68
|
const onFocusHandler = (0, react_1.useCallback)((e) => {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
}, [isDisabled, onFocus]);
|
|
52
|
-
const resolvedStyle = [
|
|
53
|
-
inputStyle,
|
|
54
|
-
variantTextStyle,
|
|
55
|
-
// iOS-only workaround: when a placeholder is visible, native iOS
|
|
56
|
-
// TextInput can render placeholder text vertically offset.
|
|
57
|
-
// Keep this iOS-only because lineHeight: 0 can collapse text on Android.
|
|
58
|
-
react_native_1.Platform.OS === 'ios' &&
|
|
59
|
-
isPlaceholderVisible && { lineHeight: 0 },
|
|
60
|
-
style,
|
|
61
|
-
].filter(Boolean);
|
|
62
|
-
return (<react_native_1.TextInput ref={ref} placeholderTextColor={placeholderTextColor} {...props} placeholder={placeholder} value={value} style={resolvedStyle} editable={!isDisabled && !isReadonly} autoFocus={autoFocus} onBlur={onBlurHandler} onFocus={onFocusHandler}/>);
|
|
69
|
+
setIsFocused(true);
|
|
70
|
+
onFocus?.(e);
|
|
71
|
+
}, [onFocus]);
|
|
72
|
+
return (<react_native_1.TextInput ref={ref} {...props} multiline={multiline} placeholder={placeholder} placeholderTextColor={placeholderTextColor} value={value} style={resolvedStyle} editable={!isDisabled && !isReadOnly} autoFocus={autoFocus} onBlur={onBlurHandler} onFocus={onFocusHandler}/>);
|
|
63
73
|
});
|
|
64
74
|
//# sourceMappingURL=Input.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Input.cjs","sourceRoot":"","sources":["../../../src/components/Input/Input.tsx"],"names":[],"mappings":";;;AAAA,kFAAkF;AAClF,8FAIuD;AACvD,oEAAyE;AACzE,
|
|
1
|
+
{"version":3,"file":"Input.cjs","sourceRoot":"","sources":["../../../src/components/Input/Input.tsx"],"names":[],"mappings":";;;AAAA,kFAAkF;AAClF,8FAIuD;AACvD,oEAAyE;AACzE,iCAA8E;AAC9E,wDAAmD;AAEnD,+DAGgC;AAEhC,2DAAmE;AAGtD,QAAA,KAAK,GAAG,IAAA,kBAAU,EAC7B,CACE,EACE,KAAK,EACL,WAAW,GAAG,kCAAW,CAAC,MAAM,EAChC,qBAAqB,EACrB,UAAU,GAAG,KAAK,EAClB,UAAU,GAAG,KAAK,EAClB,KAAK,EACL,WAAW,EACX,WAAW,EACX,MAAM,EACN,OAAO,EACP,SAAS,GAAG,KAAK,EACjB,SAAS,EACT,GAAG,KAAK,EACT,EACD,GAAG,EACH,EAAE;IACF,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,IAAA,gBAAQ,EAAC,SAAS,CAAC,CAAC;IACtD,MAAM,EAAE,GAAG,IAAA,wCAA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AE,CAAC,CAAC,CAAC,CAAC;IACd,CAAC,EACD,CAAC,MAAM,CAAC,CACT,CAAC;IAEF,MAAM,cAAc,GAAG,IAAA,mBAAW,EAChC,CAAC,CAAoD,EAAE,EAAE;QACvD,YAAY,CAAC,IAAI,CAAC,CAAC;QACnB,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC;IACf,CAAC,EACD,CAAC,OAAO,CAAC,CACV,CAAC;IAEF,OAAO,CACL,CAAC,wBAAS,CACR,GAAG,CAAC,CAAC,GAAG,CAAC,CACT,IAAI,KAAK,CAAC,CACV,SAAS,CAAC,CAAC,SAAS,CAAC,CACrB,WAAW,CAAC,CAAC,WAAW,CAAC,CACzB,oBAAoB,CAAC,CAAC,oBAAoB,CAAC,CAC3C,KAAK,CAAC,CAAC,KAAK,CAAC,CACb,KAAK,CAAC,CAAC,aAAa,CAAC,CACrB,QAAQ,CAAC,CAAC,CAAC,UAAU,IAAI,CAAC,UAAU,CAAC,CACrC,SAAS,CAAC,CAAC,SAAS,CAAC,CACrB,MAAM,CAAC,CAAC,aAAa,CAAC,CACtB,OAAO,CAAC,CAAC,cAAc,CAAC,EACxB,CACH,CAAC;AACJ,CAAC,CACF,CAAC","sourcesContent":["import { FontFamily, TextVariant } from '@metamask-previews/design-system-shared';\nimport {\n Theme,\n useTailwind,\n useTheme,\n} from '@metamask-previews/design-system-twrnc-preset';\nimport { darkTheme, lightTheme } from '@metamask-previews/design-tokens';\nimport { forwardRef, useCallback, useEffect, useMemo, useState } from 'react';\nimport { Platform, TextInput } from 'react-native';\n\nimport {\n TWCLASSMAP_TEXT_VARIANT_FONTWEIGHT,\n TWCLASSMAP_TEXT_FONTWEIGHT,\n} from '../Text/Text.constants';\n\nimport { MAP_TEXT_VARIANT_INPUT_METRICS } from './Input.constants';\nimport type { InputProps } from './Input.types';\n\nexport const Input = forwardRef<TextInput, InputProps>(\n (\n {\n style,\n textVariant = TextVariant.BodyMd,\n isStateStylesDisabled,\n isDisabled = false,\n isReadOnly = false,\n value,\n placeholder,\n twClassName,\n onBlur,\n onFocus,\n autoFocus = false,\n multiline,\n ...props\n },\n ref,\n ) => {\n const [isFocused, setIsFocused] = useState(autoFocus);\n const tw = useTailwind();\n const theme = useTheme();\n const isMultiline = multiline === true;\n\n const placeholderTextColor = useMemo(\n () =>\n theme === Theme.Light\n ? lightTheme.colors.text.alternative\n : darkTheme.colors.text.alternative,\n [theme],\n );\n\n const finalFontWeight = TWCLASSMAP_TEXT_VARIANT_FONTWEIGHT[textVariant];\n const fontSuffix = TWCLASSMAP_TEXT_FONTWEIGHT[finalFontWeight];\n const fontClass = `font-${FontFamily.Default}${fontSuffix}`;\n const hasPlaceholder =\n placeholder !== undefined && placeholder !== null && placeholder !== '';\n // Only apply placeholder-mode styling when a placeholder is present and\n // the controlled value is empty. This keeps the iOS lineHeight workaround\n // scoped to the placeholder-visible state without affecting typed text.\n const isPlaceholderVisible = hasPlaceholder && value === '';\n\n // Multiline field styles\n const multilineChromeStyle = useMemo(\n () =>\n tw.style(\n 'text-default',\n 'bg-default',\n 'border',\n 'border-transparent',\n !isStateStylesDisabled && isDisabled && 'opacity-50',\n !isStateStylesDisabled &&\n !isDisabled &&\n isFocused &&\n 'border-primary-default',\n twClassName,\n ),\n [isStateStylesDisabled, isDisabled, isFocused, twClassName, tw],\n );\n const multilineTypographyStyle = useMemo(\n () => tw.style(`text-${textVariant}`, fontClass),\n [textVariant, fontClass, tw],\n );\n\n // Single-line field styles\n const singleLineChromeStyle = useMemo(\n () =>\n tw.style(\n fontClass,\n 'text-default',\n 'bg-default',\n 'border',\n 'border-transparent',\n !isStateStylesDisabled && isDisabled && 'opacity-50',\n !isStateStylesDisabled &&\n !isDisabled &&\n isFocused &&\n 'border-primary-default',\n twClassName,\n ),\n [\n fontClass,\n isStateStylesDisabled,\n isDisabled,\n isFocused,\n twClassName,\n tw,\n ],\n );\n const singleLineTypographyStyle = useMemo(\n () => MAP_TEXT_VARIANT_INPUT_METRICS[textVariant],\n [textVariant],\n );\n // iOS-only single-line placeholder fix: native TextInput can render\n // placeholder text vertically offset. Do not use on Android (lineHeight 0\n // collapses text) or on multiline (breaks paragraph layout).\n const iosSingleLinePlaceholderLineHeightFix = Platform.OS === 'ios' &&\n isPlaceholderVisible && { lineHeight: 0 as const };\n\n const resolvedStyle = (\n isMultiline\n ? [multilineChromeStyle, multilineTypographyStyle, style]\n : [\n singleLineChromeStyle,\n singleLineTypographyStyle,\n iosSingleLinePlaceholderLineHeightFix,\n style,\n ]\n ).filter(Boolean);\n\n useEffect(() => {\n if (isDisabled || isReadOnly) {\n setIsFocused(false);\n }\n }, [isDisabled, isReadOnly]);\n\n const onBlurHandler = useCallback(\n (e: Parameters<NonNullable<InputProps['onBlur']>>[0]) => {\n setIsFocused(false);\n onBlur?.(e);\n },\n [onBlur],\n );\n\n const onFocusHandler = useCallback(\n (e: Parameters<NonNullable<InputProps['onFocus']>>[0]) => {\n setIsFocused(true);\n onFocus?.(e);\n },\n [onFocus],\n );\n\n return (\n <TextInput\n ref={ref}\n {...props}\n multiline={multiline}\n placeholder={placeholder}\n placeholderTextColor={placeholderTextColor}\n value={value}\n style={resolvedStyle}\n editable={!isDisabled && !isReadOnly}\n autoFocus={autoFocus}\n onBlur={onBlurHandler}\n onFocus={onFocusHandler}\n />\n );\n },\n);\n"]}
|
|
@@ -1,12 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { TextVariant } from "@metamask-previews/design-system-shared";
|
|
3
2
|
import { TextInput } from "react-native/index.js";
|
|
4
|
-
export declare const Input: import("react").ForwardRefExoticComponent<Omit<import("react-native").TextInputProps, "value" | "editable" | "defaultValue"> & {
|
|
5
|
-
value: string;
|
|
6
|
-
textVariant?: TextVariant | undefined;
|
|
7
|
-
isDisabled?: boolean | undefined;
|
|
8
|
-
isReadonly?: boolean | undefined;
|
|
9
|
-
isStateStylesDisabled?: boolean | undefined;
|
|
3
|
+
export declare const Input: import("react").ForwardRefExoticComponent<Omit<import("react-native").TextInputProps, "value" | "editable" | "defaultValue"> & import("@metamask-previews/design-system-shared").InputPropsShared & {
|
|
10
4
|
twClassName?: string | undefined;
|
|
11
5
|
} & import("react").RefAttributes<TextInput>>;
|
|
12
6
|
//# sourceMappingURL=Input.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Input.d.cts","sourceRoot":"","sources":["../../../src/components/Input/Input.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"Input.d.cts","sourceRoot":"","sources":["../../../src/components/Input/Input.tsx"],"names":[],"mappings":";AAQA,OAAO,EAAY,SAAS,EAAE,8BAAqB;AAUnD,eAAO,MAAM,KAAK;;6CAoJjB,CAAC"}
|
|
@@ -1,12 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { TextVariant } from "@metamask-previews/design-system-shared";
|
|
3
2
|
import { TextInput } from "react-native/index.js";
|
|
4
|
-
export declare const Input: import("react").ForwardRefExoticComponent<Omit<import("react-native").TextInputProps, "value" | "editable" | "defaultValue"> & {
|
|
5
|
-
value: string;
|
|
6
|
-
textVariant?: TextVariant | undefined;
|
|
7
|
-
isDisabled?: boolean | undefined;
|
|
8
|
-
isReadonly?: boolean | undefined;
|
|
9
|
-
isStateStylesDisabled?: boolean | undefined;
|
|
3
|
+
export declare const Input: import("react").ForwardRefExoticComponent<Omit<import("react-native").TextInputProps, "value" | "editable" | "defaultValue"> & import("@metamask-previews/design-system-shared").InputPropsShared & {
|
|
10
4
|
twClassName?: string | undefined;
|
|
11
5
|
} & import("react").RefAttributes<TextInput>>;
|
|
12
6
|
//# sourceMappingURL=Input.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Input.d.mts","sourceRoot":"","sources":["../../../src/components/Input/Input.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"Input.d.mts","sourceRoot":"","sources":["../../../src/components/Input/Input.tsx"],"names":[],"mappings":";AAQA,OAAO,EAAY,SAAS,EAAE,8BAAqB;AAUnD,eAAO,MAAM,KAAK;;6CAoJjB,CAAC"}
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import { FontFamily, TextVariant } from "@metamask-previews/design-system-shared";
|
|
2
2
|
import { Theme, useTailwind, useTheme } from "@metamask-previews/design-system-twrnc-preset";
|
|
3
3
|
import { darkTheme, lightTheme } from "@metamask-previews/design-tokens";
|
|
4
|
-
import { forwardRef, useCallback, useMemo, useState } from "react";
|
|
4
|
+
import { forwardRef, useCallback, useEffect, useMemo, useState } from "react";
|
|
5
5
|
import { Platform, TextInput } from "react-native/index.js";
|
|
6
6
|
import { TWCLASSMAP_TEXT_VARIANT_FONTWEIGHT, TWCLASSMAP_TEXT_FONTWEIGHT } from "../Text/Text.constants.mjs";
|
|
7
7
|
import { MAP_TEXT_VARIANT_INPUT_METRICS } from "./Input.constants.mjs";
|
|
8
|
-
export const Input = forwardRef(({ style, textVariant = TextVariant.BodyMd, isStateStylesDisabled, isDisabled = false,
|
|
8
|
+
export const Input = forwardRef(({ style, textVariant = TextVariant.BodyMd, isStateStylesDisabled, isDisabled = false, isReadOnly = false, value, placeholder, twClassName, onBlur, onFocus, autoFocus = false, multiline, ...props }, ref) => {
|
|
9
9
|
const [isFocused, setIsFocused] = useState(autoFocus);
|
|
10
10
|
const tw = useTailwind();
|
|
11
11
|
const theme = useTheme();
|
|
12
|
+
const isMultiline = multiline === true;
|
|
12
13
|
const placeholderTextColor = useMemo(() => theme === Theme.Light
|
|
13
14
|
? lightTheme.colors.text.alternative
|
|
14
15
|
: darkTheme.colors.text.alternative, [theme]);
|
|
@@ -20,7 +21,14 @@ export const Input = forwardRef(({ style, textVariant = TextVariant.BodyMd, isSt
|
|
|
20
21
|
// the controlled value is empty. This keeps the iOS lineHeight workaround
|
|
21
22
|
// scoped to the placeholder-visible state without affecting typed text.
|
|
22
23
|
const isPlaceholderVisible = hasPlaceholder && value === '';
|
|
23
|
-
|
|
24
|
+
// Multiline field styles
|
|
25
|
+
const multilineChromeStyle = useMemo(() => tw.style('text-default', 'bg-default', 'border', 'border-transparent', !isStateStylesDisabled && isDisabled && 'opacity-50', !isStateStylesDisabled &&
|
|
26
|
+
!isDisabled &&
|
|
27
|
+
isFocused &&
|
|
28
|
+
'border-primary-default', twClassName), [isStateStylesDisabled, isDisabled, isFocused, twClassName, tw]);
|
|
29
|
+
const multilineTypographyStyle = useMemo(() => tw.style(`text-${textVariant}`, fontClass), [textVariant, fontClass, tw]);
|
|
30
|
+
// Single-line field styles
|
|
31
|
+
const singleLineChromeStyle = useMemo(() => tw.style(fontClass, 'text-default', 'bg-default', 'border', 'border-transparent', !isStateStylesDisabled && isDisabled && 'opacity-50', !isStateStylesDisabled &&
|
|
24
32
|
!isDisabled &&
|
|
25
33
|
isFocused &&
|
|
26
34
|
'border-primary-default', twClassName), [
|
|
@@ -31,31 +39,33 @@ export const Input = forwardRef(({ style, textVariant = TextVariant.BodyMd, isSt
|
|
|
31
39
|
twClassName,
|
|
32
40
|
tw,
|
|
33
41
|
]);
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
42
|
+
const singleLineTypographyStyle = useMemo(() => MAP_TEXT_VARIANT_INPUT_METRICS[textVariant], [textVariant]);
|
|
43
|
+
// iOS-only single-line placeholder fix: native TextInput can render
|
|
44
|
+
// placeholder text vertically offset. Do not use on Android (lineHeight 0
|
|
45
|
+
// collapses text) or on multiline (breaks paragraph layout).
|
|
46
|
+
const iosSingleLinePlaceholderLineHeightFix = Platform.OS === 'ios' &&
|
|
47
|
+
isPlaceholderVisible && { lineHeight: 0 };
|
|
48
|
+
const resolvedStyle = (isMultiline
|
|
49
|
+
? [multilineChromeStyle, multilineTypographyStyle, style]
|
|
50
|
+
: [
|
|
51
|
+
singleLineChromeStyle,
|
|
52
|
+
singleLineTypographyStyle,
|
|
53
|
+
iosSingleLinePlaceholderLineHeightFix,
|
|
54
|
+
style,
|
|
55
|
+
]).filter(Boolean);
|
|
56
|
+
useEffect(() => {
|
|
57
|
+
if (isDisabled || isReadOnly) {
|
|
38
58
|
setIsFocused(false);
|
|
39
|
-
onBlur?.(e);
|
|
40
59
|
}
|
|
41
|
-
}, [isDisabled,
|
|
42
|
-
|
|
60
|
+
}, [isDisabled, isReadOnly]);
|
|
61
|
+
const onBlurHandler = useCallback((e) => {
|
|
62
|
+
setIsFocused(false);
|
|
63
|
+
onBlur?.(e);
|
|
64
|
+
}, [onBlur]);
|
|
43
65
|
const onFocusHandler = useCallback((e) => {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
}, [isDisabled, onFocus]);
|
|
49
|
-
const resolvedStyle = [
|
|
50
|
-
inputStyle,
|
|
51
|
-
variantTextStyle,
|
|
52
|
-
// iOS-only workaround: when a placeholder is visible, native iOS
|
|
53
|
-
// TextInput can render placeholder text vertically offset.
|
|
54
|
-
// Keep this iOS-only because lineHeight: 0 can collapse text on Android.
|
|
55
|
-
Platform.OS === 'ios' &&
|
|
56
|
-
isPlaceholderVisible && { lineHeight: 0 },
|
|
57
|
-
style,
|
|
58
|
-
].filter(Boolean);
|
|
59
|
-
return (<TextInput ref={ref} placeholderTextColor={placeholderTextColor} {...props} placeholder={placeholder} value={value} style={resolvedStyle} editable={!isDisabled && !isReadonly} autoFocus={autoFocus} onBlur={onBlurHandler} onFocus={onFocusHandler}/>);
|
|
66
|
+
setIsFocused(true);
|
|
67
|
+
onFocus?.(e);
|
|
68
|
+
}, [onFocus]);
|
|
69
|
+
return (<TextInput ref={ref} {...props} multiline={multiline} placeholder={placeholder} placeholderTextColor={placeholderTextColor} value={value} style={resolvedStyle} editable={!isDisabled && !isReadOnly} autoFocus={autoFocus} onBlur={onBlurHandler} onFocus={onFocusHandler}/>);
|
|
60
70
|
});
|
|
61
71
|
//# sourceMappingURL=Input.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Input.mjs","sourceRoot":"","sources":["../../../src/components/Input/Input.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,gDAAgD;AAClF,OAAO,EACL,KAAK,EACL,WAAW,EACX,QAAQ,EACT,sDAAsD;AACvD,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,yCAAyC;AACzE,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,OAAO,EAAE,QAAQ,EAAE,cAAc;
|
|
1
|
+
{"version":3,"file":"Input.mjs","sourceRoot":"","sources":["../../../src/components/Input/Input.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,gDAAgD;AAClF,OAAO,EACL,KAAK,EACL,WAAW,EACX,QAAQ,EACT,sDAAsD;AACvD,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,yCAAyC;AACzE,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,cAAc;AAC9E,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,8BAAqB;AAEnD,OAAO,EACL,kCAAkC,EAClC,0BAA0B,EAC3B,mCAA+B;AAEhC,OAAO,EAAE,8BAA8B,EAAE,8BAA0B;AAGnE,MAAM,CAAC,MAAM,KAAK,GAAG,UAAU,CAC7B,CACE,EACE,KAAK,EACL,WAAW,GAAG,WAAW,CAAC,MAAM,EAChC,qBAAqB,EACrB,UAAU,GAAG,KAAK,EAClB,UAAU,GAAG,KAAK,EAClB,KAAK,EACL,WAAW,EACX,WAAW,EACX,MAAM,EACN,OAAO,EACP,SAAS,GAAG,KAAK,EACjB,SAAS,EACT,GAAG,KAAK,EACT,EACD,GAAG,EACH,EAAE;IACF,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,CAAC,SAAS,CAAC,CAAC;IACtD,MAAM,EAAE,GAAG,WAAW,EAAE,CAAC;IACzB,MAAM,KAAK,GAAG,QAAQ,EAAE,CAAC;IACzB,MAAM,WAAW,GAAG,SAAS,KAAK,IAAI,CA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AC,CAAC;QACnB,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC;IACf,CAAC,EACD,CAAC,OAAO,CAAC,CACV,CAAC;IAEF,OAAO,CACL,CAAC,SAAS,CACR,GAAG,CAAC,CAAC,GAAG,CAAC,CACT,IAAI,KAAK,CAAC,CACV,SAAS,CAAC,CAAC,SAAS,CAAC,CACrB,WAAW,CAAC,CAAC,WAAW,CAAC,CACzB,oBAAoB,CAAC,CAAC,oBAAoB,CAAC,CAC3C,KAAK,CAAC,CAAC,KAAK,CAAC,CACb,KAAK,CAAC,CAAC,aAAa,CAAC,CACrB,QAAQ,CAAC,CAAC,CAAC,UAAU,IAAI,CAAC,UAAU,CAAC,CACrC,SAAS,CAAC,CAAC,SAAS,CAAC,CACrB,MAAM,CAAC,CAAC,aAAa,CAAC,CACtB,OAAO,CAAC,CAAC,cAAc,CAAC,EACxB,CACH,CAAC;AACJ,CAAC,CACF,CAAC","sourcesContent":["import { FontFamily, TextVariant } from '@metamask-previews/design-system-shared';\nimport {\n Theme,\n useTailwind,\n useTheme,\n} from '@metamask-previews/design-system-twrnc-preset';\nimport { darkTheme, lightTheme } from '@metamask-previews/design-tokens';\nimport { forwardRef, useCallback, useEffect, useMemo, useState } from 'react';\nimport { Platform, TextInput } from 'react-native';\n\nimport {\n TWCLASSMAP_TEXT_VARIANT_FONTWEIGHT,\n TWCLASSMAP_TEXT_FONTWEIGHT,\n} from '../Text/Text.constants';\n\nimport { MAP_TEXT_VARIANT_INPUT_METRICS } from './Input.constants';\nimport type { InputProps } from './Input.types';\n\nexport const Input = forwardRef<TextInput, InputProps>(\n (\n {\n style,\n textVariant = TextVariant.BodyMd,\n isStateStylesDisabled,\n isDisabled = false,\n isReadOnly = false,\n value,\n placeholder,\n twClassName,\n onBlur,\n onFocus,\n autoFocus = false,\n multiline,\n ...props\n },\n ref,\n ) => {\n const [isFocused, setIsFocused] = useState(autoFocus);\n const tw = useTailwind();\n const theme = useTheme();\n const isMultiline = multiline === true;\n\n const placeholderTextColor = useMemo(\n () =>\n theme === Theme.Light\n ? lightTheme.colors.text.alternative\n : darkTheme.colors.text.alternative,\n [theme],\n );\n\n const finalFontWeight = TWCLASSMAP_TEXT_VARIANT_FONTWEIGHT[textVariant];\n const fontSuffix = TWCLASSMAP_TEXT_FONTWEIGHT[finalFontWeight];\n const fontClass = `font-${FontFamily.Default}${fontSuffix}`;\n const hasPlaceholder =\n placeholder !== undefined && placeholder !== null && placeholder !== '';\n // Only apply placeholder-mode styling when a placeholder is present and\n // the controlled value is empty. This keeps the iOS lineHeight workaround\n // scoped to the placeholder-visible state without affecting typed text.\n const isPlaceholderVisible = hasPlaceholder && value === '';\n\n // Multiline field styles\n const multilineChromeStyle = useMemo(\n () =>\n tw.style(\n 'text-default',\n 'bg-default',\n 'border',\n 'border-transparent',\n !isStateStylesDisabled && isDisabled && 'opacity-50',\n !isStateStylesDisabled &&\n !isDisabled &&\n isFocused &&\n 'border-primary-default',\n twClassName,\n ),\n [isStateStylesDisabled, isDisabled, isFocused, twClassName, tw],\n );\n const multilineTypographyStyle = useMemo(\n () => tw.style(`text-${textVariant}`, fontClass),\n [textVariant, fontClass, tw],\n );\n\n // Single-line field styles\n const singleLineChromeStyle = useMemo(\n () =>\n tw.style(\n fontClass,\n 'text-default',\n 'bg-default',\n 'border',\n 'border-transparent',\n !isStateStylesDisabled && isDisabled && 'opacity-50',\n !isStateStylesDisabled &&\n !isDisabled &&\n isFocused &&\n 'border-primary-default',\n twClassName,\n ),\n [\n fontClass,\n isStateStylesDisabled,\n isDisabled,\n isFocused,\n twClassName,\n tw,\n ],\n );\n const singleLineTypographyStyle = useMemo(\n () => MAP_TEXT_VARIANT_INPUT_METRICS[textVariant],\n [textVariant],\n );\n // iOS-only single-line placeholder fix: native TextInput can render\n // placeholder text vertically offset. Do not use on Android (lineHeight 0\n // collapses text) or on multiline (breaks paragraph layout).\n const iosSingleLinePlaceholderLineHeightFix = Platform.OS === 'ios' &&\n isPlaceholderVisible && { lineHeight: 0 as const };\n\n const resolvedStyle = (\n isMultiline\n ? [multilineChromeStyle, multilineTypographyStyle, style]\n : [\n singleLineChromeStyle,\n singleLineTypographyStyle,\n iosSingleLinePlaceholderLineHeightFix,\n style,\n ]\n ).filter(Boolean);\n\n useEffect(() => {\n if (isDisabled || isReadOnly) {\n setIsFocused(false);\n }\n }, [isDisabled, isReadOnly]);\n\n const onBlurHandler = useCallback(\n (e: Parameters<NonNullable<InputProps['onBlur']>>[0]) => {\n setIsFocused(false);\n onBlur?.(e);\n },\n [onBlur],\n );\n\n const onFocusHandler = useCallback(\n (e: Parameters<NonNullable<InputProps['onFocus']>>[0]) => {\n setIsFocused(true);\n onFocus?.(e);\n },\n [onFocus],\n );\n\n return (\n <TextInput\n ref={ref}\n {...props}\n multiline={multiline}\n placeholder={placeholder}\n placeholderTextColor={placeholderTextColor}\n value={value}\n style={resolvedStyle}\n editable={!isDisabled && !isReadOnly}\n autoFocus={autoFocus}\n onBlur={onBlurHandler}\n onFocus={onFocusHandler}\n />\n );\n },\n);\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Input.types.cjs","sourceRoot":"","sources":["../../../src/components/Input/Input.types.ts"],"names":[],"mappings":"","sourcesContent":["import type {
|
|
1
|
+
{"version":3,"file":"Input.types.cjs","sourceRoot":"","sources":["../../../src/components/Input/Input.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { InputPropsShared } from '@metamask-previews/design-system-shared';\nimport type { TextInputProps } from 'react-native';\n\nexport type InputProps = Omit<\n TextInputProps,\n 'editable' | 'value' | 'defaultValue'\n> &\n InputPropsShared & {\n /**\n * Optional prop to add twrnc overriding classNames.\n */\n twClassName?: string;\n };\n"]}
|
|
@@ -1,34 +1,6 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { InputPropsShared } from "@metamask-previews/design-system-shared";
|
|
2
2
|
import type { TextInputProps } from "react-native/index.js";
|
|
3
|
-
export type InputProps = Omit<TextInputProps, 'editable' | 'value' | 'defaultValue'> & {
|
|
4
|
-
/**
|
|
5
|
-
* Controlled value for Input.
|
|
6
|
-
*/
|
|
7
|
-
value: string;
|
|
8
|
-
/**
|
|
9
|
-
* Optional enum to select between Typography variants.
|
|
10
|
-
*
|
|
11
|
-
* @default BodyMd
|
|
12
|
-
*/
|
|
13
|
-
textVariant?: TextVariant;
|
|
14
|
-
/**
|
|
15
|
-
* Optional boolean to disable Input.
|
|
16
|
-
*
|
|
17
|
-
* @default false
|
|
18
|
-
*/
|
|
19
|
-
isDisabled?: boolean;
|
|
20
|
-
/**
|
|
21
|
-
* Optional boolean to show readonly input.
|
|
22
|
-
*
|
|
23
|
-
* @default false
|
|
24
|
-
*/
|
|
25
|
-
isReadonly?: boolean;
|
|
26
|
-
/**
|
|
27
|
-
* Optional boolean to disable state styles.
|
|
28
|
-
*
|
|
29
|
-
* @default false
|
|
30
|
-
*/
|
|
31
|
-
isStateStylesDisabled?: boolean;
|
|
3
|
+
export type InputProps = Omit<TextInputProps, 'editable' | 'value' | 'defaultValue'> & InputPropsShared & {
|
|
32
4
|
/**
|
|
33
5
|
* Optional prop to add twrnc overriding classNames.
|
|
34
6
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Input.types.d.cts","sourceRoot":"","sources":["../../../src/components/Input/Input.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"Input.types.d.cts","sourceRoot":"","sources":["../../../src/components/Input/Input.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,gDAAgD;AAChF,OAAO,KAAK,EAAE,cAAc,EAAE,8BAAqB;AAEnD,MAAM,MAAM,UAAU,GAAG,IAAI,CAC3B,cAAc,EACd,UAAU,GAAG,OAAO,GAAG,cAAc,CACtC,GACC,gBAAgB,GAAG;IACjB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC"}
|
|
@@ -1,34 +1,6 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { InputPropsShared } from "@metamask-previews/design-system-shared";
|
|
2
2
|
import type { TextInputProps } from "react-native/index.js";
|
|
3
|
-
export type InputProps = Omit<TextInputProps, 'editable' | 'value' | 'defaultValue'> & {
|
|
4
|
-
/**
|
|
5
|
-
* Controlled value for Input.
|
|
6
|
-
*/
|
|
7
|
-
value: string;
|
|
8
|
-
/**
|
|
9
|
-
* Optional enum to select between Typography variants.
|
|
10
|
-
*
|
|
11
|
-
* @default BodyMd
|
|
12
|
-
*/
|
|
13
|
-
textVariant?: TextVariant;
|
|
14
|
-
/**
|
|
15
|
-
* Optional boolean to disable Input.
|
|
16
|
-
*
|
|
17
|
-
* @default false
|
|
18
|
-
*/
|
|
19
|
-
isDisabled?: boolean;
|
|
20
|
-
/**
|
|
21
|
-
* Optional boolean to show readonly input.
|
|
22
|
-
*
|
|
23
|
-
* @default false
|
|
24
|
-
*/
|
|
25
|
-
isReadonly?: boolean;
|
|
26
|
-
/**
|
|
27
|
-
* Optional boolean to disable state styles.
|
|
28
|
-
*
|
|
29
|
-
* @default false
|
|
30
|
-
*/
|
|
31
|
-
isStateStylesDisabled?: boolean;
|
|
3
|
+
export type InputProps = Omit<TextInputProps, 'editable' | 'value' | 'defaultValue'> & InputPropsShared & {
|
|
32
4
|
/**
|
|
33
5
|
* Optional prop to add twrnc overriding classNames.
|
|
34
6
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Input.types.d.mts","sourceRoot":"","sources":["../../../src/components/Input/Input.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"Input.types.d.mts","sourceRoot":"","sources":["../../../src/components/Input/Input.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,gDAAgD;AAChF,OAAO,KAAK,EAAE,cAAc,EAAE,8BAAqB;AAEnD,MAAM,MAAM,UAAU,GAAG,IAAI,CAC3B,cAAc,EACd,UAAU,GAAG,OAAO,GAAG,cAAc,CACtC,GACC,gBAAgB,GAAG;IACjB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Input.types.mjs","sourceRoot":"","sources":["../../../src/components/Input/Input.types.ts"],"names":[],"mappings":"","sourcesContent":["import type {
|
|
1
|
+
{"version":3,"file":"Input.types.mjs","sourceRoot":"","sources":["../../../src/components/Input/Input.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { InputPropsShared } from '@metamask-previews/design-system-shared';\nimport type { TextInputProps } from 'react-native';\n\nexport type InputProps = Omit<\n TextInputProps,\n 'editable' | 'value' | 'defaultValue'\n> &\n InputPropsShared & {\n /**\n * Optional prop to add twrnc overriding classNames.\n */\n twClassName?: string;\n };\n"]}
|
|
@@ -12,9 +12,9 @@ const BoxRow_1 = require("../BoxRow/index.cjs");
|
|
|
12
12
|
const ButtonIcon_1 = require("../ButtonIcon/index.cjs");
|
|
13
13
|
const KeyValueColumn = ({ keyStartAccessory, keyEndAccessory, keyEndButtonIconProps, keyLabel: keyContent, keyTextProps, valueStartAccessory, valueEndAccessory, valueEndButtonIconProps, value: valueContent, valueTextProps, twClassName, ...viewProps }) => {
|
|
14
14
|
const keyEndAccessoryNode = keyEndButtonIconProps?.iconName !== undefined &&
|
|
15
|
-
keyEndButtonIconProps.iconName !== null ? (<ButtonIcon_1.ButtonIcon size={
|
|
15
|
+
keyEndButtonIconProps.iconName !== null ? (<ButtonIcon_1.ButtonIcon size={design_system_shared_1.ButtonIconSize.Sm} iconProps={{ color: types_1.IconColor.IconAlternative }} {...keyEndButtonIconProps} iconName={keyEndButtonIconProps.iconName}/>) : (keyEndAccessory);
|
|
16
16
|
const valueEndAccessoryNode = valueEndButtonIconProps?.iconName !== undefined &&
|
|
17
|
-
valueEndButtonIconProps.iconName !== null ? (<ButtonIcon_1.ButtonIcon size={
|
|
17
|
+
valueEndButtonIconProps.iconName !== null ? (<ButtonIcon_1.ButtonIcon size={design_system_shared_1.ButtonIconSize.Sm} iconProps={{ color: types_1.IconColor.IconDefault }} {...valueEndButtonIconProps} iconName={valueEndButtonIconProps.iconName}/>) : (valueEndAccessory);
|
|
18
18
|
const keyBox = (<BoxRow_1.BoxRow startAccessory={keyStartAccessory} endAccessory={keyEndAccessoryNode} textProps={{
|
|
19
19
|
variant: design_system_shared_1.TextVariant.BodyMd,
|
|
20
20
|
fontWeight: design_system_shared_1.FontWeight.Medium,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KeyValueColumn.cjs","sourceRoot":"","sources":["../../../src/components/KeyValueColumn/KeyValueColumn.tsx"],"names":[],"mappings":";;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"KeyValueColumn.cjs","sourceRoot":"","sources":["../../../src/components/KeyValueColumn/KeyValueColumn.tsx"],"names":[],"mappings":";;;;;;AAAA,kFAKiD;AACjD,kDAA0B;AAE1B,iDAAwC;AACxC,sDAAyC;AACzC,gDAAmC;AACnC,wDAA2C;AAIpC,MAAM,cAAc,GAAG,CAAC,EAC7B,iBAAiB,EACjB,eAAe,EACf,qBAAqB,EACrB,QAAQ,EAAE,UAAU,EACpB,YAAY,EACZ,mBAAmB,EACnB,iBAAiB,EACjB,uBAAuB,EACvB,KAAK,EAAE,YAAY,EACnB,cAAc,EACd,WAAW,EACX,GAAG,SAAS,EACQ,EAAE,EAAE;IACxB,MAAM,mBAAmB,GACvB,qBAAqB,EAAE,QAAQ,KAAK,SAAS;QAC7C,qBAAqB,CAAC,QAAQ,KAAK,IAAI,CAAC,CAAC,CAAC,CACxC,CAAC,uBAAU,CACT,IAAI,CAAC,CAAC,qCAAc,CAAC,EAAE,CAAC,CACxB,SAAS,CAAC,CAAC,EAAE,KAAK,EAAE,iBAAS,CAAC,eAAe,EAAE,CAAC,CAChD,IAAI,qBAAqB,CAAC,CAC1B,QAAQ,CAAC,CAAC,qBAAqB,CAAC,QAAQ,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gBAAgB,CAE5B;MAAA,CAAC,YAAY,CACf;IAAA,EAAE,eAAM,CAAC,CACV,CAAC;IAEF,OAAO,CACL,CAAC,qBAAS,CACR,eAAe,CAAC,CAAC,QAAQ,CAAC,CAC1B,WAAW,CAAC,CAAC,WAAW,CAAC,CACzB,IAAI,SAAS,CAAC,CAEd;MAAA,CAAC,MAAM,CACT;IAAA,EAAE,qBAAS,CAAC,CACb,CAAC;AACJ,CAAC,CAAC;AArFW,QAAA,cAAc,kBAqFzB;AAEF,sBAAc,CAAC,WAAW,GAAG,gBAAgB,CAAC","sourcesContent":["import {\n ButtonIconSize,\n FontWeight,\n TextColor,\n TextVariant,\n} from '@metamask-previews/design-system-shared';\nimport React from 'react';\n\nimport { IconColor } from '../../types';\nimport { BoxColumn } from '../BoxColumn';\nimport { BoxRow } from '../BoxRow';\nimport { ButtonIcon } from '../ButtonIcon';\n\nimport type { KeyValueColumnProps } from './KeyValueColumn.types';\n\nexport const KeyValueColumn = ({\n keyStartAccessory,\n keyEndAccessory,\n keyEndButtonIconProps,\n keyLabel: keyContent,\n keyTextProps,\n valueStartAccessory,\n valueEndAccessory,\n valueEndButtonIconProps,\n value: valueContent,\n valueTextProps,\n twClassName,\n ...viewProps\n}: KeyValueColumnProps) => {\n const keyEndAccessoryNode =\n keyEndButtonIconProps?.iconName !== undefined &&\n keyEndButtonIconProps.iconName !== null ? (\n <ButtonIcon\n size={ButtonIconSize.Sm}\n iconProps={{ color: IconColor.IconAlternative }}\n {...keyEndButtonIconProps}\n iconName={keyEndButtonIconProps.iconName}\n />\n ) : (\n keyEndAccessory\n );\n\n const valueEndAccessoryNode =\n valueEndButtonIconProps?.iconName !== undefined &&\n valueEndButtonIconProps.iconName !== null ? (\n <ButtonIcon\n size={ButtonIconSize.Sm}\n iconProps={{ color: IconColor.IconDefault }}\n {...valueEndButtonIconProps}\n iconName={valueEndButtonIconProps.iconName}\n />\n ) : (\n valueEndAccessory\n );\n\n const keyBox = (\n <BoxRow\n startAccessory={keyStartAccessory}\n endAccessory={keyEndAccessoryNode}\n textProps={{\n variant: TextVariant.BodyMd,\n fontWeight: FontWeight.Medium,\n color: TextColor.TextAlternative,\n numberOfLines: 1,\n ellipsizeMode: 'tail',\n ...keyTextProps,\n }}\n twClassName=\"w-full min-w-0\"\n >\n {keyContent}\n </BoxRow>\n );\n\n const valueBox = (\n <BoxRow\n startAccessory={valueStartAccessory}\n endAccessory={valueEndAccessoryNode}\n textProps={{\n variant: TextVariant.BodyMd,\n fontWeight: FontWeight.Medium,\n color: TextColor.TextDefault,\n numberOfLines: 1,\n ellipsizeMode: 'tail',\n ...valueTextProps,\n }}\n twClassName=\"w-full min-w-0\"\n >\n {valueContent}\n </BoxRow>\n );\n\n return (\n <BoxColumn\n bottomAccessory={valueBox}\n twClassName={twClassName}\n {...viewProps}\n >\n {keyBox}\n </BoxColumn>\n );\n};\n\nKeyValueColumn.displayName = 'KeyValueColumn';\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KeyValueColumn.d.cts","sourceRoot":"","sources":["../../../src/components/KeyValueColumn/KeyValueColumn.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"KeyValueColumn.d.cts","sourceRoot":"","sources":["../../../src/components/KeyValueColumn/KeyValueColumn.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,cAAc;AAO1B,OAAO,KAAK,EAAE,mBAAmB,EAAE,mCAA+B;AAElE,eAAO,MAAM,cAAc;yOAaxB,mBAAmB;;CAwErB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KeyValueColumn.d.mts","sourceRoot":"","sources":["../../../src/components/KeyValueColumn/KeyValueColumn.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"KeyValueColumn.d.mts","sourceRoot":"","sources":["../../../src/components/KeyValueColumn/KeyValueColumn.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,cAAc;AAO1B,OAAO,KAAK,EAAE,mBAAmB,EAAE,mCAA+B;AAElE,eAAO,MAAM,cAAc;yOAaxB,mBAAmB;;CAwErB,CAAC"}
|
|
@@ -4,10 +4,10 @@ function $importDefault(module) {
|
|
|
4
4
|
}
|
|
5
5
|
return module;
|
|
6
6
|
}
|
|
7
|
-
import { FontWeight, TextColor, TextVariant } from "@metamask-previews/design-system-shared";
|
|
7
|
+
import { ButtonIconSize, FontWeight, TextColor, TextVariant } from "@metamask-previews/design-system-shared";
|
|
8
8
|
import $React from "react";
|
|
9
9
|
const React = $importDefault($React);
|
|
10
|
-
import {
|
|
10
|
+
import { IconColor } from "../../types/index.mjs";
|
|
11
11
|
import { BoxColumn } from "../BoxColumn/index.mjs";
|
|
12
12
|
import { BoxRow } from "../BoxRow/index.mjs";
|
|
13
13
|
import { ButtonIcon } from "../ButtonIcon/index.mjs";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KeyValueColumn.mjs","sourceRoot":"","sources":["../../../src/components/KeyValueColumn/KeyValueColumn.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,EACL,UAAU,EACV,SAAS,EACT,WAAW,EACZ,gDAAgD;AACjD,OAAO,MAAK,cAAc;;AAE1B,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"KeyValueColumn.mjs","sourceRoot":"","sources":["../../../src/components/KeyValueColumn/KeyValueColumn.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,EACL,cAAc,EACd,UAAU,EACV,SAAS,EACT,WAAW,EACZ,gDAAgD;AACjD,OAAO,MAAK,cAAc;;AAE1B,OAAO,EAAE,SAAS,EAAE,8BAAoB;AACxC,OAAO,EAAE,SAAS,EAAE,+BAAqB;AACzC,OAAO,EAAE,MAAM,EAAE,4BAAkB;AACnC,OAAO,EAAE,UAAU,EAAE,gCAAsB;AAI3C,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,EAC7B,iBAAiB,EACjB,eAAe,EACf,qBAAqB,EACrB,QAAQ,EAAE,UAAU,EACpB,Y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SAChB,CAAC,CACF,WAAW,CAAC,gBAAgB,CAE5B;MAAA,CAAC,UAAU,CACb;IAAA,EAAE,MAAM,CAAC,CACV,CAAC;IAEF,MAAM,QAAQ,GAAG,CACf,CAAC,MAAM,CACL,cAAc,CAAC,CAAC,mBAAmB,CAAC,CACpC,YAAY,CAAC,CAAC,qBAAqB,CAAC,CACpC,SAAS,CAAC,CAAC;YACT,OAAO,EAAE,WAAW,CAAC,MAAM;YAC3B,UAAU,EAAE,UAAU,CAAC,MAAM;YAC7B,KAAK,EAAE,SAAS,CAAC,WAAW;YAC5B,aAAa,EAAE,CAAC;YAChB,aAAa,EAAE,MAAM;YACrB,GAAG,cAAc;SAClB,CAAC,CACF,WAAW,CAAC,gBAAgB,CAE5B;MAAA,CAAC,YAAY,CACf;IAAA,EAAE,MAAM,CAAC,CACV,CAAC;IAEF,OAAO,CACL,CAAC,SAAS,CACR,eAAe,CAAC,CAAC,QAAQ,CAAC,CAC1B,WAAW,CAAC,CAAC,WAAW,CAAC,CACzB,IAAI,SAAS,CAAC,CAEd;MAAA,CAAC,MAAM,CACT;IAAA,EAAE,SAAS,CAAC,CACb,CAAC;AACJ,CAAC,CAAC;AAEF,cAAc,CAAC,WAAW,GAAG,gBAAgB,CAAC","sourcesContent":["import {\n ButtonIconSize,\n FontWeight,\n TextColor,\n TextVariant,\n} from '@metamask-previews/design-system-shared';\nimport React from 'react';\n\nimport { IconColor } from '../../types';\nimport { BoxColumn } from '../BoxColumn';\nimport { BoxRow } from '../BoxRow';\nimport { ButtonIcon } from '../ButtonIcon';\n\nimport type { KeyValueColumnProps } from './KeyValueColumn.types';\n\nexport const KeyValueColumn = ({\n keyStartAccessory,\n keyEndAccessory,\n keyEndButtonIconProps,\n keyLabel: keyContent,\n keyTextProps,\n valueStartAccessory,\n valueEndAccessory,\n valueEndButtonIconProps,\n value: valueContent,\n valueTextProps,\n twClassName,\n ...viewProps\n}: KeyValueColumnProps) => {\n const keyEndAccessoryNode =\n keyEndButtonIconProps?.iconName !== undefined &&\n keyEndButtonIconProps.iconName !== null ? (\n <ButtonIcon\n size={ButtonIconSize.Sm}\n iconProps={{ color: IconColor.IconAlternative }}\n {...keyEndButtonIconProps}\n iconName={keyEndButtonIconProps.iconName}\n />\n ) : (\n keyEndAccessory\n );\n\n const valueEndAccessoryNode =\n valueEndButtonIconProps?.iconName !== undefined &&\n valueEndButtonIconProps.iconName !== null ? (\n <ButtonIcon\n size={ButtonIconSize.Sm}\n iconProps={{ color: IconColor.IconDefault }}\n {...valueEndButtonIconProps}\n iconName={valueEndButtonIconProps.iconName}\n />\n ) : (\n valueEndAccessory\n );\n\n const keyBox = (\n <BoxRow\n startAccessory={keyStartAccessory}\n endAccessory={keyEndAccessoryNode}\n textProps={{\n variant: TextVariant.BodyMd,\n fontWeight: FontWeight.Medium,\n color: TextColor.TextAlternative,\n numberOfLines: 1,\n ellipsizeMode: 'tail',\n ...keyTextProps,\n }}\n twClassName=\"w-full min-w-0\"\n >\n {keyContent}\n </BoxRow>\n );\n\n const valueBox = (\n <BoxRow\n startAccessory={valueStartAccessory}\n endAccessory={valueEndAccessoryNode}\n textProps={{\n variant: TextVariant.BodyMd,\n fontWeight: FontWeight.Medium,\n color: TextColor.TextDefault,\n numberOfLines: 1,\n ellipsizeMode: 'tail',\n ...valueTextProps,\n }}\n twClassName=\"w-full min-w-0\"\n >\n {valueContent}\n </BoxRow>\n );\n\n return (\n <BoxColumn\n bottomAccessory={valueBox}\n twClassName={twClassName}\n {...viewProps}\n >\n {keyBox}\n </BoxColumn>\n );\n};\n\nKeyValueColumn.displayName = 'KeyValueColumn';\n"]}
|
|
@@ -14,12 +14,12 @@ const ButtonIcon_1 = require("../ButtonIcon/index.cjs");
|
|
|
14
14
|
const KeyValueRow = ({ keyStartAccessory, keyEndAccessory, keyEndButtonIconProps, keyLabel: keyContent, keyTextProps, valueStartAccessory, valueEndAccessory, valueEndButtonIconProps, value: valueContent, valueTextProps, variant = design_system_shared_1.KeyValueRowVariant.Summary, twClassName, style, ...viewProps }) => {
|
|
15
15
|
const tw = (0, design_system_twrnc_preset_1.useTailwind)();
|
|
16
16
|
const keyEndAccessoryNode = keyEndButtonIconProps?.iconName !== undefined &&
|
|
17
|
-
keyEndButtonIconProps.iconName !== null ? (<ButtonIcon_1.ButtonIcon size={
|
|
17
|
+
keyEndButtonIconProps.iconName !== null ? (<ButtonIcon_1.ButtonIcon size={design_system_shared_1.ButtonIconSize.Sm} {...keyEndButtonIconProps} iconName={keyEndButtonIconProps.iconName} iconProps={{
|
|
18
18
|
color: types_1.IconColor.IconAlternative,
|
|
19
19
|
...keyEndButtonIconProps.iconProps,
|
|
20
20
|
}}/>) : (keyEndAccessory);
|
|
21
21
|
const valueEndAccessoryNode = valueEndButtonIconProps?.iconName !== undefined &&
|
|
22
|
-
valueEndButtonIconProps.iconName !== null ? (<ButtonIcon_1.ButtonIcon size={
|
|
22
|
+
valueEndButtonIconProps.iconName !== null ? (<ButtonIcon_1.ButtonIcon size={design_system_shared_1.ButtonIconSize.Sm} {...valueEndButtonIconProps} iconName={valueEndButtonIconProps.iconName} iconProps={{
|
|
23
23
|
color: types_1.IconColor.IconDefault,
|
|
24
24
|
...valueEndButtonIconProps.iconProps,
|
|
25
25
|
}}/>) : (valueEndAccessory);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KeyValueRow.cjs","sourceRoot":"","sources":["../../../src/components/KeyValueRow/KeyValueRow.tsx"],"names":[],"mappings":";;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"KeyValueRow.cjs","sourceRoot":"","sources":["../../../src/components/KeyValueRow/KeyValueRow.tsx"],"names":[],"mappings":";;;;;;AAAA,kFAMiD;AACjD,8FAA4E;AAC5E,kDAA0B;AAE1B,iDAAwC;AACxC,0CAA6B;AAC7B,gDAAmC;AACnC,wDAA2C;AAIpC,MAAM,WAAW,GAAG,CAAC,EAC1B,iBAAiB,EACjB,eAAe,EACf,qBAAqB,EACrB,QAAQ,EAAE,UAAU,EAC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,\n TextColor,\n TextVariant,\n} from '@metamask-previews/design-system-shared';\nimport { useTailwind } from '@metamask-previews/design-system-twrnc-preset';\nimport React from 'react';\n\nimport { IconColor } from '../../types';\nimport { Box } from '../Box';\nimport { BoxRow } from '../BoxRow';\nimport { ButtonIcon } from '../ButtonIcon';\n\nimport type { KeyValueRowProps } from './KeyValueRow.types';\n\nexport const KeyValueRow = ({\n keyStartAccessory,\n keyEndAccessory,\n keyEndButtonIconProps,\n keyLabel: keyContent,\n keyTextProps,\n valueStartAccessory,\n valueEndAccessory,\n valueEndButtonIconProps,\n value: valueContent,\n valueTextProps,\n variant = KeyValueRowVariant.Summary,\n twClassName,\n style,\n ...viewProps\n}: KeyValueRowProps) => {\n const tw = useTailwind();\n\n const keyEndAccessoryNode =\n keyEndButtonIconProps?.iconName !== undefined &&\n keyEndButtonIconProps.iconName !== null ? (\n <ButtonIcon\n size={ButtonIconSize.Sm}\n {...keyEndButtonIconProps}\n iconName={keyEndButtonIconProps.iconName}\n iconProps={{\n color: IconColor.IconAlternative,\n ...keyEndButtonIconProps.iconProps,\n }}\n />\n ) : (\n keyEndAccessory\n );\n\n const valueEndAccessoryNode =\n valueEndButtonIconProps?.iconName !== undefined &&\n valueEndButtonIconProps.iconName !== null ? (\n <ButtonIcon\n size={ButtonIconSize.Sm}\n {...valueEndButtonIconProps}\n iconName={valueEndButtonIconProps.iconName}\n iconProps={{\n color: IconColor.IconDefault,\n ...valueEndButtonIconProps.iconProps,\n }}\n />\n ) : (\n valueEndAccessory\n );\n\n const keyBox = (\n <BoxRow\n startAccessory={keyStartAccessory}\n endAccessory={keyEndAccessoryNode}\n textProps={{\n variant: TextVariant.BodyMd,\n fontWeight: FontWeight.Medium,\n color: TextColor.TextAlternative,\n numberOfLines: 1,\n ellipsizeMode: 'tail',\n ...keyTextProps,\n }}\n >\n {keyContent}\n </BoxRow>\n );\n\n const valueBox = (\n <BoxRow\n startAccessory={valueStartAccessory}\n endAccessory={valueEndAccessoryNode}\n textProps={{\n variant: TextVariant.BodyMd,\n fontWeight: FontWeight.Medium,\n color: TextColor.TextDefault,\n numberOfLines: 1,\n ellipsizeMode: 'tail',\n ...valueTextProps,\n }}\n twClassName=\"flex-1 min-w-0 justify-end\"\n >\n {valueContent}\n </BoxRow>\n );\n\n return (\n <BoxRow\n endAccessory={valueBox}\n gap={4}\n style={[\n tw.style(\n variant === KeyValueRowVariant.Input ? 'h-12' : 'h-10',\n twClassName,\n ),\n style,\n ]}\n {...viewProps}\n >\n <Box twClassName=\"shrink-0\">{keyBox}</Box>\n </BoxRow>\n );\n};\n\nKeyValueRow.displayName = 'KeyValueRow';\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KeyValueRow.d.cts","sourceRoot":"","sources":["../../../src/components/KeyValueRow/KeyValueRow.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"KeyValueRow.d.cts","sourceRoot":"","sources":["../../../src/components/KeyValueRow/KeyValueRow.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,cAAc;AAO1B,OAAO,KAAK,EAAE,gBAAgB,EAAE,gCAA4B;AAE5D,eAAO,MAAM,WAAW;yPAerB,gBAAgB;;CAsFlB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KeyValueRow.d.mts","sourceRoot":"","sources":["../../../src/components/KeyValueRow/KeyValueRow.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"KeyValueRow.d.mts","sourceRoot":"","sources":["../../../src/components/KeyValueRow/KeyValueRow.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,cAAc;AAO1B,OAAO,KAAK,EAAE,gBAAgB,EAAE,gCAA4B;AAE5D,eAAO,MAAM,WAAW;yPAerB,gBAAgB;;CAsFlB,CAAC"}
|
|
@@ -4,11 +4,11 @@ function $importDefault(module) {
|
|
|
4
4
|
}
|
|
5
5
|
return module;
|
|
6
6
|
}
|
|
7
|
-
import { FontWeight, KeyValueRowVariant, TextColor, TextVariant } from "@metamask-previews/design-system-shared";
|
|
7
|
+
import { ButtonIconSize, FontWeight, KeyValueRowVariant, TextColor, TextVariant } from "@metamask-previews/design-system-shared";
|
|
8
8
|
import { useTailwind } from "@metamask-previews/design-system-twrnc-preset";
|
|
9
9
|
import $React from "react";
|
|
10
10
|
const React = $importDefault($React);
|
|
11
|
-
import {
|
|
11
|
+
import { IconColor } from "../../types/index.mjs";
|
|
12
12
|
import { Box } from "../Box/index.mjs";
|
|
13
13
|
import { BoxRow } from "../BoxRow/index.mjs";
|
|
14
14
|
import { ButtonIcon } from "../ButtonIcon/index.mjs";
|