@metamask-previews/design-system-react 0.20.0-preview.f515a62 → 0.23.1-preview.047f96c
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +49 -1
- package/dist/components/AvatarGroup/AvatarGroup.cjs +18 -13
- package/dist/components/AvatarGroup/AvatarGroup.cjs.map +1 -1
- package/dist/components/AvatarGroup/AvatarGroup.constants.cjs +16 -17
- package/dist/components/AvatarGroup/AvatarGroup.constants.cjs.map +1 -1
- package/dist/components/AvatarGroup/AvatarGroup.constants.d.cts +1 -2
- package/dist/components/AvatarGroup/AvatarGroup.constants.d.cts.map +1 -1
- package/dist/components/AvatarGroup/AvatarGroup.constants.d.mts +1 -2
- package/dist/components/AvatarGroup/AvatarGroup.constants.d.mts.map +1 -1
- package/dist/components/AvatarGroup/AvatarGroup.constants.mjs +1 -2
- package/dist/components/AvatarGroup/AvatarGroup.constants.mjs.map +1 -1
- package/dist/components/AvatarGroup/AvatarGroup.d.cts +8 -21
- package/dist/components/AvatarGroup/AvatarGroup.d.cts.map +1 -1
- package/dist/components/AvatarGroup/AvatarGroup.d.mts +8 -21
- package/dist/components/AvatarGroup/AvatarGroup.d.mts.map +1 -1
- package/dist/components/AvatarGroup/AvatarGroup.mjs +9 -4
- package/dist/components/AvatarGroup/AvatarGroup.mjs.map +1 -1
- package/dist/components/AvatarGroup/AvatarGroup.types.cjs.map +1 -1
- package/dist/components/AvatarGroup/AvatarGroup.types.d.cts +7 -24
- package/dist/components/AvatarGroup/AvatarGroup.types.d.cts.map +1 -1
- package/dist/components/AvatarGroup/AvatarGroup.types.d.mts +7 -24
- package/dist/components/AvatarGroup/AvatarGroup.types.d.mts.map +1 -1
- package/dist/components/AvatarGroup/AvatarGroup.types.mjs.map +1 -1
- package/dist/components/AvatarGroup/index.cjs +3 -3
- package/dist/components/AvatarGroup/index.cjs.map +1 -1
- package/dist/components/AvatarGroup/index.d.cts +1 -1
- package/dist/components/AvatarGroup/index.d.cts.map +1 -1
- package/dist/components/AvatarGroup/index.d.mts +1 -1
- package/dist/components/AvatarGroup/index.d.mts.map +1 -1
- package/dist/components/AvatarGroup/index.mjs +1 -1
- package/dist/components/AvatarGroup/index.mjs.map +1 -1
- package/dist/components/BannerAlert/BannerAlert.d.cts +60 -34
- package/dist/components/BannerAlert/BannerAlert.d.cts.map +1 -1
- package/dist/components/BannerAlert/BannerAlert.d.mts +60 -34
- package/dist/components/BannerAlert/BannerAlert.d.mts.map +1 -1
- package/dist/components/BannerBase/BannerBase.cjs +3 -3
- package/dist/components/BannerBase/BannerBase.cjs.map +1 -1
- package/dist/components/BannerBase/BannerBase.d.cts +60 -34
- package/dist/components/BannerBase/BannerBase.d.cts.map +1 -1
- package/dist/components/BannerBase/BannerBase.d.mts +60 -34
- package/dist/components/BannerBase/BannerBase.d.mts.map +1 -1
- package/dist/components/BannerBase/BannerBase.mjs +3 -3
- 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 +1 -5
- package/dist/components/BannerBase/BannerBase.types.d.cts.map +1 -1
- package/dist/components/BannerBase/BannerBase.types.d.mts +1 -5
- package/dist/components/BannerBase/BannerBase.types.d.mts.map +1 -1
- package/dist/components/BannerBase/BannerBase.types.mjs.map +1 -1
- package/dist/components/ButtonBase/ButtonBase.cjs +26 -18
- 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.map +1 -1
- package/dist/components/ButtonBase/ButtonBase.d.mts.map +1 -1
- package/dist/components/ButtonBase/ButtonBase.mjs +28 -20
- package/dist/components/ButtonBase/ButtonBase.mjs.map +1 -1
- package/dist/components/HeaderBase/HeaderBase.cjs +43 -0
- package/dist/components/HeaderBase/HeaderBase.cjs.map +1 -0
- package/dist/components/HeaderBase/HeaderBase.d.cts +4 -0
- package/dist/components/HeaderBase/HeaderBase.d.cts.map +1 -0
- package/dist/components/HeaderBase/HeaderBase.d.mts +4 -0
- package/dist/components/HeaderBase/HeaderBase.d.mts.map +1 -0
- package/dist/components/HeaderBase/HeaderBase.mjs +24 -0
- package/dist/components/HeaderBase/HeaderBase.mjs.map +1 -0
- package/dist/components/HeaderBase/HeaderBase.types.cjs +3 -0
- package/dist/components/HeaderBase/HeaderBase.types.cjs.map +1 -0
- package/dist/components/HeaderBase/HeaderBase.types.d.cts +51 -0
- package/dist/components/HeaderBase/HeaderBase.types.d.cts.map +1 -0
- package/dist/components/HeaderBase/HeaderBase.types.d.mts +51 -0
- package/dist/components/HeaderBase/HeaderBase.types.d.mts.map +1 -0
- package/dist/components/HeaderBase/HeaderBase.types.mjs +2 -0
- package/dist/components/HeaderBase/HeaderBase.types.mjs.map +1 -0
- package/dist/components/HeaderBase/index.cjs +6 -0
- package/dist/components/HeaderBase/index.cjs.map +1 -0
- package/dist/components/HeaderBase/index.d.cts +3 -0
- package/dist/components/HeaderBase/index.d.cts.map +1 -0
- package/dist/components/HeaderBase/index.d.mts +3 -0
- package/dist/components/HeaderBase/index.d.mts.map +1 -0
- package/dist/components/HeaderBase/index.mjs +2 -0
- package/dist/components/HeaderBase/index.mjs.map +1 -0
- package/dist/components/HelpText/HelpText.cjs +13 -0
- package/dist/components/HelpText/HelpText.cjs.map +1 -0
- package/dist/components/HelpText/HelpText.constants.cjs +11 -0
- package/dist/components/HelpText/HelpText.constants.cjs.map +1 -0
- package/dist/components/HelpText/HelpText.constants.d.cts +3 -0
- package/dist/components/HelpText/HelpText.constants.d.cts.map +1 -0
- package/dist/components/HelpText/HelpText.constants.d.mts +3 -0
- package/dist/components/HelpText/HelpText.constants.d.mts.map +1 -0
- package/dist/components/HelpText/HelpText.constants.mjs +8 -0
- package/dist/components/HelpText/HelpText.constants.mjs.map +1 -0
- package/dist/components/HelpText/HelpText.d.cts +4 -0
- package/dist/components/HelpText/HelpText.d.cts.map +1 -0
- package/dist/components/HelpText/HelpText.d.mts +4 -0
- package/dist/components/HelpText/HelpText.d.mts.map +1 -0
- package/dist/components/HelpText/HelpText.mjs +13 -0
- package/dist/components/HelpText/HelpText.mjs.map +1 -0
- package/dist/components/HelpText/HelpText.types.cjs +3 -0
- package/dist/components/HelpText/HelpText.types.cjs.map +1 -0
- package/dist/components/HelpText/HelpText.types.d.cts +9 -0
- package/dist/components/HelpText/HelpText.types.d.cts.map +1 -0
- package/dist/components/HelpText/HelpText.types.d.mts +9 -0
- package/dist/components/HelpText/HelpText.types.d.mts.map +1 -0
- package/dist/components/HelpText/HelpText.types.mjs +2 -0
- package/dist/components/HelpText/HelpText.types.mjs.map +1 -0
- package/dist/components/HelpText/index.cjs +8 -0
- package/dist/components/HelpText/index.cjs.map +1 -0
- package/dist/components/HelpText/index.d.cts +4 -0
- package/dist/components/HelpText/index.d.cts.map +1 -0
- package/dist/components/HelpText/index.d.mts +4 -0
- package/dist/components/HelpText/index.d.mts.map +1 -0
- package/dist/components/HelpText/index.mjs +3 -0
- package/dist/components/HelpText/index.mjs.map +1 -0
- package/dist/components/Icon/icons/Candlestick.cjs +1 -1
- package/dist/components/Icon/icons/Candlestick.cjs.map +1 -1
- package/dist/components/Icon/icons/Candlestick.mjs +1 -1
- package/dist/components/Icon/icons/Candlestick.mjs.map +1 -1
- package/dist/components/Icon/icons/Group.cjs +32 -0
- package/dist/components/Icon/icons/Group.cjs.map +1 -0
- package/dist/components/Icon/icons/Group.d.cts +4 -0
- package/dist/components/Icon/icons/Group.d.cts.map +1 -0
- package/dist/components/Icon/icons/Group.d.mts +4 -0
- package/dist/components/Icon/icons/Group.d.mts.map +1 -0
- package/dist/components/Icon/icons/Group.mjs +7 -0
- package/dist/components/Icon/icons/Group.mjs.map +1 -0
- package/dist/components/Icon/icons/ListArrow.cjs +32 -0
- package/dist/components/Icon/icons/ListArrow.cjs.map +1 -0
- package/dist/components/Icon/icons/ListArrow.d.cts +4 -0
- package/dist/components/Icon/icons/ListArrow.d.cts.map +1 -0
- package/dist/components/Icon/icons/ListArrow.d.mts +4 -0
- package/dist/components/Icon/icons/ListArrow.d.mts.map +1 -0
- package/dist/components/Icon/icons/ListArrow.mjs +7 -0
- package/dist/components/Icon/icons/ListArrow.mjs.map +1 -0
- package/dist/components/Icon/icons/Merge.cjs +32 -0
- package/dist/components/Icon/icons/Merge.cjs.map +1 -0
- package/dist/components/Icon/icons/Merge.d.cts +4 -0
- package/dist/components/Icon/icons/Merge.d.cts.map +1 -0
- package/dist/components/Icon/icons/Merge.d.mts +4 -0
- package/dist/components/Icon/icons/Merge.d.mts.map +1 -0
- package/dist/components/Icon/icons/Merge.mjs +7 -0
- package/dist/components/Icon/icons/Merge.mjs.map +1 -0
- package/dist/components/Icon/icons/Musd.cjs +32 -0
- package/dist/components/Icon/icons/Musd.cjs.map +1 -0
- package/dist/components/Icon/icons/Musd.d.cts +4 -0
- package/dist/components/Icon/icons/Musd.d.cts.map +1 -0
- package/dist/components/Icon/icons/Musd.d.mts +4 -0
- package/dist/components/Icon/icons/Musd.d.mts.map +1 -0
- package/dist/components/Icon/icons/Musd.mjs +7 -0
- package/dist/components/Icon/icons/Musd.mjs.map +1 -0
- package/dist/components/Icon/icons/MusdFilled.cjs +32 -0
- package/dist/components/Icon/icons/MusdFilled.cjs.map +1 -0
- package/dist/components/Icon/icons/MusdFilled.d.cts +4 -0
- package/dist/components/Icon/icons/MusdFilled.d.cts.map +1 -0
- package/dist/components/Icon/icons/MusdFilled.d.mts +4 -0
- package/dist/components/Icon/icons/MusdFilled.d.mts.map +1 -0
- package/dist/components/Icon/icons/MusdFilled.mjs +7 -0
- package/dist/components/Icon/icons/MusdFilled.mjs.map +1 -0
- package/dist/components/Icon/icons/PieChart.cjs +32 -0
- package/dist/components/Icon/icons/PieChart.cjs.map +1 -0
- package/dist/components/Icon/icons/PieChart.d.cts +4 -0
- package/dist/components/Icon/icons/PieChart.d.cts.map +1 -0
- package/dist/components/Icon/icons/PieChart.d.mts +4 -0
- package/dist/components/Icon/icons/PieChart.d.mts.map +1 -0
- package/dist/components/Icon/icons/PieChart.mjs +7 -0
- package/dist/components/Icon/icons/PieChart.mjs.map +1 -0
- package/dist/components/Icon/icons/Predictions.cjs +32 -0
- package/dist/components/Icon/icons/Predictions.cjs.map +1 -0
- package/dist/components/Icon/icons/Predictions.d.cts +4 -0
- package/dist/components/Icon/icons/Predictions.d.cts.map +1 -0
- package/dist/components/Icon/icons/Predictions.d.mts +4 -0
- package/dist/components/Icon/icons/Predictions.d.mts.map +1 -0
- package/dist/components/Icon/icons/Predictions.mjs +7 -0
- package/dist/components/Icon/icons/Predictions.mjs.map +1 -0
- package/dist/components/Icon/icons/Telegram.cjs +1 -1
- package/dist/components/Icon/icons/Telegram.cjs.map +1 -1
- package/dist/components/Icon/icons/Telegram.mjs +1 -1
- package/dist/components/Icon/icons/Telegram.mjs.map +1 -1
- package/dist/components/Icon/icons/index.cjs +14 -0
- package/dist/components/Icon/icons/index.cjs.map +1 -1
- package/dist/components/Icon/icons/index.d.cts +7 -0
- package/dist/components/Icon/icons/index.d.cts.map +1 -1
- package/dist/components/Icon/icons/index.d.mts +7 -0
- package/dist/components/Icon/icons/index.d.mts.map +1 -1
- package/dist/components/Icon/icons/index.mjs +14 -0
- package/dist/components/Icon/icons/index.mjs.map +1 -1
- package/dist/components/Input/Input.cjs +4 -3
- package/dist/components/Input/Input.cjs.map +1 -1
- package/dist/components/Input/Input.d.cts +1 -5
- package/dist/components/Input/Input.d.cts.map +1 -1
- package/dist/components/Input/Input.d.mts +1 -5
- 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/Input/Input.types.cjs.map +1 -1
- package/dist/components/Input/Input.types.d.cts +2 -20
- package/dist/components/Input/Input.types.d.cts.map +1 -1
- package/dist/components/Input/Input.types.d.mts +2 -20
- package/dist/components/Input/Input.types.d.mts.map +1 -1
- package/dist/components/Input/Input.types.mjs.map +1 -1
- package/dist/components/Label/Label.cjs +38 -0
- package/dist/components/Label/Label.cjs.map +1 -0
- package/dist/components/Label/Label.d.cts +4 -0
- package/dist/components/Label/Label.d.cts.map +1 -0
- package/dist/components/Label/Label.d.mts +4 -0
- package/dist/components/Label/Label.d.mts.map +1 -0
- package/dist/components/Label/Label.mjs +19 -0
- package/dist/components/Label/Label.mjs.map +1 -0
- package/dist/components/Label/Label.types.cjs +3 -0
- package/dist/components/Label/Label.types.cjs.map +1 -0
- package/dist/components/Label/Label.types.d.cts +27 -0
- package/dist/components/Label/Label.types.d.cts.map +1 -0
- package/dist/components/Label/Label.types.d.mts +27 -0
- package/dist/components/Label/Label.types.d.mts.map +1 -0
- package/dist/components/Label/Label.types.mjs +2 -0
- package/dist/components/Label/Label.types.mjs.map +1 -0
- package/dist/components/Label/index.cjs +6 -0
- package/dist/components/Label/index.cjs.map +1 -0
- package/dist/components/Label/index.d.cts +3 -0
- package/dist/components/Label/index.d.cts.map +1 -0
- package/dist/components/Label/index.d.mts +3 -0
- package/dist/components/Label/index.d.mts.map +1 -0
- package/dist/components/Label/index.mjs +2 -0
- package/dist/components/Label/index.mjs.map +1 -0
- package/dist/components/Modal/Modal.cjs +49 -0
- package/dist/components/Modal/Modal.cjs.map +1 -0
- package/dist/components/Modal/Modal.context.cjs +14 -0
- package/dist/components/Modal/Modal.context.cjs.map +1 -0
- package/dist/components/Modal/Modal.context.d.cts +6 -0
- package/dist/components/Modal/Modal.context.d.cts.map +1 -0
- package/dist/components/Modal/Modal.context.d.mts +6 -0
- package/dist/components/Modal/Modal.context.d.mts.map +1 -0
- package/dist/components/Modal/Modal.context.mjs +10 -0
- package/dist/components/Modal/Modal.context.mjs.map +1 -0
- package/dist/components/Modal/Modal.d.cts +4 -0
- package/dist/components/Modal/Modal.d.cts.map +1 -0
- package/dist/components/Modal/Modal.d.mts +4 -0
- package/dist/components/Modal/Modal.d.mts.map +1 -0
- package/dist/components/Modal/Modal.mjs +30 -0
- package/dist/components/Modal/Modal.mjs.map +1 -0
- package/dist/components/Modal/Modal.types.cjs +3 -0
- package/dist/components/Modal/Modal.types.cjs.map +1 -0
- package/dist/components/Modal/Modal.types.d.cts +64 -0
- package/dist/components/Modal/Modal.types.d.cts.map +1 -0
- package/dist/components/Modal/Modal.types.d.mts +64 -0
- package/dist/components/Modal/Modal.types.d.mts.map +1 -0
- package/dist/components/Modal/Modal.types.mjs +2 -0
- package/dist/components/Modal/Modal.types.mjs.map +1 -0
- package/dist/components/Modal/index.cjs +8 -0
- package/dist/components/Modal/index.cjs.map +1 -0
- package/dist/components/Modal/index.d.cts +5 -0
- package/dist/components/Modal/index.d.cts.map +1 -0
- package/dist/components/Modal/index.d.mts +5 -0
- package/dist/components/Modal/index.d.mts.map +1 -0
- package/dist/components/Modal/index.mjs +3 -0
- package/dist/components/Modal/index.mjs.map +1 -0
- package/dist/components/ModalContent/ModalContent.cjs +73 -0
- package/dist/components/ModalContent/ModalContent.cjs.map +1 -0
- package/dist/components/ModalContent/ModalContent.constants.cjs +34 -0
- package/dist/components/ModalContent/ModalContent.constants.cjs.map +1 -0
- package/dist/components/ModalContent/ModalContent.constants.d.cts +31 -0
- package/dist/components/ModalContent/ModalContent.constants.d.cts.map +1 -0
- package/dist/components/ModalContent/ModalContent.constants.d.mts +31 -0
- package/dist/components/ModalContent/ModalContent.constants.d.mts.map +1 -0
- package/dist/components/ModalContent/ModalContent.constants.mjs +31 -0
- package/dist/components/ModalContent/ModalContent.constants.mjs.map +1 -0
- package/dist/components/ModalContent/ModalContent.d.cts +4 -0
- package/dist/components/ModalContent/ModalContent.d.cts.map +1 -0
- package/dist/components/ModalContent/ModalContent.d.mts +4 -0
- package/dist/components/ModalContent/ModalContent.d.mts.map +1 -0
- package/dist/components/ModalContent/ModalContent.mjs +54 -0
- package/dist/components/ModalContent/ModalContent.mjs.map +1 -0
- package/dist/components/ModalContent/ModalContent.types.cjs +15 -0
- package/dist/components/ModalContent/ModalContent.types.cjs.map +1 -0
- package/dist/components/ModalContent/ModalContent.types.d.cts +51 -0
- package/dist/components/ModalContent/ModalContent.types.d.cts.map +1 -0
- package/dist/components/ModalContent/ModalContent.types.d.mts +51 -0
- package/dist/components/ModalContent/ModalContent.types.d.mts.map +1 -0
- package/dist/components/ModalContent/ModalContent.types.mjs +12 -0
- package/dist/components/ModalContent/ModalContent.types.mjs.map +1 -0
- package/dist/components/ModalContent/index.cjs +10 -0
- package/dist/components/ModalContent/index.cjs.map +1 -0
- package/dist/components/ModalContent/index.d.cts +5 -0
- package/dist/components/ModalContent/index.d.cts.map +1 -0
- package/dist/components/ModalContent/index.d.mts +5 -0
- package/dist/components/ModalContent/index.d.mts.map +1 -0
- package/dist/components/ModalContent/index.mjs +4 -0
- package/dist/components/ModalContent/index.mjs.map +1 -0
- package/dist/components/ModalFocus/ModalFocus.cjs +56 -0
- package/dist/components/ModalFocus/ModalFocus.cjs.map +1 -0
- package/dist/components/ModalFocus/ModalFocus.d.cts +4 -0
- package/dist/components/ModalFocus/ModalFocus.d.cts.map +1 -0
- package/dist/components/ModalFocus/ModalFocus.d.mts +4 -0
- package/dist/components/ModalFocus/ModalFocus.d.mts.map +1 -0
- package/dist/components/ModalFocus/ModalFocus.mjs +34 -0
- package/dist/components/ModalFocus/ModalFocus.mjs.map +1 -0
- package/dist/components/ModalFocus/ModalFocus.types.cjs +3 -0
- package/dist/components/ModalFocus/ModalFocus.types.cjs.map +1 -0
- package/dist/components/ModalFocus/ModalFocus.types.d.cts +36 -0
- package/dist/components/ModalFocus/ModalFocus.types.d.cts.map +1 -0
- package/dist/components/ModalFocus/ModalFocus.types.d.mts +36 -0
- package/dist/components/ModalFocus/ModalFocus.types.d.mts.map +1 -0
- package/dist/components/ModalFocus/ModalFocus.types.mjs +2 -0
- package/dist/components/ModalFocus/ModalFocus.types.mjs.map +1 -0
- package/dist/components/ModalFocus/index.cjs +6 -0
- package/dist/components/ModalFocus/index.cjs.map +1 -0
- package/dist/components/ModalFocus/index.d.cts +3 -0
- package/dist/components/ModalFocus/index.d.cts.map +1 -0
- package/dist/components/ModalFocus/index.d.mts +3 -0
- package/dist/components/ModalFocus/index.d.mts.map +1 -0
- package/dist/components/ModalFocus/index.mjs +2 -0
- package/dist/components/ModalFocus/index.mjs.map +1 -0
- package/dist/components/ModalFooter/ModalFooter.cjs +44 -0
- package/dist/components/ModalFooter/ModalFooter.cjs.map +1 -0
- package/dist/components/ModalFooter/ModalFooter.d.cts +4 -0
- package/dist/components/ModalFooter/ModalFooter.d.cts.map +1 -0
- package/dist/components/ModalFooter/ModalFooter.d.mts +4 -0
- package/dist/components/ModalFooter/ModalFooter.d.mts.map +1 -0
- package/dist/components/ModalFooter/ModalFooter.mjs +25 -0
- package/dist/components/ModalFooter/ModalFooter.mjs.map +1 -0
- package/dist/components/ModalFooter/ModalFooter.types.cjs +14 -0
- package/dist/components/ModalFooter/ModalFooter.types.cjs.map +1 -0
- package/dist/components/ModalFooter/ModalFooter.types.d.cts +63 -0
- package/dist/components/ModalFooter/ModalFooter.types.d.cts.map +1 -0
- package/dist/components/ModalFooter/ModalFooter.types.d.mts +63 -0
- package/dist/components/ModalFooter/ModalFooter.types.d.mts.map +1 -0
- package/dist/components/ModalFooter/ModalFooter.types.mjs +11 -0
- package/dist/components/ModalFooter/ModalFooter.types.mjs.map +1 -0
- package/dist/components/ModalFooter/index.cjs +8 -0
- package/dist/components/ModalFooter/index.cjs.map +1 -0
- package/dist/components/ModalFooter/index.d.cts +4 -0
- package/dist/components/ModalFooter/index.d.cts.map +1 -0
- package/dist/components/ModalFooter/index.d.mts +4 -0
- package/dist/components/ModalFooter/index.d.mts.map +1 -0
- package/dist/components/ModalFooter/index.mjs +3 -0
- package/dist/components/ModalFooter/index.mjs.map +1 -0
- package/dist/components/ModalHeader/ModalHeader.cjs +55 -0
- package/dist/components/ModalHeader/ModalHeader.cjs.map +1 -0
- package/dist/components/ModalHeader/ModalHeader.d.cts +55 -0
- package/dist/components/ModalHeader/ModalHeader.d.cts.map +1 -0
- package/dist/components/ModalHeader/ModalHeader.d.mts +55 -0
- package/dist/components/ModalHeader/ModalHeader.d.mts.map +1 -0
- package/dist/components/ModalHeader/ModalHeader.mjs +36 -0
- package/dist/components/ModalHeader/ModalHeader.mjs.map +1 -0
- package/dist/components/ModalHeader/ModalHeader.types.cjs +3 -0
- package/dist/components/ModalHeader/ModalHeader.types.cjs.map +1 -0
- package/dist/components/ModalHeader/ModalHeader.types.d.cts +69 -0
- package/dist/components/ModalHeader/ModalHeader.types.d.cts.map +1 -0
- package/dist/components/ModalHeader/ModalHeader.types.d.mts +69 -0
- package/dist/components/ModalHeader/ModalHeader.types.d.mts.map +1 -0
- package/dist/components/ModalHeader/ModalHeader.types.mjs +2 -0
- package/dist/components/ModalHeader/ModalHeader.types.mjs.map +1 -0
- package/dist/components/ModalHeader/index.cjs +6 -0
- package/dist/components/ModalHeader/index.cjs.map +1 -0
- package/dist/components/ModalHeader/index.d.cts +3 -0
- package/dist/components/ModalHeader/index.d.cts.map +1 -0
- package/dist/components/ModalHeader/index.d.mts +3 -0
- package/dist/components/ModalHeader/index.d.mts.map +1 -0
- package/dist/components/ModalHeader/index.mjs +2 -0
- package/dist/components/ModalHeader/index.mjs.map +1 -0
- package/dist/components/PopoverHeader/PopoverHeader.cjs +60 -0
- package/dist/components/PopoverHeader/PopoverHeader.cjs.map +1 -0
- package/dist/components/PopoverHeader/PopoverHeader.d.cts +55 -0
- package/dist/components/PopoverHeader/PopoverHeader.d.cts.map +1 -0
- package/dist/components/PopoverHeader/PopoverHeader.d.mts +55 -0
- package/dist/components/PopoverHeader/PopoverHeader.d.mts.map +1 -0
- package/dist/components/PopoverHeader/PopoverHeader.mjs +41 -0
- package/dist/components/PopoverHeader/PopoverHeader.mjs.map +1 -0
- package/dist/components/PopoverHeader/PopoverHeader.types.cjs +3 -0
- package/dist/components/PopoverHeader/PopoverHeader.types.cjs.map +1 -0
- package/dist/components/PopoverHeader/PopoverHeader.types.d.cts +70 -0
- package/dist/components/PopoverHeader/PopoverHeader.types.d.cts.map +1 -0
- package/dist/components/PopoverHeader/PopoverHeader.types.d.mts +70 -0
- package/dist/components/PopoverHeader/PopoverHeader.types.d.mts.map +1 -0
- package/dist/components/PopoverHeader/PopoverHeader.types.mjs +2 -0
- package/dist/components/PopoverHeader/PopoverHeader.types.mjs.map +1 -0
- package/dist/components/PopoverHeader/index.cjs +6 -0
- package/dist/components/PopoverHeader/index.cjs.map +1 -0
- package/dist/components/PopoverHeader/index.d.cts +3 -0
- package/dist/components/PopoverHeader/index.d.cts.map +1 -0
- package/dist/components/PopoverHeader/index.d.mts +3 -0
- package/dist/components/PopoverHeader/index.d.mts.map +1 -0
- package/dist/components/PopoverHeader/index.mjs +2 -0
- package/dist/components/PopoverHeader/index.mjs.map +1 -0
- package/dist/components/SensitiveText/SensitiveText.cjs +47 -0
- package/dist/components/SensitiveText/SensitiveText.cjs.map +1 -0
- package/dist/components/SensitiveText/SensitiveText.d.cts +4 -0
- package/dist/components/SensitiveText/SensitiveText.d.cts.map +1 -0
- package/dist/components/SensitiveText/SensitiveText.d.mts +4 -0
- package/dist/components/SensitiveText/SensitiveText.d.mts.map +1 -0
- package/dist/components/SensitiveText/SensitiveText.mjs +27 -0
- package/dist/components/SensitiveText/SensitiveText.mjs.map +1 -0
- package/dist/components/SensitiveText/SensitiveText.types.cjs +3 -0
- package/dist/components/SensitiveText/SensitiveText.types.cjs.map +1 -0
- package/dist/components/SensitiveText/SensitiveText.types.d.cts +11 -0
- package/dist/components/SensitiveText/SensitiveText.types.d.cts.map +1 -0
- package/dist/components/SensitiveText/SensitiveText.types.d.mts +11 -0
- package/dist/components/SensitiveText/SensitiveText.types.d.mts.map +1 -0
- package/dist/components/SensitiveText/SensitiveText.types.mjs +2 -0
- package/dist/components/SensitiveText/SensitiveText.types.mjs.map +1 -0
- package/dist/components/SensitiveText/index.cjs +8 -0
- package/dist/components/SensitiveText/index.cjs.map +1 -0
- package/dist/components/SensitiveText/index.d.cts +4 -0
- package/dist/components/SensitiveText/index.d.cts.map +1 -0
- package/dist/components/SensitiveText/index.d.mts +4 -0
- package/dist/components/SensitiveText/index.d.mts.map +1 -0
- package/dist/components/SensitiveText/index.mjs +3 -0
- package/dist/components/SensitiveText/index.mjs.map +1 -0
- package/dist/components/Skeleton/Skeleton.cjs +46 -0
- package/dist/components/Skeleton/Skeleton.cjs.map +1 -0
- package/dist/components/Skeleton/Skeleton.d.cts +4 -0
- package/dist/components/Skeleton/Skeleton.d.cts.map +1 -0
- package/dist/components/Skeleton/Skeleton.d.mts +4 -0
- package/dist/components/Skeleton/Skeleton.d.mts.map +1 -0
- package/dist/components/Skeleton/Skeleton.mjs +27 -0
- package/dist/components/Skeleton/Skeleton.mjs.map +1 -0
- package/dist/components/Skeleton/Skeleton.types.cjs +3 -0
- package/dist/components/Skeleton/Skeleton.types.cjs.map +1 -0
- package/dist/components/Skeleton/Skeleton.types.d.cts +38 -0
- package/dist/components/Skeleton/Skeleton.types.d.cts.map +1 -0
- package/dist/components/Skeleton/Skeleton.types.d.mts +38 -0
- package/dist/components/Skeleton/Skeleton.types.d.mts.map +1 -0
- package/dist/components/Skeleton/Skeleton.types.mjs +2 -0
- package/dist/components/Skeleton/Skeleton.types.mjs.map +1 -0
- package/dist/components/Skeleton/index.cjs +6 -0
- package/dist/components/Skeleton/index.cjs.map +1 -0
- package/dist/components/Skeleton/index.d.cts +3 -0
- package/dist/components/Skeleton/index.d.cts.map +1 -0
- package/dist/components/Skeleton/index.d.mts +3 -0
- package/dist/components/Skeleton/index.d.mts.map +1 -0
- package/dist/components/Skeleton/index.mjs +2 -0
- package/dist/components/Skeleton/index.mjs.map +1 -0
- package/dist/components/Text/Text.cjs +3 -1
- package/dist/components/Text/Text.cjs.map +1 -1
- package/dist/components/Text/Text.constants.cjs.map +1 -1
- package/dist/components/Text/Text.constants.d.cts +1 -1
- package/dist/components/Text/Text.constants.d.cts.map +1 -1
- package/dist/components/Text/Text.constants.d.mts +1 -1
- package/dist/components/Text/Text.constants.d.mts.map +1 -1
- package/dist/components/Text/Text.constants.mjs.map +1 -1
- package/dist/components/Text/Text.d.cts.map +1 -1
- package/dist/components/Text/Text.d.mts.map +1 -1
- package/dist/components/Text/Text.mjs +3 -1
- package/dist/components/Text/Text.mjs.map +1 -1
- package/dist/components/Text/Text.types.cjs.map +1 -1
- package/dist/components/Text/Text.types.d.cts +2 -2
- package/dist/components/Text/Text.types.d.cts.map +1 -1
- package/dist/components/Text/Text.types.d.mts +2 -2
- package/dist/components/Text/Text.types.d.mts.map +1 -1
- package/dist/components/Text/Text.types.mjs.map +1 -1
- package/dist/components/index.cjs +30 -2
- package/dist/components/index.cjs.map +1 -1
- package/dist/components/index.d.cts +22 -0
- package/dist/components/index.d.cts.map +1 -1
- package/dist/components/index.d.mts +22 -0
- package/dist/components/index.d.mts.map +1 -1
- package/dist/components/index.mjs +11 -0
- package/dist/components/index.mjs.map +1 -1
- package/dist/types/index.cjs +3 -15
- package/dist/types/index.cjs.map +1 -1
- package/dist/types/index.d.cts +0 -10
- package/dist/types/index.d.cts.map +1 -1
- package/dist/types/index.d.mts +0 -10
- package/dist/types/index.d.mts.map +1 -1
- package/dist/types/index.mjs +0 -11
- package/dist/types/index.mjs.map +1 -1
- package/package.json +10 -7
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MODAL_CONTENT_IGNORE_OUTSIDE_CLICK_ATTR = exports.ModalContentSize = exports.ModalContent = void 0;
|
|
4
|
+
var ModalContent_1 = require("./ModalContent.cjs");
|
|
5
|
+
Object.defineProperty(exports, "ModalContent", { enumerable: true, get: function () { return ModalContent_1.ModalContent; } });
|
|
6
|
+
var ModalContent_types_1 = require("./ModalContent.types.cjs");
|
|
7
|
+
Object.defineProperty(exports, "ModalContentSize", { enumerable: true, get: function () { return ModalContent_types_1.ModalContentSize; } });
|
|
8
|
+
var ModalContent_constants_1 = require("./ModalContent.constants.cjs");
|
|
9
|
+
Object.defineProperty(exports, "MODAL_CONTENT_IGNORE_OUTSIDE_CLICK_ATTR", { enumerable: true, get: function () { return ModalContent_constants_1.MODAL_CONTENT_IGNORE_OUTSIDE_CLICK_ATTR; } });
|
|
10
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../../src/components/ModalContent/index.ts"],"names":[],"mappings":";;;AAAA,mDAA8C;AAArC,4GAAA,YAAY,OAAA;AACrB,+DAAwD;AAA/C,sHAAA,gBAAgB,OAAA;AAEzB,uEAAmF;AAA1E,iJAAA,uCAAuC,OAAA","sourcesContent":["export { ModalContent } from './ModalContent';\nexport { ModalContentSize } from './ModalContent.types';\nexport type { ModalContentProps } from './ModalContent.types';\nexport { MODAL_CONTENT_IGNORE_OUTSIDE_CLICK_ATTR } from './ModalContent.constants';\n"]}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { ModalContent } from "./ModalContent.cjs";
|
|
2
|
+
export { ModalContentSize } from "./ModalContent.types.cjs";
|
|
3
|
+
export type { ModalContentProps } from "./ModalContent.types.cjs";
|
|
4
|
+
export { MODAL_CONTENT_IGNORE_OUTSIDE_CLICK_ATTR } from "./ModalContent.constants.cjs";
|
|
5
|
+
//# sourceMappingURL=index.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/components/ModalContent/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,2BAAuB;AAC9C,OAAO,EAAE,gBAAgB,EAAE,iCAA6B;AACxD,YAAY,EAAE,iBAAiB,EAAE,iCAA6B;AAC9D,OAAO,EAAE,uCAAuC,EAAE,qCAAiC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { ModalContent } from "./ModalContent.mjs";
|
|
2
|
+
export { ModalContentSize } from "./ModalContent.types.mjs";
|
|
3
|
+
export type { ModalContentProps } from "./ModalContent.types.mjs";
|
|
4
|
+
export { MODAL_CONTENT_IGNORE_OUTSIDE_CLICK_ATTR } from "./ModalContent.constants.mjs";
|
|
5
|
+
//# sourceMappingURL=index.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../src/components/ModalContent/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,2BAAuB;AAC9C,OAAO,EAAE,gBAAgB,EAAE,iCAA6B;AACxD,YAAY,EAAE,iBAAiB,EAAE,iCAA6B;AAC9D,OAAO,EAAE,uCAAuC,EAAE,qCAAiC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../src/components/ModalContent/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,2BAAuB;AAC9C,OAAO,EAAE,gBAAgB,EAAE,iCAA6B;AAExD,OAAO,EAAE,uCAAuC,EAAE,qCAAiC","sourcesContent":["export { ModalContent } from './ModalContent';\nexport { ModalContentSize } from './ModalContent.types';\nexport type { ModalContentProps } from './ModalContent.types';\nexport { MODAL_CONTENT_IGNORE_OUTSIDE_CLICK_ATTR } from './ModalContent.constants';\n"]}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
exports.ModalFocus = void 0;
|
|
30
|
+
const react_1 = __importStar(require("react"));
|
|
31
|
+
const react_focus_lock_1 = __importDefault(require("react-focus-lock"));
|
|
32
|
+
/**
|
|
33
|
+
* Based on the ModalFocusScope component from chakra-ui:
|
|
34
|
+
* https://github.com/chakra-ui/chakra-ui/blob/main/packages/components/modal/src/modal-focus.tsx
|
|
35
|
+
*/
|
|
36
|
+
// `react-focus-lock` ships dual ESM/CJS builds; depending on the consumer's
|
|
37
|
+
// bundler interop, the default export can land as either the component itself
|
|
38
|
+
// or wrapped under `.default`. This picks whichever one is callable.
|
|
39
|
+
const FocusTrap =
|
|
40
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
41
|
+
react_focus_lock_1.default.default ?? react_focus_lock_1.default;
|
|
42
|
+
const ModalFocus = ({ initialFocusRef, finalFocusRef, restoreFocus, children, autoFocus, ...props }) => {
|
|
43
|
+
const onActivation = (0, react_1.useCallback)(() => {
|
|
44
|
+
if (initialFocusRef?.current) {
|
|
45
|
+
initialFocusRef.current.focus();
|
|
46
|
+
}
|
|
47
|
+
}, [initialFocusRef]);
|
|
48
|
+
const onDeactivation = (0, react_1.useCallback)(() => {
|
|
49
|
+
finalFocusRef?.current?.focus();
|
|
50
|
+
}, [finalFocusRef]);
|
|
51
|
+
const returnFocus = restoreFocus && !finalFocusRef;
|
|
52
|
+
return (react_1.default.createElement(FocusTrap, { autoFocus: autoFocus, onActivation: onActivation, onDeactivation: onDeactivation, returnFocus: returnFocus, ...props }, children));
|
|
53
|
+
};
|
|
54
|
+
exports.ModalFocus = ModalFocus;
|
|
55
|
+
exports.ModalFocus.displayName = 'ModalFocus';
|
|
56
|
+
//# sourceMappingURL=ModalFocus.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ModalFocus.cjs","sourceRoot":"","sources":["../../../src/components/ModalFocus/ModalFocus.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAA2C;AAC3C,wEAA8C;AAI9C;;;GAGG;AAEH,4EAA4E;AAC5E,8EAA8E;AAC9E,qEAAqE;AACrE,MAAM,SAAS;AACb,8DAA8D;AAC7D,0BAAsB,CAAC,OAAO,IAAI,0BAAc,CAAC;AAE7C,MAAM,UAAU,GAA8B,CAAC,EACpD,eAAe,EACf,aAAa,EACb,YAAY,EACZ,QAAQ,EACR,SAAS,EACT,GAAG,KAAK,EACT,EAAE,EAAE;IACH,MAAM,YAAY,GAAG,IAAA,mBAAW,EAAC,GAAG,EAAE;QACpC,IAAI,eAAe,EAAE,OAAO,EAAE;YAC5B,eAAe,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;SACjC;IACH,CAAC,EAAE,CAAC,eAAe,CAAC,CAAC,CAAC;IAEtB,MAAM,cAAc,GAAG,IAAA,mBAAW,EAAC,GAAG,EAAE;QACtC,aAAa,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;IAClC,CAAC,EAAE,CAAC,aAAa,CAAC,CAAC,CAAC;IAEpB,MAAM,WAAW,GAAG,YAAY,IAAI,CAAC,aAAa,CAAC;IAEnD,OAAO,CACL,8BAAC,SAAS,IACR,SAAS,EAAE,SAAS,EACpB,YAAY,EAAE,YAAY,EAC1B,cAAc,EAAE,cAAc,EAC9B,WAAW,EAAE,WAAW,KACpB,KAAK,IAER,QAAQ,CACC,CACb,CAAC;AACJ,CAAC,CAAC;AA/BW,QAAA,UAAU,cA+BrB;AAEF,kBAAU,CAAC,WAAW,GAAG,YAAY,CAAC","sourcesContent":["import React, { useCallback } from 'react';\nimport ReactFocusLock from 'react-focus-lock';\n\nimport type { ModalFocusProps } from './ModalFocus.types';\n\n/**\n * Based on the ModalFocusScope component from chakra-ui:\n * https://github.com/chakra-ui/chakra-ui/blob/main/packages/components/modal/src/modal-focus.tsx\n */\n\n// `react-focus-lock` ships dual ESM/CJS builds; depending on the consumer's\n// bundler interop, the default export can land as either the component itself\n// or wrapped under `.default`. This picks whichever one is callable.\nconst FocusTrap: typeof ReactFocusLock =\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (ReactFocusLock as any).default ?? ReactFocusLock;\n\nexport const ModalFocus: React.FC<ModalFocusProps> = ({\n initialFocusRef,\n finalFocusRef,\n restoreFocus,\n children,\n autoFocus,\n ...props\n}) => {\n const onActivation = useCallback(() => {\n if (initialFocusRef?.current) {\n initialFocusRef.current.focus();\n }\n }, [initialFocusRef]);\n\n const onDeactivation = useCallback(() => {\n finalFocusRef?.current?.focus();\n }, [finalFocusRef]);\n\n const returnFocus = restoreFocus && !finalFocusRef;\n\n return (\n <FocusTrap\n autoFocus={autoFocus}\n onActivation={onActivation}\n onDeactivation={onDeactivation}\n returnFocus={returnFocus}\n {...props}\n >\n {children}\n </FocusTrap>\n );\n};\n\nModalFocus.displayName = 'ModalFocus';\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ModalFocus.d.cts","sourceRoot":"","sources":["../../../src/components/ModalFocus/ModalFocus.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsB,cAAc;AAG3C,OAAO,KAAK,EAAE,eAAe,EAAE,+BAA2B;AAc1D,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CA+BhD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ModalFocus.d.mts","sourceRoot":"","sources":["../../../src/components/ModalFocus/ModalFocus.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsB,cAAc;AAG3C,OAAO,KAAK,EAAE,eAAe,EAAE,+BAA2B;AAc1D,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CA+BhD,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
function $importDefault(module) {
|
|
2
|
+
if (module?.__esModule) {
|
|
3
|
+
return module.default;
|
|
4
|
+
}
|
|
5
|
+
return module;
|
|
6
|
+
}
|
|
7
|
+
import $React, { useCallback } from "react";
|
|
8
|
+
const React = $importDefault($React);
|
|
9
|
+
import $ReactFocusLock from "react-focus-lock";
|
|
10
|
+
const ReactFocusLock = $importDefault($ReactFocusLock);
|
|
11
|
+
/**
|
|
12
|
+
* Based on the ModalFocusScope component from chakra-ui:
|
|
13
|
+
* https://github.com/chakra-ui/chakra-ui/blob/main/packages/components/modal/src/modal-focus.tsx
|
|
14
|
+
*/
|
|
15
|
+
// `react-focus-lock` ships dual ESM/CJS builds; depending on the consumer's
|
|
16
|
+
// bundler interop, the default export can land as either the component itself
|
|
17
|
+
// or wrapped under `.default`. This picks whichever one is callable.
|
|
18
|
+
const FocusTrap =
|
|
19
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
20
|
+
ReactFocusLock.default ?? ReactFocusLock;
|
|
21
|
+
export const ModalFocus = ({ initialFocusRef, finalFocusRef, restoreFocus, children, autoFocus, ...props }) => {
|
|
22
|
+
const onActivation = useCallback(() => {
|
|
23
|
+
if (initialFocusRef?.current) {
|
|
24
|
+
initialFocusRef.current.focus();
|
|
25
|
+
}
|
|
26
|
+
}, [initialFocusRef]);
|
|
27
|
+
const onDeactivation = useCallback(() => {
|
|
28
|
+
finalFocusRef?.current?.focus();
|
|
29
|
+
}, [finalFocusRef]);
|
|
30
|
+
const returnFocus = restoreFocus && !finalFocusRef;
|
|
31
|
+
return (React.createElement(FocusTrap, { autoFocus: autoFocus, onActivation: onActivation, onDeactivation: onDeactivation, returnFocus: returnFocus, ...props }, children));
|
|
32
|
+
};
|
|
33
|
+
ModalFocus.displayName = 'ModalFocus';
|
|
34
|
+
//# sourceMappingURL=ModalFocus.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ModalFocus.mjs","sourceRoot":"","sources":["../../../src/components/ModalFocus/ModalFocus.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,QAAO,EAAE,WAAW,EAAE,cAAc;;AAC3C,OAAO,eAAc,yBAAyB;;AAI9C;;;GAGG;AAEH,4EAA4E;AAC5E,8EAA8E;AAC9E,qEAAqE;AACrE,MAAM,SAAS;AACb,8DAA8D;AAC7D,cAAsB,CAAC,OAAO,IAAI,cAAc,CAAC;AAEpD,MAAM,CAAC,MAAM,UAAU,GAA8B,CAAC,EACpD,eAAe,EACf,aAAa,EACb,YAAY,EACZ,QAAQ,EACR,SAAS,EACT,GAAG,KAAK,EACT,EAAE,EAAE;IACH,MAAM,YAAY,GAAG,WAAW,CAAC,GAAG,EAAE;QACpC,IAAI,eAAe,EAAE,OAAO,EAAE;YAC5B,eAAe,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;SACjC;IACH,CAAC,EAAE,CAAC,eAAe,CAAC,CAAC,CAAC;IAEtB,MAAM,cAAc,GAAG,WAAW,CAAC,GAAG,EAAE;QACtC,aAAa,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;IAClC,CAAC,EAAE,CAAC,aAAa,CAAC,CAAC,CAAC;IAEpB,MAAM,WAAW,GAAG,YAAY,IAAI,CAAC,aAAa,CAAC;IAEnD,OAAO,CACL,oBAAC,SAAS,IACR,SAAS,EAAE,SAAS,EACpB,YAAY,EAAE,YAAY,EAC1B,cAAc,EAAE,cAAc,EAC9B,WAAW,EAAE,WAAW,KACpB,KAAK,IAER,QAAQ,CACC,CACb,CAAC;AACJ,CAAC,CAAC;AAEF,UAAU,CAAC,WAAW,GAAG,YAAY,CAAC","sourcesContent":["import React, { useCallback } from 'react';\nimport ReactFocusLock from 'react-focus-lock';\n\nimport type { ModalFocusProps } from './ModalFocus.types';\n\n/**\n * Based on the ModalFocusScope component from chakra-ui:\n * https://github.com/chakra-ui/chakra-ui/blob/main/packages/components/modal/src/modal-focus.tsx\n */\n\n// `react-focus-lock` ships dual ESM/CJS builds; depending on the consumer's\n// bundler interop, the default export can land as either the component itself\n// or wrapped under `.default`. This picks whichever one is callable.\nconst FocusTrap: typeof ReactFocusLock =\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (ReactFocusLock as any).default ?? ReactFocusLock;\n\nexport const ModalFocus: React.FC<ModalFocusProps> = ({\n initialFocusRef,\n finalFocusRef,\n restoreFocus,\n children,\n autoFocus,\n ...props\n}) => {\n const onActivation = useCallback(() => {\n if (initialFocusRef?.current) {\n initialFocusRef.current.focus();\n }\n }, [initialFocusRef]);\n\n const onDeactivation = useCallback(() => {\n finalFocusRef?.current?.focus();\n }, [finalFocusRef]);\n\n const returnFocus = restoreFocus && !finalFocusRef;\n\n return (\n <FocusTrap\n autoFocus={autoFocus}\n onActivation={onActivation}\n onDeactivation={onDeactivation}\n returnFocus={returnFocus}\n {...props}\n >\n {children}\n </FocusTrap>\n );\n};\n\nModalFocus.displayName = 'ModalFocus';\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ModalFocus.types.cjs","sourceRoot":"","sources":["../../../src/components/ModalFocus/ModalFocus.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ReactNode, RefObject } from 'react';\n\nexport type FocusableElement = {\n focus(options?: FocusOptions): void;\n};\n\nexport type ModalFocusProps = {\n /**\n * The `ref` of the element to receive focus initially.\n */\n initialFocusRef?: RefObject<FocusableElement | null>;\n /**\n * The `ref` of the element to return focus to when `ModalFocus`\n * unmounts.\n */\n finalFocusRef?: RefObject<FocusableElement | null>;\n /**\n * If `true`, focus will be restored to the element that\n * triggered the `ModalFocus` once it unmounts.\n *\n * Ignored when `finalFocusRef` is provided.\n *\n * @default false\n */\n restoreFocus?: boolean;\n /**\n * The node to lock focus to.\n */\n children: ReactNode;\n /**\n * If `true`, the first focusable element within `children`\n * will be auto-focused once `ModalFocus` mounts.\n *\n * @default true\n */\n autoFocus?: boolean;\n};\n"]}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { ReactNode, RefObject } from "react";
|
|
2
|
+
export type FocusableElement = {
|
|
3
|
+
focus(options?: FocusOptions): void;
|
|
4
|
+
};
|
|
5
|
+
export type ModalFocusProps = {
|
|
6
|
+
/**
|
|
7
|
+
* The `ref` of the element to receive focus initially.
|
|
8
|
+
*/
|
|
9
|
+
initialFocusRef?: RefObject<FocusableElement | null>;
|
|
10
|
+
/**
|
|
11
|
+
* The `ref` of the element to return focus to when `ModalFocus`
|
|
12
|
+
* unmounts.
|
|
13
|
+
*/
|
|
14
|
+
finalFocusRef?: RefObject<FocusableElement | null>;
|
|
15
|
+
/**
|
|
16
|
+
* If `true`, focus will be restored to the element that
|
|
17
|
+
* triggered the `ModalFocus` once it unmounts.
|
|
18
|
+
*
|
|
19
|
+
* Ignored when `finalFocusRef` is provided.
|
|
20
|
+
*
|
|
21
|
+
* @default false
|
|
22
|
+
*/
|
|
23
|
+
restoreFocus?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* The node to lock focus to.
|
|
26
|
+
*/
|
|
27
|
+
children: ReactNode;
|
|
28
|
+
/**
|
|
29
|
+
* If `true`, the first focusable element within `children`
|
|
30
|
+
* will be auto-focused once `ModalFocus` mounts.
|
|
31
|
+
*
|
|
32
|
+
* @default true
|
|
33
|
+
*/
|
|
34
|
+
autoFocus?: boolean;
|
|
35
|
+
};
|
|
36
|
+
//# sourceMappingURL=ModalFocus.types.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ModalFocus.types.d.cts","sourceRoot":"","sources":["../../../src/components/ModalFocus/ModalFocus.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,cAAc;AAElD,MAAM,MAAM,gBAAgB,GAAG;IAC7B,KAAK,CAAC,OAAO,CAAC,EAAE,YAAY,GAAG,IAAI,CAAC;CACrC,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B;;OAEG;IACH,eAAe,CAAC,EAAE,SAAS,CAAC,gBAAgB,GAAG,IAAI,CAAC,CAAC;IACrD;;;OAGG;IACH,aAAa,CAAC,EAAE,SAAS,CAAC,gBAAgB,GAAG,IAAI,CAAC,CAAC;IACnD;;;;;;;OAOG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;IACpB;;;;;OAKG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { ReactNode, RefObject } from "react";
|
|
2
|
+
export type FocusableElement = {
|
|
3
|
+
focus(options?: FocusOptions): void;
|
|
4
|
+
};
|
|
5
|
+
export type ModalFocusProps = {
|
|
6
|
+
/**
|
|
7
|
+
* The `ref` of the element to receive focus initially.
|
|
8
|
+
*/
|
|
9
|
+
initialFocusRef?: RefObject<FocusableElement | null>;
|
|
10
|
+
/**
|
|
11
|
+
* The `ref` of the element to return focus to when `ModalFocus`
|
|
12
|
+
* unmounts.
|
|
13
|
+
*/
|
|
14
|
+
finalFocusRef?: RefObject<FocusableElement | null>;
|
|
15
|
+
/**
|
|
16
|
+
* If `true`, focus will be restored to the element that
|
|
17
|
+
* triggered the `ModalFocus` once it unmounts.
|
|
18
|
+
*
|
|
19
|
+
* Ignored when `finalFocusRef` is provided.
|
|
20
|
+
*
|
|
21
|
+
* @default false
|
|
22
|
+
*/
|
|
23
|
+
restoreFocus?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* The node to lock focus to.
|
|
26
|
+
*/
|
|
27
|
+
children: ReactNode;
|
|
28
|
+
/**
|
|
29
|
+
* If `true`, the first focusable element within `children`
|
|
30
|
+
* will be auto-focused once `ModalFocus` mounts.
|
|
31
|
+
*
|
|
32
|
+
* @default true
|
|
33
|
+
*/
|
|
34
|
+
autoFocus?: boolean;
|
|
35
|
+
};
|
|
36
|
+
//# sourceMappingURL=ModalFocus.types.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ModalFocus.types.d.mts","sourceRoot":"","sources":["../../../src/components/ModalFocus/ModalFocus.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,cAAc;AAElD,MAAM,MAAM,gBAAgB,GAAG;IAC7B,KAAK,CAAC,OAAO,CAAC,EAAE,YAAY,GAAG,IAAI,CAAC;CACrC,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B;;OAEG;IACH,eAAe,CAAC,EAAE,SAAS,CAAC,gBAAgB,GAAG,IAAI,CAAC,CAAC;IACrD;;;OAGG;IACH,aAAa,CAAC,EAAE,SAAS,CAAC,gBAAgB,GAAG,IAAI,CAAC,CAAC;IACnD;;;;;;;OAOG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;IACpB;;;;;OAKG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ModalFocus.types.mjs","sourceRoot":"","sources":["../../../src/components/ModalFocus/ModalFocus.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ReactNode, RefObject } from 'react';\n\nexport type FocusableElement = {\n focus(options?: FocusOptions): void;\n};\n\nexport type ModalFocusProps = {\n /**\n * The `ref` of the element to receive focus initially.\n */\n initialFocusRef?: RefObject<FocusableElement | null>;\n /**\n * The `ref` of the element to return focus to when `ModalFocus`\n * unmounts.\n */\n finalFocusRef?: RefObject<FocusableElement | null>;\n /**\n * If `true`, focus will be restored to the element that\n * triggered the `ModalFocus` once it unmounts.\n *\n * Ignored when `finalFocusRef` is provided.\n *\n * @default false\n */\n restoreFocus?: boolean;\n /**\n * The node to lock focus to.\n */\n children: ReactNode;\n /**\n * If `true`, the first focusable element within `children`\n * will be auto-focused once `ModalFocus` mounts.\n *\n * @default true\n */\n autoFocus?: boolean;\n};\n"]}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ModalFocus = void 0;
|
|
4
|
+
var ModalFocus_1 = require("./ModalFocus.cjs");
|
|
5
|
+
Object.defineProperty(exports, "ModalFocus", { enumerable: true, get: function () { return ModalFocus_1.ModalFocus; } });
|
|
6
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../../src/components/ModalFocus/index.ts"],"names":[],"mappings":";;;AAAA,+CAA0C;AAAjC,wGAAA,UAAU,OAAA","sourcesContent":["export { ModalFocus } from './ModalFocus';\nexport type { FocusableElement, ModalFocusProps } from './ModalFocus.types';\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/components/ModalFocus/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,yBAAqB;AAC1C,YAAY,EAAE,gBAAgB,EAAE,eAAe,EAAE,+BAA2B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../src/components/ModalFocus/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,yBAAqB;AAC1C,YAAY,EAAE,gBAAgB,EAAE,eAAe,EAAE,+BAA2B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../src/components/ModalFocus/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,yBAAqB","sourcesContent":["export { ModalFocus } from './ModalFocus';\nexport type { FocusableElement, ModalFocusProps } from './ModalFocus.types';\n"]}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.ModalFooter = void 0;
|
|
27
|
+
const design_system_shared_1 = require("@metamask-previews/design-system-shared");
|
|
28
|
+
const react_1 = __importStar(require("react"));
|
|
29
|
+
const tw_merge_1 = require("../../utils/tw-merge.cjs");
|
|
30
|
+
const Box_1 = require("../Box/index.cjs");
|
|
31
|
+
const Button_1 = require("../Button/index.cjs");
|
|
32
|
+
const ModalFooter_types_1 = require("./ModalFooter.types.cjs");
|
|
33
|
+
exports.ModalFooter = (0, react_1.forwardRef)(({ className, children, buttonsAlignment = ModalFooter_types_1.ButtonsAlignment.Horizontal, primaryButtonProps, secondaryButtonProps, ...props }, ref) => {
|
|
34
|
+
const isHorizontal = buttonsAlignment === ModalFooter_types_1.ButtonsAlignment.Horizontal;
|
|
35
|
+
const buttonClassName = isHorizontal ? 'flex-1' : 'w-full';
|
|
36
|
+
const hasButtons = Boolean(primaryButtonProps || secondaryButtonProps);
|
|
37
|
+
return (react_1.default.createElement("footer", { ref: ref, className: (0, tw_merge_1.twMerge)('px-4 pt-4', className), ...props },
|
|
38
|
+
children,
|
|
39
|
+
hasButtons && (react_1.default.createElement(Box_1.Box, { flexDirection: isHorizontal ? Box_1.BoxFlexDirection.Row : Box_1.BoxFlexDirection.Column, gap: 4 },
|
|
40
|
+
secondaryButtonProps && (react_1.default.createElement(Button_1.Button, { size: design_system_shared_1.ButtonSize.Lg, ...secondaryButtonProps, variant: design_system_shared_1.ButtonVariant.Secondary, className: (0, tw_merge_1.twMerge)(buttonClassName, secondaryButtonProps.className) })),
|
|
41
|
+
primaryButtonProps && (react_1.default.createElement(Button_1.Button, { size: design_system_shared_1.ButtonSize.Lg, ...primaryButtonProps, variant: design_system_shared_1.ButtonVariant.Primary, className: (0, tw_merge_1.twMerge)(buttonClassName, primaryButtonProps.className) }))))));
|
|
42
|
+
});
|
|
43
|
+
exports.ModalFooter.displayName = 'ModalFooter';
|
|
44
|
+
//# sourceMappingURL=ModalFooter.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ModalFooter.cjs","sourceRoot":"","sources":["../../../src/components/ModalFooter/ModalFooter.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kFAAoF;AACpF,+CAA0C;AAE1C,uDAA+C;AAC/C,0CAA+C;AAC/C,gDAAmC;AAEnC,+DAAuD;AAG1C,QAAA,WAAW,GAAG,IAAA,kBAAU,EACnC,CACE,EACE,SAAS,EACT,QAAQ,EACR,gBAAgB,GAAG,oCAAgB,CAAC,UAAU,EAC9C,kBAAkB,EAClB,oBAAoB,EACpB,GAAG,KAAK,EACT,EACD,GAAG,EACH,EAAE;IACF,MAAM,YAAY,GAAG,gBAAgB,KAAK,oCAAgB,CAAC,UAAU,CAAC;IACtE,MAAM,eAAe,GAAG,YAAY,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC;IAC3D,MAAM,UAAU,GAAG,OAAO,CAAC,kBAAkB,IAAI,oBAAoB,CAAC,CAAC;IAEvE,OAAO,CACL,0CAAQ,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,IAAA,kBAAO,EAAC,WAAW,EAAE,SAAS,CAAC,KAAM,KAAK;QACpE,QAAQ;QACR,UAAU,IAAI,CACb,8BAAC,SAAG,IACF,aAAa,EACX,YAAY,CAAC,CAAC,CAAC,sBAAgB,CAAC,GAAG,CAAC,CAAC,CAAC,sBAAgB,CAAC,MAAM,EAE/D,GAAG,EAAE,CAAC;YAEL,oBAAoB,IAAI,CACvB,8BAAC,eAAM,IACL,IAAI,EAAE,iCAAU,CAAC,EAAE,KACf,oBAAoB,EACxB,OAAO,EAAE,oCAAa,CAAC,SAAS,EAChC,SAAS,EAAE,IAAA,kBAAO,EAChB,eAAe,EACf,oBAAoB,CAAC,SAAS,CAC/B,GACD,CACH;YACA,kBAAkB,IAAI,CACrB,8BAAC,eAAM,IACL,IAAI,EAAE,iCAAU,CAAC,EAAE,KACf,kBAAkB,EACtB,OAAO,EAAE,oCAAa,CAAC,OAAO,EAC9B,SAAS,EAAE,IAAA,kBAAO,EAChB,eAAe,EACf,kBAAkB,CAAC,SAAS,CAC7B,GACD,CACH,CACG,CACP,CACM,CACV,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,mBAAW,CAAC,WAAW,GAAG,aAAa,CAAC","sourcesContent":["import { ButtonSize, ButtonVariant } from '@metamask-previews/design-system-shared';\nimport React, { forwardRef } from 'react';\n\nimport { twMerge } from '../../utils/tw-merge';\nimport { Box, BoxFlexDirection } from '../Box';\nimport { Button } from '../Button';\n\nimport { ButtonsAlignment } from './ModalFooter.types';\nimport type { ModalFooterProps } from './ModalFooter.types';\n\nexport const ModalFooter = forwardRef<HTMLElement, ModalFooterProps>(\n (\n {\n className,\n children,\n buttonsAlignment = ButtonsAlignment.Horizontal,\n primaryButtonProps,\n secondaryButtonProps,\n ...props\n },\n ref,\n ) => {\n const isHorizontal = buttonsAlignment === ButtonsAlignment.Horizontal;\n const buttonClassName = isHorizontal ? 'flex-1' : 'w-full';\n const hasButtons = Boolean(primaryButtonProps || secondaryButtonProps);\n\n return (\n <footer ref={ref} className={twMerge('px-4 pt-4', className)} {...props}>\n {children}\n {hasButtons && (\n <Box\n flexDirection={\n isHorizontal ? BoxFlexDirection.Row : BoxFlexDirection.Column\n }\n gap={4}\n >\n {secondaryButtonProps && (\n <Button\n size={ButtonSize.Lg}\n {...secondaryButtonProps}\n variant={ButtonVariant.Secondary}\n className={twMerge(\n buttonClassName,\n secondaryButtonProps.className,\n )}\n />\n )}\n {primaryButtonProps && (\n <Button\n size={ButtonSize.Lg}\n {...primaryButtonProps}\n variant={ButtonVariant.Primary}\n className={twMerge(\n buttonClassName,\n primaryButtonProps.className,\n )}\n />\n )}\n </Box>\n )}\n </footer>\n );\n },\n);\n\nModalFooter.displayName = 'ModalFooter';\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ModalFooter.d.cts","sourceRoot":"","sources":["../../../src/components/ModalFooter/ModalFooter.tsx"],"names":[],"mappings":"AACA,OAAO,KAAqB,cAAc;AAO1C,OAAO,KAAK,EAAE,gBAAgB,EAAE,gCAA4B;AAE5D,eAAO,MAAM,WAAW,mGAqDvB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ModalFooter.d.mts","sourceRoot":"","sources":["../../../src/components/ModalFooter/ModalFooter.tsx"],"names":[],"mappings":"AACA,OAAO,KAAqB,cAAc;AAO1C,OAAO,KAAK,EAAE,gBAAgB,EAAE,gCAA4B;AAE5D,eAAO,MAAM,WAAW,mGAqDvB,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
function $importDefault(module) {
|
|
2
|
+
if (module?.__esModule) {
|
|
3
|
+
return module.default;
|
|
4
|
+
}
|
|
5
|
+
return module;
|
|
6
|
+
}
|
|
7
|
+
import { ButtonSize, ButtonVariant } from "@metamask-previews/design-system-shared";
|
|
8
|
+
import $React, { forwardRef } from "react";
|
|
9
|
+
const React = $importDefault($React);
|
|
10
|
+
import { twMerge } from "../../utils/tw-merge.mjs";
|
|
11
|
+
import { Box, BoxFlexDirection } from "../Box/index.mjs";
|
|
12
|
+
import { Button } from "../Button/index.mjs";
|
|
13
|
+
import { ButtonsAlignment } from "./ModalFooter.types.mjs";
|
|
14
|
+
export const ModalFooter = forwardRef(({ className, children, buttonsAlignment = ButtonsAlignment.Horizontal, primaryButtonProps, secondaryButtonProps, ...props }, ref) => {
|
|
15
|
+
const isHorizontal = buttonsAlignment === ButtonsAlignment.Horizontal;
|
|
16
|
+
const buttonClassName = isHorizontal ? 'flex-1' : 'w-full';
|
|
17
|
+
const hasButtons = Boolean(primaryButtonProps || secondaryButtonProps);
|
|
18
|
+
return (React.createElement("footer", { ref: ref, className: twMerge('px-4 pt-4', className), ...props },
|
|
19
|
+
children,
|
|
20
|
+
hasButtons && (React.createElement(Box, { flexDirection: isHorizontal ? BoxFlexDirection.Row : BoxFlexDirection.Column, gap: 4 },
|
|
21
|
+
secondaryButtonProps && (React.createElement(Button, { size: ButtonSize.Lg, ...secondaryButtonProps, variant: ButtonVariant.Secondary, className: twMerge(buttonClassName, secondaryButtonProps.className) })),
|
|
22
|
+
primaryButtonProps && (React.createElement(Button, { size: ButtonSize.Lg, ...primaryButtonProps, variant: ButtonVariant.Primary, className: twMerge(buttonClassName, primaryButtonProps.className) }))))));
|
|
23
|
+
});
|
|
24
|
+
ModalFooter.displayName = 'ModalFooter';
|
|
25
|
+
//# sourceMappingURL=ModalFooter.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ModalFooter.mjs","sourceRoot":"","sources":["../../../src/components/ModalFooter/ModalFooter.tsx"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,gDAAgD;AACpF,OAAO,QAAO,EAAE,UAAU,EAAE,cAAc;;AAE1C,OAAO,EAAE,OAAO,EAAE,iCAA6B;AAC/C,OAAO,EAAE,GAAG,EAAE,gBAAgB,EAAE,yBAAe;AAC/C,OAAO,EAAE,MAAM,EAAE,4BAAkB;AAEnC,OAAO,EAAE,gBAAgB,EAAE,gCAA4B;AAGvD,MAAM,CAAC,MAAM,WAAW,GAAG,UAAU,CACnC,CACE,EACE,SAAS,EACT,QAAQ,EACR,gBAAgB,GAAG,gBAAgB,CAAC,UAAU,EAC9C,kBAAkB,EAClB,oBAAoB,EACpB,GAAG,KAAK,EACT,EACD,GAAG,EACH,EAAE;IACF,MAAM,YAAY,GAAG,gBAAgB,KAAK,gBAAgB,CAAC,UAAU,CAAC;IACtE,MAAM,eAAe,GAAG,YAAY,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC;IAC3D,MAAM,UAAU,GAAG,OAAO,CAAC,kBAAkB,IAAI,oBAAoB,CAAC,CAAC;IAEvE,OAAO,CACL,gCAAQ,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,OAAO,CAAC,WAAW,EAAE,SAAS,CAAC,KAAM,KAAK;QACpE,QAAQ;QACR,UAAU,IAAI,CACb,oBAAC,GAAG,IACF,aAAa,EACX,YAAY,CAAC,CAAC,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC,CAAC,gBAAgB,CAAC,MAAM,EAE/D,GAAG,EAAE,CAAC;YAEL,oBAAoB,IAAI,CACvB,oBAAC,MAAM,IACL,IAAI,EAAE,UAAU,CAAC,EAAE,KACf,oBAAoB,EACxB,OAAO,EAAE,aAAa,CAAC,SAAS,EAChC,SAAS,EAAE,OAAO,CAChB,eAAe,EACf,oBAAoB,CAAC,SAAS,CAC/B,GACD,CACH;YACA,kBAAkB,IAAI,CACrB,oBAAC,MAAM,IACL,IAAI,EAAE,UAAU,CAAC,EAAE,KACf,kBAAkB,EACtB,OAAO,EAAE,aAAa,CAAC,OAAO,EAC9B,SAAS,EAAE,OAAO,CAChB,eAAe,EACf,kBAAkB,CAAC,SAAS,CAC7B,GACD,CACH,CACG,CACP,CACM,CACV,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,WAAW,CAAC,WAAW,GAAG,aAAa,CAAC","sourcesContent":["import { ButtonSize, ButtonVariant } from '@metamask-previews/design-system-shared';\nimport React, { forwardRef } from 'react';\n\nimport { twMerge } from '../../utils/tw-merge';\nimport { Box, BoxFlexDirection } from '../Box';\nimport { Button } from '../Button';\n\nimport { ButtonsAlignment } from './ModalFooter.types';\nimport type { ModalFooterProps } from './ModalFooter.types';\n\nexport const ModalFooter = forwardRef<HTMLElement, ModalFooterProps>(\n (\n {\n className,\n children,\n buttonsAlignment = ButtonsAlignment.Horizontal,\n primaryButtonProps,\n secondaryButtonProps,\n ...props\n },\n ref,\n ) => {\n const isHorizontal = buttonsAlignment === ButtonsAlignment.Horizontal;\n const buttonClassName = isHorizontal ? 'flex-1' : 'w-full';\n const hasButtons = Boolean(primaryButtonProps || secondaryButtonProps);\n\n return (\n <footer ref={ref} className={twMerge('px-4 pt-4', className)} {...props}>\n {children}\n {hasButtons && (\n <Box\n flexDirection={\n isHorizontal ? BoxFlexDirection.Row : BoxFlexDirection.Column\n }\n gap={4}\n >\n {secondaryButtonProps && (\n <Button\n size={ButtonSize.Lg}\n {...secondaryButtonProps}\n variant={ButtonVariant.Secondary}\n className={twMerge(\n buttonClassName,\n secondaryButtonProps.className,\n )}\n />\n )}\n {primaryButtonProps && (\n <Button\n size={ButtonSize.Lg}\n {...primaryButtonProps}\n variant={ButtonVariant.Primary}\n className={twMerge(\n buttonClassName,\n primaryButtonProps.className,\n )}\n />\n )}\n </Box>\n )}\n </footer>\n );\n },\n);\n\nModalFooter.displayName = 'ModalFooter';\n"]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ButtonsAlignment = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Layout direction for the action button row.
|
|
6
|
+
*
|
|
7
|
+
* Mirrors `BottomSheetFooter`'s `ButtonsAlignment` on the React Native side so
|
|
8
|
+
* the modal/sheet families share semantics.
|
|
9
|
+
*/
|
|
10
|
+
exports.ButtonsAlignment = {
|
|
11
|
+
Horizontal: 'horizontal',
|
|
12
|
+
Vertical: 'vertical',
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=ModalFooter.types.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ModalFooter.types.cjs","sourceRoot":"","sources":["../../../src/components/ModalFooter/ModalFooter.types.ts"],"names":[],"mappings":";;;AAIA;;;;;GAKG;AACU,QAAA,gBAAgB,GAAG;IAC9B,UAAU,EAAE,YAAY;IACxB,QAAQ,EAAE,UAAU;CACZ,CAAC","sourcesContent":["import type { ComponentProps, ReactNode } from 'react';\n\nimport type { ButtonProps } from '../Button';\n\n/**\n * Layout direction for the action button row.\n *\n * Mirrors `BottomSheetFooter`'s `ButtonsAlignment` on the React Native side so\n * the modal/sheet families share semantics.\n */\nexport const ButtonsAlignment = {\n Horizontal: 'horizontal',\n Vertical: 'vertical',\n} as const;\nexport type ButtonsAlignment =\n (typeof ButtonsAlignment)[keyof typeof ButtonsAlignment];\n\n/**\n * Button props accepted by `ModalFooter`. The `variant` is enforced internally\n * by the component (Primary or Secondary, depending on slot), so consumers\n * cannot override it. The `data-*` index signature is preserved so test ids\n * and other dataset attributes can be passed through `Partial`/`Omit`\n * indirection.\n */\nexport type ModalFooterButtonProps = Omit<ButtonProps, 'variant'> & {\n [key: `data-${string}`]: string | undefined;\n};\n\nexport type ModalFooterProps = ComponentProps<'footer'> & {\n /**\n * Optional custom content rendered above the action button row. Use this\n * for inline form controls (e.g. a \"do not show again\" checkbox) or to\n * fully replace the built-in button row by omitting both\n * `primaryButtonProps` and `secondaryButtonProps`.\n */\n children?: ReactNode;\n /**\n * Optional layout direction for the action button row.\n *\n * - `Horizontal` — buttons share the row, each takes `flex-1`.\n * - `Vertical` — buttons stack with full width.\n *\n * @default ButtonsAlignment.Horizontal\n */\n buttonsAlignment?: ButtonsAlignment;\n /**\n * Optional props for the primary action button. Renders with\n * `ButtonVariant.Primary` automatically. Appears second (right in\n * horizontal layout, bottom in vertical layout).\n *\n * Pass the localized label as `children`. Wire the click handler via\n * `onClick`. `ModalFooter` is i18n-agnostic and intentionally does not pull\n * strings from any translation context.\n */\n primaryButtonProps?: ModalFooterButtonProps;\n /**\n * Optional props for the secondary action button. Renders with\n * `ButtonVariant.Secondary` automatically. Appears first (left in\n * horizontal layout, top in vertical layout).\n */\n secondaryButtonProps?: ModalFooterButtonProps;\n /**\n * Optional prop for additional CSS classes to be applied to the\n * ModalFooter root. Merged with the component's defaults via `twMerge`.\n */\n className?: string;\n};\n"]}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import type { ComponentProps, ReactNode } from "react";
|
|
2
|
+
import type { ButtonProps } from "../Button/index.cjs";
|
|
3
|
+
/**
|
|
4
|
+
* Layout direction for the action button row.
|
|
5
|
+
*
|
|
6
|
+
* Mirrors `BottomSheetFooter`'s `ButtonsAlignment` on the React Native side so
|
|
7
|
+
* the modal/sheet families share semantics.
|
|
8
|
+
*/
|
|
9
|
+
export declare const ButtonsAlignment: {
|
|
10
|
+
readonly Horizontal: "horizontal";
|
|
11
|
+
readonly Vertical: "vertical";
|
|
12
|
+
};
|
|
13
|
+
export type ButtonsAlignment = (typeof ButtonsAlignment)[keyof typeof ButtonsAlignment];
|
|
14
|
+
/**
|
|
15
|
+
* Button props accepted by `ModalFooter`. The `variant` is enforced internally
|
|
16
|
+
* by the component (Primary or Secondary, depending on slot), so consumers
|
|
17
|
+
* cannot override it. The `data-*` index signature is preserved so test ids
|
|
18
|
+
* and other dataset attributes can be passed through `Partial`/`Omit`
|
|
19
|
+
* indirection.
|
|
20
|
+
*/
|
|
21
|
+
export type ModalFooterButtonProps = Omit<ButtonProps, 'variant'> & {
|
|
22
|
+
[key: `data-${string}`]: string | undefined;
|
|
23
|
+
};
|
|
24
|
+
export type ModalFooterProps = ComponentProps<'footer'> & {
|
|
25
|
+
/**
|
|
26
|
+
* Optional custom content rendered above the action button row. Use this
|
|
27
|
+
* for inline form controls (e.g. a "do not show again" checkbox) or to
|
|
28
|
+
* fully replace the built-in button row by omitting both
|
|
29
|
+
* `primaryButtonProps` and `secondaryButtonProps`.
|
|
30
|
+
*/
|
|
31
|
+
children?: ReactNode;
|
|
32
|
+
/**
|
|
33
|
+
* Optional layout direction for the action button row.
|
|
34
|
+
*
|
|
35
|
+
* - `Horizontal` — buttons share the row, each takes `flex-1`.
|
|
36
|
+
* - `Vertical` — buttons stack with full width.
|
|
37
|
+
*
|
|
38
|
+
* @default ButtonsAlignment.Horizontal
|
|
39
|
+
*/
|
|
40
|
+
buttonsAlignment?: ButtonsAlignment;
|
|
41
|
+
/**
|
|
42
|
+
* Optional props for the primary action button. Renders with
|
|
43
|
+
* `ButtonVariant.Primary` automatically. Appears second (right in
|
|
44
|
+
* horizontal layout, bottom in vertical layout).
|
|
45
|
+
*
|
|
46
|
+
* Pass the localized label as `children`. Wire the click handler via
|
|
47
|
+
* `onClick`. `ModalFooter` is i18n-agnostic and intentionally does not pull
|
|
48
|
+
* strings from any translation context.
|
|
49
|
+
*/
|
|
50
|
+
primaryButtonProps?: ModalFooterButtonProps;
|
|
51
|
+
/**
|
|
52
|
+
* Optional props for the secondary action button. Renders with
|
|
53
|
+
* `ButtonVariant.Secondary` automatically. Appears first (left in
|
|
54
|
+
* horizontal layout, top in vertical layout).
|
|
55
|
+
*/
|
|
56
|
+
secondaryButtonProps?: ModalFooterButtonProps;
|
|
57
|
+
/**
|
|
58
|
+
* Optional prop for additional CSS classes to be applied to the
|
|
59
|
+
* ModalFooter root. Merged with the component's defaults via `twMerge`.
|
|
60
|
+
*/
|
|
61
|
+
className?: string;
|
|
62
|
+
};
|
|
63
|
+
//# sourceMappingURL=ModalFooter.types.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ModalFooter.types.d.cts","sourceRoot":"","sources":["../../../src/components/ModalFooter/ModalFooter.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,cAAc;AAEvD,OAAO,KAAK,EAAE,WAAW,EAAE,4BAAkB;AAE7C;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB;;;CAGnB,CAAC;AACX,MAAM,MAAM,gBAAgB,GAC1B,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,OAAO,gBAAgB,CAAC,CAAC;AAE3D;;;;;;GAMG;AACH,MAAM,MAAM,sBAAsB,GAAG,IAAI,CAAC,WAAW,EAAE,SAAS,CAAC,GAAG;IAClE,CAAC,GAAG,EAAE,QAAQ,MAAM,EAAE,GAAG,MAAM,GAAG,SAAS,CAAC;CAC7C,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG,cAAc,CAAC,QAAQ,CAAC,GAAG;IACxD;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB;;;;;;;OAOG;IACH,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IACpC;;;;;;;;OAQG;IACH,kBAAkB,CAAC,EAAE,sBAAsB,CAAC;IAC5C;;;;OAIG;IACH,oBAAoB,CAAC,EAAE,sBAAsB,CAAC;IAC9C;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import type { ComponentProps, ReactNode } from "react";
|
|
2
|
+
import type { ButtonProps } from "../Button/index.mjs";
|
|
3
|
+
/**
|
|
4
|
+
* Layout direction for the action button row.
|
|
5
|
+
*
|
|
6
|
+
* Mirrors `BottomSheetFooter`'s `ButtonsAlignment` on the React Native side so
|
|
7
|
+
* the modal/sheet families share semantics.
|
|
8
|
+
*/
|
|
9
|
+
export declare const ButtonsAlignment: {
|
|
10
|
+
readonly Horizontal: "horizontal";
|
|
11
|
+
readonly Vertical: "vertical";
|
|
12
|
+
};
|
|
13
|
+
export type ButtonsAlignment = (typeof ButtonsAlignment)[keyof typeof ButtonsAlignment];
|
|
14
|
+
/**
|
|
15
|
+
* Button props accepted by `ModalFooter`. The `variant` is enforced internally
|
|
16
|
+
* by the component (Primary or Secondary, depending on slot), so consumers
|
|
17
|
+
* cannot override it. The `data-*` index signature is preserved so test ids
|
|
18
|
+
* and other dataset attributes can be passed through `Partial`/`Omit`
|
|
19
|
+
* indirection.
|
|
20
|
+
*/
|
|
21
|
+
export type ModalFooterButtonProps = Omit<ButtonProps, 'variant'> & {
|
|
22
|
+
[key: `data-${string}`]: string | undefined;
|
|
23
|
+
};
|
|
24
|
+
export type ModalFooterProps = ComponentProps<'footer'> & {
|
|
25
|
+
/**
|
|
26
|
+
* Optional custom content rendered above the action button row. Use this
|
|
27
|
+
* for inline form controls (e.g. a "do not show again" checkbox) or to
|
|
28
|
+
* fully replace the built-in button row by omitting both
|
|
29
|
+
* `primaryButtonProps` and `secondaryButtonProps`.
|
|
30
|
+
*/
|
|
31
|
+
children?: ReactNode;
|
|
32
|
+
/**
|
|
33
|
+
* Optional layout direction for the action button row.
|
|
34
|
+
*
|
|
35
|
+
* - `Horizontal` — buttons share the row, each takes `flex-1`.
|
|
36
|
+
* - `Vertical` — buttons stack with full width.
|
|
37
|
+
*
|
|
38
|
+
* @default ButtonsAlignment.Horizontal
|
|
39
|
+
*/
|
|
40
|
+
buttonsAlignment?: ButtonsAlignment;
|
|
41
|
+
/**
|
|
42
|
+
* Optional props for the primary action button. Renders with
|
|
43
|
+
* `ButtonVariant.Primary` automatically. Appears second (right in
|
|
44
|
+
* horizontal layout, bottom in vertical layout).
|
|
45
|
+
*
|
|
46
|
+
* Pass the localized label as `children`. Wire the click handler via
|
|
47
|
+
* `onClick`. `ModalFooter` is i18n-agnostic and intentionally does not pull
|
|
48
|
+
* strings from any translation context.
|
|
49
|
+
*/
|
|
50
|
+
primaryButtonProps?: ModalFooterButtonProps;
|
|
51
|
+
/**
|
|
52
|
+
* Optional props for the secondary action button. Renders with
|
|
53
|
+
* `ButtonVariant.Secondary` automatically. Appears first (left in
|
|
54
|
+
* horizontal layout, top in vertical layout).
|
|
55
|
+
*/
|
|
56
|
+
secondaryButtonProps?: ModalFooterButtonProps;
|
|
57
|
+
/**
|
|
58
|
+
* Optional prop for additional CSS classes to be applied to the
|
|
59
|
+
* ModalFooter root. Merged with the component's defaults via `twMerge`.
|
|
60
|
+
*/
|
|
61
|
+
className?: string;
|
|
62
|
+
};
|
|
63
|
+
//# sourceMappingURL=ModalFooter.types.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ModalFooter.types.d.mts","sourceRoot":"","sources":["../../../src/components/ModalFooter/ModalFooter.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,cAAc;AAEvD,OAAO,KAAK,EAAE,WAAW,EAAE,4BAAkB;AAE7C;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB;;;CAGnB,CAAC;AACX,MAAM,MAAM,gBAAgB,GAC1B,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,OAAO,gBAAgB,CAAC,CAAC;AAE3D;;;;;;GAMG;AACH,MAAM,MAAM,sBAAsB,GAAG,IAAI,CAAC,WAAW,EAAE,SAAS,CAAC,GAAG;IAClE,CAAC,GAAG,EAAE,QAAQ,MAAM,EAAE,GAAG,MAAM,GAAG,SAAS,CAAC;CAC7C,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG,cAAc,CAAC,QAAQ,CAAC,GAAG;IACxD;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB;;;;;;;OAOG;IACH,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IACpC;;;;;;;;OAQG;IACH,kBAAkB,CAAC,EAAE,sBAAsB,CAAC;IAC5C;;;;OAIG;IACH,oBAAoB,CAAC,EAAE,sBAAsB,CAAC;IAC9C;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Layout direction for the action button row.
|
|
3
|
+
*
|
|
4
|
+
* Mirrors `BottomSheetFooter`'s `ButtonsAlignment` on the React Native side so
|
|
5
|
+
* the modal/sheet families share semantics.
|
|
6
|
+
*/
|
|
7
|
+
export const ButtonsAlignment = {
|
|
8
|
+
Horizontal: 'horizontal',
|
|
9
|
+
Vertical: 'vertical',
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=ModalFooter.types.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ModalFooter.types.mjs","sourceRoot":"","sources":["../../../src/components/ModalFooter/ModalFooter.types.ts"],"names":[],"mappings":"AAIA;;;;;GAKG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,UAAU,EAAE,YAAY;IACxB,QAAQ,EAAE,UAAU;CACZ,CAAC","sourcesContent":["import type { ComponentProps, ReactNode } from 'react';\n\nimport type { ButtonProps } from '../Button';\n\n/**\n * Layout direction for the action button row.\n *\n * Mirrors `BottomSheetFooter`'s `ButtonsAlignment` on the React Native side so\n * the modal/sheet families share semantics.\n */\nexport const ButtonsAlignment = {\n Horizontal: 'horizontal',\n Vertical: 'vertical',\n} as const;\nexport type ButtonsAlignment =\n (typeof ButtonsAlignment)[keyof typeof ButtonsAlignment];\n\n/**\n * Button props accepted by `ModalFooter`. The `variant` is enforced internally\n * by the component (Primary or Secondary, depending on slot), so consumers\n * cannot override it. The `data-*` index signature is preserved so test ids\n * and other dataset attributes can be passed through `Partial`/`Omit`\n * indirection.\n */\nexport type ModalFooterButtonProps = Omit<ButtonProps, 'variant'> & {\n [key: `data-${string}`]: string | undefined;\n};\n\nexport type ModalFooterProps = ComponentProps<'footer'> & {\n /**\n * Optional custom content rendered above the action button row. Use this\n * for inline form controls (e.g. a \"do not show again\" checkbox) or to\n * fully replace the built-in button row by omitting both\n * `primaryButtonProps` and `secondaryButtonProps`.\n */\n children?: ReactNode;\n /**\n * Optional layout direction for the action button row.\n *\n * - `Horizontal` — buttons share the row, each takes `flex-1`.\n * - `Vertical` — buttons stack with full width.\n *\n * @default ButtonsAlignment.Horizontal\n */\n buttonsAlignment?: ButtonsAlignment;\n /**\n * Optional props for the primary action button. Renders with\n * `ButtonVariant.Primary` automatically. Appears second (right in\n * horizontal layout, bottom in vertical layout).\n *\n * Pass the localized label as `children`. Wire the click handler via\n * `onClick`. `ModalFooter` is i18n-agnostic and intentionally does not pull\n * strings from any translation context.\n */\n primaryButtonProps?: ModalFooterButtonProps;\n /**\n * Optional props for the secondary action button. Renders with\n * `ButtonVariant.Secondary` automatically. Appears first (left in\n * horizontal layout, top in vertical layout).\n */\n secondaryButtonProps?: ModalFooterButtonProps;\n /**\n * Optional prop for additional CSS classes to be applied to the\n * ModalFooter root. Merged with the component's defaults via `twMerge`.\n */\n className?: string;\n};\n"]}
|