sosk-ui-lib 0.3.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,17 @@
1
+ import { ReactNode } from 'react';
2
+ import { Breakpoint, SxProps, Theme } from '@mui/material';
3
+ export interface CategoryTile {
4
+ label: string;
5
+ image?: string;
6
+ onClick: () => void;
7
+ }
8
+ export interface CategoryTilesProps {
9
+ items: CategoryTile[];
10
+ title?: ReactNode;
11
+ placeholderIcon?: ReactNode;
12
+ tileBackground?: string;
13
+ maxWidth?: Breakpoint | false;
14
+ sx?: SxProps<Theme>;
15
+ }
16
+ export declare function CategoryTiles(props: CategoryTilesProps): import("react").JSX.Element;
17
+ export default CategoryTiles;
@@ -10,5 +10,7 @@ export interface ContactFormProps {
10
10
  submittingLabel?: string;
11
11
  successMessage?: string;
12
12
  errorMessage?: string;
13
+ subjectOptions?: string[];
14
+ subjectPlaceholder?: string;
13
15
  }
14
- export declare function ContactForm({ onSubmit, submitLabel, submittingLabel, successMessage, errorMessage, }: ContactFormProps): import("react").JSX.Element;
16
+ export declare function ContactForm({ onSubmit, submitLabel, submittingLabel, successMessage, errorMessage, subjectOptions, subjectPlaceholder, }: ContactFormProps): import("react").JSX.Element;
package/dist/index.d.ts CHANGED
@@ -20,6 +20,8 @@ export { QuantityPicker } from './components/QuantityPicker';
20
20
  export type { QuantityPickerProps } from './components/QuantityPicker';
21
21
  export { FeatureList } from './components/FeatureList';
22
22
  export type { FeatureListProps, FeatureListItem } from './components/FeatureList';
23
+ export { CategoryTiles } from './components/CategoryTiles';
24
+ export type { CategoryTilesProps, CategoryTile } from './components/CategoryTiles';
23
25
  export { SearchField } from './components/SearchField';
24
26
  export type { SearchFieldProps } from './components/SearchField';
