@loczer/storefront-sdk 0.237.0 → 0.238.0

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 (27) hide show
  1. package/dist/components/Layout/index.d.ts.map +1 -1
  2. package/dist/components/Layout/index.js +38 -26
  3. package/dist/components/StorefrontCartPanel/index.d.ts +2 -1
  4. package/dist/components/StorefrontCartPanel/index.d.ts.map +1 -1
  5. package/dist/components/StorefrontCartPanel/index.js +24 -24
  6. package/dist/components/WhatsAppFloatingButton/WhatsAppFloatingButton.d.ts +4 -2
  7. package/dist/components/WhatsAppFloatingButton/WhatsAppFloatingButton.d.ts.map +1 -1
  8. package/dist/components/WhatsAppFloatingButton/WhatsAppFloatingButton.js +8 -8
  9. package/dist/i18n/en.d.ts +3 -0
  10. package/dist/i18n/en.d.ts.map +1 -1
  11. package/dist/i18n/en.js +3 -0
  12. package/dist/i18n/fr.d.ts +3 -0
  13. package/dist/i18n/fr.d.ts.map +1 -1
  14. package/dist/i18n/fr.js +3 -0
  15. package/dist/index.d.ts +12 -3
  16. package/dist/pages/CheckoutPage.d.ts.map +1 -1
  17. package/dist/pages/CheckoutPage.js +198 -184
  18. package/dist/pages/checkout/components/CheckoutLoadingSkeleton.d.ts.map +1 -1
  19. package/dist/pages/checkout/components/CheckoutLoadingSkeleton.js +10 -6
  20. package/dist/pages/checkout/components/CheckoutMobileSummaryDrawer.d.ts +13 -0
  21. package/dist/pages/checkout/components/CheckoutMobileSummaryDrawer.d.ts.map +1 -0
  22. package/dist/pages/checkout/components/CheckoutMobileSummaryDrawer.js +95 -0
  23. package/dist/pages/checkout/components/CheckoutSummaryColumn.d.ts +4 -1
  24. package/dist/pages/checkout/components/CheckoutSummaryColumn.d.ts.map +1 -1
  25. package/dist/pages/checkout/components/CheckoutSummaryColumn.js +22 -20
  26. package/dist/storefront.css +1 -1
  27. package/package.json +1 -1
