@graphcommerce/ecommerce-ui 6.0.2-canary.1 → 6.0.2-canary.12

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,31 @@
1
1
  # @graphcommerce/ecommerce-ui
2
2
 
3
+ ## 6.0.2-canary.12
4
+
5
+ ### Patch Changes
6
+
7
+ - [#1871](https://github.com/graphcommerce-org/graphcommerce/pull/1871) [`1e2d2e5c6`](https://github.com/graphcommerce-org/graphcommerce/commit/1e2d2e5c615f072a2d0b60074d9aa5a467876f2f) - Allow styling FormControl in CheckboxElement ([@bramvanderholst](https://github.com/bramvanderholst))
8
+
9
+ ## 6.0.2-canary.11
10
+
11
+ ## 6.0.2-canary.10
12
+
13
+ ## 6.0.2-canary.9
14
+
15
+ ## 6.0.2-canary.8
16
+
17
+ ## 6.0.2-canary.7
18
+
19
+ ## 6.0.2-canary.6
20
+
21
+ ## 6.0.2-canary.5
22
+
23
+ ## 6.0.2-canary.4
24
+
25
+ ## 6.0.2-canary.3
26
+
27
+ ## 6.0.2-canary.2
28
+
3
29
  ## 6.0.2-canary.1
4
30
 
5
31
  ## 6.0.2-canary.0
@@ -10,14 +10,19 @@ import {
10
10
  FormControl,
11
11
  FormControlLabel,
12
12
  FormControlLabelProps,
13
+ FormControlProps,
13
14
  FormGroup,
14
15
  FormHelperText,
16
+ SxProps,
17
+ Theme,
15
18
  } from '@mui/material'
16
19
 
17
20
  export type CheckboxElementProps<T extends FieldValues> = Omit<CheckboxProps, 'name'> & {
18
21
  parseError?: (error: FieldError) => string
19
22
  label?: FormControlLabelProps['label']
20
23
  helperText?: string
24
+ sx?: SxProps<Theme>
25
+ formControl?: Omit<FormControlProps<'div'>, 'required' | 'error'>
21
26
  } & Omit<ControllerProps<T>, 'render'>
22
27
 
23
28
  export function CheckboxElement<TFieldValues extends FieldValues>({
@@ -28,6 +33,8 @@ export function CheckboxElement<TFieldValues extends FieldValues>({
28
33
  label,
29
34
  control,
30
35
  helperText,
36
+ sx,
37
+ formControl,
31
38
  ...rest
32
39
  }: CheckboxElementProps<TFieldValues>): JSX.Element {
33
40
  if (required && !rules.required) {
@@ -46,7 +53,7 @@ export function CheckboxElement<TFieldValues extends FieldValues>({
46
53
  : error.message
47
54
  : helperText
48
55
  return (
49
- <FormControl required={required} error={invalid}>
56
+ <FormControl required={required} error={invalid} {...formControl}>
50
57
  <FormGroup row>
51
58
  <FormControlLabel
52
59
  label={label || ''}
@@ -55,7 +62,7 @@ export function CheckboxElement<TFieldValues extends FieldValues>({
55
62
  {...rest}
56
63
  color={rest.color || 'primary'}
57
64
  sx={{
58
- ...rest.sx,
65
+ ...(Array.isArray(sx) ? sx : [sx]),
59
66
  color: invalid ? 'error.main' : undefined,
60
67
  }}
61
68
  value={value}
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": "6.0.2-canary.1",
5
+ "version": "6.0.2-canary.12",
6
6
  "sideEffects": false,
7
7
  "prettier": "@graphcommerce/prettier-config-pwa",
8
8
  "eslintConfig": {
@@ -12,14 +12,14 @@
12
12
  }
13
13
  },
14
14
  "dependencies": {
15
- "@graphcommerce/graphql": "6.0.2-canary.1",
16
- "@graphcommerce/next-ui": "6.0.2-canary.1",
17
- "@graphcommerce/react-hook-form": "6.0.2-canary.1"
15
+ "@graphcommerce/graphql": "6.0.2-canary.12",
16
+ "@graphcommerce/next-ui": "6.0.2-canary.12",
17
+ "@graphcommerce/react-hook-form": "6.0.2-canary.12"
18
18
  },
19
19
  "devDependencies": {
20
- "@graphcommerce/eslint-config-pwa": "6.0.2-canary.1",
21
- "@graphcommerce/prettier-config-pwa": "6.0.2-canary.1",
22
- "@graphcommerce/typescript-config-pwa": "6.0.2-canary.1"
20
+ "@graphcommerce/eslint-config-pwa": "6.0.2-canary.12",
21
+ "@graphcommerce/prettier-config-pwa": "6.0.2-canary.12",
22
+ "@graphcommerce/typescript-config-pwa": "6.0.2-canary.12"
23
23
  },
24
24
  "peerDependencies": {
25
25
  "@lingui/react": "^3.13.2",