@linagora/twake-mui 5.2.0 → 7.0.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 +37 -0
- package/dist/hooks/useBreakpoints.d.ts +7 -0
- package/dist/hooks/useBreakpoints.js +7 -0
- package/dist/hooks/useBreakpoints.stories.d.ts +5 -0
- package/dist/hooks/useBreakpoints.stories.js +32 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1 -0
- package/dist/lib/lightOverrides.js +0 -94
- package/dist/lib/makeTheme.js +4 -4
- package/dist/lib/types.d.ts +0 -10
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,40 @@
|
|
|
1
|
+
# @linagora/twake-mui [7.0.0](https://github.com/linagora/twake-ui/compare/@linagora/twake-mui@6.0.0...@linagora/twake-mui@7.0.0) (2026-09-08)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **theme:** Align breakpoint values on cozy-ui bounds ([0fb7dd0](https://github.com/linagora/twake-ui/commit/0fb7dd0bb73e845cb2c62ea1c45f28016c2f9a31))
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* Add useBreakpoints hook ([f7780d5](https://github.com/linagora/twake-ui/commit/f7780d5d2fbb194752688c54ec4421e8b51fa83e))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### BREAKING CHANGES
|
|
15
|
+
|
|
16
|
+
* **theme:** theme.breakpoints.values move from
|
|
17
|
+
{sm:480, md:768, lg:1023, xl:1200} to {sm:544, md:769, lg:1024,
|
|
18
|
+
xl:1201}. Consumers calling breakpoints.up/down/between keep the same
|
|
19
|
+
call sites but resolve at the cozy-ui thresholds. down('sm') now
|
|
20
|
+
covers up to 543px instead of 479px.
|
|
21
|
+
|
|
22
|
+
# @linagora/twake-mui [6.0.0](https://github.com/linagora/twake-ui/compare/@linagora/twake-mui@5.2.0...@linagora/twake-mui@6.0.0) (2026-09-08)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
### Features
|
|
26
|
+
|
|
27
|
+
* **twake-mui:** Drop app-specific overrides from the theme ([b67cec4](https://github.com/linagora/twake-ui/commit/b67cec4bd20ebc9c04d998966e0f8c00c72830e1))
|
|
28
|
+
* **twake-mui:** Remove inert rules from light overrides ([d50595c](https://github.com/linagora/twake-ui/commit/d50595c35ac30e6e2a32be74a0cde5b45798cc44))
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
### BREAKING CHANGES
|
|
32
|
+
|
|
33
|
+
* **twake-mui:** Custom style for `Popover`, `Backdrop`,
|
|
34
|
+
`SwipeableDrawer` and `ListItem inside Accordion` has been
|
|
35
|
+
removed
|
|
36
|
+
* **twake-mui:** size="large" no longer typechecks on TextField and InputBase.
|
|
37
|
+
|
|
1
38
|
# @linagora/twake-mui [5.2.0](https://github.com/linagora/twake-ui/compare/@linagora/twake-mui@5.1.1...@linagora/twake-mui@5.2.0) (2026-09-08)
|
|
2
39
|
|
|
3
40
|
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { useMediaQuery } from '@mui/material';
|
|
2
|
+
export const useBreakpoints = () => ({
|
|
3
|
+
isMobile: useMediaQuery(theme => theme.breakpoints.down('md')),
|
|
4
|
+
isTablet: useMediaQuery(theme => theme.breakpoints.between('md', 'lg')),
|
|
5
|
+
isDesktop: useMediaQuery(theme => theme.breakpoints.up('lg')),
|
|
6
|
+
isExtraLarge: useMediaQuery(theme => theme.breakpoints.up('xl'))
|
|
7
|
+
});
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Box, Chip, Stack, Typography, useTheme } from '@mui/material';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { useBreakpoints } from './useBreakpoints';
|
|
4
|
+
const meta = {
|
|
5
|
+
title: 'Hooks/useBreakpoints',
|
|
6
|
+
parameters: { layout: 'padded' },
|
|
7
|
+
tags: ['autodocs']
|
|
8
|
+
};
|
|
9
|
+
export default meta;
|
|
10
|
+
const expectedRanges = {
|
|
11
|
+
isMobile: '0 – 768',
|
|
12
|
+
isTablet: '769 – 1023',
|
|
13
|
+
isDesktop: '1024 – ∞',
|
|
14
|
+
isExtraLarge: '1201 – ∞'
|
|
15
|
+
};
|
|
16
|
+
const BreakpointsTable = () => {
|
|
17
|
+
const theme = useTheme();
|
|
18
|
+
const breakpoints = useBreakpoints();
|
|
19
|
+
return (React.createElement(Stack, { spacing: 2 },
|
|
20
|
+
React.createElement(Typography, { variant: "body2" },
|
|
21
|
+
"Valeurs du th\u00E8me : ",
|
|
22
|
+
JSON.stringify(theme.breakpoints.values)),
|
|
23
|
+
Object.entries(breakpoints).map(([key, isActive]) => (React.createElement(Stack, { key: key, direction: "row", spacing: 2, sx: { alignItems: 'center' } },
|
|
24
|
+
React.createElement(Box, { sx: { width: 140 } },
|
|
25
|
+
React.createElement(Typography, { variant: "body1" }, key)),
|
|
26
|
+
React.createElement(Box, { sx: { width: 120 } },
|
|
27
|
+
React.createElement(Typography, { variant: "body2", color: "text.secondary" }, expectedRanges[key])),
|
|
28
|
+
React.createElement(Chip, { label: String(isActive), color: isActive ? 'success' : 'default', size: "small" }))))));
|
|
29
|
+
};
|
|
30
|
+
export const Default = {
|
|
31
|
+
render: () => React.createElement(BreakpointsTable, null)
|
|
32
|
+
};
|
package/dist/index.d.ts
CHANGED
|
@@ -10,6 +10,8 @@ export { Avatar, default as AvatarDefault } from './components/Avatar';
|
|
|
10
10
|
export { default as Chip } from './components/Chip';
|
|
11
11
|
export { nameToColor, supportedColors } from './components/Avatar/helpers';
|
|
12
12
|
export { default as AccordionExpandIcon } from './components/AccordionExpandIcon';
|
|
13
|
+
export { useBreakpoints } from './hooks/useBreakpoints';
|
|
13
14
|
export type { TwakeTheme } from './lib/theme';
|
|
14
15
|
export type { AvatarProps } from './components/Avatar';
|
|
15
16
|
export type { ChipProps } from './components/Chip';
|
|
17
|
+
export type { Breakpoints } from './hooks/useBreakpoints';
|
package/dist/index.js
CHANGED
|
@@ -13,3 +13,4 @@ export { Avatar, default as AvatarDefault } from './components/Avatar';
|
|
|
13
13
|
export { default as Chip } from './components/Chip';
|
|
14
14
|
export { nameToColor, supportedColors } from './components/Avatar/helpers';
|
|
15
15
|
export { default as AccordionExpandIcon } from './components/AccordionExpandIcon';
|
|
16
|
+
export { useBreakpoints } from './hooks/useBreakpoints';
|
|
@@ -104,21 +104,6 @@ export const lightOverrides = {
|
|
|
104
104
|
})
|
|
105
105
|
}
|
|
106
106
|
},
|
|
107
|
-
MuiTextField: {
|
|
108
|
-
defaultProps: {
|
|
109
|
-
size: 'medium'
|
|
110
|
-
},
|
|
111
|
-
styleOverrides: {
|
|
112
|
-
root: {
|
|
113
|
-
'& .MuiOutlinedInput-root': {
|
|
114
|
-
borderRadius: radius.sm,
|
|
115
|
-
'& fieldset': {
|
|
116
|
-
borderRadius: radius.sm
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
},
|
|
122
107
|
MuiOutlinedInput: {
|
|
123
108
|
styleOverrides: {
|
|
124
109
|
root: ({ theme }) => ({
|
|
@@ -151,25 +136,6 @@ export const lightOverrides = {
|
|
|
151
136
|
}
|
|
152
137
|
]
|
|
153
138
|
}
|
|
154
|
-
},
|
|
155
|
-
variants: [
|
|
156
|
-
{
|
|
157
|
-
props: { size: 'large' },
|
|
158
|
-
style: {
|
|
159
|
-
'& .MuiOutlinedInput-input': {
|
|
160
|
-
padding: '14px 16px' // Large: 54px height
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
]
|
|
165
|
-
},
|
|
166
|
-
MuiInputBase: {
|
|
167
|
-
styleOverrides: {
|
|
168
|
-
root: {
|
|
169
|
-
'&.MuiInputBase-sizeLarge': {
|
|
170
|
-
fontSize: '16px'
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
139
|
}
|
|
174
140
|
},
|
|
175
141
|
MuiSelect: {
|
|
@@ -261,14 +227,6 @@ export const lightOverrides = {
|
|
|
261
227
|
}
|
|
262
228
|
}
|
|
263
229
|
},
|
|
264
|
-
MuiPopover: {
|
|
265
|
-
styleOverrides: {
|
|
266
|
-
paper: {
|
|
267
|
-
borderRadius: radius.md,
|
|
268
|
-
boxShadow: '0 1px 3px 0 rgba(0, 0, 0, 0.30), 0 4px 8px 3px rgba(0, 0, 0, 0.15)'
|
|
269
|
-
}
|
|
270
|
-
}
|
|
271
|
-
},
|
|
272
230
|
MuiChip: {
|
|
273
231
|
styleOverrides: {
|
|
274
232
|
root: {
|
|
@@ -422,20 +380,6 @@ export const lightOverrides = {
|
|
|
422
380
|
}
|
|
423
381
|
}
|
|
424
382
|
},
|
|
425
|
-
MuiBackdrop: {
|
|
426
|
-
styleOverrides: {
|
|
427
|
-
root: {
|
|
428
|
-
variants: [
|
|
429
|
-
{
|
|
430
|
-
props: { invisible: false },
|
|
431
|
-
style: ({ theme }) => ({
|
|
432
|
-
backgroundColor: alpha(theme.palette.text.primary, theme.palette.action.focusOpacity)
|
|
433
|
-
})
|
|
434
|
-
}
|
|
435
|
-
]
|
|
436
|
-
}
|
|
437
|
-
}
|
|
438
|
-
},
|
|
439
383
|
MuiAccordion: {
|
|
440
384
|
styleOverrides: {
|
|
441
385
|
root: {
|
|
@@ -556,23 +500,6 @@ export const lightOverrides = {
|
|
|
556
500
|
})
|
|
557
501
|
}
|
|
558
502
|
},
|
|
559
|
-
MuiCssBaseline: {
|
|
560
|
-
styleOverrides: theme => ({
|
|
561
|
-
'.MuiAccordion-root .MuiListItem-root': {
|
|
562
|
-
padding: '0',
|
|
563
|
-
borderRadius: '4px',
|
|
564
|
-
'&:hover': {
|
|
565
|
-
backgroundColor: alpha(theme.palette.grey[900], 0.04)
|
|
566
|
-
}
|
|
567
|
-
},
|
|
568
|
-
'.MuiAccordion-root .MuiListItem-root label': {
|
|
569
|
-
fontSize: '14px',
|
|
570
|
-
fontStyle: 'normal',
|
|
571
|
-
fontWeight: 400,
|
|
572
|
-
color: alpha(theme.palette.grey[900], 0.9)
|
|
573
|
-
}
|
|
574
|
-
})
|
|
575
|
-
},
|
|
576
503
|
MuiMenuItem: {
|
|
577
504
|
styleOverrides: {
|
|
578
505
|
root: ({ theme }) => ({
|
|
@@ -589,26 +516,5 @@ export const lightOverrides = {
|
|
|
589
516
|
}
|
|
590
517
|
})
|
|
591
518
|
}
|
|
592
|
-
},
|
|
593
|
-
MuiSwipeableDrawer: {
|
|
594
|
-
defaultProps: {
|
|
595
|
-
sx: theme => ({
|
|
596
|
-
'& .MuiDrawer-paper': {
|
|
597
|
-
borderTopLeftRadius: radius.md,
|
|
598
|
-
borderTopRightRadius: radius.md,
|
|
599
|
-
'&::before': {
|
|
600
|
-
content: '""',
|
|
601
|
-
display: 'block',
|
|
602
|
-
width: '64px',
|
|
603
|
-
height: '4px',
|
|
604
|
-
backgroundColor: theme.palette.action.disabledBackground,
|
|
605
|
-
borderRadius: radius.md,
|
|
606
|
-
margin: '12px auto',
|
|
607
|
-
marginTop: '30px',
|
|
608
|
-
flexShrink: 0
|
|
609
|
-
}
|
|
610
|
-
}
|
|
611
|
-
})
|
|
612
|
-
}
|
|
613
519
|
}
|
|
614
520
|
};
|
package/dist/lib/makeTheme.js
CHANGED
package/dist/lib/types.d.ts
CHANGED
|
@@ -72,16 +72,6 @@ export interface PaletteJson {
|
|
|
72
72
|
Common: CommonColor;
|
|
73
73
|
}
|
|
74
74
|
export type TypographyOptions = TypographyVariantsOptions;
|
|
75
|
-
declare module '@mui/material/TextField' {
|
|
76
|
-
interface TextFieldPropsSizeOverrides {
|
|
77
|
-
large: true;
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
declare module '@mui/material/InputBase' {
|
|
81
|
-
interface InputBasePropsSizeOverrides {
|
|
82
|
-
large: true;
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
75
|
export interface TypographyConfig {
|
|
86
76
|
fontFamily?: string;
|
|
87
77
|
fontSize?: number;
|