@graphcommerce/next-ui 4.7.1 → 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/CHANGELOG.md CHANGED
@@ -1,5 +1,49 @@
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
+
3
47
  ## 4.7.1
4
48
 
5
49
  ### Patch Changes
@@ -1,5 +1,5 @@
1
1
  import { useUp, usePrevUp, usePageContext } from '@graphcommerce/framer-next-pages'
2
- import { t } from '@lingui/macro'
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 = t`Back`
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,4 +1,4 @@
1
- import { Trans } from '@lingui/macro'
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>Ok</Trans>
18
+ <Trans id='Ok' />
19
19
  </Button>
20
20
  )
21
21
  }
@@ -1,4 +1,4 @@
1
- import { Trans } from '@lingui/macro'
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 *just* wan't a single theme, use the import { ThemeProvider } from '@mui/material' instead.
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>Switch to Dark Mode</Trans>
112
+ <Trans id='Switch to Dark Mode' />
113
113
  ) : (
114
- <Trans>Switch to Light Mode</Trans>
114
+ <Trans id='Switch to Light Mode' />
115
115
  )}
116
116
  </ListItemText>
117
117
  </ListItemButton>
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.7.1",
5
+ "version": "4.7.2",
6
6
  "author": "",
7
7
  "license": "MIT",
8
8
  "sideEffects": false,
@@ -20,7 +20,7 @@
20
20
  "@emotion/server": "^11.4.0",
21
21
  "@emotion/styled": "^11.6.0",
22
22
  "@graphcommerce/framer-next-pages": "3.2.1",
23
- "@graphcommerce/framer-scroller": "2.1.9",
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/macro": "^3.13.2",
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.6",
41
+ "@graphcommerce/eslint-config-pwa": "^4.1.7",
41
42
  "@graphcommerce/prettier-config-pwa": "^4.0.6",
42
- "@graphcommerce/typescript-config-pwa": "^4.0.2",
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",