@fountain-ui/core 3.0.0-alpha.5 → 3.0.0-alpha.50
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/build/commonjs/Accordion/Accordion.js +20 -13
- package/build/commonjs/Accordion/Accordion.js.map +1 -1
- package/build/commonjs/Accordion/AccordionProps.js.map +1 -1
- package/build/commonjs/Accordion/useVariantStyleMap.js +13 -6
- package/build/commonjs/Accordion/useVariantStyleMap.js.map +1 -1
- package/build/commonjs/AppBar/AppBar.js +1 -1
- package/build/commonjs/AppBar/AppBar.js.map +1 -1
- package/build/commonjs/AspectRatio/AspectRatioNative.js +1 -1
- package/build/commonjs/AspectRatio/AspectRatioNative.js.map +1 -1
- package/build/commonjs/AspectRatio/AspectRatioWeb.js +1 -1
- package/build/commonjs/AspectRatio/AspectRatioWeb.js.map +1 -1
- package/build/commonjs/Badge/Badge.js +4 -3
- package/build/commonjs/Badge/Badge.js.map +1 -1
- package/build/commonjs/Badge/BadgeProps.js.map +1 -1
- package/build/commonjs/BottomSheetTitle/BottomSheetTitle.js +7 -3
- package/build/commonjs/BottomSheetTitle/BottomSheetTitle.js.map +1 -1
- package/build/commonjs/BottomSheetTitle/BottomSheetTitleProps.js.map +1 -1
- package/build/commonjs/Button/Button.js +26 -12
- package/build/commonjs/Button/Button.js.map +1 -1
- package/build/commonjs/Button/ButtonProps.js.map +1 -1
- package/build/commonjs/Button/useVariantStyleMap.js +18 -0
- package/build/commonjs/Button/useVariantStyleMap.js.map +1 -1
- package/build/commonjs/ButtonBase/ButtonBase.js +1 -1
- package/build/commonjs/ButtonBase/ButtonBase.js.map +1 -1
- package/build/commonjs/ButtonBase/index.js +2 -2
- package/build/commonjs/ButtonBase/index.js.map +1 -1
- package/build/commonjs/Checkbox/Checkbox.js +4 -1
- package/build/commonjs/Checkbox/Checkbox.js.map +1 -1
- package/build/commonjs/Checkbox/useVariantStyleMap.js +6 -2
- package/build/commonjs/Checkbox/useVariantStyleMap.js.map +1 -1
- package/build/commonjs/Chip/Chip.js +27 -14
- package/build/commonjs/Chip/Chip.js.map +1 -1
- package/build/commonjs/Chip/ChipProps.js +5 -1
- package/build/commonjs/Chip/ChipProps.js.map +1 -1
- package/build/commonjs/Chip/index.js +12 -0
- package/build/commonjs/Chip/index.js.map +1 -1
- package/build/commonjs/Chip/useChipStyle.js +59 -32
- package/build/commonjs/Chip/useChipStyle.js.map +1 -1
- package/build/commonjs/Dialog/Dialog.js +11 -12
- package/build/commonjs/Dialog/Dialog.js.map +1 -1
- package/build/commonjs/Dialog/DialogProps.js +1 -1
- package/build/commonjs/Dialog/DialogProps.js.map +1 -1
- package/build/commonjs/Dialog/useDialogSectionStyle.js +6 -4
- package/build/commonjs/Dialog/useDialogSectionStyle.js.map +1 -1
- package/build/commonjs/Dialog/useDialogStyle.js +19 -8
- package/build/commonjs/Dialog/useDialogStyle.js.map +1 -1
- package/build/commonjs/DialogActions/DialogActions.js +0 -1
- package/build/commonjs/DialogActions/DialogActions.js.map +1 -1
- package/build/commonjs/DialogTitle/DialogLargeTitle.js +80 -0
- package/build/commonjs/DialogTitle/DialogLargeTitle.js.map +1 -0
- package/build/commonjs/DialogTitle/DialogTitle.js +8 -4
- package/build/commonjs/DialogTitle/DialogTitle.js.map +1 -1
- package/build/commonjs/Divider/Divider.js +17 -9
- package/build/commonjs/Divider/Divider.js.map +1 -1
- package/build/commonjs/Divider/DividerProps.js +1 -1
- package/build/commonjs/Divider/DividerProps.js.map +1 -1
- package/build/commonjs/Empty/Empty.js +1 -1
- package/build/commonjs/Empty/Empty.js.map +1 -1
- package/build/commonjs/Flexbox/Flexbox.js +2 -0
- package/build/commonjs/Flexbox/Flexbox.js.map +1 -1
- package/build/commonjs/Flexbox/FlexboxProps.js.map +1 -1
- package/build/commonjs/IconButton/IconButton.js +3 -0
- package/build/commonjs/IconButton/IconButton.js.map +1 -1
- package/build/commonjs/IconButton/IconButtonProps.js +1 -1
- package/build/commonjs/IconButton/IconButtonProps.js.map +1 -1
- package/build/commonjs/Image/Image.js +13 -4
- package/build/commonjs/Image/Image.js.map +1 -1
- package/build/commonjs/Image/ImageProps.js.map +1 -1
- package/build/commonjs/Image/OverlayCloseButton/OverlayCloseButton.js +46 -0
- package/build/commonjs/Image/OverlayCloseButton/OverlayCloseButton.js.map +1 -0
- package/build/commonjs/Image/OverlayCloseButton/OverlayCloseButtonProps.js +2 -0
- package/build/commonjs/Image/OverlayCloseButton/OverlayCloseButtonProps.js.map +1 -0
- package/build/commonjs/Image/OverlayCloseButton/index.js +16 -0
- package/build/commonjs/Image/OverlayCloseButton/index.js.map +1 -0
- package/build/commonjs/Image/preload.js +10 -0
- package/build/commonjs/Image/preload.js.map +1 -0
- package/build/commonjs/Image/preload.native.js +22 -0
- package/build/commonjs/Image/preload.native.js.map +1 -0
- package/build/commonjs/ImageCore/ImageCoreNative.js +13 -10
- package/build/commonjs/ImageCore/ImageCoreNative.js.map +1 -1
- package/build/commonjs/ImageCore/ImageCoreProps.js.map +1 -1
- package/build/commonjs/ListItem/ListItem.js +5 -15
- package/build/commonjs/ListItem/ListItem.js.map +1 -1
- package/build/commonjs/ListItemText/ListItemText.js +2 -2
- package/build/commonjs/ListItemText/ListItemText.js.map +1 -1
- package/build/commonjs/ListSubheader/ListSubheader.js +1 -1
- package/build/commonjs/ListSubheader/ListSubheader.js.map +1 -1
- package/build/commonjs/Modal/Modal.js +29 -20
- package/build/commonjs/Modal/Modal.js.map +1 -1
- package/build/commonjs/Modal/ModalProps.js.map +1 -1
- package/build/commonjs/Pagination/NumberPagination.js +4 -2
- package/build/commonjs/Pagination/NumberPagination.js.map +1 -1
- package/build/commonjs/Pagination/Pagination.js +2 -0
- package/build/commonjs/Pagination/Pagination.js.map +1 -1
- package/build/commonjs/Pagination/PaginationProps.js +3 -1
- package/build/commonjs/Pagination/PaginationProps.js.map +1 -1
- package/build/commonjs/Pagination/index.js +6 -0
- package/build/commonjs/Pagination/index.js.map +1 -1
- package/build/commonjs/PaginationItem/PaginationItem.js +32 -22
- package/build/commonjs/PaginationItem/PaginationItem.js.map +1 -1
- package/build/commonjs/PaginationItem/PaginationItemProps.js.map +1 -1
- package/build/commonjs/Radio/Radio.js +31 -8
- package/build/commonjs/Radio/Radio.js.map +1 -1
- package/build/commonjs/Radio/RadioProps.js.map +1 -1
- package/build/commonjs/RadioGroup/RadioGroup.js +2 -27
- package/build/commonjs/RadioGroup/RadioGroup.js.map +1 -1
- package/build/commonjs/ShadowView/ShadowView.native.js +1 -1
- package/build/commonjs/ShadowView/ShadowView.native.js.map +1 -1
- package/build/commonjs/Slider/Slider.js +22 -18
- package/build/commonjs/Slider/Slider.js.map +1 -1
- package/build/commonjs/SnackbarContent/SnackbarContent.js +24 -7
- package/build/commonjs/SnackbarContent/SnackbarContent.js.map +1 -1
- package/build/commonjs/Tab/Tab.js +21 -19
- package/build/commonjs/Tab/Tab.js.map +1 -1
- package/build/commonjs/Tab/TabProps.js +4 -2
- package/build/commonjs/Tab/TabProps.js.map +1 -1
- package/build/commonjs/Tab/index.js +14 -0
- package/build/commonjs/Tab/index.js.map +1 -1
- package/build/commonjs/Tab/useVariantStyleMap.js +57 -16
- package/build/commonjs/Tab/useVariantStyleMap.js.map +1 -1
- package/build/commonjs/TabBase/TabBase.js +1 -8
- package/build/commonjs/TabBase/TabBase.js.map +1 -1
- package/build/commonjs/TabBase/TabBaseProps.js.map +1 -1
- package/build/commonjs/Tabs/Tabs.js +32 -11
- package/build/commonjs/Tabs/Tabs.js.map +1 -1
- package/build/commonjs/Tabs/TabsProps.js.map +1 -1
- package/build/commonjs/Tabs/index.js.map +1 -1
- package/build/commonjs/Tabs/useTabsStyle.js +81 -0
- package/build/commonjs/Tabs/useTabsStyle.js.map +1 -0
- package/build/commonjs/TextField/TextField.js +99 -17
- package/build/commonjs/TextField/TextField.js.map +1 -1
- package/build/commonjs/TextField/TextFieldProps.js +3 -1
- package/build/commonjs/TextField/TextFieldProps.js.map +1 -1
- package/build/commonjs/TextField/useVariantStyleMap.js +50 -30
- package/build/commonjs/TextField/useVariantStyleMap.js.map +1 -1
- package/build/commonjs/Toolbar/BackButton/BackButton.js +47 -0
- package/build/commonjs/Toolbar/BackButton/BackButton.js.map +1 -0
- package/build/commonjs/Toolbar/BackButton/BackButtonProps.js +2 -0
- package/build/commonjs/Toolbar/BackButton/BackButtonProps.js.map +1 -0
- package/build/commonjs/Toolbar/BackButton/index.js +16 -0
- package/build/commonjs/Toolbar/BackButton/index.js.map +1 -0
- package/build/commonjs/Toolbar/Toolbar.js +22 -12
- package/build/commonjs/Toolbar/Toolbar.js.map +1 -1
- package/build/commonjs/Toolbar/ToolbarProps.js.map +1 -1
- package/build/commonjs/Tooltip/Beaks/index.js +32 -0
- package/build/commonjs/Tooltip/Beaks/index.js.map +1 -1
- package/build/commonjs/Tooltip/Tooltip.js +23 -23
- package/build/commonjs/Tooltip/Tooltip.js.map +1 -1
- package/build/commonjs/Tooltip/TooltipProps.js.map +1 -1
- package/build/commonjs/Tooltip/index.js +19 -0
- package/build/commonjs/Tooltip/index.js.map +1 -1
- package/build/commonjs/Typography/Typography.js +9 -2
- package/build/commonjs/Typography/Typography.js.map +1 -1
- package/build/commonjs/Typography/TypographyProps.js.map +1 -1
- package/build/commonjs/hooks/useCollapsibleAppBar.js +21 -13
- package/build/commonjs/hooks/useCollapsibleAppBar.js.map +1 -1
- package/build/commonjs/hooks/useContentContainerStyle.js +35 -17
- package/build/commonjs/hooks/useContentContainerStyle.js.map +1 -1
- package/build/commonjs/hooks/useFadeInAppBar.js +4 -4
- package/build/commonjs/hooks/useFadeInAppBar.js.map +1 -1
- package/build/commonjs/internal/icons/AppBarChevronLeft.js +23 -0
- package/build/commonjs/internal/icons/AppBarChevronLeft.js.map +1 -0
- package/build/commonjs/internal/icons/ChevronLeft.js +4 -2
- package/build/commonjs/internal/icons/ChevronLeft.js.map +1 -1
- package/build/commonjs/internal/icons/ChevronRight.js +4 -2
- package/build/commonjs/internal/icons/ChevronRight.js.map +1 -1
- package/build/commonjs/internal/icons/ChipClose.js +23 -0
- package/build/commonjs/internal/icons/ChipClose.js.map +1 -0
- package/build/commonjs/internal/icons/Clear.js +3 -3
- package/build/commonjs/internal/icons/Clear.js.map +1 -1
- package/build/commonjs/internal/icons/Close.js +4 -2
- package/build/commonjs/internal/icons/Close.js.map +1 -1
- package/build/commonjs/internal/icons/CloseCircleFillPierced.js +23 -0
- package/build/commonjs/internal/icons/CloseCircleFillPierced.js.map +1 -0
- package/build/commonjs/internal/icons/Search.js +2 -2
- package/build/commonjs/internal/icons/Search.js.map +1 -1
- package/build/commonjs/internal/icons/index.js +24 -0
- package/build/commonjs/internal/icons/index.js.map +1 -1
- package/build/module/Accordion/Accordion.js +20 -13
- package/build/module/Accordion/Accordion.js.map +1 -1
- package/build/module/Accordion/AccordionProps.js.map +1 -1
- package/build/module/Accordion/useVariantStyleMap.js +13 -6
- package/build/module/Accordion/useVariantStyleMap.js.map +1 -1
- package/build/module/AppBar/AppBar.js +1 -1
- package/build/module/AppBar/AppBar.js.map +1 -1
- package/build/module/AspectRatio/AspectRatioNative.js +1 -1
- package/build/module/AspectRatio/AspectRatioNative.js.map +1 -1
- package/build/module/AspectRatio/AspectRatioWeb.js +1 -1
- package/build/module/AspectRatio/AspectRatioWeb.js.map +1 -1
- package/build/module/Badge/Badge.js +4 -3
- package/build/module/Badge/Badge.js.map +1 -1
- package/build/module/Badge/BadgeProps.js.map +1 -1
- package/build/module/BottomSheetTitle/BottomSheetTitle.js +7 -3
- package/build/module/BottomSheetTitle/BottomSheetTitle.js.map +1 -1
- package/build/module/BottomSheetTitle/BottomSheetTitleProps.js.map +1 -1
- package/build/module/Button/Button.js +27 -13
- package/build/module/Button/Button.js.map +1 -1
- package/build/module/Button/ButtonProps.js.map +1 -1
- package/build/module/Button/useVariantStyleMap.js +18 -0
- package/build/module/Button/useVariantStyleMap.js.map +1 -1
- package/build/module/ButtonBase/ButtonBase.js +1 -1
- package/build/module/ButtonBase/ButtonBase.js.map +1 -1
- package/build/module/ButtonBase/index.js +1 -1
- package/build/module/ButtonBase/index.js.map +1 -1
- package/build/module/Checkbox/Checkbox.js +4 -1
- package/build/module/Checkbox/Checkbox.js.map +1 -1
- package/build/module/Checkbox/useVariantStyleMap.js +6 -2
- package/build/module/Checkbox/useVariantStyleMap.js.map +1 -1
- package/build/module/Chip/Chip.js +23 -13
- package/build/module/Chip/Chip.js.map +1 -1
- package/build/module/Chip/ChipProps.js +2 -0
- package/build/module/Chip/ChipProps.js.map +1 -1
- package/build/module/Chip/index.js +1 -1
- package/build/module/Chip/index.js.map +1 -1
- package/build/module/Chip/useChipStyle.js +59 -32
- package/build/module/Chip/useChipStyle.js.map +1 -1
- package/build/module/Dialog/Dialog.js +11 -11
- package/build/module/Dialog/Dialog.js.map +1 -1
- package/build/module/Dialog/DialogProps.js +1 -1
- package/build/module/Dialog/DialogProps.js.map +1 -1
- package/build/module/Dialog/useDialogSectionStyle.js +6 -4
- package/build/module/Dialog/useDialogSectionStyle.js.map +1 -1
- package/build/module/Dialog/useDialogStyle.js +18 -8
- package/build/module/Dialog/useDialogStyle.js.map +1 -1
- package/build/module/DialogActions/DialogActions.js +0 -1
- package/build/module/DialogActions/DialogActions.js.map +1 -1
- package/build/module/DialogTitle/DialogLargeTitle.js +65 -0
- package/build/module/DialogTitle/DialogLargeTitle.js.map +1 -0
- package/build/module/DialogTitle/DialogTitle.js +6 -3
- package/build/module/DialogTitle/DialogTitle.js.map +1 -1
- package/build/module/Divider/Divider.js +7 -0
- package/build/module/Divider/Divider.js.map +1 -1
- package/build/module/Divider/DividerProps.js +1 -1
- package/build/module/Divider/DividerProps.js.map +1 -1
- package/build/module/Empty/Empty.js +1 -1
- package/build/module/Empty/Empty.js.map +1 -1
- package/build/module/Flexbox/Flexbox.js +2 -0
- package/build/module/Flexbox/Flexbox.js.map +1 -1
- package/build/module/Flexbox/FlexboxProps.js.map +1 -1
- package/build/module/IconButton/IconButton.js +3 -0
- package/build/module/IconButton/IconButton.js.map +1 -1
- package/build/module/IconButton/IconButtonProps.js +1 -1
- package/build/module/IconButton/IconButtonProps.js.map +1 -1
- package/build/module/Image/Image.js +11 -4
- package/build/module/Image/Image.js.map +1 -1
- package/build/module/Image/ImageProps.js.map +1 -1
- package/build/module/Image/OverlayCloseButton/OverlayCloseButton.js +31 -0
- package/build/module/Image/OverlayCloseButton/OverlayCloseButton.js.map +1 -0
- package/build/module/Image/OverlayCloseButton/OverlayCloseButtonProps.js +2 -0
- package/build/module/Image/OverlayCloseButton/OverlayCloseButtonProps.js.map +1 -0
- package/build/module/Image/OverlayCloseButton/index.js +2 -0
- package/build/module/Image/OverlayCloseButton/index.js.map +1 -0
- package/build/module/Image/preload.js +3 -0
- package/build/module/Image/preload.js.map +1 -0
- package/build/module/Image/preload.native.js +12 -0
- package/build/module/Image/preload.native.js.map +1 -0
- package/build/module/ImageCore/ImageCoreNative.js +14 -10
- package/build/module/ImageCore/ImageCoreNative.js.map +1 -1
- package/build/module/ImageCore/ImageCoreProps.js.map +1 -1
- package/build/module/ListItem/ListItem.js +5 -15
- package/build/module/ListItem/ListItem.js.map +1 -1
- package/build/module/ListItemText/ListItemText.js +2 -2
- package/build/module/ListItemText/ListItemText.js.map +1 -1
- package/build/module/ListSubheader/ListSubheader.js +1 -1
- package/build/module/ListSubheader/ListSubheader.js.map +1 -1
- package/build/module/Modal/Modal.js +30 -21
- package/build/module/Modal/Modal.js.map +1 -1
- package/build/module/Modal/ModalProps.js.map +1 -1
- package/build/module/Pagination/NumberPagination.js +4 -2
- package/build/module/Pagination/NumberPagination.js.map +1 -1
- package/build/module/Pagination/Pagination.js +2 -0
- package/build/module/Pagination/Pagination.js.map +1 -1
- package/build/module/Pagination/PaginationProps.js +1 -0
- package/build/module/Pagination/PaginationProps.js.map +1 -1
- package/build/module/Pagination/index.js +1 -1
- package/build/module/Pagination/index.js.map +1 -1
- package/build/module/PaginationItem/PaginationItem.js +28 -21
- package/build/module/PaginationItem/PaginationItem.js.map +1 -1
- package/build/module/PaginationItem/PaginationItemProps.js.map +1 -1
- package/build/module/Radio/Radio.js +28 -8
- package/build/module/Radio/Radio.js.map +1 -1
- package/build/module/Radio/RadioProps.js.map +1 -1
- package/build/module/RadioGroup/RadioGroup.js +2 -20
- package/build/module/RadioGroup/RadioGroup.js.map +1 -1
- package/build/module/ShadowView/ShadowView.native.js +2 -2
- package/build/module/ShadowView/ShadowView.native.js.map +1 -1
- package/build/module/Slider/Slider.js +22 -18
- package/build/module/Slider/Slider.js.map +1 -1
- package/build/module/SnackbarContent/SnackbarContent.js +24 -7
- package/build/module/SnackbarContent/SnackbarContent.js.map +1 -1
- package/build/module/Tab/Tab.js +22 -19
- package/build/module/Tab/Tab.js.map +1 -1
- package/build/module/Tab/TabProps.js +2 -1
- package/build/module/Tab/TabProps.js.map +1 -1
- package/build/module/Tab/index.js +1 -0
- package/build/module/Tab/index.js.map +1 -1
- package/build/module/Tab/useVariantStyleMap.js +57 -16
- package/build/module/Tab/useVariantStyleMap.js.map +1 -1
- package/build/module/TabBase/TabBase.js +1 -8
- package/build/module/TabBase/TabBase.js.map +1 -1
- package/build/module/TabBase/TabBaseProps.js.map +1 -1
- package/build/module/Tabs/Tabs.js +31 -12
- package/build/module/Tabs/Tabs.js.map +1 -1
- package/build/module/Tabs/TabsProps.js.map +1 -1
- package/build/module/Tabs/index.js.map +1 -1
- package/build/module/Tabs/useTabsStyle.js +71 -0
- package/build/module/Tabs/useTabsStyle.js.map +1 -0
- package/build/module/TextField/TextField.js +99 -18
- package/build/module/TextField/TextField.js.map +1 -1
- package/build/module/TextField/TextFieldProps.js +1 -0
- package/build/module/TextField/TextFieldProps.js.map +1 -1
- package/build/module/TextField/useVariantStyleMap.js +49 -30
- package/build/module/TextField/useVariantStyleMap.js.map +1 -1
- package/build/module/Toolbar/BackButton/BackButton.js +32 -0
- package/build/module/Toolbar/BackButton/BackButton.js.map +1 -0
- package/build/module/Toolbar/BackButton/BackButtonProps.js +2 -0
- package/build/module/Toolbar/BackButton/BackButtonProps.js.map +1 -0
- package/build/module/Toolbar/BackButton/index.js +2 -0
- package/build/module/Toolbar/BackButton/index.js.map +1 -0
- package/build/module/Toolbar/Toolbar.js +20 -12
- package/build/module/Toolbar/Toolbar.js.map +1 -1
- package/build/module/Toolbar/ToolbarProps.js.map +1 -1
- package/build/module/Tooltip/Beaks/index.js +4 -0
- package/build/module/Tooltip/Beaks/index.js.map +1 -1
- package/build/module/Tooltip/Tooltip.js +17 -16
- package/build/module/Tooltip/Tooltip.js.map +1 -1
- package/build/module/Tooltip/TooltipProps.js.map +1 -1
- package/build/module/Tooltip/index.js +1 -0
- package/build/module/Tooltip/index.js.map +1 -1
- package/build/module/Typography/Typography.js +9 -2
- package/build/module/Typography/Typography.js.map +1 -1
- package/build/module/Typography/TypographyProps.js.map +1 -1
- package/build/module/hooks/useCollapsibleAppBar.js +22 -13
- package/build/module/hooks/useCollapsibleAppBar.js.map +1 -1
- package/build/module/hooks/useContentContainerStyle.js +32 -13
- package/build/module/hooks/useContentContainerStyle.js.map +1 -1
- package/build/module/hooks/useFadeInAppBar.js +4 -4
- package/build/module/hooks/useFadeInAppBar.js.map +1 -1
- package/build/module/internal/icons/AppBarChevronLeft.js +9 -0
- package/build/module/internal/icons/AppBarChevronLeft.js.map +1 -0
- package/build/module/internal/icons/ChevronLeft.js +4 -2
- package/build/module/internal/icons/ChevronLeft.js.map +1 -1
- package/build/module/internal/icons/ChevronRight.js +4 -2
- package/build/module/internal/icons/ChevronRight.js.map +1 -1
- package/build/module/internal/icons/ChipClose.js +9 -0
- package/build/module/internal/icons/ChipClose.js.map +1 -0
- package/build/module/internal/icons/Clear.js +3 -3
- package/build/module/internal/icons/Clear.js.map +1 -1
- package/build/module/internal/icons/Close.js +4 -2
- package/build/module/internal/icons/Close.js.map +1 -1
- package/build/module/internal/icons/CloseCircleFillPierced.js +9 -0
- package/build/module/internal/icons/CloseCircleFillPierced.js.map +1 -0
- package/build/module/internal/icons/Search.js +2 -2
- package/build/module/internal/icons/Search.js.map +1 -1
- package/build/module/internal/icons/index.js +3 -0
- package/build/module/internal/icons/index.js.map +1 -1
- package/build/typescript/Accordion/Accordion.d.ts +0 -1
- package/build/typescript/Accordion/AccordionProps.d.ts +4 -1
- package/build/typescript/Accordion/useVariantStyleMap.d.ts +1 -0
- package/build/typescript/AspectRatio/AspectRatioNative.d.ts +0 -1
- package/build/typescript/AspectRatio/AspectRatioWeb.d.ts +0 -1
- package/build/typescript/Avatar/Avatar.d.ts +0 -1
- package/build/typescript/Badge/Badge.d.ts +0 -1
- package/build/typescript/Badge/BadgeProps.d.ts +10 -5
- package/build/typescript/BottomSheetActions/BottomSheetActions.d.ts +0 -1
- package/build/typescript/BottomSheetContent/BottomSheetContent.d.ts +0 -1
- package/build/typescript/BottomSheetTitle/BottomSheetTitle.d.ts +0 -1
- package/build/typescript/BottomSheetTitle/BottomSheetTitleProps.d.ts +3 -3
- package/build/typescript/Button/Button.d.ts +0 -1
- package/build/typescript/Button/ButtonProps.d.ts +5 -0
- package/build/typescript/ButtonBase/ButtonBase.d.ts +0 -1
- package/build/typescript/ButtonBase/index.d.ts +1 -1
- package/build/typescript/ButtonSet/ButtonSet.d.ts +0 -1
- package/build/typescript/Card/Card.d.ts +0 -1
- package/build/typescript/CardActions/CardActions.d.ts +0 -1
- package/build/typescript/CardContent/CardContent.d.ts +0 -1
- package/build/typescript/CardMedia/CardMedia.d.ts +0 -1
- package/build/typescript/Checkbox/Checkbox.d.ts +0 -1
- package/build/typescript/Checkbox/useVariantStyleMap.d.ts +1 -0
- package/build/typescript/Chip/Chip.d.ts +0 -1
- package/build/typescript/Chip/ChipProps.d.ts +18 -4
- package/build/typescript/Chip/index.d.ts +2 -2
- package/build/typescript/Chip/useChipStyle.d.ts +6 -3
- package/build/typescript/CircularProgress/CircularProgress.d.ts +0 -1
- package/build/typescript/Column/Column.d.ts +0 -1
- package/build/typescript/Dialog/Dialog.d.ts +0 -1
- package/build/typescript/Dialog/DialogProps.d.ts +1 -6
- package/build/typescript/Dialog/useDialogSectionStyle.d.ts +1 -2
- package/build/typescript/Dialog/useDialogStyle.d.ts +1 -1
- package/build/typescript/DialogActions/DialogActions.d.ts +0 -1
- package/build/typescript/DialogContent/DialogContent.d.ts +0 -1
- package/build/typescript/DialogMedia/DialogMedia.d.ts +0 -1
- package/build/typescript/DialogTitle/DialogLargeTitle.d.ts +8 -0
- package/build/typescript/DialogTitle/DialogTitle.d.ts +6 -2
- package/build/typescript/Divider/Divider.d.ts +0 -1
- package/build/typescript/Divider/DividerProps.d.ts +1 -1
- package/build/typescript/Empty/Empty.d.ts +0 -1
- package/build/typescript/Fab/Fab.d.ts +0 -1
- package/build/typescript/Flexbox/Flexbox.d.ts +0 -1
- package/build/typescript/Flexbox/FlexboxProps.d.ts +4 -0
- package/build/typescript/IconButton/IconButton.d.ts +0 -1
- package/build/typescript/IconButton/IconButtonProps.d.ts +1 -1
- package/build/typescript/Image/Image.d.ts +6 -2
- package/build/typescript/Image/ImageProps.d.ts +6 -0
- package/build/typescript/Image/OverlayCloseButton/OverlayCloseButton.d.ts +2 -0
- package/build/typescript/Image/OverlayCloseButton/OverlayCloseButtonProps.d.ts +3 -0
- package/build/typescript/Image/OverlayCloseButton/index.d.ts +2 -0
- package/build/typescript/Image/preload.d.ts +2 -0
- package/build/typescript/Image/preload.native.d.ts +2 -0
- package/build/typescript/ImageCore/ImageCoreNative.d.ts +0 -1
- package/build/typescript/ImageCore/ImageCoreProps.d.ts +1 -0
- package/build/typescript/ImageCore/ImageCoreWeb.d.ts +0 -1
- package/build/typescript/Link/Link.d.ts +0 -1
- package/build/typescript/List/List.d.ts +0 -1
- package/build/typescript/ListItem/ListItem.d.ts +0 -1
- package/build/typescript/ListItemIcon/ListItemIcon.d.ts +0 -1
- package/build/typescript/ListItemSecondaryAction/ListItemSecondaryAction.d.ts +0 -1
- package/build/typescript/ListItemText/ListItemText.d.ts +0 -1
- package/build/typescript/ListSubheader/ListSubheader.d.ts +0 -1
- package/build/typescript/Menu/Menu.d.ts +0 -1
- package/build/typescript/MenuItem/MenuItem.d.ts +0 -1
- package/build/typescript/Modal/AnimatedContainer/index.d.ts +0 -1
- package/build/typescript/Modal/Modal.d.ts +0 -1
- package/build/typescript/Modal/ModalProps.d.ts +8 -0
- package/build/typescript/Pagination/NumberPagination.d.ts +0 -1
- package/build/typescript/Pagination/Pagination.d.ts +0 -1
- package/build/typescript/Pagination/PaginationProps.d.ts +12 -0
- package/build/typescript/Pagination/index.d.ts +2 -2
- package/build/typescript/PaginationItem/PaginationItemProps.d.ts +6 -0
- package/build/typescript/Portal/Portal.d.ts +0 -1
- package/build/typescript/Radio/Radio.d.ts +0 -1
- package/build/typescript/Radio/RadioProps.d.ts +4 -0
- package/build/typescript/RadioGroup/RadioGroup.d.ts +0 -1
- package/build/typescript/Row/Row.d.ts +0 -1
- package/build/typescript/Section/Section.d.ts +0 -1
- package/build/typescript/ShadowView/ShadowView.d.ts +0 -1
- package/build/typescript/ShadowView/ShadowView.native.d.ts +0 -1
- package/build/typescript/Slide/Slide.d.ts +0 -1
- package/build/typescript/Slider/Slider.d.ts +1 -1
- package/build/typescript/Snackbar/Snackbar.d.ts +0 -1
- package/build/typescript/SnackbarContent/SnackbarContent.d.ts +0 -1
- package/build/typescript/SnackbarContent/StatusIcon.d.ts +0 -1
- package/build/typescript/Spacer/Spacer.d.ts +0 -1
- package/build/typescript/SvgIcon/SvgIcon.d.ts +0 -1
- package/build/typescript/Switch/Switch.d.ts +0 -1
- package/build/typescript/Tab/Tab.d.ts +0 -1
- package/build/typescript/Tab/TabProps.d.ts +21 -2
- package/build/typescript/Tab/index.d.ts +2 -1
- package/build/typescript/Tab/useVariantStyleMap.d.ts +4 -2
- package/build/typescript/TabBase/TabBase.d.ts +0 -1
- package/build/typescript/TabBase/TabBaseProps.d.ts +0 -5
- package/build/typescript/Tabs/ScrollableTabsView.d.ts +0 -1
- package/build/typescript/Tabs/TabIndicator.d.ts +0 -1
- package/build/typescript/Tabs/Tabs.d.ts +1 -1
- package/build/typescript/Tabs/TabsProps.d.ts +6 -1
- package/build/typescript/Tabs/index.d.ts +1 -1
- package/build/typescript/Tabs/useTabsStyle.d.ts +8 -0
- package/build/typescript/TextField/TextFieldProps.d.ts +13 -0
- package/build/typescript/TextField/useVariantStyleMap.d.ts +4 -2
- package/build/typescript/Toggle/Toggle.d.ts +0 -1
- package/build/typescript/Toolbar/BackButton/BackButton.d.ts +2 -0
- package/build/typescript/Toolbar/BackButton/BackButtonProps.d.ts +4 -0
- package/build/typescript/Toolbar/BackButton/index.d.ts +2 -0
- package/build/typescript/Toolbar/Toolbar.d.ts +6 -2
- package/build/typescript/Toolbar/ToolbarProps.d.ts +0 -5
- package/build/typescript/Tooltip/Beaks/Beak.d.ts +0 -1
- package/build/typescript/Tooltip/Beaks/HorizontalLargeBeak.d.ts +0 -1
- package/build/typescript/Tooltip/Beaks/HorizontalSmallBeak.d.ts +0 -1
- package/build/typescript/Tooltip/Beaks/VerticalLargeBeak.d.ts +0 -1
- package/build/typescript/Tooltip/Beaks/VerticalSmallBeak.d.ts +0 -1
- package/build/typescript/Tooltip/Beaks/index.d.ts +4 -0
- package/build/typescript/Tooltip/Tooltip.d.ts +0 -1
- package/build/typescript/Tooltip/TooltipProps.d.ts +2 -2
- package/build/typescript/Tooltip/index.d.ts +1 -0
- package/build/typescript/Typography/TypographyProps.d.ts +4 -0
- package/build/typescript/animated/AnimatedAppBar.d.ts +1 -2
- package/build/typescript/animated/AnimatedFlatList.d.ts +1 -2
- package/build/typescript/animated/AnimatedTypography.d.ts +1 -2
- package/build/typescript/hooks/useCollapsibleAppBar.d.ts +2 -1
- package/build/typescript/hooks/useContentContainerStyle.d.ts +2 -1
- package/build/typescript/internal/icons/AppBarChevronLeft.d.ts +358 -0
- package/build/typescript/internal/icons/Check.d.ts +300 -73
- package/build/typescript/internal/icons/CheckCircle.d.ts +300 -73
- package/build/typescript/internal/icons/Checkbox.d.ts +300 -73
- package/build/typescript/internal/icons/CheckboxChecked.d.ts +300 -73
- package/build/typescript/internal/icons/CheckboxOn.d.ts +300 -73
- package/build/typescript/internal/icons/ChevronDown.d.ts +300 -73
- package/build/typescript/internal/icons/ChevronLeft.d.ts +300 -73
- package/build/typescript/internal/icons/ChevronRight.d.ts +300 -73
- package/build/typescript/internal/icons/ChipClose.d.ts +358 -0
- package/build/typescript/internal/icons/CircularProgress.d.ts +0 -1
- package/build/typescript/internal/icons/Clear.d.ts +300 -73
- package/build/typescript/internal/icons/Close.d.ts +300 -73
- package/build/typescript/internal/icons/CloseCircleFillPierced.d.ts +358 -0
- package/build/typescript/internal/icons/EyeOff.d.ts +300 -73
- package/build/typescript/internal/icons/EyeOn.d.ts +300 -73
- package/build/typescript/internal/icons/InfoCircle.d.ts +300 -73
- package/build/typescript/internal/icons/LoadingSpinner/index.d.ts +0 -1
- package/build/typescript/internal/icons/LoadingSpinner/index.native.d.ts +0 -1
- package/build/typescript/internal/icons/Radio.d.ts +300 -73
- package/build/typescript/internal/icons/RadioChecked.d.ts +300 -73
- package/build/typescript/internal/icons/Search.d.ts +300 -73
- package/build/typescript/internal/icons/index.d.ts +3 -0
- package/package.json +10 -10
- package/src/Accordion/Accordion.tsx +23 -14
- package/src/Accordion/AccordionProps.ts +4 -2
- package/src/Accordion/useVariantStyleMap.ts +12 -4
- package/src/AppBar/AppBar.tsx +2 -2
- package/src/AspectRatio/AspectRatioNative.tsx +2 -2
- package/src/AspectRatio/AspectRatioWeb.tsx +3 -3
- package/src/Badge/Badge.tsx +4 -3
- package/src/Badge/BadgeProps.ts +12 -6
- package/src/BottomSheetTitle/BottomSheetTitle.tsx +6 -2
- package/src/BottomSheetTitle/BottomSheetTitleProps.ts +3 -3
- package/src/Button/Button.tsx +28 -12
- package/src/Button/ButtonProps.ts +6 -0
- package/src/Button/useVariantStyleMap.ts +18 -0
- package/src/ButtonBase/ButtonBase.tsx +1 -1
- package/src/ButtonBase/index.ts +1 -1
- package/src/Checkbox/Checkbox.tsx +11 -8
- package/src/Checkbox/useVariantStyleMap.ts +6 -1
- package/src/Chip/Chip.tsx +27 -13
- package/src/Chip/ChipProps.ts +22 -4
- package/src/Chip/index.ts +2 -2
- package/src/Chip/useChipStyle.ts +75 -29
- package/src/Dialog/Dialog.tsx +13 -11
- package/src/Dialog/DialogProps.ts +1 -7
- package/src/Dialog/useDialogSectionStyle.ts +6 -4
- package/src/Dialog/useDialogStyle.ts +19 -7
- package/src/DialogActions/DialogActions.tsx +0 -1
- package/src/DialogTitle/DialogLargeTitle.tsx +95 -0
- package/src/DialogTitle/DialogTitle.tsx +6 -1
- package/src/Divider/Divider.tsx +5 -0
- package/src/Divider/DividerProps.ts +1 -1
- package/src/Empty/Empty.tsx +1 -1
- package/src/Flexbox/Flexbox.tsx +2 -0
- package/src/Flexbox/FlexboxProps.ts +5 -0
- package/src/IconButton/IconButton.tsx +2 -0
- package/src/IconButton/IconButtonProps.ts +1 -0
- package/src/Image/Image.tsx +13 -4
- package/src/Image/ImageProps.ts +7 -0
- package/src/Image/OverlayCloseButton/OverlayCloseButton.tsx +41 -0
- package/src/Image/OverlayCloseButton/OverlayCloseButtonProps.ts +3 -0
- package/src/Image/OverlayCloseButton/index.ts +2 -0
- package/src/Image/preload.native.ts +6 -0
- package/src/Image/preload.ts +5 -0
- package/src/ImageCore/ImageCoreNative.tsx +13 -10
- package/src/ImageCore/ImageCoreProps.ts +1 -0
- package/src/ListItem/ListItem.tsx +5 -15
- package/src/ListItemText/ListItemText.tsx +2 -2
- package/src/ListSubheader/ListSubheader.tsx +1 -1
- package/src/Modal/Modal.tsx +12 -4
- package/src/Modal/ModalProps.ts +9 -0
- package/src/Pagination/NumberPagination.tsx +7 -2
- package/src/Pagination/Pagination.tsx +3 -2
- package/src/Pagination/PaginationProps.ts +15 -0
- package/src/Pagination/index.ts +2 -2
- package/src/PaginationItem/PaginationItem.tsx +31 -24
- package/src/PaginationItem/PaginationItemProps.ts +7 -0
- package/src/Radio/Radio.tsx +46 -17
- package/src/Radio/RadioProps.ts +6 -0
- package/src/RadioGroup/RadioGroup.tsx +2 -28
- package/src/ShadowView/ShadowView.native.tsx +2 -2
- package/src/Slider/Slider.tsx +1 -0
- package/src/SnackbarContent/SnackbarContent.tsx +35 -14
- package/src/Tab/Tab.tsx +32 -22
- package/src/Tab/TabProps.ts +25 -2
- package/src/Tab/index.ts +2 -1
- package/src/Tab/useVariantStyleMap.ts +70 -17
- package/src/TabBase/TabBase.tsx +1 -9
- package/src/TabBase/TabBaseProps.ts +0 -6
- package/src/Tabs/Tabs.tsx +40 -13
- package/src/Tabs/TabsProps.ts +7 -1
- package/src/Tabs/index.ts +1 -1
- package/src/Tabs/useTabsStyle.ts +79 -0
- package/src/TextField/TextField.tsx +142 -47
- package/src/TextField/TextFieldProps.ts +16 -0
- package/src/TextField/useVariantStyleMap.ts +57 -30
- package/src/Toolbar/BackButton/BackButton.tsx +42 -0
- package/src/Toolbar/BackButton/BackButtonProps.ts +4 -0
- package/src/Toolbar/BackButton/index.ts +2 -0
- package/src/Toolbar/Toolbar.tsx +26 -17
- package/src/Toolbar/ToolbarProps.ts +0 -6
- package/src/Tooltip/Beaks/index.ts +4 -0
- package/src/Tooltip/Tooltip.tsx +16 -13
- package/src/Tooltip/TooltipProps.ts +2 -2
- package/src/Tooltip/index.ts +1 -0
- package/src/Typography/Typography.tsx +3 -1
- package/src/Typography/TypographyProps.ts +5 -0
- package/src/hooks/useCollapsibleAppBar.ts +27 -24
- package/src/hooks/useContentContainerStyle.ts +29 -12
- package/src/hooks/useFadeInAppBar.ts +4 -4
- package/src/internal/icons/AppBarChevronLeft.tsx +15 -0
- package/src/internal/icons/ChevronLeft.tsx +4 -1
- package/src/internal/icons/ChevronRight.tsx +4 -1
- package/src/internal/icons/ChipClose.tsx +13 -0
- package/src/internal/icons/Clear.tsx +3 -3
- package/src/internal/icons/Close.tsx +4 -1
- package/src/internal/icons/CloseCircleFillPierced.tsx +13 -0
- package/src/internal/icons/Search.tsx +2 -2
- package/src/internal/icons/index.ts +3 -0
- package/build/commonjs/ButtonBase/LegacyButtonBase.js +0 -126
- package/build/commonjs/ButtonBase/LegacyButtonBase.js.map +0 -1
- package/build/module/ButtonBase/LegacyButtonBase.js +0 -106
- package/build/module/ButtonBase/LegacyButtonBase.js.map +0 -1
- package/build/typescript/ButtonBase/LegacyButtonBase.d.ts +0 -5
- package/src/ButtonBase/LegacyButtonBase.tsx +0 -135
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useCallback","Animated","useAnimatedValue","useThrottle","isNotAndroid12","AnimatedPressable","ORIGINAL_OPACITY","ACTIVE_OPACITY","ORIGINAL_SCALE","MINIFIED_SCALE","SCALE_EFFECT_PRESS_IN_DELAY","OPACITY_EFFECT_PRESS_IN_DELAY","startTimingAnimationWithDefaults","value","toValue","timing","duration","useNativeDriver","start","ButtonBase","props","children","disabled","disableThrottle","onPress","_onPress","onPressOut","pressEffect","pressDelay","pressDelayOrNil","style","styleProp","throttleMillis","otherProps","handlePress","periodMillis","callback","opacity","scale","startScaleAnimation","pressIn","isHover","startOpacityAnimation","setValue","startPressAnimation","handlePressIn","handlePressOut","animatedStyle","transform","defaultPressDelay","hovered","undefined"],"sources":["ButtonBase.tsx"],"sourcesContent":["import React, { useCallback } from 'react';\nimport { Animated } from 'react-native';\nimport { useAnimatedValue, useThrottle } from '../hooks';\nimport { isNotAndroid12 } from '../utils';\nimport { AnimatedPressable } from '../animated';\nimport type ButtonBaseProps from './ButtonBaseProps';\n\ninterface StartPressAnimation {\n (pressIn: boolean, isHover: boolean): void;\n}\n\nexport const ORIGINAL_OPACITY = 1;\nconst ACTIVE_OPACITY = .65;\n\nconst ORIGINAL_SCALE = 1;\nconst MINIFIED_SCALE = .
|
|
1
|
+
{"version":3,"names":["React","useCallback","Animated","useAnimatedValue","useThrottle","isNotAndroid12","AnimatedPressable","ORIGINAL_OPACITY","ACTIVE_OPACITY","ORIGINAL_SCALE","MINIFIED_SCALE","SCALE_EFFECT_PRESS_IN_DELAY","OPACITY_EFFECT_PRESS_IN_DELAY","startTimingAnimationWithDefaults","value","toValue","timing","duration","useNativeDriver","start","ButtonBase","props","children","disabled","disableThrottle","onPress","_onPress","onPressOut","pressEffect","pressDelay","pressDelayOrNil","style","styleProp","throttleMillis","otherProps","handlePress","periodMillis","callback","opacity","scale","startScaleAnimation","pressIn","isHover","startOpacityAnimation","setValue","startPressAnimation","handlePressIn","handlePressOut","animatedStyle","transform","defaultPressDelay","hovered","undefined"],"sources":["ButtonBase.tsx"],"sourcesContent":["import React, { useCallback } from 'react';\nimport { Animated } from 'react-native';\nimport { useAnimatedValue, useThrottle } from '../hooks';\nimport { isNotAndroid12 } from '../utils';\nimport { AnimatedPressable } from '../animated';\nimport type ButtonBaseProps from './ButtonBaseProps';\n\ninterface StartPressAnimation {\n (pressIn: boolean, isHover: boolean): void;\n}\n\nexport const ORIGINAL_OPACITY = 1;\nconst ACTIVE_OPACITY = .65;\n\nconst ORIGINAL_SCALE = 1;\nconst MINIFIED_SCALE = .98;\n\n// at \"node_modules/react-native/Libraries/Pressability.js\"\n// const DEFAULT_MIN_PRESS_DURATION = 130;\nconst SCALE_EFFECT_PRESS_IN_DELAY = 130;\nconst OPACITY_EFFECT_PRESS_IN_DELAY = 0;\n\ntype TimingAnimationValue = Animated.Value | Animated.ValueXY;\ntype TimingAnimationToValue = Animated.TimingAnimationConfig['toValue'];\n\nconst startTimingAnimationWithDefaults = (\n value: TimingAnimationValue,\n toValue: TimingAnimationToValue,\n) => {\n Animated.timing(value, {\n toValue,\n duration: 150,\n useNativeDriver: isNotAndroid12,\n }).start();\n};\n\nexport default function ButtonBase(props: ButtonBaseProps) {\n const {\n children,\n disabled = false,\n disableThrottle = false,\n onPress: _onPress,\n onPressOut,\n pressEffect = 'opacity',\n pressDelay: pressDelayOrNil,\n style: styleProp,\n throttleMillis = 650,\n ...otherProps\n } = props;\n\n const onPress = useCallback(() => _onPress?.(), [_onPress]);\n const handlePress = useThrottle({\n periodMillis: disableThrottle ? 0 : throttleMillis,\n callback: onPress,\n });\n\n const opacity = useAnimatedValue(ORIGINAL_OPACITY);\n const scale = useAnimatedValue(ORIGINAL_SCALE);\n\n const startScaleAnimation = useCallback<StartPressAnimation>((pressIn, isHover) => {\n if (!isHover) {\n startTimingAnimationWithDefaults(\n scale,\n pressIn ? MINIFIED_SCALE : ORIGINAL_SCALE,\n );\n }\n }, []);\n\n const startOpacityAnimation = useCallback<StartPressAnimation>((pressIn) => {\n if (pressIn) {\n opacity.setValue(ACTIVE_OPACITY);\n } else {\n startTimingAnimationWithDefaults(opacity, ORIGINAL_OPACITY);\n }\n }, []);\n\n const startPressAnimation = useCallback<StartPressAnimation>((pressIn, isHover = false) => {\n if (pressEffect === 'scale') {\n startScaleAnimation(pressIn, isHover);\n } else if (pressEffect === 'opacity') {\n startOpacityAnimation(pressIn, isHover);\n }\n }, [pressEffect]);\n\n const handlePressIn = useCallback(() => {\n startPressAnimation(true, false);\n }, [startPressAnimation]);\n\n const handlePressOut = useCallback(() => {\n onPressOut && onPressOut();\n\n startPressAnimation(false, false);\n }, [startPressAnimation, onPressOut]);\n\n const animatedStyle = {\n opacity,\n transform: [{ scale }],\n };\n\n const defaultPressDelay = pressEffect === 'scale'\n ? SCALE_EFFECT_PRESS_IN_DELAY\n : OPACITY_EFFECT_PRESS_IN_DELAY;\n const pressDelay = pressDelayOrNil ?? defaultPressDelay;\n\n return (\n <AnimatedPressable\n disabled={disabled}\n onPress={handlePress}\n onPressIn={handlePressIn}\n onPressOut={handlePressOut}\n style={[\n animatedStyle,\n styleProp,\n ]}\n unstable_pressDelay={pressDelay}\n {...otherProps}\n >\n {typeof children !== 'function' ? (\n ({ hovered }) => {\n if (hovered !== undefined && !disabled) {\n startPressAnimation(hovered, true);\n }\n\n return children;\n }\n ) : children}\n </AnimatedPressable>\n );\n};\n"],"mappings":";;AAAA,OAAOA,KAAP,IAAgBC,WAAhB,QAAmC,OAAnC;AACA,SAASC,QAAT,QAAyB,cAAzB;AACA,SAASC,gBAAT,EAA2BC,WAA3B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GAEpBC,6BAFN;EAGA,MAAMiB,UAAU,GAAGC,eAAe,IAAIoB,iBAAtC;EAEA,oBACI,oBAAC,iBAAD;IACI,QAAQ,EAAE3B,QADd;IAEI,OAAO,EAAEY,WAFb;IAGI,SAAS,EAAEW,aAHf;IAII,UAAU,EAAEC,cAJhB;IAKI,KAAK,EAAE,CACHC,aADG,EAEHhB,SAFG,CALX;IASI,mBAAmB,EAAEH;EATzB,GAUQK,UAVR,GAYK,OAAOZ,QAAP,KAAoB,UAApB,GACG,QAAiB;IAAA,IAAhB;MAAE6B;IAAF,CAAgB;;IACb,IAAIA,OAAO,KAAKC,SAAZ,IAAyB,CAAC7B,QAA9B,EAAwC;MACpCsB,mBAAmB,CAACM,OAAD,EAAU,IAAV,CAAnB;IACH;;IAED,OAAO7B,QAAP;EACH,CAPJ,GAQGA,QApBR,CADJ;AAwBH;AAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { default } from './
|
|
1
|
+
export { default } from './ButtonBase';
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["default"],"sources":["index.ts"],"sourcesContent":["export { default } from './
|
|
1
|
+
{"version":3,"names":["default"],"sources":["index.ts"],"sourcesContent":["export { default } from './ButtonBase';\nexport type { default as ButtonBaseProps } from './ButtonBaseProps';\n"],"mappings":"AAAA,SAASA,OAAT,QAAwB,cAAxB"}
|
|
@@ -19,6 +19,7 @@ export default function Checkbox(props) {
|
|
|
19
19
|
} = props;
|
|
20
20
|
const theme = useTheme();
|
|
21
21
|
const {
|
|
22
|
+
checkboxContainerStyle,
|
|
22
23
|
checkboxStyle,
|
|
23
24
|
containerStyle,
|
|
24
25
|
iconColor
|
|
@@ -40,12 +41,14 @@ export default function Checkbox(props) {
|
|
|
40
41
|
onPress: handlePress,
|
|
41
42
|
style: rootStyle
|
|
42
43
|
}, otherProps), /*#__PURE__*/React.createElement(View, {
|
|
44
|
+
style: checkboxContainerStyle
|
|
45
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
43
46
|
style: checkboxStyle
|
|
44
47
|
}, checked ? /*#__PURE__*/React.createElement(CheckboxOnIcon, {
|
|
45
48
|
fill: iconColor,
|
|
46
49
|
height: 7.5,
|
|
47
50
|
width: 11
|
|
48
|
-
}) : null), children ? /*#__PURE__*/React.createElement(Row, {
|
|
51
|
+
}) : null)), children ? /*#__PURE__*/React.createElement(Row, {
|
|
49
52
|
flexGrow: 1,
|
|
50
53
|
flexShrink: 1
|
|
51
54
|
}, /*#__PURE__*/React.createElement(Text, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","Text","View","ButtonBase","CheckboxOn","CheckboxOnIcon","Row","createFontStyle","css","useTheme","useVariantStyleMap","Checkbox","props","checked","children","disabled","onChange","style","styleProp","variant","otherProps","theme","checkboxStyle","containerStyle","iconColor","rootStyle","undefined","fontStyle","selector","typography","body2","regular","color","palette","text","strong","handlePress"],"sources":["Checkbox.tsx"],"sourcesContent":["import React from 'react';\nimport { Text, View } from 'react-native';\nimport ButtonBase from '../ButtonBase';\nimport { CheckboxOn as CheckboxOnIcon } from '../internal/icons';\nimport Row from '../Row';\nimport { createFontStyle, css, useTheme } from '../styles';\nimport type CheckboxProps from './CheckboxProps';\nimport type { CheckboxVariant } from './CheckboxProps';\nimport useVariantStyleMap from './useVariantStyleMap';\n\nexport default function Checkbox(props: CheckboxProps) {\n const {\n checked = false,\n children,\n disabled = false,\n onChange,\n style: styleProp,\n variant = 'square' as CheckboxVariant,\n ...otherProps\n } = props;\n\n const theme = useTheme();\n\n const {\n checkboxStyle,\n containerStyle,\n iconColor,\n } = useVariantStyleMap(variant, checked);\n\n const rootStyle = css([\n children ? containerStyle : undefined,\n styleProp,\n ]);\n\n const fontStyle = createFontStyle(theme, {\n selector: (typography) => typography.body2.regular,\n color: theme.palette.text.strong,\n });\n\n const handlePress = () => {\n if (onChange) {\n onChange(!checked);\n }\n };\n\n return (\n <ButtonBase\n disabled={disabled}\n onPress={handlePress}\n style={rootStyle}\n {...otherProps}\n >\n <View style={
|
|
1
|
+
{"version":3,"names":["React","Text","View","ButtonBase","CheckboxOn","CheckboxOnIcon","Row","createFontStyle","css","useTheme","useVariantStyleMap","Checkbox","props","checked","children","disabled","onChange","style","styleProp","variant","otherProps","theme","checkboxContainerStyle","checkboxStyle","containerStyle","iconColor","rootStyle","undefined","fontStyle","selector","typography","body2","regular","color","palette","text","strong","handlePress"],"sources":["Checkbox.tsx"],"sourcesContent":["import React from 'react';\nimport { Text, View } from 'react-native';\nimport ButtonBase from '../ButtonBase';\nimport { CheckboxOn as CheckboxOnIcon } from '../internal/icons';\nimport Row from '../Row';\nimport { createFontStyle, css, useTheme } from '../styles';\nimport type CheckboxProps from './CheckboxProps';\nimport type { CheckboxVariant } from './CheckboxProps';\nimport useVariantStyleMap from './useVariantStyleMap';\n\nexport default function Checkbox(props: CheckboxProps) {\n const {\n checked = false,\n children,\n disabled = false,\n onChange,\n style: styleProp,\n variant = 'square' as CheckboxVariant,\n ...otherProps\n } = props;\n\n const theme = useTheme();\n\n const {\n checkboxContainerStyle,\n checkboxStyle,\n containerStyle,\n iconColor,\n } = useVariantStyleMap(variant, checked);\n\n const rootStyle = css([\n children ? containerStyle : undefined,\n styleProp,\n ]);\n\n const fontStyle = createFontStyle(theme, {\n selector: (typography) => typography.body2.regular,\n color: theme.palette.text.strong,\n });\n\n const handlePress = () => {\n if (onChange) {\n onChange(!checked);\n }\n };\n\n return (\n <ButtonBase\n disabled={disabled}\n onPress={handlePress}\n style={rootStyle}\n {...otherProps}\n >\n <View style={checkboxContainerStyle}>\n <View style={checkboxStyle}>\n {checked ? (\n <CheckboxOnIcon\n fill={iconColor}\n height={7.5}\n width={11}\n />\n ) : null}\n </View>\n </View>\n\n {children ? (\n <Row\n flexGrow={1}\n flexShrink={1}\n >\n <Text\n children={children}\n style={fontStyle}\n />\n </Row>\n ) : null}\n </ButtonBase>\n );\n};\n"],"mappings":";;AA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E;EAAb,gBACI,oBAAC,IAAD;IAAM,KAAK,EAAEC;EAAb,GACKV,OAAO,gBACJ,oBAAC,cAAD;IACI,IAAI,EAAEY,SADV;IAEI,MAAM,EAAE,GAFZ;IAGI,KAAK,EAAE;EAHX,EADI,GAMJ,IAPR,CADJ,CANJ,EAkBKX,QAAQ,gBACL,oBAAC,GAAD;IACI,QAAQ,EAAE,CADd;IAEI,UAAU,EAAE;EAFhB,gBAII,oBAAC,IAAD;IACI,QAAQ,EAAEA,QADd;IAEI,KAAK,EAAEc;EAFX,EAJJ,CADK,GAUL,IA5BR,CADJ;AAgCH;AAAA"}
|
|
@@ -14,6 +14,10 @@ export default function useVariantStyleMap(variant, checked) {
|
|
|
14
14
|
switch (variant) {
|
|
15
15
|
case 'square':
|
|
16
16
|
return {
|
|
17
|
+
checkboxContainerStyle: {
|
|
18
|
+
alignSelf: 'flex-start',
|
|
19
|
+
paddingTop: 3
|
|
20
|
+
},
|
|
17
21
|
checkboxStyle: css([styles.checkbox, {
|
|
18
22
|
borderColor: theme.palette.border.base,
|
|
19
23
|
borderRadius: theme.shape.radius.xs,
|
|
@@ -25,9 +29,9 @@ export default function useVariantStyleMap(variant, checked) {
|
|
|
25
29
|
} : {})
|
|
26
30
|
}]),
|
|
27
31
|
containerStyle: {
|
|
28
|
-
alignItems: 'center',
|
|
29
32
|
flexDirection: 'row',
|
|
30
|
-
gap: theme.spacing(3)
|
|
33
|
+
gap: theme.spacing(3),
|
|
34
|
+
paddingVertical: theme.spacing(2)
|
|
31
35
|
},
|
|
32
36
|
iconColor: theme.palette.fill.baseAlt
|
|
33
37
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["StyleSheet","commonColors","css","useTheme","styles","create","checkbox","alignItems","borderWidth","justifyContent","useVariantStyleMap","variant","checked","theme","checkboxStyle","borderColor","palette","border","base","borderRadius","shape","radius","xs","height","width","backgroundColor","fill","containerStyle","flexDirection","gap","spacing","iconColor","baseAlt","full","accent","borderBottomColor","weak","borderBottomWidth","
|
|
1
|
+
{"version":3,"names":["StyleSheet","commonColors","css","useTheme","styles","create","checkbox","alignItems","borderWidth","justifyContent","useVariantStyleMap","variant","checked","theme","checkboxContainerStyle","alignSelf","paddingTop","checkboxStyle","borderColor","palette","border","base","borderRadius","shape","radius","xs","height","width","backgroundColor","fill","containerStyle","flexDirection","gap","spacing","paddingVertical","iconColor","baseAlt","full","accent","borderBottomColor","weak","borderBottomWidth","static","strongInverse"],"sources":["useVariantStyleMap.ts"],"sourcesContent":["import { StyleSheet } from 'react-native';\nimport { commonColors, FountainUiStyle } from '@fountain-ui/styles';\nimport { css, useTheme } from '../styles';\nimport type { CheckboxVariant } from './CheckboxProps';\n\nconst styles = StyleSheet.create({\n checkbox: {\n alignItems: 'center',\n borderWidth: 1,\n justifyContent: 'center',\n },\n});\n\ntype useVariantStyleMapReturns = {\n checkboxContainerStyle?: FountainUiStyle;\n checkboxStyle?: FountainUiStyle;\n containerStyle?: FountainUiStyle;\n iconColor?: string;\n};\n\nexport default function useVariantStyleMap(variant: CheckboxVariant, checked: boolean): useVariantStyleMapReturns {\n const theme = useTheme();\n\n switch (variant) {\n case 'square':\n return {\n checkboxContainerStyle: {\n alignSelf: 'flex-start',\n paddingTop: 3,\n },\n checkboxStyle: css([\n styles.checkbox,\n {\n borderColor: theme.palette.border.base,\n borderRadius: theme.shape.radius.xs,\n height: 18,\n width: 18,\n ...(checked ? {\n backgroundColor: theme.palette.fill.base,\n borderColor: theme.palette.fill.base,\n } : {}),\n },\n ]),\n containerStyle: {\n flexDirection: 'row',\n gap: theme.spacing(3),\n paddingVertical: theme.spacing(2),\n },\n iconColor: theme.palette.fill.baseAlt,\n };\n case 'round':\n return {\n checkboxStyle: css([\n styles.checkbox,\n {\n borderColor: theme.palette.border.base,\n borderRadius: theme.shape.radius.full,\n height: 20,\n width: 20,\n ...(checked ? {\n backgroundColor: theme.palette.fill.accent,\n borderColor: theme.palette.fill.accent,\n } : {}),\n },\n ]),\n containerStyle: {\n alignItems: 'center',\n borderBottomColor: theme.palette.border.weak,\n borderBottomWidth: 0.5,\n flexDirection: 'row-reverse',\n gap: theme.spacing(8),\n paddingVertical: theme.spacing(3.5),\n },\n iconColor: commonColors.static.strongInverse,\n };\n default:\n return {};\n }\n}\n"],"mappings":"AAAA,SAASA,UAAT,QAA2B,cAA3B;AACA,SAASC,YAAT,QAA8C,qBAA9C;AACA,SAASC,GAAT,EAAcC,QAAd,QAA8B,WAA9B;AAGA,MAAMC,MAAM,GAAGJ,UAAU,CAACK,MAAX,CAAkB;EAC7BC,QAAQ,EAAE;IACNC,UAAU,EAAE,QADN;IAENC,WAAW,EAAE,CAFP;IAGNC,cAAc,EAAE;EAHV;AADmB,CAAlB,CAAf;AAeA,eAAe,SAASC,kBAAT,CAA4BC,OAA5B,EAAsDC,OAAtD,EAAmG;EAC9G,MAAMC,KAAK,GAAGV,QAAQ,EAAtB;;EAEA,QAAQQ,OAAR;IACI,KAAK,QAAL;MACI,OAAO;QACHG,sBAAsB,EAAE;UACpBC,SAAS,EAAE,YADS;UAEpBC,UAAU,EAAE;QAFQ,CADrB;QAKHC,aAAa,EAAEf,GAAG,CAAC,CACfE,MAAM,CAACE,QADQ,EAEf;UACIY,WAAW,EAAEL,KAAK,CAACM,OAAN,CAAcC,MAAd,CAAqBC,IADtC;UAEIC,YAAY,EAAET,KAAK,CAACU,KAAN,CAAYC,MAAZ,CAAmBC,EAFrC;UAGIC,MAAM,EAAE,EAHZ;UAIIC,KAAK,EAAE,EAJX;UAKI,IAAIf,OAAO,GAAG;YACVgB,eAAe,EAAEf,KAAK,CAACM,OAAN,CAAcU,IAAd,CAAmBR,IAD1B;YAEVH,WAAW,EAAEL,KAAK,CAACM,OAAN,CAAcU,IAAd,CAAmBR;UAFtB,CAAH,GAGP,EAHJ;QALJ,CAFe,CAAD,CALf;QAkBHS,cAAc,EAAE;UACZC,aAAa,EAAE,KADH;UAEZC,GAAG,EAAEnB,KAAK,CAACoB,OAAN,CAAc,CAAd,CAFO;UAGZC,eAAe,EAAErB,KAAK,CAACoB,OAAN,CAAc,CAAd;QAHL,CAlBb;QAuBHE,SAAS,EAAEtB,KAAK,CAACM,OAAN,CAAcU,IAAd,CAAmBO;MAvB3B,CAAP;;IAyBJ,KAAK,OAAL;MACI,OAAO;QACHnB,aAAa,EAAEf,GAAG,CAAC,CACfE,MAAM,CAACE,QADQ,EAEf;UACIY,WAAW,EAAEL,KAAK,CAACM,OAAN,CAAcC,MAAd,CAAqBC,IADtC;UAEIC,YAAY,EAAET,KAAK,CAACU,KAAN,CAAYC,MAAZ,CAAmBa,IAFrC;UAGIX,MAAM,EAAE,EAHZ;UAIIC,KAAK,EAAE,EAJX;UAKI,IAAIf,OAAO,GAAG;YACVgB,eAAe,EAAEf,KAAK,CAACM,OAAN,CAAcU,IAAd,CAAmBS,MAD1B;YAEVpB,WAAW,EAAEL,KAAK,CAACM,OAAN,CAAcU,IAAd,CAAmBS;UAFtB,CAAH,GAGP,EAHJ;QALJ,CAFe,CAAD,CADf;QAcHR,cAAc,EAAE;UACZvB,UAAU,EAAE,QADA;UAEZgC,iBAAiB,EAAE1B,KAAK,CAACM,OAAN,CAAcC,MAAd,CAAqBoB,IAF5B;UAGZC,iBAAiB,EAAE,GAHP;UAIZV,aAAa,EAAE,aAJH;UAKZC,GAAG,EAAEnB,KAAK,CAACoB,OAAN,CAAc,CAAd,CALO;UAMZC,eAAe,EAAErB,KAAK,CAACoB,OAAN,CAAc,GAAd;QANL,CAdb;QAsBHE,SAAS,EAAElC,YAAY,CAACyC,MAAb,CAAoBC;MAtB5B,CAAP;;IAwBJ;MACI,OAAO,EAAP;EArDR;AAuDH"}
|
|
@@ -2,44 +2,54 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function
|
|
|
2
2
|
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import { Text, View } from 'react-native';
|
|
5
|
+
import ButtonBase from '../ButtonBase';
|
|
6
|
+
import { ChipClose } from '../internal';
|
|
5
7
|
import { css } from '../styles';
|
|
6
8
|
import { cloneElementSafely } from '../utils';
|
|
7
|
-
import ButtonBase from '../ButtonBase/ButtonBase';
|
|
8
9
|
import useChipStyle from './useChipStyle';
|
|
9
10
|
export default function Chip(props) {
|
|
10
11
|
const {
|
|
11
12
|
children,
|
|
12
|
-
|
|
13
|
+
color = 'default',
|
|
13
14
|
numberOfLines,
|
|
14
15
|
onPress,
|
|
16
|
+
selected = false,
|
|
15
17
|
size = 'small',
|
|
16
18
|
startElement: startElementProp,
|
|
17
19
|
startElementVariant = 'default',
|
|
18
20
|
style: styleProp,
|
|
21
|
+
variant = 'filled',
|
|
19
22
|
...otherProps
|
|
20
23
|
} = props;
|
|
24
|
+
const isSelected = variant === 'outlined' ? false : selected;
|
|
21
25
|
const {
|
|
22
26
|
container: containerStyle,
|
|
23
|
-
|
|
27
|
+
closeButtonContainer: closeButtonContainerStyle,
|
|
28
|
+
closeIconSize,
|
|
24
29
|
label: labelStyle,
|
|
25
|
-
startElement: startElementStyle
|
|
26
|
-
|
|
30
|
+
startElement: startElementStyle,
|
|
31
|
+
startElementContainer: startElementContainerStyle
|
|
32
|
+
} = useChipStyle(size, startElementVariant, color, isSelected, variant);
|
|
27
33
|
const chipStyle = css([containerStyle, styleProp]);
|
|
28
|
-
const startElement =
|
|
34
|
+
const startElement = /*#__PURE__*/React.createElement(View, {
|
|
35
|
+
style: startElementContainerStyle
|
|
36
|
+
}, cloneElementSafely(startElementProp, {
|
|
29
37
|
style: startElementStyle
|
|
30
|
-
}
|
|
31
|
-
style: startElementStyle
|
|
32
|
-
});
|
|
33
|
-
const endElement = cloneElementSafely(endElementProp, {
|
|
34
|
-
style: endElementStyle
|
|
35
|
-
});
|
|
38
|
+
}));
|
|
36
39
|
return /*#__PURE__*/React.createElement(ButtonBase, _extends({
|
|
40
|
+
disabled: !onPress,
|
|
37
41
|
onPress: onPress,
|
|
38
42
|
style: chipStyle
|
|
39
43
|
}, otherProps), startElement, /*#__PURE__*/React.createElement(Text, {
|
|
40
44
|
children: children,
|
|
41
45
|
numberOfLines: numberOfLines,
|
|
42
46
|
style: labelStyle
|
|
43
|
-
}),
|
|
47
|
+
}), isSelected ? /*#__PURE__*/React.createElement(View, {
|
|
48
|
+
style: closeButtonContainerStyle
|
|
49
|
+
}, /*#__PURE__*/React.createElement(ChipClose, {
|
|
50
|
+
color: 'baseInverse',
|
|
51
|
+
height: closeIconSize === null || closeIconSize === void 0 ? void 0 : closeIconSize.height,
|
|
52
|
+
width: closeIconSize === null || closeIconSize === void 0 ? void 0 : closeIconSize.width
|
|
53
|
+
})) : null);
|
|
44
54
|
}
|
|
45
55
|
//# sourceMappingURL=Chip.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","Text","View","
|
|
1
|
+
{"version":3,"names":["React","Text","View","ButtonBase","ChipClose","css","cloneElementSafely","useChipStyle","Chip","props","children","color","numberOfLines","onPress","selected","size","startElement","startElementProp","startElementVariant","style","styleProp","variant","otherProps","isSelected","container","containerStyle","closeButtonContainer","closeButtonContainerStyle","closeIconSize","label","labelStyle","startElementStyle","startElementContainer","startElementContainerStyle","chipStyle","height","width"],"sources":["Chip.tsx"],"sourcesContent":["import React from 'react';\nimport { Text, View } from 'react-native';\nimport ButtonBase from '../ButtonBase';\nimport { ChipClose } from '../internal';\nimport { css } from '../styles';\nimport { cloneElementSafely } from '../utils';\nimport type ChipProps from './ChipProps';\nimport type { ChipColor, ChipSize } from './ChipProps';\nimport useChipStyle from './useChipStyle';\n\nexport default function Chip(props: ChipProps) {\n const {\n children,\n color = 'default' as ChipColor,\n numberOfLines,\n onPress,\n selected = false,\n size = 'small' as ChipSize,\n startElement: startElementProp,\n startElementVariant = 'default',\n style: styleProp,\n variant = 'filled',\n ...otherProps\n } = props;\n\n const isSelected = variant === 'outlined' ? false : selected;\n\n const {\n container: containerStyle,\n closeButtonContainer: closeButtonContainerStyle,\n closeIconSize,\n label: labelStyle,\n startElement: startElementStyle,\n startElementContainer: startElementContainerStyle,\n } = useChipStyle(size, startElementVariant, color, isSelected, variant);\n\n const chipStyle = css([\n containerStyle,\n styleProp,\n ]);\n\n const startElement = (\n <View style={startElementContainerStyle}>\n {cloneElementSafely(startElementProp, { style: startElementStyle })}\n </View>\n );\n\n return (\n <ButtonBase\n disabled={!onPress}\n onPress={onPress}\n style={chipStyle}\n {...otherProps}\n >\n {startElement}\n\n <Text\n children={children}\n numberOfLines={numberOfLines}\n style={labelStyle}\n />\n\n {isSelected ? (\n <View style={closeButtonContainerStyle}>\n <ChipClose\n color={'baseInverse'}\n height={closeIconSize?.height}\n width={closeIconSize?.width}\n />\n </View>\n ) : null}\n </ButtonBase>\n );\n}\n"],"mappings":";;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,SAASC,IAAT,EAAeC,IAAf,QAA2B,cAA3B;AACA,OAAOC,UAAP,MAAuB,eAAvB;AACA,SAASC,SAAT,QAA0B,aAA1B;AACA,SAASC,GAAT,QAAoB,WAApB;AACA,SAASC,kBAAT,QAAmC,UAAnC;AAGA,OAAOC,YAAP,MAAyB,gBAAzB;AAEA,eAAe,SAASC,IAAT,CAAcC,KAAd,EAAgC;EAC3C,MAAM;IACFC,QADE;IAEFC,KAAK,GAAG,SAFN;IAGFC,aAHE;IAIFC,OAJE;IAKFC,QAAQ,GAAG,KALT;IAMFC,IAAI,GAAG,OANL;IAOFC,YAAY,EAAEC,gBAPZ;IAQFC,mBAAmB,GAAG,SARpB;IASFC,KAAK,EAAEC,SATL;IAUFC,OAAO,GAAG,QAVR;IAWF,GAAGC;EAXD,IAYFb,KAZJ;EAcA,MAAMc,UAAU,GAAGF,OAAO,KAAK,UAAZ,GAAyB,KAAzB,GAAiCP,QAApD;EAEA,MAAM;IACFU,SAAS,EAAEC,cADT;IAEFC,oBAAoB,EAAEC,yBAFpB;IAGFC,aAHE;IAIFC,KAAK,EAAEC,UAJL;IAKFd,YAAY,EAAEe,iBALZ;IAMFC,qBAAqB,EAAEC;EANrB,IAOF1B,YAAY,CAACQ,IAAD,EAAOG,mBAAP,EAA4BP,KAA5B,EAAmCY,UAAnC,EAA+CF,OAA/C,CAPhB;EASA,MAAMa,SAAS,GAAG7B,GAAG,CAAC,CAClBoB,cADkB,EAElBL,SAFkB,CAAD,CAArB;EAKA,MAAMJ,YAAY,gBACd,oBAAC,IAAD;IAAM,KAAK,EAAEiB;EAAb,GACK3B,kBAAkB,CAACW,gBAAD,EAAmB;IAAEE,KAAK,EAAEY;EAAT,CAAnB,CADvB,CADJ;EAMA,oBACI,oBAAC,UAAD;IACI,QAAQ,EAAE,CAAClB,OADf;IAEI,OAAO,EAAEA,OAFb;IAGI,KAAK,EAAEqB;EAHX,GAIQZ,UAJR,GAMKN,YANL,eAQI,oBAAC,IAAD;IACI,QAAQ,EAAEN,QADd;IAEI,aAAa,EAAEE,aAFnB;IAGI,KAAK,EAAEkB;EAHX,EARJ,EAcKP,UAAU,gBACP,oBAAC,IAAD;IAAM,KAAK,EAAEI;EAAb,gBACI,oBAAC,SAAD;IACI,KAAK,EAAE,aADX;IAEI,MAAM,EAAEC,aAAF,aAAEA,aAAF,uBAAEA,aAAa,CAAEO,MAF3B;IAGI,KAAK,EAAEP,aAAF,aAAEA,aAAF,uBAAEA,aAAa,CAAEQ;EAH1B,EADJ,CADO,GAQP,IAtBR,CADJ;AA0BH"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["chipSizes","chipStartElementVariants"],"sources":["ChipProps.ts"],"sourcesContent":["import React from 'react';\nimport { OverridableComponentProps } from '../types';\nimport type { ButtonBaseProps } from '../ButtonBase';\n\nexport const chipSizes = ['large', 'small'] as const;\nexport type ChipSize = typeof chipSizes[number];\n\nexport const chipStartElementVariants = ['default', 'avatar', 'image', 'icon'] as const;\nexport type ChipStartElementVariant = typeof chipStartElementVariants[number];\n\nexport default interface ChipProps extends OverridableComponentProps<ButtonBaseProps, {\n /**\n *
|
|
1
|
+
{"version":3,"names":["chipColors","chipSizes","chipStartElementVariants","chipVariants"],"sources":["ChipProps.ts"],"sourcesContent":["import React from 'react';\nimport { OverridableComponentProps } from '../types';\nimport type { ButtonBaseProps } from '../ButtonBase';\n\nexport const chipColors = ['default', 'white'] as const;\nexport type ChipColor = typeof chipColors[number];\n\nexport const chipSizes = ['large', 'small'] as const;\nexport type ChipSize = typeof chipSizes[number];\n\nexport const chipStartElementVariants = ['default', 'avatar', 'image', 'icon'] as const;\nexport type ChipStartElementVariant = typeof chipStartElementVariants[number];\n\nexport const chipVariants = ['filled', 'outlined'] as const;\nexport type ChipVariant = typeof chipVariants[number];\n\nexport default interface ChipProps extends OverridableComponentProps<ButtonBaseProps, {\n /**\n * The content of the component.\n */\n children: string;\n\n /**\n * Set backgroundColor of the component.\n * @default 'default'\n */\n color?: ChipColor;\n\n /**\n * Number of lines of children.\n */\n numberOfLines?: number;\n\n /**\n * If `true`, showing a close icon and applying a highlighted style.\n */\n selected?: boolean;\n\n /**\n * Determines size of component.\n * @default 'small'\n */\n size?: ChipSize;\n\n /**\n * Element placed before the children.\n */\n startElement?: React.ReactElement;\n\n /**\n * Determines the visual style of the component.\n * @default 'filled'\n */\n variant?: ChipVariant;\n\n /**\n * Determines the style of the start element.\n */\n startElementVariant?: ChipStartElementVariant;\n}> {}\n"],"mappings":"AAIA,OAAO,MAAMA,UAAU,GAAG,CAAC,SAAD,EAAY,OAAZ,CAAnB;AAGP,OAAO,MAAMC,SAAS,GAAG,CAAC,OAAD,EAAU,OAAV,CAAlB;AAGP,OAAO,MAAMC,wBAAwB,GAAG,CAAC,SAAD,EAAY,QAAZ,EAAsB,OAAtB,EAA+B,MAA/B,CAAjC;AAGP,OAAO,MAAMC,YAAY,GAAG,CAAC,QAAD,EAAW,UAAX,CAArB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["default","chipSizes","chipStartElementVariants"],"sources":["index.ts"],"sourcesContent":["export { default } from './Chip';\nexport type { default as ChipProps } from './ChipProps';\nexport { chipSizes, chipStartElementVariants } from './ChipProps';\n"],"mappings":"AAAA,SAASA,OAAT,QAAwB,QAAxB;AAEA,SAASC,
|
|
1
|
+
{"version":3,"names":["default","chipColors","chipSizes","chipStartElementVariants","chipVariants"],"sources":["index.ts"],"sourcesContent":["export { default } from './Chip';\nexport type { default as ChipProps, ChipVariant } from './ChipProps';\nexport { chipColors, chipSizes, chipStartElementVariants, chipVariants } from './ChipProps';\n"],"mappings":"AAAA,SAASA,OAAT,QAAwB,QAAxB;AAEA,SAASC,UAAT,EAAqBC,SAArB,EAAgCC,wBAAhC,EAA0DC,YAA1D,QAA8E,aAA9E"}
|
|
@@ -1,39 +1,54 @@
|
|
|
1
1
|
import { useMemo } from 'react';
|
|
2
2
|
import { createFontStyle, useTheme } from '../styles';
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
const closeButtonContainerStyleMap = {
|
|
4
|
+
small: {
|
|
5
|
+
marginLeft: 8,
|
|
6
|
+
paddingTop: 1
|
|
7
|
+
},
|
|
8
|
+
large: {
|
|
9
|
+
marginLeft: 10,
|
|
10
|
+
paddingTop: 1
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
const closeIconSize = {
|
|
14
|
+
small: {
|
|
15
|
+
height: 14,
|
|
16
|
+
width: 8.17
|
|
17
|
+
},
|
|
18
|
+
large: {
|
|
19
|
+
height: 16,
|
|
20
|
+
width: 9
|
|
21
|
+
}
|
|
22
|
+
}; // TODO: need to refactoring...
|
|
23
|
+
|
|
24
|
+
export default function useChipStyle(size, startElementVariant, color, selected) {
|
|
25
|
+
let variant = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 'filled';
|
|
5
26
|
const theme = useTheme();
|
|
6
27
|
return useMemo(() => {
|
|
7
|
-
var _variantStyleMap$star, _variantStyleMap$star2;
|
|
28
|
+
var _variantStyleMap$star, _variantStyleMap$star2, _variantStyleMap$star3;
|
|
8
29
|
|
|
30
|
+
const isOutlined = variant === 'outlined';
|
|
31
|
+
const textColor = selected ? theme.palette.text.strongInverse : isOutlined ? theme.palette.text.base : theme.palette.text.strong;
|
|
9
32
|
const fontStyleMap = {
|
|
10
33
|
small: createFontStyle(theme, {
|
|
11
34
|
selector: typography => typography.caption1.medium,
|
|
12
|
-
color:
|
|
35
|
+
color: textColor
|
|
13
36
|
}),
|
|
14
37
|
large: createFontStyle(theme, {
|
|
15
38
|
selector: typography => typography.body2.medium,
|
|
16
|
-
color:
|
|
39
|
+
color: textColor
|
|
17
40
|
})
|
|
18
41
|
};
|
|
19
|
-
const endElementStyleMap = {
|
|
20
|
-
small: {
|
|
21
|
-
height: 14,
|
|
22
|
-
marginLeft: theme.spacing(2),
|
|
23
|
-
width: 8.17
|
|
24
|
-
},
|
|
25
|
-
large: {
|
|
26
|
-
height: 16,
|
|
27
|
-
marginLeft: theme.spacing(2.5),
|
|
28
|
-
width: 9
|
|
29
|
-
}
|
|
30
|
-
};
|
|
31
42
|
const baseContainerStyle = {
|
|
32
43
|
alignItems: 'center',
|
|
33
|
-
backgroundColor: theme.palette.fill.weaker,
|
|
44
|
+
backgroundColor: selected ? theme.palette.fill.base : isOutlined ? 'transparent' : color === 'white' ? theme.palette.surface.base : theme.palette.fill.weaker,
|
|
34
45
|
borderRadius: theme.shape.radius.full,
|
|
35
46
|
flexDirection: 'row',
|
|
36
|
-
overflow: 'hidden'
|
|
47
|
+
overflow: 'hidden',
|
|
48
|
+
...(isOutlined && {
|
|
49
|
+
borderWidth: 1,
|
|
50
|
+
borderColor: theme.palette.border.weak
|
|
51
|
+
})
|
|
37
52
|
};
|
|
38
53
|
const isLarge = size === 'large';
|
|
39
54
|
const variantStyleMap = {
|
|
@@ -45,9 +60,11 @@ export default function useChipStyle(size, startElementVariant, isEndElement) {
|
|
|
45
60
|
},
|
|
46
61
|
startElement: {
|
|
47
62
|
borderRadius: theme.shape.radius.full,
|
|
48
|
-
height: isLarge ?
|
|
49
|
-
|
|
50
|
-
|
|
63
|
+
height: isLarge ? 26 : 23,
|
|
64
|
+
width: isLarge ? 26 : 23
|
|
65
|
+
},
|
|
66
|
+
startElementContainer: {
|
|
67
|
+
marginRight: theme.spacing(isLarge ? 1.5 : 1.25)
|
|
51
68
|
}
|
|
52
69
|
},
|
|
53
70
|
icon: {
|
|
@@ -57,11 +74,16 @@ export default function useChipStyle(size, startElementVariant, isEndElement) {
|
|
|
57
74
|
paddingVertical: theme.spacing(isLarge ? 1.5 : 1.25)
|
|
58
75
|
},
|
|
59
76
|
startElement: {
|
|
77
|
+
color: selected ? theme.palette.icon.strongInverse : theme.palette.icon.strong,
|
|
78
|
+
height: isLarge ? 17 : 16,
|
|
79
|
+
width: isLarge ? 17 : 16
|
|
80
|
+
},
|
|
81
|
+
startElementContainer: {
|
|
60
82
|
alignItems: 'center',
|
|
61
|
-
height: isLarge ?
|
|
83
|
+
height: isLarge ? 24 : 21,
|
|
62
84
|
justifyContent: 'center',
|
|
63
85
|
marginRight: theme.spacing(isLarge ? 1 : 0.75),
|
|
64
|
-
width: isLarge ?
|
|
86
|
+
width: isLarge ? 24 : 21
|
|
65
87
|
}
|
|
66
88
|
},
|
|
67
89
|
image: {
|
|
@@ -71,15 +93,18 @@ export default function useChipStyle(size, startElementVariant, isEndElement) {
|
|
|
71
93
|
},
|
|
72
94
|
startElement: {
|
|
73
95
|
borderRadius: theme.shape.radius.full,
|
|
74
|
-
height: isLarge ?
|
|
75
|
-
|
|
76
|
-
|
|
96
|
+
height: isLarge ? 36 : 31,
|
|
97
|
+
width: isLarge ? 48 : 40
|
|
98
|
+
},
|
|
99
|
+
startElementContainer: {
|
|
100
|
+
marginRight: theme.spacing(1.5)
|
|
77
101
|
}
|
|
78
102
|
},
|
|
79
103
|
default: {
|
|
80
104
|
container: {
|
|
81
105
|
paddingBottom: theme.spacing(1.75),
|
|
82
|
-
|
|
106
|
+
paddingLeft: theme.spacing(isLarge ? 3.5 : 3),
|
|
107
|
+
paddingRight: theme.spacing(isLarge ? 3.5 : 3),
|
|
83
108
|
paddingTop: theme.spacing(1.5)
|
|
84
109
|
}
|
|
85
110
|
}
|
|
@@ -87,14 +112,16 @@ export default function useChipStyle(size, startElementVariant, isEndElement) {
|
|
|
87
112
|
return {
|
|
88
113
|
container: { ...baseContainerStyle,
|
|
89
114
|
...((_variantStyleMap$star = variantStyleMap[startElementVariant]) === null || _variantStyleMap$star === void 0 ? void 0 : _variantStyleMap$star.container),
|
|
90
|
-
...(
|
|
115
|
+
...(selected ? {
|
|
91
116
|
paddingRight: theme.spacing(isLarge ? 2.5 : 2.25)
|
|
92
117
|
} : {})
|
|
93
118
|
},
|
|
94
|
-
|
|
119
|
+
closeButtonContainer: closeButtonContainerStyleMap[size],
|
|
120
|
+
closeIconSize: closeIconSize[size],
|
|
95
121
|
label: fontStyleMap[size],
|
|
96
|
-
startElement: (_variantStyleMap$star2 = variantStyleMap[startElementVariant]) === null || _variantStyleMap$star2 === void 0 ? void 0 : _variantStyleMap$star2.startElement
|
|
122
|
+
startElement: (_variantStyleMap$star2 = variantStyleMap[startElementVariant]) === null || _variantStyleMap$star2 === void 0 ? void 0 : _variantStyleMap$star2.startElement,
|
|
123
|
+
startElementContainer: (_variantStyleMap$star3 = variantStyleMap[startElementVariant]) === null || _variantStyleMap$star3 === void 0 ? void 0 : _variantStyleMap$star3.startElementContainer
|
|
97
124
|
};
|
|
98
|
-
}, [theme, size, startElementVariant]);
|
|
125
|
+
}, [theme, size, startElementVariant, color, selected, variant]);
|
|
99
126
|
}
|
|
100
127
|
//# sourceMappingURL=useChipStyle.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useMemo","createFontStyle","useTheme","useChipStyle","size","startElementVariant","isEndElement","theme","fontStyleMap","small","selector","typography","caption1","medium","color","palette","text","strong","large","body2","endElementStyleMap","height","marginLeft","spacing","width","baseContainerStyle","alignItems","backgroundColor","fill","weaker","borderRadius","shape","radius","full","flexDirection","overflow","isLarge","variantStyleMap","avatar","container","paddingLeft","paddingRight","paddingVertical","startElement","marginRight","icon","justifyContent","image","default","paddingBottom","paddingHorizontal","paddingTop","endElement","label"],"sources":["useChipStyle.ts"],"sourcesContent":["import { useMemo } from 'react';\nimport type { TextStyle } from 'react-native';\nimport type { FountainUiStyle } from '@fountain-ui/styles';\nimport { createFontStyle, useTheme } from '../styles';\nimport type { ChipSize, ChipStartElementVariant } from './ChipProps';\n\ninterface ChipStyle {\n container: FountainUiStyle;\n endElement?: FountainUiStyle;\n label: TextStyle;\n startElement?: FountainUiStyle;\n}\n\ntype VariantStyleMap = Record<ChipStartElementVariant, Partial<ChipStyle>>;\n\n// TODO: need to refactoring...\nexport default function useChipStyle(\n size: ChipSize,\n startElementVariant: ChipStartElementVariant,\n isEndElement: boolean,\n): ChipStyle {\n const theme = useTheme();\n\n return useMemo<ChipStyle>(() => {\n const fontStyleMap: Record<ChipSize, TextStyle> = {\n small: createFontStyle(theme, {\n selector: (typography) => typography.caption1.medium,\n color: theme.palette.text.strong,\n }),\n large: createFontStyle(theme, {\n selector: (typography) => typography.body2.medium,\n color: theme.palette.text.strong,\n }),\n };\n\n const endElementStyleMap: Record<ChipSize, FountainUiStyle> = {\n small: {\n height: 14,\n marginLeft: theme.spacing(2),\n width: 8.17,\n },\n large: {\n height: 16,\n marginLeft: theme.spacing(2.5),\n width: 9,\n },\n };\n\n const baseContainerStyle: FountainUiStyle = {\n alignItems: 'center',\n backgroundColor: theme.palette.fill.weaker,\n borderRadius: theme.shape.radius.full,\n flexDirection: 'row',\n overflow: 'hidden',\n };\n\n const isLarge = size === 'large';\n\n const variantStyleMap: VariantStyleMap = {\n avatar: {\n container: {\n paddingLeft: theme.spacing(isLarge ? 1.5 : 1.25),\n paddingRight: theme.spacing(isLarge ? 3.5 : 3),\n paddingVertical: theme.spacing(isLarge ? 1.25 : 1),\n },\n startElement: {\n borderRadius: theme.shape.radius.full,\n height: isLarge ? 24 : 22,\n marginRight: theme.spacing(isLarge ? 1.5 : 1.25),\n width: isLarge ? 24 : 22,\n },\n },\n icon: {\n container: {\n paddingLeft: theme.spacing(1.5),\n paddingRight: theme.spacing(isLarge ? 3.5 : 3),\n paddingVertical: theme.spacing(isLarge ? 1.5 : 1.25),\n },\n startElement: {\n alignItems: 'center',\n height: isLarge ? 22 : 20,\n justifyContent: 'center',\n marginRight: theme.spacing(isLarge ? 1 : 0.75),\n width: isLarge ? 22 : 20,\n },\n },\n image: {\n container: {\n alignItems: 'center',\n paddingRight: theme.spacing(isLarge ? 3.5 : 3),\n },\n startElement: {\n borderRadius: theme.shape.radius.full,\n height: isLarge ? 34 : 30,\n marginRight: theme.spacing(1.5),\n width: isLarge ? 45 : 40,\n },\n },\n default: {\n container: {\n paddingBottom: theme.spacing(1.75),\n paddingHorizontal: theme.spacing(isLarge ? 3.5 : 3),\n paddingTop: theme.spacing(1.5),\n },\n },\n };\n\n return {\n container: {\n ...baseContainerStyle,\n ...variantStyleMap[startElementVariant]?.container,\n ...(isEndElement ? { paddingRight: theme.spacing(isLarge ? 2.5 : 2.25) } : {}),\n },\n endElement: endElementStyleMap[size],\n label: fontStyleMap[size],\n startElement: variantStyleMap[startElementVariant]?.startElement,\n };\n }, [theme, size, startElementVariant]);\n}\n"],"mappings":"AAAA,SAASA,OAAT,QAAwB,OAAxB;AAGA,SAASC,eAAT,EAA0BC,QAA1B,QAA0C,WAA1C;AAYA;AACA,eAAe,SAASC,YAAT,CACXC,IADW,EAEXC,mBAFW,EAGXC,YAHW,EAIF;EACT,MAAMC,KAAK,GAAGL,QAAQ,EAAtB;EAEA,OAAOF,OAAO,CAAY,MAAM;IAAA;;IAC5B,MAAMQ,YAAyC,GAAG;MAC9CC,KAAK,EAAER,eAAe,CAACM,KAAD,EAAQ;QAC1BG,QAAQ,EAAGC,UAAD,IAAgBA,UAAU,CAACC,QAAX,CAAoBC,MADpB;QAE1BC,KAAK,EAAEP,KAAK,CAACQ,OAAN,CAAcC,IAAd,CAAmBC;MAFA,CAAR,CADwB;MAK9CC,KAAK,EAAEjB,eAAe,CAACM,KAAD,EAAQ;QAC1BG,QAAQ,EAAGC,UAAD,IAAgBA,UAAU,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AFZ;UAGPe,UAAU,EAAE5C,KAAK,CAACgB,OAAN,CAAc,GAAd;QAHL;MADN;IAxC4B,CAAzC;IAiDA,OAAO;MACHgB,SAAS,EAAE,EACP,GAAGd,kBADI;QAEP,6BAAGY,eAAe,CAAChC,mBAAD,CAAlB,0DAAG,sBAAsCkC,SAAzC,CAFO;QAGP,IAAIjC,YAAY,GAAG;UAAEmC,YAAY,EAAElC,KAAK,CAACgB,OAAN,CAAca,OAAO,GAAG,GAAH,GAAS,IAA9B;QAAhB,CAAH,GAA2D,EAA3E;MAHO,CADR;MAMHgB,UAAU,EAAEhC,kBAAkB,CAAChB,IAAD,CAN3B;MAOHiD,KAAK,EAAE7C,YAAY,CAACJ,IAAD,CAPhB;MAQHuC,YAAY,4BAAEN,eAAe,CAAChC,mBAAD,CAAjB,2DAAE,uBAAsCsC;IARjD,CAAP;EAUH,CA9Fa,EA8FX,CAACpC,KAAD,EAAQH,IAAR,EAAcC,mBAAd,CA9FW,CAAd;AA+FH"}
|
|
1
|
+
{"version":3,"names":["useMemo","createFontStyle","useTheme","closeButtonContainerStyleMap","small","marginLeft","paddingTop","large","closeIconSize","height","width","useChipStyle","size","startElementVariant","color","selected","variant","theme","isOutlined","textColor","palette","text","strongInverse","base","strong","fontStyleMap","selector","typography","caption1","medium","body2","baseContainerStyle","alignItems","backgroundColor","fill","surface","weaker","borderRadius","shape","radius","full","flexDirection","overflow","borderWidth","borderColor","border","weak","isLarge","variantStyleMap","avatar","container","paddingLeft","spacing","paddingRight","paddingVertical","startElement","startElementContainer","marginRight","icon","justifyContent","image","default","paddingBottom","closeButtonContainer","label"],"sources":["useChipStyle.ts"],"sourcesContent":["import { useMemo } from 'react';\nimport type { TextStyle } from 'react-native';\nimport type { FountainUiStyle } from '@fountain-ui/styles';\nimport type { SvgIconProps } from '../SvgIcon';\nimport { createFontStyle, useTheme } from '../styles';\nimport type { ChipColor, ChipSize, ChipStartElementVariant, ChipVariant } from './ChipProps';\n\ninterface ChipStyle {\n container: FountainUiStyle;\n closeButtonContainer?: FountainUiStyle;\n closeIconSize?: Pick<SvgIconProps, 'height' | 'width'>;\n label: TextStyle;\n startElement?: FountainUiStyle;\n startElementContainer?: FountainUiStyle;\n}\n\ntype VariantStyleMap = Record<ChipStartElementVariant, Partial<ChipStyle>>;\n\nconst closeButtonContainerStyleMap: Record<ChipSize, FountainUiStyle> = {\n small: {\n marginLeft: 8,\n paddingTop: 1,\n },\n large: {\n marginLeft: 10,\n paddingTop: 1,\n },\n};\n\nconst closeIconSize: Record<ChipSize, ChipStyle['closeIconSize']> = {\n small: {\n height: 14,\n width: 8.17,\n },\n large: {\n height: 16,\n width: 9,\n },\n};\n\n// TODO: need to refactoring...\nexport default function useChipStyle(\n size: ChipSize,\n startElementVariant: ChipStartElementVariant,\n color: ChipColor,\n selected: boolean,\n variant: ChipVariant = 'filled',\n): ChipStyle {\n const theme = useTheme();\n\n return useMemo<ChipStyle>(() => {\n const isOutlined = variant === 'outlined';\n\n const textColor = selected\n ? theme.palette.text.strongInverse\n : isOutlined\n ? theme.palette.text.base\n : theme.palette.text.strong;\n\n const fontStyleMap: Record<ChipSize, TextStyle> = {\n small: createFontStyle(theme, {\n selector: (typography) => typography.caption1.medium,\n color: textColor,\n }),\n large: createFontStyle(theme, {\n selector: (typography) => typography.body2.medium,\n color: textColor,\n }),\n };\n\n const baseContainerStyle: FountainUiStyle = {\n alignItems: 'center',\n backgroundColor: selected\n ? theme.palette.fill.base\n : isOutlined\n ? 'transparent'\n : color === 'white'\n ? theme.palette.surface.base\n : theme.palette.fill.weaker,\n borderRadius: theme.shape.radius.full,\n flexDirection: 'row',\n overflow: 'hidden',\n ...(isOutlined && {\n borderWidth: 1,\n borderColor: theme.palette.border.weak,\n }),\n };\n\n const isLarge = size === 'large';\n\n const variantStyleMap: VariantStyleMap = {\n avatar: {\n container: {\n paddingLeft: theme.spacing(isLarge ? 1.5 : 1.25),\n paddingRight: theme.spacing(isLarge ? 3.5 : 3),\n paddingVertical: theme.spacing(isLarge ? 1.25 : 1),\n },\n startElement: {\n borderRadius: theme.shape.radius.full,\n height: isLarge ? 26 : 23,\n width: isLarge ? 26 : 23,\n },\n startElementContainer: {\n marginRight: theme.spacing(isLarge ? 1.5 : 1.25),\n },\n },\n icon: {\n container: {\n paddingLeft: theme.spacing(1.5),\n paddingRight: theme.spacing(isLarge ? 3.5 : 3),\n paddingVertical: theme.spacing(isLarge ? 1.5 : 1.25),\n },\n startElement: {\n color: selected\n ? theme.palette.icon.strongInverse\n : theme.palette.icon.strong,\n height: isLarge ? 17 : 16,\n width: isLarge ? 17 : 16,\n },\n startElementContainer: {\n alignItems: 'center',\n height: isLarge ? 24 : 21,\n justifyContent: 'center',\n marginRight: theme.spacing(isLarge ? 1 : 0.75),\n width: isLarge ? 24 : 21,\n },\n },\n image: {\n container: {\n alignItems: 'center',\n paddingRight: theme.spacing(isLarge ? 3.5 : 3),\n },\n startElement: {\n borderRadius: theme.shape.radius.full,\n height: isLarge ? 36 : 31,\n width: isLarge ? 48 : 40,\n },\n startElementContainer: {\n marginRight: theme.spacing(1.5),\n },\n },\n default: {\n container: {\n paddingBottom: theme.spacing(1.75),\n paddingLeft: theme.spacing(isLarge ? 3.5 : 3),\n paddingRight: theme.spacing(isLarge ? 3.5 : 3),\n paddingTop: theme.spacing(1.5),\n },\n },\n };\n\n return {\n container: {\n ...baseContainerStyle,\n ...variantStyleMap[startElementVariant]?.container,\n ...(selected ? { paddingRight: theme.spacing(isLarge ? 2.5 : 2.25) } : {}),\n },\n closeButtonContainer: closeButtonContainerStyleMap[size],\n closeIconSize: closeIconSize[size],\n label: fontStyleMap[size],\n startElement: variantStyleMap[startElementVariant]?.startElement,\n startElementContainer: variantStyleMap[startElementVariant]?.startElementContainer,\n };\n }, [theme, size, startElementVariant, color, selected, variant]);\n}\n"],"mappings":"AAAA,SAASA,OAAT,QAAwB,OAAxB;AAIA,SAASC,eAAT,EAA0BC,QAA1B,QAA0C,WAA1C;AAcA,MAAMC,4BAA+D,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;QACLX,SAAS,EAAE;UACPY,aAAa,EAAE7C,KAAK,CAACmC,OAAN,CAAc,IAAd,CADR;UAEPD,WAAW,EAAElC,KAAK,CAACmC,OAAN,CAAcL,OAAO,GAAG,GAAH,GAAS,CAA9B,CAFN;UAGPM,YAAY,EAAEpC,KAAK,CAACmC,OAAN,CAAcL,OAAO,GAAG,GAAH,GAAS,CAA9B,CAHP;UAIPzC,UAAU,EAAEW,KAAK,CAACmC,OAAN,CAAc,GAAd;QAJL;MADN;IAnD4B,CAAzC;IA6DA,OAAO;MACHF,SAAS,EAAE,EACP,GAAGnB,kBADI;QAEP,6BAAGiB,eAAe,CAACnC,mBAAD,CAAlB,0DAAG,sBAAsCqC,SAAzC,CAFO;QAGP,IAAInC,QAAQ,GAAG;UAAEsC,YAAY,EAAEpC,KAAK,CAACmC,OAAN,CAAcL,OAAO,GAAG,GAAH,GAAS,IAA9B;QAAhB,CAAH,GAA2D,EAAvE;MAHO,CADR;MAMHgB,oBAAoB,EAAE5D,4BAA4B,CAACS,IAAD,CAN/C;MAOHJ,aAAa,EAAEA,aAAa,CAACI,IAAD,CAPzB;MAQHoD,KAAK,EAAEvC,YAAY,CAACb,IAAD,CARhB;MASH2C,YAAY,4BAAEP,eAAe,CAACnC,mBAAD,CAAjB,2DAAE,uBAAsC0C,YATjD;MAUHC,qBAAqB,4BAAER,eAAe,CAACnC,mBAAD,CAAjB,2DAAE,uBAAsC2C;IAV1D,CAAP;EAYH,CAjHa,EAiHX,CAACvC,KAAD,EAAQL,IAAR,EAAcC,mBAAd,EAAmCC,KAAnC,EAA0CC,QAA1C,EAAoDC,OAApD,CAjHW,CAAd;AAkHH"}
|
|
@@ -8,12 +8,11 @@ import Modal, { ANIMATION_TYPE } from '../Modal';
|
|
|
8
8
|
import ShadowView from '../ShadowView';
|
|
9
9
|
import { DialogProvider } from './DialogContext';
|
|
10
10
|
import useDialogStyle from './useDialogStyle';
|
|
11
|
-
const
|
|
11
|
+
const TOP_ELEMENT_HIDDEN_OFFSET = 20;
|
|
12
12
|
export default function Dialog(props) {
|
|
13
13
|
const {
|
|
14
14
|
animationType = ANIMATION_TYPE.SLIDE,
|
|
15
15
|
children,
|
|
16
|
-
fullScreen = false,
|
|
17
16
|
hideBackdrop,
|
|
18
17
|
onClose,
|
|
19
18
|
style: styleProp,
|
|
@@ -22,7 +21,7 @@ export default function Dialog(props) {
|
|
|
22
21
|
topElement,
|
|
23
22
|
...otherProps
|
|
24
23
|
} = props;
|
|
25
|
-
const styles = useDialogStyle(size
|
|
24
|
+
const styles = useDialogStyle(size);
|
|
26
25
|
const {
|
|
27
26
|
height: screenHeight
|
|
28
27
|
} = useWindowDimensions();
|
|
@@ -40,8 +39,9 @@ export default function Dialog(props) {
|
|
|
40
39
|
return [];
|
|
41
40
|
}
|
|
42
41
|
|
|
42
|
+
const topElementHeightWithoutOffset = Math.max(0, topElementHeight - TOP_ELEMENT_HIDDEN_OFFSET);
|
|
43
43
|
return [{
|
|
44
|
-
toValue:
|
|
44
|
+
toValue: topElementHeightWithoutOffset / 2,
|
|
45
45
|
type: ANIMATION_TYPE.SLIDE
|
|
46
46
|
}];
|
|
47
47
|
}, [topElementHeight]);
|
|
@@ -51,7 +51,7 @@ export default function Dialog(props) {
|
|
|
51
51
|
toValue: 0,
|
|
52
52
|
type: ANIMATION_TYPE.FADE
|
|
53
53
|
}];
|
|
54
|
-
} else if (animationType === ANIMATION_TYPE.SLIDE
|
|
54
|
+
} else if (animationType === ANIMATION_TYPE.SLIDE) {
|
|
55
55
|
return [{
|
|
56
56
|
toValue: screenHeight,
|
|
57
57
|
type: ANIMATION_TYPE.SLIDE
|
|
@@ -67,14 +67,14 @@ export default function Dialog(props) {
|
|
|
67
67
|
toValue: screenHeight,
|
|
68
68
|
type: ANIMATION_TYPE.SLIDE
|
|
69
69
|
}];
|
|
70
|
-
}, [animationType,
|
|
70
|
+
}, [animationType, screenHeight]);
|
|
71
71
|
const openAnimation = useMemo(() => {
|
|
72
72
|
if (animationType === ANIMATION_TYPE.FADE) {
|
|
73
73
|
return [{
|
|
74
74
|
toValue: 1,
|
|
75
75
|
type: ANIMATION_TYPE.FADE
|
|
76
76
|
}];
|
|
77
|
-
} else if (animationType === ANIMATION_TYPE.SLIDE
|
|
77
|
+
} else if (animationType === ANIMATION_TYPE.SLIDE) {
|
|
78
78
|
return [{
|
|
79
79
|
toValue: 0,
|
|
80
80
|
type: ANIMATION_TYPE.SLIDE
|
|
@@ -90,12 +90,13 @@ export default function Dialog(props) {
|
|
|
90
90
|
toValue: 0,
|
|
91
91
|
type: ANIMATION_TYPE.SLIDE
|
|
92
92
|
}];
|
|
93
|
-
}, [animationType
|
|
94
|
-
const initialOpacity = animationType === ANIMATION_TYPE.SLIDE
|
|
93
|
+
}, [animationType]);
|
|
94
|
+
const initialOpacity = animationType === ANIMATION_TYPE.SLIDE ? 1 : undefined;
|
|
95
95
|
const initialTranslateY = animationType === ANIMATION_TYPE.FADE ? 0 : undefined;
|
|
96
96
|
const paperStyle = css([styles.paper, styleProp]);
|
|
97
97
|
return /*#__PURE__*/React.createElement(Modal, _extends({
|
|
98
98
|
animationStyle: styles.container,
|
|
99
|
+
avoidKeyboard: size !== 'full',
|
|
99
100
|
closeAnimation: closeAnimation,
|
|
100
101
|
hideBackdrop: hideBackdrop || animationType === ANIMATION_TYPE.FADE,
|
|
101
102
|
initialOpacity: initialOpacity,
|
|
@@ -110,7 +111,7 @@ export default function Dialog(props) {
|
|
|
110
111
|
size
|
|
111
112
|
}
|
|
112
113
|
}, topElement ? /*#__PURE__*/React.createElement(Column, {
|
|
113
|
-
style:
|
|
114
|
+
style: styles.topElementContainer
|
|
114
115
|
}, /*#__PURE__*/React.createElement(Column, {
|
|
115
116
|
style: styles.topElementContent,
|
|
116
117
|
onLayout: handleTopElementLayout
|
|
@@ -119,5 +120,4 @@ export default function Dialog(props) {
|
|
|
119
120
|
style: paperStyle
|
|
120
121
|
}, children)));
|
|
121
122
|
}
|
|
122
|
-
;
|
|
123
123
|
//# sourceMappingURL=Dialog.js.map
|