@luxfi/ui 5.3.7
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/conf.ts +13 -0
- package/commerce/ui/context.tsx +123 -0
- package/commerce/ui/store.ts +290 -0
- package/components/access-code-input.tsx +71 -0
- package/components/auth/auth-listener.tsx +29 -0
- package/components/auth/auth-token/clear-auth-token.tsx +12 -0
- package/components/auth/auth-token/set-auth-token.tsx +16 -0
- package/components/auth/common-auth-domains.ts +16 -0
- package/components/auth/login-panel.tsx +107 -0
- package/components/back-button.tsx +49 -0
- package/components/chat-widget.tsx +85 -0
- package/components/commerce/_to_deprecate_checkout-widget/const.ts +13 -0
- package/components/commerce/_to_deprecate_checkout-widget/index.tsx_ +188 -0
- package/components/commerce/_to_deprecate_checkout-widget/obs-string-set.ts +48 -0
- package/components/commerce/_to_deprecate_checkout-widget/use-anim-clx-set.ts +59 -0
- package/components/commerce/bag-button.tsx +98 -0
- package/components/commerce/buy-button.tsx +34 -0
- package/components/commerce/checkout-button.tsx +129 -0
- package/components/commerce/checkout-panel/cart-accordian.tsx +66 -0
- package/components/commerce/checkout-panel/checkout-panel-props.ts +10 -0
- package/components/commerce/checkout-panel/desktop-bag-carousel.tsx +36 -0
- package/components/commerce/checkout-panel/desktop-cp.tsx +83 -0
- package/components/commerce/checkout-panel/index.tsx +126 -0
- package/components/commerce/checkout-panel/mobile-cp.tsx +67 -0
- package/components/commerce/checkout-panel/policy-links.tsx +29 -0
- package/components/commerce/checkout-panel/steps-indicator.tsx +39 -0
- package/components/commerce/checkout-panel/thank-you.tsx +18 -0
- package/components/commerce/desktop-bag-popup.tsx +78 -0
- package/components/commerce/desktop-nav-menu.tsx +194 -0
- package/components/commerce/drawer/index.tsx +88 -0
- package/components/commerce/drawer/micro.tsx +145 -0
- package/components/commerce/drawer/shell.tsx +85 -0
- package/components/commerce/mobile-bag-drawer.tsx +51 -0
- package/components/commerce/mobile-login-button.tsx +108 -0
- package/components/commerce/mobile-menu-toggle-button.tsx +35 -0
- package/components/commerce/mobile-nav-menu-ai.tsx +51 -0
- package/components/commerce/mobile-nav-menu-item.tsx +50 -0
- package/components/commerce/mobile-nav-menu.tsx +102 -0
- package/components/contact-dialog/contact-form.tsx +113 -0
- package/components/contact-dialog/disclaimer.tsx +13 -0
- package/components/contact-dialog/index.tsx +64 -0
- package/components/copyright.tsx +21 -0
- package/components/drawer-margin.tsx +28 -0
- package/components/footer.tsx +78 -0
- package/components/header/desktop.tsx +51 -0
- package/components/header/index.tsx +50 -0
- package/components/header/mobile.tsx +163 -0
- package/components/header/theme-toggle.tsx +26 -0
- package/components/icons/24k-gold-card.tsx +43 -0
- package/components/icons/ai-chat-act.tsx +47 -0
- package/components/icons/ai-chat.tsx +29 -0
- package/components/icons/anodized-titanium.tsx +45 -0
- package/components/icons/avatar.tsx +11 -0
- package/components/icons/bag-icon.tsx +10 -0
- package/components/icons/blog-act.tsx +14 -0
- package/components/icons/blog.tsx +20 -0
- package/components/icons/bridge-act.tsx +18 -0
- package/components/icons/bridge.tsx +68 -0
- package/components/icons/changelog-act.tsx +15 -0
- package/components/icons/changelog.tsx +21 -0
- package/components/icons/chrome.tsx +45 -0
- package/components/icons/coins-act.tsx +29 -0
- package/components/icons/coins.tsx +20 -0
- package/components/icons/compare-cards-act.tsx +30 -0
- package/components/icons/compare-cards.tsx +21 -0
- package/components/icons/credit-act.tsx +29 -0
- package/components/icons/credit.tsx +20 -0
- package/components/icons/customer-support-act.tsx +27 -0
- package/components/icons/customer-support.tsx +21 -0
- package/components/icons/customers-act.tsx +65 -0
- package/components/icons/customers.tsx +33 -0
- package/components/icons/developer-docs-act.tsx +26 -0
- package/components/icons/developer-docs.tsx +20 -0
- package/components/icons/exchange-act.tsx +27 -0
- package/components/icons/exchange.tsx +21 -0
- package/components/icons/explorer-act.tsx +27 -0
- package/components/icons/explorer.tsx +22 -0
- package/components/icons/faqs-act.tsx +27 -0
- package/components/icons/faqs.tsx +21 -0
- package/components/icons/github.tsx +14 -0
- package/components/icons/guides-act.tsx +26 -0
- package/components/icons/guides.tsx +21 -0
- package/components/icons/gun-metal.tsx +44 -0
- package/components/icons/index.tsx +43 -0
- package/components/icons/integrations-act.tsx +41 -0
- package/components/icons/integrations.tsx +25 -0
- package/components/icons/irradescent.tsx +41 -0
- package/components/icons/launch-subnet.tsx +21 -0
- package/components/icons/launchsubnet-act.tsx +29 -0
- package/components/icons/left-arrow.tsx +11 -0
- package/components/icons/lux-finance-act.tsx +34 -0
- package/components/icons/lux-finance.tsx +23 -0
- package/components/icons/lux-logo.tsx +10 -0
- package/components/icons/lux-pass-act.tsx +41 -0
- package/components/icons/lux-pass.tsx +25 -0
- package/components/icons/lux-quests-act.tsx +15 -0
- package/components/icons/lux-quests.tsx +21 -0
- package/components/icons/market-act.tsx +39 -0
- package/components/icons/market.tsx +24 -0
- package/components/icons/mirrored-titanium.tsx +46 -0
- package/components/icons/more-benefits-act.tsx +29 -0
- package/components/icons/more-benefits.tsx +21 -0
- package/components/icons/open-source-act.tsx +41 -0
- package/components/icons/open-source.tsx +26 -0
- package/components/icons/right-arrow.tsx +10 -0
- package/components/icons/safe-act.tsx +77 -0
- package/components/icons/safe.tsx +37 -0
- package/components/icons/search.tsx +12 -0
- package/components/icons/secure-delivery.tsx +13 -0
- package/components/icons/shop-act.tsx +29 -0
- package/components/icons/shop.tsx +20 -0
- package/components/icons/social-icon.tsx +35 -0
- package/components/icons/social-svg.css +3 -0
- package/components/icons/sterling-silver-card.tsx +44 -0
- package/components/icons/templates-act.tsx +29 -0
- package/components/icons/templates.tsx +21 -0
- package/components/icons/validators-act.tsx +42 -0
- package/components/icons/validators.tsx +41 -0
- package/components/icons/view-all-card-act.tsx +28 -0
- package/components/icons/view-all-card.tsx +20 -0
- package/components/icons/wallet-act.tsx +29 -0
- package/components/icons/wallet.tsx +20 -0
- package/components/icons/warpcast.tsx +58 -0
- package/components/icons/youtube-logo.tsx +59 -0
- package/components/index.ts +25 -0
- package/components/logo.tsx +89 -0
- package/components/main.tsx +27 -0
- package/components/mini-chart/index.tsx +8 -0
- package/components/mini-chart/mini-chart-props.ts +44 -0
- package/components/mini-chart/mini-chart.tsx +85 -0
- package/components/mini-chart/wrapper.tsx +23 -0
- package/components/not-found/index.tsx +28 -0
- package/components/not-found/not-found-content.mdx +5 -0
- package/components/scripts.tsx +24 -0
- package/components/tooltip.tsx +31 -0
- package/environment.d.ts +6 -0
- package/next/analytics/fpixel.ts +16 -0
- package/next/analytics/google-analytics.ts +14 -0
- package/next/analytics/index.ts +3 -0
- package/next/analytics/pixel-analytics.tsx +55 -0
- package/next/font/get-app-router-font-classes.ts +12 -0
- package/next/font/load-and-return-lux-next-fonts-on-import.ts +68 -0
- package/next/font/local/Druk-Wide-Bold.ttf +0 -0
- package/next/font/local/Druk-Wide-Medium.ttf +0 -0
- package/next/font/local/InterVariable-Italic.ttf +0 -0
- package/next/font/local/InterVariable-Italic.woff2 +0 -0
- package/next/font/local/InterVariable.ttf +0 -0
- package/next/font/local/InterVariable.woff2 +0 -0
- package/next/font/next-font-desc.ts +28 -0
- package/next/font/pages-router-font-vars.tsx +18 -0
- package/next/head-metadata/from-next/metadata-types.ts +158 -0
- package/next/head-metadata/from-next/opengraph-types.ts +267 -0
- package/next/head-metadata/from-next/twitter-types.ts +92 -0
- package/next/head-metadata/index.tsx +208 -0
- package/next/index.ts +1 -0
- package/next/middleware/determine-device-mw.ts +16 -0
- package/package.json +80 -0
- package/root-layout/WHY_THIS_IS_SEPARATE.txt +2 -0
- package/root-layout/index.tsx +112 -0
- package/server-actions/TO-DO.txt +1 -0
- package/server-actions/firebase-app.ts +14 -0
- package/server-actions/index.ts +5 -0
- package/server-actions/store-contact.ts +51 -0
- package/site-def/footer/community.tsx +67 -0
- package/site-def/footer/company.ts +37 -0
- package/site-def/footer/ecosystem.ts +37 -0
- package/site-def/footer/index.tsx +26 -0
- package/site-def/footer/legal.ts +28 -0
- package/site-def/footer/network.ts +45 -0
- package/site-def/footer/svg/warpcast-logo.svg +12 -0
- package/site-def/index.ts +3 -0
- package/site-def/main-nav.tsx +458 -0
- package/style/cart-animation.css +29 -0
- package/style/checkout-animation.css +23 -0
- package/style/drawer-handle-overrides.css +160 -0
- package/style/lux-colors.css +85 -0
- package/style/lux-global.css +51 -0
- package/tailwind/fontFamily.tailwind.lux.ts +18 -0
- package/tailwind/index.ts +2 -0
- package/tailwind/lux-tw-fonts.ts +40 -0
- package/tailwind/tailwind.config.lux-preset.ts +10 -0
- package/tsconfig.json +15 -0
- package/types/chatbot-config.ts +7 -0
- package/types/chatbot-suggested-question.ts +7 -0
- package/types/contact-info.ts +11 -0
- package/types/index.ts +4 -0
- package/types/site-def.ts +43 -0
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
import React, { useState } from 'react'
|
|
3
|
+
|
|
4
|
+
import { Plus } from 'lucide-react'
|
|
5
|
+
|
|
6
|
+
import { Button } from '@hanzo/ui/primitives'
|
|
7
|
+
import { cn } from '@hanzo/ui/util'
|
|
8
|
+
|
|
9
|
+
const MobileMenuToggleButton: React.FC<{
|
|
10
|
+
open: boolean
|
|
11
|
+
setOpen: (b: boolean) => void
|
|
12
|
+
className?: string
|
|
13
|
+
}> = ({
|
|
14
|
+
open,
|
|
15
|
+
setOpen,
|
|
16
|
+
className=''
|
|
17
|
+
}) => {
|
|
18
|
+
|
|
19
|
+
return (
|
|
20
|
+
<Button
|
|
21
|
+
variant='ghost'
|
|
22
|
+
size='default'
|
|
23
|
+
rounded='full'
|
|
24
|
+
onClick={() => {setOpen(!open)}}
|
|
25
|
+
className={cn('p-0 aspect-square hover:bg-background sm:hover:bg-level-1 active:scale-75', className)}
|
|
26
|
+
>
|
|
27
|
+
<Plus width={28} height={28} className={
|
|
28
|
+
'block h-full will-change-transform transition-transform transition-scale transition-duration-[1500] ' +
|
|
29
|
+
(open ? 'rotate-[135deg] scale-110' : 'rotate-none')
|
|
30
|
+
} />
|
|
31
|
+
</Button>
|
|
32
|
+
)
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export default MobileMenuToggleButton
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
import React, { useState } from 'react'
|
|
3
|
+
import { ArrowRight, Plus } from 'lucide-react'
|
|
4
|
+
import { Button, Card } from '@hanzo/ui/primitives'
|
|
5
|
+
import { Logo } from '..'
|
|
6
|
+
|
|
7
|
+
interface MobileNavMenuAIProps {
|
|
8
|
+
setMenuOpen: (open: boolean) => void
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const MobileNavMenuAI: React.FC<MobileNavMenuAIProps> = ({ setMenuOpen }) => {
|
|
12
|
+
const [isOpen, setIsOpen] = useState<boolean>(false)
|
|
13
|
+
|
|
14
|
+
return (
|
|
15
|
+
<>
|
|
16
|
+
<div className="w-full text-2xl cursor-pointer">
|
|
17
|
+
<div className='flex justify-between'>
|
|
18
|
+
<Logo variant='text-only' size='md' outerClx={'p-6 h-full'} />
|
|
19
|
+
<Plus width={28} height={28} className={
|
|
20
|
+
'block h-full aspect-square hover:bg-background sm:hover:bg-level-1 active:scale-75 text-foreground will-change-transform transition-transform transition-scale transition-duration-[1500] mt-6 mr-6 ' +
|
|
21
|
+
(!open ? 'rotate-none' : 'rotate-[135deg] scale-110')
|
|
22
|
+
} onClick={() => setMenuOpen(false)} />
|
|
23
|
+
</div>
|
|
24
|
+
<div className="flex items-center gap-5 border-b border-[#3A3A3A] mt-4 rounded-full bg-muted-4 mx-6">
|
|
25
|
+
<div className="text-muted-1 font-bold flex-1 flex justify-between min-h-12 items-center px-2" onClick={() => setIsOpen(true)}>
|
|
26
|
+
<span className='text-base pl-2 font-light'>Ask AI a question</span>
|
|
27
|
+
<ArrowRight />
|
|
28
|
+
</div>
|
|
29
|
+
</div>
|
|
30
|
+
</div>
|
|
31
|
+
<div className={
|
|
32
|
+
'fixed bottom-0 sm:bottom-16 right-0 w-full h-full ' +
|
|
33
|
+
'sm:max-w-[400px] sm:max-h-[550px] sm:px-4 z-floating ' +
|
|
34
|
+
(isOpen ? 'flex' : 'hidden')
|
|
35
|
+
}>
|
|
36
|
+
<Card className='flex flex-col h-full w-full'>
|
|
37
|
+
<div className='flex px-4 py-2 h-16 bg-level-0 items-center justify-between'>
|
|
38
|
+
<h3 className='font-semibold font-heading'>LUX<span className='opacity-60'>AI</span></h3>
|
|
39
|
+
<Button onClick={() => setIsOpen(false)} variant='link' size='icon' className='w-fit sm:hidden'>
|
|
40
|
+
<Plus className='w-6 h-6 flex-none mr-1 rotate-45 transition-transform' />
|
|
41
|
+
</Button>
|
|
42
|
+
</div>
|
|
43
|
+
<iframe src="https://lux.chat/iframe" className='h-full' />
|
|
44
|
+
</Card>
|
|
45
|
+
</div>
|
|
46
|
+
|
|
47
|
+
</>
|
|
48
|
+
)
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
export default MobileNavMenuAI;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import React, { useState } from 'react'
|
|
2
|
+
import type { LinkDefExtended } from '../../site-def/main-nav'
|
|
3
|
+
import { RightArrow } from '../icons'
|
|
4
|
+
import LeftArrow from '../icons/left-arrow'
|
|
5
|
+
import Link from 'next/link'
|
|
6
|
+
import MobileNavMenuAI from './mobile-nav-menu-ai'
|
|
7
|
+
|
|
8
|
+
interface MobileNavMenuItemProps {
|
|
9
|
+
link: LinkDefExtended,
|
|
10
|
+
setMenuOpen: (open: boolean) => void
|
|
11
|
+
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const MobileNavMenuItem: React.FC<MobileNavMenuItemProps> = ({
|
|
15
|
+
link,
|
|
16
|
+
setMenuOpen
|
|
17
|
+
}) => {
|
|
18
|
+
const [isOpen, setIsOpen] = useState<boolean>(false);
|
|
19
|
+
|
|
20
|
+
return (
|
|
21
|
+
<>
|
|
22
|
+
<div className="w-full flex items-center px-5 py-3 gap-[27px] text-2xl cursor-pointer" onClick={() => setIsOpen(true)}>
|
|
23
|
+
<span className='block w-[18px] h-[22px] items-center'>{link.icon}</span>
|
|
24
|
+
<span className='flex-1'>{link.title}</span>
|
|
25
|
+
<RightArrow className='' />
|
|
26
|
+
</div>
|
|
27
|
+
<div className={`fixed left-0 top-0 w-screen h-screen ${isOpen ? 'block' : 'hidden'}`} style={{ backgroundColor: 'black' }}>
|
|
28
|
+
<MobileNavMenuAI setMenuOpen={setMenuOpen} />
|
|
29
|
+
<div className="w-full flex items-center px-5 py-3 gap-[27px] text-2xl font-bold" onClick={() => setIsOpen(false)}>
|
|
30
|
+
<LeftArrow />
|
|
31
|
+
<span className="text-white">{link.title}</span>
|
|
32
|
+
</div>
|
|
33
|
+
<div className="flex flex-col">
|
|
34
|
+
{link.childMenu?.map((menu, index) => {
|
|
35
|
+
return (
|
|
36
|
+
<Link href={menu.href}>
|
|
37
|
+
<div className="w-full flex items-center px-5 py-3 gap-[27px] text-2xl" key={index}>
|
|
38
|
+
<span className='w-[18px] h-[22px] self-center flex items-center justify-center'>{menu.icon}</span>
|
|
39
|
+
<span className='flex-1'>{menu.title}</span>
|
|
40
|
+
</div>
|
|
41
|
+
</Link>
|
|
42
|
+
)
|
|
43
|
+
})}
|
|
44
|
+
</div>
|
|
45
|
+
</div>
|
|
46
|
+
</>
|
|
47
|
+
)
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export default MobileNavMenuItem
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
import React from 'react'
|
|
3
|
+
import type { LinkDef } from '@hanzo/ui/types'
|
|
4
|
+
import { cn } from '@hanzo/ui/util'
|
|
5
|
+
import type { LinkDefExtended, ChildMenu } from '../../site-def/main-nav'
|
|
6
|
+
import MobileNavMenuAI from './mobile-nav-menu-ai'
|
|
7
|
+
import MobileNavMenuItem from './mobile-nav-menu-item'
|
|
8
|
+
import MobileAuthWidget from './mobile-login-button'
|
|
9
|
+
import { Accordion, AccordionItem, AccordionTrigger, AccordionContent } from '@hanzo/ui/primitives'
|
|
10
|
+
import { ChevronDown } from 'lucide-react'
|
|
11
|
+
import Link from 'next/link'
|
|
12
|
+
|
|
13
|
+
const MobileNav: React.FC<{
|
|
14
|
+
currentAs: string | undefined
|
|
15
|
+
links: LinkDefExtended[]
|
|
16
|
+
className?: string
|
|
17
|
+
commonItemClx?: string | ((def: LinkDef) => string)
|
|
18
|
+
setChatbotOpen: (open: boolean) => void
|
|
19
|
+
setMenuOpen: (open: boolean) => void
|
|
20
|
+
setMenuState: (arg: 'closed' | 'nav' | 'login' | 'bag') => void
|
|
21
|
+
}> = ({
|
|
22
|
+
currentAs,
|
|
23
|
+
links,
|
|
24
|
+
setMenuState,
|
|
25
|
+
className = '',
|
|
26
|
+
commonItemClx,
|
|
27
|
+
setChatbotOpen,
|
|
28
|
+
setMenuOpen
|
|
29
|
+
}) => (
|
|
30
|
+
links.length > 0 ? (
|
|
31
|
+
<div className={cn('flex flex-col h-full', className)}>
|
|
32
|
+
<MobileNavMenuAI setMenuOpen={setMenuOpen} />
|
|
33
|
+
<div className="flex flex-col flex-1 overflow-auto">
|
|
34
|
+
<Accordion type="single" collapsible className='w-full h-full'>
|
|
35
|
+
{links.map((el, index) => {
|
|
36
|
+
const itemClx = (commonItemClx) ? (typeof commonItemClx === 'string' ? commonItemClx : commonItemClx(el)) : ''
|
|
37
|
+
const variant = el.variant ?? 'link'
|
|
38
|
+
let internalClx = variant === 'link'
|
|
39
|
+
? ' text-muted hover:text-foreground active:text-accent rounded-none'
|
|
40
|
+
: ' min-w-0'
|
|
41
|
+
|
|
42
|
+
if (currentAs && currentAs === el.href) {
|
|
43
|
+
internalClx += ' pointer-events-none'
|
|
44
|
+
if (variant === 'link') {
|
|
45
|
+
internalClx += ' text-accent'
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
if (!el.isAIMenu) {
|
|
50
|
+
return (
|
|
51
|
+
<AccordionItem key={index} value={el.title ? el.title : ""} className='!no-underline !border-0 px-6'>
|
|
52
|
+
<AccordionTrigger className={cn(internalClx, itemClx, '')}>
|
|
53
|
+
<div className={cn(internalClx, itemClx, 'flex items-center justify-between w-full pl-3 text-base font-normal leading-6')}>
|
|
54
|
+
{el.title}
|
|
55
|
+
</div>
|
|
56
|
+
<ChevronDown className="w-4 h-4 mr-3" />
|
|
57
|
+
</AccordionTrigger>
|
|
58
|
+
<AccordionContent>
|
|
59
|
+
{el.childMenu && (
|
|
60
|
+
<div className="px-4">
|
|
61
|
+
{Object.entries(el.childMenu.reduce((acc, child) => {
|
|
62
|
+
const group = acc[child.groupName ? child.groupName : ""] || []
|
|
63
|
+
group.push(child)
|
|
64
|
+
acc[child.groupName ? child.groupName : ""] = group
|
|
65
|
+
return acc
|
|
66
|
+
}, {} as { [key: string]: ChildMenu[] })).map(([groupName, children]) => (
|
|
67
|
+
<div key={groupName}>
|
|
68
|
+
<div className="mt-4 mb-4 font-light text-muted-1">{groupName}</div>
|
|
69
|
+
{children.map((child, childIndex) => (
|
|
70
|
+
<div key={childIndex} className="m-2">
|
|
71
|
+
<div className="flex items-center py-1">
|
|
72
|
+
<span>
|
|
73
|
+
{child.icon && child.icon}
|
|
74
|
+
</span>
|
|
75
|
+
<Link
|
|
76
|
+
href={child.href}
|
|
77
|
+
className="text-muted-2 hover:underline ml-5 hover:text-primary"
|
|
78
|
+
target={child.newTab ? '_blank' : '_self'}
|
|
79
|
+
rel="noopener noreferrer"
|
|
80
|
+
>
|
|
81
|
+
{child.title}
|
|
82
|
+
</Link>
|
|
83
|
+
</div>
|
|
84
|
+
</div>
|
|
85
|
+
))}
|
|
86
|
+
</div>
|
|
87
|
+
))}
|
|
88
|
+
</div>
|
|
89
|
+
)}
|
|
90
|
+
</AccordionContent>
|
|
91
|
+
</AccordionItem>
|
|
92
|
+
)
|
|
93
|
+
}
|
|
94
|
+
})}
|
|
95
|
+
</Accordion>
|
|
96
|
+
</div>
|
|
97
|
+
<MobileAuthWidget className='text-2xl z-10' handleLogin={() => { setMenuState('login') }} />
|
|
98
|
+
</div>
|
|
99
|
+
) : null
|
|
100
|
+
);
|
|
101
|
+
|
|
102
|
+
export default MobileNav;
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
import React, { useTransition } from 'react'
|
|
4
|
+
|
|
5
|
+
import { useForm, type SubmitHandler, type ControllerRenderProps } from 'react-hook-form'
|
|
6
|
+
import { z } from 'zod'
|
|
7
|
+
import { zodResolver } from '@hookform/resolvers/zod'
|
|
8
|
+
|
|
9
|
+
// @ts-ignore
|
|
10
|
+
import validator from 'validator'
|
|
11
|
+
|
|
12
|
+
import { Loader2 } from 'lucide-react'
|
|
13
|
+
|
|
14
|
+
import {
|
|
15
|
+
Button,
|
|
16
|
+
Input,
|
|
17
|
+
Form,
|
|
18
|
+
FormControl,
|
|
19
|
+
FormField,
|
|
20
|
+
FormItem,
|
|
21
|
+
FormMessage,
|
|
22
|
+
} from '@hanzo/ui/primitives'
|
|
23
|
+
|
|
24
|
+
import type { SubmitServerAction } from '@hanzo/ui/types'
|
|
25
|
+
import type { ContactInfo } from '../../types'
|
|
26
|
+
|
|
27
|
+
const ContactFormSchema = z.object({
|
|
28
|
+
email: z
|
|
29
|
+
.string()
|
|
30
|
+
.min(1, { message: "Email must be provided." })
|
|
31
|
+
.email("Invalid email."),
|
|
32
|
+
phone: z
|
|
33
|
+
.string()
|
|
34
|
+
.min(1, { message: "Telephone must be provided." })
|
|
35
|
+
.refine(validator.isMobilePhone, { message: "Invalid format." })
|
|
36
|
+
})
|
|
37
|
+
|
|
38
|
+
type ContactFormSchemaType = z.infer<typeof ContactFormSchema>
|
|
39
|
+
|
|
40
|
+
const ContactForm: React.FC<{
|
|
41
|
+
onSubmit: (data: ContactFormSchemaType, enc: any) => void
|
|
42
|
+
enclosure: any
|
|
43
|
+
}> = ({
|
|
44
|
+
onSubmit: _onSubmit,
|
|
45
|
+
enclosure
|
|
46
|
+
}) => {
|
|
47
|
+
|
|
48
|
+
const form = useForm<ContactFormSchemaType>({
|
|
49
|
+
resolver: zodResolver(ContactFormSchema),
|
|
50
|
+
defaultValues: {
|
|
51
|
+
email: '',
|
|
52
|
+
phone: '',
|
|
53
|
+
},
|
|
54
|
+
})
|
|
55
|
+
|
|
56
|
+
const [isPending, startTransition] = useTransition()
|
|
57
|
+
|
|
58
|
+
const onSubmit: SubmitHandler<ContactFormSchemaType> = (data) => {
|
|
59
|
+
// https://github.com/orgs/react-hook-form/discussions/10757#discussioncomment-6672403
|
|
60
|
+
// @ts-ignore
|
|
61
|
+
startTransition(async () => {
|
|
62
|
+
await _onSubmit(data, enclosure)
|
|
63
|
+
})
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
const MyFormItem: React.FC<{
|
|
67
|
+
field: ControllerRenderProps<ContactFormSchemaType, 'email'> | ControllerRenderProps<ContactFormSchemaType, 'phone'>
|
|
68
|
+
placeholder: string
|
|
69
|
+
}> = ({
|
|
70
|
+
field,
|
|
71
|
+
placeholder
|
|
72
|
+
}) => (
|
|
73
|
+
<FormItem className="space-y-0" >
|
|
74
|
+
<FormControl>
|
|
75
|
+
<Input placeholder={placeholder} {...field} className="mt-0 text-foreground"/>
|
|
76
|
+
</FormControl>
|
|
77
|
+
<div className="flex flex-row justify-start items-stretch gap-2">
|
|
78
|
+
<FormMessage />
|
|
79
|
+
</div>
|
|
80
|
+
</FormItem>
|
|
81
|
+
)
|
|
82
|
+
|
|
83
|
+
return (
|
|
84
|
+
<Form {...form}>
|
|
85
|
+
<form onSubmit={form.handleSubmit(onSubmit)} className="w-3/4">
|
|
86
|
+
<div className='flex flex-col justify-start items-stretch mt-4'>
|
|
87
|
+
<FormField
|
|
88
|
+
control={form.control}
|
|
89
|
+
name='email'
|
|
90
|
+
render={({ field }) => ( <MyFormItem field={field} placeholder='email'/> )}
|
|
91
|
+
/>
|
|
92
|
+
<FormField
|
|
93
|
+
control={form.control}
|
|
94
|
+
name='phone'
|
|
95
|
+
// @ts-ignore
|
|
96
|
+
render={({ field }) => ( <MyFormItem field={field} placeholder='phone'/> )}
|
|
97
|
+
/>
|
|
98
|
+
<Button disabled={isPending} type='submit' className='bg-primary text-primary-fg hover:bg-primary-hover'>
|
|
99
|
+
{isPending ? (<>
|
|
100
|
+
<Loader2 className="mr-2 h-4 w-4 animate-spin" />
|
|
101
|
+
Please wait
|
|
102
|
+
</>
|
|
103
|
+
) : (
|
|
104
|
+
<>Submit</>
|
|
105
|
+
)}
|
|
106
|
+
</Button>
|
|
107
|
+
</div>
|
|
108
|
+
</form>
|
|
109
|
+
</Form>
|
|
110
|
+
)
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
export default ContactForm
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
|
|
3
|
+
const Disclaimer: React.FC = () => (
|
|
4
|
+
<div>
|
|
5
|
+
By entering your mobile number and submitting, you consent to receive text messages from Lux at the number provided.
|
|
6
|
+
Message and data rates may apply. Message frequency varies.
|
|
7
|
+
You can unsubscribe at any time by replying STOP.
|
|
8
|
+
View our <a href='/privacy'>Privacy Policy</a> and <a href='/terms'>Terms & conditions</a>.
|
|
9
|
+
</div>
|
|
10
|
+
)
|
|
11
|
+
|
|
12
|
+
export default Disclaimer
|
|
13
|
+
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
import React, { useState } from 'react'
|
|
4
|
+
|
|
5
|
+
import type { ButtonModalProps} from '@hanzo/ui/types'
|
|
6
|
+
|
|
7
|
+
import {
|
|
8
|
+
Button,
|
|
9
|
+
Dialog,
|
|
10
|
+
DialogContent,
|
|
11
|
+
DialogDescription,
|
|
12
|
+
DialogHeader,
|
|
13
|
+
DialogTitle,
|
|
14
|
+
DialogTrigger,
|
|
15
|
+
} from '@hanzo/ui/primitives'
|
|
16
|
+
|
|
17
|
+
import ContactForm from './contact-form'
|
|
18
|
+
import Disclaimer from './disclaimer'
|
|
19
|
+
|
|
20
|
+
const ContactDialog: React.FC<ButtonModalProps> = ({
|
|
21
|
+
open,
|
|
22
|
+
onOpenChange,
|
|
23
|
+
buttonText,
|
|
24
|
+
buttonProps,
|
|
25
|
+
title,
|
|
26
|
+
byline,
|
|
27
|
+
action,
|
|
28
|
+
actionEnclosure
|
|
29
|
+
}) => {
|
|
30
|
+
const [success, setSuccess] = useState(false)
|
|
31
|
+
|
|
32
|
+
const onSubmit = async (formData: any, enclosure: any) => {
|
|
33
|
+
const result = await action(formData, enclosure)
|
|
34
|
+
if (result.success) {
|
|
35
|
+
setSuccess(true)
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
return (
|
|
40
|
+
<Dialog open={open} onOpenChange={onOpenChange} >
|
|
41
|
+
<DialogTrigger asChild>
|
|
42
|
+
<Button {...buttonProps} >{buttonText}</Button>
|
|
43
|
+
</DialogTrigger>
|
|
44
|
+
<DialogContent className="sm:max-w-[500px] p-0 gap-0 bg-background border">
|
|
45
|
+
<DialogHeader className='py-6 text-foreground'>
|
|
46
|
+
<DialogTitle className='text-4xl text-center text-inherit'>{title}</DialogTitle>
|
|
47
|
+
{byline && (<DialogDescription className='text-inherit text-lg text-center'>{byline} </DialogDescription>)}
|
|
48
|
+
</DialogHeader>
|
|
49
|
+
<div className='px-8 pb-8 rounded-e-lg flex flex-col justify-start items-center'>
|
|
50
|
+
{success ? (
|
|
51
|
+
<p>{actionEnclosure?.reply}</p>
|
|
52
|
+
) : (
|
|
53
|
+
<ContactForm onSubmit={onSubmit} enclosure={actionEnclosure}/>
|
|
54
|
+
)}
|
|
55
|
+
<div className='text-muted-1 text-xs mt-4' >
|
|
56
|
+
<Disclaimer />
|
|
57
|
+
</div>
|
|
58
|
+
</div>
|
|
59
|
+
</DialogContent>
|
|
60
|
+
</Dialog>
|
|
61
|
+
)
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export default ContactDialog
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
|
|
3
|
+
const FIRST = 2020
|
|
4
|
+
|
|
5
|
+
const Copyright: React.FC<{
|
|
6
|
+
className?: string
|
|
7
|
+
}> = ({
|
|
8
|
+
className=''
|
|
9
|
+
}) => {
|
|
10
|
+
|
|
11
|
+
const year = new Date().getFullYear()
|
|
12
|
+
const yearString = (year > FIRST) ? `${FIRST} - ${year}` : FIRST.toString()
|
|
13
|
+
|
|
14
|
+
return (
|
|
15
|
+
<div className={className}>
|
|
16
|
+
{`Copyright © ${yearString}`} <br className='sm:hidden'/>Lux Partners Limited. <br className='md:hidden'/> All rights reserved.
|
|
17
|
+
</div>
|
|
18
|
+
)
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export default Copyright
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
import React from 'react'
|
|
3
|
+
|
|
4
|
+
import { cn } from '@hanzo/ui/util'
|
|
5
|
+
import { useCommerceDrawer } from '@luxfi/ui/commerce'
|
|
6
|
+
import { observer } from 'mobx-react-lite'
|
|
7
|
+
|
|
8
|
+
const DrawerMargin: React.FC<{
|
|
9
|
+
clx?: string
|
|
10
|
+
}> = observer(({
|
|
11
|
+
clx=''
|
|
12
|
+
}) => {
|
|
13
|
+
|
|
14
|
+
const drawer = useCommerceDrawer()
|
|
15
|
+
if (!drawer) {
|
|
16
|
+
throw new Error("DrawerMargin must be used with a CommerceUIContext!")
|
|
17
|
+
}
|
|
18
|
+
return (
|
|
19
|
+
<div
|
|
20
|
+
className={cn('transition-height', clx)}
|
|
21
|
+
style={{
|
|
22
|
+
height: drawer.state === 'micro' ? drawer.microHeight : 0
|
|
23
|
+
}}
|
|
24
|
+
/>
|
|
25
|
+
)
|
|
26
|
+
})
|
|
27
|
+
|
|
28
|
+
export default DrawerMargin
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
|
|
3
|
+
import type { LinkDef } from '@hanzo/ui/types'
|
|
4
|
+
import { NavItems } from '@hanzo/ui/primitives'
|
|
5
|
+
import { cn } from '@hanzo/ui/util'
|
|
6
|
+
|
|
7
|
+
import Copyright from './copyright'
|
|
8
|
+
import type { SiteDef } from '../site-def'
|
|
9
|
+
import { legal } from '../site-def/footer/legal'
|
|
10
|
+
import Logo from './logo'
|
|
11
|
+
|
|
12
|
+
const Footer: React.FC<{
|
|
13
|
+
siteDef: SiteDef,
|
|
14
|
+
className?: string,
|
|
15
|
+
noHorizPadding?: boolean
|
|
16
|
+
}> = ({
|
|
17
|
+
siteDef,
|
|
18
|
+
className='',
|
|
19
|
+
noHorizPadding=false
|
|
20
|
+
}) => {
|
|
21
|
+
|
|
22
|
+
const { footer, aboveCopyright } = siteDef
|
|
23
|
+
const smGridCols = Math.floor(footer.length/2)
|
|
24
|
+
const smGridColsClx = `sm:grid-cols-${smGridCols} `
|
|
25
|
+
const _aboveCopyright = (typeof aboveCopyright === 'undefined') ? legal : aboveCopyright
|
|
26
|
+
|
|
27
|
+
return (
|
|
28
|
+
<footer className={cn('grow flex flex-col justify-between gap-6 pb-[2vh]', className)}>
|
|
29
|
+
<div className={
|
|
30
|
+
(noHorizPadding ? '' : 'px-5 md:px-8 ') +
|
|
31
|
+
'grid grid-cols-2 gap-4 gap-y-6 md:gap-x-6 lg:gap-8 ' + smGridColsClx +
|
|
32
|
+
'md:w-full sm:justify-items-center md:mx-0 lg:w-full ' +
|
|
33
|
+
'md:flex md:flex-row md:justify-between px-[24px]'
|
|
34
|
+
}>
|
|
35
|
+
<div className='hidden lg:flex flex-col' key={0}>
|
|
36
|
+
<Logo size='md' variant='text-only' />
|
|
37
|
+
</div>
|
|
38
|
+
{footer.map((defs: LinkDef[], index: number) => {
|
|
39
|
+
|
|
40
|
+
const xsColSpanClx = ((index === footer.length - 1) && (footer.length % 2 === 1)) ?
|
|
41
|
+
'xs:col-span-2 xs:mx-auto md:col-span-1 md:mx-0 ' : ''
|
|
42
|
+
|
|
43
|
+
return (
|
|
44
|
+
<NavItems
|
|
45
|
+
items={defs}
|
|
46
|
+
currentAs={siteDef.currentAs}
|
|
47
|
+
as='nav'
|
|
48
|
+
className={cn('sm:min-w-[150px] md:min-w-0 flex flex-col justify-start items-start ' +
|
|
49
|
+
'gap-[11px] sm:gap-[12px] md:gap-[15px] ',
|
|
50
|
+
xsColSpanClx
|
|
51
|
+
)}
|
|
52
|
+
key={index + 1}
|
|
53
|
+
itemClx={(def: LinkDef) => ((def.variant === 'linkFG') ?
|
|
54
|
+
'font-nav text-[15px]/[1.3] font-medium tracking-normal text-muted-1 sm:hover:text-foreground transition-color duration-500'
|
|
55
|
+
:
|
|
56
|
+
'text-[15px]/[1.1] font-normal tracking-[0.2px] text-muted-1 sm:hover:text-foreground transition-color duration-500'
|
|
57
|
+
)}
|
|
58
|
+
/>
|
|
59
|
+
)
|
|
60
|
+
})}
|
|
61
|
+
</div>
|
|
62
|
+
<div className='md:mt-[2vh]'>
|
|
63
|
+
{_aboveCopyright.length > 0 && (
|
|
64
|
+
<NavItems
|
|
65
|
+
items={_aboveCopyright}
|
|
66
|
+
as='div'
|
|
67
|
+
className={'flex flex-row justify-center gap-4 mb-2'}
|
|
68
|
+
itemClx={'text-sm text-center text-muted-2 underline hover:text-foreground'}
|
|
69
|
+
/>
|
|
70
|
+
)}
|
|
71
|
+
<Copyright className='text-sm text-center text-muted-3'/>
|
|
72
|
+
</div>
|
|
73
|
+
</footer>
|
|
74
|
+
)
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export default Footer
|
|
78
|
+
// flex flex-col justify-between gap-6
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
|
|
3
|
+
import { cn } from '@hanzo/ui/util'
|
|
4
|
+
import { AuthWidget } from '@hanzo/auth/components'
|
|
5
|
+
|
|
6
|
+
import { Logo } from '..'
|
|
7
|
+
|
|
8
|
+
import DesktopBagPopup from '../commerce/desktop-bag-popup'
|
|
9
|
+
import BagButton from '../commerce/bag-button'
|
|
10
|
+
import DesktopNav from '../commerce/desktop-nav-menu'
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
import type { LinkDef } from '@hanzo/ui/types'
|
|
14
|
+
|
|
15
|
+
const DesktopHeader: React.FC<{
|
|
16
|
+
currentAs: string | undefined
|
|
17
|
+
links: LinkDef[]
|
|
18
|
+
className?: string
|
|
19
|
+
}> = ({
|
|
20
|
+
links,
|
|
21
|
+
className = ''
|
|
22
|
+
}) => {
|
|
23
|
+
const [isMenuOpened, setIsMenuOpen] = React.useState(false);
|
|
24
|
+
const opendMenuClass = isMenuOpened ? " h-full" : ""
|
|
25
|
+
|
|
26
|
+
// TODO move 13px into a size class and configure twMerge to recognize say, 'text-size-nav'
|
|
27
|
+
// (vs be beat out by 'text-color-nav')
|
|
28
|
+
return (
|
|
29
|
+
<header className={cn('bg-[rgba(0, 0, 0, 0.5)] !backdrop-blur-3xl fixed z-header top-0 left-0 right-0', className, opendMenuClass)} >
|
|
30
|
+
{/* md or larger */}
|
|
31
|
+
<div className={
|
|
32
|
+
'flex flex-row h-[80px] items-center justify-between ' +
|
|
33
|
+
'mx-[24px] w-full max-w-screen'
|
|
34
|
+
}>
|
|
35
|
+
<Logo size='md' href='/' outerClx='hidden lg:flex' key='two' variant='text-only' />
|
|
36
|
+
<Logo size='sm' href='/' outerClx='hidden md:flex lg:hidden' key='one' variant='text-only' />
|
|
37
|
+
{/* md or larger */}
|
|
38
|
+
<div className='flex w-full gap-4 items-center justify-center'>
|
|
39
|
+
<DesktopNav links={links} isMenuOpened={isMenuOpened} setIsMenuOpen={setIsMenuOpen} />
|
|
40
|
+
</div>
|
|
41
|
+
<div className='flex items-center'>
|
|
42
|
+
<DesktopBagPopup popupClx='w-[340px]' trigger={<BagButton className='text-primary -mr-[3px] lg:min-w-0' />} />
|
|
43
|
+
<AuthWidget />
|
|
44
|
+
</div>
|
|
45
|
+
</div>
|
|
46
|
+
</header>
|
|
47
|
+
)
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export default DesktopHeader
|
|
51
|
+
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
import React from 'react'
|
|
3
|
+
|
|
4
|
+
import type { SiteDef } from '../../site-def'
|
|
5
|
+
|
|
6
|
+
import DesktopHeader from './desktop'
|
|
7
|
+
import MobileHeader from './mobile'
|
|
8
|
+
import { cn } from '@hanzo/ui/util'
|
|
9
|
+
import { ChatWidget } from '../../components'
|
|
10
|
+
|
|
11
|
+
const Header: React.FC<{
|
|
12
|
+
siteDef: SiteDef
|
|
13
|
+
className?: string
|
|
14
|
+
}> = ({
|
|
15
|
+
siteDef,
|
|
16
|
+
className = ''
|
|
17
|
+
}) => {
|
|
18
|
+
|
|
19
|
+
// TODO
|
|
20
|
+
const [open, setOpen] = React.useState<boolean>(false);
|
|
21
|
+
|
|
22
|
+
const { nav: { common, featured }, currentAs } = siteDef
|
|
23
|
+
const links = (featured) ? [...common, ...featured] : common
|
|
24
|
+
const isDesktopView = (): boolean => {
|
|
25
|
+
if (typeof window === 'undefined') return false
|
|
26
|
+
return window.innerWidth > 768
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
return (<>
|
|
30
|
+
<DesktopHeader
|
|
31
|
+
className={cn(className, 'hidden md:flex')}
|
|
32
|
+
links={links}
|
|
33
|
+
currentAs={currentAs}
|
|
34
|
+
/>
|
|
35
|
+
<MobileHeader
|
|
36
|
+
className={cn(className, 'md:hidden')}
|
|
37
|
+
links={links}
|
|
38
|
+
currentAs={currentAs}
|
|
39
|
+
setChatbotOpen={setOpen}
|
|
40
|
+
/>
|
|
41
|
+
<ChatWidget
|
|
42
|
+
title='LUX'
|
|
43
|
+
subtitle='AI'
|
|
44
|
+
chatbotUrl='https://lux.chat/iframe'
|
|
45
|
+
suggestedQuestions={siteDef.chatbot?.suggestedQuestions ?? []}
|
|
46
|
+
/>
|
|
47
|
+
</>)
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export default Header
|