Skip to content

Commit 91a4b1e

Browse files
committed
fmt
1 parent f5e87bb commit 91a4b1e

File tree

3 files changed

+61
-58
lines changed

3 files changed

+61
-58
lines changed

.eslintignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,6 @@ node_modules/
22
dist/
33
CHANGELOG.md
44
.yarn_home/
5-
src/test/integration/
5+
src/integration/
6+
src/lib/tools/@mui/
7+

.prettierignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ node_modules/
33
/CHANGELOG.md
44
/.yarn_home/
55
/test/integration/
6-
/src/tools/types/
76
/dsfr/
7+
/src/lib/tools/@mui/

src/mui.tsx

Lines changed: 57 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -14,30 +14,30 @@ import type { Theme as NonAugmentedMuiTheme } from "./lib/tools/@mui/material/st
1414

1515
export type { NonAugmentedMuiTheme };
1616

17-
const createMuiDsfrTheme = memoize((isDark: boolean): MuiTheme => {
18-
19-
const muiTheme = createTheme({
20-
"shape": {
21-
"borderRadius": 0
22-
},
23-
"breakpoints": {
24-
"unit": breakpointValuesUnit,
25-
"values": breakpointValues
26-
},
27-
"palette": (() => {
28-
const { decisions } = getColors(isDark);
17+
const createMuiDsfrTheme = memoize(
18+
(isDark: boolean): MuiTheme => {
19+
const muiTheme = createTheme({
20+
"shape": {
21+
"borderRadius": 0
22+
},
23+
"breakpoints": {
24+
"unit": breakpointValuesUnit,
25+
"values": breakpointValues
26+
},
27+
"palette": (() => {
28+
const { decisions } = getColors(isDark);
2929

30-
return {
31-
"mode": isDark ? "dark" : "light",
32-
"primary": {
33-
"main": decisions.background.actionHigh.blueFrance.default,
34-
"light": decisions.background.actionLow.blueFrance.default
35-
},
36-
"secondary": {
37-
"main": decisions.background.actionHigh.redMarianne.default,
38-
"light": decisions.background.actionLow.redMarianne.default
39-
}
40-
/*
30+
return {
31+
"mode": isDark ? "dark" : "light",
32+
"primary": {
33+
"main": decisions.background.actionHigh.blueFrance.default,
34+
"light": decisions.background.actionLow.blueFrance.default
35+
},
36+
"secondary": {
37+
"main": decisions.background.actionHigh.redMarianne.default,
38+
"light": decisions.background.actionLow.redMarianne.default
39+
}
40+
/*
4141
"primary": {
4242
"900": colorOptions.blueFrance._925_125.default,
4343
"800": colorOptions.blueFrance._850_200.default,
@@ -47,42 +47,44 @@ const createMuiDsfrTheme = memoize((isDark: boolean): MuiTheme => {
4747
"light": colorDecisions.background.actionLow.redMarianne.default,
4848
},
4949
*/
50-
} as const;
51-
})(),
52-
"typography": {
53-
"fontFamily": '"Marianne", arial, sans-serif',
54-
"h1": typography.find(({ selector }) => selector === "h1")!.style,
55-
"h2": typography.find(({ selector }) => selector === "h2")!.style,
56-
"h3": typography.find(({ selector }) => selector === "h3")!.style,
57-
"h4": typography.find(({ selector }) => selector === "h4")!.style,
58-
"h5": typography.find(({ selector }) => selector === "h5")!.style,
59-
"h6": typography.find(({ selector }) => selector === "h6")!.style,
60-
//"subtitle1":
61-
//"subtitle2":
62-
"body1": typography.find(({ selector }) => selector === "p")!.style
63-
//"body2": {},
64-
//"caption": {},
65-
//"button": {},
66-
//"overline": {}
67-
},
68-
"spacing": (() => {
69-
//NOTE: The properties are declared sorted in the object.
70-
const values = Object.values(spacingTokenByValue);
50+
} as const;
51+
})(),
52+
"typography": {
53+
"fontFamily": '"Marianne", arial, sans-serif',
54+
"h1": typography.find(({ selector }) => selector === "h1")!.style,
55+
"h2": typography.find(({ selector }) => selector === "h2")!.style,
56+
"h3": typography.find(({ selector }) => selector === "h3")!.style,
57+
"h4": typography.find(({ selector }) => selector === "h4")!.style,
58+
"h5": typography.find(({ selector }) => selector === "h5")!.style,
59+
"h6": typography.find(({ selector }) => selector === "h6")!.style,
60+
//"subtitle1":
61+
//"subtitle2":
62+
"body1": typography.find(({ selector }) => selector === "p")!.style
63+
//"body2": {},
64+
//"caption": {},
65+
//"button": {},
66+
//"overline": {}
67+
},
68+
"spacing": (() => {
69+
//NOTE: The properties are declared sorted in the object.
70+
const values = Object.values(spacingTokenByValue);
7171

72-
return (abs: string | number) =>
73-
typeof abs === "string"
74-
? abs
75-
: abs === 0
72+
return (abs: string | number) =>
73+
typeof abs === "string"
74+
? abs
75+
: abs === 0
7676
? 0
7777
: (() => {
78-
const value = values[abs - 1];
79-
return value === undefined ? abs : value;
80-
})();
81-
})()
82-
});
78+
const value = values[abs - 1];
79+
return value === undefined ? abs : value;
80+
})();
81+
})()
82+
});
8383

84-
return muiTheme;
85-
}, { "max": 1 });
84+
return muiTheme;
85+
},
86+
{ "max": 1 }
87+
);
8688

8789
export type MuiDsfrThemeProviderProps = {
8890
children: ReactNode;
@@ -153,4 +155,3 @@ export function MuiDsfrThemeProvider(props: MuiDsfrThemeProviderProps) {
153155
},
154156
});
155157
*/
156-

0 commit comments

Comments
 (0)