@linagora/twake-mui 3.0.0 → 4.1.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 +42 -0
- package/dist/components/AccordionExpandIcon/index.d.ts +3 -0
- package/dist/components/AccordionExpandIcon/index.js +4 -0
- package/dist/index.d.ts +4 -3
- package/dist/index.js +5 -1
- package/dist/lib/makeDarkOverrides.js +3 -13
- package/dist/lib/makeLightOverrides.js +99 -25
- package/dist/lib/makePalette.js +10 -3
- package/dist/lib/makeTypography.js +20 -39
- package/dist/lib/palette.json +4 -0
- package/dist/lib/types.d.ts +5 -3
- package/dist/stories/Accordion.stories.d.ts +7 -0
- package/dist/stories/Accordion.stories.js +29 -0
- package/dist/stories/Fab.stories.d.ts +7 -0
- package/dist/stories/Fab.stories.js +73 -0
- package/dist/stories/Tooltip.stories.d.ts +7 -0
- package/dist/stories/Tooltip.stories.js +41 -0
- package/dist/stories/Typography.stories.js +2 -0
- package/package.json +5 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,45 @@
|
|
|
1
|
+
# @linagora/twake-mui [4.1.0](https://github.com/linagora/twake-ui/compare/@linagora/twake-mui@4.0.0...@linagora/twake-mui@4.1.0) (2026-08-26)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* **twake-mui:** Add AppTitle ([6c7113c](https://github.com/linagora/twake-ui/commit/6c7113ce243fb381212e1b33a12b8ef6342abd38))
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Reverts
|
|
10
|
+
|
|
11
|
+
* **twake-mui:** Revert Apptitle addition ([3700530](https://github.com/linagora/twake-ui/commit/37005305b880d7a7fb11b6f4c800efdb5e9a03d0))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Dependencies
|
|
15
|
+
|
|
16
|
+
* **@linagora/twake-icons:** upgraded to 2.8.0
|
|
17
|
+
|
|
18
|
+
# @linagora/twake-mui [4.0.0](https://github.com/linagora/twake-ui/compare/@linagora/twake-mui@3.0.0...@linagora/twake-mui@4.0.0) (2026-07-28)
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
### Bug Fixes
|
|
22
|
+
|
|
23
|
+
* **twake-mui:** Remove forced grey color for Typography ([6bbd9e6](https://github.com/linagora/twake-ui/commit/6bbd9e6609356719bd2d0ce08660e079fc9d6e8c))
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
### chore
|
|
27
|
+
|
|
28
|
+
* **twake-mui:** Add @linagora/twake-icons as dependency ([d38157a](https://github.com/linagora/twake-ui/commit/d38157a0a1edc02be8450e2df0631bb492f18118))
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
### Features
|
|
32
|
+
|
|
33
|
+
* **twake-mui:** Add AccordionSummary cozy-ui style overrides with default expand icon ([30d8402](https://github.com/linagora/twake-ui/commit/30d840288a098d9e6af83422182a3e2e84dfb494))
|
|
34
|
+
* **twake-mui:** Add Fab cozy-ui style overrides with medium size default ([2d6b0ed](https://github.com/linagora/twake-ui/commit/2d6b0ede0d65e73c5c80e58d678cd894ec6ba4de))
|
|
35
|
+
* **twake-mui:** Add Tooltip cozy-ui style overrides with arrow by default ([ab349eb](https://github.com/linagora/twake-ui/commit/ab349ebc1efe3af8517a74dbab1efafe608e811e))
|
|
36
|
+
* **twake-mui:** Copy Typography style from cozy-ui ([a43378a](https://github.com/linagora/twake-ui/commit/a43378a019bb369dcb2e5debd0baa5f2355941a7))
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
### BREAKING CHANGES
|
|
40
|
+
|
|
41
|
+
* **twake-mui:** You must have `"@linagora/twake-icons": "^2.7.0"`
|
|
42
|
+
|
|
1
43
|
# @linagora/twake-mui [3.0.0](https://github.com/linagora/twake-ui/compare/@linagora/twake-mui@2.0.0...@linagora/twake-mui@3.0.0) (2026-07-27)
|
|
2
44
|
|
|
3
45
|
|
package/dist/index.d.ts
CHANGED
|
@@ -2,11 +2,12 @@ export * from '@mui/material';
|
|
|
2
2
|
export * from '@mui/lab';
|
|
3
3
|
export { createTheme, ThemeProvider, styled, alpha, darken, lighten, useTheme } from '@mui/material/styles';
|
|
4
4
|
export { default as Autocomplete } from '@mui/material/Autocomplete';
|
|
5
|
-
export { TwakeMuiThemeProvider } from './components/ThemeProvider';
|
|
6
5
|
export { makePalette } from './lib/makePalette';
|
|
7
6
|
export { theme } from './lib/theme';
|
|
8
|
-
export type { TwakeTheme } from './lib/theme';
|
|
9
7
|
export { radius } from './lib/radius';
|
|
8
|
+
export { TwakeMuiThemeProvider } from './components/ThemeProvider';
|
|
10
9
|
export { Avatar, default as AvatarDefault } from './components/Avatar';
|
|
11
|
-
export type { AvatarProps } from './components/Avatar';
|
|
12
10
|
export { nameToColor, supportedColors } from './components/Avatar/helpers';
|
|
11
|
+
export { default as AccordionExpandIcon } from './components/AccordionExpandIcon';
|
|
12
|
+
export type { TwakeTheme } from './lib/theme';
|
|
13
|
+
export type { AvatarProps } from './components/Avatar';
|
package/dist/index.js
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
|
+
// MUI
|
|
1
2
|
export * from '@mui/material';
|
|
2
3
|
export * from '@mui/lab';
|
|
3
4
|
export { createTheme, ThemeProvider, styled, alpha, darken, lighten, useTheme } from '@mui/material/styles';
|
|
4
5
|
export { default as Autocomplete } from '@mui/material/Autocomplete';
|
|
5
|
-
|
|
6
|
+
// LIB
|
|
6
7
|
export { makePalette } from './lib/makePalette';
|
|
7
8
|
export { theme } from './lib/theme';
|
|
8
9
|
export { radius } from './lib/radius';
|
|
10
|
+
// COMPONENTS & HELPERS
|
|
11
|
+
export { TwakeMuiThemeProvider } from './components/ThemeProvider';
|
|
9
12
|
export { Avatar, default as AvatarDefault } from './components/Avatar';
|
|
10
13
|
export { nameToColor, supportedColors } from './components/Avatar/helpers';
|
|
14
|
+
export { default as AccordionExpandIcon } from './components/AccordionExpandIcon';
|
|
@@ -1,19 +1,9 @@
|
|
|
1
|
-
import { alpha } from '@mui/material/styles';
|
|
2
1
|
import { merge } from 'lodash';
|
|
3
2
|
import { makeLightOverrides } from './makeLightOverrides';
|
|
4
3
|
export const makeDarkOverrides = (theme) => {
|
|
5
|
-
const makeOverridesForDarkTheme = (
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
root: {
|
|
9
|
-
color: alpha(theme.palette.grey[50], 0.9)
|
|
10
|
-
},
|
|
11
|
-
caption: {
|
|
12
|
-
// Typography caption overrides will be implemented later
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
});
|
|
4
|
+
const makeOverridesForDarkTheme = (
|
|
5
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
6
|
+
theme) => ({});
|
|
17
7
|
const DarkOverrides = merge(makeLightOverrides(theme), makeOverridesForDarkTheme(theme));
|
|
18
8
|
return DarkOverrides;
|
|
19
9
|
};
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { menuItemClasses } from '@mui/material/MenuItem';
|
|
2
|
-
import { alpha } from '@mui/material/styles';
|
|
2
|
+
import { alpha, darken } from '@mui/material/styles';
|
|
3
|
+
import React from 'react';
|
|
3
4
|
import paletteJson from './palette.json';
|
|
4
5
|
import { radius } from './radius';
|
|
6
|
+
import AccordionExpandIcon from '../components/AccordionExpandIcon';
|
|
5
7
|
const paletteData = paletteJson;
|
|
6
8
|
export const makeLightOverrides = (theme) => {
|
|
7
9
|
return {
|
|
@@ -431,16 +433,6 @@ export const makeLightOverrides = (theme) => {
|
|
|
431
433
|
}
|
|
432
434
|
}
|
|
433
435
|
},
|
|
434
|
-
MuiTypography: {
|
|
435
|
-
styleOverrides: {
|
|
436
|
-
root: {
|
|
437
|
-
color: alpha(theme.palette.grey[900], 0.9)
|
|
438
|
-
},
|
|
439
|
-
caption: {
|
|
440
|
-
// Typography caption overrides will be implemented later
|
|
441
|
-
}
|
|
442
|
-
}
|
|
443
|
-
},
|
|
444
436
|
MuiAccordion: {
|
|
445
437
|
styleOverrides: {
|
|
446
438
|
root: {
|
|
@@ -451,31 +443,113 @@ export const makeLightOverrides = (theme) => {
|
|
|
451
443
|
}
|
|
452
444
|
},
|
|
453
445
|
MuiAccordionSummary: {
|
|
446
|
+
defaultProps: { expandIcon: React.createElement(AccordionExpandIcon, null) },
|
|
454
447
|
styleOverrides: {
|
|
455
448
|
root: {
|
|
456
|
-
|
|
457
|
-
|
|
449
|
+
backgroundColor: theme.palette.grey[100],
|
|
450
|
+
textTransform: 'uppercase',
|
|
451
|
+
fontWeight: 'bold',
|
|
452
|
+
fontSize: '0.875rem',
|
|
453
|
+
minHeight: '3.5rem',
|
|
454
|
+
padding: 0,
|
|
455
|
+
color: theme.palette.text.primary,
|
|
458
456
|
'&.Mui-expanded': {
|
|
459
|
-
minHeight: '
|
|
457
|
+
minHeight: '3.5rem'
|
|
458
|
+
}
|
|
459
|
+
},
|
|
460
|
+
expandIconWrapper: {
|
|
461
|
+
order: 0,
|
|
462
|
+
'&&': {
|
|
463
|
+
marginLeft: '0.3125rem'
|
|
464
|
+
},
|
|
465
|
+
transform: 'rotate(-90deg)',
|
|
466
|
+
'&.Mui-expanded': {
|
|
467
|
+
marginLeft: '0.3125rem',
|
|
468
|
+
transform: 'rotate(0deg)'
|
|
460
469
|
}
|
|
461
470
|
},
|
|
462
471
|
content: {
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
472
|
+
margin: '0.75rem 0',
|
|
473
|
+
paddingLeft: '0.5rem',
|
|
474
|
+
paddingRight: '0.25rem',
|
|
475
|
+
order: 1,
|
|
476
|
+
'& > :last-child': {
|
|
477
|
+
paddingRight: 0
|
|
478
|
+
},
|
|
468
479
|
'&.Mui-expanded': {
|
|
469
|
-
margin: 0
|
|
480
|
+
margin: '0.75rem 0'
|
|
481
|
+
}
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
},
|
|
485
|
+
MuiFab: {
|
|
486
|
+
defaultProps: { size: 'medium' },
|
|
487
|
+
styleOverrides: {
|
|
488
|
+
root: {
|
|
489
|
+
borderRadius: 28,
|
|
490
|
+
width: 96,
|
|
491
|
+
height: 96,
|
|
492
|
+
color: theme.palette.text.primary,
|
|
493
|
+
backgroundColor: theme.palette.background.paper,
|
|
494
|
+
'&:hover': {
|
|
495
|
+
backgroundColor: darken(theme.palette.background.paper, 0.05)
|
|
496
|
+
},
|
|
497
|
+
'@media (hover: none)': {
|
|
498
|
+
backgroundColor: theme.palette.background.paper
|
|
470
499
|
}
|
|
471
500
|
},
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
borderRadius: '50%',
|
|
501
|
+
primary: {
|
|
502
|
+
color: theme.palette.primary.dark,
|
|
503
|
+
backgroundColor: theme.palette.primary.light,
|
|
476
504
|
'&:hover': {
|
|
477
|
-
backgroundColor:
|
|
505
|
+
backgroundColor: darken(theme.palette.primary.light, 0.05)
|
|
506
|
+
},
|
|
507
|
+
'@media (hover: none)': {
|
|
508
|
+
backgroundColor: theme.palette.primary.light
|
|
509
|
+
}
|
|
510
|
+
},
|
|
511
|
+
extended: {
|
|
512
|
+
borderRadius: 16,
|
|
513
|
+
width: 'auto',
|
|
514
|
+
height: 56,
|
|
515
|
+
minWidth: 56,
|
|
516
|
+
padding: '0 20px',
|
|
517
|
+
'&.MuiFab-sizeSmall': {
|
|
518
|
+
borderRadius: 16,
|
|
519
|
+
width: 'auto',
|
|
520
|
+
height: 42,
|
|
521
|
+
minWidth: 42,
|
|
522
|
+
padding: '0 12px'
|
|
523
|
+
},
|
|
524
|
+
'&.MuiFab-sizeMedium': {
|
|
525
|
+
borderRadius: 16,
|
|
526
|
+
width: 'auto',
|
|
527
|
+
height: 48,
|
|
528
|
+
minWidth: 48,
|
|
529
|
+
padding: '0 16px'
|
|
478
530
|
}
|
|
531
|
+
},
|
|
532
|
+
sizeSmall: {
|
|
533
|
+
borderRadius: 12,
|
|
534
|
+
width: 40,
|
|
535
|
+
height: 40
|
|
536
|
+
},
|
|
537
|
+
sizeMedium: {
|
|
538
|
+
borderRadius: 16,
|
|
539
|
+
width: 56,
|
|
540
|
+
height: 56
|
|
541
|
+
}
|
|
542
|
+
}
|
|
543
|
+
},
|
|
544
|
+
MuiTooltip: {
|
|
545
|
+
defaultProps: { arrow: true },
|
|
546
|
+
styleOverrides: {
|
|
547
|
+
tooltip: {
|
|
548
|
+
backgroundColor: alpha(theme.palette.grey[800], 0.9),
|
|
549
|
+
fontSize: '1rem',
|
|
550
|
+
lineHeight: 1.3,
|
|
551
|
+
borderRadius: '4px',
|
|
552
|
+
padding: '8px 12px'
|
|
479
553
|
}
|
|
480
554
|
}
|
|
481
555
|
},
|
package/dist/lib/makePalette.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { alpha } from '@mui/material/styles';
|
|
1
2
|
import paletteJson from './palette.json';
|
|
2
3
|
const paletteData = paletteJson;
|
|
3
4
|
export const makePalette = (mode = 'light', palette = paletteData) => {
|
|
@@ -57,9 +58,15 @@ export const makePalette = (mode = 'light', palette = paletteData) => {
|
|
|
57
58
|
A900: palette.Grey.A900
|
|
58
59
|
},
|
|
59
60
|
text: {
|
|
60
|
-
primary: '
|
|
61
|
-
|
|
62
|
-
|
|
61
|
+
primary: mode === 'dark'
|
|
62
|
+
? palette.Common['white']
|
|
63
|
+
: alpha(palette.Grey[900], 0.9),
|
|
64
|
+
secondary: mode === 'dark'
|
|
65
|
+
? alpha(palette.Common['white'], 0.64)
|
|
66
|
+
: alpha(palette.Grey['900'], 0.64),
|
|
67
|
+
disabled: mode === 'dark'
|
|
68
|
+
? alpha(palette.Common['white'], 0.4)
|
|
69
|
+
: alpha(palette.Grey['900'], 0.32)
|
|
63
70
|
},
|
|
64
71
|
background: {
|
|
65
72
|
default: '#FFFFFF',
|
|
@@ -16,96 +16,77 @@ export const makeTypography = () => {
|
|
|
16
16
|
h1: {
|
|
17
17
|
fontSize: 45,
|
|
18
18
|
fontWeight: 600,
|
|
19
|
-
lineHeight: 1.
|
|
20
|
-
letterSpacing: '0'
|
|
19
|
+
lineHeight: 1.087
|
|
21
20
|
},
|
|
22
21
|
h2: {
|
|
23
22
|
fontSize: 32,
|
|
24
23
|
fontWeight: 600,
|
|
25
|
-
lineHeight: 1.
|
|
26
|
-
letterSpacing: '0'
|
|
24
|
+
lineHeight: 1.313
|
|
27
25
|
},
|
|
28
26
|
h3: {
|
|
29
27
|
fontSize: 24,
|
|
30
28
|
fontWeight: 600,
|
|
31
|
-
lineHeight: 1.
|
|
32
|
-
letterSpacing: '0'
|
|
29
|
+
lineHeight: 1.167
|
|
33
30
|
},
|
|
34
31
|
h4: {
|
|
35
32
|
fontSize: 22,
|
|
36
33
|
fontWeight: 600,
|
|
37
|
-
lineHeight: 1.
|
|
38
|
-
letterSpacing: '0'
|
|
34
|
+
lineHeight: 1.167
|
|
39
35
|
},
|
|
40
36
|
h5: {
|
|
41
37
|
fontSize: 16,
|
|
42
38
|
fontWeight: 600,
|
|
43
|
-
lineHeight: 1.
|
|
44
|
-
letterSpacing: '0'
|
|
39
|
+
lineHeight: 1.313,
|
|
40
|
+
letterSpacing: '0.15px'
|
|
45
41
|
},
|
|
46
42
|
h6: {
|
|
47
43
|
fontSize: 14,
|
|
48
44
|
fontWeight: 500,
|
|
49
|
-
lineHeight: 1.
|
|
50
|
-
letterSpacing: '0'
|
|
45
|
+
lineHeight: 1.313,
|
|
46
|
+
letterSpacing: '0.1px'
|
|
51
47
|
},
|
|
52
48
|
subtitle1: {
|
|
53
49
|
fontSize: 14,
|
|
54
50
|
fontWeight: 500,
|
|
55
|
-
lineHeight: 1.
|
|
56
|
-
letterSpacing: '0.
|
|
51
|
+
lineHeight: 1.358,
|
|
52
|
+
letterSpacing: '0.1px'
|
|
57
53
|
},
|
|
58
54
|
subtitle2: {
|
|
59
55
|
fontSize: 14,
|
|
60
56
|
fontWeight: 600,
|
|
61
|
-
lineHeight: 1.
|
|
57
|
+
lineHeight: 1.334,
|
|
62
58
|
letterSpacing: '0.25px'
|
|
63
59
|
},
|
|
64
60
|
body1: {
|
|
65
61
|
fontSize: 16,
|
|
66
62
|
fontWeight: 400,
|
|
67
|
-
lineHeight: 1.
|
|
63
|
+
lineHeight: 1.313,
|
|
68
64
|
letterSpacing: '-0.15px'
|
|
69
65
|
},
|
|
70
66
|
body2: {
|
|
71
67
|
fontSize: 14,
|
|
72
|
-
fontWeight:
|
|
73
|
-
lineHeight: 1.
|
|
68
|
+
fontWeight: 500,
|
|
69
|
+
lineHeight: 1.313,
|
|
74
70
|
letterSpacing: '0.25px'
|
|
75
71
|
},
|
|
76
72
|
button: {
|
|
77
|
-
fontSize: 14,
|
|
78
|
-
fontWeight: 500,
|
|
79
|
-
lineHeight: 1.429,
|
|
80
|
-
textTransform: 'none',
|
|
81
|
-
letterSpacing: '0.1px'
|
|
82
|
-
},
|
|
83
|
-
buttonLarge: {
|
|
84
73
|
fontSize: 16,
|
|
85
74
|
fontWeight: 500,
|
|
86
|
-
lineHeight: 1.
|
|
87
|
-
textTransform: '
|
|
88
|
-
letterSpacing: '0.15px'
|
|
89
|
-
},
|
|
90
|
-
buttonSmall: {
|
|
91
|
-
fontSize: 11,
|
|
92
|
-
fontWeight: 500,
|
|
93
|
-
lineHeight: 1.455,
|
|
94
|
-
textTransform: 'none',
|
|
95
|
-
letterSpacing: '0.5px'
|
|
75
|
+
lineHeight: 1.313,
|
|
76
|
+
textTransform: 'inherit'
|
|
96
77
|
},
|
|
97
78
|
caption: {
|
|
98
79
|
fontSize: 12,
|
|
99
80
|
fontWeight: 500,
|
|
100
|
-
lineHeight: 1.
|
|
81
|
+
lineHeight: 1.313,
|
|
101
82
|
letterSpacing: '0.5px'
|
|
102
83
|
},
|
|
103
84
|
overline: {
|
|
104
85
|
fontSize: 11,
|
|
105
86
|
fontWeight: 500,
|
|
106
|
-
lineHeight:
|
|
107
|
-
letterSpacing: '0.
|
|
108
|
-
textTransform: '
|
|
87
|
+
lineHeight: '16px',
|
|
88
|
+
letterSpacing: '0.5px',
|
|
89
|
+
textTransform: 'inherit'
|
|
109
90
|
}
|
|
110
91
|
};
|
|
111
92
|
};
|
package/dist/lib/palette.json
CHANGED
package/dist/lib/types.d.ts
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import { TypographyVariantsOptions } from '@mui/material/styles';
|
|
2
|
+
export interface CommonColor {
|
|
3
|
+
white: string;
|
|
4
|
+
black: string;
|
|
5
|
+
}
|
|
2
6
|
export interface PaletteColor {
|
|
3
7
|
50: string;
|
|
4
8
|
100: string;
|
|
@@ -33,7 +37,6 @@ export interface GreyPalette {
|
|
|
33
37
|
export interface TextPalette {
|
|
34
38
|
primary: string;
|
|
35
39
|
secondary: string;
|
|
36
|
-
secondaryContainer: string;
|
|
37
40
|
disabled: string;
|
|
38
41
|
hint: string;
|
|
39
42
|
icon: string;
|
|
@@ -64,6 +67,7 @@ export interface PaletteJson {
|
|
|
64
67
|
Success: PaletteColor;
|
|
65
68
|
Info: Omit<PaletteColor, 'ContrastText'>;
|
|
66
69
|
Grey: GreyPalette;
|
|
70
|
+
Common: CommonColor;
|
|
67
71
|
}
|
|
68
72
|
export type TypographyOptions = TypographyVariantsOptions;
|
|
69
73
|
declare module '@mui/material/TextField' {
|
|
@@ -96,8 +100,6 @@ export interface TypographyVariants {
|
|
|
96
100
|
body1: TypographyConfig;
|
|
97
101
|
body2: TypographyConfig;
|
|
98
102
|
button: TypographyConfig;
|
|
99
|
-
buttonLarge: TypographyConfig;
|
|
100
|
-
buttonSmall: TypographyConfig;
|
|
101
103
|
caption: TypographyConfig;
|
|
102
104
|
overline: TypographyConfig;
|
|
103
105
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Accordion } from '@mui/material';
|
|
2
|
+
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
3
|
+
declare const meta: Meta<typeof Accordion>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof Accordion>;
|
|
6
|
+
export declare const Docs: Story;
|
|
7
|
+
export declare const Screenshot: Story;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Accordion, AccordionDetails, AccordionSummary, Stack, Typography } from '@mui/material';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
const meta = {
|
|
4
|
+
title: 'Accordion',
|
|
5
|
+
component: Accordion,
|
|
6
|
+
parameters: { layout: 'centered' },
|
|
7
|
+
tags: ['autodocs']
|
|
8
|
+
};
|
|
9
|
+
export default meta;
|
|
10
|
+
const AccordionGroup = () => (React.createElement(Stack, { spacing: 2, sx: { width: 400 } },
|
|
11
|
+
React.createElement(Accordion, null,
|
|
12
|
+
React.createElement(AccordionSummary, null, "Click to expand/collapse the first item"),
|
|
13
|
+
React.createElement(AccordionDetails, null,
|
|
14
|
+
React.createElement(Typography, null, "Lorem ipsum dolor sit amet consectetur"))),
|
|
15
|
+
React.createElement(Accordion, null,
|
|
16
|
+
React.createElement(AccordionSummary, null, "Click to expand/collapse the second item"),
|
|
17
|
+
React.createElement(AccordionDetails, null,
|
|
18
|
+
React.createElement(Typography, null, "Lorem ipsum dolor sit amet consectetur"))),
|
|
19
|
+
React.createElement(Accordion, null,
|
|
20
|
+
React.createElement(AccordionSummary, null, "Click to expand/collapse the third item"),
|
|
21
|
+
React.createElement(AccordionDetails, null,
|
|
22
|
+
React.createElement(Typography, null, "Lorem ipsum dolor sit amet consectetur")))));
|
|
23
|
+
export const Docs = {
|
|
24
|
+
render: () => React.createElement(AccordionGroup, null)
|
|
25
|
+
};
|
|
26
|
+
export const Screenshot = {
|
|
27
|
+
tags: ['argos'],
|
|
28
|
+
render: () => React.createElement(AccordionGroup, null)
|
|
29
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Fab } from '@mui/material';
|
|
2
|
+
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
3
|
+
declare const meta: Meta<typeof Fab>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof Fab>;
|
|
6
|
+
export declare const Docs: Story;
|
|
7
|
+
export declare const Screenshot: Story;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { Icon, Plus } from '@linagora/twake-icons';
|
|
2
|
+
import { Fab, Stack } from '@mui/material';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
const meta = {
|
|
5
|
+
title: 'Fab',
|
|
6
|
+
component: Fab,
|
|
7
|
+
parameters: { layout: 'centered' },
|
|
8
|
+
tags: ['autodocs']
|
|
9
|
+
};
|
|
10
|
+
export default meta;
|
|
11
|
+
export const Docs = {
|
|
12
|
+
argTypes: {
|
|
13
|
+
color: {
|
|
14
|
+
control: 'select',
|
|
15
|
+
options: ['default', 'primary', 'secondary', 'inherit']
|
|
16
|
+
},
|
|
17
|
+
size: { control: 'select', options: ['small', 'medium', 'large'] },
|
|
18
|
+
variant: { control: 'select', options: ['circular', 'extended'] }
|
|
19
|
+
},
|
|
20
|
+
render: ({ color = 'primary', size = 'medium', variant = 'circular' }) => (React.createElement(Fab, { sx: { gap: 1 }, color: color, size: size, variant: variant },
|
|
21
|
+
React.createElement(Icon, { icon: Plus }),
|
|
22
|
+
variant === 'extended' && React.createElement(React.Fragment, null, "Extended")))
|
|
23
|
+
};
|
|
24
|
+
export const Screenshot = {
|
|
25
|
+
tags: ['argos'],
|
|
26
|
+
render: () => (React.createElement(Stack, { spacing: 4, sx: { p: 4 } },
|
|
27
|
+
React.createElement("section", null,
|
|
28
|
+
React.createElement("h3", null, "Default"),
|
|
29
|
+
React.createElement(Stack, { spacing: 2, direction: "row" },
|
|
30
|
+
React.createElement(Fab, { color: "primary", size: "small" },
|
|
31
|
+
React.createElement(Icon, { icon: Plus })),
|
|
32
|
+
React.createElement(Fab, { color: "primary", size: "medium" },
|
|
33
|
+
React.createElement(Icon, { icon: Plus })),
|
|
34
|
+
React.createElement(Fab, { color: "primary", size: "large" },
|
|
35
|
+
React.createElement(Icon, { icon: Plus }))),
|
|
36
|
+
React.createElement(Stack, { spacing: 2, direction: "row", sx: { mt: 2 } },
|
|
37
|
+
React.createElement(Fab, { color: "inherit", size: "small" },
|
|
38
|
+
React.createElement(Icon, { icon: Plus })),
|
|
39
|
+
React.createElement(Fab, { color: "inherit", size: "medium" },
|
|
40
|
+
React.createElement(Icon, { icon: Plus })),
|
|
41
|
+
React.createElement(Fab, { color: "inherit", size: "large" },
|
|
42
|
+
React.createElement(Icon, { icon: Plus })))),
|
|
43
|
+
React.createElement("section", null,
|
|
44
|
+
React.createElement("h3", null, "Extended"),
|
|
45
|
+
React.createElement(Stack, { spacing: 2, direction: "row" },
|
|
46
|
+
React.createElement(Fab, { sx: { gap: 1 }, color: "primary", size: "small", variant: "extended" },
|
|
47
|
+
React.createElement(Icon, { icon: Plus }),
|
|
48
|
+
" Small"),
|
|
49
|
+
React.createElement(Fab, { sx: { gap: 1 }, color: "primary", size: "medium", variant: "extended" },
|
|
50
|
+
React.createElement(Icon, { icon: Plus }),
|
|
51
|
+
" Medium"),
|
|
52
|
+
React.createElement(Fab, { sx: { gap: 1 }, color: "primary", size: "large", variant: "extended" },
|
|
53
|
+
React.createElement(Icon, { icon: Plus }),
|
|
54
|
+
" Large")),
|
|
55
|
+
React.createElement(Stack, { spacing: 2, direction: "row", sx: { mt: 2 } },
|
|
56
|
+
React.createElement(Fab, { sx: { gap: 1 }, color: "inherit", size: "small", variant: "extended" },
|
|
57
|
+
React.createElement(Icon, { icon: Plus }),
|
|
58
|
+
" Small"),
|
|
59
|
+
React.createElement(Fab, { sx: { gap: 1 }, color: "inherit", size: "medium", variant: "extended" },
|
|
60
|
+
React.createElement(Icon, { icon: Plus }),
|
|
61
|
+
" Medium"),
|
|
62
|
+
React.createElement(Fab, { sx: { gap: 1 }, color: "inherit", size: "large", variant: "extended" },
|
|
63
|
+
React.createElement(Icon, { icon: Plus }),
|
|
64
|
+
" Large"))),
|
|
65
|
+
React.createElement("section", null,
|
|
66
|
+
React.createElement("h3", null, "Disabled"),
|
|
67
|
+
React.createElement(Stack, { spacing: 2, direction: "row" },
|
|
68
|
+
React.createElement(Fab, { color: "primary", disabled: true },
|
|
69
|
+
React.createElement(Icon, { icon: Plus })),
|
|
70
|
+
React.createElement(Fab, { color: "inherit", disabled: true },
|
|
71
|
+
React.createElement(Icon, { icon: Plus })),
|
|
72
|
+
React.createElement(Fab, { color: "primary", disabled: true, variant: "extended" }, "Extended")))))
|
|
73
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Tooltip } from '@mui/material';
|
|
2
|
+
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
3
|
+
declare const meta: Meta<typeof Tooltip>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof Tooltip>;
|
|
6
|
+
export declare const Docs: Story;
|
|
7
|
+
export declare const Screenshot: Story;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { Tooltip, Typography } from '@mui/material';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
const meta = {
|
|
4
|
+
title: 'Tooltip',
|
|
5
|
+
component: Tooltip,
|
|
6
|
+
parameters: { layout: 'centered' },
|
|
7
|
+
tags: ['autodocs']
|
|
8
|
+
};
|
|
9
|
+
export default meta;
|
|
10
|
+
export const Docs = {
|
|
11
|
+
argTypes: {
|
|
12
|
+
placement: {
|
|
13
|
+
control: 'select',
|
|
14
|
+
options: [
|
|
15
|
+
'top',
|
|
16
|
+
'bottom',
|
|
17
|
+
'left',
|
|
18
|
+
'right',
|
|
19
|
+
'top-start',
|
|
20
|
+
'top-end',
|
|
21
|
+
'bottom-start',
|
|
22
|
+
'bottom-end'
|
|
23
|
+
]
|
|
24
|
+
},
|
|
25
|
+
arrow: { control: 'boolean' }
|
|
26
|
+
},
|
|
27
|
+
args: {
|
|
28
|
+
title: (React.createElement(React.Fragment, null,
|
|
29
|
+
React.createElement(Typography, { variant: "body1", color: "inherit" }, "Carbon copy"),
|
|
30
|
+
React.createElement(Typography, { variant: "caption", color: "inherit" }, "Indicates whether the document is defined as \u201Cauthentic and original\u201D"))),
|
|
31
|
+
children: React.createElement("u", null, "hover over me")
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
export const Screenshot = {
|
|
35
|
+
tags: ['argos'],
|
|
36
|
+
render: () => (React.createElement("div", { style: { padding: 48 } },
|
|
37
|
+
React.createElement(Tooltip, { open: true, title: React.createElement(React.Fragment, null,
|
|
38
|
+
React.createElement(Typography, { variant: "body1", color: "inherit" }, "Carbon copy"),
|
|
39
|
+
React.createElement(Typography, { variant: "caption", color: "inherit" }, "Indicates whether the document is defined as \u201Cauthentic and original\u201D")) },
|
|
40
|
+
React.createElement("u", null, "hover over me"))))
|
|
41
|
+
};
|
|
@@ -36,6 +36,8 @@ export const Screenshot = {
|
|
|
36
36
|
React.createElement("section", null,
|
|
37
37
|
React.createElement("h3", { style: { marginBottom: '12px', marginTop: '24px' } }, "Colors"),
|
|
38
38
|
React.createElement(Stack, { spacing: 1 },
|
|
39
|
+
React.createElement("div", { style: { color: 'blue' } },
|
|
40
|
+
React.createElement(Typography, { color: "inherit" }, "Inherit color text")),
|
|
39
41
|
React.createElement(Typography, { color: "primary" }, "Primary color text"),
|
|
40
42
|
React.createElement(Typography, { color: "secondary" }, "Secondary color text"),
|
|
41
43
|
React.createElement(Typography, { color: "success" }, "Success color text"),
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@linagora/twake-mui",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "4.1.0",
|
|
5
5
|
"description": "MUI v9 theme system for Twake applications",
|
|
6
6
|
"author": "Twake",
|
|
7
7
|
"license": "MIT",
|
|
@@ -50,6 +50,7 @@
|
|
|
50
50
|
"peerDependencies": {
|
|
51
51
|
"@emotion/react": "^11.5.0",
|
|
52
52
|
"@emotion/styled": "^11.3.0",
|
|
53
|
+
"@linagora/twake-icons": "2.8.0",
|
|
53
54
|
"@mui/lab": "^9.0.0-beta.6",
|
|
54
55
|
"@mui/material": "^9.2.0",
|
|
55
56
|
"react": "^18",
|
|
@@ -60,6 +61,7 @@
|
|
|
60
61
|
"@argos-ci/storybook": "5.3.2",
|
|
61
62
|
"@emotion/react": "^11.5.0",
|
|
62
63
|
"@emotion/styled": "^11.3.0",
|
|
64
|
+
"@linagora/twake-icons": "2.8.0",
|
|
63
65
|
"@mui/icons-material": "^9.2.0",
|
|
64
66
|
"@mui/lab": "^9.0.0-beta.6",
|
|
65
67
|
"@mui/material": "^9.2.0",
|
|
@@ -69,6 +71,8 @@
|
|
|
69
71
|
"@storybook/react": "10.3.5",
|
|
70
72
|
"@storybook/react-vite": "10.3.5",
|
|
71
73
|
"@types/lodash": "4.17.24",
|
|
74
|
+
"@types/react": "18.2.0",
|
|
75
|
+
"@types/react-dom": "^18.2.0",
|
|
72
76
|
"@vitest/browser-playwright": "4.1.5",
|
|
73
77
|
"cozy-tsconfig": "^2.0.0",
|
|
74
78
|
"eslint": "10.2.1",
|