@luxfi/ui 5.5.2 → 5.6.0
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/dist/accordion.cjs +213 -0
- package/dist/accordion.js +186 -0
- package/dist/alert.cjs +553 -0
- package/dist/alert.js +531 -0
- package/dist/avatar.cjs +149 -0
- package/dist/avatar.js +125 -0
- package/dist/badge.cjs +611 -0
- package/dist/badge.js +589 -0
- package/dist/button.cjs +689 -0
- package/dist/button.js +664 -0
- package/dist/checkbox.cjs +265 -0
- package/dist/checkbox.js +241 -0
- package/dist/close-button.cjs +73 -0
- package/dist/close-button.js +51 -0
- package/dist/collapsible.cjs +702 -0
- package/dist/collapsible.js +679 -0
- package/dist/color-mode.cjs +96 -0
- package/dist/color-mode.js +72 -0
- package/dist/dialog.cjs +279 -0
- package/dist/dialog.js +246 -0
- package/dist/drawer.cjs +207 -0
- package/dist/drawer.js +175 -0
- package/dist/empty-state.cjs +93 -0
- package/dist/empty-state.js +71 -0
- package/dist/field.cjs +183 -0
- package/dist/field.js +160 -0
- package/dist/heading.cjs +46 -0
- package/dist/heading.js +40 -0
- package/dist/icon-button.cjs +491 -0
- package/dist/icon-button.js +470 -0
- package/dist/image.cjs +572 -0
- package/dist/image.js +551 -0
- package/dist/index.cjs +5779 -0
- package/dist/index.js +5619 -0
- package/dist/input-group.cjs +155 -0
- package/dist/input-group.js +133 -0
- package/dist/input.cjs +65 -0
- package/dist/input.js +59 -0
- package/dist/link.cjs +630 -0
- package/dist/link.js +606 -0
- package/dist/menu.cjs +305 -0
- package/dist/menu.js +269 -0
- package/dist/pin-input.cjs +182 -0
- package/dist/pin-input.js +160 -0
- package/dist/popover.cjs +327 -0
- package/dist/popover.js +294 -0
- package/dist/progress-circle.cjs +152 -0
- package/dist/progress-circle.js +128 -0
- package/dist/progress.cjs +117 -0
- package/dist/progress.js +94 -0
- package/dist/provider.cjs +62 -0
- package/dist/provider.js +40 -0
- package/dist/radio.cjs +177 -0
- package/dist/radio.js +153 -0
- package/dist/rating.cjs +80 -0
- package/dist/rating.js +58 -0
- package/dist/select.cjs +791 -0
- package/dist/select.js +757 -0
- package/dist/separator.cjs +57 -0
- package/dist/separator.js +51 -0
- package/dist/skeleton.cjs +370 -0
- package/dist/skeleton.js +346 -0
- package/dist/slider.cjs +138 -0
- package/dist/slider.js +115 -0
- package/dist/switch.cjs +163 -0
- package/dist/switch.js +140 -0
- package/dist/table.cjs +1044 -0
- package/dist/table.js +1013 -0
- package/dist/tabs.cjs +240 -0
- package/dist/tabs.js +213 -0
- package/dist/tag.cjs +651 -0
- package/dist/tag.js +628 -0
- package/dist/textarea.cjs +65 -0
- package/dist/textarea.js +59 -0
- package/dist/toaster.cjs +99 -0
- package/dist/toaster.js +96 -0
- package/dist/tooltip.cjs +171 -0
- package/dist/tooltip.js +148 -0
- package/dist/utils.cjs +11 -0
- package/dist/utils.js +9 -0
- package/package.json +270 -66
- package/src/accordion.tsx +285 -0
- package/src/alert.tsx +221 -0
- package/src/avatar.tsx +174 -0
- package/src/badge.tsx +158 -0
- package/src/button.tsx +411 -0
- package/src/checkbox.tsx +307 -0
- package/src/close-button.tsx +51 -0
- package/src/collapsible.tsx +126 -0
- package/src/color-mode.tsx +125 -0
- package/src/dialog.tsx +356 -0
- package/src/drawer.tsx +186 -0
- package/src/empty-state.tsx +97 -0
- package/src/field.tsx +202 -0
- package/src/heading.tsx +55 -0
- package/src/icon-button.tsx +192 -0
- package/src/image.tsx +280 -0
- package/src/index.ts +192 -0
- package/src/input-group.tsx +159 -0
- package/src/input.tsx +60 -0
- package/src/link.tsx +326 -0
- package/src/menu.tsx +471 -0
- package/src/pin-input.tsx +187 -0
- package/src/popover.tsx +400 -0
- package/src/progress-circle.tsx +180 -0
- package/src/progress.tsx +109 -0
- package/src/provider.tsx +12 -0
- package/src/radio.tsx +175 -0
- package/src/rating.tsx +79 -0
- package/src/select.tsx +696 -0
- package/src/separator.tsx +59 -0
- package/src/skeleton.tsx +302 -0
- package/src/slider.tsx +152 -0
- package/src/switch.tsx +158 -0
- package/src/table.tsx +621 -0
- package/src/tabs.tsx +354 -0
- package/src/tag.tsx +159 -0
- package/src/textarea.tsx +60 -0
- package/src/toaster.tsx +117 -0
- package/src/tokens.css +438 -0
- package/src/tooltip.tsx +184 -0
- package/src/utils/cn.ts +7 -0
- package/src/utils.ts +6 -0
- package/tokens.css +438 -0
- package/commerce/ui/conf.ts +0 -13
- package/commerce/ui/context.tsx +0 -123
- package/commerce/ui/store.ts +0 -295
- package/components/access-code-input.tsx +0 -71
- package/components/analytics.tsx +0 -23
- package/components/auth/auth-listener.tsx +0 -29
- package/components/auth/auth-token/clear-auth-token.tsx +0 -12
- package/components/auth/auth-token/set-auth-token.tsx +0 -16
- package/components/auth/common-auth-domains.ts +0 -17
- package/components/auth/login-panel.tsx +0 -111
- package/components/auth/mobile-login-button.tsx +0 -107
- package/components/auth/signup-panel.tsx +0 -113
- package/components/back-button.tsx +0 -49
- package/components/chat-widget.tsx +0 -85
- package/components/commerce/bag-button.tsx +0 -98
- package/components/commerce/buy-button.tsx +0 -34
- package/components/commerce/checkout-button.tsx +0 -129
- package/components/commerce/checkout-panel/cart-accordian.tsx +0 -66
- package/components/commerce/checkout-panel/checkout-panel-props.ts +0 -10
- package/components/commerce/checkout-panel/desktop-bag-carousel.tsx +0 -36
- package/components/commerce/checkout-panel/desktop-cp.tsx +0 -83
- package/components/commerce/checkout-panel/index.tsx +0 -126
- package/components/commerce/checkout-panel/mobile-cp.tsx +0 -67
- package/components/commerce/checkout-panel/policy-links.tsx +0 -29
- package/components/commerce/checkout-panel/steps-indicator.tsx +0 -39
- package/components/commerce/checkout-panel/thank-you.tsx +0 -18
- package/components/commerce/desktop-bag-popup.tsx +0 -78
- package/components/commerce/drawer/index.tsx +0 -88
- package/components/commerce/drawer/micro.tsx +0 -145
- package/components/commerce/drawer/shell.tsx +0 -85
- package/components/contact-dialog/contact-form.tsx +0 -116
- package/components/contact-dialog/disclaimer.tsx +0 -13
- package/components/contact-dialog/index.tsx +0 -64
- package/components/copyright.tsx +0 -21
- package/components/drawer-margin.tsx +0 -28
- package/components/footer.tsx +0 -78
- package/components/header/desktop-nav-menu.tsx +0 -204
- package/components/header/desktop.tsx +0 -65
- package/components/header/index.tsx +0 -50
- package/components/header/mobile-bag-drawer.tsx +0 -51
- package/components/header/mobile-menu-toggle-button.tsx +0 -35
- package/components/header/mobile-nav-menu-ai.tsx +0 -51
- package/components/header/mobile-nav-menu-item.tsx +0 -47
- package/components/header/mobile-nav-menu.tsx +0 -102
- package/components/header/mobile.tsx +0 -170
- package/components/header/theme-toggle.tsx +0 -26
- package/components/icons/avatar.tsx +0 -11
- package/components/icons/bag-icon.tsx +0 -10
- package/components/icons/index.ts +0 -6
- package/components/icons/left-arrow.tsx +0 -11
- package/components/icons/lux-logo.tsx +0 -10
- package/components/icons/right-arrow.tsx +0 -10
- package/components/icons/social-icon.tsx +0 -35
- package/components/icons/social-svg.css +0 -3
- package/components/index.ts +0 -26
- package/components/logo.tsx +0 -92
- package/components/main.tsx +0 -27
- package/components/mini-chart/index.tsx +0 -8
- package/components/mini-chart/mini-chart-props.ts +0 -44
- package/components/mini-chart/mini-chart.tsx +0 -85
- package/components/mini-chart/wrapper.tsx +0 -23
- package/components/not-found/index.tsx +0 -28
- package/components/not-found/not-found-content.mdx +0 -5
- package/components/tooltip.tsx +0 -31
- package/environment.d.ts +0 -6
- package/next/analytics/fpixel.ts +0 -16
- package/next/analytics/google-analytics.ts +0 -14
- package/next/analytics/index.ts +0 -3
- package/next/analytics/pixel-analytics.tsx +0 -55
- package/next/font/get-app-router-font-classes.ts +0 -17
- package/next/font/load-and-return-lux-next-fonts-on-import.ts +0 -68
- package/next/font/local/Druk-Wide-Bold.ttf +0 -0
- package/next/font/local/Druk-Wide-Medium.ttf +0 -0
- package/next/font/local/InterVariable-Italic.ttf +0 -0
- package/next/font/local/InterVariable-Italic.woff2 +0 -0
- package/next/font/local/InterVariable.ttf +0 -0
- package/next/font/local/InterVariable.woff2 +0 -0
- package/next/font/next-font-desc.ts +0 -28
- package/next/font/pages-router-font-vars.tsx +0 -18
- package/next/head-metadata/from-next/metadata-types.ts +0 -158
- package/next/head-metadata/from-next/opengraph-types.ts +0 -267
- package/next/head-metadata/from-next/twitter-types.ts +0 -92
- package/next/head-metadata/index.tsx +0 -208
- package/next/index.ts +0 -2
- package/next/middleware/determine-device-mw.ts +0 -29
- package/root-layout/WHY_THIS_IS_SEPARATE.txt +0 -2
- package/root-layout/index.tsx +0 -111
- package/server/auth-wrapper.ts +0 -24
- package/server-actions/TO-DO.txt +0 -1
- package/server-actions/firebase-app.ts +0 -29
- package/server-actions/index.ts +0 -5
- package/server-actions/store-contact.ts +0 -66
- package/site-def/footer/community.tsx +0 -61
- package/site-def/footer/company.ts +0 -37
- package/site-def/footer/ecosystem.ts +0 -37
- package/site-def/footer/index.tsx +0 -26
- package/site-def/footer/legal.ts +0 -28
- package/site-def/footer/network.ts +0 -45
- package/site-def/footer/svg/warpcast-logo.svg +0 -12
- package/site-def/index.ts +0 -4
- package/site-def/main-nav.tsx +0 -460
- package/style/cart-animation.css +0 -29
- package/style/checkout-animation.css +0 -23
- package/style/drawer-handle-overrides.css +0 -160
- package/style/fonts/COPY_TO_PUBLIC_FOR_NON_NEXT.txt +0 -0
- package/style/fonts/Druk-Wide-Bold.ttf +0 -0
- package/style/fonts/Druk-Wide-Medium.ttf +0 -0
- package/style/fonts/InterVariable-Italic.ttf +0 -0
- package/style/fonts/InterVariable-Italic.woff2 +0 -0
- package/style/fonts/InterVariable.ttf +0 -0
- package/style/fonts/InterVariable.woff2 +0 -0
- package/style/lux-colors.css +0 -85
- package/style/lux-fonts.css +0 -30
- package/style/lux-global-non-next.css +0 -52
- package/style/lux-global.css +0 -51
- package/tailwind/fontFamily.tailwind.lux.ts +0 -18
- package/tailwind/index.ts +0 -2
- package/tailwind/lux-tw-fonts.ts +0 -40
- package/tailwind/tailwind.config.lux-preset.ts +0 -10
- package/tsconfig.json +0 -15
- package/types/chatbot-config.ts +0 -7
- package/types/chatbot-suggested-question.ts +0 -7
- package/types/contact-info.ts +0 -11
- package/types/index.ts +0 -4
- package/types/site-def.ts +0 -46
|
@@ -1,208 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
|
|
3
|
-
import type { Metadata } from 'next'
|
|
4
|
-
import Head from "next/head"
|
|
5
|
-
|
|
6
|
-
import type {
|
|
7
|
-
IconDescriptor,
|
|
8
|
-
TemplateString,
|
|
9
|
-
Author,
|
|
10
|
-
ThemeColorDescriptor
|
|
11
|
-
} from './from-next/metadata-types'
|
|
12
|
-
|
|
13
|
-
import type { OpenGraph, OGImage } from './from-next/opengraph-types'
|
|
14
|
-
import type { Twitter, TwitterImage } from './from-next/twitter-types'
|
|
15
|
-
|
|
16
|
-
/*
|
|
17
|
-
NOTE: This is ONLY for sites that use the pages router in next.
|
|
18
|
-
The app router does this automatically
|
|
19
|
-
*/
|
|
20
|
-
|
|
21
|
-
const getURLasString = (url: string | URL) => {
|
|
22
|
-
return (
|
|
23
|
-
(typeof url === 'string') ? (url as string) : (url.href)
|
|
24
|
-
)
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
// https://stackoverflow.com/questions/68746228/next-head-wont-render-meta-tags-inside-of-fragment
|
|
28
|
-
const Icons: React.FC<{icons: IconDescriptor[]}> = ({
|
|
29
|
-
icons
|
|
30
|
-
}) => {
|
|
31
|
-
return <Head>
|
|
32
|
-
{icons.map(({url, ...rest}: IconDescriptor, index) => (
|
|
33
|
-
<link {...rest} href={getURLasString(url)} key={`icons-${index}`}/>
|
|
34
|
-
))}
|
|
35
|
-
</Head>
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
export const getTitleFromTemplateString = (title: string | TemplateString | null | undefined): string | null => {
|
|
39
|
-
|
|
40
|
-
if (!title) {
|
|
41
|
-
return null
|
|
42
|
-
}
|
|
43
|
-
if (typeof title === 'object') {
|
|
44
|
-
if ('default' in title) {
|
|
45
|
-
return title.default
|
|
46
|
-
}
|
|
47
|
-
else if ('absolute' in title) {
|
|
48
|
-
return title.absolute
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
return title as string
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
const Authors: React.FC<{
|
|
55
|
-
authors: null | undefined | Author | Array<Author>
|
|
56
|
-
}> = ({
|
|
57
|
-
authors
|
|
58
|
-
}) => {
|
|
59
|
-
|
|
60
|
-
const Author: React.FC<{author: Author}> = ({author}) => (<>
|
|
61
|
-
{author.name && <meta name="author" content={author.name} />}
|
|
62
|
-
{author.url && <link rel="author" href={getURLasString(author.url)}/>}
|
|
63
|
-
</>)
|
|
64
|
-
|
|
65
|
-
if (!authors) {
|
|
66
|
-
return null
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
if (Array.isArray(authors)) {
|
|
70
|
-
return (<>
|
|
71
|
-
{authors.map((el: Author, index) => (
|
|
72
|
-
<Author author={el} key={`authors-${index}`} />
|
|
73
|
-
))}
|
|
74
|
-
</>)
|
|
75
|
-
}
|
|
76
|
-
return (<Author author={authors as Author} />)
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
const Keywords: React.FC<{keywords: undefined | null | string | Array<string>}> = ({
|
|
80
|
-
keywords
|
|
81
|
-
}) => {
|
|
82
|
-
if (!keywords) return null
|
|
83
|
-
const content = (Array.isArray(keywords) ? keywords.join(', ') : keywords as string)
|
|
84
|
-
return (<meta name="keywords" content={content} />)
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
const ThemeColor: React.FC<{
|
|
88
|
-
thColors: null | undefined | string | ThemeColorDescriptor | ThemeColorDescriptor[]
|
|
89
|
-
}> = ({
|
|
90
|
-
thColors
|
|
91
|
-
}) => {
|
|
92
|
-
|
|
93
|
-
const ThColor: React.FC<{thColor: ThemeColorDescriptor}> = ({thColor}) => {
|
|
94
|
-
const toSpread: any = {
|
|
95
|
-
content: thColor.color
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
if ('media' in thColor) {
|
|
99
|
-
toSpread.media = thColor.media
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
return <meta name="theme-color" {...toSpread}/>
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
if (!thColors) {
|
|
106
|
-
return null
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
if (Array.isArray(thColors)) {
|
|
110
|
-
return (<>
|
|
111
|
-
{thColors.map((el: ThemeColorDescriptor, index) => (
|
|
112
|
-
<ThColor thColor={el} key={`theme-colors-${index}`} />
|
|
113
|
-
))}
|
|
114
|
-
</>)
|
|
115
|
-
}
|
|
116
|
-
else if (typeof thColors === 'string') {
|
|
117
|
-
<meta name="theme-color" content={thColors as string}/>
|
|
118
|
-
}
|
|
119
|
-
return (<ThColor thColor={thColors as ThemeColorDescriptor} />)
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
const Manifest: React.FC<{
|
|
123
|
-
manifest: undefined | null | string | URL
|
|
124
|
-
}> = ({
|
|
125
|
-
manifest
|
|
126
|
-
}) => (
|
|
127
|
-
manifest && (<link rel="manifest" href={getURLasString(manifest)}/>)
|
|
128
|
-
)
|
|
129
|
-
|
|
130
|
-
const getOGImageURL = (img: OGImage | undefined): string | null => {
|
|
131
|
-
|
|
132
|
-
if (!img) {
|
|
133
|
-
return null
|
|
134
|
-
}
|
|
135
|
-
if (typeof img === 'object' && 'url' in img) { // this is a OGImageDescriptor
|
|
136
|
-
return getURLasString(img.url)
|
|
137
|
-
}
|
|
138
|
-
return getURLasString(img) // this is a URL or string
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
const getTwitterImageURL = (img: TwitterImage | undefined): string | null => {
|
|
142
|
-
|
|
143
|
-
if (!img) {
|
|
144
|
-
return null
|
|
145
|
-
}
|
|
146
|
-
if (typeof img === 'object' && 'url' in img) { // this is a TwitterImageDescriptor
|
|
147
|
-
return getURLasString(img.url)
|
|
148
|
-
}
|
|
149
|
-
return getURLasString(img) // this is a URL or string
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
// https://stackoverflow.com/questions/68746228/next-head-wont-render-meta-tags-inside-of-fragment
|
|
153
|
-
const OpenGraphComponent: React.FC<{
|
|
154
|
-
og: OpenGraph | undefined | null
|
|
155
|
-
}> = ({
|
|
156
|
-
og
|
|
157
|
-
}) => (og && (<Head>
|
|
158
|
-
{og.url && (<meta property="og:url" content={(typeof og.url === 'string') ? (og.url as string) : (og.url.href)} />)}
|
|
159
|
-
{(og as any).type && (<meta property="og:type" content={(og as any).type} />)}
|
|
160
|
-
{og.title && (<meta property="og:title" content={getTitleFromTemplateString(og.title)!} />)}
|
|
161
|
-
{og.description && (<meta property="og:description" content={og.description} />)}
|
|
162
|
-
{og.images && (<meta property="og:image" content={getOGImageURL(Array.isArray(og.images) ? og.images[0] : og.images)!} />)}
|
|
163
|
-
</Head>))
|
|
164
|
-
|
|
165
|
-
// https://stackoverflow.com/questions/68746228/next-head-wont-render-meta-tags-inside-of-fragment
|
|
166
|
-
export const TwitterComponent: React.FC<{
|
|
167
|
-
tw: Twitter | undefined | null
|
|
168
|
-
}> = ({
|
|
169
|
-
tw
|
|
170
|
-
}) => (tw && (<Head>
|
|
171
|
-
{(tw as any).card && (<meta name="twitter:card" content={(tw as any).card} />)}
|
|
172
|
-
{tw.title && (<meta name="twitter:title" content={getTitleFromTemplateString(tw.title)!} />)}
|
|
173
|
-
{tw.description && (<meta name="twitter:description" content={tw.description} />)}
|
|
174
|
-
{tw.images && (<meta name="twitter:image" content={getTwitterImageURL(Array.isArray(tw.images) ? tw.images[0] : tw.images)!} />)}
|
|
175
|
-
{tw.site && (<meta name="twitter:site" content={tw.site} />)}
|
|
176
|
-
</Head>))
|
|
177
|
-
|
|
178
|
-
/* See NOTE at top of file! */
|
|
179
|
-
// https://stackoverflow.com/questions/68746228/next-head-wont-render-meta-tags-inside-of-fragment
|
|
180
|
-
const HeadMetadataComponent: React.FC<{
|
|
181
|
-
metadata: Metadata
|
|
182
|
-
}> = ({
|
|
183
|
-
metadata
|
|
184
|
-
}) => {
|
|
185
|
-
const mainTitle = getTitleFromTemplateString(metadata.title)
|
|
186
|
-
|
|
187
|
-
return (<>
|
|
188
|
-
<Head>
|
|
189
|
-
{mainTitle && (<title>{mainTitle}</title>) /* must be here, directly under Head component */}
|
|
190
|
-
{metadata.description && (
|
|
191
|
-
<meta name="description" content={metadata.description} />
|
|
192
|
-
)}
|
|
193
|
-
{metadata.applicationName && (
|
|
194
|
-
<meta name="application-name" content={metadata.applicationName} />
|
|
195
|
-
)}
|
|
196
|
-
<Authors authors={metadata.authors} />
|
|
197
|
-
<Keywords keywords={metadata.keywords} />
|
|
198
|
-
<ThemeColor thColors={metadata.themeColor} />
|
|
199
|
-
<Manifest manifest={metadata.manifest} />
|
|
200
|
-
</Head>
|
|
201
|
-
{/* Icons: We only support this format for now */}
|
|
202
|
-
<Icons icons={metadata.icons as IconDescriptor[]} />
|
|
203
|
-
<OpenGraphComponent og={metadata.openGraph} />
|
|
204
|
-
<TwitterComponent tw={metadata.twitter} />
|
|
205
|
-
</>)
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
export default HeadMetadataComponent
|
package/next/index.ts
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { NextRequest, NextResponse, userAgent } from 'next/server'
|
|
2
|
-
import { getSelectorsByUserAgent } from 'react-device-detect'
|
|
3
|
-
import { setCookie } from 'cookies-next'
|
|
4
|
-
|
|
5
|
-
// writed this way so they can be chained :)
|
|
6
|
-
const determineDeviceMW = async (request: NextRequest) => {
|
|
7
|
-
|
|
8
|
-
const ua = userAgent(request)
|
|
9
|
-
const { isMobileOnly, isTablet, isDesktop } = getSelectorsByUserAgent(ua.ua)
|
|
10
|
-
const agent = isMobileOnly ? 'phone' : (isTablet ? 'tablet' : (isDesktop ? 'desktop' : 'unknown'))
|
|
11
|
-
const { nextUrl: url } = request
|
|
12
|
-
//console.log(`\n=== from ${url.href} on a *${agent && agent.toUpperCase()}* device. ===\n`)
|
|
13
|
-
const auth_token = url.searchParams.get('auth-token')
|
|
14
|
-
if (auth_token) {
|
|
15
|
-
setCookie('auth-token', auth_token, {
|
|
16
|
-
domain: url.hostname,
|
|
17
|
-
path: '/',
|
|
18
|
-
sameSite: 'none',
|
|
19
|
-
secure: true,
|
|
20
|
-
httpOnly: false,
|
|
21
|
-
expires: new Date(Date.now() + 1000 * 60 * 60 * 24 * 30), // 30 days
|
|
22
|
-
})
|
|
23
|
-
url.searchParams.delete('auth-token')
|
|
24
|
-
}
|
|
25
|
-
url.searchParams.set('agent', agent)
|
|
26
|
-
return NextResponse.rewrite(url)
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export default determineDeviceMW
|
package/root-layout/index.tsx
DELETED
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
import React, { type PropsWithChildren } from 'react'
|
|
2
|
-
import type { Viewport } from 'next'
|
|
3
|
-
|
|
4
|
-
import { Toaster } from '@hanzo/ui/primitives'
|
|
5
|
-
import { AuthServiceProvider } from '@hanzo/auth/service'
|
|
6
|
-
import { getUserServerSideSafe } from '../server/auth-wrapper'
|
|
7
|
-
import type { AuthServiceConf } from '@hanzo/auth/types'
|
|
8
|
-
import { CommerceProvider } from '@hanzo/commerce'
|
|
9
|
-
|
|
10
|
-
import getAppRouterBodyFontClasses from '../next/font/get-app-router-font-classes'
|
|
11
|
-
import { FacebookPixelHead } from '../next/analytics/pixel-analytics'
|
|
12
|
-
|
|
13
|
-
import { CommerceUIProvider } from '../commerce/ui/context'
|
|
14
|
-
import { AuthListener, ChatWidget, Header, Analytics } from '../components'
|
|
15
|
-
|
|
16
|
-
import CommerceDrawer from '../components/commerce/drawer'
|
|
17
|
-
|
|
18
|
-
import type SiteDef from '../types/site-def'
|
|
19
|
-
|
|
20
|
-
import '../style/lux-global.css'
|
|
21
|
-
import '../style/cart-animation.css'
|
|
22
|
-
import '../style/checkout-animation.css'
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
// Next 14: https://nextjs.org/docs/app/building-your-application/upgrading/codemods#use-viewport-export
|
|
26
|
-
const viewport = {
|
|
27
|
-
themeColor: [
|
|
28
|
-
{ media: '(prefers-color-scheme: light)', color: 'white' },
|
|
29
|
-
{ media: '(prefers-color-scheme: dark)', color: 'black' },
|
|
30
|
-
],
|
|
31
|
-
} satisfies Viewport
|
|
32
|
-
|
|
33
|
-
/*
|
|
34
|
-
These '.variable' fields are actually autogenerate css classnames that *define* the actual
|
|
35
|
-
css variables ('--<ugly-name>') that one asks for in the tailwind classes.
|
|
36
|
-
They are what make them available in the global scope. So this MUST
|
|
37
|
-
be done like this for the tailwind font classes to work.
|
|
38
|
-
|
|
39
|
-
(...not to be confused with the css var itself. This field should be named something else!)
|
|
40
|
-
*/
|
|
41
|
-
|
|
42
|
-
/*
|
|
43
|
-
re body: overflow-y-hidden overflow-x-hidden, h-full
|
|
44
|
-
We cannot have these on body tag for scroll-snap to work on iOS!
|
|
45
|
-
*/
|
|
46
|
-
const bodyClasses =
|
|
47
|
-
'bg-background text-foreground flex flex-col min-h-full ' +
|
|
48
|
-
getAppRouterBodyFontClasses()
|
|
49
|
-
|
|
50
|
-
async function RootLayout({
|
|
51
|
-
showHeader = false,
|
|
52
|
-
chatbot = false,
|
|
53
|
-
siteDef,
|
|
54
|
-
children,
|
|
55
|
-
} : {
|
|
56
|
-
siteDef: SiteDef
|
|
57
|
-
showHeader?: boolean
|
|
58
|
-
chatbot?: boolean
|
|
59
|
-
} & PropsWithChildren) {
|
|
60
|
-
|
|
61
|
-
const currentUser = await getUserServerSideSafe()
|
|
62
|
-
|
|
63
|
-
const Guts: React.FC = () => (<>
|
|
64
|
-
{showHeader && <Header siteDef={siteDef}/>}
|
|
65
|
-
{children}
|
|
66
|
-
{chatbot && (<ChatWidget
|
|
67
|
-
title='LUX'
|
|
68
|
-
subtitle='AI'
|
|
69
|
-
chatbotUrl='https://lux.chat/iframe'
|
|
70
|
-
suggestedQuestions={siteDef.chatbot?.suggestedQuestions ?? []}
|
|
71
|
-
buttonClx='hidden md:block'
|
|
72
|
-
/>)}
|
|
73
|
-
</>)
|
|
74
|
-
|
|
75
|
-
return (
|
|
76
|
-
<html lang='en' suppressHydrationWarning className='hanzo-ui-dark-theme' style={{backgroundColor: '#000'}}>
|
|
77
|
-
<head >
|
|
78
|
-
{/* https://stackoverflow.com/a/75716588/11645689 */ }
|
|
79
|
-
<base target='_blank' />
|
|
80
|
-
<FacebookPixelHead/>
|
|
81
|
-
</head>
|
|
82
|
-
|
|
83
|
-
<body suppressHydrationWarning className={bodyClasses} style={{
|
|
84
|
-
|
|
85
|
-
// As noted above: 'overflow: hidden' on the <body> tag breaks scroll snap!
|
|
86
|
-
display: 'none', // see analytics.tsx
|
|
87
|
-
}}>
|
|
88
|
-
<Analytics/>
|
|
89
|
-
<AuthServiceProvider user={currentUser} conf={{} as AuthServiceConf}>
|
|
90
|
-
{siteDef?.commerce ? (
|
|
91
|
-
<CommerceProvider config={siteDef.commerce!} >
|
|
92
|
-
<CommerceUIProvider >
|
|
93
|
-
<Guts />
|
|
94
|
-
<CommerceDrawer />
|
|
95
|
-
</CommerceUIProvider>
|
|
96
|
-
</CommerceProvider>
|
|
97
|
-
) : (
|
|
98
|
-
<Guts />
|
|
99
|
-
)}
|
|
100
|
-
<AuthListener/>
|
|
101
|
-
</AuthServiceProvider>
|
|
102
|
-
<Toaster position='top-center' duration={3000}/>
|
|
103
|
-
</body>
|
|
104
|
-
</html>
|
|
105
|
-
)
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
export {
|
|
109
|
-
RootLayout,
|
|
110
|
-
viewport
|
|
111
|
-
}
|
package/server/auth-wrapper.ts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import 'server-only'
|
|
2
|
-
|
|
3
|
-
// Wrapper for getUserServerSide that handles Firebase not being configured
|
|
4
|
-
export async function getUserServerSideSafe() {
|
|
5
|
-
try {
|
|
6
|
-
// Check if Firebase environment variables are present
|
|
7
|
-
const hasFirebaseConfig =
|
|
8
|
-
process.env.FIREBASE_CLIENT_EMAIL &&
|
|
9
|
-
process.env.FIREBASE_PROJECT_ID &&
|
|
10
|
-
process.env.FIREBASE_PRIVATE_KEY;
|
|
11
|
-
|
|
12
|
-
if (!hasFirebaseConfig) {
|
|
13
|
-
console.log('Firebase not configured, returning null user');
|
|
14
|
-
return null;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
// Only import and use the actual function if Firebase is configured
|
|
18
|
-
const { getUserServerSide } = await import('@hanzo/auth/server');
|
|
19
|
-
return await getUserServerSide();
|
|
20
|
-
} catch (error) {
|
|
21
|
-
console.error('Error getting user server side:', error);
|
|
22
|
-
return null;
|
|
23
|
-
}
|
|
24
|
-
}
|
package/server-actions/TO-DO.txt
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
move login and logout api routes here!
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { initializeApp, getApps, type FirebaseApp } from 'firebase/app'
|
|
2
|
-
|
|
3
|
-
const firebaseConfig = {
|
|
4
|
-
apiKey: process.env.NEXT_PUBLIC_FIREBASE_API_KEY,
|
|
5
|
-
authDomain: process.env.NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN,
|
|
6
|
-
projectId: process.env.NEXT_PUBLIC_FIREBASE_PROJECT_ID,
|
|
7
|
-
storageBucket: process.env.NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET,
|
|
8
|
-
messagingSenderId: process.env.NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID,
|
|
9
|
-
appId: process.env.NEXT_PUBLIC_FIREBASE_APP_ID,
|
|
10
|
-
measurementId: process.env.NEXT_PUBLIC_FIREBASE_MEASUREMENT_ID,
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
// Check if Firebase config is present
|
|
14
|
-
const hasFirebaseConfig = firebaseConfig.apiKey && firebaseConfig.projectId;
|
|
15
|
-
|
|
16
|
-
// Initialize Firebase instance only if config is present
|
|
17
|
-
let firebaseApp: FirebaseApp | null = null;
|
|
18
|
-
|
|
19
|
-
if (hasFirebaseConfig) {
|
|
20
|
-
try {
|
|
21
|
-
firebaseApp = getApps().length === 0 ? initializeApp(firebaseConfig) : getApps()[0]
|
|
22
|
-
} catch (error) {
|
|
23
|
-
console.warn('Failed to initialize Firebase app:', error);
|
|
24
|
-
}
|
|
25
|
-
} else {
|
|
26
|
-
console.log('Firebase configuration not found, skipping initialization');
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export default firebaseApp
|
package/server-actions/index.ts
DELETED
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
'use server'
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
getFirestore,
|
|
5
|
-
collection,
|
|
6
|
-
setDoc,
|
|
7
|
-
doc,
|
|
8
|
-
serverTimestamp,
|
|
9
|
-
type Firestore,
|
|
10
|
-
} from 'firebase/firestore'
|
|
11
|
-
|
|
12
|
-
import firebaseApp from './firebase-app'
|
|
13
|
-
import type { ContactInfo } from '../types'
|
|
14
|
-
|
|
15
|
-
let dbInstance: Firestore | undefined = undefined
|
|
16
|
-
|
|
17
|
-
const getDBInstance = (name: string): Firestore | null => {
|
|
18
|
-
if (!firebaseApp) {
|
|
19
|
-
console.warn('Firebase not initialized, cannot get database instance');
|
|
20
|
-
return null;
|
|
21
|
-
}
|
|
22
|
-
if (!dbInstance) {
|
|
23
|
-
dbInstance = getFirestore(firebaseApp, name)
|
|
24
|
-
}
|
|
25
|
-
return dbInstance
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
const storeContact = async ( formData: ContactInfo, enclosure: any ) => {
|
|
29
|
-
const email = formData.email
|
|
30
|
-
const phone = formData.phone
|
|
31
|
-
const dbName = enclosure?.dbId
|
|
32
|
-
const tableName = enclosure?.listId
|
|
33
|
-
|
|
34
|
-
// Return early if Firebase is not configured
|
|
35
|
-
if (!firebaseApp) {
|
|
36
|
-
console.warn('Firebase not configured, skipping contact storage');
|
|
37
|
-
return { success: true, error: null, id: email };
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
let error: any | null = null
|
|
41
|
-
const db = getDBInstance(dbName);
|
|
42
|
-
if (!db) {
|
|
43
|
-
return { success: false, error: 'Database not available' };
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
const tableRef = collection(db, tableName)
|
|
47
|
-
|
|
48
|
-
try {
|
|
49
|
-
await setDoc(doc(tableRef, email), {
|
|
50
|
-
email,
|
|
51
|
-
phone,
|
|
52
|
-
timestamp: serverTimestamp(),
|
|
53
|
-
})
|
|
54
|
-
return { success: !error, error, id: email }
|
|
55
|
-
}
|
|
56
|
-
catch (e) {
|
|
57
|
-
console.error('Error writing contact info to database: ', e)
|
|
58
|
-
error = e
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
return { success: !error, error }
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
export {
|
|
65
|
-
storeContact as default
|
|
66
|
-
}
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import type { LinkDef } from '@hanzo/ui/types'
|
|
2
|
-
|
|
3
|
-
import { SocialIcon } from '../../components/icons'
|
|
4
|
-
|
|
5
|
-
// @ts-ignore (will build in project that has @svgr support)
|
|
6
|
-
import SVG_warp_logo from './svg/warpcast-logo.svg'
|
|
7
|
-
|
|
8
|
-
const SOC_ICON_SIZE = 18
|
|
9
|
-
|
|
10
|
-
export default [
|
|
11
|
-
{
|
|
12
|
-
title: 'Community',
|
|
13
|
-
href: '',
|
|
14
|
-
variant: 'linkFG',
|
|
15
|
-
},
|
|
16
|
-
{
|
|
17
|
-
title: 'Lux Channel',
|
|
18
|
-
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} />
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
title: 'Lux Discussions',
|
|
23
|
-
href: 'https://github.com/orgs/luxfi/discussions',
|
|
24
|
-
icon: <SocialIcon network='github' size={SOC_ICON_SIZE} />
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
title: 'Discord',
|
|
28
|
-
href: 'https://discord.gg/sxaS7FFHwh',
|
|
29
|
-
icon: <SocialIcon network='discord' size={SOC_ICON_SIZE} />
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
title: 'Telegram',
|
|
33
|
-
href: 'https://t.me/luxdefi',
|
|
34
|
-
icon: <SocialIcon network='telegram' size={SOC_ICON_SIZE} />
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
title: '@luxdefi',
|
|
38
|
-
href: 'https://twitter.com/luxdefi',
|
|
39
|
-
icon: <SocialIcon network='x' size={SOC_ICON_SIZE} />
|
|
40
|
-
},
|
|
41
|
-
{
|
|
42
|
-
title: '@luxdefi',
|
|
43
|
-
href: 'https://facebook.com/luxdefi',
|
|
44
|
-
icon: <SocialIcon network='facebook' size={SOC_ICON_SIZE + 2} />
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
title: '@luxdefi',
|
|
48
|
-
href: 'https://www.instagram.com/luxdefi',
|
|
49
|
-
icon: <SocialIcon network='instagram' size={SOC_ICON_SIZE + 2} />
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
title: '@luxdefi',
|
|
53
|
-
href: 'https://linkedin.com/company/luxdefi',
|
|
54
|
-
icon: <SocialIcon network='linkedin' size={SOC_ICON_SIZE + 2} />
|
|
55
|
-
},
|
|
56
|
-
{
|
|
57
|
-
title: '@luxdefi',
|
|
58
|
-
href: 'https://www.youtube.com/@luxdefi',
|
|
59
|
-
icon: <SocialIcon network='youtube' size={SOC_ICON_SIZE + 2} />
|
|
60
|
-
},
|
|
61
|
-
] satisfies LinkDef[]
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import type { LinkDef } from '@hanzo/ui/types'
|
|
2
|
-
|
|
3
|
-
export default [
|
|
4
|
-
{
|
|
5
|
-
title: 'Company',
|
|
6
|
-
href: "https://lux.partners/",
|
|
7
|
-
variant: 'linkFG',
|
|
8
|
-
newTab: false,
|
|
9
|
-
},
|
|
10
|
-
{
|
|
11
|
-
title: 'About',
|
|
12
|
-
href: 'https://lux.partners',
|
|
13
|
-
newTab: false,
|
|
14
|
-
},
|
|
15
|
-
{
|
|
16
|
-
title: 'Brand',
|
|
17
|
-
href: 'https://drive.google.com/drive/folders/14OJtKLVakGY6883XO9yGbiHtlFxQUUm5?usp=share_link',
|
|
18
|
-
},
|
|
19
|
-
{
|
|
20
|
-
title: 'Careers',
|
|
21
|
-
href: 'https://docs.google.com/document/d/1SCt0Hg7EIs06TootKCA1am1xo4mcXoKF/edit#heading=h.30j0zll',
|
|
22
|
-
newTab: true,
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
title: 'Partnerships',
|
|
26
|
-
href: 'https://apply.lux.partners/',
|
|
27
|
-
newTab: false,
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
title: 'Press',
|
|
31
|
-
href: 'mailto:ai@lux.partners?subject=%E2%96%BC%20Press',
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
title: 'Help',
|
|
35
|
-
href: 'mailto:ai@lux.partners?subject=%E2%96%BC%20Help',
|
|
36
|
-
},
|
|
37
|
-
] satisfies LinkDef[]
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import type { LinkDef } from '@hanzo/ui/types'
|
|
2
|
-
|
|
3
|
-
export default [
|
|
4
|
-
{
|
|
5
|
-
title: 'Ecosystem',
|
|
6
|
-
href: 'https://lux.link',
|
|
7
|
-
variant: 'linkFG'
|
|
8
|
-
},
|
|
9
|
-
{
|
|
10
|
-
title: 'Lux AI',
|
|
11
|
-
href: 'https://lux.chat',
|
|
12
|
-
},
|
|
13
|
-
{
|
|
14
|
-
title: 'Lux Credit',
|
|
15
|
-
href: 'https://lux.credit',
|
|
16
|
-
},
|
|
17
|
-
{
|
|
18
|
-
title: 'Lux Exchange',
|
|
19
|
-
href: 'https://lux.exchange',
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
title: 'Lux Finance',
|
|
23
|
-
href: 'https://lux.finance',
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
title: 'Lux Market',
|
|
27
|
-
href: 'https://lux.market',
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
title: 'Lux Shop',
|
|
31
|
-
href: 'https://lux.shop',
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
title: 'Lux Quest',
|
|
35
|
-
href: 'https://lux.quest',
|
|
36
|
-
},
|
|
37
|
-
] satisfies LinkDef[]
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import type { LinkDef } from '@hanzo/ui/types'
|
|
2
|
-
|
|
3
|
-
import ecosystem from './ecosystem'
|
|
4
|
-
import network from './network'
|
|
5
|
-
import company from './company'
|
|
6
|
-
import community from './community'
|
|
7
|
-
import { legal, legalColumn } from './legal'
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
const standard = [
|
|
11
|
-
ecosystem,
|
|
12
|
-
network,
|
|
13
|
-
company,
|
|
14
|
-
community,
|
|
15
|
-
] satisfies LinkDef[][]
|
|
16
|
-
|
|
17
|
-
export {
|
|
18
|
-
ecosystem,
|
|
19
|
-
network,
|
|
20
|
-
company,
|
|
21
|
-
community,
|
|
22
|
-
legal,
|
|
23
|
-
legalColumn,
|
|
24
|
-
standard
|
|
25
|
-
}
|
|
26
|
-
|
package/site-def/footer/legal.ts
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import type { LinkDef } from '@hanzo/ui/types'
|
|
2
|
-
|
|
3
|
-
const legal: LinkDef[] = [
|
|
4
|
-
{
|
|
5
|
-
title: 'Terms and Conditions',
|
|
6
|
-
href: 'https://docs.google.com/document/d/1mvkjr1w8Rv8ttirs1mu-_2fw_PXclOyS/preview',
|
|
7
|
-
newTab: true,
|
|
8
|
-
},
|
|
9
|
-
{
|
|
10
|
-
title: 'Privacy Policy',
|
|
11
|
-
href: 'https://docs.google.com/document/d/1vZjOKaNdOoThDIaVLERWxflQLtOsuvLn/preview',
|
|
12
|
-
newTab: true,
|
|
13
|
-
},
|
|
14
|
-
]
|
|
15
|
-
|
|
16
|
-
const title: LinkDef =
|
|
17
|
-
{
|
|
18
|
-
title: 'Legal',
|
|
19
|
-
href: '',
|
|
20
|
-
variant: 'linkFG',
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
const legalColumn: LinkDef[] = [title, ...legal]
|
|
24
|
-
|
|
25
|
-
export {
|
|
26
|
-
legal,
|
|
27
|
-
legalColumn
|
|
28
|
-
}
|