@graphcommerce/next-ui 5.1.0-canary.0 → 5.1.0-canary.10

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,62 @@
1
1
  # Change Log
2
2
 
3
+ ## 5.1.0-canary.10
4
+
5
+ ### Patch Changes
6
+
7
+ - [#1760](https://github.com/graphcommerce-org/graphcommerce/pull/1760) [`06a81e661`](https://github.com/graphcommerce-org/graphcommerce/commit/06a81e66144b4d94a1e318c2e26cac8d13aa0eb7) - When you navigate back to an overlay (cart, etc.), it can no longer be closed by dragging or clicking on the backdrop. ([@paales](https://github.com/paales))
8
+
9
+ - [#1760](https://github.com/graphcommerce-org/graphcommerce/pull/1760) [`f1ebaa2ae`](https://github.com/graphcommerce-org/graphcommerce/commit/f1ebaa2aea68fe395fddb1b7dd91624251b1d501) - Navigation received focus making the menu visible while it shouldn't ([@paales](https://github.com/paales))
10
+
11
+ ## 5.1.0-canary.9
12
+
13
+ ## 5.1.0-canary.8
14
+
15
+ ## 5.1.0-canary.7
16
+
17
+ ## 5.1.0-canary.6
18
+
19
+ ## 5.1.0-canary.5
20
+
21
+ ### Patch Changes
22
+
23
+ - [`b1444b933`](https://github.com/graphcommerce-org/graphcommerce/commit/b1444b9336107d3ac111563f9b62a884f1b26a8d) - Bring password reset page more in line with standard forms, add missing translations. ([@paales](https://github.com/paales))
24
+
25
+ - [`c7dc855af`](https://github.com/graphcommerce-org/graphcommerce/commit/c7dc855af5e096a53e17f3b2980b210642270fd5) - Added a spreadVal utility to replace responsiveVal and breakpointVal ([@paales](https://github.com/paales))
26
+
27
+ ## 5.1.0-canary.4
28
+
29
+ ### Patch Changes
30
+
31
+ - [#1755](https://github.com/graphcommerce-org/graphcommerce/pull/1755) [`0025ad80f`](https://github.com/graphcommerce-org/graphcommerce/commit/0025ad80fb82d5d1e6c786bb8b5f39b2456c0932) - Renamed clientSizeCssVar.y/x to dvh(100) and dvw(100) ([@paales](https://github.com/paales))
32
+
33
+ - [#1755](https://github.com/graphcommerce-org/graphcommerce/pull/1755) [`3fcb03b79`](https://github.com/graphcommerce-org/graphcommerce/commit/3fcb03b79ce634650fd982dc36a112dccd37282f) - New props added to LayoutOverlay and Overlay components: `widthSm` and `widthMd` to control the width of the overlay.
34
+
35
+ Defaults to `widthSm = 'max(300px, 80vw)', widthMd = 'max(800px, 50vw)'` ([@paales](https://github.com/paales))
36
+
37
+ - [#1755](https://github.com/graphcommerce-org/graphcommerce/pull/1755) [`f44a05a6c`](https://github.com/graphcommerce-org/graphcommerce/commit/f44a05a6cedadc17e44c87f53cad5f462bc52aba) - Use a singlular useElementScroll and provide ther scroll from the useScrollerContext ([@paales](https://github.com/paales))
38
+
39
+ - [#1755](https://github.com/graphcommerce-org/graphcommerce/pull/1755) [`9de7c6960`](https://github.com/graphcommerce-org/graphcommerce/commit/9de7c6960c7ec7d6d28a670f71ac678c5d3c838f) - The scrollbar was hidden for bottom sheets, while that wasn't necessary ([@paales](https://github.com/paales))
40
+
41
+ ## 5.1.0-canary.3
42
+
43
+ ### Patch Changes
44
+
45
+ - [#1752](https://github.com/graphcommerce-org/graphcommerce/pull/1752) [`2a6a4d9ec`](https://github.com/graphcommerce-org/graphcommerce/commit/2a6a4d9ecfa1b58a66ba9b9d00016d6feda9aa95) - Updated dependencies to latest versions, except for nextjs; Solve tons of peer dependency issues.
46
+
47
+ - Updated the @mui/material package
48
+ - Removed dependencies on react-hook-form-mui and @playwright/test
49
+ - Upgraded dependencies including type-fest and graphql-mesh
50
+ - Solved peer dependency issues ([@paales](https://github.com/paales))
51
+
52
+ ## 5.1.0-canary.2
53
+
54
+ ### Patch Changes
55
+
56
+ - [#1750](https://github.com/graphcommerce-org/graphcommerce/pull/1750) [`3479bc1e2`](https://github.com/graphcommerce-org/graphcommerce/commit/3479bc1e24da0e8a751ee301c59fa5f9755c8559) - show globe icon instead of shopping bag icon for store/language-switcher ([@FrankHarland](https://github.com/FrankHarland))
57
+
58
+ ## 5.1.0-canary.1
59
+
3
60
  ## 5.1.0-canary.0
4
61
 
5
62
  ## 5.0.0
package/Form/Form.tsx CHANGED
@@ -1,6 +1,5 @@
1
1
  import { darken, lighten, styled, Theme } from '@mui/material'
2
2
  import { breakpointVal } from '../Styles/breakpointVal'
3
- import { sx } from '../Theme/themeDefaults'
4
3
 
5
4
  type FormStyleProps = {
6
5
  contained?: boolean
@@ -8,7 +7,7 @@ type FormStyleProps = {
8
7
  }
9
8
 
10
9
  const styles = ({ theme, contained = false, background }: { theme: Theme } & FormStyleProps) =>
11
- sx([
10
+ theme.unstable_sx([
12
11
  {
13
12
  display: 'grid',
14
13
  alignItems: 'center',
@@ -7,7 +7,7 @@ import {
7
7
  ScrollerDots,
8
8
  ScrollerProvider,
9
9
  } from '@graphcommerce/framer-scroller'
10
- import { clientSizeCssVar } from '@graphcommerce/framer-utils'
10
+ import { dvh } from '@graphcommerce/framer-utils'
11
11
  import { Fab, useTheme, Box, styled, SxProps, Theme } from '@mui/material'
12
12
  import { m, useDomEvent, useMotionValue } from 'framer-motion'
13
13
  import { useRouter } from 'next/router'
@@ -160,7 +160,9 @@ export function SidebarGallery(props: SidebarGalleryProps) {
160
160
  width: '100vw',
161
161
  },
162
162
  [theme.breakpoints.up('md')]: {
163
- height: `calc(${clientSizeCssVar.y} - ${theme.appShell.headerHeightMd} - ${theme.spacings.lg})`,
163
+ height: `calc(${dvh(100)} - ${theme.appShell.headerHeightMd} - ${
164
+ theme.spacings.lg
165
+ })`,
164
166
  position: 'sticky',
165
167
  top: theme.appShell.headerHeightMd,
166
168
  },
@@ -169,7 +171,7 @@ export function SidebarGallery(props: SidebarGalleryProps) {
169
171
  position: 'relative',
170
172
  top: 0,
171
173
  marginTop: 0,
172
- paddingTop: clientSizeCssVar.y,
174
+ paddingTop: dvh(100),
173
175
  },
174
176
  ]}
175
177
  onLayoutAnimationComplete={() => {
@@ -1,4 +1,5 @@
1
1
  import { useScrollOffset } from '@graphcommerce/framer-next-pages'
2
+ import { dvh } from '@graphcommerce/framer-utils'
2
3
  import { Box, SxProps, Theme } from '@mui/material'
3
4
  import { useTransform, useScroll } from 'framer-motion'
4
5
  import { LayoutProvider } from '../../Layout/components/LayoutProvider'
@@ -53,7 +54,7 @@ export function LayoutDefault(props: LayoutDefaultProps) {
53
54
  className={`${classes.root} ${className ?? ''}`}
54
55
  sx={[
55
56
  (theme) => ({
56
- minHeight: '100vh',
57
+ minHeight: dvh(100),
57
58
  '@supports (-webkit-touch-callout: none)': {
58
59
  minHeight: '-webkit-fill-available',
59
60
  },
@@ -3,7 +3,14 @@ import { LayoutOverlay, LayoutOverlayProps } from '../components/LayoutOverlay'
3
3
 
4
4
  export type LayoutOverlayState = Omit<
5
5
  LayoutOverlayProps,
6
- 'children' | 'sx' | 'sxBackdrop' | 'mdSpacingTop' | 'smSpacingTop' | 'overlayPaneProps'
6
+ | 'children'
7
+ | 'sx'
8
+ | 'sxBackdrop'
9
+ | 'mdSpacingTop'
10
+ | 'smSpacingTop'
11
+ | 'overlayPaneProps'
12
+ | 'widthMd'
13
+ | 'widthSm'
7
14
  >
8
15
 
9
16
  export function useLayoutState() {
@@ -1,8 +1,4 @@
1
- import {
2
- useMotionValueValue,
3
- useMotionSelector,
4
- clientSizeCssVar,
5
- } from '@graphcommerce/framer-utils'
1
+ import { useMotionValueValue, useMotionSelector, dvw } from '@graphcommerce/framer-utils'
6
2
  import { i18n } from '@lingui/core'
7
3
  import { useTheme, Box, Fab, SxProps, Theme, useEventCallback, styled } from '@mui/material'
8
4
  import { m } from 'framer-motion'
@@ -56,7 +52,7 @@ export const NavigationOverlay = React.memo((props: NavigationOverlayProps) => {
56
52
  justifySm,
57
53
  sizeMd,
58
54
  sizeSm,
59
- itemWidthSm = clientSizeCssVar.x,
55
+ itemWidthSm = dvw(100),
60
56
  itemWidthMd,
61
57
  mouseEvent,
62
58
  itemPadding = 'md',
@@ -105,6 +101,8 @@ export const NavigationOverlay = React.memo((props: NavigationOverlayProps) => {
105
101
  variantMd={variantMd}
106
102
  sizeMd={sizeMd}
107
103
  justifyMd={justifyMd}
104
+ widthMd={false}
105
+ widthSm={false}
108
106
  overlayPaneProps={{
109
107
  layout: true,
110
108
  initial: false,
@@ -1,9 +1,5 @@
1
1
  import { Scroller, useScrollerContext, useScrollTo } from '@graphcommerce/framer-scroller'
2
- import {
3
- clientSizeCssVar,
4
- useElementScroll,
5
- useIsomorphicLayoutEffect,
6
- } from '@graphcommerce/framer-utils'
2
+ import { dvh, dvw, useIsomorphicLayoutEffect } from '@graphcommerce/framer-utils'
7
3
  import { Box, styled, SxProps, Theme, useTheme, useThemeProps } from '@mui/material'
8
4
  import { m, MotionProps, useDomEvent, useMotionValue, useTransform } from 'framer-motion'
9
5
  import React, { useCallback, useEffect, useRef } from 'react'
@@ -41,6 +37,12 @@ export type LayoutOverlayBaseProps = {
41
37
  isPresent: boolean
42
38
  safeToRemove?: (() => void) | null | undefined
43
39
  overlayPaneProps?: MotionProps
40
+
41
+ /* For `variantSm='left|right' */
42
+ widthSm?: string | false
43
+
44
+ /* For `variantMd='left|right' */
45
+ widthMd?: string | false
44
46
  } & StyleProps &
45
47
  OverridableProps
46
48
 
@@ -88,6 +90,8 @@ export function OverlayBase(incommingProps: LayoutOverlayBaseProps) {
88
90
  isPresent,
89
91
  safeToRemove,
90
92
  overlayPaneProps,
93
+ widthMd = 'max(800px, 50vw)',
94
+ widthSm = 'max(300px, 80vw)',
91
95
  } = props
92
96
 
93
97
  const th = useTheme()
@@ -98,7 +102,7 @@ export function OverlayBase(incommingProps: LayoutOverlayBaseProps) {
98
102
  props.smSpacingTop ?? ((theme) => `calc(${theme.appShell.headerHeightSm} * 0.5)`)
99
103
  )(th)
100
104
 
101
- const { scrollerRef, snap } = useScrollerContext()
105
+ const { scrollerRef, snap, scroll } = useScrollerContext()
102
106
  const positions = useOverlayPosition(variantSm, variantMd)
103
107
  const scrollTo = useScrollTo()
104
108
  const beforeRef = useRef<HTMLDivElement>(null)
@@ -109,8 +113,6 @@ export function OverlayBase(incommingProps: LayoutOverlayBaseProps) {
109
113
 
110
114
  const overlayRef = useRef<HTMLDivElement>(null)
111
115
 
112
- const scroll = useElementScroll(scrollerRef)
113
-
114
116
  // When the component is mounted, we need to set the initial position of the overlay.
115
117
  useIsomorphicLayoutEffect(() => {
116
118
  const scroller = scrollerRef.current
@@ -121,22 +123,26 @@ export function OverlayBase(incommingProps: LayoutOverlayBaseProps) {
121
123
 
122
124
  document.body.style.overflow = 'hidden'
123
125
 
124
- if (direction === 1 && position.get() !== OverlayPosition.OPENED) {
125
- scroller.scrollLeft = positions.closed.x.get()
126
- scroller.scrollTop = positions.closed.y.get()
127
- // eslint-disable-next-line @typescript-eslint/no-floating-promises
128
- scrollTo(open).then(() => {
129
- scroller.scrollLeft = positions.open.x.get()
130
- scroller.scrollTop = positions.open.y.get()
126
+ if (position.get() !== OverlayPosition.OPENED) {
127
+ if (direction === 1) {
128
+ scroller.scrollLeft = positions.closed.x.get()
129
+ scroller.scrollTop = positions.closed.y.get()
130
+ // eslint-disable-next-line @typescript-eslint/no-floating-promises
131
+ scrollTo(open).then(() => {
132
+ scroller.scrollLeft = positions.open.x.get()
133
+ scroller.scrollTop = positions.open.y.get()
134
+ position.set(OverlayPosition.OPENED)
135
+ })
136
+ } else {
137
+ scroller.scrollLeft = open.x
138
+ scroller.scrollTop = open.y
131
139
  position.set(OverlayPosition.OPENED)
132
- })
133
- } else {
134
- scroller.scrollLeft = open.x
135
- scroller.scrollTop = open.y
140
+ snap.set(true)
141
+ }
136
142
  }
137
143
 
138
144
  return clearScrollLock
139
- }, [direction, isPresent, position, positions, scrollTo, scrollerRef])
145
+ }, [direction, isPresent, position, positions, scrollTo, scrollerRef, snap])
140
146
 
141
147
  // Make sure the overlay stays open when resizing the window.
142
148
  useEffect(() => {
@@ -228,6 +234,7 @@ export function OverlayBase(incommingProps: LayoutOverlayBaseProps) {
228
234
  return (
229
235
  <>
230
236
  <MotionDiv
237
+ inert={active ? undefined : 'true'}
231
238
  className={classes.backdrop}
232
239
  style={{ opacity: positions.open.visible }}
233
240
  sx={[
@@ -249,9 +256,9 @@ export function OverlayBase(incommingProps: LayoutOverlayBaseProps) {
249
256
  ]}
250
257
  />
251
258
  <Scroller
259
+ inert={active ? undefined : 'true'}
252
260
  className={`${classes.scroller} ${className ?? ''}`}
253
261
  grid={false}
254
- hideScrollbar
255
262
  onClick={onClickAway}
256
263
  sx={[
257
264
  (theme) => ({
@@ -264,7 +271,7 @@ export function OverlayBase(incommingProps: LayoutOverlayBaseProps) {
264
271
  overflow: 'auto',
265
272
  },
266
273
 
267
- height: clientSizeCssVar.y,
274
+ height: dvh(100),
268
275
 
269
276
  [theme.breakpoints.down('md')]: {
270
277
  '&.variantSmLeft': {
@@ -281,7 +288,7 @@ export function OverlayBase(incommingProps: LayoutOverlayBaseProps) {
281
288
  borderTopLeftRadius: theme.shape.borderRadius * 3,
282
289
  borderTopRightRadius: theme.shape.borderRadius * 3,
283
290
  gridTemplate: `"beforeOverlay" "overlay"`,
284
- height: clientSizeCssVar.y,
291
+ height: dvh(100),
285
292
  },
286
293
  },
287
294
  [theme.breakpoints.up('md')]: {
@@ -289,18 +296,22 @@ export function OverlayBase(incommingProps: LayoutOverlayBaseProps) {
289
296
  gridTemplate: `"overlay beforeOverlay"`,
290
297
  borderTopRightRadius: theme.shape.borderRadius * 4,
291
298
  borderBottomRightRadius: theme.shape.borderRadius * 4,
299
+
300
+ '&::-webkit-scrollbar': { display: 'none' },
292
301
  },
293
302
  '&.variantMdRight': {
294
303
  gridTemplate: `"beforeOverlay overlay"`,
295
304
  borderTopLeftRadius: theme.shape.borderRadius * 4,
296
305
  borderBottomLeftRadius: theme.shape.borderRadius * 4,
306
+
307
+ '&::-webkit-scrollbar': { display: 'none' },
297
308
  },
298
309
  '&.variantMdBottom': {
299
310
  borderTopLeftRadius: theme.shape.borderRadius * 4,
300
311
  borderTopRightRadius: theme.shape.borderRadius * 4,
301
312
  [theme.breakpoints.up('md')]: {
302
313
  gridTemplate: `"beforeOverlay" "overlay"`,
303
- height: clientSizeCssVar.y,
314
+ height: dvh(100),
304
315
  },
305
316
  },
306
317
  },
@@ -320,18 +331,18 @@ export function OverlayBase(incommingProps: LayoutOverlayBaseProps) {
320
331
 
321
332
  [theme.breakpoints.down('md')]: {
322
333
  '&.variantSmLeft, &.variantSmRight': {
323
- width: '100vw',
334
+ width: dvh(100),
324
335
  },
325
336
  '&.variantSmBottom': {
326
- height: clientSizeCssVar.y,
337
+ height: dvh(100),
327
338
  },
328
339
  },
329
340
  [theme.breakpoints.up('md')]: {
330
341
  '&.variantMdLeft, &.variantMdRight': {
331
- width: '100vw',
342
+ width: dvw(100),
332
343
  },
333
344
  '&.variantMdBottom': {
334
- height: clientSizeCssVar.y,
345
+ height: dvh(100),
335
346
  },
336
347
  },
337
348
  })}
@@ -385,12 +396,12 @@ export function OverlayBase(incommingProps: LayoutOverlayBaseProps) {
385
396
 
386
397
  [theme.breakpoints.down('md')]: {
387
398
  minWidth: '80vw',
388
- '&:not(.sizeMdFull)': {
399
+ '&:not(.sizeSmFull)': {
389
400
  width: 'auto',
390
401
  },
391
402
 
392
403
  '&.variantSmBottom.sizeSmFull': {
393
- minHeight: `calc(${clientSizeCssVar.y} - ${smSpacingTop})`,
404
+ minHeight: `calc(${dvh(100)} - ${smSpacingTop})`,
394
405
  },
395
406
 
396
407
  '&.variantSmBottom': {
@@ -402,26 +413,30 @@ export function OverlayBase(incommingProps: LayoutOverlayBaseProps) {
402
413
  },
403
414
  '&.variantSmLeft.sizeSmFull': {
404
415
  paddingBottom: '1px',
405
- minHeight: clientSizeCssVar.y,
416
+ minHeight: dvh(100),
406
417
  },
407
418
  '&.variantSmRight.sizeSmFull': {
408
419
  paddingBottom: '1px',
409
- minHeight: clientSizeCssVar.y,
420
+ minHeight: dvh(100),
421
+ },
422
+ '&.variantSmLeft, &.variantSmRight': {
423
+ width: widthSm || undefined,
424
+ maxWidth: dvw(100),
410
425
  },
411
426
  },
412
427
  [theme.breakpoints.up('md')]: {
413
428
  minWidth: '1px',
414
429
 
415
430
  '&.sizeMdFull.variantMdBottom': {
416
- minHeight: `calc(${clientSizeCssVar.y} - ${mdSpacingTop})`,
431
+ minHeight: `calc(${dvh(100)} - ${mdSpacingTop})`,
417
432
  },
418
433
  '&.sizeMdFull.variantMdLeft': {
419
434
  paddingBottom: '1px',
420
- minHeight: clientSizeCssVar.y,
435
+ minHeight: dvh(100),
421
436
  },
422
437
  '&.sizeMdFull.variantMdRight': {
423
438
  paddingBottom: '1px',
424
- minHeight: clientSizeCssVar.y,
439
+ minHeight: dvh(100),
425
440
  },
426
441
 
427
442
  '&.variantMdBottom': {
@@ -429,7 +444,8 @@ export function OverlayBase(incommingProps: LayoutOverlayBaseProps) {
429
444
  borderTopRightRadius: `${theme.shape.borderRadius * 4}px`,
430
445
  },
431
446
  '&.variantMdLeft, &.variantMdRight': {
432
- width: 'max-content',
447
+ width: widthMd || 'max-content',
448
+ maxWidth: dvw(100),
433
449
  },
434
450
 
435
451
  '&.sizeMdFloating': {
@@ -15,7 +15,7 @@ export function useOverlayPosition(
15
15
  variantMd: 'left' | 'bottom' | 'right',
16
16
  ) {
17
17
  const match = useMatchMedia()
18
- const { getScrollSnapPositions, scrollerRef } = useScrollerContext()
18
+ const { getScrollSnapPositions, scrollerRef, scroll } = useScrollerContext()
19
19
  const state = useConstant(() => ({
20
20
  open: {
21
21
  x: motionValue(0),
@@ -28,8 +28,6 @@ export function useOverlayPosition(
28
28
  },
29
29
  }))
30
30
 
31
- const scroll = useElementScroll(scrollerRef)
32
-
33
31
  const variant = useCallback(
34
32
  () => (match.up('md') ? variantMd : variantSm),
35
33
  [match, variantMd, variantSm],
@@ -0,0 +1,11 @@
1
+ import { spreadLinear, spreadVal } from '../spreadVal'
2
+
3
+ it('generates the right spreadVal', () => {
4
+ const s = (val: any) => JSON.stringify(val)
5
+
6
+ expect(s(spreadLinear(15, 18, 'xl'))).toMatchInlineSnapshot(`"[15,15.53,16.2,17.28,18]"`)
7
+ expect(s(spreadLinear(15, 18))).toMatchInlineSnapshot(`"[15,16.31,18,18,18]"`)
8
+
9
+ expect(s(spreadVal(15, 18, 'xl'))).toMatchInlineSnapshot(`"[15,15.09,15.48,16.73,18]"`)
10
+ expect(s(spreadVal(15, 18))).toMatchInlineSnapshot(`"[15,15.57,18,18,18]"`)
11
+ })
package/Styles/index.ts CHANGED
@@ -4,3 +4,4 @@ export * from './extendableComponent'
4
4
  export * from './responsiveVal'
5
5
  export * from './withEmotionCache'
6
6
  export * from './withTheme'
7
+ export * from './spreadVal'
@@ -0,0 +1,49 @@
1
+ import type { Breakpoints } from '@mui/material'
2
+ import { breakpoints } from '../Theme/breakpoints'
3
+
4
+ type Interpolation = (from: number, to: number, t: number) => number
5
+
6
+ const linear: Interpolation = (from, to, t) => (1 - t) * from + t * to
7
+ const easeIn: Interpolation = (from, to, t) => linear(from, to, t * t)
8
+
9
+ export type SpreadValReturn = [xs: number, sm: number, md?: number, lg?: number, xl?: number]
10
+
11
+ export type SpreadVal = (
12
+ from: number,
13
+ to: number,
14
+ until?: 'sm' | 'md' | 'lg' | 'xl',
15
+ ) => SpreadValReturn
16
+
17
+ function spread(
18
+ from: number,
19
+ to: number,
20
+ until: 'sm' | 'md' | 'lg' | 'xl',
21
+ lerp: Interpolation,
22
+ bpValues: Breakpoints['values'] = breakpoints.values,
23
+ ): SpreadValReturn {
24
+ const xs = 320
25
+ const { sm, md, lg, xl } = bpValues
26
+
27
+ const bps = [xs, sm, md, lg, xl]
28
+ const untilIdx = bps.indexOf(bpValues[until])
29
+
30
+ const values = bps.map((bp, itemidx) => {
31
+ if (itemidx > untilIdx) return to
32
+ const val = lerp(from, to, (bp - xs) / (bps[untilIdx] - xs))
33
+ return Math.round(val * 100) / 100
34
+ })
35
+
36
+ return values as SpreadValReturn
37
+ }
38
+
39
+ export const spreadLinear: SpreadVal = (
40
+ from: number,
41
+ to: number,
42
+ until: 'sm' | 'md' | 'lg' | 'xl' = 'md',
43
+ ) => spread(from, to, until, linear)
44
+
45
+ export const spreadVal: SpreadVal = (
46
+ from: number,
47
+ to: number,
48
+ until: 'sm' | 'md' | 'lg' | 'xl' = 'md',
49
+ ) => spread(from, to, until, easeIn)
package/Theme/MuiChip.ts CHANGED
@@ -1,6 +1,5 @@
1
1
  import { ComponentsVariants, darken } from '@mui/material'
2
2
  import { responsiveVal } from '../Styles'
3
- import { sx } from './themeDefaults'
4
3
 
5
4
  declare module '@mui/material/Chip/Chip' {
6
5
  interface ChipPropsSizeOverrides {
@@ -21,32 +20,35 @@ export const MuiChip: ChipVariants = [
21
20
  },
22
21
  {
23
22
  props: { size: 'small' },
24
- style: sx({
25
- typography: 'caption',
26
- }),
23
+ style: ({ theme }) =>
24
+ theme.unstable_sx({
25
+ typography: 'caption',
26
+ }),
27
27
  },
28
28
  {
29
29
  props: { size: 'medium' },
30
- style: sx({
31
- height: responsiveVal(26, 30),
32
- paddingLeft: responsiveVal(3, 6),
33
- paddingRight: responsiveVal(3, 6),
34
- typography: 'caption',
35
- }),
30
+ style: ({ theme }) =>
31
+ theme.unstable_sx({
32
+ height: responsiveVal(26, 30),
33
+ paddingLeft: responsiveVal(3, 6),
34
+ paddingRight: responsiveVal(3, 6),
35
+ typography: 'caption',
36
+ }),
36
37
  },
37
38
  {
38
39
  props: { size: 'responsive' },
39
- style: sx({
40
- height: responsiveVal(32, 40),
41
- paddingLeft: responsiveVal(4, 8),
42
- paddingRight: responsiveVal(4, 8),
43
- borderRadius: '99em',
44
- typography: 'body2',
45
- '& .MuiChip-label': {
46
- paddingLeft: responsiveVal(6, 10),
47
- paddingRight: responsiveVal(6, 10),
48
- },
49
- }),
40
+ style: ({ theme }) =>
41
+ theme.unstable_sx({
42
+ height: responsiveVal(32, 40),
43
+ paddingLeft: responsiveVal(4, 8),
44
+ paddingRight: responsiveVal(4, 8),
45
+ borderRadius: '99em',
46
+ typography: 'body2',
47
+ '& .MuiChip-label': {
48
+ paddingLeft: responsiveVal(6, 10),
49
+ paddingRight: responsiveVal(6, 10),
50
+ },
51
+ }),
50
52
  },
51
53
  {
52
54
  props: { variant: 'outlined' },
@@ -0,0 +1,9 @@
1
+ export const breakpoints = {
2
+ values: {
3
+ xs: 0,
4
+ sm: 600,
5
+ md: 960,
6
+ lg: 1536,
7
+ xl: 1920,
8
+ },
9
+ }
@@ -1,18 +1,10 @@
1
- import { experimental_sx, SxProps, Theme } from '@mui/material'
1
+ import { SxProps, Theme } from '@mui/material'
2
2
  import { Shadows } from '@mui/material/styles/shadows'
3
+ import { spreadVal } from '../Styles/spreadVal'
4
+ import { breakpoints } from './breakpoints'
3
5
 
4
6
  // https://material.io/design/environment/elevation.html#default-elevations
5
7
 
6
- const breakpoints = {
7
- values: {
8
- xs: 0,
9
- sm: 600,
10
- md: 960,
11
- lg: 1536,
12
- xl: 1920,
13
- },
14
- }
15
-
16
8
  const shadows: Shadows = [
17
9
  /* 0 */ 'none',
18
10
  /* 1 */ `0px 0px 1.5px hsl(0deg 0% 0% / 0.15),0px 0.5px 0.6px hsl(0deg 0% 0% / 0.06),0px 1.4px 1.8px -1.5px hsl(0deg 0% 0% / 0.09)`,
@@ -43,7 +35,6 @@ const shadows: Shadows = [
43
35
 
44
36
  export const themeBaseDefaults = {
45
37
  breakpoints,
38
+ spreadVal,
46
39
  shadows,
47
40
  }
48
-
49
- export const sx = (props: SxProps<Theme>) => experimental_sx<Theme>(props)
package/icons/index.ts CHANGED
@@ -14,6 +14,9 @@ export { default as iconChevronBack, default as iconChevronLeft } from './chevro
14
14
  export { default as iconChevronRight } from './chevron-right.svg'
15
15
  export { default as iconChevronUp } from './chevron-up.svg'
16
16
  export { default as iconClose } from './close.svg'
17
+ export { default as iconEye } from './eye.svg'
18
+ export { default as iconEyeClosed } from './eye-closed.svg'
19
+ export { default as iconEyeCrossed } from './eye-crossed.svg'
17
20
  export { default as iconCreditCard, default as iconId } from './credit-card.svg'
18
21
  export { default as iconEllypsis } from './ellypsis.svg'
19
22
  export { default as iconEmail, default as iconEmailOutline } from './envelope-alt.svg'
@@ -39,3 +42,4 @@ export { default as iconSearch } from './search.svg'
39
42
  export { default as iconPhone } from './smartphone.svg'
40
43
  export { default as iconStar } from './star.svg'
41
44
  export { default as iconSun } from './sun.svg'
45
+ export { default as iconLanguage } from './language.svg'
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": "5.1.0-canary.0",
5
+ "version": "5.1.0-canary.10",
6
6
  "author": "",
7
7
  "license": "MIT",
8
8
  "sideEffects": false,
@@ -14,37 +14,34 @@
14
14
  }
15
15
  },
16
16
  "dependencies": {
17
- "@emotion/babel-preset-css-prop": "^11.2.0",
18
- "@emotion/cache": "^11.9.3",
19
- "@emotion/react": "^11.9.3",
17
+ "@emotion/cache": "^11.10.5",
18
+ "@emotion/react": "^11.10.5",
20
19
  "@emotion/server": "^11.4.0",
21
- "@emotion/styled": "^11.9.3",
22
- "@graphcommerce/framer-next-pages": "5.1.0-canary.0",
23
- "@graphcommerce/framer-scroller": "5.1.0-canary.0",
24
- "@graphcommerce/framer-utils": "5.1.0-canary.0",
25
- "@graphcommerce/image": "5.1.0-canary.0",
20
+ "@emotion/styled": "^11.10.5",
21
+ "@graphcommerce/framer-next-pages": "5.1.0-canary.10",
22
+ "@graphcommerce/framer-scroller": "5.1.0-canary.10",
23
+ "@graphcommerce/framer-utils": "5.1.0-canary.10",
24
+ "@graphcommerce/image": "5.1.0-canary.10",
26
25
  "cookie": "^0.5.0",
27
26
  "react-is": "^18.2.0",
28
27
  "schema-dts": "^1.1.0"
29
28
  },
29
+ "devDependencies": {
30
+ "@graphcommerce/eslint-config-pwa": "5.1.0-canary.10",
31
+ "@graphcommerce/prettier-config-pwa": "5.1.0-canary.10",
32
+ "@graphcommerce/typescript-config-pwa": "5.1.0-canary.10",
33
+ "@types/cookie": "^0.5.1",
34
+ "@types/react-is": "^17.0.3",
35
+ "typescript": "4.9.4"
36
+ },
30
37
  "peerDependencies": {
31
38
  "@lingui/core": "^3.13.2",
32
39
  "@lingui/react": "^3.13.2",
33
40
  "@mui/lab": "^5.0.0-alpha.68",
34
- "@mui/material": "5.5.3",
35
- "framer-motion": "^6.2.4",
41
+ "@mui/material": "^5.10.16",
42
+ "framer-motion": "^7.0.0",
36
43
  "next": "^12.1.2",
37
- "react": "^18.0.0",
38
- "react-dom": "^18.0.0"
39
- },
40
- "devDependencies": {
41
- "@graphcommerce/eslint-config-pwa": "^5.1.0-canary.0",
42
- "@graphcommerce/prettier-config-pwa": "^5.1.0-canary.0",
43
- "@graphcommerce/typescript-config-pwa": "^5.1.0-canary.0",
44
- "@playwright/test": "^1.21.1",
45
- "@types/cookie": "^0.5.1",
46
- "@types/react-is": "^17.0.3",
47
- "type-fest": "^2.12.2",
48
- "typescript": "4.7.4"
44
+ "react": "^18.2.0",
45
+ "react-dom": "^18.2.0"
49
46
  }
50
47
  }
package/types.d.ts CHANGED
@@ -7,8 +7,8 @@ import './Theme/createTheme'
7
7
  import 'react'
8
8
 
9
9
  declare module 'react' {
10
- interface IframeHTMLAttributes<T> extends HTMLAttributes<T> {
11
- loading?: 'lazy' | 'eager' | 'auto'
10
+ interface HTMLAttributes<T> extends AriaAttributes, DOMAttributes<T> {
11
+ inert?: 'true'
12
12
  }
13
13
  }
14
14