@resira/ui 0.4.2 → 0.4.3

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/index.cjs CHANGED
@@ -1779,6 +1779,10 @@ function ServiceOverlayCard({
1779
1779
  }) {
1780
1780
  const currency = product.currency ?? "EUR";
1781
1781
  const priceLabel = product.pricingModel === "per_rider" ? "per rider" : product.pricingModel === "per_person" ? locale.perPerson : locale.perSession;
1782
+ const hasMultipleOptions = (product.durationPricing?.length ?? 0) > 1 || (product.riderTierPricing?.length ?? 0) > 1;
1783
+ const lowestPrice = hasMultipleOptions && product.durationPricing?.length ? Math.min(...product.durationPricing.map((dp) => dp.priceCents)) : product.priceCents;
1784
+ const pricePrefix = hasMultipleOptions ? "from " : "";
1785
+ const optionCount = product.durationPricing?.length ?? (product.riderTierPricing?.length ?? 0);
1782
1786
  let className = "resira-service-overlay-card";
1783
1787
  if (isSelected) className += " resira-service-overlay-card--selected";
1784
1788
  if (cardClassName) className += ` ${cardClassName}`;
@@ -1799,17 +1803,22 @@ function ServiceOverlayCard({
1799
1803
  ] }),
1800
1804
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "resira-service-overlay-card-bottom", children: [
1801
1805
  /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "resira-service-overlay-card-price", children: [
1802
- formatPrice2(product.priceCents, currency),
1806
+ pricePrefix,
1807
+ formatPrice2(lowestPrice, currency),
1803
1808
  /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "resira-service-overlay-card-price-unit", children: [
1804
1809
  "/",
1805
1810
  priceLabel
1806
1811
  ] })
1807
1812
  ] }),
1808
1813
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "resira-service-overlay-card-pills", children: [
1809
- product.durationMinutes > 0 && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "resira-service-overlay-card-pill", children: [
1814
+ hasMultipleOptions && optionCount > 1 ? /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "resira-service-overlay-card-pill", children: [
1815
+ /* @__PURE__ */ jsxRuntime.jsx(ClockIcon, { size: 11 }),
1816
+ optionCount,
1817
+ " options"
1818
+ ] }) : product.durationMinutes > 0 ? /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "resira-service-overlay-card-pill", children: [
1810
1819
  /* @__PURE__ */ jsxRuntime.jsx(ClockIcon, { size: 11 }),
1811
1820
  formatDuration2(product.durationMinutes)
1812
- ] }),
1821
+ ] }) : null,
1813
1822
  product.maxPartySize && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "resira-service-overlay-card-pill", children: [
1814
1823
  /* @__PURE__ */ jsxRuntime.jsx(UsersIcon, { size: 11 }),
1815
1824
  "max ",
@@ -3026,8 +3035,14 @@ function ResiraBookingWidget() {
3026
3035
  partySize: clampedPartySize
3027
3036
  };
3028
3037
  });
3038
+ if (step === "resource" && isServiceBased) {
3039
+ const nextIdx = stepIndex("resource", STEPS) + 1;
3040
+ if (nextIdx < STEPS.length) {
3041
+ setStep(STEPS[nextIdx]);
3042
+ }
3043
+ }
3029
3044
  },
3030
- [setActiveResourceId, domainConfig.maxPartySize]
3045
+ [setActiveResourceId, domainConfig.maxPartySize, step, isServiceBased, STEPS]
3031
3046
  );
3032
3047
  const handleResourceSelect = react.useCallback(
3033
3048
  (resourceId) => {