@sunrise-upc/mobile-prod-card 11.10.2-beta.0 → 11.10.2

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.
@@ -1 +1 @@
1
- .card_TBosU.sr-card_Eo691{border-radius:8px;box-shadow:0 2px 4px 0 rgba(87,84,82,.2);border:none;background-color:#fff;position:relative;display:flex;flex-direction:column}.card_TBosU.border-top_18q7h{border-top-left-radius:16px;border-top-right-radius:16px;box-shadow:0 -2px 20px 0 rgba(61,57,53,.2);border:none}@media (min-width:768px){.sr-desk-card_fmqWp{border-radius:8px;box-shadow:0 2px 4px 0 rgba(87,84,82,.2);border:none;background-color:#fff;position:relative;display:flex;flex-direction:column}}@media (max-width:767px){.sr-mob-card_cE7mi{border-radius:8px;box-shadow:0 2px 4px 0 rgba(87,84,82,.2);border:none;background-color:#fff;position:relative;display:flex;flex-direction:column}}@media (min-width:1024px){.sr-md-card_nwsBG{border-radius:8px;box-shadow:0 2px 4px 0 rgba(87,84,82,.2);border:none;background-color:#fff;position:relative;display:flex;flex-direction:column}}.container_c8st7{order:-1}.stickyStyleUp_39Ybs,.stickyStyle_JW7TL{position:fixed;z-index:8;width:100%}.stickyStyle_JW7TL{margin-top:-55px}@media (max-width:1023px){.stickyStyle_JW7TL{margin-top:auto}}.animations_wbW76,.wrapper_x0eeF{min-height:60px;overflow:hidden;display:flex;align-items:center;justify-content:center;gap:16px;padding:0 16px;position:relative}@media (max-width:767px){.animations_wbW76,.wrapper_x0eeF{min-height:76px;padding:8px 16px 8px 6px!important}}.animations_wbW76 .iconStyle_ftxQx,.wrapper_x0eeF .iconStyle_ftxQx{cursor:pointer;width:44px;height:44px;padding-left:14px;padding-top:8px;position:absolute;right:16px}.animations_wbW76 .textStyle_LyRjq,.wrapper_x0eeF .textStyle_LyRjq{font-size:18px;line-height:24px;font-weight:700;display:inline;color:#3d3935}@media (max-width:767px){.animations_wbW76 .textStyle_LyRjq,.wrapper_x0eeF .textStyle_LyRjq{font-size:14px;line-height:20px}}.animations_wbW76 .descriptionColorWhite_Y5SPq,.wrapper_x0eeF .descriptionColorWhite_Y5SPq{color:#fff}.animations_wbW76 .descriptionColorBlack_9AYnW,.wrapper_x0eeF .descriptionColorBlack_9AYnW{color:#000}.animations_wbW76 .btnStyleBlack_J3qnm,.animations_wbW76 .btnStyleIceWhite_dtMgV,.animations_wbW76 .btnStyle_oc2fd,.animations_wbW76 .btnanimations_-xgbH,.wrapper_x0eeF .btnStyleBlack_J3qnm,.wrapper_x0eeF .btnStyleIceWhite_dtMgV,.wrapper_x0eeF .btnStyle_oc2fd,.wrapper_x0eeF .btnanimations_-xgbH{min-width:fit-content;text-decoration:none;border-radius:25px;background-color:#da291c;color:#fff;font-size:16px;line-height:24px;font-weight:700;border:none;padding:10px 24px}.animations_wbW76 .btnStyleIceWhite_dtMgV,.wrapper_x0eeF .btnStyleIceWhite_dtMgV{background-color:transparent;color:#fff;border:2px solid #fff}.animations_wbW76 .btnStyleBlack_J3qnm,.wrapper_x0eeF .btnStyleBlack_J3qnm{background-color:#fff;color:#3d3935;border:none}@media (max-width:767px){.container_c8st7{order:-1}.stickyStyle_JW7TL{position:fixed;z-index:1;width:100%}}.close_gz0j1{display:none}.animations_wbW76{animation-name:anime_PLkrN;animation-duration:5s;animation-fill-mode:forwards;background-color:#da291c}.btnanimations_-xgbH{animation-name:btnAnime_amQr7;animation-duration:5s;animation-fill-mode:forwards}@keyframes btnAnime_amQr7{0%{background-color:#fff;color:#da291c}to{background-color:#da291c;color:#fff}}@keyframes anime_PLkrN{0%{background-color:#da291c;color:#fff}to{background-color:#f4d4dd;color:#000}}
1
+ .card_TBosU.sr-card_Eo691{border-radius:8px;box-shadow:0 2px 4px 0 rgba(87,84,82,.2);border:none;background-color:#fff;position:relative;display:flex;flex-direction:column}.card_TBosU.border-top_18q7h{border-top-left-radius:16px;border-top-right-radius:16px;box-shadow:0 -2px 20px 0 rgba(61,57,53,.2);border:none}@media (min-width:768px){.sr-desk-card_fmqWp{border-radius:8px;box-shadow:0 2px 4px 0 rgba(87,84,82,.2);border:none;background-color:#fff;position:relative;display:flex;flex-direction:column}}@media (max-width:767px){.sr-mob-card_cE7mi{border-radius:8px;box-shadow:0 2px 4px 0 rgba(87,84,82,.2);border:none;background-color:#fff;position:relative;display:flex;flex-direction:column}}@media (min-width:1024px){.sr-md-card_nwsBG{border-radius:8px;box-shadow:0 2px 4px 0 rgba(87,84,82,.2);border:none;background-color:#fff;position:relative;display:flex;flex-direction:column}}.container_c8st7{order:-1}.stickyStyleUp_39Ybs,.stickyStyle_JW7TL{position:fixed;z-index:8;width:100%}.stickyStyle_JW7TL{margin-top:-55px}@media (max-width:1023px){.stickyStyle_JW7TL{margin-top:auto}}.animations_wbW76,.wrapper_x0eeF{min-height:60px;overflow:hidden;display:flex;align-items:center;justify-content:center;gap:16px;padding:0 16px;position:relative}@media (max-width:767px){.animations_wbW76,.wrapper_x0eeF{min-height:76px;padding:8px 16px 8px 6px!important}}.animations_wbW76 .iconStyle_ftxQx,.wrapper_x0eeF .iconStyle_ftxQx{cursor:pointer;width:44px;height:44px;padding-left:14px;padding-top:8px;position:absolute;right:16px}@media (max-width:767px){.animations_wbW76 .iconStyle_ftxQx,.wrapper_x0eeF .iconStyle_ftxQx{position:static;right:unset}}.animations_wbW76 .textStyle_LyRjq,.wrapper_x0eeF .textStyle_LyRjq{font-size:18px;line-height:24px;font-weight:700;display:inline;color:#3d3935}@media (max-width:767px){.animations_wbW76 .textStyle_LyRjq,.wrapper_x0eeF .textStyle_LyRjq{font-size:14px;line-height:20px}}.animations_wbW76 .descriptionColorWhite_Y5SPq,.wrapper_x0eeF .descriptionColorWhite_Y5SPq{color:#fff}.animations_wbW76 .descriptionColorBlack_9AYnW,.wrapper_x0eeF .descriptionColorBlack_9AYnW{color:#000}.animations_wbW76 .btnStyleBlack_J3qnm,.animations_wbW76 .btnStyleIceWhite_dtMgV,.animations_wbW76 .btnStyle_oc2fd,.animations_wbW76 .btnanimations_-xgbH,.wrapper_x0eeF .btnStyleBlack_J3qnm,.wrapper_x0eeF .btnStyleIceWhite_dtMgV,.wrapper_x0eeF .btnStyle_oc2fd,.wrapper_x0eeF .btnanimations_-xgbH{min-width:fit-content;text-decoration:none;border-radius:25px;background-color:#da291c;color:#fff;font-size:16px;line-height:24px;font-weight:700;border:none;padding:10px 24px}.animations_wbW76 .btnStyleIceWhite_dtMgV,.wrapper_x0eeF .btnStyleIceWhite_dtMgV{background-color:transparent;color:#fff;border:2px solid #fff}.animations_wbW76 .btnStyleBlack_J3qnm,.wrapper_x0eeF .btnStyleBlack_J3qnm{background-color:#fff;color:#3d3935;border:none}@media (max-width:767px){.container_c8st7{order:-1}.stickyStyle_JW7TL{position:fixed;z-index:1;width:100%}}.close_gz0j1{display:none}.animations_wbW76{animation-name:anime_PLkrN;animation-duration:5s;animation-fill-mode:forwards;background-color:#da291c}.btnanimations_-xgbH{animation-name:btnAnime_amQr7;animation-duration:5s;animation-fill-mode:forwards}@keyframes btnAnime_amQr7{0%{background-color:#fff;color:#da291c}to{background-color:#da291c;color:#fff}}@keyframes anime_PLkrN{0%{background-color:#da291c;color:#fff}to{background-color:#f4d4dd;color:#000}}
@@ -1,2 +1,2 @@
1
- import o from"./HeroLogin.module.scss.js";import l,{useState as e,useEffect as n}from"react";import i from"../richtext.js";import{HEROBANNER as t,TYPE as s}from"../../Analytics/AnalyticsConstants.js";import{trackEvent as r}from"../../utils/AnalyticsUtils.js";import c from"js-cookie";import{LoginBasicPropConfig as a}from"../../services/LoginBasicPropConfig.js";import d from"../login/LoginModalV2.js";import{NONE as u}from"../../utils/constants.js";const v=({content:v,metadata:m,loginSuccess:g,setLoginSuccess:b,basicConfigUrl:p,isProdEnv:k})=>{var S,f,y,w,E,C,L,B,h;const[$,j]=e(!1),[I,N]=e(!1),[A,x]=e(!1),[U,G]=e(!1),[P,R]=e(0);a.create({baseURL:null!=p?p:""});let W=void 0!==typeof window&&c.get("sunriseAuth");W=W&&JSON.parse(W);const Y=()=>{window.scrollY>0?x(!0):x(!1),window.scrollY>P?G(!0):G(!1),R(window.scrollY)};n(()=>{sessionStorage.getItem("hideBanner")&&N(!I)},[]),n(()=>(window.addEventListener("scroll",Y),()=>{window.removeEventListener("scroll",Y)}),[Y]);const F=t+"|"+(null===(f=null===(S=null==v?void 0:v.description)||void 0===S?void 0:S.content)||void 0===f?void 0:f.map(o=>{var l,e;return null===(e=null===(l=null==o?void 0:o.content)||void 0===l?void 0:l[0])||void 0===e?void 0:e.text})),H=()=>{r(F,null==v?void 0:v.buttonLabel,s),j(!$)},J=null==v?void 0:v.disableAnimations,M=!!(null==v?void 0:v.gradientBackgroundGlobal)&&(null==v?void 0:v.gradientBackgroundGlobal)!==u?{background:v.gradientBackgroundGlobal}:J&&(null===(y=null==v?void 0:v.backgroundColor)||void 0===y?void 0:y.color)?{backgroundColor:v.backgroundColor.color}:void 0,O={sunriseRed:`${o.btnStyle} ${J?"":o.btnanimations}`,iceWhite:o.btnStyleIceWhite,lightBlack:o.btnStyleBlack},V=(null!==(w=O[null==v?void 0:v.buttonStyles])&&void 0!==w?w:O.sunriseRed).trim(),_=null!==(E={white:o.descriptionColorWhite,black:o.descriptionColorBlack}[null==v?void 0:v.descriptionColor])&&void 0!==E?E:o.descriptionColorBlack;return l.createElement(l.Fragment,null,!(null==W?void 0:W.siteId)&&!g&&l.createElement(l.Fragment,null,l.createElement("div",{className:(()=>{if(null==v?void 0:v.isSticky)return A?U?`${o.stickyStyle} `:`${o.stickyStyleUp}`:`${o.container}`})()},l.createElement("div",{className:`${I?o.close:o.wrapper} ${J?"":o.animations}`.trim(),style:M},(null==v?void 0:v.closeIcon)&&l.createElement("div",{className:o.iconStyle,onClick:()=>{N(!I),null===sessionStorage||void 0===sessionStorage||sessionStorage.setItem("hideBanner","true")}},l.createElement("img",{src:null!==(L=null===(C=null==v?void 0:v.closeIconConfig)||void 0===C?void 0:C.filename)&&void 0!==L?L:"/ecom-int/icons/close_banner.svg",alt:"close"})),(null==v?void 0:v.description)&&l.createElement("div",{className:`${o.textStyle} ${_}`},l.createElement(i,{content:null==v?void 0:v.description})),(null==v?void 0:v.buttonLabel)&&l.createElement("button",{className:V,onClick:H},null==v?void 0:v.buttonLabel))),$&&(null===(B=null==v?void 0:v.login)||void 0===B?void 0:B[0])&&l.createElement(d,{content:null===(h=null==v?void 0:v.login)||void 0===h?void 0:h[0],closeLogin:H,metadata:m,onSuccess:()=>{b(),j(!1)},isProdEnv:k})))};export{v as default};
1
+ import o from"./HeroLogin.module.scss.js";import e,{useState as l,useEffect as n}from"react";import i from"../richtext.js";import{HEROBANNER as t,TYPE as s}from"../../Analytics/AnalyticsConstants.js";import{trackEvent as r}from"../../utils/AnalyticsUtils.js";import c from"js-cookie";import{LoginBasicPropConfig as d}from"../../services/LoginBasicPropConfig.js";import a from"../login/LoginModalV2.js";const u=({content:u,metadata:v,loginSuccess:m,setLoginSuccess:g,basicConfigUrl:p,isProdEnv:b})=>{var S,k,y,f,w,E,C,L,h;const[B,$]=l(!1),[j,I]=l(!1),[N,A]=l(!1),[x,U]=l(!1),[P,R]=l(0);d.create({baseURL:null!=p?p:""});let W=void 0!==typeof window&&c.get("sunriseAuth");W=W&&JSON.parse(W);const Y=()=>{window.scrollY>0?A(!0):A(!1),window.scrollY>P?U(!0):U(!1),R(window.scrollY)};n(()=>{sessionStorage.getItem("hideBanner")&&I(!j)},[]),n(()=>(window.addEventListener("scroll",Y),()=>{window.removeEventListener("scroll",Y)}),[Y]);const F=t+"|"+(null===(k=null===(S=null==u?void 0:u.description)||void 0===S?void 0:S.content)||void 0===k?void 0:k.map(o=>{var e,l;return null===(l=null===(e=null==o?void 0:o.content)||void 0===e?void 0:e[0])||void 0===l?void 0:l.text})),G=()=>{r(F,null==u?void 0:u.buttonLabel,s),$(!B)},H=null==u?void 0:u.disableAnimations,J=!!(null==u?void 0:u.gradientBackgroundGlobal)?{background:null==u?void 0:u.gradientBackgroundGlobal}:H?{backgroundColor:null===(y=null==u?void 0:u.backgroundColor)||void 0===y?void 0:y.color}:void 0,M={sunriseRed:`${o.btnStyle} ${H?"":o.btnanimations}`,iceWhite:o.btnStyleIceWhite,lightBlack:o.btnStyleBlack},O=(null!==(f=M[null==u?void 0:u.buttonStyles])&&void 0!==f?f:M.sunriseRed).trim(),V=null!==(w={white:o.descriptionColorWhite,black:o.descriptionColorBlack}[null==u?void 0:u.descriptionColor])&&void 0!==w?w:o.descriptionColorBlack;return e.createElement(e.Fragment,null,!(null==W?void 0:W.siteId)&&!m&&e.createElement(e.Fragment,null,e.createElement("div",{className:(()=>{if(null==u?void 0:u.isSticky)return N?x?`${o.stickyStyle} `:`${o.stickyStyleUp}`:`${o.container}`})()},e.createElement("div",{className:`${j?o.close:o.wrapper} ${H?"":o.animations}`.trim(),style:J},(null==u?void 0:u.closeIcon)&&e.createElement("div",{className:o.iconStyle,onClick:()=>{I(!j),null===sessionStorage||void 0===sessionStorage||sessionStorage.setItem("hideBanner","true")}},e.createElement("img",{src:null!==(C=null===(E=null==u?void 0:u.closeIconConfig)||void 0===E?void 0:E.filename)&&void 0!==C?C:"/ecom-int/icons/close_banner.svg",alt:"close"})),(null==u?void 0:u.description)&&e.createElement("div",{className:`${o.textStyle} ${V}`},e.createElement(i,{content:null==u?void 0:u.description})),(null==u?void 0:u.buttonLabel)&&e.createElement("button",{className:O,onClick:G},null==u?void 0:u.buttonLabel))),B&&(null===(L=null==u?void 0:u.login)||void 0===L?void 0:L[0])&&e.createElement(a,{content:null===(h=null==u?void 0:u.login)||void 0===h?void 0:h[0],closeLogin:G,metadata:v,onSuccess:()=>{g(),$(!1)},isProdEnv:b})))};export{u as default};
2
2
  //# sourceMappingURL=HeroLogin.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"HeroLogin.js","sources":["../../../../src/components/HeroLogin/HeroLogin.tsx"],"sourcesContent":["/* eslint-disable max-lines-per-function */\r\nimport Styles from './HeroLogin.module.scss';\r\nimport React, { FC, JSX, useEffect, useState } from 'react';\r\nimport RichText from '../richtext';\r\nimport { HEROBANNER, TYPE } from '../../Analytics/AnalyticsConstants';\r\nimport { trackEvent } from '../../utils/AnalyticsUtils';\r\nimport Cookies from 'js-cookie';\r\nimport { LoginBasicPropConfig } from '../../services/LoginBasicPropConfig';\r\nimport LoginModalV2 from '../login/LoginModalV2';\r\nimport { NONE } from '../../utils/constants';\r\n\r\nconst HeroLoginBanner: FC<any> = ({\r\n content,\r\n metadata,\r\n loginSuccess,\r\n setLoginSuccess,\r\n basicConfigUrl,\r\n isProdEnv,\r\n}): JSX.Element => {\r\n const [showLogin, setShowLogin] = useState<boolean>(false);\r\n const [close, setclose] = useState<boolean>(false);\r\n const [isLoginSticky, setIsLoginSticky] = useState<boolean>(false);\r\n const [scrollDir, setScrollDir] = useState<boolean>(false);\r\n const [scrollVal, setScrollVal] = useState<number>(0);\r\n\r\n LoginBasicPropConfig.create({ baseURL: basicConfigUrl ?? '' });\r\n let AuthData: any = typeof window !== undefined && Cookies.get('sunriseAuth');\r\n AuthData = AuthData && JSON.parse(AuthData);\r\n\r\n\r\n const handleScroll = () => {\r\n if (window.scrollY > 0) {\r\n setIsLoginSticky(true);\r\n } else {\r\n setIsLoginSticky(false);\r\n }\r\n if (window.scrollY > scrollVal) {\r\n setScrollDir(true);\r\n } else {\r\n setScrollDir(false);\r\n }\r\n setScrollVal(window.scrollY);\r\n };\r\n\r\n useEffect(() => {\r\n const session = sessionStorage.getItem('hideBanner');\r\n session && setclose(!close);\r\n }, []);\r\n\r\n useEffect(() => {\r\n window.addEventListener('scroll', handleScroll);\r\n return () => {\r\n window.removeEventListener('scroll', handleScroll);\r\n };\r\n }, [handleScroll]);\r\n\r\n const description =\r\n HEROBANNER +\r\n '|' +\r\n content?.description?.content?.map((item: any) => {\r\n return item?.content?.[0]?.text;\r\n });\r\n\r\n const handleClick = () => {\r\n setclose(!close);\r\n sessionStorage?.setItem('hideBanner', 'true');\r\n };\r\n\r\n const toggleShowLogin = () => {\r\n trackEvent(description, content?.buttonLabel, TYPE);\r\n setShowLogin(!showLogin);\r\n };\r\n\r\n const loginStyle = (): any => {\r\n if (content?.isSticky) {\r\n if (isLoginSticky) {\r\n return !scrollDir ? `${Styles.stickyStyleUp}` : `${Styles.stickyStyle} `;\r\n } else {\r\n return `${Styles.container}`;\r\n }\r\n }\r\n };\r\n\r\n const onLoginSuccess = () => {\r\n setLoginSuccess();\r\n setShowLogin(false);\r\n };\r\n\r\n const disableAnimation=content?.disableAnimations;\r\n const hasGlobalGradient =\r\n !!content?.gradientBackgroundGlobal && content?.gradientBackgroundGlobal !== NONE;\r\n const backgroundInlineStyle = hasGlobalGradient\r\n ? { background: content.gradientBackgroundGlobal }\r\n : disableAnimation && content?.backgroundColor?.color\r\n ? { backgroundColor: content.backgroundColor.color }\r\n : undefined;\r\n\r\n const buttonStyleMap: Record<string, string> = {\r\n sunriseRed: `${Styles.btnStyle} ${!disableAnimation ? Styles.btnanimations : ''}`,\r\n iceWhite: Styles.btnStyleIceWhite,\r\n lightBlack: Styles.btnStyleBlack,\r\n };\r\n const resolvedButtonClass = (buttonStyleMap[content?.buttonStyles] ?? buttonStyleMap.sunriseRed).trim();\r\n\r\n const descriptionColorMap: Record<string, string> = {\r\n white: Styles.descriptionColorWhite,\r\n black: Styles.descriptionColorBlack,\r\n };\r\n const resolvedDescriptionColor = descriptionColorMap[content?.descriptionColor] ?? Styles.descriptionColorBlack;\r\n\r\n return (\r\n <>\r\n {!AuthData?.siteId && !loginSuccess && (\r\n <>\r\n <div className={loginStyle()}>\r\n <div\r\n className={`${!close ? Styles.wrapper : Styles.close} ${!disableAnimation ? Styles.animations : ''}`.trim()}\r\n style={backgroundInlineStyle}\r\n >\r\n {content?.closeIcon && (\r\n <div className={Styles.iconStyle} onClick={handleClick}>\r\n <img\r\n src={content?.closeIconConfig?.filename ?? '/ecom-int/icons/close_banner.svg'}\r\n alt='close'\r\n />\r\n </div>\r\n )}\r\n {content?.description && (\r\n <div className={`${Styles.textStyle} ${resolvedDescriptionColor}`}>\r\n <RichText content={content?.description} />\r\n </div>\r\n )}\r\n {content?.buttonLabel && (\r\n <button className={resolvedButtonClass} onClick={toggleShowLogin}>\r\n {content?.buttonLabel}\r\n </button>\r\n )}\r\n </div>\r\n </div>\r\n {showLogin && content?.login?.[0] && (\r\n <LoginModalV2\r\n content={content?.login?.[0]}\r\n closeLogin={toggleShowLogin}\r\n metadata={metadata}\r\n onSuccess={onLoginSuccess}\r\n isProdEnv={isProdEnv}\r\n />\r\n )}\r\n </>\r\n )}\r\n </>\r\n );\r\n};\r\n\r\nexport default HeroLoginBanner;\r\n"],"names":["HeroLoginBanner","content","metadata","loginSuccess","setLoginSuccess","basicConfigUrl","isProdEnv","showLogin","setShowLogin","useState","close","setclose","isLoginSticky","setIsLoginSticky","scrollDir","setScrollDir","scrollVal","setScrollVal","LoginBasicPropConfig","create","baseURL","AuthData","undefined","window","Cookies","get","JSON","parse","handleScroll","scrollY","useEffect","sessionStorage","getItem","addEventListener","removeEventListener","description","HEROBANNER","_b","_a","map","item","text","toggleShowLogin","trackEvent","buttonLabel","TYPE","disableAnimation","disableAnimations","backgroundInlineStyle","gradientBackgroundGlobal","NONE","background","_c","backgroundColor","color","buttonStyleMap","sunriseRed","Styles","btnStyle","btnanimations","iceWhite","btnStyleIceWhite","lightBlack","btnStyleBlack","resolvedButtonClass","_d","buttonStyles","trim","resolvedDescriptionColor","_e","white","descriptionColorWhite","black","descriptionColorBlack","descriptionColor","React","createElement","Fragment","siteId","className","isSticky","stickyStyle","stickyStyleUp","container","loginStyle","wrapper","animations","style","closeIcon","iconStyle","onClick","setItem","src","_g","_f","closeIconConfig","filename","alt","textStyle","RichText","_h","login","LoginModalV2","_j","closeLogin","onSuccess"],"mappings":"kcAWA,MAAMA,EAA2B,EAC/BC,UACAC,WACAC,eACAC,kBACAC,iBACAC,sCAEA,MAAOC,EAAWC,GAAgBC,GAAkB,IAC7CC,EAAOC,GAAYF,GAAkB,IACrCG,EAAeC,GAAoBJ,GAAkB,IACrDK,E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eAAAA,EAASoG,aAAK,IAAAD,OAAA,EAAAA,EAAG,KAC7BzB,EAAAC,cAAC0B,EAAY,CACXrG,QAAuB,QAAdsG,EAAAtG,aAAO,EAAPA,EAASoG,aAAK,IAAAE,OAAA,EAAAA,EAAG,GAC1BC,WAAY9D,EACZxC,SAAUA,EACVuG,UA7DW,KACrBrG,IACAI,GAAa,IA4DHF,UAAWA"}
1
+ {"version":3,"file":"HeroLogin.js","sources":["../../../../src/components/HeroLogin/HeroLogin.tsx"],"sourcesContent":["/* eslint-disable max-lines-per-function */\r\nimport Styles from './HeroLogin.module.scss';\r\nimport React, { FC, JSX, useEffect, useState } from 'react';\r\nimport RichText from '../richtext';\r\nimport { HEROBANNER, TYPE } from '../../Analytics/AnalyticsConstants';\r\nimport { trackEvent } from '../../utils/AnalyticsUtils';\r\nimport Cookies from 'js-cookie';\r\nimport { LoginBasicPropConfig } from '../../services/LoginBasicPropConfig';\r\nimport LoginModalV2 from '../login/LoginModalV2';\r\n\r\nconst HeroLoginBanner: FC<any> = ({\r\n content,\r\n metadata,\r\n loginSuccess,\r\n setLoginSuccess,\r\n basicConfigUrl,\r\n isProdEnv,\r\n}): JSX.Element => {\r\n const [showLogin, setShowLogin] = useState<boolean>(false);\r\n const [close, setclose] = useState<boolean>(false);\r\n const [isLoginSticky, setIsLoginSticky] = useState<boolean>(false);\r\n const [scrollDir, setScrollDir] = useState<boolean>(false);\r\n const [scrollVal, setScrollVal] = useState<number>(0);\r\n\r\n LoginBasicPropConfig.create({ baseURL: basicConfigUrl ?? '' });\r\n let AuthData: any = typeof window !== undefined && Cookies.get('sunriseAuth');\r\n AuthData = AuthData && JSON.parse(AuthData);\r\n\r\n\r\n const handleScroll = () => {\r\n if (window.scrollY > 0) {\r\n setIsLoginSticky(true);\r\n } else {\r\n setIsLoginSticky(false);\r\n }\r\n if (window.scrollY > scrollVal) {\r\n setScrollDir(true);\r\n } else {\r\n setScrollDir(false);\r\n }\r\n setScrollVal(window.scrollY);\r\n };\r\n\r\n useEffect(() => {\r\n const session = sessionStorage.getItem('hideBanner');\r\n session && setclose(!close);\r\n }, []);\r\n\r\n useEffect(() => {\r\n window.addEventListener('scroll', handleScroll);\r\n return () => {\r\n window.removeEventListener('scroll', handleScroll);\r\n };\r\n }, [handleScroll]);\r\n\r\n const description =\r\n HEROBANNER +\r\n '|' +\r\n content?.description?.content?.map((item: any) => {\r\n return item?.content?.[0]?.text;\r\n });\r\n\r\n const handleClick = () => {\r\n setclose(!close);\r\n sessionStorage?.setItem('hideBanner', 'true');\r\n };\r\n\r\n const toggleShowLogin = () => {\r\n trackEvent(description, content?.buttonLabel, TYPE);\r\n setShowLogin(!showLogin);\r\n };\r\n\r\n const loginStyle = (): any => {\r\n if (content?.isSticky) {\r\n if (isLoginSticky) {\r\n return !scrollDir ? `${Styles.stickyStyleUp}` : `${Styles.stickyStyle} `;\r\n } else {\r\n return `${Styles.container}`;\r\n }\r\n }\r\n };\r\n\r\n const onLoginSuccess = () => {\r\n setLoginSuccess();\r\n setShowLogin(false);\r\n };\r\n\r\n const disableAnimation=content?.disableAnimations;\r\n const hasGlobalGradient = !!content?.gradientBackgroundGlobal;\r\n const backgroundInlineStyle = hasGlobalGradient\r\n ? { background: content?.gradientBackgroundGlobal }\r\n : disableAnimation\r\n ? { backgroundColor: content?.backgroundColor?.color }\r\n : undefined;\r\n\r\n const buttonStyleMap: Record<string, string> = {\r\n sunriseRed: `${Styles.btnStyle} ${!disableAnimation ? Styles.btnanimations : ''}`,\r\n iceWhite: Styles.btnStyleIceWhite,\r\n lightBlack: Styles.btnStyleBlack,\r\n };\r\n const resolvedButtonClass = (buttonStyleMap[content?.buttonStyles] ?? buttonStyleMap.sunriseRed).trim();\r\n\r\n const descriptionColorMap: Record<string, string> = {\r\n white: Styles.descriptionColorWhite,\r\n black: Styles.descriptionColorBlack,\r\n };\r\n const resolvedDescriptionColor = descriptionColorMap[content?.descriptionColor] ?? Styles.descriptionColorBlack;\r\n\r\n return (\r\n <>\r\n {!AuthData?.siteId && !loginSuccess && (\r\n <>\r\n <div className={loginStyle()}>\r\n <div\r\n className={`${!close ? Styles.wrapper : Styles.close} ${!disableAnimation ? Styles.animations : ''}`.trim()}\r\n style={backgroundInlineStyle}\r\n >\r\n {content?.closeIcon && (\r\n <div className={Styles.iconStyle} onClick={handleClick}>\r\n <img\r\n src={content?.closeIconConfig?.filename ?? '/ecom-int/icons/close_banner.svg'}\r\n alt='close'\r\n />\r\n </div>\r\n )}\r\n {content?.description && (\r\n <div className={`${Styles.textStyle} ${resolvedDescriptionColor}`}>\r\n <RichText content={content?.description} />\r\n </div>\r\n )}\r\n {content?.buttonLabel && (\r\n <button className={resolvedButtonClass} onClick={toggleShowLogin}>\r\n {content?.buttonLabel}\r\n </button>\r\n )}\r\n </div>\r\n </div>\r\n {showLogin && content?.login?.[0] && (\r\n <LoginModalV2\r\n content={content?.login?.[0]}\r\n closeLogin={toggleShowLogin}\r\n metadata={metadata}\r\n onSuccess={onLoginSuccess}\r\n isProdEnv={isProdEnv}\r\n />\r\n )}\r\n </>\r\n )}\r\n </>\r\n );\r\n};\r\n\r\nexport default HeroLoginBanner;\r\n"],"names":["HeroLoginBanner","content","metadata","loginSuccess","setLoginSuccess","basicConfigUrl","isProdEnv","showLogin","setShowLogin","useState","close","setclose","isLoginSticky","setIsLoginSticky","scrollDir","setScrollDir","scrollVal","setScrollVal","LoginBasicPropConfig","create","baseURL","AuthData","undefined","window","Cookies","get","JSON","parse","handleScroll","scrollY","useEffect","sessionStorage","getItem","addEventListener","removeEventListener","description","HEROBANNER","_b","_a","map","item","text","toggleShowLogin","trackEvent","buttonLabel","TYPE","disableAnimation","disableAnimations","backgroundInlineStyle","gradientBackgroundGlobal","background","backgroundColor","_c","color","buttonStyleMap","sunriseRed","Styles","btnStyle","btnanimations","iceWhite","btnStyleIceWhite","lightBlack","btnStyleBlack","resolvedButtonClass","_d","buttonStyles","trim","resolvedDescriptionColor","_e","white","descriptionColorWhite","black","descriptionColorBlack","descriptionColor","React","createElement","Fragment","siteId","className","isSticky","stickyStyle","stickyStyleUp","container","loginStyle","wrapper","animations","style","closeIcon","iconStyle","onClick","setItem","src","_g","_f","closeIconConfig","filename","alt","textStyle","RichText","_h","login","LoginModalV2","_j","closeLogin","onSuccess"],"mappings":"kZAUA,MAAMA,EAA2B,EAC/BC,UACAC,WACAC,eACAC,kBACAC,iBACAC,sCAEA,MAAOC,EAAWC,GAAgBC,GAAkB,IAC7CC,EAAOC,GAAYF,GAAkB,IACrCG,EAAeC,GAAoBJ,GAAkB,IACrDK,EAAWC,GAAgBN,GAAkB,IAC7CO,EAAWC,GAAgBR,EAAiB,GAEnDS,EAAqBC,OAAO,CAAEC,QAASf,QAAAA,EAAkB,KACzD,IAAIgB,OAAkCC,WAAXC,QAAwBC,EAAQC,IAAI,eAC/DJ,EAAWA,GAAYK,KAAKC,MAAMN,GAGlC,MAAMO,EAAe,KACfL,OAAOM,QAAU,EACnBhB,GAAiB,GAEjBA,GAAiB,GAEfU,OAAOM,QAAUb,EACnBD,GAAa,GAEbA,GAAa,GAEfE,EAAaM,OAAOM,UAGtBC,EAAU,KACQC,eAAeC,QAAQ,eAC5BrB,GAAUD,IACpB,IAEHoB,EAAU,KACRP,OAAOU,iBAAiB,SAAUL,GAC3B,KACLL,OAAOW,oBAAoB,SAAUN,KAEtC,CAACA,IAEJ,MAAMO,EACJC,EACA,aACAC,EAAoB,UAApBpC,aAAO,EAAPA,EAASkC,mBAAW,IAAAG,OAAA,EAAAA,EAAErC,8BAASsC,IAAKC,YAClC,OAAyB,QAAlBH,EAAa,QAAbC,EAAAE,aAAI,EAAJA,EAAMvC,eAAO,IAAAqC,OAAA,EAAAA,EAAG,UAAE,IAAAD,OAAA,EAAAA,EAAEI,QAQzBC,EAAkB,KACtBC,EAAWR,EAAalC,aAAO,EAAPA,EAAS2C,YAAaC,GAC9CrC,GAAcD,IAkBVuC,EAAiB7C,aAAO,EAAPA,EAAS8C,kBAE1BC,KADsB/C,aAAO,EAAPA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RuC,EAAAC,cAAA,MAAA,CAAKG,UAAW,GAAGtB,EAAOyC,aAAa9B,KACrCO,EAAAC,cAACuB,EAAQ,CAACjG,QAASA,aAAO,EAAPA,EAASkC,gBAG/BlC,aAAO,EAAPA,EAAS2C,cACR8B,EAAAC,cAAA,SAAA,CAAQG,UAAWf,EAAqB0B,QAAS/C,GAC9CzC,aAAO,EAAPA,EAAS2C,eAKjBrC,IAA2B,QAAd4F,EAAAlG,eAAAA,EAASmG,aAAK,IAAAD,OAAA,EAAAA,EAAG,KAC7BzB,EAAAC,cAAC0B,EAAY,CACXpG,QAAuB,QAAdqG,EAAArG,aAAO,EAAPA,EAASmG,aAAK,IAAAE,OAAA,EAAAA,EAAG,GAC1BC,WAAY7D,EACZxC,SAAUA,EACVsG,UA5DW,KACrBpG,IACAI,GAAa,IA2DHF,UAAWA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sunrise-upc/mobile-prod-card",
3
- "version": "11.10.2-beta.0",
3
+ "version": "11.10.2",
4
4
  "description": "Starter project to create reusable functional component",
5
5
  "type": "module",
6
6
  "main": "dist/esm/index.js",