kupos-ui-components-lib 9.5.8 → 9.6.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.
Files changed (46) hide show
  1. package/dist/assets/images/anims/service_list/succes_anim.json +1 -0
  2. package/dist/components/PaymentSideBar/PaymentSideBarDesktop.js +0 -1
  3. package/dist/components/Survey/ResponsiveSurvey.d.ts +3 -0
  4. package/dist/components/Survey/ResponsiveSurvey.js +10 -0
  5. package/dist/components/Survey/SurveyDesktop.d.ts +4 -0
  6. package/dist/components/Survey/SurveyDesktop.js +36 -0
  7. package/dist/components/Survey/SurveyMobile.d.ts +4 -0
  8. package/dist/components/Survey/SurveyMobile.js +39 -0
  9. package/dist/components/Survey/index.d.ts +5 -0
  10. package/dist/components/Survey/index.js +4 -0
  11. package/dist/components/Survey/types.d.ts +18 -0
  12. package/dist/components/Survey/types.js +1 -0
  13. package/dist/ui/BottomSheet/BottomSheet.d.ts +17 -0
  14. package/dist/ui/BottomSheet/BottomSheet.js +77 -0
  15. package/dist/ui/BottomSheet/index.d.ts +2 -0
  16. package/dist/ui/BottomSheet/index.js +1 -0
  17. package/dist/ui/Modal/Modal.d.ts +17 -0
  18. package/dist/ui/Modal/Modal.js +46 -0
  19. package/dist/ui/Modal/ModalHeader.d.ts +8 -0
  20. package/dist/ui/Modal/ModalHeader.js +30 -0
  21. package/dist/ui/Modal/index.d.ts +4 -0
  22. package/dist/ui/Modal/index.js +2 -0
  23. package/dist/ui/SeatSection/SeatSection.js +50 -1
  24. package/dist/ui/Survey/FeedbackBanner.d.ts +7 -0
  25. package/dist/ui/Survey/FeedbackBanner.js +21 -0
  26. package/dist/ui/Survey/FeedbackTextarea.d.ts +9 -0
  27. package/dist/ui/Survey/FeedbackTextarea.js +53 -0
  28. package/dist/ui/Survey/HeartIcon.d.ts +3 -0
  29. package/dist/ui/Survey/HeartIcon.js +4 -0
  30. package/dist/ui/Survey/ScoreButtons.d.ts +10 -0
  31. package/dist/ui/Survey/ScoreButtons.js +45 -0
  32. package/dist/ui/Survey/SurveyFooter.d.ts +14 -0
  33. package/dist/ui/Survey/SurveyFooter.js +88 -0
  34. package/dist/ui/Survey/SurveyHeader.d.ts +6 -0
  35. package/dist/ui/Survey/SurveyHeader.js +44 -0
  36. package/dist/ui/Survey/ThankYouCard.d.ts +7 -0
  37. package/dist/ui/Survey/ThankYouCard.js +57 -0
  38. package/dist/ui/Survey/constants.d.ts +13 -0
  39. package/dist/ui/Survey/constants.js +46 -0
  40. package/dist/ui/Survey/index.d.ts +9 -0
  41. package/dist/ui/Survey/index.js +8 -0
  42. package/dist/ui/mobileweb/SeatSectionMobile.js +48 -3
  43. package/package.json +1 -1
  44. package/src/components/PaymentSideBar/PaymentSideBarDesktop.tsx +0 -1
  45. package/src/ui/SeatSection/SeatSection.tsx +98 -1
  46. package/src/ui/mobileweb/SeatSectionMobile.tsx +97 -1
