@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.
Files changed (65) hide show
  1. package/commerce/ui/context.tsx +13 -16
  2. package/components/access-code-input.tsx +3 -4
  3. package/components/analytics.tsx +8 -17
  4. package/components/auth/login-panel.tsx +7 -6
  5. package/components/auth/login.tsx +1 -1
  6. package/components/auth/widget.tsx +1 -1
  7. package/components/back-button.tsx +4 -7
  8. package/components/chat-widget.tsx +5 -6
  9. package/components/commerce/bag-button.tsx +8 -7
  10. package/components/commerce/buy-button.tsx +2 -3
  11. package/components/commerce/checkout-button.tsx +12 -10
  12. package/components/commerce/checkout-panel/cart-accordian.tsx +3 -4
  13. package/components/commerce/checkout-panel/desktop-cp.tsx +5 -6
  14. package/components/commerce/checkout-panel/index.tsx +1 -1
  15. package/components/commerce/checkout-panel/mobile-cp.tsx +4 -4
  16. package/components/commerce/checkout-panel/policy-links.tsx +7 -12
  17. package/components/commerce/checkout-panel/steps-indicator.tsx +1 -1
  18. package/components/commerce/desktop-bag-popup.tsx +1 -1
  19. package/components/commerce/drawer/micro.tsx +30 -30
  20. package/components/commerce/drawer/shell.tsx +3 -5
  21. package/components/contact-dialog/contact-form.tsx +6 -13
  22. package/components/contact-dialog/index.tsx +2 -2
  23. package/components/copyright.tsx +3 -2
  24. package/components/drawer-margin.tsx +2 -2
  25. package/components/footer.tsx +6 -7
  26. package/components/header/desktop-nav-menu.tsx +6 -6
  27. package/components/header/desktop.tsx +5 -5
  28. package/components/header/index.tsx +1 -1
  29. package/components/header/mobile-bag-drawer.tsx +1 -1
  30. package/components/header/mobile-menu-toggle-button.tsx +5 -6
  31. package/components/header/mobile-nav-menu-ai.tsx +13 -12
  32. package/components/header/mobile-nav-menu-item.tsx +12 -11
  33. package/components/header/mobile-nav-menu.tsx +17 -16
  34. package/components/header/mobile.tsx +7 -8
  35. package/components/icons/social-icon.tsx +1 -1
  36. package/components/logo.tsx +3 -2
  37. package/components/main.tsx +3 -4
  38. package/components/mini-chart/mini-chart.tsx +2 -1
  39. package/next/font/font-desc.ts +18 -0
  40. package/next/font/fonts.ts +40 -0
  41. package/next/font/get-app-router-font-classes.ts +14 -12
  42. package/next/font/load-and-return-lux-next-fonts-on-import.ts +16 -24
  43. package/next/font/local/Zen-Variable.woff2 +0 -0
  44. package/next/font/next-font-desc.ts +18 -17
  45. package/next/head-metadata/index.tsx +7 -6
  46. package/next/head-metadata/next-metadata.ts +49 -0
  47. package/package.json +9 -10
  48. package/root-layout/index.tsx +39 -19
  49. package/style/fonts/Zen-Variable.woff2 +0 -0
  50. package/style/lux-colors.css +0 -1
  51. package/style/lux-fonts.css +5 -11
  52. package/style/lux-global-non-next.css +9 -9
  53. package/style/lux-global.css +56 -21
  54. package/tsconfig.json +8 -0
  55. package/next/font/local/Druk-Wide-Bold.ttf +0 -0
  56. package/next/font/local/Druk-Wide-Medium.ttf +0 -0
  57. package/next/head-metadata/from-next/metadata-types.ts +0 -158
  58. package/next/head-metadata/from-next/opengraph-types.ts +0 -267
  59. package/next/head-metadata/from-next/twitter-types.ts +0 -92
  60. package/style/fonts/Druk-Wide-Bold.ttf +0 -0
  61. package/style/fonts/Druk-Wide-Medium.ttf +0 -0
  62. package/tailwind/fontFamily.tailwind.lux.ts +0 -18
  63. package/tailwind/index.ts +0 -2
  64. package/tailwind/lux-tw-fonts.ts +0 -40
  65. package/tailwind/tailwind.config.lux-preset.ts +0 -10
@@ -2,8 +2,8 @@
2
2
  import React from 'react'
3
3
  import { observer } from 'mobx-react-lite'
4
4
 
