@loczer/storefront-sdk 0.193.0 → 0.195.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 (82) hide show
  1. package/dist/chunks/pkg/booking-engine/dist/models/{Product.shared-cjcvMCMa.js → Product.shared-iVSHRdn4.js} +21 -21
  2. package/dist/chunks/pkg/booking-engine/dist/schemas/{base-asset-CsOe0vXi.js → base-asset-BRQVuIes.js} +1 -1
  3. package/dist/chunks/pkg/booking-engine/dist/schemas/{base-booking-Sjsqh31e.js → base-booking-Bhy2Kww1.js} +2 -2
  4. package/dist/chunks/pkg/booking-engine/dist/schemas/{base-product-C_ATjuc6.js → base-product-BJHQLX8t.js} +1 -1
  5. package/dist/chunks/pkg/booking-engine/dist/schemas/{insurance-B01h642r.js → insurance-CPeHsTss.js} +1 -1
  6. package/dist/chunks/pkg/booking-engine/dist/schemas-BfXM1Dgb.js +14 -0
  7. package/dist/chunks/pkg/ui/dist/{Button-CxG2fSpA.js → Button-Cr_u8vnh.js} +1 -1
  8. package/dist/chunks/pkg/ui/dist/{Dialog-4leTWiev.js → Dialog-CczmPDwY.js} +1 -1
  9. package/dist/chunks/pkg/ui/dist/Drawer/{index-DA5V7R_q.js → index-CSvSVP_J.js} +1 -1
  10. package/dist/chunks/pkg/ui/dist/Map/{MapContent-BmKjdWmq.js → MapContent-CDeWtwKa.js} +1 -1
  11. package/dist/chunks/pkg/ui/dist/{Map-CsOTdTtL.js → Map-Cs7wgtH9.js} +2 -2
  12. package/dist/chunks/pkg/ui/dist/{MorphingModalWizard-CfEqkJ0y.js → MorphingModalWizard-j1CgFGLe.js} +4 -3
  13. package/dist/chunks/pkg/ui/dist/{ResponsiveDialog-C6IWYoIg.js → ResponsiveDialog-BVwhTZQo.js} +3 -3
  14. package/dist/chunks/pkg/ui/dist/{ScrollArea-Bjwo84cv.js → ScrollArea-BqLd0xZj.js} +1 -1
  15. package/dist/chunks/pkg/ui/dist/Spinner/{index-DzMEU0iA.js → index-Cgi70z_E.js} +1 -1
  16. package/dist/chunks/pkg/ui/dist/lib/utils-DXB19bzk.js +8 -0
  17. package/dist/components/BikeProductCard/index.js +6 -6
  18. package/dist/components/BookingBikeVariantDialog/index.js +7 -7
  19. package/dist/components/BookingFlowSteps/index.js +11 -11
  20. package/dist/components/BookingPeriodSelector/components/BookingEndDateField.js +1 -1
  21. package/dist/components/BookingPeriodSelector/components/BookingEndTimeField.d.ts.map +1 -1
  22. package/dist/components/BookingPeriodSelector/components/BookingEndTimeField.js +36 -54
  23. package/dist/components/BookingPeriodSelector/components/BookingStartDateField.js +1 -1
  24. package/dist/components/BookingPeriodSelector/components/BookingStartTimeField.d.ts.map +1 -1
  25. package/dist/components/BookingPeriodSelector/components/BookingStartTimeField.js +36 -54
  26. package/dist/components/BookingPeriodSelector/components/BookingTimeSlotsStatus.js +1 -1
  27. package/dist/components/BookingPeriodSelector/components/internal/BookingHourPickerField.d.ts +7 -0
  28. package/dist/components/BookingPeriodSelector/components/internal/BookingHourPickerField.d.ts.map +1 -0
  29. package/dist/components/BookingPeriodSelector/components/internal/BookingHourPickerField.js +27 -0
  30. package/dist/components/BookingPeriodSelector/components/internal/StorefrontHourPickerField.d.ts +36 -0
  31. package/dist/components/BookingPeriodSelector/components/internal/StorefrontHourPickerField.d.ts.map +1 -0
  32. package/dist/components/BookingPeriodSelector/components/internal/StorefrontHourPickerField.js +830 -0
  33. package/dist/components/BookingPeriodSelector/components/internal/useIsTouchDevice.d.ts +2 -0
  34. package/dist/components/BookingPeriodSelector/components/internal/useIsTouchDevice.d.ts.map +1 -0
  35. package/dist/components/BookingPeriodSelector/components/internal/useIsTouchDevice.js +21 -0
  36. package/dist/components/BookingPeriodSelector/useBookingPeriodController.d.ts +4 -1
  37. package/dist/components/BookingPeriodSelector/useBookingPeriodController.d.ts.map +1 -1
  38. package/dist/components/BookingPeriodSelector/useBookingPeriodController.js +114 -110
  39. package/dist/components/ContactSection/index.js +35 -35
  40. package/dist/components/ContractSaleDocument/DocumentAcceptanceSection.js +4 -4
  41. package/dist/components/ContractSaleDocument/ThumbnailSidebar.js +1 -1
  42. package/dist/components/DeliveryAddressSelector/index.js +5 -5
  43. package/dist/components/Footer/index.js +11 -11
  44. package/dist/components/FulfillmentSection/index.js +9 -9
  45. package/dist/components/Header/index.js +61 -61
  46. package/dist/components/Map/index.js +1 -1
  47. package/dist/components/PoweredByLoczerBadge/index.js +5 -5
  48. package/dist/components/ProductPriceBadge/index.js +73 -73
  49. package/dist/components/StorefrontCancellationPolicyNotice/index.js +6 -6
  50. package/dist/components/StorefrontCartPanel/index.js +8 -8
  51. package/dist/components/StorefrontInsuranceNotice/index.js +6 -6
  52. package/dist/components/StorefrontPopupMessages/index.js +8 -8
  53. package/dist/components/payment/MollieCardFieldsForm.js +1 -1
  54. package/dist/components/payment/StripeCardFieldsForm.js +1 -1
  55. package/dist/index.d.ts +15 -3
  56. package/dist/index.js +70 -70
  57. package/dist/lib/booking.js +1 -1
  58. package/dist/lib/checkoutSubmit.js +2 -2
  59. package/dist/lib/utils.d.ts +3 -1
  60. package/dist/lib/utils.d.ts.map +1 -1
  61. package/dist/lib/utils.js +9 -5
  62. package/dist/pages/BookingPage.d.ts.map +1 -1
  63. package/dist/pages/BookingPage.js +187 -159
  64. package/dist/pages/CheckoutPaymentPage.js +1 -1
  65. package/dist/pages/ContractSaleDocumentPage.js +15 -15
  66. package/dist/pages/HomePage.d.ts.map +1 -1
  67. package/dist/pages/HomePage.js +263 -257
  68. package/dist/pages/PaymentLinkPage.js +1 -1
  69. package/dist/pages/PaymentLinkSuccessPage.js +1 -1
  70. package/dist/pages/ProductPage.js +143 -143
  71. package/dist/pages/checkout/components/CheckoutCouponCard.js +5 -5
  72. package/dist/pages/checkout/components/CheckoutPaymentSummaryCard.js +1 -1
  73. package/dist/storefront.css +1 -1
  74. package/dist/storefrontSchemas.js +1 -1
  75. package/package.json +5 -1
  76. package/dist/chunks/node_modules/clsx/dist/clsx-CdyIqUTr.js +0 -16
  77. package/dist/chunks/node_modules/tailwind-merge/dist/bundle-mjs-CF4QheV5.js +0 -1608
  78. package/dist/chunks/pkg/booking-engine/dist/schemas-D_yUBLa0.js +0 -14
  79. package/dist/chunks/pkg/ui/dist/lib/utils-BN5KOMSm.js +0 -8
  80. package/dist/components/BookingPeriodSelector/components/internal/ModalHourPickerField.d.ts +0 -22
  81. package/dist/components/BookingPeriodSelector/components/internal/ModalHourPickerField.d.ts.map +0 -1
  82. package/dist/components/BookingPeriodSelector/components/internal/ModalHourPickerField.js +0 -333
