@luxfi/ui 5.5.4 → 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 (80) 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/callback.tsx +40 -0
  5. package/components/auth/login-panel.tsx +22 -50
  6. package/components/auth/login.tsx +47 -0
  7. package/components/auth/provider.tsx +34 -0
  8. package/components/auth/resume.ts +16 -0
  9. package/components/auth/widget.tsx +80 -0
  10. package/components/back-button.tsx +4 -7
  11. package/components/chat-widget.tsx +9 -11
  12. package/components/commerce/bag-button.tsx +8 -7
  13. package/components/commerce/buy-button.tsx +2 -3
  14. package/components/commerce/checkout-button.tsx +12 -10
  15. package/components/commerce/checkout-panel/cart-accordian.tsx +3 -4
  16. package/components/commerce/checkout-panel/desktop-cp.tsx +7 -8
  17. package/components/commerce/checkout-panel/index.tsx +1 -1
  18. package/components/commerce/checkout-panel/mobile-cp.tsx +5 -5
  19. package/components/commerce/checkout-panel/policy-links.tsx +7 -12
  20. package/components/commerce/checkout-panel/steps-indicator.tsx +1 -1
  21. package/components/commerce/desktop-bag-popup.tsx +1 -1
  22. package/components/commerce/drawer/micro.tsx +30 -30
  23. package/components/commerce/drawer/shell.tsx +3 -5
  24. package/components/contact-dialog/contact-form.tsx +6 -13
  25. package/components/contact-dialog/index.tsx +2 -2
  26. package/components/copyright.tsx +3 -2
  27. package/components/drawer-margin.tsx +2 -2
  28. package/components/footer.tsx +7 -8
  29. package/components/header/desktop-nav-menu.tsx +6 -6
  30. package/components/header/desktop.tsx +9 -9
  31. package/components/header/index.tsx +2 -2
  32. package/components/header/mobile-bag-drawer.tsx +1 -1
  33. package/components/header/mobile-menu-toggle-button.tsx +5 -6
  34. package/components/header/mobile-nav-menu-ai.tsx +14 -13
  35. package/components/header/mobile-nav-menu-item.tsx +12 -11
  36. package/components/header/mobile-nav-menu.tsx +19 -18
  37. package/components/header/mobile.tsx +10 -11
  38. package/components/icons/index.ts +0 -1
  39. package/components/icons/social-icon.tsx +1 -1
  40. package/components/index.ts +2 -2
  41. package/components/logo.tsx +40 -67
  42. package/components/main.tsx +3 -4
  43. package/components/mini-chart/mini-chart.tsx +2 -1
  44. package/components/security/index.tsx +55 -0
  45. package/next/font/font-desc.ts +18 -0
  46. package/next/font/fonts.ts +40 -0
  47. package/next/font/get-app-router-font-classes.ts +14 -12
  48. package/next/font/load-and-return-lux-next-fonts-on-import.ts +16 -24
  49. package/next/font/local/Zen-Variable.woff2 +0 -0
  50. package/next/font/next-font-desc.ts +18 -17
  51. package/next/head-metadata/index.tsx +7 -6
  52. package/next/head-metadata/next-metadata.ts +49 -0
  53. package/next/middleware/determine-device-mw.ts +0 -13
  54. package/package.json +15 -15
  55. package/root-layout/index.tsx +42 -29
  56. package/style/fonts/Zen-Variable.woff2 +0 -0
  57. package/style/lux-colors.css +0 -1
  58. package/style/lux-fonts.css +5 -11
  59. package/style/lux-global-non-next.css +9 -9
  60. package/style/lux-global.css +99 -15
  61. package/tsconfig.json +8 -0
  62. package/types/site-def.ts +7 -0
  63. package/components/auth/auth-listener.tsx +0 -33
  64. package/components/auth/auth-token/clear-auth-token.tsx +0 -12
  65. package/components/auth/auth-token/set-auth-token.tsx +0 -16
  66. package/components/auth/common-auth-domains.ts +0 -17
  67. package/components/auth/mobile-login-button.tsx +0 -112
  68. package/components/auth/signup-panel.tsx +0 -113
  69. package/components/icons/lux-logo.tsx +0 -10
  70. package/next/font/local/Druk-Wide-Bold.ttf +0 -0
  71. package/next/font/local/Druk-Wide-Medium.ttf +0 -0
  72. package/next/head-metadata/from-next/metadata-types.ts +0 -158
  73. package/next/head-metadata/from-next/opengraph-types.ts +0 -267
  74. package/next/head-metadata/from-next/twitter-types.ts +0 -92
  75. package/style/fonts/Druk-Wide-Bold.ttf +0 -0
  76. package/style/fonts/Druk-Wide-Medium.ttf +0 -0
  77. package/tailwind/fontFamily.tailwind.lux.ts +0 -18
  78. package/tailwind/index.ts +0 -2
  79. package/tailwind/lux-tw-fonts.ts +0 -40
  80. package/tailwind/tailwind.config.lux-preset.ts +0 -10
