@graphcommerce/magento-search-overlay 10.0.0-canary.67 → 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 CHANGED
@@ -1,5 +1,7 @@
1
1
  # @graphcommerce/magento-search-overlay
2
2
 
3
+ ## 10.0.0-canary.68
4
+
3
5
  ## 10.0.0-canary.67
4
6
 
5
7
  ## 10.0.0-canary.66
@@ -7,15 +7,20 @@ type StyledDivProps = {
7
7
 
8
8
  const StyledDiv = styled('div', {
9
9
  name: 'SearchOverlayBodyBase',
10
- })<StyledDivProps>(({ theme, keyboardOpen }) => ({
10
+ })<StyledDivProps>(({ theme }) => ({
11
11
  padding: `0 ${theme.page.horizontal} ${theme.page.vertical}`,
12
12
  '&:empty': { display: 'none' },
13
13
  '.SearchOverlay-root.scrolled &': {
14
14
  paddingTop: theme.appShell.headerHeightSm,
15
15
  },
16
- ...(keyboardOpen && {
17
- paddingBottom: '40vh', // It would be preferable to use env(keyboard-inset-height, 0px) here, but it is not fully supported in iOS yet.
18
- }),
16
+ variants: [
17
+ {
18
+ props: ({ keyboardOpen }) => keyboardOpen,
19
+ style: {
20
+ paddingBottom: '40vh', // It would be preferable to use env(keyboard-inset-height, 0px) here, but it is not fully supported in iOS yet.
21
+ },
22
+ },
23
+ ],
19
24
  }))
20
25
 
21
26
  export function SearchOverlayBodyBase(props) {
@@ -50,14 +50,21 @@ const SearchOverlayCategory = forwardRef<HTMLAnchorElement, SearchOverlayCategor
50
50
  <Breadcrumbs {...slotProps?.breadcrumbs}>
51
51
  {filterNonNullableKeys(category.breadcrumbs, ['category_name']).map((breadcrumb) => (
52
52
  <Typography
53
- color='text.primary'
54
53
  key={breadcrumb.category_name}
55
54
  {...slotProps?.typography}
55
+ sx={{
56
+ color: 'text.primary',
57
+ }}
56
58
  >
57
59
  {breadcrumb.category_name}
58
60
  </Typography>
59
61
  ))}
60
- <Typography color='text.primary' {...slotProps?.typography}>
62
+ <Typography
63
+ {...slotProps?.typography}
64
+ sx={{
65
+ color: 'text.primary',
66
+ }}
67
+ >
61
68
  {category.name}
62
69
  </Typography>
63
70
  </Breadcrumbs>
@@ -1,4 +1,4 @@
1
- import { breakpointVal } from '@graphcommerce/next-ui'
1
+ import { breakpointVal, sxx } from '@graphcommerce/next-ui'
2
2
  import { LayoutHeaderClose } from '@graphcommerce/next-ui/Layout/components/LayoutHeaderClose'
3
3
  import { Box, styled } from '@mui/material'
4
4
  import { useStickyHeaderOnScroll } from '../hooks/useStickyHeaderOnScroll'
@@ -10,7 +10,7 @@ const SearchOverlayHeaderRoot = styled(Box, { name: 'SearchOverlayHeader', slot:
10
10
  display: 'grid',
11
11
  top: 0,
12
12
  zIndex: theme.zIndex.appBar,
13
- background: theme.palette.background.paper,
13
+ background: theme.vars.palette.background.paper,
14
14
  boxShadow: theme.shadows[1],
15
15
  height: theme.appShell.headerHeightSm,
16
16
  gap: theme.page.horizontal,
@@ -43,7 +43,7 @@ export function SearchOverlayHeader(props: SearchOverlayHeaderProps) {
43
43
  params={params}
44
44
  size='medium'
45
45
  {...slotProps?.input}
46
- sx={[
46
+ sx={sxx(
47
47
  (theme) => ({
48
48
  width: '100%',
49
49
  height: '100%',
@@ -56,8 +56,8 @@ export function SearchOverlayHeader(props: SearchOverlayHeaderProps) {
56
56
  theme.breakpoints.values,
57
57
  ),
58
58
  }),
59
- ...(Array.isArray(slotProps?.input?.sx) ? slotProps.input.sx : [slotProps?.input?.sx]),
60
- ]}
59
+ slotProps?.input?.sx,
60
+ )}
61
61
  />
62
62
  <LayoutHeaderClose onClose={() => searchOverlayIsOpen.set(false)} {...slotProps?.close} />
63
63
  </SearchOverlayHeaderRoot>
@@ -2,6 +2,7 @@ import { InputBaseElement } from '@graphcommerce/ecommerce-ui'
2
2
  import type { ProductListParams } from '@graphcommerce/magento-product'
3
3
  import { useProductFiltersPro } from '@graphcommerce/magento-product'
4
4
  import { useSearchResultRemaining } from '@graphcommerce/magento-search'
5
+ import { sxx } from '@graphcommerce/next-ui'
5
6
  import { FormAutoSubmit, useDebounce } from '@graphcommerce/react-hook-form'
6
7
  import { t } from '@lingui/core/macro'
7
8
  import type { BoxProps, InputBaseProps, SxProps, Theme } from '@mui/material'
@@ -19,25 +20,19 @@ function SearchInputShadow(
19
20
  return (
20
21
  <Box
21
22
  component='div'
22
- sx={[
23
- { display: 'flex', height: '100%', alignItems: 'center' },
24
- ...(Array.isArray(sx) ? sx : [sx]),
25
- ]}
23
+ sx={sxx({ display: 'flex', height: '100%', alignItems: 'center' }, sx)}
26
24
  {...rest}
27
25
  >
28
26
  {!resultSearch && !targetSearch ? (
29
27
  <Box component='span'>{resultSearch}</Box>
30
28
  ) : (
31
29
  <>
32
- <Box
33
- component='span'
34
- sx={[{ color: 'transparent' }, ...(Array.isArray(inputSx) ? inputSx : [inputSx])]}
35
- >
30
+ <Box component='span' sx={sxx({ color: 'transparent' }, inputSx)}>
36
31
  {resultSearch}
37
32
  </Box>
38
33
  <Box
39
34
  component='span'
40
- sx={[
35
+ sx={sxx(
41
36
  {
42
37
  typography: 'h4',
43
38
  color: 'transparent',
@@ -45,8 +40,8 @@ function SearchInputShadow(
45
40
  borderImage: 'linear-gradient(108deg,#0894FF,#C959DD 34%,#FF2E54 68%,#FF9004)',
46
41
  borderImageSlice: 1,
47
42
  },
48
- ...(Array.isArray(inputSx) ? inputSx : [inputSx]),
49
- ]}
43
+ inputSx,
44
+ )}
50
45
  >
51
46
  {remaining}
52
47
  </Box>
@@ -83,15 +78,16 @@ export const SearchInput = React.forwardRef<HTMLInputElement, SearchInputProps>(
83
78
  type='text'
84
79
  spellCheck='false'
85
80
  autoComplete='off'
86
- sx={[
81
+ sx={sxx(
87
82
  (theme) => ({
88
83
  '& .MuiInputBase-input': { ...inputSx },
89
- ...(selected && {
90
- boxShadow: `inset 0 0 0 2px ${theme.palette.primary.main}`,
91
- }),
92
84
  }),
93
- ...(Array.isArray(sx) ? sx : [sx]),
94
- ]}
85
+ selected &&
86
+ ((theme) => ({
87
+ boxShadow: `inset 0 0 0 2px ${theme.vars.palette.primary.main}`,
88
+ })),
89
+ sx,
90
+ )}
95
91
  {...rest}
96
92
  {...rootProps}
97
93
  inputRef={ref}
@@ -105,7 +101,6 @@ export const SearchInput = React.forwardRef<HTMLInputElement, SearchInputProps>(
105
101
  )
106
102
  },
107
103
  )
108
-
109
104
  if (process.env.NODE_ENV !== 'production') {
110
105
  SearchInput.displayName = 'SearchInput'
111
106
  }
@@ -1,5 +1,6 @@
1
+ import { sxx } from '@graphcommerce/next-ui'
1
2
  import type { ListItemButtonProps } from '@mui/material'
2
- import { alpha, ListItemButton } from '@mui/material'
3
+ import { ListItemButton } from '@mui/material'
3
4
  import type { ElementType } from 'react'
4
5
  import { forwardRef, memo } from 'react'
5
6
  import { useSearchItem } from './SearchOverlayProvider'
@@ -23,20 +24,20 @@ export const SearchOverlayItem = memo(
23
24
  <ListItemButton
24
25
  {...getRootProps()}
25
26
  component={component}
26
- sx={[
27
+ sx={sxx(
27
28
  (theme) => ({
28
29
  px: theme.page.horizontal,
29
30
  mx: `calc(${theme.page.horizontal} * -1)`,
30
31
  '&.Mui-selected': {
31
- boxShadow: `inset 0 0 0 2px ${theme.palette.primary.main}`,
32
- backgroundColor: alpha(
33
- theme.palette.background.paper,
34
- theme.palette.action.selectedOpacity,
32
+ boxShadow: `inset 0 0 0 2px ${theme.vars.palette.primary.main}`,
33
+ backgroundColor: theme.alpha(
34
+ theme.vars.palette.background.paper,
35
+ theme.vars.palette.action.selectedOpacity,
35
36
  ),
36
37
  },
37
38
  }),
38
- ...(Array.isArray(sx) ? sx : [sx]),
39
- ]}
39
+ sx,
40
+ )}
40
41
  {...rest}
41
42
  />
42
43
  )
@@ -30,7 +30,7 @@ function withUseMenu<T extends keyof ProductListItemRenderer>(
30
30
  const sx: SxProps<Theme> = [
31
31
  root.selected &&
32
32
  ((theme) => ({
33
- outline: `2px solid ${theme.palette.primary.main}`,
33
+ outline: `2px solid ${theme.vars.palette.primary.main}`,
34
34
  outlineOffset: '7px',
35
35
  })),
36
36
  ]
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@graphcommerce/magento-search-overlay",
3
3
  "homepage": "https://www.graphcommerce.org/",
4
4
  "repository": "github:graphcommerce-org/graphcommerce",
5
- "version": "10.0.0-canary.67",
5
+ "version": "10.0.0-canary.68",
6
6
  "sideEffects": false,
7
7
  "prettier": "@graphcommerce/prettier-config-pwa",
8
8
  "eslintConfig": {
@@ -12,22 +12,22 @@
12
12
  }
13
13
  },
14
14
  "peerDependencies": {
15
- "@graphcommerce/ecommerce-ui": "^10.0.0-canary.67",
16
- "@graphcommerce/eslint-config-pwa": "^10.0.0-canary.67",
17
- "@graphcommerce/framer-utils": "^10.0.0-canary.67",
18
- "@graphcommerce/graphql": "^10.0.0-canary.67",
19
- "@graphcommerce/image": "^10.0.0-canary.67",
20
- "@graphcommerce/magento-product": "^10.0.0-canary.67",
21
- "@graphcommerce/magento-search": "^10.0.0-canary.67",
22
- "@graphcommerce/magento-store": "^10.0.0-canary.67",
23
- "@graphcommerce/next-ui": "^10.0.0-canary.67",
24
- "@graphcommerce/prettier-config-pwa": "^10.0.0-canary.67",
25
- "@graphcommerce/react-hook-form": "^10.0.0-canary.67",
26
- "@graphcommerce/typescript-config-pwa": "^10.0.0-canary.67",
15
+ "@graphcommerce/ecommerce-ui": "^10.0.0-canary.68",
16
+ "@graphcommerce/eslint-config-pwa": "^10.0.0-canary.68",
17
+ "@graphcommerce/framer-utils": "^10.0.0-canary.68",
18
+ "@graphcommerce/graphql": "^10.0.0-canary.68",
19
+ "@graphcommerce/image": "^10.0.0-canary.68",
20
+ "@graphcommerce/magento-product": "^10.0.0-canary.68",
21
+ "@graphcommerce/magento-search": "^10.0.0-canary.68",
22
+ "@graphcommerce/magento-store": "^10.0.0-canary.68",
23
+ "@graphcommerce/next-ui": "^10.0.0-canary.68",
24
+ "@graphcommerce/prettier-config-pwa": "^10.0.0-canary.68",
25
+ "@graphcommerce/react-hook-form": "^10.0.0-canary.68",
26
+ "@graphcommerce/typescript-config-pwa": "^10.0.0-canary.68",
27
27
  "@lingui/core": "^5",
28
28
  "@lingui/macro": "^5",
29
29
  "@lingui/react": "^5",
30
- "@mui/material": "^5.10.16",
30
+ "@mui/material": "^7.0.0",
31
31
  "framer-motion": "*",
32
32
  "next": "*",
33
33
  "react": "^19.2.0",