// packages/components/src/card/card-header/hook.ts
import { useMemo } from "@wordpress/element";
import { useContextSystem } from "../../context/index.js";
import * as styles from "../styles.js";
import { useCx } from "../../utils/hooks/use-cx.js";
import { getPaddingBySize } from "../get-padding-by-size.js";
function useCardHeader(props) {
  const {
    className,
    isBorderless = false,
    isShady = false,
    size = "medium",
    ...otherProps
  } = useContextSystem(props, "CardHeader");
  const cx = useCx();
  const classes = useMemo(() => cx(
    styles.Header,
    styles.borderRadius,
    styles.borderColor,
    getPaddingBySize(size),
    isBorderless && styles.borderless,
    isShady && styles.shady,
    // This classname is added for legacy compatibility reasons.
    "components-card__header",
    className
  ), [className, cx, isBorderless, isShady, size]);
  return {
    ...otherProps,
    className: classes
  };
}
export {
  useCardHeader
};
//# sourceMappingURL=hook.js.map
