@groupeactual/design-tokens 1.5.2 → 1.6.0-beta.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. package/dist/cjs/index.js +1 -1
  2. package/dist/cjs/index.js.map +1 -1
  3. package/dist/cjs/types/css/accordionCss.d.ts +2 -1
  4. package/dist/cjs/types/css/bannerNotificationCss.d.ts +2 -1
  5. package/dist/cjs/types/css/breadcrumbsCss.d.ts +2 -1
  6. package/dist/cjs/types/css/buttonCss.d.ts +2 -1
  7. package/dist/cjs/types/css/chipCss.d.ts +2 -1
  8. package/dist/cjs/types/css/datatable/datatableCss.d.ts +2 -1
  9. package/dist/cjs/types/css/form/autoCompleteCss.d.ts +2 -1
  10. package/dist/cjs/types/css/form/checkboxCss.d.ts +2 -1
  11. package/dist/cjs/types/css/form/checkboxGroupCss.d.ts +2 -1
  12. package/dist/cjs/types/css/form/datePickerCss.d.ts +2 -1
  13. package/dist/cjs/types/css/form/radioCss.d.ts +2 -1
  14. package/dist/cjs/types/css/form/selectCss.d.ts +2 -1
  15. package/dist/cjs/types/css/form/snackbarCss.d.ts +2 -1
  16. package/dist/cjs/types/css/form/textFieldCss.d.ts +2 -1
  17. package/dist/cjs/types/css/iconButtonCss.d.ts +2 -1
  18. package/dist/cjs/types/css/linkCss.d.ts +2 -1
  19. package/dist/cjs/types/css/paginationCss.d.ts +2 -1
  20. package/dist/cjs/types/css/switchCss.d.ts +2 -1
  21. package/dist/cjs/types/css/tooltipCss.d.ts +1 -1
  22. package/dist/cjs/types/helpers/theme.d.ts +1 -1
  23. package/dist/cjs/types/interfaces/theme.d.ts +1 -0
  24. package/dist/cjs/types/useMaterialThemeTokens.d.ts +2 -2
  25. package/dist/es/index.d.ts +22 -21
  26. package/dist/es/index.mjs +1 -1
  27. package/dist/es/index.mjs.map +1 -1
  28. package/dist/es/types/css/accordionCss.d.ts +2 -1
  29. package/dist/es/types/css/bannerNotificationCss.d.ts +2 -1
  30. package/dist/es/types/css/breadcrumbsCss.d.ts +2 -1
  31. package/dist/es/types/css/buttonCss.d.ts +2 -1
  32. package/dist/es/types/css/chipCss.d.ts +2 -1
  33. package/dist/es/types/css/datatable/datatableCss.d.ts +2 -1
  34. package/dist/es/types/css/form/autoCompleteCss.d.ts +2 -1
  35. package/dist/es/types/css/form/checkboxCss.d.ts +2 -1
  36. package/dist/es/types/css/form/checkboxGroupCss.d.ts +2 -1
  37. package/dist/es/types/css/form/datePickerCss.d.ts +2 -1
  38. package/dist/es/types/css/form/radioCss.d.ts +2 -1
  39. package/dist/es/types/css/form/selectCss.d.ts +2 -1
  40. package/dist/es/types/css/form/snackbarCss.d.ts +2 -1
  41. package/dist/es/types/css/form/textFieldCss.d.ts +2 -1
  42. package/dist/es/types/css/iconButtonCss.d.ts +2 -1
  43. package/dist/es/types/css/linkCss.d.ts +2 -1
  44. package/dist/es/types/css/paginationCss.d.ts +2 -1
  45. package/dist/es/types/css/switchCss.d.ts +2 -1
  46. package/dist/es/types/css/tooltipCss.d.ts +1 -1
  47. package/dist/es/types/helpers/theme.d.ts +1 -1
  48. package/dist/es/types/interfaces/theme.d.ts +1 -0
  49. package/dist/es/types/useMaterialThemeTokens.d.ts +2 -2
  50. package/package.json +27 -28
  51. package/src/css/accordionCss.ts +8 -8
  52. package/src/css/bannerNotificationCss.ts +14 -12
  53. package/src/css/breadcrumbsCss.ts +7 -7
  54. package/src/css/buttonCss.ts +4 -4
  55. package/src/css/chipCss.ts +33 -33
  56. package/src/css/datatable/datatableCss.ts +10 -10
  57. package/src/css/form/autoCompleteCss.ts +71 -54
  58. package/src/css/form/checkboxCss.ts +23 -23
  59. package/src/css/form/checkboxGroupCss.ts +13 -13
  60. package/src/css/form/datePickerCss.ts +3 -4
  61. package/src/css/form/radioCss.ts +26 -26
  62. package/src/css/form/selectCss.ts +24 -24
  63. package/src/css/form/snackbarCss.ts +13 -13
  64. package/src/css/form/textFieldCss.ts +7 -7
  65. package/src/css/iconButtonCss.ts +22 -22
  66. package/src/css/linkCss.ts +6 -6
  67. package/src/css/paginationCss.ts +11 -11
  68. package/src/css/switchCss.ts +20 -19
  69. package/src/css/tooltipCss.ts +6 -9
  70. package/src/helpers/theme.ts +18 -16
  71. package/src/interfaces/theme.ts +3 -0
  72. package/src/themes/tokens.ts +3 -3
  73. package/src/useMaterialThemeTokens.ts +31 -31
  74. package/src/useThemeTokens.ts +2 -2
