@apliteni/apliteni-ui 0.161.0 → 0.162.1

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.
@@ -597,7 +597,8 @@ leave it to the window.
597
597
 
598
598
  `tooltip()` is the readout that a surface shows while a pointer rests on one of its marks. It is an
599
599
  overlay. That is the guarantee: **showing, filling or moving a readout never changes the size or
600
- the place of anything else on the page.** There is one element per host. It is placed absolutely
600
+ the place of anything else on the page.** A closed readout has no box, so it cannot widen a
601
+ scroll region that holds it. There is one element per host. It is placed absolutely
601
602
  and takes no pointer events. `.ui-tip-host` marks the box it is placed against. The readout flips
602
603
  or slides only as far as needed to stay inside the viewport and every ancestor whose overflow
603
604
  clips. **What it says is text**, written with `textContent` and never parsed. Focus on a mark shows
@@ -612,7 +613,17 @@ what the bar says. No value may be reachable only by hovering. See
612
613
  React `Tooltip` shows a label, a value and an optional detail.
613
614
  `text` is still a shorthand for `label`. Empty parts are hidden.
614
615
  The focusable trigger provides the readout as its accessible description. Escape keeps focus on the trigger.
615
- The panel does not change the layout or intercept pointer events. Reduced motion removes the fade.
616
+ The panel does not change the layout or intercept pointer events.
617
+
618
+ **A pointer opens the readout after it rests for 300ms, and the readout closes at once when the
619
+ pointer leaves.** A pointer that leaves within 300ms opens nothing. **Within 300ms after a readout
620
+ closes, the next one opens at once**, so a pointer that moves along a row of icon buttons reads
621
+ each word without a new wait. **Keyboard focus opens the readout at once.** A mouse press that
622
+ focuses the trigger waits for the hover.
623
+
624
+ `control` is for a child that is one control and names itself, such as an icon button with an
625
+ `aria-label`. The readout shows its word on hover and focus. It adds no tab stop and no
626
+ description, and it is hidden from assistive technology, because the control's name already says it.
616
627
 
617
628
  `placement` selects the preferred top or bottom side. The readout stays within clipping ancestors
618
629
  and viewport bounds, and updates its position on scroll and resize.
@@ -665,21 +676,34 @@ larger.
665
676
  ### Dense financial tables
666
677
 
667
678
  The table is markup. A named scroll region contains a native `<table>`, and you apply the
668
- recipes as classes. Zebra adds no grey stripes. Hover gives a row a quiet neutral fill across the table width. Without zebra, the fill has round ends, and the first and last content sit 8px inside it. No row line crosses those ends.
669
- Keyboard focus keeps its ring, and a landed row keeps its own mark. `compact` sets a 33px minimum row, but larger or wrapped content makes the row
679
+ recipes as classes. Zebra adds no grey stripes. Hover gives a row a quiet neutral fill across the table width. On a dense hover table, the fill has round ends, and the first and last content sit 8px inside it. No row line crosses those ends.
680
+ Keyboard focus keeps its ring, and a landed row keeps its own mark. On a zebra or dense table, `compact` sets a 33px minimum row, but larger or wrapped content makes the row
670
681
  taller. **Columns scroll rather than disappear**, while sticky headers and pinned identity cells
671
682
  keep opaque backgrounds, the shared focus composition, and their full accessible names. **A
672
683
  pinned column draws its divider only where the region can actually scroll:** at a width where
673
- every column fits, the line divides nothing, so it is not drawn. **The region shows a soft shade
674
- on whichever edge still has columns behind it, and none on an edge that has been reached** —
675
- darker on a light ground, lighter on a dark one. Both are CSS alone, so vanilla and React tables
676
- carry them alike, and neither reaches the focus ring. An engine that cannot report a scroll state
677
- keeps the divider at every width. **A link
684
+ every column fits, the line divides nothing, so it is not drawn. **The region draws no shade at
685
+ its edges.** The divider is CSS alone, so vanilla and React tables carry it alike, and it does not
686
+ reach the focus ring. An engine that cannot report a scroll state keeps the divider at every
687
+ width. **A link
678
688
  inside a cell uses the row's ink, gets an underline on hover, and uses the shared ring on
679
689
  `:focus-visible`**. The ring surrounds the whole link, including a title-cell link that wraps.
680
690
  `numericValue` distinguishes missing from zero. `deltaValue` prints your sign and uses your
681
691
  explicit judgement. **Colour never supplies the sign.**
682
692
 
693
+ **A hover table that is neither zebra nor dense is a row table.** Its body rows have no lines
694
+ and no column lines, and the head keeps its rule. **A row is 48px tall, 36px with `compact` and
695
+ 56px with `comfortable`**, and larger or wrapped content makes it taller. Hover gives the row a
696
+ neutral fill, and a checked selection box gives it an accent wash. Both fills are square, and the
697
+ first and last content sit 12px inside them. The name
698
+ in the first column takes the strongest ink. **`.ui-table__sub` puts a second value under the
699
+ first**, such as an email under a name, in full ink at a smaller size. An act cell that holds icon
700
+ buttons is as wide as its buttons, and they are 32px, so the row keeps its height. In a card, the
701
+ table reaches the card's edges and its end cells keep the card's text edge. A scroll frame in a
702
+ card keeps a 4px band at each side and above the header for its focus ring, so a row fill stops
703
+ 4px inside the card's edges. The header gives that top band back, so the table keeps its place, and
704
+ the header follows the ring's rounded corners. The band shows no line at rest, and the frame adds no
705
+ room below the table.
706
+
683
707
  A cell can group its reference and status with `.ui-table__pair`. They stack when the cell cannot fit them side by side.
