@apliteni/apliteni-ui 0.186.0 → 0.188.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.
@@ -982,6 +982,9 @@ destructive question.
982
982
  body scrolls, and the title, the close control and the footer stay visible. The title is an `h2`.
983
983
  `initialFocusRef` chooses the first focus.
984
984
 
985
+ **On a phone.** At 560px and narrower, with a coarse pointer, each footer button has a 44px tap
986
+ zone. The buttons keep their drawn size.
987
+
985
988
  ### Confirm
986
989
 
987
990
  Use `Confirm` before a destructive action that the page must stop for. Use
@@ -993,7 +996,8 @@ Use `Confirm` before a destructive action that the page must stop for. Use
993
996
  ```
994
997
 
995
998
  It is an `alertdialog`. The safe action gets the focus and stands before the committing action.
996
- `onConfirm` only reports the press. You save, show errors and close.
999
+ `onConfirm` only reports the press. You save, show errors and close. The answers are the modal's
1000
+ footer buttons, so on a phone each one has a 44px tap zone.
997
1001
 
998
1002
  ### Drawer
999
1003
 
@@ -1287,7 +1291,8 @@ Right, Home and End move between columns and announce each one. Enter picks a co
1287
1291
  `selectable` is set. A plot that scrolls adds one more Tab stop for the scroll box. On a touch
1288
1292
  screen, the first tap on a mark opens its readout and does not call `onSelect`. After Escape, a
1289
1293
  new tap on the same mark opens its readout again. Every value is
1290
- reachable at full strength by pointer or keyboard.
1294
+ reachable at full strength by pointer or keyboard. A readout in a scrolling region stays fully
1295
+ visible over the region and opens above its mark when that space is available.
1291
1296
 
1292
1297
  ### Table values
1293
1298
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apliteni/apliteni-ui",
3
- "version": "0.186.0",
3
+ "version": "0.188.0",
4
4
  "workspaces": [
5
5
  "react"
6
6
  ],
@@ -330,6 +330,11 @@
330
330
  height: calc(var(--space-10) + var(--space-1));
331
331
  flex: none;
332
332
  }
333
+ @media (max-width: 560px) and (pointer: coarse) {
334
+ .rx-modal__foot {
335
+ --tap-clear-y: var(--tap-gap);
336
+ }
337
+ }
333
338
 
334
339
  /* src/AccountWindow.css */
335
340
  .rx-modal.rx-account {
@@ -6094,6 +6094,20 @@ function Shares({ look, format, swatch }) {
6094
6094
 
6095
6095
  // src/Chart.tsx
6096
6096
  import { Fragment as Fragment21, jsx as jsx47, jsxs as jsxs43 } from "react/jsx-runtime";
6097
+ function placeChartTip(mark, tip) {
6098
+ const rect = mark.getBoundingClientRect();
6099
+ const view = tip.ownerDocument.documentElement;
6100
+ const gap = parseFloat(getComputedStyle(tip).getPropertyValue("--ui-tip-gap")) || 8;
6101
+ const above = rect.top;
6102
+ const below = view.clientHeight - rect.bottom;
6103
+ const isBelow = above < tip.offsetHeight + gap && below > above;
6104
+ tip.classList.toggle("is-below", isBelow);
6105
+ const ideal = rect.left + rect.width / 2 - tip.offsetWidth / 2;
6106
+ const left = Math.max(0, Math.min(ideal, view.clientWidth - tip.offsetWidth));
6107
+ tip.style.setProperty("--ui-tip-x", `${rect.left + rect.width / 2}px`);
6108
+ tip.style.setProperty("--ui-tip-y", `${isBelow ? rect.bottom : rect.top}px`);
6109
+ tip.style.setProperty("--ui-tip-shift", `${left - ideal}px`);
6110
+ }
6097
6111
  var HEIGHT = { months: 216, bridge: 216, spark: 32, line: 216, area: 216, stacked: 216, donut: 216 };
6098
6112
  var PAD = 2;
6099
6113
  var ZERO_INSET = 1.5;
@@ -6447,6 +6461,7 @@ function Chart(props) {
6447
6461
  const [said, setSaid] = useState21("");
6448
6462
  const [ownPick, setOwnPick] = useState21(null);
6449
6463
  const pick = selected === void 0 ? ownPick : selected;
6464
+ const topLayer = typeof HTMLElement !== "undefined" && typeof HTMLElement.prototype.showPopover === "function";
6450
6465
  const steps = props.variant === "bridge" ? props.steps : void 0;
6451
6466
  const bridgeTones = props.variant === "bridge" ? props.tones : void 0;
6452
6467
  const periods = props.variant === "bridge" || props.variant === "donut" ? void 0 : props.periods;
@@ -6614,10 +6629,20 @@ function Chart(props) {
6614
6629
  if (opensAtEnd && el) el.scrollLeft = el.scrollWidth - el.clientWidth;
6615
6630
  }, [opensAtEnd, plotWidth, boxWidth, count]);
6616
6631
  useLayoutEffect5(() => {
6617
- if (!openId || !frameEl.current || !tipEl.current || !svgEl.current) return;
6632
+ const tip = tipEl.current;
6633
+ if (!tip) return;
6634
+ const layered = topLayer;
6635
+ if (!openId) {
6636
+ if (layered && tip.matches(":popover-open")) tip.hidePopover();
6637
+ return;
6638
+ }
6639
+ if (!frameEl.current || !svgEl.current) return;
6618
6640
  const anchor2 = [...svgEl.current.querySelectorAll("[data-anchor]")].find((el) => el.getAttribute("data-anchor") === openId);
6619
- if (anchor2) placeTip(frameEl.current, anchor2, tipEl.current);
6620
- }, [openId, plotWidth, plotHeight]);
6641
+ if (!anchor2) return;
6642
+ if (layered && !tip.matches(":popover-open")) tip.showPopover();
6643
+ if (layered) placeChartTip(anchor2, tip);
6644
+ else placeTip(frameEl.current, anchor2, tip);
6645
+ }, [openId, plotWidth, plotHeight, topLayer]);
6621
6646
  useEffect21(() => {
6622
6647
  if (!openId) return;
6623
6648
  const doc = frameEl.current?.ownerDocument;
@@ -6630,9 +6655,11 @@ function Chart(props) {
6630
6655
  hide();
6631
6656
  };
6632
6657
  doc.addEventListener("keydown", escape);
6658
+ doc.addEventListener("scroll", hide, true);
6633
6659
  view2.addEventListener("resize", hide);
6634
6660
  return () => {
6635
6661
  doc.removeEventListener("keydown", escape);
6662
+ doc.removeEventListener("scroll", hide, true);
6636
6663
  view2.removeEventListener("resize", hide);
6637
6664
  };
6638
6665
  }, [openId]);
@@ -7050,7 +7077,7 @@ function Chart(props) {
7050
7077
  ] })
7051
7078
  }
7052
7079
  ),
7053
- /* @__PURE__ */ jsx47("span", { ref: tipEl, className: cx9("ui-tip", openId && "is-open"), role: open ? "tooltip" : void 0, children: open && /* @__PURE__ */ jsxs43(Fragment21, { children: [
7080
+ /* @__PURE__ */ jsx47("span", { ref: tipEl, ...topLayer && { popover: "manual" }, className: cx9("ui-tip", openId && "is-open"), role: open ? "tooltip" : void 0, children: open && /* @__PURE__ */ jsxs43(Fragment21, { children: [
7054
7081
  /* @__PURE__ */ jsx47("span", { className: "ui-tip__label", children: spark || look ? columns[open.column]?.label : `${open.name}, ${columns[open.column]?.label}` }),
7055
7082
  open.rows ? /* @__PURE__ */ jsxs43(Fragment21, { children: [
7056
7083
  open.rows.map((row) => /* @__PURE__ */ jsxs43("span", { className: "ui-tip__value ui-chart__row", children: [