@hanzo/commerce 7.1.32 → 7.1.34
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.
package/components/index.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
export { default as AddToCartWidget } from './add-to-cart-widget'
|
|
2
2
|
export { default as CarouselBuyCard } from './buy/carousel-buy-card'
|
|
3
3
|
|
|
4
|
-
export { default as CartAccordian } from './cart/cart-accordian'
|
|
5
4
|
export { default as CartPanel } from './cart/cart-panel'
|
|
6
5
|
|
|
7
6
|
export { default as Icons } from './Icons'
|
package/package.json
CHANGED
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
'use client'
|
|
2
|
-
import React from 'react'
|
|
3
|
-
import { observer } from 'mobx-react-lite'
|
|
4
|
-
|
|
5
|
-
import { ChevronRight } from 'lucide-react'
|
|
6
|
-
|
|
7
|
-
import {
|
|
8
|
-
Accordion,
|
|
9
|
-
AccordionContent,
|
|
10
|
-
AccordionItem,
|
|
11
|
-
AccordionTrigger,
|
|
12
|
-
} from '@hanzo/ui/primitives'
|
|
13
|
-
import { cn } from '@hanzo/ui/util'
|
|
14
|
-
|
|
15
|
-
import { formatCurrencyValue } from '../../util'
|
|
16
|
-
import { useCommerce } from '../../context'
|
|
17
|
-
|
|
18
|
-
import CartPanel from './cart-panel'
|
|
19
|
-
|
|
20
|
-
const CartAccordian: React.FC<{
|
|
21
|
-
icon?: React.ReactNode
|
|
22
|
-
clx?: string
|
|
23
|
-
triggerClx?: string
|
|
24
|
-
panelClx?: string
|
|
25
|
-
scrollAfter: number
|
|
26
|
-
scrollHeightClx: string
|
|
27
|
-
}> = observer(({
|
|
28
|
-
icon,
|
|
29
|
-
clx='',
|
|
30
|
-
panelClx='',
|
|
31
|
-
triggerClx='',
|
|
32
|
-
scrollAfter,
|
|
33
|
-
scrollHeightClx
|
|
34
|
-
}) => {
|
|
35
|
-
const cmmc = useCommerce()
|
|
36
|
-
return (
|
|
37
|
-
<Accordion type="single" collapsible className={clx}>
|
|
38
|
-
<AccordionItem value="cart" className='w-full border-b-0'>
|
|
39
|
-
<AccordionTrigger className={'!no-underline group flex justify-between '} headerClx={ triggerClx}>
|
|
40
|
-
<div className='flex gap-0 items-center'>
|
|
41
|
-
{icon}
|
|
42
|
-
<h5 className='text-sm sm:text-xl grow'>
|
|
43
|
-
<span className='group-data-[state=open]:hidden' >Order Total:</span>
|
|
44
|
-
<span className='group-data-[state=closed]:hidden' >Your Order</span>
|
|
45
|
-
</h5>
|
|
46
|
-
</div>
|
|
47
|
-
<div className='flex gap-1 items-center'>
|
|
48
|
-
<h5 className='text-sm sm:text-xl grow truncate'>{formatCurrencyValue(cmmc.promoAppliedCartTotal)}</h5>
|
|
49
|
-
<ChevronRight className="h-5 w-5 -mr-2 shrink-0 transition-transform duration-200 group-data-[state=open]:rotate-90" />
|
|
50
|
-
</div>
|
|
51
|
-
</AccordionTrigger>
|
|
52
|
-
<AccordionContent className='data-[state=open]:mb-4'>
|
|
53
|
-
<CartPanel
|
|
54
|
-
className={cn('w-full', panelClx)}
|
|
55
|
-
scrollAfter={scrollAfter}
|
|
56
|
-
scrollHeightClx={scrollHeightClx}
|
|
57
|
-
listClx='mt-0'
|
|
58
|
-
itemClx='mt-2'
|
|
59
|
-
totalClx='sticky px-1 pr-2 border-t -bottom-[1px] bg-background'
|
|
60
|
-
showShipping
|
|
61
|
-
showPromoCode
|
|
62
|
-
/>
|
|
63
|
-
</AccordionContent>
|
|
64
|
-
</AccordionItem>
|
|
65
|
-
</Accordion>
|
|
66
|
-
)
|
|
67
|
-
})
|
|
68
|
-
|
|
69
|
-
export default CartAccordian
|