@graphcommerce/magento-customer 10.0.0-canary.67 → 10.0.0-canary.72

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.
Files changed (43) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/components/AccountAddress/AccountAddress.tsx +4 -4
  3. package/components/AccountAddresses/AccountAddresses.tsx +6 -2
  4. package/components/AccountDeleteForm/AccountDeleteForm.tsx +14 -4
  5. package/components/AccountMenu/AccountMenu.tsx +2 -2
  6. package/components/AccountMenuItem/AccountMenuItem.tsx +19 -16
  7. package/components/ApolloCustomerError/useAuthorizationErrorMasked.ts +2 -2
  8. package/components/CancelOrder/CancelOrderForm.tsx +12 -19
  9. package/components/ConfirmCustomer/ConfirmCustomerForm.tsx +1 -5
  10. package/components/ContactForm/ContactForm.tsx +29 -26
  11. package/components/CreditMemo/CreditMemoCard.tsx +6 -6
  12. package/components/CreditMemo/CreditMemoDetails.tsx +12 -12
  13. package/components/CreditMemo/CreditMemoItems.tsx +5 -4
  14. package/components/CreditMemo/CreditMemoTotals.tsx +7 -8
  15. package/components/CustomerForms/useCustomerCreateForm.ts +2 -2
  16. package/components/CustomerForms/useCustomerUpdateForm.ts +2 -2
  17. package/components/EditAddressForm/EditAddressForm.tsx +0 -2
  18. package/components/ForgotPasswordForm/ForgotPasswordForm.tsx +0 -2
  19. package/components/Invoice/InvoiceCard.tsx +6 -6
  20. package/components/Invoice/InvoiceDetails.tsx +12 -12
  21. package/components/Invoice/InvoiceItems.tsx +5 -4
  22. package/components/Invoice/InvoiceTotals.tsx +7 -8
  23. package/components/NoOrdersFound/NoOrdersFound.tsx +2 -5
  24. package/components/Order/OrderCard/OrderCard.tsx +6 -7
  25. package/components/Order/OrderDetails/OrderDetails.tsx +9 -12
  26. package/components/Order/OrderItems/OrderItems.tsx +5 -4
  27. package/components/Order/OrderStateLabel/OrderStateLabelInline.tsx +12 -13
  28. package/components/Order/OrderTotals/OrderTotals.tsx +7 -8
  29. package/components/Shipment/ShipmentCard.tsx +6 -6
  30. package/components/Shipment/ShipmentDetails.tsx +12 -12
  31. package/components/Shipment/ShipmentItems.tsx +5 -4
  32. package/components/SignInForm/SignInForm.tsx +0 -2
  33. package/components/SignInForm/SignInFormInline.tsx +8 -5
  34. package/components/SignOutForm/signOut.ts +1 -1
  35. package/components/SignUpForm/SignUpForm.tsx +2 -2
  36. package/components/SignUpForm/SignUpFormInline.tsx +3 -1
  37. package/components/TrackingLink/TrackingLink.tsx +5 -5
  38. package/hooks/useCustomerQuery.ts +10 -9
  39. package/hooks/useCustomerSession.ts +1 -2
  40. package/hooks/useGuestQuery.ts +8 -7
  41. package/link/customerLink.ts +40 -31
  42. package/link/xMagentoCacheIdHeader.ts +22 -19
  43. package/package.json +16 -16
package/CHANGELOG.md CHANGED
@@ -1,5 +1,25 @@
1
1
  # Change Log
2
2
 
