Files

20 lines
666 B
TypeScript
Raw Permalink Normal View History

2026-02-17 10:35:03 +01:00
import type { ComputedRef, Ref } from "vue"
import { createContext } from "reka-ui"
2025-10-20 08:57:51 +02:00
2026-02-17 10:35:03 +01:00
export const SIDEBAR_COOKIE_NAME = "sidebar_state"
2025-10-20 08:57:51 +02:00
export const SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7
2026-02-17 10:35:03 +01:00
export const SIDEBAR_WIDTH = "16rem"
export const SIDEBAR_WIDTH_MOBILE = "18rem"
export const SIDEBAR_WIDTH_ICON = "3rem"
export const SIDEBAR_KEYBOARD_SHORTCUT = "b"
2025-10-20 08:57:51 +02:00
export const [useSidebar, provideSidebarContext] = createContext<{
2026-02-17 10:35:03 +01:00
state: ComputedRef<"expanded" | "collapsed">
2025-10-20 08:57:51 +02:00
open: Ref<boolean>
setOpen: (value: boolean) => void
isMobile: Ref<boolean>
openMobile: Ref<boolean>
setOpenMobile: (value: boolean) => void
toggleSidebar: () => void
2026-02-17 10:35:03 +01:00
}>("Sidebar")