UNPKG

flowbite-react

Version:

Official React components built for Flowbite and Tailwind CSS

1 lines 1.03 kB
{"version":3,"file":"AccordionPanelContext.cjs","sources":["../../../src/components/Accordion/AccordionPanelContext.tsx"],"sourcesContent":["\"use client\";\n\nimport { createContext, useContext } from \"react\";\nimport type { AccordionPanelProps } from \"./AccordionPanel\";\n\nexport type AccordionPanelContextValue = Omit<AccordionPanelProps, \"children\">;\n\nexport const AccordionPanelContext = createContext<AccordionPanelContextValue | undefined>(undefined);\n\nexport function useAccordionContext(): AccordionPanelContextValue {\n const context = useContext(AccordionPanelContext);\n\n if (!context) {\n throw new Error(\"useAccordionContext should be used within the AccordionPanelContext provider!\");\n }\n\n return context;\n}\n"],"names":["createContext","useContext"],"mappings":";;;;AAGY,MAAC,qBAAqB,GAAGA,mBAAa,CAAC,MAAM;AAClD,SAAS,mBAAmB,GAAG;AACtC,EAAE,MAAM,OAAO,GAAGC,gBAAU,CAAC,qBAAqB,CAAC;AACnD,EAAE,IAAI,CAAC,OAAO,EAAE;AAChB,IAAI,MAAM,IAAI,KAAK,CAAC,+EAA+E,CAAC;AACpG;AACA,EAAE,OAAO,OAAO;AAChB;;;;;"}