@luxfi/ui 5.5.3 → 5.5.4

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/LICENSE ADDED
@@ -0,0 +1,29 @@
1
+ BSD 3-Clause License
2
+
3
+ Copyright (c) 2024, Lux Partners Limited
4
+ All rights reserved.
5
+
6
+ Redistribution and use in source and binary forms, with or without
7
+ modification, are permitted provided that the following conditions are met:
8
+
9
+ 1. Redistributions of source code must retain the above copyright notice, this
10
+ list of conditions and the following disclaimer.
11
+
12
+ 2. Redistributions in binary form must reproduce the above copyright notice,
13
+ this list of conditions and the following disclaimer in the documentation
14
+ and/or other materials provided with the distribution.
15
+
16
+ 3. Neither the name of the copyright holder nor the names of its
17
+ contributors may be used to endorse or promote products derived from
18
+ this software without specific prior written permission.
19
+
20
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
24
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
27
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
28
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -8,19 +8,23 @@ const AuthListener = () => {
8
8
  const auth = useAuth()
9
9
 
10
10
  useEffect(() => {
11
- fetch(`${process.env.NEXT_PUBLIC_LOGIN_SITE_URL}/api/auth/get-auth-token`, {
11
+ // Sites that do not share a login origin leave this unset; without it there
12
+ // is nothing to ask, so asking would only fetch the string "undefined".
13
+ const loginSite = process.env.NEXT_PUBLIC_LOGIN_SITE_URL
14
+ if (!loginSite) return
15
+
16
+ fetch(`${loginSite}/api/auth/get-auth-token`, {
12
17
  method: 'GET',
13
18
  credentials: 'include',
14
19
  })
15
20
  .then(response => response.json())
16
21
  .then((data: any) => {
17
22
  const token = data.reqToken
18
- console.log(data)
19
- console.log(token)
20
23
  if (!!token) {
21
24
  auth.loginWithCustomToken(token)
22
25
  }
23
26
  })
27
+ .catch(() => { /* no shared session available */ })
24
28
  }, [auth])
25
29
 
26
30
  return ( <></> )
@@ -54,15 +54,20 @@ const MobileAuthWidget: React.FC<{
54
54
  </Button>
55
55
  </div>
56
56
  ) : (
57
- <LinkElement
58
- def={{
59
- href: `${process.env.NEXT_PUBLIC_LOGIN_SITE_URL}?redirectUrl=${window.location.href}`,
60
- title: 'Login',
61
- variant: 'primary',
62
- newTab: false
63
- } satisfies LinkDef}
64
- className='h-8 w-fit !min-w-0'
65
- />
57
+ // Without a login origin there is nowhere to send them, and the
58
+ // link would read `undefined?redirectUrl=…` — which next/link
59
+ // prefetches, so every page fetches a 404 it can never use.
60
+ process.env.NEXT_PUBLIC_LOGIN_SITE_URL ? (
61
+ <LinkElement
62
+ def={{
63
+ href: `${process.env.NEXT_PUBLIC_LOGIN_SITE_URL}?redirectUrl=${window.location.href}`,
64
+ title: 'Login',
65
+ variant: 'primary',
66
+ newTab: false
67
+ } satisfies LinkDef}
68
+ className='h-8 w-fit !min-w-0'
69
+ />
70
+ ) : null
66
71
  )
67
72
  ))
68
73
  }
@@ -0,0 +1,31 @@
1
+ 'use client'
2
+ import React from 'react'
3
+
4
+ import type { LinkDef } from '@hanzo/ui/types'
5
+ import { NavItems } from '@hanzo/ui/primitives'
6
+
7
+ // NavItems styles each item via a callback, and a callback cannot cross the
8
+ // server/client boundary. Creating it here keeps Footer itself on the server.
9
+ const FooterNav: React.FC<{
10
+ items: LinkDef[]
11
+ currentAs?: string
12
+ className?: string
13
+ }> = ({
14
+ items,
15
+ currentAs,
16
+ className = ''
17
+ }) => (
18
+ <NavItems
19
+ items={items}
20
+ currentAs={currentAs}
21
+ as='nav'
22
+ className={className}
23
+ itemClx={(def: LinkDef) => ((def.variant === 'linkFG') ?
24
+ 'font-nav text-[15px]/[1.3] font-medium tracking-normal text-muted-1 sm:hover:text-foreground transition-color duration-500'
25
+ :
26
+ 'text-[15px]/[1.1] font-normal tracking-[0.2px] text-muted-1 sm:hover:text-foreground transition-color duration-500'
27
+ )}
28
+ />
29
+ )
30
+
31
+ export default FooterNav
@@ -7,6 +7,7 @@ import { cn } from '@hanzo/ui/util'
7
7
  import Copyright from './copyright'
