@luxfi/ui 5.5.5 → 5.5.6
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/commerce/ui/context.tsx +13 -16
- package/components/access-code-input.tsx +3 -4
- package/components/analytics.tsx +8 -17
- package/components/auth/login-panel.tsx +7 -6
- package/components/auth/login.tsx +1 -1
- package/components/auth/widget.tsx +1 -1
- package/components/back-button.tsx +4 -7
- package/components/chat-widget.tsx +5 -6
- package/components/commerce/bag-button.tsx +8 -7
- package/components/commerce/buy-button.tsx +2 -3
- package/components/commerce/checkout-button.tsx +12 -10
- package/components/commerce/checkout-panel/cart-accordian.tsx +3 -4
- package/components/commerce/checkout-panel/desktop-cp.tsx +5 -6
- package/components/commerce/checkout-panel/index.tsx +1 -1
- package/components/commerce/checkout-panel/mobile-cp.tsx +4 -4
- package/components/commerce/checkout-panel/policy-links.tsx +7 -12
- package/components/commerce/checkout-panel/steps-indicator.tsx +1 -1
- package/components/commerce/desktop-bag-popup.tsx +1 -1
- package/components/commerce/drawer/micro.tsx +30 -30
- package/components/commerce/drawer/shell.tsx +3 -5
- package/components/contact-dialog/contact-form.tsx +6 -13
- package/components/contact-dialog/index.tsx +2 -2
- package/components/copyright.tsx +3 -2
- package/components/drawer-margin.tsx +2 -2
- package/components/footer.tsx +6 -7
- package/components/header/desktop-nav-menu.tsx +6 -6
- package/components/header/desktop.tsx +5 -5
- package/components/header/index.tsx +1 -1
- package/components/header/mobile-bag-drawer.tsx +1 -1
- package/components/header/mobile-menu-toggle-button.tsx +5 -6
- package/components/header/mobile-nav-menu-ai.tsx +13 -12
- package/components/header/mobile-nav-menu-item.tsx +12 -11
- package/components/header/mobile-nav-menu.tsx +17 -16
- package/components/header/mobile.tsx +7 -8
- package/components/icons/social-icon.tsx +1 -1
- package/components/logo.tsx +3 -2
- package/components/main.tsx +3 -4
- package/components/mini-chart/mini-chart.tsx +2 -1
- package/next/font/font-desc.ts +18 -0
- package/next/font/fonts.ts +40 -0
- package/next/font/get-app-router-font-classes.ts +14 -12
- package/next/font/load-and-return-lux-next-fonts-on-import.ts +16 -24
- package/next/font/local/Zen-Variable.woff2 +0 -0
- package/next/font/next-font-desc.ts +18 -17
- package/next/head-metadata/index.tsx +7 -6
- package/next/head-metadata/next-metadata.ts +49 -0
- package/package.json +9 -10
- package/root-layout/index.tsx +39 -19
- package/style/fonts/Zen-Variable.woff2 +0 -0
- package/style/lux-colors.css +0 -1
- package/style/lux-fonts.css +5 -11
- package/style/lux-global-non-next.css +9 -9
- package/style/lux-global.css +56 -21
- package/tsconfig.json +8 -0
- package/next/font/local/Druk-Wide-Bold.ttf +0 -0
- package/next/font/local/Druk-Wide-Medium.ttf +0 -0
- package/next/head-metadata/from-next/metadata-types.ts +0 -158
- package/next/head-metadata/from-next/opengraph-types.ts +0 -267
- package/next/head-metadata/from-next/twitter-types.ts +0 -92
- package/style/fonts/Druk-Wide-Bold.ttf +0 -0
- package/style/fonts/Druk-Wide-Medium.ttf +0 -0
- package/tailwind/fontFamily.tailwind.lux.ts +0 -18
- package/tailwind/index.ts +0 -2
- package/tailwind/lux-tw-fonts.ts +0 -40
- package/tailwind/tailwind.config.lux-preset.ts +0 -10
package/commerce/ui/context.tsx
CHANGED
|
@@ -12,13 +12,17 @@ import { usePathname } from 'next/navigation'
|
|
|
12
12
|
import { useDebounceCallback } from 'usehooks-ts'
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
import { preset as twConfig } from '@hanzo/ui/tailwind'
|
|
16
15
|
import { useCommerce } from '@hanzo/commerce'
|
|
17
16
|
|
|
18
17
|
import type { CommerceDrawer, SelectAndBuy } from './store'
|
|
19
18
|
import { CommerceUIStore } from './store'
|
|
20
19
|
import conf from './conf'
|
|
21
20
|
|
|
21
|
+
/** The `md` rung: below this the commerce drawer behaves as a mobile sheet.
|
|
22
|
+
* It used to be read out of a Tailwind preset's `screens.md`, which is one
|
|
23
|
+
* more place for a number that belongs in one. */
|
|
24
|
+
const DESKTOP_MIN = 768
|
|
25
|
+
|
|
22
26
|
const LOG = false ////////////////////
|
|
23
27
|
const log = (s: string) => {
|
|
24
28
|
if (LOG) {
|
|
@@ -48,23 +52,16 @@ const CommerceUIProvider: React.FC<PropsWithChildren> = ({
|
|
|
48
52
|
const storeRef = useRef<CommerceUIStore>(new CommerceUIStore(cmmc, conf))
|
|
49
53
|
const prevPathRef = useRef<string>('initial')
|
|
50
54
|
|
|
51
|
-
const onResize = () => {
|
|
52
|
-
const width = window.innerWidth
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
if ('md' in twConfig.theme?.screens && typeof twConfig.theme?.screens.md === 'string') {
|
|
57
|
-
desktopMin = parseInt(twConfig.theme?.screens.md)
|
|
58
|
-
}
|
|
59
|
-
if (width < desktopMin) {
|
|
60
|
-
if (!storeRef.current.isMobile) {
|
|
61
|
-
storeRef.current.setMobile(true)
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
else if (storeRef.current.isMobile) {
|
|
65
|
-
storeRef.current.setMobile(false)
|
|
55
|
+
const onResize = () => {
|
|
56
|
+
const width = window.innerWidth
|
|
57
|
+
if (width < DESKTOP_MIN) {
|
|
58
|
+
if (!storeRef.current.isMobile) {
|
|
59
|
+
storeRef.current.setMobile(true)
|
|
66
60
|
}
|
|
67
61
|
}
|
|
62
|
+
else if (storeRef.current.isMobile) {
|
|
63
|
+
storeRef.current.setMobile(false)
|
|
64
|
+
}
|
|
68
65
|
storeRef.current.setViewportHeight(window.innerHeight)
|
|
69
66
|
}
|
|
70
67
|
|
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import { useState } from 'react'
|
|
4
4
|
import { InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot } from '@hanzo/ui/primitives'
|
|
5
|
-
import { cn } from '@hanzo/ui
|
|
6
|
-
|
|
5
|
+
import { Box, cn } from '@hanzo/ui'
|
|
7
6
|
const AccessCodeInput: React.FC<{
|
|
8
7
|
onSuccess?: () => void
|
|
9
8
|
onFail?: () => void
|
|
@@ -35,7 +34,7 @@ const AccessCodeInput: React.FC<{
|
|
|
35
34
|
}
|
|
36
35
|
|
|
37
36
|
return (
|
|
38
|
-
<
|
|
37
|
+
<Box className={cn('flex flex-col gap-2 mx-auto w-full text-center items-center', className)}>
|
|
39
38
|
<InputOTP
|
|
40
39
|
className='mx-auto'
|
|
41
40
|
maxLength={6}
|
|
@@ -64,7 +63,7 @@ const AccessCodeInput: React.FC<{
|
|
|
64
63
|
null
|
|
65
64
|
}
|
|
66
65
|
</p>
|
|
67
|
-
</
|
|
66
|
+
</Box>
|
|
68
67
|
)
|
|
69
68
|
}
|
|
70
69
|
|
package/components/analytics.tsx
CHANGED
|
@@ -1,23 +1,14 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
|
|
3
|
-
import { useEffect } from 'react'
|
|
4
3
|
import { GoogleAnalytics } from '@next/third-parties/google'
|
|
5
|
-
import { FacebookPixel } from '../next/analytics'
|
|
6
|
-
|
|
7
|
-
const Analytics = () => {
|
|
8
4
|
|
|
9
|
-
|
|
10
|
-
document.body.style.display = 'flex'
|
|
11
|
-
}, [])
|
|
5
|
+
import { FacebookPixel } from '../next/analytics'
|
|
12
6
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}
|
|
7
|
+
const Analytics = () => (
|
|
8
|
+
<>
|
|
9
|
+
<FacebookPixel />
|
|
10
|
+
<GoogleAnalytics gaId={process.env.NEXT_PUBLIC_GA_MEASUREMENT_ID ?? ''} />
|
|
11
|
+
</>
|
|
12
|
+
)
|
|
20
13
|
|
|
21
|
-
export {
|
|
22
|
-
Analytics as default
|
|
23
|
-
}
|
|
14
|
+
export { Analytics as default }
|
|
@@ -3,13 +3,12 @@
|
|
|
3
3
|
import React from 'react'
|
|
4
4
|
import Link from 'next/link'
|
|
5
5
|
|
|
6
|
-
import { cn } from '@hanzo/ui
|
|
6
|
+
import { Box, cn } from '@hanzo/ui'
|
|
7
7
|
import { Button, Carousel, CarouselContent, CarouselItem } from '@hanzo/ui/primitives'
|
|
8
8
|
|
|
9
9
|
import Login from './login'
|
|
10
10
|
import { LuxLogo } from '@luxfi/logo'
|
|
11
11
|
import Logo from '../logo'
|
|
12
|
-
import { EmblaAutoplay } from '..'
|
|
13
12
|
import { legal } from '../../site-def/footer'
|
|
14
13
|
|
|
15
14
|
const LoginPanel: React.FC<{
|
|
@@ -23,7 +22,7 @@ const LoginPanel: React.FC<{
|
|
|
23
22
|
}) => {
|
|
24
23
|
|
|
25
24
|
return (
|
|
26
|
-
<
|
|
25
|
+
<Box className={cn('grid grid-cols-1 md:grid-cols-2', className)}>
|
|
27
26
|
<div className='hidden md:flex w-full h-full bg-[radial-gradient(circle_at_24.1%_68.8%_,_rgba(15,14,14,0)_,_rgba(9,9,9,99.4))] flex-row items-end justify-end overflow-y-auto min-h-screen'>
|
|
28
27
|
<div className='h-full w-full max-w-[750px] px-8 pt-0'>
|
|
29
28
|
<div className='h-full w-full max-w-[550px] mx-auto flex flex-col justify-between min-h-screen py-10'>
|
|
@@ -35,9 +34,11 @@ const LoginPanel: React.FC<{
|
|
|
35
34
|
<Logo size='md' variant='wordmark' />
|
|
36
35
|
</Button>
|
|
37
36
|
<Carousel
|
|
38
|
-
|
|
37
|
+
// Autoplay is an option now, not a plugin — and it holds while the
|
|
38
|
+
// pointer is over the carousel or focus is inside it, which is
|
|
39
|
+
// what `stopOnInteraction` was asking for.
|
|
40
|
+
options={{ align: 'center', loop: true, autoplay: 5000 }}
|
|
39
41
|
className='w-full'
|
|
40
|
-
plugins={[EmblaAutoplay({ delay: 5000, stopOnInteraction: true })]}
|
|
41
42
|
>
|
|
42
43
|
<CarouselContent>
|
|
43
44
|
{reviews.map(({ text, author, href }, index) => (
|
|
@@ -75,7 +76,7 @@ const LoginPanel: React.FC<{
|
|
|
75
76
|
</div>
|
|
76
77
|
</div>
|
|
77
78
|
</div>
|
|
78
|
-
</
|
|
79
|
+
</Box>
|
|
79
80
|
)
|
|
80
81
|
}
|
|
81
82
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import React, { useContext } from 'react'
|
|
4
4
|
|
|
5
5
|
import { Button, Popover, PopoverContent, PopoverTrigger, Separator } from '@hanzo/ui/primitives'
|
|
6
|
-
import { cn } from '@hanzo/ui
|
|
6
|
+
import { cn } from '@hanzo/ui'
|
|
7
7
|
import { IamContext, useIam, useIamIdentity } from '@hanzo/iam/react'
|
|
8
8
|
|
|
9
9
|
import { remember } from './resume'
|
|
@@ -4,17 +4,14 @@ import { useRouter } from 'next/navigation'
|
|
|
4
4
|
|
|
5
5
|
import { ChevronLeft } from 'lucide-react'
|
|
6
6
|
|
|
7
|
-
|
|
8
7
|
import {
|
|
9
8
|
Button,
|
|
10
9
|
buttonVariants,
|
|
11
10
|
} from '@hanzo/ui/primitives'
|
|
12
|
-
|
|
13
|
-
import type { VariantProps } from '@hanzo/ui/util'
|
|
14
|
-
|
|
11
|
+
import { css, type ButtonSize, type ButtonVariant } from '@hanzo/ui'
|
|
15
12
|
const BackButton: React.FC<{
|
|
16
|
-
variant?:
|
|
17
|
-
size?:
|
|
13
|
+
variant?: { variant?: ButtonVariant | null; size?: ButtonSize | null }['variant']
|
|
14
|
+
size?: { variant?: ButtonVariant | null; size?: ButtonSize | null }['size']
|
|
18
15
|
onBack?: () => void
|
|
19
16
|
clx?: string
|
|
20
17
|
iconClx?: string
|
|
@@ -41,7 +38,7 @@ const BackButton: React.FC<{
|
|
|
41
38
|
onClick={back}
|
|
42
39
|
className={clx}
|
|
43
40
|
>
|
|
44
|
-
<ChevronLeft
|
|
41
|
+
<ChevronLeft style={css(iconClx)}/>
|
|
45
42
|
</Button>
|
|
46
43
|
)
|
|
47
44
|
}
|
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
import React from 'react'
|
|
3
3
|
|
|
4
4
|
import { Button, Card } from '@hanzo/ui/primitives'
|
|
5
|
-
import { cn } from '@hanzo/ui
|
|
6
|
-
|
|
5
|
+
import { Box, cn } from '@hanzo/ui'
|
|
7
6
|
import { LuxLogo } from '@luxfi/logo'
|
|
8
7
|
import type { ChatbotSuggestedQuestion } from '../types'
|
|
9
8
|
|
|
@@ -49,7 +48,7 @@ const ChatWidget: React.FC<{
|
|
|
49
48
|
const iframeSrc = `${chatbotUrl}?${searchParams.toString()}`
|
|
50
49
|
|
|
51
50
|
return (<>
|
|
52
|
-
<
|
|
51
|
+
<Box className={
|
|
53
52
|
'fixed bottom-0 sm:bottom-16 right-0 w-full h-full ' +
|
|
54
53
|
'sm:max-w-[400px] sm:max-h-[550px] sm:px-4 z-floating ' +
|
|
55
54
|
(showChatbot ? 'flex' : 'hidden')
|
|
@@ -63,9 +62,9 @@ const ChatWidget: React.FC<{
|
|
|
63
62
|
</div>
|
|
64
63
|
<iframe src={iframeSrc} className='h-full' />
|
|
65
64
|
</Card>
|
|
66
|
-
</
|
|
65
|
+
</Box>
|
|
67
66
|
|
|
68
|
-
<span
|
|
67
|
+
<Box tag="span"
|
|
69
68
|
onClick={onClick}
|
|
70
69
|
className={cn(
|
|
71
70
|
// z-index should be below anything in commerce-iu (buy drawer and checkout widget)
|
|
@@ -77,7 +76,7 @@ const ChatWidget: React.FC<{
|
|
|
77
76
|
)}
|
|
78
77
|
>
|
|
79
78
|
<LuxLogo variant='white' size={28} />
|
|
80
|
-
</
|
|
79
|
+
</Box>
|
|
81
80
|
</>)
|
|
82
81
|
}
|
|
83
82
|
|
|
@@ -4,7 +4,7 @@ import { observable, type IObservableValue, reaction, runInAction } from 'mobx'
|
|
|
4
4
|
import { observer } from 'mobx-react-lite'
|
|
5
5
|
|
|
6
6
|
import { buttonVariants } from '@hanzo/ui/primitives'
|
|
7
|
-
import { cn, type
|
|
7
|
+
import { Box, cn, type ButtonSize, type ButtonVariant } from '@hanzo/ui'
|
|
8
8
|
import { useCommerce } from '@hanzo/commerce'
|
|
9
9
|
|
|
10
10
|
import { Bag } from '../icons'
|
|
@@ -13,7 +13,7 @@ const BagButton: React.FC<{
|
|
|
13
13
|
showIfEmpty?: boolean
|
|
14
14
|
animateOnHover?: boolean
|
|
15
15
|
animateOnQuantityChange?: boolean
|
|
16
|
-
size?:
|
|
16
|
+
size?: { variant?: ButtonVariant | null; size?: ButtonSize | null }['size']
|
|
17
17
|
className?: string
|
|
18
18
|
iconClx?: string
|
|
19
19
|
onClick?: () => void
|
|
@@ -57,12 +57,13 @@ const BagButton: React.FC<{
|
|
|
57
57
|
|
|
58
58
|
|
|
59
59
|
return (
|
|
60
|
-
<
|
|
60
|
+
<Box
|
|
61
61
|
aria-label="Bag"
|
|
62
62
|
role='button'
|
|
63
63
|
onClick={onClick}
|
|
64
64
|
className={cn(
|
|
65
|
-
buttonVariants({ variant: 'ghost', size
|
|
65
|
+
buttonVariants({ variant: 'ghost', size }),
|
|
66
|
+
'rounded-md',
|
|
66
67
|
// Overides the bg change on hover --not a "hover effect"
|
|
67
68
|
'relative group p-0 aspect-square hover:bg-background',
|
|
68
69
|
((wiggleRef.current.get() === 'more') ?
|
|
@@ -73,14 +74,14 @@ const BagButton: React.FC<{
|
|
|
73
74
|
)}
|
|
74
75
|
>
|
|
75
76
|
{!c.cartEmpty && (
|
|
76
|
-
<
|
|
77
|
+
<Box className={
|
|
77
78
|
'z-above-content flex flex-col justify-center items-center ' +
|
|
78
79
|
'absolute left-0 right-0 top-0 bottom-0 ' +
|
|
79
80
|
'leading-none font-sans font-bold text-primary-fg text-xs '
|
|
80
81
|
}>
|
|
81
82
|
<div className='h-[3px] w-full' />
|
|
82
83
|
<div>{c.cartQuantity}</div>
|
|
83
|
-
</
|
|
84
|
+
</Box>
|
|
84
85
|
)}
|
|
85
86
|
<Bag width='24' height='28' className={cn(
|
|
86
87
|
'relative -top-[3px] fill-primary',
|
|
@@ -91,7 +92,7 @@ const BagButton: React.FC<{
|
|
|
91
92
|
''
|
|
92
93
|
)
|
|
93
94
|
)} aria-hidden="true" />
|
|
94
|
-
</
|
|
95
|
+
</Box>
|
|
95
96
|
)
|
|
96
97
|
})
|
|
97
98
|
|
|
@@ -2,14 +2,13 @@
|
|
|
2
2
|
import React, {type PropsWithChildren} from 'react'
|
|
3
3
|
|
|
4
4
|
import { Button, buttonVariants } from '@hanzo/ui/primitives'
|
|
5
|
-
import { type VariantProps } from '@hanzo/ui/util'
|
|
6
5
|
|
|
7
|
-
import { cn } from '@hanzo/ui
|
|
6
|
+
import { cn, type ButtonSize, type ButtonVariant } from '@hanzo/ui'
|
|
8
7
|
import { useSelectAndBuy } from '../../commerce/ui/context'
|
|
9
8
|
|
|
10
9
|
const BuyButton: React.FC<
|
|
11
10
|
PropsWithChildren &
|
|
12
|
-
|
|
11
|
+
{ variant?: ButtonVariant | null; size?: ButtonSize | null } &
|
|
13
12
|
{
|
|
14
13
|
skuPath: string
|
|
15
14
|
className?: string
|
|
@@ -4,7 +4,7 @@ import { observable, type IObservableValue, reaction, runInAction } from 'mobx'
|
|
|
4
4
|
import { observer } from 'mobx-react-lite'
|
|
5
5
|
|
|
6
6
|
import { Button, type ButtonProps } from '@hanzo/ui/primitives'
|
|
7
|
-
import { cn } from '@hanzo/ui
|
|
7
|
+
import { Box, cn } from '@hanzo/ui'
|
|
8
8
|
import { useCommerce } from '@hanzo/commerce'
|
|
9
9
|
|
|
10
10
|
import { Bag } from '../icons'
|
|
@@ -49,9 +49,9 @@ const IconAndQuantity: React.FC<{
|
|
|
49
49
|
), [])
|
|
50
50
|
|
|
51
51
|
return (
|
|
52
|
-
<
|
|
52
|
+
<Box className={cn('flex items-center justify-center', clx)}>
|
|
53
53
|
{showQuantity && (
|
|
54
|
-
<
|
|
54
|
+
<Box className={cn(
|
|
55
55
|
'relative flex items-center justify-center mr-1',
|
|
56
56
|
((wiggleRef.current.get() === 'more') ?
|
|
57
57
|
'item-added-to-cart-animation'
|
|
@@ -59,19 +59,19 @@ const IconAndQuantity: React.FC<{
|
|
|
59
59
|
(wiggleRef.current.get() === 'less') ? 'item-removed-from-cart-animation' : ''),
|
|
60
60
|
)} >
|
|
61
61
|
{cmmc.cartQuantity > 0 && (
|
|
62
|
-
<
|
|
62
|
+
<Box className={cn(
|
|
63
63
|
'z-above-content flex flex-col justify-center items-center',
|
|
64
64
|
'absolute left-0 right-0 top-0 bottom-0',
|
|
65
65
|
digitClx
|
|
66
66
|
)}>
|
|
67
67
|
<div style={{/* color: 'white' tailwind bug? ,*/ fontSize: '11px', position: 'relative', top: '1px' }}>{cmmc.cartQuantity}</div>
|
|
68
|
-
</
|
|
68
|
+
</Box>
|
|
69
69
|
)}
|
|
70
70
|
<Bag width='19' height='24' className={cn('relative -top-[3px] opacity-70' , iconClx)} aria-hidden="true" />
|
|
71
|
-
</
|
|
71
|
+
</Box>
|
|
72
72
|
)}
|
|
73
73
|
{showArrow && (<span style={{fontSize: '17px',}}>›</span>)}
|
|
74
|
-
</
|
|
74
|
+
</Box>
|
|
75
75
|
)
|
|
76
76
|
})
|
|
77
77
|
|
|
@@ -81,6 +81,8 @@ const CheckoutButton: React.FC<ButtonProps & {
|
|
|
81
81
|
showArrow?: boolean
|
|
82
82
|
animateOnQuantityChange?: boolean
|
|
83
83
|
centerText?: boolean
|
|
84
|
+
/** A corner off the radius scale. It was a Button variant in the 5.x line. */
|
|
85
|
+
rounded?: 'none' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | 'full'
|
|
84
86
|
}> = ({
|
|
85
87
|
handleCheckout,
|
|
86
88
|
variant='primary',
|
|
@@ -99,12 +101,12 @@ const CheckoutButton: React.FC<ButtonProps & {
|
|
|
99
101
|
{...rest}
|
|
100
102
|
onClick={handleCheckout}
|
|
101
103
|
variant={variant}
|
|
102
|
-
|
|
103
|
-
className={cn(
|
|
104
|
+
className={cn(`rounded-${rounded}`, cn(
|
|
104
105
|
'flex justify-between items-stretch group',
|
|
105
106
|
showQuantity ? (centerText ? 'px-1.5' : 'pl-2.5 pr-1.5') : '',
|
|
106
107
|
className,
|
|
107
|
-
)}
|
|
108
|
+
))}
|
|
109
|
+
|
|
108
110
|
>
|
|
109
111
|
{centerText && ( // must scale this one too, as it effects layout
|
|
110
112
|
<IconAndQuantity
|
|
@@ -10,8 +10,7 @@ import {
|
|
|
10
10
|
AccordionItem,
|
|
11
11
|
AccordionTrigger,
|
|
12
12
|
} from '@hanzo/ui/primitives'
|
|
13
|
-
import { cn } from '@hanzo/ui
|
|
14
|
-
|
|
13
|
+
import { cn, css } from '@hanzo/ui'
|
|
15
14
|
import { useCommerce, CartPanel, formatCurrencyValue } from '@hanzo/commerce'
|
|
16
15
|
|
|
17
16
|
const CartAccordian: React.FC<{
|
|
@@ -33,7 +32,7 @@ const CartAccordian: React.FC<{
|
|
|
33
32
|
return (
|
|
34
33
|
<Accordion type="single" collapsible className={clx}>
|
|
35
34
|
<AccordionItem value="cart" className='w-full border-b-0'>
|
|
36
|
-
<AccordionTrigger className=
|
|
35
|
+
<AccordionTrigger className="!no-underline group flex justify-between ">
|
|
37
36
|
<div className='flex gap-0 items-center'>
|
|
38
37
|
{icon}
|
|
39
38
|
<h5 className='text-sm sm:text-xl grow'>
|
|
@@ -43,7 +42,7 @@ const CartAccordian: React.FC<{
|
|
|
43
42
|
</div>
|
|
44
43
|
<div className='flex gap-1 items-center'>
|
|
45
44
|
<h5 className='text-sm sm:text-xl grow truncate'>{formatCurrencyValue(cmmc.promoAppliedCartTotal)}</h5>
|
|
46
|
-
<ChevronRight
|
|
45
|
+
<ChevronRight style={css('h-5 w-5 -mr-2 shrink-0 transition-transform duration-200 group-data-[state=open]:rotate-90')} />
|
|
47
46
|
</div>
|
|
48
47
|
</AccordionTrigger>
|
|
49
48
|
<AccordionContent className='data-[state=open]:mb-4'>
|
|
@@ -5,8 +5,7 @@ import { observer } from 'mobx-react-lite'
|
|
|
5
5
|
import { ScrollArea, StepIndicator } from '@hanzo/ui/primitives'
|
|
6
6
|
import AuthWidget from '../../auth/widget'
|
|
7
7
|
import { CartPanel, useCommerce } from '@hanzo/commerce'
|
|
8
|
-
import { cn } from '@hanzo/ui
|
|
9
|
-
|
|
8
|
+
import { Box, cn } from '@hanzo/ui'
|
|
10
9
|
import { BackButton, Logo, Tooltip } from '../..'
|
|
11
10
|
import DesktopBagCarousel from './desktop-bag-carousel'
|
|
12
11
|
import LinksRow from './policy-links'
|
|
@@ -22,7 +21,7 @@ const DesktopCheckoutPanel: React.FC<PropsWithChildren & CheckoutPanelProps> = o
|
|
|
22
21
|
|
|
23
22
|
const cmmc = useCommerce()
|
|
24
23
|
return (
|
|
25
|
-
<
|
|
24
|
+
<Box /* id='CHECKOUT_PANEL' */ className={cn('grid grid-cols-2', clx)}>
|
|
26
25
|
<div key={1} className='w-full h-full bg-background flex flex-row items-start justify-end'>
|
|
27
26
|
<div className='w-full h-full max-w-[750px] relative flex flex-col items-stretch justify-start px-8 pb-8'>
|
|
28
27
|
<div key={1} className='h-[80px] grow-0 flex flex-row items-center z-10' >
|
|
@@ -39,7 +38,7 @@ const DesktopCheckoutPanel: React.FC<PropsWithChildren & CheckoutPanelProps> = o
|
|
|
39
38
|
onBack={onLeave}
|
|
40
39
|
/>
|
|
41
40
|
<Tooltip select='.back-button-tooltip-class' text='back' position='right' offset={5}/>
|
|
42
|
-
<
|
|
41
|
+
<Box key={2} className={cn(
|
|
43
42
|
'w-full grow min-h-0 max-w-[550px] mx-auto flex flex-col gap-3',
|
|
44
43
|
(cmmc.cartItems.length > 4 ? 'justify-between' : 'justify-start gap-10 pt-10')
|
|
45
44
|
)}>
|
|
@@ -55,7 +54,7 @@ const DesktopCheckoutPanel: React.FC<PropsWithChildren & CheckoutPanelProps> = o
|
|
|
55
54
|
showShipping
|
|
56
55
|
selectItems
|
|
57
56
|
/>
|
|
58
|
-
</
|
|
57
|
+
</Box>
|
|
59
58
|
</div>
|
|
60
59
|
</div>
|
|
61
60
|
<div key={2} className='w-full h-full flex flex-col bg-level-1 min-h-screen justify-between'>
|
|
@@ -76,7 +75,7 @@ const DesktopCheckoutPanel: React.FC<PropsWithChildren & CheckoutPanelProps> = o
|
|
|
76
75
|
</div>
|
|
77
76
|
</div>
|
|
78
77
|
</div>
|
|
79
|
-
</
|
|
78
|
+
</Box>
|
|
80
79
|
)
|
|
81
80
|
})
|
|
82
81
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
import React, { useLayoutEffect, useRef, useState } from 'react'
|
|
3
3
|
|
|
4
|
-
import { capitalize, cn } from '@hanzo/ui
|
|
4
|
+
import { capitalize, cn } from '@hanzo/ui'
|
|
5
5
|
|
|
6
6
|
import { useCommerce, ShippingStepForm, PaymentStepForm } from '@hanzo/commerce'
|
|
7
7
|
import type { CheckoutStep } from '@hanzo/commerce/types'
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import React, { type PropsWithChildren } from 'react'
|
|
3
3
|
|
|
4
4
|
import { StepIndicator } from '@hanzo/ui/primitives'
|
|
5
|
-
import { cn } from '@hanzo/ui
|
|
5
|
+
import { Box, cn } from '@hanzo/ui'
|
|
6
6
|
import AuthWidget from '../../auth/widget'
|
|
7
7
|
|
|
8
8
|
import { BackButton, Logo } from '../..'
|
|
@@ -20,7 +20,7 @@ const MobileCheckoutPanel: React.FC<PropsWithChildren & CheckoutPanelProps> = ({
|
|
|
20
20
|
children
|
|
21
21
|
}) => (
|
|
22
22
|
|
|
23
|
-
<
|
|
23
|
+
<Box /* id='MOBILE_GRID' */ className={cn('bg-background flex flex-col justify-start px-4 pt-[101px]', clx)}>
|
|
24
24
|
<div className='fixed z-11 top-0 h-[45px] w-full flex justify-between items-stretch bg-background'>
|
|
25
25
|
<div className='flex items-stretch gap-1 grow-0'>
|
|
26
26
|
<BackButton
|
|
@@ -31,7 +31,7 @@ const MobileCheckoutPanel: React.FC<PropsWithChildren & CheckoutPanelProps> = ({
|
|
|
31
31
|
}
|
|
32
32
|
onBack={onLeave}
|
|
33
33
|
/>
|
|
34
|
-
<Logo size='
|
|
34
|
+
<Logo size='sm' variant='wordmark' href='/' onClick={onLeave} outerClx='-ml-2'/>
|
|
35
35
|
</div>
|
|
36
36
|
<StepIndicator
|
|
37
37
|
dotSizeRem={1}
|
|
@@ -61,7 +61,7 @@ const MobileCheckoutPanel: React.FC<PropsWithChildren & CheckoutPanelProps> = ({
|
|
|
61
61
|
/>
|
|
62
62
|
{children}
|
|
63
63
|
<PolicyLinks clx='mt-auto mb-3 pt-2' />
|
|
64
|
-
</
|
|
64
|
+
</Box>
|
|
65
65
|
)
|
|
66
66
|
|
|
67
67
|
export default MobileCheckoutPanel
|
|
@@ -2,28 +2,23 @@ import React from 'react'
|
|
|
2
2
|
import Link from 'next/link'
|
|
3
3
|
|
|
4
4
|
import { Separator, buttonVariants } from '@hanzo/ui/primitives'
|
|
5
|
-
import { cn } from '@hanzo/ui
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const linkClx = buttonVariants({
|
|
9
|
-
variant: 'linkMuted',
|
|
10
|
-
size: 'link',
|
|
11
|
-
rounded: 'none',
|
|
12
|
-
})
|
|
5
|
+
import { Box, cn, css } from '@hanzo/ui'
|
|
6
|
+
// `link` was a SIZE in the 5.x line and is a variant here; a radius is a class.
|
|
7
|
+
const linkClx = cn(buttonVariants({ variant: 'linkMuted' }), 'rounded-none')
|
|
13
8
|
|
|
14
9
|
const PolicyLinks: React.FC<{
|
|
15
10
|
clx?: string
|
|
16
11
|
}> = ({
|
|
17
12
|
clx=''
|
|
18
13
|
}) => (
|
|
19
|
-
<
|
|
14
|
+
<Box className={cn('flex flex-col items-center', clx)}>
|
|
20
15
|
<Separator/>
|
|
21
16
|
<div className='flex gap-4 py-2 text-sm'>
|
|
22
17
|
{/* TODO: add Refund policy and Privacy policy links */}
|
|
23
|
-
<Link
|
|
24
|
-
<Link
|
|
18
|
+
<Link style={css(linkClx)} href=''>refund policy</Link>
|
|
19
|
+
<Link style={css(linkClx)} href=''>privacy policy</Link>
|
|
25
20
|
</div>
|
|
26
|
-
</
|
|
21
|
+
</Box>
|
|
27
22
|
)
|
|
28
23
|
|
|
29
24
|
export default PolicyLinks
|