kupos-ui-components-lib 10.4.13 → 10.4.15

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.
Files changed (56) hide show
  1. package/dist/assets/images/anims/service_list/60_percent_anim.json +1 -0
  2. package/dist/assets/images/filter/arrow-down.png +0 -0
  3. package/dist/assets/images/filter/rapido.svg +14 -0
  4. package/dist/components/FilterSortBar/FilterChip.d.ts +6 -2
  5. package/dist/components/FilterSortBar/FilterChip.js +10 -32
  6. package/dist/components/FilterSortBar/FilterSortBarMobile.d.ts +1 -1
  7. package/dist/components/FilterSortBar/FilterSortBarMobile.js +86 -38
  8. package/dist/components/FilterSortBar/FiltersMasterSheet.d.ts +3 -1
  9. package/dist/components/FilterSortBar/FiltersMasterSheet.js +28 -97
  10. package/dist/components/FilterSortBar/OptionCheckboxList.js +5 -16
  11. package/dist/components/FilterSortBar/PriceRangeSlider.js +17 -55
  12. package/dist/components/FilterSortBar/SheetFooter.js +3 -30
  13. package/dist/components/FilterSortBar/defaultIcons.js +9 -0
  14. package/dist/components/FilterSortBar/icons.d.ts +7 -0
  15. package/dist/components/FilterSortBar/icons.js +8 -1
  16. package/dist/components/FilterSortBar/index.d.ts +1 -1
  17. package/dist/components/FilterSortBar/types.d.ts +34 -0
  18. package/dist/components/PaymentOptions/PaymentOptionsDesktop.d.ts +4 -0
  19. package/dist/components/PaymentOptions/PaymentOptionsDesktop.js +5 -0
  20. package/dist/components/PaymentOptions/PaymentOptionsMobile.d.ts +4 -0
  21. package/dist/components/PaymentOptions/PaymentOptionsMobile.js +5 -0
  22. package/dist/components/PaymentOptions/ResponsivePaymentOptions.d.ts +3 -0
  23. package/dist/components/PaymentOptions/ResponsivePaymentOptions.js +10 -0
  24. package/dist/components/PaymentOptions/index.d.ts +5 -0
  25. package/dist/components/PaymentOptions/index.js +4 -0
  26. package/dist/components/PaymentOptions/mobileTypes.d.ts +0 -0
  27. package/dist/components/PaymentOptions/mobileTypes.js +0 -0
  28. package/dist/components/PaymentOptions/type.d.ts +4 -0
  29. package/dist/components/PaymentOptions/type.js +1 -0
  30. package/dist/components/PaymentSideBar/PaymentSideBarMobile.js +1 -1
  31. package/dist/components/ServiceItem/ExpandedDropdown.d.ts +19 -0
  32. package/dist/components/ServiceItem/ExpandedDropdown.js +28 -0
  33. package/dist/components/ServiceItem/ServiceItemDesktopPeru.d.ts +6 -0
  34. package/dist/components/ServiceItem/ServiceItemDesktopPeru.js +612 -0
  35. package/dist/index.d.ts +1 -1
  36. package/dist/styles.css +233 -0
  37. package/dist/ui/PaymentCardMobile/PaymentCardMobile.js +40 -51
  38. package/dist/ui/TopAmenities/PromoCountdown.d.ts +18 -0
  39. package/dist/ui/TopAmenities/PromoCountdown.js +55 -0
  40. package/package.json +2 -2
  41. package/src/assets/images/filter/arrow-down.png +0 -0
  42. package/src/assets/images/filter/rapido.svg +14 -0
  43. package/src/components/FilterSortBar/FilterChip.tsx +31 -35
  44. package/src/components/FilterSortBar/FilterSortBarMobile.tsx +122 -66
  45. package/src/components/FilterSortBar/FiltersMasterSheet.tsx +34 -118
  46. package/src/components/FilterSortBar/OptionCheckboxList.tsx +5 -16
  47. package/src/components/FilterSortBar/PriceRangeSlider.tsx +20 -61
  48. package/src/components/FilterSortBar/SheetFooter.tsx +4 -32
  49. package/src/components/FilterSortBar/defaultIcons.ts +11 -0
  50. package/src/components/FilterSortBar/icons.tsx +38 -2
  51. package/src/components/FilterSortBar/index.ts +2 -0
  52. package/src/components/FilterSortBar/types.ts +36 -0
  53. package/src/components/PaymentSideBar/PaymentSideBarMobile.tsx +4 -1
  54. package/src/index.ts +2 -0
  55. package/src/ui/PaymentCardMobile/PaymentCardMobile.tsx +136 -98
  56. package/src/components/FilterSortBar/SingleFilterSheet.tsx +0 -82
@@ -17,8 +17,8 @@ class ModalTabStateWrapper extends React.Component {
17
17
  }
