@metamask/design-system-react-native 0.24.0 → 0.26.0
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/BannerBase/BannerBase.cjs +3 -12
- 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 +3 -12
- 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/Button/variants/ButtonPrimary/ButtonPrimary.cjs +1 -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 +1 -17
- package/dist/components/Button/variants/ButtonPrimary/ButtonPrimary.mjs.map +1 -1
- package/dist/components/Button/variants/ButtonSecondary/ButtonSecondary.cjs +1 -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 +1 -17
- package/dist/components/Button/variants/ButtonSecondary/ButtonSecondary.mjs.map +1 -1
- package/dist/components/Button/variants/ButtonTertiary/ButtonTertiary.cjs +1 -17
- 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 +1 -17
- package/dist/components/Button/variants/ButtonTertiary/ButtonTertiary.mjs.map +1 -1
- package/dist/components/ButtonBase/ButtonBase.cjs +42 -28
- package/dist/components/ButtonBase/ButtonBase.cjs.map +1 -1
- package/dist/components/ButtonBase/ButtonBase.constants.cjs +31 -1
- 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 +12 -0
- package/dist/components/ButtonBase/ButtonBase.types.d.cts.map +1 -1
- package/dist/components/ButtonBase/ButtonBase.types.d.mts +12 -0
- package/dist/components/ButtonBase/ButtonBase.types.d.mts.map +1 -1
- package/dist/components/ButtonBase/ButtonBase.types.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/assets/telegram.svg +1 -3
- package/dist/components/Input/Input.cjs +25 -14
- package/dist/components/Input/Input.cjs.map +1 -1
- 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 +25 -14
- package/dist/components/Input/Input.mjs.map +1 -1
- package/dist/components/SectionDivider/SectionDivider.cjs +47 -0
- package/dist/components/SectionDivider/SectionDivider.cjs.map +1 -0
- package/dist/components/SectionDivider/SectionDivider.d.cts +6 -0
- package/dist/components/SectionDivider/SectionDivider.d.cts.map +1 -0
- package/dist/components/SectionDivider/SectionDivider.d.mts +6 -0
- package/dist/components/SectionDivider/SectionDivider.d.mts.map +1 -0
- package/dist/components/SectionDivider/SectionDivider.mjs +28 -0
- package/dist/components/SectionDivider/SectionDivider.mjs.map +1 -0
- package/dist/components/SectionDivider/SectionDivider.types.cjs +3 -0
- package/dist/components/SectionDivider/SectionDivider.types.cjs.map +1 -0
- package/dist/components/SectionDivider/SectionDivider.types.d.cts +3 -0
- package/dist/components/SectionDivider/SectionDivider.types.d.cts.map +1 -0
- package/dist/components/SectionDivider/SectionDivider.types.d.mts +3 -0
- package/dist/components/SectionDivider/SectionDivider.types.d.mts.map +1 -0
- package/dist/components/SectionDivider/SectionDivider.types.mjs +2 -0
- package/dist/components/SectionDivider/SectionDivider.types.mjs.map +1 -0
- package/dist/components/SectionDivider/index.cjs +6 -0
- package/dist/components/SectionDivider/index.cjs.map +1 -0
- package/dist/components/SectionDivider/index.d.cts +3 -0
- package/dist/components/SectionDivider/index.d.cts.map +1 -0
- package/dist/components/SectionDivider/index.d.mts +3 -0
- package/dist/components/SectionDivider/index.d.mts.map +1 -0
- package/dist/components/SectionDivider/index.mjs +2 -0
- package/dist/components/SectionDivider/index.mjs.map +1 -0
- package/dist/components/SectionHeader/SectionHeader.cjs +45 -0
- package/dist/components/SectionHeader/SectionHeader.cjs.map +1 -0
- package/dist/components/SectionHeader/SectionHeader.d.cts +23 -0
- package/dist/components/SectionHeader/SectionHeader.d.cts.map +1 -0
- package/dist/components/SectionHeader/SectionHeader.d.mts +23 -0
- package/dist/components/SectionHeader/SectionHeader.d.mts.map +1 -0
- package/dist/components/SectionHeader/SectionHeader.mjs +45 -0
- package/dist/components/SectionHeader/SectionHeader.mjs.map +1 -0
- package/dist/components/SectionHeader/SectionHeader.types.cjs +3 -0
- package/dist/components/SectionHeader/SectionHeader.types.cjs.map +1 -0
- package/dist/components/SectionHeader/SectionHeader.types.d.cts +32 -0
- package/dist/components/SectionHeader/SectionHeader.types.d.cts.map +1 -0
- package/dist/components/SectionHeader/SectionHeader.types.d.mts +32 -0
- package/dist/components/SectionHeader/SectionHeader.types.d.mts.map +1 -0
- package/dist/components/SectionHeader/SectionHeader.types.mjs +2 -0
- package/dist/components/SectionHeader/SectionHeader.types.mjs.map +1 -0
- package/dist/components/SectionHeader/index.cjs +6 -0
- package/dist/components/SectionHeader/index.cjs.map +1 -0
- package/dist/components/SectionHeader/index.d.cts +3 -0
- package/dist/components/SectionHeader/index.d.cts.map +1 -0
- package/dist/components/SectionHeader/index.d.mts +3 -0
- package/dist/components/SectionHeader/index.d.mts.map +1 -0
- package/dist/components/SectionHeader/index.mjs +2 -0
- package/dist/components/SectionHeader/index.mjs.map +1 -0
- package/dist/components/SegmentButton/SegmentButton.cjs +86 -0
- package/dist/components/SegmentButton/SegmentButton.cjs.map +1 -0
- package/dist/components/SegmentButton/SegmentButton.d.cts +7 -0
- package/dist/components/SegmentButton/SegmentButton.d.cts.map +1 -0
- package/dist/components/SegmentButton/SegmentButton.d.mts +7 -0
- package/dist/components/SegmentButton/SegmentButton.d.mts.map +1 -0
- package/dist/components/SegmentButton/SegmentButton.mjs +66 -0
- package/dist/components/SegmentButton/SegmentButton.mjs.map +1 -0
- package/dist/components/SegmentButton/SegmentButton.types.cjs +3 -0
- package/dist/components/SegmentButton/SegmentButton.types.cjs.map +1 -0
- package/dist/components/SegmentButton/SegmentButton.types.d.cts +9 -0
- package/dist/components/SegmentButton/SegmentButton.types.d.cts.map +1 -0
- package/dist/components/SegmentButton/SegmentButton.types.d.mts +9 -0
- package/dist/components/SegmentButton/SegmentButton.types.d.mts.map +1 -0
- package/dist/components/SegmentButton/SegmentButton.types.mjs +2 -0
- package/dist/components/SegmentButton/SegmentButton.types.mjs.map +1 -0
- package/dist/components/SegmentButton/index.cjs +8 -0
- package/dist/components/SegmentButton/index.cjs.map +1 -0
- package/dist/components/SegmentButton/index.d.cts +4 -0
- package/dist/components/SegmentButton/index.d.cts.map +1 -0
- package/dist/components/SegmentButton/index.d.mts +4 -0
- package/dist/components/SegmentButton/index.d.mts.map +1 -0
- package/dist/components/SegmentButton/index.mjs +3 -0
- package/dist/components/SegmentButton/index.mjs.map +1 -0
- package/dist/components/SegmentGroup/SegmentGroup.cjs +47 -0
- package/dist/components/SegmentGroup/SegmentGroup.cjs.map +1 -0
- package/dist/components/SegmentGroup/SegmentGroup.d.cts +7 -0
- package/dist/components/SegmentGroup/SegmentGroup.d.cts.map +1 -0
- package/dist/components/SegmentGroup/SegmentGroup.d.mts +7 -0
- package/dist/components/SegmentGroup/SegmentGroup.d.mts.map +1 -0
- package/dist/components/SegmentGroup/SegmentGroup.mjs +27 -0
- package/dist/components/SegmentGroup/SegmentGroup.mjs.map +1 -0
- package/dist/components/SegmentGroup/SegmentGroup.types.cjs +3 -0
- package/dist/components/SegmentGroup/SegmentGroup.types.cjs.map +1 -0
- package/dist/components/SegmentGroup/SegmentGroup.types.d.cts +12 -0
- package/dist/components/SegmentGroup/SegmentGroup.types.d.cts.map +1 -0
- package/dist/components/SegmentGroup/SegmentGroup.types.d.mts +12 -0
- package/dist/components/SegmentGroup/SegmentGroup.types.d.mts.map +1 -0
- package/dist/components/SegmentGroup/SegmentGroup.types.mjs +2 -0
- package/dist/components/SegmentGroup/SegmentGroup.types.mjs.map +1 -0
- package/dist/components/SegmentGroup/index.cjs +6 -0
- package/dist/components/SegmentGroup/index.cjs.map +1 -0
- package/dist/components/SegmentGroup/index.d.cts +3 -0
- package/dist/components/SegmentGroup/index.d.cts.map +1 -0
- package/dist/components/SegmentGroup/index.d.mts +3 -0
- package/dist/components/SegmentGroup/index.d.mts.map +1 -0
- package/dist/components/SegmentGroup/index.mjs +2 -0
- package/dist/components/SegmentGroup/index.mjs.map +1 -0
- package/dist/components/SelectButton/SelectButton.cjs +53 -0
- package/dist/components/SelectButton/SelectButton.cjs.map +1 -0
- package/dist/components/SelectButton/SelectButton.constants.cjs +12 -0
- package/dist/components/SelectButton/SelectButton.constants.cjs.map +1 -0
- package/dist/components/SelectButton/SelectButton.constants.d.cts +4 -0
- package/dist/components/SelectButton/SelectButton.constants.d.cts.map +1 -0
- package/dist/components/SelectButton/SelectButton.constants.d.mts +4 -0
- package/dist/components/SelectButton/SelectButton.constants.d.mts.map +1 -0
- package/dist/components/SelectButton/SelectButton.constants.mjs +9 -0
- package/dist/components/SelectButton/SelectButton.constants.mjs.map +1 -0
- package/dist/components/SelectButton/SelectButton.d.cts +7 -0
- package/dist/components/SelectButton/SelectButton.d.cts.map +1 -0
- package/dist/components/SelectButton/SelectButton.d.mts +7 -0
- package/dist/components/SelectButton/SelectButton.d.mts.map +1 -0
- package/dist/components/SelectButton/SelectButton.mjs +53 -0
- package/dist/components/SelectButton/SelectButton.mjs.map +1 -0
- package/dist/components/SelectButton/SelectButton.types.cjs +3 -0
- package/dist/components/SelectButton/SelectButton.types.cjs.map +1 -0
- package/dist/components/SelectButton/SelectButton.types.d.cts +13 -0
- package/dist/components/SelectButton/SelectButton.types.d.cts.map +1 -0
- package/dist/components/SelectButton/SelectButton.types.d.mts +13 -0
- package/dist/components/SelectButton/SelectButton.types.d.mts.map +1 -0
- package/dist/components/SelectButton/SelectButton.types.mjs +2 -0
- package/dist/components/SelectButton/SelectButton.types.mjs.map +1 -0
- package/dist/components/SelectButton/index.cjs +9 -0
- package/dist/components/SelectButton/index.cjs.map +1 -0
- package/dist/components/SelectButton/index.d.cts +4 -0
- package/dist/components/SelectButton/index.d.cts.map +1 -0
- package/dist/components/SelectButton/index.d.mts +4 -0
- package/dist/components/SelectButton/index.d.mts.map +1 -0
- package/dist/components/SelectButton/index.mjs +3 -0
- package/dist/components/SelectButton/index.mjs.map +1 -0
- package/dist/components/SensitiveText/SensitiveText.cjs +4 -4
- package/dist/components/SensitiveText/SensitiveText.cjs.map +1 -1
- package/dist/components/SensitiveText/SensitiveText.d.cts.map +1 -1
- package/dist/components/SensitiveText/SensitiveText.d.mts.map +1 -1
- package/dist/components/SensitiveText/SensitiveText.mjs +1 -1
- package/dist/components/SensitiveText/SensitiveText.mjs.map +1 -1
- package/dist/components/SensitiveText/SensitiveText.types.cjs.map +1 -1
- package/dist/components/SensitiveText/SensitiveText.types.d.cts +6 -34
- package/dist/components/SensitiveText/SensitiveText.types.d.cts.map +1 -1
- package/dist/components/SensitiveText/SensitiveText.types.d.mts +6 -34
- package/dist/components/SensitiveText/SensitiveText.types.d.mts.map +1 -1
- package/dist/components/SensitiveText/SensitiveText.types.mjs.map +1 -1
- package/dist/components/SensitiveText/index.cjs +3 -3
- package/dist/components/SensitiveText/index.cjs.map +1 -1
- package/dist/components/SensitiveText/index.d.cts +1 -1
- package/dist/components/SensitiveText/index.d.cts.map +1 -1
- package/dist/components/SensitiveText/index.d.mts +1 -1
- package/dist/components/SensitiveText/index.d.mts.map +1 -1
- package/dist/components/SensitiveText/index.mjs +1 -1
- package/dist/components/SensitiveText/index.mjs.map +1 -1
- package/dist/components/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 +1 -2
- package/dist/components/TextField/TextField.cjs.map +1 -1
- package/dist/components/TextField/TextField.d.cts +8 -2
- package/dist/components/TextField/TextField.d.cts.map +1 -1
- package/dist/components/TextField/TextField.d.mts +8 -2
- package/dist/components/TextField/TextField.d.mts.map +1 -1
- package/dist/components/TextField/TextField.mjs +1 -2
- 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 +5 -1
- package/dist/components/TextField/TextField.types.d.cts.map +1 -1
- package/dist/components/TextField/TextField.types.d.mts +5 -1
- 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.d.cts +8 -2
- package/dist/components/TextFieldSearch/TextFieldSearch.d.cts.map +1 -1
- package/dist/components/TextFieldSearch/TextFieldSearch.d.mts +8 -2
- package/dist/components/TextFieldSearch/TextFieldSearch.d.mts.map +1 -1
- package/dist/components/TitleAlert/TitleAlert.cjs +54 -0
- package/dist/components/TitleAlert/TitleAlert.cjs.map +1 -0
- package/dist/components/TitleAlert/TitleAlert.d.cts +21 -0
- package/dist/components/TitleAlert/TitleAlert.d.cts.map +1 -0
- package/dist/components/TitleAlert/TitleAlert.d.mts +21 -0
- package/dist/components/TitleAlert/TitleAlert.d.mts.map +1 -0
- package/dist/components/TitleAlert/TitleAlert.mjs +54 -0
- package/dist/components/TitleAlert/TitleAlert.mjs.map +1 -0
- package/dist/components/TitleAlert/TitleAlert.types.cjs +3 -0
- package/dist/components/TitleAlert/TitleAlert.types.cjs.map +1 -0
- package/dist/components/TitleAlert/TitleAlert.types.d.cts +31 -0
- package/dist/components/TitleAlert/TitleAlert.types.d.cts.map +1 -0
- package/dist/components/TitleAlert/TitleAlert.types.d.mts +31 -0
- package/dist/components/TitleAlert/TitleAlert.types.d.mts.map +1 -0
- package/dist/components/TitleAlert/TitleAlert.types.mjs +2 -0
- package/dist/components/TitleAlert/TitleAlert.types.mjs.map +1 -0
- package/dist/components/TitleAlert/index.cjs +6 -0
- package/dist/components/TitleAlert/index.cjs.map +1 -0
- package/dist/components/TitleAlert/index.d.cts +3 -0
- package/dist/components/TitleAlert/index.d.cts.map +1 -0
- package/dist/components/TitleAlert/index.d.mts +3 -0
- package/dist/components/TitleAlert/index.d.mts.map +1 -0
- package/dist/components/TitleAlert/index.mjs +2 -0
- package/dist/components/TitleAlert/index.mjs.map +1 -0
- package/dist/components/index.cjs +24 -2
- package/dist/components/index.cjs.map +1 -1
- package/dist/components/index.d.cts +18 -0
- package/dist/components/index.d.cts.map +1 -1
- package/dist/components/index.d.mts +18 -0
- package/dist/components/index.d.mts.map +1 -1
- package/dist/components/index.mjs +9 -0
- 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/package.json +2 -2
- package/dist/components/SensitiveText/SensitiveText.constants.cjs +0 -14
- package/dist/components/SensitiveText/SensitiveText.constants.cjs.map +0 -1
- package/dist/components/SensitiveText/SensitiveText.constants.d.cts +0 -11
- package/dist/components/SensitiveText/SensitiveText.constants.d.cts.map +0 -1
- package/dist/components/SensitiveText/SensitiveText.constants.d.mts +0 -11
- package/dist/components/SensitiveText/SensitiveText.constants.d.mts.map +0 -1
- package/dist/components/SensitiveText/SensitiveText.constants.mjs +0 -11
- package/dist/components/SensitiveText/SensitiveText.constants.mjs.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,33 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.26.0]
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- Added `TitleAlert` for alert-style headings with a severity icon, title row, and optional description in modals, bottom sheets, and other compact surfaces ([#1131](https://github.com/MetaMask/metamask-design-system/pull/1131))
|
|
15
|
+
- Added `SectionHeader` for section titles with optional start and end accessories, icon shortcuts, and an inline title accessory ([#1175](https://github.com/MetaMask/metamask-design-system/pull/1175))
|
|
16
|
+
- Added `SectionDivider` as a horizontal rule with a muted top border and default vertical spacing for separating screen sections ([#1174](https://github.com/MetaMask/metamask-design-system/pull/1174))
|
|
17
|
+
|
|
18
|
+
### Changed
|
|
19
|
+
|
|
20
|
+
- Updated the `Telegram` icon asset to match the official Telegram logo ([#1176](https://github.com/MetaMask/metamask-design-system/pull/1176))
|
|
21
|
+
|
|
22
|
+
## [0.25.0]
|
|
23
|
+
|
|
24
|
+
### Added
|
|
25
|
+
|
|
26
|
+
- Added `SelectButton`, `SegmentButton`, and `SegmentGroup` for option rows, single-choice segments, and grouped segment controls ([#1172](https://github.com/MetaMask/metamask-design-system/pull/1172))
|
|
27
|
+
- Added `SensitiveText` for masking and revealing sensitive strings, matching the cross-platform contract used on web ([#1164](https://github.com/MetaMask/metamask-design-system/pull/1164))
|
|
28
|
+
- Added `HeaderStandardAnimated` and `useHeaderStandardAnimated` for standard headers with coordinated scroll-driven motion ([#1151](https://github.com/MetaMask/metamask-design-system/pull/1151))
|
|
29
|
+
- Added `TextArea` for multi-line text entry ([#1141](https://github.com/MetaMask/metamask-design-system/pull/1141))
|
|
30
|
+
|
|
31
|
+
### Changed
|
|
32
|
+
|
|
33
|
+
- `ButtonBase` now derives label typography, start and end icon sizes, and internal spacing from the `size` prop for every supported `ButtonBaseSize`, keeping defaults aligned without manual per-size tuning ([#1150](https://github.com/MetaMask/metamask-design-system/pull/1150))
|
|
34
|
+
- If you wrap **`ButtonBase`** and override label, icon, or spacing, see [Migration guide](./MIGRATION.md#buttonbase-size-defaults).
|
|
35
|
+
- `BannerBase` close control behavior is simplified and aligned with the shared dismiss contract ([#1166](https://github.com/MetaMask/metamask-design-system/pull/1166))
|
|
36
|
+
|
|
10
37
|
## [0.24.0]
|
|
11
38
|
|
|
12
39
|
### Added
|
|
@@ -419,7 +446,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
419
446
|
- Full TypeScript support with type definitions and enums
|
|
420
447
|
- React Native integration with TWRNC preset support
|
|
421
448
|
|
|
422
|
-
[Unreleased]: https://github.com/MetaMask/metamask-design-system/compare/@metamask/design-system-react-native@0.
|
|
449
|
+
[Unreleased]: https://github.com/MetaMask/metamask-design-system/compare/@metamask/design-system-react-native@0.26.0...HEAD
|
|
450
|
+
[0.26.0]: https://github.com/MetaMask/metamask-design-system/compare/@metamask/design-system-react-native@0.25.0...@metamask/design-system-react-native@0.26.0
|
|
451
|
+
[0.25.0]: https://github.com/MetaMask/metamask-design-system/compare/@metamask/design-system-react-native@0.24.0...@metamask/design-system-react-native@0.25.0
|
|
423
452
|
[0.24.0]: https://github.com/MetaMask/metamask-design-system/compare/@metamask/design-system-react-native@0.23.0...@metamask/design-system-react-native@0.24.0
|
|
424
453
|
[0.23.0]: https://github.com/MetaMask/metamask-design-system/compare/@metamask/design-system-react-native@0.22.0...@metamask/design-system-react-native@0.23.0
|
|
425
454
|
[0.22.0]: https://github.com/MetaMask/metamask-design-system/compare/@metamask/design-system-react-native@0.21.0...@metamask/design-system-react-native@0.22.0
|
|
@@ -14,18 +14,9 @@ const isTextContent = (content) => typeof content === 'string' || typeof content
|
|
|
14
14
|
const hasContent = (content) => content !== null && content !== undefined;
|
|
15
15
|
const BannerBase = ({ title, titleProps, description, descriptionProps, children, childrenWrapperProps, actionButtonLabel, actionButtonOnPress, actionButtonProps, startAccessory, onClose, closeButtonProps, twClassName, ...props }) => {
|
|
16
16
|
const resolvedActionButtonProps = actionButtonProps ?? {};
|
|
17
|
-
const { accessibilityLabel: closeButtonAccessibilityLabel = 'Close banner',
|
|
18
|
-
const shouldShowCloseButton = Boolean(onClose
|
|
17
|
+
const { accessibilityLabel: closeButtonAccessibilityLabel = 'Close banner', twClassName: closeButtonTwClassName, ...resolvedCloseButtonProps } = closeButtonProps ?? {};
|
|
18
|
+
const shouldShowCloseButton = Boolean(onClose);
|
|
19
19
|
const shouldShowActionButton = Boolean(actionButtonOnPress);
|
|
20
|
-
const handleClosePress = onClose || closeButtonPropsOnPress
|
|
21
|
-
? (event) => {
|
|
22
|
-
if (onClose) {
|
|
23
|
-
onClose();
|
|
24
|
-
return;
|
|
25
|
-
}
|
|
26
|
-
closeButtonPropsOnPress?.(event);
|
|
27
|
-
}
|
|
28
|
-
: undefined;
|
|
29
20
|
const mergedCloseButtonTwClassName = closeButtonTwClassName
|
|
30
21
|
? `ml-3 ${closeButtonTwClassName}`
|
|
31
22
|
: 'ml-3';
|
|
@@ -56,7 +47,7 @@ const BannerBase = ({ title, titleProps, description, descriptionProps, children
|
|
|
56
47
|
</Box_1.Box>)}
|
|
57
48
|
</Box_1.Box>
|
|
58
49
|
|
|
59
|
-
{shouldShowCloseButton && (<ButtonIcon_1.ButtonIcon twClassName={mergedCloseButtonTwClassName} iconName={design_system_shared_1.IconName.Close} size={design_system_shared_1.ButtonIconSize.Sm} accessibilityLabel={closeButtonAccessibilityLabel} onPress={
|
|
50
|
+
{shouldShowCloseButton && (<ButtonIcon_1.ButtonIcon twClassName={mergedCloseButtonTwClassName} iconName={design_system_shared_1.IconName.Close} size={design_system_shared_1.ButtonIconSize.Sm} accessibilityLabel={closeButtonAccessibilityLabel} onPress={onClose} {...resolvedCloseButtonProps}/>)}
|
|
60
51
|
</Box_1.Box>);
|
|
61
52
|
};
|
|
62
53
|
exports.BannerBase = BannerBase;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BannerBase.cjs","sourceRoot":"","sources":["../../../src/components/BannerBase/BannerBase.tsx"],"names":[],"mappings":";;;;;;AAAA,yEASwC;AACxC,kDAA0B;
|
|
1
|
+
{"version":3,"file":"BannerBase.cjs","sourceRoot":"","sources":["../../../src/components/BannerBase/BannerBase.tsx"],"names":[],"mappings":";;;;;;AAAA,yEASwC;AACxC,kDAA0B;AAE1B,0CAA6B;AAC7B,gDAAmC;AACnC,wDAA2C;AAC3C,4CAA+B;AAI/B,MAAM,aAAa,GAAG,CAAC,OAAwB,EAA8B,EAAE,CAC7E,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO,OAAO,KAAK,QAAQ,CAAC;AAE7D,MAAM,UAAU,GAAG,CAAC,OAAwB,EAAE,EAAE,CAC9C,OAAO,KAAK,IAAI,IAAI,OAAO,KAAK,SAAS,CAAC;AAErC,MAAM,UAAU,GAA8B,CAAC,EACpD,KAAK,EACL,UAAU,EACV,WAAW,EACX,gBAAgB,EAChB,QAAQ,EACR,oBAAoB,EACpB,iBAAiB,EACjB,mBAAmB,EACnB,iBAAiB,EACjB,cAAc,EACd,OAAO,EACP,gBAAgB,EAChB,WAAW,EACX,GAAG,KAAK,EACT,EAAE,EAAE;IACH,MAAM,yBAAyB,GAAG,iBAAiB,IAAI,EAAE,CAAC;IAE1D,MAAM,EACJ,kBAAkB,EAAE,6BAA6B,GAAG,cAAc,EAClE,WAAW,EAAE,sBAAsB,EACnC,GAAG,wBAAwB,EAC5B,GAAG,gBAAgB,IAAI,EAAE,CAAC;IAE3B,MAAM,qBAAqB,GAAG,OAAO,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BoxBackgroundColor,\n BoxFlexDirection,\n ButtonIconSize,\n ButtonSize,\n FontWeight,\n IconName,\n TextVariant,\n} from '@metamask/design-system-shared';\nimport React from 'react';\n\nimport { Box } from '../Box';\nimport { Button } from '../Button';\nimport { ButtonIcon } from '../ButtonIcon';\nimport { Text } from '../Text';\n\nimport type { BannerBaseProps } from './BannerBase.types';\n\nconst isTextContent = (content: React.ReactNode): content is string | number =>\n typeof content === 'string' || typeof content === 'number';\n\nconst hasContent = (content: React.ReactNode) =>\n content !== null && content !== undefined;\n\nexport const BannerBase: React.FC<BannerBaseProps> = ({\n title,\n titleProps,\n description,\n descriptionProps,\n children,\n childrenWrapperProps,\n actionButtonLabel,\n actionButtonOnPress,\n actionButtonProps,\n startAccessory,\n onClose,\n closeButtonProps,\n twClassName,\n ...props\n}) => {\n const resolvedActionButtonProps = actionButtonProps ?? {};\n\n const {\n accessibilityLabel: closeButtonAccessibilityLabel = 'Close banner',\n twClassName: closeButtonTwClassName,\n ...resolvedCloseButtonProps\n } = closeButtonProps ?? {};\n\n const shouldShowCloseButton = Boolean(onClose);\n const shouldShowActionButton = Boolean(actionButtonOnPress);\n\n const mergedCloseButtonTwClassName = closeButtonTwClassName\n ? `ml-3 ${closeButtonTwClassName}`\n : 'ml-3';\n\n return (\n <Box\n flexDirection={BoxFlexDirection.Row}\n alignItems={BoxAlignItems.Start}\n gap={2}\n backgroundColor={BoxBackgroundColor.BackgroundDefault}\n padding={3}\n twClassName={twClassName ? `rounded-sm ${twClassName}` : 'rounded-sm'}\n {...props}\n >\n {startAccessory}\n\n <Box twClassName=\"flex-1\">\n {hasContent(title) &&\n (isTextContent(title) ? (\n <Text\n variant={TextVariant.BodyMd}\n fontWeight={FontWeight.Medium}\n {...titleProps}\n >\n {title}\n </Text>\n ) : (\n title\n ))}\n\n {hasContent(description) && (\n <Box twClassName={hasContent(title) ? 'mt-1' : undefined}>\n {isTextContent(description) ? (\n <Text variant={TextVariant.BodySm} {...descriptionProps}>\n {description}\n </Text>\n ) : (\n description\n )}\n </Box>\n )}\n\n {hasContent(children) &&\n (isTextContent(children) ? (\n <Text variant={TextVariant.BodyMd} {...childrenWrapperProps}>\n {children}\n </Text>\n ) : (\n children\n ))}\n\n {shouldShowActionButton && (\n <Box twClassName=\"mt-4\">\n <Button\n size={ButtonSize.Md}\n onPress={actionButtonOnPress}\n {...resolvedActionButtonProps}\n >\n {actionButtonLabel}\n </Button>\n </Box>\n )}\n </Box>\n\n {shouldShowCloseButton && (\n <ButtonIcon\n twClassName={mergedCloseButtonTwClassName}\n iconName={IconName.Close}\n size={ButtonIconSize.Sm}\n accessibilityLabel={closeButtonAccessibilityLabel}\n onPress={onClose}\n {...resolvedCloseButtonProps}\n />\n )}\n </Box>\n );\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BannerBase.d.cts","sourceRoot":"","sources":["../../../src/components/BannerBase/BannerBase.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,cAAc;
|
|
1
|
+
{"version":3,"file":"BannerBase.d.cts","sourceRoot":"","sources":["../../../src/components/BannerBase/BannerBase.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,cAAc;AAO1B,OAAO,KAAK,EAAE,eAAe,EAAE,+BAA2B;AAQ1D,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAuGhD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BannerBase.d.mts","sourceRoot":"","sources":["../../../src/components/BannerBase/BannerBase.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,cAAc;
|
|
1
|
+
{"version":3,"file":"BannerBase.d.mts","sourceRoot":"","sources":["../../../src/components/BannerBase/BannerBase.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,cAAc;AAO1B,OAAO,KAAK,EAAE,eAAe,EAAE,+BAA2B;AAQ1D,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAuGhD,CAAC"}
|
|
@@ -15,18 +15,9 @@ const isTextContent = (content) => typeof content === 'string' || typeof content
|
|
|
15
15
|
const hasContent = (content) => content !== null && content !== undefined;
|
|
16
16
|
export const BannerBase = ({ title, titleProps, description, descriptionProps, children, childrenWrapperProps, actionButtonLabel, actionButtonOnPress, actionButtonProps, startAccessory, onClose, closeButtonProps, twClassName, ...props }) => {
|
|
17
17
|
const resolvedActionButtonProps = actionButtonProps ?? {};
|
|
18
|
-
const { accessibilityLabel: closeButtonAccessibilityLabel = 'Close banner',
|
|
19
|
-
const shouldShowCloseButton = Boolean(onClose
|
|
18
|
+
const { accessibilityLabel: closeButtonAccessibilityLabel = 'Close banner', twClassName: closeButtonTwClassName, ...resolvedCloseButtonProps } = closeButtonProps ?? {};
|
|
19
|
+
const shouldShowCloseButton = Boolean(onClose);
|
|
20
20
|
const shouldShowActionButton = Boolean(actionButtonOnPress);
|
|
21
|
-
const handleClosePress = onClose || closeButtonPropsOnPress
|
|
22
|
-
? (event) => {
|
|
23
|
-
if (onClose) {
|
|
24
|
-
onClose();
|
|
25
|
-
return;
|
|
26
|
-
}
|
|
27
|
-
closeButtonPropsOnPress?.(event);
|
|
28
|
-
}
|
|
29
|
-
: undefined;
|
|
30
21
|
const mergedCloseButtonTwClassName = closeButtonTwClassName
|
|
31
22
|
? `ml-3 ${closeButtonTwClassName}`
|
|
32
23
|
: 'ml-3';
|
|
@@ -57,7 +48,7 @@ export const BannerBase = ({ title, titleProps, description, descriptionProps, c
|
|
|
57
48
|
</Box>)}
|
|
58
49
|
</Box>
|
|
59
50
|
|
|
60
|
-
{shouldShowCloseButton && (<ButtonIcon twClassName={mergedCloseButtonTwClassName} iconName={IconName.Close} size={ButtonIconSize.Sm} accessibilityLabel={closeButtonAccessibilityLabel} onPress={
|
|
51
|
+
{shouldShowCloseButton && (<ButtonIcon twClassName={mergedCloseButtonTwClassName} iconName={IconName.Close} size={ButtonIconSize.Sm} accessibilityLabel={closeButtonAccessibilityLabel} onPress={onClose} {...resolvedCloseButtonProps}/>)}
|
|
61
52
|
</Box>);
|
|
62
53
|
};
|
|
63
54
|
//# sourceMappingURL=BannerBase.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BannerBase.mjs","sourceRoot":"","sources":["../../../src/components/BannerBase/BannerBase.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,EACL,aAAa,EACb,kBAAkB,EAClB,gBAAgB,EAChB,cAAc,EACd,UAAU,EACV,UAAU,EACV,QAAQ,EACR,WAAW,EACZ,uCAAuC;AACxC,OAAO,MAAK,cAAc;;
|
|
1
|
+
{"version":3,"file":"BannerBase.mjs","sourceRoot":"","sources":["../../../src/components/BannerBase/BannerBase.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,EACL,aAAa,EACb,kBAAkB,EAClB,gBAAgB,EAChB,cAAc,EACd,UAAU,EACV,UAAU,EACV,QAAQ,EACR,WAAW,EACZ,uCAAuC;AACxC,OAAO,MAAK,cAAc;;AAE1B,OAAO,EAAE,GAAG,EAAE,yBAAe;AAC7B,OAAO,EAAE,MAAM,EAAE,4BAAkB;AACnC,OAAO,EAAE,UAAU,EAAE,gCAAsB;AAC3C,OAAO,EAAE,IAAI,EAAE,0BAAgB;AAI/B,MAAM,aAAa,GAAG,CAAC,OAAwB,EAA8B,EAAE,CAC7E,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO,OAAO,KAAK,QAAQ,CAAC;AAE7D,MAAM,UAAU,GAAG,CAAC,OAAwB,EAAE,EAAE,CAC9C,OAAO,KAAK,IAAI,IAAI,OAAO,KAAK,SAAS,CAAC;AAE5C,MAAM,CAAC,MAAM,UAAU,GAA8B,CAAC,EACpD,KAAK,EACL,UAAU,EACV,WAAW,EACX,gBAAgB,EAChB,QAAQ,EACR,oBAAoB,EACpB,iBAAiB,EACjB,mBAAmB,EACnB,iBAAiB,EACjB,cAAc,EACd,OAAO,EACP,gBAAgB,EAChB,WAAW,EACX,GAAG,KAAK,EACT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CACxB,kBAAkB,CAAC,CAAC,6BAA6B,CAAC,CAClD,OAAO,CAAC,CAAC,OAAO,CAAC,CACjB,IAAI,wBAAwB,CAAC,EAC7B,CACH,CACH;IAAA,EAAE,GAAG,CAAC,CACP,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import {\n BoxAlignItems,\n BoxBackgroundColor,\n BoxFlexDirection,\n ButtonIconSize,\n ButtonSize,\n FontWeight,\n IconName,\n TextVariant,\n} from '@metamask/design-system-shared';\nimport React from 'react';\n\nimport { Box } from '../Box';\nimport { Button } from '../Button';\nimport { ButtonIcon } from '../ButtonIcon';\nimport { Text } from '../Text';\n\nimport type { BannerBaseProps } from './BannerBase.types';\n\nconst isTextContent = (content: React.ReactNode): content is string | number =>\n typeof content === 'string' || typeof content === 'number';\n\nconst hasContent = (content: React.ReactNode) =>\n content !== null && content !== undefined;\n\nexport const BannerBase: React.FC<BannerBaseProps> = ({\n title,\n titleProps,\n description,\n descriptionProps,\n children,\n childrenWrapperProps,\n actionButtonLabel,\n actionButtonOnPress,\n actionButtonProps,\n startAccessory,\n onClose,\n closeButtonProps,\n twClassName,\n ...props\n}) => {\n const resolvedActionButtonProps = actionButtonProps ?? {};\n\n const {\n accessibilityLabel: closeButtonAccessibilityLabel = 'Close banner',\n twClassName: closeButtonTwClassName,\n ...resolvedCloseButtonProps\n } = closeButtonProps ?? {};\n\n const shouldShowCloseButton = Boolean(onClose);\n const shouldShowActionButton = Boolean(actionButtonOnPress);\n\n const mergedCloseButtonTwClassName = closeButtonTwClassName\n ? `ml-3 ${closeButtonTwClassName}`\n : 'ml-3';\n\n return (\n <Box\n flexDirection={BoxFlexDirection.Row}\n alignItems={BoxAlignItems.Start}\n gap={2}\n backgroundColor={BoxBackgroundColor.BackgroundDefault}\n padding={3}\n twClassName={twClassName ? `rounded-sm ${twClassName}` : 'rounded-sm'}\n {...props}\n >\n {startAccessory}\n\n <Box twClassName=\"flex-1\">\n {hasContent(title) &&\n (isTextContent(title) ? (\n <Text\n variant={TextVariant.BodyMd}\n fontWeight={FontWeight.Medium}\n {...titleProps}\n >\n {title}\n </Text>\n ) : (\n title\n ))}\n\n {hasContent(description) && (\n <Box twClassName={hasContent(title) ? 'mt-1' : undefined}>\n {isTextContent(description) ? (\n <Text variant={TextVariant.BodySm} {...descriptionProps}>\n {description}\n </Text>\n ) : (\n description\n )}\n </Box>\n )}\n\n {hasContent(children) &&\n (isTextContent(children) ? (\n <Text variant={TextVariant.BodyMd} {...childrenWrapperProps}>\n {children}\n </Text>\n ) : (\n children\n ))}\n\n {shouldShowActionButton && (\n <Box twClassName=\"mt-4\">\n <Button\n size={ButtonSize.Md}\n onPress={actionButtonOnPress}\n {...resolvedActionButtonProps}\n >\n {actionButtonLabel}\n </Button>\n </Box>\n )}\n </Box>\n\n {shouldShowCloseButton && (\n <ButtonIcon\n twClassName={mergedCloseButtonTwClassName}\n iconName={IconName.Close}\n size={ButtonIconSize.Sm}\n accessibilityLabel={closeButtonAccessibilityLabel}\n onPress={onClose}\n {...resolvedCloseButtonProps}\n />\n )}\n </Box>\n );\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BannerBase.types.cjs","sourceRoot":"","sources":["../../../src/components/BannerBase/BannerBase.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { BannerBasePropsShared } from '@metamask/design-system-shared';\nimport type { GestureResponderEvent } from 'react-native';\n\nimport type { BoxProps } from '../Box';\nimport type { ButtonProps } from '../Button';\nimport type { ButtonIconProps } from '../ButtonIcon';\nimport type { TextProps } from '../Text';\n\ntype BannerBaseActionButtonProps = Omit<\n Partial<ButtonProps>,\n 'children' | 'onPress' | 'variant'\n>;\n\ntype BannerBaseCloseButtonProps = Omit<\n Partial<ButtonIconProps>,\n 'iconName' | 'onPress'\n
|
|
1
|
+
{"version":3,"file":"BannerBase.types.cjs","sourceRoot":"","sources":["../../../src/components/BannerBase/BannerBase.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { BannerBasePropsShared } from '@metamask/design-system-shared';\nimport type { GestureResponderEvent } from 'react-native';\n\nimport type { BoxProps } from '../Box';\nimport type { ButtonProps } from '../Button';\nimport type { ButtonIconProps } from '../ButtonIcon';\nimport type { TextProps } from '../Text';\n\ntype BannerBaseActionButtonProps = Omit<\n Partial<ButtonProps>,\n 'children' | 'onPress' | 'variant'\n>;\n\ntype BannerBaseCloseButtonProps = Omit<\n Partial<ButtonIconProps>,\n 'iconName' | 'onPress'\n>;\n\ntype BannerBasePropsBase = BannerBasePropsShared &\n Omit<BoxProps, 'children'> & {\n /**\n * Optional props for the title `Text` when title is a string.\n */\n titleProps?: Omit<Partial<TextProps>, 'children'>;\n /**\n * Optional props for the description `Text` when description is a string.\n */\n descriptionProps?: Omit<Partial<TextProps>, 'children'>;\n /**\n * Optional props for the children wrapper `Text` when children is a string.\n */\n childrenWrapperProps?: Omit<Partial<TextProps>, 'children'>;\n /**\n * Optional callback for the close button.\n * If provided, a close button is shown.\n */\n onClose?: () => void;\n /**\n * Optional props for the close `ButtonIcon`.\n * Only used when `onClose` is provided.\n */\n closeButtonProps?: BannerBaseCloseButtonProps;\n };\n\ntype BannerBaseActionPropsWithHandler = {\n actionButtonOnPress: (event: GestureResponderEvent) => void;\n actionButtonLabel: string;\n actionButtonProps?: BannerBaseActionButtonProps;\n};\n\ntype BannerBaseActionPropsWithoutHandler = {\n actionButtonOnPress?: undefined;\n actionButtonLabel?: string;\n actionButtonProps?: BannerBaseActionButtonProps;\n};\n\n/**\n * BannerBase component props.\n */\nexport type BannerBaseProps = BannerBasePropsBase &\n (BannerBaseActionPropsWithHandler | BannerBaseActionPropsWithoutHandler);\n"]}
|
|
@@ -5,12 +5,7 @@ import type { ButtonProps } from "../Button/index.cjs";
|
|
|
5
5
|
import type { ButtonIconProps } from "../ButtonIcon/index.cjs";
|
|
6
6
|
import type { TextProps } from "../Text/index.cjs";
|
|
7
7
|
type BannerBaseActionButtonProps = Omit<Partial<ButtonProps>, 'children' | 'onPress' | 'variant'>;
|
|
8
|
-
type BannerBaseCloseButtonProps = Omit<Partial<ButtonIconProps>, 'iconName' | 'onPress'
|
|
9
|
-
/**
|
|
10
|
-
* Optional press handler for the close button.
|
|
11
|
-
*/
|
|
12
|
-
onPress?: (event: GestureResponderEvent) => void;
|
|
13
|
-
};
|
|
8
|
+
type BannerBaseCloseButtonProps = Omit<Partial<ButtonIconProps>, 'iconName' | 'onPress'>;
|
|
14
9
|
type BannerBasePropsBase = BannerBasePropsShared & Omit<BoxProps, 'children'> & {
|
|
15
10
|
/**
|
|
16
11
|
* Optional props for the title `Text` when title is a string.
|
|
@@ -31,7 +26,7 @@ type BannerBasePropsBase = BannerBasePropsShared & Omit<BoxProps, 'children'> &
|
|
|
31
26
|
onClose?: () => void;
|
|
32
27
|
/**
|
|
33
28
|
* Optional props for the close `ButtonIcon`.
|
|
34
|
-
*
|
|
29
|
+
* Only used when `onClose` is provided.
|
|
35
30
|
*/
|
|
36
31
|
closeButtonProps?: BannerBaseCloseButtonProps;
|
|
37
32
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BannerBase.types.d.cts","sourceRoot":"","sources":["../../../src/components/BannerBase/BannerBase.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,uCAAuC;AAC5E,OAAO,KAAK,EAAE,qBAAqB,EAAE,8BAAqB;AAE1D,OAAO,KAAK,EAAE,QAAQ,EAAE,yBAAe;AACvC,OAAO,KAAK,EAAE,WAAW,EAAE,4BAAkB;AAC7C,OAAO,KAAK,EAAE,eAAe,EAAE,gCAAsB;AACrD,OAAO,KAAK,EAAE,SAAS,EAAE,0BAAgB;AAEzC,KAAK,2BAA2B,GAAG,IAAI,CACrC,OAAO,CAAC,WAAW,CAAC,EACpB,UAAU,GAAG,SAAS,GAAG,SAAS,CACnC,CAAC;AAEF,KAAK,0BAA0B,GAAG,IAAI,CACpC,OAAO,CAAC,eAAe,CAAC,EACxB,UAAU,GAAG,SAAS,CACvB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,CAAC,EAAE,2BAA2B,CAAC;CACjD,CAAC;AAEF,KAAK,mCAAmC,GAAG;IACzC,mBAAmB,CAAC,EAAE,SAAS,CAAC;IAChC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,iBAAiB,CAAC,EAAE,2BAA2B,CAAC;CACjD,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,mBAAmB,GAC/C,CAAC,gCAAgC,GAAG,mCAAmC,CAAC,CAAC"}
|
|
@@ -5,12 +5,7 @@ import type { ButtonProps } from "../Button/index.mjs";
|
|
|
5
5
|
import type { ButtonIconProps } from "../ButtonIcon/index.mjs";
|
|
6
6
|
import type { TextProps } from "../Text/index.mjs";
|
|
7
7
|
type BannerBaseActionButtonProps = Omit<Partial<ButtonProps>, 'children' | 'onPress' | 'variant'>;
|
|
8
|
-
type BannerBaseCloseButtonProps = Omit<Partial<ButtonIconProps>, 'iconName' | 'onPress'
|
|
9
|
-
/**
|
|
10
|
-
* Optional press handler for the close button.
|
|
11
|
-
*/
|
|
12
|
-
onPress?: (event: GestureResponderEvent) => void;
|
|
13
|
-
};
|
|
8
|
+
type BannerBaseCloseButtonProps = Omit<Partial<ButtonIconProps>, 'iconName' | 'onPress'>;
|
|
14
9
|
type BannerBasePropsBase = BannerBasePropsShared & Omit<BoxProps, 'children'> & {
|
|
15
10
|
/**
|
|
16
11
|
* Optional props for the title `Text` when title is a string.
|
|
@@ -31,7 +26,7 @@ type BannerBasePropsBase = BannerBasePropsShared & Omit<BoxProps, 'children'> &
|
|
|
31
26
|
onClose?: () => void;
|
|
32
27
|
/**
|
|
33
28
|
* Optional props for the close `ButtonIcon`.
|
|
34
|
-
*
|
|
29
|
+
* Only used when `onClose` is provided.
|
|
35
30
|
*/
|
|
36
31
|
closeButtonProps?: BannerBaseCloseButtonProps;
|
|
37
32
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BannerBase.types.d.mts","sourceRoot":"","sources":["../../../src/components/BannerBase/BannerBase.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,uCAAuC;AAC5E,OAAO,KAAK,EAAE,qBAAqB,EAAE,8BAAqB;AAE1D,OAAO,KAAK,EAAE,QAAQ,EAAE,yBAAe;AACvC,OAAO,KAAK,EAAE,WAAW,EAAE,4BAAkB;AAC7C,OAAO,KAAK,EAAE,eAAe,EAAE,gCAAsB;AACrD,OAAO,KAAK,EAAE,SAAS,EAAE,0BAAgB;AAEzC,KAAK,2BAA2B,GAAG,IAAI,CACrC,OAAO,CAAC,WAAW,CAAC,EACpB,UAAU,GAAG,SAAS,GAAG,SAAS,CACnC,CAAC;AAEF,KAAK,0BAA0B,GAAG,IAAI,CACpC,OAAO,CAAC,eAAe,CAAC,EACxB,UAAU,GAAG,SAAS,CACvB,
|
|
1
|
+
{"version":3,"file":"BannerBase.types.d.mts","sourceRoot":"","sources":["../../../src/components/BannerBase/BannerBase.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,uCAAuC;AAC5E,OAAO,KAAK,EAAE,qBAAqB,EAAE,8BAAqB;AAE1D,OAAO,KAAK,EAAE,QAAQ,EAAE,yBAAe;AACvC,OAAO,KAAK,EAAE,WAAW,EAAE,4BAAkB;AAC7C,OAAO,KAAK,EAAE,eAAe,EAAE,gCAAsB;AACrD,OAAO,KAAK,EAAE,SAAS,EAAE,0BAAgB;AAEzC,KAAK,2BAA2B,GAAG,IAAI,CACrC,OAAO,CAAC,WAAW,CAAC,EACpB,UAAU,GAAG,SAAS,GAAG,SAAS,CACnC,CAAC;AAEF,KAAK,0BAA0B,GAAG,IAAI,CACpC,OAAO,CAAC,eAAe,CAAC,EACxB,UAAU,GAAG,SAAS,CACvB,CAAC;AAEF,KAAK,mBAAmB,GAAG,qBAAqB,GAC9C,IAAI,CAAC,QAAQ,EAAE,UAAU,CAAC,GAAG;IAC3B;;OAEG;IACH,UAAU,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,UAAU,CAAC,CAAC;IAClD;;OAEG;IACH,gBAAgB,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,UAAU,CAAC,CAAC;IACxD;;OAEG;IACH,oBAAoB,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,UAAU,CAAC,CAAC;IAC5D;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,0BAA0B,CAAC;CAC/C,CAAC;AAEJ,KAAK,gCAAgC,GAAG;IACtC,mBAAmB,EAAE,CAAC,KAAK,EAAE,qBAAqB,KAAK,IAAI,CAAC;IAC5D,iBAAiB,EAAE,MAAM,CAAC;IAC1B,iBAAiB,CAAC,EAAE,2BAA2B,CAAC;CACjD,CAAC;AAEF,KAAK,mCAAmC,GAAG;IACzC,mBAAmB,CAAC,EAAE,SAAS,CAAC;IAChC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,iBAAiB,CAAC,EAAE,2BAA2B,CAAC;CACjD,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,mBAAmB,GAC/C,CAAC,gCAAgC,GAAG,mCAAmC,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BannerBase.types.mjs","sourceRoot":"","sources":["../../../src/components/BannerBase/BannerBase.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { BannerBasePropsShared } from '@metamask/design-system-shared';\nimport type { GestureResponderEvent } from 'react-native';\n\nimport type { BoxProps } from '../Box';\nimport type { ButtonProps } from '../Button';\nimport type { ButtonIconProps } from '../ButtonIcon';\nimport type { TextProps } from '../Text';\n\ntype BannerBaseActionButtonProps = Omit<\n Partial<ButtonProps>,\n 'children' | 'onPress' | 'variant'\n>;\n\ntype BannerBaseCloseButtonProps = Omit<\n Partial<ButtonIconProps>,\n 'iconName' | 'onPress'\n
|
|
1
|
+
{"version":3,"file":"BannerBase.types.mjs","sourceRoot":"","sources":["../../../src/components/BannerBase/BannerBase.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { BannerBasePropsShared } from '@metamask/design-system-shared';\nimport type { GestureResponderEvent } from 'react-native';\n\nimport type { BoxProps } from '../Box';\nimport type { ButtonProps } from '../Button';\nimport type { ButtonIconProps } from '../ButtonIcon';\nimport type { TextProps } from '../Text';\n\ntype BannerBaseActionButtonProps = Omit<\n Partial<ButtonProps>,\n 'children' | 'onPress' | 'variant'\n>;\n\ntype BannerBaseCloseButtonProps = Omit<\n Partial<ButtonIconProps>,\n 'iconName' | 'onPress'\n>;\n\ntype BannerBasePropsBase = BannerBasePropsShared &\n Omit<BoxProps, 'children'> & {\n /**\n * Optional props for the title `Text` when title is a string.\n */\n titleProps?: Omit<Partial<TextProps>, 'children'>;\n /**\n * Optional props for the description `Text` when description is a string.\n */\n descriptionProps?: Omit<Partial<TextProps>, 'children'>;\n /**\n * Optional props for the children wrapper `Text` when children is a string.\n */\n childrenWrapperProps?: Omit<Partial<TextProps>, 'children'>;\n /**\n * Optional callback for the close button.\n * If provided, a close button is shown.\n */\n onClose?: () => void;\n /**\n * Optional props for the close `ButtonIcon`.\n * Only used when `onClose` is provided.\n */\n closeButtonProps?: BannerBaseCloseButtonProps;\n };\n\ntype BannerBaseActionPropsWithHandler = {\n actionButtonOnPress: (event: GestureResponderEvent) => void;\n actionButtonLabel: string;\n actionButtonProps?: BannerBaseActionButtonProps;\n};\n\ntype BannerBaseActionPropsWithoutHandler = {\n actionButtonOnPress?: undefined;\n actionButtonLabel?: string;\n actionButtonProps?: BannerBaseActionButtonProps;\n};\n\n/**\n * BannerBase component props.\n */\nexport type BannerBaseProps = BannerBasePropsBase &\n (BannerBaseActionPropsWithHandler | BannerBaseActionPropsWithoutHandler);\n"]}
|
|
@@ -26,8 +26,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
26
26
|
exports.ButtonPrimary = void 0;
|
|
27
27
|
const react_1 = __importStar(require("react"));
|
|
28
28
|
const ButtonBase_1 = require("../../../ButtonBase/index.cjs");
|
|
29
|
-
const Icon_1 = require("../../../Icon/index.cjs");
|
|
30
|
-
const Text_1 = require("../../../Text/index.cjs");
|
|
31
29
|
// Internal Button variant.
|
|
32
30
|
// Consumers should use `Button` with `variant`.
|
|
33
31
|
const ButtonPrimary = ({ children, textProps, spinnerProps, startIconProps, endIconProps, isDanger = false, isInverse = false, isLoading = false, twClassName = '', style, ...props }) => {
|
|
@@ -58,21 +56,7 @@ const ButtonPrimary = ({ children, textProps, spinnerProps, startIconProps, endI
|
|
|
58
56
|
}
|
|
59
57
|
return 'text-primary-inverse';
|
|
60
58
|
}, [isInverse, isDanger, isLoading]);
|
|
61
|
-
return (<ButtonBase_1.ButtonBase textProps={{
|
|
62
|
-
variant: Text_1.TextVariant.BodyMd,
|
|
63
|
-
fontWeight: Text_1.FontWeight.Medium,
|
|
64
|
-
numberOfLines: 1,
|
|
65
|
-
ellipsizeMode: 'clip',
|
|
66
|
-
...textProps,
|
|
67
|
-
}} spinnerProps={{
|
|
68
|
-
...spinnerProps,
|
|
69
|
-
}} startIconProps={{
|
|
70
|
-
size: Icon_1.IconSize.Sm,
|
|
71
|
-
...startIconProps,
|
|
72
|
-
}} endIconProps={{
|
|
73
|
-
size: Icon_1.IconSize.Sm,
|
|
74
|
-
...endIconProps,
|
|
75
|
-
}} isLoading={isLoading} twClassName={getContainerClassName} textClassName={getTextClassName} iconClassName={getTextClassName} style={style} {...props}>
|
|
59
|
+
return (<ButtonBase_1.ButtonBase textProps={textProps} spinnerProps={spinnerProps} startIconProps={startIconProps} endIconProps={endIconProps} isLoading={isLoading} twClassName={getContainerClassName} textClassName={getTextClassName} iconClassName={getTextClassName} style={style} {...props}>
|
|
76
60
|
{children}
|
|
77
61
|
</ButtonBase_1.ButtonBase>);
|
|
78
62
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ButtonPrimary.cjs","sourceRoot":"","sources":["../../../../../src/components/Button/variants/ButtonPrimary/ButtonPrimary.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAA2C;AAE3C,8DAAiD;
|
|
1
|
+
{"version":3,"file":"ButtonPrimary.cjs","sourceRoot":"","sources":["../../../../../src/components/Button/variants/ButtonPrimary/ButtonPrimary.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAA2C;AAE3C,8DAAiD;AAIjD,2BAA2B;AAC3B,gDAAgD;AACzC,MAAM,aAAa,GAAG,CAAC,EAC5B,QAAQ,EACR,SAAS,EACT,YAAY,EACZ,cAAc,EACd,YAAY,EACZ,QAAQ,GAAG,KAAK,EAChB,SAAS,GAAG,KAAK,EACjB,SAAS,GAAG,KAAK,EACjB,WAAW,GAAG,EAAE,EAChB,KAAK,EACL,GAAG,KAAK,EACW,EAAE,EAAE;IACvB,MAAM,qBAAqB,GAAG,IAAA,mBAAW,EACvC,CAAC,OAAgB,EAAU,EAAE;QAC3B,MAAM,YAAY,GAChB,OAAO,WAAW,KAAK,UAAU,CAAC,CAAC,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC;QAEzE,IAAI,SAAS,IAAI,QAAQ,EAAE;YACzB,OAAO,GAAG,OAAO,IAAI,SAAS,CAAC,CAAC,CAAC,oBAAoB,CAAC,CAAC,CAAC,YAAY,IAAI,YAAY,EAAE,CAAC;SACxF;QACD,IAAI,QAAQ,EAAE;YACZ,OAAO,GAAG,OAAO,IAAI,SAAS,CAAC,CAAC,CAAC,0BAA0B,CAAC,CAAC,CAAC,kBAAkB,IAAI,YAAY,EAAE,CAAC;SACpG;QACD,IAAI,SAAS,EAAE;YACb,OAAO,GAAG,OAAO,IAAI,SAAS,CAAC,CAAC,CAAC,oBAAoB,CAAC,CAAC,CAAC,YAAY,IAAI,YAAY,EAAE,CAAC;SACxF;QACD,OAAO,GAAG,OAAO,IAAI,SAAS,CAAC,CAAC,CAAC,yBAAyB,CAAC,CAAC,CAAC,iBAAiB,IAAI,YAAY,EAAE,CAAC;IACnG,CAAC,EACD,CAAC,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAE,WAAW,CAAC,CAC9C,CAAC;IAEF,MAAM,gBAAgB,GAAG,IAAA,mBAAW,EAClC,CAAC,OAAgB,EAAU,EAAE;QAC3B,IAAI,SAAS,IAAI,QAAQ,EAAE;YACzB,OAAO,OAAO,IAAI,SAAS;gBACzB,CAAC,CAAC,4BAA4B;gBAC9B,CAAC,CAAC,oBAAoB,CAAC;SAC1B;QACD,IAAI,QAAQ,EAAE;YACZ,OAAO,sBAAsB,CAAC;SAC/B;QACD,IAAI,SAAS,EAAE;YACb,OAAO,cAAc,CAAC;SACvB;QACD,OAAO,sBAAsB,CAAC;IAChC,CAAC,EACD,CAAC,SAAS,EAAE,QAAQ,EAAE,SAAS,CAAC,CACjC,CAAC;IAEF,OAAO,CACL,CAAC,uBAAU,CACT,SAAS,CAAC,CAAC,SAAS,CAAC,CACrB,YAAY,CAAC,CAAC,YAAY,CAAC,CAC3B,cAAc,CAAC,CAAC,cAAc,CAAC,CAC/B,YAAY,CAAC,CAAC,YAAY,CAAC,CAC3B,SAAS,CAAC,CAAC,SAAS,CAAC,CACrB,WAAW,CAAC,CAAC,qBAAqB,CAAC,CACnC,aAAa,CAAC,CAAC,gBAAgB,CAAC,CAChC,aAAa,CAAC,CAAC,gBAAgB,CAAC,CAChC,KAAK,CAAC,CAAC,KAAK,CAAC,CACb,IAAI,KAAK,CAAC,CAEV;MAAA,CAAC,QAAQ,CACX;IAAA,EAAE,uBAAU,CAAC,CACd,CAAC;AACJ,CAAC,CAAC;AAlEW,QAAA,aAAa,iBAkExB","sourcesContent":["import React, { useCallback } from 'react';\n\nimport { ButtonBase } from '../../../ButtonBase';\n\nimport type { ButtonPrimaryProps } from './ButtonPrimary.types';\n\n// Internal Button variant.\n// Consumers should use `Button` with `variant`.\nexport const ButtonPrimary = ({\n children,\n textProps,\n spinnerProps,\n startIconProps,\n endIconProps,\n isDanger = false,\n isInverse = false,\n isLoading = false,\n twClassName = '',\n style,\n ...props\n}: ButtonPrimaryProps) => {\n const getContainerClassName = useCallback(\n (pressed: boolean): string => {\n const classNameStr =\n typeof twClassName === 'function' ? twClassName(pressed) : twClassName;\n\n if (isInverse && isDanger) {\n return `${pressed || isLoading ? 'bg-default-pressed' : 'bg-default'} ${classNameStr}`;\n }\n if (isDanger) {\n return `${pressed || isLoading ? 'bg-error-default-pressed' : 'bg-error-default'} ${classNameStr}`;\n }\n if (isInverse) {\n return `${pressed || isLoading ? 'bg-default-pressed' : 'bg-default'} ${classNameStr}`;\n }\n return `${pressed || isLoading ? 'bg-icon-default-pressed' : 'bg-icon-default'} ${classNameStr}`;\n },\n [isInverse, isDanger, isLoading, twClassName],\n );\n\n const getTextClassName = useCallback(\n (pressed: boolean): string => {\n if (isInverse && isDanger) {\n return pressed || isLoading\n ? 'text-error-default-pressed'\n : 'text-error-default';\n }\n if (isDanger) {\n return 'text-primary-inverse';\n }\n if (isInverse) {\n return 'text-default';\n }\n return 'text-primary-inverse';\n },\n [isInverse, isDanger, isLoading],\n );\n\n return (\n <ButtonBase\n textProps={textProps}\n spinnerProps={spinnerProps}\n startIconProps={startIconProps}\n endIconProps={endIconProps}\n isLoading={isLoading}\n twClassName={getContainerClassName}\n textClassName={getTextClassName}\n iconClassName={getTextClassName}\n style={style}\n {...props}\n >\n {children}\n </ButtonBase>\n );\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ButtonPrimary.d.cts","sourceRoot":"","sources":["../../../../../src/components/Button/variants/ButtonPrimary/ButtonPrimary.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsB,cAAc;
|
|
1
|
+
{"version":3,"file":"ButtonPrimary.d.cts","sourceRoot":"","sources":["../../../../../src/components/Button/variants/ButtonPrimary/ButtonPrimary.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsB,cAAc;AAI3C,OAAO,KAAK,EAAE,kBAAkB,EAAE,kCAA8B;AAIhE,eAAO,MAAM,aAAa,sIAYvB,kBAAkB,sBAsDpB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ButtonPrimary.d.mts","sourceRoot":"","sources":["../../../../../src/components/Button/variants/ButtonPrimary/ButtonPrimary.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsB,cAAc;
|
|
1
|
+
{"version":3,"file":"ButtonPrimary.d.mts","sourceRoot":"","sources":["../../../../../src/components/Button/variants/ButtonPrimary/ButtonPrimary.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsB,cAAc;AAI3C,OAAO,KAAK,EAAE,kBAAkB,EAAE,kCAA8B;AAIhE,eAAO,MAAM,aAAa,sIAYvB,kBAAkB,sBAsDpB,CAAC"}
|
|
@@ -7,8 +7,6 @@ function $importDefault(module) {
|
|
|
7
7
|
import $React, { useCallback } from "react";
|
|
8
8
|
const React = $importDefault($React);
|
|
9
9
|
import { ButtonBase } from "../../../ButtonBase/index.mjs";
|
|
10
|
-
import { IconSize } from "../../../Icon/index.mjs";
|
|
11
|
-
import { TextVariant, FontWeight } from "../../../Text/index.mjs";
|
|
12
10
|
// Internal Button variant.
|
|
13
11
|
// Consumers should use `Button` with `variant`.
|
|
14
12
|
export const ButtonPrimary = ({ children, textProps, spinnerProps, startIconProps, endIconProps, isDanger = false, isInverse = false, isLoading = false, twClassName = '', style, ...props }) => {
|
|
@@ -39,21 +37,7 @@ export const ButtonPrimary = ({ children, textProps, spinnerProps, startIconProp
|
|
|
39
37
|
}
|
|
40
38
|
return 'text-primary-inverse';
|
|
41
39
|
}, [isInverse, isDanger, isLoading]);
|
|
42
|
-
return (<ButtonBase textProps={{
|
|
43
|
-
variant: TextVariant.BodyMd,
|
|
44
|
-
fontWeight: FontWeight.Medium,
|
|
45
|
-
numberOfLines: 1,
|
|
46
|
-
ellipsizeMode: 'clip',
|
|
47
|
-
...textProps,
|
|
48
|
-
}} spinnerProps={{
|
|
49
|
-
...spinnerProps,
|
|
50
|
-
}} startIconProps={{
|
|
51
|
-
size: IconSize.Sm,
|
|
52
|
-
...startIconProps,
|
|
53
|
-
}} endIconProps={{
|
|
54
|
-
size: IconSize.Sm,
|
|
55
|
-
...endIconProps,
|
|
56
|
-
}} isLoading={isLoading} twClassName={getContainerClassName} textClassName={getTextClassName} iconClassName={getTextClassName} style={style} {...props}>
|
|
40
|
+
return (<ButtonBase textProps={textProps} spinnerProps={spinnerProps} startIconProps={startIconProps} endIconProps={endIconProps} isLoading={isLoading} twClassName={getContainerClassName} textClassName={getTextClassName} iconClassName={getTextClassName} style={style} {...props}>
|
|
57
41
|
{children}
|
|
58
42
|
</ButtonBase>);
|
|
59
43
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ButtonPrimary.mjs","sourceRoot":"","sources":["../../../../../src/components/Button/variants/ButtonPrimary/ButtonPrimary.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,QAAO,EAAE,WAAW,EAAE,cAAc;;AAE3C,OAAO,EAAE,UAAU,EAAE,sCAA4B;
|
|
1
|
+
{"version":3,"file":"ButtonPrimary.mjs","sourceRoot":"","sources":["../../../../../src/components/Button/variants/ButtonPrimary/ButtonPrimary.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,QAAO,EAAE,WAAW,EAAE,cAAc;;AAE3C,OAAO,EAAE,UAAU,EAAE,sCAA4B;AAIjD,2BAA2B;AAC3B,gDAAgD;AAChD,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,EAC5B,QAAQ,EACR,SAAS,EACT,YAAY,EACZ,cAAc,EACd,YAAY,EACZ,QAAQ,GAAG,KAAK,EAChB,SAAS,GAAG,KAAK,EACjB,SAAS,GAAG,KAAK,EACjB,WAAW,GAAG,EAAE,EAChB,KAAK,EACL,GAAG,KAAK,EACW,EAAE,EAAE;IACvB,MAAM,qBAAqB,GAAG,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ACT,SAAS,CAAC,CAAC,SAAS,CAAC,CACrB,YAAY,CAAC,CAAC,YAAY,CAAC,CAC3B,cAAc,CAAC,CAAC,cAAc,CAAC,CAC/B,YAAY,CAAC,CAAC,YAAY,CAAC,CAC3B,SAAS,CAAC,CAAC,SAAS,CAAC,CACrB,WAAW,CAAC,CAAC,qBAAqB,CAAC,CACnC,aAAa,CAAC,CAAC,gBAAgB,CAAC,CAChC,aAAa,CAAC,CAAC,gBAAgB,CAAC,CAChC,KAAK,CAAC,CAAC,KAAK,CAAC,CACb,IAAI,KAAK,CAAC,CAEV;MAAA,CAAC,QAAQ,CACX;IAAA,EAAE,UAAU,CAAC,CACd,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import React, { useCallback } from 'react';\n\nimport { ButtonBase } from '../../../ButtonBase';\n\nimport type { ButtonPrimaryProps } from './ButtonPrimary.types';\n\n// Internal Button variant.\n// Consumers should use `Button` with `variant`.\nexport const ButtonPrimary = ({\n children,\n textProps,\n spinnerProps,\n startIconProps,\n endIconProps,\n isDanger = false,\n isInverse = false,\n isLoading = false,\n twClassName = '',\n style,\n ...props\n}: ButtonPrimaryProps) => {\n const getContainerClassName = useCallback(\n (pressed: boolean): string => {\n const classNameStr =\n typeof twClassName === 'function' ? twClassName(pressed) : twClassName;\n\n if (isInverse && isDanger) {\n return `${pressed || isLoading ? 'bg-default-pressed' : 'bg-default'} ${classNameStr}`;\n }\n if (isDanger) {\n return `${pressed || isLoading ? 'bg-error-default-pressed' : 'bg-error-default'} ${classNameStr}`;\n }\n if (isInverse) {\n return `${pressed || isLoading ? 'bg-default-pressed' : 'bg-default'} ${classNameStr}`;\n }\n return `${pressed || isLoading ? 'bg-icon-default-pressed' : 'bg-icon-default'} ${classNameStr}`;\n },\n [isInverse, isDanger, isLoading, twClassName],\n );\n\n const getTextClassName = useCallback(\n (pressed: boolean): string => {\n if (isInverse && isDanger) {\n return pressed || isLoading\n ? 'text-error-default-pressed'\n : 'text-error-default';\n }\n if (isDanger) {\n return 'text-primary-inverse';\n }\n if (isInverse) {\n return 'text-default';\n }\n return 'text-primary-inverse';\n },\n [isInverse, isDanger, isLoading],\n );\n\n return (\n <ButtonBase\n textProps={textProps}\n spinnerProps={spinnerProps}\n startIconProps={startIconProps}\n endIconProps={endIconProps}\n isLoading={isLoading}\n twClassName={getContainerClassName}\n textClassName={getTextClassName}\n iconClassName={getTextClassName}\n style={style}\n {...props}\n >\n {children}\n </ButtonBase>\n );\n};\n"]}
|
|
@@ -26,8 +26,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
26
26
|
exports.ButtonSecondary = void 0;
|
|
27
27
|
const react_1 = __importStar(require("react"));
|
|
28
28
|
const ButtonBase_1 = require("../../../ButtonBase/index.cjs");
|
|
29
|
-
const Icon_1 = require("../../../Icon/index.cjs");
|
|
30
|
-
const Text_1 = require("../../../Text/index.cjs");
|
|
31
29
|
// Internal Button variant.
|
|
32
30
|
// Consumers should use `Button` with `variant`.
|
|
33
31
|
const ButtonSecondary = ({ children, textProps, spinnerProps, startIconProps, endIconProps, isDanger = false, isInverse = false, isLoading = false, twClassName = '', style, ...props }) => {
|
|
@@ -75,21 +73,7 @@ const ButtonSecondary = ({ children, textProps, spinnerProps, startIconProps, en
|
|
|
75
73
|
}
|
|
76
74
|
return 'text-default';
|
|
77
75
|
}, [isDanger, isInverse, isLoading]);
|
|
78
|
-
return (<ButtonBase_1.ButtonBase textProps={{
|
|
79
|
-
variant: Text_1.TextVariant.BodyMd,
|
|
80
|
-
fontWeight: Text_1.FontWeight.Medium,
|
|
81
|
-
numberOfLines: 1,
|
|
82
|
-
ellipsizeMode: 'clip',
|
|
83
|
-
...textProps,
|
|
84
|
-
}} spinnerProps={{
|
|
85
|
-
...spinnerProps,
|
|
86
|
-
}} startIconProps={{
|
|
87
|
-
size: Icon_1.IconSize.Sm,
|
|
88
|
-
...startIconProps,
|
|
89
|
-
}} endIconProps={{
|
|
90
|
-
size: Icon_1.IconSize.Sm,
|
|
91
|
-
...endIconProps,
|
|
92
|
-
}} isLoading={isLoading} twClassName={getContainerClassName} textClassName={getTextClassName} iconClassName={getTextClassName} style={style} {...props}>
|
|
76
|
+
return (<ButtonBase_1.ButtonBase textProps={textProps} spinnerProps={spinnerProps} startIconProps={startIconProps} endIconProps={endIconProps} isLoading={isLoading} twClassName={getContainerClassName} textClassName={getTextClassName} iconClassName={getTextClassName} style={style} {...props}>
|
|
93
77
|
{children}
|
|
94
78
|
</ButtonBase_1.ButtonBase>);
|
|
95
79
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ButtonSecondary.cjs","sourceRoot":"","sources":["../../../../../src/components/Button/variants/ButtonSecondary/ButtonSecondary.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAA2C;AAE3C,8DAAiD;
|
|
1
|
+
{"version":3,"file":"ButtonSecondary.cjs","sourceRoot":"","sources":["../../../../../src/components/Button/variants/ButtonSecondary/ButtonSecondary.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAA2C;AAE3C,8DAAiD;AAIjD,2BAA2B;AAC3B,gDAAgD;AACzC,MAAM,eAAe,GAAG,CAAC,EAC9B,QAAQ,EACR,SAAS,EACT,YAAY,EACZ,cAAc,EACd,YAAY,EACZ,QAAQ,GAAG,KAAK,EAChB,SAAS,GAAG,KAAK,EACjB,SAAS,GAAG,KAAK,EACjB,WAAW,GAAG,EAAE,EAChB,KAAK,EACL,GAAG,KAAK,EACa,EAAE,EAAE;IACzB,MAAM,qBAAqB,GAAG,IAAA,mBAAW,EACvC,CAAC,OAAgB,EAAU,EAAE;QAC3B,MAAM,YAAY,GAChB,OAAO,WAAW,KAAK,UAAU,CAAC,CAAC,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC;QAEzE,MAAM,WAAW,GAAG;;UAEhB,YAAY;OACf,CAAC;QAEF,IAAI,eAAe,GAAG,EAAE,CAAC;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C,uBAAU,CACT,SAAS,CAAC,CAAC,SAAS,CAAC,CACrB,YAAY,CAAC,CAAC,YAAY,CAAC,CAC3B,cAAc,CAAC,CAAC,cAAc,CAAC,CAC/B,YAAY,CAAC,CAAC,YAAY,CAAC,CAC3B,SAAS,CAAC,CAAC,SAAS,CAAC,CACrB,WAAW,CAAC,CAAC,qBAAqB,CAAC,CACnC,aAAa,CAAC,CAAC,gBAAgB,CAAC,CAChC,aAAa,CAAC,CAAC,gBAAgB,CAAC,CAChC,KAAK,CAAC,CAAC,KAAK,CAAC,CACb,IAAI,KAAK,CAAC,CAEV;MAAA,CAAC,QAAQ,CACX;IAAA,EAAE,uBAAU,CAAC,CACd,CAAC;AACJ,CAAC,CAAC;AAnFW,QAAA,eAAe,mBAmF1B","sourcesContent":["import React, { useCallback } from 'react';\n\nimport { ButtonBase } from '../../../ButtonBase';\n\nimport type { ButtonSecondaryProps } from './ButtonSecondary.types';\n\n// Internal Button variant.\n// Consumers should use `Button` with `variant`.\nexport const ButtonSecondary = ({\n children,\n textProps,\n spinnerProps,\n startIconProps,\n endIconProps,\n isDanger = false,\n isInverse = false,\n isLoading = false,\n twClassName = '',\n style,\n ...props\n}: ButtonSecondaryProps) => {\n const getContainerClassName = useCallback(\n (pressed: boolean): string => {\n const classNameStr =\n typeof twClassName === 'function' ? twClassName(pressed) : twClassName;\n\n const baseClasses = `\n border\n ${classNameStr}\n `;\n\n let backgroundClass = '';\n let borderClass = '';\n\n if (isInverse && isDanger) {\n backgroundClass =\n pressed || isLoading ? 'bg-default-pressed' : 'bg-default';\n borderClass =\n pressed || isLoading\n ? 'border-background-default-pressed'\n : 'border-background-default';\n } else if (isDanger) {\n backgroundClass =\n pressed || isLoading ? 'bg-muted-pressed' : 'bg-muted';\n borderClass = 'border-transparent';\n } else if (isInverse) {\n backgroundClass =\n pressed || isLoading ? 'bg-pressed' : 'bg-transparent';\n borderClass = 'border-primary-inverse';\n } else {\n backgroundClass =\n pressed || isLoading ? 'bg-muted-pressed' : 'bg-muted';\n borderClass = 'border-transparent';\n }\n\n return `${backgroundClass} ${borderClass} ${baseClasses}`;\n },\n [isInverse, isDanger, isLoading, twClassName],\n );\n\n const getTextClassName = useCallback(\n (pressed: boolean): string => {\n if (isDanger) {\n return pressed || isLoading\n ? 'text-error-default-pressed'\n : 'text-error-default';\n }\n if (isInverse) {\n return 'text-primary-inverse';\n }\n return 'text-default';\n },\n [isDanger, isInverse, isLoading],\n );\n\n return (\n <ButtonBase\n textProps={textProps}\n spinnerProps={spinnerProps}\n startIconProps={startIconProps}\n endIconProps={endIconProps}\n isLoading={isLoading}\n twClassName={getContainerClassName}\n textClassName={getTextClassName}\n iconClassName={getTextClassName}\n style={style}\n {...props}\n >\n {children}\n </ButtonBase>\n );\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ButtonSecondary.d.cts","sourceRoot":"","sources":["../../../../../src/components/Button/variants/ButtonSecondary/ButtonSecondary.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsB,cAAc;
|
|
1
|
+
{"version":3,"file":"ButtonSecondary.d.cts","sourceRoot":"","sources":["../../../../../src/components/Button/variants/ButtonSecondary/ButtonSecondary.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsB,cAAc;AAI3C,OAAO,KAAK,EAAE,oBAAoB,EAAE,oCAAgC;AAIpE,eAAO,MAAM,eAAe,sIAYzB,oBAAoB,sBAuEtB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ButtonSecondary.d.mts","sourceRoot":"","sources":["../../../../../src/components/Button/variants/ButtonSecondary/ButtonSecondary.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsB,cAAc;
|
|
1
|
+
{"version":3,"file":"ButtonSecondary.d.mts","sourceRoot":"","sources":["../../../../../src/components/Button/variants/ButtonSecondary/ButtonSecondary.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsB,cAAc;AAI3C,OAAO,KAAK,EAAE,oBAAoB,EAAE,oCAAgC;AAIpE,eAAO,MAAM,eAAe,sIAYzB,oBAAoB,sBAuEtB,CAAC"}
|
|
@@ -7,8 +7,6 @@ function $importDefault(module) {
|
|
|
7
7
|
import $React, { useCallback } from "react";
|
|
8
8
|
const React = $importDefault($React);
|
|
9
9
|
import { ButtonBase } from "../../../ButtonBase/index.mjs";
|
|
10
|
-
import { IconSize } from "../../../Icon/index.mjs";
|
|
11
|
-
import { TextVariant, FontWeight } from "../../../Text/index.mjs";
|
|
12
10
|
// Internal Button variant.
|
|
13
11
|
// Consumers should use `Button` with `variant`.
|
|
14
12
|
export const ButtonSecondary = ({ children, textProps, spinnerProps, startIconProps, endIconProps, isDanger = false, isInverse = false, isLoading = false, twClassName = '', style, ...props }) => {
|
|
@@ -56,21 +54,7 @@ export const ButtonSecondary = ({ children, textProps, spinnerProps, startIconPr
|
|
|
56
54
|
}
|
|
57
55
|
return 'text-default';
|
|
58
56
|
}, [isDanger, isInverse, isLoading]);
|
|
59
|
-
return (<ButtonBase textProps={{
|
|
60
|
-
variant: TextVariant.BodyMd,
|
|
61
|
-
fontWeight: FontWeight.Medium,
|
|
62
|
-
numberOfLines: 1,
|
|
63
|
-
ellipsizeMode: 'clip',
|
|
64
|
-
...textProps,
|
|
65
|
-
}} spinnerProps={{
|
|
66
|
-
...spinnerProps,
|
|
67
|
-
}} startIconProps={{
|
|
68
|
-
size: IconSize.Sm,
|
|
69
|
-
...startIconProps,
|
|
70
|
-
}} endIconProps={{
|
|
71
|
-
size: IconSize.Sm,
|
|
72
|
-
...endIconProps,
|
|
73
|
-
}} isLoading={isLoading} twClassName={getContainerClassName} textClassName={getTextClassName} iconClassName={getTextClassName} style={style} {...props}>
|
|
57
|
+
return (<ButtonBase textProps={textProps} spinnerProps={spinnerProps} startIconProps={startIconProps} endIconProps={endIconProps} isLoading={isLoading} twClassName={getContainerClassName} textClassName={getTextClassName} iconClassName={getTextClassName} style={style} {...props}>
|
|
74
58
|
{children}
|
|
75
59
|
</ButtonBase>);
|
|
76
60
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ButtonSecondary.mjs","sourceRoot":"","sources":["../../../../../src/components/Button/variants/ButtonSecondary/ButtonSecondary.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,QAAO,EAAE,WAAW,EAAE,cAAc;;AAE3C,OAAO,EAAE,UAAU,EAAE,sCAA4B;
|
|
1
|
+
{"version":3,"file":"ButtonSecondary.mjs","sourceRoot":"","sources":["../../../../../src/components/Button/variants/ButtonSecondary/ButtonSecondary.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,QAAO,EAAE,WAAW,EAAE,cAAc;;AAE3C,OAAO,EAAE,UAAU,EAAE,sCAA4B;AAIjD,2BAA2B;AAC3B,gDAAgD;AAChD,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,EAC9B,QAAQ,EACR,SAAS,EACT,YAAY,EACZ,cAAc,EACd,YAAY,EACZ,QAAQ,GAAG,KAAK,EAChB,SAAS,GAAG,KAAK,EACjB,SAAS,GAAG,KAAK,EACjB,WAAW,GAAG,EAAE,EAChB,KAAK,EACL,GAAG,KAAK,EACa,EAAE,EAAE;IACzB,MAAM,qBAAqB,GAAG,WAAW,CACvC,CAAC,OAAgB,EAAU,EAAE;QAC3B,MAAM,YAAY,GAChB,OAAO,WAAW,KAAK,UAAU,CAAC,CAAC,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC;QAEzE,MAAM,WAAW,GAAG;;UAEhB,YAAY;OACf,CAAC;QAEF,IAAI,eAAe,GAAG,EAAE,CAAC;QACzB,IAAI,WAAW,GAAG,EAAE,CAAC;QAErB,IAAI,SAAS,IAAI,QAAQ,EAAE;YACzB,eAAe;gBACb,OAAO,IAAI,SAAS,CAAC,CAAC,CAAC,oBAAoB,CAAC,CAAC,CAAC,YAAY,CAAC;YAC7D,WAAW;gBACT,OAAO,IAAI,SAAS;oBAClB,CAAC,CAAC,mCAAmC;oBACr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AAC,CAAC,gBAAgB,CAAC,CAChC,aAAa,CAAC,CAAC,gBAAgB,CAAC,CAChC,KAAK,CAAC,CAAC,KAAK,CAAC,CACb,IAAI,KAAK,CAAC,CAEV;MAAA,CAAC,QAAQ,CACX;IAAA,EAAE,UAAU,CAAC,CACd,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import React, { useCallback } from 'react';\n\nimport { ButtonBase } from '../../../ButtonBase';\n\nimport type { ButtonSecondaryProps } from './ButtonSecondary.types';\n\n// Internal Button variant.\n// Consumers should use `Button` with `variant`.\nexport const ButtonSecondary = ({\n children,\n textProps,\n spinnerProps,\n startIconProps,\n endIconProps,\n isDanger = false,\n isInverse = false,\n isLoading = false,\n twClassName = '',\n style,\n ...props\n}: ButtonSecondaryProps) => {\n const getContainerClassName = useCallback(\n (pressed: boolean): string => {\n const classNameStr =\n typeof twClassName === 'function' ? twClassName(pressed) : twClassName;\n\n const baseClasses = `\n border\n ${classNameStr}\n `;\n\n let backgroundClass = '';\n let borderClass = '';\n\n if (isInverse && isDanger) {\n backgroundClass =\n pressed || isLoading ? 'bg-default-pressed' : 'bg-default';\n borderClass =\n pressed || isLoading\n ? 'border-background-default-pressed'\n : 'border-background-default';\n } else if (isDanger) {\n backgroundClass =\n pressed || isLoading ? 'bg-muted-pressed' : 'bg-muted';\n borderClass = 'border-transparent';\n } else if (isInverse) {\n backgroundClass =\n pressed || isLoading ? 'bg-pressed' : 'bg-transparent';\n borderClass = 'border-primary-inverse';\n } else {\n backgroundClass =\n pressed || isLoading ? 'bg-muted-pressed' : 'bg-muted';\n borderClass = 'border-transparent';\n }\n\n return `${backgroundClass} ${borderClass} ${baseClasses}`;\n },\n [isInverse, isDanger, isLoading, twClassName],\n );\n\n const getTextClassName = useCallback(\n (pressed: boolean): string => {\n if (isDanger) {\n return pressed || isLoading\n ? 'text-error-default-pressed'\n : 'text-error-default';\n }\n if (isInverse) {\n return 'text-primary-inverse';\n }\n return 'text-default';\n },\n [isDanger, isInverse, isLoading],\n );\n\n return (\n <ButtonBase\n textProps={textProps}\n spinnerProps={spinnerProps}\n startIconProps={startIconProps}\n endIconProps={endIconProps}\n isLoading={isLoading}\n twClassName={getContainerClassName}\n textClassName={getTextClassName}\n iconClassName={getTextClassName}\n style={style}\n {...props}\n >\n {children}\n </ButtonBase>\n );\n};\n"]}
|
|
@@ -26,8 +26,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
26
26
|
exports.ButtonTertiary = void 0;
|
|
27
27
|
const react_1 = __importStar(require("react"));
|
|
28
28
|
const ButtonBase_1 = require("../../../ButtonBase/index.cjs");
|
|
29
|
-
const Icon_1 = require("../../../Icon/index.cjs");
|
|
30
|
-
const Text_1 = require("../../../Text/index.cjs");
|
|
31
29
|
// Internal Button variant.
|
|
32
30
|
// Consumers should use `Button` with `variant`.
|
|
33
31
|
const ButtonTertiary = ({ children, textProps, spinnerProps, startIconProps, endIconProps, isDanger = false, isInverse = false, isLoading = false, twClassName = '', style, ...props }) => {
|
|
@@ -82,21 +80,7 @@ const ButtonTertiary = ({ children, textProps, spinnerProps, startIconProps, end
|
|
|
82
80
|
// Use neutral text color for all states (default, pressed, loading)
|
|
83
81
|
return 'text-default';
|
|
84
82
|
}, [isDanger, isInverse, isLoading]);
|
|
85
|
-
return (<ButtonBase_1.ButtonBase textProps={{
|
|
86
|
-
variant: Text_1.TextVariant.BodyMd,
|
|
87
|
-
fontWeight: Text_1.FontWeight.Medium,
|
|
88
|
-
numberOfLines: 1,
|
|
89
|
-
ellipsizeMode: 'clip',
|
|
90
|
-
...textProps,
|
|
91
|
-
}} spinnerProps={{
|
|
92
|
-
...spinnerProps,
|
|
93
|
-
}} startIconProps={{
|
|
94
|
-
size: Icon_1.IconSize.Sm,
|
|
95
|
-
...startIconProps,
|
|
96
|
-
}} endIconProps={{
|
|
97
|
-
size: Icon_1.IconSize.Sm,
|
|
98
|
-
...endIconProps,
|
|
99
|
-
}} isLoading={isLoading} twClassName={getContainerClassName} textClassName={getTextClassName} iconClassName={getTextClassName} style={style} {...props}>
|
|
83
|
+
return (<ButtonBase_1.ButtonBase textProps={textProps} spinnerProps={spinnerProps} startIconProps={startIconProps} endIconProps={endIconProps} isLoading={isLoading} twClassName={getContainerClassName} textClassName={getTextClassName} iconClassName={getTextClassName} style={style} {...props}>
|
|
100
84
|
{children}
|
|
101
85
|
</ButtonBase_1.ButtonBase>);
|
|
102
86
|
};
|