@cleartrip/talos-hotel-srp-card 11.0.0 → 11.1.0

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.
@@ -430,6 +430,178 @@
430
430
  return handlers;
431
431
  }
432
432
 
433
+ const staticContainerStyles = ctDesignStyleManager.makeStyles(() => {
434
+ return {
435
+ root: {
436
+ display: 'flex',
437
+ flexDirection: 'column',
438
+ pointerEvents: 'auto'
439
+ }
440
+ };
441
+ });
442
+ function getPointerEventsStyles(pointerEvents) {
443
+ if (pointerEvents === 'box-none') {
444
+ return {
445
+ pointerEvents: 'none',
446
+ '& > *': {
447
+ pointerEvents: 'auto'
448
+ }
449
+ };
450
+ }
451
+ if (pointerEvents === 'box-only') {
452
+ return {
453
+ pointerEvents: 'auto',
454
+ '& > *': {
455
+ pointerEvents: 'none'
456
+ }
457
+ };
458
+ }
459
+ if (pointerEvents === 'none') {
460
+ return {
461
+ pointerEvents: 'none'
462
+ };
463
+ }
464
+ return {
465
+ pointerEvents: 'auto'
466
+ };
467
+ }
468
+ const Container = React.forwardRef(({
469
+ id,
470
+ as: ContainerAs = 'div',
471
+ children,
472
+ styleConfig,
473
+ onClick,
474
+ onLayout,
475
+ onMouseEnter,
476
+ onMouseLeave,
477
+ onTransitionEnd,
478
+ onTouchStart,
479
+ onTouchEnd,
480
+ onTouchCancel,
481
+ onTouchMove,
482
+ pointerEvents,
483
+ hitSlop: _hitSlop,
484
+ hapticEnabled: _hapticEnabled,
485
+ hapticVariant: _hapticVariant,
486
+ hapticRepeat: _hapticRepeat
487
+ }, forwardedRef) => {
488
+ const localRef = React.useRef(null);
489
+ const handleFocus = React.useCallback(() => {
490
+ var _a;
491
+ (_a = localRef.current) === null || _a === void 0 ? void 0 : _a.focus();
492
+ }, []);
493
+ const handleGetBoundingRect = React.useCallback(callback => {
494
+ var _a;
495
+ const rect = (_a = localRef.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
496
+ if (rect) {
497
+ callback === null || callback === void 0 ? void 0 : callback({
498
+ x: rect.x,
499
+ y: rect.y,
500
+ width: rect.width,
501
+ height: rect.height
502
+ });
503
+ }
504
+ }, []);
505
+ const handleAddEventListener = React.useCallback((type, listener, options) => {
506
+ var _a;
507
+ (_a = localRef.current) === null || _a === void 0 ? void 0 : _a.addEventListener(type, listener, options);
508
+ }, []);
509
+ const handleRemoveEventListener = React.useCallback((type, listener, options) => {
510
+ var _a;
511
+ (_a = localRef.current) === null || _a === void 0 ? void 0 : _a.removeEventListener(type, listener, options);
512
+ }, []);
513
+ React.useImperativeHandle(forwardedRef, () => {
514
+ var _a;
515
+ return {
516
+ focus: handleFocus,
517
+ getBoundingRectWithCallback: handleGetBoundingRect,
518
+ getElementRef: () => localRef,
519
+ style: ((_a = localRef.current) === null || _a === void 0 ? void 0 : _a.style) || {},
520
+ classList: {
521
+ add: className => {
522
+ var _a;
523
+ (_a = localRef.current) === null || _a === void 0 ? void 0 : _a.classList.add(className);
524
+ }
525
+ },
526
+ measure: _callback => {
527
+ var _a;
528
+ (_a = localRef.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
529
+ },
530
+ addEventListener: handleAddEventListener,
531
+ removeEventListener: handleRemoveEventListener
532
+ };
533
+ }, [handleFocus, handleGetBoundingRect, handleAddEventListener, handleRemoveEventListener]);
534
+ const {
535
+ root: rootStyles = []
536
+ } = styleConfig || {};
537
+ const pointerEventsStyle = React.useMemo(() => {
538
+ if (pointerEvents == null) return null;
539
+ return getPointerEventsStyles(pointerEvents);
540
+ }, [pointerEvents]);
541
+ const mergedRootStyles = ctDesignStyleManager.useWebMergeStyles([staticContainerStyles.root, ...rootStyles, ...(pointerEventsStyle ? [pointerEventsStyle] : [])], [rootStyles, pointerEventsStyle]);
542
+ React.useLayoutEffect(() => {
543
+ var _a, _b, _c, _d, _e, _f, _g, _h;
544
+ onLayout === null || onLayout === void 0 ? void 0 : onLayout({
545
+ layout: {
546
+ height: (_b = (_a = localRef.current) === null || _a === void 0 ? void 0 : _a.clientHeight) !== null && _b !== void 0 ? _b : 0,
547
+ width: (_d = (_c = localRef.current) === null || _c === void 0 ? void 0 : _c.clientWidth) !== null && _d !== void 0 ? _d : 0,
548
+ x: (_f = (_e = localRef.current) === null || _e === void 0 ? void 0 : _e.getBoundingClientRect().x) !== null && _f !== void 0 ? _f : 0,
549
+ y: (_h = (_g = localRef.current) === null || _g === void 0 ? void 0 : _g.getBoundingClientRect().y) !== null && _h !== void 0 ? _h : 0
550
+ }
551
+ });
552
+ }, [onLayout]);
553
+ return jsxRuntimeExports.jsx(ContainerAs, {
554
+ id: id,
555
+ ref: localRef,
556
+ className: mergedRootStyles,
557
+ onClick: event => onClick === null || onClick === void 0 ? void 0 : onClick({
558
+ stopPropagation: () => event.stopPropagation(),
559
+ preventDefault: () => event.preventDefault(),
560
+ nativeEvent: {
561
+ locationX: event.clientX,
562
+ locationY: event.clientY
563
+ }
564
+ }),
565
+ onMouseEnter: onMouseEnter,
566
+ onMouseLeave: onMouseLeave,
567
+ onTransitionEnd: onTransitionEnd,
568
+ onTouchStart: onTouchStart,
569
+ onTouchEnd: onTouchEnd,
570
+ onTouchCancel: onTouchCancel,
571
+ onTouchMove: onTouchMove,
572
+ children: children
573
+ });
574
+ });
575
+ Container.displayName = 'Container';
576
+
577
+ const StarRatingIcon = _a => {
578
+ var {
579
+ className,
580
+ width,
581
+ height,
582
+ stroke,
583
+ fill
584
+ } = _a,
585
+ restProps = __rest(_a, ["className", "width", "height", "stroke", "fill"]);
586
+ return jsxRuntimeExports.jsx("svg", Object.assign({}, restProps, {
587
+ className: className,
588
+ width: width,
589
+ height: height,
590
+ viewBox: '0 0 24 24',
591
+ fill: 'none',
592
+ xmlns: 'http://www.w3.org/2000/svg',
593
+ style: {
594
+ transition: 'all 0.2s ease-in-out'
595
+ },
596
+ children: jsxRuntimeExports.jsx("path", {
597
+ d: 'M12 2L15.09 8.26L22 9.27L17 14.14L18.18 21.02L12 17.77L5.82 21.02L7 14.14L2 9.27L8.91 8.26L12 2Z',
598
+ stroke: stroke,
599
+ fill: fill,
600
+ strokeWidth: '1'
601
+ })
602
+ }));
603
+ };
604
+
433
605
  var isDevelopment$1 = false;
434
606
 
435
607
  /*
@@ -2080,221 +2252,77 @@
2080
2252
  keyframes = _createEmotion.keyframes,
2081
2253
  css$1 = _createEmotion.css;
2082
2254
 
2083
- const staticContainerStyles$3 = ctDesignStyleManager.makeStyles(() => {
2084
- return {
2085
- root: {
2086
- display: 'flex',
2087
- flexDirection: 'column',
2088
- pointerEvents: 'auto'
2089
- }
2090
- };
2091
- });
2092
- function getPointerEventsStyles$3(pointerEvents) {
2093
- if (pointerEvents === 'box-none') {
2094
- return {
2095
- pointerEvents: 'none',
2096
- '& > *': {
2097
- pointerEvents: 'auto'
2255
+ var TypographyVariant;
2256
+ (function (TypographyVariant) {
2257
+ TypographyVariant["HD1"] = "HD1";
2258
+ TypographyVariant["HD2"] = "HD2";
2259
+ TypographyVariant["HD3"] = "HD3";
2260
+ TypographyVariant["HM1"] = "HM1";
2261
+ TypographyVariant["HM2"] = "HM2";
2262
+ TypographyVariant["HM3"] = "HM3";
2263
+ TypographyVariant["HM4"] = "HM4";
2264
+ TypographyVariant["B1"] = "B1";
2265
+ TypographyVariant["B2"] = "B2";
2266
+ TypographyVariant["B3"] = "B3";
2267
+ TypographyVariant["B3CAPS"] = "B3CAPS";
2268
+ TypographyVariant["B4"] = "B4";
2269
+ TypographyVariant["B4CAPS"] = "B4CAPS";
2270
+ TypographyVariant["P1"] = "P1";
2271
+ TypographyVariant["P2"] = "P2";
2272
+ TypographyVariant["P3"] = "P3";
2273
+ TypographyVariant["P4"] = "P4";
2274
+ TypographyVariant["L1"] = "L1";
2275
+ TypographyVariant["L2"] = "L2";
2276
+ TypographyVariant["L3"] = "L3";
2277
+ TypographyVariant["OVERLINE"] = "OVERLINE";
2278
+ TypographyVariant["TAG"] = "TAG";
2279
+ TypographyVariant["M4BOLD"] = "M4BOLD";
2280
+ TypographyVariant["WRAPPER"] = "WRAPPER";
2281
+ })(TypographyVariant || (TypographyVariant = {}));
2282
+ var TypographyColor;
2283
+ (function (TypographyColor) {
2284
+ TypographyColor["PRIMARY"] = "primary";
2285
+ TypographyColor["SECONDARY"] = "secondary";
2286
+ TypographyColor["TERTIARY"] = "tertiary";
2287
+ TypographyColor["HEADING"] = "heading";
2288
+ TypographyColor["SUBHEADING"] = "subheading";
2289
+ TypographyColor["SUCCESS"] = "success";
2290
+ TypographyColor["ALERT"] = "alert";
2291
+ TypographyColor["WARNING"] = "warning";
2292
+ TypographyColor["DISABLED"] = "disabled";
2293
+ TypographyColor["LINK"] = "link";
2294
+ TypographyColor["NEUTRAL"] = "neutral";
2295
+ TypographyColor["LINK2"] = "link2";
2296
+ TypographyColor["PRIMARY2"] = "primary2";
2297
+ TypographyColor["SECONDARY2"] = "secondary2";
2298
+ TypographyColor["GRAPETINI"] = "grapetini900";
2299
+ TypographyColor["PINA_COLADA750"] = "pinacolada750";
2300
+ TypographyColor["BRAND"] = "brand";
2301
+ TypographyColor["ALERT500"] = "alert500";
2302
+ TypographyColor["NEUTRAL50"] = "neutral50";
2303
+ TypographyColor["MARGARITA750"] = "margarita750";
2304
+ TypographyColor["GREEN100"] = "green100";
2305
+ TypographyColor["RED100"] = "red100";
2306
+ TypographyColor["ALERT300"] = "alert300";
2307
+ TypographyColor["RED500"] = "red500";
2308
+ TypographyColor["CORALPINK"] = "coralpink";
2309
+ TypographyColor["WARNING500"] = "warning500";
2310
+ TypographyColor["BLUE700"] = "blue700";
2311
+ TypographyColor["NEUTRAL650"] = "neutral650";
2312
+ TypographyColor["GREY700"] = "grey700";
2313
+ TypographyColor["BLACK000"] = "black000";
2314
+ })(TypographyColor || (TypographyColor = {}));
2315
+ const getTypographyVariant = (theme, variant) => {
2316
+ switch (variant) {
2317
+ case TypographyVariant.HD1:
2318
+ {
2319
+ return {
2320
+ fontSize: theme.typography.size[48],
2321
+ fontWeight: theme.typography.weight.semibold,
2322
+ lineHeight: theme.typography.lineHeight[56]
2323
+ };
2098
2324
  }
2099
- };
2100
- }
2101
- if (pointerEvents === 'box-only') {
2102
- return {
2103
- pointerEvents: 'auto',
2104
- '& > *': {
2105
- pointerEvents: 'none'
2106
- }
2107
- };
2108
- }
2109
- if (pointerEvents === 'none') {
2110
- return {
2111
- pointerEvents: 'none'
2112
- };
2113
- }
2114
- return {
2115
- pointerEvents: 'auto'
2116
- };
2117
- }
2118
- const Container$3 = React.forwardRef(({
2119
- id,
2120
- as: ContainerAs = 'div',
2121
- children,
2122
- styleConfig,
2123
- onClick,
2124
- onLayout,
2125
- onMouseEnter,
2126
- onMouseLeave,
2127
- onTransitionEnd,
2128
- onTouchStart,
2129
- onTouchEnd,
2130
- onTouchCancel,
2131
- onTouchMove,
2132
- pointerEvents,
2133
- hitSlop: _hitSlop,
2134
- hapticEnabled: _hapticEnabled,
2135
- hapticVariant: _hapticVariant,
2136
- hapticRepeat: _hapticRepeat
2137
- }, forwardedRef) => {
2138
- const localRef = React.useRef(null);
2139
- const handleFocus = React.useCallback(() => {
2140
- var _a;
2141
- (_a = localRef.current) === null || _a === void 0 ? void 0 : _a.focus();
2142
- }, []);
2143
- const handleGetBoundingRect = React.useCallback(callback => {
2144
- var _a;
2145
- const rect = (_a = localRef.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
2146
- if (rect) {
2147
- callback === null || callback === void 0 ? void 0 : callback({
2148
- x: rect.x,
2149
- y: rect.y,
2150
- width: rect.width,
2151
- height: rect.height
2152
- });
2153
- }
2154
- }, []);
2155
- const handleAddEventListener = React.useCallback((type, listener, options) => {
2156
- var _a;
2157
- (_a = localRef.current) === null || _a === void 0 ? void 0 : _a.addEventListener(type, listener, options);
2158
- }, []);
2159
- const handleRemoveEventListener = React.useCallback((type, listener, options) => {
2160
- var _a;
2161
- (_a = localRef.current) === null || _a === void 0 ? void 0 : _a.removeEventListener(type, listener, options);
2162
- }, []);
2163
- React.useImperativeHandle(forwardedRef, () => {
2164
- var _a;
2165
- return {
2166
- focus: handleFocus,
2167
- getBoundingRectWithCallback: handleGetBoundingRect,
2168
- getElementRef: () => localRef,
2169
- style: ((_a = localRef.current) === null || _a === void 0 ? void 0 : _a.style) || {},
2170
- classList: {
2171
- add: className => {
2172
- var _a;
2173
- (_a = localRef.current) === null || _a === void 0 ? void 0 : _a.classList.add(className);
2174
- }
2175
- },
2176
- measure: _callback => {
2177
- var _a;
2178
- (_a = localRef.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
2179
- },
2180
- addEventListener: handleAddEventListener,
2181
- removeEventListener: handleRemoveEventListener
2182
- };
2183
- }, [handleFocus, handleGetBoundingRect, handleAddEventListener, handleRemoveEventListener]);
2184
- const {
2185
- root: rootStyles = []
2186
- } = styleConfig || {};
2187
- const pointerEventsStyle = React.useMemo(() => {
2188
- if (pointerEvents == null) return null;
2189
- return getPointerEventsStyles$3(pointerEvents);
2190
- }, [pointerEvents]);
2191
- const mergedRootStyles = ctDesignStyleManager.useWebMergeStyles([staticContainerStyles$3.root, ...rootStyles, ...(pointerEventsStyle ? [pointerEventsStyle] : [])], [rootStyles, pointerEventsStyle]);
2192
- React.useLayoutEffect(() => {
2193
- var _a, _b, _c, _d, _e, _f, _g, _h;
2194
- onLayout === null || onLayout === void 0 ? void 0 : onLayout({
2195
- layout: {
2196
- height: (_b = (_a = localRef.current) === null || _a === void 0 ? void 0 : _a.clientHeight) !== null && _b !== void 0 ? _b : 0,
2197
- width: (_d = (_c = localRef.current) === null || _c === void 0 ? void 0 : _c.clientWidth) !== null && _d !== void 0 ? _d : 0,
2198
- x: (_f = (_e = localRef.current) === null || _e === void 0 ? void 0 : _e.getBoundingClientRect().x) !== null && _f !== void 0 ? _f : 0,
2199
- y: (_h = (_g = localRef.current) === null || _g === void 0 ? void 0 : _g.getBoundingClientRect().y) !== null && _h !== void 0 ? _h : 0
2200
- }
2201
- });
2202
- }, [onLayout]);
2203
- return jsxRuntimeExports.jsx(ContainerAs, {
2204
- id: id,
2205
- ref: localRef,
2206
- className: mergedRootStyles,
2207
- onClick: event => onClick === null || onClick === void 0 ? void 0 : onClick({
2208
- stopPropagation: () => event.stopPropagation(),
2209
- preventDefault: () => event.preventDefault(),
2210
- nativeEvent: {
2211
- locationX: event.clientX,
2212
- locationY: event.clientY
2213
- }
2214
- }),
2215
- onMouseEnter: onMouseEnter,
2216
- onMouseLeave: onMouseLeave,
2217
- onTransitionEnd: onTransitionEnd,
2218
- onTouchStart: onTouchStart,
2219
- onTouchEnd: onTouchEnd,
2220
- onTouchCancel: onTouchCancel,
2221
- onTouchMove: onTouchMove,
2222
- children: children
2223
- });
2224
- });
2225
- Container$3.displayName = 'Container';
2226
-
2227
- var TypographyVariant$2;
2228
- (function (TypographyVariant) {
2229
- TypographyVariant["HD1"] = "HD1";
2230
- TypographyVariant["HD2"] = "HD2";
2231
- TypographyVariant["HD3"] = "HD3";
2232
- TypographyVariant["HM1"] = "HM1";
2233
- TypographyVariant["HM2"] = "HM2";
2234
- TypographyVariant["HM3"] = "HM3";
2235
- TypographyVariant["HM4"] = "HM4";
2236
- TypographyVariant["B1"] = "B1";
2237
- TypographyVariant["B2"] = "B2";
2238
- TypographyVariant["B3"] = "B3";
2239
- TypographyVariant["B3CAPS"] = "B3CAPS";
2240
- TypographyVariant["B4"] = "B4";
2241
- TypographyVariant["B4CAPS"] = "B4CAPS";
2242
- TypographyVariant["P1"] = "P1";
2243
- TypographyVariant["P2"] = "P2";
2244
- TypographyVariant["P3"] = "P3";
2245
- TypographyVariant["P4"] = "P4";
2246
- TypographyVariant["L1"] = "L1";
2247
- TypographyVariant["L2"] = "L2";
2248
- TypographyVariant["L3"] = "L3";
2249
- TypographyVariant["OVERLINE"] = "OVERLINE";
2250
- TypographyVariant["TAG"] = "TAG";
2251
- TypographyVariant["M4BOLD"] = "M4BOLD";
2252
- TypographyVariant["WRAPPER"] = "WRAPPER";
2253
- })(TypographyVariant$2 || (TypographyVariant$2 = {}));
2254
- var TypographyColor$2;
2255
- (function (TypographyColor) {
2256
- TypographyColor["PRIMARY"] = "primary";
2257
- TypographyColor["SECONDARY"] = "secondary";
2258
- TypographyColor["TERTIARY"] = "tertiary";
2259
- TypographyColor["HEADING"] = "heading";
2260
- TypographyColor["SUBHEADING"] = "subheading";
2261
- TypographyColor["SUCCESS"] = "success";
2262
- TypographyColor["ALERT"] = "alert";
2263
- TypographyColor["WARNING"] = "warning";
2264
- TypographyColor["DISABLED"] = "disabled";
2265
- TypographyColor["LINK"] = "link";
2266
- TypographyColor["NEUTRAL"] = "neutral";
2267
- TypographyColor["LINK2"] = "link2";
2268
- TypographyColor["PRIMARY2"] = "primary2";
2269
- TypographyColor["SECONDARY2"] = "secondary2";
2270
- TypographyColor["GRAPETINI"] = "grapetini900";
2271
- TypographyColor["PINA_COLADA750"] = "pinacolada750";
2272
- TypographyColor["BRAND"] = "brand";
2273
- TypographyColor["ALERT500"] = "alert500";
2274
- TypographyColor["NEUTRAL50"] = "neutral50";
2275
- TypographyColor["MARGARITA750"] = "margarita750";
2276
- TypographyColor["GREEN100"] = "green100";
2277
- TypographyColor["RED100"] = "red100";
2278
- TypographyColor["ALERT300"] = "alert300";
2279
- TypographyColor["RED500"] = "red500";
2280
- TypographyColor["CORALPINK"] = "coralpink";
2281
- TypographyColor["WARNING500"] = "warning500";
2282
- TypographyColor["BLUE700"] = "blue700";
2283
- TypographyColor["NEUTRAL650"] = "neutral650";
2284
- TypographyColor["GREY700"] = "grey700";
2285
- TypographyColor["BLACK000"] = "black000";
2286
- })(TypographyColor$2 || (TypographyColor$2 = {}));
2287
- const getTypographyVariant$2 = (theme, variant) => {
2288
- switch (variant) {
2289
- case TypographyVariant$2.HD1:
2290
- {
2291
- return {
2292
- fontSize: theme.typography.size[48],
2293
- fontWeight: theme.typography.weight.semibold,
2294
- lineHeight: theme.typography.lineHeight[56]
2295
- };
2296
- }
2297
- case TypographyVariant$2.HD2:
2325
+ case TypographyVariant.HD2:
2298
2326
  {
2299
2327
  return {
2300
2328
  fontSize: theme.typography.size[40],
@@ -2302,7 +2330,7 @@
2302
2330
  lineHeight: theme.typography.lineHeight[48]
2303
2331
  };
2304
2332
  }
2305
- case TypographyVariant$2.HD3:
2333
+ case TypographyVariant.HD3:
2306
2334
  {
2307
2335
  return {
2308
2336
  fontSize: theme.typography.size[32],
@@ -2310,7 +2338,7 @@
2310
2338
  lineHeight: theme.typography.lineHeight[40]
2311
2339
  };
2312
2340
  }
2313
- case TypographyVariant$2.HM1:
2341
+ case TypographyVariant.HM1:
2314
2342
  {
2315
2343
  return {
2316
2344
  fontSize: theme.typography.size[24],
@@ -2318,7 +2346,7 @@
2318
2346
  lineHeight: theme.typography.lineHeight[32]
2319
2347
  };
2320
2348
  }
2321
- case TypographyVariant$2.HM2:
2349
+ case TypographyVariant.HM2:
2322
2350
  {
2323
2351
  return {
2324
2352
  fontSize: theme.typography.size[20],
@@ -2326,7 +2354,7 @@
2326
2354
  lineHeight: theme.typography.lineHeight[28]
2327
2355
  };
2328
2356
  }
2329
- case TypographyVariant$2.HM3:
2357
+ case TypographyVariant.HM3:
2330
2358
  {
2331
2359
  return {
2332
2360
  fontSize: theme.typography.size[16],
@@ -2334,7 +2362,7 @@
2334
2362
  lineHeight: theme.typography.lineHeight[24]
2335
2363
  };
2336
2364
  }
2337
- case TypographyVariant$2.HM4:
2365
+ case TypographyVariant.HM4:
2338
2366
  {
2339
2367
  return {
2340
2368
  fontSize: theme.typography.size[14],
@@ -2342,7 +2370,7 @@
2342
2370
  lineHeight: theme.typography.lineHeight[20]
2343
2371
  };
2344
2372
  }
2345
- case TypographyVariant$2.B1:
2373
+ case TypographyVariant.B1:
2346
2374
  {
2347
2375
  return {
2348
2376
  fontSize: theme.typography.size[16],
@@ -2350,7 +2378,7 @@
2350
2378
  lineHeight: theme.typography.lineHeight[24]
2351
2379
  };
2352
2380
  }
2353
- case TypographyVariant$2.B2:
2381
+ case TypographyVariant.B2:
2354
2382
  {
2355
2383
  return {
2356
2384
  fontSize: theme.typography.size[14],
@@ -2358,7 +2386,7 @@
2358
2386
  lineHeight: theme.typography.lineHeight[20]
2359
2387
  };
2360
2388
  }
2361
- case TypographyVariant$2.B3:
2389
+ case TypographyVariant.B3:
2362
2390
  {
2363
2391
  return {
2364
2392
  fontSize: theme.typography.size[12],
@@ -2366,7 +2394,7 @@
2366
2394
  lineHeight: theme.typography.lineHeight[16]
2367
2395
  };
2368
2396
  }
2369
- case TypographyVariant$2.B3CAPS:
2397
+ case TypographyVariant.B3CAPS:
2370
2398
  {
2371
2399
  return {
2372
2400
  fontSize: theme.typography.size[12],
@@ -2376,7 +2404,7 @@
2376
2404
  textTransform: 'uppercase'
2377
2405
  };
2378
2406
  }
2379
- case TypographyVariant$2.B4:
2407
+ case TypographyVariant.B4:
2380
2408
  {
2381
2409
  return {
2382
2410
  fontSize: theme.typography.size[10],
@@ -2384,7 +2412,7 @@
2384
2412
  lineHeight: theme.typography.lineHeight[14]
2385
2413
  };
2386
2414
  }
2387
- case TypographyVariant$2.B4CAPS:
2415
+ case TypographyVariant.B4CAPS:
2388
2416
  {
2389
2417
  return {
2390
2418
  fontSize: theme.typography.size[10],
@@ -2394,7 +2422,7 @@
2394
2422
  textTransform: 'uppercase'
2395
2423
  };
2396
2424
  }
2397
- case TypographyVariant$2.P1:
2425
+ case TypographyVariant.P1:
2398
2426
  {
2399
2427
  return {
2400
2428
  fontSize: theme.typography.size[16],
@@ -2402,7 +2430,7 @@
2402
2430
  lineHeight: theme.typography.lineHeight[22]
2403
2431
  };
2404
2432
  }
2405
- case TypographyVariant$2.P2:
2433
+ case TypographyVariant.P2:
2406
2434
  {
2407
2435
  return {
2408
2436
  fontSize: theme.typography.size[14],
@@ -2410,7 +2438,7 @@
2410
2438
  lineHeight: theme.typography.lineHeight[20]
2411
2439
  };
2412
2440
  }
2413
- case TypographyVariant$2.P3:
2441
+ case TypographyVariant.P3:
2414
2442
  {
2415
2443
  return {
2416
2444
  fontSize: theme.typography.size[12],
@@ -2418,7 +2446,7 @@
2418
2446
  lineHeight: theme.typography.lineHeight[16]
2419
2447
  };
2420
2448
  }
2421
- case TypographyVariant$2.P4:
2449
+ case TypographyVariant.P4:
2422
2450
  {
2423
2451
  return {
2424
2452
  fontSize: theme.typography.size[10],
@@ -2426,7 +2454,7 @@
2426
2454
  lineHeight: theme.typography.lineHeight[14]
2427
2455
  };
2428
2456
  }
2429
- case TypographyVariant$2.L1:
2457
+ case TypographyVariant.L1:
2430
2458
  {
2431
2459
  return {
2432
2460
  fontSize: theme.typography.size[16],
@@ -2434,7 +2462,7 @@
2434
2462
  lineHeight: theme.typography.lineHeight[24]
2435
2463
  };
2436
2464
  }
2437
- case TypographyVariant$2.L2:
2465
+ case TypographyVariant.L2:
2438
2466
  {
2439
2467
  return {
2440
2468
  fontSize: theme.typography.size[14],
@@ -2442,7 +2470,7 @@
2442
2470
  lineHeight: theme.typography.lineHeight[20]
2443
2471
  };
2444
2472
  }
2445
- case TypographyVariant$2.L3:
2473
+ case TypographyVariant.L3:
2446
2474
  {
2447
2475
  return {
2448
2476
  fontSize: theme.typography.size[12],
@@ -2450,7 +2478,7 @@
2450
2478
  lineHeight: theme.typography.lineHeight[16]
2451
2479
  };
2452
2480
  }
2453
- case TypographyVariant$2.OVERLINE:
2481
+ case TypographyVariant.OVERLINE:
2454
2482
  {
2455
2483
  return {
2456
2484
  fontSize: theme.typography.size[12],
@@ -2458,7 +2486,7 @@
2458
2486
  lineHeight: theme.typography.lineHeight[16]
2459
2487
  };
2460
2488
  }
2461
- case TypographyVariant$2.TAG:
2489
+ case TypographyVariant.TAG:
2462
2490
  {
2463
2491
  return {
2464
2492
  fontSize: theme.typography.size[10],
@@ -2477,122 +2505,122 @@
2477
2505
  }
2478
2506
  }
2479
2507
  };
2480
- const getTypographyColor$2 = (theme, color) => {
2508
+ const getTypographyColor = (theme, color) => {
2481
2509
  switch (color) {
2482
- case TypographyColor$2.PRIMARY:
2510
+ case TypographyColor.PRIMARY:
2483
2511
  {
2484
2512
  return theme.color.text.primary;
2485
2513
  }
2486
- case TypographyColor$2.SECONDARY:
2514
+ case TypographyColor.SECONDARY:
2487
2515
  {
2488
2516
  return theme.color.text.secondary;
2489
2517
  }
2490
- case TypographyColor$2.TERTIARY:
2518
+ case TypographyColor.TERTIARY:
2491
2519
  {
2492
2520
  return theme.color.text.tertiary;
2493
2521
  }
2494
- case TypographyColor$2.ALERT:
2522
+ case TypographyColor.ALERT:
2495
2523
  {
2496
2524
  return theme.color.text.alert;
2497
2525
  }
2498
- case TypographyColor$2.DISABLED:
2526
+ case TypographyColor.DISABLED:
2499
2527
  {
2500
2528
  return theme.color.text.disabled;
2501
2529
  }
2502
- case TypographyColor$2.HEADING:
2530
+ case TypographyColor.HEADING:
2503
2531
  {
2504
2532
  return theme.color.text.heading;
2505
2533
  }
2506
- case TypographyColor$2.LINK:
2534
+ case TypographyColor.LINK:
2507
2535
  {
2508
2536
  return theme.color.text.link;
2509
2537
  }
2510
- case TypographyColor$2.SUBHEADING:
2538
+ case TypographyColor.SUBHEADING:
2511
2539
  {
2512
2540
  return theme.color.text.subHeading;
2513
2541
  }
2514
- case TypographyColor$2.SUCCESS:
2542
+ case TypographyColor.SUCCESS:
2515
2543
  {
2516
2544
  return theme.color.text.success;
2517
2545
  }
2518
- case TypographyColor$2.WARNING:
2546
+ case TypographyColor.WARNING:
2519
2547
  {
2520
2548
  return theme.color.text.warning;
2521
2549
  }
2522
- case TypographyColor$2.NEUTRAL:
2550
+ case TypographyColor.NEUTRAL:
2523
2551
  {
2524
2552
  return theme.color.text.neutral;
2525
2553
  }
2526
- case TypographyColor$2.LINK2:
2554
+ case TypographyColor.LINK2:
2527
2555
  {
2528
2556
  return theme.color.text.link2;
2529
2557
  }
2530
- case TypographyColor$2.PRIMARY2:
2558
+ case TypographyColor.PRIMARY2:
2531
2559
  {
2532
2560
  return theme.color.text.primary2;
2533
2561
  }
2534
- case TypographyColor$2.SECONDARY2:
2562
+ case TypographyColor.SECONDARY2:
2535
2563
  {
2536
2564
  return theme.color.text.secondary2;
2537
2565
  }
2538
- case TypographyColor$2.GRAPETINI:
2566
+ case TypographyColor.GRAPETINI:
2539
2567
  {
2540
2568
  return theme.color.text.grapetini900;
2541
2569
  }
2542
- case TypographyColor$2.PINA_COLADA750:
2570
+ case TypographyColor.PINA_COLADA750:
2543
2571
  {
2544
2572
  return theme.color.text.pinaColada750;
2545
2573
  }
2546
- case TypographyColor$2.CORALPINK:
2574
+ case TypographyColor.CORALPINK:
2547
2575
  {
2548
2576
  return theme.color.text.coralpink;
2549
2577
  }
2550
- case TypographyColor$2.NEUTRAL50:
2578
+ case TypographyColor.NEUTRAL50:
2551
2579
  {
2552
2580
  return theme.color.text.neutral50;
2553
2581
  }
2554
- case TypographyColor$2.WARNING500:
2555
- case TypographyColor$2.ALERT500:
2582
+ case TypographyColor.WARNING500:
2583
+ case TypographyColor.ALERT500:
2556
2584
  {
2557
2585
  return theme.color.text.alert500;
2558
2586
  }
2559
- case TypographyColor$2.BRAND:
2587
+ case TypographyColor.BRAND:
2560
2588
  {
2561
2589
  return theme.color.text.brand;
2562
2590
  }
2563
- case TypographyColor$2.MARGARITA750:
2591
+ case TypographyColor.MARGARITA750:
2564
2592
  {
2565
2593
  return theme.color.text.margarita750;
2566
2594
  }
2567
- case TypographyColor$2.GREEN100:
2595
+ case TypographyColor.GREEN100:
2568
2596
  {
2569
2597
  return theme.color.text.green100;
2570
2598
  }
2571
- case TypographyColor$2.RED100:
2599
+ case TypographyColor.RED100:
2572
2600
  {
2573
2601
  return theme.color.text.red100;
2574
2602
  }
2575
- case TypographyColor$2.ALERT300:
2603
+ case TypographyColor.ALERT300:
2576
2604
  {
2577
2605
  return theme.color.text.alert300;
2578
2606
  }
2579
- case TypographyColor$2.RED500:
2607
+ case TypographyColor.RED500:
2580
2608
  {
2581
2609
  return theme.color.text.red500;
2582
2610
  }
2583
- case TypographyColor$2.BLUE700:
2611
+ case TypographyColor.BLUE700:
2584
2612
  {
2585
2613
  return theme.color.text.blue700;
2586
2614
  }
2587
- case TypographyColor$2.NEUTRAL650:
2615
+ case TypographyColor.NEUTRAL650:
2588
2616
  {
2589
2617
  return theme.color.text.neutral650;
2590
2618
  }
2591
- case TypographyColor$2.GREY700:
2619
+ case TypographyColor.GREY700:
2592
2620
  {
2593
2621
  return theme.color.text.gray700;
2594
2622
  }
2595
- case TypographyColor$2.BLACK000:
2623
+ case TypographyColor.BLACK000:
2596
2624
  {
2597
2625
  return theme.color.text.black000;
2598
2626
  }
@@ -2602,7 +2630,7 @@
2602
2630
  }
2603
2631
  }
2604
2632
  };
2605
- const getLineClampStyles$2 = lineClamp => {
2633
+ const getLineClampStyles = lineClamp => {
2606
2634
  if (!lineClamp) {
2607
2635
  return {};
2608
2636
  }
@@ -2626,7 +2654,7 @@
2626
2654
  minWidth: 0
2627
2655
  };
2628
2656
  };
2629
- const getTypographyStyles$2 = ({
2657
+ const getTypographyStyles = ({
2630
2658
  theme,
2631
2659
  variant,
2632
2660
  color,
@@ -2636,13 +2664,13 @@
2636
2664
  showInItalics
2637
2665
  }) => {
2638
2666
  const textDecorationLine = isStriked ? 'line-through' : 'none';
2639
- return Object.assign(Object.assign({}, getTypographyVariant$2(theme, variant !== null && variant !== void 0 ? variant : TypographyVariant$2.HM2)), {
2640
- color: colorCode || getTypographyColor$2(theme, color !== null && color !== void 0 ? color : TypographyColor$2.PRIMARY),
2667
+ return Object.assign(Object.assign({}, getTypographyVariant(theme, variant !== null && variant !== void 0 ? variant : TypographyVariant.HM2)), {
2668
+ color: colorCode || getTypographyColor(theme, color !== null && color !== void 0 ? color : TypographyColor.PRIMARY),
2641
2669
  textDecorationLine: isUnderlined ? 'underline' : textDecorationLine,
2642
2670
  fontStyle: showInItalics ? 'italic' : 'none'
2643
2671
  });
2644
2672
  };
2645
- const getTextType$2 = variant => {
2673
+ const getTextType = variant => {
2646
2674
  var _a;
2647
2675
  const variantMapper = {
2648
2676
  HD1: 'h1',
@@ -2672,10 +2700,10 @@
2672
2700
  };
2673
2701
  return (_a = variantMapper[variant]) !== null && _a !== void 0 ? _a : 'span';
2674
2702
  };
2675
- const Typography$2 = ({
2703
+ const Typography = ({
2676
2704
  children = null,
2677
2705
  variant,
2678
- color = TypographyColor$2.PRIMARY,
2706
+ color = TypographyColor.PRIMARY,
2679
2707
  isClickable,
2680
2708
  isStriked = false,
2681
2709
  isUnderlined = false,
@@ -2691,7 +2719,7 @@
2691
2719
  const parsedIsClickable = typeof isClickable === 'boolean' ? isClickable : !!onClick;
2692
2720
  const typographyStyles = ctDesignStyleManager.useStyles(theme => {
2693
2721
  return {
2694
- root: getTypographyStyles$2({
2722
+ root: getTypographyStyles({
2695
2723
  theme,
2696
2724
  variant,
2697
2725
  color,
@@ -2710,17 +2738,17 @@
2710
2738
  container: customContainerStyles = []
2711
2739
  } = styleConfig || {};
2712
2740
  const clampClass = React.useMemo(() => {
2713
- return /*#__PURE__*/css$1(getLineClampStyles$2(lineClamp), "" , "" );
2741
+ return /*#__PURE__*/css$1(getLineClampStyles(lineClamp), "" , "" );
2714
2742
  }, [lineClamp]);
