feat: add better provider support, icons, regen, and a lot more

This commit is contained in:
Zoe
2026-02-12 14:56:13 +00:00
parent d5a5945c03
commit d29f95bacf
124 changed files with 6374 additions and 1861 deletions
+20
View File
@@ -0,0 +1,20 @@
const SIDENAV_CONTEXT_KEY = Symbol('sidenav-context');
export interface SidenavContext {
isHovered: Readonly<Ref<boolean>>;
sidebarWidth: Readonly<Ref<number>>;
isOpen: Readonly<Ref<boolean>>;
close: () => void;
}
export const provideSidenavContext = (context: SidenavContext) => {
provide(SIDENAV_CONTEXT_KEY, context);
};
export const useSidenavContext = (): SidenavContext => {
const context = inject<SidenavContext>(SIDENAV_CONTEXT_KEY);
if (!context) {
throw new Error('useSidenavContext must be used within a Sidenav provider');
}
return context;
};