@planetaexo/design-system 0.9.2 → 0.9.4

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
@@ -3894,8 +3894,11 @@ function BookingConfirmationEmail({
3894
3894
  );
3895
3895
  }
3896
3896
  function BookingOtpEmail({
3897
- bodyMessage,
3897
+ greeting,
3898
+ intro,
3899
+ code,
3898
3900
  expiryMessage,
3901
+ teamSignature,
3899
3902
  logoUrl,
3900
3903
  className
3901
3904
  }) {
@@ -3915,15 +3918,44 @@ function BookingOtpEmail({
3915
3918
  className,
3916
3919
  children: [
3917
3920
  /* @__PURE__ */ jsxRuntime.jsx(EmailLogo, { src: logoUrl }),
3921
+ /* @__PURE__ */ jsxRuntime.jsx("p", { style: { fontSize: "16px", lineHeight: "1.5", margin: "0 0 12px" }, children: greeting }),
3922
+ /* @__PURE__ */ jsxRuntime.jsx("p", { style: { fontSize: "15px", lineHeight: "1.5", margin: "0 0 24px" }, children: intro }),
3918
3923
  /* @__PURE__ */ jsxRuntime.jsx(
3919
- "p",
3924
+ "table",
3920
3925
  {
3921
- style: {
3922
- fontSize: "16px",
3923
- lineHeight: "1.6",
3924
- margin: "0 0 16px"
3925
- },
3926
- children: bodyMessage
3926
+ role: "presentation",
3927
+ cellPadding: 0,
3928
+ cellSpacing: 0,
3929
+ border: 0,
3930
+ style: { width: "100%", borderCollapse: "collapse", margin: "0 0 24px" },
3931
+ children: /* @__PURE__ */ jsxRuntime.jsx("tbody", { children: /* @__PURE__ */ jsxRuntime.jsx("tr", { children: /* @__PURE__ */ jsxRuntime.jsx(
3932
+ "td",
3933
+ {
3934
+ align: "center",
3935
+ style: {
3936
+ backgroundColor: emailTokens.primaryLight,
3937
+ border: `1px solid ${emailTokens.border}`,
3938
+ borderRadius: "12px",
3939
+ padding: "24px 16px"
3940
+ },
3941
+ children: /* @__PURE__ */ jsxRuntime.jsx(
3942
+ "div",
3943
+ {
3944
+ style: {
3945
+ fontFamily: emailTokens.fontFamily,
3946
+ fontSize: "36px",
3947
+ fontWeight: 700,
3948
+ letterSpacing: "0.3em",
3949
+ color: emailTokens.foreground,
3950
+ lineHeight: 1,
3951
+ // Padding esquerdo compensa letter-spacing final, mantendo visualmente centralizado.
3952
+ paddingLeft: "0.3em"
3953
+ },
3954
+ children: code
3955
+ }
3956
+ )
3957
+ }
3958
+ ) }) })
3927
3959
  }
3928
3960
  ),
3929
3961
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -3933,11 +3965,12 @@ function BookingOtpEmail({
3933
3965
  color: emailTokens.mutedForeground,
3934
3966
  fontSize: "14px",
3935
3967
  lineHeight: "1.5",
3936
- margin: "0"
3968
+ margin: "0 0 24px"
3937
3969
  },
3938
3970
  children: expiryMessage
3939
3971
  }
3940
- )
3972
+ ),
3973
+ /* @__PURE__ */ jsxRuntime.jsx("p", { style: { fontSize: "14px", lineHeight: "1.5", margin: "0" }, children: teamSignature })
3941
3974
  ]
3942
3975
  }
3943
3976
  );
