@luxfi/core 4.3.15 → 4.3.18

Sign up to get free protection for your applications and to get access to all the features.
@@ -47,7 +47,7 @@ const BagButton: React.FC<{
47
47
  <div className={
48
48
  'z-above-content flex flex-col justify-center items-center ' +
49
49
  'absolute left-0 right-0 top-0 bottom-0 ' +
50
- 'leading-none font-sans font-bold text-primary-fg text-accent text-xs '
50
+ 'leading-none font-sans font-bold text-foreground text-xs '
51
51
  }>
52
52
  <div className='h-[3px] w-full' />
53
53
  <div>{c.cartQuantity}</div>
@@ -4,19 +4,22 @@ import React from 'react'
4
4
  import { cn } from '@hanzo/ui/util'
5
5
 
6
6
  import Logo from '../../logo'
7
+ import type { TShirtSize } from '@hanzo/ui/types'
7
8
 
8
9
  const CloseButton: React.FC<{
9
10
  close: () => void
11
+ size?: TShirtSize
10
12
  className?: string
11
13
  }> = ({
12
14
  close,
15
+ size,
13
16
  className=''
14
17
  }) => (
15
18
  <div
16
19
  onClick={close}
17
20
  className={cn('md:self-start', className)}
18
21
  >
19
- <Logo layout='text-only' href='/'/>
22
+ <Logo layout='text-only' href='/' size={size}/>
20
23
  </div>
21
24
  )
22
25
 
@@ -1,53 +1,67 @@
1
1
  'use client'
2
-
3
2
  import React, { type PropsWithChildren } from 'react'
4
3
 
5
- import { StepIndicator } from '@hanzo/ui/primitives'
6
- import { cn } from '@hanzo/ui/util'
4
+ import { ScrollArea, StepIndicator } from '@hanzo/ui/primitives'
5
+ import { AuthWidget } from '@hanzo/auth/components'
7
6
  import { CartPanel } from '@hanzo/commerce'
8
7
 
9
8
  import * as Icons from '../../icons'
10
9
  import DesktopBagCarousel from './dt-bag-carousel'
10
+ import CloseButton from './close-button'
11
+ import { cn } from '@hanzo/ui/util'
12
+ import LinksRow from './links-row'
11
13
 
12
14
  const DesktopCheckoutPanel: React.FC<PropsWithChildren & {
13
15
  index: number
14
16
  stepNames: string[]
17
+ close:() => void
15
18
  className?: string
16
19
  }> = ({
17
20
  index,
18
21
  stepNames,
22
+ close,
19
23
  className='',
20
24
  children
21
25
  }) => (
22
26
 
23
27
  <div /* id='CHECKOUT_PANEL' */ className={cn('grid grid-cols-2', className)}>
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>
28
+ <div className='w-full h-full bg-background flex flex-row items-start justify-end'>
29
+ <div className='w-full max-w-[750px] relative flex flex-col items-center justify-start p-8'>
30
+ <CloseButton close={close} size='md'/>
31
+ <div className='w-full max-w-[550px] mx-auto flex flex-col gap-3'>
32
+ <DesktopBagCarousel className='h-[260px] w-[360px] lg:w-[420px] mx-auto -mt-8' constrainTo={{w: 250, h: 250}}/>
33
+ <CartPanel
34
+ className='w-full border-none p-0'
35
+ itemClx='mb-3'
36
+ totalClx='sticky -bottom-1 p-1 bg-background'
37
+ listClx='pr-3'
38
+ scrollAfter={5}
39
+ scrollHeightClx='h-[50vh]'
40
+ showPromoCode
41
+ showShipping
42
+ />
43
+ </div>
28
44
  </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
45
  </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}
46
+ <div className='w-full h-full flex flex-col bg-level-1 min-h-screen justify-between'>
47
+ <ScrollArea className='w-full flex flex-row items-start justify-start overflow-y-auto'>
48
+ <div className='h-full w-full max-w-[750px] relative flex flex-col items-center px-8 pt-0'>
49
+ <div className='bg-level-1 sticky h-30 pb-8 w-full top-0 flex justify-center items-end'>
50
+ <AuthWidget noLogin className='hidden md:flex absolute top-4 right-4 '/>
51
+ <StepIndicator dotSizeRem={1.5} steps={stepNames} currentStep={index} className='gap-2 text-base w-pr-70' />
52
+ </div>
53
+ <div className='w-full max-w-[550px] mx-auto pb-10'>
54
+ {children}
55
+ </div>
56
+ </div>
57
+ </ScrollArea>
58
+ <div className='w-full max-w-[750px] relative flex flex-col items-center px-8 pt-0'>
59
+ <div className='w-full max-w-[550px] mx-auto flex flex-col items-center'>
60
+ <LinksRow className='w-full' />
61
+ </div>
62
+ </div>
49
63
  </div>
50
64
  </div>
51
65
  )
