@apliteni/apliteni-ui 0.172.0 → 0.174.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 +12 -2
- package/guidelines/dense-tables.md +3 -1
- package/guidelines/drawer.md +6 -6
- package/package.json +1 -1
- package/react/README.md +4 -2
- package/src/styles/drawer.css +31 -9
- package/src/styles/table.css +30 -0
- package/src/tokens/tokens.css +4 -0
package/docs/components.md
CHANGED
|
@@ -563,8 +563,18 @@ must have a search field is a rule rather than a recommendation:
|
|
|
563
563
|
|
|
564
564
|
A drawer is a panel against one edge of the screen. It appears over a scrim. It lets the reader
|
|
565
565
|
look at or change one thing without leaving the list that opened it. **It groups by heading, never
|
|
566
|
-
by card:** `
|
|
567
|
-
then hears each label with its value.
|
|
566
|
+
by card:** `DrawerSection` puts a heading over a `<dl>` of label and value pairs. A screen reader
|
|
567
|
+
then hears each label with its value. **Groups stand 32px apart, with no line between them.**
|
|
568
|
+
Each group heading stands on a 1px `--border` line, the same line as a table head. **A record can
|
|
569
|
+
lead with its key figure:** put a `<dl class="ui-drawer__figure">` in a group with no heading, as
|
|
570
|
+
the first group. Its `<dt>` is the label, and its `<dd>` holds a `.ui-drawer__figure-value`, set at
|
|
571
|
+
22px (`--text-xl`), with a status badge beside it. The figure never breaks across lines.
|
|
572
|
+
**A table in a drawer group takes the drawer's 13px text.** Its head is semibold in strong ink, as
|
|
573
|
+
a group heading is. Its rows have no lines between them. A table that is not a hover table holds
|
|
574
|
+
its rows 8px apart. A hover table keeps its own row height, because its rows are targets. The
|
|
575
|
+
table stands on the drawer's ground, in light and in dark. Its first and last columns start and
|
|
576
|
+
end on the edges of the drawer's other text. A dense or zebra table keeps its own inset.
|
|
577
|
+
The value stays beside its label instead of moving to the far
|
|
568
578
|
edge of the panel. A row whose value is a field or a dropdown lines its label up with the control's first line of text.
|
|
569
579
|
This alignment happens by itself. There is no setting for it.
|
|
570
580
|
Nothing inside a drawer draws a card, a row rule or an `<hr>`. Actions stay
|
|
@@ -8,10 +8,12 @@
|
|
|
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:** Mark a hovered row with an inset grey fill
|
|
11
|
+
**Do:** Mark a hovered row with an inset grey fill, with room at both ends.
|
|
12
12
|
|
|
13
13
|
**Don't:** Add a grey zebra.
|
|
14
14
|
|
|
15
|
+
**Except:** A table in a card or drawer group stands on that surface.
|
|
16
|
+
|
|
15
17
|
## Choose density without shrinking type
|
|
16
18
|
|
|
17
19
|
<!-- rule: density -->
|
package/guidelines/drawer.md
CHANGED
|
@@ -36,21 +36,21 @@
|
|
|
36
36
|
|
|
37
37
|
**Why:** The drawer already provides the edge and raised surface, so cards add unnecessary boxes.
|
|
38
38
|
|
|
39
|
-
**Do:**
|
|
39
|
+
**Do:** Lead with the key figure, then put a heading over each group.
|
|
40
40
|
|
|
41
|
-
**Don't:** Put each group in a card
|
|
41
|
+
**Don't:** Put each group in a card.
|
|
42
42
|
|
|
43
43
|
## Header and group dividers
|
|
44
44
|
|
|
45
45
|
<!-- rule: three-lines -->
|
|
46
46
|
|
|
47
|
-
**Rule:** Add lines
|
|
47
|
+
**Rule:** Add lines under the header and each group heading. Leave the footer unfilled and without a rule.
|
|
48
48
|
|
|
49
|
-
**Why:** The header line marks the scrolling body
|
|
49
|
+
**Why:** The header line marks the scrolling body, heading lines match table heads, and actions share the panel surface.
|
|
50
50
|
|
|
51
|
-
**Do:**
|
|
51
|
+
**Do:** Hold groups apart with space.
|
|
52
52
|
|
|
53
|
-
**Don't:** Add dividers between
|
|
53
|
+
**Don't:** Add dividers between groups or rows.
|
|
54
54
|
|
|
55
55
|
## Spaced label rows
|
|
56
56
|
|
package/package.json
CHANGED
package/react/README.md
CHANGED
|
@@ -414,8 +414,10 @@ Set `redacted` on a row to display “Hidden” with an eye-off icon without ren
|
|
|
414
414
|
the value. Below 560px, each label appears above its value, and the layout
|
|
415
415
|
changes to one column.
|
|
416
416
|
|
|
417
|
-
DrawerSection groups content under a heading
|
|
418
|
-
|
|
417
|
+
DrawerSection groups content under a heading that stands on a thin line. Groups
|
|
418
|
+
stand apart by space. A section without a title has no heading and no line. Use it
|
|
419
|
+
for a lead figure (`ui-drawer__figure`) or for a table that names its own columns.
|
|
420
|
+
Its `headingLevel` defaults to 3. Import both the kit CSS and the React
|
|
419
421
|
CSS. Use a table for figures that readers need to compare down a column.
|
|
420
422
|
|
|
421
423
|
```tsx
|
package/src/styles/drawer.css
CHANGED
|
@@ -198,21 +198,19 @@
|
|
|
198
198
|
}
|
|
199
199
|
|
|
200
200
|
/* -- Groups and rows ------------------------------------------------------- */
|
|
201
|
-
/*
|
|
201
|
+
/* DrawerSection: a heading over label/value rows. The value sits beside its
|
|
202
202
|
label rather than at the far edge, so nothing has to lead the eye across the
|
|
203
|
-
panel, and rows are held apart by space alone.
|
|
204
|
-
|
|
205
|
-
|
|
203
|
+
panel, and rows are held apart by space alone. Groups stand apart by space too.
|
|
204
|
+
The one line inside the body stands under each group heading, the same hairline
|
|
205
|
+
as a table head, so a heading and a table head read as one kind of line.
|
|
206
206
|
why: docs/components.md#the-drawer */
|
|
207
|
-
.ui-drawer__section + .ui-drawer__section {
|
|
208
|
-
margin-top: var(--space-6);
|
|
209
|
-
padding-top: var(--space-6);
|
|
210
|
-
border-top: 1px solid var(--border);
|
|
211
|
-
}
|
|
207
|
+
.ui-drawer__section + .ui-drawer__section { margin-top: var(--space-8); }
|
|
212
208
|
/* An h3, and it opts out of the display face for the reason .ui-drawer__title does.
|
|
213
209
|
why: docs/foundations.md#typefaces */
|
|
214
210
|
.ui-drawer__section-title {
|
|
215
211
|
margin: 0 0 var(--space-2);
|
|
212
|
+
padding-bottom: var(--space-2);
|
|
213
|
+
border-bottom: 1px solid var(--border);
|
|
216
214
|
font-family: var(--font-sans);
|
|
217
215
|
font-size: var(--text-sm);
|
|
218
216
|
/* Semibold, and so outside the rank table, which has nothing at this size and
|
|
@@ -221,6 +219,30 @@
|
|
|
221
219
|
font-weight: var(--weight-semibold);
|
|
222
220
|
color: var(--strong);
|
|
223
221
|
}
|
|
222
|
+
/* The record's lead figure: a <dl> of one label over its value, with a status badge
|
|
223
|
+
beside the value. It stands in a group with no heading, before the other groups.
|
|
224
|
+
why: docs/components.md#the-drawer */
|
|
225
|
+
.ui-drawer__figure { margin: 0; }
|
|
226
|
+
.ui-drawer__figure > dt { color: var(--text); }
|
|
227
|
+
.ui-drawer__figure > dd {
|
|
228
|
+
display: flex;
|
|
229
|
+
flex-wrap: wrap;
|
|
230
|
+
align-items: center;
|
|
231
|
+
gap: var(--space-1) var(--space-3);
|
|
232
|
+
margin: var(--space-1) 0 0;
|
|
233
|
+
}
|
|
234
|
+
/* A figure is never broken across lines: `€` stays with its digits. */
|
|
235
|
+
.ui-drawer__figure-value {
|
|
236
|
+
color: var(--strong);
|
|
237
|
+
/* display: readout — a key figure is read as a number at a glance, not as a line of prose */
|
|
238
|
+
font-family: var(--font-display);
|
|
239
|
+
font-size: var(--text-xl);
|
|
240
|
+
font-weight: var(--weight-semibold);
|
|
241
|
+
line-height: var(--leading-tight);
|
|
242
|
+
letter-spacing: var(--tracking-tight);
|
|
243
|
+
font-variant-numeric: tabular-nums;
|
|
244
|
+
white-space: nowrap;
|
|
245
|
+
}
|
|
224
246
|
.ui-drawer__rows {
|
|
225
247
|
display: grid;
|
|
226
248
|
grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
|
package/src/styles/table.css
CHANGED
|
@@ -252,6 +252,8 @@
|
|
|
252
252
|
chip's hand-off travels with it, so an identifier in a cell keeps the page rather than
|
|
253
253
|
the card the cell is now painted with. why: src/tokens/tokens.css */
|
|
254
254
|
.ui-card { --table-bg: var(--surface); --table-code-bg: var(--bg); }
|
|
255
|
+
/* A drawer group is a reading surface in the same way, so its table takes the drawer's ground. */
|
|
256
|
+
.ui-drawer .ui-drawer__section { --table-bg: var(--drawer-surface); --table-code-bg: var(--bg); }
|
|
255
257
|
|
|
256
258
|
/* White in light, base canvas in dark; never a grey or tinted data surface. */
|
|
257
259
|
.ui-table { background: var(--table-bg); }
|
|
@@ -606,6 +608,34 @@ a.ui-identity:hover { text-decoration: underline; }
|
|
|
606
608
|
.ui-card > .ui-table.ui-table--hover:not(.ui-table--zebra):not(.ui-table--dense) { --cell-edge: var(--space-6); }
|
|
607
609
|
/* In a frame, the side band holds space-1 of the card's text edge. */
|
|
608
610
|
.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)); }
|
|
611
|
+
/* In a drawer group the table hangs out by its end-cell inset, into the body's padding, so
|
|
612
|
+
the first column starts on the edge of the group heading and the drawer title. */
|
|
613
|
+
.ui-drawer .ui-drawer__section > .ui-table.ui-table--hover:not(.ui-table--zebra):not(.ui-table--dense) {
|
|
614
|
+
width: calc(100% + 2 * var(--cell-edge));
|
|
615
|
+
max-width: none;
|
|
616
|
+
margin-inline: calc(-1 * var(--cell-edge));
|
|
617
|
+
}
|
|
618
|
+
/* A table in a drawer group takes the drawer body's 13px text. Its head is set as a group
|
|
619
|
+
heading is, semibold in strong ink on the same hairline, so the two read as one kind of
|
|
620
|
+
line. Its rows are held apart by space, as the drawer's pairs are, with no line between.
|
|
621
|
+
A hover table keeps its own row floor, because its rows are targets.
|
|
622
|
+
why: docs/components.md#the-drawer */
|
|
623
|
+
.ui-drawer .ui-drawer__section .ui-table thead th {
|
|
624
|
+
padding-bottom: var(--space-2);
|
|
625
|
+
font-weight: var(--weight-semibold);
|
|
626
|
+
color: var(--strong);
|
|
627
|
+
}
|
|
628
|
+
.ui-drawer .ui-drawer__section .ui-table :is(tbody, tfoot) :is(td, th) {
|
|
629
|
+
font-size: var(--text-sm);
|
|
630
|
+
border-bottom: 0;
|
|
631
|
+
}
|
|
632
|
+
.ui-drawer .ui-drawer__section .ui-table:not(.ui-table--hover) :is(tbody, tfoot) :is(td, th) { padding-block: var(--space-2); }
|
|
633
|
+
.ui-drawer .ui-drawer__section .ui-table:not(.ui-table--hover) tbody tr:first-child > :is(td, th) { padding-top: var(--space-3); }
|
|
634
|
+
/* --surface-3 barely steps off the raised drawer ground in dark, so a hovered row there takes
|
|
635
|
+
--surface, as a menu item does. Light keeps the grey. The drawer adds no weight, so a
|
|
636
|
+
checked row keeps its own stronger wash under the pointer. */
|
|
637
|
+
:where(.ui-drawer .ui-drawer__section) .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); }
|
|
638
|
+
:where(:root[data-theme="light"] .ui-drawer .ui-drawer__section) .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); }
|
|
609
639
|
|
|
610
640
|
/* On a phone the cells pad by space-3 across and a card's end cells by space-4. A wide
|
|
611
641
|
table scrolls under a finger, so the frame shows no scrollbar. 560px is the kit's phone
|
package/src/tokens/tokens.css
CHANGED
|
@@ -667,6 +667,10 @@
|
|
|
667
667
|
.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); }
|
|
668
668
|
.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),
|
|
669
669
|
.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); }
|
|
670
|
+
/* A hovered row in a drawer group takes --surface in dark, so a chip there keeps the page.
|
|
671
|
+
The drawer adds no weight, so a checked row keeps the hand-off above. */
|
|
672
|
+
:where(.ui-drawer .ui-drawer__section) .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(--bg); }
|
|
673
|
+
:where(:root[data-theme="light"] .ui-drawer .ui-drawer__section) .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); }
|
|
670
674
|
.ui-card--accent,
|
|
671
675
|
.ui-card--live,
|
|
672
676
|
.ui-snippet--reveal { --code-bg: var(--surface); }
|