@@ -1,10 +1,10 @@
1
- const RadioCss = (
2
- muiTokens: Record<string, string | number | any>
3
- ): Record<string, unknown> => {
1
+ import { MuiTokens } from '../../interfaces/theme';
2
+
3
+ const RadioCss = (muiTokens: MuiTokens): Record<string, unknown> => {
4
4
  return {
5
5
  '&.MuiFormControl-root': {
6
6
  '.MuiSvgIcon-root': {
7
- marginTop: '-2px'
7
+ marginTop: '-2px',
8
8
  },
9
9
  '.MuiRadio-root': {
10
10
  '.MuiSvgIcon-root': {
@@ -12,73 +12,73 @@ const RadioCss = (
12
12
  zIndex: 1,
13
13
  height: '16px',
14
14
  width: '16px',
15
- marginTop: '-2px'
15
+ marginTop: '-2px',
16
16
  },
17
17
  height: '16px',
18
18
  width: '16px',
19
19
  marginRight: '8px',
20
20
  '&:hover': {
21
21
  '.MuiSvgIcon-root': {
22
- color: muiTokens.palette.blueHoverClickable + ' !important'
23
- }
24
- }
22
+ color: muiTokens.palette.blueHoverClickable + ' !important',
23
+ },
24
+ },
25
25
  },
26
26
  '.MuiFormControlLabel-root': {
27
27
  margin: '0px 0px 4px 0px',
28
28
  color: muiTokens.palette.greyXDark,
29
- alignItems: 'self-start'
29
+ alignItems: 'self-start',
30
30
  },
31
31
  '.MuiFormControlLabel-label': {
32
32
  fontWeight: '400',
33
33
  fontSize: '14px',
34
- position: 'relative'
34
+ position: 'relative',
35
35
  },
36
36
  '.MuiButtonBase-root': {
37
37
  color: muiTokens.palette.greyLightDefaultBorder,
38
38
  '&.Mui-checked': {
39
- color: muiTokens.palette.blueClickable
40
- }
39
+ color: muiTokens.palette.blueClickable,
40
+ },
41
41
  },
42
42
  '.MuiFormLabel-root': {
43
43
  color: muiTokens.palette.greyXDark,
44
44
  fontWeight: '500',
45
45
  fontSize: '13px',
46
46
  paddingBottom: '4px',
47
- paddingLeft: '2px'
47
+ paddingLeft: '2px',
48
48
  },
49
49
  '.MuiFormHelperText-root': {
50
50
  margin: '0px',
51
51
  paddingTop: '4px',
52
52
  color: muiTokens.palette.greyDark,
53
- fontSize: '11px'
53
+ fontSize: '11px',
54
54
  },
55
55
  '&.Mui-disabled': {
56
56
  '.MuiFormLabel-root': {
57
- color: muiTokens.palette.greyDark
57
+ color: muiTokens.palette.greyDark,
58
58
  },
59
59
  '.MuiFormControlLabel-label': {
60
60
  color: muiTokens.palette.greyMediumInactive,
61
- fontWeight: '700'
61
+ fontWeight: '700',
62
62
  },
63
63
  '.MuiButtonBase-root': {
64
64
  backgroundColor: muiTokens.palette.greyXLight,
65
65
  color: muiTokens.palette.greyMediumInactive,
66
66
  transform: 'scale(0.889)',
67
67
  '& span': {
68
- transform: 'scale(1.3)'
68
+ transform: 'scale(1.3)',
69
69
  },
70
70
  '&.Mui-checked': {
71
- color: muiTokens.palette.greyMediumInactive
72
- }
73
- }
71
+ color: muiTokens.palette.greyMediumInactive,
72
+ },
73
+ },
74
74
  },