@@ -5572,12 +5605,14 @@ function RegistrationSuccessCard({
5572
5605
  logo,
5573
5606
  logoAlt = "PlanetaEXO",
5574
5607
  terms,
5608
+ termsLayout = "summary",
5609
+ termsLabels,
5575
5610
  adventure,
5576
5611
  booking,
5577
5612
  traveller,
5578
5613
  tripInfoLabels
5579
5614
  }) {
5580
- var _a, _b, _c, _d, _e;
5615
+ var _a, _b, _c, _d, _e, _f, _g, _h;
5581
5616
  const isMinimal = variant === "minimal";
5582
5617
  const sorted = isMinimal ? [] : [...fields].sort((a, b) => {
5583
5618
  var _a2, _b2;
@@ -5609,40 +5644,43 @@ function RegistrationSuccessCard({
5609
5644
  message && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground font-ui", children: message })
5610
5645
  ] }),
5611
5646
  hasTripInfo && /* @__PURE__ */ jsxRuntime.jsx(FormSection2, { title: TL.sectionTitle, children: /* @__PURE__ */ jsxRuntime.jsxs("dl", { className: "flex flex-col gap-y-3 text-sm font-ui", children: [
5612
- adventure && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start justify-between gap-x-4", children: [
5613
- /* @__PURE__ */ jsxRuntime.jsx("dt", { className: "text-muted-foreground", children: TL.adventureLabel }),
5614
- /* @__PURE__ */ jsxRuntime.jsx("dd", { className: "text-foreground font-medium text-right min-w-0 break-words", children: adventure.name })
5647
+ adventure && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start gap-x-4", children: [
5648
+ /* @__PURE__ */ jsxRuntime.jsx("dt", { className: "w-1/2 text-muted-foreground break-words", children: TL.adventureLabel }),
5649
+ /* @__PURE__ */ jsxRuntime.jsx("dd", { className: "w-1/2 text-foreground font-medium text-right min-w-0 break-words", children: adventure.name })
5615
5650
  ] }),
5616
- dateRange && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start justify-between gap-x-4", children: [
5617
- /* @__PURE__ */ jsxRuntime.jsx("dt", { className: "text-muted-foreground", children: (adventure == null ? void 0 : adventure.startDate) && (adventure == null ? void 0 : adventure.endDate) ? "Dates" : "Date" }),
5618
- /* @__PURE__ */ jsxRuntime.jsx("dd", { className: "text-foreground text-right min-w-0", children: dateRange })
5651
+ dateRange && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start gap-x-4", children: [
5652
+ /* @__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" }),
5653
+ /* @__PURE__ */ jsxRuntime.jsx("dd", { className: "w-1/2 text-foreground text-right min-w-0 break-words", children: dateRange })
5619
5654
  ] }),
5620
- (adventure == null ? void 0 : adventure.partnerName) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start justify-between gap-x-4", children: [
5621
- /* @__PURE__ */ jsxRuntime.jsx("dt", { className: "text-muted-foreground", children: TL.partnerLabel }),
5622
- /* @__PURE__ */ jsxRuntime.jsx("dd", { className: "text-foreground text-right min-w-0", children: adventure.partnerName })
5655
+ (adventure == null ? void 0 : adventure.partnerName) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start gap-x-4", children: [
5656
+ /* @__PURE__ */ jsxRuntime.jsx("dt", { className: "w-1/2 text-muted-foreground break-words", children: TL.partnerLabel }),
5657
+ /* @__PURE__ */ jsxRuntime.jsx("dd", { className: "w-1/2 text-foreground text-right min-w-0 break-words", children: adventure.partnerName })
5623
5658
  ] }),
5624
- booking && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start justify-between gap-x-4", children: [
5625
- /* @__PURE__ */ jsxRuntime.jsx("dt", { className: "text-muted-foreground", children: TL.bookingLabel }),
5626
- /* @__PURE__ */ jsxRuntime.jsx("dd", { className: "text-foreground font-mono tabular-nums text-right min-w-0", children: booking.id })
5659
+ booking && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start gap-x-4", children: [
5660
+ /* @__PURE__ */ jsxRuntime.jsx("dt", { className: "w-1/2 text-muted-foreground break-words", children: TL.bookingLabel }),
5661
+ /* @__PURE__ */ jsxRuntime.jsx("dd", { className: "w-1/2 text-foreground font-mono tabular-nums text-right min-w-0 break-words", children: booking.id })
5627
5662
  ] }),
5628
- traveller && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start justify-between gap-x-4", children: [
5629
- /* @__PURE__ */ jsxRuntime.jsx("dt", { className: "text-muted-foreground", children: TL.travellerLabel }),
5630
- /* @__PURE__ */ jsxRuntime.jsx("dd", { className: "text-foreground font-medium text-right min-w-0 break-words", children: traveller.fullName })
5663
+ traveller && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start gap-x-4", children: [
5664
+ /* @__PURE__ */ jsxRuntime.jsx("dt", { className: "w-1/2 text-muted-foreground break-words", children: TL.travellerLabel }),
5665
+ /* @__PURE__ */ jsxRuntime.jsx("dd", { className: "w-1/2 text-foreground font-medium text-right min-w-0 break-words", children: traveller.fullName })
5631
5666
  ] })
