UNPKG

@postenbring/hedwig-react

Version:

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

63 lines (61 loc) 1.93 kB
import { Box } from "./chunk-3OGHJOJF.mjs"; import { __objRest, __spreadProps, __spreadValues } from "./chunk-YOSPWY5K.mjs"; // src/alert/alert.tsx import { forwardRef } from "react"; import { clsx } from "@postenbring/hedwig-css/typed-classname"; import { Slot } from "@radix-ui/react-slot"; import { jsx, jsxs } from "react/jsx-runtime"; var AlertTitle = forwardRef( (_a, ref) => { var _b = _a, { asChild, className } = _b, rest = __objRest(_b, ["asChild", "className"]); const Component = asChild ? Slot : "div"; return /* @__PURE__ */ jsx(Component, __spreadValues({ className: clsx("hds-alert__title", className), ref }, rest)); } ); AlertTitle.displayName = "Alert.Title"; var AlertDescription = forwardRef( (_a, ref) => { var _b = _a, { asChild, className } = _b, rest = __objRest(_b, ["asChild", "className"]); const Component = asChild ? Slot : "div"; return /* @__PURE__ */ jsx( Component, __spreadValues({ className: clsx("hds-alert__description", className), ref }, rest) ); } ); AlertDescription.displayName = "Alert.Description"; var Alert = forwardRef( (_a, ref) => { var _b = _a, { children, className, variant = "success", icon, iconClassName } = _b, rest = __objRest(_b, ["children", "className", "variant", "icon", "iconClassName"]); return /* @__PURE__ */ jsxs( Box, __spreadProps(__spreadValues({ className: clsx(`hds-alert`, `hds-alert--${variant}`, className), ref }, rest), { children: [ variant === "neutral" && /* @__PURE__ */ jsx("div", { className: clsx("hds-alert--neutral__icon", iconClassName), children: icon }), children ] }) ); } ); Alert.displayName = "Alert"; Alert.Title = AlertTitle; Alert.Description = AlertDescription; export { AlertTitle, AlertDescription, Alert }; //# sourceMappingURL=chunk-4P4GPVKZ.mjs.map