kupos-ui-components-lib 9.1.1 → 9.1.2

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 (47) hide show
  1. package/README copy.md +223 -67
  2. package/dist/assets/images/anims/service_list/directo.json +1 -1
  3. package/dist/components/ServiceItem/PeruServiceItemDesktop.js +1 -1
  4. package/dist/components/ServiceItem/RatingHover.js +32 -33
  5. package/dist/components/ServiceItem/ServiceItemDesktop.d.ts +1 -1
  6. package/dist/components/ServiceItem/ServiceItemDesktop.js +147 -267
  7. package/dist/components/ServiceItem/ServiceItemMobile.d.ts +1 -1
  8. package/dist/components/ServiceItem/ServiceItemMobile.js +87 -278
  9. package/dist/components/ServiceItem/mobileTypes.d.ts +5 -0
  10. package/dist/components/ServiceItem/types.d.ts +7 -0
  11. package/dist/styles.css +131 -32
  12. package/dist/ui/AmenitiesBlock.js +23 -30
  13. package/dist/ui/BottomAmenities/BottomAmenities.js +0 -1
  14. package/dist/ui/DurationBlock.js +4 -4
  15. package/dist/ui/FlexibleBlock.js +5 -6
  16. package/dist/ui/PetBlock.js +1 -3
  17. package/dist/ui/RatingBlock.d.ts +9 -1
  18. package/dist/ui/RatingBlock.js +7 -3
  19. package/dist/utils/CommonService.d.ts +1 -1
  20. package/dist/utils/CommonService.js +2 -0
  21. package/package.json +2 -1
  22. package/src/assets/images/anims/service_list/bomb.json +1 -0
  23. package/src/assets/images/anims/service_list/directo.json +1 -1
  24. package/src/components/ServiceItem/PeruServiceItemDesktop.tsx +1 -0
  25. package/src/components/ServiceItem/RatingHover.tsx +44 -45
  26. package/src/components/ServiceItem/ServiceItemDesktop.tsx +313 -537
  27. package/src/components/ServiceItem/ServiceItemMobile.tsx +213 -530
  28. package/src/components/ServiceItem/mobileTypes.ts +5 -0
  29. package/src/components/ServiceItem/types.ts +7 -0
  30. package/src/ui/AmenitiesBlock.tsx +50 -29
  31. package/src/ui/BottomAmenities/BottomAmenities.tsx +110 -0
  32. package/src/ui/DateTimeSection/DateTimeSection.tsx +207 -0
  33. package/src/ui/DirectoBlock.tsx +31 -0
  34. package/src/ui/DurationBlock.tsx +4 -4
  35. package/src/ui/ExpendedDropDown/ExpandedDropdown.tsx +103 -0
  36. package/src/ui/FlexibleBlock.tsx +6 -5
  37. package/src/ui/KuposButton/KuposButton.tsx +48 -0
  38. package/src/ui/PetBlock.tsx +2 -2
  39. package/src/ui/RatingBlock.tsx +18 -6
  40. package/src/ui/SeatSection/SeatSection.tsx +207 -0
  41. package/src/ui/TopAmenities/TopAmenities.tsx +127 -0
  42. package/src/ui/mobileweb/BottomAmenitiesMobile.tsx +169 -0
  43. package/src/ui/mobileweb/DateTimeSectionMobile.tsx +192 -0
  44. package/src/ui/mobileweb/ExpandedDropdownMobile.tsx +56 -0
  45. package/src/ui/mobileweb/SeatSectionMobile.tsx +256 -0
  46. package/src/ui/mobileweb/TopAmenitieMobile.tsx +126 -0
  47. package/src/utils/CommonService.ts +2 -0
@@ -113,6 +113,9 @@ export interface MobileServiceItemProps {
113
113
  seatFallBackIcon: string;
114
114
  headPhoneIcon?: string;
115
115
  allowCancellationIcon?: string;
116
+ bombAnim?: string;
117
+ whiteBoardingIcon?: string;
118
+ downArrow?: string;
116
119
  [key: string]: string | Record<string, string | undefined> | undefined;
117
120
  };
118
121
  useLottieFor?: string[];
