This is an automated email from the ASF dual-hosted git repository.

kgabryje pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/superset.git


The following commit(s) were added to refs/heads/master by this push:
     new 79372465757 fix(button): use colorLink token for link-style buttons 
(#38121)
79372465757 is described below

commit 79372465757d420ab824604599f78a2b5b4c8662
Author: Kamil Gabryjelski <[email protected]>
AuthorDate: Fri Feb 20 16:54:05 2026 +0100

    fix(button): use colorLink token for link-style buttons (#38121)
    
    Co-authored-by: Claude Opus 4.6 <[email protected]>
---
 .../src/components/Button/Button.stories.tsx       |  2 +-
 .../src/components/Button/index.tsx                | 42 +++++++++++-----------
 2 files changed, 22 insertions(+), 22 deletions(-)

diff --git 
a/superset-frontend/packages/superset-ui-core/src/components/Button/Button.stories.tsx
 
b/superset-frontend/packages/superset-ui-core/src/components/Button/Button.stories.tsx
index ede9d87cbb8..808a16f45b1 100644
--- 
a/superset-frontend/packages/superset-ui-core/src/components/Button/Button.stories.tsx
+++ 
b/superset-frontend/packages/superset-ui-core/src/components/Button/Button.stories.tsx
@@ -105,7 +105,7 @@ export const InteractiveButton = (args: ButtonProps & { 
children: string }) => (
 );
 
 InteractiveButton.args = {
-  buttonStyle: 'default',
+  buttonStyle: 'primary',
   buttonSize: 'default',
   children: 'Button!',
 };
diff --git 
a/superset-frontend/packages/superset-ui-core/src/components/Button/index.tsx 
b/superset-frontend/packages/superset-ui-core/src/components/Button/index.tsx
index 0266680d655..3a78ef989bf 100644
--- 
a/superset-frontend/packages/superset-ui-core/src/components/Button/index.tsx
+++ 
b/superset-frontend/packages/superset-ui-core/src/components/Button/index.tsx
@@ -30,6 +30,22 @@ import type {
   OnClickHandler,
 } from './types';
 
+const BUTTON_STYLE_MAP: Record<
+  ButtonStyle,
+  {
+    type?: ButtonType;
+    variant?: ButtonVariantType;
+    color?: ButtonColorType;
+  }
+> = {
+  primary: { type: 'primary', variant: 'solid', color: 'primary' },
+  secondary: { variant: 'filled', color: 'primary' },
+  tertiary: { variant: 'outlined', color: 'default' },
+  dashed: { type: 'dashed', variant: 'dashed', color: 'primary' },
+  danger: { variant: 'solid', color: 'danger' },
+  link: { type: 'link' },
+};
+
 export function Button(props: ButtonProps) {
   const {
     tooltip,
@@ -62,27 +78,11 @@ export function Button(props: ButtonProps) {
     padding = 4;
   }
 
-  let antdType: ButtonType = 'default';
-  let variant: ButtonVariantType = 'solid';
-  let color: ButtonColorType = 'primary';
-
-  if (!buttonStyle || buttonStyle === 'primary') {
-    variant = 'solid';
-    antdType = 'primary';
-  } else if (buttonStyle === 'secondary') {
-    variant = 'filled';
-    color = 'primary';
-  } else if (buttonStyle === 'tertiary') {
-    variant = 'outlined';
-    color = 'default';
-  } else if (buttonStyle === 'dashed') {
-    variant = 'dashed';
-    antdType = 'dashed';
-  } else if (buttonStyle === 'danger') {
-    color = 'danger';
-  } else if (buttonStyle === 'link') {
-    variant = 'link';
-  }
+  const {
+    type: antdType = 'default',
+    variant,
+    color,
+  } = BUTTON_STYLE_MAP[buttonStyle ?? 'primary'];
 
   const element = children as ReactElement;
 

Reply via email to