@linagora/twake-mui 9.1.0 → 9.3.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,27 @@
1
+ # @linagora/twake-mui [9.3.0](https://github.com/linagora/twake-ui/compare/@linagora/twake-mui@9.2.0...@linagora/twake-mui@9.3.0) (2026-09-23)
2
+
3
+
4
+ ### Features
5
+
6
+ * **twake-mui:** Migrate Tooltip from cozy-ui ([6a5263a](https://github.com/linagora/twake-ui/commit/6a5263a2d5246798a1d003a8a2a7e0b5183bbe0d))
7
+
8
+ # @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)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * **twake-mui:** Tint light-mode shadows with Grey 900, like cozy-ui ([4c74b68](https://github.com/linagora/twake-ui/commit/4c74b6861f6160ce174b7022ec2b42a64f5d5ecd))
14
+
15
+
16
+ ### Features
17
+
18
+ * Read the palette from twake-css ([7c0a9e6](https://github.com/linagora/twake-ui/commit/7c0a9e6719d9520bdfdbd7b32b9d3132f2ae7d64))
19
+
20
+
21
+ ### Dependencies
22
+
23
+ * **@linagora/twake-css:** upgraded to 1.0.0
24
+
1
25
  # @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
26
 
3
27
 
@@ -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 ?? {}));
@@ -1000,10 +1000,17 @@ export const overrides = {
1000
1000
  styleOverrides: {
1001
1001
  tooltip: ({ theme }) => ({
1002
1002
  backgroundColor: alpha(theme.palette.grey[800], 0.9),
1003
- fontSize: '1rem',
1004
- lineHeight: 1.3,
1005
- borderRadius: '4px',
1006
- padding: '8px 12px'
1003
+ borderRadius: radius.sm,
1004
+ variants: [
1005
+ {
1006
+ props: ({ ownerState }) => !ownerState.touch,
1007
+ style: {
1008
+ fontSize: theme.typography.pxToRem(16),
1009
+ lineHeight: 1.3,
1010
+ padding: '8px 12px'
1011
+ }
1012
+ }
1013
+ ]
1007
1014
  })
1008
1015
  }
1009
1016
  },
@@ -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
  }
@@ -3,5 +3,5 @@ import type { Meta, StoryObj } from '@storybook/react-vite';
3
3
  declare const meta: Meta<typeof Tooltip>;
4
4
  export default meta;
5
5
  type Story = StoryObj<typeof Tooltip>;
6
- export declare const Docs: Story;
6
+ export declare const Default: Story;
7
7
  export declare const Screenshot: Story;
@@ -1,13 +1,24 @@
1
- import { Tooltip, Typography } from '@mui/material';
1
+ import { CarbonCopy, Icon } from '@linagora/twake-icons';
2
+ import { Box, Stack, Tooltip, Typography } from '@mui/material';
2
3
  import React from 'react';
4
+ const title = (React.createElement(React.Fragment, null,
5
+ React.createElement(Stack, { direction: "row", spacing: 1, sx: { alignItems: 'center', mb: 1 } },
6
+ React.createElement(Icon, { icon: CarbonCopy }),
7
+ React.createElement(Typography, { variant: "body1", color: "inherit" }, "Carbon copy")),
8
+ React.createElement(Typography, { variant: "caption", color: "inherit" }, "Indicates whether the document is defined as \u201Cauthentic and original\u201D by Cozy Cloud, the host of your Cozy, as it can claim that it comes directly from a third-party service, without having undergone any modification.")));
3
9
  const meta = {
4
10
  title: 'Tooltip',
5
11
  component: Tooltip,
6
12
  parameters: { layout: 'centered' },
7
- tags: ['autodocs']
13
+ tags: ['autodocs'],
14
+ decorators: [
15
+ // The dark tooltip shares the dark paper colour, so it would vanish on it
16
+ (Story) => (React.createElement(Box, { sx: theme => theme.applyStyles('dark', { bgcolor: 'background.default' }) },
17
+ React.createElement(Story, null)))
18
+ ]
8
19
  };
9
20
  export default meta;
10
- export const Docs = {
21
+ export const Default = {
11
22
  argTypes: {
12
23
  placement: {
13
24
  control: 'select',
@@ -25,17 +36,13 @@ export const Docs = {
25
36
  arrow: { control: 'boolean' }
26
37
  },
27
38
  args: {
28
- title: (React.createElement(React.Fragment, null,
29
- React.createElement(Typography, { variant: "body1", color: "inherit" }, "Carbon copy"),
30
- React.createElement(Typography, { variant: "caption", color: "inherit" }, "Indicates whether the document is defined as \u201Cauthentic and original\u201D"))),
39
+ title,
31
40
  children: React.createElement("u", null, "hover over me")
32
41
  }
33
42
  };
34
43
  export const Screenshot = {
35
44
  tags: ['argos'],
36
- render: () => (React.createElement("div", { style: { padding: 48 } },
37
- React.createElement(Tooltip, { open: true, title: React.createElement(React.Fragment, null,
38
- React.createElement(Typography, { variant: "body1", color: "inherit" }, "Carbon copy"),
39
- React.createElement(Typography, { variant: "caption", color: "inherit" }, "Indicates whether the document is defined as \u201Cauthentic and original\u201D")) },
45
+ render: () => (React.createElement("div", { style: { padding: '48px 96px 200px' } },
46
+ React.createElement(Tooltip, { open: true, title: title },
40
47
  React.createElement("u", null, "hover over me"))))
41
48
  };
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.3.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
- }