@planetaexo/design-system 0.59.2 → 0.61.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
@@ -7346,6 +7346,166 @@ function BookingOtpEmail({
7346
7346
  }
7347
7347
  );
7348
7348
  }
7349
+ function NotificationEmail({
7350
+ greeting,
7351
+ paragraphs,
7352
+ cta,
7353
+ details,
7354
+ detailsHeading,
7355
+ highlight,
7356
+ signature,
7357
+ logoUrl,
7358
+ className
7359
+ }) {
7360
+ const ctaStyle = {
7361
+ display: "inline-block",
7362
+ backgroundColor: emailTokens.primary,
7363
+ color: emailTokens.primaryForeground,
7364
+ padding: "12px 24px",
7365
+ borderRadius: "8px",
7366
+ fontSize: "14px",
7367
+ fontWeight: "700",
7368
+ textDecoration: "none",
7369
+ fontFamily: emailTokens.fontFamily
7370
+ };
7371
+ const hasHighlight = Array.isArray(highlight) && highlight.length > 0;
7372
+ const hasDetails = Array.isArray(details) && details.length > 0;
7373
+ return /* @__PURE__ */ jsxRuntime.jsxs(
7374
+ "div",
7375
+ {
7376
+ style: {
7377
+ fontFamily: emailTokens.fontFamily,
7378
+ color: emailTokens.foreground,
7379
+ maxWidth: "600px",
7380
+ margin: "0 auto",
7381
+ padding: "32px",
7382
+ border: `1px solid ${emailTokens.border}`,
7383
+ borderRadius: "12px",
7384
+ backgroundColor: emailTokens.white
7385
+ },
7386
+ className,
7387
+ children: [
7388
+ /* @__PURE__ */ jsxRuntime.jsx(EmailLogo, { src: logoUrl }),
7389
+ /* @__PURE__ */ jsxRuntime.jsx("p", { style: { fontSize: "16px", lineHeight: "1.5", margin: "0 0 16px" }, children: greeting }),
7390
+ paragraphs.map((paragraph, i) => /* @__PURE__ */ jsxRuntime.jsx(
7391
+ "p",
7392
+ {
7393
+ style: { fontSize: "15px", lineHeight: "1.5", margin: "0 0 16px" },
7394
+ children: paragraph
7395
+ },
7396
+ i
7397
+ )),
7398
+ hasHighlight && /* @__PURE__ */ jsxRuntime.jsx(
7399
+ "table",
7400
+ {
7401
+ role: "presentation",
7402
+ cellPadding: 0,
7403
+ cellSpacing: 0,
7404
+ border: 0,
7405
+ style: { width: "100%", borderCollapse: "collapse", margin: "0 0 24px" },
7406
+ children: /* @__PURE__ */ jsxRuntime.jsx("tbody", { children: /* @__PURE__ */ jsxRuntime.jsx("tr", { children: /* @__PURE__ */ jsxRuntime.jsx(
7407
+ "td",
7408
+ {
7409
+ style: {
7410
+ backgroundColor: emailTokens.primaryLight,
7411
+ border: `1px solid ${emailTokens.border}`,
7412
+ borderRadius: "12px",
7413
+ padding: "24px 16px"
7414
+ },
7415
+ children: highlight.map((line, i) => /* @__PURE__ */ jsxRuntime.jsx(
7416
+ "p",
7417
+ {
7418
+ style: {
7419
+ fontSize: "15px",
7420
+ lineHeight: "1.5",
7421
+ margin: i < highlight.length - 1 ? "0 0 8px" : "0",
7422
+ color: emailTokens.foreground
7423
+ },
7424
+ children: line
7425
+ },
7426
+ i
7427
+ ))
7428
+ }
7429
+ ) }) })
7430
+ }
7431
+ ),
7432
+ hasDetails && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
7433
+ detailsHeading && /* @__PURE__ */ jsxRuntime.jsx(
7434
+ "p",
7435
+ {
7436
+ style: {
7437
+ fontSize: "15px",
7438
+ lineHeight: "1.5",
7439
+ fontWeight: 700,
7440
+ margin: "0 0 12px"
7441
+ },
7442
+ children: detailsHeading
7443
+ }
7444
+ ),
7445
+ /* @__PURE__ */ jsxRuntime.jsx(
7446
+ "table",
7447
+ {
7448
+ role: "presentation",
7449
+ cellPadding: 0,
7450
+ cellSpacing: 0,
7451
+ border: 0,
7452
+ style: { width: "100%", borderCollapse: "collapse", margin: "0 0 24px" },
7453
+ children: /* @__PURE__ */ jsxRuntime.jsx("tbody", { children: details.map((item, i) => /* @__PURE__ */ jsxRuntime.jsx("tr", { children: item.label ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
7454
+ /* @__PURE__ */ jsxRuntime.jsx(
7455
+ "td",
7456
+ {
7457
+ style: {
7458
+ fontSize: "14px",
7459
+ lineHeight: "1.6",
7460
+ color: emailTokens.mutedForeground,
7461
+ padding: "4px 12px 4px 0",
7462
+ verticalAlign: "top",
7463
+ whiteSpace: "nowrap"
7464
+ },
7465
+ children: item.label
7466
+ }
7467
+ ),
7468
+ /* @__PURE__ */ jsxRuntime.jsx(
7469
+ "td",
7470
+ {
7471
+ style: {
7472
+ fontSize: "14px",
7473
+ lineHeight: "1.6",
7474
+ color: item.emphasizeValue ? emailTokens.primary : emailTokens.foreground,
7475
+ fontWeight: item.emphasizeValue ? 700 : 400,
7476
+ padding: "4px 0",
7477
+ verticalAlign: "top",
7478
+ width: "100%"
7479
+ },
7480
+ children: item.value
7481
+ }
7482
+ )
7483
+ ] }) : /* @__PURE__ */ jsxRuntime.jsxs(
7484
+ "td",
7485
+ {
7486
+ colSpan: 2,
7487
+ style: {
7488
+ fontSize: "14px",
7489
+ lineHeight: "1.6",
7490
+ color: emailTokens.foreground,
7491
+ padding: "4px 0",
7492
+ verticalAlign: "top"
7493
+ },
7494
+ children: [
7495
+ /* @__PURE__ */ jsxRuntime.jsx("span", { style: { color: emailTokens.primary, paddingRight: "8px" }, children: "\u2022" }),
7496
+ item.value
7497
+ ]
7498
+ }
7499
+ ) }, i)) })
7500
+ }
7501
+ )
7502
+ ] }),
7503
+ cta && /* @__PURE__ */ jsxRuntime.jsx("div", { style: { margin: "24px 0" }, children: cta.url ? /* @__PURE__ */ jsxRuntime.jsx("a", { href: cta.url, style: ctaStyle, children: cta.label }) : /* @__PURE__ */ jsxRuntime.jsx("span", { style: ctaStyle, role: "presentation", children: cta.label }) }),
7504
+ /* @__PURE__ */ jsxRuntime.jsx("p", { style: { fontSize: "14px", lineHeight: "1.5", margin: "0" }, children: signature })
7505
+ ]
7506
+ }
7507
+ );
7508
+ }
7349
7509
  function TravellerFormInviteEmail({
7350
7510
  greeting,
7351
7511
  bodyIntro,
@@ -8332,6 +8492,7 @@ function FieldRenderer({
8332
8492
  onChange,
8333
8493
  defaultPhoneCountry,
8334
8494
  labels,
8495
+ countries,
8335
8496
  error,
8336
8497
  disabled
8337
8498
  }) {
@@ -8566,6 +8727,7 @@ function FieldRenderer({
8566
8727
  required: field.required,
8567
8728
  value: typeof value === "string" ? value : "",
8568
8729
  onChange: (code) => onChange(code),
8730
+ countries,
8569
8731
  disabled
8570
8732
  }
8571
8733
  );
@@ -8711,6 +8873,7 @@ function RegistrationForm({
8711
8873
  defaultPhoneCountry = "BR",
8712
8874
  dateFormatter,
8713
8875
  labels,
8876
+ countries,
8714
8877
  className,
8715
8878
  readOnly = false
8716
8879
  }) {
@@ -8896,6 +9059,7 @@ function RegistrationForm({
8896
9059
  onChange: (v) => setField(field.id, v),
8897
9060
  defaultPhoneCountry,
8898
9061
  labels: L,
9062
+ countries,
8899
9063
  error: fieldErrors[field.id],
8900
9064
  disabled: readOnly
8901
9065
  }
@@ -9043,7 +9207,7 @@ function phoneCountryDial(code) {
9043
9207
  var _a, _b;
9044
9208
  return (_b = (_a = PHONE_COUNTRIES.find((c) => c.code === code)) == null ? void 0 : _a.dial) != null ? _b : code;
9045
9209
  }
9046
- function defaultFormatAnswer(field, value, fmtDate, yesNoLabels) {
9210
+ function defaultFormatAnswer(field, value, fmtDate, yesNoLabels, countries) {
9047
9211
  var _a, _b, _c, _d, _e, _f, _g, _h;
9048
9212
  if (value == null || value === "") return "\u2014";
9049
9213
  if (value instanceof Date) return fmtDate(value);
@@ -9072,7 +9236,7 @@ function defaultFormatAnswer(field, value, fmtDate, yesNoLabels) {
9072
9236
  }
9073
9237
  }
9074
9238
  if (field.type === "nationality" && typeof value === "string") {
9075
- return (_d = (_c = COUNTRIES.find((c) => c.code === value)) == null ? void 0 : _c.name) != null ? _d : value;
9239
+ return (_d = (_c = (countries != null ? countries : COUNTRIES).find((c) => c.code === value)) == null ? void 0 : _c.name) != null ? _d : value;
9076
9240
  }
9077
9241
  if (field.type === "select" && field.options) {
9078
9242
  return (_f = (_e = field.options.find((o) => o.value === value)) == null ? void 0 : _e.label) != null ? _f : String(value);
@@ -9098,6 +9262,7 @@ function RegistrationSuccessCard({
9098
9262
  answers = {},
9099
9263
  dateFormatter = isoOrDateToString,
9100
9264
  formatAnswer,
9265
+ countries,
9101
9266
  className,
9102
9267
  actions,
9103
9268
  logo,
@@ -9207,7 +9372,7 @@ function RegistrationSuccessCard({
9207
9372
  /* @__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, {
9208
9373
  yesLabel: scLabels == null ? void 0 : scLabels.yesLabel,
9209
9374
  noLabel: scLabels == null ? void 0 : scLabels.noLabel
9210
- })))(
9375
+ }, countries)))(
9211
9376
  f,
9212
9377
  answers[f.id]
9213
9378
  ) })
@@ -16576,6 +16741,7 @@ exports.ItineraryDay = ItineraryDay;
16576
16741
  exports.LOGO_PLANETAEXO_DATA_URI = LOGO_PLANETAEXO_DATA_URI;
16577
16742
  exports.LeadCapturePopup = LeadCapturePopup;
16578
16743
  exports.MenuTrip = MenuTrip;
16744
+ exports.NotificationEmail = NotificationEmail;
16579
16745
  exports.OTPCodeInput = OTPCodeInput;
16580
16746
  exports.Offer = Offer;
16581
16747
  exports.OfferAdventureCard = OfferAdventureCard;