🩹(react) export Button props

In some cases we need the props of a component to be exported,
to be able to use them in other components. This commit exports
the props of the Button component.
This commit is contained in:
Anthony Le Courric
2023-10-04 17:04:14 +02:00
committed by Anthony LC
parent b5c91d429d
commit cf3a589d7f
2 changed files with 7 additions and 2 deletions

View File

@@ -0,0 +1,5 @@
---
"@openfun/cunningham-react": minor
---
Export Button props

View File

@@ -1,6 +1,6 @@
import React, { ButtonHTMLAttributes, forwardRef, ReactNode } from "react";
interface Props extends ButtonHTMLAttributes<HTMLButtonElement> {
export interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
color?: "primary" | "secondary" | "tertiary" | "danger";
size?: "medium" | "small" | "nano";
icon?: ReactNode;
@@ -9,7 +9,7 @@ interface Props extends ButtonHTMLAttributes<HTMLButtonElement> {
fullWidth?: boolean;
}
export const Button = forwardRef<HTMLButtonElement, Props>(
export const Button = forwardRef<HTMLButtonElement, ButtonProps>(
(
{
children,