🩹(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:
committed by
Anthony LC
parent
b5c91d429d
commit
cf3a589d7f
5
.changeset/tough-toys-obey.md
Normal file
5
.changeset/tough-toys-obey.md
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
"@openfun/cunningham-react": minor
|
||||||
|
---
|
||||||
|
|
||||||
|
Export Button props
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
import React, { ButtonHTMLAttributes, forwardRef, ReactNode } from "react";
|
import React, { ButtonHTMLAttributes, forwardRef, ReactNode } from "react";
|
||||||
|
|
||||||
interface Props extends ButtonHTMLAttributes<HTMLButtonElement> {
|
export interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
||||||
color?: "primary" | "secondary" | "tertiary" | "danger";
|
color?: "primary" | "secondary" | "tertiary" | "danger";
|
||||||
size?: "medium" | "small" | "nano";
|
size?: "medium" | "small" | "nano";
|
||||||
icon?: ReactNode;
|
icon?: ReactNode;
|
||||||
@@ -9,7 +9,7 @@ interface Props extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|||||||
fullWidth?: boolean;
|
fullWidth?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const Button = forwardRef<HTMLButtonElement, Props>(
|
export const Button = forwardRef<HTMLButtonElement, ButtonProps>(
|
||||||
(
|
(
|
||||||
{
|
{
|
||||||
children,
|
children,
|
||||||
|
|||||||
Reference in New Issue
Block a user