@graphcommerce/magento-cart 3.5.3 → 3.5.7

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.
@@ -1,9 +1,11 @@
1
1
  import {
2
+ FixedFab,
2
3
  iconShoppingBag,
4
+ responsiveVal,
3
5
  StyledBadge,
4
6
  SvgImageSimple,
5
- FixedFab,
6
7
  useFixedFabAnimation,
8
+ UseStyles,
7
9
  } from '@graphcommerce/next-ui'
8
10
  import { Fab, FabProps, makeStyles, NoSsr, Theme } from '@material-ui/core'
9
11
  import clsx from 'clsx'
@@ -14,24 +16,34 @@ import { useCartQuery } from '../../hooks/useCartQuery'
14
16
  import { CartFabDocument } from './CartFab.gql'
15
17
  import { CartTotalQuantityFragment } from './CartTotalQuantity.gql'
16
18
 
19
+ const useStyles = makeStyles(
20
+ (theme: Theme) => ({
21
+ fab: {
22
+ boxShadow: 'none',
23
+ background: theme.palette.background.default,
24
+ [theme.breakpoints.down('sm')]: {
25
+ width: responsiveVal(42, 56),
26
+ height: responsiveVal(42, 56),
27
+ },
28
+ },
29
+ }),
30
+ {
31
+ name: 'CartFab',
32
+ },
33
+ )
34
+
17
35
  export type CartFabProps = {
18
36
  icon?: React.ReactNode
19
- } & Omit<FabProps, 'children' | 'aria-label'>
37
+ } & Omit<FabProps, 'children' | 'aria-label'> &
38
+ UseStyles<typeof useStyles>
20
39
 
21
40
  type CartFabContentProps = CartFabProps & CartTotalQuantityFragment
22
41
 
23
- const useStyles = makeStyles((theme: Theme) => ({
24
- fab: {
25
- boxShadow: 'none',
26
- background: theme.palette.background.default,
27
- },
28
- }))
29
-
30
42
  function CartFabContent(props: CartFabContentProps) {
31
- const { total_quantity, icon, className, ...fabProps } = props
32
- const classes = useStyles()
43
+ const { total_quantity, icon, ...fabProps } = props
33
44
  const cartIcon = icon ?? <SvgImageSimple src={iconShoppingBag} loading='eager' size='large' />
34
45
  const { boxShadow } = useFixedFabAnimation()
46
+ const classes = useStyles(props)
35
47
 
36
48
  return (
37
49
  <m.div style={{ boxShadow, width: 'inherit', borderRadius: 'inherit' }}>
@@ -40,7 +52,7 @@ function CartFabContent(props: CartFabContentProps) {
40
52
  aria-label='Cart'
41
53
  color='inherit'
42
54
  size='large'
43
- className={clsx(classes.fab, className)}
55
+ classes={{ root: classes.fab }}
44
56
  {...fabProps}
45
57
  >
46
58
  {total_quantity > 0 ? (
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@graphcommerce/magento-cart",
3
- "version": "3.5.3",
3
+ "version": "3.5.7",
4
4
  "sideEffects": false,
5
5
  "prettier": "@graphcommerce/prettier-config-pwa",
6
6
  "browserslist": [
@@ -21,14 +21,14 @@
21
21
  },
22
22
  "dependencies": {
23
23
  "@apollo/client": "^3.4.16",
24
- "@graphcommerce/framer-scroller": "^0.4.3",
25
- "@graphcommerce/graphql": "^2.105.2",
24
+ "@graphcommerce/framer-scroller": "^1.0.2",
25
+ "@graphcommerce/graphql": "^2.105.3",
26
26
  "@graphcommerce/image": "^2.105.2",
27
- "@graphcommerce/magento-customer": "^3.4.3",
28
- "@graphcommerce/magento-graphql": "^2.104.2",
29
- "@graphcommerce/magento-store": "^3.2.3",
30
- "@graphcommerce/next-ui": "^3.12.3",
31
- "@graphcommerce/react-hook-form": "^2.102.14",
27
+ "@graphcommerce/magento-customer": "^3.4.7",
28
+ "@graphcommerce/magento-graphql": "^2.104.3",
29
+ "@graphcommerce/magento-store": "^3.2.7",
30
+ "@graphcommerce/next-ui": "^3.13.2",
31
+ "@graphcommerce/react-hook-form": "^2.103.0",
32
32
  "@graphql-typed-document-node/core": "^3.1.0",
33
33
  "@material-ui/core": "^4.12.3",
34
34
  "@material-ui/lab": "^4.0.0-alpha.60",
@@ -38,5 +38,5 @@
38
38
  "react": "^17.0.2",
39
39
  "react-dom": "^17.0.2"
40
40
  },
41
- "gitHead": "8fc77cf7261a01a54e82d2c9bdb2b59c31faeffc"
41
+ "gitHead": "db0c7ff1a81b75e4e6eeee3717a1fc608d9c3c86"
42
42
  }