@@ -4,14 +4,14 @@ import { Card as n } from "../ui/card.js";
4
4
  import { ContractSaleDocument as r } from "../components/ContractSaleDocument/Invoice.js";
5
5
  import "../components/ContractSaleDocument/index.js";
6
6
  import { apiGet as i, apiPost as a } from "../lib/apiCall.js";
7
- import { Spinner as o } from "../chunks/pkg/ui/dist/Spinner/index-DzMEU0iA.js";
7
+ import { Spinner as o } from "../chunks/pkg/ui/dist/Spinner/index-Cgi70z_E.js";
8
8
  import { ACCEPT_CONTRACT_SALE_DOCUMENT_ROUTE as s, DOWNLOAD_CONTRACT_SALE_DOCUMENT_PDF_ROUTE as c, GET_CONTRACT_SALE_DOCUMENT_ROUTE as l, acceptContractSaleDocumentResponseSchema as u, contractSaleDocumentApiSchema as d, getContractSaleDocumentResponseSchema as f } from "../lib/contractSaleDocumentApi.js";
9
9
  import { useEffect as p, useState as m } from "react";
10
10
  import { jsx as h, jsxs as g } from "react/jsx-runtime";
11
- import { cn as _ } from "@rpcbase/ui";
12
- import { toast as v } from "@rpcbase/client";
13
- import { Link as y, useLoaderData as b, useLocation as x, useNavigate as S } from "@rpcbase/router";
14
- import { useTranslation as C } from "react-i18next";
11
+ import { toast as _ } from "@rpcbase/client";
12
+ import { Link as v, useLoaderData as y, useLocation as b, useNavigate as x } from "@rpcbase/router";
13
+ import { useTranslation as S } from "react-i18next";
14
+ import { cn as C } from "@rpcbase/ui";
15
15
  import { ArrowLeft as w, ChevronDown as T, Download as E } from "lucide-react";
