{"version":3,"file":"calendarContext.cjs","sources":["../../../../../src/components/forms/calendar/context/calendarContext.ts"],"sourcesContent":["import { createContext, useContext } from 'react'\r\n\r\nexport type CalendarView = 'day' | 'month' | 'year'\r\n\r\nexport type CalendarContextValue = {\r\n    view: CalendarView\r\n    setView: (v: CalendarView) => void\r\n    currentMonth: Date\r\n    setCurrentMonth: (d: Date) => void\r\n    startYear: number\r\n    endYear: number\r\n}\r\n\r\nexport const CalendarContext = createContext<CalendarContextValue | undefined>(undefined)\r\n\r\nexport const useCalendarContext = (): CalendarContextValue => {\r\n    const ctx = useContext(CalendarContext)\r\n    if (!ctx) {throw new Error('useCalendarContext must be used within a Calendar')}\r\n    return ctx\r\n}\r\n"],"names":["CalendarContext","createContext","useCalendarContext","ctx","useContext"],"mappings":"yGAaaA,EAAkBC,EAAAA,cAAgD,MAAS,EAE3EC,EAAqB,IAA4B,CAC1D,MAAMC,EAAMC,EAAAA,WAAWJ,CAAe,EACtC,GAAI,CAACG,EAAM,MAAM,IAAI,MAAM,mDAAmD,EAC9E,OAAOA,CACX"}