@@ -0,0 +1,45 @@
1
+ import React from "react";
2
+ import { getZoneColor, getZoneShadow } from "./constants";
3
+ const ScoreButtons = ({ selectedScore, onScoreChange, buttonHeight = 54, fontSize = 15, gap = 8, }) => (React.createElement("div", { style: { marginBottom: 4 } },
4
+ React.createElement("div", { style: {
5
+ display: "grid",
6
+ gridTemplateColumns: "repeat(10, 1fr)",
7
+ gap,
8
+ } }, Array.from({ length: 10 }, (_, i) => i + 1).map((num) => {
9
+ const isSelected = selectedScore === num;
10
+ const zoneColor = getZoneColor(num);
11
+ return (React.createElement("button", { key: num, onClick: () => onScoreChange === null || onScoreChange === void 0 ? void 0 : onScoreChange(num), onMouseEnter: (e) => {
12
+ if (!isSelected) {
13
+ e.currentTarget.style.borderColor = zoneColor;
14
+ e.currentTarget.style.color = zoneColor;
15
+ }
16
+ }, onMouseLeave: (e) => {
17
+ if (!isSelected) {
18
+ e.currentTarget.style.borderColor = "#E5E7EB";
19
+ e.currentTarget.style.color = "#111827";
20
+ }
21
+ }, style: {
22
+ height: buttonHeight,
23
+ borderRadius: 14,
24
+ fontSize,
25
+ fontWeight: 600,
26
+ border: isSelected ? "none" : "1.5px solid #E5E7EB",
27
+ background: isSelected ? zoneColor : "#FFFFFF",
28
+ color: isSelected ? "#FFFFFF" : "#111827",
29
+ cursor: "pointer",
30
+ transition: "border-color 0.15s, color 0.15s, background 0.15s",
31
+ boxShadow: isSelected ? getZoneShadow(num) : "none",
32
+ display: "flex",
33
+ alignItems: "center",
34
+ justifyContent: "center",
35
+ boxSizing: "border-box",
36
+ } }, num));
37
+ })),
38
+ React.createElement("div", { style: {
39
+ display: "flex",
40
+ justifyContent: "space-between",
41
+ marginTop: 8,
42
+ } },
43
+ React.createElement("span", { style: { fontSize: 12, color: "#9CA3AF" } }, "No es probable"),
44
+ React.createElement("span", { style: { fontSize: 12, color: "#9CA3AF" } }, "Muy probable"))));
45
+ export default ScoreButtons;
@@ -0,0 +1,14 @@
1
+ import React from "react";
2
+ interface SurveyFooterProps {
3
+ selectedScore?: number | null;
4
+ onSkip?: () => void;
5
+ onSubmit: () => void;
6
+ layout?: "inline" | "stacked";
7
+ colors?: {
8
+ secondaryColor?: string;
9
+ tertiaryColor?: string;
10
+ primaryColor?: string;
11
+ };
12
+ }
13
+ declare const SurveyFooter: ({ selectedScore, onSkip, onSubmit, layout, colors, }: SurveyFooterProps) => React.JSX.Element;
14
+ export default SurveyFooter;
@@ -0,0 +1,88 @@
1
+ import React from "react";
2
+ const SurveyFooter = ({ selectedScore, onSkip, onSubmit, layout = "inline", colors, }) => {
3
+ if (layout === "stacked") {
4
+ return (React.createElement("div", { style: { marginTop: 24 } },
5
+ React.createElement("button", { onClick: onSkip, style: {
6
+ display: "block",
7
+ width: "100%",
8
+ textAlign: "center",
9
+ fontSize: "13.33px",
10
+ color: "#6B7280",
11
+ background: "none",
12
+ border: "none",
13
+ cursor: "pointer",
14
+ padding: "0 0 14px",
15
+ } }, "Saltar por ahora"),
16
+ React.createElement("button", { onClick: onSubmit, disabled: selectedScore == null, style: {
17
+ display: "flex",
18
+ alignItems: "center",
19
+ justifyContent: "center",
20
+ gap: 8,
21
+ width: "100%",
22
+ padding: "16px",
23
+ borderRadius: 999,
24
+ fontSize: "13.33px",
25
+ fontWeight: 700,
26
+ letterSpacing: "0.08em",
27
+ textTransform: "uppercase",
28
+ border: "none",
29
+ cursor: selectedScore != null ? "pointer" : "not-allowed",
30
+ background: selectedScore != null
31
+ ? colors === null || colors === void 0 ? void 0 : colors.secondaryColor
32
+ : "rgba(232,76,13,0.28)",
33
+ color: "#FFFFFF",
34
+ transition: "background 0.15s",
35
+ } },
36
+ "Enviar comentarios ",
37
+ React.createElement("span", null, "\u2192"))));
38
+ }
39
+ return (React.createElement(React.Fragment, null,
40
+ React.createElement("div", { style: {
41
+ display: "flex",
42
+ alignItems: "center",
43
+ justifyContent: "space-between",
44
+ marginTop: 24,
45
+ } },
46
+ React.createElement("button", { onClick: onSkip, style: {
47
+ fontSize: "13.33px",
48
+ color: "#6B7280",
49
+ background: "none",
50
+ border: "none",
51
+ cursor: "pointer",
52
+ padding: 0,
53
+ } }, "Saltar por ahora"),
54
+ React.createElement("button", { onClick: onSubmit, disabled: selectedScore == null, style: {
55
+ display: "flex",
56
+ alignItems: "center",
57
+ gap: 8,
58
+ padding: "14px 28px",
59
+ borderRadius: 999,
60
+ fontSize: "13.33px",
61
+ fontWeight: 700,
62
+ letterSpacing: "0.08em",
63
+ textTransform: "uppercase",
64
+ border: "none",
65
+ cursor: selectedScore != null ? "pointer" : "not-allowed",
66
+ background: selectedScore != null
67
+ ? colors === null || colors === void 0 ? void 0 : colors.secondaryColor
68
+ : "rgba(232,76,13,0.28)",
69
+ color: "#FFFFFF",
70
+ transition: "background 0.15s",
71
+ minWidth: 160,
72
+ justifyContent: "center",
73
+ } },
74
+ "Enviar comentarios ",
75
+ React.createElement("span", null, "\u2192"))),
76
+ React.createElement("div", { style: {
77
+ display: "flex",
78
+ alignItems: "center",
79
+ justifyContent: "center",
80
+ gap: 6,
81
+ marginTop: 14,
82
+ fontSize: 12,
83
+ color: "#9CA3AF",
84
+ } },
85
+ React.createElement("span", null, "\uD83D\uDD12"),
86
+ React.createElement("span", null, "An\u00F3nimo \u00B7 solo se usa para mejorar el servicio"))));
87
+ };
88
+ export default SurveyFooter;
@@ -0,0 +1,6 @@
1
+ import React from "react";
2
+ interface SurveyHeaderProps {
3
+ onClose?: () => void;
4
+ }
5
+ declare const SurveyHeader: ({ onClose }: SurveyHeaderProps) => React.JSX.Element;
6
+ export default SurveyHeader;
@@ -0,0 +1,44 @@
1
+ import React from "react";
2
+ import { BRAND } from "./constants";
3
+ const SurveyHeader = ({ onClose }) => (React.createElement("div", { style: {
4
+ display: "flex",
5
+ alignItems: "center",
6
+ justifyContent: "space-between",
7
+ } },
8
+ React.createElement("div", { style: { display: "flex", alignItems: "center", gap: 6 } },
9
+ React.createElement("span", { style: {
10
+ width: 8,
11
+ height: 8,
12
+ borderRadius: "50%",
13
+ backgroundColor: BRAND,
14
+ display: "inline-block",
15
+ flexShrink: 0,
16
+ } }),
17
+ React.createElement("span", { style: {
18
+ color: BRAND,
19
+ fontSize: 11,
20
+ fontWeight: 700,
21
+ letterSpacing: "0.1em",
22
+ textTransform: "uppercase",
23
+ } }, "Comentarios r\u00E1pidos"),
24
+ React.createElement("span", { style: {
25
+ color: "#9CA3AF",
26
+ fontSize: 11,
27
+ letterSpacing: "0.06em",
28
+ textTransform: "uppercase",
29
+ } }, "\u00B7 Tarda 20 segundos")),
30
+ React.createElement("button", { onClick: onClose, style: {
31
+ width: 36,
32
+ height: 36,
33
+ borderRadius: "50%",
34
+ background: "#F3F4F6",
35
+ border: "none",
36
+ cursor: "pointer",
37
+ fontSize: 14,
38
+ color: "#6B7280",
39
+ display: "flex",
40
+ alignItems: "center",
41
+ justifyContent: "center",
42
+ flexShrink: 0,
43
+ } }, "\u2715")));
44
+ export default SurveyHeader;
@@ -0,0 +1,7 @@
1
+ import React from "react";
2
+ interface ThankYouCardProps {
3
+ onClose?: () => void;
4
+ titleFontSize?: string;
5
+ }
6
+ declare const ThankYouCard: ({ onClose, titleFontSize, }: ThankYouCardProps) => React.JSX.Element;
7
+ export default ThankYouCard;
@@ -0,0 +1,57 @@
1
+ import React from "react";
2
+ import { BRAND } from "./constants";
3
+ import succes_anim from "../../assets/images/anims/service_list/succes_anim.json";
4
+ import LottiePlayer from "../../assets/LottiePlayer";
5
+ const ThankYouCard = ({ onClose, titleFontSize = "1.5rem", }) => (React.createElement("div", { style: {
6
+ display: "flex",
7
+ flexDirection: "column",
8
+ alignItems: "center",
9
+ justifyContent: "center",
10
+ padding: "48px 40px 40px",
11
+ position: "relative",
12
+ } },
13
+ React.createElement("button", { onClick: onClose, style: {
14
+ position: "absolute",
15
+ top: 16,
16
+ right: 16,
17
+ width: 34,
18
+ height: 34,
19
+ borderRadius: "50%",
20
+ border: "none",
21
+ background: "#F3F4F6",
22
+ color: "#6B7280",
23
+ fontSize: 14,
24
+ cursor: "pointer",
25
+ display: "flex",
26
+ alignItems: "center",
27
+ justifyContent: "center",
28
+ } }, "\u2715"),
29
+ React.createElement("div", { style: {
30
+ width: 64,
31
+ height: 64,
32
+ borderRadius: "50%",
33
+ backgroundColor: "#DCFCE7",
34
+ display: "flex",
35
+ alignItems: "center",
36
+ justifyContent: "center",
37
+ marginBottom: 20,
38
+ } },
39
+ React.createElement(LottiePlayer, { animationData: succes_anim, loop: true, autoplay: true, width: "70px", height: "70px" })),
40
+ React.createElement("h2", { style: {
41
+ fontSize: titleFontSize,
42
+ fontWeight: 700,
43
+ color: "#111827",
44
+ textAlign: "center",
45
+ marginBottom: 10,
46
+ lineHeight: 1.3,
47
+ } },
48
+ "Gracias por tu",
49
+ " ",
50
+ React.createElement("em", { style: {
51
+ color: BRAND,
52
+ fontFamily: "Georgia, 'Times New Roman', serif",
53
+ fontStyle: "italic",
54
+ fontWeight: "bold",
55
+ } }, "comentario")),
56
+ React.createElement("p", { style: { fontSize: "13.33px", color: "#6B7280", textAlign: "center" } }, "Hemos le\u00EDdo todas las respuestas. \u00A1Que tengas un buen viaje!")));
57
+ export default ThankYouCard;
@@ -0,0 +1,13 @@
1
+ export declare const BRAND = "#E84C0D";
2
+ export declare const MAX_CHARS = 500;
3
+ export type FeedbackConfig = {
4
+ emoji: string;
5
+ message: string;
6
+ bannerBg: string;
7
+ bannerText: string;
8
+ question: string;
9
+ placeholder: string;
10
+ };
11
+ export declare const getZoneColor: (num: number) => string;
12
+ export declare const getZoneShadow: (num: number) => string;
13
+ export declare const getFeedbackConfig: (score: number | null | undefined) => FeedbackConfig | null;
@@ -0,0 +1,46 @@
1
+ export const BRAND = "#E84C0D";
2
+ export const MAX_CHARS = 500;
3
+ export const getZoneColor = (num) => {
4
+ if (num <= 6)
5
+ return "#E84C0D";
6
+ if (num <= 8)
7
+ return "#F59E0B";
8
+ return "#22C55E";
9
+ };
10
+ export const getZoneShadow = (num) => {
11
+ if (num <= 6)
12
+ return "0 2px 8px rgba(232,76,13,0.35)";
13
+ if (num <= 8)
14
+ return "0 2px 8px rgba(245,158,11,0.35)";
15
+ return "0 2px 8px rgba(34,197,94,0.35)";
16
+ };
17
+ export const getFeedbackConfig = (score) => {
18
+ if (score == null)
19
+ return null;
20
+ if (score <= 6)
21
+ return {
22
+ emoji: "😔",
23
+ message: "Lo sentimos, no cumplimos tus expectativas.",
24
+ bannerBg: "#FFF0EE",
25
+ bannerText: BRAND,
26
+ question: "¿Qué salió mal?",
27
+ placeholder: "Cuéntanos qué podríamos haber hecho mejor — cada detalle nos ayuda.",
28
+ };
29
+ if (score <= 8)
30
+ return {
31
+ emoji: "🤔",
32
+ message: "Gracias — apreciamos tu sinceridad.",
33
+ bannerBg: "#FFFBEB",
34
+ bannerText: "#92400E",
35
+ question: "¿Qué podría mejorar?",
36
+ placeholder: "Cuéntanos qué podría hacer que la experiencia sea aún mejor.",
37
+ };
38
+ return {
39
+ emoji: "🎉",
40
+ message: "¡Nos acabas de alegrar el día!",
41
+ bannerBg: "#F0FDF4",
42
+ bannerText: "#166534",
43
+ question: "¿Qué hicimos bien?",
44
+ placeholder: "¡Nos encantaría saber qué fue lo que más te gustó!",
45
+ };
46
+ };
@@ -0,0 +1,9 @@
1
+ export { default as HeartIcon } from "./HeartIcon";
2
+ export { default as ThankYouCard } from "./ThankYouCard";
3
+ export { default as SurveyHeader } from "./SurveyHeader";
4
+ export { default as ScoreButtons } from "./ScoreButtons";
5
+ export { default as FeedbackBanner } from "./FeedbackBanner";
6
+ export { default as FeedbackTextarea } from "./FeedbackTextarea";
7
+ export { default as SurveyFooter } from "./SurveyFooter";
8
+ export { BRAND, MAX_CHARS, getZoneColor, getZoneShadow, getFeedbackConfig } from "./constants";
9
+ export type { FeedbackConfig } from "./constants";
@@ -0,0 +1,8 @@
1
+ export { default as HeartIcon } from "./HeartIcon";
2
+ export { default as ThankYouCard } from "./ThankYouCard";
3
+ export { default as SurveyHeader } from "./SurveyHeader";
4
+ export { default as ScoreButtons } from "./ScoreButtons";
5
+ export { default as FeedbackBanner } from "./FeedbackBanner";
6
+ export { default as FeedbackTextarea } from "./FeedbackTextarea";
7
+ export { default as SurveyFooter } from "./SurveyFooter";
8
+ export { BRAND, MAX_CHARS, getZoneColor, getZoneShadow, getFeedbackConfig } from "./constants";
@@ -43,7 +43,7 @@ const getUniqueSeats = (data, limit) => {
43
43
  .slice(0, limit);
44
44
  };
