kupos-ui-components-lib 9.0.4 → 9.0.6

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 (57) hide show
  1. package/README copy.md +223 -67
  2. package/dist/assets/images/anims/service_list/bomb.json +1 -0
  3. package/dist/assets/images/anims/service_list/directo.json +1 -1
  4. package/dist/assets/images/anims/service_list/priority_stage.json +1 -1
  5. package/dist/components/ServiceItem/ExpandedDropdown.d.ts +19 -0
  6. package/dist/components/ServiceItem/ExpandedDropdown.js +28 -0
  7. package/dist/components/ServiceItem/ServiceItemDesktop.d.ts +1 -1
  8. package/dist/components/ServiceItem/ServiceItemDesktop.js +125 -262
  9. package/dist/components/ServiceItem/ServiceItemMobile.js +44 -291
  10. package/dist/components/ServiceItem/mobileTypes.d.ts +3 -0
  11. package/dist/components/ServiceItem/types.d.ts +7 -0
  12. package/dist/styles.css +67 -12
  13. package/dist/ui/AmenitiesBlock.js +60 -66
  14. package/dist/ui/BottomAmenities/BottomAmenities.d.ts +26 -0
  15. package/dist/ui/BottomAmenities/BottomAmenities.js +22 -0
  16. package/dist/ui/DurationBlock.js +2 -2
  17. package/dist/ui/ExpendedDropDown/ExpandedDropdown.d.ts +19 -0
  18. package/dist/ui/ExpendedDropDown/ExpandedDropdown.js +27 -0
  19. package/dist/ui/FlexibleBlock.js +2 -4
  20. package/dist/ui/KuposButton/KuposButton.d.ts +12 -0
  21. package/dist/ui/KuposButton/KuposButton.js +12 -0
  22. package/dist/ui/PetBlock.js +1 -3
  23. package/dist/ui/RatingBlock.js +6 -2
  24. package/dist/ui/SeatSection/SeatSection.d.ts +17 -0
  25. package/dist/ui/SeatSection/SeatSection.js +92 -0
  26. package/dist/ui/TopAmenities/TopAmenities.d.ts +12 -0
  27. package/dist/ui/TopAmenities/TopAmenities.js +32 -0
  28. package/dist/ui/mobileweb/BottomAmenitiesMobile.d.ts +23 -0
  29. package/dist/ui/mobileweb/BottomAmenitiesMobile.js +37 -0
  30. package/dist/ui/mobileweb/DateTimeSectionMobile.d.ts +23 -0
  31. package/dist/ui/mobileweb/DateTimeSectionMobile.js +57 -0
  32. package/dist/ui/mobileweb/SeatSectionMobile.d.ts +17 -0
  33. package/dist/ui/mobileweb/SeatSectionMobile.js +100 -0
  34. package/dist/ui/mobileweb/TopAmenitieMobile.d.ts +10 -0
  35. package/dist/ui/mobileweb/TopAmenitieMobile.js +35 -0
  36. package/package.json +1 -1
  37. package/src/assets/images/anims/service_list/bomb.json +1 -0
  38. package/src/assets/images/anims/service_list/directo.json +1 -1
  39. package/src/assets/images/anims/service_list/priority_stage.json +1 -1
  40. package/src/components/ServiceItem/ServiceItemDesktop.tsx +222 -465
  41. package/src/components/ServiceItem/ServiceItemMobile.tsx +120 -501
  42. package/src/components/ServiceItem/mobileTypes.ts +3 -0
  43. package/src/components/ServiceItem/types.ts +7 -0
  44. package/src/ui/AmenitiesBlock.tsx +115 -97
  45. package/src/ui/BottomAmenities/BottomAmenities.tsx +109 -0
  46. package/src/ui/DurationBlock.tsx +2 -2
  47. package/src/ui/ExpendedDropDown/ExpandedDropdown.tsx +85 -0
  48. package/src/ui/FlexibleBlock.tsx +3 -3
  49. package/src/ui/KuposButton/KuposButton.tsx +48 -0
  50. package/src/ui/PetBlock.tsx +2 -2
  51. package/src/ui/RatingBlock.tsx +16 -4
  52. package/src/ui/SeatSection/SeatSection.tsx +187 -0
  53. package/src/ui/TopAmenities/TopAmenities.tsx +82 -0
  54. package/src/ui/mobileweb/BottomAmenitiesMobile.tsx +168 -0
  55. package/src/ui/mobileweb/DateTimeSectionMobile.tsx +192 -0
  56. package/src/ui/mobileweb/SeatSectionMobile.tsx +256 -0
  57. package/src/ui/mobileweb/TopAmenitieMobile.tsx +82 -0
@@ -1,78 +1,72 @@
1
1
  import React from "react";
