diff --git a/src/components/tools/Popper/Popper.tsx b/src/components/tools/Popper/Popper.tsx index 65f6d51b..9acc6e3f 100644 --- a/src/components/tools/Popper/Popper.tsx +++ b/src/components/tools/Popper/Popper.tsx @@ -21,7 +21,19 @@ export type PopperProps = { customRootClass?: string; activationStrategy?: 'hover'; className?: string; - placement?: 'top' | 'bottom' | 'bottom-start'; // TODO: fix + placement?: + | 'top' + | 'bottom' + | 'left' + | 'right' + | 'top-start' + | 'top-end' + | 'bottom-start' + | 'bottom-end' + | 'left-start' + | 'left-end' + | 'right-start' + | 'right-end'; children?: React.ReactNode; // TODO: fix open?: boolean; hoverDelay?: number; diff --git a/src/components/ui/Tooltip/Tooltip.tsx b/src/components/ui/Tooltip/Tooltip.tsx index c02937b2..c59f435e 100644 --- a/src/components/ui/Tooltip/Tooltip.tsx +++ b/src/components/ui/Tooltip/Tooltip.tsx @@ -1,5 +1,4 @@ import React from 'react'; - import Popper from '~/components/tools/Popper/Popper'; const COMPONENT_NAME = 'Tooltip'; @@ -7,13 +6,35 @@ const COMPONENT_NAME = 'Tooltip'; type TooltipProps = { children: React.ReactNode; label: string; + placement?: + | 'top' + | 'bottom' + | 'left' + | 'right' + | 'top-start' + | 'top-end' + | 'bottom-start' + | 'bottom-end' + | 'left-start' + | 'left-end' + | 'right-start' + | 'right-end'; [key: string]: any; }; -const Tooltip = ({ children, label, ...props }:TooltipProps) => { - return
- {children} -
; +const Tooltip = ({ children, label="hello", placement = 'top', ...props }: TooltipProps) => { + return ( +
+ + {children} + +
+ ); }; export default Tooltip; diff --git a/src/components/ui/Tooltip/stories/Tooltip.stories.js b/src/components/ui/Tooltip/stories/Tooltip.stories.js index a3df3903..5cb3003f 100644 --- a/src/components/ui/Tooltip/stories/Tooltip.stories.js +++ b/src/components/ui/Tooltip/stories/Tooltip.stories.js @@ -8,7 +8,7 @@ export default { component: Tooltip, render: (args) => - + Hello, hover me!