@luxfi/ui 5.4.1 → 5.5.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 (96) hide show
  1. package/components/auth/login-panel.tsx +1 -1
  2. package/components/{commerce → auth}/mobile-login-button.tsx +0 -1
  3. package/components/auth/signup-panel.tsx +1 -1
  4. package/components/chat-widget.tsx +1 -1
  5. package/components/commerce/bag-button.tsx +2 -2
  6. package/components/commerce/checkout-button.tsx +2 -2
  7. package/components/commerce/desktop-bag-popup.tsx +2 -2
  8. package/components/{commerce → header}/desktop-nav-menu.tsx +59 -59
  9. package/components/header/desktop.tsx +6 -2
  10. package/components/header/index.tsx +3 -2
  11. package/components/{commerce → header}/mobile-bag-drawer.tsx +1 -1
  12. package/components/header/mobile-nav-menu-item.tsx +47 -0
  13. package/components/{commerce → header}/mobile-nav-menu.tsx +1 -1
  14. package/components/header/mobile.tsx +23 -18
  15. package/components/icons/index.ts +6 -0
  16. package/components/logo.tsx +3 -3
  17. package/package.json +15 -20
  18. package/site-def/footer/community.tsx +12 -18
  19. package/site-def/index.ts +2 -1
  20. package/site-def/main-nav.tsx +67 -65
  21. package/components/commerce/_to_deprecate_checkout-widget/const.ts +0 -13
  22. package/components/commerce/_to_deprecate_checkout-widget/index.tsx_ +0 -188
  23. package/components/commerce/_to_deprecate_checkout-widget/obs-string-set.ts +0 -48
  24. package/components/commerce/_to_deprecate_checkout-widget/use-anim-clx-set.ts +0 -59
  25. package/components/commerce/mobile-nav-menu-item.tsx +0 -50
  26. package/components/icons/24k-gold-card.tsx +0 -43
  27. package/components/icons/ai-chat-act.tsx +0 -47
  28. package/components/icons/ai-chat.tsx +0 -29
  29. package/components/icons/anodized-titanium.tsx +0 -45
  30. package/components/icons/blog-act.tsx +0 -14
  31. package/components/icons/blog.tsx +0 -20
  32. package/components/icons/bridge-act.tsx +0 -18
  33. package/components/icons/bridge.tsx +0 -68
  34. package/components/icons/changelog-act.tsx +0 -15
  35. package/components/icons/changelog.tsx +0 -21
  36. package/components/icons/chrome.tsx +0 -45
  37. package/components/icons/coins-act.tsx +0 -29
  38. package/components/icons/coins.tsx +0 -20
  39. package/components/icons/compare-cards-act.tsx +0 -30
  40. package/components/icons/compare-cards.tsx +0 -21
  41. package/components/icons/credit-act.tsx +0 -29
  42. package/components/icons/credit.tsx +0 -20
  43. package/components/icons/customer-support-act.tsx +0 -27
  44. package/components/icons/customer-support.tsx +0 -21
  45. package/components/icons/customers-act.tsx +0 -65
  46. package/components/icons/customers.tsx +0 -33
  47. package/components/icons/developer-docs-act.tsx +0 -26
  48. package/components/icons/developer-docs.tsx +0 -20
  49. package/components/icons/exchange-act.tsx +0 -27
  50. package/components/icons/exchange.tsx +0 -21
  51. package/components/icons/explorer-act.tsx +0 -27
  52. package/components/icons/explorer.tsx +0 -22
  53. package/components/icons/faqs-act.tsx +0 -27
  54. package/components/icons/faqs.tsx +0 -21
  55. package/components/icons/github.tsx +0 -14
  56. package/components/icons/guides-act.tsx +0 -26
  57. package/components/icons/guides.tsx +0 -21
  58. package/components/icons/gun-metal.tsx +0 -44
  59. package/components/icons/index.tsx +0 -43
  60. package/components/icons/integrations-act.tsx +0 -41
  61. package/components/icons/integrations.tsx +0 -25
  62. package/components/icons/irradescent.tsx +0 -41
  63. package/components/icons/launch-subnet.tsx +0 -21
  64. package/components/icons/launchsubnet-act.tsx +0 -29
  65. package/components/icons/lux-finance-act.tsx +0 -34
  66. package/components/icons/lux-finance.tsx +0 -23
  67. package/components/icons/lux-pass-act.tsx +0 -41
  68. package/components/icons/lux-pass.tsx +0 -25
  69. package/components/icons/lux-quests-act.tsx +0 -15
  70. package/components/icons/lux-quests.tsx +0 -21
  71. package/components/icons/market-act.tsx +0 -39
  72. package/components/icons/market.tsx +0 -24
  73. package/components/icons/mirrored-titanium.tsx +0 -46
  74. package/components/icons/more-benefits-act.tsx +0 -29
  75. package/components/icons/more-benefits.tsx +0 -21
  76. package/components/icons/open-source-act.tsx +0 -41
  77. package/components/icons/open-source.tsx +0 -26
  78. package/components/icons/safe-act.tsx +0 -77
  79. package/components/icons/safe.tsx +0 -37
  80. package/components/icons/search.tsx +0 -12
  81. package/components/icons/secure-delivery.tsx +0 -13
  82. package/components/icons/shop-act.tsx +0 -29
  83. package/components/icons/shop.tsx +0 -20
  84. package/components/icons/sterling-silver-card.tsx +0 -44
  85. package/components/icons/templates-act.tsx +0 -29
  86. package/components/icons/templates.tsx +0 -21
  87. package/components/icons/validators-act.tsx +0 -42
  88. package/components/icons/validators.tsx +0 -41
  89. package/components/icons/view-all-card-act.tsx +0 -28
  90. package/components/icons/view-all-card.tsx +0 -20
  91. package/components/icons/wallet-act.tsx +0 -29
  92. package/components/icons/wallet.tsx +0 -20
  93. package/components/icons/warpcast.tsx +0 -58
  94. package/components/icons/youtube-logo.tsx +0 -59
  95. /package/components/{commerce → header}/mobile-menu-toggle-button.tsx +0 -0
  96. /package/components/{commerce → header}/mobile-nav-menu-ai.tsx +0 -0
