@danxbot/ui 15.12.2 → 15.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -30994,26 +30994,27 @@ function OB({
30994
30994
  size: r,
30995
30995
  remainderLabel: o = "Remaining",
30996
30996
  showValue: s = !0,
30997
- className: i
30997
+ centerValue: i,
30998
+ className: a
30998
30999
  }) {
30999
- const { arcs: a, used: l, overflow: c } = MB(e, t), u = Ul(l, t), p = t - l, f = e.filter((g) => g.value > 0).map((g) => `${g.label} ${Ul(g.value, t)}%`);
31000
- p > 0 && f.push(`${o} ${Ul(p, t)}%`);
31001
- const h = c > 0 ? `${f.join(", ")} — over the total by ${Ul(c, t)}%` : f.join(", "), m = `dx-ring-${_t()}`;
31000
+ const { arcs: l, used: c, overflow: u } = MB(e, t), p = Ul(c, t), f = i ?? p, h = t - c, m = e.filter((x) => x.value > 0).map((x) => `${x.label} ${Ul(x.value, t)}%`);
31001
+ h > 0 && m.push(`${o} ${Ul(h, t)}%`);
31002
+ const g = u > 0 ? `${m.join(", ")} — over the total by ${Ul(u, t)}%` : m.join(", "), b = `dx-ring-${_t()}`;
31002
31003
  return /* @__PURE__ */ T(
31003
31004
  "div",
31004
31005
  {
31005
- className: U(lN({ size: r }), i),
31006
+ className: U(lN({ size: r }), a),
31006
31007
  role: "progressbar",
31007
- "aria-valuenow": Math.min(100, u),
31008
+ "aria-valuenow": Math.max(0, Math.min(100, Math.round(f))),
31008
31009
  "aria-valuemin": 0,
31009
31010
  "aria-valuemax": 100,
31010
31011
  "aria-label": n,
31011
- "aria-describedby": m,
31012
- "data-overflow": c > 0 ? "true" : void 0,
31012
+ "aria-describedby": b,
31013
+ "data-overflow": u > 0 ? "true" : void 0,
31013
31014
  children: [
31014
31015
  /* @__PURE__ */ T("svg", { viewBox: "0 0 24 24", className: "size-full -rotate-90", children: [
31015
31016
  /* @__PURE__ */ d("circle", { cx: "12", cy: "12", r: "10", fill: "none", strokeWidth: "2.5", className: "stroke-surface-inset" }),
31016
- a.map((g, b) => /* @__PURE__ */ d(
31017
+ l.map((x, w) => /* @__PURE__ */ d(
31017
31018
  "circle",
31018
31019
  {
31019
31020
  cx: "12",
@@ -31023,21 +31024,23 @@ function OB({
31023
31024
  strokeWidth: "2.5",
31024
31025
  strokeLinecap: "butt",
31025
31026
  pathLength: "1",
31026
- strokeDasharray: `${g.length} 1`,
31027
- strokeDashoffset: -g.start,
31027
+ strokeDasharray: `${x.length} 1`,
31028
+ strokeDashoffset: -x.start,
31028
31029
  className: U(
31029
31030
  "transition-[var(--tx-colors),stroke-dasharray,stroke-dashoffset] duration-(--dur-slow) ease-emphasis",
31030
- cN[g.tone]
31031
+ cN[x.tone]
31031
31032
  ),
31032
31033
  stroke: "currentColor"
31033
31034
  },
31034
- `${g.label}-${b}`
31035
+ `${x.label}-${w}`
31035
31036
  ))
31036
31037
  ] }),
31037
- s && /* NOT clamped. A ring that is full and a ring that is half as full
31038
- again are the same picture, and this number is the difference. */
31039
- /* @__PURE__ */ d("span", { className: "absolute font-mono text-xs font-semibold tabular-nums text-primary", children: u }),
31040
- /* @__PURE__ */ d("span", { id: m, className: "sr-only", children: h })
31038
+ s && /* NOT clamped (rounded only). A ring that is full and a ring that is
31039
+ half as full again are the same picture, and this number is the
31040
+ difference — true of an over-sum `total`/`segments` pair and
31041
+ equally true of a `centerValue` the caller hands in past 100. */
31042
+ /* @__PURE__ */ d("span", { className: "absolute font-mono text-xs font-semibold tabular-nums text-primary", children: Math.round(f) }),
31043
+ /* @__PURE__ */ d("span", { id: b, className: "sr-only", children: g })
31041
31044
  ]
31042
31045
  }
31043
31046
  );