{"version":3,"file":"TextInput.DFzAw-TJ.mjs","names":["useState","useRef"],"sources":["https:/framerusercontent.com/modules/FsKnDLeIBIY1rWfcFV9c/VvkqXFHqootmnWmHoXKn/TextInput.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{useState,useRef}from\"react\";// ---------------------------------------------------------------------------\n// COMPONENT\n// ---------------------------------------------------------------------------\n/**\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight fixed\n */export default function TextInput(props){const{placeholderLabel=\"\",inputType=\"text\",backgroundColor=\"#FFFFFF\",textColor=\"#160B0B\",placeholderColor=\"#4C4745\",borderColor=\"#D4CCCB\",borderRadius=10,padding=16,hasError=false,autoComplete=\"off\",storageKey,onChange,onFocus,onBlur}=props;// Error colors override normal colors\nconst activeBg=hasError?\"#FCE3DC\":backgroundColor;const activeBorder=borderColor;const activeText=hasError?\"#AC2C2B\":textColor;const activeLabel=hasError?\"#AC2C2B\":placeholderColor;const defaultFont={fontFamily:\"Inter, sans-serif\",fontSize:16,fontWeight:400,lineHeight:\"24px\"};const[value,setValue]=useState(()=>{if(storageKey&&typeof window!==\"undefined\"){return localStorage.getItem(storageKey)??\"\";}return\"\";});const[focused,setFocused]=useState(false);const inputRef=useRef(null);const isActive=value.length>0||focused;const handleChange=e=>{const text=e.target.value;setValue(text);if(storageKey)localStorage.setItem(storageKey,text);if(onChange)onChange(text);};const handleFocus=()=>{setFocused(true);if(onFocus)onFocus();};const handleBlur=()=>{setFocused(false);if(onBlur)onBlur();};const handleContainerClick=()=>{inputRef.current?.focus();};const resolvedPlaceholder=placeholderLabel||\"Label\";return /*#__PURE__*/_jsxs(\"div\",{onClick:handleContainerClick,style:{width:\"100%\",height:\"100%\",display:\"flex\",alignItems:\"center\",padding:`0 ${padding}px`,backgroundColor:activeBg,border:`1px solid ${activeBorder}`,borderRadius,cursor:\"text\",boxSizing:\"border-box\",position:\"relative\",...defaultFont},children:[/*#__PURE__*/_jsx(\"span\",{style:{position:\"absolute\",left:padding,color:activeLabel,fontSize:isActive?12:16,lineHeight:isActive?\"14px\":\"24px\",transform:isActive?\"translateY(-12px)\":\"translateY(0px)\",transition:\"transform 0.2s cubic-bezier(0.2, 0, 0, 1), font-size 0.2s cubic-bezier(0.2, 0, 0, 1), line-height 0.2s cubic-bezier(0.2, 0, 0, 1)\",transformOrigin:\"left bottom\",pointerEvents:\"none\",whiteSpace:\"nowrap\",overflow:\"hidden\",textOverflow:\"ellipsis\",maxWidth:`calc(100% - ${padding*2}px)`},children:resolvedPlaceholder}),/*#__PURE__*/_jsx(\"input\",{ref:inputRef,type:inputType,value:value,onChange:handleChange,onFocus:handleFocus,onBlur:handleBlur,autoComplete:autoComplete,style:{width:\"100%\",border:\"none\",outline:\"none\",backgroundColor:\"transparent\",color:activeText,padding:0,margin:0,transform:\"translateY(8px)\",...defaultFont}})]});}// ---------------------------------------------------------------------------\n// PROPERTY CONTROLS\n// ---------------------------------------------------------------------------\naddPropertyControls(TextInput,{placeholderLabel:{type:ControlType.String,title:\"Label\",defaultValue:\"Full name\"},inputType:{type:ControlType.Enum,title:\"Type\",options:[\"text\",\"email\"],optionTitles:[\"Text\",\"Email\"],defaultValue:\"text\"},backgroundColor:{type:ControlType.Color,title:\"Background\",defaultValue:\"#FFFFFF\"},textColor:{type:ControlType.Color,title:\"Text\",defaultValue:\"#160B0B\"},placeholderColor:{type:ControlType.Color,title:\"Placeholder\",defaultValue:\"#4C4745\"},borderColor:{type:ControlType.Color,title:\"Border\",defaultValue:\"#D4CCCB\"},borderRadius:{type:ControlType.Number,title:\"Radius\",defaultValue:10,min:0,max:24},padding:{type:ControlType.Number,title:\"Padding\",defaultValue:16,min:4,max:32}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"TextInput\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"fixed\",\"framerSupportedLayoutWidth\":\"any\",\"framerCont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