kupos-ui-components-lib 9.7.3 → 9.7.5

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 (30) hide show
  1. package/dist/KuposUIComponent.d.ts +0 -3
  2. package/dist/components/ServiceItem/ServiceItemDesktop.d.ts +1 -1
  3. package/dist/components/ServiceItem/ServiceItemDesktop.js +2 -15
  4. package/dist/components/ServiceItem/ServiceItemMobile.d.ts +1 -1
  5. package/dist/components/ServiceItem/ServiceItemMobile.js +7 -16
  6. package/dist/components/ServiceItem/mobileTypes.d.ts +3 -27
  7. package/dist/components/ServiceItem/types.d.ts +0 -17
  8. package/dist/styles.css +6 -165
  9. package/dist/types.d.ts +3 -0
  10. package/dist/ui/ExpendedDropDown/ExpandedDropdown.js +6 -13
  11. package/dist/ui/FeaturServiceUiMobile/FeatureServiceUiMobile.js +98 -52
  12. package/dist/ui/FeatureServiceUI/FeatureServiceUi.js +22 -24
  13. package/dist/ui/SeatSection/SeatSection.js +1 -1
  14. package/dist/ui/mobileweb/ExpandedDropdownMobile.js +6 -15
  15. package/dist/utils/CommonService.js +1 -11
  16. package/package.json +1 -1
  17. package/src/KuposUIComponent.tsx +0 -3
  18. package/src/components/ServiceItem/ServiceItemDesktop.tsx +0 -41
  19. package/src/components/ServiceItem/ServiceItemMobile.tsx +286 -331
  20. package/src/components/ServiceItem/mobileTypes.ts +4 -23
  21. package/src/components/ServiceItem/types.ts +0 -18
  22. package/src/types.ts +3 -0
  23. package/src/ui/ExpendedDropDown/ExpandedDropdown.tsx +11 -25
  24. package/src/ui/SeatSection/SeatSection.tsx +1 -1
  25. package/src/ui/mobileweb/ExpandedDropdownMobile.tsx +14 -34
  26. package/src/utils/CommonService.ts +1 -13
  27. package/src/assets/images/anims/service_list/thunder_icon.json +0 -1
  28. package/src/assets/images/anims/service_list/users_anim.json +0 -1
  29. package/src/ui/FeaturServiceUiMobile/FeatureServiceUiMobile.tsx +0 -1042
  30. package/src/ui/FeatureServiceUI/FeatureServiceUi.tsx +0 -477
