@apliteni/apliteni-ui 0.147.0 → 0.149.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.
@@ -68,6 +68,10 @@
68
68
  border-spacing: 0;
69
69
  padding: 0 var(--space-2);
70
70
  }
71
+ /* A pinned column sticks at the frame's edge, so its first cell owns the start inset
72
+ and the text does not move when the table scrolls. why: #736 */
73
+ .ui-table--hover.ui-table--pinned:not(.ui-table--zebra) { padding: 0 var(--space-2) 0 0; }
74
+ .ui-table--hover.ui-table--pinned:not(.ui-table--zebra) :is(th, td):first-child { padding-left: var(--space-2); }
71
75
  .ui-table--hover:not(.ui-table--zebra) tbody tr:hover td:first-child {
72
76
  border-top-left-radius: var(--radius-sm); border-bottom-left-radius: var(--radius-sm); }
73
77
  .ui-table--hover:not(.ui-table--zebra) tbody tr:hover td:last-child {
@@ -221,8 +225,7 @@
221
225
  * because a dense cell is nowrap, and the column is then only as wide as the wider
222
226
  * of the two: a status that had a column of its own was the first thing a phone cut
223
227
  * off, and in here it is the last. The class goes on a span inside the cell, never
224
- * on the cell, which would leave the table box model. A row carrying a paragraph takes
225
- * .ui-table--stack below instead, which drops the head; a pair keeps every head at every
228
+ * on the cell, which would leave the table box model. A pair keeps every head at every
226
229
  * width, which is what a three-value glance row is read by. why: #505 */
227
230
  .ui-table__pair { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-2); }
228
231
 
@@ -271,6 +274,12 @@
271
274
  .ui-table--zebra.ui-table--hover tbody tr.is-target:hover > :is(td, th) {
272
275
  background: color-mix(in srgb, var(--accent) 12%, transparent); /* code-bg: inherit — this translucent wash leaves the chip on its opaque ground. */
273
276
  }
277
+ /* A pinned cell lays the wash over its own ground, or the columns that scroll under it
278
+ show through. #736 */
279
+ .ui-table--pinned tbody tr.is-target > :is(.ui-table__identity, .ui-table__selection),
280
+ .ui-table--pinned.ui-table--hover tbody tr.is-target:hover > :is(.ui-table__identity, .ui-table__selection) {
281
+ background: linear-gradient(color-mix(in srgb, var(--accent) 12%, transparent)) var(--table-bg);
282
+ }
274
283
 
275
284
  /* A focused row draws the shared ring inward, like its containing scroll region.
276
285
  why: docs/foundations.md#the-focus-ring */
@@ -299,6 +308,11 @@
299
308
  .ui-card > .ui-table-scroll > .ui-table--dense {
300
309
  padding-inline: 0;
301
310
  }
311
+ /* A hover table's row inset plus the frame's 4px band is one --space-3, so the
312
+ frame hangs out by that much and the first column meets the title. why: #736 */
313
+ .ui-card > .ui-table-scroll:has(> .ui-table--hover:not(.ui-table--dense)) {
314
+ margin-inline: calc(-1 * var(--space-3));
315
+ }
302
316
  .ui-table td.ui-table__num { text-align: right; }
303
317
  .ui-table--compact td,
304
318
  .ui-table--compact :is(tbody, tfoot) th { padding: var(--space-1) var(--space-3); font-size: var(--text-sm); line-height: var(--leading-snug); height: 33px; }
@@ -335,9 +349,9 @@
335
349
  /* The surface belongs to the box that scrolls, so the shades land under the cells
336
350
  rather than behind them; the row fills repeat that same surface and step aside.
337
351
  The sticky header and pinned column keep their paint: they hide what scrolls
338
- beneath them. */
352
+ beneath them. A target row keeps its wash. */
339
353
  .ui-table-scroll > .ui-table,
340
- .ui-table-scroll > .ui-table tbody td:not(.ui-table__identity, .ui-table__selection) { background-color: transparent; }
354
+ .ui-table-scroll > .ui-table tbody :where(tr:not(.is-target)) > td:not(.ui-table__identity, .ui-table__selection) { background-color: transparent; }
341
355
  .ui-table-scroll > .ui-table--hover tbody tr:hover:not(.is-target) > :is(td, th) {
342
356
  background: var(--surface-2);
343
357
  }
@@ -392,6 +406,14 @@
392
406
  .ui-table-scroll::after { left: calc(100% - var(--space-3)); right: 0; justify-self: end; }
