kupos-ui-components-lib 10.4.46 → 10.4.48

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.
@@ -148,7 +148,7 @@ function PeruServiceItemMobile({ serviceItem, onBookButtonPress, colors, busStag
148
148
  color: isSoldOut ? "#bbb" : "text-[#464647]",
149
149
  } },
150
150
  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)),
151
- 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 }),
151
+ 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, discountSeatCrossPriceColor: colors.discountSeatCrossPriceColor, isTrain: isTrain }),
152
152
  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)),
153
153
  showLastSeats ? (React.createElement("div", { className: "flex justify-end " }, (serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.available_seats) < 10 &&
154
154
  (serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.available_seats) > 0 && (React.createElement("div", { className: "text-[10px] text-center", style: {
@@ -45,13 +45,15 @@ function getServiceDiscount(service) {
45
45
  return { type: "percentage", amount: dpPercent };
46
46
  if ((service === null || service === void 0 ? void 0 : service.discount_type) === "percentage" &&
47
47
  (service === null || service === void 0 ? void 0 : service.discount_value) != null &&
48
- service.discount_value > 0) {
48
+ service.discount_value > 0 &&
49
+ (((service === null || service === void 0 ? void 0 : service.ui_type) === 1 && (service === null || service === void 0 ? void 0 : service.offer_text)) || (service === null || service === void 0 ? void 0 : service.ui_type) === 2)) {
49
50
  return { type: "percentage", amount: Number(service.discount_value) };
50
51
  }
51
52
  if (((service === null || service === void 0 ? void 0 : service.discount_type) === "fixed" ||
52
53
  (service === null || service === void 0 ? void 0 : service.discount_type) === "fixed_price") &&
53
54
  (service === null || service === void 0 ? void 0 : service.discount_value) != null &&
54
- service.discount_value > 0) {
55
+ service.discount_value > 0 &&
56
+ (((service === null || service === void 0 ? void 0 : service.ui_type) === 1 && (service === null || service === void 0 ? void 0 : service.offer_text)) || (service === null || service === void 0 ? void 0 : service.ui_type) === 2)) {
55
57
  const rawDiscount = Number(service.discount_value);
56
58
  const { max_discount } = service;
57
59
  const amount = max_discount != null && max_discount > 0
@@ -342,10 +342,10 @@ function SeatSection({ seatTypes, availableSeats, isSoldOut, priceColor, currenc
342
342
  : `${discountValue}% OFF`)),
343
343
  (serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.ui_type) !== 1 &&
344
344
  isPeru &&
345
- (serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.discount_display_badge) && (React.createElement("span", { className: "rounded-[100px] bg-[#ff5964] px-[6px] text-[12px] bold-text leading-[20px] text-white", style: {
345
+ (serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.discount_display_badge) && (React.createElement("span", { className: "rounded-[100px] px-[6px] text-[12px] bold-text leading-[20px] text-white", style: {
346
346
  animation: "pulse-zoom 2s ease-in-out infinite",
347
347
  whiteSpace: "nowrap",
348
- backgroundColor: discountSeatCrossPriceColor,
348
+ backgroundColor: discountSeatCrossPriceColor || "#ff5964",
349
349
  } }, serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.discount_display_badge))),
350
350
  (serviceItem === null || serviceItem === void 0 ? void 0 : serviceItem.ui_type) === 1 ? null : (React.createElement("div", { className: "col-start-2 row-start-2 flex items-center justify-center ", style: { textAlign: "center" } },
351
351
  React.createElement("span", { className: "text-[13.33px] font-normal leading-[20px] relative whitespace-nowrap", style: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kupos-ui-components-lib",
3
- "version": "10.4.46",
3
+ "version": "10.4.48",
4
4
  "description": "A reusable UI components package",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -331,6 +331,7 @@ function PeruServiceItemMobile({
331
331
  serviceItem={serviceItem}
332
332
  showLastSeats={showLastSeats}
333
333
  discountSeatPriceColor={colors.discountSeatPriceColor}
334
+ discountSeatCrossPriceColor={colors.discountSeatCrossPriceColor}
334
335
  isTrain={isTrain}
335
336
  />
336
337
 
@@ -62,7 +62,8 @@ function getServiceDiscount(
62
62
  if (
63
63
  service?.discount_type === "percentage" &&
64
64
  service?.discount_value != null &&
65
- service.discount_value > 0
65
+ service.discount_value > 0 &&
66
+ ((service?.ui_type === 1 && service?.offer_text) || service?.ui_type === 2)
66
67
  ) {
67
68
  return { type: "percentage", amount: Number(service.discount_value) };
68
69
  }
@@ -71,7 +72,8 @@ function getServiceDiscount(
71
72
  (service?.discount_type === "fixed" ||
72
73
  service?.discount_type === "fixed_price") &&
73
74
  service?.discount_value != null &&
74
- service.discount_value > 0
75
+ service.discount_value > 0 &&
76
+ ((service?.ui_type === 1 && service?.offer_text) || service?.ui_type === 2)
75
77
  ) {
76
78
  const rawDiscount = Number(service.discount_value);
77
79
  const { max_discount } = service;
@@ -675,11 +675,11 @@ function SeatSection({
675
675
  isPeru &&
676
676
  serviceItem?.discount_display_badge && (
677
677
  <span
678
- className="rounded-[100px] bg-[#ff5964] px-[6px] text-[12px] bold-text leading-[20px] text-white"
678
+ className="rounded-[100px] px-[6px] text-[12px] bold-text leading-[20px] text-white"
679
679
  style={{
680
680
  animation: "pulse-zoom 2s ease-in-out infinite",
681
681
  whiteSpace: "nowrap",
682
- backgroundColor: discountSeatCrossPriceColor,
682
+ backgroundColor: discountSeatCrossPriceColor || "#ff5964",
683
683
  }}
684
684
  >
685
685
  {serviceItem?.discount_display_badge}