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.

27 lines (26 loc) 799 B
import { n as a } from "./chunk-Y2CYZVJY-0JxdZxki.js"; import { m as w } from "./src-DtRLxcYO.js"; import { c as x } from "./chunk-WYO6CB5R-DDHkKowO.js"; var l = /* @__PURE__ */ a((t, e, i, r) => { t.attr("class", i); const { width: o, height: h, x: c, y: s } = m(t, e); x(t, h, o, r); const n = u(c, s, o, h, e); t.attr("viewBox", n), w.debug(`viewBox configured: ${n} with padding: ${e}`); }, "setupViewPortForSVG"), m = /* @__PURE__ */ a((t, e) => { const i = t.node()?.getBBox() || { width: 0, height: 0, x: 0, y: 0 }; return { width: i.width + e * 2, height: i.height + e * 2, x: i.x, y: i.y }; }, "calculateDimensionsWithPadding"), u = /* @__PURE__ */ a((t, e, i, r, o) => `${t - o} ${e - o} ${i} ${r}`, "createViewBox"); export { l as t };