one
Version:
One is a new React Framework that makes Vite serve both native and web.
34 lines (33 loc) • 951 B
JavaScript
import { isValidElement } from "react";
import { Slot as SlotImpl } from "./Slot.mjs";
import { useTabsWithChildren } from "./Tabs.shared.mjs";
export * from "./TabContext.mjs";
export * from "./TabList.mjs";
export * from "./TabSlot.mjs";
export * from "./TabTrigger.mjs";
export * from "./Tabs.shared.mjs";
import { jsx } from "react/jsx-runtime";
const Slot = SlotImpl;
function Tabs(props) {
const {
children,
asChild,
options,
...rest
} = props;
const Comp = asChild ? Slot : "div";
const {
NavigationContent
} = useTabsWithChildren({
children: asChild && isValidElement(children) && children.props && typeof children.props === "object" && "children" in children.props ? children.props.children : children,
...options
});
return /* @__PURE__ */jsx(Comp, {
...rest,
children: /* @__PURE__ */jsx(NavigationContent, {
children
})
});
}
export { Tabs };
//# sourceMappingURL=Tabs.mjs.map