@@ -8,9 +8,9 @@ import { cn } from '@hanzo/ui/util'
8
8
  import { Button, Carousel, CarouselContent, CarouselItem } from '@hanzo/ui/primitives'
9
9
  import { LoginPanel as Login } from '@hanzo/auth/components'
10
10
 
11
+ import { LuxLogo } from '../icons'
11
12
  import Logo from '../logo'
12
13
  import { EmblaAutoplay } from '..'
13
- import LuxLogo from '../icons/lux-logo'
14
14
  import { legal } from '../../site-def/footer'
15
15
 
16
16
  const LoginPanel: React.FC<{
@@ -17,7 +17,6 @@ import { cn } from '@hanzo/ui/util'
17
17
  import { useAuth } from "@hanzo/auth/service"
18
18
 
19
19
  import { Ethereum } from "@hanzo/auth/icons"
20
- import { Icons } from ".."
21
20
 
22
21
  const MobileAuthWidget: React.FC<{
23
22
  noLogin?: boolean
@@ -9,9 +9,9 @@ import { cn } from '@hanzo/ui/util'
9
9
  import { Button, Carousel, CarouselContent, CarouselItem } from '@hanzo/ui/primitives'
10
10
  import { LoginPanel as Login, SignupPanel as Signup } from '@hanzo/auth/components'
11
11
 
12
+ import { LuxLogo } from '../icons'
12
13
  import Logo from '../logo'
13
14
  import { EmblaAutoplay } from '..'
14
- import LuxLogo from '../icons/lux-logo'
15
15
  import { legal } from '../../site-def/footer'
16
16
 
17
17
  const SignupPanel: React.FC<{
@@ -4,7 +4,7 @@ import React from 'react'
4
4
  import { Button, Card } from '@hanzo/ui/primitives'
5
5
  import { cn } from '@hanzo/ui/util'
6
6
 
7
- import LuxLogo from './icons/lux-logo'
7
+ import { LuxLogo } from './icons'
8
8
  import type { ChatbotSuggestedQuestion } from '../types'
9
9
 
10
10
  const ChatWidget: React.FC<{
@@ -7,7 +7,7 @@ import { buttonVariants } from '@hanzo/ui/primitives'
7
7
  import { cn, type VariantProps } from '@hanzo/ui/util'
8
8
  import { useCommerce } from '@hanzo/commerce'
9
9
 
10
- import * as Icons from '../icons'
10
+ import { Bag } from '../icons'
11
11
 
12
12
  const BagButton: React.FC<{
13
13
  showIfEmpty?: boolean
@@ -82,7 +82,7 @@ const BagButton: React.FC<{
82
82
  <div>{c.cartQuantity}</div>
83
83
  </div>
84
84
  )}
85
- <Icons.bag width='24' height='28' className={cn(
85
+ <Bag width='24' height='28' className={cn(
86
86
  'relative -top-[3px] fill-primary',
87
87
  iconClx,
88
88
  (animateOnHover ?
@@ -7,7 +7,7 @@ import { Button, type ButtonProps } from '@hanzo/ui/primitives'
7
7
  import { cn } from '@hanzo/ui/util'
8
8
  import { useCommerce } from '@hanzo/commerce'
9
9
 
10
- import * as Icons from '../icons'
10
+ import { Bag } from '../icons'
11
11
 
12
12
  const IconAndQuantity: React.FC<{
13
13
  animateOnQuantityChange?: boolean
@@ -67,7 +67,7 @@ const IconAndQuantity: React.FC<{
67
67
  <div style={{/* color: 'white' tailwind bug? ,*/ fontSize: '11px', position: 'relative', top: '1px' }}>{cmmc.cartQuantity}</div>
68
68
  </div>
69
69
  )}
70
- <Icons.bag width='19' height='24' className={cn('relative -top-[3px] opacity-70' , iconClx)} aria-hidden="true" />
70
+ <Bag width='19' height='24' className={cn('relative -top-[3px] opacity-70' , iconClx)} aria-hidden="true" />
71
71
  </div>
72
72
  )}
73
73
  {showArrow && (<span style={{fontSize: '17px',}}>&rsaquo;</span>)}
@@ -14,7 +14,7 @@ import {
14
14
  import { cn } from '@hanzo/ui/util'
15
15
  import { CartPanel, useCommerce } from '@hanzo/commerce'
16
16
 
17
- import * as Icons from '../icons'
17
+ import { Bag } from '../icons'
18
18
  import sendGAEvent from '../../next/analytics/google-analytics'
19
19
 
20
20
  const DesktopBagPopup: React.FC<{
@@ -65,7 +65,7 @@ const DesktopBagPopup: React.FC<{
65
65
  buttonClx='max-w-[220px] flex-none'
66
66
  >
67
67
  <div className='flex flex-row items-center flex-none justify-center '>
68
- <Icons.bag className='mr-2 relative w-6 h-7 fill-foreground ' />
68
+ <Bag className='mr-2 relative w-6 h-7 fill-foreground ' />
69
69
  <p className='font-heading text-foreground text-default'>Your Bag</p>
70
70
  </div>
71
71
  <div className='h-[1px] w-pr-80 bg-muted-3 mx-auto mt-1.5 flex-none'/>
@@ -1,9 +1,9 @@
1
- "use client"
1
+ 'use client'
2
2
 
3
- import * as React from "react"
4
- import Link from "next/link"
3
+ import * as React from 'react'
4
+ import Link from 'next/link'
5
5
  import { cn } from '@hanzo/ui/util'
6
- import type { ChildMenu, LinkDefExtended } from "../../site-def/main-nav"
6
+ import type { ChildMenu, LinkDefExtended } from '../../site-def/main-nav'
7
7
  import {
8
8
  NavigationMenu,
9
9
  NavigationMenuContent,
@@ -22,61 +22,61 @@ const DesktopNav: React.FC<{
22
22
 
23
23
  React.useEffect(() => {
24
24
  const preventScroll = (e: WheelEvent | TouchEvent) => {
25
- e.preventDefault();
26
- };
25
+ e.preventDefault()
26
+ }
27
27
 
28
28
  if (isMenuOpened) {
29
- window.addEventListener('wheel', preventScroll, { passive: false });
30
- window.addEventListener('touchmove', preventScroll, { passive: false });
31
- window.addEventListener('keydown', preventScrollKeys, { passive: false });
29
+ window.addEventListener('wheel', preventScroll, { passive: false })
30
+ window.addEventListener('touchmove', preventScroll, { passive: false })
31
+ window.addEventListener('keydown', preventScrollKeys, { passive: false })
32
32
  } else {
33
- window.removeEventListener('wheel', preventScroll);
34
- window.removeEventListener('touchmove', preventScroll);
35
- window.removeEventListener('keydown', preventScrollKeys);
33
+ window.removeEventListener('wheel', preventScroll)
34
+ window.removeEventListener('touchmove', preventScroll)
35
+ window.removeEventListener('keydown', preventScrollKeys)
36
36
  }
37
37
 
38
38
  return () => {
39
- window.removeEventListener('wheel', preventScroll);
40
- window.removeEventListener('touchmove', preventScroll);
41
- window.removeEventListener('keydown', preventScrollKeys);
42
- };
43
- }, [isMenuOpened]);
39
+ window.removeEventListener('wheel', preventScroll)
40
+ window.removeEventListener('touchmove', preventScroll)
41
+ window.removeEventListener('keydown', preventScrollKeys)
42
+ }
43
+ }, [isMenuOpened])
44
44
 
45
45
  const preventScrollKeys = (e: KeyboardEvent) => {
46
46
  if (['ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight', ' '].includes(e.key)) {
47
- e.preventDefault();
47
+ e.preventDefault()
48
48
  }
49
- };
49
+ }
50
50
 
51
51
  const handleMouseEnter = React.useCallback(() => {
52
- setIsMenuOpen(true);
53
- }, [setIsMenuOpen]);
52
+ setIsMenuOpen(true)
53
+ }, [setIsMenuOpen])
54
54
 
55
55
  const handleMouseLeave = React.useCallback(() => {
56
- setIsMenuOpen(false);
57
- }, [setIsMenuOpen]);
56
+ setIsMenuOpen(false)
57
+ }, [setIsMenuOpen])
58
58
 
59
59
  const handleContentMouseMove = () => {
60
60
  setIsMenuOpen(false)
61
61
  }
62
62
 
63
- const menuHiddenClass = !isMenuOpened ? "invisible" : "";
63
+ const menuHiddenClass = !isMenuOpened ? 'invisible' : ''
64
64
 
65
65
  return links.length > 0 ? (
66
66
  <NavigationMenu>
67
67
  <NavigationMenuList>
68
68
  {links.map((el, index) => (
69
- <NavigationMenuItem key={index} className="!m-0">
69
+ <NavigationMenuItem key={index} className='!m-0'>
70
70
  {el.isAIMenu ? (
71
71
  <Link href={el.href} legacyBehavior passHref>
72
72
  <NavigationMenuLink className={cn(navigationMenuTriggerStyle(), ' text-muted-1 bg-transparent')}>
73
73
  {el.title}
74
74
  </NavigationMenuLink>
75
75
  </Link>
76
- ) : el.title === "Cards" ? (
76
+ ) : el.title === 'Cards' ? (
77
77
  <>
78
78
  <NavigationMenuTrigger
79
- className="text-muted-1 bg-transparent"
79
+ className='text-muted-1 bg-transparent'
80
80
  onMouseEnter={handleMouseEnter}
81
81
  onFocus={handleMouseEnter}
82
82
  onMouseLeave={handleMouseLeave}
@@ -87,13 +87,13 @@ const DesktopNav: React.FC<{
87
87
  </Link>
88
88
  </NavigationMenuTrigger>
89
89
  <NavigationMenuContent
90
- className={cn("fixed left-0 top-14 pt-6 w-screen h-full border-0 !backdrop-blur-3xl bg-transparent mt-0", menuHiddenClass)}
90
+ className={cn('fixed left-0 top-14 pt-6 w-screen h-full border-0 !backdrop-blur-3xl bg-transparent mt-0', menuHiddenClass)}
91
91
  onMouseEnter={handleMouseEnter}
92
92
  onMouseLeave={handleMouseLeave}
93
93
  >
94
- <div className="flex justify-center items-start">
94
+ <div className='flex justify-center items-start'>
95
95
  <div
96
- className="grid xl:grid-cols-3 w-full justify-center max-w-[750px]"
96
+ className='grid xl:grid-cols-3 w-full justify-center max-w-[750px]'
97
97
  onMouseLeave={handleContentMouseMove}
98
98
  >
99
99
  {GroupChildMenu({ childs: el.childMenu, isCards: true })}
@@ -104,26 +104,26 @@ const DesktopNav: React.FC<{
104
104
  ) : (
105
105
  <>
106
106
  <NavigationMenuTrigger
107
- className="text-muted-1 bg-transparent"
107
+ className='text-muted-1 bg-transparent'
108
108
  onMouseEnter={handleMouseEnter}
109
109
  onFocus={handleMouseEnter}
110
110
  onMouseLeave={handleMouseLeave}
111
111
  onBlur={handleMouseLeave}
112
112
  >
113
113
  {
114
- el.href && el.href !== "" ?
114
+ el.href && el.href !== '' ?
115
115
  <Link href={el.href} legacyBehavior passHref>
116
116
  {el.title}
117
117
  </Link> : <>{el.title}</>
118
118
  }
119
119
  </NavigationMenuTrigger>
120
120
  <NavigationMenuContent
121
- className={cn("fixed left-0 top-14 pt-6 w-screen h-full border-0 !backdrop-blur-3xl bg-transparent mt-0", menuHiddenClass)}
121
+ className={cn('fixed left-0 top-14 pt-6 w-screen h-full border-0 !backdrop-blur-3xl bg-transparent mt-0', menuHiddenClass)}
122
122
  onMouseEnter={handleMouseEnter}
123
123
  onMouseLeave={handleMouseLeave}
124
124
  >
125
125
  <div
126
- className="flex flex-row w-full justify-center"
126
+ className='flex flex-row w-full justify-center'
127
127
  onMouseLeave={handleContentMouseMove}
128
128
  >
129
129
  {GroupChildMenu({ childs: el.childMenu })}
@@ -135,70 +135,70 @@ const DesktopNav: React.FC<{
135
135
  ))}
136
136
  </NavigationMenuList>
137
137
  </NavigationMenu>
138
- ) : null;
139
- };
138
+ ) : null
139
+ }
140
140
 
141
141
  export default DesktopNav
142
142
 
143
143
  const ListItem = React.forwardRef<
144
- React.ElementRef<"a">,
145
- React.ComponentPropsWithoutRef<"a">
144
+ React.ElementRef<'a'>,
145
+ React.ComponentPropsWithoutRef<'a'>
146
146
  >(({ className, title, children, ...props }, ref) => (
147
147
  <li key={title}>
148
148
  <NavigationMenuLink asChild>
149
149
  <a
150
150
  ref={ref}
151
151
  className={cn(
152
- "block select-none space-y-1 rounded-md p-3 leading-none no-underline outline-none transition-colors hover:text-accent-foreground focus:bg-level-1 focus:text-accent-foreground text-muted-1 hover:text-primary hover:bg-transparent duration-1000 ease-in-out",
152
+ 'block select-none space-y-1 rounded-md p-3 leading-none no-underline outline-none transition-colors hover:text-accent-foreground focus:bg-level-1 focus:text-accent-foreground text-muted-1 hover:text-primary hover:bg-transparent duration-1000 ease-in-out',
153
153
  className
154
154
  )}
155
155
  {...props}
156
156
  >
157
- <div className="text-sm font-medium leading-none">{title}</div>
158
- <p className="line-clamp-3 text-sm leading-snug text-muted-1">
157
+ <div className='text-sm font-medium leading-none'>{title}</div>
158
+ <p className='line-clamp-3 text-sm leading-snug text-muted-1'>
159
159
  {children}
160
160
  </p>
161
161
  </a>
162
162
  </NavigationMenuLink>
163
163
  </li>
164
- ));
165
- ListItem.displayName = "ListItem"
164
+ ))
165
+ ListItem.displayName = 'ListItem'
166
166
 
167
167
  const GroupChildMenu = (params: { childs: ChildMenu[] | undefined, isCards?: boolean }) => {
168
- const { childs, isCards = false } = params;
168
+ const { childs, isCards = false } = params
169
169
 
170
170
  if (!childs) {
171
- return null;
171
+ return null
172
172
  }
173
173
 
174
174
  const groupedChildMenus = childs.reduce((grouped: Record<string, ChildMenu[]>, childLink) => {
175
175
  if (childLink.groupName) {
176
- grouped[childLink.groupName] = grouped[childLink.groupName] || [];
177
- grouped[childLink.groupName].push(childLink);
176
+ grouped[childLink.groupName] = grouped[childLink.groupName] || []
177
+ grouped[childLink.groupName].push(childLink)
178
178
  }
179
- return grouped;
180
- }, {});
179
+ return grouped
180
+ }, {})
181
181
 
182
182
  const getChildExtraClass = (index: number) => {
183
183
  if (isCards && (index === 3 || index === 4)) {
184
- return "xl:-mt-32"
184
+ return 'xl:-mt-32'
185
185
  }
186
- return ""
187
- };
186
+ return ''
187
+ }
188
188
 
189
189
  return Object.entries(groupedChildMenus).map(([groupName, childLinks], index) => (
190
- <div key={groupName} className={cn("py-4 px-4 ", getChildExtraClass(index))}>
191
- <h2 className="text-muted-1">{groupName}</h2>
192
- <ul className="w-[200px] gap-3 md:w-[250px] lg:w-[250px]">
190
+ <div key={groupName} className={cn('py-4 px-4 ', getChildExtraClass(index))}>
191
+ <h2 className='text-muted-1'>{groupName}</h2>
192
+ <ul className='w-[200px] gap-3 md:w-[250px] lg:w-[250px]'>
193
193
  {childLinks.map((link) => (
194
- <div className="flex justify-start items-center" key={link.title}>
194
+ <div className='flex justify-start items-center' key={link.title}>
195
195
  {link.icon}
196
- <ListItem key={link.title} title={link.title} href={link.href} className="ml-[14px]">
196
+ <ListItem key={link.title} title={link.title} href={link.href} className='ml-[14px]'>
197
197
  {link.contents}
198
198
  </ListItem>
199
199
  </div>
200
200
  ))}
201
201
  </ul>
202
202
  </div>
203
- ));
204
- };
203
+ ))
204
+ }
@@ -7,7 +7,7 @@ import Logo, { type LogoVariant } from '../logo'
7
7
 
