@fifteen/design-system-vue
Version:
Vue 3 (Composition API + Typescript) implementation of the Fifteen Design System
35 lines (34 loc) • 881 B
JavaScript
import { inject as i, computed as f, unref as s, watch as a } from "vue";
const u = {
icons: Symbol.for("icons"),
flags: Symbol.for("flagIcons"),
creditCards: Symbol.for("creditCardIcons")
};
function y(c, o) {
const t = u[c], e = i(t), n = f(() => {
const r = s(o);
return r ? e?.[r] : null;
});
return a(
n,
(r) => {
s(o) && !r && console.warn(
`[FDS] Markup for icon "${s(o)}" was not found for collection "${Symbol.keyFor(
t
)}". Icons are not longer registered by default. You must import and declare them by using the \`createFds\` function in your app entry point.'`
);
},
{ immediate: !0 }
), { markup: n };
}
function d(c, o) {
const t = u[c], e = i(t);
e && Object.keys(o).forEach((n) => {
e[n] = o[n];
});
}
export {
u as iconsInjectionKeys,
d as registerIcons,
y as useIcon
};