45
45
  function SeatSectionMobile({ seatTypes: seatTypesData, isSoldOut, isPeru, seatPriceColor, currencySign, availableSeats, removeDuplicateSeats, serviceItem, tooltipBgColor, showLastSeats, }) {
46
- var _a, _b, _c, _d, _e;
46
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
47
47
  const hasMultipleTypes = ((_a = seatTypesData === null || seatTypesData === void 0 ? void 0 : seatTypesData.length) !== null && _a !== void 0 ? _a : 0) > 2;
48
48
  const getFare = (fare) => {
49
49
  if (removeDuplicateSeats && availableSeats <= 0 && !isPeru) {
@@ -133,7 +133,52 @@ function SeatSectionMobile({ seatTypes: seatTypesData, isSoldOut, isPeru, seatPr
133
133
  typeof (serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.discount_value) === "number"
134
134
  ? Math.round(serviceItem.discount_value)
135
135
  : null;
136
- return (React.createElement("div", { className: "content-center relative", style: { width: "40%" } }, (serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.is_dp_enabled) ? (React.createElement("div", { className: "flex flex-col justify-between h-[2.5rem]", style: { gap: isSoldOut ? "0px" : "5px" } }, renderDpSeats())) : hasDiscount && discountSeat ? (React.createElement("div", { className: "relative grid grid-cols-[auto_auto] justify-between gap-x-[8px] " },
136
+ const originalDpPrice = Array.isArray(serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.original_dp_price)
137
+ ? serviceItem.original_dp_price[0]
138
+ : Object.values((serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.original_dp_price) || {})[0];
139
+ const dpDiscountPercent = Array.isArray(serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.dp_discount_percents)
140
+ ? serviceItem.dp_discount_percents[0]
141
+ : Object.values((serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.dp_discount_percents) || {})[0];
142
+ const firstSeatFare = (_f = (_e = seatTypesData === null || seatTypesData === void 0 ? void 0 : seatTypesData.filter((item) => getFilteredSeats(item.label) && !EXCEPTIONS.includes(item.label))) === null || _e === void 0 ? void 0 : _e[0]) === null || _f === void 0 ? void 0 : _f.fare;
143
+ const hasDpDiscount = (serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.dp_discounted_seats) &&
144
+ (serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.dp_discount_percents) &&
145
+ originalDpPrice != null &&
146
+ dpDiscountPercent != null &&
147
+ firstSeatFare != null;
148
+ return (React.createElement("div", { className: "content-center relative", style: { width: "40%" } }, (serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.is_dp_enabled) &&
149
+ !((_g = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.dp_discounted_seats) === null || _g === void 0 ? void 0 : _g.length) &&
150
+ !dpDiscountPercent ? (React.createElement("div", { className: "flex flex-col justify-between h-[2.5rem]", style: { gap: isSoldOut ? "0px" : "5px" } }, renderDpSeats())) : hasDpDiscount ? (React.createElement("div", { className: "relative grid grid-cols-[auto_auto] justify-between gap-x-[8px] " },
151
+ !isNaN(Number(dpDiscountPercent)) &&
152
+ Number(dpDiscountPercent) > 0 && (React.createElement("div", { className: "absolute -top-[18px] right-[0px]", style: {
153
+ animation: "pulse-zoom 2s ease-in-out infinite",
154
+ } },
155
+ React.createElement("span", { className: "rounded-[100px] px-[8px] text-[12px] bold-text leading-[20px] text-[#fff]", style: {
156
+ backgroundColor: tooltipBgColor,
157
+ } },
158
+ Math.round(Number(dpDiscountPercent)),
159
+ "% OFF"))),
160
+ React.createElement("span", { className: "min-[420]:text-[13px] text-[12px] leading-[20px] text-[#c2c2c2]" }, "Antes"),
161
+ React.createElement("span", { className: "min-[420]:text-[13px] text-[12px] leading-[20px] text-[#9f9f9f] text-right", style: {
162
+ position: "relative",
163
+ display: "inline-block",
164
+ overflow: "hidden",
165
+ } },
166
+ commonService.currency(Number(originalDpPrice), currencySign),
167
+ React.createElement("span", { style: {
168
+ position: "absolute",
169
+ top: "35%",
170
+ left: "50%",
171
+ width: "80%",
172
+ height: "1px",
173
+ background: "#9f9f9f",
174
+ transform: "rotate(-12deg)",
175
+ transformOrigin: "center",
176
+ } })),
177
+ React.createElement("span", { className: "min-[420]:text-[13px] text-[12px] leading-[24px]", style: { color: isSoldOut ? "#bbb" : "#464647" } }, "Desde"),
178
+ React.createElement("span", { className: "flex items-center justify-end gap-[4px] text-[14px] bold-text leading-[24px]", style: { color: isSoldOut ? "#bbb" : "#ff5964" } },
179
+ ((_h = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _h === void 0 ? void 0 : _h.fireIcon) ? (React.createElement("img", { src: serviceItem.icons.fireIcon, alt: "discount", className: "h-[16px] w-[16px] object-contain", style: { filter: isSoldOut ? "grayscale" : "" } })) : null,
180
+ commonService.discountedCurrency(Number(firstSeatFare), currencySign)),
181
+ isSoldOut ? (React.createElement("span", { className: "col-span-2 min-[420]:text-[13px] text-right text-[12px] text-[#ccc]" }, "Agotado")) : null)) : hasDiscount && discountSeat ? (React.createElement("div", { className: "relative grid grid-cols-[auto_auto] justify-between gap-x-[8px] " },
137
182
  discountValue != null && (React.createElement("div", { className: "absolute -top-[18px] right-[0px]", style: {
138
183
  animation: "pulse-zoom 2s ease-in-out infinite",
139
184
  } },
@@ -161,7 +206,7 @@ function SeatSectionMobile({ seatTypes: seatTypesData, isSoldOut, isPeru, seatPr
161
206
  } })),
162
207
  React.createElement("span", { className: "min-[420]:text-[13px] text-[12px] leading-[24px]", style: { color: isSoldOut ? "#bbb" : "#464647" } }, "Desde"),
163
208
  React.createElement("span", { className: "flex items-center justify-end gap-[4px] text-[14px] bold-text leading-[24px]", style: { color: isSoldOut ? "#bbb" : "#ff5964" } },
164
- ((_e = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _e === void 0 ? void 0 : _e.fireIcon) ? (React.createElement("img", { src: serviceItem.icons.fireIcon, alt: "discount", className: "h-[16px] w-[16px] object-contain", style: { filter: isSoldOut ? "grayscale" : "" } })) : null,
209
+ ((_j = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.icons) === null || _j === void 0 ? void 0 : _j.fireIcon) ? (React.createElement("img", { src: serviceItem.icons.fireIcon, alt: "discount", className: "h-[16px] w-[16px] object-contain", style: { filter: isSoldOut ? "grayscale" : "" } })) : null,
165
210
  commonService.discountedCurrency(discountSeat.discountedPrice, currencySign)),
166
211
  isSoldOut ? (React.createElement("span", { className: "col-span-2 min-[420]:text-[13px] text-right text-[12px] text-[#ccc]" }, "Agotado")) : null)) : (React.createElement("div", { className: "flex flex-col justify-between h-[2.5rem] ", style: {
167
212
  gap: isSoldOut ? "0px" : "5px",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kupos-ui-components-lib",
3
- "version": "9.5.8",
3
+ "version": "9.6.0",
4
4
  "description": "A reusable UI components package",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -569,7 +569,6 @@ const PaymentSideBarDesktop: React.FC<PaymentSideBarProps> = ({
569
569
  >
570
570
  {selectSeatOnward && selectedOnward && selectedOnward[0]
571
571
  ? selectedOnward[0].map((val, key) => {
572
- console.log("🚀 ~ PaymentSideBarDesktop ~ val:", val);
573
572
  return (
574
573
  <div
575
574
  key={key}
@@ -222,7 +222,14 @@ function SeatSection({
222
222
  return renderSeatNames();
223
223
  };
224
224
 
225
- if (serviceItem?.is_dp_enabled) {
225
+ const _dpSeatsFirstVal = Array.isArray(serviceItem?.dp_discounted_seats)
226
+ ? serviceItem.dp_discounted_seats[0]
227
+ : Object.values(serviceItem?.dp_discounted_seats || {})[0];
228
+ const _dpPercentsFirstVal = Array.isArray(serviceItem?.dp_discount_percents)
229
+ ? serviceItem.dp_discount_percents[0]
230
+ : Object.values(serviceItem?.dp_discount_percents || {})[0];
231
+
232
+ if (serviceItem?.is_dp_enabled && !_dpSeatsFirstVal && !_dpPercentsFirstVal) {
226
233
  const dpSeats = (
227
234
  removeDuplicateSeats ? uniqueSeats : sortedSeatTypes
228
235
  ).filter((s) => !SEAT_EXCEPTIONS.includes(s.label));
@@ -279,6 +286,96 @@ function SeatSection({
279
286
  );
280
287
  }
281
288
 
289
+ if (_dpSeatsFirstVal && _dpPercentsFirstVal) {
290
+ const originalDpPrice = Array.isArray(serviceItem.original_dp_price)
291
+ ? serviceItem.original_dp_price[0]
292
+ : Object.values(serviceItem.original_dp_price || {})[0];
293
+ const dpDiscountPercent = Array.isArray(serviceItem.dp_discount_percents)
294
+ ? serviceItem.dp_discount_percents[0]
295
+ : Object.values(serviceItem.dp_discount_percents || {})[0];
296
+ const seatTypeFare = serviceItem.seat_types?.[0]?.fare;
297
+
298
+ if (originalDpPrice && seatTypeFare) {
299
+ return (
300
+ <div className="grid grid-cols-2 items-center text-[13.33px] relative">
301
+ <div className="col-start-1 row-start-2 flex items-center">
302
+ <span className="text-[13.33px] font-normal leading-[22px] text-[#ccc]">
303
+ Antes
304
+ </span>
305
+ </div>
306
+
307
+ <div className="col-start-1 row-start-3 flex h-[20px] items-end">
308
+ <span className="text-[13.33px] font-normal leading-[20px] text-[#464647]">
309
+ Desde
310
+ </span>
311
+ </div>
312
+
313
+ <div
314
+ className="col-start-2 row-start-1 flex items-center justify-center absolute"
315
+ style={{ top: "-22px", left: "50%", transform: "translateX(-50%)" }}
316
+ >
317
+ {!isNaN(Number(dpDiscountPercent)) &&
318
+ Number(dpDiscountPercent) > 0 && (
319
+ <span
320
+ className="rounded-[100px] bg-[#ff5964] px-[6px] text-[12px] bold-text leading-[20px] text-white"
321
+ style={{
322
+ animation: "pulse-zoom 2s ease-in-out infinite",
323
+ whiteSpace: "nowrap",
324
+ }}
325
+ >
326
+ {Math.round(Number(dpDiscountPercent))}% OFF
327
+ </span>
328
+ )}
329
+ </div>
330
+
331
+ <div
332
+ className="col-start-2 row-start-2 flex items-center justify-center"
333
+ style={{ textAlign: "center" }}
334
+ >
335
+ <span
336
+ className="text-[13.33px] font-normal leading-[20px] text-[#9f9f9f] relative"
337
+ style={{ position: "relative" }}
338
+ >
339
+ {formatPrice(Number(originalDpPrice))}
340
+ <span
341
+ style={{
342
+ position: "absolute",
343
+ left: "-2px",
344
+ top: "50%",
345
+ width: "calc(100% + 4px)",
346
+ height: "1px",
347
+ backgroundColor: "#9f9f9f",
348
+ transform: "rotate(-10deg)",
349
+ transformOrigin: "center",
350
+ }}
351
+ />
352
+ </span>
353
+ </div>
354
+
355
+ <div className="col-start-2 row-start-3 flex h-[30px] items-end justify-center relative">
356
+ <span
357
+ className="flex items-center gap-[6px] text-[22px] bold-text leading-[30px]"
358
+ style={{ color: isSoldOut ? "#c0c0c0" : "#ff5964" }}
359
+ >
360
+ <div
361
+ className="absolute"
362
+ style={{ left: isPeru ? "-1px" : "-8px" }}
363
+ >
364
+ {renderIcon("fireIcon", "16px")}
365
+ </div>
366
+ {availableSeats <= 0
367
+ ? CommonService.currency(0, currencySign)
368
+ : CommonService.discountedCurrency(
369
+ Number(seatTypeFare),
370
+ currencySign,
371
+ )}
372
+ </span>
373
+ </div>
374
+ </div>
375
+ );
376
+ }
377
+ }
378
+
282
379
  if (hasDiscount && discountSeat) {
283
380
  return (
284
381
  <div className="grid grid-cols-2 items-center text-[13.33px] relative">