18
18
  }
19
19
  export const PaymentCardMobile = (props) => {
20
- const { serviceNameOnward, serviceNameReturn, currencySign, dateOnward, dateReturn, sourceOnward, sourceReturn, destinationOnward, destinationReturn, boardingStageOnward, boardingStageReturn, droppingStageOnward, droppingStageReturn, boardingTimeOnward, boardingTimeReturn, droppingTimeOnward, droppingTimeReturn, durationOnward, durationReturn, selectSeatOnward, selectSeatReturn, journeyTypeActive, setJourneyTypeActive, translation, trainTypeOnward, trainTypeReturn, colors, trainType, icons, selectedOnward, selectedReturn, removeDiscountAtomValue, netFare, promoCode, onPromoRemove, renderDiscount, discountAmount, currency, insuranceData, isPeru, showDetails = false, setShowDetails, } = props;
21
- console.log("🚀 ~ PaymentCardMobile ~ selectSeatOnward:", selectSeatOnward);
20
+ var _a, _b;
21
+ const { serviceNameOnward, serviceNameReturn, currencySign, dateOnward, dateReturn, sourceOnward, sourceReturn, destinationOnward, destinationReturn, boardingStageOnward, boardingStageReturn, droppingStageOnward, droppingStageReturn, boardingTimeOnward, boardingTimeReturn, droppingTimeOnward, droppingTimeReturn, durationOnward, durationReturn, selectSeatOnward, selectSeatReturn, journeyTypeActive, setJourneyTypeActive, translation, trainTypeOnward, trainTypeReturn, colors, trainType, icons, selectedOnward, selectedReturn, removeDiscountAtomValue, netFare, promoCode, onPromoRemove, renderDiscount, discountAmount, currency, insuranceData, isPeru, walletMoney, walletLabel, virtualMoney, virtualLimit, creditosLabel, showDetails = false, setShowDetails, } = props;
22
22
  // We use a Class component wrapper below to hold the state,
23
23
  // avoiding Invalid Hook Call issues when linked in external apps with multiple React instances.
24
24
  // These will be derived inside the render prop of ModalTabStateWrapper
@@ -32,8 +32,8 @@ export const PaymentCardMobile = (props) => {
32
32
  ? droppingStageReturn
33
33
  : droppingStageOnward;
34
34
  const activeDroppingTime = isReturn ? droppingTimeReturn : droppingTimeOnward;
35
- const activeSource = isReturn ? sourceReturn : sourceOnward;
36
- const activeDest = isReturn ? destinationReturn : destinationOnward;
35
+ const activeSource = (_a = (isReturn ? sourceReturn : sourceOnward)) === null || _a === void 0 ? void 0 : _a.replace(/,\s*/g, ", ");
36
+ const activeDest = (_b = (isReturn ? destinationReturn : destinationOnward)) === null || _b === void 0 ? void 0 : _b.replace(/,\s*/g, ", ");
37
37
  const activeServiceName = isReturn ? serviceNameReturn : serviceNameOnward;
38
38
  const activeDate = isReturn ? dateReturn : dateOnward;
39
39
  const activeDuration = isReturn ? durationReturn : durationOnward;
@@ -120,7 +120,7 @@ export const PaymentCardMobile = (props) => {
120
120
  : "2px solid transparent",
121
121
  transition: "all 0.2s ease",
122
122
  } }, (translation === null || translation === void 0 ? void 0 : translation.return) || "Vuelta"))) : null,
