@arolariu/components
Version:
🎨 70+ beautiful, accessible React components built on Base UI. TypeScript-first, CSS Modules styling, tree-shakeable, SSR-ready. Perfect for modern web apps, design systems & rapid prototyping. Zero config, maximum flexibility! ⚡
36 lines (35 loc) • 1.46 kB
JavaScript
"use client";
import { jsx } from "react/jsx-runtime";
import { mergeProps } from "@base-ui/react/merge-props";
import { Toggle } from "@base-ui/react/toggle";
import { useRender } from "@base-ui/react/use-render";
import { cn } from "../../lib/utilities.js";
import toggle_module from "./toggle.module.js";
import * as __rspack_external_react from "react";
function toggleVariants({ variant = "default", size = "default", className } = {}) {
const variantClass = "outline" === variant ? toggle_module.outline : toggle_module["default"];
const sizeClass = "sm" === size ? toggle_module.sizeSm : "lg" === size ? toggle_module.sizeLg : toggle_module.sizeDefault;
return cn(toggle_module.root, variantClass, sizeClass, className);
}
const toggle_Toggle = /*#__PURE__*/ __rspack_external_react.forwardRef((props, ref)=>{
const { className, children, render, size, variant, ...otherProps } = props;
return /*#__PURE__*/ jsx(Toggle, {
ref: ref,
...otherProps,
render: useRender({
defaultTagName: "button",
render: render,
props: mergeProps({
className: toggleVariants({
variant,
size,
className
})
}, {})
}),
children: children
});
});
toggle_Toggle.displayName = "Toggle";
export { toggleVariants, toggle_Toggle as Toggle };
//# sourceMappingURL=toggle.js.map