5
- import { Button, Image } from '@hanzo/ui/primitives'
6
- import { cn, } from '@hanzo/ui/util'
5
+ import { Button, } from '@hanzo/ui/primitives'
6
+ import { Box, MediaStack, cn } from '@hanzo/ui'
7
7
  import type { LineItem } from '@hanzo/commerce/types'
8
8
  import { useCommerce, formatCurrencyValue } from '@hanzo/commerce'
9
9
 
@@ -37,20 +37,20 @@ const Info: React.FC<{
37
37
  const priceStr = formatCurrencyValue(item.price)
38
38
 
39
39
  return (<>
40
- <div className={cn('sm:hidden flex flex-col !text-muted items-stretch whitespace-nowrap text-ellipsis ', clx)}>
40
+ <Box className={cn('sm:hidden flex flex-col !text-muted items-stretch whitespace-nowrap text-ellipsis ', clx)}>
41
41
  <p className='text-left text-xs'>{topLine}</p>
42
42
  <div className='flex justify-between text-xxs'>
43
43
  <div>{optionLabel}</div>
44
44
  <div className='pl-2.5'>{priceStr}</div>
45
45
  </div>
46
- </div>
47
- <div className={cn('hidden sm:flex !text-muted flex-col items-stretch whitespace-nowrap text-ellipsis text-xs', clx)}>
46
+ </Box>
47
+ <Box className={cn('hidden sm:flex !text-muted flex-col items-stretch whitespace-nowrap text-ellipsis text-xs', clx)}>
48
48
  <p className='text-left'>{topLine}</p>
49
49
  <div className='flex justify-between'>
50
50
  <div>{optionLabel}</div>
51
51
  <div className='pl-2.5'>{priceStr}</div>
52
52
  </div>
53
- </div>
53
+ </Box>
54
54
  </>)
55
55
  }
56
56
 
