@graphcommerce/next-ui 11.0.0-canary.56 → 11.0.0-canary.57

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,17 @@
1
1
  # Change Log
2
2
 
3
+ ## 11.0.0-canary.57
4
+
5
+ ### Major Changes
6
+
7
+ - [#2708](https://github.com/graphcommerce-org/graphcommerce/pull/2708) [`28aa653`](https://github.com/graphcommerce-org/graphcommerce/commit/28aa653188ed5dc4a0cc5401ee5149b31858e01d) - **Breaking change:** GraphCommerce imports `motion/react` and requires the `motion` package. In your project, replace the `framer-motion` dependency with `motion` 14 and change the imports from `framer-motion` to `motion/react`. ([@paales](https://github.com/paales))
8
+
9
+ - [#2708](https://github.com/graphcommerce-org/graphcommerce/pull/2708) [`cb36d6c`](https://github.com/graphcommerce-org/graphcommerce/commit/cb36d6c219e067ffe2fb2e847a8ff84e8f87a5e8) - **Breaking change:** GraphCommerce requires Lingui 6 and Node.js 22.19 or later. Lingui 6 has no `@lingui/macro` package: import the JSX macros from `@lingui/react/macro`. The `lingui-next` config excludes `.d.ts` files and `node_modules` outside the working directory too. ([@paales](https://github.com/paales))
10
+
11
+ ### Patch Changes
12
+
13
+ - [#2708](https://github.com/graphcommerce-org/graphcommerce/pull/2708) [`1c97bc6`](https://github.com/graphcommerce-org/graphcommerce/commit/1c97bc6d6d01e80d98fe70e595b06804be2ba905) - Uses `@googlemaps/js-api-loader` 2, `cookie` 2, `fetch-retry` 6, `web-vitals` 6 and `schema-dts` 2. `usePlacesAutocomplete` loads the Places library with `setOptions` and `importLibrary`. ([@paales](https://github.com/paales))
14
+
3
15
  ## 11.0.0-canary.56
4
16
 
5
17
  ## 11.0.0-canary.55
@@ -14,7 +14,7 @@ import { sidebarGallery } from '@graphcommerce/next-config/config'
14
14
  import { sxx } from '@graphcommerce/next-ui'
15
15
  import type { SxProps, Theme } from '@mui/material'
16
16
  import { Box, Fab, styled, Unstable_TrapFocus as TrapFocus, useTheme } from '@mui/material'
17
- import { m, useDomEvent, useMotionValue } from 'framer-motion'
17
+ import { m, useDomEvent, useMotionValue } from 'motion/react'
18
18
  import { useRouter } from 'next/router'
19
19
  import React, { useCallback, useEffect, useRef } from 'react'
20
20
  import { iconChevronLeft, iconChevronRight, iconFullscreen, iconFullscreenExit } from '../icons'
@@ -2,8 +2,8 @@ import { useMotionValueValue } from '@graphcommerce/framer-utils'
2
2
  import { sxx } from '@graphcommerce/next-ui'
3
3
  import type { SxProps, Theme } from '@mui/material'
4
4
  import { Box, styled } from '@mui/material'
5
- import type { LayoutProps } from 'framer-motion'
6
- import { m } from 'framer-motion'
5
+ import type { MotionNodeLayoutOptions } from 'motion/react'
6
+ import { m } from 'motion/react'
7
7
  import React, { useRef } from 'react'
8
8
  import { Container } from '../../Container/Container'
9
9
  import { extendableComponent } from '../../Styles'
@@ -20,10 +20,10 @@ export type LayoutHeaderContentProps = FloatingProps & {
20
20
  switchPoint?: number
21
21
  sx?: SxProps<Theme>
22
22
  sxBg?: SxProps<Theme>
23
- layout?: LayoutProps['layout']
23
+ layout?: MotionNodeLayoutOptions['layout']
24
24
  size?: 'small' | 'responsive'
25
25
  bgColor?: 'paper' | 'default'
26
- } & Pick<LayoutProps, 'layout' | 'layoutDependency'>
26
+ } & Pick<MotionNodeLayoutOptions, 'layout' | 'layoutDependency'>
27
27
 
28
28
  type OwnerState = {
29
29
  floatingSm: boolean
package/Layout/types.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { MotionValue } from 'framer-motion'
1
+ import type { MotionValue } from 'motion/react'
2
2
 
3
3
  export type LayoutContext = {
4
4
  scroll: MotionValue<number>
@@ -3,7 +3,7 @@ import { dvh } from '@graphcommerce/framer-utils'
3
3
  import { sxx } from '@graphcommerce/next-ui'
4
4
  import type { SxProps, Theme } from '@mui/material'
5
5
  import { Box } from '@mui/material'
6
- import { useScroll, useTransform } from 'framer-motion'
6
+ import { useScroll, useTransform } from 'motion/react'
7
7
  import { Container } from '../../Container/Container'
8
8
  import { LayoutProvider } from '../../Layout/components/LayoutProvider'
9
9
  import { SkipLink } from '../../SkipLink/SkipLink'
@@ -11,8 +11,8 @@ import { extendableComponent } from '../../Styles'
11
11
  import { useFabSize } from '../../Theme'
12
12
 
13
13
  /**
14
- * @deprecated Import `LayoutDefaultProps` from your project's
15
- * `components/Layout/LayoutDefault.tsx` instead.
14
+ * @deprecated Import `LayoutDefaultProps` from your project's `components/Layout/LayoutDefault.tsx`
15
+ * instead.
16
16
  */
17
17
  export type LayoutDefaultProps = {
18
18
  className?: string
@@ -36,8 +36,8 @@ const { withState } = extendableComponent<OwnerState, 'LayoutDefault', typeof pa
36
36
  )
37
37
 
38
38
  /**
39
- * @deprecated Import `LayoutDefault` from your project's
40
- * `components/Layout/LayoutDefault.tsx` instead.
39
+ * @deprecated Import `LayoutDefault` from your project's `components/Layout/LayoutDefault.tsx`
40
+ * instead.
41
41
  */
42
42
  export function LayoutDefault(props: LayoutDefaultProps) {
43
43
  const {
@@ -2,7 +2,7 @@ import { useGo, usePageContext, useScrollOffset } from '@graphcommerce/framer-ne
2
2
  import { ScrollerProvider } from '@graphcommerce/framer-scroller'
3
3
  import { useMotionValueValue } from '@graphcommerce/framer-utils'
4
4
  import { useEventCallback } from '@mui/material'
5
- import { usePresence } from 'framer-motion'
5
+ import { usePresence } from 'motion/react'
6
6
  import type { SetOptional } from 'type-fest'
7
7
  import type { LayoutOverlayBaseProps } from '../../Overlay/components/OverlayBase'
8
8
  import { OverlayBase } from '../../Overlay/components/OverlayBase'
@@ -2,7 +2,7 @@ import { useMotionValueValue } from '@graphcommerce/framer-utils'
2
2
  import { sxx } from '@graphcommerce/next-ui'
3
3
  import type { FabProps, MenuProps as MenuPropsType, SxProps, Theme } from '@mui/material'
4
4
  import { Box, Divider, Fab, ListItem, Menu, styled } from '@mui/material'
5
- import { m } from 'framer-motion'
5
+ import { m } from 'motion/react'
6
6
  import { useRouter } from 'next/router'
7
7
  import React, { useEffect } from 'react'
8
8
  import { iconClose, iconMenu } from '../icons'
@@ -1,4 +1,4 @@
1
- import { useTransform } from 'framer-motion'
1
+ import { useTransform } from 'motion/react'
2
2
  import { useScrollY } from '../Layout/hooks/useScrollY'
3
3
 
4
4
  export function useFabAnimation() {
@@ -2,7 +2,7 @@ import { useMotionValueValue } from '@graphcommerce/framer-utils'
2
2
  import { sxx } from '@graphcommerce/next-ui'
3
3
  import type { FabProps, SxProps, Theme } from '@mui/material'
4
4
  import { Box, Fab, styled, useTheme } from '@mui/material'
5
- import { m } from 'framer-motion'
5
+ import { m } from 'motion/react'
6
6
  import { useRouter } from 'next/router'
7
7
  import React, { useEffect } from 'react'
8
8
  import { iconClose, iconMenu } from '../../icons'
@@ -1,7 +1,7 @@
1
1
  // @vitest-environment happy-dom
2
2
 
3
3
  import { createTheme, ThemeProvider } from '@mui/material'
4
- import { motionValue } from 'framer-motion'
4
+ import { motionValue } from 'motion/react'
5
5
  import type React from 'react'
6
6
  import { act } from 'react'
7
7
  import { createRoot } from 'react-dom/client'
@@ -3,7 +3,7 @@ import { sxx } from '@graphcommerce/next-ui'
3
3
  import { t } from '@lingui/core/macro'
4
4
  import type { SxProps, Theme } from '@mui/material'
5
5
  import { Box, Fab, styled, useEventCallback, useTheme } from '@mui/material'
6
- import { m } from 'framer-motion'
6
+ import { m } from 'motion/react'
7
7
  import React, { useEffect, useRef } from 'react'
8
8
  import type { LiteralUnion } from 'type-fest'
9
9
  import { useMatchMedia } from '../../hooks'
@@ -1,5 +1,5 @@
1
1
  import { useMotionValueValue } from '@graphcommerce/framer-utils'
2
- import { MotionConfig, useMotionValue } from 'framer-motion'
2
+ import { MotionConfig, useMotionValue } from 'motion/react'
3
3
  import React, { useMemo } from 'react'
4
4
  import { isElement } from 'react-is'
5
5
  import { LazyHydrate } from '../../LazyHydrate'
@@ -1,5 +1,5 @@
1
- import type { MotionValue } from 'framer-motion'
2
- import { useMotionValue } from 'framer-motion'
1
+ import type { MotionValue } from 'motion/react'
2
+ import { useMotionValue } from 'motion/react'
3
3
  import type React from 'react'
4
4
  import { createContext, useContext } from 'react'
5
5
 
@@ -1,6 +1,6 @@
1
1
  import { ScrollerProvider } from '@graphcommerce/framer-scroller'
2
2
  import { Portal } from '@mui/material'
3
- import { AnimatePresence, usePresence } from 'framer-motion'
3
+ import { AnimatePresence, usePresence } from 'motion/react'
4
4
  import type { SetOptional } from 'type-fest'
5
5
  import { variantsToScrollSnapType } from '../utils/variantsToScrollSnapType'
6
6
  import type { LayoutOverlayBaseProps } from './OverlayBase'
@@ -10,7 +10,7 @@ import {
10
10
  import { sxx } from '@graphcommerce/next-ui'
11
11
  import type { SxProps, Theme } from '@mui/material'
12
12
  import { Box, styled, useTheme, useThemeProps } from '@mui/material'
13
- import type { MotionProps } from 'framer-motion'
13
+ import type { MotionProps } from 'motion/react'
14
14
  import {
15
15
  m,
16
16
  motionValue,
@@ -18,7 +18,7 @@ import {
18
18
  useMotionValue,
19
19
  useMotionValueEvent,
20
20
  useTransform,
21
- } from 'framer-motion'
21
+ } from 'motion/react'
22
22
  import React, { useCallback, useEffect, useRef } from 'react'
23
23
  import { useMatchMedia } from '../../hooks/useMatchMedia'
24
24
  import { LayoutProvider } from '../../Layout/components/LayoutProvider'
@@ -1,7 +1,7 @@
1
1
  import { sxx } from '@graphcommerce/next-ui'
2
2
  import type { SxProps, Theme } from '@mui/material'
3
3
  import { styled } from '@mui/material'
4
- import { m, useTransform } from 'framer-motion'
4
+ import { m, useTransform } from 'motion/react'
5
5
  import { useScrollY } from '../../Layout'
6
6
 
7
7
  const MotionDiv = styled(m.div)({})
@@ -1,4 +1,4 @@
1
- import { useMotionValue } from 'framer-motion'
1
+ import { useMotionValue } from 'motion/react'
2
2
  import type React from 'react'
3
3
  import { useEffect } from 'react'
4
4
 
@@ -1,6 +1,6 @@
1
1
  import { GlobalStyles } from '@mui/material'
2
- import type { FeatureBundle } from 'framer-motion'
3
- import { LazyMotion } from 'framer-motion'
2
+ import type { FeatureBundle } from 'motion/react'
3
+ import { LazyMotion } from 'motion/react'
4
4
  import { startTransition, useEffect, useState } from 'react'
5
5
  import type { EmotionProviderProps } from '../Styles/EmotionProvider'
6
6
  import { EmotionProvider } from '../Styles/EmotionProvider'
@@ -9,7 +9,7 @@ import { EmotionProvider } from '../Styles/EmotionProvider'
9
9
  const noFeatures = {} as FeatureBundle
10
10
 
11
11
  /**
12
- * Loads framer-motion's features after hydration and applies them in a transition, so the resulting
12
+ * Loads Motion's features after hydration and applies them in a transition, so the resulting
13
13
  * re-render of all `m` components is time-sliced instead of one blocking task, and the features
14
14
  * stay out of the startup bundle.
15
15
  */
@@ -26,10 +26,10 @@ function useFramerFeatures() {
26
26
  export type CssAndFramerMotionProviderProps = EmotionProviderProps
27
27
 
28
28
  /**
29
- * For [@emotion/core](https://emotion.sh/docs/introduction) and
30
- * [framer-motion](https://www.framer.com/motion/) to work they need to have a provider.
29
+ * For [@emotion/core](https://emotion.sh/docs/introduction) and [Motion](https://motion.dev/) to
30
+ * work they need to have a provider.
31
31
  *
32
- * - Wrapps the app to lazily load framer-motion.
32
+ * - Wrapps the app to lazily load Motion.
33
33
  * - Wrapps the app to have Emotion CSS styles
34
34
  */
35
35
  export function CssAndFramerMotionProvider(props: CssAndFramerMotionProviderProps) {
@@ -1,4 +1,4 @@
1
1
  // features.js
2
- import { domMax } from 'framer-motion'
2
+ import { domMax } from 'motion/react'
3
3
 
4
4
  export default domMax
@@ -1,6 +1,6 @@
1
1
  import type { LinearProgressProps } from '@mui/material'
2
2
  import { LinearProgress } from '@mui/material'
3
- import { m, motionValue, useTransform } from 'framer-motion'
3
+ import { m, motionValue, useTransform } from 'motion/react'
4
4
  import { useRouter } from 'next/router'
5
5
  import { forwardRef, useEffect, useState } from 'react'
6
6
 
@@ -1,6 +1,6 @@
1
1
  import type { Breakpoint } from '@mui/material'
2
2
  import { useTheme } from '@mui/material'
3
- import { useMotionValue } from 'framer-motion'
3
+ import { useMotionValue } from 'motion/react'
4
4
  import { useEffect, useMemo } from 'react'
5
5
 
6
6
  export function useMatchMediaMotionValue(
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": "11.0.0-canary.56",
5
+ "version": "11.0.0-canary.57",
6
6
  "sideEffects": false,
7
7
  "prettier": "@graphcommerce/prettier-config-pwa",
8
8
  "eslintConfig": {
@@ -31,31 +31,30 @@
31
31
  "./proxy": "./proxy.ts"
32
32
  },
33
33
  "dependencies": {
34
- "cookie": "^1.1.1",
35
- "react-is": "^19.2.0"
34
+ "cookie": "^2.0.1",
35
+ "react-is": "^19.3.1"
36
36
  },
37
37
  "devDependencies": {
38
- "@types/react-is": "^19.2.0",
39
- "typescript": "5.9.3"
38
+ "@types/react-is": "^19.3.0",
39
+ "typescript": "6.0.3"
40
40
  },
41
41
  "peerDependencies": {
42
42
  "@emotion/cache": "^11.14.0",
43
43
  "@emotion/react": "^11.14.0",
44
44
  "@emotion/server": "^11.11.0",
45
45
  "@emotion/styled": "^11.14.1",
46
- "@graphcommerce/eslint-config-pwa": "^11.0.0-canary.56",
47
- "@graphcommerce/framer-next-pages": "^11.0.0-canary.56",
48
- "@graphcommerce/framer-scroller": "^11.0.0-canary.56",
49
- "@graphcommerce/framer-utils": "^11.0.0-canary.56",
50
- "@graphcommerce/image": "^11.0.0-canary.56",
51
- "@graphcommerce/prettier-config-pwa": "^11.0.0-canary.56",
52
- "@graphcommerce/typescript-config-pwa": "^11.0.0-canary.56",
53
- "@lingui/core": "^5",
54
- "@lingui/macro": "^5",
55
- "@lingui/react": "^5",
56
- "@mui/lab": "7.0.1-beta.20",
46
+ "@graphcommerce/eslint-config-pwa": "^11.0.0-canary.57",
47
+ "@graphcommerce/framer-next-pages": "^11.0.0-canary.57",
48
+ "@graphcommerce/framer-scroller": "^11.0.0-canary.57",
49
+ "@graphcommerce/framer-utils": "^11.0.0-canary.57",
50
+ "@graphcommerce/image": "^11.0.0-canary.57",
51
+ "@graphcommerce/prettier-config-pwa": "^11.0.0-canary.57",
52
+ "@graphcommerce/typescript-config-pwa": "^11.0.0-canary.57",
53
+ "@lingui/core": "^6",
54
+ "@lingui/react": "^6",
55
+ "@mui/lab": "7.0.1-beta.25",
57
56
  "@mui/material": "^7.0.0",
58
- "framer-motion": "^11.0.0",
57
+ "motion": "^14.0.0",
59
58
  "next": "*",
60
59
  "next-sitemap": "4.2.3",
61
60
  "react": "^19.2.0",
package/utils/cookie.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { useMotionValueValue } from '@graphcommerce/framer-utils'
2
2
  import type { SerializeOptions } from 'cookie'
3
- import { parse, serialize } from 'cookie'
4
- import { motionValue } from 'framer-motion'
3
+ import { parseCookie, stringifySetCookie } from 'cookie'
4
+ import { motionValue } from 'motion/react'
5
5
  import { useSyncExternalStore } from 'react'
6
6
  import { useIsSSR } from '../hooks'
7
7
 
@@ -20,14 +20,14 @@ export function cookie(name?: string, value?: string | null, options?: Serialize
20
20
  if (typeof window === 'undefined') return undefined
21
21
 
22
22
  // Read all cookies
23
- if (typeof name === 'undefined') return parse(document.cookie)
23
+ if (typeof name === 'undefined') return parseCookie(document.cookie)
24
24
 
25
25
  // Read a cookie
26
- if (typeof value === 'undefined') return parse(document.cookie)[name]
26
+ if (typeof value === 'undefined') return parseCookie(document.cookie)[name]
27
27
 
28
28
  // Set a cookie
29
29
  if (typeof value === 'string') {
30
- const serialized = serialize(name, value, { path: '/', maxAge: 31536000, ...options })
30
+ const serialized = stringifySetCookie({ name, value, path: '/', maxAge: 31536000, ...options })
31
31
  document.cookie = serialized
32
32
  cookieNotify.set(cookieNotify.get() + 1)
33
33
  return undefined
@@ -35,7 +35,7 @@ export function cookie(name?: string, value?: string | null, options?: Serialize
35
35
 
36
36
  // Delete a cookie
37
37
  if (value === null) {
38
- const serialized = serialize(name, '', { path: '/', maxAge: 0 })
38
+ const serialized = stringifySetCookie({ name, value: '', path: '/', maxAge: 0 })
39
39
  document.cookie = serialized
40
40
  cookieNotify.set(cookieNotify.get() + 1)
41
41
  return undefined