kupos-ui-components-lib 10.4.43 → 10.4.46
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/components/ServiceItem/ServiceItemDesktop.js +5 -2
- package/dist/styles.css +6 -3
- package/dist/ui/BottomAmenities/BottomAmenities.d.ts +3 -1
- package/dist/ui/BottomAmenities/BottomAmenities.js +7 -3
- package/dist/ui/mobileweb/BottomAmenitiesMobile.js +5 -4
- package/dist/ui/mobileweb/SeatSectionMobile.js +1 -1
- package/package.json +1 -1
- package/src/components/ServiceItem/ServiceItemDesktop.tsx +7 -1
- package/src/ui/BottomAmenities/BottomAmenities.tsx +18 -1
- package/src/ui/mobileweb/BottomAmenitiesMobile.tsx +9 -5
- package/src/ui/mobileweb/SeatSectionMobile.tsx +5 -2
|
@@ -312,7 +312,10 @@ function ServiceItemPB({ serviceItem, onBookButtonPress, colors, metaData, child
|
|
|
312
312
|
render: (React.createElement(FlexibleBlock, { translation: translation, getAnimationIcon: getAnimationIcon, colors: colors, serviceItem: serviceItem, isSoldOut: isSoldOut })),
|
|
313
313
|
},
|
|
314
314
|
];
|
|
315
|
-
const otherItems = items.filter((i) => i.key !== "pet" &&
|
|
315
|
+
const otherItems = items.filter((i) => i.key !== "pet" &&
|
|
316
|
+
i.key !== "flexible" &&
|
|
317
|
+
i.key !== "servicetype" &&
|
|
318
|
+
!!i.condition);
|
|
316
319
|
return (React.createElement(React.Fragment, null, isPeruSites ? (React.createElement(PeruServiceItemDesktop, { serviceItem: serviceItem, onBookButtonPress: onBookButtonPress, colors: colors, metaData: metaData, children: children, busStage: busStage, serviceDetailsLoading: serviceDetailsLoading, cityOrigin: cityOrigin, cityDestination: cityDestination, translation: translation, orignLabel: orignLabel, destinationLabel: destinationLabel, currencySign: currencySign, isCiva: isCiva, showRating: showRating, showLastSeats: showLastSeats, removeArrivalTime: removeArrivalTime, removeDuplicateSeats: removeDuplicateSeats, isPeruSites: isPeruSites, t: (key) => t(key), showAvailableSeats: showAvailableSeats, isSeatIcon: isSeatIcon, isPeru: isPeru, siteType: siteType, isAllinBus: isAllinBus, viewersConfig: viewersConfig, isLoggedIn: isLoggedIn, showLoginModal: showLoginModal, isExpand: isExpand, setIsExpand: setIsExpand, coachKey: coachKey, isFlores: isFlores, isNewUiEnabled: isNewUiEnabledPeru, showLoginOption: showLoginOption, priority_stage_ids: priority_stage_ids })) : isNewUi && !isTrain ? (React.createElement(FeatureServiceUi, { serviceItem: serviceItem, showTopLabel: showTopLabel, getAnimationIcon: getAnimationIcon, cityOrigin: cityOrigin, cityDestination: cityDestination, renderIcon: renderIcon, viewersConfig: viewersConfig, isFeatureDropDownExpand: isFeatureDropDownExpand, ticketQuantity: ticketQuantity, onIncreaseTicketQuantity: onIncreaseTicketQuantity, onDecreaseTicketQuantity: onDecreaseTicketQuantity, onBookButtonPress: onRemateUiButtonClick, onToggleExpand: () => setIsFeatureDropDownExpand &&
|
|
317
320
|
setIsFeatureDropDownExpand(isFeatureDropDownExpand === serviceItem.id ||
|
|
318
321
|
isFeatureDropDownExpand === true
|
|
@@ -373,7 +376,7 @@ function ServiceItemPB({ serviceItem, onBookButtonPress, colors, metaData, child
|
|
|
373
376
|
color: colors.seatPriceColor,
|
|
374
377
|
} }, "\u00A1\u00DAltimos Asientos!")))) : null)),
|
|
375
378
|
React.createElement(BottomAmenities, { otherItems: otherItems, serviceItem: serviceItem, grayscaleClass: grayscaleClass, isSoldOut: isSoldOut, isItemExpanded: isItemExpanded, colors: colors, translation: translation, getAnimationIcon: getAnimationIcon, downArrowIcon: renderIcon("downArrow", "10px"), onToggleExpand: () => setIsExpand &&
|
|
376
|
-
setIsExpand(isItemExpanded ? null : serviceItem.id), isPeru: isPeru, isTrain: isTrain, isDpEnabled: serviceItem.is_dp_enabled }))),
|
|
379
|
+
setIsExpand(isItemExpanded ? null : serviceItem.id), isPeru: isPeru, isTrain: isTrain, isDpEnabled: serviceItem.is_dp_enabled, serviceType: serviceItem.service_type, renderIcon: renderIcon }))),
|
|
377
380
|
isPeru ? null : (React.createElement("div", { style: {
|
|
378
381
|
display: "grid",
|
|
379
382
|
gridTemplateRows: isItemExpanded ? "1fr" : "0fr",
|
package/dist/styles.css
CHANGED
|
@@ -273,6 +273,9 @@
|
|
|
273
273
|
.-mr-\[12px\] {
|
|
274
274
|
margin-right: calc(12px * -1);
|
|
275
275
|
}
|
|
276
|
+
.mr-\[1px\] {
|
|
277
|
+
margin-right: 1px;
|
|
278
|
+
}
|
|
276
279
|
.mr-\[2px\] {
|
|
277
280
|
margin-right: 2px;
|
|
278
281
|
}
|
|
@@ -507,9 +510,6 @@
|
|
|
507
510
|
.w-\[50\%\] {
|
|
508
511
|
width: 50%;
|
|
509
512
|
}
|
|
510
|
-
.w-\[55\%\] {
|
|
511
|
-
width: 55%;
|
|
512
|
-
}
|
|
513
513
|
.w-\[60\%\] {
|
|
514
514
|
width: 60%;
|
|
515
515
|
}
|
|
@@ -744,6 +744,9 @@
|
|
|
744
744
|
.gap-\[2px\] {
|
|
745
745
|
gap: 2px;
|
|
746
746
|
}
|
|
747
|
+
.gap-\[3px\] {
|
|
748
|
+
gap: 3px;
|
|
749
|
+
}
|
|
747
750
|
.gap-\[3rem\] {
|
|
748
751
|
gap: 3rem;
|
|
749
752
|
}
|
|
@@ -26,6 +26,8 @@ interface BottomAmenitiesProps {
|
|
|
26
26
|
isPeru?: boolean;
|
|
27
27
|
isTrain?: boolean;
|
|
28
28
|
isDpEnabled?: boolean;
|
|
29
|
+
serviceType?: string;
|
|
30
|
+
renderIcon?: (iconKey: string, size?: string) => React.ReactNode;
|
|
29
31
|
}
|
|
30
|
-
declare function BottomAmenities({ otherItems, serviceItem, grayscaleClass, isSoldOut, isItemExpanded, colors, translation, getAnimationIcon, downArrowIcon, onToggleExpand, isPeru, isTrain, isDpEnabled, }: BottomAmenitiesProps): React.ReactElement;
|
|
32
|
+
declare function BottomAmenities({ otherItems, serviceItem, grayscaleClass, isSoldOut, isItemExpanded, colors, translation, getAnimationIcon, downArrowIcon, onToggleExpand, isPeru, isTrain, isDpEnabled, serviceType, renderIcon, }: BottomAmenitiesProps): React.ReactElement;
|
|
31
33
|
export default BottomAmenities;
|
|
@@ -3,7 +3,8 @@ import LottiePlayer from "../../assets/LottiePlayer";
|
|
|
3
3
|
import FlexibleBlock from "../FlexibleBlock";
|
|
4
4
|
import PetBlock from "../PetBlock";
|
|
5
5
|
import FemaleBlock from "../FemaleBlock";
|
|
6
|
-
|
|
6
|
+
import CommonService from "../../utils/CommonService";
|
|
7
|
+
function BottomAmenities({ otherItems, serviceItem, grayscaleClass, isSoldOut, isItemExpanded, colors, translation, getAnimationIcon, downArrowIcon, onToggleExpand, isPeru, isTrain, isDpEnabled, serviceType, renderIcon, }) {
|
|
7
8
|
const hasPetInfo = serviceItem.pet_seat_info &&
|
|
8
9
|
Object.keys(serviceItem.pet_seat_info).length > 0;
|
|
9
10
|
const showDownArrow = ((serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.is_change_ticket) && serviceItem.pet_seat_info) ||
|
|
@@ -11,11 +12,14 @@ function BottomAmenities({ otherItems, serviceItem, grayscaleClass, isSoldOut, i
|
|
|
11
12
|
Object.keys(serviceItem.pet_seat_info).length > 0);
|
|
12
13
|
return (React.createElement("div", { className: "flex items-center mt-[15px] border-t border-[#eee] pt-[6px]" },
|
|
13
14
|
React.createElement("div", { className: "grid items-center gap-[2%] flex-1 ", style: {
|
|
14
|
-
// gridTemplateColumns: " 28% 21% 23% 23%",
|
|
15
15
|
gridTemplateColumns: isTrain
|
|
16
16
|
? "25.6% 17% 23% 23%"
|
|
17
17
|
: "25.3% 17% 23% 23%",
|
|
18
|
-
} },
|
|
18
|
+
} },
|
|
19
|
+
otherItems.map((item) => (React.createElement("div", { key: item.key, className: "flex items-center" }, item.render))),
|
|
20
|
+
serviceType && (React.createElement("div", { className: `flex items-center gap-[3px] text-[13.33px] whitespace-nowrap ${isSoldOut ? "text-[#c0c0c0]" : "text-[#464647]"}`, style: { gridColumn: 4 } }, renderIcon === null || renderIcon === void 0 ? void 0 :
|
|
21
|
+
renderIcon("serviceTypeIcon", "15px"),
|
|
22
|
+
React.createElement("span", { className: "bold-text" }, CommonService.capitalizeFirstLetter(serviceType))))),
|
|
19
23
|
React.createElement("div", { className: "flex items-center justify-end shrink-0 ml-[5px] w-[150px]" },
|
|
20
24
|
(serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.is_tracking_enabled) && (React.createElement("div", { className: grayscaleClass + " mr-[10px]" },
|
|
21
25
|
React.createElement(LottiePlayer, { animationData: getAnimationIcon("locationAnim"), width: "20px", height: "20px" }))),
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import LottiePlayer from "../../assets/LottiePlayer";
|
|
3
3
|
import DateService from "../../utils/DateService";
|
|
4
|
+
import commonService from "../../utils/CommonService";
|
|
4
5
|
function BottomAmenitiesMobile({ isSoldOut, amenitiesNodes, hoursIcon, duration, isDirectTrip, directoColor, directoAnim, isChangeTicket, isPetSeat, petSeatInfo, petFriendlyAnim, flexibleAnim, isTrackingEnabled, locationAnim, downArrowIcon, showDropdown, setShowDropdown, onDropdownToggle, isItemExpanded, isPeru, femaleAnim, ladiesBookedSeats, isDpEnabled, isTrain, seatCategoryText, serviceType, serviceTypeIcon, renderIcon, }) {
|
|
5
6
|
return (React.createElement("div", { className: `${"flex justify-between items-center items-center "}` },
|
|
6
|
-
React.createElement("div", { className: "
|
|
7
|
+
React.createElement("div", { className: " flex justify-between items-center", style: { width: isPeru && serviceType ? "100%" : "55%" } },
|
|
7
8
|
React.createElement("div", { style: { opacity: isSoldOut ? 0.5 : 1 } }, amenitiesNodes),
|
|
8
9
|
React.createElement("div", { className: "flex relative ", style: { color: isSoldOut ? "#bbb" : "text-[#464647]" } },
|
|
9
10
|
React.createElement("div", { className: `w-[12px] h-auto mr-[2px] ${isSoldOut ? "grayscale" : ""}` }, hoursIcon),
|
|
@@ -11,10 +12,10 @@ function BottomAmenitiesMobile({ isSoldOut, amenitiesNodes, hoursIcon, duration,
|
|
|
11
12
|
React.createElement("div", { className: `cursor-default group min-[420]:text-[13px] text-[12px] ${isSoldOut ? "text-[#c0c0c0]" : ""}`, style: { lineHeight: "normal" } },
|
|
12
13
|
DateService.formatDuration(duration),
|
|
13
14
|
"hrs")),
|
|
14
|
-
serviceType && (React.createElement("div", { className: "flex relative ", style: { color: isSoldOut ? "#bbb" : "text-[#464647]" } },
|
|
15
|
-
React.createElement("div", { className: `w-[12px] h-auto mr-[
|
|
15
|
+
serviceType && (React.createElement("div", { className: "flex relative items-center", style: { color: isSoldOut ? "#bbb" : "text-[#464647]" } },
|
|
16
|
+
React.createElement("div", { className: `w-[12px] h-auto mr-[1px] mt-[3px] ${isSoldOut ? "grayscale" : ""}` }, renderIcon("serviceTypeIcon", "12px")),
|
|
16
17
|
"\u00A0",
|
|
17
|
-
React.createElement("div", { className: `cursor-default group min-[420]:text-[13px] text-[12px] ${isSoldOut ? "text-[#c0c0c0]" : ""}`, style: { lineHeight: "normal" } }, serviceType)))),
|
|
18
|
+
React.createElement("div", { className: `cursor-default group min-[420]:text-[13px] text-[12px] bold-text ${isSoldOut ? "text-[#c0c0c0]" : ""}`, style: { lineHeight: "normal" } }, commonService.capitalizeFirstLetter(serviceType))))),
|
|
18
19
|
seatCategoryText && (React.createElement("div", { className: "flex-1 text-right whitespace-nowrap min-[420]:text-[13px] text-[12px]", style: { opacity: isSoldOut ? 0.5 : 1 } }, seatCategoryText)),
|
|
19
20
|
React.createElement("div", { className: "flex items-center" },
|
|
20
21
|
React.createElement("div", null, (isChangeTicket || isPetSeat) && (React.createElement("div", { className: "flex items-center" },
|
|
@@ -45,7 +45,7 @@ const getUniqueSeats = (data, limit) => {
|
|
|
45
45
|
});
|
|
46
46
|
return Array.from(seatMap.values())
|
|
47
47
|
.sort((a, b) => a.fare - b.fare)
|
|
48
|
-
.slice(
|
|
48
|
+
.slice(2, limit);
|
|
49
49
|
};
|
|
50
50
|
function SeatSectionMobile({ seatTypes: seatTypesData, isSoldOut, isPeru, seatPriceColor, currencySign, availableSeats, removeDuplicateSeats, serviceItem, tooltipBgColor, showLastSeats, discountSeatPriceColor, isTrain, discountSeatCrossPriceColor, }) {
|
|
51
51
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
package/package.json
CHANGED
|
@@ -493,7 +493,11 @@ function ServiceItemPB({
|
|
|
493
493
|
];
|
|
494
494
|
|
|
495
495
|
const otherItems = items.filter(
|
|
496
|
-
(i) =>
|
|
496
|
+
(i) =>
|
|
497
|
+
i.key !== "pet" &&
|
|
498
|
+
i.key !== "flexible" &&
|
|
499
|
+
i.key !== "servicetype" &&
|
|
500
|
+
!!i.condition,
|
|
497
501
|
);
|
|
498
502
|
|
|
499
503
|
return (
|
|
@@ -769,6 +773,8 @@ function ServiceItemPB({
|
|
|
769
773
|
isPeru={isPeru}
|
|
770
774
|
isTrain={isTrain}
|
|
771
775
|
isDpEnabled={serviceItem.is_dp_enabled}
|
|
776
|
+
serviceType={serviceItem.service_type}
|
|
777
|
+
renderIcon={renderIcon}
|
|
772
778
|
/>
|
|
773
779
|
</div>
|
|
774
780
|
</div>
|
|
@@ -3,6 +3,7 @@ import LottiePlayer from "../../assets/LottiePlayer";
|
|
|
3
3
|
import FlexibleBlock from "../FlexibleBlock";
|
|
4
4
|
import PetBlock from "../PetBlock";
|
|
5
5
|
import FemaleBlock from "../FemaleBlock";
|
|
6
|
+
import CommonService from "../../utils/CommonService";
|
|
6
7
|
|
|
7
8
|
interface ItemEntry {
|
|
8
9
|
key: string;
|
|
@@ -30,6 +31,8 @@ interface BottomAmenitiesProps {
|
|
|
30
31
|
isPeru?: boolean;
|
|
31
32
|
isTrain?: boolean;
|
|
32
33
|
isDpEnabled?: boolean;
|
|
34
|
+
serviceType?: string;
|
|
35
|
+
renderIcon?: (iconKey: string, size?: string) => React.ReactNode;
|
|
33
36
|
}
|
|
34
37
|
|
|
35
38
|
function BottomAmenities({
|
|
@@ -46,6 +49,8 @@ function BottomAmenities({
|
|
|
46
49
|
isPeru,
|
|
47
50
|
isTrain,
|
|
48
51
|
isDpEnabled,
|
|
52
|
+
serviceType,
|
|
53
|
+
renderIcon,
|
|
49
54
|
}: BottomAmenitiesProps): React.ReactElement {
|
|
50
55
|
const hasPetInfo =
|
|
51
56
|
serviceItem.pet_seat_info &&
|
|
@@ -62,7 +67,6 @@ function BottomAmenities({
|
|
|
62
67
|
<div
|
|
63
68
|
className="grid items-center gap-[2%] flex-1 "
|
|
64
69
|
style={{
|
|
65
|
-
// gridTemplateColumns: " 28% 21% 23% 23%",
|
|
66
70
|
gridTemplateColumns: isTrain
|
|
67
71
|
? "25.6% 17% 23% 23%"
|
|
68
72
|
: "25.3% 17% 23% 23%",
|
|
@@ -73,6 +77,19 @@ function BottomAmenities({
|
|
|
73
77
|
{item.render}
|
|
74
78
|
</div>
|
|
75
79
|
))}
|
|
80
|
+
{serviceType && (
|
|
81
|
+
<div
|
|
82
|
+
className={`flex items-center gap-[3px] text-[13.33px] whitespace-nowrap ${
|
|
83
|
+
isSoldOut ? "text-[#c0c0c0]" : "text-[#464647]"
|
|
84
|
+
}`}
|
|
85
|
+
style={{ gridColumn: 4 }}
|
|
86
|
+
>
|
|
87
|
+
{renderIcon?.("serviceTypeIcon", "15px")}
|
|
88
|
+
<span className="bold-text">
|
|
89
|
+
{CommonService.capitalizeFirstLetter(serviceType)}
|
|
90
|
+
</span>
|
|
91
|
+
</div>
|
|
92
|
+
)}
|
|
76
93
|
</div>
|
|
77
94
|
|
|
78
95
|
{/* PET + FLEXIBLE (always visible) */}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import LottiePlayer from "../../assets/LottiePlayer";
|
|
3
3
|
import DateService from "../../utils/DateService";
|
|
4
|
+
import commonService from "../../utils/CommonService";
|
|
4
5
|
|
|
5
6
|
interface BottomAmenitiesMobileProps {
|
|
6
7
|
isSoldOut: boolean;
|
|
@@ -65,7 +66,10 @@ function BottomAmenitiesMobile({
|
|
|
65
66
|
}: BottomAmenitiesMobileProps): React.ReactElement {
|
|
66
67
|
return (
|
|
67
68
|
<div className={`${"flex justify-between items-center items-center "}`}>
|
|
68
|
-
<div
|
|
69
|
+
<div
|
|
70
|
+
className=" flex justify-between items-center"
|
|
71
|
+
style={{ width: isPeru && serviceType ? "100%" : "55%" }}
|
|
72
|
+
>
|
|
69
73
|
<div style={{ opacity: isSoldOut ? 0.5 : 1 }}>{amenitiesNodes}</div>
|
|
70
74
|
|
|
71
75
|
<div
|
|
@@ -92,11 +96,11 @@ function BottomAmenitiesMobile({
|
|
|
92
96
|
|
|
93
97
|
{serviceType && (
|
|
94
98
|
<div
|
|
95
|
-
className="flex relative "
|
|
99
|
+
className="flex relative items-center"
|
|
96
100
|
style={{ color: isSoldOut ? "#bbb" : "text-[#464647]" }}
|
|
97
101
|
>
|
|
98
102
|
<div
|
|
99
|
-
className={`w-[12px] h-auto mr-[
|
|
103
|
+
className={`w-[12px] h-auto mr-[1px] mt-[3px] ${
|
|
100
104
|
isSoldOut ? "grayscale" : ""
|
|
101
105
|
}`}
|
|
102
106
|
>
|
|
@@ -104,12 +108,12 @@ function BottomAmenitiesMobile({
|
|
|
104
108
|
</div>
|
|
105
109
|
|
|
106
110
|
<div
|
|
107
|
-
className={`cursor-default group min-[420]:text-[13px] text-[12px] ${
|
|
111
|
+
className={`cursor-default group min-[420]:text-[13px] text-[12px] bold-text ${
|
|
108
112
|
isSoldOut ? "text-[#c0c0c0]" : ""
|
|
109
113
|
}`}
|
|
110
114
|
style={{ lineHeight: "normal" }}
|
|
111
115
|
>
|
|
112
|
-
{serviceType}
|
|
116
|
+
{commonService.capitalizeFirstLetter(serviceType)}
|
|
113
117
|
</div>
|
|
114
118
|
</div>
|
|
115
119
|
)}
|
|
@@ -119,7 +119,7 @@ const getUniqueSeats = (data: SeatType[], limit: number): SeatType[] => {
|
|
|
119
119
|
|
|
120
120
|
return Array.from(seatMap.values())
|
|
121
121
|
.sort((a, b) => a.fare - b.fare)
|
|
122
|
-
.slice(
|
|
122
|
+
.slice(2, limit);
|
|
123
123
|
};
|
|
124
124
|
|
|
125
125
|
function SeatSectionMobile({
|
|
@@ -144,7 +144,10 @@ function SeatSectionMobile({
|
|
|
144
144
|
serviceItem?.operator_service_name === "Movil Bus";
|
|
145
145
|
const hasInclination = hasInclinationSeatTypes(seatTypesData ?? []);
|
|
146
146
|
// Fetch ALL unique seats (no slice limit) for the multi-row seat-type case
|
|
147
|
-
const allUniqueSeats = getUniqueSeats(
|
|
147
|
+
const allUniqueSeats = getUniqueSeats(
|
|
148
|
+
seatTypesData ?? [],
|
|
149
|
+
Infinity as number,
|
|
150
|
+
);
|
|
148
151
|
// A service that exposes more than one seat type (e.g. "Bus Cama" + "160°")
|
|
149
152
|
// lists every type with its own fare, under a shared "Desde" heading.
|
|
150
153
|
const showSeatTypeRows =
|