{"version":3,"file":"Today.CSHNpGWe.mjs","names":["React.useState","React.useRef","React.useMemo"],"sources":["https:/framer.com/m/framer/default-utils.js@^0.45.0","https:/framerusercontent.com/modules/wSuGZ1BGPboPBIeA21TW/2MbaJbkI1drBldADhhJt/Today.js"],"sourcesContent":["/*\n * index (framer/default-utils@0.45.0)\n *\n * Learn More: https://www.framer.com/asset-urls\n */\n\nexport * from \"https://framerusercontent.com/modules/G4IfyjvwmaeSBpdb4TWu/OIjZRBmWDcIE2B6qgG1j/index.js\"\n","import{jsx as _jsx}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType}from\"framer\";import{localeOptions,containerStyles,fontStack}from\"https://framer.com/m/framer/default-utils.js@^0.45.0\";export function Time(props){const{outputType,showNumber,showWeekday,showYear,showHours,showMinutes,showSeconds,monthFormat,timeFormat,localeType,customLocale,color,font,alignment,fontSize}=props;const[rerenderOutputKey,setRerenderOutputKey]=React.useState(`${Math.random()}`);const timerRef=React.useRef();const text=React.useMemo(()=>{const locale=localeType===\"custom\"?[customLocale]:[];let formatOptions;switch(outputType){case\"date\":formatOptions={weekday:showWeekday?\"long\":undefined,day:showNumber?\"numeric\":undefined,month:monthFormat,year:showYear?\"numeric\":undefined};break;case\"time\":formatOptions={hour:showHours?\"numeric\":undefined,minute:showMinutes?\"numeric\":undefined,second:showSeconds&&showMinutes?\"numeric\":undefined,hour12:timeFormat===\"12h\"};break;default:console.error(`Unsupported outputType: ${outputType}`);break;}return new Intl.DateTimeFormat(locale,formatOptions).format(new Date);},[outputType,localeType,customLocale,timeFormat,showYear,showNumber,showWeekday,showHours,showMinutes,showSeconds,monthFormat,rerenderOutputKey]);React.useEffect(()=>{if(outputType===\"time\"){const timer=setInterval(()=>setRerenderOutputKey(`${Math.random()}`),(60-new Date().getSeconds())*1e3);// @ts-ignore – Framer runtime\ntimerRef.current=timer;return()=>{if(timer)clearInterval(timer);};}},[outputType]);return /*#__PURE__*/_jsx(\"div\",{style:{...containerStyles,color,fontFamily:fontStack,// Spread the font object first so our explicit controls can override\n...font,// Explicit controls have final say:\nfontSize,fontWeight:font?.fontWeight??500,textAlign:alignment,lineHeight:\"1.2\"},children:/*#__PURE__*/_jsx(\"span\",{style:{width:\"100%\"},children:text})});}Time.defaultProps={height:20,width:140,outputType:\"time\",localeType:\"auto\",customLocale:\"en-US\",color:\"#999\",timeFormat:\"24h\",showYear:true,showWeekday:true,showNumber:false,showHours:true,showMinutes:true,showSeconds:false,monthFormat:\"long\",alignment:\"center\",// Hard default:\nfontSize:11,font:{// This can still be tweaked in the Font control; size will be overridden by fontSize above\nfontSize:11,fontWeight:500,fontFamily:\"-apple-system, system-ui, sans-serif\"}};Time.displayName=\"Time & Date\";addPropertyControls(Time,{outputType:{title:\"Type\",type:ControlType.Enum,displaySegmentedControl:true,options:[\"date\",\"time\"],optionTitles:[\"Date\",\"Time\"]},showNumber:{title:\"Show Day Number\",type:ControlType.Boolean,enabledTitle:\"Show\",disabledTitle:\"Hide\",defaultValue:true,hidden:props=>props.outputType!==\"date\"},showWeekday:{title:\"Show Weekday\",type:ControlType.Boolean,enabledTitle:\"Show\",disabledTitle:\"Hide\",defaultValue:true,hidden:props=>props.outputType!==\"date\"},showYear:{title:\"Show Year\",type:ControlType.Boolean,enabledTitle:\"Show\",disabledTitle:\"Hide\",defaultValue:true,hidden:props=>props.outputType!==\"date\"},showHours:{title:\"Show Hours\",type:ControlType.Boolean,enabledTitle:\"Show\",disabledTitle:\"Hide\",defaultValue:true,hidden:props=>props.outputType!==\"time\"},showMinutes:{title:\"Show Minutes\",type:ControlType.Boolean,enabledTitle:\"Show\",disabledTitle:\"Hide\",defaultValue:true,hidden:props=>props.outputType!==\"time\"},showSeconds:{title:\"Show Seconds\",type:ControlType.Boolean,enabledTitle:\"Show\",disabledTitle:\"Hide\",defaultValue:false,hidden:props=>props.outputType!==\"time\"||!props.showMinutes},monthFormat:{title:\"Month Format\",type:ControlType.Enum,options:[\"short\",\"long\",\"numeric\"],optionTitles:[\"Short\",\"Long\",\"Numeric\"],defaultValue:\"long\",hidden:props=>props.outputType!==\"date\"},timeFormat:{title:\"Time Format\",type:ControlType.Enum,options:[\"12h\",\"24h\"],optionTitles:[\"12h\",\"24h\"],displaySegmentedControl:true,defaultValue:\"24h\",hidden:props=>props.outputType!==\"time\"},localeType:{title:\"Locale\",type:ControlType.Enum,displaySegmentedControl:true,options:[\"custom\",\"auto\"],optionTitles:[\"Custom\",\"Auto\"],defaultValue:Time.defaultProps.localeType},customLocale:{title:\" \",type:ControlType.Enum,options:Object.keys(localeOptions).sort(),optionTitles:Object.keys(localeOptions).sort().map(key=>localeOptions[key]),hidden:props=>props.localeType!==\"custom\",defaultValue:\"en\"},font:{// Framer’s extended font control (family/weight/etc.)\n// Size is still visible here but will be overridden by fontSize control if both are set.\n// @ts-expect-error – Internal\ntype:ControlType.Font,controls:\"extended\"},// NEW: direct control for font size\nfontSize:{title:\"Font Size\",type:ControlType.Number,defaultValue:11,min:8,max:48,displayStepper:true,unit:\"px\",step:1},color:{type:ControlType.Color,defaultValue:Time.defaultProps.color},// (Optional) expose alignment in the panel in case you want to tweak it visually\nalignment:{title:\"Align\",type:ControlType.Enum,options:[\"left\",\"center\",\"right\"],optionTitles:[\"Left\",\"Center\",\"Right\"],defaultValue:\"center\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"Time\":{\"type\":\"reactComponent\",\"name\":\"Time\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Today.map"],"mappings":"uRCAqO,SAAgB,EAAK,EAAM,CAAC,GAAK,CAAC,aAAW,aAAW,cAAY,WAAS,YAAU,cAAY,cAAY,cAAY,aAAW,aAAW,eAAa,QAAM,OAAK,YAAU,YAAU,EAAW,CAAC,EAAkB,GAAsBA,EAAe,GAAG,KAAK,QAAQ,GAAG,CAAO,EAASC,GAAc,CAAO,EAAKC,MAAkB,CAAC,IAAM,EAAO,IAAa,SA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