@metamask-previews/design-system-react-native 0.11.0-preview.fa05289 → 0.13.0-preview.b4e6ece
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +30 -1
- package/dist/components/AvatarAccount/AvatarAccount.cjs +4 -3
- package/dist/components/AvatarAccount/AvatarAccount.cjs.map +1 -1
- package/dist/components/AvatarAccount/AvatarAccount.constants.cjs +9 -1
- package/dist/components/AvatarAccount/AvatarAccount.constants.cjs.map +1 -1
- package/dist/components/AvatarAccount/AvatarAccount.constants.d.cts +2 -0
- package/dist/components/AvatarAccount/AvatarAccount.constants.d.cts.map +1 -1
- package/dist/components/AvatarAccount/AvatarAccount.constants.d.mts +2 -0
- package/dist/components/AvatarAccount/AvatarAccount.constants.d.mts.map +1 -1
- package/dist/components/AvatarAccount/AvatarAccount.constants.mjs +8 -0
- package/dist/components/AvatarAccount/AvatarAccount.constants.mjs.map +1 -1
- package/dist/components/AvatarAccount/AvatarAccount.d.cts.map +1 -1
- package/dist/components/AvatarAccount/AvatarAccount.d.mts.map +1 -1
- package/dist/components/AvatarAccount/AvatarAccount.mjs +4 -3
- package/dist/components/AvatarAccount/AvatarAccount.mjs.map +1 -1
- package/dist/components/AvatarBase/AvatarBase.cjs +3 -3
- package/dist/components/AvatarBase/AvatarBase.cjs.map +1 -1
- package/dist/components/AvatarBase/AvatarBase.constants.cjs +21 -21
- package/dist/components/AvatarBase/AvatarBase.constants.cjs.map +1 -1
- package/dist/components/AvatarBase/AvatarBase.constants.d.cts +1 -1
- package/dist/components/AvatarBase/AvatarBase.constants.d.cts.map +1 -1
- package/dist/components/AvatarBase/AvatarBase.constants.d.mts +1 -1
- package/dist/components/AvatarBase/AvatarBase.constants.d.mts.map +1 -1
- package/dist/components/AvatarBase/AvatarBase.constants.mjs +1 -1
- package/dist/components/AvatarBase/AvatarBase.constants.mjs.map +1 -1
- package/dist/components/AvatarBase/AvatarBase.d.cts.map +1 -1
- package/dist/components/AvatarBase/AvatarBase.d.mts.map +1 -1
- package/dist/components/AvatarBase/AvatarBase.mjs +1 -1
- package/dist/components/AvatarBase/AvatarBase.mjs.map +1 -1
- package/dist/components/AvatarBase/AvatarBase.types.cjs.map +1 -1
- package/dist/components/AvatarBase/AvatarBase.types.d.cts +3 -39
- package/dist/components/AvatarBase/AvatarBase.types.d.cts.map +1 -1
- package/dist/components/AvatarBase/AvatarBase.types.d.mts +3 -39
- package/dist/components/AvatarBase/AvatarBase.types.d.mts.map +1 -1
- package/dist/components/AvatarBase/AvatarBase.types.mjs.map +1 -1
- package/dist/components/AvatarBase/index.cjs +3 -3
- package/dist/components/AvatarBase/index.cjs.map +1 -1
- package/dist/components/AvatarBase/index.d.cts +1 -1
- package/dist/components/AvatarBase/index.d.cts.map +1 -1
- package/dist/components/AvatarBase/index.d.mts +1 -1
- package/dist/components/AvatarBase/index.d.mts.map +1 -1
- package/dist/components/AvatarBase/index.mjs +1 -1
- package/dist/components/AvatarBase/index.mjs.map +1 -1
- package/dist/components/AvatarNetwork/AvatarNetwork.types.cjs.map +1 -1
- package/dist/components/AvatarNetwork/AvatarNetwork.types.d.cts +7 -9
- package/dist/components/AvatarNetwork/AvatarNetwork.types.d.cts.map +1 -1
- package/dist/components/AvatarNetwork/AvatarNetwork.types.d.mts +7 -9
- package/dist/components/AvatarNetwork/AvatarNetwork.types.d.mts.map +1 -1
- package/dist/components/AvatarNetwork/AvatarNetwork.types.mjs.map +1 -1
- package/dist/components/BadgeWrapper/BadgeWrapper.cjs +8 -8
- package/dist/components/BadgeWrapper/BadgeWrapper.cjs.map +1 -1
- package/dist/components/BadgeWrapper/BadgeWrapper.d.cts.map +1 -1
- package/dist/components/BadgeWrapper/BadgeWrapper.d.mts.map +1 -1
- package/dist/components/BadgeWrapper/BadgeWrapper.mjs +1 -1
- package/dist/components/BadgeWrapper/BadgeWrapper.mjs.map +1 -1
- package/dist/components/BadgeWrapper/BadgeWrapper.types.cjs.map +1 -1
- package/dist/components/BadgeWrapper/BadgeWrapper.types.d.cts +4 -51
- package/dist/components/BadgeWrapper/BadgeWrapper.types.d.cts.map +1 -1
- package/dist/components/BadgeWrapper/BadgeWrapper.types.d.mts +4 -51
- package/dist/components/BadgeWrapper/BadgeWrapper.types.d.mts.map +1 -1
- package/dist/components/BadgeWrapper/BadgeWrapper.types.mjs.map +1 -1
- package/dist/components/BadgeWrapper/index.cjs +3 -3
- package/dist/components/BadgeWrapper/index.cjs.map +1 -1
- package/dist/components/BadgeWrapper/index.d.cts +1 -2
- package/dist/components/BadgeWrapper/index.d.cts.map +1 -1
- package/dist/components/BadgeWrapper/index.d.mts +1 -2
- package/dist/components/BadgeWrapper/index.d.mts.map +1 -1
- package/dist/components/BadgeWrapper/index.mjs +1 -1
- package/dist/components/BadgeWrapper/index.mjs.map +1 -1
- package/dist/components/BottomSheet/BottomSheet.cjs +7 -10
- package/dist/components/BottomSheet/BottomSheet.cjs.map +1 -1
- package/dist/components/BottomSheet/BottomSheet.d.cts +31 -2
- package/dist/components/BottomSheet/BottomSheet.d.cts.map +1 -1
- package/dist/components/BottomSheet/BottomSheet.d.mts +31 -2
- package/dist/components/BottomSheet/BottomSheet.d.mts.map +1 -1
- package/dist/components/BottomSheet/BottomSheet.mjs +6 -6
- package/dist/components/BottomSheet/BottomSheet.mjs.map +1 -1
- package/dist/components/BottomSheet/BottomSheet.types.cjs.map +1 -1
- package/dist/components/BottomSheet/BottomSheet.types.d.cts +3 -8
- package/dist/components/BottomSheet/BottomSheet.types.d.cts.map +1 -1
- package/dist/components/BottomSheet/BottomSheet.types.d.mts +3 -8
- package/dist/components/BottomSheet/BottomSheet.types.d.mts.map +1 -1
- package/dist/components/BottomSheet/BottomSheet.types.mjs.map +1 -1
- package/dist/components/BottomSheetDialog/BottomSheetDialog.cjs +3 -3
- package/dist/components/BottomSheetDialog/BottomSheetDialog.cjs.map +1 -1
- package/dist/components/BottomSheetDialog/BottomSheetDialog.d.cts +31 -2
- package/dist/components/BottomSheetDialog/BottomSheetDialog.d.cts.map +1 -1
- package/dist/components/BottomSheetDialog/BottomSheetDialog.d.mts +31 -2
- package/dist/components/BottomSheetDialog/BottomSheetDialog.d.mts.map +1 -1
- package/dist/components/BottomSheetDialog/BottomSheetDialog.mjs +2 -3
- package/dist/components/BottomSheetDialog/BottomSheetDialog.mjs.map +1 -1
- package/dist/components/BottomSheetDialog/BottomSheetDialog.types.cjs.map +1 -1
- package/dist/components/BottomSheetDialog/BottomSheetDialog.types.d.cts +7 -0
- package/dist/components/BottomSheetDialog/BottomSheetDialog.types.d.cts.map +1 -1
- package/dist/components/BottomSheetDialog/BottomSheetDialog.types.d.mts +7 -0
- package/dist/components/BottomSheetDialog/BottomSheetDialog.types.d.mts.map +1 -1
- package/dist/components/BottomSheetDialog/BottomSheetDialog.types.mjs.map +1 -1
- package/dist/components/BottomSheetDialog/index.cjs +2 -5
- package/dist/components/BottomSheetDialog/index.cjs.map +1 -1
- package/dist/components/BottomSheetDialog/index.d.cts +1 -1
- package/dist/components/BottomSheetDialog/index.d.cts.map +1 -1
- package/dist/components/BottomSheetDialog/index.d.mts +1 -1
- package/dist/components/BottomSheetDialog/index.d.mts.map +1 -1
- package/dist/components/BottomSheetDialog/index.mjs +1 -1
- package/dist/components/BottomSheetDialog/index.mjs.map +1 -1
- package/dist/components/BottomSheetHeader/BottomSheetHeader.cjs +2 -2
- package/dist/components/BottomSheetHeader/BottomSheetHeader.cjs.map +1 -1
- package/dist/components/BottomSheetHeader/BottomSheetHeader.mjs +2 -2
- package/dist/components/BottomSheetHeader/BottomSheetHeader.mjs.map +1 -1
- package/dist/components/BoxHorizontal/BoxHorizontal.cjs +18 -0
- package/dist/components/BoxHorizontal/BoxHorizontal.cjs.map +1 -0
- package/dist/components/BoxHorizontal/BoxHorizontal.d.cts +7 -0
- package/dist/components/BoxHorizontal/BoxHorizontal.d.cts.map +1 -0
- package/dist/components/BoxHorizontal/BoxHorizontal.d.mts +7 -0
- package/dist/components/BoxHorizontal/BoxHorizontal.d.mts.map +1 -0
- package/dist/components/BoxHorizontal/BoxHorizontal.mjs +18 -0
- package/dist/components/BoxHorizontal/BoxHorizontal.mjs.map +1 -0
- package/dist/components/BoxHorizontal/BoxHorizontal.types.cjs +3 -0
- package/dist/components/BoxHorizontal/BoxHorizontal.types.cjs.map +1 -0
- package/dist/components/BoxHorizontal/BoxHorizontal.types.d.cts +13 -0
- package/dist/components/BoxHorizontal/BoxHorizontal.types.d.cts.map +1 -0
- package/dist/components/BoxHorizontal/BoxHorizontal.types.d.mts +13 -0
- package/dist/components/BoxHorizontal/BoxHorizontal.types.d.mts.map +1 -0
- package/dist/components/BoxHorizontal/BoxHorizontal.types.mjs +2 -0
- package/dist/components/BoxHorizontal/BoxHorizontal.types.mjs.map +1 -0
- package/dist/components/BoxHorizontal/index.cjs +6 -0
- package/dist/components/BoxHorizontal/index.cjs.map +1 -0
- package/dist/components/BoxHorizontal/index.d.cts +3 -0
- package/dist/components/BoxHorizontal/index.d.cts.map +1 -0
- package/dist/components/BoxHorizontal/index.d.mts +3 -0
- package/dist/components/BoxHorizontal/index.d.mts.map +1 -0
- package/dist/components/BoxHorizontal/index.mjs +2 -0
- package/dist/components/BoxHorizontal/index.mjs.map +1 -0
- package/dist/components/BoxVertical/BoxVertical.cjs +18 -0
- package/dist/components/BoxVertical/BoxVertical.cjs.map +1 -0
- package/dist/components/BoxVertical/BoxVertical.d.cts +7 -0
- package/dist/components/BoxVertical/BoxVertical.d.cts.map +1 -0
- package/dist/components/BoxVertical/BoxVertical.d.mts +7 -0
- package/dist/components/BoxVertical/BoxVertical.d.mts.map +1 -0
- package/dist/components/BoxVertical/BoxVertical.mjs +18 -0
- package/dist/components/BoxVertical/BoxVertical.mjs.map +1 -0
- package/dist/components/BoxVertical/BoxVertical.types.cjs +3 -0
- package/dist/components/BoxVertical/BoxVertical.types.cjs.map +1 -0
- package/dist/components/BoxVertical/BoxVertical.types.d.cts +13 -0
- package/dist/components/BoxVertical/BoxVertical.types.d.cts.map +1 -0
- package/dist/components/BoxVertical/BoxVertical.types.d.mts +13 -0
- package/dist/components/BoxVertical/BoxVertical.types.d.mts.map +1 -0
- package/dist/components/BoxVertical/BoxVertical.types.mjs +2 -0
- package/dist/components/BoxVertical/BoxVertical.types.mjs.map +1 -0
- package/dist/components/BoxVertical/index.cjs +6 -0
- package/dist/components/BoxVertical/index.cjs.map +1 -0
- package/dist/components/BoxVertical/index.d.cts +3 -0
- package/dist/components/BoxVertical/index.d.cts.map +1 -0
- package/dist/components/BoxVertical/index.d.mts +3 -0
- package/dist/components/BoxVertical/index.d.mts.map +1 -0
- package/dist/components/BoxVertical/index.mjs +2 -0
- package/dist/components/BoxVertical/index.mjs.map +1 -0
- package/dist/components/HeaderRoot/HeaderRoot.cjs +61 -0
- package/dist/components/HeaderRoot/HeaderRoot.cjs.map +1 -0
- package/dist/components/HeaderRoot/HeaderRoot.d.cts +7 -0
- package/dist/components/HeaderRoot/HeaderRoot.d.cts.map +1 -0
- package/dist/components/HeaderRoot/HeaderRoot.d.mts +7 -0
- package/dist/components/HeaderRoot/HeaderRoot.d.mts.map +1 -0
- package/dist/components/HeaderRoot/HeaderRoot.mjs +61 -0
- package/dist/components/HeaderRoot/HeaderRoot.mjs.map +1 -0
- package/dist/components/HeaderRoot/HeaderRoot.types.cjs +3 -0
- package/dist/components/HeaderRoot/HeaderRoot.types.cjs.map +1 -0
- package/dist/components/HeaderRoot/HeaderRoot.types.d.cts +60 -0
- package/dist/components/HeaderRoot/HeaderRoot.types.d.cts.map +1 -0
- package/dist/components/HeaderRoot/HeaderRoot.types.d.mts +60 -0
- package/dist/components/HeaderRoot/HeaderRoot.types.d.mts.map +1 -0
- package/dist/components/HeaderRoot/HeaderRoot.types.mjs +2 -0
- package/dist/components/HeaderRoot/HeaderRoot.types.mjs.map +1 -0
- package/dist/components/HeaderRoot/index.cjs +6 -0
- package/dist/components/HeaderRoot/index.cjs.map +1 -0
- package/dist/components/HeaderRoot/index.d.cts +3 -0
- package/dist/components/HeaderRoot/index.d.cts.map +1 -0
- package/dist/components/HeaderRoot/index.d.mts +3 -0
- package/dist/components/HeaderRoot/index.d.mts.map +1 -0
- package/dist/components/HeaderRoot/index.mjs +2 -0
- package/dist/components/HeaderRoot/index.mjs.map +1 -0
- package/dist/components/HeaderStandard/HeaderStandard.cjs +101 -0
- package/dist/components/HeaderStandard/HeaderStandard.cjs.map +1 -0
- package/dist/components/HeaderStandard/HeaderStandard.d.cts +4 -0
- package/dist/components/HeaderStandard/HeaderStandard.d.cts.map +1 -0
- package/dist/components/HeaderStandard/HeaderStandard.d.mts +4 -0
- package/dist/components/HeaderStandard/HeaderStandard.d.mts.map +1 -0
- package/dist/components/HeaderStandard/HeaderStandard.mjs +81 -0
- package/dist/components/HeaderStandard/HeaderStandard.mjs.map +1 -0
- package/dist/components/HeaderStandard/HeaderStandard.types.cjs +8 -0
- package/dist/components/HeaderStandard/HeaderStandard.types.cjs.map +1 -0
- package/dist/components/HeaderStandard/HeaderStandard.types.d.cts +55 -0
- package/dist/components/HeaderStandard/HeaderStandard.types.d.cts.map +1 -0
- package/dist/components/HeaderStandard/HeaderStandard.types.d.mts +55 -0
- package/dist/components/HeaderStandard/HeaderStandard.types.d.mts.map +1 -0
- package/dist/components/HeaderStandard/HeaderStandard.types.mjs +10 -0
- package/dist/components/HeaderStandard/HeaderStandard.types.mjs.map +1 -0
- package/dist/components/HeaderStandard/index.cjs +6 -0
- package/dist/components/HeaderStandard/index.cjs.map +1 -0
- package/dist/components/HeaderStandard/index.d.cts +3 -0
- package/dist/components/HeaderStandard/index.d.cts.map +1 -0
- package/dist/components/HeaderStandard/index.d.mts +3 -0
- package/dist/components/HeaderStandard/index.d.mts.map +1 -0
- package/dist/components/HeaderStandard/index.mjs +2 -0
- package/dist/components/HeaderStandard/index.mjs.map +1 -0
- package/dist/components/Icon/assets/candlestick.svg +1 -1
- package/dist/components/Input/Input.cjs +4 -3
- package/dist/components/Input/Input.cjs.map +1 -1
- package/dist/components/Input/Input.constants.cjs +69 -0
- package/dist/components/Input/Input.constants.cjs.map +1 -0
- package/dist/components/Input/Input.constants.d.cts +11 -0
- package/dist/components/Input/Input.constants.d.cts.map +1 -0
- package/dist/components/Input/Input.constants.d.mts +11 -0
- package/dist/components/Input/Input.constants.d.mts.map +1 -0
- package/dist/components/Input/Input.constants.mjs +66 -0
- package/dist/components/Input/Input.constants.mjs.map +1 -0
- package/dist/components/Input/Input.d.cts.map +1 -1
- package/dist/components/Input/Input.d.mts.map +1 -1
- package/dist/components/Input/Input.mjs +4 -3
- package/dist/components/Input/Input.mjs.map +1 -1
- package/dist/components/KeyValueRow/KeyValueLabel/KeyValueLabel.cjs +34 -0
- package/dist/components/KeyValueRow/KeyValueLabel/KeyValueLabel.cjs.map +1 -0
- package/dist/components/KeyValueRow/KeyValueLabel/KeyValueLabel.d.cts +13 -0
- package/dist/components/KeyValueRow/KeyValueLabel/KeyValueLabel.d.cts.map +1 -0
- package/dist/components/KeyValueRow/KeyValueLabel/KeyValueLabel.d.mts +13 -0
- package/dist/components/KeyValueRow/KeyValueLabel/KeyValueLabel.d.mts.map +1 -0
- package/dist/components/KeyValueRow/KeyValueLabel/KeyValueLabel.mjs +34 -0
- package/dist/components/KeyValueRow/KeyValueLabel/KeyValueLabel.mjs.map +1 -0
- package/dist/components/KeyValueRow/KeyValueRoot/KeyValueRoot.cjs +40 -0
- package/dist/components/KeyValueRow/KeyValueRoot/KeyValueRoot.cjs.map +1 -0
- package/dist/components/KeyValueRow/KeyValueRoot/KeyValueRoot.d.cts +24 -0
- package/dist/components/KeyValueRow/KeyValueRoot/KeyValueRoot.d.cts.map +1 -0
- package/dist/components/KeyValueRow/KeyValueRoot/KeyValueRoot.d.mts +24 -0
- package/dist/components/KeyValueRow/KeyValueRoot/KeyValueRoot.d.mts.map +1 -0
- package/dist/components/KeyValueRow/KeyValueRoot/KeyValueRoot.mjs +40 -0
- package/dist/components/KeyValueRow/KeyValueRoot/KeyValueRoot.mjs.map +1 -0
- package/dist/components/KeyValueRow/KeyValueRow.cjs +76 -0
- package/dist/components/KeyValueRow/KeyValueRow.cjs.map +1 -0
- package/dist/components/KeyValueRow/KeyValueRow.d.cts +24 -0
- package/dist/components/KeyValueRow/KeyValueRow.d.cts.map +1 -0
- package/dist/components/KeyValueRow/KeyValueRow.d.mts +24 -0
- package/dist/components/KeyValueRow/KeyValueRow.d.mts.map +1 -0
- package/dist/components/KeyValueRow/KeyValueRow.mjs +76 -0
- package/dist/components/KeyValueRow/KeyValueRow.mjs.map +1 -0
- package/dist/components/KeyValueRow/KeyValueRow.types.cjs +29 -0
- package/dist/components/KeyValueRow/KeyValueRow.types.cjs.map +1 -0
- package/dist/components/KeyValueRow/KeyValueRow.types.d.cts +177 -0
- package/dist/components/KeyValueRow/KeyValueRow.types.d.cts.map +1 -0
- package/dist/components/KeyValueRow/KeyValueRow.types.d.mts +177 -0
- package/dist/components/KeyValueRow/KeyValueRow.types.d.mts.map +1 -0
- package/dist/components/KeyValueRow/KeyValueRow.types.mjs +26 -0
- package/dist/components/KeyValueRow/KeyValueRow.types.mjs.map +1 -0
- package/dist/components/KeyValueRow/KeyValueRow.utils.cjs +6 -0
- package/dist/components/KeyValueRow/KeyValueRow.utils.cjs.map +1 -0
- package/dist/components/KeyValueRow/KeyValueRow.utils.d.cts +3 -0
- package/dist/components/KeyValueRow/KeyValueRow.utils.d.cts.map +1 -0
- package/dist/components/KeyValueRow/KeyValueRow.utils.d.mts +3 -0
- package/dist/components/KeyValueRow/KeyValueRow.utils.d.mts.map +1 -0
- package/dist/components/KeyValueRow/KeyValueRow.utils.mjs +2 -0
- package/dist/components/KeyValueRow/KeyValueRow.utils.mjs.map +1 -0
- package/dist/components/KeyValueRow/KeyValueSection/KeyValueSection.cjs +30 -0
- package/dist/components/KeyValueRow/KeyValueSection/KeyValueSection.cjs.map +1 -0
- package/dist/components/KeyValueRow/KeyValueSection/KeyValueSection.d.cts +16 -0
- package/dist/components/KeyValueRow/KeyValueSection/KeyValueSection.d.cts.map +1 -0
- package/dist/components/KeyValueRow/KeyValueSection/KeyValueSection.d.mts +16 -0
- package/dist/components/KeyValueRow/KeyValueSection/KeyValueSection.d.mts.map +1 -0
- package/dist/components/KeyValueRow/KeyValueSection/KeyValueSection.mjs +30 -0
- package/dist/components/KeyValueRow/KeyValueSection/KeyValueSection.mjs.map +1 -0
- package/dist/components/KeyValueRow/index.cjs +12 -0
- package/dist/components/KeyValueRow/index.cjs.map +1 -0
- package/dist/components/KeyValueRow/index.d.cts +3 -0
- package/dist/components/KeyValueRow/index.d.cts.map +1 -0
- package/dist/components/KeyValueRow/index.d.mts +3 -0
- package/dist/components/KeyValueRow/index.d.mts.map +1 -0
- package/dist/components/KeyValueRow/index.mjs +3 -0
- package/dist/components/KeyValueRow/index.mjs.map +1 -0
- package/dist/components/Skeleton/Skeleton.cjs +2 -1
- package/dist/components/Skeleton/Skeleton.cjs.map +1 -1
- package/dist/components/Skeleton/Skeleton.d.cts +1 -2
- package/dist/components/Skeleton/Skeleton.d.cts.map +1 -1
- package/dist/components/Skeleton/Skeleton.d.mts +1 -2
- package/dist/components/Skeleton/Skeleton.d.mts.map +1 -1
- package/dist/components/Skeleton/Skeleton.mjs +1 -2
- package/dist/components/Skeleton/Skeleton.mjs.map +1 -1
- package/dist/components/Skeleton/index.cjs +1 -4
- package/dist/components/Skeleton/index.cjs.map +1 -1
- package/dist/components/Skeleton/index.d.cts +1 -1
- package/dist/components/Skeleton/index.d.cts.map +1 -1
- package/dist/components/Skeleton/index.d.mts +1 -1
- package/dist/components/Skeleton/index.d.mts.map +1 -1
- package/dist/components/Skeleton/index.mjs +1 -1
- package/dist/components/Skeleton/index.mjs.map +1 -1
- package/dist/components/Text/Text.types.cjs.map +1 -1
- package/dist/components/Text/Text.types.d.cts +1 -1
- package/dist/components/Text/Text.types.d.mts +1 -1
- package/dist/components/Text/Text.types.mjs.map +1 -1
- package/dist/components/TextButton/TextButton.cjs +12 -36
- package/dist/components/TextButton/TextButton.cjs.map +1 -1
- package/dist/components/TextButton/TextButton.d.cts.map +1 -1
- package/dist/components/TextButton/TextButton.d.mts.map +1 -1
- package/dist/components/TextButton/TextButton.mjs +14 -38
- package/dist/components/TextButton/TextButton.mjs.map +1 -1
- package/dist/components/TextButton/TextButton.types.cjs.map +1 -1
- package/dist/components/TextButton/TextButton.types.d.cts +8 -60
- package/dist/components/TextButton/TextButton.types.d.cts.map +1 -1
- package/dist/components/TextButton/TextButton.types.d.mts +8 -60
- package/dist/components/TextButton/TextButton.types.d.mts.map +1 -1
- package/dist/components/TextButton/TextButton.types.mjs.map +1 -1
- package/dist/components/TextButton/index.cjs +1 -3
- package/dist/components/TextButton/index.cjs.map +1 -1
- package/dist/components/TextButton/index.d.cts +0 -1
- package/dist/components/TextButton/index.d.cts.map +1 -1
- package/dist/components/TextButton/index.d.mts +0 -1
- package/dist/components/TextButton/index.d.mts.map +1 -1
- package/dist/components/TextButton/index.mjs +0 -1
- package/dist/components/TextButton/index.mjs.map +1 -1
- package/dist/components/TextField/TextField.cjs +22 -8
- package/dist/components/TextField/TextField.cjs.map +1 -1
- package/dist/components/TextField/TextField.d.cts +0 -2
- package/dist/components/TextField/TextField.d.cts.map +1 -1
- package/dist/components/TextField/TextField.d.mts +0 -2
- package/dist/components/TextField/TextField.d.mts.map +1 -1
- package/dist/components/TextField/TextField.mjs +22 -8
- package/dist/components/TextField/TextField.mjs.map +1 -1
- package/dist/components/TextField/TextField.types.cjs +0 -10
- package/dist/components/TextField/TextField.types.cjs.map +1 -1
- package/dist/components/TextField/TextField.types.d.cts +0 -14
- package/dist/components/TextField/TextField.types.d.cts.map +1 -1
- package/dist/components/TextField/TextField.types.d.mts +0 -14
- package/dist/components/TextField/TextField.types.d.mts.map +1 -1
- package/dist/components/TextField/TextField.types.mjs +1 -9
- package/dist/components/TextField/TextField.types.mjs.map +1 -1
- package/dist/components/TextField/index.cjs +1 -3
- package/dist/components/TextField/index.cjs.map +1 -1
- package/dist/components/TextField/index.d.cts +0 -1
- package/dist/components/TextField/index.d.cts.map +1 -1
- package/dist/components/TextField/index.d.mts +0 -1
- package/dist/components/TextField/index.d.mts.map +1 -1
- package/dist/components/TextField/index.mjs +0 -1
- package/dist/components/TextField/index.mjs.map +1 -1
- package/dist/components/TextFieldSearch/TextFieldSearch.cjs +45 -0
- package/dist/components/TextFieldSearch/TextFieldSearch.cjs.map +1 -0
- package/dist/components/TextFieldSearch/TextFieldSearch.d.cts +14 -0
- package/dist/components/TextFieldSearch/TextFieldSearch.d.cts.map +1 -0
- package/dist/components/TextFieldSearch/TextFieldSearch.d.mts +14 -0
- package/dist/components/TextFieldSearch/TextFieldSearch.d.mts.map +1 -0
- package/dist/components/TextFieldSearch/TextFieldSearch.mjs +26 -0
- package/dist/components/TextFieldSearch/TextFieldSearch.mjs.map +1 -0
- package/dist/components/TextFieldSearch/TextFieldSearch.types.cjs +3 -0
- package/dist/components/TextFieldSearch/TextFieldSearch.types.cjs.map +1 -0
- package/dist/components/TextFieldSearch/TextFieldSearch.types.d.cts +17 -0
- package/dist/components/TextFieldSearch/TextFieldSearch.types.d.cts.map +1 -0
- package/dist/components/TextFieldSearch/TextFieldSearch.types.d.mts +17 -0
- package/dist/components/TextFieldSearch/TextFieldSearch.types.d.mts.map +1 -0
- package/dist/components/TextFieldSearch/TextFieldSearch.types.mjs +2 -0
- package/dist/components/TextFieldSearch/TextFieldSearch.types.mjs.map +1 -0
- package/dist/components/TextFieldSearch/index.cjs +6 -0
- package/dist/components/TextFieldSearch/index.cjs.map +1 -0
- package/dist/components/TextFieldSearch/index.d.cts +3 -0
- package/dist/components/TextFieldSearch/index.d.cts.map +1 -0
- package/dist/components/TextFieldSearch/index.d.mts +3 -0
- package/dist/components/TextFieldSearch/index.d.mts.map +1 -0
- package/dist/components/TextFieldSearch/index.mjs +2 -0
- package/dist/components/TextFieldSearch/index.mjs.map +1 -0
- package/dist/components/Toast/Toast.cjs +2 -2
- package/dist/components/Toast/Toast.cjs.map +1 -1
- package/dist/components/Toast/Toast.d.cts +1 -2
- package/dist/components/Toast/Toast.d.cts.map +1 -1
- package/dist/components/Toast/Toast.d.mts +1 -2
- package/dist/components/Toast/Toast.d.mts.map +1 -1
- package/dist/components/Toast/Toast.mjs +1 -2
- package/dist/components/Toast/Toast.mjs.map +1 -1
- package/dist/components/Toast/index.cjs +1 -4
- package/dist/components/Toast/index.cjs.map +1 -1
- package/dist/components/Toast/index.d.cts +1 -1
- package/dist/components/Toast/index.d.cts.map +1 -1
- package/dist/components/Toast/index.d.mts +1 -1
- package/dist/components/Toast/index.d.mts.map +1 -1
- package/dist/components/Toast/index.mjs +1 -1
- package/dist/components/Toast/index.mjs.map +1 -1
- package/dist/components/index.cjs +14 -8
- package/dist/components/index.cjs.map +1 -1
- package/dist/components/index.d.cts +13 -3
- package/dist/components/index.d.cts.map +1 -1
- package/dist/components/index.d.mts +13 -3
- package/dist/components/index.d.mts.map +1 -1
- package/dist/components/index.mjs +8 -3
- package/dist/components/index.mjs.map +1 -1
- package/dist/components/temp-components/TextOrChildren/TextOrChildren.types.cjs.map +1 -1
- package/dist/components/temp-components/TextOrChildren/TextOrChildren.types.d.cts +2 -5
- package/dist/components/temp-components/TextOrChildren/TextOrChildren.types.d.cts.map +1 -1
- package/dist/components/temp-components/TextOrChildren/TextOrChildren.types.d.mts +2 -5
- package/dist/components/temp-components/TextOrChildren/TextOrChildren.types.d.mts.map +1 -1
- package/dist/components/temp-components/TextOrChildren/TextOrChildren.types.mjs.map +1 -1
- package/dist/types/index.cjs +20 -71
- package/dist/types/index.cjs.map +1 -1
- package/dist/types/index.d.cts +10 -82
- package/dist/types/index.d.cts.map +1 -1
- package/dist/types/index.d.mts +10 -82
- package/dist/types/index.d.mts.map +1 -1
- package/dist/types/index.mjs +10 -78
- package/dist/types/index.mjs.map +1 -1
- package/package.json +7 -8
- package/dist/components/TextButton/TextButton.constants.cjs +0 -12
- package/dist/components/TextButton/TextButton.constants.cjs.map +0 -1
- package/dist/components/TextButton/TextButton.constants.d.cts +0 -4
- package/dist/components/TextButton/TextButton.constants.d.cts.map +0 -1
- package/dist/components/TextButton/TextButton.constants.d.mts +0 -4
- package/dist/components/TextButton/TextButton.constants.d.mts.map +0 -1
- package/dist/components/TextButton/TextButton.constants.mjs +0 -9
- package/dist/components/TextButton/TextButton.constants.mjs.map +0 -1
- package/dist/components/TextField/TextField.constants.cjs +0 -13
- package/dist/components/TextField/TextField.constants.cjs.map +0 -1
- package/dist/components/TextField/TextField.constants.d.cts +0 -6
- package/dist/components/TextField/TextField.constants.d.cts.map +0 -1
- package/dist/components/TextField/TextField.constants.d.mts +0 -6
- package/dist/components/TextField/TextField.constants.d.mts.map +0 -1
- package/dist/components/TextField/TextField.constants.mjs +0 -10
- package/dist/components/TextField/TextField.constants.mjs.map +0 -1
|
@@ -4,6 +4,7 @@ import { forwardRef, useCallback, useMemo, useState } from "react";
|
|
|
4
4
|
import { Platform, TextInput } from "react-native/index.js";
|
|
5
5
|
import { FontFamily, TextVariant } from "../../types/index.mjs";
|
|
6
6
|
import { MAP_TEXT_VARIANT_FONTWEIGHT, TWCLASSMAP_TEXT_FONTWEIGHT } from "../Text/Text.constants.mjs";
|
|
7
|
+
import { MAP_TEXT_VARIANT_INPUT_METRICS } from "./Input.constants.mjs";
|
|
7
8
|
export const Input = forwardRef(({ style, textVariant = TextVariant.BodyMd, isStateStylesDisabled, isDisabled = false, isReadonly = false, value, placeholder, twClassName, onBlur, onFocus, autoFocus = false, ...props }, ref) => {
|
|
8
9
|
const [isFocused, setIsFocused] = useState(autoFocus);
|
|
9
10
|
const tw = useTailwind();
|
|
@@ -19,11 +20,10 @@ export const Input = forwardRef(({ style, textVariant = TextVariant.BodyMd, isSt
|
|
|
19
20
|
// the controlled value is empty. This keeps the iOS lineHeight workaround
|
|
20
21
|
// scoped to the placeholder-visible state without affecting typed text.
|
|
21
22
|
const isPlaceholderVisible = hasPlaceholder && value === '';
|
|
22
|
-
const inputStyle = useMemo(() => tw.style(
|
|
23
|
+
const inputStyle = useMemo(() => tw.style(fontClass, 'text-default', 'bg-default', 'border', 'border-transparent', !isStateStylesDisabled && isDisabled && 'opacity-50', !isStateStylesDisabled &&
|
|
23
24
|
!isDisabled &&
|
|
24
25
|
isFocused &&
|
|
25
26
|
'border-primary-default', twClassName), [
|
|
26
|
-
textVariant,
|
|
27
27
|
fontClass,
|
|
28
28
|
isStateStylesDisabled,
|
|
29
29
|
isDisabled,
|
|
@@ -31,6 +31,7 @@ export const Input = forwardRef(({ style, textVariant = TextVariant.BodyMd, isSt
|
|
|
31
31
|
twClassName,
|
|
32
32
|
tw,
|
|
33
33
|
]);
|
|
34
|
+
const variantTextStyle = useMemo(() => MAP_TEXT_VARIANT_INPUT_METRICS[textVariant], [textVariant]);
|
|
34
35
|
/* istanbul ignore next: handler body covered by focus/blur tests */
|
|
35
36
|
const onBlurHandler = useCallback((e) => {
|
|
36
37
|
if (!isDisabled) {
|
|
@@ -47,12 +48,12 @@ export const Input = forwardRef(({ style, textVariant = TextVariant.BodyMd, isSt
|
|
|
47
48
|
}, [isDisabled, onFocus]);
|
|
48
49
|
const resolvedStyle = [
|
|
49
50
|
inputStyle,
|
|
51
|
+
variantTextStyle,
|
|
50
52
|
// iOS-only workaround: when a placeholder is visible, native iOS
|
|
51
53
|
// TextInput can render placeholder text vertically offset.
|
|
52
54
|
// Keep this iOS-only because lineHeight: 0 can collapse text on Android.
|
|
53
55
|
Platform.OS === 'ios' &&
|
|
54
56
|
isPlaceholderVisible && { lineHeight: 0 },
|
|
55
|
-
Platform.OS === 'ios' && { textAlignVertical: 'center' },
|
|
56
57
|
style,
|
|
57
58
|
].filter(Boolean);
|
|
58
59
|
return (<TextInput ref={ref} placeholderTextColor={placeholderTextColor} {...props} placeholder={placeholder} value={value} style={resolvedStyle} editable={!isDisabled && !isReadonly} autoFocus={autoFocus} onBlur={onBlurHandler} onFocus={onFocusHandler}/>);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Input.mjs","sourceRoot":"","sources":["../../../src/components/Input/Input.tsx"],"names":[],"mappings":"AAAA,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;AACnE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,8BAAqB;AAEnD,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,8BAAoB;AACtD,OAAO,EACL,2BAA2B,EAC3B,0BAA0B,EAC3B,mCAA+B;
|
|
1
|
+
{"version":3,"file":"Input.mjs","sourceRoot":"","sources":["../../../src/components/Input/Input.tsx"],"names":[],"mappings":"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","sourcesContent":["import {\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, useMemo, useState } from 'react';\nimport { Platform, TextInput } from 'react-native';\n\nimport { FontFamily, TextVariant } from '../../types';\nimport {\n MAP_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 ...props\n },\n ref,\n ) => {\n const [isFocused, setIsFocused] = useState(autoFocus);\n const tw = useTailwind();\n const theme = useTheme();\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 = MAP_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 const inputStyle = 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\n const variantTextStyle = useMemo(\n () => MAP_TEXT_VARIANT_INPUT_METRICS[textVariant],\n [textVariant],\n );\n\n /* istanbul ignore next: handler body covered by focus/blur tests */\n const onBlurHandler = useCallback(\n (e: Parameters<NonNullable<InputProps['onBlur']>>[0]) => {\n if (!isDisabled) {\n setIsFocused(false);\n onBlur?.(e);\n }\n },\n [isDisabled, onBlur],\n );\n\n /* istanbul ignore next: handler body covered by focus/blur tests */\n const onFocusHandler = useCallback(\n (e: Parameters<NonNullable<InputProps['onFocus']>>[0]) => {\n if (!isDisabled) {\n setIsFocused(true);\n onFocus?.(e);\n }\n },\n [isDisabled, onFocus],\n );\n const resolvedStyle = [\n inputStyle,\n variantTextStyle,\n // iOS-only workaround: when a placeholder is visible, native iOS\n // TextInput can render placeholder text vertically offset.\n // Keep this iOS-only because lineHeight: 0 can collapse text on Android.\n Platform.OS === 'ios' &&\n isPlaceholderVisible && { lineHeight: 0 as const },\n style,\n ].filter(Boolean);\n\n return (\n <TextInput\n ref={ref}\n placeholderTextColor={placeholderTextColor}\n {...props}\n placeholder={placeholder}\n value={value}\n style={resolvedStyle}\n editable={!isDisabled && !isReadonly}\n autoFocus={autoFocus}\n onBlur={onBlurHandler}\n onFocus={onFocusHandler}\n />\n );\n },\n);\n"]}
|
|
@@ -0,0 +1,34 @@
|
|
|
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.KeyValueRowLabel = void 0;
|
|
7
|
+
const design_system_twrnc_preset_1 = require("@metamask-previews/design-system-twrnc-preset");
|
|
8
|
+
const react_1 = __importDefault(require("react"));
|
|
9
|
+
const react_native_1 = require("react-native/index.js");
|
|
10
|
+
const ButtonIcon_1 = require("../../ButtonIcon/index.cjs");
|
|
11
|
+
const Icon_1 = require("../../Icon/index.cjs");
|
|
12
|
+
const Text_1 = require("../../Text/index.cjs");
|
|
13
|
+
const KeyValueRow_utils_1 = require("../KeyValueRow.utils.cjs");
|
|
14
|
+
/**
|
|
15
|
+
* A label and optional tooltip button component.
|
|
16
|
+
*
|
|
17
|
+
* @param props - Component props.
|
|
18
|
+
* @param props.label - The label content to display.
|
|
19
|
+
* @param props.tooltip - Optional tooltip to render to the right of the label.
|
|
20
|
+
*
|
|
21
|
+
* @returns The rendered KeyValueRowLabel component.
|
|
22
|
+
*/
|
|
23
|
+
const KeyValueRowLabel = ({ label, tooltip, }) => {
|
|
24
|
+
const tw = (0, design_system_twrnc_preset_1.useTailwind)();
|
|
25
|
+
const hasTooltip = Boolean(tooltip?.title && tooltip?.content);
|
|
26
|
+
return (<react_native_1.View style={tw.style('flex-row items-center')}>
|
|
27
|
+
{(0, KeyValueRow_utils_1.isPreDefinedKeyValueRowLabel)(label) ? (<Text_1.Text variant={label.variant ?? Text_1.TextVariant.BodyMd} color={label.color ?? Text_1.TextColor.TextDefault}>
|
|
28
|
+
{label.text}
|
|
29
|
+
</Text_1.Text>) : (label)}
|
|
30
|
+
{hasTooltip && tooltip && (<ButtonIcon_1.ButtonIcon size={tooltip.size ?? ButtonIcon_1.ButtonIconSize.Md} iconName={tooltip.iconName ?? Icon_1.IconName.Question} accessibilityLabel={`${tooltip.title} tooltip`} onPress={() => tooltip?.onPress?.()}/>)}
|
|
31
|
+
</react_native_1.View>);
|
|
32
|
+
};
|
|
33
|
+
exports.KeyValueRowLabel = KeyValueRowLabel;
|
|
34
|
+
//# sourceMappingURL=KeyValueLabel.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"KeyValueLabel.cjs","sourceRoot":"","sources":["../../../../src/components/KeyValueRow/KeyValueLabel/KeyValueLabel.tsx"],"names":[],"mappings":";;;;;;AAAA,8FAA4E;AAC5E,kDAA0B;AAC1B,wDAAoC;AAEpC,2DAA8D;AAC9D,+CAAsC;AACtC,+CAA0D;AAE1D,gEAAoE;AAEpE;;;;;;;;GAQG;AACI,MAAM,gBAAgB,GAAoC,CAAC,EAChE,KAAK,EACL,OAAO,GACR,EAAE,EAAE;IACH,MAAM,EAAE,GAAG,IAAA,wCAAW,GAAE,CAAC;IAEzB,MAAM,UAAU,GAAG,OAAO,CAAC,OAAO,EAAE,KAAK,IAAI,OAAO,EAAE,OAAO,CAAC,CAAC;IAE/D,OAAO,CACL,CAAC,mBAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,uBAAuB,CAAC,CAAC,CAC7C;MAAA,CAAC,IAAA,gDAA4B,EAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CACrC,CAAC,WAAI,CACH,OAAO,CAAC,CAAC,KAAK,CAAC,OAAO,IAAI,kBAAW,CAAC,MAAM,CAAC,CAC7C,KAAK,CAAC,CAAC,KAAK,CAAC,KAAK,IAAI,gBAAS,CAAC,WAAW,CAAC,CAE5C;UAAA,CAAC,KAAK,CAAC,IAAI,CACb;QAAA,EAAE,WAAI,CAAC,CACR,CAAC,CAAC,CAAC,CACF,KAAK,CACN,CACD;MAAA,CAAC,UAAU,IAAI,OAAO,IAAI,CACxB,CAAC,uBAAU,CACT,IAAI,CAAC,CAAC,OAAO,CAAC,IAAI,IAAI,2BAAc,CAAC,EAAE,CAAC,CACxC,QAAQ,CAAC,CAAC,OAAO,CAAC,QAAQ,IAAI,eAAQ,CAAC,QAAQ,CAAC,CAChD,kBAAkB,CAAC,CAAC,GAAG,OAAO,CAAC,KAAK,UAAU,CAAC,CAC/C,OAAO,CAAC,CAAC,GAAG,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,EAAE,CAAC,EACpC,CACH,CACH;IAAA,EAAE,mBAAI,CAAC,CACR,CAAC;AACJ,CAAC,CAAC;AA9BW,QAAA,gBAAgB,oBA8B3B","sourcesContent":["import { useTailwind } from '@metamask-previews/design-system-twrnc-preset';\nimport React from 'react';\nimport { View } from 'react-native';\n\nimport { ButtonIcon, ButtonIconSize } from '../../ButtonIcon';\nimport { IconName } from '../../Icon';\nimport { Text, TextColor, TextVariant } from '../../Text';\nimport type { KeyValueRowLabelProps } from '../KeyValueRow.types';\nimport { isPreDefinedKeyValueRowLabel } from '../KeyValueRow.utils';\n\n/**\n * A label and optional tooltip button component.\n *\n * @param props - Component props.\n * @param props.label - The label content to display.\n * @param props.tooltip - Optional tooltip to render to the right of the label.\n *\n * @returns The rendered KeyValueRowLabel component.\n */\nexport const KeyValueRowLabel: React.FC<KeyValueRowLabelProps> = ({\n label,\n tooltip,\n}) => {\n const tw = useTailwind();\n\n const hasTooltip = Boolean(tooltip?.title && tooltip?.content);\n\n return (\n <View style={tw.style('flex-row items-center')}>\n {isPreDefinedKeyValueRowLabel(label) ? (\n <Text\n variant={label.variant ?? TextVariant.BodyMd}\n color={label.color ?? TextColor.TextDefault}\n >\n {label.text}\n </Text>\n ) : (\n label\n )}\n {hasTooltip && tooltip && (\n <ButtonIcon\n size={tooltip.size ?? ButtonIconSize.Md}\n iconName={tooltip.iconName ?? IconName.Question}\n accessibilityLabel={`${tooltip.title} tooltip`}\n onPress={() => tooltip?.onPress?.()}\n />\n )}\n </View>\n );\n};\n"]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { KeyValueRowLabelProps } from "../KeyValueRow.types.cjs";
|
|
3
|
+
/**
|
|
4
|
+
* A label and optional tooltip button component.
|
|
5
|
+
*
|
|
6
|
+
* @param props - Component props.
|
|
7
|
+
* @param props.label - The label content to display.
|
|
8
|
+
* @param props.tooltip - Optional tooltip to render to the right of the label.
|
|
9
|
+
*
|
|
10
|
+
* @returns The rendered KeyValueRowLabel component.
|
|
11
|
+
*/
|
|
12
|
+
export declare const KeyValueRowLabel: React.FC<KeyValueRowLabelProps>;
|
|
13
|
+
//# sourceMappingURL=KeyValueLabel.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"KeyValueLabel.d.cts","sourceRoot":"","sources":["../../../../src/components/KeyValueRow/KeyValueLabel/KeyValueLabel.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,cAAc;AAM1B,OAAO,KAAK,EAAE,qBAAqB,EAAE,iCAA6B;AAGlE;;;;;;;;GAQG;AACH,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,qBAAqB,CA8B5D,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { KeyValueRowLabelProps } from "../KeyValueRow.types.mjs";
|
|
3
|
+
/**
|
|
4
|
+
* A label and optional tooltip button component.
|
|
5
|
+
*
|
|
6
|
+
* @param props - Component props.
|
|
7
|
+
* @param props.label - The label content to display.
|
|
8
|
+
* @param props.tooltip - Optional tooltip to render to the right of the label.
|
|
9
|
+
*
|
|
10
|
+
* @returns The rendered KeyValueRowLabel component.
|
|
11
|
+
*/
|
|
12
|
+
export declare const KeyValueRowLabel: React.FC<KeyValueRowLabelProps>;
|
|
13
|
+
//# sourceMappingURL=KeyValueLabel.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"KeyValueLabel.d.mts","sourceRoot":"","sources":["../../../../src/components/KeyValueRow/KeyValueLabel/KeyValueLabel.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,cAAc;AAM1B,OAAO,KAAK,EAAE,qBAAqB,EAAE,iCAA6B;AAGlE;;;;;;;;GAQG;AACH,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,qBAAqB,CA8B5D,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
function $importDefault(module) {
|
|
2
|
+
if (module?.__esModule) {
|
|
3
|
+
return module.default;
|
|
4
|
+
}
|
|
5
|
+
return module;
|
|
6
|
+
}
|
|
7
|
+
import { useTailwind } from "@metamask-previews/design-system-twrnc-preset";
|
|
8
|
+
import $React from "react";
|
|
9
|
+
const React = $importDefault($React);
|
|
10
|
+
import { View } from "react-native/index.js";
|
|
11
|
+
import { ButtonIcon, ButtonIconSize } from "../../ButtonIcon/index.mjs";
|
|
12
|
+
import { IconName } from "../../Icon/index.mjs";
|
|
13
|
+
import { Text, TextColor, TextVariant } from "../../Text/index.mjs";
|
|
14
|
+
import { isPreDefinedKeyValueRowLabel } from "../KeyValueRow.utils.mjs";
|
|
15
|
+
/**
|
|
16
|
+
* A label and optional tooltip button component.
|
|
17
|
+
*
|
|
18
|
+
* @param props - Component props.
|
|
19
|
+
* @param props.label - The label content to display.
|
|
20
|
+
* @param props.tooltip - Optional tooltip to render to the right of the label.
|
|
21
|
+
*
|
|
22
|
+
* @returns The rendered KeyValueRowLabel component.
|
|
23
|
+
*/
|
|
24
|
+
export const KeyValueRowLabel = ({ label, tooltip, }) => {
|
|
25
|
+
const tw = useTailwind();
|
|
26
|
+
const hasTooltip = Boolean(tooltip?.title && tooltip?.content);
|
|
27
|
+
return (<View style={tw.style('flex-row items-center')}>
|
|
28
|
+
{isPreDefinedKeyValueRowLabel(label) ? (<Text variant={label.variant ?? TextVariant.BodyMd} color={label.color ?? TextColor.TextDefault}>
|
|
29
|
+
{label.text}
|
|
30
|
+
</Text>) : (label)}
|
|
31
|
+
{hasTooltip && tooltip && (<ButtonIcon size={tooltip.size ?? ButtonIconSize.Md} iconName={tooltip.iconName ?? IconName.Question} accessibilityLabel={`${tooltip.title} tooltip`} onPress={() => tooltip?.onPress?.()}/>)}
|
|
32
|
+
</View>);
|
|
33
|
+
};
|
|
34
|
+
//# sourceMappingURL=KeyValueLabel.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"KeyValueLabel.mjs","sourceRoot":"","sources":["../../../../src/components/KeyValueRow/KeyValueLabel/KeyValueLabel.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,sDAAsD;AAC5E,OAAO,MAAK,cAAc;;AAC1B,OAAO,EAAE,IAAI,EAAE,8BAAqB;AAEpC,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,mCAAyB;AAC9D,OAAO,EAAE,QAAQ,EAAE,6BAAmB;AACtC,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,6BAAmB;AAE1D,OAAO,EAAE,4BAA4B,EAAE,iCAA6B;AAEpE;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAoC,CAAC,EAChE,KAAK,EACL,OAAO,GACR,EAAE,EAAE;IACH,MAAM,EAAE,GAAG,WAAW,EAAE,CAAC;IAEzB,MAAM,UAAU,GAAG,OAAO,CAAC,OAAO,EAAE,KAAK,IAAI,OAAO,EAAE,OAAO,CAAC,CAAC;IAE/D,OAAO,CACL,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,uBAAuB,CAAC,CAAC,CAC7C;MAAA,CAAC,4BAA4B,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CACrC,CAAC,IAAI,CACH,OAAO,CAAC,CAAC,KAAK,CAAC,OAAO,IAAI,WAAW,CAAC,MAAM,CAAC,CAC7C,KAAK,CAAC,CAAC,KAAK,CAAC,KAAK,IAAI,SAAS,CAAC,WAAW,CAAC,CAE5C;UAAA,CAAC,KAAK,CAAC,IAAI,CACb;QAAA,EAAE,IAAI,CAAC,CACR,CAAC,CAAC,CAAC,CACF,KAAK,CACN,CACD;MAAA,CAAC,UAAU,IAAI,OAAO,IAAI,CACxB,CAAC,UAAU,CACT,IAAI,CAAC,CAAC,OAAO,CAAC,IAAI,IAAI,cAAc,CAAC,EAAE,CAAC,CACxC,QAAQ,CAAC,CAAC,OAAO,CAAC,QAAQ,IAAI,QAAQ,CAAC,QAAQ,CAAC,CAChD,kBAAkB,CAAC,CAAC,GAAG,OAAO,CAAC,KAAK,UAAU,CAAC,CAC/C,OAAO,CAAC,CAAC,GAAG,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,EAAE,CAAC,EACpC,CACH,CACH;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { useTailwind } from '@metamask-previews/design-system-twrnc-preset';\nimport React from 'react';\nimport { View } from 'react-native';\n\nimport { ButtonIcon, ButtonIconSize } from '../../ButtonIcon';\nimport { IconName } from '../../Icon';\nimport { Text, TextColor, TextVariant } from '../../Text';\nimport type { KeyValueRowLabelProps } from '../KeyValueRow.types';\nimport { isPreDefinedKeyValueRowLabel } from '../KeyValueRow.utils';\n\n/**\n * A label and optional tooltip button component.\n *\n * @param props - Component props.\n * @param props.label - The label content to display.\n * @param props.tooltip - Optional tooltip to render to the right of the label.\n *\n * @returns The rendered KeyValueRowLabel component.\n */\nexport const KeyValueRowLabel: React.FC<KeyValueRowLabelProps> = ({\n label,\n tooltip,\n}) => {\n const tw = useTailwind();\n\n const hasTooltip = Boolean(tooltip?.title && tooltip?.content);\n\n return (\n <View style={tw.style('flex-row items-center')}>\n {isPreDefinedKeyValueRowLabel(label) ? (\n <Text\n variant={label.variant ?? TextVariant.BodyMd}\n color={label.color ?? TextColor.TextDefault}\n >\n {label.text}\n </Text>\n ) : (\n label\n )}\n {hasTooltip && tooltip && (\n <ButtonIcon\n size={tooltip.size ?? ButtonIconSize.Md}\n iconName={tooltip.iconName ?? IconName.Question}\n accessibilityLabel={`${tooltip.title} tooltip`}\n onPress={() => tooltip?.onPress?.()}\n />\n )}\n </View>\n );\n};\n"]}
|
|
@@ -0,0 +1,40 @@
|
|
|
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.KeyValueRowRoot = void 0;
|
|
7
|
+
const design_system_twrnc_preset_1 = require("@metamask-previews/design-system-twrnc-preset");
|
|
8
|
+
const react_1 = __importDefault(require("react"));
|
|
9
|
+
const react_native_1 = require("react-native/index.js");
|
|
10
|
+
/**
|
|
11
|
+
* The main container for the KeyValueRow component.
|
|
12
|
+
* When creating custom KeyValueRow components, this must be the outermost component
|
|
13
|
+
* wrapping the two <KeyValueSection/> components.
|
|
14
|
+
*
|
|
15
|
+
* e.g.
|
|
16
|
+
* ```
|
|
17
|
+
* <KeyValueRowRoot>
|
|
18
|
+
* <KeyValueSection></KeyValueSection>
|
|
19
|
+
* <KeyValueSection></KeyValueSection>
|
|
20
|
+
* </KeyValueRowRoot>
|
|
21
|
+
* ```
|
|
22
|
+
*
|
|
23
|
+
* @param props - Component props.
|
|
24
|
+
* @param props.children - The two <KeyValueSection> children.
|
|
25
|
+
* @param props.twClassName - Optional Tailwind class names to override root styles.
|
|
26
|
+
* @param props.style - Optional additional styles for the root element.
|
|
27
|
+
*
|
|
28
|
+
* @returns The rendered Root component.
|
|
29
|
+
*/
|
|
30
|
+
const KeyValueRowRoot = ({ children, twClassName, style, ...props }) => {
|
|
31
|
+
const tw = (0, design_system_twrnc_preset_1.useTailwind)();
|
|
32
|
+
return (<react_native_1.View style={[
|
|
33
|
+
tw.style('flex-row justify-between items-center overflow-hidden', twClassName),
|
|
34
|
+
style,
|
|
35
|
+
]} {...props}>
|
|
36
|
+
{children}
|
|
37
|
+
</react_native_1.View>);
|
|
38
|
+
};
|
|
39
|
+
exports.KeyValueRowRoot = KeyValueRowRoot;
|
|
40
|
+
//# sourceMappingURL=KeyValueRoot.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"KeyValueRoot.cjs","sourceRoot":"","sources":["../../../../src/components/KeyValueRow/KeyValueRoot/KeyValueRoot.tsx"],"names":[],"mappings":";;;;;;AAAA,8FAA4E;AAC5E,kDAA0B;AAC1B,wDAAoC;AAIpC;;;;;;;;;;;;;;;;;;;GAmBG;AACI,MAAM,eAAe,GAAmC,CAAC,EAC9D,QAAQ,EACR,WAAW,EACX,KAAK,EACL,GAAG,KAAK,EACT,EAAE,EAAE;IACH,MAAM,EAAE,GAAG,IAAA,wCAAW,GAAE,CAAC;IAEzB,OAAO,CACL,CAAC,mBAAI,CACH,KAAK,CAAC,CAAC;YACL,EAAE,CAAC,KAAK,CACN,uDAAuD,EACvD,WAAW,CACZ;YACD,KAAK;SACN,CAAC,CACF,IAAI,KAAK,CAAC,CAEV;MAAA,CAAC,QAAQ,CACX;IAAA,EAAE,mBAAI,CAAC,CACR,CAAC;AACJ,CAAC,CAAC;AAtBW,QAAA,eAAe,mBAsB1B","sourcesContent":["import { useTailwind } from '@metamask-previews/design-system-twrnc-preset';\nimport React from 'react';\nimport { View } from 'react-native';\n\nimport type { KeyValueRowRootProps } from '../KeyValueRow.types';\n\n/**\n * The main container for the KeyValueRow component.\n * When creating custom KeyValueRow components, this must be the outermost component\n * wrapping the two <KeyValueSection/> components.\n *\n * e.g.\n * ```\n * <KeyValueRowRoot>\n * <KeyValueSection></KeyValueSection>\n * <KeyValueSection></KeyValueSection>\n * </KeyValueRowRoot>\n * ```\n *\n * @param props - Component props.\n * @param props.children - The two <KeyValueSection> children.\n * @param props.twClassName - Optional Tailwind class names to override root styles.\n * @param props.style - Optional additional styles for the root element.\n *\n * @returns The rendered Root component.\n */\nexport const KeyValueRowRoot: React.FC<KeyValueRowRootProps> = ({\n children,\n twClassName,\n style,\n ...props\n}) => {\n const tw = useTailwind();\n\n return (\n <View\n style={[\n tw.style(\n 'flex-row justify-between items-center overflow-hidden',\n twClassName,\n ),\n style,\n ]}\n {...props}\n >\n {children}\n </View>\n );\n};\n"]}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { KeyValueRowRootProps } from "../KeyValueRow.types.cjs";
|
|
3
|
+
/**
|
|
4
|
+
* The main container for the KeyValueRow component.
|
|
5
|
+
* When creating custom KeyValueRow components, this must be the outermost component
|
|
6
|
+
* wrapping the two <KeyValueSection/> components.
|
|
7
|
+
*
|
|
8
|
+
* e.g.
|
|
9
|
+
* ```
|
|
10
|
+
* <KeyValueRowRoot>
|
|
11
|
+
* <KeyValueSection></KeyValueSection>
|
|
12
|
+
* <KeyValueSection></KeyValueSection>
|
|
13
|
+
* </KeyValueRowRoot>
|
|
14
|
+
* ```
|
|
15
|
+
*
|
|
16
|
+
* @param props - Component props.
|
|
17
|
+
* @param props.children - The two <KeyValueSection> children.
|
|
18
|
+
* @param props.twClassName - Optional Tailwind class names to override root styles.
|
|
19
|
+
* @param props.style - Optional additional styles for the root element.
|
|
20
|
+
*
|
|
21
|
+
* @returns The rendered Root component.
|
|
22
|
+
*/
|
|
23
|
+
export declare const KeyValueRowRoot: React.FC<KeyValueRowRootProps>;
|
|
24
|
+
//# sourceMappingURL=KeyValueRoot.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"KeyValueRoot.d.cts","sourceRoot":"","sources":["../../../../src/components/KeyValueRow/KeyValueRoot/KeyValueRoot.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,cAAc;AAG1B,OAAO,KAAK,EAAE,oBAAoB,EAAE,iCAA6B;AAEjE;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CAsB1D,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { KeyValueRowRootProps } from "../KeyValueRow.types.mjs";
|
|
3
|
+
/**
|
|
4
|
+
* The main container for the KeyValueRow component.
|
|
5
|
+
* When creating custom KeyValueRow components, this must be the outermost component
|
|
6
|
+
* wrapping the two <KeyValueSection/> components.
|
|
7
|
+
*
|
|
8
|
+
* e.g.
|
|
9
|
+
* ```
|
|
10
|
+
* <KeyValueRowRoot>
|
|
11
|
+
* <KeyValueSection></KeyValueSection>
|
|
12
|
+
* <KeyValueSection></KeyValueSection>
|
|
13
|
+
* </KeyValueRowRoot>
|
|
14
|
+
* ```
|
|
15
|
+
*
|
|
16
|
+
* @param props - Component props.
|
|
17
|
+
* @param props.children - The two <KeyValueSection> children.
|
|
18
|
+
* @param props.twClassName - Optional Tailwind class names to override root styles.
|
|
19
|
+
* @param props.style - Optional additional styles for the root element.
|
|
20
|
+
*
|
|
21
|
+
* @returns The rendered Root component.
|
|
22
|
+
*/
|
|
23
|
+
export declare const KeyValueRowRoot: React.FC<KeyValueRowRootProps>;
|
|
24
|
+
//# sourceMappingURL=KeyValueRoot.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"KeyValueRoot.d.mts","sourceRoot":"","sources":["../../../../src/components/KeyValueRow/KeyValueRoot/KeyValueRoot.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,cAAc;AAG1B,OAAO,KAAK,EAAE,oBAAoB,EAAE,iCAA6B;AAEjE;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CAsB1D,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
function $importDefault(module) {
|
|
2
|
+
if (module?.__esModule) {
|
|
3
|
+
return module.default;
|
|
4
|
+
}
|
|
5
|
+
return module;
|
|
6
|
+
}
|
|
7
|
+
import { useTailwind } from "@metamask-previews/design-system-twrnc-preset";
|
|
8
|
+
import $React from "react";
|
|
9
|
+
const React = $importDefault($React);
|
|
10
|
+
import { View } from "react-native/index.js";
|
|
11
|
+
/**
|
|
12
|
+
* The main container for the KeyValueRow component.
|
|
13
|
+
* When creating custom KeyValueRow components, this must be the outermost component
|
|
14
|
+
* wrapping the two <KeyValueSection/> components.
|
|
15
|
+
*
|
|
16
|
+
* e.g.
|
|
17
|
+
* ```
|
|
18
|
+
* <KeyValueRowRoot>
|
|
19
|
+
* <KeyValueSection></KeyValueSection>
|
|
20
|
+
* <KeyValueSection></KeyValueSection>
|
|
21
|
+
* </KeyValueRowRoot>
|
|
22
|
+
* ```
|
|
23
|
+
*
|
|
24
|
+
* @param props - Component props.
|
|
25
|
+
* @param props.children - The two <KeyValueSection> children.
|
|
26
|
+
* @param props.twClassName - Optional Tailwind class names to override root styles.
|
|
27
|
+
* @param props.style - Optional additional styles for the root element.
|
|
28
|
+
*
|
|
29
|
+
* @returns The rendered Root component.
|
|
30
|
+
*/
|
|
31
|
+
export const KeyValueRowRoot = ({ children, twClassName, style, ...props }) => {
|
|
32
|
+
const tw = useTailwind();
|
|
33
|
+
return (<View style={[
|
|
34
|
+
tw.style('flex-row justify-between items-center overflow-hidden', twClassName),
|
|
35
|
+
style,
|
|
36
|
+
]} {...props}>
|
|
37
|
+
{children}
|
|
38
|
+
</View>);
|
|
39
|
+
};
|
|
40
|
+
//# sourceMappingURL=KeyValueRoot.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"KeyValueRoot.mjs","sourceRoot":"","sources":["../../../../src/components/KeyValueRow/KeyValueRoot/KeyValueRoot.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,sDAAsD;AAC5E,OAAO,MAAK,cAAc;;AAC1B,OAAO,EAAE,IAAI,EAAE,8BAAqB;AAIpC;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,CAAC,MAAM,eAAe,GAAmC,CAAC,EAC9D,QAAQ,EACR,WAAW,EACX,KAAK,EACL,GAAG,KAAK,EACT,EAAE,EAAE;IACH,MAAM,EAAE,GAAG,WAAW,EAAE,CAAC;IAEzB,OAAO,CACL,CAAC,IAAI,CACH,KAAK,CAAC,CAAC;YACL,EAAE,CAAC,KAAK,CACN,uDAAuD,EACvD,WAAW,CACZ;YACD,KAAK;SACN,CAAC,CACF,IAAI,KAAK,CAAC,CAEV;MAAA,CAAC,QAAQ,CACX;IAAA,EAAE,IAAI,CAAC,CACR,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { useTailwind } from '@metamask-previews/design-system-twrnc-preset';\nimport React from 'react';\nimport { View } from 'react-native';\n\nimport type { KeyValueRowRootProps } from '../KeyValueRow.types';\n\n/**\n * The main container for the KeyValueRow component.\n * When creating custom KeyValueRow components, this must be the outermost component\n * wrapping the two <KeyValueSection/> components.\n *\n * e.g.\n * ```\n * <KeyValueRowRoot>\n * <KeyValueSection></KeyValueSection>\n * <KeyValueSection></KeyValueSection>\n * </KeyValueRowRoot>\n * ```\n *\n * @param props - Component props.\n * @param props.children - The two <KeyValueSection> children.\n * @param props.twClassName - Optional Tailwind class names to override root styles.\n * @param props.style - Optional additional styles for the root element.\n *\n * @returns The rendered Root component.\n */\nexport const KeyValueRowRoot: React.FC<KeyValueRowRootProps> = ({\n children,\n twClassName,\n style,\n ...props\n}) => {\n const tw = useTailwind();\n\n return (\n <View\n style={[\n tw.style(\n 'flex-row justify-between items-center overflow-hidden',\n twClassName,\n ),\n style,\n ]}\n {...props}\n >\n {children}\n </View>\n );\n};\n"]}
|
|
@@ -0,0 +1,76 @@
|
|
|
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.KeyValueRowStubs = exports.KeyValueRow = void 0;
|
|
7
|
+
const design_system_twrnc_preset_1 = require("@metamask-previews/design-system-twrnc-preset");
|
|
8
|
+
const react_1 = __importDefault(require("react"));
|
|
9
|
+
const react_native_1 = require("react-native/index.js");
|
|
10
|
+
const Icon_1 = require("../Icon/index.cjs");
|
|
11
|
+
const KeyValueLabel_1 = require("./KeyValueLabel/KeyValueLabel.cjs");
|
|
12
|
+
const KeyValueRoot_1 = require("./KeyValueRoot/KeyValueRoot.cjs");
|
|
13
|
+
const KeyValueRow_types_1 = require("./KeyValueRow.types.cjs");
|
|
14
|
+
const KeyValueSection_1 = require("./KeyValueSection/KeyValueSection.cjs");
|
|
15
|
+
const renderIcon = (icon) => {
|
|
16
|
+
const { side: _side, ...iconProps } = icon;
|
|
17
|
+
return <Icon_1.Icon {...iconProps}/>;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Prebuilt convenience component to format and render a key/value label pair.
|
|
21
|
+
* The KeyValueRowLabel component has props to display a tooltip and icon.
|
|
22
|
+
*
|
|
23
|
+
* @param props - Component props
|
|
24
|
+
* @param props.field - Represents the left side of the key value row pair
|
|
25
|
+
* @param props.value - Represents the right side of the key value row pair
|
|
26
|
+
* @param props.twClassName - Optional Tailwind class names for the root element
|
|
27
|
+
* @param props.style - Optional additional styles for the root element
|
|
28
|
+
*
|
|
29
|
+
* @returns The rendered KeyValueRow component.
|
|
30
|
+
*/
|
|
31
|
+
const KeyValueRow = ({ field, value, twClassName, style, ...props }) => {
|
|
32
|
+
const tw = (0, design_system_twrnc_preset_1.useTailwind)();
|
|
33
|
+
const fieldIcon = field?.icon;
|
|
34
|
+
const valueIcon = value?.icon;
|
|
35
|
+
return (<KeyValueRoot_1.KeyValueRowRoot twClassName={twClassName} style={style} {...props}>
|
|
36
|
+
<KeyValueSection_1.KeyValueSection>
|
|
37
|
+
<react_native_1.View style={tw.style('flex-row items-center gap-2')}>
|
|
38
|
+
{fieldIcon?.name &&
|
|
39
|
+
(fieldIcon.side === KeyValueRow_types_1.KeyValueRowFieldIconSides.Left ||
|
|
40
|
+
fieldIcon.side === KeyValueRow_types_1.KeyValueRowFieldIconSides.Both ||
|
|
41
|
+
!fieldIcon.side) &&
|
|
42
|
+
renderIcon(fieldIcon)}
|
|
43
|
+
<KeyValueLabel_1.KeyValueRowLabel label={field.label} tooltip={field.tooltip}/>
|
|
44
|
+
{fieldIcon?.name &&
|
|
45
|
+
(fieldIcon.side === KeyValueRow_types_1.KeyValueRowFieldIconSides.Right ||
|
|
46
|
+
fieldIcon.side === KeyValueRow_types_1.KeyValueRowFieldIconSides.Both) &&
|
|
47
|
+
renderIcon(fieldIcon)}
|
|
48
|
+
</react_native_1.View>
|
|
49
|
+
</KeyValueSection_1.KeyValueSection>
|
|
50
|
+
<KeyValueSection_1.KeyValueSection align={KeyValueRow_types_1.KeyValueRowSectionAlignments.Right}>
|
|
51
|
+
<react_native_1.View style={tw.style('flex-row items-center gap-2')}>
|
|
52
|
+
{valueIcon?.name &&
|
|
53
|
+
(valueIcon.side === KeyValueRow_types_1.KeyValueRowFieldIconSides.Left ||
|
|
54
|
+
valueIcon.side === KeyValueRow_types_1.KeyValueRowFieldIconSides.Both ||
|
|
55
|
+
!valueIcon.side) &&
|
|
56
|
+
renderIcon(valueIcon)}
|
|
57
|
+
<KeyValueLabel_1.KeyValueRowLabel label={value.label} tooltip={value.tooltip}/>
|
|
58
|
+
{valueIcon?.name &&
|
|
59
|
+
(valueIcon.side === KeyValueRow_types_1.KeyValueRowFieldIconSides.Right ||
|
|
60
|
+
valueIcon.side === KeyValueRow_types_1.KeyValueRowFieldIconSides.Both) &&
|
|
61
|
+
renderIcon(valueIcon)}
|
|
62
|
+
</react_native_1.View>
|
|
63
|
+
</KeyValueSection_1.KeyValueSection>
|
|
64
|
+
</KeyValueRoot_1.KeyValueRowRoot>);
|
|
65
|
+
};
|
|
66
|
+
exports.KeyValueRow = KeyValueRow;
|
|
67
|
+
exports.KeyValueRow.displayName = 'KeyValueRow';
|
|
68
|
+
/**
|
|
69
|
+
* Exported sub-components to provide a base for new KeyValueRow variants.
|
|
70
|
+
*/
|
|
71
|
+
exports.KeyValueRowStubs = {
|
|
72
|
+
Root: KeyValueRoot_1.KeyValueRowRoot,
|
|
73
|
+
Section: KeyValueSection_1.KeyValueSection,
|
|
74
|
+
Label: KeyValueLabel_1.KeyValueRowLabel,
|
|
75
|
+
};
|
|
76
|
+
//# sourceMappingURL=KeyValueRow.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"KeyValueRow.cjs","sourceRoot":"","sources":["../../../src/components/KeyValueRow/KeyValueRow.tsx"],"names":[],"mappings":";;;;;;AAAA,8FAA4E;AAC5E,kDAA0B;AAC1B,wDAAoC;AAEpC,4CAA+B;AAG/B,qEAAiE;AACjE,kEAA8D;AAE9D,+DAG6B;AAC7B,2EAAoE;AAIpE,MAAM,UAAU,GAAG,CAAC,IAAkB,EAAE,EAAE;IACxC,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,SAAS,EAAE,GAAG,IAAI,CAAC;IAC3C,OAAO,CAAC,WAAI,CAAC,IAAI,SAAS,CAAC,EAAG,CAAC;AACjC,CAAC,CAAC;AAEF;;;;;;;;;;;GAWG;AACI,MAAM,WAAW,GAA+B,CAAC,EACtD,KAAK,EACL,KAAK,EACL,WAAW,EACX,KAAK,EACL,GAAG,KAAK,EACT,EAAE,EAAE;IACH,MAAM,EAAE,GAAG,IAAA,wCAAW,GAAE,CAAC;IAEzB,MAAM,SAAS,GAAG,KAAK,EAAE,IAAI,CAAC;IAC9B,MAAM,SAAS,GAAG,KAAK,EAAE,IAAI,CAAC;IAE9B,OAAO,CACL,CAAC,8BAAe,CAAC,WAAW,CAAC,CAAC,WAAW,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,KAAK,CAAC,CACjE;MAAA,CAAC,iCAAe,CACd;QAAA,CAAC,mBAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,6BAA6B,CAAC,CAAC,CACnD;UAAA,CAAC,SAAS,EAAE,IAAI;YACd,CAAC,SAAS,CAAC,IAAI,KAAK,6CAAyB,CAAC,IAAI;gBAChD,SAAS,CAAC,IAAI,KAAK,6CAAyB,CAAC,IAAI;gBACjD,CAAC,SAAS,CAAC,IAAI,CAAC;YAClB,UAAU,CAAC,SAAS,CAAC,CACvB;UAAA,CAAC,gCAAgB,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,EAC7D;UAAA,CAAC,SAAS,EAAE,IAAI;YACd,CAAC,SAAS,CAAC,IAAI,KAAK,6CAAyB,CAAC,KAAK;gBACjD,SAAS,CAAC,IAAI,KAAK,6CAAyB,CAAC,IAAI,CAAC;YACpD,UAAU,CAAC,SAAS,CAAC,CACzB;QAAA,EAAE,mBAAI,CACR;MAAA,EAAE,iCAAe,CACjB;MAAA,CAAC,iCAAe,CAAC,KAAK,CAAC,CAAC,gDAA4B,CAAC,KAAK,CAAC,CACzD;QAAA,CAAC,mBAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,6BAA6B,CAAC,CAAC,CACnD;UAAA,CAAC,SAAS,EAAE,IAAI;YACd,CAAC,SAAS,CAAC,IAAI,KAAK,6CAAyB,CAAC,IAAI;gBAChD,SAAS,CAAC,IAAI,KAAK,6CAAyB,CAAC,IAAI;gBACjD,CAAC,SAAS,CAAC,IAAI,CAAC;YAClB,UAAU,CAAC,SAAS,CAAC,CACvB;UAAA,CAAC,gCAAgB,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,EAC7D;UAAA,CAAC,SAAS,EAAE,IAAI;YACd,CAAC,SAAS,CAAC,IAAI,KAAK,6CAAyB,CAAC,KAAK;gBACjD,SAAS,CAAC,IAAI,KAAK,6CAAyB,CAAC,IAAI,CAAC;YACpD,UAAU,CAAC,SAAS,CAAC,CACzB;QAAA,EAAE,mBAAI,CACR;MAAA,EAAE,iCAAe,CACnB;IAAA,EAAE,8BAAe,CAAC,CACnB,CAAC;AACJ,CAAC,CAAC;AA5CW,QAAA,WAAW,eA4CtB;AAEF,mBAAW,CAAC,WAAW,GAAG,aAAa,CAAC;AAExC;;GAEG;AACU,QAAA,gBAAgB,GAAG;IAC9B,IAAI,EAAE,8BAAe;IACrB,OAAO,EAAE,iCAAe;IACxB,KAAK,EAAE,gCAAgB;CACxB,CAAC","sourcesContent":["import { useTailwind } from '@metamask-previews/design-system-twrnc-preset';\nimport React from 'react';\nimport { View } from 'react-native';\n\nimport { Icon } from '../Icon';\nimport type { IconProps } from '../Icon';\n\nimport { KeyValueRowLabel } from './KeyValueLabel/KeyValueLabel';\nimport { KeyValueRowRoot } from './KeyValueRoot/KeyValueRoot';\nimport type { KeyValueRowProps } from './KeyValueRow.types';\nimport {\n KeyValueRowFieldIconSides,\n KeyValueRowSectionAlignments,\n} from './KeyValueRow.types';\nimport { KeyValueSection } from './KeyValueSection/KeyValueSection';\n\ntype IconWithSide = IconProps & { side?: KeyValueRowFieldIconSides };\n\nconst renderIcon = (icon: IconWithSide) => {\n const { side: _side, ...iconProps } = icon;\n return <Icon {...iconProps} />;\n};\n\n/**\n * Prebuilt convenience component to format and render a key/value label pair.\n * The KeyValueRowLabel component has props to display a tooltip and icon.\n *\n * @param props - Component props\n * @param props.field - Represents the left side of the key value row pair\n * @param props.value - Represents the right side of the key value row pair\n * @param props.twClassName - Optional Tailwind class names for the root element\n * @param props.style - Optional additional styles for the root element\n *\n * @returns The rendered KeyValueRow component.\n */\nexport const KeyValueRow: React.FC<KeyValueRowProps> = ({\n field,\n value,\n twClassName,\n style,\n ...props\n}) => {\n const tw = useTailwind();\n\n const fieldIcon = field?.icon;\n const valueIcon = value?.icon;\n\n return (\n <KeyValueRowRoot twClassName={twClassName} style={style} {...props}>\n <KeyValueSection>\n <View style={tw.style('flex-row items-center gap-2')}>\n {fieldIcon?.name &&\n (fieldIcon.side === KeyValueRowFieldIconSides.Left ||\n fieldIcon.side === KeyValueRowFieldIconSides.Both ||\n !fieldIcon.side) &&\n renderIcon(fieldIcon)}\n <KeyValueRowLabel label={field.label} tooltip={field.tooltip} />\n {fieldIcon?.name &&\n (fieldIcon.side === KeyValueRowFieldIconSides.Right ||\n fieldIcon.side === KeyValueRowFieldIconSides.Both) &&\n renderIcon(fieldIcon)}\n </View>\n </KeyValueSection>\n <KeyValueSection align={KeyValueRowSectionAlignments.Right}>\n <View style={tw.style('flex-row items-center gap-2')}>\n {valueIcon?.name &&\n (valueIcon.side === KeyValueRowFieldIconSides.Left ||\n valueIcon.side === KeyValueRowFieldIconSides.Both ||\n !valueIcon.side) &&\n renderIcon(valueIcon)}\n <KeyValueRowLabel label={value.label} tooltip={value.tooltip} />\n {valueIcon?.name &&\n (valueIcon.side === KeyValueRowFieldIconSides.Right ||\n valueIcon.side === KeyValueRowFieldIconSides.Both) &&\n renderIcon(valueIcon)}\n </View>\n </KeyValueSection>\n </KeyValueRowRoot>\n );\n};\n\nKeyValueRow.displayName = 'KeyValueRow';\n\n/**\n * Exported sub-components to provide a base for new KeyValueRow variants.\n */\nexport const KeyValueRowStubs = {\n Root: KeyValueRowRoot,\n Section: KeyValueSection,\n Label: KeyValueRowLabel,\n};\n"]}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { KeyValueRowProps } from "./KeyValueRow.types.cjs";
|
|
3
|
+
/**
|
|
4
|
+
* Prebuilt convenience component to format and render a key/value label pair.
|
|
5
|
+
* The KeyValueRowLabel component has props to display a tooltip and icon.
|
|
6
|
+
*
|
|
7
|
+
* @param props - Component props
|
|
8
|
+
* @param props.field - Represents the left side of the key value row pair
|
|
9
|
+
* @param props.value - Represents the right side of the key value row pair
|
|
10
|
+
* @param props.twClassName - Optional Tailwind class names for the root element
|
|
11
|
+
* @param props.style - Optional additional styles for the root element
|
|
12
|
+
*
|
|
13
|
+
* @returns The rendered KeyValueRow component.
|
|
14
|
+
*/
|
|
15
|
+
export declare const KeyValueRow: React.FC<KeyValueRowProps>;
|
|
16
|
+
/**
|
|
17
|
+
* Exported sub-components to provide a base for new KeyValueRow variants.
|
|
18
|
+
*/
|
|
19
|
+
export declare const KeyValueRowStubs: {
|
|
20
|
+
Root: React.FC<import("./KeyValueRow.types.cjs").KeyValueRowRootProps>;
|
|
21
|
+
Section: React.FC<import("./KeyValueRow.types.cjs").KeyValueSectionProps>;
|
|
22
|
+
Label: React.FC<import("./KeyValueRow.types.cjs").KeyValueRowLabelProps>;
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=KeyValueRow.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"KeyValueRow.d.cts","sourceRoot":"","sources":["../../../src/components/KeyValueRow/KeyValueRow.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,cAAc;AAQ1B,OAAO,KAAK,EAAE,gBAAgB,EAAE,gCAA4B;AAc5D;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CA4ClD,CAAC;AAIF;;GAEG;AACH,eAAO,MAAM,gBAAgB;;;;CAI5B,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { KeyValueRowProps } from "./KeyValueRow.types.mjs";
|
|
3
|
+
/**
|
|
4
|
+
* Prebuilt convenience component to format and render a key/value label pair.
|
|
5
|
+
* The KeyValueRowLabel component has props to display a tooltip and icon.
|
|
6
|
+
*
|
|
7
|
+
* @param props - Component props
|
|
8
|
+
* @param props.field - Represents the left side of the key value row pair
|
|
9
|
+
* @param props.value - Represents the right side of the key value row pair
|
|
10
|
+
* @param props.twClassName - Optional Tailwind class names for the root element
|
|
11
|
+
* @param props.style - Optional additional styles for the root element
|
|
12
|
+
*
|
|
13
|
+
* @returns The rendered KeyValueRow component.
|
|
14
|
+
*/
|
|
15
|
+
export declare const KeyValueRow: React.FC<KeyValueRowProps>;
|
|
16
|
+
/**
|
|
17
|
+
* Exported sub-components to provide a base for new KeyValueRow variants.
|
|
18
|
+
*/
|
|
19
|
+
export declare const KeyValueRowStubs: {
|
|
20
|
+
Root: React.FC<import("./KeyValueRow.types.mjs").KeyValueRowRootProps>;
|
|
21
|
+
Section: React.FC<import("./KeyValueRow.types.mjs").KeyValueSectionProps>;
|
|
22
|
+
Label: React.FC<import("./KeyValueRow.types.mjs").KeyValueRowLabelProps>;
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=KeyValueRow.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"KeyValueRow.d.mts","sourceRoot":"","sources":["../../../src/components/KeyValueRow/KeyValueRow.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,cAAc;AAQ1B,OAAO,KAAK,EAAE,gBAAgB,EAAE,gCAA4B;AAc5D;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CA4ClD,CAAC;AAIF;;GAEG;AACH,eAAO,MAAM,gBAAgB;;;;CAI5B,CAAC"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
function $importDefault(module) {
|
|
2
|
+
if (module?.__esModule) {
|
|
3
|
+
return module.default;
|
|
4
|
+
}
|
|
5
|
+
return module;
|
|
6
|
+
}
|
|
7
|
+
import { useTailwind } from "@metamask-previews/design-system-twrnc-preset";
|
|
8
|
+
import $React from "react";
|
|
9
|
+
const React = $importDefault($React);
|
|
10
|
+
import { View } from "react-native/index.js";
|
|
11
|
+
import { Icon } from "../Icon/index.mjs";
|
|
12
|
+
import { KeyValueRowLabel } from "./KeyValueLabel/KeyValueLabel.mjs";
|
|
13
|
+
import { KeyValueRowRoot } from "./KeyValueRoot/KeyValueRoot.mjs";
|
|
14
|
+
import { KeyValueRowFieldIconSides, KeyValueRowSectionAlignments } from "./KeyValueRow.types.mjs";
|
|
15
|
+
import { KeyValueSection } from "./KeyValueSection/KeyValueSection.mjs";
|
|
16
|
+
const renderIcon = (icon) => {
|
|
17
|
+
const { side: _side, ...iconProps } = icon;
|
|
18
|
+
return <Icon {...iconProps}/>;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Prebuilt convenience component to format and render a key/value label pair.
|
|
22
|
+
* The KeyValueRowLabel component has props to display a tooltip and icon.
|
|
23
|
+
*
|
|
24
|
+
* @param props - Component props
|
|
25
|
+
* @param props.field - Represents the left side of the key value row pair
|
|
26
|
+
* @param props.value - Represents the right side of the key value row pair
|
|
27
|
+
* @param props.twClassName - Optional Tailwind class names for the root element
|
|
28
|
+
* @param props.style - Optional additional styles for the root element
|
|
29
|
+
*
|
|
30
|
+
* @returns The rendered KeyValueRow component.
|
|
31
|
+
*/
|
|
32
|
+
export const KeyValueRow = ({ field, value, twClassName, style, ...props }) => {
|
|
33
|
+
const tw = useTailwind();
|
|
34
|
+
const fieldIcon = field?.icon;
|
|
35
|
+
const valueIcon = value?.icon;
|
|
36
|
+
return (<KeyValueRowRoot twClassName={twClassName} style={style} {...props}>
|
|
37
|
+
<KeyValueSection>
|
|
38
|
+
<View style={tw.style('flex-row items-center gap-2')}>
|
|
39
|
+
{fieldIcon?.name &&
|
|
40
|
+
(fieldIcon.side === KeyValueRowFieldIconSides.Left ||
|
|
41
|
+
fieldIcon.side === KeyValueRowFieldIconSides.Both ||
|
|
42
|
+
!fieldIcon.side) &&
|
|
43
|
+
renderIcon(fieldIcon)}
|
|
44
|
+
<KeyValueRowLabel label={field.label} tooltip={field.tooltip}/>
|
|
45
|
+
{fieldIcon?.name &&
|
|
46
|
+
(fieldIcon.side === KeyValueRowFieldIconSides.Right ||
|
|
47
|
+
fieldIcon.side === KeyValueRowFieldIconSides.Both) &&
|
|
48
|
+
renderIcon(fieldIcon)}
|
|
49
|
+
</View>
|
|
50
|
+
</KeyValueSection>
|
|
51
|
+
<KeyValueSection align={KeyValueRowSectionAlignments.Right}>
|
|
52
|
+
<View style={tw.style('flex-row items-center gap-2')}>
|
|
53
|
+
{valueIcon?.name &&
|
|
54
|
+
(valueIcon.side === KeyValueRowFieldIconSides.Left ||
|
|
55
|
+
valueIcon.side === KeyValueRowFieldIconSides.Both ||
|
|
56
|
+
!valueIcon.side) &&
|
|
57
|
+
renderIcon(valueIcon)}
|
|
58
|
+
<KeyValueRowLabel label={value.label} tooltip={value.tooltip}/>
|
|
59
|
+
{valueIcon?.name &&
|
|
60
|
+
(valueIcon.side === KeyValueRowFieldIconSides.Right ||
|
|
61
|
+
valueIcon.side === KeyValueRowFieldIconSides.Both) &&
|
|
62
|
+
renderIcon(valueIcon)}
|
|
63
|
+
</View>
|
|
64
|
+
</KeyValueSection>
|
|
65
|
+
</KeyValueRowRoot>);
|
|
66
|
+
};
|
|
67
|
+
KeyValueRow.displayName = 'KeyValueRow';
|
|
68
|
+
/**
|
|
69
|
+
* Exported sub-components to provide a base for new KeyValueRow variants.
|
|
70
|
+
*/
|
|
71
|
+
export const KeyValueRowStubs = {
|
|
72
|
+
Root: KeyValueRowRoot,
|
|
73
|
+
Section: KeyValueSection,
|
|
74
|
+
Label: KeyValueRowLabel,
|
|
75
|
+
};
|
|
76
|
+
//# sourceMappingURL=KeyValueRow.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"KeyValueRow.mjs","sourceRoot":"","sources":["../../../src/components/KeyValueRow/KeyValueRow.tsx"],"names":[],"mappings":"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","sourcesContent":["import { useTailwind } from '@metamask-previews/design-system-twrnc-preset';\nimport React from 'react';\nimport { View } from 'react-native';\n\nimport { Icon } from '../Icon';\nimport type { IconProps } from '../Icon';\n\nimport { KeyValueRowLabel } from './KeyValueLabel/KeyValueLabel';\nimport { KeyValueRowRoot } from './KeyValueRoot/KeyValueRoot';\nimport type { KeyValueRowProps } from './KeyValueRow.types';\nimport {\n KeyValueRowFieldIconSides,\n KeyValueRowSectionAlignments,\n} from './KeyValueRow.types';\nimport { KeyValueSection } from './KeyValueSection/KeyValueSection';\n\ntype IconWithSide = IconProps & { side?: KeyValueRowFieldIconSides };\n\nconst renderIcon = (icon: IconWithSide) => {\n const { side: _side, ...iconProps } = icon;\n return <Icon {...iconProps} />;\n};\n\n/**\n * Prebuilt convenience component to format and render a key/value label pair.\n * The KeyValueRowLabel component has props to display a tooltip and icon.\n *\n * @param props - Component props\n * @param props.field - Represents the left side of the key value row pair\n * @param props.value - Represents the right side of the key value row pair\n * @param props.twClassName - Optional Tailwind class names for the root element\n * @param props.style - Optional additional styles for the root element\n *\n * @returns The rendered KeyValueRow component.\n */\nexport const KeyValueRow: React.FC<KeyValueRowProps> = ({\n field,\n value,\n twClassName,\n style,\n ...props\n}) => {\n const tw = useTailwind();\n\n const fieldIcon = field?.icon;\n const valueIcon = value?.icon;\n\n return (\n <KeyValueRowRoot twClassName={twClassName} style={style} {...props}>\n <KeyValueSection>\n <View style={tw.style('flex-row items-center gap-2')}>\n {fieldIcon?.name &&\n (fieldIcon.side === KeyValueRowFieldIconSides.Left ||\n fieldIcon.side === KeyValueRowFieldIconSides.Both ||\n !fieldIcon.side) &&\n renderIcon(fieldIcon)}\n <KeyValueRowLabel label={field.label} tooltip={field.tooltip} />\n {fieldIcon?.name &&\n (fieldIcon.side === KeyValueRowFieldIconSides.Right ||\n fieldIcon.side === KeyValueRowFieldIconSides.Both) &&\n renderIcon(fieldIcon)}\n </View>\n </KeyValueSection>\n <KeyValueSection align={KeyValueRowSectionAlignments.Right}>\n <View style={tw.style('flex-row items-center gap-2')}>\n {valueIcon?.name &&\n (valueIcon.side === KeyValueRowFieldIconSides.Left ||\n valueIcon.side === KeyValueRowFieldIconSides.Both ||\n !valueIcon.side) &&\n renderIcon(valueIcon)}\n <KeyValueRowLabel label={value.label} tooltip={value.tooltip} />\n {valueIcon?.name &&\n (valueIcon.side === KeyValueRowFieldIconSides.Right ||\n valueIcon.side === KeyValueRowFieldIconSides.Both) &&\n renderIcon(valueIcon)}\n </View>\n </KeyValueSection>\n </KeyValueRowRoot>\n );\n};\n\nKeyValueRow.displayName = 'KeyValueRow';\n\n/**\n * Exported sub-components to provide a base for new KeyValueRow variants.\n */\nexport const KeyValueRowStubs = {\n Root: KeyValueRowRoot,\n Section: KeyValueSection,\n Label: KeyValueRowLabel,\n};\n"]}
|