fix add endIconClassName in button (#3893)
* fix add tooltip provider to tooltip * fix: add endIconClassNames support for button as startIcon has * fix: undo tooltip provder Co-authored-by: Agusti Fernandez Pardo <git@agusti.me> Co-authored-by: Peer Richelsen <peeroke@gmail.com>pull/3939/head
parent
4e73c4f7fb
commit
bfe780e0af
|
@ -14,6 +14,7 @@ export type ButtonBaseProps = {
|
||||||
StartIcon?: SVGComponent;
|
StartIcon?: SVGComponent;
|
||||||
startIconClassName?: string;
|
startIconClassName?: string;
|
||||||
EndIcon?: SVGComponent;
|
EndIcon?: SVGComponent;
|
||||||
|
endIconClassName?: string;
|
||||||
shallow?: boolean;
|
shallow?: boolean;
|
||||||
};
|
};
|
||||||
export type ButtonProps = ButtonBaseProps &
|
export type ButtonProps = ButtonBaseProps &
|
||||||
|
@ -32,6 +33,7 @@ export const Button = forwardRef<HTMLAnchorElement | HTMLButtonElement, ButtonPr
|
||||||
size = "base",
|
size = "base",
|
||||||
StartIcon,
|
StartIcon,
|
||||||
startIconClassName,
|
startIconClassName,
|
||||||
|
endIconClassName,
|
||||||
EndIcon,
|
EndIcon,
|
||||||
shallow,
|
shallow,
|
||||||
// attributes propagated from `HTMLAnchorProps` or `HTMLButtonProps`
|
// attributes propagated from `HTMLAnchorProps` or `HTMLButtonProps`
|
||||||
|
@ -130,7 +132,9 @@ export const Button = forwardRef<HTMLAnchorElement | HTMLButtonElement, ButtonPr
|
||||||
</svg>
|
</svg>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
{EndIcon && <EndIcon className="-mr-1 inline h-5 w-5 ltr:ml-2 rtl:mr-2" />}
|
{EndIcon && (
|
||||||
|
<EndIcon className={classNames("-mr-1 inline h-5 w-5 ltr:ml-2 rtl:mr-2", endIconClassName || "")} />
|
||||||
|
)}
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
return props.href ? (
|
return props.href ? (
|
||||||
|
|
Loading…
Reference in New Issue