@planetaexo/design-system 0.95.2 → 0.96.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/index.cjs CHANGED
@@ -18880,7 +18880,7 @@ function FeaturedDeparture({
18880
18880
  labels,
18881
18881
  onSelect
18882
18882
  }) {
18883
- var _a;
18883
+ var _a, _b;
18884
18884
  const spotsLeft = d.capacity - d.travellers;
18885
18885
  const needsQuorum = d.min != null && d.travellers < d.min;
18886
18886
  const eyebrow = needsQuorum ? labels.confirmsIn(d.min - d.travellers) : labels.fillingFast(spotsLeft);
@@ -18899,7 +18899,7 @@ function FeaturedDeparture({
18899
18899
  ] }),
18900
18900
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mt-2 flex flex-wrap items-center gap-x-3 gap-y-2", children: [
18901
18901
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-display text-lg font-extrabold tracking-tight whitespace-nowrap", children: fmtDates(d) }),
18902
- /* @__PURE__ */ jsxRuntime.jsx(StatusChip, { status: d.status }),
18902
+ /* @__PURE__ */ jsxRuntime.jsx(StatusChip, { status: d.status, label: (_a = labels.statusLabels) == null ? void 0 : _a[d.status] }),
18903
18903
  d.dynamicPricing && /* @__PURE__ */ jsxRuntime.jsxs(Tooltip, { children: [
18904
18904
  /* @__PURE__ */ jsxRuntime.jsx(
18905
18905
  TooltipTrigger,
@@ -18933,7 +18933,7 @@ function FeaturedDeparture({
18933
18933
  {
18934
18934
  className: "mt-3",
18935
18935
  current: d.travellers,
18936
- min: (_a = d.min) != null ? _a : d.travellers,
18936
+ min: (_b = d.min) != null ? _b : d.travellers,
18937
18937
  max: d.capacity,
18938
18938
  hideLabels: d.min == null
18939
18939
  }
@@ -19020,14 +19020,17 @@ function MonthChip({
19020
19020
  }
19021
19021
  );
19022
19022
  }
19023
- function StatusChip({ status }) {
19023
+ function StatusChip({
19024
+ status,
19025
+ label
19026
+ }) {
19024
19027
  return /* @__PURE__ */ jsxRuntime.jsx(
19025
19028
  Chip,
19026
19029
  {
19027
19030
  variant: "solid",
19028
19031
  size: "sm",
19029
19032
  className: "hover:bg-muted hover:text-foreground/80",
19030
- children: STATUS_MAP[status].label
19033
+ children: label != null ? label : STATUS_MAP[status].label
19031
19034
  }
19032
19035
  );
19033
19036
  }
@@ -19036,10 +19039,11 @@ function DepartureRow({
19036
19039
  labels,
19037
19040
  onSelect
19038
19041
  }) {
19039
- var _a;
19042
+ var _a, _b, _c;
19040
19043
  const dateLabel = fmtDates(d);
19041
19044
  const statusTip = (_a = labels.statusTooltips) == null ? void 0 : _a[d.status];
19042
- const pct = Math.max(0, Math.min(100, d.travellers / d.capacity * 100));
19045
+ const pct = d.capacity > 0 ? Math.max(0, Math.min(100, d.travellers / d.capacity * 100)) : 0;
19046
+ const travellersText = labels.travellers(d.travellers, d.capacity);
19043
19047
  const overlayClass = "absolute inset-0 z-0 rounded-2xl focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary";
19044
19048
  const statusBadge = statusTip ? /* @__PURE__ */ jsxRuntime.jsxs(Tooltip, { children: [
19045
19049
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -19052,14 +19056,14 @@ function DepartureRow({
19052
19056
  className: "pointer-events-auto cursor-help outline-hidden"
19053
19057
  }
19054
19058
  ),
19055
- children: /* @__PURE__ */ jsxRuntime.jsx(StatusChip, { status: d.status })
19059
+ children: /* @__PURE__ */ jsxRuntime.jsx(StatusChip, { status: d.status, label: (_b = labels.statusLabels) == null ? void 0 : _b[d.status] })
19056
19060
  }
19057
19061
  ),
19058
19062
  /* @__PURE__ */ jsxRuntime.jsxs(TooltipContent, { children: [
19059
19063
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "block font-bold", children: statusTip.title }),
19060
19064
  statusTip.body
19061
19065
  ] })
19062
- ] }) : /* @__PURE__ */ jsxRuntime.jsx(StatusChip, { status: d.status });
19066
+ ] }) : /* @__PURE__ */ jsxRuntime.jsx(StatusChip, { status: d.status, label: (_c = labels.statusLabels) == null ? void 0 : _c[d.status] });
19063
19067
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "group relative grid grid-cols-[1fr_auto] items-center gap-x-3 gap-y-2 overflow-hidden rounded-2xl border border-border p-3.5 pb-4 transition-colors hover:border-foreground/25 hover:bg-muted/40 has-focus-visible:border-foreground/25 sm:flex sm:flex-nowrap sm:gap-4", children: [
19064
19068
  d.href ? /* @__PURE__ */ jsxRuntime.jsx("a", { href: d.href, "aria-label": dateLabel, className: overlayClass }) : /* @__PURE__ */ jsxRuntime.jsx(
19065
19069
  "button",
@@ -19073,9 +19077,9 @@ function DepartureRow({
19073
19077
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "pointer-events-none relative z-10 font-display text-sm font-extrabold tracking-tight whitespace-nowrap sm:order-1", children: dateLabel }),
19074
19078
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "pointer-events-none relative z-10 justify-self-end sm:order-3 sm:ml-auto", children: statusBadge }),
19075
19079
  /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "pointer-events-none relative z-10 inline-flex items-center gap-2 sm:order-2", children: [
19076
- /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "inline-flex items-center gap-1.5 font-sans text-sm text-muted-foreground whitespace-nowrap", children: [
19080
+ travellersText && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "inline-flex items-center gap-1.5 font-sans text-sm text-muted-foreground whitespace-nowrap", children: [
19077
19081
  /* @__PURE__ */ jsxRuntime.jsx(lucideReact.UsersIcon, { className: "size-4", strokeWidth: 1.6 }),
19078
- labels.travellers(d.travellers, d.capacity)
19082
+ travellersText
19079
19083
  ] }),
19080
19084
  d.dynamicPricing && /* @__PURE__ */ jsxRuntime.jsxs(Tooltip, { children: [
19081
19085
  /* @__PURE__ */ jsxRuntime.jsx(