@lobehub/ui
Version:
Lobe UI is an open-source UI component library for building AIGC web apps
1 lines • 890 B
Source Map (JSON)
{"version":3,"file":"ModalProvider.mjs","names":[],"sources":["../../src/Modal/ModalProvider.tsx"],"sourcesContent":["'use client';\n\nimport type { ReactNode } from 'react';\nimport { createContext, memo, use } from 'react';\n\nimport type { ModalContextValue } from './type';\n\nexport const ModalContext = createContext<ModalContextValue>({\n close: () => undefined,\n setCanDismissByClickOutside: () => undefined,\n});\n\nexport const ModalProvider = memo<{ children: ReactNode; value: ModalContextValue }>(\n ({ children, value }) => {\n return <ModalContext value={value}>{children}</ModalContext>;\n },\n);\n\nexport const useModalContext = () => {\n return use(ModalContext);\n};\n"],"mappings":";;;;;;AAOA,MAAa,eAAe,cAAiC;CAC3D,aAAa;CACb,mCAAmC;CACpC,CAAC;AAEF,MAAa,gBAAgB,MAC1B,EAAE,UAAU,YAAY;AACvB,QAAO,oBAAC;EAAoB;EAAQ;GAAwB;EAE/D;AAED,MAAa,wBAAwB;AACnC,QAAO,IAAI,aAAa"}