5632
5667
  ] }) }),
5633
- 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 justify-between gap-x-4", children: [
5634
- /* @__PURE__ */ jsxRuntime.jsx("dt", { className: "text-muted-foreground", children: f.label }),
5635
- /* @__PURE__ */ jsxRuntime.jsx("dd", { className: "text-foreground text-right min-w-0 break-words", children: (formatAnswer != null ? formatAnswer : ((field, v) => defaultFormatAnswer(field, v, dateFormatter)))(
5668
+ 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: [
5669
+ /* @__PURE__ */ jsxRuntime.jsx("dt", { className: "w-1/2 text-muted-foreground break-words", children: f.label }),
5670
+ /* @__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)))(
5636
5671
  f,
5637
5672
  answers[f.id]
5638
5673
  ) })
5639
5674
  ] }, f.id)) }) }),
5640
- !isMinimal && terms && /* @__PURE__ */ jsxRuntime.jsx(FormSection2, { title: "Terms & Conditions", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 text-sm font-ui", children: [
5641
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn(
5642
- "inline-flex h-5 w-5 items-center justify-center rounded-full text-white text-xs font-bold",
5643
- terms.accepted ? "bg-primary" : "bg-destructive"
5644
- ), children: terms.accepted ? "\u2713" : "\u2717" }),
5645
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: terms.accepted ? "text-primary font-medium" : "text-destructive font-medium", children: terms.accepted ? "Accepted" : "Not accepted" })
5675
+ !isMinimal && terms && /* @__PURE__ */ jsxRuntime.jsx(FormSection2, { title: (_f = termsLabels == null ? void 0 : termsLabels.title) != null ? _f : "Terms & Conditions", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-3 text-sm font-ui", children: [
5676
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
5677
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn(
5678
+ "inline-flex h-5 w-5 items-center justify-center rounded-full text-white text-xs font-bold",
5679
+ terms.accepted ? "bg-primary" : "bg-destructive"
5680
+ ), children: terms.accepted ? "\u2713" : "\u2717" }),
5681
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: terms.accepted ? "text-primary font-medium" : "text-destructive font-medium", children: terms.accepted ? (_g = termsLabels == null ? void 0 : termsLabels.accepted) != null ? _g : "Accepted" : (_h = termsLabels == null ? void 0 : termsLabels.notAccepted) != null ? _h : "Not accepted" })
5682
+ ] }),
5683
+ termsLayout === "full" && terms.markdown.trim().length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "rounded-lg border border-border bg-muted/30 p-4", children: /* @__PURE__ */ jsxRuntime.jsx("p", { className: "whitespace-pre-wrap break-words text-sm leading-relaxed text-foreground font-ui", children: terms.markdown }) })
5646
5684
  ] }) })
5647
5685
  ] });
5648
5686
  }
@@ -5678,11 +5716,19 @@ var OTPCodeInput = ({
5678
5716
  const numeric = raw.replace(/\D/g, "");
5679
5717
  if (!numeric) return;
5680
5718
  const newDigits = [...digits];
5681
- newDigits[index] = numeric[numeric.length - 1];
5682
- updateValue(newDigits);
5683
- if (index < length - 1) {
5684
- focusSlot(index + 1);
5719
+ if (numeric.length === 1) {
5720
+ newDigits[index] = numeric;
5721
+ updateValue(newDigits);
5722
+ if (index < length - 1) focusSlot(index + 1);
5723
+ return;
5685
5724
  }
5725
+ const toPaste = numeric.slice(0, length - index);
5726
+ for (let i = 0; i < toPaste.length; i++) {
5727
+ newDigits[index + i] = toPaste[i];
5728
+ }
5729
+ updateValue(newDigits);
5730
+ const lastFilled = Math.min(index + toPaste.length, length) - 1;
5731
+ focusSlot(lastFilled < length - 1 ? lastFilled + 1 : lastFilled);
5686
5732
  };
5687
5733
  const handleKeyDown = (index, e) => {
5688
5734
  if (e.key === "Backspace") {