8
8
  import DesktopBagPopup from '../commerce/desktop-bag-popup'
9
9
  import BagButton from '../commerce/bag-button'
10
- import DesktopNav from '../commerce/desktop-nav-menu'
10
+ import DesktopNav from './desktop-nav-menu'
11
11
 
12
12
 
13
13
  import type { LinkDef } from '@hanzo/ui/types'
@@ -17,11 +17,13 @@ const DesktopHeader: React.FC<{
17
17
  links: LinkDef[]
18
18
  className?: string
19
19
  noAuth?: boolean
20
+ noCommerce?: boolean
20
21
  logoVariant?: LogoVariant
21
22
  } & PropsWithChildren> = ({
22
23
  links,
23
24
  className = '',
24
25
  noAuth=false,
26
+ noCommerce=false,
25
27
  children,
26
28
  logoVariant='text-only'
27
29
  }) => {
@@ -47,7 +49,9 @@ const DesktopHeader: React.FC<{
47
49
  <DesktopNav links={links} isMenuOpened={isMenuOpened} setIsMenuOpen={setIsMenuOpen} />
48
50
  </div>
49
51
  <div className='flex items-center'>
50
- <DesktopBagPopup popupClx='w-[340px]' trigger={<BagButton className='text-primary -mr-[3px] lg:min-w-0' />} />
52
+ {!noCommerce && (
53
+ <DesktopBagPopup popupClx='w-[340px]' trigger={<BagButton className='text-primary -mr-[3px] lg:min-w-0' />} />
54
+ )}
51
55
  <AuthWidget noLogin={noAuth}/>
52
56
  {children}
53
57
  </div>
@@ -24,7 +24,7 @@ const Header: React.FC<{
24
24
  // TODO
25
25
  const [open, setOpen] = React.useState<boolean>(false);
26
26
 
27
- const { nav: { common, featured }, currentAs, noAuth } = siteDef
27
+ const { nav: { common, featured }, currentAs, noAuth, commerce } = siteDef
28
28
  const links = (featured) ? [...common, ...featured] : common
29
29
 
30
30
  return (<>
@@ -33,6 +33,7 @@ const Header: React.FC<{
33
33
  links={links}
34
34
  currentAs={currentAs}
35
35
  noAuth={noAuth}
36
+ noCommerce={!!!commerce}
36
37
  logoVariant={logoVariant}
37
38
  >{children}</DesktopHeader>
38
39
  <MobileHeader
@@ -41,7 +42,7 @@ const Header: React.FC<{
41
42
  currentAs={currentAs}
42
43
  setChatbotOpen={setOpen}
43
44
  noAuth={noAuth}
44
-
45
+ noCommerce={!!!commerce}
45
46
  />
46
47
  </>)
47
48
  }
@@ -5,7 +5,7 @@ import { Drawer, DrawerContent} from '@hanzo/ui/primitives'
5
5
  import { cn } from '@hanzo/ui/util'
6
6
  import { CartPanel } from '@hanzo/commerce'
7
7
 
8
- import BagButton from './bag-button'
8
+ import BagButton from '../commerce/bag-button'
9
9
 
10
10
  const MobileBagDrawer: React.FC<{
11
11
  open: boolean,
@@ -0,0 +1,47 @@
1
+ import React, { useState } from 'react'
2
+ import Link from 'next/link'
3
+
4
+ import type { LinkDefExtended } from '../../site-def/main-nav'
5
+ import { LeftArrow, RightArrow } from '../icons'
6
+ import MobileNavMenuAI from './mobile-nav-menu-ai'
7
+
8
+ const MobileNavMenuItem: React.FC<{
9
+ link: LinkDefExtended,
10
+ setMenuOpen: (open: boolean) => void
11
+ }> = ({
12
+ link,
13
+ setMenuOpen
14
+ }) => {
15
+ const [isOpen, setIsOpen] = useState<boolean>(false);
16
+
17
+ return (
18
+ <>
19
+ <div className="w-full flex items-center px-5 py-3 gap-[27px] text-2xl cursor-pointer" onClick={() => setIsOpen(true)}>
20
+ <span className='block w-[18px] h-[22px] items-center'>{link.icon}</span>
21
+ <span className='flex-1'>{link.title}</span>
22
+ <RightArrow className='' />
23
+ </div>
24
+ <div className={`fixed left-0 top-0 w-screen h-screen ${isOpen ? 'block' : 'hidden'}`} style={{ backgroundColor: 'black' }}>
25
+ <MobileNavMenuAI setMenuOpen={setMenuOpen} />
26
+ <div className="w-full flex items-center px-5 py-3 gap-[27px] text-2xl font-bold" onClick={() => setIsOpen(false)}>
27
+ <LeftArrow />
28
+ <span className="text-white">{link.title}</span>
29
+ </div>
30
+ <div className="flex flex-col">
31
+ {link.childMenu?.map((menu, index) => {
32
+ return (
33
+ <Link href={menu.href}>
34
+ <div className="w-full flex items-center px-5 py-3 gap-[27px] text-2xl" key={index}>
35
+ <span className='w-[18px] h-[22px] self-center flex items-center justify-center'>{menu.icon}</span>
36
+ <span className='flex-1'>{menu.title}</span>
37
+ </div>
38
+ </Link>
39
+ )
40
+ })}
41
+ </div>
42
+ </div>
43
+ </>
44
+ )
45
+ }
46
+
47
+ export default MobileNavMenuItem
@@ -5,7 +5,7 @@ import { cn } from '@hanzo/ui/util'
5
5
  import type { LinkDefExtended, ChildMenu } from '../../site-def/main-nav'
6
6
  import MobileNavMenuAI from './mobile-nav-menu-ai'
7
7
  import MobileNavMenuItem from './mobile-nav-menu-item'
8
- import MobileAuthWidget from './mobile-login-button'
8
+ import MobileAuthWidget from '../auth/mobile-login-button'
9
9
  import { Accordion, AccordionItem, AccordionTrigger, AccordionContent } from '@hanzo/ui/primitives'
10
10
  import { ChevronDown } from 'lucide-react'
11
11
  import Link from 'next/link'
@@ -6,16 +6,16 @@ import type { LinkDef } from '@hanzo/ui/types'
6
6
  import { cn } from '@hanzo/ui/util'
7
7
 
8
8
  import { CartPanel, useCommerce } from '@hanzo/commerce'
9
- import { AuthWidget, LoginPanel } from '@hanzo/auth/components'
9
+ import { LoginPanel } from '@hanzo/auth/components'
10
10
  import sendGAEvent from '../../next/analytics/google-analytics'
11
- import * as Icons from '../icons'
12
11
 
12
+ import { Avatar, Bag } from '../icons'
13
13
  import { Logo } from '..'
14
14
 
15
- import MenuToggleButton from '../commerce/mobile-menu-toggle-button'
15
+ import MenuToggleButton from './mobile-menu-toggle-button'
16
16
  import BagButton from '../commerce/bag-button'
17
- import MobileBagDrawer from '../commerce/mobile-bag-drawer'
18
- import NavMenu from '../commerce/mobile-nav-menu'
17
+ import MobileBagDrawer from './mobile-bag-drawer'
18
+ import NavMenu from './mobile-nav-menu'
19
19
 
20
20
  const bagClx = 'mt-4 mb-8 border-none py-0 px-4 w-full ' +
21
21
  'sm:min-w-[350px] sm:max-w-[500px] sm:mx-auto min-h-[60vh] max-h-[70vh] ' +
@@ -24,15 +24,17 @@ const bagClx = 'mt-4 mb-8 border-none py-0 px-4 w-full ' +
24
24
  const MobileHeader: React.FC<{
25
25
  currentAs: string | undefined
26
26
  links: LinkDef[]
27
- className?: string,
28
- setChatbotOpen: (open: boolean) => void,
27
+ className?: string
28
+ setChatbotOpen: (open: boolean) => void
29
29
  noAuth?: boolean
30
+ noCommerce?: boolean
30
31
  }> = ({
31
32
  currentAs,
32
33
  links,
33
34
  className = '',
34
35
  setChatbotOpen,
35
- noAuth=false // :aa TODO
36
+ noAuth=false, // :aa TODO
37
+ noCommerce=false // :aa TODO
36
38
  }) => {
37
39
  const cmmc = useCommerce()
38
40
  const [menuState, setMenuState] = useState<'closed' | 'nav' | 'login' | 'bag'>('closed')
@@ -101,7 +103,7 @@ const MobileHeader: React.FC<{
101
103
  'flex flex-row ' +
102
104
  'bg-background animate-mobile-menu-open'
103
105
  }>
104
- <Icons.Avatar className='self-center ' />
106
+ <Avatar className='self-center ' />
105
107
  </div>
106
108
  )}
107
109
  <div className='flex gap-0 flex-row'>
@@ -111,22 +113,25 @@ const MobileHeader: React.FC<{
111
113
 
112
114
  </div>
113
115
  </header>
114
- <MobileBagDrawer
115
- className=''
116
- open={bagDrawerOpen}
117
- setOpen={setBagDrawerOpen}
118
- handleCheckout={handleCheckout}
119
- />
116
+ {!noCommerce && (
117
+ <MobileBagDrawer
118
+ className=''
119
+ open={bagDrawerOpen}
120
+ setOpen={setBagDrawerOpen}
121
+ handleCheckout={handleCheckout}
122
+ />
123
+ )}
124
+
120
125
  {menuOpen() && (
121
126
  <div className={
122
127
  'fixed top-0 left-0 w-full h-full ' +
123
128
  // z must below header itself
124
129
  'flex flex-column bg-background z-below-header animate-mobile-menu-open'
125
130
  }>
126
- {menuState === 'login' ? (
131
+ {(!!!noAuth && menuState === 'login') ? (
127
132
  <LoginPanel noHeading onLoginChanged={onLoginChanged} className='sm:animate-in sm:zoom-in-90' />
128
133
  ) : (
129
- menuState === 'bag' ? (
134
+ (!!!noCommerce && menuState === 'bag') ? (
130
135
 
131
136
  <CartPanel
132
137
  handleCheckout={() => { router.push('/checkout') }}
@@ -139,7 +144,7 @@ const MobileHeader: React.FC<{
139
144
  buttonClx='max-w-[220px] flex-none'
140
145
  >
141
146
  <div className='flex flex-row items-center flex-none justify-center '>
142
- <Icons.bag className='mr-2 relative w-4 h-5 fill-foreground ' />
147
+ <Bag className='mr-2 relative w-4 h-5 fill-foreground ' />
143
148
  <p className='font-heading text-foreground text-default'>Your Bag</p>
144
149
  </div>
145
150
  <div className='h-[1px] w-pr-80 bg-muted-3 mx-auto mt-1.5 flex-none' />
@@ -0,0 +1,6 @@
1
+ export { default as Avatar } from './avatar'
2
+ export { default as Bag } from './bag-icon'
3
+ export { default as LeftArrow } from './left-arrow'
4
+ export { default as LuxLogo } from './lux-logo'
5
+ export { default as RightArrow } from './right-arrow'
6
+ export { default as SocialIcon, type SocialIconProps } from './social-icon'
@@ -3,7 +3,7 @@ import Link from 'next/link'
3
3
 
4
4
  import { type TShirtSize } from '@hanzo/ui/types'
5
5
 
6
- import * as Icons from './icons'
6
+ import { LuxLogo } from './icons'
7
7
 
8
8
  const TEXT = 'LUX'
9
9
  type LogoVariant = 'text-only' | 'logo-only' | 'full'
@@ -74,12 +74,12 @@ const Logo: React.FC<{
74
74
  return (
75
75
  href ? (
76
76
  <Link href={href} className={outerClasses} onClick={onClick} >
77
- <Icons.logo className={classes.icon} />
77
+ <LuxLogo className={classes.icon} />
78
78
  <span className={spanClasses}>{TEXT}</span>
79
79
  </Link>
80
80
  ) : (
81
81
  <span className={outerClasses} onClick={onClick}>
82
- <Icons.logo className={classes.icon} />
82
+ <LuxLogo className={classes.icon} />
83
83
  <span className={spanClasses}>{TEXT}</span>
84
84
  </span>
85
85
  )