import { lt as __exportAll } from "./translation-adapter-52kMOmeK.mjs";
import { f as getGapField, i as getBorderColorField, l as getColorField, m as getPaddingField, n as borderWidthClasses, o as getBorderRadiusField, r as gapValues, s as getBorderWidthField, t as borderColorClasses, u as getFontSizeField } from "./registries-BZVov8GL.mjs";
import { jsx, jsxs } from "react/jsx-runtime";
//#region ../widgets/src/widgets/BulletListWidget.tsx
var BulletListWidget_exports = /* @__PURE__ */ __exportAll({
	BulletListWidget: () => BulletListWidget,
	bulletListWidgetPropertySchema: () => bulletListWidgetPropertySchema
});
function BulletListWidget({ titleEnabled = true, title = "List", titleFontSize = "lg", titleColor = "foreground", listType = "unordered", items = [
	"Item 1",
	"Item 2",
	"Item 3"
], itemFontSize = "md", itemColor = "foreground", background = {
	type: "solid",
	color: "background"
}, padding = 4, borderRadius = "md", borderWidth = "none", borderColor = "muted", gapSize = "sm", 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";
	const listItems = typeof items === "string" ? items.split("\n").filter(Boolean) : items ?? [];
	const ListTag = listType === "ordered" ? "ol" : "ul";
	const listStyleClass = listType === "ordered" ? "list-decimal" : "list-disc";
	const gap = gapValues[gapSize] ?? gapValues.sm;
	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} font-header mb-2 font-bold`,
			children: title
		}), /* @__PURE__ */ jsx(ListTag, {
			className: `${listStyleClass} pl-5 text-${itemFontSize} text-${itemColor}`,
			style: {
				display: "flex",
				flexDirection: "column",
				gap
			},
			children: listItems.map((item, index) => /* @__PURE__ */ jsx("li", { children: item }, index))
		})]
	});
}
const bulletListWidgetPropertySchema = {
	widgetType: "BulletListWidget",
	displayName: "Bullet List",
	fields: [
		{
			key: "titleEnabled",
			label: "Widget Title",
			type: "boolean",
			description: "Enable the title displayed above the list",
			defaultValue: true,
			group: "Title"
		},
		{
			key: "title",
			label: "Title",
			type: "text",
			description: "The title",
			defaultValue: "List",
			group: "Title",
			requiresKeyToBeTrue: "titleEnabled"
		},
		getFontSizeField({
			key: "titleFontSize",
			label: "Title Font Size",
			description: "Font size for the title",
			defaultValue: "lg",
			group: "Title",
			requiresKeyToBeTrue: "titleEnabled"
		}),
		getColorField({
			key: "titleColor",
			label: "Title Color",
			description: "The color of the title",
			defaultValue: "foreground",
			group: "Title",
			requiresKeyToBeTrue: "titleEnabled"
		}),
		{
			key: "listType",
			label: "List Type",
			type: "select",
			description: "Ordered (numbered) or unordered (bullets)",
			options: [{
				label: "Bullets",
				value: "unordered"
			}, {
				label: "Numbered",
				value: "ordered"
			}],
			defaultValue: "unordered",
			group: "List"
		},
		{
			key: "items",
			label: "List Items",
			type: "stringArray",
			description: "Add or remove list items",
			defaultValue: [
				"Item 1",
				"Item 2",
				"Item 3"
			],
			group: "List"
		},
		getFontSizeField({
			key: "itemFontSize",
			label: "Item Font Size",
			description: "Font size for list items",
			defaultValue: "md",
			group: "List"
		}),
		getColorField({
			key: "itemColor",
			label: "Item Color",
			description: "The color of list items",
			defaultValue: "foreground",
			group: "List"
		}),
		{
			type: "background",
			key: "background",
			label: "Background",
			description: "Background for the list container",
			defaultValue: "background",
			group: "Style"
		},
		getPaddingField({
			key: "padding",
			label: "Padding",
			description: "The padding of the list container",
			defaultValue: 4,
			group: "Style"
		}),
		getBorderRadiusField({
			key: "borderRadius",
			label: "Border Radius",
			description: "The border radius of the list container",
			group: "Design"
		}),
		getBorderWidthField({
			key: "borderWidth",
			label: "Border Width",
			description: "Border width for the widget",
			defaultValue: "none",
			group: "Design"
		}),
		getBorderColorField({
			key: "borderColor",
			label: "Border Color",
			description: "Border color for the widget",
			defaultValue: "muted",
			group: "Design"
		}),
		getGapField({
			key: "gapSize",
			label: "Item Gap",
			description: "Gap between list items",
			defaultValue: "sm",
			group: "Style"
		})
	]
};
//#endregion
export { BulletListWidget_exports as n, bulletListWidgetPropertySchema as r, BulletListWidget as t };

//# sourceMappingURL=BulletListWidget-CPYe9y8c.mjs.map