@luxfi/core 4.3.11 → 4.3.13

Sign up to get free protection for your applications and to get access to all the features.
@@ -7,6 +7,7 @@ import { LoginPanel as Login } from '@hanzo/auth/components'
7
7
 
8
8
  import { Logo } from '..'
9
9
  import LuxLogo from '../icons/lux-logo'
10
+ import { legal } from '../../site-def/footer'
10
11
 
11
12
  const LoginPanel: React.FC<{
12
13
  close: () => void
@@ -21,6 +22,9 @@ const LoginPanel: React.FC<{
21
22
  className='',
22
23
  reviews
23
24
  }) => {
25
+ const termsOfServiceUrl = legal.find(({title}) => title === 'Terms and Conditions')?.href || ''
26
+ const privacyPolicyUrl = legal.find(({title}) => title === 'Privacy Policy')?.href || ''
27
+
24
28
  return (
25
29
  <div className={cn('grid grid-cols-1 md:grid-cols-2', className)}>
26
30
  <div className='hidden md:flex w-full h-full bg-level-1 flex-row items-end justify-end overflow-y-auto min-h-screen'>
@@ -62,13 +66,12 @@ const LoginPanel: React.FC<{
62
66
  >
63
67
  <LuxLogo className='w-5 h-5'/>
64
68
  </Button>
65
- {/* TODO: add Terms of Service and Privacy Policy links */}
66
69
  <Login
67
70
  getStartedUrl={getStartedUrl}
68
71
  redirectUrl={redirectUrl}
69
72
  className='w-full max-w-sm'
70
- termsOfServiceUrl=''
71
- privacyPolicyUrl=''
73
+ termsOfServiceUrl={termsOfServiceUrl}
74
+ privacyPolicyUrl={privacyPolicyUrl}
72
75
  />
73
76
  </div>
74
77
  </div>
@@ -1,66 +1,51 @@
1
1
  'use client'
2
+
2
3
  import React, { type PropsWithChildren } from 'react'
3
4
 
4
- import { ScrollArea } from '@hanzo/ui/primitives'
5
+ import { StepIndicator } from '@hanzo/ui/primitives'
5
6
  import { cn } from '@hanzo/ui/util'
6
- import { AuthWidget } from '@hanzo/auth/components'
7
7
  import { CartPanel } from '@hanzo/commerce'
8
8
 
9
9
  import * as Icons from '../../icons'
10
10
  import DesktopBagCarousel from './dt-bag-carousel'
11
- import CloseButton from './close-button'
12
- import LinksRow from './links-row'
13
- import StepsIndicator from './steps-indicator'
14
11
 
15
12
  const DesktopCheckoutPanel: React.FC<PropsWithChildren & {
16
13
  index: number
17
14
  stepNames: string[]
18
- close:() => void
19
15
  className?: string
20
16
  }> = ({
21
17
  index,
22
18
  stepNames,
23
- close,
24
19
  className='',
25
20
  children
26
21
  }) => (
27
22
 
28
23
  <div /* id='CHECKOUT_PANEL' */ className={cn('grid grid-cols-2', className)}>
29
- <ScrollArea className='w-full h-full bg-level-1 flex flex-row items-start overflow-y-auto min-h-screen'>
30
- <div className='h-full w-full flex justify-end'>
31
- <div className='h-full w-full max-w-[750px] px-8 pt-0'>
32
- <div className='h-full w-full max-w-[550px] mx-auto flex flex-col gap-3 justify-end min-h-screen'>
33
- <div className='flex flex-col gap-3 h-30 justify-center'>
34
- <CloseButton close={close} />
35
- <StepsIndicator currentStep={index} stepNames={stepNames}/>
36
- </div>
37
- {children}
38
- <LinksRow className='mt-auto mb-3' />
39
- </div>
40
- </div>
41
- </div>
42
- </ScrollArea>
43
- <div className='w-full h-full bg-background flex flex-row items-start justify-start'>
44
- <div className='w-full max-w-[750px] relative flex flex-col items-center justify-start px-8 pt-0'>
45
- <AuthWidget noLogin className='hidden md:flex absolute top-4 right-4 '/>
46
- <div className='flex items-center justify-center h-30'>
47
- <Icons.bag className='fill-foreground mr-2 relative -top-1 w-6 h-7'/>
48
- <p className='font-heading text-default'>Order Summary</p>
49
- </div>
50
- <div className='w-full max-w-[550px] mx-auto'>
51
- <DesktopBagCarousel className='h-[260px] w-[360px] lg:w-[420px] mx-auto -mt-8' constrainTo={{w: 250, h: 250}}/>
52
- <CartPanel
53
- className='w-full border-none p-0 pr-3'
54
- itemClx='mb-3'
55
- totalClx='sticky bottom-0 p-1 bg-background'
56
- scrollAfter={5}
57
- scrollHeightClx='h-[50vh]'
58
- selectItems
59
- showPromoCode
60
- showShipping
61
- />
62
- </div>
24
+ <div className='w-full h-full flex flex-col items-center py-8 px-10'>
25
+ <div className='flex items-center justify-center pt-2'>
26
+ <Icons.bag className='fill-foreground mr-2 relative -top-1 w-6 h-7'/>
27
+ <p className='font-heading text-default'>Order Summary</p>
63
28
  </div>
29
+ <DesktopBagCarousel className='mx-auto' constrainTo={{w: 250, h: 250}}/>
30
+ <CartPanel
31
+ className='w-full border-none p-0 pr-3'
32
+ itemClx='mb-3'
33
+ totalClx='sticky -bottom-1 p-1 bg-background'
34
+ scrollAfter={5}
35
+ scrollHeightClx='h-[45vh]'
36
+ selectItems
37
+ showPromoCode
38
+ showShipping
39
+ />
40
+ </div>
41
+ <div className='w-full h-full flex flex-col gap-3 min-h-screen items-center py-8 px-10 bg-level-1'>
42
+ <StepIndicator
43
+ dotSizeRem={1.2}
44
+ steps={stepNames}
45
+ currentStep={index}
46
+ className='gap-2 text-sm w-pr-70'
47
+ />
48
+ {children}
64
49
  </div>
65
50
  </div>
66
51
  )
@@ -30,10 +30,8 @@ import DesktopCP from './dt-checkout-panel'
30
30
  import MobileCP from './mb-checkout-panel'
31
31
 
32
32
  const CheckoutPanel: React.FC<{
33
- close: () => void
34
33
  className?: string
35
34
  }> = ({
36
- close,
37
35
  className=''
38
36
  }) => {
39
37
 
@@ -74,11 +72,6 @@ const CheckoutPanel: React.FC<{
74
72
  }
75
73
  }
76
74
 
77
- const _close = () => {
78
- setStep('first')
79
- close()
80
- }
81
-
82
75
  // Determine if mobile or desktop based on visibility of desktopElement
83
76
  // https://stackoverflow.com/a/21696585/11378853
84
77
  const desktopElement = useRef<HTMLDivElement | null>(null)
@@ -101,8 +94,7 @@ const CheckoutPanel: React.FC<{
101
94
 
102
95
  return (<>
103
96
  <DesktopCP
104
- className={cn('h-full', className, 'hidden md:flex')}
105
- close={_close}
97
+ className={cn('h-full', className, 'hidden md:grid')}
106
98
  index={stepIndex}
107
99
  stepNames={STEP_NAMES}
108
100
  >
@@ -112,7 +104,6 @@ const CheckoutPanel: React.FC<{
112
104
  </DesktopCP>
113
105
  <MobileCP
114
106
  className={cn('h-full overflow-y-auto', className, 'md:hidden' )}
115
- close={_close}
116
107
  index={stepIndex}
117
108
  stepNames={STEP_NAMES}
118
109
  >
@@ -1,35 +1,32 @@
1
1
  'use client'
2
+
2
3
  import React, { type PropsWithChildren } from 'react'
3
4
 
4
5
  import { cn } from '@hanzo/ui/util'
5
- import { AuthWidget } from '@hanzo/auth/components'
6
6
  import { CartAccordian } from '@hanzo/commerce'
7
7
 
8
- import CloseButton from './close-button'
9
8
  import BagButton from '../bag-button'
10
- import LinksRow from './links-row'
11
- import StepsIndicator from './steps-indicator'
9
+ import { StepIndicator } from '@hanzo/ui/primitives'
12
10
 
13
11
  const MobileCheckoutPanel: React.FC<PropsWithChildren & {
14
12
  index: number
15
13
  stepNames: string[]
16
- close:() => void
17
14
  className?: string
18
15
  }> = ({
19
16
  index,
20
17
  stepNames,
21
- close,
22
18
  className='',
23
19
  children
24
20
  }) => (
25
21
 
26
- <div /* id='MOBILE_GRID' */ className={cn('bg-background flex flex-col justify-start px-4', className)}>
27
- <div className='sticky top-0 w-full flex flex-row justify-between items-center bg-background'>
28
- <CloseButton close={close} />
29
- <StepsIndicator currentStep={index} stepNames={stepNames}/>
30
- {/* Need wrapper div since 'noLogin' returns null if no logged in user */}
31
- <div className='w-10 h-10 flex items-center justify-center'><AuthWidget noLogin className=''/></div>
32
- </div>
22
+ <div /* id='MOBILE_GRID' */ className={cn('flex flex-col items-center justify-start px-4 pt-11', className)}>
23
+ <StepIndicator
24
+ dotSizeRem={0.8}
25
+ steps={stepNames}
26
+ currentStep={index}
27
+ className='text-xs w-full'
28
+ muted
29
+ />
33
30
  <CartAccordian
34
31
  icon={
35
32
  <BagButton
@@ -44,7 +41,6 @@ const MobileCheckoutPanel: React.FC<PropsWithChildren & {
44
41
  className='flex items-center justify-center py-2 w-full'
45
42
  />
46
43
  {children}
47
- <LinksRow className='mt-auto mb-3 pt-2' />
48
44
  </div>
49
45
  )
50
46
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@luxfi/core",
3
- "version": "4.3.11",
3
+ "version": "4.3.13",
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/",
@@ -19,7 +19,7 @@
19
19
  "luxdefi"
20
20
  ],
21
21
  "scripts": {
22
- "lat": "npm show @luxfi/common version",
22
+ "lat": "npm show @luxfi/core version",
23
23
  "pub": "npm publish",
24
24
  "build": "tsc",
25
25
  "tc": "tsc",
@@ -39,8 +39,8 @@
39
39
  "./conf": "./conf/index.ts"
40
40
  },
41
41
  "dependencies": {
42
- "@hanzo/auth": "2.3.5",
43
- "@hanzo/commerce": "6.3.2",
42
+ "@hanzo/auth": "2.3.6",
43
+ "@hanzo/commerce": "6.3.3",
44
44
  "@hanzo/ui": "3.6.3",
45
45
  "@next/third-parties": "^14.1.0",
46
46
  "embla-carousel-autoplay": "^8.0.1",
@@ -3,12 +3,12 @@ import type { LinkDef } from '@hanzo/ui/types'
3
3
  const legal: LinkDef[] = [
4
4
  {
5
5
  title: 'Terms and Conditions',
6
- href: '/terms',
6
+ href: 'https://docs.google.com/document/d/1mvkjr1w8Rv8ttirs1mu-_2fw_PXclOyS/preview',
7
7
  newTab: true,
8
8
  },
9
9
  {
10
10
  title: 'Privacy Policy',
11
- href: '/privacy',
11
+ href: 'https://docs.google.com/document/d/1vZjOKaNdOoThDIaVLERWxflQLtOsuvLn/preview',
12
12
  newTab: true,
13
13
  },
14
14
  ]