@fountain-ui/core 2.0.0-beta.93 → 2.0.0-beta.94
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 +50 -52
- package/build/commonjs/Accordion/Accordion.js.map +1 -1
- package/build/commonjs/Accordion/AccordionProps.js +7 -0
- package/build/commonjs/Accordion/AccordionProps.js.map +1 -1
- package/build/commonjs/Accordion/LegacyAccordion.js +171 -0
- package/build/commonjs/Accordion/LegacyAccordion.js.map +1 -0
- package/build/commonjs/Accordion/LegacyAccordionProps.js +2 -0
- package/build/commonjs/Accordion/LegacyAccordionProps.js.map +1 -0
- package/build/commonjs/Accordion/index.js +2 -2
- package/build/commonjs/Accordion/index.js.map +1 -1
- package/build/commonjs/Accordion/useVariantStyleMap.js +126 -0
- package/build/commonjs/Accordion/useVariantStyleMap.js.map +1 -0
- package/build/commonjs/Badge/Badge.js +16 -20
- package/build/commonjs/Badge/Badge.js.map +1 -1
- package/build/commonjs/Badge/BadgeProps.js +15 -0
- package/build/commonjs/Badge/BadgeProps.js.map +1 -1
- package/build/commonjs/Badge/LegacyBadge.js +61 -0
- package/build/commonjs/Badge/LegacyBadge.js.map +1 -0
- package/build/commonjs/Badge/LegacyBadgeProps.js +2 -0
- package/build/commonjs/Badge/LegacyBadgeProps.js.map +1 -0
- package/build/commonjs/Badge/index.js +2 -2
- package/build/commonjs/Badge/index.js.map +1 -1
- package/build/commonjs/Badge/useVariantStyleMap.js +74 -0
- package/build/commonjs/Badge/useVariantStyleMap.js.map +1 -0
- package/build/commonjs/Button/Button.js +65 -23
- package/build/commonjs/Button/Button.js.map +1 -1
- package/build/commonjs/Button/ButtonProps.js +1 -1
- package/build/commonjs/Button/ButtonProps.js.map +1 -1
- package/build/commonjs/Button/useVariantStyleMap.js +86 -7
- package/build/commonjs/Button/useVariantStyleMap.js.map +1 -1
- package/build/commonjs/ButtonBase/ButtonBase.js +4 -10
- package/build/commonjs/ButtonBase/ButtonBase.js.map +1 -1
- package/build/commonjs/ButtonBase/LegacyButtonBase.js +126 -0
- package/build/commonjs/ButtonBase/LegacyButtonBase.js.map +1 -0
- package/build/commonjs/ButtonBase/index.js +2 -2
- package/build/commonjs/ButtonBase/index.js.map +1 -1
- package/build/commonjs/Chip/Chip.js +24 -62
- package/build/commonjs/Chip/Chip.js.map +1 -1
- package/build/commonjs/Chip/ChipProps.js +9 -0
- package/build/commonjs/Chip/ChipProps.js.map +1 -1
- package/build/commonjs/Chip/LegacyChip.js +98 -0
- package/build/commonjs/Chip/LegacyChip.js.map +1 -0
- package/build/commonjs/Chip/LegacyChipProps.js +2 -0
- package/build/commonjs/Chip/LegacyChipProps.js.map +1 -0
- package/build/commonjs/Chip/index.js +2 -2
- package/build/commonjs/Chip/index.js.map +1 -1
- package/build/commonjs/Chip/useChipStyle.js +113 -0
- package/build/commonjs/Chip/useChipStyle.js.map +1 -0
- package/build/commonjs/Empty/Empty.js +86 -0
- package/build/commonjs/Empty/Empty.js.map +1 -0
- package/build/commonjs/Empty/EmptyProps.js +2 -0
- package/build/commonjs/Empty/EmptyProps.js.map +1 -0
- package/build/commonjs/Empty/index.js +16 -0
- package/build/commonjs/Empty/index.js.map +1 -0
- package/build/commonjs/IconButton/LegacyIconButton.js +3 -2
- package/build/commonjs/IconButton/LegacyIconButton.js.map +1 -1
- package/build/commonjs/IconButton/LegacyIconButtonProps.js.map +1 -1
- package/build/commonjs/Pagination/LegacyPagination.js +145 -0
- package/build/commonjs/Pagination/LegacyPagination.js.map +1 -0
- package/build/commonjs/Pagination/LegacyPaginationProps.js +2 -0
- package/build/commonjs/Pagination/LegacyPaginationProps.js.map +1 -0
- package/build/commonjs/Pagination/NumberPagination.js +71 -0
- package/build/commonjs/Pagination/NumberPagination.js.map +1 -0
- package/build/commonjs/Pagination/Pagination.js +9 -5
- package/build/commonjs/Pagination/Pagination.js.map +1 -1
- package/build/commonjs/Pagination/PaginationProps.js +7 -0
- package/build/commonjs/Pagination/PaginationProps.js.map +1 -1
- package/build/commonjs/Pagination/index.js +2 -2
- package/build/commonjs/Pagination/index.js.map +1 -1
- package/build/commonjs/PaginationItem/LegacyPaginationItem.js +53 -0
- package/build/commonjs/PaginationItem/LegacyPaginationItem.js.map +1 -0
- package/build/commonjs/PaginationItem/PaginationItem.js +2 -2
- package/build/commonjs/PaginationItem/PaginationItem.js.map +1 -1
- package/build/commonjs/Snackbar/LegacySnackbar.js +134 -0
- package/build/commonjs/Snackbar/LegacySnackbar.js.map +1 -0
- package/build/commonjs/Snackbar/LegacySnackbarProps.js +2 -0
- package/build/commonjs/Snackbar/LegacySnackbarProps.js.map +1 -0
- package/build/commonjs/Snackbar/Snackbar.js +7 -5
- package/build/commonjs/Snackbar/Snackbar.js.map +1 -1
- package/build/commonjs/Snackbar/SnackbarProps.js +7 -0
- package/build/commonjs/Snackbar/SnackbarProps.js.map +1 -1
- package/build/commonjs/Snackbar/index.js +2 -2
- package/build/commonjs/Snackbar/index.js.map +1 -1
- package/build/commonjs/SnackbarContent/LegacySnackbarContent.js +105 -0
- package/build/commonjs/SnackbarContent/LegacySnackbarContent.js.map +1 -0
- package/build/commonjs/SnackbarContent/LegacySnackbarContentProps.js +2 -0
- package/build/commonjs/SnackbarContent/LegacySnackbarContentProps.js.map +1 -0
- package/build/commonjs/SnackbarContent/SnackbarContent.js +48 -38
- package/build/commonjs/SnackbarContent/SnackbarContent.js.map +1 -1
- package/build/commonjs/SnackbarContent/SnackbarContentProps.js.map +1 -1
- package/build/commonjs/SnackbarContent/StatusIcon.js +43 -0
- package/build/commonjs/SnackbarContent/StatusIcon.js.map +1 -0
- package/build/commonjs/SnackbarContent/index.js +2 -2
- package/build/commonjs/SnackbarContent/index.js.map +1 -1
- package/build/commonjs/Tab/LegacyTab.js +126 -0
- package/build/commonjs/Tab/LegacyTab.js.map +1 -0
- package/build/commonjs/Tab/LegacyTabProps.js +2 -0
- package/build/commonjs/Tab/LegacyTabProps.js.map +1 -0
- package/build/commonjs/Tab/Tab.js +31 -69
- package/build/commonjs/Tab/Tab.js.map +1 -1
- package/build/commonjs/Tab/TabIndicator.js.map +1 -1
- package/build/commonjs/Tab/TabProps.js +7 -0
- package/build/commonjs/Tab/TabProps.js.map +1 -1
- package/build/commonjs/Tab/index.js +2 -2
- package/build/commonjs/Tab/index.js.map +1 -1
- package/build/commonjs/Tab/useVariantStyleMap.js +80 -0
- package/build/commonjs/Tab/useVariantStyleMap.js.map +1 -0
- package/build/commonjs/TabBase/LegacyTabBase.js +57 -0
- package/build/commonjs/TabBase/LegacyTabBase.js.map +1 -0
- package/build/commonjs/TabBase/TabBase.js +1 -6
- package/build/commonjs/TabBase/TabBase.js.map +1 -1
- package/build/commonjs/TabBase/index.js +2 -2
- package/build/commonjs/TabBase/index.js.map +1 -1
- package/build/commonjs/Tabs/LegacyTabIndicator.js +119 -0
- package/build/commonjs/Tabs/LegacyTabIndicator.js.map +1 -0
- package/build/commonjs/Tabs/LegacyTabIndicatorProps.js +2 -0
- package/build/commonjs/Tabs/LegacyTabIndicatorProps.js.map +1 -0
- package/build/commonjs/Tabs/LegacyTabs.js +205 -0
- package/build/commonjs/Tabs/LegacyTabs.js.map +1 -0
- package/build/commonjs/Tabs/LegacyTabsProps.js +2 -0
- package/build/commonjs/Tabs/LegacyTabsProps.js.map +1 -0
- package/build/commonjs/Tabs/TabIndicator.js +5 -9
- package/build/commonjs/Tabs/TabIndicator.js.map +1 -1
- package/build/commonjs/Tabs/TabIndicatorProps.js.map +1 -1
- package/build/commonjs/Tabs/Tabs.js +10 -9
- package/build/commonjs/Tabs/Tabs.js.map +1 -1
- package/build/commonjs/Tabs/TabsProps.js +7 -0
- package/build/commonjs/Tabs/TabsProps.js.map +1 -1
- package/build/commonjs/Tabs/index.js +2 -2
- package/build/commonjs/Tabs/index.js.map +1 -1
- package/build/commonjs/TextField/LegacyTextField.js +195 -0
- package/build/commonjs/TextField/LegacyTextField.js.map +1 -0
- package/build/commonjs/TextField/LegacyTextFieldProps.js +2 -0
- package/build/commonjs/TextField/LegacyTextFieldProps.js.map +1 -0
- package/build/commonjs/TextField/OutlinedTextField.js.map +1 -1
- package/build/commonjs/TextField/TextField.js +105 -147
- package/build/commonjs/TextField/TextField.js.map +1 -1
- package/build/commonjs/TextField/TextFieldProps.js +9 -0
- package/build/commonjs/TextField/TextFieldProps.js.map +1 -1
- package/build/commonjs/TextField/index.js +2 -2
- package/build/commonjs/TextField/index.js.map +1 -1
- package/build/commonjs/TextField/useVariantStyleMap.js +103 -0
- package/build/commonjs/TextField/useVariantStyleMap.js.map +1 -0
- package/build/commonjs/Tooltip/Beaks/Beak.js +69 -0
- package/build/commonjs/Tooltip/Beaks/Beak.js.map +1 -0
- package/build/commonjs/Tooltip/Beaks/BeakProps.js +2 -0
- package/build/commonjs/Tooltip/Beaks/BeakProps.js.map +1 -0
- package/build/commonjs/Tooltip/Beaks/HorizontalLargeBeak.js +25 -0
- package/build/commonjs/Tooltip/Beaks/HorizontalLargeBeak.js.map +1 -0
- package/build/commonjs/Tooltip/Beaks/HorizontalSmallBeak.js +25 -0
- package/build/commonjs/Tooltip/Beaks/HorizontalSmallBeak.js.map +1 -0
- package/build/commonjs/Tooltip/Beaks/VerticalLargeBeak.js +25 -0
- package/build/commonjs/Tooltip/Beaks/VerticalLargeBeak.js.map +1 -0
- package/build/commonjs/Tooltip/Beaks/VerticalSmallBeak.js +25 -0
- package/build/commonjs/Tooltip/Beaks/VerticalSmallBeak.js.map +1 -0
- package/build/commonjs/Tooltip/Beaks/index.js +16 -0
- package/build/commonjs/Tooltip/Beaks/index.js.map +1 -0
- package/build/commonjs/Tooltip/LegacyTooltip.js +147 -0
- package/build/commonjs/Tooltip/LegacyTooltip.js.map +1 -0
- package/build/commonjs/Tooltip/LegacyTooltipProps.js +2 -0
- package/build/commonjs/Tooltip/LegacyTooltipProps.js.map +1 -0
- package/build/commonjs/Tooltip/Tooltip.js +101 -52
- package/build/commonjs/Tooltip/Tooltip.js.map +1 -1
- package/build/commonjs/Tooltip/TooltipProps.js +11 -0
- package/build/commonjs/Tooltip/TooltipProps.js.map +1 -1
- package/build/commonjs/Tooltip/index.js +2 -2
- package/build/commonjs/Tooltip/index.js.map +1 -1
- package/build/commonjs/hooks/useCollapsibleAppBar.js +2 -3
- package/build/commonjs/hooks/useCollapsibleAppBar.js.map +1 -1
- package/build/commonjs/index.js +21 -0
- package/build/commonjs/index.js.map +1 -1
- package/build/commonjs/internal/icons/CheckCircle.js +27 -0
- package/build/commonjs/internal/icons/CheckCircle.js.map +1 -0
- package/build/commonjs/internal/icons/Clear.js +27 -0
- package/build/commonjs/internal/icons/Clear.js.map +1 -0
- package/build/commonjs/internal/icons/EyeOff.js +31 -0
- package/build/commonjs/internal/icons/EyeOff.js.map +1 -0
- package/build/commonjs/internal/icons/EyeOn.js +27 -0
- package/build/commonjs/internal/icons/EyeOn.js.map +1 -0
- package/build/commonjs/internal/icons/InfoCircle.js +27 -0
- package/build/commonjs/internal/icons/InfoCircle.js.map +1 -0
- package/build/commonjs/internal/icons/LoadingSpinner/LoadingSpinnerProps.js +2 -0
- package/build/commonjs/internal/icons/LoadingSpinner/LoadingSpinnerProps.js.map +1 -0
- package/build/commonjs/internal/icons/LoadingSpinner/index.js +36 -0
- package/build/commonjs/internal/icons/LoadingSpinner/index.js.map +1 -0
- package/build/commonjs/internal/icons/LoadingSpinner/index.native.js +36 -0
- package/build/commonjs/internal/icons/LoadingSpinner/index.native.js.map +1 -0
- package/build/commonjs/internal/icons/LoadingSpinner/loadingSpinnerGray.json +1 -0
- package/build/commonjs/internal/icons/LoadingSpinner/loadingSpinnerWhite.json +1 -0
- package/build/commonjs/internal/icons/LoadingSpinner/utils.js +25 -0
- package/build/commonjs/internal/icons/LoadingSpinner/utils.js.map +1 -0
- package/build/commonjs/internal/icons/Search.js +23 -0
- package/build/commonjs/internal/icons/Search.js.map +1 -0
- package/build/commonjs/internal/icons/index.js +56 -0
- package/build/commonjs/internal/icons/index.js.map +1 -1
- package/build/module/Accordion/Accordion.js +47 -50
- package/build/module/Accordion/Accordion.js.map +1 -1
- package/build/module/Accordion/AccordionProps.js +1 -1
- package/build/module/Accordion/AccordionProps.js.map +1 -1
- package/build/module/Accordion/LegacyAccordion.js +148 -0
- package/build/module/Accordion/LegacyAccordion.js.map +1 -0
- package/build/module/Accordion/LegacyAccordionProps.js +2 -0
- package/build/module/Accordion/LegacyAccordionProps.js.map +1 -0
- package/build/module/Accordion/index.js +1 -1
- package/build/module/Accordion/index.js.map +1 -1
- package/build/module/Accordion/useVariantStyleMap.js +116 -0
- package/build/module/Accordion/useVariantStyleMap.js.map +1 -0
- package/build/module/Badge/Badge.js +17 -23
- package/build/module/Badge/Badge.js.map +1 -1
- package/build/module/Badge/BadgeProps.js +5 -1
- package/build/module/Badge/BadgeProps.js.map +1 -1
- package/build/module/Badge/LegacyBadge.js +48 -0
- package/build/module/Badge/LegacyBadge.js.map +1 -0
- package/build/module/Badge/LegacyBadgeProps.js +2 -0
- package/build/module/Badge/LegacyBadgeProps.js.map +1 -0
- package/build/module/Badge/index.js +1 -1
- package/build/module/Badge/index.js.map +1 -1
- package/build/module/Badge/useVariantStyleMap.js +64 -0
- package/build/module/Badge/useVariantStyleMap.js.map +1 -0
- package/build/module/Button/Button.js +59 -19
- package/build/module/Button/Button.js.map +1 -1
- package/build/module/Button/ButtonProps.js +1 -1
- package/build/module/Button/ButtonProps.js.map +1 -1
- package/build/module/Button/useVariantStyleMap.js +86 -7
- package/build/module/Button/useVariantStyleMap.js.map +1 -1
- package/build/module/ButtonBase/ButtonBase.js +4 -9
- package/build/module/ButtonBase/ButtonBase.js.map +1 -1
- package/build/module/ButtonBase/LegacyButtonBase.js +106 -0
- package/build/module/ButtonBase/LegacyButtonBase.js.map +1 -0
- package/build/module/ButtonBase/index.js +1 -1
- package/build/module/ButtonBase/index.js.map +1 -1
- package/build/module/Chip/Chip.js +25 -64
- package/build/module/Chip/Chip.js.map +1 -1
- package/build/module/Chip/ChipProps.js +2 -1
- package/build/module/Chip/ChipProps.js.map +1 -1
- package/build/module/Chip/LegacyChip.js +84 -0
- package/build/module/Chip/LegacyChip.js.map +1 -0
- package/build/module/Chip/LegacyChipProps.js +2 -0
- package/build/module/Chip/LegacyChipProps.js.map +1 -0
- package/build/module/Chip/index.js +1 -1
- package/build/module/Chip/index.js.map +1 -1
- package/build/module/Chip/useChipStyle.js +104 -0
- package/build/module/Chip/useChipStyle.js.map +1 -0
- package/build/module/Empty/Empty.js +71 -0
- package/build/module/Empty/Empty.js.map +1 -0
- package/build/module/Empty/EmptyProps.js +2 -0
- package/build/module/Empty/EmptyProps.js.map +1 -0
- package/build/module/Empty/index.js +2 -0
- package/build/module/Empty/index.js.map +1 -0
- package/build/module/IconButton/LegacyIconButton.js +3 -2
- package/build/module/IconButton/LegacyIconButton.js.map +1 -1
- package/build/module/IconButton/LegacyIconButtonProps.js.map +1 -1
- package/build/module/Pagination/LegacyPagination.js +129 -0
- package/build/module/Pagination/LegacyPagination.js.map +1 -0
- package/build/module/Pagination/LegacyPaginationProps.js +2 -0
- package/build/module/Pagination/LegacyPaginationProps.js.map +1 -0
- package/build/module/Pagination/NumberPagination.js +57 -0
- package/build/module/Pagination/NumberPagination.js.map +1 -0
- package/build/module/Pagination/Pagination.js +8 -5
- package/build/module/Pagination/Pagination.js.map +1 -1
- package/build/module/Pagination/PaginationProps.js +1 -1
- 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/LegacyPaginationItem.js +40 -0
- package/build/module/PaginationItem/LegacyPaginationItem.js.map +1 -0
- package/build/module/PaginationItem/PaginationItem.js +2 -2
- package/build/module/PaginationItem/PaginationItem.js.map +1 -1
- package/build/module/Snackbar/LegacySnackbar.js +107 -0
- package/build/module/Snackbar/LegacySnackbar.js.map +1 -0
- package/build/module/Snackbar/LegacySnackbarProps.js +2 -0
- package/build/module/Snackbar/LegacySnackbarProps.js.map +1 -0
- package/build/module/Snackbar/Snackbar.js +7 -5
- package/build/module/Snackbar/Snackbar.js.map +1 -1
- package/build/module/Snackbar/SnackbarProps.js +1 -1
- package/build/module/Snackbar/SnackbarProps.js.map +1 -1
- package/build/module/Snackbar/index.js +1 -1
- package/build/module/Snackbar/index.js.map +1 -1
- package/build/module/SnackbarContent/LegacySnackbarContent.js +84 -0
- package/build/module/SnackbarContent/LegacySnackbarContent.js.map +1 -0
- package/build/module/SnackbarContent/LegacySnackbarContentProps.js +2 -0
- package/build/module/SnackbarContent/LegacySnackbarContentProps.js.map +1 -0
- package/build/module/SnackbarContent/SnackbarContent.js +48 -35
- package/build/module/SnackbarContent/SnackbarContent.js.map +1 -1
- package/build/module/SnackbarContent/SnackbarContentProps.js.map +1 -1
- package/build/module/SnackbarContent/StatusIcon.js +31 -0
- package/build/module/SnackbarContent/StatusIcon.js.map +1 -0
- package/build/module/SnackbarContent/index.js +1 -1
- package/build/module/SnackbarContent/index.js.map +1 -1
- package/build/module/Tab/LegacyTab.js +105 -0
- package/build/module/Tab/LegacyTab.js.map +1 -0
- package/build/module/Tab/LegacyTabProps.js +2 -0
- package/build/module/Tab/LegacyTabProps.js.map +1 -0
- package/build/module/Tab/Tab.js +30 -66
- package/build/module/Tab/Tab.js.map +1 -1
- package/build/module/Tab/TabIndicator.js.map +1 -1
- package/build/module/Tab/TabProps.js +1 -1
- package/build/module/Tab/TabProps.js.map +1 -1
- package/build/module/Tab/index.js +1 -1
- package/build/module/Tab/index.js.map +1 -1
- package/build/module/Tab/useVariantStyleMap.js +70 -0
- package/build/module/Tab/useVariantStyleMap.js.map +1 -0
- package/build/module/TabBase/LegacyTabBase.js +44 -0
- package/build/module/TabBase/LegacyTabBase.js.map +1 -0
- package/build/module/TabBase/TabBase.js +1 -5
- package/build/module/TabBase/TabBase.js.map +1 -1
- package/build/module/TabBase/index.js +1 -1
- package/build/module/TabBase/index.js.map +1 -1
- package/build/module/Tabs/LegacyTabIndicator.js +98 -0
- package/build/module/Tabs/LegacyTabIndicator.js.map +1 -0
- package/build/module/Tabs/LegacyTabIndicatorProps.js +2 -0
- package/build/module/Tabs/LegacyTabIndicatorProps.js.map +1 -0
- package/build/module/Tabs/LegacyTabs.js +180 -0
- package/build/module/Tabs/LegacyTabs.js.map +1 -0
- package/build/module/Tabs/LegacyTabsProps.js +2 -0
- package/build/module/Tabs/LegacyTabsProps.js.map +1 -0
- package/build/module/Tabs/TabIndicator.js +5 -9
- package/build/module/Tabs/TabIndicator.js.map +1 -1
- package/build/module/Tabs/TabIndicatorProps.js.map +1 -1
- package/build/module/Tabs/Tabs.js +10 -9
- package/build/module/Tabs/Tabs.js.map +1 -1
- package/build/module/Tabs/TabsProps.js +1 -1
- package/build/module/Tabs/TabsProps.js.map +1 -1
- package/build/module/Tabs/index.js +1 -1
- package/build/module/Tabs/index.js.map +1 -1
- package/build/module/TextField/LegacyTextField.js +169 -0
- package/build/module/TextField/LegacyTextField.js.map +1 -0
- package/build/module/TextField/LegacyTextFieldProps.js +2 -0
- package/build/module/TextField/LegacyTextFieldProps.js.map +1 -0
- package/build/module/TextField/OutlinedTextField.js.map +1 -1
- package/build/module/TextField/TextField.js +104 -144
- package/build/module/TextField/TextField.js.map +1 -1
- package/build/module/TextField/TextFieldProps.js +2 -1
- package/build/module/TextField/TextFieldProps.js.map +1 -1
- package/build/module/TextField/index.js +1 -1
- package/build/module/TextField/index.js.map +1 -1
- package/build/module/TextField/useVariantStyleMap.js +94 -0
- package/build/module/TextField/useVariantStyleMap.js.map +1 -0
- package/build/module/Tooltip/Beaks/Beak.js +56 -0
- package/build/module/Tooltip/Beaks/Beak.js.map +1 -0
- package/build/module/Tooltip/Beaks/BeakProps.js +2 -0
- package/build/module/Tooltip/Beaks/BeakProps.js.map +1 -0
- package/build/module/Tooltip/Beaks/HorizontalLargeBeak.js +14 -0
- package/build/module/Tooltip/Beaks/HorizontalLargeBeak.js.map +1 -0
- package/build/module/Tooltip/Beaks/HorizontalSmallBeak.js +14 -0
- package/build/module/Tooltip/Beaks/HorizontalSmallBeak.js.map +1 -0
- package/build/module/Tooltip/Beaks/VerticalLargeBeak.js +14 -0
- package/build/module/Tooltip/Beaks/VerticalLargeBeak.js.map +1 -0
- package/build/module/Tooltip/Beaks/VerticalSmallBeak.js +14 -0
- package/build/module/Tooltip/Beaks/VerticalSmallBeak.js.map +1 -0
- package/build/module/Tooltip/Beaks/index.js +2 -0
- package/build/module/Tooltip/Beaks/index.js.map +1 -0
- package/build/module/Tooltip/LegacyTooltip.js +121 -0
- package/build/module/Tooltip/LegacyTooltip.js.map +1 -0
- package/build/module/Tooltip/LegacyTooltipProps.js +2 -0
- package/build/module/Tooltip/LegacyTooltipProps.js.map +1 -0
- package/build/module/Tooltip/Tooltip.js +97 -46
- package/build/module/Tooltip/Tooltip.js.map +1 -1
- package/build/module/Tooltip/TooltipProps.js +3 -1
- package/build/module/Tooltip/TooltipProps.js.map +1 -1
- package/build/module/Tooltip/index.js +1 -1
- package/build/module/Tooltip/index.js.map +1 -1
- package/build/module/hooks/useCollapsibleAppBar.js +2 -3
- package/build/module/hooks/useCollapsibleAppBar.js.map +1 -1
- package/build/module/index.js +2 -0
- package/build/module/index.js.map +1 -1
- package/build/module/internal/icons/CheckCircle.js +13 -0
- package/build/module/internal/icons/CheckCircle.js.map +1 -0
- package/build/module/internal/icons/Clear.js +13 -0
- package/build/module/internal/icons/Clear.js.map +1 -0
- package/build/module/internal/icons/EyeOff.js +17 -0
- package/build/module/internal/icons/EyeOff.js.map +1 -0
- package/build/module/internal/icons/EyeOn.js +13 -0
- package/build/module/internal/icons/EyeOn.js.map +1 -0
- package/build/module/internal/icons/InfoCircle.js +13 -0
- package/build/module/internal/icons/InfoCircle.js.map +1 -0
- package/build/module/internal/icons/LoadingSpinner/LoadingSpinnerProps.js +2 -0
- package/build/module/internal/icons/LoadingSpinner/LoadingSpinnerProps.js.map +1 -0
- package/build/module/internal/icons/LoadingSpinner/index.js +23 -0
- package/build/module/internal/icons/LoadingSpinner/index.js.map +1 -0
- package/build/module/internal/icons/LoadingSpinner/index.native.js +23 -0
- package/build/module/internal/icons/LoadingSpinner/index.native.js.map +1 -0
- package/build/module/internal/icons/LoadingSpinner/loadingSpinnerGray.json +1 -0
- package/build/module/internal/icons/LoadingSpinner/loadingSpinnerWhite.json +1 -0
- package/build/module/internal/icons/LoadingSpinner/utils.js +12 -0
- package/build/module/internal/icons/LoadingSpinner/utils.js.map +1 -0
- package/build/module/internal/icons/Search.js +9 -0
- package/build/module/internal/icons/Search.js.map +1 -0
- package/build/module/internal/icons/index.js +7 -0
- package/build/module/internal/icons/index.js.map +1 -1
- package/build/typescript/Accordion/Accordion.d.ts +1 -1
- package/build/typescript/Accordion/AccordionProps.d.ts +8 -1
- package/build/typescript/Accordion/LegacyAccordion.d.ts +3 -0
- package/build/typescript/Accordion/LegacyAccordionProps.d.ts +28 -0
- package/build/typescript/Accordion/index.d.ts +2 -2
- package/build/typescript/Accordion/useVariantStyleMap.d.ts +13 -0
- package/build/typescript/Badge/Badge.d.ts +1 -1
- package/build/typescript/Badge/BadgeProps.d.ts +28 -2
- package/build/typescript/Badge/LegacyBadge.d.ts +3 -0
- package/build/typescript/Badge/LegacyBadgeProps.d.ts +34 -0
- package/build/typescript/Badge/index.d.ts +2 -2
- package/build/typescript/Badge/useVariantStyleMap.d.ts +9 -0
- package/build/typescript/Button/ButtonProps.d.ts +6 -1
- package/build/typescript/Button/useVariantStyleMap.d.ts +2 -2
- package/build/typescript/ButtonBase/ButtonBase.d.ts +0 -1
- package/build/typescript/ButtonBase/LegacyButtonBase.d.ts +5 -0
- package/build/typescript/ButtonBase/index.d.ts +1 -1
- package/build/typescript/Chip/ChipProps.d.ts +13 -6
- package/build/typescript/Chip/LegacyChip.d.ts +3 -0
- package/build/typescript/Chip/LegacyChipProps.d.ts +28 -0
- package/build/typescript/Chip/index.d.ts +2 -2
- package/build/typescript/Chip/useChipStyle.d.ts +11 -0
- package/build/typescript/Empty/Empty.d.ts +3 -0
- package/build/typescript/Empty/EmptyProps.d.ts +27 -0
- package/build/typescript/Empty/index.d.ts +2 -0
- package/build/typescript/IconButton/LegacyIconButtonProps.d.ts +4 -0
- package/build/typescript/Pagination/LegacyPagination.d.ts +3 -0
- package/build/typescript/Pagination/LegacyPaginationProps.d.ts +71 -0
- package/build/typescript/Pagination/NumberPagination.d.ts +8 -0
- package/build/typescript/Pagination/PaginationProps.d.ts +7 -0
- package/build/typescript/Pagination/index.d.ts +2 -2
- package/build/typescript/PaginationItem/LegacyPaginationItem.d.ts +5 -0
- package/build/typescript/Snackbar/LegacySnackbar.d.ts +3 -0
- package/build/typescript/Snackbar/LegacySnackbarProps.d.ts +51 -0
- package/build/typescript/Snackbar/SnackbarProps.d.ts +9 -2
- package/build/typescript/Snackbar/index.d.ts +2 -2
- package/build/typescript/SnackbarContent/LegacySnackbarContent.d.ts +3 -0
- package/build/typescript/SnackbarContent/LegacySnackbarContentProps.d.ts +26 -0
- package/build/typescript/SnackbarContent/SnackbarContentProps.d.ts +5 -24
- package/build/typescript/SnackbarContent/StatusIcon.d.ts +7 -0
- package/build/typescript/SnackbarContent/index.d.ts +2 -2
- package/build/typescript/Tab/LegacyTab.d.ts +3 -0
- package/build/typescript/Tab/LegacyTabProps.d.ts +58 -0
- package/build/typescript/Tab/TabIndicator.d.ts +2 -2
- package/build/typescript/Tab/TabProps.d.ts +3 -16
- package/build/typescript/Tab/index.d.ts +2 -2
- package/build/typescript/Tab/useVariantStyleMap.d.ts +10 -0
- package/build/typescript/TabBase/LegacyTabBase.d.ts +3 -0
- package/build/typescript/TabBase/index.d.ts +1 -1
- package/build/typescript/Tabs/LegacyTabIndicator.d.ts +3 -0
- package/build/typescript/Tabs/LegacyTabIndicatorProps.d.ts +28 -0
- package/build/typescript/Tabs/LegacyTabs.d.ts +5 -0
- package/build/typescript/Tabs/LegacyTabsProps.d.ts +74 -0
- package/build/typescript/Tabs/TabIndicatorProps.d.ts +0 -10
- package/build/typescript/Tabs/Tabs.d.ts +1 -1
- package/build/typescript/Tabs/TabsProps.d.ts +10 -10
- package/build/typescript/Tabs/index.d.ts +2 -2
- package/build/typescript/TextField/LegacyTextField.d.ts +5 -0
- package/build/typescript/TextField/LegacyTextFieldProps.d.ts +67 -0
- package/build/typescript/TextField/OutlinedTextField.d.ts +1 -1
- package/build/typescript/TextField/TextField.d.ts +1 -1
- package/build/typescript/TextField/TextFieldProps.d.ts +25 -51
- package/build/typescript/TextField/index.d.ts +2 -2
- package/build/typescript/TextField/useVariantStyleMap.d.ts +9 -0
- package/build/typescript/Tooltip/Beaks/Beak.d.ts +3 -0
- package/build/typescript/Tooltip/Beaks/BeakProps.d.ts +4 -0
- package/build/typescript/Tooltip/Beaks/HorizontalLargeBeak.d.ts +3 -0
- package/build/typescript/Tooltip/Beaks/HorizontalSmallBeak.d.ts +3 -0
- package/build/typescript/Tooltip/Beaks/VerticalLargeBeak.d.ts +3 -0
- package/build/typescript/Tooltip/Beaks/VerticalSmallBeak.d.ts +3 -0
- package/build/typescript/Tooltip/Beaks/index.d.ts +2 -0
- package/build/typescript/Tooltip/LegacyTooltip.d.ts +3 -0
- package/build/typescript/Tooltip/LegacyTooltipProps.d.ts +72 -0
- package/build/typescript/Tooltip/TooltipProps.d.ts +19 -9
- package/build/typescript/Tooltip/index.d.ts +2 -2
- package/build/typescript/index.d.ts +2 -0
- package/build/typescript/internal/icons/CheckCircle.d.ts +8 -0
- package/build/typescript/internal/icons/Clear.d.ts +8 -0
- package/build/typescript/internal/icons/EyeOff.d.ts +8 -0
- package/build/typescript/internal/icons/EyeOn.d.ts +8 -0
- package/build/typescript/internal/icons/InfoCircle.d.ts +8 -0
- package/build/typescript/internal/icons/LoadingSpinner/LoadingSpinnerProps.d.ts +9 -0
- package/build/typescript/internal/icons/LoadingSpinner/index.d.ts +3 -0
- package/build/typescript/internal/icons/LoadingSpinner/index.native.d.ts +3 -0
- package/build/typescript/internal/icons/LoadingSpinner/utils.d.ts +3 -0
- package/build/typescript/internal/icons/Search.d.ts +8 -0
- package/build/typescript/internal/icons/index.d.ts +7 -0
- package/package.json +2 -2
- package/src/Accordion/Accordion.tsx +75 -72
- package/src/Accordion/AccordionProps.ts +11 -2
- package/src/Accordion/LegacyAccordion.tsx +188 -0
- package/src/Accordion/LegacyAccordionProps.ts +34 -0
- package/src/Accordion/index.ts +2 -2
- package/src/Accordion/useVariantStyleMap.ts +127 -0
- package/src/Badge/Badge.tsx +23 -29
- package/src/Badge/BadgeProps.ts +35 -2
- package/src/Badge/LegacyBadge.tsx +66 -0
- package/src/Badge/LegacyBadgeProps.ts +40 -0
- package/src/Badge/index.ts +2 -2
- package/src/Badge/useVariantStyleMap.ts +73 -0
- package/src/Button/Button.tsx +72 -22
- package/src/Button/ButtonProps.ts +8 -0
- package/src/Button/useVariantStyleMap.ts +88 -9
- package/src/ButtonBase/ButtonBase.tsx +4 -10
- package/src/ButtonBase/LegacyButtonBase.tsx +135 -0
- package/src/ButtonBase/index.ts +2 -2
- package/src/Chip/Chip.tsx +26 -82
- package/src/Chip/ChipProps.ts +16 -7
- package/src/Chip/LegacyChip.tsx +116 -0
- package/src/Chip/LegacyChipProps.ts +33 -0
- package/src/Chip/index.ts +2 -2
- package/src/Chip/useChipStyle.ts +123 -0
- package/src/Empty/Empty.tsx +108 -0
- package/src/Empty/EmptyProps.ts +31 -0
- package/src/Empty/index.ts +2 -0
- package/src/IconButton/LegacyIconButton.tsx +3 -2
- package/src/IconButton/LegacyIconButtonProps.ts +5 -0
- package/src/Pagination/LegacyPagination.tsx +168 -0
- package/src/Pagination/LegacyPaginationProps.ts +85 -0
- package/src/Pagination/NumberPagination.tsx +78 -0
- package/src/Pagination/Pagination.tsx +15 -5
- package/src/Pagination/PaginationProps.ts +9 -0
- package/src/Pagination/index.ts +2 -2
- package/src/PaginationItem/LegacyPaginationItem.tsx +52 -0
- package/src/PaginationItem/PaginationItem.tsx +2 -2
- package/src/Snackbar/LegacySnackbar.tsx +130 -0
- package/src/Snackbar/LegacySnackbarProps.ts +61 -0
- package/src/Snackbar/Snackbar.tsx +7 -5
- package/src/Snackbar/SnackbarProps.ts +11 -3
- package/src/Snackbar/index.ts +2 -2
- package/src/SnackbarContent/LegacySnackbarContent.tsx +129 -0
- package/src/SnackbarContent/LegacySnackbarContentProps.ts +30 -0
- package/src/SnackbarContent/SnackbarContent.tsx +53 -48
- package/src/SnackbarContent/SnackbarContentProps.ts +10 -27
- package/src/SnackbarContent/StatusIcon.tsx +37 -0
- package/src/SnackbarContent/index.ts +2 -2
- package/src/Tab/LegacyTab.tsx +141 -0
- package/src/Tab/LegacyTabProps.ts +68 -0
- package/src/Tab/Tab.tsx +36 -79
- package/src/Tab/TabIndicator.tsx +5 -2
- package/src/Tab/TabProps.ts +3 -18
- package/src/Tab/index.ts +2 -2
- package/src/Tab/useVariantStyleMap.ts +86 -0
- package/src/TabBase/LegacyTabBase.tsx +55 -0
- package/src/TabBase/TabBase.tsx +0 -5
- package/src/TabBase/index.ts +2 -2
- package/src/Tabs/LegacyTabIndicator.tsx +111 -0
- package/src/Tabs/LegacyTabIndicatorProps.ts +33 -0
- package/src/Tabs/LegacyTabs.tsx +225 -0
- package/src/Tabs/LegacyTabsProps.ts +87 -0
- package/src/Tabs/TabIndicator.tsx +6 -12
- package/src/Tabs/TabIndicatorProps.ts +0 -13
- package/src/Tabs/Tabs.tsx +12 -8
- package/src/Tabs/TabsProps.ts +12 -11
- package/src/Tabs/index.ts +2 -2
- package/src/TextField/LegacyTextField.tsx +168 -0
- package/src/TextField/LegacyTextFieldProps.ts +80 -0
- package/src/TextField/OutlinedTextField.tsx +1 -1
- package/src/TextField/TextField.tsx +155 -137
- package/src/TextField/TextFieldProps.ts +27 -57
- package/src/TextField/index.tsx +2 -2
- package/src/TextField/useVariantStyleMap.ts +100 -0
- package/src/Tooltip/Beaks/Beak.tsx +53 -0
- package/src/Tooltip/Beaks/BeakProps.ts +4 -0
- package/src/Tooltip/Beaks/HorizontalLargeBeak.tsx +18 -0
- package/src/Tooltip/Beaks/HorizontalSmallBeak.tsx +18 -0
- package/src/Tooltip/Beaks/VerticalLargeBeak.tsx +18 -0
- package/src/Tooltip/Beaks/VerticalSmallBeak.tsx +18 -0
- package/src/Tooltip/Beaks/index.ts +2 -0
- package/src/Tooltip/LegacyTooltip.tsx +167 -0
- package/src/Tooltip/LegacyTooltipProps.ts +86 -0
- package/src/Tooltip/Tooltip.tsx +114 -66
- package/src/Tooltip/TooltipProps.ts +28 -10
- package/src/Tooltip/index.ts +2 -2
- package/src/hooks/useCollapsibleAppBar.ts +2 -3
- package/src/index.ts +3 -0
- package/src/internal/icons/CheckCircle.tsx +20 -0
- package/src/internal/icons/Clear.tsx +20 -0
- package/src/internal/icons/EyeOff.tsx +25 -0
- package/src/internal/icons/EyeOn.tsx +20 -0
- package/src/internal/icons/InfoCircle.tsx +21 -0
- package/src/internal/icons/LoadingSpinner/LoadingSpinnerProps.ts +11 -0
- package/src/internal/icons/LoadingSpinner/index.native.tsx +31 -0
- package/src/internal/icons/LoadingSpinner/index.tsx +31 -0
- package/src/internal/icons/LoadingSpinner/loadingSpinnerGray.json +1 -0
- package/src/internal/icons/LoadingSpinner/loadingSpinnerWhite.json +1 -0
- package/src/internal/icons/LoadingSpinner/utils.ts +14 -0
- package/src/internal/icons/Search.tsx +15 -0
- package/src/internal/icons/index.ts +7 -0
|
@@ -20,39 +20,56 @@ function useVariantStyleMap(variant, color) {
|
|
|
20
20
|
const variantStyleMap = {
|
|
21
21
|
solid: {
|
|
22
22
|
accent: {
|
|
23
|
-
|
|
23
|
+
container: {
|
|
24
|
+
backgroundColor: palette.fill.accent
|
|
25
|
+
},
|
|
24
26
|
labelColor: _styles.commonColors.static.strongInverse,
|
|
25
27
|
iconColor: _styles.commonColors.static.strongInverse
|
|
26
28
|
},
|
|
27
29
|
primary: {
|
|
28
|
-
|
|
30
|
+
container: {
|
|
31
|
+
backgroundColor: palette.fill.base
|
|
32
|
+
},
|
|
29
33
|
labelColor: palette.text.strongInverse,
|
|
30
34
|
iconColor: palette.icon.strongInverse
|
|
31
35
|
},
|
|
32
36
|
danger: {
|
|
33
|
-
|
|
37
|
+
container: {
|
|
38
|
+
backgroundColor: palette.status.danger
|
|
39
|
+
},
|
|
34
40
|
labelColor: _styles.commonColors.static.strongInverse,
|
|
35
41
|
iconColor: _styles.commonColors.static.strongInverse
|
|
36
42
|
},
|
|
37
43
|
disabled: {
|
|
38
|
-
|
|
44
|
+
container: {
|
|
45
|
+
backgroundColor: palette.status.disabled
|
|
46
|
+
},
|
|
39
47
|
labelColor: palette.status.onDisabled,
|
|
40
48
|
iconColor: palette.status.onDisabled
|
|
41
49
|
}
|
|
42
50
|
},
|
|
43
51
|
outlined: {
|
|
44
52
|
accent: {
|
|
45
|
-
|
|
53
|
+
container: {
|
|
54
|
+
borderColor: palette.border.accent,
|
|
55
|
+
borderWidth: 1
|
|
56
|
+
},
|
|
46
57
|
labelColor: palette.text.accent,
|
|
47
58
|
iconColor: palette.icon.accent
|
|
48
59
|
},
|
|
49
60
|
primary: {
|
|
50
|
-
|
|
61
|
+
container: {
|
|
62
|
+
borderColor: palette.border.base,
|
|
63
|
+
borderWidth: 1
|
|
64
|
+
},
|
|
51
65
|
labelColor: palette.text.base,
|
|
52
66
|
iconColor: palette.icon.base
|
|
53
67
|
},
|
|
54
68
|
disabled: {
|
|
55
|
-
|
|
69
|
+
container: {
|
|
70
|
+
borderColor: palette.status.disabled,
|
|
71
|
+
borderWidth: 1
|
|
72
|
+
},
|
|
56
73
|
labelColor: palette.status.disabledLabel,
|
|
57
74
|
iconColor: palette.status.disabledLabel
|
|
58
75
|
}
|
|
@@ -78,6 +95,68 @@ function useVariantStyleMap(variant, color) {
|
|
|
78
95
|
labelColor: palette.status.disabledLabel,
|
|
79
96
|
iconColor: palette.status.disabledLabel
|
|
80
97
|
}
|
|
98
|
+
},
|
|
99
|
+
capsuleSolid: {
|
|
100
|
+
accent: {
|
|
101
|
+
container: {
|
|
102
|
+
backgroundColor: theme.palette.fill.accent,
|
|
103
|
+
borderRadius: theme.shape.radius.full
|
|
104
|
+
},
|
|
105
|
+
labelColor: _styles.commonColors.static.strongInverse,
|
|
106
|
+
iconColor: _styles.commonColors.static.strongInverse
|
|
107
|
+
},
|
|
108
|
+
primary: {
|
|
109
|
+
container: {
|
|
110
|
+
backgroundColor: theme.palette.fill.base,
|
|
111
|
+
borderRadius: theme.shape.radius.full
|
|
112
|
+
},
|
|
113
|
+
labelColor: palette.text.strongInverse,
|
|
114
|
+
iconColor: palette.icon.strongInverse
|
|
115
|
+
},
|
|
116
|
+
danger: {
|
|
117
|
+
container: {
|
|
118
|
+
backgroundColor: theme.palette.status.danger,
|
|
119
|
+
borderRadius: theme.shape.radius.full
|
|
120
|
+
},
|
|
121
|
+
labelColor: _styles.commonColors.static.strongInverse,
|
|
122
|
+
iconColor: _styles.commonColors.static.strongInverse
|
|
123
|
+
},
|
|
124
|
+
secondary: {
|
|
125
|
+
container: {
|
|
126
|
+
backgroundColor: _styles.commonColors.static.strongInverse,
|
|
127
|
+
borderRadius: theme.shape.radius.full
|
|
128
|
+
},
|
|
129
|
+
labelColor: theme.palette.text.strong,
|
|
130
|
+
iconColor: theme.palette.icon.strong
|
|
131
|
+
},
|
|
132
|
+
disabled: {
|
|
133
|
+
container: {
|
|
134
|
+
backgroundColor: theme.palette.status.disabled,
|
|
135
|
+
borderRadius: theme.shape.radius.full
|
|
136
|
+
},
|
|
137
|
+
labelColor: theme.palette.status.onDisabled,
|
|
138
|
+
iconColor: theme.palette.status.onDisabled
|
|
139
|
+
}
|
|
140
|
+
},
|
|
141
|
+
capsuleOutlined: {
|
|
142
|
+
primary: {
|
|
143
|
+
container: {
|
|
144
|
+
borderColor: theme.palette.border.base,
|
|
145
|
+
borderRadius: theme.shape.radius.full,
|
|
146
|
+
borderWidth: 1
|
|
147
|
+
},
|
|
148
|
+
labelColor: theme.palette.text.strong,
|
|
149
|
+
iconColor: theme.palette.icon.strong
|
|
150
|
+
},
|
|
151
|
+
disabled: {
|
|
152
|
+
container: {
|
|
153
|
+
borderColor: theme.palette.status.disabled,
|
|
154
|
+
borderRadius: theme.shape.radius.full,
|
|
155
|
+
borderWidth: 1
|
|
156
|
+
},
|
|
157
|
+
labelColor: theme.palette.status.disabledLabel,
|
|
158
|
+
iconColor: theme.palette.status.disabledLabel
|
|
159
|
+
}
|
|
81
160
|
}
|
|
82
161
|
};
|
|
83
162
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useVariantStyleMap","variant","color","theme","useTheme","useMemo","palette","variantStyleMap","solid","accent","fillColor","fill","labelColor","commonColors","static","strongInverse","iconColor","primary","base","text","icon","danger","status","disabled","onDisabled","outlined","borderColor","border","disabledLabel","strong","secondary","accentAlt","process","env","NODE_ENV","console","warn"],"sources":["useVariantStyleMap.ts"],"sourcesContent":["import { useMemo } from 'react';\nimport { commonColors } from '@fountain-ui/styles';\nimport { useTheme } from '../styles';\nimport { ButtonColor, ButtonVariant } from './ButtonProps';\n\ntype UseVariantStyleMapReturns = {\n borderColor?: string;\n fillColor?: string;\n iconColor?: string;\n labelColor?: string;\n}\n\ntype VariantStyleMap = {\n [variant in ButtonVariant]: {\n [color in ButtonColor]?: UseVariantStyleMapReturns;\n }\n};\n\nexport default function useVariantStyleMap(variant: ButtonVariant, color: ButtonColor): UseVariantStyleMapReturns {\n const theme = useTheme();\n\n return useMemo(() => {\n const { palette } = theme;\n\n const variantStyleMap: VariantStyleMap = {\n solid: {\n accent: {\n fillColor: palette.fill.accent,\n labelColor: commonColors.static.strongInverse,\n iconColor: commonColors.static.strongInverse,\n },\n primary: {\n fillColor: palette.fill.base,\n labelColor: palette.text.strongInverse,\n iconColor: palette.icon.strongInverse,\n },\n danger: {\n fillColor: palette.status.danger,\n labelColor: commonColors.static.strongInverse,\n iconColor: commonColors.static.strongInverse,\n },\n disabled: {\n fillColor: palette.status.disabled,\n labelColor: palette.status.onDisabled,\n iconColor: palette.status.onDisabled,\n },\n },\n outlined: {\n accent: {\n borderColor: palette.border.accent,\n labelColor: palette.text.accent,\n iconColor: palette.icon.accent,\n },\n primary: {\n borderColor: palette.border.base,\n labelColor: palette.text.base,\n iconColor: palette.icon.base,\n },\n disabled: {\n borderColor: palette.status.disabled,\n labelColor: palette.status.disabledLabel,\n iconColor: palette.status.disabledLabel,\n },\n },\n text: {\n primary: {\n labelColor: palette.text.strong,\n iconColor: palette.icon.strong,\n },\n secondary: {\n labelColor: palette.text.base,\n iconColor: palette.icon.base,\n },\n accent: {\n labelColor: palette.text.accent,\n iconColor: palette.icon.accent,\n },\n accentAlt: {\n labelColor: palette.text.accentAlt,\n iconColor: palette.icon.accentAlt,\n },\n disabled: {\n labelColor: palette.status.disabledLabel,\n iconColor: palette.status.disabledLabel,\n },\n },\n };\n\n if (variantStyleMap[variant][color]) {\n return variantStyleMap[variant][color] as UseVariantStyleMapReturns;\n }\n\n if (process.env.NODE_ENV !== 'production') {\n console.warn('The selected color is not supported for the chosen variant.');\n }\n\n return {};\n }, [theme, variant, color]);\n}\n"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AAgBe,SAASA,kBAAT,CAA4BC,OAA5B,EAAoDC,KAApD,EAAmG;EAC9G,MAAMC,KAAK,GAAG,IAAAC,iBAAA,GAAd;EAEA,OAAO,IAAAC,cAAA,EAAQ,MAAM;IACjB,MAAM;MAAEC;IAAF,IAAcH,KAApB;IAEA,MAAMI,eAAgC,GAAG;MACrCC,KAAK,EAAE;QACHC,MAAM,EAAE;UACJC,SAAS,EAAEJ,OAAO,CAACK,IAAR,CAAaF,MADpB;UAEJG,UAAU,EAAEC,oBAAA,CAAaC,MAAb,CAAoBC,aAF5B;UAGJC,SAAS,EAAEH,oBAAA,CAAaC,MAAb,CAAoBC;QAH3B,CADL;QAMHE,OAAO,EAAE;UACLP,SAAS,EAAEJ,OAAO,CAACK,IAAR,CAAaO,IADnB;UAELN,UAAU,EAAEN,OAAO,CAACa,IAAR,CAAaJ,aAFpB;UAGLC,SAAS,EAAEV,OAAO,CAACc,IAAR,CAAaL;QAHnB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IAAR,CAAaF;QAFjB,CALT;QASFT,MAAM,EAAE;UACJG,UAAU,EAAEN,OAAO,CAACa,IAAR,CAAaV,MADrB;UAEJO,SAAS,EAAEV,OAAO,CAACc,IAAR,CAAaX;QAFpB,CATN;QAaFsB,SAAS,EAAE;UACPnB,UAAU,EAAEN,OAAO,CAACa,IAAR,CAAaY,SADlB;UAEPf,SAAS,EAAEV,OAAO,CAACc,IAAR,CAAaW;QAFjB,CAbT;QAiBFR,QAAQ,EAAE;UACNX,UAAU,EAAEN,OAAO,CAACgB,MAAR,CAAeM,aADrB;UAENZ,SAAS,EAAEV,OAAO,CAACgB,MAAR,CAAeM;QAFpB;MAjBR;IAxC+B,CAAzC;;IAgEA,IAAIrB,eAAe,CAACN,OAAD,CAAf,CAAyBC,KAAzB,CAAJ,EAAqC;MACjC,OAAOK,eAAe,CAACN,OAAD,CAAf,CAAyBC,KAAzB,CAAP;IACH;;IAED,IAAI8B,OAAO,CAACC,GAAR,CAAYC,QAAZ,KAAyB,YAA7B,EAA2C;MACvCC,OAAO,CAACC,IAAR,CAAa,6DAAb;IACH;;IAED,OAAO,EAAP;EACH,CA5EM,EA4EJ,CAACjC,KAAD,EAAQF,OAAR,EAAiBC,KAAjB,CA5EI,CAAP;AA6EH"}
|
|
1
|
+
{"version":3,"names":["useVariantStyleMap","variant","color","theme","useTheme","useMemo","palette","variantStyleMap","solid","accent","container","backgroundColor","fill","labelColor","commonColors","static","strongInverse","iconColor","primary","base","text","icon","danger","status","disabled","onDisabled","outlined","borderColor","border","borderWidth","disabledLabel","strong","secondary","accentAlt","capsuleSolid","borderRadius","shape","radius","full","capsuleOutlined","process","env","NODE_ENV","console","warn"],"sources":["useVariantStyleMap.ts"],"sourcesContent":["import { useMemo } from 'react';\nimport type { FountainUiStyle } from '@fountain-ui/styles';\nimport { commonColors } from '@fountain-ui/styles';\nimport { useTheme } from '../styles';\nimport { ButtonColor, ButtonVariant } from './ButtonProps';\n\ntype UseVariantStyleMapReturns = {\n container?: FountainUiStyle;\n iconColor?: string;\n labelColor?: string;\n}\n\ntype VariantStyleMap = {\n [variant in ButtonVariant]: {\n [color in ButtonColor]?: UseVariantStyleMapReturns;\n }\n};\n\nexport default function useVariantStyleMap(variant: ButtonVariant, color: ButtonColor): UseVariantStyleMapReturns {\n const theme = useTheme();\n\n return useMemo(() => {\n const { palette } = theme;\n\n const variantStyleMap: VariantStyleMap = {\n solid: {\n accent: {\n container: {\n backgroundColor: palette.fill.accent,\n },\n labelColor: commonColors.static.strongInverse,\n iconColor: commonColors.static.strongInverse,\n },\n primary: {\n container: {\n backgroundColor: palette.fill.base,\n },\n labelColor: palette.text.strongInverse,\n iconColor: palette.icon.strongInverse,\n },\n danger: {\n container: {\n backgroundColor: palette.status.danger,\n },\n labelColor: commonColors.static.strongInverse,\n iconColor: commonColors.static.strongInverse,\n },\n disabled: {\n container: {\n backgroundColor: palette.status.disabled,\n },\n labelColor: palette.status.onDisabled,\n iconColor: palette.status.onDisabled,\n },\n },\n outlined: {\n accent: {\n container: {\n borderColor: palette.border.accent,\n borderWidth: 1,\n },\n labelColor: palette.text.accent,\n iconColor: palette.icon.accent,\n },\n primary: {\n container: {\n borderColor: palette.border.base,\n borderWidth: 1,\n },\n labelColor: palette.text.base,\n iconColor: palette.icon.base,\n },\n disabled: {\n container: {\n borderColor: palette.status.disabled,\n borderWidth: 1,\n },\n labelColor: palette.status.disabledLabel,\n iconColor: palette.status.disabledLabel,\n },\n },\n text: {\n primary: {\n labelColor: palette.text.strong,\n iconColor: palette.icon.strong,\n },\n secondary: {\n labelColor: palette.text.base,\n iconColor: palette.icon.base,\n },\n accent: {\n labelColor: palette.text.accent,\n iconColor: palette.icon.accent,\n },\n accentAlt: {\n labelColor: palette.text.accentAlt,\n iconColor: palette.icon.accentAlt,\n },\n disabled: {\n labelColor: palette.status.disabledLabel,\n iconColor: palette.status.disabledLabel,\n },\n },\n capsuleSolid: {\n accent: {\n container: {\n backgroundColor: theme.palette.fill.accent,\n borderRadius: theme.shape.radius.full,\n },\n labelColor: commonColors.static.strongInverse,\n iconColor: commonColors.static.strongInverse,\n },\n primary: {\n container: {\n backgroundColor: theme.palette.fill.base,\n borderRadius: theme.shape.radius.full,\n },\n labelColor: palette.text.strongInverse,\n iconColor: palette.icon.strongInverse,\n },\n danger: {\n container: {\n backgroundColor: theme.palette.status.danger,\n borderRadius: theme.shape.radius.full,\n },\n labelColor: commonColors.static.strongInverse,\n iconColor: commonColors.static.strongInverse,\n },\n secondary: {\n container: {\n backgroundColor: commonColors.static.strongInverse,\n borderRadius: theme.shape.radius.full,\n },\n labelColor: theme.palette.text.strong,\n iconColor: theme.palette.icon.strong,\n },\n disabled: {\n container: {\n backgroundColor: theme.palette.status.disabled,\n borderRadius: theme.shape.radius.full,\n },\n labelColor: theme.palette.status.onDisabled,\n iconColor: theme.palette.status.onDisabled,\n },\n },\n capsuleOutlined: {\n primary: {\n container: {\n borderColor: theme.palette.border.base,\n borderRadius: theme.shape.radius.full,\n borderWidth: 1,\n },\n labelColor: theme.palette.text.strong,\n iconColor: theme.palette.icon.strong,\n },\n disabled: {\n container: {\n borderColor: theme.palette.status.disabled,\n borderRadius: theme.shape.radius.full,\n borderWidth: 1,\n },\n labelColor: theme.palette.status.disabledLabel,\n iconColor: theme.palette.status.disabledLabel,\n },\n },\n };\n\n if (variantStyleMap[variant][color]) {\n return variantStyleMap[variant][color] as UseVariantStyleMapReturns;\n }\n\n if (process.env.NODE_ENV !== 'production') {\n console.warn('The selected color is not supported for the chosen variant.');\n }\n\n return {};\n }, [theme, variant, color]);\n}\n"],"mappings":";;;;;;;AAAA;;AAEA;;AACA;;AAee,SAASA,kBAAT,CAA4BC,OAA5B,EAAoDC,KAApD,EAAmG;EAC9G,MAAMC,KAAK,GAAG,IAAAC,iBAAA,GAAd;EAEA,OAAO,IAAAC,cAAA,EAAQ,MAAM;IACjB,MAAM;MAAEC;IAAF,IAAcH,KAApB;IAEA,MAAMI,eAAgC,GAAG;MACrCC,KAAK,EAAE;Q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3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.ORIGINAL_OPACITY =
|
|
6
|
+
exports.ORIGINAL_OPACITY = void 0;
|
|
7
7
|
exports.default = ButtonBase;
|
|
8
8
|
|
|
9
9
|
var _react = _interopRequireWildcard(require("react"));
|
|
@@ -24,8 +24,6 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function
|
|
|
24
24
|
|
|
25
25
|
const ORIGINAL_OPACITY = 1;
|
|
26
26
|
exports.ORIGINAL_OPACITY = ORIGINAL_OPACITY;
|
|
27
|
-
const DISABLED_OPACITY = .3;
|
|
28
|
-
exports.DISABLED_OPACITY = DISABLED_OPACITY;
|
|
29
27
|
const ACTIVE_OPACITY = .65;
|
|
30
28
|
const ORIGINAL_SCALE = 1;
|
|
31
29
|
const MINIFIED_SCALE = .96; // at "node_modules/react-native/Libraries/Pressability.js"
|
|
@@ -42,14 +40,12 @@ const startTimingAnimationWithDefaults = (value, toValue) => {
|
|
|
42
40
|
}).start();
|
|
43
41
|
};
|
|
44
42
|
|
|
45
|
-
const getOpacityByDisabled = disabled => disabled ? DISABLED_OPACITY : ORIGINAL_OPACITY;
|
|
46
|
-
|
|
47
43
|
function ButtonBase(props) {
|
|
48
44
|
const {
|
|
49
45
|
children,
|
|
50
46
|
disabled = false,
|
|
51
47
|
disableThrottle = false,
|
|
52
|
-
onPress,
|
|
48
|
+
onPress: _onPress,
|
|
53
49
|
onPressOut,
|
|
54
50
|
pressEffect = 'opacity',
|
|
55
51
|
pressDelay: pressDelayOrNil,
|
|
@@ -57,15 +53,13 @@ function ButtonBase(props) {
|
|
|
57
53
|
throttleMillis = 650,
|
|
58
54
|
...otherProps
|
|
59
55
|
} = props;
|
|
56
|
+
const onPress = (0, _react.useCallback)(() => _onPress === null || _onPress === void 0 ? void 0 : _onPress(), [_onPress]);
|
|
60
57
|
const handlePress = (0, _hooks.useThrottle)({
|
|
61
58
|
periodMillis: disableThrottle ? 0 : throttleMillis,
|
|
62
59
|
callback: onPress
|
|
63
60
|
});
|
|
64
|
-
const opacity = (0, _hooks.useAnimatedValue)(
|
|
61
|
+
const opacity = (0, _hooks.useAnimatedValue)(ORIGINAL_OPACITY);
|
|
65
62
|
const scale = (0, _hooks.useAnimatedValue)(ORIGINAL_SCALE);
|
|
66
|
-
(0, _react.useEffect)(() => {
|
|
67
|
-
opacity.setValue(getOpacityByDisabled(disabled));
|
|
68
|
-
}, [disabled, pressEffect]);
|
|
69
63
|
const startScaleAnimation = (0, _react.useCallback)((pressIn, isHover) => {
|
|
70
64
|
if (!isHover) {
|
|
71
65
|
startTimingAnimationWithDefaults(scale, pressIn ? MINIFIED_SCALE : ORIGINAL_SCALE);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["ORIGINAL_OPACITY","
|
|
1
|
+
{"version":3,"names":["ORIGINAL_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","ButtonBase","props","children","disabled","disableThrottle","onPress","_onPress","onPressOut","pressEffect","pressDelay","pressDelayOrNil","style","styleProp","throttleMillis","otherProps","useCallback","handlePress","useThrottle","periodMillis","callback","opacity","useAnimatedValue","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 = .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\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;;AACA;;AACA;;AACA;;AACA;;;;;;;;AAOO,MAAMA,gBAAgB,GAAG,CAAzB;;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,EAAuB;IACnBC,OADmB;IAEnBG,QAAQ,EAAE,GAFS;IAGnBC,eAAe,EAAEC;EAHE,CAAvB,EAIGC,KAJH;AAKH,CATD;;AAWe,SAASC,UAAT,CAAoBC,KAApB,EAA4C;EACvD,MAAM;IACFC,QADE;IAEFC,QAAQ,GAAG,KAFT;IAGFC,eAAe,GAAG,KAHhB;IAIFC,OAAO,EAAEC,QAJP;IAKFC,UALE;IAMFC,WAAW,GAAG,SANZ;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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
|
|
@@ -0,0 +1 @@
|
|
|
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,EAAuB;IACnBC,OADmB;IAEnBG,QAAQ,EAAE,GAFS;IAGnBC,eA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AAP,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"}
|
|
@@ -6,11 +6,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
Object.defineProperty(exports, "default", {
|
|
7
7
|
enumerable: true,
|
|
8
8
|
get: function () {
|
|
9
|
-
return
|
|
9
|
+
return _LegacyButtonBase.default;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
12
|
|
|
13
|
-
var
|
|
13
|
+
var _LegacyButtonBase = _interopRequireDefault(require("./LegacyButtonBase"));
|
|
14
14
|
|
|
15
15
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
16
16
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export { default } from './
|
|
1
|
+
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export { default } from './LegacyButtonBase';\nexport type { default as ButtonBaseProps } from './ButtonBaseProps';\n"],"mappings":";;;;;;;;;;;;AAAA"}
|
|
@@ -13,86 +13,48 @@ var _styles = require("../styles");
|
|
|
13
13
|
|
|
14
14
|
var _utils = require("../utils");
|
|
15
15
|
|
|
16
|
-
var _ButtonBase = _interopRequireDefault(require("../ButtonBase"));
|
|
16
|
+
var _ButtonBase = _interopRequireDefault(require("../ButtonBase/ButtonBase"));
|
|
17
|
+
|
|
18
|
+
var _useChipStyle = _interopRequireDefault(require("./useChipStyle"));
|
|
17
19
|
|
|
18
20
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
21
|
|
|
20
22
|
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); }
|
|
21
23
|
|
|
22
|
-
const ICON_SIZE = 20;
|
|
23
|
-
|
|
24
|
-
const useStyles = function () {
|
|
25
|
-
const theme = (0, _styles.useTheme)();
|
|
26
|
-
return {
|
|
27
|
-
root: {
|
|
28
|
-
alignItems: 'center',
|
|
29
|
-
borderRadius: theme.shape.roundnessExtra,
|
|
30
|
-
flexDirection: 'row',
|
|
31
|
-
height: 32,
|
|
32
|
-
justifyContent: 'center',
|
|
33
|
-
paddingLeft: theme.spacing(3),
|
|
34
|
-
paddingRight: theme.spacing(3)
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
};
|
|
38
|
-
|
|
39
24
|
function Chip(props) {
|
|
40
25
|
const {
|
|
41
26
|
children,
|
|
42
|
-
|
|
27
|
+
endElement: endElementProp,
|
|
43
28
|
numberOfLines,
|
|
44
29
|
onPress,
|
|
45
|
-
|
|
30
|
+
size = 'small',
|
|
31
|
+
startElement: startElementProp,
|
|
32
|
+
startElementVariant = 'default',
|
|
46
33
|
style: styleProp,
|
|
47
|
-
variant = 'outlined',
|
|
48
34
|
...otherProps
|
|
49
35
|
} = props;
|
|
50
|
-
const
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
borderColor: theme.palette.primary.main,
|
|
65
|
-
borderWidth: 1.5
|
|
66
|
-
}
|
|
67
|
-
};
|
|
68
|
-
const chipStyle = (0, _styles.css)([styles.root, variantStyleMap[variant], styleProp]);
|
|
69
|
-
const fontStyle = (0, _styles.createFontStyle)(theme, {
|
|
70
|
-
selector: typo => variant === 'bold' ? typo.subtitle2 : typo.body2,
|
|
71
|
-
color: fontColor
|
|
36
|
+
const {
|
|
37
|
+
container: containerStyle,
|
|
38
|
+
endElement: endElementStyle,
|
|
39
|
+
label: labelStyle,
|
|
40
|
+
startElement: startElementStyle
|
|
41
|
+
} = (0, _useChipStyle.default)(size, startElementVariant, !!endElementProp);
|
|
42
|
+
const chipStyle = (0, _styles.css)([containerStyle, styleProp]);
|
|
43
|
+
const startElement = startElementVariant === 'icon' ? /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
44
|
+
style: startElementStyle
|
|
45
|
+
}, (0, _utils.cloneElementSafely)(startElementProp)) : (0, _utils.cloneElementSafely)(startElementProp, {
|
|
46
|
+
style: startElementStyle
|
|
47
|
+
});
|
|
48
|
+
const endElement = (0, _utils.cloneElementSafely)(endElementProp, {
|
|
49
|
+
style: endElementStyle
|
|
72
50
|
});
|
|
73
|
-
const textMarginSize = theme.spacing(1);
|
|
74
|
-
const textMarginStyle = startIconProp ? {
|
|
75
|
-
marginLeft: textMarginSize
|
|
76
|
-
} : endIconProp ? {
|
|
77
|
-
marginRight: textMarginSize
|
|
78
|
-
} : undefined;
|
|
79
|
-
const textStyle = (0, _styles.css)([fontStyle, textMarginStyle, {
|
|
80
|
-
textAlign: 'center'
|
|
81
|
-
}]);
|
|
82
|
-
const iconProps = {
|
|
83
|
-
width: ICON_SIZE,
|
|
84
|
-
height: ICON_SIZE,
|
|
85
|
-
fill: fontColor
|
|
86
|
-
};
|
|
87
|
-
const startIcon = (0, _utils.cloneElementSafely)(startIconProp, iconProps);
|
|
88
|
-
const endIcon = (0, _utils.cloneElementSafely)(endIconProp, iconProps);
|
|
89
51
|
return /*#__PURE__*/_react.default.createElement(_ButtonBase.default, _extends({
|
|
90
52
|
onPress: onPress,
|
|
91
53
|
style: chipStyle
|
|
92
|
-
}, otherProps),
|
|
54
|
+
}, otherProps), startElement, /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
93
55
|
children: children,
|
|
94
56
|
numberOfLines: numberOfLines,
|
|
95
|
-
style:
|
|
96
|
-
}),
|
|
57
|
+
style: labelStyle
|
|
58
|
+
}), endElement);
|
|
97
59
|
}
|
|
98
60
|
//# sourceMappingURL=Chip.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["Chip","props","children","endElement","endElementProp","numberOfLines","onPress","size","startElement","startElementProp","startElementVariant","style","styleProp","otherProps","container","containerStyle","endElementStyle","label","labelStyle","startElementStyle","useChipStyle","chipStyle","css","cloneElementSafely"],"sources":["Chip.tsx"],"sourcesContent":["import React from 'react';\nimport { Text, View } from 'react-native';\nimport { css } from '../styles';\nimport { cloneElementSafely } from '../utils';\nimport ButtonBase from '../ButtonBase/ButtonBase';\nimport type ChipProps from './ChipProps';\nimport type { ChipSize } from './ChipProps';\nimport useChipStyle from './useChipStyle';\n\nexport default function Chip(props: ChipProps) {\n const {\n children,\n endElement: endElementProp,\n numberOfLines,\n onPress,\n size = 'small' as ChipSize,\n startElement: startElementProp,\n startElementVariant = 'default',\n style: styleProp,\n ...otherProps\n } = props;\n\n const {\n container: containerStyle,\n endElement: endElementStyle,\n label: labelStyle,\n startElement: startElementStyle,\n } = useChipStyle(size, startElementVariant, !!endElementProp);\n\n const chipStyle = css([\n containerStyle,\n styleProp,\n ]);\n\n const startElement = startElementVariant === 'icon'\n ? (\n <View style={startElementStyle}>\n {cloneElementSafely(startElementProp)}\n </View>\n ) : cloneElementSafely(startElementProp, { style: startElementStyle });\n const endElement = cloneElementSafely(endElementProp, { style: endElementStyle });\n\n return (\n <ButtonBase\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 {endElement}\n </ButtonBase>\n );\n}\n"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AAGA;;;;;;AAEe,SAASA,IAAT,CAAcC,KAAd,EAAgC;EAC3C,MAAM;IACFC,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ipSizes = ['large', 'small'];
|
|
8
|
+
exports.chipSizes = chipSizes;
|
|
9
|
+
const chipStartElementVariants = ['default', 'avatar', 'image', 'icon'];
|
|
10
|
+
exports.chipStartElementVariants = chipStartElementVariants;
|
|
2
11
|
//# sourceMappingURL=ChipProps.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["ChipProps.ts"],"sourcesContent":["import React from 'react';\nimport { OverridableComponentProps } from '../types';\nimport type { ButtonBaseProps } from '../ButtonBase';\n\nexport
|
|
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 * Element placed after the children.\n */\n endElement?: React.ReactElement;\n\n /**\n * The content of the component.\n */\n children: string;\n\n /**\n * Number of lines of children.\n */\n numberOfLines?: number;\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 style of the start element.\n */\n startElementVariant?: ChipStartElementVariant;\n}> {}\n"],"mappings":";;;;;;AAIO,MAAMA,SAAS,GAAG,CAAC,OAAD,EAAU,OAAV,CAAlB;;AAGA,MAAMC,wBAAwB,GAAG,CAAC,SAAD,EAAY,QAAZ,EAAsB,OAAtB,EAA+B,MAA/B,CAAjC"}
|