@fluid-app/portal-sdk 0.1.35 → 0.1.37

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 (81) hide show
  1. package/dist/{ContactsScreen-eDQWCAQK.mjs → ContactsScreen-C9kEFGyO.mjs} +4 -4
  2. package/dist/{ContactsScreen-eDQWCAQK.mjs.map → ContactsScreen-C9kEFGyO.mjs.map} +1 -1
  3. package/dist/{ContactsScreen-BZSNw0uV.cjs → ContactsScreen-CSRNNY-u.cjs} +4 -4
  4. package/dist/{ContactsScreen-BZSNw0uV.cjs.map → ContactsScreen-CSRNNY-u.cjs.map} +1 -1
  5. package/dist/{ContactsScreen-XI4f7ix6.cjs → ContactsScreen-CYYOSb1o.cjs} +3 -3
  6. package/dist/{FluidProvider-BXxRdatZ.cjs → FluidProvider-D2VHDQOl.cjs} +23 -1
  7. package/dist/{FluidProvider-BXxRdatZ.cjs.map → FluidProvider-D2VHDQOl.cjs.map} +1 -1
  8. package/dist/{FluidProvider-CWC6LA9W.mjs → FluidProvider-S05cIFwO.mjs} +23 -1
  9. package/dist/FluidProvider-S05cIFwO.mjs.map +1 -0
  10. package/dist/{MessagingScreen-Df6yRSZ5.mjs → MessagingScreen-B5FFX0rk.mjs} +4 -4
  11. package/dist/{MessagingScreen-Df6yRSZ5.mjs.map → MessagingScreen-B5FFX0rk.mjs.map} +1 -1
  12. package/dist/{MessagingScreen-onjDz5S1.cjs → MessagingScreen-BVoTHaZo.cjs} +4 -4
  13. package/dist/{MessagingScreen-onjDz5S1.cjs.map → MessagingScreen-BVoTHaZo.cjs.map} +1 -1
  14. package/dist/{MessagingScreen-Dp3t7kpp.cjs → MessagingScreen-CbtZhxMa.cjs} +2 -2
  15. package/dist/{MessagingScreen-CXA3RIlu2.mjs → MessagingScreen-oclISkI22.mjs} +2 -2
  16. package/dist/{OrdersScreen-DTF-zAqR.mjs → OrdersScreen-C3U5o8Ix.mjs} +4 -4
  17. package/dist/{OrdersScreen-DTF-zAqR.mjs.map → OrdersScreen-C3U5o8Ix.mjs.map} +1 -1
  18. package/dist/{OrdersScreen-BeUKNA_f.cjs → OrdersScreen-CGUvJ3rO.cjs} +4 -4
  19. package/dist/{OrdersScreen-BeUKNA_f.cjs.map → OrdersScreen-CGUvJ3rO.cjs.map} +1 -1
  20. package/dist/{OrdersScreen-DJFlTTTO.cjs → OrdersScreen-D5ljtaRm.cjs} +3 -3
  21. package/dist/{ProductsScreen-CtGow3-U.mjs → ProductsScreen-BfPljupU.mjs} +4 -4
  22. package/dist/{ProductsScreen-CtGow3-U.mjs.map → ProductsScreen-BfPljupU.mjs.map} +1 -1
  23. package/dist/{ProductsScreen-UgEr2Y6M.cjs → ProductsScreen-CCrZS-7j.cjs} +3 -3
  24. package/dist/{ProductsScreen-CzbRJMF4.cjs → ProductsScreen-D3ySzLOk.cjs} +4 -4
  25. package/dist/{ProductsScreen-CzbRJMF4.cjs.map → ProductsScreen-D3ySzLOk.cjs.map} +1 -1
  26. package/dist/{ProductsScreen-CNz_p26B.mjs → ProductsScreen-DSmPPJfw.mjs} +3 -3
  27. package/dist/{ProfileScreen-DCFj7ETG.mjs → ProfileScreen-BFzPOFB1.mjs} +4 -4
  28. package/dist/{ProfileScreen-DCFj7ETG.mjs.map → ProfileScreen-BFzPOFB1.mjs.map} +1 -1
  29. package/dist/{ProfileScreen-CNOAZaoe.cjs → ProfileScreen-CqUT2-XX.cjs} +2 -2
  30. package/dist/{ProfileScreen-CzARNtFJ.cjs → ProfileScreen-T9Exf2DR.cjs} +4 -4
  31. package/dist/{ProfileScreen-CzARNtFJ.cjs.map → ProfileScreen-T9Exf2DR.cjs.map} +1 -1
  32. package/dist/{ShareablesScreen-w3DGRfIr.mjs → ShareablesScreen-Ce-wWJPW.mjs} +4 -4
  33. package/dist/{ShareablesScreen-w3DGRfIr.mjs.map → ShareablesScreen-Ce-wWJPW.mjs.map} +1 -1
  34. package/dist/{ShareablesScreen-Dofp37E4.mjs → ShareablesScreen-CjjnN7JR.mjs} +3 -3
  35. package/dist/{ShareablesScreen-cpwboVjB.cjs → ShareablesScreen-CoAe2YQx.cjs} +3 -3
  36. package/dist/{ShareablesScreen-DSJ7x0Ww.cjs → ShareablesScreen-TqfgVJm_.cjs} +4 -4
  37. package/dist/{ShareablesScreen-DSJ7x0Ww.cjs.map → ShareablesScreen-TqfgVJm_.cjs.map} +1 -1
  38. package/dist/{ShopScreen-vbGhD5GJ.cjs → ShopScreen-7G98Kb3F.cjs} +2 -2
  39. package/dist/{ShopScreen-ByjnSNho.cjs → ShopScreen-Cyq4ebDX.cjs} +4 -4
  40. package/dist/{ShopScreen-ByjnSNho.cjs.map → ShopScreen-Cyq4ebDX.cjs.map} +1 -1
  41. package/dist/{ShopScreen-BlyzHYeU.mjs → ShopScreen-DP4SvMCy.mjs} +4 -4
  42. package/dist/{ShopScreen-BlyzHYeU.mjs.map → ShopScreen-DP4SvMCy.mjs.map} +1 -1
  43. package/dist/{SubscriptionsScreen-BNjDelpe.cjs → SubscriptionsScreen-DMySArYf.cjs} +3 -3
  44. package/dist/{SubscriptionsScreen-DawiAb7q.cjs → SubscriptionsScreen-DvcrZaiR.cjs} +5 -5
  45. package/dist/SubscriptionsScreen-DvcrZaiR.cjs.map +1 -0
  46. package/dist/{SubscriptionsScreen-tUrUZ3VC.mjs → SubscriptionsScreen-PX_Ygilp.mjs} +5 -5
  47. package/dist/SubscriptionsScreen-PX_Ygilp.mjs.map +1 -0
  48. package/dist/index.cjs +30 -30
  49. package/dist/index.d.mts +1 -2
  50. package/dist/index.d.mts.map +1 -1
  51. package/dist/index.mjs +30 -30
  52. package/dist/{products-CBjo08FD.mjs → products--saBmlZw.mjs} +2 -2
  53. package/dist/{products-CBjo08FD.mjs.map → products--saBmlZw.mjs.map} +1 -1
  54. package/dist/{products-Q7fqnjYK.cjs → products-B-qICtJG.cjs} +2 -2
  55. package/dist/{products-Q7fqnjYK.cjs.map → products-B-qICtJG.cjs.map} +1 -1
  56. package/dist/{src-CsjWsZwA.cjs → src-BKkLa2oq.cjs} +4 -4
  57. package/dist/{src-CsjWsZwA.cjs.map → src-BKkLa2oq.cjs.map} +1 -1
  58. package/dist/{src-rgyT4GpO.mjs → src-CECPMmmx.mjs} +4 -4
  59. package/dist/{src-rgyT4GpO.mjs.map → src-CECPMmmx.mjs.map} +1 -1
  60. package/dist/{src-C2NjWMLg.mjs → src-CHFa-f0Q.mjs} +354 -342
  61. package/dist/src-CHFa-f0Q.mjs.map +1 -0
  62. package/dist/{src-B7JarYAL.cjs → src-DvDLW4sK.cjs} +353 -341
  63. package/dist/src-DvDLW4sK.cjs.map +1 -0
  64. package/dist/{use-account-clients-DAQe3cFz.mjs → use-account-clients-7RWjXPNu.mjs} +2 -2
  65. package/dist/{use-account-clients-DAQe3cFz.mjs.map → use-account-clients-7RWjXPNu.mjs.map} +1 -1
  66. package/dist/{use-account-clients-T32HqoLD.cjs → use-account-clients-YWHavlX7.cjs} +2 -2
  67. package/dist/{use-account-clients-T32HqoLD.cjs.map → use-account-clients-YWHavlX7.cjs.map} +1 -1
  68. package/dist/{use-customer-account-C1oG0PQ5.cjs → use-customer-account-BO2vTl2o.cjs} +2 -2
  69. package/dist/{use-customer-account-C1oG0PQ5.cjs.map → use-customer-account-BO2vTl2o.cjs.map} +1 -1
  70. package/dist/{use-customer-account-BV3IWOWw.mjs → use-customer-account-hnWIJ0oS.mjs} +2 -2
  71. package/dist/{use-customer-account-BV3IWOWw.mjs.map → use-customer-account-hnWIJ0oS.mjs.map} +1 -1
  72. package/dist/{use-fluid-api-CQIVrQCO.mjs → use-fluid-api-D8iCEtbP.mjs} +2 -2
  73. package/dist/{use-fluid-api-CQIVrQCO.mjs.map → use-fluid-api-D8iCEtbP.mjs.map} +1 -1
  74. package/dist/{use-fluid-api-B27mJ8gv.cjs → use-fluid-api-haPhtgOR.cjs} +2 -2
  75. package/dist/{use-fluid-api-B27mJ8gv.cjs.map → use-fluid-api-haPhtgOR.cjs.map} +1 -1
  76. package/package.json +10 -10
  77. package/dist/FluidProvider-CWC6LA9W.mjs.map +0 -1
  78. package/dist/SubscriptionsScreen-DawiAb7q.cjs.map +0 -1
  79. package/dist/SubscriptionsScreen-tUrUZ3VC.mjs.map +0 -1
  80. package/dist/src-B7JarYAL.cjs.map +0 -1
  81. package/dist/src-C2NjWMLg.mjs.map +0 -1