393
407
  @container scroll-state(scrollable: left) {
394
408
  .ui-table-scroll::before { background: linear-gradient(to right, var(--table-edge), transparent); }
409
+ /* A pinned column stays, so the shade falls on its right side, over the columns that
410
+ scroll under it. The spread carries the shadow past each row's ends, and the clip cuts
411
+ it there and on the left, so the rows join as one even band. why: #736 */
412
+ .ui-table-scroll:has(> .ui-table--pinned)::before { background: none; }
413
+ .ui-table--pinned .ui-table__identity {
414
+ box-shadow: calc(-1 * var(--space-2)) 0 var(--space-3) var(--space-3) var(--table-edge);
415
+ clip-path: inset(0 calc(-1 * var(--space-6)) 0 0);
416
+ }
395
417
  }
396
418
  @container scroll-state(scrollable: right) {
397
419
  .ui-table-scroll::after { background: linear-gradient(to left, var(--table-edge), transparent); }
@@ -494,112 +516,13 @@ a.ui-identity:hover { text-decoration: underline; }
494
516
  .ui-table--pinned .ui-table__selection + .ui-table__identity { left: var(--ui-table-selection-width); }
495
517
 
496
518
  /* ============================================================================
497
- * Stacked rows at phone width — .ui-table--stack, .ui-table__long
519
+ * Running text in a cell — .ui-table__long
498
520
  *
499
- * The cell rules name both .ui-table and the modifier on purpose: --dense, --compact and
500
- * __title reach a cell with two classes, and one class would lose to them and leave
501
- * `nowrap` on a paragraph.
502
- *
503
- * The consumer's half — the roles a changed `display` drops — is in docs/components.md.
504
- * why: docs/components.md#dense-financial-tables
505
- * held by: src/styles/table-stack.test.js (layout), stories/table-stack.test.js (roles)
521
+ * A table never stacks its rows at any width. A wide table scrolls sideways in its frame,
522
+ * and a pinned identity keeps the first column in view. why: #736
506
523
  * ========================================================================== */
507
524
 
508
- /* The marked column holds running text at any width. What the modifier adds below the
509
- phone step is the line of its own. */
510
- .ui-table td.ui-table__long { white-space: normal; }
511
-
512
- @media (max-width: 560px) {
513
- .ui-table.ui-table--stack { display: block; width: 100%; min-width: 0; padding: 0; }
514
- .ui-table.ui-table--stack > thead {
515
- position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%);
516
- }
517
- .ui-table.ui-table--stack > tbody { display: block; }
518
- .ui-table.ui-table--stack > tbody > tr {
519
- display: flex; flex-wrap: wrap; align-items: baseline;
520
- column-gap: var(--space-3); row-gap: var(--space-1);
521
- /* The inset is on the row, not the table, so its hover fill and separator keep
522
- their clearance at the width above this one. */
523
- padding: var(--space-3); border-bottom: 1px solid var(--border);
524
- }
525
- .ui-table.ui-table--stack > tbody > tr:last-child { border-bottom: 0; }
526
- /* `height` is in this list for the same reason `white-space` is: --compact sets a row
527
- height for a one-line cell, and a block cell takes it as a fixed height rather than a
528
- floor, so a wrapped paragraph spills through the separator into the next row. A stacked
529
- cell is as tall as its text. */
530
- .ui-table.ui-table--stack > tbody > tr > td {
531
- display: block; width: auto; min-width: 0; max-width: 100%; height: auto;
532
- padding: 0; border-bottom: 0; white-space: normal; overflow-wrap: break-word;
533
- }
534
- .ui-table.ui-table--stack.ui-table--hover tbody tr:hover:not(.is-target) > :is(td, th) {
535
- background: transparent;
536
- }
537
- .ui-table.ui-table--stack > tbody > tr > td.ui-table__long { flex: 0 0 100%; text-align: left; }
538
- /* The head is gone, so an amount that names its column in `data-label` says it in front of
539
- the figure, in the unit's size and body ink. */
540
- .ui-table.ui-table--stack > tbody > tr > td[data-label]::before {
541
- content: attr(data-label) / ""; margin-right: var(--space-1); font-size: var(--text-xs);
542
- }
543
- /* The cells of a stacked row are separate boxes with gaps between them, so a tint on each
544
- would paint patches. The row paints one tint and the cells let it through. */
545
- .ui-table.ui-table--stack tbody tr.is-target:is(*, :hover) {
546
- background: color-mix(in srgb, var(--accent) 12%, transparent); /* code-bg: inherit — this translucent wash leaves the chip on its opaque ground. */
547
- }
548
- .ui-table.ui-table--stack tbody tr.is-target:is(*, :hover) > :is(td, th) { background: transparent; }
549
- /* A stacked row has no columns left to pin, stick or inset, and the identity's name is
550
- what the row is about — the fold hides it only because a pinned column is narrow. */
551
- .ui-table.ui-table--stack.ui-table--pinned > :where(thead, tbody) > tr > :where(.ui-table__identity, .ui-table__selection) {
552
- position: static; width: auto; min-width: 0; max-width: none;
553
- padding-inline: 0; border-right: 0; text-align: left;
554
- /* The cap's cut goes with the cap: a card is as wide as the row, so there is
555
- nothing to cut, and a clip box here would only reach a focused link's ring. */
556
- overflow: visible; text-overflow: clip;
557
- }
558
- /* The name is what the card is about, and a card has the width to wrap it. #500 put
559
- `nowrap` on it for the narrow column, so the stacked row takes that off too. */
560
- .ui-table.ui-table--stack.ui-table--pinned .ui-identity__name {
561
- position: static; width: auto; height: auto; max-width: none;
562
- overflow: visible; clip-path: none; white-space: normal; text-overflow: clip;
563
- }
564
- .ui-table.ui-table--stack.ui-table--pinned .ui-table__identity > * {
565
- overflow: visible; text-overflow: clip;
566
- }
567
- .ui-table.ui-table--stack.ui-table--pinned .ui-table__identity > * a {
568
- max-width: none; overflow: visible; text-overflow: clip;
569
- }
570
- .ui-table.ui-table--stack.ui-table--pinned .ui-table__identity > a:not([class]) {
571
- display: inline-block;
572
- }
573
- .ui-table.ui-table--stack.ui-table--pinned .ui-table__identity:not(.ui-table__linked):has(> a:focus-visible) {
574
- outline: none;
575
- }
576
- .ui-table.ui-table--stack.ui-table--pinned .ui-table__identity:not(.ui-table__linked) > a:focus-visible {
577
- outline: var(--ring);
578
- outline-offset: var(--ring-offset);
579
- }
580
- /* A card has no column to fill: every cell is a block on its own line and the ROW pays
581
- the inset, so the fill's padding would stand the link a step right of the card's text
582
- edge and the cell's `height: 1px` would hold a block cell to one pixel. Written through
583
- the row like the resets above it, so it outranks the fill and its density. */
584
- .ui-table.ui-table--stack > tbody > tr > td.ui-table__linked:has(> :is(a:not([class]), a.ui-identity):only-child) { height: auto; }
585
- .ui-table.ui-table--stack > tbody > tr > td.ui-table__linked > :is(a:not([class]), a.ui-identity):only-child {
586
- width: auto; height: auto; padding: 0;
587
- }
588
- /* The stacked card gives the link its own box again, so it takes the outset band. */
589
- .ui-table.ui-table--stack > tbody > tr > td.ui-table__linked > a:only-child:focus-visible {
590
- outline: var(--ring);
591
- outline-offset: var(--ring-offset);
592
- }
593
- /* The bleed now pays for the row's inset instead of the end cells', so the cells still
594
- start on the card's own text edge and the outline keeps its room on both sides. Same
595
- step, so the arithmetic is the one the sheet already does for a dense table above; these
596
- rules exist because a stacked table that is not dense gets no bleed from that one. A
597
- scroll wrapper owns the bleed when it is the card's child, and owes one step more than
598
- the table does because the wrapper keeps its own --space-1 of focus clearance. */
599
- .ui-card > .ui-table--stack {
600
- width: calc(100% + 2 * var(--space-3)); margin-inline: calc(-1 * var(--space-3));
601
- }
602
- .ui-card > .ui-table-scroll:has(> .ui-table--stack) {
603
- margin-inline: calc(-1 * var(--space-4));
604
- }
605
- }
525
+ /* The marked column holds running text at any width. Two classes outrank the nowrap of
526
+ --dense, --compact and __title. The floor keeps a note a readable paragraph when the table
527
+ is wider than its frame, so the frame scrolls instead of the note collapsing to one word. */
528
+ .ui-table td.ui-table__long { white-space: normal; min-width: var(--panel-sm); }