@everlywell/consumer-ui 1.28.0 → 1.28.1
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.
package/index.js
CHANGED
|
@@ -29,4 +29,4 @@ Check the top-level render call using <`+l+">.")}return n}}function Ge(e,n){{if(
|
|
|
29
29
|
<%s {...props} />
|
|
30
30
|
React keys must be passed directly to JSX without using spread:
|
|
31
31
|
let props = %s;
|
|
32
|
-
<%s key={someKey} {...props} />`,Ie,Z,St,Z),qe[Z+Ie]=!0}}return e===f?wt(T):Ct(T),T}}function jt(e,n,l){return Ke(e,n,l,!0)}function yt(e,n,l){return Ke(e,n,l,!1)}var Et=yt,Rt=jt;de.Fragment=f,de.jsx=Et,de.jsxs=Rt}()),de}process.env.NODE_ENV==="production"?Ae.exports=kt():Ae.exports=Tt();var t=Ae.exports;const Be=60,et=6,Lt=i=>{const{activeStepIndex:o,hideIndicators:x=!1,steps:f,stepperTheme:j={light:"eggplant.light",base:"eggplant.base"}}=i,{activeStep:g,setActiveStep:C}=r.useSteps({index:o,count:f.length});return y.useEffect(()=>{C(o)},[o,C]),t.jsx(r.Box,{position:"relative",width:"100%","data-testid":"stepper",children:t.jsx(r.Stepper,{role:"progressbar",index:g,width:"100%",display:"flex",flexWrap:"nowrap",children:f.map((R,s)=>{const m=g===s,u=s===0,h=s===f.length-1,E=g>s;let d=`${Be}px`;const D=`calc(100% - ((${Be*(f.length-1)}px) - (${f.length-1} * ${et*2}px)))`;return m?d=D:(u||h)&&(d=`${Be-et}px`),t.jsx(r.Box,{width:d,opacity:E||m?1:.2,paddingRight:h?"0":"6px",paddingLeft:u?"0":"6px",transition:"width 0.4s ease-in-out, opacity 0.4s ease-in-out",children:t.jsx(r.Box,{paddingTop:x?2:5,position:"relative",width:"100%",children:t.jsx(r.Box,{width:"100%",position:"absolute",top:"0",backgroundColor:E?j.light:j.base,height:x?"4px":"8px",borderRadius:"4",left:"0"})})},`step-${s}`)})})})},Ot=y.memo(Lt),Dt=({children:i,...o})=>t.jsx(ne.Text,{color:"tints.uiGrey",fontSize:["md",null,null,"lg"],...o,children:i}),$e=(i,o)=>{const x=(i==null?void 0:i.startsWith("http"))||(i==null?void 0:i.startsWith("mailto"));return o&&!x?{to:i}:{href:i}},Re=y.forwardRef((i,o)=>{const{label:x,additionalContent:f,mainTextFontSize:j,linkComponent:g,href:C,...R}=i,s=g||r.Link,m=$e(C,!!g);return t.jsxs(r.Box,{ref:o,as:s,display:"flex",alignItems:"center",gap:[null,null,null,1],justifyContent:[null,null,null,"space-between"],paddingY:[3,null,null,0],color:"tints.black",_hover:{color:"viridian.base",textDecoration:"none"},borderBottom:["1px",null,null,"unset"],borderColor:["tints.cream",null,null,"unset"],width:["100%",null,null,"fit-content"],cursor:"pointer",...m,...R,children:[t.jsx(r.Icon,{display:["none",null,null,"block"],as:W.CaretRight,fontSize:"lg",color:"viridian.light",role:"img","aria-label":"Caret right icon",weight:"bold"}),t.jsxs(r.Flex,{alignItems:"center",gap:"1",width:["100%",null,null,"auto"],children:[t.jsx(r.Text,{fontSize:[j||"xl",null,null,"lg"],fontWeight:"medium",children:x}),f&&(typeof f=="string"?t.jsx(r.Text,{fontSize:["xl",null,null,"lg"],fontWeight:"medium",color:"tints.uiGrey",sx:{"a:hover &":{color:"viridian.base"}},children:f}):f),t.jsx(r.Icon,{display:["block",null,null,"none"],as:W.CaretRight,fontSize:"2xl",color:"tints.uiGrey",role:"img","aria-label":"Caret right icon",marginLeft:"auto"})]})]})}),fe=y.forwardRef((i,o)=>{const{children:x,isSelected:f,...j}=i,g=i.backgroundColor||(f?"tints.lightCream":"transparent");return t.jsx(r.Button,{ref:o,borderRadius:"full",backgroundColor:g,fontSize:"lg !important",fontWeight:"normal",color:"tints.black",_before:{content:'""',position:"absolute",top:[null,null,null,-6],right:[null,null,null,-2],bottom:[null,null,null,-6],left:[null,null,null,-2]},_hover:{backgroundColor:g,textDecoration:"none",filter:"brightness(0.95)"},...j,children:x})}),rt=({title:i,description:o,imageSrc:x,imageElement:f,button:j,backgroundColor:g="viridian.wash",onClick:C,href:R,linkComponent:s})=>{const m="80px",u="200px",h="272px",E=s||r.Link,d=$e(R,!!s);return t.jsxs(r.Flex,{direction:["row",null,null,"column"],alignItems:["center"],borderRadius:"xl",overflow:"hidden",height:[m,null,null,h],backgroundColor:g,onClick:C,"data-testid":"spotlight-card",position:"relative",transition:"box-shadow 0.2s ease-in-out",border:"1px solid",borderColor:"transparent",_hover:{boxShadow:"lg",cursor:"pointer",textDecoration:"none",border:"1px solid",borderColor:"tints.white"},as:E,...d,children:[t.jsx(r.Box,{width:["72px",null,null,"100%"],height:["100%"],flex:[null,null,null,"1"],children:x?t.jsx(r.Image,{src:x,objectFit:"cover",height:[m,null,null,u],width:"100%",alt:"","data-testid":"spotlight-card-image"}):t.jsx(r.Box,{height:[m,null,null,u],overflow:"hidden",children:f})}),t.jsxs(r.Flex,{direction:["column",null,null,"row"],justifyContent:[null,null,null,"space-between"],alignItems:["left",null,null,"center"],padding:"4",height:["100%",null,null,"auto"],width:"100%",position:[null,null,null,"absolute"],bottom:[null,null,null,"0"],backgroundColor:[null,null,null,`${g}CC`],backdropFilter:[null,null,null,"blur(8px)"],children:[t.jsxs(r.Box,{children:[t.jsx(r.Text,{fontSize:"lg",fontWeight:"medium",color:"tints.black",children:i}),t.jsx(r.Text,{fontSize:"sm",color:"tints.black",children:o})]}),t.jsx(r.Box,{display:["none",null,null,"block"],children:j})]})]})},q=i=>t.jsx(r.IconButton,{size:"sm",width:["40px",null,null,"46px"],height:["40px",null,null,"46px"],padding:["2 !important",null,null,"3 !important"],colorScheme:"whiteCS",backgroundColor:"tints.cream",sx:{svg:{width:"24px",height:"24px"}},_hover:{backgroundColor:"tints.cream",filter:"brightness(0.95)"},...i}),Pt=()=>t.jsx("svg",{width:"116",height:"24",viewBox:"0 0 116 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":"Everlywell Logo",children:t.jsx("g",{id:"Everlywell Logo",children:t.jsx("path",{id:"Everlywell Logo_2",fillRule:"evenodd",clipRule:"evenodd",d:"M54.8224 1V17.8352H52.4272V1H54.8224ZM5.65731 14.992C4.9835 14.4474 4.59261 13.726 4.48231 12.8278H13.7822C13.9984 10.4829 13.5723 8.70006 12.5039 7.47915C11.4322 6.25824 9.93769 5.64945 8.01698 5.64945C6.23518 5.64945 4.78896 6.22479 3.67214 7.38216C2.55841 8.5395 2 9.92767 2 11.8377C2 13.7476 2.56171 15.273 3.68501 16.4136C4.80831 17.5542 6.30612 18.1229 8.18163 18.1229C9.11125 18.1229 10.0216 17.9489 10.9125 17.5944C11.8034 17.2431 12.533 16.7447 13.1075 16.1025L11.5517 14.5371C11.2095 14.9217 10.7253 15.2294 10.099 15.4636C9.46959 15.6944 8.84662 15.8115 8.22684 15.8115C7.18735 15.8115 6.33197 15.5372 5.65731 14.992ZM10.4671 8.60977C11.0772 9.10817 11.416 9.81395 11.4774 10.7305H4.52751C4.71152 9.81395 5.12475 9.10817 5.77027 8.60977C6.41589 8.11136 7.18735 7.86384 8.08473 7.86384C9.05966 7.86384 9.85696 8.11136 10.4671 8.60977ZM22.1465 17.8819L27.0047 5.93699H24.3771L22.6565 10.2486L20.8424 15.2828L18.8217 9.76697L17.2884 5.93699H14.6382L19.5189 17.8819H22.1465ZM30.3737 12.8244C30.4835 13.7242 30.8741 14.4467 31.5487 14.992C32.2234 15.5372 33.0788 15.8115 34.1181 15.8115C34.7379 15.8115 35.361 15.6944 35.9905 15.4636C36.6166 15.2294 37.1009 14.9217 37.4431 14.5371L38.999 16.1025C38.4244 16.7447 37.6948 17.2431 36.8039 17.5944C35.9129 17.9489 35.0027 18.1229 34.0729 18.1229C32.1975 18.1229 30.6997 17.5542 29.5764 16.4136C28.453 15.273 27.8914 13.7476 27.8914 11.8377C27.8914 9.92767 28.4498 8.5395 29.5635 7.38216C30.6804 6.22479 32.1265 5.64945 33.9084 5.64945C35.829 5.64945 37.3236 6.25824 38.3952 7.47915C39.4638 8.70006 39.8899 10.4829 39.6736 12.8278H30.3769L30.3737 12.8244ZM37.3688 10.7305C37.3075 9.81395 36.9685 9.10817 36.3584 8.60977C35.7483 8.11136 34.951 7.86384 33.9762 7.86384C33.0788 7.86384 32.3073 8.11136 31.6617 8.60977C31.0161 9.10817 30.6029 9.81395 30.4189 10.7305H37.3688ZM44.5032 7.5263L44.3418 5.96085H44.3385H42.108V17.8355H44.5032V11.4031C44.5032 10.3595 44.8001 9.5567 45.3877 8.99473C45.9751 8.43278 46.7112 8.15181 47.5956 8.15181C48.3703 8.15181 49.0417 8.39264 49.6163 8.87432L50.7073 6.70677C49.9811 6.03445 49.0353 5.6966 47.8732 5.6966C46.2914 5.6966 45.1681 6.30539 44.5032 7.5263ZM60.3782 12.3193V5.96054H57.983V12.3428C57.983 14.1089 58.4286 15.5004 59.3195 16.5106C60.2104 17.5241 61.3789 18.0292 62.8186 18.0292C64.552 18.0292 65.8787 17.387 66.7923 16.1025V18.1262C66.7923 19.2669 66.4824 20.1499 65.8626 20.7754C65.2429 21.401 64.494 21.7154 63.6094 21.7154C61.8889 21.7154 60.8754 20.9661 60.5654 19.4742H58.2187C58.3252 20.9326 58.8644 22.0532 59.8327 22.8326C60.8011 23.612 62.1214 24 63.6546 24C65.188 24 66.4727 23.5049 67.5121 22.5081C68.5515 21.5147 69.0712 20.0697 69.0712 18.1731V5.96054H66.6761V12.1521C66.6761 13.1623 66.3791 14.0153 65.7819 14.7043C65.188 15.3967 64.4681 15.7412 63.4933 15.7412C62.5184 15.7412 61.7566 15.4268 61.2047 14.8013C60.6526 14.1725 60.3782 13.3463 60.3782 12.3193ZM81.5989 5.93699L84.3427 15.2828L87.1768 5.93699H89.8496L85.8275 17.8819H83.0385L81.6892 13.9315L80.5724 9.79039L79.4328 13.9315L78.0836 17.8819H75.2945L71.2498 5.93699H73.9453L76.7795 15.2828L79.5232 5.93699H81.5924H81.5989ZM94.65 14.992C93.9754 14.4467 93.5848 13.7242 93.475 12.8244L93.4847 12.8278H102.781C102.998 10.4829 102.572 8.70006 101.503 7.47915C100.431 6.25824 98.9368 5.64945 97.0162 5.64945C95.2343 5.64945 93.785 6.22479 92.668 7.38216C91.5544 8.5395 90.9959 9.92767 90.9959 11.8377C90.9959 13.7476 91.5576 15.273 92.6809 16.4136C93.8043 17.5542 95.3021 18.1229 97.1775 18.1229C98.1073 18.1229 99.0175 17.9489 99.9084 17.5944C100.799 17.2431 101.529 16.7447 102.103 16.1025L100.544 14.5371C100.202 14.9217 99.7212 15.2328 99.0918 15.4636C98.4623 15.6944 97.8393 15.8115 97.2196 15.8115C96.1802 15.8115 95.3247 15.5372 94.65 14.992ZM99.4598 8.60977C100.07 9.10817 100.409 9.81395 100.47 10.7305H93.5202C93.7042 9.81395 94.1175 9.10817 94.763 8.60977C95.4086 8.11136 96.1802 7.86384 97.0774 7.86384C98.0524 7.86384 98.8465 8.11136 99.4598 8.60977ZM107.698 1V17.8352H105.303V1H107.698ZM113.53 17.8352V1H111.135V17.8352H113.53Z",fill:"#28724F"})})}),lt=({desktopTopButtons:i,kitRegistrationElement:o,profileElement:x,cartElement:f,onSearchClick:j,onMenuClick:g,hasSearch:C=!1,logoLink:R="https://www.everlywell.com",onHeightChange:s,linkComponent:m,onLogoClick:u})=>{const h=y.useRef(null),[E,d]=y.useState(0),D=100,B=y.useCallback(()=>{if(h.current&&s){const $=Date.now();if($-E>D){const A=h.current.getBoundingClientRect().height;s(A),d($)}}},[s,E]);return y.useEffect(()=>{B();const $=new ResizeObserver(()=>{B()});return h.current&&$.observe(h.current),()=>{$.disconnect()}},[B]),t.jsx(r.Box,{ref:h,paddingY:"4",paddingX:[4,null,null,12],borderBottom:"1px solid",borderColor:"tints.lightCream",backgroundColor:"tints.white",position:"fixed",width:"100%",zIndex:["sticky",null,null,"tooltip"],children:t.jsxs(r.Flex,{justifyContent:"space-between",alignItems:"center",children:[t.jsxs(r.Flex,{alignItems:"center",gap:"5",children:[t.jsx(r.Box,{"aria-label":"Go to homepage",onClick:u,as:m||r.Link,...$e(R,!!m),children:t.jsx(Pt,{})}),t.jsx(r.Flex,{display:["none",null,null,"flex"],children:i})]}),t.jsxs(r.Flex,{alignItems:"center",gap:"2",children:[t.jsx(r.Box,{display:["none",null,null,"block"],children:o}),C?t.jsx(q,{"aria-label":"Search",icon:t.jsx(r.Icon,{as:W.MagnifyingGlass}),onClick:j}):null,f,t.jsx(r.Box,{display:["flex",null,null,"none"],children:t.jsx(q,{icon:t.jsx(W.List,{}),"aria-label":"menu","data-testid":"menu-button",onClick:g})}),t.jsx(r.Box,{display:["none",null,null,"block"],children:x})]})]})})},it=({count:i=0,...o})=>t.jsxs(r.Box,{position:"relative",display:"inline-block",children:[t.jsx(q,{icon:t.jsx(W.Basket,{}),...o}),i>0&&t.jsx(r.Box,{display:"flex",minWidth:"20px",height:"20px",py:"4px",px:"6px",justifyContent:"center",alignItems:"center",position:"absolute",right:"-4px",top:"-4px",borderRadius:"32px",background:"viridian.base",color:"white",fontSize:"xs",fontWeight:"normal",children:i})]}),Ft=({numLinks:i=5,showPromoButton:o=!0})=>t.jsx(r.VStack,{spacing:0,align:"stretch",children:t.jsx(r.Box,{paddingY:4,paddingX:6,borderBottomWidth:"1px",children:t.jsxs(r.Flex,{justify:"space-between",align:"center",children:[t.jsx(r.Skeleton,{w:"120px",h:"48px"}),t.jsxs(r.HStack,{spacing:8,marginLeft:12,children:[Array.from({length:i}).map((x,f)=>t.jsx(r.Skeleton,{width:"90px",height:"48px"},f)),o&&t.jsx(r.Skeleton,{width:"110px",height:"48px",borderRadius:"full"})]}),t.jsxs(r.HStack,{spacing:4,ml:"auto",children:[t.jsx(r.SkeletonCircle,{width:"120px",height:"48px"})," ",t.jsx(r.SkeletonCircle,{width:"48px",height:"48px"})," ",t.jsx(r.SkeletonCircle,{width:"48px",height:"48px"})," ",t.jsx(r.SkeletonCircle,{width:"48px",height:"48px"})," "]})]})})}),It=(i,o)=>{let x;return(...f)=>{x&&clearTimeout(x),x=setTimeout(()=>{i(...f)},o)}},He="nav-drawer-hover",tt=i=>{window.dispatchEvent(new CustomEvent(He,{detail:{isHovering:i},bubbles:!0,cancelable:!0}))},Bt=(i=!1,o=!1,x=!1)=>i||!o?"column":x?"row":"row-reverse",Se=({isOpen:i=!1,onClose:o,title:x,navDrawerLinks:f,bottomNavButtons:j,spotlightCards:g,bottomButton:C,hasBackButton:R=!0,onBackClick:s,hasOnlySpotlightCards:m=!1,navHeight:u,hasSearch:h=!1,onSearch:E=()=>{}})=>{const d=ne.useBreakpointValue({base:!1,tablet:!1,largeTablet:!1,desktop:!0}),D=d?"top":"left",[B,$]=y.useState(0),A=()=>{$(V=>V+1)},k=y.useCallback(It(V=>{E(V),A()},100),[]);return t.jsxs(r.Drawer,{isOpen:i,onClose:o,placement:D,blockScrollOnMount:!1,autoFocus:!1,children:[t.jsx(r.DrawerOverlay,{backgroundColor:"tints.black",top:["0",null,null,u?`${u}px`:null],opacity:d?void 0:"0.4 !important",motionProps:d?{initial:{opacity:0},animate:{opacity:.4},exit:{opacity:0},transition:{duration:.4,delay:.2,ease:"easeOut"}}:{}}),t.jsxs(r.DrawerContent,{onMouseEnter:()=>{!h&&d&&tt(!0)},onMouseLeave:()=>{!h&&d&&tt(!1)},paddingTop:[4,null,null,u?`${u+24}px`:null],paddingX:[4,null,null,12],paddingBottom:"24",overflow:"auto",maxHeight:"100vh",position:"relative",children:[!h&&d?null:t.jsxs(r.DrawerHeader,{padding:"0",flexDirection:h?"column":"row",gap:h?"4":"0",children:[d?null:t.jsxs(r.Flex,{width:"100%",justifyContent:"space-between",alignItems:"center",children:[R?t.jsx(q,{icon:t.jsx(W.CaretLeft,{}),onClick:()=>{s&&s(),o()},"aria-label":"Back"}):null,t.jsx(r.Text,{color:"tints.uiGrey",fontSize:["xl",null,null,"lg"],children:x}),t.jsx(q,{icon:t.jsx(W.X,{}),onClick:o,"aria-label":"Close"})]}),h&&t.jsxs(ne.InputGroup,{width:"100%",children:[t.jsx(ne.Input,{onChange:V=>{k(V.target.value)},placeholder:"Search",autoFocus:!0,width:"full",type:"search"}),t.jsx(ne.InputRightElement,{pointerEvents:"none",children:t.jsx(ne.Icon,{as:W.MagnifyingGlass,color:"gray.500"})})]})]}),t.jsx(r.DrawerBody,{paddingX:"0",paddingBottom:[6,null,null,4],"data-testid":`navbar-drawer-body-${x.toLowerCase()}`,children:t.jsx(Xe.motion.div,{...d?{initial:{opacity:0,y:0},animate:{opacity:1,y:0},exit:{opacity:0,y:0},transition:{duration:.3,ease:[.4,0,.2,1],exit:{duration:.3,ease:[.4,0,.2,1]}}}:{},children:t.jsxs(Xe.motion.div,{...d?{initial:{opacity:0,y:-5},animate:{opacity:1,y:0},exit:{opacity:0,y:-5},transition:{duration:.5,delay:.2,ease:[.4,0,.2,1],exit:{duration:.5,delay:.2,ease:[.4,0,.2,1]}}}:{},style:{display:"flex",flexDirection:Bt(m,d,h),gap:"24px",justifyContent:"space-between"},children:[g?t.jsx(r.Box,{gap:"6",display:"flex",justifyContent:[null,null,null,"center"],sx:{"& > *":{width:["100%",null,null,"365px","432px"]},flexWrap:"wrap",flexDirection:["column",null,null,"row"]},children:g}):null,t.jsxs(r.Flex,{position:[null,null,null,"relative"],flexDirection:"column",gap:"6",width:["100%",null,null,"auto"],children:[f?t.jsx(r.Box,{children:f}):null,j&&!d?t.jsx(r.Box,{children:j}):null,C?t.jsx(r.Box,{width:["100%"],position:[null,null,null,"absolute"],bottom:[null,null,null,0],children:C}):null]})]},B)})})]})]})},nt=i=>{const o=new Set;return i.reduce((x,f)=>{var g;const j=((g=f.sections)==null?void 0:g.reduce((C,R)=>{const s=R.links.filter(m=>o.has(m.label)||m.isSearchable!==!0?!1:(o.add(m.label),!0));return[...C,...s]},[]))??[];return[...x,...j]},[])},At=({source:i,onSearchCallback:o,isActive:x})=>{const[f,j]=y.useState(""),[g,C]=y.useState([]),R=(u,h)=>{if(!u)return[];const E=u.toLowerCase();return h.filter(d=>{const D=d.label.toLowerCase().includes(E),B=typeof d.additionalContent=="string"&&d.additionalContent.toLowerCase().includes(E);return D||B}).sort((d,D)=>d.label.localeCompare(D.label))},s=u=>{if(j(u),!u){C([]);return}const h=R(u,i);C(h),o&&o(u,h)},m=()=>{j(""),C([])};return y.useEffect(()=>{x||(j(""),C([]))},[x]),{query:f,results:g,handleClose:m,handleSearch:s}},Ht=({categories:i=[],onCartClick:o,mainCategoryLabel:x="Menu",logoLink:f="https://www.everlywell.com",hasSearch:j=!0,onSearchClick:g,registrationUrl:C,profileUrl:R="https://secure.everlywell.com/login",mobileBottomButtons:s=[],numberOfCartItems:m=0,linkComponent:u,onSearchCallback:h,onLinkClick:E,onCategoryOpen:d,onMobileMenuOpen:D,onBackToMainMenu:B,onRegisterKitClick:$,onProfileClick:A,onLogoClick:k})=>{var je,se,ye;const[V,pe]=y.useState(!1),[he,K]=y.useState(!1),[S,Y]=y.useState(null),[X,_e]=y.useState(0),[xe,re]=y.useState(!1),[H,z]=y.useState(!1),{query:U,results:G,handleSearch:ve}=At({source:nt(i),onSearchCallback:h,isActive:he}),ge=U&&t.jsxs(r.Flex,{gap:"6",direction:"column",children:[G.length>0?t.jsx(r.Text,{color:"tints.uiGrey",children:`${G.length} Results`}):t.jsx(r.Text,{children:"We didn't find what you were looking for, click to shop all products."}),t.jsx(r.Flex,{gap:"6",flexDirection:["column",null,null,"row"],justifyContent:[null,null,null,"flex-start"],children:Array.from({length:Math.ceil(G.length/4)},(c,O)=>t.jsx(r.Flex,{direction:"column",gap:"6",children:G.slice(O*4,(O+1)*4).map((L,P)=>t.jsx(Re,{href:L.href,label:L.label,additionalContent:L==null?void 0:L.additionalContent,linkComponent:u},`${L.label}-${P}`))},O))})]}),be=y.useCallback(c=>{_e(c)},[]),le=()=>{pe(!1),Y(null)},me=c=>{Y(c)},Ce=c=>{re(!0),K(!1),(c.sections||c.spotlightCards)&&Y(c)},we=()=>{re(!1)};y.useEffect(()=>{const c=O=>{z(O.detail.isHovering)};return window.addEventListener(He,c),()=>{window.removeEventListener(He,c)}},[]),y.useEffect(()=>{!xe&&!H&&(Y(null),K(!1))},[xe,H]),y.useEffect(()=>{let c=window.location.href;const O=()=>{const P=window.location.href;P!==c&&(c=P,le(),Y(null))},L=setInterval(O,100);return window.addEventListener("popstate",O),()=>{window.removeEventListener("popstate",O),clearInterval(L)}},[]);const ke=()=>{Y(null),B==null||B()},Te=t.jsx(t.Fragment,{children:i==null?void 0:i.map((c,O)=>t.jsx(fe,{onMouseEnter:()=>{Ce(c),d==null||d(c.label)},onMouseLeave:we,isSelected:(S==null?void 0:S.label)===c.label,...c.buttonProps,children:c.label},`${c.label}-${O}`))}),ie=(je=i.filter(c=>c.isMobileTopLink!==!1))==null?void 0:je.map(c=>t.jsx(r.Box,{onClick:()=>{me(c),d==null||d(c.label)},children:t.jsx(Re,{label:c.label,role:"link",additionalContent:c.additionalContent,mainTextFontSize:"3xl",linkComponent:u})},c.label));nt(i);const ae=t.jsxs(t.Fragment,{children:[t.jsx(fe,{as:r.Link,href:R,width:"100%",backgroundColor:"tints.cream",onClick:A,children:t.jsxs(r.Flex,{gap:"2",children:["My Everly",t.jsx(r.Icon,{as:W.User,size:24})]})},"my-everly"),t.jsx(fe,{as:r.Link,width:"100%",href:C,backgroundColor:"tints.cream",onClick:$,children:t.jsxs(r.Flex,{gap:"2",children:["Register kit",t.jsx(r.Icon,{as:W.QrCode,size:24})]})},"register-kit")]}),J=t.jsxs(r.Flex,{gap:"2",flexDirection:"column",children:[s,ae]}),oe=S?t.jsx(r.Flex,{direction:["column",null,null,"row"],gap:"8",children:(se=S==null?void 0:S.sections)==null?void 0:se.map((c,O)=>{const L=[];for(let P=0;P<c.links.length;P+=3)L.push(c.links.slice(P,P+3));return t.jsxs(r.Box,{children:[t.jsx(r.Text,{fontSize:"md",color:"tints.uiGrey",marginBottom:[0,null,null,6],children:c.title}),t.jsx(r.Flex,{flexDirection:["column",null,null,"row"],gap:[null,null,null,8],children:L==null?void 0:L.map((P,Ee)=>t.jsx(r.Flex,{flexDirection:["column"],gap:[null,null,null,5],marginLeft:[null,null,null,-2],children:P==null?void 0:P.map(N=>t.jsx(Re,{label:N.label,href:N.href,additionalContent:N.additionalContent,linkComponent:u,onClick:()=>E==null?void 0:E(N.label)},N.label))},Ee))})]},`${c.title}-${O}`)})}):null,Q=S!=null&&S.spotlightCards?(ye=S.spotlightCards)==null?void 0:ye.map(c=>t.jsx(rt,{...c},c.title)):t.jsx(r.Box,{});return t.jsxs(t.Fragment,{children:[t.jsx(lt,{desktopTopButtons:Te,kitRegistrationElement:t.jsx(fe,{as:r.Link,href:C,onClick:$,backgroundColor:"tints.cream",children:"Register Kit"}),profileElement:t.jsx(r.Link,{href:R,"aria-label":"login",onClick:A,children:t.jsx(q,{icon:t.jsx(r.Icon,{as:W.User}),"aria-label":"Profile"})}),cartElement:t.jsx(it,{"aria-label":"Cart",count:m,onClick:o}),onSearchClick:()=>{K(!0),g==null||g()},onMenuClick:()=>{pe(!0),D==null||D()},hasSearch:j,logoLink:f,onHeightChange:be,linkComponent:u,onLogoClick:k}),t.jsx(Se,{isOpen:V,onClose:le,title:x,navDrawerLinks:ie,bottomNavButtons:J,hasBackButton:!1,navHeight:X}),t.jsx(Se,{isOpen:!!S,onClose:()=>Y(null),title:(S==null?void 0:S.label)||"",navDrawerLinks:oe,onBackClick:ke,spotlightCards:Q,hasOnlySpotlightCards:S==null?void 0:S.hasOnlySpotlightCards,navHeight:X,bottomButton:S==null?void 0:S.bottomButton}),t.jsx(Se,{isOpen:he,onClose:()=>K(!1),title:"Search",navHeight:X,navDrawerLinks:ge,onSearch:ve,hasSearch:!0,hasBackButton:!1})]})};exports.BasketButton=it;exports.CategoryLabel=Dt;exports.NavButton=fe;exports.NavSkeleton=Ft;exports.NavbarDrawer=Se;exports.NavbarDrawerLink=Re;exports.NavigationBar=Ht;exports.SpotlightCard=rt;exports.Stepper=Ot;exports.TopNavIconButton=q;exports.TopNavigation=lt;
|
|
32
|
+
<%s key={someKey} {...props} />`,Ie,Z,St,Z),qe[Z+Ie]=!0}}return e===f?wt(T):Ct(T),T}}function jt(e,n,l){return Ke(e,n,l,!0)}function yt(e,n,l){return Ke(e,n,l,!1)}var Et=yt,Rt=jt;de.Fragment=f,de.jsx=Et,de.jsxs=Rt}()),de}process.env.NODE_ENV==="production"?Ae.exports=kt():Ae.exports=Tt();var t=Ae.exports;const Be=60,et=6,Lt=i=>{const{activeStepIndex:o,hideIndicators:x=!1,steps:f,stepperTheme:j={light:"eggplant.light",base:"eggplant.base"}}=i,{activeStep:g,setActiveStep:C}=r.useSteps({index:o,count:f.length});return y.useEffect(()=>{C(o)},[o,C]),t.jsx(r.Box,{position:"relative",width:"100%","data-testid":"stepper",children:t.jsx(r.Stepper,{role:"progressbar",index:g,width:"100%",display:"flex",flexWrap:"nowrap",children:f.map((R,s)=>{const m=g===s,u=s===0,h=s===f.length-1,E=g>s;let d=`${Be}px`;const D=`calc(100% - ((${Be*(f.length-1)}px) - (${f.length-1} * ${et*2}px)))`;return m?d=D:(u||h)&&(d=`${Be-et}px`),t.jsx(r.Box,{width:d,opacity:E||m?1:.2,paddingRight:h?"0":"6px",paddingLeft:u?"0":"6px",transition:"width 0.4s ease-in-out, opacity 0.4s ease-in-out",children:t.jsx(r.Box,{paddingTop:x?2:5,position:"relative",width:"100%",children:t.jsx(r.Box,{width:"100%",position:"absolute",top:"0",backgroundColor:E?j.light:j.base,height:x?"4px":"8px",borderRadius:"4",left:"0"})})},`step-${s}`)})})})},Ot=y.memo(Lt),Dt=({children:i,...o})=>t.jsx(ne.Text,{color:"tints.uiGrey",fontSize:["md",null,null,"lg"],...o,children:i}),$e=(i,o)=>{const x=(i==null?void 0:i.startsWith("http"))||(i==null?void 0:i.startsWith("mailto"));return o&&!x?{to:i}:{href:i}},Re=y.forwardRef((i,o)=>{const{label:x,additionalContent:f,mainTextFontSize:j,linkComponent:g,href:C,...R}=i,s=g||r.Link,m=$e(C,!!g);return t.jsxs(r.Box,{ref:o,as:s,display:"flex",alignItems:"center",gap:[null,null,null,1],justifyContent:[null,null,null,"space-between"],paddingY:[3,null,null,0],color:"tints.black",_hover:{color:"viridian.base",textDecoration:"none"},borderBottom:["1px",null,null,"unset"],borderColor:["tints.cream",null,null,"unset"],width:["100%",null,null,"fit-content"],cursor:"pointer",...m,...R,children:[t.jsx(r.Icon,{display:["none",null,null,"block"],as:W.CaretRight,fontSize:"lg",color:"viridian.light",role:"img","aria-label":"Caret right icon",weight:"bold"}),t.jsxs(r.Flex,{alignItems:"center",gap:"1",width:["100%",null,null,"auto"],children:[t.jsx(r.Text,{fontSize:[j||"xl",null,null,"lg"],fontWeight:"medium",children:x}),f&&(typeof f=="string"?t.jsx(r.Text,{fontSize:["xl",null,null,"lg"],fontWeight:"medium",color:"tints.uiGrey",sx:{"a:hover &":{color:"viridian.base"}},children:f}):f),t.jsx(r.Icon,{display:["block",null,null,"none"],as:W.CaretRight,fontSize:"2xl",color:"tints.uiGrey",role:"img","aria-label":"Caret right icon",marginLeft:"auto"})]})]})}),fe=y.forwardRef((i,o)=>{const{children:x,isSelected:f,...j}=i,g=i.backgroundColor||(f?"tints.lightCream":"transparent");return t.jsx(r.Button,{ref:o,borderRadius:"full",backgroundColor:g,fontSize:"lg !important",fontWeight:"normal",color:"tints.black",_before:{content:'""',position:"absolute",top:[null,null,null,-6],right:[null,null,null,-2],bottom:[null,null,null,-6],left:[null,null,null,-2]},_hover:{backgroundColor:g,textDecoration:"none",filter:"brightness(0.95)"},...j,children:x})}),rt=({title:i,description:o,imageSrc:x,imageElement:f,button:j,backgroundColor:g="viridian.wash",onClick:C,href:R,linkComponent:s})=>{const m="80px",u="200px",h="272px",E=s||r.Link,d=$e(R,!!s);return t.jsxs(r.Flex,{direction:["row",null,null,"column"],alignItems:["center"],borderRadius:"xl",overflow:"hidden",height:[m,null,null,h],backgroundColor:g,onClick:C,"data-testid":"spotlight-card",position:"relative",transition:"box-shadow 0.2s ease-in-out",border:"1px solid",borderColor:"transparent",_hover:{boxShadow:"lg",cursor:"pointer",textDecoration:"none",border:"1px solid",borderColor:"tints.white"},as:E,...d,children:[t.jsx(r.Box,{width:["72px",null,null,"100%"],height:["100%"],flex:[null,null,null,"1"],children:x?t.jsx(r.Image,{src:x,objectFit:"cover",height:[m,null,null,u],width:"100%",alt:"","data-testid":"spotlight-card-image"}):t.jsx(r.Box,{height:[m,null,null,u],overflow:"hidden",children:f})}),t.jsxs(r.Flex,{direction:["column",null,null,"row"],justifyContent:[null,null,null,"space-between"],alignItems:["left",null,null,"center"],padding:"4",height:["100%",null,null,"auto"],width:"100%",position:[null,null,null,"absolute"],bottom:[null,null,null,"0"],backgroundColor:[null,null,null,`${g}CC`],backdropFilter:[null,null,null,"blur(8px)"],children:[t.jsxs(r.Box,{children:[t.jsx(r.Text,{fontSize:"lg",fontWeight:"medium",color:"tints.black",children:i}),t.jsx(r.Text,{fontSize:"sm",color:"tints.black",children:o})]}),t.jsx(r.Box,{display:["none",null,null,"block"],children:j})]})]})},q=i=>t.jsx(r.IconButton,{size:"sm",width:["40px",null,null,"46px"],height:["40px",null,null,"46px"],padding:["2 !important",null,null,"3 !important"],colorScheme:"whiteCS",backgroundColor:"tints.cream",sx:{svg:{width:"24px",height:"24px"}},_hover:{backgroundColor:"tints.cream",filter:"brightness(0.95)"},...i}),Pt=()=>t.jsx("svg",{width:"116",height:"24",viewBox:"0 0 116 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:"img","aria-label":"Everlywell Logo",children:t.jsx("g",{id:"Everlywell Logo",children:t.jsx("path",{id:"Everlywell Logo_2",fillRule:"evenodd",clipRule:"evenodd",d:"M54.8224 1V17.8352H52.4272V1H54.8224ZM5.65731 14.992C4.9835 14.4474 4.59261 13.726 4.48231 12.8278H13.7822C13.9984 10.4829 13.5723 8.70006 12.5039 7.47915C11.4322 6.25824 9.93769 5.64945 8.01698 5.64945C6.23518 5.64945 4.78896 6.22479 3.67214 7.38216C2.55841 8.5395 2 9.92767 2 11.8377C2 13.7476 2.56171 15.273 3.68501 16.4136C4.80831 17.5542 6.30612 18.1229 8.18163 18.1229C9.11125 18.1229 10.0216 17.9489 10.9125 17.5944C11.8034 17.2431 12.533 16.7447 13.1075 16.1025L11.5517 14.5371C11.2095 14.9217 10.7253 15.2294 10.099 15.4636C9.46959 15.6944 8.84662 15.8115 8.22684 15.8115C7.18735 15.8115 6.33197 15.5372 5.65731 14.992ZM10.4671 8.60977C11.0772 9.10817 11.416 9.81395 11.4774 10.7305H4.52751C4.71152 9.81395 5.12475 9.10817 5.77027 8.60977C6.41589 8.11136 7.18735 7.86384 8.08473 7.86384C9.05966 7.86384 9.85696 8.11136 10.4671 8.60977ZM22.1465 17.8819L27.0047 5.93699H24.3771L22.6565 10.2486L20.8424 15.2828L18.8217 9.76697L17.2884 5.93699H14.6382L19.5189 17.8819H22.1465ZM30.3737 12.8244C30.4835 13.7242 30.8741 14.4467 31.5487 14.992C32.2234 15.5372 33.0788 15.8115 34.1181 15.8115C34.7379 15.8115 35.361 15.6944 35.9905 15.4636C36.6166 15.2294 37.1009 14.9217 37.4431 14.5371L38.999 16.1025C38.4244 16.7447 37.6948 17.2431 36.8039 17.5944C35.9129 17.9489 35.0027 18.1229 34.0729 18.1229C32.1975 18.1229 30.6997 17.5542 29.5764 16.4136C28.453 15.273 27.8914 13.7476 27.8914 11.8377C27.8914 9.92767 28.4498 8.5395 29.5635 7.38216C30.6804 6.22479 32.1265 5.64945 33.9084 5.64945C35.829 5.64945 37.3236 6.25824 38.3952 7.47915C39.4638 8.70006 39.8899 10.4829 39.6736 12.8278H30.3769L30.3737 12.8244ZM37.3688 10.7305C37.3075 9.81395 36.9685 9.10817 36.3584 8.60977C35.7483 8.11136 34.951 7.86384 33.9762 7.86384C33.0788 7.86384 32.3073 8.11136 31.6617 8.60977C31.0161 9.10817 30.6029 9.81395 30.4189 10.7305H37.3688ZM44.5032 7.5263L44.3418 5.96085H44.3385H42.108V17.8355H44.5032V11.4031C44.5032 10.3595 44.8001 9.5567 45.3877 8.99473C45.9751 8.43278 46.7112 8.15181 47.5956 8.15181C48.3703 8.15181 49.0417 8.39264 49.6163 8.87432L50.7073 6.70677C49.9811 6.03445 49.0353 5.6966 47.8732 5.6966C46.2914 5.6966 45.1681 6.30539 44.5032 7.5263ZM60.3782 12.3193V5.96054H57.983V12.3428C57.983 14.1089 58.4286 15.5004 59.3195 16.5106C60.2104 17.5241 61.3789 18.0292 62.8186 18.0292C64.552 18.0292 65.8787 17.387 66.7923 16.1025V18.1262C66.7923 19.2669 66.4824 20.1499 65.8626 20.7754C65.2429 21.401 64.494 21.7154 63.6094 21.7154C61.8889 21.7154 60.8754 20.9661 60.5654 19.4742H58.2187C58.3252 20.9326 58.8644 22.0532 59.8327 22.8326C60.8011 23.612 62.1214 24 63.6546 24C65.188 24 66.4727 23.5049 67.5121 22.5081C68.5515 21.5147 69.0712 20.0697 69.0712 18.1731V5.96054H66.6761V12.1521C66.6761 13.1623 66.3791 14.0153 65.7819 14.7043C65.188 15.3967 64.4681 15.7412 63.4933 15.7412C62.5184 15.7412 61.7566 15.4268 61.2047 14.8013C60.6526 14.1725 60.3782 13.3463 60.3782 12.3193ZM81.5989 5.93699L84.3427 15.2828L87.1768 5.93699H89.8496L85.8275 17.8819H83.0385L81.6892 13.9315L80.5724 9.79039L79.4328 13.9315L78.0836 17.8819H75.2945L71.2498 5.93699H73.9453L76.7795 15.2828L79.5232 5.93699H81.5924H81.5989ZM94.65 14.992C93.9754 14.4467 93.5848 13.7242 93.475 12.8244L93.4847 12.8278H102.781C102.998 10.4829 102.572 8.70006 101.503 7.47915C100.431 6.25824 98.9368 5.64945 97.0162 5.64945C95.2343 5.64945 93.785 6.22479 92.668 7.38216C91.5544 8.5395 90.9959 9.92767 90.9959 11.8377C90.9959 13.7476 91.5576 15.273 92.6809 16.4136C93.8043 17.5542 95.3021 18.1229 97.1775 18.1229C98.1073 18.1229 99.0175 17.9489 99.9084 17.5944C100.799 17.2431 101.529 16.7447 102.103 16.1025L100.544 14.5371C100.202 14.9217 99.7212 15.2328 99.0918 15.4636C98.4623 15.6944 97.8393 15.8115 97.2196 15.8115C96.1802 15.8115 95.3247 15.5372 94.65 14.992ZM99.4598 8.60977C100.07 9.10817 100.409 9.81395 100.47 10.7305H93.5202C93.7042 9.81395 94.1175 9.10817 94.763 8.60977C95.4086 8.11136 96.1802 7.86384 97.0774 7.86384C98.0524 7.86384 98.8465 8.11136 99.4598 8.60977ZM107.698 1V17.8352H105.303V1H107.698ZM113.53 17.8352V1H111.135V17.8352H113.53Z",fill:"#28724F"})})}),lt=({desktopTopButtons:i,kitRegistrationElement:o,profileElement:x,cartElement:f,onSearchClick:j,onMenuClick:g,hasSearch:C=!1,logoLink:R="https://www.everlywell.com",onHeightChange:s,linkComponent:m,onLogoClick:u})=>{const h=y.useRef(null),[E,d]=y.useState(0),D=100,B=y.useCallback(()=>{if(h.current&&s){const $=Date.now();if($-E>D){const A=h.current.getBoundingClientRect().height;s(A),d($)}}},[s,E]);return y.useEffect(()=>{B();const $=new ResizeObserver(()=>{B()});return h.current&&$.observe(h.current),()=>{$.disconnect()}},[B]),t.jsx(r.Box,{ref:h,paddingY:"4",paddingX:[4,null,null,12],borderBottom:"1px solid",borderColor:"tints.lightCream",backgroundColor:"tints.white",position:"fixed",width:"100%",zIndex:["sticky",null,null,"tooltip"],children:t.jsxs(r.Flex,{justifyContent:"space-between",alignItems:"center",children:[t.jsxs(r.Flex,{alignItems:"center",gap:"5",children:[t.jsx(r.Box,{"aria-label":"Go to homepage",onClick:u,as:m||r.Link,...$e(R,!!m),children:t.jsx(Pt,{})}),t.jsx(r.Flex,{display:["none",null,null,"flex"],children:i})]}),t.jsxs(r.Flex,{alignItems:"center",gap:"2",children:[t.jsx(r.Box,{display:["none",null,null,"block"],children:o}),C?t.jsx(q,{"aria-label":"Search",icon:t.jsx(r.Icon,{as:W.MagnifyingGlass}),onClick:j}):null,f,t.jsx(r.Box,{display:["flex",null,null,"none"],children:t.jsx(q,{icon:t.jsx(W.List,{}),"aria-label":"menu","data-testid":"menu-button",onClick:g})}),t.jsx(r.Box,{display:["none",null,null,"block"],children:x})]})]})})},it=({count:i=0,...o})=>t.jsxs(r.Box,{position:"relative",display:"inline-block",children:[t.jsx(q,{icon:t.jsx(W.Basket,{}),...o}),i>0&&t.jsx(r.Box,{display:"flex",minWidth:"20px",height:"20px",py:"4px",px:"6px",justifyContent:"center",alignItems:"center",position:"absolute",right:"-4px",top:"-4px",borderRadius:"32px",background:"viridian.base",color:"white",fontSize:"xs",fontWeight:"normal",children:i})]}),Ft=({numLinks:i=5,showPromoButton:o=!0})=>t.jsx(r.VStack,{spacing:0,align:"stretch",children:t.jsx(r.Box,{paddingY:4,paddingX:6,borderBottomWidth:"1px",children:t.jsxs(r.Flex,{justify:"space-between",align:"center",children:[t.jsx(r.Skeleton,{w:"120px",h:"48px"}),t.jsxs(r.HStack,{spacing:8,marginLeft:12,children:[Array.from({length:i}).map((x,f)=>t.jsx(r.Skeleton,{width:"90px",height:"48px"},f)),o&&t.jsx(r.Skeleton,{width:"110px",height:"48px",borderRadius:"full"})]}),t.jsxs(r.HStack,{spacing:4,ml:"auto",children:[t.jsx(r.SkeletonCircle,{width:"120px",height:"48px"})," ",t.jsx(r.SkeletonCircle,{width:"48px",height:"48px"})," ",t.jsx(r.SkeletonCircle,{width:"48px",height:"48px"})," ",t.jsx(r.SkeletonCircle,{width:"48px",height:"48px"})," "]})]})})}),It=(i,o)=>{let x;return(...f)=>{x&&clearTimeout(x),x=setTimeout(()=>{i(...f)},o)}},He="nav-drawer-hover",tt=i=>{window.dispatchEvent(new CustomEvent(He,{detail:{isHovering:i},bubbles:!0,cancelable:!0}))},Bt=(i=!1,o=!1,x=!1)=>i||!o?"column":x?"row":"row-reverse",Se=({isOpen:i=!1,onClose:o,title:x,navDrawerLinks:f,bottomNavButtons:j,spotlightCards:g,bottomButton:C,hasBackButton:R=!0,onBackClick:s,hasOnlySpotlightCards:m=!1,navHeight:u,hasSearch:h=!1,onSearch:E=()=>{}})=>{const d=ne.useBreakpointValue({base:!1,tablet:!1,largeTablet:!1,desktop:!0}),D=d?"top":"left",[B,$]=y.useState(0),A=()=>{$(V=>V+1)},k=y.useCallback(It(V=>{E(V),A()},100),[]);return t.jsxs(r.Drawer,{isOpen:i,onClose:o,placement:D,blockScrollOnMount:!1,autoFocus:!1,children:[t.jsx(r.DrawerOverlay,{backgroundColor:"tints.black",top:["0",null,null,u?`${u}px`:null],opacity:d?void 0:"0.4 !important",motionProps:d?{initial:{opacity:0},animate:{opacity:.4},exit:{opacity:0},transition:{duration:.4,delay:.2,ease:"easeOut"}}:{}}),t.jsxs(r.DrawerContent,{onMouseEnter:()=>{!h&&d&&tt(!0)},onMouseLeave:()=>{!h&&d&&tt(!1)},paddingTop:[4,null,null,u?`${u+24}px`:null],paddingX:[4,null,null,12],paddingBottom:"24",overflow:"auto",maxHeight:"100vh",position:"relative",className:"navbar-drawer-content-container",children:[!h&&d?null:t.jsxs(r.DrawerHeader,{padding:"0",flexDirection:h?"column":"row",gap:h?"4":"0",children:[d?null:t.jsxs(r.Flex,{width:"100%",justifyContent:"space-between",alignItems:"center",children:[R?t.jsx(q,{icon:t.jsx(W.CaretLeft,{}),onClick:()=>{s&&s(),o()},"aria-label":"Back"}):null,t.jsx(r.Text,{color:"tints.uiGrey",fontSize:["xl",null,null,"lg"],children:x}),t.jsx(q,{icon:t.jsx(W.X,{}),onClick:o,"aria-label":"Close"})]}),h&&t.jsxs(ne.InputGroup,{width:"100%",children:[t.jsx(ne.Input,{onChange:V=>{k(V.target.value)},placeholder:"Search",autoFocus:!0,width:"full",type:"search"}),t.jsx(ne.InputRightElement,{pointerEvents:"none",children:t.jsx(ne.Icon,{as:W.MagnifyingGlass,color:"gray.500"})})]})]}),t.jsx(r.DrawerBody,{paddingX:"0",paddingBottom:[6,null,null,4],"data-testid":`navbar-drawer-body-${x.toLowerCase()}`,children:t.jsx(Xe.motion.div,{...d?{initial:{opacity:0,y:0},animate:{opacity:1,y:0},exit:{opacity:0,y:0},transition:{duration:.3,ease:[.4,0,.2,1],exit:{duration:.3,ease:[.4,0,.2,1]}}}:{},children:t.jsxs(Xe.motion.div,{...d?{initial:{opacity:0,y:-5},animate:{opacity:1,y:0},exit:{opacity:0,y:-5},transition:{duration:.5,delay:.2,ease:[.4,0,.2,1],exit:{duration:.5,delay:.2,ease:[.4,0,.2,1]}}}:{},style:{display:"flex",flexDirection:Bt(m,d,h),gap:"24px",justifyContent:"space-between"},children:[g?t.jsx(r.Box,{gap:"6",display:"flex",justifyContent:[null,null,null,"center"],sx:{"& > *":{width:["100%",null,null,"365px","432px"]},flexWrap:"wrap",flexDirection:["column",null,null,"row"]},children:g}):null,t.jsxs(r.Flex,{position:[null,null,null,"relative"],flexDirection:"column",gap:"6",width:["100%",null,null,"auto"],children:[f?t.jsx(r.Box,{children:f}):null,j&&!d?t.jsx(r.Box,{children:j}):null,C?t.jsx(r.Box,{width:["100%"],position:[null,null,null,"absolute"],bottom:[null,null,null,0],children:C}):null]})]},B)})})]})]})},nt=i=>{const o=new Set;return i.reduce((x,f)=>{var g;const j=((g=f.sections)==null?void 0:g.reduce((C,R)=>{const s=R.links.filter(m=>o.has(m.label)||m.isSearchable!==!0?!1:(o.add(m.label),!0));return[...C,...s]},[]))??[];return[...x,...j]},[])},At=({source:i,onSearchCallback:o,isActive:x})=>{const[f,j]=y.useState(""),[g,C]=y.useState([]),R=(u,h)=>{if(!u)return[];const E=u.toLowerCase();return h.filter(d=>{const D=d.label.toLowerCase().includes(E),B=typeof d.additionalContent=="string"&&d.additionalContent.toLowerCase().includes(E);return D||B}).sort((d,D)=>d.label.localeCompare(D.label))},s=u=>{if(j(u),!u){C([]);return}const h=R(u,i);C(h),o&&o(u,h)},m=()=>{j(""),C([])};return y.useEffect(()=>{x||(j(""),C([]))},[x]),{query:f,results:g,handleClose:m,handleSearch:s}},Ht=({categories:i=[],onCartClick:o,mainCategoryLabel:x="Menu",logoLink:f="https://www.everlywell.com",hasSearch:j=!0,onSearchClick:g,registrationUrl:C,profileUrl:R="https://secure.everlywell.com/login",mobileBottomButtons:s=[],numberOfCartItems:m=0,linkComponent:u,onSearchCallback:h,onLinkClick:E,onCategoryOpen:d,onMobileMenuOpen:D,onBackToMainMenu:B,onRegisterKitClick:$,onProfileClick:A,onLogoClick:k})=>{var je,se,ye;const[V,pe]=y.useState(!1),[he,K]=y.useState(!1),[S,Y]=y.useState(null),[X,_e]=y.useState(0),[xe,re]=y.useState(!1),[H,z]=y.useState(!1),{query:U,results:G,handleSearch:ve}=At({source:nt(i),onSearchCallback:h,isActive:he}),ge=U&&t.jsxs(r.Flex,{gap:"6",direction:"column",children:[G.length>0?t.jsx(r.Text,{color:"tints.uiGrey",children:`${G.length} Results`}):t.jsx(r.Text,{children:"We didn't find what you were looking for, click to shop all products."}),t.jsx(r.Flex,{gap:"6",flexDirection:["column",null,null,"row"],justifyContent:[null,null,null,"flex-start"],children:Array.from({length:Math.ceil(G.length/4)},(c,O)=>t.jsx(r.Flex,{direction:"column",gap:"6",children:G.slice(O*4,(O+1)*4).map((L,P)=>t.jsx(Re,{href:L.href,label:L.label,additionalContent:L==null?void 0:L.additionalContent,linkComponent:u},`${L.label}-${P}`))},O))})]}),be=y.useCallback(c=>{_e(c)},[]),le=()=>{pe(!1),Y(null)},me=c=>{Y(c)},Ce=c=>{re(!0),K(!1),(c.sections||c.spotlightCards)&&Y(c)},we=()=>{re(!1)};y.useEffect(()=>{const c=O=>{z(O.detail.isHovering)};return window.addEventListener(He,c),()=>{window.removeEventListener(He,c)}},[]),y.useEffect(()=>{!xe&&!H&&(Y(null),K(!1))},[xe,H]),y.useEffect(()=>{let c=window.location.href;const O=()=>{const P=window.location.href;P!==c&&(c=P,le(),Y(null))},L=setInterval(O,100);return window.addEventListener("popstate",O),()=>{window.removeEventListener("popstate",O),clearInterval(L)}},[]);const ke=()=>{Y(null),B==null||B()},Te=t.jsx(t.Fragment,{children:i==null?void 0:i.map((c,O)=>t.jsx(fe,{onMouseEnter:()=>{Ce(c),d==null||d(c.label)},onMouseLeave:we,isSelected:(S==null?void 0:S.label)===c.label,...c.buttonProps,children:c.label},`${c.label}-${O}`))}),ie=(je=i.filter(c=>c.isMobileTopLink!==!1))==null?void 0:je.map(c=>t.jsx(r.Box,{onClick:()=>{me(c),d==null||d(c.label)},children:t.jsx(Re,{label:c.label,role:"link",additionalContent:c.additionalContent,mainTextFontSize:"3xl",linkComponent:u})},c.label));nt(i);const ae=t.jsxs(t.Fragment,{children:[t.jsx(fe,{as:r.Link,href:R,width:"100%",backgroundColor:"tints.cream",onClick:A,children:t.jsxs(r.Flex,{gap:"2",children:["My Everly",t.jsx(r.Icon,{as:W.User,size:24})]})},"my-everly"),t.jsx(fe,{as:r.Link,width:"100%",href:C,backgroundColor:"tints.cream",onClick:$,children:t.jsxs(r.Flex,{gap:"2",children:["Register kit",t.jsx(r.Icon,{as:W.QrCode,size:24})]})},"register-kit")]}),J=t.jsxs(r.Flex,{gap:"2",flexDirection:"column",children:[s,ae]}),oe=S?t.jsx(r.Flex,{direction:["column",null,null,"row"],gap:"8",children:(se=S==null?void 0:S.sections)==null?void 0:se.map((c,O)=>{const L=[];for(let P=0;P<c.links.length;P+=3)L.push(c.links.slice(P,P+3));return t.jsxs(r.Box,{children:[t.jsx(r.Text,{fontSize:"md",color:"tints.uiGrey",marginBottom:[0,null,null,6],children:c.title}),t.jsx(r.Flex,{flexDirection:["column",null,null,"row"],gap:[null,null,null,8],children:L==null?void 0:L.map((P,Ee)=>t.jsx(r.Flex,{flexDirection:["column"],gap:[null,null,null,5],marginLeft:[null,null,null,-2],children:P==null?void 0:P.map(N=>t.jsx(Re,{label:N.label,href:N.href,additionalContent:N.additionalContent,linkComponent:u,onClick:()=>E==null?void 0:E(N.label)},N.label))},Ee))})]},`${c.title}-${O}`)})}):null,Q=S!=null&&S.spotlightCards?(ye=S.spotlightCards)==null?void 0:ye.map(c=>t.jsx(rt,{...c},c.title)):t.jsx(r.Box,{});return t.jsxs(t.Fragment,{children:[t.jsx(lt,{desktopTopButtons:Te,kitRegistrationElement:t.jsx(fe,{as:r.Link,href:C,onClick:$,backgroundColor:"tints.cream",children:"Register Kit"}),profileElement:t.jsx(r.Link,{href:R,"aria-label":"login",onClick:A,children:t.jsx(q,{icon:t.jsx(r.Icon,{as:W.User}),"aria-label":"Profile"})}),cartElement:t.jsx(it,{"aria-label":"Cart",count:m,onClick:o}),onSearchClick:()=>{K(!0),g==null||g()},onMenuClick:()=>{pe(!0),D==null||D()},hasSearch:j,logoLink:f,onHeightChange:be,linkComponent:u,onLogoClick:k}),t.jsx(Se,{isOpen:V,onClose:le,title:x,navDrawerLinks:ie,bottomNavButtons:J,hasBackButton:!1,navHeight:X}),t.jsx(Se,{isOpen:!!S,onClose:()=>Y(null),title:(S==null?void 0:S.label)||"",navDrawerLinks:oe,onBackClick:ke,spotlightCards:Q,hasOnlySpotlightCards:S==null?void 0:S.hasOnlySpotlightCards,navHeight:X,bottomButton:S==null?void 0:S.bottomButton}),t.jsx(Se,{isOpen:he,onClose:()=>K(!1),title:"Search",navHeight:X,navDrawerLinks:ge,onSearch:ve,hasSearch:!0,hasBackButton:!1})]})};exports.BasketButton=it;exports.CategoryLabel=Dt;exports.NavButton=fe;exports.NavSkeleton=Ft;exports.NavbarDrawer=Se;exports.NavbarDrawerLink=Re;exports.NavigationBar=Ht;exports.SpotlightCard=rt;exports.Stepper=Ot;exports.TopNavIconButton=q;exports.TopNavigation=lt;
|
package/index.mjs
CHANGED
|
@@ -18,16 +18,16 @@ function on() {
|
|
|
18
18
|
if (st)
|
|
19
19
|
return pe;
|
|
20
20
|
st = 1;
|
|
21
|
-
var l = Ye, a = Symbol.for("react.element"), h = Symbol.for("react.fragment"), d = Object.prototype.hasOwnProperty,
|
|
21
|
+
var l = Ye, a = Symbol.for("react.element"), h = Symbol.for("react.fragment"), d = Object.prototype.hasOwnProperty, w = l.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, x = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
22
22
|
function m(E, o, b) {
|
|
23
|
-
var s, p = {},
|
|
24
|
-
b !== void 0 && (
|
|
23
|
+
var s, p = {}, j = null, c = null;
|
|
24
|
+
b !== void 0 && (j = "" + b), o.key !== void 0 && (j = "" + o.key), o.ref !== void 0 && (c = o.ref);
|
|
25
25
|
for (s in o)
|
|
26
26
|
d.call(o, s) && !x.hasOwnProperty(s) && (p[s] = o[s]);
|
|
27
27
|
if (E && E.defaultProps)
|
|
28
28
|
for (s in o = E.defaultProps, o)
|
|
29
29
|
p[s] === void 0 && (p[s] = o[s]);
|
|
30
|
-
return { $$typeof: a, type: E, key:
|
|
30
|
+
return { $$typeof: a, type: E, key: j, ref: c, props: p, _owner: w.current };
|
|
31
31
|
}
|
|
32
32
|
return pe.Fragment = h, pe.jsx = m, pe.jsxs = m, pe;
|
|
33
33
|
}
|
|
@@ -44,7 +44,7 @@ var he = {};
|
|
|
44
44
|
var ut;
|
|
45
45
|
function sn() {
|
|
46
46
|
return ut || (ut = 1, process.env.NODE_ENV !== "production" && function() {
|
|
47
|
-
var l = Ye, a = Symbol.for("react.element"), h = Symbol.for("react.portal"), d = Symbol.for("react.fragment"),
|
|
47
|
+
var l = Ye, a = Symbol.for("react.element"), h = Symbol.for("react.portal"), d = Symbol.for("react.fragment"), w = Symbol.for("react.strict_mode"), x = Symbol.for("react.profiler"), m = Symbol.for("react.provider"), E = Symbol.for("react.context"), o = Symbol.for("react.forward_ref"), b = Symbol.for("react.suspense"), s = Symbol.for("react.suspense_list"), p = Symbol.for("react.memo"), j = Symbol.for("react.lazy"), c = Symbol.for("react.offscreen"), P = Symbol.iterator, A = "@@iterator";
|
|
48
48
|
function W(e) {
|
|
49
49
|
if (e === null || typeof e != "object")
|
|
50
50
|
return null;
|
|
@@ -72,7 +72,7 @@ function sn() {
|
|
|
72
72
|
var ve = !1, xe = !1, J = !1, R = !1, Y = !1, q;
|
|
73
73
|
q = Symbol.for("react.module.reference");
|
|
74
74
|
function ke(e) {
|
|
75
|
-
return !!(typeof e == "string" || typeof e == "function" || e === d || e === x || Y || e ===
|
|
75
|
+
return !!(typeof e == "string" || typeof e == "function" || e === d || e === x || Y || e === w || e === b || e === s || R || e === c || ve || xe || J || typeof e == "object" && e !== null && (e.$$typeof === j || e.$$typeof === p || e.$$typeof === m || e.$$typeof === E || e.$$typeof === o || // This needs to include all possible module reference object
|
|
76
76
|
// types supported by any Flight configuration anywhere since
|
|
77
77
|
// we don't know which Flight build this will end up being used
|
|
78
78
|
// with.
|
|
@@ -102,7 +102,7 @@ function sn() {
|
|
|
102
102
|
return "Portal";
|
|
103
103
|
case x:
|
|
104
104
|
return "Profiler";
|
|
105
|
-
case
|
|
105
|
+
case w:
|
|
106
106
|
return "StrictMode";
|
|
107
107
|
case b:
|
|
108
108
|
return "Suspense";
|
|
@@ -122,7 +122,7 @@ function sn() {
|
|
|
122
122
|
case p:
|
|
123
123
|
var i = e.displayName || null;
|
|
124
124
|
return i !== null ? i : $(e.type) || "Memo";
|
|
125
|
-
case
|
|
125
|
+
case j: {
|
|
126
126
|
var g = e, C = g._payload, v = g._init;
|
|
127
127
|
try {
|
|
128
128
|
return $(v(C));
|
|
@@ -133,14 +133,14 @@ function sn() {
|
|
|
133
133
|
}
|
|
134
134
|
return null;
|
|
135
135
|
}
|
|
136
|
-
var z = Object.assign, G = 0, Z, be, me, Ce, oe,
|
|
136
|
+
var z = Object.assign, G = 0, Z, be, me, Ce, oe, we, je;
|
|
137
137
|
function ye() {
|
|
138
138
|
}
|
|
139
139
|
ye.__reactDisabledLog = !0;
|
|
140
140
|
function Le() {
|
|
141
141
|
{
|
|
142
142
|
if (G === 0) {
|
|
143
|
-
Z = console.log, be = console.info, me = console.warn, Ce = console.error, oe = console.group,
|
|
143
|
+
Z = console.log, be = console.info, me = console.warn, Ce = console.error, oe = console.group, we = console.groupCollapsed, je = console.groupEnd;
|
|
144
144
|
var e = {
|
|
145
145
|
configurable: !0,
|
|
146
146
|
enumerable: !0,
|
|
@@ -185,10 +185,10 @@ function sn() {
|
|
|
185
185
|
value: oe
|
|
186
186
|
}),
|
|
187
187
|
groupCollapsed: z({}, e, {
|
|
188
|
-
value:
|
|
188
|
+
value: we
|
|
189
189
|
}),
|
|
190
190
|
groupEnd: z({}, e, {
|
|
191
|
-
value:
|
|
191
|
+
value: je
|
|
192
192
|
})
|
|
193
193
|
});
|
|
194
194
|
}
|
|
@@ -311,7 +311,7 @@ function sn() {
|
|
|
311
311
|
return Re(e.render);
|
|
312
312
|
case p:
|
|
313
313
|
return O(e.type, n, r);
|
|
314
|
-
case
|
|
314
|
+
case j: {
|
|
315
315
|
var i = e, g = i._payload, C = i._init;
|
|
316
316
|
try {
|
|
317
317
|
return O(C(g), n, r);
|
|
@@ -387,7 +387,7 @@ function sn() {
|
|
|
387
387
|
}
|
|
388
388
|
return e.ref !== void 0;
|
|
389
389
|
}
|
|
390
|
-
function
|
|
390
|
+
function wt(e) {
|
|
391
391
|
if (k.call(e, "key")) {
|
|
392
392
|
var n = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
393
393
|
if (n && n.isReactWarning)
|
|
@@ -395,7 +395,7 @@ function sn() {
|
|
|
395
395
|
}
|
|
396
396
|
return e.key !== void 0;
|
|
397
397
|
}
|
|
398
|
-
function
|
|
398
|
+
function jt(e, n) {
|
|
399
399
|
if (typeof e.ref == "string" && fe.current && n && fe.current.stateNode !== n) {
|
|
400
400
|
var r = $(fe.current.type);
|
|
401
401
|
De[r] || (S('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', $(fe.current.type), e.ref), De[r] = !0);
|
|
@@ -455,7 +455,7 @@ function sn() {
|
|
|
455
455
|
function _t(e, n, r, i, g) {
|
|
456
456
|
{
|
|
457
457
|
var C, v = {}, f = null, I = null;
|
|
458
|
-
r !== void 0 && (Ze(r), f = "" + r),
|
|
458
|
+
r !== void 0 && (Ze(r), f = "" + r), wt(n) && (Ze(n.key), f = "" + n.key), Ct(n) && (I = n.ref, jt(n, g));
|
|
459
459
|
for (C in n)
|
|
460
460
|
k.call(n, C) && !mt.hasOwnProperty(C) && (v[C] = n[C]);
|
|
461
461
|
if (e && e.defaultProps) {
|
|
@@ -650,7 +650,7 @@ const We = 60, ct = 6, un = (l) => {
|
|
|
650
650
|
activeStepIndex: a,
|
|
651
651
|
hideIndicators: h = !1,
|
|
652
652
|
steps: d,
|
|
653
|
-
stepperTheme:
|
|
653
|
+
stepperTheme: w = {
|
|
654
654
|
light: "eggplant.light",
|
|
655
655
|
base: "eggplant.base"
|
|
656
656
|
}
|
|
@@ -671,14 +671,14 @@ const We = 60, ct = 6, un = (l) => {
|
|
|
671
671
|
display: "flex",
|
|
672
672
|
flexWrap: "nowrap",
|
|
673
673
|
children: d.map((E, o) => {
|
|
674
|
-
const b = x === o, s = o === 0, p = o === d.length - 1,
|
|
674
|
+
const b = x === o, s = o === 0, p = o === d.length - 1, j = x > o;
|
|
675
675
|
let c = `${We}px`;
|
|
676
676
|
const P = `calc(100% - ((${We * (d.length - 1)}px) - (${d.length - 1} * ${ct * 2}px)))`;
|
|
677
677
|
return b ? c = P : (s || p) && (c = `${We - ct}px`), /* @__PURE__ */ t.jsx(
|
|
678
678
|
y,
|
|
679
679
|
{
|
|
680
680
|
width: c,
|
|
681
|
-
opacity:
|
|
681
|
+
opacity: j || b ? 1 : 0.2,
|
|
682
682
|
paddingRight: p ? "0" : "6px",
|
|
683
683
|
paddingLeft: s ? "0" : "6px",
|
|
684
684
|
transition: "width 0.4s ease-in-out, opacity 0.4s ease-in-out",
|
|
@@ -694,7 +694,7 @@ const We = 60, ct = 6, un = (l) => {
|
|
|
694
694
|
width: "100%",
|
|
695
695
|
position: "absolute",
|
|
696
696
|
top: "0",
|
|
697
|
-
backgroundColor:
|
|
697
|
+
backgroundColor: j ? w.light : w.base,
|
|
698
698
|
height: h ? "4px" : "8px",
|
|
699
699
|
borderRadius: "4",
|
|
700
700
|
left: "0"
|
|
@@ -709,7 +709,7 @@ const We = 60, ct = 6, un = (l) => {
|
|
|
709
709
|
}
|
|
710
710
|
) }
|
|
711
711
|
);
|
|
712
|
-
},
|
|
712
|
+
}, jn = Ye.memo(un), yn = ({
|
|
713
713
|
children: l,
|
|
714
714
|
...a
|
|
715
715
|
}) => /* @__PURE__ */ t.jsx(
|
|
@@ -727,7 +727,7 @@ const We = 60, ct = 6, un = (l) => {
|
|
|
727
727
|
const {
|
|
728
728
|
label: h,
|
|
729
729
|
additionalContent: d,
|
|
730
|
-
mainTextFontSize:
|
|
730
|
+
mainTextFontSize: w,
|
|
731
731
|
linkComponent: x,
|
|
732
732
|
href: m,
|
|
733
733
|
...E
|
|
@@ -769,7 +769,7 @@ const We = 60, ct = 6, un = (l) => {
|
|
|
769
769
|
/* @__PURE__ */ t.jsx(
|
|
770
770
|
U,
|
|
771
771
|
{
|
|
772
|
-
fontSize: [
|
|
772
|
+
fontSize: [w || "xl", null, null, "lg"],
|
|
773
773
|
fontWeight: "medium",
|
|
774
774
|
children: h
|
|
775
775
|
}
|
|
@@ -808,7 +808,7 @@ const We = 60, ct = 6, un = (l) => {
|
|
|
808
808
|
}
|
|
809
809
|
), Te = pt(
|
|
810
810
|
(l, a) => {
|
|
811
|
-
const { children: h, isSelected: d, ...
|
|
811
|
+
const { children: h, isSelected: d, ...w } = l, x = l.backgroundColor || (d ? "tints.lightCream" : "transparent");
|
|
812
812
|
return /* @__PURE__ */ t.jsx(
|
|
813
813
|
Wt,
|
|
814
814
|
{
|
|
@@ -831,7 +831,7 @@ const We = 60, ct = 6, un = (l) => {
|
|
|
831
831
|
textDecoration: "none",
|
|
832
832
|
filter: "brightness(0.95)"
|
|
833
833
|
},
|
|
834
|
-
...
|
|
834
|
+
...w,
|
|
835
835
|
children: h
|
|
836
836
|
}
|
|
837
837
|
);
|
|
@@ -841,13 +841,13 @@ const We = 60, ct = 6, un = (l) => {
|
|
|
841
841
|
description: a,
|
|
842
842
|
imageSrc: h,
|
|
843
843
|
imageElement: d,
|
|
844
|
-
button:
|
|
844
|
+
button: w,
|
|
845
845
|
backgroundColor: x = "viridian.wash",
|
|
846
846
|
onClick: m,
|
|
847
847
|
href: E,
|
|
848
848
|
linkComponent: o
|
|
849
849
|
}) => {
|
|
850
|
-
const b = "80px", s = "200px", p = "272px",
|
|
850
|
+
const b = "80px", s = "200px", p = "272px", j = o || X, c = Ue(E, !!o);
|
|
851
851
|
return /* @__PURE__ */ t.jsxs(
|
|
852
852
|
L,
|
|
853
853
|
{
|
|
@@ -870,7 +870,7 @@ const We = 60, ct = 6, un = (l) => {
|
|
|
870
870
|
border: "1px solid",
|
|
871
871
|
borderColor: "tints.white"
|
|
872
872
|
},
|
|
873
|
-
as:
|
|
873
|
+
as: j,
|
|
874
874
|
...c,
|
|
875
875
|
children: [
|
|
876
876
|
/* @__PURE__ */ t.jsx(
|
|
@@ -926,7 +926,7 @@ const We = 60, ct = 6, un = (l) => {
|
|
|
926
926
|
)
|
|
927
927
|
] }
|
|
928
928
|
),
|
|
929
|
-
/* @__PURE__ */ t.jsx(y, { display: ["none", null, null, "block"], children:
|
|
929
|
+
/* @__PURE__ */ t.jsx(y, { display: ["none", null, null, "block"], children: w })
|
|
930
930
|
]
|
|
931
931
|
}
|
|
932
932
|
)
|
|
@@ -983,7 +983,7 @@ const We = 60, ct = 6, un = (l) => {
|
|
|
983
983
|
kitRegistrationElement: a,
|
|
984
984
|
profileElement: h,
|
|
985
985
|
cartElement: d,
|
|
986
|
-
onSearchClick:
|
|
986
|
+
onSearchClick: w,
|
|
987
987
|
onMenuClick: x,
|
|
988
988
|
hasSearch: m = !1,
|
|
989
989
|
logoLink: E = "https://www.everlywell.com",
|
|
@@ -991,15 +991,15 @@ const We = 60, ct = 6, un = (l) => {
|
|
|
991
991
|
linkComponent: b,
|
|
992
992
|
onLogoClick: s
|
|
993
993
|
}) => {
|
|
994
|
-
const p = Zt(null), [
|
|
994
|
+
const p = Zt(null), [j, c] = V(0), P = 100, A = ze(() => {
|
|
995
995
|
if (p.current && o) {
|
|
996
996
|
const W = Date.now();
|
|
997
|
-
if (W -
|
|
997
|
+
if (W - j > P) {
|
|
998
998
|
const H = p.current.getBoundingClientRect().height;
|
|
999
999
|
o(H), c(W);
|
|
1000
1000
|
}
|
|
1001
1001
|
}
|
|
1002
|
-
}, [o,
|
|
1002
|
+
}, [o, j]);
|
|
1003
1003
|
return le(() => {
|
|
1004
1004
|
A();
|
|
1005
1005
|
const W = new ResizeObserver(() => {
|
|
@@ -1054,7 +1054,7 @@ const We = 60, ct = 6, un = (l) => {
|
|
|
1054
1054
|
{
|
|
1055
1055
|
"aria-label": "Search",
|
|
1056
1056
|
icon: /* @__PURE__ */ t.jsx(re, { as: ht }),
|
|
1057
|
-
onClick:
|
|
1057
|
+
onClick: w
|
|
1058
1058
|
}
|
|
1059
1059
|
) : null,
|
|
1060
1060
|
d,
|
|
@@ -1162,7 +1162,7 @@ const We = 60, ct = 6, un = (l) => {
|
|
|
1162
1162
|
onClose: a,
|
|
1163
1163
|
title: h,
|
|
1164
1164
|
navDrawerLinks: d,
|
|
1165
|
-
bottomNavButtons:
|
|
1165
|
+
bottomNavButtons: w,
|
|
1166
1166
|
spotlightCards: x,
|
|
1167
1167
|
bottomButton: m,
|
|
1168
1168
|
hasBackButton: E = !0,
|
|
@@ -1170,7 +1170,7 @@ const We = 60, ct = 6, un = (l) => {
|
|
|
1170
1170
|
hasOnlySpotlightCards: b = !1,
|
|
1171
1171
|
navHeight: s,
|
|
1172
1172
|
hasSearch: p = !1,
|
|
1173
|
-
onSearch:
|
|
1173
|
+
onSearch: j = () => {
|
|
1174
1174
|
}
|
|
1175
1175
|
}) => {
|
|
1176
1176
|
const c = Xt({
|
|
@@ -1182,7 +1182,7 @@ const We = 60, ct = 6, un = (l) => {
|
|
|
1182
1182
|
W((N) => N + 1);
|
|
1183
1183
|
}, S = ze(
|
|
1184
1184
|
hn((N) => {
|
|
1185
|
-
|
|
1185
|
+
j(N), H();
|
|
1186
1186
|
}, 100),
|
|
1187
1187
|
[]
|
|
1188
1188
|
);
|
|
@@ -1228,6 +1228,7 @@ const We = 60, ct = 6, un = (l) => {
|
|
|
1228
1228
|
overflow: "auto",
|
|
1229
1229
|
maxHeight: "100vh",
|
|
1230
1230
|
position: "relative",
|
|
1231
|
+
className: "navbar-drawer-content-container",
|
|
1231
1232
|
children: [
|
|
1232
1233
|
!p && c ? null : /* @__PURE__ */ t.jsxs(
|
|
1233
1234
|
Ut,
|
|
@@ -1366,7 +1367,7 @@ const We = 60, ct = 6, un = (l) => {
|
|
|
1366
1367
|
width: ["100%", null, null, "auto"],
|
|
1367
1368
|
children: [
|
|
1368
1369
|
d ? /* @__PURE__ */ t.jsx(y, { children: d }) : null,
|
|
1369
|
-
|
|
1370
|
+
w && !c ? /* @__PURE__ */ t.jsx(y, { children: w }) : null,
|
|
1370
1371
|
m ? /* @__PURE__ */ t.jsx(
|
|
1371
1372
|
y,
|
|
1372
1373
|
{
|
|
@@ -1396,37 +1397,37 @@ const We = 60, ct = 6, un = (l) => {
|
|
|
1396
1397
|
const a = /* @__PURE__ */ new Set();
|
|
1397
1398
|
return l.reduce((h, d) => {
|
|
1398
1399
|
var x;
|
|
1399
|
-
const
|
|
1400
|
+
const w = ((x = d.sections) == null ? void 0 : x.reduce((m, E) => {
|
|
1400
1401
|
const o = E.links.filter((b) => a.has(b.label) || b.isSearchable !== !0 ? !1 : (a.add(b.label), !0));
|
|
1401
1402
|
return [...m, ...o];
|
|
1402
1403
|
}, [])) ?? [];
|
|
1403
|
-
return [...h, ...
|
|
1404
|
+
return [...h, ...w];
|
|
1404
1405
|
}, []);
|
|
1405
1406
|
}, xn = ({
|
|
1406
1407
|
source: l,
|
|
1407
1408
|
onSearchCallback: a,
|
|
1408
1409
|
isActive: h
|
|
1409
1410
|
}) => {
|
|
1410
|
-
const [d,
|
|
1411
|
+
const [d, w] = V(""), [x, m] = V([]), E = (s, p) => {
|
|
1411
1412
|
if (!s)
|
|
1412
1413
|
return [];
|
|
1413
|
-
const
|
|
1414
|
+
const j = s.toLowerCase();
|
|
1414
1415
|
return p.filter((c) => {
|
|
1415
|
-
const P = c.label.toLowerCase().includes(
|
|
1416
|
+
const P = c.label.toLowerCase().includes(j), A = typeof c.additionalContent == "string" && c.additionalContent.toLowerCase().includes(j);
|
|
1416
1417
|
return P || A;
|
|
1417
1418
|
}).sort((c, P) => c.label.localeCompare(P.label));
|
|
1418
1419
|
}, o = (s) => {
|
|
1419
|
-
if (
|
|
1420
|
+
if (w(s), !s) {
|
|
1420
1421
|
m([]);
|
|
1421
1422
|
return;
|
|
1422
1423
|
}
|
|
1423
1424
|
const p = E(s, l);
|
|
1424
1425
|
m(p), a && a(s, p);
|
|
1425
1426
|
}, b = () => {
|
|
1426
|
-
|
|
1427
|
+
w(""), m([]);
|
|
1427
1428
|
};
|
|
1428
1429
|
return le(() => {
|
|
1429
|
-
h || (
|
|
1430
|
+
h || (w(""), m([]));
|
|
1430
1431
|
}, [h]), {
|
|
1431
1432
|
query: d,
|
|
1432
1433
|
results: x,
|
|
@@ -1438,7 +1439,7 @@ const We = 60, ct = 6, un = (l) => {
|
|
|
1438
1439
|
onCartClick: a,
|
|
1439
1440
|
mainCategoryLabel: h = "Menu",
|
|
1440
1441
|
logoLink: d = "https://www.everlywell.com",
|
|
1441
|
-
hasSearch:
|
|
1442
|
+
hasSearch: w = !0,
|
|
1442
1443
|
onSearchClick: x,
|
|
1443
1444
|
registrationUrl: m,
|
|
1444
1445
|
profileUrl: E = "https://secure.everlywell.com/login",
|
|
@@ -1446,7 +1447,7 @@ const We = 60, ct = 6, un = (l) => {
|
|
|
1446
1447
|
numberOfCartItems: b = 0,
|
|
1447
1448
|
linkComponent: s,
|
|
1448
1449
|
onSearchCallback: p,
|
|
1449
|
-
onLinkClick:
|
|
1450
|
+
onLinkClick: j,
|
|
1450
1451
|
onCategoryOpen: c,
|
|
1451
1452
|
onMobileMenuOpen: P,
|
|
1452
1453
|
onBackToMainMenu: A,
|
|
@@ -1502,9 +1503,9 @@ const We = 60, ct = 6, un = (l) => {
|
|
|
1502
1503
|
ke(u);
|
|
1503
1504
|
}, []), oe = () => {
|
|
1504
1505
|
ve(!1), Y(null);
|
|
1505
|
-
}, je = (u) => {
|
|
1506
|
-
Y(u);
|
|
1507
1506
|
}, we = (u) => {
|
|
1507
|
+
Y(u);
|
|
1508
|
+
}, je = (u) => {
|
|
1508
1509
|
ae(!0), J(!1), (u.sections || u.spotlightCards) && Y(u);
|
|
1509
1510
|
}, ye = () => {
|
|
1510
1511
|
ae(!1);
|
|
@@ -1543,7 +1544,7 @@ const We = 60, ct = 6, un = (l) => {
|
|
|
1543
1544
|
Te,
|
|
1544
1545
|
{
|
|
1545
1546
|
onMouseEnter: () => {
|
|
1546
|
-
|
|
1547
|
+
je(u), c == null || c(u.label);
|
|
1547
1548
|
},
|
|
1548
1549
|
onMouseLeave: ye,
|
|
1549
1550
|
isSelected: (R == null ? void 0 : R.label) === u.label,
|
|
@@ -1558,7 +1559,7 @@ const We = 60, ct = 6, un = (l) => {
|
|
|
1558
1559
|
y,
|
|
1559
1560
|
{
|
|
1560
1561
|
onClick: () => {
|
|
1561
|
-
|
|
1562
|
+
we(u), c == null || c(u.label);
|
|
1562
1563
|
},
|
|
1563
1564
|
children: /* @__PURE__ */ t.jsx(
|
|
1564
1565
|
Me,
|
|
@@ -1659,7 +1660,7 @@ const We = 60, ct = 6, un = (l) => {
|
|
|
1659
1660
|
href: B.href,
|
|
1660
1661
|
additionalContent: B.additionalContent,
|
|
1661
1662
|
linkComponent: s,
|
|
1662
|
-
onClick: () =>
|
|
1663
|
+
onClick: () => j == null ? void 0 : j(B.label)
|
|
1663
1664
|
},
|
|
1664
1665
|
B.label
|
|
1665
1666
|
)
|
|
@@ -1712,7 +1713,7 @@ const We = 60, ct = 6, un = (l) => {
|
|
|
1712
1713
|
onMenuClick: () => {
|
|
1713
1714
|
ve(!0), P == null || P();
|
|
1714
1715
|
},
|
|
1715
|
-
hasSearch:
|
|
1716
|
+
hasSearch: w,
|
|
1716
1717
|
logoLink: d,
|
|
1717
1718
|
onHeightChange: Ce,
|
|
1718
1719
|
linkComponent: s,
|
|
@@ -1770,7 +1771,7 @@ export {
|
|
|
1770
1771
|
Me as NavbarDrawerLink,
|
|
1771
1772
|
Rn as NavigationBar,
|
|
1772
1773
|
cn as SpotlightCard,
|
|
1773
|
-
|
|
1774
|
+
jn as Stepper,
|
|
1774
1775
|
ie as TopNavIconButton,
|
|
1775
1776
|
fn as TopNavigation
|
|
1776
1777
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NavbarDrawer.d.ts","sourceRoot":"","sources":["../../../../../../../libs/consumer-ui/src/lib/components/Navbar/NavbarDrawer/NavbarDrawer.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAgC,MAAM,OAAO,CAAC;AAarD,eAAO,MAAM,sBAAsB,qBAAqB,CAAC;AAGzD,eAAO,MAAM,wBAAwB,eAAgB,OAAO,SAQ3D,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B;;OAEG;IACH,MAAM,EAAE,OAAO,CAAC;IAChB;;OAEG;IACH,OAAO,EAAE,YAAY,CAAC;IACtB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,cAAc,EAAE,KAAK,CAAC,SAAS,CAAC;IAChC;;;OAGG;IACH,gBAAgB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACnC;;OAEG;IACH,cAAc,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACjC;;OAEG;IACH,YAAY,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC/B;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;;OAGG;IACH,WAAW,CAAC,EAAE,YAAY,CAAC;IAC3B;;;;OAIG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACpC,CAAC;AAkBF,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,
|
|
1
|
+
{"version":3,"file":"NavbarDrawer.d.ts","sourceRoot":"","sources":["../../../../../../../libs/consumer-ui/src/lib/components/Navbar/NavbarDrawer/NavbarDrawer.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAgC,MAAM,OAAO,CAAC;AAarD,eAAO,MAAM,sBAAsB,qBAAqB,CAAC;AAGzD,eAAO,MAAM,wBAAwB,eAAgB,OAAO,SAQ3D,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B;;OAEG;IACH,MAAM,EAAE,OAAO,CAAC;IAChB;;OAEG;IACH,OAAO,EAAE,YAAY,CAAC;IACtB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,cAAc,EAAE,KAAK,CAAC,SAAS,CAAC;IAChC;;;OAGG;IACH,gBAAgB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACnC;;OAEG;IACH,cAAc,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACjC;;OAEG;IACH,YAAY,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC/B;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;;OAGG;IACH,WAAW,CAAC,EAAE,YAAY,CAAC;IAC3B;;;;OAIG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACpC,CAAC;AAkBF,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAkPpD,CAAC;AACF,eAAe,YAAY,CAAC"}
|