@planetaexo/design-system 0.13.1 → 0.14.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
@@ -2172,7 +2172,7 @@ function OfferAdventureCard({ adventure }) {
2172
2172
  }
2173
2173
  function Offer({
2174
2174
  logo = "/logo-planetaexo.png",
2175
- logoAlt = "Planeta EXO",
2175
+ logoAlt = "PlanetaEXO",
2176
2176
  title,
2177
2177
  subtitle,
2178
2178
  adventures,
@@ -3202,6 +3202,7 @@ function OrderSummary({
3202
3202
  balanceDueLabel,
3203
3203
  totalPaidLabel
3204
3204
  }) {
3205
+ var _a;
3205
3206
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "rounded-2xl border border-border bg-card p-5 lg:p-6 flex flex-col gap-4", children: [
3206
3207
  /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-xs font-bold text-muted-foreground font-heading uppercase tracking-widest", children: "Order Summary" }),
3207
3208
  /* @__PURE__ */ jsxRuntime.jsx(Separator, {}),
@@ -3289,7 +3290,8 @@ function OrderSummary({
3289
3290
  depositInfo && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-2 rounded-lg bg-muted/50 border border-border p-4", children: [
3290
3291
  !depositInfo.hideDepositLine && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between", children: [
3291
3292
  /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-sm text-muted-foreground font-sans", children: [
3292
- "Deposit (",
3293
+ (_a = depositInfo.depositLabel) != null ? _a : "Deposit",
3294
+ " (",
3293
3295
  depositInfo.depositPercent,
3294
3296
  "%)"
3295
3297
  ] }),
@@ -4869,7 +4871,9 @@ var DEFAULT_LABELS3 = {
4869
4871
  nationalityLabel: "Nationality",
4870
4872
  selectPlaceholder: "Select an option\u2026",
4871
4873
  optionalLabel: "(optional)",
4872
- requiredFieldError: "Required"
4874
+ requiredFieldError: "Required",
4875
+ dateLabel: "Date",
4876
+ datesLabel: "Dates"
4873
4877
  };
4874
4878
  var TERMS_ACCEPT_KEY = "__registrationTermsAccepted";
4875
4879
  function emptyName() {
@@ -5480,7 +5484,7 @@ function FieldRenderer({
5480
5484
  }
5481
5485
  function RegistrationForm({
5482
5486
  logo = "/logo-planetaexo.png",
5483
- logoAlt = "Planeta EXO",
5487
+ logoAlt = "PlanetaEXO",
5484
5488
  heroImage,
5485
5489
  heroImageAlt = "",
5486
5490
  title,
@@ -5650,7 +5654,7 @@ function RegistrationForm({
5650
5654
  /* @__PURE__ */ jsxRuntime.jsx("dd", { className: "text-foreground font-medium text-right min-w-0 break-words", children: adventure.name })
5651
5655
  ] }),
5652
5656
  dateRange && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start justify-between gap-x-4", children: [
5653
- /* @__PURE__ */ jsxRuntime.jsx("dt", { className: "text-muted-foreground", children: (adventure == null ? void 0 : adventure.startDate) && (adventure == null ? void 0 : adventure.endDate) ? "Dates" : "Date" }),
5657
+ /* @__PURE__ */ jsxRuntime.jsx("dt", { className: "text-muted-foreground", children: (adventure == null ? void 0 : adventure.startDate) && (adventure == null ? void 0 : adventure.endDate) ? L.datesLabel : L.dateLabel }),
5654
5658
  /* @__PURE__ */ jsxRuntime.jsx("dd", { className: "text-foreground text-right min-w-0", children: dateRange })
5655
5659
  ] }),
5656
5660
  (adventure == null ? void 0 : adventure.partnerName) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start justify-between gap-x-4", children: [
@@ -5834,7 +5838,7 @@ function phoneCountryDial(code) {
5834
5838
  var _a, _b;
5835
5839
  return (_b = (_a = PHONE_COUNTRIES.find((c) => c.code === code)) == null ? void 0 : _a.dial) != null ? _b : code;
5836
5840
  }
5837
- function defaultFormatAnswer(field, value, fmtDate) {
5841
+ function defaultFormatAnswer(field, value, fmtDate, booleanLabels = { yes: "Yes", no: "No" }) {
5838
5842
  var _a, _b, _c, _d, _e, _f;
5839
5843
  if (value == null || value === "") return "\u2014";
5840
5844
  if (value instanceof Date) return fmtDate(value);
@@ -5844,7 +5848,7 @@ function defaultFormatAnswer(field, value, fmtDate) {
5844
5848
  }
5845
5849
  return value.filter(Boolean).join(", ") || "\u2014";
5846
5850
  }
5847
- if (typeof value === "boolean") return value ? "Yes" : "No";
5851
+ if (typeof value === "boolean") return value ? booleanLabels.yes : booleanLabels.no;
5848
5852
  if (typeof value === "object") {
5849
5853
  if ("contactName" in value) {
5850
5854
  const ec = value;
@@ -5899,11 +5903,12 @@ function RegistrationSuccessCard({
5899
5903
  booking,
5900
5904
  traveller,
5901
5905
  tripInfoLabels,
5906
+ booleanLabels,
5902
5907
  density = "comfortable",
5903
5908
  submissionTimestamps,
5904
5909
  submissionTimestampsLabels
5905
5910
  }) {
5906
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
5911
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
5907
5912
  const isMinimal = variant === "minimal";
5908
5913
  const isCompact = density === "compact";
5909
5914
  const sorted = isMinimal ? [] : [...fields].sort((a, b) => {
@@ -5917,11 +5922,17 @@ function RegistrationSuccessCard({
5917
5922
  adventureLabel: (_b = tripInfoLabels == null ? void 0 : tripInfoLabels.adventureLabel) != null ? _b : "Adventure",
5918
5923
  bookingLabel: (_c = tripInfoLabels == null ? void 0 : tripInfoLabels.bookingLabel) != null ? _c : "Booking",
5919
5924
  partnerLabel: (_d = tripInfoLabels == null ? void 0 : tripInfoLabels.partnerLabel) != null ? _d : "Partner",
5920
- travellerLabel: (_e = tripInfoLabels == null ? void 0 : tripInfoLabels.travellerLabel) != null ? _e : "Traveller"
5925
+ travellerLabel: (_e = tripInfoLabels == null ? void 0 : tripInfoLabels.travellerLabel) != null ? _e : "Traveller",
5926
+ dateLabel: (_f = tripInfoLabels == null ? void 0 : tripInfoLabels.dateLabel) != null ? _f : "Date",
5927
+ datesLabel: (_g = tripInfoLabels == null ? void 0 : tripInfoLabels.datesLabel) != null ? _g : "Dates"
5928
+ };
5929
+ const BL = {
5930
+ yes: (_h = booleanLabels == null ? void 0 : booleanLabels.yes) != null ? _h : "Yes",
5931
+ no: (_i = booleanLabels == null ? void 0 : booleanLabels.no) != null ? _i : "No"
5921
5932
  };
5922
5933
  const STL = {
5923
- submittedAt: (_f = submissionTimestampsLabels == null ? void 0 : submissionTimestampsLabels.submittedAt) != null ? _f : "Submitted",
5924
- lastUpdatedAt: (_g = submissionTimestampsLabels == null ? void 0 : submissionTimestampsLabels.lastUpdatedAt) != null ? _g : "Last updated"
5934
+ submittedAt: (_j = submissionTimestampsLabels == null ? void 0 : submissionTimestampsLabels.submittedAt) != null ? _j : "Submitted",
5935
+ lastUpdatedAt: (_k = submissionTimestampsLabels == null ? void 0 : submissionTimestampsLabels.lastUpdatedAt) != null ? _k : "Last updated"
5925
5936
  };
5926
5937
  const hasTimestamps = !isMinimal && !!submissionTimestamps && (!!submissionTimestamps.submittedAt || !!submissionTimestamps.lastUpdatedAt);
5927
5938
  return /* @__PURE__ */ jsxRuntime.jsxs(
@@ -5972,7 +5983,7 @@ function RegistrationSuccessCard({
5972
5983
  /* @__PURE__ */ jsxRuntime.jsx("dd", { className: "w-1/2 text-foreground font-medium text-right min-w-0 break-words", children: adventure.name })
5973
5984
  ] }),
5974
5985
  dateRange && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start gap-x-4", children: [
5975
- /* @__PURE__ */ jsxRuntime.jsx("dt", { className: "w-1/2 text-muted-foreground break-words", children: (adventure == null ? void 0 : adventure.startDate) && (adventure == null ? void 0 : adventure.endDate) ? "Dates" : "Date" }),
5986
+ /* @__PURE__ */ jsxRuntime.jsx("dt", { className: "w-1/2 text-muted-foreground break-words", children: (adventure == null ? void 0 : adventure.startDate) && (adventure == null ? void 0 : adventure.endDate) ? TL.datesLabel : TL.dateLabel }),
5976
5987
  /* @__PURE__ */ jsxRuntime.jsx("dd", { className: "w-1/2 text-foreground text-right min-w-0 break-words", children: dateRange })
5977
5988
  ] }),
5978
5989
  (adventure == null ? void 0 : adventure.partnerName) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start gap-x-4", children: [
@@ -5990,18 +6001,18 @@ function RegistrationSuccessCard({
5990
6001
  ] }) }),
5991
6002
  sorted.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(FormSection2, { title: answersTitle, children: /* @__PURE__ */ jsxRuntime.jsx("dl", { className: "flex flex-col gap-y-3 text-sm font-ui", children: sorted.map((f) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start gap-x-4", children: [
5992
6003
  /* @__PURE__ */ jsxRuntime.jsx("dt", { className: "w-1/2 text-muted-foreground break-words", children: f.label }),
5993
- /* @__PURE__ */ jsxRuntime.jsx("dd", { className: "w-1/2 text-foreground text-right min-w-0 break-words", children: (formatAnswer != null ? formatAnswer : ((field, v) => defaultFormatAnswer(field, v, dateFormatter)))(
6004
+ /* @__PURE__ */ jsxRuntime.jsx("dd", { className: "w-1/2 text-foreground text-right min-w-0 break-words", children: (formatAnswer != null ? formatAnswer : ((field, v) => defaultFormatAnswer(field, v, dateFormatter, BL)))(
5994
6005
  f,
5995
6006
  answers[f.id]
5996
6007
  ) })
5997
6008
  ] }, f.id)) }) }),
5998
- !isMinimal && terms && /* @__PURE__ */ jsxRuntime.jsx(FormSection2, { title: (_h = termsLabels == null ? void 0 : termsLabels.title) != null ? _h : "Terms & Conditions", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-3 text-sm font-ui", children: [
6009
+ !isMinimal && terms && /* @__PURE__ */ jsxRuntime.jsx(FormSection2, { title: (_l = termsLabels == null ? void 0 : termsLabels.title) != null ? _l : "Terms & Conditions", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-3 text-sm font-ui", children: [
5999
6010
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
6000
6011
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn(
6001
6012
  "inline-flex h-5 w-5 items-center justify-center rounded-full text-white text-xs font-bold",
6002
6013
  terms.accepted ? "bg-primary" : "bg-destructive"
6003
6014
  ), children: terms.accepted ? "\u2713" : "\u2717" }),
6004
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: terms.accepted ? "text-primary font-medium" : "text-destructive font-medium", children: terms.accepted ? (_i = termsLabels == null ? void 0 : termsLabels.accepted) != null ? _i : "Accepted" : (_j = termsLabels == null ? void 0 : termsLabels.notAccepted) != null ? _j : "Not accepted" })
6015
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: terms.accepted ? "text-primary font-medium" : "text-destructive font-medium", children: terms.accepted ? (_m = termsLabels == null ? void 0 : termsLabels.accepted) != null ? _m : "Accepted" : (_n = termsLabels == null ? void 0 : termsLabels.notAccepted) != null ? _n : "Not accepted" })
6005
6016
  ] }),
6006
6017
  termsLayout === "full" && terms.markdown.trim().length > 0 && /* @__PURE__ */ jsxRuntime.jsx(
6007
6018
  "div",
@@ -7598,7 +7609,7 @@ function SiteHeader({
7598
7609
  variant = "transparent",
7599
7610
  links = DEFAULT_HEADER_LINKS,
7600
7611
  logoSrc = "/logo-planetaexo.png",
7601
- logoAlt = "Planeta Exo",
7612
+ logoAlt = "PlanetaEXO",
7602
7613
  languages = DEFAULT_LANGUAGES,
7603
7614
  currentLanguage = "EN",
7604
7615
  onLanguageChange,