@apliteni/apliteni-ui 0.159.0 → 0.160.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/docs/components.md +1 -1
- package/guidelines/dense-tables.md +2 -2
- package/package.json +1 -1
- package/src/styles/table.css +41 -26
package/docs/components.md
CHANGED
|
@@ -665,7 +665,7 @@ larger.
|
|
|
665
665
|
### Dense financial tables
|
|
666
666
|
|
|
667
667
|
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.
|
|
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
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
|
|
670
670
|
taller. **Columns scroll rather than disappear**, while sticky headers and pinned identity cells
|
|
671
671
|
keep opaque backgrounds, the shared focus composition, and their full accessible names. **A
|
|
@@ -8,9 +8,9 @@
|
|
|
8
8
|
|
|
9
9
|
**Rule:** Put tables on a white surface in light mode and the base canvas in dark mode.
|
|
10
10
|
|
|
11
|
-
**Do:**
|
|
11
|
+
**Do:** Mark a hovered row with an inset grey fill that leaves room at both ends of the row.
|
|
12
12
|
|
|
13
|
-
**Don't:** Add a grey zebra
|
|
13
|
+
**Don't:** Add a grey zebra.
|
|
14
14
|
|
|
15
15
|
## Choose density without shrinking type
|
|
16
16
|
|
package/package.json
CHANGED
package/src/styles/table.css
CHANGED
|
@@ -58,30 +58,32 @@
|
|
|
58
58
|
.ui-table tr.is-dead td { /* muted-ink: state — revoked row */ color: var(--muted); }
|
|
59
59
|
.ui-table tbody tr { transition: background var(--dur-fast) var(--ease); }
|
|
60
60
|
|
|
61
|
-
/* Row hover:
|
|
62
|
-
*
|
|
63
|
-
*
|
|
64
|
-
*
|
|
65
|
-
*
|
|
61
|
+
/* Row hover: a rounded fill across the full table width. The separate border model with
|
|
62
|
+
* zero spacing lets the row ends round. The table has no side padding, so the end cells
|
|
63
|
+
* hold the room: --space-2 inside the fill at each end, header and body alike, so a
|
|
64
|
+
* column and its header share one edge. A pinned column sticks at the frame's edge with
|
|
65
|
+
* that room inside it (#736). The dense and compact variants and an end action cell
|
|
66
|
+
* keep the same room. Zebra keeps the original full-bleed tint
|
|
67
|
+
* (finance ledger) and is excluded here; its hover rule is below. why: #773 */
|
|
66
68
|
.ui-table--hover:not(.ui-table--zebra) {
|
|
67
69
|
border-collapse: separate;
|
|
68
70
|
border-spacing: 0;
|
|
69
|
-
padding: 0 var(--space-2);
|
|
70
71
|
}
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
.ui-table--hover
|
|
74
|
-
.ui-table--hover
|
|
75
|
-
.ui-table--hover:not(.ui-table--zebra) tbody tr:hover td:first-child {
|
|
72
|
+
:where(.ui-table--hover:not(.ui-table--zebra)) :is(th, td):not(.ui-table__act):first-child { padding-left: var(--space-2); }
|
|
73
|
+
:where(.ui-table--hover:not(.ui-table--zebra)) :is(th, td):not(.ui-table__act):last-child { padding-right: var(--space-2); }
|
|
74
|
+
:where(.ui-table--hover:not(.ui-table--zebra)) td.ui-table__act:last-child { padding-right: var(--space-2); }
|
|
75
|
+
.ui-table--hover:not(.ui-table--zebra) tbody tr:hover > :is(td, th):first-child {
|
|
76
76
|
border-top-left-radius: var(--radius-sm); border-bottom-left-radius: var(--radius-sm); }
|
|
77
|
-
.ui-table--hover:not(.ui-table--zebra) tbody tr:hover td:last-child {
|
|
77
|
+
.ui-table--hover:not(.ui-table--zebra) tbody tr:hover > :is(td, th):last-child {
|
|
78
78
|
border-top-right-radius: var(--radius-sm); border-bottom-right-radius: var(--radius-sm); }
|
|
79
|
-
/*
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
79
|
+
/* A row line that met a round corner crossed it. A hovered row drops the line below it,
|
|
80
|
+
the row before it drops the line above it, and the header drops its line over the
|
|
81
|
+
first row. why: #773 */
|
|
82
|
+
.ui-table--hover:not(.ui-table--zebra) tbody tr:hover > :is(td, th),
|
|
83
|
+
.ui-table--hover:not(.ui-table--zebra) tbody tr:has(+ tr:hover) > :is(td, th),
|
|
84
|
+
.ui-table--hover:not(.ui-table--zebra) thead:has(+ tbody > tr:first-child:hover) > tr > th {
|
|
85
|
+
border-bottom-color: transparent;
|
|
86
|
+
}
|
|
85
87
|
|
|
86
88
|
/* Data-table modifiers, composable: .ui-table--dense --zebra --hover.
|
|
87
89
|
* --dense --space-3 across, --space-2 down — one step in from the base table
|
|
@@ -194,9 +196,13 @@
|
|
|
194
196
|
}
|
|
195
197
|
/* The last cell gave up its end gap above, so the link it holds gives up the same. */
|
|
196
198
|
.ui-table td.ui-table__linked:where(:last-child) > :is(a:not([class]), a.ui-identity):only-child { padding-right: 0; }
|
|
197
|
-
|
|
199
|
+
/* A hover table's end cells hold the room inside the fill, so a linked end cell's link does. */
|
|
200
|
+
:where(.ui-table--hover:not(.ui-table--zebra)) td.ui-table__linked:first-child > :is(a:not([class]), a.ui-identity):only-child { padding-left: var(--space-2); }
|
|
201
|
+
:where(.ui-table--hover:not(.ui-table--zebra)) td.ui-table__linked:last-child > :is(a:not([class]), a.ui-identity):only-child { padding-right: var(--space-2); }
|
|
198
202
|
.ui-table--dense td.ui-table__linked > :is(a:not([class]), a.ui-identity):only-child { padding: var(--space-2) var(--space-3); }
|
|
199
203
|
.ui-table--compact td.ui-table__linked > :is(a:not([class]), a.ui-identity):only-child { padding: var(--space-1) var(--space-3); }
|
|
204
|
+
:where(.ui-table--hover:not(.ui-table--zebra)):is(.ui-table--dense, .ui-table--compact) td.ui-table__linked:first-child > :is(a:not([class]), a.ui-identity):only-child { padding-left: var(--space-2); }
|
|
205
|
+
:where(.ui-table--hover:not(.ui-table--zebra)):is(.ui-table--dense, .ui-table--compact) td.ui-table__linked:last-child > :is(a:not([class]), a.ui-identity):only-child { padding-right: var(--space-2); }
|
|
200
206
|
/* Zebra insets the row's END cells only, so the fill does too: a marked identity behind a
|
|
201
207
|
selection column is a middle cell, and a step it never gave up would move its name. */
|
|
202
208
|
.ui-table--zebra td.ui-table__linked:first-child > :is(a:not([class]), a.ui-identity):only-child { padding-left: var(--space-3); }
|
|
@@ -305,23 +311,32 @@
|
|
|
305
311
|
.ui-card > .ui-table-scroll:has(> .ui-table--dense) {
|
|
306
312
|
margin-inline: calc(-1 * var(--space-4));
|
|
307
313
|
}
|
|
308
|
-
/* A hover table
|
|
309
|
-
straight in a card started 8px inside the card's text edge. #757 */
|
|
310
|
-
.ui-card > .ui-table-scroll > .ui-table--dense,
|
|
314
|
+
/* A hover table holds 8px at its ends, so a dense one hangs out by that much. why: #773 */
|
|
311
315
|
.ui-card > .ui-table--dense.ui-table--hover:not(.ui-table--zebra) {
|
|
312
|
-
|
|
316
|
+
width: calc(100% + 2 * var(--space-2));
|
|
317
|
+
margin-inline: calc(-1 * var(--space-2));
|
|
318
|
+
}
|
|
319
|
+
.ui-card--fit > .ui-table--dense.ui-table--hover:not(.ui-table--zebra) {
|
|
320
|
+
width: auto;
|
|
321
|
+
max-width: calc(100% + 2 * var(--space-2));
|
|
313
322
|
}
|
|
314
|
-
/* A hover table's
|
|
315
|
-
frame hangs out by that much and the first column meets the title.
|
|
316
|
-
|
|
323
|
+
/* A hover table's 8px end-cell room plus the frame's 4px band is one --space-3, so the
|
|
324
|
+
frame hangs out by that much and the first column meets the title. A dense zebra hover
|
|
325
|
+
table keeps the dense bleed. why: #736, #773 */
|
|
326
|
+
.ui-card > .ui-table-scroll:has(> .ui-table--hover:not(.ui-table--dense.ui-table--zebra)) {
|
|
317
327
|
margin-inline: calc(-1 * var(--space-3));
|
|
318
328
|
}
|
|
319
329
|
.ui-table td.ui-table__num { text-align: right; }
|
|
320
330
|
.ui-table--compact td,
|
|
321
331
|
.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; }
|
|
322
332
|
.ui-table--compact th { padding: var(--space-2) var(--space-3); }
|
|
333
|
+
.ui-table--compact th:first-child,
|
|
334
|
+
.ui-table--compact td:first-child { padding-left: var(--space-3); }
|
|
323
335
|
.ui-table--compact th:last-child,
|
|
324
336
|
.ui-table--compact td:last-child { padding-right: var(--space-3); }
|
|
337
|
+
/* A hover table holds --space-2 inside the fill at each end, and dense and compact too. why: #773 */
|
|
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
|
+
: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); }
|
|
325
340
|
/* Columns past the box's edge, said in paint. Two shades, one per side, under two
|
|
326
341
|
cover layers that ride the content: `local` moves a cover with the scroll, so
|
|
327
342
|
reaching an end slides that cover over its shade. A cover is solid for its first
|