684
708
  A landed row's `.is-target` mark shows on pointer arrival as well as keyboard focus, and it outlives focus, so arrival and focus show together and stay distinguishable.
685
709
  The caller brings the target row into view and keeps its mark until the next arrival.
@@ -705,9 +729,10 @@ its right side.
705
729
 
706
730
  **On a phone, a table stays a table.** No kit table lays its rows out as blocks. A table wider
707
731
  than the screen scrolls sideways inside its frame, and the page does not scroll. A pinned identity
708
- column stays at the frame's left edge on the table's own surface, so it follows the theme. While
709
- columns sit under it, a soft shade from the edge token falls to its right. At the left edge there
710
- is no shade. This is a rule in [Dense tables](../guidelines/dense-tables.md).
732
+ column stays at the frame's left edge on the table's own surface, so it follows the theme.
733
+ **Below 560px the frame shows no scrollbar**, because a finger scrolls it. **A screen-reader label
734
+ in the table stays inside the frame**, so it cannot widen the page. This is a rule in
735
+ [Dense tables](../guidelines/dense-tables.md).
711
736
 
712
737
  `FilterBar` is controlled by you. Selections, removal, and clear-all request changes. They never
713
738
  change the filters you supplied. Given `add` and `onAdd` it also draws the way to add one; see
@@ -940,7 +965,8 @@ vanilla sections above.
940
965
  Tables fill their container by default. Inside `.ui-card--fit`, tables size to their content.
941
966
  A `.ui-table__title` cell gives a text column the remaining width. A column takes `cell` for it:
942
967
  `title`, `code`, `long`, `strong` or `act`. `rowHeader` renders the column's body cells as `th scope="row"`.
943
- `DataTable` takes the vanilla hooks as props: `zebra`, `hover` (on unless `false`), `density`,
968
+ `DataTable` takes the vanilla hooks as props: `zebra`, `hover` (on unless `false`), `density`
969
+ (`dense`, `compact` or `comfortable`),
944
970
  `stickyHeader` and `pinnedIdentity`. `rowState` marks a row `target` or `dead`, `footer` takes totals rows
945
971
  and `caption` names the table for assistive technology. A `dead` row is muted and shows its state as a word,
946
972
  with no strike line. `stack` is deprecated and ignored: a phone table scrolls sideways like any other. A table that does not scroll is the card's own child, so a dense table reaches the card's text edge.
@@ -1340,7 +1366,8 @@ The button and tick follow `value` until the caller updates it. `AccountMenu` ma
1340
1366
  and follows the OS otherwise. It sets `data-theme-choice` and the resolved `data-theme` on
1341
1367
  `html` and exports `THEME_INIT_SCRIPT` for a head script.
1342
1368
  - **`Tooltip`** renders the vanilla host, panel and label classes. Escape keeps focus on the
