@linagora/twake-mui 7.0.0 → 7.1.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,15 @@
1
+ # @linagora/twake-mui [7.1.0](https://github.com/linagora/twake-ui/compare/@linagora/twake-mui@7.0.0...@linagora/twake-mui@7.1.0) (2026-09-10)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **twake-mui:** Clean old IconButton override ([b5a7733](https://github.com/linagora/twake-ui/commit/b5a7733ad9451ea9950e93a787133a2f9bf951d5))
7
+
8
+
9
+ ### Features
10
+
11
+ * **twake-mui:** Migrate IconButton from cozy-ui ([d6aca04](https://github.com/linagora/twake-ui/commit/d6aca0454195f1d3ffd5170b2463f5bec9254678))
12
+
1
13
  # @linagora/twake-mui [7.0.0](https://github.com/linagora/twake-ui/compare/@linagora/twake-mui@6.0.0...@linagora/twake-mui@7.0.0) (2026-09-08)
2
14
 
3
15
 
@@ -2,9 +2,9 @@ import { Icon, CrossSmall } from '@linagora/twake-icons';
2
2
  import { Box, Chip as MuiChip, IconButton } from '@mui/material';
3
3
  import cx from 'classnames';
4
4
  import React from 'react';
5
- export const Chip = ({ className, deleteIcon = (React.createElement(IconButton, null,
6
- React.createElement(Icon, { icon: CrossSmall }))), label, endIcon, square = false, ...props }) => {
7
- return (React.createElement(MuiChip, { className: cx(className, { square }), deleteIcon: deleteIcon, label: endIcon ? (React.createElement(Box, { component: "span", sx: { display: 'flex', alignItems: 'center', gap: 1 } },
5
+ export const Chip = ({ className, label, endIcon, square = false, size, deleteIcon = (React.createElement(IconButton, { size: size === 'small' ? 'xsmall' : 'small' },
6
+ React.createElement(Icon, { icon: CrossSmall }))), ...props }) => {
7
+ return (React.createElement(MuiChip, { size: size, className: cx(className, { square }), deleteIcon: deleteIcon, label: endIcon ? (React.createElement(Box, { component: "span", sx: { display: 'flex', alignItems: 'center', gap: 1 } },
8
8
  label,
9
9
  React.createElement("span", null, endIcon))) : (label), ...props }));
10
10
  };
@@ -364,10 +364,41 @@ export const lightOverrides = {
364
364
  }
365
365
  },
366
366
  MuiIconButton: {
367
+ defaultProps: { size: 'large' },
367
368
  styleOverrides: {
368
369
  root: ({ theme }) => ({
369
- color: alpha(theme.palette.grey[900], 0.48),
370
- padding: '4px'
370
+ variants: [
371
+ {
372
+ props: { color: 'default' },
373
+ style: {
374
+ color: theme.palette.text.secondary
375
+ }
376
+ },
377
+ {
378
+ props: { size: 'xsmall' },
379
+ style: {
380
+ padding: '5px'
381
+ }
382
+ },
383
+ {
384
+ props: { size: 'small' },
385
+ style: {
386
+ padding: '8px'
387
+ }
388
+ },
389
+ {
390
+ props: { size: 'medium' },
391
+ style: {
392
+ padding: '12px'
393
+ }
394
+ },
395
+ {
396
+ props: { size: 'large' },
397
+ style: {
398
+ padding: '16px'
399
+ }
400
+ }
401
+ ]
371
402
  })
372
403
  }
373
404
  },
@@ -115,3 +115,8 @@ declare module '@mui/material/styles' {
115
115
  border?: Partial<BorderPalette>;
116
116
  }
117
117
  }
118
+ declare module '@mui/material/IconButton' {
119
+ interface IconButtonPropsSizeOverrides {
120
+ xsmall: true;
121
+ }
122
+ }
@@ -81,8 +81,8 @@ export const Screenshot = {
81
81
  React.createElement("div", null,
82
82
  React.createElement(Chip, { color: color, variant: variant, label: "Avatar Chip", avatar: React.createElement(Avatar, null, "M"), square: square, size: size })),
83
83
  React.createElement("div", null,
84
- React.createElement(Chip, { color: color, variant: variant, label: "Action chip", avatar: React.createElement(Avatar, null, "M"), deleteIcon: React.createElement(IconButton, null,
85
- React.createElement(Icon, { icon: Right })), endIcon: React.createElement(IconButton, { sx: {
84
+ React.createElement(Chip, { color: color, variant: variant, label: "Action chip", avatar: React.createElement(Avatar, null, "M"), deleteIcon: React.createElement(IconButton, { size: size === 'small' ? 'xsmall' : 'small' },
85
+ React.createElement(Icon, { icon: Right })), endIcon: React.createElement(IconButton, { size: size === 'small' ? 'xsmall' : 'small', sx: {
86
86
  color: color === 'default'
87
87
  ? `${color}.main`
88
88
  : `inherit`
@@ -0,0 +1,7 @@
1
+ import { IconButton } from '@mui/material';
2
+ import type { Meta, StoryObj } from '@storybook/react-vite';
3
+ declare const meta: Meta<typeof IconButton>;
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,59 @@
1
+ import { Cross, Icon, People, Restore, Stop, Trash } from '@linagora/twake-icons';
2
+ import { Button, IconButton, Stack, Typography } from '@mui/material';
3
+ import React from 'react';
4
+ const meta = {
5
+ title: 'IconButton',
6
+ component: IconButton,
7
+ parameters: { layout: 'centered' },
8
+ tags: ['autodocs'],
9
+ argTypes: {
10
+ color: {
11
+ control: 'select',
12
+ options: ['default', 'inherit', 'primary', 'secondary', 'error']
13
+ },
14
+ size: {
15
+ control: 'select',
16
+ options: ['xsmall', 'small', 'medium', 'large']
17
+ },
18
+ disabled: { control: 'boolean' }
19
+ }
20
+ };
21
+ export default meta;
22
+ export const Default = {
23
+ args: {
24
+ children: React.createElement(Icon, { icon: People })
25
+ }
26
+ };
27
+ const sizes = ['xsmall', 'small', 'medium', 'large'];
28
+ const Row = ({ size, disabled }) => (React.createElement(Stack, { direction: "row", spacing: 1, sx: { alignItems: 'center' } },
29
+ React.createElement(IconButton, { size: size, disabled: disabled },
30
+ React.createElement(Icon, { icon: People })),
31
+ React.createElement(IconButton, { color: "primary", size: size, disabled: disabled },
32
+ React.createElement(Icon, { icon: Restore })),
33
+ React.createElement(IconButton, { color: "secondary", size: size, disabled: disabled },
34
+ React.createElement(Icon, { icon: Cross })),
35
+ React.createElement(IconButton, { color: "error", size: size, disabled: disabled },
36
+ React.createElement(Icon, { icon: Trash }))));
37
+ export const Screenshot = {
38
+ tags: ['argos'],
39
+ render: () => (React.createElement(Stack, { spacing: 4, sx: { p: 4 } },
40
+ sizes.map(size => (React.createElement("section", { key: size },
41
+ React.createElement("h3", null, size),
42
+ React.createElement(Stack, { direction: "row", spacing: 4 },
43
+ React.createElement(Stack, { spacing: 1 },
44
+ React.createElement(Typography, { variant: "caption" }, "default"),
45
+ React.createElement(Row, { size: size })),
46
+ React.createElement(Stack, { spacing: 1 },
47
+ React.createElement(Typography, { variant: "caption" }, "disabled"),
48
+ React.createElement(Row, { size: size, disabled: true })))))),
49
+ React.createElement("section", null,
50
+ React.createElement("h3", null, "Embedded button"),
51
+ React.createElement(IconButton, { size: "small" },
52
+ React.createElement(Button, { component: "div", sx: {
53
+ minWidth: 'auto',
54
+ width: 16,
55
+ height: 16,
56
+ borderRadius: '50%'
57
+ }, size: "small" },
58
+ React.createElement(Icon, { icon: Stop, size: 12 }))))))
59
+ };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@linagora/twake-mui",
3
3
  "type": "module",
4
- "version": "7.0.0",
4
+ "version": "7.1.0",
5
5
  "description": "MUI v9 theme system for Twake applications",
6
6
  "author": "Twake",
7
7
  "license": "MIT",