{"version":3,"file":"ScrollableTextBox.DwNrfY12.mjs","names":["useRef"],"sources":["https:/framerusercontent.com/modules/E65U3f9Tsl5CxzFsQW9Y/zIDUHUMlvA9wobCTbTso/ScrollableTextBox.js"],"sourcesContent":["// Transparent scrolling text box with visible scrollbar and wrapping text\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{useRef,useEffect}from\"react\";/**\n * Transparent scrolling text box. Only the scrollbar is visible; text wraps to fit size.\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */export default function ScrollableTextBox(props){const{text,scrollbarColor,scrollbarWidth,font,style}=props;const scrollRef=useRef(null);useEffect(()=>{if(!scrollRef.current)return;// This ensures scrollbar even if content is not scrollable (for preview)\nscrollRef.current.scrollTop=0;},[text]);// Custom scrollbar via inline style\nconst scrollbarStyles={scrollbarColor:`transparent transparent`,scrollbarWidth:\"thin\"};// Add explicit scrollbar CSS for Chrome/webkit\nconst customScrollbar=`\n    &::-webkit-scrollbar {\n      width: ${scrollbarWidth}px;\n      background: transparent;\n    }\n    &::-webkit-scrollbar-thumb {\n      background: transparent;\n      border-radius: 6px;\n    }\n  `;const sx={...style,width:\"100%\",height:\"100%\",background:\"transparent\",boxShadow:\"none\",border:`1px solid ${font?.color??\"#BBBBBB\"}33`,overflowY:\"auto\",overflowX:\"hidden\",// font related styles\n...font,color:font?.color??\"#BBBBBB\",padding:\"0 20px\",outline:\"none\",wordBreak:\"break-word\",whiteSpace:\"pre-wrap\",position:\"relative\",scrollbarColor:`transparent transparent`,scrollbarWidth:\"thin\"};return /*#__PURE__*/_jsxs(\"div\",{ref:scrollRef,style:sx,tabIndex:0,\"aria-label\":\"Scrolling text area\",// apply custom scrollbar for webkit\nclassName:\"scrolling-text\",children:[text,/*#__PURE__*/_jsx(\"style\",{children:`\n        .scrolling-text::-webkit-scrollbar {\n          width: ${scrollbarWidth}px;\n          background: transparent;\n        }\n        .scrolling-text::-webkit-scrollbar-thumb {\n          background: transparent;\n          border-radius: 6px;\n        }\n      `})]});}addPropertyControls(ScrollableTextBox,{text:{type:ControlType.String,title:\"Text\",defaultValue:\"This is a transparent scrolling text box. Only the scrollbar is visible. The text wraps to fit the size of the box.\\n\\nAdd more lines to enable scrolling.\",displayTextArea:true},scrollbarColor:{type:ControlType.Color,title:\"Scrollbar Color\",defaultValue:\"#BBBBBB\"},scrollbarWidth:{type:ControlType.Number,title:\"Scrollbar Width\",defaultValue:6,min:2,max:18,step:1,unit:\"px\"},font:{type:ControlType.Font,title:\"Font\",defaultFontType:\"sans-serif\",controls:\"extended\",defaultValue:{fontSize:\"16px\",variant:\"Regular\",lineHeight:\"1.3em\",letterSpacing:\"0\"}}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ScrollableTextBox\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ScrollableTextBox.map"],"mappings":"mLAMG,SAAwB,EAAkB,EAAM,CAAC,GAAK,CAAC,OAAK,iBAAe,iBAAe,OAAK,SAAO,EAAY,EAAUA,EAAO,KAAK,CAa2D,OAb1D,MAAc,CAAK,EAAU,UACzK,EAAU,QAAQ,UAAU,IAAI,CAAC,EAAK,CAAC,CAEjB,GAEP,IAQ2M,EAAM,MAAM,CAAC,IAAI,EAAU,MADxO,CAAC,GAAG,EAAM,MAAM,OAAO,OAAO,OAAO,WAAW,cAAc,UAAU,OAAO,OAAO,aAAa,GAAM,OAAO,UAAU,IAAI,UAAU,OAAO,UAAU,SACtK,GAAG,EAAK,MAAM,GAAM,OAAO,UAAU,QAAQ,SAAS,QAAQ,OAAO,UAAU,aAAa,WAAW,WAAW,SAAS,WAAW,eAAe,0BAA0B,eAAe,OAAO,C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