@luxfi/core 5.1.4 → 5.1.6
Sign up to get free protection for your applications and to get access to all the features.
- package/commerce/{AUTO-GEN-bullion-by-family.json → data/AUTO-GEN-bullion-by-family.json} +33 -33
- package/commerce/{EDIT-ME-bullion-market-prices.ts → data/EDIT-ME-bullion-market-prices.ts} +11 -11
- package/commerce/{assign-prices.ts → data/assign-prices.ts} +49 -49
- package/commerce/{assign-videos-by-family-group.ts → data/assign-videos-by-family-group.ts} +14 -14
- package/commerce/{bullion-price-1oz.ts → data/bullion-price-1oz.ts} +5 -5
- package/commerce/{index.ts → data/index.ts} +18 -18
- package/commerce/ui/conf.ts +13 -0
- package/commerce/ui/context.tsx +102 -0
- package/commerce/ui/store.ts +277 -0
- package/components/access-code-input.tsx +71 -71
- package/components/auth/auth-listener.tsx +29 -29
- package/components/auth/auth-token/clear-auth-token.tsx +12 -12
- package/components/auth/auth-token/set-auth-token.tsx +16 -16
- package/components/auth/common-auth-domains.ts +16 -16
- package/components/auth/login-panel.tsx +107 -104
- package/components/chat-widget.tsx +85 -80
- package/components/commerce/add-widget.tsx +20 -0
- package/components/commerce/bag-button.tsx +98 -98
- package/components/commerce/buy-button.tsx +34 -0
- package/components/commerce/checkout-button.tsx +129 -116
- package/components/commerce/checkout-panel/close-button.tsx +26 -26
- package/components/commerce/checkout-panel/dt-bag-carousel.tsx +36 -36
- package/components/commerce/checkout-panel/dt-checkout-panel.tsx +66 -66
- package/components/commerce/checkout-panel/index.tsx +129 -124
- package/components/commerce/checkout-panel/links-row.tsx +21 -21
- package/components/commerce/checkout-panel/mb-checkout-panel.tsx +54 -54
- package/components/commerce/checkout-panel/steps-indicator.tsx +39 -39
- package/components/commerce/checkout-panel/thank-you.tsx +18 -18
- package/components/commerce/checkout-widget/const.ts +13 -13
- package/components/commerce/checkout-widget/index.tsx +192 -86
- package/components/commerce/checkout-widget/obs-string-set.ts +48 -48
- package/components/commerce/checkout-widget/use-anim-clx-set.ts +58 -56
- package/components/commerce/desktop-bag-popup.tsx +78 -78
- package/components/commerce/drawer/index.tsx +117 -0
- package/components/commerce/drawer/micro.tsx +136 -0
- package/components/commerce/drawer/shell.tsx +79 -0
- package/components/commerce/mobile-bag-drawer.tsx +51 -51
- package/components/commerce/mobile-login-button.tsx +100 -100
- package/components/commerce/mobile-menu-toggle-button.tsx +35 -35
- package/components/commerce/mobile-nav-menu-ai.tsx +97 -97
- package/components/commerce/mobile-nav-menu-item.tsx +45 -45
- package/components/commerce/mobile-nav-menu.tsx +80 -79
- package/components/contact-dialog/contact-form.tsx +113 -112
- package/components/contact-dialog/disclaimer.tsx +13 -13
- package/components/contact-dialog/index.tsx +64 -64
- package/components/copyright.tsx +21 -21
- package/components/drawer-margin.tsx +25 -0
- package/components/footer.tsx +77 -77
- package/components/header/desktop.tsx +54 -54
- package/components/header/index.tsx +40 -47
- package/components/header/mobile.tsx +165 -165
- package/components/header/theme-toggle.tsx +26 -26
- package/components/icons/avatar.tsx +11 -11
- package/components/icons/bag-icon.tsx +10 -10
- package/components/icons/github.tsx +14 -14
- package/components/icons/index.tsx +43 -43
- package/components/icons/left-arrow.tsx +11 -11
- package/components/icons/lux-logo.tsx +10 -10
- package/components/icons/right-arrow.tsx +10 -10
- package/components/icons/search.tsx +12 -12
- package/components/icons/secure-delivery.tsx +13 -13
- package/components/icons/social-icon.tsx +35 -35
- package/components/icons/social-svg.css +3 -3
- package/components/icons/youtube-logo.tsx +59 -59
- package/components/index.ts +25 -27
- package/components/logo.tsx +81 -81
- package/components/main.tsx +27 -0
- package/components/mini-chart/index.tsx +7 -7
- package/components/mini-chart/mini-chart-props.ts +43 -43
- package/components/mini-chart/mini-chart.tsx +85 -85
- package/components/mini-chart/wrapper.tsx +23 -23
- package/components/not-found/index.tsx +28 -27
- package/components/not-found/not-found-content.mdx +5 -5
- package/components/scripts.tsx +24 -24
- package/conf/index.ts +52 -50
- package/{commerce/lux-service-options.ts → conf/lux-commerce-options.ts} +6 -6
- package/environment.d.ts +5 -5
- package/next/analytics/fpixel.ts +15 -15
- package/next/analytics/google-analytics.ts +13 -13
- package/next/analytics/index.ts +3 -3
- package/next/analytics/pixel-analytics.tsx +54 -54
- package/next/font/get-app-router-font-classes.ts +12 -12
- package/next/font/load-and-return-lux-next-fonts-on-import.ts +68 -68
- package/next/font/next-font-desc.ts +27 -27
- package/next/font/pages-router-font-vars.tsx +18 -18
- package/next/head-metadata/from-next/metadata-types.ts +158 -158
- package/next/head-metadata/from-next/opengraph-types.ts +267 -267
- package/next/head-metadata/from-next/twitter-types.ts +92 -92
- package/next/head-metadata/index.tsx +208 -208
- package/next/middleware/determine-device-mw.ts +16 -16
- package/package.json +80 -73
- package/root-layout/WHY_THIS_IS_SEPARATE.txt +1 -1
- package/root-layout/index.tsx +118 -121
- package/server-actions/firebase-app.ts +14 -14
- package/server-actions/index.ts +5 -5
- package/server-actions/store-contact.ts +51 -51
- package/site-def/footer/community.tsx +67 -67
- package/site-def/footer/company.ts +37 -37
- package/site-def/footer/ecosystem.ts +37 -37
- package/site-def/footer/index.tsx +26 -26
- package/site-def/footer/legal.ts +28 -28
- package/site-def/footer/network.ts +45 -45
- package/site-def/footer/svg/warpcast-logo.svg +11 -11
- package/site-def/index.ts +2 -2
- package/site-def/main-nav.tsx +292 -292
- package/style/cart-animation.css +29 -29
- package/style/checkout-animation.css +23 -23
- package/style/drawer-handle-overrides.css +160 -0
- package/style/lux-colors.css +85 -85
- package/style/lux-global.css +30 -30
- package/tailwind/fontFamily.tailwind.lux.ts +18 -18
- package/tailwind/index.ts +2 -2
- package/tailwind/lux-tw-fonts.ts +39 -39
- package/tailwind/tailwind.config.lux-preset.ts +10 -10
- package/tsconfig.json +15 -10
- package/types/chatbot-config.ts +6 -6
- package/types/chatbot-suggested-question.ts +7 -7
- package/types/commerce-config.ts +10 -10
- package/types/contact-info.ts +10 -10
- package/types/index.ts +5 -5
- package/types/site-def.ts +45 -45
- package/components/commerce/buy-drawer/drawer.tsx +0 -44
- package/components/commerce/buy-drawer/index.tsx +0 -46
- package/components/commerce/checkout-widget/use-lagging-item-ref.ts +0 -30
- package/components/header/guts.tsx +0 -27
package/types/contact-info.ts
CHANGED
@@ -1,11 +1,11 @@
|
|
1
|
-
interface ContactInfo {
|
2
|
-
email: string
|
3
|
-
phone?: string
|
4
|
-
}
|
5
|
-
|
6
|
-
type ContactInfoFields = keyof ContactInfo
|
7
|
-
|
8
|
-
export {
|
9
|
-
type ContactInfo,
|
10
|
-
type ContactInfoFields
|
1
|
+
interface ContactInfo {
|
2
|
+
email: string
|
3
|
+
phone?: string
|
4
|
+
}
|
5
|
+
|
6
|
+
type ContactInfoFields = keyof ContactInfo
|
7
|
+
|
8
|
+
export {
|
9
|
+
type ContactInfo,
|
10
|
+
type ContactInfoFields
|
11
11
|
}
|
package/types/index.ts
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
export type { ContactInfo, ContactInfoFields } from './contact-info'
|
2
|
-
export type { default as SiteDef } from './site-def'
|
3
|
-
export type { default as ChatbotSuggestedQuestion } from './chatbot-suggested-question'
|
4
|
-
export type { default as ChatbotConfig } from './chatbot-config'
|
5
|
-
export type { default as CommerceConfig } from './commerce-config'
|
1
|
+
export type { ContactInfo, ContactInfoFields } from './contact-info'
|
2
|
+
export type { default as SiteDef } from './site-def'
|
3
|
+
export type { default as ChatbotSuggestedQuestion } from './chatbot-suggested-question'
|
4
|
+
export type { default as ChatbotConfig } from './chatbot-config'
|
5
|
+
export type { default as CommerceConfig } from './commerce-config'
|
package/types/site-def.ts
CHANGED
@@ -1,45 +1,45 @@
|
|
1
|
-
import React from 'react'
|
2
|
-
|
3
|
-
import type { LinkDef } from '@hanzo/ui/types'
|
4
|
-
|
5
|
-
import type CommerceConfig from './commerce-config'
|
6
|
-
import type ChatbotConfig from './chatbot-config'
|
7
|
-
|
8
|
-
interface SiteDef {
|
9
|
-
|
10
|
-
/** url of this site. All nav links in the system will show it in 'current' state */
|
11
|
-
currentAs?: string
|
12
|
-
|
13
|
-
nav: {
|
14
|
-
/** common elements (will auto-select currentAs if it's provide) */
|
15
|
-
/** optional feature element. right-most after 'elements' (any min-w is ignored) */
|
16
|
-
common: LinkDef[]
|
17
|
-
featured?: LinkDef[]
|
18
|
-
auth?: boolean
|
19
|
-
cart?: React.ReactNode
|
20
|
-
}
|
21
|
-
|
22
|
-
/**
|
23
|
-
* Array of columns, each of which itself is an array of links
|
24
|
-
* (or "title defs" where href='' and variant='linkFG')
|
25
|
-
* Common use case: To render a site-specific first column:
|
26
|
-
* {
|
27
|
-
* footer[myColumn, ...commonColumnsFromUi]
|
28
|
-
* }
|
29
|
-
* see: @hanzo/ui/siteDef/footer (default export)
|
30
|
-
* or @hanzo/ui/siteDef/footer/common
|
31
|
-
*/
|
32
|
-
footer: LinkDef[][]
|
33
|
-
|
34
|
-
/**
|
35
|
-
* optional override of default 'above copyright' horizantal links
|
36
|
-
default (undefined / absent): links in side-def/footer/legal are rendered
|
37
|
-
[] renders nothing above the copyright
|
38
|
-
*/
|
39
|
-
aboveCopyright?: LinkDef[]
|
40
|
-
|
41
|
-
commerce?: CommerceConfig
|
42
|
-
chatbot?: ChatbotConfig
|
43
|
-
}
|
44
|
-
|
45
|
-
export { type SiteDef as default }
|
1
|
+
import React from 'react'
|
2
|
+
|
3
|
+
import type { LinkDef } from '@hanzo/ui/types'
|
4
|
+
|
5
|
+
import type CommerceConfig from './commerce-config'
|
6
|
+
import type ChatbotConfig from './chatbot-config'
|
7
|
+
|
8
|
+
interface SiteDef {
|
9
|
+
|
10
|
+
/** url of this site. All nav links in the system will show it in 'current' state */
|
11
|
+
currentAs?: string
|
12
|
+
|
13
|
+
nav: {
|
14
|
+
/** common elements (will auto-select currentAs if it's provide) */
|
15
|
+
/** optional feature element. right-most after 'elements' (any min-w is ignored) */
|
16
|
+
common: LinkDef[]
|
17
|
+
featured?: LinkDef[]
|
18
|
+
auth?: boolean
|
19
|
+
cart?: React.ReactNode
|
20
|
+
}
|
21
|
+
|
22
|
+
/**
|
23
|
+
* Array of columns, each of which itself is an array of links
|
24
|
+
* (or "title defs" where href='' and variant='linkFG')
|
25
|
+
* Common use case: To render a site-specific first column:
|
26
|
+
* {
|
27
|
+
* footer[myColumn, ...commonColumnsFromUi]
|
28
|
+
* }
|
29
|
+
* see: @hanzo/ui/siteDef/footer (default export)
|
30
|
+
* or @hanzo/ui/siteDef/footer/common
|
31
|
+
*/
|
32
|
+
footer: LinkDef[][]
|
33
|
+
|
34
|
+
/**
|
35
|
+
* optional override of default 'above copyright' horizantal links
|
36
|
+
default (undefined / absent): links in side-def/footer/legal are rendered
|
37
|
+
[] renders nothing above the copyright
|
38
|
+
*/
|
39
|
+
aboveCopyright?: LinkDef[]
|
40
|
+
|
41
|
+
commerce?: CommerceConfig
|
42
|
+
chatbot?: ChatbotConfig
|
43
|
+
}
|
44
|
+
|
45
|
+
export { type SiteDef as default }
|
@@ -1,44 +0,0 @@
|
|
1
|
-
'use client'
|
2
|
-
import React, {type PropsWithChildren } from 'react'
|
3
|
-
|
4
|
-
import { X as LucideX} from 'lucide-react'
|
5
|
-
|
6
|
-
import { Button, Drawer, DrawerContent, type DrawerProps } from '@hanzo/ui/primitives'
|
7
|
-
import { cn } from '@hanzo/ui/util'
|
8
|
-
|
9
|
-
const CommerceDrawer: React.FC<PropsWithChildren &
|
10
|
-
Omit<DrawerProps, 'onOpenChange'> &
|
11
|
-
{
|
12
|
-
setOpen: (b: boolean) => void
|
13
|
-
drawerClx?: string
|
14
|
-
}
|
15
|
-
> = ({
|
16
|
-
children,
|
17
|
-
open,
|
18
|
-
setOpen,
|
19
|
-
modal,
|
20
|
-
drawerClx='',
|
21
|
-
...rest
|
22
|
-
}) => (
|
23
|
-
// @ts-ignore
|
24
|
-
<Drawer open={open} onOpenChange={setOpen} modal={modal} {...rest}>
|
25
|
-
<DrawerContent modal={modal} className={cn(
|
26
|
-
'rounded-t-xl mt-6 pt-6',
|
27
|
-
drawerClx
|
28
|
-
)}>
|
29
|
-
{children}
|
30
|
-
<Button
|
31
|
-
variant='ghost'
|
32
|
-
size='icon'
|
33
|
-
onClick={() => {setOpen(false)}}
|
34
|
-
className={'absolute top-4 right-4 w-8 h-8 group rounded-full p-1 hidden md:flex items-center'}
|
35
|
-
>
|
36
|
-
<LucideX className='w-6 h-6 text-muted group-hover:text-foreground'/>
|
37
|
-
</Button>
|
38
|
-
</DrawerContent>
|
39
|
-
</Drawer>
|
40
|
-
)
|
41
|
-
|
42
|
-
|
43
|
-
export default CommerceDrawer
|
44
|
-
|
@@ -1,46 +0,0 @@
|
|
1
|
-
'use client'
|
2
|
-
import React from 'react'
|
3
|
-
import { useRouter } from 'next/navigation'
|
4
|
-
import { observer } from 'mobx-react-lite'
|
5
|
-
|
6
|
-
import { useCommerceUI, CarouselBuyCard } from '@hanzo/commerce'
|
7
|
-
|
8
|
-
import CommerceDrawer from './drawer'
|
9
|
-
import CheckoutButton from '../checkout-button'
|
10
|
-
|
11
|
-
const CommerceUIComponent: React.FC = observer(() => {
|
12
|
-
|
13
|
-
const ui = useCommerceUI()
|
14
|
-
const router = useRouter()
|
15
|
-
|
16
|
-
const handleCheckout = () => {
|
17
|
-
router.push('/checkout')
|
18
|
-
}
|
19
|
-
|
20
|
-
// Should only ever be called internally to close
|
21
|
-
const reallyOnlyCloseDrawer = (b: boolean) => {
|
22
|
-
if (!b ) {
|
23
|
-
ui.hideBuyOptions()
|
24
|
-
}
|
25
|
-
}
|
26
|
-
|
27
|
-
return (
|
28
|
-
<CommerceDrawer
|
29
|
-
open={!!ui.buyOptionsSkuPath}
|
30
|
-
setOpen={reallyOnlyCloseDrawer}
|
31
|
-
drawerClx={'w-full md:max-w-[550px] md:mx-auto lg:max-w-[50vw]'}
|
32
|
-
>
|
33
|
-
<CarouselBuyCard
|
34
|
-
skuPath={ui.buyOptionsSkuPath!}
|
35
|
-
checkoutButton={
|
36
|
-
<CheckoutButton handleCheckout={handleCheckout} className='w-full min-w-[160px] sm:max-w-[320px]'/>
|
37
|
-
}
|
38
|
-
clx='w-full'
|
39
|
-
addBtnClx='w-full min-w-[160px] sm:max-w-[320px]'
|
40
|
-
selectorClx='max-w-[475px]'
|
41
|
-
/>
|
42
|
-
</CommerceDrawer>
|
43
|
-
)
|
44
|
-
})
|
45
|
-
|
46
|
-
export default CommerceUIComponent
|
@@ -1,30 +0,0 @@
|
|
1
|
-
import { useEffect, useRef } from 'react'
|
2
|
-
import { reaction } from 'mobx'
|
3
|
-
|
4
|
-
import type { LineItem, ObsLineItemRef } from "@hanzo/commerce/types"
|
5
|
-
import { LineItemRef } from '@hanzo/commerce'
|
6
|
-
|
7
|
-
export default (orig: ObsLineItemRef, lagMs: number): ObsLineItemRef => {
|
8
|
-
|
9
|
-
// a ref that is synced to 'orig', but persists for lagMs longer
|
10
|
-
// so ui does not jump while animating out.
|
11
|
-
// (Fascilitates for start and end states in animation)
|
12
|
-
const laggingRef = useRef<LineItemRef>(new LineItemRef())
|
13
|
-
|
14
|
-
useEffect(() => (
|
15
|
-
reaction(
|
16
|
-
() => (orig.item),
|
17
|
-
(item: LineItem | undefined) => {
|
18
|
-
if (item) {
|
19
|
-
laggingRef.current.set(item)
|
20
|
-
}
|
21
|
-
else {
|
22
|
-
setTimeout(() => { laggingRef.current.set(undefined) }, lagMs)
|
23
|
-
}
|
24
|
-
},
|
25
|
-
{equals: (val, prev) => (val?.sku === prev?.sku)}
|
26
|
-
)
|
27
|
-
), [])
|
28
|
-
|
29
|
-
return laggingRef.current
|
30
|
-
}
|
@@ -1,27 +0,0 @@
|
|
1
|
-
'use client'
|
2
|
-
import React, { useState, useEffect } from 'react'
|
3
|
-
import type SiteDef from '../../types/site-def'
|
4
|
-
import { ChatWidget, Header } from '../../components'
|
5
|
-
|
6
|
-
const Guts: React.FC<{
|
7
|
-
children: React.ReactNode,
|
8
|
-
siteDef: SiteDef,
|
9
|
-
showHeader?: boolean,
|
10
|
-
chatbot?: boolean
|
11
|
-
}> = ({
|
12
|
-
children,
|
13
|
-
siteDef,
|
14
|
-
showHeader,
|
15
|
-
chatbot
|
16
|
-
}) => {
|
17
|
-
return (
|
18
|
-
<>
|
19
|
-
{showHeader && <Header
|
20
|
-
siteDef={siteDef}
|
21
|
-
/>}
|
22
|
-
{children}
|
23
|
-
</>
|
24
|
-
)
|
25
|
-
}
|
26
|
-
|
27
|
-
export default Guts
|