52
66
 
53
- export default DesktopCheckoutPanel
67
+ export default DesktopCheckoutPanel
@@ -30,8 +30,10 @@ 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
33
34
  className?: string
34
35
  }> = ({
36
+ close,
35
37
  className=''
36
38
  }) => {
37
39
 
@@ -72,6 +74,11 @@ const CheckoutPanel: React.FC<{
72
74
  }
73
75
  }
74
76
 
77
+ const _close = () => {
78
+ setStep('first')
79
+ close()
80
+ }
81
+
75
82
  // Determine if mobile or desktop based on visibility of desktopElement
76
83
  // https://stackoverflow.com/a/21696585/11378853
77
84
  const desktopElement = useRef<HTMLDivElement | null>(null)
@@ -90,11 +97,12 @@ const CheckoutPanel: React.FC<{
90
97
  }
91
98
  }, [])
92
99
 
93
- const StepToRender = STEPS[stepIndex].Comp
100
+ const StepToRender = STEPS[stepIndex].Comp
94
101
 
95
102
  return (<>
96
103
  <DesktopCP
97
- className={cn('h-full', className, 'hidden md:grid')}
104
+ className={cn('h-full', className, 'hidden md:flex')}
105
+ close={_close}
98
106
  index={stepIndex}
99
107
  stepNames={STEP_NAMES}
100
108
  >
@@ -104,6 +112,7 @@ const CheckoutPanel: React.FC<{
104
112
  </DesktopCP>
105
113
  <MobileCP
106
114
  className={cn('h-full overflow-y-auto', className, 'md:hidden' )}
115
+ close={_close}
107
116
  index={stepIndex}
108
117
  stepNames={STEP_NAMES}
109
118
  >
@@ -112,4 +121,4 @@ const CheckoutPanel: React.FC<{
112
121
  </>)
113
122
  }
114
123
 
115
- export default CheckoutPanel
124
+ export default CheckoutPanel
@@ -9,8 +9,8 @@ const LinksRow: React.FC<{
9
9
  className=''
10
10
  }) => (
11
11
  <div className={cn('flex flex-col', className)}>
12
- <Separator className='my-1'/>
13
- <div className='flex gap-4 text-sm'>
12
+ <Separator/>
13
+ <div className='flex gap-4 text-sm py-2'>
14
14
  {/* TODO: add Refund policy and Privacy policy links */}
15
15
  <Link href=''>Refund policy</Link>
16
16
  <Link href=''>Privacy policy</Link>
@@ -1,32 +1,34 @@
1
1
  'use client'
2
-
3
2
  import React, { type PropsWithChildren } from 'react'
4
3
 
4
+ import { StepIndicator } from '@hanzo/ui/primitives'
5
5
  import { cn } from '@hanzo/ui/util'
6
+ import { AuthWidget } from '@hanzo/auth/components'
6
7
  import { CartAccordian } from '@hanzo/commerce'
7
8
 
9
+ import CloseButton from './close-button'
8
10
  import BagButton from '../bag-button'
9
- import { StepIndicator } from '@hanzo/ui/primitives'
11
+ import LinksRow from './links-row'
10
12
 
11
13
  const MobileCheckoutPanel: React.FC<PropsWithChildren & {
12
14
  index: number
13
15
  stepNames: string[]
16
+ close:() => void
14
17
  className?: string
15
18
  }> = ({
16
19
  index,
17
20
  stepNames,
21
+ close,
18
22
  className='',
19
23
  children
20
24
  }) => (
21
25
 
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
- />
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} size='xs' />
29
+ {/* Need wrapper div since 'noLogin' returns null if no logged in user */}
30
+ <div className='w-10 h-10 flex items-center justify-center'><AuthWidget noLogin className=''/></div>
31
+ </div>
30
32
  <CartAccordian
31
33
  icon={
32
34
  <BagButton
@@ -38,10 +40,17 @@ const MobileCheckoutPanel: React.FC<PropsWithChildren & {
38
40
  iconClx='fill-foreground '
39
41
  />
40
42
  }
41
- className='flex items-center justify-center py-2 w-full'
43
+ className='flex items-center justify-center w-full'
44
+ />
45
+ <StepIndicator
46
+ dotSizeRem={1}
47
+ steps={stepNames}
48
+ currentStep={index}
49
+ className='text-xs font-semibold w-full pb-3'
42
50
  />
43
51
  {children}
52
+ <LinksRow className='mt-auto mb-3 pt-2' />
44
53
  </div>
45
54
  )
46
55
 
47
- export default MobileCheckoutPanel
56
+ export default MobileCheckoutPanel
@@ -57,7 +57,7 @@ const DesktopBagPopup: React.FC<{
57
57
  <CartPanel
58
58
  handleCheckout={() => {router.push('/checkout')}}
59
59
  className='mt-4 mb-4 border-none py-0 px-4'
60
- listClx='rounded-sm'
60
+ listClx='rounded-sm pr-3'
61
61
  scrollAfter={5}
62
62
  scrollHeightClx='h-[70vh]'
63
63
  itemClx='mt-3'
@@ -25,7 +25,7 @@ const MobileBagDrawer: React.FC<{
25
25
  <CartPanel
26
26
  handleCheckout={handleCheckout}
27
27
  className='mt-4 mb-4 border-none py-0 px-4 w-full '
28
- listClx='rounded-sm'
28
+ listClx='rounded-sm pr-3'
29
29
  scrollAfter={5}
30
30
  itemClx='mt-2'
31
31
  totalClx='sticky px-1 pr-2 border rounded-sm -bottom-[1px] bg-background'
@@ -2,8 +2,8 @@ import React from 'react'
2
2
  import { type LucideProps } from 'lucide-react'
3
3
 
4
4
  const BagIcon: React.FC<LucideProps> = (props: LucideProps) => (
5
- <svg fill="currentColor" viewBox='0 0 20 23' {...props}>
6
- <path fillRule="evenodd" d="M5 5a5 5 0 0 1 10 0v1h-2V5a3 3 0 1 0-6 0v1H5V5Zm0 1v4h2V6h6v4h2V6h3.5a1 1 0 0 1 1 1v15a1 1 0 0 1-1 1h-17a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1H5Z" clipRule="evenodd"/>
5
+ <svg fill="none" viewBox="0 0 15 18" {...props}>
6
+ <path d="m13.6501 5.19282h-2.3255v-.82146c0-2.01258-1.74959-3.634971-3.87568-3.634971s-3.87572 1.622401-3.87572 3.634971v.82146h-2.32543c-.31008 0-.553678.22588-.553678.51341v10.26827c0 .7393.642278 1.3349 1.439548 1.3349h10.63056c.7973 0 1.4395-.5956 1.4395-1.3349v-10.26827c0-.28753-.2436-.51341-.5536-.51341zm-8.96955-.84198c0-1.43756 1.24021-2.60814 2.76837-2.60814 1.52815 0 2.76838 1.17055 2.76838 2.60814v.82146h-5.53675zm8.08365 11.93176h-10.63056c-.1772 0-.3322-.1438-.3322-.3081v-9.75484h1.77176v2.83405c0 .28753.2436.51341.55367.51341.31008 0 .55368-.22588.55368-.51341v-2.83405h5.53675v2.83405c0 .28753.2436.51341.5537.51341.31 0 .5536-.22588.5536-.51341v-2.83405h1.7718v9.75484c0 .1643-.155.3081-.3322.3081z" fill="currentColor"/>
7
7
  </svg>
8
8
  )
9
9
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@luxfi/core",
3
- "version": "4.3.15",
3
+ "version": "4.3.18",
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/",
@@ -40,7 +40,7 @@
40
40
  },
41
41
  "dependencies": {
42
42
  "@hanzo/auth": "2.3.6",
43
- "@hanzo/commerce": "6.3.3",
43
+ "@hanzo/commerce": "6.3.4",
44
44
  "@hanzo/ui": "3.6.3",
45
45
  "@next/third-parties": "^14.1.0",
46
46
  "embla-carousel-autoplay": "^8.0.1",