@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
package/src/Chip/ChipProps.ts
CHANGED
|
@@ -2,13 +2,17 @@ import React from 'react';
|
|
|
2
2
|
import { OverridableComponentProps } from '../types';
|
|
3
3
|
import type { ButtonBaseProps } from '../ButtonBase';
|
|
4
4
|
|
|
5
|
-
export
|
|
5
|
+
export const chipSizes = ['large', 'small'] as const;
|
|
6
|
+
export type ChipSize = typeof chipSizes[number];
|
|
7
|
+
|
|
8
|
+
export const chipStartElementVariants = ['default', 'avatar', 'image', 'icon'] as const;
|
|
9
|
+
export type ChipStartElementVariant = typeof chipStartElementVariants[number];
|
|
6
10
|
|
|
7
11
|
export default interface ChipProps extends OverridableComponentProps<ButtonBaseProps, {
|
|
8
12
|
/**
|
|
9
13
|
* Element placed after the children.
|
|
10
14
|
*/
|
|
11
|
-
|
|
15
|
+
endElement?: React.ReactElement;
|
|
12
16
|
|
|
13
17
|
/**
|
|
14
18
|
* The content of the component.
|
|
@@ -20,14 +24,19 @@ export default interface ChipProps extends OverridableComponentProps<ButtonBaseP
|
|
|
20
24
|
*/
|
|
21
25
|
numberOfLines?: number;
|
|
22
26
|
|
|
27
|
+
/**
|
|
28
|
+
* Determines size of component.
|
|
29
|
+
* @default 'small'
|
|
30
|
+
*/
|
|
31
|
+
size?: ChipSize;
|
|
32
|
+
|
|
23
33
|
/**
|
|
24
34
|
* Element placed before the children.
|
|
25
35
|
*/
|
|
26
|
-
|
|
36
|
+
startElement?: React.ReactElement;
|
|
27
37
|
|
|
28
38
|
/**
|
|
29
|
-
*
|
|
30
|
-
* @default 'outlined'
|
|
39
|
+
* Determines the style of the start element.
|
|
31
40
|
*/
|
|
32
|
-
|
|
33
|
-
}> {}
|
|
41
|
+
startElementVariant?: ChipStartElementVariant;
|
|
42
|
+
}> {}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Text } from 'react-native';
|
|
3
|
+
import { NamedStylesStringUnion, UseStyles } from '@fountain-ui/styles';
|
|
4
|
+
import { createFontStyle, css, useTheme } from '../styles';
|
|
5
|
+
import { cloneElementSafely } from '../utils';
|
|
6
|
+
import ButtonBase from '../ButtonBase';
|
|
7
|
+
import type ChipProps from './LegacyChipProps';
|
|
8
|
+
|
|
9
|
+
type ChipStyles = NamedStylesStringUnion<'root'>;
|
|
10
|
+
|
|
11
|
+
const ICON_SIZE = 20;
|
|
12
|
+
|
|
13
|
+
const useStyles: UseStyles<ChipStyles> = function (): ChipStyles {
|
|
14
|
+
const theme = useTheme();
|
|
15
|
+
|
|
16
|
+
return {
|
|
17
|
+
root: {
|
|
18
|
+
alignItems: 'center',
|
|
19
|
+
borderRadius: theme.shape.roundnessExtra,
|
|
20
|
+
flexDirection: 'row',
|
|
21
|
+
height: 32,
|
|
22
|
+
justifyContent: 'center',
|
|
23
|
+
paddingLeft: theme.spacing(3),
|
|
24
|
+
paddingRight: theme.spacing(3),
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export default function Chip(props: ChipProps) {
|
|
30
|
+
const {
|
|
31
|
+
children,
|
|
32
|
+
endIcon: endIconProp,
|
|
33
|
+
numberOfLines,
|
|
34
|
+
onPress,
|
|
35
|
+
startIcon: startIconProp,
|
|
36
|
+
style: styleProp,
|
|
37
|
+
variant = 'outlined',
|
|
38
|
+
...otherProps
|
|
39
|
+
} = props;
|
|
40
|
+
|
|
41
|
+
const theme = useTheme();
|
|
42
|
+
const styles = useStyles();
|
|
43
|
+
|
|
44
|
+
const fontColor = variant === 'outlined'
|
|
45
|
+
? theme.palette.tertiary.main
|
|
46
|
+
: theme.palette.primary.main;
|
|
47
|
+
|
|
48
|
+
const variantStyleMap = {
|
|
49
|
+
outlined: {
|
|
50
|
+
backgroundColor: theme.palette.paper.default,
|
|
51
|
+
borderColor: theme.palette.border.default,
|
|
52
|
+
borderWidth: 1,
|
|
53
|
+
},
|
|
54
|
+
filled: {
|
|
55
|
+
backgroundColor: theme.palette.paper.grey,
|
|
56
|
+
},
|
|
57
|
+
bold: {
|
|
58
|
+
backgroundColor: theme.palette.paper.default,
|
|
59
|
+
borderColor: theme.palette.primary.main,
|
|
60
|
+
borderWidth: 1.5,
|
|
61
|
+
},
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
const chipStyle = css([
|
|
65
|
+
styles.root,
|
|
66
|
+
variantStyleMap[variant],
|
|
67
|
+
styleProp,
|
|
68
|
+
]);
|
|
69
|
+
|
|
70
|
+
const fontStyle = createFontStyle(theme, {
|
|
71
|
+
selector: (typo) => variant === 'bold'
|
|
72
|
+
? typo.subtitle2
|
|
73
|
+
: typo.body2,
|
|
74
|
+
color: fontColor,
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
const textMarginSize = theme.spacing(1);
|
|
78
|
+
const textMarginStyle = startIconProp
|
|
79
|
+
? { marginLeft: textMarginSize }
|
|
80
|
+
: endIconProp
|
|
81
|
+
? { marginRight: textMarginSize }
|
|
82
|
+
: undefined;
|
|
83
|
+
|
|
84
|
+
const textStyle = css([
|
|
85
|
+
fontStyle,
|
|
86
|
+
textMarginStyle,
|
|
87
|
+
{ textAlign: 'center' },
|
|
88
|
+
]);
|
|
89
|
+
|
|
90
|
+
const iconProps = {
|
|
91
|
+
width: ICON_SIZE,
|
|
92
|
+
height: ICON_SIZE,
|
|
93
|
+
fill: fontColor,
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
const startIcon = cloneElementSafely(startIconProp, iconProps);
|
|
97
|
+
const endIcon = cloneElementSafely(endIconProp, iconProps);
|
|
98
|
+
|
|
99
|
+
return (
|
|
100
|
+
<ButtonBase
|
|
101
|
+
onPress={onPress}
|
|
102
|
+
style={chipStyle}
|
|
103
|
+
{...otherProps}
|
|
104
|
+
>
|
|
105
|
+
{startIcon}
|
|
106
|
+
|
|
107
|
+
<Text
|
|
108
|
+
children={children}
|
|
109
|
+
numberOfLines={numberOfLines}
|
|
110
|
+
style={textStyle}
|
|
111
|
+
/>
|
|
112
|
+
|
|
113
|
+
{endIcon}
|
|
114
|
+
</ButtonBase>
|
|
115
|
+
);
|
|
116
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { OverridableComponentProps } from '../types';
|
|
3
|
+
import type { ButtonBaseProps } from '../ButtonBase';
|
|
4
|
+
|
|
5
|
+
export type ChipVariant = 'outlined' | 'filled' | 'bold';
|
|
6
|
+
|
|
7
|
+
export default interface ChipProps extends OverridableComponentProps<ButtonBaseProps, {
|
|
8
|
+
/**
|
|
9
|
+
* Element placed after the children.
|
|
10
|
+
*/
|
|
11
|
+
endIcon?: React.ReactElement;
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* The content of the component.
|
|
15
|
+
*/
|
|
16
|
+
children: string;
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Number of lines of children.
|
|
20
|
+
*/
|
|
21
|
+
numberOfLines?: number;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Element placed before the children.
|
|
25
|
+
*/
|
|
26
|
+
startIcon?: React.ReactElement;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* The variant to use.
|
|
30
|
+
* @default 'outlined'
|
|
31
|
+
*/
|
|
32
|
+
variant?: ChipVariant;
|
|
33
|
+
}> {}
|
package/src/Chip/index.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { default } from './
|
|
2
|
-
export type { default as ChipProps } from './
|
|
1
|
+
export { default } from './LegacyChip';
|
|
2
|
+
export type { default as ChipProps } from './LegacyChipProps';
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { useMemo } from 'react';
|
|
2
|
+
import type { TextStyle } from 'react-native';
|
|
3
|
+
import type { FountainUiStyle } from '@fountain-ui/styles';
|
|
4
|
+
import { createFontStyle, useTheme } from '../styles';
|
|
5
|
+
import type { ChipSize, ChipStartElementVariant } from './ChipProps';
|
|
6
|
+
|
|
7
|
+
interface ChipStyle {
|
|
8
|
+
container: FountainUiStyle;
|
|
9
|
+
endElement?: FountainUiStyle;
|
|
10
|
+
label: TextStyle;
|
|
11
|
+
startElement?: FountainUiStyle;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
type VariantStyleMap = Record<ChipStartElementVariant, Partial<ChipStyle>>;
|
|
15
|
+
|
|
16
|
+
// TODO: need to refactoring...
|
|
17
|
+
export default function useChipStyle(
|
|
18
|
+
size: ChipSize,
|
|
19
|
+
startElementVariant: ChipStartElementVariant,
|
|
20
|
+
isEndElement: boolean,
|
|
21
|
+
): ChipStyle {
|
|
22
|
+
const theme = useTheme();
|
|
23
|
+
|
|
24
|
+
return useMemo<ChipStyle>(() => {
|
|
25
|
+
const fontStyleMap: Record<ChipSize, TextStyle> = {
|
|
26
|
+
small: createFontStyle(theme, {
|
|
27
|
+
// TODO: select typography.
|
|
28
|
+
// selector: (typography) => typography.caption1.medium,
|
|
29
|
+
color: theme.palette.text.strong,
|
|
30
|
+
}),
|
|
31
|
+
large: createFontStyle(theme, {
|
|
32
|
+
// TODO: select typography.
|
|
33
|
+
// selector: (typography) => typography.body2.medium,
|
|
34
|
+
color: theme.palette.text.strong,
|
|
35
|
+
}),
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
const endElementStyleMap: Record<ChipSize, FountainUiStyle> = {
|
|
39
|
+
small: {
|
|
40
|
+
height: 14,
|
|
41
|
+
marginLeft: theme.spacing(2),
|
|
42
|
+
width: 8.17,
|
|
43
|
+
},
|
|
44
|
+
large: {
|
|
45
|
+
height: 16,
|
|
46
|
+
marginLeft: theme.spacing(2.5),
|
|
47
|
+
width: 9,
|
|
48
|
+
},
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
const baseContainerStyle: FountainUiStyle = {
|
|
52
|
+
alignItems: 'center',
|
|
53
|
+
backgroundColor: theme.palette.fill.weaker,
|
|
54
|
+
borderRadius: theme.shape.radius.full,
|
|
55
|
+
flexDirection: 'row',
|
|
56
|
+
height: 'fit-content',
|
|
57
|
+
overflow: 'hidden',
|
|
58
|
+
width: 'fit-content',
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
const isLarge = size === 'large';
|
|
62
|
+
|
|
63
|
+
const variantStyleMap: VariantStyleMap = {
|
|
64
|
+
avatar: {
|
|
65
|
+
container: {
|
|
66
|
+
paddingLeft: theme.spacing(isLarge ? 1.5 : 1.25),
|
|
67
|
+
paddingRight: theme.spacing(isLarge ? 3.5 : 3),
|
|
68
|
+
paddingVertical: theme.spacing(isLarge ? 1.25 : 1),
|
|
69
|
+
},
|
|
70
|
+
startElement: {
|
|
71
|
+
borderRadius: theme.shape.radius.full,
|
|
72
|
+
height: isLarge ? 24 : 22,
|
|
73
|
+
marginRight: theme.spacing(isLarge ? 1.5 : 1.25),
|
|
74
|
+
width: isLarge ? 24 : 22,
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
icon: {
|
|
78
|
+
container: {
|
|
79
|
+
paddingLeft: theme.spacing(1.5),
|
|
80
|
+
paddingRight: theme.spacing(isLarge ? 3.5 : 3),
|
|
81
|
+
paddingVertical: theme.spacing(isLarge ? 1.5 : 1.25),
|
|
82
|
+
},
|
|
83
|
+
startElement: {
|
|
84
|
+
alignItems: 'center',
|
|
85
|
+
height: isLarge ? 22 : 20,
|
|
86
|
+
justifyContent: 'center',
|
|
87
|
+
marginRight: theme.spacing(isLarge ? 1 : 0.75),
|
|
88
|
+
width: isLarge ? 22 : 20,
|
|
89
|
+
},
|
|
90
|
+
},
|
|
91
|
+
image: {
|
|
92
|
+
container: {
|
|
93
|
+
alignItems: 'center',
|
|
94
|
+
paddingRight: theme.spacing(isLarge ? 3.5 : 3),
|
|
95
|
+
},
|
|
96
|
+
startElement: {
|
|
97
|
+
borderRadius: theme.shape.radius.full,
|
|
98
|
+
height: isLarge ? 34 : 30,
|
|
99
|
+
marginRight: theme.spacing(1.5),
|
|
100
|
+
width: isLarge ? 45 : 40,
|
|
101
|
+
},
|
|
102
|
+
},
|
|
103
|
+
default: {
|
|
104
|
+
container: {
|
|
105
|
+
paddingBottom: theme.spacing(1.75),
|
|
106
|
+
paddingHorizontal: theme.spacing(isLarge ? 3.5 : 3),
|
|
107
|
+
paddingTop: theme.spacing(1.5),
|
|
108
|
+
},
|
|
109
|
+
},
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
return {
|
|
113
|
+
container: {
|
|
114
|
+
...baseContainerStyle,
|
|
115
|
+
...variantStyleMap[startElementVariant]?.container,
|
|
116
|
+
...(isEndElement ? { paddingRight: theme.spacing(isLarge ? 2.5 : 2.25) } : {}),
|
|
117
|
+
},
|
|
118
|
+
endElement: endElementStyleMap[size],
|
|
119
|
+
label: fontStyleMap[size],
|
|
120
|
+
startElement: variantStyleMap[startElementVariant]?.startElement,
|
|
121
|
+
};
|
|
122
|
+
}, [theme, size, startElementVariant]);
|
|
123
|
+
}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Text } from 'react-native';
|
|
3
|
+
import { NamedStylesStringUnion, UseStyles } from '@fountain-ui/styles';
|
|
4
|
+
import Button from '../Button/Button';
|
|
5
|
+
import Column from '../Column';
|
|
6
|
+
import Spacer from '../Spacer';
|
|
7
|
+
import { createFontStyle, css, useTheme } from '../styles';
|
|
8
|
+
import type { FalsyReactElement } from '../utils';
|
|
9
|
+
import { cloneElementSafely } from '../utils';
|
|
10
|
+
import type EmptyProps from './EmptyProps';
|
|
11
|
+
|
|
12
|
+
type EmptyStyles = NamedStylesStringUnion<'root' | 'cta'>;
|
|
13
|
+
|
|
14
|
+
const useStyles: UseStyles<EmptyStyles> = function (): EmptyStyles {
|
|
15
|
+
const theme = useTheme();
|
|
16
|
+
|
|
17
|
+
return {
|
|
18
|
+
root: {
|
|
19
|
+
alignItems: 'center',
|
|
20
|
+
flex: 1,
|
|
21
|
+
justifyContent: 'center',
|
|
22
|
+
paddingHorizontal: theme.spacing(12),
|
|
23
|
+
},
|
|
24
|
+
cta: {
|
|
25
|
+
alignSelf: 'center',
|
|
26
|
+
},
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export default function Empty(props: EmptyProps) {
|
|
31
|
+
const {
|
|
32
|
+
buttonTitle,
|
|
33
|
+
description,
|
|
34
|
+
headerContent: headerContentProp,
|
|
35
|
+
onButtonPress,
|
|
36
|
+
style: styleProp,
|
|
37
|
+
title,
|
|
38
|
+
...otherProps
|
|
39
|
+
} = props;
|
|
40
|
+
|
|
41
|
+
const styles = useStyles();
|
|
42
|
+
|
|
43
|
+
const theme = useTheme();
|
|
44
|
+
|
|
45
|
+
const rootStyle = css([
|
|
46
|
+
styles.root,
|
|
47
|
+
styleProp,
|
|
48
|
+
]);
|
|
49
|
+
|
|
50
|
+
const headerContent = cloneElementSafely(headerContentProp as FalsyReactElement);
|
|
51
|
+
|
|
52
|
+
const titleFontStyle = createFontStyle(theme, {
|
|
53
|
+
selector: (typography) => typography.header3.semiBold,
|
|
54
|
+
color: theme.palette.text.strong,
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
const descriptionFontStyle = createFontStyle(theme, {
|
|
58
|
+
// TODO: select typography.
|
|
59
|
+
// selector: (typography) => typography.body2.regular,
|
|
60
|
+
color: theme.palette.text.base,
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
return (
|
|
64
|
+
<Column
|
|
65
|
+
style={rootStyle}
|
|
66
|
+
{...otherProps}
|
|
67
|
+
>
|
|
68
|
+
{headerContent ? (
|
|
69
|
+
<React.Fragment>
|
|
70
|
+
{headerContent}
|
|
71
|
+
|
|
72
|
+
<Spacer size={6}/>
|
|
73
|
+
</React.Fragment>
|
|
74
|
+
) : null}
|
|
75
|
+
|
|
76
|
+
<Text
|
|
77
|
+
children={title}
|
|
78
|
+
style={titleFontStyle}
|
|
79
|
+
/>
|
|
80
|
+
|
|
81
|
+
{description ? (
|
|
82
|
+
<React.Fragment>
|
|
83
|
+
<Spacer size={2}/>
|
|
84
|
+
|
|
85
|
+
<Text
|
|
86
|
+
children={description}
|
|
87
|
+
style={descriptionFontStyle}
|
|
88
|
+
/>
|
|
89
|
+
</React.Fragment>
|
|
90
|
+
) : null}
|
|
91
|
+
|
|
92
|
+
{buttonTitle && onButtonPress ? (
|
|
93
|
+
<React.Fragment>
|
|
94
|
+
<Spacer size={6}/>
|
|
95
|
+
|
|
96
|
+
{/* TODO: change Capsule solid variant. */}
|
|
97
|
+
<Button
|
|
98
|
+
children={buttonTitle}
|
|
99
|
+
color={'accent'}
|
|
100
|
+
onPress={onButtonPress}
|
|
101
|
+
style={styles.cta}
|
|
102
|
+
variant={'solid'}
|
|
103
|
+
/>
|
|
104
|
+
</React.Fragment>
|
|
105
|
+
) : null}
|
|
106
|
+
</Column>
|
|
107
|
+
);
|
|
108
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ViewProps } from 'react-native';
|
|
3
|
+
import type { OverridableComponentProps } from '../types';
|
|
4
|
+
|
|
5
|
+
export default interface EmptyProps extends OverridableComponentProps<Omit<ViewProps, 'children'>, {
|
|
6
|
+
/**
|
|
7
|
+
* Text displayed on the CTA button.
|
|
8
|
+
*/
|
|
9
|
+
buttonTitle?: string;
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Descriptive text shown below the title.
|
|
13
|
+
*/
|
|
14
|
+
description?: string;
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Content displayed at the top.
|
|
18
|
+
* Can be an icon, image, or any visual element.
|
|
19
|
+
*/
|
|
20
|
+
headerContent?: React.ReactNode;
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Function called when the CTA button is pressed.
|
|
24
|
+
*/
|
|
25
|
+
onButtonPress?: () => void;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* The main title text.
|
|
29
|
+
*/
|
|
30
|
+
title: string;
|
|
31
|
+
}> {}
|
|
@@ -40,6 +40,7 @@ export default function IconButton(props: IconButtonProps) {
|
|
|
40
40
|
onPress,
|
|
41
41
|
size = 'medium',
|
|
42
42
|
style,
|
|
43
|
+
iconSize,
|
|
43
44
|
...otherProps
|
|
44
45
|
} = props;
|
|
45
46
|
|
|
@@ -47,8 +48,8 @@ export default function IconButton(props: IconButtonProps) {
|
|
|
47
48
|
const styles = useStyles();
|
|
48
49
|
|
|
49
50
|
const icon = cloneElementSafely(children, {
|
|
50
|
-
width: iconSizes[size],
|
|
51
|
-
height: iconSizes[size],
|
|
51
|
+
width: iconSize ?? iconSizes[size],
|
|
52
|
+
height: iconSize ?? iconSizes[size],
|
|
52
53
|
color: color,
|
|
53
54
|
});
|
|
54
55
|
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { View } from 'react-native';
|
|
3
|
+
import { NamedStylesStringUnion, UseStyles } from '@fountain-ui/styles';
|
|
4
|
+
import { times } from '@fountain-ui/utils';
|
|
5
|
+
import { ChevronLeft, ChevronRight } from '../internal/icons';
|
|
6
|
+
import { css, useTheme } from '../styles';
|
|
7
|
+
import IconButton from '../IconButton';
|
|
8
|
+
import PaginationItem from '../PaginationItem/LegacyPaginationItem';
|
|
9
|
+
import type PaginationProps from './LegacyPaginationProps';
|
|
10
|
+
|
|
11
|
+
type PaginationStyleKeys =
|
|
12
|
+
| 'root'
|
|
13
|
+
| 'rootInline'
|
|
14
|
+
| 'rootAnchor'
|
|
15
|
+
| 'items'
|
|
16
|
+
| 'arrowContainer'
|
|
17
|
+
| 'prevInline'
|
|
18
|
+
| 'prevAnchor'
|
|
19
|
+
| 'nextInline'
|
|
20
|
+
| 'nextAnchor';
|
|
21
|
+
|
|
22
|
+
type PaginationStyles = NamedStylesStringUnion<PaginationStyleKeys>;
|
|
23
|
+
|
|
24
|
+
const useStyles: UseStyles<PaginationStyles> = function (): PaginationStyles {
|
|
25
|
+
const theme = useTheme();
|
|
26
|
+
|
|
27
|
+
return {
|
|
28
|
+
root: {},
|
|
29
|
+
rootInline: {
|
|
30
|
+
flexDirection: 'row',
|
|
31
|
+
alignItems: 'center',
|
|
32
|
+
},
|
|
33
|
+
rootAnchor: {
|
|
34
|
+
flexDirection: 'column',
|
|
35
|
+
},
|
|
36
|
+
items: {
|
|
37
|
+
flexDirection: 'row',
|
|
38
|
+
justifyContent: 'center',
|
|
39
|
+
marginTop: theme.spacing(2),
|
|
40
|
+
},
|
|
41
|
+
arrowContainer: {
|
|
42
|
+
flexDirection: 'column',
|
|
43
|
+
justifyContent: 'center',
|
|
44
|
+
},
|
|
45
|
+
prevInline: {
|
|
46
|
+
marginRight: theme.spacing(1),
|
|
47
|
+
},
|
|
48
|
+
prevAnchor: {
|
|
49
|
+
position: 'absolute',
|
|
50
|
+
left: -24,
|
|
51
|
+
},
|
|
52
|
+
nextInline: {
|
|
53
|
+
marginLeft: theme.spacing(1),
|
|
54
|
+
},
|
|
55
|
+
nextAnchor: {
|
|
56
|
+
position: 'absolute',
|
|
57
|
+
right: -24,
|
|
58
|
+
},
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
export default function Pagination(props: PaginationProps) {
|
|
63
|
+
const {
|
|
64
|
+
bundleSize = 1,
|
|
65
|
+
children,
|
|
66
|
+
count,
|
|
67
|
+
disabled = false,
|
|
68
|
+
hideIndicator = false,
|
|
69
|
+
hideNextButton = false,
|
|
70
|
+
hidePrevButton = false,
|
|
71
|
+
infinite = false,
|
|
72
|
+
onChange,
|
|
73
|
+
page,
|
|
74
|
+
renderItem = ({ index, ...rest }) => <PaginationItem key={`${index}`} {...rest}/>,
|
|
75
|
+
style,
|
|
76
|
+
...otherProps
|
|
77
|
+
} = props;
|
|
78
|
+
|
|
79
|
+
const styles = useStyles();
|
|
80
|
+
|
|
81
|
+
const firstPage = 0;
|
|
82
|
+
const lastPage = count - 1;
|
|
83
|
+
|
|
84
|
+
const handleChange = (nextPage: number) => {
|
|
85
|
+
if (nextPage >= firstPage && nextPage <= lastPage) {
|
|
86
|
+
if (onChange) {
|
|
87
|
+
onChange(nextPage);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
const handlePrevPress = () => {
|
|
93
|
+
const prevPage = page - bundleSize >= firstPage
|
|
94
|
+
? page - bundleSize
|
|
95
|
+
: (infinite ? count - bundleSize + page : firstPage);
|
|
96
|
+
|
|
97
|
+
handleChange(prevPage);
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
const handleNextPress = () => {
|
|
101
|
+
const nextPage = page + bundleSize <= lastPage
|
|
102
|
+
? page + bundleSize
|
|
103
|
+
: (infinite ? page + bundleSize - count : lastPage);
|
|
104
|
+
|
|
105
|
+
handleChange(nextPage);
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
const prevButton = !hidePrevButton ? (
|
|
109
|
+
<IconButton
|
|
110
|
+
color={'tertiary'}
|
|
111
|
+
disabled={disabled || (!infinite && page <= firstPage)}
|
|
112
|
+
onPress={handlePrevPress}
|
|
113
|
+
size={'small'}
|
|
114
|
+
style={children ? styles.prevAnchor : styles.prevInline}
|
|
115
|
+
>
|
|
116
|
+
<ChevronLeft/>
|
|
117
|
+
</IconButton>
|
|
118
|
+
) : null;
|
|
119
|
+
|
|
120
|
+
const nextButton = !hideNextButton ? (
|
|
121
|
+
<IconButton
|
|
122
|
+
color={'tertiary'}
|
|
123
|
+
disabled={disabled || (!infinite && page + bundleSize > lastPage)}
|
|
124
|
+
onPress={handleNextPress}
|
|
125
|
+
size={'small'}
|
|
126
|
+
style={children ? styles.nextAnchor : styles.nextInline}
|
|
127
|
+
>
|
|
128
|
+
<ChevronRight/>
|
|
129
|
+
</IconButton>
|
|
130
|
+
) : null;
|
|
131
|
+
|
|
132
|
+
const items = !hideIndicator ? (
|
|
133
|
+
times(i => renderItem({ index: i, disabled, selected: i === page }), count)
|
|
134
|
+
) : null;
|
|
135
|
+
|
|
136
|
+
const containerProps = {
|
|
137
|
+
style: css([
|
|
138
|
+
styles.root,
|
|
139
|
+
children ? styles.rootAnchor : styles.rootInline,
|
|
140
|
+
style,
|
|
141
|
+
]),
|
|
142
|
+
...otherProps,
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
if (children) {
|
|
146
|
+
return (
|
|
147
|
+
<View {...containerProps}>
|
|
148
|
+
<View style={css(styles.arrowContainer)}>
|
|
149
|
+
{children}
|
|
150
|
+
{prevButton}
|
|
151
|
+
{nextButton}
|
|
152
|
+
</View>
|
|
153
|
+
|
|
154
|
+
<View style={css(styles.items)}>
|
|
155
|
+
{items}
|
|
156
|
+
</View>
|
|
157
|
+
</View>
|
|
158
|
+
);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
return (
|
|
162
|
+
<View {...containerProps}>
|
|
163
|
+
{prevButton}
|
|
164
|
+
{items}
|
|
165
|
+
{nextButton}
|
|
166
|
+
</View>
|
|
167
|
+
);
|
|
168
|
+
};
|