kupos-ui-components-lib 10.4.42 → 10.4.43
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/assets/images/directo-icon.png +0 -0
- package/dist/components/ServiceItem/ServiceItemDesktop.js +8 -0
- package/dist/components/ServiceItem/ServiceItemMobile.js +2 -2
- package/dist/components/ServiceItem/mobileTypes.d.ts +2 -0
- package/dist/components/ServiceItem/types.d.ts +1 -0
- package/dist/ui/ServiceType.d.ts +9 -0
- package/dist/ui/ServiceType.js +9 -0
- package/dist/ui/mobileweb/BottomAmenitiesMobile.d.ts +4 -1
- package/dist/ui/mobileweb/BottomAmenitiesMobile.js +6 -2
- package/package.json +1 -1
- package/src/components/ServiceItem/ServiceItemDesktop.tsx +14 -0
- package/src/components/ServiceItem/ServiceItemMobile.tsx +2 -0
- package/src/components/ServiceItem/mobileTypes.ts +2 -0
- package/src/components/ServiceItem/types.ts +1 -0
- package/src/ui/mobileweb/BottomAmenitiesMobile.tsx +30 -0
|
Binary file
|
|
@@ -297,6 +297,14 @@ function ServiceItemPB({ serviceItem, onBookButtonPress, colors, metaData, child
|
|
|
297
297
|
Object.keys(serviceItem.pet_seat_info).length > 0,
|
|
298
298
|
render: (React.createElement(PetBlock, { translation: translation, getAnimationIcon: getAnimationIcon, colors: colors, isSoldOut: isSoldOut })),
|
|
299
299
|
},
|
|
300
|
+
{
|
|
301
|
+
key: "servicetype",
|
|
302
|
+
width: "20%",
|
|
303
|
+
condition: serviceItem.service_type,
|
|
304
|
+
render: (React.createElement("div", { className: "mt-[4px]" },
|
|
305
|
+
renderIcon("serviceTypeIcon", "12px"),
|
|
306
|
+
React.createElement("span", { className: "group text-[13.33px] cursor-pointer ml-[3px] " }, serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.service_type))),
|
|
307
|
+
},
|
|
300
308
|
{
|
|
301
309
|
key: "flexible",
|
|
302
310
|
width: "20%",
|
|
@@ -161,9 +161,9 @@ function ServiceItemMobile({ serviceItem, onBookButtonPress, colors, busStage, o
|
|
|
161
161
|
color: colors.tooltipBgColor,
|
|
162
162
|
} }, "\u00A1\u00DAltimos Asientos!")))) : null,
|
|
163
163
|
React.createElement("div", { className: "bg-[#E6E6E6] mt-[10px] mb-[8px] h-[1px]" }),
|
|
164
|
-
React.createElement(BottomAmenitiesMobile, { isSoldOut: isSoldOut, amenitiesNodes: amenities(), hoursIcon: renderIcon("hours", "14px"), duration: (_j = serviceItem.duration) === null || _j === void 0 ? void 0 : _j.toString(), isDirectTrip: serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.is_direct_trip, directoColor: colors.directoColor, directoAnim: serviceItem.icons.directoAnim, isChangeTicket: serviceItem.is_change_ticket, isPetSeat: isPetSeat, petSeatInfo: serviceItem.pet_seat_info, petFriendlyAnim: serviceItem.icons.petFriendlyAnim, flexibleAnim: serviceItem.icons.flexibleAnim, isTrackingEnabled: serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.is_tracking_enabled, locationAnim: serviceItem.icons.locationAnim, downArrowIcon: serviceItem.icons.downArrow, showDropdown: isItemExpanded, setShowDropdown: () => setIsExpanded(isItemExpanded ? null : serviceItem.id), onDropdownToggle: () => {
|
|
164
|
+
React.createElement(BottomAmenitiesMobile, { isSoldOut: isSoldOut, amenitiesNodes: amenities(), hoursIcon: renderIcon("hours", "14px"), duration: (_j = serviceItem.duration) === null || _j === void 0 ? void 0 : _j.toString(), isDirectTrip: serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.is_direct_trip, serviceType: serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.service_type, directoColor: colors.directoColor, directoAnim: serviceItem.icons.directoAnim, isChangeTicket: serviceItem.is_change_ticket, isPetSeat: isPetSeat, petSeatInfo: serviceItem.pet_seat_info, petFriendlyAnim: serviceItem.icons.petFriendlyAnim, flexibleAnim: serviceItem.icons.flexibleAnim, isTrackingEnabled: serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.is_tracking_enabled, locationAnim: serviceItem.icons.locationAnim, downArrowIcon: serviceItem.icons.downArrow, showDropdown: isItemExpanded, setShowDropdown: () => setIsExpanded(isItemExpanded ? null : serviceItem.id), onDropdownToggle: () => {
|
|
165
165
|
setIsExpanded(isItemExpanded ? null : serviceItem.id);
|
|
166
|
-
}, isPeru: isPeru, femaleAnim: serviceItem.icons.femaleAnim, ladiesBookedSeats: serviceItem.ladies_booked_seats, isDpEnabled: serviceItem.is_dp_enabled, isTrain: isTrain })),
|
|
166
|
+
}, isPeru: isPeru, femaleAnim: serviceItem.icons.femaleAnim, ladiesBookedSeats: serviceItem.ladies_booked_seats, isDpEnabled: serviceItem.is_dp_enabled, isTrain: isTrain, renderIcon: renderIcon })),
|
|
167
167
|
React.createElement(ServiceBadgesMobile, { showTopLabel: showTopLabel || undefined, isSoldOut: isSoldOut, colors: colors, renderIcon: renderIcon, serviceItem: serviceItem, isConexion: isConexion, isAllinBus: isAllinBus, boardingName: boardingName })),
|
|
168
168
|
hasOfferText &&
|
|
169
169
|
isNewUiEnabled &&
|
|
@@ -3,6 +3,7 @@ export interface MobileServiceItemProps {
|
|
|
3
3
|
amenitiesData?: any;
|
|
4
4
|
serviceItem: {
|
|
5
5
|
id: string;
|
|
6
|
+
service_type?: string;
|
|
6
7
|
is_transpordo?: boolean;
|
|
7
8
|
operator_details: [
|
|
8
9
|
string,
|
|
@@ -102,6 +103,7 @@ export interface MobileServiceItemProps {
|
|
|
102
103
|
airConditionIcon?: string;
|
|
103
104
|
baggageIcon?: string;
|
|
104
105
|
chargingIcon?: string;
|
|
106
|
+
serviceTypeIcon?: string;
|
|
105
107
|
coffeeIcon?: string;
|
|
106
108
|
foodIcon?: string;
|
|
107
109
|
gamingIcon?: string;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
declare const ServiceType: ({ serviceItem, translation, renderIcon, isSoldOut, colors, }: {
|
|
3
|
+
serviceItem: any;
|
|
4
|
+
translation: any;
|
|
5
|
+
renderIcon: any;
|
|
6
|
+
isSoldOut: any;
|
|
7
|
+
colors: any;
|
|
8
|
+
}) => React.JSX.Element;
|
|
9
|
+
export default ServiceType;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
const ServiceType = ({ serviceItem, translation, renderIcon, isSoldOut, colors, }) => (React.createElement("div", { className: "flex items-baseline relative whitespace-nowrap " },
|
|
3
|
+
React.createElement("div", { className: `w-[18px] mr-[4px] ${isSoldOut ? "grayscale" : ""}`, style: { opacity: isSoldOut ? 0.5 : 1 } }),
|
|
4
|
+
React.createElement("div", { className: "group text-[13.33px] cursor-pointer" },
|
|
5
|
+
React.createElement("span", { style: { opacity: isSoldOut ? 0.5 : 1 } }, serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.service_type),
|
|
6
|
+
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-[188px] text-center break-normal shadow-service text-[12px]", style: { backgroundColor: colors.bottomStripColor } },
|
|
7
|
+
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.bottomStripColor } }),
|
|
8
|
+
"Duraci\u00F3n estimada del viaje"))));
|
|
9
|
+
export default ServiceType;
|
|
@@ -25,6 +25,9 @@ interface BottomAmenitiesMobileProps {
|
|
|
25
25
|
isDpEnabled?: boolean;
|
|
26
26
|
isTrain?: boolean;
|
|
27
27
|
seatCategoryText?: string;
|
|
28
|
+
serviceType?: string;
|
|
29
|
+
serviceTypeIcon?: string;
|
|
30
|
+
renderIcon?: any;
|
|
28
31
|
}
|
|
29
|
-
declare 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, }: BottomAmenitiesMobileProps): React.ReactElement;
|
|
32
|
+
declare 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, }: BottomAmenitiesMobileProps): React.ReactElement;
|
|
30
33
|
export default BottomAmenitiesMobile;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import LottiePlayer from "../../assets/LottiePlayer";
|
|
3
3
|
import DateService from "../../utils/DateService";
|
|
4
|
-
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, }) {
|
|
4
|
+
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
5
|
return (React.createElement("div", { className: `${"flex justify-between items-center items-center "}` },
|
|
6
6
|
React.createElement("div", { className: "w-[55%] flex justify-between items-center" },
|
|
7
7
|
React.createElement("div", { style: { opacity: isSoldOut ? 0.5 : 1 } }, amenitiesNodes),
|
|
@@ -10,7 +10,11 @@ function BottomAmenitiesMobile({ isSoldOut, amenitiesNodes, hoursIcon, duration,
|
|
|
10
10
|
"\u00A0",
|
|
11
11
|
React.createElement("div", { className: `cursor-default group min-[420]:text-[13px] text-[12px] ${isSoldOut ? "text-[#c0c0c0]" : ""}`, style: { lineHeight: "normal" } },
|
|
12
12
|
DateService.formatDuration(duration),
|
|
13
|
-
"hrs"))
|
|
13
|
+
"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-[2px] ${isSoldOut ? "grayscale" : ""}` }, renderIcon("serviceTypeIcon", "12px")),
|
|
16
|
+
"\u00A0",
|
|
17
|
+
React.createElement("div", { className: `cursor-default group min-[420]:text-[13px] text-[12px] ${isSoldOut ? "text-[#c0c0c0]" : ""}`, style: { lineHeight: "normal" } }, serviceType)))),
|
|
14
18
|
seatCategoryText && (React.createElement("div", { className: "flex-1 text-right whitespace-nowrap min-[420]:text-[13px] text-[12px]", style: { opacity: isSoldOut ? 0.5 : 1 } }, seatCategoryText)),
|
|
15
19
|
React.createElement("div", { className: "flex items-center" },
|
|
16
20
|
React.createElement("div", null, (isChangeTicket || isPetSeat) && (React.createElement("div", { className: "flex items-center" },
|
package/package.json
CHANGED
|
@@ -462,6 +462,20 @@ function ServiceItemPB({
|
|
|
462
462
|
),
|
|
463
463
|
},
|
|
464
464
|
|
|
465
|
+
{
|
|
466
|
+
key: "servicetype",
|
|
467
|
+
width: "20%",
|
|
468
|
+
condition: serviceItem.service_type,
|
|
469
|
+
render: (
|
|
470
|
+
<div className="mt-[4px]">
|
|
471
|
+
{renderIcon("serviceTypeIcon", "12px")}
|
|
472
|
+
<span className="group text-[13.33px] cursor-pointer ml-[3px] ">
|
|
473
|
+
{serviceItem?.service_type}
|
|
474
|
+
</span>
|
|
475
|
+
</div>
|
|
476
|
+
),
|
|
477
|
+
},
|
|
478
|
+
|
|
465
479
|
{
|
|
466
480
|
key: "flexible",
|
|
467
481
|
width: "20%",
|
|
@@ -432,6 +432,7 @@ function ServiceItemMobile({
|
|
|
432
432
|
hoursIcon={renderIcon("hours", "14px")}
|
|
433
433
|
duration={serviceItem.duration?.toString()}
|
|
434
434
|
isDirectTrip={serviceItem?.is_direct_trip}
|
|
435
|
+
serviceType={serviceItem?.service_type}
|
|
435
436
|
directoColor={colors.directoColor}
|
|
436
437
|
directoAnim={serviceItem.icons.directoAnim}
|
|
437
438
|
isChangeTicket={serviceItem.is_change_ticket}
|
|
@@ -454,6 +455,7 @@ function ServiceItemMobile({
|
|
|
454
455
|
ladiesBookedSeats={serviceItem.ladies_booked_seats}
|
|
455
456
|
isDpEnabled={serviceItem.is_dp_enabled}
|
|
456
457
|
isTrain={isTrain}
|
|
458
|
+
renderIcon={renderIcon}
|
|
457
459
|
/>
|
|
458
460
|
</div>
|
|
459
461
|
|
|
@@ -6,6 +6,7 @@ export interface MobileServiceItemProps {
|
|
|
6
6
|
amenitiesData?: any;
|
|
7
7
|
serviceItem: {
|
|
8
8
|
id: string;
|
|
9
|
+
service_type?: string;
|
|
9
10
|
is_transpordo?: boolean;
|
|
10
11
|
operator_details: [
|
|
11
12
|
string,
|
|
@@ -105,6 +106,7 @@ export interface MobileServiceItemProps {
|
|
|
105
106
|
airConditionIcon?: string;
|
|
106
107
|
baggageIcon?: string;
|
|
107
108
|
chargingIcon?: string;
|
|
109
|
+
serviceTypeIcon?: string;
|
|
108
110
|
coffeeIcon?: string;
|
|
109
111
|
foodIcon?: string;
|
|
110
112
|
gamingIcon?: string;
|
|
@@ -28,6 +28,9 @@ interface BottomAmenitiesMobileProps {
|
|
|
28
28
|
isDpEnabled?: boolean;
|
|
29
29
|
isTrain?: boolean;
|
|
30
30
|
seatCategoryText?: string;
|
|
31
|
+
serviceType?: string;
|
|
32
|
+
serviceTypeIcon?: string;
|
|
33
|
+
renderIcon?: any;
|
|
31
34
|
}
|
|
32
35
|
|
|
33
36
|
function BottomAmenitiesMobile({
|
|
@@ -56,6 +59,9 @@ function BottomAmenitiesMobile({
|
|
|
56
59
|
isDpEnabled,
|
|
57
60
|
isTrain,
|
|
58
61
|
seatCategoryText,
|
|
62
|
+
serviceType,
|
|
63
|
+
serviceTypeIcon,
|
|
64
|
+
renderIcon,
|
|
59
65
|
}: BottomAmenitiesMobileProps): React.ReactElement {
|
|
60
66
|
return (
|
|
61
67
|
<div className={`${"flex justify-between items-center items-center "}`}>
|
|
@@ -84,6 +90,30 @@ function BottomAmenitiesMobile({
|
|
|
84
90
|
</div>
|
|
85
91
|
</div>
|
|
86
92
|
|
|
93
|
+
{serviceType && (
|
|
94
|
+
<div
|
|
95
|
+
className="flex relative "
|
|
96
|
+
style={{ color: isSoldOut ? "#bbb" : "text-[#464647]" }}
|
|
97
|
+
>
|
|
98
|
+
<div
|
|
99
|
+
className={`w-[12px] h-auto mr-[2px] ${
|
|
100
|
+
isSoldOut ? "grayscale" : ""
|
|
101
|
+
}`}
|
|
102
|
+
>
|
|
103
|
+
{renderIcon("serviceTypeIcon", "12px")}
|
|
104
|
+
</div>
|
|
105
|
+
|
|
106
|
+
<div
|
|
107
|
+
className={`cursor-default group min-[420]:text-[13px] text-[12px] ${
|
|
108
|
+
isSoldOut ? "text-[#c0c0c0]" : ""
|
|
109
|
+
}`}
|
|
110
|
+
style={{ lineHeight: "normal" }}
|
|
111
|
+
>
|
|
112
|
+
{serviceType}
|
|
113
|
+
</div>
|
|
114
|
+
</div>
|
|
115
|
+
)}
|
|
116
|
+
|
|
87
117
|
{/* {isDirectTrip && (
|
|
88
118
|
<div
|
|
89
119
|
className={`flex items-center gap-[2px] text-white min-[420]:text-[12px] text-[10px] z-20 `}
|