@linagora/twake-mui 11.2.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,10 @@
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
+
1
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)
2
9
 
3
10
 
@@ -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
@@ -51,6 +51,7 @@ export { default as ListSkeleton } from './components/ListSkeleton';
51
51
  export { default as ListSubheader } from './components/ListSubheader';
52
52
  export { default as Markdown } from './components/Markdown';
53
53
  export { default as PointerAlert } from './components/PointerAlert';
54
+ export { default as ProgressionBanner } from './components/ProgressionBanner';
54
55
  export { Tabs, default as TabsDefault } from './components/Tabs';
55
56
  export { Switch, default as SwitchDefault } from './components/Switch';
56
57
  export { SearchBar, default as SearchBarDefault } from './components/SearchBar';
@@ -110,6 +111,7 @@ export type { OverlayBox, OverlayRegion } from './components/SpaceOverlay/region
110
111
  export type { OverlayFrameProps } from './components/SpaceOverlay/OverlayFrame';
111
112
  export type { DialogProps, DialogSize } from './components/Dialog';
112
113
  export type { PointerAlertProps, PointerAlertDirection } from './components/PointerAlert';
114
+ export type { ProgressionBannerProps } from './components/ProgressionBanner';
113
115
  export type { EmptyProps, EmptyIconSize, EmptyComponentsProps } from './components/Empty';
114
116
  export type { DropdownButtonProps } from './components/DropdownButton';
115
117
  export type { DropdownTextProps, DropdownTextVariant } from './components/DropdownText';
package/dist/index.js CHANGED
@@ -54,6 +54,7 @@ export { default as ListSkeleton } from './components/ListSkeleton';
54
54
  export { default as ListSubheader } from './components/ListSubheader';
55
55
  export { default as Markdown } from './components/Markdown';
56
56
  export { default as PointerAlert } from './components/PointerAlert';
57
+ export { default as ProgressionBanner } from './components/ProgressionBanner';
57
58
  export { Tabs, default as TabsDefault } from './components/Tabs';
58
59
  export { Switch, default as SwitchDefault } from './components/Switch';
59
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.2.0",
4
+ "version": "11.3.0",
5
5
  "description": "MUI v9 theme system for Twake applications",
6
6
  "author": "Twake",
7
7
  "license": "MIT",