{"version":3,"file":"SearchBar.CS3lbXue.mjs","names":["React.useRef"],"sources":["https:/framerusercontent.com/modules/rNN4fRjfXGFB0uj6Yx0L/4XtTK0qnwDwJ4EuCfHrw/SearchBar.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType}from\"framer\";import{useFilterStore}from\"https://framerusercontent.com/modules/J5ZwmgJ1GWQkwoPBD60b/7cYf9uNPKqipjXLCyjkF/filterStore.js\";export default function SearchBar(props){const[store,setStore]=useFilterStore();const inputRef=React.useRef(null);const isActive=store.search.trim()!==\"\";const clearSearch=()=>{setStore({search:\"\"});setTimeout(()=>{inputRef.current?.focus();},50);};return /*#__PURE__*/_jsxs(\"div\",{style:{width:\"100%\",display:\"flex\",alignItems:\"center\",gap:props.gap},children:[/*#__PURE__*/_jsx(\"button\",{onClick:()=>{if(isActive){clearSearch();}else{inputRef.current?.focus();}},style:{background:\"transparent\",border:\"none\",padding:0,margin:0,cursor:\"pointer\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",color:props.accentColor,fontSize:props.plusSize,fontWeight:props.plusWeight,lineHeight:1,transform:isActive?\"rotate(45deg)\":\"rotate(0deg)\",transition:\"transform 0.3s cubic-bezier(0.25, 0.1, 0.25, 1)\"},children:\"+\"}),/*#__PURE__*/_jsx(\"input\",{ref:inputRef,type:\"text\",value:store.search,placeholder:props.placeholder,onChange:event=>{setStore({search:event.target.value});},onFocus:()=>{inputRef.current?.focus();},onKeyDown:event=>{if(event.key===\"Escape\"){clearSearch();event.currentTarget.blur();}},style:{width:\"100%\",background:\"transparent\",border:\"none\",outline:\"none\",fontFamily:props.fontFamily,fontSize:props.fontSize,fontWeight:props.fontWeight,color:props.color,opacity:props.opacity,caretColor:props.accentColor}})]});}SearchBar.defaultProps={placeholder:\"Search\",fontFamily:\"Inter\",fontSize:16,fontWeight:400,color:\"#000000\",opacity:1,accentColor:\"#D97A5C\",plusSize:28,plusWeight:300,gap:10};addPropertyControls(SearchBar,{placeholder:{type:ControlType.String,title:\"Placeholder\"},fontFamily:{type:ControlType.String,title:\"Font\"},fontSize:{type:ControlType.Number,title:\"Size\"},fontWeight:{type:ControlType.Number,title:\"Weight\",min:100,max:900,step:100},color:{type:ControlType.Color,title:\"Color\"},opacity:{type:ControlType.Number,title:\"Opacity\",min:0,max:1,step:.05},accentColor:{type:ControlType.Color,title:\"Accent\"},plusSize:{type:ControlType.Number,title:\"Plus Size\"},plusWeight:{type:ControlType.Number,title:\"Plus Weight\",min:100,max:900,step:100},gap:{type:ControlType.Number,title:\"Gap\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"SearchBar\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}"],"mappings":"qOAAoQ,SAAwB,EAAU,EAAM,CAAC,GAAK,CAAC,EAAM,GAAU,EAAe,EAAQ,EAASA,EAAa,IAAI,EAAQ,EAAS,EAAM,OAAO,KAAK,IAAI,GAAS,MAAgB,CAAC,EAAS,CAAC,OAAO,EAAE,CAAC,EAAE,eAAe,CAAC,EAAS,SAAS,MAAM,CAAE,EAAE,EAAE,CAAE,EAAE,OAAoB,EAAM,MAAM,CAAC,MAAM,CAAC,MAAM,OAAO,QAAQ,OAAO,WAAW,SAAS,IAAI,EAAM,GAAG,EAAE,SAAS,CAAc,EAAK,SAAS,CAAC,YAAY,CAAI,EAAU,EAAY,EAAQ,EAAS,SAAS,MAAM,CAAG,EAAE,MAAM,CAAC,WAAW,cAAc,OAAO,OAAO,QAAQ,EAAE,OAAO,EAAE,OAAO,UAAU,QAAQ,OAAO,WAAW,SAAS,eAAe,SAAS,MAAM,EAAM,YAAY,SAAS,EAAM,SAAS,WAAW,EAAM,WAAW,WAAW,EAAE,UAAU,EAAS,gBAAgB,eAAe,WAAW,iDAAiD,EAAE,SAAS,GAAG,CAAC,EAAe,EAAK,QAAQ,CAA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