25
27
  export { StatusPanel } from './components/StatusPanel';
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),y=require("react"),t=require("@mui/material"),Y=require("@mui/icons-material/Edit"),K=require("@mui/icons-material/Delete"),R=require("@mui/icons-material/Close"),E=require("@mui/icons-material/Add"),Q=require("@mui/icons-material/CloudUpload"),J=require("@mui/icons-material/Remove"),P=require("@mui/icons-material/Search");function O({open:i,onClose:r,title:s,children:o,actions:a,maxWidth:n="sm",disableClose:l=!1}){const c=y.useId();return e.jsxs(t.Dialog,{open:i,onClose:()=>!l&&r(),fullWidth:!0,maxWidth:n,"aria-labelledby":c,children:[e.jsxs(t.Stack,{direction:"row",sx:{alignItems:"center",borderBottom:2,borderColor:"divider",pr:3},children:[e.jsx(t.DialogTitle,{id:c,sx:{flex:1,minWidth:0},children:s}),e.jsx(t.IconButton,{size:"small",onClick:r,disabled:l,"aria-label":"Close",children:e.jsx(R,{fontSize:"small"})})]}),e.jsxs(t.DialogContent,{sx:{padding:0},children:[o,a&&e.jsx(t.Stack,{direction:"row",spacing:2,sx:{justifyContent:"flex-end",borderTop:2,borderColor:"divider",p:2},children:a})]})]})}function $({open:i,onClose:r,onConfirm:s,title:o,message:a,confirmLabel:n="Confirm",cancelLabel:l="Cancel",pendingLabel:c,confirmColor:d="error",errorMessage:u="Something went wrong. Please try again."}){const[h,x]=y.useState(!1),[p,g]=y.useState(!1),b=()=>{g(!1),r()},w=async()=>{x(!0),g(!1);try{await s()}catch{g(!0),x(!1);return}x(!1),b()};return e.jsx(O,{open:i,onClose:b,title:o,maxWidth:"xs",disableClose:h,actions:e.jsxs(e.Fragment,{children:[e.jsx(t.Button,{variant:"outlined",color:"inherit",onClick:b,disabled:h,children:l}),e.jsx(t.Button,{variant:"contained",color:d,onClick:w,disabled:h,children:h&&c?c:n})]}),children:e.jsxs(t.Box,{sx:{p:2},children:[e.jsx(t.Typography,{component:"div",children:a}),p&&e.jsx(t.Alert,{severity:"error",sx:{mt:2},children:u})]})})}function T(i){return i?Array.isArray(i)?i:[i]:[]}const N={border:0,clip:"rect(0 0 0 0)",clipPath:"inset(50%)",height:1,margin:-1,overflow:"hidden",padding:0,position:"absolute",whiteSpace:"nowrap",width:1};function U(i,r){return i==="outlined"?{borderRadius:1,border:1,borderColor:"divider",boxShadow:"none",...r&&{transition:"border-color 0.2s ease","&:hover":{borderColor:"primary.main"}}}:{borderRadius:3,boxShadow:"0 4px 16px rgba(0,0,0,0.08)",...r&&{transition:"all 0.25s ease","&:hover":{transform:"translateY(-4px)",boxShadow:"0 10px 28px rgba(0,0,0,0.12)"}}}}function q(i,r){return r?{width:"100%",height:"auto",aspectRatio:r}:{height:i}}function X({image:i,imageAlt:r="",imageHeight:s=260,imageAspectRatio:o,fallback:a=e.jsx(t.Typography,{children:"No Image Available"}),title:n,titleComponent:l,subtitle:c,description:d,descriptionLines:u=3,highlight:h,footer:x,actions:p,variant:g="elevated",density:b="comfortable",sx:w,onEdit:f,editForm:k,editLabel:B="Edit",onDelete:I,deleteLabel:C="Delete",deleteConfirmMessage:v="Are you sure you want to delete this item? This action cannot be undone.",onClick:S}){const[m,j]=y.useState(!1),[W,L]=y.useState(!1),z=!!(f&&k),M=!!I,D=b==="compact",A=D?1.75:3,V=async _=>{f&&(await f(_),j(!1))};return e.jsxs(t.Box,{sx:{position:"relative",height:"100%"},children:[(z||M)&&e.jsxs(t.Stack,{direction:"row",spacing:.5,sx:{position:"absolute",top:8,right:8,zIndex:1,bgcolor:"background.paper",borderRadius:1,boxShadow:1},children:[z&&e.jsx(t.IconButton,{size:"small",onClick:()=>j(!0),"aria-label":B,children:e.jsx(Y,{fontSize:"small"})}),M&&e.jsx(t.IconButton,{size:"small",onClick:()=>L(!0),"aria-label":C,children:e.jsx(K,{fontSize:"small",color:"error"})})]}),e.jsxs(t.Card,{sx:[{position:"relative",height:"100%",display:"flex",flexDirection:"column",overflow:"hidden",...U(g,!!S)},...T(w)],children:[i?e.jsx(t.CardMedia,{component:"img",image:i,alt:r,sx:{...q(s,o),objectFit:"cover",bgcolor:"background.default"}}):e.jsx(t.Box,{sx:{...q(s,o),display:"flex",alignItems:"center",justifyContent:"center",bgcolor:"grey.100",color:"text.secondary"},children:a}),e.jsxs(t.CardContent,{sx:{display:"flex",flexDirection:"column",flexGrow:1,p:A,pb:p?0:A,"&:last-child":{pb:A}},children:[e.jsx(t.Typography,{variant:D?"subtitle1":"h6",...l&&{component:l},sx:{fontWeight:600,color:"text.primary",mb:D?.5:1,...D&&{lineHeight:1.3}},children:S?e.jsx(t.ButtonBase,{onClick:S,disableRipple:!0,sx:{position:"static",font:"inherit",letterSpacing:"inherit",textAlign:"inherit",color:"inherit","&::after":{content:'""',position:"absolute",inset:0,borderRadius:"inherit"},"&.Mui-focusVisible::after":{outline:"2px solid",outlineColor:"primary.main",outlineOffset:"-2px"}},children:n}):n}),c&&e.jsx(t.Typography,{variant:"body2",color:"text.secondary",sx:{mb:D?.5:1},children:c}),d&&e.jsx(t.Typography,{variant:"body2",color:"text.secondary",sx:{flexGrow:1,mb:2,display:"-webkit-box",WebkitLineClamp:u,WebkitBoxOrient:"vertical",overflow:"hidden"},children:d}),h&&e.jsx(t.Typography,{variant:D?"h6":"h5",sx:{fontWeight:700,color:"primary.main",...D?{mt:"auto",pt:.5}:{mb:2}},children:h}),D&&x?e.jsx(t.Box,{sx:{mt:1},children:x}):x]}),p&&e.jsx(t.Box,{sx:{position:"relative",zIndex:1,px:A,pt:D?1.5:2,pb:A},children:p})]}),z&&e.jsx(O,{open:m,onClose:()=>j(!1),title:B,children:k({onSubmit:V,onCancel:()=>j(!1)})}),M&&e.jsx($,{open:W,onClose:()=>L(!1),onConfirm:I,title:C,message:v,confirmLabel:C,pendingLabel:"Deleting…"})]})}function Z({imageHeight:i=260,imageAspectRatio:r,variant:s="elevated",density:o="comfortable"}){const a=o==="compact";return e.jsxs(t.Card,{sx:{width:"100%",overflow:"hidden",...U(s,!1)},children:[e.jsx(t.Skeleton,{variant:"rectangular",animation:"wave",sx:{width:"100%",...q(i,r)}}),e.jsxs(t.Box,{sx:{p:a?1.75:3},children:[e.jsx(t.Skeleton,{animation:"wave",width:"60%",height:a?24:32,sx:{mb:1}}),!a&&e.jsxs(e.Fragment,{children:[e.jsx(t.Skeleton,{animation:"wave",height:20}),e.jsx(t.Skeleton,{animation:"wave",height:20})]}),e.jsx(t.Skeleton,{animation:"wave",width:"30%",height:a?28:36,sx:{mt:a?0:2}})]})]})}function ee({items:i,renderItem:r,getItemKey:s,margin:o={xs:3,lg:8},spacing:a=2,gridSize:n={xs:12,sm:6,md:4},onAddNewItem:l,addNewItemForm:c,addNewItemLabel:d="Add New Item",loading:u=!1,skeletonCount:h=6,skeletonWidth:x="100%",skeletonHeight:p=450,renderSkeleton:g,header:b}){const[w,f]=y.useState(!1),k=!!(l&&c),B={xs:n.xs,sm:n.sm?Math.max(1,Math.floor(n.sm/2)):void 0,md:n.md?Math.max(1,Math.floor(n.md/2)):void 0,lg:n.lg?Math.max(1,Math.floor(n.lg/2)):void 0},I=async v=>{l&&(await l(v),f(!1))},C=e.jsxs(t.Card,{sx:{width:"100%",maxWidth:x,minHeight:p,mx:"auto",borderRadius:3,overflow:"hidden",boxShadow:"0 4px 16px rgba(0,0,0,0.08)"},children:[e.jsx(t.Skeleton,{variant:"rectangular",animation:"wave",height:260,sx:{width:"100%"}}),e.jsxs(t.Box,{sx:{p:3},children:[e.jsx(t.Skeleton,{animation:"wave",width:"60%",height:32,sx:{mb:1}}),e.jsx(t.Skeleton,{animation:"wave",height:20}),e.jsx(t.Skeleton,{animation:"wave",height:20}),e.jsx(t.Skeleton,{animation:"wave",width:"30%",height:36,sx:{mt:2}})]})]});return e.jsxs(t.Box,{sx:{margin:o},children:[b&&e.jsx(t.Box,{sx:{mb:3},children:b}),e.jsxs(t.Grid,{container:!0,spacing:a,sx:{width:"100%"},children:[u?Array.from({length:h}).map((v,S)=>e.jsx(t.Grid,{size:n,children:g?g():C},`skeleton-${S}`)):i.map(v=>e.jsx(t.Grid,{size:n,children:r(v)},s(v))),!u&&k&&e.jsx(t.Grid,{size:B,children:e.jsx(t.Box,{sx:{height:"100%",minHeight:160,display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsx(t.Card,{variant:"outlined",sx:{width:"100%",height:"50%",minHeight:80,display:"flex",alignItems:"center",justifyContent:"center",bgcolor:"rgba(0, 0, 0, 0.04)",border:"3px dashed",borderColor:"grey.400",boxShadow:"none",transition:"all 0.2s ease",borderRadius:4,"&:hover":{bgcolor:"rgba(0, 0, 0, 0.08)",borderColor:"primary.main"}},children:e.jsxs(t.CardActionArea,{onClick:()=>f(!0),sx:{height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:1,p:2},children:[e.jsx(E,{fontSize:"large",color:"action"}),e.jsx(t.Typography,{color:"text.secondary",children:d})]})})})})]}),k&&e.jsx(O,{open:w,onClose:()=>f(!1),title:d,children:c({onSubmit:I,onCancel:()=>f(!1)})})]})}const te=i=>new Promise((r,s)=>{const o=new FileReader;o.onload=()=>r(o.result),o.onerror=s,o.readAsDataURL(i)});function ne({label:i="Image",value:r,onChange:s,error:o,helperText:a,maxSizeMB:n=5,disabled:l=!1}){const[c,d]=y.useState(!1),[u,h]=y.useState(null),x=y.useRef(null),p=y.useId(),g=y.useId(),b=y.useCallback(async m=>{if(h(null),!m.type.startsWith("image/")){h("Only image files are allowed.");return}if(m.size>n*1024*1024){h(`Image must be smaller than ${n}MB.`);return}try{const j=await te(m);s({base64:j,fileName:m.name,fileType:m.type,fileSize:m.size})}catch{h("Failed to read the image file.")}},[n,s]),w=y.useCallback(m=>{var W;if(m.preventDefault(),m.stopPropagation(),d(!1),l)return;const j=(W=m.dataTransfer.files)==null?void 0:W[0];j&&b(j)},[l,b]),f=m=>{m.preventDefault(),m.stopPropagation(),l||d(!0)},k=m=>{m.preventDefault(),m.stopPropagation(),d(!1)},B=m=>{var W;const j=(W=m.target.files)==null?void 0:W[0];j&&b(j),m.target.value=""},I=m=>{var j;m.target!==x.current&&(l||(j=x.current)==null||j.click())},C=m=>{var j;m.stopPropagation(),s(null),h(null),(j=x.current)==null||j.focus()},v=o||!!u,S=u||a;return e.jsxs(t.Box,{children:[e.jsx(t.Typography,{component:"label",htmlFor:p,variant:"subtitle2",sx:{display:"block",mb:.5},children:i}),e.jsxs(t.Paper,{variant:"outlined",onClick:I,onDrop:w,onDragOver:f,onDragLeave:k,sx:{position:"relative",p:3,textAlign:"center",cursor:l?"not-allowed":"pointer",borderStyle:"dashed",borderWidth:2,borderColor:v?"error.main":c?"primary.main":"divider",bgcolor:c?"action.hover":"background.paper",opacity:l?.5:1,transition:"border-color 0.15s, background-color 0.15s","&:hover":l?void 0:{borderColor:"primary.main",bgcolor:"action.hover"},"&:has(input:focus-visible)":{outline:"2px solid",outlineColor:"primary.main",outlineOffset:2}},children:[e.jsx("input",{ref:x,id:p,type:"file",accept:"image/*",disabled:l,onChange:B,"aria-invalid":v||void 0,"aria-describedby":S?g:void 0,style:N}),r?e.jsxs(t.Stack,{direction:"row",spacing:2,sx:{alignItems:"center",justifyContent:"center"},children:[e.jsx(t.Avatar,{src:r.base64,alt:"",variant:"rounded",sx:{width:56,height:56}}),e.jsxs(t.Box,{sx:{textAlign:"left",minWidth:0},children:[e.jsx(t.Typography,{variant:"body2",noWrap:!0,sx:{maxWidth:220},children:r.fileName}),e.jsxs(t.Typography,{variant:"caption",color:"text.secondary",children:[(r.fileSize/1024).toFixed(1)," KB"]})]}),e.jsx(t.IconButton,{size:"small",onClick:C,disabled:l,"aria-label":`Remove ${r.fileName}`,children:e.jsx(R,{fontSize:"small"})})]}):e.jsxs(t.Stack,{spacing:1,sx:{alignItems:"center"},children:[e.jsx(Q,{color:"action"}),e.jsx(t.Typography,{variant:"body2",color:"text.secondary",children:"Drag & drop an image here, or click to browse"})]})]}),e.jsx(t.Box,{"aria-live":"polite",children:S&&e.jsx(t.FormHelperText,{id:g,error:v,children:S})})]})}const F=y.forwardRef(function(r,s){const{fullWidth:o=!0,label:a,...n}=r,l=y.useId(),c=n.id??l,d=p=>e.jsxs(t.Box,{sx:{width:o?"100%":"auto"},children:[a&&e.jsxs(t.Typography,{component:"label",htmlFor:c,variant:"body2",sx:{display:"block",mb:.5,fontWeight:500},children:[a,n.required&&e.jsx(t.Typography,{component:"span",sx:{color:"error.main",ml:.5},children:"*"})]}),p]});if(n.price){const{price:p,value:g,onChange:b,currencySymbol:w="$",slotProps:f,...k}=n,B=I=>{const C=I.target.value;if(C===""){b(void 0);return}const v=Number(C);Number.isNaN(v)||b(v)};return d(e.jsx(t.TextField,{...k,id:c,ref:s,fullWidth:o,type:"number",value:g??"",onChange:B,hiddenLabel:!0,slotProps:{...f,input:{...f==null?void 0:f.input,startAdornment:e.jsx(t.InputAdornment,{position:"start",children:w})},htmlInput:{min:0,step:"0.01",...f==null?void 0:f.htmlInput},formHelperText:{sx:{mx:0},...f==null?void 0:f.formHelperText}}}))}const{price:u,slotProps:h,...x}=n;return d(e.jsx(t.TextField,{...x,id:c,ref:s,fullWidth:o,hiddenLabel:!0,slotProps:{...h,formHelperText:{sx:{mx:0},...h==null?void 0:h.formHelperText}}}))});function re({options:i,value:r,onChange:s,getOptionLabel:o,isOptionEqualToValue:a,label:n,icon:l,popupIcon:c,width:d=240,variant:u="card",size:h="medium",sx:x}){const p=u==="minimal";return e.jsx(t.Box,{sx:[{width:d},...T(x)],children:e.jsx(t.Autocomplete,{disableClearable:!0,size:h,options:i,getOptionLabel:o,isOptionEqualToValue:a,value:r,popupIcon:c,onChange:(g,b)=>{b!==null&&s(b)},sx:{width:"100%","& .MuiOutlinedInput-root":{borderRadius:p?1:3,bgcolor:"transparent",boxShadow:p?"none":"0 2px 8px rgba(0,0,0,0.06)",transition:"all 0.2s ease","&:hover .MuiOutlinedInput-notchedOutline":{borderColor:"primary.main"},"&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:"primary.main"}}},renderInput:g=>e.jsx(F,{...g,label:n,slotProps:{...g.slotProps,input:{...g.slotProps.input,startAdornment:l?e.jsx(t.InputAdornment,{position:"start",sx:{color:"text.secondary"},children:l}):g.slotProps.input.startAdornment}}})})})}function ie({title:i,subtitle:r,eyebrow:s,actions:o,imageSrc:a,imageAlt:n="",imagePosition:l="right",align:c="auto",background:d="background.paper",minHeight:u="60vh",maxWidth:h=1200,slotProps:x}){var v,S;const p=!!a,g=l==="left",{sx:b,...w}=(x==null?void 0:x.title)??{},{sx:f,...k}=(x==null?void 0:x.subtitle)??{},B=c==="left"?"left":p?{xs:"center",md:"left"}:"center",I=c==="left"?"flex-start":p?{xs:"center",md:"flex-start"}:"center",C=p&&e.jsx(t.Box,{sx:{width:"100%",maxWidth:{xs:"100%",md:550},minWidth:0},children:e.jsx(t.Box,{component:"img",src:a,alt:n,sx:[{width:"100%",height:"auto",maxHeight:{xs:220,sm:280,md:400},borderRadius:2,objectFit:"cover",boxShadow:4,display:"block"},...T((v=x==null?void 0:x.image)==null?void 0:v.sx)]})});return e.jsx(t.Box,{sx:[{minHeight:{xs:"auto",md:u},display:"flex",justifyContent:"center",alignItems:"center",bgcolor:d,px:{xs:2,sm:3},py:{xs:5,md:0}},...T((S=x==null?void 0:x.root)==null?void 0:S.sx)],children:e.jsxs(t.Box,{sx:{width:"100%",maxWidth:h,display:"flex",flexDirection:{xs:"column",md:"row"},alignItems:"center",justifyContent:p?"space-between":"center",gap:{xs:4,md:8}},children:[g&&C,e.jsxs(t.Box,{sx:{width:c==="left"?"100%":"auto",maxWidth:p?{xs:"100%",md:550}:700,minWidth:0,textAlign:B},children:[s&&e.jsx(t.Typography,{variant:"overline",sx:{display:"block",color:"primary.main",fontWeight:700,letterSpacing:"0.14em",mb:1},children:s}),e.jsx(t.Typography,{variant:"h2",component:"h1",...w,sx:[{color:"primary.main",mb:2},...T(b)],children:i}),r&&e.jsx(t.Typography,{variant:"h6",component:"p",...k,sx:[{color:"text.secondary"},...T(f)],children:r}),o&&e.jsx(t.Stack,{direction:"row",spacing:1.5,useFlexGap:!0,sx:{flexWrap:"wrap",justifyContent:I,mt:3},children:o})]}),!g&&C]})})}const oe=400;function H({severity:i,children:r,onClose:s}){const[o,a]=y.useState(!0);return e.jsx(t.Fade,{in:o,timeout:oe,onExited:s,children:e.jsx(t.Box,{sx:{position:"fixed",bottom:{xs:16,sm:24},left:"50%",transform:"translateX(-50%)",zIndex:n=>n.zIndex.snackbar,width:{xs:"calc(100% - 32px)",sm:"auto"},maxWidth:480},children:e.jsx(t.Alert,{severity:i,variant:"standard",action:e.jsx(t.IconButton,{size:"small",color:"inherit",onClick:()=>a(!1),"aria-label":"close",children:e.jsx(R,{fontSize:"small"})}),sx:{backgroundColor:"background.paper",boxShadow:4},children:r})})})}const G={name:"",email:"",subject:"",message:""};function ae({onSubmit:i,submitLabel:r="Send message",submittingLabel:s="Sending…",successMessage:o="Your message has been sent!",errorMessage:a="There was an issue sending your message. Please try again."}){const[n,l]=y.useState(G),[c,d]=y.useState("idle"),u=x=>p=>l(g=>({...g,[x]:p.target.value})),h=async x=>{x.preventDefault(),d("submitting");try{await i(n),l(G),d("success")}catch{d("error")}};return e.jsx(t.Box,{component:"form",onSubmit:h,children:e.jsxs(t.Stack,{spacing:2,children:[e.jsx(F,{label:"Name",value:n.name,onChange:u("name"),required:!0,fullWidth:!0}),e.jsx(F,{label:"Email Address",type:"email",value:n.email,onChange:u("email"),required:!0,fullWidth:!0}),e.jsx(F,{label:"Subject",value:n.subject,onChange:u("subject"),fullWidth:!0}),e.jsx(F,{label:"Your message",value:n.message,onChange:u("message"),required:!0,fullWidth:!0,multiline:!0,minRows:4}),c==="success"&&e.jsx(H,{severity:"success",onClose:()=>d("idle"),children:o}),c==="error"&&e.jsx(H,{severity:"error",onClose:()=>d("idle"),children:a}),e.jsx(t.Button,{type:"submit",variant:"contained",disabled:c==="submitting",fullWidth:!0,children:c==="submitting"?e.jsxs(e.Fragment,{children:[e.jsx(t.CircularProgress,{size:22,color:"inherit","aria-hidden":!0}),e.jsx("span",{style:N,children:s})]}):r})]})})}function se({value:i,onChange:r,min:s=1,max:o=1/0,label:a="quantity",size:n="medium",shape:l="pill",sx:c}){const d=l==="rounded"?{borderRadius:1}:void 0;return e.jsxs(t.Stack,{direction:"row",sx:[{alignItems:"center",width:"fit-content",border:1,borderColor:"divider",borderRadius:l==="rounded"?1:999},...T(c)],children:[e.jsx(t.IconButton,{size:n,"aria-label":`Decrease ${a}`,onClick:()=>r(Math.max(s,i-1)),disabled:i<=s,sx:d,children:e.jsx(J,{fontSize:"small"})}),e.jsx(t.Typography,{component:"output","aria-label":a,sx:{minWidth:32,textAlign:"center",fontWeight:600},children:i}),e.jsx(t.IconButton,{size:n,"aria-label":`Increase ${a}`,onClick:()=>r(Math.min(o,i+1)),disabled:i>=o,sx:d,children:e.jsx(E,{fontSize:"small"})})]})}function le(i){const{items:r,columns:s=3,background:o="transparent",maxWidth:a="lg"}=i;return e.jsx(t.Box,{sx:{bgcolor:o},children:e.jsx(t.Container,{component:"ul",maxWidth:a,sx:{display:"grid",gridTemplateColumns:{md:`repeat(${s}, minmax(0, 1fr))`},gap:{xs:2.5,md:4},my:0,py:4,listStyle:"none"},children:r.map((n,l)=>e.jsxs(t.Stack,{component:"li",direction:"row",spacing:1.75,sx:{alignItems:"flex-start"},children:[e.jsx(t.Box,{sx:{display:"grid",placeItems:"center",flexShrink:0,width:44,height:44,border:1,borderColor:"secondary.main",borderRadius:"50%",bgcolor:"background.paper",color:"primary.main"},children:n.icon}),e.jsxs(t.Box,{children:[e.jsx(t.Typography,{sx:{fontWeight:700},children:n.title}),n.text&&e.jsx(t.Typography,{color:"text.secondary",sx:{mt:.25,fontSize:15},children:n.text})]})]},l))})})}function ce(i){const{value:r,onChange:s,onSubmit:o,placeholder:a="Search",label:n="Search",submitLabel:l="Search",clearLabel:c="Clear search",sx:d}=i;function u(h){h.preventDefault(),o==null||o(r)}return e.jsxs(t.Box,{component:"form",role:"search",onSubmit:u,sx:[{display:"flex",alignItems:"stretch",height:44,overflow:"hidden",border:1,borderColor:"divider",borderRadius:1,bgcolor:"background.paper","&:focus-within":{borderColor:"primary.main"}},...T(d)],children:[e.jsx(t.InputBase,{value:r,onChange:h=>s(h.target.value),placeholder:a,slotProps:{input:{"aria-label":n,enterKeyHint:"search"}},sx:{flex:1,minWidth:0,px:1.5}}),r&&e.jsx(t.IconButton,{size:"small","aria-label":c,onClick:()=>s(""),sx:{alignSelf:"center",mr:.5},children:e.jsx(R,{fontSize:"small"})}),e.jsx(t.ButtonBase,{type:"submit","aria-label":l,sx:{width:48,flexShrink:0,bgcolor:"primary.main",color:"primary.contrastText","&.Mui-focusVisible":{outline:"2px solid",outlineColor:"primary.contrastText",outlineOffset:"-5px"}},children:e.jsx(P,{fontSize:"small"})})]})}function de(i){const{icon:r,title:s,children:o,actions:a,titleVariant:n="h5",titleComponent:l="h3",iconBackground:c="action.hover",sx:d}=i;return e.jsxs(t.Stack,{spacing:1.5,sx:[{alignItems:"center",justifyContent:"center",p:3,textAlign:"center"},...T(d)],children:[e.jsx(t.Box,{sx:{display:"grid",placeItems:"center",width:64,height:64,borderRadius:"50%",bgcolor:c,color:"primary.main"},children:r}),e.jsx(t.Typography,{variant:n,component:l,children:s}),o,a&&e.jsx(t.Stack,{direction:"row",spacing:1.5,useFlexGap:!0,sx:{flexWrap:"wrap",justifyContent:"center",pt:1},children:a})]})}function xe(i){const{items:r,sx:s}=i;return r.length===0?null:e.jsx(t.Box,{component:"dl",sx:[{display:"grid",gridTemplateColumns:"auto 1fr",gap:"6px 16px",m:0},...T(s)],children:r.map((o,a)=>e.jsxs(y.Fragment,{children:[e.jsx(t.Box,{component:"dt",sx:{fontWeight:700},children:o.label}),e.jsx(t.Box,{component:"dd",sx:{m:0,color:"text.secondary",overflowWrap:"anywhere"},children:o.value})]},a))})}const he={background:"grey.900",text:"grey.300",heading:"common.white",divider:"grey.800"};function ue(i){const{brand:r,description:s,columns:o=[],bottom:a,bottomAlign:n="left",colors:l,maxWidth:c="lg"}=i,d={...he,...l};return e.jsxs(t.Box,{component:"footer",sx:{bgcolor:d.background,color:d.text,"& a":{color:"inherit",textDecoration:"underline",textUnderlineOffset:"0.2em","&:focus-visible":{outline:"2px solid currentColor",outlineOffset:2,borderRadius:"2px"}},"& li a":{textDecoration:"none","&:hover, &:focus-visible":{textDecoration:"underline"}}},children:[e.jsxs(t.Container,{maxWidth:c,sx:{display:"grid",gridTemplateColumns:{xs:"repeat(2, minmax(0, 1fr))",md:o.length?`2fr repeat(${o.length}, minmax(0, 1fr))`:"1fr"},gap:"28px 24px",pt:5,pb:3.5},children:[e.jsxs(t.Box,{sx:{gridColumn:{xs:"1 / -1",md:"auto"}},children:[e.jsx(t.Box,{sx:{mb:1,color:d.heading},children:r}),s&&e.jsx(t.Typography,{sx:{maxWidth:"34ch",fontSize:15},children:s})]}),o.map(u=>e.jsxs(t.Box,{component:"nav","aria-label":u.title,sx:u.wide?{gridColumn:{xs:"1 / -1",md:"auto"}}:void 0,children:[e.jsx(t.Typography,{component:"h2",sx:{mb:1.25,color:d.heading,fontSize:13,fontWeight:700,letterSpacing:"0.12em",textTransform:"uppercase"},children:u.title}),e.jsx(t.Stack,{component:"ul",spacing:1,sx:{m:0,p:0,listStyle:"none",fontSize:15},children:u.items.map((h,x)=>e.jsx(t.Box,{component:"li",sx:{overflowWrap:"anywhere"},children:h},x))})]},u.title))]}),a&&e.jsx(t.Box,{sx:{borderTop:1,borderColor:d.divider},children:e.jsx(t.Container,{maxWidth:c,sx:{display:"flex",justifyContent:n==="right"?"flex-end":"flex-start",py:1},children:e.jsx(t.Typography,{variant:"body2",sx:{fontSize:13},children:a})})})]})}exports.Autocomplete=re;exports.ConfirmDialog=$;exports.ContactForm=ae;exports.DetailList=xe;exports.DismissibleAlert=H;exports.FeatureList=le;exports.HeroBanner=ie;exports.ImageField=ne;exports.ItemGrid=ee;exports.MediaCard=X;exports.MediaCardSkeleton=Z;exports.QuantityPicker=se;exports.SearchField=ce;exports.SiteFooter=ue;exports.StatusPanel=de;exports.TextField=F;exports.TitledDialog=O;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),y=require("react"),t=require("@mui/material"),Y=require("@mui/icons-material/Edit"),K=require("@mui/icons-material/Delete"),R=require("@mui/icons-material/Close"),G=require("@mui/icons-material/Add"),P=require("@mui/icons-material/CloudUpload"),Q=require("@mui/icons-material/Remove"),J=require("@mui/icons-material/StorefrontOutlined"),X=require("@mui/icons-material/Search");function z({open:i,onClose:n,title:a,children:o,actions:s,maxWidth:r="sm",disableClose:l=!1}){const d=y.useId();return e.jsxs(t.Dialog,{open:i,onClose:()=>!l&&n(),fullWidth:!0,maxWidth:r,"aria-labelledby":d,children:[e.jsxs(t.Stack,{direction:"row",sx:{alignItems:"center",borderBottom:2,borderColor:"divider",pr:3},children:[e.jsx(t.DialogTitle,{id:d,sx:{flex:1,minWidth:0},children:a}),e.jsx(t.IconButton,{size:"small",onClick:n,disabled:l,"aria-label":"Close",children:e.jsx(R,{fontSize:"small"})})]}),e.jsxs(t.DialogContent,{sx:{padding:0},children:[o,s&&e.jsx(t.Stack,{direction:"row",spacing:2,sx:{justifyContent:"flex-end",borderTop:2,borderColor:"divider",p:2},children:s})]})]})}function $({open:i,onClose:n,onConfirm:a,title:o,message:s,confirmLabel:r="Confirm",cancelLabel:l="Cancel",pendingLabel:d,confirmColor:c="error",errorMessage:u="Something went wrong. Please try again."}){const[h,x]=y.useState(!1),[p,b]=y.useState(!1),m=()=>{b(!1),n()},C=async()=>{x(!0),b(!1);try{await a()}catch{b(!0),x(!1);return}x(!1),m()};return e.jsx(z,{open:i,onClose:m,title:o,maxWidth:"xs",disableClose:h,actions:e.jsxs(e.Fragment,{children:[e.jsx(t.Button,{variant:"outlined",color:"inherit",onClick:m,disabled:h,children:l}),e.jsx(t.Button,{variant:"contained",color:c,onClick:C,disabled:h,children:h&&d?d:r})]}),children:e.jsxs(t.Box,{sx:{p:2},children:[e.jsx(t.Typography,{component:"div",children:s}),p&&e.jsx(t.Alert,{severity:"error",sx:{mt:2},children:u})]})})}function I(i){return i?Array.isArray(i)?i:[i]:[]}const N={border:0,clip:"rect(0 0 0 0)",clipPath:"inset(50%)",height:1,margin:-1,overflow:"hidden",padding:0,position:"absolute",whiteSpace:"nowrap",width:1};function V(i,n){return i==="outlined"?{borderRadius:1,border:1,borderColor:"divider",boxShadow:"none",...n&&{transition:"border-color 0.2s ease","&:hover":{borderColor:"primary.main"}}}:{borderRadius:3,boxShadow:"0 4px 16px rgba(0,0,0,0.08)",...n&&{transition:"all 0.25s ease","&:hover":{transform:"translateY(-4px)",boxShadow:"0 10px 28px rgba(0,0,0,0.12)"}}}}function q(i,n){return n?{width:"100%",height:"auto",aspectRatio:n}:{height:i}}function Z({image:i,imageAlt:n="",imageHeight:a=260,imageAspectRatio:o,fallback:s=e.jsx(t.Typography,{children:"No Image Available"}),title:r,titleComponent:l,subtitle:d,description:c,descriptionLines:u=3,highlight:h,footer:x,actions:p,variant:b="elevated",density:m="comfortable",sx:C,onEdit:g,editForm:B,editLabel:k="Edit",onDelete:T,deleteLabel:S="Delete",deleteConfirmMessage:v="Are you sure you want to delete this item? This action cannot be undone.",onClick:w}){const[f,j]=y.useState(!1),[W,L]=y.useState(!1),O=!!(g&&B),M=!!T,D=m==="compact",A=D?1.75:3,U=async _=>{g&&(await g(_),j(!1))};return e.jsxs(t.Box,{sx:{position:"relative",height:"100%"},children:[(O||M)&&e.jsxs(t.Stack,{direction:"row",spacing:.5,sx:{position:"absolute",top:8,right:8,zIndex:1,bgcolor:"background.paper",borderRadius:1,boxShadow:1},children:[O&&e.jsx(t.IconButton,{size:"small",onClick:()=>j(!0),"aria-label":k,children:e.jsx(Y,{fontSize:"small"})}),M&&e.jsx(t.IconButton,{size:"small",onClick:()=>L(!0),"aria-label":S,children:e.jsx(K,{fontSize:"small",color:"error"})})]}),e.jsxs(t.Card,{sx:[{position:"relative",height:"100%",display:"flex",flexDirection:"column",overflow:"hidden",...V(b,!!w)},...I(C)],children:[i?e.jsx(t.CardMedia,{component:"img",image:i,alt:n,sx:{...q(a,o),objectFit:"cover",bgcolor:"background.default"}}):e.jsx(t.Box,{sx:{...q(a,o),display:"flex",alignItems:"center",justifyContent:"center",bgcolor:"grey.100",color:"text.secondary"},children:s}),e.jsxs(t.CardContent,{sx:{display:"flex",flexDirection:"column",flexGrow:1,p:A,pb:p?0:A,"&:last-child":{pb:A}},children:[e.jsx(t.Typography,{variant:D?"subtitle1":"h6",...l&&{component:l},sx:{fontWeight:600,color:"text.primary",mb:D?.5:1,...D&&{lineHeight:1.3}},children:w?e.jsx(t.ButtonBase,{onClick:w,disableRipple:!0,sx:{position:"static",font:"inherit",letterSpacing:"inherit",textAlign:"inherit",color:"inherit","&::after":{content:'""',position:"absolute",inset:0,borderRadius:"inherit"},"&.Mui-focusVisible::after":{outline:"2px solid",outlineColor:"primary.main",outlineOffset:"-2px"}},children:r}):r}),d&&e.jsx(t.Typography,{variant:"body2",color:"text.secondary",sx:{mb:D?.5:1},children:d}),c&&e.jsx(t.Typography,{variant:"body2",color:"text.secondary",sx:{flexGrow:1,mb:2,display:"-webkit-box",WebkitLineClamp:u,WebkitBoxOrient:"vertical",overflow:"hidden"},children:c}),h&&e.jsx(t.Typography,{variant:D?"h6":"h5",sx:{fontWeight:700,color:"primary.main",...D?{mt:"auto",pt:.5}:{mb:2}},children:h}),D&&x?e.jsx(t.Box,{sx:{mt:1},children:x}):x]}),p&&e.jsx(t.Box,{sx:{position:"relative",zIndex:1,px:A,pt:D?1.5:2,pb:A},children:p})]}),O&&e.jsx(z,{open:f,onClose:()=>j(!1),title:k,children:B({onSubmit:U,onCancel:()=>j(!1)})}),M&&e.jsx($,{open:W,onClose:()=>L(!1),onConfirm:T,title:S,message:v,confirmLabel:S,pendingLabel:"Deleting…"})]})}function ee({imageHeight:i=260,imageAspectRatio:n,variant:a="elevated",density:o="comfortable"}){const s=o==="compact";return e.jsxs(t.Card,{sx:{width:"100%",overflow:"hidden",...V(a,!1)},children:[e.jsx(t.Skeleton,{variant:"rectangular",animation:"wave",sx:{width:"100%",...q(i,n)}}),e.jsxs(t.Box,{sx:{p:s?1.75:3},children:[e.jsx(t.Skeleton,{animation:"wave",width:"60%",height:s?24:32,sx:{mb:1}}),!s&&e.jsxs(e.Fragment,{children:[e.jsx(t.Skeleton,{animation:"wave",height:20}),e.jsx(t.Skeleton,{animation:"wave",height:20})]}),e.jsx(t.Skeleton,{animation:"wave",width:"30%",height:s?28:36,sx:{mt:s?0:2}})]})]})}function te({items:i,renderItem:n,getItemKey:a,margin:o={xs:3,lg:8},spacing:s=2,gridSize:r={xs:12,sm:6,md:4},onAddNewItem:l,addNewItemForm:d,addNewItemLabel:c="Add New Item",loading:u=!1,skeletonCount:h=6,skeletonWidth:x="100%",skeletonHeight:p=450,renderSkeleton:b,header:m}){const[C,g]=y.useState(!1),B=!!(l&&d),k={xs:r.xs,sm:r.sm?Math.max(1,Math.floor(r.sm/2)):void 0,md:r.md?Math.max(1,Math.floor(r.md/2)):void 0,lg:r.lg?Math.max(1,Math.floor(r.lg/2)):void 0},T=async v=>{l&&(await l(v),g(!1))},S=e.jsxs(t.Card,{sx:{width:"100%",maxWidth:x,minHeight:p,mx:"auto",borderRadius:3,overflow:"hidden",boxShadow:"0 4px 16px rgba(0,0,0,0.08)"},children:[e.jsx(t.Skeleton,{variant:"rectangular",animation:"wave",height:260,sx:{width:"100%"}}),e.jsxs(t.Box,{sx:{p:3},children:[e.jsx(t.Skeleton,{animation:"wave",width:"60%",height:32,sx:{mb:1}}),e.jsx(t.Skeleton,{animation:"wave",height:20}),e.jsx(t.Skeleton,{animation:"wave",height:20}),e.jsx(t.Skeleton,{animation:"wave",width:"30%",height:36,sx:{mt:2}})]})]});return e.jsxs(t.Box,{sx:{margin:o},children:[m&&e.jsx(t.Box,{sx:{mb:3},children:m}),e.jsxs(t.Grid,{container:!0,spacing:s,sx:{width:"100%"},children:[u?Array.from({length:h}).map((v,w)=>e.jsx(t.Grid,{size:r,children:b?b():S},`skeleton-${w}`)):i.map(v=>e.jsx(t.Grid,{size:r,children:n(v)},a(v))),!u&&B&&e.jsx(t.Grid,{size:k,children:e.jsx(t.Box,{sx:{height:"100%",minHeight:160,display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsx(t.Card,{variant:"outlined",sx:{width:"100%",height:"50%",minHeight:80,display:"flex",alignItems:"center",justifyContent:"center",bgcolor:"rgba(0, 0, 0, 0.04)",border:"3px dashed",borderColor:"grey.400",boxShadow:"none",transition:"all 0.2s ease",borderRadius:4,"&:hover":{bgcolor:"rgba(0, 0, 0, 0.08)",borderColor:"primary.main"}},children:e.jsxs(t.CardActionArea,{onClick:()=>g(!0),sx:{height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:1,p:2},children:[e.jsx(G,{fontSize:"large",color:"action"}),e.jsx(t.Typography,{color:"text.secondary",children:c})]})})})})]}),B&&e.jsx(z,{open:C,onClose:()=>g(!1),title:c,children:d({onSubmit:T,onCancel:()=>g(!1)})})]})}const ne=i=>new Promise((n,a)=>{const o=new FileReader;o.onload=()=>n(o.result),o.onerror=a,o.readAsDataURL(i)});function re({label:i="Image",value:n,onChange:a,error:o,helperText:s,maxSizeMB:r=5,disabled:l=!1}){const[d,c]=y.useState(!1),[u,h]=y.useState(null),x=y.useRef(null),p=y.useId(),b=y.useId(),m=y.useCallback(async f=>{if(h(null),!f.type.startsWith("image/")){h("Only image files are allowed.");return}if(f.size>r*1024*1024){h(`Image must be smaller than ${r}MB.`);return}try{const j=await ne(f);a({base64:j,fileName:f.name,fileType:f.type,fileSize:f.size})}catch{h("Failed to read the image file.")}},[r,a]),C=y.useCallback(f=>{var W;if(f.preventDefault(),f.stopPropagation(),c(!1),l)return;const j=(W=f.dataTransfer.files)==null?void 0:W[0];j&&m(j)},[l,m]),g=f=>{f.preventDefault(),f.stopPropagation(),l||c(!0)},B=f=>{f.preventDefault(),f.stopPropagation(),c(!1)},k=f=>{var W;const j=(W=f.target.files)==null?void 0:W[0];j&&m(j),f.target.value=""},T=f=>{var j;f.target!==x.current&&(l||(j=x.current)==null||j.click())},S=f=>{var j;f.stopPropagation(),a(null),h(null),(j=x.current)==null||j.focus()},v=o||!!u,w=u||s;return e.jsxs(t.Box,{children:[e.jsx(t.Typography,{component:"label",htmlFor:p,variant:"subtitle2",sx:{display:"block",mb:.5},children:i}),e.jsxs(t.Paper,{variant:"outlined",onClick:T,onDrop:C,onDragOver:g,onDragLeave:B,sx:{position:"relative",p:3,textAlign:"center",cursor:l?"not-allowed":"pointer",borderStyle:"dashed",borderWidth:2,borderColor:v?"error.main":d?"primary.main":"divider",bgcolor:d?"action.hover":"background.paper",opacity:l?.5:1,transition:"border-color 0.15s, background-color 0.15s","&:hover":l?void 0:{borderColor:"primary.main",bgcolor:"action.hover"},"&:has(input:focus-visible)":{outline:"2px solid",outlineColor:"primary.main",outlineOffset:2}},children:[e.jsx("input",{ref:x,id:p,type:"file",accept:"image/*",disabled:l,onChange:k,"aria-invalid":v||void 0,"aria-describedby":w?b:void 0,style:N}),n?e.jsxs(t.Stack,{direction:"row",spacing:2,sx:{alignItems:"center",justifyContent:"center"},children:[e.jsx(t.Avatar,{src:n.base64,alt:"",variant:"rounded",sx:{width:56,height:56}}),e.jsxs(t.Box,{sx:{textAlign:"left",minWidth:0},children:[e.jsx(t.Typography,{variant:"body2",noWrap:!0,sx:{maxWidth:220},children:n.fileName}),e.jsxs(t.Typography,{variant:"caption",color:"text.secondary",children:[(n.fileSize/1024).toFixed(1)," KB"]})]}),e.jsx(t.IconButton,{size:"small",onClick:S,disabled:l,"aria-label":`Remove ${n.fileName}`,children:e.jsx(R,{fontSize:"small"})})]}):e.jsxs(t.Stack,{spacing:1,sx:{alignItems:"center"},children:[e.jsx(P,{color:"action"}),e.jsx(t.Typography,{variant:"body2",color:"text.secondary",children:"Drag & drop an image here, or click to browse"})]})]}),e.jsx(t.Box,{"aria-live":"polite",children:w&&e.jsx(t.FormHelperText,{id:b,error:v,children:w})})]})}const F=y.forwardRef(function(n,a){const{fullWidth:o=!0,label:s,...r}=n,l=y.useId(),d=r.id??l,c=p=>e.jsxs(t.Box,{sx:{width:o?"100%":"auto"},children:[s&&e.jsxs(t.Typography,{component:"label",id:`${d}-label`,htmlFor:d,variant:"body2",sx:{display:"block",mb:.5,fontWeight:500},children:[s,r.required&&e.jsx(t.Typography,{component:"span",sx:{color:"error.main",ml:.5},children:"*"})]}),p]});if(r.price){const{price:p,value:b,onChange:m,currencySymbol:C="$",slotProps:g,...B}=r,k=T=>{const S=T.target.value;if(S===""){m(void 0);return}const v=Number(S);Number.isNaN(v)||m(v)};return c(e.jsx(t.TextField,{...B,id:d,ref:a,fullWidth:o,type:"number",value:b??"",onChange:k,hiddenLabel:!0,slotProps:{...g,input:{...g==null?void 0:g.input,startAdornment:e.jsx(t.InputAdornment,{position:"start",children:C})},htmlInput:{min:0,step:"0.01",...g==null?void 0:g.htmlInput},formHelperText:{sx:{mx:0},...g==null?void 0:g.formHelperText}}}))}const{price:u,slotProps:h,...x}=r;return c(e.jsx(t.TextField,{...x,id:d,ref:a,fullWidth:o,hiddenLabel:!0,slotProps:{...h,formHelperText:{sx:{mx:0},...h==null?void 0:h.formHelperText}}}))});function ie({options:i,value:n,onChange:a,getOptionLabel:o,isOptionEqualToValue:s,label:r,icon:l,popupIcon:d,width:c=240,variant:u="card",size:h="medium",sx:x}){const p=u==="minimal";return e.jsx(t.Box,{sx:[{width:c},...I(x)],children:e.jsx(t.Autocomplete,{disableClearable:!0,size:h,options:i,getOptionLabel:o,isOptionEqualToValue:s,value:n,popupIcon:d,onChange:(b,m)=>{m!==null&&a(m)},sx:{width:"100%","& .MuiOutlinedInput-root":{borderRadius:p?1:3,bgcolor:"transparent",boxShadow:p?"none":"0 2px 8px rgba(0,0,0,0.06)",transition:"all 0.2s ease","&:hover .MuiOutlinedInput-notchedOutline":{borderColor:"primary.main"},"&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:"primary.main"}}},renderInput:b=>e.jsx(F,{...b,label:r,slotProps:{...b.slotProps,input:{...b.slotProps.input,startAdornment:l?e.jsx(t.InputAdornment,{position:"start",sx:{color:"text.secondary"},children:l}):b.slotProps.input.startAdornment}}})})})}function oe({title:i,subtitle:n,eyebrow:a,actions:o,imageSrc:s,imageAlt:r="",imagePosition:l="right",align:d="auto",background:c="background.paper",minHeight:u="60vh",maxWidth:h=1200,slotProps:x}){var v,w;const p=!!s,b=l==="left",{sx:m,...C}=(x==null?void 0:x.title)??{},{sx:g,...B}=(x==null?void 0:x.subtitle)??{},k=d==="left"?"left":p?{xs:"center",md:"left"}:"center",T=d==="left"?"flex-start":p?{xs:"center",md:"flex-start"}:"center",S=p&&e.jsx(t.Box,{sx:{width:"100%",maxWidth:{xs:"100%",md:550},minWidth:0},children:e.jsx(t.Box,{component:"img",src:s,alt:r,sx:[{width:"100%",height:"auto",maxHeight:{xs:220,sm:280,md:400},borderRadius:2,objectFit:"cover",boxShadow:4,display:"block"},...I((v=x==null?void 0:x.image)==null?void 0:v.sx)]})});return e.jsx(t.Box,{sx:[{minHeight:{xs:"auto",md:u},display:"flex",justifyContent:"center",alignItems:"center",bgcolor:c,px:{xs:2,sm:3},py:{xs:5,md:0}},...I((w=x==null?void 0:x.root)==null?void 0:w.sx)],children:e.jsxs(t.Box,{sx:{width:"100%",maxWidth:h,display:"flex",flexDirection:{xs:"column",md:"row"},alignItems:"center",justifyContent:p?"space-between":"center",gap:{xs:4,md:8}},children:[b&&S,e.jsxs(t.Box,{sx:{width:d==="left"?"100%":"auto",maxWidth:p?{xs:"100%",md:550}:700,minWidth:0,textAlign:k},children:[a&&e.jsx(t.Typography,{variant:"overline",sx:{display:"block",color:"primary.main",fontWeight:700,letterSpacing:"0.14em",mb:1},children:a}),e.jsx(t.Typography,{variant:"h2",component:"h1",...C,sx:[{color:"primary.main",mb:2},...I(m)],children:i}),n&&e.jsx(t.Typography,{variant:"h6",component:"p",...B,sx:[{color:"text.secondary"},...I(g)],children:n}),o&&e.jsx(t.Stack,{direction:"row",spacing:1.5,useFlexGap:!0,sx:{flexWrap:"wrap",justifyContent:T,mt:3},children:o})]}),!b&&S]})})}const ae=400;function H({severity:i,children:n,onClose:a}){const[o,s]=y.useState(!0);return e.jsx(t.Fade,{in:o,timeout:ae,onExited:a,children:e.jsx(t.Box,{sx:{position:"fixed",bottom:{xs:16,sm:24},left:"50%",transform:"translateX(-50%)",zIndex:r=>r.zIndex.snackbar,width:{xs:"calc(100% - 32px)",sm:"auto"},maxWidth:480},children:e.jsx(t.Alert,{severity:i,variant:"standard",action:e.jsx(t.IconButton,{size:"small",color:"inherit",onClick:()=>s(!1),"aria-label":"close",children:e.jsx(R,{fontSize:"small"})}),sx:{backgroundColor:"background.paper",boxShadow:4},children:n})})})}const E={name:"",email:"",subject:"",message:""};function se({onSubmit:i,submitLabel:n="Send message",submittingLabel:a="Sending…",successMessage:o="Your message has been sent!",errorMessage:s="There was an issue sending your message. Please try again.",subjectOptions:r,subjectPlaceholder:l="Choose a subject"}){const d=y.useId(),[c,u]=y.useState(E),[h,x]=y.useState("idle"),p=m=>C=>u(g=>({...g,[m]:C.target.value})),b=async m=>{m.preventDefault(),x("submitting");try{await i(c),u(E),x("success")}catch{x("error")}};return e.jsx(t.Box,{component:"form",onSubmit:b,children:e.jsxs(t.Stack,{spacing:2,children:[e.jsx(F,{label:"Name",value:c.name,onChange:p("name"),required:!0,fullWidth:!0}),e.jsx(F,{label:"Email Address",type:"email",value:c.email,onChange:p("email"),required:!0,fullWidth:!0}),r?e.jsx(F,{label:"Subject",select:!0,value:c.subject,onChange:p("subject"),required:!0,fullWidth:!0,id:d,slotProps:{select:{labelId:`${d}-label`,displayEmpty:!0,renderValue:m=>m?String(m):e.jsx(t.Box,{component:"span",sx:{color:"text.secondary"},children:l})}},children:r.map(m=>e.jsx(t.MenuItem,{value:m,children:m},m))}):e.jsx(F,{label:"Subject",value:c.subject,onChange:p("subject"),fullWidth:!0}),e.jsx(F,{label:"Your message",value:c.message,onChange:p("message"),required:!0,fullWidth:!0,multiline:!0,minRows:4}),h==="success"&&e.jsx(H,{severity:"success",onClose:()=>x("idle"),children:o}),h==="error"&&e.jsx(H,{severity:"error",onClose:()=>x("idle"),children:s}),e.jsx(t.Button,{type:"submit",variant:"contained",disabled:h==="submitting",fullWidth:!0,children:h==="submitting"?e.jsxs(e.Fragment,{children:[e.jsx(t.CircularProgress,{size:22,color:"inherit","aria-hidden":!0}),e.jsx("span",{style:N,children:a})]}):n})]})})}function le({value:i,onChange:n,min:a=1,max:o=1/0,label:s="quantity",size:r="medium",shape:l="pill",sx:d}){const c=l==="rounded"?{borderRadius:1}:void 0;return e.jsxs(t.Stack,{direction:"row",sx:[{alignItems:"center",width:"fit-content",border:1,borderColor:"divider",borderRadius:l==="rounded"?1:999},...I(d)],children:[e.jsx(t.IconButton,{size:r,"aria-label":`Decrease ${s}`,onClick:()=>n(Math.max(a,i-1)),disabled:i<=a,sx:c,children:e.jsx(Q,{fontSize:"small"})}),e.jsx(t.Typography,{component:"output","aria-label":s,sx:{minWidth:32,textAlign:"center",fontWeight:600},children:i}),e.jsx(t.IconButton,{size:r,"aria-label":`Increase ${s}`,onClick:()=>n(Math.min(o,i+1)),disabled:i>=o,sx:c,children:e.jsx(G,{fontSize:"small"})})]})}function ce(i){const{items:n,columns:a=3,background:o="transparent",maxWidth:s="lg"}=i;return e.jsx(t.Box,{sx:{bgcolor:o},children:e.jsx(t.Container,{component:"ul",maxWidth:s,sx:{display:"grid",gridTemplateColumns:{md:`repeat(${a}, minmax(0, 1fr))`},gap:{xs:2.5,md:4},my:0,py:4,listStyle:"none"},children:n.map((r,l)=>e.jsxs(t.Stack,{component:"li",direction:"row",spacing:1.75,sx:{alignItems:"flex-start"},children:[e.jsx(t.Box,{sx:{display:"grid",placeItems:"center",flexShrink:0,width:44,height:44,border:1,borderColor:"secondary.main",borderRadius:"50%",bgcolor:"background.paper",color:"primary.main"},children:r.icon}),e.jsxs(t.Box,{children:[e.jsx(t.Typography,{sx:{fontWeight:700},children:r.title}),r.text&&e.jsx(t.Typography,{color:"text.secondary",sx:{mt:.25,fontSize:15},children:r.text})]})]},l))})})}function de(i){const{items:n,title:a,placeholderIcon:o=e.jsx(J,{}),tileBackground:s="background.default",maxWidth:r="lg",sx:l}=i,d=y.useId(),c={width:"100%",aspectRatio:"1 / 1",borderRadius:"50%",p:"4px",border:1,borderColor:"divider",bgcolor:s};return e.jsxs(t.Container,{component:"section",maxWidth:r,"aria-labelledby":a?d:void 0,sx:[{display:"flex",flexDirection:"column",alignItems:"center",gap:3},...I(l)],children:[a&&e.jsx(t.Typography,{id:d,variant:"h3",component:"h2",children:a}),e.jsx(t.Box,{component:"ul",sx:{display:"grid",gridTemplateColumns:`repeat(${n.length}, minmax(0, 1fr))`,gap:{xs:1.5,md:2},width:"100%",maxWidth:n.length*190,m:0,p:0,listStyle:"none"},children:n.map(u=>e.jsx("li",{children:e.jsxs(t.ButtonBase,{onClick:u.onClick,sx:{display:"flex",flexDirection:"column",gap:1,width:"100%",borderRadius:1,color:"text.primary",fontSize:15,fontWeight:600,lineHeight:1.3,textAlign:"center","&:hover .category-tile-label":{textDecoration:"underline"},"&.Mui-focusVisible":{outline:2,outlineColor:"primary.main",outlineOffset:4}},children:[u.image?e.jsx(t.Box,{component:"img",src:u.image,alt:"",loading:"lazy",sx:{...c,display:"block",objectFit:"cover"}}):e.jsx(t.Box,{"aria-hidden":!0,sx:{...c,display:"grid",placeItems:"center",color:"primary.main"},children:o}),e.jsx(t.Box,{component:"span",className:"category-tile-label",children:u.label})]})},u.label))})]})}function xe(i){const{value:n,onChange:a,onSubmit:o,placeholder:s="Search",label:r="Search",submitLabel:l="Search",clearLabel:d="Clear search",sx:c}=i;function u(h){h.preventDefault(),o==null||o(n)}return e.jsxs(t.Box,{component:"form",role:"search",onSubmit:u,sx:[{display:"flex",alignItems:"stretch",height:44,overflow:"hidden",border:1,borderColor:"divider",borderRadius:1,bgcolor:"background.paper","&:focus-within":{borderColor:"primary.main"}},...I(c)],children:[e.jsx(t.InputBase,{value:n,onChange:h=>a(h.target.value),placeholder:s,slotProps:{input:{"aria-label":r,enterKeyHint:"search"}},sx:{flex:1,minWidth:0,px:1.5}}),n&&e.jsx(t.IconButton,{size:"small","aria-label":d,onClick:()=>a(""),sx:{alignSelf:"center",mr:.5},children:e.jsx(R,{fontSize:"small"})}),e.jsx(t.ButtonBase,{type:"submit","aria-label":l,sx:{width:48,flexShrink:0,bgcolor:"primary.main",color:"primary.contrastText","&.Mui-focusVisible":{outline:"2px solid",outlineColor:"primary.contrastText",outlineOffset:"-5px"}},children:e.jsx(X,{fontSize:"small"})})]})}function he(i){const{icon:n,title:a,children:o,actions:s,titleVariant:r="h5",titleComponent:l="h3",iconBackground:d="action.hover",sx:c}=i;return e.jsxs(t.Stack,{spacing:1.5,sx:[{alignItems:"center",justifyContent:"center",p:3,textAlign:"center"},...I(c)],children:[e.jsx(t.Box,{sx:{display:"grid",placeItems:"center",width:64,height:64,borderRadius:"50%",bgcolor:d,color:"primary.main"},children:n}),e.jsx(t.Typography,{variant:r,component:l,children:a}),o,s&&e.jsx(t.Stack,{direction:"row",spacing:1.5,useFlexGap:!0,sx:{flexWrap:"wrap",justifyContent:"center",pt:1},children:s})]})}function ue(i){const{items:n,sx:a}=i;return n.length===0?null:e.jsx(t.Box,{component:"dl",sx:[{display:"grid",gridTemplateColumns:"auto 1fr",gap:"6px 16px",m:0},...I(a)],children:n.map((o,s)=>e.jsxs(y.Fragment,{children:[e.jsx(t.Box,{component:"dt",sx:{fontWeight:700},children:o.label}),e.jsx(t.Box,{component:"dd",sx:{m:0,color:"text.secondary",overflowWrap:"anywhere"},children:o.value})]},s))})}const me={background:"grey.900",text:"grey.300",heading:"common.white",divider:"grey.800"};function pe(i){const{brand:n,description:a,columns:o=[],bottom:s,bottomAlign:r="left",colors:l,maxWidth:d="lg"}=i,c={...me,...l};return e.jsxs(t.Box,{component:"footer",sx:{bgcolor:c.background,color:c.text,"& a":{color:"inherit",textDecoration:"underline",textUnderlineOffset:"0.2em","&:focus-visible":{outline:"2px solid currentColor",outlineOffset:2,borderRadius:"2px"}},"& li a":{textDecoration:"none","&:hover, &:focus-visible":{textDecoration:"underline"}}},children:[e.jsxs(t.Container,{maxWidth:d,sx:{display:"grid",gridTemplateColumns:{xs:"repeat(2, minmax(0, 1fr))",md:o.length?`2fr repeat(${o.length}, minmax(0, 1fr))`:"1fr"},gap:"28px 24px",pt:5,pb:3.5},children:[e.jsxs(t.Box,{sx:{gridColumn:{xs:"1 / -1",md:"auto"}},children:[e.jsx(t.Box,{sx:{mb:1,color:c.heading},children:n}),a&&e.jsx(t.Typography,{sx:{maxWidth:"34ch",fontSize:15},children:a})]}),o.map(u=>e.jsxs(t.Box,{component:"nav","aria-label":u.title,sx:u.wide?{gridColumn:{xs:"1 / -1",md:"auto"}}:void 0,children:[e.jsx(t.Typography,{component:"h2",sx:{mb:1.25,color:c.heading,fontSize:13,fontWeight:700,letterSpacing:"0.12em",textTransform:"uppercase"},children:u.title}),e.jsx(t.Stack,{component:"ul",spacing:1,sx:{m:0,p:0,listStyle:"none",fontSize:15},children:u.items.map((h,x)=>e.jsx(t.Box,{component:"li",sx:{overflowWrap:"anywhere"},children:h},x))})]},u.title))]}),s&&e.jsx(t.Box,{sx:{borderTop:1,borderColor:c.divider},children:e.jsx(t.Container,{maxWidth:d,sx:{display:"flex",justifyContent:r==="right"?"flex-end":"flex-start",py:1},children:e.jsx(t.Typography,{variant:"body2",sx:{fontSize:13},children:s})})})]})}exports.Autocomplete=ie;exports.CategoryTiles=de;exports.ConfirmDialog=$;exports.ContactForm=se;exports.DetailList=ue;exports.DismissibleAlert=H;exports.FeatureList=ce;exports.HeroBanner=oe;exports.ImageField=re;exports.ItemGrid=te;exports.MediaCard=Z;exports.MediaCardSkeleton=ee;exports.QuantityPicker=le;exports.SearchField=xe;exports.SiteFooter=pe;exports.StatusPanel=he;exports.TextField=F;exports.TitledDialog=z;
2
2
  //# sourceMappingURL=sosk-ui-lib.cjs.map