{"version":3,"file":"SuperScript.8ZdMp8Ru.mjs","names":["_Fragment"],"sources":["https:/framerusercontent.com/modules/hBnI2bB7muNDfTCwkUFi/kK2OWrgVCmKRq2WIT5zk/SuperScript.js"],"sourcesContent":["// Welcome to Code in Framer\n// Get Started: https://www.framer.com/developers/\n/*\n * Component: SuperscriptAndSubscript\n * Author: Łukasz Grondecki\n * Version: 1.6\n * Description: A React component for rendering superscript and subscript text with customizable styles.\n */import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";export default function SuperscriptAndSubscript({baseText,superscriptText,fontFamily,fontStyle,fontWeight,fontSize,textColor,textAlign,lineHeight,letterSpacing,superscriptFontSize,textStyle,type,textStyleOption}){// Function to render text with superscripts, subscripts, or regular text\nconst renderTextWithSupOrSub=()=>/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(\"span\",{style:{color:textColor},children:baseText}),superscriptText&&/*#__PURE__*/_jsx(SupSub,{style:{fontSize:`${superscriptFontSize}px`,color:textColor,verticalAlign:type===\"sup\"?\"super\":type===\"sub\"?\"sub\":\"baseline\",lineHeight:\"0\"},type:type,children:superscriptText})]});return /*#__PURE__*/_jsx(\"div\",{style:styles.container,children:/*#__PURE__*/_jsx(\"p\",{style:{...styles.text,fontFamily,fontSize:`${fontSize}px`,lineHeight:`${lineHeight}em`,letterSpacing:`${letterSpacing}em`,fontStyle,fontWeight,textAlign,color:textColor,...textStyle,...textStyleOption},children:renderTextWithSupOrSub()})});}// Superscript and Subscript component\nconst SupSub=({children,style,type})=>{if(type===\"sup\"){return /*#__PURE__*/_jsx(\"sup\",{style:style,children:children});}else if(type===\"sub\"){return /*#__PURE__*/_jsx(\"sub\",{style:style,children:children});}else{return /*#__PURE__*/_jsx(\"span\",{style:style,children:children})// Regular text (none)\n;}};// Default styles\nconst styles={container:{padding:\"0px\"},text:{margin:0,color:\"inherit\"}};// Define property controls with updated order and additional controls\naddPropertyControls(SuperscriptAndSubscript,{// Content section\nbaseText:{type:ControlType.String,title:\"Text\",defaultValue:\"20 m\"},superscriptText:{type:ControlType.String,title:\"Superscript\",defaultValue:\"2\"},// Type placed below Superscript\ntype:{type:ControlType.Enum,title:\"Type\",defaultValue:\"sup\",options:[\"sup\",\"sub\",\"none\"],optionTitles:[\"Superscript\",\"Subscript\",\"None\"]},// Styles section\nfontFamily:{type:ControlType.String,title:\"Font Family\",defaultValue:\"Inter\",group:\"Styles\"},fontStyle:{type:ControlType.Enum,title:\"Font Style\",defaultValue:\"normal\",options:[\"normal\",\"italic\"],optionTitles:[\"Normal\",\"Italic\"],group:\"Styles\"},fontWeight:{type:ControlType.Enum,title:\"Font Weight\",defaultValue:\"normal\",options:[\"normal\",\"medium\",\"bold\",\"semibold\"],optionTitles:[\"Normal\",\"Medium\",\"Bold\",\"SemiBold\"],group:\"Styles\"},textColor:{type:ControlType.Color,title:\"Text Color\",defaultValue:\"#000000\",group:\"Styles\"},// Text Align added below Text Color\ntextAlign:{type:ControlType.Enum,title:\"Text Align\",defaultValue:\"left\",options:[\"left\",\"center\",\"right\"],optionTitles:[\"Left\",\"Center\",\"Right\"],group:\"Styles\"},fontSize:{type:ControlType.Number,title:\"Font Size\",defaultValue:16,min:6,max:72,unit:\"px\",step:1,group:\"Styles\"},lineHeight:{type:ControlType.Number,title:\"Line Height\",defaultValue:1.5,min:.5,max:3,step:.1,group:\"Styles\"},letterSpacing:{type:ControlType.Number,title:\"Letter Spacing\",defaultValue:0,min:-.1,max:.5,step:.01,group:\"Styles\"},superscriptFontSize:{type:ControlType.Number,title:\"Superscript Font Size\",defaultValue:12,min:6,max:24,unit:\"px\",step:1,group:\"Styles\"},textStyle:{type:ControlType.Object,title:\"Text Style\",group:\"Styles\"},textStyleOption:{type:ControlType.Style,title:\"Text Style Option\",group:\"Styles\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"SuperscriptAndSubscript\",\"slots\":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