@linagora/twake-mui 9.5.0 → 9.6.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,22 @@
1
+ # @linagora/twake-mui [9.6.0](https://github.com/linagora/twake-ui/compare/@linagora/twake-mui@9.5.1...@linagora/twake-mui@9.6.0) (2026-09-24)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **twake-mui:** Clean old MenuItem override ([8c7b2f9](https://github.com/linagora/twake-ui/commit/8c7b2f9824e4ecc695f293ee04367415c5d5602e))
7
+
8
+
9
+ ### Features
10
+
11
+ * **twake-mui:** Migrate Menu from cozy-ui ([e73e894](https://github.com/linagora/twake-ui/commit/e73e894938ac5e30f647f7e64ff06737b03afbad))
12
+
13
+ ## @linagora/twake-mui [9.5.1](https://github.com/linagora/twake-ui/compare/@linagora/twake-mui@9.5.0...@linagora/twake-mui@9.5.1) (2026-09-24)
14
+
15
+
16
+ ### Bug Fixes
17
+
18
+ * **twake-mui:** Remove the dark mode elevation overlay on papers ([b940b8f](https://github.com/linagora/twake-ui/commit/b940b8feba4abbe7918870ea1253a21469d3e534))
19
+
1
20
  # @linagora/twake-mui [9.5.0](https://github.com/linagora/twake-ui/compare/@linagora/twake-mui@9.4.0...@linagora/twake-mui@9.5.0) (2026-09-24)
2
21
 
3
22
 
@@ -34,7 +34,8 @@ export const makeTheme = (mode = 'light', paletteOverrides, themeOptions) => {
34
34
  },
35
35
  dark: {
36
36
  palette: makePalette('dark', paletteOverrides),
37
- shadows: makeShadows('dark')
37
+ shadows: makeShadows('dark'),
38
+ overlays: Array(25).fill('none')
38
39
  }
39
40
  },
40
41
  typography: makeTypography(),
@@ -5,7 +5,8 @@ import { checkboxClasses } from '@mui/material/Checkbox';
5
5
  import { dialogTitleClasses } from '@mui/material/DialogTitle';
6
6
  import { formHelperTextClasses } from '@mui/material/FormHelperText';
7
7
  import { formLabelClasses } from '@mui/material/FormLabel';
8
- import { menuItemClasses } from '@mui/material/MenuItem';
8
+ import { listItemIconClasses } from '@mui/material/ListItemIcon';
9
+ import { listItemTextClasses } from '@mui/material/ListItemText';
9
10
  import { outlinedInputClasses } from '@mui/material/OutlinedInput';
10
11
  import { radioClasses } from '@mui/material/Radio';
11
12
  import { selectClasses } from '@mui/material/Select';
@@ -1014,20 +1015,33 @@ export const overrides = {
1014
1015
  })
1015
1016
  }
1016
1017
  },
