@groupeactual/design-tokens 1.7.10 → 2.0.0-beta.0

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 (108) hide show
  1. package/dist/cjs/index.js +23 -1
  2. package/dist/es/index.d.ts +244 -63
  3. package/dist/es/index.js +23 -1
  4. package/dist/types/helpers/theme.helper.d.ts +5 -0
  5. package/dist/types/index.d.ts +2 -0
  6. package/dist/types/interfaces/theme.interface.d.ts +242 -0
  7. package/dist/types/styled/Accordion.d.ts +4 -0
  8. package/dist/types/styled/Alert.d.ts +4 -0
  9. package/dist/types/styled/Autocomplete.d.ts +4 -0
  10. package/dist/types/styled/Breadcrumbs.d.ts +4 -0
  11. package/dist/types/styled/Button.d.ts +4 -0
  12. package/dist/types/styled/Checkbox.d.ts +4 -0
  13. package/dist/types/styled/Chip.d.ts +4 -0
  14. package/dist/types/styled/Divider.d.ts +4 -0
  15. package/dist/types/styled/FormHelperText.d.ts +4 -0
  16. package/dist/types/styled/FormLabel.d.ts +4 -0
  17. package/dist/types/styled/IconButton.d.ts +4 -0
  18. package/dist/types/styled/InputLabel.d.ts +4 -0
  19. package/dist/types/styled/MenuItem.d.ts +4 -0
  20. package/dist/types/styled/OutlinedInput.d.ts +4 -0
  21. package/dist/types/styled/PaginationItem.d.ts +4 -0
  22. package/dist/types/styled/Radio.d.ts +4 -0
  23. package/dist/types/styled/Select.d.ts +4 -0
  24. package/dist/types/styled/Switch.d.ts +4 -0
  25. package/dist/types/styled/Table.d.ts +4 -0
  26. package/dist/types/styled/TextField.d.ts +4 -0
  27. package/dist/types/styled/Typography.d.ts +4 -0
  28. package/dist/types/theme/theme.d.ts +4 -0
  29. package/package.json +22 -14
  30. package/src/helpers/theme.helper.ts +229 -0
  31. package/src/index.ts +2 -4
  32. package/src/interfaces/theme.interface.ts +270 -0
  33. package/src/styled/Accordion.ts +49 -0
  34. package/src/styled/Alert.ts +83 -0
  35. package/src/styled/Autocomplete.ts +24 -0
  36. package/src/styled/Breadcrumbs.ts +29 -0
  37. package/src/styled/Button.ts +109 -0
  38. package/src/styled/Checkbox.ts +81 -0
  39. package/src/styled/Chip.ts +201 -0
  40. package/src/styled/Divider.ts +24 -0
  41. package/src/styled/FormHelperText.ts +28 -0
  42. package/src/styled/FormLabel.ts +30 -0
  43. package/src/styled/IconButton.ts +161 -0
  44. package/src/styled/InputLabel.ts +30 -0
  45. package/src/styled/MenuItem.ts +73 -0
  46. package/src/styled/OutlinedInput.ts +89 -0
  47. package/src/styled/PaginationItem.ts +72 -0
  48. package/src/styled/Radio.ts +67 -0
  49. package/src/styled/Select.ts +38 -0
  50. package/src/styled/Switch.ts +62 -0
  51. package/src/styled/Table.ts +54 -0
  52. package/src/styled/TextField.ts +105 -0
  53. package/src/styled/Typography.ts +67 -0
  54. package/src/theme/theme.tsx +23 -0
  55. package/src/tokens/tokens.json +667 -6
  56. package/dist/types/src/css/accordionCss.d.ts +0 -3
  57. package/dist/types/src/css/bannerNotificationCss.d.ts +0 -3
  58. package/dist/types/src/css/breadcrumbsCss.d.ts +0 -3
  59. package/dist/types/src/css/buttonCss.d.ts +0 -3
  60. package/dist/types/src/css/chipCss.d.ts +0 -3
  61. package/dist/types/src/css/datatable/datatableCss.d.ts +0 -3
  62. package/dist/types/src/css/form/autoCompleteCss.d.ts +0 -3
  63. package/dist/types/src/css/form/checkboxCss.d.ts +0 -3
  64. package/dist/types/src/css/form/checkboxGroupCss.d.ts +0 -3
  65. package/dist/types/src/css/form/datePickerCss.d.ts +0 -3
  66. package/dist/types/src/css/form/radioCss.d.ts +0 -3
  67. package/dist/types/src/css/form/selectCss.d.ts +0 -3
  68. package/dist/types/src/css/form/snackbarCss.d.ts +0 -3
  69. package/dist/types/src/css/form/textFieldCss.d.ts +0 -3
  70. package/dist/types/src/css/iconButtonCss.d.ts +0 -3
  71. package/dist/types/src/css/index.d.ts +0 -20
  72. package/dist/types/src/css/linkCss.d.ts +0 -3
  73. package/dist/types/src/css/menuItemCss.d.ts +0 -3
  74. package/dist/types/src/css/paginationCss.d.ts +0 -3
  75. package/dist/types/src/css/switchCss.d.ts +0 -3
  76. package/dist/types/src/css/tooltipCss.d.ts +0 -2
  77. package/dist/types/src/helpers/theme.d.ts +0 -4
  78. package/dist/types/src/index.d.ts +0 -4
  79. package/dist/types/src/interfaces/theme.d.ts +0 -16
  80. package/dist/types/src/themes/tokens.d.ts +0 -167
  81. package/dist/types/src/useMaterialThemeTokens.d.ts +0 -6
  82. package/dist/types/src/useThemeTokens.d.ts +0 -6
  83. package/src/css/accordionCss.ts +0 -30
  84. package/src/css/bannerNotificationCss.ts +0 -52
  85. package/src/css/breadcrumbsCss.ts +0 -19
  86. package/src/css/buttonCss.ts +0 -80
  87. package/src/css/chipCss.ts +0 -142
  88. package/src/css/datatable/datatableCss.ts +0 -32
  89. package/src/css/form/autoCompleteCss.ts +0 -340
  90. package/src/css/form/checkboxCss.ts +0 -128
  91. package/src/css/form/checkboxGroupCss.ts +0 -42
  92. package/src/css/form/datePickerCss.ts +0 -117
  93. package/src/css/form/radioCss.ts +0 -102
  94. package/src/css/form/selectCss.ts +0 -233
  95. package/src/css/form/snackbarCss.ts +0 -42
  96. package/src/css/form/textFieldCss.ts +0 -188
  97. package/src/css/iconButtonCss.ts +0 -64
  98. package/src/css/index.ts +0 -20
  99. package/src/css/linkCss.ts +0 -15
  100. package/src/css/menuItemCss.ts +0 -31
  101. package/src/css/paginationCss.ts +0 -59
  102. package/src/css/switchCss.ts +0 -58
  103. package/src/css/tooltipCss.ts +0 -5
  104. package/src/helpers/theme.ts +0 -89
  105. package/src/interfaces/theme.ts +0 -34
  106. package/src/themes/tokens.ts +0 -169
  107. package/src/useMaterialThemeTokens.ts +0 -218
  108. package/src/useThemeTokens.ts +0 -30
