@linagora/twake-mui 11.1.0 → 11.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,17 @@
1
+ # @linagora/twake-mui [11.3.0](https://github.com/linagora/twake-ui/compare/@linagora/twake-mui@11.2.0...@linagora/twake-mui@11.3.0) (2026-10-08)
2
+
3
+
4
+ ### Features
5
+
6
+ * **twake-mui:** Migrate ProgressionBanner from cozy-ui ([f3fb9a1](https://github.com/linagora/twake-ui/commit/f3fb9a11f9f91a15a5cb27d399c1956bcc1927c3))
7
+
8
+ # @linagora/twake-mui [11.2.0](https://github.com/linagora/twake-ui/compare/@linagora/twake-mui@11.1.0...@linagora/twake-mui@11.2.0) (2026-10-08)
9
+
10
+
11
+ ### Features
12
+
13
+ * **twake-mui:** Migrate Markdown from cozy-ui ([120d160](https://github.com/linagora/twake-ui/commit/120d1608e7c7ef4d1d624293b6c3d49d0e27a281))
14
+
1
15
  # @linagora/twake-mui [11.1.0](https://github.com/linagora/twake-ui/compare/@linagora/twake-mui@11.0.0...@linagora/twake-mui@11.1.0) (2026-10-08)
2
16
 
3
17
 
@@ -0,0 +1,7 @@
1
+ import type { Meta, StoryObj } from '@storybook/react-vite';
2
+ import Markdown from './index';
3
+ declare const meta: Meta<typeof Markdown>;
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,78 @@
1
+ import Markdown from './index';
2
+ const content = `
3
+ # Demo
4
+
5
+ This is a text to test all possibilities of markdown.
6
+
7
+ ## Headers
8
+
9
+ # H1 Header
10
+ ## H2 Header
11
+ ### H3 Header
12
+ #### H4 Header
13
+ ##### H5 Header
14
+ ###### H6 Header
15
+
16
+ ## Paragraphs
17
+
18
+ I really like using Markdown.
19
+
20
+ I think I'll use it to format all of my documents from now on.
21
+
22
+ ## Emphasis
23
+
24
+ _Italic Text_
25
+
26
+ ***Bold Text***
27
+
28
+ __Bold and Italic Text__
29
+
30
+ ~~Strikethrough~~
31
+
32
+ <u>Underline</u>
33
+
34
+ ## Lists
35
+
36
+ 1. Ordered List Item 1
37
+ 2. Ordered List Item 2
38
+ 3. Ordered List Item 3
39
+
40
+ - Unordered List Item 1
41
+ - Unordered List Item 2
42
+ - Unordered List Item 3
43
+
44
+ ## Links
45
+
46
+ [Link to GitHub](https://github.com/linagora/twake-ui)
47
+
48
+ ## Images
49
+
50
+ ![Mountains](https://picsum.photos/id/1018/400/200 "Mountains")
51
+
52
+ ## Code
53
+
54
+ Inline code: \`const variable = 'value';\`
55
+
56
+ Block code:
57
+ \`\`\`javascript function add(a, b) { return a + b; }\`\`\`
58
+
59
+ ## Blockquotes
60
+
61
+ > This is a blockquote.
62
+ `;
63
+ const meta = {
64
+ title: 'Markdown',
65
+ component: Markdown,
66
+ tags: ['autodocs'],
67
+ argTypes: {
68
+ content: { control: 'text' }
69
+ }
70
+ };
71
+ export default meta;
72
+ export const Default = {
73
+ args: { content }
74
+ };
75
+ export const Screenshot = {
76
+ tags: ['argos'],
77
+ args: { content }
78
+ };
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ export interface MarkdownProps {
3
+ content: string;
4
+ }
5
+ declare const Markdown: React.FC<MarkdownProps>;
6
+ export default Markdown;
@@ -0,0 +1,21 @@
1
+ import { Link, Typography } from '@mui/material';
2
+ import React from 'react';
3
+ import ReactMarkdown from 'react-markdown';
4
+ import remarkGfm from 'remark-gfm';
5
+ const makeHeading = (variant) => {
6
+ const Heading = ({ children }) => (React.createElement(Typography, { variant: variant, sx: { mb: 2 } }, children));
7
+ return Heading;
8
+ };
9
+ const components = {
10
+ a: ({ children, href }) => (React.createElement(Link, { href: href, rel: "noreferrer", target: "_blank" }, children)),
11
+ p: ({ children }) => (React.createElement(Typography, { variant: "body1", sx: { mb: 2 } }, children)),
12
+ h1: makeHeading('h1'),
13
+ h2: makeHeading('h2'),
14
+ h3: makeHeading('h3'),
15
+ h4: makeHeading('h4'),
16
+ h5: makeHeading('h5'),
17
+ h6: makeHeading('h6')
18
+ };
19
+ const remarkPlugins = [remarkGfm];
20
+ const Markdown = ({ content }) => (React.createElement(ReactMarkdown, { remarkPlugins: remarkPlugins, components: components }, content));
21
+ export default Markdown;
@@ -0,0 +1,7 @@
1
+ import type { Meta, StoryObj } from '@storybook/react-vite';
2
+ import ProgressionBanner from './index';
3
+ declare const meta: Meta<typeof ProgressionBanner>;
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,47 @@
1
+ /* eslint-disable no-console */
2
+ import { CloudSync2, Icon } from '@linagora/twake-icons';
3
+ import { Button, Stack } from '@mui/material';
4
+ import React from 'react';
5
+ import ProgressionBanner from './index';
6
+ const icon = React.createElement(Icon, { icon: CloudSync2 });
7
+ const errorLight = 'var(--twake-palette-error-light)';
8
+ const manageButton = (React.createElement(Button, { variant: "text", color: "primary", onClick: () => console.log('clicked') }, "Manage your storage space"));
9
+ const meta = {
10
+ title: 'ProgressionBanner',
11
+ component: ProgressionBanner,
12
+ tags: ['autodocs'],
13
+ argTypes: {
14
+ value: { control: { type: 'range', min: 0, max: 100, step: 1 } },
15
+ text: { control: 'text' },
16
+ progressBar: { control: 'boolean' },
17
+ color: { control: 'color' }
18
+ }
19
+ };
20
+ export default meta;
21
+ export const Default = {
22
+ args: {
23
+ value: 25,
24
+ text: '4 remaining items',
25
+ progressBar: true,
26
+ icon
27
+ }
28
+ };
29
+ const Row = ({ title, children }) => (React.createElement("section", null,
30
+ React.createElement("h3", { style: { marginBottom: '12px' } }, title),
31
+ children));
32
+ export const Screenshot = {
33
+ tags: ['argos'],
34
+ render: () => (React.createElement(Stack, { spacing: 4 },
35
+ React.createElement(Row, { title: "Determinate" },
36
+ React.createElement(ProgressionBanner, { value: 25, text: "4 remaining items", icon: icon })),
37
+ React.createElement(Row, { title: "Indeterminate" },
38
+ React.createElement(ProgressionBanner, { text: "4 remaining items", icon: icon })),
39
+ React.createElement(Row, { title: "Without progress bar" },
40
+ React.createElement(ProgressionBanner, { progressBar: false, text: "4 remaining items", icon: icon })),
41
+ React.createElement(Row, { title: "With button" },
42
+ React.createElement(ProgressionBanner, { value: 25, text: "Storage limit nearly reached", icon: icon, button: manageButton })),
43
+ React.createElement(Row, { title: "Custom color" },
44
+ React.createElement(ProgressionBanner, { value: 25, color: errorLight, text: "Storage limit nearly reached", icon: icon, button: manageButton })),
45
+ React.createElement(Row, { title: "Default icon" },
46
+ React.createElement(ProgressionBanner, { value: 25, text: "4 remaining items" }))))
47
+ };
@@ -0,0 +1,2 @@
1
+ declare const ProgressionBannerProgress: import("@emotion/styled").StyledComponent<import("@mui/material").LinearProgressProps & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
2
+ export default ProgressionBannerProgress;
@@ -0,0 +1,7 @@
1
+ import { LinearProgress, styled } from '@mui/material';
2
+ const ProgressionBannerProgress = styled(LinearProgress)({
3
+ backgroundColor: 'transparent',
4
+ height: 2,
5
+ marginTop: -2
6
+ });
7
+ export default ProgressionBannerProgress;
@@ -0,0 +1,4 @@
1
+ declare const ProgressionBannerRoot: import("@emotion/styled").StyledComponent<import("@mui/material").AlertProps & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
2
+ background?: string;
3
+ }, {}, {}>;
4
+ export default ProgressionBannerRoot;
@@ -0,0 +1,21 @@
1
+ import { Alert, alertClasses, styled } from '@mui/material';
2
+ const ProgressionBannerRoot = styled(Alert, {
3
+ shouldForwardProp: prop => prop !== 'background'
4
+ })(({ theme, background }) => ({
5
+ borderRadius: 0,
6
+ // outranks the severity tint, which the dark scheme re-applies after this rule
7
+ '&&': {
8
+ backgroundColor: background ?? theme.vars.palette.background.contrast
9
+ },
10
+ [theme.breakpoints.down('md')]: {
11
+ flexWrap: 'wrap',
12
+ // keeps the message beside the icon so only the action wraps
13
+ [`& .${alertClasses.message}`]: { flexBasis: 0 },
14
+ [`& .${alertClasses.action}`]: {
15
+ width: '100%',
16
+ paddingLeft: 0,
17
+ justifyContent: 'end'
18
+ }
19
+ }
20
+ }));
21
+ export default ProgressionBannerRoot;
@@ -0,0 +1,14 @@
1
+ import { AlertProps } from '@mui/material';
2
+ import React from 'react';
3
+ export interface ProgressionBannerProps extends Omit<AlertProps, 'color' | 'children'> {
4
+ /** Percentage of progression, between 0 and 100. Without it the bar is indeterminate. */
5
+ value?: number;
6
+ text?: React.ReactNode;
7
+ /** Rendered as the alert action */
8
+ button?: React.ReactNode;
9
+ progressBar?: boolean;
10
+ /** Background colour of the banner, any CSS colour */
11
+ color?: string;
12
+ }
13
+ declare const ProgressionBanner: React.FC<ProgressionBannerProps>;
14
+ export default ProgressionBanner;
@@ -0,0 +1,11 @@
1
+ import { Typography } from '@mui/material';
2
+ import React from 'react';
3
+ import ProgressionBannerProgress from './ProgressionBannerProgress';
4
+ import ProgressionBannerRoot from './ProgressionBannerRoot';
5
+ const ProgressionBanner = ({ value, text, icon, button, progressBar = true, color, ...props }) => (React.createElement(React.Fragment, null,
6
+ React.createElement(ProgressionBannerRoot, { icon: React.isValidElement(icon)
7
+ ? React.cloneElement(icon, { size: icon.props.size ?? 32 })
8
+ : icon, action: button, background: color, ...props },
9
+ React.createElement(Typography, { component: "span", variant: "h6" }, text)),
10
+ progressBar && (React.createElement(ProgressionBannerProgress, { variant: value ? 'determinate' : 'indeterminate', value: value }))));
11
+ export default ProgressionBanner;
package/dist/index.d.ts CHANGED
@@ -49,7 +49,9 @@ export { default as ListItemText } from './components/ListItemText';
49
49
  export { default as ListItemSkeleton } from './components/ListItemSkeleton';
50
50
  export { default as ListSkeleton } from './components/ListSkeleton';
51
51
  export { default as ListSubheader } from './components/ListSubheader';
52
+ export { default as Markdown } from './components/Markdown';
52
53
  export { default as PointerAlert } from './components/PointerAlert';
54
+ export { default as ProgressionBanner } from './components/ProgressionBanner';
53
55
  export { Tabs, default as TabsDefault } from './components/Tabs';
54
56
  export { Switch, default as SwitchDefault } from './components/Switch';
55
57
  export { SearchBar, default as SearchBarDefault } from './components/SearchBar';
@@ -109,6 +111,7 @@ export type { OverlayBox, OverlayRegion } from './components/SpaceOverlay/region
109
111
  export type { OverlayFrameProps } from './components/SpaceOverlay/OverlayFrame';
110
112
  export type { DialogProps, DialogSize } from './components/Dialog';
111
113
  export type { PointerAlertProps, PointerAlertDirection } from './components/PointerAlert';
114
+ export type { ProgressionBannerProps } from './components/ProgressionBanner';
112
115
  export type { EmptyProps, EmptyIconSize, EmptyComponentsProps } from './components/Empty';
113
116
  export type { DropdownButtonProps } from './components/DropdownButton';
114
117
  export type { DropdownTextProps, DropdownTextVariant } from './components/DropdownText';
@@ -119,6 +122,7 @@ export type { ListItemTextProps } from './components/ListItemText';
119
122
  export type { ListItemSkeletonProps } from './components/ListItemSkeleton';
120
123
  export type { ListSkeletonProps } from './components/ListSkeleton';
121
124
  export type { ListSubheaderProps } from './components/ListSubheader';
125
+ export type { MarkdownProps } from './components/Markdown';
122
126
  export type { TabsProps } from './components/Tabs';
123
127
  export type { SwitchProps } from './components/Switch';
124
128
  export type { SearchBarProps } from './components/SearchBar/types';
package/dist/index.js CHANGED
@@ -52,7 +52,9 @@ export { default as ListItemText } from './components/ListItemText';
52
52
  export { default as ListItemSkeleton } from './components/ListItemSkeleton';
53
53
  export { default as ListSkeleton } from './components/ListSkeleton';
54
54
  export { default as ListSubheader } from './components/ListSubheader';
55
+ export { default as Markdown } from './components/Markdown';
55
56
  export { default as PointerAlert } from './components/PointerAlert';
57
+ export { default as ProgressionBanner } from './components/ProgressionBanner';
56
58
  export { Tabs, default as TabsDefault } from './components/Tabs';
57
59
  export { Switch, default as SwitchDefault } from './components/Switch';
58
60
  export { SearchBar, default as SearchBarDefault } from './components/SearchBar';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@linagora/twake-mui",
3
3
  "type": "module",
4
- "version": "11.1.0",
4
+ "version": "11.3.0",
5
5
  "description": "MUI v9 theme system for Twake applications",
6
6
  "author": "Twake",
7
7
  "license": "MIT",
@@ -66,8 +66,10 @@
66
66
  "classnames": "^2.5.1",
67
67
  "cozy-minilog": "^3.10.1",
68
68
  "pdf-lib": "^1.17.1",
69
+ "react-markdown": "^10.1.0",
69
70
  "react-use-measure": "2.1.7",
70
71
  "react-virtuoso": "4.13.0",
72
+ "remark-gfm": "^4.0.1",
71
73
  "rooks": "8.4.0"
72
74
  },
73
75
  "devDependencies": {