@graphcommerce/next-ui 4.22.0 → 4.23.0

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,18 @@
1
1
  # Change Log
2
2
 
3
+ ## 4.23.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#1620](https://github.com/graphcommerce-org/graphcommerce/pull/1620) [`755d2cf83`](https://github.com/graphcommerce-org/graphcommerce/commit/755d2cf83343a5ad3d61063eff595d821de360aa) Thanks [@ErwinOtten](https://github.com/ErwinOtten)! - Add spacing feature to navItems
8
+
9
+ * [#1618](https://github.com/graphcommerce-org/graphcommerce/pull/1618) [`dc7f2dda4`](https://github.com/graphcommerce-org/graphcommerce/commit/dc7f2dda40ff8572fc11161de6eb62ca13e720dd) Thanks [@ErwinOtten](https://github.com/ErwinOtten)! - Remove prefetch from navigation links
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies []:
14
+ - @graphcommerce/framer-scroller@2.1.34
15
+
3
16
  ## 4.22.0
4
17
 
5
18
  ### Minor Changes
@@ -151,7 +151,7 @@ export const NavigationItem = React.memo<NavigationItemProps>((props) => {
151
151
  const { name, href } = props
152
152
  return (
153
153
  <NavigationLI sx={[hideItem && { display: 'none' }]} className={classes.li}>
154
- <PageLink href={href} passHref>
154
+ <PageLink href={href} passHref prefetch={false}>
155
155
  <ListItemButton
156
156
  className={classes.item}
157
157
  component='a'
@@ -5,6 +5,7 @@ import { Trans } from '@lingui/react'
5
5
  import { Box, Fab, SxProps, Theme, useEventCallback, useMediaQuery } from '@mui/material'
6
6
  import { m, useMotionValue } from 'framer-motion'
7
7
  import React, { startTransition, useEffect, useRef, useState } from 'react'
8
+ import type { LiteralUnion } from 'type-fest'
8
9
  import { IconSvg, useIconSvgSize } from '../../IconSvg'
9
10
  import { LayoutHeaderContent } from '../../Layout/components/LayoutHeaderContent'
10
11
  import { LayoutTitle } from '../../Layout/components/LayoutTitle'
@@ -27,6 +28,7 @@ import { NavigationList } from './NavigationList'
27
28
  type LayoutOverlayVariant = 'left' | 'bottom' | 'right'
28
29
  type LayoutOverlaySize = 'floating' | 'minimal' | 'full'
29
30
  type LayoutOverlayAlign = 'start' | 'end' | 'center' | 'stretch'
31
+ type ItemPadding = LiteralUnion<keyof Theme['spacings'], string | number>
30
32
 
31
33
  type NavigationOverlayProps = {
32
34
  sx?: SxProps<Theme>
@@ -39,6 +41,7 @@ type NavigationOverlayProps = {
39
41
  justifyMd?: LayoutOverlayAlign
40
42
  itemWidthSm?: string
41
43
  itemWidthMd?: string
44
+ itemPadding?: ItemPadding
42
45
  } & mouseEventPref
43
46
 
44
47
  function findCurrent(
@@ -82,6 +85,7 @@ export const NavigationOverlay = React.memo<NavigationOverlayProps>((props) => {
82
85
  itemWidthSm,
83
86
  itemWidthMd,
84
87
  mouseEvent,
88
+ itemPadding = 'md',
85
89
  } = props
86
90
  const { selection, items, animating, closing } = useNavigation()
87
91
 
@@ -227,13 +231,17 @@ export const NavigationOverlay = React.memo<NavigationOverlayProps>((props) => {
227
231
  '& .NavigationItem-item': {
228
232
  width:
229
233
  sizeSm !== 'floating'
230
- ? `calc(${itemWidthSm || '100vw'} - ${theme.spacings.md} - ${
231
- theme.spacings.md
232
- } + ${selectedLevel}px)`
233
- : `calc(${itemWidthSm || '100vw'} - ${theme.spacings.md} - ${
234
- theme.spacings.md
235
- } - ${theme.page.horizontal} - ${theme.page.horizontal})`,
236
- minWidth: `calc(${200}px - ${theme.spacings.md} - ${theme.spacings.md})`,
234
+ ? `calc(${itemWidthSm || '100vw'} - ${
235
+ theme.spacings[itemPadding] ?? itemPadding
236
+ } - ${theme.spacings[itemPadding] ?? itemPadding} + ${selectedLevel}px)`
237
+ : `calc(${itemWidthSm || '100vw'} - ${
238
+ theme.spacings[itemPadding] ?? itemPadding
239
+ } - ${theme.spacings[itemPadding] ?? itemPadding} - ${
240
+ theme.page.horizontal
241
+ } - ${theme.page.horizontal})`,
242
+ minWidth: `calc(${200}px - ${theme.spacings[itemPadding] ?? itemPadding} - ${
243
+ theme.spacings[itemPadding] ?? itemPadding
244
+ })`,
237
245
  },
238
246
  },
239
247
  })}
@@ -242,7 +250,7 @@ export const NavigationOverlay = React.memo<NavigationOverlayProps>((props) => {
242
250
  className={classes.navigation}
243
251
  sx={[
244
252
  (theme) => ({
245
- py: theme.spacings.md,
253
+ py: theme.spacings[itemPadding] ?? itemPadding,
246
254
  display: 'grid',
247
255
  gridAutoFlow: 'column',
248
256
  scrollSnapAlign: 'end',
@@ -254,11 +262,11 @@ export const NavigationOverlay = React.memo<NavigationOverlayProps>((props) => {
254
262
  },
255
263
  '& .Navigation-column': {},
256
264
  '& .NavigationItem-item': {
257
- mx: theme.spacings.md,
265
+ mx: theme.spacings[itemPadding] ?? itemPadding,
258
266
  whiteSpace: 'nowrap',
259
267
  },
260
268
  '& .NavigationItem-item.first': {
261
- // mt: theme.spacings.md,
269
+ // mt: paddingMd,
262
270
  },
263
271
  '& .Navigation-column:first-of-type': {
264
272
  boxShadow: 'none',
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.22.0",
5
+ "version": "4.23.0",
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.9.3",
22
22
  "@graphcommerce/framer-next-pages": "3.3.0",
23
- "@graphcommerce/framer-scroller": "2.1.33",
23
+ "@graphcommerce/framer-scroller": "2.1.34",
24
24
  "@graphcommerce/framer-utils": "3.2.0",
25
25
  "@graphcommerce/image": "3.1.9",
26
26
  "cookie": "^0.5.0",