@linagora/twake-mui 13.0.0 → 13.2.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 [13.2.0](https://github.com/linagora/twake-ui/compare/@linagora/twake-mui@13.1.0...@linagora/twake-mui@13.2.0) (2026-10-13)
2
+
3
+
4
+ ### Features
5
+
6
+ * **twake-mui:** Migrate MidEllipsis from cozy-ui ([54c58b7](https://github.com/linagora/twake-ui/commit/54c58b75389c5a608080e2e4df7164f76f441b21))
7
+
8
+ # @linagora/twake-mui [13.1.0](https://github.com/linagora/twake-ui/compare/@linagora/twake-mui@13.0.0...@linagora/twake-mui@13.1.0) (2026-10-13)
9
+
10
+
11
+ ### Features
12
+
13
+ * **twake-mui:** Migrate BarTitle from cozy-ui ([63e9e21](https://github.com/linagora/twake-ui/commit/63e9e21fee5ceaffe6355c6eca9fc7f2aee5500b))
14
+
1
15
  # @linagora/twake-mui [13.0.0](https://github.com/linagora/twake-ui/compare/@linagora/twake-mui@12.1.0...@linagora/twake-mui@13.0.0) (2026-10-12)
2
16
 
3
17
 
@@ -0,0 +1,7 @@
1
+ import type { Meta, StoryObj } from '@storybook/react-vite';
2
+ import BarTitle from './index';
3
+ declare const meta: Meta<typeof BarTitle>;
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,35 @@
1
+ import { Box, Stack } from '@mui/material';
2
+ import React from 'react';
3
+ import BarTitle from './index';
4
+ const longTitle = 'Ada Lovelace, born Augusta Ada Byron, was an English mathematician and writer chiefly known for her work on the Analytical Engine';
5
+ const BarArea = ({ children }) => (React.createElement(Box, { sx: { border: '1px solid red' } }, children));
6
+ const meta = {
7
+ title: 'BarTitle',
8
+ component: BarTitle,
9
+ tags: ['autodocs'],
10
+ argTypes: {
11
+ children: { control: 'text' },
12
+ noWrap: { control: 'boolean' }
13
+ }
14
+ };
15
+ export default meta;
16
+ export const Default = {
17
+ args: {
18
+ children: 'My transactions',
19
+ noWrap: false
20
+ },
21
+ render: args => (React.createElement(BarArea, null,
22
+ React.createElement(BarTitle, { ...args })))
23
+ };
24
+ export const Screenshot = {
25
+ tags: ['argos'],
26
+ render: () => (React.createElement(Stack, { spacing: 4 },
27
+ React.createElement("section", null,
28
+ React.createElement("h3", null, "Basic usage"),
29
+ React.createElement(BarArea, null,
30
+ React.createElement(BarTitle, null, "My transactions"))),
31
+ React.createElement("section", null,
32
+ React.createElement("h3", null, "Long title with ellipsis"),
33
+ React.createElement(BarArea, null,
34
+ React.createElement(BarTitle, { noWrap: true }, longTitle)))))
35
+ };
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ export interface BarTitleProps {
3
+ children?: React.ReactNode;
4
+ /** Truncates the title with an ellipsis instead of wrapping */
5
+ noWrap?: boolean;
6
+ }
7
+ declare const BarTitle: React.FC<BarTitleProps>;
8
+ export default BarTitle;
@@ -0,0 +1,5 @@
1
+ import { Box, Typography } from '@mui/material';
2
+ import React from 'react';
3
+ const BarTitle = ({ noWrap = false, children }) => (React.createElement(Box, { sx: { display: 'flex', alignItems: 'center', height: 48 } },
4
+ React.createElement(Typography, { variant: "h4", component: "h1", color: "textPrimary", noWrap: noWrap }, children)));
5
+ export default BarTitle;
@@ -0,0 +1,7 @@
1
+ import type { Meta, StoryObj } from '@storybook/react-vite';
2
+ import MidEllipsis from './index';
3
+ declare const meta: Meta<typeof MidEllipsis>;
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,65 @@
1
+ import { Box, Link, Stack, Typography } from '@mui/material';
2
+ import React from 'react';
3
+ import MidEllipsis from './index';
4
+ const longText = 'Augusta Ada King-Noel, Countess of Lovelace (née Byron; 10 December 1815 – 27 November 1852) was an English mathematician and writer, chiefly known for her work on Charles Babbage’s proposed mechanical general-purpose computer, the Analytical Engine.';
5
+ const filename = 'my-very-long-file-name-from-last-summer-holidays.pdf';
6
+ const path = '/Documents/Administrative/Taxes/2025/Income statements';
7
+ const email = 'augusta.ada.king-noel.lovelace@analytical-engine.example.com';
8
+ const widths = [80, 150, 250, 400];
9
+ const Section = ({ title, children }) => (React.createElement("section", null,
10
+ React.createElement("h3", null, title),
11
+ children));
12
+ const meta = {
13
+ title: 'MidEllipsis',
14
+ component: MidEllipsis,
15
+ tags: ['autodocs'],
16
+ argTypes: {
17
+ text: { control: 'text' },
18
+ children: { control: 'text' },
19
+ className: { control: 'text' },
20
+ title: { control: 'text' }
21
+ }
22
+ };
23
+ export default meta;
24
+ export const Default = {
25
+ args: {
26
+ text: filename
27
+ },
28
+ render: args => (React.createElement(Box, { sx: { width: 250 } },
29
+ React.createElement(MidEllipsis, { ...args })))
30
+ };
31
+ export const Screenshot = {
32
+ tags: ['argos'],
33
+ render: () => (React.createElement(Stack, { spacing: 4 },
34
+ React.createElement(Section, { title: "Text prop" },
35
+ React.createElement(MidEllipsis, { text: longText })),
36
+ React.createElement(Section, { title: "Children" },
37
+ React.createElement(MidEllipsis, null, longText)),
38
+ React.createElement(Section, { title: "Text prop takes precedence over children" },
39
+ React.createElement(MidEllipsis, { text: "Shown from the text prop" }, "Hidden children")),
40
+ React.createElement(Section, { title: "Text fitting its container" },
41
+ React.createElement(MidEllipsis, { text: "Ada Lovelace" })),
42
+ React.createElement(Section, { title: "Container widths" },
43
+ React.createElement(Stack, { spacing: 1 }, widths.map(width => (React.createElement(Box, { key: width, sx: { width } },
44
+ React.createElement(MidEllipsis, { text: filename })))))),
45
+ React.createElement(Section, { title: "Preserved whitespace" },
46
+ React.createElement(Box, { sx: { width: 250 } },
47
+ React.createElement(MidEllipsis, { text: "Spaces kept as typed in the name.txt" }))),
48
+ React.createElement(Section, { title: "Inside Typography" },
49
+ React.createElement(Stack, { spacing: 1, sx: { width: 250 } },
50
+ React.createElement(Typography, { variant: "h3", noWrap: true },
51
+ React.createElement(MidEllipsis, { text: filename })),
52
+ React.createElement(Typography, { variant: "h4", color: "textPrimary", noWrap: true },
53
+ React.createElement(MidEllipsis, { text: filename })),
54
+ React.createElement(Typography, { variant: "body2", color: "textSecondary" },
55
+ React.createElement(MidEllipsis, { text: email })),
56
+ React.createElement(Typography, { variant: "caption", color: "textSecondary" },
57
+ React.createElement(MidEllipsis, { text: path })))),
58
+ React.createElement(Section, { title: "Inside a link" },
59
+ React.createElement(Box, { sx: { width: 250 } },
60
+ React.createElement(Link, { href: "#" },
61
+ React.createElement(MidEllipsis, { text: path })))),
62
+ React.createElement(Section, { title: "Custom className and native attributes" },
63
+ React.createElement(Box, { sx: { width: 250 } },
64
+ React.createElement(MidEllipsis, { className: "u-mh-1 u-error", title: filename, "data-testid": "mid-ellipsis", text: filename })))))
65
+ };
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ export interface MidEllipsisProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'children'> {
3
+ text?: string;
4
+ children?: string;
5
+ }
6
+ declare const MidEllipsis: React.ForwardRefExoticComponent<MidEllipsisProps & React.RefAttributes<HTMLDivElement>>;
7
+ export default MidEllipsis;
@@ -0,0 +1,16 @@
1
+ import cx from 'classnames';
2
+ import React, { forwardRef } from 'react';
3
+ // Wraps the RTL-overflowing last part so its characters still read left-to-right
4
+ const LRM = '‎';
5
+ const MidEllipsis = forwardRef(({ text, className, children, ...props }, ref) => {
6
+ const str = text || children || '';
7
+ const partLength = Math.round(str.length / 2);
8
+ return (React.createElement("div", { className: cx('u-midellipsis', className), ref: ref, ...props },
9
+ React.createElement("span", null, str.substring(0, partLength)),
10
+ React.createElement("span", null,
11
+ LRM,
12
+ str.substring(partLength),
13
+ LRM)));
14
+ });
15
+ MidEllipsis.displayName = 'MidEllipsis';
16
+ export default MidEllipsis;
package/dist/index.d.ts CHANGED
@@ -32,6 +32,7 @@ export { editAttribute } from './components/ActionsMenu/Actions/editAttribute';
32
32
  export { others } from './components/ActionsMenu/Actions/others';
33
33
  export { exportToText } from './components/ActionsMenu/Actions/exportToText';
34
34
  export { Avatar, default as AvatarDefault } from './components/Avatar';
35
+ export { default as BarTitle } from './components/BarTitle';
35
36
  export { Button, default as ButtonDefault } from './components/Button';
36
37
  export { default as BottomSheet } from './components/BottomSheet';
37
38
  export { default as BottomSheetItem } from './components/BottomSheet/BottomSheetItem';
@@ -52,6 +53,7 @@ export { default as ListItemSkeleton } from './components/ListItemSkeleton';
52
53
  export { default as ListSkeleton } from './components/ListSkeleton';
53
54
  export { default as ListSubheader } from './components/ListSubheader';
54
55
  export { default as Markdown } from './components/Markdown';
56
+ export { default as MidEllipsis } from './components/MidEllipsis';
55
57
  export { default as PointerAlert } from './components/PointerAlert';
56
58
  export { default as ProgressionBanner } from './components/ProgressionBanner';
57
59
  export { Tabs, default as TabsDefault } from './components/Tabs';
@@ -96,6 +98,7 @@ export type { DownloadActionOptions, DownloadFileOptions } from './components/Ac
96
98
  export type { PrintActionOptions, PrintClient } from './components/ActionsMenu/Actions/print';
97
99
  export type { ExportToTextActionOptions } from './components/ActionsMenu/Actions/exportToText';
98
100
  export type { AvatarProps } from './components/Avatar';
101
+ export type { BarTitleProps } from './components/BarTitle';
99
102
  export type { ButtonProps } from './components/Button';
100
103
  export type { BottomSheetProps, BottomSheetSettings, BottomSheetToolbarProps } from './components/BottomSheet/types';
101
104
  export type { BottomSheetItemProps } from './components/BottomSheet/BottomSheetItem';
@@ -128,6 +131,7 @@ export type { ListItemSkeletonProps } from './components/ListItemSkeleton';
128
131
  export type { ListSkeletonProps } from './components/ListSkeleton';
129
132
  export type { ListSubheaderProps } from './components/ListSubheader';
130
133
  export type { MarkdownProps } from './components/Markdown';
134
+ export type { MidEllipsisProps } from './components/MidEllipsis';
131
135
  export type { TabsProps } from './components/Tabs';
132
136
  export type { SwitchProps } from './components/Switch';
133
137
  export type { SearchBarProps } from './components/SearchBar/types';
package/dist/index.js CHANGED
@@ -35,6 +35,7 @@ export { editAttribute } from './components/ActionsMenu/Actions/editAttribute';
35
35
  export { others } from './components/ActionsMenu/Actions/others';
36
36
  export { exportToText } from './components/ActionsMenu/Actions/exportToText';
37
37
  export { Avatar, default as AvatarDefault } from './components/Avatar';
38
+ export { default as BarTitle } from './components/BarTitle';
38
39
  export { Button, default as ButtonDefault } from './components/Button';
39
40
  export { default as BottomSheet } from './components/BottomSheet';
40
41
  export { default as BottomSheetItem } from './components/BottomSheet/BottomSheetItem';
@@ -55,6 +56,7 @@ export { default as ListItemSkeleton } from './components/ListItemSkeleton';
55
56
  export { default as ListSkeleton } from './components/ListSkeleton';
56
57
  export { default as ListSubheader } from './components/ListSubheader';
57
58
  export { default as Markdown } from './components/Markdown';
59
+ export { default as MidEllipsis } from './components/MidEllipsis';
58
60
  export { default as PointerAlert } from './components/PointerAlert';
59
61
  export { default as ProgressionBanner } from './components/ProgressionBanner';
60
62
  export { Tabs, default as TabsDefault } from './components/Tabs';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@linagora/twake-mui",
3
3
  "type": "module",
4
- "version": "13.0.0",
4
+ "version": "13.2.0",
5
5
  "description": "MUI v9 theme system for Twake applications",
6
6
  "author": "Twake",
7
7
  "license": "MIT",