@dialpad/dialtone
Version:
Dialpad's Dialtone design system monorepo
61 lines (60 loc) • 1.53 kB
JavaScript
import { icons as t } from "@dialpad/dialtone-icons/vue3";
import { ICON_NAMES as i, ICON_SIZE_MODIFIERS as n } from "./icon-constants.js";
import { createBlock as o, createCommentVNode as c, openBlock as s, resolveDynamicComponent as d } 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) => i.includes(e)
},
/**
* The label of the icon as read out by a screen-reader. Leave this unset if your icon is purely presentational
*/
ariaLabel: {
type: String,
default: void 0
}
},
data() {
return {
// i18n: new DialtoneLocalization(),
};
},
computed: {
icon() {
return t[`./src/icons/${this.name}.vue`];
},
iconAriaLabel() {
return this.ariaLabel;
}
}
};
function u(e, p, r, f, _, a) {
return a.icon ? (s(), o(d(a.icon), {
key: 0,
size: r.size,
"aria-label": a.iconAriaLabel,
"data-qa": e.$attrs["data-qa"] ?? "dt-icon"
}, null, 8, ["size", "aria-label", "data-qa"])) : c("", !0);
}
const C = /* @__PURE__ */ l(m, [["render", u]]);
export {
C as default
};
//# sourceMappingURL=icon.js.map