{"version":3,"file":"RangeSlider.BM0ECPwG.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/nJ9QBSF5GiYFEAYax0Cj/TFaDpYplwOaEKS5w0G34/RangeSlider.js"],"sourcesContent":["// Range slider input component for Framer forms with customizable appearance and layout options\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useEffect,useState,startTransition}from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * Range Slider Input\n *\n * @framerIntrinsicWidth 300\n * @framerIntrinsicHeight 80\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */export default function RangeSlider(props){const{name=\"range\",min=0,max=100,step=1,defaultValue=50,thumbSize=20,trackHeight=6,trackColor=\"#EEEEEE\",trackFillColor=\"#000000\",thumbColor=\"#000000\",labelColor=\"#000000\",valueColor=\"#000000\",borderRadius=8,thumbRadius=50,thumbBorder={borderWidth:0,borderStyle:\"solid\",borderColor:\"#FFFFFF\"},padding=16,layout=\"horizontal\",labelFont,valueFont,label=\"Range\",showLabel=true,showValue=true,direction=\"ltr\",style}=props;const[value,setValue]=useState(defaultValue);useEffect(()=>{setValue(defaultValue);},[defaultValue]);// Inject thumb styles into document head for canvas compatibility\nuseEffect(()=>{if(typeof document===\"undefined\")return;const styleId=`range-slider-${name}`;let styleElement=document.getElementById(styleId);if(!styleElement){styleElement=document.createElement(\"style\");styleElement.id=styleId;document.head.appendChild(styleElement);}const borderWidth=thumbBorder?.borderWidth||0;const borderStyle=thumbBorder?.borderStyle||\"solid\";const borderColor=thumbBorder?.borderColor||\"#FFFFFF\";styleElement.textContent=`\n            input[type=\"range\"][name=\"${name}\"]::-webkit-slider-thumb {\n                -webkit-appearance: none;\n                appearance: none;\n                width: ${thumbSize}px;\n                height: ${thumbSize}px;\n                border-radius: ${thumbRadius}%;\n                background: ${thumbColor};\n                cursor: pointer;\n                border: ${borderWidth}px ${borderStyle} ${borderColor};\n            }\n            \n            input[type=\"range\"][name=\"${name}\"]::-moz-range-thumb {\n                width: ${thumbSize}px;\n                height: ${thumbSize}px;\n                border-radius: ${thumbRadius}%;\n                background: ${thumbColor};\n                cursor: pointer;\n                border: ${borderWidth}px ${borderStyle} ${borderColor};\n            }\n        `;return()=>{if(styleElement&&styleElement.parentNode){styleElement.parentNode.removeChild(styleElement);}};},[name,thumbSize,thumbRadius,thumbColor,thumbBorder]);const handleChange=e=>{const newValue=Number(e.target.value);startTransition(()=>setValue(newValue));};const percentage=(value-min)/(max-min)*100;const isVertical=layout===\"vertical\"||layout===\"vertical-inline\";const isInline=layout===\"horizontal-inline\"||layout===\"vertical-inline\";const containerStyle={width:\"100%\",height:\"100%\",display:\"flex\",flexDirection:isVertical?\"column\":\"row\",alignItems:isInline?\"center\":\"flex-start\",gap:isInline?12:8,padding:padding,position:\"relative\"};const labelContainerStyle={display:\"flex\",flexDirection:isInline&&isVertical?\"column\":\"row-reverse\",alignItems:\"center\",gap:8,minWidth:isInline&&!isVertical?\"max-content\":undefined,justifyContent:isVertical&&!isInline?\"space-between\":undefined,width:isVertical&&!isInline?\"100%\":undefined};const sliderContainerStyle={position:\"relative\",flex:isInline?1:undefined,width:isInline?\"100%\":\"100%\",height:isVertical&&!isInline?\"100%\":undefined,display:\"flex\",alignItems:\"center\"};const trackStyle={position:\"absolute\",width:\"100%\",height:trackHeight,backgroundColor:trackColor,borderRadius:borderRadius,pointerEvents:\"none\"};const fillStyle={position:\"absolute\",height:trackHeight,backgroundColor:trackFillColor,borderRadius:borderRadius,width:`${percentage}%`,pointerEvents:\"none\",...direction===\"rtl\"?{right:0}:{left:0}};const inputStyle={width:\"100%\",height:thumbSize,margin:0,padding:0,appearance:\"none\",WebkitAppearance:\"none\",background:\"transparent\",cursor:\"pointer\",position:\"relative\",zIndex:1};return /*#__PURE__*/_jsxs(\"div\",{style:containerStyle,children:[!isInline&&/*#__PURE__*/_jsxs(\"div\",{style:labelContainerStyle,children:[showLabel&&/*#__PURE__*/_jsx(\"label\",{htmlFor:name,style:{color:labelColor,margin:0,...labelFont},children:label}),showValue&&/*#__PURE__*/_jsx(\"span\",{style:{color:valueColor,margin:0,...valueFont},children:value})]}),/*#__PURE__*/_jsxs(\"div\",{style:{display:\"flex\",flexDirection:isVertical?\"column\":\"row\",alignItems:\"center\",gap:12,width:\"100%\",flex:1},children:[/*#__PURE__*/_jsxs(\"div\",{style:sliderContainerStyle,children:[/*#__PURE__*/_jsx(\"div\",{style:trackStyle}),/*#__PURE__*/_jsx(\"div\",{style:fillStyle}),/*#__PURE__*/_jsx(\"input\",{type:\"range\",id:name,name:name,min:min,max:max,step:step,value:value,onChange:handleChange,style:inputStyle,dir:direction,\"aria-label\":label,\"aria-valuemin\":min,\"aria-valuemax\":max,\"aria-valuenow\":value})]}),isInline&&showLabel&&/*#__PURE__*/_jsx(\"label\",{htmlFor:name,style:{color:labelColor,margin:0,minWidth:\"max-content\",...labelFont},children:label}),isInline&&showValue&&/*#__PURE__*/_jsx(\"span\",{style:{color:valueColor,margin:0,minWidth:\"max-content\",...valueFont},children:value})]})]});}addPropertyControls(RangeSlider,{// Basic Settings\nname:{type:ControlType.String,title:\"Name\",defaultValue:\"range\"},label:{type:ControlType.String,title:\"Label\",defaultValue:\"Range\"},showLabel:{type:ControlType.Boolean,title:\"Show Label\",defaultValue:true,enabledTitle:\"Show\",disabledTitle:\"Hide\"},showValue:{type:ControlType.Boolean,title:\"Show Value\",defaultValue:true,enabledTitle:\"Show\",disabledTitle:\"Hide\"},layout:{type:ControlType.Enum,title:\"Layout\",options:[\"horizontal\",\"vertical\",\"horizontal-inline\",\"vertical-inline\"],optionTitles:[\"Horizontal\",\"Vertical\",\"Horizontal Inline\",\"Vertical Inline\"],defaultValue:\"horizontal\",displaySegmentedControl:false},direction:{type:ControlType.Enum,title:\"Direction\",options:[\"ltr\",\"rtl\"],optionTitles:[\"Left to Right\",\"Right to Left\"],defaultValue:\"ltr\",displaySegmentedControl:true},// Range Settings\nmin:{type:ControlType.Number,title:\"Min Value\",defaultValue:0,step:1},max:{type:ControlType.Number,title:\"Max Value\",defaultValue:100,step:1},step:{type:ControlType.Number,title:\"Step\",defaultValue:1,min:.01,step:.01},defaultValue:{type:ControlType.Number,title:\"Default Value\",defaultValue:50,step:1},// Track Styling\ntrackHeight:{type:ControlType.Number,title:\"Track Height\",defaultValue:6,min:2,max:20,step:1,unit:\"px\"},trackColor:{type:ControlType.Color,title:\"Track Color\",defaultValue:\"#EEEEEE\"},trackFillColor:{type:ControlType.Color,title:\"Track Fill\",defaultValue:\"#000000\"},borderRadius:{type:ControlType.Number,title:\"Track Radius\",defaultValue:8,min:0,max:32,step:1,unit:\"px\"},// Thumb Styling\nthumbSize:{type:ControlType.Number,title:\"Thumb Size\",defaultValue:20,min:10,max:40,step:1,unit:\"px\"},thumbColor:{type:ControlType.Color,title:\"Thumb Color\",defaultValue:\"#000000\"},thumbRadius:{type:ControlType.Number,title:\"Thumb Radius\",defaultValue:50,min:0,max:50,step:1,unit:\"%\"},thumbBorder:{type:ControlType.Border,title:\"Thumb Border\",defaultValue:{borderWidth:0,borderStyle:\"solid\",borderColor:\"#FFFFFF\"}},// Text Styling\nlabelColor:{type:ControlType.Color,title:\"Label Color\",defaultValue:\"#000000\"},labelFont:{type:ControlType.Font,title:\"Label Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"15px\",variant:\"Medium\",letterSpacing:\"-0.01em\",lineHeight:\"1em\"}},valueColor:{type:ControlType.Color,title:\"Value Color\",defaultValue:\"#000000\"},valueFont:{type:ControlType.Font,title:\"Value Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"15px\",variant:\"Semibold\",letterSpacing:\"-0.01em\",lineHeight:\"1em\"}},// Spacing\npadding:{type:ControlType.Number,title:\"Padding\",defaultValue:16,min:0,max:40,step:1,unit:\"px\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"RangeSlider\",\"slots\":[],\"annotations\":{\"framerIntrinsicWidth\":\"300\",\"framerIntrinsicHeight\":\"80\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./RangeSlider.map"],"mappings":"+LASG,SAAwB,EAAY,EAAM,CAAC,GAAK,CAAC,OAAK,QAAQ,MAAI,EAAE,MAAI,IAAI,OAAK,EAAE,eAAa,GAAG,YAAU,GAAG,cAAY,EAAE,aAAW,UAAU,iBAAe,UAAU,aAAW,UAAU,aAAW,UAAU,aAAW,UAAU,eAAa,EAAE,cAAY,GAAG,cAAY,CAAC,YAAY,EAAE,YAAY,QAAQ,YAAY,UAAU,CAAC,UAAQ,GAAG,SAAO,aAAa,YAAU,YAAU,QAAM,QAAQ,YAAU,GAAK,YAAU,GAAK,YAAU,MAAM,SAAO,EAAW,CAAC,EAAM,GAAUA,EAAS,EAAa,CAAC,MAAc,CAAC,EAAS,EAAa,EAAG,CAAC,EAAa,CAAC,CACljB,MAAc,CAAC,GAAG,OAAO,SAAW,IAAY,OAAO,IAAM,EAAQ,gBAAgB,IAAW,EAAa,SAAS,eAAe,EAAQ,CAAK,IAAc,EAAa,SAAS,cAAc,QAAQ,CAAC,EAAa,GAAG,EAAQ,SAAS,KAAK,YAAY,EAAa,EAAE,IAAM,EAAY,GAAa,aAAa,EAAQ,EAAY,GAAa,aAAa,QAAc,EAAY,GAAa,aAAa,UAoBlZ,MApB4Z,GAAa,YAAY;wCACvZ,EAAK;;;yBAGpB,EAAU;0BACT,EAAU;iCACH,EAAY;8BACf,EAAW;;0BAEf,EAAY,KAAK,EAAY,GAAG,EAAY;;;wCAG9B,EAAK;yBACpB,EAAU;0BACT,EAAU;iCACH,EAAY;8BACf,EAAW;;0BAEf,EAAY,KAAK,EAAY,GAAG,EAAY;;cAElD,CAAI,GAAc,EAAa,YAAY,EAAa,WAAW,YAAY,EAAa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