@loczer/storefront-sdk 0.220.0 → 0.222.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 (47) hide show
  1. package/dist/StorefrontContext.d.ts +2 -2
  2. package/dist/StorefrontProvider.d.ts +2 -2
  3. package/dist/components/Header/index.d.ts.map +1 -1
  4. package/dist/components/Header/index.js +118 -126
  5. package/dist/components/LanguageSelector/index.d.ts +7 -0
  6. package/dist/components/LanguageSelector/index.d.ts.map +1 -0
  7. package/dist/components/LanguageSelector/index.js +69 -0
  8. package/dist/components/StorefrontCartPanel/index.d.ts +3 -8
  9. package/dist/components/StorefrontCartPanel/index.d.ts.map +1 -1
  10. package/dist/components/StorefrontCartPanel/index.js +65 -108
  11. package/dist/i18n/I18nProvider.d.ts +3 -2
  12. package/dist/i18n/I18nProvider.d.ts.map +1 -1
  13. package/dist/i18n/I18nProvider.js +61 -64
  14. package/dist/i18n/en.d.ts +3 -2
  15. package/dist/i18n/en.d.ts.map +1 -1
  16. package/dist/i18n/en.js +6 -5
  17. package/dist/i18n/fr.d.ts +3 -2
  18. package/dist/i18n/fr.d.ts.map +1 -1
  19. package/dist/i18n/fr.js +6 -5
  20. package/dist/i18n/languages.d.ts +15 -0
  21. package/dist/i18n/languages.d.ts.map +1 -0
  22. package/dist/i18n/languages.js +26 -0
  23. package/dist/index.d.ts +36 -24
  24. package/dist/index.js +50 -49
  25. package/dist/lib/cartSummary.d.ts +2 -5
  26. package/dist/lib/cartSummary.d.ts.map +1 -1
  27. package/dist/lib/cartSummary.js +5 -11
  28. package/dist/pages/BookingPage.d.ts.map +1 -1
  29. package/dist/pages/BookingPage.js +150 -148
  30. package/dist/pages/CheckoutPage.d.ts.map +1 -1
  31. package/dist/pages/CheckoutPage.js +236 -272
  32. package/dist/pages/ContractSaleDocumentPage.d.ts +2 -3
  33. package/dist/pages/ContractSaleDocumentPage.d.ts.map +1 -1
  34. package/dist/pages/ContractSaleDocumentPage.js +18 -17
  35. package/dist/pages/checkout/components/CheckoutDetailsCard.d.ts.map +1 -1
  36. package/dist/pages/checkout/components/CheckoutDetailsCard.js +38 -25
  37. package/dist/pages/checkout/components/CheckoutSummaryColumn.d.ts +6 -2
  38. package/dist/pages/checkout/components/CheckoutSummaryColumn.d.ts.map +1 -1
  39. package/dist/pages/checkout/components/CheckoutSummaryColumn.js +48 -19
  40. package/dist/storefront.css +1 -1
  41. package/dist/storefrontSchemas.d.ts +2 -2
  42. package/dist/storefrontSchemas.d.ts.map +1 -1
  43. package/dist/storefrontSchemas.js +95 -94
  44. package/package.json +1 -1
  45. package/dist/pages/checkout/components/CheckoutPaymentSummaryCard.d.ts +0 -24
  46. package/dist/pages/checkout/components/CheckoutPaymentSummaryCard.d.ts.map +0 -1
  47. package/dist/pages/checkout/components/CheckoutPaymentSummaryCard.js +0 -158
@@ -1,5 +1,4 @@
1
1
  import { Loader } from '@rpcbase/client';
2
- import { StorefrontI18nLanguage } from '../i18n/I18nProvider';
3
2
  export declare const resolveContractSaleDocumentBackLink: (search: string) => string | null;
