/*! ratio-ui · design system for knowledge sharing · https://github.com/losol/ratio-ui · (c) 2026 Losol AS · MPL-2.0 */
import { cn } from "../../utils/cn.js";
import { buildCoverImageStyle } from "../../utils/buildCoverImageStyle.js";
import { buildSpacingClasses } from "../../tokens/spacing.js";
import { buildBorderClasses } from "../../tokens/borders.js";
import { surfaceBgClasses } from "../../tokens/colors.js";
/* empty css     */
import "react";
import { jsx } from "react/jsx-runtime";
//#region src/core/Card/Card.tsx
var SHADOW_CLASSES = {
	none: "",
	xs: "card-shadow-xs",
	sm: "card-shadow-sm",
	md: "card-shadow-md"
};
var Card = ({ transparent = false, shadow, hoverEffect = false, gap = "sm", color, children, as: Component = "div", backgroundImageUrl, className, style, testId, ...spacingAndBorder }) => {
	const padding = spacingAndBorder.padding ?? "md";
	const radius = spacingAndBorder.radius ?? "xl";
	const border = spacingAndBorder.border ?? !transparent;
	const effectiveShadow = shadow ?? (transparent ? "none" : "xs");
	const fillClass = transparent ? "bg-transparent" : "bg-card";
	const hoverShadow = effectiveShadow === "none" ? "hover:shadow-card-hover-tile" : "hover:shadow-card-hover";
	const transitionClasses = hoverEffect ? "transition-all duration-200 ease-out" : "";
	const hoverClasses = hoverEffect ? `hover:bg-card-hover hover:border-(--primary) ${hoverShadow}` : "";
	const bgClasses = transparent ? fillClass : color ? surfaceBgClasses[color] : fillClass;
	const { padding: _padding, paddingX, paddingY, paddingTop, paddingBottom, margin, marginX, marginY, marginTop, marginBottom, border: _border, borderColor, radius: _radius, ...rest } = spacingAndBorder;
	const spacingClasses = buildSpacingClasses({
		padding,
		paddingX,
		paddingY,
		paddingTop,
		paddingBottom,
		margin,
		marginX,
		marginY,
		marginTop,
		marginBottom,
		gap
	});
	const borderClasses = buildBorderClasses({
		border,
		borderColor,
		radius
	});
	const combinedStyle = buildCoverImageStyle(backgroundImageUrl) || style;
	return /* @__PURE__ */ jsx(Component, {
		className: cn("ratio-card", "relative", bgClasses, borderClasses, SHADOW_CLASSES[effectiveShadow], transitionClasses, hoverClasses, spacingClasses, className),
		style: combinedStyle,
		"data-testid": testId,
		...rest,
		children
	});
};
//#endregion
export { Card };

//# sourceMappingURL=Card2.js.map