From 7dcfdcaad615f01bf145ae2ada1f76f8d6790e31 Mon Sep 17 00:00:00 2001 From: Cyanideankst Date: Tue, 17 Oct 2023 01:30:32 +0300 Subject: [PATCH] add tooltip to button component --- .../stories/components/Button.stories.tsx | 4 ++- .../src/components/Button/Button.tsx | 30 ++++++++++++------- 2 files changed, 22 insertions(+), 12 deletions(-) diff --git a/apps/cyberstorm-storybook/stories/components/Button.stories.tsx b/apps/cyberstorm-storybook/stories/components/Button.stories.tsx index d590de25e..b349488c2 100644 --- a/apps/cyberstorm-storybook/stories/components/Button.stories.tsx +++ b/apps/cyberstorm-storybook/stories/components/Button.stories.tsx @@ -9,7 +9,9 @@ const meta = { component: Button.Root, } as Meta; -const defaultArgs = {}; +const defaultArgs = { + tooltipText: "tooltip text", +}; const Template: StoryFn = (args) => (
; style?: { [key: string]: string }; type?: "button" | "submit" | "reset"; + tooltipText?: string; } /** @@ -56,6 +59,7 @@ const Button = React.forwardRef< onClick, paddingSize = "medium", iconAlignment = "default", + tooltipText, ...forwardedProps } = props; @@ -79,17 +83,21 @@ const Button = React.forwardRef< const fRef = forwardedRef as React.ForwardedRef; const ref = fRef || fallbackRef; return ( - + + + + + ); } });