@hanzo/commerce 4.3.2 → 4.4.0

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'
@@ -71,11 +71,11 @@ const AddToCartWidget: React.FC<{
71
71
  <Icons.trash className={iconClx} aria-hidden='true'/>
72
72
  )}
73
73
  </Button>
74
- <div className={'text-sm flex items-center cursor-default xs:px-2 ' + digitClx} >{item.quantity}</div>
74
+ <div className={'text-sm flex items-center cursor-default xs:px-2 text-primary-fg ' + digitClx} >{item.quantity}</div>
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}
@@ -81,7 +81,7 @@ const BuyItemCard: React.FC<{
81
81
  category={cmmc.specifiedCategories[0]}
82
82
  selectedItemRef={cmmc /* ...conveniently. :) */ }
83
83
  selectSku={cmmc.setCurrentItem.bind(cmmc)}
84
- className={!renderFacetTabs && mobile ? 'border-t-2 ' : ''}
84
+ className=''
85
85
  onQuantityChanged={onQuantityChanged}
86
86
  />
87
87
  )}
@@ -1,8 +1,14 @@
1
1
  'use client'
2
2
  import React, { useState, type ReactNode } from 'react'
3
3
 
4
- import { X as LucideX} from 'lucide-react'
5
- import { Sheet, SheetContent, SheetTrigger } from '@hanzo/ui/primitives'
4
+ //import { X as LucideX} from 'lucide-react'
5
+ //import { Sheet, SheetContent, SheetTrigger } from '@hanzo/ui/primitives'
6
+
7
+ import {
8
+ Drawer,
9
+ DrawerTrigger,
10
+ DrawerContent,
11
+ } from '@hanzo/ui/primitives'
6
12
 
7
13
  import { cn } from '@hanzo/ui/util'
8
14
 
@@ -31,17 +37,17 @@ const BuyItemMobileDrawer: React.FC<{
31
37
  }
32
38
 
33
39
  return (
34
- <Sheet open={open} onOpenChange={setOpen} >
35
- <SheetTrigger asChild className={triggerClx}>
40
+ <Drawer open={open} onOpenChange={setOpen} >
41
+ <DrawerTrigger asChild className={triggerClx}>
36
42
  {trigger}
37
- </SheetTrigger>
38
- <SheetContent
39
- className={cn('rounded-tl-xl rounded-tr-xl p-0 overflow-hidden border-none', drawerClx)}
40
- side="bottom"
43
+ </DrawerTrigger>
44
+ <DrawerContent
45
+ className={cn('rounded-tl-xl rounded-tr-xl p-0 overflow-hidden', drawerClx)}
46
+ // side="bottom"
41
47
  >
42
48
  <BuyItemCard skuPath={skuPath} mobile onQuantityChanged={onQuantityChanged} className={cn("w-full relative ", cardClx)}/>
43
- </SheetContent>
44
- </Sheet>
49
+ </DrawerContent>
50
+ </Drawer>
45
51
  )
46
52
  }
47
53
 
@@ -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)}
@@ -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'
@@ -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.2",
3
+ "version": "4.4.0",
4
4
  "description": "Library with shopping cart components.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/",