@graphcommerce/next-ui 4.6.2 → 4.7.2
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/Blog/BlogAuthor/BlogAuthor.tsx +1 -0
- package/CHANGELOG.md +64 -0
- package/Layout/components/LayoutHeaderBack.tsx +2 -2
- package/Row/ButtonLinkList/ButtonLinkList.tsx +35 -16
- package/Row/ButtonLinkList/ButtonLinkListItem.tsx +1 -1
- package/Row/ContentLinks/ContentLinks.tsx +1 -1
- package/Row/IconBlocks/IconBlock.tsx +1 -0
- package/Row/IconBlocks/IconBlocks.tsx +5 -1
- package/Snackbar/ErrorSnackbar.tsx +2 -2
- package/Styles/EmotionProvider.tsx +1 -1
- package/Theme/DarkLightModeThemeProvider.tsx +4 -4
- package/icons/index.ts +1 -0
- package/package.json +7 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,69 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
+
## 4.7.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#1451](https://github.com/graphcommerce-org/graphcommerce/pull/1451) [`f698ff85d`](https://github.com/graphcommerce-org/graphcommerce/commit/f698ff85df6bb0922288471bb3c81856091b8061) Thanks [@paales](https://github.com/paales)! - Removed all occurences of @lingui/macro and moved to @lingui/macro / @lingui/core in preparation to move to swc.
|
|
8
|
+
|
|
9
|
+
Since we've removed @lingui/macro, all occurences need to be replaced with @lingui/core and @lingui/react.
|
|
10
|
+
|
|
11
|
+
All occurences of `<Trans>` and `t` need to be replaced:
|
|
12
|
+
|
|
13
|
+
```tsx
|
|
14
|
+
import { Trans, t } from '@lingui/macro'
|
|
15
|
+
|
|
16
|
+
function MyComponent() {
|
|
17
|
+
const foo = 'bar'
|
|
18
|
+
return (
|
|
19
|
+
<div aria-label={t`Account ${foo}`}>
|
|
20
|
+
<Trans>My Translation {foo}</Trans>
|
|
21
|
+
</div>
|
|
22
|
+
)
|
|
23
|
+
}
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Needs to be replaced with:
|
|
27
|
+
|
|
28
|
+
```tsx
|
|
29
|
+
import { Trans } from '@lingui/react'
|
|
30
|
+
import { i18n } from '@lingui/core'
|
|
31
|
+
|
|
32
|
+
function MyComponent() {
|
|
33
|
+
const foo = 'bar'
|
|
34
|
+
return (
|
|
35
|
+
<div aria-label={i18n._(/* i18n */ `Account {foo}`, { foo })}>
|
|
36
|
+
<Trans key='My Translation {foo}' values={{ foo }}></Trans>
|
|
37
|
+
</div>
|
|
38
|
+
)
|
|
39
|
+
}
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
[More examples for Trans](https://lingui.js.org/ref/macro.html#examples-of-jsx-macros) and [more examples for `t`](https://lingui.js.org/ref/macro.html#examples-of-js-macros)
|
|
43
|
+
|
|
44
|
+
- Updated dependencies [[`f698ff85d`](https://github.com/graphcommerce-org/graphcommerce/commit/f698ff85df6bb0922288471bb3c81856091b8061)]:
|
|
45
|
+
- @graphcommerce/framer-scroller@2.1.10
|
|
46
|
+
|
|
47
|
+
## 4.7.1
|
|
48
|
+
|
|
49
|
+
### Patch Changes
|
|
50
|
+
|
|
51
|
+
- Updated dependencies [[`99600dd09`](https://github.com/graphcommerce-org/graphcommerce/commit/99600dd091980dd9ef335c04d2efac0835c20b2f)]:
|
|
52
|
+
- @graphcommerce/framer-next-pages@3.2.1
|
|
53
|
+
- @graphcommerce/framer-scroller@2.1.9
|
|
54
|
+
|
|
55
|
+
## 4.7.0
|
|
56
|
+
|
|
57
|
+
### Minor Changes
|
|
58
|
+
|
|
59
|
+
- [#1416](https://github.com/graphcommerce-org/graphcommerce/pull/1416) [`f3d06dd83`](https://github.com/graphcommerce-org/graphcommerce/commit/f3d06dd836c9a76412b419d4d2c79bbd0ee92e04) Thanks [@ErwinOtten](https://github.com/ErwinOtten)! - SEO audit
|
|
60
|
+
|
|
61
|
+
### Patch Changes
|
|
62
|
+
|
|
63
|
+
- Updated dependencies [[`f3d06dd83`](https://github.com/graphcommerce-org/graphcommerce/commit/f3d06dd836c9a76412b419d4d2c79bbd0ee92e04)]:
|
|
64
|
+
- @graphcommerce/framer-next-pages@3.2.0
|
|
65
|
+
- @graphcommerce/framer-scroller@2.1.8
|
|
66
|
+
|
|
3
67
|
## 4.6.2
|
|
4
68
|
|
|
5
69
|
### Patch Changes
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useUp, usePrevUp, usePageContext } from '@graphcommerce/framer-next-pages'
|
|
2
|
-
import {
|
|
2
|
+
import { i18n } from '@lingui/core'
|
|
3
3
|
import { Box, SxProps, Theme } from '@mui/material'
|
|
4
4
|
import PageLink from 'next/link'
|
|
5
5
|
import { useRouter } from 'next/router'
|
|
@@ -46,7 +46,7 @@ export function LayoutHeaderBack(props: BackProps) {
|
|
|
46
46
|
const backIcon = <IconSvg src={iconChevronLeft} size='medium' />
|
|
47
47
|
const canClickBack = backSteps > 0 && path !== prevUp?.href
|
|
48
48
|
|
|
49
|
-
let label =
|
|
49
|
+
let label = i18n._(/* i18n */ `Back`)
|
|
50
50
|
if (up?.href === path && up?.title) label = up.title
|
|
51
51
|
if (prevUp?.href === path && prevUp?.title) label = prevUp.title
|
|
52
52
|
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { Box, SxProps, Theme } from '@mui/material'
|
|
1
|
+
import { Box, SxProps, Theme, Typography } from '@mui/material'
|
|
2
2
|
import React from 'react'
|
|
3
|
-
import { SectionContainer } from '../../SectionContainer/SectionContainer'
|
|
4
3
|
import { extendableComponent } from '../../Styles'
|
|
5
4
|
import { responsiveVal } from '../../Styles/responsiveVal'
|
|
6
5
|
import { Row } from '../Row'
|
|
@@ -8,6 +7,7 @@ import { Row } from '../Row'
|
|
|
8
7
|
export type ButtonLinkListProps = {
|
|
9
8
|
title: string
|
|
10
9
|
children: React.ReactNode
|
|
10
|
+
component?: React.ElementType
|
|
11
11
|
sx?: SxProps<Theme>
|
|
12
12
|
} & OwnerState
|
|
13
13
|
|
|
@@ -21,7 +21,7 @@ const { withState } = extendableComponent<OwnerState, typeof compName, typeof pa
|
|
|
21
21
|
)
|
|
22
22
|
|
|
23
23
|
export function ButtonLinkList(props: ButtonLinkListProps) {
|
|
24
|
-
const { title, children, containsBigLinks, sx = [] } = props
|
|
24
|
+
const { title, children, component = 'span', containsBigLinks, sx = [] } = props
|
|
25
25
|
|
|
26
26
|
const classes = withState({ containsBigLinks })
|
|
27
27
|
|
|
@@ -31,20 +31,39 @@ export function ButtonLinkList(props: ButtonLinkListProps) {
|
|
|
31
31
|
className={classes.root}
|
|
32
32
|
sx={[{ maxWidth: 820 }, ...(Array.isArray(sx) ? sx : [sx])]}
|
|
33
33
|
>
|
|
34
|
-
<
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
'&:not(.containsBigLinks)': {
|
|
41
|
-
gridTemplateColumns: `repeat(auto-fill, minmax(${responsiveVal(210, 350)}, 1fr))`,
|
|
34
|
+
<Box
|
|
35
|
+
sx={[
|
|
36
|
+
(theme) => ({
|
|
37
|
+
position: 'relative',
|
|
38
|
+
'&:focus': {
|
|
39
|
+
outline: 'none',
|
|
42
40
|
},
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
41
|
+
display: 'flex',
|
|
42
|
+
justifyContent: 'space-between',
|
|
43
|
+
alignItems: 'center',
|
|
44
|
+
marginTop: theme.spacings.sm,
|
|
45
|
+
marginBottom: theme.spacings.xxs,
|
|
46
|
+
paddingBottom: theme.spacings.xxs,
|
|
47
|
+
borderBottom: `1px solid ${theme.palette.divider}`,
|
|
48
|
+
}),
|
|
49
|
+
]}
|
|
50
|
+
>
|
|
51
|
+
<Typography variant='overline' color='textSecondary' component={component}>
|
|
52
|
+
{title}
|
|
53
|
+
</Typography>
|
|
54
|
+
</Box>
|
|
55
|
+
<Box
|
|
56
|
+
className={classes.links}
|
|
57
|
+
sx={(theme) => ({
|
|
58
|
+
display: 'grid',
|
|
59
|
+
columnGap: theme.spacings.sm,
|
|
60
|
+
'&:not(.containsBigLinks)': {
|
|
61
|
+
gridTemplateColumns: `repeat(auto-fill, minmax(${responsiveVal(210, 350)}, 1fr))`,
|
|
62
|
+
},
|
|
63
|
+
})}
|
|
64
|
+
>
|
|
65
|
+
{children}
|
|
66
|
+
</Box>
|
|
48
67
|
</Row>
|
|
49
68
|
)
|
|
50
69
|
}
|
|
@@ -21,7 +21,7 @@ export function ButtonLinkListItem(props: ButtonLinkListItemProps) {
|
|
|
21
21
|
|
|
22
22
|
return (
|
|
23
23
|
<PageLink href={url} passHref>
|
|
24
|
-
<ButtonItem {...buttonProps} endIcon={endIcon}>
|
|
24
|
+
<ButtonItem {...buttonProps} endIcon={endIcon} LinkComponent='h3'>
|
|
25
25
|
{children}
|
|
26
26
|
</ButtonItem>
|
|
27
27
|
</PageLink>
|
|
@@ -37,7 +37,7 @@ export function ContentLinks(props: ContentLinksProps) {
|
|
|
37
37
|
gridAutoColumns: `max-content`,
|
|
38
38
|
})}
|
|
39
39
|
>
|
|
40
|
-
<Typography variant='subtitle1' component='
|
|
40
|
+
<Typography variant='subtitle1' component='h2' className={classes.title}>
|
|
41
41
|
{title}
|
|
42
42
|
</Typography>
|
|
43
43
|
{children}
|
|
@@ -18,7 +18,11 @@ export function IconBlocks(props: IconBlocksProps) {
|
|
|
18
18
|
const { title, children, sx = [] } = props
|
|
19
19
|
|
|
20
20
|
return (
|
|
21
|
-
<Row
|
|
21
|
+
<Row
|
|
22
|
+
maxWidth='md'
|
|
23
|
+
className={classes.container}
|
|
24
|
+
sx={[{ maxWidth: 820 }, ...(Array.isArray(sx) ? sx : [sx])]}
|
|
25
|
+
>
|
|
22
26
|
<Box className={classes.wrapper} sx={(theme) => ({ paddingTop: `${theme.spacings.lg}` })}>
|
|
23
27
|
<Box
|
|
24
28
|
className={classes.title}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Trans } from '@lingui/
|
|
1
|
+
import { Trans } from '@lingui/react'
|
|
2
2
|
import { Button } from '@mui/material'
|
|
3
3
|
import { MessageSnackbar } from './MessageSnackbar'
|
|
4
4
|
import { MessageSnackbarImplProps } from './MessageSnackbarImpl'
|
|
@@ -15,7 +15,7 @@ export function ErrorSnackbar(props: ErrorSnackbarProps) {
|
|
|
15
15
|
action={
|
|
16
16
|
action ?? (
|
|
17
17
|
<Button size='medium' variant='pill' color='secondary'>
|
|
18
|
-
<Trans
|
|
18
|
+
<Trans id='Ok' />
|
|
19
19
|
</Button>
|
|
20
20
|
)
|
|
21
21
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Trans } from '@lingui/
|
|
1
|
+
import { Trans } from '@lingui/react'
|
|
2
2
|
import {
|
|
3
3
|
Theme,
|
|
4
4
|
ThemeProvider,
|
|
@@ -43,7 +43,7 @@ type ThemeProviderProps = {
|
|
|
43
43
|
* The multi DarkLightModeThemeProvider allows switching between light and dark mode based on URL
|
|
44
44
|
* and on user input.
|
|
45
45
|
*
|
|
46
|
-
* If you
|
|
46
|
+
* If you _just_ wan't a single theme, use the import { ThemeProvider } from '@mui/material' instead.
|
|
47
47
|
*/
|
|
48
48
|
export function DarkLightModeThemeProvider(props: ThemeProviderProps) {
|
|
49
49
|
const { children, light, dark } = props
|
|
@@ -109,9 +109,9 @@ export function DarkLightModeMenuSecondaryItem(props: ListItemButtonProps) {
|
|
|
109
109
|
</ListItemIcon>
|
|
110
110
|
<ListItemText>
|
|
111
111
|
{currentMode === 'light' ? (
|
|
112
|
-
<Trans
|
|
112
|
+
<Trans id='Switch to Dark Mode' />
|
|
113
113
|
) : (
|
|
114
|
-
<Trans
|
|
114
|
+
<Trans id='Switch to Light Mode' />
|
|
115
115
|
)}
|
|
116
116
|
</ListItemText>
|
|
117
117
|
</ListItemButton>
|
package/icons/index.ts
CHANGED
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@graphcommerce/next-ui",
|
|
3
3
|
"homepage": "https://www.graphcommerce.org/",
|
|
4
4
|
"repository": "github:graphcommerce-org/graphcommerce",
|
|
5
|
-
"version": "4.
|
|
5
|
+
"version": "4.7.2",
|
|
6
6
|
"author": "",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"sideEffects": false,
|
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
"@emotion/react": "^11.9.0",
|
|
20
20
|
"@emotion/server": "^11.4.0",
|
|
21
21
|
"@emotion/styled": "^11.6.0",
|
|
22
|
-
"@graphcommerce/framer-next-pages": "3.1
|
|
23
|
-
"@graphcommerce/framer-scroller": "2.1.
|
|
22
|
+
"@graphcommerce/framer-next-pages": "3.2.1",
|
|
23
|
+
"@graphcommerce/framer-scroller": "2.1.10",
|
|
24
24
|
"@graphcommerce/framer-utils": "3.1.2",
|
|
25
25
|
"@graphcommerce/image": "3.1.5",
|
|
26
26
|
"react-is": "^17.0.0",
|
|
@@ -28,7 +28,8 @@
|
|
|
28
28
|
"schema-dts": "^1.1.0"
|
|
29
29
|
},
|
|
30
30
|
"peerDependencies": {
|
|
31
|
-
"@lingui/
|
|
31
|
+
"@lingui/react": "^3.13.2",
|
|
32
|
+
"@lingui/core": "^3.13.2",
|
|
32
33
|
"@mui/lab": "^5.0.0-alpha.68",
|
|
33
34
|
"@mui/material": "5.5.3",
|
|
34
35
|
"framer-motion": "^6.2.4",
|
|
@@ -37,9 +38,9 @@
|
|
|
37
38
|
"react-dom": "^17.0.2"
|
|
38
39
|
},
|
|
39
40
|
"devDependencies": {
|
|
40
|
-
"@graphcommerce/eslint-config-pwa": "^4.1.
|
|
41
|
+
"@graphcommerce/eslint-config-pwa": "^4.1.7",
|
|
41
42
|
"@graphcommerce/prettier-config-pwa": "^4.0.6",
|
|
42
|
-
"@graphcommerce/typescript-config-pwa": "^4.0.
|
|
43
|
+
"@graphcommerce/typescript-config-pwa": "^4.0.3",
|
|
43
44
|
"@playwright/test": "^1.21.1",
|
|
44
45
|
"@types/react-is": "^17.0.3",
|
|
45
46
|
"type-fest": "^2.12.2",
|