kupos-ui-components-lib 9.1.2 → 9.1.4
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/README copy.md +67 -223
- package/dist/assets/images/anims/service_list/directo.json +1 -1
- package/dist/components/FilterBar/FilterBarDesktop.d.ts +1 -1
- package/dist/components/FilterBar/FilterBarDesktop.js +38 -3
- package/dist/components/FilterBar/tyoes.d.ts +1 -0
- package/dist/components/ServiceItem/PeruServiceItemDesktop.js +1 -1
- package/dist/components/ServiceItem/RatingHover.js +33 -32
- package/dist/components/ServiceItem/ServiceItemDesktop.d.ts +1 -1
- package/dist/components/ServiceItem/ServiceItemDesktop.js +267 -147
- package/dist/components/ServiceItem/ServiceItemMobile.d.ts +1 -1
- package/dist/components/ServiceItem/ServiceItemMobile.js +278 -87
- package/dist/components/ServiceItem/mobileTypes.d.ts +0 -5
- package/dist/components/ServiceItem/types.d.ts +0 -7
- package/dist/styles.css +32 -131
- package/dist/ui/AmenitiesBlock.js +30 -23
- package/dist/ui/DurationBlock.js +4 -4
- package/dist/ui/FlexibleBlock.js +6 -5
- package/dist/ui/PetBlock.js +3 -1
- package/dist/ui/RatingBlock.d.ts +1 -9
- package/dist/ui/RatingBlock.js +3 -7
- package/dist/utils/CommonService.d.ts +1 -1
- package/dist/utils/CommonService.js +0 -2
- package/package.json +1 -2
- package/src/assets/images/anims/service_list/directo.json +1 -1
- package/src/components/FilterBar/FilterBarDesktop.tsx +46 -3
- package/src/components/FilterBar/tyoes.ts +1 -0
- package/src/components/ServiceItem/PeruServiceItemDesktop.tsx +0 -1
- package/src/components/ServiceItem/RatingHover.tsx +45 -44
- package/src/components/ServiceItem/ServiceItemDesktop.tsx +537 -313
- package/src/components/ServiceItem/ServiceItemMobile.tsx +530 -213
- package/src/components/ServiceItem/mobileTypes.ts +0 -5
- package/src/components/ServiceItem/types.ts +0 -7
- package/src/ui/AmenitiesBlock.tsx +29 -50
- package/src/ui/DurationBlock.tsx +4 -4
- package/src/ui/FlexibleBlock.tsx +5 -6
- package/src/ui/PetBlock.tsx +2 -2
- package/src/ui/RatingBlock.tsx +6 -18
- package/src/utils/CommonService.ts +0 -2
- package/src/assets/images/anims/service_list/bomb.json +0 -1
- package/src/ui/BottomAmenities/BottomAmenities.tsx +0 -110
- package/src/ui/DateTimeSection/DateTimeSection.tsx +0 -207
- package/src/ui/DirectoBlock.tsx +0 -31
- package/src/ui/ExpendedDropDown/ExpandedDropdown.tsx +0 -103
- package/src/ui/KuposButton/KuposButton.tsx +0 -48
- package/src/ui/SeatSection/SeatSection.tsx +0 -207
- package/src/ui/TopAmenities/TopAmenities.tsx +0 -127
- package/src/ui/mobileweb/BottomAmenitiesMobile.tsx +0 -169
- package/src/ui/mobileweb/DateTimeSectionMobile.tsx +0 -192
- package/src/ui/mobileweb/ExpandedDropdownMobile.tsx +0 -56
- package/src/ui/mobileweb/SeatSectionMobile.tsx +0 -256
- package/src/ui/mobileweb/TopAmenitieMobile.tsx +0 -126
|
@@ -1,256 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import commonService from "../../utils/CommonService";
|
|
3
|
-
|
|
4
|
-
const EXCEPTIONS = [
|
|
5
|
-
"gy",
|
|
6
|
-
".gy",
|
|
7
|
-
"GY",
|
|
8
|
-
".GY",
|
|
9
|
-
"Gy",
|
|
10
|
-
".Gy",
|
|
11
|
-
"BLANCO",
|
|
12
|
-
"blanco",
|
|
13
|
-
"asiento_mascota",
|
|
14
|
-
];
|
|
15
|
-
|
|
16
|
-
interface SeatType {
|
|
17
|
-
label: string;
|
|
18
|
-
key?: string;
|
|
19
|
-
fare: number;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
interface SeatSectionMobileProps {
|
|
23
|
-
seatTypes: SeatType[];
|
|
24
|
-
isSoldOut: boolean;
|
|
25
|
-
isPeru: boolean;
|
|
26
|
-
seatPriceColor: string;
|
|
27
|
-
currencySign: string;
|
|
28
|
-
availableSeats: number;
|
|
29
|
-
removeDuplicateSeats?: boolean;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
interface SeatRowProps {
|
|
33
|
-
type: SeatType;
|
|
34
|
-
index: number;
|
|
35
|
-
displayLabel: string;
|
|
36
|
-
fare: string;
|
|
37
|
-
isSoldOut: boolean;
|
|
38
|
-
seatPriceColor: string;
|
|
39
|
-
hasMultipleTypes: boolean;
|
|
40
|
-
textSize: string;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
const SeatRow: React.FC<SeatRowProps> = ({
|
|
44
|
-
type,
|
|
45
|
-
index,
|
|
46
|
-
displayLabel,
|
|
47
|
-
fare,
|
|
48
|
-
isSoldOut,
|
|
49
|
-
seatPriceColor,
|
|
50
|
-
hasMultipleTypes,
|
|
51
|
-
textSize,
|
|
52
|
-
}) => {
|
|
53
|
-
if (EXCEPTIONS.includes(type.label)) return null;
|
|
54
|
-
|
|
55
|
-
const rowClass = hasMultipleTypes
|
|
56
|
-
? "w-[100%] flex flex-row justify-between "
|
|
57
|
-
: "w-[100%] flex flex-row justify-between items-center";
|
|
58
|
-
|
|
59
|
-
const labelColor = isSoldOut ? "#bbb" : "#464647";
|
|
60
|
-
const priceColor = isSoldOut ? "#bbb" : seatPriceColor;
|
|
61
|
-
|
|
62
|
-
return (
|
|
63
|
-
<div className={rowClass} key={index}>
|
|
64
|
-
<span
|
|
65
|
-
className={`min-[420]:text-[13px] ${textSize} `}
|
|
66
|
-
style={{ color: labelColor }}
|
|
67
|
-
>
|
|
68
|
-
{displayLabel}
|
|
69
|
-
</span>
|
|
70
|
-
<span
|
|
71
|
-
className={`min-[420]:text-[13px] ${textSize} bold-text`}
|
|
72
|
-
style={{ color: priceColor }}
|
|
73
|
-
>
|
|
74
|
-
{fare}
|
|
75
|
-
</span>
|
|
76
|
-
</div>
|
|
77
|
-
);
|
|
78
|
-
};
|
|
79
|
-
|
|
80
|
-
const getFilteredSeats = (item: string) => {
|
|
81
|
-
return item;
|
|
82
|
-
};
|
|
83
|
-
|
|
84
|
-
const getUniqueSeats = (data: SeatType[], limit: number): SeatType[] => {
|
|
85
|
-
const seatMap = new Map<string, SeatType>();
|
|
86
|
-
|
|
87
|
-
data
|
|
88
|
-
?.filter((item) => getFilteredSeats(item.label))
|
|
89
|
-
?.forEach((item) => {
|
|
90
|
-
if (EXCEPTIONS.includes(item.key as any)) return;
|
|
91
|
-
const existing = seatMap.get(item.label);
|
|
92
|
-
if (
|
|
93
|
-
!existing ||
|
|
94
|
-
parseFloat(item.fare as any) < parseFloat(existing.fare as any)
|
|
95
|
-
) {
|
|
96
|
-
seatMap.set(item.label, item);
|
|
97
|
-
}
|
|
98
|
-
});
|
|
99
|
-
|
|
100
|
-
return Array.from(seatMap.values())
|
|
101
|
-
.sort((a, b) => a.fare - b.fare)
|
|
102
|
-
.slice(0, limit);
|
|
103
|
-
};
|
|
104
|
-
|
|
105
|
-
function SeatSectionMobile({
|
|
106
|
-
seatTypes: seatTypesData,
|
|
107
|
-
isSoldOut,
|
|
108
|
-
isPeru,
|
|
109
|
-
seatPriceColor,
|
|
110
|
-
currencySign,
|
|
111
|
-
availableSeats,
|
|
112
|
-
removeDuplicateSeats,
|
|
113
|
-
}: SeatSectionMobileProps): React.ReactElement {
|
|
114
|
-
const hasMultipleTypes = (seatTypesData?.length ?? 0) > 2;
|
|
115
|
-
|
|
116
|
-
const getFare = (fare: number) => {
|
|
117
|
-
if (removeDuplicateSeats && availableSeats <= 0 && !isPeru) {
|
|
118
|
-
return commonService.currency(0, currencySign);
|
|
119
|
-
}
|
|
120
|
-
return commonService.currency(fare, currencySign);
|
|
121
|
-
};
|
|
122
|
-
|
|
123
|
-
const getLowestFare = (): number | null => {
|
|
124
|
-
const filtered = seatTypesData
|
|
125
|
-
?.filter((item) => getFilteredSeats(item.label))
|
|
126
|
-
?.filter((item) => !EXCEPTIONS.includes(item.label));
|
|
127
|
-
if (!filtered || filtered.length === 0) return null;
|
|
128
|
-
return filtered.reduce(
|
|
129
|
-
(min, item) => (item.fare < min ? item.fare : min),
|
|
130
|
-
filtered[0].fare,
|
|
131
|
-
);
|
|
132
|
-
};
|
|
133
|
-
|
|
134
|
-
const getHighestFare = (): number => {
|
|
135
|
-
return (
|
|
136
|
-
seatTypesData
|
|
137
|
-
?.filter((item) => !EXCEPTIONS.includes(item.label))
|
|
138
|
-
?.reduce((max, item) => (item.fare > max ? item.fare : max), 0) || 0
|
|
139
|
-
);
|
|
140
|
-
};
|
|
141
|
-
|
|
142
|
-
const renderPeruSeats = () => {
|
|
143
|
-
const lowestFare = getLowestFare();
|
|
144
|
-
if (lowestFare === null) return null;
|
|
145
|
-
|
|
146
|
-
const priceColor = isSoldOut ? "#bbb" : seatPriceColor;
|
|
147
|
-
|
|
148
|
-
return (
|
|
149
|
-
<>
|
|
150
|
-
<div className="w-[100%] flex flex-row justify-between items-center">
|
|
151
|
-
<span
|
|
152
|
-
className="min-[420]:text-[13px] text-[12px]"
|
|
153
|
-
style={{ color: "#bbb" }}
|
|
154
|
-
>
|
|
155
|
-
Antes
|
|
156
|
-
</span>
|
|
157
|
-
<span
|
|
158
|
-
className="min-[420]:text-[13px] text-[12px] line-through"
|
|
159
|
-
style={{ color: "#bbb" }}
|
|
160
|
-
>
|
|
161
|
-
{commonService.currency(getHighestFare(), currencySign)}
|
|
162
|
-
</span>
|
|
163
|
-
</div>
|
|
164
|
-
<div className="w-[100%] flex flex-row justify-between items-center">
|
|
165
|
-
<span
|
|
166
|
-
className="min-[420]:text-[13px] text-[12px] bold-text"
|
|
167
|
-
style={{ color: isSoldOut ? "#bbb" : "#464647" }}
|
|
168
|
-
>
|
|
169
|
-
Desde
|
|
170
|
-
</span>
|
|
171
|
-
<span
|
|
172
|
-
className="min-[420]:text-[13px] text-[12px] bold-text"
|
|
173
|
-
style={{ color: priceColor }}
|
|
174
|
-
>
|
|
175
|
-
{commonService.currency(lowestFare, currencySign)}
|
|
176
|
-
</span>
|
|
177
|
-
</div>
|
|
178
|
-
</>
|
|
179
|
-
);
|
|
180
|
-
};
|
|
181
|
-
|
|
182
|
-
const renderSeats = () => {
|
|
183
|
-
if (isPeru) {
|
|
184
|
-
return renderPeruSeats();
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
if (removeDuplicateSeats) {
|
|
188
|
-
const uniqueSeats = getUniqueSeats(seatTypesData, 3);
|
|
189
|
-
return uniqueSeats.map((type, i) => (
|
|
190
|
-
<SeatRow
|
|
191
|
-
key={i}
|
|
192
|
-
type={type}
|
|
193
|
-
index={i}
|
|
194
|
-
displayLabel={commonService.truncateSeatLabel(type.label)}
|
|
195
|
-
fare={getFare(type.fare)}
|
|
196
|
-
isSoldOut={isSoldOut}
|
|
197
|
-
seatPriceColor={seatPriceColor}
|
|
198
|
-
hasMultipleTypes={hasMultipleTypes}
|
|
199
|
-
textSize="text-[11px]"
|
|
200
|
-
/>
|
|
201
|
-
));
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
return seatTypesData
|
|
205
|
-
?.filter((item) => getFilteredSeats(item.label))
|
|
206
|
-
?.sort((a, b) => a.fare - b.fare)
|
|
207
|
-
?.slice(0, 2)
|
|
208
|
-
?.map((type, i) => (
|
|
209
|
-
<SeatRow
|
|
210
|
-
key={i}
|
|
211
|
-
type={type}
|
|
212
|
-
index={i}
|
|
213
|
-
displayLabel={type.label}
|
|
214
|
-
fare={commonService.currency(type.fare, currencySign)}
|
|
215
|
-
isSoldOut={isSoldOut}
|
|
216
|
-
seatPriceColor={seatPriceColor}
|
|
217
|
-
hasMultipleTypes={hasMultipleTypes}
|
|
218
|
-
textSize="text-[12px]"
|
|
219
|
-
/>
|
|
220
|
-
));
|
|
221
|
-
};
|
|
222
|
-
|
|
223
|
-
return (
|
|
224
|
-
<div className="content-center relative" style={{ width: "40%" }}>
|
|
225
|
-
{!isPeru && (
|
|
226
|
-
<div className="absolute -top-[16px] right-[0] flex justify-end">
|
|
227
|
-
<span
|
|
228
|
-
className="min-[420]:text-[13px] text-[12px] line-through"
|
|
229
|
-
style={{ color: "#bbb" }}
|
|
230
|
-
>
|
|
231
|
-
$7.000
|
|
232
|
-
</span>
|
|
233
|
-
</div>
|
|
234
|
-
)}
|
|
235
|
-
<div
|
|
236
|
-
className="flex flex-col justify-between h-[2.5rem] "
|
|
237
|
-
style={{
|
|
238
|
-
gap: isSoldOut ? "0px" : "5px",
|
|
239
|
-
justifyContent: hasMultipleTypes ? "space-between" : "center",
|
|
240
|
-
}}
|
|
241
|
-
>
|
|
242
|
-
{renderSeats()}
|
|
243
|
-
|
|
244
|
-
{isSoldOut ? (
|
|
245
|
-
<div className="flex justify-end">
|
|
246
|
-
<span className="min-[420]:text-[13px] text-[12px] text-[#ccc]">
|
|
247
|
-
Agotado
|
|
248
|
-
</span>
|
|
249
|
-
</div>
|
|
250
|
-
) : null}
|
|
251
|
-
</div>
|
|
252
|
-
</div>
|
|
253
|
-
);
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
export default SeatSectionMobile;
|
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import LottiePlayer from "../../assets/LottiePlayer";
|
|
3
|
-
|
|
4
|
-
interface TopAmenitieMobileProps {
|
|
5
|
-
showTopLabel: string | boolean;
|
|
6
|
-
isSoldOut: boolean;
|
|
7
|
-
seatPriceColor?: string;
|
|
8
|
-
bombAnim?: any;
|
|
9
|
-
priorityStageAnim?: any;
|
|
10
|
-
countdownSeconds?: number;
|
|
11
|
-
promoText?: string;
|
|
12
|
-
onCountdownEnd?: () => void;
|
|
13
|
-
offerText?: string;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
function TopAmenitieMobile({
|
|
17
|
-
showTopLabel,
|
|
18
|
-
isSoldOut,
|
|
19
|
-
seatPriceColor,
|
|
20
|
-
bombAnim,
|
|
21
|
-
priorityStageAnim,
|
|
22
|
-
countdownSeconds = 0,
|
|
23
|
-
onCountdownEnd,
|
|
24
|
-
offerText,
|
|
25
|
-
}: TopAmenitieMobileProps): React.ReactElement {
|
|
26
|
-
const pad = (n: number) => String(n).padStart(2, "0");
|
|
27
|
-
|
|
28
|
-
const startCountdown = (el: HTMLSpanElement | null) => {
|
|
29
|
-
if (!el || el.dataset.timerStarted) return;
|
|
30
|
-
el.dataset.timerStarted = "true";
|
|
31
|
-
let remaining = countdownSeconds;
|
|
32
|
-
|
|
33
|
-
const update = () => {
|
|
34
|
-
const hrs = Math.floor(remaining / 3600);
|
|
35
|
-
const mins = Math.floor((remaining % 3600) / 60);
|
|
36
|
-
const secs = remaining % 60;
|
|
37
|
-
el.textContent = `${pad(hrs)}:${pad(mins)}:${pad(secs)}`;
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
update();
|
|
41
|
-
const timer = setInterval(() => {
|
|
42
|
-
if (remaining <= 0) {
|
|
43
|
-
clearInterval(timer);
|
|
44
|
-
const promoBar = el.closest("[data-promo-bar]") as HTMLElement;
|
|
45
|
-
if (promoBar) promoBar.style.display = "none";
|
|
46
|
-
if (onCountdownEnd) onCountdownEnd();
|
|
47
|
-
return;
|
|
48
|
-
}
|
|
49
|
-
remaining--;
|
|
50
|
-
update();
|
|
51
|
-
}, 1000);
|
|
52
|
-
};
|
|
53
|
-
return (
|
|
54
|
-
<div
|
|
55
|
-
style={{
|
|
56
|
-
display: "flex",
|
|
57
|
-
justifyContent: "flex-end",
|
|
58
|
-
position: "relative",
|
|
59
|
-
zIndex: "-1",
|
|
60
|
-
}}
|
|
61
|
-
>
|
|
62
|
-
{offerText && (
|
|
63
|
-
<div
|
|
64
|
-
style={{
|
|
65
|
-
backgroundColor: seatPriceColor,
|
|
66
|
-
|
|
67
|
-
position: "relative",
|
|
68
|
-
right: showTopLabel ? "-21px" : "",
|
|
69
|
-
padding: "0 14px",
|
|
70
|
-
borderTopRightRadius: "12px",
|
|
71
|
-
borderTopLeftRadius: "12px",
|
|
72
|
-
}}
|
|
73
|
-
>
|
|
74
|
-
<div style={{ display: "flex", alignItems: "center", color: "#fff" }}>
|
|
75
|
-
<LottiePlayer animationData={bombAnim} width="16px" height="16px" />
|
|
76
|
-
<span
|
|
77
|
-
className="flex items-center gap-[5px] py-[6px] pl-[6px] text-[12px] z-20"
|
|
78
|
-
style={{ paddingRight: showTopLabel ? "20px" : "0" }}
|
|
79
|
-
>
|
|
80
|
-
<span className="bold-text">{offerText}</span> |{" "}
|
|
81
|
-
<span
|
|
82
|
-
ref={startCountdown}
|
|
83
|
-
style={{
|
|
84
|
-
fontVariantNumeric: "tabular-nums",
|
|
85
|
-
display: "inline-block",
|
|
86
|
-
minWidth: "50px",
|
|
87
|
-
}}
|
|
88
|
-
/>
|
|
89
|
-
</span>
|
|
90
|
-
</div>
|
|
91
|
-
</div>
|
|
92
|
-
)}
|
|
93
|
-
|
|
94
|
-
{showTopLabel && (
|
|
95
|
-
<div
|
|
96
|
-
className={`flex items-center gap-[5px] py-[6px] px-[10px] text-[12px] z-20`}
|
|
97
|
-
style={{
|
|
98
|
-
backgroundColor: isSoldOut ? "#ddd" : "#ff8f45",
|
|
99
|
-
borderTopRightRadius: "12px",
|
|
100
|
-
borderTopLeftRadius: "12px",
|
|
101
|
-
}}
|
|
102
|
-
>
|
|
103
|
-
{/* {renderIcon("whiteBoardingIcon", "12px")} */}
|
|
104
|
-
<LottiePlayer
|
|
105
|
-
animationData={priorityStageAnim}
|
|
106
|
-
width="12px"
|
|
107
|
-
height="12px"
|
|
108
|
-
/>
|
|
109
|
-
<div
|
|
110
|
-
className={
|
|
111
|
-
// isSoldOut ? "text-white" : `text-[${colors.topLabelColor}]`
|
|
112
|
-
`text-white`
|
|
113
|
-
}
|
|
114
|
-
style={{
|
|
115
|
-
color: "#fff",
|
|
116
|
-
}}
|
|
117
|
-
>
|
|
118
|
-
{showTopLabel}
|
|
119
|
-
</div>
|
|
120
|
-
</div>
|
|
121
|
-
)}
|
|
122
|
-
</div>
|
|
123
|
-
);
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
export default TopAmenitieMobile;
|