@luxfi/ui 5.4.0 → 5.4.1

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.
@@ -1,9 +1,9 @@
1
- import React from 'react'
1
+ import React, { type PropsWithChildren } from 'react'
2
2
 
3
3
  import { cn } from '@hanzo/ui/util'
4
4
  import { AuthWidget } from '@hanzo/auth/components'
5
5
 
6
- import { Logo } from '..'
6
+ 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'
@@ -17,10 +17,13 @@ const DesktopHeader: React.FC<{
17
17
  links: LinkDef[]
18
18
  className?: string
19
19
  noAuth?: boolean
20
- }> = ({
20
+ logoVariant?: LogoVariant
21
+ } & PropsWithChildren> = ({
21
22
  links,
22
23
  className = '',
23
- noAuth=false
24
+ noAuth=false,
25
+ children,
26
+ logoVariant='text-only'
24
27
  }) => {
25
28
  const [isMenuOpened, setIsMenuOpen] = React.useState(false);
26
29
 
@@ -37,8 +40,8 @@ const DesktopHeader: React.FC<{
37
40
  'flex flex-row h-[80px] items-center justify-between ' +
38
41
  'mx-[24px] w-full max-w-screen'
39
42
  }>
40
- <Logo size='md' href='/' outerClx='hidden lg:flex' key='two' variant='text-only' />
41
- <Logo size='sm' href='/' outerClx='hidden md:flex lg:hidden' key='one' variant='text-only' />
43
+ <Logo size={logoVariant === 'logo-only' ? 'lg' : 'md'} href='/' outerClx='hidden lg:flex' key='two' variant={logoVariant} />
44
+ <Logo size='sm' href='/' outerClx='hidden md:flex lg:hidden' key='one' variant={logoVariant} />
42
45
  {/* md or larger */}
43
46
  <div className='flex w-full gap-4 items-center justify-center'>
44
47
  <DesktopNav links={links} isMenuOpened={isMenuOpened} setIsMenuOpen={setIsMenuOpen} />
@@ -46,6 +49,7 @@ const DesktopHeader: React.FC<{
46
49
  <div className='flex items-center'>
47
50
  <DesktopBagPopup popupClx='w-[340px]' trigger={<BagButton className='text-primary -mr-[3px] lg:min-w-0' />} />
48
51
  <AuthWidget noLogin={noAuth}/>
52
+ {children}
49
53
  </div>
50
54
  </div>
51
55
  </header>
@@ -1,19 +1,24 @@
1
1
  'use client'
2
- import React from 'react'
2
+ import React, { type PropsWithChildren } from 'react'
3
3
 
4
4
  import type { SiteDef } from '../../site-def'
5
5
 
6
6
  import DesktopHeader from './desktop'
7
7
  import MobileHeader from './mobile'
8
8
  import { cn } from '@hanzo/ui/util'
9
- import { ChatWidget } from '../../components'
9
+ import { type LogoVariant } from '../logo'
10
10
 
11
+
12
+ /** children will render furthest right */
11
13
  const Header: React.FC<{
12
14
  siteDef: SiteDef
13
15
  className?: string
14
- }> = ({
16
+ logoVariant?: LogoVariant
17
+ } & PropsWithChildren> = ({
15
18
  siteDef,
16
- className = ''
19
+ className = '',
20
+ children,
21
+ logoVariant='text-only'
17
22
  }) => {
18
23
 
19
24
  // TODO
@@ -28,13 +33,15 @@ const Header: React.FC<{
28
33
  links={links}
29
34
  currentAs={currentAs}
30
35
  noAuth={noAuth}
31
- />
36
+ logoVariant={logoVariant}
37
+ >{children}</DesktopHeader>
32
38
  <MobileHeader
33
39
  className={cn(className, 'md:hidden')}
34
40
  links={links}
35
41
  currentAs={currentAs}
36
42
  setChatbotOpen={setOpen}
37
43
  noAuth={noAuth}
44
+
38
45
  />
39
46
  </>)
40
47
  }
@@ -5,7 +5,7 @@ export { default as Copyright} from './copyright'
5
5
  export { default as Footer } from './footer'
6
6
  export { default as Header } from './header'
7
7
  export * as Icons from './icons'
8
- export { default as Logo } from './logo'
8
+ export { default as Logo, type LogoVariant } from './logo'
9
9
  export { default as Main } from './main'
10
10
  export { default as MiniChart } from './mini-chart'
11
11
  export { default as NotFound } from './not-found'
@@ -3,15 +3,15 @@ import Link from 'next/link'
3
3
 
4
4
  import { type TShirtSize } from '@hanzo/ui/types'
5
5
 
6
- import { cn } from '@hanzo/ui/util'
7
-
8
6
  import * as Icons from './icons'
9
7
 
10
8
  const TEXT = 'LUX'
9
+ type LogoVariant = 'text-only' | 'logo-only' | 'full'
10
+
11
11
 
12
12
  const Logo: React.FC<{
13
13
  size?: TShirtSize
14
- variant?: 'text-only' | 'logo-only' | 'full'
14
+ variant?: LogoVariant
15
15
  onClick?: () => void
16
16
  href?: string
17
17
  outerClx?: string
@@ -86,4 +86,7 @@ const Logo: React.FC<{
86
86
  )
87
87
  }
88
88
 
89
- export default Logo
89
+ export {
90
+ Logo as default,
91
+ type LogoVariant
92
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@luxfi/ui",
3
- "version": "5.4.0",
3
+ "version": "5.4.1",
4
4
  "description": "Library that contains shared UI primitives, support for a common design system, and other boilerplate support.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/",