@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.
Files changed (87) hide show
  1. package/components/add-to-cart-widget.tsx +13 -11
  2. package/components/buy/buy-card.tsx +6 -4
  3. package/components/buy/carousel-buy-card.tsx +3 -2
  4. package/components/buy/multi-family/all-variants-carousel.tsx +3 -5
  5. package/components/buy/multi-family/family-carousel/index.tsx +2 -4
  6. package/components/buy/multi-family/family-carousel/slide.tsx +3 -4
  7. package/components/buy/single-family-selector.tsx +6 -5
  8. package/components/buy/title-and-byline.tsx +4 -3
  9. package/components/cart/cart-panel/cart-line-item.tsx +5 -4
  10. package/components/cart/cart-panel/index.tsx +7 -4
  11. package/components/cart/cart-panel/promo-code.tsx +3 -7
  12. package/components/cart/cart-panel/total-area.tsx +3 -2
  13. package/components/checkout/payment-step-form/cc-button.tsx +3 -2
  14. package/components/checkout/payment-step-form/contact-form.tsx +2 -4
  15. package/components/checkout/payment-step-form/index.tsx +6 -2
  16. package/components/checkout/payment-step-form/methods/bank-transfer.tsx +4 -2
  17. package/components/checkout/payment-step-form/methods/card.tsx +2 -4
  18. package/components/checkout/payment-step-form/methods/crypto.tsx +12 -13
  19. package/components/checkout/shipping-step-form.tsx +2 -6
  20. package/components/item/product-card.tsx +9 -8
  21. package/components/item-selector/button.tsx +8 -8
  22. package/components/item-selector/carousel/index.tsx +4 -5
  23. package/components/item-selector/carousel/slider.tsx +4 -7
  24. package/components/item-selector/quantity-indicator.tsx +3 -1
  25. package/components/node-tabs/index.tsx +34 -41
  26. package/dist/client.js.map +1 -1
  27. package/dist/components/Icons.d.ts +15 -15
  28. package/dist/components/add-to-cart-widget.js +7 -7
  29. package/dist/components/add-to-cart-widget.js.map +1 -1
  30. package/dist/components/buy/buy-card.js +3 -4
  31. package/dist/components/buy/buy-card.js.map +1 -1
  32. package/dist/components/buy/carousel-buy-card.js +1 -1
  33. package/dist/components/buy/carousel-buy-card.js.map +1 -1
  34. package/dist/components/buy/multi-family/all-variants-carousel.js +3 -4
  35. package/dist/components/buy/multi-family/all-variants-carousel.js.map +1 -1
  36. package/dist/components/buy/multi-family/family-carousel/index.js +1 -2
  37. package/dist/components/buy/multi-family/family-carousel/index.js.map +1 -1
  38. package/dist/components/buy/multi-family/family-carousel/slide.js +1 -2
  39. package/dist/components/buy/multi-family/family-carousel/slide.js.map +1 -1
  40. package/dist/components/buy/single-family-selector.js +2 -3
  41. package/dist/components/buy/single-family-selector.js.map +1 -1
  42. package/dist/components/buy/title-and-byline.js +1 -2
  43. package/dist/components/buy/title-and-byline.js.map +1 -1
  44. package/dist/components/cart/cart-panel/cart-line-item.js +3 -4
  45. package/dist/components/cart/cart-panel/cart-line-item.js.map +1 -1
  46. package/dist/components/cart/cart-panel/index.js +3 -4
  47. package/dist/components/cart/cart-panel/index.js.map +1 -1
  48. package/dist/components/cart/cart-panel/promo-code.js +1 -2
  49. package/dist/components/cart/cart-panel/promo-code.js.map +1 -1
  50. package/dist/components/cart/cart-panel/total-area.js +1 -1
  51. package/dist/components/cart/cart-panel/total-area.js.map +1 -1
  52. package/dist/components/checkout/payment-step-form/cc-button.js +1 -1
  53. package/dist/components/checkout/payment-step-form/cc-button.js.map +1 -1
  54. package/dist/components/checkout/payment-step-form/contact-form.js +1 -2
  55. package/dist/components/checkout/payment-step-form/contact-form.js.map +1 -1
  56. package/dist/components/checkout/payment-step-form/index.js +1 -1
  57. package/dist/components/checkout/payment-step-form/index.js.map +1 -1
  58. package/dist/components/checkout/payment-step-form/methods/bank-transfer.js +1 -1
  59. package/dist/components/checkout/payment-step-form/methods/bank-transfer.js.map +1 -1
  60. package/dist/components/checkout/payment-step-form/methods/card.js +1 -2
  61. package/dist/components/checkout/payment-step-form/methods/card.js.map +1 -1
  62. package/dist/components/checkout/payment-step-form/methods/crypto.js +2 -2
  63. package/dist/components/checkout/payment-step-form/methods/crypto.js.map +1 -1
  64. package/dist/components/checkout/shipping-step-form.js +1 -2
  65. package/dist/components/checkout/shipping-step-form.js.map +1 -1
  66. package/dist/components/item/product-card.js +2 -3
  67. package/dist/components/item/product-card.js.map +1 -1
  68. package/dist/components/item-selector/button.js +3 -4
  69. package/dist/components/item-selector/button.js.map +1 -1
  70. package/dist/components/item-selector/carousel/index.d.ts +1 -1
  71. package/dist/components/item-selector/carousel/index.js +3 -4
  72. package/dist/components/item-selector/carousel/index.js.map +1 -1
  73. package/dist/components/item-selector/carousel/slider.js +2 -2
  74. package/dist/components/item-selector/carousel/slider.js.map +1 -1
  75. package/dist/components/item-selector/quantity-indicator.js +1 -1
  76. package/dist/components/item-selector/quantity-indicator.js.map +1 -1
  77. package/dist/components/node-tabs/index.d.ts +2 -1
  78. package/dist/components/node-tabs/index.js +12 -23
  79. package/dist/components/node-tabs/index.js.map +1 -1
  80. package/dist/metering.js.map +1 -1
  81. package/dist/service/debug.js.map +1 -1
  82. package/dist/util/item-selector-options-accessor.d.ts +1 -1
  83. package/dist/util/item-selector-options-accessor.js.map +1 -1
  84. package/dist/util/multi-family-selector-options-accessor.d.ts +1 -1
  85. package/dist/util/multi-family-selector-options-accessor.js.map +1 -1
  86. package/package.json +4 -4
  87. 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 { Button, buttonVariants } from '@hanzo/ui/primitives'
