From c4d5c6e8644176892053278f91957a3727ca71aa Mon Sep 17 00:00:00 2001 From: Arnaud Date: Thu, 22 Aug 2024 20:04:24 +0200 Subject: [PATCH] Add events to be tracked by the Storybook while interacting with the components --- src/components/Button/Button.tsx | 8 +++++ src/components/ButtonIcon/ButtonIcon.tsx | 8 +++++ src/components/Dropdown/Dropdown.tsx | 32 +++++++++++++++---- src/components/Input/Input.tsx | 12 +++++++ src/components/InputGroup/InputGroup.tsx | 18 ++++++++++- src/components/InputGroup/inputGroup.css | 2 +- src/components/Select/Select.tsx | 16 ++++++++++ src/components/Table/Table.tsx | 1 - src/components/Upload/Upload.tsx | 30 +++++++++++++++--- stories/Button.stories.ts | 6 +++- stories/ButtonIcon.stories.ts | 2 +- stories/Dropdown.stories.tsx | 40 +++++++++++++++++++----- stories/Input.stories.ts | 8 ++++- stories/InputGroup.stories.ts | 9 +++++- stories/Select.stories.ts | 8 ++++- stories/Stepper.stories.tsx | 12 +++++-- stories/Upload.stories.tsx | 32 ++++++++++++++++--- 17 files changed, 211 insertions(+), 33 deletions(-) diff --git a/src/components/Button/Button.tsx b/src/components/Button/Button.tsx index 63408f0..0cae94d 100644 --- a/src/components/Button/Button.tsx +++ b/src/components/Button/Button.tsx @@ -23,6 +23,10 @@ type Props = { onClick?: () => unknown | Promise; + onMouseEnter?: () => unknown | Promise; + + onMouseLeave?: () => unknown | Promise; + label: string; /** @@ -67,6 +71,8 @@ export function Button({ label, className = "", Icon, + onMouseEnter, + onMouseLeave, fetching = false, disabled = false, style, @@ -76,6 +82,8 @@ export function Button({ return (