@graphcommerce/next-ui 9.0.0-canary.77 → 9.0.0-canary.79
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,21 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
+
## 9.0.0-canary.79
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#2356](https://github.com/graphcommerce-org/graphcommerce/pull/2356) [`d283901`](https://github.com/graphcommerce-org/graphcommerce/commit/d283901cb537c3e7bf6f5500e9f52f47f452cf10) - Loading an overlay page directly would animate in the overlay instead of directly showing it. ([@paales](https://github.com/paales))
|
|
8
|
+
|
|
9
|
+
## 9.0.0-canary.78
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [#2354](https://github.com/graphcommerce-org/graphcommerce/pull/2354) [`7cd5c1c`](https://github.com/graphcommerce-org/graphcommerce/commit/7cd5c1cadf8dac43de9e5bb19038383be64aa08f) - Fix issues when using non-hex colors in theme ([@bramvanderholst](https://github.com/bramvanderholst))
|
|
14
|
+
|
|
15
|
+
- [#2354](https://github.com/graphcommerce-org/graphcommerce/pull/2354) [`7c10458`](https://github.com/graphcommerce-org/graphcommerce/commit/7c104588ef96b9066b8f91835c29f957b08e4831) - Fix back button transparency on hover ([@bramvanderholst](https://github.com/bramvanderholst))
|
|
16
|
+
|
|
17
|
+
- [#2354](https://github.com/graphcommerce-org/graphcommerce/pull/2354) [`1de9582`](https://github.com/graphcommerce-org/graphcommerce/commit/1de9582967f2a09cc7167a38ada4e50fe0d1b29a) - Properly align cart loading state (and other FullPageMessage usages) ([@bramvanderholst](https://github.com/bramvanderholst))
|
|
18
|
+
|
|
3
19
|
## 9.0.0-canary.77
|
|
4
20
|
|
|
5
21
|
## 9.0.0-canary.76
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Direction } from '@graphcommerce/framer-next-pages'
|
|
1
2
|
import { Scroller, useScrollerContext, useScrollTo } from '@graphcommerce/framer-scroller'
|
|
2
3
|
import {
|
|
3
4
|
dvh,
|
|
@@ -46,7 +47,7 @@ export type LayoutOverlayBaseProps = {
|
|
|
46
47
|
sx?: SxProps<Theme>
|
|
47
48
|
sxBackdrop?: SxProps<Theme>
|
|
48
49
|
active: boolean
|
|
49
|
-
direction?:
|
|
50
|
+
direction?: Direction
|
|
50
51
|
onClosed: () => void
|
|
51
52
|
offsetPageY?: number
|
|
52
53
|
isPresent: boolean
|
|
@@ -123,7 +124,8 @@ export function OverlayBase(incomingProps: LayoutOverlayBaseProps) {
|
|
|
123
124
|
props.smSpacingTop ?? ((theme) => `calc(${theme.appShell.headerHeightSm} * 0.5)`)
|
|
124
125
|
)(th)
|
|
125
126
|
|
|
126
|
-
const { scrollerRef, snap, scroll, getScrollSnapPositions, disableSnap } =
|
|
127
|
+
const { scrollerRef, snap, scroll, getScrollSnapPositions, disableSnap, enableSnap } =
|
|
128
|
+
useScrollerContext()
|
|
127
129
|
const scrollTo = useScrollTo()
|
|
128
130
|
|
|
129
131
|
const beforeRef = useRef<HTMLDivElement>(null)
|
|
@@ -137,7 +139,7 @@ export function OverlayBase(incomingProps: LayoutOverlayBaseProps) {
|
|
|
137
139
|
|
|
138
140
|
const match = useMatchMedia()
|
|
139
141
|
const positions = useConstant(() => ({
|
|
140
|
-
open: { x: motionValue(0), y: motionValue(0), visible: motionValue(0) },
|
|
142
|
+
open: { x: motionValue(0), y: motionValue(0), visible: motionValue(direction === 0 ? 1 : 0) },
|
|
141
143
|
closed: { x: motionValue(0), y: motionValue(0) },
|
|
142
144
|
}))
|
|
143
145
|
|
|
@@ -277,17 +279,40 @@ export function OverlayBase(incomingProps: LayoutOverlayBaseProps) {
|
|
|
277
279
|
useIsomorphicLayoutEffect(() => {
|
|
278
280
|
const scroller = scrollerRef.current
|
|
279
281
|
|
|
280
|
-
if (!scroller || !isPresent) return
|
|
282
|
+
if (!scroller || !isPresent || position.get() === OverlayPosition.OPENED) return
|
|
281
283
|
|
|
282
284
|
if (variant() === 'right') document.body.style.overflow = 'hidden'
|
|
283
285
|
|
|
284
|
-
if (
|
|
286
|
+
if (direction === 0) {
|
|
287
|
+
disableSnap()
|
|
288
|
+
scroller.scrollTop = positions.open.y.get()
|
|
289
|
+
scroller.scrollLeft = positions.open.x.get()
|
|
290
|
+
scroll.y.set(positions.open.y.get())
|
|
291
|
+
scroll.x.set(positions.open.x.get())
|
|
292
|
+
position.set(OverlayPosition.OPENED)
|
|
293
|
+
enableSnap()
|
|
294
|
+
} else if (!scroll.animating.get()) {
|
|
285
295
|
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
|
286
296
|
scrollTo(openClosePositions().open, { stopAnimationOnScroll: false }).then(() =>
|
|
287
297
|
position.set(OverlayPosition.OPENED),
|
|
288
298
|
)
|
|
289
299
|
}
|
|
290
|
-
}, [
|
|
300
|
+
}, [
|
|
301
|
+
direction,
|
|
302
|
+
disableSnap,
|
|
303
|
+
enableSnap,
|
|
304
|
+
isPresent,
|
|
305
|
+
openClosePositions,
|
|
306
|
+
position,
|
|
307
|
+
positions.open.x,
|
|
308
|
+
positions.open.y,
|
|
309
|
+
scroll.animating,
|
|
310
|
+
scroll.x,
|
|
311
|
+
scroll.y,
|
|
312
|
+
scrollTo,
|
|
313
|
+
scrollerRef,
|
|
314
|
+
variant,
|
|
315
|
+
])
|
|
291
316
|
|
|
292
317
|
// When the overlay is closed by navigating away, we're closing the overlay.
|
|
293
318
|
useEffect(() => {
|
package/Theme/MuiButton.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ComponentsVariants, Theme } from '@mui/material'
|
|
1
|
+
import { ComponentsVariants, Theme, alpha, darken, lighten } from '@mui/material'
|
|
2
2
|
import { responsiveVal } from '../Styles/responsiveVal'
|
|
3
3
|
|
|
4
4
|
declare module '@mui/material/Button/Button' {
|
|
@@ -126,7 +126,15 @@ export const MuiButtonPill: ButtonVariants = [
|
|
|
126
126
|
},
|
|
127
127
|
{
|
|
128
128
|
props: { variant: 'pill', color: 'inherit' },
|
|
129
|
-
style: ({ theme }) => ({
|
|
129
|
+
style: ({ theme }) => ({
|
|
130
|
+
backgroundColor: theme.palette.background.paper,
|
|
131
|
+
'&:hover:not(.Mui-disabled)': {
|
|
132
|
+
backgroundColor:
|
|
133
|
+
theme.palette.mode === 'light'
|
|
134
|
+
? darken(theme.palette.background.default, 0.05)
|
|
135
|
+
: lighten(theme.palette.background.default, 0.2),
|
|
136
|
+
},
|
|
137
|
+
}),
|
|
130
138
|
},
|
|
131
139
|
{
|
|
132
140
|
props: { variant: 'pill', disabled: true },
|
|
@@ -142,7 +150,7 @@ export const MuiButtonInline: ButtonVariants = [
|
|
|
142
150
|
props: { variant: 'inline', color: 'primary' },
|
|
143
151
|
style: ({ theme }) => ({
|
|
144
152
|
color: theme.palette.primary.main,
|
|
145
|
-
'&:hover:not(.Mui-disabled)': { backgroundColor:
|
|
153
|
+
'&:hover:not(.Mui-disabled)': { backgroundColor: alpha(theme.palette.primary.main, 0.19) },
|
|
146
154
|
}),
|
|
147
155
|
},
|
|
148
156
|
{
|
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": "9.0.0-canary.
|
|
5
|
+
"version": "9.0.0-canary.79",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"prettier": "@graphcommerce/prettier-config-pwa",
|
|
8
8
|
"eslintConfig": {
|
|
@@ -26,13 +26,13 @@
|
|
|
26
26
|
"typescript": "5.5.3"
|
|
27
27
|
},
|
|
28
28
|
"peerDependencies": {
|
|
29
|
-
"@graphcommerce/eslint-config-pwa": "^9.0.0-canary.
|
|
30
|
-
"@graphcommerce/framer-next-pages": "^9.0.0-canary.
|
|
31
|
-
"@graphcommerce/framer-scroller": "^9.0.0-canary.
|
|
32
|
-
"@graphcommerce/framer-utils": "^9.0.0-canary.
|
|
33
|
-
"@graphcommerce/image": "^9.0.0-canary.
|
|
34
|
-
"@graphcommerce/prettier-config-pwa": "^9.0.0-canary.
|
|
35
|
-
"@graphcommerce/typescript-config-pwa": "^9.0.0-canary.
|
|
29
|
+
"@graphcommerce/eslint-config-pwa": "^9.0.0-canary.79",
|
|
30
|
+
"@graphcommerce/framer-next-pages": "^9.0.0-canary.79",
|
|
31
|
+
"@graphcommerce/framer-scroller": "^9.0.0-canary.79",
|
|
32
|
+
"@graphcommerce/framer-utils": "^9.0.0-canary.79",
|
|
33
|
+
"@graphcommerce/image": "^9.0.0-canary.79",
|
|
34
|
+
"@graphcommerce/prettier-config-pwa": "^9.0.0-canary.79",
|
|
35
|
+
"@graphcommerce/typescript-config-pwa": "^9.0.0-canary.79",
|
|
36
36
|
"@lingui/core": "^4.2.1",
|
|
37
37
|
"@lingui/macro": "^4.2.1",
|
|
38
38
|
"@lingui/react": "^4.2.1",
|