Skip to content

Commit

Permalink
Acutally fix types for Button component mouse and focus events (#979)
Browse files Browse the repository at this point in the history
  • Loading branch information
danoc authored Apr 3, 2024
1 parent 70a3f4b commit eeecac7
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 12 deletions.
4 changes: 4 additions & 0 deletions packages/thumbprint-react/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## Unreleased

### Fixed

- [Patch] Acutally fix types for Button component mouse and focus events

## 14.18.1 - 2024-04-03

### Fixed
Expand Down
24 changes: 12 additions & 12 deletions packages/thumbprint-react/components/Button/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,28 +100,28 @@ export interface TextButtonProps {
/**
* Function that will run when the button is clicked on.
*/
onClick?: () => void;
onClick?: (e: React.MouseEvent<HTMLElement>) => void;
/**
* Function that runs when the user hovers on the button.
*/
onMouseEnter?: () => void;
onMouseEnter?: (e: React.MouseEvent<HTMLElement>) => void;
/**
* Function that runs when the user hovers on the button. Unlike `onMouseEnter`, `onMouseOver`
* fires each time a child element receives focus.
*/
onMouseOver?: () => void;
onMouseOver?: (e: React.MouseEvent<HTMLElement>) => void;
/**
* Function that runs when the button receives focus.
*/
onFocus?: () => void;
onFocus?: (e: React.FocusEvent<HTMLElement>) => void;
/**
* Function that runs when the user hovers away from the button.
*/
onMouseLeave?: () => void;
onMouseLeave?: (e: React.MouseEvent<HTMLElement>) => void;
/**
* Function that runs when the button loses focus.
*/
onBlur?: () => void;
onBlur?: (e: React.FocusEvent<HTMLElement>) => void;
/**
* Description of the button’s content. It is required if the button has an icon and no
* descriptive text.
Expand Down Expand Up @@ -233,28 +233,28 @@ export interface ButtonProps {
/**
* Function that will run when the button is clicked on.
*/
onClick?: () => void;
onClick?: (e: React.MouseEvent<HTMLElement>) => void;
/**
* Function that runs when the user hovers on the button.
*/
onMouseEnter?: () => void;
onMouseEnter?: (e: React.MouseEvent<HTMLElement>) => void;
/**
* Function that runs when the user hovers on the button. Unlike `onMouseEnter`, `onMouseOver`
* fires each time a child element receives focus.
*/
onMouseOver?: () => void;
onMouseOver?: (e: React.MouseEvent<HTMLElement>) => void;
/**
* Function that runs when the button receives focus.
*/
onFocus?: () => void;
onFocus?: (e: React.FocusEvent<HTMLElement>) => void;
/**
* Function that runs when the user hovers away from the button.
*/
onMouseLeave?: () => void;
onMouseLeave?: (e: React.MouseEvent<HTMLElement>) => void;
/**
* Function that runs when the button loses focus.
*/
onBlur?: () => void;
onBlur?: (e: React.FocusEvent<HTMLElement>) => void;
/**
* Controls the button’s background, text, and border color.
*/
Expand Down

0 comments on commit eeecac7

Please sign in to comment.