@aotearoan/neon
Version:
Neon is a lightweight design library of Vue 3 components with minimal dependencies.
54 lines (53 loc) • 1.33 kB
JavaScript
var r = Object.defineProperty;
var o = (i, t, s) => t in i ? r(i, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : i[t] = s;
var e = (i, t, s) => (o(i, typeof t != "symbol" ? t + "" : t, s), s);
const c = class c {
/**
* Add an icon to the registry.
*
* @param name Icon name, this corresponds to the <em>name</em> property in NeonIcon.
* @param svg The string representation of the SVG.
* @param overwrite Overwrite an existing icon if the name is a duplicate.
*
* @returns Boolean indicating if the icon was successfully registered.
*/
static addIcon(t, s, a = !0) {
return a || !c.icons[t] ? (c.icons[t] = s, !0) : !1;
}
/**
* Remove an icon from the registry.
*
* @param name The name of the icon to remove.
*/
static removeIcon(t) {
delete c.icons[t];
}
/**
* Get an icon SVG by name.
*
* @param name The name of the icon to remove.
*
* @returns The icon SVG as a string.
*/
static getIcon(t) {
return c.icons[t];
}
/**
* List all registered icon names.
*/
static list() {
return Object.keys(c.icons);
}
/**
* Clear the icon registry.
*/
static clear() {
c.icons = {};
}
};
e(c, "icons", {});
let n = c;
export {
n as NeonIconRegistry
};
//# sourceMappingURL=NeonIconRegistry.es.js.map