@graphcommerce/magento-search 4.1.6 → 4.1.9
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 +24 -0
- package/components/SearchLink/SearchLink.tsx +42 -37
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,29 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
+
## 4.1.9
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [[`25ef6cf08`](https://github.com/graphcommerce-org/graphcommerce/commit/25ef6cf08c278105307d6f604b7135d637e9046c), [`80e30bb77`](https://github.com/graphcommerce-org/graphcommerce/commit/80e30bb77015755fbc00a7935d590f80c1c1c18c)]:
|
|
8
|
+
- @graphcommerce/graphql@3.1.2
|
|
9
|
+
- @graphcommerce/next-ui@4.7.1
|
|
10
|
+
|
|
11
|
+
## 4.1.8
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- Updated dependencies [[`f3d06dd83`](https://github.com/graphcommerce-org/graphcommerce/commit/f3d06dd836c9a76412b419d4d2c79bbd0ee92e04)]:
|
|
16
|
+
- @graphcommerce/next-ui@4.7.0
|
|
17
|
+
|
|
18
|
+
## 4.1.7
|
|
19
|
+
|
|
20
|
+
### Patch Changes
|
|
21
|
+
|
|
22
|
+
- Updated dependencies [[`100f4c38c`](https://github.com/graphcommerce-org/graphcommerce/commit/100f4c38c8fcda4bc6e0425e38028b550b60adc2)]:
|
|
23
|
+
- @graphcommerce/graphql@3.1.1
|
|
24
|
+
- @graphcommerce/next-ui@4.6.2
|
|
25
|
+
- @graphcommerce/react-hook-form@3.1.2
|
|
26
|
+
|
|
3
27
|
## 4.1.6
|
|
4
28
|
|
|
5
29
|
### Patch Changes
|
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
} from '@graphcommerce/next-ui'
|
|
8
8
|
import { Link, LinkProps } from '@mui/material'
|
|
9
9
|
import PageLink from 'next/link'
|
|
10
|
+
import { useRouter } from 'next/router'
|
|
10
11
|
import type { SetRequired } from 'type-fest'
|
|
11
12
|
|
|
12
13
|
export type SearchLinkProps = SetRequired<Pick<LinkProps, 'href' | 'sx' | 'children'>, 'href'>
|
|
@@ -24,46 +25,50 @@ const { classes } = extendableComponent(name, parts)
|
|
|
24
25
|
*/
|
|
25
26
|
export function SearchLink(props: SearchLinkProps) {
|
|
26
27
|
const { href, sx = [], children, ...linkProps } = props
|
|
28
|
+
const router = useRouter()
|
|
27
29
|
|
|
28
30
|
const fabSize = useFabSize('responsive')
|
|
29
31
|
|
|
30
32
|
return (
|
|
31
|
-
<
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
33
|
+
<Link
|
|
34
|
+
component='button'
|
|
35
|
+
className={classes.root}
|
|
36
|
+
underline='none'
|
|
37
|
+
onClick={(e) => {
|
|
38
|
+
e.preventDefault()
|
|
39
|
+
return router.push(href)
|
|
40
|
+
}}
|
|
41
|
+
sx={[
|
|
42
|
+
(theme) => ({
|
|
43
|
+
justifySelf: 'center',
|
|
44
|
+
// @todo make abstract, this is the size of a responsive Fab minus the icon size, divided by 2.
|
|
45
|
+
marginRight: `calc(${fabSize} / 4)`,
|
|
46
|
+
width: responsiveVal(64, 172),
|
|
47
|
+
borderRadius: 2,
|
|
48
|
+
typography: 'body2',
|
|
49
|
+
display: 'flex',
|
|
50
|
+
alignItems: 'center',
|
|
51
|
+
justifyContent: 'space-between',
|
|
52
|
+
gap: theme.spacings.xs,
|
|
53
|
+
color: 'text.secondary',
|
|
54
|
+
border: 1,
|
|
55
|
+
borderColor: 'divider',
|
|
56
|
+
py: 1,
|
|
57
|
+
px: 1.5,
|
|
58
|
+
'&:hover': {
|
|
59
|
+
borderColor: 'text.secondary',
|
|
60
|
+
},
|
|
61
|
+
}),
|
|
62
|
+
...(Array.isArray(sx) ? sx : [sx]),
|
|
63
|
+
]}
|
|
64
|
+
{...linkProps}
|
|
65
|
+
>
|
|
66
|
+
<div className={classes.text}>{children ?? <> </>}</div>
|
|
67
|
+
<IconSvg
|
|
68
|
+
src={iconSearch}
|
|
69
|
+
className={classes.svg}
|
|
70
|
+
sx={{ color: 'text.primary', fontSize: '1.4em' }}
|
|
71
|
+
/>
|
|
72
|
+
</Link>
|
|
68
73
|
)
|
|
69
74
|
}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@graphcommerce/magento-search",
|
|
3
3
|
"homepage": "https://www.graphcommerce.org/",
|
|
4
4
|
"repository": "github:graphcommerce-org/graphcommerce",
|
|
5
|
-
"version": "4.1.
|
|
5
|
+
"version": "4.1.9",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"prettier": "@graphcommerce/prettier-config-pwa",
|
|
8
8
|
"eslintConfig": {
|
|
@@ -12,17 +12,17 @@
|
|
|
12
12
|
}
|
|
13
13
|
},
|
|
14
14
|
"devDependencies": {
|
|
15
|
-
"@graphcommerce/eslint-config-pwa": "^4.1.
|
|
15
|
+
"@graphcommerce/eslint-config-pwa": "^4.1.6",
|
|
16
16
|
"@graphcommerce/prettier-config-pwa": "^4.0.6",
|
|
17
17
|
"@graphcommerce/typescript-config-pwa": "^4.0.2",
|
|
18
18
|
"@playwright/test": "^1.21.1",
|
|
19
19
|
"type-fest": "^2.12.2"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@graphcommerce/graphql": "3.1.
|
|
22
|
+
"@graphcommerce/graphql": "3.1.2",
|
|
23
23
|
"@graphcommerce/image": "3.1.5",
|
|
24
|
-
"@graphcommerce/next-ui": "4.
|
|
25
|
-
"@graphcommerce/react-hook-form": "3.1.
|
|
24
|
+
"@graphcommerce/next-ui": "4.7.1",
|
|
25
|
+
"@graphcommerce/react-hook-form": "3.1.2"
|
|
26
26
|
},
|
|
27
27
|
"peerDependencies": {
|
|
28
28
|
"@lingui/macro": "^3.13.2",
|