@dialpad/dialtone
Version:
Dialpad's Dialtone design system monorepo
55 lines (54 loc) • 1.34 kB
JavaScript
import { icons as r } from "@dialpad/dialtone-icons/vue2";
import { ICON_SIZE_MODIFIERS as n, ICON_NAMES as i } from "./icon-constants.js";
import { n as o } from "../../_plugin-vue2_normalizer-DSLOjnn3.js";
const c = {
name: "DtIcon",
// mixins: [DtLocalizationMixin],
props: {
/**
* The size of the icon.
* @values 100, 200, 300, 400, 500, 600, 700, 800
*/
size: {
type: String,
default: "500",
validator: (t) => Object.keys(n).includes(t)
},
/**
* The icon name in kebab-case
*/
name: {
type: String,
required: !0,
validator: (t) => i.includes(t)
},
/**
* 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
}
},
computed: {
icon() {
return r[`./src/icons/${this.name}.vue`];
},
iconAriaLabel() {
return this.ariaLabel;
}
}
};
var s = function() {
var e = this, a = e._self._c;
return e.icon ? a(e.icon, { tag: "component", attrs: { size: e.size, "aria-label": e.iconAriaLabel, "data-qa": e.$attrs["data-qa"] ?? "dt-icon" } }) : e._e();
}, _ = [], d = /* @__PURE__ */ o(
c,
s,
_
);
const u = d.exports;
export {
u as default
};
//# sourceMappingURL=icon.js.map