From cf3a589d7f86abad78efb56efdc91892c259aa0c Mon Sep 17 00:00:00 2001 From: Anthony Le Courric Date: Wed, 4 Oct 2023 17:04:14 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=A9=B9(react)=20export=20Button=20props?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- .changeset/tough-toys-obey.md | 5 +++++ packages/react/src/components/Button/index.tsx | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 .changeset/tough-toys-obey.md diff --git a/.changeset/tough-toys-obey.md b/.changeset/tough-toys-obey.md new file mode 100644 index 0000000..87798a3 --- /dev/null +++ b/.changeset/tough-toys-obey.md @@ -0,0 +1,5 @@ +--- +"@openfun/cunningham-react": minor +--- + +Export Button props diff --git a/packages/react/src/components/Button/index.tsx b/packages/react/src/components/Button/index.tsx index f4a7edb..7ecf8dd 100644 --- a/packages/react/src/components/Button/index.tsx +++ b/packages/react/src/components/Button/index.tsx @@ -1,6 +1,6 @@ import React, { ButtonHTMLAttributes, forwardRef, ReactNode } from "react"; -interface Props extends ButtonHTMLAttributes { +export interface ButtonProps extends ButtonHTMLAttributes { color?: "primary" | "secondary" | "tertiary" | "danger"; size?: "medium" | "small" | "nano"; icon?: ReactNode; @@ -9,7 +9,7 @@ interface Props extends ButtonHTMLAttributes { fullWidth?: boolean; } -export const Button = forwardRef( +export const Button = forwardRef( ( { children,