@graphcommerce/framer-scroller 10.0.0-canary.66 → 10.0.0-canary.68
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 +10 -0
- package/README.md +2 -2
- package/components/MotionImageAspect.tsx +4 -6
- package/components/Scroller.tsx +2 -1
- package/components/ScrollerBar.tsx +3 -3
- package/components/ScrollerButton.tsx +2 -2
- package/components/ScrollerDot.tsx +1 -1
- package/components/ScrollerDots.tsx +4 -3
- package/components/ScrollerPageCounter.tsx +2 -1
- package/components/ScrollerThumbnail.tsx +6 -6
- package/components/ThumbnailContainer.tsx +5 -6
- package/hooks/usePreventScroll.ts +1 -1
- package/package.json +7 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
+
## 10.0.0-canary.68
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- [#2557](https://github.com/graphcommerce-org/graphcommerce/pull/2557) [`ceaadd8`](https://github.com/graphcommerce-org/graphcommerce/commit/ceaadd87f0648982a068a3b07b1fa149c9127f49) - ## Material UI v5 → v7 Migration
|
|
8
|
+
|
|
9
|
+
This release upgrades Material UI from v5 to v7 with full CSS variables support. ([@paales](https://github.com/paales))
|
|
10
|
+
|
|
11
|
+
## 10.0.0-canary.67
|
|
12
|
+
|
|
3
13
|
## 10.0.0-canary.66
|
|
4
14
|
|
|
5
15
|
## 10.0.0-canary.65
|
package/README.md
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ImageProps } from '@graphcommerce/image'
|
|
2
2
|
import { Image } from '@graphcommerce/image'
|
|
3
|
+
import { sxx } from '@graphcommerce/next-ui'
|
|
3
4
|
import { Box, type BoxProps } from '@mui/material'
|
|
4
5
|
import { m, type MotionProps } from 'framer-motion'
|
|
5
6
|
import { forwardRef } from 'react'
|
|
@@ -31,10 +32,9 @@ export const MotionImageAspect = m.create(
|
|
|
31
32
|
return (
|
|
32
33
|
<Box
|
|
33
34
|
className='MotionImageAspect'
|
|
34
|
-
sx={
|
|
35
|
+
sx={sxx(
|
|
35
36
|
{
|
|
36
37
|
position: 'relative',
|
|
37
|
-
|
|
38
38
|
'& > picture': {
|
|
39
39
|
display: 'block',
|
|
40
40
|
'@supports (aspect-ratio: 1 / 1)': {
|
|
@@ -42,12 +42,10 @@ export const MotionImageAspect = m.create(
|
|
|
42
42
|
maxHeight: '100%',
|
|
43
43
|
width: 'auto',
|
|
44
44
|
height: 'auto',
|
|
45
|
-
|
|
46
45
|
position: 'absolute',
|
|
47
46
|
top: '50%',
|
|
48
47
|
left: '50%',
|
|
49
48
|
transform: 'translate(-50%, -50%)',
|
|
50
|
-
|
|
51
49
|
'&:after': {
|
|
52
50
|
display: 'block',
|
|
53
51
|
content: '""',
|
|
@@ -66,8 +64,8 @@ export const MotionImageAspect = m.create(
|
|
|
66
64
|
},
|
|
67
65
|
},
|
|
68
66
|
},
|
|
69
|
-
|
|
70
|
-
|
|
67
|
+
slotProps?.box?.sx,
|
|
68
|
+
)}
|
|
71
69
|
{...slotProps?.box}
|
|
72
70
|
>
|
|
73
71
|
<Image
|
package/components/Scroller.tsx
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { sxx } from '@graphcommerce/next-ui'
|
|
1
2
|
import type { SxProps, Theme } from '@mui/material'
|
|
2
3
|
import { styled } from '@mui/material'
|
|
3
4
|
import { m } from 'framer-motion'
|
|
@@ -15,7 +16,7 @@ export const Scroller = forwardRef<HTMLDivElement, ScrollableProps & { sx?: SxPr
|
|
|
15
16
|
forwardedRef,
|
|
16
17
|
)
|
|
17
18
|
|
|
18
|
-
return <ScrollerDiv {...scroller} sx={
|
|
19
|
+
return <ScrollerDiv {...scroller} sx={sxx(scroller.sx, sx)} />
|
|
19
20
|
},
|
|
20
21
|
)
|
|
21
22
|
Scroller.displayName = 'Scroller'
|
|
@@ -72,15 +72,15 @@ export function ScrollerBar(props: ScrollerBarProps) {
|
|
|
72
72
|
className={classes.track}
|
|
73
73
|
sx={sx}
|
|
74
74
|
whileHover={{
|
|
75
|
-
backgroundColor: theme.palette.action.selected,
|
|
76
|
-
// borderTop: `1px solid ${theme.palette.action.active}`,
|
|
75
|
+
backgroundColor: theme.vars.palette.action.selected,
|
|
76
|
+
// borderTop: `1px solid ${theme.vars.palette.action.active}`,
|
|
77
77
|
}}
|
|
78
78
|
>
|
|
79
79
|
<Scroll
|
|
80
80
|
className={classes.thumb}
|
|
81
81
|
aria-label='Scroll'
|
|
82
82
|
sx={{
|
|
83
|
-
backgroundColor: theme.palette.action.active,
|
|
83
|
+
backgroundColor: theme.vars.palette.action.active,
|
|
84
84
|
borderRadius: '50px',
|
|
85
85
|
}}
|
|
86
86
|
style={{ [direction]: thumbX, [size]: thumbSize }}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { useMotionValueValue } from '@graphcommerce/framer-utils'
|
|
2
|
+
import { sxx } from '@graphcommerce/next-ui'
|
|
2
3
|
import type { FabProps, SxProps, Theme } from '@mui/material'
|
|
3
4
|
import { Fab, styled } from '@mui/material'
|
|
4
5
|
import { m, useTransform } from 'framer-motion'
|
|
@@ -79,11 +80,10 @@ export const ScrollerButton = m.create(
|
|
|
79
80
|
{...buttonProps}
|
|
80
81
|
onClick={handleClick}
|
|
81
82
|
aria-label={direction}
|
|
82
|
-
sx={
|
|
83
|
+
sx={sxx({ transition: 'all 250ms', ...mode }, sx)}
|
|
83
84
|
/>
|
|
84
85
|
</MotionDiv>
|
|
85
86
|
)
|
|
86
87
|
}),
|
|
87
88
|
)
|
|
88
|
-
|
|
89
89
|
ScrollerButton.displayName = 'ScrollerButton'
|
|
@@ -54,7 +54,7 @@ export function ScrollerDot(props: ScrollerDotProps) {
|
|
|
54
54
|
borderRadius: '99em',
|
|
55
55
|
width: { xs: 6, sm: 8, md: 10 },
|
|
56
56
|
height: { xs: 6, sm: 8, md: 10 },
|
|
57
|
-
background: theme.palette.text.primary,
|
|
57
|
+
background: theme.vars.palette.text.primary,
|
|
58
58
|
})}
|
|
59
59
|
style={{ opacity }}
|
|
60
60
|
/>
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { useMotionValueValue } from '@graphcommerce/framer-utils'
|
|
2
|
+
import { sxx } from '@graphcommerce/next-ui'
|
|
2
3
|
// eslint-disable-next-line import/no-extraneous-dependencies
|
|
3
4
|
import { extendableComponent } from '@graphcommerce/next-ui/Styles'
|
|
4
5
|
import type { FabProps, SxProps, Theme } from '@mui/material'
|
|
@@ -30,7 +31,7 @@ export const ScrollerDots = m.create(
|
|
|
30
31
|
{...containerProps}
|
|
31
32
|
className={classes.root}
|
|
32
33
|
ref={ref}
|
|
33
|
-
sx={
|
|
34
|
+
sx={sxx(
|
|
34
35
|
{
|
|
35
36
|
width: 'fit-content',
|
|
36
37
|
maxWidth: '100%',
|
|
@@ -41,8 +42,8 @@ export const ScrollerDots = m.create(
|
|
|
41
42
|
background: 'transparent',
|
|
42
43
|
display: 'flex',
|
|
43
44
|
},
|
|
44
|
-
|
|
45
|
-
|
|
45
|
+
sx,
|
|
46
|
+
)}
|
|
46
47
|
>
|
|
47
48
|
{itemsArr.map((item, idx) => (
|
|
48
49
|
// eslint-disable-next-line react/no-array-index-key
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { useMotionValueValue } from '@graphcommerce/framer-utils'
|
|
2
|
+
import { sxx } from '@graphcommerce/next-ui'
|
|
2
3
|
import type { SxProps, Theme } from '@mui/material'
|
|
3
4
|
import { styled } from '@mui/material'
|
|
4
5
|
import { m } from 'framer-motion'
|
|
@@ -29,7 +30,7 @@ export const ScrollerPageCounter = React.forwardRef<HTMLDivElement, SliderPageCo
|
|
|
29
30
|
})
|
|
30
31
|
|
|
31
32
|
return (
|
|
32
|
-
<MotionDiv ref={ref} sx={
|
|
33
|
+
<MotionDiv ref={ref} sx={sxx({ typography: 'h4' }, sx)}>
|
|
33
34
|
<span>{String(current).padStart(2, '0')}</span> — {String(count).padStart(2, '0')}
|
|
34
35
|
</MotionDiv>
|
|
35
36
|
)
|
|
@@ -3,7 +3,7 @@ import type { ImageProps } from '@graphcommerce/image'
|
|
|
3
3
|
import { Image } from '@graphcommerce/image'
|
|
4
4
|
// eslint-disable-next-line import/no-extraneous-dependencies
|
|
5
5
|
import { extendableComponent, responsiveVal } from '@graphcommerce/next-ui/Styles'
|
|
6
|
-
import {
|
|
6
|
+
import { styled, useTheme } from '@mui/material'
|
|
7
7
|
import { m, motionValue, useTransform } from 'framer-motion'
|
|
8
8
|
import { useEffect, useRef } from 'react'
|
|
9
9
|
import { useScrollerContext } from '../hooks/useScrollerContext'
|
|
@@ -41,9 +41,9 @@ export function ScrollerThumbnail(props: ScrollerThumbnailProps) {
|
|
|
41
41
|
item.visibility,
|
|
42
42
|
[1, 0],
|
|
43
43
|
[
|
|
44
|
-
`inset 0 0 0 2px ${theme.palette.primary.main}, 0 0 0 4px ${alpha(
|
|
45
|
-
theme.palette.primary.main,
|
|
46
|
-
theme.palette.action.hoverOpacity,
|
|
44
|
+
`inset 0 0 0 2px ${theme.vars.palette.primary.main}, 0 0 0 4px ${theme.alpha(
|
|
45
|
+
theme.vars.palette.primary.main,
|
|
46
|
+
theme.vars.palette.action.hoverOpacity,
|
|
47
47
|
)}`,
|
|
48
48
|
'inset 0 0 0 2px #ffffff00, 0 0 0 4px #ffffff00',
|
|
49
49
|
],
|
|
@@ -85,11 +85,11 @@ export function ScrollerThumbnail(props: ScrollerThumbnailProps) {
|
|
|
85
85
|
layout='position'
|
|
86
86
|
style={{ boxShadow }}
|
|
87
87
|
layoutDependency={layoutDependency}
|
|
88
|
-
sx={{
|
|
88
|
+
sx={(theme) => ({
|
|
89
89
|
padding: '2px',
|
|
90
90
|
mx: `calc(${theme.spacing(1)} / 2)`,
|
|
91
91
|
borderRadius: theme.shape.borderRadius,
|
|
92
|
-
}}
|
|
92
|
+
})}
|
|
93
93
|
>
|
|
94
94
|
<Image
|
|
95
95
|
{...image}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { sxx } from '@graphcommerce/next-ui'
|
|
1
2
|
import type { SxProps, Theme } from '@mui/material'
|
|
2
3
|
import { styled } from '@mui/material'
|
|
3
4
|
import type { PanHandlers } from 'framer-motion'
|
|
@@ -24,7 +25,7 @@ export function ThumbnailContainer(props: ThumbnailContainerProps) {
|
|
|
24
25
|
ref={containerRef}
|
|
25
26
|
onPan={onPan}
|
|
26
27
|
layoutDependency={layoutDependency}
|
|
27
|
-
sx={
|
|
28
|
+
sx={sxx(
|
|
28
29
|
{
|
|
29
30
|
padding: '4px',
|
|
30
31
|
userSelect: 'none',
|
|
@@ -33,12 +34,10 @@ export function ThumbnailContainer(props: ThumbnailContainerProps) {
|
|
|
33
34
|
overflowX: 'auto',
|
|
34
35
|
display: 'flex',
|
|
35
36
|
scrollbarWidth: 'none',
|
|
36
|
-
'&::-webkit-scrollbar': {
|
|
37
|
-
display: 'none',
|
|
38
|
-
},
|
|
37
|
+
'&::-webkit-scrollbar': { display: 'none' },
|
|
39
38
|
},
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
sx,
|
|
40
|
+
)}
|
|
42
41
|
>
|
|
43
42
|
{children}
|
|
44
43
|
</MotionBox>
|
|
@@ -7,7 +7,7 @@ function usePreventScroll(shouldPrevent: boolean) {
|
|
|
7
7
|
|
|
8
8
|
useEffect(() => {
|
|
9
9
|
if (shouldPrevent) {
|
|
10
|
-
const scrollbarSize = getScrollbarSize(
|
|
10
|
+
const scrollbarSize = getScrollbarSize(window)
|
|
11
11
|
|
|
12
12
|
document.body.style.overflow = 'hidden'
|
|
13
13
|
document.body.style.paddingRight = `${scrollbarSize}px`
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@graphcommerce/framer-scroller",
|
|
3
3
|
"homepage": "https://www.graphcommerce.org/",
|
|
4
4
|
"repository": "github:graphcommerce-org/graphcommerce",
|
|
5
|
-
"version": "10.0.0-canary.
|
|
5
|
+
"version": "10.0.0-canary.68",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"scripts": {
|
|
8
8
|
"dev": "tsc -W"
|
|
@@ -21,14 +21,14 @@
|
|
|
21
21
|
"popmotion": "11.0.5"
|
|
22
22
|
},
|
|
23
23
|
"peerDependencies": {
|
|
24
|
-
"@graphcommerce/eslint-config-pwa": "^10.0.0-canary.
|
|
25
|
-
"@graphcommerce/framer-utils": "^10.0.0-canary.
|
|
26
|
-
"@graphcommerce/image": "^10.0.0-canary.
|
|
27
|
-
"@graphcommerce/prettier-config-pwa": "^10.0.0-canary.
|
|
28
|
-
"@graphcommerce/typescript-config-pwa": "^10.0.0-canary.
|
|
24
|
+
"@graphcommerce/eslint-config-pwa": "^10.0.0-canary.68",
|
|
25
|
+
"@graphcommerce/framer-utils": "^10.0.0-canary.68",
|
|
26
|
+
"@graphcommerce/image": "^10.0.0-canary.68",
|
|
27
|
+
"@graphcommerce/prettier-config-pwa": "^10.0.0-canary.68",
|
|
28
|
+
"@graphcommerce/typescript-config-pwa": "^10.0.0-canary.68",
|
|
29
29
|
"@lingui/core": "^5",
|
|
30
30
|
"@lingui/react": "^5",
|
|
31
|
-
"@mui/material": "^
|
|
31
|
+
"@mui/material": "^7.0.0",
|
|
32
32
|
"framer-motion": "^11.0.0",
|
|
33
33
|
"next": "*",
|
|
34
34
|
"react": "^19.2.0",
|