@@ -0,0 +1,13 @@
1
+ import { ReactNode } from 'react';
2
+ type CheckoutMobileSummaryDrawerProps = {
3
+ canSubmit: boolean;
4
+ children: ReactNode;
5
+ compactSubmitLabel: string;
6
+ itemCount: number;
7
+ onSubmit: () => void;
8
+ submitLabel: string;
9
+ totalLabel: string;
10
+ };
11
+ export declare function CheckoutMobileSummaryDrawer({ canSubmit, children, compactSubmitLabel, itemCount, onSubmit, submitLabel, totalLabel, }: CheckoutMobileSummaryDrawerProps): import("react/jsx-runtime").JSX.Element;
12
+ export {};
13
+ //# sourceMappingURL=CheckoutMobileSummaryDrawer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CheckoutMobileSummaryDrawer.d.ts","sourceRoot":"","sources":["../../../../src/pages/checkout/components/CheckoutMobileSummaryDrawer.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAuB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAiB3D,KAAK,gCAAgC,GAAG;IACtC,SAAS,EAAE,OAAO,CAAA;IAClB,QAAQ,EAAE,SAAS,CAAA;IACnB,kBAAkB,EAAE,MAAM,CAAA;IAC1B,SAAS,EAAE,MAAM,CAAA;IACjB,QAAQ,EAAE,MAAM,IAAI,CAAA;IACpB,WAAW,EAAE,MAAM,CAAA;IACnB,UAAU,EAAE,MAAM,CAAA;CACnB,CAAA;AAED,wBAAgB,2BAA2B,CAAC,EAC1C,SAAS,EACT,QAAQ,EACR,kBAAkB,EAClB,SAAS,EACT,QAAQ,EACR,WAAW,EACX,UAAU,GACX,EAAE,gCAAgC,2CAuFlC"}
@@ -0,0 +1,95 @@
1
+ import { Button as e } from "../../../ui/button.js";
2
+ import { Drawer as t, DrawerContent as n, DrawerFooter as r, DrawerHeader as i, DrawerTitle as a, DrawerTrigger as o } from "../../../ui/drawer.js";
3
+ import { useEffect as s, useState as c } from "react";
4
+ import { jsx as l, jsxs as u } from "react/jsx-runtime";
5
+ import { useMediaQuery as d } from "@rpcbase/client";
6
+ import { useTranslation as f } from "react-i18next";
7
+ import { toast as p } from "sonner";
8
+ import { ShoppingCart as m } from "lucide-react";
9
+ //#region src/pages/checkout/components/CheckoutMobileSummaryDrawer.tsx
10
+ function h({ canSubmit: h, children: g, compactSubmitLabel: _, itemCount: v, onSubmit: y, submitLabel: b, totalLabel: x }) {
11
+ let { t: S } = f(), [C, w] = c(!1), T = d("(min-width: 64rem)");
12
+ return s(() => {
13
+ T && w(!1);
14
+ }, [T]), /* @__PURE__ */ l("div", {
15
+ className: "lg:hidden",
16
+ children: /* @__PURE__ */ u(t, {
17
+ open: C && !T,
18
+ onOpenChange: (e) => {
19
+ e && p.dismiss(), w(e);
20
+ },
21
+ children: [/* @__PURE__ */ u("div", {
22
+ className: "fixed inset-x-0 bottom-0 z-40 flex gap-2 border-t border-slate-200/80 bg-white/95 p-3 pb-[calc(0.75rem+env(safe-area-inset-bottom))] shadow-[0_-12px_30px_-22px_rgba(15,23,42,0.45)] backdrop-blur-lg",
23
+ "data-testid": "checkout-mobile-action-bar",
24
+ children: [/* @__PURE__ */ l(o, {
25
+ asChild: !0,
26
+ children: /* @__PURE__ */ l(e, {
27
+ type: "button",
28
+ variant: "outline",
29
+ className: "h-12 min-w-0 flex-1 border-primary/20 px-3 text-primary hover:bg-primary/5 hover:text-primary",
30
+ "aria-label": S("checkout_mobile_summary_button", { count: v }),
31
+ "data-testid": "checkout-mobile-summary-trigger",
32
+ children: /* @__PURE__ */ u("span", {
33
+ className: "flex w-full min-w-0 items-center justify-between gap-2",
34
+ children: [/* @__PURE__ */ u("span", {
35
+ className: "flex shrink-0 items-center gap-2",
36
+ children: [/* @__PURE__ */ l(m, {
37
+ className: "size-4",
38
+ "aria-hidden": "true"
39
+ }), /* @__PURE__ */ l("span", {
40
+ className: "inline-flex min-w-5 items-center justify-center rounded-full bg-primary/10 px-1.5 py-0.5 text-xs font-bold",
41
+ children: v
42
+ })]
43
+ }), /* @__PURE__ */ l("span", {
44
+ className: "truncate text-sm font-semibold",
45
+ "aria-live": "polite",
46
+ children: x
47
+ })]
48
+ })
49
+ })
50
+ }), /* @__PURE__ */ l(e, {
51
+ type: "button",
52
+ className: "h-12 min-w-0 flex-1 px-3 text-sm font-semibold",
53
+ "aria-label": b,
54
+ "data-testid": "checkout-mobile-submit",
55
+ disabled: !h,
56
+ onClick: y,
57
+ children: /* @__PURE__ */ l("span", {
58
+ className: "line-clamp-2 whitespace-normal leading-tight",
59
+ children: _
60
+ })
61
+ })]
62
+ }), /* @__PURE__ */ u(n, {
63
+ className: "max-h-[90dvh] rounded-t-2xl bg-white",
64
+ closeLabel: S("close_modal"),
65
+ "data-testid": "checkout-mobile-summary-drawer",
66
+ showCloseButton: !0,
67
+ children: [
68
+ /* @__PURE__ */ l(i, {
69
+ className: "sr-only",
70
+ children: /* @__PURE__ */ l(a, { children: S("checkout_summary_title") })
71
+ }),
72
+ /* @__PURE__ */ l("div", {
73
+ className: "min-h-0 flex-1 overflow-y-auto px-4 pb-4 pt-8",
74
+ children: g
75
+ }),
76
+ /* @__PURE__ */ l(r, {
77
+ className: "mt-auto shrink-0 border-t border-slate-200 bg-white pb-[calc(1rem+env(safe-area-inset-bottom))] pt-4",
78
+ children: /* @__PURE__ */ l(e, {
79
+ type: "button",
80
+ size: "lg",
81
+ className: "w-full font-semibold",
82
+ disabled: !h,
83
+ onClick: () => {
84
+ w(!1), y();
85
+ },
86
+ children: /* @__PURE__ */ l("span", { children: b })
87
+ })
88
+ })
89
+ ]
90
+ })]
91
+ })
92
+ });
93
+ }
94
+ //#endregion
95
+ export { h as CheckoutMobileSummaryDrawer };
@@ -8,10 +8,13 @@ type CheckoutSummaryColumnProps = Pick<StorefrontCartPanelProps, "lines" | "item
8
8
  coupon?: CheckoutCouponCardProps;
