@zoreal/oauth2-react 0.2.23 → 0.2.24

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.cjs CHANGED
@@ -42,7 +42,7 @@ var import_react2 = require("react");
42
42
 
43
43
  // src/wire.ts
44
44
  var WIRE_VERSION = 1;
45
- var SDK_VERSION = "0.2.23";
45
+ var SDK_VERSION = "0.2.24";
46
46
  var DEFAULT_ISSUER = "https://id.zoreal.com";
47
47
  var POLL_INTERVAL_MS = 2e3;
48
48
  var POLL_INTERVAL_ENROLLING_MS = 5e3;
@@ -1652,9 +1652,16 @@ var SVG_NS = "http://www.w3.org/2000/svg";
1652
1652
  var TAIL = 0.3;
1653
1653
  var STACK = Array.from({ length: 12 }, (_, i) => 12 - i);
1654
1654
  var HALO = [3, 2, 1];
1655
- function radiusOf(control) {
1656
- const value = parseFloat(getComputedStyle(control).borderTopLeftRadius);
1657
- return Number.isFinite(value) ? value : 8;
1655
+ function cornerOf(radius, width, height) {
1656
+ const raw = radius.trim();
1657
+ const value = parseFloat(raw);
1658
+ const offset = 2;
1659
+ if (raw.endsWith("%") && Number.isFinite(value)) {
1660
+ return [width * value / 100 + offset, height * value / 100 + offset];
1661
+ }
1662
+ const px = Number.isFinite(value) ? value : /infinity/i.test(raw) ? Infinity : 8;
1663
+ const r = Math.min(px, width / 2, height / 2) + offset;
1664
+ return [r, r];
1658
1665
  }
1659
1666
  function holdBusy(control) {
1660
1667
  if (typeof document === "undefined") return () => {
@@ -1675,12 +1682,11 @@ function holdBusy(control) {
1675
1682
  overlay.setAttribute("aria-hidden", "true");
1676
1683
  const svg = document.createElementNS(SVG_NS, "svg");
1677
1684
  svg.setAttribute("class", cx("ring-svg"));
1678
- const rx = radiusOf(control) + 2;
1685
+ const rects = [];
1679
1686
  const layer = (name, len, alpha) => {
1680
1687
  const rect = document.createElementNS(SVG_NS, "rect");
1681
1688
  rect.setAttribute("class", cx(name));
1682
- rect.setAttribute("rx", String(rx));
1683
- rect.setAttribute("ry", String(rx));
1689
+ rects.push(rect);
1684
1690
  rect.style.strokeDasharray = `calc(var(--zrl-l) * ${len}) calc(var(--zrl-l) * ${1 - len})`;
1685
1691
  rect.style.setProperty("--zrl-s", `calc(var(--zrl-l) * ${-(TAIL - len)})`);
1686
1692
  rect.style.opacity = alpha;
@@ -1703,6 +1709,11 @@ function holdBusy(control) {
1703
1709
  overlay.style.top = `${box.top}px`;
1704
1710
  overlay.style.width = `${box.width}px`;
1705
1711
  overlay.style.height = `${box.height}px`;
1712
+ const [rx, ry] = cornerOf(getComputedStyle(control).borderTopLeftRadius, box.width, box.height);
1713
+ for (const rect of rects) {
1714
+ rect.setAttribute("rx", String(rx));
1715
+ rect.setAttribute("ry", String(ry));
1716
+ }
1706
1717
  const length = typeof measured?.getTotalLength === "function" ? measured.getTotalLength() : 0;
1707
1718
  if (length > 0) overlay.style.setProperty("--zrl-ring-len", `${length}px`);
1708
1719
  };