import { cunninghamConfig } from "@gouvfr-lasuite/ui-kit"; // TODO: Temporary solution to override the default button tertiary text color, waiting for the new ui-kit to be released /** * Deep merge function that recursively merges objects * @param target - The target object to merge into * @param source - The source object to merge from * @returns A new object with deeply merged properties * * @example * const obj1 = { a: { x: 1, y: 2 }, b: 3 }; * const obj2 = { a: { y: 3, z: 4 }, c: 5 }; * const merged = deepMerge(obj1, obj2); * // Result: { a: { x: 1, y: 3, z: 4 }, b: 3, c: 5 } */ // eslint-disable-next-line @typescript-eslint/no-explicit-any function deepMerge(target: any, source: any): any { const result = { ...target }; for (const key in source) { if (source.hasOwnProperty(key)) { const sourceValue = source[key]; const targetValue = result[key]; if ( sourceValue && typeof sourceValue === "object" && !Array.isArray(sourceValue) && targetValue && typeof targetValue === "object" && !Array.isArray(targetValue) ) { // Recursively merge nested objects result[key] = deepMerge(targetValue, sourceValue); } else if (sourceValue !== undefined) { // Override with source value result[key] = sourceValue; } } } return result; } const themesImages = { anct: { favicon: "/assets/anct_favicon.png", logo: "/assets/acal_full_logotype_vector.svg", "logo-icon": "/assets/anct_logo-icon.svg", }, dark: { favicon: "/assets/favicon.png", logo: "/assets/cal_full_logotype_vector.svg", "logo-icon": "/assets/logo-icon_beta.svg", }, default: { favicon: "/assets/favicon.png", logo: "/assets/cal_full_logotype_vector.svg", "logo-icon": "/assets/logo-icon_beta.svg", }, }; const themesGaufre = { anct: { widgetPath: "https://static.suite.anct.gouv.fr/widgets/lagaufre.js", apiUrl: "https://operateurs.suite.anct.gouv.fr/api/v1.0/lagaufre/services/?operator=9f5624fc-ef99-4d10-ae3f-403a81eb16ef&siret=21870030000013", }, dark: { widgetPath: "https://static.suite.anct.gouv.fr/widgets/lagaufre.js", apiUrl: "https://lasuite.numerique.gouv.fr/api/services", }, default: { widgetPath: "https://static.suite.anct.gouv.fr/widgets/lagaufre.js", apiUrl: "https://lasuite.numerique.gouv.fr/api/services", }, }; const getComponents = (theme: keyof typeof themesImages) => { return { datagrid: { "body--background-color-hover": "ref(contextuals.background.semantic.contextual.primary)", }, gaufre: { widgetPath: `'${themesGaufre[theme].widgetPath}'`, apiUrl: `'${themesGaufre[theme].apiUrl}'`, }, favicon: { src: `'${themesImages[theme].favicon}'`, }, logo: { src: `url('${themesImages[theme].logo}')`, }, "logo-icon": { src: `url('${themesImages[theme]["logo-icon"]}')`, }, }; }; const defaultConfig = deepMerge(cunninghamConfig, { themes: { anct: { globals: { colors: { "brand-050": "#EEF0F9", "brand-100": "#DDE2F5", "brand-150": "#CBD4F1", "brand-200": "#B8C6F0", "brand-250": "#A5B7F2", "brand-300": "#91A8F7", "brand-350": "#7C98FE", "brand-400": "#6A89FF", "brand-450": "#5A7AFB", "brand-500": "#4B6BF0", "brand-550": "#3E5CE7", "brand-600": "#3352D5", "brand-650": "#2A47C0", "brand-700": "#2340A3", "brand-750": "#223A7F", "brand-800": "#1F325F", "brand-850": "#1B2845", "brand-900": "#151E30", "brand-950": "#0D121D", "gray-000": "#FFFFFF", "gray-025": "#F6F8FA", "gray-050": "#ECF1F7", "gray-100": "#DDE3F3", "gray-150": "#CCD4EA", "gray-200": "#BCC7E0", "gray-250": "#AEB9D2", "gray-300": "#A1ABC4", "gray-350": "#949EB6", "gray-400": "#8791A9", "gray-450": "#7A849B", "gray-500": "#6D778E", "gray-550": "#616A81", "gray-600": "#555E75", "gray-650": "#495268", "gray-700": "#3E475C", "gray-750": "#333B50", "gray-800": "#283044", "gray-850": "#1E2539", "gray-900": "#171B28", "gray-950": "#0F1118", "gray-1000": "#000000", "info-050": "#E9F2F8", "info-100": "#D2E5F1", "info-150": "#C0D7F0", "info-200": "#AEC8F0", "info-250": "#9EB9F2", "info-300": "#8DABEE", "info-350": "#7B9DE9", "info-400": "#6E8FDB", "info-450": "#6282CD", "info-500": "#5575BF", "info-550": "#4968B1", "info-600": "#3E5CA3", "info-650": "#344F97", "info-700": "#294389", "info-750": "#243972", "info-800": "#1D2F5B", "info-850": "#1A2744", "info-900": "#151D2F", "info-950": "#0E131F", "success-050": "#E7F1E9", "success-100": "#CFE3D3", "success-150": "#B9D8C0", "success-200": "#A1CEAC", "success-250": "#85C496", "success-300": "#63BC7F", "success-350": "#45B16B", "success-400": "#1CA659", "success-450": "#00984C", "success-500": "#008A3F", "success-550": "#007C32", "success-600": "#006E24", "success-650": "#016016", "success-700": "#005305", "success-750": "#0D450A", "success-800": "#11380E", "success-850": "#132A11", "success-900": "#101E0F", "success-950": "#091209", "warning-050": "#F6F0E8", "warning-100": "#EDE2D1", "warning-150": "#E6D3B8", "warning-200": "#E3C39F", "warning-250": "#E3B082", "warning-300": "#E19E5C", "warning-350": "#D98E3F", "warning-400": "#CF7D19", "warning-450": "#C17000", "warning-500": "#B36300", "warning-550": "#A45600", "warning-600": "#964900", "warning-650": "#893C00", "warning-700": "#7B2F00", "warning-750": "#68270D", "warning-800": "#562013", "warning-850": "#411D18", "warning-900": "#2E1714", "warning-950": "#1D0F0D", "error-050": "#F9EFEC", "error-100": "#F4DFD9", "error-150": "#F0CEC6", "error-200": "#EEBCB2", "error-250": "#EEA99D", "error-300": "#EF9487", "error-350": "#F37C6E", "error-400": "#F65F53", "error-450": "#EF443C", "error-500": "#E0342E", "error-550": "#D0201F", "error-600": "#C0000C", "error-650": "#AA0000", "error-700": "#910C06", "error-750": "#731E16", "error-800": "#58201A", "error-850": "#411D18", "error-900": "#2E1714", "error-950": "#1D0F0D", "red-050": "#F9EFEC", "red-100": "#F4DEDA", "red-150": "#F0CDC9", "red-200": "#EEBBB6", "red-250": "#EEA8A2", "red-300": "#F0938D", "red-350": "#EC7E78", "red-400": "#E46D67", "red-450": "#D95B58", "red-500": "#CA4E4B", "red-550": "#BB403F", "red-600": "#AC3233", "red-650": "#9D2227", "red-700": "#882023", "red-750": "#721D1B", "red-800": "#58201A", "red-850": "#401D18", "red-900": "#2E1714", "red-950": "#1D0F0D", "orange-050": "#F8F0E9", "orange-100": "#F1E0D3", "orange-150": "#ECD0BD", "orange-200": "#E9C0A5", "orange-250": "#E8AE8A", "orange-300": "#EB9870", "orange-350": "#EB845A", "orange-400": "#E66E37", "orange-450": "#DD5B16", "orange-500": "#CE4D00", "orange-550": "#BF3E00", "orange-600": "#B02F00", "orange-650": "#A11E00", "orange-700": "#8A1E14", "orange-750": "#731E16", "orange-800": "#58201A", "orange-850": "#401D18", "orange-900": "#2E1714", "orange-950": "#1D0F0D", "brown-050": "#F5F0E8", "brown-100": "#ECE2D1", "brown-150": "#E9D1B9", "brown-200": "#E3C19D", "brown-250": "#DCB187", "brown-300": "#D2A26F", "brown-350": "#C49562", "brown-400": "#B68855", "brown-450": "#A97B48", "brown-500": "#9B6E3B", "brown-550": "#8E612F", "brown-600": "#815521", "brown-650": "#744913", "brown-700": "#673D00", "brown-750": "#5A3100", "brown-800": "#4E2600", "brown-850": "#3D1F0B", "brown-900": "#2C170F", "brown-950": "#1C0F0B", "yellow-050": "#F3F0E7", "yellow-100": "#E9E2CF", "yellow-150": "#E0D4B7", "yellow-200": "#DAC59A", "yellow-250": "#D5B67A", "yellow-300": "#D0A559", "yellow-350": "#CC9331", "yellow-400": "#C48400", "yellow-450": "#B77600", "yellow-500": "#AA6800", "yellow-550": "#9D5A00", "yellow-600": "#914D00", "yellow-650": "#843F00", "yellow-700": "#773200", "yellow-750": "#6A2601", "yellow-800": "#56210F", "yellow-850": "#401D16", "yellow-900": "#2E1714", "yellow-950": "#1D0F0D", "green-050": "#E3F1EF", "green-100": "#CAE5E1", "green-150": "#B0DBD4", "green-200": "#91D1C7", "green-250": "#6AC8BC", "green-300": "#4DBCAF", "green-350": "#3CAFA2", "green-400": "#2AA194", "green-450": "#109487", "green-500": "#00867A", "green-550": "#00786D", "green-600": "#016A60", "green-650": "#015D53", "green-700": "#005047", "green-750": "#00443B", "green-800": "#00382F", "green-850": "#002C25", "green-900": "#041F1A", "green-950": "#041310", "blue1-050": "#EAF2F9", "blue1-100": "#D4E4F3", "blue1-150": "#BFD7F0", "blue1-200": "#AAC9EF", "blue1-250": "#96BBF1", "blue1-300": "#82ACF6", "blue1-350": "#709BFE", "blue1-400": "#608BFF", "blue1-450": "#537BFB", "blue1-500": "#476DEC", "blue1-550": "#3C60DD", "blue1-600": "#3252CF", "blue1-650": "#2B48B9", "blue1-700": "#28409B", "blue1-750": "#24397E", "blue1-800": "#223260", "blue1-850": "#1F2A48", "blue1-900": "#191F32", "blue1-950": "#111320", "blue2-050": "#E5F2F3", "blue2-100": "#CDE6EC", "blue2-150": "#B7D9EA", "blue2-200": "#9BCDE7", "blue2-250": "#84C1E0", "blue2-300": "#6BB4D8", "blue2-350": "#5CA6CB", "blue2-400": "#4D99BC", "blue2-450": "#3E8CAE", "blue2-500": "#2F7FA2", "blue2-550": "#1F7295", "blue2-600": "#056688", "blue2-650": "#00597B", "blue2-700": "#004C6C", "blue2-750": "#003F5E", "blue2-800": "#003353", "blue2-850": "#0C273E", "blue2-900": "#0E1C2C", "blue2-950": "#0A121C", "purple-050": "#EDF1FA", "purple-100": "#DCE2F5", "purple-150": "#CCD4F1", "purple-200": "#BCC4F0", "purple-250": "#ADB6F2", "purple-300": "#9EA6F6", "purple-350": "#8E95FD", "purple-400": "#8083FF", "purple-450": "#7173FF", "purple-500": "#6665F1", "purple-550": "#5B57E2", "purple-600": "#5049D4", "purple-650": "#4641BC", "purple-700": "#3D39A2", "purple-750": "#363680", "purple-800": "#2E3162", "purple-850": "#242848", "purple-900": "#1C1E32", "purple-950": "#121320", "pink-050": "#F8EFF4", "pink-100": "#F0DEE9", "pink-150": "#EBCDDF", "pink-200": "#E7BDD6", "pink-250": "#E5A9CC", "pink-300": "#E695C0", "pink-350": "#EA7CAE", "pink-400": "#E4659F", "pink-450": "#DD4F93", "pink-500": "#CD4085", "pink-550": "#BE3279", "pink-600": "#AE216D", "pink-650": "#9B195D", "pink-700": "#86164E", "pink-750": "#6E1B3D", "pink-800": "#551E31", "pink-850": "#3F1C24", "pink-900": "#2D161A", "pink-950": "#1C0E10", }, }, components: getComponents("anct"), }, dark: { globals: cunninghamConfig.themes.default.globals, components: getComponents("dark"), }, default: { components: getComponents("default"), }, }, }); const config = defaultConfig; export default config;