mirror of
https://github.com/suitenumerique/drive.git
synced 2026-09-13 05:07:55 +02:00
✨(frontend) add gaufre theme configuration and components
- Introduced a new gaufre theme with widget paths and API URLs. - Updated the getComponents function to include gaufre theme components. - Enhanced styles to support the new gaufre theme in cunningham-tokens. - Added console logs for debugging theme configurations.
This commit is contained in:
@@ -61,12 +61,32 @@ const themesImages = {
|
||||
},
|
||||
};
|
||||
|
||||
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}'`,
|
||||
},
|
||||
@@ -82,7 +102,6 @@ const getComponents = (theme: keyof typeof themesImages) => {
|
||||
const defaultConfig = deepMerge(cunninghamConfig, {
|
||||
themes: {
|
||||
anct: {
|
||||
components: getComponents("anct"),
|
||||
globals: {
|
||||
colors: {
|
||||
"brand-050": "#EEF0F9",
|
||||
@@ -375,6 +394,7 @@ const defaultConfig = deepMerge(cunninghamConfig, {
|
||||
"pink-950": "#1C0E10",
|
||||
},
|
||||
},
|
||||
components: getComponents("anct"),
|
||||
},
|
||||
dark: {
|
||||
globals: cunninghamConfig.themes.default.globals,
|
||||
|
||||
@@ -844,6 +844,10 @@ $themes: (
|
||||
'color': #265EAA
|
||||
)
|
||||
),
|
||||
'gaufre': (
|
||||
'widgetPath': 'https://static.suite.anct.gouv.fr/widgets/lagaufre.js',
|
||||
'apiUrl': 'https://lasuite.numerique.gouv.fr/api/services'
|
||||
),
|
||||
'favicon': (
|
||||
'src': '/assets/favicon.png'
|
||||
),
|
||||
@@ -1647,6 +1651,10 @@ $themes: (
|
||||
'datagrid': (
|
||||
'body--background-color-hover': #0000000D
|
||||
),
|
||||
'gaufre': (
|
||||
'widgetPath': 'https://static.suite.anct.gouv.fr/widgets/lagaufre.js',
|
||||
'apiUrl': 'https://lasuite.numerique.gouv.fr/api/services'
|
||||
),
|
||||
'favicon': (
|
||||
'src': '/assets/favicon.png'
|
||||
),
|
||||
@@ -1659,20 +1667,6 @@ $themes: (
|
||||
)
|
||||
),
|
||||
'anct': (
|
||||
'components': (
|
||||
'datagrid': (
|
||||
'body--background-color-hover': #0000000D
|
||||
),
|
||||
'favicon': (
|
||||
'src': '/assets/anct_favicon.png'
|
||||
),
|
||||
'logo': (
|
||||
'src': url('/assets/anct_logo_beta.svg')
|
||||
),
|
||||
'logo-icon': (
|
||||
'src': url('/assets/anct_logo-icon.svg')
|
||||
)
|
||||
),
|
||||
'globals': (
|
||||
'colors': (
|
||||
'brand-050': #EEF0F9,
|
||||
@@ -1964,6 +1958,24 @@ $themes: (
|
||||
'pink-900': #2D161A,
|
||||
'pink-950': #1C0E10
|
||||
)
|
||||
),
|
||||
'components': (
|
||||
'datagrid': (
|
||||
'body--background-color-hover': #0000000D
|
||||
),
|
||||
'gaufre': (
|
||||
'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'
|
||||
),
|
||||
'favicon': (
|
||||
'src': '/assets/anct_favicon.png'
|
||||
),
|
||||
'logo': (
|
||||
'src': url('/assets/anct_logo_beta.svg')
|
||||
),
|
||||
'logo-icon': (
|
||||
'src': url('/assets/anct_logo-icon.svg')
|
||||
)
|
||||
)
|
||||
)
|
||||
) !default;
|
||||
|
||||
@@ -660,6 +660,8 @@
|
||||
--c--components--badge--warning--color: var(--c--contextuals--content--semantic--warning--secondary);
|
||||
--c--components--badge--info--background-color: var(--c--contextuals--background--semantic--info--secondary);
|
||||
--c--components--badge--info--color: var(--c--contextuals--content--semantic--info--secondary);
|
||||
--c--components--gaufre--widgetpath: 'https://static.suite.anct.gouv.fr/widgets/lagaufre.js';
|
||||
--c--components--gaufre--apiurl: 'https://lasuite.numerique.gouv.fr/api/services';
|
||||
--c--components--favicon--src: '/assets/favicon.png';
|
||||
--c--components--logo--src: url('/assets/logo_beta.svg');
|
||||
--c--components--logo-icon--src: url('/assets/logo-icon_beta.svg');
|
||||
@@ -1297,15 +1299,13 @@
|
||||
--c--contextuals--border--palette--gray--secondary: var(--c--globals--colors--gray-450);
|
||||
--c--contextuals--border--palette--gray--tertiary: var(--c--globals--colors--gray-550);
|
||||
--c--components--datagrid--body--background-color-hover: var(--c--contextuals--background--semantic--contextual--primary);
|
||||
--c--components--gaufre--widgetPath: 'https://static.suite.anct.gouv.fr/widgets/lagaufre.js';
|
||||
--c--components--gaufre--apiUrl: 'https://lasuite.numerique.gouv.fr/api/services';
|
||||
--c--components--favicon--src: '/assets/favicon.png';
|
||||
--c--components--logo--src: url('/assets/logo_beta.svg');
|
||||
--c--components--logo-icon--src: url('/assets/logo-icon_beta.svg');
|
||||
}
|
||||
.cunningham-theme--anct{
|
||||
--c--components--datagrid--body--background-color-hover: var(--c--contextuals--background--semantic--contextual--primary);
|
||||
--c--components--favicon--src: '/assets/anct_favicon.png';
|
||||
--c--components--logo--src: url('/assets/anct_logo_beta.svg');
|
||||
--c--components--logo-icon--src: url('/assets/anct_logo-icon.svg');
|
||||
--c--globals--colors--brand-050: #EEF0F9;
|
||||
--c--globals--colors--brand-100: #DDE2F5;
|
||||
--c--globals--colors--brand-150: #CBD4F1;
|
||||
@@ -1594,4 +1594,10 @@
|
||||
--c--globals--colors--pink-850: #3F1C24;
|
||||
--c--globals--colors--pink-900: #2D161A;
|
||||
--c--globals--colors--pink-950: #1C0E10;
|
||||
--c--components--datagrid--body--background-color-hover: var(--c--contextuals--background--semantic--contextual--primary);
|
||||
--c--components--gaufre--widgetPath: 'https://static.suite.anct.gouv.fr/widgets/lagaufre.js';
|
||||
--c--components--gaufre--apiUrl: 'https://operateurs.suite.anct.gouv.fr/api/v1.0/lagaufre/services/?operator=9f5624fc-ef99-4d10-ae3f-403a81eb16ef&siret=21870030000013';
|
||||
--c--components--favicon--src: '/assets/anct_favicon.png';
|
||||
--c--components--logo--src: url('/assets/anct_logo_beta.svg');
|
||||
--c--components--logo-icon--src: url('/assets/anct_logo-icon.svg');
|
||||
}
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user