@loczer/storefront-sdk 0.195.0 → 0.196.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.
@@ -1 +1 @@
1
- {"version":3,"file":"BookingEndTimeField.d.ts","sourceRoot":"","sources":["../../../../src/components/BookingPeriodSelector/components/BookingEndTimeField.tsx"],"names":[],"mappings":"AAmBA,eAAO,MAAM,mBAAmB,+CAmJ/B,CAAA"}
1
+ {"version":3,"file":"BookingEndTimeField.d.ts","sourceRoot":"","sources":["../../../../src/components/BookingPeriodSelector/components/BookingEndTimeField.tsx"],"names":[],"mappings":"AAmBA,eAAO,MAAM,mBAAmB,+CAqJ/B,CAAA"}
@@ -13,8 +13,8 @@ var d = (e, t, n) => new Intl.NumberFormat(t, {
13
13
  minimumFractionDigits: 0,
14
14
  maximumFractionDigits: 0
15
15
  }).format(e / 100), f = () => {
16
- let { labels: f, localeCode: p, currencyCode: m, endTime: h, selectEndTime: g, availableEndTimeSlots: _, endTimeSlotsStatus: v, isEndTimeSelectOpen: y, setIsEndTimeSelectOpen: b, labelClassName: x, inputClassName: S, buttonClassName: C, errors: w, isHydrated: T, startMinutesValue: E, isSameDaySelection: D, isEndToday: O, earliestMinutesForToday: k } = e(), A = _.map((e) => {
17
- let t = !!D && E != null && e.startMinutes <= E, n = O && k != null && e.startMinutes < k, r = e.isDisabled || t || n, i = e.disabledReason === "closed" ? f.timeSlotClosedLabel ?? "Closed" : e.disabledReason, a = e.isExtra && e.extraAmount != null ? f.timeSlotExtraFee?.({ amount: d(e.extraAmount, p, m) }) ?? `Extra fee: ${d(e.extraAmount, p, m)}` : null, o = e.isDisabled && i ? i : null, u = a && o ? /* @__PURE__ */ l(s, { children: [/* @__PURE__ */ c("span", {
16
+ let { labels: f, localeCode: p, currencyCode: m, endTime: h, selectEndTime: g, availableEndTimeSlots: _, endTimeSlotsStatus: v, isEndTimeSelectOpen: y, setIsEndTimeSelectOpen: b, labelClassName: x, inputClassName: S, buttonClassName: C, errors: w, isMobile: T, isHydrated: E, startMinutesValue: D, isSameDaySelection: O, isEndToday: k, earliestMinutesForToday: A } = e(), j = _.map((e) => {
17
+ let t = !!O && D != null && e.startMinutes <= D, n = k && A != null && e.startMinutes < A, r = e.isDisabled || t || n, i = e.disabledReason === "closed" ? f.timeSlotClosedLabel ?? "Closed" : e.disabledReason, a = e.isExtra && e.extraAmount != null ? f.timeSlotExtraFee?.({ amount: d(e.extraAmount, p, m) }) ?? `Extra fee: ${d(e.extraAmount, p, m)}` : null, o = e.isDisabled && i ? i : null, u = a && o ? /* @__PURE__ */ l(s, { children: [/* @__PURE__ */ c("span", {
18
18
  className: "block",
19
19
  children: a
20
20
  }), /* @__PURE__ */ c("span", {
@@ -27,12 +27,12 @@ var d = (e, t, n) => new Intl.NumberFormat(t, {
27
27
  disabled: r,
28
28
  description: u
29
29
  };
30
- }), j = A.some((e) => !e.disabled), M = v !== "local" && (v !== "ready" || !j), N = v === "loading" ? f.timeSlotsLoading : v === "error" ? f.timeSlotsLoadError : v === "ready" && !j ? f.timeSlotsUnavailable : f.endTime, P = A.find((e) => !e.disabled)?.value, F = o(h ?? P ?? null), I = t();
30
+ }), M = j.some((e) => !e.disabled), N = v !== "local" && (v !== "ready" || !M), P = v === "loading" ? f.timeSlotsLoading : v === "error" ? f.timeSlotsLoadError : v === "ready" && !M ? f.timeSlotsUnavailable : f.endTime, F = j.find((e) => !e.disabled)?.value, I = o(h ?? F ?? null), L = t();
31
31
  return a(() => {
32
- y || (F.current = h ?? P ?? null);
32
+ y || (I.current = h ?? F ?? null);
33
33
  }, [
34
34
  h,
35
- P,
35
+ F,
36
36
  y
37
37
  ]), a(() => {
38
38
  let e = document.getElementById("end-time-picker");
@@ -40,7 +40,7 @@ var d = (e, t, n) => new Intl.NumberFormat(t, {
40
40
  let t = (e) => {
41
41
  if (e.key !== "Enter" || !y) return;
42
42
  e.preventDefault(), e.stopPropagation();
43
- let t = F.current ?? h ?? P;
43
+ let t = I.current ?? h ?? F;
44
44
  t && g(t);
45
45
  };
46
46
  return e.addEventListener("keydown", t, !0), () => {
@@ -48,7 +48,7 @@ var d = (e, t, n) => new Intl.NumberFormat(t, {
48
48
  };
49
49
  }, [
50
50
  h,
51
- P,
51
+ F,
52
52
  y,
53
53
  g
54
54
  ]), /* @__PURE__ */ l("div", {
@@ -61,23 +61,24 @@ var d = (e, t, n) => new Intl.NumberFormat(t, {
61
61
  }),
62
62
  /* @__PURE__ */ c(i, {
63
63
  id: "end-time-picker",
64
- placeholder: N,
64
+ placeholder: P,
65
65
  value: h ?? null,
66
66
  onValueUpdate: (e) => {
67
- e && (F.current = e);
67
+ e && (I.current = e);
68
68
  },
69
69
  onChange: (e) => {
70
- e && (F.current = e, g(e));
70
+ e && (I.current = e, g(e));
71
71
  },
72
- options: A,
73
- disabled: M,
72
+ options: j,
73
+ compact: T,
74
+ disabled: N,
74
75
  open: y,
75
76
  onOpenChange: b,
76
77
  triggerTestId: "end-time-trigger",
77
78
  contentTestId: "end-time-select-content",
78
- isHydrated: T,
79
+ isHydrated: E,
79
80
  inputClassName: u(w.endTime && "border-destructive", S, C),
80
- portalContainer: I
81
+ portalContainer: L
81
82
  }),
82
83
  w.endTime && /* @__PURE__ */ c(r, { children: w.endTime })
83
84
  ]
@@ -1 +1 @@
1
- {"version":3,"file":"BookingStartTimeField.d.ts","sourceRoot":"","sources":["../../../../src/components/BookingPeriodSelector/components/BookingStartTimeField.tsx"],"names":[],"mappings":"AAmBA,eAAO,MAAM,qBAAqB,+CA6IjC,CAAA"}
1
+ {"version":3,"file":"BookingStartTimeField.d.ts","sourceRoot":"","sources":["../../../../src/components/BookingPeriodSelector/components/BookingStartTimeField.tsx"],"names":[],"mappings":"AAmBA,eAAO,MAAM,qBAAqB,+CA+IjC,CAAA"}
@@ -13,8 +13,8 @@ var d = (e, t, n) => new Intl.NumberFormat(t, {
13
13
  minimumFractionDigits: 0,
14
14
  maximumFractionDigits: 0
15
15
  }).format(e / 100), f = () => {
16
- let { labels: f, localeCode: p, currencyCode: m, startTime: h, selectStartTime: g, startTimeSlots: _, startTimeSlotsStatus: v, isStartTimeSelectOpen: y, setIsStartTimeSelectOpen: b, labelClassName: x, inputClassName: S, buttonClassName: C, errors: w, isHydrated: T, isStartToday: E, earliestMinutesForToday: D } = e(), O = _.map((e) => {
17
- let t = E && D != null && e.startMinutes < D, n = e.isDisabled || t, r = e.disabledReason === "closed" ? f.timeSlotClosedLabel ?? "Closed" : e.disabledReason, i = e.isExtra && e.extraAmount != null ? f.timeSlotExtraFee?.({ amount: d(e.extraAmount, p, m) }) ?? `Extra fee: ${d(e.extraAmount, p, m)}` : null, a = e.isDisabled && r ? r : null, o = i && a ? /* @__PURE__ */ l(s, { children: [/* @__PURE__ */ c("span", {
16
+ let { labels: f, localeCode: p, currencyCode: m, startTime: h, selectStartTime: g, startTimeSlots: _, startTimeSlotsStatus: v, isStartTimeSelectOpen: y, setIsStartTimeSelectOpen: b, labelClassName: x, inputClassName: S, buttonClassName: C, errors: w, isMobile: T, isHydrated: E, isStartToday: D, earliestMinutesForToday: O } = e(), k = _.map((e) => {
17
+ let t = D && O != null && e.startMinutes < O, n = e.isDisabled || t, r = e.disabledReason === "closed" ? f.timeSlotClosedLabel ?? "Closed" : e.disabledReason, i = e.isExtra && e.extraAmount != null ? f.timeSlotExtraFee?.({ amount: d(e.extraAmount, p, m) }) ?? `Extra fee: ${d(e.extraAmount, p, m)}` : null, a = e.isDisabled && r ? r : null, o = i && a ? /* @__PURE__ */ l(s, { children: [/* @__PURE__ */ c("span", {
18
18
  className: "block",
19
19
  children: i
20
20
  }), /* @__PURE__ */ c("span", {
@@ -27,11 +27,11 @@ var d = (e, t, n) => new Intl.NumberFormat(t, {
27
27
  disabled: n,
28
28
  description: o
29
29
  };
30
- }), k = O.some((e) => !e.disabled), A = v !== "local" && (v !== "ready" || !k), j = v === "loading" ? f.timeSlotsLoading : v === "error" ? f.timeSlotsLoadError : v === "ready" && !k ? f.timeSlotsUnavailable : f.startTime, M = O.find((e) => !e.disabled)?.value, N = o(h ?? M ?? null), P = t();
30
+ }), A = k.some((e) => !e.disabled), j = v !== "local" && (v !== "ready" || !A), M = v === "loading" ? f.timeSlotsLoading : v === "error" ? f.timeSlotsLoadError : v === "ready" && !A ? f.timeSlotsUnavailable : f.startTime, N = k.find((e) => !e.disabled)?.value, P = o(h ?? N ?? null), F = t();
31
31
  return a(() => {
32
- y || (N.current = h ?? M ?? null);
32
+ y || (P.current = h ?? N ?? null);
33
33
  }, [
34
- M,
34
+ N,
35
35
  y,
36
36
  h
37
37
  ]), a(() => {
@@ -41,14 +41,14 @@ var d = (e, t, n) => new Intl.NumberFormat(t, {
41
41
  let t = (e) => {
42
42
  if (e.key !== "Enter" || !y) return;
43
43
  e.preventDefault(), e.stopPropagation();
44
- let t = N.current ?? h ?? M;
44
+ let t = P.current ?? h ?? N;
45
45
  t && g(t);
46
46
  };
47
47
  return e.addEventListener("keydown", t, !0), () => {
48
48
  e.removeEventListener("keydown", t, !0);
49
49
  };
50
50
  }, [
51
- M,
51
+ N,
52
52
  y,
53
53
  g,
54
54
  h
@@ -62,23 +62,24 @@ var d = (e, t, n) => new Intl.NumberFormat(t, {
62
62
  }),
63
63
  /* @__PURE__ */ c(i, {
64
64
  id: "start-time-picker",
65
- placeholder: j,
65
+ placeholder: M,
66
66
  value: h ?? null,
67
67
  onValueUpdate: (e) => {
68
- e && (N.current = e);
68
+ e && (P.current = e);
69
69
  },
70
70
  onChange: (e) => {
71
- e && (N.current = e, g(e));
71
+ e && (P.current = e, g(e));
72
72
  },
73
- options: O,
74
- disabled: A,
73
+ options: k,
74
+ compact: T,
75
+ disabled: j,
75
76
  open: y,
76
77
  onOpenChange: b,
77
78
  triggerTestId: "start-time-trigger",
78
79
  contentTestId: "start-time-select-content",
79
- isHydrated: T,
80
+ isHydrated: E,
80
81
  inputClassName: u(w.startTime && "border-destructive", S, C),
81
- portalContainer: P
82
+ portalContainer: F
82
83
  }),
83
84
  w.startTime && /* @__PURE__ */ c(r, { children: w.startTime })
84
85
  ]
@@ -1 +1 @@
1
- {"version":3,"file":"BookingHourPickerField.d.ts","sourceRoot":"","sources":["../../../../../src/components/BookingPeriodSelector/components/internal/BookingHourPickerField.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,oBAAoB,EAE1B,MAAM,6BAA6B,CAAA;AAIpC,KAAK,2BAA2B,GAAG,oBAAoB,GAAG;IACxD,eAAe,CAAC,EAAE,WAAW,GAAG,IAAI,CAAA;CACrC,CAAA;AAED,eAAO,MAAM,sBAAsB,GAAI,mEAMpC,2BAA2B,4CAuB7B,CAAA"}
1
+ {"version":3,"file":"BookingHourPickerField.d.ts","sourceRoot":"","sources":["../../../../../src/components/BookingPeriodSelector/components/internal/BookingHourPickerField.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,oBAAoB,EAE1B,MAAM,6BAA6B,CAAA;AAIpC,KAAK,2BAA2B,GAAG,oBAAoB,GAAG;IACxD,eAAe,CAAC,EAAE,WAAW,GAAG,IAAI,CAAA;CACrC,CAAA;AAED,eAAO,MAAM,sBAAsB,GAAI,mEAMpC,2BAA2B,4CAmB7B,CAAA"}
@@ -1,27 +1,26 @@
1
1
  import { cn as e } from "../../../../lib/utils.js";
2
2
  import { HourPickerField as t } from "./StorefrontHourPickerField.js";
3
- import { Fragment as n, jsx as r, jsxs as i } from "react/jsx-runtime";
3
+ import { jsx as n } from "react/jsx-runtime";
4
4
  //#region src/components/BookingPeriodSelector/components/internal/BookingHourPickerField.tsx
5
- var a = ({ options: a, className: o, inputClassName: s, portalContainer: c, ...l }) => {
6
- let u = a.map((e) => ({
5
+ var r = ({ options: r, className: i, inputClassName: a, portalContainer: o, ...s }) => {
6
+ let c = r.map((e) => ({
7
7
  ...e,
8
- selectedLabel: /* @__PURE__ */ i(n, { children: [/* @__PURE__ */ r("span", {
9
- "data-slot": "booking-hour-picker-mobile-selected-label",
10
- className: "md:hidden",
11
- children: e.value
12
- }), /* @__PURE__ */ r("span", {
8
+ selectedLabel: /* @__PURE__ */ n("span", {
13
9
  "data-slot": "booking-hour-picker-desktop-selected-label",
14
- className: "hidden md:inline",
15
10
  children: e.label
16
- })] })
11
+ }),
12
+ compactSelectedLabel: /* @__PURE__ */ n("span", {
13
+ "data-slot": "booking-hour-picker-mobile-selected-label",
14
+ children: e.value
15
+ })
17
16
  }));
18
- return /* @__PURE__ */ r(t, {
19
- ...l,
20
- options: u,
21
- className: e("w-full min-w-0", o),
22
- inputClassName: e("min-w-0", s),
23
- portalContainer: c
17
+ return /* @__PURE__ */ n(t, {
18
+ ...s,
19
+ options: c,
20
+ className: e("w-full min-w-0", i),
21
+ inputClassName: e("min-w-0", a),
22
+ portalContainer: o
24
23
  });
25
24
  };
26
25
  //#endregion
27
- export { a as BookingHourPickerField };
26
+ export { r as BookingHourPickerField };
@@ -3,6 +3,7 @@ export type HourPickerOption = {
3
3
  value: string;
4
4
  label: string;
5
5
  selectedLabel?: React.ReactNode;
6
+ compactSelectedLabel?: React.ReactNode;
6
7
  disabled?: boolean;
7
8
  description?: React.ReactNode;
8
9
  };
@@ -28,8 +29,10 @@ export declare function HourPickerInput({ id, value, onChange, onValueUpdate, op
28
29
  export declare namespace HourPickerInput {
29
30
  var displayName: string;
30
31
  }
31
- export type HourPickerFieldProps = HourPickerInputProps;
32
- export declare function HourPickerField(props: HourPickerFieldProps): import("react/jsx-runtime").JSX.Element;
32
+ export type HourPickerFieldProps = HourPickerInputProps & {
33
+ compact?: boolean;
34
+ };
35
+ export declare function HourPickerField({ compact, ...props }: HourPickerFieldProps): import("react/jsx-runtime").JSX.Element;
33
36
  export declare namespace HourPickerField {
34
37
  var displayName: string;
35
38
  }
@@ -1 +1 @@
1
- {"version":3,"file":"StorefrontHourPickerField.d.ts","sourceRoot":"","sources":["../../../../../src/components/BookingPeriodSelector/components/internal/StorefrontHourPickerField.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAmB9B,MAAM,M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B;yBA9de,eAAe;;;AAke/B,MAAM,MAAM,oBAAoB,GAAG,oBAAoB,CAAA;AA0YvD,wBAAgB,eAAe,CAAC,KAAK,EAAE,oBAAoB,2CAQ1D;yBARe,eAAe"}
1
+ {"version":3,"file":"StorefrontHourPickerField.d.ts","sourceRoot":"","sources":["../../../../../src/components/BookingPeriodSelector/components/internal/StorefrontHourPickerField.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAkB9B,MAAM,MAAM,gBAAgB,GAAG;IAC7B,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;IACb,aAAa,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC/B,oBAAoB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACtC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CAC9B,CAAA;AAyYD,MAAM,MAAM,oBAAoB,GAAG;IACjC,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;IACpB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAA;IACxC,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAA;IAC9C,OAAO,EAAE,gBAAgB,EAAE,CAAA;IAC3B,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAA;IACtC,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,aAAa,CAAC,E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