UNPKG

@tamagui/react-native-web-lite

Version:
44 lines (43 loc) 2.61 kB
var __create = Object.create; var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; var __getProtoOf = Object.getPrototypeOf, __hasOwnProp = Object.prototype.hasOwnProperty; var __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: !0 }); }, __copyProps = (to, from, except, desc) => { if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); return to; }; var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( // If the importer is in node compatibility mode or this is not an ESM // file that has been converted to a CommonJS file using a Babel- // compatible transform (i.e. "__esModule" has not been set), then set // "default" to the CommonJS "module.exports" for node compatibility. isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: !0 }) : target, mod )), __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod); var SafeAreaView_exports = {}; __export(SafeAreaView_exports, { default: () => SafeAreaView_default }); module.exports = __toCommonJS(SafeAreaView_exports); var React = __toESM(require("react")), import_react_native_web_internals = require("@tamagui/react-native-web-internals"), import_View = __toESM(require("../View/index")), import_jsx_runtime = require("react/jsx-runtime"); const cssFunction = import_react_native_web_internals.canUseDOM && window.CSS && window.CSS.supports && window.CSS.supports("top: constant(safe-area-inset-top)") ? "constant" : "env", SafeAreaView = React.forwardRef((props, ref) => { const { style, ...rest } = props; return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_View.default, { ...rest, ref, style: import_react_native_web_internals.StyleSheet.compose(styles.root, style) }); }); SafeAreaView.displayName = "SafeAreaView"; const styles = import_react_native_web_internals.StyleSheet.create({ root: { paddingTop: `${cssFunction}(safe-area-inset-top)`, paddingRight: `${cssFunction}(safe-area-inset-right)`, paddingBottom: `${cssFunction}(safe-area-inset-bottom)`, paddingLeft: `${cssFunction}(safe-area-inset-left)` } }); var SafeAreaView_default = SafeAreaView; //# sourceMappingURL=index.js.map