3
+ ## 10.0.0-canary.72
4
+
5
+ ## 10.0.0-canary.71
6
+
7
+ ## 10.0.0-canary.70
8
+
9
+ ### Major Changes
10
+
11
+ - [#2565](https://github.com/graphcommerce-org/graphcommerce/pull/2565) [`c96dfcd`](https://github.com/graphcommerce-org/graphcommerce/commit/c96dfcdca981baca387c270ad9e2b9515cdd00cc) - Updated to Apollo Client 4 ([@paales](https://github.com/paales))
12
+
13
+ ## 10.0.0-canary.69
14
+
15
+ ## 10.0.0-canary.68
16
+
17
+ ### Major Changes
18
+
19
+ - [#2557](https://github.com/graphcommerce-org/graphcommerce/pull/2557) [`ceaadd8`](https://github.com/graphcommerce-org/graphcommerce/commit/ceaadd87f0648982a068a3b07b1fa149c9127f49) - ## Material UI v5 → v7 Migration
20
+
21
+ This release upgrades Material UI from v5 to v7 with full CSS variables support. ([@paales](https://github.com/paales))
22
+
3
23
  ## 10.0.0-canary.67
4
24
 
5
25
  ### Patch Changes
@@ -1,4 +1,4 @@
1
- import { extendableComponent } from '@graphcommerce/next-ui'
1
+ import { extendableComponent, sxx } from '@graphcommerce/next-ui'
2
2
  import { Trans } from '@lingui/react/macro'
3
3
  import type { SxProps, Theme } from '@mui/material'
4
4
  import { Box, Link } from '@mui/material'
@@ -22,7 +22,7 @@ export function AccountAddress(props: AccountAddressProps) {
22
22
  return (
23
23
  <Box
24
24
  className={classes.root}
25
- sx={[
25
+ sx={sxx(
26
26
  (theme) => ({
27
27
  display: 'flex',
28
28
  justifyContent: 'space-between',
@@ -30,8 +30,8 @@ export function AccountAddress(props: AccountAddressProps) {
30
30
  paddingBottom: theme.spacings.md,
31
31
  typography: 'body2',
32
32
  }),
33
- ...(Array.isArray(sx) ? sx : [sx]),
34
- ]}
33
+ sx,
34
+ )}
35
35
  >
36
36
  <Box className={classes.address} sx={{ '& > span': { display: 'block' } }}>
37
37
  <AddressMultiLine id={id} {...addressProps} />
@@ -35,7 +35,9 @@ export function AccountAddresses(props: AccountAddressesProps) {
35
35
  >
36
36
  <Box
37
37
  className={classes.addresses}
38
- sx={(theme) => ({ '& > div': { borderBottom: `1px solid ${theme.palette.divider}` } })}
38
+ sx={(theme) => ({
39
+ '& > div': { borderBottom: `1px solid ${theme.vars.palette.divider}` },
40
+ })}
39
41
  >
40
42
  <Skeleton height={128} />
41
43
  <Skeleton height={128} />
@@ -77,7 +79,9 @@ export function AccountAddresses(props: AccountAddressesProps) {
77
79
  <SectionContainer labelLeft={<Trans>Shipping addresses</Trans>}>
78
80
  <Box
79
81
  className={classes.addresses}
80
- sx={(theme) => ({ '& > div': { borderBottom: `1px solid ${theme.palette.divider}` } })}
82
+ sx={(theme) => ({
83
+ '& > div': { borderBottom: `1px solid ${theme.vars.palette.divider}` },
84
+ })}
81
85
  >
82
86
  {addresses.map((address) => (
83
87
  <AccountAddress key={address.id} {...address} />
@@ -2,8 +2,8 @@ import { CheckboxElement, EmailElement } from '@graphcommerce/ecommerce-ui'
2
2
  import { useApolloClient, useMutation } from '@graphcommerce/graphql'
3
3
  import { Button, FormActions, FormRow } from '@graphcommerce/next-ui'
4
4
  import { useForm } from '@graphcommerce/react-hook-form'
5
- import { Trans } from '@lingui/react/macro'
6
5
  import { t } from '@lingui/core/macro'
6
+ import { Trans } from '@lingui/react/macro'
7
7
  import { Box, Typography } from '@mui/material'
8
8
  import { useRouter } from 'next/router'
9
9
  import { CustomerDocument, CustomerTokenDocument, useCustomerQuery } from '../../hooks'
@@ -50,10 +50,20 @@ export function AccountDeleteForm() {
50
50
  {!called || error || loading ? (
51
51
  <WaitForCustomer waitFor={dashboard}>
52
52
  <Box component='form' onSubmit={submitHandler} noValidate>
53
- <Typography variant='h6' textAlign='center'>
53
+ <Typography
54
+ variant='h6'
55
+ sx={{
56
+ textAlign: 'center',
57
+ }}
58
+ >
54
59
  <Trans>Are you sure you want to delete your account?</Trans>
55
60
  </Typography>
56
- <Typography variant='body1' textAlign='center'>
61
+ <Typography
62
+ variant='body1'
63
+ sx={{
64
+ textAlign: 'center',
65
+ }}
66
+ >
57
67
  <Trans>
58
68
  Doing so will remove all your data including order history and saved shipping /
59
69
  billing addresses.
@@ -91,7 +101,7 @@ export function AccountDeleteForm() {
91
101
  </WaitForCustomer>
92
102
  ) : (
93
103
  <>
94
- <Typography variant='h6' textAlign='center'>
104
+ <Typography variant='h6' sx={{ textAlign: 'center' }}>
95
105
  <Trans>Account deletion successful</Trans>
96
106
  </Typography>
97
107
  <FormActions>
@@ -1,4 +1,4 @@
1
- import { extendableComponent } from '@graphcommerce/next-ui'
1
+ import { extendableComponent, sxx } from '@graphcommerce/next-ui'
2
2
  import type { SxProps, Theme } from '@mui/material'
3
3
  import { List } from '@mui/material'
4
4
  import React from 'react'
@@ -14,7 +14,7 @@ export function AccountMenu(props: AccountMenuProps) {
14
14
  <List
15
15
  classes={classes}
16
16
  disablePadding
17
- sx={[(theme) => ({ marginBottom: theme.spacings.lg }), ...(Array.isArray(sx) ? sx : [sx])]}
17
+ sx={sxx((theme) => ({ marginBottom: theme.spacings.lg }), sx)}
18
18
  >
19
19
  {children}
20
20
  </List>
@@ -6,6 +6,7 @@ import {
6
6
  iconChevronRight,
7
7
  IconSvg,
8
8
  responsiveVal,
9
+ sxx,
9
10
  } from '@graphcommerce/next-ui'
10
11
  import type { SxProps, Theme } from '@mui/material'
11
12
  import { ListItem, ListItemIcon, ListItemText } from '@mui/material'
@@ -44,30 +45,29 @@ export function AccountMenuItem(props: AccountMenuItemProps) {
44
45
  href={href}
45
46
  disabled={disabled}
46
47
  className={classes.root}
47
- sx={[
48
+ sx={sxx(
48
49
  (theme) => ({
49
50
  width: '100%',
50
51
  height: responsiveVal(88, 104),
51
52
  padding: 0,
52
53
  borderRadius: 0,
53
- background: theme.palette.background.paper,
54
+ background: theme.vars.palette.background.paper,
54
55
  '&:hover': {
55
- background: theme.palette.background.default,
56
+ background: theme.vars.palette.background.default,
56
57
  },
57
58
  '&:disabled': {
58
- background: theme.palette.background.default,
59
+ background: theme.vars.palette.background.default,
59
60
  },
60
61
  '&:focus': {
61
62
  // fix: disableElevation does not work when button is focused
62
63
  boxShadow: 'none',
63
64
  },
64
-
65
65
  '&:not(.noBorderBottom)': {
66
- borderBottom: `1px solid ${theme.palette.divider}`,
66
+ borderBottom: `1px solid ${theme.vars.palette.divider}`,
67
67
  },
68
68
  }),
69
- ...(Array.isArray(sx) ? sx : [sx]),
70
- ]}
69
+ sx,
70
+ )}
71
71
  {...buttonProps}
72
72
  >
73
73
  <ListItem disableGutters>
@@ -80,16 +80,19 @@ export function AccountMenuItem(props: AccountMenuItemProps) {
80
80
  <IconSvg src={iconSrc} size='large' />
81
81
  </ListItemIcon>
82
82
  <ListItemText
83
- primaryTypographyProps={{ sx: { typography: 'subtitle1' } }}
84
- secondaryTypographyProps={{
85
- sx: {
86
- whiteSpace: 'nowrap',
87
- overflow: 'hidden',
88
- textOverflow: 'elipsis',
89
- },
90
- }}
91
83
  primary={title}
92
84
  secondary={subtitle}
85
+ slotProps={{
86
+ primary: { sx: { typography: 'subtitle1' } },
87
+
88
+ secondary: {
89
+ sx: {
90
+ whiteSpace: 'nowrap',
91
+ overflow: 'hidden',
92
+ textOverflow: 'elipsis',
93
+ },
94
+ },
95
+ }}
93
96
  />
94
97
  {endIcon ?? <IconSvg src={iconChevronRight} />}
95
98
  </ListItem>
@@ -1,9 +1,9 @@
1
- import type { ApolloError } from '@graphcommerce/graphql'
2
1
  import { graphqlErrorByCategory } from '@graphcommerce/magento-graphql'
2
+ import type { ErrorLike } from '@apollo/client'
3
3
  import { t } from '@lingui/core/macro'
4
4
  import { useCustomerSession } from '../../hooks/useCustomerSession'
5
5
 
6
- export function useAuthorizationErrorMasked(error?: ApolloError | null) {
6
+ export function useAuthorizationErrorMasked(error?: ErrorLike | null) {
7
7
  const { token } = useCustomerSession()
8
8
 
9
9
  return graphqlErrorByCategory({
@@ -8,6 +8,7 @@ import {
8
8
  FormRow,
9
9
  iconChevronDown,
10
10
  IconSvg,
11
+ sxx,
11
12
  } from '@graphcommerce/next-ui'
12
13
  import { useFormGqlMutation } from '@graphcommerce/react-hook-form'
13
14
  import { Trans } from '@lingui/react/macro'
@@ -52,10 +53,9 @@ export function CancelOrderForm(props: CancelOrderFormProps) {
52
53
  <Trans>Order has successfully been canceled</Trans>
53
54
  </Alert>
54
55
  )
55
-
56
56
  return (
57
57
  <Accordion
58
- sx={[
58
+ sx={sxx(
59
59
  (theme) => ({
60
60
  mb: theme.spacings.xxl,
61
61
  ...breakpointVal(
@@ -69,22 +69,20 @@ export function CancelOrderForm(props: CancelOrderFormProps) {
69
69
  mb: theme.spacings.xxl,
70
70
  },
71
71
  }),
72
- ...(Array.isArray(sx) ? sx : [sx]),
73
- ]}
72
+ sx,
73
+ )}
74
74
  {...rest}
75
75
  >
76
76
  <AccordionSummary
77
77
  expandIcon={<IconSvg src={iconChevronDown} />}
78
- sx={[
79
- (theme) => ({
80
- px: theme.spacings.xs,
81
- '& .MuiAccordionSummary-content': {
82
- alignItems: 'center',
83
- columnGap: 2,
84
- justifyContent: 'space-between',
85
- },
86
- }),
87
- ]}
78
+ sx={(theme) => ({
79
+ px: theme.spacings.xs,
80
+ '& .MuiAccordionSummary-content': {
81
+ alignItems: 'center',
82
+ columnGap: 2,
83
+ justifyContent: 'space-between',
84
+ },
85
+ })}
88
86
  >
89
87
  <Trans>Cancel order</Trans>
90
88
  </AccordionSummary>
@@ -103,7 +101,6 @@ export function CancelOrderForm(props: CancelOrderFormProps) {
103
101
  }))}
104
102
  />
105
103
  </FormRow>
106
-
107
104
  <CheckboxElement
108
105
  required
109
106
  control={control}
@@ -113,19 +110,15 @@ export function CancelOrderForm(props: CancelOrderFormProps) {
113
110
  <Trans>I understand that my order will be canceled and this can not be undone.</Trans>
114
111
  }
115
112
  />
116
-
117
113
  {submittedWithoutErrors && (
118
114
  <Alert>
119
115
  <Trans>Order has successfully been canceled</Trans>
120
116
  </Alert>
121
117
  )}
122
-
123
118
  {cancelOrderData?.cancelOrder?.error && (
124
119
  <Alert severity='error'>{cancelOrderData?.cancelOrder?.error}</Alert>
125
120
  )}
126
-
127
121
  <ApolloErrorSnackbar error={error} />
128
-
129
122
  <FormRow
130
123
  sx={(theme) => ({
131
124
  justifyContent: 'center',
@@ -37,7 +37,6 @@ export function ConfirmCustomerForm() {
37
37
  <LayoutTitle icon={iconPerson}>
38
38
  <Trans>Account confirmation</Trans>
39
39
  </LayoutTitle>
40
-
41
40
  {!key && (
42
41
  <Alert severity='error' sx={(theme) => ({ my: theme.spacings.xxs })}>
43
42
  <Trans>You can only confirm you account by clicking on the link in your email.</Trans>
@@ -45,10 +44,9 @@ export function ConfirmCustomerForm() {
45
44
  )}
46
45
  {key && (
47
46
  <>
48
- <Typography variant='h6' textAlign='center'>
47
+ <Typography variant='h6' sx={{ textAlign: 'center' }}>
49
48
  <Trans>Fill in your email to confirm registration</Trans>
50
49
  </Typography>
51
-
52
50
  <FormRow>
53
51
  <EmailElement
54
52
  variant='outlined'
@@ -59,7 +57,6 @@ export function ConfirmCustomerForm() {
59
57
  disabled={isSubmitSuccessful}
60
58
  />
61
59
  </FormRow>
62
-
63
60
  <FormRow sx={{ justifyItems: 'center' }}>
64
61
  <Button
65
62
  type='submit'
@@ -72,7 +69,6 @@ export function ConfirmCustomerForm() {
72
69
  <Trans>Confirm registration</Trans>
73
70
  </Button>
74
71
  </FormRow>
75
-
76
72
  <ApolloCustomerErrorAlert
77
73
  sx={(theme) => ({ my: theme.spacings.xxs })}
78
74
  error={error}
@@ -7,12 +7,13 @@ import {
7
7
  import { Button, Form, FormRow, MessageSnackbar } from '@graphcommerce/next-ui'
8
8
  import { FormPersist, useFormGqlMutation } from '@graphcommerce/react-hook-form'
9
9
  import { Trans } from '@lingui/react/macro'
10
+ import { useEffect } from 'react'
10
11
  import type { CustomerQuery } from '../../hooks'
11
12
  import { CustomerDocument, useCustomerQuery } from '../../hooks'
12
13
  import type { ContactUsMutationVariables } from './ContactUsMutation.gql'
13
14
  import { ContactUsDocument } from './ContactUsMutation.gql'
14
15
 
15
- function findTelephone(data: CustomerQuery): string | undefined {
16
+ function findTelephone(data: Partial<CustomerQuery>): string | undefined {
16
17
  const { customer } = data
17
18
  if (!customer) return undefined
18
19
 
@@ -48,31 +49,33 @@ export function ContactForm() {
48
49
 
49
50
  const { control, formState, error, handleSubmit, setValue, getValues } = form
50
51
 
51
- useCustomerQuery(CustomerDocument, {
52
- onCompleted: (data) => {
53
- if (!data.customer) return
54
-
55
- const telephone = findTelephone(data)
56
-
57
- if (!getValues('input.telephone') && telephone) {
58
- setValue('input.telephone', telephone)
59
- }
60
-
61
- if (!getValues('input.email') && data.customer?.email) {
62
- setValue('input.email', data.customer?.email)
63
- }
64
-
65
- if (!getValues('input.name') && data.customer) {
66
- setValue(
67
- 'input.name',
68
- `${data.customer?.firstname ?? ''} ${data.customer?.middlename ?? ''} ${data.customer?.lastname ?? ''}`.replaceAll(
69
- ' ',
70
- ' ',
71
- ),
72
- )
73
- }
74
- },
75
- })
52
+ const customerQuery = useCustomerQuery(CustomerDocument)
53
+
54
+ // Handle customer data when it's loaded
55
+ useEffect(() => {
56
+ const data = customerQuery.data
57
+ if (!data?.customer) return
58
+
59
+ const telephone = findTelephone(data)
60
+
61
+ if (!getValues('input.telephone') && telephone) {
62
+ setValue('input.telephone', telephone)
63
+ }
64
+
65
+ if (!getValues('input.email') && data.customer?.email) {
66
+ setValue('input.email', data.customer?.email)
67
+ }
68
+
69
+ if (!getValues('input.name') && data.customer) {
70
+ setValue(
71
+ 'input.name',
72
+ `${data.customer?.firstname ?? ''} ${data.customer?.middlename ?? ''} ${data.customer?.lastname ?? ''}`.replaceAll(
73
+ ' ',
74
+ ' ',
75
+ ),
76
+ )
77
+ }
78
+ }, [customerQuery.data, getValues, setValue])
76
79
 
77
80
  const submit = handleSubmit(() => {})
78
81
 
@@ -2,7 +2,7 @@ import { Money } from '@graphcommerce/magento-store'
2
2
  import { breakpointVal, iconChevronRight, IconSvg, NextLink, sxx } from '@graphcommerce/next-ui'
3
3
  import { Trans } from '@lingui/react/macro'
4
4
  import type { SxProps, Theme } from '@mui/material'
5
- import { Box, lighten } from '@mui/material'
5
+ import { Box } from '@mui/material'
6
6
  import type { CreditMemoCardFragment } from './CreditMemoCard.gql'
7
7
 
8
8
  export type CreditMemoCardProps = {
@@ -26,10 +26,10 @@ export function CreditMemoCard(props: CreditMemoCardProps) {
26
26
  px: theme.spacings.xxs,
27
27
  py: theme.spacings.xxs,
28
28
  gap: theme.spacings.sm,
29
- background:
30
- theme.palette.mode === 'light'
31
- ? theme.palette.background.default
32
- : lighten(theme.palette.background.default, 0.15),
29
+ background: theme.vars.palette.background.default,
30
+ ...theme.applyStyles('dark', {
31
+ background: theme.lighten(theme.vars.palette.background.default, 0.15),
32
+ }),
33
33
  ...breakpointVal(
34
34
  'borderRadius',
35
35
  theme.shape.borderRadius * 2,
@@ -37,7 +37,7 @@ export function CreditMemoCard(props: CreditMemoCardProps) {
37
37
  theme.breakpoints.values,
38
38
  ),
39
39
  '&:hover': {
40
- backgroundColor: theme.palette.action.hover,
40
+ backgroundColor: theme.vars.palette.action.hover,
41
41
  },
42
42
  display: 'grid',
43
43
  gridTemplate: `
@@ -3,10 +3,11 @@ import {
3
3
  DateTimeFormat,
4
4
  extendableComponent,
5
5
  SectionContainer,
6
+ sxx,
6
7
  } from '@graphcommerce/next-ui'
7
8
  import { Trans } from '@lingui/react/macro'
8
9
  import type { SxProps, Theme } from '@mui/material'
9
- import { Box, lighten, Typography } from '@mui/material'
10
+ import { Box, Typography } from '@mui/material'
10
11
  import type { CreditMemoFragment } from './CreditMemo.gql'
11
12
 
12
13
  export type CreditMemoDetailsProps = {
@@ -30,14 +31,11 @@ export function CreditMemoDetails(props: CreditMemoDetailsProps) {
30
31
  return (
31
32
  <SectionContainer
32
33
  labelLeft={<Trans>Credit Memo details</Trans>}
33
- sx={[
34
+ sx={sxx(
34
35
  (theme) => ({
35
36
  padding: theme.spacings.sm,
36
37
  marginBottom: theme.spacings.md,
37
- background:
38
- theme.palette.mode === 'light'
39
- ? theme.palette.background.default
40
- : lighten(theme.palette.background.default, 0.15),
38
+ background: theme.lighten(theme.vars.palette.background.default, 0.15),
41
39
  ...breakpointVal(
42
40
  'borderRadius',
43
41
  theme.shape.borderRadius * 2,
@@ -48,13 +46,16 @@ export function CreditMemoDetails(props: CreditMemoDetailsProps) {
48
46
  mt: 0,
49
47
  mb: theme.spacings.xs,
50
48
  },
49
+ ...theme.applyStyles('light', {
50
+ background: theme.vars.palette.background.default,
51
+ }),
51
52
  }),
52
- ...(Array.isArray(sx) ? sx : [sx]),
53
- ]}
53
+ sx,
54
+ )}
54
55
  >
55
56
  <Box
56
57
  className={classes.creditMemoDetailContainer}
57
- sx={[
58
+ sx={sxx(
58
59
  (theme) => ({
59
60
  gridColumnGap: theme.spacings.xxl,
60
61
  gridRowGap: theme.spacings.md,
@@ -64,8 +65,8 @@ export function CreditMemoDetails(props: CreditMemoDetailsProps) {
64
65
  marginTop: theme.spacings.xxs,
65
66
  },
66
67
  }),
67
- ...(Array.isArray(sx) ? sx : [sx]),
68
- ]}
68
+ sx,
69
+ )}
69
70
  >
70
71
  <Box className={classes.creditMemoDetailRow}>
71
72
  <SectionContainer
@@ -77,7 +78,6 @@ export function CreditMemoDetails(props: CreditMemoDetailsProps) {
77
78
  <Typography>{number}</Typography>
78
79
  </SectionContainer>
79
80
  </Box>
80
-
81
81
  <Box className={classes.creditMemoDetailRow}>
82
82
  {/* <SectionContainer
83
83
  variantLeft='h5'
@@ -4,6 +4,7 @@ import {
4
4
  extendableComponent,
5
5
  nonNullable,
6
6
  SectionContainer,
7
+ sxx,
7
8
  } from '@graphcommerce/next-ui'
8
9
  import { Trans } from '@lingui/react/macro'
9
10
  import type { SxProps, Theme } from '@mui/material'
@@ -31,11 +32,11 @@ export function CreditMemoItems(props: CreditMemoItemsProps) {
31
32
  return (
32
33
  <Box
33
34
  className={classes.root}
34
- sx={[
35
+ sx={sxx(
35
36
  (theme) => ({
36
37
  my: theme.spacings.md,
37
38
  padding: `${theme.spacings.sm} ${theme.spacings.sm}`,
38
- border: `1px ${theme.palette.divider} solid`,
39
+ border: `1px ${theme.vars.palette.divider} solid`,
39
40
  ...breakpointVal(
40
41
  'borderRadius',
41
42
  theme.shape.borderRadius * 2,
@@ -43,8 +44,8 @@ export function CreditMemoItems(props: CreditMemoItemsProps) {
43
44
  theme.breakpoints.values,
44
45
  ),
45
46
  }),
46
- ...(Array.isArray(sx) ? sx : [sx]),
47
- ]}
47
+ sx,
48
+ )}
48
49
  >
49
50
  <SectionContainer
50
51
  sx={{ '& .SectionHeader-root': { mt: 0 } }}
@@ -2,7 +2,7 @@ import { Money } from '@graphcommerce/magento-store'
2
2
  import { breakpointVal, extendableComponent, sxx } from '@graphcommerce/next-ui'
3
3
  import { Trans } from '@lingui/react/macro'
4
4
  import type { SxProps, Theme } from '@mui/material'
5
- import { Box, Divider, lighten, Typography } from '@mui/material'
5
+ import { Box, Divider, Typography } from '@mui/material'
6
6
  import type { CreditMemoFragment } from './CreditMemo.gql'
7
7
 
8
8
  export type CreditMemoTotalsProps = {
@@ -32,10 +32,10 @@ export function CreditMemoTotals(props: CreditMemoTotalsProps) {
32
32
  theme.shape.borderRadius * 5,
33
33
  theme.breakpoints.values,
34
34
  ),
35
- background:
36
- theme.palette.mode === 'light'
37
- ? theme.palette.background.default
38
- : lighten(theme.palette.background.default, 0.15),
35
+ background: theme.vars.palette.background.default,
36
+ ...theme.applyStyles('dark', {
37
+ background: theme.lighten(theme.vars.palette.background.default, 0.15),
38
+ }),
39
39
  padding: `${theme.spacings.xs} ${theme.spacings.sm}`,
40
40
  }),
41
41
  sx,
@@ -86,13 +86,12 @@ export function CreditMemoTotals(props: CreditMemoTotalsProps) {
86
86
  )}
87
87
 
88
88
  <Divider sx={(theme) => ({ my: theme.spacings.xxs })} />
89
-
90
89
  <Box
91
90
  className={classes.totalsRow}
92
91
  sx={(theme) => ({
93
92
  display: 'flex',
94
93
  justifyContent: 'space-between',
95
- color: theme.palette.primary.main,
94
+ color: theme.vars.palette.primary.main,
96
95
  })}
97
96
  >
98
97
  <Typography>
@@ -108,7 +107,7 @@ export function CreditMemoTotals(props: CreditMemoTotalsProps) {
108
107
  sx={(theme) => ({
109
108
  display: 'flex',
110
109
  justifyContent: 'space-between',
111
- color: theme.palette.text.disabled,
110
+ color: theme.vars.palette.text.disabled,
112
111
  })}
113
112
  >
114
113
  <Typography>
@@ -6,7 +6,7 @@ import {
6
6
  type UseAttributesFormConfig,
7
7
  } from '@graphcommerce/magento-store'
8
8
  import { useFormGqlMutation, type UseFormGraphQlOptions } from '@graphcommerce/react-hook-form'
9
- import type { MutationHookOptions } from '@apollo/client'
9
+ import type { useMutation } from '@apollo/client/react'
10
10
  import {
11
11
  UseCustomerCreateFormDocument,
12
12
  type UseCustomerCreateFormMutation,
@@ -46,7 +46,7 @@ export function useCustomerCreateForm(
46
46
  UseCustomerCreateFormMutation,
47
47
  CreateCustomerFormValues
48
48
  >,
49
- mutationOptions?: MutationHookOptions<UseCustomerCreateFormMutation, CreateCustomerFormValues>,
49
+ mutationOptions?: useMutation.Options<UseCustomerCreateFormMutation, CreateCustomerFormValues>,
50
50
  ) {
51
51
  const attributes = useAttributesForm({
52
52
  formCode: 'customer_account_create',
@@ -7,7 +7,7 @@ import {
7
7
  type UseAttributesFormConfig,
8
8
  } from '@graphcommerce/magento-store'
9
9
  import { useFormGqlMutation, type UseFormGraphQlOptions } from '@graphcommerce/react-hook-form'
10
- import type { MutationHookOptions } from '@apollo/client'
10
+ import type { useMutation } from '@apollo/client/react'
11
11
  import type { OmitDeep } from 'type-fest'
12
12
  import type { CustomerInfoFragment } from '../../hooks'
13
13
  import {
@@ -93,7 +93,7 @@ export function useCustomerUpdateForm(
93
93
  UseCustomerUpdateFormMutation,
94
94
  UpdateCustomerFormValues
95
95
  >,
96
- mutationOptions?: MutationHookOptions<UseCustomerUpdateFormMutation, UpdateCustomerFormValues>,
96
+ mutationOptions?: useMutation.Options<UseCustomerUpdateFormMutation, UpdateCustomerFormValues>,
97
97
  ) {
98
98
  const { customer, ...attributeFormConfig } = config
99
99
  const attributes = useAttributesForm({
@@ -99,7 +99,6 @@ export function EditAddressForm(props: EditAddressFormProps) {
99
99
  showValid
100
100
  />
101
101
  </FormRow>
102
-
103
102
  {billingAddressReadonly && address?.default_billing ? (
104
103
  <Trans>
105
104
  You can not change this address as it is your billing address. Not correct? Please
@@ -119,7 +118,6 @@ export function EditAddressForm(props: EditAddressFormProps) {
119
118
  </FormActions>
120
119
  )}
121
120
  </Form>
122
-
123
121
  <ApolloErrorSnackbar error={error} />
124
122
  </>
125
123
  )
@@ -56,9 +56,7 @@ export function ForgotPasswordForm(props: ForgotPasswordFormProps) {
56
56
  showValid
57
57
  />
58
58
  </FormRow>
59
-
60
59
  <ApolloCustomerErrorAlert error={error} />
61
-
62
60
  <FormActions>
63
61
  <Button
64
62
  type='submit'