@luxfi/core 5.2.11 → 5.2.13

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.
Files changed (47) hide show
  1. package/commerce/ui/store.ts +0 -2
  2. package/components/back-button.tsx +1 -8
  3. package/components/commerce/checkout-panel/dt-checkout-panel.tsx +85 -0
  4. package/components/commerce/checkout-panel/index.tsx +19 -16
  5. package/components/commerce/checkout-panel/links-row.tsx +21 -0
  6. package/components/commerce/checkout-panel/mb-checkout-panel.tsx +55 -0
  7. package/components/commerce/desktop-nav-menu.tsx +71 -71
  8. package/components/commerce/drawer/micro.tsx +4 -4
  9. package/components/commerce/mobile-nav-menu-ai.tsx +1 -0
  10. package/components/copyright.tsx +3 -3
  11. package/components/icons/ai-chat-act.tsx +47 -0
  12. package/components/icons/blog-act.tsx +14 -0
  13. package/components/icons/bridge-act.tsx +18 -0
  14. package/components/icons/changelog-act.tsx +15 -0
  15. package/components/icons/coins-act.tsx +29 -0
  16. package/components/icons/compare-cards-act.tsx +30 -0
  17. package/components/icons/credit-act.tsx +29 -0
  18. package/components/icons/customer-support-act.tsx +27 -0
  19. package/components/icons/customers-act.tsx +65 -0
  20. package/components/icons/developer-docs-act.tsx +26 -0
  21. package/components/icons/exchange-act.tsx +27 -0
  22. package/components/icons/explorer-act.tsx +27 -0
  23. package/components/icons/faqs-act.tsx +27 -0
  24. package/components/icons/guides-act.tsx +26 -0
  25. package/components/icons/integrations-act.tsx +41 -0
  26. package/components/icons/launchsubnet-act.tsx +29 -0
  27. package/components/icons/lux-finance-act.tsx +34 -0
  28. package/components/icons/lux-pass-act.tsx +41 -0
  29. package/components/icons/lux-quests-act.tsx +15 -0
  30. package/components/icons/market-act.tsx +39 -0
  31. package/components/icons/more-benefits-act.tsx +29 -0
  32. package/components/icons/open-source-act.tsx +41 -0
  33. package/components/icons/safe-act.tsx +77 -0
  34. package/components/icons/shop-act.tsx +29 -0
  35. package/components/icons/templates-act.tsx +29 -0
  36. package/components/icons/validators-act.tsx +42 -0
  37. package/components/icons/view-all-card-act.tsx +28 -0
  38. package/components/icons/wallet-act.tsx +29 -0
  39. package/package.json +1 -1
  40. package/site-def/main-nav.tsx +96 -30
  41. package/style/lux-global.css +17 -0
  42. package/components/commerce/checkout-panel/cart-accordian.tsx +0 -66
  43. package/components/commerce/checkout-panel/checkout-panel-props.ts +0 -10
  44. package/components/commerce/checkout-panel/desktop-cp.tsx +0 -83
  45. package/components/commerce/checkout-panel/mobile-cp.tsx +0 -67
  46. package/components/commerce/checkout-panel/policy-links.tsx +0 -29
  47. /package/components/commerce/checkout-panel/{desktop-bag-carousel.tsx → dt-bag-carousel.tsx} +0 -0
@@ -35,6 +35,34 @@ import Wallet from '../components/icons/wallet'
35
35
  import Validators from '../components/icons/validators'
36
36
  import OpenSource from '../components/icons/open-source'
37
37
  import LuxPass from '../components/icons/lux-pass'
