UNPKG

@indielayer/ui

Version:

Indielayer UI Components with Tailwind CSS build for Vue 3

55 lines (54 loc) 1.63 kB
import { defineComponent as d, openBlock as o, createElementBlock as t, normalizeClass as a, unref as e, normalizeStyle as z, createBlock as i, createCommentVNode as n, toDisplayString as y } from "vue"; import { useCommon as l } from "../../composables/useCommon.js"; import { useTheme as k } from "../../composables/useTheme.js"; import c from "../icon/Icon.vue.js"; import v from "../spinner/Spinner.vue.js"; import { successIcon as S, errorIcon as b } from "../../common/icons.js"; const g = { ...l.props(), status: { type: String, default: "active" }, icon: String, label: String }, C = { name: "XLoader", validators: { ...l.validators(), status: ["active", "success", "error"] } }, $ = /* @__PURE__ */ d({ ...C, props: g, setup(m) { const u = m, { styles: p, classes: r, className: f } = k("Loader", {}, u); return (s, B) => (o(), t("div", { class: a([e(f), e(r).wrapper]), style: z(e(p)) }, [ s.status === "active" ? (o(), i(v, { key: 0, size: s.size, icon: s.icon }, null, 8, ["size", "icon"])) : s.status === "success" ? (o(), i(c, { key: 1, class: a(e(r).iconSuccess), size: s.size, icon: e(S) }, null, 8, ["class", "size", "icon"])) : s.status === "error" ? (o(), i(c, { key: 2, class: a(e(r).iconError), size: s.size, icon: e(b) }, null, 8, ["class", "size", "icon"])) : n("", !0), s.label ? (o(), t("span", { key: 3, class: a(e(r).label) }, y(s.label), 3)) : n("", !0) ], 6)); } }); export { $ as default };