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.

36 lines (35 loc) 963 B
import { D as s, H as u } from "./factory-WDxu11V0.js"; import "./builder-EH76YCFS.js"; var n = /* @__PURE__ */ new Map(); function v(e, r) { u ? (n.set(e, r), r.prototype._ssrTag = e) : customElements.get(e) || customElements.define(e, r); } function E(e) { return n.get(e); } function o() { return n; } var l = () => typeof document < "u" ? HTMLElement : s, R = l(), g = (e) => { if (e.tagName && e.tagName !== "div") return e.tagName; const r = o(); 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) : ""; }, m = (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 { v as a, c as i, R as n, E as o, m as r, l as t };