flowbite-react
Version:
Official React components built for Flowbite and Tailwind CSS
1 lines • 1.43 kB
Source Map (JSON)
{"version":3,"file":"DatepickerContext.mjs","sources":["../../../../src/components/Datepicker/DatepickerContext.tsx"],"sourcesContent":["\"use client\";\n\nimport { createContext, useContext } from \"react\";\nimport type { FlowbiteDatepickerTheme } from \"./Datepicker\";\nimport type { Views, WeekStart } from \"./helpers\";\n\ntype DatepickerContextProps = {\n theme: FlowbiteDatepickerTheme;\n language: string;\n weekStart: WeekStart;\n minDate?: Date;\n maxDate?: Date;\n isOpen?: boolean;\n setIsOpen: (isOpen: boolean) => void;\n view: Views;\n setView: (value: Views) => void;\n selectedDate: Date;\n setSelectedDate: (date: Date) => void;\n changeSelectedDate: (date: Date, useAutohide: boolean) => void;\n viewDate: Date;\n setViewDate: (date: Date) => void;\n};\n\nexport const DatepickerContext = createContext<DatepickerContextProps | undefined>(undefined);\n\nexport function useDatePickerContext(): DatepickerContextProps {\n const context = useContext(DatepickerContext);\n\n if (!context) {\n throw new Error(\"useDatePickerContext should be used within the DatePickerContext provider!\");\n }\n\n return context;\n}\n"],"names":[],"mappings":";;AAGY,MAAC,iBAAiB,GAAG,aAAa,CAAC,KAAK,CAAC,EAAE;AAChD,SAAS,oBAAoB,GAAG;AACvC,EAAE,MAAM,OAAO,GAAG,UAAU,CAAC,iBAAiB,CAAC,CAAC;AAChD,EAAE,IAAI,CAAC,OAAO,EAAE;AAChB,IAAI,MAAM,IAAI,KAAK,CAAC,4EAA4E,CAAC,CAAC;AAClG,GAAG;AACH,EAAE,OAAO,OAAO,CAAC;AACjB;;;;"}