@planetaexo/design-system 0.92.5 → 0.93.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
@@ -1512,6 +1512,13 @@ interface BookingSummaryRoomItem {
1512
1512
  roomName: string;
1513
1513
  bedArrangement: "DOUBLE" | "TWIN" | "SINGLE" | "TRIPLE" | "QUADRUPLE" | "QUINTUPLE";
1514
1514
  qty: number;
1515
+ /**
1516
+ * Spec planetaexo-bookings partner-email-accommodation-name — nome da
1517
+ * Acomodação-pai. Quando presente em ≥1 item, o bloco AGRUPA por acomodação
1518
+ * (sub-heading com o nome + quartos do grupo abaixo). Ausente em TODOS os
1519
+ * itens → lista flat (retrocompat com o render anterior).
1520
+ */
1521
+ accommodationName?: string;
1515
1522
  }
1516
1523
  interface BookingSummaryProps {
1517
1524
  /**
package/dist/index.d.ts CHANGED
@@ -1512,6 +1512,13 @@ interface BookingSummaryRoomItem {
1512
1512
  roomName: string;
1513
1513
  bedArrangement: "DOUBLE" | "TWIN" | "SINGLE" | "TRIPLE" | "QUADRUPLE" | "QUINTUPLE";
1514
1514
  qty: number;
1515
+ /**
1516
+ * Spec planetaexo-bookings partner-email-accommodation-name — nome da
1517
+ * Acomodação-pai. Quando presente em ≥1 item, o bloco AGRUPA por acomodação
1518
+ * (sub-heading com o nome + quartos do grupo abaixo). Ausente em TODOS os
1519
+ * itens → lista flat (retrocompat com o render anterior).
1520
+ */
1521
+ accommodationName?: string;
1515
1522
  }
1516
1523
  interface BookingSummaryProps {
1517
1524
  /**
package/dist/index.js CHANGED
@@ -5057,7 +5057,7 @@ var DEFAULT_BED_LABELS = {
5057
5057
  QUINTUPLE: "Quintuple"
5058
5058
  };
5059
5059
  function BookingSummary({ heading, rows, rooms, roomsHeading, bedArrangementLabels, footer, className }) {
5060
- var _a, _b, _c, _d, _e, _f, _g, _h;
5060
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i;
5061
5061
  const hasRooms = !!rooms && rooms.length > 0;
5062
5062
  const bedLabels = {
5063
5063
  DOUBLE: (_a = bedArrangementLabels == null ? void 0 : bedArrangementLabels.DOUBLE) != null ? _a : DEFAULT_BED_LABELS.DOUBLE,
@@ -5067,6 +5067,21 @@ function BookingSummary({ heading, rows, rooms, roomsHeading, bedArrangementLabe
5067
5067
  QUADRUPLE: (_e = bedArrangementLabels == null ? void 0 : bedArrangementLabels.QUADRUPLE) != null ? _e : DEFAULT_BED_LABELS.QUADRUPLE,
5068
5068
  QUINTUPLE: (_f = bedArrangementLabels == null ? void 0 : bedArrangementLabels.QUINTUPLE) != null ? _f : DEFAULT_BED_LABELS.QUINTUPLE
5069
5069
  };
5070
+ const roomGroups = [];
5071
+ let anyAccommodation = false;
5072
+ if (hasRooms) {
5073
+ for (const room of rooms) {
5074
+ const name = ((_g = room.accommodationName) == null ? void 0 : _g.trim()) || null;
5075
+ if (name) anyAccommodation = true;
5076
+ let bucket = roomGroups.find((g) => g.name === name);
5077
+ if (!bucket) {
5078
+ bucket = { name, items: [] };
5079
+ roomGroups.push(bucket);
5080
+ }
5081
+ bucket.items.push(room);
5082
+ }
5083
+ }
5084
+ const roomLine = (room) => `${room.qty}\xD7 ${room.roomName} \u2014 ${bedLabels[room.bedArrangement]}`;
5070
5085
  return /* @__PURE__ */ jsxs("div", { className, style: { marginBottom: "24px" }, children: [
5071
5086
  heading && /* @__PURE__ */ jsx(
5072
5087
  "p",
@@ -5166,18 +5181,51 @@ function BookingSummary({ heading, rows, rooms, roomsHeading, bedArrangementLabe
5166
5181
  children: roomsHeading != null ? roomsHeading : "Accommodations"
5167
5182
  }
5168
5183
  ),
5169
- rooms.map((room, i) => /* @__PURE__ */ jsx(
5170
- "div",
5171
- {
5172
- style: {
5173
- fontSize: "14px",
5174
- color: emailTokens.foreground,
5175
- marginBottom: i < rooms.length - 1 ? "4px" : 0
5184
+ !anyAccommodation ? (
5185
+ // Retrocompat: nenhum item tem accommodationName → lista flat
5186
+ // (idêntica ao render anterior).
5187
+ rooms.map((room, i) => /* @__PURE__ */ jsx(
5188
+ "div",
5189
+ {
5190
+ style: {
5191
+ fontSize: "14px",
5192
+ color: emailTokens.foreground,
5193
+ marginBottom: i < rooms.length - 1 ? "4px" : 0
5194
+ },
5195
+ children: roomLine(room)
5176
5196
  },
5177
- children: `${room.qty}\xD7 ${room.roomName} \u2014 ${bedLabels[room.bedArrangement]}`
5178
- },
5179
- i
5180
- ))
5197
+ i
5198
+ ))
5199
+ ) : (
5200
+ // Agrupado por acomodação: sub-heading (nome) + quartos do grupo.
5201
+ roomGroups.map((group, gi) => /* @__PURE__ */ jsxs("div", { children: [
5202
+ group.name && /* @__PURE__ */ jsx(
5203
+ "div",
5204
+ {
5205
+ style: {
5206
+ fontSize: "14px",
5207
+ fontWeight: 700,
5208
+ color: emailTokens.foreground,
5209
+ marginTop: gi > 0 ? "10px" : 0,
5210
+ marginBottom: "4px"
5211
+ },
5212
+ children: group.name
5213
+ }
5214
+ ),
5215
+ group.items.map((room, ri) => /* @__PURE__ */ jsx(
5216
+ "div",
5217
+ {
5218
+ style: {
5219
+ fontSize: "14px",
5220
+ color: emailTokens.foreground,
5221
+ marginBottom: ri < group.items.length - 1 ? "4px" : 0
5222
+ },
5223
+ children: `\xB7 ${roomLine(room)}`
5224
+ },
5225
+ ri
5226
+ ))
5227
+ ] }, gi))
5228
+ )
5181
5229
  ]
5182
5230
  }
5183
5231
  )
@@ -5190,8 +5238,8 @@ function BookingSummary({ heading, rows, rooms, roomsHeading, bedArrangementLabe
5190
5238
  style: {
5191
5239
  padding: "12px 20px",
5192
5240
  textAlign: "center",
5193
- fontWeight: (_g = footer.fontWeight) != null ? _g : 600,
5194
- color: (_h = footer.color) != null ? _h : emailTokens.foreground,
5241
+ fontWeight: (_h = footer.fontWeight) != null ? _h : 600,
5242
+ color: (_i = footer.color) != null ? _i : emailTokens.foreground,
5195
5243
  backgroundColor: footer.backgroundColor
5196
5244
  },
5197
5245
  children: footer.text