@graphcommerce/magento-search 3.5.7 → 3.5.11

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
@@ -3,6 +3,17 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [3.5.8](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/magento-search@3.5.7...@graphcommerce/magento-search@3.5.8) (2021-12-03)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * search page ([85cf721](https://github.com/ho-nl/m2-pwa/commit/85cf72130bce4c3d2c392a3745adf05bca8618b1))
12
+
13
+
14
+
15
+
16
+
6
17
  ## [3.5.5](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/magento-search@3.5.4...@graphcommerce/magento-search@3.5.5) (2021-12-01)
7
18
 
8
19
 
@@ -1,6 +1,7 @@
1
1
  import { FormRow, UseStyles, iconClose, iconSearch, SvgImageSimple } from '@graphcommerce/next-ui'
2
2
  import { useForm, useFormAutoSubmit, useFormMuiRegister } from '@graphcommerce/react-hook-form'
3
- import { IconButton, makeStyles, TextField, Theme } from '@material-ui/core'
3
+ import { t, Plural } from '@lingui/macro'
4
+ import { IconButton, makeStyles, TextField, TextFieldProps, Theme } from '@material-ui/core'
4
5
  import { useRouter } from 'next/router'
5
6
  import React from 'react'
6
7
 
@@ -22,10 +23,11 @@ export type SearchFormProps = {
22
23
  search?: string
23
24
  urlHandle?: string
24
25
  autoFocus?: boolean
26
+ textFieldProps?: TextFieldProps
25
27
  } & UseStyles<typeof useStyles>
26
28
 
27
29
  export default function SearchForm(props: SearchFormProps) {
28
- const { totalResults = 0, search = '', urlHandle = 'search', autoFocus = true } = props
30
+ const { totalResults = 0, search = '', urlHandle = 'search', textFieldProps } = props
29
31
  const classes = useStyles(props)
30
32
  const router = useRouter()
31
33
 
@@ -55,7 +57,7 @@ export default function SearchForm(props: SearchFormProps) {
55
57
  <>
56
58
  {totalResults > 0 && (
57
59
  <div className={classes.totalProducts}>
58
- {totalResults} {totalResults > 1 ? 'results' : 'result'}
60
+ <Plural value={totalResults} zero='' one='# result' other='# results' />
59
61
  </div>
60
62
  )}
61
63
  <IconButton onClick={handleReset} size='small'>
@@ -79,13 +81,13 @@ export default function SearchForm(props: SearchFormProps) {
79
81
  <TextField
80
82
  variant='outlined'
81
83
  type='text'
82
- autoFocus={autoFocus}
83
- placeholder='Search'
84
+ placeholder={t`Search`}
84
85
  defaultValue={search}
85
86
  error={formState.isSubmitted && !!formState.errors.search}
86
87
  helperText={formState.isSubmitted && formState.errors.search?.message}
87
88
  {...muiRegister('search', { required: true, minLength: 2 })}
88
89
  InputProps={{ endAdornment }}
90
+ {...textFieldProps}
89
91
  />
90
92
  </FormRow>
91
93
  </form>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@graphcommerce/magento-search",
3
- "version": "3.5.7",
3
+ "version": "3.5.11",
4
4
  "sideEffects": false,
5
5
  "prettier": "@graphcommerce/prettier-config-pwa",
6
6
  "browserslist": [
@@ -22,7 +22,7 @@
22
22
  "dependencies": {
23
23
  "@graphcommerce/graphql": "^2.105.6",
24
24
  "@graphcommerce/image": "^2.105.5",
25
- "@graphcommerce/next-ui": "^3.20.0",
25
+ "@graphcommerce/next-ui": "^3.20.4",
26
26
  "@graphcommerce/react-hook-form": "^2.104.1",
27
27
  "@lingui/macro": "^3.12.1",
28
28
  "@material-ui/core": "^4.12.3",
@@ -31,5 +31,5 @@
31
31
  "react": "^17.0.2",
32
32
  "react-dom": "^17.0.2"
33
33
  },
34
- "gitHead": "8f156415c7f5a963e363f0d6d18fe5d6bbd5dba2"
34
+ "gitHead": "b992ac3fbe719310988edb8ad811366431509bc2"
35
35
  }