kupos-ui-components-lib 9.8.4 → 9.8.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.
- package/dist/KuposUIComponent.d.ts +0 -3
- package/dist/components/ServiceItem/PeruServiceItemDesktop.d.ts +1 -1
- package/dist/components/ServiceItem/PeruServiceItemDesktop.js +2 -2
- package/dist/components/ServiceItem/ServiceItemDesktop.d.ts +1 -1
- package/dist/components/ServiceItem/ServiceItemDesktop.js +21 -21
- package/dist/components/ServiceItem/ServiceItemMobile.d.ts +1 -1
- package/dist/components/ServiceItem/ServiceItemMobile.js +7 -16
- package/dist/components/ServiceItem/mobileTypes.d.ts +0 -33
- package/dist/components/ServiceItem/types.d.ts +8 -23
- package/dist/styles.css +6 -212
- package/dist/ui/SeatSection/SeatSection.d.ts +7 -1
- package/dist/ui/SeatSection/SeatSection.js +31 -6
- package/dist/utils/CommonService.js +1 -11
- package/package.json +1 -1
- package/src/KuposUIComponent.tsx +0 -3
- package/src/components/ServiceItem/PeruServiceItemDesktop.tsx +24 -34
- package/src/components/ServiceItem/ServiceItemDesktop.tsx +45 -57
- package/src/components/ServiceItem/ServiceItemMobile.tsx +286 -342
- package/src/components/ServiceItem/mobileTypes.ts +1 -30
- package/src/components/ServiceItem/types.ts +24 -35
- package/src/styles.css +0 -15
- package/src/ui/SeatSection/SeatSection.tsx +76 -15
- package/src/utils/CommonService.ts +1 -13
- package/src/assets/images/anims/service_list/flame_anim.json +0 -1
- package/src/assets/images/anims/service_list/thunder_icon.json +0 -1
- package/src/assets/images/anims/service_list/users_anim.json +0 -1
- package/src/ui/FeaturServiceUiMobile/FeatureServiceUiMobile.tsx +0 -556
- package/src/ui/FeatureServiceUI/FeatureServiceUi.tsx +0 -592
|
@@ -67,6 +67,7 @@ function PeruServiceItemDesktop({
|
|
|
67
67
|
isPeru,
|
|
68
68
|
siteType,
|
|
69
69
|
isAllinBus,
|
|
70
|
+
isFlores,
|
|
70
71
|
t = (key: string) => key,
|
|
71
72
|
}: ServiceItemProps & { currencySign?: string }): React.ReactElement {
|
|
72
73
|
const animationMap: Record<string, Record<string, any>> = {
|
|
@@ -148,9 +149,8 @@ function PeruServiceItemDesktop({
|
|
|
148
149
|
style={{
|
|
149
150
|
filter: color === "white" ? "brightness(0) invert(1)" : "",
|
|
150
151
|
}}
|
|
151
|
-
className={`object-contain ${
|
|
152
|
-
|
|
153
|
-
}`}
|
|
152
|
+
className={`object-contain ${moreAnemities ? "w-[16px] h-[16px]" : "w-[16px] h-[16px]"
|
|
153
|
+
}`}
|
|
154
154
|
/>
|
|
155
155
|
);
|
|
156
156
|
};
|
|
@@ -261,9 +261,8 @@ function PeruServiceItemDesktop({
|
|
|
261
261
|
SEAT_EXCEPTIONS.includes(val.label) ? null : (
|
|
262
262
|
<span
|
|
263
263
|
key={key}
|
|
264
|
-
className={`flex items-center justify-between text-[13.33px] ${
|
|
265
|
-
|
|
266
|
-
}`}
|
|
264
|
+
className={`flex items-center justify-between text-[13.33px] ${isSoldOut ? "text-[#c0c0c0]" : ""
|
|
265
|
+
}`}
|
|
267
266
|
>
|
|
268
267
|
<div>
|
|
269
268
|
<img
|
|
@@ -288,9 +287,8 @@ function PeruServiceItemDesktop({
|
|
|
288
287
|
SEAT_EXCEPTIONS.includes(val.label) ? null : (
|
|
289
288
|
<span
|
|
290
289
|
key={key}
|
|
291
|
-
className={`flex items-center justify-between text-[13.33px] ${
|
|
292
|
-
|
|
293
|
-
}`}
|
|
290
|
+
className={`flex items-center justify-between text-[13.33px] ${isSoldOut ? "text-[#c0c0c0]" : ""
|
|
291
|
+
}`}
|
|
294
292
|
>
|
|
295
293
|
<div>
|
|
296
294
|
<img
|
|
@@ -538,15 +536,13 @@ function PeruServiceItemDesktop({
|
|
|
538
536
|
|
|
539
537
|
return (
|
|
540
538
|
<div
|
|
541
|
-
className={`relative ${
|
|
542
|
-
serviceItem
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
serviceItem?.train_type_label === "Tren Express (Nuevo)" ||
|
|
546
|
-
showTopLabel
|
|
539
|
+
className={`relative ${serviceItem.offer_text ? "mb-[55px]" : "mb-[10px]"
|
|
540
|
+
} ${serviceItem?.is_direct_trip ||
|
|
541
|
+
serviceItem?.train_type_label === "Tren Express (Nuevo)" ||
|
|
542
|
+
showTopLabel
|
|
547
543
|
? "mt-[24px]"
|
|
548
544
|
: "mt-[20px]"
|
|
549
|
-
|
|
545
|
+
} `}
|
|
550
546
|
>
|
|
551
547
|
<div
|
|
552
548
|
className={"bg-white rounded-[20px] shadow-service mx-auto relative"}
|
|
@@ -587,9 +583,8 @@ function PeruServiceItemDesktop({
|
|
|
587
583
|
<img
|
|
588
584
|
src={serviceItem.operator_details[0]}
|
|
589
585
|
alt="service logo"
|
|
590
|
-
className={`
|
|
591
|
-
isSoldOut ? "grayscale" : ""
|
|
592
|
-
}`}
|
|
586
|
+
className={`h-auto object-contain ${isFlores ? "w-[80%]" : "w-full"
|
|
587
|
+
} ${isSoldOut ? "grayscale" : ""}`}
|
|
593
588
|
/>
|
|
594
589
|
</div>
|
|
595
590
|
{isCiva ? (
|
|
@@ -601,9 +596,8 @@ function PeruServiceItemDesktop({
|
|
|
601
596
|
|
|
602
597
|
{/* DATE AND TIME - Grid Layout */}
|
|
603
598
|
<div
|
|
604
|
-
className={`min-h-[2.5rem] grid grid-cols-[0.8fr_auto_26%_1fr] gap-x-4 items-center text-[13.33px] ${
|
|
605
|
-
|
|
606
|
-
}`}
|
|
599
|
+
className={`min-h-[2.5rem] grid grid-cols-[0.8fr_auto_26%_1fr] gap-x-4 items-center text-[13.33px] ${isSoldOut ? "text-[#c0c0c0]" : ""
|
|
600
|
+
}`}
|
|
607
601
|
style={{
|
|
608
602
|
gridTemplateRows: "1fr",
|
|
609
603
|
}}
|
|
@@ -620,9 +614,8 @@ function PeruServiceItemDesktop({
|
|
|
620
614
|
<img
|
|
621
615
|
src={serviceItem.icons?.origin}
|
|
622
616
|
alt="origin"
|
|
623
|
-
className={`w-[18px] h-auto mr-[8px] ${
|
|
624
|
-
|
|
625
|
-
}`}
|
|
617
|
+
className={`w-[18px] h-auto mr-[8px] ${isSoldOut ? "grayscale" : ""
|
|
618
|
+
}`}
|
|
626
619
|
/>
|
|
627
620
|
</div>
|
|
628
621
|
)}
|
|
@@ -637,9 +630,8 @@ function PeruServiceItemDesktop({
|
|
|
637
630
|
<div className="h-[20px] flex items-center">
|
|
638
631
|
<img
|
|
639
632
|
src={serviceItem.icons?.destination}
|
|
640
|
-
className={`w-[18px] h-auto mr-[8px] ${
|
|
641
|
-
|
|
642
|
-
}`}
|
|
633
|
+
className={`w-[18px] h-auto mr-[8px] ${isSoldOut ? "grayscale" : ""
|
|
634
|
+
}`}
|
|
643
635
|
style={{ opacity: isSoldOut ? 0.5 : 1 }}
|
|
644
636
|
/>
|
|
645
637
|
</div>
|
|
@@ -744,9 +736,8 @@ function PeruServiceItemDesktop({
|
|
|
744
736
|
{/* SEATS */}
|
|
745
737
|
<div className="content-center">
|
|
746
738
|
<div
|
|
747
|
-
className={`relative flex gap-[10px] text-[13.33px] justify-between min-h-[2.5rem] ${
|
|
748
|
-
|
|
749
|
-
}`}
|
|
739
|
+
className={`relative flex gap-[10px] text-[13.33px] justify-between min-h-[2.5rem] ${getNumberOfSeats() < 3 ? "" : ""
|
|
740
|
+
}`}
|
|
750
741
|
style={
|
|
751
742
|
getNumberOfSeats() < 2
|
|
752
743
|
? { alignItems: "center" }
|
|
@@ -792,9 +783,8 @@ function PeruServiceItemDesktop({
|
|
|
792
783
|
<button
|
|
793
784
|
onClick={() => (!isSoldOut ? checkMidnight() : null)}
|
|
794
785
|
disabled={serviceDetailsLoading}
|
|
795
|
-
className={`w-full ${
|
|
796
|
-
|
|
797
|
-
} text-[13.33px] font-bold text-white rounded-[10px] border-none px-[20px] flex items-center justify-center`}
|
|
786
|
+
className={`w-full ${serviceDetailsLoading || isSoldOut ? "py-[12px]" : "py-[12px]"
|
|
787
|
+
} text-[13.33px] font-bold text-white rounded-[10px] border-none px-[20px] flex items-center justify-center`}
|
|
798
788
|
style={{
|
|
799
789
|
backgroundColor:
|
|
800
790
|
serviceDetailsLoading || isSoldOut
|
|
@@ -27,8 +27,6 @@ import bombAnimation from "../../assets/images/anims/service_list/bomb.json";
|
|
|
27
27
|
import dotAnimation from "../../assets/images/anims/service_list/dot_animation.json";
|
|
28
28
|
import starAnimation from "../../assets/images/anims/service_list/star_anim.json";
|
|
29
29
|
import femaleAnimation from "../../assets/images/anims/service_list/female_anim.json";
|
|
30
|
-
import usersAnimation from "../../assets/images/anims/service_list/users_anim.json";
|
|
31
|
-
import flameAnimation from "../../assets/images/anims/service_list/flame_anim.json";
|
|
32
30
|
|
|
33
31
|
import RatingBlock from "../../ui/RatingBlock";
|
|
34
32
|
import DurationBlock from "../../ui/DurationBlock";
|
|
@@ -39,9 +37,6 @@ import KuposButton from "../../ui/KuposButton/KuposButton";
|
|
|
39
37
|
import BottomAmenities from "../../ui/BottomAmenities/BottomAmenities";
|
|
40
38
|
import SeatSection from "../../ui/SeatSection/SeatSection";
|
|
41
39
|
import DateTimeSection from "../../ui/DateTimeSection/DateTimeSection";
|
|
42
|
-
import FeatureServiceUi from "../../ui/FeatureServiceUI/FeatureServiceUi";
|
|
43
|
-
|
|
44
|
-
import thunderAnimation from "../../assets/images/anims/service_list/thunder_icon.json";
|
|
45
40
|
import ServiceBadges from "../../ui/ServiceBadges/ServiceBadges";
|
|
46
41
|
|
|
47
42
|
const SEAT_EXCEPTIONS = ["Asiento mascota"];
|
|
@@ -76,9 +71,6 @@ const ANIMATION_MAP: Record<string, Record<string, any>> = {
|
|
|
76
71
|
bombAnimation: {
|
|
77
72
|
kupos: bombAnimation,
|
|
78
73
|
},
|
|
79
|
-
thunderAnimation: {
|
|
80
|
-
kupos: thunderAnimation,
|
|
81
|
-
},
|
|
82
74
|
dotAnimation: {
|
|
83
75
|
kupos: dotAnimation,
|
|
84
76
|
},
|
|
@@ -88,12 +80,6 @@ const ANIMATION_MAP: Record<string, Record<string, any>> = {
|
|
|
88
80
|
femaaleAnimation: {
|
|
89
81
|
kupos: femaleAnimation,
|
|
90
82
|
},
|
|
91
|
-
usersAnimation: {
|
|
92
|
-
kupos: usersAnimation,
|
|
93
|
-
},
|
|
94
|
-
flameAnimation: {
|
|
95
|
-
kupos: flameAnimation,
|
|
96
|
-
},
|
|
97
83
|
};
|
|
98
84
|
|
|
99
85
|
function ServiceItemPB({
|
|
@@ -127,22 +113,27 @@ function ServiceItemPB({
|
|
|
127
113
|
setIsExpand,
|
|
128
114
|
coachKey,
|
|
129
115
|
viewersConfig,
|
|
130
|
-
isNewUi,
|
|
131
116
|
showLoginModal,
|
|
132
117
|
isLoggedIn,
|
|
133
118
|
showLoginOption,
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
isTimeDropdownOpen,
|
|
143
|
-
onTimeDropdownToggle,
|
|
144
|
-
wowDealData,
|
|
119
|
+
isTrain,
|
|
120
|
+
selectedSeatKey,
|
|
121
|
+
onSeatSelect,
|
|
122
|
+
onTrainButtonClick,
|
|
123
|
+
showSeatSelectionError,
|
|
124
|
+
onShowSeatSelectionError,
|
|
125
|
+
onClearSeatSelectionError,
|
|
126
|
+
isFlores,
|
|
145
127
|
}: ServiceItemProps & { currencySign?: string }): React.ReactElement {
|
|
128
|
+
const handleSeatSelect = (
|
|
129
|
+
key: any,
|
|
130
|
+
price: number,
|
|
131
|
+
seatKey: string,
|
|
132
|
+
apiSeatType?: string,
|
|
133
|
+
) => {
|
|
134
|
+
onClearSeatSelectionError?.();
|
|
135
|
+
onSeatSelect?.(key, price, seatKey, apiSeatType);
|
|
136
|
+
};
|
|
146
137
|
const getAnimationIcon = (icon: string) => {
|
|
147
138
|
const animation = ANIMATION_MAP[icon];
|
|
148
139
|
if (!animation) return null;
|
|
@@ -339,6 +330,17 @@ function ServiceItemPB({
|
|
|
339
330
|
return;
|
|
340
331
|
}
|
|
341
332
|
|
|
333
|
+
if (isTrain) {
|
|
334
|
+
if (!selectedSeatKey) {
|
|
335
|
+
onShowSeatSelectionError?.(serviceItem.id);
|
|
336
|
+
return;
|
|
337
|
+
}
|
|
338
|
+
if (onTrainButtonClick) {
|
|
339
|
+
onTrainButtonClick();
|
|
340
|
+
return;
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
|
|
342
344
|
onBookButtonPress();
|
|
343
345
|
};
|
|
344
346
|
|
|
@@ -440,36 +442,7 @@ function ServiceItemPB({
|
|
|
440
442
|
isPeru={isPeru}
|
|
441
443
|
siteType={siteType}
|
|
442
444
|
isAllinBus={isAllinBus}
|
|
443
|
-
|
|
444
|
-
) : isNewUi ? (
|
|
445
|
-
<FeatureServiceUi
|
|
446
|
-
serviceItem={serviceItem}
|
|
447
|
-
showTopLabel={showTopLabel}
|
|
448
|
-
isSoldOut={isSoldOut}
|
|
449
|
-
getAnimationIcon={getAnimationIcon}
|
|
450
|
-
cityOrigin={cityOrigin}
|
|
451
|
-
cityDestination={cityDestination}
|
|
452
|
-
renderIcon={renderIcon}
|
|
453
|
-
viewersConfig={viewersConfig}
|
|
454
|
-
isFeatureDropDownExpand={isFeatureDropDownExpand}
|
|
455
|
-
ticketQuantity={ticketQuantity}
|
|
456
|
-
onIncreaseTicketQuantity={onIncreaseTicketQuantity}
|
|
457
|
-
onDecreaseTicketQuantity={onDecreaseTicketQuantity}
|
|
458
|
-
onBookButtonPress={onRemateUiButtonClick}
|
|
459
|
-
onToggleExpand={() =>
|
|
460
|
-
setIsFeatureDropDownExpand &&
|
|
461
|
-
setIsFeatureDropDownExpand(
|
|
462
|
-
isFeatureDropDownExpand === serviceItem.id ||
|
|
463
|
-
isFeatureDropDownExpand === true
|
|
464
|
-
? null
|
|
465
|
-
: serviceItem.id,
|
|
466
|
-
)
|
|
467
|
-
}
|
|
468
|
-
selectedTimeSlot={selectedTimeSlot}
|
|
469
|
-
onTimeSlotChange={onTimeSlotChange}
|
|
470
|
-
isTimeDropdownOpen={isTimeDropdownOpen}
|
|
471
|
-
onTimeDropdownToggle={onTimeDropdownToggle}
|
|
472
|
-
wowDealData={wowDealData}
|
|
445
|
+
isFlores={isFlores}
|
|
473
446
|
/>
|
|
474
447
|
) : (
|
|
475
448
|
<div
|
|
@@ -581,6 +554,10 @@ function ServiceItemPB({
|
|
|
581
554
|
isPeru={isPeru}
|
|
582
555
|
renderIcon={renderIcon}
|
|
583
556
|
discountSeatPriceColor={colors.discountSeatPriceColor}
|
|
557
|
+
isTrain={isTrain}
|
|
558
|
+
selectedSeatKey={selectedSeatKey}
|
|
559
|
+
onSeatSelect={handleSeatSelect}
|
|
560
|
+
topLabelColor={colors.topLabelColor}
|
|
584
561
|
/>
|
|
585
562
|
</div>
|
|
586
563
|
|
|
@@ -596,6 +573,18 @@ function ServiceItemPB({
|
|
|
596
573
|
soldOutIcon={renderIcon("soldOutIcon", "14px")}
|
|
597
574
|
onClick={checkMidnight}
|
|
598
575
|
/>
|
|
576
|
+
{showSeatSelectionError === serviceItem.id && isTrain && (
|
|
577
|
+
<div className="flex justify-center mr-[11px] w-[100%] right-[0px] absolute left-[0] top-[40px]">
|
|
578
|
+
<div
|
|
579
|
+
className="text-[9px] text-center whitespace-nowrap"
|
|
580
|
+
style={{
|
|
581
|
+
color: colors.seatPriceColor,
|
|
582
|
+
}}
|
|
583
|
+
>
|
|
584
|
+
Selecciona el tipo de servicio
|
|
585
|
+
</div>
|
|
586
|
+
</div>
|
|
587
|
+
)}
|
|
599
588
|
{showLastSeats ? (
|
|
600
589
|
<div className="flex justify-center mr-[11px] w-[100%] right-[0px] absolute left-[0] top-[40px]">
|
|
601
590
|
{serviceItem?.available_seats < 10 &&
|
|
@@ -642,7 +631,6 @@ function ServiceItemPB({
|
|
|
642
631
|
"grid-template-rows 0.3s ease-in-out, opacity 0.25s ease-in-out",
|
|
643
632
|
position: "relative",
|
|
644
633
|
zIndex: hasOfferText || hasDpEnabled ? 0 : -1,
|
|
645
|
-
marginTop: isItemExpanded ? "" : "-10px",
|
|
646
634
|
}}
|
|
647
635
|
>
|
|
648
636
|
<div
|