Skip to content

Commit 28d038c

Browse files
Shrey DhyaniShrey Dhyani
authored andcommitted
Added onMouseEnter, onMouseLeave, onFocus and onBlur event to ButtonBase
1 parent f43d419 commit 28d038c

3 files changed

Lines changed: 1073 additions & 27 deletions

File tree

apps/storybook/src/stories/atoms/Buttons.stories.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
import React from 'react';
22
import { ComponentStory, ComponentMeta } from '@storybook/react';
33
import { ButtonBase } from '@reusejs/react';
4-
import {
5-
CheckCircleIcon,
6-
} from '@heroicons/react/solid';
4+
import { CheckCircleIcon } from '@heroicons/react/solid';
75

86
export default {
97
title: 'Atoms/Buttons',

packages/react/src/atoms/buttons/base.tsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ export interface ButtonBaseProps {
2626
disabledClasses?: any;
2727
};
2828
onClick?: () => void;
29+
onMouseEnter?: () => void;
30+
onMouseLeave?: () => void;
31+
onFocus?: () => void;
32+
onBlur?: () => void;
2933
}
3034

3135
const ButtonBase = (props: ButtonBaseProps) => {
@@ -49,13 +53,19 @@ const ButtonBase = (props: ButtonBaseProps) => {
4953
theme
5054
);
5155

56+
console.log("Props>>>>>>>>", props);
57+
5258
return (
5359
<button
5460
type={props.type}
5561
className={finalClassNames}
5662
style={props.buttonStyles}
5763
onClick={props.onClick}
5864
disabled={props.disabled || props.busy}
65+
onMouseEnter={props.onMouseEnter}
66+
onMouseLeave={props.onMouseLeave}
67+
onFocus={props.onFocus}
68+
onBlur={props.onBlur}
5969
>
6070
{props.buttonPrefix && props.buttonPrefix}
6171
{props.busy && <>{props.busyText}</>}

0 commit comments

Comments
 (0)