@@ -4,7 +4,7 @@ import { observable, type IObservableValue, reaction, runInAction } from 'mobx'
4
4
  import { observer } from 'mobx-react-lite'
5
5
 
6
6
  import { Button, type ButtonProps } from '@hanzo/ui/primitives'
7
- import { cn } from '@hanzo/ui/util'
7
+ import { Box, cn } from '@hanzo/ui'
8
8
  import { useCommerce } from '@hanzo/commerce'
9
9
 
10
10
  import { Bag } from '../icons'
@@ -49,9 +49,9 @@ const IconAndQuantity: React.FC<{
49
49
  ), [])
50
50
 
51
51
  return (
52
- <div className={cn('flex items-center justify-center', clx)}>
52
+ <Box className={cn('flex items-center justify-center', clx)}>
53
53
  {showQuantity && (
54
- <div className={cn(
54
+ <Box className={cn(
55
55
  'relative flex items-center justify-center mr-1',
56
56
  ((wiggleRef.current.get() === 'more') ?
57
57
  'item-added-to-cart-animation'
@@ -59,19 +59,19 @@ const IconAndQuantity: React.FC<{
59
59
  (wiggleRef.current.get() === 'less') ? 'item-removed-from-cart-animation' : ''),
60
60
  )} >
61
61
  {cmmc.cartQuantity > 0 && (
62
- <div className={cn(
62
+ <Box className={cn(
63
63
  'z-above-content flex flex-col justify-center items-center',
64
64
  'absolute left-0 right-0 top-0 bottom-0',
65
65
  digitClx
66
66
  )}>
67
67
  <div style={{/* color: 'white' tailwind bug? ,*/ fontSize: '11px', position: 'relative', top: '1px' }}>{cmmc.cartQuantity}</div>
68
- </div>
68
+ </Box>
69
69
  )}
70
70
  <Bag width='19' height='24' className={cn('relative -top-[3px] opacity-70' , iconClx)} aria-hidden="true" />
71
- </div>
71
+ </Box>
72
72
  )}
73
73
  {showArrow && (<span style={{fontSize: '17px',}}>&rsaquo;</span>)}
74
- </div>
74
+ </Box>
75
75
  )
76
76
  })
77
77
 
@@ -81,6 +81,8 @@ const CheckoutButton: React.FC<ButtonProps & {
81
81
  showArrow?: boolean
82
82
  animateOnQuantityChange?: boolean
83
83
  centerText?: boolean
84
+ /** A corner off the radius scale. It was a Button variant in the 5.x line. */
85
+ rounded?: 'none' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | 'full'
84
86
  }> = ({
85
87
  handleCheckout,
86
88
  variant='primary',
@@ -99,12 +101,12 @@ const CheckoutButton: React.FC<ButtonProps & {
99
101
  {...rest}
100
102
  onClick={handleCheckout}
101
103
  variant={variant}
102
- rounded={rounded}
103
- className={cn(
104
+ className={cn(`rounded-${rounded}`, cn(
104
105
  'flex justify-between items-stretch group',
105
106
  showQuantity ? (centerText ? 'px-1.5' : 'pl-2.5 pr-1.5') : '',
106
107
  className,
107
- )}
108
+ ))}
109
+
108
110
  >
109
111
  {centerText && ( // must scale this one too, as it effects layout
110
112
  <IconAndQuantity
@@ -10,8 +10,7 @@ import {
10
10
  AccordionItem,
11
11
  AccordionTrigger,
12
12
  } from '@hanzo/ui/primitives'
13
- import { cn } from '@hanzo/ui/util'
14
-
13
+ import { cn, css } from '@hanzo/ui'
15
14
  import { useCommerce, CartPanel, formatCurrencyValue } from '@hanzo/commerce'
16
15
 
17
16
  const CartAccordian: React.FC<{
@@ -33,7 +32,7 @@ const CartAccordian: React.FC<{
33
32
  return (
34
33
  <Accordion type="single" collapsible className={clx}>
35
34
  <AccordionItem value="cart" className='w-full border-b-0'>
36
- <AccordionTrigger className={'!no-underline group flex justify-between '} headerClx={ triggerClx}>
35
+ <AccordionTrigger className="!no-underline group flex justify-between ">
37
36
  <div className='flex gap-0 items-center'>
38
37
  {icon}
39
38
  <h5 className='text-sm sm:text-xl grow'>
@@ -43,7 +42,7 @@ const CartAccordian: React.FC<{
43
42
  </div>
44
43
  <div className='flex gap-1 items-center'>
45
44
  <h5 className='text-sm sm:text-xl grow truncate'>{formatCurrencyValue(cmmc.promoAppliedCartTotal)}</h5>
46
- <ChevronRight className="h-5 w-5 -mr-2 shrink-0 transition-transform duration-200 group-data-[state=open]:rotate-90" />
45
+ <ChevronRight style={css('h-5 w-5 -mr-2 shrink-0 transition-transform duration-200 group-data-[state=open]:rotate-90')} />
47
46
  </div>
48
47
  </AccordionTrigger>
49
48
  <AccordionContent className='data-[state=open]:mb-4'>
@@ -3,10 +3,9 @@ import React, { type PropsWithChildren } from 'react'
3
3
  import { observer } from 'mobx-react-lite'
4
4
 
5
5
  import { ScrollArea, StepIndicator } from '@hanzo/ui/primitives'
6
- import { AuthWidget } from '@hanzo/auth/components'
6
+ import AuthWidget from '../../auth/widget'
7
7
  import { CartPanel, useCommerce } from '@hanzo/commerce'
8
- import { cn } from '@hanzo/ui/util'
9
-
8
+ import { Box, cn } from '@hanzo/ui'
10
9
  import { BackButton, Logo, Tooltip } from '../..'
11
10
  import DesktopBagCarousel from './desktop-bag-carousel'
12
11
  import LinksRow from './policy-links'
@@ -22,11 +21,11 @@ const DesktopCheckoutPanel: React.FC<PropsWithChildren & CheckoutPanelProps> = o
22
21
 
23
22
  const cmmc = useCommerce()
24
23
  return (
25
- <div /* id='CHECKOUT_PANEL' */ className={cn('grid grid-cols-2', clx)}>
24
+ <Box /* id='CHECKOUT_PANEL' */ className={cn('grid grid-cols-2', clx)}>
26
25
  <div key={1} className='w-full h-full bg-background flex flex-row items-start justify-end'>
27
26
  <div className='w-full h-full max-w-[750px] relative flex flex-col items-stretch justify-start px-8 pb-8'>
28
27
  <div key={1} className='h-[80px] grow-0 flex flex-row items-center z-10' >
29
- <Logo size='md' href='/' onClick={onLeave} variant='text-only' outerClx='logo-outer-tooltip-class' />
28
+ <Logo size='md' href='/' onClick={onLeave} variant='wordmark' outerClx='logo-outer-tooltip-class' />
30
29
  <Tooltip select='.logo-outer-tooltip-class' text='home' position='right' offset={6}/>
31
30
  </div>
32
31
  <BackButton
@@ -39,7 +38,7 @@ const DesktopCheckoutPanel: React.FC<PropsWithChildren & CheckoutPanelProps> = o
39
38
  onBack={onLeave}
40
39
  />
41
40
  <Tooltip select='.back-button-tooltip-class' text='back' position='right' offset={5}/>
42
- <div key={2} className={cn(
41
+ <Box key={2} className={cn(
43
42
  'w-full grow min-h-0 max-w-[550px] mx-auto flex flex-col gap-3',
44
43
  (cmmc.cartItems.length > 4 ? 'justify-between' : 'justify-start gap-10 pt-10')
45
44
  )}>
@@ -55,7 +54,7 @@ const DesktopCheckoutPanel: React.FC<PropsWithChildren & CheckoutPanelProps> = o
55
54
  showShipping
56
55
  selectItems
57
56
  />
58
- </div>
57
+ </Box>
59
58
  </div>
60
59
  </div>
61
60
  <div key={2} className='w-full h-full flex flex-col bg-level-1 min-h-screen justify-between'>
@@ -76,7 +75,7 @@ const DesktopCheckoutPanel: React.FC<PropsWithChildren & CheckoutPanelProps> = o
76
75
  </div>
77
76
  </div>
78
77
  </div>
79
- </div>
78
+ </Box>
80
79
  )
81
80
  })
82
81
 
@@ -1,7 +1,7 @@
1
1
  'use client'
2
2
  import React, { useLayoutEffect, useRef, useState } from 'react'
3
3
 
4
- import { capitalize, cn } from '@hanzo/ui/util'
4
+ import { capitalize, cn } from '@hanzo/ui'
5
5
 
6
6
  import { useCommerce, ShippingStepForm, PaymentStepForm } from '@hanzo/commerce'
7
7
  import type { CheckoutStep } from '@hanzo/commerce/types'
@@ -2,8 +2,8 @@
2
2
  import React, { type PropsWithChildren } from 'react'
3
3
 
4
4
  import { StepIndicator } from '@hanzo/ui/primitives'
5
- import { cn } from '@hanzo/ui/util'
6
- import { AuthWidget } from '@hanzo/auth/components'
5
+ import { Box, cn } from '@hanzo/ui'
6
+ import AuthWidget from '../../auth/widget'
7
7
 
8
8
  import { BackButton, Logo } from '../..'
9
9
  import BagButton from '../bag-button'
@@ -20,7 +20,7 @@ const MobileCheckoutPanel: React.FC<PropsWithChildren & CheckoutPanelProps> = ({
20
20
  children
21
21
  }) => (
22
22
 
23
- <div /* id='MOBILE_GRID' */ className={cn('bg-background flex flex-col justify-start px-4 pt-[101px]', clx)}>
23
+ <Box /* id='MOBILE_GRID' */ className={cn('bg-background flex flex-col justify-start px-4 pt-[101px]', clx)}>
24
24
  <div className='fixed z-11 top-0 h-[45px] w-full flex justify-between items-stretch bg-background'>
25
25
  <div className='flex items-stretch gap-1 grow-0'>
26
26
  <BackButton
@@ -31,7 +31,7 @@ const MobileCheckoutPanel: React.FC<PropsWithChildren & CheckoutPanelProps> = ({
31
31
  }
32
32
  onBack={onLeave}
33
33
  />
34
- <Logo size='xs' variant='text-only' href='/' onClick={onLeave} outerClx='-ml-2'/>
34
+ <Logo size='sm' variant='wordmark' href='/' onClick={onLeave} outerClx='-ml-2'/>
35
35
  </div>
36
36
  <StepIndicator
37
37
  dotSizeRem={1}
@@ -61,7 +61,7 @@ const MobileCheckoutPanel: React.FC<PropsWithChildren & CheckoutPanelProps> = ({
61
61
  />
62
62
  {children}
63
63
  <PolicyLinks clx='mt-auto mb-3 pt-2' />
64
- </div>
64
+ </Box>
65
65
  )
66
66
 
67
67
  export default MobileCheckoutPanel
@@ -2,28 +2,23 @@ import React from 'react'
2
2
  import Link from 'next/link'
3
3
 
4
4
  import { Separator, buttonVariants } from '@hanzo/ui/primitives'
5
- import { cn } from '@hanzo/ui/util'
6
-
7
-
8
- const linkClx = buttonVariants({
9
- variant: 'linkMuted',
10
- size: 'link',
11
- rounded: 'none',
12
- })
5
+ import { Box, cn, css } from '@hanzo/ui'
6
+ // `link` was a SIZE in the 5.x line and is a variant here; a radius is a class.
7
+ const linkClx = cn(buttonVariants({ variant: 'linkMuted' }), 'rounded-none')
13
8
 
14
9
  const PolicyLinks: React.FC<{
15
10
  clx?: string
16
11
  }> = ({
17
12
  clx=''
18
13
  }) => (
19
- <div className={cn('flex flex-col items-center', clx)}>
14
+ <Box className={cn('flex flex-col items-center', clx)}>
20
15
  <Separator/>
21
16
  <div className='flex gap-4 py-2 text-sm'>
22
17
  {/* TODO: add Refund policy and Privacy policy links */}
23
- <Link className={linkClx} href=''>refund policy</Link>
24
- <Link className={linkClx} href=''>privacy policy</Link>
18
+ <Link style={css(linkClx)} href=''>refund policy</Link>
19
+ <Link style={css(linkClx)} href=''>privacy policy</Link>
25
20
  </div>
26
- </div>
21
+ </Box>
27
22
  )
28
23
 
29
24
  export default PolicyLinks
@@ -5,7 +5,7 @@ import {
5
5
  BreadcrumbList,
6
6
  BreadcrumbSeparator
7
7
  } from '@hanzo/ui/primitives'
8
- import { cn } from '@hanzo/ui/util'
8
+ import { cn } from '@hanzo/ui'
9
9
 
10
10
  const StepsIndicator: React.FC<{
11
11
  currentStep: number
@@ -11,7 +11,7 @@ import {
11
11
  PopoverClose,
12
12
  } from "@hanzo/ui/primitives"
13
13
 
14
- import { cn } from '@hanzo/ui/util'
14
+ import { cn } from '@hanzo/ui'
15
15
  import { CartPanel, useCommerce } from '@hanzo/commerce'
16
16
 
17
17
  import { Bag } from '../icons'
@@ -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,15 +25,15 @@ 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 ' +
34
33
  'md:flex md:flex-row md:justify-between px-[24px]'
35
34
  }>
36
35
  <div className='hidden lg:flex flex-col' key={0}>
37
- <Logo size='md' variant='text-only' />
36
+ <Logo size='md' variant='wordmark' />
38
37
  </div>
39
38
  {footer.map((defs: LinkDef[], index: number) => {
40
39
 
@@ -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
  }