7
- import { cn, type VariantProps } from '@hanzo/ui/util'
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 'xs' and 'default' button heights
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 ? 'xs' : 'default'}
129
+ size={ghost || priSmaller ? 'sm' : 'default'}
128
130
  variant={primary || priSmaller ? 'primary' : 'ghost'}
129
- rounded={ghost ? 'full' : ROUNDED_VAL}
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 ? 'xs' : 'default'}
160
+ size={ghost || priSmaller ? 'sm' : 'default'}
159
161
 
160
162
  variant={primary || priSmaller ? 'primary' : 'ghost'}
161
- rounded={ghost ? 'full' : ROUNDED_VAL}
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 ? 'xs' : 'default'}
183
+ size={ghost || priSmaller ? 'sm' : 'default'}
182
184
  variant={ghost ? 'ghost' : (primary || priSmaller ? 'primary' : 'outline')}
183
- rounded={ROUNDED_VAL}
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 { cn } from '@hanzo/ui/util'
7
- import { ApplyTypography, MediaStack } from '@hanzo/ui/primitives'
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}} clx={(scroll ? 'shrink-0' : '')}/>
247
+ <MediaStack media={cmmc.currentItem} constrainTo={{w: 200, h: 200}} className={(scroll ? 'shrink-0' : '')}/>
246
248
  )}
247
249
  {itemsToShow && (
248
250
  <Selector
@@ -7,8 +7,9 @@ import React, {
7
7
  } from 'react'
8
8
  import { observer } from 'mobx-react-lite'
9
9
 
10
- import { cn } from '@hanzo/ui/util'
11
-
10
+ import {
11
+ cn,
12
+ } from '@hanzo/ui'
12
13
  import type {
13
14
  ItemSelectorProps,
14
15
  LineItem,
@@ -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/primitives'
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} clx='my-4'/>
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/primitives'
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
- } from '@hanzo/ui/primitives'
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 { MediaStack, Skeleton } from '@hanzo/ui/primitives'
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
- clx={'mb-2 ' + (scrollable ? 'shrink-0' : '')}
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 { ApplyTypography } from '@hanzo/ui/primitives'
4
- import { cn } from '@hanzo/ui/util'
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 { cn } from '@hanzo/ui/util'
7
- import { Image } from '@hanzo/ui/primitives'
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
- <Image def={item.img} constrainTo={{w: imgSizePx, h: imgSizePx}} />
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 { Button, ScrollArea } from '@hanzo/ui/primitives'
7
- import { cn } from '@hanzo/ui/util'
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='lg'
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/form'
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 { cn } from '@hanzo/ui/util'
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,5 +1,6 @@
1
- import { Button } from '@hanzo/ui/primitives'
2
-
1
+ import {
2
+ Button,
3
+ } from '@hanzo/ui'
3
4
  import PaymentMethods from './card-icon-row'
4
5
  import type { PropsWithChildren } from 'react'
5
6
 
@@ -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/form'
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 { Tabs, TabsContent, TabsList, TabsTrigger } from '@hanzo/ui/primitives'
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 { Button, toast } from '@hanzo/ui/primitives'
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
- } from '@hanzo/ui/primitives'
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/primitives'
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 defaultValue='eth' />
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/form'
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
- } from '@hanzo/ui/primitives'
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
- {...props}
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}} clx='p-6' />
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
- Image,
9
- Label,
10
- RadioGroup,
11
- ScrollArea
12
- } from '@hanzo/ui/primitives'
13
- import { cn } from '@hanzo/ui/util'
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
- <Image def={img} constrainTo={constrainTo} preload className=''/>
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/primitives'
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} clx='my-4' />
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 { Slider } from '@hanzo/ui/primitives'
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}
@@ -4,7 +4,9 @@ import { observer } from 'mobx-react-lite'
4
4
 
5
5
  import { type LucideProps } from 'lucide-react'
6
6
 
7
- import { cn } from '@hanzo/ui/util'
7
+ import {
8
+ cn,
9
+ } from '@hanzo/ui'
8
10
  import type { LineItem } from '../../types'
9
11
 
10
12
  // Generalize this.