@dialpad/dialtone
Version:
Dialpad's Dialtone design system monorepo
58 lines (57 loc) • 1.45 kB
JavaScript
import { icons as r } from "@dialpad/dialtone-icons/vue3";
import { ICON_SIZE_MODIFIERS as n, ICON_NAMES as o } from "./icon-constants.js";
import { openBlock as i, createBlock as c, resolveDynamicComponent as d, createCommentVNode as s } from "vue";
import { _ as l } from "../../_plugin-vue_export-helper-CHgC5LLL.js";
const m = {
compatConfig: { MODE: 3 },
name: "DtIcon",
props: {
/**
* The size of the icon.
* @values 100, 200, 300, 400, 500, 600, 700, 800
*/
size: {
type: String,
default: "500",
validator: (e) => Object.keys(n).includes(e)
},
/**
* The icon name in kebab-case
*/
name: {
type: String,
required: !0,
validator: (e) => o.includes(e)
},
/**
* The label of the icon as read out by a screenreader. Leave this unset if your icon is purely presentational
*/
ariaLabel: {
type: String,
default: void 0
}
},
data() {
return {
iconLoaded: !1
};
},
computed: {
icon() {
return r[`./src/icons/${this.name}.vue`];
}
}
};
function u(e, f, a, p, _, t) {
return t.icon ? (i(), c(d(t.icon), {
key: 0,
size: a.size,
"aria-label": a.ariaLabel,
"data-qa": e.$attrs["data-qa"] ?? "dt-icon"
}, null, 8, ["size", "aria-label", "data-qa"])) : s("", !0);
}
const C = /* @__PURE__ */ l(m, [["render", u]]);
export {
C as default
};
//# sourceMappingURL=icon.js.map