{"version":3,"file":"LocalTimeTextBox.B6ZA8fGh.mjs","names":["useState","useState"],"sources":["https:/framerusercontent.com/modules/7Jayg6dXM2iBRinFuihx/MVCQKe0St1dhVlSojT48/LocalTimeBox.js","https:/framerusercontent.com/modules/j9nnHOzRif6zpN2hSFGG/qBICESPdzhZfh8EXTjaK/LocalTimeTextBox.js"],"sourcesContent":["// Text box component with local time and timezone abbreviation, customizable font and colors\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useState,useEffect,startTransition}from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */export default function LocalTimeBox(props){const{backgroundColor,textColor,timeFont,showTimezone,use24Hour,showSeconds,padding,borderRadius,horizontalAlign}=props;const[time,setTime]=useState(\"\");const[timezone,setTimezone]=useState(\"\");useEffect(()=>{if(typeof window===\"undefined\"){setTime(\"12:00:00\");setTimezone(\"UTC\");return;}const updateTime=()=>{const now=new Date;const options={hour:\"2-digit\",minute:\"2-digit\",...showSeconds&&{second:\"2-digit\"},hour12:!use24Hour};const timeString=now.toLocaleTimeString(\"en-US\",options);const timezoneString=now.toLocaleTimeString(\"en-US\",{timeZoneName:\"short\"}).split(\" \").pop()||\"UTC\";startTransition(()=>{setTime(timeString);setTimezone(timezoneString);});};updateTime();const interval=setInterval(updateTime,1e3);return()=>clearInterval(interval);},[use24Hour,showSeconds]);const isFixedWidth=props?.style&&props.style.width===\"100%\";const isFixedHeight=props?.style&&props.style.height===\"100%\";return /*#__PURE__*/_jsxs(\"div\",{style:{...props.style,position:\"relative\",backgroundColor,borderRadius,padding,display:\"flex\",flexDirection:\"row\",alignItems:\"center\",justifyContent:horizontalAlign,gap:8,...isFixedWidth?{}:{width:\"max-content\"},...isFixedHeight?{}:{height:\"max-content\"}},children:[/*#__PURE__*/_jsx(\"div\",{style:{...timeFont,color:textColor,whiteSpace:\"nowrap\"},children:time}),showTimezone&&/*#__PURE__*/_jsx(\"div\",{style:{...timeFont,color:textColor,whiteSpace:\"nowrap\"},children:timezone})]});}addPropertyControls(LocalTimeBox,{backgroundColor:{type:ControlType.Color,title:\"Background\",defaultValue:\"#FFFFFF\"},textColor:{type:ControlType.Color,title:\"Text Color\",defaultValue:\"#000000\"},timeFont:{type:ControlType.Font,title:\"Time Font\",defaultValue:{fontSize:\"40px\",variant:\"Bold\",letterSpacing:\"-0.04em\",lineHeight:\"1em\"},controls:\"extended\",defaultFontType:\"sans-serif\"},horizontalAlign:{type:ControlType.Enum,title:\"Horizontal Align\",options:[\"flex-start\",\"center\",\"flex-end\"],optionTitles:[\"Left\",\"Center\",\"Right\"],defaultValue:\"center\",displaySegmentedControl:true},showTimezone:{type:ControlType.Boolean,title:\"Show Timezone\",defaultValue:true,enabledTitle:\"Show\",disabledTitle:\"Hide\"},use24Hour:{type:ControlType.Boolean,title:\"Time Format\",defaultValue:false,enabledTitle:\"24h\",disabledTitle:\"12h\"},showSeconds:{type:ControlType.Boolean,title:\"Show Seconds\",defaultValue:true,enabledTitle:\"Show\",disabledTitle:\"Hide\"},padding:{type:ControlType.Number,title:\"Padding\",defaultValue:20,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\":\"LocalTimeBox\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./LocalTimeBox.map","// Text box component that displays local time with customizable font color and styling\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{useState,useEffect,startTransition}from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight auto\n */export default function LocalTimeTextBox(props){const{timeFormat=\"12h\",showDate=false,dateFormat=\"short\",showTimezone=false,textColor=\"#000000\",backgroundColor=\"#FFFFFF\",font,padding=16,borderRadius=8,textAlign=\"center\",style}=props;const[date,setDate]=useState(\"\");useEffect(()=>{if(typeof window===\"undefined\")return;const updateTime=()=>{const now=new Date;// Format as MONTH.01\nconst month=now.toLocaleDateString(\"en-US\",{month:\"long\"}).toUpperCase();const day=now.getDate().toString().padStart(2,\"0\");const dateString=`${month}.${day}`;startTransition(()=>setDate(dateString));};updateTime();const interval=setInterval(updateTime,1e3);return()=>clearInterval(interval);},[timeFormat,showDate,dateFormat,showTimezone]);const isFixedWidth=style&&style.width===\"100%\";return /*#__PURE__*/_jsx(\"div\",{style:{...style,position:\"relative\",backgroundColor,color:textColor,padding,borderRadius,textAlign,...isFixedWidth?{}:{minWidth:\"max-content\"},...font},children:date||\"Loading...\"});}addPropertyControls(LocalTimeTextBox,{timeFormat:{type:ControlType.Enum,title:\"Time Format\",options:[\"12h\",\"24h\"],optionTitles:[\"12 Hour\",\"24 Hour\"],defaultValue:\"12h\",displaySegmentedControl:true},showTimezone:{type:ControlType.Boolean,title:\"Show Timezone\",defaultValue:false,enabledTitle:\"Show\",disabledTitle:\"Hide\"},showDate:{type:ControlType.Boolean,title:\"Show Date\",defaultValue:false,enabledTitle:\"Show\",disabledTitle:\"Hide\"},dateFormat:{type:ControlType.Enum,title:\"Date Format\",options:[\"short\",\"long\",\"numeric\"],optionTitles:[\"Short\",\"Long\",\"Numeric\"],defaultValue:\"short\",hidden:({showDate})=>!showDate},textColor:{type:ControlType.Color,title:\"Text Color\",defaultValue:\"#000000\"},backgroundColor:{type:ControlType.Color,title:\"Background\",defaultValue:\"#FFFFFF\"},font:{type:ControlType.Font,title:\"Font\",defaultValue:{fontSize:\"15px\",variant:\"Medium\",letterSpacing:\"-0.01em\",lineHeight:\"1.3em\"},controls:\"extended\",defaultFontType:\"sans-serif\"},padding:{type:ControlType.Number,title:\"Padding\",defaultValue:16,min:0,max:48,step:1,unit:\"px\"},borderRadius:{type:ControlType.Number,title:\"Radius\",defaultValue:8,min:0,max:32,step:1,unit:\"px\"},textAlign:{type:ControlType.Enum,title:\"Text Align\",options:[\"left\",\"center\",\"right\"],optionTitles:[\"Left\",\"Center\",\"Right\"],defaultValue:\"center\",displaySegmentedControl:true}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"LocalTimeTextBox\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"auto\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./LocalTimeTextBox.map"],"mappings":"6MAIG,SAAwB,EAAa,EAAM,CAAC,GAAK,CAAC,kBAAgB,YAAU,WAAS,eAAa,YAAU,cAAY,UAAQ,eAAa,mBAAiB,EAAW,CAAC,EAAK,GAASA,EAAS,GAAG,CAAM,CAAC,EAAS,GAAaA,EAAS,GAAG,CAAC,MAAc,CAAC,GAAU,IAAS,OAAY,CAAC,EAAQ,WAAW,CAAC,EAAY,MAAM,CAAC,OAAQ,IAAM,MAAe,CAAC,IAAM,EAAI,IAAI,KAAW,EAAQ,CAAC,KAAK,UAAU,OAAO,UAAU,GAAG,GAAa,CAAC,OAAO,UAAU,CAAC,OAAO,CAAC,EAAU,CAAO,EAAW,EAAI,mBAAmB,QAAQ,EAAQ,CAAO,EAAe,EAAI,mBAAmB,QAAQ,CAAC,aAAa,QAAQ,CAAC,CAAC,MAAM,IAAI,CAAC,KAAK,EAAE,MAAM,MAAoB,CAAC,EAAQ,EAAW,CAAC,EAAY,EAAe,EAAG,EAAG,GAAY,CAAC,IAAM,EAAS,YAAY,EAAW,IAAI,CAAC,UAAU,cAAc,EAAS,EAAG,CAAC,EAAU,EAAY,CAAC,CAAC,IAAM,EAAa,GAAO,OAAO,EAAM,MAAM,QAAQ,OAAa,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