38
+ import CompareCardsAct from '../components/icons/compare-cards-act'
39
+ import ViewAllCardsAct from '../components/icons/view-all-card-act'
40
+ import MoreBenefitsAct from '../components/icons/more-benefits-act'
41
+ import AIChatAct from '../components/icons/ai-chat-act'
42
+ import ExchangeAct from '../components/icons/exchange-act'
43
+ import MarketAct from '../components/icons/market-act'
44
+ import ShopAct from '../components/icons/shop-act'
45
+ import CreditAct from '../components/icons/credit-act'
46
+ import LuxFinanceAct from '../components/icons/lux-finance-act'
47
+ import LuxQuestsAct from '../components/icons/lux-quests-act'
48
+ import BridgeAct from '../components/icons/bridge-act'
49
+ import ExplorerAct from '../components/icons/explorer-act'
50
+ import LaunchSubnetAct from '../components/icons/launchsubnet-act'
51
+ import CoinsAct from '../components/icons/coins-act'
52
+ import SafeAct from '../components/icons/safe-act'
53
+ import LuxWalletAct from '../components/icons/wallet-act'
54
+ import ValidatorsAct from '../components/icons/validators-act'
55
+ import DeveloperDocsAct from '../components/icons/developer-docs-act'
56
+ import OpenSourceAct from '../components/icons/open-source-act'
57
+ import LuxPassAct from '../components/icons/lux-pass-act'
58
+ import IntegrationAct from '../components/icons/integrations-act'
59
+ import TemplatesAct from '../components/icons/templates-act'
60
+ import CustomersAct from '../components/icons/customers-act'
61
+ import BlogAct from '../components/icons/blog-act'
62
+ import ChangeLogAct from '../components/icons/changelog-act'
63
+ import CustomerSupportAct from '../components/icons/customer-support-act'
64
+ import FAQsAct from '../components/icons/faqs-act'
65
+ import GuidesAct from '../components/icons/guides-act'
38
66
 