75
75
  '&.Mui-error': {
76
76
  '.MuiFormLabel-root': {
77
- color: muiTokens.palette.redError
77
+ color: muiTokens.palette.redError,
78
78
  },
79
79
  '.MuiFormHelperText-root': {
80
- color: muiTokens.palette.redError + ' !important'
81
- }
80
+ color: muiTokens.palette.redError + ' !important',
81
+ },
82
82
  },
83
83
  '.MuiTouchRipple-root': {
84
84
  background: 'white',
@@ -86,9 +86,9 @@ const RadioCss = (
86
86
  width: '12px',
87
87
  top: '3px',
88
88
  zIndex: 0,
89
- left: '3px'
90
- }
91
- }
89
+ left: '3px',
90
+ },
91
+ },
92
92
  };
93
93
  };
94
94
 
@@ -1,9 +1,23 @@
1
- const SelectCss = (
2
- muiTokens: Record<string, string | number | any>,
3
- ): Record<string, unknown> => {
1
+ import { MuiTokens } from '../../interfaces/theme';
2
+
3
+ const SelectCss = (muiTokens: MuiTokens): Record<string, unknown> => {
4
4
  return {
5
5
  '&.MuiFormControl-root': {
6
6
  zIndex: 1,
7
+ '&:hover': {
8
+ '.clear': {
9
+ visibility: 'visible',
10
+ },
11
+ '.MuiOutlinedInput-notchedOutline': {
12
+ borderColor: muiTokens.palette.greyDark + ' !important',
13
+ },
14
+ },
15
+ '.MuiInputBase-root.Mui-disabled': {
16
+ backgroundColor: muiTokens.palette.greyXLight,
17
+ color: muiTokens.palette.greyDark,
18
+ borderColor: muiTokens.palette.greyLightDefaultBorder + ' !important',
19
+ WebkitTextFillColor: muiTokens.palette.greyDark,
20
+ },
7
21
  '.MuiInputBase-root': {
8
22
  height: '44px',
9
23
  padding: 0 + ' !important',
@@ -11,9 +25,6 @@ const SelectCss = (
11
25
  '.SelectIcon': {
12
26
  color: muiTokens.palette.blueClickable + ' !important',
13
27
  },
14
- '&.Mui-error': {
15
- '.SelectIcon': { color: muiTokens.palette.redError },
16
- },
17
28
  },
18
29
  '.MuiFormLabel-root.Mui-focused': {
19
30
  transform: 'translate(14px, -7px) scale(0.75) !important',
@@ -61,8 +72,10 @@ const SelectCss = (
61
72
  borderWidth: '1px',
62
73
  borderColor: muiTokens.palette.blueClickable,
63
74
  },
64
- '.Mui-error .MuiOutlinedInput-notchedOutline': {
65
- borderColor: muiTokens.palette.redError + ' !important',
75
+ '&.Mui-error': {
76
+ '.MuiOutlinedInput-notchedOutline': {
77
+ borderColor: muiTokens.palette.redError + ' !important',
78
+ },
66
79
  },
67
80
  '.clear': {
68
81
  visibility: 'hidden',
@@ -71,14 +84,7 @@ const SelectCss = (
71
84
  marginTop: '2px',
72
85
  marginRight: '-8px',
73
86
  },
74
- '&:hover': {
75
- '.clear': {
76
- visibility: 'visible',
77
- },
78
- '.MuiOutlinedInput-notchedOutline': {
79
- borderColor: muiTokens.palette.greyDark,
80
- },
81
- },
87
+
82
88
  '& .MuiSelect-select .notranslate::after': {
83
89
  fontWeight: 400,
84
90
  lineHeight: '18px',
@@ -91,7 +97,7 @@ const SelectCss = (
91
97
  fontSize: '14px',
92
98
  lineHeight: '18px',
93
99
  fontWeight: 400,
94
- padding: '13px 31px 11px 8px',
100
+ padding: '13px 22px 11px 8px',
95
101
  '&.Mui-disabled': {
96
102
  color: muiTokens.palette.greyDark,
97
103
  },
@@ -194,12 +200,6 @@ const SelectCss = (
194
200
  '.MuiFormLabel-colorSuccess': {
195
201
  color: muiTokens.palette.greenSuccess + ' !important',
196
202
  },
197
- '.MuiInputBase-root.Mui-disabled': {
198
- backgroundColor: muiTokens.palette.greyXLight,
199
- color: muiTokens.palette.greyDark,
200
- borderColor: muiTokens.palette.greyLightDefaultBorder,
201
- WebkitTextFillColor: muiTokens.palette.greyDark,
202
- },
203
203
  '.MuiInputBase-colorSuccess': {
204
204
  '.SelectIcon': {
205
205
  color: muiTokens.palette.greenSuccess + ' !important',
@@ -229,4 +229,4 @@ const SelectCss = (
229
229
  };
230
230
  };
231
231
 
232
- export default SelectCss;
232
+ export default SelectCss;
@@ -1,6 +1,6 @@
1
- const SnackbarCss = (
2
- muiTokens: Record<string, string | number | any>
3
- ): Record<string, unknown> => {
1
+ import { MuiTokens } from '../../interfaces/theme';
2
+
3
+ const SnackbarCss = (muiTokens: MuiTokens): Record<string, unknown> => {
4
4
  return {
5
5
  '&.MuiPaper-root': {
6
6
  padding: '8px 16px 8px 16px',
@@ -8,34 +8,34 @@ const SnackbarCss = (
8
8
  color: 'white',
9
9
  fontWeight: '700',
10
10
  fontSize: '14px',
11
- width: '350px'
11
+ width: '350px',
12
12
  },
13
13
  '.MuiAlert-message': {
14
- padding: '0px'
14
+ padding: '0px',
15
15
  },
16
16
  '&.MuiAlert-standardSuccess': {
17
- backgroundColor: muiTokens.palette.greenSuccess
17
+ backgroundColor: muiTokens.palette.greenSuccess,
18
18
  },
19
19
  '&.MuiAlert-standardWarning': {
20
- backgroundColor: muiTokens.palette.orangeWarning
20
+ backgroundColor: muiTokens.palette.orangeWarning,
21
21
  },
22
22
  '&.MuiAlert-standardError': {
23
- backgroundColor: muiTokens.palette.redError
23
+ backgroundColor: muiTokens.palette.redError,
24
24
  },
25
25
  '&.MuiAlert-standardInfo': {
26
- backgroundColor: muiTokens.palette.blueInfo
26
+ backgroundColor: muiTokens.palette.blueInfo,
27
27
  },
28
28
  '.MuiAlert-icon': {
29
29
  alignSelf: 'center',
30
30
  height: '16px',
31
31
  marginRight: '16px',
32
32
  alignItems: 'center',
33
- opacity: 1
33
+ opacity: 1,
34
34
  },
35
35
  '.MuiSvgIcon-root': {
36
- color: 'white'
37
- }
38
- }
36
+ color: 'white',
37
+ },
38
+ },
39
39
  };
40
40
  };
41
41
 
@@ -1,6 +1,6 @@
1
- const TextFieldCss = (
2
- muiTokens: Record<string, string | number | any>,
3
- ): Record<string, unknown> => {
1
+ import { MuiTokens } from '../../interfaces/theme';
2
+
3
+ const TextFieldCss = (muiTokens: MuiTokens): Record<string, unknown> => {
4
4
  return {
5
5
  '.Mui-error .MuiOutlinedInput-notchedOutline': {
6
6
  borderColor: muiTokens.palette.redError + ' !important',
@@ -8,14 +8,14 @@ const TextFieldCss = (
8
8
  '.Mui-focused .MuiOutlinedInput-notchedOutline': {
9
9
  borderColor: muiTokens.palette.blueClickable,
10
10
  },
11
- '.Mui-disabled .MuiOutlinedInput-notchedOutline': {
12
- borderColor: muiTokens.palette.greyLightDefaultBorder + ' !important',
13
- },
14
11
  '&:hover': {
15
12
  '.MuiOutlinedInput-notchedOutline': {
16
- borderColor: muiTokens.palette.greyDark,
13
+ borderColor: muiTokens.palette.greyDark + ' !important',
17
14
  },
18
15
  },
16
+ '.Mui-disabled .MuiOutlinedInput-notchedOutline': {
17
+ borderColor: muiTokens.palette.greyLightDefaultBorder + ' !important',
18
+ },
19
19
  '&.MuiTextField-root': {
20
20
  '.MuiInputBase-root': {
21
21
  backgroundColor: muiTokens.palette.white,
@@ -1,24 +1,24 @@
1
- const IconButtonCss = (
2
- muiTokens: Record<string, string | number | any>
3
- ): Record<string, unknown> => {
1
+ import { MuiTokens } from '../interfaces/theme';
2
+
3
+ const IconButtonCss = (muiTokens: MuiTokens): Record<string, unknown> => {
4
4
  return {
5
5
  '&.MuiIconButton-root': {
6
6
  borderRadius: '4px',
7
7
  '& .MuiTouchRipple-root .MuiTouchRipple-child': {
8
- borderRadius: '4px'
8
+ borderRadius: '4px',
9
9
  },
10
10
  '& .MuiSvgIcon-root': {
11
- color: muiTokens.palette.blueClickable
11
+ color: muiTokens.palette.blueClickable,
12
12
  },
13
13
  '&:hover': {
14
14
  '& .MuiSvgIcon-root': {
15
- color: muiTokens.palette.blueHoverClickable
16
- }
15
+ color: muiTokens.palette.blueHoverClickable,
16
+ },
17
17
  },
18
18
  '&.Mui-disabled': {
19
19
  '& .MuiSvgIcon-root': {
20
- color: muiTokens.palette.greyMediumInactive
21
- }
20
+ color: muiTokens.palette.greyMediumInactive,
21
+ },
22
22
  },
23
23
  '&.IconButtonVariant-default': {
24
24
  width: '44px !important',
@@ -27,40 +27,40 @@ const IconButtonCss = (
27
27
  borderColor: muiTokens.palette.greyLightDefaultBorder,
28
28
  '&:hover': {
29
29
  borderColor: muiTokens.palette.blueHoverClickable,
30
- backgroundColor: muiTokens.palette.white
31
- }
30
+ backgroundColor: muiTokens.palette.white,
31
+ },
32
32
  },
33
33
  '&.IconButtonVariant-table': {
34
34
  width: '42px !important',
35
35
  height: '42px !important',
36
36
  border: '0px',
37
37
  '&:hover': {
38
- backgroundColor: muiTokens.palette.blueHoverOpacity12
39
- }
38
+ backgroundColor: muiTokens.palette.blueHoverOpacity12,
39
+ },
40
40
  },
41
41
  '&.IconButtonPositionGroup-left': {
42
42
  borderRadius: '4px 0px 0px 4px',
43
43
  '& .MuiTouchRipple-root .MuiTouchRipple-child': {
44
- borderRadius: '4px 0px 0px 4px'
45
- }
44
+ borderRadius: '4px 0px 0px 4px',
45
+ },
46
46
  },
47
47
  '&.IconButtonPositionGroup-middle': {
48
48
  borderRadius: '0px',
49
49
  '& .MuiTouchRipple-root .MuiTouchRipple-child': {
50
- borderRadius: '0px'
51
- }
50
+ borderRadius: '0px',
51
+ },
52
52
  },
53
53
  '&.IconButtonPositionGroup-right': {
54
54
  borderRadius: '0px 4px 4px 0px',
55
55
  '& .MuiTouchRipple-root .MuiTouchRipple-child': {
56
- borderRadius: '0px 4px 4px 0px'
57
- }
56
+ borderRadius: '0px 4px 4px 0px',
57
+ },
58
58
  },
59
59
  '&.IconButtonSize-small': {
60
60
  width: '24px !important',
61
- height: '24px !important'
62
- }
63
- }
61
+ height: '24px !important',
62
+ },
63
+ },
64
64
  };
65
65
  };
66
66
 
@@ -1,14 +1,14 @@
1
- const LinkCss = (
2
- muiTokens: Record<string, string | number | any>
3
- ): Record<string, unknown> => {
1
+ import { MuiTokens } from '../interfaces/theme';
2
+
3
+ const LinkCss = (muiTokens: MuiTokens): Record<string, unknown> => {
4
4
  return {
5
5
  '&.MuiLink-root': {
6
6
  color: muiTokens.palette.blueClickable,
7
- cursor: 'pointer'
7
+ cursor: 'pointer',
8
8
  },
9
9
  '&:hover': {
10
- color: muiTokens.palette.blueHoverClickable + ' !important'
11
- }
10
+ color: muiTokens.palette.blueHoverClickable + ' !important',
11
+ },
12
12
  };
13
13
  };
14
14
 
@@ -1,6 +1,6 @@
1
- const PaginationCss = (
2
- muiTokens: Record<string, string | number | any>
3
- ): Record<string, unknown> => {
1
+ import { MuiTokens } from '../interfaces/theme';
2
+
3
+ const PaginationCss = (muiTokens: MuiTokens): Record<string, unknown> => {
4
4
  return {
5
5
  '.MuiPaginationItem-root': {
6
6
  height: '44px !important',
@@ -16,7 +16,7 @@ const PaginationCss = (
16
16
  backgroundColor: 'white !important',
17
17
  borderColor: muiTokens.palette.blueHoverClickable + ' !important',
18
18
  borderRadius: '4px !important',
19
- outline: 'none !important'
19
+ outline: 'none !important',
20
20
  },
21
21
  '&.Mui-selected': {
22
22
  color: 'white !important',
@@ -28,30 +28,30 @@ const PaginationCss = (
28
28
  backgroundColor: muiTokens.palette.blueClickable + ' !important',
29
29
  borderColor: muiTokens.palette.greyDark + ' !important',
30
30
  borderRadius: '4px !important',
31
- outline: 'none !important'
31
+ outline: 'none !important',
32
32
  },
33
33
  '&:focus': {
34
34
  color: 'white !important',
35
35
  backgroundColor: muiTokens.palette.blueClickable + ' !important',
36
36
  borderColor: muiTokens.palette.greyDark + ' !important',
37
37
  borderRadius: '4px !important',
38
- outline: 'none !important'
39
- }
38
+ outline: 'none !important',
39
+ },
40
40
  },
41
41
  '&.Mui-disabled': {
42
42
  color: muiTokens.palette.greyMediumInactive + ' !important',
43
43
  backgroundColor: 'white !important',
44
44
  borderRadius: '4px !important',
45
45
  outline: 'none !important',
46
- opacity: '1 !important'
46
+ opacity: '1 !important',
47
47
  },
48
48
  '&.MuiPaginationItem-ellipsis': {
49
49
  color: muiTokens.palette.greyDark + ' !important',
50
50
  display: 'flex',
51
51
  alignItems: 'center',
52
- justifyContent: 'center'
53
- }
54
- }
52
+ justifyContent: 'center',
53
+ },
54
+ },
55
55
  };
56
56
  };
57
57
 
@@ -1,56 +1,57 @@
1
- const SwitchCss = (
2
- muiTokens: Record<string, string | number | any>
3
- ): Record<string, unknown> => {
1
+ import { MuiTokens } from '../interfaces/theme';
2
+
3
+ const SwitchCss = (muiTokens: MuiTokens): Record<string, unknown> => {
4
4
  return {
5
5
  '& .MuiSwitch-switchBase': {
6
6
  '&:hover': {
7
- backgroundColor: muiTokens.palette.blueHoverOpacity12 + ' !important'
7
+ backgroundColor: muiTokens.palette.blueHoverOpacity12 + ' !important',
8
8
  },
9
9
  '& + .MuiSwitch-track': {
10
10
  backgroundColor: muiTokens.palette.blueHoverEquivalence + ' !important',
11
11
  border: '1px solid',
12
12
  borderColor: muiTokens.palette.blueClickable + ' !important',
13
- opacity: 1
13
+ opacity: 1,
14
14
  },
15
15
  '& + .MuiSwitch-thumb': {
16
- backgroundColor: muiTokens.palette.white + ' !important'
16
+ backgroundColor: muiTokens.palette.white + ' !important',
17
17
  },
18
18
  '&.Mui-disabled': {
19
19
  '& + .MuiSwitch-track': {
20
- backgroundColor: muiTokens.palette.greyLightDefaultBorder + ' !important',
20
+ backgroundColor:
21
+ muiTokens.palette.greyLightDefaultBorder + ' !important',
21
22
  border: '1px solid',
22
23
  borderColor: muiTokens.palette.greyMediumInactive + ' !important',
23
- opacity: 1
24
+ opacity: 1,
24
25
  },
25
26
  '& + .MuiSwitch-thumb': {
26
- backgroundColor: muiTokens.palette.greyDark + ' !important'
27
- }
27
+ backgroundColor: muiTokens.palette.greyDark + ' !important',
28
+ },
28
29
  },
29
30
  '&.Mui-checked': {
30
31
  '& + .MuiSwitch-track': {
31
32
  backgroundColor: muiTokens.palette.blueClickable + ' !important',
32
33
  opacity: 1,
33
34
  border: '1px solid',
34
- borderColor: muiTokens.palette.blueClickable + ' !important'
35
+ borderColor: muiTokens.palette.blueClickable + ' !important',
35
36
  },
36
37
  '& .MuiSwitch-thumb': {
37
- backgroundColor: muiTokens.palette.blueHoverClickable + ' !important'
38
+ backgroundColor: muiTokens.palette.blueHoverClickable + ' !important',
38
39
  },
39
40
  '&:hover': {
40
- backgroundColor: muiTokens.palette.blueHoverOpacity12 + ' !important'
41
- }
41
+ backgroundColor: muiTokens.palette.blueHoverOpacity12 + ' !important',
42
+ },
42
43
  },
43
44
  '&.Mui-disabled.Mui-checked': {
44
45
  '& .MuiSwitch-thumb': {
45
- backgroundColor: muiTokens.palette.greyDark + ' !important'
46
+ backgroundColor: muiTokens.palette.greyDark + ' !important',
46
47
  },
47
48
  '& + .MuiSwitch-track': {
48
49
  backgroundColor: muiTokens.palette.greyMediumInactive + ' !important',
49
50
  border: '1px solid',
50
- borderColor: muiTokens.palette.greyMediumInactive + ' !important'
51
- }
52
- }
53
- }
51
+ borderColor: muiTokens.palette.greyMediumInactive + ' !important',
52
+ },
53
+ },
54
+ },
54
55
  };
55
56
  };
56
57
 
@@ -1,24 +1,21 @@
1
- const TooltipCss = (
2
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
3
- muiTokens: Record<string, string | number | any>
4
- ): Record<string, unknown> => {
1
+ const TooltipCss = (): Record<string, unknown> => {
5
2
  return {
6
3
  '& .MuiTooltip-tooltip': {
7
4
  background: 'red',
8
- backgroundColor: 'red'
5
+ backgroundColor: 'red',
9
6
  },
10
7
  '.MuiTooltip-tooltip': {
11
8
  background: 'red',
12
- backgroundColor: 'red'
9
+ backgroundColor: 'red',
13
10
  },
14
11
  '& .MuiPopper-popper': {
15
12
  background: 'red',
16
- backgroundColor: 'red'
13
+ backgroundColor: 'red',
17
14
  },
18
15
  '.MuiPopper-popper': {
19
16
  background: 'red',
20
- backgroundColor: 'red'
21
- }
17
+ backgroundColor: 'red',
18
+ },
22
19
  };
23
20
  };
24
21
 
@@ -1,9 +1,9 @@
1
- import * as tokens from '../themes/tokens';
2
1
  import { Theme, Types } from '../interfaces/theme';
2
+ import * as tokens from '../themes/tokens';
3
3
 
4
4
  export const getTokensByType = (
5
5
  themeName: Theme,
6
- type: Types
6
+ type: Types,
7
7
  ): Record<string, string> => {
8
8
  const defaultTokens: Record<string, string> = {};
9
9
 
@@ -17,10 +17,10 @@ export const getTokensByType = (
17
17
  case 'lineHeights':
18
18
  case 'fontSize':
19
19
  case 'paragraphSpacing':
20
- defaultTokens[parsedTokenKey] = (tokens as any)[tokenKey] + 'px';
20
+ defaultTokens[parsedTokenKey] = tokens[tokenKey] + 'px';
21
21
  break;
22
22
  default:
23
- defaultTokens[parsedTokenKey] = (tokens as any)[tokenKey];
23
+ defaultTokens[parsedTokenKey] = tokens[tokenKey];
24
24
  }
25
25
  }
26
26
  });
@@ -28,8 +28,10 @@ export const getTokensByType = (
28
28
  return defaultTokens;
29
29
  };
30
30
 
31
- export const getMuiPalette = (themeName: Theme): Record<string, any> => {
32
- const palette: Record<string, string | any> = {};
31
+ export const getMuiPalette = (
32
+ themeName: Theme,
33
+ ): Record<string, string | number | unknown> => {
34
+ const palette: Record<string, string | number | unknown> = {};
33
35
 
34
36
  Object.keys(tokens).forEach((colorName) => {
35
37
  // color structure :
@@ -37,39 +39,39 @@ export const getMuiPalette = (themeName: Theme): Record<string, any> => {
37
39
  // récupérer last iteration of "Colors" pour avoir le nom de la couleur
38
40
  if (colorName.startsWith(themeName) && colorName.indexOf('Colors')) {
39
41
  let colorKey = colorName.substring(
40
- colorName.lastIndexOf('Colors') + 'Colors'.length
42
+ colorName.lastIndexOf('Colors') + 'Colors'.length,
41
43
  );
42
44
 
43
45
  colorKey = colorKey.charAt(0).toLowerCase() + colorKey.slice(1);
44
- palette[colorKey] = (tokens as any)[colorName] as 'primary';
46
+ palette[colorKey] = tokens[colorName] as 'primary';
45
47
  }
46
48
  });
47
49
 
48
50
  const defaultPalette = {
49
51
  primary: {
50
52
  main: palette['blueClickable'],
51
- dark: palette['blueHoverClickable']
53
+ dark: palette['blueHoverClickable'],
52
54
  },
53
55
  secondary: {
54
- main: palette['redActual']
56
+ main: palette['redActual'],
55
57
  },
56
58
  success: {
57
- main: palette['greenSuccess']
59
+ main: palette['greenSuccess'],
58
60
  },
59
61
  error: {
60
- main: palette['redError']
62
+ main: palette['redError'],
61
63
  },
62
64
  warning: {
63
- main: palette['orangeWarning']
65
+ main: palette['orangeWarning'],
64
66
  },
65
67
  infos: {
66
- main: palette['blueInfo']
67
- }
68
+ main: palette['blueInfo'],
69
+ },
68
70
  };
69
71
 
70
72
  return {
71
73
  ...palette,
72
- ...defaultPalette
74
+ ...defaultPalette,
73
75
  };
74
76
  };
75
77
 
@@ -29,3 +29,6 @@ export type Types =
29
29
  // Default = Theme backoffice Material
30
30
  // Ep = Espace personnel
31
31
  export type Theme = 'Default' | 'Ep';
32
+
33
+ /* eslint-disable @typescript-eslint/no-explicit-any */
34
+ export type MuiTokens = Record<string, any>;