@linagora/twake-mui 9.14.0 → 9.16.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 +32 -0
- package/dist/components/PointerAlert/PointerAlert.stories.d.ts +7 -0
- package/dist/components/PointerAlert/PointerAlert.stories.js +88 -0
- package/dist/components/PointerAlert/index.d.ts +9 -0
- package/dist/components/PointerAlert/index.js +68 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1 -0
- package/dist/lib/overrides.d.ts +1 -0
- package/dist/lib/overrides.js +36 -34
- package/dist/stories/Accordion.stories.d.ts +1 -1
- package/dist/stories/Accordion.stories.js +33 -17
- package/dist/stories/IconButton.stories.js +1 -1
- package/dist/stories/TextField.stories.js +1 -1
- package/package.json +7 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,35 @@
|
|
|
1
|
+
# @linagora/twake-mui [9.16.0](https://github.com/linagora/twake-ui/compare/@linagora/twake-mui@9.15.0...@linagora/twake-mui@9.16.0) (2026-10-01)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **twake-mui:** Clean old Accordion override ([def3b03](https://github.com/linagora/twake-ui/commit/def3b03479b193a3246e716ae4adc89c4d85cbd2))
|
|
7
|
+
* **twake-mui:** Use theme shadow for Accordion ([97cb9b7](https://github.com/linagora/twake-ui/commit/97cb9b7ce81a61963cf9b3e5aaac615b3da4ae63))
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### Features
|
|
11
|
+
|
|
12
|
+
* **twake-mui:** Migrate Accordion from cozy-ui ([4033f8d](https://github.com/linagora/twake-ui/commit/4033f8dc03f550eed64263a77f9953e63f2572ec))
|
|
13
|
+
|
|
14
|
+
# @linagora/twake-mui [9.15.0](https://github.com/linagora/twake-ui/compare/@linagora/twake-mui@9.14.1...@linagora/twake-mui@9.15.0) (2026-09-30)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Bug Fixes
|
|
18
|
+
|
|
19
|
+
* **twake-mui:** Default Alert severity to primary ([9cdb94e](https://github.com/linagora/twake-ui/commit/9cdb94e7e636d54f2d93fdabb21c03ece9bfbff4))
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
### Features
|
|
23
|
+
|
|
24
|
+
* **twake-mui:** Migrate PointerAlert from cozy-ui ([82aa564](https://github.com/linagora/twake-ui/commit/82aa5646f8da35d1a9986e045a0ed5ec8a5da003))
|
|
25
|
+
|
|
26
|
+
## @linagora/twake-mui [9.14.1](https://github.com/linagora/twake-ui/compare/@linagora/twake-mui@9.14.0...@linagora/twake-mui@9.14.1) (2026-09-30)
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
### Bug Fixes
|
|
30
|
+
|
|
31
|
+
* **twake-mui:** Accept any twake-icons from 2.10.0 as peer ([e934d0e](https://github.com/linagora/twake-ui/commit/e934d0e9335c0a63c0caf2dde202aa46ddc33238))
|
|
32
|
+
|
|
1
33
|
# @linagora/twake-mui [9.14.0](https://github.com/linagora/twake-ui/compare/@linagora/twake-mui@9.13.0...@linagora/twake-mui@9.14.0) (2026-09-29)
|
|
2
34
|
|
|
3
35
|
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import PointerAlert from './index';
|
|
3
|
+
declare const meta: Meta<typeof PointerAlert>;
|
|
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,88 @@
|
|
|
1
|
+
/* eslint-disable no-console */
|
|
2
|
+
import { DeviceLaptop, Download, Icon } from '@linagora/twake-icons';
|
|
3
|
+
import { AlertTitle, Button, Stack, Typography } from '@mui/material';
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import PointerAlert from './index';
|
|
6
|
+
const directions = ['top', 'bottom', 'left', 'right'];
|
|
7
|
+
const severities = [
|
|
8
|
+
'primary',
|
|
9
|
+
'secondary',
|
|
10
|
+
'success',
|
|
11
|
+
'error',
|
|
12
|
+
'warning',
|
|
13
|
+
'info'
|
|
14
|
+
];
|
|
15
|
+
const variants = ['standard', 'filled', 'outlined'];
|
|
16
|
+
const makeActionColor = (variant, severity) => {
|
|
17
|
+
if (variant === 'filled')
|
|
18
|
+
return 'inherit';
|
|
19
|
+
return severity === 'primary' || severity === 'secondary'
|
|
20
|
+
? undefined
|
|
21
|
+
: severity;
|
|
22
|
+
};
|
|
23
|
+
const text = 'Get Cozy Drive for Desktop and synchronise your files safely to make them accessible at all times.';
|
|
24
|
+
const downloadAction = (React.createElement(Button, { variant: "text", size: "small", startIcon: React.createElement(Icon, { icon: Download }) }, "Download"));
|
|
25
|
+
const meta = {
|
|
26
|
+
title: 'PointerAlert',
|
|
27
|
+
component: PointerAlert,
|
|
28
|
+
parameters: { layout: 'centered' },
|
|
29
|
+
tags: ['autodocs'],
|
|
30
|
+
argTypes: {
|
|
31
|
+
direction: { control: 'select', options: directions },
|
|
32
|
+
position: {
|
|
33
|
+
control: 'text',
|
|
34
|
+
description: 'Any CSS length or percentage, e.g. `30%` or `100px`'
|
|
35
|
+
},
|
|
36
|
+
severity: { control: 'select', options: severities },
|
|
37
|
+
variant: { control: 'select', options: variants },
|
|
38
|
+
color: {
|
|
39
|
+
control: 'select',
|
|
40
|
+
options: severities,
|
|
41
|
+
description: 'Overrides the colour taken from `severity`'
|
|
42
|
+
},
|
|
43
|
+
square: { control: 'boolean' }
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
export default meta;
|
|
47
|
+
export const Default = {
|
|
48
|
+
args: {
|
|
49
|
+
direction: 'bottom',
|
|
50
|
+
position: '50%',
|
|
51
|
+
severity: 'primary',
|
|
52
|
+
variant: 'standard'
|
|
53
|
+
},
|
|
54
|
+
render: args => (React.createElement(PointerAlert, { ...args, sx: { width: 480 }, action: downloadAction }, text))
|
|
55
|
+
};
|
|
56
|
+
const Section = ({ title, children }) => (React.createElement("section", null,
|
|
57
|
+
React.createElement(Typography, { variant: "h4", gutterBottom: true }, title),
|
|
58
|
+
React.createElement(Stack, { spacing: 1, useFlexGap: true }, children)));
|
|
59
|
+
export const Screenshot = {
|
|
60
|
+
tags: ['argos'],
|
|
61
|
+
render: () => (React.createElement(Stack, { spacing: 3, sx: { width: 640 } },
|
|
62
|
+
React.createElement(Section, { title: "Directions" }, directions.map(direction => (React.createElement(PointerAlert, { key: direction, direction: direction, severity: "primary", action: downloadAction },
|
|
63
|
+
direction,
|
|
64
|
+
": ",
|
|
65
|
+
text)))),
|
|
66
|
+
React.createElement(Section, { title: "Positions" }, ['calc(0% + 0.75rem)', '30%', '100px', 'calc(100% - 0.75rem)'].map(position => (React.createElement(PointerAlert, { key: position, position: position, severity: "info" }, position)))),
|
|
67
|
+
variants.map(variant => (React.createElement(Section, { key: variant, title: `${variant} variant` }, severities.map(severity => (React.createElement(PointerAlert, { key: severity, variant: variant, severity: severity, action: React.createElement(Button, { variant: "text", size: "small", color: makeActionColor(variant, severity) }, "ACTION") },
|
|
68
|
+
React.createElement(AlertTitle, null, severity),
|
|
69
|
+
"This is a ",
|
|
70
|
+
severity,
|
|
71
|
+
" alert")))))),
|
|
72
|
+
React.createElement(Section, { title: "Content" },
|
|
73
|
+
React.createElement(PointerAlert, { severity: "primary" },
|
|
74
|
+
React.createElement(AlertTitle, null, "This is the title"),
|
|
75
|
+
text),
|
|
76
|
+
React.createElement(PointerAlert, { severity: "primary", color: "warning" },
|
|
77
|
+
"Colour overridden: ",
|
|
78
|
+
text),
|
|
79
|
+
React.createElement(PointerAlert, { severity: "primary", icon: React.createElement(Icon, { icon: DeviceLaptop, color: "var(--twake-palette-error-main)", size: 32 }) }, text),
|
|
80
|
+
React.createElement(PointerAlert, { severity: "primary", icon: false }, text),
|
|
81
|
+
React.createElement(PointerAlert, { severity: "primary", square: true },
|
|
82
|
+
"Square: ",
|
|
83
|
+
text),
|
|
84
|
+
React.createElement(PointerAlert, { severity: "primary", onClose: () => console.log('closed') }, text),
|
|
85
|
+
React.createElement(PointerAlert, { severity: "primary", action: React.createElement(React.Fragment, null,
|
|
86
|
+
downloadAction,
|
|
87
|
+
React.createElement(Button, { variant: "text", size: "small" }, "No, thanks!")) }, text))))
|
|
88
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { AlertProps } from '@mui/material';
|
|
2
|
+
export type PointerAlertDirection = 'top' | 'right' | 'bottom' | 'left';
|
|
3
|
+
export interface PointerAlertProps extends AlertProps {
|
|
4
|
+
direction?: PointerAlertDirection;
|
|
5
|
+
/** Arrow offset along its edge, any CSS length or percentage. `calc(0% + 0.75rem)` puts it against the starting corner. */
|
|
6
|
+
position?: string;
|
|
7
|
+
}
|
|
8
|
+
declare const PointerAlert: import("@emotion/styled").StyledComponent<AlertProps & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & PointerAlertProps, {}, {}>;
|
|
9
|
+
export default PointerAlert;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { Alert, alertClasses, styled } from '@mui/material';
|
|
2
|
+
import { capitalize } from '@mui/material/utils';
|
|
3
|
+
import { alertSeverities } from '../../lib/overrides';
|
|
4
|
+
const ARROW_SIZE = '0.75rem';
|
|
5
|
+
const ARROW_BASE = `calc(2 * ${ARROW_SIZE})`;
|
|
6
|
+
// The alert paints on whole pixels but a clip path cuts on fractional ones. Overshooting
|
|
7
|
+
// on the alert side leaves that edge to the arrow's box, snapped like the alert; the
|
|
8
|
+
// slopes are unchanged.
|
|
9
|
+
const BLEED = '1px';
|
|
10
|
+
const makeShape = (direction, position) => {
|
|
11
|
+
const horizontal = { left: position, marginLeft: `-${ARROW_SIZE}` };
|
|
12
|
+
const vertical = { top: position, marginTop: `-${ARROW_SIZE}` };
|
|
13
|
+
const shapes = {
|
|
14
|
+
top: {
|
|
15
|
+
...horizontal,
|
|
16
|
+
bottom: '100%',
|
|
17
|
+
width: ARROW_BASE,
|
|
18
|
+
height: ARROW_SIZE,
|
|
19
|
+
clipPath: `polygon(50% 0, calc(100% + ${BLEED}) calc(100% + ${BLEED}), -${BLEED} calc(100% + ${BLEED}))`
|
|
20
|
+
},
|
|
21
|
+
bottom: {
|
|
22
|
+
...horizontal,
|
|
23
|
+
top: '100%',
|
|
24
|
+
width: ARROW_BASE,
|
|
25
|
+
height: ARROW_SIZE,
|
|
26
|
+
clipPath: `polygon(-${BLEED} -${BLEED}, calc(100% + ${BLEED}) -${BLEED}, 50% 100%)`
|
|
27
|
+
},
|
|
28
|
+
left: {
|
|
29
|
+
...vertical,
|
|
30
|
+
right: '100%',
|
|
31
|
+
width: ARROW_SIZE,
|
|
32
|
+
height: ARROW_BASE,
|
|
33
|
+
clipPath: `polygon(calc(100% + ${BLEED}) -${BLEED}, calc(100% + ${BLEED}) calc(100% + ${BLEED}), 0 50%)`
|
|
34
|
+
},
|
|
35
|
+
right: {
|
|
36
|
+
...vertical,
|
|
37
|
+
left: '100%',
|
|
38
|
+
width: ARROW_SIZE,
|
|
39
|
+
height: ARROW_BASE,
|
|
40
|
+
clipPath: `polygon(-${BLEED} -${BLEED}, 100% 50%, -${BLEED} calc(100% + ${BLEED}))`
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
return {
|
|
44
|
+
root: { [`margin-${direction}`]: ARROW_SIZE },
|
|
45
|
+
arrow: shapes[direction]
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
const PointerAlert = styled(Alert, {
|
|
49
|
+
shouldForwardProp: prop => prop !== 'direction' && prop !== 'position'
|
|
50
|
+
})(({ theme, direction = 'bottom', position = '50%' }) => {
|
|
51
|
+
const { root, arrow } = makeShape(direction, position);
|
|
52
|
+
return {
|
|
53
|
+
...root,
|
|
54
|
+
position: 'relative',
|
|
55
|
+
'&::after': {
|
|
56
|
+
...arrow,
|
|
57
|
+
content: '""',
|
|
58
|
+
position: 'absolute',
|
|
59
|
+
backgroundColor: 'inherit'
|
|
60
|
+
},
|
|
61
|
+
// outlined alerts have no background for the arrow to inherit
|
|
62
|
+
...Object.fromEntries(alertSeverities.map(severity => [
|
|
63
|
+
`&.${alertClasses.outlined}.MuiAlert-color${capitalize(severity)}::after`,
|
|
64
|
+
{ backgroundColor: theme.vars.palette[severity].main }
|
|
65
|
+
]))
|
|
66
|
+
};
|
|
67
|
+
});
|
|
68
|
+
export default PointerAlert;
|
package/dist/index.d.ts
CHANGED
|
@@ -21,6 +21,7 @@ export { default as ListItemText } from './components/ListItemText';
|
|
|
21
21
|
export { default as ListItemSkeleton } from './components/ListItemSkeleton';
|
|
22
22
|
export { default as ListSkeleton } from './components/ListSkeleton';
|
|
23
23
|
export { default as ListSubheader } from './components/ListSubheader';
|
|
24
|
+
export { default as PointerAlert } from './components/PointerAlert';
|
|
24
25
|
export { Tabs, default as TabsDefault } from './components/Tabs';
|
|
25
26
|
export { Switch, default as SwitchDefault } from './components/Switch';
|
|
26
27
|
export { SearchBar, default as SearchBarDefault } from './components/SearchBar';
|
|
@@ -51,6 +52,7 @@ export type { ContactPopoverCalendarActionProps } from './components/ContactPopo
|
|
|
51
52
|
export type { ContactPopoverEmailActionProps } from './components/ContactPopover/ContactPopoverEmailAction';
|
|
52
53
|
export type { ChipProps } from './components/Chip';
|
|
53
54
|
export type { DialogProps, DialogSize } from './components/Dialog';
|
|
55
|
+
export type { PointerAlertProps, PointerAlertDirection } from './components/PointerAlert';
|
|
54
56
|
export type { EmptyProps, EmptyIconSize, EmptyComponentsProps } from './components/Empty';
|
|
55
57
|
export type { DropdownButtonProps } from './components/DropdownButton';
|
|
56
58
|
export type { DropdownTextProps, DropdownTextVariant } from './components/DropdownText';
|
package/dist/index.js
CHANGED
|
@@ -24,6 +24,7 @@ export { default as ListItemText } from './components/ListItemText';
|
|
|
24
24
|
export { default as ListItemSkeleton } from './components/ListItemSkeleton';
|
|
25
25
|
export { default as ListSkeleton } from './components/ListSkeleton';
|
|
26
26
|
export { default as ListSubheader } from './components/ListSubheader';
|
|
27
|
+
export { default as PointerAlert } from './components/PointerAlert';
|
|
27
28
|
export { Tabs, default as TabsDefault } from './components/Tabs';
|
|
28
29
|
export { Switch, default as SwitchDefault } from './components/Switch';
|
|
29
30
|
export { SearchBar, default as SearchBarDefault } from './components/SearchBar';
|
package/dist/lib/overrides.d.ts
CHANGED
package/dist/lib/overrides.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Bottom, CheckCircle, CheckSquare, Icon, Info, RadioChecked, RadioUnchecked, Spinner, Warning, WarningCircle } from '@linagora/twake-icons';
|
|
2
|
+
import { accordionSummaryClasses } from '@mui/material/AccordionSummary';
|
|
2
3
|
import { alertClasses } from '@mui/material/Alert';
|
|
3
4
|
import { buttonClasses } from '@mui/material/Button';
|
|
4
5
|
import { checkboxClasses } from '@mui/material/Checkbox';
|
|
@@ -18,7 +19,7 @@ import { alpha, darken } from '@mui/material/styles';
|
|
|
18
19
|
import React from 'react';
|
|
19
20
|
import { radius } from './radius';
|
|
20
21
|
import AccordionExpandIcon from '../components/AccordionExpandIcon';
|
|
21
|
-
const alertSeverities = [
|
|
22
|
+
export const alertSeverities = [
|
|
22
23
|
'primary',
|
|
23
24
|
'secondary',
|
|
24
25
|
'success',
|
|
@@ -881,9 +882,10 @@ export const overrides = {
|
|
|
881
882
|
}
|
|
882
883
|
},
|
|
883
884
|
MuiAlert: {
|
|
884
|
-
// cozy-ui's 16px icons; the icon padding below centres them on the first
|
|
885
|
-
// line of the message.
|
|
886
885
|
defaultProps: {
|
|
886
|
+
severity: 'primary',
|
|
887
|
+
// 16px icons; the icon padding below centres them on the first line of
|
|
888
|
+
// the message.
|
|
887
889
|
iconMapping: {
|
|
888
890
|
primary: React.createElement(Icon, { icon: Info }),
|
|
889
891
|
secondary: React.createElement(Icon, { icon: Info }),
|
|
@@ -923,53 +925,53 @@ export const overrides = {
|
|
|
923
925
|
},
|
|
924
926
|
MuiAccordion: {
|
|
925
927
|
styleOverrides: {
|
|
926
|
-
root: {
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
928
|
+
root: ({ theme }) => ({
|
|
929
|
+
boxShadow: theme.vars.shadows[1],
|
|
930
|
+
border: `1px solid ${theme.vars.palette.border.main}`,
|
|
931
|
+
overflow: 'hidden',
|
|
932
|
+
marginBottom: 16,
|
|
933
|
+
'&::before': { display: 'none' }
|
|
934
|
+
}),
|
|
935
|
+
rounded: ({ theme }) => ({ borderRadius: theme.shape.borderRadius })
|
|
931
936
|
}
|
|
932
937
|
},
|
|
933
938
|
MuiAccordionSummary: {
|
|
934
939
|
defaultProps: { expandIcon: React.createElement(AccordionExpandIcon, null) },
|
|
935
940
|
styleOverrides: {
|
|
936
941
|
root: ({ theme }) => ({
|
|
937
|
-
backgroundColor: theme.palette.
|
|
942
|
+
backgroundColor: theme.vars.palette.background.default,
|
|
938
943
|
textTransform: 'uppercase',
|
|
939
944
|
fontWeight: 'bold',
|
|
940
|
-
fontSize:
|
|
941
|
-
minHeight:
|
|
945
|
+
fontSize: theme.typography.pxToRem(14),
|
|
946
|
+
minHeight: 56,
|
|
942
947
|
padding: 0,
|
|
943
|
-
|
|
944
|
-
'&.Mui-expanded': {
|
|
945
|
-
minHeight: '3.5rem'
|
|
946
|
-
}
|
|
948
|
+
[`&.${accordionSummaryClasses.expanded}`]: { minHeight: 56 }
|
|
947
949
|
}),
|
|
948
|
-
expandIconWrapper: {
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
950
|
+
expandIconWrapper: ({ theme }) => ({
|
|
951
|
+
color: theme.vars.palette.text.secondary,
|
|
952
|
+
padding: 12,
|
|
953
|
+
marginLeft: 5,
|
|
954
|
+
marginRight: -12,
|
|
953
955
|
transform: 'rotate(-90deg)',
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
transform: 'rotate(0deg)'
|
|
957
|
-
}
|
|
958
|
-
},
|
|
956
|
+
[`&.${accordionSummaryClasses.expanded}`]: { transform: 'rotate(0deg)' }
|
|
957
|
+
}),
|
|
959
958
|
content: {
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
paddingRight: '0.25rem',
|
|
959
|
+
paddingLeft: 8,
|
|
960
|
+
paddingRight: 4,
|
|
963
961
|
order: 1,
|
|
964
|
-
'& > :last-child': {
|
|
965
|
-
|
|
966
|
-
},
|
|
967
|
-
'&.Mui-expanded': {
|
|
968
|
-
margin: '0.75rem 0'
|
|
969
|
-
}
|
|
962
|
+
'& > :last-child': { paddingRight: 0 },
|
|
963
|
+
[`&.${accordionSummaryClasses.expanded}`]: { margin: '12px 0' }
|
|
970
964
|
}
|
|
971
965
|
}
|
|
972
966
|
},
|
|
967
|
+
MuiAccordionDetails: {
|
|
968
|
+
styleOverrides: {
|
|
969
|
+
root: ({ theme }) => ({
|
|
970
|
+
padding: 0,
|
|
971
|
+
borderTop: `1px solid ${theme.vars.palette.border.main}`
|
|
972
|
+
})
|
|
973
|
+
}
|
|
974
|
+
},
|
|
973
975
|
MuiFab: {
|
|
974
976
|
defaultProps: { size: 'medium' },
|
|
975
977
|
styleOverrides: {
|
|
@@ -3,5 +3,5 @@ import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
|
3
3
|
declare const meta: Meta<typeof Accordion>;
|
|
4
4
|
export default meta;
|
|
5
5
|
type Story = StoryObj<typeof Accordion>;
|
|
6
|
-
export declare const
|
|
6
|
+
export declare const Default: Story;
|
|
7
7
|
export declare const Screenshot: Story;
|
|
@@ -4,26 +4,42 @@ const meta = {
|
|
|
4
4
|
title: 'Accordion',
|
|
5
5
|
component: Accordion,
|
|
6
6
|
parameters: { layout: 'centered' },
|
|
7
|
-
tags: ['autodocs']
|
|
7
|
+
tags: ['autodocs'],
|
|
8
|
+
argTypes: {
|
|
9
|
+
defaultExpanded: { control: 'boolean' },
|
|
10
|
+
disabled: { control: 'boolean' },
|
|
11
|
+
disableGutters: { control: 'boolean' },
|
|
12
|
+
square: { control: 'boolean' }
|
|
13
|
+
}
|
|
8
14
|
};
|
|
9
15
|
export default meta;
|
|
10
|
-
const
|
|
11
|
-
React.createElement(
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
React.createElement(
|
|
16
|
-
React.createElement(
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
React.createElement(
|
|
21
|
-
React.createElement(
|
|
22
|
-
React.createElement(Typography, null, "Lorem ipsum dolor sit amet consectetur")))));
|
|
23
|
-
export const Docs = {
|
|
24
|
-
render: () => React.createElement(AccordionGroup, null)
|
|
16
|
+
const Item = ({ label, ...props }) => (React.createElement(Accordion, { ...props },
|
|
17
|
+
React.createElement(AccordionSummary, null,
|
|
18
|
+
"Click to expand/collapse the ",
|
|
19
|
+
label,
|
|
20
|
+
" item"),
|
|
21
|
+
React.createElement(AccordionDetails, null,
|
|
22
|
+
React.createElement(Typography, { sx: { m: 2 } }, "Lorem ipsum dolor sit amet consectetur"))));
|
|
23
|
+
export const Default = {
|
|
24
|
+
render: args => (React.createElement("div", { style: { width: 400, maxWidth: '100%' } },
|
|
25
|
+
React.createElement(Item, { ...args, label: "first" }),
|
|
26
|
+
React.createElement(Item, { ...args, label: "second" }),
|
|
27
|
+
React.createElement(Item, { ...args, label: "third" })))
|
|
25
28
|
};
|
|
29
|
+
const Section = ({ title, children }) => (React.createElement("section", null,
|
|
30
|
+
React.createElement("h3", { style: { marginBottom: '12px' } }, title),
|
|
31
|
+
children));
|
|
32
|
+
// Visual Regression - Combined view for Argos testing
|
|
26
33
|
export const Screenshot = {
|
|
27
34
|
tags: ['argos'],
|
|
28
|
-
render: () => React.createElement(
|
|
35
|
+
render: () => (React.createElement(Stack, { spacing: 4, sx: { width: 400, maxWidth: '100%' } },
|
|
36
|
+
React.createElement(Section, { title: "Default" },
|
|
37
|
+
React.createElement(Item, { label: "first" }),
|
|
38
|
+
React.createElement(Item, { label: "second" }),
|
|
39
|
+
React.createElement(Item, { label: "third" })),
|
|
40
|
+
React.createElement(Section, { title: "Expanded" },
|
|
41
|
+
React.createElement(Item, { label: "first", defaultExpanded: true }),
|
|
42
|
+
React.createElement(Item, { label: "second" })),
|
|
43
|
+
React.createElement(Section, { title: "Disabled" },
|
|
44
|
+
React.createElement(Item, { label: "first", disabled: true }))))
|
|
29
45
|
};
|
|
@@ -39,7 +39,7 @@ export const Screenshot = {
|
|
|
39
39
|
render: () => (React.createElement(Stack, { spacing: 4, sx: { p: 4 } },
|
|
40
40
|
sizes.map(size => (React.createElement("section", { key: size },
|
|
41
41
|
React.createElement("h3", null, size),
|
|
42
|
-
React.createElement(Stack, { direction: "row", spacing: 4 },
|
|
42
|
+
React.createElement(Stack, { direction: "row", spacing: 4, useFlexGap: true, sx: { flexWrap: 'wrap' } },
|
|
43
43
|
React.createElement(Stack, { spacing: 1 },
|
|
44
44
|
React.createElement(Typography, { variant: "caption" }, "default"),
|
|
45
45
|
React.createElement(Row, { size: size })),
|
|
@@ -39,7 +39,7 @@ const adornments = {
|
|
|
39
39
|
};
|
|
40
40
|
const items = options.map(option => (React.createElement(MenuItem, { key: option.value, value: option.value }, option.label)));
|
|
41
41
|
// One enabled and one disabled field
|
|
42
|
-
const Pair = props => (React.createElement(Stack, { direction: "row", spacing: 2 },
|
|
42
|
+
const Pair = props => (React.createElement(Stack, { direction: "row", spacing: 2, useFlexGap: true, sx: { flexWrap: 'wrap' } },
|
|
43
43
|
React.createElement(TextField, { ...props }),
|
|
44
44
|
React.createElement(TextField, { disabled: true, ...props })));
|
|
45
45
|
// Every example of the cozy-ui TextField doc, for one set of variant props
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@linagora/twake-mui",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "9.
|
|
4
|
+
"version": "9.16.0",
|
|
5
5
|
"description": "MUI v9 theme system for Twake applications",
|
|
6
6
|
"author": "Twake",
|
|
7
7
|
"license": "MIT",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"peerDependencies": {
|
|
51
51
|
"@emotion/react": "^11.5.0",
|
|
52
52
|
"@emotion/styled": "^11.3.0",
|
|
53
|
-
"@linagora/twake-icons": "
|
|
53
|
+
"@linagora/twake-icons": ">=2.10.0",
|
|
54
54
|
"@mui/lab": "^9.0.0-beta.6",
|
|
55
55
|
"@mui/material": "^9.2.0",
|
|
56
56
|
"react": "^18",
|
|
@@ -65,8 +65,8 @@
|
|
|
65
65
|
"rooks": "7.14.1"
|
|
66
66
|
},
|
|
67
67
|
"devDependencies": {
|
|
68
|
-
"@argos-ci/cli": "
|
|
69
|
-
"@argos-ci/storybook": "
|
|
68
|
+
"@argos-ci/cli": "6.9.5",
|
|
69
|
+
"@argos-ci/storybook": "6.4.1",
|
|
70
70
|
"@emotion/react": "^11.5.0",
|
|
71
71
|
"@emotion/styled": "^11.3.0",
|
|
72
72
|
"@linagora/twake-icons": "^2.10.0",
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
"@types/lodash": "4.17.24",
|
|
83
83
|
"@types/react": "18.2.0",
|
|
84
84
|
"@types/react-dom": "^18.2.0",
|
|
85
|
-
"@vitest/browser-playwright": "4.1.
|
|
85
|
+
"@vitest/browser-playwright": "4.1.11",
|
|
86
86
|
"cozy-tsconfig": "^2.0.0",
|
|
87
87
|
"eslint": "10.2.1",
|
|
88
88
|
"eslint-config-cozy-app": "7.0.0",
|
|
@@ -93,7 +93,7 @@
|
|
|
93
93
|
"react-dom": "^18.2.0",
|
|
94
94
|
"storybook": "10.3.5",
|
|
95
95
|
"twake-i18n": "^0.5.0",
|
|
96
|
-
"vite": "8.
|
|
97
|
-
"vitest": "4.1.
|
|
96
|
+
"vite": "8.3.1",
|
|
97
|
+
"vitest": "4.1.11"
|
|
98
98
|
}
|
|
99
99
|
}
|