UNPKG

@trail-ui/react

Version:
22 lines (19 loc) 737 B
import { CardContext } from "./chunk-PLEBMEPB.mjs"; // src/card/card-header.tsx import { clsx } from "@trail-ui/shared-utils"; import { forwardRef, useContext } from "react"; import { jsx } from "react/jsx-runtime"; function CardHeader(props, ref) { var _a; const { elementType, className, ...otherProps } = props; const Component = elementType || "div"; const { slots, classNames } = useContext(CardContext); const headerStyles = clsx(classNames == null ? void 0 : classNames.header, className); return /* @__PURE__ */ jsx(Component, { ref, className: (_a = slots.header) == null ? void 0 : _a.call(slots, { class: headerStyles }), ...otherProps }); } var _CardHeader = forwardRef(CardHeader); export { _CardHeader };