import { ft as __exportAll } from "./translation-adapter-RsuBioxm.mjs";
import { d as getFontWeightField, i as getBorderColorField, l as getColorField, m as getPaddingField, n as borderWidthClasses, o as getBorderRadiusField, s as getBorderWidthField, t as borderColorClasses, u as getFontSizeField } from "./registries-DXVOnKV2.mjs";
import { jsx, jsxs } from "react/jsx-runtime";
import { AlignCenter, AlignLeft, AlignRight } from "lucide-react";
//#region ../widgets/src/widgets/TextWidget.tsx
var TextWidget_exports = /* @__PURE__ */ __exportAll({
	TextWidget: () => TextWidget,
	textWidgetPropertySchema: () => textWidgetPropertySchema
});
const textAlignmentClasses = {
	left: "text-left",
	center: "text-center",
	right: "text-right"
};
function TextWidget({ titleEnabled = true, title = "Text Widget", titleFontSize = "xl", titleFontWeight = "bold", titleColor = "foreground", titleAlignment = "left", description = "This is a text widget", descriptionFontSize = "md", descriptionFontWeight = "normal", descriptionColor = "foreground", descriptionAlignment = "left", background = {
	type: "solid",
	color: "background"
}, padding = 4, borderRadius = "md", borderWidth = "none", borderColor = "muted", className, ...props }) {
	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";
	return /* @__PURE__ */ jsxs("div", {
		className: `bg-${backgroundColor} p-${padding} rounded-${borderRadius} ${borderWidthClasses[borderWidth]} ${borderWidth !== "none" ? borderColorClasses[borderColor] : ""} ${className ?? ""}`,
		style: { backgroundImage },
		...props,
		children: [titleEnabled && /* @__PURE__ */ jsx("h2", {
			className: `text-${titleFontSize} text-${titleColor} ${textAlignmentClasses[titleAlignment]} font-header font-${titleFontWeight}`,
			children: title
		}), /* @__PURE__ */ jsx("p", {
			className: `text-${descriptionFontSize} text-${descriptionColor} ${textAlignmentClasses[descriptionAlignment]} font-${descriptionFontWeight}`,
			children: description
		})]
	});
}
const textWidgetPropertySchema = {
	widgetType: "TextWidget",
	displayName: "Text Widget",
	tabsConfig: [{
		id: "content",
		label: "Content"
	}],
	dataSourceTargetProps: ["title", "description"],
	fields: [
		{
			key: "titleEnabled",
			label: "Widget Title",
			type: "boolean",
			description: "Enable the title displayed above the text",
			defaultValue: true,
			tab: "content",
			group: "Title"
		},
		{
			key: "title",
			label: "Title",
			type: "text",
			description: "The title",
			defaultValue: "Heads up!",
			tab: "content",
			group: "Title",
			requiresKeyToBeTrue: "titleEnabled"
		},
		getFontSizeField({
			key: "titleFontSize",
			label: "Title Font Size",
			description: "Font size for the title",
			defaultValue: "xl",
			tab: "content",
			group: "Title",
			requiresKeyToBeTrue: "titleEnabled"
		}),
		getFontWeightField({
			key: "titleFontWeight",
			label: "Title Font Weight",
			description: "Font weight for the title",
			defaultValue: "bold",
			tab: "content",
			group: "Title",
			requiresKeyToBeTrue: "titleEnabled"
		}),
		getColorField({
			key: "titleColor",
			label: "Title Color",
			description: "The color of the title",
			defaultValue: "foreground",
			tab: "content",
			group: "Title",
			requiresKeyToBeTrue: "titleEnabled"
		}),
		{
			key: "titleAlignment",
			label: "Alignment",
			type: "buttonGroup",
			description: "Text alignment for the title",
			options: [
				{
					icon: AlignLeft,
					ariaLabel: "Align left",
					value: "left"
				},
				{
					icon: AlignCenter,
					ariaLabel: "Align center",
					value: "center"
				},
				{
					icon: AlignRight,
					ariaLabel: "Align right",
					value: "right"
				}
			],
			defaultValue: "left",
			tab: "content",
			group: "Title",
			requiresKeyToBeTrue: "titleEnabled"
		},
		{
			key: "description",
			label: "Description",
			type: "textarea",
			description: "The text message",
			rows: 3,
			defaultValue: "You can add components and dependencies to your app using the cli.",
			tab: "content",
			group: "Description"
		},
		getFontSizeField({
			key: "descriptionFontSize",
			label: "Description Font Size",
			description: "Font size for the text",
			defaultValue: "md",
			tab: "content",
			group: "Description"
		}),
		getFontWeightField({
			key: "descriptionFontWeight",
			label: "Description Font Weight",
			description: "Font weight for the text",
			defaultValue: "normal",
			tab: "content",
			group: "Description"
		}),
		getColorField({
			key: "descriptionColor",
			label: "Description Color",
			description: "The color of the text",
			defaultValue: "foreground",
			tab: "content",
			group: "Description"
		}),
		{
			key: "descriptionAlignment",
			label: "Alignment",
			type: "buttonGroup",
			description: "Text alignment for the description",
			options: [
				{
					icon: AlignLeft,
					ariaLabel: "Align left",
					value: "left"
				},
				{
					icon: AlignCenter,
					ariaLabel: "Align center",
					value: "center"
				},
				{
					icon: AlignRight,
					ariaLabel: "Align right",
					value: "right"
				}
			],
			defaultValue: "left",
			tab: "content",
			group: "Description"
		},
		{
			type: "background",
			key: "background",
			label: "Background",
			description: "Background for the text container",
			defaultValue: "background",
			tab: "content",
			group: "Style"
		},
		getPaddingField({
			key: "padding",
			label: "Padding",
			description: "The padding of the text container",
			defaultValue: 4,
			tab: "content",
			group: "Style"
		}),
		getBorderRadiusField({
			key: "borderRadius",
			description: "The border radius of the text container",
			label: "Border Radius",
			tab: "content",
			group: "Design"
		}),
		getBorderWidthField({
			key: "borderWidth",
			label: "Border Width",
			description: "The border width of the text container",
			defaultValue: "none",
			tab: "content",
			group: "Design"
		}),
		getBorderColorField({
			key: "borderColor",
			label: "Border Color",
			description: "The border color of the text container",
			defaultValue: "muted",
			tab: "content",
			group: "Design"
		})
	]
};
//#endregion
export { TextWidget_exports as n, textWidgetPropertySchema as r, TextWidget as t };

//# sourceMappingURL=TextWidget-B-2RFD_g.mjs.map