@@ -70,29 +70,26 @@ const Micro: React.FC<{
70
70
  const cmmc = useCommerce()
71
71
 
72
72
  return (
73
- <div className={cn(
73
+ <Box className={cn(
74
74
  (drawer.showRecent ? 'grid grid-cols-2' : 'flex justify-center items-center '),
75
75
  (drawer.showRecent ? ((drawer.isMobile) ? '-mt-3' : '-mt-3') : ''),
76
76
  'gap-2 md:gap-3 relative',
77
77
  clx
78
78
  )}>
79
79
  {drawer.showRecent && (
80
- <div className={'flex flex-col items-stretch ' + (drawer.isMobile ? 'justify-start' : 'group')}>
81
- <p className={'relative text-muted text-xxs md:text-xs leading-none pl-1 self-start ' + (drawer.isMobile ? 'top-[3px]' : 'top-[1px]')}>
80
+ <Box className={'flex flex-col items-stretch ' + (drawer.isMobile ? 'justify-start' : 'group')}>
81
+ <Box tag="p" className={'relative text-muted text-xxs md:text-xs leading-none pl-1 self-start ' + (drawer.isMobile ? 'top-[3px]' : 'top-[1px]')}>
82
82
  <span className='invisible'>scrictly for layout</span>
83
83
  {drawer.isMobile ? (
84
- <span className={PROMPT_COMMON_CLX}>tap for options:</span>
84
+ <Box tag="span" className={PROMPT_COMMON_CLX}>tap for options:</Box>
85
85
  ) : (<>
86
- <span className={PROMPT_COMMON_CLX + ' group-hover:opacity-0'}>recent item:</span>
87
- <span className={PROMPT_COMMON_CLX + ' opacity-0 group-hover:opacity-100'}>view options:</span>
86
+ <Box tag="span" className={PROMPT_COMMON_CLX + ' group-hover:opacity-0'}>recent item:</Box>
87
+ <Box tag="span" className={PROMPT_COMMON_CLX + ' opacity-0 group-hover:opacity-100'}>view options:</Box>
88
88
  </>)}
89
- </p>
89
+ </Box>
90
90
  <Button
91
91
  variant='ghost'
92
- rounded={drawer.isMobile ? 'md' : 'lg'}
93
- size={drawer.isMobile ? 'sm' : 'default'}
94
- onClick={handleItemClicked}
95
- className={cn(
92
+ className={cn(`rounded-${drawer.isMobile ? 'md' : 'lg'}`, cn(
96
93
  'box-content',
97
94
  'flex flex-row justify-between items-center gap-1',
98
95
  '-ml-1.5',
@@ -101,12 +98,15 @@ const Micro: React.FC<{
101
98
  'border border-transparent group-hover:border-muted-3',
102
99
  'group-hover:!bg-transparent',
103
100
  '!min-w-0'
104
- )}
101
+ ))}
102
+ size={drawer.isMobile ? 'sm' : 'default'}
103
+ onClick={handleItemClicked}
104
+
105
105
  >
106
106
  {cmmc.recentItem?.item.img && (<>
107
- <Image def={cmmc.recentItem.item.img} constrainTo={CN.mobile} preload className='sm:hidden grow-0 shrink-0'/>
108
- <Image def={cmmc.recentItem.item.img} constrainTo={CN.sm} preload className='hidden sm:block md:hidden grow-0 shrink-0'/>
109
- <Image def={cmmc.recentItem.item.img} constrainTo={CN.desktop} preload className='hidden md:block grow-0 shrink-0'/>
107
+ <MediaStack media={{img: cmmc.recentItem.item.img}} constrainTo={CN.mobile} className='sm:hidden grow-0 shrink-0' />
108
+ <MediaStack media={{img: cmmc.recentItem.item.img}} constrainTo={CN.sm} className='hidden sm:block md:hidden grow-0 shrink-0' />
109
+ <MediaStack media={{img: cmmc.recentItem.item.img}} constrainTo={CN.desktop} className='hidden md:block grow-0 shrink-0' />
110
110
  </>)}
111
111
  {cmmc.recentItem && (
112
112
  <div className='grow w-full'>
@@ -114,10 +114,10 @@ const Micro: React.FC<{
114
114
  </div>
115
115
  )}
116
116
  </Button>
117
- </div>
117
+ </Box>
118
118
  )}
119
119
  {drawer.showCheckout && (
120
- <div className={cn(
120
+ <Box className={cn(
121
121
  'flex flex-col w-full',
122
122
  (drawer.showRecent ? 'items-stretch' : 'items-center' ),
123
123
  (drawer.isMobile ? 'justify-start' : 'justify-center')
@@ -126,19 +126,19 @@ const Micro: React.FC<{
126
126
  <CheckoutButton
127
127
  handleCheckout={handleCheckout}
128
128
  variant='primary'
129
- size={drawer.isMobile ? 'xs' : 'lg'}
130
- rounded={drawer.isMobile ? 'md' : 'lg'}
131
- centerText={drawer.isMobile ? !drawer.showRecent : true}
132
- className={cn(drawer.isMobile ?
129
+ size={drawer.isMobile ? 'sm' : 'lg'}
130
+ className={cn(`rounded-${drawer.isMobile ? 'md' : 'lg'}`, cn(drawer.isMobile ?
133
131
  (drawer.showRecent ? 'pl-3.5 pr-2.5' : 'min-w-[320px]')
134
132
  :
135
133
  (drawer.showRecent ? '' : 'w-[320px]'),
136
134
  'text-sm font-semibold'
137
- )}
135
+ ))}
136
+ centerText={drawer.isMobile ? !drawer.showRecent : true}
137
+
138
138
  />
139
- </div>
139
+ </Box>
140
140
  )}
141
- </div>
141
+ </Box>
142
142
  )
143
143
  })
144
144
 
@@ -8,8 +8,7 @@ import {
8
8
  DrawerHandle,
9
9
  type DrawerProps,
10
10
  } from '@hanzo/ui/primitives'
11
- import { cn } from '@hanzo/ui/util'
12
-
11
+ import { Box, cn } from '@hanzo/ui'
13
12
  import '../../../style/drawer-handle-overrides.css'
14
13
  import { useCommerceDrawer } from '../../../commerce/ui/context'
15
14
 
@@ -58,7 +57,7 @@ const CommerceDrawer: React.FC<PropsWithChildren &
58
57
  'w-full h-full',
59
58
  )}
60
59
  // https://github.com/radix-ui/primitives/discussions/935
61
- onOpenAutoFocus={(e) => {e.preventDefault()}}
60
+ onOpenAutoFocus={(e: Event) => { e.preventDefault() }}
62
61
  >
63
62
  <DrawerHandle
64
63
  className={cn(
@@ -68,7 +67,7 @@ const CommerceDrawer: React.FC<PropsWithChildren &
68
67
  drawer.isMobile ? 'h-5 touch-pan-y' : 'h-6',
69
68
  )}
70
69
  >
71
- <div className={cn(
70
+ <Box className={cn(
72
71
  // pseudo-handle
73
72
  'rounded-[3px] bg-level-3',
74
73
  drawer.isMobile ? 'w-[155px] mt-[5px] h-1.5' : 'w-[180px] mt-[3px] h-2.5 hover:bg-level-4',
@@ -81,5 +80,4 @@ const CommerceDrawer: React.FC<PropsWithChildren &
81
80
  )
82
81
  })
83
82
 
84
-
85
83
  export default CommerceDrawer
@@ -16,14 +16,7 @@ import {
16
16
  Input,
17
17
  } from '@hanzo/ui/primitives'
18
18
 
19
- import {
20
- Form,
21
- FormControl,
22
- FormField,
23
- FormItem,
24
- FormMessage,
25
- } from '@hanzo/ui/form'
26
-
19
+ import { Box, Form, FormControl, FormField, FormItem, FormMessage, css } from '@hanzo/ui'
27
20
  import type { SubmitServerAction } from '@hanzo/ui/types'
28
21
  import type { ContactInfo } from '../../types'
29
22
 
@@ -77,15 +70,15 @@ const ContactForm: React.FC<{
77
70
  <FormControl>
78
71
  <Input placeholder={placeholder} {...field} className="mt-0 text-foreground"/>
79
72
  </FormControl>
80
- <div className="flex flex-row justify-start items-stretch gap-2">
73
+ <Box className="flex flex-row justify-start items-stretch gap-2">
81
74
  <FormMessage />
82
- </div>
75
+ </Box>
83
76
  </FormItem>
84
77
  )
85
78
 
86
79
  return (
87
80
  <Form {...form}>
88
- <form onSubmit={form.handleSubmit(onSubmit)} className="w-3/4">
81
+ <Box tag="form" onSubmit={form.handleSubmit(onSubmit)} className="w-3/4">
89
82
  <div className='flex flex-col justify-start items-stretch mt-4'>
90
83
  <FormField
91
84
  control={form.control}
@@ -100,7 +93,7 @@ const ContactForm: React.FC<{
100
93
  />
101
94
  <Button disabled={isPending} type='submit' className='bg-primary text-primary-fg hover:bg-primary-hover'>
102
95
  {isPending ? (<>
103
- <Loader2 className="mr-2 h-4 w-4 animate-spin" />
96
+ <Loader2 style={css('mr-2 h-4 w-4 animate-spin')} />
104
97
  Please wait
105
98
  </>
106
99
  ) : (
@@ -108,7 +101,7 @@ const ContactForm: React.FC<{
108
101
  )}
109
102
  </Button>
110
103
  </div>
111
- </form>
104
+ </Box>
112
105
  </Form>
113
106
  )
114
107
  }
@@ -30,7 +30,7 @@ const ContactDialog: React.FC<ButtonModalProps> = ({
30
30
  const [success, setSuccess] = useState(false)
31
31
 
32
32
  const onSubmit = async (formData: any, enclosure: any) => {
33
- const result = await action(formData, enclosure)
33
+ const result = (await action(formData, enclosure)) as { success?: boolean }
34
34
  if (result.success) {
35
35
  setSuccess(true)
36
36
  }
@@ -48,7 +48,7 @@ const ContactDialog: React.FC<ButtonModalProps> = ({
48
48
  </DialogHeader>
49
49
  <div className='px-8 pb-8 rounded-e-lg flex flex-col justify-start items-center'>
50
50
  {success ? (
51
- <p>{actionEnclosure?.reply}</p>
51
+ <p>{(actionEnclosure as { reply?: string } | undefined)?.reply}</p>
52
52
  ) : (
53
53
  <ContactForm onSubmit={onSubmit} enclosure={actionEnclosure}/>
54
54
  )}
@@ -1,4 +1,5 @@
1
1
  import React from 'react'
2
+ import { Box } from '@hanzo/ui'
2
3
 
3
4
  const FIRST = 2020
4
5
 
@@ -12,9 +13,9 @@ const Copyright: React.FC<{
12
13
  const yearString = (year > FIRST) ? `${FIRST} - ${year}` : FIRST.toString()
13
14
 
14
15
  return (
15
- <div className={className}>
16
+ <Box className={className}>
16
17
  {`Copyright © ${yearString}`}&nbsp;<br className='sm:hidden'/>Lux Partners Limited.&nbsp;<br className='md:hidden'/>&nbsp;All rights reserved.
17
- </div>
18
+ </Box>
18
19
  )
19
20
  }
20
21
 
@@ -1,7 +1,7 @@
1
1
  'use client'
2
2
  import React from 'react'
3
3
 
4
- import { cn } from '@hanzo/ui/util'
4
+ import { Box, cn } from '@hanzo/ui'
5
5
  import { useCommerceDrawer } from '@luxfi/ui/commerce'
6
6
  import { observer } from 'mobx-react-lite'
7
7
 
@@ -16,7 +16,7 @@ const DrawerMargin: React.FC<{
16
16
  throw new Error("DrawerMargin must be used with a CommerceUIContext!")
17
17
  }
18
18
  return (
19
- <div
19
+ <Box
20
20
  className={cn('transition-height', clx)}
21
21
  style={{
22
22
  height: drawer.state === 'micro' ? drawer.microHeight : 0
@@ -2,8 +2,7 @@ import React from 'react'
2
2
 
3
3
  import type { LinkDef } from '@hanzo/ui/types'
4
4
  import { NavItems } from '@hanzo/ui/primitives'
5
- import { cn } from '@hanzo/ui/util'
6
-
5
+ import { Box, cn } from '@hanzo/ui'
7
6
  import Copyright from './copyright'
8
7
  import type { SiteDef } from '../site-def'
9
8
  import { legal } from '../site-def/footer/legal'
@@ -26,8 +25,8 @@ const Footer: React.FC<{
26
25
  const _aboveCopyright = (typeof aboveCopyright === 'undefined') ? legal : aboveCopyright
27
26
 
28
27
  return (
29
- <footer className={cn('grow flex flex-col justify-between gap-6 pb-[2vh]', className)}>
30
- <div className={
28
+ <Box tag="footer" className={cn('grow flex flex-col justify-between gap-6 pb-[2vh]', className)}>
29
+ <Box className={
31
30
  (noHorizPadding ? '' : 'px-5 md:px-8 ') +
32
31
  'grid grid-cols-2 gap-4 gap-y-6 md:gap-x-6 lg:gap-8 ' + smGridColsClx +
33
32
  'md:w-full sm:justify-items-center md:mx-0 lg:w-full ' +
@@ -53,19 +52,19 @@ const Footer: React.FC<{
53
52
  />
54
53
  )
55
54
  })}
56
- </div>
55
+ </Box>
57
56
  <div className='md:mt-[2vh]'>
58
57
  {_aboveCopyright.length > 0 && (
59
58
  <NavItems
60
59
  items={_aboveCopyright}
61
60
  as='div'
62
- className={'flex flex-row justify-center gap-4 mb-2'}
61
+ className="flex flex-row justify-center gap-4 mb-2"
63
62
  itemClx={'text-sm text-center text-muted-2 underline hover:text-foreground'}
64
63
  />
65
64
  )}
66
65
  <Copyright className='text-sm text-center text-muted-3'/>
67
66
  </div>
68
- </footer>
67
+ </Box>
69
68
  )
70
69
  }
71
70
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  import * as React from 'react'
4
4
  import Link from 'next/link'
5
- import { cn } from '@hanzo/ui/util'
5
+ import { Box, cn, css } from '@hanzo/ui'
6
6
  import type { ChildMenu, LinkDefExtended } from '../../site-def/main-nav'
7
7
  import {
8
8
  NavigationMenu,
@@ -68,7 +68,7 @@ const DesktopNav: React.FC<{
68
68
  {links.map((el, index) => (
69
69
  <NavigationMenuItem key={index} className='!m-0'>
70
70
  {el.isAIMenu ? (
71
- <Link href={el.href} className={cn(navigationMenuTriggerStyle(), ' text-muted-1 bg-transparent')}>
71
+ <Link href={el.href} style={css(cn(navigationMenuTriggerStyle(), ' text-muted-1 bg-transparent'))}>
72
72
  {el.title}
73
73
  </Link>
74
74
  ) : el.title === 'Cards' ? (
@@ -144,7 +144,7 @@ const ListItem = React.forwardRef<
144
144
  >(({ className, title, children, ...props }, ref) => (
145
145
  <li key={title}>
146
146
  <NavigationMenuLink asChild>
147
- <a
147
+ <Box tag="a"
148
148
  ref={ref}
149
149
  className={cn(
150
150
  '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',
@@ -156,7 +156,7 @@ const ListItem = React.forwardRef<
156
156
  <p className='line-clamp-3 text-sm leading-snug text-muted-1'>
157
157
  {children}
158
158
  </p>
159
- </a>
159
+ </Box>
160
160
  </NavigationMenuLink>
161
161
  </li>
162
162
  ))
@@ -185,7 +185,7 @@ const GroupChildMenu = (params: { childs: ChildMenu[] | undefined, isCards?: boo
185
185
  }
186
186
 
187
187
  return Object.entries(groupedChildMenus).map(([groupName, childLinks], index) => (
188
- <div key={groupName} className={cn('py-4 px-4 ', getChildExtraClass(index))}>
188
+ <Box key={groupName} className={cn('py-4 px-4 ', getChildExtraClass(index))}>
189
189
  <h2 className='text-muted-1'>{groupName}</h2>
190
190
  <ul className='w-[200px] gap-3 md:w-[250px] lg:w-[250px]'>
191
191
  {childLinks.map((link) => (
@@ -197,6 +197,6 @@ const GroupChildMenu = (params: { childs: ChildMenu[] | undefined, isCards?: boo
197
197
  </div>
198
198
  ))}
199
199
  </ul>
200
- </div>
200
+ </Box>
201
201
  ))
202
202
  }
@@ -1,6 +1,6 @@
1
1
  import React, { type PropsWithChildren } from 'react'
2
2
 
3
- import { cn } from '@hanzo/ui/util'
3
+ import { Box, cn } from '@hanzo/ui'
4
4
  import AuthWidget from '../auth/widget'
5
5
 
6
6
  import Logo, { type LogoVariant } from '../logo'
@@ -32,13 +32,13 @@ const DesktopHeader: React.FC<{
32
32
  // TODO move 13px into a size class and configure twMerge to recognize say, 'text-size-nav'
33
33
  // (vs be beat out by 'text-color-nav')
34
34
  return (
35
- <header id='DESKTOP_HEADER' className={cn(
35
+ <Box tag="header" id='DESKTOP_HEADER' className={cn(
36
36
  'bg-[rgba(0, 0, 0, 0.5)] !backdrop-blur-3xl fixed z-header top-0 left-0 right-0',
37
37
  className,
38
38
  isMenuOpened ? ' h-full' : ''
39
39
  )} >
40
40
  {/* md or larger */}
41
- <div className={
41
+ <Box className={
42
42
  'flex flex-row h-[80px] items-center justify-between ' +
43
43
  'mx-[24px] w-full max-w-screen'
44
44
  }>
@@ -55,8 +55,8 @@ const DesktopHeader: React.FC<{
55
55
  {!noAuth && <AuthWidget />}
56
56
  {children}
57
57
  </div>
58
- </div>
59
- </header>
58
+ </Box>
59
+ </Box>
60
60
  )
61
61
  }
62
62
 
@@ -5,7 +5,7 @@ import type { SiteDef } from '../../site-def'
5
5
 
6
6
  import DesktopHeader from './desktop'
7
7
  import MobileHeader from './mobile'
8
- import { cn } from '@hanzo/ui/util'
8
+ import { cn } from '@hanzo/ui'
9
9
  import { type LogoVariant } from '../logo'
10
10
 
11
11
 
@@ -2,7 +2,7 @@
2
2
  import React from 'react'
3
3
 
4
4
  import { Drawer, DrawerContent} from '@hanzo/ui/primitives'
5
- import { cn } from '@hanzo/ui/util'
5
+ import { cn } from '@hanzo/ui'
6
6
  import { CartPanel } from '@hanzo/commerce'
7
7
 
8
8
  import BagButton from '../commerce/bag-button'
@@ -4,8 +4,7 @@ import React, { useState } from 'react'
4
4
  import { Plus } from 'lucide-react'
5
5
 
6
6
  import { Button } from '@hanzo/ui/primitives'
7
- import { cn } from '@hanzo/ui/util'
8
-
7
+ import { cn, css } from '@hanzo/ui'
9
8
  const MobileMenuToggleButton: React.FC<{
10
9
  open: boolean
11
10
  setOpen: (b: boolean) => void
@@ -20,14 +19,14 @@ const MobileMenuToggleButton: React.FC<{
20
19
  <Button
21
20
  variant='ghost'
22
21
  size='default'
23
- rounded='full'
22
+ className={cn('rounded-full', cn('p-0 aspect-square hover:bg-background sm:hover:bg-level-1 active:scale-75', className))}
24
23
  onClick={() => {setOpen(!open)}}
25
- className={cn('p-0 aspect-square hover:bg-background sm:hover:bg-level-1 active:scale-75', className)}
24
+
26
25
  >
27
- <Plus width={28} height={28} className={
26
+ <Plus width={28} height={28} style={css(
28
27
  'block h-full will-change-transform transition-transform transition-scale transition-duration-[1500] ' +
29
28
  (open ? 'rotate-[135deg] scale-110' : 'rotate-none')
30
- } />
29
+ )} />
31
30
  </Button>
32
31
  )
33
32
  }
@@ -1,5 +1,6 @@
1
1
  'use client'
2
2
  import React, { useState } from 'react'
3
+ import { Box, cn, css } from '@hanzo/ui'
3
4
  import { ArrowRight, Plus } from 'lucide-react'
4
5
  import { Button, Card } from '@hanzo/ui/primitives'
5
6
  import { Logo } from '..'
@@ -13,22 +14,22 @@ const MobileNavMenuAI: React.FC<MobileNavMenuAIProps> = ({ setMenuOpen }) => {
13
14
 
14
15
  return (
15
16
  <>
16
- <div className="w-full text-2xl cursor-pointer">
17
+ <Box className="w-full text-2xl cursor-pointer">
17
18
  <div className='flex justify-between'>
18
19
  <Logo variant='wordmark' 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)} />
20
+ <Box tag="span" className={cn('grid', '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
+ <Plus width={28} height={28} style={css('w-full h-full')} onClick={() => setMenuOpen(false)} />
23
+ </Box>
23
24
  </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)}>
25
+ <Box className="flex items-center gap-5 border-b border-[#3A3A3A] mt-4 rounded-full bg-muted-4 mx-6">
26
+ <Box className="text-muted-1 font-bold flex-1 flex justify-between min-h-12 items-center px-2" onClick={() => setIsOpen(true)}>
26
27
  <span className='text-base pl-2 font-light'>Ask AI a question</span>
27
28
  <ArrowRight />
28
- </div>
29
- </div>
30
- </div>
31
- <div className={
29
+ </Box>
30
+ </Box>
31
+ </Box>
32
+ <Box className={
32
33
  'fixed bottom-0 sm:bottom-16 right-0 w-full h-full ' +
33
34
  'sm:max-w-[400px] sm:max-h-[550px] sm:px-4 z-floating ' +
34
35
  (isOpen ? 'flex' : 'hidden')
@@ -42,7 +43,7 @@ const MobileNavMenuAI: React.FC<MobileNavMenuAIProps> = ({ setMenuOpen }) => {
42
43
  </div>
43
44
  <iframe src="https://lux.chat/iframe" className='h-full' />
44
45
  </Card>
45
- </div>
46
+ </Box>
46
47
 
47
48
  </>
48
49
  )
@@ -1,4 +1,5 @@
1
1
  import React, { useState } from 'react'
2
+ import { Box } from '@hanzo/ui'
2
3
  import Link from 'next/link'
3
4
 
4
5
  import type { LinkDefExtended } from '../../site-def/main-nav'
@@ -16,30 +17,30 @@ const MobileNavMenuItem: React.FC<{
16
17
 
17
18
  return (
18
19
  <>
19
- <div className="w-full flex items-center px-5 py-3 gap-[27px] text-2xl cursor-pointer" onClick={() => setIsOpen(true)}>
20
+ <Box className="w-full flex items-center px-5 py-3 gap-[27px] text-2xl cursor-pointer" onClick={() => setIsOpen(true)}>
20
21
  <span className='block w-[18px] h-[22px] items-center'>{link.icon}</span>
21
22
  <span className='flex-1'>{link.title}</span>
22
23
  <RightArrow className='' />
23
- </div>
24
- <div className={`fixed left-0 top-0 w-screen h-screen ${isOpen ? 'block' : 'hidden'}`} style={{ backgroundColor: 'black' }}>
24
+ </Box>
25
+ <Box className={`fixed left-0 top-0 w-screen h-screen ${isOpen ? 'block' : 'hidden'}`} style={{ backgroundColor: 'black' }}>
25
26
  <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
+ <Box className="w-full flex items-center px-5 py-3 gap-[27px] text-2xl font-bold" onClick={() => setIsOpen(false)}>
27
28
  <LeftArrow />
28
- <span className="text-white">{link.title}</span>
29
- </div>
30
- <div className="flex flex-col">
29
+ <Box tag="span" className="text-white">{link.title}</Box>
30
+ </Box>
31
+ <Box className="flex flex-col">
31
32
  {link.childMenu?.map((menu, index) => {
32
33
  return (
33
34
  <Link href={menu.href}>
34
- <div className="w-full flex items-center px-5 py-3 gap-[27px] text-2xl" key={index}>
35
+ <Box className="w-full flex items-center px-5 py-3 gap-[27px] text-2xl" key={index}>
35
36
  <span className='w-[18px] h-[22px] self-center flex items-center justify-center'>{menu.icon}</span>
36
37
  <span className='flex-1'>{menu.title}</span>
37
- </div>
38
+ </Box>
38
39
  </Link>
39
40
  )
40
41
  })}
41
- </div>
42
- </div>
42
+ </Box>
43
+ </Box>
43
44
  </>
44
45
  )
45
46
  }
@@ -1,7 +1,7 @@
1
1
  'use client'
2
2
  import React from 'react'
3
3
  import type { LinkDef } from '@hanzo/ui/types'
4
- import { cn } from '@hanzo/ui/util'
4
+ import { Box, cn, css } from '@hanzo/ui'
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'
@@ -28,9 +28,9 @@ const MobileNav: React.FC<{
28
28
  setMenuOpen
29
29
  }) => (
30
30
  links.length > 0 ? (
31
- <div className={cn('flex flex-col h-full', className)}>
31
+ <Box className={cn('flex flex-col h-full', className)}>
32
32
  <MobileNavMenuAI setMenuOpen={setMenuOpen} />
33
- <div className="flex flex-col flex-1 overflow-auto">
33
+ <Box className="flex flex-col flex-1 overflow-auto">
34
34
  <Accordion type="single" collapsible className='w-full h-full'>
35
35
  {links.map((el, index) => {
36
36
  const itemClx = (commonItemClx) ? (typeof commonItemClx === 'string' ? commonItemClx : commonItemClx(el)) : ''
@@ -50,14 +50,14 @@ const MobileNav: React.FC<{
50
50
  return (
51
51
  <AccordionItem key={index} value={el.title ? el.title : ""} className='!no-underline !border-0 px-6'>
52
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')}>
53
+ <Box className={cn(internalClx, itemClx, 'flex items-center justify-between w-full pl-3 text-base font-normal leading-6')}>
54
54
  {el.title}
55
- </div>
56
- <ChevronDown className="w-4 h-4 mr-3" />
55
+ </Box>
56
+ <ChevronDown style={css('w-4 h-4 mr-3')} />
57
57
  </AccordionTrigger>
58
58
  <AccordionContent>
59
59
  {el.childMenu && (
60
- <div className="px-4">
60
+ <Box className="px-4">
61
61
  {Object.entries(el.childMenu.reduce((acc, child) => {
62
62
  const group = acc[child.groupName ? child.groupName : ""] || []
63
63
  group.push(child)
@@ -65,27 +65,28 @@ const MobileNav: React.FC<{
65
65
  return acc
66
66
  }, {} as { [key: string]: ChildMenu[] })).map(([groupName, children]) => (
67
67
  <div key={groupName}>
68
- <div className="mt-4 mb-4 font-light text-muted-1">{groupName}</div>
68
+ <Box className="mt-4 mb-4 font-light text-muted-1">{groupName}</Box>
69
69
  {children.map((child, childIndex) => (
70
- <div key={childIndex} className="m-2">
71
- <div className="flex items-center py-1">
70
+ <Box key={childIndex} className="m-2">
71
+ <Box className="flex items-center py-1">
72
72
  <span>
73
73
  {child.icon && child.icon}
74
74
  </span>
75
75
  <Link
76
76
  href={child.href}
77
- className="text-muted-2 hover:underline ml-5 hover:text-primary"
78
77
  target={child.newTab ? '_blank' : '_self'}
79
78
  rel="noopener noreferrer"
80
79
  >
80
+ <Box tag="span" className="text-muted-2 hover:underline ml-5 hover:text-primary">
81
81
  {child.title}
82
+ </Box>
82
83
  </Link>
83
- </div>
84
- </div>
84
+ </Box>
85
+ </Box>
85
86
  ))}
86
87
  </div>
87
88
  ))}
88
- </div>
89
+ </Box>
89
90
  )}
90
91
  </AccordionContent>
91
92
  </AccordionItem>
@@ -93,9 +94,9 @@ const MobileNav: React.FC<{
93
94
  }
94
95
  })}
95
96
  </Accordion>
96
- </div>
97
+ </Box>
97
98
  <AuthWidget className='text-2xl z-10' handleLogin={() => { setMenuState('login') }} />
98
- </div>
99
+ </Box>
99
100
  ) : null
100
101
  );
101
102