UNPKG

@react-spectrum/s2

Version:
1 lines 1.31 kB
{"mappings":";;AAAA;;;;;;;;;;CAUC;AAMM,SAAS;IACd,OAAO,CAAA,GAAA,oBAAY,EAAE;AACvB;AAEO,SAAS;IACd,IAAI,cAAc,CAAA,GAAA,oBAAY,EAAE;IAChC,IAAI,aACF,OAAO;IAGT,OAAO;AACT","sources":["packages/@react-spectrum/s2/src/utils.ts"],"sourcesContent":["/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {useMediaQuery} from '@react-spectrum/utils';\n\nexport type Scale = 'large' | 'medium';\n\nexport function useIsMobileDevice(): boolean {\n return useMediaQuery('(max-width: 640px)');\n}\n\nexport function useScale(): Scale {\n let matchesFine = useMediaQuery('not ((hover: hover) and (pointer: fine))');\n if (matchesFine) {\n return 'large';\n }\n\n return 'medium';\n}\n"],"names":[],"version":3,"file":"utils.mjs.map"}