@hanzo/commerce 4.3.1 → 4.3.3

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.
@@ -32,7 +32,7 @@ const AddToCartWidget: React.FC<{
32
32
 
33
33
  if (disabled) {
34
34
  return (
35
- <div className={cn('flex flex-row items-stretch ' + (ghost ? 'bg-transparent rounded-xl' : 'bg-secondary rounded-xl'), className)}>
35
+ <div className={cn('flex flex-row items-stretch ' + (ghost ? 'bg-transparent rounded-xl' : 'bg-primary rounded-xl'), className)}>
36
36
  <div className={'text-sm flex items-center cursor-default ' + digitClx} >{item.quantity}</div>
37
37
  </div>
38
38
  )
@@ -55,11 +55,11 @@ const AddToCartWidget: React.FC<{
55
55
  }
56
56
 
57
57
  return ( item.isInCart ? (
58
- <div className={cn('flex flex-row items-stretch justify-center ' + (ghost ? 'bg-transparent rounded-xl' : 'bg-secondary rounded-xl'), className)}>
58
+ <div className={cn('flex flex-row items-stretch justify-center ' + (ghost ? 'bg-transparent rounded-xl' : 'bg-primary rounded-xl'), className)}>
59
59
  <Button
60
60
  aria-label={'Remove a ' + item.title + ' from the cart'}
61
61
  size={size}
62
- variant={ghost ? 'ghost' : 'secondary'}
62
+ variant={ghost ? 'ghost' : 'primary'}
63
63
  rounded={ghost ? 'full' : 'xl'}
64
64
  className={cn('px-1 lg:min-w-0 lg:px-2 xs:justify-end', buttonClx)}
65
65
  key='left'
@@ -75,7 +75,7 @@ const AddToCartWidget: React.FC<{
75
75
  <Button
76
76
  aria-label={'Add another ' + item.title + ' to the cart'}
77
77
  size={size}
78
- variant={ghost ? 'ghost' : 'secondary'}
78
+ variant={ghost ? 'ghost' : 'primary'}
79
79
  rounded={ghost ? 'full' : 'xl'}
80
80
  className={cn('px-1 lg:min-w-0 lg:px-2 xs:justify-start', buttonClx)}
81
81
  onClick={inc}
@@ -88,7 +88,7 @@ const AddToCartWidget: React.FC<{
88
88
  <Button
89
89
  aria-label={'Add a ' + item.title + ' to cart'}
90
90
  size={size}
91
- variant='secondary'
91
+ variant='primary'
92
92
  rounded='xl'
93
93
  className={cn(buttonClx, className)}
94
94
  onClick={inc}
@@ -0,0 +1,27 @@
1
+ 'use client'
2
+ import React, {type PropsWithChildren} from 'react'
3
+
4
+ import BuyItemPopup from './buy-item-popup'
5
+ import BuyItemMobileDrawer from './buy-item-mobile-drawer'
6
+
7
+ const BuyItemButtonWrapper: React.FC<{
8
+ skuPath: string
9
+ desktopTrigger: React.ReactNode
10
+ mobileTrigger: React.ReactNode
11
+ popupClx?: string
12
+ }> = ({
13
+ skuPath,
14
+ desktopTrigger,
15
+ mobileTrigger,
16
+ popupClx=''
17
+ }) => (<>
18
+ <BuyItemPopup skuPath={skuPath} popupClx={popupClx}>
19
+ {desktopTrigger}
20
+ </BuyItemPopup>
21
+ <BuyItemMobileDrawer skuPath={skuPath} trigger={mobileTrigger} />
22
+ </>
23
+ )
24
+
25
+
26
+
27
+ export default BuyItemButtonWrapper
@@ -40,7 +40,7 @@ const SelectCategoryItemCard: React.FC<React.HTMLAttributes<HTMLDivElement> & It
40
40
  const item = category.products[0] as LineItem
41
41
  return (
42
42
  <div className={cn('flex flex-col justify-center items-center ' + (mobilePicker ? 'h-[180px] ' : 'h-auto min-h-24'), className)}>
43
- <p className='text-lg font-semibold'>{item.titleAsOption + ', ' + formatPrice(item.price)}</p>
43
+ <p className='text-lg text-center font-semibold'>{item.titleAsOption + ', ' + formatPrice(item.price)}</p>
44
44
  </div>
45
45
  )
46
46
  }
@@ -45,7 +45,7 @@ const CartPanel: React.FC<PropsWithChildren & {
45
45
  {!noCheckout && (<>
46
46
  {!cmmc.cartEmpty && (
47
47
  <Button
48
- variant='secondary'
48
+ variant='primary'
49
49
  rounded='lg'
50
50
  className='mt-12 mx-auto w-full'
51
51
  onClick={() => setCheckoutOpen(true)}
@@ -15,9 +15,9 @@ const CloseButton: React.FC<{
15
15
  variant='ghost'
16
16
  size='icon'
17
17
  onClick={onClose}
18
- className={className}
18
+ className={'group ' + className}
19
19
  >
20
- <ChevronLeft className='w-5 h-5'/>
20
+ <ChevronLeft className='w-5 h-5 group-hover:scale-110 transition-scale transition-duration-300'/>
21
21
  </Button>
22
22
  )
23
23
 
@@ -78,7 +78,7 @@ const CheckoutPanel: React.FC<{
78
78
  <DialogPortal>
79
79
  <div id='PORTAL_OUTER'
80
80
  className={cn(
81
- 'fixed top-0 pt-[44px] md:pt-[80px] shadow-lg ',
81
+ 'fixed top-0 shadow-lg ',
82
82
  'animate-in data-[state=open]:fade-in-90 data-[state=open]:slide-in-from-bottom-10',
83
83
  'sm:zoom-in-90 data-[state=open]:sm:slide-in-from-bottom-0',
84
84
  '!max-w-none w-full h-full min-h-screen bg-transparent backdrop-blur-sm z-50'
@@ -1,4 +1,5 @@
1
1
  export { default as AddToCartWidget } from './add-to-cart-widget'
2
+ export { default as BuyItemButtonWrapper } from './buy-item/buy-item-button-wrapper'
2
3
  export { default as BuyItemButton } from './buy-item/buy-item-button'
3
4
  export { default as BuyItemCard } from './buy-item/buy-item-card'
4
5
  export { default as BuyItemPopup } from './buy-item/buy-item-popup'
@@ -57,7 +57,7 @@ const ProductCard: React.FC<ProductCardProps> = ({
57
57
  aria-label='Placeholder'
58
58
  role='img'
59
59
  aria-roledescription='placeholder'
60
- className='flex h-full items-center justify-center bg-secondary'
60
+ className='flex h-full items-center justify-center bg-background'
61
61
  >
62
62
  <Icons.barcode className='h-9 w-9 text-muted' aria-hidden='true' />
63
63
  </div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hanzo/commerce",
3
- "version": "4.3.1",
3
+ "version": "4.3.3",
4
4
  "description": "Library with shopping cart components.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/",