4
3
  type ContractSaleDocumentLoaderArgs = Parameters<Loader>[0] & {
5
4
  request?: {
@@ -11,7 +10,7 @@ export declare const loader: ({ ctx, params, request }: ContractSaleDocumentLoad
11
10
  referenceId: string;
12
11
  saleDocumentId: string;
13
12
  pdfMode: boolean;
14
- documentLanguage: StorefrontI18nLanguage | null;
13
+ documentLanguage: "fr" | "en" | null;
15
14
  document: null;
16
15
  error: string | null;
17
16
  } | {
@@ -19,7 +18,7 @@ export declare const loader: ({ ctx, params, request }: ContractSaleDocumentLoad
19
18
  referenceId: string;
20
19
  saleDocumentId: string;
21
20
  pdfMode: boolean;
22
- documentLanguage: StorefrontI18nLanguage | null;
21
+ documentLanguage: "fr" | "en" | null;
23
22
  document: {
24
23
  id: string;
25
24
  kind: "quote" | "invoice" | "credit_note";
@@ -1 +1 @@
1
- {"version":3,"file":"ContractSaleDocumentPage.d.ts","sourceRoot":"","sources":["../../src/pages/ContractSaleDocumentPage.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,iBAAiB,CAAA;AAsB7C,OAAO,EAAmC,KAAK,sBAAsB,EAAE,MAAM,sBAAsB,CAAA;AAanG,eAAO,MAAM,mCAAmC,GAAI,QAAQ,MAAM,KAAG,MAAM,GAAG,IAe7E,CAAA;AA0KD,KAAK,8BAA8B,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,GAAG;IAC5D,OAAO,CAAC,EAAE;QAAE,GAAG,CAAC,EAAE,OAAO,CAAA;KAAE,CAAA;CAC5B,CAAA;AAED,eAAO,MAAM,MAAM,6BAAqC,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmEnE,CAAA;AAYnB,MAAM,CAAC,OAAO,UAAU,wBAAwB,4CA8P/C"}
1
+ {"version":3,"file":"ContractSaleDocumentPage.d.ts","sourceRoot":"","sources":["../../src/pages/ContractSaleDocumentPage.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,iBAAiB,CAAA;AAmC7C,eAAO,MAAM,mCAAmC,GAAI,QAAQ,MAAM,KAAG,MAAM,GAAG,IAe7E,CAAA;AA0KD,KAAK,8BAA8B,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,GAAG;IAC5D,OAAO,CAAC,EAAE;QAAE,GAAG,CAAC,EAAE,OAAO,CAAA;KAAE,CAAA;CAC5B,CAAA;AAED,eAAO,MAAM,MAAM,6BAAqC,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmEnE,CAAA;AAYnB,MAAM,CAAC,OAAO,UAAU,wBAAwB,4CA8P/C"}
@@ -1,5 +1,6 @@
1
- import { Button as e } from "../ui/button.js";
2
- import { normalizeStorefrontI18nLanguage as t } from "../i18n/I18nProvider.js";
1
+ import { normalizeStorefrontI18nLanguage as e } from "../i18n/languages.js";
2
+ import { Button as t } from "../ui/button.js";
3
+ import "../i18n/I18nProvider.js";
3
4
  import { toast as n } from "../lib/toast.js";
4
5
  import { Card as r } from "../ui/card.js";
5
6
  import { ContractSaleDocument as i } from "../components/ContractSaleDocument/Invoice.js";
@@ -63,14 +64,14 @@ var k = (e) => new URLSearchParams(e).get("pdf") === "1", A = (e) => c(new URLSe
63
64
  code: "fr",
64
65
  labelKey: "docs_contract_sale_language_option_fr"
65
66
  };
66
- function z({ selectedLanguage: t, onChange: n }) {
67
- let { t: r } = C(), [i, a] = g(!1), o = L.find((e) => e.code === t) ?? R;
67
+ function z({ selectedLanguage: e, onChange: n }) {
68
+ let { t: r } = C(), [i, a] = g(!1), o = L.find((t) => t.code === e) ?? R;
68
69
  return /* @__PURE__ */ v(O.Root, {
69
70
  open: i,
70
71
  onOpenChange: a,
71
72
  children: [/* @__PURE__ */ _(O.Trigger, {
72
73
  nativeButton: !0,
73
- render: /* @__PURE__ */ v(e, {
74
+ render: /* @__PURE__ */ v(t, {
74
75
  variant: "outline",
75
76
  size: "sm",
76
77
  type: "button",
@@ -100,17 +101,17 @@ function z({ selectedLanguage: t, onChange: n }) {
100
101
  "data-state": t.open ? "open" : "closed"
101
102
  }),
102
103
  className: "z-50 min-w-36 overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md transition-opacity duration-75 data-[ending-style]:opacity-0 data-[starting-style]:opacity-0 data-[instant]:transition-none",
103
- children: L.map((e) => /* @__PURE__ */ v(O.Item, {
104
- onClick: (t) => {
105
- t.defaultPrevented || (n(e.code), a(!1));
104
+ children: L.map((t) => /* @__PURE__ */ v(O.Item, {
105
+ onClick: (e) => {
106
+ e.defaultPrevented || (n(t.code), a(!1));
106
107
  },
107
- "data-testid": `contract-sale-document-language-option-${e.code}`,
108
- className: w("relative flex cursor-pointer select-none items-center justify-between gap-3 whitespace-nowrap rounded-sm px-2 py-1.5 text-sm outline-none transition-colors data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground", t === e.code && "bg-accent"),
109
- children: [/* @__PURE__ */ _("span", { children: r(e.labelKey) }), /* @__PURE__ */ _("span", {
108
+ "data-testid": `contract-sale-document-language-option-${t.code}`,
109
+ className: w("relative flex cursor-pointer select-none items-center justify-between gap-3 whitespace-nowrap rounded-sm px-2 py-1.5 text-sm outline-none transition-colors data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground", e === t.code && "bg-accent"),
110
+ children: [/* @__PURE__ */ _("span", { children: r(t.labelKey) }), /* @__PURE__ */ _("span", {
110
111
  className: "text-2xs uppercase text-muted-foreground",
111
- children: e.code
112
+ children: t.code
112
113
  })]
113
- }, e.code))
114
+ }, t.code))
114
115
  })
115
116
  }) })]
116
117
  });
@@ -166,11 +167,11 @@ var B = (async ({ ctx: e, params: t, request: n }) => {
166
167
  return t.success ? t.data : null;
167
168
  };
168
169
  function H() {
169
- let { t: a, i18n: s } = C(), c = b(), u = x(), d = S(), { storeSlug: p, referenceId: m, saleDocumentId: w } = c, E = c.pdfMode || k(u.search), O = j(u.search), M = O ?? `/${p ?? ""}`, L = a(O ? "docs_contract_sale_back" : "docs_contract_sale_back_to_storefront"), [R, B] = g(V(c.document)), [H, U] = g(null), [W, G] = g(!1), [K, q] = g(c.error), J = A(u.search) ?? t(R?.language?.customer) ?? c.documentLanguage ?? t(s.language) ?? "fr", Y = p && m && w ? N(p, m, w, J) : null, X = p && m && w ? P(p, m, w, J) : "";
170
+ let { t: a, i18n: s } = C(), c = b(), u = x(), d = S(), { storeSlug: p, referenceId: m, saleDocumentId: w } = c, E = c.pdfMode || k(u.search), O = j(u.search), M = O ?? `/${p ?? ""}`, L = a(O ? "docs_contract_sale_back" : "docs_contract_sale_back_to_storefront"), [R, B] = g(V(c.document)), [H, U] = g(null), [W, G] = g(!1), [K, q] = g(c.error), J = A(u.search) ?? e(R?.language?.customer) ?? c.documentLanguage ?? e(s.language) ?? "fr", Y = p && m && w ? N(p, m, w, J) : null, X = p && m && w ? P(p, m, w, J) : "";
170
171
  h(() => {
171
172
  B(V(c.document)), q(c.error);
172
173
  }, [c.document, c.error]), h(() => {
173
- t(s.language) !== J && s.changeLanguage(J);
174
+ e(s.language) !== J && s.changeLanguage(J);
174
175
  }, [s, J]);
175
176
  let Z = (e) => {
176
177
  if (e === J) return;
@@ -198,7 +199,7 @@ function H() {
198
199
  /* @__PURE__ */ _(y, {
199
200
  to: M,
200
201
  "data-testid": "contract-sale-document-back-link",
201
- children: /* @__PURE__ */ v(e, {
202
+ children: /* @__PURE__ */ v(t, {
202
203
  className: "gap-2",
203
204
  children: [/* @__PURE__ */ _(T, {
204
205
  className: "h-4 w-4",
@@ -267,7 +268,7 @@ function H() {
267
268
  selectedLanguage: J,
268
269
  onChange: Z
269
270
  }),
270
- Y ? /* @__PURE__ */ v(e, {
271
+ Y ? /* @__PURE__ */ v(t, {
271
272
  variant: "outline",
272
273
  size: "sm",
273
274
  type: "button",
@@ -1 +1 @@
1
- {"version":3,"file":"CheckoutDetailsCard.d.ts","sourceRoot":"","sources":["../../../../src/pages/checkout/components/CheckoutDetailsCard.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,eAAe,CAAA;AAG5C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAA;AAOlD,KAAK,YAAY,GAAG,UAAU,CAAC,OAAO,OAAO,CAAC,kBAAkB,CAAC,CAAC,CAAA;AAElE,KAAK,wBAAwB,GAAG;IAC9B,IAAI,EAAE,YAAY,CAAA;CACnB,CAAA;AAED,wBAAgB,mBAAmB,CAAC,EAAE,IAAI,EAAE,EAAE,wBAAwB,2CA2FrE"}
1
+ {"version":3,"file":"CheckoutDetailsCard.d.ts","sourceRoot":"","sources":["../../../../src/pages/checkout/components/CheckoutDetailsCard.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,eAAe,CAAA;AAK5C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAA;AAOlD,KAAK,YAAY,GAAG,UAAU,CAAC,OAAO,OAAO,CAAC,kBAAkB,CAAC,CAAC,CAAA;AAElE,KAAK,wBAAwB,GAAG;IAC9B,IAAI,EAAE,YAAY,CAAA;CACnB,CAAA;AAOD,wBAAgB,mBAAmB,CAAC,EAAE,IAAI,EAAE,EAAE,wBAAwB,2CAsHrE"}
@@ -4,88 +4,101 @@ import { Textarea as s } from "../../../ui/textarea.js";
4
4
  import { Card as c } from "../../../ui/card.js";
5
5
  import { jsx as l, jsxs as u } from "react/jsx-runtime";
6
6
  import { useTranslation as d } from "react-i18next";
7
+ import { PhoneNumberInput as f, cn as p } from "@rpcbase/ui";
7
8
  //#region src/pages/checkout/components/CheckoutDetailsCard.tsx
8
- function f({ form: f }) {
9
- let { t: p } = d();
9
+ var m = (e) => e.startsWith("fr") ? "FR" : "US";
10
+ function h({ form: h }) {
11
+ let { t: g, i18n: _ } = d();
10
12
  return /* @__PURE__ */ u(c, {
11
13
  className: "border-slate-200 bg-white shadow-sm",
12
14
  children: [/* @__PURE__ */ u("div", {
13
15
  className: "border-b border-slate-200 px-4 py-4",
14
16
  children: [/* @__PURE__ */ l("p", {
15
17
  className: "text-sm font-semibold text-slate-950",
16
- children: /* @__PURE__ */ l("span", { children: p("checkout_form_title") })
18
+ children: /* @__PURE__ */ l("span", { children: g("checkout_form_title") })
17
19
  }), /* @__PURE__ */ l("p", {
18
20
  className: "mt-1 text-xs text-slate-600",
19
- children: /* @__PURE__ */ l("span", { children: p("checkout_form_description") })
21
+ children: /* @__PURE__ */ l("span", { children: g("checkout_form_description") })
20
22
  })]
21
23
  }), /* @__PURE__ */ l("div", {
22
24
  className: "px-4 py-4",
23
25
  children: /* @__PURE__ */ l(t, {
24
- ...f,
26
+ ...h,
25
27
  children: /* @__PURE__ */ u("form", {
26
28
  onSubmit: (e) => e.preventDefault(),
27
29
  className: "grid gap-3",
28
30
  children: [
29
31
  /* @__PURE__ */ l(r, {
30
- control: f.control,
32
+ control: h.control,
31
33
  name: "first_name",
32
34
  render: ({ field: t }) => /* @__PURE__ */ u(i, { children: [
33
- /* @__PURE__ */ l(a, { children: p("checkout_first_name_label") }),
35
+ /* @__PURE__ */ l(a, { children: g("checkout_first_name_label") }),
34
36
  /* @__PURE__ */ l(n, { children: /* @__PURE__ */ l(e, {
35
37
  ...t,
36
38
  autoComplete: "given-name",
37
- placeholder: p("checkout_first_name_placeholder")
39
+ placeholder: g("checkout_first_name_placeholder")
38
40
  }) }),
39
41
  /* @__PURE__ */ l(o, {})
40
42
  ] })
41
43
  }),
42
44
  /* @__PURE__ */ l(r, {
43
- control: f.control,
45
+ control: h.control,
44
46
  name: "last_name",
45
47
  render: ({ field: t }) => /* @__PURE__ */ u(i, { children: [
46
- /* @__PURE__ */ l(a, { children: p("checkout_last_name_label") }),
48
+ /* @__PURE__ */ l(a, { children: g("checkout_last_name_label") }),
47
49
  /* @__PURE__ */ l(n, { children: /* @__PURE__ */ l(e, {
48
50
  ...t,
49
51
  autoComplete: "family-name",
50
- placeholder: p("checkout_last_name_placeholder")
52
+ placeholder: g("checkout_last_name_placeholder")
51
53
  }) }),
52
54
  /* @__PURE__ */ l(o, {})
53
55
  ] })
54
56
  }),
55
57
  /* @__PURE__ */ l(r, {
56
- control: f.control,
58
+ control: h.control,
57
59
  name: "email",
58
60
  render: ({ field: t }) => /* @__PURE__ */ u(i, { children: [
59
- /* @__PURE__ */ l(a, { children: p("checkout_email_label") }),
61
+ /* @__PURE__ */ l(a, { children: g("checkout_email_label") }),
60
62
  /* @__PURE__ */ l(n, { children: /* @__PURE__ */ l(e, {
61
63
  ...t,
62
64
  type: "email",
63
- placeholder: p("checkout_email_placeholder")
65
+ placeholder: g("checkout_email_placeholder")
64
66
  }) }),
65
67
  /* @__PURE__ */ l(o, {})
66
68
  ] })
67
69
  }),
68
70
  /* @__PURE__ */ l(r, {
69
- control: f.control,
71
+ control: h.control,
70
72
  name: "phone",
71
- render: ({ field: t }) => /* @__PURE__ */ u(i, { children: [
72
- /* @__PURE__ */ l(a, { children: p("checkout_phone_label") }),
73
- /* @__PURE__ */ l(n, { children: /* @__PURE__ */ l(e, {
74
- ...t,
75
- placeholder: p("checkout_phone_placeholder")
73
+ render: ({ field: e, fieldState: t }) => /* @__PURE__ */ u(i, { children: [
74
+ /* @__PURE__ */ l(a, { children: g("checkout_phone_label") }),
75
+ /* @__PURE__ */ l(n, { children: /* @__PURE__ */ l(f, {
76
+ name: e.name,
77
+ value: e.value ?? "",
78
+ onBlur: e.onBlur,
79
+ onChange: (t) => {
80
+ let n = t.e164 || t.formattedInternational || t.rawInput || "";
81
+ e.onChange(n);
82
+ },
83
+ defaultCountry: m(_.language),
84
+ locale: _.language,
85
+ placeholder: g("checkout_phone_placeholder"),
86
+ className: "relative",
87
+ inputClassName: p(t.error && "border-destructive focus-visible:ring-destructive"),
88
+ renderValidationMessage: ({ message: e }) => t.error?.message ? null : /* @__PURE__ */ l(o, { children: /* @__PURE__ */ l("span", { children: e }) })
76
89
  }) }),
77
- /* @__PURE__ */ l(o, {})
90
+ t.error?.message ? /* @__PURE__ */ l(o, {}) : null
78
91
  ] })
79
92
  }),
80
93
  /* @__PURE__ */ l(r, {
81
- control: f.control,
94
+ control: h.control,
82
95
  name: "notes",
83
96
  render: ({ field: e }) => /* @__PURE__ */ u(i, { children: [
84
- /* @__PURE__ */ l(a, { children: p("checkout_notes_label") }),
97
+ /* @__PURE__ */ l(a, { children: g("checkout_notes_label") }),
85
98
  /* @__PURE__ */ l(n, { children: /* @__PURE__ */ l(s, {
86
99
  ...e,
87
100
  rows: 4,
88
- placeholder: p("checkout_notes_placeholder")
101
+ placeholder: g("checkout_notes_placeholder")
89
102
  }) }),
90
103
  /* @__PURE__ */ l(o, {})
91
104
  ] })
@@ -97,4 +110,4 @@ function f({ form: f }) {
97
110
  });
98
111
  }
99
112
  //#endregion
100
- export { f as CheckoutDetailsCard };
113
+ export { h as CheckoutDetailsCard };
@@ -3,9 +3,13 @@ import { StorefrontCartPanel } from '../../../components/StorefrontCartPanel';
3
3
  import { CheckoutCouponCard } from './CheckoutCouponCard';
4
4
  type StorefrontCartPanelProps = ComponentProps<typeof StorefrontCartPanel>;
5
5
  type CheckoutCouponCardProps = ComponentProps<typeof CheckoutCouponCard>;
6
- type CheckoutSummaryColumnProps = Pick<StorefrontCartPanelProps, "lines" | "itemCount" | "totalPerBaseUnitMinor" | "baseUnitLabel" | "estimatedTotalMinor" | "discountedEstimatedTotalMinor" | "discountAmountMinor" | "lateReturnSurchargeMinor" | "couponCode" | "durationInBaseUnitLabel" | "onQuantityChange" | "onRemove"> & {
6
+ type CheckoutSummaryColumnProps = Pick<StorefrontCartPanelProps, "lines" | "itemCount" | "baseUnitLabel" | "onQuantityChange" | "onRemove"> & {
7
7
  coupon?: CheckoutCouponCardProps;
8
+ bookingSubtotalLabel: string;
9
+ vatAmountLabel: string;
10
+ vatRateLabel: string;
11
+ bookingTotalLabel: string;
8
12
  };
9
- export declare function CheckoutSummaryColumn({ lines, itemCount, totalPerBaseUnitMinor, baseUnitLabel, estimatedTotalMinor, discountedEstimatedTotalMinor, discountAmountMinor, lateReturnSurchargeMinor, couponCode, durationInBaseUnitLabel, coupon, onQuantityChange, onRemove, }: CheckoutSummaryColumnProps): import("react/jsx-runtime").JSX.Element;
13
+ export declare function CheckoutSummaryColumn({ lines, itemCount, baseUnitLabel, coupon, bookingSubtotalLabel, vatAmountLabel, vatRateLabel, bookingTotalLabel, onQuantityChange, onRemove, }: CheckoutSummaryColumnProps): import("react/jsx-runtime").JSX.Element;
10
14
  export {};
11
15
  //# 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,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,uBAAuB,GACvB,eAAe,GACf,qBAAqB,GACrB,+BAA+B,GAC/B,qBAAqB,GACrB,0BAA0B,GAC1B,YAAY,GACZ,yBAAyB,GACzB,kBAAkB,GAClB,UAAU,CACb,GAAG;IACF,MAAM,CAAC,EAAE,uBAAuB,CAAA;CACjC,CAAA;AAED,wBAAgB,qBAAqB,CAAC,EACpC,KAAK,EACL,SAAS,EACT,qBAAqB,EACrB,aAAa,EACb,mBAAmB,EACnB,6BAA6B,EAC7B,mBAAmB,EACnB,wBAAwB,EACxB,UAAU,EACV,uBAAuB,EACvB,MAAM,EACN,gBAAgB,EAChB,QAAQ,GACT,EAAE,0BAA0B,2CA0B5B"}
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,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,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,oBAAoB,EACpB,cAAc,EACd,YAAY,EACZ,iBAAiB,EACjB,gBAAgB,EAChB,QAAQ,GACT,EAAE,0BAA0B,2CA+C5B"}
@@ -1,32 +1,61 @@
1
1
  import { StorefrontCartPanel as e } from "../../../components/StorefrontCartPanel/index.js";
2
2
  import { CheckoutCouponCard as t } from "./CheckoutCouponCard.js";
3
- import { jsx as n } from "react/jsx-runtime";
4
- import { useTranslation as r } from "react-i18next";
3
+ import { jsx as n, jsxs as r } from "react/jsx-runtime";
4
+ import { useTranslation as i } from "react-i18next";
5
5
  //#region src/pages/checkout/components/CheckoutSummaryColumn.tsx
6
- function i({ lines: i, itemCount: a, totalPerBaseUnitMinor: o, baseUnitLabel: s, estimatedTotalMinor: c, discountedEstimatedTotalMinor: l, discountAmountMinor: u, lateReturnSurchargeMinor: d, couponCode: f, durationInBaseUnitLabel: p, coupon: m, onQuantityChange: h, onRemove: g }) {
7
- let { t: _ } = r();
6
+ function a({ lines: a, itemCount: o, baseUnitLabel: s, coupon: c, bookingSubtotalLabel: l, vatAmountLabel: u, vatRateLabel: d, bookingTotalLabel: f, onQuantityChange: p, onRemove: m }) {
7
+ let { t: h } = i();
8
8
  return /* @__PURE__ */ n("div", {
9
9
  className: "lg:col-span-5",
10
10
  children: /* @__PURE__ */ n(e, {
11
- lines: i,
12
- itemCount: a,
13
- totalPerBaseUnitMinor: o,
11
+ lines: a,
12
+ itemCount: o,
14
13
  baseUnitLabel: s,
15
- estimatedTotalMinor: c,
16
- discountedEstimatedTotalMinor: l,
17
- discountAmountMinor: u,
18
- lateReturnSurchargeMinor: d,
19
- couponCode: f,
20
- durationInBaseUnitLabel: p,
21
- title: _("checkout_summary_title"),
22
- description: _("checkout_summary_description"),
14
+ title: h("checkout_summary_title"),
15
+ description: h("checkout_summary_description"),
23
16
  editable: !0,
24
- summaryAddon: m ? /* @__PURE__ */ n(t, { ...m }) : void 0,
17
+ summaryAddon: c ? /* @__PURE__ */ n(t, { ...c }) : void 0,
18
+ pricingSummary: /* @__PURE__ */ r("dl", {
19
+ className: "grid border-t border-slate-200 pt-3 text-sm",
20
+ "data-testid": "checkout-booking-totals",
21
+ children: [
22
+ /* @__PURE__ */ r("div", {
23
+ className: "flex items-center justify-between gap-3 py-1.5",
24
+ children: [/* @__PURE__ */ n("dt", {
25
+ className: "text-slate-700",
26
+ children: /* @__PURE__ */ n("span", { children: h("checkout_booking_subtotal") })
27
+ }), /* @__PURE__ */ n("dd", {
28
+ className: "font-medium tabular-nums text-slate-900",
29
+ children: /* @__PURE__ */ n("span", { children: l })
30
+ })]
31
+ }),
32
+ /* @__PURE__ */ r("div", {
33
+ className: "flex items-center justify-between gap-3 py-1.5",
34
+ children: [/* @__PURE__ */ n("dt", {
35
+ className: "text-slate-700",
36
+ children: /* @__PURE__ */ n("span", { children: h("checkout_payment_vat", { rate: d }) })
37
+ }), /* @__PURE__ */ n("dd", {
38
+ className: "font-medium tabular-nums text-slate-900",
39
+ children: /* @__PURE__ */ n("span", { children: u })
40
+ })]
41
+ }),
42
+ /* @__PURE__ */ r("div", {
43
+ className: "mt-1 flex items-center justify-between gap-3 border-t border-slate-200 pt-3",
44
+ children: [/* @__PURE__ */ n("dt", {
45
+ className: "font-semibold text-slate-950",
46
+ children: /* @__PURE__ */ n("span", { children: h("checkout_estimated_total") })
47
+ }), /* @__PURE__ */ n("dd", {
48
+ className: "text-base font-bold tabular-nums tracking-tight text-slate-950",
49
+ children: /* @__PURE__ */ n("span", { children: f })
50
+ })]
51
+ })
52
+ ]
53
+ }),
25
54
  stickyTopClassName: "top-32",
26
- onQuantityChange: h,
27
- onRemove: g
55
+ onQuantityChange: p,
56
+ onRemove: m
28
57
  })
29
58
  });
30
59
  }
31
60
  //#endregion
32
- export { i as CheckoutSummaryColumn };
61
+ export { a as CheckoutSummaryColumn };