@planetaexo/design-system 0.58.2 → 0.59.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.js CHANGED
@@ -1305,7 +1305,7 @@ function AdventureCard({
1305
1305
  labels,
1306
1306
  interactionsDisabled
1307
1307
  }) {
1308
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r;
1308
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s;
1309
1309
  const isControlled = (_b = (_a = adventure.optionals) == null ? void 0 : _a.some((o) => o.onCheckedChange !== void 0)) != null ? _b : false;
1310
1310
  const [checkedInternal, setCheckedInternal] = React31.useState(
1311
1311
  new Set((_d = (_c = adventure.optionals) == null ? void 0 : _c.filter((o) => o.defaultChecked).map((o) => o.id)) != null ? _d : [])
@@ -1507,22 +1507,48 @@ function AdventureCard({
1507
1507
  ), children: adventure.detailsSlot })
1508
1508
  ] })
1509
1509
  ] }),
1510
+ adventure.rooms && adventure.rooms.length > 0 && /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2.5 mt-1", children: [
1511
+ /* @__PURE__ */ jsx("h4", { className: "text-base font-bold text-foreground font-heading", children: (_p = adventure.accommodationsLabel) != null ? _p : "Accommodations" }),
1512
+ /* @__PURE__ */ jsx("ul", { className: "flex flex-col gap-3", children: adventure.rooms.map((room, i) => {
1513
+ var _a2, _b2;
1514
+ const bedLabel = (_b2 = (_a2 = adventure.bedArrangementLabels) == null ? void 0 : _a2[room.bedArrangement]) != null ? _b2 : room.bedArrangement === "DOUBLE" ? "Double" : room.bedArrangement === "TWIN" ? "Twin" : room.bedArrangement === "SINGLE" ? "Single" : "Triple";
1515
+ return /* @__PURE__ */ jsxs("li", { className: "flex items-start gap-3", children: [
1516
+ room.imageUrl && // eslint-disable-next-line @next/next/no-img-element
1517
+ /* @__PURE__ */ jsx(
1518
+ "img",
1519
+ {
1520
+ src: room.imageUrl,
1521
+ alt: room.roomName,
1522
+ className: "w-20 h-16 object-cover rounded shrink-0"
1523
+ }
1524
+ ),
1525
+ /* @__PURE__ */ jsxs("div", { className: "flex-1", children: [
1526
+ /* @__PURE__ */ jsx("div", { className: "text-base font-semibold text-foreground", children: `${room.qty}\xD7 ${room.roomName}` }),
1527
+ /* @__PURE__ */ jsxs("div", { className: "text-sm text-foreground/70 flex items-center gap-2 flex-wrap", children: [
1528
+ /* @__PURE__ */ jsx("span", { children: room.accommodationName }),
1529
+ /* @__PURE__ */ jsx("span", { className: "inline-block px-2 py-0.5 text-xs font-semibold bg-primary/10 text-primary rounded uppercase tracking-wide", children: bedLabel })
1530
+ ] }),
1531
+ room.description && /* @__PURE__ */ jsx("p", { className: "text-sm text-foreground/70 mt-1 leading-snug", children: room.description })
1532
+ ] })
1533
+ ] }, i);
1534
+ }) })
1535
+ ] }),
1510
1536
  adventure.included && adventure.included.length > 0 && /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2.5 mt-1", children: [
1511
- /* @__PURE__ */ jsx("h4", { className: "text-base font-bold text-foreground font-heading", children: (_p = adventure.includedLabel) != null ? _p : "What's included" }),
1537
+ /* @__PURE__ */ jsx("h4", { className: "text-base font-bold text-foreground font-heading", children: (_q = adventure.includedLabel) != null ? _q : "What's included" }),
1512
1538
  /* @__PURE__ */ jsx("ul", { className: "flex flex-col gap-1.5", children: adventure.included.map((item, i) => /* @__PURE__ */ jsxs("li", { className: "flex items-start gap-2 text-base text-foreground/80 font-sans", children: [
1513
1539
  /* @__PURE__ */ jsx(CheckIcon, { className: "w-4 h-4 text-primary shrink-0 mt-1" }),
1514
1540
  item
1515
1541
  ] }, i)) })
