{"version":3,"file":"SmartTextBox.BOGx_u98.mjs","names":["useMemo"],"sources":["https:/framerusercontent.com/modules/5xQMKNB5twofAfbaOWZg/BS2Xq8s21aedgCTsBARR/SmartTextBox.js"],"sourcesContent":["// Text box that transforms text appearance based on rules:\n// - If text starts with lowercase, capitalize only the first letter\n// - If text starts with uppercase, display as-is without any transforms\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{useMemo}from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight auto\n */export default function SmartTextBox(props){const{text=\"hello world\",font,textColor,backgroundColor,padding,borderRadius,style}=props;const transformedText=useMemo(()=>{if(!text||text.length===0)return text;const firstChar=text.charAt(0);// Check if first character is uppercase\nif(firstChar===firstChar.toUpperCase()&&firstChar!==firstChar.toLowerCase()){// First char is already uppercase, return text as-is\nreturn text;}// First char is lowercase, capitalize only the first letter\nreturn firstChar.toUpperCase()+text.slice(1);},[text]);const isFixedWidth=style?.width===\"100%\";return /*#__PURE__*/_jsx(\"div\",{style:{...style,position:\"relative\",display:\"inline-block\",backgroundColor,borderRadius,padding,...isFixedWidth?{}:{width:\"max-content\"}},children:/*#__PURE__*/_jsx(\"span\",{style:{...font,color:textColor,display:\"block\",width:isFixedWidth?\"100%\":\"max-content\"},children:transformedText})});}addPropertyControls(SmartTextBox,{text:{type:ControlType.String,title:\"Text\",defaultValue:\"hello world\",displayTextArea:true},font:{type:ControlType.Font,title:\"Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"15px\",variant:\"Medium\",letterSpacing:\"-0.01em\",lineHeight:\"1.3em\"}},textColor:{type:ControlType.Color,title:\"Text Color\",defaultValue:\"#000000\"},backgroundColor:{type:ControlType.Color,title:\"Background\",defaultValue:\"#FFFFFF\"},padding:{type:ControlType.Number,title:\"Padding\",defaultValue:16,min:0,max:100,step:1,unit:\"px\"},borderRadius:{type:ControlType.Number,title:\"Radius\",defaultValue:8,min:0,max:50,step:1,unit:\"px\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"SmartTextBox\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerSupportedLayoutHeight\":\"auto\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./SmartTextBox.map"],"mappings":"qKAMG,SAAwB,EAAa,EAAM,CAAC,GAAK,CAAC,OAAK,cAAc,OAAK,YAAU,kBAAgB,UAAQ,eAAa,SAAO,EAAY,EAAgBA,MAAY,CAAC,GAAG,CAAC,GAAM,EAAK,SAAS,EAAE,OAAO,EAAK,IAAM,EAAU,EAAK,OAAO,EAAE,CAGhP,OAFG,IAAY,EAAU,aAAa,EAAE,IAAY,EAAU,aAAa,CACpE,EACA,EAAU,aAAa,CAAC,EAAK,MAAM,EAAE,EAAG,CAAC,EAAK,CAAC,CAAO,EAAa,GAAO,QAAQ,OAAO,OAAoB,EAAK,MAAM,CAAC,MAAM,CAAC,GAAG,EAAM,SAAS,WAAW,QAAQ,eAAe,kBAAgB,eAAa,UAAQ,GAAG,EAAa,EAAE,CAAC,CAAC,MAAM,cAAc,CAAC,CAAC,SAAsB,EAAK,OAAO,CAAC,MAAM,CAAC,GAAG,EAAK,MAAM,EAAU,QAAQ,QAAQ,MAAM,EAAa,OAAO,cAAc,CAAC,SAAS,EAAgB,CAAC,CAAC,CAAC,kBANtX,IAA2B,IAAoD,CAMyS,EAAoB,EAAa,CAAC,KAAK,CAAC,KAAK,EAAY,OAAO,MAAM,OAAO,aAAa,cAAc,gBAAgB,GAAK,CAAC,KAAK,CAAC,KAAK,EAAY,KAAK,MAAM,OAAO,SAAS,WAAW,gBAAgB,aAAa,aAAa,CAAC,SAAS,OAAO,QAAQ,SAAS,cAAc,UAAU,WAAW,QAAQ,CAAC,CAAC,UAAU,CAAC,KAAK,EAAY,MAAM,MAAM,aAAa,a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