@linagora/twake-mui 5.1.1 → 6.0.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/CHANGELOG.md +29 -0
- package/dist/lib/lightOverrides.js +0 -94
- package/dist/lib/makePalette.d.ts +2 -1
- package/dist/lib/makePalette.js +20 -2
- package/dist/lib/makeShadows.d.ts +3 -0
- package/dist/lib/makeShadows.js +52 -0
- package/dist/lib/makeTheme.js +3 -1
- package/dist/lib/types.d.ts +22 -10
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,32 @@
|
|
|
1
|
+
# @linagora/twake-mui [6.0.0](https://github.com/linagora/twake-ui/compare/@linagora/twake-mui@5.2.0...@linagora/twake-mui@6.0.0) (2026-09-08)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* **twake-mui:** Drop app-specific overrides from the theme ([b67cec4](https://github.com/linagora/twake-ui/commit/b67cec4bd20ebc9c04d998966e0f8c00c72830e1))
|
|
7
|
+
* **twake-mui:** Remove inert rules from light overrides ([d50595c](https://github.com/linagora/twake-ui/commit/d50595c35ac30e6e2a32be74a0cde5b45798cc44))
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### BREAKING CHANGES
|
|
11
|
+
|
|
12
|
+
* **twake-mui:** Custom style for `Popover`, `Backdrop`,
|
|
13
|
+
`SwipeableDrawer` and `ListItem inside Accordion` has been
|
|
14
|
+
removed
|
|
15
|
+
* **twake-mui:** size="large" no longer typechecks on TextField and InputBase.
|
|
16
|
+
|
|
17
|
+
# @linagora/twake-mui [5.2.0](https://github.com/linagora/twake-ui/compare/@linagora/twake-mui@5.1.1...@linagora/twake-mui@5.2.0) (2026-09-08)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Bug Fixes
|
|
21
|
+
|
|
22
|
+
* **twake-mui:** Type background.contrast on the MUI palette ([0985fcb](https://github.com/linagora/twake-ui/commit/0985fcbc880b73575ffd817ab70b724979d74481))
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
### Features
|
|
26
|
+
|
|
27
|
+
* **twake-mui:** Add border and text.icon palette keys from cozy-ui ([9082d24](https://github.com/linagora/twake-ui/commit/9082d2416ad8be62772627bebe4daa27f4eabeca))
|
|
28
|
+
* **twake-mui:** Align elevation shadows with cozy-ui ([64d3d5c](https://github.com/linagora/twake-ui/commit/64d3d5cce9e02ca013317ced302ba557a03d9de3))
|
|
29
|
+
|
|
1
30
|
## @linagora/twake-mui [5.1.1](https://github.com/linagora/twake-ui/compare/@linagora/twake-mui@5.1.0...@linagora/twake-mui@5.1.1) (2026-09-08)
|
|
2
31
|
|
|
3
32
|
|
|
@@ -104,21 +104,6 @@ export const lightOverrides = {
|
|
|
104
104
|
})
|
|
105
105
|
}
|
|
106
106
|
},
|
|
107
|
-
MuiTextField: {
|
|
108
|
-
defaultProps: {
|
|
109
|
-
size: 'medium'
|
|
110
|
-
},
|
|
111
|
-
styleOverrides: {
|
|
112
|
-
root: {
|
|
113
|
-
'& .MuiOutlinedInput-root': {
|
|
114
|
-
borderRadius: radius.sm,
|
|
115
|
-
'& fieldset': {
|
|
116
|
-
borderRadius: radius.sm
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
},
|
|
122
107
|
MuiOutlinedInput: {
|
|
123
108
|
styleOverrides: {
|
|
124
109
|
root: ({ theme }) => ({
|
|
@@ -151,25 +136,6 @@ export const lightOverrides = {
|
|
|
151
136
|
}
|
|
152
137
|
]
|
|
153
138
|
}
|
|
154
|
-
},
|
|
155
|
-
variants: [
|
|
156
|
-
{
|
|
157
|
-
props: { size: 'large' },
|
|
158
|
-
style: {
|
|
159
|
-
'& .MuiOutlinedInput-input': {
|
|
160
|
-
padding: '14px 16px' // Large: 54px height
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
]
|
|
165
|
-
},
|
|
166
|
-
MuiInputBase: {
|
|
167
|
-
styleOverrides: {
|
|
168
|
-
root: {
|
|
169
|
-
'&.MuiInputBase-sizeLarge': {
|
|
170
|
-
fontSize: '16px'
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
139
|
}
|
|
174
140
|
},
|
|
175
141
|
MuiSelect: {
|
|
@@ -261,14 +227,6 @@ export const lightOverrides = {
|
|
|
261
227
|
}
|
|
262
228
|
}
|
|
263
229
|
},
|
|
264
|
-
MuiPopover: {
|
|
265
|
-
styleOverrides: {
|
|
266
|
-
paper: {
|
|
267
|
-
borderRadius: radius.md,
|
|
268
|
-
boxShadow: '0 1px 3px 0 rgba(0, 0, 0, 0.30), 0 4px 8px 3px rgba(0, 0, 0, 0.15)'
|
|
269
|
-
}
|
|
270
|
-
}
|
|
271
|
-
},
|
|
272
230
|
MuiChip: {
|
|
273
231
|
styleOverrides: {
|
|
274
232
|
root: {
|
|
@@ -422,20 +380,6 @@ export const lightOverrides = {
|
|
|
422
380
|
}
|
|
423
381
|
}
|
|
424
382
|
},
|
|
425
|
-
MuiBackdrop: {
|
|
426
|
-
styleOverrides: {
|
|
427
|
-
root: {
|
|
428
|
-
variants: [
|
|
429
|
-
{
|
|
430
|
-
props: { invisible: false },
|
|
431
|
-
style: ({ theme }) => ({
|
|
432
|
-
backgroundColor: alpha(theme.palette.text.primary, theme.palette.action.focusOpacity)
|
|
433
|
-
})
|
|
434
|
-
}
|
|
435
|
-
]
|
|
436
|
-
}
|
|
437
|
-
}
|
|
438
|
-
},
|
|
439
383
|
MuiAccordion: {
|
|
440
384
|
styleOverrides: {
|
|
441
385
|
root: {
|
|
@@ -556,23 +500,6 @@ export const lightOverrides = {
|
|
|
556
500
|
})
|
|
557
501
|
}
|
|
558
502
|
},
|
|
559
|
-
MuiCssBaseline: {
|
|
560
|
-
styleOverrides: theme => ({
|
|
561
|
-
'.MuiAccordion-root .MuiListItem-root': {
|
|
562
|
-
padding: '0',
|
|
563
|
-
borderRadius: '4px',
|
|
564
|
-
'&:hover': {
|
|
565
|
-
backgroundColor: alpha(theme.palette.grey[900], 0.04)
|
|
566
|
-
}
|
|
567
|
-
},
|
|
568
|
-
'.MuiAccordion-root .MuiListItem-root label': {
|
|
569
|
-
fontSize: '14px',
|
|
570
|
-
fontStyle: 'normal',
|
|
571
|
-
fontWeight: 400,
|
|
572
|
-
color: alpha(theme.palette.grey[900], 0.9)
|
|
573
|
-
}
|
|
574
|
-
})
|
|
575
|
-
},
|
|
576
503
|
MuiMenuItem: {
|
|
577
504
|
styleOverrides: {
|
|
578
505
|
root: ({ theme }) => ({
|
|
@@ -589,26 +516,5 @@ export const lightOverrides = {
|
|
|
589
516
|
}
|
|
590
517
|
})
|
|
591
518
|
}
|
|
592
|
-
},
|
|
593
|
-
MuiSwipeableDrawer: {
|
|
594
|
-
defaultProps: {
|
|
595
|
-
sx: theme => ({
|
|
596
|
-
'& .MuiDrawer-paper': {
|
|
597
|
-
borderTopLeftRadius: radius.md,
|
|
598
|
-
borderTopRightRadius: radius.md,
|
|
599
|
-
'&::before': {
|
|
600
|
-
content: '""',
|
|
601
|
-
display: 'block',
|
|
602
|
-
width: '64px',
|
|
603
|
-
height: '4px',
|
|
604
|
-
backgroundColor: theme.palette.action.disabledBackground,
|
|
605
|
-
borderRadius: radius.md,
|
|
606
|
-
margin: '12px auto',
|
|
607
|
-
marginTop: '30px',
|
|
608
|
-
flexShrink: 0
|
|
609
|
-
}
|
|
610
|
-
}
|
|
611
|
-
})
|
|
612
|
-
}
|
|
613
519
|
}
|
|
614
520
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { PaletteOptions } from '@mui/material/styles';
|
|
2
|
-
import { PaletteJson, BackgroundPalette, GreyPalette } from './types';
|
|
2
|
+
import { PaletteJson, BackgroundPalette, GreyPalette, BorderPalette } from './types';
|
|
3
3
|
export declare const makePalette: (mode?: "light" | "dark", palette?: PaletteJson) => PaletteOptions & {
|
|
4
4
|
background: BackgroundPalette;
|
|
5
5
|
grey: GreyPalette;
|
|
6
|
+
border: BorderPalette;
|
|
6
7
|
};
|
package/dist/lib/makePalette.js
CHANGED
|
@@ -61,13 +61,22 @@ export const makePalette = (mode = 'light', palette = paletteData) => {
|
|
|
61
61
|
text: {
|
|
62
62
|
primary: palette.Common.white,
|
|
63
63
|
secondary: alpha(palette.Common.white, 0.64),
|
|
64
|
-
disabled: alpha(palette.Common.white, 0.4)
|
|
64
|
+
disabled: alpha(palette.Common.white, 0.4),
|
|
65
|
+
icon: palette.Common.white
|
|
65
66
|
},
|
|
66
67
|
background: {
|
|
67
68
|
default: palette.Grey.A400,
|
|
68
69
|
paper: palette.Grey[800],
|
|
69
70
|
contrast: alpha(palette.Common.white, 0.072)
|
|
70
71
|
},
|
|
72
|
+
border: {
|
|
73
|
+
main: alpha(palette.Common.white, 0.24),
|
|
74
|
+
disabled: alpha(palette.Common.white, 0.12),
|
|
75
|
+
ghost: alpha(palette.Common.white, 0.48),
|
|
76
|
+
ghostDisabled: alpha(palette.Common.white, 0.24),
|
|
77
|
+
opacity: 0.48,
|
|
78
|
+
ghostOpacity: 0.48
|
|
79
|
+
},
|
|
71
80
|
divider: alpha(palette.Common.white, 0.16),
|
|
72
81
|
action: {
|
|
73
82
|
active: palette.Common.white,
|
|
@@ -142,13 +151,22 @@ export const makePalette = (mode = 'light', palette = paletteData) => {
|
|
|
142
151
|
text: {
|
|
143
152
|
primary: alpha(palette.Grey[900], 0.9),
|
|
144
153
|
secondary: alpha(palette.Grey[900], 0.64),
|
|
145
|
-
disabled: alpha(palette.Grey[900], 0.32)
|
|
154
|
+
disabled: alpha(palette.Grey[900], 0.32),
|
|
155
|
+
icon: alpha(palette.Grey[900], 0.72)
|
|
146
156
|
},
|
|
147
157
|
background: {
|
|
148
158
|
default: palette.Grey[100],
|
|
149
159
|
paper: palette.Common.white,
|
|
150
160
|
contrast: alpha(palette.Grey[900], 0.048)
|
|
151
161
|
},
|
|
162
|
+
border: {
|
|
163
|
+
main: alpha(palette.Grey[900], 0.16),
|
|
164
|
+
disabled: alpha(palette.Grey[900], 0.08),
|
|
165
|
+
ghost: alpha(palette.Grey[900], 0.48),
|
|
166
|
+
ghostDisabled: alpha(palette.Grey[900], 0.16),
|
|
167
|
+
opacity: 0.32,
|
|
168
|
+
ghostOpacity: 0.48
|
|
169
|
+
},
|
|
152
170
|
divider: alpha(palette.Grey[900], 0.12),
|
|
153
171
|
action: {
|
|
154
172
|
active: alpha(palette.Grey[900], 0.56),
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { alpha } from '@mui/material/styles';
|
|
2
|
+
import paletteJson from './palette.json';
|
|
3
|
+
const paletteData = paletteJson;
|
|
4
|
+
/**
|
|
5
|
+
* Each elevation is two offset layers plus a constant hairline outline.
|
|
6
|
+
* Tuple is [y1, blur1, spread1, opacity1, y2, blur2, spread2, opacity2];
|
|
7
|
+
* the x offset is always 0.
|
|
8
|
+
*/
|
|
9
|
+
const elevations = [
|
|
10
|
+
[2, 4, 0, 0.08, 4, 16, 0, 0.06],
|
|
11
|
+
[3, 5, 0, 0.09, 4, 17, 0, 0.07],
|
|
12
|
+
[3, 5, -1, 0.09, 5, 19, 1, 0.08],
|
|
13
|
+
[3, 6, -1, 0.1, 5, 20, 1, 0.08],
|
|
14
|
+
[4, 6, -1, 0.11, 5, 22, 1, 0.09],
|
|
15
|
+
[4, 7, -2, 0.11, 6, 23, 2, 0.1],
|
|
16
|
+
[5, 7, -2, 0.12, 6, 24, 2, 0.11],
|
|
17
|
+
[5, 8, -2, 0.13, 6, 26, 2, 0.11],
|
|
18
|
+
[5, 8, -3, 0.14, 7, 27, 3, 0.12],
|
|
19
|
+
[6, 9, -3, 0.14, 7, 29, 3, 0.13],
|
|
20
|
+
[6, 9, -3, 0.15, 7, 30, 3, 0.14],
|
|
21
|
+
[7, 10, -4, 0.16, 8, 31, 4, 0.15],
|
|
22
|
+
[7, 10, -4, 0.16, 8, 33, 4, 0.15],
|
|
23
|
+
[8, 11, -5, 0.17, 9, 34, 5, 0.16],
|
|
24
|
+
[8, 11, -5, 0.18, 9, 35, 5, 0.17],
|
|
25
|
+
[9, 12, -5, 0.18, 9, 37, 5, 0.18],
|
|
26
|
+
[9, 12, -6, 0.19, 10, 38, 6, 0.19],
|
|
27
|
+
[9, 13, -6, 0.2, 10, 40, 6, 0.19],
|
|
28
|
+
[10, 13, -6, 0.21, 10, 41, 6, 0.2],
|
|
29
|
+
[10, 14, -7, 0.21, 11, 42, 7, 0.21],
|
|
30
|
+
[11, 14, -7, 0.22, 11, 44, 7, 0.22],
|
|
31
|
+
[11, 15, -7, 0.23, 11, 45, 7, 0.22],
|
|
32
|
+
[12, 15, -8, 0.23, 12, 47, 8, 0.23],
|
|
33
|
+
[12, 16, -8, 0.24, 12, 48, 8, 0.24]
|
|
34
|
+
];
|
|
35
|
+
const OUTLINE_OPACITY = 0.12;
|
|
36
|
+
/**
|
|
37
|
+
* cozy-ui defines a flat 26th elevation outside the ramp. MUI's `Shadows`
|
|
38
|
+
* contract stops at 25, so `theme.shadows[25]` is reachable at runtime but not
|
|
39
|
+
* through the type. Kept to stay iso with cozy-ui.
|
|
40
|
+
*/
|
|
41
|
+
const EXTRA_ELEVATION_OPACITY = 0.04;
|
|
42
|
+
export const makeShadows = (mode = 'light', palette = paletteData) => {
|
|
43
|
+
const shadowColor = mode === 'dark' ? palette.Common.black : palette.Grey[900];
|
|
44
|
+
const outline = `0px 0px 0px 0.5px ${alpha(shadowColor, OUTLINE_OPACITY)}`;
|
|
45
|
+
const shadows = elevations.map(([y1, blur1, spread1, o1, y2, blur2, spread2, o2]) => [
|
|
46
|
+
`0px ${y1}px ${blur1}px ${spread1}px ${alpha(shadowColor, o1)}`,
|
|
47
|
+
`0px ${y2}px ${blur2}px ${spread2}px ${alpha(shadowColor, o2)}`,
|
|
48
|
+
outline
|
|
49
|
+
].join(', '));
|
|
50
|
+
const extraElevation = `0px 1px 4px ${alpha(shadowColor, EXTRA_ELEVATION_OPACITY)}`;
|
|
51
|
+
return ['none', ...shadows, extraElevation];
|
|
52
|
+
};
|
package/dist/lib/makeTheme.js
CHANGED
|
@@ -2,6 +2,7 @@ import { createTheme } from '@mui/material/styles';
|
|
|
2
2
|
import { darkOverrides } from './darkOverrides';
|
|
3
3
|
import { lightOverrides } from './lightOverrides';
|
|
4
4
|
import { makePalette } from './makePalette';
|
|
5
|
+
import { makeShadows } from './makeShadows';
|
|
5
6
|
import { makeTypography } from './makeTypography';
|
|
6
7
|
// DatePicker styles are applied through component overrides
|
|
7
8
|
const themesCommonConfig = {
|
|
@@ -27,7 +28,8 @@ export const makeTheme = (mode = 'light') => {
|
|
|
27
28
|
const theme = createTheme({
|
|
28
29
|
...themesCommonConfig,
|
|
29
30
|
palette,
|
|
30
|
-
typography
|
|
31
|
+
typography,
|
|
32
|
+
shadows: makeShadows(mode)
|
|
31
33
|
});
|
|
32
34
|
const components = mode === 'dark' ? darkOverrides : lightOverrides;
|
|
33
35
|
// Create the final theme with components
|
package/dist/lib/types.d.ts
CHANGED
|
@@ -57,6 +57,9 @@ export interface BorderPalette {
|
|
|
57
57
|
main: string;
|
|
58
58
|
disabled: string;
|
|
59
59
|
ghost: string;
|
|
60
|
+
ghostDisabled: string;
|
|
61
|
+
opacity: number;
|
|
62
|
+
ghostOpacity: number;
|
|
60
63
|
}
|
|
61
64
|
export interface PaletteJson {
|
|
62
65
|
Primary: PaletteColor;
|
|
@@ -69,16 +72,6 @@ export interface PaletteJson {
|
|
|
69
72
|
Common: CommonColor;
|
|
70
73
|
}
|
|
71
74
|
export type TypographyOptions = TypographyVariantsOptions;
|
|
72
|
-
declare module '@mui/material/TextField' {
|
|
73
|
-
interface TextFieldPropsSizeOverrides {
|
|
74
|
-
large: true;
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
declare module '@mui/material/InputBase' {
|
|
78
|
-
interface InputBasePropsSizeOverrides {
|
|
79
|
-
large: true;
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
75
|
export interface TypographyConfig {
|
|
83
76
|
fontFamily?: string;
|
|
84
77
|
fontSize?: number;
|
|
@@ -103,3 +96,22 @@ export interface TypographyVariants {
|
|
|
103
96
|
overline: TypographyConfig;
|
|
104
97
|
}
|
|
105
98
|
export type MakeTypography = () => TypographyOptions;
|
|
99
|
+
/**
|
|
100
|
+
* Twake additions on top of the MUI palette, mirroring cozy-ui. MUI does not
|
|
101
|
+
* declare them, so without this augmentation consumers reading
|
|
102
|
+
* `theme.palette.background.contrast` get a type error.
|
|
103
|
+
*/
|
|
104
|
+
declare module '@mui/material/styles' {
|
|
105
|
+
interface TypeBackground {
|
|
106
|
+
contrast: string;
|
|
107
|
+
}
|
|
108
|
+
interface TypeText {
|
|
109
|
+
icon: string;
|
|
110
|
+
}
|
|
111
|
+
interface Palette {
|
|
112
|
+
border: BorderPalette;
|
|
113
|
+
}
|
|
114
|
+
interface PaletteOptions {
|
|
115
|
+
border?: Partial<BorderPalette>;
|
|
116
|
+
}
|
|
117
|
+
}
|