diff --git a/.changeset/proud-pigs-yell.md b/.changeset/proud-pigs-yell.md new file mode 100644 index 0000000000..cb612ff02c --- /dev/null +++ b/.changeset/proud-pigs-yell.md @@ -0,0 +1,5 @@ +--- +"@sumup-oss/circuit-ui": patch +--- + +Removed the `default` attribute that was accidentally added to components with default translations. diff --git a/packages/circuit-ui/util/i18n.ts b/packages/circuit-ui/util/i18n.ts index c2a6770595..5bc764c1ab 100644 --- a/packages/circuit-ui/util/i18n.ts +++ b/packages/circuit-ui/util/i18n.ts @@ -110,7 +110,8 @@ export function transformModulesToTranslations< Key extends string | number | symbol = keyof T, >(modules: Record): Translations { const translations = Object.entries(modules).reduce( - (acc, [importPath, strings]) => { + (acc, [importPath, exports]) => { + const { default: unused, ...strings } = exports; const matches = importPath.match(/[a-z]{2}-[A-Z]{2}/); // @ts-expect-error This environment variable is set by Vite. @@ -128,7 +129,7 @@ export function transformModulesToTranslations< throw new Error(`Unsupported locale: ${importPath}`); } - acc[locale] = strings as Record; + acc[locale] = strings as unknown as Record; return acc; }, {} as Translations,