@linagora/twake-mui 9.1.0 → 9.2.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 CHANGED
@@ -1,3 +1,20 @@
1
+ # @linagora/twake-mui [9.2.0](https://github.com/linagora/twake-ui/compare/@linagora/twake-mui@9.1.0...@linagora/twake-mui@9.2.0) (2026-09-22)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **twake-mui:** Tint light-mode shadows with Grey 900, like cozy-ui ([4c74b68](https://github.com/linagora/twake-ui/commit/4c74b6861f6160ce174b7022ec2b42a64f5d5ecd))
7
+
8
+
9
+ ### Features
10
+
11
+ * Read the palette from twake-css ([7c0a9e6](https://github.com/linagora/twake-ui/commit/7c0a9e6719d9520bdfdbd7b32b9d3132f2ae7d64))
12
+
13
+
14
+ ### Dependencies
15
+
16
+ * **@linagora/twake-css:** upgraded to 1.0.0
17
+
1
18
  # @linagora/twake-mui [9.1.0](https://github.com/linagora/twake-ui/compare/@linagora/twake-mui@9.0.0...@linagora/twake-mui@9.1.0) (2026-09-22)
2
19
 
3
20
 
@@ -1,6 +1,6 @@
1
+ import paletteJson from '@linagora/twake-css/palette.json';
1
2
  import { alpha } from '@mui/material/styles';
2
3
  import { deepmerge } from '@mui/utils';
3
- import paletteJson from './palette.json';
4
4
  const paletteData = paletteJson;
5
5
  export const makePalette = (mode = 'light', overrides = {}) => {
6
6
  const palette = deepmerge(paletteData, overrides);
@@ -1,3 +1,3 @@
1
1
  import { Shadows } from '@mui/material/styles';
2
2
  import { PaletteJson } from './types';
3
- export declare const makeShadows: (palette?: PaletteJson) => Shadows;
3
+ export declare const makeShadows: (mode?: "light" | "dark", palette?: PaletteJson) => Shadows;
@@ -1,5 +1,5 @@
1
+ import paletteJson from '@linagora/twake-css/palette.json';
1
2
  import { alpha } from '@mui/material/styles';
2
- import paletteJson from './palette.json';
3
3
  const paletteData = paletteJson;
4
4
  /**
5
5
  * Each elevation is two offset layers plus a constant hairline outline.
@@ -39,8 +39,8 @@ const OUTLINE_OPACITY = 0.12;
39
39
  * through the type. Kept to stay iso with cozy-ui.
40
40
  */
41
41
  const EXTRA_ELEVATION_OPACITY = 0.04;
42
- export const makeShadows = (palette = paletteData) => {
43
- const shadowColor = palette.Common.black;
42
+ export const makeShadows = (mode = 'light', palette = paletteData) => {
43
+ const shadowColor = mode === 'light' ? palette.Grey[900] : palette.Common.black;
44
44
  const outline = `0px 0px 0px 0.5px ${alpha(shadowColor, OUTLINE_OPACITY)}`;
45
45
  const shadows = elevations.map(([y1, blur1, spread1, o1, y2, blur2, spread2, o2]) => [
46
46
  `0px ${y1}px ${blur1}px ${spread1}px ${alpha(shadowColor, o1)}`,
@@ -25,14 +25,20 @@ const themesCommonConfig = {
25
25
  export const makeTheme = (mode = 'light', paletteOverrides, themeOptions) => {
26
26
  const baseOptions = {
27
27
  ...themesCommonConfig,
28
- cssVariables: { colorSchemeSelector: 'data-theme' },
28
+ cssVariables: { colorSchemeSelector: 'data-theme', cssVarPrefix: 'twake' },
29
29
  defaultColorScheme: mode,
30
30
  colorSchemes: {
31
- light: { palette: makePalette('light', paletteOverrides) },
32
- dark: { palette: makePalette('dark', paletteOverrides) }
31
+ light: {
32
+ palette: makePalette('light', paletteOverrides),
33
+ shadows: makeShadows('light')
34
+ },
35
+ dark: {
36
+ palette: makePalette('dark', paletteOverrides),
37
+ shadows: makeShadows('dark')
38
+ }
33
39
  },
34
40
  typography: makeTypography(),
35
- shadows: makeShadows(),
41
+ shadows: makeShadows(mode),
36
42
  components: overrides
37
43
  };
38
44
  return createTheme(deepmerge(baseOptions, themeOptions ?? {}));
@@ -1,38 +1,9 @@
1
- import { TypographyVariantsOptions } from '@mui/material/styles';
2
- export interface CommonColor {
3
- white: string;
4
- black: string;
5
- }
6
- export interface PaletteColor {
7
- 50: string;
8
- 100: string;
9
- 200: string;
10
- 300: string;
11
- 400: string;
12
- 500: string;
13
- 600: string;
14
- 700: string;
15
- 800: string;
16
- 900: string;
17
- ContrastText?: string;
18
- }
19
- export interface GreyPalette {
20
- 50: string;
21
- 100: string;
22
- 200: string;
23
- 300: string;
24
- 400: string;
25
- 500: string;
26
- 600: string;
27
- 700: string;
28
- 800: string;
29
- 900: string;
30
- A100: string;
31
- A200: string;
32
- A400: string;
33
- A700: string;
34
- A900: string;
35
- }
1
+ import paletteJson from '@linagora/twake-css/palette.json';
2
+ import { Shadows, TypographyVariantsOptions } from '@mui/material/styles';
3
+ export type PaletteJson = typeof paletteJson;
4
+ export type PaletteColor = PaletteJson['Primary'];
5
+ export type GreyPalette = PaletteJson['Grey'];
6
+ export type CommonColor = PaletteJson['Common'];
36
7
  export interface TextPalette {
37
8
  primary: string;
38
9
  secondary: string;
@@ -61,16 +32,6 @@ export interface BorderPalette {
61
32
  opacity: number;
62
33
  ghostOpacity: number;
63
34
  }
64
- export interface PaletteJson {
65
- Primary: PaletteColor;
66
- Secondary: PaletteColor;
67
- Error: PaletteColor;
68
- Warning: PaletteColor;
69
- Success: PaletteColor;
70
- Info: Omit<PaletteColor, 'ContrastText'>;
71
- Grey: GreyPalette;
72
- Common: CommonColor;
73
- }
74
35
  export type TypographyOptions = TypographyVariantsOptions;
75
36
  export interface TypographyConfig {
76
37
  fontFamily?: string;
@@ -102,6 +63,9 @@ export type MakeTypography = () => TypographyOptions;
102
63
  * `theme.palette.background.contrast` get a type error.
103
64
  */
104
65
  declare module '@mui/material/styles' {
66
+ interface ColorSystemOptions {
67
+ shadows?: Shadows;
68
+ }
105
69
  interface CssThemeVariables {
106
70
  enabled: true;
107
71
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@linagora/twake-mui",
3
3
  "type": "module",
4
- "version": "9.1.0",
4
+ "version": "9.2.0",
5
5
  "description": "MUI v9 theme system for Twake applications",
6
6
  "author": "Twake",
7
7
  "license": "MIT",
@@ -40,7 +40,7 @@
40
40
  "build": "tsc",
41
41
  "build:doc": "storybook build --output-dir storybook-static",
42
42
  "start": "tsc --watch",
43
- "test": "echo \"Error: no test specified\" && exit 1",
43
+ "test": "vitest run --project unit",
44
44
  "lint": "eslint src --ext .ts,.tsx",
45
45
  "lint:fix": "eslint src --ext .ts,.tsx --fix",
46
46
  "clean": "rm -rf dist",
@@ -58,6 +58,7 @@
58
58
  "twake-i18n": ">=0.5.0"
59
59
  },
60
60
  "dependencies": {
61
+ "@linagora/twake-css": "^1.0.0",
61
62
  "@mui/utils": "^9.2.0",
62
63
  "classnames": "^2.5.1"
63
64
  },
@@ -1,100 +0,0 @@
1
- {
2
- "Primary": {
3
- "50": "#f6fbff",
4
- "100": "#e3f1ff",
5
- "200": "#d2e9ff",
6
- "300": "#bfdfff",
7
- "400": "#7bbdff",
8
- "500": "#46a2ff",
9
- "600": "#0a84ff",
10
- "700": "#006bd8",
11
- "800": "#0157ad",
12
- "900": "#082139",
13
- "ContrastText": "#fff"
14
- },
15
- "Secondary": {
16
- "50": "#f1f5fa",
17
- "100": "#e8f0fa",
18
- "200": "#d1e0f2",
19
- "300": "#b5d1f1",
20
- "400": "#96bce8",
21
- "500": "#85b5ec",
22
- "600": "#5c9ce6",
23
- "700": "#5085c3",
24
- "800": "#243b55",
25
- "900": "#081f39",
26
- "ContrastText": "#fff"
27
- },
28
- "Error": {
29
- "50": "#fffbfe",
30
- "100": "#fceeee",
31
- "200": "#ffd2d7",
32
- "300": "#ff939d",
33
- "400": "#ff7a87",
34
- "500": "#ff4d5e",
35
- "600": "#ff3347",
36
- "700": "#d32c3c",
37
- "800": "#b52c39",
38
- "900": "#7a1e27",
39
- "ContrastText": "#fff"
40
- },
41
- "Warning": {
42
- "50": "#fff8e1",
43
- "100": "#ffecb3",
44
- "200": "#ffe082",
45
- "300": "#ffd54f",
46
- "400": "#ffca28",
47
- "500": "#ffb300",
48
- "600": "#ff8f00",
49
- "700": "#ff6f00",
50
- "800": "#b5672c",
51
- "900": "#281c07",
52
- "ContrastText": "#fff"
53
- },
54
- "Success": {
55
- "50": "#f3fff5",
56
- "100": "#e3ffe7",
57
- "200": "#b9f6ca",
58
- "300": "#97eca1",
59
- "400": "#66e475",
60
- "500": "#38c949",
61
- "600": "#00c853",
62
- "700": "#00ad48",
63
- "800": "#245538",
64
- "900": "#08250b",
65
- "ContrastText": "#fff"
66
- },
67
- "Info": {
68
- "50": "#edffff",
69
- "100": "#d4feff",
70
- "200": "#affdff",
71
- "300": "#86f5f7",
72
- "400": "#4ee2e5",
73
- "500": "#1de9b6",
74
- "600": "#00bfa5",
75
- "700": "#00796b",
76
- "800": "#004345",
77
- "900": "#002526"
78
- },
79
- "Grey": {
80
- "50": "#FBFDFF",
81
- "100": "#F3F6F9",
82
- "200": "#EDF2F7",
83
- "300": "#E1E3E6",
84
- "400": "#C5C7CA",
85
- "500": "#AAACAE",
86
- "600": "#909294",
87
- "700": "#757779",
88
- "800": "#4E5052",
89
- "900": "#424244",
90
- "A100": "#FCFCFC",
91
- "A200": "#E5ECF3",
92
- "A400": "#2C3039",
93
- "A700": "#5D6169",
94
- "A900": "#1C1B1F"
95
- },
96
- "Common": {
97
- "white": "#fff",
98
- "black": "#000"
99
- }
100
- }