@graphcommerce/next-ui 8.0.5-canary.1 → 8.0.5-canary.3

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,20 @@
1
1
  # Change Log
2
2
 
3
+ ## 8.0.5-canary.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [#2236](https://github.com/graphcommerce-org/graphcommerce/pull/2236) [`85fb916`](https://github.com/graphcommerce-org/graphcommerce/commit/85fb916e5ec2a1456a93a59bf92a5f414fee8595) - Solve issue where the inert prop wouldnt be properly forwarded
8
+ ([@paales](https://github.com/paales))
9
+
10
+ ## 8.0.5-canary.2
11
+
12
+ ### Patch Changes
13
+
14
+ - [#2235](https://github.com/graphcommerce-org/graphcommerce/pull/2235) [`de99691`](https://github.com/graphcommerce-org/graphcommerce/commit/de9969155e271cc2535147479b80b602a1b9c335) - The Lazyhydrate component to accepts any BoxProps. Replaced `<section>` with a `<Box>` so it doesn't hold symantic meaning.
15
+
16
+ Please note: If you've used child selectors to style the section, please make sure you update your styles. ([@carlocarels90](https://github.com/carlocarels90))
17
+
3
18
  ## 8.0.5-canary.1
4
19
 
5
20
  ## 8.0.5-canary.0
@@ -1,9 +1,10 @@
1
+ import { Box, BoxProps } from '@mui/material'
1
2
  import React, { useState, useRef, startTransition, useLayoutEffect, useEffect } from 'react'
2
3
 
3
4
  // Make sure the server doesn't choke on the useLayoutEffect
4
5
  export const useLayoutEffect2 = typeof window !== 'undefined' ? useLayoutEffect : useEffect
5
6
 
6
- export type LazyHydrateProps = {
7
+ export type LazyHydrateProps = BoxProps<'div'> & {
7
8
  /**
8
9
  * The content is always rendered on the server and on the client it uses the server rendered HTML until it is hydrated.
9
10
  */
@@ -25,8 +26,8 @@ export type LazyHydrateProps = {
25
26
  * This can be a way to improve the TBT of a page.
26
27
  */
27
28
  export function LazyHydrate(props: LazyHydrateProps) {
28
- const { hydrated, children } = props
29
- const rootRef = useRef<HTMLElement>(null)
29
+ const { hydrated, children, ...elementProps } = props
30
+ const rootRef = useRef<HTMLDivElement>(null)
30
31
 
31
32
  const [isHydrated, setIsHydrated] = useState(hydrated || false)
32
33
  if (!isHydrated && hydrated) setIsHydrated(true)
@@ -58,15 +59,24 @@ export function LazyHydrate(props: LazyHydrateProps) {
58
59
  }, [hydrated, isHydrated])
59
60
 
60
61
  if (isHydrated) {
61
- return <section>{children}</section>
62
+ return <Box {...elementProps}>{children}</Box>
62
63
  }
63
64
 
64
65
  if (typeof window === 'undefined') {
65
- return <section data-lazy-hydrate>{children}</section>
66
+ return (
67
+ <Box data-lazy-hydrate {...elementProps}>
68
+ {children}
69
+ </Box>
70
+ )
66
71
  }
67
72
 
68
73
  return (
69
- // eslint-disable-next-line react/no-danger
70
- <section ref={rootRef} dangerouslySetInnerHTML={{ __html: '' }} suppressHydrationWarning />
74
+ <Box
75
+ ref={rootRef}
76
+ // eslint-disable-next-line react/no-danger
77
+ dangerouslySetInnerHTML={{ __html: '' }}
78
+ suppressHydrationWarning
79
+ {...elementProps}
80
+ />
71
81
  )
72
82
  }
@@ -365,7 +365,7 @@ export function OverlayBase(incomingProps: LayoutOverlayBaseProps) {
365
365
  return (
366
366
  <>
367
367
  <MotionDiv
368
- inert={active ? undefined : true}
368
+ inert={active ? undefined : ('true' as unknown as boolean)}
369
369
  className={classes.backdrop}
370
370
  style={{ opacity: positions.open.visible }}
371
371
  sx={[
@@ -387,7 +387,7 @@ export function OverlayBase(incomingProps: LayoutOverlayBaseProps) {
387
387
  ]}
388
388
  />
389
389
  <Scroller
390
- inert={disableInert || active ? undefined : true}
390
+ inert={disableInert || active ? undefined : ('true' as unknown as boolean)}
391
391
  className={`${classes.scroller} ${className ?? ''}`}
392
392
  grid={false}
393
393
  onClick={onClickAway}
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": "8.0.5-canary.1",
5
+ "version": "8.0.5-canary.3",
6
6
  "sideEffects": false,
7
7
  "prettier": "@graphcommerce/prettier-config-pwa",
8
8
  "eslintConfig": {
@@ -25,14 +25,14 @@
25
25
  "typescript": "5.3.3"
26
26
  },
27
27
  "peerDependencies": {
28
- "@graphcommerce/eslint-config-pwa": "^8.0.5-canary.1",
29
- "@graphcommerce/framer-next-pages": "^8.0.5-canary.1",
30
- "@graphcommerce/framer-scroller": "^8.0.5-canary.1",
31
- "@graphcommerce/framer-utils": "^8.0.5-canary.1",
32
- "@graphcommerce/image": "^8.0.5-canary.1",
33
- "@graphcommerce/lingui-next": "^8.0.5-canary.1",
34
- "@graphcommerce/prettier-config-pwa": "^8.0.5-canary.1",
35
- "@graphcommerce/typescript-config-pwa": "^8.0.5-canary.1",
28
+ "@graphcommerce/eslint-config-pwa": "^8.0.5-canary.3",
29
+ "@graphcommerce/framer-next-pages": "^8.0.5-canary.3",
30
+ "@graphcommerce/framer-scroller": "^8.0.5-canary.3",
31
+ "@graphcommerce/framer-utils": "^8.0.5-canary.3",
32
+ "@graphcommerce/image": "^8.0.5-canary.3",
33
+ "@graphcommerce/lingui-next": "^8.0.5-canary.3",
34
+ "@graphcommerce/prettier-config-pwa": "^8.0.5-canary.3",
35
+ "@graphcommerce/typescript-config-pwa": "^8.0.5-canary.3",
36
36
  "@lingui/core": "^4.2.1",
37
37
  "@lingui/macro": "^4.2.1",
38
38
  "@lingui/react": "^4.2.1",
package/types.d.ts CHANGED
@@ -6,12 +6,6 @@ import './Theme/createTheme'
6
6
  // eslint-disable-next-line react/no-typos
7
7
  import 'react'
8
8
 
9
- declare module 'react' {
10
- interface HTMLAttributes<T> extends AriaAttributes, DOMAttributes<T> {
11
- inert?: 'true'
12
- }
13
- }
14
-
15
9
  declare module '*.po' {
16
10
  const messages: Record<
17
11
  string,