From 72fad21e929d9318669a4fea1a8e4f9585ebfc09 Mon Sep 17 00:00:00 2001 From: Charles de Dreuille Date: Thu, 13 Mar 2025 15:52:54 +0000 Subject: [PATCH 1/2] Fix Button types Signed-off-by: Charles de Dreuille --- packages/canon/report.api.md | 14 ++-------- packages/canon/src/components/Button/types.ts | 27 ++++++++++++++++--- 2 files changed, 25 insertions(+), 16 deletions(-) diff --git a/packages/canon/report.api.md b/packages/canon/report.api.md index c51d6b6218..4f4a52ffd3 100644 --- a/packages/canon/report.api.md +++ b/packages/canon/report.api.md @@ -142,22 +142,12 @@ export const buttonPropDefs: { }; // @public -export interface ButtonProps { - // (undocumented) +export interface ButtonProps + extends Omit, 'children'> { children: React.ReactNode; - // (undocumented) - className?: string; - // (undocumented) - disabled?: boolean; - // (undocumented) iconEnd?: IconNames; - // (undocumented) iconStart?: IconNames; - // (undocumented) size?: ButtonOwnProps['size']; - // (undocumented) - style?: React.CSSProperties; - // (undocumented) variant?: ButtonOwnProps['variant']; } diff --git a/packages/canon/src/components/Button/types.ts b/packages/canon/src/components/Button/types.ts index 89bb8c79e5..0d61e1cda4 100644 --- a/packages/canon/src/components/Button/types.ts +++ b/packages/canon/src/components/Button/types.ts @@ -21,13 +21,32 @@ import type { ButtonOwnProps } from './Button.props'; * * @public */ -export interface ButtonProps { +export interface ButtonProps + extends Omit, 'children'> { + /** + * The size of the button + * @defaultValue 'medium' + */ size?: ButtonOwnProps['size']; + + /** + * The visual variant of the button + * @defaultValue 'primary' + */ variant?: ButtonOwnProps['variant']; + + /** + * The content of the button + */ children: React.ReactNode; - className?: string; - disabled?: boolean; + + /** + * Optional icon to display at the start of the button + */ iconStart?: IconNames; + + /** + * Optional icon to display at the end of the button + */ iconEnd?: IconNames; - style?: React.CSSProperties; } From 56850cacab34d93dac5184a1f78f5984b5184aef Mon Sep 17 00:00:00 2001 From: Charles de Dreuille Date: Thu, 13 Mar 2025 15:55:00 +0000 Subject: [PATCH 2/2] Create chubby-kids-hear.md Signed-off-by: Charles de Dreuille --- .changeset/chubby-kids-hear.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/chubby-kids-hear.md diff --git a/.changeset/chubby-kids-hear.md b/.changeset/chubby-kids-hear.md new file mode 100644 index 0000000000..b6461e8f71 --- /dev/null +++ b/.changeset/chubby-kids-hear.md @@ -0,0 +1,5 @@ +--- +'@backstage/canon': patch +--- + +Fix Button types that was preventing the use of native attributes like onClick.