UNPKG

one

Version:

One is a new React Framework that makes Vite serve both native and web.

45 lines (43 loc) 1.29 kB
import { jsx as _jsx } from "react/jsx-runtime"; import { isValidElement } from "react"; import { StyleSheet, View } from "react-native"; import { ViewSlot } from "./common.native.js"; import { useTabsWithChildren } from "./Tabs.shared.native.js"; export * from "./TabContext.native.js"; export * from "./TabList.native.js"; export * from "./TabSlot.native.js"; export * from "./TabTrigger.native.js"; export * from "./Tabs.shared.native.js"; function _type_of(obj) { "@swc/helpers - typeof"; return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj; } function Tabs(props) { var { children, asChild, options, ...rest } = props; var Comp = asChild ? ViewSlot : View; var { NavigationContent } = useTabsWithChildren({ children: asChild && /* @__PURE__ */isValidElement(children) && children.props && _type_of(children.props) === "object" && "children" in children.props ? children.props.children : children, ...options }); return /* @__PURE__ */_jsx(Comp, { style: styles.tabsRoot, ...rest, children: /* @__PURE__ */_jsx(NavigationContent, { children }) }); } var styles = StyleSheet.create({ tabsRoot: { flex: 1 } }); export { Tabs }; //# sourceMappingURL=Tabs.native.js.map