@luxfi/ui 5.4.0 → 5.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/header/desktop.tsx +10 -6
- package/components/header/index.tsx +12 -5
- package/components/index.ts +1 -1
- package/components/logo.tsx +7 -4
- package/package.json +14 -20
|
@@ -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 {
|
|
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=
|
|
41
|
-
<Logo size='sm' href='/' outerClx='hidden md:flex lg:hidden' key='one' variant=
|
|
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 {
|
|
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
|
}
|
package/components/index.ts
CHANGED
|
@@ -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'
|
package/components/logo.tsx
CHANGED
|
@@ -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?:
|
|
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
|
|
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.
|
|
3
|
+
"version": "5.4.2",
|
|
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/",
|
|
@@ -37,7 +37,6 @@
|
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@next/third-parties": "^14.1.0",
|
|
40
|
-
"@types/node": "^20.12.12",
|
|
41
40
|
"@types/validator": "^13.12.1",
|
|
42
41
|
"cookies-next": "^4.1.1",
|
|
43
42
|
"date-fns": "^3.6.0",
|
|
@@ -51,18 +50,18 @@
|
|
|
51
50
|
"usehooks-ts": "^3.1.0"
|
|
52
51
|
},
|
|
53
52
|
"peerDependencies": {
|
|
54
|
-
"@hanzo/auth": "
|
|
55
|
-
"@hanzo/commerce": "
|
|
56
|
-
"@hanzo/ui": "
|
|
53
|
+
"@hanzo/auth": "catalog:",
|
|
54
|
+
"@hanzo/commerce": "catalog:",
|
|
55
|
+
"@hanzo/ui": "catalog:",
|
|
57
56
|
"@hookform/resolvers": "^3.3.2",
|
|
58
|
-
"lucide-react": "
|
|
57
|
+
"lucide-react": "catalog:",
|
|
59
58
|
"mobx": "^6.12.3",
|
|
60
59
|
"mobx-react-lite": "^4.0.7",
|
|
61
|
-
"next": "
|
|
60
|
+
"next": "catalog:",
|
|
62
61
|
"next-themes": "^0.2.1",
|
|
63
|
-
"react": "
|
|
64
|
-
"react-dom": "
|
|
65
|
-
"react-hook-form": "
|
|
62
|
+
"react": "catalog:",
|
|
63
|
+
"react-dom": "catalog:",
|
|
64
|
+
"react-hook-form": "catalog:",
|
|
66
65
|
"validator": "^13.11.0",
|
|
67
66
|
"zod": "3.23.8"
|
|
68
67
|
},
|
|
@@ -73,15 +72,10 @@
|
|
|
73
72
|
"@types/facebook-pixel": "^0.0.30",
|
|
74
73
|
"@types/gtag.js": "^0.0.19",
|
|
75
74
|
"@types/mdx": "^2.0.9",
|
|
76
|
-
"@types/node": "
|
|
77
|
-
"@types/react": "
|
|
78
|
-
"@types/react-dom": "
|
|
79
|
-
"
|
|
80
|
-
"
|
|
81
|
-
"react-hook-form": "^7.51.4",
|
|
82
|
-
"tailwindcss": "^3.4.3",
|
|
83
|
-
"typescript": "5.6.3",
|
|
84
|
-
"validator": "^13.11.0",
|
|
85
|
-
"zod": "3.23.8"
|
|
75
|
+
"@types/node": "catalog:",
|
|
76
|
+
"@types/react": "catalog:",
|
|
77
|
+
"@types/react-dom": "catalog:",
|
|
78
|
+
"tailwindcss": "catalog:",
|
|
79
|
+
"typescript": "catalog:"
|
|
86
80
|
}
|
|
87
81
|
}
|