@stenajs-webui/panels 23.17.1 → 23.17.3
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 +69 -69
- 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"),S=require("react-responsive"),D=require("yet-another-react-lightbox"),J=require("yet-another-react-lightbox/plugins/inline"),Y=require("yet-another-react-lightbox/plugins/zoom"),ee=require("yet-another-react-lightbox/plugins/counter"),ne=require("yet-another-react-lightbox/plugins/captions");function te(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 se=te(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:j,zIndex:m,disableTrapFocus:g=!1,...B})=>{const[v,w,C,f]=t.useBoolean(!1),h=x.useRef(null),k=p??h,M=x.useMemo(()=>({open:w,close:C}),[w,C]),X=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:X,...P}),hideArrow:!0,disablePadding:!0,open:v,onRequestClose:C,placement:s,appendTo:j,zIndex:m,children:v&&e.jsx(o.ActionMenu,{width:l,top:i,trapFocus:!g,children:e.jsx(o.ActionMenuContext.Provider,{value:M,children:n(C)})})})})},re=n=>e.jsx(z,{buttonComponent:o.PrimaryButton,...n}),oe=n=>e.jsx(z,{buttonComponent:o.SecondaryButton,...n}),E=n=>e.jsx(z,{buttonComponent:o.FlatButton,...n}),ae="1px solid var(--lhds-color-ui-300)",le=({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:ae,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)})})}),ie="_navBar_kzibd_1",ce={navBar:ie},ue=({className:n,onClick:s})=>e.jsx(o.FlatButton,{leftIcon:o.stenaHamburger,className:n,onClick:s}),de=({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(ce.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(ue,{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:se.Children.map(a,(p,j)=>e.jsxs(e.Fragment,{children:[j>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})]})]})},xe="_navBarButton_b3x3w_1",he="_selected_b3x3w_14",L={navBarButton:xe,selected:he},$=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)})}),pe="_navBarLink_1u1b2_1",je="_selected_1u1b2_14",q={navBarLink:pe,selected:je},me=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)})}),ge=n=>e.jsx(t.Heading,{whiteSpace:"nowrap",variant:"h4",as:"h1",...n}),Ce=({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",Be="_unread_1nfdy_23",fe="_icon_1nfdy_23",I={navBarNotificationButton:be,unread:Be,icon:fe},ve=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",Se="_navBarSearchFieldWrapper_1rp8g_12",ye="_withButton_1rp8g_24",Ie="_clearButton_1rp8g_33",R={navBarSearchFieldInput:we,navBarSearchFieldWrapper:Se,withButton:ye,clearButton:Ie},Re=({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}),_e="_navBarUserButton_10f9z_1",ke={navBarUserButton:_e},Me=({className:n,username:s,initials:r,icon:a=o.stenaUserCircle,responsiveIconOnly:l=r==null,...i})=>e.jsx(E,{...i,className:b(ke.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})),Pe=({children:n})=>e.jsx(t.Column,{gap:1,children:n}),Ne=({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}),Fe="_sidebarMenuCollapsibleGroupBox_ikek9_1",ze={sidebarMenuCollapsibleGroupBox:Fe},U=({children:n})=>e.jsx("div",{className:ze.sidebarMenuCollapsibleGroupBox,children:n}),Te=({children:n})=>e.jsx(t.Box,{spacing:!0,indent:!0,children:e.jsx(t.Text,{variant:"overline",size:"smaller",children:n})}),Ae=({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})]})]})})})},Le=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})]})]}),qe=n=>e.jsx(t.Box,{width:"100%",height:"100%",spacing:6,justifyContent:"center",alignItems:"center",children:e.jsx(Q,{...n})}),He=({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]}),Oe=n=>e.jsx(t.Row,{indent:3,spacing:!0,...n}),De=({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_1njaw_1",$e="_iconColumn_1njaw_9",H={selectionRow:Ee,iconColumn:$e},We=({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]})})]}),a]}),Ue="_sidebarMenu_1bx5w_1",Ge="_sidebarItems_1bx5w_38",Qe="_scrollContainer_1bx5w_48",N={sidebarMenu:Ue,sidebarItems:Ge,scrollContainer:Qe},Ve="_stenaFlag_108h7_1",Ke={stenaFlag:Ve},Ze=({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:Ke.stenaFlag})]})]}),Xe=({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})},Je=({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(Ze,{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(Xe,{isPinned:c,onClick:l}),e.jsx(t.Space,{})]})]})})]}),_=x.createContext(!1),T=()=>x.useContext(_),Ye=({label:n,...s})=>e.jsx(y.Tooltip,{label:n,placement:"right",appendTo:document.body,children:e.jsx(o.IconMenuButton,{...s})}),en=({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(Ye,{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})]}),nn=({label:n,leftIcon:s,...r})=>s==null?null:e.jsx(y.Tooltip,{label:n,placement:"right",children:e.jsx(o.IconMenuButtonLink,{icon:s,...r})}),tn=n=>T()?e.jsx(nn,{...n}):e.jsx(o.MenuButtonLink,{...n}),sn=({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]})})}),rn=({children:n,label:s,leftIcon:r,className:a,initialExpand:l=!1})=>{const[i,c]=x.useState(l);return T()?r==null?null:e.jsx(sn,{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})})},on=n=>e.jsx(t.SeparatorLine,{color:d.cssColor("--lhds-color-ui-400"),...n}),an=(n,s,r)=>n==null?"":(t.pluralFormatter(t.selectPluralRule(r))(n,s)??"").replace("{ITEMS}",String(n)),ln=({numItemsSelected:n,label:s,selectedLabel:r={one:"{ITEMS} item selected",other:"{ITEMS} items selected"},afterLabelContent:a,rightContent:l,localeId:i="en-GB"})=>{const c=an(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})]})},cn=({children:n})=>e.jsx(t.Row,{spacing:.5,indent:.5,flex:1,children:n}),un="_productCard_19x6b_1",dn={productCard:un},xn=({renderSelectedProductCard:n,renderEditButton:s,children:r,loading:a,shadow:l,...i})=>e.jsxs(t.Column,{"data-comp":"ProductCard",className:dn.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,{})})]}),hn=({children:n})=>e.jsx(t.Text,{variant:"bold",style:{fontSize:"2.0rem"},children:n}),pn=({description:n,subDescription:s,descriptionTags:r,capacityTag:a,offerCodeTag:l,priceText:i,title:c,subTitle:u,renderImage:p,children:j,headingLevel:m})=>{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:m,children:c}),e.jsxs(t.Row,{gap:2,children:[l&&e.jsx(t.Column,{justifyContent:"center",children:l}),e.jsx(hn,{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,{})]}),j]})]})},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"})})]})]}),mn=({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]}),gn=({title:n,variant:s="normal",loading:r,iconLeft:a,compactIconLeft:l,renderLeft:i,renderButton:c,renderOfferCodeTag:u,renderMandatoryTag:p,renderContentLeftOfButton:j,children:m,...g})=>{const{fontSizeRatio:B}=t.useAccessibleFontSizeContext(),v=S.useMediaQuery({query:"(max-width: 460px)"}),C=S.useMediaQuery({query:"(max-width: 360px)"})||v&&B>1.2,f=r?"normal":s,h=bn(f),k=d.cssColor("--moln"),M=Cn(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:m}),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:[j?.()??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,{})})]})},Cn=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)}},Bn="_productSummaryCardImage_1knc7_1",fn={productSummaryCardImage:Bn},vn=({src:n,alt:s})=>e.jsx("img",{src:n,alt:s,className:fn.productSummaryCardImage}),wn=({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=S.useMediaQuery({query:"(max-width: 768px)"}),s=S.useMediaQuery({query:"(max-width: 395px)"}),r=S.useMediaQuery({query:"(max-width: 1024px)"}),a=S.useMediaQuery({query:"(max-width: 1160px)"});return{deviceSize:s?"small-mobile":n?"mobile":r?"tablet":a?"tablet-wide":"desktop"}},K=(n,s)=>n===s||O.indexOf(n)>O.indexOf(s),Sn=n=>{const{deviceSize:s}=A();return{visible:x.useMemo(()=>K(s,n),[s,n])}},Z=({isOpen:n,initialIndex:s,onUpdateIndex:r,altLabelPrevious:a,altLabelZoomIn:l,altLabelZoomOut:i,altLabelNext:c,altLabelClose:u,onRequestClose:p,images:j})=>{const m=x.useRef(null),{deviceSize:g}=A(),B=g!=="mobile",[v,w]=x.useState(s??0),C=({index:h})=>{w(h),r?.(h)},f=x.useMemo(()=>j.map(h=>yn(h)),[j]);return e.jsx(D,{open:n,close:p,index:v,plugins:[Y,ee,ne],slides:f,on:{view:C},animation:{fade:0},controller:{closeOnPullDown:!0,closeOnBackdropClick:!0,ref:m},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:()=>j.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:()=>m.current?.prev()})}),buttonNext:()=>j.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:()=>m.current?.next()})}),buttonClose:()=>e.jsx(t.Indent,{children:e.jsx(o.PrimaryButton,{variant:"danger","aria-label":u,leftIcon:o.stenaTimesThick,size:"large",onClick:()=>m.current?.close()})})}})},yn=n=>({src:n.url,width:n.width,height:n.height,alt:n.alt,title:n.title,description:n.description}),In=({images:n,initialIndex:s,altLabelPrevious:r,altLabelZoomIn:a,altLabelZoomOut:l,altLabelNext:i,altLabelClose:c})=>{const u=x.useRef(null),[p,j]=x.useState(!1),[m,g]=x.useState(s??0),B=x.useCallback(()=>{j(!0)},[]),v=x.useCallback(()=>{j(!1)},[]),w=({index:h})=>g(h);x.useEffect(()=>{g(s??0)},[s]);const C=x.useMemo(()=>n.map(Rn),[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:m,slides:C,plugins:[J],on:{view:w,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(Z,{isOpen:!0,onRequestClose:v,initialIndex:m,onUpdateIndex:g,images:f,altLabelPrevious:r,altLabelNext:i,altLabelClose:c,altLabelZoomIn:a,altLabelZoomOut:l})]})},Rn=n=>({src:n.url,width:n.width,height:n.height,alt:n.alt,title:n.title,description:n.description});exports.ActionMenuFlatButton=E;exports.ActionMenuPrimaryButton=re;exports.ActionMenuSecondaryButton=oe;exports.CheckboxMenu=le;exports.Collapsible=W;exports.CollapsibleEmptyContent=Ae;exports.CollapsibleGroupHeading=Te;exports.CollapsibleList=Pe;exports.CollapsibleWithCheckbox=Ne;exports.ErrorPanel=G;exports.ErrorScreen=Le;exports.FullscreenImageCarousel=Z;exports.ImageCarousel=In;exports.LoadingPanel=Q;exports.LoadingScreen=qe;exports.NavBar=de;exports.NavBarButton=$;exports.NavBarHeading=ge;exports.NavBarLink=me;exports.NavBarNotificationButton=ve;exports.NavBarPopoverButton=Ce;exports.NavBarSearchField=Re;exports.NavBarUserButton=Me;exports.PageHeader=He;exports.PageHeaderRow=Oe;exports.PageHeading=De;exports.ProductCard=xn;exports.ProductCardContentItem=pn;exports.ProductCardContentItemSkeletor=jn;exports.ProductSummaryCard=gn;exports.ProductSummaryCardImage=vn;exports.ProductSummaryCardSkeletor=wn;exports.SelectedItemsActionsPadding=cn;exports.SelectedItemsActionsPanel=ln;exports.SelectedProductCard=mn;exports.SelectionRow=We;exports.SidebarMenu=Je;exports.SidebarMenuCollapsible=rn;exports.SidebarMenuCollapsibleGroupBox=U;exports.SidebarMenuHeading=V;exports.SidebarMenuLink=tn;exports.SidebarMenuSeparator=on;exports.SidebarRailMenu=en;exports.isDeviceSameOrLarger=K;exports.useDeviceSize=A;exports.useLayoutVisibility=Sn;
|
|
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"),S=require("react-responsive"),D=require("yet-another-react-lightbox"),J=require("yet-another-react-lightbox/plugins/inline"),Y=require("yet-another-react-lightbox/plugins/zoom"),ee=require("yet-another-react-lightbox/plugins/counter"),ne=require("yet-another-react-lightbox/plugins/captions");function te(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 se=te(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:j,zIndex:m,disableTrapFocus:g=!1,...B})=>{const[v,w,C,f]=t.useBoolean(!1),h=x.useRef(null),k=p??h,M=x.useMemo(()=>({open:w,close:C}),[w,C]),X=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:X,...P}),hideArrow:!0,disablePadding:!0,open:v,onRequestClose:C,placement:s,appendTo:j,zIndex:m,children:v&&e.jsx(o.ActionMenu,{width:l,top:i,trapFocus:!g,children:e.jsx(o.ActionMenuContext.Provider,{value:M,children:n(C)})})})})},re=n=>e.jsx(z,{buttonComponent:o.PrimaryButton,...n}),oe=n=>e.jsx(z,{buttonComponent:o.SecondaryButton,...n}),E=n=>e.jsx(z,{buttonComponent:o.FlatButton,...n}),ae="1px solid var(--lhds-color-ui-300)",le=({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:ae,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)})})}),ie="_navBar_kzibd_1",ce={navBar:ie},ue=({className:n,onClick:s})=>e.jsx(o.FlatButton,{leftIcon:o.stenaHamburger,className:n,onClick:s}),de=({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(ce.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(ue,{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:se.Children.map(a,(p,j)=>e.jsxs(e.Fragment,{children:[j>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})]})]})},xe="_navBarButton_b3x3w_1",he="_selected_b3x3w_14",L={navBarButton:xe,selected:he},$=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)})}),pe="_navBarLink_1u1b2_1",je="_selected_1u1b2_14",q={navBarLink:pe,selected:je},me=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)})}),ge=n=>e.jsx(t.Heading,{whiteSpace:"nowrap",variant:"h4",as:"h1",...n}),Ce=({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",Be="_unread_1nfdy_23",fe="_icon_1nfdy_23",I={navBarNotificationButton:be,unread:Be,icon:fe},ve=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",Se="_navBarSearchFieldWrapper_1rp8g_12",ye="_withButton_1rp8g_24",Ie="_clearButton_1rp8g_33",R={navBarSearchFieldInput:we,navBarSearchFieldWrapper:Se,withButton:ye,clearButton:Ie},Re=({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}),_e="_navBarUserButton_10f9z_1",ke={navBarUserButton:_e},Me=({className:n,username:s,initials:r,icon:a=o.stenaUserCircle,responsiveIconOnly:l=r==null,...i})=>e.jsx(E,{...i,className:b(ke.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})),Pe=({children:n})=>e.jsx(t.Column,{gap:1,children:n}),Ne=({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}),Fe="_sidebarMenuCollapsibleGroupBox_ikek9_1",ze={sidebarMenuCollapsibleGroupBox:Fe},U=({children:n})=>e.jsx("div",{className:ze.sidebarMenuCollapsibleGroupBox,children:n}),Te=({children:n})=>e.jsx(t.Box,{spacing:!0,indent:!0,children:e.jsx(t.Text,{variant:"overline",size:"smaller",children:n})}),Ae=({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})]})]})})})},Le=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})]})]}),qe=n=>e.jsx(t.Box,{width:"100%",height:"100%",spacing:6,justifyContent:"center",alignItems:"center",children:e.jsx(Q,{...n})}),He=({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]}),Oe=n=>e.jsx(t.Row,{indent:3,spacing:!0,...n}),De=({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",$e="_iconColumn_eqiow_10",H={selectionRow:Ee,iconColumn:$e},We=({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})]}),Ue="_sidebarMenu_1bx5w_1",Ge="_sidebarItems_1bx5w_38",Qe="_scrollContainer_1bx5w_48",N={sidebarMenu:Ue,sidebarItems:Ge,scrollContainer:Qe},Ve="_stenaFlag_108h7_1",Ke={stenaFlag:Ve},Ze=({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:Ke.stenaFlag})]})]}),Xe=({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})},Je=({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(Ze,{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(Xe,{isPinned:c,onClick:l}),e.jsx(t.Space,{})]})]})})]}),_=x.createContext(!1),T=()=>x.useContext(_),Ye=({label:n,...s})=>e.jsx(y.Tooltip,{label:n,placement:"right",appendTo:document.body,children:e.jsx(o.IconMenuButton,{...s})}),en=({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(Ye,{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})]}),nn=({label:n,leftIcon:s,...r})=>s==null?null:e.jsx(y.Tooltip,{label:n,placement:"right",children:e.jsx(o.IconMenuButtonLink,{icon:s,...r})}),tn=n=>T()?e.jsx(nn,{...n}):e.jsx(o.MenuButtonLink,{...n}),sn=({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]})})}),rn=({children:n,label:s,leftIcon:r,className:a,initialExpand:l=!1})=>{const[i,c]=x.useState(l);return T()?r==null?null:e.jsx(sn,{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})})},on=n=>e.jsx(t.SeparatorLine,{color:d.cssColor("--lhds-color-ui-400"),...n}),an=(n,s,r)=>n==null?"":(t.pluralFormatter(t.selectPluralRule(r))(n,s)??"").replace("{ITEMS}",String(n)),ln=({numItemsSelected:n,label:s,selectedLabel:r={one:"{ITEMS} item selected",other:"{ITEMS} items selected"},afterLabelContent:a,rightContent:l,localeId:i="en-GB"})=>{const c=an(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})]})},cn=({children:n})=>e.jsx(t.Row,{spacing:.5,indent:.5,flex:1,children:n}),un="_productCard_19x6b_1",dn={productCard:un},xn=({renderSelectedProductCard:n,renderEditButton:s,children:r,loading:a,shadow:l,...i})=>e.jsxs(t.Column,{"data-comp":"ProductCard",className:dn.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,{})})]}),hn=({children:n})=>e.jsx(t.Text,{variant:"bold",style:{fontSize:"2.0rem"},children:n}),pn=({description:n,subDescription:s,descriptionTags:r,capacityTag:a,offerCodeTag:l,priceText:i,title:c,subTitle:u,renderImage:p,children:j,headingLevel:m})=>{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:m,children:c}),e.jsxs(t.Row,{gap:2,children:[l&&e.jsx(t.Column,{justifyContent:"center",children:l}),e.jsx(hn,{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,{})]}),j]})]})},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"})})]})]}),mn=({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]}),gn=({title:n,variant:s="normal",loading:r,iconLeft:a,compactIconLeft:l,renderLeft:i,renderButton:c,renderOfferCodeTag:u,renderMandatoryTag:p,renderContentLeftOfButton:j,children:m,...g})=>{const{fontSizeRatio:B}=t.useAccessibleFontSizeContext(),v=S.useMediaQuery({query:"(max-width: 460px)"}),C=S.useMediaQuery({query:"(max-width: 360px)"})||v&&B>1.2,f=r?"normal":s,h=bn(f),k=d.cssColor("--moln"),M=Cn(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:m}),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:[j?.()??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,{})})]})},Cn=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)}},Bn="_productSummaryCardImage_1knc7_1",fn={productSummaryCardImage:Bn},vn=({src:n,alt:s})=>e.jsx("img",{src:n,alt:s,className:fn.productSummaryCardImage}),wn=({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=S.useMediaQuery({query:"(max-width: 768px)"}),s=S.useMediaQuery({query:"(max-width: 395px)"}),r=S.useMediaQuery({query:"(max-width: 1024px)"}),a=S.useMediaQuery({query:"(max-width: 1160px)"});return{deviceSize:s?"small-mobile":n?"mobile":r?"tablet":a?"tablet-wide":"desktop"}},K=(n,s)=>n===s||O.indexOf(n)>O.indexOf(s),Sn=n=>{const{deviceSize:s}=A();return{visible:x.useMemo(()=>K(s,n),[s,n])}},Z=({isOpen:n,initialIndex:s,onUpdateIndex:r,altLabelPrevious:a,altLabelZoomIn:l,altLabelZoomOut:i,altLabelNext:c,altLabelClose:u,onRequestClose:p,images:j})=>{const m=x.useRef(null),{deviceSize:g}=A(),B=g!=="mobile",[v,w]=x.useState(s??0),C=({index:h})=>{w(h),r?.(h)},f=x.useMemo(()=>j.map(h=>yn(h)),[j]);return e.jsx(D,{open:n,close:p,index:v,plugins:[Y,ee,ne],slides:f,on:{view:C},animation:{fade:0},controller:{closeOnPullDown:!0,closeOnBackdropClick:!0,ref:m},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:()=>j.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:()=>m.current?.prev()})}),buttonNext:()=>j.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:()=>m.current?.next()})}),buttonClose:()=>e.jsx(t.Indent,{children:e.jsx(o.PrimaryButton,{variant:"danger","aria-label":u,leftIcon:o.stenaTimesThick,size:"large",onClick:()=>m.current?.close()})})}})},yn=n=>({src:n.url,width:n.width,height:n.height,alt:n.alt,title:n.title,description:n.description}),In=({images:n,initialIndex:s,altLabelPrevious:r,altLabelZoomIn:a,altLabelZoomOut:l,altLabelNext:i,altLabelClose:c})=>{const u=x.useRef(null),[p,j]=x.useState(!1),[m,g]=x.useState(s??0),B=x.useCallback(()=>{j(!0)},[]),v=x.useCallback(()=>{j(!1)},[]),w=({index:h})=>g(h);x.useEffect(()=>{g(s??0)},[s]);const C=x.useMemo(()=>n.map(Rn),[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:m,slides:C,plugins:[J],on:{view:w,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(Z,{isOpen:!0,onRequestClose:v,initialIndex:m,onUpdateIndex:g,images:f,altLabelPrevious:r,altLabelNext:i,altLabelClose:c,altLabelZoomIn:a,altLabelZoomOut:l})]})},Rn=n=>({src:n.url,width:n.width,height:n.height,alt:n.alt,title:n.title,description:n.description});exports.ActionMenuFlatButton=E;exports.ActionMenuPrimaryButton=re;exports.ActionMenuSecondaryButton=oe;exports.CheckboxMenu=le;exports.Collapsible=W;exports.CollapsibleEmptyContent=Ae;exports.CollapsibleGroupHeading=Te;exports.CollapsibleList=Pe;exports.CollapsibleWithCheckbox=Ne;exports.ErrorPanel=G;exports.ErrorScreen=Le;exports.FullscreenImageCarousel=Z;exports.ImageCarousel=In;exports.LoadingPanel=Q;exports.LoadingScreen=qe;exports.NavBar=de;exports.NavBarButton=$;exports.NavBarHeading=ge;exports.NavBarLink=me;exports.NavBarNotificationButton=ve;exports.NavBarPopoverButton=Ce;exports.NavBarSearchField=Re;exports.NavBarUserButton=Me;exports.PageHeader=He;exports.PageHeaderRow=Oe;exports.PageHeading=De;exports.ProductCard=xn;exports.ProductCardContentItem=pn;exports.ProductCardContentItemSkeletor=jn;exports.ProductSummaryCard=gn;exports.ProductSummaryCardImage=vn;exports.ProductSummaryCardSkeletor=wn;exports.SelectedItemsActionsPadding=cn;exports.SelectedItemsActionsPanel=ln;exports.SelectedProductCard=mn;exports.SelectionRow=We;exports.SidebarMenu=Je;exports.SidebarMenuCollapsible=rn;exports.SidebarMenuCollapsibleGroupBox=U;exports.SidebarMenuHeading=V;exports.SidebarMenuLink=tn;exports.SidebarMenuSeparator=on;exports.SidebarRailMenu=en;exports.isDeviceSameOrLarger=K;exports.useDeviceSize=A;exports.useLayoutVisibility=Sn;
|
|
2
2
|
//# sourceMappingURL=index.js.map
|