1018
+ MuiMenu: {
1019
+ styleOverrides: {
1020
+ paper: { maxWidth: 320 }
1021
+ }
1022
+ },
1017
1023
  MuiMenuItem: {
1018
1024
  styleOverrides: {
1019
1025
  root: ({ theme }) => ({
1020
- borderRadius: radius.md,
1021
- '&&&:hover': {
1022
- backgroundColor: `${alpha(theme.palette.primary.main, theme.palette.action.hoverOpacity)}`
1026
+ gap: 16,
1027
+ paddingTop: 4,
1028
+ paddingBottom: 4,
1029
+ whiteSpace: 'normal',
1030
+ wordBreak: 'break-word',
1031
+ [`& .${listItemIconClasses.root}`]: {
1032
+ minWidth: 'auto',
1033
+ color: theme.vars.palette.text.icon
1023
1034
  },
1024
- [`&.${menuItemClasses.selected}`]: {
1025
- backgroundColor: alpha(theme.palette.primary.main, theme.palette.action.selectedOpacity),
1026
- '&:hover': {
1027
- backgroundColor: alpha(theme.palette.primary.main, theme.palette.action.selectedOpacity +
1028
- theme.palette.action.hoverOpacity)
1035
+ [`& .${listItemTextClasses.root}`]: {
1036
+ marginTop: 1,
1037
+ marginBottom: 1
1038
+ },
1039
+ variants: [
1040
+ {
1041
+ props: { dense: false },
1042
+ style: { [theme.breakpoints.up('sm')]: { minHeight: 40 } }
1029
1043
  }
1030
- }
1044
+ ]
1031
1045
  })
1032
1046
  }
1033
1047
  },
@@ -0,0 +1,7 @@
1
+ import { Menu } from '@mui/material';
2
+ import type { Meta, StoryObj } from '@storybook/react-vite';
3
+ declare const meta: Meta<typeof Menu>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof meta>;
6
+ export declare const Default: Story;
7
+ export declare const Screenshot: Story;
@@ -0,0 +1,71 @@
1
+ import { Attachment, Attention, Bottom, Contrast, Copy, Icon, Pen, People, Telephone } from '@linagora/twake-icons';
2
+ import { Box, Button, Divider, ListItemIcon, ListItemText, Menu, MenuItem, Typography } from '@mui/material';
3
+ import React, { useState } from 'react';
4
+ const items = [
5
+ React.createElement(MenuItem, { key: "modify" },
6
+ React.createElement(ListItemIcon, null,
7
+ React.createElement(Icon, { icon: Pen })),
8
+ React.createElement(ListItemText, { primary: "Modify" }),
9
+ React.createElement(ListItemIcon, null,
10
+ React.createElement(Typography, { color: "error" },
11
+ React.createElement(Icon, { icon: Attention })))),
12
+ React.createElement(MenuItem, { key: "people" },
13
+ React.createElement(ListItemIcon, null,
14
+ React.createElement(Icon, { icon: People })),
15
+ React.createElement(ListItemText, { primary: "People" })),
16
+ React.createElement(MenuItem, { key: "attachment" },
17
+ React.createElement(ListItemIcon, null,
18
+ React.createElement(Icon, { icon: Attachment })),
19
+ React.createElement(ListItemText, { primary: "Attachment" })),
20
+ React.createElement(MenuItem, { key: "long" },
21
+ React.createElement(ListItemIcon, null,
22
+ React.createElement(Icon, { icon: People })),
23
+ React.createElement(ListItemText, { primary: "Item with a very long title to show how it should be displayed" })),
24
+ React.createElement(MenuItem, { key: "no-icon" },
25
+ React.createElement(ListItemText, { primary: "Item without icon" })),
26
+ React.createElement(Divider, { key: "divider" }),
27
+ React.createElement(MenuItem, { key: "call" },
28
+ React.createElement(ListItemIcon, null,
29
+ React.createElement(Icon, { icon: Telephone })),
30
+ React.createElement(ListItemText, { primary: "Call" })),
31
+ React.createElement(MenuItem, { key: "contrast" },
32
+ React.createElement(ListItemIcon, null,
33
+ React.createElement(Icon, { icon: Contrast })),
34
+ React.createElement(ListItemText, { primary: "Contrast" })),
35
+ React.createElement(MenuItem, { key: "copy" },
36
+ React.createElement(ListItemIcon, null,
37
+ React.createElement(Icon, { icon: Copy })),
38
+ React.createElement(ListItemText, { primary: "Copy" }))
39
+ ];
40
+ const ExampleMenu = ({ defaultOpen = false, ...props }) => {
41
+ const [button, setButton] = useState(null);
42
+ const [open, setOpen] = useState(defaultOpen);
43
+ return (React.createElement(React.Fragment, null,
44
+ React.createElement(Button, { ref: setButton, variant: "text", endIcon: React.createElement(Icon, { icon: Bottom }), onClick: () => setOpen(!open) }, "Show menu"),
45
+ React.createElement(Menu, { anchorOrigin: { vertical: 'bottom', horizontal: 'left' }, ...props, anchorEl: button, open: open && Boolean(button), onClose: () => setOpen(false) }, items)));
46
+ };
47
+ const meta = {
48
+ title: 'Menu',
49
+ component: Menu,
50
+ parameters: { layout: 'centered' },
51
+ tags: ['autodocs'],
52
+ argTypes: {
53
+ variant: { control: 'select', options: ['menu', 'selectedMenu'] },
54
+ autoFocus: { control: 'boolean' },
55
+ disableAutoFocusItem: { control: 'boolean' },
56
+ keepMounted: { control: 'boolean' },
57
+ marginThreshold: { control: 'number' },
58
+ elevation: { control: 'number' }
59
+ }
60
+ };
61
+ export default meta;
62
+ export const Default = {
63
+ render: args => React.createElement(ExampleMenu, { ...args })
64
+ };
65
+ // Visual Regression - The cozy-ui Menu doc example, opened
66
+ export const Screenshot = {
67
+ tags: ['argos'],
68
+ parameters: { layout: 'padded' },
69
+ render: () => (React.createElement(Box, { sx: { minHeight: 440 } },
70
+ React.createElement(ExampleMenu, { defaultOpen: true, autoFocus: false, disablePortal: true, disableScrollLock: true, transitionDuration: 0 })))
71
+ };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@linagora/twake-mui",
3
3
  "type": "module",
4
- "version": "9.5.0",
4
+ "version": "9.6.0",
5
5
  "description": "MUI v9 theme system for Twake applications",
6
6
  "author": "Twake",
7
7
  "license": "MIT",