@indielayer/ui
Version:
Indielayer UI Components with Tailwind CSS build for Vue 3
48 lines (47 loc) • 1.48 kB
JavaScript
import { defineComponent as m, openBlock as n, createBlock as p, resolveDynamicComponent as d, normalizeStyle as u, unref as o, normalizeClass as c, withCtx as f, createElementBlock as k, renderSlot as t, createVNode as y } from "vue";
import { useColors as h } from "../../composables/useColors.js";
import { useTheme as g } from "../../composables/useTheme.js";
import { externalIcon as B } from "../../common/icons.js";
import w from "../icon/Icon.vue.js";
const C = {
key: 0,
class: "inline-flex items-center"
}, $ = {
...h.props("secondary"),
tag: {
type: String,
default: "a"
},
to: [String, Object],
shadow: Boolean,
external: Boolean,
underline: Boolean
}, S = { name: "XLink" }, D = /* @__PURE__ */ m({
...S,
props: $,
setup(s) {
const l = s, { styles: r, classes: a, className: i } = g("Link", {}, l);
return (e, v) => (n(), p(d(e.to ? e.tag !== "a" ? e.tag : "router-link" : e.tag), {
to: e.to,
style: u(o(r)),
class: c([
o(i),
e.$style.link,
o(a).wrapper,
[e.shadow ? e.$style["link--shadow"] : ""],
{ underline: e.underline }
])
}, {
default: f(() => [
e.external ? (n(), k("span", C, [
t(e.$slots, "default", {}, void 0, !0),
y(w, { icon: o(B) }, null, 8, ["icon"])
])) : t(e.$slots, "default", { key: 1 }, void 0, !0)
]),
_: 3
}, 8, ["to", "style", "class"]));
}
});
export {
D as default
};