Skip to content

The easy-to-use open source Business Intelligence and Embedded Analytics tool that lets everyone work with data :bar_chart:

fix(sdk-bundle, sdk-package): add missing focus color due to dark mode changes (#64641)

Phoomparin Manob5e93da26644
diff --git a/docs/embedding/sdk/snippets/appearance/theme.ts b/docs/embedding/sdk/snippets/appearance/theme.ts
index 4288f290182..29f14342caf 100644
--- a/docs/embedding/sdk/snippets/appearance/theme.ts
+++ b/docs/embedding/sdk/snippets/appearance/theme.ts
@@ -65,6 +65,9 @@ const theme = defineMetabaseTheme({
// Color used to indicate dangerous actions and negative values/trends
negative: "#FF7979",
+ /** Color used to outline elements in focus */
+ focus: "#CAE1F7",
+
/** Color used for popover shadows */
shadow: "rgba(0,0,0,0.08)",
diff --git a/enterprise/frontend/src/embedding-sdk-bundle/lib/theme/get-embedding-theme.unit.spec.ts b/enterprise/frontend/src/embedding-sdk-bundle/lib/theme/get-embedding-theme.unit.spec.ts
index aa6e5c7cd9d..483f84c987e 100644
--- a/enterprise/frontend/src/embedding-sdk-bundle/lib/theme/get-embedding-theme.unit.spec.ts
+++ b/enterprise/frontend/src/embedding-sdk-bundle/lib/theme/get-embedding-theme.unit.spec.ts
@@ -18,6 +18,7 @@ describe("Transform Embedding Theme Override", () => {
"text-tertiary": "green",
"background-disabled": "pink",
"text-white": "white",
+ focus: "blue",
},
// we should strip any explicit "undefined" values and apply default component values
@@ -42,6 +43,7 @@ describe("Transform Embedding Theme Override", () => {
"background-disabled": expect.arrayContaining(["pink"]),
"text-white": expect.arrayContaining(["white"]),
white: expect.arrayContaining(["white"]),
+ focus: expect.arrayContaining(["blue"]),
},
other: {
fontSize: "2rem",
diff --git a/frontend/src/metabase/embedding-sdk/theme/MetabaseTheme.ts b/frontend/src/metabase/embedding-sdk/theme/MetabaseTheme.ts
index 7b2c9beec32..3dee7383c53 100644
--- a/frontend/src/metabase/embedding-sdk/theme/MetabaseTheme.ts
+++ b/frontend/src/metabase/embedding-sdk/theme/MetabaseTheme.ts
@@ -88,6 +88,9 @@ export interface MetabaseColors {
/** Color used to indicate dangerous actions and negative values/trends */
negative?: string;
+ /** Color used to outline elements in focus */
+ focus?: string;
+
/** Color used for white text */
"text-white"?: string;
diff --git a/frontend/src/metabase/embedding-sdk/theme/embedding-color-palette.ts b/frontend/src/metabase/embedding-sdk/theme/embedding-color-palette.ts
index ad2eb7c8753..da6ed4295d1 100644
--- a/frontend/src/metabase/embedding-sdk/theme/embedding-color-palette.ts
+++ b/frontend/src/metabase/embedding-sdk/theme/embedding-color-palette.ts
@@ -63,6 +63,7 @@ export const SDK_TO_MAIN_APP_COLORS_MAPPING: Record<
error: ["error"],
"background-error": ["bg-error"],
"text-hover": ["text-hover"],
+ focus: ["focus"],
};
/**