@graphcommerce/ecommerce-ui 8.1.0-canary.46 → 8.1.0-canary.48

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,14 @@
1
1
  # @graphcommerce/ecommerce-ui
2
2
 
3
+ ## 8.1.0-canary.48
4
+
5
+ ### Minor Changes
6
+
7
+ - [#2319](https://github.com/graphcommerce-org/graphcommerce/pull/2319) [`a3409e8`](https://github.com/graphcommerce-org/graphcommerce/commit/a3409e8a629ee95413da6547cbdcf48aa2502c23) - Created a new TelephoneElement component to make re-use easier
8
+ ([@Giovanni-Schroevers](https://github.com/Giovanni-Schroevers))
9
+
10
+ ## 8.1.0-canary.47
11
+
3
12
  ## 8.1.0-canary.46
4
13
 
5
14
  ## 8.1.0-canary.45
@@ -0,0 +1,23 @@
1
+ import { FieldValues, phonePattern } from '@graphcommerce/react-hook-form'
2
+ import { Trans, t } from '@lingui/macro'
3
+ import { TextFieldElement, TextFieldElementProps } from './TextFieldElement'
4
+
5
+ export type TelephoneElementProps<T extends FieldValues> = TextFieldElementProps<T>
6
+
7
+ export function TelephoneElement<TFieldValues extends FieldValues>(
8
+ props: TelephoneElementProps<TFieldValues>,
9
+ ): JSX.Element {
10
+ const { rules, ...rest } = props
11
+ return (
12
+ <TextFieldElement
13
+ type='text'
14
+ label={<Trans>Telephone</Trans>}
15
+ autoComplete='tel'
16
+ rules={{
17
+ pattern: { value: phonePattern, message: t`Invalid phone number` },
18
+ ...rules,
19
+ }}
20
+ {...rest}
21
+ />
22
+ )
23
+ }
@@ -1,14 +1,15 @@
1
1
  export * from './AutoCompleteElement'
2
2
  export * from './CheckboxButtonGroup'
3
3
  export * from './CheckboxElement'
4
+ export * from './EmailElement'
4
5
  export * from './MultiSelectElement'
6
+ export * from './NumberFieldElement'
5
7
  export * from './PasswordElement'
6
8
  export * from './PasswordRepeatElement'
7
- export * from './NumberFieldElement'
8
- export * from './SliderElement'
9
- export * from './SwitchElement'
10
9
  export * from './RadioButtonGroup'
11
10
  export * from './SelectElement'
11
+ export * from './SliderElement'
12
+ export * from './SwitchElement'
13
+ export * from './TelephoneElement'
12
14
  export * from './TextFieldElement'
13
15
  export * from './ToggleButtonGroup'
14
- export * from './EmailElement'
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@graphcommerce/ecommerce-ui",
3
3
  "homepage": "https://www.graphcommerce.org/",
4
4
  "repository": "github:graphcommerce-org/graphcommerce",
5
- "version": "8.1.0-canary.46",
5
+ "version": "8.1.0-canary.48",
6
6
  "sideEffects": false,
7
7
  "prettier": "@graphcommerce/prettier-config-pwa",
8
8
  "eslintConfig": {
@@ -12,12 +12,12 @@
12
12
  }
13
13
  },
14
14
  "peerDependencies": {
15
- "@graphcommerce/eslint-config-pwa": "^8.1.0-canary.46",
16
- "@graphcommerce/graphql": "^8.1.0-canary.46",
17
- "@graphcommerce/next-ui": "^8.1.0-canary.46",
18
- "@graphcommerce/prettier-config-pwa": "^8.1.0-canary.46",
19
- "@graphcommerce/react-hook-form": "^8.1.0-canary.46",
20
- "@graphcommerce/typescript-config-pwa": "^8.1.0-canary.46",
15
+ "@graphcommerce/eslint-config-pwa": "^8.1.0-canary.48",
16
+ "@graphcommerce/graphql": "^8.1.0-canary.48",
17
+ "@graphcommerce/next-ui": "^8.1.0-canary.48",
18
+ "@graphcommerce/prettier-config-pwa": "^8.1.0-canary.48",
19
+ "@graphcommerce/react-hook-form": "^8.1.0-canary.48",
20
+ "@graphcommerce/typescript-config-pwa": "^8.1.0-canary.48",
21
21
  "@lingui/core": "^4.2.1",
22
22
  "@lingui/macro": "^4.2.1",
23
23
  "@lingui/react": "^4.2.1",