@cleartrip/ct-design-header 1.2.0-SNAPSHOT-header-v0.5-login-test.0 → 1.2.0-SNAPSHOT-test-logo-left-padding.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.
@@ -50,27 +50,23 @@
50
50
  var NAVBAR_OPTIONS = [{
51
51
  lefticon: ctDesignIcons.Offers,
52
52
  text: 'Offers',
53
- ravenActionName: 'offers',
54
53
  isHoverable: false,
55
54
  isClickable: true,
56
55
  link: OFFERS_URL
57
56
  }, {
58
57
  lefticon: ctDesignIcons.BusinessBag,
59
58
  text: 'Business',
60
- ravenActionName: 'business',
61
59
  rightIcon: ctDesignIcons.ChevronDown,
62
60
  isHoverable: true
63
61
  }, {
64
62
  lefticon: ctDesignIcons.MyTrips,
65
63
  text: 'My Trips',
66
- ravenActionName: 'mytrips',
67
64
  isHoverable: false,
68
65
  isClickable: true,
69
66
  link: MY_TRIPS_URL
70
67
  }, {
71
68
  lefticon: ctDesignIcons.SupportIcon,
72
69
  text: 'Support',
73
- ravenActionName: 'support',
74
70
  isHoverable: false,
75
71
  isClickable: true,
76
72
  link: SUPPORT_URL
@@ -106,14 +102,11 @@
106
102
  var bdConfig = [{
107
103
  title: 'AgentBox',
108
104
  subtitle: 'For travel agents',
109
- details: 'One-stop travel solution offering the best deals to our travel agency partners',
110
- link: 'https://agency.cleartrip.com'
105
+ details: 'One-stop travel solution offering the best deals to our travel agency partners'
111
106
  }, {
112
107
  title: 'OutOfOffice',
113
108
  subtitle: 'For startups, corporates and SMEs',
114
- details: 'Manage corporate business travel, smartly',
115
- link: 'https://ooo.cleartrip.com/',
116
- ravenActionName: 'ooo'
109
+ details: 'Manage corporate business travel, smartly'
117
110
  }, {
118
111
  title: 'MICE',
119
112
  subtitle: 'For corporate events',
@@ -126,12 +119,12 @@
126
119
  link: 'https://business.cleartrip.com/api-customers/more-details'
127
120
  }];
128
121
  var BUSINESS_DROPDOWN_HEADING = 'Other business services';
129
- exports.RAVEN_PAGE_NAMES = void 0;
122
+ var RAVEN_PAGE_NAMES;
130
123
  (function (RAVEN_PAGE_NAMES) {
131
124
  RAVEN_PAGE_NAMES["UNIFIED_HOME"] = "unified_homepage";
132
125
  RAVEN_PAGE_NAMES["HOTELS_HOME"] = "hotels_homepage";
133
126
  RAVEN_PAGE_NAMES["FLIGHTS_HOME"] = "flights_homepage";
134
- })(exports.RAVEN_PAGE_NAMES || (exports.RAVEN_PAGE_NAMES = {}));
127
+ })(RAVEN_PAGE_NAMES || (RAVEN_PAGE_NAMES = {}));
135
128
  var RAVEN_PLATFORMS;
