From c5e5d9fa854e6f35e7751c0cffa99b6df45631f2 Mon Sep 17 00:00:00 2001 From: Nathan Vasse Date: Wed, 28 Feb 2024 14:34:05 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=9D(react)=20make=20color=20prop=20of?= =?UTF-8?q?=20Button=20appear=20in=20the=20doc?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This prop color was not appearing in the ArgTypes because it was an override attribute. Fixes #235 --- .../react/src/components/Button/index.tsx | 32 ++++++++++--------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/packages/react/src/components/Button/index.tsx b/packages/react/src/components/Button/index.tsx index c7739d4..a513e98 100644 --- a/packages/react/src/components/Button/index.tsx +++ b/packages/react/src/components/Button/index.tsx @@ -6,21 +6,23 @@ import React, { ReactNode, } from "react"; -export type ButtonProps = ButtonHTMLAttributes & - AnchorHTMLAttributes & { - color?: - | "primary" - | "primary-text" - | "secondary" - | "tertiary" - | "tertiary-text" - | "danger"; - size?: "medium" | "small" | "nano"; - icon?: ReactNode; - iconPosition?: "left" | "right"; - active?: boolean; - fullWidth?: boolean; - }; +type DomProps = ButtonHTMLAttributes & + AnchorHTMLAttributes; + +export type ButtonProps = Omit & { + size?: "medium" | "small" | "nano"; + color?: + | "primary" + | "primary-text" + | "secondary" + | "tertiary" + | "tertiary-text" + | "danger"; + icon?: ReactNode; + iconPosition?: "left" | "right"; + active?: boolean; + fullWidth?: boolean; +}; export type ButtonElement = HTMLButtonElement & HTMLAnchorElement;