2715
2743
  const mergedRootStyles = ctDesignStyleManager.useWebMergeStyles([typographyStyles.root, clampClass, ...customRootStyles], [typographyStyles.root, clampClass, customRootStyles]);
2716
- const ComponentToRender = lineClamp ? 'div' : componentNode || getTextType$2(variant) || 'p';
2744
+ const ComponentToRender = lineClamp ? 'div' : componentNode || getTextType(variant) || 'p';
2717
2745
  const isInlineNode = ComponentToRender === 'span';
2718
2746
  if (parsedIsClickable) {
2719
2747
  const containerAs = isInlineNode ? 'span' : 'div';
2720
2748
  const clickableContainerStyles = isInlineNode ? [{
2721
2749
  display: 'inline'
2722
2750
  }, ...customContainerStyles] : customContainerStyles;
2723
- return jsxRuntimeExports.jsx(Container$3, {
2751
+ return jsxRuntimeExports.jsx(Container, {
2724
2752
  onClick: onClick,
2725
2753
  styleConfig: {
2726
2754
  root: clickableContainerStyles
@@ -2756,6 +2784,7 @@
2756
2784
  BadgeColors["BLUE"] = "blue";
2757
2785
  BadgeColors["DEFAULT"] = "default";
2758
2786
  BadgeColors["GREEN"] = "green";
2787
+ BadgeColors["GREEN_500"] = "green500";
2759
2788
  BadgeColors["MARGARITA_250"] = "margarita250";
2760
2789
  BadgeColors["MARGARITA_100"] = "margarita100";
2761
2790
  BadgeColors["MARGARITA_900"] = "margarita900";
@@ -2765,7 +2794,9 @@
2765
2794
  BadgeColors["PINA_COLADA"] = "pinaColada";
2766
2795
  BadgeColors["NEUTRAL_700"] = "neutral700";
2767
2796
  BadgeColors["RED"] = "red";
2797
+ BadgeColors["RED_500"] = "red500";
2768
2798
  BadgeColors["YELLOW"] = "yellow";
2799
+ BadgeColors["ALERT_500"] = "alert500";
2769
2800
  BadgeColors["LINK"] = "link";
2770
2801
  BadgeColors["LINK_TEXT"] = "linkText";
2771
2802
  BadgeColors["BLUE100"] = "blue100";
@@ -2826,9 +2857,12 @@
2826
2857
  [BadgeColors.ORANGE_250]: theme.color.badge.orange250,
2827
2858
  [BadgeColors.ORANGE_500]: theme.color.badge.orange500,
2828
2859
  [BadgeColors.PINA_COLADA]: theme.color.badge.pinaColada,
2860
+ [BadgeColors.NEUTRAL_700]: theme.color.badge.neutral700,
2829
2861
  [BadgeColors.RED]: theme.color.badge.red,
2862
+ [BadgeColors.RED_500]: theme.color.badge.red500,
2830
2863
  [BadgeColors.WHITE]: theme.color.badge.neutral100,
2831
2864
  [BadgeColors.YELLOW]: theme.color.badge.yellow,
2865
+ [BadgeColors.ALERT_500]: theme.color.badge.alert500,
2832
2866
  [BadgeColors.LINK]: theme.color.badge.link,
2833
2867
  [BadgeColors.LINK_TEXT]: theme.color.badge.link,
2834
2868
  [BadgeColors.BLUE100]: theme.color.badge.blue100,
@@ -2968,12 +3002,12 @@
2968
3002
  }), getBadgePadding(theme, size)), getBadgeBorder(theme, colorScheme))
2969
3003
  };
2970
3004
  }, [colorScheme, size, textColor]);