9
9
  bookingPeriod?: CheckoutBookingPeriodSummaryProps;
10
10
  bookingSubtotalLabel: string;
11
+ className?: string;
12
+ presentation?: StorefrontCartPanelProps["presentation"];
13
+ stickyTopClassName?: string;
11
14
  vatAmountLabel: string;
12
15
  vatRateLabel: string;
13
16
  bookingTotalLabel: string;
14
17
  };
15
- export declare function CheckoutSummaryColumn({ lines, itemCount, baseUnitLabel, coupon, bookingPeriod, bookingSubtotalLabel, vatAmountLabel, vatRateLabel, bookingTotalLabel, onQuantityChange, onRemove, }: CheckoutSummaryColumnProps): import("react/jsx-runtime").JSX.Element;
18
+ export declare function CheckoutSummaryColumn({ lines, itemCount, baseUnitLabel, coupon, bookingPeriod, bookingSubtotalLabel, className, presentation, stickyTopClassName, vatAmountLabel, vatRateLabel, bookingTotalLabel, onQuantityChange, onRemove, }: CheckoutSummaryColumnProps): import("react/jsx-runtime").JSX.Element;
16
19
  export {};
17
20
  //# sourceMappingURL=CheckoutSummaryColumn.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"CheckoutSummaryColumn.d.ts","sourceRoot":"","sources":["../../../../src/pages/checkout/components/CheckoutSummaryColumn.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAA;AAG3C,OAAO,EAAE,mBAAmB,EAAE,MAAM,yCAAyC,CAAA;AAC7E,OAAO,EAEL,KAAK,iCAAiC,EACvC,MAAM,gCAAgC,CAAA;AACvC,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AAGzD,KAAK,wBAAwB,GAAG,cAAc,CAAC,OAAO,mBAAmB,CAAC,CAAA;AAC1E,KAAK,uBAAuB,GAAG,cAAc,CAAC,OAAO,kBAAkB,CAAC,CAAA;AAExE,KAAK,0BAA0B,GAAG,IAAI,CACpC,wBAAwB,EACtB,OAAO,GACP,WAAW,GACX,eAAe,GACf,kBAAkB,GAClB,UAAU,CACb,GAAG;IACF,MAAM,CAAC,EAAE,uBAAuB,CAAA;IAChC,aAAa,CAAC,EAAE,iCAAiC,CAAA;IACjD,oBAAoB,EAAE,MAAM,CAAA;IAC5B,cAAc,EAAE,MAAM,CAAA;IACtB,YAAY,EAAE,MAAM,CAAA;IACpB,iBAAiB,EAAE,MAAM,CAAA;CAC1B,CAAA;AAED,wBAAgB,qBAAqB,CAAC,EACpC,KAAK,EACL,SAAS,EACT,aAAa,EACb,MAAM,EACN,aAAa,EACb,oBAAoB,EACpB,cAAc,EACd,YAAY,EACZ,iBAAiB,EACjB,gBAAgB,EAChB,QAAQ,GACT,EAAE,0BAA0B,2CAgD5B"}
