From bcf9348bf40c69228f6d3a1f828dbd162057f43c Mon Sep 17 00:00:00 2001 From: literat Date: Fri, 3 Nov 2023 13:49:52 +0100 Subject: [PATCH] Fix(web-react): Add missing exports for Tooltip components --- packages/web-react/src/components/Tooltip/Tooltip.tsx | 4 ++-- .../src/components/Tooltip/TooltipCloseButton.tsx | 2 +- .../web-react/src/components/Tooltip/TooltipWrapper.tsx | 4 ++-- .../src/components/Tooltip/UncontrolledTooltip.tsx | 2 +- packages/web-react/src/components/Tooltip/index.ts | 9 +++++---- 5 files changed, 11 insertions(+), 10 deletions(-) diff --git a/packages/web-react/src/components/Tooltip/Tooltip.tsx b/packages/web-react/src/components/Tooltip/Tooltip.tsx index d71ae654e9..3f9ef40e35 100644 --- a/packages/web-react/src/components/Tooltip/Tooltip.tsx +++ b/packages/web-react/src/components/Tooltip/Tooltip.tsx @@ -1,11 +1,11 @@ -import React, { useMemo, forwardRef, LegacyRef } from 'react'; import classNames from 'classnames'; +import React, { LegacyRef, forwardRef, useMemo } from 'react'; import { useStyleProps } from '../../hooks'; import { SpiritTooltipProps } from '../../types'; import TooltipCloseButton from './TooltipCloseButton'; import { useTooltipStyleProps } from './useTooltipStyleProps'; -const Tooltip = forwardRef((props: SpiritTooltipProps, ref) => { +export const Tooltip = forwardRef((props: SpiritTooltipProps, ref) => { const { children, isDismissible, closeLabel = 'Close', open, onClose, ...restProps } = props; const { classProps, props: modifiedProps } = useTooltipStyleProps({ diff --git a/packages/web-react/src/components/Tooltip/TooltipCloseButton.tsx b/packages/web-react/src/components/Tooltip/TooltipCloseButton.tsx index 60f739ed59..66e4235e51 100644 --- a/packages/web-react/src/components/Tooltip/TooltipCloseButton.tsx +++ b/packages/web-react/src/components/Tooltip/TooltipCloseButton.tsx @@ -6,7 +6,7 @@ import { Icon } from '../Icon'; import { VisuallyHidden } from '../VisuallyHidden'; import { useTooltipStyleProps } from './useTooltipStyleProps'; -const TooltipCloseButton = ({ label = 'Close', onClick, ...restProps }: TooltipCloseButtonProps) => { +export const TooltipCloseButton = ({ label = 'Close', onClick, ...restProps }: TooltipCloseButtonProps) => { const { classProps, props: modifiedProps } = useTooltipStyleProps({ ...restProps }); const { styleProps } = useStyleProps({ ...modifiedProps }); diff --git a/packages/web-react/src/components/Tooltip/TooltipWrapper.tsx b/packages/web-react/src/components/Tooltip/TooltipWrapper.tsx index fcb5eaa91a..f7c4d31e96 100644 --- a/packages/web-react/src/components/Tooltip/TooltipWrapper.tsx +++ b/packages/web-react/src/components/Tooltip/TooltipWrapper.tsx @@ -1,10 +1,10 @@ -import React from 'react'; import classNames from 'classnames'; +import React from 'react'; import { useStyleProps } from '../../hooks'; import { TooltipWrapperProps } from '../../types'; import { useTooltipStyleProps } from './useTooltipStyleProps'; -const TooltipWrapper = ({ children, ...restProps }: TooltipWrapperProps) => { +export const TooltipWrapper = ({ children, ...restProps }: TooltipWrapperProps) => { const { classProps, props: modifiedProps } = useTooltipStyleProps({ ...restProps }); const { styleProps } = useStyleProps({ ...modifiedProps }); diff --git a/packages/web-react/src/components/Tooltip/UncontrolledTooltip.tsx b/packages/web-react/src/components/Tooltip/UncontrolledTooltip.tsx index a4072a16cf..4a54c7e0d3 100644 --- a/packages/web-react/src/components/Tooltip/UncontrolledTooltip.tsx +++ b/packages/web-react/src/components/Tooltip/UncontrolledTooltip.tsx @@ -3,7 +3,7 @@ import { UncontrolledTooltipProps } from '../../types'; import Tooltip from './Tooltip'; import { useTooltip } from './useTooltip'; -const UncontrolledTooltip = (props: UncontrolledTooltipProps) => { +export const UncontrolledTooltip = (props: UncontrolledTooltipProps) => { const { children, isDismissible, ...restProps } = props; const { open, onClose } = useTooltip({ isDismissible }); diff --git a/packages/web-react/src/components/Tooltip/index.ts b/packages/web-react/src/components/Tooltip/index.ts index a4cd67bb78..211af3a55e 100644 --- a/packages/web-react/src/components/Tooltip/index.ts +++ b/packages/web-react/src/components/Tooltip/index.ts @@ -1,9 +1,10 @@ export * from './Tooltip'; -export * from './TooltipWrapper'; +export { default as Tooltip } from './Tooltip'; export * from './TooltipCloseButton'; +export { default as TooltipCloseButton } from './TooltipCloseButton'; +export * from './TooltipWrapper'; +export { default as TooltipWrapper } from './TooltipWrapper'; export * from './UncontrolledTooltip'; +export { default as UncontrolledTooltip } from './UncontrolledTooltip'; export * from './useTooltip'; export * from './useTooltipStyleProps'; -export { default as Tooltip } from './Tooltip'; -export { default as TooltipWrapper } from './TooltipWrapper'; -export { default as UncontrolledTooltip } from './UncontrolledTooltip';