2971
- return jsxRuntimeExports.jsxs(Container$3, {
3005
+ return jsxRuntimeExports.jsxs(Container, {
2972
3006
  ref: forwardedRef,
2973
3007
  styleConfig: {
2974
3008
  root: [badgeStaticStyles.root, dynamicStyles.root, ...root]
2975
3009
  },
2976
- children: [prefixIconNode, !!text && typeof text === 'string' ? jsxRuntimeExports.jsx(Typography$2, {
3010
+ children: [prefixIconNode, !!text && typeof text === 'string' ? jsxRuntimeExports.jsx(Typography, {
2977
3011
  variant: getTextVariant(size),
2978
3012
  styleConfig: {
2979
3013
  root: textNodeContainer
@@ -3431,14 +3465,80 @@
3431
3465
  IconPosition["RIGHT"] = "right";
3432
3466
  })(IconPosition || (IconPosition = {}));
3433
3467
 
3434
- /**
3435
- * SSR Window 3.0.0
3436
- * Better handling for window object in SSR environment
3437
- * https://github.com/nolimits4web/ssr-window
3438
- *
3439
- * Copyright 2020, Vladimir Kharlampidi
3440
- *
3441
- * Licensed under MIT
3468
+ var Platform;
3469
+ (function (Platform) {
3470
+ Platform["IOS"] = "iOS";
3471
+ Platform["PWA"] = "PWA";
3472
+ Platform["ANDROID"] = "Android";
3473
+ })(Platform || (Platform = {}));
3474
+ var AppAgent;
3475
+ (function (AppAgent) {
3476
+ AppAgent["PWA"] = "PWA";
3477
+ AppAgent["IOS"] = "iPhoneApp";
3478
+ AppAgent["ANDROID"] = "AndroidApp";
3479
+ AppAgent["H_PWA"] = "pwa";
3480
+ AppAgent["H_IOS"] = "ios";
3481
+ AppAgent["H_ANDROID"] = "android";
3482
+ AppAgent["H_UNKNOWN"] = "unrecognised";
3483
+ })(AppAgent || (AppAgent = {}));
3484
+ class PromiseHandler {
3485
+ constructor(options = {}) {
3486
+ this.queue = [];
3487
+ this.running = 0;
3488
+ this.clear = () => {
3489
+ this.queue = [];
3490
+ this.running = 0;
3491
+ };
3492
+ this.add = async (task, ref) => {
3493
+ if (!ref) {
3494
+ return Promise.resolve();
3495
+ }
3496
+ return new Promise((resolve, reject) => {
3497
+ this.queue.push(async () => {
3498
+ try {
3499
+ const result = await task();
3500
+ resolve(result);
3501
+ } catch (error) {
3502
+ if (error instanceof Error) {
3503
+ reject(error);
3504
+ } else {
3505
+ reject(new Error('Unknown error'));
3506
+ }
3507
+ } finally {
3508
+ if (this.running > -1) {
3509
+ this.running--;
3510
+ this.processQueue();
3511
+ }
3512
+ }
3513
+ });
3514
+ this.processQueue();
3515
+ });
3516
+ };
3517
+ this.processQueue = () => {
3518
+ while (this.running < this.concurrency && this.queue.length > 0) {
3519
+ const task = this.queue.shift();
3520
+ if (task) {
3521
+ this.running++;
3522
+ task();
3523
+ }
3524
+ }
3525
+ };
3526
+ this.concurrency = options.concurrency || 5;
3527
+ }
3528
+ }
3529
+ const createPromiseHandler = options => {
3530
+ return new PromiseHandler(options);
3531
+ };
3532
+ createPromiseHandler();
3533
+
3534
+ /**
3535
+ * SSR Window 3.0.0
3536
+ * Better handling for window object in SSR environment
3537
+ * https://github.com/nolimits4web/ssr-window
3538
+ *
3539
+ * Copyright 2020, Vladimir Kharlampidi
3540
+ *
3541
+ * Licensed under MIT
3442
3542
  *
3443
3543
  * Released on: November 9, 2020
3444
3544
  */
@@ -9076,72 +9176,6 @@
9076
9176
  })(eventemitter3);
9077
9177
  var EventEmitter = eventemitter3Exports;
9078
9178
 
9079
- var Platform$1;
9080
- (function (Platform) {
9081
- Platform["IOS"] = "iOS";
9082
- Platform["PWA"] = "PWA";
9083
- Platform["ANDROID"] = "Android";
9084
- })(Platform$1 || (Platform$1 = {}));
9085
- var AppAgent$1;
9086
- (function (AppAgent) {
9087
- AppAgent["PWA"] = "PWA";
9088
- AppAgent["IOS"] = "iPhoneApp";
9089
- AppAgent["ANDROID"] = "AndroidApp";
9090
- AppAgent["H_PWA"] = "pwa";
9091
- AppAgent["H_IOS"] = "ios";
9092
- AppAgent["H_ANDROID"] = "android";
9093
- AppAgent["H_UNKNOWN"] = "unrecognised";
9094
- })(AppAgent$1 || (AppAgent$1 = {}));
9095
- let PromiseHandler$1 = class PromiseHandler {
9096
- constructor(options = {}) {
9097
- this.queue = [];
9098
- this.running = 0;
9099
- this.clear = () => {
9100
- this.queue = [];
9101
- this.running = 0;
9102
- };
9103
- this.add = async (task, ref) => {
9104
- if (!ref) {
9105
- return Promise.resolve();
9106
- }
9107
- return new Promise((resolve, reject) => {
9108
- this.queue.push(async () => {
9109
- try {
9110
- const result = await task();
9111
- resolve(result);
9112
- } catch (error) {
9113
- if (error instanceof Error) {
9114
- reject(error);
9115
- } else {
9116
- reject(new Error('Unknown error'));
9117
- }
9118
- } finally {
9119
- if (this.running > -1) {
9120
- this.running--;
9121
- this.processQueue();
9122
- }
9123
- }
9124
- });
9125
- this.processQueue();
9126
- });
9127
- };
9128
- this.processQueue = () => {
9129
- while (this.running < this.concurrency && this.queue.length > 0) {
9130
- const task = this.queue.shift();
9131
- if (task) {
9132
- this.running++;
9133
- task();
9134
- }
9135
- }
9136
- };
9137
- this.concurrency = options.concurrency || 5;
9138
- }
9139
- };
9140
- const createPromiseHandler$1 = options => {
9141
- return new PromiseHandler$1(options);
9142
- };
9143
- createPromiseHandler$1();
9144
-
9145
9179
  var EVENT_NAMES;
9146
9180
  (function (EVENT_NAMES) {
9147
9181
  EVENT_NAMES["SCROLL_VIEW"] = "scroll-view";
@@ -11669,72 +11703,6 @@
11669
11703
  List.displayName = 'List';
11670
11704
  React.createContext(undefined);
11671
11705
 
11672
- var Platform;
11673
- (function (Platform) {
11674
- Platform["IOS"] = "iOS";
11675
- Platform["PWA"] = "PWA";
11676
- Platform["ANDROID"] = "Android";
11677
- })(Platform || (Platform = {}));
11678
- var AppAgent;
11679
- (function (AppAgent) {
11680
- AppAgent["PWA"] = "PWA";
11681
- AppAgent["IOS"] = "iPhoneApp";
11682
- AppAgent["ANDROID"] = "AndroidApp";
11683
- AppAgent["H_PWA"] = "pwa";
11684
- AppAgent["H_IOS"] = "ios";
11685
- AppAgent["H_ANDROID"] = "android";
11686
- AppAgent["H_UNKNOWN"] = "unrecognised";
11687
- })(AppAgent || (AppAgent = {}));
11688
- class PromiseHandler {
11689
- constructor(options = {}) {
11690
- this.queue = [];
11691
- this.running = 0;
11692
- this.clear = () => {
11693
- this.queue = [];
11694
- this.running = 0;
11695
- };
11696
- this.add = async (task, ref) => {
11697
- if (!ref) {
11698
- return Promise.resolve();
11699
- }
11700
- return new Promise((resolve, reject) => {
11701
- this.queue.push(async () => {
11702
- try {
11703
- const result = await task();
11704
- resolve(result);
11705
- } catch (error) {
11706
- if (error instanceof Error) {
11707
- reject(error);
11708
- } else {
11709
- reject(new Error('Unknown error'));
11710
- }
11711
- } finally {
11712
- if (this.running > -1) {
11713
- this.running--;
11714
- this.processQueue();
11715
- }
11716
- }
11717
- });
11718
- this.processQueue();
11719
- });
11720
- };
11721
- this.processQueue = () => {
11722
- while (this.running < this.concurrency && this.queue.length > 0) {
11723
- const task = this.queue.shift();
11724
- if (task) {
11725
- this.running++;
11726
- task();
11727
- }
11728
- }
11729
- };
11730
- this.concurrency = options.concurrency || 5;
11731
- }
11732
- }
11733
- const createPromiseHandler = options => {
11734
- return new PromiseHandler(options);
11735
- };
11736
- createPromiseHandler();
11737
-
11738
11706
  const WebIntersectionObserver = ({
11739
11707
  children,
11740
11708
  onIntersection,
@@ -11816,2257 +11784,769 @@
11816
11784
  });
11817
11785
  };
11818
11786
 
11819
- const staticContainerStyles$2 = ctDesignStyleManager.makeStyles(() => {
11820
- return {
11821
- root: {
11822
- display: 'flex',
11823
- flexDirection: 'column',
11824
- pointerEvents: 'auto'
11825
- }
11826
- };
11827
- });
11828
- function getPointerEventsStyles$2(pointerEvents) {
11829
- if (pointerEvents === 'box-none') {
11830
- return {
11831
- pointerEvents: 'none',
11832
- '& > *': {
11833
- pointerEvents: 'auto'
11834
- }
11835
- };
11836
- }
11837
- if (pointerEvents === 'box-only') {
11838
- return {
11839
- pointerEvents: 'auto',
11840
- '& > *': {
11841
- pointerEvents: 'none'
11842
- }
11843
- };
11844
- }
11845
- if (pointerEvents === 'none') {
11846
- return {
11847
- pointerEvents: 'none'
11848
- };
11787
+ const staticStyles$3 = ctDesignStyleManager.makeStyles(() => ({
11788
+ swiper: {
11789
+ width: '100%',
11790
+ height: '100%'
11791
+ },
11792
+ swiperSlide: {
11793
+ backgroundColor: 'white'
11794
+ },
11795
+ swiperSlideImg: {
11796
+ width: '100%',
11797
+ height: '100%',
11798
+ objectFit: 'cover'
11849
11799
  }
11850
- return {
11851
- pointerEvents: 'auto'
11852
- };
11853
- }
11854
- const Container$2 = React.forwardRef(({
11855
- id,
11856
- as: ContainerAs = 'div',
11857
- children,
11858
- styleConfig,
11859
- onClick,
11860
- onLayout,
11861
- onMouseEnter,
11862
- onMouseLeave,
11863
- onTransitionEnd,
11864
- onTouchStart,
11865
- onTouchEnd,
11866
- onTouchCancel,
11867
- onTouchMove,
11868
- pointerEvents,
11869
- hitSlop: _hitSlop,
11870
- hapticEnabled: _hapticEnabled,
11871
- hapticVariant: _hapticVariant,
11872
- hapticRepeat: _hapticRepeat
11873
- }, forwardedRef) => {
11874
- const localRef = React.useRef(null);
11875
- const handleFocus = React.useCallback(() => {
11876
- var _a;
11877
- (_a = localRef.current) === null || _a === void 0 ? void 0 : _a.focus();
11878
- }, []);
11879
- const handleGetBoundingRect = React.useCallback(callback => {
11880
- var _a;
11881
- const rect = (_a = localRef.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
11882
- if (rect) {
11883
- callback === null || callback === void 0 ? void 0 : callback({
11884
- x: rect.x,
11885
- y: rect.y,
11886
- width: rect.width,
11887
- height: rect.height
11888
- });
11800
+ }));
11801
+ const Swiper = React.forwardRef(({
11802
+ data,
11803
+ autoPlay = false,
11804
+ isInfinite = false,
11805
+ autoPlaySpeed = 500,
11806
+ autoSwipeDuration = 1000,
11807
+ children = [],
11808
+ stopAutoplayOnUserInteraction = false,
11809
+ onSlide,
11810
+ renderItem
11811
+ }) => {
11812
+ const userHasInteractedRef = React.useRef(false);
11813
+ const [shouldAutoplay, setShouldAutoplay] = React.useState(false);
11814
+ const handleIntersection = React.useCallback(() => {
11815
+ if (autoPlay && (!stopAutoplayOnUserInteraction || !userHasInteractedRef.current)) {
11816
+ setShouldAutoplay(true);
11889
11817
  }
11890
- }, []);
11891
- const handleAddEventListener = React.useCallback((type, listener, options) => {
11892
- var _a;
11893
- (_a = localRef.current) === null || _a === void 0 ? void 0 : _a.addEventListener(type, listener, options);
11894
- }, []);
11895
- const handleRemoveEventListener = React.useCallback((type, listener, options) => {
11896
- var _a;
11897
- (_a = localRef.current) === null || _a === void 0 ? void 0 : _a.removeEventListener(type, listener, options);
11898
- }, []);
11899
- React.useImperativeHandle(forwardedRef, () => {
11900
- var _a;
11901
- return {
11902
- focus: handleFocus,
11903
- getBoundingRectWithCallback: handleGetBoundingRect,
11904
- getElementRef: () => localRef,
11905
- style: ((_a = localRef.current) === null || _a === void 0 ? void 0 : _a.style) || {},
11906
- classList: {
11907
- add: className => {
11908
- var _a;
11909
- (_a = localRef.current) === null || _a === void 0 ? void 0 : _a.classList.add(className);
11910
- }
11911
- },
11912
- measure: _callback => {
11913
- var _a;
11914
- (_a = localRef.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
11915
- },
11916
- addEventListener: handleAddEventListener,
11917
- removeEventListener: handleRemoveEventListener
11918
- };
11919
- }, [handleFocus, handleGetBoundingRect, handleAddEventListener, handleRemoveEventListener]);
11920
- const {
11921
- root: rootStyles = []
11922
- } = styleConfig || {};
11923
- const pointerEventsStyle = React.useMemo(() => {
11924
- if (pointerEvents == null) return null;
11925
- return getPointerEventsStyles$2(pointerEvents);
11926
- }, [pointerEvents]);
11927
- const mergedRootStyles = ctDesignStyleManager.useWebMergeStyles([staticContainerStyles$2.root, ...rootStyles, ...(pointerEventsStyle ? [pointerEventsStyle] : [])], [rootStyles, pointerEventsStyle]);
11928
- React.useLayoutEffect(() => {
11929
- var _a, _b, _c, _d, _e, _f, _g, _h;
11930
- onLayout === null || onLayout === void 0 ? void 0 : onLayout({
11931
- layout: {
11932
- height: (_b = (_a = localRef.current) === null || _a === void 0 ? void 0 : _a.clientHeight) !== null && _b !== void 0 ? _b : 0,
11933
- width: (_d = (_c = localRef.current) === null || _c === void 0 ? void 0 : _c.clientWidth) !== null && _d !== void 0 ? _d : 0,
11934
- x: (_f = (_e = localRef.current) === null || _e === void 0 ? void 0 : _e.getBoundingClientRect().x) !== null && _f !== void 0 ? _f : 0,
11935
- y: (_h = (_g = localRef.current) === null || _g === void 0 ? void 0 : _g.getBoundingClientRect().y) !== null && _h !== void 0 ? _h : 0
11936
- }
11937
- });
11938
- }, [onLayout]);
11939
- return jsxRuntimeExports.jsx(ContainerAs, {
11940
- id: id,
11941
- ref: localRef,
11942
- className: mergedRootStyles,
11943
- onClick: event => onClick === null || onClick === void 0 ? void 0 : onClick({
11944
- stopPropagation: () => event.stopPropagation(),
11945
- preventDefault: () => event.preventDefault(),
11946
- nativeEvent: {
11947
- locationX: event.clientX,
11948
- locationY: event.clientY
11949
- }
11950
- }),
11951
- onMouseEnter: onMouseEnter,
11952
- onMouseLeave: onMouseLeave,
11953
- onTransitionEnd: onTransitionEnd,
11954
- onTouchStart: onTouchStart,
11955
- onTouchEnd: onTouchEnd,
11956
- onTouchCancel: onTouchCancel,
11957
- onTouchMove: onTouchMove,
11958
- children: children
11818
+ }, [autoPlay, stopAutoplayOnUserInteraction]);
11819
+ const swiperStyles = ctDesignStyleManager.useWebMergeStyles([staticStyles$3.swiper], []);
11820
+ const swiperSlideStyles = ctDesignStyleManager.useWebMergeStyles([staticStyles$3.swiperSlide], []);
11821
+ const _renderItem = React.useCallback(info => {
11822
+ if (renderItem) {
11823
+ return renderItem(info, data.length);
11824
+ }
11825
+ return children === null || children === void 0 ? void 0 : children[info.index];
11826
+ }, [children, renderItem, data.length]);
11827
+ return jsxRuntimeExports.jsx(WebIntersectionObserver, {
11828
+ wrapped: true,
11829
+ threshold: [0.6],
11830
+ onIntersection: handleIntersection,
11831
+ children: jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, {
11832
+ children: jsxRuntimeExports.jsx(Swiper$1, {
11833
+ loop: isInfinite,
11834
+ autoplay: shouldAutoplay ? {
11835
+ delay: autoPlaySpeed
11836
+ } : false,
11837
+ speed: autoSwipeDuration,
11838
+ lazy: {
11839
+ loadPrevNextAmount: 2
11840
+ },
11841
+ className: swiperStyles,
11842
+ loopAdditionalSlides: 0,
11843
+ onSlideChange: ({
11844
+ activeIndex
11845
+ }) => onSlide === null || onSlide === void 0 ? void 0 : onSlide(activeIndex),
11846
+ children: data.map((slide, index) => jsxRuntimeExports.jsx(SwiperSlide, {
11847
+ tag: 'span',
11848
+ className: swiperSlideStyles,
11849
+ children: jsxRuntimeExports.jsx(WebIntersectionObserver, {
11850
+ onIntersection: handleIntersection,
11851
+ children: _renderItem({
11852
+ index,
11853
+ item: slide
11854
+ })
11855
+ })
11856
+ }, index))
11857
+ })
11858
+ })
11959
11859
  });
11960
11860
  });
11961
- Container$2.displayName = 'Container';
11962
-
11963
- var TypographyVariant$1;
11964
- (function (TypographyVariant) {
11965
- TypographyVariant["HD1"] = "HD1";
11966
- TypographyVariant["HD2"] = "HD2";
11967
- TypographyVariant["HD3"] = "HD3";
11968
- TypographyVariant["HM1"] = "HM1";
11969
- TypographyVariant["HM2"] = "HM2";
11970
- TypographyVariant["HM3"] = "HM3";
11971
- TypographyVariant["HM4"] = "HM4";
11972
- TypographyVariant["B1"] = "B1";
11973
- TypographyVariant["B2"] = "B2";
11974
- TypographyVariant["B3"] = "B3";
11975
- TypographyVariant["B3CAPS"] = "B3CAPS";
11976
- TypographyVariant["B4"] = "B4";
11977
- TypographyVariant["B4CAPS"] = "B4CAPS";
11978
- TypographyVariant["P1"] = "P1";
11979
- TypographyVariant["P2"] = "P2";
11980
- TypographyVariant["P3"] = "P3";
11981
- TypographyVariant["P4"] = "P4";
11982
- TypographyVariant["L1"] = "L1";
11983
- TypographyVariant["L2"] = "L2";
11984
- TypographyVariant["L3"] = "L3";
11985
- TypographyVariant["OVERLINE"] = "OVERLINE";
11986
- TypographyVariant["TAG"] = "TAG";
11987
- TypographyVariant["M4BOLD"] = "M4BOLD";
11988
- TypographyVariant["WRAPPER"] = "WRAPPER";
11989
- })(TypographyVariant$1 || (TypographyVariant$1 = {}));
11990
- var TypographyColor$1;
11991
- (function (TypographyColor) {
11992
- TypographyColor["PRIMARY"] = "primary";
11993
- TypographyColor["SECONDARY"] = "secondary";
11994
- TypographyColor["TERTIARY"] = "tertiary";
11995
- TypographyColor["HEADING"] = "heading";
11996
- TypographyColor["SUBHEADING"] = "subheading";
11997
- TypographyColor["SUCCESS"] = "success";
11998
- TypographyColor["ALERT"] = "alert";
11999
- TypographyColor["WARNING"] = "warning";
12000
- TypographyColor["DISABLED"] = "disabled";
12001
- TypographyColor["LINK"] = "link";
12002
- TypographyColor["NEUTRAL"] = "neutral";
12003
- TypographyColor["LINK2"] = "link2";
12004
- TypographyColor["PRIMARY2"] = "primary2";
12005
- TypographyColor["SECONDARY2"] = "secondary2";
12006
- TypographyColor["GRAPETINI"] = "grapetini900";
12007
- TypographyColor["PINA_COLADA750"] = "pinacolada750";
12008
- TypographyColor["BRAND"] = "brand";
12009
- TypographyColor["ALERT500"] = "alert500";
12010
- TypographyColor["NEUTRAL50"] = "neutral50";
12011
- TypographyColor["MARGARITA750"] = "margarita750";
12012
- TypographyColor["GREEN100"] = "green100";
12013
- TypographyColor["RED100"] = "red100";
12014
- TypographyColor["ALERT300"] = "alert300";
12015
- TypographyColor["RED500"] = "red500";
12016
- TypographyColor["CORALPINK"] = "coralpink";
12017
- TypographyColor["WARNING500"] = "warning500";
12018
- TypographyColor["BLUE700"] = "blue700";
12019
- TypographyColor["NEUTRAL650"] = "neutral650";
12020
- TypographyColor["GREY700"] = "grey700";
12021
- TypographyColor["BLACK000"] = "black000";
12022
- })(TypographyColor$1 || (TypographyColor$1 = {}));
12023
- const getTypographyVariant$1 = (theme, variant) => {
12024
- switch (variant) {
12025
- case TypographyVariant$1.HD1:
12026
- {
12027
- return {
12028
- fontSize: theme.typography.size[48],
12029
- fontWeight: theme.typography.weight.semibold,
12030
- lineHeight: theme.typography.lineHeight[56]
12031
- };
12032
- }
12033
- case TypographyVariant$1.HD2:
12034
- {
12035
- return {
12036
- fontSize: theme.typography.size[40],
12037
- fontWeight: theme.typography.weight.semibold,
12038
- lineHeight: theme.typography.lineHeight[48]
12039
- };
12040
- }
12041
- case TypographyVariant$1.HD3:
12042
- {
12043
- return {
12044
- fontSize: theme.typography.size[32],
12045
- fontWeight: theme.typography.weight.semibold,
12046
- lineHeight: theme.typography.lineHeight[40]
12047
- };
12048
- }
12049
- case TypographyVariant$1.HM1:
12050
- {
12051
- return {
12052
- fontSize: theme.typography.size[24],
12053
- fontWeight: theme.typography.weight.semibold,
12054
- lineHeight: theme.typography.lineHeight[32]
12055
- };
12056
- }
12057
- case TypographyVariant$1.HM2:
12058
- {
12059
- return {
12060
- fontSize: theme.typography.size[20],
12061
- fontWeight: theme.typography.weight.semibold,
12062
- lineHeight: theme.typography.lineHeight[28]
12063
- };
12064
- }
12065
- case TypographyVariant$1.HM3:
12066
- {
12067
- return {
12068
- fontSize: theme.typography.size[16],
12069
- fontWeight: theme.typography.weight.semibold,
12070
- lineHeight: theme.typography.lineHeight[24]
12071
- };
12072
- }
12073
- case TypographyVariant$1.HM4:
12074
- {
12075
- return {
12076
- fontSize: theme.typography.size[14],
12077
- fontWeight: theme.typography.weight.semibold,
12078
- lineHeight: theme.typography.lineHeight[20]
12079
- };
12080
- }
12081
- case TypographyVariant$1.B1:
12082
- {
12083
- return {
12084
- fontSize: theme.typography.size[16],
12085
- fontWeight: theme.typography.weight.medium,
12086
- lineHeight: theme.typography.lineHeight[24]
12087
- };
12088
- }
12089
- case TypographyVariant$1.B2:
12090
- {
12091
- return {
12092
- fontSize: theme.typography.size[14],
12093
- fontWeight: theme.typography.weight.medium,
12094
- lineHeight: theme.typography.lineHeight[20]
12095
- };
12096
- }
12097
- case TypographyVariant$1.B3:
12098
- {
12099
- return {
12100
- fontSize: theme.typography.size[12],
12101
- fontWeight: theme.typography.weight.medium,
12102
- lineHeight: theme.typography.lineHeight[16]
12103
- };
12104
- }
12105
- case TypographyVariant$1.B3CAPS:
12106
- {
12107
- return {
12108
- fontSize: theme.typography.size[12],
12109
- fontWeight: theme.typography.weight.semibold,
12110
- lineHeight: theme.typography.lineHeight[16],
12111
- letterSpacing: theme.typography.letterSpacing.point4,
12112
- textTransform: 'uppercase'
12113
- };
12114
- }
12115
- case TypographyVariant$1.B4:
12116
- {
12117
- return {
12118
- fontSize: theme.typography.size[10],
12119
- fontWeight: theme.typography.weight.medium,
12120
- lineHeight: theme.typography.lineHeight[14]
12121
- };
12122
- }
12123
- case TypographyVariant$1.B4CAPS:
12124
- {
12125
- return {
12126
- fontSize: theme.typography.size[10],
12127
- fontWeight: theme.typography.weight.semibold,
12128
- lineHeight: theme.typography.lineHeight[12],
12129
- letterSpacing: theme.typography.letterSpacing.point4,
12130
- textTransform: 'uppercase'
12131
- };
12132
- }
12133
- case TypographyVariant$1.P1:
12134
- {
12135
- return {
12136
- fontSize: theme.typography.size[16],
12137
- fontWeight: theme.typography.weight.normal,
12138
- lineHeight: theme.typography.lineHeight[22]
12139
- };
12140
- }
12141
- case TypographyVariant$1.P2:
12142
- {
12143
- return {
12144
- fontSize: theme.typography.size[14],
12145
- fontWeight: theme.typography.weight.normal,
12146
- lineHeight: theme.typography.lineHeight[20]
12147
- };
12148
- }
12149
- case TypographyVariant$1.P3:
12150
- {
12151
- return {
12152
- fontSize: theme.typography.size[12],
12153
- fontWeight: theme.typography.weight.normal,
12154
- lineHeight: theme.typography.lineHeight[16]
12155
- };
12156
- }
12157
- case TypographyVariant$1.P4:
12158
- {
12159
- return {
12160
- fontSize: theme.typography.size[10],
12161
- fontWeight: theme.typography.weight.normal,
12162
- lineHeight: theme.typography.lineHeight[14]
12163
- };
12164
- }
12165
- case TypographyVariant$1.L1:
12166
- {
12167
- return {
12168
- fontSize: theme.typography.size[16],
12169
- fontWeight: theme.typography.weight.semibold,
12170
- lineHeight: theme.typography.lineHeight[24]
12171
- };
12172
- }
12173
- case TypographyVariant$1.L2:
12174
- {
12175
- return {
12176
- fontSize: theme.typography.size[14],
12177
- fontWeight: theme.typography.weight.semibold,
12178
- lineHeight: theme.typography.lineHeight[20]
12179
- };
12180
- }
12181
- case TypographyVariant$1.L3:
12182
- {
12183
- return {
12184
- fontSize: theme.typography.size[12],
12185
- fontWeight: theme.typography.weight.semibold,
12186
- lineHeight: theme.typography.lineHeight[16]
12187
- };
12188
- }
12189
- case TypographyVariant$1.OVERLINE:
12190
- {
12191
- return {
12192
- fontSize: theme.typography.size[12],
12193
- fontWeight: theme.typography.weight.semibold,
12194
- lineHeight: theme.typography.lineHeight[16]
12195
- };
12196
- }
12197
- case TypographyVariant$1.TAG:
12198
- {
12199
- return {
12200
- fontSize: theme.typography.size[10],
12201
- fontWeight: theme.typography.weight.semibold,
12202
- lineHeight: theme.typography.lineHeight[12],
12203
- letterSpacing: theme.typography.letterSpacing.point4
12204
- };
12205
- }
12206
- default:
12207
- {
12208
- return {
12209
- fontSize: theme.typography.size[20],
12210
- fontWeight: theme.typography.weight.semibold,
12211
- lineHeight: theme.typography.lineHeight[28]
12212
- };
12213
- }
11861
+ Swiper.displayName = 'Swiper';
11862
+ const staticStyles$2 = ctDesignStyleManager.makeStyles(theme => ({
11863
+ dot: {
11864
+ flexDirection: 'row',
11865
+ alignItems: 'center',
11866
+ justifyContent: 'center',
11867
+ marginTop: theme.spacing[2]
11868
+ },
11869
+ activeDot: {
11870
+ heigt: theme.spacing[1],
11871
+ borderRadius: theme.border.radius[8],
11872
+ position: 'relative',
11873
+ marginLeft: theme.spacing[2],
11874
+ width: 6,
11875
+ backgroundColor: '#E6E6E6'
11876
+ },
11877
+ activeProgress: {
11878
+ backgroundColor: '#808080',
11879
+ height: '100%',
11880
+ borderRadius: theme.border.radius[8]
12214
11881
  }
11882
+ }));
11883
+ const transitionClass = /*#__PURE__*/css$1({
11884
+ name: "12qokeg",
11885
+ styles: "transition:width 300ms ease-in-out"
11886
+ } );
11887
+ const progressAnimation = /*#__PURE__*/keyframes({
11888
+ name: "15jyylt",
11889
+ styles: "from{width:0%;}to{width:100%;}"
11890
+ } );
11891
+ const ProgressDot = ({
11892
+ index,
11893
+ currentIndex,
11894
+ autoPlayInterval,
11895
+ dotWidth
11896
+ }) => {
11897
+ const isActive = currentIndex === index;
11898
+ const dynamicStyles = ctDesignStyleManager.useStyles(() => ({
11899
+ activeDot: {
11900
+ width: isActive ? dotWidth || 52 : 6
11901
+ }
11902
+ }), [dotWidth, isActive]);
11903
+ const classes = ctDesignStyleManager.useWebMergeStyles([staticStyles$2.activeDot, dynamicStyles.activeDot, transitionClass], [dynamicStyles.activeDot]);
11904
+ const animationClass = React.useMemo(() => {
11905
+ return /*#__PURE__*/css$1({
11906
+ animation: `${progressAnimation} ${autoPlayInterval}ms linear`
11907
+ }, "" , "" );
11908
+ }, [autoPlayInterval]);
11909
+ const progressClass = ctDesignStyleManager.useWebMergeStyles([staticStyles$2.activeProgress, animationClass], [animationClass]);
11910
+ return jsxRuntimeExports.jsx("div", {
11911
+ className: classes,
11912
+ children: jsxRuntimeExports.jsx("div", {
11913
+ className: progressClass
11914
+ })
11915
+ });
12215
11916
  };
12216
- const getTypographyColor$1 = (theme, color) => {
12217
- switch (color) {
12218
- case TypographyColor$1.PRIMARY:
12219
- {
12220
- return theme.color.text.primary;
12221
- }
12222
- case TypographyColor$1.SECONDARY:
12223
- {
12224
- return theme.color.text.secondary;
12225
- }
12226
- case TypographyColor$1.TERTIARY:
12227
- {
12228
- return theme.color.text.tertiary;
12229
- }
12230
- case TypographyColor$1.ALERT:
12231
- {
12232
- return theme.color.text.alert;
12233
- }
12234
- case TypographyColor$1.DISABLED:
12235
- {
12236
- return theme.color.text.disabled;
12237
- }
12238
- case TypographyColor$1.HEADING:
12239
- {
12240
- return theme.color.text.heading;
12241
- }
12242
- case TypographyColor$1.LINK:
12243
- {
12244
- return theme.color.text.link;
12245
- }
12246
- case TypographyColor$1.SUBHEADING:
12247
- {
12248
- return theme.color.text.subHeading;
12249
- }
12250
- case TypographyColor$1.SUCCESS:
12251
- {
12252
- return theme.color.text.success;
12253
- }
12254
- case TypographyColor$1.WARNING:
12255
- {
12256
- return theme.color.text.warning;
12257
- }
12258
- case TypographyColor$1.NEUTRAL:
12259
- {
12260
- return theme.color.text.neutral;
12261
- }
12262
- case TypographyColor$1.LINK2:
12263
- {
12264
- return theme.color.text.link2;
12265
- }
12266
- case TypographyColor$1.PRIMARY2:
12267
- {
12268
- return theme.color.text.primary2;
12269
- }
12270
- case TypographyColor$1.SECONDARY2:
12271
- {
12272
- return theme.color.text.secondary2;
12273
- }
12274
- case TypographyColor$1.GRAPETINI:
12275
- {
12276
- return theme.color.text.grapetini900;
12277
- }
12278
- case TypographyColor$1.PINA_COLADA750:
12279
- {
12280
- return theme.color.text.pinaColada750;
12281
- }
12282
- case TypographyColor$1.CORALPINK:
12283
- {
12284
- return theme.color.text.coralpink;
12285
- }
12286
- case TypographyColor$1.NEUTRAL50:
12287
- {
12288
- return theme.color.text.neutral50;
12289
- }
12290
- case TypographyColor$1.WARNING500:
12291
- case TypographyColor$1.ALERT500:
12292
- {
12293
- return theme.color.text.alert500;
12294
- }
12295
- case TypographyColor$1.BRAND:
12296
- {
12297
- return theme.color.text.brand;
12298
- }
12299
- case TypographyColor$1.MARGARITA750:
12300
- {
12301
- return theme.color.text.margarita750;
12302
- }
12303
- case TypographyColor$1.GREEN100:
12304
- {
12305
- return theme.color.text.green100;
12306
- }
12307
- case TypographyColor$1.RED100:
12308
- {
12309
- return theme.color.text.red100;
12310
- }
12311
- case TypographyColor$1.ALERT300:
12312
- {
12313
- return theme.color.text.alert300;
12314
- }
12315
- case TypographyColor$1.RED500:
12316
- {
12317
- return theme.color.text.red500;
12318
- }
12319
- case TypographyColor$1.BLUE700:
12320
- {
12321
- return theme.color.text.blue700;
12322
- }
12323
- case TypographyColor$1.NEUTRAL650:
12324
- {
12325
- return theme.color.text.neutral650;
12326
- }
12327
- case TypographyColor$1.GREY700:
12328
- {
12329
- return theme.color.text.gray700;
12330
- }
12331
- case TypographyColor$1.BLACK000:
12332
- {
12333
- return theme.color.text.black000;
12334
- }
12335
- default:
12336
- {
12337
- return theme.color.text.primary;
12338
- }
12339
- }
11917
+ const ProgressDots = ({
11918
+ total,
11919
+ currentIndex,
11920
+ autoPlayInterval,
11921
+ dotWidth,
11922
+ isProgressComplete = false
11923
+ }) => {
11924
+ return jsxRuntimeExports.jsx(Container, {
11925
+ styleConfig: {
11926
+ root: [staticStyles$2.dot]
11927
+ },
11928
+ children: Array.from({
11929
+ length: total
11930
+ }).map((_, index) => jsxRuntimeExports.jsx(ProgressDot, {
11931
+ index: index,
11932
+ currentIndex: currentIndex,
11933
+ autoPlayInterval: autoPlayInterval,
11934
+ dotWidth: dotWidth,
11935
+ isProgressComplete: isProgressComplete
11936
+ }, index))
11937
+ });
12340
11938
  };
12341
- const getLineClampStyles$1 = lineClamp => {
12342
- if (!lineClamp) {
12343
- return {};
12344
- }
12345
- if (lineClamp === 1) {
12346
- return {
12347
- display: 'block',
12348
- whiteSpace: 'nowrap',
11939
+ const staticStyles$1 = ctDesignStyleManager.makeStyles(theme => {
11940
+ return {
11941
+ carouselDots: {
11942
+ backgroundColor: '#ffffff80',
11943
+ borderRadius: theme === null || theme === void 0 ? void 0 : theme.border.radius[6]
11944
+ },
11945
+ selectedDots: {
11946
+ width: theme.spacing['1.5'],
11947
+ height: theme.spacing['1.5'],
12349
11948
  overflow: 'hidden',
12350
- textOverflow: 'ellipsis',
11949
+ borderRadius: theme === null || theme === void 0 ? void 0 : theme.border.radius[6],
11950
+ backgroundColor: theme === null || theme === void 0 ? void 0 : theme.color.background.neutral
11951
+ },
11952
+ dotsContainer: {
11953
+ gap: 5,
11954
+ marginBottom: 11,
11955
+ zIndex: 15,
12351
11956
  width: '100%',
12352
- minWidth: 0
12353
- };
12354
- }
12355
- return {
12356
- display: '-webkit-box',
12357
- WebkitLineClamp: lineClamp,
12358
- WebkitBoxOrient: 'vertical',
12359
- overflow: 'hidden',
12360
- textOverflow: 'ellipsis',
12361
- width: '100%',
12362
- minWidth: 0
11957
+ alignItems: 'center',
11958
+ position: 'absolute',
11959
+ justifyContent: 'center',
11960
+ bottom: 0,
11961
+ left: 0,
11962
+ right: 0,
11963
+ flexDirection: 'row'
11964
+ },
11965
+ activeDots: {
11966
+ width: theme.spacing['1.5'],
11967
+ height: theme.spacing['1.5'],
11968
+ borderRadius: theme.border.radius[4]
11969
+ },
11970
+ inActiveDots: {
11971
+ width: theme.spacing['1'],
11972
+ height: theme.spacing['1'],
11973
+ borderRadius: 2
11974
+ },
11975
+ customIconContainer: {
11976
+ width: theme.spacing['1.5'],
11977
+ height: theme.spacing['1.5'],
11978
+ alignItems: 'center',
11979
+ justifyContent: 'center'
11980
+ }
12363
11981
  };
12364
- };
12365
- const getTypographyStyles$1 = ({
12366
- theme,
12367
- variant,
12368
- color,
12369
- isStriked,
12370
- colorCode,
12371
- isUnderlined,
12372
- showInItalics
11982
+ });
11983
+ const CarouselPagination = ({
11984
+ data,
11985
+ styleConfig,
11986
+ currentSlideIndex,
11987
+ customIcon,
11988
+ customIconIndex,
11989
+ maxDotsToShow,
11990
+ showDots = true
12373
11991
  }) => {
12374
- const textDecorationLine = isStriked ? 'line-through' : 'none';
12375
- return Object.assign(Object.assign({}, getTypographyVariant$1(theme, variant !== null && variant !== void 0 ? variant : TypographyVariant$1.HM2)), {
12376
- color: colorCode || getTypographyColor$1(theme, color !== null && color !== void 0 ? color : TypographyColor$1.PRIMARY),
12377
- textDecorationLine: isUnderlined ? 'underline' : textDecorationLine,
12378
- fontStyle: showInItalics ? 'italic' : 'none'
12379
- });
12380
- };
12381
- const getTextType$1 = variant => {
12382
11992
  var _a;
12383
- const variantMapper = {
12384
- HD1: 'h1',
12385
- HD2: 'h2',
12386
- HD3: 'h3',
12387
- HM1: 'h1',
12388
- HM2: 'h2',
12389
- HM3: 'h3',
12390
- HM4: 'h4',
12391
- B1: 'span',
12392
- B2: 'span',
12393
- B3: 'span',
12394
- B4: 'span',
12395
- P1: 'span',
12396
- P2: 'span',
12397
- P3: 'span',
12398
- P4: 'span',
12399
- L1: 'span',
12400
- L2: 'span',
12401
- L3: 'span',
12402
- M4BOLD: 'span',
12403
- B4CAPS: 'div',
12404
- OVERLINE: 'div',
12405
- B3CAPS: 'div',
12406
- TAG: 'div',
12407
- WRAPPER: 'div'
12408
- };
12409
- return (_a = variantMapper[variant]) !== null && _a !== void 0 ? _a : 'span';
12410
- };
12411
- const Typography$1 = ({
12412
- children = null,
12413
- variant,
12414
- color = TypographyColor$1.PRIMARY,
12415
- isClickable,
12416
- isStriked = false,
12417
- isUnderlined = false,
12418
- onClick,
12419
- colorCode = '',
12420
- showInItalics = false,
12421
- lineClamp,
12422
- componentNode,
12423
- isDisabled = false,
12424
- styleConfig = {}
12425
- }) => {
12426
- const theme = ctDesignTheme.useTheme();
12427
- const parsedIsClickable = typeof isClickable === 'boolean' ? isClickable : !!onClick;
12428
- const typographyStyles = ctDesignStyleManager.useStyles(theme => {
12429
- return {
12430
- root: getTypographyStyles$1({
12431
- theme,
12432
- variant,
12433
- color,
12434
- isClickable: parsedIsClickable,
12435
- isStriked,
12436
- isUnderlined,
12437
- colorCode,
12438
- showInItalics,
12439
- lineClamp,
12440
- isDisabled
12441
- })
12442
- };
12443
- }, [variant, color, parsedIsClickable, isStriked, isUnderlined, colorCode, showInItalics, lineClamp, isDisabled, theme]);
12444
11993
  const {
12445
- root: customRootStyles = [],
12446
- container: customContainerStyles = []
12447
- } = styleConfig || {};
12448
- const clampClass = React.useMemo(() => {
12449
- return /*#__PURE__*/css$1(getLineClampStyles$1(lineClamp), "" , "" );
12450
- }, [lineClamp]);
12451
- const mergedRootStyles = ctDesignStyleManager.useWebMergeStyles([typographyStyles.root, clampClass, ...customRootStyles], [typographyStyles.root, clampClass, customRootStyles]);
12452
- const ComponentToRender = lineClamp ? 'div' : componentNode || getTextType$1(variant) || 'p';
12453
- const isInlineNode = ComponentToRender === 'span';
12454
- if (parsedIsClickable) {
12455
- const containerAs = isInlineNode ? 'span' : 'div';
12456
- const clickableContainerStyles = isInlineNode ? [{
12457
- display: 'inline'
12458
- }, ...customContainerStyles] : customContainerStyles;
12459
- return jsxRuntimeExports.jsx(Container$2, {
12460
- onClick: onClick,
12461
- styleConfig: {
12462
- root: clickableContainerStyles
12463
- },
12464
- as: containerAs,
12465
- children: jsxRuntimeExports.jsx(ComponentToRender, {
12466
- className: mergedRootStyles,
12467
- children: children
12468
- })
12469
- });
12470
- }
12471
- return jsxRuntimeExports.jsx(ComponentToRender, {
12472
- className: mergedRootStyles,
12473
- children: children
12474
- });
12475
- };
12476
-
12477
- const staticStyles$3 = ctDesignStyleManager.makeStyles(() => ({
12478
- swiper: {
12479
- width: '100%',
12480
- height: '100%'
12481
- },
12482
- swiperSlide: {
12483
- backgroundColor: 'white'
12484
- },
12485
- swiperSlideImg: {
12486
- width: '100%',
12487
- height: '100%',
12488
- objectFit: 'cover'
12489
- }
12490
- }));
12491
- const Swiper = React.forwardRef(({
12492
- data,
12493
- autoPlay = false,
12494
- isInfinite = false,
12495
- autoPlaySpeed = 500,
12496
- autoSwipeDuration = 1000,
12497
- children = [],
12498
- stopAutoplayOnUserInteraction = false,
12499
- onSlide,
12500
- renderItem
12501
- }) => {
12502
- const userHasInteractedRef = React.useRef(false);
12503
- const [shouldAutoplay, setShouldAutoplay] = React.useState(false);
12504
- const handleIntersection = React.useCallback(() => {
12505
- if (autoPlay && (!stopAutoplayOnUserInteraction || !userHasInteractedRef.current)) {
12506
- setShouldAutoplay(true);
12507
- }
12508
- }, [autoPlay, stopAutoplayOnUserInteraction]);
12509
- const swiperStyles = ctDesignStyleManager.useWebMergeStyles([staticStyles$3.swiper], []);
12510
- const swiperSlideStyles = ctDesignStyleManager.useWebMergeStyles([staticStyles$3.swiperSlide], []);
12511
- const _renderItem = React.useCallback(info => {
12512
- if (renderItem) {
12513
- return renderItem(info, data.length);
12514
- }
12515
- return children === null || children === void 0 ? void 0 : children[info.index];
12516
- }, [children, renderItem, data.length]);
12517
- return jsxRuntimeExports.jsx(WebIntersectionObserver, {
12518
- wrapped: true,
12519
- threshold: [0.6],
12520
- onIntersection: handleIntersection,
12521
- children: jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, {
12522
- children: jsxRuntimeExports.jsx(Swiper$1, {
12523
- loop: isInfinite,
12524
- autoplay: shouldAutoplay ? {
12525
- delay: autoPlaySpeed
12526
- } : false,
12527
- speed: autoSwipeDuration,
12528
- lazy: {
12529
- loadPrevNextAmount: 2
12530
- },
12531
- className: swiperStyles,
12532
- loopAdditionalSlides: 0,
12533
- onSlideChange: ({
12534
- activeIndex
12535
- }) => onSlide === null || onSlide === void 0 ? void 0 : onSlide(activeIndex),
12536
- children: data.map((slide, index) => jsxRuntimeExports.jsx(SwiperSlide, {
12537
- tag: 'span',
12538
- className: swiperSlideStyles,
12539
- children: jsxRuntimeExports.jsx(WebIntersectionObserver, {
12540
- onIntersection: handleIntersection,
12541
- children: _renderItem({
12542
- index,
12543
- item: slide
12544
- })
12545
- })
12546
- }, index))
12547
- })
12548
- })
12549
- });
12550
- });
12551
- Swiper.displayName = 'Swiper';
12552
- const staticStyles$2 = ctDesignStyleManager.makeStyles(theme => ({
12553
- dot: {
12554
- flexDirection: 'row',
12555
- alignItems: 'center',
12556
- justifyContent: 'center',
12557
- marginTop: theme.spacing[2]
12558
- },
12559
- activeDot: {
12560
- heigt: theme.spacing[1],
12561
- borderRadius: theme.border.radius[8],
12562
- position: 'relative',
12563
- marginLeft: theme.spacing[2],
12564
- width: 6,
12565
- backgroundColor: '#E6E6E6'
12566
- },
12567
- activeProgress: {
12568
- backgroundColor: '#808080',
12569
- height: '100%',
12570
- borderRadius: theme.border.radius[8]
12571
- }
12572
- }));
12573
- const transitionClass = /*#__PURE__*/css$1({
12574
- name: "12qokeg",
12575
- styles: "transition:width 300ms ease-in-out"
12576
- } );
12577
- const progressAnimation = /*#__PURE__*/keyframes({
12578
- name: "15jyylt",
12579
- styles: "from{width:0%;}to{width:100%;}"
12580
- } );
12581
- const ProgressDot = ({
12582
- index,
12583
- currentIndex,
12584
- autoPlayInterval,
12585
- dotWidth
12586
- }) => {
12587
- const isActive = currentIndex === index;
12588
- const dynamicStyles = ctDesignStyleManager.useStyles(() => ({
12589
- activeDot: {
12590
- width: isActive ? dotWidth || 52 : 6
12591
- }
12592
- }), [dotWidth, isActive]);
12593
- const classes = ctDesignStyleManager.useWebMergeStyles([staticStyles$2.activeDot, dynamicStyles.activeDot, transitionClass], [dynamicStyles.activeDot]);
12594
- const animationClass = React.useMemo(() => {
12595
- return /*#__PURE__*/css$1({
12596
- animation: `${progressAnimation} ${autoPlayInterval}ms linear`
12597
- }, "" , "" );
12598
- }, [autoPlayInterval]);
12599
- const progressClass = ctDesignStyleManager.useWebMergeStyles([staticStyles$2.activeProgress, animationClass], [animationClass]);
12600
- return jsxRuntimeExports.jsx("div", {
12601
- className: classes,
12602
- children: jsxRuntimeExports.jsx("div", {
12603
- className: progressClass
12604
- })
12605
- });
12606
- };
12607
- const ProgressDots = ({
12608
- total,
12609
- currentIndex,
12610
- autoPlayInterval,
12611
- dotWidth,
12612
- isProgressComplete = false
12613
- }) => {
12614
- return jsxRuntimeExports.jsx(Container$2, {
12615
- styleConfig: {
12616
- root: [staticStyles$2.dot]
12617
- },
12618
- children: Array.from({
12619
- length: total
12620
- }).map((_, index) => jsxRuntimeExports.jsx(ProgressDot, {
12621
- index: index,
12622
- currentIndex: currentIndex,
12623
- autoPlayInterval: autoPlayInterval,
12624
- dotWidth: dotWidth,
12625
- isProgressComplete: isProgressComplete
12626
- }, index))
12627
- });
12628
- };
12629
- const staticStyles$1 = ctDesignStyleManager.makeStyles(theme => {
12630
- return {
12631
- carouselDots: {
12632
- backgroundColor: '#ffffff80',
12633
- borderRadius: theme === null || theme === void 0 ? void 0 : theme.border.radius[6]
12634
- },
12635
- selectedDots: {
12636
- width: theme.spacing['1.5'],
12637
- height: theme.spacing['1.5'],
12638
- overflow: 'hidden',
12639
- borderRadius: theme === null || theme === void 0 ? void 0 : theme.border.radius[6],
12640
- backgroundColor: theme === null || theme === void 0 ? void 0 : theme.color.background.neutral
12641
- },
12642
- dotsContainer: {
12643
- gap: 5,
12644
- marginBottom: 11,
12645
- zIndex: 15,
12646
- width: '100%',
12647
- alignItems: 'center',
12648
- position: 'absolute',
12649
- justifyContent: 'center',
12650
- bottom: 0,
12651
- left: 0,
12652
- right: 0,
12653
- flexDirection: 'row'
12654
- },
12655
- activeDots: {
12656
- width: theme.spacing['1.5'],
12657
- height: theme.spacing['1.5'],
12658
- borderRadius: theme.border.radius[4]
12659
- },
12660
- inActiveDots: {
12661
- width: theme.spacing['1'],
12662
- height: theme.spacing['1'],
12663
- borderRadius: 2
12664
- },
12665
- customIconContainer: {
12666
- width: theme.spacing['1.5'],
12667
- height: theme.spacing['1.5'],
12668
- alignItems: 'center',
12669
- justifyContent: 'center'
12670
- }
12671
- };
12672
- });
12673
- const CarouselPagination = ({
12674
- data,
12675
- styleConfig,
12676
- currentSlideIndex,
12677
- customIcon,
12678
- customIconIndex,
12679
- maxDotsToShow,
12680
- showDots = true
12681
- }) => {
12682
- var _a;
12683
- const {
12684
- carouselDots: dotStyles = [],
12685
- selectedDots: selectedDotStyles = [],
12686
- dotsContainer: dotsContainerStyles = []
11994
+ carouselDots: dotStyles = [],
11995
+ selectedDots: selectedDotStyles = [],
11996
+ dotsContainer: dotsContainerStyles = []
12687
11997
  } = styleConfig || {};
12688
11998
  if (!showDots) return null;
12689
- return jsxRuntimeExports.jsx(Container$2, {
11999
+ return jsxRuntimeExports.jsx(Container, {
12690
12000
  styleConfig: {
12691
12001
  root: [staticStyles$1.dotsContainer, ...dotsContainerStyles]
12692
- },
12693
- children: (_a = data === null || data === void 0 ? void 0 : data.slice(0, maxDotsToShow + 1)) === null || _a === void 0 ? void 0 : _a.map((_, index) => {
12694
- const isActive = currentSlideIndex - 1 === index;
12695
- if (customIcon && index === customIconIndex) {
12696
- const Icon = customIcon;
12697
- return jsxRuntimeExports.jsx(Container$2, {
12698
- styleConfig: {
12699
- root: [staticStyles$1.customIconContainer]
12700
- },
12701
- children: jsxRuntimeExports.jsx(Icon, {
12702
- color: isActive ? '#fff' : '#ffffff80'
12703
- }, index)
12704
- }, index);
12705
- }
12706
- if (isActive) {
12707
- return jsxRuntimeExports.jsx(Container$2, {
12708
- styleConfig: {
12709
- root: [staticStyles$1.activeDots, staticStyles$1.selectedDots, ...selectedDotStyles]
12710
- }
12711
- }, index);
12712
- }
12713
- return jsxRuntimeExports.jsx(Container$2, {
12714
- styleConfig: {
12715
- root: [staticStyles$1.inActiveDots, staticStyles$1.carouselDots, ...dotStyles]
12716
- }
12717
- }, index);
12718
- })
12719
- });
12720
- };
12721
- const staticStyles = ctDesignStyleManager.makeStyles(theme => {
12722
- return {
12723
- root: {
12724
- position: 'relative'
12725
- },
12726
- countWrapper: {
12727
- zIndex: 12,
12728
- right: '4%',
12729
- position: 'absolute',
12730
- alignSelf: 'flex-end',
12731
- bottom: theme === null || theme === void 0 ? void 0 : theme.spacing[4]
12732
- },
12733
- carouselContainerStyles: {
12734
- width: '100%',
12735
- alignItems: 'center',
12736
- justifyContent: 'center'
12737
- },
12738
- carouselDots: {
12739
- backgroundColor: '#ffffff80',
12740
- borderRadius: theme === null || theme === void 0 ? void 0 : theme.border.radius[6]
12741
- },
12742
- selectedDots: {
12743
- width: theme.spacing['1.5'],
12744
- height: theme.spacing['1.5'],
12745
- overflow: 'hidden',
12746
- borderRadius: theme === null || theme === void 0 ? void 0 : theme.border.radius[6],
12747
- backgroundColor: theme === null || theme === void 0 ? void 0 : theme.color.background.neutral
12748
- },
12749
- dotsContainer: {
12750
- gap: 5,
12751
- marginBottom: 11,
12752
- zIndex: 16,
12753
- width: '100%',
12754
- alignItems: 'center',
12755
- position: 'absolute',
12756
- justifyContent: 'center',
12757
- bottom: 0,
12758
- left: 0,
12759
- right: 0
12760
- },
12761
- imageCountChipContainer: {
12762
- width: 54,
12763
- height: 36,
12764
- zIndex: 12,
12765
- borderRadius: 24,
12766
- alignItems: 'center',
12767
- justifyContent: 'center',
12768
- right: theme === null || theme === void 0 ? void 0 : theme.spacing[4],
12769
- bottom: theme === null || theme === void 0 ? void 0 : theme.spacing[4],
12770
- backgroundColor: 'rgba(26, 26, 26, 0.4)'
12771
- },
12772
- customIconContainer: {
12773
- width: theme.spacing['1.5'],
12774
- height: theme.spacing['1.5'],
12775
- alignItems: 'center',
12776
- justifyContent: 'center'
12777
- }
12778
- };
12779
- });
12780
- var SLIDER_DIRECTION;
12781
- (function (SLIDER_DIRECTION) {
12782
- SLIDER_DIRECTION["NEXT"] = "next";
12783
- SLIDER_DIRECTION["PREV"] = "prev";
12784
- })(SLIDER_DIRECTION || (SLIDER_DIRECTION = {}));
12785
- const checkNeedsInstantJump = (dir, pos, finalLogicalPos, numItems, loop, finalVirtualPos) => {
12786
- if (!loop || numItems <= 1) {
12787
- return {
12788
- needsInstantJump: false,
12789
- jumpToVirtualPos: finalVirtualPos
12790
- };
12791
- }
12792
- if (dir === SLIDER_DIRECTION.NEXT && pos === numItems - 1 && finalLogicalPos === 0) {
12793
- return {
12794
- needsInstantJump: true,
12795
- jumpToVirtualPos: numItems + 1
12796
- };
12797
- }
12798
- if (dir === SLIDER_DIRECTION.PREV && pos === 0 && finalLogicalPos === numItems - 1) {
12799
- return {
12800
- needsInstantJump: true,
12801
- jumpToVirtualPos: 0
12802
- };
12803
- }
12804
- return {
12805
- needsInstantJump: false,
12806
- jumpToVirtualPos: finalVirtualPos
12807
- };
12808
- };
12809
- const getFinalPos = (position, direction, length) => {
12810
- return (position + length + (direction === SLIDER_DIRECTION.PREV ? -1 : 1)) % length;
12811
- };
12812
- const SWIPE_SENSITIVITY = 1;
12813
- const SWIPE_THRESHOLD_VELOCITY = 0.15;
12814
- const DEFAULT_CONTAINER_WIDTH = 400;
12815
- const DEFAULT_TRANSITION_TIME = 0.3;
12816
- const TRANSITION_TIMING_FUNCTION = 'ease';
12817
- const CORNER_SLIDE_THRESHOLD = 60;
12818
- const getVirtualPos = (logicalPos, numItems, loop) => {
12819
- if (!loop || numItems <= 1) return logicalPos;
12820
- return logicalPos + 1;
12821
- };
12822
- const Slider = React.forwardRef(({
12823
- data,
12824
- slideWidth,
12825
- autoPlay = false,
12826
- showDots = true,
12827
- startIndex = 0,
12828
- isInfinite = false,
12829
- autoPlaySpeed = 500,
12830
- maxDotsToShow = data === null || data === void 0 ? void 0 : data.length,
12831
- showCountChip = false,
12832
- thresholdDelta = 40,
12833
- isSwipeDisabled = false,
12834
- autoSwipeDuration = 1000,
12835
- containerWidth: containerWidthProps,
12836
- children = [],
12837
- showProgressDots = false,
12838
- progressDotWidth = 80,
12839
- styleConfig,
12840
- onSlide,
12841
- renderItem
12842
- }, ref) => {
12843
- const containerRef = React.useRef(null);
12844
- const carouselRef = React.useRef(null);
12845
- const swipeRef = React.useRef(false);
12846
- const firstClientX = React.useRef(0);
12847
- const {
12848
- imageCountChipContainer: countContainerStyles = []
12849
- } = styleConfig || {};
12850
- const [chipCount, setChipCount] = React.useState(startIndex + 1);
12851
- const getSwipePercentage = (e, customSensitivity) => {
12852
- var _a;
12853
- const newPosition = (customSensitivity || SWIPE_SENSITIVITY) * e.deltaX;
12854
- const containerWidth = containerWidthProps || ((_a = carouselRef.current) === null || _a === void 0 ? void 0 : _a.offsetWidth) || DEFAULT_CONTAINER_WIDTH;
12855
- const percentage = typeof containerWidth === 'number' ? newPosition / containerWidth * 100 : 0;
12856
- return percentage;
12857
- };
12858
- const isPositionValid = React.useCallback(position => position > 0 || position < (data.length - 1) * -100, [data.length]);
12859
- const handleInstantJumpTransition = React.useCallback((finalVirtualPos, finalLogicalPos) => {
12860
- if (!carouselRef.current) return;
12861
- const transitionEndHandler = () => {
12862
- if (!carouselRef.current) return;
12863
- carouselRef.current.removeEventListener('transitionend', transitionEndHandler);
12864
- window.requestAnimationFrame(() => {
12865
- if (!carouselRef.current) return;
12866
- carouselRef.current.style.transition = `0s ${TRANSITION_TIMING_FUNCTION}`;
12867
- carouselRef.current.style.transform = `translateX(${finalVirtualPos * -100}%)`;
12868
- window.requestAnimationFrame(() => {
12869
- onSlide === null || onSlide === void 0 ? void 0 : onSlide(finalLogicalPos);
12870
- setChipCount(finalLogicalPos);
12871
- });
12872
- });
12873
- };
12874
- carouselRef.current.addEventListener('transitionend', transitionEndHandler, {
12875
- once: true
12876
- });
12877
- }, [onSlide]);
12878
- const handleNormalTransition = React.useCallback(finalLogicalPos => {
12879
- window.requestAnimationFrame(() => {
12880
- onSlide === null || onSlide === void 0 ? void 0 : onSlide(finalLogicalPos);
12881
- setChipCount(finalLogicalPos);
12882
- });
12883
- }, [onSlide]);
12884
- const onSwipe = React.useCallback(dir => {
12885
- const finalLogicalPos = getFinalPos(chipCount, dir, data.length);
12886
- const finalVirtualPos = getVirtualPos(finalLogicalPos, data.length, isInfinite);
12887
- if (!carouselRef.current) return;
12888
- const {
12889
- needsInstantJump,
12890
- jumpToVirtualPos
12891
- } = checkNeedsInstantJump(dir, chipCount, finalLogicalPos, data.length, isInfinite, finalVirtualPos);
12892
- window.requestAnimationFrame(() => {
12893
- if (!carouselRef.current) return;
12894
- carouselRef.current.style.transition = `all ${DEFAULT_TRANSITION_TIME}s ${TRANSITION_TIMING_FUNCTION}`;
12895
- carouselRef.current.style.transform = `translateX(${jumpToVirtualPos * -100}%)`;
12896
- if (needsInstantJump) {
12897
- handleInstantJumpTransition(finalVirtualPos, finalLogicalPos);
12898
- } else {
12899
- handleNormalTransition(finalLogicalPos);
12900
- }
12901
- });
12902
- swipeRef.current = true;
12903
- }, [handleInstantJumpTransition, handleNormalTransition, data.length, isInfinite, chipCount]);
12904
- const resetSwipe = (isNewPositionInvalid = false) => {
12905
- if (isSwipeDisabled) return;
12906
- if (!carouselRef.current) return;
12907
- const currentVirtualPos = getVirtualPos(chipCount, data.length, isInfinite);
12908
- carouselRef.current.style.transition = `all ${isNewPositionInvalid ? DEFAULT_TRANSITION_TIME + 0.2 : DEFAULT_TRANSITION_TIME}s ${TRANSITION_TIMING_FUNCTION}`;
12909
- carouselRef.current.style.transform = `translate(${currentVirtualPos * -100}%, 0px) translateZ(0px)`;
12910
- };
12911
- const onSwiping = e => {
12912
- if (isSwipeDisabled) return;
12913
- e.event.preventDefault();
12914
- e.event.stopPropagation();
12915
- const dir = e.dir.toUpperCase();
12916
- if (SLIDER_DIRECTION.NEXT !== dir && SLIDER_DIRECTION.PREV !== dir) return;
12917
- let percentage = getSwipePercentage(e);
12918
- swipeRef.current = false;
12919
- percentage = Math.max(Math.min(percentage, 90), -100);
12920
- if (!carouselRef.current) return;
12921
- const currentVirtualPos = getVirtualPos(chipCount, data.length, isInfinite);
12922
- let newPosition = currentVirtualPos * -100 + percentage;
12923
- if (!isInfinite) {
12924
- if (newPosition - CORNER_SLIDE_THRESHOLD > 0 || newPosition + CORNER_SLIDE_THRESHOLD < (data.length - 1) * -100) return;
12925
- const isNewPositionInvalid = isPositionValid(newPosition);
12926
- if (isNewPositionInvalid) {
12927
- percentage = getSwipePercentage(e, 0.3);
12928
- newPosition = currentVirtualPos * -100 + percentage;
12929
- }
12930
- }
12931
- carouselRef.current.style.transition = `0s ${TRANSITION_TIMING_FUNCTION}`;
12932
- carouselRef.current.style.transform = `translateX(${newPosition}%)`;
12933
- };
12934
- const handlers = useSwipeable(Object.assign({
12935
- onSwipedLeft: e => {
12936
- if (isSwipeDisabled) return;
12937
- const percentage = getSwipePercentage(e);
12938
- if (!carouselRef.current) return;
12939
- const currentVirtualPos = getVirtualPos(chipCount, data.length, isInfinite);
12940
- const newPosition = currentVirtualPos * -100 + percentage;
12941
- const isNewPositionInvalid = !isInfinite && isPositionValid(newPosition);
12942
- if (!isNewPositionInvalid && (e.velocity > SWIPE_THRESHOLD_VELOCITY || Math.abs(percentage) > thresholdDelta)) {
12943
- if (!isInfinite && chipCount === data.length - 1) return;
12944
- onSwipe(SLIDER_DIRECTION.NEXT);
12945
- } else {
12946
- resetSwipe(isNewPositionInvalid);
12947
- }
12948
- swipeRef.current = true;
12949
- },
12950
- onSwipedRight: e => {
12951
- if (isSwipeDisabled) return;
12952
- const percentage = getSwipePercentage(e);
12953
- if (!carouselRef.current) return;
12954
- const currentVirtualPos = getVirtualPos(chipCount, data.length, isInfinite);
12955
- const newPosition = currentVirtualPos * -100 + percentage;
12956
- const isNewPositionInvalid = !isInfinite && isPositionValid(newPosition);
12957
- if (!isNewPositionInvalid && (e.velocity > SWIPE_THRESHOLD_VELOCITY || percentage > thresholdDelta)) {
12958
- if (!isInfinite && chipCount === 0) return;
12959
- onSwipe(SLIDER_DIRECTION.PREV);
12960
- } else {
12961
- resetSwipe(isNewPositionInvalid);
12962
- }
12963
- swipeRef.current = true;
12964
- },
12965
- swipeDuration: autoPlay ? autoSwipeDuration : Infinity,
12966
- trackTouch: true,
12967
- trackMouse: true,
12968
- onTouchStartOrOnMouseDown: e => {
12969
- if (isSwipeDisabled) e.event.preventDefault();
12970
- },
12971
- onTouchEndOrOnMouseUp: () => {
12972
- setTimeout(() => {
12973
- if (!swipeRef.current) {
12974
- resetSwipe();
12975
- }
12976
- }, 100);
12977
- }
12978
- }, {
12979
- onSwiping: onSwiping
12980
- }));
12981
- const length = React__namespace.default.Children.count(children);
12982
- React.useEffect(() => {
12983
- let timer;
12984
- if (autoPlay && length) {
12985
- timer = setInterval(() => {
12986
- onSwipe(SLIDER_DIRECTION.NEXT);
12987
- }, autoPlaySpeed);
12988
- }
12989
- return () => {
12990
- clearInterval(timer);
12991
- };
12992
- }, [length, autoPlay, autoPlaySpeed, onSwipe, chipCount]);
12993
- useIsomorphicEffect(() => {
12994
- var _a, _b;
12995
- if (chipCount !== undefined && carouselRef.current && !((_b = (_a = carouselRef === null || carouselRef === void 0 ? void 0 : carouselRef.current) === null || _a === void 0 ? void 0 : _a.style) === null || _b === void 0 ? void 0 : _b.transform)) {
12996
- const virtualPos = getVirtualPos(chipCount, data.length, isInfinite);
12997
- carouselRef.current.style.transform = `translateX(${virtualPos * -100}%)`;
12998
- }
12999
- }, [chipCount, data.length, isInfinite]);
13000
- const touchStart = React.useCallback(e => {
13001
- firstClientX.current = e.touches[0].clientX;
13002
- }, []);
13003
- const preventTouch = React.useCallback(e => {
13004
- e.preventDefault();
13005
- e.stopPropagation();
13006
- }, []);
13007
- React.useEffect(() => {
13008
- if (carouselRef.current) {
13009
- carouselRef.current.addEventListener('touchstart', touchStart, {
13010
- passive: false
13011
- });
13012
- carouselRef.current.addEventListener('touchmove', preventTouch, {
13013
- passive: false
13014
- });
13015
- }
13016
- return () => {
13017
- if (carouselRef.current) {
13018
- carouselRef.current.removeEventListener('touchstart', touchStart);
13019
- carouselRef.current.removeEventListener('touchmove', e => {
13020
- preventTouch(e);
13021
- });
13022
- }
13023
- };
13024
- }, []);
13025
- React.useEffect(() => {
13026
- if (containerRef.current) {
13027
- containerRef.current.addEventListener('touchstart', touchStart, {
13028
- passive: false
13029
- });
13030
- containerRef.current.addEventListener('touchmove', preventTouch, {
13031
- passive: false
13032
- });
13033
- }
13034
- return () => {
13035
- if (containerRef.current) {
13036
- containerRef.current.removeEventListener('touchstart', touchStart);
13037
- containerRef.current.removeEventListener('touchmove', preventTouch);
13038
- }
13039
- };
13040
- }, []);
13041
- React.useImperativeHandle(ref, () => ({
13042
- goToNextSlide: () => {
13043
- onSwipe(SLIDER_DIRECTION.NEXT);
13044
- },
13045
- goToPreviousSlide: () => {
13046
- onSwipe(SLIDER_DIRECTION.PREV);
13047
- }
13048
- }), []);
13049
- const dynamicStylesSlide = ctDesignStyleManager.useStyles(() => {
13050
- return {
13051
- slide: {
13052
- width: slideWidth || '100%'
13053
- }
13054
- };
13055
- }, [slideWidth]);
13056
- const _renderItem = React.useCallback(info => {
13057
- if (renderItem) {
13058
- return renderItem(info, data.length);
13059
- }
13060
- return children === null || children === void 0 ? void 0 : children[info.index];
13061
- }, [children, renderItem, data.length]);
13062
- return jsxRuntimeExports.jsxs("div", {
13063
- ref: containerRef,
13064
- children: [jsxRuntimeExports.jsxs("div", Object.assign({}, handlers, {
13065
- children: [!showProgressDots && jsxRuntimeExports.jsx(CarouselPagination, {
13066
- data: data,
13067
- showDots: showDots,
13068
- maxDotsToShow: maxDotsToShow,
13069
- styleConfig: styleConfig,
13070
- currentSlideIndex: chipCount
13071
- }), showCountChip && jsxRuntimeExports.jsx(Container$2, {
13072
- styleConfig: {
13073
- root: [staticStyles.countWrapper]
13074
- },
13075
- children: jsxRuntimeExports.jsx(Container$2, {
13076
- styleConfig: {
13077
- root: [staticStyles.imageCountChipContainer, ...countContainerStyles]
13078
- },
13079
- children: jsxRuntimeExports.jsxs(Typography$1, {
13080
- variant: TypographyVariant$1.L2,
13081
- color: TypographyColor$1.NEUTRAL,
13082
- children: [chipCount, "/", data.length]
13083
- })
13084
- })
13085
- }), jsxRuntimeExports.jsx("div", {
13086
- ref: carouselRef,
13087
- children: data.map((item, index) => {
13088
- const key = `slide-${index}`;
13089
- return jsxRuntimeExports.jsx(Container$2, {
13090
- styleConfig: {
13091
- root: [dynamicStylesSlide.slide]
13092
- },
13093
- children: _renderItem({
13094
- item,
13095
- index
13096
- })
13097
- }, key);
13098
- })
13099
- })]
13100
- })), showProgressDots && jsxRuntimeExports.jsx(ProgressDots, {
13101
- total: data === null || data === void 0 ? void 0 : data.length,
13102
- currentIndex: chipCount,
13103
- autoPlayInterval: autoPlaySpeed,
13104
- dotWidth: progressDotWidth
13105
- })]
13106
- });
13107
- });
13108
- Slider.displayName = 'Slider';
13109
- const getComponent = variant => {
13110
- switch (variant) {
13111
- case 'swiper':
13112
- return Swiper;
13113
- case 'slider':
13114
- return Slider;
13115
- default:
13116
- return Slider;
13117
- }
13118
- };
13119
- const CarouselComponent = (_a, ref) => {
13120
- var {
13121
- variant = 'swiper'
13122
- } = _a,
13123
- props = __rest(_a, ["variant"]);
13124
- const Component = getComponent(variant);
13125
- return jsxRuntimeExports.jsx(Component, Object.assign({}, props, {
13126
- ref: ref
13127
- }));
13128
- };
13129
- const Carousel = React.forwardRef(CarouselComponent);
13130
-
13131
- const staticContainerStyles$1 = ctDesignStyleManager.makeStyles(() => {
13132
- return {
13133
- root: {
13134
- display: 'flex',
13135
- flexDirection: 'column',
13136
- pointerEvents: 'auto'
13137
- }
13138
- };
13139
- });
13140
- function getPointerEventsStyles$1(pointerEvents) {
13141
- if (pointerEvents === 'box-none') {
13142
- return {
13143
- pointerEvents: 'none',
13144
- '& > *': {
13145
- pointerEvents: 'auto'
13146
- }
13147
- };
13148
- }
13149
- if (pointerEvents === 'box-only') {
13150
- return {
13151
- pointerEvents: 'auto',
13152
- '& > *': {
13153
- pointerEvents: 'none'
13154
- }
13155
- };
13156
- }
13157
- if (pointerEvents === 'none') {
13158
- return {
13159
- pointerEvents: 'none'
13160
- };
13161
- }
13162
- return {
13163
- pointerEvents: 'auto'
13164
- };
13165
- }
13166
- const Container$1 = React.forwardRef(({
13167
- id,
13168
- as: ContainerAs = 'div',
13169
- children,
13170
- styleConfig,
13171
- onClick,
13172
- onLayout,
13173
- onMouseEnter,
13174
- onMouseLeave,
13175
- onTransitionEnd,
13176
- onTouchStart,
13177
- onTouchEnd,
13178
- onTouchCancel,
13179
- onTouchMove,
13180
- pointerEvents,
13181
- hitSlop: _hitSlop,
13182
- hapticEnabled: _hapticEnabled,
13183
- hapticVariant: _hapticVariant,
13184
- hapticRepeat: _hapticRepeat
13185
- }, forwardedRef) => {
13186
- const localRef = React.useRef(null);
13187
- const handleFocus = React.useCallback(() => {
13188
- var _a;
13189
- (_a = localRef.current) === null || _a === void 0 ? void 0 : _a.focus();
13190
- }, []);
13191
- const handleGetBoundingRect = React.useCallback(callback => {
13192
- var _a;
13193
- const rect = (_a = localRef.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
13194
- if (rect) {
13195
- callback === null || callback === void 0 ? void 0 : callback({
13196
- x: rect.x,
13197
- y: rect.y,
13198
- width: rect.width,
13199
- height: rect.height
13200
- });
13201
- }
13202
- }, []);
13203
- const handleAddEventListener = React.useCallback((type, listener, options) => {
13204
- var _a;
13205
- (_a = localRef.current) === null || _a === void 0 ? void 0 : _a.addEventListener(type, listener, options);
13206
- }, []);
13207
- const handleRemoveEventListener = React.useCallback((type, listener, options) => {
13208
- var _a;
13209
- (_a = localRef.current) === null || _a === void 0 ? void 0 : _a.removeEventListener(type, listener, options);
13210
- }, []);
13211
- React.useImperativeHandle(forwardedRef, () => {
13212
- var _a;
13213
- return {
13214
- focus: handleFocus,
13215
- getBoundingRectWithCallback: handleGetBoundingRect,
13216
- getElementRef: () => localRef,
13217
- style: ((_a = localRef.current) === null || _a === void 0 ? void 0 : _a.style) || {},
13218
- classList: {
13219
- add: className => {
13220
- var _a;
13221
- (_a = localRef.current) === null || _a === void 0 ? void 0 : _a.classList.add(className);
13222
- }
13223
- },
13224
- measure: _callback => {
13225
- var _a;
13226
- (_a = localRef.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
13227
- },
13228
- addEventListener: handleAddEventListener,
13229
- removeEventListener: handleRemoveEventListener
13230
- };
13231
- }, [handleFocus, handleGetBoundingRect, handleAddEventListener, handleRemoveEventListener]);
13232
- const {
13233
- root: rootStyles = []
13234
- } = styleConfig || {};
13235
- const pointerEventsStyle = React.useMemo(() => {
13236
- if (pointerEvents == null) return null;
13237
- return getPointerEventsStyles$1(pointerEvents);
13238
- }, [pointerEvents]);
13239
- const mergedRootStyles = ctDesignStyleManager.useWebMergeStyles([staticContainerStyles$1.root, ...rootStyles, ...(pointerEventsStyle ? [pointerEventsStyle] : [])], [rootStyles, pointerEventsStyle]);
13240
- React.useLayoutEffect(() => {
13241
- var _a, _b, _c, _d, _e, _f, _g, _h;
13242
- onLayout === null || onLayout === void 0 ? void 0 : onLayout({
13243
- layout: {
13244
- height: (_b = (_a = localRef.current) === null || _a === void 0 ? void 0 : _a.clientHeight) !== null && _b !== void 0 ? _b : 0,
13245
- width: (_d = (_c = localRef.current) === null || _c === void 0 ? void 0 : _c.clientWidth) !== null && _d !== void 0 ? _d : 0,
13246
- x: (_f = (_e = localRef.current) === null || _e === void 0 ? void 0 : _e.getBoundingClientRect().x) !== null && _f !== void 0 ? _f : 0,
13247
- y: (_h = (_g = localRef.current) === null || _g === void 0 ? void 0 : _g.getBoundingClientRect().y) !== null && _h !== void 0 ? _h : 0
13248
- }
13249
- });
13250
- }, [onLayout]);
13251
- return jsxRuntimeExports.jsx(ContainerAs, {
13252
- id: id,
13253
- ref: localRef,
13254
- className: mergedRootStyles,
13255
- onClick: event => onClick === null || onClick === void 0 ? void 0 : onClick({
13256
- stopPropagation: () => event.stopPropagation(),
13257
- preventDefault: () => event.preventDefault(),
13258
- nativeEvent: {
13259
- locationX: event.clientX,
13260
- locationY: event.clientY
13261
- }
13262
- }),
13263
- onMouseEnter: onMouseEnter,
13264
- onMouseLeave: onMouseLeave,
13265
- onTransitionEnd: onTransitionEnd,
13266
- onTouchStart: onTouchStart,
13267
- onTouchEnd: onTouchEnd,
13268
- onTouchCancel: onTouchCancel,
13269
- onTouchMove: onTouchMove,
13270
- children: children
13271
- });
13272
- });
13273
- Container$1.displayName = 'Container';
13274
-
13275
- const staticContainerStyles = ctDesignStyleManager.makeStyles(() => {
13276
- return {
13277
- root: {
13278
- display: 'flex',
13279
- flexDirection: 'column',
13280
- pointerEvents: 'auto'
13281
- }
13282
- };
13283
- });
13284
- function getPointerEventsStyles(pointerEvents) {
13285
- if (pointerEvents === 'box-none') {
13286
- return {
13287
- pointerEvents: 'none',
13288
- '& > *': {
13289
- pointerEvents: 'auto'
13290
- }
13291
- };
13292
- }
13293
- if (pointerEvents === 'box-only') {
13294
- return {
13295
- pointerEvents: 'auto',
13296
- '& > *': {
13297
- pointerEvents: 'none'
13298
- }
13299
- };
13300
- }
13301
- if (pointerEvents === 'none') {
13302
- return {
13303
- pointerEvents: 'none'
13304
- };
13305
- }
13306
- return {
13307
- pointerEvents: 'auto'
13308
- };
13309
- }
13310
- const Container = React.forwardRef(({
13311
- id,
13312
- as: ContainerAs = 'div',
13313
- children,
13314
- styleConfig,
13315
- onClick,
13316
- onLayout,
13317
- onMouseEnter,
13318
- onMouseLeave,
13319
- onTransitionEnd,
13320
- onTouchStart,
13321
- onTouchEnd,
13322
- onTouchCancel,
13323
- onTouchMove,
13324
- pointerEvents,
13325
- hitSlop: _hitSlop,
13326
- hapticEnabled: _hapticEnabled,
13327
- hapticVariant: _hapticVariant,
13328
- hapticRepeat: _hapticRepeat
13329
- }, forwardedRef) => {
13330
- const localRef = React.useRef(null);
13331
- const handleFocus = React.useCallback(() => {
13332
- var _a;
13333
- (_a = localRef.current) === null || _a === void 0 ? void 0 : _a.focus();
13334
- }, []);
13335
- const handleGetBoundingRect = React.useCallback(callback => {
13336
- var _a;
13337
- const rect = (_a = localRef.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
13338
- if (rect) {
13339
- callback === null || callback === void 0 ? void 0 : callback({
13340
- x: rect.x,
13341
- y: rect.y,
13342
- width: rect.width,
13343
- height: rect.height
13344
- });
13345
- }
13346
- }, []);
13347
- const handleAddEventListener = React.useCallback((type, listener, options) => {
13348
- var _a;
13349
- (_a = localRef.current) === null || _a === void 0 ? void 0 : _a.addEventListener(type, listener, options);
13350
- }, []);
13351
- const handleRemoveEventListener = React.useCallback((type, listener, options) => {
13352
- var _a;
13353
- (_a = localRef.current) === null || _a === void 0 ? void 0 : _a.removeEventListener(type, listener, options);
13354
- }, []);
13355
- React.useImperativeHandle(forwardedRef, () => {
13356
- var _a;
13357
- return {
13358
- focus: handleFocus,
13359
- getBoundingRectWithCallback: handleGetBoundingRect,
13360
- getElementRef: () => localRef,
13361
- style: ((_a = localRef.current) === null || _a === void 0 ? void 0 : _a.style) || {},
13362
- classList: {
13363
- add: className => {
13364
- var _a;
13365
- (_a = localRef.current) === null || _a === void 0 ? void 0 : _a.classList.add(className);
13366
- }
13367
- },
13368
- measure: _callback => {
13369
- var _a;
13370
- (_a = localRef.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
13371
- },
13372
- addEventListener: handleAddEventListener,
13373
- removeEventListener: handleRemoveEventListener
13374
- };
13375
- }, [handleFocus, handleGetBoundingRect, handleAddEventListener, handleRemoveEventListener]);
13376
- const {
13377
- root: rootStyles = []
13378
- } = styleConfig || {};
13379
- const pointerEventsStyle = React.useMemo(() => {
13380
- if (pointerEvents == null) return null;
13381
- return getPointerEventsStyles(pointerEvents);
13382
- }, [pointerEvents]);
13383
- const mergedRootStyles = ctDesignStyleManager.useWebMergeStyles([staticContainerStyles.root, ...rootStyles, ...(pointerEventsStyle ? [pointerEventsStyle] : [])], [rootStyles, pointerEventsStyle]);
13384
- React.useLayoutEffect(() => {
13385
- var _a, _b, _c, _d, _e, _f, _g, _h;
13386
- onLayout === null || onLayout === void 0 ? void 0 : onLayout({
13387
- layout: {
13388
- height: (_b = (_a = localRef.current) === null || _a === void 0 ? void 0 : _a.clientHeight) !== null && _b !== void 0 ? _b : 0,
13389
- width: (_d = (_c = localRef.current) === null || _c === void 0 ? void 0 : _c.clientWidth) !== null && _d !== void 0 ? _d : 0,
13390
- x: (_f = (_e = localRef.current) === null || _e === void 0 ? void 0 : _e.getBoundingClientRect().x) !== null && _f !== void 0 ? _f : 0,
13391
- y: (_h = (_g = localRef.current) === null || _g === void 0 ? void 0 : _g.getBoundingClientRect().y) !== null && _h !== void 0 ? _h : 0
13392
- }
13393
- });
13394
- }, [onLayout]);
13395
- return jsxRuntimeExports.jsx(ContainerAs, {
13396
- id: id,
13397
- ref: localRef,
13398
- className: mergedRootStyles,
13399
- onClick: event => onClick === null || onClick === void 0 ? void 0 : onClick({
13400
- stopPropagation: () => event.stopPropagation(),
13401
- preventDefault: () => event.preventDefault(),
13402
- nativeEvent: {
13403
- locationX: event.clientX,
13404
- locationY: event.clientY
13405
- }
13406
- }),
13407
- onMouseEnter: onMouseEnter,
13408
- onMouseLeave: onMouseLeave,
13409
- onTransitionEnd: onTransitionEnd,
13410
- onTouchStart: onTouchStart,
13411
- onTouchEnd: onTouchEnd,
13412
- onTouchCancel: onTouchCancel,
13413
- onTouchMove: onTouchMove,
13414
- children: children
13415
- });
13416
- });
13417
- Container.displayName = 'Container';
13418
-
13419
- const StarRatingIcon = _a => {
13420
- var {
13421
- className,
13422
- width,
13423
- height,
13424
- stroke,
13425
- fill
13426
- } = _a,
13427
- restProps = __rest(_a, ["className", "width", "height", "stroke", "fill"]);
13428
- return jsxRuntimeExports.jsx("svg", Object.assign({}, restProps, {
13429
- className: className,
13430
- width: width,
13431
- height: height,
13432
- viewBox: '0 0 24 24',
13433
- fill: 'none',
13434
- xmlns: 'http://www.w3.org/2000/svg',
13435
- style: {
13436
- transition: 'all 0.2s ease-in-out'
13437
- },
13438
- children: jsxRuntimeExports.jsx("path", {
13439
- d: 'M12 2L15.09 8.26L22 9.27L17 14.14L18.18 21.02L12 17.77L5.82 21.02L7 14.14L2 9.27L8.91 8.26L12 2Z',
13440
- stroke: stroke,
13441
- fill: fill,
13442
- strokeWidth: '1'
13443
- })
13444
- }));
13445
- };
13446
-
13447
- var RatingSize;
13448
- (function (RatingSize) {
13449
- RatingSize["XS"] = "xs";
13450
- RatingSize["XSM"] = "xsm";
13451
- RatingSize["SM"] = "sm";
13452
- RatingSize["MD"] = "md";
13453
- RatingSize["LG"] = "lg";
13454
- RatingSize["XL"] = "xl";
13455
- RatingSize["XXL"] = "xxl";
13456
- })(RatingSize || (RatingSize = {}));
13457
- const getRatingSizeTokens = (theme, size) => {
13458
- switch (size) {
13459
- case RatingSize.XS:
13460
- return {
13461
- width: theme.size[2],
13462
- height: theme.size[2]
13463
- };
13464
- case RatingSize.XSM:
13465
- return {
13466
- width: theme.size[3],
13467
- height: theme.size[3]
13468
- };
13469
- case RatingSize.SM:
13470
- return {
13471
- width: theme.size[4],
13472
- height: theme.size[4]
13473
- };
13474
- case RatingSize.MD:
13475
- return {
13476
- width: theme.size[5],
13477
- height: theme.size[5]
13478
- };
13479
- case RatingSize.LG:
13480
- return {
13481
- width: theme.size[6],
13482
- height: theme.size[6]
13483
- };
13484
- case RatingSize.XL:
13485
- return {
13486
- width: theme.size[8],
13487
- height: theme.size[8]
13488
- };
13489
- case RatingSize.XXL:
13490
- return {
13491
- width: theme.size[10],
13492
- height: theme.size[10]
13493
- };
13494
- default:
13495
- return {
13496
- width: theme.size[4],
13497
- height: theme.size[4]
13498
- };
13499
- }
13500
- };
13501
- const getRatingColorTokens = theme => ({
13502
- activeColor: theme.color.text.primary,
13503
- inActiveColor: theme.color.text.tertiary
13504
- });
13505
- const getRatingTokens = (theme, size) => Object.assign(Object.assign({}, getRatingSizeTokens(theme, size)), getRatingColorTokens(theme));
13506
- const staticRatingStyles = ctDesignStyleManager.makeStyles(theme => ({
13507
- root: {
13508
- flexDirection: 'row',
13509
- padding: theme === null || theme === void 0 ? void 0 : theme.spacing[1],
13510
- width: '100%'
13511
- },
13512
- ratingContainer: {
13513
- flexDirection: 'row'
13514
- }
13515
- }));
13516
- const Rating = React.forwardRef((props, ref) => {
13517
- const {
13518
- rating = 2,
13519
- maxRating = 5,
13520
- size = RatingSize.LG,
13521
- activeColor,
13522
- inActiveColor,
13523
- styleConfig
13524
- } = props;
13525
- const theme = ctDesignTheme.useTheme();
13526
- const tokens = React.useMemo(() => getRatingTokens(theme, size), [theme, size]);
13527
- const {
13528
- root: customRootStyles = [],
13529
- ratingContainer: customRatingContainer = []
13530
- } = styleConfig || {};
13531
- return jsxRuntimeExports.jsx(Container, {
13532
- ref: ref,
13533
- styleConfig: {
13534
- root: [staticRatingStyles.root, ...customRootStyles]
13535
- },
13536
- children: Array.from({
13537
- length: maxRating
13538
- }, (_, index) => {
13539
- const isActive = index + 1 <= rating;
13540
- const fill = isActive ? activeColor || tokens.activeColor : inActiveColor || tokens.inActiveColor;
13541
- return jsxRuntimeExports.jsx(Container, {
13542
- styleConfig: {
13543
- root: [staticRatingStyles.ratingContainer, ...customRatingContainer]
13544
- },
13545
- children: jsxRuntimeExports.jsx(StarRatingIcon, {
13546
- fill: fill,
13547
- stroke: fill,
13548
- width: tokens.width,
13549
- height: tokens.height
13550
- })
13551
- }, `rating_${index}`);
13552
- })
13553
- });
13554
- });
13555
- Rating.displayName = 'Rating';
13556
-
13557
- var TypographyVariant;
13558
- (function (TypographyVariant) {
13559
- TypographyVariant["HD1"] = "HD1";
13560
- TypographyVariant["HD2"] = "HD2";
13561
- TypographyVariant["HD3"] = "HD3";
13562
- TypographyVariant["HM1"] = "HM1";
13563
- TypographyVariant["HM2"] = "HM2";
13564
- TypographyVariant["HM3"] = "HM3";
13565
- TypographyVariant["HM4"] = "HM4";
13566
- TypographyVariant["B1"] = "B1";
13567
- TypographyVariant["B2"] = "B2";
13568
- TypographyVariant["B3"] = "B3";
13569
- TypographyVariant["B3CAPS"] = "B3CAPS";
13570
- TypographyVariant["B4"] = "B4";
13571
- TypographyVariant["B4CAPS"] = "B4CAPS";
13572
- TypographyVariant["P1"] = "P1";
13573
- TypographyVariant["P2"] = "P2";
13574
- TypographyVariant["P3"] = "P3";
13575
- TypographyVariant["P4"] = "P4";
13576
- TypographyVariant["L1"] = "L1";
13577
- TypographyVariant["L2"] = "L2";
13578
- TypographyVariant["L3"] = "L3";
13579
- TypographyVariant["OVERLINE"] = "OVERLINE";
13580
- TypographyVariant["TAG"] = "TAG";
13581
- TypographyVariant["M4BOLD"] = "M4BOLD";
13582
- TypographyVariant["WRAPPER"] = "WRAPPER";
13583
- })(TypographyVariant || (TypographyVariant = {}));
13584
- var TypographyColor;
13585
- (function (TypographyColor) {
13586
- TypographyColor["PRIMARY"] = "primary";
13587
- TypographyColor["SECONDARY"] = "secondary";
13588
- TypographyColor["TERTIARY"] = "tertiary";
13589
- TypographyColor["HEADING"] = "heading";
13590
- TypographyColor["SUBHEADING"] = "subheading";
13591
- TypographyColor["SUCCESS"] = "success";
13592
- TypographyColor["ALERT"] = "alert";
13593
- TypographyColor["WARNING"] = "warning";
13594
- TypographyColor["DISABLED"] = "disabled";
13595
- TypographyColor["LINK"] = "link";
13596
- TypographyColor["NEUTRAL"] = "neutral";
13597
- TypographyColor["LINK2"] = "link2";
13598
- TypographyColor["PRIMARY2"] = "primary2";
13599
- TypographyColor["SECONDARY2"] = "secondary2";
13600
- TypographyColor["GRAPETINI"] = "grapetini900";
13601
- TypographyColor["PINA_COLADA750"] = "pinacolada750";
13602
- TypographyColor["BRAND"] = "brand";
13603
- TypographyColor["ALERT500"] = "alert500";
13604
- TypographyColor["NEUTRAL50"] = "neutral50";
13605
- TypographyColor["MARGARITA750"] = "margarita750";
13606
- TypographyColor["GREEN100"] = "green100";
13607
- TypographyColor["RED100"] = "red100";
13608
- TypographyColor["ALERT300"] = "alert300";
13609
- TypographyColor["RED500"] = "red500";
13610
- TypographyColor["CORALPINK"] = "coralpink";
13611
- TypographyColor["WARNING500"] = "warning500";
13612
- TypographyColor["BLUE700"] = "blue700";
13613
- TypographyColor["NEUTRAL650"] = "neutral650";
13614
- TypographyColor["GREY700"] = "grey700";
13615
- TypographyColor["BLACK000"] = "black000";
13616
- })(TypographyColor || (TypographyColor = {}));
13617
- const getTypographyVariant = (theme, variant) => {
13618
- switch (variant) {
13619
- case TypographyVariant.HD1:
13620
- {
13621
- return {
13622
- fontSize: theme.typography.size[48],
13623
- fontWeight: theme.typography.weight.semibold,
13624
- lineHeight: theme.typography.lineHeight[56]
13625
- };
13626
- }
13627
- case TypographyVariant.HD2:
13628
- {
13629
- return {
13630
- fontSize: theme.typography.size[40],
13631
- fontWeight: theme.typography.weight.semibold,
13632
- lineHeight: theme.typography.lineHeight[48]
13633
- };
13634
- }
13635
- case TypographyVariant.HD3:
13636
- {
13637
- return {
13638
- fontSize: theme.typography.size[32],
13639
- fontWeight: theme.typography.weight.semibold,
13640
- lineHeight: theme.typography.lineHeight[40]
13641
- };
13642
- }
13643
- case TypographyVariant.HM1:
13644
- {
13645
- return {
13646
- fontSize: theme.typography.size[24],
13647
- fontWeight: theme.typography.weight.semibold,
13648
- lineHeight: theme.typography.lineHeight[32]
13649
- };
13650
- }
13651
- case TypographyVariant.HM2:
13652
- {
13653
- return {
13654
- fontSize: theme.typography.size[20],
13655
- fontWeight: theme.typography.weight.semibold,
13656
- lineHeight: theme.typography.lineHeight[28]
13657
- };
13658
- }
13659
- case TypographyVariant.HM3:
13660
- {
13661
- return {
13662
- fontSize: theme.typography.size[16],
13663
- fontWeight: theme.typography.weight.semibold,
13664
- lineHeight: theme.typography.lineHeight[24]
13665
- };
13666
- }
13667
- case TypographyVariant.HM4:
13668
- {
13669
- return {
13670
- fontSize: theme.typography.size[14],
13671
- fontWeight: theme.typography.weight.semibold,
13672
- lineHeight: theme.typography.lineHeight[20]
13673
- };
13674
- }
13675
- case TypographyVariant.B1:
13676
- {
13677
- return {
13678
- fontSize: theme.typography.size[16],
13679
- fontWeight: theme.typography.weight.medium,
13680
- lineHeight: theme.typography.lineHeight[24]
13681
- };
13682
- }
13683
- case TypographyVariant.B2:
13684
- {
13685
- return {
13686
- fontSize: theme.typography.size[14],
13687
- fontWeight: theme.typography.weight.medium,
13688
- lineHeight: theme.typography.lineHeight[20]
13689
- };
13690
- }
13691
- case TypographyVariant.B3:
13692
- {
13693
- return {
13694
- fontSize: theme.typography.size[12],
13695
- fontWeight: theme.typography.weight.medium,
13696
- lineHeight: theme.typography.lineHeight[16]
13697
- };
13698
- }
13699
- case TypographyVariant.B3CAPS:
13700
- {
13701
- return {
13702
- fontSize: theme.typography.size[12],
13703
- fontWeight: theme.typography.weight.semibold,
13704
- lineHeight: theme.typography.lineHeight[16],
13705
- letterSpacing: theme.typography.letterSpacing.point4,
13706
- textTransform: 'uppercase'
13707
- };
13708
- }
13709
- case TypographyVariant.B4:
13710
- {
13711
- return {
13712
- fontSize: theme.typography.size[10],
13713
- fontWeight: theme.typography.weight.medium,
13714
- lineHeight: theme.typography.lineHeight[14]
13715
- };
13716
- }
13717
- case TypographyVariant.B4CAPS:
13718
- {
13719
- return {
13720
- fontSize: theme.typography.size[10],
13721
- fontWeight: theme.typography.weight.semibold,
13722
- lineHeight: theme.typography.lineHeight[12],
13723
- letterSpacing: theme.typography.letterSpacing.point4,
13724
- textTransform: 'uppercase'
13725
- };
13726
- }
13727
- case TypographyVariant.P1:
13728
- {
13729
- return {
13730
- fontSize: theme.typography.size[16],
13731
- fontWeight: theme.typography.weight.normal,
13732
- lineHeight: theme.typography.lineHeight[22]
13733
- };
13734
- }
13735
- case TypographyVariant.P2:
13736
- {
13737
- return {
13738
- fontSize: theme.typography.size[14],
13739
- fontWeight: theme.typography.weight.normal,
13740
- lineHeight: theme.typography.lineHeight[20]
13741
- };
13742
- }
13743
- case TypographyVariant.P3:
13744
- {
13745
- return {
13746
- fontSize: theme.typography.size[12],
13747
- fontWeight: theme.typography.weight.normal,
13748
- lineHeight: theme.typography.lineHeight[16]
13749
- };
13750
- }
13751
- case TypographyVariant.P4:
13752
- {
13753
- return {
13754
- fontSize: theme.typography.size[10],
13755
- fontWeight: theme.typography.weight.normal,
13756
- lineHeight: theme.typography.lineHeight[14]
13757
- };
13758
- }
13759
- case TypographyVariant.L1:
13760
- {
13761
- return {
13762
- fontSize: theme.typography.size[16],
13763
- fontWeight: theme.typography.weight.semibold,
13764
- lineHeight: theme.typography.lineHeight[24]
13765
- };
13766
- }
13767
- case TypographyVariant.L2:
13768
- {
13769
- return {
13770
- fontSize: theme.typography.size[14],
13771
- fontWeight: theme.typography.weight.semibold,
13772
- lineHeight: theme.typography.lineHeight[20]
13773
- };
13774
- }
13775
- case TypographyVariant.L3:
13776
- {
13777
- return {
13778
- fontSize: theme.typography.size[12],
13779
- fontWeight: theme.typography.weight.semibold,
13780
- lineHeight: theme.typography.lineHeight[16]
13781
- };
13782
- }
13783
- case TypographyVariant.OVERLINE:
13784
- {
13785
- return {
13786
- fontSize: theme.typography.size[12],
13787
- fontWeight: theme.typography.weight.semibold,
13788
- lineHeight: theme.typography.lineHeight[16]
13789
- };
13790
- }
13791
- case TypographyVariant.TAG:
13792
- {
13793
- return {
13794
- fontSize: theme.typography.size[10],
13795
- fontWeight: theme.typography.weight.semibold,
13796
- lineHeight: theme.typography.lineHeight[12],
13797
- letterSpacing: theme.typography.letterSpacing.point4
13798
- };
12002
+ },
12003
+ children: (_a = data === null || data === void 0 ? void 0 : data.slice(0, maxDotsToShow + 1)) === null || _a === void 0 ? void 0 : _a.map((_, index) => {
12004
+ const isActive = currentSlideIndex - 1 === index;
12005
+ if (customIcon && index === customIconIndex) {
12006
+ const Icon = customIcon;
12007
+ return jsxRuntimeExports.jsx(Container, {
12008
+ styleConfig: {
12009
+ root: [staticStyles$1.customIconContainer]
12010
+ },
12011
+ children: jsxRuntimeExports.jsx(Icon, {
12012
+ color: isActive ? '#fff' : '#ffffff80'
12013
+ }, index)
12014
+ }, index);
13799
12015
  }
13800
- default:
13801
- {
13802
- return {
13803
- fontSize: theme.typography.size[20],
13804
- fontWeight: theme.typography.weight.semibold,
13805
- lineHeight: theme.typography.lineHeight[28]
13806
- };
12016
+ if (isActive) {
12017
+ return jsxRuntimeExports.jsx(Container, {
12018
+ styleConfig: {
12019
+ root: [staticStyles$1.activeDots, staticStyles$1.selectedDots, ...selectedDotStyles]
12020
+ }
12021
+ }, index);
13807
12022
  }
12023
+ return jsxRuntimeExports.jsx(Container, {
12024
+ styleConfig: {
12025
+ root: [staticStyles$1.inActiveDots, staticStyles$1.carouselDots, ...dotStyles]
12026
+ }
12027
+ }, index);
12028
+ })
12029
+ });
12030
+ };
12031
+ const staticStyles = ctDesignStyleManager.makeStyles(theme => {
12032
+ return {
12033
+ root: {
12034
+ position: 'relative'
12035
+ },
12036
+ countWrapper: {
12037
+ zIndex: 12,
12038
+ right: '4%',
12039
+ position: 'absolute',
12040
+ alignSelf: 'flex-end',
12041
+ bottom: theme === null || theme === void 0 ? void 0 : theme.spacing[4]
12042
+ },
12043
+ carouselContainerStyles: {
12044
+ width: '100%',
12045
+ alignItems: 'center',
12046
+ justifyContent: 'center'
12047
+ },
12048
+ carouselDots: {
12049
+ backgroundColor: '#ffffff80',
12050
+ borderRadius: theme === null || theme === void 0 ? void 0 : theme.border.radius[6]
12051
+ },
12052
+ selectedDots: {
12053
+ width: theme.spacing['1.5'],
12054
+ height: theme.spacing['1.5'],
12055
+ overflow: 'hidden',
12056
+ borderRadius: theme === null || theme === void 0 ? void 0 : theme.border.radius[6],
12057
+ backgroundColor: theme === null || theme === void 0 ? void 0 : theme.color.background.neutral
12058
+ },
12059
+ dotsContainer: {
12060
+ gap: 5,
12061
+ marginBottom: 11,
12062
+ zIndex: 16,
12063
+ width: '100%',
12064
+ alignItems: 'center',
12065
+ position: 'absolute',
12066
+ justifyContent: 'center',
12067
+ bottom: 0,
12068
+ left: 0,
12069
+ right: 0
12070
+ },
12071
+ imageCountChipContainer: {
12072
+ width: 54,
12073
+ height: 36,
12074
+ zIndex: 12,
12075
+ borderRadius: 24,
12076
+ alignItems: 'center',
12077
+ justifyContent: 'center',
12078
+ right: theme === null || theme === void 0 ? void 0 : theme.spacing[4],
12079
+ bottom: theme === null || theme === void 0 ? void 0 : theme.spacing[4],
12080
+ backgroundColor: 'rgba(26, 26, 26, 0.4)'
12081
+ },
12082
+ customIconContainer: {
12083
+ width: theme.spacing['1.5'],
12084
+ height: theme.spacing['1.5'],
12085
+ alignItems: 'center',
12086
+ justifyContent: 'center'
12087
+ }
12088
+ };
12089
+ });
12090
+ var SLIDER_DIRECTION;
12091
+ (function (SLIDER_DIRECTION) {
12092
+ SLIDER_DIRECTION["NEXT"] = "next";
12093
+ SLIDER_DIRECTION["PREV"] = "prev";
12094
+ })(SLIDER_DIRECTION || (SLIDER_DIRECTION = {}));
12095
+ const checkNeedsInstantJump = (dir, pos, finalLogicalPos, numItems, loop, finalVirtualPos) => {
12096
+ if (!loop || numItems <= 1) {
12097
+ return {
12098
+ needsInstantJump: false,
12099
+ jumpToVirtualPos: finalVirtualPos
12100
+ };
12101
+ }
12102
+ if (dir === SLIDER_DIRECTION.NEXT && pos === numItems - 1 && finalLogicalPos === 0) {
12103
+ return {
12104
+ needsInstantJump: true,
12105
+ jumpToVirtualPos: numItems + 1
12106
+ };
12107
+ }
12108
+ if (dir === SLIDER_DIRECTION.PREV && pos === 0 && finalLogicalPos === numItems - 1) {
12109
+ return {
12110
+ needsInstantJump: true,
12111
+ jumpToVirtualPos: 0
12112
+ };
13808
12113
  }
12114
+ return {
12115
+ needsInstantJump: false,
12116
+ jumpToVirtualPos: finalVirtualPos
12117
+ };
13809
12118
  };
13810
- const getTypographyColor = (theme, color) => {
13811
- switch (color) {
13812
- case TypographyColor.PRIMARY:
13813
- {
13814
- return theme.color.text.primary;
13815
- }
13816
- case TypographyColor.SECONDARY:
13817
- {
13818
- return theme.color.text.secondary;
13819
- }
13820
- case TypographyColor.TERTIARY:
13821
- {
13822
- return theme.color.text.tertiary;
13823
- }
13824
- case TypographyColor.ALERT:
13825
- {
13826
- return theme.color.text.alert;
13827
- }
13828
- case TypographyColor.DISABLED:
13829
- {
13830
- return theme.color.text.disabled;
13831
- }
13832
- case TypographyColor.HEADING:
13833
- {
13834
- return theme.color.text.heading;
13835
- }
13836
- case TypographyColor.LINK:
13837
- {
13838
- return theme.color.text.link;
13839
- }
13840
- case TypographyColor.SUBHEADING:
13841
- {
13842
- return theme.color.text.subHeading;
13843
- }
13844
- case TypographyColor.SUCCESS:
13845
- {
13846
- return theme.color.text.success;
13847
- }
13848
- case TypographyColor.WARNING:
13849
- {
13850
- return theme.color.text.warning;
13851
- }
13852
- case TypographyColor.NEUTRAL:
13853
- {
13854
- return theme.color.text.neutral;
13855
- }
13856
- case TypographyColor.LINK2:
13857
- {
13858
- return theme.color.text.link2;
13859
- }
13860
- case TypographyColor.PRIMARY2:
13861
- {
13862
- return theme.color.text.primary2;
13863
- }
13864
- case TypographyColor.SECONDARY2:
13865
- {
13866
- return theme.color.text.secondary2;
13867
- }
13868
- case TypographyColor.GRAPETINI:
13869
- {
13870
- return theme.color.text.grapetini900;
13871
- }
13872
- case TypographyColor.PINA_COLADA750:
13873
- {
13874
- return theme.color.text.pinaColada750;
13875
- }
13876
- case TypographyColor.CORALPINK:
13877
- {
13878
- return theme.color.text.coralpink;
13879
- }
13880
- case TypographyColor.NEUTRAL50:
13881
- {
13882
- return theme.color.text.neutral50;
13883
- }
13884
- case TypographyColor.WARNING500:
13885
- case TypographyColor.ALERT500:
13886
- {
13887
- return theme.color.text.alert500;
13888
- }
13889
- case TypographyColor.BRAND:
13890
- {
13891
- return theme.color.text.brand;
13892
- }
13893
- case TypographyColor.MARGARITA750:
13894
- {
13895
- return theme.color.text.margarita750;
13896
- }
13897
- case TypographyColor.GREEN100:
13898
- {
13899
- return theme.color.text.green100;
13900
- }
13901
- case TypographyColor.RED100:
13902
- {
13903
- return theme.color.text.red100;
12119
+ const getFinalPos = (position, direction, length) => {
12120
+ return (position + length + (direction === SLIDER_DIRECTION.PREV ? -1 : 1)) % length;
12121
+ };
12122
+ const SWIPE_SENSITIVITY = 1;
12123
+ const SWIPE_THRESHOLD_VELOCITY = 0.15;
12124
+ const DEFAULT_CONTAINER_WIDTH = 400;
12125
+ const DEFAULT_TRANSITION_TIME = 0.3;
12126
+ const TRANSITION_TIMING_FUNCTION = 'ease';
12127
+ const CORNER_SLIDE_THRESHOLD = 60;
12128
+ const getVirtualPos = (logicalPos, numItems, loop) => {
12129
+ if (!loop || numItems <= 1) return logicalPos;
12130
+ return logicalPos + 1;
12131
+ };
12132
+ const Slider = React.forwardRef(({
12133
+ data,
12134
+ slideWidth,
12135
+ autoPlay = false,
12136
+ showDots = true,
12137
+ startIndex = 0,
12138
+ isInfinite = false,
12139
+ autoPlaySpeed = 500,
12140
+ maxDotsToShow = data === null || data === void 0 ? void 0 : data.length,
12141
+ showCountChip = false,
12142
+ thresholdDelta = 40,
12143
+ isSwipeDisabled = false,
12144
+ autoSwipeDuration = 1000,
12145
+ containerWidth: containerWidthProps,
12146
+ children = [],
12147
+ showProgressDots = false,
12148
+ progressDotWidth = 80,
12149
+ styleConfig,
12150
+ onSlide,
12151
+ renderItem
12152
+ }, ref) => {
12153
+ const containerRef = React.useRef(null);
12154
+ const carouselRef = React.useRef(null);
12155
+ const swipeRef = React.useRef(false);
12156
+ const firstClientX = React.useRef(0);
12157
+ const {
12158
+ imageCountChipContainer: countContainerStyles = []
12159
+ } = styleConfig || {};
12160
+ const [chipCount, setChipCount] = React.useState(startIndex + 1);
12161
+ const getSwipePercentage = (e, customSensitivity) => {
12162
+ var _a;
12163
+ const newPosition = (customSensitivity || SWIPE_SENSITIVITY) * e.deltaX;
12164
+ const containerWidth = containerWidthProps || ((_a = carouselRef.current) === null || _a === void 0 ? void 0 : _a.offsetWidth) || DEFAULT_CONTAINER_WIDTH;
12165
+ const percentage = typeof containerWidth === 'number' ? newPosition / containerWidth * 100 : 0;
12166
+ return percentage;
12167
+ };
12168
+ const isPositionValid = React.useCallback(position => position > 0 || position < (data.length - 1) * -100, [data.length]);
12169
+ const handleInstantJumpTransition = React.useCallback((finalVirtualPos, finalLogicalPos) => {
12170
+ if (!carouselRef.current) return;
12171
+ const transitionEndHandler = () => {
12172
+ if (!carouselRef.current) return;
12173
+ carouselRef.current.removeEventListener('transitionend', transitionEndHandler);
12174
+ window.requestAnimationFrame(() => {
12175
+ if (!carouselRef.current) return;
12176
+ carouselRef.current.style.transition = `0s ${TRANSITION_TIMING_FUNCTION}`;
12177
+ carouselRef.current.style.transform = `translateX(${finalVirtualPos * -100}%)`;
12178
+ window.requestAnimationFrame(() => {
12179
+ onSlide === null || onSlide === void 0 ? void 0 : onSlide(finalLogicalPos);
12180
+ setChipCount(finalLogicalPos);
12181
+ });
12182
+ });
12183
+ };
12184
+ carouselRef.current.addEventListener('transitionend', transitionEndHandler, {
12185
+ once: true
12186
+ });
12187
+ }, [onSlide]);
12188
+ const handleNormalTransition = React.useCallback(finalLogicalPos => {
12189
+ window.requestAnimationFrame(() => {
12190
+ onSlide === null || onSlide === void 0 ? void 0 : onSlide(finalLogicalPos);
12191
+ setChipCount(finalLogicalPos);
12192
+ });
12193
+ }, [onSlide]);
12194
+ const onSwipe = React.useCallback(dir => {
12195
+ const finalLogicalPos = getFinalPos(chipCount, dir, data.length);
12196
+ const finalVirtualPos = getVirtualPos(finalLogicalPos, data.length, isInfinite);
12197
+ if (!carouselRef.current) return;
12198
+ const {
12199
+ needsInstantJump,
12200
+ jumpToVirtualPos
12201
+ } = checkNeedsInstantJump(dir, chipCount, finalLogicalPos, data.length, isInfinite, finalVirtualPos);
12202
+ window.requestAnimationFrame(() => {
12203
+ if (!carouselRef.current) return;
12204
+ carouselRef.current.style.transition = `all ${DEFAULT_TRANSITION_TIME}s ${TRANSITION_TIMING_FUNCTION}`;
12205
+ carouselRef.current.style.transform = `translateX(${jumpToVirtualPos * -100}%)`;
12206
+ if (needsInstantJump) {
12207
+ handleInstantJumpTransition(finalVirtualPos, finalLogicalPos);
12208
+ } else {
12209
+ handleNormalTransition(finalLogicalPos);
13904
12210
  }
13905
- case TypographyColor.ALERT300:
13906
- {
13907
- return theme.color.text.alert300;
12211
+ });
12212
+ swipeRef.current = true;
12213
+ }, [handleInstantJumpTransition, handleNormalTransition, data.length, isInfinite, chipCount]);
12214
+ const resetSwipe = (isNewPositionInvalid = false) => {
12215
+ if (isSwipeDisabled) return;
12216
+ if (!carouselRef.current) return;
12217
+ const currentVirtualPos = getVirtualPos(chipCount, data.length, isInfinite);
12218
+ carouselRef.current.style.transition = `all ${isNewPositionInvalid ? DEFAULT_TRANSITION_TIME + 0.2 : DEFAULT_TRANSITION_TIME}s ${TRANSITION_TIMING_FUNCTION}`;
12219
+ carouselRef.current.style.transform = `translate(${currentVirtualPos * -100}%, 0px) translateZ(0px)`;
12220
+ };
12221
+ const onSwiping = e => {
12222
+ if (isSwipeDisabled) return;
12223
+ e.event.preventDefault();
12224
+ e.event.stopPropagation();
12225
+ const dir = e.dir.toUpperCase();
12226
+ if (SLIDER_DIRECTION.NEXT !== dir && SLIDER_DIRECTION.PREV !== dir) return;
12227
+ let percentage = getSwipePercentage(e);
12228
+ swipeRef.current = false;
12229
+ percentage = Math.max(Math.min(percentage, 90), -100);
12230
+ if (!carouselRef.current) return;
12231
+ const currentVirtualPos = getVirtualPos(chipCount, data.length, isInfinite);
12232
+ let newPosition = currentVirtualPos * -100 + percentage;
12233
+ if (!isInfinite) {
12234
+ if (newPosition - CORNER_SLIDE_THRESHOLD > 0 || newPosition + CORNER_SLIDE_THRESHOLD < (data.length - 1) * -100) return;
12235
+ const isNewPositionInvalid = isPositionValid(newPosition);
12236
+ if (isNewPositionInvalid) {
12237
+ percentage = getSwipePercentage(e, 0.3);
12238
+ newPosition = currentVirtualPos * -100 + percentage;
13908
12239
  }
13909
- case TypographyColor.RED500:
13910
- {
13911
- return theme.color.text.red500;
12240
+ }
12241
+ carouselRef.current.style.transition = `0s ${TRANSITION_TIMING_FUNCTION}`;
12242
+ carouselRef.current.style.transform = `translateX(${newPosition}%)`;
12243
+ };
12244
+ const handlers = useSwipeable(Object.assign({
12245
+ onSwipedLeft: e => {
12246
+ if (isSwipeDisabled) return;
12247
+ const percentage = getSwipePercentage(e);
12248
+ if (!carouselRef.current) return;
12249
+ const currentVirtualPos = getVirtualPos(chipCount, data.length, isInfinite);
12250
+ const newPosition = currentVirtualPos * -100 + percentage;
12251
+ const isNewPositionInvalid = !isInfinite && isPositionValid(newPosition);
12252
+ if (!isNewPositionInvalid && (e.velocity > SWIPE_THRESHOLD_VELOCITY || Math.abs(percentage) > thresholdDelta)) {
12253
+ if (!isInfinite && chipCount === data.length - 1) return;
12254
+ onSwipe(SLIDER_DIRECTION.NEXT);
12255
+ } else {
12256
+ resetSwipe(isNewPositionInvalid);
13912
12257
  }
13913
- case TypographyColor.BLUE700:
13914
- {
13915
- return theme.color.text.blue700;
12258
+ swipeRef.current = true;
12259
+ },
12260
+ onSwipedRight: e => {
12261
+ if (isSwipeDisabled) return;
12262
+ const percentage = getSwipePercentage(e);
12263
+ if (!carouselRef.current) return;
12264
+ const currentVirtualPos = getVirtualPos(chipCount, data.length, isInfinite);
12265
+ const newPosition = currentVirtualPos * -100 + percentage;
12266
+ const isNewPositionInvalid = !isInfinite && isPositionValid(newPosition);
12267
+ if (!isNewPositionInvalid && (e.velocity > SWIPE_THRESHOLD_VELOCITY || percentage > thresholdDelta)) {
12268
+ if (!isInfinite && chipCount === 0) return;
12269
+ onSwipe(SLIDER_DIRECTION.PREV);
12270
+ } else {
12271
+ resetSwipe(isNewPositionInvalid);
13916
12272
  }
13917
- case TypographyColor.NEUTRAL650:
13918
- {
13919
- return theme.color.text.neutral650;
12273
+ swipeRef.current = true;
12274
+ },
12275
+ swipeDuration: autoPlay ? autoSwipeDuration : Infinity,
12276
+ trackTouch: true,
12277
+ trackMouse: true,
12278
+ onTouchStartOrOnMouseDown: e => {
12279
+ if (isSwipeDisabled) e.event.preventDefault();
12280
+ },
12281
+ onTouchEndOrOnMouseUp: () => {
12282
+ setTimeout(() => {
12283
+ if (!swipeRef.current) {
12284
+ resetSwipe();
12285
+ }
12286
+ }, 100);
12287
+ }
12288
+ }, {
12289
+ onSwiping: onSwiping
12290
+ }));
12291
+ const length = React__namespace.default.Children.count(children);
12292
+ React.useEffect(() => {
12293
+ let timer;
12294
+ if (autoPlay && length) {
12295
+ timer = setInterval(() => {
12296
+ onSwipe(SLIDER_DIRECTION.NEXT);
12297
+ }, autoPlaySpeed);
12298
+ }
12299
+ return () => {
12300
+ clearInterval(timer);
12301
+ };
12302
+ }, [length, autoPlay, autoPlaySpeed, onSwipe, chipCount]);
12303
+ useIsomorphicEffect(() => {
12304
+ var _a, _b;
12305
+ if (chipCount !== undefined && carouselRef.current && !((_b = (_a = carouselRef === null || carouselRef === void 0 ? void 0 : carouselRef.current) === null || _a === void 0 ? void 0 : _a.style) === null || _b === void 0 ? void 0 : _b.transform)) {
12306
+ const virtualPos = getVirtualPos(chipCount, data.length, isInfinite);
12307
+ carouselRef.current.style.transform = `translateX(${virtualPos * -100}%)`;
12308
+ }
12309
+ }, [chipCount, data.length, isInfinite]);
12310
+ const touchStart = React.useCallback(e => {
12311
+ firstClientX.current = e.touches[0].clientX;
12312
+ }, []);
12313
+ const preventTouch = React.useCallback(e => {
12314
+ e.preventDefault();
12315
+ e.stopPropagation();
12316
+ }, []);
12317
+ React.useEffect(() => {
12318
+ if (carouselRef.current) {
12319
+ carouselRef.current.addEventListener('touchstart', touchStart, {
12320
+ passive: false
12321
+ });
12322
+ carouselRef.current.addEventListener('touchmove', preventTouch, {
12323
+ passive: false
12324
+ });
12325
+ }
12326
+ return () => {
12327
+ if (carouselRef.current) {
12328
+ carouselRef.current.removeEventListener('touchstart', touchStart);
12329
+ carouselRef.current.removeEventListener('touchmove', e => {
12330
+ preventTouch(e);
12331
+ });
13920
12332
  }
13921
- case TypographyColor.GREY700:
13922
- {
13923
- return theme.color.text.gray700;
12333
+ };
12334
+ }, []);
12335
+ React.useEffect(() => {
12336
+ if (containerRef.current) {
12337
+ containerRef.current.addEventListener('touchstart', touchStart, {
12338
+ passive: false
12339
+ });
12340
+ containerRef.current.addEventListener('touchmove', preventTouch, {
12341
+ passive: false
12342
+ });
12343
+ }
12344
+ return () => {
12345
+ if (containerRef.current) {
12346
+ containerRef.current.removeEventListener('touchstart', touchStart);
12347
+ containerRef.current.removeEventListener('touchmove', preventTouch);
13924
12348
  }
13925
- case TypographyColor.BLACK000:
13926
- {
13927
- return theme.color.text.black000;
12349
+ };
12350
+ }, []);
12351
+ React.useImperativeHandle(ref, () => ({
12352
+ goToNextSlide: () => {
12353
+ onSwipe(SLIDER_DIRECTION.NEXT);
12354
+ },
12355
+ goToPreviousSlide: () => {
12356
+ onSwipe(SLIDER_DIRECTION.PREV);
12357
+ }
12358
+ }), []);
12359
+ const dynamicStylesSlide = ctDesignStyleManager.useStyles(() => {
12360
+ return {
12361
+ slide: {
12362
+ width: slideWidth || '100%'
13928
12363
  }
12364
+ };
12365
+ }, [slideWidth]);
12366
+ const _renderItem = React.useCallback(info => {
12367
+ if (renderItem) {
12368
+ return renderItem(info, data.length);
12369
+ }
12370
+ return children === null || children === void 0 ? void 0 : children[info.index];
12371
+ }, [children, renderItem, data.length]);
12372
+ return jsxRuntimeExports.jsxs("div", {
12373
+ ref: containerRef,
12374
+ children: [jsxRuntimeExports.jsxs("div", Object.assign({}, handlers, {
12375
+ children: [!showProgressDots && jsxRuntimeExports.jsx(CarouselPagination, {
12376
+ data: data,
12377
+ showDots: showDots,
12378
+ maxDotsToShow: maxDotsToShow,
12379
+ styleConfig: styleConfig,
12380
+ currentSlideIndex: chipCount
12381
+ }), showCountChip && jsxRuntimeExports.jsx(Container, {
12382
+ styleConfig: {
12383
+ root: [staticStyles.countWrapper]
12384
+ },
12385
+ children: jsxRuntimeExports.jsx(Container, {
12386
+ styleConfig: {
12387
+ root: [staticStyles.imageCountChipContainer, ...countContainerStyles]
12388
+ },
12389
+ children: jsxRuntimeExports.jsxs(Typography, {
12390
+ variant: TypographyVariant.L2,
12391
+ color: TypographyColor.NEUTRAL,
12392
+ children: [chipCount, "/", data.length]
12393
+ })
12394
+ })
12395
+ }), jsxRuntimeExports.jsx("div", {
12396
+ ref: carouselRef,
12397
+ children: data.map((item, index) => {
12398
+ const key = `slide-${index}`;
12399
+ return jsxRuntimeExports.jsx(Container, {
12400
+ styleConfig: {
12401
+ root: [dynamicStylesSlide.slide]
12402
+ },
12403
+ children: _renderItem({
12404
+ item,
12405
+ index
12406
+ })
12407
+ }, key);
12408
+ })
12409
+ })]
12410
+ })), showProgressDots && jsxRuntimeExports.jsx(ProgressDots, {
12411
+ total: data === null || data === void 0 ? void 0 : data.length,
12412
+ currentIndex: chipCount,
12413
+ autoPlayInterval: autoPlaySpeed,
12414
+ dotWidth: progressDotWidth
12415
+ })]
12416
+ });
12417
+ });
12418
+ Slider.displayName = 'Slider';
12419
+ const getComponent = variant => {
12420
+ switch (variant) {
12421
+ case 'swiper':
12422
+ return Swiper;
12423
+ case 'slider':
12424
+ return Slider;
13929
12425
  default:
13930
- {
13931
- return theme.color.text.primary;
13932
- }
13933
- }
13934
- };
13935
- const getLineClampStyles = lineClamp => {
13936
- if (!lineClamp) {
13937
- return {};
13938
- }
13939
- if (lineClamp === 1) {
13940
- return {
13941
- display: 'block',
13942
- whiteSpace: 'nowrap',
13943
- overflow: 'hidden',
13944
- textOverflow: 'ellipsis',
13945
- width: '100%',
13946
- minWidth: 0
13947
- };
12426
+ return Slider;
13948
12427
  }
13949
- return {
13950
- display: '-webkit-box',
13951
- WebkitLineClamp: lineClamp,
13952
- WebkitBoxOrient: 'vertical',
13953
- overflow: 'hidden',
13954
- textOverflow: 'ellipsis',
13955
- width: '100%',
13956
- minWidth: 0
13957
- };
13958
12428
  };
13959
- const getTypographyStyles = ({
13960
- theme,
13961
- variant,
13962
- color,
13963
- isStriked,
13964
- colorCode,
13965
- isUnderlined,
13966
- showInItalics
13967
- }) => {
13968
- const textDecorationLine = isStriked ? 'line-through' : 'none';
13969
- return Object.assign(Object.assign({}, getTypographyVariant(theme, variant !== null && variant !== void 0 ? variant : TypographyVariant.HM2)), {
13970
- color: colorCode || getTypographyColor(theme, color !== null && color !== void 0 ? color : TypographyColor.PRIMARY),
13971
- textDecorationLine: isUnderlined ? 'underline' : textDecorationLine,
13972
- fontStyle: showInItalics ? 'italic' : 'none'
13973
- });
12429
+ const CarouselComponent = (_a, ref) => {
12430
+ var {
12431
+ variant = 'swiper'
12432
+ } = _a,
12433
+ props = __rest(_a, ["variant"]);
12434
+ const Component = getComponent(variant);
12435
+ return jsxRuntimeExports.jsx(Component, Object.assign({}, props, {
12436
+ ref: ref
12437
+ }));
13974
12438
  };
13975
- const getTextType = variant => {
13976
- var _a;
13977
- const variantMapper = {
13978
- HD1: 'h1',
13979
- HD2: 'h2',
13980
- HD3: 'h3',
13981
- HM1: 'h1',
13982
- HM2: 'h2',
13983
- HM3: 'h3',
13984
- HM4: 'h4',
13985
- B1: 'span',
13986
- B2: 'span',
13987
- B3: 'span',
13988
- B4: 'span',
13989
- P1: 'span',
13990
- P2: 'span',
13991
- P3: 'span',
13992
- P4: 'span',
13993
- L1: 'span',
13994
- L2: 'span',
13995
- L3: 'span',
13996
- M4BOLD: 'span',
13997
- B4CAPS: 'div',
13998
- OVERLINE: 'div',
13999
- B3CAPS: 'div',
14000
- TAG: 'div',
14001
- WRAPPER: 'div'
14002
- };
14003
- return (_a = variantMapper[variant]) !== null && _a !== void 0 ? _a : 'span';
12439
+ const Carousel = React.forwardRef(CarouselComponent);
12440
+
12441
+ var RatingSize;
12442
+ (function (RatingSize) {
12443
+ RatingSize["XS"] = "xs";
12444
+ RatingSize["XSM"] = "xsm";
12445
+ RatingSize["SM"] = "sm";
12446
+ RatingSize["MD"] = "md";
12447
+ RatingSize["LG"] = "lg";
12448
+ RatingSize["XL"] = "xl";
12449
+ RatingSize["XXL"] = "xxl";
12450
+ })(RatingSize || (RatingSize = {}));
12451
+ const getRatingSizeTokens = (theme, size) => {
12452
+ switch (size) {
12453
+ case RatingSize.XS:
12454
+ return {
12455
+ width: theme.size[2],
12456
+ height: theme.size[2]
12457
+ };
12458
+ case RatingSize.XSM:
12459
+ return {
12460
+ width: theme.size[3],
12461
+ height: theme.size[3]
12462
+ };
12463
+ case RatingSize.SM:
12464
+ return {
12465
+ width: theme.size[4],
12466
+ height: theme.size[4]
12467
+ };
12468
+ case RatingSize.MD:
12469
+ return {
12470
+ width: theme.size[5],
12471
+ height: theme.size[5]
12472
+ };
12473
+ case RatingSize.LG:
12474
+ return {
12475
+ width: theme.size[6],
12476
+ height: theme.size[6]
12477
+ };
12478
+ case RatingSize.XL:
12479
+ return {
12480
+ width: theme.size[8],
12481
+ height: theme.size[8]
12482
+ };
12483
+ case RatingSize.XXL:
12484
+ return {
12485
+ width: theme.size[10],
12486
+ height: theme.size[10]
12487
+ };
12488
+ default:
12489
+ return {
12490
+ width: theme.size[4],
12491
+ height: theme.size[4]
12492
+ };
12493
+ }
14004
12494
  };
14005
- const Typography = ({
14006
- children = null,
14007
- variant,
14008
- color = TypographyColor.PRIMARY,
14009
- isClickable,
14010
- isStriked = false,
14011
- isUnderlined = false,
14012
- onClick,
14013
- colorCode = '',
14014
- showInItalics = false,
14015
- lineClamp,
14016
- componentNode,
14017
- isDisabled = false,
14018
- styleConfig = {}
14019
- }) => {
12495
+ const getRatingColorTokens = theme => ({
12496
+ activeColor: theme.color.text.primary,
12497
+ inActiveColor: theme.color.text.tertiary
12498
+ });
12499
+ const getRatingTokens = (theme, size) => Object.assign(Object.assign({}, getRatingSizeTokens(theme, size)), getRatingColorTokens(theme));
12500
+ const staticRatingStyles = ctDesignStyleManager.makeStyles(theme => ({
12501
+ root: {
12502
+ flexDirection: 'row',
12503
+ padding: theme === null || theme === void 0 ? void 0 : theme.spacing[1],
12504
+ width: '100%'
12505
+ },
12506
+ ratingContainer: {
12507
+ flexDirection: 'row'
12508
+ }
12509
+ }));
12510
+ const Rating = React.forwardRef((props, ref) => {
12511
+ const {
12512
+ rating = 2,
12513
+ maxRating = 5,
12514
+ size = RatingSize.LG,
12515
+ activeColor,
12516
+ inActiveColor,
12517
+ styleConfig
12518
+ } = props;
14020
12519
  const theme = ctDesignTheme.useTheme();
14021
- const parsedIsClickable = typeof isClickable === 'boolean' ? isClickable : !!onClick;
14022
- const typographyStyles = ctDesignStyleManager.useStyles(theme => {
14023
- return {
14024
- root: getTypographyStyles({
14025
- theme,
14026
- variant,
14027
- color,
14028
- isClickable: parsedIsClickable,
14029
- isStriked,
14030
- isUnderlined,
14031
- colorCode,
14032
- showInItalics,
14033
- lineClamp,
14034
- isDisabled
14035
- })
14036
- };
14037
- }, [variant, color, parsedIsClickable, isStriked, isUnderlined, colorCode, showInItalics, lineClamp, isDisabled, theme]);
12520
+ const tokens = React.useMemo(() => getRatingTokens(theme, size), [theme, size]);
14038
12521
  const {
14039
12522
  root: customRootStyles = [],
14040
- container: customContainerStyles = []
12523
+ ratingContainer: customRatingContainer = []
14041
12524
  } = styleConfig || {};
14042
- const clampClass = React.useMemo(() => {
14043
- return /*#__PURE__*/css$1(getLineClampStyles(lineClamp), "" , "" );
14044
- }, [lineClamp]);
14045
- const mergedRootStyles = ctDesignStyleManager.useWebMergeStyles([typographyStyles.root, clampClass, ...customRootStyles], [typographyStyles.root, clampClass, customRootStyles]);
14046
- const ComponentToRender = lineClamp ? 'div' : componentNode || getTextType(variant) || 'p';
14047
- const isInlineNode = ComponentToRender === 'span';
14048
- if (parsedIsClickable) {
14049
- const containerAs = isInlineNode ? 'span' : 'div';
14050
- const clickableContainerStyles = isInlineNode ? [{
14051
- display: 'inline'
14052
- }, ...customContainerStyles] : customContainerStyles;
14053
- return jsxRuntimeExports.jsx(Container$1, {
14054
- onClick: onClick,
14055
- styleConfig: {
14056
- root: clickableContainerStyles
14057
- },
14058
- as: containerAs,
14059
- children: jsxRuntimeExports.jsx(ComponentToRender, {
14060
- className: mergedRootStyles,
14061
- children: children
14062
- })
14063
- });
14064
- }
14065
- return jsxRuntimeExports.jsx(ComponentToRender, {
14066
- className: mergedRootStyles,
14067
- children: children
12525
+ return jsxRuntimeExports.jsx(Container, {
12526
+ ref: ref,
12527
+ styleConfig: {
12528
+ root: [staticRatingStyles.root, ...customRootStyles]
12529
+ },
12530
+ children: Array.from({
12531
+ length: maxRating
12532
+ }, (_, index) => {
12533
+ const isActive = index + 1 <= rating;
12534
+ const fill = isActive ? activeColor || tokens.activeColor : inActiveColor || tokens.inActiveColor;
12535
+ return jsxRuntimeExports.jsx(Container, {
12536
+ styleConfig: {
12537
+ root: [staticRatingStyles.ratingContainer, ...customRatingContainer]
12538
+ },
12539
+ children: jsxRuntimeExports.jsx(StarRatingIcon, {
12540
+ fill: fill,
12541
+ stroke: fill,
12542
+ width: tokens.width,
12543
+ height: tokens.height
12544
+ })
12545
+ }, `rating_${index}`);
12546
+ })
14068
12547
  });
14069
- };
12548
+ });
12549
+ Rating.displayName = 'Rating';
14070
12550
 
14071
12551
  var CAROUSEL_HEIGHT = {
14072
12552
  DEFAULT: 172,
@@ -14249,12 +12729,12 @@
14249
12729
  if (talosGeneralUtils.isEmpty(inclusions)) {
14250
12730
  return null;
14251
12731
  }
14252
- return (jsxRuntimeExports.jsx(Container$1, { styleConfig: { root: [hotelSRPCardStyles.inclusionsSection] }, children: inclusions.map(function (inclusion, index) {
12732
+ return (jsxRuntimeExports.jsx(Container, { styleConfig: { root: [hotelSRPCardStyles.inclusionsSection] }, children: inclusions.map(function (inclusion, index) {
14253
12733
  var _a;
14254
12734
  if (talosGeneralUtils.isEmpty(inclusion === null || inclusion === void 0 ? void 0 : inclusion.text))
14255
12735
  return null;
14256
12736
  var _b = inclusion !== null && inclusion !== void 0 ? inclusion : {}, _c = _b.icon, iconId = _c === void 0 ? "" : _c, _d = _b.text, text = _d === void 0 ? "" : _d, _e = _b.color, inclusionColor = _e === void 0 ? TypographyColor.PRIMARY : _e;
14257
- return (jsxRuntimeExports.jsxs(Container$1, { styleConfig: { root: [hotelSRPCardStyles.inclusionRow] }, children: [jsxRuntimeExports.jsx(Container$1, { styleConfig: { root: [hotelSRPCardStyles.inclusionIcon] }, children: jsxRuntimeExports.jsx(talosIcon.Icon, { icon: iconId, color: inclusionColor === "success" ? "#11A670" : "#1A1A1A" }) }), jsxRuntimeExports.jsx(Typography, { variant: TypographyVariant.B3, color: (_a = inclusionColor) !== null && _a !== void 0 ? _a : TypographyColor.PRIMARY, children: text })] }, "inclusion-".concat(index)));
12737
+ return (jsxRuntimeExports.jsxs(Container, { styleConfig: { root: [hotelSRPCardStyles.inclusionRow] }, children: [jsxRuntimeExports.jsx(Container, { styleConfig: { root: [hotelSRPCardStyles.inclusionIcon] }, children: jsxRuntimeExports.jsx(talosIcon.Icon, { icon: iconId, color: inclusionColor === "success" ? "#11A670" : "#1A1A1A" }) }), jsxRuntimeExports.jsx(Typography, { variant: TypographyVariant.B3, color: (_a = inclusionColor) !== null && _a !== void 0 ? _a : TypographyColor.PRIMARY, children: text })] }, "inclusion-".concat(index)));
14258
12738
  }) }));
14259
12739
  };
14260
12740
 
@@ -14298,9 +12778,9 @@
14298
12778
  var firstImageUrl = (_c = imageUrls[0]) !== null && _c !== void 0 ? _c : DEFAULT_IMAGE_URL;
14299
12779
  var renderCarousel = function () {
14300
12780
  if (!config.enableCarousel || imageUrls.length === 1) {
14301
- return (jsxRuntimeExports.jsx(Container$1, { styleConfig: { root: [hotelSRPCardStyles.carouselSection] }, children: jsxRuntimeExports.jsx(Container$1, { children: jsxRuntimeExports.jsx(talosImage.Image, { src: firstImageUrl, alt: hotelName || "Hotel image", height: carouselHeight }) }) }));
12781
+ return (jsxRuntimeExports.jsx(Container, { styleConfig: { root: [hotelSRPCardStyles.carouselSection] }, children: jsxRuntimeExports.jsx(Container, { children: jsxRuntimeExports.jsx(talosImage.Image, { src: firstImageUrl, alt: hotelName || "Hotel image", height: carouselHeight }) }) }));
14302
12782
  }
14303
- return (jsxRuntimeExports.jsx(Container$1, { styleConfig: {
12783
+ return (jsxRuntimeExports.jsx(Container, { styleConfig: {
14304
12784
  root: [
14305
12785
  hotelSRPCardStyles.carouselSection,
14306
12786
  { height: carouselHeight },
@@ -14313,7 +12793,7 @@
14313
12793
  return (jsxRuntimeExports.jsx(talosImage.Image, { src: item, alt: hotelName || "Hotel image ".concat(index + 1), width: imageWidth, height: carouselHeight }, "hotel-carousel-".concat(index)));
14314
12794
  } }) }));
14315
12795
  };
14316
- return (jsxRuntimeExports.jsxs(Container$1, { styleConfig: { root: [hotelSRPCardStyles.carouselContainer] }, children: [renderCarousel(), !talosGeneralUtils.isEmpty(overlayBadgeUrl) && (jsxRuntimeExports.jsx(Container$1, { styleConfig: { root: [hotelSRPCardStyles.overlayBadge] }, children: jsxRuntimeExports.jsx(talosImage.Image, { src: constructImageUrl(overlayBadgeUrl), alt: "", height: 20 }) }))] }));
12796
+ return (jsxRuntimeExports.jsxs(Container, { styleConfig: { root: [hotelSRPCardStyles.carouselContainer] }, children: [renderCarousel(), !talosGeneralUtils.isEmpty(overlayBadgeUrl) && (jsxRuntimeExports.jsx(Container, { styleConfig: { root: [hotelSRPCardStyles.overlayBadge] }, children: jsxRuntimeExports.jsx(talosImage.Image, { src: constructImageUrl(overlayBadgeUrl), alt: "", height: 20 }) }))] }));
14317
12797
  };
14318
12798
 
14319
12799
  var HotelPricing = function (_a) {
@@ -14323,7 +12803,7 @@
14323
12803
  if (talosGeneralUtils.isEmpty(data === null || data === void 0 ? void 0 : data.pricing)) {
14324
12804
  return null;
14325
12805
  }
14326
- return (jsxRuntimeExports.jsxs(Container$1, { styleConfig: { root: [hotelSRPCardStyles.pricingSection] }, children: [jsxRuntimeExports.jsxs(Container$1, { styleConfig: { root: [hotelSRPCardStyles.fareRow] }, children: [!talosGeneralUtils.isEmpty(fare) && (jsxRuntimeExports.jsx(Typography, { variant: config.fare, color: TypographyColor.PRIMARY, styleConfig: { root: [hotelSRPCardStyles.fare] }, children: fare })), !talosGeneralUtils.isEmpty(strikedFare) && (jsxRuntimeExports.jsx(Typography, { variant: config.strikedFare, color: TypographyColor.SUBHEADING, styleConfig: { root: [hotelSRPCardStyles.strikedFare] }, children: strikedFare })), config.showTaxDetailsCompact && !talosGeneralUtils.isEmpty(taxDetails) && (jsxRuntimeExports.jsx(Typography, { variant: TypographyVariant.B4, color: TypographyColor.SUBHEADING, lineClamp: 1, styleConfig: { root: [hotelSRPCardStyles.taxDetails] }, children: taxDetails }))] }), config.showTaxDetails && !talosGeneralUtils.isEmpty(taxDetails) && (jsxRuntimeExports.jsx(Typography, { variant: TypographyVariant.P3, color: TypographyColor.SUBHEADING, lineClamp: 1, children: taxDetails }))] }));
12806
+ return (jsxRuntimeExports.jsxs(Container, { styleConfig: { root: [hotelSRPCardStyles.pricingSection] }, children: [jsxRuntimeExports.jsxs(Container, { styleConfig: { root: [hotelSRPCardStyles.fareRow] }, children: [!talosGeneralUtils.isEmpty(fare) && (jsxRuntimeExports.jsx(Typography, { variant: config.fare, color: TypographyColor.PRIMARY, styleConfig: { root: [hotelSRPCardStyles.fare] }, children: fare })), !talosGeneralUtils.isEmpty(strikedFare) && (jsxRuntimeExports.jsx(Typography, { variant: config.strikedFare, color: TypographyColor.SUBHEADING, styleConfig: { root: [hotelSRPCardStyles.strikedFare] }, children: strikedFare })), config.showTaxDetailsCompact && !talosGeneralUtils.isEmpty(taxDetails) && (jsxRuntimeExports.jsx(Typography, { variant: TypographyVariant.B4, color: TypographyColor.SUBHEADING, lineClamp: 1, styleConfig: { root: [hotelSRPCardStyles.taxDetails] }, children: taxDetails }))] }), config.showTaxDetails && !talosGeneralUtils.isEmpty(taxDetails) && (jsxRuntimeExports.jsx(Typography, { variant: TypographyVariant.P3, color: TypographyColor.SUBHEADING, lineClamp: 1, children: taxDetails }))] }));
14327
12807
  };
14328
12808
 
14329
12809
  var HotelRatingRow = function (_a) {
@@ -14334,7 +12814,7 @@
14334
12814
  if (talosGeneralUtils.isEmpty(rating) && talosGeneralUtils.isEmpty(badgeLabel)) {
14335
12815
  return null;
14336
12816
  }
14337
- return (jsxRuntimeExports.jsxs(Container$1, { styleConfig: { root: [hotelSRPCardStyles.ratingRow] }, children: [jsxRuntimeExports.jsx(Container$1, { styleConfig: { root: [hotelSRPCardStyles.ratingLeft] }, children: !talosGeneralUtils.isEmpty(rating) && (jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [!talosGeneralUtils.isEmpty(ratingValue) && (jsxRuntimeExports.jsx(Badge, { text: jsxRuntimeExports.jsx(Typography, { variant: config.ratingValue, color: TypographyColor.NEUTRAL, children: ratingValue }), size: "micro", colorScheme: "blue500", styleConfig: {
12817
+ return (jsxRuntimeExports.jsxs(Container, { styleConfig: { root: [hotelSRPCardStyles.ratingRow] }, children: [jsxRuntimeExports.jsx(Container, { styleConfig: { root: [hotelSRPCardStyles.ratingLeft] }, children: !talosGeneralUtils.isEmpty(rating) && (jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [!talosGeneralUtils.isEmpty(ratingValue) && (jsxRuntimeExports.jsx(Badge, { text: jsxRuntimeExports.jsx(Typography, { variant: config.ratingValue, color: TypographyColor.NEUTRAL, children: ratingValue }), size: "micro", colorScheme: "blue500", styleConfig: {
14338
12818
  root: [hotelSRPCardStyles.ratingValueBadge],
14339
12819
  } })), config.showRatingLabel && !talosGeneralUtils.isEmpty(ratingLabel) && (jsxRuntimeExports.jsx(Typography, { variant: TypographyVariant.B3, color: TypographyColor.LINK, children: ratingLabel })), !talosGeneralUtils.isEmpty(reviewCount) && (jsxRuntimeExports.jsx(Typography, { variant: config.reviewCount, color: TypographyColor.SUBHEADING, children: reviewCount }))] })) }), config.showBadge && !talosGeneralUtils.isEmpty(badgeLabel) && (jsxRuntimeExports.jsx(Badge, { text: jsxRuntimeExports.jsx(Typography, { variant: TypographyVariant.B4, color: TypographyColor.PRIMARY, children: badgeLabel }), colorScheme: BadgeColors.BLUE100 }))] }));
14340
12820
  };
@@ -14344,7 +12824,7 @@
14344
12824
  var theme = ctDesignTheme.useTheme();
14345
12825
  var _b = data !== null && data !== void 0 ? data : {}, _c = _b.hotelName, hotelName = _c === void 0 ? "" : _c, _d = _b.starRating, starRating = _d === void 0 ? 0 : _d, _e = _b.location, location = _e === void 0 ? "" : _e, _f = _b.variant, variant = _f === void 0 ? "DEFAULT" : _f;
14346
12826
  var nameLineClamp = variant === "COMPACT" ? 1 : 2;
14347
- return (jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [jsxRuntimeExports.jsx(Container$1, { styleConfig: { root: [hotelSRPCardStyles.titleRow] }, children: !talosGeneralUtils.isEmpty(hotelName) && (jsxRuntimeExports.jsx(Typography, { variant: config.hotelName, color: TypographyColor.PRIMARY, lineClamp: nameLineClamp, styleConfig: { root: [hotelSRPCardStyles.hotelName] }, children: hotelName })) }), (!talosGeneralUtils.isEmpty(location) || starRating > 0) && (jsxRuntimeExports.jsxs(Container$1, { styleConfig: { root: [hotelSRPCardStyles.locationRow] }, children: [!talosGeneralUtils.isEmpty(location) && (jsxRuntimeExports.jsx(Typography, { variant: TypographyVariant.P3, color: TypographyColor.SUBHEADING, lineClamp: 1, styleConfig: { root: [hotelSRPCardStyles.hotelName] }, children: location })), starRating > 0 && (jsxRuntimeExports.jsx(Container$1, { styleConfig: { root: [hotelSRPCardStyles.starRating] }, children: jsxRuntimeExports.jsx(Rating, { rating: starRating, maxRating: 5, size: "xs", activeColor: theme.color.text.primary, inActiveColor: theme.color.border.disabledDark }) }))] }))] }));
12827
+ return (jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [jsxRuntimeExports.jsx(Container, { styleConfig: { root: [hotelSRPCardStyles.titleRow] }, children: !talosGeneralUtils.isEmpty(hotelName) && (jsxRuntimeExports.jsx(Typography, { variant: config.hotelName, color: TypographyColor.PRIMARY, lineClamp: nameLineClamp, styleConfig: { root: [hotelSRPCardStyles.hotelName] }, children: hotelName })) }), (!talosGeneralUtils.isEmpty(location) || starRating > 0) && (jsxRuntimeExports.jsxs(Container, { styleConfig: { root: [hotelSRPCardStyles.locationRow] }, children: [!talosGeneralUtils.isEmpty(location) && (jsxRuntimeExports.jsx(Typography, { variant: TypographyVariant.P3, color: TypographyColor.SUBHEADING, lineClamp: 1, styleConfig: { root: [hotelSRPCardStyles.hotelName] }, children: location })), starRating > 0 && (jsxRuntimeExports.jsx(Container, { styleConfig: { root: [hotelSRPCardStyles.starRating] }, children: jsxRuntimeExports.jsx(Rating, { rating: starRating, maxRating: 5, size: "xs", activeColor: theme.color.text.primary, inActiveColor: theme.color.border.disabledDark }) }))] }))] }));
14348
12828
  };
14349
12829
 
14350
12830
  var VARIANT_CONFIG = {
@@ -14404,9 +12884,9 @@
14404
12884
  var handleClick = React.useCallback(function () {
14405
12885
  dispatchAll(onClick);
14406
12886
  }, [dispatchAll, onClick]);
14407
- return (jsxRuntimeExports.jsxs(Container$1, { styleConfig: {
12887
+ return (jsxRuntimeExports.jsxs(Container, { styleConfig: {
14408
12888
  root: [hotelSRPCardStyles.root, { width: cardWidth }],
14409
- }, onClick: handleClick, children: [jsxRuntimeExports.jsx(HotelMedia, __assign({}, sectionProps, { config: config })), jsxRuntimeExports.jsxs(Container$1, { styleConfig: { root: [hotelSRPCardStyles.contentSection] }, children: [jsxRuntimeExports.jsxs(Container$1, { styleConfig: { root: [hotelSRPCardStyles.infoSection] }, children: [jsxRuntimeExports.jsx(HotelRatingRow, __assign({}, sectionProps, { config: config })), jsxRuntimeExports.jsx(HotelTitleBlock, __assign({}, sectionProps, { config: config }))] }), config.showInclusions && (jsxRuntimeExports.jsx(HotelInclusions, { data: cardData, config: config, styles: hotelSRPCardStyles })), jsxRuntimeExports.jsx(HotelPricing, __assign({}, sectionProps, { config: config }))] })] }));
12889
+ }, onClick: handleClick, children: [jsxRuntimeExports.jsx(HotelMedia, __assign({}, sectionProps, { config: config })), jsxRuntimeExports.jsxs(Container, { styleConfig: { root: [hotelSRPCardStyles.contentSection] }, children: [jsxRuntimeExports.jsxs(Container, { styleConfig: { root: [hotelSRPCardStyles.infoSection] }, children: [jsxRuntimeExports.jsx(HotelRatingRow, __assign({}, sectionProps, { config: config })), jsxRuntimeExports.jsx(HotelTitleBlock, __assign({}, sectionProps, { config: config }))] }), config.showInclusions && (jsxRuntimeExports.jsx(HotelInclusions, { data: cardData, config: config, styles: hotelSRPCardStyles })), jsxRuntimeExports.jsx(HotelPricing, __assign({}, sectionProps, { config: config }))] })] }));
14410
12890
  };
14411
12891
 
14412
12892
  exports.HotelSRPCard = HotelSRPCard;