@aotearoan/neon
Version:
Neon is a lightweight design library of Vue 3 components with minimal dependencies.
38 lines (37 loc) • 1.08 kB
JavaScript
import { defineComponent as r, useAttrs as s, computed as i } from "vue";
import { NeonIconRegistry as a } from "../../../common/utils/NeonIconRegistry.es.js";
const d = r({
name: "NeonIcon",
props: {
/**
* The name of an icon registered in the icon registry.
*/
name: { type: String, required: !0 },
/**
* The color to render the icon. By default, it will be the current text color (light text in dark mode or dark text in light mode).
*/
color: { type: String, default: null },
/**
* Set the icon color to the inverse text color
*/
inverse: { type: Boolean, default: !1 },
/**
* Apply a disabled style to the icon
*/
disabled: { type: Boolean, default: !1 }
},
setup(e) {
const o = s(), t = i(() => {
const n = a.getIcon(e.name);
return n || console.error(`icon ${e.name} doesn't exist! Register icon with NeonIconRegistry.addIcon(name, svg);`), n;
});
return {
attrs: o,
icon: t
};
}
});
export {
d as default
};
//# sourceMappingURL=NeonIcon.es.js.map