@linagora/twake-mui 16.1.0 → 16.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 +14 -0
- package/dist/components/FilePathLink/FilePathLink.stories.d.ts +7 -0
- package/dist/components/FilePathLink/FilePathLink.stories.js +41 -0
- package/dist/components/FilePathLink/index.d.ts +7 -0
- package/dist/components/FilePathLink/index.js +6 -0
- package/dist/components/NavigationList/NavigationList.stories.d.ts +7 -0
- package/dist/components/NavigationList/NavigationList.stories.js +83 -0
- package/dist/components/NavigationList/NavigationListHeader.d.ts +6 -0
- package/dist/components/NavigationList/NavigationListHeader.js +9 -0
- package/dist/components/NavigationList/NavigationListSection.d.ts +6 -0
- package/dist/components/NavigationList/NavigationListSection.js +8 -0
- package/dist/components/NavigationList/index.d.ts +12 -0
- package/dist/components/NavigationList/index.js +13 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +4 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
# @linagora/twake-mui [16.3.0](https://github.com/linagora/twake-ui/compare/@linagora/twake-mui@16.2.0...@linagora/twake-mui@16.3.0) (2026-10-22)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* **twake-mui:** Migrate NavigationList from cozy-ui ([2bb292a](https://github.com/linagora/twake-ui/commit/2bb292a1534e53d332194b4e609210479cea9aaa))
|
|
7
|
+
|
|
8
|
+
# @linagora/twake-mui [16.2.0](https://github.com/linagora/twake-ui/compare/@linagora/twake-mui@16.1.0...@linagora/twake-mui@16.2.0) (2026-10-21)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Features
|
|
12
|
+
|
|
13
|
+
* **twake-mui:** Migrate FilePathLink from cozy-ui ([49a90f5](https://github.com/linagora/twake-ui/commit/49a90f54647a0e697be1038d061b24af5449541e))
|
|
14
|
+
|
|
1
15
|
# @linagora/twake-mui [16.1.0](https://github.com/linagora/twake-ui/compare/@linagora/twake-mui@16.0.1...@linagora/twake-mui@16.1.0) (2026-10-21)
|
|
2
16
|
|
|
3
17
|
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import FilePathLink from './index';
|
|
3
|
+
declare const meta: Meta<typeof FilePathLink>;
|
|
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,41 @@
|
|
|
1
|
+
import { Box, Stack } from '@mui/material';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import FilePathLink from './index';
|
|
4
|
+
const path = '/Partages reçus/Cozy 🗄 - Team/Customers & Partners 🛒/Xxxxxx (Xxxxxxxx)/4_Suivi opérationnel/Point de synchro';
|
|
5
|
+
const widths = [150, 250, 400];
|
|
6
|
+
const Section = ({ title, children }) => (React.createElement("section", null,
|
|
7
|
+
React.createElement("h3", null, title),
|
|
8
|
+
children));
|
|
9
|
+
const meta = {
|
|
10
|
+
title: 'FilePathLink',
|
|
11
|
+
component: FilePathLink,
|
|
12
|
+
tags: ['autodocs'],
|
|
13
|
+
argTypes: {
|
|
14
|
+
children: { control: 'text' },
|
|
15
|
+
href: { control: 'text' },
|
|
16
|
+
color: {
|
|
17
|
+
control: 'select',
|
|
18
|
+
options: ['textSecondary', 'textPrimary', 'primary', 'inherit']
|
|
19
|
+
},
|
|
20
|
+
underline: { control: 'select', options: ['hover', 'always', 'none'] },
|
|
21
|
+
className: { control: 'text' }
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
export default meta;
|
|
25
|
+
export const Default = {
|
|
26
|
+
args: {
|
|
27
|
+
children: path,
|
|
28
|
+
href: '/'
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
export const Screenshot = {
|
|
32
|
+
tags: ['argos'],
|
|
33
|
+
render: () => (React.createElement(Stack, { spacing: 4 },
|
|
34
|
+
React.createElement(Section, { title: "Default" },
|
|
35
|
+
React.createElement(FilePathLink, { href: "/" }, path)),
|
|
36
|
+
React.createElement(Section, { title: "Underline always" },
|
|
37
|
+
React.createElement(FilePathLink, { href: "/", underline: "always" }, path)),
|
|
38
|
+
React.createElement(Section, { title: "Container widths" },
|
|
39
|
+
React.createElement(Stack, { spacing: 1 }, widths.map(width => (React.createElement(Box, { key: width, sx: { width } },
|
|
40
|
+
React.createElement(FilePathLink, { href: "/" }, path))))))))
|
|
41
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Link } from '@mui/material';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import FilePath from '../FilePath';
|
|
4
|
+
const FilePathLink = ({ children, ...props }) => (React.createElement(Link, { color: "textSecondary", ...props },
|
|
5
|
+
React.createElement(FilePath, null, children)));
|
|
6
|
+
export default FilePathLink;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import NavigationList from './index';
|
|
3
|
+
declare const meta: Meta<typeof NavigationList>;
|
|
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,83 @@
|
|
|
1
|
+
import { Bank, Gear, Icon, People, Right, Trash } from '@linagora/twake-icons';
|
|
2
|
+
import { Divider, ListItemIcon, ListItemSecondaryAction, Stack, Tab, Typography } from '@mui/material';
|
|
3
|
+
import React, { useState } from 'react';
|
|
4
|
+
import NavigationListHeader from './NavigationListHeader';
|
|
5
|
+
import NavigationListSection from './NavigationListSection';
|
|
6
|
+
import NavigationList from './index';
|
|
7
|
+
import ListItem from '../ListItem';
|
|
8
|
+
import ListItemText from '../ListItemText';
|
|
9
|
+
import Tabs from '../Tabs';
|
|
10
|
+
const rightArrow = (React.createElement(ListItemSecondaryAction, null,
|
|
11
|
+
React.createElement(Icon, { icon: Right, size: 16, className: "u-mr-1" })));
|
|
12
|
+
const sections = (React.createElement(React.Fragment, null,
|
|
13
|
+
React.createElement(NavigationListHeader, null, "General"),
|
|
14
|
+
React.createElement(NavigationListSection, null,
|
|
15
|
+
React.createElement(ListItem, null,
|
|
16
|
+
React.createElement(ListItemIcon, null,
|
|
17
|
+
React.createElement(Icon, { icon: Gear, size: 24 })),
|
|
18
|
+
React.createElement(ListItemText, { primary: "General settings" }),
|
|
19
|
+
rightArrow),
|
|
20
|
+
React.createElement(Divider, { variant: "inset" }),
|
|
21
|
+
React.createElement(ListItem, null,
|
|
22
|
+
React.createElement(ListItemIcon, null,
|
|
23
|
+
React.createElement(Icon, { icon: Gear, size: 32 })),
|
|
24
|
+
React.createElement(ListItemText, { primary: "A large icon does not change size of icon area" }),
|
|
25
|
+
rightArrow),
|
|
26
|
+
React.createElement(Divider, { variant: "inset" }),
|
|
27
|
+
React.createElement(ListItem, null,
|
|
28
|
+
React.createElement(ListItemIcon, null,
|
|
29
|
+
React.createElement(Icon, { icon: People, size: 16 })),
|
|
30
|
+
React.createElement(ListItemText, { primary: "User preferences", secondary: "Notifications and theme" }),
|
|
31
|
+
rightArrow),
|
|
32
|
+
React.createElement(Divider, { variant: "inset" }),
|
|
33
|
+
React.createElement(ListItem, null,
|
|
34
|
+
React.createElement(ListItemIcon, null,
|
|
35
|
+
React.createElement(Icon, { icon: Trash, size: 16, className: "u-error" })),
|
|
36
|
+
React.createElement(ListItemText, { primary: "Delete account", secondary: "Permanently delete all your data", slotProps: {
|
|
37
|
+
primary: { color: 'error' },
|
|
38
|
+
secondary: { color: 'error' }
|
|
39
|
+
} }))),
|
|
40
|
+
React.createElement(NavigationListHeader, null, "Accounts"),
|
|
41
|
+
React.createElement(NavigationListSection, null,
|
|
42
|
+
React.createElement(ListItem, null,
|
|
43
|
+
React.createElement(ListItemIcon, null,
|
|
44
|
+
React.createElement(Icon, { icon: Bank, size: 16 })),
|
|
45
|
+
React.createElement(ListItemText, { primary: "Bank accounts" }),
|
|
46
|
+
rightArrow))));
|
|
47
|
+
const TabsExample = () => {
|
|
48
|
+
const [tab, setTab] = useState('nav');
|
|
49
|
+
const handleChange = (_, value) => setTab(value);
|
|
50
|
+
return (React.createElement("div", null,
|
|
51
|
+
React.createElement(Tabs, { value: tab, onChange: handleChange },
|
|
52
|
+
React.createElement(Tab, { value: "nav", label: "Nav" }),
|
|
53
|
+
React.createElement(Tab, { value: "details", label: "Details" })),
|
|
54
|
+
React.createElement(Divider, { className: "u-mb-1" }),
|
|
55
|
+
tab === 'nav' ? React.createElement(NavigationList, null, sections) : null,
|
|
56
|
+
tab === 'details' ? (React.createElement(Typography, { variant: "body1" }, "Ada Lovelace wrote the first algorithm meant to be carried out by a machine.")) : null));
|
|
57
|
+
};
|
|
58
|
+
const meta = {
|
|
59
|
+
title: 'NavigationList',
|
|
60
|
+
component: NavigationList,
|
|
61
|
+
subcomponents: { NavigationListHeader, NavigationListSection },
|
|
62
|
+
tags: ['autodocs'],
|
|
63
|
+
argTypes: {
|
|
64
|
+
children: { control: false },
|
|
65
|
+
className: { control: 'text' },
|
|
66
|
+
style: { control: 'object' }
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
export default meta;
|
|
70
|
+
export const Default = {
|
|
71
|
+
args: {
|
|
72
|
+
children: sections
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
// Visual Regression - Combined view for Argos testing
|
|
76
|
+
export const Screenshot = {
|
|
77
|
+
tags: ['argos'],
|
|
78
|
+
render: () => (React.createElement(Stack, { spacing: 4 },
|
|
79
|
+
React.createElement("section", null,
|
|
80
|
+
React.createElement(NavigationList, null, sections)),
|
|
81
|
+
React.createElement("section", null,
|
|
82
|
+
React.createElement(TabsExample, null))))
|
|
83
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Typography } from '@mui/material';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { useBreakpoints } from '../../hooks/useBreakpoints';
|
|
4
|
+
import ListSubheader from '../ListSubheader';
|
|
5
|
+
const NavigationListHeader = ({ children }) => {
|
|
6
|
+
const { isMobile } = useBreakpoints();
|
|
7
|
+
return isMobile ? (React.createElement(ListSubheader, null, children)) : (React.createElement(Typography, { variant: "subtitle1", color: "text.secondary", className: "u-mb-1" }, children));
|
|
8
|
+
};
|
|
9
|
+
export default NavigationListHeader;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Box } from '@mui/material';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { useBreakpoints } from '../../hooks/useBreakpoints';
|
|
4
|
+
const NavigationListSection = ({ children }) => {
|
|
5
|
+
const { isMobile } = useBreakpoints();
|
|
6
|
+
return isMobile ? (React.createElement(React.Fragment, null, children)) : (React.createElement(Box, { className: "u-ov-hidden u-mb-1-half u-bdrs-4", sx: { border: 1, borderColor: 'divider' } }, children));
|
|
7
|
+
};
|
|
8
|
+
export default NavigationListSection;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React, { CSSProperties, ReactNode } from 'react';
|
|
2
|
+
export interface NavigationListProps {
|
|
3
|
+
children?: ReactNode;
|
|
4
|
+
className?: string;
|
|
5
|
+
style?: CSSProperties;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Navigation choices grouped in sections: a plain list with subheaders on
|
|
9
|
+
* mobile, one bordered card per section on desktop.
|
|
10
|
+
*/
|
|
11
|
+
declare const NavigationList: ({ children, className, style }: NavigationListProps) => React.ReactElement;
|
|
12
|
+
export default NavigationList;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { List } from '@mui/material';
|
|
2
|
+
import cx from 'classnames';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { useBreakpoints } from '../../hooks/useBreakpoints';
|
|
5
|
+
/**
|
|
6
|
+
* Navigation choices grouped in sections: a plain list with subheaders on
|
|
7
|
+
* mobile, one bordered card per section on desktop.
|
|
8
|
+
*/
|
|
9
|
+
const NavigationList = ({ children, className, style }) => {
|
|
10
|
+
const { isMobile } = useBreakpoints();
|
|
11
|
+
return isMobile ? (React.createElement(List, { className: className, style: style }, children)) : (React.createElement("div", { className: cx('u-stack-s u-nolist', className), style: style }, children));
|
|
12
|
+
};
|
|
13
|
+
export default NavigationList;
|
package/dist/index.d.ts
CHANGED
|
@@ -60,6 +60,7 @@ export { Empty, EmptySubTitle } from './components/Empty';
|
|
|
60
60
|
export { ExtendableFab } from './components/ExtendableFab';
|
|
61
61
|
export { default as Filename } from './components/Filename';
|
|
62
62
|
export { default as FilePath } from './components/FilePath';
|
|
63
|
+
export { default as FilePathLink } from './components/FilePathLink';
|
|
63
64
|
export { default as ListItem } from './components/ListItem';
|
|
64
65
|
export { default as ListItemButton } from './components/ListItemButton';
|
|
65
66
|
export { default as ListItemText } from './components/ListItemText';
|
|
@@ -69,6 +70,9 @@ export { default as ListSubheader } from './components/ListSubheader';
|
|
|
69
70
|
export { default as LoadMore } from './components/LoadMore';
|
|
70
71
|
export { default as Markdown } from './components/Markdown';
|
|
71
72
|
export { default as MidEllipsis } from './components/MidEllipsis';
|
|
73
|
+
export { default as NavigationList } from './components/NavigationList';
|
|
74
|
+
export { default as NavigationListHeader } from './components/NavigationList/NavigationListHeader';
|
|
75
|
+
export { default as NavigationListSection } from './components/NavigationList/NavigationListSection';
|
|
72
76
|
export { default as PointerAlert } from './components/PointerAlert';
|
|
73
77
|
export type { AlertProviderProps } from './providers/AlertProvider';
|
|
74
78
|
export type { AlertContextValue, ShowAlert, ShowAlertOptions } from './providers/AlertProvider/useAlert';
|
|
@@ -159,6 +163,7 @@ export type { DropdownTextProps, DropdownTextVariant } from './components/Dropdo
|
|
|
159
163
|
export type { ExtendableFabProps, ScrollOptions } from './components/ExtendableFab';
|
|
160
164
|
export type { FilenameProps } from './components/Filename';
|
|
161
165
|
export type { FilePathProps } from './components/FilePath';
|
|
166
|
+
export type { FilePathLinkProps } from './components/FilePathLink';
|
|
162
167
|
export type { ListItemProps, ListItemGutters, ListItemSize } from './components/ListItem';
|
|
163
168
|
export type { ListItemButtonProps } from './components/ListItemButton';
|
|
164
169
|
export type { ListItemTextProps } from './components/ListItemText';
|
|
@@ -168,6 +173,9 @@ export type { ListSubheaderProps } from './components/ListSubheader';
|
|
|
168
173
|
export type { LoadMoreProps } from './components/LoadMore';
|
|
169
174
|
export type { MarkdownProps } from './components/Markdown';
|
|
170
175
|
export type { MidEllipsisProps } from './components/MidEllipsis';
|
|
176
|
+
export type { NavigationListProps } from './components/NavigationList';
|
|
177
|
+
export type { NavigationListHeaderProps } from './components/NavigationList/NavigationListHeader';
|
|
178
|
+
export type { NavigationListSectionProps } from './components/NavigationList/NavigationListSection';
|
|
171
179
|
export type { TabsProps } from './components/Tabs';
|
|
172
180
|
export type { SwitchProps } from './components/Switch';
|
|
173
181
|
export type { SearchBarProps } from './components/SearchBar/types';
|
package/dist/index.js
CHANGED
|
@@ -63,6 +63,7 @@ export { Empty, EmptySubTitle } from './components/Empty';
|
|
|
63
63
|
export { ExtendableFab } from './components/ExtendableFab';
|
|
64
64
|
export { default as Filename } from './components/Filename';
|
|
65
65
|
export { default as FilePath } from './components/FilePath';
|
|
66
|
+
export { default as FilePathLink } from './components/FilePathLink';
|
|
66
67
|
export { default as ListItem } from './components/ListItem';
|
|
67
68
|
export { default as ListItemButton } from './components/ListItemButton';
|
|
68
69
|
export { default as ListItemText } from './components/ListItemText';
|
|
@@ -72,6 +73,9 @@ export { default as ListSubheader } from './components/ListSubheader';
|
|
|
72
73
|
export { default as LoadMore } from './components/LoadMore';
|
|
73
74
|
export { default as Markdown } from './components/Markdown';
|
|
74
75
|
export { default as MidEllipsis } from './components/MidEllipsis';
|
|
76
|
+
export { default as NavigationList } from './components/NavigationList';
|
|
77
|
+
export { default as NavigationListHeader } from './components/NavigationList/NavigationListHeader';
|
|
78
|
+
export { default as NavigationListSection } from './components/NavigationList/NavigationListSection';
|
|
75
79
|
export { default as PointerAlert } from './components/PointerAlert';
|
|
76
80
|
export { default as AlertProvider } from './providers/AlertProvider';
|
|
77
81
|
export { useAlert } from './providers/AlertProvider/useAlert';
|