@@ -1,4 +1,4 @@
1
- import { b as Skeleton, dt as Card, ft as CardContent, k as Input, mt as CardTitle, pt as CardHeader, rn as cn } from "./src-S_xL86wk.mjs";
1
+ import { b as Skeleton, k as Input, rn as cn } from "./src-S_xL86wk.mjs";
2
2
  import { createContext, useCallback, useContext, useEffect, useState } from "react";
3
3
  import { useQuery } from "@tanstack/react-query";
4
4
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
@@ -516,53 +516,6 @@ function OrdersList({ customerId, onOrderClick, onSubscriptionClick, t, pageSize
516
516
  });
517
517
  }
518
518
  //#endregion
519
- //#region ../../orders/ui/src/components/section.tsx
520
- function Section({ title, children, footer }) {
521
- return /* @__PURE__ */ jsxs(Card, { children: [
522
- /* @__PURE__ */ jsx(CardHeader, { children: /* @__PURE__ */ jsx(CardTitle, { children: title }) }),
523
- /* @__PURE__ */ jsx(CardContent, { children }),
524
- footer && /* @__PURE__ */ jsx("div", {
525
- className: "px-6 pb-6",
526
- children: footer
527
- })
528
- ] });
529
- }
530
- //#endregion
531
- //#region ../../orders/ui/src/components/shipping-address-card.tsx
532
- function ShippingAddressCard({ name, address, title = "Shipping Address", className }) {
533
- return /* @__PURE__ */ jsxs(Card, {
534
- className,
535
- children: [/* @__PURE__ */ jsx(CardHeader, { children: /* @__PURE__ */ jsx(CardTitle, { children: title }) }), /* @__PURE__ */ jsx(CardContent, { children: !address ? /* @__PURE__ */ jsx("p", {
536
- className: "text-muted-foreground text-sm",
537
- children: "No shipping address available"
538
- }) : /* @__PURE__ */ jsxs("div", {
539
- className: "flex items-start gap-2",
540
- children: [/* @__PURE__ */ jsx(Truck, { className: "text-muted-foreground mt-0.5 mr-2 h-4 w-4 shrink-0" }), /* @__PURE__ */ jsxs("div", {
541
- className: "flex min-w-0 flex-1 flex-col",
542
- children: [
543
- name && /* @__PURE__ */ jsx("span", {
544
- className: "text-foreground min-w-0 truncate text-sm",
545
- title: name,
546
- children: name
547
- }),
548
- address.line1 && /* @__PURE__ */ jsx("span", {
549
- className: "text-muted-foreground text-sm",
550
- children: address.line1
551
- }),
552
- address.line2 && /* @__PURE__ */ jsx("span", {
553
- className: "text-muted-foreground text-sm",
554
- children: address.line2
555
- }),
556
- address.line3 && /* @__PURE__ */ jsx("span", {
557
- className: "text-muted-foreground text-sm",
558
- children: address.line3
559
- })
560
- ]
561
- })]
562
- }) })]
563
- });
564
- }
565
- //#endregion
566
519
  //#region ../../orders/ui/src/lib/format.ts
