@linagora/twake-mui 1.5.0 → 1.6.1
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 +21 -0
- package/README.md +54 -0
- package/dist/components/Avatar/Avatar.stories.d.ts +7 -0
- package/dist/components/Avatar/Avatar.stories.js +73 -0
- package/dist/lib/makeDarkOverrides.js +7 -47
- package/dist/lib/makeLightOverrides.js +659 -39
- package/dist/stories/Alert.stories.d.ts +7 -0
- package/dist/stories/Alert.stories.js +81 -0
- package/dist/stories/Button.stories.d.ts +7 -0
- package/dist/stories/Button.stories.js +78 -0
- package/dist/stories/Dialog.stories.d.ts +7 -0
- package/dist/stories/Dialog.stories.js +40 -0
- package/dist/stories/Input.stories.d.ts +7 -0
- package/dist/stories/Input.stories.js +41 -0
- package/dist/stories/Selection.stories.d.ts +7 -0
- package/dist/stories/Selection.stories.js +37 -0
- package/dist/stories/Typography.stories.d.ts +7 -0
- package/dist/stories/Typography.stories.js +50 -0
- package/package.json +36 -26
- package/dist/lib/overrides/accordionOverrides.d.ts +0 -2
- package/dist/lib/overrides/accordionOverrides.js +0 -63
- package/dist/lib/overrides/autocompleteOverrides.d.ts +0 -2
- package/dist/lib/overrides/autocompleteOverrides.js +0 -31
- package/dist/lib/overrides/avatarOverrides.d.ts +0 -2
- package/dist/lib/overrides/avatarOverrides.js +0 -85
- package/dist/lib/overrides/backdropOverrides.d.ts +0 -2
- package/dist/lib/overrides/backdropOverrides.js +0 -17
- package/dist/lib/overrides/buttonOverrides.d.ts +0 -2
- package/dist/lib/overrides/buttonOverrides.js +0 -86
- package/dist/lib/overrides/checkboxOverrides.d.ts +0 -2
- package/dist/lib/overrides/checkboxOverrides.js +0 -11
- package/dist/lib/overrides/datePickerOverrides.d.ts +0 -2
- package/dist/lib/overrides/datePickerOverrides.js +0 -150
- package/dist/lib/overrides/dialogOverrides.d.ts +0 -5
- package/dist/lib/overrides/dialogOverrides.js +0 -43
- package/dist/lib/overrides/iconButtonOverrides.d.ts +0 -2
- package/dist/lib/overrides/iconButtonOverrides.js +0 -13
- package/dist/lib/overrides/menuItemOverrides.d.ts +0 -2
- package/dist/lib/overrides/menuItemOverrides.js +0 -22
- package/dist/lib/overrides/popoverOverrides.d.ts +0 -2
- package/dist/lib/overrides/popoverOverrides.js +0 -11
- package/dist/lib/overrides/swipeableDrawerOverrides.d.ts +0 -2
- package/dist/lib/overrides/swipeableDrawerOverrides.js +0 -26
- package/dist/lib/overrides/textFieldOverrides.d.ts +0 -5
- package/dist/lib/overrides/textFieldOverrides.js +0 -95
- package/dist/lib/overrides/toggleButtonOverrides.d.ts +0 -3
- package/dist/lib/overrides/toggleButtonOverrides.js +0 -42
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Alert } from '@mui/material';
|
|
2
|
+
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
3
|
+
declare const meta: Meta<typeof Alert>;
|
|
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,81 @@
|
|
|
1
|
+
import { Alert, AlertTitle } from '@mui/material';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
const meta = {
|
|
4
|
+
title: 'Alert',
|
|
5
|
+
component: Alert,
|
|
6
|
+
parameters: { layout: 'centered' },
|
|
7
|
+
tags: ['autodocs'],
|
|
8
|
+
argTypes: {
|
|
9
|
+
severity: {
|
|
10
|
+
control: 'text',
|
|
11
|
+
description: 'Severity level (error, warning, info, success) or custom color name (primary, secondary)'
|
|
12
|
+
},
|
|
13
|
+
variant: {
|
|
14
|
+
control: 'select',
|
|
15
|
+
options: ['standard', 'filled', 'outlined']
|
|
16
|
+
},
|
|
17
|
+
color: {
|
|
18
|
+
control: 'text',
|
|
19
|
+
description: 'Custom color (CSS color value or MUI palette color like "primary", "secondary")'
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
export default meta;
|
|
24
|
+
export const Default = {
|
|
25
|
+
args: {
|
|
26
|
+
severity: 'info',
|
|
27
|
+
variant: 'standard'
|
|
28
|
+
},
|
|
29
|
+
render: args => (React.createElement(Alert, { ...args },
|
|
30
|
+
React.createElement(AlertTitle, null, "Alert Title"),
|
|
31
|
+
"This is the alert content text"))
|
|
32
|
+
};
|
|
33
|
+
// Visual Regression - All severity colors and variants combined
|
|
34
|
+
export const Screenshot = {
|
|
35
|
+
tags: ['argos'],
|
|
36
|
+
render: () => (React.createElement("div", { style: {
|
|
37
|
+
display: 'flex',
|
|
38
|
+
flexDirection: 'column',
|
|
39
|
+
gap: '24px',
|
|
40
|
+
minWidth: '400px'
|
|
41
|
+
} },
|
|
42
|
+
React.createElement("section", null,
|
|
43
|
+
React.createElement("h3", { style: { marginBottom: '12px' } }, "Standard Variant"),
|
|
44
|
+
React.createElement("div", { style: { display: 'flex', flexDirection: 'column', gap: '16px' } },
|
|
45
|
+
React.createElement(Alert, { severity: 'primary' },
|
|
46
|
+
React.createElement(AlertTitle, null, "Primary Alert"),
|
|
47
|
+
"This is a primary alert with title and text"),
|
|
48
|
+
React.createElement(Alert, { severity: 'secondary' },
|
|
49
|
+
React.createElement(AlertTitle, null, "Secondary Alert"),
|
|
50
|
+
"This is a secondary alert with title and text"),
|
|
51
|
+
React.createElement(Alert, { severity: "error" },
|
|
52
|
+
React.createElement(AlertTitle, null, "Error Alert"),
|
|
53
|
+
"This is an error alert with title and text"),
|
|
54
|
+
React.createElement(Alert, { severity: "warning" },
|
|
55
|
+
React.createElement(AlertTitle, null, "Warning Alert"),
|
|
56
|
+
"This is a warning alert with title and text"),
|
|
57
|
+
React.createElement(Alert, { severity: "info" },
|
|
58
|
+
React.createElement(AlertTitle, null, "Info Alert"),
|
|
59
|
+
"This is an info alert with title and text"),
|
|
60
|
+
React.createElement(Alert, { severity: "success" },
|
|
61
|
+
React.createElement(AlertTitle, null, "Success Alert"),
|
|
62
|
+
"This is a success alert with title and text"))),
|
|
63
|
+
React.createElement("section", null,
|
|
64
|
+
React.createElement("h3", { style: { marginBottom: '12px' } }, "Filled Variant"),
|
|
65
|
+
React.createElement("div", { style: { display: 'flex', flexDirection: 'column', gap: '16px' } },
|
|
66
|
+
React.createElement(Alert, { severity: "error", variant: "filled" },
|
|
67
|
+
React.createElement(AlertTitle, null, "Filled Error"),
|
|
68
|
+
"This is a filled error alert"),
|
|
69
|
+
React.createElement(Alert, { severity: "success", variant: "filled" },
|
|
70
|
+
React.createElement(AlertTitle, null, "Filled Success"),
|
|
71
|
+
"This is a filled success alert"))),
|
|
72
|
+
React.createElement("section", null,
|
|
73
|
+
React.createElement("h3", { style: { marginBottom: '12px' } }, "Outlined Variant"),
|
|
74
|
+
React.createElement("div", { style: { display: 'flex', flexDirection: 'column', gap: '16px' } },
|
|
75
|
+
React.createElement(Alert, { severity: "warning", variant: "outlined" },
|
|
76
|
+
React.createElement(AlertTitle, null, "Outlined Warning"),
|
|
77
|
+
"This is an outlined warning alert"),
|
|
78
|
+
React.createElement(Alert, { severity: "info", variant: "outlined" },
|
|
79
|
+
React.createElement(AlertTitle, null, "Outlined Info"),
|
|
80
|
+
"This is an outlined info alert")))))
|
|
81
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Button } from '@mui/material';
|
|
2
|
+
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
3
|
+
declare const meta: Meta<typeof Button>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof Button>;
|
|
6
|
+
export declare const Docs: Story;
|
|
7
|
+
export declare const Screenshot: Story;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { Button, Stack } from '@mui/material';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
const meta = {
|
|
4
|
+
title: 'Button',
|
|
5
|
+
component: Button,
|
|
6
|
+
parameters: { layout: 'centered' },
|
|
7
|
+
tags: ['autodocs'],
|
|
8
|
+
argTypes: {
|
|
9
|
+
variant: {
|
|
10
|
+
control: 'select',
|
|
11
|
+
options: ['contained', 'outlined', 'text']
|
|
12
|
+
},
|
|
13
|
+
color: {
|
|
14
|
+
control: 'select',
|
|
15
|
+
options: ['primary', 'secondary', 'error', 'warning', 'info', 'success']
|
|
16
|
+
},
|
|
17
|
+
size: {
|
|
18
|
+
control: 'select',
|
|
19
|
+
options: ['small', 'medium', 'large']
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
export default meta;
|
|
24
|
+
export const Docs = {
|
|
25
|
+
args: {
|
|
26
|
+
variant: 'contained',
|
|
27
|
+
children: 'Button'
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
// Visual Regression - All variants combined
|
|
31
|
+
export const Screenshot = {
|
|
32
|
+
tags: ['argos'],
|
|
33
|
+
render: () => (React.createElement(Stack, { spacing: 4 },
|
|
34
|
+
React.createElement("section", null,
|
|
35
|
+
React.createElement("h3", { style: { marginBottom: '12px' } }, "Variants"),
|
|
36
|
+
React.createElement(Stack, { direction: "row", spacing: 2 },
|
|
37
|
+
React.createElement(Button, { variant: "contained" }, "Contained"),
|
|
38
|
+
React.createElement(Button, { variant: "outlined" }, "Outlined"),
|
|
39
|
+
React.createElement(Button, { variant: "text" }, "Text"))),
|
|
40
|
+
React.createElement("section", null,
|
|
41
|
+
React.createElement("h3", { style: { marginBottom: '12px' } }, "Colors contained"),
|
|
42
|
+
React.createElement(Stack, { direction: { xs: 'column', sm: 'row' }, spacing: 2 },
|
|
43
|
+
React.createElement(Button, { variant: "contained", color: "primary" }, "Primary"),
|
|
44
|
+
React.createElement(Button, { variant: "contained", color: "secondary" }, "Secondary"),
|
|
45
|
+
React.createElement(Button, { variant: "contained", color: "success" }, "Success"),
|
|
46
|
+
React.createElement(Button, { variant: "contained", color: "error" }, "Error"),
|
|
47
|
+
React.createElement(Button, { variant: "contained", color: "warning" }, "Warning"),
|
|
48
|
+
React.createElement(Button, { variant: "contained", color: "info" }, "Info"))),
|
|
49
|
+
React.createElement("section", null,
|
|
50
|
+
React.createElement("h3", { style: { marginBottom: '12px' } }, "Colors outlined"),
|
|
51
|
+
React.createElement(Stack, { direction: { xs: 'column', sm: 'row' }, spacing: 2 },
|
|
52
|
+
React.createElement(Button, { variant: "outlined", color: "primary" }, "Primary"),
|
|
53
|
+
React.createElement(Button, { variant: "outlined", color: "secondary" }, "Secondary"),
|
|
54
|
+
React.createElement(Button, { variant: "outlined", color: "success" }, "Success"),
|
|
55
|
+
React.createElement(Button, { variant: "outlined", color: "error" }, "Error"),
|
|
56
|
+
React.createElement(Button, { variant: "outlined", color: "warning" }, "Warning"),
|
|
57
|
+
React.createElement(Button, { variant: "outlined", color: "info" }, "Info"))),
|
|
58
|
+
React.createElement("section", null,
|
|
59
|
+
React.createElement("h3", { style: { marginBottom: '12px' } }, "Colors text"),
|
|
60
|
+
React.createElement(Stack, { direction: { xs: 'column', sm: 'row' }, spacing: 2 },
|
|
61
|
+
React.createElement(Button, { variant: "text", color: "primary" }, "Primary"),
|
|
62
|
+
React.createElement(Button, { variant: "text", color: "secondary" }, "Secondary"),
|
|
63
|
+
React.createElement(Button, { variant: "text", color: "success" }, "Success"),
|
|
64
|
+
React.createElement(Button, { variant: "text", color: "error" }, "Error"),
|
|
65
|
+
React.createElement(Button, { variant: "text", color: "warning" }, "Warning"),
|
|
66
|
+
React.createElement(Button, { variant: "text", color: "info" }, "Info"))),
|
|
67
|
+
React.createElement("section", null,
|
|
68
|
+
React.createElement("h3", { style: { marginBottom: '12px' } }, "Sizes"),
|
|
69
|
+
React.createElement(Stack, { direction: "row", spacing: 2, sx: { alignItems: 'center' } },
|
|
70
|
+
React.createElement(Button, { variant: "contained", size: "small" }, "Small"),
|
|
71
|
+
React.createElement(Button, { variant: "contained", size: "medium" }, "Medium"),
|
|
72
|
+
React.createElement(Button, { variant: "contained", size: "large" }, "Large"))),
|
|
73
|
+
React.createElement("section", null,
|
|
74
|
+
React.createElement("h3", { style: { marginBottom: '12px' } }, "States"),
|
|
75
|
+
React.createElement(Stack, { direction: "row", spacing: 2 },
|
|
76
|
+
React.createElement(Button, { variant: "contained" }, "Normal"),
|
|
77
|
+
React.createElement(Button, { variant: "contained", disabled: true }, "Disabled")))))
|
|
78
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Dialog } from '@mui/material';
|
|
2
|
+
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
3
|
+
declare const meta: Meta<typeof Dialog>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof Dialog>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const Screenshot: Story;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { Dialog, DialogTitle, DialogContent, DialogContentText, DialogActions, Button, Stack } from '@mui/material';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
const meta = {
|
|
4
|
+
title: 'Dialog',
|
|
5
|
+
component: Dialog,
|
|
6
|
+
parameters: { layout: 'centered' },
|
|
7
|
+
tags: ['autodocs']
|
|
8
|
+
};
|
|
9
|
+
export default meta;
|
|
10
|
+
// Basic Dialog with open/close state
|
|
11
|
+
const BasicDialogComponent = () => {
|
|
12
|
+
const [open, setOpen] = React.useState(false);
|
|
13
|
+
return (React.createElement(React.Fragment, null,
|
|
14
|
+
React.createElement(Button, { variant: "contained", onClick: () => setOpen(true) }, "Open Dialog"),
|
|
15
|
+
React.createElement(Dialog, { open: open, onClose: () => setOpen(false) },
|
|
16
|
+
React.createElement(DialogTitle, null, "Dialog Title"),
|
|
17
|
+
React.createElement(DialogContent, null,
|
|
18
|
+
React.createElement(DialogContentText, null, "This is a basic dialog with a title, content, and action buttons. You can put any content here.")),
|
|
19
|
+
React.createElement(DialogActions, null,
|
|
20
|
+
React.createElement(Button, { onClick: () => setOpen(false) }, "Cancel"),
|
|
21
|
+
React.createElement(Button, { onClick: () => setOpen(false), variant: "contained" }, "Confirm")))));
|
|
22
|
+
};
|
|
23
|
+
export const Default = {
|
|
24
|
+
render: () => React.createElement(BasicDialogComponent, null)
|
|
25
|
+
};
|
|
26
|
+
// Visual Regression - Dialog styles
|
|
27
|
+
export const Screenshot = {
|
|
28
|
+
tags: ['argos'],
|
|
29
|
+
render: () => (React.createElement(Stack, { spacing: 4 },
|
|
30
|
+
React.createElement("section", null,
|
|
31
|
+
React.createElement("h3", { style: { marginBottom: '12px' } }, "Dialog Components"),
|
|
32
|
+
React.createElement(Stack, { spacing: 2 },
|
|
33
|
+
React.createElement(Dialog, { open: true },
|
|
34
|
+
React.createElement(DialogTitle, null, "Standard Dialog"),
|
|
35
|
+
React.createElement(DialogContent, null,
|
|
36
|
+
React.createElement(DialogContentText, null, "This demonstrates the standard dialog appearance with all its subcomponents styled according to the Twake theme.")),
|
|
37
|
+
React.createElement(DialogActions, null,
|
|
38
|
+
React.createElement(Button, null, "Cancel"),
|
|
39
|
+
React.createElement(Button, { variant: "contained" }, "Confirm")))))))
|
|
40
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { TextField } from '@mui/material';
|
|
2
|
+
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
3
|
+
declare const meta: Meta<typeof TextField>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof TextField>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const Screenshot: Story;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { TextField, Select, MenuItem, Stack, Box } from '@mui/material';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
const meta = {
|
|
4
|
+
title: 'Input',
|
|
5
|
+
component: TextField,
|
|
6
|
+
parameters: { layout: 'centered' },
|
|
7
|
+
tags: ['autodocs']
|
|
8
|
+
};
|
|
9
|
+
export default meta;
|
|
10
|
+
export const Default = {
|
|
11
|
+
args: {
|
|
12
|
+
label: 'Label',
|
|
13
|
+
variant: 'outlined',
|
|
14
|
+
defaultValue: 'Sample text'
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
// Visual Regression - All inputs combined
|
|
18
|
+
export const Screenshot = {
|
|
19
|
+
tags: ['argos'],
|
|
20
|
+
render: () => (React.createElement(Stack, { spacing: 4 },
|
|
21
|
+
React.createElement("section", null,
|
|
22
|
+
React.createElement("h3", { style: { marginBottom: '12px' } }, "TextField Variants"),
|
|
23
|
+
React.createElement(Stack, { spacing: 2 },
|
|
24
|
+
React.createElement(TextField, { label: "Outlined", variant: "outlined", defaultValue: "Sample text" }),
|
|
25
|
+
React.createElement(TextField, { label: "Filled", variant: "filled", defaultValue: "Sample text" }),
|
|
26
|
+
React.createElement(TextField, { label: "Standard", variant: "standard", defaultValue: "Sample text" }))),
|
|
27
|
+
React.createElement("section", null,
|
|
28
|
+
React.createElement("h3", { style: { marginBottom: '12px' } }, "TextField States"),
|
|
29
|
+
React.createElement(Stack, { spacing: 2 },
|
|
30
|
+
React.createElement(TextField, { label: "Normal", variant: "outlined", defaultValue: "Sample text" }),
|
|
31
|
+
React.createElement(TextField, { label: "Disabled", variant: "outlined", defaultValue: "Cannot edit", disabled: true }),
|
|
32
|
+
React.createElement(TextField, { label: "Error", variant: "outlined", defaultValue: "Invalid value", error: true, helperText: "This field has an error" }),
|
|
33
|
+
React.createElement(TextField, { label: "Required", variant: "outlined", required: true }))),
|
|
34
|
+
React.createElement("section", null,
|
|
35
|
+
React.createElement("h3", { style: { marginBottom: '12px' } }, "Select"),
|
|
36
|
+
React.createElement(Box, { sx: { minWidth: 200 } },
|
|
37
|
+
React.createElement(Select, { value: 10, fullWidth: true },
|
|
38
|
+
React.createElement(MenuItem, { value: 10 }, "Ten"),
|
|
39
|
+
React.createElement(MenuItem, { value: 20 }, "Twenty"),
|
|
40
|
+
React.createElement(MenuItem, { value: 30 }, "Thirty"))))))
|
|
41
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Checkbox } from '@mui/material';
|
|
2
|
+
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
3
|
+
declare const meta: Meta<typeof Checkbox>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof Checkbox>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const Screenshot: Story;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import FormatBoldIcon from '@mui/icons-material/FormatBold';
|
|
2
|
+
import FormatItalicIcon from '@mui/icons-material/FormatItalic';
|
|
3
|
+
import FormatUnderlinedIcon from '@mui/icons-material/FormatUnderlined';
|
|
4
|
+
import { Checkbox, FormControlLabel, ToggleButton, ToggleButtonGroup, Stack, Box } from '@mui/material';
|
|
5
|
+
import React from 'react';
|
|
6
|
+
const meta = {
|
|
7
|
+
title: 'Selection',
|
|
8
|
+
component: Checkbox,
|
|
9
|
+
parameters: { layout: 'centered' },
|
|
10
|
+
tags: ['autodocs']
|
|
11
|
+
};
|
|
12
|
+
export default meta;
|
|
13
|
+
export const Default = {
|
|
14
|
+
render: () => React.createElement(FormControlLabel, { control: React.createElement(Checkbox, null), label: "Checkbox" })
|
|
15
|
+
};
|
|
16
|
+
// Visual Regression - All selection components
|
|
17
|
+
export const Screenshot = {
|
|
18
|
+
tags: ['argos'],
|
|
19
|
+
render: () => (React.createElement(Stack, { spacing: 4 },
|
|
20
|
+
React.createElement("section", null,
|
|
21
|
+
React.createElement("h3", { style: { marginBottom: '12px' } }, "Checkbox States"),
|
|
22
|
+
React.createElement(Stack, { direction: "row", spacing: 4 },
|
|
23
|
+
React.createElement(FormControlLabel, { control: React.createElement(Checkbox, { checked: false }), label: "Unchecked" }),
|
|
24
|
+
React.createElement(FormControlLabel, { control: React.createElement(Checkbox, { checked: true }), label: "Checked" }),
|
|
25
|
+
React.createElement(FormControlLabel, { control: React.createElement(Checkbox, { indeterminate: true }), label: "Indeterminate" }),
|
|
26
|
+
React.createElement(FormControlLabel, { control: React.createElement(Checkbox, { disabled: true }), label: "Disabled" }))),
|
|
27
|
+
React.createElement("section", null,
|
|
28
|
+
React.createElement("h3", { style: { marginBottom: '12px' } }, "Toggle Buttons"),
|
|
29
|
+
React.createElement(Box, null,
|
|
30
|
+
React.createElement(ToggleButtonGroup, { value: ['bold'] },
|
|
31
|
+
React.createElement(ToggleButton, { value: "bold", "aria-label": "bold" },
|
|
32
|
+
React.createElement(FormatBoldIcon, null)),
|
|
33
|
+
React.createElement(ToggleButton, { value: "italic", "aria-label": "italic" },
|
|
34
|
+
React.createElement(FormatItalicIcon, null)),
|
|
35
|
+
React.createElement(ToggleButton, { value: "underlined", "aria-label": "underlined" },
|
|
36
|
+
React.createElement(FormatUnderlinedIcon, null)))))))
|
|
37
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Typography } from '@mui/material';
|
|
2
|
+
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
3
|
+
declare const meta: Meta<typeof Typography>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof Typography>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const Screenshot: Story;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { Typography, Stack } from '@mui/material';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
const meta = {
|
|
4
|
+
title: 'Typography',
|
|
5
|
+
component: Typography,
|
|
6
|
+
parameters: { layout: 'centered' },
|
|
7
|
+
tags: ['autodocs']
|
|
8
|
+
};
|
|
9
|
+
export default meta;
|
|
10
|
+
export const Default = {
|
|
11
|
+
args: {
|
|
12
|
+
variant: 'body1',
|
|
13
|
+
children: 'This is sample typography text.'
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
// Visual Regression - All typography combined
|
|
17
|
+
export const Screenshot = {
|
|
18
|
+
tags: ['argos'],
|
|
19
|
+
render: () => (React.createElement(Stack, { spacing: 2 },
|
|
20
|
+
React.createElement("section", null,
|
|
21
|
+
React.createElement("h3", { style: { marginBottom: '12px' } }, "All Variants"),
|
|
22
|
+
React.createElement(Stack, { spacing: 1 },
|
|
23
|
+
React.createElement(Typography, { variant: "h1" }, "Heading 1"),
|
|
24
|
+
React.createElement(Typography, { variant: "h2" }, "Heading 2"),
|
|
25
|
+
React.createElement(Typography, { variant: "h3" }, "Heading 3"),
|
|
26
|
+
React.createElement(Typography, { variant: "h4" }, "Heading 4"),
|
|
27
|
+
React.createElement(Typography, { variant: "h5" }, "Heading 5"),
|
|
28
|
+
React.createElement(Typography, { variant: "h6" }, "Heading 6"),
|
|
29
|
+
React.createElement(Typography, { variant: "subtitle1" }, "Subtitle 1"),
|
|
30
|
+
React.createElement(Typography, { variant: "subtitle2" }, "Subtitle 2"),
|
|
31
|
+
React.createElement(Typography, { variant: "body1" }, "Body 1 - This is the default body text style used for most content."),
|
|
32
|
+
React.createElement(Typography, { variant: "body2" }, "Body 2 - This is a smaller body text style for secondary content."),
|
|
33
|
+
React.createElement(Typography, { variant: "button" }, "Button Text"),
|
|
34
|
+
React.createElement(Typography, { variant: "caption" }, "Caption text"),
|
|
35
|
+
React.createElement(Typography, { variant: "overline" }, "OVERLINE TEXT"))),
|
|
36
|
+
React.createElement("section", null,
|
|
37
|
+
React.createElement("h3", { style: { marginBottom: '12px', marginTop: '24px' } }, "Colors"),
|
|
38
|
+
React.createElement(Stack, { spacing: 1 },
|
|
39
|
+
React.createElement(Typography, { color: "primary" }, "Primary color text"),
|
|
40
|
+
React.createElement(Typography, { color: "secondary" }, "Secondary color text"),
|
|
41
|
+
React.createElement(Typography, { color: "success" }, "Success color text"),
|
|
42
|
+
React.createElement(Typography, { color: "error" }, "Error color text"),
|
|
43
|
+
React.createElement(Typography, { color: "warning" }, "Warning color text"),
|
|
44
|
+
React.createElement(Typography, { color: "info" }, "Info color text"),
|
|
45
|
+
React.createElement(Typography, { color: "textPrimary" }, "Text primary color"),
|
|
46
|
+
React.createElement(Typography, { color: "textSecondary" }, "Text secondary color"),
|
|
47
|
+
React.createElement(Typography, { color: "textDisabled" }, "Text disabled color"),
|
|
48
|
+
React.createElement(Typography, { color: "text.primary" }, "Text primary color"),
|
|
49
|
+
React.createElement(Typography, { color: "text.secondary" }, "Text secondary color")))))
|
|
50
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@linagora/twake-mui",
|
|
3
|
-
"
|
|
3
|
+
"type": "module",
|
|
4
|
+
"version": "1.6.1",
|
|
4
5
|
"description": "MUI v7 theme system for Twake applications",
|
|
5
6
|
"author": "Twake",
|
|
6
7
|
"license": "MIT",
|
|
@@ -21,9 +22,8 @@
|
|
|
21
22
|
],
|
|
22
23
|
"exports": {
|
|
23
24
|
".": {
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"types": "./dist/index.d.ts"
|
|
25
|
+
"types": "./dist/index.d.ts",
|
|
26
|
+
"import": "./dist/index.js"
|
|
27
27
|
}
|
|
28
28
|
},
|
|
29
29
|
"main": "dist/index.js",
|
|
@@ -38,36 +38,46 @@
|
|
|
38
38
|
},
|
|
39
39
|
"scripts": {
|
|
40
40
|
"build": "tsc",
|
|
41
|
+
"build:doc": "storybook build --output-dir storybook-static",
|
|
41
42
|
"start": "tsc --watch",
|
|
42
43
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
43
44
|
"lint": "eslint src --ext .ts,.tsx",
|
|
44
45
|
"lint:fix": "eslint src --ext .ts,.tsx --fix",
|
|
45
|
-
"clean": "rm -rf dist"
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
"react": "^18.2.0",
|
|
49
|
-
"react-dom": "^18.2.0"
|
|
46
|
+
"clean": "rm -rf dist",
|
|
47
|
+
"doc": "storybook dev -p 6006",
|
|
48
|
+
"screenshots": "vitest run"
|
|
50
49
|
},
|
|
51
50
|
"peerDependencies": {
|
|
52
|
-
"@emotion/react": "^11.
|
|
53
|
-
"@emotion/styled": "^11.
|
|
51
|
+
"@emotion/react": "^11.5.0",
|
|
52
|
+
"@emotion/styled": "^11.3.0",
|
|
54
53
|
"@mui/material": "^7.1.2",
|
|
55
|
-
"react": "^18
|
|
56
|
-
"react-dom": "^18
|
|
54
|
+
"react": "^18",
|
|
55
|
+
"react-dom": "^18"
|
|
57
56
|
},
|
|
58
57
|
"devDependencies": {
|
|
59
|
-
"@
|
|
60
|
-
"@
|
|
61
|
-
"
|
|
62
|
-
"
|
|
63
|
-
"
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
"
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
"react-
|
|
70
|
-
|
|
71
|
-
|
|
58
|
+
"@argos-ci/cli": "4.2.0",
|
|
59
|
+
"@argos-ci/storybook": "5.3.2",
|
|
60
|
+
"@emotion/react": "^11.5.0",
|
|
61
|
+
"@emotion/styled": "^11.3.0",
|
|
62
|
+
"@mui/icons-material": "7.3.10",
|
|
63
|
+
"@mui/material": "^7.1.2",
|
|
64
|
+
"@storybook/addon-docs": "10.3.5",
|
|
65
|
+
"@storybook/addon-vitest": "10.3.5",
|
|
66
|
+
"@storybook/builder-vite": "10.3.5",
|
|
67
|
+
"@storybook/react": "10.3.5",
|
|
68
|
+
"@storybook/react-vite": "10.3.5",
|
|
69
|
+
"@types/lodash": "4.17.24",
|
|
70
|
+
"@vitest/browser-playwright": "4.1.5",
|
|
71
|
+
"cozy-tsconfig": "^2.0.0",
|
|
72
|
+
"eslint": "10.2.1",
|
|
73
|
+
"eslint-config-cozy-app": "7.0.0",
|
|
74
|
+
"eslint-plugin-storybook": "10.3.5",
|
|
75
|
+
"lodash": "4.18.1",
|
|
76
|
+
"playwright": "1.59.1",
|
|
77
|
+
"react": "^18.2.0",
|
|
78
|
+
"react-dom": "^18.2.0",
|
|
79
|
+
"storybook": "10.3.5",
|
|
80
|
+
"vite": "8.0.9",
|
|
81
|
+
"vitest": "4.1.5"
|
|
72
82
|
}
|
|
73
83
|
}
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { alpha } from '@mui/material/styles';
|
|
2
|
-
import paletteJson from '../palette.json';
|
|
3
|
-
const paletteData = paletteJson;
|
|
4
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
5
|
-
export const accordionOverrides = (theme) => {
|
|
6
|
-
return {
|
|
7
|
-
MuiAccordion: {
|
|
8
|
-
styleOverrides: {
|
|
9
|
-
root: {
|
|
10
|
-
'&::before': {
|
|
11
|
-
display: 'none'
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
},
|
|
16
|
-
MuiAccordionSummary: {
|
|
17
|
-
styleOverrides: {
|
|
18
|
-
root: {
|
|
19
|
-
padding: '0',
|
|
20
|
-
minHeight: '32px',
|
|
21
|
-
'&.Mui-expanded': {
|
|
22
|
-
minHeight: '32px'
|
|
23
|
-
}
|
|
24
|
-
},
|
|
25
|
-
content: {
|
|
26
|
-
fontSize: '14px',
|
|
27
|
-
fontWeight: 500,
|
|
28
|
-
lineHeight: '20px',
|
|
29
|
-
color: alpha(paletteData.Grey[900], 0.9),
|
|
30
|
-
margin: 0,
|
|
31
|
-
'&.Mui-expanded': {
|
|
32
|
-
margin: 0
|
|
33
|
-
}
|
|
34
|
-
},
|
|
35
|
-
expandIconWrapper: {
|
|
36
|
-
padding: '4px',
|
|
37
|
-
color: alpha(paletteData.Grey[900], 0.48),
|
|
38
|
-
borderRadius: '50%',
|
|
39
|
-
'&:hover': {
|
|
40
|
-
backgroundColor: alpha(paletteData.Primary.A400, 0.04)
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
},
|
|
45
|
-
MuiCssBaseline: {
|
|
46
|
-
styleOverrides: {
|
|
47
|
-
'.MuiAccordion-root .MuiListItem-root': {
|
|
48
|
-
padding: '0',
|
|
49
|
-
borderRadius: '4px',
|
|
50
|
-
'&:hover': {
|
|
51
|
-
backgroundColor: alpha(paletteData.Grey.A900, 0.04)
|
|
52
|
-
}
|
|
53
|
-
},
|
|
54
|
-
'.MuiAccordion-root .MuiListItem-root label': {
|
|
55
|
-
fontSize: '14px',
|
|
56
|
-
fontStyle: 'normal',
|
|
57
|
-
fontWeight: 400,
|
|
58
|
-
color: alpha(paletteData.Grey[900], 0.9)
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
};
|
|
63
|
-
};
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { radius } from '../radius';
|
|
2
|
-
export const autocompleteOverrides = () => {
|
|
3
|
-
return {
|
|
4
|
-
styleOverrides: {
|
|
5
|
-
root: {
|
|
6
|
-
// Using "&&" to increase CSS specificity
|
|
7
|
-
'&&': {
|
|
8
|
-
'& .MuiOutlinedInput-root': {
|
|
9
|
-
paddingLeft: '16px',
|
|
10
|
-
borderRadius: radius.sm,
|
|
11
|
-
'& fieldset.MuiOutlinedInput-notchedOutline': {
|
|
12
|
-
borderRadius: radius.sm
|
|
13
|
-
},
|
|
14
|
-
'&.MuiInputBase-sizeSmall': {
|
|
15
|
-
paddingTop: '8px',
|
|
16
|
-
paddingBottom: '8px',
|
|
17
|
-
paddingLeft: '16px',
|
|
18
|
-
'& .MuiAutocomplete-input': {
|
|
19
|
-
padding: '0px 4px 0px 8px'
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
},
|
|
25
|
-
// Styling for chips in Autocomplete
|
|
26
|
-
tag: {
|
|
27
|
-
margin: '2px'
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
};
|
|
31
|
-
};
|