8
8
  import type { SiteDef } from '../site-def'
9
9
  import { legal } from '../site-def/footer/legal'
10
+ import FooterNav from './footer-nav'
10
11
  import Logo from './logo'
11
12
 
12
13
  const Footer: React.FC<{
@@ -41,21 +42,15 @@ const Footer: React.FC<{
41
42
  'xs:col-span-2 xs:mx-auto md:col-span-1 md:mx-0 ' : ''
42
43
 
43
44
  return (
44
- <NavItems
45
- items={defs}
45
+ <FooterNav
46
+ items={defs}
46
47
  currentAs={siteDef.currentAs}
47
- as='nav'
48
- className={cn('sm:min-w-[150px] md:min-w-0 flex flex-col justify-start items-start ' +
48
+ className={cn('sm:min-w-[150px] md:min-w-0 flex flex-col justify-start items-start ' +
49
49
  'gap-[11px] sm:gap-[12px] md:gap-[15px] ',
50
50
  xsColSpanClx
51
- )}
52
- key={index + 1}
53
- itemClx={(def: LinkDef) => ((def.variant === 'linkFG') ?
54
- 'font-nav text-[15px]/[1.3] font-medium tracking-normal text-muted-1 sm:hover:text-foreground transition-color duration-500'
55
- :
56
- 'text-[15px]/[1.1] font-normal tracking-[0.2px] text-muted-1 sm:hover:text-foreground transition-color duration-500'
57
51
  )}
58
- />
52
+ key={index + 1}
53
+ />
59
54
  )
60
55
  })}
61
56
  </div>
@@ -68,10 +68,8 @@ 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} legacyBehavior passHref>
72
- <NavigationMenuLink className={cn(navigationMenuTriggerStyle(), ' text-muted-1 bg-transparent')}>
73
- {el.title}
74
- </NavigationMenuLink>
71
+ <Link href={el.href} className={cn(navigationMenuTriggerStyle(), ' text-muted-1 bg-transparent')}>
72
+ {el.title}
75
73
  </Link>
