{"version":3,"file":"Breadcrumbs.el87gr2f.mjs","names":["useState","startTransition"],"sources":["https:/framerusercontent.com/modules/CT0zL8ayOQjukbSTLVzH/i4noTlC0ZBgd8fn0BGH3/Breadcrumbs.js"],"sourcesContent":["// Breadcrumbs component that dynamically displays current and parent pages with slashes as separators\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{useEffect,useState,startTransition}from\"react\";/**\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n */export default function Breadcrumbs(props){const{separator=\"/\",textColor=\"#666666\",activeColor=\"#000000\",hoverColor=\"#333333\",font,showHome=true,homeLabel=\"Home\",spacing=8}=props;const[breadcrumbs,setBreadcrumbs]=useState([]);const[hoveredIndex,setHoveredIndex]=useState(null);useEffect(()=>{if(typeof window===\"undefined\"){startTransition(()=>{setBreadcrumbs([{label:\"Home\",path:\"/\"},{label:\"Products\",path:\"/products\"},{label:\"Category\",path:\"/products/category\"}]);});return;}const pathname=window.location.pathname;const segments=pathname.split(\"/\").filter(Boolean);const crumbs=[];if(showHome){crumbs.push({label:homeLabel,path:\"/\"});}segments.forEach((segment,index)=>{const path=\"/\"+segments.slice(0,index+1).join(\"/\");const label=segment.split(\"-\").map(word=>word.charAt(0).toUpperCase()+word.slice(1)).join(\" \");crumbs.push({label,path});});startTransition(()=>{setBreadcrumbs(crumbs);});},[showHome,homeLabel]);const handleClick=(path,index)=>{if(typeof window===\"undefined\")return;if(index===breadcrumbs.length-1)return;window.location.href=path;};return /*#__PURE__*/_jsx(\"nav\",{\"aria-label\":\"Breadcrumb\",style:{display:\"flex\",alignItems:\"center\",gap:`${spacing}px`,flexWrap:\"wrap\",width:\"max-content\",...font},children:breadcrumbs.map((crumb,index)=>{const isLast=index===breadcrumbs.length-1;const isHovered=hoveredIndex===index;return /*#__PURE__*/_jsxs(\"div\",{style:{display:\"flex\",alignItems:\"center\",gap:`${spacing}px`},children:[/*#__PURE__*/_jsx(\"a\",{href:crumb.path,onClick:e=>{e.preventDefault();handleClick(crumb.path,index);},onMouseEnter:()=>startTransition(()=>setHoveredIndex(index)),onMouseLeave:()=>startTransition(()=>setHoveredIndex(null)),style:{color:isLast?activeColor:isHovered?hoverColor:textColor,textDecoration:\"none\",cursor:isLast?\"default\":\"pointer\",transition:\"color 0.2s ease\",whiteSpace:\"nowrap\"},\"aria-current\":isLast?\"page\":undefined,children:crumb.label}),!isLast&&/*#__PURE__*/_jsx(\"span\",{style:{color:textColor,userSelect:\"none\"},\"aria-hidden\":\"true\",children:separator})]},crumb.path);})});}addPropertyControls(Breadcrumbs,{showHome:{type:ControlType.Boolean,title:\"Show Home\",defaultValue:true,enabledTitle:\"Show\",disabledTitle:\"Hide\"},homeLabel:{type:ControlType.String,title:\"Home Label\",defaultValue:\"Home\",hidden:({showHome})=>!showHome},separator:{type:ControlType.String,title:\"Separator\",defaultValue:\"/\"},spacing:{type:ControlType.Number,title:\"Spacing\",defaultValue:8,min:0,max:32,step:1,unit:\"px\"},textColor:{type:ControlType.Color,title:\"Text Color\",defaultValue:\"#666666\"},activeColor:{type:ControlType.Color,title:\"Active Color\",defaultValue:\"#000000\"},hoverColor:{type:ControlType.Color,title:\"Hover Color\",defaultValue:\"#333333\"},font:{type:ControlType.Font,title:\"Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"14px\",variant:\"Medium\",letterSpacing:\"-0.01em\",lineHeight:\"1.3em\"}}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"Breadcrumbs\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"auto\",\"framerSupportedLayoutWidth\":\"auto\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Breadcrumbs.map"],"mappings":"8MAIG,SAAwB,EAAY,EAAM,CAAC,GAAK,CAAC,YAAU,IAAI,YAAU,UAAU,cAAY,UAAU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