@graphcommerce/magento-cart 4.1.3 → 4.1.4

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.
@@ -5,7 +5,7 @@ import { CartAddressFragment } from '../CartAddress/CartAddress.gql'
5
5
 
6
6
  export type CartAddressMultiLineProps = Partial<CartAddressFragment>
7
7
 
8
- export default function CartAddressMultiLine(props: CartAddressMultiLineProps) {
8
+ export function CartAddressMultiLine(props: CartAddressMultiLineProps) {
9
9
  const { country, region, ...addressProps } = props
10
10
  return (
11
11
  <AddressMultiLine
@@ -5,7 +5,7 @@ import { CartAddressFragment } from '../CartAddress/CartAddress.gql'
5
5
 
6
6
  export type CartAddressSingleLineProps = CartAddressFragment & { locale?: CountryCodeEnum }
7
7
 
8
- export default function CartAddressSingleLine(props: CartAddressSingleLineProps) {
8
+ export function CartAddressSingleLine(props: CartAddressSingleLineProps) {
9
9
  const { locale } = props
10
10
  return <AddressSingleLine {...props} country_code={locale} />
11
11
  }
@@ -24,12 +24,12 @@ import { CartAgreementsDocument } from './CartAgreements.gql'
24
24
 
25
25
  export type CartAgreementsFormProps = Pick<UseFormComposeOptions, 'step'> & { sx?: SxProps<Theme> }
26
26
 
27
- const name = 'CartAgreementsForm' as const
27
+ const componentName = 'CartAgreementsForm' as const
28
28
  const parts = ['form', 'formInner', 'formControlRoot', 'manualCheck'] as const
29
- const { classes } = extendableComponent(name, parts)
29
+ const { classes } = extendableComponent(componentName, parts)
30
30
 
31
- export default function CartAgreementsForm(props: CartAgreementsFormProps) {
32
- const { step } = props
31
+ export function CartAgreementsForm(props: CartAgreementsFormProps) {
32
+ const { step, sx = [] } = props
33
33
  const { data } = useQuery(CartAgreementsDocument)
34
34
 
35
35
  // sort conditions so checkboxes will be placed first
@@ -51,7 +51,10 @@ export default function CartAgreementsForm(props: CartAgreementsFormProps) {
51
51
  useFormCompose({ form, step, submit, key: 'PaymentAgreementsForm' })
52
52
 
53
53
  return (
54
- <FormDiv className={classes.form} sx={(theme) => ({ pt: theme.spacings.md })}>
54
+ <FormDiv
55
+ className={classes.form}
56
+ sx={[(theme) => ({ pt: theme.spacings.md }), ...(Array.isArray(sx) ? sx : [sx])]}
57
+ >
55
58
  <form noValidate onSubmit={submit} name='cartAgreements'>
56
59
  <Box className={classes.formInner} sx={{ typography: 'body1', display: 'inline-block' }}>
57
60
  {data?.checkoutAgreements &&
@@ -25,6 +25,7 @@ type CartFabContentProps = CartFabProps & CartTotalQuantityFragment
25
25
  const MotionDiv = styled(m.div)({})
26
26
 
27
27
  const MotionFab = m(
28
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
28
29
  React.forwardRef<any, Omit<FabProps, 'style' | 'onDrag'>>((props, ref) => (
29
30
  <Fab {...props} ref={ref} />
30
31
  )),
@@ -107,7 +108,7 @@ function CartFabContent(props: CartFabContentProps) {
107
108
  * immediately start fetching. Why? There is a time between creating a cart and adding the first
108
109
  * product to the cart. This would mean that it would immediately start executing this query.
109
110
  */
110
- export default function CartFab(props: CartFabProps) {
111
+ export function CartFab(props: CartFabProps) {
111
112
  const { data } = useCartQuery(CartFabDocument, {
112
113
  fetchPolicy: 'cache-only',
113
114
  nextFetchPolicy: 'cache-first',
@@ -12,7 +12,7 @@ import { Trans } from '@lingui/macro'
12
12
  import { Box, Divider, SxProps, Theme } from '@mui/material'
13
13
  import React from 'react'
14
14
  import { useCartQuery } from '../../hooks'
15
- import CartTotals from '../CartTotals/CartTotals'
15
+ import { CartTotals } from '../CartTotals/CartTotals'
16
16
  import { CartItemSummaryDocument } from './GetCartItemSummary.gql'
17
17
 
18
18
  const name = 'CartItemSummary' as const
@@ -32,7 +32,7 @@ const { classes } = extendableComponent(name, parts)
32
32
 
33
33
  type OrderSummaryProps = { sx?: SxProps<Theme> }
34
34
 
35
- export default function CartItemSummary(props: OrderSummaryProps) {
35
+ export function CartItemSummary(props: OrderSummaryProps) {
36
36
  const { sx = [] } = props
37
37
  const { data } = useCartQuery(CartItemSummaryDocument, { allowUrl: true })
38
38
 
@@ -19,7 +19,7 @@ const parts = [
19
19
  ] as const
20
20
  const { classes } = extendableComponent(name, parts)
21
21
 
22
- export default function CartStartCheckout(props: CartStartCheckoutProps) {
22
+ export function CartStartCheckout(props: CartStartCheckoutProps) {
23
23
  const { prices, children, sx = [] } = props
24
24
 
25
25
  const hasTotals = (prices?.grand_total?.value ?? 0) > 0
@@ -5,7 +5,7 @@ import { Box, Link, SxProps, Theme, Typography } from '@mui/material'
5
5
  import PageLink from 'next/link'
6
6
  import React from 'react'
7
7
  import { useCartQuery } from '../../hooks'
8
- import CartAddressMultiLine from '../CartAddressMultiLine'
8
+ import { CartAddressMultiLine } from '../CartAddressMultiLine/CartAddressMultiLine'
9
9
  import { GetCartSummaryDocument } from './GetCartSummary.gql'
10
10
 
11
11
  export type CartSummaryProps = {
@@ -19,7 +19,7 @@ const compName = 'CartSummary' as const
19
19
  const parts = ['root', 'detailsContainer', 'sectionHeaderWrapper'] as const
20
20
  const { classes } = extendableComponent<OwnerState, typeof compName, typeof parts>(compName, parts)
21
21
 
22
- export default function CartSummary(props: CartSummaryProps) {
22
+ export function CartSummary(props: CartSummaryProps) {
23
23
  const { children, editable } = props
24
24
 
25
25
  const { data } = useCartQuery(GetCartSummaryDocument, { allowUrl: true })
@@ -27,7 +27,7 @@ const { withState } = extendableComponent<OwnerProps, typeof name, typeof parts>
27
27
  *
28
28
  * @see https://github.com/magento/magento2/issues/33848
29
29
  */
30
- export default function CartTotals(props: CartTotalsProps) {
30
+ export function CartTotals(props: CartTotalsProps) {
31
31
  const { data } = useCartQuery(GetCartTotalsDocument, { allowUrl: true })
32
32
  const { containerMargin, sx = [] } = props
33
33
 
@@ -95,11 +95,11 @@ export default function CartTotals(props: CartTotalsProps) {
95
95
  return (
96
96
  <AnimatedRow
97
97
  key={discount?.label}
98
- sx={(theme) => ({
98
+ sx={{
99
99
  display: 'flex',
100
100
  justifyContent: 'space-between',
101
101
  typography: 'subtitle1',
102
- })}
102
+ }}
103
103
  >
104
104
  <Box>{discount?.label}</Box>
105
105
  <Box className={classes.money} sx={{ whiteSpace: 'nowrap' }}>
@@ -5,7 +5,7 @@ import Link from 'next/link'
5
5
  import React from 'react'
6
6
 
7
7
  type EmptyCartProps = { children?: React.ReactNode }
8
- export default function EmptyCart(props: EmptyCartProps) {
8
+ export function EmptyCart(props: EmptyCartProps) {
9
9
  const { children } = props
10
10
 
11
11
  return (
@@ -22,7 +22,7 @@ const name = 'InlineAccount' as const
22
22
  const parts = ['root', 'innerContainer', 'form', 'button', 'title'] as const
23
23
  const { classes } = extendableComponent(name, parts)
24
24
 
25
- export default function InlineAccount(props: InlineAccountProps) {
25
+ export function InlineAccount(props: InlineAccountProps) {
26
26
  const { title, description, accountHref, sx = [] } = props
27
27
 
28
28
  const [toggled, setToggled] = useState<boolean>(false)
@@ -1,30 +1,12 @@
1
+ export * from './ApolloCartError'
2
+ export * from './CartAddressMultiLine/CartAddressMultiLine'
3
+ export * from './CartAddressSingleLine/CartAddressSingleLine'
4
+ export * from './CartAgreementsForm/CartAgreements.gql'
5
+ export * from './CartAgreementsForm/CartAgreementsForm'
1
6
  export * from './CartFab/CartFab'
2
- export { default as CartFab } from './CartFab/CartFab'
3
-
7
+ export * from './CartItemSummary/CartItemSummary'
4
8
  export * from './CartStartCheckout/CartStartCheckout'
5
- export { default as CartStartCheckout } from './CartStartCheckout/CartStartCheckout'
6
-
9
+ export * from './CartSummary/CartSummary'
7
10
  export * from './CartTotals/CartTotals'
8
- export { default as CartTotals } from './CartTotals/CartTotals'
9
-
10
- export { default as EmptyCart } from './EmptyCart/EmptyCart'
11
-
12
- export * from './ApolloCartError'
13
-
14
- export * from './CartSummary'
15
- export { default as CartSummary } from './CartSummary'
16
-
17
- export { default as CartItemSummary } from './CartItemSummary'
18
-
19
- export * from './InlineAccount'
20
- export { default as InlineAccount } from './InlineAccount'
21
-
22
- export * from './CartAddressMultiLine'
23
- export { default as CartAddressMultiLine } from './CartAddressMultiLine'
24
-
25
- export * from './CartAddressSingleLine'
26
- export { default as CartAddressSingleLine } from './CartAddressSingleLine'
27
-
28
- export * from './CartAgreementsForm/CartAgreementsForm'
29
- export { default as CartAgreementsForm } from './CartAgreementsForm/CartAgreementsForm'
30
- export * from './CartAgreementsForm/CartAgreements.gql'
11
+ export * from './EmptyCart/EmptyCart'
12
+ export * from './InlineAccount/InlineAccount'
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@graphcommerce/magento-cart",
3
3
  "homepage": "https://www.graphcommerce.org/",
4
4
  "repository": "github:graphcommerce-org/graphcommerce",
5
- "version": "4.1.3",
5
+ "version": "4.1.4",
6
6
  "sideEffects": false,
7
7
  "prettier": "@graphcommerce/prettier-config-pwa",
8
8
  "eslintConfig": {
@@ -12,22 +12,22 @@
12
12
  }
13
13
  },
14
14
  "devDependencies": {
15
- "@graphcommerce/eslint-config-pwa": "^4.0.3",
16
- "@graphcommerce/prettier-config-pwa": "^4.0.2",
15
+ "@graphcommerce/eslint-config-pwa": "^4.0.5",
16
+ "@graphcommerce/prettier-config-pwa": "^4.0.3",
17
17
  "@graphcommerce/typescript-config-pwa": "^4.0.2",
18
- "@playwright/test": "^1.19.1"
18
+ "@playwright/test": "^1.19.2"
19
19
  },
20
20
  "dependencies": {
21
- "@graphcommerce/ecommerce-ui": "^1.0.2",
22
- "@graphcommerce/framer-next-pages": "^3.1.0",
23
- "@graphcommerce/framer-scroller": "^2.0.3",
24
- "@graphcommerce/graphql": "^3.0.3",
25
- "@graphcommerce/image": "^3.1.0",
26
- "@graphcommerce/magento-customer": "^4.1.3",
27
- "@graphcommerce/magento-graphql": "^3.0.3",
28
- "@graphcommerce/magento-store": "^4.0.3",
29
- "@graphcommerce/next-ui": "^4.2.0",
30
- "@graphcommerce/react-hook-form": "^3.0.3"
21
+ "@graphcommerce/ecommerce-ui": "^1.0.3",
22
+ "@graphcommerce/framer-next-pages": "^3.1.2",
23
+ "@graphcommerce/framer-scroller": "^2.0.6",
24
+ "@graphcommerce/graphql": "^3.0.4",
25
+ "@graphcommerce/image": "^3.1.1",
26
+ "@graphcommerce/magento-customer": "^4.1.4",
27
+ "@graphcommerce/magento-graphql": "^3.0.4",
28
+ "@graphcommerce/magento-store": "^4.1.2",
29
+ "@graphcommerce/next-ui": "^4.2.4",
30
+ "@graphcommerce/react-hook-form": "^3.0.4"
31
31
  },
32
32
  "peerDependencies": {
33
33
  "@lingui/macro": "^3.13.2",