@loczer/storefront-sdk 0.214.0 → 0.216.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 (28) hide show
  1. package/dist/components/BookingBikeQuickAddCard/index.js +1 -1
  2. package/dist/components/BookingBikeVariantDialog/index.js +1 -1
  3. package/dist/components/BookingPeriodSelector/components/BookingEndDateField.d.ts.map +1 -1
  4. package/dist/components/BookingPeriodSelector/components/BookingEndDateField.js +82 -83
  5. package/dist/components/BookingPeriodSelector/components/BookingMobileDateDrawer.d.ts +5 -1
  6. package/dist/components/BookingPeriodSelector/components/BookingMobileDateDrawer.d.ts.map +1 -1
  7. package/dist/components/BookingPeriodSelector/components/BookingMobileDateDrawer.js +135 -149
  8. package/dist/components/BookingPeriodSelector/components/BookingStartDateField.d.ts.map +1 -1
  9. package/dist/components/BookingPeriodSelector/components/BookingStartDateField.js +34 -35
  10. package/dist/components/BookingPeriodSelector/useBookingPeriodController.d.ts.map +1 -1
  11. package/dist/components/BookingPeriodSelector/useBookingPeriodController.js +233 -228
  12. package/dist/components/ContactSection/index.js +1 -1
  13. package/dist/components/payment/StripeCardFieldsForm.d.ts.map +1 -1
  14. package/dist/components/payment/StripeCardFieldsForm.js +43 -33
  15. package/dist/index.d.ts +5 -1
  16. package/dist/pages/BookingPage.d.ts.map +1 -1
  17. package/dist/pages/BookingPage.js +244 -216
  18. package/dist/pages/CheckoutPage.d.ts.map +1 -1
  19. package/dist/pages/CheckoutPage.js +219 -219
  20. package/dist/pages/HomePage.d.ts.map +1 -1
  21. package/dist/pages/HomePage.js +268 -264
  22. package/dist/pages/ProductPage.d.ts.map +1 -1
  23. package/dist/pages/ProductPage.js +182 -182
  24. package/dist/storefront.css +1 -1
  25. package/dist/ui/drawer.d.ts +1 -0
  26. package/dist/ui/drawer.d.ts.map +1 -1
  27. package/dist/ui/drawer.js +58 -47
  28. package/package.json +1 -1
