@stenajs-webui/panels 25.3.0 → 25.3.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.
- package/dist/index.css +1 -1
- package/dist/index.es.js +133 -122
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +7 -7
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('./index.css');const e=require("react/jsx-runtime"),o=require("@stenajs-webui/elements"),x=require("react"),t=require("@stenajs-webui/core"),y=require("@stenajs-webui/tooltip"),F=require("@stenajs-webui/forms"),b=require("classnames"),d=require("@stenajs-webui/theme"),w=require("react-responsive"),D=require("yet-another-react-lightbox"),Y=require("yet-another-react-lightbox/plugins/inline"),ee=require("yet-another-react-lightbox/plugins/zoom"),ne=require("yet-another-react-lightbox/plugins/counter"),te=require("yet-another-react-lightbox/plugins/captions");function se(n){const s=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const r in n)if(r!=="default"){const a=Object.getOwnPropertyDescriptor(n,r);Object.defineProperty(s,r,a.get?a:{enumerable:!0,get:()=>n[r]})}}return s.default=n,Object.freeze(s)}const re=se(x),z=({renderItems:n,placement:s="bottom",buttonComponent:r,rightIcon:a=o.stenaAngleDown,menuWidth:l,menuTop:i,onClick:c,disableArrow:u=!1,buttonRef:p,appendTo:m,zIndex:j,disableTrapFocus:g=!1,...B})=>{const[v,S,C,f]=t.useBoolean(!1),h=x.useRef(null),k=p??h,M=x.useMemo(()=>({open:S,close:C}),[S,C]),J=P=>{c?.(P),f()};return e.jsx(e.Fragment,{children:e.jsx(y.ControlledPopover,{renderTrigger:P=>e.jsx(r,{rightIcon:u?void 0:a,...B,ref:k,onClick:J,...P}),hideArrow:!0,disablePadding:!0,open:v,onRequestClose:C,placement:s,appendTo:m,zIndex:j,children:v&&e.jsx(o.ActionMenu,{width:l,top:i,trapFocus:!g,children:e.jsx(o.ActionMenuContext.Provider,{value:M,children:n(C)})})})})},oe=n=>e.jsx(z,{buttonComponent:o.PrimaryButton,...n}),ae=n=>e.jsx(z,{buttonComponent:o.SecondaryButton,...n}),E=n=>e.jsx(z,{buttonComponent:o.FlatButton,...n}),le="1px solid var(--lhds-color-ui-300)",ie=({renderMenu:n,...s})=>e.jsx(y.Popover,{trigger:"click",renderTrigger:r=>e.jsx(t.Row,{children:e.jsxs(t.Row,{spacing:.5,indent:!0,alignItems:"center",border:le,borderRadius:"4px",children:[e.jsx(F.Checkbox,{...s}),e.jsx(t.Indent,{num:.5}),e.jsx(o.FlatButton,{size:"small",leftIcon:o.stenaAngleDown,...r})]})}),hideArrow:!0,disablePadding:!0,placement:"bottom-start",children:({onRequestClose:r})=>e.jsx(t.Column,{children:e.jsx(o.ActionMenu,{children:n(r)})})}),ce="_navBar_kzibd_1",ue={navBar:ce},de=({className:n,onClick:s})=>e.jsx(o.FlatButton,{leftIcon:o.stenaHamburger,className:n,onClick:s}),xe=({left:n,className:s,showMenuButton:r=!1,children:a,right:l,center:i,onClickMenuButton:c})=>{const u=i?1:void 0;return e.jsxs(t.Row,{justifyContent:"space-between",className:b(ue.navBar,s),children:[e.jsxs(t.Row,{flex:u,justifyContent:"flex-start",alignItems:"center",children:[r&&e.jsxs(t.Row,{width:"86px",alignItems:"center",children:[e.jsx(t.Indent,{}),e.jsx(de,{onClick:c})]}),n&&e.jsxs(e.Fragment,{children:[n,e.jsx(t.Indent,{num:2})]}),a&&e.jsx(e.Fragment,{children:e.jsx(t.Row,{justifyContent:"center",alignItems:"center",children:re.Children.map(a,(p,m)=>e.jsxs(e.Fragment,{children:[m>0&&e.jsx(t.Indent,{}),p]}))})})]}),i&&e.jsx(t.Row,{justifyContent:"center",alignItems:"center",children:i}),e.jsxs(t.Row,{justifyContent:"flex-end",alignItems:"center",flex:u,children:[l,e.jsx(t.Indent,{num:2})]})]})},he="_navBarButton_b3x3w_1",pe="_selected_b3x3w_14",L={navBarButton:he,selected:pe},$=x.forwardRef(function({selected:n,className:s,...r},a){return e.jsx(o.FlatButton,{...r,ref:a,className:b(L.navBarButton,n&&L.selected,s)})}),me="_navBarLink_1u1b2_1",je="_selected_1u1b2_14",q={navBarLink:me,selected:je},ge=x.forwardRef(function({selected:s,className:r,...a},l){return e.jsx(o.FlatButtonLink,{...a,ref:l,className:b(q.navBarLink,s&&q.selected,r)})}),Ce=n=>e.jsx(t.Heading,{whiteSpace:"nowrap",variant:"h4",as:"h1",...n}),be=({content:n,children:s,appendTo:r,zIndex:a,...l})=>{const[i,,c,u]=t.useBoolean(!1);return e.jsx(y.ControlledPopover,{renderTrigger:p=>e.jsx($,{...l,...p,onClick:u}),open:i,onRequestClose:c,zIndex:a,appendTo:r,children:e.jsxs(t.Box,{children:[n&&n({close:c}),s]})})},Be="_navBarNotificationButton_1nfdy_1",fe="_unread_1nfdy_23",ve="_icon_1nfdy_23",I={navBarNotificationButton:Be,unread:fe,icon:ve},Se=x.forwardRef(function({count:n,unread:s=!1,className:r,labelClassName:a,iconClassName:l,icon:i=o.stenaBellFilled,...c},u){const p=n>1;return e.jsx(o.BaseButton,{...c,ref:u,leftIcon:i,className:b(I.navBarNotificationButton,s&&I.unread,p&&I.hasCount,r),label:p?String(n):void 0,labelClassName:b(a,I.label),iconClassName:b(l,I.icon)})}),we="_navBarSearchFieldInput_1rp8g_1",ye="_navBarSearchFieldWrapper_1rp8g_12",Ie="_withButton_1rp8g_24",Re="_clearButton_1rp8g_33",R={navBarSearchFieldInput:we,navBarSearchFieldWrapper:ye,withButton:Ie,clearButton:Re},_e=({placeholder:n="Search",className:s,wrapperClassName:r,showClearButton:a,onClickClearButton:l,value:i,...c})=>e.jsx(F.TextInput,{wrapperClassName:b(R.navBarSearchFieldWrapper,a?R.withButton:void 0,r),className:b(R.navBarSearchFieldInput,s),placeholder:n,value:i,buttonRight:i&&a?e.jsx(o.TextInputButton,{className:R.clearButton,icon:o.stenaTimes,variant:"error",onClick:l}):void 0,...c}),ke="_navBarUserButton_10f9z_1",Me={navBarUserButton:ke},Pe=({className:n,username:s,initials:r,icon:a=o.stenaUserCircle,responsiveIconOnly:l=r==null,...i})=>e.jsx(E,{...i,className:b(Me.navBarUserButton,n),leftIcon:s!=null?a:void 0,label:r??s,forceRound:r!=null,responsiveIconOnly:l,disableArrow:!0}),W=x.forwardRef(({contentLeft:n,contentRight:s,collapsed:r=!1,...a},l)=>e.jsx(o.MenuButton,{ref:l,expandable:!0,expanded:!r,selected:!r,left:n,right:s,...a})),Ne=({children:n})=>e.jsx(t.Column,{gap:1,children:n}),Fe=({value:n,onValueChange:s,onChange:r,indeterminate:a,checkboxDisabled:l,...i})=>e.jsx(W,{contentLeft:e.jsx(F.Checkbox,{value:n,indeterminate:a,onValueChange:s,onChange:r,disabled:l,onClick:c=>c.stopPropagation()}),...i}),ze="_sidebarMenuCollapsibleGroupBox_ikek9_1",Te={sidebarMenuCollapsibleGroupBox:ze},U=({children:n})=>e.jsx("div",{className:Te.sidebarMenuCollapsibleGroupBox,children:n}),Ae=({children:n})=>e.jsx(t.Box,{spacing:!0,indent:!0,children:e.jsx(t.Text,{variant:"overline",size:"smaller",children:n})}),Le=({text:n="No content"})=>e.jsxs(t.Column,{indent:!0,spacing:!0,flex:1,alignItems:"center",children:[e.jsx(o.Icon,{icon:o.stenaMail,color:d.cssColor("--lhds-color-ui-500")}),e.jsx(t.Space,{}),e.jsx(t.Text,{size:"small",color:d.cssColor("--lhds-color-ui-500"),children:n})]}),G=({text:n,heading:s,children:r,buttons:a,icon:l=o.stenaTripFerryXl,headingLevel:i="h3",...c})=>{const u=!n&&!s?"Something unexpected happened.":n;return e.jsx(o.Card,{...c,children:e.jsx(o.CardBody,{children:e.jsxs(t.Column,{spacing:1,gap:3,alignItems:"center",children:[e.jsxs(t.Column,{alignItems:"center",children:[e.jsx(t.Space,{num:1}),e.jsx(o.CircledIcon,{icon:l,size:"xl"})]}),s&&e.jsx(t.Heading,{as:i,children:s}),u&&e.jsx(t.Text,{textAlign:"center",children:u}),r,a&&e.jsxs(t.Box,{children:[e.jsx(t.Space,{num:2}),e.jsx(t.Box,{gap:2,children:a})]})]})})})},qe=n=>e.jsx(t.Box,{width:"100%",height:"100%",spacing:6,justifyContent:"center",alignItems:"center",children:e.jsx(G,{...n})}),Q=({text:n,...s})=>e.jsxs(t.Box,{alignItems:"center",...t.getDataProps(s),children:[e.jsx(o.ScreenSpinner,{}),n&&e.jsxs(e.Fragment,{children:[e.jsx(t.Space,{num:4}),e.jsx(t.Heading,{variant:"h4",children:n})]})]}),He=n=>e.jsx(t.Box,{width:"100%",height:"100%",spacing:6,justifyContent:"center",alignItems:"center",children:e.jsx(Q,{...n})}),Oe=({renderBreadCrumbs:n,renderPageHeading:s,renderTabs:r,children:a})=>e.jsxs(t.Box,{shadow:"bottom",background:d.cssColor("--lhds-color-ui-50"),gap:2,children:[e.jsxs(t.Box,{indent:3,children:[n&&e.jsx(t.Row,{spacing:1,alignItems:"center",children:n()}),s?.(),r&&e.jsx(t.Space,{}),r?.()]}),a]}),De=n=>e.jsx(t.Row,{indent:3,spacing:!0,...n}),Ee=({icon:n,heading:s,headingLevel:r="h2",contentLeft:a,contentRight:l})=>e.jsxs(t.Row,{alignItems:"center",gap:2,height:"64px",children:[e.jsxs(t.Row,{alignItems:"center",children:[n&&e.jsx(t.Row,{width:"64px",alignItems:"center",children:e.jsx(o.CircledIcon,{icon:n})}),e.jsx(t.Heading,{variant:"h3",as:r,children:s})]}),e.jsx(t.Row,{alignItems:"center",children:a}),e.jsx(t.Row,{style:{marginLeft:"auto"},alignItems:"center",children:l})]}),$e="_selectionRow_eqiow_1",We="_iconColumn_eqiow_10",H={selectionRow:$e,iconColumn:We},Ue=({icon:n,heading:s,description:r,contentRight:a,htmlFor:l,circledIconVariant:i,...c})=>e.jsxs("div",{className:H.selectionRow,...t.getDataProps(c),children:[e.jsxs(t.Row,{gap:2,children:[n&&e.jsx(t.Box,{alignItems:"center",justifyContent:"center",width:"40px",className:H.iconColumn,children:e.jsx(o.CircledIcon,{icon:n,variant:i})}),e.jsx("label",{htmlFor:l,children:e.jsxs(t.Column,{gap:.5,children:[e.jsx(t.Text,{variant:"bold",children:s}),typeof r=="string"?e.jsx(t.Text,{color:d.cssColor("--silver-dark"),children:r}):r]})})]}),e.jsx(t.Row,{flex:1,justifyContent:"flex-end",children:a})]}),Ge="_sidebarMenu_1bx5w_1",Qe="_sidebarItems_1bx5w_38",Ve="_scrollContainer_1bx5w_48",N={sidebarMenu:Ge,sidebarItems:Qe,scrollContainer:Ve},Ke="_stenaFlag_108h7_1",Ze={stenaFlag:Ke},Xe=({onClick:n})=>e.jsxs(t.Column,{background:d.cssColor("--lhds-color-ui-50"),children:[e.jsx(t.Space,{}),e.jsxs(t.Row,{justifyContent:"space-between",alignItems:"center",flex:1,indent:1,minHeight:"48px",children:[e.jsx(o.CloseButton,{onClick:n}),e.jsx(o.StenaFlag,{className:Ze.stenaFlag})]})]}),Je=({isPinned:n,onClick:s,label:r})=>{const l=r??(n?"Unpin menu":"Pin menu"),i=n?o.stenaAngleLeftDouble:o.stenaPin;return e.jsx(o.MenuButton,{onClick:s,label:l,leftIcon:i})},Ye=({className:n,children:s,onCloseClick:r,pinButtonVisible:a,onClickPinButton:l,bottomItems:i,isPinned:c,...u})=>e.jsxs(t.Box,{...u,className:b(N.sidebarMenu,n),children:[e.jsx(Xe,{onClick:r}),e.jsx(t.Box,{className:N.scrollContainer,children:e.jsxs(t.Column,{className:N.sidebarItems,justifyContent:"space-between",flex:1,gap:1,indent:1,children:[e.jsx(t.Column,{gap:1,children:s}),(i||a)&&e.jsxs(t.Column,{gap:1,children:[i,a&&e.jsx(Je,{isPinned:c,onClick:l}),e.jsx(t.Space,{})]})]})})]}),_=x.createContext(!1),T=()=>x.useContext(_),en=({label:n,...s})=>e.jsx(y.Tooltip,{label:n,placement:"right",appendTo:document.body,children:e.jsx(o.IconMenuButton,{...s})}),nn=({closeButtonVisible:n,onClickCloseButton:s,onClickMenuButton:r,children:a,bottomItems:l,closeButtonTitle:i="Unpin menu"})=>e.jsxs(t.Box,{position:"fixed",left:0,top:0,bottom:0,indent:.5,spacing:1,gap:1,shadow:"popover",background:d.cssColor("--lhds-color-ui-50"),children:[e.jsx(o.IconMenuButton,{onClick:r,icon:o.stenaHamburger}),e.jsxs(t.Column,{justifyContent:"space-between",flex:1,gap:1,children:[e.jsx(t.Column,{gap:1,children:e.jsx(_.Provider,{value:!0,children:a})}),e.jsx(t.Column,{gap:1,children:(l||n)&&e.jsxs(_.Provider,{value:!0,children:[l,n&&e.jsx(en,{icon:o.stenaAngleLeftDouble,label:i,onClick:s})]})})]})]}),V=({label:n})=>T()?null:e.jsxs(t.Box,{height:"32px",justifyContent:"center",indent:1,children:[e.jsx(t.Space,{}),e.jsx(t.Text,{variant:"overline",size:"smaller",children:n})]}),tn=({label:n,leftIcon:s,...r})=>s==null?null:e.jsx(y.Tooltip,{label:n,placement:"right",children:e.jsx(o.IconMenuButtonLink,{icon:s,...r})}),sn=n=>T()?e.jsx(tn,{...n}):e.jsx(o.MenuButtonLink,{...n}),rn=({children:n,label:s,icon:r,popupMinWidth:a="200px"})=>e.jsx(y.Popover,{renderTrigger:l=>e.jsx(o.IconMenuButton,{icon:r,...l}),placement:"right-start",trigger:["hover","focus"],disablePadding:!0,children:e.jsx(t.Box,{minWidth:a,shadow:"popover",spacing:1,indent:1,gap:2,children:e.jsxs(_.Provider,{value:!1,children:[e.jsx(V,{label:s}),n]})})}),on=({children:n,label:s,leftIcon:r,className:a,initialExpand:l=!1})=>{const[i,c]=x.useState(l);return T()?r==null?null:e.jsx(rn,{label:s,icon:r,children:n}):e.jsx(o.MenuButton,{label:s,onClick:()=>c(!i),leftIcon:r,className:a,expandable:!0,expanded:i,selected:i,children:e.jsx(U,{children:n})})},an=n=>e.jsx(t.SeparatorLine,{color:d.cssColor("--lhds-color-ui-400"),...n}),ln=(n,s,r)=>n==null?"":(t.pluralFormatter(t.selectPluralRule(r))(n,s)??"").replace("{ITEMS}",String(n)),cn=({numItemsSelected:n,label:s,selectedLabel:r={one:"{ITEMS} item selected",other:"{ITEMS} items selected"},afterLabelContent:a,rightContent:l,localeId:i="en-GB"})=>{const c=ln(n,r,i);return e.jsxs(t.Row,{indent:3,spacing:!0,gap:3,minHeight:"56px",justifyContent:"space-between",alignItems:"center",background:d.cssColor("--silver-lighter"),flex:1,borderRadius:"var(--swui-border-radius)",children:[e.jsxs(t.Row,{alignItems:"center",gap:2,children:[n!=null||s!=null?e.jsx(t.Row,{alignItems:"center",children:n!=null?e.jsx(t.Text,{children:c}):s!=null?typeof s=="string"?e.jsx(t.Text,{children:s}):s:null}):null,a&&e.jsx(t.Row,{children:a})]}),e.jsx(t.Row,{gap:2,children:l})]})},un=({children:n})=>e.jsx(t.Row,{spacing:.5,indent:.5,flex:1,children:n}),dn="_productCard_19x6b_1",xn={productCard:dn},hn=({renderSelectedProductCard:n,renderEditButton:s,children:r,loading:a,shadow:l,...i})=>e.jsxs(t.Column,{"data-comp":"ProductCard",className:xn.productCard,shadow:l?"box":void 0,background:d.cssColor("--moln"),borderRadius:"24px",overflow:"hidden",position:a?"relative":void 0,...t.getDataProps(i),children:[n?.(),e.jsx(t.Column,{gap:2,children:r}),s&&e.jsxs(t.Column,{children:[e.jsx(t.Row,{indent:2,justifyContent:"flex-end",children:s()}),e.jsx(t.Spacing,{})]}),a&&e.jsx(t.Box,{top:0,bottom:0,left:0,right:0,position:"absolute",justifyContent:"center",alignItems:"center",background:"rgba(255, 255, 255, 0.7)",children:e.jsx(o.Spinner,{})})]}),pn=({children:n})=>e.jsx(t.Text,{variant:"bold",style:{fontSize:"2.0rem"},children:n}),mn=({description:n,subDescription:s,descriptionTags:r,capacityTag:a,offerCodeTag:l,priceText:i,title:c,subTitle:u,renderImage:p,children:m,headingLevel:j})=>{const g=r==null?!1:Array.isArray(r)?r.length>0:!t.isEmptyFragment(r);return e.jsxs(t.Column,{children:[p?.(),e.jsxs(t.Box,{gap:2,spacing:4,indent:4,background:d.cssColor("--moln"),children:[e.jsxs(t.Box,{gap:.5,children:[e.jsxs(t.Row,{justifyContent:"space-between",alignItems:"flex-start",gap:2,children:[e.jsx(t.Heading,{variant:"h3",as:j,children:c}),e.jsxs(t.Row,{gap:2,children:[l&&e.jsx(t.Column,{justifyContent:"center",children:l}),e.jsx(pn,{children:i})]})]}),u&&e.jsx(t.Text,{variant:"bold",color:d.cssColor("--silver-dark"),children:u})]}),(g||a)&&e.jsxs(t.Column,{children:[e.jsxs(t.Row,{gap:1,flexWrap:"wrap",children:[r,a&&e.jsx(o.Tag,{label:a,variant:"passive"})]}),e.jsx(t.Space,{})]}),n&&e.jsxs(t.Column,{children:[e.jsx(t.Text,{children:n}),e.jsx(t.Space,{})]}),s&&e.jsxs(t.Column,{children:[e.jsx(t.Text,{children:s}),e.jsx(t.Space,{})]}),m]})]})},jn=({renderImage:n})=>e.jsxs(t.Column,{children:[n?.(),e.jsxs(t.Box,{gap:3,spacing:4,indent:4,background:d.cssColor("--moln"),children:[e.jsx(t.Box,{gap:.5,children:e.jsx(t.Row,{justifyContent:"space-between",alignItems:"flex-start",gap:2,children:e.jsx(o.ShimmerBox,{width:"50px",height:"2.8rem",borderRadius:"8px"})})}),e.jsx(t.Column,{children:e.jsx(o.ShimmerBox,{width:"180px",height:"2.0rem",borderRadius:"8px"})}),e.jsx(t.Column,{children:e.jsx(o.ShimmerBox,{width:"150px",height:"1.4rem",borderRadius:"8px"})})]})]}),gn=({label:n,children:s})=>e.jsxs(t.Box,{background:d.cssColor("--mussla"),indent:2,spacing:2,gap:2,children:[e.jsx(t.Heading,{variant:"h3",as:"h2",color:"white",children:n}),s]}),Cn=({title:n,variant:s="normal",loading:r,iconLeft:a,compactIconLeft:l,renderLeft:i,renderButton:c,renderOfferCodeTag:u,renderMandatoryTag:p,renderContentLeftOfButton:m,children:j,...g})=>{const{fontSizeRatio:B}=t.useAccessibleFontSizeContext(),v=w.useMediaQuery({query:"(max-width: 460px)"}),C=w.useMediaQuery({query:"(max-width: 360px)"})||v&&B>1.2,f=r?"normal":s,h=Bn(f),k=d.cssColor("--moln"),M=bn(f);return e.jsxs(t.Box,{"data-comp":"ProductSummaryCard",borderRadius:"16px",shadow:"box",overflow:"hidden",position:r?"relative":void 0,...t.getDataProps(g),children:[e.jsxs(t.Row,{flex:1,children:[!C&&e.jsxs(t.Box,{flex:2,justifyContent:"center",background:h,children:[i?.(),a&&e.jsx(o.Icon,{color:M,icon:a,size:73})]}),e.jsx(t.Box,{flex:4,indent:2,spacing:2,background:k,children:e.jsxs(t.Column,{gap:2,children:[n&&e.jsxs(t.Row,{justifyContent:"space-between",children:[e.jsxs(t.Row,{gap:2,alignItems:"center",children:[C&&l&&e.jsx(o.CircledIcon,{icon:l,size:"medium"}),e.jsx(t.Text,{variant:"bold",size:"large",children:n})]}),f=="normal"&&u?.()]}),e.jsx(t.Column,{style:{opacity:r?0:void 0},children:j}),p&&e.jsx(t.Row,{style:{opacity:r?0:void 0},children:p()}),e.jsx("div",{}),e.jsxs(t.Row,{justifyContent:"space-between",alignItems:"center",gap:2,flexWrap:"wrap",children:[m?.()??e.jsx("div",{}),c?.()]})]})})]}),r&&e.jsx(t.Box,{top:0,bottom:0,left:0,right:0,position:"absolute",justifyContent:"center",alignItems:"center",background:"rgba(255, 255, 255, 0.7)",children:e.jsx(o.Spinner,{})})]})},bn=n=>{switch(n){case"edit":return d.cssColor("--moln");case"upgrade":return d.cssColor("--moln");case"normal":return d.cssColor("--mussla");default:t.exhaustSwitchCaseElseThrow(n)}},Bn=n=>{switch(n){case"edit":return d.cssColor("--mussla");case"upgrade":return d.cssColor("--mussla");case"normal":return d.cssColor("--silver-lighter");default:t.exhaustSwitchCaseElseThrow(n)}},fn="_productSummaryCardImage_1knc7_1",vn={productSummaryCardImage:fn},K=({src:n,alt:s})=>e.jsx("img",{src:n,alt:s,className:vn.productSummaryCardImage}),Sn="_productSummaryCardImageButton_1mznn_11",wn={productSummaryCardImageButton:Sn},yn=({onClick:n,ariaLabel:s,...r})=>e.jsx("button",{type:"button",className:wn.productSummaryCardImageButton,"aria-label":s,onClick:n,children:e.jsx(K,{...r})}),In=({iconLeft:n,...s})=>e.jsx(t.Box,{borderRadius:"16px",shadow:"box",overflow:"hidden",...t.getDataProps(s),children:e.jsxs(t.Row,{flex:1,children:[e.jsx(t.Box,{flex:2,justifyContent:"center",background:d.cssColor("--silver-lighter"),children:n&&e.jsx(o.Icon,{color:d.cssColor("--mussla"),icon:n,size:73})}),e.jsx(t.Box,{flex:4,indent:2,spacing:2,background:d.cssColor("--moln"),children:e.jsxs(t.Column,{gap:2,children:[e.jsx(o.ShimmerBox,{width:"180px",height:"2.8rem",borderRadius:"8px"}),e.jsx(o.ShimmerBox,{width:"50px",height:"2.0rem",borderRadius:"8px"}),e.jsx(o.ShimmerBox,{width:"150px",height:"1.4rem",borderRadius:"8px"})]})})]})}),O=["small-mobile","mobile","tablet","tablet-wide","desktop"],A=()=>{const n=w.useMediaQuery({query:"(max-width: 768px)"}),s=w.useMediaQuery({query:"(max-width: 395px)"}),r=w.useMediaQuery({query:"(max-width: 1024px)"}),a=w.useMediaQuery({query:"(max-width: 1160px)"});return{deviceSize:s?"small-mobile":n?"mobile":r?"tablet":a?"tablet-wide":"desktop"}},Z=(n,s)=>n===s||O.indexOf(n)>O.indexOf(s),Rn=n=>{const{deviceSize:s}=A();return{visible:x.useMemo(()=>Z(s,n),[s,n])}},X=({isOpen:n,initialIndex:s,onUpdateIndex:r,altLabelPrevious:a,altLabelZoomIn:l,altLabelZoomOut:i,altLabelNext:c,altLabelClose:u,onRequestClose:p,images:m})=>{const j=x.useRef(null),{deviceSize:g}=A(),B=g!=="mobile",[v,S]=x.useState(s??0),C=({index:h})=>{S(h),r?.(h)},f=x.useMemo(()=>m.map(h=>_n(h)),[m]);return e.jsx(D,{open:n,close:p,index:v,plugins:[ee,ne,te],slides:f,on:{view:C},animation:{fade:0},controller:{closeOnPullDown:!0,closeOnBackdropClick:!0,ref:j},counter:{container:{style:{filter:"none",color:"white",fontSize:"2.0rem",fontFamily:"var(--swui-font-primary)"}}},render:{buttonZoom:h=>B&&e.jsxs(t.Row,{gap:1,indent:2,children:[e.jsx(o.SecondaryButton,{"aria-label":l,leftIcon:o.stenaSearchPlus,size:"large",onClick:()=>h.zoomIn()}),e.jsx(o.SecondaryButton,{"aria-label":i,leftIcon:o.stenaSearchMinus,size:"large",onClick:()=>h.zoomOut()})]}),buttonPrev:()=>m.length>1&&B&&e.jsx(t.Indent,{num:4,className:"yarl__navigation_prev",children:e.jsx(o.SecondaryButton,{"aria-label":a,leftIcon:o.stenaAngleLeft,size:"large",onClick:()=>j.current?.prev()})}),buttonNext:()=>m.length>1&&B&&e.jsx(t.Indent,{num:4,className:"yarl__navigation_next",children:e.jsx(o.SecondaryButton,{"aria-label":c,leftIcon:o.stenaAngleRight,size:"large",onClick:()=>j.current?.next()})}),buttonClose:()=>e.jsx(t.Indent,{children:e.jsx(o.PrimaryButton,{variant:"danger","aria-label":u,leftIcon:o.stenaTimesThick,size:"large",onClick:()=>j.current?.close()})})}})},_n=n=>({src:n.url,width:n.width,height:n.height,alt:n.alt,title:n.title,description:n.description}),kn=({images:n,initialIndex:s,altLabelPrevious:r,altLabelZoomIn:a,altLabelZoomOut:l,altLabelNext:i,altLabelClose:c})=>{const u=x.useRef(null),[p,m]=x.useState(!1),[j,g]=x.useState(s??0),B=x.useCallback(()=>{m(!0)},[]),v=x.useCallback(()=>{m(!1)},[]),S=({index:h})=>g(h);x.useEffect(()=>{g(s??0)},[s]);const C=x.useMemo(()=>n.map(Mn),[n]),f=x.useMemo(()=>n.map(h=>h.fullscreenImage?{...h,url:h.fullscreenImage.url,width:h.fullscreenImage.width,height:h.fullscreenImage.height}:h),[n]);return e.jsxs(t.BlockKeyboardEvents,{blockedKeys:"Escape",children:[e.jsx(D,{controller:{ref:u},index:j,slides:C,plugins:[Y],on:{view:S,click:B},carousel:{padding:0,spacing:0,imageFit:"cover"},render:{buttonPrev:()=>n.length>1&&e.jsx(t.Indent,{className:"yarl__navigation_prev",children:e.jsx(o.SecondaryButton,{"aria-label":r,leftIcon:o.stenaAngleLeft,onClick:()=>u.current?.prev()})}),buttonNext:()=>n.length>1&&e.jsx(t.Indent,{className:"yarl__navigation_next",children:e.jsx(o.SecondaryButton,{"aria-label":i,leftIcon:o.stenaAngleRight,onClick:()=>u.current?.next()})})},styles:{button:{filter:"none"}},inline:{style:{width:"100%",maxWidth:"900px",aspectRatio:"3 / 2",margin:"0 auto"}}}),p&&e.jsx(X,{isOpen:!0,onRequestClose:v,initialIndex:j,onUpdateIndex:g,images:f,altLabelPrevious:r,altLabelNext:i,altLabelClose:c,altLabelZoomIn:a,altLabelZoomOut:l})]})},Mn=n=>({src:n.url,width:n.width,height:n.height,alt:n.alt,title:n.title,description:n.description});exports.ActionMenuFlatButton=E;exports.ActionMenuPrimaryButton=oe;exports.ActionMenuSecondaryButton=ae;exports.CheckboxMenu=ie;exports.Collapsible=W;exports.CollapsibleEmptyContent=Le;exports.CollapsibleGroupHeading=Ae;exports.CollapsibleList=Ne;exports.CollapsibleWithCheckbox=Fe;exports.ErrorPanel=G;exports.ErrorScreen=qe;exports.FullscreenImageCarousel=X;exports.ImageCarousel=kn;exports.LoadingPanel=Q;exports.LoadingScreen=He;exports.NavBar=xe;exports.NavBarButton=$;exports.NavBarHeading=Ce;exports.NavBarLink=ge;exports.NavBarNotificationButton=Se;exports.NavBarPopoverButton=be;exports.NavBarSearchField=_e;exports.NavBarUserButton=Pe;exports.PageHeader=Oe;exports.PageHeaderRow=De;exports.PageHeading=Ee;exports.ProductCard=hn;exports.ProductCardContentItem=mn;exports.ProductCardContentItemSkeletor=jn;exports.ProductSummaryCard=Cn;exports.ProductSummaryCardImage=K;exports.ProductSummaryCardImageButton=yn;exports.ProductSummaryCardSkeletor=In;exports.SelectedItemsActionsPadding=un;exports.SelectedItemsActionsPanel=cn;exports.SelectedProductCard=gn;exports.SelectionRow=Ue;exports.SidebarMenu=Ye;exports.SidebarMenuCollapsible=on;exports.SidebarMenuCollapsibleGroupBox=U;exports.SidebarMenuHeading=V;exports.SidebarMenuLink=sn;exports.SidebarMenuSeparator=an;exports.SidebarRailMenu=nn;exports.isDeviceSameOrLarger=Z;exports.useDeviceSize=A;exports.useLayoutVisibility=Rn;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('./index.css');const e=require("react/jsx-runtime"),o=require("@stenajs-webui/elements"),x=require("react"),t=require("@stenajs-webui/core"),y=require("@stenajs-webui/tooltip"),F=require("@stenajs-webui/forms"),b=require("classnames"),d=require("@stenajs-webui/theme"),w=require("react-responsive"),D=require("yet-another-react-lightbox"),Y=require("yet-another-react-lightbox/plugins/inline"),ee=require("yet-another-react-lightbox/plugins/zoom"),ne=require("yet-another-react-lightbox/plugins/counter"),te=require("yet-another-react-lightbox/plugins/captions");function se(n){const s=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const r in n)if(r!=="default"){const a=Object.getOwnPropertyDescriptor(n,r);Object.defineProperty(s,r,a.get?a:{enumerable:!0,get:()=>n[r]})}}return s.default=n,Object.freeze(s)}const re=se(x),z=({renderItems:n,placement:s="bottom",buttonComponent:r,rightIcon:a=o.stenaAngleDown,menuWidth:l,menuTop:i,onClick:c,disableArrow:u=!1,buttonRef:p,appendTo:m,zIndex:j,disableTrapFocus:g=!1,...B})=>{const[v,S,C,f]=t.useBoolean(!1),h=x.useRef(null),k=p??h,M=x.useMemo(()=>({open:S,close:C}),[S,C]),J=P=>{c?.(P),f()};return e.jsx(e.Fragment,{children:e.jsx(y.ControlledPopover,{renderTrigger:P=>e.jsx(r,{rightIcon:u?void 0:a,...B,ref:k,onClick:J,...P}),hideArrow:!0,disablePadding:!0,open:v,onRequestClose:C,placement:s,appendTo:m,zIndex:j,children:v&&e.jsx(o.ActionMenu,{width:l,top:i,trapFocus:!g,children:e.jsx(o.ActionMenuContext.Provider,{value:M,children:n(C)})})})})},oe=n=>e.jsx(z,{buttonComponent:o.PrimaryButton,...n}),ae=n=>e.jsx(z,{buttonComponent:o.SecondaryButton,...n}),$=n=>e.jsx(z,{buttonComponent:o.FlatButton,...n}),le="1px solid var(--lhds-color-ui-300)",ie=({renderMenu:n,...s})=>e.jsx(y.Popover,{trigger:"click",renderTrigger:r=>e.jsx(t.Row,{children:e.jsxs(t.Row,{spacing:.5,indent:!0,alignItems:"center",border:le,borderRadius:"4px",children:[e.jsx(F.Checkbox,{...s}),e.jsx(t.Indent,{num:.5}),e.jsx(o.FlatButton,{size:"small",leftIcon:o.stenaAngleDown,...r})]})}),hideArrow:!0,disablePadding:!0,placement:"bottom-start",children:({onRequestClose:r})=>e.jsx(t.Column,{children:e.jsx(o.ActionMenu,{children:n(r)})})}),ce="_navBar_kzibd_1",ue={navBar:ce},de=({className:n,onClick:s})=>e.jsx(o.FlatButton,{leftIcon:o.stenaHamburger,className:n,onClick:s}),xe=({left:n,className:s,showMenuButton:r=!1,children:a,right:l,center:i,onClickMenuButton:c})=>{const u=i?1:void 0;return e.jsxs(t.Row,{justifyContent:"space-between",className:b(ue.navBar,s),children:[e.jsxs(t.Row,{flex:u,justifyContent:"flex-start",alignItems:"center",children:[r&&e.jsxs(t.Row,{width:"86px",alignItems:"center",children:[e.jsx(t.Indent,{}),e.jsx(de,{onClick:c})]}),n&&e.jsxs(e.Fragment,{children:[n,e.jsx(t.Indent,{num:2})]}),a&&e.jsx(e.Fragment,{children:e.jsx(t.Row,{justifyContent:"center",alignItems:"center",children:re.Children.map(a,(p,m)=>e.jsxs(e.Fragment,{children:[m>0&&e.jsx(t.Indent,{}),p]}))})})]}),i&&e.jsx(t.Row,{justifyContent:"center",alignItems:"center",children:i}),e.jsxs(t.Row,{justifyContent:"flex-end",alignItems:"center",flex:u,children:[l,e.jsx(t.Indent,{num:2})]})]})},he="_navBarButton_b3x3w_1",pe="_selected_b3x3w_14",L={navBarButton:he,selected:pe},E=x.forwardRef(function({selected:n,className:s,...r},a){return e.jsx(o.FlatButton,{...r,ref:a,className:b(L.navBarButton,n&&L.selected,s)})}),me="_navBarLink_1u1b2_1",je="_selected_1u1b2_14",q={navBarLink:me,selected:je},ge=x.forwardRef(function({selected:s,className:r,...a},l){return e.jsx(o.FlatButtonLink,{...a,ref:l,className:b(q.navBarLink,s&&q.selected,r)})}),Ce=n=>e.jsx(t.Heading,{whiteSpace:"nowrap",variant:"h4",as:"h1",...n}),be=({content:n,children:s,appendTo:r,zIndex:a,...l})=>{const[i,,c,u]=t.useBoolean(!1);return e.jsx(y.ControlledPopover,{renderTrigger:p=>e.jsx(E,{...l,...p,onClick:u}),open:i,onRequestClose:c,zIndex:a,appendTo:r,children:e.jsxs(t.Box,{children:[n&&n({close:c}),s]})})},Be="_navBarNotificationButton_1nfdy_1",fe="_unread_1nfdy_23",ve="_icon_1nfdy_23",I={navBarNotificationButton:Be,unread:fe,icon:ve},Se=x.forwardRef(function({count:n,unread:s=!1,className:r,labelClassName:a,iconClassName:l,icon:i=o.stenaBellFilled,...c},u){const p=n>1;return e.jsx(o.BaseButton,{...c,ref:u,leftIcon:i,className:b(I.navBarNotificationButton,s&&I.unread,p&&I.hasCount,r),label:p?String(n):void 0,labelClassName:b(a,I.label),iconClassName:b(l,I.icon)})}),we="_navBarSearchFieldInput_1rp8g_1",ye="_navBarSearchFieldWrapper_1rp8g_12",Ie="_withButton_1rp8g_24",Re="_clearButton_1rp8g_33",R={navBarSearchFieldInput:we,navBarSearchFieldWrapper:ye,withButton:Ie,clearButton:Re},_e=({placeholder:n="Search",className:s,wrapperClassName:r,showClearButton:a,onClickClearButton:l,value:i,...c})=>e.jsx(F.TextInput,{wrapperClassName:b(R.navBarSearchFieldWrapper,a?R.withButton:void 0,r),className:b(R.navBarSearchFieldInput,s),placeholder:n,value:i,buttonRight:i&&a?e.jsx(o.TextInputButton,{className:R.clearButton,icon:o.stenaTimes,variant:"error",onClick:l}):void 0,...c}),ke="_navBarUserButton_10f9z_1",Me={navBarUserButton:ke},Pe=({className:n,username:s,initials:r,icon:a=o.stenaUserCircle,responsiveIconOnly:l=r==null,...i})=>e.jsx($,{...i,className:b(Me.navBarUserButton,n),leftIcon:s!=null?a:void 0,label:r??s,forceRound:r!=null,responsiveIconOnly:l,disableArrow:!0}),W=x.forwardRef(({contentLeft:n,contentRight:s,collapsed:r=!1,...a},l)=>e.jsx(o.MenuButton,{ref:l,expandable:!0,expanded:!r,selected:!r,left:n,right:s,...a})),Ne=({children:n})=>e.jsx(t.Column,{gap:1,children:n}),Fe=({value:n,onValueChange:s,onChange:r,indeterminate:a,checkboxDisabled:l,...i})=>e.jsx(W,{contentLeft:e.jsx(F.Checkbox,{value:n,indeterminate:a,onValueChange:s,onChange:r,disabled:l,onClick:c=>c.stopPropagation()}),...i}),ze="_sidebarMenuCollapsibleGroupBox_ikek9_1",Te={sidebarMenuCollapsibleGroupBox:ze},U=({children:n})=>e.jsx("div",{className:Te.sidebarMenuCollapsibleGroupBox,children:n}),Ae=({children:n})=>e.jsx(t.Box,{spacing:!0,indent:!0,children:e.jsx(t.Text,{variant:"overline",size:"smaller",children:n})}),Le=({text:n="No content"})=>e.jsxs(t.Column,{indent:!0,spacing:!0,flex:1,alignItems:"center",children:[e.jsx(o.Icon,{icon:o.stenaMail,color:d.cssColor("--lhds-color-ui-500")}),e.jsx(t.Space,{}),e.jsx(t.Text,{size:"small",color:d.cssColor("--lhds-color-ui-500"),children:n})]}),G=({text:n,heading:s,children:r,buttons:a,icon:l=o.stenaTripFerryXl,headingLevel:i="h3",...c})=>{const u=!n&&!s?"Something unexpected happened.":n;return e.jsx(o.Card,{...c,children:e.jsx(o.CardBody,{children:e.jsxs(t.Column,{spacing:1,gap:3,alignItems:"center",children:[e.jsxs(t.Column,{alignItems:"center",children:[e.jsx(t.Space,{num:1}),e.jsx(o.CircledIcon,{icon:l,size:"xl"})]}),s&&e.jsx(t.Heading,{as:i,children:s}),u&&e.jsx(t.Text,{textAlign:"center",children:u}),r,a&&e.jsxs(t.Box,{children:[e.jsx(t.Space,{num:2}),e.jsx(t.Box,{gap:2,children:a})]})]})})})},qe=n=>e.jsx(t.Box,{width:"100%",height:"100%",spacing:6,justifyContent:"center",alignItems:"center",children:e.jsx(G,{...n})}),Q=({text:n,...s})=>e.jsxs(t.Box,{alignItems:"center",...t.getDataProps(s),children:[e.jsx(o.ScreenSpinner,{}),n&&e.jsxs(e.Fragment,{children:[e.jsx(t.Space,{num:4}),e.jsx(t.Heading,{variant:"h4",children:n})]})]}),He=n=>e.jsx(t.Box,{width:"100%",height:"100%",spacing:6,justifyContent:"center",alignItems:"center",children:e.jsx(Q,{...n})}),Oe=({renderBreadCrumbs:n,renderPageHeading:s,renderTabs:r,children:a})=>e.jsxs(t.Box,{shadow:"bottom",background:d.cssColor("--lhds-color-ui-50"),gap:2,children:[e.jsxs(t.Box,{indent:3,children:[n&&e.jsx(t.Row,{spacing:1,alignItems:"center",children:n()}),s?.(),r&&e.jsx(t.Space,{}),r?.()]}),a]}),De=n=>e.jsx(t.Row,{indent:3,spacing:!0,...n}),$e=({icon:n,heading:s,headingLevel:r="h2",contentLeft:a,contentRight:l})=>e.jsxs(t.Row,{alignItems:"center",gap:2,height:"64px",children:[e.jsxs(t.Row,{alignItems:"center",children:[n&&e.jsx(t.Row,{width:"64px",alignItems:"center",children:e.jsx(o.CircledIcon,{icon:n})}),e.jsx(t.Heading,{variant:"h3",as:r,children:s})]}),e.jsx(t.Row,{alignItems:"center",children:a}),e.jsx(t.Row,{style:{marginLeft:"auto"},alignItems:"center",children:l})]}),Ee="_selectionRow_eqiow_1",We="_iconColumn_eqiow_10",H={selectionRow:Ee,iconColumn:We},Ue=({icon:n,heading:s,description:r,contentRight:a,htmlFor:l,circledIconVariant:i,...c})=>e.jsxs("div",{className:H.selectionRow,...t.getDataProps(c),children:[e.jsxs(t.Row,{gap:2,children:[n&&e.jsx(t.Box,{alignItems:"center",justifyContent:"center",width:"40px",className:H.iconColumn,children:e.jsx(o.CircledIcon,{icon:n,variant:i})}),e.jsx("label",{htmlFor:l,children:e.jsxs(t.Column,{gap:.5,children:[e.jsx(t.Text,{variant:"bold",children:s}),typeof r=="string"?e.jsx(t.Text,{color:d.cssColor("--silver-dark"),children:r}):r]})})]}),e.jsx(t.Row,{flex:1,justifyContent:"flex-end",children:a})]}),Ge="_sidebarMenu_1bx5w_1",Qe="_sidebarItems_1bx5w_38",Ve="_scrollContainer_1bx5w_48",N={sidebarMenu:Ge,sidebarItems:Qe,scrollContainer:Ve},Ke="_stenaFlag_108h7_1",Ze={stenaFlag:Ke},Xe=({onClick:n})=>e.jsxs(t.Column,{background:d.cssColor("--lhds-color-ui-50"),children:[e.jsx(t.Space,{}),e.jsxs(t.Row,{justifyContent:"space-between",alignItems:"center",flex:1,indent:1,minHeight:"48px",children:[e.jsx(o.CloseButton,{onClick:n}),e.jsx(o.StenaFlag,{className:Ze.stenaFlag})]})]}),Je=({isPinned:n,onClick:s,label:r})=>{const l=r??(n?"Unpin menu":"Pin menu"),i=n?o.stenaAngleLeftDouble:o.stenaPin;return e.jsx(o.MenuButton,{onClick:s,label:l,leftIcon:i})},Ye=({className:n,children:s,onCloseClick:r,pinButtonVisible:a,onClickPinButton:l,bottomItems:i,isPinned:c,...u})=>e.jsxs(t.Box,{...u,className:b(N.sidebarMenu,n),children:[e.jsx(Xe,{onClick:r}),e.jsx(t.Box,{className:N.scrollContainer,children:e.jsxs(t.Column,{className:N.sidebarItems,justifyContent:"space-between",flex:1,gap:1,indent:1,children:[e.jsx(t.Column,{gap:1,children:s}),(i||a)&&e.jsxs(t.Column,{gap:1,children:[i,a&&e.jsx(Je,{isPinned:c,onClick:l}),e.jsx(t.Space,{})]})]})})]}),_=x.createContext(!1),T=()=>x.useContext(_),en=({label:n,...s})=>e.jsx(y.Tooltip,{label:n,placement:"right",appendTo:document.body,children:e.jsx(o.IconMenuButton,{...s})}),nn=({closeButtonVisible:n,onClickCloseButton:s,onClickMenuButton:r,children:a,bottomItems:l,closeButtonTitle:i="Unpin menu"})=>e.jsxs(t.Box,{position:"fixed",left:0,top:0,bottom:0,indent:.5,spacing:1,gap:1,shadow:"popover",background:d.cssColor("--lhds-color-ui-50"),children:[e.jsx(o.IconMenuButton,{onClick:r,icon:o.stenaHamburger}),e.jsxs(t.Column,{justifyContent:"space-between",flex:1,gap:1,children:[e.jsx(t.Column,{gap:1,children:e.jsx(_.Provider,{value:!0,children:a})}),e.jsx(t.Column,{gap:1,children:(l||n)&&e.jsxs(_.Provider,{value:!0,children:[l,n&&e.jsx(en,{icon:o.stenaAngleLeftDouble,label:i,onClick:s})]})})]})]}),V=({label:n})=>T()?null:e.jsxs(t.Box,{height:"32px",justifyContent:"center",indent:1,children:[e.jsx(t.Space,{}),e.jsx(t.Text,{variant:"overline",size:"smaller",children:n})]}),tn=({label:n,leftIcon:s,...r})=>s==null?null:e.jsx(y.Tooltip,{label:n,placement:"right",children:e.jsx(o.IconMenuButtonLink,{icon:s,...r})}),sn=n=>T()?e.jsx(tn,{...n}):e.jsx(o.MenuButtonLink,{...n}),rn=({children:n,label:s,icon:r,popupMinWidth:a="200px"})=>e.jsx(y.Popover,{renderTrigger:l=>e.jsx(o.IconMenuButton,{icon:r,...l}),placement:"right-start",trigger:["hover","focus"],disablePadding:!0,children:e.jsx(t.Box,{minWidth:a,shadow:"popover",spacing:1,indent:1,gap:2,children:e.jsxs(_.Provider,{value:!1,children:[e.jsx(V,{label:s}),n]})})}),on=({children:n,label:s,leftIcon:r,className:a,initialExpand:l=!1})=>{const[i,c]=x.useState(l);return T()?r==null?null:e.jsx(rn,{label:s,icon:r,children:n}):e.jsx(o.MenuButton,{label:s,onClick:()=>c(!i),leftIcon:r,className:a,expandable:!0,expanded:i,selected:i,children:e.jsx(U,{children:n})})},an=n=>e.jsx(t.SeparatorLine,{color:d.cssColor("--lhds-color-ui-400"),...n}),ln=(n,s,r)=>n==null?"":(t.pluralFormatter(t.selectPluralRule(r))(n,s)??"").replace("{ITEMS}",String(n)),cn=({numItemsSelected:n,label:s,selectedLabel:r={one:"{ITEMS} item selected",other:"{ITEMS} items selected"},afterLabelContent:a,rightContent:l,localeId:i="en-GB"})=>{const c=ln(n,r,i);return e.jsxs(t.Row,{indent:3,spacing:!0,gap:3,minHeight:"56px",justifyContent:"space-between",alignItems:"center",background:d.cssColor("--silver-lighter"),flex:1,borderRadius:"var(--swui-border-radius)",children:[e.jsxs(t.Row,{alignItems:"center",gap:2,children:[n!=null||s!=null?e.jsx(t.Row,{alignItems:"center",children:n!=null?e.jsx(t.Text,{children:c}):s!=null?typeof s=="string"?e.jsx(t.Text,{children:s}):s:null}):null,a&&e.jsx(t.Row,{children:a})]}),e.jsx(t.Row,{gap:2,children:l})]})},un=({children:n})=>e.jsx(t.Row,{spacing:.5,indent:.5,flex:1,children:n}),dn="_productCard_19x6b_1",xn={productCard:dn},hn=({renderSelectedProductCard:n,renderEditButton:s,children:r,loading:a,shadow:l,...i})=>e.jsxs(t.Column,{"data-comp":"ProductCard",className:xn.productCard,shadow:l?"box":void 0,background:d.cssColor("--moln"),borderRadius:"24px",overflow:"hidden",position:a?"relative":void 0,...t.getDataProps(i),children:[n?.(),e.jsx(t.Column,{gap:2,children:r}),s&&e.jsxs(t.Column,{children:[e.jsx(t.Row,{indent:2,justifyContent:"flex-end",children:s()}),e.jsx(t.Spacing,{})]}),a&&e.jsx(t.Box,{top:0,bottom:0,left:0,right:0,position:"absolute",justifyContent:"center",alignItems:"center",background:"rgba(255, 255, 255, 0.7)",children:e.jsx(o.Spinner,{})})]}),pn=({children:n})=>e.jsx(t.Text,{variant:"bold",style:{fontSize:"2.0rem"},children:n}),mn="_price_181ks_15",jn={price:mn},gn=({description:n,subDescription:s,descriptionTags:r,capacityTag:a,offerCodeTag:l,priceText:i,title:c,subTitle:u,renderImage:p,children:m,headingLevel:j})=>{const g=r==null?!1:Array.isArray(r)?r.length>0:!t.isEmptyFragment(r);return e.jsxs(t.Column,{children:[p?.(),e.jsxs(t.Box,{gap:2,spacing:4,indent:4,background:d.cssColor("--moln"),children:[e.jsxs(t.Box,{gap:.5,children:[e.jsxs(t.Row,{justifyContent:"space-between",alignItems:"flex-start",gap:2,children:[e.jsx(t.Heading,{variant:"h3",as:j,children:c}),e.jsxs(t.Row,{gap:2,className:jn.price,children:[l&&e.jsx(t.Column,{justifyContent:"center",children:l}),e.jsx(pn,{children:i})]})]}),u&&e.jsx(t.Text,{variant:"bold",color:d.cssColor("--silver-dark"),children:u})]}),(g||a)&&e.jsxs(t.Column,{children:[e.jsxs(t.Row,{gap:1,flexWrap:"wrap",children:[r,a&&e.jsx(o.Tag,{label:a,variant:"passive"})]}),e.jsx(t.Space,{})]}),n&&e.jsxs(t.Column,{children:[e.jsx(t.Text,{children:n}),e.jsx(t.Space,{})]}),s&&e.jsxs(t.Column,{children:[e.jsx(t.Text,{children:s}),e.jsx(t.Space,{})]}),m]})]})},Cn=({renderImage:n})=>e.jsxs(t.Column,{children:[n?.(),e.jsxs(t.Box,{gap:3,spacing:4,indent:4,background:d.cssColor("--moln"),children:[e.jsx(t.Box,{gap:.5,children:e.jsx(t.Row,{justifyContent:"space-between",alignItems:"flex-start",gap:2,children:e.jsx(o.ShimmerBox,{width:"50px",height:"2.8rem",borderRadius:"8px"})})}),e.jsx(t.Column,{children:e.jsx(o.ShimmerBox,{width:"180px",height:"2.0rem",borderRadius:"8px"})}),e.jsx(t.Column,{children:e.jsx(o.ShimmerBox,{width:"150px",height:"1.4rem",borderRadius:"8px"})})]})]}),bn=({label:n,children:s})=>e.jsxs(t.Box,{background:d.cssColor("--mussla"),indent:2,spacing:2,gap:2,children:[e.jsx(t.Heading,{variant:"h3",as:"h2",color:"white",children:n}),s]}),Bn="_content_1m4r7_10",fn={content:Bn},vn=({title:n,variant:s="normal",loading:r,iconLeft:a,compactIconLeft:l,renderLeft:i,renderButton:c,renderOfferCodeTag:u,renderMandatoryTag:p,renderContentLeftOfButton:m,children:j,...g})=>{const{fontSizeRatio:B}=t.useAccessibleFontSizeContext(),v=w.useMediaQuery({query:"(max-width: 460px)"}),C=w.useMediaQuery({query:"(max-width: 360px)"})||v&&B>1.2,f=r?"normal":s,h=wn(f),k=d.cssColor("--moln"),M=Sn(f);return e.jsxs(t.Box,{"data-comp":"ProductSummaryCard",borderRadius:"16px",shadow:"box",overflow:"hidden",position:r?"relative":void 0,...t.getDataProps(g),children:[e.jsxs(t.Row,{flex:1,children:[!C&&e.jsxs(t.Box,{flex:2,justifyContent:"center",background:h,children:[i?.(),a&&e.jsx(o.Icon,{color:M,icon:a,size:73})]}),e.jsx(t.Box,{flex:4,indent:2,spacing:2,background:k,children:e.jsxs(t.Column,{gap:2,children:[n&&e.jsxs(t.Row,{justifyContent:"space-between",children:[e.jsxs(t.Row,{gap:2,alignItems:"center",children:[C&&l&&e.jsx(o.CircledIcon,{icon:l,size:"medium"}),e.jsx(t.Text,{variant:"bold",size:"large",children:n})]}),f=="normal"&&u?.()]}),e.jsx(t.Column,{className:fn.content,style:{opacity:r?0:void 0},children:j}),p&&e.jsx(t.Row,{style:{opacity:r?0:void 0},children:p()}),e.jsx("div",{}),e.jsxs(t.Row,{justifyContent:"space-between",alignItems:"center",gap:2,flexWrap:"wrap",children:[m?.()??e.jsx("div",{}),c?.()]})]})})]}),r&&e.jsx(t.Box,{top:0,bottom:0,left:0,right:0,position:"absolute",justifyContent:"center",alignItems:"center",background:"rgba(255, 255, 255, 0.7)",children:e.jsx(o.Spinner,{})})]})},Sn=n=>{switch(n){case"edit":return d.cssColor("--moln");case"upgrade":return d.cssColor("--moln");case"normal":return d.cssColor("--mussla");default:t.exhaustSwitchCaseElseThrow(n)}},wn=n=>{switch(n){case"edit":return d.cssColor("--mussla");case"upgrade":return d.cssColor("--mussla");case"normal":return d.cssColor("--silver-lighter");default:t.exhaustSwitchCaseElseThrow(n)}},yn="_productSummaryCardImage_1knc7_1",In={productSummaryCardImage:yn},K=({src:n,alt:s})=>e.jsx("img",{src:n,alt:s,className:In.productSummaryCardImage}),Rn="_productSummaryCardImageButton_1mznn_11",_n={productSummaryCardImageButton:Rn},kn=({onClick:n,ariaLabel:s,...r})=>e.jsx("button",{type:"button",className:_n.productSummaryCardImageButton,"aria-label":s,onClick:n,children:e.jsx(K,{...r})}),Mn=({iconLeft:n,...s})=>e.jsx(t.Box,{borderRadius:"16px",shadow:"box",overflow:"hidden",...t.getDataProps(s),children:e.jsxs(t.Row,{flex:1,children:[e.jsx(t.Box,{flex:2,justifyContent:"center",background:d.cssColor("--silver-lighter"),children:n&&e.jsx(o.Icon,{color:d.cssColor("--mussla"),icon:n,size:73})}),e.jsx(t.Box,{flex:4,indent:2,spacing:2,background:d.cssColor("--moln"),children:e.jsxs(t.Column,{gap:2,children:[e.jsx(o.ShimmerBox,{width:"180px",height:"2.8rem",borderRadius:"8px"}),e.jsx(o.ShimmerBox,{width:"50px",height:"2.0rem",borderRadius:"8px"}),e.jsx(o.ShimmerBox,{width:"150px",height:"1.4rem",borderRadius:"8px"})]})})]})}),O=["small-mobile","mobile","tablet","tablet-wide","desktop"],A=()=>{const n=w.useMediaQuery({query:"(max-width: 768px)"}),s=w.useMediaQuery({query:"(max-width: 395px)"}),r=w.useMediaQuery({query:"(max-width: 1024px)"}),a=w.useMediaQuery({query:"(max-width: 1160px)"});return{deviceSize:s?"small-mobile":n?"mobile":r?"tablet":a?"tablet-wide":"desktop"}},Z=(n,s)=>n===s||O.indexOf(n)>O.indexOf(s),Pn=n=>{const{deviceSize:s}=A();return{visible:x.useMemo(()=>Z(s,n),[s,n])}},X=({isOpen:n,initialIndex:s,onUpdateIndex:r,altLabelPrevious:a,altLabelZoomIn:l,altLabelZoomOut:i,altLabelNext:c,altLabelClose:u,onRequestClose:p,images:m})=>{const j=x.useRef(null),{deviceSize:g}=A(),B=g!=="mobile",[v,S]=x.useState(s??0),C=({index:h})=>{S(h),r?.(h)},f=x.useMemo(()=>m.map(h=>Nn(h)),[m]);return e.jsx(D,{open:n,close:p,index:v,plugins:[ee,ne,te],slides:f,on:{view:C},animation:{fade:0},controller:{closeOnPullDown:!0,closeOnBackdropClick:!0,ref:j},counter:{container:{style:{filter:"none",color:"white",fontSize:"2.0rem",fontFamily:"var(--swui-font-primary)"}}},render:{buttonZoom:h=>B&&e.jsxs(t.Row,{gap:1,indent:2,children:[e.jsx(o.SecondaryButton,{"aria-label":l,leftIcon:o.stenaSearchPlus,size:"large",onClick:()=>h.zoomIn()}),e.jsx(o.SecondaryButton,{"aria-label":i,leftIcon:o.stenaSearchMinus,size:"large",onClick:()=>h.zoomOut()})]}),buttonPrev:()=>m.length>1&&B&&e.jsx(t.Indent,{num:4,className:"yarl__navigation_prev",children:e.jsx(o.SecondaryButton,{"aria-label":a,leftIcon:o.stenaAngleLeft,size:"large",onClick:()=>j.current?.prev()})}),buttonNext:()=>m.length>1&&B&&e.jsx(t.Indent,{num:4,className:"yarl__navigation_next",children:e.jsx(o.SecondaryButton,{"aria-label":c,leftIcon:o.stenaAngleRight,size:"large",onClick:()=>j.current?.next()})}),buttonClose:()=>e.jsx(t.Indent,{children:e.jsx(o.PrimaryButton,{variant:"danger","aria-label":u,leftIcon:o.stenaTimesThick,size:"large",onClick:()=>j.current?.close()})})}})},Nn=n=>({src:n.url,width:n.width,height:n.height,alt:n.alt,title:n.title,description:n.description}),Fn=({images:n,initialIndex:s,altLabelPrevious:r,altLabelZoomIn:a,altLabelZoomOut:l,altLabelNext:i,altLabelClose:c})=>{const u=x.useRef(null),[p,m]=x.useState(!1),[j,g]=x.useState(s??0),B=x.useCallback(()=>{m(!0)},[]),v=x.useCallback(()=>{m(!1)},[]),S=({index:h})=>g(h);x.useEffect(()=>{g(s??0)},[s]);const C=x.useMemo(()=>n.map(zn),[n]),f=x.useMemo(()=>n.map(h=>h.fullscreenImage?{...h,url:h.fullscreenImage.url,width:h.fullscreenImage.width,height:h.fullscreenImage.height}:h),[n]);return e.jsxs(t.BlockKeyboardEvents,{blockedKeys:"Escape",children:[e.jsx(D,{controller:{ref:u},index:j,slides:C,plugins:[Y],on:{view:S,click:B},carousel:{padding:0,spacing:0,imageFit:"cover"},render:{buttonPrev:()=>n.length>1&&e.jsx(t.Indent,{className:"yarl__navigation_prev",children:e.jsx(o.SecondaryButton,{"aria-label":r,leftIcon:o.stenaAngleLeft,onClick:()=>u.current?.prev()})}),buttonNext:()=>n.length>1&&e.jsx(t.Indent,{className:"yarl__navigation_next",children:e.jsx(o.SecondaryButton,{"aria-label":i,leftIcon:o.stenaAngleRight,onClick:()=>u.current?.next()})})},styles:{button:{filter:"none"}},inline:{style:{width:"100%",maxWidth:"900px",aspectRatio:"3 / 2",margin:"0 auto"}}}),p&&e.jsx(X,{isOpen:!0,onRequestClose:v,initialIndex:j,onUpdateIndex:g,images:f,altLabelPrevious:r,altLabelNext:i,altLabelClose:c,altLabelZoomIn:a,altLabelZoomOut:l})]})},zn=n=>({src:n.url,width:n.width,height:n.height,alt:n.alt,title:n.title,description:n.description});exports.ActionMenuFlatButton=$;exports.ActionMenuPrimaryButton=oe;exports.ActionMenuSecondaryButton=ae;exports.CheckboxMenu=ie;exports.Collapsible=W;exports.CollapsibleEmptyContent=Le;exports.CollapsibleGroupHeading=Ae;exports.CollapsibleList=Ne;exports.CollapsibleWithCheckbox=Fe;exports.ErrorPanel=G;exports.ErrorScreen=qe;exports.FullscreenImageCarousel=X;exports.ImageCarousel=Fn;exports.LoadingPanel=Q;exports.LoadingScreen=He;exports.NavBar=xe;exports.NavBarButton=E;exports.NavBarHeading=Ce;exports.NavBarLink=ge;exports.NavBarNotificationButton=Se;exports.NavBarPopoverButton=be;exports.NavBarSearchField=_e;exports.NavBarUserButton=Pe;exports.PageHeader=Oe;exports.PageHeaderRow=De;exports.PageHeading=$e;exports.ProductCard=hn;exports.ProductCardContentItem=gn;exports.ProductCardContentItemSkeletor=Cn;exports.ProductSummaryCard=vn;exports.ProductSummaryCardImage=K;exports.ProductSummaryCardImageButton=kn;exports.ProductSummaryCardSkeletor=Mn;exports.SelectedItemsActionsPadding=un;exports.SelectedItemsActionsPanel=cn;exports.SelectedProductCard=bn;exports.SelectionRow=Ue;exports.SidebarMenu=Ye;exports.SidebarMenuCollapsible=on;exports.SidebarMenuCollapsibleGroupBox=U;exports.SidebarMenuHeading=V;exports.SidebarMenuLink=sn;exports.SidebarMenuSeparator=an;exports.SidebarRailMenu=nn;exports.isDeviceSameOrLarger=Z;exports.useDeviceSize=A;exports.useLayoutVisibility=Pn;
|
|
2
2
|
//# sourceMappingURL=index.js.map
|