UNPKG

@clubmed/trident-icons

Version:

Shared ClubMed Icons library

51 lines (50 loc) 993 B
import { jsx as s } from "react/jsx-runtime"; import { createContext as u, useState as f } from "react"; const r = /* @__PURE__ */ new Map(); function d(t) { return t ? t.charAt(0).toUpperCase() + t.slice(1) : ""; } function l(t) { const e = t.type || "default", n = r.get(e) || /* @__PURE__ */ new Map(); r.set(e, n); const o = t.name + d(t.orientation); n.set(o, { ...t, type: e, key: o }); } function c(t) { return t.flat().forEach((e) => { l(e); }), r; } const p = u({ locale: "", container: r, updateContainer: () => { } }); function m({ icons: t, locale: e, children: n }) { const [o, a] = f(() => c(t)); return /* @__PURE__ */ s( p.Provider, { value: { locale: e, container: o, updateContainer: (i) => { a(c(i)); } }, children: n } ); } export { r as IconTypesRegistry, p as IconsContext, m as IconsProvider, c as loadIcons }; //# sourceMappingURL=IconsContext.js.map