1516
1542
  ] }),
1517
1543
  adventure.notIncluded && adventure.notIncluded.length > 0 && /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2.5 mt-1", children: [
1518
- /* @__PURE__ */ jsx("h4", { className: "text-base font-bold text-foreground font-heading", children: (_q = adventure.notIncludedLabel) != null ? _q : "What's not included" }),
1544
+ /* @__PURE__ */ jsx("h4", { className: "text-base font-bold text-foreground font-heading", children: (_r = adventure.notIncludedLabel) != null ? _r : "What's not included" }),
1519
1545
  /* @__PURE__ */ jsx("ul", { className: "flex flex-col gap-1.5", children: adventure.notIncluded.map((item, i) => /* @__PURE__ */ jsxs("li", { className: "flex items-start gap-2 text-base text-foreground/80 font-sans", children: [
1520
1546
  /* @__PURE__ */ jsx(XIcon, { className: "w-4 h-4 text-destructive shrink-0 mt-1" }),
1521
1547
  item
1522
1548
  ] }, i)) })
1523
1549
  ] }),
1524
1550
  adventure.cancellationPolicy && adventure.cancellationPolicy.length > 0 && /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2.5 mt-1", children: [
1525
- /* @__PURE__ */ jsx("h4", { className: "text-base font-bold text-foreground font-heading", children: (_r = adventure.cancellationPolicyLabel) != null ? _r : "Cancellation policy" }),
1551
+ /* @__PURE__ */ jsx("h4", { className: "text-base font-bold text-foreground font-heading", children: (_s = adventure.cancellationPolicyLabel) != null ? _s : "Cancellation policy" }),
1526
1552
  /* @__PURE__ */ jsx("ul", { className: "flex flex-col gap-1.5", children: adventure.cancellationPolicy.map((item, i) => /* @__PURE__ */ jsxs("li", { className: "flex items-start gap-2 text-base text-muted-foreground font-sans", children: [
1527
1553
  /* @__PURE__ */ jsx("span", { className: "w-1.5 h-1.5 rounded-full bg-primary shrink-0 mt-2.5" }),
1528
1554
  item
@@ -4071,7 +4097,14 @@ var DEFAULT_LABELS = {
4071
4097
  notIncludedHeading: "O que n\xE3o est\xE1 incluso",
4072
4098
  childBadge: "child",
4073
4099
  adultsUnit: "adult(s)",
4074
- childrenUnit: "child(ren)"
4100
+ childrenUnit: "child(ren)",
4101
+ accommodationsHeading: "ACCOMMODATIONS",
4102
+ bedArrangementLabels: {
4103
+ DOUBLE: "Double",
4104
+ TWIN: "Twin",
4105
+ SINGLE: "Single",
4106
+ TRIPLE: "Triple"
4107
+ }
4075
4108
  };
4076
4109
  function BookingAdventureCard({
4077
4110
  tag,
@@ -4091,10 +4124,11 @@ function BookingAdventureCard({
4091
4124
  notIncluded,
4092
4125
  lineItems,
4093
4126
  subtotal,
4127
+ rooms,
4094
4128
  labels,
4095
4129
  className
4096
4130
  }) {
4097
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
4131
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u;
4098
4132
  const l = {
4099
4133
  travellersHeading: (_a = labels == null ? void 0 : labels.travellersHeading) != null ? _a : DEFAULT_LABELS.travellersHeading,
4100
4134
  detailsHeading: (_b = labels == null ? void 0 : labels.detailsHeading) != null ? _b : DEFAULT_LABELS.detailsHeading,
@@ -4107,7 +4141,14 @@ function BookingAdventureCard({
4107
4141
  notIncludedHeading: (_i = labels == null ? void 0 : labels.notIncludedHeading) != null ? _i : DEFAULT_LABELS.notIncludedHeading,
4108
4142
  childBadge: (_j = labels == null ? void 0 : labels.childBadge) != null ? _j : DEFAULT_LABELS.childBadge,
4109
4143
  adultsUnit: (_k = labels == null ? void 0 : labels.adultsUnit) != null ? _k : DEFAULT_LABELS.adultsUnit,
4110
- childrenUnit: (_l = labels == null ? void 0 : labels.childrenUnit) != null ? _l : DEFAULT_LABELS.childrenUnit
4144
+ childrenUnit: (_l = labels == null ? void 0 : labels.childrenUnit) != null ? _l : DEFAULT_LABELS.childrenUnit,
4145
+ accommodationsHeading: (_m = labels == null ? void 0 : labels.accommodationsHeading) != null ? _m : DEFAULT_LABELS.accommodationsHeading,
4146
+ bedArrangementLabels: {
4147
+ DOUBLE: (_o = (_n = labels == null ? void 0 : labels.bedArrangementLabels) == null ? void 0 : _n.DOUBLE) != null ? _o : DEFAULT_LABELS.bedArrangementLabels.DOUBLE,
4148
+ TWIN: (_q = (_p = labels == null ? void 0 : labels.bedArrangementLabels) == null ? void 0 : _p.TWIN) != null ? _q : DEFAULT_LABELS.bedArrangementLabels.TWIN,
4149
+ SINGLE: (_s = (_r = labels == null ? void 0 : labels.bedArrangementLabels) == null ? void 0 : _r.SINGLE) != null ? _s : DEFAULT_LABELS.bedArrangementLabels.SINGLE,
4150
+ TRIPLE: (_u = (_t = labels == null ? void 0 : labels.bedArrangementLabels) == null ? void 0 : _t.TRIPLE) != null ? _u : DEFAULT_LABELS.bedArrangementLabels.TRIPLE
4151
+ }
4111
4152
  };
4112
4153
  const hasTravellers = !!travellers && travellers.length > 0;
4113
4154
  const hasItinerary = !!itinerary && itinerary.length > 0;
@@ -4115,6 +4156,7 @@ function BookingAdventureCard({
4115
4156
  const hasIncluded = !!included && included.length > 0;
4116
4157
  const hasNotIncluded = !!notIncluded && notIncluded.length > 0;
4117
4158
  const hasLineItems = lineItems.length > 0;
4159
+ const hasRooms = !!rooms && rooms.length > 0;
4118
4160
  const dateRange = endDate ? `${startDate} \u2192 ${endDate}` : startDate;
4119
4161
  const showSlots = !!slots;
4120
4162
  const slotsText = showSlots ? [
@@ -4411,6 +4453,118 @@ function BookingAdventureCard({
4411
4453
  );
4412
4454
  })
4413
4455
  ] }),
4456
+ hasRooms && /* @__PURE__ */ jsxs("div", { style: { marginTop: "4px" }, children: [
4457
+ /* @__PURE__ */ jsx(
4458
+ "hr",
4459
+ {
4460
+ style: {
4461
+ border: "none",
4462
+ borderTop: `1px solid ${emailTokens.border}`,
4463
+ marginBottom: "10px"
4464
+ }
4465
+ }
4466
+ ),
4467
+ /* @__PURE__ */ jsx(
4468
+ "p",
4469
+ {
4470
+ style: {
4471
+ fontSize: "10px",
4472
+ fontWeight: 700,
4473
+ color: emailTokens.mutedForeground,
4474
+ textTransform: "uppercase",
4475
+ letterSpacing: "0.1em",
4476
+ margin: "0 0 10px 0"
4477
+ },
4478
+ children: l.accommodationsHeading
4479
+ }
4480
+ ),
4481
+ rooms.map((room, i) => /* @__PURE__ */ jsx(
4482
+ "table",
4483
+ {
4484
+ cellPadding: 0,
4485
+ cellSpacing: 0,
4486
+ style: {
4487
+ borderCollapse: "collapse",
4488
+ width: "100%",
4489
+ marginBottom: i < rooms.length - 1 ? "10px" : "0"
4490
+ },
4491
+ children: /* @__PURE__ */ jsx("tbody", { children: /* @__PURE__ */ jsxs("tr", { children: [
4492
+ room.imageUrl && /* @__PURE__ */ jsx(
4493
+ "td",
4494
+ {
4495
+ style: {
4496
+ width: "80px",
4497
+ verticalAlign: "top",
4498
+ paddingRight: "10px"
4499
+ },
4500
+ children: /* @__PURE__ */ jsx(
4501
+ "img",
4502
+ {
4503
+ src: room.imageUrl,
4504
+ alt: room.roomName,
4505
+ style: {
4506
+ width: "80px",
4507
+ height: "60px",
4508
+ objectFit: "cover",
4509
+ display: "block",
4510
+ borderRadius: "6px"
4511
+ }
4512
+ }
4513
+ )
4514
+ }
4515
+ ),
4516
+ /* @__PURE__ */ jsxs("td", { style: { verticalAlign: "top" }, children: [
4517
+ /* @__PURE__ */ jsx(
4518
+ "div",
4519
+ {
4520
+ style: {
4521
+ fontSize: "14px",
4522
+ fontWeight: 600,
4523
+ color: emailTokens.foreground,
4524
+ marginBottom: "2px"
4525
+ },
4526
+ children: `${room.qty}\xD7 ${room.roomName}`
4527
+ }
4528
+ ),
4529
+ /* @__PURE__ */ jsxs("div", { style: { fontSize: "12px", color: emailTokens.mutedForeground }, children: [
4530
+ room.accommodationName,
4531
+ /* @__PURE__ */ jsx(
4532
+ "span",
4533
+ {
4534
+ style: {
4535
+ display: "inline-block",
4536
+ marginLeft: "8px",
4537
+ padding: "1px 6px",
4538
+ fontSize: "10px",
4539
+ fontWeight: 600,
4540
+ color: emailTokens.primary,
4541
+ backgroundColor: emailTokens.primaryLight,
4542
+ borderRadius: "4px",
4543
+ textTransform: "uppercase",
4544
+ letterSpacing: "0.05em"
4545
+ },
4546
+ children: l.bedArrangementLabels[room.bedArrangement]
4547
+ }
4548
+ )
4549
+ ] }),
4550
+ room.description && /* @__PURE__ */ jsx(
4551
+ "div",
4552
+ {
4553
+ style: {
4554
+ fontSize: "12px",
4555
+ color: emailTokens.bodyText,
4556
+ marginTop: "4px",
4557
+ lineHeight: "1.4"
4558
+ },
4559
+ children: room.description
4560
+ }
4561
+ )
4562
+ ] })
4563
+ ] }) })
4564
+ },
4565
+ i
4566
+ ))
4567
+ ] }),
4414
4568
  (hasDescription || hasItinerary) && /* @__PURE__ */ jsxs("div", { style: { marginTop: "4px" }, children: [
4415
4569
  /* @__PURE__ */ jsx(
4416
4570
  "hr",
@@ -4663,8 +4817,21 @@ function BookingAdventureCard({
4663
4817
  }
4664
4818
  );
4665
4819
  }
4666
- function BookingSummary({ heading, rows, footer, className }) {
4667
- var _a, _b;
4820
+ var DEFAULT_BED_LABELS = {
4821
+ DOUBLE: "Double",
4822
+ TWIN: "Twin",
4823
+ SINGLE: "Single",
4824
+ TRIPLE: "Triple"
4825
+ };
4826
+ function BookingSummary({ heading, rows, rooms, roomsHeading, bedArrangementLabels, footer, className }) {
4827
+ var _a, _b, _c, _d, _e, _f;
4828
+ const hasRooms = !!rooms && rooms.length > 0;
4829
+ const bedLabels = {
4830
+ DOUBLE: (_a = bedArrangementLabels == null ? void 0 : bedArrangementLabels.DOUBLE) != null ? _a : DEFAULT_BED_LABELS.DOUBLE,
4831
+ TWIN: (_b = bedArrangementLabels == null ? void 0 : bedArrangementLabels.TWIN) != null ? _b : DEFAULT_BED_LABELS.TWIN,
4832
+ SINGLE: (_c = bedArrangementLabels == null ? void 0 : bedArrangementLabels.SINGLE) != null ? _c : DEFAULT_BED_LABELS.SINGLE,
4833
+ TRIPLE: (_d = bedArrangementLabels == null ? void 0 : bedArrangementLabels.TRIPLE) != null ? _d : DEFAULT_BED_LABELS.TRIPLE
4834
+ };
4668
4835
  return /* @__PURE__ */ jsxs("div", { className, style: { marginBottom: "24px" }, children: [
4669
4836
  heading && /* @__PURE__ */ jsx(
4670
4837
  "p",
@@ -4699,7 +4866,7 @@ function BookingSummary({ heading, rows, footer, className }) {
4699
4866
  children: /* @__PURE__ */ jsxs("tbody", { children: [
4700
4867
  rows.map((row, i) => {
4701
4868
  var _a2;
4702
- const isLastRowWithoutFooter = i === rows.length - 1 && !footer;
4869
+ const isLastRowWithoutFooter = i === rows.length - 1 && !footer && !hasRooms;
4703
4870
  return /* @__PURE__ */ jsxs(
4704
4871
  "tr",
4705
4872
  {
@@ -4737,6 +4904,50 @@ function BookingSummary({ heading, rows, footer, className }) {
4737
4904
  i
4738
4905
  );
4739
4906
  }),
4907
+ hasRooms && /* @__PURE__ */ jsx(
4908
+ "tr",
4909
+ {
4910
+ style: !footer ? {} : { borderBottom: `1px solid ${emailTokens.border}` },
4911
+ children: /* @__PURE__ */ jsxs(
4912
+ "td",
4913
+ {
4914
+ colSpan: 2,
4915
+ style: {
4916
+ padding: "12px 20px",
4917
+ backgroundColor: emailTokens.muted
4918
+ },
4919
+ children: [
4920
+ /* @__PURE__ */ jsx(
4921
+ "div",
4922
+ {
4923
+ style: {
4924
+ fontSize: "10px",
4925
+ fontWeight: 700,
4926
+ color: emailTokens.mutedForeground,
4927
+ textTransform: "uppercase",
4928
+ letterSpacing: "0.1em",
4929
+ marginBottom: "6px"
4930
+ },
4931
+ children: roomsHeading != null ? roomsHeading : "Accommodations"
4932
+ }
4933
+ ),
4934
+ rooms.map((room, i) => /* @__PURE__ */ jsx(
4935
+ "div",
4936
+ {
4937
+ style: {
4938
+ fontSize: "14px",
4939
+ color: emailTokens.foreground,
4940
+ marginBottom: i < rooms.length - 1 ? "4px" : 0
4941
+ },
4942
+ children: `${room.qty}\xD7 ${room.roomName} \u2014 ${bedLabels[room.bedArrangement]}`
4943
+ },
4944
+ i
4945
+ ))
4946
+ ]
4947
+ }
4948
+ )
4949
+ }
4950
+ ),
4740
4951
  footer && /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsx(
4741
4952
  "td",
4742
4953
  {
@@ -4744,8 +4955,8 @@ function BookingSummary({ heading, rows, footer, className }) {
4744
4955
  style: {
4745
4956
  padding: "12px 20px",
4746
4957
  textAlign: "center",
4747
- fontWeight: (_a = footer.fontWeight) != null ? _a : 600,
4748
- color: (_b = footer.color) != null ? _b : emailTokens.foreground,
4958
+ fontWeight: (_e = footer.fontWeight) != null ? _e : 600,
4959
+ color: (_f = footer.color) != null ? _f : emailTokens.foreground,
4749
4960
  backgroundColor: footer.backgroundColor
4750
4961
  },
4751
4962
  children: footer.text
@@ -6412,6 +6623,13 @@ var DEFAULT_LABELS9 = {
6412
6623
  datesLabel: "Dates",
6413
6624
  numberOfPeopleLabel: "Number of Travellers",
6414
6625
  optionalsLabel: "Optionals",
6626
+ accommodationsHeading: "Accommodations",
6627
+ bedArrangementLabels: {
6628
+ DOUBLE: "Double",
6629
+ TWIN: "Twin",
6630
+ SINGLE: "Single",
6631
+ TRIPLE: "Triple"
6632
+ },
6415
6633
  registrationPendingNotice: "The travellers' registration details will be sent to you as soon as all travellers have completed their forms.",
6416
6634
  mustReplyToConfirm: "Please reply to this email to confirm the booking.",
6417
6635
  closingAgent: (agentName, contact) => /* @__PURE__ */ jsxs(Fragment, { children: [
@@ -6435,6 +6653,7 @@ function PartnerBookingCreatedEmail({
6435
6653
  dateRange,
6436
6654
  travellersCount,
6437
6655
  optionals,
6656
+ rooms,
6438
6657
  booker,
6439
6658
  agent,
6440
6659
  logoUrl,
@@ -6499,7 +6718,16 @@ function PartnerBookingCreatedEmail({
6499
6718
  /* @__PURE__ */ jsx("p", { style: { marginBottom: "16px" }, children: l.greeting(partnerName) }),
6500
6719
  /* @__PURE__ */ jsx("p", { style: { marginBottom: "24px" }, children: l.intro(adventureName) }),
6501
6720
  sectionDivider,
6502
- /* @__PURE__ */ jsx(BookingSummary, { heading: l.summaryHeading, rows: summaryRows }),
6721
+ /* @__PURE__ */ jsx(
6722
+ BookingSummary,
6723
+ {
6724
+ heading: l.summaryHeading,
6725
+ rows: summaryRows,
6726
+ rooms,
6727
+ roomsHeading: l.accommodationsHeading,
6728
+ bedArrangementLabels: l.bedArrangementLabels
6729
+ }
6730
+ ),
6503
6731
  sectionDivider,
6504
6732
  /* @__PURE__ */ jsxs(
6505
6733
  "div",
@@ -10060,6 +10288,7 @@ function Picture(_a) {
10060
10288
  "onLoad",
10061
10289
  "onError"
10062
10290
  ]);
10291
+ var _a2;
10063
10292
  const ref = React31.useRef(null);
10064
10293
  const [visible, setVisible] = React31.useState(eager);
10065
10294
  const [loaded, setLoaded] = React31.useState(false);
@@ -10088,6 +10317,7 @@ function Picture(_a) {
10088
10317
  const webp = webpVariantUrl(src);
10089
10318
  const realSrc = visible ? src : PLACEHOLDER_SRC;
10090
10319
  const decodingResolved = decoding != null ? decoding : eager ? void 0 : "async";
10320
+ const fetchPriorityResolved = (_a2 = imgProps.fetchPriority) != null ? _a2 : eager ? void 0 : "low";
10091
10321
  const handleLoad = (e) => {
10092
10322
  if (visible) setLoaded(true);
10093
10323
  onLoad == null ? void 0 : onLoad(e);
@@ -10113,6 +10343,7 @@ function Picture(_a) {
10113
10343
  onLoad: handleLoad,
10114
10344
  onError: handleError
10115
10345
  }, imgProps), {
10346
+ fetchPriority: fetchPriorityResolved,
10116
10347
  style: mergedStyle
10117
10348
  })
10118
10349
  )
@@ -10135,6 +10366,7 @@ function Picture(_a) {
10135
10366
  onLoad: handleLoad,
10136
10367
  onError: handleError
10137
10368
  }, imgProps), {
10369
+ fetchPriority: fetchPriorityResolved,
10138
10370
  style: mergedStyle
10139
10371
  })
10140
10372
  )