@seed-design/react-drawer 0.0.0-alpha-20260414104312

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,15 @@
1
+ import { createContext, useContext } from "react";
2
+
3
+ export type DrawerContextValue = ReturnType<typeof import("./useDrawer").useDrawer>;
4
+
5
+ const DrawerContext = createContext<DrawerContextValue | null>(null);
6
+
7
+ export const DrawerProvider = DrawerContext.Provider;
8
+
9
+ export function useDrawerContext() {
10
+ const context = useContext(DrawerContext);
11
+ if (context === null) {
12
+ throw new Error("useDrawerContext must be used within DrawerProvider");
13
+ }
14
+ return context;
15
+ }