123
- React.createElement("div", { style: { padding: "16px 16px 0 16px" } },
123
+ React.createElement("div", { style: { padding: "16px 10px 0 10px" } },
124
124
  React.createElement("div", { style: {
125
125
  display: "flex",
126
126
  alignItems: "flex-start",
@@ -160,27 +160,14 @@ export const PaymentCardMobile = (props) => {
160
160
  } },
161
161
  React.createElement("div", { style: {
162
162
  flexShrink: 0,
163
- width: "28px",
164
- height: "28px",
163
+ width: "20px",
164
+ height: "20px",
165
165
  display: "flex",
166
166
  alignItems: "center",
167
167
  justifyContent: "center",
168
168
  marginTop: "2px",
169
- } }, (icons === null || icons === void 0 ? void 0 : icons.origin) ? (React.createElement("img", { src: icons.origin, style: { width: "18px", height: "18px" }, alt: "origin" })) : (React.createElement("div", { style: {
170
- width: "22px",
171
- height: "22px",
172
- borderRadius: "50%",
173
- border: "2.5px solid #e0321c",
174
- display: "flex",
175
- alignItems: "center",
176
- justifyContent: "center",
177
169
  } },
178
- React.createElement("div", { style: {
179
- width: "8px",
180
- height: "8px",
181
- borderRadius: "50%",
182
- backgroundColor: "#e0321c",
183
- } })))),
170
+ React.createElement("img", { src: icons.origin, style: { width: "18px", height: "18px" }, alt: "origin" })),
184
171
  React.createElement("div", { style: { flex: 1 } },
185
172
  React.createElement("div", { style: {
186
173
  fontSize: "15px",
@@ -188,7 +175,7 @@ export const PaymentCardMobile = (props) => {
188
175
  color: "#464647",
189
176
  textTransform: "capitalize",
190
177
  lineHeight: 1.3,
191
- } }, activeSource),
178
+ }, className: "bold-text" }, activeSource),
192
179
  formatSubText(activeBoardingStage, activeBoardingTime) && (React.createElement("div", { style: {
193
180
  fontSize: "12px",
194
181
  color: "#464647",
@@ -198,25 +185,18 @@ export const PaymentCardMobile = (props) => {
198
185
  React.createElement("div", { style: {
199
186
  display: "flex",
200
187
  alignItems: "flex-start",
201
- gap: "8px",
188
+ gap: "7px",
202
189
  } },
203
190
  React.createElement("div", { style: {
204
191
  flexShrink: 0,
205
- width: "28px",
206
- height: "28px",
192
+ width: "20px",
193
+ height: "20px",
207
194
  display: "flex",
208
195
  alignItems: "center",
209
196
  justifyContent: "center",
210
197
  marginTop: "2px",
211
- } }, (icons === null || icons === void 0 ? void 0 : icons.destination) ? (React.createElement("img", { src: icons.destination, style: { width: "18px", height: "18px" }, alt: "destination" })) : (React.createElement("div", { style: {
212
- width: "22px",
213
- height: "22px",
214
- display: "flex",
215
- alignItems: "center",
216
- justifyContent: "center",
217
198
  } },
218
- React.createElement("svg", { viewBox: "0 0 24 24", width: "24", height: "24", fill: "none" },
219
- React.createElement("path", { d: "M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z", fill: "#e05252" }))))),
199
+ React.createElement("img", { src: icons.destination, style: { width: "18px", height: "18px" }, alt: "destination" })),
220
200
  React.createElement("div", { style: { flex: 1 } },
221
201
  React.createElement("div", { style: {
222
202
  fontSize: "15px",
@@ -224,7 +204,7 @@ export const PaymentCardMobile = (props) => {
224
204
  color: "#464647",
225
205
  textTransform: "capitalize",
226
206
  lineHeight: 1.3,
227
- } }, activeDest),
207
+ }, className: "bold-text" }, activeDest),
228
208
  formatSubText(activeDroppingStage, activeDroppingTime) && (React.createElement("div", { style: {
229
209
  fontSize: "12px",
230
210
  color: "#464647",
@@ -269,7 +249,7 @@ export const PaymentCardMobile = (props) => {
269
249
  zIndex: 20,
270
250
  } })),
271
251
  React.createElement(ModalTabStateWrapper, { initialTab: journeyTypeActive || 1, showDetails: showDetails, render: (modalTab, setModalTab) => {
272
- var _a, _b, _c, _d, _e, _f, _g;
252
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
273
253
  const modalIsReturn = modalTab === 2;
274
254
  const modalBoardingStage = modalIsReturn
275
255
  ? boardingStageReturn
@@ -283,10 +263,8 @@ export const PaymentCardMobile = (props) => {
283
263
  const modalDroppingTime = modalIsReturn
284
264
  ? droppingTimeReturn
285
265
  : droppingTimeOnward;
286
- const modalSource = modalIsReturn ? sourceReturn : sourceOnward;
287
- const modalDest = modalIsReturn
288
- ? destinationReturn
289
- : destinationOnward;
266
+ const modalSource = (_a = (modalIsReturn ? sourceReturn : sourceOnward)) === null || _a === void 0 ? void 0 : _a.replace(/,\s*/g, ", ");
267
+ const modalDest = (_b = (modalIsReturn ? destinationReturn : destinationOnward)) === null || _b === void 0 ? void 0 : _b.replace(/,\s*/g, ", ");
290
268
  const modalServiceName = modalIsReturn
291
269
  ? serviceNameReturn
292
270
  : serviceNameOnward;
@@ -385,6 +363,7 @@ export const PaymentCardMobile = (props) => {
385
363
  ? selectedReturn[0]
386
364
  : selectedOnward[0]).map((val, idx) => {
387
365
  var _a, _b;
366
+ console.log("🚀 ~ PaymentCardMobile ~ val:", val);
388
367
  return (React.createElement("span", { key: idx, style: {
389
368
  display: "inline-flex",
390
369
  alignItems: "center",
@@ -402,11 +381,6 @@ export const PaymentCardMobile = (props) => {
402
381
  marginLeft: "4px",
403
382
  } }, (_b = (_a = val.type) === null || _a === void 0 ? void 0 : _a.charAt(0)) === null || _b === void 0 ? void 0 : _b.toUpperCase()))));
404
383
  }))))),
405
- React.createElement("div", { style: S.section, className: "mt-[30px]" },
406
- React.createElement("div", { style: S.sectionTitle, className: "bold-text" }, "Pol\u00EDtica"),
407
- React.createElement("div", { style: S.sectionRow },
408
- React.createElement("span", { style: { flex: 1 } }, "Cancelaci\u00F3n"),
409
- React.createElement("span", { style: Object.assign(Object.assign({}, S.sectionRowValue), { fontSize: "13px" }), className: "bold-text" }, "Gratis hasta 24h antes"))),
410
384
  React.createElement("div", { style: S.section, className: "mt-[30px]" },
411
385
  React.createElement("div", { style: S.sectionTitle, className: "bold-text" }, "Tarifa"),
412
386
  selectSeatOnward && selectedOnward && selectedOnward[0]
@@ -437,18 +411,19 @@ export const PaymentCardMobile = (props) => {
437
411
  : null,
438
412
  (insuranceData === null || insuranceData === void 0 ? void 0 : insuranceData.insurance_enabled) ? (React.createElement("div", { style: S.sectionRow },
439
413
  React.createElement("span", { style: { flex: 1 } },
440
- ((_b = (_a = selectedOnward === null || selectedOnward === void 0 ? void 0 : selectedOnward[1]) === null || _a === void 0 ? void 0 : _a.reduce((acc, qty) => acc + qty, 0)) !== null && _b !== void 0 ? _b : 0) +
441
- ((_d = (_c = selectedReturn === null || selectedReturn === void 0 ? void 0 : selectedReturn[1]) === null || _c === void 0 ? void 0 : _c.reduce((acc, qty) => acc + qty, 0)) !== null && _d !== void 0 ? _d : 0),
414
+ ((_d = (_c = selectedOnward === null || selectedOnward === void 0 ? void 0 : selectedOnward[1]) === null || _c === void 0 ? void 0 : _c.reduce((acc, qty) => acc + qty, 0)) !== null && _d !== void 0 ? _d : 0) +
415
+ ((_f = (_e = selectedReturn === null || selectedReturn === void 0 ? void 0 : selectedReturn[1]) === null || _e === void 0 ? void 0 : _e.reduce((acc, qty) => acc + qty, 0)) !== null && _f !== void 0 ? _f : 0),
442
416
  " ",
443
417
  "x Viajero Seguro"),
444
- React.createElement("span", { style: S.sectionRowValue, className: "bold-text" }, CommonService.currency((_e = insuranceData === null || insuranceData === void 0 ? void 0 : insuranceData.insurance_total) !== null && _e !== void 0 ? _e : 0, currencySign)))) : null,
445
- ((_f = props.serviceFeeDataStateValue) === null || _f === void 0 ? void 0 : _f.service_fee) > 0 && (React.createElement("div", { style: S.sectionRow },
418
+ React.createElement("span", { style: S.sectionRowValue, className: "bold-text" }, CommonService.currency((_g = insuranceData === null || insuranceData === void 0 ? void 0 : insuranceData.insurance_total) !== null && _g !== void 0 ? _g : 0, currencySign)))) : null,
419
+ ((_h = props.serviceFeeDataStateValue) === null || _h === void 0 ? void 0 : _h.total_convenience_fee_amount) && (React.createElement("div", { style: S.sectionRow },
446
420
  React.createElement("span", { style: { flex: 1 } }, "Cargo por servicio"),
447
- React.createElement("span", { style: S.sectionRowValue, className: "bold-text" }, CommonService.currency(props.serviceFeeDataStateValue.service_fee, currencySign)))),
421
+ React.createElement("span", { style: S.sectionRowValue, className: "bold-text" }, CommonService.currency(props.serviceFeeDataStateValue
422
+ .total_convenience_fee_amount, currencySign)))),
448
423
  (promoCode === null || promoCode === void 0 ? void 0 : promoCode.promoCodeApplied) && (React.createElement(React.Fragment, null,
449
424
  React.createElement("div", { style: S.sectionRow },
450
425
  React.createElement("span", { style: { flex: 1 } }, (translation === null || translation === void 0 ? void 0 : translation.promotionalCode) || "Código promocional"),
451
- React.createElement("span", { style: Object.assign(Object.assign({}, S.sectionRowValue), { color: colors === null || colors === void 0 ? void 0 : colors.promoCodePriceColor }), className: "bold-text" }, CommonService.currency((_g = promoCode === null || promoCode === void 0 ? void 0 : promoCode.promoCouponAmount) !== null && _g !== void 0 ? _g : 0, currencySign))),
426
+ React.createElement("span", { style: Object.assign(Object.assign({}, S.sectionRowValue), { color: colors === null || colors === void 0 ? void 0 : colors.promoCodePriceColor }), className: "bold-text" }, CommonService.currency((_j = promoCode === null || promoCode === void 0 ? void 0 : promoCode.promoCouponAmount) !== null && _j !== void 0 ? _j : 0, currencySign))),
452
427
  (promoCode === null || promoCode === void 0 ? void 0 : promoCode.promoCouponAmount) ? (React.createElement("div", { style: {
453
428
  display: "flex",
454
429
  alignItems: "center",
@@ -489,6 +464,19 @@ export const PaymentCardMobile = (props) => {
489
464
  }
490
465
  `),
491
466
  renderDiscount && renderDiscount(discountAmount)))) : null,
467
+ removeDiscountAtomValue && (React.createElement("div", { style: S.sectionRow },
468
+ React.createElement("span", { style: { flex: 1 } }, "Cup\u00F3n"),
469
+ React.createElement("span", { style: Object.assign(Object.assign({}, S.sectionRowValue), { color: "var(--secondary-color)" }), className: "bold-text" }, `- ${CommonService.currency((netFare !== null && netFare !== void 0 ? netFare : 0) - (discountAmount !== null && discountAmount !== void 0 ? discountAmount : 0), currencySign)}`))),
470
+ walletMoney ? (React.createElement("div", { style: S.sectionRow },
471
+ React.createElement("span", { style: { flex: 1 } }, walletLabel),
472
+ React.createElement("span", { style: Object.assign(Object.assign({}, S.sectionRowValue), { color: "var(--secondary-color)" }), className: "bold-text" }, isPeru
473
+ ? CommonService.currencyFixed(walletMoney, currencySign)
474
+ : CommonService.currency(walletMoney, currencySign)))) : null,
475
+ virtualMoney ? (React.createElement("div", { style: S.sectionRow },
476
+ React.createElement("span", { style: { flex: 1 } },
477
+ React.createElement("span", { style: { color: "var(--secondary-color)" } }, `${creditosLabel}(${virtualLimit}%)`)),
478
+ React.createElement("span", { style: Object.assign(Object.assign({}, S.sectionRowValue), { color: "var(--secondary-color)" }), className: "bold-text" }, CommonService.currency(((virtualLimit !== null && virtualLimit !== void 0 ? virtualLimit : 0) / 100) *
479
+ Number(virtualMoney !== null && virtualMoney !== void 0 ? virtualMoney : 0), currencySign)))) : null,
492
480
  React.createElement("div", { style: {
493
481
  borderTop: "1.5px dashed #464647",
494
482
  margin: "14px 0",
@@ -516,9 +504,10 @@ export const PaymentCardMobile = (props) => {
516
504
  alignItems: "center",
517
505
  justifyContent: "center",
518
506
  gap: "6px",
519
- paddingBottom: "14px",
507
+ paddingBottom: "8px",
520
508
  cursor: "pointer",
521
509
  userSelect: "none",
510
+ marginTop: "-5px",
522
511
  }, onClick: () => setShowDetails && setShowDetails(!showDetails) },
523
512
  React.createElement("span", { style: { fontSize: "14px", fontWeight: 700, color: "#464647" } }, "Ver todos los detalles"),
524
513
  React.createElement("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", style: {
@@ -0,0 +1,18 @@
1
+ import React from "react";
2
+ interface PromoCountdownProps {
3
+ countdownSeconds: number;
4
+ }
5
+ interface PromoCountdownState {
6
+ remaining: number;
7
+ }
8
+ declare class PromoCountdown extends React.Component<PromoCountdownProps, PromoCountdownState> {
9
+ private timer;
10
+ constructor(props: PromoCountdownProps);
11
+ componentDidMount(): void;
12
+ componentDidUpdate(prevProps: PromoCountdownProps): void;
13
+ componentWillUnmount(): void;
14
+ private clearTimer;
15
+ private startTimer;
16
+ render(): React.JSX.Element;
17
+ }
18
+ export default PromoCountdown;
@@ -0,0 +1,55 @@
1
+ import React from "react";
2
+ class PromoCountdown extends React.Component {
3
+ constructor(props) {
4
+ super(props);
5
+ this.timer = null;
6
+ this.state = { remaining: props.countdownSeconds };
7
+ }
8
+ componentDidMount() {
9
+ this.startTimer();
10
+ }
11
+ componentDidUpdate(prevProps) {
12
+ if (prevProps.countdownSeconds !== this.props.countdownSeconds) {
13
+ this.setState({ remaining: this.props.countdownSeconds }, () => {
14
+ this.startTimer();
15
+ });
16
+ }
17
+ }
18
+ componentWillUnmount() {
19
+ this.clearTimer();
20
+ }
21
+ clearTimer() {
22
+ if (this.timer) {
23
+ clearInterval(this.timer);
24
+ this.timer = null;
25
+ }
26
+ }
27
+ startTimer() {
28
+ this.clearTimer();
29
+ if (this.state.remaining <= 0)
30
+ return;
31
+ this.timer = setInterval(() => {
32
+ this.setState((prev) => {
33
+ if (prev.remaining <= 1) {
34
+ this.clearTimer();
35
+ return { remaining: 0 };
36
+ }
37
+ return { remaining: prev.remaining - 1 };
38
+ });
39
+ }, 1000);
40
+ }
41
+ render() {
42
+ const { remaining } = this.state;
43
+ const hrs = Math.floor(remaining / 3600);
44
+ const mins = Math.floor((remaining % 3600) / 60);
45
+ const secs = remaining % 60;
46
+ const pad = (n) => String(n).padStart(2, "0");
47
+ return (React.createElement("span", { className: "bold-text" },
48
+ pad(hrs),
49
+ ":",
50
+ pad(mins),
51
+ ":",
52
+ pad(secs)));
53
+ }
54
+ }
55
+ export default PromoCountdown;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kupos-ui-components-lib",
3
- "version": "10.4.13",
3
+ "version": "10.4.15",
4
4
  "description": "A reusable UI components package",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -30,7 +30,7 @@
30
30
  "author": "Zahid Dar",
31
31
  "license": "MIT",
32
32
  "dependencies": {
33
- "kupos-ui-components-lib": "^9.0.7",
33
+ "kupos-ui-components-lib": "^10.4.15",
34
34
  "lottie-react": "^2.4.1",
35
35
  "lottie-web": "^5.13.0",
36
36
  "moment": "^2.30.1",
@@ -0,0 +1,14 @@
1
+ <svg width="13" height="12" viewBox="0 0 13 12" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M7.26471 1.41528C9.92084 1.41532 12.0821 3.57653 12.0821 6.23267C12.0821 8.88878 9.92082 11.05 7.26471 11.05C4.60857 11.05 2.44735 8.8888 2.44733 6.23267C2.44733 3.57651 4.60855 1.41528 7.26471 1.41528ZM7.26471 1.9895C4.92362 1.9895 3.02155 3.89158 3.02155 6.23267C3.02157 8.57373 4.92364 10.4758 7.26471 10.4758C9.60575 10.4758 11.5078 8.57371 11.5079 6.23267C11.5079 3.8916 9.60577 1.98953 7.26471 1.9895Z" fill="#464647" stroke="#464647" stroke-width="0.1"/>
3
+ <path d="M7.26425 2.51123C9.31779 2.51134 10.9859 4.17935 10.9859 6.23291C10.9858 8.28638 9.31772 9.95448 7.26425 9.95459C5.21449 9.95459 3.54268 8.28648 3.54257 6.23291C3.54257 4.17928 5.21063 2.51123 7.26425 2.51123ZM7.26425 3.08545C5.52946 3.08545 4.11679 4.49812 4.11679 6.23291C4.1169 7.96761 5.52953 9.38037 7.26425 9.38037C8.99888 9.38026 10.4116 7.96754 10.4117 6.23291C10.4117 4.49819 8.99895 3.08556 7.26425 3.08545Z" fill="#464647" stroke="#464647" stroke-width="0.1"/>
4
+ <path d="M7.26443 5.56592C6.89538 5.56592 6.5979 5.86341 6.5979 6.23246C6.5979 6.60151 6.89538 6.89901 7.26443 6.89901C7.63349 6.89901 7.93099 6.60151 7.93099 6.23246C7.93099 5.86341 7.63349 5.56592 7.26443 5.56592Z" fill="#464647"/>
5
+ <path d="M6.53391 1.12598L6.75233 1.27284C6.71467 1.18246 6.63182 1.12598 6.53391 1.12598Z" fill="#464647"/>
6
+ <path d="M7.99449 1.12598H7.22627L6.87982 1.35946H6.53334H6.29987V1.7511C6.29987 1.87914 6.40531 1.98458 6.53334 1.98458C6.56724 1.98458 6.59736 1.97705 6.62749 1.96575C6.66891 1.95822 6.82333 1.94316 7.27899 1.94316C7.7083 1.94316 7.85515 1.95822 7.89657 1.96575C8.01331 2.01847 8.15265 1.96575 8.20914 1.84901C8.2242 1.81889 8.23173 1.785 8.23173 1.7511V1.35946C8.23173 1.23142 8.12629 1.12598 7.99825 1.12598H7.99449ZM6.74423 1.85278C6.74423 1.85278 6.75931 1.82265 6.76308 1.80383C6.75931 1.81889 6.75176 1.83771 6.74423 1.85278ZM6.76308 1.80383C6.76308 1.80383 6.76306 1.78876 6.76682 1.77746C6.76682 1.78499 6.76684 1.79629 6.76308 1.80383ZM7.76854 1.80383C7.76854 1.80383 7.77607 1.83771 7.7836 1.85278C7.77607 1.83771 7.77231 1.82265 7.76854 1.80383ZM7.76478 1.77746C7.76478 1.77746 7.76478 1.79252 7.76854 1.80006C7.76854 1.79252 7.76854 1.78499 7.76478 1.77746Z" fill="#464647"/>
7
+ <path d="M7.99439 1.46867H6.53324C6.12654 1.46867 5.79891 1.13351 5.80267 0.73057C5.80267 0.331393 6.13407 0.00376582 6.53324 0H7.99815C8.19398 0 8.3785 0.0790829 8.51784 0.218418C8.65717 0.357754 8.72872 0.542281 8.72872 0.738103C8.72872 1.13728 8.39733 1.46491 7.99815 1.46867H7.99439ZM7.99439 0.474497H6.53324C6.39391 0.474497 6.27717 0.591235 6.27717 0.73057C6.27717 0.873671 6.39014 0.990413 6.53324 0.990413H7.99062C8.12995 0.990413 8.24669 0.873675 8.24669 0.73434C8.24669 0.666555 8.22035 0.598768 8.17139 0.549812C8.12243 0.500857 8.05842 0.474493 7.98687 0.470728L7.99439 0.474497Z" fill="#464647"/>
8
+ <path d="M3.63795 3.72449H1.86426C1.73246 3.72449 1.62701 3.61905 1.62701 3.48725C1.62701 3.35544 1.73246 3.25 1.86426 3.25H3.63795C3.76975 3.25 3.8752 3.35544 3.8752 3.48725C3.8752 3.61905 3.76975 3.72449 3.63795 3.72449Z" fill="#464647"/>
9
+ <path d="M2.67736 6.5487H1.45347C1.32166 6.5487 1.21622 6.44326 1.21622 6.31146C1.21622 6.17965 1.32166 6.07422 1.45347 6.07422H2.67736C2.80916 6.07422 2.91461 6.17965 2.91461 6.31146C2.91461 6.44326 2.80916 6.5487 2.67736 6.5487Z" fill="#464647"/>
10
+ <path d="M2.86165 7.93493H1.20847C1.07667 7.93493 0.971222 7.8295 0.971222 7.6977C0.971222 7.56589 1.07667 7.46045 1.20847 7.46045H2.86165C2.99345 7.46045 3.0989 7.56589 3.0989 7.6977C3.0989 7.8295 2.99345 7.93493 2.86165 7.93493Z" fill="#464647"/>
11
+ <path d="M2.91474 5.13636H0.237249C0.105445 5.13636 0 5.03091 0 4.89911C0 4.7673 0.105445 4.66187 0.237249 4.66187H2.91474C3.04655 4.66187 3.15199 4.7673 3.15199 4.89911C3.15199 5.03091 3.04655 5.13636 2.91474 5.13636Z" fill="#464647"/>
12
+ <path d="M7.09121 6.21729C7.03096 6.21729 6.97071 6.19469 6.92552 6.1495L5.97652 5.21558C5.88238 5.1252 5.88238 4.97457 5.97652 4.88042C6.0669 4.78628 6.21754 4.78628 6.31169 4.88042L7.26066 5.81435C7.3548 5.90473 7.3548 6.05536 7.26066 6.1495C7.21547 6.19846 7.15147 6.22105 7.09121 6.22105V6.21729Z" fill="#464647"/>
13
+ <path d="M7.51304 6.28133C7.45279 6.28133 7.39253 6.25874 7.34734 6.21355C7.2532 6.1194 7.2532 5.97253 7.34734 5.87838L8.9591 4.25909C9.05325 4.16494 9.20012 4.16494 9.29427 4.25909C9.38841 4.35323 9.38841 4.5001 9.29427 4.59424L7.68248 6.21355C7.63729 6.25874 7.57706 6.2851 7.51304 6.2851V6.28133Z" fill="#464647"/>
14
+ </svg>
@@ -1,6 +1,6 @@
1
1
  import React from "react";
2
- import { ChevronDownIcon, FilterIcon } from "./icons";
3
- import { FilterSortBarColors, FilterSortBarIcons } from "./types";
2
+ import { ChevronDownIcon, FilterIcon, SortArrowIcon } from "./icons";
3
+ import { FilterSortBarColors, FilterSortBarIcons, SortDirection } from "./types";
4
4
 
5
5
  interface FilterChipProps {
6
6
  label: string;
@@ -16,6 +16,10 @@ interface FilterChipProps {
16
16
  badgeCount?: number;
17
17
  /** When true, the label text is hidden and only the icon + badge + chevron show (used for the Filtros button once the strip is scrolled). */
18
18
  collapsed?: boolean;
19
+ /** Renders a directional arrow instead of the dropdown chevron — used for base sort chips (Horario, Precio, Rápido). */
20
+ sortDirection?: SortDirection;
21
+ /** Suppresses the trailing chevron/arrow entirely — used for cohort sort chips (Después de las 6 PM, Salón Cama), which just toggle on/off. */
22
+ hideTrailingIcon?: boolean;
19
23
  colors: Required<
20
24
  Pick<
21
25
  FilterSortBarColors,
@@ -35,6 +39,8 @@ const FilterChip = ({
35
39
  activeIconSrc,
36
40
  badgeCount = 0,
37
41
  collapsed,
42
+ sortDirection,
43
+ hideTrailingIcon,
38
44
  colors,
39
45
  icons,
40
46
  }: FilterChipProps) => {
@@ -43,22 +49,11 @@ const FilterChip = ({
43
49
  return (
44
50
  <button
45
51
  onClick={onClick}
52
+ className="flex flex-shrink-0 items-center gap-[6px] px-[14px] py-[9px] rounded-[20px] text-[13px] font-medium whitespace-nowrap cursor-pointer transition-[padding] duration-200 ease-in-out [-webkit-tap-highlight-color:transparent]"
46
53
  style={{
47
- flexShrink: 0,
48
- display: "flex",
49
- alignItems: "center",
50
- gap: 6,
51
- padding: "9px 14px",
52
- borderRadius: 20,
53
54
  border: `1px solid ${isHighlighted ? colors.primaryColor : colors.chipBorderColor}`,
54
55
  backgroundColor: isHighlighted ? colors.primaryColor : "#fff",
55
56
  color: isHighlighted ? colors.primaryTextColor : colors.chipTextColor,
56
- fontSize: 13,
57
- fontWeight: 500,
58
- whiteSpace: "nowrap",
59
- cursor: "pointer",
60
- transition: "padding 0.2s ease",
61
- WebkitTapHighlightColor: "transparent",
62
57
  }}
63
58
  >
64
59
  {isFiltersButton && (
@@ -75,37 +70,38 @@ const FilterChip = ({
75
70
  width={14}
76
71
  height={14}
77
72
  alt=""
78
- style={isHighlighted && !activeIconSrc ? { filter: "brightness(0) invert(1)" } : undefined}
73
+ className={isHighlighted && !activeIconSrc ? "brightness-0 invert" : undefined}
79
74
  />
80
75
  )}
76
+ {!collapsed && <span>{label}</span>}
81
77
  {badgeCount > 0 && (
82
78
  <span
79
+ className="inline-flex flex-shrink-0 items-center justify-center w-[18px] h-[18px] rounded-full box-border text-[10px] font-bold leading-none"
83
80
  style={{
84
- display: "inline-flex",
85
- flexShrink: 0,
86
- alignItems: "center",
87
- justifyContent: "center",
88
- width: 16,
89
- height: 16,
90
- borderRadius: "50%",
91
- boxSizing: "border-box",
92
- fontSize: 10,
93
- fontWeight: 700,
94
- lineHeight: 1,
95
- backgroundColor: colors.badgeBackgroundColor,
96
- color: colors.badgeTextColor,
81
+ backgroundColor: !isFiltersButton && isHighlighted ? "#FFFFFF" : colors.badgeBackgroundColor,
82
+ color: !isFiltersButton && isHighlighted ? colors.primaryColor : colors.badgeTextColor,
97
83
  }}
98
84
  >
99
85
  {badgeCount}
100
86
  </span>
101
87
  )}
102
- {!collapsed && <span>{label}</span>}
103
- <ChevronDownIcon
104
- size={8}
105
- color={isHighlighted ? colors.primaryTextColor : colors.chipTextColor}
106
- open={isOpen}
107
- src={icons?.chevronDownIcon}
108
- />
88
+ {!hideTrailingIcon &&
89
+ (sortDirection ? (
90
+ <SortArrowIcon
91
+ size={9}
92
+ color={isHighlighted ? colors.primaryTextColor : colors.chipTextColor}
93
+ direction={sortDirection}
94
+ src={icons?.sortArrowIcon}
95
+ active={isHighlighted}
96
+ />
97
+ ) : (
98
+ <ChevronDownIcon
99
+ size={8}
100
+ color={isHighlighted ? colors.primaryTextColor : colors.chipTextColor}
101
+ open={isOpen}
102
+ src={icons?.chevronDownIcon}
103
+ />
104
+ ))}
109
105
  </button>
110
106
  );
111
107
  };