@planetaexo/design-system 0.95.1 → 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.d.cts CHANGED
@@ -5058,6 +5058,9 @@ interface DeparturesLabels {
5058
5058
  title: string;
5059
5059
  body: string;
5060
5060
  }>>;
5061
+ /** Sobrescreve o rótulo visível da pílula de status (i18n). Sem override,
5062
+ * cai no rótulo (em inglês) de DEPARTURE_STATUS_MAP. */
5063
+ statusLabels?: Partial<Record<DepartureStatus, string>>;
5061
5064
  }
5062
5065
  interface DeparturesListProps {
5063
5066
  departures: Departure[];
package/dist/index.d.ts CHANGED
@@ -5058,6 +5058,9 @@ interface DeparturesLabels {
5058
5058
  title: string;
5059
5059
  body: string;
5060
5060
  }>>;
5061
+ /** Sobrescreve o rótulo visível da pílula de status (i18n). Sem override,
5062
+ * cai no rótulo (em inglês) de DEPARTURE_STATUS_MAP. */
5063
+ statusLabels?: Partial<Record<DepartureStatus, string>>;
5061
5064
  }
5062
5065
  interface DeparturesListProps {
5063
5066
  departures: Departure[];
package/dist/index.js CHANGED
@@ -18859,7 +18859,7 @@ function FeaturedDeparture({
18859
18859
  labels,
18860
18860
  onSelect
18861
18861
  }) {
18862
- var _a;
18862
+ var _a, _b;
18863
18863
  const spotsLeft = d.capacity - d.travellers;
18864
18864
  const needsQuorum = d.min != null && d.travellers < d.min;
18865
18865
  const eyebrow = needsQuorum ? labels.confirmsIn(d.min - d.travellers) : labels.fillingFast(spotsLeft);
@@ -18878,7 +18878,7 @@ function FeaturedDeparture({
18878
18878
  ] }),
18879
18879
  /* @__PURE__ */ jsxs("div", { className: "mt-2 flex flex-wrap items-center gap-x-3 gap-y-2", children: [
18880
18880
  /* @__PURE__ */ jsx("span", { className: "font-display text-lg font-extrabold tracking-tight whitespace-nowrap", children: fmtDates(d) }),
18881
- /* @__PURE__ */ jsx(StatusChip, { status: d.status }),
18881
+ /* @__PURE__ */ jsx(StatusChip, { status: d.status, label: (_a = labels.statusLabels) == null ? void 0 : _a[d.status] }),
18882
18882
  d.dynamicPricing && /* @__PURE__ */ jsxs(Tooltip, { children: [
18883
18883
  /* @__PURE__ */ jsx(
18884
18884
  TooltipTrigger,
@@ -18912,7 +18912,7 @@ function FeaturedDeparture({
18912
18912
  {
18913
18913
  className: "mt-3",
18914
18914
  current: d.travellers,
18915
- min: (_a = d.min) != null ? _a : d.travellers,
18915
+ min: (_b = d.min) != null ? _b : d.travellers,
18916
18916
  max: d.capacity,
18917
18917
  hideLabels: d.min == null
18918
18918
  }
@@ -18999,14 +18999,17 @@ function MonthChip({
18999
18999
  }
19000
19000
  );
19001
19001
  }
19002
- function StatusChip({ status }) {
19002
+ function StatusChip({
19003
+ status,
19004
+ label
19005
+ }) {
19003
19006
  return /* @__PURE__ */ jsx(
19004
19007
  Chip,
19005
19008
  {
19006
19009
  variant: "solid",
19007
19010
  size: "sm",
19008
19011
  className: "hover:bg-muted hover:text-foreground/80",
19009
- children: STATUS_MAP[status].label
19012
+ children: label != null ? label : STATUS_MAP[status].label
19010
19013
  }
19011
19014
  );
19012
19015
  }
@@ -19015,10 +19018,11 @@ function DepartureRow({
19015
19018
  labels,
19016
19019
  onSelect
19017
19020
  }) {
19018
- var _a;
19021
+ var _a, _b, _c;
19019
19022
  const dateLabel = fmtDates(d);
19020
19023
  const statusTip = (_a = labels.statusTooltips) == null ? void 0 : _a[d.status];
19021
- const pct = Math.max(0, Math.min(100, d.travellers / d.capacity * 100));
19024
+ const pct = d.capacity > 0 ? Math.max(0, Math.min(100, d.travellers / d.capacity * 100)) : 0;
19025
+ const travellersText = labels.travellers(d.travellers, d.capacity);
19022
19026
  const overlayClass = "absolute inset-0 z-0 rounded-2xl focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary";
19023
19027
  const statusBadge = statusTip ? /* @__PURE__ */ jsxs(Tooltip, { children: [
19024
19028
  /* @__PURE__ */ jsx(
@@ -19031,14 +19035,14 @@ function DepartureRow({
19031
19035
  className: "pointer-events-auto cursor-help outline-hidden"
19032
19036
  }
19033
19037
  ),
19034
- children: /* @__PURE__ */ jsx(StatusChip, { status: d.status })
19038
+ children: /* @__PURE__ */ jsx(StatusChip, { status: d.status, label: (_b = labels.statusLabels) == null ? void 0 : _b[d.status] })
19035
19039
  }
19036
19040
  ),
19037
19041
  /* @__PURE__ */ jsxs(TooltipContent, { children: [
19038
19042
  /* @__PURE__ */ jsx("span", { className: "block font-bold", children: statusTip.title }),
19039
19043
  statusTip.body
19040
19044
  ] })
19041
- ] }) : /* @__PURE__ */ jsx(StatusChip, { status: d.status });
19045
+ ] }) : /* @__PURE__ */ jsx(StatusChip, { status: d.status, label: (_c = labels.statusLabels) == null ? void 0 : _c[d.status] });
19042
19046
  return /* @__PURE__ */ 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: [
19043
19047
  d.href ? /* @__PURE__ */ jsx("a", { href: d.href, "aria-label": dateLabel, className: overlayClass }) : /* @__PURE__ */ jsx(
19044
19048
  "button",
@@ -19052,9 +19056,9 @@ function DepartureRow({
19052
19056
  /* @__PURE__ */ jsx("span", { className: "pointer-events-none relative z-10 font-display text-sm font-extrabold tracking-tight whitespace-nowrap sm:order-1", children: dateLabel }),
19053
19057
  /* @__PURE__ */ jsx("span", { className: "pointer-events-none relative z-10 justify-self-end sm:order-3 sm:ml-auto", children: statusBadge }),
19054
19058
  /* @__PURE__ */ jsxs("span", { className: "pointer-events-none relative z-10 inline-flex items-center gap-2 sm:order-2", children: [
19055
- /* @__PURE__ */ jsxs("span", { className: "inline-flex items-center gap-1.5 font-sans text-sm text-muted-foreground whitespace-nowrap", children: [
19059
+ travellersText && /* @__PURE__ */ jsxs("span", { className: "inline-flex items-center gap-1.5 font-sans text-sm text-muted-foreground whitespace-nowrap", children: [
19056
19060
  /* @__PURE__ */ jsx(UsersIcon, { className: "size-4", strokeWidth: 1.6 }),
19057
- labels.travellers(d.travellers, d.capacity)
19061
+ travellersText
19058
19062
  ] }),
19059
19063
  d.dynamicPricing && /* @__PURE__ */ jsxs(Tooltip, { children: [
19060
19064
  /* @__PURE__ */ jsx(