39
67
  export interface LinkDefExtended extends LinkDef {
40
68
  isAIMenu?: boolean
@@ -46,6 +74,7 @@ export interface LinkDefExtended extends LinkDef {
46
74
 
47
75
  export interface ChildMenu extends LinkDef{
48
76
  groupName?:string
77
+ icon_act?:any
49
78
  }
50
79
 
51
80
  export default [
@@ -67,6 +96,7 @@ export default [
67
96
  groupName:'Black Card',
68
97
  title: "Anodized Black Titanium",
69
98
  icon: <Anodized />,
99
+ icon_act: '',
70
100
  href: "https://lux.credit/cards/black?sku=LXM-CR-B-ABT",
71
101
  newTab: false,
72
102
  contents:"" //insert string to here
@@ -75,6 +105,7 @@ export default [
75
105
  groupName:'Black Card',
76
106
  title: "Black Gunmetal",
77
107
  icon: <GunMetal />,
108
+ icon_act: '',
78
109
  href: "https://lux.credit/cards/black?sku=LXM-CR-B-GM",
79
110
  newTab: false,
80
111
  contents:"" //insert string to here
@@ -83,6 +114,7 @@ export default [
83
114
  groupName:'Founder Card',
84
115
  title: "Cool Chrome",
85
116
  icon: <Chrome />,
117
+ icon_act: '',
86
118
  href: "https://lux.credit/cards/founder?sku=LXM-CR-F-CC",
87
119
  newTab: false,
88
120
  contents:"" //insert string to here
@@ -91,6 +123,7 @@ export default [
91
123
  groupName:'Founder Card',
92
124
  title: "Iridescent Chrome",
93
125
  icon: <Irradescent />,
126
+ icon_act: '',
94
127
  href: "https://lux.credit/cards/founder?sku=LXM-CR-F-IC",
95
128
  newTab: false,
96
129
  contents:"" //insert string to here
@@ -98,7 +131,8 @@ export default [
98
131
  {
99
132
  groupName:'Explore',
100
133
  title: "Compare cards",
101
- icon: <CompareCards width={25} height={25} className='outline outline-1 outline-muted-2 outline-offset-4 rounded-sm'/>,
134
+ icon: <CompareCards width={25} height={25} />,
135
+ icon_act: <CompareCardsAct width={27} height={27} />,
102
136
  href: "https://lux.credit/compare",
103
137
  newTab: false,
104
138
  contents:"Evaluate Lux cards"
@@ -106,7 +140,8 @@ export default [
106
140
  {
107
141
  groupName:'Explore',
108
142
  title: "View all cards",
109
- icon: <ViewAllCards width={25} height={25} className='outline outline-1 outline-muted-2 outline-offset-4 rounded-sm'/>,
143
+ icon: <ViewAllCards width={25} height={25} />,
144
+ icon_act: <ViewAllCardsAct width={25} height={25}/>,
110
145
  href: "https://lux.credit/cards",
111
146
  newTab: false,
112
147
  contents:"General overview"
@@ -114,7 +149,8 @@ export default [
114
149
  {
115
150
  groupName:'Explore',
116
151
  title: "More benefits",
117
- icon: <MoreBenefits width={25} height={25} className='outline outline-1 outline-muted-2 outline-offset-4 rounded-sm'/>,
152
+ icon: <MoreBenefits width={25} height={25} />,
153
+ icon_act: <MoreBenefitsAct width={27} height={27} />,
118
154
  href: "#",
119
155
  newTab: false,
120
156
  contents:"See what's truly unique"
@@ -123,6 +159,7 @@ export default [
123
159
  groupName:'Elite Card',
124
160
  title: "24k Gold",
125
161
  icon: <GoldCard />,
162
+ icon_act: "",
126
163
  href: "https://lux.credit/cards/elite?sku=LXM-CR-E-24G",
127
164
  newTab: false,
128
165
  contents:"" //insert string to here
@@ -131,6 +168,7 @@ export default [
131
168
  groupName:'Elite Card',
132
169
  title: "Sterling Silver",
133
170
  icon: <Sterling />,
171
+ icon_act: "",
134
172
  href: "https://lux.credit/cards/elite?sku=LXM-CR-E-SS",
135
173
  newTab: false,
136
174
  contents:"" //insert string to here
@@ -139,6 +177,7 @@ export default [
139
177
  groupName:'Sovereign Card',
140
178
  title: "Reflective Titanium",
141
179
  icon: <MirroredTitanium/>,
180
+ icon_act: "",
142
181
  href: "https://lux.credit/cards/sovereign?sku=LXM-CR-S-RT",
143
182
  newTab: false,
144
183
  contents:"" //insert string to here
@@ -155,7 +194,8 @@ export default [
155
194
  {
156
195
  groupName:'Blockchain',
157
196
  title: "AI Chat",
158
- icon: <AIChat width={25} height={25} className='outline outline-1 outline-muted-2 outline-offset-4 rounded-sm'/>,
197
+ icon: <AIChat width={25} height={25} />,
198
+ icon_act: <AIChatAct width={27} height={27}/>,
159
199
  href: "https://lux.chat",
160
200
  newTab: false,
161
201
  contents:"Ask anything, literally"
@@ -163,7 +203,8 @@ export default [
163
203
  {
164
204
  groupName:'Blockchain',
165
205
  title: "Exchange",
166
- icon: <Exchange width={25} height={25} className='outline outline-1 outline-muted-2 outline-offset-4 rounded-sm'/>,
206
+ icon: <Exchange width={25} height={25} />,
207
+ icon_act: <ExchangeAct width={27} height={27} />,
167
208
  href: "https://lux.exchange",
168
209
  newTab: false,
169
210
  contents:"Buy, sell, trade, swap..."
@@ -171,7 +212,8 @@ export default [
171
212
  {
172
213
  groupName:'Blockchain',
173
214
  title: "Market",
174
- icon: <Market width={25} height={25} className='outline outline-1 outline-muted-2 outline-offset-4 rounded-sm'/>,
215
+ icon: <Market width={25} height={25} />,
216
+ icon_act: <MarketAct width={27} height={27}/>,
175
217
  href: "https://lux.market",
176
218
  newTab: false,
177
219
  contents:"Digital collectibles & more"
@@ -179,7 +221,8 @@ export default [
179
221
  {
180
222
  groupName:'Blockchain',
181
223
  title: "Shop",
182
- icon: <Shop width={25} height={25} className='outline outline-1 outline-muted-2 outline-offset-4 rounded-sm'/>,
224
+ icon: <Shop width={25} height={25} />,
225
+ icon_act: <ShopAct width={27} height={27}/>,
183
226
  href: "https://lux.market",
184
227
  newTab: false,
185
228
  contents:"Find any Lux product for sale"
@@ -187,7 +230,8 @@ export default [
187
230
  {
188
231
  groupName:'Real World',
189
232
  title: "Credit",
190
- icon: <Credit width={25} height={25} className='outline outline-1 outline-muted-2 outline-offset-4 rounded-sm'/>,
233
+ icon: <Credit width={25} height={25} />,
234
+ icon_act: <CreditAct width={27} height={27}/>,
191
235
  href: "https://lux.credit",
192
236
  newTab: false,
193
237
  contents:"Risk free loans"
@@ -195,7 +239,8 @@ export default [
195
239
  {
196
240
  groupName:'Real World',
197
241
  title: "Lux Finance",
198
- icon: <LuxFinance width={25} height={25} className='outline outline-1 outline-muted-2 outline-offset-4 rounded-sm'/>,
242
+ icon: <LuxFinance width={25} height={25} />,
243
+ icon_act: <LuxFinanceAct width={27} height={27}/>,
199
244
  href: "https://lux.finance",
200
245
  newTab: false,
201
246
  contents:"Financial arbitrage"
@@ -203,7 +248,8 @@ export default [
203
248
  {
204
249
  groupName:'More',
205
250
  title: "Lux Quest",
206
- icon: <LuxQuests width={25} height={25} className='outline outline-1 outline-muted-2 outline-offset-4 rounded-sm'/>,
251
+ icon: <LuxQuests width={25} height={25} />,
252
+ icon_act: <LuxQuestsAct width={27} height={27}/>,
207
253
  href: "https://lux.quest",
208
254
  newTab: false,
209
255
  contents:"Go above and beyond"
@@ -220,7 +266,8 @@ export default [
220
266
  {
221
267
  groupName:'Defi Tools',
222
268
  title: "Bridge",
223
- icon: <Bridge width={25} height={25} className='outline outline-1 outline-muted-2 outline-offset-4 rounded-sm'/>,
269
+ icon: <Bridge width={25} height={25} />,
270
+ icon_act: <BridgeAct width={27} height={27}/>,
224
271
  href: "https://bridge.lux.network/",
225
272
  newTab: false,
226
273
  contents:"Teleport assets"
@@ -228,7 +275,8 @@ export default [
228
275
  {
229
276
  groupName:'Defi Tools',
230
277
  title: "Explorer",
231
- icon: <Explorer width={25} height={25} className='outline outline-1 outline-muted-2 outline-offset-4 rounded-sm'/>,
278
+ icon: <Explorer width={25} height={25} />,
279
+ icon_act: <ExplorerAct width={27} height={27}/>,
232
280
  href: "https://explorer.lux.network/",
233
281
  newTab: false,
234
282
  contents:"All transactions"
@@ -236,7 +284,8 @@ export default [
236
284
  {
237
285
  groupName:'Defi Tools',
238
286
  title: "Launch Subnet",
239
- icon: <LaunchSubnet width={25} height={25} className='outline outline-1 outline-muted-2 outline-offset-4 rounded-sm'/>,
287
+ icon: <LaunchSubnet width={25} height={25} />,
288
+ icon_act: <LaunchSubnetAct width={27} height={27}/>,
240
289
  href: "https://docs.lux.network/build/subnet/hello-subnet",
241
290
  newTab: false,
242
291
  contents:"Easy, free, and superior"
@@ -244,7 +293,8 @@ export default [
244
293
  {
245
294
  groupName:'Earn',
246
295
  title: "Coins",
247
- icon: <Coins width={25} height={25} className='outline outline-1 outline-muted-2 outline-offset-4 rounded-sm'/>,
296
+ icon: <Coins width={25} height={25} />,
297
+ icon_act: <CoinsAct width={27} height={27}/>,
248
298
  href: "https://lux.network/coin",
249
299
  newTab: false,
250
300
  contents:"Be part of the ecosystem"
@@ -252,7 +302,8 @@ export default [
252
302
  {
253
303
  groupName:'Earn',
254
304
  title: "Safe",
255
- icon: <Safe width={25} height={25} className='outline outline-1 outline-muted-2 outline-offset-4 rounded-sm'/>,
305
+ icon: <Safe width={25} height={25} />,
306
+ icon_act: <SafeAct width={27} height={27} />,
256
307
  href: "https://safe.lux.network",
257
308
  newTab: false,
258
309
  contents:"Multi-signature wallet"
@@ -260,7 +311,8 @@ export default [
260
311
  {
261
312
  groupName:'Earn',
262
313
  title: "Lux Wallet",
263
- icon: <Wallet width={25} height={25} className='outline outline-1 outline-muted-2 outline-offset-4 rounded-sm'/>,
314
+ icon: <Wallet width={25} height={25} />,
315
+ icon_act: <LuxWalletAct width={27} height={27}/>,
264
316
  href: "https://wallet.lux.network",
265
317
  newTab: false,
266
318
  contents:"Safe and quantum secure"
@@ -268,7 +320,8 @@ export default [
268
320
  {
269
321
  groupName:'Earn',
270
322
  title: "Validators",
271
- icon: <Validators width={25} height={25} className='outline outline-1 outline-muted-2 outline-offset-4 rounded-sm'/>,
323
+ icon: <Validators width={25} height={25} />,
324
+ icon_act: <ValidatorsAct width={27} height={27}/>,
272
325
  href: "https://lux.market/validator",
273
326
  newTab: false,
274
327
  contents:"Own a part of the network"
@@ -276,7 +329,8 @@ export default [
276
329
  {
277
330
  groupName:'Get Access',
278
331
  title: "Developer docs",
279
- icon: <DeveloperDocs width={25} height={25} className='outline outline-1 outline-muted-2 outline-offset-4 rounded-sm'/>,
332
+ icon: <DeveloperDocs width={25} height={25} />,
333
+ icon_act: <DeveloperDocsAct width={27} height={27}/>,
280
334
  href: "#",
281
335
  newTab: false,
282
336
  contents:"Software explained"
@@ -284,7 +338,8 @@ export default [
284
338
  {
285
339
  groupName:'Get Access',
286
340
  title: "Open Source",
287
- icon: <OpenSource width={25} height={25} className='outline outline-1 outline-muted-2 outline-offset-4 rounded-sm'/>,
341
+ icon: <OpenSource width={25} height={25} />,
342
+ icon_act: <OpenSourceAct width={27} height={27}/>,
288
343
  href: "#",
289
344
  newTab: false,
290
345
  contents:"Accessible for everyone"
@@ -292,7 +347,8 @@ export default [
292
347
  {
293
348
  groupName:'Get Access',
294
349
  title: "Lux Pass",
295
- icon: <LuxPass width={25} height={25} className='outline outline-1 outline-muted-2 outline-offset-4 rounded-sm'/>,
350
+ icon: <LuxPass width={25} height={25} />,
351
+ icon_act: <LuxPassAct width={27} height={27}/>,
296
352
  href: "#",
297
353
  newTab: false,
298
354
  contents:"All access pass to network"
@@ -309,7 +365,8 @@ export default [
309
365
  {
310
366
  groupName:'Tools',
311
367
  title: "Resource Center",
312
- icon: <AIChat width={25} height={25} className='outline outline-1 outline-muted-2 outline-offset-4 rounded-sm'/>,
368
+ icon: <AIChat width={25} height={25} />,
369
+ icon_act: <AIChatAct width={27} height={27}/>,
313
370
  href: "#",
314
371
  newTab: false,
315
372
  contents:"Dynamic solutions"
@@ -317,7 +374,8 @@ export default [
317
374
  {
318
375
  groupName:'Tools',
319
376
  title: "Integrations",
320
- icon: <Integration width={25} height={25} className='outline outline-1 outline-muted-2 outline-offset-4 rounded-sm'/>,
377
+ icon: <Integration width={25} height={25} />,
378
+ icon_act: <IntegrationAct width={27} height={27}/>,
321
379
  href: "#",
322
380
  newTab: false,
323
381
  contents:"Simplified onboarding"
@@ -325,7 +383,8 @@ export default [
325
383
  {
326
384
  groupName:'Tools',
327
385
  title: "Templates",
328
- icon: <Templates width={25} height={25} className='outline outline-1 outline-muted-2 outline-offset-4 rounded-sm'/>,
386
+ icon: <Templates width={25} height={25} />,
387
+ icon_act: <TemplatesAct width={27} height={27}/>,
329
388
  href: "#",
330
389
  newTab: false,
331
390
  contents:"Speedy app development"
@@ -333,7 +392,8 @@ export default [
333
392
  {
334
393
  groupName:'Tools',
335
394
  title: "Guides",
336
- icon: <Guides width={25} height={25} className='outline outline-1 outline-muted-2 outline-offset-4 rounded-sm'/>,
395
+ icon: <Guides width={25} height={25} />,
396
+ icon_act: <GuidesAct width={27} height={27}/>,
337
397
  href: "#",
338
398
  newTab: false,
339
399
  contents:"Find help quickly"
@@ -341,7 +401,8 @@ export default [
341
401
  {
342
402
  groupName:'Company',
343
403
  title: "Customers",
344
- icon: <Customers width={25} height={25} className='outline outline-1 outline-muted-2 outline-offset-4 rounded-sm'/>,
404
+ icon: <Customers width={25} height={25} />,
405
+ icon_act: <CustomersAct width={27} height={27}/>,
345
406
  href: "#",
346
407
  newTab: false,
347
408
  contents:"Trusted by the best teams"
@@ -349,7 +410,8 @@ export default [
349
410
  {
350
411
  groupName:'Company',
351
412
  title: "Blog",
352
- icon: <Blog width={25} height={25} className='outline outline-1 outline-muted-2 outline-offset-4 rounded-sm'/>,
413
+ icon: <Blog width={25} height={25} />,
414
+ icon_act: <BlogAct width={27} height={27}/>,
353
415
  href: "#",
354
416
  newTab: false,
355
417
  contents:"Latest posts and changes"
@@ -357,7 +419,8 @@ export default [
357
419
  {
358
420
  groupName:'Company',
359
421
  title: "Changelog",
360
- icon: <ChangeLog width={25} height={25} className='outline outline-1 outline-muted-2 outline-offset-4 rounded-sm'/>,
422
+ icon: <ChangeLog width={25} height={25} />,
423
+ icon_act: <ChangeLogAct width={27} height={27} />,
361
424
  href: "#",
362
425
  newTab: false,
363
426
  contents:"Manage deployments"
@@ -365,7 +428,8 @@ export default [
365
428
  {
366
429
  groupName:'More',
367
430
  title: "Developer docs",
368
- icon: <DeveloperDocs width={25} height={25} className='outline outline-1 outline-muted-2 outline-offset-4 rounded-sm'/>,
431
+ icon: <DeveloperDocs width={25} height={25} />,
432
+ icon_act: <DeveloperDocsAct width={25} height={25}/>,
369
433
  href: "#",
370
434
  newTab: false,
371
435
  contents:"Software explained"
@@ -373,7 +437,8 @@ export default [
373
437
  {
374
438
  groupName:'More',
375
439
  title: "Customer Support",
376
- icon: <CustomerSupport width={25} height={25} className='outline outline-1 outline-muted-2 outline-offset-4 rounded-sm'/>,
440
+ icon: <CustomerSupport width={25} height={25} />,
441
+ icon_act: <CustomerSupportAct width={27} height={27}/>,
377
442
  href: "#",
378
443
  newTab: false,
379
444
  contents:"Dedicated help, 24/7"
@@ -381,7 +446,8 @@ export default [
381
446
  {
382
447
  groupName:'More',
383
448
  title: "FAQs",
384
- icon: <FAQs width={25} height={25} className='outline outline-1 outline-muted-2 outline-offset-4 rounded-sm'/>,
449
+ icon: <FAQs width={25} height={25} />,
450
+ icon_act: <FAQsAct width={27} height={27}/>,
385
451
  href: "#",
386
452
  newTab: false,
387
453
  contents:"Common queries"
@@ -28,4 +28,21 @@ div.nextjs-toast-errors-parent[data-nextjs-toast="true"] {
28
28
  .sq-card-wrapper .sq-card-message {
29
29
  margin-top: 0 !important;
30
30
  margin-bottom: 0 !important;
31
+ }
32
+
33
+
34
+ .element-container:hover .icon-container-nor {
35
+ display: none;
36
+ }
37
+
38
+ .icon-container-hov {
39
+ display: none;
40
+ }
41
+
42
+ .element-container:hover .icon-container-hov {
43
+ display: block !important;
44
+ }
45
+
46
+ .element-container:hover .text-container {
47
+ background: transparent;
31
48
  }
@@ -1,66 +0,0 @@
1
- 'use client'
2
- import React from 'react'
3
- import { observer } from 'mobx-react-lite'
4
-
5
- import { ChevronRight } from 'lucide-react'
6
-
7
- import {
8
- Accordion,
9
- AccordionContent,
10
- AccordionItem,
11
- AccordionTrigger,
12
- } from '@hanzo/ui/primitives'
13
- import { cn } from '@hanzo/ui/util'
14
-
15
- import { useCommerce, CartPanel, formatCurrencyValue } from '@hanzo/commerce'
16
-
17
- const CartAccordian: React.FC<{
18
- icon?: React.ReactNode
19
- clx?: string
20
- triggerClx?: string
21
- panelClx?: string
22
- scrollAfter: number
23
- scrollHeightClx: string
24
- }> = observer(({
25
- icon,
26
- clx='',
27
- panelClx='',
28
- triggerClx='',
29
- scrollAfter,
30
- scrollHeightClx
31
- }) => {
32
- const cmmc = useCommerce()
33
- return (
34
- <Accordion type="single" collapsible className={clx}>
35
- <AccordionItem value="cart" className='w-full border-b-0'>
36
- <AccordionTrigger className={'!no-underline group flex justify-between '} headerClx={ triggerClx}>
37
- <div className='flex gap-0 items-center'>
38
- {icon}
39
- <h5 className='text-sm sm:text-xl grow'>
40
- <span className='group-data-[state=open]:hidden' >Order Total:</span>
41
- <span className='group-data-[state=closed]:hidden' >Your Order</span>
42
- </h5>
43
- </div>
44
- <div className='flex gap-1 items-center'>
45
- <h5 className='text-sm sm:text-xl grow truncate'>{formatCurrencyValue(cmmc.promoAppliedCartTotal)}</h5>
46
- <ChevronRight className="h-5 w-5 -mr-2 shrink-0 transition-transform duration-200 group-data-[state=open]:rotate-90" />
47
- </div>
48
- </AccordionTrigger>
49
- <AccordionContent className='data-[state=open]:mb-4'>
50
- <CartPanel
51
- className={cn('w-full', panelClx)}
52
- scrollAfter={scrollAfter}
53
- scrollHeightClx={scrollHeightClx}
54
- listClx='mt-0'
55
- itemClx='mt-0.5 mb-0'
56
- totalClx='sticky px-1 pr-2 border-t -bottom-[1px] bg-background'
57
- showShipping
58
- showPromoCode
59
- />
60
- </AccordionContent>
61
- </AccordionItem>
62
- </Accordion>
63
- )
64
- })
65
-
66
- export default CartAccordian
@@ -1,10 +0,0 @@
1
- interface CheckoutPanelProps {
2
- step: number
3
- stepNames: string[]
4
- onLeave:() => void
5
- clx?: string
6
- }
7
-
8
- export {
9
- type CheckoutPanelProps as default
10
- }
@@ -1,83 +0,0 @@
1
- 'use client'
2
- import React, { type PropsWithChildren } from 'react'
3
- import { observer } from 'mobx-react-lite'
4
-
5
- import { ScrollArea, StepIndicator } from '@hanzo/ui/primitives'
6
- import { AuthWidget } from '@hanzo/auth/components'
7
- import { CartPanel, useCommerce } from '@hanzo/commerce'
8
- import { cn } from '@hanzo/ui/util'
9
-
10
- import { BackButton, Logo, Tooltip } from '../..'
11
- import DesktopBagCarousel from './desktop-bag-carousel'
12
- import LinksRow from './policy-links'
13
- import type CheckoutPanelProps from './checkout-panel-props'
14
-
15
- const DesktopCheckoutPanel: React.FC<PropsWithChildren & CheckoutPanelProps> = observer(({
16
- step,
17
- stepNames,
18
- onLeave,
19
- clx='',
20
- children
21
- }) => {
22
-
23
- const cmmc = useCommerce()
24
- return (
25
- <div /* id='CHECKOUT_PANEL' */ className={cn('grid grid-cols-2', clx)}>
26
- <div key={1} className='w-full h-full bg-background flex flex-row items-start justify-end'>
27
- <div className='w-full h-full max-w-[750px] relative flex flex-col items-stretch justify-start px-8 pb-8'>
28
- <div key={1} className='h-[80px] grow-0 flex flex-row items-center z-10' >
29
- <Logo size='md' href='/' onClick={onLeave} variant='text-only' outerClx='logo-outer-tooltip-class' />
30
- <Tooltip select='.logo-outer-tooltip-class' text='home' position='right' offset={6}/>
31
- </div>
32
- <BackButton
33
- size='sm'
34
- clx={
35
- 'z-10 absolute top-14 left-6 !px-0 aspect-square ' +
36
- 'rounded-full hover:!bg-level-3 ' +
37
- 'back-button-tooltip-class '
38
- }
39
- onBack={onLeave}
40
- />
41
- <Tooltip select='.back-button-tooltip-class' text='back' position='right' offset={5}/>
42
- <div key={2} className={cn(
43
- 'w-full grow min-h-0 max-w-[550px] mx-auto flex flex-col gap-3',
44
- (cmmc.cartItems.length > 4 ? 'justify-between' : 'justify-start gap-10 pt-10')
45
- )}>
46
- <DesktopBagCarousel className='grow-0 h-[260px] w-[360px] lg:w-[420px] mx-auto -mt-8' constrainTo={{w: 250, h: 250}}/>
47
- <CartPanel
48
- className='w-full border-none p-0'
49
- itemClx='mb-2'
50
- totalClx='sticky bottom-0 bg-background'
51
- listClx='pr-3'
52
- scrollAfter={4}
53
- scrollHeightClx='min-h-[50vh] grow'
54
- showPromoCode
55
- showShipping
56
- selectItems
57
- />
58
- </div>
59
- </div>
60
- </div>
61
- <div key={2} className='w-full h-full flex flex-col bg-level-1 min-h-screen justify-between'>
62
- <ScrollArea className='w-full flex flex-row items-start justify-start overflow-y-auto'>
63
- <div className='h-full w-full max-w-[750px] relative flex flex-col items-center px-8 pt-0'>
64
- <div key={1} className='bg-level-1 sticky h-[80px] bg-[#aaaaff] w-full top-0 flex justify-center items-end'>
65
- <AuthWidget noLogin className='hidden md:flex absolute top-4 right-4 '/>
66
- <StepIndicator dotSizeRem={1.35} steps={stepNames} currentStep={step} className='gap-2 text-base w-pr-70' />
67
- </div>
68
- <div key={2} className='w-full max-w-[550px] mx-auto py-8'>
69
- {children}
70
- </div>
71
- </div>
72
- </ScrollArea>
73
- <div className='w-full max-w-[750px] relative flex flex-col items-center px-8 pt-0'>
74
- <div className='w-full max-w-[550px] mx-auto flex flex-col items-center'>
75
- <LinksRow clx='w-full' />
76
- </div>
77
- </div>
78
- </div>
79
- </div>
80
- )
81
- })
82
-
83
- export default DesktopCheckoutPanel
@@ -1,67 +0,0 @@
1
- 'use client'
2
- import React, { type PropsWithChildren } from 'react'
3
-
4
- import { StepIndicator } from '@hanzo/ui/primitives'
5
- import { cn } from '@hanzo/ui/util'
6
- import { AuthWidget } from '@hanzo/auth/components'
7
-
8
- import { BackButton, Logo } from '../..'
9
- import BagButton from '../bag-button'
10
- import PolicyLinks from './policy-links'
11
- import CartAccordian from './cart-accordian'
12
- import type CheckoutPanelProps from './checkout-panel-props'
13
-
14
-
15
- const MobileCheckoutPanel: React.FC<PropsWithChildren & CheckoutPanelProps> = ({
16
- step,
17
- stepNames,
18
- onLeave,
19
- clx='',
20
- children
21
- }) => (
22
-
23
- <div /* id='MOBILE_GRID' */ className={cn('bg-background flex flex-col justify-start px-4 pt-[101px]', clx)}>
24
- <div className='fixed z-11 top-0 h-[45px] w-full flex justify-between items-stretch bg-background'>
25
- <div className='flex items-stretch gap-1 grow-0'>
26
- <BackButton
27
- size='sm'
28
- clx={
29
- '-ml-5 !px-0 aspect-square h-full ' +
30
- 'rounded-full active:!bg-level-3 '
31
- }
32
- onBack={onLeave}
33
- />
34
- <Logo size='xs' variant='text-only' href='/' onClick={onLeave} outerClx='-ml-2'/>
35
- </div>
36
- <StepIndicator
37
- dotSizeRem={1}
38
- steps={stepNames}
39
- currentStep={step}
40
- className='relative grow mx-2 top-[14px] text-xs font-semibold w-full'
41
- />
42
-
43
- {/* 72px by observation (for centering). Need wrapper div since 'noLogin' returns null if no logged in user */}
44
- <div className='w-[72px] grow-0 shrink-0 flex items-center justify-center'><AuthWidget noLogin className=''/></div>
45
- </div>
46
- <CartAccordian
47
- icon={
48
- <BagButton
49
- animateOnHover={false}
50
- showIfEmpty
51
- size='sm'
52
- className='mr-1 relative w-5 h-6 sm:w-6 sm:h-7'
53
- iconClx='fill-foreground'
54
- />
55
- }
56
- clx='flex items-center justify-center w-full'
57
- triggerClx='bg-background fixed z-11 top-[45px] left-0 right-0 !m-0 px-4'
58
- panelClx='!py-0'
59
- scrollAfter={3}
60
- scrollHeightClx='h-[385px]'
61
- />
62
- {children}
63
- <PolicyLinks clx='mt-auto mb-3 pt-2' />
64
- </div>
65
- )
66
-
67
- export default MobileCheckoutPanel
@@ -1,29 +0,0 @@
1
- import React from 'react'
2
- import Link from 'next/link'
3
-
4
- import { Separator, buttonVariants } from '@hanzo/ui/primitives'
5
- import { cn } from '@hanzo/ui/util'
6
-
7
-
8
- const linkClx = buttonVariants({
9
- variant: 'linkMuted',
10
- size: 'link',
11
- rounded: 'none',
12
- })
13
-
14
- const PolicyLinks: React.FC<{
15
- clx?: string
16
- }> = ({
17
- clx=''
18
- }) => (
19
- <div className={cn('flex flex-col items-center', clx)}>
20
- <Separator/>
21
- <div className='flex gap-4 py-2 text-sm'>
22
- {/* TODO: add Refund policy and Privacy policy links */}
23
- <Link className={linkClx} href=''>refund policy</Link>
24
- <Link className={linkClx} href=''>privacy policy</Link>
25
- </div>
26
- </div>
27
- )
28
-
29
- export default PolicyLinks