1343
- trigger.
1369
+ trigger. A hover opens it after 300ms and keyboard focus at once; see
1370
+ [The React tooltip](#the-react-tooltip).
1344
1371
  - **`Pill`** and **`StatusDot`** add no interactive role and create no live region. Visible
1345
1372
  status text belongs beside the dot.
1346
1373
  - **`SuccessPanel`** is the inline confirmation. **`SuccessCheck`** is the bare shared mark.
@@ -1356,8 +1383,8 @@ This is stated so nobody has to discover it by trying:
1356
1383
 
1357
1384
  - **No build step**, whose consequence is
1358
1385
  [breakpoints as literals](foundations.md#breakpoints).
1359
- - **No density system.** `.ui-table--dense`, `.ui-table--compact` and `.ui-cmdk--roomy` are the
1360
- only density modifiers, and each is local to its component.
1386
+ - **No density system.** `.ui-table--dense`, `.ui-table--compact`, `.ui-table--comfortable` and
1387
+ `.ui-cmdk--roomy` are the only density modifiers, and each is local to its component.
1361
1388
  - **No container scale.** There is one `--container`, not a narrow/wide set.
1362
1389
  - **No second bar for a control's glyph.** 1.5 CSS px is the line for every stroked mark.
1363
1390
  - **No charts.** A stat band's trend is a slot for your `<svg>`.
@@ -112,16 +112,16 @@
112
112
 
113
113
  **Don't:** Replace the table with a blank state or move focus without telling the reader why.
114
114
 
115
- ## Give every table its filter bar
115
+ ## Give a long table its filter bar
116
116
 
117
117
  <!-- rule: filter-bar -->
118
118
 
119
- **Why:** Readers narrow rows before reading them, and look for the bar where other tables put it.
119
+ **Why:** Readers narrow a long table before they read it, and look for the bar where other tables put it.
120
120
 
121
- **Rule:** Put a bar with a search field and column filters directly above every table.
121
+ **Rule:** Put a bar with a search field and column filters directly above a table that can hold more than 10 rows.
122
122
 
123
123
  **Do:** Search, then a status filter, on the row above the table.
124
124
 
125
125
  **Don't:** Leave rows that the reader cannot narrow.
126
126
 
127
- **Except:** Two tables take no bar: one that compares a document line by line, where a filter hides lines the reviewer must check, and a chart's Table view, which holds only the chart's points.
127
+ **Except:** Three tables take no bar. One compares a document line by line, where a filter hides lines the reviewer must check. One is a chart's Table view, which holds only the chart's points. One never holds more than 10 rows, such as a list of API tokens, because the reader sees every row at once.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apliteni/apliteni-ui",
3
- "version": "0.161.0",
3
+ "version": "0.162.1",
4
4
  "workspaces": [
5
5
  "react"
6
6
  ],
@@ -201,6 +201,14 @@
201
201
  opacity: 1;
202
202
  visibility: visible;
203
203
  }
204
+ .ui-tip:not(.is-open) {
205
+ display: none;
206
+ }
207
+ @starting-style {
208
+ .ui-tip.is-open {
209
+ opacity: 0;
210
+ }
211
+ }
204
212
  .ui-tip__label {
205
213
  color: var(--text);
206
214
  }
@@ -374,7 +374,7 @@ type DataTableProps<T> = {
374
374
  /** A caption read by assistive technology only. */
375
375
  caption?: string;
376
376
  dense?: boolean;
377
- density?: 'default' | 'dense' | 'compact';
377
+ density?: 'default' | 'dense' | 'compact' | 'comfortable';
378
378
  stickyHeader?: boolean;
379
379
  pinnedIdentity?: boolean;
380
380
  scrollLabel?: string;
@@ -1066,10 +1066,12 @@ type TooltipProps = {
1066
1066
  value?: string;
1067
1067
  detail?: string;
1068
1068
  placement?: 'top' | 'bottom';
1069
+ /** The child is one control that names itself, such as an icon button: the readout repeats its name, so it adds no tab stop and no description. */
1070
+ control?: boolean;
1069
1071
  /** Inline content without nested controls. */
1070
1072
  children: ReactNode;
1071
1073
  };
1072
- declare function Tooltip({ text, label, value, detail, placement, children }: TooltipProps): react.JSX.Element;
1074
+ declare function Tooltip({ text, label, value, detail, placement, control, children }: TooltipProps): react.JSX.Element;
1073
1075
 
1074
1076
  type SuccessMark = 'line' | 'circled';
1075
1077
  type SuccessCheckProps = Omit<SVGAttributes<SVGSVGElement>, 'children'> & {
@@ -514,6 +514,15 @@ function placeTip(host, mark, tip, bound, placement = "top") {
514
514
  tip.style.setProperty("--ui-tip-shift", `${left - ideal}px`);
515
515
  }
516
516
 
517
+ // src/tooltipDelay.ts
518
+ var OPEN_DELAY = 300;
519
+ var SKIP_WINDOW = 300;
520
+ var lastClose = -Infinity;
521
+ var hoverWait = () => Date.now() - lastClose < SKIP_WINDOW ? 0 : OPEN_DELAY;
522
+ function noteClose() {
523
+ lastClose = Date.now();
524
+ }
525
+
517
526
  // src/Tooltip.tsx
518
527
  import { useEffect as useEffect2, useId as useId3, useLayoutEffect as useLayoutEffect2, useRef as useRef2, useState as useState3 } from "react";
519
528
  import { Fragment as Fragment3, jsx as jsx11, jsxs as jsxs7 } from "react/jsx-runtime";
@@ -548,7 +557,7 @@ var Text2 = ({ label = "", value = "", detail: detail2 = "" }) => /* @__PURE__ *
548
557
  /* @__PURE__ */ jsx11("span", { className: "ui-tip__value", hidden: !value, children: value }),
549
558
  /* @__PURE__ */ jsx11("span", { className: "ui-tip__detail", hidden: !detail2, children: detail2 })
550
559
  ] });
