@loczer/storefront-sdk 0.215.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.
- package/dist/components/BookingBikeQuickAddCard/index.js +1 -1
- package/dist/components/BookingBikeVariantDialog/index.js +1 -1
- package/dist/components/BookingPeriodSelector/components/BookingEndDateField.d.ts.map +1 -1
- package/dist/components/BookingPeriodSelector/components/BookingEndDateField.js +82 -83
- package/dist/components/BookingPeriodSelector/components/BookingMobileDateDrawer.d.ts +5 -1
- package/dist/components/BookingPeriodSelector/components/BookingMobileDateDrawer.d.ts.map +1 -1
- package/dist/components/BookingPeriodSelector/components/BookingMobileDateDrawer.js +135 -149
- package/dist/components/BookingPeriodSelector/components/BookingStartDateField.d.ts.map +1 -1
- package/dist/components/BookingPeriodSelector/components/BookingStartDateField.js +34 -35
- package/dist/components/BookingPeriodSelector/useBookingPeriodController.d.ts.map +1 -1
- package/dist/components/BookingPeriodSelector/useBookingPeriodController.js +233 -228
- package/dist/components/ContactSection/index.js +1 -1
- package/dist/components/payment/StripeCardFieldsForm.d.ts.map +1 -1
- package/dist/components/payment/StripeCardFieldsForm.js +43 -33
- package/dist/index.d.ts +5 -1
- package/dist/pages/BookingPage.d.ts.map +1 -1
- package/dist/pages/BookingPage.js +244 -216
- package/dist/pages/CheckoutPage.d.ts.map +1 -1
- package/dist/pages/CheckoutPage.js +219 -219
- package/dist/pages/HomePage.d.ts.map +1 -1
- package/dist/pages/HomePage.js +268 -264
- package/dist/pages/ProductPage.d.ts.map +1 -1
- package/dist/pages/ProductPage.js +182 -182
- package/dist/storefront.css +1 -1
- package/dist/ui/drawer.d.ts +1 -0
- package/dist/ui/drawer.d.ts.map +1 -1
- package/dist/ui/drawer.js +13 -13
- package/package.json +1 -1
|
@@ -141,7 +141,7 @@ function v({ bike: v, detailsPath: y, productDetailsLinkState: b, actionDisabled
|
|
|
141
141
|
value: H(i.id),
|
|
142
142
|
onChange: (e) => W(i.id, e),
|
|
143
143
|
onBlur: () => G(i.id),
|
|
144
|
-
className: "h-8 w-9 rounded-r-none border-r-0 px-1 text-center text-
|
|
144
|
+
className: "h-8 w-9 rounded-r-none border-r-0 px-1 text-center text-base focus-visible:z-10 md:text-sm",
|
|
145
145
|
"aria-label": k("quantity_label"),
|
|
146
146
|
"data-testid": s
|
|
147
147
|
}), /* @__PURE__ */ l(n, {
|
|
@@ -232,7 +232,7 @@ function M({ ariaLabel: e, onQuantityChange: t, quantity: n, testIdPrefix: r })
|
|
|
232
232
|
t(n ? String(A(n)) : "");
|
|
233
233
|
},
|
|
234
234
|
onBlur: () => t(String(A(n))),
|
|
235
|
-
className: T("h-8 w-9 rounded-r-none border-r-0 px-1 text-center text-
|
|
235
|
+
className: T("h-8 w-9 rounded-r-none border-r-0 px-1 text-center text-base focus-visible:z-10", "sm:h-9 sm:w-16 sm:rounded-md sm:border-r sm:px-3"),
|
|
236
236
|
"aria-label": e,
|
|
237
237
|
"data-testid": `${r}-value`
|
|
238
238
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BookingEndDateField.d.ts","sourceRoot":"","sources":["../../../../src/components/BookingPeriodSelector/components/BookingEndDateField.tsx"],"names":[],"mappings":"AAqJA,eAAO,MAAM,mBAAmB,+
|
|
1
|
+
{"version":3,"file":"BookingEndDateField.d.ts","sourceRoot":"","sources":["../../../../src/components/BookingPeriodSelector/components/BookingEndDateField.tsx"],"names":[],"mappings":"AAqJA,eAAO,MAAM,mBAAmB,+CA+iB/B,CAAA"}
|
|
@@ -73,95 +73,95 @@ var b = (e) => String(e).padStart(2, "0"), x = (e) => `${e.getFullYear()}-${b(e.
|
|
|
73
73
|
};
|
|
74
74
|
k.displayName = "BookingEndDateDayButton";
|
|
75
75
|
var A = () => {
|
|
76
|
-
let { labels: e, startDate: n, endDate: r, selectEndDate: u, isEndDatePopoverOpen: d, setIsEndDatePopoverOpen: f, setIsStartTimeSelectOpen: b,
|
|
76
|
+
let { labels: e, startDate: n, endDate: r, selectEndDate: u, isEndDatePopoverOpen: d, setIsEndDatePopoverOpen: f, setIsStartTimeSelectOpen: b, setIsEndTimeSelectOpen: S, hoveredEndDate: C, setHoveredEndDate: A, resetHoveredEndDate: j, labelClassName: M, inputClassName: N, buttonClassName: P, errors: F, dateLocale: I, numberOfMonths: L, isMobile: ee, isHydrated: R, openDatePickerOnFocus: te, withMobileDateDrawer: ne, selectionFlow: z, minSelectableDate: B } = i(), V = ne && ee, H = m(null), U = m(!1), [W, G] = h(null), [K, q] = h(() => w(n ?? r ?? /* @__PURE__ */ new Date())), J = a(), re = !!J;
|
|
77
77
|
p(() => {
|
|
78
78
|
if (typeof document > "u") return;
|
|
79
79
|
let e = document.getElementById("end-date-picker");
|
|
80
80
|
if (!(e instanceof HTMLInputElement)) return;
|
|
81
81
|
let t = (e) => {
|
|
82
|
-
|
|
82
|
+
U.current = e.key === "ArrowUp" || e.key === "ArrowDown";
|
|
83
83
|
};
|
|
84
84
|
return e.addEventListener("keydown", t, !0), () => {
|
|
85
85
|
e.removeEventListener("keydown", t, !0);
|
|
86
86
|
};
|
|
87
87
|
}, []), p(() => {
|
|
88
|
-
if (!d ||
|
|
88
|
+
if (!d || V) return;
|
|
89
89
|
let e = w(n ?? r ?? /* @__PURE__ */ new Date()), t = r ?? n;
|
|
90
|
-
|
|
90
|
+
q(t ? T(e, t, L) : e);
|
|
91
91
|
}, [
|
|
92
92
|
r,
|
|
93
93
|
d,
|
|
94
|
-
|
|
94
|
+
L,
|
|
95
95
|
n
|
|
96
96
|
]), p(() => {
|
|
97
97
|
if (!d) return;
|
|
98
|
-
let e =
|
|
99
|
-
e &&
|
|
98
|
+
let e = C ?? r;
|
|
99
|
+
e && q((t) => T(t, e, L));
|
|
100
100
|
}, [
|
|
101
101
|
r,
|
|
102
|
-
|
|
102
|
+
C,
|
|
103
103
|
d,
|
|
104
|
-
|
|
104
|
+
L
|
|
105
105
|
]), p(() => {
|
|
106
|
-
if (!d || typeof document > "u" || (
|
|
106
|
+
if (!d || typeof document > "u" || (j(), V)) return;
|
|
107
107
|
let e = document.getElementById("end-date-picker");
|
|
108
108
|
if (!(e instanceof HTMLElement)) {
|
|
109
109
|
f(!1);
|
|
110
110
|
return;
|
|
111
111
|
}
|
|
112
112
|
document.activeElement !== e && requestAnimationFrame(() => {
|
|
113
|
-
e.focus({ preventScroll: !0 }),
|
|
113
|
+
e.focus({ preventScroll: !0 }), z === "chained-times" && e.click();
|
|
114
114
|
});
|
|
115
115
|
}, [
|
|
116
116
|
d,
|
|
117
|
-
|
|
118
|
-
|
|
117
|
+
j,
|
|
118
|
+
z,
|
|
119
119
|
f
|
|
120
120
|
]), p(() => {
|
|
121
121
|
if (typeof document > "u") return;
|
|
122
122
|
let e = document.getElementById("end-date-picker");
|
|
123
|
-
if (!(e instanceof HTMLInputElement) ||
|
|
123
|
+
if (!(e instanceof HTMLInputElement) || z !== "chained-times") return;
|
|
124
124
|
let t = () => {
|
|
125
125
|
b(!1);
|
|
126
126
|
};
|
|
127
127
|
return e.addEventListener("focus", t, !0), () => {
|
|
128
128
|
e.removeEventListener("focus", t, !0);
|
|
129
129
|
};
|
|
130
|
-
}, [
|
|
130
|
+
}, [z, b]), p(() => {
|
|
131
131
|
if (d || typeof document > "u") return;
|
|
132
|
-
let e =
|
|
132
|
+
let e = H.current;
|
|
133
133
|
if (!e) return;
|
|
134
134
|
let t = document.getElementById("end-date-calendar")?.querySelector(`[data-day="${e}"] button`);
|
|
135
|
-
t instanceof HTMLElement && D(t),
|
|
135
|
+
t instanceof HTMLElement && D(t), H.current = null, G(null);
|
|
136
136
|
}, [d]);
|
|
137
|
-
let
|
|
137
|
+
let Y = m({
|
|
138
138
|
labels: e,
|
|
139
139
|
startDate: n,
|
|
140
140
|
endDate: r,
|
|
141
|
-
hoveredEndDate:
|
|
142
|
-
keyboardTooltipDay:
|
|
143
|
-
numberOfMonths:
|
|
144
|
-
overlayLayer:
|
|
145
|
-
calendarMonth:
|
|
146
|
-
resetHoveredEndDate:
|
|
147
|
-
setHoveredEndDate:
|
|
141
|
+
hoveredEndDate: C,
|
|
142
|
+
keyboardTooltipDay: W,
|
|
143
|
+
numberOfMonths: L,
|
|
144
|
+
overlayLayer: J,
|
|
145
|
+
calendarMonth: K,
|
|
146
|
+
resetHoveredEndDate: j,
|
|
147
|
+
setHoveredEndDate: A
|
|
148
148
|
});
|
|
149
|
-
|
|
149
|
+
Y.current = {
|
|
150
150
|
labels: e,
|
|
151
151
|
startDate: n,
|
|
152
152
|
endDate: r,
|
|
153
|
-
hoveredEndDate:
|
|
154
|
-
keyboardTooltipDay:
|
|
155
|
-
numberOfMonths:
|
|
156
|
-
overlayLayer:
|
|
157
|
-
calendarMonth:
|
|
158
|
-
resetHoveredEndDate:
|
|
159
|
-
setHoveredEndDate:
|
|
153
|
+
hoveredEndDate: C,
|
|
154
|
+
keyboardTooltipDay: W,
|
|
155
|
+
numberOfMonths: L,
|
|
156
|
+
overlayLayer: J,
|
|
157
|
+
calendarMonth: K,
|
|
158
|
+
resetHoveredEndDate: j,
|
|
159
|
+
setHoveredEndDate: A
|
|
160
160
|
};
|
|
161
|
-
let
|
|
162
|
-
if (!
|
|
161
|
+
let X = m(null);
|
|
162
|
+
if (!X.current) {
|
|
163
163
|
let e = (e) => {
|
|
164
|
-
let { labels: n, startDate: r, endDate: i, hoveredEndDate: a, keyboardTooltipDay: s, numberOfMonths: c, overlayLayer: l, calendarMonth: u, setHoveredEndDate: d } =
|
|
164
|
+
let { labels: n, startDate: r, endDate: i, hoveredEndDate: a, keyboardTooltipDay: s, numberOfMonths: c, overlayLayer: l, calendarMonth: u, setHoveredEndDate: d } = Y.current, f = {
|
|
165
165
|
labels: n,
|
|
166
166
|
startDate: r,
|
|
167
167
|
hoveredEndDate: a,
|
|
@@ -177,7 +177,7 @@ var A = () => {
|
|
|
177
177
|
onMouseLeave: (e) => {
|
|
178
178
|
let t = e.currentTarget;
|
|
179
179
|
requestAnimationFrame(() => {
|
|
180
|
-
t.matches(":hover") ||
|
|
180
|
+
t.matches(":hover") || Y.current.resetHoveredEndDate();
|
|
181
181
|
});
|
|
182
182
|
},
|
|
183
183
|
children: /* @__PURE__ */ g(o, {
|
|
@@ -185,7 +185,7 @@ var A = () => {
|
|
|
185
185
|
mode: "range",
|
|
186
186
|
month: u,
|
|
187
187
|
onMonthChange: (e) => {
|
|
188
|
-
|
|
188
|
+
q(w(e));
|
|
189
189
|
},
|
|
190
190
|
selected: {
|
|
191
191
|
from: r,
|
|
@@ -206,24 +206,24 @@ var A = () => {
|
|
|
206
206
|
})
|
|
207
207
|
});
|
|
208
208
|
};
|
|
209
|
-
e.displayName = "BookingEndDateDayPicker",
|
|
209
|
+
e.displayName = "BookingEndDateDayPicker", X.current = e;
|
|
210
210
|
}
|
|
211
|
-
let
|
|
211
|
+
let Z = X.current, Q = () => {
|
|
212
212
|
if (typeof document > "u") {
|
|
213
|
-
|
|
213
|
+
H.current = null;
|
|
214
214
|
return;
|
|
215
215
|
}
|
|
216
|
-
let e =
|
|
216
|
+
let e = H.current;
|
|
217
217
|
if (!e) return;
|
|
218
218
|
let t = document.getElementById("end-date-calendar")?.querySelector(`[data-day="${e}"] button`);
|
|
219
|
-
t instanceof HTMLElement && D(t),
|
|
220
|
-
},
|
|
219
|
+
t instanceof HTMLElement && D(t), H.current = null, G(null);
|
|
220
|
+
}, $ = (e) => {
|
|
221
221
|
if (typeof document > "u") return;
|
|
222
222
|
let t = x(e);
|
|
223
|
-
if (
|
|
224
|
-
|
|
223
|
+
if (H.current === t) return;
|
|
224
|
+
Q(), H.current = t, G(t);
|
|
225
225
|
let n = 0, r = () => {
|
|
226
|
-
if (
|
|
226
|
+
if (H.current !== t) return;
|
|
227
227
|
let e = document.getElementById("end-date-calendar");
|
|
228
228
|
if (!(e instanceof HTMLElement)) {
|
|
229
229
|
n += 1, n <= 6 && requestAnimationFrame(r);
|
|
@@ -237,17 +237,16 @@ var A = () => {
|
|
|
237
237
|
n += 1, n <= 6 && requestAnimationFrame(r);
|
|
238
238
|
};
|
|
239
239
|
requestAnimationFrame(r);
|
|
240
|
-
}, $ = () => {
|
|
241
|
-
B && f(!0);
|
|
242
240
|
};
|
|
243
241
|
return /* @__PURE__ */ _("div", {
|
|
244
|
-
className: y("group/form-item relative min-w-0 w-full",
|
|
245
|
-
|
|
246
|
-
|
|
242
|
+
className: y("group/form-item relative min-w-0 w-full", V && "cursor-pointer rounded-md"),
|
|
243
|
+
onClick: () => {
|
|
244
|
+
V && (b(!1), S(!1), f(!0));
|
|
245
|
+
},
|
|
247
246
|
children: [
|
|
248
247
|
/* @__PURE__ */ g(s, {
|
|
249
248
|
htmlFor: "end-date-picker",
|
|
250
|
-
className: y("mb-1 block text-sm font-medium",
|
|
249
|
+
className: y("mb-1 block text-sm font-medium", V && "cursor-pointer", M),
|
|
251
250
|
children: /* @__PURE__ */ g("span", { children: e.endDate })
|
|
252
251
|
}),
|
|
253
252
|
re ? /* @__PURE__ */ g(l, {
|
|
@@ -255,10 +254,10 @@ var A = () => {
|
|
|
255
254
|
value: r ?? null,
|
|
256
255
|
placeholder: e.pickEndDate,
|
|
257
256
|
triggerTestId: "end-date-trigger",
|
|
258
|
-
isHydrated:
|
|
259
|
-
open: !
|
|
257
|
+
isHydrated: R,
|
|
258
|
+
open: !V && d,
|
|
260
259
|
onOpenChange: f,
|
|
261
|
-
readOnly:
|
|
260
|
+
readOnly: V,
|
|
262
261
|
openOnFocus: te,
|
|
263
262
|
onValueUpdate: (e) => {
|
|
264
263
|
let t = (() => {
|
|
@@ -267,16 +266,16 @@ var A = () => {
|
|
|
267
266
|
return e instanceof HTMLElement && e.id === "end-date-picker";
|
|
268
267
|
})();
|
|
269
268
|
if (!n || !e || e < n) {
|
|
270
|
-
|
|
269
|
+
j(), t && Q();
|
|
271
270
|
return;
|
|
272
271
|
}
|
|
273
|
-
|
|
272
|
+
A(e), t && $(e);
|
|
274
273
|
},
|
|
275
274
|
onChange: (e) => {
|
|
276
|
-
if (
|
|
277
|
-
if (typeof document > "u") return
|
|
278
|
-
let e = document.activeElement, t =
|
|
279
|
-
return
|
|
275
|
+
if (j(), (() => {
|
|
276
|
+
if (typeof document > "u") return U.current = !1, !1;
|
|
277
|
+
let e = document.activeElement, t = U.current && e instanceof HTMLElement && e.id === "end-date-picker";
|
|
278
|
+
return U.current = !1, t;
|
|
280
279
|
})() || e && r && e.getFullYear() === r.getFullYear() && e.getMonth() === r.getMonth() && e.getDate() === r.getDate()) return;
|
|
281
280
|
let t = (() => {
|
|
282
281
|
if (!e || typeof document > "u") return !1;
|
|
@@ -285,27 +284,27 @@ var A = () => {
|
|
|
285
284
|
})();
|
|
286
285
|
u(e ?? void 0, { openTimePicker: t ? void 0 : !1 });
|
|
287
286
|
},
|
|
288
|
-
inputClassName: y(
|
|
289
|
-
dayPickerComponent:
|
|
287
|
+
inputClassName: y(F.endDate && "border-destructive", N, P),
|
|
288
|
+
dayPickerComponent: Z,
|
|
290
289
|
dayPickerProps: {
|
|
291
290
|
id: "end-date-calendar",
|
|
292
|
-
locale:
|
|
291
|
+
locale: I,
|
|
293
292
|
showOutsideDays: !1,
|
|
294
|
-
numberOfMonths:
|
|
295
|
-
disabled: (e) => n && e < n || e <
|
|
293
|
+
numberOfMonths: L,
|
|
294
|
+
disabled: (e) => n && e < n || e < B,
|
|
296
295
|
autoFocus: !0,
|
|
297
296
|
"data-testid": "end-date-calendar"
|
|
298
297
|
},
|
|
299
|
-
portalContainer:
|
|
298
|
+
portalContainer: J
|
|
300
299
|
}) : /* @__PURE__ */ g(v, {
|
|
301
300
|
id: "end-date-picker",
|
|
302
301
|
value: r ?? null,
|
|
303
302
|
placeholder: e.pickEndDate,
|
|
304
303
|
triggerTestId: "end-date-trigger",
|
|
305
|
-
isHydrated:
|
|
306
|
-
open: !
|
|
304
|
+
isHydrated: R,
|
|
305
|
+
open: !V && d,
|
|
307
306
|
onOpenChange: f,
|
|
308
|
-
readOnly:
|
|
307
|
+
readOnly: V,
|
|
309
308
|
onValueUpdate: (e) => {
|
|
310
309
|
let t = (() => {
|
|
311
310
|
if (!d || typeof document > "u") return !1;
|
|
@@ -313,16 +312,16 @@ var A = () => {
|
|
|
313
312
|
return e instanceof HTMLElement && e.id === "end-date-picker";
|
|
314
313
|
})();
|
|
315
314
|
if (!n || !e || e < n) {
|
|
316
|
-
|
|
315
|
+
j(), t && Q();
|
|
317
316
|
return;
|
|
318
317
|
}
|
|
319
|
-
|
|
318
|
+
A(e), t && $(e);
|
|
320
319
|
},
|
|
321
320
|
onChange: (e) => {
|
|
322
|
-
if (
|
|
323
|
-
if (typeof document > "u") return
|
|
324
|
-
let e = document.activeElement, t =
|
|
325
|
-
return
|
|
321
|
+
if (j(), (() => {
|
|
322
|
+
if (typeof document > "u") return U.current = !1, !1;
|
|
323
|
+
let e = document.activeElement, t = U.current && e instanceof HTMLElement && e.id === "end-date-picker";
|
|
324
|
+
return U.current = !1, t;
|
|
326
325
|
})() || e && r && e.getFullYear() === r.getFullYear() && e.getMonth() === r.getMonth() && e.getDate() === r.getDate()) return;
|
|
327
326
|
let t = (() => {
|
|
328
327
|
if (!e || typeof document > "u") return !1;
|
|
@@ -331,19 +330,19 @@ var A = () => {
|
|
|
331
330
|
})();
|
|
332
331
|
u(e ?? void 0, { openTimePicker: t ? void 0 : !1 });
|
|
333
332
|
},
|
|
334
|
-
inputClassName: y(
|
|
335
|
-
dayPickerComponent:
|
|
333
|
+
inputClassName: y(F.endDate && "border-destructive", N, P),
|
|
334
|
+
dayPickerComponent: Z,
|
|
336
335
|
dayPickerProps: {
|
|
337
336
|
id: "end-date-calendar",
|
|
338
|
-
locale:
|
|
337
|
+
locale: I,
|
|
339
338
|
showOutsideDays: !1,
|
|
340
|
-
numberOfMonths:
|
|
341
|
-
disabled: (e) => n && e < n || e <
|
|
339
|
+
numberOfMonths: L,
|
|
340
|
+
disabled: (e) => n && e < n || e < B,
|
|
342
341
|
autoFocus: !0,
|
|
343
342
|
"data-testid": "end-date-calendar"
|
|
344
343
|
}
|
|
345
344
|
}),
|
|
346
|
-
|
|
345
|
+
F.endDate && /* @__PURE__ */ g(c, { children: F.endDate })
|
|
347
346
|
]
|
|
348
347
|
});
|
|
349
348
|
};
|
|
@@ -1,2 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
type BookingMobileDateDrawerProps = {
|
|
2
|
+
onContinue?: () => void;
|
|
3
|
+
};
|
|
4
|
+
export declare const BookingMobileDateDrawer: ({ onContinue }: BookingMobileDateDrawerProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
5
|
+
export {};
|
|
2
6
|
//# sourceMappingURL=BookingMobileDateDrawer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BookingMobileDateDrawer.d.ts","sourceRoot":"","sources":["../../../../src/components/BookingPeriodSelector/components/BookingMobileDateDrawer.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"BookingMobileDateDrawer.d.ts","sourceRoot":"","sources":["../../../../src/components/BookingPeriodSelector/components/BookingMobileDateDrawer.tsx"],"names":[],"mappings":"AAkCA,KAAK,4BAA4B,GAAG;IAClC,UAAU,CAAC,EAAE,MAAM,IAAI,CAAA;CACxB,CAAA;AAyDD,eAAO,MAAM,uBAAuB,GAAI,gBAAgB,4BAA4B,mDAuTnF,CAAA"}
|