@@ -0,0 +1,270 @@
1
+ import { ColorPartial } from '@mui/material/styles/createPalette';
2
+
3
+ // * Interne = One theme only for now
4
+ export type Theme = 'Interne' | 'Externe';
5
+
6
+ export interface ThemeValue {
7
+ value: string;
8
+ type: string;
9
+ }
10
+
11
+ export type DefaultColors = { [key: string]: ThemeValue };
12
+
13
+ export interface ThemeStructure {
14
+ 'DFLib-Variables/Interne'?: TokenStructure;
15
+ 'DFLib-Variables/Interne/defaultColors'?: CustomColors;
16
+ 'DFLib-Variables/Externe'?: TokenStructure;
17
+ }
18
+
19
+ export interface PaletteColors {
20
+ primary: ColorCategory;
21
+ secondary: ColorCategory;
22
+ error: ColorCategory;
23
+ warning: ColorCategory;
24
+ success: ColorCategory;
25
+ infos: ColorCategory;
26
+ text: TextColors;
27
+ background: Background;
28
+ border: Border;
29
+ action: {
30
+ hoverOpacity: ThemeValue;
31
+ };
32
+ }
33
+
34
+ export interface TokenStructure {
35
+ palette?: PaletteColors;
36
+ Typography?: TypographyTokens;
37
+ spacing?: SpacingTokens;
38
+ radius?: RadiusTokens;
39
+ }
40
+
41
+ export interface TextDefaultColors {
42
+ greyDark?: ThemeValue;
43
+ }
44
+
45
+ export interface BackgroundDefaultColors {
46
+ white?: ThemeValue;
47
+ greyXLight?: ThemeValue;
48
+ greyXDarkBgModal?: ThemeValue;
49
+ blueHoverEquivalence?: ThemeValue;
50
+ blueHoverOpacity12?: ThemeValue;
51
+ }
52
+
53
+ export interface BorderDefaultColors {
54
+ greyLightDefaultBorder?: ThemeValue;
55
+ }
56
+
57
+ export interface NotificationDefaultColors {
58
+ blueInfo?: ThemeValue;
59
+ greenSuccess?: ThemeValue;
60
+ orangeWarning?: ThemeValue;
61
+ redError?: ThemeValue;
62
+ }
63
+
64
+ export interface SecondaryDefaultColors {
65
+ blueDark?: ThemeValue;
66
+ blueMedium?: ThemeValue;
67
+ blueLight?: ThemeValue;
68
+ greenDark?: ThemeValue;
69
+ greenMedium?: ThemeValue;
70
+ green?: ThemeValue;
71
+ greenLight?: ThemeValue;
72
+ brown?: ThemeValue;
73
+ brownLight?: ThemeValue;
74
+ orangeLight?: ThemeValue;
75
+ yellow?: ThemeValue;
76
+ purpleDark?: ThemeValue;
77
+ purple?: ThemeValue;
78
+ pink?: ThemeValue;
79
+ pinkLight?: ThemeValue;
80
+ }
81
+
82
+ export interface CustomColors {
83
+ redActual?: ThemeValue;
84
+ blueClickable?: ThemeValue;
85
+ blueHoverClickable?: ThemeValue;
86
+ blueHoverOpacity12?: ThemeValue;
87
+ greyMediumInactive?: ThemeValue;
88
+ greyXDark?: ThemeValue;
89
+ textColors: TextDefaultColors;
90
+ backgroundColors: BackgroundDefaultColors;
91
+ borderColors: BorderDefaultColors;
92
+ notificationColors: NotificationDefaultColors;
93
+ secondaryColors: SecondaryDefaultColors;
94
+ }
95
+
96
+ export interface ColorCategory {
97
+ main?: ThemeValue;
98
+ mainChannel?: ThemeValue;
99
+ light?: ThemeValue;
100
+ 'light 2'?: ThemeValue;
101
+ 'light 3'?: ThemeValue;
102
+ lightChannel?: ThemeValue;
103
+ dark?: ThemeValue;
104
+ 'dark 2'?: ThemeValue;
105
+ 'dark 3'?: ThemeValue;
106
+ darkChannel?: ThemeValue;
107
+ 'secondary contrast text'?: ThemeValue;
108
+ 'primary contrast text'?: ThemeValue;
109
+ }
110
+
111
+ export interface TextColors {
112
+ primary: ThemeValue;
113
+ secondary: ThemeValue;
114
+ disabled: ThemeValue;
115
+ dark: ThemeValue;
116
+ }
117
+
118
+ export interface Background {
119
+ default: ThemeValue;
120
+ grey: ThemeValue;
121
+ }
122
+
123
+ export interface Border {
124
+ default: ThemeValue;
125
+ grey: ThemeValue;
126
+ }
127
+
128
+ export interface TypographyToken {
129
+ fontFamily: { value: string; type: string };
130
+ fontSize: { value: string; type: string };
131
+ LineHeight: { value: string; type: string };
132
+ fontWeight: { value: string; type: string };
133
+ }
134
+
135
+ export interface TypographyTokens {
136
+ h1: TypographyToken;
137
+ h2: TypographyToken;
138
+ h3: TypographyToken;
139
+ h4: TypographyToken;
140
+ h5: TypographyToken;
141
+ h6: TypographyToken;
142
+ subtitle1: TypographyToken;
143
+ subtitle2: TypographyToken;
144
+ body1: TypographyToken;
145
+ body2: TypographyToken;
146
+ button: TypographyToken;
147
+ caption: TypographyToken;
148
+ }
149
+
150
+ export interface SpacingTokens {
151
+ xxs: ThemeValue;
152
+ xs: ThemeValue;
153
+ sm: ThemeValue;
154
+ md: ThemeValue;
155
+ lg: ThemeValue;
156
+ xl: ThemeValue;
157
+ xxl: ThemeValue;
158
+ }
159
+
160
+ export interface RadiusTokens {
161
+ small: ThemeValue;
162
+ medium: ThemeValue;
163
+ large: ThemeValue;
164
+ xLarge: ThemeValue;
165
+ }
166
+
167
+ export type PaletteColorOptions = BasicPaletteColorOptions | ColorPartial;
168
+
169
+ export interface BasicPaletteColorOptions {
170
+ light?: string;
171
+ lightChannel?: string;
172
+ light2?: string;
173
+ light3?: string;
174
+ main: string;
175
+ mainChannel?: string;
176
+ dark?: string;
177
+ darkChannel?: string;
178
+ dark2?: string;
179
+ dark3?: string;
180
+ contrastText?: string;
181
+ }
182
+
183
+ export interface TextPaletteColorOptions {
184
+ secondary?: string;
185
+ primary?: string;
186
+ dark?: string;
187
+ disabled?: string;
188
+ }
189
+
190
+ export interface BackgroundPaletteColorOptions {
191
+ default?: string;
192
+ paper?: string;
193
+ grey?: string;
194
+ }
195
+
196
+ export interface BorderPaletteColorOptions {
197
+ default?: string;
198
+ grey?: string;
199
+ }
200
+
201
+ export interface PaletteDefaultColors {
202
+ redActual?: string;
203
+ blueClickable?: string;
204
+ blueHoverClickable?: string;
205
+ greyMediumInactive?: string;
206
+ greyXDark?: string;
207
+ greyDark?: string;
208
+ white?: string;
209
+ greyXLight?: string;
210
+ greyXDarkBgModal?: string;
211
+ blueHoverEquivalence?: string;
212
+ blueHoverOpacity12?: string;
213
+ greyLightDefaultBorder?: string;
214
+ blueInfo?: string;
215
+ greenSuccess?: string;
216
+ orangeWarning?: string;
217
+ redError?: string;
218
+ blueDark?: string;
219
+ blueMedium?: string;
220
+ blueLight?: string;
221
+ greenDark?: string;
222
+ greenMedium?: string;
223
+ green?: string;
224
+ greenLight?: string;
225
+ brown?: string;
226
+ brownLight?: string;
227
+ orangeLight?: string;
228
+ yellow?: string;
229
+ purpleDark?: string;
230
+ purple?: string;
231
+ pink?: string;
232
+ pinkLight?: string;
233
+ }
234
+
235
+ export interface PaletteDS extends PaletteDefaultColors {
236
+ primary?: BasicPaletteColorOptions;
237
+ secondary?: BasicPaletteColorOptions;
238
+ error?: BasicPaletteColorOptions;
239
+ warning?: BasicPaletteColorOptions;
240
+ success?: BasicPaletteColorOptions;
241
+ info?: BasicPaletteColorOptions;
242
+ text?: TextPaletteColorOptions;
243
+ border?: BorderPaletteColorOptions;
244
+ }
245
+
246
+ // * TODO = Remove this interface when all css are removed
247
+ export interface MuiTokens {
248
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
249
+ palette: any;
250
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
251
+ typography: any;
252
+ }
253
+
254
+ export type SpacingArgument = number | string;
255
+ export interface Spacing {
256
+ (): string;
257
+ (_value: SpacingArgument): string;
258
+ (_topBottom: SpacingArgument, _rightLeft: SpacingArgument): string;
259
+ (
260
+ _top: SpacingArgument,
261
+ _rightLeft: SpacingArgument,
262
+ _bottom: SpacingArgument,
263
+ ): string;
264
+ (
265
+ _top: SpacingArgument,
266
+ _right: SpacingArgument,
267
+ _bottom: SpacingArgument,
268
+ _left: SpacingArgument,
269
+ ): string;
270
+ }
@@ -0,0 +1,49 @@
1
+ import { Components } from '@mui/material';
2
+
3
+ import {
4
+ CustomColors,
5
+ Spacing,
6
+ TokenStructure,
7
+ } from '@/interfaces/theme.interface';
8
+
9
+ const Accordion = (
10
+ spacing: Spacing,
11
+ tokens: TokenStructure & CustomColors,
12
+ ): Components<unknown> => {
13
+ return {
14
+ MuiAccordion: {
15
+ styleOverrides: {
16
+ root: {
17
+ border: `1px solid`,
18
+ borderColor: tokens.palette?.border.default?.value,
19
+ boxShadow: 'none',
20
+ },
21
+ },
22
+ },
23
+ MuiAccordionSummary: {
24
+ styleOverrides: {
25
+ root: {
26
+ minHeight: 'auto !important',
27
+ padding: spacing(2, 4),
28
+ },
29
+ },
30
+ },
31
+ MuiAccordionDetails: {
32
+ styleOverrides: {
33
+ root: {
34
+ borderTop: `1px solid`,
35
+ borderColor: tokens.palette?.border.default?.value,
36
+ backgroundColor: tokens.palette?.background.grey?.value,
37
+ fontWeight: 400,
38
+ fontSize: '14px',
39
+ lineHeight: '18px',
40
+ padding: spacing(4),
41
+ borderBottomLeftRadius: 1,
42
+ borderBottomRightRadius: 1,
43
+ },
44
+ },
45
+ },
46
+ };
47
+ };
48
+
49
+ export default Accordion;
@@ -0,0 +1,83 @@
1
+ import { Components } from '@mui/material';
2
+
3
+ import {
4
+ CustomColors,
5
+ Spacing,
6
+ TokenStructure,
7
+ } from '@/interfaces/theme.interface';
8
+
9
+ const Alert = (
10
+ spacing: Spacing,
11
+ tokens: TokenStructure & CustomColors,
12
+ ): Components<unknown> => {
13
+ return {
14
+ MuiAlert: {
15
+ styleOverrides: {
16
+ root: {
17
+ '&.MuiAlert-standardInfo': {
18
+ backgroundColor: tokens?.notificationColors?.blueInfo?.value,
19
+ },
20
+ '&.MuiAlert-standardWarning': {
21
+ backgroundColor: tokens?.notificationColors?.orangeWarning?.value,
22
+ },
23
+ '&.MuiAlert-standardError': {
24
+ backgroundColor: tokens?.notificationColors?.redError?.value,
25
+ },
26
+ '&.MuiAlert-standardSuccess': {
27
+ backgroundColor: tokens?.notificationColors?.greenSuccess?.value,
28
+ },
29
+ '&.MuiAlertSnackbar': {
30
+ padding: spacing(2, 4, 2, 4),
31
+ color: 'white',
32
+ fontWeight: '700',
33
+ fontSize: '14px',
34
+ width: '350px',
35
+ '.MuiAlert-message': {
36
+ padding: '0px',
37
+ },
38
+ '.MuiAlert-icon': {
39
+ alignSelf: 'center',
40
+ height: '16px',
41
+ marginRight: spacing(4),
42
+ alignItems: 'center',
43
+ opacity: 1,
44
+ },
45
+ '.MuiSvgIcon-root': {
46
+ color: 'white',
47
+ },
48
+ },
49
+ '&.MuiAlertBannerNotification': {
50
+ height: '50px',
51
+ paddingLeft: spacing(6),
52
+ paddingRight: spacing(6),
53
+ borderRadius: 0,
54
+ color: 'white',
55
+ fontWeight: '700',
56
+ fontSize: '14px',
57
+ maxWidth: '1600px',
58
+ '.MuiAlert-icon': {
59
+ opacity: 1 + ' !important',
60
+ alignItems: 'center',
61
+ marginRight: spacing(2),
62
+ },
63
+ '.MuiAlert-message': {
64
+ alignSelf: 'center',
65
+ },
66
+ '.MuiSvgIcon-root': {
67
+ color: 'white',
68
+ '-webkit-tap-highlight-color': 'white',
69
+ },
70
+ '.MuiAlert-action': {
71
+ cursor: 'pointer',
72
+ marginRight: 0,
73
+ padding: 0,
74
+ alignSelf: 'center',
75
+ },
76
+ },
77
+ },
78
+ },
79
+ },
80
+ };
81
+ };
82
+
83
+ export default Alert;
@@ -0,0 +1,24 @@
1
+ import { Components } from '@mui/material';
2
+
3
+ import {
4
+ CustomColors,
5
+ Spacing,
6
+ TokenStructure,
7
+ } from '@/interfaces/theme.interface';
8
+
9
+ const Autocomplete = (
10
+ _spacing: Spacing,
11
+ _tokens: TokenStructure & CustomColors,
12
+ ): Components<unknown> => {
13
+ return {
14
+ MuiAutocomplete: {
15
+ styleOverrides: {
16
+ paper: {
17
+ marginTop: 0 + ' !important',
18
+ },
19
+ },
20
+ },
21
+ };
22
+ };
23
+
24
+ export default Autocomplete;
@@ -0,0 +1,29 @@
1
+ import { Components } from '@mui/material';
2
+
3
+ import {
4
+ CustomColors,
5
+ Spacing,
6
+ TokenStructure,
7
+ } from '@/interfaces/theme.interface';
8
+
9
+ const Breadcrumbs = (
10
+ spacing: Spacing,
11
+ _tokens: TokenStructure & CustomColors,
12
+ ): Components<unknown> => {
13
+ return {
14
+ MuiBreadcrumbs: {
15
+ styleOverrides: {
16
+ root: {
17
+ margin: 0,
18
+ padding: `${spacing(1)} 0`,
19
+ },
20
+ separator: {
21
+ margin: 0,
22
+ padding: `0 ${spacing(1)}`,
23
+ },
24
+ },
25
+ },
26
+ };
27
+ };
28
+
29
+ export default Breadcrumbs;
@@ -0,0 +1,109 @@
1
+ import { Components } from '@mui/material';
2
+
3
+ import {
4
+ CustomColors,
5
+ Spacing,
6
+ TokenStructure,
7
+ } from '@/interfaces/theme.interface';
8
+
9
+ const Button = (
10
+ _spacing: Spacing,
11
+ tokens: TokenStructure & CustomColors,
12
+ ): Components<unknown> => {
13
+ return {
14
+ MuiButton: {
15
+ styleOverrides: {
16
+ root: {
17
+ height: '44px',
18
+ padding: `${tokens.spacing?.sm.value}px ${tokens.spacing?.md.value}px !important`,
19
+ textTransform: 'none',
20
+ borderRadius: Number(tokens.radius?.small.value),
21
+ variants: [
22
+ {
23
+ props: (props) => props.variant === 'tertiary',
24
+ style: {
25
+ padding: `${tokens.spacing?.xs.value}px ${tokens.spacing?.md.value}px !important`,
26
+ color: tokens.palette?.primary.main?.value,
27
+ '.itemIcon': {
28
+ color: tokens.palette?.primary.main?.value,
29
+ },
30
+ '&.Mui-disabled': {
31
+ color: tokens.palette?.text.disabled.value,
32
+ '.itemIcon': {
33
+ color: tokens.palette?.text.disabled.value,
34
+ },
35
+ },
36
+ '&:hover': {
37
+ backgroundColor: tokens.palette?.primary['light 3']?.value,
38
+ color: tokens.palette?.primary.dark?.value,
39
+ '.itemIcon': {
40
+ color: tokens.palette?.primary.dark?.value,
41
+ },
42
+ },
43
+ ':active': {
44
+ color: tokens.palette?.primary.dark?.value,
45
+ '.itemIcon': {
46
+ color: tokens.palette?.primary.dark?.value,
47
+ },
48
+ '.MuiTouchRipple-root': {
49
+ opacity: 0,
50
+ },
51
+ },
52
+ },
53
+ },
54
+ {
55
+ props: (props) =>
56
+ props.variant === 'outlined' && props.color === 'primary', // secondary
57
+ style: {
58
+ '.itemIcon': {
59
+ color: tokens.palette?.primary.main?.value,
60
+ },
61
+ '&.Mui-disabled': {
62
+ borderColor: tokens.palette?.border?.default.value,
63
+ '.itemIcon': {
64
+ color: tokens.palette?.text.disabled.value,
65
+ },
66
+ },
67
+ '&:hover': {
68
+ color: tokens.palette?.primary.dark?.value,
69
+ '.itemIcon': {
70
+ color: tokens.palette?.primary.dark?.value,
71
+ },
72
+ },
73
+ '&:active': {
74
+ color: tokens.palette?.primary.dark?.value,
75
+ '.itemIcon': {
76
+ color: tokens.palette?.primary.dark?.value,
77
+ },
78
+ '.MuiTouchRipple-root': {
79
+ opacity: 0,
80
+ },
81
+ },
82
+ },
83
+ },
84
+ ],
85
+ },
86
+ outlined: {
87
+ borderColor: tokens.palette?.border?.default.value,
88
+ '&.Mui-disabled': {
89
+ color: tokens.palette?.text.disabled.value,
90
+ },
91
+ '&:hover': {
92
+ backgroundColor: tokens.palette?.primary['light 3']?.value,
93
+ },
94
+ },
95
+ contained: {
96
+ boxShadow: 'none !important',
97
+ '&:hover': {
98
+ boxShadow: 'none !important',
99
+ },
100
+ '&:active': {
101
+ boxShadow: 'none !important',
102
+ },
103
+ },
104
+ },
105
+ },
106
+ };
107
+ };
108
+
109
+ export default Button;
@@ -0,0 +1,81 @@
1
+ import { Components } from '@mui/material';
2
+
3
+ import {
4
+ CustomColors,
5
+ Spacing,
6
+ TokenStructure,
7
+ } from '@/interfaces/theme.interface';
8
+
9
+ const Checkbox = (
10
+ spacing: Spacing,
11
+ tokens: TokenStructure & CustomColors,
12
+ ): Components<unknown> => {
13
+ return {
14
+ MuiCheckbox: {
15
+ defaultProps: {
16
+ disableRipple: true,
17
+ },
18
+ styleOverrides: {
19
+ root: {
20
+ width: '24px',
21
+ height: '24px',
22
+ padding: `${spacing(1)} !important`,
23
+ marginRight: `${spacing(1)}`,
24
+ marginBottom: '0px',
25
+ borderRadius: '4px',
26
+ '::before': {
27
+ zIndex: 1,
28
+ content: '" "',
29
+ display: 'block',
30
+ position: 'absolute',
31
+ borderRadius: '4px',
32
+ width: '14px',
33
+ height: '14px',
34
+ backgroundColor: tokens?.palette?.background.default.value,
35
+ },
36
+ '&:hover': {
37
+ backgroundColor: tokens.palette?.primary['light 3']?.value,
38
+ },
39
+ '.MuiSvgIcon-root': {
40
+ zIndex: 1,
41
+ width: '16px',
42
+ height: '16px',
43
+ color: tokens.palette?.border.grey.value,
44
+ path: {
45
+ width: '14px',
46
+ height: '14px',
47
+ },
48
+ },
49
+ '.MuiFormControlLabel-root:hover &': {
50
+ backgroundColor: tokens.palette?.primary['light 3']?.value,
51
+ '&.Mui-disabled': {
52
+ backgroundColor: 'transparent',
53
+ },
54
+ },
55
+ '&.Mui-checked': {
56
+ '.MuiSvgIcon-root': {
57
+ color: tokens.palette?.primary.main?.value + ' !important',
58
+ },
59
+ },
60
+ '&.MuiCheckbox-indeterminate': {
61
+ '.MuiSvgIcon-root': {
62
+ color: tokens.palette?.primary.main?.value + ' !important',
63
+ },
64
+ },
65
+ '&.Mui-disabled': {
66
+ '::before': {
67
+ backgroundColor: tokens.palette?.background.grey.value,
68
+ },
69
+ '.MuiSvgIcon-root': {
70
+ color: tokens.palette?.text?.disabled?.value + ' !important',
71
+ backgroundColor: 'transparent !important',
72
+ outlineOffset: '-2px',
73
+ },
74
+ },
75
+ },
76
+ },
77
+ },
78
+ };
79
+ };
80
+
81
+ export default Checkbox;