@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.
- package/dist/cjs/index.js +23 -1
- package/dist/es/index.d.ts +244 -63
- package/dist/es/index.js +23 -1
- package/dist/types/helpers/theme.helper.d.ts +5 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/interfaces/theme.interface.d.ts +242 -0
- package/dist/types/styled/Accordion.d.ts +4 -0
- package/dist/types/styled/Alert.d.ts +4 -0
- package/dist/types/styled/Autocomplete.d.ts +4 -0
- package/dist/types/styled/Breadcrumbs.d.ts +4 -0
- package/dist/types/styled/Button.d.ts +4 -0
- package/dist/types/styled/Checkbox.d.ts +4 -0
- package/dist/types/styled/Chip.d.ts +4 -0
- package/dist/types/styled/Divider.d.ts +4 -0
- package/dist/types/styled/FormHelperText.d.ts +4 -0
- package/dist/types/styled/FormLabel.d.ts +4 -0
- package/dist/types/styled/IconButton.d.ts +4 -0
- package/dist/types/styled/InputLabel.d.ts +4 -0
- package/dist/types/styled/MenuItem.d.ts +4 -0
- package/dist/types/styled/OutlinedInput.d.ts +4 -0
- package/dist/types/styled/PaginationItem.d.ts +4 -0
- package/dist/types/styled/Radio.d.ts +4 -0
- package/dist/types/styled/Select.d.ts +4 -0
- package/dist/types/styled/Switch.d.ts +4 -0
- package/dist/types/styled/Table.d.ts +4 -0
- package/dist/types/styled/TextField.d.ts +4 -0
- package/dist/types/styled/Typography.d.ts +4 -0
- package/dist/types/theme/theme.d.ts +4 -0
- package/package.json +22 -14
- package/src/helpers/theme.helper.ts +229 -0
- package/src/index.ts +2 -4
- package/src/interfaces/theme.interface.ts +270 -0
- package/src/styled/Accordion.ts +49 -0
- package/src/styled/Alert.ts +83 -0
- package/src/styled/Autocomplete.ts +24 -0
- package/src/styled/Breadcrumbs.ts +29 -0
- package/src/styled/Button.ts +109 -0
- package/src/styled/Checkbox.ts +81 -0
- package/src/styled/Chip.ts +201 -0
- package/src/styled/Divider.ts +24 -0
- package/src/styled/FormHelperText.ts +28 -0
- package/src/styled/FormLabel.ts +30 -0
- package/src/styled/IconButton.ts +161 -0
- package/src/styled/InputLabel.ts +30 -0
- package/src/styled/MenuItem.ts +73 -0
- package/src/styled/OutlinedInput.ts +89 -0
- package/src/styled/PaginationItem.ts +72 -0
- package/src/styled/Radio.ts +67 -0
- package/src/styled/Select.ts +38 -0
- package/src/styled/Switch.ts +62 -0
- package/src/styled/Table.ts +54 -0
- package/src/styled/TextField.ts +105 -0
- package/src/styled/Typography.ts +67 -0
- package/src/theme/theme.tsx +23 -0
- package/src/tokens/tokens.json +667 -6
- package/dist/types/src/css/accordionCss.d.ts +0 -3
- package/dist/types/src/css/bannerNotificationCss.d.ts +0 -3
- package/dist/types/src/css/breadcrumbsCss.d.ts +0 -3
- package/dist/types/src/css/buttonCss.d.ts +0 -3
- package/dist/types/src/css/chipCss.d.ts +0 -3
- package/dist/types/src/css/datatable/datatableCss.d.ts +0 -3
- package/dist/types/src/css/form/autoCompleteCss.d.ts +0 -3
- package/dist/types/src/css/form/checkboxCss.d.ts +0 -3
- package/dist/types/src/css/form/checkboxGroupCss.d.ts +0 -3
- package/dist/types/src/css/form/datePickerCss.d.ts +0 -3
- package/dist/types/src/css/form/radioCss.d.ts +0 -3
- package/dist/types/src/css/form/selectCss.d.ts +0 -3
- package/dist/types/src/css/form/snackbarCss.d.ts +0 -3
- package/dist/types/src/css/form/textFieldCss.d.ts +0 -3
- package/dist/types/src/css/iconButtonCss.d.ts +0 -3
- package/dist/types/src/css/index.d.ts +0 -20
- package/dist/types/src/css/linkCss.d.ts +0 -3
- package/dist/types/src/css/menuItemCss.d.ts +0 -3
- package/dist/types/src/css/paginationCss.d.ts +0 -3
- package/dist/types/src/css/switchCss.d.ts +0 -3
- package/dist/types/src/css/tooltipCss.d.ts +0 -2
- package/dist/types/src/helpers/theme.d.ts +0 -4
- package/dist/types/src/index.d.ts +0 -4
- package/dist/types/src/interfaces/theme.d.ts +0 -16
- package/dist/types/src/themes/tokens.d.ts +0 -167
- package/dist/types/src/useMaterialThemeTokens.d.ts +0 -6
- package/dist/types/src/useThemeTokens.d.ts +0 -6
- package/src/css/accordionCss.ts +0 -30
- package/src/css/bannerNotificationCss.ts +0 -52
- package/src/css/breadcrumbsCss.ts +0 -19
- package/src/css/buttonCss.ts +0 -80
- package/src/css/chipCss.ts +0 -142
- package/src/css/datatable/datatableCss.ts +0 -32
- package/src/css/form/autoCompleteCss.ts +0 -340
- package/src/css/form/checkboxCss.ts +0 -128
- package/src/css/form/checkboxGroupCss.ts +0 -42
- package/src/css/form/datePickerCss.ts +0 -117
- package/src/css/form/radioCss.ts +0 -102
- package/src/css/form/selectCss.ts +0 -233
- package/src/css/form/snackbarCss.ts +0 -42
- package/src/css/form/textFieldCss.ts +0 -188
- package/src/css/iconButtonCss.ts +0 -64
- package/src/css/index.ts +0 -20
- package/src/css/linkCss.ts +0 -15
- package/src/css/menuItemCss.ts +0 -31
- package/src/css/paginationCss.ts +0 -59
- package/src/css/switchCss.ts +0 -58
- package/src/css/tooltipCss.ts +0 -5
- package/src/helpers/theme.ts +0 -89
- package/src/interfaces/theme.ts +0 -34
- package/src/themes/tokens.ts +0 -169
- package/src/useMaterialThemeTokens.ts +0 -218
- package/src/useThemeTokens.ts +0 -30
package/src/css/menuItemCss.ts
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { MuiTokens } from '@/interfaces/theme';
|
|
2
|
-
|
|
3
|
-
const MenuItemCss = (muiTokens: MuiTokens): Record<string, unknown> => {
|
|
4
|
-
return {
|
|
5
|
-
padding: '13px 16px',
|
|
6
|
-
'.itemIcon': {
|
|
7
|
-
color: muiTokens.palette.greyDark,
|
|
8
|
-
},
|
|
9
|
-
'.MuiTypography-root': {
|
|
10
|
-
paddingTop: '2px',
|
|
11
|
-
},
|
|
12
|
-
'&:hover': {
|
|
13
|
-
'.MuiTypography-root': {
|
|
14
|
-
fontWeight: 500,
|
|
15
|
-
paddingTop: '2px',
|
|
16
|
-
},
|
|
17
|
-
'.itemIcon': {
|
|
18
|
-
color: muiTokens.palette.blueHoverClickable,
|
|
19
|
-
},
|
|
20
|
-
backgroundColor: muiTokens.palette.blueHoverOpacity12,
|
|
21
|
-
'& .MuiTypography-body2': {
|
|
22
|
-
color: muiTokens.palette.blueHoverClickable,
|
|
23
|
-
},
|
|
24
|
-
'& .MuiBox-root': {
|
|
25
|
-
color: muiTokens.palette.blueHoverClickable,
|
|
26
|
-
},
|
|
27
|
-
},
|
|
28
|
-
};
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
export default MenuItemCss;
|
package/src/css/paginationCss.ts
DELETED
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import { MuiTokens } from '@/interfaces/theme';
|
|
2
|
-
|
|
3
|
-
const PaginationCss = (muiTokens: MuiTokens): Record<string, unknown> => {
|
|
4
|
-
return {
|
|
5
|
-
'.MuiPaginationItem-root': {
|
|
6
|
-
fontFamily: 'Roboto',
|
|
7
|
-
height: '44px !important',
|
|
8
|
-
width: '44px !important',
|
|
9
|
-
color: muiTokens.palette.blueClickable + ' !important',
|
|
10
|
-
backgroundColor: 'white !important',
|
|
11
|
-
fontWeight: '700 !important',
|
|
12
|
-
outline: 'none !important',
|
|
13
|
-
fontSize: '14px !important',
|
|
14
|
-
borderColor: muiTokens.palette.greyLightDefaultBorder + ' !important',
|
|
15
|
-
'&.Mui-selected': {
|
|
16
|
-
color: 'white !important',
|
|
17
|
-
backgroundColor: muiTokens.palette.blueClickable + ' !important',
|
|
18
|
-
borderRadius: '4px !important',
|
|
19
|
-
outline: 'none !important',
|
|
20
|
-
'&:hover': {
|
|
21
|
-
color: 'white !important',
|
|
22
|
-
backgroundColor: muiTokens.palette.blueClickable + ' !important',
|
|
23
|
-
borderColor: muiTokens.palette.greyDark + ' !important',
|
|
24
|
-
borderRadius: '4px !important',
|
|
25
|
-
outline: 'none !important',
|
|
26
|
-
},
|
|
27
|
-
'&:focus': {
|
|
28
|
-
color: 'white !important',
|
|
29
|
-
backgroundColor: muiTokens.palette.blueClickable + ' !important',
|
|
30
|
-
borderColor: muiTokens.palette.greyDark + ' !important',
|
|
31
|
-
borderRadius: '4px !important',
|
|
32
|
-
outline: 'none !important',
|
|
33
|
-
},
|
|
34
|
-
},
|
|
35
|
-
'&:hover': {
|
|
36
|
-
color: muiTokens.palette.blueClickable + ' !important',
|
|
37
|
-
backgroundColor: 'white !important',
|
|
38
|
-
borderColor: muiTokens.palette.blueHoverClickable + ' !important',
|
|
39
|
-
borderRadius: '4px !important',
|
|
40
|
-
outline: 'none !important',
|
|
41
|
-
},
|
|
42
|
-
'&.Mui-disabled': {
|
|
43
|
-
color: muiTokens.palette.greyMediumInactive + ' !important',
|
|
44
|
-
backgroundColor: 'white !important',
|
|
45
|
-
borderRadius: '4px !important',
|
|
46
|
-
outline: 'none !important',
|
|
47
|
-
opacity: '1 !important',
|
|
48
|
-
},
|
|
49
|
-
'&.MuiPaginationItem-ellipsis': {
|
|
50
|
-
color: muiTokens.palette.greyDark + ' !important',
|
|
51
|
-
display: 'flex',
|
|
52
|
-
alignItems: 'center',
|
|
53
|
-
justifyContent: 'center',
|
|
54
|
-
},
|
|
55
|
-
},
|
|
56
|
-
};
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
export default PaginationCss;
|
package/src/css/switchCss.ts
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { MuiTokens } from '@/interfaces/theme';
|
|
2
|
-
|
|
3
|
-
const SwitchCss = (muiTokens: MuiTokens): Record<string, unknown> => {
|
|
4
|
-
return {
|
|
5
|
-
'& .MuiSwitch-switchBase': {
|
|
6
|
-
'&:hover': {
|
|
7
|
-
backgroundColor: muiTokens.palette.blueHoverOpacity12 + ' !important',
|
|
8
|
-
},
|
|
9
|
-
'& + .MuiSwitch-track': {
|
|
10
|
-
backgroundColor: muiTokens.palette.blueHoverEquivalence + ' !important',
|
|
11
|
-
border: '1px solid',
|
|
12
|
-
borderColor: muiTokens.palette.blueClickable + ' !important',
|
|
13
|
-
opacity: 1,
|
|
14
|
-
},
|
|
15
|
-
'& + .MuiSwitch-thumb': {
|
|
16
|
-
backgroundColor: muiTokens.palette.white + ' !important',
|
|
17
|
-
},
|
|
18
|
-
'&.Mui-disabled': {
|
|
19
|
-
'& + .MuiSwitch-track': {
|
|
20
|
-
backgroundColor:
|
|
21
|
-
muiTokens.palette.greyLightDefaultBorder + ' !important',
|
|
22
|
-
border: '1px solid',
|
|
23
|
-
borderColor: muiTokens.palette.greyMediumInactive + ' !important',
|
|
24
|
-
opacity: 1,
|
|
25
|
-
},
|
|
26
|
-
'& + .MuiSwitch-thumb': {
|
|
27
|
-
backgroundColor: muiTokens.palette.greyDark + ' !important',
|
|
28
|
-
},
|
|
29
|
-
},
|
|
30
|
-
'&.Mui-checked': {
|
|
31
|
-
'& + .MuiSwitch-track': {
|
|
32
|
-
backgroundColor: muiTokens.palette.blueClickable + ' !important',
|
|
33
|
-
opacity: 1,
|
|
34
|
-
border: '1px solid',
|
|
35
|
-
borderColor: muiTokens.palette.blueClickable + ' !important',
|
|
36
|
-
},
|
|
37
|
-
'& .MuiSwitch-thumb': {
|
|
38
|
-
backgroundColor: muiTokens.palette.blueHoverClickable + ' !important',
|
|
39
|
-
},
|
|
40
|
-
'&:hover': {
|
|
41
|
-
backgroundColor: muiTokens.palette.blueHoverOpacity12 + ' !important',
|
|
42
|
-
},
|
|
43
|
-
},
|
|
44
|
-
'&.Mui-disabled.Mui-checked': {
|
|
45
|
-
'& .MuiSwitch-thumb': {
|
|
46
|
-
backgroundColor: muiTokens.palette.greyDark + ' !important',
|
|
47
|
-
},
|
|
48
|
-
'& + .MuiSwitch-track': {
|
|
49
|
-
backgroundColor: muiTokens.palette.greyMediumInactive + ' !important',
|
|
50
|
-
border: '1px solid',
|
|
51
|
-
borderColor: muiTokens.palette.greyMediumInactive + ' !important',
|
|
52
|
-
},
|
|
53
|
-
},
|
|
54
|
-
},
|
|
55
|
-
};
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
export default SwitchCss;
|
package/src/css/tooltipCss.ts
DELETED
package/src/helpers/theme.ts
DELETED
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
import { Theme, Types } from '@/interfaces/theme';
|
|
2
|
-
import * as tokens from '@/themes/tokens';
|
|
3
|
-
|
|
4
|
-
export const getTokensByType = (
|
|
5
|
-
themeName: Theme,
|
|
6
|
-
type: Types,
|
|
7
|
-
): Record<string, string> => {
|
|
8
|
-
const defaultTokens: Record<string, string> = {};
|
|
9
|
-
|
|
10
|
-
Object.keys(tokens).forEach((tokenKey) => {
|
|
11
|
-
if (tokenKey.startsWith(`${themeName}${type}`)) {
|
|
12
|
-
let parsedTokenKey = tokenKey.replace(`${themeName}${type}`, '');
|
|
13
|
-
parsedTokenKey =
|
|
14
|
-
parsedTokenKey.charAt(0).toLowerCase() + parsedTokenKey.slice(1);
|
|
15
|
-
|
|
16
|
-
switch (parsedTokenKey) {
|
|
17
|
-
case 'lineHeights':
|
|
18
|
-
case 'fontSize':
|
|
19
|
-
case 'paragraphSpacing':
|
|
20
|
-
defaultTokens[parsedTokenKey] = tokens[tokenKey] + 'px';
|
|
21
|
-
break;
|
|
22
|
-
default:
|
|
23
|
-
defaultTokens[parsedTokenKey] = tokens[tokenKey];
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
return defaultTokens;
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
export const getMuiPalette = (
|
|
32
|
-
themeName: Theme,
|
|
33
|
-
): Record<string, string | number | unknown> => {
|
|
34
|
-
const palette: Record<string, string | number | unknown> = {};
|
|
35
|
-
|
|
36
|
-
Object.keys(tokens).forEach((colorName) => {
|
|
37
|
-
// color structure :
|
|
38
|
-
// DefaultDefaultColorsBackgroundColorsGreyXLight : Default/DefaultColorsBackgroundColors/GreyXLight -> Theme/Catégorie/Couleur
|
|
39
|
-
// récupérer last iteration of "Colors" pour avoir le nom de la couleur
|
|
40
|
-
if (colorName.startsWith(themeName) && colorName.indexOf('Colors')) {
|
|
41
|
-
let colorKey = colorName.substring(
|
|
42
|
-
colorName.lastIndexOf('Colors') + 'Colors'.length,
|
|
43
|
-
);
|
|
44
|
-
|
|
45
|
-
colorKey = colorKey.charAt(0).toLowerCase() + colorKey.slice(1);
|
|
46
|
-
palette[colorKey] = tokens[colorName] as 'primary';
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
|
-
|
|
50
|
-
const defaultPalette = {
|
|
51
|
-
primary: {
|
|
52
|
-
main: palette['blueClickable'],
|
|
53
|
-
dark: palette['blueHoverClickable'],
|
|
54
|
-
},
|
|
55
|
-
secondary: {
|
|
56
|
-
main: palette['redActual'],
|
|
57
|
-
},
|
|
58
|
-
success: {
|
|
59
|
-
main: palette['greenSuccess'],
|
|
60
|
-
},
|
|
61
|
-
error: {
|
|
62
|
-
main: palette['redError'],
|
|
63
|
-
},
|
|
64
|
-
warning: {
|
|
65
|
-
main: palette['orangeWarning'],
|
|
66
|
-
},
|
|
67
|
-
infos: {
|
|
68
|
-
main: palette['blueInfo'],
|
|
69
|
-
},
|
|
70
|
-
};
|
|
71
|
-
|
|
72
|
-
return {
|
|
73
|
-
...palette,
|
|
74
|
-
...defaultPalette,
|
|
75
|
-
};
|
|
76
|
-
};
|
|
77
|
-
|
|
78
|
-
export const getFontFamilies = (themeName: Theme): string[] => {
|
|
79
|
-
const designTokens = tokens as Record<string, string | number | unknown>;
|
|
80
|
-
const fontFamilies: string[] = [];
|
|
81
|
-
|
|
82
|
-
Object.keys(tokens).forEach((fontFamily) => {
|
|
83
|
-
if (fontFamily.startsWith(themeName + 'FontFamilies')) {
|
|
84
|
-
fontFamilies.push(designTokens[fontFamily] as string);
|
|
85
|
-
}
|
|
86
|
-
});
|
|
87
|
-
|
|
88
|
-
return fontFamilies;
|
|
89
|
-
};
|
package/src/interfaces/theme.ts
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
export interface DesignTokens {
|
|
2
|
-
fontSize: Record<string, string | number>;
|
|
3
|
-
fontWeights: Record<string, string | number>;
|
|
4
|
-
lineHeights: Record<string, string | number>;
|
|
5
|
-
fontFamilies: string[];
|
|
6
|
-
letterSpacing: Record<string, string | number>;
|
|
7
|
-
paragraphSpacing: Record<string, string | number>;
|
|
8
|
-
textCase: Record<string, string | number>;
|
|
9
|
-
textDecoration: Record<string, string | number>;
|
|
10
|
-
colors: Record<string, string | Record<string, string>>;
|
|
11
|
-
spacing: Record<string, string | number>;
|
|
12
|
-
sizing: Record<string, string | number>;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export type Types =
|
|
16
|
-
| 'FontSize'
|
|
17
|
-
| 'FontWeights'
|
|
18
|
-
| 'LineHeights'
|
|
19
|
-
| 'Colors'
|
|
20
|
-
| 'Spacing'
|
|
21
|
-
| 'Sizing'
|
|
22
|
-
| 'FontFamilies'
|
|
23
|
-
| 'LetterSpacing'
|
|
24
|
-
| 'ParagraphSpacing'
|
|
25
|
-
| 'TextCase'
|
|
26
|
-
| 'TextDecoration';
|
|
27
|
-
|
|
28
|
-
// Deux themes pour le moment :
|
|
29
|
-
// Default = Theme backoffice Material
|
|
30
|
-
// Ep = Espace personnel
|
|
31
|
-
export type Theme = 'Default' | 'Ep';
|
|
32
|
-
|
|
33
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
34
|
-
export type MuiTokens = Record<string, any>;
|
package/src/themes/tokens.ts
DELETED
|
@@ -1,169 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Do not edit directly
|
|
3
|
-
* Generated on Thu, 23 Feb 2023 15:24:19 GMT
|
|
4
|
-
*/
|
|
5
|
-
export const DefaultWebShadowAllContent = {
|
|
6
|
-
color: '#2727271f',
|
|
7
|
-
type: 'dropShadow',
|
|
8
|
-
x: '0',
|
|
9
|
-
y: '2',
|
|
10
|
-
blur: '10',
|
|
11
|
-
spread: '0',
|
|
12
|
-
};
|
|
13
|
-
export const DefaultSpacingXxs = '4';
|
|
14
|
-
export const DefaultSpacingXs = '8';
|
|
15
|
-
export const DefaultSpacingMd = '16';
|
|
16
|
-
export const DefaultSpacingLg = '24';
|
|
17
|
-
export const DefaultSpacingXl = '32';
|
|
18
|
-
export const DefaultSpacingXxl = '40';
|
|
19
|
-
export const DefaultSpacingXxxl = '72';
|
|
20
|
-
export const DefaultBorderRadius4 = '4';
|
|
21
|
-
export const DefaultBorderRadius8 = '8';
|
|
22
|
-
export const DefaultBorderRadius16 = '16';
|
|
23
|
-
export const DefaultBorderRadius24 = '24';
|
|
24
|
-
export const DefaultSizingXs = '8';
|
|
25
|
-
export const DefaultSizingSm = '12';
|
|
26
|
-
export const DefaultSizingMd = '16';
|
|
27
|
-
export const DefaultSizingLg = '24';
|
|
28
|
-
export const DefaultSizingXl = '32';
|
|
29
|
-
export const DefaultSizingXxl = '40';
|
|
30
|
-
export const DefaultSizingXxxl = '72';
|
|
31
|
-
export const DefaultFontFamiliesRoboto = 'Roboto';
|
|
32
|
-
export const DefaultLineHeights12 = '12';
|
|
33
|
-
export const DefaultLineHeights16 = '16';
|
|
34
|
-
export const DefaultLineHeights18 = '18';
|
|
35
|
-
export const DefaultLineHeights21 = '21';
|
|
36
|
-
export const DefaultLineHeights28 = '28';
|
|
37
|
-
export const DefaultLineHeights34 = '34';
|
|
38
|
-
export const DefaultLineHeights41 = '41';
|
|
39
|
-
export const DefaultLineHeights49 = '49';
|
|
40
|
-
export const DefaultFontWeightsRoboto700 = 'Bold';
|
|
41
|
-
export const DefaultFontWeightsRoboto500 = 'Medium';
|
|
42
|
-
export const DefaultFontWeightsRoboto400 = 'Regular';
|
|
43
|
-
export const DefaultFontSize11 = '11';
|
|
44
|
-
export const DefaultFontSize13 = '13';
|
|
45
|
-
export const DefaultFontSize14 = '14';
|
|
46
|
-
export const DefaultFontSize16 = '16';
|
|
47
|
-
export const DefaultFontSize18 = '18';
|
|
48
|
-
export const DefaultFontSize24 = '24';
|
|
49
|
-
export const DefaultFontSize29 = '29';
|
|
50
|
-
export const DefaultFontSize35 = '35';
|
|
51
|
-
export const DefaultFontSize42 = '42';
|
|
52
|
-
export const DefaultLetterSpacingNone = 'none';
|
|
53
|
-
export const DefaultParagraphSpacing0 = '0';
|
|
54
|
-
export const DefaultParagraphSpacing8 = '8';
|
|
55
|
-
export const DefaultTextCaseNone = 'none';
|
|
56
|
-
export const DefaultTextDecorationNone = 'none';
|
|
57
|
-
export const DefaultTextDecorationUnderline = 'underline';
|
|
58
|
-
export const DefaultDefaultColorsRedActual = '#e40521';
|
|
59
|
-
export const DefaultDefaultColorsBlueClickable = '#136cac';
|
|
60
|
-
export const DefaultDefaultColorsBlueHoverClickable = '#004f88';
|
|
61
|
-
export const DefaultDefaultColorsGreyMediumInactive = '#808080';
|
|
62
|
-
export const DefaultDefaultColorsTextColorsGreyXDark = '#272727';
|
|
63
|
-
export const DefaultDefaultColorsTextColorsGreyDark = '#545352';
|
|
64
|
-
export const DefaultDefaultColorsBackgroundColorsWhite = '#ffffff';
|
|
65
|
-
export const DefaultDefaultColorsBackgroundColorsGreyXLight = '#f0f0f0';
|
|
66
|
-
export const DefaultDefaultColorsBackgroundColorsGreyXDarkBgModal = '#27272780';
|
|
67
|
-
export const DefaultDefaultColorsBackgroundColorsBlueHoverEquivalence =
|
|
68
|
-
'#e8f1f7';
|
|
69
|
-
export const DefaultDefaultColorsBackgroundColorsBlueHoverOpacity12 =
|
|
70
|
-
'#136cac1f';
|
|
71
|
-
export const DefaultDefaultColorsBorderColorsGreyLightDefaultBorder = '#cbcbcb';
|
|
72
|
-
export const DefaultDefaultColorsNotificationColorsBlueInfo = '#1d91c3';
|
|
73
|
-
export const DefaultDefaultColorsNotificationColorsGreenSuccess = '#23956d';
|
|
74
|
-
export const DefaultDefaultColorsNotificationColorsOrangeWarning = '#e46221';
|
|
75
|
-
export const DefaultDefaultColorsNotificationColorsRedError = '#b80025';
|
|
76
|
-
export const DefaultDefaultColorsSecondaryColorsBlueDark = '#0d2c54';
|
|
77
|
-
export const DefaultDefaultColorsSecondaryColorsBlueMedium = '#3d5a80';
|
|
78
|
-
export const DefaultDefaultColorsSecondaryColorsBlueLight = '#7fdcea';
|
|
79
|
-
export const DefaultDefaultColorsSecondaryColorsGreenDark = '#125e42';
|
|
80
|
-
export const DefaultDefaultColorsSecondaryColorsGreenMedium = '#1f8461';
|
|
81
|
-
export const DefaultDefaultColorsSecondaryColorsGreen = '#5dca8b';
|
|
82
|
-
export const DefaultDefaultColorsSecondaryColorsGreenLight = '#bad07a';
|
|
83
|
-
export const DefaultDefaultColorsSecondaryColorsBrown = '#6f2902';
|
|
84
|
-
export const DefaultDefaultColorsSecondaryColorsBrownLight = '#b65700';
|
|
85
|
-
export const DefaultDefaultColorsSecondaryColorsOrangeLight = '#f59b00';
|
|
86
|
-
export const DefaultDefaultColorsSecondaryColorsYellow = '#f9d25e';
|
|
87
|
-
export const DefaultDefaultColorsSecondaryColorsPurpleDark = '#530d48';
|
|
88
|
-
export const DefaultDefaultColorsSecondaryColorsPurple = '#831443';
|
|
89
|
-
export const DefaultDefaultColorsSecondaryColorsPink = '#ca1e5c';
|
|
90
|
-
export const DefaultDefaultColorsSecondaryColorsPinkLight = '#fd6972';
|
|
91
|
-
export const EpAppShadowAllContent = {
|
|
92
|
-
color: '#dedada66',
|
|
93
|
-
type: 'dropShadow',
|
|
94
|
-
x: '0',
|
|
95
|
-
y: '4',
|
|
96
|
-
blur: '15',
|
|
97
|
-
spread: '0',
|
|
98
|
-
};
|
|
99
|
-
export const EpAppShadowButtomMenu = {
|
|
100
|
-
color: '#dedada66',
|
|
101
|
-
type: 'dropShadow',
|
|
102
|
-
x: '0',
|
|
103
|
-
y: '-4',
|
|
104
|
-
blur: '15',
|
|
105
|
-
spread: '0',
|
|
106
|
-
};
|
|
107
|
-
export const EpBorderRadius4 = '4';
|
|
108
|
-
export const EpBorderRadius8 = '8';
|
|
109
|
-
export const EpBorderRadius16 = '16';
|
|
110
|
-
export const EpBorderRadius24 = '24';
|
|
111
|
-
export const EpSpacingXxs = '4';
|
|
112
|
-
export const EpSpacingXs = '8';
|
|
113
|
-
export const EpSpacingMd = '16';
|
|
114
|
-
export const EpSpacingLg = '24';
|
|
115
|
-
export const EpSpacingXl = '32';
|
|
116
|
-
export const EpSpacingXxl = '40';
|
|
117
|
-
export const EpSpacingXxxl = '72';
|
|
118
|
-
export const EpColorsRed = '#e11c31';
|
|
119
|
-
export const EpColorsRedHover = '#b61425';
|
|
120
|
-
export const EpColorsGreenBlue = '#159f9f';
|
|
121
|
-
export const EpColorsGreenBlueHover = '#128888';
|
|
122
|
-
export const EpColorsGreyMediumInactive = '#808080';
|
|
123
|
-
export const EpColorsBlack = '#161616';
|
|
124
|
-
export const EpColorsGreyDark = '#676767';
|
|
125
|
-
export const EpColorsWhite = '#ffffff';
|
|
126
|
-
export const EpColorsRedLight = '#fff7f5';
|
|
127
|
-
export const EpColorsGreenLight = '#f2f8f8';
|
|
128
|
-
export const EpColorsGreyDarkBgModal = '#67676780';
|
|
129
|
-
export const EpColorsGreyLightBorder = '#cbcbcb';
|
|
130
|
-
export const EpColorsBlueInfo = '#1d91c3';
|
|
131
|
-
export const EpColorsGreenSucces = '#23956d';
|
|
132
|
-
export const EpColorsOrangeWarning = '#e46221';
|
|
133
|
-
export const EpColorsRedError = '#b80025';
|
|
134
|
-
export const EpColorsGrey = '#acc1cc';
|
|
135
|
-
export const EpColorsRedPastel = '#feefeb';
|
|
136
|
-
export const EpColorsGreenPastel = '#e4f1f1';
|
|
137
|
-
export const EpColorsGreyPastel = '#eaf2f6';
|
|
138
|
-
export const EpSizingXs = '8';
|
|
139
|
-
export const EpSizingSm = '12';
|
|
140
|
-
export const EpSizingMd = '16';
|
|
141
|
-
export const EpSizingLg = '24';
|
|
142
|
-
export const EpSizingXl = '32';
|
|
143
|
-
export const EpSizingXxl = '40';
|
|
144
|
-
export const EpSizingXxxl = '72';
|
|
145
|
-
export const EpFontFamiliesManrope = 'Manrope';
|
|
146
|
-
export const EpFontFamiliesOpenSans = 'Open Sans';
|
|
147
|
-
export const EpLineHeights14 = '14';
|
|
148
|
-
export const EpLineHeights16 = '16';
|
|
149
|
-
export const EpLineHeights20 = '20';
|
|
150
|
-
export const EpLineHeights24 = '24';
|
|
151
|
-
export const EpLineHeights26 = '26';
|
|
152
|
-
export const EpLineHeights34 = '34';
|
|
153
|
-
export const EpFontWeightsManrope700 = 'Bold';
|
|
154
|
-
export const EpFontWeightsManrope500 = 'Medium';
|
|
155
|
-
export const EpFontWeightsOpenSans400 = 'Regular';
|
|
156
|
-
export const EpFontWeightsOpenSans600 = 'SemiBold';
|
|
157
|
-
export const EpFontWeightsOpenSans700 = 'Bold';
|
|
158
|
-
export const EpFontSize10 = '10';
|
|
159
|
-
export const EpFontSize12 = '12';
|
|
160
|
-
export const EpFontSize14 = '14';
|
|
161
|
-
export const EpFontSize16 = '16';
|
|
162
|
-
export const EpFontSize18 = '18';
|
|
163
|
-
export const EpFontSize24 = '24';
|
|
164
|
-
export const EpLetterSpacingNone = 'none';
|
|
165
|
-
export const EpParagraphSpacing0 = '0';
|
|
166
|
-
export const EpParagraphSpacing8 = '8';
|
|
167
|
-
export const EpTextCaseNone = 'none';
|
|
168
|
-
export const EpTextDecorationNone = 'none';
|
|
169
|
-
export const EpTextDecorationUnderline = 'underline';
|
|
@@ -1,218 +0,0 @@
|
|
|
1
|
-
import { useMemo } from 'react';
|
|
2
|
-
|
|
3
|
-
import { getFontFamilies, getMuiPalette } from './helpers/theme';
|
|
4
|
-
import { MuiTokens, Theme } from './interfaces/theme';
|
|
5
|
-
import * as tokens from './themes/tokens';
|
|
6
|
-
|
|
7
|
-
interface useMaterialThemeTokensReturnType {
|
|
8
|
-
muiTokens: MuiTokens;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
const useMaterialThemeTokens = (
|
|
12
|
-
themeName: Theme,
|
|
13
|
-
): useMaterialThemeTokensReturnType => {
|
|
14
|
-
const fontWeights = {
|
|
15
|
-
RobotoBold: 700,
|
|
16
|
-
RobotoMedium: 500,
|
|
17
|
-
RobotoRegular: 400,
|
|
18
|
-
};
|
|
19
|
-
const designTokens = tokens as Record<string, string | number | unknown>;
|
|
20
|
-
|
|
21
|
-
const h1 = {
|
|
22
|
-
fontWeight: fontWeights.RobotoBold,
|
|
23
|
-
lineHeight: designTokens[`${themeName}LineHeights41`] + 'px',
|
|
24
|
-
fontSize: designTokens[`${themeName}FontSize35`] + 'px',
|
|
25
|
-
letterSpacing: designTokens[`${themeName}LetterSpacingNone`],
|
|
26
|
-
paragraphSpacing: designTokens[`${themeName}ParagraphSpacing0`] + 'px',
|
|
27
|
-
textCase: designTokens[`${themeName}TextCaseNone`],
|
|
28
|
-
textDecoration: designTokens[`${themeName}TextDecorationNone`],
|
|
29
|
-
};
|
|
30
|
-
const h2 = {
|
|
31
|
-
fontWeight: fontWeights.RobotoMedium,
|
|
32
|
-
lineHeight: designTokens[`${themeName}LineHeights34`] + 'px',
|
|
33
|
-
fontSize: designTokens[`${themeName}FontSize29`] + 'px',
|
|
34
|
-
letterSpacing: designTokens[`${themeName}LetterSpacingNone`],
|
|
35
|
-
paragraphSpacing: designTokens[`${themeName}ParagraphSpacing0`] + 'px',
|
|
36
|
-
textCase: designTokens[`${themeName}TextCaseNone`],
|
|
37
|
-
textDecoration: designTokens[`${themeName}TextDecorationNone`],
|
|
38
|
-
};
|
|
39
|
-
const h3 = {
|
|
40
|
-
fontWeight: fontWeights.RobotoRegular,
|
|
41
|
-
lineHeight: designTokens[`${themeName}LineHeights28`] + 'px',
|
|
42
|
-
fontSize: designTokens[`${themeName}FontSize24`] + 'px',
|
|
43
|
-
letterSpacing: designTokens[`${themeName}LetterSpacingNone`],
|
|
44
|
-
paragraphSpacing: designTokens[`${themeName}ParagraphSpacing0`] + 'px',
|
|
45
|
-
textCase: designTokens[`${themeName}TextCaseNone`],
|
|
46
|
-
textDecoration: designTokens[`${themeName}TextDecorationNone`],
|
|
47
|
-
};
|
|
48
|
-
const h4 = {
|
|
49
|
-
fontWeight: fontWeights.RobotoMedium,
|
|
50
|
-
lineHeight: designTokens[`${themeName}LineHeights21`] + 'px',
|
|
51
|
-
fontSize: designTokens[`${themeName}FontSize18`] + 'px',
|
|
52
|
-
letterSpacing: designTokens[`${themeName}LetterSpacingNone`],
|
|
53
|
-
paragraphSpacing: designTokens[`${themeName}ParagraphSpacing0`] + 'px',
|
|
54
|
-
textCase: designTokens[`${themeName}TextCaseNone`],
|
|
55
|
-
textDecoration: designTokens[`${themeName}TextDecorationNone`],
|
|
56
|
-
};
|
|
57
|
-
const body1 = {
|
|
58
|
-
fontWeight: fontWeights.RobotoRegular,
|
|
59
|
-
lineHeight: designTokens[`${themeName}LineHeights18`] + 'px',
|
|
60
|
-
fontSize: designTokens[`${themeName}FontSize14`] + 'px',
|
|
61
|
-
letterSpacing: designTokens[`${themeName}LetterSpacingNone`],
|
|
62
|
-
paragraphSpacing: designTokens[`${themeName}ParagraphSpacing8`] + 'px',
|
|
63
|
-
textCase: designTokens[`${themeName}TextCaseNone`],
|
|
64
|
-
textDecoration: designTokens[`${themeName}TextDecorationNone`],
|
|
65
|
-
};
|
|
66
|
-
const body2 = {
|
|
67
|
-
fontWeight: fontWeights.RobotoRegular,
|
|
68
|
-
lineHeight: designTokens[`${themeName}LineHeights16`] + 'px',
|
|
69
|
-
fontSize: designTokens[`${themeName}FontSize13`] + 'px',
|
|
70
|
-
letterSpacing: designTokens[`${themeName}LetterSpacingNone`],
|
|
71
|
-
paragraphSpacing: designTokens[`${themeName}ParagraphSpacing8`] + 'px',
|
|
72
|
-
textCase: designTokens[`${themeName}TextCaseNone`],
|
|
73
|
-
textDecoration: designTokens[`${themeName}TextDecorationNone`],
|
|
74
|
-
};
|
|
75
|
-
|
|
76
|
-
const muiTokensObject = {
|
|
77
|
-
components: {
|
|
78
|
-
MuiTypography: {
|
|
79
|
-
defaultProps: {
|
|
80
|
-
variantMapping: {
|
|
81
|
-
subtitle1: 'body1',
|
|
82
|
-
subtitle2: 'body2',
|
|
83
|
-
},
|
|
84
|
-
},
|
|
85
|
-
},
|
|
86
|
-
},
|
|
87
|
-
typography: {
|
|
88
|
-
fontFamily: getFontFamilies(themeName).join(','),
|
|
89
|
-
bigNumber: {
|
|
90
|
-
fontWeight: fontWeights.RobotoBold,
|
|
91
|
-
lineHeight: designTokens[`${themeName}LineHeights49`] + 'px',
|
|
92
|
-
fontSize: designTokens[`${themeName}FontSize42`] + 'px',
|
|
93
|
-
letterSpacing: designTokens[`${themeName}LetterSpacingNone`],
|
|
94
|
-
paragraphSpacing: designTokens[`${themeName}ParagraphSpacing0`] + 'px',
|
|
95
|
-
textCase: designTokens[`${themeName}TextCaseNone`],
|
|
96
|
-
textDecoration: designTokens[`${themeName}TextDecorationNone`],
|
|
97
|
-
},
|
|
98
|
-
h1,
|
|
99
|
-
header1: h1, // Do not used this, use h1 instead
|
|
100
|
-
h2,
|
|
101
|
-
header2: h2, // Do not used this, use h2 instead
|
|
102
|
-
h3,
|
|
103
|
-
header3: h3, // Do not used this, use h3 instead
|
|
104
|
-
h4,
|
|
105
|
-
header4: h4, // Do not used this, use h4 instead
|
|
106
|
-
body1,
|
|
107
|
-
body1Regular: body1, // Do not used this, use body1 instead
|
|
108
|
-
body1Medium: {
|
|
109
|
-
fontWeight: fontWeights.RobotoMedium,
|
|
110
|
-
lineHeight: designTokens[`${themeName}LineHeights18`] + 'px',
|
|
111
|
-
fontSize: designTokens[`${themeName}FontSize14`] + 'px',
|
|
112
|
-
letterSpacing: designTokens[`${themeName}LetterSpacingNone`],
|
|
113
|
-
paragraphSpacing: designTokens[`${themeName}ParagraphSpacing8`] + 'px',
|
|
114
|
-
textCase: designTokens[`${themeName}TextCaseNone`],
|
|
115
|
-
textDecoration: designTokens[`${themeName}TextDecorationNone`],
|
|
116
|
-
},
|
|
117
|
-
body1Bold: {
|
|
118
|
-
fontWeight: fontWeights.RobotoBold,
|
|
119
|
-
lineHeight: designTokens[`${themeName}LineHeights18`] + 'px',
|
|
120
|
-
fontSize: designTokens[`${themeName}FontSize14`] + 'px',
|
|
121
|
-
letterSpacing: designTokens[`${themeName}LetterSpacingNone`],
|
|
122
|
-
paragraphSpacing: designTokens[`${themeName}ParagraphSpacing8`] + 'px',
|
|
123
|
-
textCase: designTokens[`${themeName}TextCaseNone`],
|
|
124
|
-
textDecoration: designTokens[`${themeName}TextDecorationNone`],
|
|
125
|
-
},
|
|
126
|
-
body2,
|
|
127
|
-
body2Regular: body2,
|
|
128
|
-
body2Medium: {
|
|
129
|
-
fontWeight: fontWeights.RobotoMedium,
|
|
130
|
-
lineHeight: designTokens[`${themeName}LineHeights16`] + 'px',
|
|
131
|
-
fontSize: designTokens[`${themeName}FontSize13`] + 'px',
|
|
132
|
-
letterSpacing: designTokens[`${themeName}LetterSpacingNone`],
|
|
133
|
-
paragraphSpacing: designTokens[`${themeName}ParagraphSpacing8`] + 'px',
|
|
134
|
-
textCase: designTokens[`${themeName}TextCaseNone`],
|
|
135
|
-
textDecoration: designTokens[`${themeName}TextDecorationNone`],
|
|
136
|
-
},
|
|
137
|
-
body2Bold: {
|
|
138
|
-
fontWeight: fontWeights.RobotoBold,
|
|
139
|
-
lineHeight: designTokens[`${themeName}LineHeights16`] + 'px',
|
|
140
|
-
fontSize: designTokens[`${themeName}FontSize13`] + 'px',
|
|
141
|
-
letterSpacing: designTokens[`${themeName}LetterSpacingNone`],
|
|
142
|
-
paragraphSpacing: designTokens[`${themeName}ParagraphSpacing8`] + 'px',
|
|
143
|
-
textCase: designTokens[`${themeName}TextCaseNone`],
|
|
144
|
-
textDecoration: designTokens[`${themeName}TextDecorationNone`],
|
|
145
|
-
},
|
|
146
|
-
caption: {
|
|
147
|
-
fontWeight: fontWeights.RobotoRegular,
|
|
148
|
-
lineHeight: designTokens[`${themeName}LineHeights12`] + 'px',
|
|
149
|
-
fontSize: designTokens[`${themeName}FontSize11`] + 'px',
|
|
150
|
-
letterSpacing: designTokens[`${themeName}LetterSpacingNone`],
|
|
151
|
-
paragraphSpacing: designTokens[`${themeName}ParagraphSpacing0`] + 'px',
|
|
152
|
-
textCase: designTokens[`${themeName}TextCaseNone`],
|
|
153
|
-
textDecoration: designTokens[`${themeName}TextDecorationNone`],
|
|
154
|
-
},
|
|
155
|
-
buttonNotif: {
|
|
156
|
-
fontWeight: fontWeights.RobotoBold,
|
|
157
|
-
lineHeight: designTokens[`${themeName}LineHeights18`] + 'px',
|
|
158
|
-
fontSize: designTokens[`${themeName}FontSize14`] + 'px',
|
|
159
|
-
letterSpacing: designTokens[`${themeName}LetterSpacingNone`],
|
|
160
|
-
paragraphSpacing: designTokens[`${themeName}ParagraphSpacing0`] + 'px',
|
|
161
|
-
textCase: designTokens[`${themeName}TextCaseNone`],
|
|
162
|
-
textDecoration: designTokens[`${themeName}TextDecorationNone`],
|
|
163
|
-
},
|
|
164
|
-
link1: {
|
|
165
|
-
fontWeight: fontWeights.RobotoBold,
|
|
166
|
-
lineHeight: designTokens[`${themeName}LineHeights18`] + 'px',
|
|
167
|
-
fontSize: designTokens[`${themeName}FontSize14`] + 'px',
|
|
168
|
-
letterSpacing: designTokens[`${themeName}LetterSpacingNone`],
|
|
169
|
-
paragraphSpacing: designTokens[`${themeName}ParagraphSpacing0`] + 'px',
|
|
170
|
-
textCase: designTokens[`${themeName}TextCaseNone`],
|
|
171
|
-
textDecoration: designTokens[`${themeName}TextDecorationUnderline`],
|
|
172
|
-
},
|
|
173
|
-
link2: {
|
|
174
|
-
fontWeight: fontWeights.RobotoBold,
|
|
175
|
-
lineHeight: designTokens[`${themeName}LineHeights16`] + 'px',
|
|
176
|
-
fontSize: designTokens[`${themeName}FontSize13`] + 'px',
|
|
177
|
-
letterSpacing: designTokens[`${themeName}LetterSpacingNone`],
|
|
178
|
-
paragraphSpacing: designTokens[`${themeName}ParagraphSpacing0`] + 'px',
|
|
179
|
-
textCase: designTokens[`${themeName}TextCaseNone`],
|
|
180
|
-
textDecoration: designTokens[`${themeName}TextDecorationUnderline`],
|
|
181
|
-
},
|
|
182
|
-
fontWeightRegular: fontWeights.RobotoRegular,
|
|
183
|
-
fontWeightMedium: fontWeights.RobotoMedium,
|
|
184
|
-
fontWeightBold: fontWeights.RobotoBold,
|
|
185
|
-
},
|
|
186
|
-
breakpoints: {
|
|
187
|
-
values: {
|
|
188
|
-
xs: 0,
|
|
189
|
-
sm: 600,
|
|
190
|
-
md: 900,
|
|
191
|
-
lg: 1200,
|
|
192
|
-
xl: 1536,
|
|
193
|
-
},
|
|
194
|
-
},
|
|
195
|
-
zIndex: {
|
|
196
|
-
mobileStepper: 1000,
|
|
197
|
-
fab: 1050,
|
|
198
|
-
speedDial: 1050,
|
|
199
|
-
appBar: 1100,
|
|
200
|
-
drawer: 1200,
|
|
201
|
-
modal: 1300,
|
|
202
|
-
snackbar: 1400,
|
|
203
|
-
tooltip: 1500,
|
|
204
|
-
},
|
|
205
|
-
palette: getMuiPalette(themeName),
|
|
206
|
-
};
|
|
207
|
-
|
|
208
|
-
const muiTokens = useMemo(
|
|
209
|
-
() => ({
|
|
210
|
-
...muiTokensObject,
|
|
211
|
-
}),
|
|
212
|
-
[muiTokensObject],
|
|
213
|
-
);
|
|
214
|
-
|
|
215
|
-
return { muiTokens };
|
|
216
|
-
};
|
|
217
|
-
|
|
218
|
-
export default useMaterialThemeTokens;
|