@@ -316,7 +316,7 @@ function L({ storeSlug: L }) {
316
316
  locale: z.language,
317
317
  placeholder: R("contact_form_phone_placeholder"),
318
318
  className: "relative",
319
- inputClassName: O("flex h-11 w-full rounded-md border border-input bg-background py-2 text-base ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm", t.error && "border-destructive focus-visible:ring-destructive"),
319
+ inputClassName: O("flex h-11 w-full rounded-md border border-input bg-background py-2 text-base ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm", t.error && "border-destructive focus-visible:ring-destructive"),
320
320
  renderValidationMessage: ({ message: e }) => t.error?.message ? null : /* @__PURE__ */ w(y, {
321
321
  style: { top: "100%" },
322
322
  children: /* @__PURE__ */ w("span", { children: e })
@@ -1 +1 @@
1
- {"version":3,"file":"StripeCardFieldsForm.d.ts","sourceRoot":"","sources":["../../../src/components/payment/StripeCardFieldsForm.tsx"],"names":[],"mappings":"AAWA,KAAK,iCAAiC,GAAG;IACvC,eAAe,EAAE,MAAM,CAAA;IACvB,cAAc,EAAE,MAAM,CAAA;IACtB,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAA;AAED,KAAK,yBAAyB,GAAG;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,QAAQ,EAAE,CAAC,OAAO,EAAE,iCAAiC,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;CACxE,CAAA;AAED,wBAAgB,oBAAoB,CAAC,EACnC,KAAU,EACV,YAAmB,EACnB,QAAgB,EAChB,WAAW,EACX,eAAe,EACf,QAAQ,GACT,EAAE,yBAAyB,2CA2H3B"}
1
+ {"version":3,"file":"StripeCardFieldsForm.d.ts","sourceRoot":"","sources":["../../../src/components/payment/StripeCardFieldsForm.tsx"],"names":[],"mappings":"AAmBA,KAAK,iCAAiC,GAAG;IACvC,eAAe,EAAE,MAAM,CAAA;IACvB,cAAc,EAAE,MAAM,CAAA;IACtB,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAA;AAED,KAAK,yBAAyB,GAAG;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,QAAQ,EAAE,CAAC,OAAO,EAAE,iCAAiC,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;CACxE,CAAA;AAED,wBAAgB,oBAAoB,CAAC,EACnC,KAAU,EACV,YAAmB,EACnB,QAAgB,EAChB,WAAW,EACX,eAAe,EACf,QAAQ,GACT,EAAE,yBAAyB,2CA2H3B"}
@@ -8,30 +8,31 @@ import { useTranslation as s } from "react-i18next";
8
8
  import { CreditCard as c } from "lucide-react";
9
9
  import { CardCvcElement as l, CardExpiryElement as u, CardNumberElement as d, useElements as f, useStripe as p } from "@stripe/react-stripe-js";
10
10
  //#region src/components/payment/StripeCardFieldsForm.tsx
11
- function m({ email: m = "", requireEmail: h = !0, disabled: g = !1, submitLabel: _, submittingLabel: v, onSubmit: y }) {
12
- let { t: b } = s(), x = p(), S = f(), [C, w] = i(""), [T, E] = i(!1), [D, O] = i(null);
11
+ var m = { style: { base: { fontSize: "16px" } } };
12
+ function h({ email: h = "", requireEmail: g = !0, disabled: _ = !1, submitLabel: v, submittingLabel: y, onSubmit: b }) {
13
+ let { t: x } = s(), S = p(), C = f(), [w, T] = i(""), [E, D] = i(!1), [O, k] = i(null);
13
14
  return /* @__PURE__ */ o("form", {
14
15
  onSubmit: async (e) => {
15
- if (e.preventDefault(), !x || !S) {
16
- O(b("secure_payment_link.errors.stripe_not_ready"));
16
+ if (e.preventDefault(), !S || !C) {
17
+ k(x("secure_payment_link.errors.stripe_not_ready"));
17
18
  return;
18
19
  }
19
- let t = m.trim(), n = C.trim();
20
+ let t = h.trim(), n = w.trim();
20
21
  if (!n) {
21
- O(b("secure_payment_link.form.name_required"));
22
+ k(x("secure_payment_link.form.name_required"));
22
23
  return;
23
24
  }
24
- if (h && !t) {
25
- O(b("secure_payment_link.form.email_required"));
25
+ if (g && !t) {
26
+ k(x("secure_payment_link.form.email_required"));
26
27
  return;
27
28
  }
28
- let r = S.getElement(d);
29
+ let r = C.getElement(d);
29
30
  if (!r) {
30
- O(b("secure_payment_link.errors.stripe_not_ready"));
31
+ k(x("secure_payment_link.errors.stripe_not_ready"));
31
32
  return;
32
33
  }
33
- E(!0), O(null);
34
- let i = await x.createPaymentMethod({
34
+ D(!0), k(null);
35
+ let i = await S.createPaymentMethod({
35
36
  type: "card",
36
37
  card: r,
37
38
  billing_details: {
@@ -40,19 +41,19 @@ function m({ email: m = "", requireEmail: h = !0, disabled: g = !1, submitLabel:
40
41
  }
41
42
  });
42
43
  if (i.error || !i.paymentMethod) {
43
- E(!1), O(i.error?.message ?? b("secure_payment_link.errors.payment_failed"));
44
+ D(!1), k(i.error?.message ?? x("secure_payment_link.errors.payment_failed"));
44
45
  return;
45
46
  }
46
47
  try {
47
- await y({
48
+ await b({
48
49
  paymentMethodId: i.paymentMethod.id,
49
50
  cardholderName: n,
50
51
  email: t || void 0
51
52
  });
52
53
  } catch (e) {
53
- O(e instanceof Error ? e.message : b("secure_payment_link.errors.payment_failed"));
54
+ k(e instanceof Error ? e.message : x("secure_payment_link.errors.payment_failed"));
54
55
  } finally {
55
- E(!1);
56
+ D(!1);
56
57
  }
57
58
  },
58
59
  className: "grid gap-3",
@@ -61,25 +62,28 @@ function m({ email: m = "", requireEmail: h = !0, disabled: g = !1, submitLabel:
61
62
  className: "space-y-1",
62
63
  children: [/* @__PURE__ */ a(t, {
63
64
  htmlFor: "payment-cardholder-name",
64
- children: /* @__PURE__ */ a("span", { children: b("secure_payment_link.form.cardholder_name_label") })
65
+ children: /* @__PURE__ */ a("span", { children: x("secure_payment_link.form.cardholder_name_label") })
65
66
  }), /* @__PURE__ */ a(n, {
66
67
  id: "payment-cardholder-name",
67
- value: C,
68
+ value: w,
68
69
  onChange: (e) => {
69
- w(e.target.value);
70
+ T(e.target.value);
70
71
  },
71
- placeholder: b("secure_payment_link.form.cardholder_name_placeholder"),
72
- disabled: g || T
72
+ placeholder: x("secure_payment_link.form.cardholder_name_placeholder"),
73
+ disabled: _ || E
73
74
  })]
74
75
  }),
75
76
  /* @__PURE__ */ o("div", {
76
77
  className: "space-y-1",
77
78
  children: [/* @__PURE__ */ a(t, {
78
79
  htmlFor: "payment-card-number",
79
- children: /* @__PURE__ */ a("span", { children: b("secure_payment_link.form.card_number_label") })
80
+ children: /* @__PURE__ */ a("span", { children: x("secure_payment_link.form.card_number_label") })
80
81
  }), /* @__PURE__ */ a("div", {
81
82
  className: "rounded-md border border-slate-200 bg-white px-3 py-2",
82
- children: /* @__PURE__ */ a(d, { id: "payment-card-number" })
83
+ children: /* @__PURE__ */ a(d, {
84
+ id: "payment-card-number",
85
+ options: m
86
+ })
83
87
  })]
84
88
  }),
85
89
  /* @__PURE__ */ o("div", {
@@ -88,40 +92,46 @@ function m({ email: m = "", requireEmail: h = !0, disabled: g = !1, submitLabel:
88
92
  className: "space-y-1",
89
93
  children: [/* @__PURE__ */ a(t, {
90
94
  htmlFor: "payment-card-expiry",
91
- children: /* @__PURE__ */ a("span", { children: b("secure_payment_link.form.card_expiry_label") })
95
+ children: /* @__PURE__ */ a("span", { children: x("secure_payment_link.form.card_expiry_label") })
92
96
  }), /* @__PURE__ */ a("div", {
93
97
  className: "rounded-md border border-slate-200 bg-white px-3 py-2",
94
- children: /* @__PURE__ */ a(u, { id: "payment-card-expiry" })
98
+ children: /* @__PURE__ */ a(u, {
99
+ id: "payment-card-expiry",
100
+ options: m
101
+ })
95
102
  })]
96
103
  }), /* @__PURE__ */ o("div", {
97
104
  className: "space-y-1",
98
105
  children: [/* @__PURE__ */ a(t, {
99
106
  htmlFor: "payment-card-cvc",
100
- children: /* @__PURE__ */ a("span", { children: b("secure_payment_link.form.card_cvc_label") })
107
+ children: /* @__PURE__ */ a("span", { children: x("secure_payment_link.form.card_cvc_label") })
101
108
  }), /* @__PURE__ */ a("div", {
102
109
  className: "rounded-md border border-slate-200 bg-white px-3 py-2",
103
- children: /* @__PURE__ */ a(l, { id: "payment-card-cvc" })
110
+ children: /* @__PURE__ */ a(l, {
111
+ id: "payment-card-cvc",
112
+ options: m
113
+ })
104
114
  })]
105
115
  })]
106
116
  }),
107
- D ? /* @__PURE__ */ a("p", {
117
+ O ? /* @__PURE__ */ a("p", {
108
118
  className: "text-sm text-destructive",
109
- children: /* @__PURE__ */ a("span", { children: D })
119
+ children: /* @__PURE__ */ a("span", { children: O })
110
120
  }) : null,
111
121
  /* @__PURE__ */ o(e, {
112
122
  type: "submit",
113
- disabled: g || T || !x || !S,
123
+ disabled: _ || E || !S || !C,
114
124
  className: "gap-2",
115
- children: [T ? /* @__PURE__ */ a(r, {
125
+ children: [E ? /* @__PURE__ */ a(r, {
116
126
  className: "size-4",
117
127
  "aria-hidden": "true"
118
128
  }) : /* @__PURE__ */ a(c, {
119
129
  className: "h-4 w-4",
120
130
  "aria-hidden": "true"
121
- }), /* @__PURE__ */ a("span", { children: T ? v ?? b("secure_payment_link.form.submitting_button") : _ ?? b("secure_payment_link.form.submit_button") })]
131
+ }), /* @__PURE__ */ a("span", { children: E ? y ?? x("secure_payment_link.form.submitting_button") : v ?? x("secure_payment_link.form.submit_button") })]
122
132
  })
123
133
  ]
124
134
  });
125
135
  }
126
136
  //#endregion
127
- export { m as StripeCardFieldsForm };
137
+ export { h as StripeCardFieldsForm };
package/dist/index.d.ts CHANGED
@@ -706,7 +706,11 @@ export declare const bookingInsuranceSnapshotSchema: z.ZodObject<{
706
706
  }, z.core.$strip>>;
707
707
  }, z.core.$strip>;
708
708
 
709
- export declare const BookingMobileDateDrawer: () => JSX.Element | null;
709
+ export declare const BookingMobileDateDrawer: ({ onContinue }: BookingMobileDateDrawerProps) => JSX.Element | null;
710
+
711
+ declare type BookingMobileDateDrawerProps = {
712
+ onContinue?: () => void;
713
+ };
710
714
 
711
715
  export declare type BookingPeriodChangeMeta = {
712
716
  source: "user" | "auto";
@@ -1 +1 @@
1
- {"version":3,"file":"BookingPage.d.ts","sourceRoot":"","sources":["../../src/pages/BookingPage.tsx"],"names":[],"mappings":"AAuMA,MAAM,CAAC,OAAO,UAAU,WAAW,4CAioBlC"}
1
+ {"version":3,"file":"BookingPage.d.ts","sourceRoot":"","sources":["../../src/pages/BookingPage.tsx"],"names":[],"mappings":"AA6MA,MAAM,CAAC,OAAO,UAAU,WAAW,4CAsrBlC"}