@linagora/twake-mui 6.0.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 +21 -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/makeTheme.js +4 -4
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,24 @@
|
|
|
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
|
+
|
|
1
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)
|
|
2
23
|
|
|
3
24
|
|
|
@@ -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';
|
package/dist/lib/makeTheme.js
CHANGED