@@ -121,6 +124,8 @@ export interface MobileServiceItemProps {
121
124
  terminals?: any[];
122
125
  showDropdown?: boolean;
123
126
  setShowDropdown?: (value: boolean) => void;
127
+ isExpanded?: string | null;
128
+ setIsExpanded?: (value: string | null) => void;
124
129
  setAmenetiesAtomValue?: (
125
130
  value:
126
131
  | {
@@ -117,6 +117,9 @@ export interface ServiceItemProps {
117
117
  seatFallBackIcon: string;
118
118
  headPhoneIcon?: string;
119
119
  allowCancellationIcon?: string;
120
+ whiteBoardingIcon?: string
121
+ bombJson?:string
122
+ downArrow?:string
120
123
 
121
124
  [key: string]: string | Record<string, string | undefined> | undefined;
122
125
  };
@@ -192,7 +195,11 @@ export interface ServiceItemProps {
192
195
  petFriendlyAnim?: string;
193
196
  priorityStageAnim?: string;
194
197
  promoAnim?: string;
198
+ bombAnimation?: string;
195
199
  isPeru?: boolean;
196
200
  siteType?: "kupos" | "pullman" | "opsites" | "linatal";
197
201
  isAllinBus?: boolean;
202
+ isExpand?: any;
203
+ setIsExpand?: (value: any) => void;
204
+ coachKey?: number
198
205
  }
@@ -6,7 +6,9 @@ const DEFAULT_PRIORITY_IDS = ["2", "3", "13"];
6
6
  const TOOLTIP_CLASS =
7
7
  "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]";
8
8
 
9
- const getAmenityBaseName = (amenityStr) => amenityStr?.split(".")[0] ?? "";
9
+ const getAmenityBaseName = (amenityStr) => {
10
+ return amenityStr?.split(".")[0] ?? "";
11
+ };
10
12
 
11
13
  const isWater = (amenityStr) =>
12
14
  getAmenityBaseName(amenityStr)?.toUpperCase() === "WATER";
@@ -81,18 +83,7 @@ const AmenitiesBlock = ({
81
83
  const grayscaleClass = isSoldOut ? "grayscale" : "";
82
84
 
83
85
  return (
84
- <div className="flex items-center gap-[6px]">
85
- {/* GPS */}
86
- {serviceItem?.is_tracking_enabled && (
87
- <div className={grayscaleClass}>
88
- <LottiePlayer
89
- animationData={getAnimationIcon("locationAnim")}
90
- width="20px"
91
- height="20px"
92
- />
93
- </div>
94
- )}
95
-
86
+ <div className="relative flex items-center gap-[6px] group cursor-pointer">
96
87
  {/* AMENITIES */}
97
88
  {visibleAmenities.map((val, key) => {
98
89
  const raw = metaData.amenities[val];
@@ -100,32 +91,51 @@ const AmenitiesBlock = ({
100
91
  const baseName = getAmenityBaseName(raw);
101
92
 
102
93
  return (
103
- <div key={key} className="relative group cursor-pointer">
94
+ <div key={key}>
104
95
  <div className={grayscaleClass}>
105
96
  <SvgAmenities
106
97
  moreAnemities={false}
107
98
  name={baseName.toLowerCase()}
108
99
  />
109
100
  </div>
110
-
111
- {/* Tooltip */}
112
- <div
113
- className={TOOLTIP_CLASS}
114
- style={{
115
- backgroundColor: colors.tooltipColor,
116
- zIndex: 21,
117
- padding: "12px",
118
- }}
119
- >
120
- <TooltipArrow color={colors.tooltipColor} />
121
- {getAmenityName(baseName.split("_").join(" "))}
122
- </div>
123
101
  </div>
124
102
  );
125
103
  })}
126
104
 
105
+ {/* Tooltip – show ALL amenities on container hover */}
106
+ <div
107
+ className={TOOLTIP_CLASS}
108
+ style={{
109
+ backgroundColor: colors.bottomStripColor,
110
+ zIndex: 21,
111
+ padding: "12px",
112
+ }}
113
+ >
114
+ <TooltipArrow color={colors.tooltipColor} />
115
+ <div className="flex flex-col gap-[10px]">
116
+ {amenities.map((id, i) => {
117
+ const rawItem = metaData.amenities[id];
118
+ if (isWater(rawItem)) return null;
119
+ const name = getAmenityBaseName(rawItem);
120
+ return (
121
+ <div
122
+ key={i}
123
+ className="flex items-center gap-[5px] text-xs whitespace-nowrap"
124
+ >
125
+ <SvgAmenities
126
+ moreAnemities={true}
127
+ name={name.toUpperCase()}
128
+ color="white"
129
+ />
130
+ {getAmenityName(name.split("_").join(" "))}
131
+ </div>
132
+ );
133
+ })}
134
+ </div>
135
+ </div>
136
+
127
137
  {/* PLUS ICON */}
128
- {shouldShowPlus && (
138
+ {/* {shouldShowPlus && (
129
139
  <div className="relative ml-1 cursor-pointer">
130
140
  <div className="group">
131
141
  <img
@@ -167,7 +177,18 @@ const AmenitiesBlock = ({
167
177
  </div>
168
178
  </div>
169
179
  </div>
170
- )}
180
+ )} */}
181
+
182
+ {/* GPS */}
183
+ {/* {serviceItem?.is_tracking_enabled && (
184
+ <div className={grayscaleClass}>
185
+ <LottiePlayer
186
+ animationData={getAnimationIcon("locationAnim")}
187
+ width="20px"
188
+ height="20px"
189
+ />
190
+ </div>
191
+ )} */}
171
192
  </div>
172
193
  );
173
194
  };
@@ -0,0 +1,110 @@
1
+ import React from "react";
2
+ import LottiePlayer from "../../assets/LottiePlayer";
3
+ import FlexibleBlock from "../FlexibleBlock";
4
+ import PetBlock from "../PetBlock";
5
+
6
+ interface ItemEntry {
7
+ key: string;
8
+ render: React.ReactNode;
9
+ }
10
+
11
+ interface BottomAmenitiesProps {
12
+ otherItems: ItemEntry[];
13
+ serviceItem: {
14
+ id: string;
15
+ is_tracking_enabled?: boolean;
16
+ is_change_ticket?: boolean;
17
+ pet_seat_info?: Record<string, any>;
18
+ };
19
+ grayscaleClass: string;
20
+ isSoldOut: boolean;
21
+ isItemExpanded: boolean;
22
+ colors: Record<string, any>;
23
+ translation?: { [key: string]: string };
24
+ getAnimationIcon: (icon: string) => any;
25
+ downArrowIcon?: React.ReactNode;
26
+ onToggleExpand: () => void;
27
+ }
28
+
29
+ function BottomAmenities({
30
+ otherItems,
31
+ serviceItem,
32
+ grayscaleClass,
33
+ isSoldOut,
34
+ isItemExpanded,
35
+ colors,
36
+ translation,
37
+ getAnimationIcon,
38
+ downArrowIcon,
39
+ onToggleExpand,
40
+ }: BottomAmenitiesProps): React.ReactElement {
41
+ const hasPetInfo =
42
+ serviceItem.pet_seat_info &&
43
+ Object.keys(serviceItem.pet_seat_info).length > 0;
44
+
45
+ const showDownArrow =
46
+ (serviceItem?.is_change_ticket && serviceItem.pet_seat_info) ||
47
+ (serviceItem.pet_seat_info &&
48
+ Object.keys(serviceItem.pet_seat_info).length > 0);
49
+
50
+ return (
51
+ <div className="flex items-center mt-[15px] border-t border-[#eee] pt-[6px]">
52
+ {/* OTHER ITEMS (GRID) */}
53
+ <div
54
+ className="grid items-center gap-[2%] flex-1 "
55
+ style={{
56
+ // gridTemplateColumns: " 28% 21% 23% 23%",
57
+ gridTemplateColumns: "28% 17% 23% 23%",
58
+ }}
59
+ >
60
+ {otherItems.map((item) => (
61
+ <div key={item.key} className="flex items-center">
62
+ {item.render}
63
+ </div>
64
+ ))}
65
+ </div>
66
+
67
+ {/* PET + FLEXIBLE (always visible) */}
68
+ <div className="flex items-center justify-end shrink-0 ml-[5px] w-[150px]">
69
+ {serviceItem?.is_tracking_enabled && (
70
+ <div className={grayscaleClass + " mr-[10px]"}>
71
+ <LottiePlayer
72
+ animationData={getAnimationIcon("locationAnim")}
73
+ width="20px"
74
+ height="20px"
75
+ />
76
+ </div>
77
+ )}
78
+ {serviceItem.is_change_ticket && (
79
+ <FlexibleBlock
80
+ translation={translation}
81
+ getAnimationIcon={getAnimationIcon}
82
+ colors={colors}
83
+ serviceItem={serviceItem}
84
+ isSoldOut={isSoldOut}
85
+ />
86
+ )}
87
+ {hasPetInfo && (
88
+ <PetBlock
89
+ translation={translation}
90
+ getAnimationIcon={getAnimationIcon}
91
+ colors={colors}
92
+ isSoldOut={isSoldOut}
93
+ />
94
+ )}
95
+
96
+ {/* DOWN ARROW ICON */}
97
+ {/* {showDownArrow ? ( */}
98
+ <div
99
+ className={`flex items-center cursor-pointer ml-[4px] transition-transform duration-300 w-[14px] h-[14px] ${isItemExpanded ? "rotate-180" : ""}`}
100
+ onClick={onToggleExpand}
101
+ >
102
+ {downArrowIcon}
103
+ </div>
104
+ {/* ) : null} */}
105
+ </div>
106
+ </div>
107
+ );
108
+ }
109
+
110
+ export default BottomAmenities;
@@ -0,0 +1,207 @@
1
+ import React from "react";
2
+ import DateService from "../../utils/DateService";
3
+ import StageTooltip from "../StagesTooltip";
4
+
5
+ interface DateTimeSectionProps {
6
+ serviceItem: {
7
+ icons?: { origin?: string; destination?: string; [key: string]: any };
8
+ boarding_stages?: string;
9
+ dropoff_stages?: string;
10
+ travel_date: string;
11
+ arrival_date: string;
12
+ dep_time: string;
13
+ arr_time: string;
14
+ [key: string]: any;
15
+ };
16
+ isSoldOut: boolean;
17
+ isCiva?: boolean;
18
+ isLinatal?: boolean;
19
+ removeArrivalTime?: boolean;
20
+ orignLabel?: string;
21
+ destinationLabel?: string;
22
+ busStage?: Record<string, string>;
23
+ metaData?: any;
24
+ colors: Record<string, any>;
25
+ }
26
+
27
+ function DateTimeSection({
28
+ serviceItem,
29
+ isSoldOut,
30
+ isCiva,
31
+ isLinatal,
32
+ removeArrivalTime,
33
+ orignLabel,
34
+ destinationLabel,
35
+ busStage,
36
+ metaData,
37
+ colors,
38
+ }: DateTimeSectionProps): React.ReactElement {
39
+ const depTime = serviceItem.dep_time || "";
40
+ const hasAM = depTime.includes("AM");
41
+ const hasPM = depTime.includes("PM");
42
+
43
+ const convertTo24Hour = (depTime: string): string => {
44
+ const hasAM = depTime.includes("AM");
45
+ const hasPM = depTime.includes("PM");
46
+ const [timePart] = depTime.split(/AM|PM/).map((part) => part.trim());
47
+ const [hour, minute] = timePart.split(":").map(Number);
48
+ const pad = (n: number) => (n < 10 ? "0" + n : String(n));
49
+
50
+ if (hasAM) {
51
+ return `${pad(hour === 12 ? 0 : hour)}:${pad(minute)}`;
52
+ }
53
+ if (hasPM) {
54
+ return `${hour === 12 ? hour : hour + 12}:${pad(minute)}`;
55
+ }
56
+ return timePart;
57
+ };
58
+
59
+ const cleanedDepTime = convertTo24Hour(depTime);
60
+
61
+ return (
62
+ <div
63
+ className={`min-h-[2.2rem] grid grid-cols-[26px_auto_26%_1fr] gap-x-4 items-center text-[13.33px] ${
64
+ isSoldOut ? "text-[#c0c0c0]" : ""
65
+ }`}
66
+ style={{
67
+ gridTemplateRows: "1fr",
68
+ }}
69
+ >
70
+ {/* ICONS COLUMN */}
71
+ <div className="flex flex-col gap-[4px]">
72
+ {/* Origin Icon */}
73
+ {orignLabel ? (
74
+ <div className="w-[60px] h-[20px] flex items-center">
75
+ {orignLabel}
76
+ </div>
77
+ ) : (
78
+ <div className="h-[20px] flex items-center">
79
+ <img
80
+ src={serviceItem.icons?.origin}
81
+ alt="origin"
82
+ className={`w-[16px] h-auto mr-[8px] ${
83
+ isSoldOut ? "grayscale" : ""
84
+ }`}
85
+ />
86
+ </div>
87
+ )}
88
+
89
+ {/* Destination Icon */}
90
+ {!isCiva &&
91
+ (destinationLabel ? (
92
+ <div className="w-[60px] h-[20px] flex items-center">
93
+ {destinationLabel}
94
+ </div>
95
+ ) : (
96
+ <div className="h-[20px] flex items-center">
97
+ <img
98
+ src={serviceItem.icons?.destination}
99
+ className={`w-[16px] h-auto mr-[8px] ${
100
+ isSoldOut ? "grayscale" : ""
101
+ }`}
102
+ style={{ opacity: isSoldOut ? 0.5 : 1 }}
103
+ />
104
+ </div>
105
+ ))}
106
+ </div>
107
+
108
+ {/* DATES COLUMN */}
109
+ <div className="flex flex-col gap-[4px]">
110
+ {/* Departure Date */}
111
+ <StageTooltip
112
+ stageData={serviceItem.boarding_stages}
113
+ direction={1}
114
+ terminals={busStage}
115
+ serviceItem={serviceItem}
116
+ metaData={metaData}
117
+ colors={colors}
118
+ >
119
+ <span className="cursor-pointer bold-text capitalize">
120
+ {DateService.getServiceItemDate(serviceItem.travel_date)}
121
+ </span>
122
+ </StageTooltip>
123
+
124
+ {/* Arrival Date */}
125
+ {!isCiva && (
126
+ <StageTooltip
127
+ stageData={serviceItem.boarding_stages}
128
+ direction={1}
129
+ terminals={busStage}
130
+ serviceItem={serviceItem}
131
+ metaData={metaData}
132
+ colors={colors}
133
+ >
134
+ <span className="cursor-pointer bold-text capitalize">
135
+ {DateService.getServiceItemDate(serviceItem.arrival_date)}
136
+ </span>
137
+ </StageTooltip>
138
+ )}
139
+ </div>
140
+
141
+ {/* DOTS COLUMN */}
142
+ <div className="flex flex-col gap-[4px] items-center">
143
+ {/* Departure Dot */}
144
+ <div className="h-[20px] flex items-center justify-center">
145
+ <div>•</div>
146
+ </div>
147
+
148
+ {/* Arrival Dot */}
149
+ {!isCiva && (
150
+ <div className="h-[20px] flex items-center justify-center">
151
+ {removeArrivalTime ? null : serviceItem.arr_time ? (
152
+ <div>•</div>
153
+ ) : null}
154
+ </div>
155
+ )}
156
+ </div>
157
+
158
+ {/* TIMES COLUMN */}
159
+ <div className="flex flex-col gap-[4px]">
160
+ {/* Departure Time */}
161
+ <StageTooltip
162
+ stageData={serviceItem.dropoff_stages}
163
+ direction={2}
164
+ terminals={busStage}
165
+ serviceItem={serviceItem}
166
+ metaData={metaData}
167
+ colors={colors}
168
+ >
169
+ <div className="font-[900] bold-text">
170
+ {isLinatal ? (
171
+ <>
172
+ {cleanedDepTime} <span>{hasPM ? "PM" : hasAM ? "AM" : ""}</span>
173
+ {!serviceItem?.dep_time.includes("AM") &&
174
+ !serviceItem?.dep_time.includes("PM") &&
175
+ DateService.ampmOnly(serviceItem.dep_time)}
176
+ </>
177
+ ) : (
178
+ DateService.formatTime(serviceItem.dep_time)
179
+ )}
180
+ </div>
181
+ </StageTooltip>
182
+
183
+ {/* Arrival Time */}
184
+ {!isCiva && (
185
+ <StageTooltip
186
+ stageData={serviceItem.dropoff_stages}
187
+ direction={2}
188
+ terminals={busStage}
189
+ serviceItem={serviceItem}
190
+ metaData={metaData}
191
+ colors={colors}
192
+ >
193
+ <div className="font-[900] bold-text">
194
+ {removeArrivalTime
195
+ ? "\u00A0"
196
+ : serviceItem.arr_time
197
+ ? DateService.formatTime(serviceItem.arr_time)
198
+ : "\u00A0"}
199
+ </div>
200
+ </StageTooltip>
201
+ )}
202
+ </div>
203
+ </div>
204
+ );
205
+ }
206
+
207
+ export default DateTimeSection;
@@ -0,0 +1,31 @@
1
+ import React from "react";
2
+ import LottiePlayer from "../assets/LottiePlayer";
3
+
4
+ const DirectoBlock = ({ translation, isSoldOut, colors, getAnimationIcon }) => (
5
+ <div className="flex items-center relative whitespace-nowrap mt-[3px]">
6
+ <div className={`w-[18px] mr-[4px] ${isSoldOut ? "grayscale" : ""}`}>
7
+ <LottiePlayer
8
+ animationData={getAnimationIcon("directoAnim")}
9
+ width="14px"
10
+ height="14px"
11
+ />
12
+ </div>
13
+
14
+ <div className="group text-[13.33px] cursor-pointer">
15
+ {translation?.directService}
16
+ <div
17
+ className="hidden group-hover:block absolute top-[24px] left-1/2 -translate-x-1/2 text-white p-3 rounded-[14px] whitespace-nowrap w-fit z-10 mt-2.5 text-center shadow-service text-[12px]"
18
+ style={{ backgroundColor: colors.bottomStripColor }}
19
+ >
20
+ {/* Tooltip arrow */}
21
+ <div
22
+ 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"
23
+ style={{ borderBottomColor: colors.bottomStripColor }}
24
+ ></div>
25
+ {translation?.directServiceText}
26
+ </div>
27
+ </div>
28
+ </div>
29
+ );
30
+
31
+ export default DirectoBlock;
@@ -7,21 +7,21 @@ const DurationBlock = ({
7
7
  isSoldOut,
8
8
  colors,
9
9
  }) => (
10
- <div className="flex items-baseline relative whitespace-nowrap">
10
+ <div className="flex items-baseline relative whitespace-nowrap ">
11
11
  <div className={`w-[18px] mr-[4px] ${isSoldOut ? "grayscale" : ""}`}>
12
12
  {renderIcon("hours", "14px")}
13
13
  </div>
14
14
 
15
- <div className="group text-[13.33px]">
15
+ <div className="group text-[13.33px] cursor-pointer">
16
16
  {serviceItem.duration} {translation.hours}
17
17
  <div
18
18
  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-[188px] text-center break-normal shadow-service text-[12px]"
19
- style={{ backgroundColor: colors.tooltipColor }}
19
+ style={{ backgroundColor: colors.bottomStripColor }}
20
20
  >
21
21
  {/* Tooltip arrow */}
22
22
  <div
23
23
  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"
24
- style={{ borderBottomColor: colors.tooltipColor }}
24
+ style={{ borderBottomColor: colors.bottomStripColor }}
25
25
  ></div>
26
26
  Duración estimada del viaje
27
27
  </div>
@@ -0,0 +1,103 @@
1
+ import React from "react";
2
+ import LottiePlayer from "../../assets/LottiePlayer";
3
+
4
+ interface ExpandedDropdownProps {
5
+ serviceItem: {
6
+ change_ticket_hours?: number;
7
+ pet_seat_info?: Record<string, any>;
8
+ is_change_ticket?: boolean;
9
+ is_tracking_enabled?: boolean;
10
+ };
11
+ }
12
+
13
+ function ExpandedDropdown({
14
+ serviceItem,
15
+ }: ExpandedDropdownProps): React.ReactElement {
16
+ const hasPetInfo =
17
+ serviceItem.pet_seat_info &&
18
+ Object.keys(serviceItem.pet_seat_info).length > 0;
19
+
20
+ return (
21
+ <div
22
+ className="px-[15px] pt-[26px] pb-[14px] -mt-[16px] pt-[35px] relative -z-9"
23
+ style={{
24
+ backgroundColor: "#ffefef",
25
+ borderRadius: "0 0 10px 10px",
26
+ // border: showPromo ? `1px solid ${colors.priceColor}` : "1px solid #ccc",
27
+ // border: `1px solid ${colors.priceColor}`,
28
+
29
+ // borderTop: "none",
30
+ }}
31
+ >
32
+ {/* <div className="flex flex-col gap-[12px] text-[13px] text-[#464647]">
33
+ {hasPetInfo && (
34
+ <div className="flex items-center gap-[10px]">
35
+ <LottiePlayer
36
+ animationData={getAnimationIcon("petFriendlyAnim")}
37
+ width="20px"
38
+ height="20px"
39
+ />
40
+ <div className="h-auto mr-[4px] text-[13px] text-[#464647] bold-text">
41
+ <span>{translation?.petFriendly}</span>
42
+ </div>
43
+ </div>
44
+ )}
45
+ {serviceItem.is_change_ticket && (
46
+ <div className="flex items-center gap-[10px]">
47
+ <LottiePlayer
48
+ animationData={getAnimationIcon("flexibleIcon")}
49
+ width="20px"
50
+ height="20px"
51
+ />
52
+ <div className="h-auto mr-[4px] text-[13px] text-[#464647] bold-text">
53
+ <span>{translation?.flexible}</span>
54
+ </div>
55
+ </div>
56
+ )}
57
+ {serviceItem?.is_tracking_enabled && (
58
+ <div className={`${grayscaleClass} flex items-center gap-[10px]`}>
59
+ <LottiePlayer
60
+ animationData={getAnimationIcon("locationAnim")}
61
+ width="20px"
62
+ height="20px"
63
+ />
64
+ <div className="h-auto mr-[4px] text-[13px] text-[#464647] bold-text">
65
+ <span>{"GPS Tracker"}</span>
66
+ </div>
67
+ </div>
68
+ )}
69
+ </div> */}
70
+ <div
71
+ className="flex flex-col gap-[10px] text-[13px] text-[#464647]"
72
+ style={{ lineHeight: 1.6 }}
73
+ >
74
+ <div className="flex gap-[8px] text-[13.33px]">
75
+ <span style={{ marginTop: "2px" }}>•</span>
76
+ <span>
77
+ <span className="bold-text">Políticas de anulación:</span> Tu pasaje
78
+ puede ser anulado de forma online{" "}
79
+ <span className="bold-text">
80
+ hasta {serviceItem?.change_ticket_hours ?? 6} horas antes
81
+ </span>{" "}
82
+ de la salida del bus. Al anular tu pasaje recibirás una devolución
83
+ del 85% del monto de tu compra.
84
+ </span>
85
+ </div>
86
+ <div className="flex gap-[8px]">
87
+ <span style={{ marginTop: "2px" }}>•</span>
88
+ <span>
89
+ <span className="bold-text">Políticas de cambios:</span> Tu pasaje
90
+ puede ser cambiado de manera online{" "}
91
+ <span className="bold-text">
92
+ hasta {serviceItem?.change_ticket_hours ?? 6} horas antes
93
+ </span>{" "}
94
+ de la salida del bus. El monto será reembolsado a tu billetera
95
+ kupospay.
96
+ </span>
97
+ </div>
98
+ </div>
99
+ </div>
100
+ );
101
+ }
102
+
103
+ export default ExpandedDropdown;
@@ -9,7 +9,7 @@ const FlexibleBlock = ({
9
9
  isSoldOut,
10
10
  }) => (
11
11
  <div className="flex items-center">
12
- <div className="relative group cursor-default">
12
+ <div className="relative group cursor-pointer">
13
13
  <div className="flex items-center">
14
14
  <div className={`mr-[5px] ${isSoldOut ? "grayscale" : ""}`}>
15
15
  <LottiePlayer
@@ -19,21 +19,22 @@ const FlexibleBlock = ({
19
19
  height="20px"
20
20
  />
21
21
  </div>
22
- <div className="h-auto mr-[4px] text-[13px] text-[#464647]">
22
+ {/* <div className="h-auto mr-[4px] text-[13px] text-[#464647]">
23
23
  <span>{translation?.flexible}</span>
24
- </div>
24
+ </div> */}
25
25
  </div>
26
26
  <div
27
27
  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]"
28
28
  style={{
29
- backgroundColor: colors.tooltipColor,
29
+ backgroundColor: colors.bottomStripColor,
30
30
  lineHeight: "1.5",
31
+ zIndex: "1000",
31
32
  }}
32
33
  >
33
34
  {/* Tooltip arrow */}
34
35
  <div
35
36
  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 "
36
- style={{ borderBottomColor: colors.tooltipColor }}
37
+ style={{ borderBottomColor: colors.bottomStripColor }}
37
38
  ></div>
38
39
  Esta empresa permite cambios sin costo hasta (
39
40
  {serviceItem?.change_ticket_hours ?? 6}) horas antes del viaje.