require("./chunk-9hOWP6kD.cjs");
const require_ScreenRenderer = require("./ScreenRenderer-B-ZfGmhX.cjs");
const require_registries = require("./registries-DgzzKX8_.cjs");
let react_jsx_runtime = require("react/jsx-runtime");
//#region ../widgets/src/widgets/CardWidget.tsx
const DEFAULT_BACKGROUND = {
	type: "solid",
	color: "background"
};
const DEFAULT_CHILDREN = [];
function CardWidget({ headerEnabled = true, title = "Card Title", titleFontSize = "lg", titleColor = "foreground", headerBackground = "transparent", footerEnabled = false, footerContent = "", footerColor = "muted", footerBackground = "transparent", background = DEFAULT_BACKGROUND, padding = 6, borderRadius = "xl", borderWidth = "thin", borderColor = "muted", borderEnabled, gapSize = "md", children = DEFAULT_CHILDREN, className = "" }) {
	const contextRegistry = require_ScreenRenderer.useRegistry();
	const ScreenRenderer$1 = require_ScreenRenderer.useScreenRenderer() ?? require_ScreenRenderer.ScreenRenderer;
	const backgroundColor = background.color || "background";
	const backgroundImage = (background.resource?.image_url || background.resource?.imageUrl) && background.type === "image" ? `url(${background.resource.image_url || background.resource.imageUrl})` : "none";
	const gapSizeValue = gapSize ? require_registries.gapValues[gapSize] : 4;
	const effectiveBorderWidth = borderEnabled === false ? "none" : borderWidth;
	const cardClasses = [
		"flex flex-col gap-6",
		`bg-${backgroundColor}`,
		`p-${padding}`,
		`rounded-${borderRadius}`,
		require_registries.borderWidthClasses[effectiveBorderWidth],
		effectiveBorderWidth !== "none" ? require_registries.borderColorClasses[borderColor] : "",
		className
	].filter(Boolean).join(" ");
	const containerStyle = { backgroundImage };
	const validChildren = children.filter((child) => child !== null);
	return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
		"data-slot": "card",
		className: cardClasses,
		style: containerStyle,
		children: [
			headerEnabled && (title || headerBackground !== "transparent") && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
				"data-slot": "card-header",
				className: headerBackground !== "transparent" ? `bg-${headerBackground} -mx-${padding} -mt-${padding} px-${padding} py-${padding} rounded-t-${borderRadius}` : void 0,
				children: title && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
					"data-slot": "card-title",
					className: `text-${titleFontSize} text-${titleColor} font-header leading-none font-semibold`,
					children: title
				})
			}),
			/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
				"data-slot": "card-content",
				className: "@container flex-1",
				children: contextRegistry ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ScreenRenderer$1, {
					screen: validChildren,
					registry: contextRegistry,
					className: `flex flex-col gap-${gapSizeValue}`
				}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { className: `flex flex-col gap-${gapSizeValue}` })
			}),
			footerEnabled && footerContent && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
				"data-slot": "card-footer",
				className: [`text-sm text-${footerColor} flex items-center`, footerBackground !== "transparent" ? `bg-${footerBackground} -mx-${padding} -mb-${padding} px-${padding} py-${padding} rounded-b-${borderRadius}` : ""].filter(Boolean).join(" "),
				children: footerContent
			})
		]
	});
}
const cardWidgetPropertySchema = {
	widgetType: "CardWidget",
	displayName: "Card",
	fields: [
		{
			key: "headerEnabled",
			label: "Show Header",
			type: "boolean",
			description: "Toggle header visibility",
			defaultValue: true,
			group: "Header"
		},
		{
			key: "title",
			label: "Title",
			type: "text",
			description: "Card title text",
			defaultValue: "Card Title",
			group: "Header",
			requiresKeyToBeTrue: "headerEnabled"
		},
		require_registries.getFontSizeField({
			key: "titleFontSize",
			label: "Title Font Size",
			description: "Font size for the title",
			defaultValue: "lg",
			group: "Header",
			requiresKeyToBeTrue: "headerEnabled"
		}),
		require_registries.getColorField({
			key: "titleColor",
			label: "Title Color",
			description: "Color for the title",
			defaultValue: "foreground",
			group: "Header",
			requiresKeyToBeTrue: "headerEnabled"
		}),
		require_registries.getColorField({
			key: "headerBackground",
			label: "Header Background",
			description: "Background color for the header",
			defaultValue: "transparent",
			group: "Header",
			requiresKeyToBeTrue: "headerEnabled"
		}),
		{
			key: "footerEnabled",
			label: "Show Footer",
			type: "boolean",
			description: "Toggle footer visibility",
			defaultValue: false,
			group: "Footer"
		},
		{
			key: "footerContent",
			label: "Footer Text",
			type: "text",
			description: "Footer content text",
			defaultValue: "",
			group: "Footer",
			requiresKeyToBeTrue: "footerEnabled"
		},
		require_registries.getColorField({
			key: "footerColor",
			label: "Footer Color",
			description: "Color for the footer text",
			defaultValue: "muted",
			group: "Footer",
			requiresKeyToBeTrue: "footerEnabled"
		}),
		require_registries.getColorField({
			key: "footerBackground",
			label: "Footer Background",
			description: "Background color for the footer",
			defaultValue: "transparent",
			group: "Footer",
			requiresKeyToBeTrue: "footerEnabled"
		}),
		{
			type: "background",
			key: "background",
			label: "Background",
			description: "Background for the card",
			defaultValue: "background",
			group: "Design"
		},
		require_registries.getPaddingField({
			key: "padding",
			label: "Padding",
			description: "Card padding",
			defaultValue: 6,
			group: "Design"
		}),
		require_registries.getBorderRadiusField({
			key: "borderRadius",
			label: "Border Radius",
			description: "Card border radius",
			defaultValue: "xl",
			group: "Design"
		}),
		require_registries.getBorderWidthField({
			key: "borderWidth",
			label: "Border Width",
			description: "Card border width",
			defaultValue: "thin",
			group: "Design"
		}),
		require_registries.getBorderColorField({
			key: "borderColor",
			label: "Border Color",
			description: "Card border color",
			defaultValue: "muted",
			group: "Design"
		}),
		require_registries.getGapField({
			key: "gapSize",
			label: "Gap",
			description: "Gap between child widgets",
			defaultValue: "md",
			group: "Design"
		})
	]
};
//#endregion
Object.defineProperty(exports, "CardWidget", {
	enumerable: true,
	get: function() {
		return CardWidget;
	}
});
Object.defineProperty(exports, "cardWidgetPropertySchema", {
	enumerable: true,
	get: function() {
		return cardWidgetPropertySchema;
	}
});

//# sourceMappingURL=CardWidget-BjSOmo4v.cjs.map