UNPKG

@dialpad/dialtone

Version:

Dialpad's Dialtone design system monorepo

53 lines (52 loc) 1.43 kB
import { icons } from "@dialpad/dialtone-icons/vue2"; import { ICON_SIZE_MODIFIERS, ICON_NAMES } from "./icon_constants.js"; import normalizeComponent from "../../_virtual/_plugin-vue2_normalizer.js"; const _sfc_main = { name: "DtIcon", props: { /** * The size of the icon. * @values 100, 200, 300, 400, 500, 600, 700, 800 */ size: { type: String, default: "500", validator: (s) => Object.keys(ICON_SIZE_MODIFIERS).includes(s) }, /** * The icon name in kebab-case */ name: { type: String, required: true, validator: (name) => ICON_NAMES.includes(name) }, /** * 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 icons[`./src/icons/${this.name}.vue`]; } } }; var _sfc_render = function render() { var _vm = this, _c = _vm._self._c; return _vm.icon ? _c(_vm.icon, { tag: "component", attrs: { "size": _vm.size, "aria-label": _vm.ariaLabel, "data-qa": _vm.$attrs["data-qa"] ?? "dt-icon" } }) : _vm._e(); }; var _sfc_staticRenderFns = []; var __component__ = /* @__PURE__ */ normalizeComponent( _sfc_main, _sfc_render, _sfc_staticRenderFns ); const icon = __component__.exports; export { icon as default }; //# sourceMappingURL=icon.vue.js.map