@fountain-ui/core 2.0.0-beta.93 → 2.0.0-beta.95
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/Dialog/Dialog.js +26 -50
- package/build/commonjs/Dialog/Dialog.js.map +1 -1
- package/build/commonjs/Dialog/DialogProps.js +7 -0
- package/build/commonjs/Dialog/DialogProps.js.map +1 -1
- package/build/commonjs/Dialog/LegacyDialog.js +181 -0
- package/build/commonjs/Dialog/LegacyDialog.js.map +1 -0
- package/build/commonjs/Dialog/LegacyDialogProps.js +2 -0
- package/build/commonjs/Dialog/LegacyDialogProps.js.map +1 -0
- package/build/commonjs/Dialog/index.js +2 -2
- package/build/commonjs/Dialog/index.js.map +1 -1
- package/build/commonjs/Dialog/useDialogStyle.js +81 -0
- package/build/commonjs/Dialog/useDialogStyle.js.map +1 -0
- package/build/commonjs/DialogActions/DialogActions.js +2 -2
- package/build/commonjs/DialogActions/DialogActions.js.map +1 -1
- package/build/commonjs/DialogActions/LegacyDialogActions.js +30 -0
- package/build/commonjs/DialogActions/LegacyDialogActions.js.map +1 -0
- package/build/commonjs/DialogActions/index.js +2 -2
- package/build/commonjs/DialogActions/index.js.map +1 -1
- package/build/commonjs/DialogContent/DialogContent.js +30 -11
- package/build/commonjs/DialogContent/DialogContent.js.map +1 -1
- package/build/commonjs/DialogContent/DialogContentProps.js.map +1 -1
- package/build/commonjs/DialogContent/LegacyDialogContent.js +36 -0
- package/build/commonjs/DialogContent/LegacyDialogContent.js.map +1 -0
- package/build/commonjs/DialogContent/LegacyDialogContentProps.js +2 -0
- package/build/commonjs/DialogContent/LegacyDialogContentProps.js.map +1 -0
- package/build/commonjs/DialogContent/index.js +2 -2
- package/build/commonjs/DialogContent/index.js.map +1 -1
- package/build/commonjs/DialogMedia/DialogMedia.js +24 -10
- package/build/commonjs/DialogMedia/DialogMedia.js.map +1 -1
- package/build/commonjs/DialogMedia/DialogMediaProps.js +7 -0
- package/build/commonjs/DialogMedia/DialogMediaProps.js.map +1 -1
- package/build/commonjs/DialogMedia/LegacyDialogMedia.js +33 -0
- package/build/commonjs/DialogMedia/LegacyDialogMedia.js.map +1 -0
- package/build/commonjs/DialogMedia/LegacyDialogMediaProps.js +2 -0
- package/build/commonjs/DialogMedia/LegacyDialogMediaProps.js.map +1 -0
- package/build/commonjs/DialogMedia/index.js +2 -2
- package/build/commonjs/DialogMedia/index.js.map +1 -1
- package/build/commonjs/DialogTitle/DialogTitle.js +27 -11
- package/build/commonjs/DialogTitle/DialogTitle.js.map +1 -1
- package/build/commonjs/DialogTitle/DialogTitleProps.js.map +1 -1
- package/build/commonjs/DialogTitle/LegacyDialogTitle.js +36 -0
- package/build/commonjs/DialogTitle/LegacyDialogTitle.js.map +1 -0
- package/build/commonjs/DialogTitle/LegacyDialogTitleProps.js +2 -0
- package/build/commonjs/DialogTitle/LegacyDialogTitleProps.js.map +1 -0
- package/build/commonjs/DialogTitle/index.js +2 -2
- package/build/commonjs/DialogTitle/index.js.map +1 -1
- 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/Dialog/Dialog.js +23 -52
- package/build/module/Dialog/Dialog.js.map +1 -1
- package/build/module/Dialog/DialogProps.js +1 -1
- package/build/module/Dialog/DialogProps.js.map +1 -1
- package/build/module/Dialog/LegacyDialog.js +160 -0
- package/build/module/Dialog/LegacyDialog.js.map +1 -0
- package/build/module/Dialog/LegacyDialogProps.js +2 -0
- package/build/module/Dialog/LegacyDialogProps.js.map +1 -0
- package/build/module/Dialog/index.js +1 -1
- package/build/module/Dialog/index.js.map +1 -1
- package/build/module/Dialog/useDialogStyle.js +71 -0
- package/build/module/Dialog/useDialogStyle.js.map +1 -0
- package/build/module/DialogActions/DialogActions.js +2 -2
- package/build/module/DialogActions/DialogActions.js.map +1 -1
- package/build/module/DialogActions/LegacyDialogActions.js +17 -0
- package/build/module/DialogActions/LegacyDialogActions.js.map +1 -0
- package/build/module/DialogActions/index.js +1 -1
- package/build/module/DialogActions/index.js.map +1 -1
- package/build/module/DialogContent/DialogContent.js +32 -11
- package/build/module/DialogContent/DialogContent.js.map +1 -1
- package/build/module/DialogContent/DialogContentProps.js.map +1 -1
- package/build/module/DialogContent/LegacyDialogContent.js +22 -0
- package/build/module/DialogContent/LegacyDialogContent.js.map +1 -0
- package/build/module/DialogContent/LegacyDialogContentProps.js +2 -0
- package/build/module/DialogContent/LegacyDialogContentProps.js.map +1 -0
- package/build/module/DialogContent/index.js +1 -1
- package/build/module/DialogContent/index.js.map +1 -1
- package/build/module/DialogMedia/DialogMedia.js +24 -10
- package/build/module/DialogMedia/DialogMedia.js.map +1 -1
- package/build/module/DialogMedia/DialogMediaProps.js +1 -1
- package/build/module/DialogMedia/DialogMediaProps.js.map +1 -1
- package/build/module/DialogMedia/LegacyDialogMedia.js +21 -0
- package/build/module/DialogMedia/LegacyDialogMedia.js.map +1 -0
- package/build/module/DialogMedia/LegacyDialogMediaProps.js +2 -0
- package/build/module/DialogMedia/LegacyDialogMediaProps.js.map +1 -0
- package/build/module/DialogMedia/index.js +1 -1
- package/build/module/DialogMedia/index.js.map +1 -1
- package/build/module/DialogTitle/DialogTitle.js +29 -11
- package/build/module/DialogTitle/DialogTitle.js.map +1 -1
- package/build/module/DialogTitle/DialogTitleProps.js.map +1 -1
- package/build/module/DialogTitle/LegacyDialogTitle.js +22 -0
- package/build/module/DialogTitle/LegacyDialogTitle.js.map +1 -0
- package/build/module/DialogTitle/LegacyDialogTitleProps.js +2 -0
- package/build/module/DialogTitle/LegacyDialogTitleProps.js.map +1 -0
- package/build/module/DialogTitle/index.js +1 -1
- package/build/module/DialogTitle/index.js.map +1 -1
- 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/Dialog/DialogProps.d.ts +7 -0
- package/build/typescript/Dialog/LegacyDialog.d.ts +3 -0
- package/build/typescript/Dialog/LegacyDialogProps.d.ts +25 -0
- package/build/typescript/Dialog/index.d.ts +2 -2
- package/build/typescript/Dialog/useDialogStyle.d.ts +6 -0
- package/build/typescript/DialogActions/LegacyDialogActions.d.ts +3 -0
- package/build/typescript/DialogActions/index.d.ts +1 -1
- package/build/typescript/DialogContent/DialogContentProps.d.ts +5 -5
- package/build/typescript/DialogContent/LegacyDialogContent.d.ts +3 -0
- package/build/typescript/DialogContent/LegacyDialogContentProps.d.ts +10 -0
- package/build/typescript/DialogContent/index.d.ts +2 -2
- package/build/typescript/DialogMedia/DialogMediaProps.d.ts +7 -10
- package/build/typescript/DialogMedia/LegacyDialogMedia.d.ts +3 -0
- package/build/typescript/DialogMedia/LegacyDialogMediaProps.d.ts +15 -0
- package/build/typescript/DialogMedia/index.d.ts +2 -2
- package/build/typescript/DialogTitle/DialogTitleProps.d.ts +2 -13
- package/build/typescript/DialogTitle/LegacyDialogTitle.d.ts +3 -0
- package/build/typescript/DialogTitle/LegacyDialogTitleProps.d.ts +15 -0
- package/build/typescript/DialogTitle/index.d.ts +2 -2
- 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 +3 -3
- 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/Dialog/Dialog.tsx +27 -69
- package/src/Dialog/DialogProps.ts +9 -0
- package/src/Dialog/LegacyDialog.tsx +198 -0
- package/src/Dialog/LegacyDialogProps.ts +28 -0
- package/src/Dialog/index.ts +2 -2
- package/src/Dialog/useDialogStyle.ts +90 -0
- package/src/DialogActions/DialogActions.tsx +2 -4
- package/src/DialogActions/LegacyDialogActions.tsx +23 -0
- package/src/DialogActions/index.ts +2 -2
- package/src/DialogContent/DialogContent.tsx +47 -16
- package/src/DialogContent/DialogContentProps.ts +5 -5
- package/src/DialogContent/LegacyDialogContent.tsx +30 -0
- package/src/DialogContent/LegacyDialogContentProps.ts +10 -0
- package/src/DialogContent/index.ts +2 -2
- package/src/DialogMedia/DialogMedia.tsx +35 -8
- package/src/DialogMedia/DialogMediaProps.ts +7 -10
- package/src/DialogMedia/LegacyDialogMedia.tsx +21 -0
- package/src/DialogMedia/LegacyDialogMediaProps.ts +16 -0
- package/src/DialogMedia/index.ts +2 -2
- package/src/DialogTitle/DialogTitle.tsx +46 -16
- package/src/DialogTitle/DialogTitleProps.ts +2 -14
- package/src/DialogTitle/LegacyDialogTitle.tsx +30 -0
- package/src/DialogTitle/LegacyDialogTitleProps.ts +16 -0
- package/src/DialogTitle/index.ts +2 -2
- 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
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
import React, { useImperativeHandle, useRef } from 'react';
|
|
2
|
+
import { Animated } from 'react-native';
|
|
3
|
+
import { css } from '../styles';
|
|
4
|
+
import { useAnimatedValue } from '../hooks';
|
|
5
|
+
import OutlinedTextField from './OutlinedTextField';
|
|
6
|
+
import { blurAnimationDuration, focusAnimationDuration } from './utils';
|
|
7
|
+
const TextField = /*#__PURE__*/React.forwardRef(function TextField(props, ref) {
|
|
8
|
+
const {
|
|
9
|
+
disabled = false,
|
|
10
|
+
error = false,
|
|
11
|
+
keyboardType = 'default',
|
|
12
|
+
icon,
|
|
13
|
+
label,
|
|
14
|
+
onBlur,
|
|
15
|
+
onChangeText,
|
|
16
|
+
onFocus,
|
|
17
|
+
onIconPress,
|
|
18
|
+
onSubmitEditing,
|
|
19
|
+
placeholder: placeholderProp,
|
|
20
|
+
secureTextEntry = false,
|
|
21
|
+
value,
|
|
22
|
+
style: styleProp
|
|
23
|
+
} = props;
|
|
24
|
+
const innerRef = useRef(null); //@ts-ignore
|
|
25
|
+
|
|
26
|
+
useImperativeHandle(ref, () => ({
|
|
27
|
+
focus: () => {
|
|
28
|
+
var _innerRef$current;
|
|
29
|
+
|
|
30
|
+
(_innerRef$current = innerRef.current) === null || _innerRef$current === void 0 ? void 0 : _innerRef$current.focus();
|
|
31
|
+
},
|
|
32
|
+
isFocused: () => {
|
|
33
|
+
const current = innerRef.current;
|
|
34
|
+
return current ? current.isFocused() : false;
|
|
35
|
+
},
|
|
36
|
+
clear: () => {
|
|
37
|
+
var _innerRef$current2;
|
|
38
|
+
|
|
39
|
+
(_innerRef$current2 = innerRef.current) === null || _innerRef$current2 === void 0 ? void 0 : _innerRef$current2.clear();
|
|
40
|
+
},
|
|
41
|
+
blur: () => {
|
|
42
|
+
var _innerRef$current3;
|
|
43
|
+
|
|
44
|
+
(_innerRef$current3 = innerRef.current) === null || _innerRef$current3 === void 0 ? void 0 : _innerRef$current3.blur();
|
|
45
|
+
},
|
|
46
|
+
setStyle: style => {
|
|
47
|
+
var _innerRef$current4;
|
|
48
|
+
|
|
49
|
+
(_innerRef$current4 = innerRef.current) === null || _innerRef$current4 === void 0 ? void 0 : _innerRef$current4.setNativeProps({
|
|
50
|
+
style
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
}));
|
|
54
|
+
const animatedLabel = useAnimatedValue(value ? 0 : 1);
|
|
55
|
+
const animatedError = useAnimatedValue(error ? 1 : 0);
|
|
56
|
+
const [focused, setFocused] = React.useState(false);
|
|
57
|
+
const [placeholder, setPlaceholder] = React.useState('');
|
|
58
|
+
const [labelLayout, setLabelLayout] = React.useState({
|
|
59
|
+
measured: false,
|
|
60
|
+
width: 0,
|
|
61
|
+
height: 0
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
const minimizeLabel = () => {
|
|
65
|
+
Animated.timing(animatedLabel, {
|
|
66
|
+
toValue: 0,
|
|
67
|
+
duration: blurAnimationDuration,
|
|
68
|
+
useNativeDriver: false
|
|
69
|
+
}).start();
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
const restoreLabel = () => {
|
|
73
|
+
Animated.timing(animatedLabel, {
|
|
74
|
+
toValue: 1,
|
|
75
|
+
duration: focusAnimationDuration,
|
|
76
|
+
useNativeDriver: false
|
|
77
|
+
}).start();
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
const showError = () => {
|
|
81
|
+
Animated.timing(animatedError, {
|
|
82
|
+
toValue: 1,
|
|
83
|
+
duration: focusAnimationDuration,
|
|
84
|
+
useNativeDriver: false
|
|
85
|
+
}).start();
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
const hideError = () => {
|
|
89
|
+
Animated.timing(animatedError, {
|
|
90
|
+
toValue: 0,
|
|
91
|
+
duration: blurAnimationDuration,
|
|
92
|
+
useNativeDriver: false
|
|
93
|
+
}).start();
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
const showPlaceholder = () => {
|
|
97
|
+
placeholderProp && setPlaceholder(placeholderProp);
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
const hidePlaceholder = () => setPlaceholder('');
|
|
101
|
+
|
|
102
|
+
React.useEffect(() => {
|
|
103
|
+
value || focused ? minimizeLabel() : restoreLabel();
|
|
104
|
+
}, [focused, value, labelLayout]);
|
|
105
|
+
React.useEffect(() => {
|
|
106
|
+
animatedError ? showError() : hideError();
|
|
107
|
+
}, [animatedError]);
|
|
108
|
+
React.useEffect(() => {
|
|
109
|
+
focused || !label ? showPlaceholder() : hidePlaceholder();
|
|
110
|
+
}, [focused, label]);
|
|
111
|
+
|
|
112
|
+
const handleFocus = event => {
|
|
113
|
+
if (disabled) {
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
setFocused(true);
|
|
118
|
+
onFocus === null || onFocus === void 0 ? void 0 : onFocus(event);
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
const handleBlur = event => {
|
|
122
|
+
setFocused(false);
|
|
123
|
+
onBlur === null || onBlur === void 0 ? void 0 : onBlur(event);
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
const style = css([{
|
|
127
|
+
opacity: disabled ? 0.3 : 1
|
|
128
|
+
}, styleProp]);
|
|
129
|
+
|
|
130
|
+
const handleLayoutAnimatedText = event => {
|
|
131
|
+
setLabelLayout({
|
|
132
|
+
width: event.nativeEvent.layout.width,
|
|
133
|
+
height: event.nativeEvent.layout.height,
|
|
134
|
+
measured: true
|
|
135
|
+
});
|
|
136
|
+
};
|
|
137
|
+
|
|
138
|
+
const forceFocus = () => {
|
|
139
|
+
var _innerRef$current5;
|
|
140
|
+
|
|
141
|
+
(_innerRef$current5 = innerRef.current) === null || _innerRef$current5 === void 0 ? void 0 : _innerRef$current5.focus();
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
return /*#__PURE__*/React.createElement(OutlinedTextField, {
|
|
145
|
+
animatedError: animatedError,
|
|
146
|
+
animatedLabel: animatedLabel,
|
|
147
|
+
disabled: disabled,
|
|
148
|
+
error: error,
|
|
149
|
+
focused: focused,
|
|
150
|
+
forceFocus: forceFocus,
|
|
151
|
+
icon: icon,
|
|
152
|
+
keyboardType: keyboardType,
|
|
153
|
+
label: label,
|
|
154
|
+
labelLayout: labelLayout,
|
|
155
|
+
onFocus: handleFocus,
|
|
156
|
+
onBlur: handleBlur,
|
|
157
|
+
onChangeText: onChangeText,
|
|
158
|
+
onIconPress: onIconPress,
|
|
159
|
+
onLayoutAnimatedText: handleLayoutAnimatedText,
|
|
160
|
+
onSubmitEditing: onSubmitEditing,
|
|
161
|
+
placeholder: placeholder,
|
|
162
|
+
ref: innerRef,
|
|
163
|
+
secureTextEntry: secureTextEntry,
|
|
164
|
+
style: style,
|
|
165
|
+
value: value
|
|
166
|
+
});
|
|
167
|
+
});
|
|
168
|
+
export default TextField;
|
|
169
|
+
//# sourceMappingURL=LegacyTextField.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","useImperativeHandle","useRef","Animated","css","useAnimatedValue","OutlinedTextField","blurAnimationDuration","focusAnimationDuration","TextField","forwardRef","props","ref","disabled","error","keyboardType","icon","label","onBlur","onChangeText","onFocus","onIconPress","onSubmitEditing","placeholder","placeholderProp","secureTextEntry","value","style","styleProp","innerRef","focus","current","isFocused","clear","blur","setStyle","setNativeProps","animatedLabel","animatedError","focused","setFocused","useState","setPlaceholder","labelLayout","setLabelLayout","measured","width","height","minimizeLabel","timing","toValue","duration","useNativeDriver","start","restoreLabel","showError","hideError","showPlaceholder","hidePlaceholder","useEffect","handleFocus","event","handleBlur","opacity","handleLayoutAnimatedText","nativeEvent","layout","forceFocus"],"sources":["LegacyTextField.tsx"],"sourcesContent":["import React, { useImperativeHandle, useRef } from 'react';\nimport { Animated, LayoutChangeEvent, NativeSyntheticEvent, TargetedEvent, TextInput } from 'react-native';\nimport { css } from '../styles';\nimport { useAnimatedValue } from '../hooks';\nimport OutlinedTextField from './OutlinedTextField';\nimport TextFieldProps, { setStyleProp } from './LegacyTextFieldProps';\nimport { blurAnimationDuration, focusAnimationDuration } from './utils';\n\nconst TextField = React.forwardRef<TextInput, TextFieldProps>(function TextField(props, ref) {\n const {\n disabled = false,\n error = false,\n keyboardType = 'default',\n icon,\n label,\n onBlur,\n onChangeText,\n onFocus,\n onIconPress,\n onSubmitEditing,\n placeholder: placeholderProp,\n secureTextEntry = false,\n value,\n style: styleProp,\n } = props;\n\n const innerRef = useRef<TextInput | null>(null);\n //@ts-ignore\n useImperativeHandle(ref, () => ({\n focus: () => {\n innerRef.current?.focus();\n },\n isFocused: () => {\n const current = innerRef.current;\n return current ? current.isFocused() : false;\n },\n clear: () => {\n innerRef.current?.clear();\n },\n blur: () => {\n innerRef.current?.blur();\n },\n setStyle: (style: setStyleProp) => {\n innerRef.current?.setNativeProps({\n style,\n });\n },\n }));\n\n const animatedLabel = useAnimatedValue(value ? 0 : 1);\n const animatedError = useAnimatedValue(error ? 1 : 0);\n const [focused, setFocused] = React.useState(false);\n const [placeholder, setPlaceholder] = React.useState('');\n const [labelLayout, setLabelLayout] = React.useState({\n measured: false,\n width: 0,\n height: 0,\n });\n\n const minimizeLabel = () => {\n Animated.timing(animatedLabel, {\n toValue: 0,\n duration: blurAnimationDuration,\n useNativeDriver: false,\n }).start();\n };\n\n const restoreLabel = () => {\n Animated.timing(animatedLabel, {\n toValue: 1,\n duration: focusAnimationDuration,\n useNativeDriver: false,\n }).start();\n };\n\n const showError = () => {\n Animated.timing(animatedError, {\n toValue: 1,\n duration: focusAnimationDuration,\n useNativeDriver: false,\n }).start();\n };\n\n const hideError = () => {\n Animated.timing(animatedError, {\n toValue: 0,\n duration: blurAnimationDuration,\n useNativeDriver: false,\n }).start();\n };\n\n const showPlaceholder = () => {\n placeholderProp && setPlaceholder(placeholderProp);\n };\n\n const hidePlaceholder = () => setPlaceholder('');\n\n React.useEffect(() => {\n value || focused ? minimizeLabel() : restoreLabel();\n }, [focused, value, labelLayout]);\n\n React.useEffect(() => {\n animatedError ? showError() : hideError();\n }, [animatedError]);\n\n React.useEffect(() => {\n focused || !label ? showPlaceholder() : hidePlaceholder();\n }, [focused, label]);\n\n const handleFocus = (event: NativeSyntheticEvent<TargetedEvent>) => {\n if (disabled) {\n return;\n }\n\n setFocused(true);\n onFocus?.(event);\n };\n\n const handleBlur = (event: NativeSyntheticEvent<TargetedEvent>) => {\n setFocused(false);\n onBlur?.(event);\n };\n\n const style = css([\n { opacity: disabled ? 0.3 : 1 },\n styleProp,\n ]);\n\n const handleLayoutAnimatedText = (event: LayoutChangeEvent) => {\n setLabelLayout({\n width: event.nativeEvent.layout.width,\n height: event.nativeEvent.layout.height,\n measured: true,\n });\n };\n\n const forceFocus = () => {\n innerRef.current?.focus();\n };\n\n return (\n <OutlinedTextField\n animatedError={animatedError}\n animatedLabel={animatedLabel}\n disabled={disabled}\n error={error}\n focused={focused}\n forceFocus={forceFocus}\n icon={icon}\n keyboardType={keyboardType}\n label={label}\n labelLayout={labelLayout}\n onFocus={handleFocus}\n onBlur={handleBlur}\n onChangeText={onChangeText}\n onIconPress={onIconPress}\n onLayoutAnimatedText={handleLayoutAnimatedText}\n onSubmitEditing={onSubmitEditing}\n placeholder={placeholder}\n ref={innerRef}\n secureTextEntry={secureTextEntry}\n style={style}\n value={value}\n />\n );\n});\n\nexport default TextField;\n"],"mappings":"AAAA,OAAOA,KAAP,IAAgBC,mBAAhB,EAAqCC,MAArC,QAAmD,OAAnD;AACA,SAASC,QAAT,QAA4F,cAA5F;AACA,SAASC,GAAT,QAAoB,WAApB;AACA,SAASC,gBAAT,QAAiC,UAAjC;AACA,OAAOC,iBAAP,MAA8B,qBAA9B;AAEA,SAASC,qBAAT,EAAgCC,sBAAhC,QAA8D,SAA9D;AAEA,MAAMC,SAAS,gBAAGT,KAAK,CAACU,UAAN,CAA4C,SAASD,SAAT,CAAmBE,KAAnB,EAA0BC,GAA1B,EAA+B;EACzF,MAAM;IACFC,QAAQ,GAAG,KADT;IAEFC,KAAK,GAAG,KAFN;IAGFC,YAAY,GAAG,SAHb;IAIFC,IAJE;IAKFC,KALE;IAMFC,MANE;IAOFC,YAPE;IAQFC,OARE;IASFC,WATE;IAUFC,eAVE;IAWFC,WAAW,EAAEC,eAXX;IAYFC,eAAe,GAAG,KAZhB;IAaFC,KAbE;IAcFC,KAAK,EAAEC;EAdL,IAeFjB,KAfJ;EAiBA,MAAMkB,QAAQ,GAAG3B,MAAM,CAAmB,IAAnB,CAAvB,CAlByF,CAmBzF;;EACAD,mBAAmB,CAACW,GAAD,EAAM,OAAO;IAC5BkB,KAAK,EAAE,MAAM;MAAA;;MACT,qBAAAD,QAAQ,CAACE,OAAT,wEAAkBD,KAAlB;IACH,CAH2B;IAI5BE,SAAS,EAAE,MAAM;MACb,MAAMD,OAAO,GA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;IAiBI,WAAW,EAAEC,WAjBjB;IAkBI,GAAG,EAAEM,QAlBT;IAmBI,eAAe,EAAEJ,eAnBrB;IAoBI,KAAK,EAAEE,KApBX;IAqBI,KAAK,EAAED;EArBX,EADJ;AAyBH,CA7JiB,CAAlB;AA+JA,eAAejB,SAAf"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["LegacyTextFieldProps.ts"],"sourcesContent":["import React from 'react';\nimport { NativeSyntheticEvent, TargetedEvent } from 'react-native';\nimport { ComponentProps } from '../types';\n\ntype TextFieldKeyboardType = 'default' | 'numeric' | 'email-address';\n\nexport interface setStyleProp {\n fontFamily: string;\n}\n\nexport default interface TextFieldProps extends ComponentProps<{\n /**\n * If true, user won't be able to interact with the component.\n * @default false\n */\n disabled?: boolean;\n\n /**\n * Whether to style the TextField with error style.\n * @default false\n */\n error?: boolean,\n\n /**\n * It is an icon placed to the right of the TextField.\n */\n icon?: React.ReactElement;\n\n /**\n * User can specify the keyboard type.\n * @default 'default'\n */\n keyboardType?: TextFieldKeyboardType;\n\n /**\n * The text to use for the floating label.\n */\n label?: string;\n\n /**\n * Callback that is called when the textField is blurred.\n */\n onBlur?: (event: NativeSyntheticEvent<TargetedEvent>) => void,\n\n /**\n * Callback that is called when the textField's text changes.\n */\n onChangeText?: (value: string) => void,\n\n /**\n * Callback that is called when the textField is focused.\n */\n onFocus?: (event: NativeSyntheticEvent<TargetedEvent>) => void,\n\n /**\n * Callback that is called when icon pressed.\n */\n onIconPress?: () => void;\n\n /**\n * Callback that is called when enter or submit key pressed.\n */\n onSubmitEditing?: () => void\n\n /**\n * Placeholder for textField.\n */\n placeholder?: string;\n\n /**\n * If true, the text input obscures the text entered so that sensitive text like passwords stay secure.\n * @default false\n */\n secureTextEntry?: boolean;\n\n /**\n * Value of the textField.\n */\n value?: string;\n}> {}\n"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","Platform","TextInput","View","createFontStyle","css","useTheme","IconButton","InputLabel","defaultHeight","iconSize","inputPaddingHorizontal","labelFontSize","labelPaddingTop","labelYOffset","useStyles","theme","outline","position","left","right","bottom","borderRadius","shape","roundness","input","flexGrow","paddingHorizontal","textAlignVertical","textAlign","zIndex","textField","iconContainer","width","height","justifyContent","alignItems","OutlinedTextField","forwardRef","props","ref","animatedError","animatedLabel","disabled","error","focused","forceFocus","icon","keyboardType","label","labelLayout","onBlur","onChangeText","onFocus","onIconPress","onLayoutAnimatedText","onSubmitEditing","placeholder","secureTextEntry","style","value","styles","hasActiveOutline","inputTextColor","palette","tertiary","main","primary","activeColor","warning","accent","placeholderColor","text","hint","outlineColor","border","default","errorColor","typography","body2","fontSize","unitless","labelScale","labelWidth","labelHeight","labelHalfWidth","labelHalfHeight","labelTranslateX","minInputHeight","inputHeight","topPosition","Math","floor","iconTopPosition","labelTranslateY","placeholderOpacity","interpolate","inputRange","outputRange","measured","labelProps","inputTextFontStyle","selector","typo","caption2","color","outlineStyle","borderWidth","borderColor","top","textInputStyle","marginRight","paddingRight","OS","outlineWidth","containerStyle","paddingTop","minHeight","iconContainerStyle","onIconButtonPress"],"sources":["OutlinedTextField.tsx"],"sourcesContent":["import React from 'react';\nimport { Animated, LayoutChangeEvent, Platform, TextInput, View } from 'react-native';\nimport { NamedStylesStringUnion, UseStyles } from '@fountain-ui/styles';\nimport { createFontStyle, css, useTheme } from '../styles';\nimport IconButton from '../IconButton';\nimport TextFieldProps from './TextFieldProps';\nimport InputLabel from './InputLabel';\nimport {\n defaultHeight,\n iconSize,\n inputPaddingHorizontal,\n labelFontSize,\n labelPaddingTop,\n labelYOffset,\n} from './utils';\n\ninterface OutlinedTextFieldProps extends TextFieldProps {\n animatedError: Animated.Value;\n animatedLabel: Animated.Value;\n focused: boolean;\n forceFocus: () => void;\n labelLayout: { measured: boolean; width: number; height: number };\n onLayoutAnimatedText: (event: LayoutChangeEvent) => void;\n}\n\ntype OutlinedTextFieldStyles = NamedStylesStringUnion<'outline' | 'input' | 'iconContainer'>;\n\nconst useStyles: UseStyles<OutlinedTextFieldStyles> = function (): OutlinedTextFieldStyles {\n const theme = useTheme();\n\n return {\n outline: {\n position: 'absolute',\n left: 0,\n right: 0,\n bottom: 0,\n borderRadius: theme.shape.roundness,\n },\n input: {\n flexGrow: 1,\n paddingHorizontal: inputPaddingHorizontal,\n textAlignVertical: 'center',\n textAlign: 'left',\n zIndex: theme.zIndex.textField,\n },\n iconContainer: {\n position: 'absolute',\n width: 24,\n height: 24,\n justifyContent: 'center',\n alignItems: 'center',\n right: 12,\n },\n };\n};\n\nconst OutlinedTextField = React.forwardRef<TextInput, OutlinedTextFieldProps>(function OutlinedTextField(props, ref) {\n const {\n animatedError,\n animatedLabel,\n disabled,\n error,\n focused,\n forceFocus,\n icon,\n keyboardType,\n label,\n labelLayout,\n onBlur,\n onChangeText,\n onFocus,\n onIconPress,\n onLayoutAnimatedText,\n onSubmitEditing,\n placeholder,\n secureTextEntry,\n style,\n value,\n } = props;\n\n const theme = useTheme();\n\n const styles = useStyles();\n\n const hasActiveOutline = focused || error;\n const inputTextColor = disabled ? theme.palette.tertiary.main : theme.palette.primary.main;\n const activeColor = error\n ? theme.palette.warning.main\n : disabled\n ? theme.palette.tertiary.main\n : theme.palette.accent.main;\n const placeholderColor = disabled ? theme.palette.tertiary.main : theme.palette.text.hint;\n const outlineColor = theme.palette.border.default;\n const errorColor = disabled ? theme.palette.tertiary.main : theme.palette.warning.main;\n\n const typography = theme.typography.body2;\n const fontSize = typography.fontSize.unitless;\n\n const labelScale = labelFontSize / fontSize;\n const labelWidth = labelLayout.width;\n const labelHeight = labelLayout.height;\n const labelHalfWidth = labelWidth / 2;\n const labelHalfHeight = labelHeight / 2;\n\n const labelTranslateX = -1 * (labelHalfWidth - (labelScale * labelWidth) / 2 - (fontSize - labelFontSize) * labelScale);\n const minInputHeight = defaultHeight - labelPaddingTop;\n const inputHeight = labelHeight < minInputHeight ? minInputHeight : labelHeight;\n const topPosition = Math.floor(((inputHeight > 0 ? inputHeight : 0) - labelHeight) / 2 + labelPaddingTop);\n const iconTopPosition = (defaultHeight - (label ? 0 : labelPaddingTop) - iconSize - (label ? labelYOffset : 0)) / 2;\n const labelTranslateY = -labelHalfHeight - (topPosition + labelYOffset);\n\n const placeholderOpacity = hasActiveOutline\n ? animatedLabel.interpolate({\n inputRange: [0, 1],\n outputRange: [hasActiveOutline ? 0 : 1, 1],\n })\n : labelLayout.measured ? 1 : 0;\n\n const labelProps = {\n activeColor,\n error,\n errorColor,\n fontSize,\n hasActiveOutline,\n label,\n labelScale,\n labelTranslateX,\n labelTranslateY,\n onLayoutAnimatedText,\n placeholderColor,\n placeholderOpacity,\n topPosition,\n };\n\n const inputTextFontStyle = createFontStyle(theme, {\n selector: (typo) => typo.caption2,\n color: inputTextColor,\n });\n\n const outlineStyle = css([\n styles.outline,\n {\n borderWidth: hasActiveOutline ? 2 : 1,\n borderColor: error ? errorColor : (hasActiveOutline ? activeColor : outlineColor),\n top: label ? 6 : 0,\n },\n ]);\n\n const textInputStyle = css([\n inputTextFontStyle,\n styles.input,\n {\n fontSize,\n color: inputTextColor,\n height: inputHeight,\n },\n icon && {\n marginRight: iconSize + 20,\n paddingRight: 0,\n },\n Platform.OS === 'web' && {\n //@ts-ignore\n outlineWidth: 0,\n },\n ]);\n\n const containerStyle = css([\n {\n paddingTop: label ? labelPaddingTop : 0,\n minHeight: label ? defaultHeight : defaultHeight + labelYOffset,\n },\n ]);\n\n const iconContainerStyle = css([\n styles.iconContainer,\n { top: iconTopPosition },\n ]);\n\n const onIconButtonPress = () => {\n forceFocus();\n onIconPress?.();\n };\n\n return (\n <View style={style}>\n <View\n pointerEvents={'none'}\n style={outlineStyle}\n />\n <View style={containerStyle}>\n {label ? (\n <InputLabel\n animatedLabel={animatedLabel}\n animatedError={animatedError}\n focused={focused}\n labelLayout={labelLayout}\n placeholder={placeholder}\n value={value}\n {...labelProps}\n />\n ) : null}\n <TextInput\n autoCapitalize={'none'}\n autoCorrect={false}\n disableFullscreenUI={true}\n ref={ref}\n onChangeText={onChangeText}\n placeholder={placeholder}\n placeholderTextColor={placeholderColor}\n editable={!disabled}\n selectionColor={activeColor}\n onFocus={onFocus}\n onBlur={onBlur}\n onSubmitEditing={onSubmitEditing}\n keyboardType={keyboardType}\n secureTextEntry={secureTextEntry}\n underlineColorAndroid={'transparent'}\n style={textInputStyle}\n value={value}\n />\n </View>\n {icon ? (\n <View style={iconContainerStyle}>\n <IconButton\n children={icon}\n onPress={onIconButtonPress}\n />\n </View>\n ) : null}\n </View>\n );\n});\n\nexport default OutlinedTextField;\n"],"mappings":";;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,SAAsCC,QAAtC,EAAgDC,SAAhD,EAA2DC,IAA3D,QAAuE,cAAvE;AAEA,SAASC,eAAT,EAA0BC,GAA1B,EAA+BC,QAA/B,QAA+C,WAA/C;AACA,OAAOC,UAAP,MAAuB,eAAvB;AAEA,OAAOC,UAAP,MAAuB,cAAvB;AACA,SACIC,aADJ,EAEIC,QAFJ,EAGIC,sBAHJ,EAIIC,aAJJ,EAKIC,eALJ,EAMIC,YANJ,QAOO,SAPP;;AAoBA,MAAMC,SAA6C,GAAG,YAAqC;EACvF,MAAMC,KAAK,GAAGV,QAAQ,EAAtB;EAEA,OAAO;IACHW,OAAO,EAAE;MACLC,QAAQ,EAAE,UADL;MAELC,IAAI,EAAE,CAFD;MAGLC,KAAK,EAAE,CAHF;MAILC,MAAM,EAAE,CAJH;MAKLC,YAAY,EAAEN,KAAK,CAACO,KAAN,CAAYC;IALrB,CADN;IAQHC,KAAK,EAAE;MACHC,QAAQ,EAAE,CADP;MAEHC,iBAAiB,EAAEhB,sBAFhB;MAGHiB,iBAAiB,EAAE,QAHhB;MAIHC,SAAS,EAAE,MAJR;MAKHC,MAAM,EAAEd,KAAK,CAACc,MAAN,CAAaC;IALlB,CARJ;IAeHC,aAAa,EAAE;MACXd,QAAQ,EAAE,UADC;MAEXe,KAAK,EAAE,EAFI;MA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,EAAEU,eAdrB;IAeI,qBAAqB,EAAE,aAf3B;IAgBI,KAAK,EAAEoD,cAhBX;IAiBI,KAAK,EAAElD;EAjBX,EAZJ,CALJ,EAqCKb,IAAI,gBACD,oBAAC,IAAD;IAAM,KAAK,EAAEuE;EAAb,gBACI,oBAAC,UAAD;IACI,QAAQ,EAAEvE,IADd;IAEI,OAAO,EAAEwE;EAFb,EADJ,CADC,GAOD,IA5CR,CADJ;AAgDH,CA/KyB,CAA1B;AAiLA,eAAelF,iBAAf"}
|
|
1
|
+
{"version":3,"names":["React","Platform","TextInput","View","createFontStyle","css","useTheme","IconButton","InputLabel","defaultHeight","iconSize","inputPaddingHorizontal","labelFontSize","labelPaddingTop","labelYOffset","useStyles","theme","outline","position","left","right","bottom","borderRadius","shape","roundness","input","flexGrow","paddingHorizontal","textAlignVertical","textAlign","zIndex","textField","iconContainer","width","height","justifyContent","alignItems","OutlinedTextField","forwardRef","props","ref","animatedError","animatedLabel","disabled","error","focused","forceFocus","icon","keyboardType","label","labelLayout","onBlur","onChangeText","onFocus","onIconPress","onLayoutAnimatedText","onSubmitEditing","placeholder","secureTextEntry","style","value","styles","hasActiveOutline","inputTextColor","palette","tertiary","main","primary","activeColor","warning","accent","placeholderColor","text","hint","outlineColor","border","default","errorColor","typography","body2","fontSize","unitless","labelScale","labelWidth","labelHeight","labelHalfWidth","labelHalfHeight","labelTranslateX","minInputHeight","inputHeight","topPosition","Math","floor","iconTopPosition","labelTranslateY","placeholderOpacity","interpolate","inputRange","outputRange","measured","labelProps","inputTextFontStyle","selector","typo","caption2","color","outlineStyle","borderWidth","borderColor","top","textInputStyle","marginRight","paddingRight","OS","outlineWidth","containerStyle","paddingTop","minHeight","iconContainerStyle","onIconButtonPress"],"sources":["OutlinedTextField.tsx"],"sourcesContent":["import React from 'react';\nimport { Animated, LayoutChangeEvent, Platform, TextInput, View } from 'react-native';\nimport { NamedStylesStringUnion, UseStyles } from '@fountain-ui/styles';\nimport { createFontStyle, css, useTheme } from '../styles';\nimport IconButton from '../IconButton';\nimport TextFieldProps from './LegacyTextFieldProps';\nimport InputLabel from './InputLabel';\nimport {\n defaultHeight,\n iconSize,\n inputPaddingHorizontal,\n labelFontSize,\n labelPaddingTop,\n labelYOffset,\n} from './utils';\n\ninterface OutlinedTextFieldProps extends TextFieldProps {\n animatedError: Animated.Value;\n animatedLabel: Animated.Value;\n focused: boolean;\n forceFocus: () => void;\n labelLayout: { measured: boolean; width: number; height: number };\n onLayoutAnimatedText: (event: LayoutChangeEvent) => void;\n}\n\ntype OutlinedTextFieldStyles = NamedStylesStringUnion<'outline' | 'input' | 'iconContainer'>;\n\nconst useStyles: UseStyles<OutlinedTextFieldStyles> = function (): OutlinedTextFieldStyles {\n const theme = useTheme();\n\n return {\n outline: {\n position: 'absolute',\n left: 0,\n right: 0,\n bottom: 0,\n borderRadius: theme.shape.roundness,\n },\n input: {\n flexGrow: 1,\n paddingHorizontal: inputPaddingHorizontal,\n textAlignVertical: 'center',\n textAlign: 'left',\n zIndex: theme.zIndex.textField,\n },\n iconContainer: {\n position: 'absolute',\n width: 24,\n height: 24,\n justifyContent: 'center',\n alignItems: 'center',\n right: 12,\n },\n };\n};\n\nconst OutlinedTextField = React.forwardRef<TextInput, OutlinedTextFieldProps>(function OutlinedTextField(props, ref) {\n const {\n animatedError,\n animatedLabel,\n disabled,\n error,\n focused,\n forceFocus,\n icon,\n keyboardType,\n label,\n labelLayout,\n onBlur,\n onChangeText,\n onFocus,\n onIconPress,\n onLayoutAnimatedText,\n onSubmitEditing,\n placeholder,\n secureTextEntry,\n style,\n value,\n } = props;\n\n const theme = useTheme();\n\n const styles = useStyles();\n\n const hasActiveOutline = focused || error;\n const inputTextColor = disabled ? theme.palette.tertiary.main : theme.palette.primary.main;\n const activeColor = error\n ? theme.palette.warning.main\n : disabled\n ? theme.palette.tertiary.main\n : theme.palette.accent.main;\n const placeholderColor = disabled ? theme.palette.tertiary.main : theme.palette.text.hint;\n const outlineColor = theme.palette.border.default;\n const errorColor = disabled ? theme.palette.tertiary.main : theme.palette.warning.main;\n\n const typography = theme.typography.body2;\n const fontSize = typography.fontSize.unitless;\n\n const labelScale = labelFontSize / fontSize;\n const labelWidth = labelLayout.width;\n const labelHeight = labelLayout.height;\n const labelHalfWidth = labelWidth / 2;\n const labelHalfHeight = labelHeight / 2;\n\n const labelTranslateX = -1 * (labelHalfWidth - (labelScale * labelWidth) / 2 - (fontSize - labelFontSize) * labelScale);\n const minInputHeight = defaultHeight - labelPaddingTop;\n const inputHeight = labelHeight < minInputHeight ? minInputHeight : labelHeight;\n const topPosition = Math.floor(((inputHeight > 0 ? inputHeight : 0) - labelHeight) / 2 + labelPaddingTop);\n const iconTopPosition = (defaultHeight - (label ? 0 : labelPaddingTop) - iconSize - (label ? labelYOffset : 0)) / 2;\n const labelTranslateY = -labelHalfHeight - (topPosition + labelYOffset);\n\n const placeholderOpacity = hasActiveOutline\n ? animatedLabel.interpolate({\n inputRange: [0, 1],\n outputRange: [hasActiveOutline ? 0 : 1, 1],\n })\n : labelLayout.measured ? 1 : 0;\n\n const labelProps = {\n activeColor,\n error,\n errorColor,\n fontSize,\n hasActiveOutline,\n label,\n labelScale,\n labelTranslateX,\n labelTranslateY,\n onLayoutAnimatedText,\n placeholderColor,\n placeholderOpacity,\n topPosition,\n };\n\n const inputTextFontStyle = createFontStyle(theme, {\n selector: (typo) => typo.caption2,\n color: inputTextColor,\n });\n\n const outlineStyle = css([\n styles.outline,\n {\n borderWidth: hasActiveOutline ? 2 : 1,\n borderColor: error ? errorColor : (hasActiveOutline ? activeColor : outlineColor),\n top: label ? 6 : 0,\n },\n ]);\n\n const textInputStyle = css([\n inputTextFontStyle,\n styles.input,\n {\n fontSize,\n color: inputTextColor,\n height: inputHeight,\n },\n icon && {\n marginRight: iconSize + 20,\n paddingRight: 0,\n },\n Platform.OS === 'web' && {\n //@ts-ignore\n outlineWidth: 0,\n },\n ]);\n\n const containerStyle = css([\n {\n paddingTop: label ? labelPaddingTop : 0,\n minHeight: label ? defaultHeight : defaultHeight + labelYOffset,\n },\n ]);\n\n const iconContainerStyle = css([\n styles.iconContainer,\n { top: iconTopPosition },\n ]);\n\n const onIconButtonPress = () => {\n forceFocus();\n onIconPress?.();\n };\n\n return (\n <View style={style}>\n <View\n pointerEvents={'none'}\n style={outlineStyle}\n />\n <View style={containerStyle}>\n {label ? (\n <InputLabel\n animatedLabel={animatedLabel}\n animatedError={animatedError}\n focused={focused}\n labelLayout={labelLayout}\n placeholder={placeholder}\n value={value}\n {...labelProps}\n />\n ) : null}\n <TextInput\n autoCapitalize={'none'}\n autoCorrect={false}\n disableFullscreenUI={true}\n ref={ref}\n onChangeText={onChangeText}\n placeholder={placeholder}\n placeholderTextColor={placeholderColor}\n editable={!disabled}\n selectionColor={activeColor}\n onFocus={onFocus}\n onBlur={onBlur}\n onSubmitEditing={onSubmitEditing}\n keyboardType={keyboardType}\n secureTextEntry={secureTextEntry}\n underlineColorAndroid={'transparent'}\n style={textInputStyle}\n value={value}\n />\n </View>\n {icon ? (\n <View style={iconContainerStyle}>\n <IconButton\n children={icon}\n onPress={onIconButtonPress}\n />\n </View>\n ) : null}\n </View>\n );\n});\n\nexport default OutlinedTextField;\n"],"mappings":";;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,SAAsCC,QAAtC,EAAgDC,SAAhD,EAA2DC,IAA3D,QAAuE,cAAvE;AAEA,SAASC,eAAT,EAA0BC,GAA1B,EAA+BC,QAA/B,QAA+C,WAA/C;AACA,OAAOC,UAAP,MAAuB,eAAvB;AAEA,OAAOC,UAAP,MAAuB,cAAvB;AACA,SACIC,aADJ,EAEIC,QAFJ,EAGIC,sBAHJ,EAIIC,aAJJ,EAKIC,eALJ,EAMIC,YANJ,QAOO,SAPP;;AAoBA,MAAMC,SAA6C,GAAG,YAAqC;EACvF,MAAMC,KAAK,GAAGV,QAAQ,EAAtB;EAEA,OAAO;IACHW,OAAO,EAAE;MACLC,QAAQ,EAAE,UADL;MAELC,IAAI,EAAE,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eAYI,oBAAC,SAAD;IACI,cAAc,EAAE,MADpB;IAEI,WAAW,EAAE,KAFjB;IAGI,mBAAmB,EAAE,IAHzB;IAII,GAAG,EAAE5D,GAJT;IAKI,YAAY,EAAEY,YALlB;IAMI,WAAW,EAAEK,WANjB;IAOI,oBAAoB,EAAEc,gBAP1B;IAQI,QAAQ,EAAE,CAAC5B,QARf;IASI,cAAc,EAAEyB,WATpB;IAUI,OAAO,EAAEf,OAVb;IAWI,MAAM,EAAEF,MAXZ;IAYI,eAAe,EAAEK,eAZrB;IAaI,YAAY,EAAER,YAblB;IAcI,eAAe,EAAEU,eAdrB;IAeI,qBAAqB,EAAE,aAf3B;IAgBI,KAAK,EAAEoD,cAhBX;IAiBI,KAAK,EAAElD;EAjBX,EAZJ,CALJ,EAqCKb,IAAI,gBACD,oBAAC,IAAD;IAAM,KAAK,EAAEuE;EAAb,gBACI,oBAAC,UAAD;IACI,QAAQ,EAAEvE,IADd;IAEI,OAAO,EAAEwE;EAFb,EADJ,CADC,GAOD,IA5CR,CADJ;AAgDH,CA/KyB,CAA1B;AAiLA,eAAelF,iBAAf"}
|
|
@@ -1,169 +1,129 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import
|
|
1
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
+
|
|
3
|
+
import React, { useState } from 'react';
|
|
4
|
+
import { Platform, StyleSheet, Text, TextInput, View } from 'react-native';
|
|
5
|
+
import { css } from '@fountain-ui/styles';
|
|
6
|
+
import IconButton from '../IconButton/IconButton';
|
|
7
|
+
import { Clear, EyeOff, EyeOn, LoadingSpinner, Search } from '../internal/icons';
|
|
8
|
+
import Row from '../Row';
|
|
9
|
+
import { createFontStyle, useTheme } from '../styles';
|
|
10
|
+
import useVariantStyleMap from './useVariantStyleMap';
|
|
11
|
+
const styles = StyleSheet.create({
|
|
12
|
+
root: {
|
|
13
|
+
alignItems: 'center',
|
|
14
|
+
flexGrow: 1
|
|
15
|
+
},
|
|
16
|
+
input: {
|
|
17
|
+
flexGrow: 1
|
|
18
|
+
},
|
|
19
|
+
secureToggleButton: {
|
|
20
|
+
alignItems: 'flex-end',
|
|
21
|
+
padding: 0
|
|
22
|
+
}
|
|
23
|
+
});
|
|
7
24
|
const TextField = /*#__PURE__*/React.forwardRef(function TextField(props, ref) {
|
|
8
25
|
const {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
26
|
+
autoFocus,
|
|
27
|
+
containerStyle: containerStyleProp,
|
|
28
|
+
editable = true,
|
|
29
|
+
hint,
|
|
30
|
+
isLoading,
|
|
14
31
|
onBlur,
|
|
15
|
-
onChangeText,
|
|
32
|
+
onChangeText: onChangeTextProp,
|
|
16
33
|
onFocus,
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
34
|
+
placeholderTextColor: placeholderTextColorProp,
|
|
35
|
+
secureTextEntry: secureTextEntryProp,
|
|
36
|
+
showClearButton: showClearButtonProp,
|
|
37
|
+
status = 'default',
|
|
38
|
+
style: styleProp,
|
|
39
|
+
title,
|
|
21
40
|
value,
|
|
22
|
-
|
|
41
|
+
variant = 'default',
|
|
42
|
+
...otherProps
|
|
23
43
|
} = props;
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
(_innerRef$current = innerRef.current) === null || _innerRef$current === void 0 ? void 0 : _innerRef$current.focus();
|
|
31
|
-
},
|
|
32
|
-
isFocused: () => {
|
|
33
|
-
const current = innerRef.current;
|
|
34
|
-
return current ? current.isFocused() : false;
|
|
35
|
-
},
|
|
36
|
-
clear: () => {
|
|
37
|
-
var _innerRef$current2;
|
|
38
|
-
|
|
39
|
-
(_innerRef$current2 = innerRef.current) === null || _innerRef$current2 === void 0 ? void 0 : _innerRef$current2.clear();
|
|
40
|
-
},
|
|
41
|
-
blur: () => {
|
|
42
|
-
var _innerRef$current3;
|
|
43
|
-
|
|
44
|
-
(_innerRef$current3 = innerRef.current) === null || _innerRef$current3 === void 0 ? void 0 : _innerRef$current3.blur();
|
|
45
|
-
},
|
|
46
|
-
setStyle: style => {
|
|
47
|
-
var _innerRef$current4;
|
|
48
|
-
|
|
49
|
-
(_innerRef$current4 = innerRef.current) === null || _innerRef$current4 === void 0 ? void 0 : _innerRef$current4.setNativeProps({
|
|
50
|
-
style
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
}));
|
|
54
|
-
const animatedLabel = useAnimatedValue(value ? 0 : 1);
|
|
55
|
-
const animatedError = useAnimatedValue(error ? 1 : 0);
|
|
56
|
-
const [focused, setFocused] = React.useState(false);
|
|
57
|
-
const [placeholder, setPlaceholder] = React.useState('');
|
|
58
|
-
const [labelLayout, setLabelLayout] = React.useState({
|
|
59
|
-
measured: false,
|
|
60
|
-
width: 0,
|
|
61
|
-
height: 0
|
|
62
|
-
});
|
|
63
|
-
|
|
64
|
-
const minimizeLabel = () => {
|
|
65
|
-
Animated.timing(animatedLabel, {
|
|
66
|
-
toValue: 0,
|
|
67
|
-
duration: blurAnimationDuration,
|
|
68
|
-
useNativeDriver: false
|
|
69
|
-
}).start();
|
|
70
|
-
};
|
|
71
|
-
|
|
72
|
-
const restoreLabel = () => {
|
|
73
|
-
Animated.timing(animatedLabel, {
|
|
74
|
-
toValue: 1,
|
|
75
|
-
duration: focusAnimationDuration,
|
|
76
|
-
useNativeDriver: false
|
|
77
|
-
}).start();
|
|
78
|
-
};
|
|
79
|
-
|
|
80
|
-
const showError = () => {
|
|
81
|
-
Animated.timing(animatedError, {
|
|
82
|
-
toValue: 1,
|
|
83
|
-
duration: focusAnimationDuration,
|
|
84
|
-
useNativeDriver: false
|
|
85
|
-
}).start();
|
|
86
|
-
};
|
|
87
|
-
|
|
88
|
-
const hideError = () => {
|
|
89
|
-
Animated.timing(animatedError, {
|
|
90
|
-
toValue: 0,
|
|
91
|
-
duration: blurAnimationDuration,
|
|
92
|
-
useNativeDriver: false
|
|
93
|
-
}).start();
|
|
94
|
-
};
|
|
44
|
+
const isSearch = variant === 'search';
|
|
45
|
+
const disabled = !editable || isLoading;
|
|
46
|
+
const theme = useTheme();
|
|
47
|
+
const [isFocused, setIsFocused] = useState(autoFocus ?? false);
|
|
48
|
+
const [secureTextEntry, setSecureTextEntry] = useState(secureTextEntryProp ?? false);
|
|
49
|
+
const variantStyles = useVariantStyleMap(variant, status, isFocused);
|
|
95
50
|
|
|
96
|
-
const
|
|
97
|
-
|
|
51
|
+
const handleBlur = event => {
|
|
52
|
+
setIsFocused(false);
|
|
53
|
+
onBlur === null || onBlur === void 0 ? void 0 : onBlur(event);
|
|
98
54
|
};
|
|
99
55
|
|
|
100
|
-
const hidePlaceholder = () => setPlaceholder('');
|
|
101
|
-
|
|
102
|
-
React.useEffect(() => {
|
|
103
|
-
value || focused ? minimizeLabel() : restoreLabel();
|
|
104
|
-
}, [focused, value, labelLayout]);
|
|
105
|
-
React.useEffect(() => {
|
|
106
|
-
animatedError ? showError() : hideError();
|
|
107
|
-
}, [animatedError]);
|
|
108
|
-
React.useEffect(() => {
|
|
109
|
-
focused || !label ? showPlaceholder() : hidePlaceholder();
|
|
110
|
-
}, [focused, label]);
|
|
111
|
-
|
|
112
56
|
const handleFocus = event => {
|
|
113
|
-
|
|
114
|
-
return;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
setFocused(true);
|
|
57
|
+
setIsFocused(true);
|
|
118
58
|
onFocus === null || onFocus === void 0 ? void 0 : onFocus(event);
|
|
119
59
|
};
|
|
120
60
|
|
|
121
|
-
const
|
|
122
|
-
|
|
123
|
-
onBlur === null || onBlur === void 0 ? void 0 : onBlur(event);
|
|
61
|
+
const handleSecureTogglePress = () => {
|
|
62
|
+
setSecureTextEntry(current => !current);
|
|
124
63
|
};
|
|
125
64
|
|
|
126
|
-
const
|
|
127
|
-
|
|
128
|
-
}, styleProp]);
|
|
129
|
-
|
|
130
|
-
const handleLayoutAnimatedText = event => {
|
|
131
|
-
setLabelLayout({
|
|
132
|
-
width: event.nativeEvent.layout.width,
|
|
133
|
-
height: event.nativeEvent.layout.height,
|
|
134
|
-
measured: true
|
|
135
|
-
});
|
|
65
|
+
const handleChangeText = text => {
|
|
66
|
+
onChangeTextProp === null || onChangeTextProp === void 0 ? void 0 : onChangeTextProp(text);
|
|
136
67
|
};
|
|
137
68
|
|
|
138
|
-
const
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
(_innerRef$current5 = innerRef.current) === null || _innerRef$current5 === void 0 ? void 0 : _innerRef$current5.focus();
|
|
69
|
+
const handleClear = () => {
|
|
70
|
+
handleChangeText('');
|
|
142
71
|
};
|
|
143
72
|
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
73
|
+
const showClearButton = showClearButtonProp ?? isSearch;
|
|
74
|
+
const titleFontStyle = createFontStyle(theme, {
|
|
75
|
+
// selector: (typography) => typography.caption1['semiBold']
|
|
76
|
+
color: theme.palette.text.strong
|
|
77
|
+
});
|
|
78
|
+
const inputStyle = css([styles.input, variantStyles.inputStyle, Platform.OS === 'web' ? {
|
|
79
|
+
outlineWidth: 0
|
|
80
|
+
} : {}, styleProp]);
|
|
81
|
+
const placeholderTextColor = placeholderTextColorProp ?? theme.palette.status.disabledLabel;
|
|
82
|
+
const containerStyle = css([styles.root, variantStyles.containerStyle, {
|
|
83
|
+
opacity: disabled ? 0.3 : 1
|
|
84
|
+
}, containerStyleProp]);
|
|
85
|
+
return /*#__PURE__*/React.createElement(View, null, title && !isSearch ? /*#__PURE__*/React.createElement(Text, {
|
|
86
|
+
children: title,
|
|
87
|
+
style: titleFontStyle
|
|
88
|
+
}) : null, /*#__PURE__*/React.createElement(Row, {
|
|
89
|
+
style: containerStyle
|
|
90
|
+
}, isSearch ? isLoading ? /*#__PURE__*/React.createElement(LoadingSpinner, null) : /*#__PURE__*/React.createElement(Search, {
|
|
91
|
+
color: 'base',
|
|
92
|
+
enableV2: true,
|
|
93
|
+
height: 18,
|
|
94
|
+
width: 18
|
|
95
|
+
}) : null, /*#__PURE__*/React.createElement(TextInput, _extends({
|
|
96
|
+
autoFocus: autoFocus,
|
|
97
|
+
editable: !disabled,
|
|
156
98
|
onBlur: handleBlur,
|
|
157
|
-
onChangeText:
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
placeholder: placeholder,
|
|
162
|
-
ref: innerRef,
|
|
99
|
+
onChangeText: handleChangeText,
|
|
100
|
+
onFocus: handleFocus,
|
|
101
|
+
placeholderTextColor: placeholderTextColor,
|
|
102
|
+
ref: ref,
|
|
163
103
|
secureTextEntry: secureTextEntry,
|
|
164
|
-
style:
|
|
104
|
+
style: inputStyle,
|
|
165
105
|
value: value
|
|
166
|
-
})
|
|
106
|
+
}, otherProps)), showClearButton && value !== null && value !== void 0 && value.length && value.length > 0 ? /*#__PURE__*/React.createElement(IconButton, {
|
|
107
|
+
color: 'base',
|
|
108
|
+
children: /*#__PURE__*/React.createElement(Clear, {
|
|
109
|
+
height: 13.75,
|
|
110
|
+
width: 15
|
|
111
|
+
}),
|
|
112
|
+
onPress: handleClear
|
|
113
|
+
}) : null, secureTextEntryProp && !isSearch ? /*#__PURE__*/React.createElement(IconButton, {
|
|
114
|
+
color: 'base',
|
|
115
|
+
onPress: handleSecureTogglePress,
|
|
116
|
+
style: styles.secureToggleButton
|
|
117
|
+
}, secureTextEntry ? /*#__PURE__*/React.createElement(EyeOff, {
|
|
118
|
+
height: 19,
|
|
119
|
+
width: 17.42
|
|
120
|
+
}) : /*#__PURE__*/React.createElement(EyeOn, {
|
|
121
|
+
height: 19,
|
|
122
|
+
width: 17.42
|
|
123
|
+
})) : null), hint && !isSearch ? /*#__PURE__*/React.createElement(Text, {
|
|
124
|
+
children: hint,
|
|
125
|
+
style: variantStyles.hintStyle
|
|
126
|
+
}) : null);
|
|
167
127
|
});
|
|
168
128
|
export default TextField;
|
|
169
129
|
//# sourceMappingURL=TextField.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useImperativeHandle","useRef","Animated","css","useAnimatedValue","OutlinedTextField","blurAnimationDuration","focusAnimationDuration","TextField","forwardRef","props","ref","disabled","error","keyboardType","icon","label","onBlur","onChangeText","onFocus","onIconPress","onSubmitEditing","placeholder","placeholderProp","secureTextEntry","value","style","styleProp","innerRef","focus","current","isFocused","clear","blur","setStyle","setNativeProps","animatedLabel","animatedError","focused","setFocused","useState","setPlaceholder","labelLayout","setLabelLayout","measured","width","height","minimizeLabel","timing","toValue","duration","useNativeDriver","start","restoreLabel","showError","hideError","showPlaceholder","hidePlaceholder","useEffect","handleFocus","event","handleBlur","opacity","handleLayoutAnimatedText","nativeEvent","layout","forceFocus"],"sources":["TextField.tsx"],"sourcesContent":["import React, { useImperativeHandle, useRef } from 'react';\nimport { Animated, LayoutChangeEvent, NativeSyntheticEvent, TargetedEvent, TextInput } from 'react-native';\nimport { css } from '../styles';\nimport { useAnimatedValue } from '../hooks';\nimport OutlinedTextField from './OutlinedTextField';\nimport TextFieldProps, { setStyleProp } from './TextFieldProps';\nimport { blurAnimationDuration, focusAnimationDuration } from './utils';\n\nconst TextField = React.forwardRef<TextInput, TextFieldProps>(function TextField(props, ref) {\n const {\n disabled = false,\n error = false,\n keyboardType = 'default',\n icon,\n label,\n onBlur,\n onChangeText,\n onFocus,\n onIconPress,\n onSubmitEditing,\n placeholder: placeholderProp,\n secureTextEntry = false,\n value,\n style: styleProp,\n } = props;\n\n const innerRef = useRef<TextInput | null>(null);\n //@ts-ignore\n useImperativeHandle(ref, () => ({\n focus: () => {\n innerRef.current?.focus();\n },\n isFocused: () => {\n const current = innerRef.current;\n return current ? current.isFocused() : false;\n },\n clear: () => {\n innerRef.current?.clear();\n },\n blur: () => {\n innerRef.current?.blur();\n },\n setStyle: (style: setStyleProp) => {\n innerRef.current?.setNativeProps({\n style,\n });\n },\n }));\n\n const animatedLabel = useAnimatedValue(value ? 0 : 1);\n const animatedError = useAnimatedValue(error ? 1 : 0);\n const [focused, setFocused] = React.useState(false);\n const [placeholder, setPlaceholder] = React.useState('');\n const [labelLayout, setLabelLayout] = React.useState({\n measured: false,\n width: 0,\n height: 0,\n });\n\n const minimizeLabel = () => {\n Animated.timing(animatedLabel, {\n toValue: 0,\n duration: blurAnimationDuration,\n useNativeDriver: false,\n }).start();\n };\n\n const restoreLabel = () => {\n Animated.timing(animatedLabel, {\n toValue: 1,\n duration: focusAnimationDuration,\n useNativeDriver: false,\n }).start();\n };\n\n const showError = () => {\n Animated.timing(animatedError, {\n toValue: 1,\n duration: focusAnimationDuration,\n useNativeDriver: false,\n }).start();\n };\n\n const hideError = () => {\n Animated.timing(animatedError, {\n toValue: 0,\n duration: blurAnimationDuration,\n useNativeDriver: false,\n }).start();\n };\n\n const showPlaceholder = () => {\n placeholderProp && setPlaceholder(placeholderProp);\n };\n\n const hidePlaceholder = () => setPlaceholder('');\n\n React.useEffect(() => {\n value || focused ? minimizeLabel() : restoreLabel();\n }, [focused, value, labelLayout]);\n\n React.useEffect(() => {\n animatedError ? showError() : hideError();\n }, [animatedError]);\n\n React.useEffect(() => {\n focused || !label ? showPlaceholder() : hidePlaceholder();\n }, [focused, label]);\n\n const handleFocus = (event: NativeSyntheticEvent<TargetedEvent>) => {\n if (disabled) {\n return;\n }\n\n setFocused(true);\n onFocus?.(event);\n };\n\n const handleBlur = (event: NativeSyntheticEvent<TargetedEvent>) => {\n setFocused(false);\n onBlur?.(event);\n };\n\n const style = css([\n { opacity: disabled ? 0.3 : 1 },\n styleProp,\n ]);\n\n const handleLayoutAnimatedText = (event: LayoutChangeEvent) => {\n setLabelLayout({\n width: event.nativeEvent.layout.width,\n height: event.nativeEvent.layout.height,\n measured: true,\n });\n };\n\n const forceFocus = () => {\n innerRef.current?.focus();\n };\n\n return (\n <OutlinedTextField\n animatedError={animatedError}\n animatedLabel={animatedLabel}\n disabled={disabled}\n error={error}\n focused={focused}\n forceFocus={forceFocus}\n icon={icon}\n keyboardType={keyboardType}\n label={label}\n labelLayout={labelLayout}\n onFocus={handleFocus}\n onBlur={handleBlur}\n onChangeText={onChangeText}\n onIconPress={onIconPress}\n onLayoutAnimatedText={handleLayoutAnimatedText}\n onSubmitEditing={onSubmitEditing}\n placeholder={placeholder}\n ref={innerRef}\n secureTextEntry={secureTextEntry}\n style={style}\n value={value}\n />\n );\n});\n\nexport default TextField;\n"],"mappings":"AAAA,OAAOA,KAAP,IAAgBC,mBAAhB,EAAqCC,MAArC,QAAmD,OAAnD;AACA,SAASC,QAAT,QAA4F,cAA5F;AACA,SAASC,GAAT,QAAoB,WAApB;AACA,SAASC,gBAAT,QAAiC,UAAjC;AACA,OAAOC,iBAAP,MAA8B,qBAA9B;AAEA,SAASC,qBAAT,EAAgCC,sBAAhC,QAA8D,SAA9D;AAEA,MAAMC,SAAS,gBAAGT,KAAK,CAACU,UAAN,CAA4C,SAASD,SAAT,CAAmBE,KAAnB,EAA0BC,GAA1B,EAA+B;EACzF,MAAM;IACFC,QAAQ,GAAG,KADT;IAEFC,KAAK,GAAG,KAFN;IAGFC,YAAY,GAAG,SAHb;IAIFC,IAJE;IAKFC,KALE;IAMFC,MANE;IAOFC,YAPE;IAQFC,OARE;IASFC,WATE;IAUFC,eAVE;IAWFC,WAAW,EAAEC,eAXX;IAYFC,eAAe,GAAG,KAZhB;IAaFC,KAbE;IAcFC,KAAK,EAAEC;EAdL,IAeFjB,KAfJ;EAiBA,MAAMkB,QAAQ,GAAG3B,MAAM,CAAmB,IAAnB,CAAvB,CAlByF,CAmBzF;;EACAD,mBAAmB,CAACW,GAAD,EAAM,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iB,WAXb;IAYI,MAAM,EAAEE,UAZZ;IAaI,YAAY,EAAE3C,YAblB;IAcI,WAAW,EAAEE,WAdjB;IAeI,oBAAoB,EAAE2C,wBAf1B;IAgBI,eAAe,EAAE1C,eAhBrB;IAiBI,WAAW,EAAEC,WAjBjB;IAkBI,GAAG,EAAEM,QAlBT;IAmBI,eAAe,EAAEJ,eAnBrB;IAoBI,KAAK,EAAEE,KApBX;IAqBI,KAAK,EAAED;EArBX,EADJ;AAyBH,CA7JiB,CAAlB;AA+JA,eAAejB,SAAf"}
|
|
1
|
+
{"version":3,"names":["React","useState","Platform","StyleSheet","Text","TextInput","View","css","IconButton","Clear","EyeOff","EyeOn","LoadingSpinner","Search","Row","createFontStyle","useTheme","useVariantStyleMap","styles","create","root","alignItems","flexGrow","input","secureToggleButton","padding","TextField","forwardRef","props","ref","autoFocus","containerStyle","containerStyleProp","editable","hint","isLoading","onBlur","onChangeText","onChangeTextProp","onFocus","placeholderTextColor","placeholderTextColorProp","secureTextEntry","secureTextEntryProp","showClearButton","showClearButtonProp","status","style","styleProp","title","value","variant","otherProps","isSearch","disabled","theme","isFocused","setIsFocused","setSecureTextEntry","variantStyles","handleBlur","event","handleFocus","handleSecureTogglePress","current","handleChangeText","text","handleClear","titleFontStyle","color","palette","strong","inputStyle","OS","outlineWidth","disabledLabel","opacity","length","hintStyle"],"sources":["TextField.tsx"],"sourcesContent":["import React, { useState } from 'react';\nimport type { NativeSyntheticEvent, TextInputFocusEventData } from 'react-native';\nimport { Platform, StyleSheet, Text, TextInput, View } from 'react-native';\nimport type { FountainUiStyle } from '@fountain-ui/styles';\nimport { css } from '@fountain-ui/styles';\nimport IconButton from '../IconButton/IconButton';\nimport { Clear, EyeOff, EyeOn, LoadingSpinner, Search } from '../internal/icons';\nimport Row from '../Row';\nimport { createFontStyle, useTheme } from '../styles';\nimport type TextFieldProps from './TextFieldProps';\nimport type { TextFieldStatus, TextFieldVariant } from './TextFieldProps';\nimport useVariantStyleMap from './useVariantStyleMap';\n\nconst styles = StyleSheet.create({\n root: {\n alignItems: 'center',\n flexGrow: 1,\n },\n input: {\n flexGrow: 1,\n },\n secureToggleButton: {\n alignItems: 'flex-end',\n padding: 0,\n },\n});\n\nconst TextField = React.forwardRef<TextInput, TextFieldProps>(function TextField(props, ref) {\n const {\n autoFocus,\n containerStyle: containerStyleProp,\n editable = true,\n hint,\n isLoading,\n onBlur,\n onChangeText: onChangeTextProp,\n onFocus,\n placeholderTextColor: placeholderTextColorProp,\n secureTextEntry: secureTextEntryProp,\n showClearButton: showClearButtonProp,\n status = 'default' as TextFieldStatus,\n style: styleProp,\n title,\n value,\n variant = 'default' as TextFieldVariant,\n ...otherProps\n } = props;\n\n const isSearch = variant === 'search';\n\n const disabled = !editable || isLoading;\n\n const theme = useTheme();\n\n const [isFocused, setIsFocused] = useState<boolean>(autoFocus ?? false);\n const [secureTextEntry, setSecureTextEntry] = useState<boolean>(secureTextEntryProp ?? false);\n\n const variantStyles = useVariantStyleMap(variant, status, isFocused);\n\n const handleBlur = (event: NativeSyntheticEvent<TextInputFocusEventData>) => {\n setIsFocused(false);\n onBlur?.(event);\n };\n\n const handleFocus = (event: NativeSyntheticEvent<TextInputFocusEventData>) => {\n setIsFocused(true);\n onFocus?.(event);\n };\n\n const handleSecureTogglePress = () => {\n setSecureTextEntry((current) => !current);\n };\n\n const handleChangeText = (text: string) => {\n onChangeTextProp?.(text);\n };\n\n const handleClear = () => {\n handleChangeText('');\n };\n\n const showClearButton = showClearButtonProp ?? isSearch;\n\n const titleFontStyle = createFontStyle(theme, {\n // selector: (typography) => typography.caption1['semiBold']\n color: theme.palette.text.strong,\n });\n\n const inputStyle = css([\n styles.input,\n variantStyles.inputStyle,\n Platform.OS === 'web' ? { outlineWidth: 0 } as FountainUiStyle : {},\n styleProp,\n ]);\n\n const placeholderTextColor = placeholderTextColorProp ?? theme.palette.status.disabledLabel;\n\n const containerStyle = css([\n styles.root,\n variantStyles.containerStyle,\n { opacity: disabled ? 0.3 : 1 },\n containerStyleProp,\n ]);\n\n return (\n <View>\n {title && !isSearch ? (\n <Text\n children={title}\n style={titleFontStyle}\n />\n ) : null}\n\n <Row style={containerStyle}>\n {isSearch ? (\n isLoading ? (\n <LoadingSpinner/>\n ) : (\n <Search\n color={'base'}\n enableV2={true}\n height={18}\n width={18}\n />\n )\n ) : null}\n\n <TextInput\n autoFocus={autoFocus}\n editable={!disabled}\n onBlur={handleBlur}\n onChangeText={handleChangeText}\n onFocus={handleFocus}\n placeholderTextColor={placeholderTextColor}\n ref={ref}\n secureTextEntry={secureTextEntry}\n style={inputStyle}\n value={value}\n {...otherProps}\n />\n\n {showClearButton && value?.length && value.length > 0 ? (\n <IconButton\n color={'base'}\n children={\n <Clear\n height={13.75}\n width={15}\n />\n }\n onPress={handleClear}\n />\n ) : null}\n\n {secureTextEntryProp && !isSearch ? (\n <IconButton\n color={'base'}\n onPress={handleSecureTogglePress}\n style={styles.secureToggleButton}\n >\n {secureTextEntry ? (\n <EyeOff\n height={19}\n width={17.42}\n />\n ) : (\n <EyeOn\n height={19}\n width={17.42}\n />\n )}\n </IconButton>\n ) : null}\n </Row>\n\n {hint && !isSearch ? (\n <Text\n children={hint}\n style={variantStyles.hintStyle}\n />\n ) : null}\n </View>\n );\n});\n\nexport default TextField;\n"],"mappings":";;AAAA,OAAOA,KAAP,IAAgBC,QAAhB,QAAgC,OAAhC;AAEA,SAASC,QAAT,EAAmBC,UAAnB,EAA+BC,IAA/B,EAAqCC,SAArC,EAAgDC,IAAhD,QAA4D,cAA5D;AAEA,SAASC,GAAT,QAAoB,qBAApB;AACA,OAAOC,UAAP,MAAuB,0BAAvB;AACA,SAASC,KAAT,EAAgBC,MAAhB,EAAwBC,KAAxB,EAA+BC,cAA/B,EAA+CC,MAA/C,QAA6D,mBAA7D;AACA,OAAOC,GAAP,MAAgB,QAAhB;AACA,SAASC,eAAT,EAA0BC,QAA1B,QAA0C,WAA1C;AAGA,OAAOC,kBAAP,MAA+B,sBAA/B;AAEA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;EAFX,EADY,gBAMZ,oBAAC,KAAD;IACI,MAAM,EAAE,EADZ;IAEI,KAAK,EAAE;EAFX,EAXR,CADH,GAkBG,IA3DR,CARJ,EAsEKR,IAAI,IAAI,CAACmB,QAAT,gBACG,oBAAC,IAAD;IACI,QAAQ,EAAEnB,IADd;IAEI,KAAK,EAAEyB,aAAa,CAACmB;EAFzB,EADH,GAKG,IA3ER,CADJ;AA+EH,CA5JiB,CAAlB;AA8JA,eAAepD,SAAf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["TextFieldProps.ts"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"names":["textFieldStatus","textFieldVariants"],"sources":["TextFieldProps.ts"],"sourcesContent":["import type { TextInputProps } from 'react-native';\nimport type { OverridableComponentProps } from '../types';\nimport { StyleProp, TextStyle } from 'react-native';\nimport { ExtendedStyle } from '../types';\n\nexport const textFieldStatus = ['default', 'success', 'error'] as const;\nexport type TextFieldStatus = typeof textFieldStatus[number];\n\nexport const textFieldVariants = ['default', 'search'] as const;\nexport type TextFieldVariant = typeof textFieldVariants[number];\n\nexport default interface TextFieldProps extends OverridableComponentProps<TextInputProps, {\n /**\n * Determines the style of the container that wraps the input.\n */\n containerStyle?: ExtendedStyle | ExtendedStyle[];\n\n /**\n * Determines the text below the input.\n */\n hint?: string;\n\n /**\n * Determines whether to display the spinner when in loading state. (only search)\n */\n isLoading?: boolean;\n\n /**\n * Determines whether to expose the Clear button.\n * @default variant === search ? true : false\n */\n showClearButton?: boolean;\n\n /**\n * Determines the input color based on the status.\n * @default default\n */\n status?: TextFieldStatus;\n\n /**\n * Determines the title of the input.\n */\n title?: string;\n\n /**\n * Determines the overall style and appearance of the input.\n * @default default\n */\n variant?: TextFieldVariant;\n}> {}\n"],"mappings":"AAKA,OAAO,MAAMA,eAAe,GAAG,CAAC,SAAD,EAAY,SAAZ,EAAuB,OAAvB,CAAxB;AAGP,OAAO,MAAMC,iBAAiB,GAAG,CAAC,SAAD,EAAY,QAAZ,CAA1B"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { default } from './
|
|
1
|
+
export { default } from './LegacyTextField';
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["default"],"sources":["index.tsx"],"sourcesContent":["export { default } from './
|
|
1
|
+
{"version":3,"names":["default"],"sources":["index.tsx"],"sourcesContent":["export { default } from './LegacyTextField';\nexport type { default as TextFieldProps } from './LegacyTextFieldProps';\n"],"mappings":"AAAA,SAASA,OAAT,QAAwB,mBAAxB"}
|