UNPKG

@postenbring/hedwig-react

Version:

React components for [Hedwig Design System](https://github.com/bring/hedwig-design-system).

60 lines (58 loc) 1.42 kB
import { __objRest, __spreadProps, __spreadValues } from "./chunk-YOSPWY5K.mjs"; // src/button/button.tsx import { forwardRef } from "react"; import { clsx } from "@postenbring/hedwig-css/typed-classname"; import { Slot } from "@radix-ui/react-slot"; import { jsx } from "react/jsx-runtime"; var Button = forwardRef( (_a, ref) => { var _b = _a, { asChild, children, variant = "primary", size = "large", fullWidth = false, icon = false, className } = _b, rest = __objRest(_b, [ "asChild", "children", "variant", "size", "fullWidth", "icon", "className" ]); const Component = asChild ? Slot : "button"; return /* @__PURE__ */ jsx( Component, __spreadProps(__spreadValues({ className: clsx( "hds-button", `hds-button--${size}`, `hds-button--${variant}`, { "hds-button--full": fullWidth === true, "hds-button--mobile-full": fullWidth === "mobile", "hds-button--only-icon": icon === true, "hds-button--leading-icon": icon === "leading", "hds-button--trailing-icon": icon === "trailing" }, className ), ref }, rest), { children }) ); } ); Button.displayName = "Button"; export { Button }; //# sourceMappingURL=chunk-TYCGAA35.mjs.map