2
- import LottiePlayer from "../assets/LottiePlayer";
3
- const AmenitiesBlock = ({ serviceItem, metaData, isSoldOut, colors, isPeru, getAnimationIcon, getAmenityName, SvgAmenities, }) => {
4
- var _a, _b;
5
- if (!metaData ||
6
- !((_a = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.operator_details) === null || _a === void 0 ? void 0 : _a[4]) ||
7
- !serviceItem.operator_details[4].length) {
8
- return null;
9
- }
10
- const PRIORITY_IDS = ["2", "3", "13"];
11
- const amenities = [...serviceItem.operator_details[4]];
12
- const priorityAmenities = amenities.filter((id) => PRIORITY_IDS.includes(id));
13
- const nonPriorityAmenities = amenities.filter((id) => !PRIORITY_IDS.includes(id));
14
- const hasPriority = priorityAmenities.length > 0;
2
+ const DEFAULT_PRIORITY_IDS = ["2", "3", "13"];
3
+ const TOOLTIP_CLASS = "hidden group-hover:block absolute top-[30px] left-1/2 -translate-x-1/2 text-white rounded-[14px] whitespace-nowrap mt-2.5 text-center shadow-service text-[13.33px]";
4
+ const getAmenityBaseName = (amenityStr) => { var _a; return (_a = amenityStr === null || amenityStr === void 0 ? void 0 : amenityStr.split(".")[0]) !== null && _a !== void 0 ? _a : ""; };
5
+ const isWater = (amenityStr) => { var _a; return ((_a = getAmenityBaseName(amenityStr)) === null || _a === void 0 ? void 0 : _a.toUpperCase()) === "WATER"; };
6
+ const TooltipArrow = ({ color }) => (React.createElement("div", { className: "tooltip-arrow absolute -top-[7px] left-1/2 -translate-x-1/2 w-0 h-0 border-l-8 border-r-8 border-b-8 border-l-transparent border-r-transparent", style: { borderBottomColor: color } }));
7
+ const getAmenitySplit = ({ isPeru, amenities, priorityIds }) => {
8
+ const priority = amenities.filter((id) => priorityIds.includes(id));
9
+ const nonPriority = amenities.filter((id) => !priorityIds.includes(id));
10
+ const hasPriority = priority.length > 0;
15
11
  /* ============================
16
12
  🇵🇪 PERU LOGIC
17
13
  ============================ */
18
- let visibleAmenities = [];
19
- let shouldShowPlus = false;
20
- let plusAmenities = [];
21
14
  if (isPeru) {
22
- if (hasPriority) {
23
- visibleAmenities = priorityAmenities;
24
- shouldShowPlus = nonPriorityAmenities.length > 0;
25
- plusAmenities = nonPriorityAmenities;
26
- }
27
- else {
28
- visibleAmenities = [];
29
- shouldShowPlus = amenities.length > 0;
30
- plusAmenities = amenities;
31
- }
15
+ return hasPriority
16
+ ? { visible: priority, plus: nonPriority }
17
+ : { visible: [], plus: amenities };
32
18
  }
33
19
  /* ============================
34
20
  🌍 NON-PERU LOGIC
35
21
  ============================ */
36
- if (!isPeru) {
37
- const sortedAmenities = [...amenities].sort((a, b) => Number(PRIORITY_IDS.includes(b)) - Number(PRIORITY_IDS.includes(a)));
38
- visibleAmenities = sortedAmenities.slice(0, 3);
39
- shouldShowPlus = sortedAmenities.length > 3;
40
- plusAmenities = sortedAmenities.slice(3);
22
+ const sorted = [...amenities].sort((a, b) => Number(priorityIds.includes(b)) - Number(priorityIds.includes(a)));
23
+ return {
24
+ visible: sorted.slice(0, 3),
25
+ plus: sorted.slice(3),
26
+ };
27
+ };
28
+ const AmenitiesBlock = ({ serviceItem, metaData, isSoldOut, colors, isPeru, getAnimationIcon, getAmenityName, SvgAmenities, }) => {
29
+ var _a, _b;
30
+ if (!metaData ||
31
+ !((_a = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.operator_details) === null || _a === void 0 ? void 0 : _a[4]) ||
32
+ !serviceItem.operator_details[4].length) {
33
+ return null;
41
34
  }
42
- return (React.createElement("div", { className: "flex items-center gap-[6px]" },
43
- (serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.is_tracking_enabled) && (React.createElement("div", { className: isSoldOut ? "grayscale" : "" },
44
- React.createElement(LottiePlayer, { animationData: getAnimationIcon("locationAnim"), width: "20px", height: "20px" }))),
45
- visibleAmenities.map((val, key) => {
46
- var _a, _b, _c, _d, _e, _f, _g;
47
- return ((_b = (_a = metaData.amenities[val]) === null || _a === void 0 ? void 0 : _a.split(".")[0]) === null || _b === void 0 ? void 0 : _b.toUpperCase()) !== "WATER" ? (React.createElement("div", { key: key, className: "relative group cursor-pointer" },
48
- React.createElement("div", { className: `${isSoldOut ? "grayscale" : ""}` },
49
- React.createElement(SvgAmenities, { moreAnemities: false, name: (_d = (_c = metaData.amenities[val]) === null || _c === void 0 ? void 0 : _c.split(".")[0]) === null || _d === void 0 ? void 0 : _d.toLowerCase() })),
50
- React.createElement("div", { className: "hidden group-hover:block absolute top-[30px] left-1/2 -translate-x-1/2 text-white rounded-[14px] whitespace-nowrap mt-2.5 text-center shadow-service text-[13.33px]", style: {
51
- backgroundColor: colors.tooltipColor,
52
- zIndex: 21,
53
- padding: "12px",
54
- } },
55
- React.createElement("div", { className: "tooltip-arrow absolute -top-[7px] left-1/2 -translate-x-1/2 w-0 h-0 border-l-8 border-r-8 border-b-8 border-l-transparent border-r-transparent", style: {
56
- borderBottomColor: colors.tooltipColor,
57
- } }),
58
- getAmenityName((_g = (_f = (_e = metaData.amenities[val]) === null || _e === void 0 ? void 0 : _e.split(".")[0]) === null || _f === void 0 ? void 0 : _f.split("_")) === null || _g === void 0 ? void 0 : _g.join(" "))))) : null;
59
- }),
60
- shouldShowPlus && (React.createElement("div", { className: "relative ml-1 cursor-pointer" },
61
- React.createElement("div", { className: "group" },
62
- React.createElement("img", { src: ((_b = serviceItem.icons) === null || _b === void 0 ? void 0 : _b.plus) ||
63
- "/images/icons/amenities/icon_plus.svg", className: "w-[16px] h-[16px]", alt: "plus" }),
64
- React.createElement("div", { style: { zIndex: 100 }, className: "hidden group-hover:block absolute top-[30px] left-1/2 -translate-x-1/2 text-white rounded-[14px] whitespace-nowrap mt-2.5 text-center shadow-service text-[13.33px]" },
65
- React.createElement("div", { className: "tooltip-arrow absolute -top-[7px] left-1/2 -translate-x-1/2 w-0 h-0 border-l-8 border-r-8 border-b-8 border-l-transparent border-r-transparent", style: {
66
- borderBottomColor: colors.tooltipColor,
67
- } }),
68
- React.createElement("div", { className: "flex flex-col gap-[10px] p-3 rounded-[8px] shadow-md", style: {
69
- backgroundColor: colors.tooltipColor,
70
- } }, plusAmenities.map((val, key) => {
71
- var _a, _b, _c, _d, _e, _f, _g;
72
- return ((_b = (_a = metaData.amenities[val]) === null || _a === void 0 ? void 0 : _a.split(".")[0]) === null || _b === void 0 ? void 0 : _b.toUpperCase()) !==
73
- "WATER" ? (React.createElement("div", { key: key, className: "flex items-center gap-[5px] text-xs whitespace-nowrap" },
74
- React.createElement(SvgAmenities, { moreAnemities: true, name: (_d = (_c = metaData.amenities[val]) === null || _c === void 0 ? void 0 : _c.split(".")[0]) === null || _d === void 0 ? void 0 : _d.toUpperCase(), color: "white" }),
75
- getAmenityName((_g = (_f = (_e = metaData.amenities[val]) === null || _e === void 0 ? void 0 : _e.split(".")[0]) === null || _f === void 0 ? void 0 : _f.split("_")) === null || _g === void 0 ? void 0 : _g.join(" ")))) : null;
76
- }))))))));
35
+ const operatorPriorityIds = (_b = serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.operator_details) === null || _b === void 0 ? void 0 : _b[5];
36
+ const priorityIds = (operatorPriorityIds === null || operatorPriorityIds === void 0 ? void 0 : operatorPriorityIds.length) > 0
37
+ ? operatorPriorityIds
38
+ : DEFAULT_PRIORITY_IDS;
39
+ const amenities = [...serviceItem.operator_details[4]];
40
+ const { visible: visibleAmenities, plus: plusAmenities } = getAmenitySplit({
41
+ isPeru,
42
+ amenities,
43
+ priorityIds,
44
+ });
45
+ const shouldShowPlus = plusAmenities.length > 0;
46
+ const grayscaleClass = isSoldOut ? "grayscale" : "";
47
+ return (React.createElement("div", { className: "flex items-center gap-[6px]" }, visibleAmenities.map((val, key) => {
48
+ const raw = metaData.amenities[val];
49
+ if (isWater(raw))
50
+ return null;
51
+ const baseName = getAmenityBaseName(raw);
52
+ return (React.createElement("div", { key: key, className: "relative group cursor-pointer" },
53
+ React.createElement("div", { className: grayscaleClass },
54
+ React.createElement(SvgAmenities, { moreAnemities: false, name: baseName.toLowerCase() })),
55
+ React.createElement("div", { className: TOOLTIP_CLASS, style: {
56
+ backgroundColor: colors.tooltipColor,
57
+ zIndex: 21,
58
+ padding: "12px",
59
+ } },
60
+ React.createElement(TooltipArrow, { color: colors.tooltipColor }),
61
+ React.createElement("div", { className: "flex flex-col gap-[10px]" }, amenities.map((id, i) => {
62
+ const rawItem = metaData.amenities[id];
63
+ if (isWater(rawItem))
64
+ return null;
65
+ const name = getAmenityBaseName(rawItem);
66
+ return (React.createElement("div", { key: i, className: "flex items-center gap-[5px] text-xs whitespace-nowrap" },
67
+ React.createElement(SvgAmenities, { moreAnemities: true, name: name.toUpperCase(), color: "white" }),
68
+ getAmenityName(name.split("_").join(" "))));
69
+ })))));
70
+ })));
77
71
  };
78
72
  export default AmenitiesBlock;
@@ -0,0 +1,26 @@
1
+ import React from "react";
2
+ interface ItemEntry {
3
+ key: string;
4
+ render: React.ReactNode;
5
+ }
6
+ interface BottomAmenitiesProps {
7
+ otherItems: ItemEntry[];
8
+ serviceItem: {
9
+ id: string;
10
+ is_tracking_enabled?: boolean;
11
+ is_change_ticket?: boolean;
12
+ pet_seat_info?: Record<string, any>;
13
+ };
14
+ grayscaleClass: string;
15
+ isSoldOut: boolean;
16
+ isItemExpanded: boolean;
17
+ colors: Record<string, any>;
18
+ translation?: {
19
+ [key: string]: string;
20
+ };
21
+ getAnimationIcon: (icon: string) => any;
22
+ downArrowIcon?: React.ReactNode;
23
+ onToggleExpand: () => void;
24
+ }
25
+ declare function BottomAmenities({ otherItems, serviceItem, grayscaleClass, isSoldOut, isItemExpanded, colors, translation, getAnimationIcon, downArrowIcon, onToggleExpand, }: BottomAmenitiesProps): React.ReactElement;
26
+ export default BottomAmenities;
@@ -0,0 +1,22 @@
1
+ import React from "react";
2
+ import LottiePlayer from "../../assets/LottiePlayer";
3
+ import FlexibleBlock from "../FlexibleBlock";
4
+ import PetBlock from "../PetBlock";
5
+ function BottomAmenities({ otherItems, serviceItem, grayscaleClass, isSoldOut, isItemExpanded, colors, translation, getAnimationIcon, downArrowIcon, onToggleExpand, }) {
6
+ const hasPetInfo = serviceItem.pet_seat_info &&
7
+ Object.keys(serviceItem.pet_seat_info).length > 0;
8
+ const showDownArrow = ((serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.is_change_ticket) && serviceItem.pet_seat_info) ||
9
+ (serviceItem.pet_seat_info &&
10
+ Object.keys(serviceItem.pet_seat_info).length > 0);
11
+ return (React.createElement("div", { className: "flex items-center mt-[15px] border-t border-[#eee] pt-[6px]" },
12
+ React.createElement("div", { className: "grid items-center gap-[2%] flex-1 ", style: {
13
+ gridTemplateColumns: "18% 18% 23% 23%",
14
+ } }, otherItems.map((item) => (React.createElement("div", { key: item.key, className: "flex items-center" }, item.render)))),
15
+ React.createElement("div", { className: "flex items-center justify-end shrink-0 ml-[5px] w-[150px]" },
16
+ (serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.is_tracking_enabled) && (React.createElement("div", { className: grayscaleClass + " mr-[10px]" },
17
+ React.createElement(LottiePlayer, { animationData: getAnimationIcon("locationAnim"), width: "20px", height: "20px" }))),
18
+ serviceItem.is_change_ticket && (React.createElement(FlexibleBlock, { translation: translation, getAnimationIcon: getAnimationIcon, colors: colors, serviceItem: serviceItem, isSoldOut: isSoldOut })),
19
+ hasPetInfo && (React.createElement(PetBlock, { translation: translation, getAnimationIcon: getAnimationIcon, colors: colors, isSoldOut: isSoldOut })),
20
+ showDownArrow ? (React.createElement("div", { className: "flex items-center cursor-pointer ml-[4px] transition-transform duration-300 w-[14px] h-[14px]", onClick: onToggleExpand }, downArrowIcon)) : null)));
21
+ }
22
+ export default BottomAmenities;
@@ -1,7 +1,7 @@
1
1
  import React from "react";
2
- const DurationBlock = ({ serviceItem, translation, renderIcon, isSoldOut, colors, }) => (React.createElement("div", { className: "flex items-baseline relative whitespace-nowrap" },
2
+ const DurationBlock = ({ serviceItem, translation, renderIcon, isSoldOut, colors, }) => (React.createElement("div", { className: "flex items-baseline relative whitespace-nowrap " },
3
3
  React.createElement("div", { className: `w-[18px] mr-[4px] ${isSoldOut ? "grayscale" : ""}` }, renderIcon("hours", "14px")),
4
- React.createElement("div", { className: "group text-[13.33px]" },
4
+ React.createElement("div", { className: "group text-[13.33px] cursor-pointer" },
5
5
  serviceItem.duration,
6
6
  " ",
7
7
  translation.hours,
@@ -0,0 +1,19 @@
1
+ import React from "react";
2
+ interface ExpandedDropdownProps {
3
+ serviceItem: {
4
+ pet_seat_info?: Record<string, any>;
5
+ is_change_ticket?: boolean;
6
+ is_tracking_enabled?: boolean;
7
+ };
8
+ showPromo: boolean;
9
+ colors: {
10
+ priceColor?: string;
11
+ };
12
+ grayscaleClass: string;
13
+ translation?: {
14
+ [key: string]: string;
15
+ };
16
+ getAnimationIcon: (icon: string) => any;
17
+ }
18
+ declare function ExpandedDropdown({ serviceItem, showPromo, colors, grayscaleClass, translation, getAnimationIcon, }: ExpandedDropdownProps): React.ReactElement;
19
+ export default ExpandedDropdown;
@@ -0,0 +1,27 @@
1
+ import React from "react";
2
+ import LottiePlayer from "../../assets/LottiePlayer";
3
+ function ExpandedDropdown({ serviceItem, showPromo, colors, grayscaleClass, translation, getAnimationIcon, }) {
4
+ const hasPetInfo = serviceItem.pet_seat_info &&
5
+ Object.keys(serviceItem.pet_seat_info).length > 0;
6
+ return (React.createElement("div", { className: "px-[15px] pt-[26px] pb-[14px] -mt-[16px] pt-[20px] relative -z-9", style: {
7
+ backgroundColor: "#f5f5f5",
8
+ borderRadius: "0 0 10px 10px",
9
+ // border: showPromo ? `1px solid ${colors.priceColor}` : "1px solid #ccc",
10
+ border: `1px solid ${colors.priceColor}`,
11
+ borderTop: "none",
12
+ } },
13
+ React.createElement("div", { className: "flex flex-col gap-[12px] text-[13px] text-[#464647]" },
14
+ hasPetInfo && (React.createElement("div", { className: "flex items-center gap-[10px]" },
15
+ React.createElement(LottiePlayer, { animationData: getAnimationIcon("petFriendlyAnim"), width: "20px", height: "20px" }),
16
+ React.createElement("div", { className: "h-auto mr-[4px] text-[13px] text-[#464647] bold-text" },
17
+ React.createElement("span", null, translation === null || translation === void 0 ? void 0 : translation.petFriendly)))),
18
+ serviceItem.is_change_ticket && (React.createElement("div", { className: "flex items-center gap-[10px]" },
19
+ React.createElement(LottiePlayer, { animationData: getAnimationIcon("flexibleIcon"), width: "20px", height: "20px" }),
20
+ React.createElement("div", { className: "h-auto mr-[4px] text-[13px] text-[#464647] bold-text" },
21
+ React.createElement("span", null, translation === null || translation === void 0 ? void 0 : translation.flexible)))),
22
+ (serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.is_tracking_enabled) && (React.createElement("div", { className: `${grayscaleClass} flex items-center gap-[10px]` },
23
+ React.createElement(LottiePlayer, { animationData: getAnimationIcon("locationAnim"), width: "20px", height: "20px" }),
24
+ React.createElement("div", { className: "h-auto mr-[4px] text-[13px] text-[#464647] bold-text" },
25
+ React.createElement("span", null, "GPS Tracker")))))));
26
+ }
27
+ export default ExpandedDropdown;
@@ -3,16 +3,14 @@ import LottiePlayer from "../assets/LottiePlayer";
3
3
  const FlexibleBlock = ({ translation, getAnimationIcon, colors, serviceItem, isSoldOut, }) => {
4
4
  var _a;
5
5
  return (React.createElement("div", { className: "flex items-center" },
6
- React.createElement("div", { className: "relative group cursor-default" },
6
+ React.createElement("div", { className: "relative group cursor-pointer" },
7
7
  React.createElement("div", { className: "flex items-center" },
8
8
  React.createElement("div", { className: `mr-[5px] ${isSoldOut ? "grayscale" : ""}` },
9
9
  React.createElement(LottiePlayer
10
10
  // animationData={serviceItem.icons.flexibleAnim}
11
11
  , {
12
12
  // animationData={serviceItem.icons.flexibleAnim}
13
- animationData: getAnimationIcon("flexibleIcon"), width: "20px", height: "20px" })),
14
- React.createElement("div", { className: "h-auto mr-[4px] text-[13px] text-[#464647]" },
15
- React.createElement("span", null, translation === null || translation === void 0 ? void 0 : translation.flexible))),
13
+ animationData: getAnimationIcon("flexibleIcon"), width: "20px", height: "20px" }))),
16
14
  React.createElement("div", { className: "hidden group-hover:block absolute top-[24px] left-1/2 -translate-x-1/2 text-white p-3 rounded-[14px] whitespace-normal z-10 mt-2.5 w-[230px] text-center break-normal shadow-service text-[12px]", style: {
17
15
  backgroundColor: colors.tooltipColor,
18
16
  lineHeight: "1.5",
@@ -0,0 +1,12 @@
1
+ import React from "react";
2
+ interface KuposButtonProps {
3
+ isSoldOut: boolean;
4
+ isLoading: boolean;
5
+ buttonColor?: string;
6
+ buyLabel?: string;
7
+ soldOutLabel?: string;
8
+ soldOutIcon?: React.ReactNode;
9
+ onClick: () => void;
10
+ }
11
+ declare function KuposButton({ isSoldOut, isLoading, buttonColor, buyLabel, soldOutLabel, soldOutIcon, onClick, }: KuposButtonProps): React.ReactElement;
12
+ export default KuposButton;
@@ -0,0 +1,12 @@
1
+ import React from "react";
2
+ function KuposButton({ isSoldOut, isLoading, buttonColor, buyLabel, soldOutLabel, soldOutIcon, onClick, }) {
3
+ const isDisabled = isLoading || isSoldOut;
4
+ return (React.createElement("button", { onClick: () => (!isSoldOut ? onClick() : null), disabled: isLoading, className: "w-full py-[12px] text-[12px] font-bold text-white rounded-[14px] border-none px-[20px] flex items-center justify-center", style: {
5
+ backgroundColor: isDisabled ? "lightgray" : buttonColor,
6
+ cursor: isDisabled ? "not-allowed" : "pointer",
7
+ } },
8
+ React.createElement("span", { className: "min-w-[75px] flex justify-center items-center bold-text uppercase" },
9
+ isSoldOut ? soldOutIcon : null,
10
+ isLoading ? (React.createElement("span", { className: "loader-circle" })) : !isSoldOut ? (buyLabel) : (soldOutLabel))));
11
+ }
12
+ export default KuposButton;
@@ -8,9 +8,7 @@ const PetBlock = ({ translation, getAnimationIcon, colors, isSoldOut }) => (Reac
8
8
  // animationData={serviceItem.icons.petFriendlyAnim}
9
9
  , {
10
10
  // animationData={serviceItem.icons.petFriendlyAnim}
11
- animationData: getAnimationIcon("petFriendlyAnim"), width: "20px", height: "20px" })),
12
- React.createElement("div", { className: "h-auto mr-[4px] text-[13px] text-[#464647]" },
13
- React.createElement("span", null, translation === null || translation === void 0 ? void 0 : translation.petFriendly))),
11
+ animationData: getAnimationIcon("petFriendlyAnim"), width: "20px", height: "20px" }))),
14
12
  React.createElement("div", { className: " hidden group-hover:block absolute top-[24px] left-1/2 -translate-x-1/2 text-white p-3 rounded-[14px] whitespace-normal z-10 mt-2.5 w-[230px] text-center break-normal shadow-service", style: { backgroundColor: colors === null || colors === void 0 ? void 0 : colors.tooltipColor } },
15
13
  React.createElement("div", { className: "tooltip-arrow absolute text-[13.33px] -top-[7px] left-1/2 -translate-x-1/2 w-0 h-0 border-l-8 border-r-8 border-b-8 border-l-transparent border-r-transparent", style: { borderBottomColor: colors === null || colors === void 0 ? void 0 : colors.tooltipColor } }),
16
14
  "Este servicio incluye asientos para mascotas."))));
@@ -2,8 +2,12 @@ import React from "react";
2
2
  import RatingHover from "../components/ServiceItem/RatingHover";
3
3
  const RatingBlock = ({ showRating, serviceItem, isSoldOut, colors, t, translation, }) => (React.createElement("div", { className: "flex items-center whitespace-nowrap" },
4
4
  showRating && (React.createElement(RatingHover, { serviceItem: serviceItem, isSoldOut: isSoldOut, colors: colors, t: t, translation: translation })),
5
- React.createElement("span", { className: "ml-[10px] text-[13.33px]", style: {
5
+ React.createElement("div", { className: "group relative ml-[10px] text-[13.33px]", style: {
6
6
  marginLeft: showRating ? "10px" : "0",
7
7
  color: isSoldOut ? "#c0c0c0" : "#464647",
8
- } }, serviceItem.operator_details[2])));
8
+ } },
9
+ React.createElement("span", { className: "block max-w-[120px] overflow-hidden text-ellipsis whitespace-nowrap cursor-pointer" }, serviceItem.operator_details[2]),
10
+ React.createElement("div", { className: "hidden group-hover:block absolute top-[24px] left-1/2 -translate-x-1/2 text-white p-3 rounded-[14px] whitespace-nowrap z-10 mt-2.5 w-max text-center shadow-service text-[12px]", style: { backgroundColor: colors.tooltipColor } },
11
+ React.createElement("div", { className: "tooltip-arrow absolute -top-[7px] left-1/2 -translate-x-1/2 w-0 h-0 border-l-8 border-r-8 border-b-8 border-l-transparent border-r-transparent ", style: { borderBottomColor: colors.tooltipColor } }),
12
+ serviceItem.operator_details[2]))));
9
13
  export default RatingBlock;
@@ -0,0 +1,17 @@
1
+ import React from "react";
2
+ interface SeatType {
3
+ label: string;
4
+ fare: number;
5
+ key: any;
6
+ }
7
+ interface SeatSectionProps {
8
+ seatTypes: SeatType[];
9
+ availableSeats: number;
10
+ isSoldOut: boolean;
11
+ priceColor?: string;
12
+ currencySign?: string;
13
+ removeDuplicateSeats?: boolean;
14
+ isPeru?: boolean;
15
+ }
16
+ declare function SeatSection({ seatTypes, availableSeats, isSoldOut, priceColor, currencySign, removeDuplicateSeats, isPeru, }: SeatSectionProps): React.ReactElement;
17
+ export default SeatSection;
@@ -0,0 +1,92 @@
1
+ import React from "react";
2
+ import CommonService from "../../utils/CommonService";
3
+ const SEAT_EXCEPTIONS = ["Asiento mascota"];
4
+ function getAllSeatTypes(seatTypes) {
5
+ if (!(seatTypes === null || seatTypes === void 0 ? void 0 : seatTypes.length)) {
6
+ return [{ label: "Salon cama", price: 0 }];
7
+ }
8
+ let seatTypesWithPrices = seatTypes.filter(Boolean).map((val) => ({
9
+ label: val === null || val === void 0 ? void 0 : val.label,
10
+ price: val === null || val === void 0 ? void 0 : val.fare,
11
+ }));
12
+ seatTypesWithPrices.sort((a, b) => a.price - b.price);
13
+ return seatTypesWithPrices;
14
+ }
15
+ function getSortedSeatTypes(seatTypes) {
16
+ if (!(seatTypes === null || seatTypes === void 0 ? void 0 : seatTypes.length)) {
17
+ return [{ label: "Salon cama", price: 0 }];
18
+ }
19
+ let seatTypesWithPrices = getAllSeatTypes(seatTypes);
20
+ const premiumIndex = seatTypesWithPrices.findIndex((item) => item.label === "Premium");
21
+ if (premiumIndex >= 3) {
22
+ seatTypesWithPrices[2] = seatTypesWithPrices[premiumIndex];
23
+ }
24
+ seatTypesWithPrices = seatTypesWithPrices.slice(0, 2);
25
+ return seatTypesWithPrices;
26
+ }
27
+ function getUniqueSeats(seatTypes) {
28
+ const allSeatTypes = getAllSeatTypes(seatTypes);
29
+ const seatMap = new Map();
30
+ allSeatTypes.forEach((seat) => {
31
+ if (SEAT_EXCEPTIONS.includes(seat.label))
32
+ return;
33
+ // Only check if the label already exists in the map, don't compare prices
34
+ if (!seatMap.has(seat.label)) {
35
+ seatMap.set(seat.label, seat);
36
+ }
37
+ });
38
+ return Array.from(seatMap.values());
39
+ }
40
+ function getNumberOfSeats(seatTypes) {
41
+ return seatTypes.filter((val) => !SEAT_EXCEPTIONS.includes(val.label)).length;
42
+ }
43
+ function SeatSection({ seatTypes, availableSeats, isSoldOut, priceColor, currencySign, removeDuplicateSeats, isPeru, }) {
44
+ const uniqueSeats = getUniqueSeats(seatTypes);
45
+ const sortedSeatTypes = getSortedSeatTypes(seatTypes);
46
+ const numberOfSeats = getNumberOfSeats(seatTypes);
47
+ const isCentered = numberOfSeats < 2 || removeDuplicateSeats;
48
+ const formatPrice = (price) => availableSeats <= 0
49
+ ? CommonService.currency(0, currencySign)
50
+ : CommonService.currency(price, currencySign);
51
+ const renderSeatNames = () => {
52
+ const seats = removeDuplicateSeats ? uniqueSeats : sortedSeatTypes;
53
+ return seats.map((val, key) => SEAT_EXCEPTIONS.includes(val.label) ? null : (React.createElement("span", { key: key, className: `flex items-center justify-between text-[13.33px] ${isSoldOut ? "text-[#c0c0c0]" : ""}` }, typeof val.label === "string" || typeof val.label === "number"
54
+ ? removeDuplicateSeats && isPeru
55
+ ? CommonService.truncateSeatLabel(val.label)
56
+ : val.label
57
+ : null)));
58
+ };
59
+ const renderSeatPrices = () => {
60
+ if (removeDuplicateSeats) {
61
+ return uniqueSeats.map((val, key) => (React.createElement("span", { key: key }, formatPrice(val.price))));
62
+ }
63
+ return sortedSeatTypes.map((val, key) => SEAT_EXCEPTIONS.includes(val.label) ? null : (React.createElement("span", { key: key, className: "flex items-center text-[13.33px] bold-text" }, typeof val.price === "string" || typeof val.price === "number"
64
+ ? formatPrice(val.price)
65
+ : null)));
66
+ };
67
+ const renderLabels = () => {
68
+ if (isPeru) {
69
+ return (React.createElement(React.Fragment, null,
70
+ React.createElement("span", { className: "text-[13.33px]", style: { color: "#999" } }, "Antes"),
71
+ React.createElement("span", { className: "text-[13.33px]" }, "Desde")));
72
+ }
73
+ return renderSeatNames();
74
+ };
75
+ const strikethroughStyle = Object.assign({ color: "#ccc", display: "flex", textAlign: "end", textDecoration: "line-through" }, (isPeru
76
+ ? { position: "relative", top: 0 }
77
+ : { position: "absolute", top: isCentered ? "-10px" : "-18px" }));
78
+ return (React.createElement("div", { className: "relative flex gap-[10px] text-[13.33px] justify-between min-h-[2.5rem]", style: isCentered ? { alignItems: "center" } : {} },
79
+ React.createElement("div", { className: "flex flex-col justify-between", style: { gap: "10px" } }, renderLabels()),
80
+ React.createElement("div", { className: "flex flex-col justify-between absolute inset-y-0 right-0 left-1/2 h-full", style: {
81
+ color: isSoldOut ? "#c0c0c0" : priceColor,
82
+ top: 0,
83
+ bottom: 0,
84
+ left: "clamp(60%, 65% + (100vw - 1300px) * 0.1, 65%)",
85
+ right: 0,
86
+ justifyContent: isCentered ? "center" : "",
87
+ gap: "10px",
88
+ } },
89
+ React.createElement("span", { className: "text-[13.33px]", style: strikethroughStyle }, "$1.000"),
90
+ renderSeatPrices())));
91
+ }
92
+ export default SeatSection;
@@ -0,0 +1,12 @@
1
+ import React from "react";
2
+ interface TopAmenitiesProps {
3
+ showPromo: boolean;
4
+ showTopLabel: string | boolean;
5
+ isSoldOut: boolean;
6
+ priceColor?: string;
7
+ buttonColor?: string;
8
+ boardingIcon?: React.ReactNode;
9
+ getAnimationIcon: (icon: string) => any;
10
+ }
11
+ declare function TopAmenities({ showPromo, showTopLabel, isSoldOut, priceColor, buttonColor, boardingIcon, getAnimationIcon, }: TopAmenitiesProps): React.ReactElement;
12
+ export default TopAmenities;
@@ -0,0 +1,32 @@
1
+ import React from "react";
2
+ import LottiePlayer from "../../assets/LottiePlayer";
3
+ function TopAmenities({ showPromo, showTopLabel, isSoldOut, priceColor, buttonColor, boardingIcon, getAnimationIcon, }) {
4
+ return (React.createElement("div", { style: {
5
+ display: "flex",
6
+ justifyContent: "flex-end",
7
+ position: "relative",
8
+ zIndex: "-1",
9
+ } },
10
+ React.createElement("div", { style: {
11
+ backgroundColor: priceColor,
12
+ position: "relative",
13
+ right: showTopLabel ? "-21px" : "",
14
+ padding: "0 14px",
15
+ borderTopRightRadius: "10px",
16
+ borderTopLeftRadius: "10px",
17
+ } },
18
+ React.createElement("div", { style: { display: "flex", alignItems: "center" } },
19
+ React.createElement(LottiePlayer, { animationData: getAnimationIcon("bombAnimation"), width: "14px", height: "14px" }),
20
+ React.createElement("span", { className: "flex items-center py-[10px] pl-[6px] text-white text-[13.33px] z-20", style: { paddingRight: showTopLabel ? "18px" : "" } },
21
+ React.createElement("span", { className: "bold-text" }, "kuponazo 20%\u00A0"),
22
+ " | Termina en\u00A0",
23
+ React.createElement("span", { className: "bold-text" }, "02:10:30")))),
24
+ showTopLabel && (React.createElement("div", { className: "flex items-center py-[10px] px-[14px] text-[13.33px] z-20", style: {
25
+ backgroundColor: isSoldOut ? "#ddd" : buttonColor,
26
+ borderTopRightRadius: "10px",
27
+ borderTopLeftRadius: "10px",
28
+ } },
29
+ React.createElement(LottiePlayer, { animationData: getAnimationIcon("priorityStageAnim"), width: "14px", height: "14px" }),
30
+ React.createElement("div", { className: "text-white pl-[6px]" }, showTopLabel)))));
31
+ }
32
+ export default TopAmenities;
@@ -0,0 +1,23 @@
1
+ import React from "react";
2
+ interface BottomAmenitiesMobileProps {
3
+ isSoldOut: boolean;
4
+ amenitiesNodes: React.ReactNode;
5
+ hoursIcon: React.ReactNode;
6
+ duration: string;
7
+ isDirectTrip?: boolean;
8
+ directoColor?: string;
9
+ directoAnim?: any;
10
+ isChangeTicket?: boolean;
11
+ isPetSeat: boolean;
12
+ petSeatInfo?: Record<string, any>;
13
+ petFriendlyAnim?: any;
14
+ flexibleAnim?: any;
15
+ isTrackingEnabled?: boolean;
16
+ locationAnim?: any;
17
+ downArrowIcon?: string;
18
+ showDropdown: boolean;
19
+ setShowDropdown: (val: boolean) => void;
20
+ onDropdownToggle: () => void;
21
+ }
22
+ declare function BottomAmenitiesMobile({ isSoldOut, amenitiesNodes, hoursIcon, duration, isDirectTrip, directoColor, directoAnim, isChangeTicket, isPetSeat, petSeatInfo, petFriendlyAnim, flexibleAnim, isTrackingEnabled, locationAnim, downArrowIcon, showDropdown, setShowDropdown, onDropdownToggle, }: BottomAmenitiesMobileProps): React.ReactElement;
23
+ export default BottomAmenitiesMobile;
@@ -0,0 +1,37 @@
1
+ import React from "react";
2
+ import LottiePlayer from "../../assets/LottiePlayer";
3
+ function BottomAmenitiesMobile({ isSoldOut, amenitiesNodes, hoursIcon, duration, isDirectTrip, directoColor, directoAnim, isChangeTicket, isPetSeat, petSeatInfo, petFriendlyAnim, flexibleAnim, isTrackingEnabled, locationAnim, downArrowIcon, showDropdown, setShowDropdown, onDropdownToggle, }) {
4
+ return (React.createElement("div", { className: `${"flex justify-between items-center items-center "}` },
5
+ React.createElement("div", { className: "w-[55%] flex justify-between items-center" },
6
+ React.createElement("div", { style: { opacity: isSoldOut ? 0.5 : 1 } }, amenitiesNodes),
7
+ React.createElement("div", { className: "flex relative ", style: { color: isSoldOut ? "#bbb" : "text-[#464647]" } },
8
+ React.createElement("div", { className: `w-[12px] h-auto mr-[2px] ${isSoldOut ? "grayscale" : ""}` }, hoursIcon),
9
+ "\u00A0",
10
+ React.createElement("div", { className: `cursor-default group min-[420]:text-[13px] text-[12px] ${isSoldOut ? "text-[#c0c0c0]" : ""}`, style: { lineHeight: "normal" } },
11
+ duration,
12
+ "hrs")),
13
+ isDirectTrip && (React.createElement("div", { className: `flex items-center gap-[2px] text-white min-[420]:text-[12px] text-[10px] z-20 `, style: {
14
+ // backgroundColor: isSoldOut ? "#ddd" : colors.tooltipBgColor,
15
+ color: isSoldOut ? "#bbb" : directoColor,
16
+ } },
17
+ React.createElement(LottiePlayer, { animationData: directoAnim, width: "14px", height: "14px" }),
18
+ React.createElement("div", { className: "ml-[5px]" }, "Directo")))),
19
+ React.createElement("div", null, (isChangeTicket || isPetSeat) && (React.createElement("div", { onClick: onDropdownToggle, className: "flex items-center" },
20
+ petSeatInfo && Object.keys(petSeatInfo).length > 0 ? (React.createElement("div", { className: "flex items-center" },
21
+ React.createElement("div", { className: `relative group cursor-default ` },
22
+ React.createElement("div", { className: "flex items-center" },
23
+ React.createElement("div", { className: `mr-[5px] ${isSoldOut ? "grayscale" : ""}` },
24
+ React.createElement(LottiePlayer, { animationData: petFriendlyAnim, width: "16px", height: "16px" })))))) : null,
25
+ isChangeTicket && (React.createElement("div", { className: "flex items-center" },
26
+ React.createElement("div", { className: "relative group cursor-default" },
27
+ React.createElement("div", { className: "flex items-center" },
28
+ React.createElement("div", { className: `mr-[5px] ${isSoldOut ? "grayscale" : ""}` },
29
+ React.createElement(LottiePlayer, { animationData: flexibleAnim, width: "16px", height: "16px" })))))),
30
+ isTrackingEnabled && (React.createElement("div", { className: "flex items-center mr-[10px]" },
31
+ React.createElement("div", { className: `h-auto mr-[4px] min-[420]:text-[13px] text-[11px] text-[#464647] ${isSoldOut ? "grayscale" : ""}` },
32
+ React.createElement(LottiePlayer, { animationData: locationAnim, width: "16px", height: "16px" })))),
33
+ (isChangeTicket || isPetSeat) && (
34
+ // <img src={serviceItem.icons.plus} alt="icon" width={11} />
35
+ React.createElement("img", { src: downArrowIcon, alt: "icon", width: 14, height: 14 })))))));
36
+ }
37
+ export default BottomAmenitiesMobile;
@@ -0,0 +1,23 @@
1
+ import React from "react";
2
+ interface DateTimeSectionMobileProps {
3
+ onBookButtonPress: () => void;
4
+ isCiva: boolean;
5
+ isSoldOut: boolean;
6
+ isLinatal: boolean;
7
+ isPeru: boolean;
8
+ orignLabel?: React.ReactNode;
9
+ destinationLabel?: React.ReactNode;
10
+ originIcon?: string;
11
+ destinationIcon?: string;
12
+ travelDate: string;
13
+ arrivalDate: string;
14
+ depTime: string;
15
+ arrTime: string;
16
+ seatTypes: any[];
17
+ seatPriceColor: string;
18
+ currencySign: string;
19
+ availableSeats: number;
20
+ removeDuplicateSeats?: boolean;
21
+ }
22
+ declare function DateTimeSectionMobile({ onBookButtonPress, isCiva, isSoldOut, isLinatal, isPeru, orignLabel, destinationLabel, originIcon, destinationIcon, travelDate, arrivalDate, depTime, arrTime, seatTypes, seatPriceColor, currencySign, availableSeats, removeDuplicateSeats, }: DateTimeSectionMobileProps): React.ReactElement;
23
+ export default DateTimeSectionMobile;