567
520
  function startCase(str) {
568
521
  if (!str) return "";
@@ -572,71 +525,6 @@ function formatCurrency(symbol, value) {
572
525
  return `${symbol}${Number(value).toFixed(2)}`;
573
526
  }
574
527
  //#endregion
575
- //#region ../../orders/ui/src/components/payment-method-card.tsx
576
- function capitalizeFirstLetter(str) {
577
- if (!str || str.length === 0) return "";
578
- return str.charAt(0).toUpperCase() + str.slice(1);
579
- }
580
- function PaymentDetails({ card }) {
581
- const paymentTitle = card.payment_title || (card.source ? startCase(card.source) : null);
582
- if (card.source === "card" || card.card_type) {
583
- const cardType = capitalizeFirstLetter(card.card_type || "Card");
584
- const lastFour = card.last_four_digits || "XXXX";
585
- return /* @__PURE__ */ jsx("div", {
586
- className: "flex w-full flex-row justify-between",
587
- children: /* @__PURE__ */ jsxs("div", {
588
- className: "flex flex-row items-center gap-2.5",
589
- children: [card.logo_url ? /* @__PURE__ */ jsx("img", {
590
- src: card.logo_url,
591
- alt: `${cardType} Logo`,
592
- className: "h-6 w-9 object-contain",
593
- width: 35,
594
- height: 24
595
- }) : /* @__PURE__ */ jsx("div", {
596
- className: "bg-muted text-muted-foreground flex h-6 w-9 items-center justify-center rounded text-xs",
597
- children: cardType.charAt(0)
598
- }), /* @__PURE__ */ jsxs("span", {
599
- className: "text-sm font-medium",
600
- children: [
601
- cardType,
602
- " * ",
603
- lastFour
604
- ]
605
- })]
606
- })
607
- });
608
- }
609
- const displayTitle = paymentTitle || "Payment Method";
610
- return /* @__PURE__ */ jsx("div", {
611
- className: "flex w-full flex-row justify-between",
612
- children: /* @__PURE__ */ jsxs("div", {
613
- className: "flex flex-row items-center gap-2.5",
614
- children: [card.logo_url ? /* @__PURE__ */ jsx("img", {
615
- src: card.logo_url,
616
- alt: `${displayTitle} Logo`,
617
- className: "h-6 w-9 object-contain",
618
- width: 35,
619
- height: 24
620
- }) : /* @__PURE__ */ jsx("div", {
621
- className: "flex h-6 w-9 items-center justify-center rounded bg-blue-100 text-xs font-medium text-blue-600 dark:bg-blue-900/30 dark:text-blue-400",
622
- children: displayTitle.charAt(0)
623
- }), /* @__PURE__ */ jsx("span", {
624
- className: "text-sm font-medium",
625
- children: displayTitle
626
- })]
627
- })
628
- });
629
- }
630
- function PaymentMethodCard({ paymentMethod, title = "Payment Method", className }) {
631
- return /* @__PURE__ */ jsxs(Card, {
632
- className,
633
- children: [/* @__PURE__ */ jsx(CardHeader, { children: /* @__PURE__ */ jsx(CardTitle, { children: title }) }), /* @__PURE__ */ jsx(CardContent, { children: paymentMethod ? /* @__PURE__ */ jsx(PaymentDetails, { card: paymentMethod }) : /* @__PURE__ */ jsx("p", {
634
- className: "text-muted-foreground text-sm",
635
- children: "No payment method"
636
- }) })]
637
- });
638
- }
639
- //#endregion
640
528
  //#region ../../orders/ui/src/components/order-status-badge.tsx
641
529
  const statusColorMap = {
642
530
  paid: "green",
@@ -663,231 +551,391 @@ function OrderStatusBadge({ status, className }) {
663
551
  }
664
552
  //#endregion
665
553
  //#region ../../orders/ui/src/components/order-detail.tsx
666
- function formatAddress(address) {
667
- return {
668
- line1: address.address1 ?? "",
669
- line2: [[address.city, address.state].filter(Boolean).join(", "), address.postal_code].filter(Boolean).join(" "),
670
- line3: address.country_code ?? ""
671
- };
672
- }
673
554
  function OrderDetailSkeleton() {
674
555
  return /* @__PURE__ */ jsxs("div", {
675
- className: "space-y-6",
676
- children: [/* @__PURE__ */ jsx(Skeleton, { className: "h-16 w-full rounded-lg" }), /* @__PURE__ */ jsxs("div", {
677
- className: "grid grid-cols-1 gap-6 lg:grid-cols-3",
678
- children: [/* @__PURE__ */ jsxs("div", {
679
- className: "space-y-6 lg:col-span-2",
680
- children: [/* @__PURE__ */ jsx(Skeleton, { className: "h-64 w-full rounded-lg" }), /* @__PURE__ */ jsx(Skeleton, { className: "h-48 w-full rounded-lg" })]
681
- }), /* @__PURE__ */ jsxs("div", {
682
- className: "space-y-6",
556
+ className: "flex flex-col lg:grid lg:grid-cols-8",
557
+ children: [/* @__PURE__ */ jsx("div", {
558
+ className: "bg-muted flex flex-col items-center px-8 lg:col-span-4",
559
+ children: /* @__PURE__ */ jsxs("div", {
560
+ className: "w-full max-w-lg py-6",
683
561
  children: [
684
- /* @__PURE__ */ jsx(Skeleton, { className: "h-32 w-full rounded-lg" }),
685
- /* @__PURE__ */ jsx(Skeleton, { className: "h-32 w-full rounded-lg" }),
686
- /* @__PURE__ */ jsx(Skeleton, { className: "h-32 w-full rounded-lg" })
562
+ /* @__PURE__ */ jsx(Skeleton, { className: "mb-4 h-6 w-48" }),
563
+ /* @__PURE__ */ jsx("div", {
564
+ className: "space-y-4",
565
+ children: /* @__PURE__ */ jsxs("div", {
566
+ className: "flex items-center space-x-4",
567
+ children: [/* @__PURE__ */ jsx(Skeleton, { className: "h-24 w-24 rounded" }), /* @__PURE__ */ jsxs("div", {
568
+ className: "flex-1 space-y-2",
569
+ children: [
570
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-3/4" }),
571
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-1/2" }),
572
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-1/4" })
573
+ ]
574
+ })]
575
+ })
576
+ }),
577
+ /* @__PURE__ */ jsxs("div", {
578
+ className: "mt-6 space-y-2",
579
+ children: [
580
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-full" }),
581
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-full" }),
582
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-full" }),
583
+ /* @__PURE__ */ jsx(Skeleton, { className: "h-5 w-full" })
584
+ ]
585
+ })
687
586
  ]
688
- })]
689
- })]
690
- });
691
- }
692
- function OrderItemRow({ item }) {
693
- return /* @__PURE__ */ jsxs("div", {
694
- className: "flex items-start gap-4 py-4 first:pt-0 last:pb-0",
695
- children: [
696
- item.image_url && /* @__PURE__ */ jsx("img", {
697
- src: item.image_url,
698
- alt: item.title,
699
- className: "h-16 w-16 flex-shrink-0 rounded-lg object-cover"
700
- }),
701
- /* @__PURE__ */ jsxs("div", {
702
- className: "min-w-0 flex-1",
587
+ })
588
+ }), /* @__PURE__ */ jsx("div", {
589
+ className: "bg-background px-8 pt-4 lg:col-span-4",
590
+ children: /* @__PURE__ */ jsxs("div", {
591
+ className: "mx-auto max-w-lg lg:mx-0 lg:mr-auto",
703
592
  children: [
704
- /* @__PURE__ */ jsx("p", {
705
- className: "text-foreground font-medium",
706
- children: item.title
707
- }),
708
- item.ordered_variant.length > 0 && /* @__PURE__ */ jsx("p", {
709
- className: "text-muted-foreground text-sm",
710
- children: item.ordered_variant.map((v) => v.value).join(" / ")
593
+ /* @__PURE__ */ jsx(Skeleton, { className: "mb-4 h-10 w-full rounded" }),
594
+ /* @__PURE__ */ jsxs("div", {
595
+ className: "mt-6 space-y-4",
596
+ children: [/* @__PURE__ */ jsx(Skeleton, { className: "h-5 w-40" }), /* @__PURE__ */ jsx(Skeleton, { className: "h-16 w-full rounded" })]
711
597
  }),
712
- item.sku && /* @__PURE__ */ jsxs("p", {
713
- className: "text-muted-foreground text-xs",
714
- children: ["SKU: ", item.sku]
598
+ /* @__PURE__ */ jsxs("div", {
599
+ className: "mt-6 space-y-4",
600
+ children: [/* @__PURE__ */ jsx(Skeleton, { className: "h-5 w-40" }), /* @__PURE__ */ jsx(Skeleton, { className: "h-16 w-full rounded" })]
715
601
  }),
716
- item.subscription && /* @__PURE__ */ jsx(StatusBadge, {
717
- color: "blue",
718
- size: "xs",
719
- className: "mt-1",
720
- children: "Subscription"
602
+ /* @__PURE__ */ jsxs("div", {
603
+ className: "mt-6 space-y-4",
604
+ children: [/* @__PURE__ */ jsx(Skeleton, { className: "h-5 w-40" }), /* @__PURE__ */ jsx(Skeleton, { className: "h-16 w-full rounded" })]
721
605
  })
722
606
  ]
723
- }),
724
- /* @__PURE__ */ jsxs("div", {
725
- className: "text-right text-sm",
726
- children: [/* @__PURE__ */ jsx("p", {
727
- className: "text-foreground font-medium",
607
+ })
608
+ })]
609
+ });
610
+ }
611
+ function OrderItemRow({ item }) {
612
+ return /* @__PURE__ */ jsxs("div", {
613
+ className: "flex items-center space-x-4 py-4",
614
+ children: [/* @__PURE__ */ jsxs("div", {
615
+ className: "relative shrink-0",
616
+ children: [/* @__PURE__ */ jsx("div", {
617
+ className: "bg-muted h-24 w-24 overflow-hidden rounded",
618
+ children: item.image_url ? /* @__PURE__ */ jsx("img", {
619
+ src: item.image_url,
620
+ alt: item.title,
621
+ width: 96,
622
+ height: 96,
623
+ className: "h-full w-full object-cover"
624
+ }) : /* @__PURE__ */ jsx("div", {
625
+ className: "text-muted-foreground flex h-full w-full items-center justify-center",
626
+ children: "No image"
627
+ })
628
+ }), item.quantity > 1 && /* @__PURE__ */ jsx("span", {
629
+ className: "bg-foreground text-background absolute -top-2 -right-2 z-10 flex h-6 w-6 items-center justify-center rounded-full text-xs font-medium",
630
+ children: item.quantity
631
+ })]
632
+ }), /* @__PURE__ */ jsxs("div", {
633
+ className: "flex min-w-0 flex-1 flex-col space-y-0.5",
634
+ children: [
635
+ /* @__PURE__ */ jsx("p", {
636
+ className: "text-foreground truncate text-sm font-medium",
637
+ title: item.title,
638
+ children: item.title
639
+ }),
640
+ item.ordered_variant.length > 0 && /* @__PURE__ */ jsx("p", {
641
+ className: "text-muted-foreground text-sm",
642
+ children: item.ordered_variant.map((v) => v.value).join(" / ")
643
+ }),
644
+ item.sku && /* @__PURE__ */ jsxs("p", {
645
+ className: "text-muted-foreground text-xs",
646
+ children: ["SKU: ", item.sku]
647
+ }),
648
+ item.subscription && /* @__PURE__ */ jsx(StatusBadge, {
649
+ color: "blue",
650
+ size: "xs",
651
+ className: "mt-1",
652
+ children: "Subscription"
653
+ }),
654
+ /* @__PURE__ */ jsx("p", {
655
+ className: "text-foreground text-sm font-medium",
728
656
  children: item.display_total
729
- }), item.quantity > 1 && /* @__PURE__ */ jsxs("p", {
730
- className: "text-muted-foreground",
657
+ }),
658
+ item.quantity > 1 && /* @__PURE__ */ jsxs("p", {
659
+ className: "text-muted-foreground text-xs",
731
660
  children: [
732
661
  item.display_price,
733
662
  " x ",
734
663
  item.quantity
735
664
  ]
736
- })]
737
- })
738
- ]
665
+ })
666
+ ]
667
+ })]
739
668
  });
740
669
  }
741
- function OrderPriceSummary({ order }) {
670
+ function OrderItemsSection({ order }) {
671
+ const visibleItems = order.items.filter((item) => item.display_to_customer !== false);
742
672
  const sym = order.currency_symbol || "$";
743
- return /* @__PURE__ */ jsx(Section, {
744
- title: "Summary",
745
- children: /* @__PURE__ */ jsxs("dl", {
746
- className: "space-y-2 text-sm",
673
+ return /* @__PURE__ */ jsx("section", {
674
+ className: "bg-muted flex w-full flex-col items-center px-8 lg:col-span-4",
675
+ children: /* @__PURE__ */ jsxs("div", {
676
+ className: "flex w-full max-w-lg flex-col",
747
677
  children: [
748
678
  /* @__PURE__ */ jsxs("div", {
749
- className: "flex justify-between",
750
- children: [/* @__PURE__ */ jsx("dt", {
751
- className: "text-muted-foreground",
752
- children: "Subtotal"
753
- }), /* @__PURE__ */ jsx("dd", {
754
- className: "text-foreground font-medium",
755
- children: order.sub_total_in_currency
756
- })]
679
+ className: "mt-4",
680
+ children: [/* @__PURE__ */ jsxs("h2", {
681
+ className: "text-foreground mb-2 text-lg font-medium",
682
+ children: [
683
+ "Items (",
684
+ visibleItems.length,
685
+ ")"
686
+ ]
687
+ }), /* @__PURE__ */ jsx("hr", { className: "border-border" })]
757
688
  }),
758
- Number(order.discount) > 0 && /* @__PURE__ */ jsxs("div", {
759
- className: "flex justify-between",
760
- children: [/* @__PURE__ */ jsxs("dt", {
761
- className: "text-muted-foreground",
762
- children: ["Discount", order.discount_codes?.length ? ` (${order.discount_codes.join(", ")})` : ""]
763
- }), /* @__PURE__ */ jsxs("dd", {
764
- className: "text-foreground font-medium",
765
- children: ["-", order.discount_in_currency]
766
- })]
689
+ /* @__PURE__ */ jsx("div", {
690
+ className: "divide-border divide-y",
691
+ children: visibleItems.map((item) => /* @__PURE__ */ jsx(OrderItemRow, { item }, item.id))
767
692
  }),
768
693
  /* @__PURE__ */ jsxs("div", {
769
- className: "flex justify-between",
770
- children: [/* @__PURE__ */ jsx("dt", {
771
- className: "text-muted-foreground",
772
- children: "Shipping"
773
- }), /* @__PURE__ */ jsx("dd", {
774
- className: "text-foreground font-medium",
775
- children: order.free_shipping ? "Free" : order.shipping_total_for_display
776
- })]
694
+ className: "border-border mb-4 border-t pt-4",
695
+ children: [
696
+ /* @__PURE__ */ jsxs("div", {
697
+ className: "flex justify-between text-sm",
698
+ children: [/* @__PURE__ */ jsx("p", {
699
+ className: "text-muted-foreground font-medium",
700
+ children: "Subtotal"
701
+ }), /* @__PURE__ */ jsx("p", {
702
+ className: "text-muted-foreground font-medium",
703
+ children: order.sub_total_in_currency
704
+ })]
705
+ }),
706
+ Number(order.discount) > 0 && /* @__PURE__ */ jsxs("div", {
707
+ className: "mt-2 flex justify-between text-sm",
708
+ children: [/* @__PURE__ */ jsxs("p", {
709
+ className: "text-muted-foreground font-medium",
710
+ children: ["Discount", order.discount_codes?.length ? ` (${order.discount_codes.join(", ")})` : ""]
711
+ }), /* @__PURE__ */ jsxs("p", {
712
+ className: "text-muted-foreground font-medium",
713
+ children: ["-", order.discount_in_currency]
714
+ })]
715
+ }),
716
+ /* @__PURE__ */ jsxs("div", {
717
+ className: "mt-2 flex justify-between text-sm",
718
+ children: [/* @__PURE__ */ jsx("p", {
719
+ className: "text-muted-foreground font-medium",
720
+ children: "Shipping"
721
+ }), /* @__PURE__ */ jsx("p", {
722
+ className: "text-muted-foreground font-medium",
723
+ children: order.free_shipping ? "Free" : order.shipping_total_for_display
724
+ })]
725
+ }),
726
+ /* @__PURE__ */ jsxs("div", {
727
+ className: "mt-2 flex justify-between text-sm",
728
+ children: [/* @__PURE__ */ jsxs("p", {
729
+ className: "text-muted-foreground font-medium",
730
+ children: ["Tax", order.price_inclusive_of_tax && order.price_inclusive_tax_name ? ` (${order.price_inclusive_tax_name}, included)` : ""]
731
+ }), /* @__PURE__ */ jsx("p", {
732
+ className: "text-muted-foreground font-medium",
733
+ children: order.tax_in_currency
734
+ })]
735
+ }),
736
+ order.points_applied_amount_in_currency != null && order.points_applied_amount_in_currency > 0 && /* @__PURE__ */ jsxs("div", {
737
+ className: "mt-2 flex justify-between text-sm",
738
+ children: [/* @__PURE__ */ jsx("p", {
739
+ className: "text-muted-foreground font-medium",
740
+ children: "Points Applied"
741
+ }), /* @__PURE__ */ jsx("p", {
742
+ className: "text-muted-foreground font-medium",
743
+ children: `-${formatCurrency(sym, order.points_applied_amount_in_currency)}`
744
+ })]
745
+ }),
746
+ /* @__PURE__ */ jsxs("div", {
747
+ className: "mt-4 flex items-center justify-between text-base font-medium",
748
+ children: [/* @__PURE__ */ jsx("p", {
749
+ className: "text-muted-foreground text-sm font-medium",
750
+ children: "Total"
751
+ }), /* @__PURE__ */ jsx("p", {
752
+ className: "text-foreground text-base font-bold",
753
+ children: order.total_in_currency
754
+ })]
755
+ })
756
+ ]
757
+ })
758
+ ]
759
+ })
760
+ });
761
+ }
762
+ function OrderDetailsSection({ order }) {
763
+ const paymentDetails = order.payment_details;
764
+ const cardDetails = paymentDetails?.details;
765
+ return /* @__PURE__ */ jsx("div", {
766
+ className: "bg-background px-8 pt-4 lg:col-span-4",
767
+ children: /* @__PURE__ */ jsxs("div", {
768
+ className: "mx-auto max-w-lg lg:mx-0 lg:mr-auto",
769
+ children: [
770
+ /* @__PURE__ */ jsx("div", {
771
+ className: "border-border mb-6 border-b pb-6",
772
+ children: /* @__PURE__ */ jsxs("div", {
773
+ className: "flex flex-wrap items-center gap-3",
774
+ children: [
775
+ /* @__PURE__ */ jsxs("div", {
776
+ className: "flex items-center gap-2",
777
+ children: [/* @__PURE__ */ jsx("span", {
778
+ className: "text-muted-foreground text-sm",
779
+ children: "Payment:"
780
+ }), /* @__PURE__ */ jsx(OrderStatusBadge, { status: order.payment_status })]
781
+ }),
782
+ /* @__PURE__ */ jsxs("div", {
783
+ className: "flex items-center gap-2",
784
+ children: [/* @__PURE__ */ jsx("span", {
785
+ className: "text-muted-foreground text-sm",
786
+ children: "Fulfillment:"
787
+ }), /* @__PURE__ */ jsx(OrderStatusBadge, { status: order.fulfillment_status })]
788
+ }),
789
+ /* @__PURE__ */ jsxs("div", {
790
+ className: "flex items-center gap-2",
791
+ children: [/* @__PURE__ */ jsx("span", {
792
+ className: "text-muted-foreground text-sm",
793
+ children: "Delivery:"
794
+ }), /* @__PURE__ */ jsx(OrderStatusBadge, { status: order.delivery_status })]
795
+ })
796
+ ]
797
+ })
777
798
  }),
778
799
  /* @__PURE__ */ jsxs("div", {
779
- className: "flex justify-between",
780
- children: [/* @__PURE__ */ jsxs("dt", {
781
- className: "text-muted-foreground",
782
- children: ["Tax", order.price_inclusive_of_tax && order.price_inclusive_tax_name ? ` (${order.price_inclusive_tax_name}, included)` : ""]
783
- }), /* @__PURE__ */ jsx("dd", {
784
- className: "text-foreground font-medium",
785
- children: order.tax_in_currency
800
+ className: "border-border mb-6 border-b pb-6",
801
+ children: [
802
+ /* @__PURE__ */ jsx("h3", {
803
+ className: "text-foreground mb-3 text-sm/6 font-semibold",
804
+ children: "Order Info"
805
+ }),
806
+ /* @__PURE__ */ jsxs("div", {
807
+ className: "divide-border flex divide-x",
808
+ children: [
809
+ /* @__PURE__ */ jsxs("div", {
810
+ className: "flex-1 pr-4",
811
+ children: [/* @__PURE__ */ jsx("div", {
812
+ className: "text-muted-foreground text-sm",
813
+ children: "Order Number"
814
+ }), /* @__PURE__ */ jsx("div", {
815
+ className: "text-foreground font-medium",
816
+ children: order.order_number
817
+ })]
818
+ }),
819
+ /* @__PURE__ */ jsxs("div", {
820
+ className: "flex-1 px-4",
821
+ children: [/* @__PURE__ */ jsx("div", {
822
+ className: "text-muted-foreground text-sm",
823
+ children: "Channel"
824
+ }), /* @__PURE__ */ jsx("div", {
825
+ className: "text-foreground font-medium",
826
+ children: startCase(order.channel)
827
+ })]
828
+ }),
829
+ /* @__PURE__ */ jsxs("div", {
830
+ className: "flex-1 pl-4 text-right",
831
+ children: [/* @__PURE__ */ jsx("div", {
832
+ className: "text-muted-foreground text-sm",
833
+ children: "Date"
834
+ }), /* @__PURE__ */ jsx("div", {
835
+ className: "text-foreground font-medium",
836
+ children: new Date(order.created_at).toLocaleDateString("en-US", {
837
+ year: "numeric",
838
+ month: "short",
839
+ day: "numeric"
840
+ })
841
+ })]
842
+ })
843
+ ]
844
+ }),
845
+ order.email && /* @__PURE__ */ jsxs("div", {
846
+ className: "mt-3",
847
+ children: [/* @__PURE__ */ jsx("div", {
848
+ className: "text-muted-foreground text-sm",
849
+ children: "Email"
850
+ }), /* @__PURE__ */ jsx("div", {
851
+ className: "text-foreground text-sm font-medium",
852
+ children: order.email
853
+ })]
854
+ })
855
+ ]
856
+ }),
857
+ paymentDetails && /* @__PURE__ */ jsxs("div", {
858
+ className: "border-border mb-6 border-b pb-4",
859
+ children: [/* @__PURE__ */ jsx("div", {
860
+ className: "text-muted-foreground mb-1 text-sm",
861
+ children: "Payment Method"
862
+ }), /* @__PURE__ */ jsxs("div", {
863
+ className: "text-foreground flex items-center gap-2 text-sm",
864
+ children: [cardDetails?.logo_url ? /* @__PURE__ */ jsx("img", {
865
+ src: cardDetails.logo_url,
866
+ alt: cardDetails.card_type ?? "Card",
867
+ className: "h-6 w-9 object-contain",
868
+ width: 35,
869
+ height: 24
870
+ }) : /* @__PURE__ */ jsx("div", {
871
+ className: "bg-muted text-muted-foreground flex h-6 w-9 items-center justify-center rounded text-xs",
872
+ children: (paymentDetails.payment_title || paymentDetails.payment_type || "P").charAt(0)
873
+ }), /* @__PURE__ */ jsxs("span", {
874
+ className: "font-medium",
875
+ children: [cardDetails?.card_type ? startCase(cardDetails.card_type) : paymentDetails.payment_title || startCase(paymentDetails.payment_type), cardDetails?.last_four ? ` ending in ${cardDetails.last_four}` : ""]
876
+ })]
786
877
  })]
787
878
  }),
788
- order.points_applied_amount_in_currency != null && order.points_applied_amount_in_currency > 0 && /* @__PURE__ */ jsxs("div", {
789
- className: "flex justify-between",
790
- children: [/* @__PURE__ */ jsx("dt", {
791
- className: "text-muted-foreground",
792
- children: "Points Applied"
793
- }), /* @__PURE__ */ jsxs("dd", {
794
- className: "text-foreground font-medium",
795
- children: ["-", formatCurrency(sym, order.points_applied_amount_in_currency)]
879
+ order.ship_to && /* @__PURE__ */ jsxs("div", {
880
+ className: "border-border mb-6 border-b pb-4",
881
+ children: [/* @__PURE__ */ jsx("div", {
882
+ className: "text-muted-foreground mb-1 text-sm",
883
+ children: "Shipping Address"
884
+ }), /* @__PURE__ */ jsxs("div", {
885
+ className: "text-foreground flex items-start gap-2 text-sm",
886
+ children: [/* @__PURE__ */ jsx(Truck, { className: "text-muted-foreground mt-0.5 mr-1 h-4 w-4 shrink-0" }), /* @__PURE__ */ jsxs("div", {
887
+ className: "flex flex-col",
888
+ children: [
889
+ order.ship_to.name && /* @__PURE__ */ jsx("span", {
890
+ className: "font-medium",
891
+ children: order.ship_to.name
892
+ }),
893
+ order.ship_to.address1 && /* @__PURE__ */ jsx("span", { children: order.ship_to.address1 }),
894
+ (order.ship_to.city || order.ship_to.state || order.ship_to.postal_code) && /* @__PURE__ */ jsx("span", { children: [[order.ship_to.city, order.ship_to.state].filter(Boolean).join(", "), order.ship_to.postal_code].filter(Boolean).join(" ") }),
895
+ order.ship_to.country_code && /* @__PURE__ */ jsx("span", { children: order.ship_to.country_code })
896
+ ]
897
+ })]
796
898
  })]
797
899
  }),
798
- /* @__PURE__ */ jsxs("div", {
799
- className: "border-border flex justify-between border-t pt-2",
800
- children: [/* @__PURE__ */ jsx("dt", {
801
- className: "text-foreground font-semibold",
802
- children: "Total"
803
- }), /* @__PURE__ */ jsx("dd", {
804
- className: "text-foreground font-semibold",
805
- children: order.total_in_currency
900
+ order.bill_to && /* @__PURE__ */ jsxs("div", {
901
+ className: "border-border mb-6 border-b pb-4",
902
+ children: [/* @__PURE__ */ jsx("div", {
903
+ className: "text-muted-foreground mb-1 text-sm",
904
+ children: "Billing Address"
905
+ }), /* @__PURE__ */ jsxs("div", {
906
+ className: "text-foreground text-sm",
907
+ children: [
908
+ order.bill_to.name && /* @__PURE__ */ jsx("p", {
909
+ className: "font-medium",
910
+ children: order.bill_to.name
911
+ }),
912
+ order.bill_to.address1 && /* @__PURE__ */ jsx("p", { children: order.bill_to.address1 }),
913
+ (order.bill_to.city || order.bill_to.state || order.bill_to.postal_code) && /* @__PURE__ */ jsx("p", { children: [[order.bill_to.city, order.bill_to.state].filter(Boolean).join(", "), order.bill_to.postal_code].filter(Boolean).join(" ") }),
914
+ order.bill_to.country_code && /* @__PURE__ */ jsx("p", { children: order.bill_to.country_code })
915
+ ]
806
916
  })]
917
+ }),
918
+ order.shipping_method && /* @__PURE__ */ jsxs("div", {
919
+ className: "border-border mb-6 border-b pb-4",
920
+ children: [
921
+ /* @__PURE__ */ jsx("div", {
922
+ className: "text-muted-foreground mb-1 text-sm",
923
+ children: "Shipping Method"
924
+ }),
925
+ /* @__PURE__ */ jsx("div", {
926
+ className: "text-foreground text-sm font-medium",
927
+ children: order.shipping_method.title
928
+ }),
929
+ order.shipping_method.delivery_time_estimate && /* @__PURE__ */ jsxs("div", {
930
+ className: "text-muted-foreground mt-1 text-xs",
931
+ children: ["Est. ", order.shipping_method.delivery_time_estimate]
932
+ })
933
+ ]
807
934
  })
808
935
  ]
809
936
  })
810
937
  });
811
938
  }
812
- function OrderStatusRow({ order }) {
813
- return /* @__PURE__ */ jsxs("div", {
814
- className: "border-border bg-card flex flex-wrap items-center gap-3 rounded-lg border p-6",
815
- children: [
816
- /* @__PURE__ */ jsxs("div", {
817
- className: "flex items-center gap-2",
818
- children: [/* @__PURE__ */ jsx("span", {
819
- className: "text-muted-foreground text-sm",
820
- children: "Payment:"
821
- }), /* @__PURE__ */ jsx(OrderStatusBadge, { status: order.payment_status })]
822
- }),
823
- /* @__PURE__ */ jsxs("div", {
824
- className: "flex items-center gap-2",
825
- children: [/* @__PURE__ */ jsx("span", {
826
- className: "text-muted-foreground text-sm",
827
- children: "Fulfillment:"
828
- }), /* @__PURE__ */ jsx(OrderStatusBadge, { status: order.fulfillment_status })]
829
- }),
830
- /* @__PURE__ */ jsxs("div", {
831
- className: "flex items-center gap-2",
832
- children: [/* @__PURE__ */ jsx("span", {
833
- className: "text-muted-foreground text-sm",
834
- children: "Delivery:"
835
- }), /* @__PURE__ */ jsx(OrderStatusBadge, { status: order.delivery_status })]
836
- }),
837
- /* @__PURE__ */ jsx("div", {
838
- className: "text-muted-foreground ml-auto text-sm",
839
- children: new Date(order.created_at).toLocaleDateString("en-US", {
840
- year: "numeric",
841
- month: "long",
842
- day: "numeric"
843
- })
844
- })
845
- ]
846
- });
847
- }
848
- function OrderInfoCard({ order }) {
849
- return /* @__PURE__ */ jsx(Section, {
850
- title: "Order Info",
851
- children: /* @__PURE__ */ jsxs("dl", {
852
- className: "space-y-2 text-sm",
853
- children: [
854
- /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("dt", {
855
- className: "text-muted-foreground",
856
- children: "Order Number"
857
- }), /* @__PURE__ */ jsx("dd", {
858
- className: "text-foreground font-medium",
859
- children: order.order_number
860
- })] }),
861
- /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("dt", {
862
- className: "text-muted-foreground",
863
- children: "Channel"
864
- }), /* @__PURE__ */ jsx("dd", {
865
- className: "text-foreground font-medium",
866
- children: startCase(order.channel)
867
- })] }),
868
- order.email && /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("dt", {
869
- className: "text-muted-foreground",
870
- children: "Email"
871
- }), /* @__PURE__ */ jsx("dd", {
872
- className: "text-foreground font-medium",
873
- children: order.email
874
- })] })
875
- ]
876
- })
877
- });
878
- }
879
- function ShippingMethodCard({ method }) {
880
- return /* @__PURE__ */ jsxs(Section, {
881
- title: "Shipping Method",
882
- children: [/* @__PURE__ */ jsx("p", {
883
- className: "text-muted-foreground text-sm",
884
- children: method.title
885
- }), method.delivery_time_estimate && /* @__PURE__ */ jsxs("p", {
886
- className: "text-muted-foreground mt-1 text-xs",
887
- children: ["Est. ", method.delivery_time_estimate]
888
- })]
889
- });
890
- }
891
939
  function OrderDetail({ token, onNotFound, onError }) {
892
940
  const { data, isLoading, error } = useOrder(token);
893
941
  const order = data?.order;
@@ -908,48 +956,12 @@ function OrderDetail({ token, onNotFound, onError }) {
908
956
  ]);
909
957
  if (isLoading) return /* @__PURE__ */ jsx(OrderDetailSkeleton, {});
910
958
  if (!order) return null;
911
- const visibleItems = order.items.filter((item) => item.display_to_customer !== false);
912
959
  return /* @__PURE__ */ jsxs("div", {
913
- className: "space-y-6",
914
- children: [/* @__PURE__ */ jsx(OrderStatusRow, { order }), /* @__PURE__ */ jsxs("div", {
915
- className: "grid grid-cols-1 gap-6 lg:grid-cols-3",
916
- children: [/* @__PURE__ */ jsxs("div", {
917
- className: "space-y-6 lg:col-span-2",
918
- children: [/* @__PURE__ */ jsx(Section, {
919
- title: `Items (${order.items_count})`,
920
- children: /* @__PURE__ */ jsx("div", {
921
- className: "divide-border divide-y",
922
- children: visibleItems.map((item) => /* @__PURE__ */ jsx(OrderItemRow, { item }, item.id))
923
- })
924
- }), /* @__PURE__ */ jsx(OrderPriceSummary, { order })]
925
- }), /* @__PURE__ */ jsxs("div", {
926
- className: "space-y-6",
927
- children: [
928
- order.payment_details && /* @__PURE__ */ jsx(PaymentMethodCard, { paymentMethod: {
929
- source: order.payment_details.payment_type,
930
- payment_title: order.payment_details.payment_title,
931
- logo_url: order.payment_details.details.logo_url,
932
- card_type: order.payment_details.details.card_type,
933
- last_four_digits: order.payment_details.details.last_four
934
- } }),
935
- order.ship_to && /* @__PURE__ */ jsx(ShippingAddressCard, {
936
- name: order.ship_to.name,
937
- address: formatAddress(order.ship_to),
938
- title: "Shipping Address"
939
- }),
940
- order.bill_to && /* @__PURE__ */ jsx(ShippingAddressCard, {
941
- name: order.bill_to.name,
942
- address: formatAddress(order.bill_to),
943
- title: "Billing Address"
944
- }),
945
- order.shipping_method && /* @__PURE__ */ jsx(ShippingMethodCard, { method: order.shipping_method }),
946
- /* @__PURE__ */ jsx(OrderInfoCard, { order })
947
- ]
948
- })]
949
- })]
960
+ className: "flex flex-col lg:grid lg:grid-cols-8",
961
+ children: [/* @__PURE__ */ jsx(OrderItemsSection, { order }), /* @__PURE__ */ jsx(OrderDetailsSection, { order })]
950
962
  });
951
963
  }
952
964
  //#endregion
953
965
  export { OrdersCoreProvider as a, PaginationFooter as i, OrdersList as n, TableColumn as r, OrderDetail as t };
954
966
 
955
- //# sourceMappingURL=src-C2NjWMLg.mjs.map
967
+ //# sourceMappingURL=src-CHFa-f0Q.mjs.map