{"version":3,"file":"fileInputContext.cjs","sources":["../../../../../src/components/file-input/internal/fileInputContext.tsx"],"sourcesContent":["import React, { createContext, useContext } from \"react\";\nimport type { WithChildren } from \"../../../core/types.js\";\nimport type { UploadedFile } from \"../types.js\";\n\ntype FileInputContext = {\n    accept?: \"image/*\" | \".pdf\" | \"image/*,.pdf\" | HTMLInputElement[\"accept\"];\n    maxSizeBytes?: number;\n    files: UploadedFile[];\n    onChange: (\n        e:\n            | React.ChangeEvent<HTMLInputElement>\n            | React.DragEvent<HTMLDivElement>,\n        files: UploadedFile[],\n    ) => void;\n};\n\nconst fileInputContext = createContext<FileInputContext | null>(null);\n\nexport const useFileInputContext = (): FileInputContext | null =>\n    useContext(fileInputContext);\n\nexport interface FileInputContextProviderProps extends WithChildren {\n    context: FileInputContext;\n}\n\nexport const FileInputContextProvider: React.FC<\n    FileInputContextProviderProps\n> = ({ context, children }) => (\n    <fileInputContext.Provider value={context}>\n        {children}\n    </fileInputContext.Provider>\n);\n"],"names":["fileInputContext","createContext","context","children","jsx","Provider","value","useContext"],"mappings":"wIAgBMA,EAAmBC,EAAAA,cAAuC,uCAW5D,EAAGC,QAAAA,EAASC,SAAAA,KACZC,EAAAA,IAACJ,EAAiBK,SAAjB,CAA0BC,MAAOJ,EAC7BC,SAAAA,gCAX0B,IAC/BI,EAAAA,WAAWP"}