1
+ {"version":3,"file":"CheckoutSummaryColumn.d.ts","sourceRoot":"","sources":["../../../../src/pages/checkout/components/CheckoutSummaryColumn.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAA;AAI3C,OAAO,EAAE,mBAAmB,EAAE,MAAM,yCAAyC,CAAA;AAC7E,OAAO,EAEL,KAAK,iCAAiC,EACvC,MAAM,gCAAgC,CAAA;AACvC,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AAGzD,KAAK,wBAAwB,GAAG,cAAc,CAAC,OAAO,mBAAmB,CAAC,CAAA;AAC1E,KAAK,uBAAuB,GAAG,cAAc,CAAC,OAAO,kBAAkB,CAAC,CAAA;AAExE,KAAK,0BAA0B,GAAG,IAAI,CACpC,wBAAwB,EACtB,OAAO,GACP,WAAW,GACX,eAAe,GACf,kBAAkB,GAClB,UAAU,CACb,GAAG;IACF,MAAM,CAAC,EAAE,uBAAuB,CAAA;IAChC,aAAa,CAAC,EAAE,iCAAiC,CAAA;IACjD,oBAAoB,EAAE,MAAM,CAAA;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,YAAY,CAAC,EAAE,wBAAwB,CAAC,cAAc,CAAC,CAAA;IACvD,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B,cAAc,EAAE,MAAM,CAAA;IACtB,YAAY,EAAE,MAAM,CAAA;IACpB,iBAAiB,EAAE,MAAM,CAAA;CAC1B,CAAA;AAED,wBAAgB,qBAAqB,CAAC,EACpC,KAAK,EACL,SAAS,EACT,aAAa,EACb,MAAM,EACN,aAAa,EACb,oBAAoB,EACpB,SAAS,EACT,YAAY,EACZ,kBAA6B,EAC7B,cAAc,EACd,YAAY,EACZ,iBAAiB,EACjB,gBAAgB,EAChB,QAAQ,GACT,EAAE,0BAA0B,2CAiD5B"}
@@ -3,20 +3,22 @@ import { CheckoutBookingPeriodSummary as t } from "./CheckoutBookingPeriodSummar
3
3
  import { CheckoutCouponCard as n } from "./CheckoutCouponCard.js";
4
4
  import { jsx as r, jsxs as i } from "react/jsx-runtime";
5
5
  import { useTranslation as a } from "react-i18next";
6
+ import { cn as o } from "@rpcbase/ui";
6
7
  //#region src/pages/checkout/components/CheckoutSummaryColumn.tsx
7
- function o({ lines: o, itemCount: s, baseUnitLabel: c, coupon: l, bookingPeriod: u, bookingSubtotalLabel: d, vatAmountLabel: f, vatRateLabel: p, bookingTotalLabel: m, onQuantityChange: h, onRemove: g }) {
8
- let { t: _ } = a();
8
+ function s({ lines: s, itemCount: c, baseUnitLabel: l, coupon: u, bookingPeriod: d, bookingSubtotalLabel: f, className: p, presentation: m, stickyTopClassName: h = "top-32", vatAmountLabel: g, vatRateLabel: _, bookingTotalLabel: v, onQuantityChange: y, onRemove: b }) {
9
+ let { t: x } = a();
9
10
  return /* @__PURE__ */ r("div", {
10
- className: "lg:col-span-5",
11
+ className: o("lg:col-span-5", p),
11
12
  children: /* @__PURE__ */ r(e, {
12
- lines: o,
13
- itemCount: s,
14
- baseUnitLabel: c,
15
- title: _("checkout_summary_title"),
16
- description: _("checkout_summary_description"),
17
- headerAddon: u ? /* @__PURE__ */ r(t, { ...u }) : void 0,
13
+ lines: s,
14
+ itemCount: c,
15
+ baseUnitLabel: l,
16
+ title: x("checkout_summary_title"),
17
+ description: x("checkout_summary_description"),
18
+ headerAddon: d ? /* @__PURE__ */ r(t, { ...d }) : void 0,
18
19
  editable: !0,
19
- summaryAddon: l ? /* @__PURE__ */ r(n, { ...l }) : void 0,
20
+ presentation: m,
21
+ summaryAddon: u ? /* @__PURE__ */ r(n, { ...u }) : void 0,
20
22
  pricingSummary: /* @__PURE__ */ i("dl", {
21
23
  className: "grid border-t border-slate-200 pt-3 text-sm",
22
24
  "data-testid": "checkout-booking-totals",
@@ -25,39 +27,39 @@ function o({ lines: o, itemCount: s, baseUnitLabel: c, coupon: l, bookingPeriod:
25
27
  className: "flex items-center justify-between gap-3 py-1.5",
26
28
  children: [/* @__PURE__ */ r("dt", {
27
29
  className: "text-slate-700",
28
- children: /* @__PURE__ */ r("span", { children: _("checkout_booking_subtotal") })
30
+ children: /* @__PURE__ */ r("span", { children: x("checkout_booking_subtotal") })
29
31
  }), /* @__PURE__ */ r("dd", {
30
32
  className: "font-medium tabular-nums text-slate-900",
31
- children: /* @__PURE__ */ r("span", { children: d })
33
+ children: /* @__PURE__ */ r("span", { children: f })
32
34
  })]
33
35
  }),
34
36
  /* @__PURE__ */ i("div", {
35
37
  className: "flex items-center justify-between gap-3 py-1.5",
36
38
  children: [/* @__PURE__ */ r("dt", {
37
39
  className: "text-slate-700",
38
- children: /* @__PURE__ */ r("span", { children: _("checkout_payment_vat", { rate: p }) })
40
+ children: /* @__PURE__ */ r("span", { children: x("checkout_payment_vat", { rate: _ }) })
39
41
  }), /* @__PURE__ */ r("dd", {
40
42
  className: "font-medium tabular-nums text-slate-900",
41
- children: /* @__PURE__ */ r("span", { children: f })
43
+ children: /* @__PURE__ */ r("span", { children: g })
42
44
  })]
43
45
  }),
44
46
  /* @__PURE__ */ i("div", {
45
47
  className: "mt-1 flex items-center justify-between gap-3 border-t border-slate-200 pt-3",
46
48
  children: [/* @__PURE__ */ r("dt", {
47
49
  className: "font-semibold text-slate-950",
48
- children: /* @__PURE__ */ r("span", { children: _("checkout_estimated_total") })
50
+ children: /* @__PURE__ */ r("span", { children: x("checkout_estimated_total") })
49
51
  }), /* @__PURE__ */ r("dd", {
50
52
  className: "text-base font-bold tabular-nums tracking-tight text-slate-950",
51
- children: /* @__PURE__ */ r("span", { children: m })
53
+ children: /* @__PURE__ */ r("span", { children: v })
52
54
  })]
53
55
  })
54
56
  ]
55
57
  }),
56
- stickyTopClassName: "top-32",
57
- onQuantityChange: h,
58
- onRemove: g
58
+ stickyTopClassName: h,
59
+ onQuantityChange: y,
60
+ onRemove: b
59
61
  })
60
62
  });
61
63
  }
62
64
  //#endregion
63
- export { o as CheckoutSummaryColumn };
65
+ export { s as CheckoutSummaryColumn };