@planetaexo/design-system 0.92.4 → 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.cjs CHANGED
@@ -5078,7 +5078,7 @@ var DEFAULT_BED_LABELS = {
5078
5078
  QUINTUPLE: "Quintuple"
5079
5079
  };
5080
5080
  function BookingSummary({ heading, rows, rooms, roomsHeading, bedArrangementLabels, footer, className }) {
5081
- var _a, _b, _c, _d, _e, _f, _g, _h;
5081
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i;
5082
5082
  const hasRooms = !!rooms && rooms.length > 0;
5083
5083
  const bedLabels = {
5084
5084
  DOUBLE: (_a = bedArrangementLabels == null ? void 0 : bedArrangementLabels.DOUBLE) != null ? _a : DEFAULT_BED_LABELS.DOUBLE,
@@ -5088,6 +5088,21 @@ function BookingSummary({ heading, rows, rooms, roomsHeading, bedArrangementLabe
5088
5088
  QUADRUPLE: (_e = bedArrangementLabels == null ? void 0 : bedArrangementLabels.QUADRUPLE) != null ? _e : DEFAULT_BED_LABELS.QUADRUPLE,
5089
5089
  QUINTUPLE: (_f = bedArrangementLabels == null ? void 0 : bedArrangementLabels.QUINTUPLE) != null ? _f : DEFAULT_BED_LABELS.QUINTUPLE
5090
5090
  };
5091
+ const roomGroups = [];
5092
+ let anyAccommodation = false;
5093
+ if (hasRooms) {
5094
+ for (const room of rooms) {
5095
+ const name = ((_g = room.accommodationName) == null ? void 0 : _g.trim()) || null;
5096
+ if (name) anyAccommodation = true;
5097
+ let bucket = roomGroups.find((g) => g.name === name);
5098
+ if (!bucket) {
5099
+ bucket = { name, items: [] };
5100
+ roomGroups.push(bucket);
5101
+ }
5102
+ bucket.items.push(room);
5103
+ }
5104
+ }
5105
+ const roomLine = (room) => `${room.qty}\xD7 ${room.roomName} \u2014 ${bedLabels[room.bedArrangement]}`;
5091
5106
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className, style: { marginBottom: "24px" }, children: [
5092
5107
  heading && /* @__PURE__ */ jsxRuntime.jsx(
5093
5108
  "p",
@@ -5187,18 +5202,51 @@ function BookingSummary({ heading, rows, rooms, roomsHeading, bedArrangementLabe
5187
5202
  children: roomsHeading != null ? roomsHeading : "Accommodations"
5188
5203
  }
5189
5204
  ),
5190
- rooms.map((room, i) => /* @__PURE__ */ jsxRuntime.jsx(
5191
- "div",
5192
- {
5193
- style: {
5194
- fontSize: "14px",
5195
- color: emailTokens.foreground,
5196
- marginBottom: i < rooms.length - 1 ? "4px" : 0
5205
+ !anyAccommodation ? (
5206
+ // Retrocompat: nenhum item tem accommodationName → lista flat
5207
+ // (idêntica ao render anterior).
5208
+ rooms.map((room, i) => /* @__PURE__ */ jsxRuntime.jsx(
5209
+ "div",
5210
+ {
5211
+ style: {
5212
+ fontSize: "14px",
5213
+ color: emailTokens.foreground,
5214
+ marginBottom: i < rooms.length - 1 ? "4px" : 0
5215
+ },
5216
+ children: roomLine(room)
5197
5217
  },
5198
- children: `${room.qty}\xD7 ${room.roomName} \u2014 ${bedLabels[room.bedArrangement]}`
5199
- },
5200
- i
5201
- ))
5218
+ i
5219
+ ))
5220
+ ) : (
5221
+ // Agrupado por acomodação: sub-heading (nome) + quartos do grupo.
5222
+ roomGroups.map((group, gi) => /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
5223
+ group.name && /* @__PURE__ */ jsxRuntime.jsx(
5224
+ "div",
5225
+ {
5226
+ style: {
5227
+ fontSize: "14px",
5228
+ fontWeight: 700,
5229
+ color: emailTokens.foreground,
5230
+ marginTop: gi > 0 ? "10px" : 0,
5231
+ marginBottom: "4px"
5232
+ },
5233
+ children: group.name
5234
+ }
5235
+ ),
5236
+ group.items.map((room, ri) => /* @__PURE__ */ jsxRuntime.jsx(
5237
+ "div",
5238
+ {
5239
+ style: {
5240
+ fontSize: "14px",
5241
+ color: emailTokens.foreground,
5242
+ marginBottom: ri < group.items.length - 1 ? "4px" : 0
5243
+ },
5244
+ children: `\xB7 ${roomLine(room)}`
5245
+ },
5246
+ ri
5247
+ ))
5248
+ ] }, gi))
5249
+ )
5202
5250
  ]
5203
5251
  }
5204
5252
  )
@@ -5211,8 +5259,8 @@ function BookingSummary({ heading, rows, rooms, roomsHeading, bedArrangementLabe
5211
5259
  style: {
5212
5260
  padding: "12px 20px",
5213
5261
  textAlign: "center",
5214
- fontWeight: (_g = footer.fontWeight) != null ? _g : 600,
5215
- color: (_h = footer.color) != null ? _h : emailTokens.foreground,
5262
+ fontWeight: (_h = footer.fontWeight) != null ? _h : 600,
5263
+ color: (_i = footer.color) != null ? _i : emailTokens.foreground,
5216
5264
  backgroundColor: footer.backgroundColor
5217
5265
  },
5218
5266
  children: footer.text