UNPKG

ranui

Version:

A framework-agnostic Web Components UI library built on native custom elements, with TypeScript types, light/dark theming, SSR and PWA support.

35 lines (34 loc) 929 B
import { c as u, n as s } from "./mocks-CMGoftIc.js"; var n = /* @__PURE__ */ new Map(); function d(e, r) { u ? (n.set(e, r), r.prototype._ssrTag = e) : customElements.get(e) || customElements.define(e, r); } function v(e) { return n.get(e); } function l() { return n; } var o = () => typeof document < "u" ? HTMLElement : s, E = o(), g = (e) => { if (e.tagName && e.tagName !== "div") return e.tagName; const r = l(); for (const [a, t] of r) if (e instanceof t) return a; return e.constructor.name.toLowerCase(); }, c = (e) => { if (!e) return ""; const r = g(e); return typeof e.serialize == "function" || e instanceof s ? e.serialize(r) : ""; }, R = (e, r = {}, ...a) => { const t = new s(e); return Object.entries(r).forEach(([i, f]) => t.setAttribute(i, f)), a.forEach((i) => { i && t.appendChild(i); }), t.serialize(); }; export { d as a, c as i, E as n, v as o, R as r, o as t };