@@ -1,477 +0,0 @@
1
- import React from "react";
2
- import LottiePlayer from "../../assets/LottiePlayer";
3
- import commonService from "../../utils/CommonService";
4
-
5
- const HARDCODED_OPERATORS = [
6
- {
7
- logo: "https://upload.wikimedia.org/wikipedia/commons/thumb/4/4e/Turbus_logo.svg/320px-Turbus_logo.svg.png",
8
- name: "Turbus",
9
- time: "7:00 am",
10
- seatsAvailable: "3 disponibles",
11
- },
12
- {
13
- logo: "https://upload.wikimedia.org/wikipedia/commons/thumb/6/6e/Pullman_Bus_logo.svg/320px-Pullman_Bus_logo.svg.png",
14
- name: "Pullmanbus",
15
- time: "8:00 am",
16
- seatsAvailable: "5 disponibles",
17
- },
18
- {
19
- logo: "https://upload.wikimedia.org/wikipedia/commons/thumb/4/4e/Turbus_logo.svg/320px-Turbus_logo.svg.png",
20
- name: "Expreso Santa C...",
21
- time: "9:00 am",
22
- seatsAvailable: "3 disponibles",
23
- },
24
- ];
25
-
26
- const FeatureServiceUi = ({
27
- serviceItem,
28
- showTopLabel,
29
- isSoldOut,
30
- getAnimationIcon,
31
- cityOrigin,
32
- cityDestination,
33
- renderIcon,
34
- viewersConfig,
35
- isFeatureDropDownExpand,
36
- onToggleExpand,
37
- ticketQuantity = 1,
38
- onIncreaseTicketQuantity,
39
- onDecreaseTicketQuantity,
40
- onBookButtonPress,
41
- }) => {
42
- const operators =
43
- serviceItem?.operators?.length > 0
44
- ? serviceItem.operators
45
- : HARDCODED_OPERATORS;
46
-
47
- const isItemExpanded =
48
- serviceItem.id === isFeatureDropDownExpand ||
49
- isFeatureDropDownExpand === true;
50
- const canDecreaseTicketQuantity = ticketQuantity > 1;
51
-
52
- const HOW_IT_WORKS_STEPS = [
53
- {
54
- icon: "flexible",
55
- name: "1. Salida flexible",
56
- text: "Viajas en un horario entre las 07:00 y las 10:00 AM del día elegido.",
57
- },
58
- {
59
- icon: "bus",
60
- name: "2. Empresa asignada",
61
- text: "Una de las empresas disponibles confirma tu viaje una vez pagado.",
62
- },
63
- {
64
- icon: "price",
65
- name: "3. Precio garantizado",
66
- text: "Al seleccionar este servicio aseguras el precio reducido.",
67
- },
68
- {
69
- icon: "ticket",
70
- name: "4. ¡Listo!",
71
- text: "Recibe todos los detalles de tu viaje al instante tras la compra.",
72
- },
73
- ];
74
-
75
- const FeatureStepIcon = ({ icon }) => {
76
- switch (icon) {
77
- case "flexible":
78
- return renderIcon("flexibleIcon", "24px");
79
- case "bus":
80
- return renderIcon("empressaIcon", "24px");
81
- case "price":
82
- return renderIcon("precioIcon", "24px");
83
- default:
84
- return renderIcon("listoIcon", "24px");
85
- }
86
- };
87
-
88
- return (
89
- <div
90
- // ${
91
- // serviceItem.offer_text ? "mb-[55px]" : "mb-[10px]"
92
- // }
93
- className={`relative mb-[10px]
94
- ${
95
- serviceItem?.is_direct_trip ||
96
- serviceItem?.train_type_label === "Tren Express (Nuevo)" ||
97
- showTopLabel
98
- ? "mt-[24px]"
99
- : "mt-[20px]"
100
- }`}
101
- >
102
- <div
103
- className=""
104
- style={{
105
- border: "1px solid #c0c0c0",
106
- padding: "14px",
107
- borderRadius: "14px",
108
- }}
109
- >
110
- <div className="flex justify-between items-center px-[14px] pb-[10px] text-[13.33px]">
111
- <div className="flex items-center gap-[10px]">
112
- <span>Salida flexible</span>
113
- <div
114
- className="bold-text font-[9px]"
115
- style={{
116
- backgroundColor: "#FF5C60",
117
- padding: "1px 8px",
118
- borderRadius: "4px",
119
- color: "#fff",
120
- animation: "pulse-zoom 2s ease-in-out infinite",
121
- whiteSpace: "nowrap",
122
- }}
123
- >
124
- <span>AHORRAS 60%</span>
125
- </div>
126
- </div>
127
- <div>
128
- <span>
129
- {renderIcon("fireIcon", "14px")}{" "}
130
- <span className="bold-text">Remate</span> términa en{" "}
131
- <span
132
- className="bold-text text-end"
133
- ref={(node) => commonService.startCountdown(node, 599)}
134
- style={{
135
- fontVariantNumeric: "tabular-nums",
136
- display: "inline-block",
137
- color: "#FF5C60",
138
- minWidth: "40px",
139
- }}
140
- />
141
- </span>
142
- </div>
143
- </div>
144
- <div
145
- id={`service-card-${serviceItem.id}`}
146
- className="bg-[#0C1421] text-white mx-auto relative rounded-[14px] p-[14px] text-[13.33px]"
147
- >
148
- <div className="grid grid-cols-[23%_50%_27%] items-stretch">
149
- {/* LEFT: origin, destination, flexible, time, confirmed seat */}
150
- <div className="flex flex-col justify-between gap-[20px] my-[14px] pr-[22px]">
151
- <div className="flex flex-col gap-[8px]">
152
- <div className="flex items-center gap-[8px]">
153
- <img
154
- src={serviceItem.icons?.whiteOrigin}
155
- alt="origin"
156
- className={`w-[14px] h-[14px] shrink-0 ${
157
- isSoldOut ? "grayscale" : ""
158
- }`}
159
- />
160
- <span className="text-[13px] bold-text">
161
- {cityOrigin?.label.split(",")[0]}
162
- </span>
163
- </div>
164
- <div className="flex items-center gap-[8px]">
165
- <img
166
- src={serviceItem.icons?.whiteDestination}
167
- alt="destination"
168
- className={`w-[14px] h-[14px] shrink-0 ${
169
- isSoldOut ? "grayscale" : ""
170
- }`}
171
- style={{ opacity: isSoldOut ? 0.5 : 1 }}
172
- />
173
- <span className="text-[13px] bold-text">
174
- {cityDestination?.label.split(",")[0]}
175
- </span>
176
- </div>
177
- </div>
178
-
179
- <div className="flex flex-col gap-[8px]">
180
- <div className="text-[12px] bold-text whitespace-nowrap">
181
- Entre 07:00 AM y 10:00 AM
182
- </div>
183
- <div className="text-[11px] bold-text">Viernes 23 de mayo</div>
184
- </div>
185
-
186
- <div className="flex flex-col items-start gap-[10px] text-[12px] ">
187
- <div className="flex items-justify gap-[8px]">
188
- {renderIcon("sheildIcon", "16px")}
189
-
190
- <span
191
- className="text-[10px]"
192
- style={{
193
- lineHeight: 1.3,
194
- }}
195
- >
196
- Empresa y hora a confirmar luego del pago.
197
- </span>
198
- </div>
199
- <div className="flex items-justify gap-[8px]">
200
- {renderIcon("confirmarIcon", "16px")}
201
-
202
- <span
203
- className="text-[10px]"
204
- style={{
205
- lineHeight: 1.3,
206
- }}
207
- >
208
- Tu compra está 100% asegurada.
209
- </span>
210
- </div>
211
- </div>
212
- </div>
213
-
214
- {/* MIDDLE: competing operators + viewers */}
215
- <div className="min-w-0 px-[22px] flex flex-col items-center justify-between gap-[16px] py-[2px] border-r border-[#363c48] border-l border-[#363c48]">
216
- <div className="text-center">
217
- <div className="bold-text text-[14px]">
218
- 3 operadores compitiendo por tu compra
219
- </div>
220
- {/* <div className="text-[12px] mt-[8px]">
221
- Empresa a confirmar después de tu pago
222
- </div> */}
223
- </div>
224
-
225
- <div className="grid w-full grid-cols-3 items-stretch gap-[14px] mb-[12px]">
226
- {operators.map((op, idx) => (
227
- <div
228
- key={idx}
229
- className="flex min-w-0 flex-col items-center justify-center gap-[8px] rounded-[8px]"
230
- style={{
231
- // height: "80px",
232
- border: "1px solid #363c48",
233
- backgroundColor: "#1a202e",
234
- padding: "14px 10px",
235
- }}
236
- >
237
- <img
238
- src={serviceItem.operator_details[0]}
239
- alt={op.name}
240
- className={`h-[24px] max-w-full object-contain ${
241
- isSoldOut ? "grayscale" : ""
242
- }`}
243
- />
244
- <span className="text-[11px] truncate max-w-full text-center">
245
- {serviceItem.operator_details[2]}
246
- </span>
247
- <div className="bg-[#FF8F45] text-white text-[12px] font-bold px-[10px] py-[4px] rounded-[4px] bold-text whitespace-nowrap">
248
- <span>{op?.time}</span>
249
- </div>
250
- <span className="text-[10px] mt-[6px]">
251
- {op?.seatsAvailable}
252
- </span>
253
- </div>
254
- ))}
255
- </div>
256
-
257
- <div
258
- className="flex w-full items-center justify-center gap-[6px] text-[12px]"
259
- style={{
260
- border: "1px solid #363c48",
261
- backgroundColor: "#1a202e",
262
- padding: "8px 14px",
263
- borderRadius: "24px",
264
- }}
265
- >
266
- <LottiePlayer
267
- // animationData={serviceItem.icons.flexibleAnim}
268
- animationData={getAnimationIcon("usersAnimation")}
269
- width="18px"
270
- height="18px"
271
- />
272
- <span>
273
- <span className="bold-text text-white">
274
- {" "}
275
- <span
276
- className="bold-text"
277
- ref={(node) =>
278
- commonService.startViewerCount(node, viewersConfig)
279
- }
280
- style={{
281
- fontVariantNumeric: "tabular-nums",
282
- color: "#FF5C60",
283
- }}
284
- />{" "}
285
- </span>{" "}
286
- viendo |{" "}
287
- <span
288
- className="bold-text"
289
- ref={(node) =>
290
- commonService.startComprandoCount(node, 4, 16)
291
- }
292
- style={{ fontVariantNumeric: "tabular-nums" }}
293
- />{" "}
294
- han comprado
295
- </span>
296
- </div>
297
- </div>
298
-
299
- {/* RIGHT: price + button */}
300
- <div className="flex flex-col justify-center gap-[12px] py-[2px] pl-[22px] pr-[10px] relative mb-[16px]">
301
- <div
302
- className="flex flex-col gap-[6px] "
303
- style={{
304
- alignItems: "center",
305
- }}
306
- >
307
- <span
308
- className="text-[#FF8F45] bold-text text-[26px] leading-tight"
309
- style={{
310
- animation: "pulse-zoom 2s ease-in-out infinite",
311
- whiteSpace: "nowrap",
312
- }}
313
- >
314
- 60% OFF
315
- </span>
316
- {/* <span className="text-[#666] text-[14px] line-through">
317
- $10.000
318
- </span> */}
319
- <span
320
- className="text-[13.33px] font-normal leading-[20px] text-[#9f9f9f] relative"
321
- style={{ position: "relative" }}
322
- >
323
- $10.000
324
- <span
325
- style={{
326
- position: "absolute",
327
- left: "-2px",
328
- top: "50%",
329
- width: "calc(100% + 4px)",
330
- height: "1px",
331
-
332
- backgroundColor: "#FF5C60",
333
-
334
- transform: "rotate(-10deg)",
335
- transformOrigin: "center",
336
- }}
337
- />
338
- </span>
339
- <span className="text-white bold-text text-[28px] leading-none">
340
- {`$${(4000 * ticketQuantity).toLocaleString()}`}
341
- </span>
342
- </div>
343
-
344
- <div className="mt-[4px] flex flex-col items-center gap-[8px]">
345
- <span className="text-[12px] text-white">
346
- ¿Cuántos pasajes quieres?
347
- </span>
348
- <div
349
- className="flex w-full items-center justify-between"
350
- style={{
351
- border: "1px solid #363c48",
352
- backgroundColor: "#1a202e",
353
- padding: "6px 14px",
354
- borderRadius: "14px",
355
- }}
356
- >
357
- <button
358
- type="button"
359
- aria-label="Disminuir pasajes"
360
- disabled={!canDecreaseTicketQuantity}
361
- onClick={() => onDecreaseTicketQuantity?.(serviceItem)}
362
- className={`flex h-[34px] w-[34px] items-center justify-center rounded-full border-none text-[25px] leading-none text-white ${
363
- canDecreaseTicketQuantity
364
- ? "cursor-pointer bg-[#2d374d]"
365
- : "cursor-not-allowed bg-[#222b3d] opacity-50"
366
- }`}
367
- >
368
- -
369
- </button>
370
- <span className="bold-text text-[20px] text-white">
371
- {ticketQuantity}
372
- </span>
373
- <button
374
- type="button"
375
- aria-label="Aumentar pasajes"
376
- onClick={() => onIncreaseTicketQuantity?.(serviceItem)}
377
- className="flex h-[34px] w-[34px] cursor-pointer items-center justify-center rounded-full border-none bg-[#2d374d] text-[25px] leading-none text-white"
378
- >
379
- +
380
- </button>
381
- </div>
382
- </div>
383
-
384
- <button
385
- type="button"
386
- onClick={onBookButtonPress}
387
- className="flex items-center gap-[6px] px-[20px] py-[10px] rounded-[16px] text-white bold-text text-[13px] mt-[4px] justify-center border-none cursor-pointer"
388
- style={{
389
- backgroundColor: "#FF5C60",
390
- animation: "pulse-zoom 2s ease-in-out infinite",
391
- whiteSpace: "nowrap",
392
- }}
393
- >
394
- <LottiePlayer
395
- // animationData={serviceItem.icons.flexibleAnim}
396
- animationData={getAnimationIcon("thunderAnimation")}
397
- width="18px"
398
- height="18px"
399
- />
400
- <span className="whitespace-nowrap">¡Lo quiero!</span>
401
- </button>
402
- </div>
403
-
404
- <div
405
- className={`absolute bottom-[11px] right-[18px] cursor-pointer transition-transform duration-300 ease-in-out ${isItemExpanded ? "rotate-180" : ""}`}
406
- onClick={onToggleExpand}
407
- >
408
- <img
409
- src={serviceItem.icons?.downArrow}
410
- alt="down arrow"
411
- style={{
412
- width: "14px",
413
- height: "8px",
414
- filter: "brightness(0) invert(1)",
415
- }}
416
- />
417
- </div>
418
- </div>
419
- </div>
420
- <div
421
- className="grid"
422
- style={{
423
- gridTemplateRows: isItemExpanded ? "1fr" : "0fr",
424
- opacity: isItemExpanded ? 1 : 0,
425
- transition:
426
- "grid-template-rows 300ms ease-in-out, opacity 250ms ease-in-out",
427
- }}
428
- >
429
- <div
430
- className={`min-h-0 overflow-hidden px-[16px] text-[13.33px] ${
431
- isItemExpanded ? "pt-[14px] pb-[6px]" : "py-0"
432
- }`}
433
- style={{ transition: "padding 300ms ease-in-out" }}
434
- >
435
- <span className="bold-text">¿Cómo funciona?</span>
436
-
437
- <div className="mt-[14px] grid grid-cols-4 gap-[20px] px-[16px] ">
438
- {HOW_IT_WORKS_STEPS.map((step) => (
439
- <div
440
- key={step.name}
441
- className="flex flex-col items-center text-center text-[#272727]"
442
- >
443
- <FeatureStepIcon icon={step.icon} />
444
- <span className="bold-text mt-[10px] text-[12px] leading-[14px]">
445
- {step.name}
446
- </span>
447
- <span className="mt-[2px] max-w-[220px] text-[12px] leading-[14px] text-[#4a4a4a]">
448
- {step.text}
449
- </span>
450
- </div>
451
- ))}
452
- </div>
453
- </div>
454
- </div>
455
- </div>
456
-
457
- {/* TOP BADGE — "Remate | Termina en 09:55 min" hardcoded, no countdown hook */}
458
- {/* {showTopLabel && (
459
- <div className="absolute -top-[11px] left-0 w-full flex items-center justify-end gap-[12px] pr-[15px] z-10 ">
460
- <div className="flex items-center gap-[6px] py-[5px] px-[14px] rounded-[38px] text-[12.5px] bg-[#FF8F45] text-white whitespace-nowrap">
461
- <LottiePlayer
462
- animationData={getAnimationIcon("bombAnimation")}
463
- width="14px"
464
- height="14px"
465
- />
466
- <span>
467
- <strong>Remate</strong> | Termina en{" "}
468
- <strong>{HARDCODED_COUNTDOWN}</strong> min
469
- </span>
470
- </div>
471
- </div>
472
- )} */}
473
- </div>
474
- );
475
- };
476
-
477
- export default FeatureServiceUi;