16
16
  import { Menu as D } from "@base-ui/react/menu";
17
17
  //#region src/pages/ContractSaleDocumentPage.tsx
@@ -55,7 +55,7 @@ var O = (e) => new URLSearchParams(e).get("pdf") === "1", k = (e) => t(new URLSe
55
55
  labelKey: "docs_contract_sale_language_option_fr"
56
56
  };
57
57
  function R({ selectedLanguage: t, onChange: n }) {
58
- let { t: r } = C(), [i, a] = m(!1), o = I.find((e) => e.code === t) ?? L;
58
+ let { t: r } = S(), [i, a] = m(!1), o = I.find((e) => e.code === t) ?? L;
59
59
  return /* @__PURE__ */ g(D.Root, {
60
60
  open: i,
61
61
  onOpenChange: a,
@@ -96,7 +96,7 @@ function R({ selectedLanguage: t, onChange: n }) {
96
96
  t.defaultPrevented || (n(e.code), a(!1));
97
97
  },
98
98
  "data-testid": `contract-sale-document-language-option-${e.code}`,
99
- className: _("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"),
99
+ className: C("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"),
100
100
  children: [/* @__PURE__ */ h("span", { children: r(e.labelKey) }), /* @__PURE__ */ h("span", {
101
101
  className: "text-2xs uppercase text-muted-foreground",
102
102
  children: e.code
@@ -157,7 +157,7 @@ var z = (async ({ ctx: e, params: t }) => {
157
157
  return t.success ? t.data : null;
158
158
  };
159
159
  function V() {
160
- let { t: i, i18n: o } = C(), c = b(), l = x(), d = S(), { storeSlug: f, referenceId: _, saleDocumentId: T } = c, D = c.pdfMode || O(l.search), [A, j] = m(B(c.document)), [I, L] = m(null), [z, V] = m(!1), [H, U] = m(c.error), W = k(l.search) ?? t(A?.language?.customer) ?? c.documentLanguage ?? t(o.language) ?? "fr", G = f && _ && T ? M(f, _, T, W) : null, K = f && _ && T ? N(f, _, T, W) : "";
160
+ let { t: i, i18n: o } = S(), c = y(), l = b(), d = x(), { storeSlug: f, referenceId: C, saleDocumentId: T } = c, D = c.pdfMode || O(l.search), [A, j] = m(B(c.document)), [I, L] = m(null), [z, V] = m(!1), [H, U] = m(c.error), W = k(l.search) ?? t(A?.language?.customer) ?? c.documentLanguage ?? t(o.language) ?? "fr", G = f && C && T ? M(f, C, T, W) : null, K = f && C && T ? N(f, C, T, W) : "";
161
161
  p(() => {
162
162
  j(B(c.document)), U(c.error);
163
163
  }, [c.document, c.error]), p(() => {
@@ -186,7 +186,7 @@ function V() {
186
186
  className: "text-sm text-destructive",
187
187
  children: /* @__PURE__ */ h("span", { children: H ?? i("docs_contract_sale_load_error") })
188
188
  }),
189
- /* @__PURE__ */ h(y, {
189
+ /* @__PURE__ */ h(v, {
190
190
  to: `/${f ?? ""}`,
191
191
  children: /* @__PURE__ */ g(e, {
192
192
  className: "gap-2",
@@ -211,7 +211,7 @@ function V() {
211
211
  let J = async () => {
212
212
  if (!G || z) return;
213
213
  V(!0);
214
- let e = v.loading(i("docs_contract_sale_preparing_pdf"), { icon: F() });
214
+ let e = _.loading(i("docs_contract_sale_preparing_pdf"), { icon: F() });
215
215
  try {
216
216
  let t = await fetch(G, {
217
217
  method: "GET",
@@ -219,11 +219,11 @@ function V() {
219
219
  });
220
220
  if (!t.ok) throw Error(`PDF request failed with status ${t.status}`);
221
221
  let n = await t.blob(), r = window.URL.createObjectURL(n), i = window.document.createElement("a");
222
- i.href = r, i.download = P(t.headers.get("content-disposition"), A.saleDocumentNumber, A.kind), window.document.body.appendChild(i), i.click(), i.remove(), v.dismiss(e), window.setTimeout(() => {
222
+ i.href = r, i.download = P(t.headers.get("content-disposition"), A.saleDocumentNumber, A.kind), window.document.body.appendChild(i), i.click(), i.remove(), _.dismiss(e), window.setTimeout(() => {
223
223
  window.URL.revokeObjectURL(r);
224
224
  }, 0);
225
225
  } catch (t) {
226
- console.error("Failed to download storefront contract sale document PDF", t), v.dismiss(e), v.error(i("docs_contract_sale_download_pdf_error"));
226
+ console.error("Failed to download storefront contract sale document PDF", t), _.dismiss(e), _.error(i("docs_contract_sale_download_pdf_error"));
227
227
  } finally {
228
228
  V(!1);
229
229
  }
@@ -232,7 +232,7 @@ function V() {
232
232
  className: "flex h-dvh min-h-0 flex-col overflow-hidden bg-gradient-to-br from-slate-100 via-slate-100 to-slate-200",
233
233
  children: [/* @__PURE__ */ g("div", {
234
234
  className: "fixed inset-x-0 top-0 z-40 flex h-14 items-center justify-between gap-3 border-b border-border bg-background/70 px-4 backdrop-blur-xl backdrop-saturate-125 supports-[backdrop-filter]:bg-background/55 sm:px-6",
235
- children: [/* @__PURE__ */ g(y, {
235
+ children: [/* @__PURE__ */ g(v, {
236
236
  to: `/${f ?? ""}`,
237
237
  className: "inline-flex items-center gap-2 text-sm font-medium text-slate-700 hover:text-slate-950",
238
238
  children: [/* @__PURE__ */ h(w, {
@@ -291,12 +291,12 @@ function V() {
291
291
  publicDocumentUrl: K,
292
292
  onAccept: async (e) => {
293
293
  let t = e.mode === "signature" ? i("docs_contract_sale_signature_submit_error") : i("docs_contract_sale_acceptance_submit_error");
294
- if (!f || !_ || !T) throw Error(t);
294
+ if (!f || !C || !T) throw Error(t);
295
295
  L(e.mode);
296
296
  try {
297
297
  let n = await a(s, {
298
298
  storeSlug: f,
299
- referenceId: _,
299
+ referenceId: C,
300
300
  saleDocumentId: T,
301
301
  lang: W,
302
302
  acceptance: e.mode === "signature" ? {
@@ -1 +1 @@
1
- {"version":3,"file":"HomePage.d.ts","sourceRoot":"","sources":["../../src/pages/HomePage.tsx"],"names":[],"mappings":"AA2IA,MAAM,CAAC,OAAO,UAAU,QAAQ,4CAstB/B"}
1
+ {"version":3,"file":"HomePage.d.ts","sourceRoot":"","sources":["../../src/pages/HomePage.tsx"],"names":[],"mappings":"AA2IA,MAAM,CAAC,OAAO,UAAU,QAAQ,4CAouB/B"}