@hanzo/commerce 7.6.5 → 7.7.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.
- package/components/add-to-cart-widget.tsx +13 -11
- package/components/buy/buy-card.tsx +6 -4
- package/components/buy/carousel-buy-card.tsx +3 -2
- package/components/buy/multi-family/all-variants-carousel.tsx +3 -5
- package/components/buy/multi-family/family-carousel/index.tsx +2 -4
- package/components/buy/multi-family/family-carousel/slide.tsx +3 -4
- package/components/buy/single-family-selector.tsx +6 -5
- package/components/buy/title-and-byline.tsx +4 -3
- package/components/cart/cart-panel/cart-line-item.tsx +5 -4
- package/components/cart/cart-panel/index.tsx +7 -4
- package/components/cart/cart-panel/promo-code.tsx +3 -7
- package/components/cart/cart-panel/total-area.tsx +3 -2
- package/components/checkout/payment-step-form/cc-button.tsx +3 -2
- package/components/checkout/payment-step-form/contact-form.tsx +2 -4
- package/components/checkout/payment-step-form/index.tsx +6 -2
- package/components/checkout/payment-step-form/methods/bank-transfer.tsx +4 -2
- package/components/checkout/payment-step-form/methods/card.tsx +2 -4
- package/components/checkout/payment-step-form/methods/crypto.tsx +12 -13
- package/components/checkout/shipping-step-form.tsx +2 -6
- package/components/item/product-card.tsx +9 -8
- package/components/item-selector/button.tsx +8 -8
- package/components/item-selector/carousel/index.tsx +4 -5
- package/components/item-selector/carousel/slider.tsx +4 -7
- package/components/item-selector/quantity-indicator.tsx +3 -1
- package/components/node-tabs/index.tsx +34 -41
- package/dist/client.js.map +1 -1
- package/dist/components/Icons.d.ts +15 -15
- package/dist/components/add-to-cart-widget.js +7 -7
- package/dist/components/add-to-cart-widget.js.map +1 -1
- package/dist/components/buy/buy-card.js +3 -4
- package/dist/components/buy/buy-card.js.map +1 -1
- package/dist/components/buy/carousel-buy-card.js +1 -1
- package/dist/components/buy/carousel-buy-card.js.map +1 -1
- package/dist/components/buy/multi-family/all-variants-carousel.js +3 -4
- package/dist/components/buy/multi-family/all-variants-carousel.js.map +1 -1
- package/dist/components/buy/multi-family/family-carousel/index.js +1 -2
- package/dist/components/buy/multi-family/family-carousel/index.js.map +1 -1
- package/dist/components/buy/multi-family/family-carousel/slide.js +1 -2
- package/dist/components/buy/multi-family/family-carousel/slide.js.map +1 -1
- package/dist/components/buy/single-family-selector.js +2 -3
- package/dist/components/buy/single-family-selector.js.map +1 -1
- package/dist/components/buy/title-and-byline.js +1 -2
- package/dist/components/buy/title-and-byline.js.map +1 -1
- package/dist/components/cart/cart-panel/cart-line-item.js +3 -4
- package/dist/components/cart/cart-panel/cart-line-item.js.map +1 -1
- package/dist/components/cart/cart-panel/index.js +3 -4
- package/dist/components/cart/cart-panel/index.js.map +1 -1
- package/dist/components/cart/cart-panel/promo-code.js +1 -2
- package/dist/components/cart/cart-panel/promo-code.js.map +1 -1
- package/dist/components/cart/cart-panel/total-area.js +1 -1
- package/dist/components/cart/cart-panel/total-area.js.map +1 -1
- package/dist/components/checkout/payment-step-form/cc-button.js +1 -1
- package/dist/components/checkout/payment-step-form/cc-button.js.map +1 -1
- package/dist/components/checkout/payment-step-form/contact-form.js +1 -2
- package/dist/components/checkout/payment-step-form/contact-form.js.map +1 -1
- package/dist/components/checkout/payment-step-form/index.js +1 -1
- package/dist/components/checkout/payment-step-form/index.js.map +1 -1
- package/dist/components/checkout/payment-step-form/methods/bank-transfer.js +1 -1
- package/dist/components/checkout/payment-step-form/methods/bank-transfer.js.map +1 -1
- package/dist/components/checkout/payment-step-form/methods/card.js +1 -2
- package/dist/components/checkout/payment-step-form/methods/card.js.map +1 -1
- package/dist/components/checkout/payment-step-form/methods/crypto.js +2 -2
- package/dist/components/checkout/payment-step-form/methods/crypto.js.map +1 -1
- package/dist/components/checkout/shipping-step-form.js +1 -2
- package/dist/components/checkout/shipping-step-form.js.map +1 -1
- package/dist/components/item/product-card.js +2 -3
- package/dist/components/item/product-card.js.map +1 -1
- package/dist/components/item-selector/button.js +3 -4
- package/dist/components/item-selector/button.js.map +1 -1
- package/dist/components/item-selector/carousel/index.d.ts +1 -1
- package/dist/components/item-selector/carousel/index.js +3 -4
- package/dist/components/item-selector/carousel/index.js.map +1 -1
- package/dist/components/item-selector/carousel/slider.js +2 -2
- package/dist/components/item-selector/carousel/slider.js.map +1 -1
- package/dist/components/item-selector/quantity-indicator.js +1 -1
- package/dist/components/item-selector/quantity-indicator.js.map +1 -1
- package/dist/components/node-tabs/index.d.ts +2 -1
- package/dist/components/node-tabs/index.js +12 -23
- package/dist/components/node-tabs/index.js.map +1 -1
- package/dist/metering.js.map +1 -1
- package/dist/service/debug.js.map +1 -1
- package/dist/util/item-selector-options-accessor.d.ts +1 -1
- package/dist/util/item-selector-options-accessor.js.map +1 -1
- package/dist/util/multi-family-selector-options-accessor.d.ts +1 -1
- package/dist/util/multi-family-selector-options-accessor.js.map +1 -1
- package/package.json +4 -4
- package/hanzo-ui.d.ts +0 -108
|
@@ -3,9 +3,12 @@ import React, { useEffect, useRef } from 'react'
|
|
|
3
3
|
import { reaction, type IReactionDisposer } from 'mobx'
|
|
4
4
|
import { observer } from 'mobx-react-lite'
|
|
5
5
|
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
import {
|
|
7
|
+
Button,
|
|
8
|
+
buttonVariants,
|
|
9
|
+
cn,
|
|
10
|
+
sx,
|
|
11
|
+
} from '@hanzo/ui'
|
|
9
12
|
import Icons from './Icons'
|
|
10
13
|
import type { LineItem } from '../types'
|
|
11
14
|
import { sendFBEvent, sendGAEvent } from '../util/analytics'
|
|
@@ -48,7 +51,6 @@ const AddToCartWidget: React.FC<{
|
|
|
48
51
|
// only for as long as some OTHER file in whatever the consumer scans spells it
|
|
49
52
|
// literally. Tailwind reads source text; a template literal is not a class
|
|
50
53
|
// name, so this one was borrowing a rule it did not ask for.
|
|
51
|
-
const ROUNDED_VAL = 'lg' // the `rounded=` variant prop on Button
|
|
52
54
|
const ROUNDED_CLX = ' rounded-lg ' // the class
|
|
53
55
|
|
|
54
56
|
const ghost = variant === 'minimal'
|
|
@@ -115,7 +117,7 @@ const AddToCartWidget: React.FC<{
|
|
|
115
117
|
return ( item.isInCart ? (
|
|
116
118
|
<div className={cn(
|
|
117
119
|
'flex flex-row items-stretch justify-between ',
|
|
118
|
-
// should match '
|
|
120
|
+
// should match 'sm' and 'default' button heights
|
|
119
121
|
(ghost || priSmaller ? 'h-8' : 'h-9'),
|
|
120
122
|
ROUNDED_CLX,
|
|
121
123
|
(primary || priSmaller ? 'bg-primary' : 'bg-transparent'),
|
|
@@ -124,9 +126,9 @@ const AddToCartWidget: React.FC<{
|
|
|
124
126
|
)}>
|
|
125
127
|
<Button
|
|
126
128
|
aria-label={'Remove a ' + item.title + ' from the cart'}
|
|
127
|
-
size={ghost || priSmaller ? '
|
|
129
|
+
size={ghost || priSmaller ? 'sm' : 'default'}
|
|
128
130
|
variant={primary || priSmaller ? 'primary' : 'ghost'}
|
|
129
|
-
|
|
131
|
+
{...sx(ghost ? 'rounded-full' : 'rounded-lg')}
|
|
130
132
|
className={cn(
|
|
131
133
|
'lg:min-w-0 lg:px-2 grow justify-start group',
|
|
132
134
|
(ghost || priSmaller ? 'px-1' : 'px-2'),
|
|
@@ -155,10 +157,10 @@ const AddToCartWidget: React.FC<{
|
|
|
155
157
|
itemProp='potentialAction'
|
|
156
158
|
itemScope
|
|
157
159
|
itemType='https://schema.org/AddAction'
|
|
158
|
-
size={ghost || priSmaller ? '
|
|
160
|
+
size={ghost || priSmaller ? 'sm' : 'default'}
|
|
159
161
|
|
|
160
162
|
variant={primary || priSmaller ? 'primary' : 'ghost'}
|
|
161
|
-
|
|
163
|
+
{...sx(ghost ? 'rounded-full' : 'rounded-lg')}
|
|
162
164
|
className={cn(
|
|
163
165
|
'lg:min-w-0 lg:px-2 grow justify-end group',
|
|
164
166
|
(ghost || priSmaller ? 'px-1' : 'px-2'),
|
|
@@ -178,9 +180,9 @@ const AddToCartWidget: React.FC<{
|
|
|
178
180
|
itemProp='potentialAction'
|
|
179
181
|
itemScope
|
|
180
182
|
itemType='https://schema.org/AddAction'
|
|
181
|
-
size={ghost || priSmaller ? '
|
|
183
|
+
size={ghost || priSmaller ? 'sm' : 'default'}
|
|
182
184
|
variant={ghost ? 'ghost' : (primary || priSmaller ? 'primary' : 'outline')}
|
|
183
|
-
rounded
|
|
185
|
+
{...sx('rounded-lg')}
|
|
184
186
|
className={cn(buttonClx, className)}
|
|
185
187
|
onClick={inc}
|
|
186
188
|
>
|
|
@@ -3,9 +3,11 @@ import React, { useRef, useEffect, type ComponentType } from 'react'
|
|
|
3
3
|
import { reaction, type IReactionDisposer } from 'mobx'
|
|
4
4
|
import { observer } from 'mobx-react-lite'
|
|
5
5
|
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
import {
|
|
7
|
+
cn,
|
|
8
|
+
ApplyTypography,
|
|
9
|
+
MediaStack,
|
|
10
|
+
} from '@hanzo/ui'
|
|
9
11
|
import type {
|
|
10
12
|
ItemSelectorProps,
|
|
11
13
|
ItemSelectorCompProps,
|
|
@@ -242,7 +244,7 @@ const BuyCard: React.FC<{
|
|
|
242
244
|
<TitleArea title={famTitle} clx=''/>
|
|
243
245
|
)}
|
|
244
246
|
{(cmmc.currentItem && showItemMedia) && (
|
|
245
|
-
<MediaStack media={cmmc.currentItem} constrainTo={{w: 200, h: 200}}
|
|
247
|
+
<MediaStack media={cmmc.currentItem} constrainTo={{w: 200, h: 200}} className={(scroll ? 'shrink-0' : '')}/>
|
|
246
248
|
)}
|
|
247
249
|
{itemsToShow && (
|
|
248
250
|
<Selector
|
|
@@ -3,9 +3,8 @@ import React, { useCallback, useEffect, useRef, useState } from 'react'
|
|
|
3
3
|
import { reaction } from 'mobx'
|
|
4
4
|
import { observer } from 'mobx-react-lite'
|
|
5
5
|
|
|
6
|
-
import { cn } from '@hanzo/ui/util'
|
|
7
|
-
|
|
8
6
|
import {
|
|
7
|
+
cn,
|
|
9
8
|
ApplyTypography,
|
|
10
9
|
type CarouselApi,
|
|
11
10
|
Carousel,
|
|
@@ -14,8 +13,7 @@ import {
|
|
|
14
13
|
CarouselPrevious,
|
|
15
14
|
CarouselNext,
|
|
16
15
|
MediaStack,
|
|
17
|
-
} from '@hanzo/ui
|
|
18
|
-
|
|
16
|
+
} from '@hanzo/ui'
|
|
19
17
|
import type { MultiFamilySelectorProps, LineItem } from '../../../types'
|
|
20
18
|
import {
|
|
21
19
|
formatCurrencyValue,
|
|
@@ -238,7 +236,7 @@ const AllVariantsCarousel: React.FC<MultiFamilySelectorProps> = ({
|
|
|
238
236
|
<CarouselContent>
|
|
239
237
|
{r.current.items.map((item) => (
|
|
240
238
|
<CarouselItem key={item.sku} className={cn('p-2 flex flex-col justify-center items-center', itemClx)}>
|
|
241
|
-
<MediaStack media={item} constrainTo={mediaConstraint}
|
|
239
|
+
<MediaStack media={item} constrainTo={mediaConstraint} className='my-4'/>
|
|
242
240
|
</CarouselItem>
|
|
243
241
|
))}
|
|
244
242
|
</CarouselContent>
|
|
@@ -1,17 +1,15 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
import React, { useCallback, useRef } from 'react'
|
|
3
3
|
|
|
4
|
-
import { cn } from '@hanzo/ui/util'
|
|
5
|
-
|
|
6
4
|
import {
|
|
5
|
+
cn,
|
|
7
6
|
type CarouselApi,
|
|
8
7
|
Carousel,
|
|
9
8
|
CarouselContent,
|
|
10
9
|
CarouselItem,
|
|
11
10
|
CarouselPrevious,
|
|
12
11
|
CarouselNext,
|
|
13
|
-
} from '@hanzo/ui
|
|
14
|
-
|
|
12
|
+
} from '@hanzo/ui'
|
|
15
13
|
import type { MultiFamilySelectorProps } from '../../../../types'
|
|
16
14
|
|
|
17
15
|
import FamilySlide from './slide'
|
|
@@ -3,14 +3,13 @@ import React from 'react'
|
|
|
3
3
|
|
|
4
4
|
import {
|
|
5
5
|
ApplyTypography,
|
|
6
|
-
MediaStack
|
|
7
|
-
|
|
6
|
+
MediaStack,
|
|
7
|
+
cn,
|
|
8
|
+
} from '@hanzo/ui'
|
|
8
9
|
import type { Dimensions } from '@hanzo/ui/types'
|
|
9
10
|
|
|
10
11
|
import type { ItemSelectorOptions, Family, LineItem, ItemSelector } from '../../../../types'
|
|
11
12
|
import { ButtonItemSelector } from '../../..'
|
|
12
|
-
import { cn } from '@hanzo/ui/util'
|
|
13
|
-
|
|
14
13
|
const FamilySlide: React.FC<Omit<ItemSelector, 'items'> & {
|
|
15
14
|
family: Family
|
|
16
15
|
mediaConstraint: Dimensions
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import { observer } from 'mobx-react-lite'
|
|
3
3
|
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
MediaStack,
|
|
6
|
+
Skeleton,
|
|
7
|
+
cn,
|
|
8
|
+
} from '@hanzo/ui'
|
|
5
9
|
import type { Dimensions } from '@hanzo/ui/types'
|
|
6
10
|
|
|
7
11
|
import { useCommerce } from '../..'
|
|
@@ -9,9 +13,6 @@ import { useCommerce } from '../..'
|
|
|
9
13
|
import type { ItemSelectorOptions, ItemSelectorProps, LineItem } from '../../types'
|
|
10
14
|
import TitleAndByline from './title-and-byline'
|
|
11
15
|
import { accessItemOptions } from '../../util'
|
|
12
|
-
import { cn } from '@hanzo/ui/util'
|
|
13
|
-
|
|
14
|
-
|
|
15
16
|
const DEF_MEDIA_CONSTRAINT = {w: 200, h: 200}
|
|
16
17
|
|
|
17
18
|
const SingleFamilySelector: React.FC<{
|
|
@@ -61,7 +62,7 @@ const SingleFamilySelector: React.FC<{
|
|
|
61
62
|
<MediaStack
|
|
62
63
|
media={cmmc.currentItem!}
|
|
63
64
|
constrainTo={mediaConstraint}
|
|
64
|
-
|
|
65
|
+
className={'mb-2 ' + (scrollable ? 'shrink-0' : '')}
|
|
65
66
|
/>
|
|
66
67
|
) : (
|
|
67
68
|
<Skeleton className={'w-[200px] h-[200px] my-2 ' + (scrollable ? 'shrink-0' : '')}/>
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
import {
|
|
4
|
+
ApplyTypography,
|
|
5
|
+
cn,
|
|
6
|
+
} from '@hanzo/ui'
|
|
6
7
|
const TitleAndByline: React.FC<{
|
|
7
8
|
title: string | undefined
|
|
8
9
|
byline?: string | undefined
|
|
@@ -3,9 +3,10 @@
|
|
|
3
3
|
import React from 'react'
|
|
4
4
|
import { observer } from 'mobx-react-lite'
|
|
5
5
|
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
import {
|
|
7
|
+
cn,
|
|
8
|
+
MediaStack,
|
|
9
|
+
} from '@hanzo/ui'
|
|
9
10
|
import type { LineItem } from '../../../types'
|
|
10
11
|
import { formatCurrencyValue } from '../../../util'
|
|
11
12
|
import AddToCartWidget from '../../add-to-cart-widget'
|
|
@@ -53,7 +54,7 @@ const CartLineItem: React.FC<{
|
|
|
53
54
|
>
|
|
54
55
|
<div className='flex flex-row justify-between items-center gap-1' >
|
|
55
56
|
{item.img ? (
|
|
56
|
-
<
|
|
57
|
+
<MediaStack media={item} constrainTo={{w: imgSizePx, h: imgSizePx}} />
|
|
57
58
|
) : ( // placeholder so things align
|
|
58
59
|
<div style={{height: imgSizePx, width: imgSizePx}} className='bg-level-3'/>
|
|
59
60
|
)}
|
|
@@ -3,9 +3,12 @@ import React, { useLayoutEffect, type PropsWithChildren } from 'react'
|
|
|
3
3
|
import { reaction } from 'mobx'
|
|
4
4
|
import { observer } from 'mobx-react-lite'
|
|
5
5
|
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
import {
|
|
7
|
+
Button,
|
|
8
|
+
ScrollArea,
|
|
9
|
+
cn,
|
|
10
|
+
sx,
|
|
11
|
+
} from '@hanzo/ui'
|
|
9
12
|
import type { LineItem } from '../../../types'
|
|
10
13
|
import { useCommerce } from '../../../service/context'
|
|
11
14
|
import { sendFBEvent, sendGAEvent } from '../../../util/analytics'
|
|
@@ -141,7 +144,7 @@ const CartPanel: React.FC<PropsWithChildren & {
|
|
|
141
144
|
<Button
|
|
142
145
|
onClick={_handleCheckout}
|
|
143
146
|
variant='primary'
|
|
144
|
-
rounded
|
|
147
|
+
{...sx('rounded-lg')}
|
|
145
148
|
className={cn('mt-12 mx-auto w-full sm:max-w-[220px]', buttonClx)}
|
|
146
149
|
>
|
|
147
150
|
Checkout
|
|
@@ -9,18 +9,14 @@ import * as z from 'zod'
|
|
|
9
9
|
import { zodResolver } from '@hookform/resolvers/zod'
|
|
10
10
|
import { Check } from 'lucide-react'
|
|
11
11
|
|
|
12
|
-
import {
|
|
13
|
-
Button,
|
|
14
|
-
Input
|
|
15
|
-
} from '@hanzo/ui/primitives'
|
|
16
|
-
|
|
17
12
|
import {
|
|
13
|
+
Button,
|
|
14
|
+
Input,
|
|
18
15
|
Form,
|
|
19
16
|
FormControl,
|
|
20
17
|
FormField,
|
|
21
18
|
FormItem,
|
|
22
|
-
} from '@hanzo/ui
|
|
23
|
-
|
|
19
|
+
} from '@hanzo/ui'
|
|
24
20
|
import { useCommerce } from '../../../service/context'
|
|
25
21
|
import type { Promo } from '../../../types'
|
|
26
22
|
import getPromoFromApi from '../../../util/promo-codes'
|
|
@@ -2,8 +2,9 @@
|
|
|
2
2
|
import React, { Suspense } from 'react'
|
|
3
3
|
import { observer } from 'mobx-react-lite'
|
|
4
4
|
|
|
5
|
-
import {
|
|
6
|
-
|
|
5
|
+
import {
|
|
6
|
+
cn,
|
|
7
|
+
} from '@hanzo/ui'
|
|
7
8
|
import { formatCurrencyValue } from '../../../util'
|
|
8
9
|
import PromoCode from './promo-code'
|
|
9
10
|
import { useCommerce } from '../../../service/context'
|
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
import { Input } from '@hanzo/ui/primitives'
|
|
2
|
-
|
|
3
1
|
import {
|
|
2
|
+
Input,
|
|
4
3
|
Form,
|
|
5
4
|
FormControl,
|
|
6
5
|
FormField,
|
|
7
6
|
FormItem,
|
|
8
7
|
FormMessage,
|
|
9
|
-
} from '@hanzo/ui
|
|
10
|
-
|
|
8
|
+
} from '@hanzo/ui'
|
|
11
9
|
import type { ContactFormType } from '../../../types'
|
|
12
10
|
|
|
13
11
|
const ContactForm: React.FC<{
|
|
@@ -6,8 +6,12 @@ import { zodResolver } from '@hookform/resolvers/zod'
|
|
|
6
6
|
import * as z from 'zod'
|
|
7
7
|
import { useForm } from 'react-hook-form'
|
|
8
8
|
|
|
9
|
-
import {
|
|
10
|
-
|
|
9
|
+
import {
|
|
10
|
+
Tabs,
|
|
11
|
+
TabsContent,
|
|
12
|
+
TabsList,
|
|
13
|
+
TabsTrigger,
|
|
14
|
+
} from '@hanzo/ui'
|
|
11
15
|
import { useCommerce } from '../../../service/context'
|
|
12
16
|
import { sendFBEvent, sendGAEvent } from '../../../util/analytics'
|
|
13
17
|
import type { CheckoutStepComponentProps, TransactionStatus } from '../../../types'
|
|
@@ -3,8 +3,10 @@
|
|
|
3
3
|
import React from 'react'
|
|
4
4
|
import { Copy } from 'lucide-react'
|
|
5
5
|
|
|
6
|
-
import {
|
|
7
|
-
|
|
6
|
+
import {
|
|
7
|
+
Button,
|
|
8
|
+
toast,
|
|
9
|
+
} from '@hanzo/ui'
|
|
8
10
|
import type { PaymentMethodComponentProps } from '../../../../types'
|
|
9
11
|
|
|
10
12
|
import ContactForm from '../contact-form'
|
|
@@ -11,10 +11,8 @@ import {
|
|
|
11
11
|
Button,
|
|
12
12
|
Separator,
|
|
13
13
|
Skeleton,
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
import { cn } from '@hanzo/ui/util'
|
|
17
|
-
|
|
14
|
+
cn,
|
|
15
|
+
} from '@hanzo/ui'
|
|
18
16
|
import { useCommerce } from '../../../../service/context'
|
|
19
17
|
import { processSquareCardPayment } from '../../../../util'
|
|
20
18
|
import type { PaymentMethodComponentProps } from '../../../../types'
|
|
@@ -6,18 +6,17 @@ import { observer } from 'mobx-react-lite'
|
|
|
6
6
|
|
|
7
7
|
import { ethers } from 'ethers'
|
|
8
8
|
|
|
9
|
-
import {
|
|
10
|
-
Button,
|
|
11
|
-
Input,
|
|
12
|
-
Select,
|
|
13
|
-
SelectContent,
|
|
14
|
-
SelectGroup,
|
|
15
|
-
SelectItem,
|
|
16
|
-
SelectTrigger,
|
|
17
|
-
SelectValue,
|
|
18
|
-
toast
|
|
19
|
-
} from '@hanzo/ui
|
|
20
|
-
|
|
9
|
+
import {
|
|
10
|
+
Button,
|
|
11
|
+
Input,
|
|
12
|
+
Select,
|
|
13
|
+
SelectContent,
|
|
14
|
+
SelectGroup,
|
|
15
|
+
SelectItem,
|
|
16
|
+
SelectTrigger,
|
|
17
|
+
SelectValue,
|
|
18
|
+
toast,
|
|
19
|
+
} from '@hanzo/ui'
|
|
21
20
|
import Eth from '../crypto-icons/eth'
|
|
22
21
|
import { useCommerce } from '../../../../service/context'
|
|
23
22
|
import type { PaymentMethodComponentProps } from '../../../../types'
|
|
@@ -178,7 +177,7 @@ const PayWithCrypto: React.FC<PaymentMethodComponentProps> = observer(({
|
|
|
178
177
|
<div className='flex gap-2 grid grid-cols-3'>
|
|
179
178
|
<Select onValueChange={(token) => {/*ONLY ETH setSelectedToken(token) */}} defaultValue='eth'>
|
|
180
179
|
<SelectTrigger>
|
|
181
|
-
<SelectValue
|
|
180
|
+
<SelectValue />
|
|
182
181
|
</SelectTrigger>
|
|
183
182
|
<SelectContent>
|
|
184
183
|
<SelectGroup>
|
|
@@ -11,17 +11,13 @@ import {
|
|
|
11
11
|
SelectContent,
|
|
12
12
|
SelectItem,
|
|
13
13
|
SelectTrigger,
|
|
14
|
-
SelectValue
|
|
15
|
-
} from '@hanzo/ui/primitives'
|
|
16
|
-
|
|
17
|
-
import {
|
|
14
|
+
SelectValue,
|
|
18
15
|
Form,
|
|
19
16
|
FormControl,
|
|
20
17
|
FormField,
|
|
21
18
|
FormItem,
|
|
22
19
|
FormMessage,
|
|
23
|
-
} from '@hanzo/ui
|
|
24
|
-
|
|
20
|
+
} from '@hanzo/ui'
|
|
25
21
|
import { useCommerce } from '../../service/context'
|
|
26
22
|
|
|
27
23
|
import countries from '../../util/countries'
|
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
4
|
Card,
|
|
5
5
|
CardContent,
|
|
6
6
|
CardFooter,
|
|
7
7
|
CardHeader,
|
|
8
8
|
CardTitle,
|
|
9
|
-
MediaStack
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
import { cn } from '@hanzo/ui/util'
|
|
13
|
-
|
|
9
|
+
MediaStack,
|
|
10
|
+
cn,
|
|
11
|
+
} from '@hanzo/ui'
|
|
14
12
|
import { formatCurrencyValue } from '../../util'
|
|
15
13
|
import type { LineItem } from '../../types'
|
|
16
14
|
|
|
@@ -29,7 +27,10 @@ const ProductCard: React.FC<ProductCardProps> = ({
|
|
|
29
27
|
itemScope
|
|
30
28
|
itemType='https://schema.org/Product'
|
|
31
29
|
className={cn('max-h-[360px] lg:min-w-[200px] max-w-[260px] overflow-hidden', className)}
|
|
32
|
-
|
|
30
|
+
// A div's whole attribute set, spread onto a cross-platform component that
|
|
31
|
+
// names a few of them differently. The element a Card renders IS a div, and
|
|
32
|
+
// it is the one these reach.
|
|
33
|
+
{...(props as object)}
|
|
33
34
|
>
|
|
34
35
|
{/* Standard schema.org Product microdata. Neutral and analytics-agnostic:
|
|
35
36
|
track.js `annotate`, GA4 Merchant, or any reader picks up the item with
|
|
@@ -38,7 +39,7 @@ const ProductCard: React.FC<ProductCardProps> = ({
|
|
|
38
39
|
<meta itemProp='name' content={item.title} />
|
|
39
40
|
<meta itemProp='sku' content={item.sku} />
|
|
40
41
|
<CardHeader className='w-full border-b p-6 min-h-[180px] max-h-[240px] relative'>
|
|
41
|
-
<MediaStack media={item} constrainTo={{w: 700, h:700}}
|
|
42
|
+
<MediaStack media={item} constrainTo={{w: 700, h:700}} className='p-6' />
|
|
42
43
|
</CardHeader>
|
|
43
44
|
<CardContent className='grid gap-2.5 p-4'>
|
|
44
45
|
<CardTitle className='text-sm sm:text-base flex flex-col justify-start items-center line-clap-3'>
|
|
@@ -4,13 +4,13 @@ import { observer } from 'mobx-react-lite'
|
|
|
4
4
|
|
|
5
5
|
import * as RadioGroupPrimitive from "@radix-ui/react-radio-group"
|
|
6
6
|
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
7
|
+
import {
|
|
8
|
+
Label,
|
|
9
|
+
RadioGroup,
|
|
10
|
+
ScrollArea,
|
|
11
|
+
cn,
|
|
12
|
+
MediaStack,
|
|
13
|
+
} from '@hanzo/ui'
|
|
14
14
|
import type { Dimensions } from '@hanzo/ui/types'
|
|
15
15
|
|
|
16
16
|
import type { ItemSelectorProps, LineItem } from '../../types'
|
|
@@ -70,7 +70,7 @@ const ImageRadioGroupItem = React.forwardRef<
|
|
|
70
70
|
value={item.sku}
|
|
71
71
|
>
|
|
72
72
|
{img ? (
|
|
73
|
-
<
|
|
73
|
+
<MediaStack media={{img}} constrainTo={constrainTo} />
|
|
74
74
|
) : ( // placeholder so things align
|
|
75
75
|
<div style={{height: constrainTo.h, width: constrainTo.w}}/>
|
|
76
76
|
)}
|
|
@@ -3,10 +3,8 @@ import React, { useCallback, useEffect, useRef, useState } from 'react'
|
|
|
3
3
|
import { reaction } from 'mobx'
|
|
4
4
|
import { observer } from 'mobx-react-lite'
|
|
5
5
|
|
|
6
|
-
import { cn } from '@hanzo/ui/util'
|
|
7
|
-
import type { Dimensions } from '@hanzo/ui/types'
|
|
8
|
-
|
|
9
6
|
import {
|
|
7
|
+
cn,
|
|
10
8
|
ApplyTypography,
|
|
11
9
|
type CarouselOptions,
|
|
12
10
|
type CarouselApi,
|
|
@@ -16,7 +14,8 @@ import {
|
|
|
16
14
|
CarouselPrevious,
|
|
17
15
|
CarouselNext,
|
|
18
16
|
MediaStack,
|
|
19
|
-
} from '@hanzo/ui
|
|
17
|
+
} from '@hanzo/ui'
|
|
18
|
+
import type { Dimensions } from '@hanzo/ui/types'
|
|
20
19
|
|
|
21
20
|
import type { ItemSelectorProps, LineItem } from '../../../types'
|
|
22
21
|
import { formatCurrencyValue, accessItemOptions } from '../../../util'
|
|
@@ -43,7 +42,7 @@ const ItemSlide: React.FC<{
|
|
|
43
42
|
clx=''
|
|
44
43
|
}) => (
|
|
45
44
|
<CarouselItem className={cn('p-2 flex flex-col justify-center items-center', clx)}>
|
|
46
|
-
<MediaStack media={item} constrainTo={constrainTo}
|
|
45
|
+
<MediaStack media={item} constrainTo={constrainTo} className='my-4' />
|
|
47
46
|
</CarouselItem>
|
|
48
47
|
)
|
|
49
48
|
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
import React, { useEffect, useState } from 'react'
|
|
3
3
|
|
|
4
|
-
import {
|
|
5
|
-
|
|
4
|
+
import {
|
|
5
|
+
Slider,
|
|
6
|
+
} from '@hanzo/ui'
|
|
6
7
|
const ItemCarouselSlider: React.FC<{
|
|
7
8
|
clx?: string
|
|
8
9
|
setScrollTo: (scrollTo: (index: number) => void) => void
|
|
@@ -22,11 +23,7 @@ const ItemCarouselSlider: React.FC<{
|
|
|
22
23
|
|
|
23
24
|
return (
|
|
24
25
|
<Slider
|
|
25
|
-
className={clx}
|
|
26
|
-
thumbClx='w-8 border-muted border-2 bg-level-1 focus-visible:ring-0 focus-visible:ring-offset-0 transition-none'
|
|
27
|
-
trackBgClx='bg-level-3'
|
|
28
|
-
rangeBgClx='bg-level-3'
|
|
29
|
-
thumbSlidingClx='bg-muted-2'
|
|
26
|
+
className={clx}
|
|
30
27
|
defaultValue={[0]}
|
|
31
28
|
min={0}
|
|
32
29
|
max={numStops - 1}
|