@base-ui-components/react
Version:
Base UI is a library of headless ('unstyled') React components and low-level hooks. You gain complete control over your app's CSS and accessibility features.
28 lines (27 loc) • 648 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getPlatform = getPlatform;
exports.isIOS = isIOS;
exports.isWebKit = isWebKit;
// Avoid Chrome DevTools blue warning.
function getPlatform() {
if (typeof navigator === 'undefined') {
return '';
}
const uaData = navigator.userAgentData;
if (uaData?.platform) {
return uaData.platform;
}
return navigator.platform;
}
function isWebKit() {
if (typeof CSS === 'undefined' || !CSS.supports) {
return false;
}
return CSS.supports('-webkit-backdrop-filter:none');
}
function isIOS() {
return /iP(hone|ad|od)|iOS/.test(getPlatform());
}