one
Version:
One is a React framework for web, iOS, and Android apps.
48 lines (46 loc) • 2.21 kB
JavaScript
;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all) __defProp(target, name, {
get: all[name],
enumerable: true
});
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
get: () => from[key],
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
});
}
return to;
};
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var Tabs_exports = {};
__export(Tabs_exports, { Tabs: () => Tabs });
module.exports = __toCommonJS(Tabs_exports);
var import_jsx_runtime = require("react/jsx-runtime");
var import_react = require("react");
var import_Slot = require("./Slot.native.js");
var import_Tabs = require("./Tabs.shared.native.js");
__reExport(Tabs_exports, require("./TabContext.native.js"), module.exports);
__reExport(Tabs_exports, require("./TabList.native.js"), module.exports);
__reExport(Tabs_exports, require("./TabSlot.native.js"), module.exports);
__reExport(Tabs_exports, require("./TabTrigger.native.js"), module.exports);
__reExport(Tabs_exports, require("./Tabs.shared.native.js"), module.exports);
function Tabs(props) {
var { children, asChild, options, ...rest } = props;
var Comp = asChild ? import_Slot.Slot : "div";
var { NavigationContent } = (0, import_Tabs.useTabsWithChildren)({
children: asChild && /* @__PURE__ */ (0, import_react.isValidElement)(children) && children.props && typeof children.props === "object" && "children" in children.props ? children.props.children : children,
...options
});
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Comp, {
...rest,
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(NavigationContent, { children })
});
}