From c196de1a58947d169710e64f4db017b292475f57 Mon Sep 17 00:00:00 2001 From: Kyle McDonald Date: Fri, 8 Nov 2024 15:30:34 -0600 Subject: [PATCH] fix: button text wrapping --- .changeset/violet-zebras-roll.md | 5 +++++ packages/button/src/Button/Button.tsx | 8 ++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 .changeset/violet-zebras-roll.md diff --git a/.changeset/violet-zebras-roll.md b/.changeset/violet-zebras-roll.md new file mode 100644 index 00000000..4d20bd08 --- /dev/null +++ b/.changeset/violet-zebras-roll.md @@ -0,0 +1,5 @@ +--- +"@telegraph/button": patch +--- + +fix button text wrapping diff --git a/packages/button/src/Button/Button.tsx b/packages/button/src/Button/Button.tsx index c9ad3c94..8acdf927 100644 --- a/packages/button/src/Button/Button.tsx +++ b/packages/button/src/Button/Button.tsx @@ -234,7 +234,7 @@ const Text = ({ color, size, weight = "medium", - className, + style, ...props }: TextProps) => { const context = React.useContext(ButtonContext); @@ -249,10 +249,14 @@ const Text = ({ color={derivedColor} size={size ?? textSizeMap[context.size]} weight={weight} - className={clsx("no-underline whitespace-nowrap", className)} internal_optionalAs={true} data-button-text data-button-text-color={derivedColor} + style={{ + textDecoration: "none", + whiteSpace: "nowrap", + ...style, + }} {...props} /> );