@graphcommerce/magento-search 8.0.0-canary.75 → 8.0.0-canary.77
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 +9 -0
- package/components/SearchLink/SearchLink.tsx +19 -1
- package/package.json +10 -10
package/CHANGELOG.md
CHANGED
@@ -1,5 +1,14 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
|
+
## 8.0.0-canary.77
|
4
|
+
|
5
|
+
### Patch Changes
|
6
|
+
|
7
|
+
- [`e33660f`](https://github.com/graphcommerce-org/graphcommerce/commit/e33660f172466dcfa0ab7262cee612d9a3e47776) - a11y improvements (see https://github.com/graphcommerce-org/graphcommerce/issues/1995 for more info)
|
8
|
+
([@FrankHarland](https://github.com/FrankHarland))
|
9
|
+
|
10
|
+
## 8.0.0-canary.76
|
11
|
+
|
3
12
|
## 8.0.0-canary.75
|
4
13
|
|
5
14
|
### Patch Changes
|
@@ -8,7 +8,7 @@ import {
|
|
8
8
|
} from '@graphcommerce/next-ui'
|
9
9
|
import { Breakpoint, Fab, FabProps, Link, LinkProps } from '@mui/material'
|
10
10
|
import { useRouter } from 'next/router'
|
11
|
-
import { MouseEventHandler } from 'react'
|
11
|
+
import { KeyboardEventHandler, MouseEventHandler } from 'react'
|
12
12
|
import type { SetRequired } from 'type-fest'
|
13
13
|
|
14
14
|
export type SearchLinkProps = {
|
@@ -29,10 +29,25 @@ const { classes } = extendableComponent(name, parts)
|
|
29
29
|
*/
|
30
30
|
export function SearchLink(props: SearchLinkProps) {
|
31
31
|
const { href, sx = [], children, breakpoint, fab, onClick, ...linkProps } = props
|
32
|
+
const router = useRouter()
|
32
33
|
const fabSize = useFabSize('responsive')
|
33
34
|
const iconSize = useIconSvgSize('large')
|
34
35
|
const { sx: fabSx = [], size, color, ...fabProps } = fab ?? {}
|
35
36
|
|
37
|
+
const handleClick: MouseEventHandler<HTMLAnchorElement> = (e) => {
|
38
|
+
e.preventDefault()
|
39
|
+
onClick?.(e)
|
40
|
+
return router.push(href)
|
41
|
+
}
|
42
|
+
|
43
|
+
const handleKeyDown: KeyboardEventHandler<HTMLAnchorElement> = (e) => {
|
44
|
+
if (e.key === 'Enter') {
|
45
|
+
e.preventDefault()
|
46
|
+
return router.push(href)
|
47
|
+
}
|
48
|
+
return undefined
|
49
|
+
}
|
50
|
+
|
36
51
|
return (
|
37
52
|
<>
|
38
53
|
<Link
|
@@ -40,6 +55,9 @@ export function SearchLink(props: SearchLinkProps) {
|
|
40
55
|
rel='noindex'
|
41
56
|
className={classes.root}
|
42
57
|
underline='none'
|
58
|
+
onClick={handleClick}
|
59
|
+
onKeyDown={handleKeyDown}
|
60
|
+
tabIndex={0}
|
43
61
|
sx={[
|
44
62
|
(theme) => ({
|
45
63
|
justifySelf: 'center',
|
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": "8.0.0-canary.
|
5
|
+
"version": "8.0.0-canary.77",
|
6
6
|
"sideEffects": false,
|
7
7
|
"prettier": "@graphcommerce/prettier-config-pwa",
|
8
8
|
"eslintConfig": {
|
@@ -12,15 +12,15 @@
|
|
12
12
|
}
|
13
13
|
},
|
14
14
|
"peerDependencies": {
|
15
|
-
"@graphcommerce/ecommerce-ui": "^8.0.0-canary.
|
16
|
-
"@graphcommerce/eslint-config-pwa": "^8.0.0-canary.
|
17
|
-
"@graphcommerce/graphql": "^8.0.0-canary.
|
18
|
-
"@graphcommerce/image": "^8.0.0-canary.
|
19
|
-
"@graphcommerce/magento-product": "^8.0.0-canary.
|
20
|
-
"@graphcommerce/next-ui": "^8.0.0-canary.
|
21
|
-
"@graphcommerce/prettier-config-pwa": "^8.0.0-canary.
|
22
|
-
"@graphcommerce/react-hook-form": "^8.0.0-canary.
|
23
|
-
"@graphcommerce/typescript-config-pwa": "^8.0.0-canary.
|
15
|
+
"@graphcommerce/ecommerce-ui": "^8.0.0-canary.77",
|
16
|
+
"@graphcommerce/eslint-config-pwa": "^8.0.0-canary.77",
|
17
|
+
"@graphcommerce/graphql": "^8.0.0-canary.77",
|
18
|
+
"@graphcommerce/image": "^8.0.0-canary.77",
|
19
|
+
"@graphcommerce/magento-product": "^8.0.0-canary.77",
|
20
|
+
"@graphcommerce/next-ui": "^8.0.0-canary.77",
|
21
|
+
"@graphcommerce/prettier-config-pwa": "^8.0.0-canary.77",
|
22
|
+
"@graphcommerce/react-hook-form": "^8.0.0-canary.77",
|
23
|
+
"@graphcommerce/typescript-config-pwa": "^8.0.0-canary.77",
|
24
24
|
"@lingui/core": "^4.2.1",
|
25
25
|
"@lingui/macro": "^4.2.1",
|
26
26
|
"@lingui/react": "^4.2.1",
|