551
- function Tooltip({ text: text2, label = text2, value, detail: detail2, placement = "top", children }) {
560
+ function Tooltip({ text: text2, label = text2, value, detail: detail2, placement = "top", control = false, children }) {
552
561
  const id = useId3();
553
562
  const host = useRef2(null);
554
563
  const trigger = useRef2(null);
@@ -560,12 +569,35 @@ function Tooltip({ text: text2, label = text2, value, detail: detail2, placement
560
569
  const dismissed = useRef2(null);
561
570
  const [mark, setMark] = useState3(null);
562
571
  const active = useRef2(null);
572
+ const timer = useRef2(void 0);
563
573
  active.current = mark;
564
574
  const open = mark !== null;
575
+ function cancel() {
576
+ clearTimeout(timer.current);
577
+ timer.current = void 0;
578
+ }
565
579
  function close(reset = false) {
580
+ cancel();
581
+ if (active.current) noteClose();
566
582
  dismissed.current = reset ? null : active.current;
567
583
  setMark(null);
568
584
  }
585
+ function hover(target) {
586
+ if (!target) {
587
+ close(true);
588
+ return;
589
+ }
590
+ if (target === active.current || timer.current) return;
591
+ const wait = hoverWait();
592
+ if (!wait) {
593
+ show(target);
594
+ return;
595
+ }
596
+ timer.current = setTimeout(() => {
597
+ timer.current = void 0;
598
+ show(target);
599
+ }, wait);
600
+ }
569
601
  function show(target) {
570
602
  if (target && target !== dismissed.current) {
571
603
  dismissed.current = null;
@@ -613,6 +645,7 @@ function Tooltip({ text: text2, label = text2, value, detail: detail2, placement
613
645
  if ((pointerKind.current === "touch" || pointerKind.current === "pen") && !host.current?.contains(event.target)) close(true);
614
646
  };
615
647
  useEffect2(() => wireDocument(host.current.ownerDocument, shared.current), []);
648
+ useEffect2(() => cancel, []);
616
649
  useEffect2(() => {
617
650
  if (!open) return;
618
651
  const view = host.current.ownerDocument.defaultView;
@@ -632,15 +665,13 @@ function Tooltip({ text: text2, label = text2, value, detail: detail2, placement
632
665
  style: { display: "inline-block" },
633
666
  onMouseOver: (event) => {
634
667
  if (Date.now() <= ignoreMouseUntil.current) return;
635
- const target = markOf(event.target);
636
- if (target) show(target);
637
- else setMark(null);
668
+ hover(markOf(event.target));
638
669
  },
639
670
  onMouseLeave: () => {
640
671
  if (Date.now() > ignoreMouseUntil.current) close(true);
641
672
  },
642
673
  onFocus: (event) => {
643
- if (Date.now() > ignoreMouseUntil.current) show(markOf(event.target));
674
+ if (Date.now() > ignoreMouseUntil.current && pointerKind.current !== "mouse") show(markOf(event.target));
644
675
  },
645
676
  onBlur: (event) => {
646
677
  if (!markOf(event.relatedTarget)) close(true);
@@ -649,7 +680,7 @@ function Tooltip({ text: text2, label = text2, value, detail: detail2, placement
649
680
  if (event.pointerType === "touch" || event.pointerType === "pen") ignoreMouseUntil.current = Date.now() + 800;
650
681
  else if (event.pointerType === "mouse") {
651
682
  ignoreMouseUntil.current = 0;
652
- show(markOf(event.target));
683
+ hover(markOf(event.target));
653
684
  }
654
685
  },
655
686
  onClickCapture: (event) => {
@@ -662,6 +693,11 @@ function Tooltip({ text: text2, label = text2, value, detail: detail2, placement
662
693
  if (!touched) close();
663
694
  return;
664
695
  }
696
+ if (control) {
697
+ dismissed.current = null;
698
+ show(target);
699
+ return;
700
+ }
665
701
  event.preventDefault();
666
702
  event.stopPropagation();
667
703
  const doc = host.current.ownerDocument;
@@ -696,8 +732,8 @@ function Tooltip({ text: text2, label = text2, value, detail: detail2, placement
696
732
  }
697
733
  },
698
734
  children: [
699
- /* @__PURE__ */ jsx11("span", { ref: trigger, className: "ui-focusable", tabIndex: 0, "aria-describedby": id, children }),
700
- /* @__PURE__ */ jsx11("span", { ref: tip, id, "data-tip": "", role: "tooltip", className: `ui-tip${open ? " is-open" : ""}`, children: /* @__PURE__ */ jsx11(Text2, { label, value, detail: detail2 }) })
735
+ control ? /* @__PURE__ */ jsx11("span", { ref: trigger, children }) : /* @__PURE__ */ jsx11("span", { ref: trigger, className: "ui-focusable", tabIndex: 0, "aria-describedby": id, children }),
736
+ /* @__PURE__ */ jsx11("span", { ref: tip, id, "data-tip": "", role: "tooltip", "aria-hidden": control || void 0, className: `ui-tip${open ? " is-open" : ""}`, children: /* @__PURE__ */ jsx11(Text2, { label, value, detail: detail2 }) })
701
737
  ]
702
738
  }
703
739
  );
@@ -2236,7 +2272,7 @@ function DataTable({
2236
2272
  "table",
2237
2273
  {
2238
2274
  ref: table,
2239
- className: ["ui-table", hover && "ui-table--hover", zebra && "ui-table--zebra", (density === "dense" || !density && dense) && "ui-table--dense", density === "compact" && "ui-table--compact", stickyHeader && "ui-table--sticky", pinnedIdentity && "ui-table--pinned"].filter(Boolean).join(" "),
2275
+ className: ["ui-table", hover && "ui-table--hover", zebra && "ui-table--zebra", (density === "dense" || !density && dense) && "ui-table--dense", density === "compact" && "ui-table--compact", density === "comfortable" && "ui-table--comfortable", stickyHeader && "ui-table--sticky", pinnedIdentity && "ui-table--pinned"].filter(Boolean).join(" "),
2240
2276
  "aria-busy": loading || void 0,
2241
2277
  children: [
2242
2278
  caption ? /* @__PURE__ */ jsx23("caption", { className: "ui-sr", children: caption }) : null,
@@ -337,37 +337,24 @@
337
337
  /* A hover table holds --space-2 inside the fill at each end, and dense and compact too. why: #773 */
338
338
  :where(.ui-table--hover:not(.ui-table--zebra)):is(.ui-table--dense, .ui-table--compact) :is(th, td):first-child { padding-left: var(--space-2); }
339
339
  :where(.ui-table--hover:not(.ui-table--zebra)):is(.ui-table--dense, .ui-table--compact) :is(th, td):last-child { padding-right: var(--space-2); }
340
- /* Columns past the box's edge, said in paint. Two shades, one per side, under two
341
- cover layers that ride the content: `local` moves a cover with the scroll, so
342
- reaching an end slides that cover over its shade. A cover is solid for its first
343
- half, so at 24px it hides a 12px shade outright — which is why the two sizes are
344
- not one. why: guidelines/dense-tables.md */
340
+ /* A wide table scrolls sideways in its frame. The frame paints no shade at its edges. #770 */
345
341
  .ui-table-scroll {
346
342
  overflow: auto; max-height: var(--ui-table-height, 70vh);
347
343
  /* A transparent border, not padding: positioned cells cover an outline on the scrollport's
348
344
  padding. The side and bottom bands draw in the border at the visible edge at every scroll
349
345
  position. why: docs/foundations.md#the-focus-ring */
350
- border: 0 solid transparent; border-inline-width: var(--space-1); border-bottom-width: var(--space-1); background-origin: border-box;
346
+ border: 0 solid transparent; border-inline-width: var(--space-1); border-bottom-width: var(--space-1);
351
347
  background-color: var(--table-bg);
352
- background-image:
353
- linear-gradient(to right, var(--table-bg) 50%, transparent),
354
- linear-gradient(to left, var(--table-bg) 50%, transparent),
355
- radial-gradient(farthest-side at 0 50%, var(--table-edge), transparent),
356
- radial-gradient(farthest-side at 100% 50%, var(--table-edge), transparent);
357
- background-position: 0 0, 100% 0, 0 0, 100% 0;
358
- background-size: var(--space-6) 100%, var(--space-6) 100%, var(--space-3) 100%, var(--space-3) 100%;
359
- background-repeat: no-repeat;
360
- background-attachment: local, local, scroll, scroll;
361
- }
362
- /* The edge darkens on a light ground and lightens on a dark one: ink has nowhere to
363
- go on a near-black page, which is why --elev-drop splits its spend and a raised
364
- dark surface takes a light --elev-edge. */
365
- .ui-table-scroll { --table-edge: color-mix(in srgb, var(--sheen) 12%, transparent); }
366
- :root[data-theme="light"] .ui-table-scroll { --table-edge: color-mix(in srgb, var(--shadow-ink) 13%, transparent); }
367
- /* The surface belongs to the box that scrolls, so the shades land under the cells
368
- rather than behind them; the row fills repeat that same surface and step aside.
369
- The sticky header and pinned column keep their paint: they hide what scrolls
370
- beneath them. A target row keeps its wash. */
348
+ /* The containing block of an absolute child, such as a screen-reader label, so the
349
+ frame clips it and it cannot widen the page. #770 */
350
+ position: relative;
351
+ /* A grid track with a zero floor, so a wide table cannot widen the frame's card. */
352
+ display: grid;
353
+ grid-template-columns: minmax(0, 1fr);
354
+ }
355
+ /* The surface belongs to the box that scrolls, and the row fills repeat that same surface.
356
+ The sticky header and pinned column keep their paint: they hide what scrolls beneath
357
+ them. A target row keeps its wash. */
371
358
  .ui-table-scroll > .ui-table,
372
359
  .ui-table-scroll > .ui-table tbody :where(tr:not(.is-target)) > td:not(.ui-table__identity, .ui-table__selection) { background-color: transparent; }
373
360
  .ui-table-scroll > .ui-table--hover tbody tr:hover:not(.is-target) > :is(td, th) {
@@ -398,45 +385,6 @@
398
385
  rule. The resting rule keeps it, so an engine that cannot answer the query is unchanged;
399
386
  scroll-state makes a query container, not a size one. why: guidelines/dense-tables.md */
400
387
  .ui-table-scroll { container-type: scroll-state; }
401
- /* A shared grid cell puts the edge shade over the opaque sticky header, on both
402
- sides: the radial-gradient shades below answer only the table's own background
403
- and fall to nothing where the sticky header paints over them, so an engine that
404
- can ask whether the scrollport still has room sticks a shade of its own above
405
- it instead and the base radial pair is sized to 0 here. #434 review round 2 */
406
- @supports (container-type: scroll-state) {
407
- .ui-table-scroll {
408
- display: grid;
409
- grid-template-columns: minmax(0, 1fr);
410
- background-size: var(--space-6) 100%, var(--space-6) 100%, 0 100%, 0 100%;
411
- }
412
- .ui-table-scroll > .ui-table { grid-area: 1 / 1; }
413
- .ui-table-scroll::before,
414
- .ui-table-scroll::after {
415
- content: '';
416
- grid-area: 1 / 1;
417
- position: sticky;
418
- top: 0;
419
- width: var(--space-3);
420
- z-index: calc(var(--z-sticky) + 2);
421
- pointer-events: none;
422
- }
423
- .ui-table-scroll::before { left: 0; right: calc(100% - var(--space-3)); justify-self: start; }
424
- .ui-table-scroll::after { left: calc(100% - var(--space-3)); right: 0; justify-self: end; }
425
- @container scroll-state(scrollable: left) {
426
- .ui-table-scroll::before { background: linear-gradient(to right, var(--table-edge), transparent); }
427
- /* A pinned column stays, so the shade falls on its right side, over the columns that
428
- scroll under it. The spread carries the shadow past each row's ends, and the clip cuts
429
- it there and on the left, so the rows join as one even band. why: #736 */
430
- .ui-table-scroll:has(> .ui-table--pinned)::before { background: none; }
431
- .ui-table--pinned .ui-table__identity {
432
- box-shadow: calc(-1 * var(--space-2)) 0 var(--space-3) var(--space-3) var(--table-edge);
433
- clip-path: inset(0 calc(-1 * var(--space-6)) 0 0);
434
- }
435
- }
436
- @container scroll-state(scrollable: right) {
437
- .ui-table-scroll::after { background: linear-gradient(to left, var(--table-edge), transparent); }
438
- }
439
- }
440
388
  @container not scroll-state(scrollable: x) {
441
389
  .ui-table--pinned :is(.ui-table__identity, .ui-table__selection) { border-right-color: transparent; }
442
390
  }
@@ -544,3 +492,106 @@ a.ui-identity:hover { text-decoration: underline; }
544
492
  --dense, --compact and __title. The floor keeps a note a readable paragraph when the table
545
493
  is wider than its frame, so the frame scrolls instead of the note collapsing to one word. */
546
494
  .ui-table td.ui-table__long { white-space: normal; min-width: var(--panel-sm); }
495
+
496
+
497
+ /* ============================================================================
498
+ * The row table: a hover table that is neither dense nor zebra. #770
499
+ * Body rows have no lines, and the head keeps its rule. A row's fill is square. Rows
500
+ * are 48px, `--compact` 36px and `--comfortable` 56px. In a card, the table meets the
501
+ * card's edges and its end cells keep the card's text edge.
502
+ * ========================================================================== */
503
+ .ui-table.ui-table--hover:not(.ui-table--zebra):not(.ui-table--dense) {
504
+ --cell-gap: var(--space-4);
505
+ --cell-edge: var(--space-3);
506
+ padding: 0;
507
+ }
508
+ .ui-table.ui-table--hover:not(.ui-table--zebra):not(.ui-table--dense) :is(th, td) {
509
+ line-height: var(--leading-snug);
510
+ padding-inline: 0 var(--cell-gap);
511
+ }
512
+ /* A pinned selection cell keeps its fixed, centred track. */
513
+ .ui-table.ui-table--hover:not(.ui-table--zebra):not(.ui-table--dense) :is(th, td):first-child:not(:where(.ui-table--pinned) .ui-table__selection) { padding-left: var(--cell-edge); }
514
+ .ui-table.ui-table--hover:not(.ui-table--zebra):not(.ui-table--dense) :is(th, td):last-child { padding-right: var(--cell-edge); }
515
+ /* 16px, so the box's 44px phone tap layer stops at the cell's edge and leaves the next cell's control whole. */
516
+ .ui-table.ui-table--hover:not(.ui-table--zebra):not(.ui-table--dense):not(.ui-table--pinned) .ui-table__selection { padding-right: var(--space-4); }
517
+ .ui-table.ui-table--hover:not(.ui-table--zebra):not(.ui-table--dense) thead th { padding-block: var(--space-3); }
518
+ .ui-table.ui-table--hover:not(.ui-table--zebra):not(.ui-table--dense) tbody > tr > :is(td, th) { border-bottom: 0; }
519
+ .ui-table.ui-table--hover:not(.ui-table--zebra):not(.ui-table--dense) :is(tbody, tfoot) :is(td, th):not(.ui-table__act) {
520
+ height: var(--space-12);
521
+ padding-block: var(--space-2);
522
+ }
523
+ .ui-table.ui-table--hover:not(.ui-table--zebra):not(.ui-table--dense).ui-table--compact { --cell-gap: var(--space-3); }
524
+ .ui-table.ui-table--hover:not(.ui-table--zebra):not(.ui-table--dense).ui-table--compact thead th { padding-block: var(--space-2); }
525
+ .ui-table.ui-table--hover:not(.ui-table--zebra):not(.ui-table--dense).ui-table--compact :is(tbody, tfoot) :is(td, th):not(.ui-table__act) { height: calc(var(--space-8) + var(--space-1)); }
526
+ .ui-table.ui-table--hover:not(.ui-table--zebra):not(.ui-table--dense).ui-table--comfortable { --cell-gap: var(--space-5); }
527
+ .ui-table.ui-table--hover:not(.ui-table--zebra):not(.ui-table--dense).ui-table--comfortable :is(tbody, tfoot) :is(td, th):not(.ui-table__act) {
528
+ height: calc(var(--space-12) + var(--space-2));
529
+ padding-block: var(--space-3);
530
+ }
531
+ /* A filled cell link carries the padding its cell gave up. */
532
+ .ui-table.ui-table--hover:not(.ui-table--zebra):not(.ui-table--dense) td.ui-table__linked:has(> :is(a:not([class]), a.ui-identity):only-child) { padding: 0; }
533
+ .ui-table.ui-table--hover:not(.ui-table--zebra):not(.ui-table--dense) td.ui-table__linked > :is(a:not([class]), a.ui-identity):only-child { padding: var(--space-2) var(--cell-gap) var(--space-2) 0; }
534
+ .ui-table.ui-table--hover:not(.ui-table--zebra):not(.ui-table--dense).ui-table--comfortable td.ui-table__linked > :is(a:not([class]), a.ui-identity):only-child { padding-block: var(--space-3); }
535
+ .ui-table.ui-table--hover:not(.ui-table--zebra):not(.ui-table--dense) td.ui-table__linked:first-child > :is(a:not([class]), a.ui-identity):only-child { padding-left: var(--cell-edge); }
536
+ .ui-table.ui-table--hover:not(.ui-table--zebra):not(.ui-table--dense) td.ui-table__linked:last-child > :is(a:not([class]), a.ui-identity):only-child { padding-right: var(--cell-edge); }
537
+
538
+ /* The row's name, in the first column after the selection, is the row's strongest ink. */
539
+ .ui-table.ui-table--hover:not(.ui-table--zebra):not(.ui-table--dense) tbody tr:not(.is-dead) > :is(td, th):is(:first-child, .ui-table__selection + *) {
540
+ color: var(--strong);
541
+ font-weight: var(--weight-medium);
542
+ }
543
+ /* A second line under a cell's value, such as an email under a name. It is a value, so
544
+ it keeps full ink. Its size and weight set it below the name. */
545
+ .ui-table__sub { display: block; font-size: var(--text-sm); font-weight: var(--weight-normal); color: var(--text); }
546
+
547
+ /* Row states. Hover is a quiet neutral fill. A selected row takes an accent wash, one step
548
+ stronger under the pointer. Each fill is opaque and square, so a pinned cell still covers
549
+ the columns that scroll under it. A target row keeps its own wash. The selected wash
550
+ is 9%: at 8% an inline code chip on the dark page loses its 1.1:1 step. */
551
+ .ui-table.ui-table--hover:not(.ui-table--zebra):not(.ui-table--dense) tbody tr:hover > :is(td, th) { border-radius: 0; }
552
+ .ui-table.ui-table--hover:not(.ui-table--zebra):not(.ui-table--dense) tbody tr:hover:not(.is-target) > :is(td, th) { background: var(--surface-3); }
553
+ .ui-table.ui-table--hover:not(.ui-table--zebra):not(.ui-table--dense) tbody tr:not(.is-target):has(> .ui-table__selection :checked) > :is(td, th) { background: color-mix(in srgb, var(--accent) 9%, var(--table-bg)); }
554
+ .ui-table.ui-table--hover:not(.ui-table--zebra):not(.ui-table--dense) tbody tr:not(.is-target):has(> .ui-table__selection :checked):hover > :is(td, th) { background: color-mix(in srgb, var(--accent) 12%, var(--table-bg)); }
555
+
556
+ /* Icon row actions: 32px buttons in a cell as wide as its buttons, so a row keeps its
557
+ height. The glyph, not the button, meets the end cell's edge. */
558
+ .ui-table.ui-table--hover:not(.ui-table--zebra):not(.ui-table--dense) td.ui-table__act { padding-block: 0; padding-right: calc(var(--cell-edge) - var(--space-2)); }
559
+ .ui-table.ui-table--hover:not(.ui-table--zebra):not(.ui-table--dense) td.ui-table__act:has(.ui-btn--icon) { width: 1%; }
560
+ .ui-table.ui-table--hover:not(.ui-table--zebra):not(.ui-table--dense) td.ui-table__act .ui-btn--icon { box-sizing: border-box; width: var(--space-8); height: var(--space-8); padding: 0; justify-content: center; }
561
+
562
+ /* In a card the table, or its frame, reaches the card's edges, so a row's fill does too. */
563
+ .ui-card > :is(.ui-table.ui-table--hover:not(.ui-table--zebra):not(.ui-table--dense), .ui-table-scroll:has(> .ui-table.ui-table--hover:not(.ui-table--zebra):not(.ui-table--dense))) {
564
+ width: calc(100% + 2 * var(--space-6));
565
+ max-width: none;
566
+ margin-inline: calc(-1 * var(--space-6));
567
+ }
568
+ .ui-card > :is(.ui-table.ui-table--hover:not(.ui-table--zebra):not(.ui-table--dense), .ui-table-scroll:has(> .ui-table.ui-table--hover:not(.ui-table--zebra):not(.ui-table--dense))):first-child { margin-top: calc(-1 * var(--space-6)); }
569
+ .ui-card > :is(.ui-table.ui-table--hover:not(.ui-table--zebra):not(.ui-table--dense), .ui-table-scroll:has(> .ui-table.ui-table--hover:not(.ui-table--zebra):not(.ui-table--dense))):last-child { margin-bottom: calc(-1 * var(--space-6)); }
570
+ .ui-card--pad-sm > :is(.ui-table.ui-table--hover:not(.ui-table--zebra):not(.ui-table--dense), .ui-table-scroll:has(> .ui-table.ui-table--hover:not(.ui-table--zebra):not(.ui-table--dense))):first-child { margin-top: calc(-1 * var(--space-5)); }
571
+ .ui-card--pad-sm > :is(.ui-table.ui-table--hover:not(.ui-table--zebra):not(.ui-table--dense), .ui-table-scroll:has(> .ui-table.ui-table--hover:not(.ui-table--zebra):not(.ui-table--dense))):last-child { margin-bottom: calc(-1 * var(--space-5)); }
572
+ .ui-card--fit > :is(.ui-table.ui-table--hover:not(.ui-table--zebra):not(.ui-table--dense), .ui-table-scroll:has(> .ui-table.ui-table--hover:not(.ui-table--zebra):not(.ui-table--dense))) { width: auto; max-width: calc(100% + 2 * var(--space-6)); }
573
+ /* The frame keeps its side bands and takes a top band, because the sticky header covers a
574
+ ring drawn anywhere else. The frame clips its cells to the inner curve of the bands, so
575
+ the header follows the ring at the top corners. The header gives the top band back from
576
+ its padding. The frame drops the bottom band, so the card's padding is the only room
577
+ below the table. */
578
+ .ui-card > .ui-table-scroll:has(> .ui-table.ui-table--hover:not(.ui-table--zebra):not(.ui-table--dense)) { border-top-width: var(--space-1); border-bottom-width: 0; }
579
+ .ui-card > .ui-table-scroll > .ui-table.ui-table--hover:not(.ui-table--zebra):not(.ui-table--dense) thead th { padding-top: calc(var(--space-3) - var(--space-1)); }
580
+ .ui-card > .ui-table-scroll > .ui-table.ui-table--hover:not(.ui-table--zebra):not(.ui-table--dense).ui-table--compact thead th { padding-top: calc(var(--space-2) - var(--space-1)); }
581
+ /* The frame's corners follow the card's, so a fill in the first or last row does too. */
582
+ .ui-card > .ui-table-scroll:has(> .ui-table.ui-table--hover:not(.ui-table--zebra):not(.ui-table--dense)):first-child { border-start-start-radius: inherit; border-start-end-radius: inherit; }
583
+ .ui-card > .ui-table-scroll:has(> .ui-table.ui-table--hover:not(.ui-table--zebra):not(.ui-table--dense)):last-child { border-end-start-radius: inherit; border-end-end-radius: inherit; }
584
+ .ui-card > .ui-table.ui-table--hover:not(.ui-table--zebra):not(.ui-table--dense) { --cell-edge: var(--space-6); }
585
+ /* In a frame, the side band holds space-1 of the card's text edge. */
586
+ .ui-card > .ui-table-scroll > .ui-table.ui-table--hover:not(.ui-table--zebra):not(.ui-table--dense) { --cell-edge: calc(var(--space-6) - var(--space-1)); }
587
+
588
+ /* On a phone the cells pad by space-3 across and a card's end cells by space-4. A wide
589
+ table scrolls under a finger, so the frame shows no scrollbar. 560px is the kit's phone
590
+ breakpoint. */
591
+ @media (max-width: 560px) {
592
+ .ui-table.ui-table--hover:not(.ui-table--zebra):not(.ui-table--dense):is(*, .ui-table--comfortable) { --cell-gap: var(--space-3); }
593
+ .ui-card > .ui-table-scroll > .ui-table.ui-table--hover:not(.ui-table--zebra):not(.ui-table--dense) { --cell-edge: calc(var(--space-4) - var(--space-1)); }
594
+ .ui-card > .ui-table.ui-table--hover:not(.ui-table--zebra):not(.ui-table--dense) { --cell-edge: var(--space-4); }
595
+ .ui-table-scroll { scrollbar-width: none; }
596
+ .ui-table-scroll::-webkit-scrollbar { display: none; }
597
+ }
@@ -59,6 +59,11 @@
59
59
 
60
60
  .ui-tip.is-open { opacity: 1; visibility: visible; }
61
61
 
62
+ /* A closed readout has no box: a hidden box still widens the scroller that holds
63
+ it. The open readout fades in from its starting style. */
64
+ .ui-tip:not(.is-open) { display: none; }
65
+ @starting-style { .ui-tip.is-open { opacity: 0; } }
66
+
62
67
  .ui-tip__label { color: var(--text); }
63
68
  .ui-tip__value {
64
69
  font-size: var(--text-sm);
@@ -649,6 +649,11 @@
649
649
  .ui-table-scroll > .ui-table--hover tbody tr:hover:not(.is-target) > :is(td, th) {
650
650
  --code-bg: var(--surface);
651
651
  }
652
+ /* The row table hovers on --surface-3, and a chip there keeps the card surface. A selected
653
+ * row mixes the accent into the table ground, so a chip there keeps that plain ground. */
654
+ .ui-table.ui-table--hover:not(.ui-table--zebra):not(.ui-table--dense) tbody tr:hover:not(.is-target) > :is(td, th) { --code-bg: var(--surface); }
655
+ .ui-table.ui-table--hover:not(.ui-table--zebra):not(.ui-table--dense) tbody tr:not(.is-target):has(> .ui-table__selection :checked) > :is(td, th),
656
+ .ui-table.ui-table--hover:not(.ui-table--zebra):not(.ui-table--dense) tbody tr:not(.is-target):has(> .ui-table__selection :checked):hover > :is(td, th) { --code-bg: var(--table-bg); }
652
657
  .ui-card--accent,
653
658
  .ui-card--live,
654
659
  .ui-snippet--reveal { --code-bg: var(--surface); }