kupos-ui-components-lib 10.4.25 → 10.4.26
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/ServiceItemMobile.js +1 -1
- package/dist/components/ServiceItem/mobileTypes.d.ts +1 -0
- package/dist/ui/mobileweb/DateTimeSectionMobile.d.ts +2 -1
- package/dist/ui/mobileweb/DateTimeSectionMobile.js +2 -2
- package/dist/ui/mobileweb/SeatSectionMobile.d.ts +2 -1
- package/dist/ui/mobileweb/SeatSectionMobile.js +2 -2
- package/package.json +1 -1
- package/src/components/ServiceItem/ServiceItemMobile.tsx +1 -0
- package/src/components/ServiceItem/mobileTypes.ts +1 -0
- package/src/ui/mobileweb/DateTimeSectionMobile.tsx +3 -0
- package/src/ui/mobileweb/SeatSectionMobile.tsx +3 -2
|
@@ -154,7 +154,7 @@ function ServiceItemMobile({ serviceItem, onBookButtonPress, colors, busStage, o
|
|
|
154
154
|
color: isSoldOut ? "#bbb" : "text-[#464647]",
|
|
155
155
|
} },
|
|
156
156
|
React.createElement("span", { className: "ml-[3px] min-[420]:text-[13px] text-[12px] text-ellipsis overflow-hidden whitespace-nowrap max-w-[120px]" }, serviceItem.operator_details[2]))))) : null)),
|
|
157
|
-
React.createElement(DateTimeSectionMobile, { onBookButtonPress: onBookButtonPress, isCiva: isCiva, isSoldOut: isSoldOut, isLinatal: isLinatal, isPeru: isPeru, orignLabel: orignLabel, destinationLabel: destinationLabel, originIcon: (_g = serviceItem.icons) === null || _g === void 0 ? void 0 : _g.origin, destinationIcon: (_h = serviceItem.icons) === null || _h === void 0 ? void 0 : _h.destination, travelDate: serviceItem.travel_date, arrivalDate: serviceItem.arrival_date, depTime: serviceItem.dep_time, arrTime: serviceItem.arr_time, seatTypes: serviceItem.seat_types, seatPriceColor: colors.seatPriceColor, tooltipBgColor: colors.tooltipBgColor, currencySign: currencySign, availableSeats: serviceItem.available_seats, removeDuplicateSeats: removeDuplicateSeats, serviceItem: serviceItem, showLastSeats: showLastSeats, discountSeatPriceColor: colors.discountSeatPriceColor, isTrain: isTrain }),
|
|
157
|
+
React.createElement(DateTimeSectionMobile, { onBookButtonPress: onBookButtonPress, isCiva: isCiva, isSoldOut: isSoldOut, isLinatal: isLinatal, isPeru: isPeru, orignLabel: orignLabel, destinationLabel: destinationLabel, originIcon: (_g = serviceItem.icons) === null || _g === void 0 ? void 0 : _g.origin, destinationIcon: (_h = serviceItem.icons) === null || _h === void 0 ? void 0 : _h.destination, travelDate: serviceItem.travel_date, arrivalDate: serviceItem.arrival_date, depTime: serviceItem.dep_time, arrTime: serviceItem.arr_time, seatTypes: serviceItem.seat_types, seatPriceColor: colors.seatPriceColor, tooltipBgColor: colors.tooltipBgColor, currencySign: currencySign, availableSeats: serviceItem.available_seats, removeDuplicateSeats: removeDuplicateSeats, serviceItem: serviceItem, showLastSeats: showLastSeats, discountSeatPriceColor: colors.discountSeatPriceColor, isTrain: isTrain, discountSeatCrossPriceColor: colors.discountSeatCrossPriceColor }),
|
|
158
158
|
hasDiscount && (React.createElement("div", { className: "flex justify-end" }, isSoldOut ? (React.createElement("span", { className: "col-span-2 min-[420]:text-[13px] text-right text-[12px] text-[#ccc]" }, "Agotado")) : null)),
|
|
159
159
|
showLastSeats ? (React.createElement("div", { className: "flex justify-end " }, (serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.available_seats) < 10 &&
|
|
160
160
|
(serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.available_seats) > 0 && (React.createElement("div", { className: "text-[10px] text-center", style: {
|
|
@@ -197,6 +197,7 @@ export interface MobileServiceItemProps {
|
|
|
197
197
|
tooltipBgColor?: string;
|
|
198
198
|
lastSeatText?: string;
|
|
199
199
|
lastSeatBg?: string;
|
|
200
|
+
discountSeatCrossPriceColor?: string;
|
|
200
201
|
seatPriceColor?: string;
|
|
201
202
|
rightGradiantColor?: string;
|
|
202
203
|
leftGradiantColor?: string;
|
|
@@ -23,6 +23,7 @@ interface DateTimeSectionMobileProps {
|
|
|
23
23
|
showLastSeats?: boolean;
|
|
24
24
|
discountSeatPriceColor?: string;
|
|
25
25
|
isTrain?: boolean;
|
|
26
|
+
discountSeatCrossPriceColor?: string;
|
|
26
27
|
}
|
|
27
|
-
declare function DateTimeSectionMobile({ onBookButtonPress, isCiva, isSoldOut, isLinatal, isPeru, orignLabel, destinationLabel, originIcon, destinationIcon, travelDate, arrivalDate, depTime, arrTime, seatTypes, seatPriceColor, currencySign, availableSeats, removeDuplicateSeats, serviceItem, tooltipBgColor, showLastSeats, discountSeatPriceColor, isTrain, }: DateTimeSectionMobileProps): React.ReactElement;
|
|
28
|
+
declare function DateTimeSectionMobile({ onBookButtonPress, isCiva, isSoldOut, isLinatal, isPeru, orignLabel, destinationLabel, originIcon, destinationIcon, travelDate, arrivalDate, depTime, arrTime, seatTypes, seatPriceColor, currencySign, availableSeats, removeDuplicateSeats, serviceItem, tooltipBgColor, showLastSeats, discountSeatPriceColor, isTrain, discountSeatCrossPriceColor, }: DateTimeSectionMobileProps): React.ReactElement;
|
|
28
29
|
export default DateTimeSectionMobile;
|
|
@@ -37,7 +37,7 @@ const TimeRow = ({ label, icon, alt, date, timeContent, isSoldOut, }) => {
|
|
|
37
37
|
React.createElement("div", { className: `absolute left-[50%] ${dotPositionClass}` }, "\u2022"),
|
|
38
38
|
React.createElement("div", { className: "font-[900] relative black-text whitespace-nowrap" }, timeContent)))));
|
|
39
39
|
};
|
|
40
|
-
function DateTimeSectionMobile({ onBookButtonPress, isCiva, isSoldOut, isLinatal, isPeru, orignLabel, destinationLabel, originIcon, destinationIcon, travelDate, arrivalDate, depTime, arrTime, seatTypes, seatPriceColor, currencySign, availableSeats, removeDuplicateSeats, serviceItem, tooltipBgColor, showLastSeats, discountSeatPriceColor, isTrain, }) {
|
|
40
|
+
function DateTimeSectionMobile({ onBookButtonPress, isCiva, isSoldOut, isLinatal, isPeru, orignLabel, destinationLabel, originIcon, destinationIcon, travelDate, arrivalDate, depTime, arrTime, seatTypes, seatPriceColor, currencySign, availableSeats, removeDuplicateSeats, serviceItem, tooltipBgColor, showLastSeats, discountSeatPriceColor, isTrain, discountSeatCrossPriceColor, }) {
|
|
41
41
|
const { cleaned: cleanedDepTime, hasAM, hasPM } = getCleanedDepTime(depTime);
|
|
42
42
|
const depTimeContent = isLinatal ? (React.createElement("div", null,
|
|
43
43
|
React.createElement("span", null,
|
|
@@ -62,6 +62,6 @@ function DateTimeSectionMobile({ onBookButtonPress, isCiva, isSoldOut, isLinatal
|
|
|
62
62
|
backgroundColor: "#ccc",
|
|
63
63
|
margin: "auto",
|
|
64
64
|
} }),
|
|
65
|
-
React.createElement(SeatSectionMobile, { seatTypes: seatTypes, isSoldOut: isSoldOut, isPeru: isPeru, seatPriceColor: seatPriceColor, currencySign: currencySign, availableSeats: availableSeats, removeDuplicateSeats: removeDuplicateSeats, serviceItem: serviceItem, tooltipBgColor: tooltipBgColor, showLastSeats: showLastSeats, discountSeatPriceColor: discountSeatPriceColor, isTrain: isTrain })));
|
|
65
|
+
React.createElement(SeatSectionMobile, { seatTypes: seatTypes, isSoldOut: isSoldOut, isPeru: isPeru, seatPriceColor: seatPriceColor, currencySign: currencySign, availableSeats: availableSeats, removeDuplicateSeats: removeDuplicateSeats, serviceItem: serviceItem, tooltipBgColor: tooltipBgColor, showLastSeats: showLastSeats, discountSeatPriceColor: discountSeatPriceColor, isTrain: isTrain, discountSeatCrossPriceColor: discountSeatCrossPriceColor })));
|
|
66
66
|
}
|
|
67
67
|
export default DateTimeSectionMobile;
|
|
@@ -18,6 +18,7 @@ interface SeatSectionMobileProps {
|
|
|
18
18
|
showLastSeats?: boolean;
|
|
19
19
|
discountSeatPriceColor?: string;
|
|
20
20
|
isTrain?: boolean;
|
|
21
|
+
discountSeatCrossPriceColor?: string;
|
|
21
22
|
}
|
|
22
|
-
declare function SeatSectionMobile({ seatTypes: seatTypesData, isSoldOut, isPeru, seatPriceColor, currencySign, availableSeats, removeDuplicateSeats, serviceItem, tooltipBgColor, showLastSeats, discountSeatPriceColor, isTrain, }: SeatSectionMobileProps): React.ReactElement;
|
|
23
|
+
declare function SeatSectionMobile({ seatTypes: seatTypesData, isSoldOut, isPeru, seatPriceColor, currencySign, availableSeats, removeDuplicateSeats, serviceItem, tooltipBgColor, showLastSeats, discountSeatPriceColor, isTrain, discountSeatCrossPriceColor, }: SeatSectionMobileProps): React.ReactElement;
|
|
23
24
|
export default SeatSectionMobile;
|
|
@@ -47,7 +47,7 @@ const getUniqueSeats = (data, limit) => {
|
|
|
47
47
|
.sort((a, b) => a.fare - b.fare)
|
|
48
48
|
.slice(0, limit);
|
|
49
49
|
};
|
|
50
|
-
function SeatSectionMobile({ seatTypes: seatTypesData, isSoldOut, isPeru, seatPriceColor, currencySign, availableSeats, removeDuplicateSeats, serviceItem, tooltipBgColor, showLastSeats, discountSeatPriceColor, isTrain, }) {
|
|
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;
|
|
52
52
|
const hasMultipleTypes = ((_a = seatTypesData === null || seatTypesData === void 0 ? void 0 : seatTypesData.length) !== null && _a !== void 0 ? _a : 0) > 2;
|
|
53
53
|
const getFare = (fare) => {
|
|
@@ -270,7 +270,7 @@ function SeatSectionMobile({ seatTypes: seatTypesData, isSoldOut, isPeru, seatPr
|
|
|
270
270
|
left: "50%",
|
|
271
271
|
width: "80%",
|
|
272
272
|
height: "1px",
|
|
273
|
-
background:
|
|
273
|
+
background: discountSeatCrossPriceColor,
|
|
274
274
|
transform: "rotate(-12deg)",
|
|
275
275
|
transformOrigin: "center",
|
|
276
276
|
} })))),
|
package/package.json
CHANGED
|
@@ -26,6 +26,7 @@ interface DateTimeSectionMobileProps {
|
|
|
26
26
|
showLastSeats?: boolean;
|
|
27
27
|
discountSeatPriceColor?: string;
|
|
28
28
|
isTrain?: boolean;
|
|
29
|
+
discountSeatCrossPriceColor?: string;
|
|
29
30
|
}
|
|
30
31
|
|
|
31
32
|
const pad = (n: number) => (n < 10 ? "0" + n : String(n));
|
|
@@ -135,6 +136,7 @@ function DateTimeSectionMobile({
|
|
|
135
136
|
showLastSeats,
|
|
136
137
|
discountSeatPriceColor,
|
|
137
138
|
isTrain,
|
|
139
|
+
discountSeatCrossPriceColor,
|
|
138
140
|
}: DateTimeSectionMobileProps): React.ReactElement {
|
|
139
141
|
const { cleaned: cleanedDepTime, hasAM, hasPM } = getCleanedDepTime(depTime);
|
|
140
142
|
|
|
@@ -211,6 +213,7 @@ function DateTimeSectionMobile({
|
|
|
211
213
|
showLastSeats={showLastSeats}
|
|
212
214
|
discountSeatPriceColor={discountSeatPriceColor}
|
|
213
215
|
isTrain={isTrain}
|
|
216
|
+
discountSeatCrossPriceColor={discountSeatCrossPriceColor}
|
|
214
217
|
/>
|
|
215
218
|
</div>
|
|
216
219
|
);
|
|
@@ -33,6 +33,7 @@ interface SeatSectionMobileProps {
|
|
|
33
33
|
showLastSeats?: boolean;
|
|
34
34
|
discountSeatPriceColor?: string;
|
|
35
35
|
isTrain?: boolean;
|
|
36
|
+
discountSeatCrossPriceColor?: string;
|
|
36
37
|
}
|
|
37
38
|
|
|
38
39
|
interface SeatRowProps {
|
|
@@ -132,6 +133,7 @@ function SeatSectionMobile({
|
|
|
132
133
|
showLastSeats,
|
|
133
134
|
discountSeatPriceColor,
|
|
134
135
|
isTrain,
|
|
136
|
+
discountSeatCrossPriceColor,
|
|
135
137
|
}: SeatSectionMobileProps): React.ReactElement {
|
|
136
138
|
const hasMultipleTypes = (seatTypesData?.length ?? 0) > 2;
|
|
137
139
|
|
|
@@ -244,7 +246,6 @@ function SeatSectionMobile({
|
|
|
244
246
|
);
|
|
245
247
|
}
|
|
246
248
|
|
|
247
|
-
|
|
248
249
|
const { originalPrice, discountedPrice } =
|
|
249
250
|
commonService.calculateDiscountedPrice(lowestFare, serviceItem);
|
|
250
251
|
|
|
@@ -639,7 +640,7 @@ function SeatSectionMobile({
|
|
|
639
640
|
left: "50%",
|
|
640
641
|
width: "80%",
|
|
641
642
|
height: "1px",
|
|
642
|
-
background:
|
|
643
|
+
background: discountSeatCrossPriceColor,
|
|
643
644
|
transform: "rotate(-12deg)",
|
|
644
645
|
transformOrigin: "center",
|
|
645
646
|
}}
|