136
129
  (function (RAVEN_PLATFORMS) {
137
130
  RAVEN_PLATFORMS["DESKTOP"] = "desktop";
@@ -158,18 +151,23 @@
158
151
  var LobsHeader = function () {
159
152
  var selectedLOB = useHeaderContext().selectedLOB;
160
153
  return jsxRuntime.jsx(ctDesignContainer.Container, __assign({
161
- className: 'flex p-4 flex-middle flex-center',
154
+ display: 'flex',
155
+ alignItems: 'center',
156
+ justifyContent: 'center',
157
+ padding: '16px',
158
+ height: '64',
159
+ background: '#F3F5FA',
160
+ top: '64px',
161
+ zIndex: 2,
162
162
  css: {
163
- gap: 40,
164
- height: 64,
165
- background: ' #F3F5FA',
166
- top: 64,
167
- zIndex: 2
163
+ gap: 40
168
164
  }
169
165
  }, {
170
166
  children: LOB_DATA.map(function (item, index) {
171
167
  return jsxRuntime.jsxs(ctDesignContainer.Container, __assign({
172
- className: 'flex flex-middle c-pointer',
168
+ display: 'flex',
169
+ alignItems: 'center',
170
+ cursor: 'pointer',
173
171
  css: {
174
172
  gap: 8,
175
173
  background: selectedLOB === item.title ? '#FFFFFF' : 'transparent',
@@ -393,85 +391,11 @@
393
391
  };
394
392
  };
395
393
 
396
- var stringifyPayload = function (payload) {
397
- var keys = Object.keys(payload);
398
- var numericValues = [];
399
- keys.forEach(function (key) {
400
- if (numericValues.includes(key)) {
401
- payload[key] = Number(payload[key]);
402
- } else {
403
- payload[key] = '' + payload[key];
404
- }
405
- });
406
- return payload;
407
- };
408
- var isServer = function () {
409
- return typeof window === 'undefined' || !window;
410
- };
411
- var getQueryParam = function (queryParam) {
412
- if (isServer()) {
413
- return '';
414
- }
415
- var urlParams = new URLSearchParams(window.location.search);
416
- return urlParams.get(queryParam);
417
- };
418
- var ravenLoyaltyTypes = function (loyaltyType) {
419
- switch (loyaltyType) {
420
- case 'FkVip':
421
- return 'fk_vip';
422
- case 'FkPremium':
423
- return 'fk_plus_premium';
424
- case 'InsiderIcon':
425
- return 'myntra_insidericon';
426
- case 'InsiderElite':
427
- return 'myntra_insiderelite';
428
- default:
429
- return '';
430
- }
431
- };
432
- var ravenSDKTrigger = function (isUserLoggedIn, eventName, ravenPayload, customRavenPayload, ravenPushCallback, pageName) {
433
- var _a;
434
- if (typeof ravenPushCallback !== 'function') {
435
- console.error('ravenPushCallback is not provided or is not a function');
436
- return;
437
- }
438
- var commonPayload = {
439
- page_name: pageName,
440
- platform: RAVEN_PLATFORMS.DESKTOP,
441
- login_status: isUserLoggedIn ? 'yes' : 'no',
442
- domain: (_a = window === null || window === void 0 ? void 0 : window.location) === null || _a === void 0 ? void 0 : _a.host
443
- };
444
- var newRavenPayload = stringifyPayload(ravenPayload);
445
- var parsedCustomRavenPayload = stringifyPayload(customRavenPayload);
446
- var finalPayload = __assign(__assign(__assign({}, commonPayload), newRavenPayload), parsedCustomRavenPayload);
447
- try {
448
- if (ravenPushCallback.length === 1) {
449
- ravenPushCallback({
450
- eventName: eventName,
451
- eventData: finalPayload
452
- });
453
- } else {
454
- ravenPushCallback(eventName, finalPayload);
455
- }
456
- } catch (err) {
457
- console.error(err);
458
- return;
459
- }
460
- };
461
-
462
394
  var BusinessDropdownContent = function (_a) {
463
395
  var isOpen = _a.isOpen;
464
- var _b = useHeaderContext(),
465
- isUserLoggedIn = _b.isUserLoggedIn,
466
- ravenPushCallback = _b.ravenPushCallback,
467
- ravenPageName = _b.ravenPageName,
468
- ravenEventName = _b.ravenEventName,
469
- loyaltyType = _b.loyaltyType,
470
- _c = _b.ravenPayload,
471
- ravenPayload = _c === void 0 ? {} : _c;
472
- var _d = react.useState(0),
473
- leftPosition = _d[0],
474
- setLeftPosition = _d[1];
396
+ var _b = react.useState(0),
397
+ leftPosition = _b[0],
398
+ setLeftPosition = _b[1];
475
399
  var containerRef = useDropdownAnimation(isOpen).containerRef;
476
400
  react.useEffect(function () {
477
401
  var updatePosition = function () {
@@ -490,74 +414,54 @@
490
414
  return window.removeEventListener('resize', updatePosition);
491
415
  };
492
416
  }, [containerRef, leftPosition]);
493
- var handleBusinessDropdownClick = react.useCallback(function (link, title, ravenActionName) {
494
- var _a;
495
- var utmSource = (_a = getQueryParam('utm_source')) !== null && _a !== void 0 ? _a : 'organic';
496
- var actionName = ravenActionName ? "".concat(ravenActionName, "_business_click") : title ? "".concat(title.toLowerCase(), "_business_click") : '';
497
- var defaultPayload = {
498
- action_name: actionName,
499
- action_type: 'click',
500
- u_utm_source: utmSource,
501
- loyalty_type: ravenLoyaltyTypes(loyaltyType)
502
- };
503
- if (link) {
504
- ravenSDKTrigger(isUserLoggedIn, ravenEventName, defaultPayload, ravenPayload, ravenPushCallback, ravenPageName);
505
- window.location.href = link;
506
- }
507
- }, [isUserLoggedIn, ravenEventName, ravenPayload, ravenPushCallback, ravenPageName, loyaltyType]);
508
417
  return jsxRuntime.jsxs(ctDesignContainer.Container, __assign({
509
418
  ref: containerRef,
510
- className: 'bg-neutral-100 o-hidden',
419
+ backgroundColor: '#fff',
420
+ top: '76px',
421
+ position: 'fixed',
422
+ left: "".concat(leftPosition, "px"),
423
+ borderRadius: 24,
424
+ boxShadow: '0px 8px 24px 0px rgba(26, 26, 26, 0.10)',
425
+ width: 'fit-content',
426
+ zIndex: 1002,
511
427
  css: {
512
- top: '76px',
513
- position: 'fixed',
514
- left: "".concat(leftPosition, "px"),
515
- borderRadius: 24,
516
- boxShadow: '0px 8px 24px 0px rgba(26, 26, 26, 0.10)',
517
- width: 'fit-content',
518
- zIndex: 1002,
428
+ overflow: 'hidden',
519
429
  opacity: 0
520
430
  }
521
431
  }, {
522
432
  children: [jsxRuntime.jsx(ctDesignContainer.Container, __assign({
523
- className: 'px-6 py-5',
433
+ padding: '20px 24px 20px 24px',
524
434
  backgroundColor: '#FFF1EC'
525
435
  }, {
526
436
  children: jsxRuntime.jsx(ctDesignTypography.Typography, __assign({
527
437
  variant: 'HM2',
528
- style: {
438
+ css: {
529
439
  lineHeight: '24px'
530
440
  }
531
441
  }, {
532
442
  children: BUSINESS_DROPDOWN_HEADING
533
443
  }))
534
444
  })), jsxRuntime.jsx(ctDesignContainer.Container, __assign({
535
- className: 'flex flex-row p-6',
536
- css: {
537
- columnGap: '48px',
538
- width: 'fit-content'
539
- }
445
+ display: 'flex',
446
+ flexDirection: 'row',
447
+ padding: '24px',
448
+ columnGap: '48px',
449
+ width: 'fit-content'
540
450
  }, {
541
451
  children: bdConfig.map(function (_a) {
542
452
  var title = _a.title,
543
453
  subtitle = _a.subtitle,
544
- details = _a.details,
545
- link = _a.link,
546
- ravenActionName = _a.ravenActionName;
454
+ details = _a.details;
547
455
  return jsxRuntime.jsxs(ctDesignContainer.Container, __assign({
548
- css: {
549
- width: '200px'
550
- },
551
- onClick: function () {
552
- return handleBusinessDropdownClick(link, title, ravenActionName);
553
- },
554
- className: 'bd-hover-container c-pointer'
456
+ cursor: 'pointer',
457
+ width: '200px',
458
+ className: 'bd-hover-container'
555
459
  }, {
556
460
  children: [jsxRuntime.jsxs(ctDesignContainer.Container, __assign({
557
- className: 'flex flex-row flex-middle',
558
- style: {
559
- columnGap: '8px'
560
- }
461
+ display: 'flex',
462
+ flexDirection: 'row',
463
+ alignItems: 'center',
464
+ columnGap: '8px'
561
465
  }, {
562
466
  children: [jsxRuntime.jsx(ctDesignTypography.Typography, __assign({
563
467
  variant: 'HM2',
@@ -567,8 +471,8 @@
567
471
  })), jsxRuntime.jsx(AnimatedArrow, {})]
568
472
  })), jsxRuntime.jsx(ctDesignTypography.Typography, __assign({
569
473
  variant: 'B3',
570
- className: 'mt-1',
571
474
  css: {
475
+ marginTop: '4px',
572
476
  opacity: 0.75
573
477
  }
574
478
  }, {
@@ -576,7 +480,9 @@
576
480
  })), jsxRuntime.jsx(ctDesignTypography.Typography, __assign({
577
481
  variant: 'P3',
578
482
  color: 'subheading',
579
- className: 'mt-3'
483
+ css: {
484
+ marginTop: '12px'
485
+ }
580
486
  }, {
581
487
  children: details
582
488
  }))]
@@ -648,7 +554,6 @@
648
554
  redirectionLink: 'accounts/personal-data-dashboard'
649
555
  }];
650
556
  var SIGN_OUT_TEXT = 'Logout';
651
- var MY_ACCOUNT_TEXT = 'My Account';
652
557
  var LOGGEDIN_USER_TEXT = 'You are logged in with';
653
558
  var HEADER_ACCOUNTS_OPTIONS_OPEN_BTN_ID = 'header-acc-btn';
654
559
  var ACCOUNT_OPTIONS_CONTAINER_ID = 'account-options';
@@ -660,40 +565,27 @@
660
565
  backgroundGradient = _a.backgroundGradient,
661
566
  handleChipClick = _a.handleChipClick,
662
567
  chevronFillColor = _a.chevronFillColor;
663
- var _b = useHeaderContext(),
664
- loyaltyType = _b.loyaltyType,
665
- isUserLoggedIn = _b.isUserLoggedIn,
666
- ravenPushCallback = _b.ravenPushCallback,
667
- ravenPageName = _b.ravenPageName,
668
- _c = _b.ravenPayload,
669
- ravenPayload = _c === void 0 ? {} : _c,
670
- ravenEventName = _b.ravenEventName;
671
- var _d = react.useState(false),
672
- isHovered = _d[0],
673
- setIsHovered = _d[1];
674
- var handleClick = react.useCallback(function () {
675
- var _a;
676
- if (handleChipClick) {
677
- handleChipClick();
678
- } else {
679
- var utmSource = (_a = getQueryParam('utm_source')) !== null && _a !== void 0 ? _a : 'organic';
680
- var defaultPayload = {
681
- action_name: "loyalty_account_click",
682
- action_type: 'click',
683
- u_utm_source: utmSource,
684
- loyaltyType: ravenLoyaltyTypes(loyaltyType)
685
- };
686
- ravenSDKTrigger(isUserLoggedIn, ravenEventName, defaultPayload, ravenPayload, ravenPushCallback, ravenPageName);
687
- window.location.href = '/all-offers/loyalty-october';
688
- }
689
- }, [handleChipClick, loyaltyType, isUserLoggedIn, ravenEventName, ravenPayload, ravenPushCallback, ravenPageName]);
568
+ var _b = react.useState(false),
569
+ isHovered = _b[0],
570
+ setIsHovered = _b[1];
571
+ var handleClick = function () {
572
+ window.location.href = '/';
573
+ handleChipClick && handleChipClick();
574
+ };
690
575
  return jsxRuntime.jsxs(ctDesignContainer.Container, __assign({
691
- className: 'flex p-relative flex-middle flex-center br-8 o-hidden c-pointer',
692
- style: {
576
+ display: 'flex',
577
+ position: 'relative',
578
+ alignItems: 'center',
579
+ justifyContent: 'center',
580
+ borderRadius: '8px',
581
+ cursor: 'pointer',
582
+ paddingLeft: '8px',
583
+ paddingRight: isHovered ? '4px' : '8px',
584
+ css: {
585
+ overflow: 'hidden',
693
586
  height: 32,
694
587
  paddingLeft: 8,
695
- transition: 'padding-right 0.2s ease-in-out',
696
- paddingRight: isHovered ? 4 : 8
588
+ transition: 'padding-right 0.2s ease-in-out'
697
589
  },
698
590
  onMouseEnter: function () {
699
591
  return setIsHovered(true);
@@ -726,12 +618,16 @@
726
618
  zIndex: -1
727
619
  }
728
620
  }), jsxRuntime.jsx(ctDesignContainer.Container, __assign({
729
- className: 'flex flex-middle p-relative'
621
+ display: 'flex',
622
+ alignItems: 'center',
623
+ position: 'relative'
730
624
  }, {
731
625
  children: icon
732
626
  })), jsxRuntime.jsx(ctDesignContainer.Container, __assign({
733
- className: 'flex flex-middle o-hidden',
627
+ display: 'flex',
628
+ alignItems: 'center',
734
629
  style: {
630
+ overflow: 'hidden',
735
631
  maxWidth: isHovered ? 16 : 0,
736
632
  transition: 'max-width 0.2s ease-in-out, opacity 0.2s ease-in-out',
737
633
  opacity: isHovered ? 0.5 : 0
@@ -795,41 +691,23 @@
795
691
  handleChipClick = _a.handleChipClick,
796
692
  value = _a.value,
797
693
  type = _a.type;
798
- var _b = useHeaderContext(),
799
- loyaltyType = _b.loyaltyType,
800
- isUserLoggedIn = _b.isUserLoggedIn,
801
- ravenPushCallback = _b.ravenPushCallback,
802
- ravenPageName = _b.ravenPageName,
803
- ravenEventName = _b.ravenEventName,
804
- _c = _b.ravenPayload,
805
- ravenPayload = _c === void 0 ? {} : _c;
806
- var _d = react.useState(false),
807
- isHovered = _d[0],
808
- setIsHovered = _d[1];
809
- var handleDefaultClick = react.useCallback(function () {
810
- var _a;
811
- if (handleChipClick) {
812
- handleChipClick();
813
- } else {
814
- var utmSource = (_a = getQueryParam('utm_source')) !== null && _a !== void 0 ? _a : 'organic';
815
- var defaultPayload = {
816
- action_name: "".concat(type, "_account_click"),
817
- action_type: 'click',
818
- u_utm_source: utmSource,
819
- loyaltyType: ravenLoyaltyTypes(loyaltyType)
820
- };
821
- ravenSDKTrigger(isUserLoggedIn, ravenEventName, defaultPayload, ravenPayload, ravenPushCallback, ravenPageName);
822
- var redirectUrls = {
823
- supercoin: '/all-offers/supercoins/',
824
- wallet: '/accounts/wallet'
825
- };
826
- if (redirectUrls[type]) {
827
- window.location.href = redirectUrls[type];
828
- }
694
+ var _b = react.useState(false),
695
+ isHovered = _b[0],
696
+ setIsHovered = _b[1];
697
+ var handleDefaultClick = function () {
698
+ if (type === 'supercoins') {
699
+ window.location.href = '/supercoins';
700
+ } else if (type === 'wallet') {
701
+ window.location.href = '/wallet';
829
702
  }
830
- }, [handleChipClick, type, loyaltyType, isUserLoggedIn, ravenEventName, ravenPayload, ravenPushCallback, ravenPageName]);
703
+ handleChipClick && handleChipClick();
704
+ };
831
705
  return jsxRuntime.jsxs(ctDesignContainer.Container, __assign({
832
- className: "flex flex-middle justify-center br-8 c-pointer",
706
+ display: 'flex',
707
+ alignItems: 'center',
708
+ justifyContent: 'center',
709
+ borderRadius: '8px',
710
+ cursor: 'pointer',
833
711
  style: {
834
712
  height: 32,
835
713
  paddingLeft: 8,
@@ -846,18 +724,23 @@
846
724
  onClick: handleDefaultClick
847
725
  }, {
848
726
  children: [jsxRuntime.jsxs(ctDesignContainer.Container, __assign({
849
- className: 'flex flex-middle flex-gap-1'
727
+ display: 'flex',
728
+ alignItems: 'center',
729
+ css: {
730
+ gap: '4px'
731
+ }
850
732
  }, {
851
733
  children: [icon, jsxRuntime.jsx(ctDesignTypography.Typography, __assign({
852
734
  variant: 'B3',
853
- className: 'value-text',
854
735
  isClickable: true
855
736
  }, {
856
737
  children: value
857
738
  }))]
858
739
  })), jsxRuntime.jsx(ctDesignContainer.Container, __assign({
859
- className: 'flex flex-middle o-hidden',
740
+ display: 'flex',
741
+ alignItems: 'center',
860
742
  style: {
743
+ overflow: 'hidden',
861
744
  maxWidth: isHovered ? 16 : 0,
862
745
  transition: 'max-width 0.2s ease-in-out, opacity 0.2s ease-in-out',
863
746
  opacity: isHovered ? 1 : 0
@@ -884,16 +767,13 @@
884
767
  hideWalletChip = _b.hideWalletChip,
885
768
  hideSupercoinsChip = _b.hideSupercoinsChip,
886
769
  hideLoyaltyChip = _b.hideLoyaltyChip;
887
- var shouldShowLoyalty = loyaltyLoading || selectedLoyaltyType && LOYALTY_DATA[selectedLoyaltyType] && !hideLoyaltyChip;
888
- var shouldShowSupercoin = superCoinsLoading || !hideSupercoinsChip;
889
- var shouldShowWallet = walletLoading || !hideWalletChip;
890
- if (!shouldShowLoyalty && !shouldShowSupercoin && !shouldShowWallet) {
891
- return null;
892
- }
893
770
  return jsxRuntime.jsxs(ctDesignContainer.Container, __assign({
894
- className: 'flex p-4 pt-0 flex-start flex-gap-1',
895
- style: {
896
- alignSelf: 'stretch'
771
+ display: 'flex',
772
+ padding: '0 16px 16px 16px',
773
+ justifyContent: 'flex-start',
774
+ css: {
775
+ alignSelf: 'stretch',
776
+ gap: '4px'
897
777
  }
898
778
  }, {
899
779
  children: [loyaltyLoading ? jsxRuntime.jsx(ctDesignShimmer.Shimmer, {
@@ -917,7 +797,7 @@
917
797
  }),
918
798
  value: superCoinBalance,
919
799
  handleChipClick: supercoinsChipClick,
920
- type: 'supercoin'
800
+ type: 'supercoins'
921
801
  }), walletLoading ? jsxRuntime.jsx(ctDesignShimmer.Shimmer, {
922
802
  width: '50px',
923
803
  height: '32px',
@@ -941,51 +821,34 @@
941
821
  userName = _b.userName,
942
822
  userMobileNumber = _b.userMobileNumber,
943
823
  countryCode = _b.countryCode,
944
- userDetailsLoading = _b.userDetailsLoading,
945
- loyaltyType = _b.loyaltyType,
946
- isUserLoggedIn = _b.isUserLoggedIn,
947
- ravenEventName = _b.ravenEventName,
948
- ravenPageName = _b.ravenPageName,
949
- _c = _b.ravenPayload,
950
- ravenPayload = _c === void 0 ? {} : _c,
951
- ravenPushCallback = _b.ravenPushCallback;
824
+ userDetailsLoading = _b.userDetailsLoading;
952
825
  var containerRef = useDropdownAnimation(isOpen).containerRef;
953
- var _d = react.useMemo(function () {
826
+ var _c = react.useMemo(function () {
827
+ var userGreeting = userName && "Hello ".concat(userName, "!");
828
+ var phoneNumber = countryCode && userMobileNumber ? "".concat(countryCode, " ").concat(userMobileNumber) : '';
954
829
  return {
955
- userGreeting: userName ? "Hello ".concat(userName, "!") : '',
956
- phoneNumber: countryCode && userMobileNumber ? "".concat(countryCode, " ").concat(userMobileNumber) : ''
830
+ userGreeting: userGreeting,
831
+ phoneNumber: phoneNumber
957
832
  };
958
833
  }, [userName, userMobileNumber, countryCode]),
959
- userGreeting = _d.userGreeting,
960
- phoneNumber = _d.phoneNumber;
961
- var generateRavenPayload = function (actionName) {
962
- var _a;
963
- return {
964
- action_name: actionName.toLowerCase().replace(/[\s-]/g, '') + '_account_click',
965
- action_type: 'click',
966
- u_utm_source: (_a = getQueryParam('utm_source')) !== null && _a !== void 0 ? _a : 'organic',
967
- loyalty_type: ravenLoyaltyTypes(loyaltyType)
834
+ userGreeting = _c.userGreeting,
835
+ phoneNumber = _c.phoneNumber;
836
+ var handleRedirectClick = function (redirectLink) {
837
+ return function () {
838
+ window.location.href = redirectLink;
968
839
  };
969
840
  };
970
- var handleAccountOptionsClick = react.useCallback(function (text, redirectLink) {
971
- ravenSDKTrigger(isUserLoggedIn, ravenEventName, generateRavenPayload(text), ravenPayload, ravenPushCallback, ravenPageName);
972
- window.location.href = redirectLink;
973
- }, [isUserLoggedIn, ravenEventName, ravenPayload, ravenPushCallback, ravenPageName]);
974
- var handleLogout = react.useCallback(function () {
975
- ravenSDKTrigger(isUserLoggedIn, ravenEventName, generateRavenPayload(SIGN_OUT_TEXT), ravenPayload, ravenPushCallback, ravenPageName);
976
- handleLogoutClick();
977
- }, [isUserLoggedIn, ravenEventName, ravenPayload, ravenPushCallback, ravenPageName, handleLogoutClick]);
978
- var positionAccountOptionsDiv = react.useCallback(function () {
841
+ react.useEffect(function () {
979
842
  var headerAccBtn = document.getElementById(HEADER_ACCOUNTS_OPTIONS_OPEN_BTN_ID);
980
843
  var accountOptionsElem = document.getElementById(ACCOUNT_OPTIONS_CONTAINER_ID);
981
- if (headerAccBtn && accountOptionsElem) {
982
- var headerBtnRight = headerAccBtn.getBoundingClientRect().right;
983
- accountOptionsElem.style.left = "".concat(headerBtnRight - ACCOUNT_OPTIONS_CONTAINER_WIDTH, "px");
984
- }
985
- }, []);
986
- react.useEffect(function () {
844
+ var positionAccountOptionsDiv = function () {
845
+ var headerBtnRight = headerAccBtn === null || headerAccBtn === void 0 ? void 0 : headerAccBtn.getBoundingClientRect().right;
846
+ if (accountOptionsElem && headerBtnRight) {
847
+ accountOptionsElem.style.left = "".concat(headerBtnRight - ACCOUNT_OPTIONS_CONTAINER_WIDTH, "px");
848
+ }
849
+ };
987
850
  positionAccountOptionsDiv();
988
- }, [positionAccountOptionsDiv]);
851
+ }, []);
989
852
  var renderUserData = function () {
990
853
  var renderContent = function (loading, content, variant, color) {
991
854
  return jsxRuntime.jsx(ctDesignTypography.Typography, __assign({
@@ -999,7 +862,11 @@
999
862
  }));
1000
863
  };
1001
864
  return jsxRuntime.jsx(ctDesignContainer.Container, __assign({
1002
- className: 'flex flex-column flex-gap-1'
865
+ display: 'flex',
866
+ flexDirection: 'column',
867
+ css: {
868
+ gap: '4px'
869
+ }
1003
870
  }, {
1004
871
  children: userGreeting ? jsxRuntime.jsxs(jsxRuntime.Fragment, {
1005
872
  children: [renderContent(userDetailsLoading, userGreeting, 'HM3', 'primary'), renderContent(userDetailsLoading, "".concat(LOGGEDIN_USER_TEXT, " ").concat(phoneNumber), 'P3', 'subheading')]
@@ -1011,28 +878,33 @@
1011
878
  return jsxRuntime.jsxs(ctDesignContainer.Container, __assign({
1012
879
  id: ACCOUNT_OPTIONS_CONTAINER_ID,
1013
880
  ref: containerRef,
1014
- className: 'flex flex-column br-16 o-hidden',
881
+ display: 'flex',
882
+ flexDirection: 'column',
883
+ borderRadius: '16px',
884
+ zIndex: 1002,
885
+ top: '76px',
886
+ position: 'fixed',
1015
887
  css: {
1016
- zIndex: 1002,
1017
888
  opacity: 0,
1018
- top: '76px',
1019
- position: 'fixed'
889
+ overflow: 'hidden'
1020
890
  },
1021
891
  width: "".concat(ACCOUNT_OPTIONS_CONTAINER_WIDTH, "px"),
1022
892
  background: '#FFF1EC'
1023
893
  }, {
1024
894
  children: [jsxRuntime.jsx(ctDesignContainer.Container, __assign({
1025
- className: 'p-4',
1026
- height: '76px'
895
+ padding: '16px',
896
+ height: '72px'
1027
897
  }, {
1028
898
  children: renderUserData()
1029
899
  })), jsxRuntime.jsx(RewardsSection, {}), jsxRuntime.jsxs(ctDesignContainer.Container, __assign({
1030
- className: 'p-2 flex flex-column',
900
+ display: 'flex',
901
+ flexDirection: 'column',
902
+ padding: '8px',
1031
903
  backgroundColor: 'white',
904
+ rowGap: '8px',
1032
905
  style: {
1033
906
  borderBottomLeftRadius: 12,
1034
- borderBottomRightRadius: 12,
1035
- rowGap: 8
907
+ borderBottomRightRadius: 12
1036
908
  }
1037
909
  }, {
1038
910
  children: [ACCOUNT_OPTIONS_POPUP_CONFIG.map(function (_a) {
@@ -1040,20 +912,26 @@
1040
912
  icon = _a.icon,
1041
913
  redirectionLink = _a.redirectionLink;
1042
914
  return jsxRuntime.jsx(ctDesignContainer.Container, __assign({
1043
- className: 'p-2 br-8 c-pointer hoverable-container',
1044
- onClick: function () {
1045
- return handleAccountOptionsClick(text, redirectionLink);
1046
- }
915
+ className: 'hoverable-container',
916
+ padding: '8px',
917
+ borderRadius: '8px',
918
+ cursor: 'pointer',
919
+ onClick: handleRedirectClick(redirectionLink)
1047
920
  }, {
1048
921
  children: jsxRuntime.jsxs(ctDesignContainer.Container, __assign({
1049
- className: 'flex c-pointer',
922
+ display: 'flex',
923
+ cursor: 'pointer',
1050
924
  style: {
1051
925
  columnGap: '8px'
1052
926
  }
1053
927
  }, {
1054
928
  children: [icon, jsxRuntime.jsx(ctDesignTypography.Typography, __assign({
1055
929
  variant: 'P1',
1056
- className: 'flex flex-middle c-pointer'
930
+ css: {
931
+ display: 'flex',
932
+ alignItems: 'center',
933
+ cursor: 'pointer'
934
+ }
1057
935
  }, {
1058
936
  children: text
1059
937
  }))]
@@ -1064,15 +942,23 @@
1064
942
  borderBottom: '1px dashed #E6E6E6'
1065
943
  }
1066
944
  }), jsxRuntime.jsxs(ctDesignContainer.Container, __assign({
1067
- className: 'flex p-2 br-8 c-pointer logout-button',
1068
- onClick: handleLogout
945
+ className: 'logout-button',
946
+ display: 'flex',
947
+ padding: '8px',
948
+ borderRadius: '8px',
949
+ cursor: 'pointer',
950
+ onClick: handleLogoutClick
1069
951
  }, {
1070
952
  children: [jsxRuntime.jsx(ctDesignIcons.Signout, {
1071
953
  height: 24,
1072
954
  width: 24
1073
955
  }), jsxRuntime.jsx(ctDesignTypography.Typography, __assign({
1074
956
  variant: 'P1',
1075
- className: 'flex flex-middle c-pointer',
957
+ css: {
958
+ display: 'flex',
959
+ alignItems: 'center',
960
+ cursor: 'pointer'
961
+ },
1076
962
  color: 'warning'
1077
963
  }, {
1078
964
  children: SIGN_OUT_TEXT
@@ -1083,26 +969,18 @@
1083
969
  };
1084
970
 
1085
971
  var UserAccount = function () {
1086
- var _a = useHeaderContext(),
1087
- isNovacThemeEnabled = _a.isNovacThemeEnabled,
1088
- ravenEventName = _a.ravenEventName,
1089
- _b = _a.ravenPayload,
1090
- ravenPayload = _b === void 0 ? {} : _b,
1091
- ravenPushCallback = _a.ravenPushCallback,
1092
- isUserLoggedIn = _a.isUserLoggedIn,
1093
- loyaltyType = _a.loyaltyType,
1094
- ravenPageName = _a.ravenPageName;
1095
- var _c = useHoverDropdown({
972
+ var isNovacThemeEnabled = useHeaderContext().isNovacThemeEnabled;
973
+ var _a = useHoverDropdown({
1096
974
  openDelay: 0
1097
975
  }),
1098
- isDropdownVisible = _c.isDropdownVisible,
1099
- handleOnMouseEnter = _c.handleOnMouseEnter,
1100
- handleOnMouseLeave = _c.handleOnMouseLeave,
1101
- handleDropdownMouseEnter = _c.handleDropdownMouseEnter,
1102
- handleDropdownMouseLeave = _c.handleDropdownMouseLeave;
1103
- var _d = react.useState(false),
1104
- scrolled = _d[0],
1105
- setScrolled = _d[1];
976
+ isDropdownVisible = _a.isDropdownVisible,
977
+ handleOnMouseEnter = _a.handleOnMouseEnter,
978
+ handleOnMouseLeave = _a.handleOnMouseLeave,
979
+ handleDropdownMouseEnter = _a.handleDropdownMouseEnter,
980
+ handleDropdownMouseLeave = _a.handleDropdownMouseLeave;
981
+ var _b = react.useState(false),
982
+ scrolled = _b[0],
983
+ setScrolled = _b[1];
1106
984
  react.useEffect(function () {
1107
985
  var handleScroll = function () {
1108
986
  setScrolled(window.scrollY >= 100);
@@ -1114,27 +992,20 @@
1114
992
  }, []);
1115
993
  var effectiveNovacThemeEnabled = isNovacThemeEnabled && !scrolled;
1116
994
  var hoverColor = effectiveNovacThemeEnabled ? '#FFB8A5' : '#FF4F17';
1117
- var triggerRavenEventOnHover = react.useCallback(function () {
1118
- var _a;
1119
- var utmSource = (_a = getQueryParam('utm_source')) !== null && _a !== void 0 ? _a : 'organic';
1120
- var defaultPayload = {
1121
- action_name: "".concat(MY_ACCOUNT_TEXT.toLowerCase().replace(/[\s-]/g, ''), "_header_hover"),
1122
- action_type: 'hover',
1123
- u_utm_source: utmSource,
1124
- loyalty_type: ravenLoyaltyTypes(loyaltyType)
1125
- };
1126
- ravenSDKTrigger(isUserLoggedIn, ravenEventName, defaultPayload, ravenPayload, ravenPushCallback, ravenPageName);
1127
- }, [isUserLoggedIn, ravenEventName, ravenPayload, ravenPushCallback, ravenPageName, loyaltyType]);
1128
995
  return jsxRuntime.jsxs(ctDesignContainer.Container, {
1129
996
  children: [jsxRuntime.jsxs(ctDesignContainer.Container, __assign({
1130
- className: "flex px-3 py-2 flex-middle br-12 h-100p c-pointer",
997
+ display: 'flex',
998
+ padding: '8px 12px',
999
+ alignItems: 'center',
1000
+ borderRadius: '12px',
1001
+ height: '100%',
1002
+ cursor: 'pointer',
1131
1003
  style: {
1132
1004
  columnGap: 8,
1133
1005
  height: 64
1134
1006
  },
1135
1007
  onMouseEnter: function () {
1136
- handleOnMouseEnter(0);
1137
- triggerRavenEventOnHover();
1008
+ return handleOnMouseEnter(0);
1138
1009
  },
1139
1010
  onMouseLeave: handleOnMouseLeave,
1140
1011
  id: HEADER_ACCOUNTS_OPTIONS_OPEN_BTN_ID
@@ -1142,14 +1013,18 @@
1142
1013
  children: [jsxRuntime.jsx(ctDesignIcons.MyAccount, {
1143
1014
  color: isDropdownVisible ? hoverColor : effectiveNovacThemeEnabled ? '#FFF' : '#1A1A1A'
1144
1015
  }), jsxRuntime.jsxs(ctDesignContainer.Container, __assign({
1145
- className: 'flex flex-row flex-middle'
1016
+ display: 'flex',
1017
+ flexDirection: 'row',
1018
+ alignItems: 'center'
1146
1019
  }, {
1147
1020
  children: [jsxRuntime.jsx(ctDesignTypography.Typography, __assign({
1148
1021
  variant: 'B2',
1149
- className: 'c-pointer',
1022
+ css: {
1023
+ cursor: 'pointer'
1024
+ },
1150
1025
  colorCode: isDropdownVisible ? hoverColor : effectiveNovacThemeEnabled ? '#FFF' : '#1A1A1A'
1151
1026
  }, {
1152
- children: MY_ACCOUNT_TEXT
1027
+ children: "My Account"
1153
1028
  })), jsxRuntime.jsx(ctDesignIcons.ChevronDown, {
1154
1029
  width: 20,
1155
1030
  height: 20,
@@ -1178,23 +1053,21 @@
1178
1053
  }));
1179
1054
  };
1180
1055
  var HeaderContent = function () {
1181
- var _a;
1182
- var _b = useHeaderContext(),
1183
- onLoginButtonClick = _b.onLoginButtonClick,
1184
- _c = _b.showAllLobs,
1185
- showAllLobs = _c === void 0 ? false : _c,
1186
- isUserLoggedIn = _b.isUserLoggedIn,
1187
- loyaltyType = _b.loyaltyType,
1188
- _d = _b.isNovacThemeEnabled,
1189
- isNovacThemeEnabled = _d === void 0 ? false : _d,
1190
- _e = _b.ravenPayload,
1191
- ravenPayload = _e === void 0 ? {} : _e,
1192
- ravenPushCallback = _b.ravenPushCallback,
1193
- ravenPageName = _b.ravenPageName,
1194
- ravenEventName = _b.ravenEventName;
1195
- var _f = react.useState(false),
1196
- scrolled = _f[0],
1197
- setScrolled = _f[1];
1056
+ var _a = useHeaderContext(),
1057
+ onLoginButtonClick = _a.onLoginButtonClick,
1058
+ _b = _a.showAllLobs,
1059
+ showAllLobs = _b === void 0 ? false : _b,
1060
+ isUserLoggedIn = _a.isUserLoggedIn;
1061
+ _a.loyaltyType;
1062
+ var _c = _a.isNovacThemeEnabled,
1063
+ isNovacThemeEnabled = _c === void 0 ? false : _c;
1064
+ _a.ravenPayload;
1065
+ _a.ravenPushCallback;
1066
+ _a.ravenPageName;
1067
+ _a.ravenEventName;
1068
+ var _e = react.useState(false),
1069
+ scrolled = _e[0],
1070
+ setScrolled = _e[1];
1198
1071
  react.useEffect(function () {
1199
1072
  var handleScroll = function () {
1200
1073
  setScrolled(window.scrollY >= 100);
@@ -1207,69 +1080,59 @@
1207
1080
  var effectiveNovacThemeEnabled = isNovacThemeEnabled && !scrolled;
1208
1081
  var headerBackground = effectiveNovacThemeEnabled ? 'transparent' : '#F7FAFF';
1209
1082
  var hoverColor = effectiveNovacThemeEnabled ? '#FFB8A5' : '#FF4F17';
1210
- var _g = useHoverDropdown({
1083
+ var _f = useHoverDropdown({
1211
1084
  openDelay: 0
1212
1085
  }),
1213
- isDropdownVisible = _g.isDropdownVisible,
1214
- hoveredElemIndex = _g.hoveredElemIndex,
1215
- handleOnMouseEnter = _g.handleOnMouseEnter,
1216
- handleOnMouseLeave = _g.handleOnMouseLeave,
1217
- handleDropdownMouseEnter = _g.handleDropdownMouseEnter,
1218
- handleDropdownMouseLeave = _g.handleDropdownMouseLeave;
1219
- var utmSource = (_a = getQueryParam('utm_source')) !== null && _a !== void 0 ? _a : 'organic';
1220
- var createPayload = react.useCallback(function (actionName, actionType) {
1221
- return {
1222
- action_name: actionName,
1223
- action_type: actionType,
1224
- u_utm_source: utmSource,
1225
- loyalty_type: ravenLoyaltyTypes(loyaltyType)
1226
- };
1227
- }, [utmSource, loyaltyType]);
1228
- var handleNavbarOptionsClick = react.useCallback(function (option) {
1229
- if (option.isClickable && option.link) {
1230
- var actionName = "".concat(option.text.toLowerCase().replace(/\s/g, ''), "_header_click");
1231
- var payload = createPayload(actionName, 'click');
1232
- ravenSDKTrigger(isUserLoggedIn, ravenEventName, payload, ravenPayload, ravenPushCallback, ravenPageName);
1233
- window.location.href = option.link;
1234
- }
1235
- }, [createPayload, isUserLoggedIn, ravenEventName, ravenPayload, ravenPushCallback, ravenPageName]);
1236
- var handleHomeClick = react.useCallback(function () {
1237
- var payload = createPayload('home_header_click', 'click');
1238
- ravenSDKTrigger(isUserLoggedIn, ravenEventName, payload, ravenPayload, ravenPushCallback, ravenPageName);
1239
- window.location.href = '/';
1240
- }, [createPayload, isUserLoggedIn, ravenEventName, ravenPayload, ravenPushCallback, ravenPageName]);
1241
- var triggerRavenEventOnHover = react.useCallback(function (option) {
1242
- var actionName = "".concat(option.text.toLowerCase().replace(/\s/g, ''), "_header_hover");
1243
- var payload = createPayload(actionName, 'hover');
1244
- ravenSDKTrigger(isUserLoggedIn, ravenEventName, payload, ravenPayload, ravenPushCallback, ravenPageName);
1245
- }, [createPayload, isUserLoggedIn, ravenEventName, ravenPayload, ravenPushCallback, ravenPageName]);
1086
+ isDropdownVisible = _f.isDropdownVisible,
1087
+ hoveredElemIndex = _f.hoveredElemIndex,
1088
+ handleOnMouseEnter = _f.handleOnMouseEnter,
1089
+ handleOnMouseLeave = _f.handleOnMouseLeave,
1090
+ handleDropdownMouseEnter = _f.handleDropdownMouseEnter,
1091
+ handleDropdownMouseLeave = _f.handleDropdownMouseLeave;
1246
1092
  return jsxRuntime.jsxs(jsxRuntime.Fragment, {
1247
1093
  children: [jsxRuntime.jsx(ctDesignContainer.Container, __assign({
1248
- className: 'flex t-0 p-sticky w-100p flex-middle flex-center flex-gap-6 flex-no-shrink',
1249
- style: {
1250
- zIndex: 1000,
1251
- height: 64,
1094
+ display: 'flex',
1095
+ top: 0,
1096
+ position: 'sticky',
1097
+ width: '100%',
1098
+ alignItems: 'center',
1099
+ justifyContent: 'center',
1100
+ zIndex: 1000,
1101
+ height: '64px',
1102
+ background: headerBackground,
1103
+ css: {
1104
+ gap: '24px',
1105
+ flexShrink: 0,
1252
1106
  borderBottom: effectiveNovacThemeEnabled ? '' : '1px solid #E6E6E6',
1253
- background: headerBackground,
1254
1107
  transition: 'background-color 0.3s ease-in-out, border-bottom 0.3s ease-in-out'
1255
1108
  }
1256
1109
  }, {
1257
1110
  children: jsxRuntime.jsxs(ctDesignContainer.Container, __assign({
1258
- className: 'flex flex-middle flex-between flex-gap-6',
1111
+ display: 'flex',
1112
+ alignItems: 'center',
1113
+ justifyContent: 'space-between',
1114
+ padding: '0 28px',
1115
+ flex: 1,
1259
1116
  style: {
1260
- maxWidth: 1440,
1261
- padding: '0px 28px',
1262
- flex: '1 0 0'
1117
+ gap: '24px',
1118
+ maxWidth: 1440
1263
1119
  }
1264
1120
  }, {
1265
1121
  children: [jsxRuntime.jsxs(ctDesignContainer.Container, __assign({
1266
- className: 'flex flex-row flex-center flex-middle c-pointer',
1267
- onClick: handleHomeClick
1122
+ display: 'flex',
1123
+ flexDirection: 'row',
1124
+ alignItems: 'center',
1125
+ justifyContent: 'center',
1126
+ cursor: 'pointer',
1127
+ paddingLeft: '16px',
1128
+ onClick: function () {
1129
+ window.location.href = '/';
1130
+ }
1268
1131
  }, {
1269
1132
  children: [jsxRuntime.jsx(ctDesignIcons.CTLogo, {
1270
1133
  fillColor: effectiveNovacThemeEnabled ? '#FFF' : '#FF4F17'
1271
1134
  }), jsxRuntime.jsx(ctDesignDivider.Divider, {
1272
- style: {
1135
+ css: {
1273
1136
  width: 12,
1274
1137
  marginLeft: 2,
1275
1138
  marginRight: 2,
@@ -1280,35 +1143,47 @@
1280
1143
  color: effectiveNovacThemeEnabled ? '#FFF' : '#1A1A1A'
1281
1144
  })]
1282
1145
  })), jsxRuntime.jsxs(ctDesignContainer.Container, __assign({
1283
- className: 'flex flex-row flex-middle flex-center flex-cg-6'
1146
+ display: 'flex',
1147
+ flexDirection: 'row',
1148
+ alignItems: 'center',
1149
+ justifyContent: 'center',
1150
+ columnGap: '24px'
1284
1151
  }, {
1285
1152
  children: [jsxRuntime.jsx(ctDesignContainer.Container, __assign({
1286
- className: 'flex flex-row flex-middle flex-center flex-cg-1'
1153
+ display: 'flex',
1154
+ flexDirection: 'row',
1155
+ alignItems: 'center',
1156
+ justifyContent: 'center',
1157
+ columnGap: '4px'
1287
1158
  }, {
1288
1159
  children: NAVBAR_OPTIONS.map(function (option, index) {
1289
1160
  var isHovered = hoveredElemIndex === index;
1290
1161
  return jsxRuntime.jsxs(ctDesignContainer.Container, {
1291
1162
  children: [jsxRuntime.jsxs(ctDesignContainer.Container, __assign({
1292
1163
  onMouseEnter: function () {
1293
- handleOnMouseEnter(index);
1294
- if (option.isHoverable) {
1295
- triggerRavenEventOnHover(option);
1296
- }
1164
+ return handleOnMouseEnter(index);
1297
1165
  },
1298
1166
  onMouseLeave: handleOnMouseLeave,
1299
- className: 'flex flex-row flex-middle px-3 py-2 c-pointer p-relative',
1300
- style: {
1301
- columnGap: 8,
1302
- height: 64
1303
- },
1167
+ display: 'flex',
1168
+ flexDirection: 'row',
1169
+ alignItems: 'center',
1170
+ padding: '8px 12px 8px 12px',
1171
+ cursor: 'pointer',
1172
+ position: 'relative',
1173
+ columnGap: 8,
1174
+ height: '64px',
1304
1175
  onClick: function () {
1305
- return handleNavbarOptionsClick(option);
1176
+ if (option.link && option.isClickable) {
1177
+ window.location.href = option.link;
1178
+ }
1306
1179
  }
1307
1180
  }, {
1308
1181
  children: [jsxRuntime.jsx(option.lefticon, {
1309
1182
  color: isHovered ? hoverColor : effectiveNovacThemeEnabled ? '#FFF' : '#1A1A1A'
1310
1183
  }), jsxRuntime.jsxs(ctDesignContainer.Container, __assign({
1311
- className: 'flex flex-row flex-middle'
1184
+ display: 'flex',
1185
+ flexDirection: 'row',
1186
+ alignItems: 'center'
1312
1187
  }, {
1313
1188
  children: [jsxRuntime.jsx(ctDesignTypography.Typography, __assign({
1314
1189
  variant: 'B2',
@@ -1344,7 +1219,9 @@
1344
1219
  }
1345
1220
  }), jsxRuntime.jsx(ctDesignContainer.Container, {
1346
1221
  children: isUserLoggedIn ? jsxRuntime.jsx(ctDesignContainer.Container, __assign({
1347
- className: 'flex flex-row flex-middle'
1222
+ display: 'flex',
1223
+ flexDirection: 'row',
1224
+ alignItems: 'center'
1348
1225
  }, {
1349
1226
  children: jsxRuntime.jsx(UserAccount, {})
1350
1227
  })) : jsxRuntime.jsx(ctDesignButton.Button, __assign({
@@ -1362,7 +1239,7 @@
1362
1239
  variant: 'L2',
1363
1240
  color: effectiveNovacThemeEnabled ? 'neutral' : 'primary'
1364
1241
  }, {
1365
- children: "Log in"
1242
+ children: "Login"
1366
1243
  }))
1367
1244
  }))
1368
1245
  })]