{ "version": 3, "sources": ["../../javascript/warp/hooks/useMediaQuery.ts", "../../javascript/warp/hooks/breakpoints.ts"], "sourcesContent": ["import React from \"react\"\n\nexport default function useMediaQuery(query: string) {\n const [value, setValue] = React.useState(false)\n\n React.useEffect(() => {\n function onChange(event: MediaQueryListEvent) {\n setValue(event.matches)\n }\n\n const result = matchMedia(query)\n result.addEventListener(\"change\", onChange)\n setValue(result.matches)\n\n return () => result.removeEventListener(\"change\", onChange)\n }, [query])\n\n return value\n}\n", "import useMediaQuery from \"./useMediaQuery\"\n\nexport function useIsTablet() {\n const breakpoint = getComputedStyle(document.body).getPropertyValue(\n \"--breakpoint-tablet\"\n )\n return useMediaQuery(`(min-width: ${breakpoint})`)\n}\n\nexport function useIsDesktop() {\n const breakpoint = getComputedStyle(document.body).getPropertyValue(\n \"--breakpoint-desktop\"\n )\n return useMediaQuery(`(min-width: ${breakpoint})`)\n}\n\nexport function useIsDesktopLarge() {\n const breakpoint = getComputedStyle(document.body).getPropertyValue(\n \"--breakpoint-desktop-large\"\n )\n return useMediaQuery(`(min-width: ${breakpoint})`)\n}\n\nexport function useIsDesktopHuge() {\n const breakpoint = getComputedStyle(document.body).getPropertyValue(\n \"--breakpoint-desktop-huge\"\n )\n return useMediaQuery(`(min-width: ${breakpoint})`)\n}\n"], "mappings": "kHAAA,IAAAA,EAAkB,SAEH,SAARC,EAA+BC,EAAe,CACnD,GAAM,CAACC,EAAOC,CAAQ,EAAI,EAAAC,QAAM,SAAS,EAAK,EAE9C,SAAAA,QAAM,UAAU,IAAM,CACpB,SAASC,EAASC,EAA4B,CAC5CH,EAASG,EAAM,OAAO,CACxB,CAEA,IAAMC,EAAS,WAAWN,CAAK,EAC/B,OAAAM,EAAO,iBAAiB,SAAUF,CAAQ,EAC1CF,EAASI,EAAO,OAAO,EAEhB,IAAMA,EAAO,oBAAoB,SAAUF,CAAQ,CAC5D,EAAG,CAACJ,CAAK,CAAC,EAEHC,CACT,CCTO,SAASM,GAAe,CAC7B,IAAMC,EAAa,iBAAiB,SAAS,IAAI,EAAE,iBACjD,sBACF,EACA,OAAOC,EAAc,eAAeD,IAAa,CACnD", "names": ["import_react", "useMediaQuery", "query", "value", "setValue", "React", "onChange", "event", "result", "useIsDesktop", "breakpoint", "useMediaQuery"] }