@fountain-ui/core 3.0.0-alpha.4 → 3.0.0-alpha.40
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 +15 -8
- 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/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/Badge/useVariantStyleMap.js +2 -2
- package/build/commonjs/Badge/useVariantStyleMap.js.map +1 -1
- package/build/commonjs/BottomSheetTitle/BottomSheetTitle.js +6 -2
- 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 +9 -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 +25 -14
- package/build/commonjs/Chip/Chip.js.map +1 -1
- package/build/commonjs/Chip/ChipProps.js +3 -1
- package/build/commonjs/Chip/ChipProps.js.map +1 -1
- package/build/commonjs/Chip/index.js +6 -0
- package/build/commonjs/Chip/index.js.map +1 -1
- package/build/commonjs/Chip/useChipStyle.js +51 -31
- package/build/commonjs/Chip/useChipStyle.js.map +1 -1
- package/build/commonjs/Dialog/Dialog.js +10 -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 +2 -2
- package/build/commonjs/Image/Image.js.map +1 -1
- package/build/commonjs/ImageCore/ImageCoreNative.js +1 -1
- package/build/commonjs/ImageCore/ImageCoreNative.js.map +1 -1
- package/build/commonjs/ListItem/ListItem.js +38 -26
- package/build/commonjs/ListItem/ListItem.js.map +1 -1
- package/build/commonjs/ListItem/ListItemProps.js.map +1 -1
- package/build/commonjs/ListItemIcon/ListItemIcon.js +1 -2
- package/build/commonjs/ListItemIcon/ListItemIcon.js.map +1 -1
- package/build/commonjs/ListItemSecondaryAction/ListItemSecondaryAction.js +2 -0
- package/build/commonjs/ListItemSecondaryAction/ListItemSecondaryAction.js.map +1 -1
- package/build/commonjs/ListItemText/ListItemText.js +20 -21
- package/build/commonjs/ListItemText/ListItemText.js.map +1 -1
- package/build/commonjs/ListItemText/ListItemTextProps.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 +1 -1
- package/build/commonjs/Modal/Modal.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 +11 -4
- package/build/commonjs/Radio/Radio.js.map +1 -1
- package/build/commonjs/RadioGroup/RadioGroup.js +2 -27
- package/build/commonjs/RadioGroup/RadioGroup.js.map +1 -1
- package/build/commonjs/Section/Section.js +32 -0
- package/build/commonjs/Section/Section.js.map +1 -0
- package/build/commonjs/Section/SectionProps.js +2 -0
- package/build/commonjs/Section/SectionProps.js.map +1 -0
- package/build/commonjs/Section/index.js +16 -0
- package/build/commonjs/Section/index.js.map +1 -0
- package/build/commonjs/ShadowView/ShadowView.native.js +4 -0
- package/build/commonjs/ShadowView/ShadowView.native.js.map +1 -1
- package/build/commonjs/SnackbarContent/SnackbarContent.js +26 -9
- 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 +59 -18
- 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 +23 -7
- 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 +60 -15
- package/build/commonjs/TextField/TextField.js.map +1 -1
- package/build/commonjs/TextField/useVariantStyleMap.js +29 -29
- 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 +18 -22
- 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/useBreakpointUp.js +4 -1
- package/build/commonjs/hooks/useBreakpointUp.js.map +1 -1
- package/build/commonjs/hooks/useCollapsibleAppBar.js +11 -13
- package/build/commonjs/hooks/useCollapsibleAppBar.js.map +1 -1
- package/build/commonjs/hooks/useContentContainerStyle.js +39 -25
- 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/index.js +21 -0
- package/build/commonjs/index.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/Search.js +2 -2
- package/build/commonjs/internal/icons/Search.js.map +1 -1
- package/build/commonjs/internal/icons/index.js +16 -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 +15 -8
- 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/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/Badge/useVariantStyleMap.js +2 -2
- package/build/module/Badge/useVariantStyleMap.js.map +1 -1
- package/build/module/BottomSheetTitle/BottomSheetTitle.js +6 -2
- 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 +9 -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 +21 -13
- package/build/module/Chip/Chip.js.map +1 -1
- package/build/module/Chip/ChipProps.js +1 -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 +51 -31
- package/build/module/Chip/useChipStyle.js.map +1 -1
- package/build/module/Dialog/Dialog.js +10 -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 +2 -2
- package/build/module/Image/Image.js.map +1 -1
- package/build/module/ImageCore/ImageCoreNative.js +1 -1
- package/build/module/ImageCore/ImageCoreNative.js.map +1 -1
- package/build/module/ListItem/ListItem.js +36 -28
- package/build/module/ListItem/ListItem.js.map +1 -1
- package/build/module/ListItem/ListItemProps.js.map +1 -1
- package/build/module/ListItemIcon/ListItemIcon.js +1 -2
- package/build/module/ListItemIcon/ListItemIcon.js.map +1 -1
- package/build/module/ListItemSecondaryAction/ListItemSecondaryAction.js +2 -0
- package/build/module/ListItemSecondaryAction/ListItemSecondaryAction.js.map +1 -1
- package/build/module/ListItemText/ListItemText.js +17 -19
- package/build/module/ListItemText/ListItemText.js.map +1 -1
- package/build/module/ListItemText/ListItemTextProps.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 +1 -1
- package/build/module/Modal/Modal.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 +10 -4
- package/build/module/Radio/Radio.js.map +1 -1
- package/build/module/RadioGroup/RadioGroup.js +2 -20
- package/build/module/RadioGroup/RadioGroup.js.map +1 -1
- package/build/module/Section/Section.js +19 -0
- package/build/module/Section/Section.js.map +1 -0
- package/build/module/Section/SectionProps.js +2 -0
- package/build/module/Section/SectionProps.js.map +1 -0
- package/build/module/Section/index.js +2 -0
- package/build/module/Section/index.js.map +1 -0
- package/build/module/ShadowView/ShadowView.native.js +4 -0
- package/build/module/ShadowView/ShadowView.native.js.map +1 -1
- package/build/module/SnackbarContent/SnackbarContent.js +26 -9
- 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 +59 -18
- 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 +21 -7
- 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 +60 -15
- package/build/module/TextField/TextField.js.map +1 -1
- package/build/module/TextField/useVariantStyleMap.js +29 -29
- 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 +11 -14
- 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/useBreakpointUp.js +4 -1
- package/build/module/hooks/useBreakpointUp.js.map +1 -1
- package/build/module/hooks/useCollapsibleAppBar.js +12 -13
- package/build/module/hooks/useCollapsibleAppBar.js.map +1 -1
- package/build/module/hooks/useContentContainerStyle.js +43 -25
- 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/index.js +2 -0
- package/build/module/index.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/Search.js +2 -2
- package/build/module/internal/icons/Search.js.map +1 -1
- package/build/module/internal/icons/index.js +2 -0
- package/build/module/internal/icons/index.js.map +1 -1
- package/build/typescript/Accordion/AccordionProps.d.ts +4 -1
- package/build/typescript/Accordion/useVariantStyleMap.d.ts +1 -0
- package/build/typescript/Badge/BadgeProps.d.ts +10 -5
- package/build/typescript/BottomSheetTitle/BottomSheetTitleProps.d.ts +1 -0
- package/build/typescript/Button/ButtonProps.d.ts +5 -0
- package/build/typescript/ButtonBase/index.d.ts +1 -1
- package/build/typescript/Checkbox/useVariantStyleMap.d.ts +1 -0
- package/build/typescript/Chip/ChipProps.d.ts +11 -4
- package/build/typescript/Chip/index.d.ts +1 -1
- package/build/typescript/Chip/useChipStyle.d.ts +6 -3
- package/build/typescript/Dialog/DialogProps.d.ts +1 -6
- package/build/typescript/Dialog/useDialogStyle.d.ts +1 -1
- package/build/typescript/DialogTitle/DialogLargeTitle.d.ts +9 -0
- package/build/typescript/DialogTitle/DialogTitle.d.ts +6 -1
- package/build/typescript/Divider/DividerProps.d.ts +1 -1
- package/build/typescript/Flexbox/FlexboxProps.d.ts +4 -0
- package/build/typescript/IconButton/IconButtonProps.d.ts +1 -1
- package/build/typescript/ListItem/ListItem.d.ts +1 -1
- package/build/typescript/ListItem/ListItemProps.d.ts +4 -0
- package/build/typescript/ListItemText/ListItemTextProps.d.ts +2 -9
- 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/Section/Section.d.ts +3 -0
- package/build/typescript/Section/SectionProps.d.ts +6 -0
- package/build/typescript/Section/index.d.ts +2 -0
- 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/TabBaseProps.d.ts +0 -5
- 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/useVariantStyleMap.d.ts +2 -0
- package/build/typescript/Toolbar/BackButton/BackButton.d.ts +3 -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 -1
- package/build/typescript/Toolbar/ToolbarProps.d.ts +0 -5
- package/build/typescript/Tooltip/Beaks/index.d.ts +4 -0
- 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/hooks/useCollapsibleAppBar.d.ts +1 -1
- package/build/typescript/hooks/useContentContainerStyle.d.ts +5 -8
- package/build/typescript/index.d.ts +2 -0
- package/build/typescript/internal/icons/AppBarChevronLeft.d.ts +131 -0
- package/build/typescript/internal/icons/ChipClose.d.ts +131 -0
- package/build/typescript/internal/icons/index.d.ts +2 -0
- package/package.json +5 -5
- package/src/Accordion/Accordion.tsx +23 -14
- package/src/Accordion/AccordionProps.ts +4 -2
- package/src/Accordion/useVariantStyleMap.ts +14 -6
- package/src/AppBar/AppBar.tsx +2 -2
- package/src/Badge/Badge.tsx +4 -3
- package/src/Badge/BadgeProps.ts +12 -6
- package/src/Badge/useVariantStyleMap.ts +2 -2
- package/src/BottomSheetTitle/BottomSheetTitle.tsx +5 -1
- package/src/BottomSheetTitle/BottomSheetTitleProps.ts +1 -0
- package/src/Button/Button.tsx +28 -12
- package/src/Button/ButtonProps.ts +6 -0
- package/src/Button/useVariantStyleMap.ts +9 -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 +24 -13
- package/src/Chip/ChipProps.ts +13 -4
- package/src/Chip/index.ts +1 -1
- package/src/Chip/useChipStyle.ts +59 -29
- package/src/Dialog/Dialog.tsx +12 -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 +3 -3
- package/src/ImageCore/ImageCoreNative.tsx +1 -1
- package/src/ListItem/ListItem.tsx +61 -30
- package/src/ListItem/ListItemProps.ts +5 -0
- package/src/ListItemIcon/ListItemIcon.tsx +1 -2
- package/src/ListItemSecondaryAction/ListItemSecondaryAction.tsx +2 -0
- package/src/ListItemText/ListItemText.tsx +20 -28
- package/src/ListItemText/ListItemTextProps.ts +2 -10
- package/src/ListSubheader/ListSubheader.tsx +1 -1
- package/src/Modal/Modal.tsx +1 -1
- 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 +12 -3
- package/src/RadioGroup/RadioGroup.tsx +2 -28
- package/src/Section/Section.tsx +26 -0
- package/src/Section/SectionProps.ts +6 -0
- package/src/Section/index.ts +2 -0
- package/src/ShadowView/ShadowView.native.tsx +4 -0
- package/src/SnackbarContent/SnackbarContent.tsx +36 -15
- 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 +72 -19
- package/src/TabBase/TabBase.tsx +1 -9
- package/src/TabBase/TabBaseProps.ts +0 -6
- package/src/Tabs/Tabs.tsx +26 -8
- 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 +99 -45
- package/src/TextField/useVariantStyleMap.ts +29 -27
- package/src/Toolbar/BackButton/BackButton.tsx +44 -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 +10 -12
- 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/useBreakpointUp.ts +3 -1
- package/src/hooks/useCollapsibleAppBar.ts +10 -24
- package/src/hooks/useContentContainerStyle.ts +43 -31
- package/src/hooks/useFadeInAppBar.ts +4 -4
- package/src/index.ts +3 -0
- 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/Search.tsx +2 -2
- package/src/internal/icons/index.ts +2 -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,60 +1,72 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { FountainUiStyle } from '@fountain-ui/styles';
|
|
2
|
+
import { css, useTheme } from '../styles';
|
|
2
3
|
import type { Theme } from '../types';
|
|
3
|
-
import { useTheme } from '../styles';
|
|
4
|
-
import useBreakpointUp from './useBreakpointUp';
|
|
5
4
|
|
|
6
5
|
type Breakpoint = keyof Theme['breakpoints']['values'];
|
|
7
6
|
|
|
8
|
-
type ContentContainerStyle = ScrollViewProps['contentContainerStyle'];
|
|
9
|
-
|
|
10
7
|
export interface Config {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
8
|
+
maxWidth?: number;
|
|
9
|
+
styleProvider?: (theme: Theme) => FountainUiStyle;
|
|
10
|
+
isHomeScreen?: boolean;
|
|
14
11
|
}
|
|
15
12
|
|
|
16
|
-
|
|
17
|
-
breakpoint
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
13
|
+
function getMaxWidth(theme: Theme, breakpoint: Breakpoint, customMaxWidth?: number): number | undefined {
|
|
14
|
+
switch (breakpoint) {
|
|
15
|
+
case 'lg':
|
|
16
|
+
case 'md':
|
|
17
|
+
return customMaxWidth ?? theme.breakpoints.values[breakpoint];
|
|
18
|
+
default:
|
|
19
|
+
return undefined;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
21
22
|
|
|
22
|
-
|
|
23
|
-
function getMaxWidth(theme: Theme, breakpoint: Breakpoint): ViewStyle['maxWidth'] {
|
|
23
|
+
function getHomeScreenPaddingHorizontal(theme: Theme, breakpoint: Breakpoint): number {
|
|
24
24
|
switch (breakpoint) {
|
|
25
|
+
case 'xxs':
|
|
25
26
|
case 'xs':
|
|
26
|
-
return theme.
|
|
27
|
+
return theme.spacing(3);
|
|
27
28
|
case 'sm':
|
|
28
|
-
return theme.
|
|
29
|
+
return theme.spacing(6);
|
|
29
30
|
case 'md':
|
|
30
|
-
return theme.breakpoints.values['lg'];
|
|
31
31
|
case 'lg':
|
|
32
|
-
|
|
32
|
+
default:
|
|
33
|
+
return theme.spacing(4);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function getPaddingHorizontal(theme: Theme, breakpoint: Breakpoint, isHomeScreen?: boolean): number {
|
|
38
|
+
if (isHomeScreen) {
|
|
39
|
+
return getHomeScreenPaddingHorizontal(theme, breakpoint);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
switch (breakpoint) {
|
|
43
|
+
case 'sm':
|
|
44
|
+
return theme.spacing(6);
|
|
45
|
+
default:
|
|
46
|
+
return theme.spacing(4);
|
|
33
47
|
}
|
|
34
48
|
}
|
|
35
49
|
|
|
36
|
-
export default function useContentContainerStyle(config: Config =
|
|
50
|
+
export default function useContentContainerStyle(config: Config = {}): FountainUiStyle {
|
|
37
51
|
const {
|
|
38
|
-
|
|
39
|
-
maxWidth,
|
|
52
|
+
maxWidth: customMaxWidth,
|
|
40
53
|
styleProvider,
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
...config,
|
|
44
|
-
};
|
|
54
|
+
isHomeScreen = false,
|
|
55
|
+
} = config;
|
|
45
56
|
|
|
46
57
|
const theme = useTheme();
|
|
47
58
|
|
|
59
|
+
const currentBreakpoint = theme.breakpoints.current;
|
|
60
|
+
|
|
48
61
|
const additionalStyle = styleProvider?.(theme);
|
|
49
62
|
|
|
50
|
-
|
|
63
|
+
return css([
|
|
51
64
|
{
|
|
52
65
|
alignSelf: 'center',
|
|
53
|
-
maxWidth: getMaxWidth(theme,
|
|
66
|
+
maxWidth: getMaxWidth(theme, currentBreakpoint, customMaxWidth),
|
|
67
|
+
paddingHorizontal: getPaddingHorizontal(theme, currentBreakpoint, isHomeScreen),
|
|
54
68
|
width: '100%',
|
|
55
69
|
},
|
|
56
70
|
additionalStyle,
|
|
57
|
-
];
|
|
58
|
-
|
|
59
|
-
return useBreakpointUp(breakpoint, yesStyle, additionalStyle);
|
|
71
|
+
]);
|
|
60
72
|
};
|
|
@@ -76,7 +76,7 @@ export default function useFadeInAppBar(userOptions: Options = defaultOptions):
|
|
|
76
76
|
const lastOffsetY = useSharedValue<number>(0);
|
|
77
77
|
const normalized = useSharedValue<number>(0);
|
|
78
78
|
|
|
79
|
-
const originalBackgroundColor = theme.palette.background.
|
|
79
|
+
const originalBackgroundColor = theme.palette.background.base;
|
|
80
80
|
const rgbValues = useMemo(() => rgb(originalBackgroundColor), [originalBackgroundColor]);
|
|
81
81
|
|
|
82
82
|
const animatedAppBarStyle = useAnimatedStyle(() => {
|
|
@@ -88,11 +88,11 @@ export default function useFadeInAppBar(userOptions: Options = defaultOptions):
|
|
|
88
88
|
borderColor: theme.palette.divider,
|
|
89
89
|
borderBottomWidth: normalized.value >= 1 ? StyleSheet.hairlineWidth : 0,
|
|
90
90
|
};
|
|
91
|
-
}, [rgbValues]);
|
|
91
|
+
}, [rgbValues, normalized, theme]);
|
|
92
92
|
|
|
93
93
|
const animatedTitleStyle = useAnimatedStyle(() => ({
|
|
94
94
|
opacity: normalized.value,
|
|
95
|
-
}), []);
|
|
95
|
+
}), [normalized]);
|
|
96
96
|
|
|
97
97
|
const scrollHandler = useAnimatedScrollHandler({
|
|
98
98
|
onBeginDrag: () => {
|
|
@@ -117,7 +117,7 @@ export default function useFadeInAppBar(userOptions: Options = defaultOptions):
|
|
|
117
117
|
onMomentumEnd: (event) => {
|
|
118
118
|
lastOffsetY.value = event.contentOffset.y;
|
|
119
119
|
},
|
|
120
|
-
}
|
|
120
|
+
});
|
|
121
121
|
|
|
122
122
|
const appBarStyle = [
|
|
123
123
|
animatedAppBarStyle,
|
package/src/index.ts
CHANGED
|
@@ -149,6 +149,9 @@ export * from './RadioGroup';
|
|
|
149
149
|
export { default as Row } from './Row';
|
|
150
150
|
export * from './Row';
|
|
151
151
|
|
|
152
|
+
export { default as Section } from './Section';
|
|
153
|
+
export * from './Section';
|
|
154
|
+
|
|
152
155
|
export { default as ShadowView } from './ShadowView';
|
|
153
156
|
export * from './ShadowView';
|
|
154
157
|
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Path } from 'react-native-svg';
|
|
3
|
+
import { createSvgIcon } from '../../utils';
|
|
4
|
+
|
|
5
|
+
export default createSvgIcon(
|
|
6
|
+
<React.Fragment>
|
|
7
|
+
<Path
|
|
8
|
+
fillRule="evenodd"
|
|
9
|
+
clipRule="evenodd"
|
|
10
|
+
d="M7.29289 12.7071C6.90237 12.3166 6.90237 11.6834 7.29289 11.2929L15.2929 3.29289C15.6834 2.90237 16.3166 2.90237 16.7071 3.29289C17.0976 3.68342 17.0976 4.31658 16.7071 4.70711L9.41421 12L16.7071 19.2929C17.0976 19.6834 17.0976 20.3166 16.7071 20.7071C16.3166 21.0976 15.6834 21.0976 15.2929 20.7071L7.29289 12.7071Z"
|
|
11
|
+
/>
|
|
12
|
+
</React.Fragment>,
|
|
13
|
+
'AppBarChevronLeft',
|
|
14
|
+
'0 0 24 24',
|
|
15
|
+
);
|
|
@@ -4,7 +4,10 @@ import { createSvgIcon } from '../../utils';
|
|
|
4
4
|
|
|
5
5
|
export default createSvgIcon(
|
|
6
6
|
<Path
|
|
7
|
-
|
|
7
|
+
fillRule="evenodd"
|
|
8
|
+
clipRule="evenodd"
|
|
9
|
+
d="M0 12C3.16267e-09 11.7348 0.105357 11.4804 0.292893 11.2929L6.29289 5.29289C6.68342 4.90237 7.31658 4.90237 7.70711 5.29289C8.09763 5.68342 8.09763 6.31658 7.70711 6.70711L2.41421 12L7.70711 17.2929C8.09763 17.6834 8.09763 18.3166 7.70711 18.7071C7.31658 19.0976 6.68342 19.0976 6.29289 18.7071L0.292893 12.7071C0.105357 12.5196 -3.16267e-09 12.2652 0 12Z"
|
|
8
10
|
/>,
|
|
9
11
|
'ChevronLeft',
|
|
12
|
+
'0 0 8 24',
|
|
10
13
|
);
|
|
@@ -4,7 +4,10 @@ import { createSvgIcon } from '../../utils';
|
|
|
4
4
|
|
|
5
5
|
export default createSvgIcon(
|
|
6
6
|
<Path
|
|
7
|
-
|
|
7
|
+
fillRule="evenodd"
|
|
8
|
+
clipRule="evenodd"
|
|
9
|
+
d="M8 12C8 12.2652 7.89464 12.5196 7.70711 12.7071L1.70711 18.7071C1.31658 19.0976 0.683417 19.0976 0.292892 18.7071C-0.0976309 18.3166 -0.0976309 17.6834 0.292893 17.2929L5.58579 12L0.292894 6.70711C-0.0976304 6.31658 -0.0976304 5.68342 0.292895 5.29289C0.683418 4.90237 1.31658 4.90237 1.70711 5.29289L7.70711 11.2929C7.89464 11.4804 8 11.7348 8 12Z"
|
|
8
10
|
/>,
|
|
9
11
|
'ChevronRight',
|
|
12
|
+
'0 0 8 24',
|
|
10
13
|
);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Path } from 'react-native-svg';
|
|
3
|
+
import { createSvgIcon } from '../../utils';
|
|
4
|
+
|
|
5
|
+
export default createSvgIcon(
|
|
6
|
+
<Path
|
|
7
|
+
fillRule="evenodd"
|
|
8
|
+
clipRule="evenodd"
|
|
9
|
+
d="M0.170854 3.58753C0.39866 3.35972 0.768006 3.35972 0.995812 3.58753L4.08333 6.67505L7.17085 3.58753C7.39866 3.35972 7.76801 3.35972 7.99581 3.58753C8.22362 3.81533 8.22362 4.18468 7.99581 4.41248L4.90829 7.5L7.99581 10.5875C8.22362 10.8153 8.22362 11.1847 7.99581 11.4125C7.76801 11.6403 7.39866 11.6403 7.17085 11.4125L4.08333 8.32496L0.995812 11.4125C0.768006 11.6403 0.39866 11.6403 0.170854 11.4125C-0.0569515 11.1847 -0.0569515 10.8153 0.170854 10.5875L3.25838 7.5L0.170854 4.41248C-0.0569515 4.18468 -0.0569515 3.81533 0.170854 3.58753Z"
|
|
10
|
+
/>,
|
|
11
|
+
'ChipClose',
|
|
12
|
+
'0 0 9 15',
|
|
13
|
+
);
|
|
@@ -7,14 +7,14 @@ export default createSvgIcon(
|
|
|
7
7
|
<Path
|
|
8
8
|
fillRule="evenodd"
|
|
9
9
|
clipRule="evenodd"
|
|
10
|
-
d="
|
|
10
|
+
d="M5.32076 6.32681C5.603 6.04521 6.06061 6.04521 6.34285 6.32681L7.99999 7.98019L9.65712 6.32681C9.93937 6.04521 10.397 6.04521 10.6792 6.32681C10.9615 6.60842 10.9615 7.06498 10.6792 7.34659L9.02208 8.99997L10.6792 10.6533C10.9615 10.9349 10.9615 11.3915 10.6792 11.6731C10.397 11.9547 9.93937 11.9547 9.65712 11.6731L7.99999 10.0197L6.34285 11.6731C6.06061 11.9547 5.603 11.9547 5.32076 11.6731C5.03852 11.3915 5.03852 10.9349 5.32076 10.6533L6.9779 8.99997L5.32076 7.34659C5.03852 7.06498 5.03852 6.60842 5.32076 6.32681Z"
|
|
11
11
|
/>
|
|
12
12
|
<Path
|
|
13
13
|
fillRule="evenodd"
|
|
14
14
|
clipRule="evenodd"
|
|
15
|
-
d="M7 2.
|
|
15
|
+
d="M7.99999 2.51017C4.40763 2.51017 1.49544 5.41575 1.49544 8.99997C1.49544 12.5842 4.40763 15.4898 7.99999 15.4898C11.5923 15.4898 14.5045 12.5842 14.5045 8.99997C14.5045 5.41575 11.5923 2.51017 7.99999 2.51017ZM0.0499878 8.99997C0.0499878 4.61926 3.60932 1.06799 7.99999 1.06799C12.3907 1.06799 15.95 4.61926 15.95 8.99997C15.95 13.3807 12.3907 16.9319 7.99999 16.9319C3.60932 16.9319 0.0499878 13.3807 0.0499878 8.99997Z"
|
|
16
16
|
/>
|
|
17
17
|
</React.Fragment>,
|
|
18
18
|
'Clear',
|
|
19
|
-
'0 0
|
|
19
|
+
'0 0 16 18',
|
|
20
20
|
);
|
|
@@ -4,7 +4,10 @@ import { createSvgIcon } from '../../utils';
|
|
|
4
4
|
|
|
5
5
|
export default createSvgIcon(
|
|
6
6
|
<Path
|
|
7
|
-
|
|
7
|
+
fillRule="evenodd"
|
|
8
|
+
clipRule="evenodd"
|
|
9
|
+
d="M0.292893 5.29289C0.683417 4.90237 1.31658 4.90237 1.70711 5.29289L7 10.5858L12.2929 5.29289C12.6834 4.90237 13.3166 4.90237 13.7071 5.29289C14.0976 5.68342 14.0976 6.31658 13.7071 6.70711L8.41421 12L13.7071 17.2929C14.0976 17.6834 14.0976 18.3166 13.7071 18.7071C13.3166 19.0976 12.6834 19.0976 12.2929 18.7071L7 13.4142L1.70711 18.7071C1.31658 19.0976 0.683417 19.0976 0.292893 18.7071C-0.0976311 18.3166 -0.0976311 17.6834 0.292893 17.2929L5.58579 12L0.292893 6.70711C-0.0976311 6.31658 -0.0976311 5.68342 0.292893 5.29289Z"
|
|
8
10
|
/>,
|
|
9
11
|
'Close',
|
|
12
|
+
'0 0 14 24',
|
|
10
13
|
);
|
|
@@ -7,9 +7,9 @@ export default createSvgIcon(
|
|
|
7
7
|
<Path
|
|
8
8
|
fillRule="evenodd"
|
|
9
9
|
clipRule="evenodd"
|
|
10
|
-
d="M8.
|
|
10
|
+
d="M8.70834 3.16665C5.64776 3.16665 3.16667 5.64774 3.16667 8.70831C3.16667 11.7689 5.64776 14.25 8.70834 14.25C10.2024 14.25 11.5585 13.6587 12.5551 12.6973C12.5755 12.6711 12.5977 12.6458 12.6218 12.6217C12.6459 12.5977 12.6711 12.5754 12.6974 12.5551C13.6587 11.5584 14.25 10.2024 14.25 8.70831C14.25 5.64774 11.7689 3.16665 8.70834 3.16665ZM14.2753 13.1556C15.2503 11.9367 15.8333 10.3906 15.8333 8.70831C15.8333 4.77328 12.6434 1.58331 8.70834 1.58331C4.77331 1.58331 1.58334 4.77328 1.58334 8.70831C1.58334 12.6433 4.77331 15.8333 8.70834 15.8333C10.3906 15.8333 11.9368 15.2503 13.1557 14.2752L16.0655 17.1851C16.3747 17.4942 16.8759 17.4942 17.1851 17.1851C17.4943 16.8759 17.4943 16.3747 17.1851 16.0655L14.2753 13.1556Z"
|
|
11
11
|
/>
|
|
12
12
|
</React.Fragment>,
|
|
13
13
|
'Search',
|
|
14
|
-
'0 0
|
|
14
|
+
'0 0 19 19',
|
|
15
15
|
);
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export { default as AppBarChevronLeft } from './AppBarChevronLeft';
|
|
1
2
|
export { default as Check } from './Check';
|
|
2
3
|
export { default as Checkbox } from './Checkbox';
|
|
3
4
|
export { default as CheckboxChecked } from './CheckboxChecked';
|
|
@@ -6,6 +7,7 @@ export { default as CheckCircle } from './CheckCircle';
|
|
|
6
7
|
export { default as ChevronDown } from './ChevronDown';
|
|
7
8
|
export { default as ChevronLeft } from './ChevronLeft';
|
|
8
9
|
export { default as ChevronRight } from './ChevronRight';
|
|
10
|
+
export { default as ChipClose } from './ChipClose';
|
|
9
11
|
export { default as CircularProgress } from './CircularProgress';
|
|
10
12
|
export { default as Clear } from './Clear';
|
|
11
13
|
export { default as Close } from './Close';
|
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.ORIGINAL_OPACITY = exports.DISABLED_OPACITY = void 0;
|
|
7
|
-
exports.default = ButtonBase;
|
|
8
|
-
|
|
9
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
-
|
|
11
|
-
var _reactNative = require("react-native");
|
|
12
|
-
|
|
13
|
-
var _hooks = require("../hooks");
|
|
14
|
-
|
|
15
|
-
var _utils = require("../utils");
|
|
16
|
-
|
|
17
|
-
var _animated = require("../animated");
|
|
18
|
-
|
|
19
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
20
|
-
|
|
21
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
22
|
-
|
|
23
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
24
|
-
|
|
25
|
-
const ORIGINAL_OPACITY = 1;
|
|
26
|
-
exports.ORIGINAL_OPACITY = ORIGINAL_OPACITY;
|
|
27
|
-
const DISABLED_OPACITY = .3;
|
|
28
|
-
exports.DISABLED_OPACITY = DISABLED_OPACITY;
|
|
29
|
-
const ACTIVE_OPACITY = .65;
|
|
30
|
-
const ORIGINAL_SCALE = 1;
|
|
31
|
-
const MINIFIED_SCALE = .96; // at "node_modules/react-native/Libraries/Pressability.js"
|
|
32
|
-
// const DEFAULT_MIN_PRESS_DURATION = 130;
|
|
33
|
-
|
|
34
|
-
const SCALE_EFFECT_PRESS_IN_DELAY = 130;
|
|
35
|
-
const OPACITY_EFFECT_PRESS_IN_DELAY = 0;
|
|
36
|
-
|
|
37
|
-
const startTimingAnimationWithDefaults = (value, toValue) => {
|
|
38
|
-
_reactNative.Animated.timing(value, {
|
|
39
|
-
toValue,
|
|
40
|
-
duration: 150,
|
|
41
|
-
useNativeDriver: _utils.isNotAndroid12
|
|
42
|
-
}).start();
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
const getOpacityByDisabled = disabled => disabled ? DISABLED_OPACITY : ORIGINAL_OPACITY;
|
|
46
|
-
|
|
47
|
-
function ButtonBase(props) {
|
|
48
|
-
const {
|
|
49
|
-
children,
|
|
50
|
-
disabled = false,
|
|
51
|
-
disableThrottle = false,
|
|
52
|
-
onPress,
|
|
53
|
-
onPressOut,
|
|
54
|
-
pressEffect = 'opacity',
|
|
55
|
-
pressDelay: pressDelayOrNil,
|
|
56
|
-
style: styleProp,
|
|
57
|
-
throttleMillis = 650,
|
|
58
|
-
...otherProps
|
|
59
|
-
} = props;
|
|
60
|
-
const handlePress = (0, _hooks.useThrottle)({
|
|
61
|
-
periodMillis: disableThrottle ? 0 : throttleMillis,
|
|
62
|
-
callback: onPress
|
|
63
|
-
});
|
|
64
|
-
const opacity = (0, _hooks.useAnimatedValue)(getOpacityByDisabled(disabled));
|
|
65
|
-
const scale = (0, _hooks.useAnimatedValue)(ORIGINAL_SCALE);
|
|
66
|
-
(0, _react.useEffect)(() => {
|
|
67
|
-
opacity.setValue(getOpacityByDisabled(disabled));
|
|
68
|
-
}, [disabled, pressEffect]);
|
|
69
|
-
const startScaleAnimation = (0, _react.useCallback)((pressIn, isHover) => {
|
|
70
|
-
if (!isHover) {
|
|
71
|
-
startTimingAnimationWithDefaults(scale, pressIn ? MINIFIED_SCALE : ORIGINAL_SCALE);
|
|
72
|
-
}
|
|
73
|
-
}, []);
|
|
74
|
-
const startOpacityAnimation = (0, _react.useCallback)(pressIn => {
|
|
75
|
-
if (pressIn) {
|
|
76
|
-
opacity.setValue(ACTIVE_OPACITY);
|
|
77
|
-
} else {
|
|
78
|
-
startTimingAnimationWithDefaults(opacity, ORIGINAL_OPACITY);
|
|
79
|
-
}
|
|
80
|
-
}, []);
|
|
81
|
-
const startPressAnimation = (0, _react.useCallback)(function (pressIn) {
|
|
82
|
-
let isHover = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
83
|
-
|
|
84
|
-
if (pressEffect === 'scale') {
|
|
85
|
-
startScaleAnimation(pressIn, isHover);
|
|
86
|
-
} else if (pressEffect === 'opacity') {
|
|
87
|
-
startOpacityAnimation(pressIn, isHover);
|
|
88
|
-
}
|
|
89
|
-
}, [pressEffect]);
|
|
90
|
-
const handlePressIn = (0, _react.useCallback)(() => {
|
|
91
|
-
startPressAnimation(true, false);
|
|
92
|
-
}, [startPressAnimation]);
|
|
93
|
-
const handlePressOut = (0, _react.useCallback)(() => {
|
|
94
|
-
onPressOut && onPressOut();
|
|
95
|
-
startPressAnimation(false, false);
|
|
96
|
-
}, [startPressAnimation, onPressOut]);
|
|
97
|
-
const animatedStyle = {
|
|
98
|
-
opacity,
|
|
99
|
-
transform: [{
|
|
100
|
-
scale
|
|
101
|
-
}]
|
|
102
|
-
};
|
|
103
|
-
const defaultPressDelay = pressEffect === 'scale' ? SCALE_EFFECT_PRESS_IN_DELAY : OPACITY_EFFECT_PRESS_IN_DELAY;
|
|
104
|
-
const pressDelay = pressDelayOrNil ?? defaultPressDelay;
|
|
105
|
-
return /*#__PURE__*/_react.default.createElement(_animated.AnimatedPressable, _extends({
|
|
106
|
-
disabled: disabled,
|
|
107
|
-
onPress: handlePress,
|
|
108
|
-
onPressIn: handlePressIn,
|
|
109
|
-
onPressOut: handlePressOut,
|
|
110
|
-
style: [animatedStyle, styleProp],
|
|
111
|
-
unstable_pressDelay: pressDelay
|
|
112
|
-
}, otherProps), typeof children !== 'function' ? _ref => {
|
|
113
|
-
let {
|
|
114
|
-
hovered
|
|
115
|
-
} = _ref;
|
|
116
|
-
|
|
117
|
-
if (hovered !== undefined && !disabled) {
|
|
118
|
-
startPressAnimation(hovered, true);
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
return children;
|
|
122
|
-
} : children);
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
;
|
|
126
|
-
//# sourceMappingURL=LegacyButtonBase.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["ORIGINAL_OPACITY","DISABLED_OPACITY","ACTIVE_OPACITY","ORIGINAL_SCALE","MINIFIED_SCALE","SCALE_EFFECT_PRESS_IN_DELAY","OPACITY_EFFECT_PRESS_IN_DELAY","startTimingAnimationWithDefaults","value","toValue","Animated","timing","duration","useNativeDriver","isNotAndroid12","start","getOpacityByDisabled","disabled","ButtonBase","props","children","disableThrottle","onPress","onPressOut","pressEffect","pressDelay","pressDelayOrNil","style","styleProp","throttleMillis","otherProps","handlePress","useThrottle","periodMillis","callback","opacity","useAnimatedValue","scale","useEffect","setValue","startScaleAnimation","useCallback","pressIn","isHover","startOpacityAnimation","startPressAnimation","handlePressIn","handlePressOut","animatedStyle","transform","defaultPressDelay","hovered","undefined"],"sources":["LegacyButtonBase.tsx"],"sourcesContent":["import React, { useCallback, useEffect } 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;\nexport const DISABLED_OPACITY = .3;\nconst ACTIVE_OPACITY = .65;\n\nconst ORIGINAL_SCALE = 1;\nconst MINIFIED_SCALE = .96;\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\nconst getOpacityByDisabled = (disabled: boolean) => disabled ? DISABLED_OPACITY : ORIGINAL_OPACITY;\n\nexport default function ButtonBase(props: ButtonBaseProps) {\n const {\n children,\n disabled = false,\n disableThrottle = false,\n onPress,\n onPressOut,\n pressEffect = 'opacity',\n pressDelay: pressDelayOrNil,\n style: styleProp,\n throttleMillis = 650,\n ...otherProps\n } = props;\n\n const handlePress = useThrottle({\n periodMillis: disableThrottle ? 0 : throttleMillis,\n callback: onPress,\n });\n\n const opacity = useAnimatedValue(getOpacityByDisabled(disabled));\n const scale = useAnimatedValue(ORIGINAL_SCALE);\n\n useEffect(() => {\n opacity.setValue(getOpacityByDisabled(disabled));\n }, [disabled, pressEffect]);\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;;AACA;;AACA;;AACA;;AACA;;;;;;;;AAOO,MAAMA,gBAAgB,GAAG,CAAzB;;AACA,MAAMC,gBAAgB,GAAG,EAAzB;;AACP,MAAMC,cAAc,GAAG,GAAvB;AAEA,MAAMC,cAAc,GAAG,CAAvB;AACA,MAAMC,cAAc,GAAG,GAAvB,C,CAEA;AACA;;AACA,MAAMC,2BAA2B,GAAG,GAApC;AACA,MAAMC,6BAA6B,GAAG,CAAtC;;AAKA,MAAMC,gCAAgC,GAAG,CACrCC,KADqC,EAErCC,OAFqC,KAGpC;EACDC,qBAAA,CAASC,MAAT,CAAgBH,KAAhB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,CALX;IASI,mBAAmB,EAAEH;EATzB,GAUQK,UAVR,GAYK,OAAOV,QAAP,KAAoB,UAApB,GACG,QAAiB;IAAA,IAAhB;MAAE+B;IAAF,CAAgB;;IACb,IAAIA,OAAO,KAAKC,SAAZ,IAAyB,CAACnC,QAA9B,EAAwC;MACpC4B,mBAAmB,CAACM,OAAD,EAAU,IAAV,CAAnB;IACH;;IAED,OAAO/B,QAAP;EACH,CAPJ,GAQGA,QApBR,CADJ;AAwBH;;AAAA"}
|
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
-
|
|
3
|
-
import React, { useCallback, useEffect } from 'react';
|
|
4
|
-
import { Animated } from 'react-native';
|
|
5
|
-
import { useAnimatedValue, useThrottle } from '../hooks';
|
|
6
|
-
import { isNotAndroid12 } from '../utils';
|
|
7
|
-
import { AnimatedPressable } from '../animated';
|
|
8
|
-
export const ORIGINAL_OPACITY = 1;
|
|
9
|
-
export const DISABLED_OPACITY = .3;
|
|
10
|
-
const ACTIVE_OPACITY = .65;
|
|
11
|
-
const ORIGINAL_SCALE = 1;
|
|
12
|
-
const MINIFIED_SCALE = .96; // at "node_modules/react-native/Libraries/Pressability.js"
|
|
13
|
-
// const DEFAULT_MIN_PRESS_DURATION = 130;
|
|
14
|
-
|
|
15
|
-
const SCALE_EFFECT_PRESS_IN_DELAY = 130;
|
|
16
|
-
const OPACITY_EFFECT_PRESS_IN_DELAY = 0;
|
|
17
|
-
|
|
18
|
-
const startTimingAnimationWithDefaults = (value, toValue) => {
|
|
19
|
-
Animated.timing(value, {
|
|
20
|
-
toValue,
|
|
21
|
-
duration: 150,
|
|
22
|
-
useNativeDriver: isNotAndroid12
|
|
23
|
-
}).start();
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
const getOpacityByDisabled = disabled => disabled ? DISABLED_OPACITY : ORIGINAL_OPACITY;
|
|
27
|
-
|
|
28
|
-
export default function ButtonBase(props) {
|
|
29
|
-
const {
|
|
30
|
-
children,
|
|
31
|
-
disabled = false,
|
|
32
|
-
disableThrottle = false,
|
|
33
|
-
onPress,
|
|
34
|
-
onPressOut,
|
|
35
|
-
pressEffect = 'opacity',
|
|
36
|
-
pressDelay: pressDelayOrNil,
|
|
37
|
-
style: styleProp,
|
|
38
|
-
throttleMillis = 650,
|
|
39
|
-
...otherProps
|
|
40
|
-
} = props;
|
|
41
|
-
const handlePress = useThrottle({
|
|
42
|
-
periodMillis: disableThrottle ? 0 : throttleMillis,
|
|
43
|
-
callback: onPress
|
|
44
|
-
});
|
|
45
|
-
const opacity = useAnimatedValue(getOpacityByDisabled(disabled));
|
|
46
|
-
const scale = useAnimatedValue(ORIGINAL_SCALE);
|
|
47
|
-
useEffect(() => {
|
|
48
|
-
opacity.setValue(getOpacityByDisabled(disabled));
|
|
49
|
-
}, [disabled, pressEffect]);
|
|
50
|
-
const startScaleAnimation = useCallback((pressIn, isHover) => {
|
|
51
|
-
if (!isHover) {
|
|
52
|
-
startTimingAnimationWithDefaults(scale, pressIn ? MINIFIED_SCALE : ORIGINAL_SCALE);
|
|
53
|
-
}
|
|
54
|
-
}, []);
|
|
55
|
-
const startOpacityAnimation = useCallback(pressIn => {
|
|
56
|
-
if (pressIn) {
|
|
57
|
-
opacity.setValue(ACTIVE_OPACITY);
|
|
58
|
-
} else {
|
|
59
|
-
startTimingAnimationWithDefaults(opacity, ORIGINAL_OPACITY);
|
|
60
|
-
}
|
|
61
|
-
}, []);
|
|
62
|
-
const startPressAnimation = useCallback(function (pressIn) {
|
|
63
|
-
let isHover = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
64
|
-
|
|
65
|
-
if (pressEffect === 'scale') {
|
|
66
|
-
startScaleAnimation(pressIn, isHover);
|
|
67
|
-
} else if (pressEffect === 'opacity') {
|
|
68
|
-
startOpacityAnimation(pressIn, isHover);
|
|
69
|
-
}
|
|
70
|
-
}, [pressEffect]);
|
|
71
|
-
const handlePressIn = useCallback(() => {
|
|
72
|
-
startPressAnimation(true, false);
|
|
73
|
-
}, [startPressAnimation]);
|
|
74
|
-
const handlePressOut = useCallback(() => {
|
|
75
|
-
onPressOut && onPressOut();
|
|
76
|
-
startPressAnimation(false, false);
|
|
77
|
-
}, [startPressAnimation, onPressOut]);
|
|
78
|
-
const animatedStyle = {
|
|
79
|
-
opacity,
|
|
80
|
-
transform: [{
|
|
81
|
-
scale
|
|
82
|
-
}]
|
|
83
|
-
};
|
|
84
|
-
const defaultPressDelay = pressEffect === 'scale' ? SCALE_EFFECT_PRESS_IN_DELAY : OPACITY_EFFECT_PRESS_IN_DELAY;
|
|
85
|
-
const pressDelay = pressDelayOrNil ?? defaultPressDelay;
|
|
86
|
-
return /*#__PURE__*/React.createElement(AnimatedPressable, _extends({
|
|
87
|
-
disabled: disabled,
|
|
88
|
-
onPress: handlePress,
|
|
89
|
-
onPressIn: handlePressIn,
|
|
90
|
-
onPressOut: handlePressOut,
|
|
91
|
-
style: [animatedStyle, styleProp],
|
|
92
|
-
unstable_pressDelay: pressDelay
|
|
93
|
-
}, otherProps), typeof children !== 'function' ? _ref => {
|
|
94
|
-
let {
|
|
95
|
-
hovered
|
|
96
|
-
} = _ref;
|
|
97
|
-
|
|
98
|
-
if (hovered !== undefined && !disabled) {
|
|
99
|
-
startPressAnimation(hovered, true);
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
return children;
|
|
103
|
-
} : children);
|
|
104
|
-
}
|
|
105
|
-
;
|
|
106
|
-
//# sourceMappingURL=LegacyButtonBase.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["React","useCallback","useEffect","Animated","useAnimatedValue","useThrottle","isNotAndroid12","AnimatedPressable","ORIGINAL_OPACITY","DISABLED_OPACITY","ACTIVE_OPACITY","ORIGINAL_SCALE","MINIFIED_SCALE","SCALE_EFFECT_PRESS_IN_DELAY","OPACITY_EFFECT_PRESS_IN_DELAY","startTimingAnimationWithDefaults","value","toValue","timing","duration","useNativeDriver","start","getOpacityByDisabled","disabled","ButtonBase","props","children","disableThrottle","onPress","onPressOut","pressEffect","pressDelay","pressDelayOrNil","style","styleProp","throttleMillis","otherProps","handlePress","periodMillis","callback","opacity","scale","setValue","startScaleAnimation","pressIn","isHover","startOpacityAnimation","startPressAnimation","handlePressIn","handlePressOut","animatedStyle","transform","defaultPressDelay","hovered","undefined"],"sources":["LegacyButtonBase.tsx"],"sourcesContent":["import React, { useCallback, useEffect } 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;\nexport const DISABLED_OPACITY = .3;\nconst ACTIVE_OPACITY = .65;\n\nconst ORIGINAL_SCALE = 1;\nconst MINIFIED_SCALE = .96;\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\nconst getOpacityByDisabled = (disabled: boolean) => disabled ? DISABLED_OPACITY : ORIGINAL_OPACITY;\n\nexport default function ButtonBase(props: ButtonBaseProps) {\n const {\n children,\n disabled = false,\n disableThrottle = false,\n onPress,\n onPressOut,\n pressEffect = 'opacity',\n pressDelay: pressDelayOrNil,\n style: styleProp,\n throttleMillis = 650,\n ...otherProps\n } = props;\n\n const handlePress = useThrottle({\n periodMillis: disableThrottle ? 0 : throttleMillis,\n callback: onPress,\n });\n\n const opacity = useAnimatedValue(getOpacityByDisabled(disabled));\n const scale = useAnimatedValue(ORIGINAL_SCALE);\n\n useEffect(() => {\n opacity.setValue(getOpacityByDisabled(disabled));\n }, [disabled, pressEffect]);\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,EAA6BC,SAA7B,QAA8C,OAA9C;AACA,SAASC,QAAT,QAAyB,cAAzB;AACA,SAASC,gBAAT,EAA2BC,WAA3B,QAA8C,UAA9C;AACA,SAASC,cAAT,QAA+B,UAA/B;AACA,SAASC,iBAAT,QAAkC,aAAlC;AAOA,OAAO,MAAMC,gBAAgB,GAAG,CAAzB;AACP,OAAO,MAAMC,gBAAgB,GAAG,EAAzB;AACP,MAAMC,cAAc,GAAG,GAAvB;AAEA,MAAMC,cAAc,GAAG,CAAvB;AACA,MAAMC,cAAc,GAAG,GAAvB,C,CAEA;AACA;;AACA,MAAMC,2BAA2B,GAAG,GAApC;AACA,MAAMC,6BAA6B,GAAG,CAAtC;;AAKA,MAAMC,gCAAgC,GAAG,CACrCC,KADqC,EAErCC,OAFqC,KAGpC;EACDd,QAAQ,CAACe,MAAT,CAAgBF,KAAhB,EAAuB;IACnBC,OADmB;IAEnBE,QAAQ,EAAE,GAFS;IAGnBC,eAAe,EAAEd;EAHE,CAAvB,EAIGe,KAJH;AAKH,CATD;;AAWA,MAAMC,oBAAoB,GAAIC,QAAD,IAAuBA,QAAQ,GAAGd,gBAAH,GAAsBD,gBAAlF;;AAEA,eAAe,SAASgB,UAAT,CAAoBC,KAApB,EAA4C;EACvD,MAAM;IACFC,QADE;IAEFH,QAAQ,GAAG,KAFT;IAGFI,eAAe,GAAG,KAHhB;IAIFC,OAJE;IAKFC,UALE;IAMFC,WAAW,GAAG,SANZ;IAOFC,UAAU,EAAEC,eAPV;IAQFC,KAAK,EAAEC,SARL;IASFC,cAAc,GAAG,GATf;IAUF,GAAGC;EAVD,IAWFX,KAXJ;EAaA,MAAMY,WAAW,GAAGhC,WAAW,CAAC;IAC5BiC,YAAY,EAAEX,eAAe,GAAG,CAAH,GAAOQ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