@indielayer/ui
Version:
Indielayer UI Components with Tailwind CSS build for Vue 3
27 lines (26 loc) • 2.03 kB
JavaScript
const s = {
classes: {
wrapper: "",
box: ({ props: e, data: t }) => {
const r = ["w-full border border-secondary-300 dark:border-secondary-700 outline-transparent outline outline-2 outline-offset-[-1px] transition-all duration-150 ease-in-out rounded-md shadow-sm"];
return !t.errorInternal && !e.disabled && r.push("hover:border-secondary-400 dark:hover:border-secondary-500"), e.size === "xs" ? r.push("px-2 py-1 text-xs") : e.size === "sm" ? r.push("px-2 py-1.5 text-sm") : e.size === "lg" ? r.push("px-4 py-3 text-lg") : e.size === "xl" ? r.push("px-5 py-4 text-xl") : r.push("px-3 py-2"), e.disabled ? r.push("bg-secondary-100 dark:bg-secondary-700 text-secondary-400 dark:text-secondary-600 cursor-not-allowed") : r.push("bg-white dark:bg-secondary-800 text-secondary-700 dark:text-secondary-200"), t.errorInternal ? r.push("border-error-500 dark:border-error-400 group-focus:outline-error-500") : e.disabled || r.push("group-focus:outline-[color:var(--x-select-border)]"), !e.multiple && !e.multipleCheckbox && r.push("truncate"), e.clearable ? r.push("pr-14") : r.push("pr-8"), r;
},
truncateCounter: "absolute right-0 cursor-pointer hover:bg-secondary-200 bg-secondary-100 text-secondary-800 rounded px-1 py-0.5 text-xs",
content: "p-1",
search: "p-1 mb-0.5",
contentBody: "overflow-y-auto max-h-64 min-w-[280px]",
iconWrapper: "absolute inset-y-0 right-0 flex items-center px-2 pointer-events-none",
clearButton: "absolute top-1/2 -translate-y-1/2 right-5 flex items-center p-2",
icon: ({ props: e }) => {
const t = [];
return e.size === "sm" || e.size === "xs" ? t.push("h-3 w-3") : e.size === "lg" || e.size === "xl" ? t.push("h-5 w-5") : t.push("h-4 w-4"), e.disabled ? t.push("text-secondary-300 dark:text-secondary-500") : t.push("text-secondary-500 dark:text-secondary-400"), t;
}
},
styles: ({ colors: e, css: t }) => {
const r = e.getPalette("primary");
return t.get("border", r[500]);
}
}, o = s;
export {
o as default
};