76
74
  ) : el.title === 'Cards' ? (
77
75
  <>
@@ -82,7 +80,7 @@ const DesktopNav: React.FC<{
82
80
  onMouseLeave={handleMouseLeave}
83
81
  onBlur={handleMouseLeave}
84
82
  >
85
- <Link href={el.href} legacyBehavior passHref>
83
+ <Link href={el.href}>
86
84
  {el.title}
87
85
  </Link>
88
86
  </NavigationMenuTrigger>
@@ -112,7 +110,7 @@ const DesktopNav: React.FC<{
112
110
  >
113
111
  {
114
112
  el.href && el.href !== '' ?
115
- <Link href={el.href} legacyBehavior passHref>
113
+ <Link href={el.href}>
116
114
  {el.title}
117
115
  </Link> : <>{el.title}</>
118
116
  }
@@ -68,7 +68,7 @@ const Logo: React.FC<{
68
68
  const outerClasses = 'flex flex-row items-center ' + outerClx
69
69
  const spanClasses = 'inline-block font-bold font-heading '
70
70
  + textClx
71
- + (href ? ' hover:text-accent cursor-pointer ' : ' cursor-default ')
71
+ + (href ? ' hover:opacity-80 cursor-pointer ' : ' cursor-default ')
72
72
  + classes.span
73
73
 
74
74
  return (
@@ -4,7 +4,7 @@ declare global {
4
4
  }
5
5
  }
6
6
 
7
- export const FB_PIXEL_ID = process.env.NEXT_PUBLIC_FACEBOOK_PIXEL_ID
7
+ export const FB_PIXEL_ID = process.env.NEXT_PUBLIC_FACEBOOK_PIXEL_ID || ''
8
8
 
9
9
  export const pageview = () => {
10
10
  window.fbq('track', 'PageView')
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@luxfi/ui",
3
- "version": "5.5.3",
3
+ "version": "5.5.4",
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/",
@@ -18,13 +18,6 @@
18
18
  "hanzo",
19
19
  "luxdefi"
20
20
  ],
21
- "scripts": {
22
- "lat": "npm show @luxfi/ui version",
23
- "pub": "npm publish",
24
- "build": "tsc",
25
- "tc": "tsc",
26
- "clean": "rm -rf node_modules"
27
- },
28
21
  "exports": {
29
22
  ".": "./components/index.ts",
30
23
  "./commerce": "./commerce/ui/context.tsx",
@@ -32,15 +25,17 @@
32
25
  "./next": "./next/index.ts",
33
26
  "./style/": "./style/",
34
27
  "./site-def": "./site-def/index.ts",
35
- "./tailwind": "./tailwind/index.ts"
28
+ "./tailwind": "./tailwind/index.ts",
29
+ "./util": "./util/index.ts"
36
30
  },
37
31
  "dependencies": {
38
- "@next/third-parties": "^14.1.0",
32
+ "@next/third-parties": "^16.1.0",
39
33
  "cookies-next": "^4.1.1",
40
34
  "date-fns": "^3.6.0",
41
35
  "embla-carousel-autoplay": "^8.1.6",
42
36
  "firebase": "10.12.0",
43
37
  "framer-motion": "^11.2.12",
38
+ "markdown-to-jsx": "^7.4.7",
44
39
  "react-device-detect": "^2.2.3",
45
40
  "react-social-icons": "^6.4.0",
46
41
  "react-tooltip": "^5.26.4",
@@ -48,21 +43,21 @@
48
43
  "usehooks-ts": "^3.1.0"
49
44
  },
50
45
  "peerDependencies": {
51
- "@hanzo/auth": "catalog:",
52
- "@hanzo/commerce": "catalog:",
53
- "@hanzo/ui": "catalog:",
54
- "@luxfi/menu-icons": "1.0.2",
46
+ "@hanzo/auth": "2.5.8",
47
+ "@hanzo/commerce": "7.3.10",
48
+ "@hanzo/ui": "5.3.34",
55
49
  "@hookform/resolvers": "^3.3.2",
56
- "lucide-react": "catalog:",
50
+ "lucide-react": "0.470.0",
57
51
  "mobx": "^6.12.3",
58
52
  "mobx-react-lite": "^4.0.7",
59
- "next": "catalog:",
60
- "next-themes": "^0.2.1",
61
- "react": "catalog:",
62
- "react-dom": "catalog:",
63
- "react-hook-form": "catalog:",
53
+ "next": "16.1.0",
54
+ "next-themes": "^0.4.0",
55
+ "react": "19.2.0",
56
+ "react-dom": "19.2.0",
57
+ "react-hook-form": "7.54.2",
64
58
  "validator": "^13.11.0",
65
- "zod": "3.23.8"
59
+ "zod": "3.23.8",
60
+ "@luxfi/menu-icons": "1.0.2"
66
61
  },
67
62
  "devDependencies": {
68
63
  "@hookform/resolvers": "^3.3.2",
@@ -71,11 +66,18 @@
71
66
  "@types/facebook-pixel": "^0.0.30",
72
67
  "@types/gtag.js": "^0.0.19",
73
68
  "@types/mdx": "^2.0.9",
74
- "@types/node": "catalog:",
75
- "@types/react": "catalog:",
76
- "@types/react-dom": "catalog:",
69
+ "@types/node": "22.10.6",
70
+ "@types/react": "19.0.2",
71
+ "@types/react-dom": "19.0.2",
77
72
  "@types/validator": "^13.12.1",
78
- "tailwindcss": "catalog:",
79
- "typescript": "catalog:"
73
+ "tailwindcss": "3.4.17",
74
+ "typescript": "5.7.3"
75
+ },
76
+ "scripts": {
77
+ "lat": "npm show @luxfi/ui version",
78
+ "pub": "npm publish",
79
+ "build": "tsc",
80
+ "tc": "tsc",
81
+ "clean": "rm -rf node_modules"
80
82
  }
81
- }
83
+ }
@@ -2,9 +2,6 @@ import type { LinkDef } from '@hanzo/ui/types'
2
2
 
3
3
  import { SocialIcon } from '../../components/icons'
4
4
 
5
- // @ts-ignore (will build in project that has @svgr support)
6
- import SVG_warp_logo from './svg/warpcast-logo.svg'
7
-
8
5
  const SOC_ICON_SIZE = 18
9
6
 
10
7
  export default [
@@ -16,7 +13,7 @@ export default [
16
13
  {
17
14
  title: 'Lux Channel',
18
15
  href: 'https://warpcast.com/~/channel/lux',
19
- icon: <SVG_warp_logo width={SOC_ICON_SIZE} height={SOC_ICON_SIZE} /> //<SocialIcon network='warpcast' size={SOC_ICON_SIZE} />
16
+ icon: <SocialIcon network='x' size={SOC_ICON_SIZE} />
20
17
  },
21
18
  {
22
19
  title: 'Lux Discussions',
@@ -23,8 +23,8 @@ export default [
23
23
  href: "https://safe.lux.network/",
24
24
  },
25
25
  {
26
- title: 'Lux Validator',
27
- href: "https://lux.network/validator",
26
+ title: 'Lux Build',
27
+ href: "https://lux.build",
28
28
  },
29
29
  {
30
30
  title: 'Lux Coin',
@@ -153,7 +153,7 @@ export default [
153
153
  title: "More benefits",
154
154
  icon: <MoreBenefits width={25} height={25} />,
155
155
  icon_act: <MoreBenefitsAct width={27} height={27} />,
156
- href: "#",
156
+ href: "https://lux.credit/compare",
157
157
  newTab: false,
158
158
  contents:"See what's truly unique"
159
159
  },
@@ -225,7 +225,7 @@ export default [
225
225
  title: "Shop",
226
226
  icon: <Shop width={25} height={25} />,
227
227
  icon_act: <ShopAct width={27} height={27}/>,
228
- href: "https://lux.market",
228
+ href: "https://lux.shop",
229
229
  newTab: false,
230
230
  contents:"Find any Lux product for sale"
231
231
  },
@@ -279,7 +279,7 @@ export default [
279
279
  title: "Explorer",
280
280
  icon: <Explorer width={25} height={25} />,
281
281
  icon_act: <ExplorerAct width={27} height={27}/>,
282
- href: "https://explorer.lux.network/",
282
+ href: "https://explore.lux.network/",
283
283
  newTab: false,
284
284
  contents:"All transactions"
285
285
  },
@@ -324,16 +324,16 @@ export default [
324
324
  title: "Validators",
325
325
  icon: <Validators width={25} height={25} />,
326
326
  icon_act: <ValidatorsAct width={27} height={27}/>,
327
- href: "https://lux.market/validator",
327
+ href: "https://lux.build",
328
328
  newTab: false,
329
- contents:"Own a part of the network"
329
+ contents:"Stake, delegate, and manage"
330
330
  },
331
331
  {
332
332
  groupName:'Get Access',
333
333
  title: "Developer docs",
334
334
  icon: <DeveloperDocs width={25} height={25} />,
335
335
  icon_act: <DeveloperDocsAct width={27} height={27}/>,
336
- href: "#",
336
+ href: "https://docs.lux.network",
337
337
  newTab: false,
338
338
  contents:"Software explained"
339
339
  },
@@ -342,7 +342,7 @@ export default [
342
342
  title: "Open Source",
343
343
  icon: <OpenSource width={25} height={25} />,
344
344
  icon_act: <OpenSourceAct width={27} height={27}/>,
345
- href: "#",
345
+ href: "https://github.com/luxfi",
346
346
  newTab: false,
347
347
  contents:"Accessible for everyone"
348
348
  },
@@ -351,7 +351,7 @@ export default [
351
351
  title: "Lux Pass",
352
352
  icon: <LuxPass width={25} height={25} />,
353
353
  icon_act: <LuxPassAct width={27} height={27}/>,
354
- href: "#",
354
+ href: "https://lux.market/pass",
355
355
  newTab: false,
356
356
  contents:"All access pass to network"
357
357
  },
@@ -360,7 +360,7 @@ export default [
360
360
  {
361
361
  title: "Resources",
362
362
  icon: '',
363
- href: "",
363
+ href: "https://docs.lux.network",
364
364
  newTab: false,
365
365
  details: "",
366
366
  childMenu: [
@@ -369,7 +369,7 @@ export default [
369
369
  title: "Resource Center",
370
370
  icon: <AIChat width={25} height={25} />,
371
371
  icon_act: <AIChatAct width={27} height={27}/>,
372
- href: "#",
372
+ href: "https://docs.lux.network",
373
373
  newTab: false,
374
374
  contents:"Dynamic solutions"
375
375
  },
@@ -378,7 +378,7 @@ export default [
378
378
  title: "Integrations",
379
379
  icon: <Integration width={25} height={25} />,
380
380
  icon_act: <IntegrationAct width={27} height={27}/>,
381
- href: "#",
381
+ href: "https://docs.lux.network/integrations",
382
382
  newTab: false,
383
383
  contents:"Simplified onboarding"
384
384
  },
@@ -387,7 +387,7 @@ export default [
387
387
  title: "Templates",
388
388
  icon: <Templates width={25} height={25} />,
389
389
  icon_act: <TemplatesAct width={27} height={27}/>,
390
- href: "#",
390
+ href: "https://docs.lux.network/templates",
391
391
  newTab: false,
392
392
  contents:"Speedy app development"
393
393
  },
@@ -396,7 +396,7 @@ export default [
396
396
  title: "Guides",
397
397
  icon: <Guides width={25} height={25} />,
398
398
  icon_act: <GuidesAct width={27} height={27}/>,
399
- href: "#",
399
+ href: "https://docs.lux.network/guides",
400
400
  newTab: false,
401
401
  contents:"Find help quickly"
402
402
  },
@@ -405,7 +405,7 @@ export default [
405
405
  title: "Customers",
406
406
  icon: <Customers width={25} height={25} />,
407
407
  icon_act: <CustomersAct width={27} height={27}/>,
408
- href: "#",
408
+ href: "https://lux.partners",
409
409
  newTab: false,
410
410
  contents:"Trusted by the best teams"
411
411
  },
@@ -414,7 +414,7 @@ export default [
414
414
  title: "Blog",
415
415
  icon: <Blog width={25} height={25} />,
416
416
  icon_act: <BlogAct width={27} height={27}/>,
417
- href: "#",
417
+ href: "https://blog.lux.network",
418
418
  newTab: false,
419
419
  contents:"Latest posts and changes"
420
420
  },
@@ -423,7 +423,7 @@ export default [
423
423
  title: "Changelog",
424
424
  icon: <ChangeLog width={25} height={25} />,
425
425
  icon_act: <ChangeLogAct width={27} height={27} />,
426
- href: "#",
426
+ href: "https://docs.lux.network/changelog",
427
427
  newTab: false,
428
428
  contents:"Manage deployments"
429
429
  },
@@ -432,7 +432,7 @@ export default [
432
432
  title: "Developer docs",
433
433
  icon: <DeveloperDocs width={25} height={25} />,
434
434
  icon_act: <DeveloperDocsAct width={25} height={25}/>,
435
- href: "#",
435
+ href: "https://docs.lux.network",
436
436
  newTab: false,
437
437
  contents:"Software explained"
438
438
  },
@@ -441,7 +441,7 @@ export default [
441
441
  title: "Customer Support",
442
442
  icon: <CustomerSupport width={25} height={25} />,
443
443
  icon_act: <CustomerSupportAct width={27} height={27}/>,
444
- href: "#",
444
+ href: "mailto:support@lux.network",
445
445
  newTab: false,
446
446
  contents:"Dedicated help, 24/7"
447
447
  },
@@ -450,7 +450,7 @@ export default [
450
450
  title: "FAQs",
451
451
  icon: <FAQs width={25} height={25} />,
452
452
  icon_act: <FAQsAct width={27} height={27}/>,
453
- href: "#",
453
+ href: "https://docs.lux.network/faq",
454
454
  newTab: false,
455
455
  contents:"Common queries"
456
456
  }
package/util/index.ts ADDED
@@ -0,0 +1,11 @@
1
+ import { compiler } from 'markdown-to-jsx'
2
+
3
+ // Compiles markdown to JSX. `wrapper: null` yields the bare nodes rather than
4
+ // a wrapping element, so callers can drop the result straight into a
5
+ // ReactNode-typed field. Inline HTML (<br/>, <cite>) is parsed natively.
6
+ export const markdown = (s: string, options?: any) => (
7
+ compiler(s, {
8
+ wrapper: null,
9
+ ...options
10
+ })
11
+ )