const require_chunk = require("./chunk-9hOWP6kD.cjs");
const require_registries = require("./registries-yZkFfBWj.cjs");
let react_jsx_runtime = require("react/jsx-runtime");
let lucide_react = require("lucide-react");
//#region ../widgets/src/widgets/TextWidget.tsx
var TextWidget_exports = /* @__PURE__ */ require_chunk.__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__ */ (0, react_jsx_runtime.jsxs)("div", {
		className: `bg-${backgroundColor} p-${padding} rounded-${borderRadius} ${require_registries.borderWidthClasses[borderWidth]} ${borderWidth !== "none" ? require_registries.borderColorClasses[borderColor] : ""} ${className ?? ""}`,
		style: { backgroundImage },
		...props,
		children: [titleEnabled && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("h2", {
			className: `text-${titleFontSize} text-${titleColor} ${textAlignmentClasses[titleAlignment]} font-header font-${titleFontWeight}`,
			children: title
		}), /* @__PURE__ */ (0, react_jsx_runtime.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"
		},
		require_registries.getFontSizeField({
			key: "titleFontSize",
			label: "Title Font Size",
			description: "Font size for the title",
			defaultValue: "xl",
			tab: "content",
			group: "Title",
			requiresKeyToBeTrue: "titleEnabled"
		}),
		require_registries.getFontWeightField({
			key: "titleFontWeight",
			label: "Title Font Weight",
			description: "Font weight for the title",
			defaultValue: "bold",
			tab: "content",
			group: "Title",
			requiresKeyToBeTrue: "titleEnabled"
		}),
		require_registries.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: lucide_react.AlignLeft,
					ariaLabel: "Align left",
					value: "left"
				},
				{
					icon: lucide_react.AlignCenter,
					ariaLabel: "Align center",
					value: "center"
				},
				{
					icon: lucide_react.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"
		},
		require_registries.getFontSizeField({
			key: "descriptionFontSize",
			label: "Description Font Size",
			description: "Font size for the text",
			defaultValue: "md",
			tab: "content",
			group: "Description"
		}),
		require_registries.getFontWeightField({
			key: "descriptionFontWeight",
			label: "Description Font Weight",
			description: "Font weight for the text",
			defaultValue: "normal",
			tab: "content",
			group: "Description"
		}),
		require_registries.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: lucide_react.AlignLeft,
					ariaLabel: "Align left",
					value: "left"
				},
				{
					icon: lucide_react.AlignCenter,
					ariaLabel: "Align center",
					value: "center"
				},
				{
					icon: lucide_react.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"
		},
		require_registries.getPaddingField({
			key: "padding",
			label: "Padding",
			description: "The padding of the text container",
			defaultValue: 4,
			tab: "content",
			group: "Style"
		}),
		require_registries.getBorderRadiusField({
			key: "borderRadius",
			description: "The border radius of the text container",
			label: "Border Radius",
			tab: "content",
			group: "Design"
		}),
		require_registries.getBorderWidthField({
			key: "borderWidth",
			label: "Border Width",
			description: "The border width of the text container",
			defaultValue: "none",
			tab: "content",
			group: "Design"
		}),
		require_registries.getBorderColorField({
			key: "borderColor",
			label: "Border Color",
			description: "The border color of the text container",
			defaultValue: "muted",
			tab: "content",
			group: "Design"
		})
	]
};
//#endregion
Object.defineProperty(exports, "TextWidget", {
	enumerable: true,
	get: function() {
		return TextWidget;
	}
});
Object.defineProperty(exports, "TextWidget_exports", {
	enumerable: true,
	get: function() {
		return TextWidget_exports;
	}
});
Object.defineProperty(exports, "textWidgetPropertySchema", {
	enumerable: true,
	get: function() {
		return textWidgetPropertySchema;
	}
});

//# sourceMappingURL=TextWidget-A1k61Rz8.cjs.map