import { defineConfig } from "tsdown";

const components = [
	"dialog", "toggle", "switch", "checkbox", "progress", "text-field",
	"radio-group", "toggle-group", "collapsible", "accordion", "alert-dialog", "tabs",
	"slider", "drawer", "listbox", "select", "combobox", "dropdown-menu",
	"toast", "tooltip", "popover", "hover-card", "alert", "badge",
	"skeleton", "breadcrumbs", "link", "button", "number-field",
	"card", "avatar", "navigation-menu",
	"virtual-list", "calendar", "date-picker", "command-palette", "form", "wizard", "data-table",
];
const utilities = ["presence", "focus-trap", "scroll-lock", "dismiss", "portal", "visually-hidden"];

const entry: Record<string, string> = {};
for (const c of components) entry[`${c}/index`] = `src/components/${c}/index.ts`;
for (const u of utilities) entry[`${u}/index`] = `src/utilities/${u}/index.ts`;

export default defineConfig({
	entry,
	format: ["esm", "cjs"],
	dts: true,
	clean: true,
	sourcemap: true,
	external: ["solid-js", "solid-js/web", "solid-js/store", "zod", "zod/v4"],
});
