@apliteni/apliteni-ui 0.175.0 → 0.178.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 +60 -16
- package/docs/foundations.md +29 -2
- package/guidelines/INDEX.md +1 -1
- package/guidelines/button-labels.md +14 -0
- package/guidelines/colour-and-theming.md +2 -2
- package/guidelines/component-choice.md +0 -14
- package/guidelines/dense-tables.md +16 -2
- package/guidelines/iconography.md +1 -1
- package/guidelines/the-page.md +1 -1
- package/package.json +1 -1
- package/react/dist/index.css +12 -2
- package/react/dist/index.d.ts +13 -2
- package/react/dist/index.js +74 -29
- package/src/assets/icons.js +4 -0
- package/src/styles/button.css +3 -3
- package/src/styles/drawer.css +7 -0
- package/src/styles/dropdown.css +11 -8
- package/src/styles/feedback.css +1 -1
- package/src/styles/filter-bar.css +23 -4
- package/src/styles/input.css +22 -3
- package/src/styles/layout.css +52 -5
- package/src/styles/pagination.css +2 -2
- package/src/styles/segmented.css +6 -7
- package/src/styles/table.css +14 -0
- package/src/styles/tap-zone.css +10 -0
- package/src/styles/topbar.css +12 -10
package/docs/components.md
CHANGED
|
@@ -409,8 +409,9 @@ two-pixel band. A row that reaches the panel edges draws the ring on the panel b
|
|
|
409
409
|
outside it. The panel has only two choices: **keep the three pixels inside the panel as padding,
|
|
410
410
|
so the ring appears in the padding; or do not clip at the panel edge, so the ring crosses it.**
|
|
411
411
|
If the panel does neither, it cuts off the ring and leaves the reader with two accent bars.
|
|
412
|
-
`.ui-dropdown__panel
|
|
413
|
-
|
|
412
|
+
`.ui-dropdown__panel`, the top bar's version menu and the account menu use the first choice.
|
|
413
|
+
A menu row draws its ring inward, inside its own corner, so the ring never touches the
|
|
414
|
+
panel edge or a divider.
|
|
414
415
|
|
|
415
416
|
### A filter row holds its panels
|
|
416
417
|
|
|
@@ -515,6 +516,12 @@ item has `href`. It never emits a `<button>`. A row that must be a real button i
|
|
|
515
516
|
[one you write yourself](#a-dropdown-row-you-write-yourself). **A destructive row stays quiet
|
|
516
517
|
and turns `--pink` on the way to being pressed**, in both hover and focus.
|
|
517
518
|
|
|
519
|
+
**Every menu row answers the pointer with a fill and draws no edge.** Only keyboard focus draws
|
|
520
|
+
the band, inside the row and on the row's corner. A row in a menu that you style yourself keeps
|
|
521
|
+
the `.ui-dropdown__item` class, so it takes the same hover, focus and forced-colour rules. A
|
|
522
|
+
menu head that reaches the panel edge keeps a 5px gap above the first row. In forced colours a
|
|
523
|
+
separator stays a visible 1px line.
|
|
524
|
+
|
|
518
525
|
### A submenu row
|
|
519
526
|
|
|
520
527
|
A row that opens a submenu carries `aria-haspopup="menu"` and `aria-expanded`. It ends in
|
|
@@ -564,7 +571,9 @@ must have a search field is a rule rather than a recommendation:
|
|
|
564
571
|
A drawer is a panel against one edge of the screen. It appears over a scrim. It lets the reader
|
|
565
572
|
look at or change one thing without leaving the list that opened it. **It groups by heading, never
|
|
566
573
|
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. **
|
|
574
|
+
then hears each label with its value. **An icon button at the end of a value, such as a copy
|
|
575
|
+
button, sits on the value's line**, and its row keeps a text row's height. On a phone it reaches
|
|
576
|
+
the 44px tap target. **Groups stand 32px apart, with no line between them.**
|
|
568
577
|
Each group heading stands on a 1px `--border` line, the same line as a table head. **A record can
|
|
569
578
|
lead with its key figure:** put a `<dl class="ui-drawer__figure">` in a group with no heading, as
|
|
570
579
|
the first group. Its `<dt>` is the label, and its `<dd>` holds a `.ui-drawer__figure-value`, set at
|
|
@@ -930,7 +939,7 @@ has no radius, so **the card paints that ring instead**.
|
|
|
930
939
|
|
|
931
940
|
### A toolbar at one column
|
|
932
941
|
|
|
933
|
-
A toolbar above a list opens with a search box, followed by its filters and then its view switch.
|
|
942
|
+
A toolbar above a list opens with a search box, followed by its filters and then its view switch. A create action stands on its own row above the toolbar, at the left.
|
|
934
943
|
`.ui-toolbar` gives its text field a `6rem` flex basis. The row breaks only when the field would
|
|
935
944
|
be squeezed below that size. At `560px`, that basis would become the field's size rather than its
|
|
936
945
|
floor. So at that width the field uses `flex-basis: 100%`. It takes the full line, and the rest
|
|
@@ -939,10 +948,21 @@ of the row wraps below it.
|
|
|
939
948
|
A title without an introduction keeps a 32px gap before the page body.
|
|
940
949
|
A control row directly inside the page body, a `.ui-card-stack` or a `.ui-stack` sits one inner gap, 8px, above the block it controls. On a touch phone below `560px`, that gap is 20px.
|
|
941
950
|
Use `.ui-toolbar--split` to place the final control at the row's end. On a phone, it stays in that row beside the control before it, rather than dropping to its own line.
|
|
951
|
+
Every control on a toolbar line takes the line's height, so a button beside a field or a filter chip has the same top and bottom edge. Put a button and a field that share a row in `.ui-toolbar`, and change neither control's size.
|
|
952
|
+
|
|
953
|
+
**A toolbar that opens with a small search field is a small row.** With a mouse, its filter
|
|
954
|
+
chips, the add control and Clear all stand at 32px, level with the field, a dropdown trigger, a
|
|
955
|
+
small Segmented and a small button. Give the Segmented and the button `size="sm"` yourself. The
|
|
956
|
+
small search field stops at `--panel-sm`, 320px, and the free width goes before the last
|
|
957
|
+
control. A full-size search field still takes the free width. At `560px` and below, each search
|
|
958
|
+
field takes the full line. On a touch screen the row is 40px, a chip's height: the field keeps
|
|
959
|
+
16px text, and a chip, Clear all, a dropdown trigger, the Segmented and the button are 40px on
|
|
960
|
+
every line of the row. At both sizes, the text and the glyphs of the row share one vertical centre,
|
|
961
|
+
within about 1.5px.
|
|
942
962
|
|
|
943
963
|
### Segmented strips that outgrow their column
|
|
944
964
|
|
|
945
|
-
The enabled selected pill uses
|
|
965
|
+
The enabled selected pill uses the primary button's accent fill and label ink, with a thin accent edge that marks it wherever that fill is faint on the track. A disabled or underline selection has no edge. A disabled selected pill keeps a quiet fill and disabled ink. Only keyboard focus draws an outline.
|
|
946
966
|
|
|
947
967
|
A pill strip lays out its choices in one row while they fit. When they do not fit, the choices
|
|
948
968
|
wrap onto further rows. **It never widens past its container:** a twelve-month picker in a phone
|
|
@@ -998,8 +1018,14 @@ vanilla sections above.
|
|
|
998
1018
|
### React tables
|
|
999
1019
|
|
|
1000
1020
|
Tables fill their container by default. Inside `.ui-card--fit`, tables size to their content.
|
|
1001
|
-
A `.ui-table__title` cell gives a text column the remaining width. A
|
|
1002
|
-
|
|
1021
|
+
A `.ui-table__title` cell gives a text column the remaining width. **A title cell is never narrower
|
|
1022
|
+
than 20 characters**, or a pinned column's ceiling, so a table wider than its frame scrolls and a
|
|
1023
|
+
two-word name in a pinned column stays on one line. A column takes `cell` for it:
|
|
1024
|
+
`title`, `code`, `long`, `strong` or `act`. **A column's `width`, such as `'12ch'`, holds while
|
|
1025
|
+
the rows reload or are empty**, so the columns do not move when data arrives; longer content still
|
|
1026
|
+
widens it. The columns with no `width` share the free room, so set the narrow columns and leave the
|
|
1027
|
+
title column unset to keep it the widest. When the set widths and a title column's 20 characters add up to more than the table, the
|
|
1028
|
+
columns share the room by their content, so the edges can move on a narrow screen. `rowHeader` renders the column's body cells as `th scope="row"`.
|
|
1003
1029
|
`DataTable` takes the vanilla hooks as props: `zebra`, `hover` (on unless `false`), `density`
|
|
1004
1030
|
(`dense`, `compact` or `comfortable`),
|
|
1005
1031
|
`stickyHeader` and `pinnedIdentity`. **`pinnedIdentity: true` pins column 0; a column key pins that column**,
|
|
@@ -1115,6 +1141,13 @@ the control's only name**, because no label appears in the row. It declares no C
|
|
|
1115
1141
|
toolbar's row rule and the field's focus ring therefore reach it from the kit's stylesheet.
|
|
1116
1142
|
**There is no clear button**, because the browser paints its own near-black button on the light
|
|
1117
1143
|
field and white button on the dark one.
|
|
1144
|
+
**`size="sm"` is the field above a dense table.** With a mouse it is 32px high with `--text-sm`, the
|
|
1145
|
+
text of the dense rows, and the pill corner. Without `size`, the field keeps its full size. At every
|
|
1146
|
+
size, the leading glyph sits on the vertical centre of the text and the caret. A `TextField` glyph
|
|
1147
|
+
does the same. On a touch screen a
|
|
1148
|
+
small field is 40px with 16px text, because iOS zooms into a field with smaller text. Only `SearchField` takes a size: `TextField` and `SelectField` keep
|
|
1149
|
+
one size, because a form keeps the full size. See
|
|
1150
|
+
[A toolbar at one column](#a-toolbar-at-one-column).
|
|
1118
1151
|
|
|
1119
1152
|
### React date and month picker
|
|
1120
1153
|
|
|
@@ -1140,8 +1173,12 @@ and loses only the tint. **Blocked beats every other state in the paint, and its
|
|
|
1140
1173
|
through.** **Hover is the kit's row hover**, not a tint of the accent. **The current period is a
|
|
1141
1174
|
ring**, a hairline in the accent, and it stands aside while the cell holds focus, so a focused
|
|
1142
1175
|
current period draws one band and not two. **Nothing is drawn under the grid:** no legend and no per-period
|
|
1143
|
-
swatch. **Below 560px the panel is a sheet, and a sheet is the kit's drawer
|
|
1144
|
-
|
|
1176
|
+
swatch. **Below 560px the panel is a sheet, and a sheet is the kit's drawer**. **Inside a `Field`,
|
|
1177
|
+
the sheet's title is the field's label**, because the sheet covers the field. An `ariaLabel` wins
|
|
1178
|
+
over the label, and outside a `Field` the placeholder is the title. The trigger's name is
|
|
1179
|
+
that label or `ariaLabel` and then the value it shows, such as "Due date, August 2026". **In a `Modal`, the open panel draws over the dialog's edge**,
|
|
1180
|
+
below the field, or above it where there is more room, and scrolls inside itself when neither
|
|
1181
|
+
side holds it. Below the phone step the gap between weeks opens to reach the 44px tap floor. Its one breakpoint literal is one of
|
|
1145
1182
|
the steps in [Breakpoints](foundations.md#breakpoints).
|
|
1146
1183
|
|
|
1147
1184
|
### React file drop
|
|
@@ -1322,7 +1359,7 @@ The button and tick follow `value` until the caller updates it. `AccountMenu` ma
|
|
|
1322
1359
|
Tab stop whatever the choice is.** Arrow keys wrap past disabled options; Home and End reach
|
|
1323
1360
|
the first and last enabled choice. `block` fills the container with either appearance. An
|
|
1324
1361
|
option's `icon` names a kit glyph drawn before its label. With `iconOnly`, the glyph is the
|
|
1325
|
-
whole button and the label becomes its accessible name.
|
|
1362
|
+
whole button and the label becomes its accessible name and its hover title.
|
|
1326
1363
|
**`size="sm"` compacts the pill appearance only:** under the underline appearance it changes
|
|
1327
1364
|
the type size and leaves the tab at its full height.
|
|
1328
1365
|
- **`Confirm`** builds on `Modal` as an `alertdialog`. It focuses the safe action and draws it
|
|
@@ -1338,8 +1375,9 @@ The button and tick follow `value` until the caller updates it. `AccountMenu` ma
|
|
|
1338
1375
|
account at the rail foot and leaves only Sign out in its menu. It shows no section counts.
|
|
1339
1376
|
Pass `back` to show the way up from a subpage, above the page title.
|
|
1340
1377
|
**`tools` puts small tools for the whole page at the end of the title row** (#736), such as
|
|
1341
|
-
a version badge or a `size="sm"` button. The lede stands under the whole row.
|
|
1342
|
-
not
|
|
1378
|
+
a version badge, a period picker or a `size="sm"` button. The lede stands under the whole row.
|
|
1379
|
+
**Tools that do not fit beside the title go under it**, so a period picker and a view action
|
|
1380
|
+
can stay on a 390px phone. `actions` keeps
|
|
1343
1381
|
the page's buttons in their own row under the title.
|
|
1344
1382
|
**`accountItems` adds a product's rows, such as Account settings and Support, at the top of
|
|
1345
1383
|
every account menu,** above the Theme row and Sign out. A row takes `href` to go somewhere,
|
|
@@ -1412,7 +1450,12 @@ The button and tick follow `value` until the caller updates it. `AccountMenu` ma
|
|
|
1412
1450
|
its description; the label stays the box's name. **`CheckList` groups `Checkbox` children in a
|
|
1413
1451
|
fieldset under a legend** set in the field label's type. A disabled box dims its hint with its label.
|
|
1414
1452
|
- **`Snippet`** displays `code` as plain text, and **copying always writes the original `code`
|
|
1415
|
-
string**, whatever `children` displays.
|
|
1453
|
+
string**, whatever `children` displays. **`Snippet` is a block of code, not the only way to
|
|
1454
|
+
copy.** To copy an identifier where it stands, in a drawer row or a table cell, put an
|
|
1455
|
+
icon-only `Button` with the `copy` glyph beside it, such as
|
|
1456
|
+
`<Button variant="ghost" size="sm" icon="copy" iconOnly>Copy INV-1162</Button>`. Its words
|
|
1457
|
+
become its accessible name and its hover title. Swap the glyph to `check` for a moment after
|
|
1458
|
+
the copy, as `Snippet` does.
|
|
1416
1459
|
- **`EmptyState`** uses the vanilla markup and CSS, and **the page supplies its own `h1`.**
|
|
1417
1460
|
- **`ThemeToggle`** cycles through dark, light, auto, then dark. It stores explicit choices
|
|
1418
1461
|
and follows the OS otherwise. It sets `data-theme-choice` and the resolved `data-theme` on
|
|
@@ -1484,13 +1527,14 @@ dropdown's `id` sits on a wrapper that a label cannot name. The label and then t
|
|
|
1484
1527
|
the trigger, the error or hint describes it, and an error marks it invalid. The list is named by the
|
|
1485
1528
|
label unless you give it an `ariaLabel`. A control outside a `field()` needs its own `ariaLabel`. A
|
|
1486
1529
|
placeholder is not a name. **In a field, a dropdown trigger has the shape of a text input.** It
|
|
1487
|
-
|
|
1488
|
-
height. Its side padding is 16px, 1px more than the input's. On a touch screen its text is a
|
|
1530
|
+
has the input's pill corner, its top and bottom padding and its type size, so the two have the
|
|
1531
|
+
same height. Its side padding is 16px, 1px more than the input's. On a touch screen its text is a
|
|
1489
1532
|
fixed 16px, as the input's is, also when the host changes `--text-base`. A long value stays on
|
|
1490
1533
|
one line, starts at the left and ends with an ellipsis, as in a select, so the trigger keeps the
|
|
1491
1534
|
input's height at every value length. A person mark stands as far from the left edge as from the
|
|
1492
1535
|
top and bottom edges. A date picker in a field does the same. Outside a field, for example in a
|
|
1493
|
-
filter bar, a toolbar or the topbar, the trigger
|
|
1536
|
+
filter bar, a toolbar or the topbar, the trigger is the same pill. See
|
|
1537
|
+
[Control corners](foundations.md#control-corners).
|
|
1494
1538
|
Put a form on a card, not on the page ground. A field is drawn by its edge, but the page ground
|
|
1495
1539
|
is too close to the field's own fill for you to see that edge. See
|
|
1496
1540
|
[Colour and contrast](foundations.md#colour-and-contrast). **A filter bar is the one exception.**
|
package/docs/foundations.md
CHANGED
|
@@ -68,6 +68,27 @@ and the next. On a touch phone the inner gap of a group of small controls is `--
|
|
|
68
68
|
and the view strip wraps its rows `--space-1` (4px) apart. A control that draws no box starts its
|
|
69
69
|
first label on the page title's edge.
|
|
70
70
|
|
|
71
|
+
## Control corners
|
|
72
|
+
|
|
73
|
+
**Every control that a reader presses or types into is a pill.** This covers each button size,
|
|
74
|
+
each dropdown trigger, also in a form, a filter chip and the filter bar's add control, a search
|
|
75
|
+
field, a text field, a select and every other one-line field. The corner is `--radius-pill`. A
|
|
76
|
+
wordless button is square, so the pill makes it a circle. In a toolbar beside a full field or a filter
|
|
77
|
+
bar, a wordless button takes the row's height and stays a circle. A dropdown in a form and the text input
|
|
78
|
+
beside it have the same corner and the same height. The kit's padding keeps text, glyphs, units
|
|
79
|
+
and the focus ring inside the rounded edge. Give a control of your own the same corner.
|
|
80
|
+
|
|
81
|
+
These parts keep another corner:
|
|
82
|
+
|
|
83
|
+
- A text area keeps `--radius-md`, because a pill does not fit several lines.
|
|
84
|
+
- A segmented strip keeps its own rounded track.
|
|
85
|
+
- A menu row, a palette row and a date picker's day cell keep their small corner. They are rows
|
|
86
|
+
and cells in a panel, not controls on the page.
|
|
87
|
+
- The account row in the side rail keeps the corner of the rail rows.
|
|
88
|
+
- The search line of the command palette is the top edge of the palette, so it follows the
|
|
89
|
+
palette's corners.
|
|
90
|
+
- A file drop area keeps its large dashed corner. The button in it is a pill.
|
|
91
|
+
|
|
71
92
|
## Typefaces
|
|
72
93
|
|
|
73
94
|
The kit uses two families, and the split is based on role:
|
|
@@ -283,8 +304,10 @@ is the named exception. It uses a soft fill, and neutral chip tones use
|
|
|
283
304
|
floating panel in dark and vanished on a white card in light.
|
|
284
305
|
|
|
285
306
|
**A selected item is the one exception.** Selection is marked by a background highlight. An
|
|
286
|
-
enabled chosen segmented pill
|
|
287
|
-
|
|
307
|
+
enabled chosen segmented pill takes the primary button's pair, `--accent-strong` with
|
|
308
|
+
`--accent-contrast` ink, and a 1px `--accent` edge. Where the fill is under 3:1 on the track, as
|
|
309
|
+
under the default accent in dark, the edge is the mark. A disabled chosen pill and an underline tab
|
|
310
|
+
take no edge. A disabled chosen pill keeps `--surface-3` and the disabled
|
|
288
311
|
ink.
|
|
289
312
|
|
|
290
313
|
**What floats depends on the surface's job, not on its rung.** A floating surface has the
|
|
@@ -436,6 +459,10 @@ zoom back out.
|
|
|
436
459
|
A bare `input { font-size: 20px !important; }` has the same specificity as the net. It works
|
|
437
460
|
only while your stylesheet loads after the kit's.
|
|
438
461
|
|
|
462
|
+
**A small field is the full field on a touch screen.** With a mouse, `SearchField size="sm"` is
|
|
463
|
+
32px high with `--text-sm`. On a touch screen it is 40px high with 16px text, and its toolbar
|
|
464
|
+
and a create row above it stand the same height. So the small size never takes a field under 16px.
|
|
465
|
+
|
|
439
466
|
## A tap reaches the floor below the phone step
|
|
440
467
|
|
|
441
468
|
A finger covers more area than a cursor. Below the phone step, the kit's own small controls
|
package/guidelines/INDEX.md
CHANGED
|
@@ -14,7 +14,7 @@ Each row names one guideline page, the screen parts it covers, and when to read
|
|
|
14
14
|
| [Microcopy and tone](microcopy.md) | Names for controls and their current state. | Read it before you name controls or states. |
|
|
15
15
|
| [Text length](text-length.md) | Labels, buttons, captions, callouts and introductions. | Read it when you write labels, captions or callouts. |
|
|
16
16
|
| [Labels and titles](labels-and-titles.md) | Text ink, sentence case, card titles and eyebrows. | Read it when you write labels, titles or eyebrows. |
|
|
17
|
-
| [Button labels](button-labels.md) | Button words, glyphs and
|
|
17
|
+
| [Button labels](button-labels.md) | Button words, glyphs, wordless buttons and the one shape of every control. | Read it before you write button words, add glyphs or draw a control. |
|
|
18
18
|
| [Iconography](iconography.md) | Icon-only controls, status glyphs and glyph paths. | Read it before you use a glyph or an icon-only control. |
|
|
19
19
|
| [Layout and density](layout-and-density.md) | Page width, the reading column, the spacing scale and breakpoints. | Read it before you set page width, columns or breakpoints. |
|
|
20
20
|
| [Spacing](spacing.md) | Page gaps, title placement and the text edge. | Read it before you set gaps on a page. |
|
|
@@ -45,3 +45,17 @@
|
|
|
45
45
|
**Do:** An Add note button under the clause opens the note form.
|
|
46
46
|
|
|
47
47
|
**Don't:** A toolbar that appears over the selected words.
|
|
48
|
+
|
|
49
|
+
## Give every control one shape
|
|
50
|
+
|
|
51
|
+
<!-- rule: one-shape -->
|
|
52
|
+
|
|
53
|
+
**Rule:** Draw buttons, dropdowns, filter chips and one-line fields as pills, and a wordless button as a circle.
|
|
54
|
+
|
|
55
|
+
**Why:** One shape marks what a reader can use.
|
|
56
|
+
|
|
57
|
+
**Except:** A text area keeps a small corner, because a pill does not fit several lines.
|
|
58
|
+
|
|
59
|
+
**Do:** Search, status and buttons, all pills.
|
|
60
|
+
|
|
61
|
+
**Don't:** A square button and field beside a round dropdown.
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
|
|
39
39
|
**Don't:** Use `--accent` as ground.
|
|
40
40
|
|
|
41
|
-
**Except:** Only Nebula gives the two tokens different values.
|
|
41
|
+
**Except:** Only Nebula gives the two tokens different values. A dark selected Segmented pill adds an `--accent` edge to its `--accent-strong` ground (#832).
|
|
42
42
|
|
|
43
43
|
<!-- rule: accent-strong -->
|
|
44
44
|
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
|
|
55
55
|
**Don't:** Add a second accent mark, such as an accent counter, to a selected tab.
|
|
56
56
|
|
|
57
|
-
**Except:** NavTabs pills keep accent ink on soft fill
|
|
57
|
+
**Except:** NavTabs pills keep accent ink on soft fill, as fill alone is too faint (#429). A Segmented pill's edge belongs to its fill.
|
|
58
58
|
|
|
59
59
|
## Theme checks
|
|
60
60
|
|
|
@@ -68,20 +68,6 @@
|
|
|
68
68
|
|
|
69
69
|
**Don't:** Open that drawer across the page from its button.
|
|
70
70
|
|
|
71
|
-
## Group one category at a time
|
|
72
|
-
|
|
73
|
-
<!-- rule: one-category -->
|
|
74
|
-
|
|
75
|
-
**Rule:** Give views, filters, sorting and actions separate groups and styles.
|
|
76
|
-
|
|
77
|
-
**Why:** Identical controls in one bar hide that one of them re-draws every row while its neighbour only narrows them.
|
|
78
|
-
|
|
79
|
-
**Do:** Keep the filter chips in one bar, the views in a strip of their own, and the action at the right-hand end.
|
|
80
|
-
|
|
81
|
-
**Don't:** Put three saved views and a filter control in one bar as four buttons of the same size and style.
|
|
82
|
-
|
|
83
|
-
**Except:** Saved views that re-draw one table take a segmented strip; views that swap panels take tabs.
|
|
84
|
-
|
|
85
71
|
## Match confirmation scale
|
|
86
72
|
|
|
87
73
|
<!-- rule: scale -->
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
|
|
59
59
|
**Rule:** Keep units smaller and in body ink.
|
|
60
60
|
|
|
61
|
-
**Do:**
|
|
61
|
+
**Do:** Explain abbreviations in reachable text.
|
|
62
62
|
|
|
63
63
|
**Don't:** Hide units in muted text or make readers guess what an abbreviation means.
|
|
64
64
|
|
|
@@ -122,7 +122,7 @@
|
|
|
122
122
|
|
|
123
123
|
**Rule:** Keep the table stable while results update.
|
|
124
124
|
|
|
125
|
-
**Do:** Retain rows while refreshing, report busy state, distinguish no data from no matches and errors, and preserve focus when filters change.
|
|
125
|
+
**Do:** Retain rows and column widths while refreshing, report busy state, distinguish no data from no matches and errors, and preserve focus when filters change.
|
|
126
126
|
|
|
127
127
|
**Don't:** Replace the table with a blank state or move focus without telling the reader why.
|
|
128
128
|
|
|
@@ -139,3 +139,17 @@
|
|
|
139
139
|
**Don't:** Leave rows that the reader cannot narrow.
|
|
140
140
|
|
|
141
141
|
**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.
|
|
142
|
+
|
|
143
|
+
## Size the bar to the rows
|
|
144
|
+
|
|
145
|
+
<!-- rule: control-size -->
|
|
146
|
+
|
|
147
|
+
**Why:** A full-size field is the largest part of a dense block.
|
|
148
|
+
|
|
149
|
+
**Rule:** Use small controls above a dense table, and full-size controls in a form.
|
|
150
|
+
|
|
151
|
+
**Do:** Put a small search field, segmented control, chips and button above dense rows.
|
|
152
|
+
|
|
153
|
+
**Don't:** Put a full-size field above dense rows.
|
|
154
|
+
|
|
155
|
+
**Except:** Tabs keep one size, and touch controls stand a chip's height.
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
**Why:** Without a legend, readers need labels for unfamiliar glyphs.
|
|
10
10
|
|
|
11
|
-
**Except:** New entries require a decision and pass Earn a wordless button on Button labels. Allowed: close, copy, overflow, expand, collapse and export. Theme and sidebar toggles and collapsed-rail links have separate approval. Owner additions:
|
|
11
|
+
**Except:** New entries require a decision and pass Earn a wordless button on Button labels. Allowed: close, copy, overflow, expand, collapse and export. Theme and sidebar toggles and collapsed-rail links have separate approval. Owner additions: Table beside Chart or Board ([#742](https://github.com/apliteni/apliteni-ui/issues/742), [#832](https://github.com/apliteni/apliteni-ui/issues/832)), a React AppShell search trigger below 560px for one light icon row ([#729](https://github.com/apliteni/apliteni-ui/issues/729)), and a notifications bell with its count ([#798](https://github.com/apliteni/apliteni-ui/issues/798)). The last two are named by their sentence: phones have no hover title.
|
|
12
12
|
|
|
13
13
|
**Do:** A wordless overflow menu and a labelled Settings.
|
|
14
14
|
|
package/guidelines/the-page.md
CHANGED
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
|
|
37
37
|
**Don't:** Put filters above the title.
|
|
38
38
|
|
|
39
|
-
**Except:** Small tools for the whole page, such as a version badge, stand at the end of the title row.
|
|
39
|
+
**Except:** Small tools for the whole page, such as a version badge, a period picker or a view action, stand at the end of the title row.
|
|
40
40
|
|
|
41
41
|
## Use one page title
|
|
42
42
|
|
package/package.json
CHANGED
package/react/dist/index.css
CHANGED
|
@@ -118,6 +118,11 @@
|
|
|
118
118
|
--tap-clear-x: var(--tap-gap);
|
|
119
119
|
--tap-clear-y: var(--tap-gap);
|
|
120
120
|
}
|
|
121
|
+
.ui-app__tools {
|
|
122
|
+
gap: var(--tap-gap) !important;
|
|
123
|
+
--tap-clear-x: var(--tap-gap);
|
|
124
|
+
--tap-clear-y: var(--tap-gap);
|
|
125
|
+
}
|
|
121
126
|
.ui-table__selection {
|
|
122
127
|
--tap-clear-x: var(--tap-min);
|
|
123
128
|
--tap-clear-y: var(--tap-min);
|
|
@@ -158,6 +163,10 @@
|
|
|
158
163
|
--tap-clear-x: var(--space-1, 4px);
|
|
159
164
|
--tap-clear-y: var(--tap-gap-bordered);
|
|
160
165
|
}
|
|
166
|
+
.ui-drawer__row > dd {
|
|
167
|
+
--tap-clear-x: var(--tap-gap);
|
|
168
|
+
--tap-clear-y: var(--tap-gap);
|
|
169
|
+
}
|
|
161
170
|
.ui-footer__socials,
|
|
162
171
|
.ui-drawer__header {
|
|
163
172
|
gap: var(--tap-gap) !important;
|
|
@@ -556,6 +565,7 @@
|
|
|
556
565
|
min-width: 34px;
|
|
557
566
|
min-height: 34px;
|
|
558
567
|
padding: var(--space-2);
|
|
568
|
+
font-family: inherit;
|
|
559
569
|
font-size: var(--text-sm);
|
|
560
570
|
font-weight: var(--weight-medium);
|
|
561
571
|
font-variant-numeric: tabular-nums;
|
|
@@ -1278,7 +1288,7 @@
|
|
|
1278
1288
|
height: var(--ui-head-control-h, calc(18px + 1.2 * var(--text-base)));
|
|
1279
1289
|
padding: 0;
|
|
1280
1290
|
border: 0;
|
|
1281
|
-
border-radius:
|
|
1291
|
+
border-radius: var(--radius-pill);
|
|
1282
1292
|
background: none;
|
|
1283
1293
|
color: var(--text);
|
|
1284
1294
|
transform: none;
|
|
@@ -1378,7 +1388,7 @@
|
|
|
1378
1388
|
padding: 0;
|
|
1379
1389
|
margin: 0;
|
|
1380
1390
|
border: 0;
|
|
1381
|
-
border-radius: var(--radius-
|
|
1391
|
+
border-radius: var(--radius-pill);
|
|
1382
1392
|
background: transparent;
|
|
1383
1393
|
}
|
|
1384
1394
|
.ui-react-app .ui-app__bar .ui-app__search:hover,
|
package/react/dist/index.d.ts
CHANGED
|
@@ -327,6 +327,11 @@ type Column<T> = {
|
|
|
327
327
|
rowHeader?: boolean;
|
|
328
328
|
/** `title` gives the column the remaining width, `code` sets a handle or id in the table's small text, `long` is running text that wraps in a column wide enough to read, `strong` bolds a figure, `act` right-aligns a row action. */
|
|
329
329
|
cell?: 'title' | 'code' | 'long' | 'strong' | 'act';
|
|
330
|
+
/**
|
|
331
|
+
* The column's set width, such as `'12ch'` or `'160px'`. The column keeps it while the rows
|
|
332
|
+
* change, so a reload does not move the columns. Longer content still widens it. #832
|
|
333
|
+
*/
|
|
334
|
+
width?: string;
|
|
330
335
|
};
|
|
331
336
|
type TableSort<T> = {
|
|
332
337
|
key: (keyof T & string) | undefined;
|
|
@@ -893,10 +898,13 @@ type FileDropProps = {
|
|
|
893
898
|
};
|
|
894
899
|
declare function FileDrop({ label, note, title, multiple, accept, dropLabel, removeLabel, retryLabel, file, dragging, disabled, onFile, onFiles, onRemove, onRetry, children, className, }: FileDropProps): react.JSX.Element;
|
|
895
900
|
|
|
896
|
-
type SearchFieldProps = Omit<InputHTMLAttributes<HTMLInputElement>, 'type' | 'aria-label'> & {
|
|
901
|
+
type SearchFieldProps = Omit<InputHTMLAttributes<HTMLInputElement>, 'type' | 'aria-label' | 'size'> & {
|
|
897
902
|
/** The control's name. A toolbar search box shows no label, so this is the
|
|
898
903
|
only name it has. */
|
|
899
904
|
ariaLabel: string;
|
|
905
|
+
/** `sm` is the toolbar above a dense table: 32px with 13px text to a mouse, and
|
|
906
|
+
the full field on a touch screen. */
|
|
907
|
+
size?: 'sm';
|
|
900
908
|
};
|
|
901
909
|
/**
|
|
902
910
|
* The toolbar's search box: one `.ui-input-group` holding the `search` glyph and
|
|
@@ -910,10 +918,13 @@ type SearchFieldProps = Omit<InputHTMLAttributes<HTMLInputElement>, 'type' | 'ar
|
|
|
910
918
|
* only one answers to a token — so `input.css` suppresses it.
|
|
911
919
|
* why: docs/components.md#react-search-field
|
|
912
920
|
*/
|
|
913
|
-
declare const SearchField: react.ForwardRefExoticComponent<Omit<InputHTMLAttributes<HTMLInputElement>, "type" | "aria-label"> & {
|
|
921
|
+
declare const SearchField: react.ForwardRefExoticComponent<Omit<InputHTMLAttributes<HTMLInputElement>, "type" | "size" | "aria-label"> & {
|
|
914
922
|
/** The control's name. A toolbar search box shows no label, so this is the
|
|
915
923
|
only name it has. */
|
|
916
924
|
ariaLabel: string;
|
|
925
|
+
/** `sm` is the toolbar above a dense table: 32px with 13px text to a mouse, and
|
|
926
|
+
the full field on a touch screen. */
|
|
927
|
+
size?: "sm";
|
|
917
928
|
} & react.RefAttributes<HTMLInputElement>>;
|
|
918
929
|
|
|
919
930
|
type ToastNotice = {
|
package/react/dist/index.js
CHANGED
|
@@ -2209,6 +2209,7 @@ function DataTable({
|
|
|
2209
2209
|
hasMore = false
|
|
2210
2210
|
}) {
|
|
2211
2211
|
const scrollable = stickyHeader || pinnedIdentity;
|
|
2212
|
+
const sized = columns.some((c) => c.width);
|
|
2212
2213
|
const table = useRef13(null);
|
|
2213
2214
|
const [pagerHost, setPagerHost] = useState10(null);
|
|
2214
2215
|
const holdPagerBox = useCallback4(
|
|
@@ -2298,6 +2299,10 @@ function DataTable({
|
|
|
2298
2299
|
"aria-busy": loading || void 0,
|
|
2299
2300
|
children: [
|
|
2300
2301
|
caption ? /* @__PURE__ */ jsx23("caption", { className: "ui-sr", children: caption }) : null,
|
|
2302
|
+
sized ? /* @__PURE__ */ jsxs19("colgroup", { children: [
|
|
2303
|
+
selectable ? /* @__PURE__ */ jsx23("col", {}) : null,
|
|
2304
|
+
columns.map((c) => /* @__PURE__ */ jsx23("col", { style: c.width ? { width: c.width } : void 0 }, c.key))
|
|
2305
|
+
] }) : null,
|
|
2301
2306
|
/* @__PURE__ */ jsx23("thead", { children: /* @__PURE__ */ jsxs19("tr", { children: [
|
|
2302
2307
|
selectable ? /* @__PURE__ */ jsx23("th", { scope: "col", className: "ui-table__selection", children: /* @__PURE__ */ jsx23(
|
|
2303
2308
|
"input",
|
|
@@ -2353,14 +2358,20 @@ function DataTable({
|
|
|
2353
2358
|
) }) : null,
|
|
2354
2359
|
columns.map((c, columnIndex) => {
|
|
2355
2360
|
const Cell = c.rowHeader ? "th" : "td";
|
|
2356
|
-
return
|
|
2357
|
-
|
|
2358
|
-
|
|
2359
|
-
|
|
2360
|
-
|
|
2361
|
-
|
|
2362
|
-
|
|
2363
|
-
|
|
2361
|
+
return (
|
|
2362
|
+
// A set width lives on the col alone. In a table with a set width, a title
|
|
2363
|
+
// cell gives up its claim on the rest of the row, so the edges hold when the
|
|
2364
|
+
// rows arrive: the free room goes to the unsized columns in both states. #832
|
|
2365
|
+
/* @__PURE__ */ jsx23(
|
|
2366
|
+
Cell,
|
|
2367
|
+
{
|
|
2368
|
+
scope: c.rowHeader ? "row" : void 0,
|
|
2369
|
+
style: c.width || sized && c.cell === "title" ? { width: "auto" } : void 0,
|
|
2370
|
+
className: [c.num && "ui-table__num", c.cell && CELL_CLASS[c.cell], pinnedColumn(pinnedIdentity, c.key, columnIndex) && "ui-table__identity", c.linked && "ui-table__linked"].filter(Boolean).join(" ") || void 0,
|
|
2371
|
+
children: c.render ? c.render(r) : String(r[c.key])
|
|
2372
|
+
},
|
|
2373
|
+
c.key
|
|
2374
|
+
)
|
|
2364
2375
|
);
|
|
2365
2376
|
})
|
|
2366
2377
|
]
|
|
@@ -2483,12 +2494,19 @@ function Denied({
|
|
|
2483
2494
|
// src/DatePicker.tsx
|
|
2484
2495
|
import {
|
|
2485
2496
|
useCallback as useCallback5,
|
|
2497
|
+
useContext as useContext2,
|
|
2486
2498
|
useEffect as useEffect12,
|
|
2487
2499
|
useMemo as useMemo4,
|
|
2488
2500
|
useRef as useRef14,
|
|
2489
2501
|
useState as useState11
|
|
2490
2502
|
} from "react";
|
|
2491
2503
|
import { dropdownRest, dropdownViewportFit } from "@apliteni/apliteni-ui";
|
|
2504
|
+
|
|
2505
|
+
// src/fieldContext.ts
|
|
2506
|
+
import { createContext as createContext3 } from "react";
|
|
2507
|
+
var FieldContext = createContext3(null);
|
|
2508
|
+
|
|
2509
|
+
// src/DatePicker.tsx
|
|
2492
2510
|
import { jsx as jsx25, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
2493
2511
|
var cx5 = (...a) => a.filter(Boolean).join(" ");
|
|
2494
2512
|
var pad = (n) => String(n).padStart(2, "0");
|
|
@@ -2650,7 +2668,27 @@ function DatePicker({
|
|
|
2650
2668
|
const el = panel.current;
|
|
2651
2669
|
const view = el?.ownerDocument?.defaultView;
|
|
2652
2670
|
if (!el || !view || !open) return;
|
|
2671
|
+
const lifted = !asSheet && !!el.closest(".rx-modal");
|
|
2672
|
+
const lift = () => {
|
|
2673
|
+
const root2 = el.parentElement;
|
|
2674
|
+
if (!lifted || !root2) return;
|
|
2675
|
+
const r = root2.getBoundingClientRect();
|
|
2676
|
+
const gap = parseFloat(view.getComputedStyle(el).getPropertyValue("--ui-dropdown-gap")) || 0;
|
|
2677
|
+
if (root2.parentElement?.classList.contains("ui-field")) el.style.width = `${r.width}px`;
|
|
2678
|
+
el.style.position = "fixed";
|
|
2679
|
+
const moving = view.getComputedStyle(el.closest(".rx-modal")).transform !== "none";
|
|
2680
|
+
el.style.visibility = moving ? "hidden" : "";
|
|
2681
|
+
const tall = el.scrollHeight + el.offsetHeight - el.clientHeight;
|
|
2682
|
+
const below = view.innerHeight - r.bottom - gap * 2;
|
|
2683
|
+
const up = tall > below && r.top - gap * 2 > below;
|
|
2684
|
+
el.style.top = up ? `${Math.max(gap, r.top - gap - Math.min(tall, r.top - gap * 2))}px` : `${r.bottom + gap}px`;
|
|
2685
|
+
el.style.maxHeight = `${up ? r.top - gap * 2 : below}px`;
|
|
2686
|
+
el.style.overflowY = "auto";
|
|
2687
|
+
el.style.left = align === "end" ? "auto" : `${r.left}px`;
|
|
2688
|
+
el.style.right = align === "end" ? `${el.ownerDocument.documentElement.clientWidth - r.right}px` : "auto";
|
|
2689
|
+
};
|
|
2653
2690
|
const fit = () => {
|
|
2691
|
+
lift();
|
|
2654
2692
|
let got = dropdownViewportFit(el);
|
|
2655
2693
|
if (!got) return;
|
|
2656
2694
|
el.style.setProperty("--ui-dropdown-ceiling", got.max > 0 ? `${got.max}px` : "");
|
|
@@ -2663,11 +2701,19 @@ function DatePicker({
|
|
|
2663
2701
|
if (trigger.current) ro?.observe(trigger.current);
|
|
2664
2702
|
ro?.observe(el);
|
|
2665
2703
|
view.addEventListener("resize", fit);
|
|
2704
|
+
const dialog = lifted ? el.closest(".rx-modal") : null;
|
|
2705
|
+
dialog?.addEventListener("transitionend", fit);
|
|
2706
|
+
const rest = lifted ? setTimeout(fit, 400) : void 0;
|
|
2707
|
+
if (lifted) view.addEventListener("scroll", fit, true);
|
|
2666
2708
|
return () => {
|
|
2667
2709
|
ro?.disconnect();
|
|
2668
2710
|
view.removeEventListener("resize", fit);
|
|
2711
|
+
view.removeEventListener("scroll", fit, true);
|
|
2712
|
+
dialog?.removeEventListener("transitionend", fit);
|
|
2713
|
+
clearTimeout(rest);
|
|
2714
|
+
if (lifted) for (const k of ["position", "top", "left", "right", "width", "max-height", "overflow-y", "visibility"]) el.style.removeProperty(k);
|
|
2669
2715
|
};
|
|
2670
|
-
}, [open, asSheet]);
|
|
2716
|
+
}, [open, asSheet, align]);
|
|
2671
2717
|
useEffect12(() => {
|
|
2672
2718
|
if (!open || asSheet) return;
|
|
2673
2719
|
const doc = root.current?.ownerDocument ?? document;
|
|
@@ -2810,6 +2856,10 @@ function DatePicker({
|
|
|
2810
2856
|
}, [picksRange, grain, span.start, span.end, picked, names, at]);
|
|
2811
2857
|
const empty = placeholder ?? (picksRange ? grain === "month" ? "Select a period" : "Select dates" : grain === "month" ? "Select a month" : "Select a date");
|
|
2812
2858
|
const name = ariaLabel || empty;
|
|
2859
|
+
const inField = useContext2(FieldContext);
|
|
2860
|
+
const sheetTitle = ariaLabel || (inField && id === inField.id ? inField.label : empty);
|
|
2861
|
+
const fieldLabel = inField && id === inField.id ? inField.label : "";
|
|
2862
|
+
const triggerName = ariaLabel || fieldLabel ? `${ariaLabel || fieldLabel}, ${shown ?? empty}` : void 0;
|
|
2813
2863
|
const pageName = (which) => grain === "month" ? String(which) : names.monthYear.format(at(firstDayOf(which)));
|
|
2814
2864
|
const stepBack = `${grain === "month" ? "Previous year" : "Previous month"}, ${pageName(page - 1)}`;
|
|
2815
2865
|
const stepOn = `${grain === "month" ? "Next year" : "Next month"}, ${pageName(page + 1)}`;
|
|
@@ -2948,7 +2998,7 @@ function DatePicker({
|
|
|
2948
2998
|
id,
|
|
2949
2999
|
"aria-haspopup": "dialog",
|
|
2950
3000
|
"aria-expanded": open,
|
|
2951
|
-
"aria-label":
|
|
3001
|
+
"aria-label": triggerName,
|
|
2952
3002
|
disabled,
|
|
2953
3003
|
ref: trigger,
|
|
2954
3004
|
onClick: (e) => {
|
|
@@ -2968,7 +3018,7 @@ function DatePicker({
|
|
|
2968
3018
|
// without taking the sheet's affordances left a phone reader with no
|
|
2969
3019
|
// visible way out and a Tab that walked into the live page behind it.
|
|
2970
3020
|
// why: guidelines/drawer.md
|
|
2971
|
-
/* @__PURE__ */ jsx25(Drawer, { open, side: "bottom", size: "md", title:
|
|
3021
|
+
/* @__PURE__ */ jsx25(Drawer, { open, side: "bottom", size: "md", title: sheetTitle, onClose: () => setOpen(false), children: calendar })
|
|
2972
3022
|
) : /* @__PURE__ */ jsx25(
|
|
2973
3023
|
"div",
|
|
2974
3024
|
{
|
|
@@ -2991,7 +3041,7 @@ function DatePicker({
|
|
|
2991
3041
|
import {
|
|
2992
3042
|
Fragment as Fragment13,
|
|
2993
3043
|
useCallback as useCallback6,
|
|
2994
|
-
useContext as
|
|
3044
|
+
useContext as useContext3,
|
|
2995
3045
|
useEffect as useEffect13,
|
|
2996
3046
|
useId as useId12,
|
|
2997
3047
|
useRef as useRef15,
|
|
@@ -3011,12 +3061,6 @@ import {
|
|
|
3011
3061
|
dropdownSnap,
|
|
3012
3062
|
filterPanelRow
|
|
3013
3063
|
} from "@apliteni/apliteni-ui";
|
|
3014
|
-
|
|
3015
|
-
// src/fieldContext.ts
|
|
3016
|
-
import { createContext as createContext3 } from "react";
|
|
3017
|
-
var FieldContext = createContext3(null);
|
|
3018
|
-
|
|
3019
|
-
// src/Dropdown.tsx
|
|
3020
3064
|
import { Fragment as Fragment14, jsx as jsx26, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
3021
3065
|
var EXIT_SLACK_MS2 = 50;
|
|
3022
3066
|
var SETTLE_MS = 450;
|
|
@@ -3098,7 +3142,7 @@ function Dropdown({
|
|
|
3098
3142
|
const at = useRef15("");
|
|
3099
3143
|
const auto = useId12().replace(/:/g, "");
|
|
3100
3144
|
const uid = id ?? auto;
|
|
3101
|
-
const inField =
|
|
3145
|
+
const inField = useContext3(FieldContext);
|
|
3102
3146
|
const fieldName = inField && id === inField.id && !(ariaLabel && triggerContent != null) ? { id: `${uid}-trigger`, labelId: inField.labelId, labelledBy: `${inField.labelId} ${uid}-trigger` } : null;
|
|
3103
3147
|
const setOpen = useCallback6((next) => {
|
|
3104
3148
|
if (openProp === void 0) setSelfOpen(next);
|
|
@@ -3701,6 +3745,7 @@ function Segmented({ options, value, onChange, label, appearance = "pill", size,
|
|
|
3701
3745
|
disabled: disabled || option.disabled,
|
|
3702
3746
|
className: value === option.value ? "is-active" : void 0,
|
|
3703
3747
|
"aria-label": option.ariaLabel ?? (option.icon && option.iconOnly ? option.label : void 0),
|
|
3748
|
+
title: option.icon && option.iconOnly ? option.label : void 0,
|
|
3704
3749
|
"aria-pressed": value === option.value,
|
|
3705
3750
|
tabIndex: option.value === tabValue ? 0 : -1,
|
|
3706
3751
|
onClick: () => onChange(option.value),
|
|
@@ -3926,7 +3971,7 @@ function Snippet({ label = "shell", code = "", children, copy = true, reveal = f
|
|
|
3926
3971
|
"aria-label": copyLabel,
|
|
3927
3972
|
title: copyLabel,
|
|
3928
3973
|
onClick: handleCopy,
|
|
3929
|
-
children: /* @__PURE__ */ jsx32(Icon, { name: status
|
|
3974
|
+
children: /* @__PURE__ */ jsx32(Icon, { name: status !== "copied" ? "copy" : "check" })
|
|
3930
3975
|
}
|
|
3931
3976
|
),
|
|
3932
3977
|
/* @__PURE__ */ jsx32("span", { className: "ui-sr ui-snippet__status", role: "status", "aria-live": "polite", children: status === "copied" ? "Copied" : status === "failed" ? "Copy failed" : "" })
|
|
@@ -4019,7 +4064,7 @@ function Field({ id: suppliedId, label, hint, error, required, children }) {
|
|
|
4019
4064
|
const generatedId = useId13();
|
|
4020
4065
|
const id = suppliedId ?? generatedId;
|
|
4021
4066
|
const labelId = `${id}-label`;
|
|
4022
|
-
return /* @__PURE__ */ jsx34(Frame, { ...{ id, labelId, label, hint, error, required }, children: /* @__PURE__ */ jsx34(FieldContext.Provider, { value: { id, labelId }, children: children({ ...wiring(id, hint, error), required }) }) });
|
|
4067
|
+
return /* @__PURE__ */ jsx34(Frame, { ...{ id, labelId, label, hint, error, required }, children: /* @__PURE__ */ jsx34(FieldContext.Provider, { value: { id, labelId, label }, children: children({ ...wiring(id, hint, error), required }) }) });
|
|
4023
4068
|
}
|
|
4024
4069
|
var TextField = forwardRef8(function TextField2({ label, hint, error, required, type = "text", unit, icon: glyph2, className = "", ...props }, ref) {
|
|
4025
4070
|
const id = useId13();
|
|
@@ -4352,7 +4397,7 @@ function FileDrop({
|
|
|
4352
4397
|
import { forwardRef as forwardRef9 } from "react";
|
|
4353
4398
|
import { icon as icon6 } from "@apliteni/apliteni-ui";
|
|
4354
4399
|
import { jsx as jsx37, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
4355
|
-
var SearchField = forwardRef9(function SearchField2({ ariaLabel, className, ...props }, ref) {
|
|
4400
|
+
var SearchField = forwardRef9(function SearchField2({ ariaLabel, size, className, ...props }, ref) {
|
|
4356
4401
|
return /* @__PURE__ */ jsxs33("div", { className: "ui-input-group", children: [
|
|
4357
4402
|
/* @__PURE__ */ jsx37("span", { className: "ui-input-group__icon", dangerouslySetInnerHTML: { __html: icon6("search") } }),
|
|
4358
4403
|
/* @__PURE__ */ jsx37(
|
|
@@ -4362,14 +4407,14 @@ var SearchField = forwardRef9(function SearchField2({ ariaLabel, className, ...p
|
|
|
4362
4407
|
...props,
|
|
4363
4408
|
type: "search",
|
|
4364
4409
|
"aria-label": ariaLabel,
|
|
4365
|
-
className: ["ui-input", className].filter(Boolean).join(" ")
|
|
4410
|
+
className: ["ui-input", size === "sm" && "ui-input--sm", className].filter(Boolean).join(" ")
|
|
4366
4411
|
}
|
|
4367
4412
|
)
|
|
4368
4413
|
] });
|
|
4369
4414
|
});
|
|
4370
4415
|
|
|
4371
4416
|
// src/Toast.tsx
|
|
4372
|
-
import { createContext as createContext4, useCallback as useCallback7, useContext as
|
|
4417
|
+
import { createContext as createContext4, useCallback as useCallback7, useContext as useContext4, useEffect as useEffect17, useLayoutEffect as useLayoutEffect4, useRef as useRef21, useState as useState17 } from "react";
|
|
4373
4418
|
import { createPortal as createPortal6 } from "react-dom";
|
|
4374
4419
|
|
|
4375
4420
|
// src/lib/toast-stack.ts
|
|
@@ -4484,7 +4529,7 @@ var Context = createContext4(null);
|
|
|
4484
4529
|
var PileHoldContext = createContext4(false);
|
|
4485
4530
|
var glyphs = { success: "circleCheck", danger: "circleX", warn: "circleAlert", info: "info", neutral: "bolt" };
|
|
4486
4531
|
function useToast() {
|
|
4487
|
-
const push =
|
|
4532
|
+
const push = useContext4(Context);
|
|
4488
4533
|
if (!push) throw new Error("useToast requires a Toast provider");
|
|
4489
4534
|
return push;
|
|
4490
4535
|
}
|
|
@@ -4494,7 +4539,7 @@ function Notice({ notice, remove }) {
|
|
|
4494
4539
|
const dismissed = useRef21(false);
|
|
4495
4540
|
const [hovered, setHovered] = useState17(false);
|
|
4496
4541
|
const [focused, setFocused] = useState17(false);
|
|
4497
|
-
const pileHeld =
|
|
4542
|
+
const pileHeld = useContext4(PileHoldContext);
|
|
4498
4543
|
const paused = hovered || focused || pileHeld;
|
|
4499
4544
|
const tone2 = notice.tone ?? "success";
|
|
4500
4545
|
const timed = !notice.action && notice.timer !== false && notice.timer !== 0;
|
|
@@ -5404,7 +5449,7 @@ var Success = forwardRef11(function Success2({
|
|
|
5404
5449
|
// src/Chart.tsx
|
|
5405
5450
|
import {
|
|
5406
5451
|
useCallback as useCallback8,
|
|
5407
|
-
useContext as
|
|
5452
|
+
useContext as useContext5,
|
|
5408
5453
|
useEffect as useEffect21,
|
|
5409
5454
|
useId as useId16,
|
|
5410
5455
|
useLayoutEffect as useLayoutEffect5,
|
|
@@ -6197,7 +6242,7 @@ function Chart(props) {
|
|
|
6197
6242
|
const asTable = showTable && view === "table";
|
|
6198
6243
|
const uid = useId16().replace(/[^\w-]/g, "");
|
|
6199
6244
|
const frameEl = useRef25(null);
|
|
6200
|
-
const card =
|
|
6245
|
+
const card = useContext5(CardTools);
|
|
6201
6246
|
const claim = card?.claim;
|
|
6202
6247
|
useLayoutEffect5(() => showTable && claim ? claim(uid) : void 0, [showTable, claim, uid]);
|
|
6203
6248
|
const toCard = showTable && card?.owner === uid ? card.slot : null;
|
|
@@ -6964,7 +7009,7 @@ function AccountMenu2({
|
|
|
6964
7009
|
{
|
|
6965
7010
|
...props,
|
|
6966
7011
|
href: item.disabled ? void 0 : item.href ? safeUrl4(item.href) : item.value === "sign-out" && onSignOut ? void 0 : safeUrl4(item.value === "sign-out" ? "#logout" : `#${item.value}`),
|
|
6967
|
-
className: [props.className
|
|
7012
|
+
className: [props.className, !item.disabled && item.value === current && "cur", item.value === "sign-out" && "aout"].filter(Boolean).join(" "),
|
|
6968
7013
|
children: [
|
|
6969
7014
|
item.icon && /* @__PURE__ */ jsx48("span", { "aria-hidden": "true", dangerouslySetInnerHTML: { __html: icon8(item.icon) } }),
|
|
6970
7015
|
item.label
|
package/src/assets/icons.js
CHANGED
|
@@ -194,6 +194,9 @@ export const iconOnlyAllowed = {
|
|
|
194
194
|
// are the two views themselves, side by side in one toolbar at the card's corner.
|
|
195
195
|
chart: 'show the values as a chart',
|
|
196
196
|
table: 'show the values as a table',
|
|
197
|
+
// A list's Table and Board switch, decided by Artur on #832 (rev_4f729c7b8624/d16).
|
|
198
|
+
// The kit has no board glyph; the grid of four squares is the nearest one.
|
|
199
|
+
grid: 'show the items as a board',
|
|
197
200
|
};
|
|
198
201
|
|
|
199
202
|
// The word a wordless control's name may open with. The list above says which
|
|
@@ -221,6 +224,7 @@ export const iconOnlyNames = {
|
|
|
221
224
|
plus: ['zoom'],
|
|
222
225
|
chart: ['chart'],
|
|
223
226
|
table: ['table'],
|
|
227
|
+
grid: ['board'],
|
|
224
228
|
};
|
|
225
229
|
|
|
226
230
|
// What a glyph means when a component picks it for the reader rather than a
|
package/src/styles/button.css
CHANGED
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
font-size: var(--btn-font);
|
|
30
30
|
font-weight: var(--weight-medium);
|
|
31
31
|
line-height: var(--leading-tight);
|
|
32
|
-
border-radius: var(--radius-
|
|
32
|
+
border-radius: var(--radius-pill); /* why: docs/foundations.md#control-corners */
|
|
33
33
|
padding: var(--btn-pad-y) var(--btn-pad-x);
|
|
34
34
|
min-height: var(--btn-height-md);
|
|
35
35
|
cursor: pointer;
|
|
@@ -113,10 +113,10 @@
|
|
|
113
113
|
.ui-btn--xs { --btn-pad-y: 4.5px; --btn-pad-x: 8px; --btn-font: var(--text-xs); min-width: 24px; min-height: 24px; }
|
|
114
114
|
.ui-btn--xs svg { width: 13px; height: 13px; stroke-width: 2.8; }
|
|
115
115
|
.ui-btn--sm { --btn-pad-y: 6px; --btn-pad-x: 12px; --btn-font: var(--text-sm); min-height: var(--btn-height-sm); }
|
|
116
|
-
.ui-btn--lg { --btn-pad-y: 13px; --btn-pad-x: 24px; --btn-font: var(--text-md);
|
|
116
|
+
.ui-btn--lg { --btn-pad-y: 13px; --btn-pad-x: 24px; --btn-font: var(--text-md); }
|
|
117
117
|
|
|
118
118
|
/* Icon-only */
|
|
119
|
-
.ui-btn--icon { --btn-pad-y: var(--btn-pad-y-md); padding: var(--btn-pad-y-md);
|
|
119
|
+
.ui-btn--icon { --btn-pad-y: var(--btn-pad-y-md); padding: var(--btn-pad-y-md); }
|
|
120
120
|
.ui-btn--icon.ui-btn--xs { --btn-pad-y: 4.5px; padding: 4.5px; }
|
|
121
121
|
.ui-btn--icon.ui-btn--sm { --btn-pad-y: 7px; padding: 7px; }
|
|
122
122
|
|
package/src/styles/drawer.css
CHANGED
|
@@ -263,6 +263,13 @@
|
|
|
263
263
|
stays for a screen reader only when one field fills the value cell. With two
|
|
264
264
|
fields, each label remains visible to name its control. */
|
|
265
265
|
.ui-drawer__row:has(> dd :is(.ui-input, .ui-textarea, .ui-select, .ui-dropdown)) > :is(dt, dd) { align-self: baseline; }
|
|
266
|
+
/* An icon button after a value, such as a copy button, centres on the value's line and gives
|
|
267
|
+
back the height it draws past that line, so its row keeps a text row's height. #832 */
|
|
268
|
+
.ui-drawer__row > dd > .ui-btn--icon:last-child {
|
|
269
|
+
vertical-align: middle;
|
|
270
|
+
margin-block: calc((var(--btn-height-sm) - 1lh) / -2);
|
|
271
|
+
margin-inline-start: var(--space-2);
|
|
272
|
+
}
|
|
266
273
|
.ui-drawer__row > dd:has(> .ui-field:only-child) > .ui-field > .ui-field__label { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
|
|
267
274
|
.ui-drawer__row dt { color: var(--text); }
|
|
268
275
|
.ui-drawer__row dd { color: var(--text); font-variant-numeric: tabular-nums; }
|
package/src/styles/dropdown.css
CHANGED
|
@@ -40,9 +40,9 @@
|
|
|
40
40
|
why: docs/foundations.md#colour-and-contrast */
|
|
41
41
|
border: 1px solid var(--control-edge);
|
|
42
42
|
border-radius: var(--radius-pill);
|
|
43
|
-
/*
|
|
44
|
-
level with an sm button. #814 */
|
|
45
|
-
padding:
|
|
43
|
+
/* The button's tight 13px line, so the two texts share a baseline. #822 This block padding,
|
|
44
|
+
between two steps, and the edge hold the pill at 32px, level with an sm button. #814 */
|
|
45
|
+
line-height: var(--leading-tight); padding: 7.2px 11px 7.2px 13px;
|
|
46
46
|
transition: border-color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
|
|
47
47
|
}
|
|
48
48
|
/* The hover edge steps aside under the band: an accent edge one pixel inside an
|
|
@@ -431,6 +431,10 @@
|
|
|
431
431
|
|
|
432
432
|
/* Separator */
|
|
433
433
|
.ui-dropdown__sep { height: 1px; background: var(--border); margin: 5px 4px; }
|
|
434
|
+
/* Forced colours drop the background, so the line comes back as a border of the same 1px. #824 */
|
|
435
|
+
@media (forced-colors: active) {
|
|
436
|
+
.ui-dropdown__sep { height: 0; border-top: 1px solid; }
|
|
437
|
+
}
|
|
434
438
|
|
|
435
439
|
/* Optional pinned head/foot blocks — symmetrical: one inner padding, and each
|
|
436
440
|
bleeding to the edge it sits on, lining the edge it faces.
|
|
@@ -484,7 +488,7 @@
|
|
|
484
488
|
/* The ground and line .ui-input takes. why: docs/foundations.md#elevation */
|
|
485
489
|
background: var(--field-bg); /* code-bg: inherit — control paint; the containing surface is the ground, for a chip and for a band alike. */
|
|
486
490
|
border: 1px solid var(--field-edge);
|
|
487
|
-
border-radius: var(--radius-
|
|
491
|
+
border-radius: var(--radius-pill);
|
|
488
492
|
padding: 8px 12px 8px 34px;
|
|
489
493
|
/* The height Chromium paints (38.25px), stated so the target-size gate, which
|
|
490
494
|
cannot see an <input>'s line of text, reads the box a reader hits. */
|
|
@@ -548,14 +552,13 @@
|
|
|
548
552
|
.ui-field > .ui-dropdown { display: grid; }
|
|
549
553
|
.ui-field > .ui-dropdown > .ui-dropdown__trigger > .ui-dropdown__chevron { margin-left: auto; }
|
|
550
554
|
.ui-field > .ui-dropdown > .ui-dropdown__panel { inline-size: 100%; min-width: 0; }
|
|
551
|
-
/* In a form the trigger takes the text input's
|
|
552
|
-
|
|
555
|
+
/* In a form the trigger takes the text input's block padding and type, so the two
|
|
556
|
+
stand at one height. Both are pills, so it keeps its own corner. #812, #823
|
|
553
557
|
why: docs/components.md#forms */
|
|
554
558
|
@property --ui-dropdown-line { syntax: "<length>"; inherits: true; initial-value: 0px; }
|
|
555
559
|
.ui-field > .ui-dropdown > .ui-dropdown__trigger {
|
|
556
|
-
border-radius: var(--radius-md);
|
|
557
560
|
padding: var(--space-3) var(--space-4);
|
|
558
|
-
font-size: var(--text-base);
|
|
561
|
+
font-size: var(--text-base); line-height: normal;
|
|
559
562
|
min-inline-size: 0;
|
|
560
563
|
/* The value line, as a length the mark below can read. */
|
|
561
564
|
--ui-dropdown-line: 1lh;
|
package/src/styles/feedback.css
CHANGED
|
@@ -97,7 +97,7 @@
|
|
|
97
97
|
.ui-fbcomposer textarea:focus-visible { outline: var(--ring); outline-offset: var(--ring-offset); }
|
|
98
98
|
.ui-fbc__foot { display: flex; align-items: center; justify-content: flex-end; gap: 12px; padding: 16px 20px 18px; }
|
|
99
99
|
|
|
100
|
-
.ui-fbbtn { font-family: var(--font-sans); font-size: var(--text-sm); font-weight: var(--weight-semibold); border-radius:
|
|
100
|
+
.ui-fbbtn { font-family: var(--font-sans); font-size: var(--text-sm); font-weight: var(--weight-semibold); border-radius: var(--radius-pill); padding: 9px 17px; cursor: pointer; border: 0; transition: filter var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease); }
|
|
101
101
|
.ui-fbbtn.ghost { background: transparent; color: var(--text); }
|
|
102
102
|
.ui-fbbtn.ghost:hover { color: var(--strong); background: var(--surface); /* code-bg: inherit — control paint; the containing surface is the ground, for a chip and for a band alike. */ }
|
|
103
103
|
.ui-fbbtn:focus-visible { outline: var(--ring); outline-offset: var(--ring-offset); }
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
showing through a switched-off box — the complaint behind #505's review. */
|
|
6
6
|
.ui-filter-bar__chip {
|
|
7
7
|
display: inline-flex; align-items: center; min-width: 0; margin: 0;
|
|
8
|
-
border: 1px solid var(--control-edge); border-radius: var(--radius-
|
|
8
|
+
border: 1px solid var(--control-edge); border-radius: var(--radius-pill); padding: var(--space-1);
|
|
9
9
|
/* The chip holds two focus targets of its own — the trigger and the remove
|
|
10
10
|
button — so it is a painted container, not a control that inherits the gap
|
|
11
11
|
outside it. It joins the shared recomposition in tokens.css beside .ui-seg,
|
|
@@ -15,14 +15,14 @@
|
|
|
15
15
|
mark's line box. The bar names the height; every chip keeps it. */
|
|
16
16
|
min-height: var(--ui-filter-row-h);
|
|
17
17
|
}
|
|
18
|
-
.ui-filter-bar__chip .ui-dropdown__trigger { border: 0; background: transparent; padding: var(--space-1) var(--space-2); }
|
|
18
|
+
.ui-filter-bar__chip .ui-dropdown__trigger { border: 0; background: transparent; padding: var(--space-1) var(--space-2); min-height: calc(var(--ui-filter-row-h) - 2px - 2 * var(--space-1)); } /* fills the chip: a fieldset's content does not follow its min-height. #822 */
|
|
19
19
|
/* The chip is the edge the row's other boxes are measured against, so it fades with them:
|
|
20
20
|
off, the chips stayed at full strength and only their ink said so. Two carriers, because
|
|
21
21
|
a bar turned off disables the controls in a nested fieldset and not the fieldset. #518
|
|
22
22
|
why: guidelines/accessibility-floor.md#disabled-control-legibility */
|
|
23
23
|
.ui-filter-bar__chip:disabled,
|
|
24
24
|
.ui-filter-bar:disabled .ui-filter-bar__chip { border-color: var(--disabled-border); }
|
|
25
|
-
.ui-filter-bar__remove { border: 0; background: transparent; /* muted-ink: glyph — filter remove mark */ color: var(--muted); font: inherit; text-align: center; font-size: var(--text-lg); padding: 0; min-width: 24px; min-height: 24px; border-radius: var(--radius-
|
|
25
|
+
.ui-filter-bar__remove { border: 0; background: transparent; /* muted-ink: glyph — filter remove mark */ color: var(--muted); font: inherit; text-align: center; font-size: var(--text-lg); padding: 0; min-width: 24px; min-height: 24px; border-radius: var(--radius-pill); cursor: pointer; }
|
|
26
26
|
.ui-filter-bar__remove:focus-visible,
|
|
27
27
|
.ui-filter-bar:focus-visible { outline: var(--ring); outline-offset: var(--ring-offset); }
|
|
28
28
|
.ui-filter-bar button:disabled { /* muted-ink: state — disabled filters */ color: var(--disabled-ink); cursor: not-allowed; }
|
|
@@ -134,6 +134,25 @@
|
|
|
134
134
|
names it too, for the control at the end of a split row. Rounded up to a whole pixel:
|
|
135
135
|
a fractional line moved a scrolled table below it off the pixel its hit test uses. #768 */
|
|
136
136
|
.ui-filter-bar, .ui-toolbar { --ui-filter-row-h: round(up, calc(2px + 2 * var(--space-1) + var(--leading-normal) * var(--text-lg)), 1px); }
|
|
137
|
+
/* A toolbar that opens with a small search field is a small row, and its filter bar
|
|
138
|
+
follows it to 32px. The chip gives up its block padding so the 24px remove mark still
|
|
139
|
+
fits. The trigger fills the chip between its two edges, because a min-height on the
|
|
140
|
+
chip alone leaves the text high: the chip is a fieldset. On a touch screen the row is a
|
|
141
|
+
chip's height, 40px, and a small button or segmented control on any of its lines takes
|
|
142
|
+
it too. #822, rev_1bef7d7c3b22/d5
|
|
143
|
+
why: docs/components.md#a-toolbar-at-one-column */
|
|
144
|
+
@media not (pointer: coarse) {
|
|
145
|
+
.ui-toolbar:has(> .ui-input-group > .ui-input--sm),
|
|
146
|
+
.ui-toolbar:has(> .ui-input-group > .ui-input--sm) .ui-filter-bar { --ui-filter-row-h: var(--btn-height-sm); }
|
|
147
|
+
.ui-toolbar:has(> .ui-input-group > .ui-input--sm) .ui-filter-bar__chip { padding-block: 0; }
|
|
148
|
+
.ui-toolbar:has(> .ui-input-group > .ui-input--sm) .ui-filter-bar__chip .ui-dropdown__trigger { min-height: calc(var(--btn-height-sm) - 2px); }
|
|
149
|
+
.ui-toolbar:has(> .ui-input-group > .ui-input--sm) .ui-filter-bar__remove { line-height: var(--leading-tight); }
|
|
150
|
+
}
|
|
151
|
+
@media (pointer: coarse) {
|
|
152
|
+
.ui-toolbar:has(> .ui-input-group > .ui-input--sm) > :is(.ui-btn, .ui-seg) { min-height: var(--ui-filter-row-h); }
|
|
153
|
+
/* The create row above that bar stands the same height. #832 */
|
|
154
|
+
.ui-toolbar:has(+ .ui-toolbar > .ui-input-group > .ui-input--sm) > .ui-btn { min-height: var(--ui-filter-row-h); }
|
|
155
|
+
}
|
|
137
156
|
|
|
138
157
|
/* A chip's neighbour takes the chip's corner, that height and edge, but not its painted fill:
|
|
139
158
|
the trigger's own edge can differ from the row's, while its --surface made the
|
|
@@ -152,7 +171,7 @@
|
|
|
152
171
|
/* Clear all keeps a chip's height when it wraps to a line of its own, so a wider gap
|
|
153
172
|
that moves it to the next line does not change its size. */
|
|
154
173
|
.ui-toolbar .ui-filter-bar [data-filter-clear] button { min-height: var(--ui-filter-row-h); }
|
|
155
|
-
.ui-filter-bar [data-filter-add] .ui-dropdown__trigger {
|
|
174
|
+
.ui-filter-bar [data-filter-add] .ui-dropdown__trigger { min-height: var(--ui-filter-row-h); border-color: var(--control-edge); background: transparent; }
|
|
156
175
|
.ui-filter-bar [data-filter-add] .ui-dropdown__trigger svg { width: 16px; height: 16px; flex: none; stroke-width: 2.4; }
|
|
157
176
|
.ui-filter-bar [data-filter-add] .ui-dropdown__trigger:enabled:hover:not(:focus-visible) { border-color: var(--accent); }
|
|
158
177
|
.ui-filter-bar [data-filter-add] .ui-dropdown__trigger:disabled { border-color: var(--disabled-border); }
|
package/src/styles/input.css
CHANGED
|
@@ -27,12 +27,12 @@
|
|
|
27
27
|
why: docs/foundations.md#elevation */
|
|
28
28
|
background: var(--field-bg); /* code-bg: inherit — control paint; the containing surface is the ground, for a chip and for a band alike. */
|
|
29
29
|
border: 1px solid var(--field-edge);
|
|
30
|
-
border-radius: var(--radius-
|
|
30
|
+
border-radius: var(--radius-pill); /* why: docs/foundations.md#control-corners */
|
|
31
31
|
padding: 12px 15px;
|
|
32
32
|
width: 100%;
|
|
33
33
|
transition: border-color var(--dur-med) var(--ease), box-shadow var(--dur-med) var(--ease);
|
|
34
34
|
}
|
|
35
|
-
.ui-textarea { resize: vertical; min-height: 96px; line-height: 1.55; }
|
|
35
|
+
.ui-textarea { resize: vertical; min-height: 96px; line-height: 1.55; border-radius: var(--radius-md); }
|
|
36
36
|
|
|
37
37
|
.ui-input:hover,
|
|
38
38
|
.ui-textarea:hover,
|
|
@@ -98,7 +98,7 @@
|
|
|
98
98
|
/* muted-ink: glyph — field icon */ color: var(--muted);
|
|
99
99
|
pointer-events: none;
|
|
100
100
|
}
|
|
101
|
-
.ui-input-group__icon svg { width: 100%; height: 100%; stroke: currentColor; fill: none; stroke-width: 2.2; }
|
|
101
|
+
.ui-input-group__icon svg { display: block; width: 100%; height: 100%; stroke: currentColor; fill: none; stroke-width: 2.2; } /* block: inline, it sat on the slot's baseline, 2px low, at every size. #822 #826 */
|
|
102
102
|
|
|
103
103
|
/* The chevron is a data URI, and a data URI cannot read a token: `var()` does not
|
|
104
104
|
substitute inside url() and `currentColor` does not cross into the image's own
|
|
@@ -333,3 +333,22 @@
|
|
|
333
333
|
}
|
|
334
334
|
.ui-switch input:focus-visible + .ui-switch__track { outline: var(--ring); outline-offset: var(--ring-offset); }
|
|
335
335
|
.ui-switch input:disabled + .ui-switch__track { opacity: 0.5; cursor: not-allowed; }
|
|
336
|
+
|
|
337
|
+
/* The small field: 32px with the dense rows' 13px text, level with a small button, a
|
|
338
|
+
dropdown trigger and a small segmented control. Only a fine pointer gets it. On a touch
|
|
339
|
+
screen it keeps 16px text, because iOS zooms into a field under 16px, and stands 40px,
|
|
340
|
+
a chip's height. rev_1bef7d7c3b22/d5, #832 The group's
|
|
341
|
+
42px left padding outranks the side padding here, so the glyph keeps its place. #822
|
|
342
|
+
why: docs/components.md#react-search-field */
|
|
343
|
+
@media not (pointer: coarse) {
|
|
344
|
+
.ui-input--sm {
|
|
345
|
+
font-size: var(--text-sm);
|
|
346
|
+
line-height: var(--leading-tight);
|
|
347
|
+
min-height: var(--btn-height-sm);
|
|
348
|
+
padding: var(--space-1) var(--space-3);
|
|
349
|
+
border-radius: var(--radius-pill); /* why: docs/foundations.md#control-corners */
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
@media (pointer: coarse) {
|
|
353
|
+
.ui-input--sm { height: var(--ui-filter-row-h, 40px); min-height: var(--ui-filter-row-h, 40px); padding-block: 0; }
|
|
354
|
+
}
|
package/src/styles/layout.css
CHANGED
|
@@ -365,7 +365,7 @@
|
|
|
365
365
|
why: docs/foundations.md#elevation */
|
|
366
366
|
background: var(--surface); /* code-bg: inherit — control paint; the containing surface is the ground, for a chip and for a band alike. */
|
|
367
367
|
border: 1px solid var(--border);
|
|
368
|
-
border-radius: var(--radius-
|
|
368
|
+
border-radius: var(--radius-pill);
|
|
369
369
|
cursor: pointer;
|
|
370
370
|
transition: border-color var(--dur-med) var(--ease), color var(--dur-med) var(--ease);
|
|
371
371
|
}
|
|
@@ -415,11 +415,13 @@
|
|
|
415
415
|
.ui-app__main > h1:not(:has(+ .ui-app__sub)) { margin-bottom: var(--space-8); }
|
|
416
416
|
/* Page tools stand at the end of the title row, and the lede goes under the whole row.
|
|
417
417
|
The row takes the h1's steps: 8px to a lede, 32px when the page opens on its title alone.
|
|
418
|
-
16px keeps the tools off a long title, and the tools stand 12px apart.
|
|
419
|
-
|
|
418
|
+
16px keeps the tools off a long title, and the tools stand 12px apart. Tools that do
|
|
419
|
+
not fit beside the title, such as a period picker on a phone, go under it, 8px down. #832 */
|
|
420
|
+
.ui-app__title-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-4); margin-bottom: 8px; }
|
|
420
421
|
.ui-app__title-row:not(:has(+ .ui-app__sub)) { margin-bottom: var(--space-8); }
|
|
421
422
|
.ui-app__main .ui-app__title-row > h1 { flex: 1 1 auto; min-width: 0; margin-bottom: 0; }
|
|
422
|
-
|
|
423
|
+
/* The tools wrap at the narrowest phone, so a period picker and a view action stay in the column. #832 */
|
|
424
|
+
.ui-app__tools { display: flex; flex: none; flex-wrap: wrap; align-items: center; gap: var(--space-3); max-width: 100%; }
|
|
423
425
|
.ui-app__body { display: flex; flex-direction: column; gap: var(--space-5); }
|
|
424
426
|
/* A flex child's min-width is its content by default, so one wide block — a
|
|
425
427
|
ledger, a code sample — pushes the whole page sideways instead of scrolling
|
|
@@ -479,9 +481,11 @@
|
|
|
479
481
|
otherwise empty row — a mark that came loose rather than what to do with the
|
|
480
482
|
block, which is what Artur marked on round r31. `align-self` is what keeps
|
|
481
483
|
the control its own height beside a group two lines tall; it sits at the
|
|
482
|
-
row's top end, the corner it keeps above this step.
|
|
484
|
+
row's top end, the corner it keeps above this step. A segmented track there stops
|
|
485
|
+
at its options' width and draws no empty end. A filter group still grows. #831
|
|
483
486
|
why: Artur's review of the Finance report, rounds r31 and r34, #505 */
|
|
484
487
|
.ui-toolbar--split > :nth-last-child(2) { flex: 1 1 60%; min-width: 0; }
|
|
488
|
+
.ui-toolbar--split > .ui-seg:nth-last-child(2) { max-width: max-content; }
|
|
485
489
|
.ui-toolbar--split > :last-child { margin-inline-start: 0; align-self: start; }
|
|
486
490
|
}
|
|
487
491
|
|
|
@@ -546,9 +550,52 @@
|
|
|
546
550
|
These sit below the phone shell because guideline references cite the lines above. #768 */
|
|
547
551
|
.ui-toolbar :where(div:has(.ui-filter-bar)) { display: grid; }
|
|
548
552
|
.ui-toolbar > .ui-seg { align-self: stretch; }
|
|
553
|
+
/* A wordless button on a toolbar is a circle of the row's height. A wrapping row cannot
|
|
554
|
+
give a stretched box a width from its height, so the button takes the height that
|
|
555
|
+
the row gets: a chip's height beside a filter bar, and beside a full field the field's
|
|
556
|
+
own height, which is the line box of the field's text, its 12px padding and its edge.
|
|
557
|
+
On a touch screen every field is a full field with 16px text. #831
|
|
558
|
+
why: docs/foundations.md#control-corners */
|
|
559
|
+
.ui-toolbar:has(.ui-filter-bar) > .ui-btn--icon:not(.ui-btn--xs, .ui-btn--sm) {
|
|
560
|
+
min-width: var(--ui-filter-row-h);
|
|
561
|
+
min-height: var(--ui-filter-row-h);
|
|
562
|
+
}
|
|
563
|
+
/* The two pointers have separate queries, because the fine rule's selector is the more
|
|
564
|
+
specific one and would win on a touch screen too. */
|
|
565
|
+
@media not (pointer: coarse) {
|
|
566
|
+
.ui-toolbar:has(> .ui-input-group > .ui-input:not(.ui-input--sm), > .ui-input:not(.ui-input--sm)) > .ui-btn--icon:not(.ui-btn--xs, .ui-btn--sm) {
|
|
567
|
+
font-size: var(--text-base);
|
|
568
|
+
line-height: normal;
|
|
569
|
+
min-width: calc(1lh + 26px);
|
|
570
|
+
min-height: calc(1lh + 26px);
|
|
571
|
+
}
|
|
572
|
+
}
|
|
573
|
+
@media (pointer: coarse) {
|
|
574
|
+
.ui-toolbar:has(> .ui-input-group > .ui-input, > .ui-input) > .ui-btn--icon:not(.ui-btn--xs, .ui-btn--sm) {
|
|
575
|
+
font-size: 16px;
|
|
576
|
+
line-height: normal;
|
|
577
|
+
min-width: calc(1lh + 26px);
|
|
578
|
+
min-height: calc(1lh + 26px);
|
|
579
|
+
}
|
|
580
|
+
}
|
|
549
581
|
@media (max-width: 560px) {
|
|
550
582
|
.ui-toolbar--split:has(.ui-filter-bar) > :last-child { min-height: var(--ui-filter-row-h); }
|
|
551
583
|
}
|
|
584
|
+
/* On a touch screen a dropdown trigger alone on a toolbar line takes a chip's height too,
|
|
585
|
+
not its own 32px, so every control under the full field is one height. #822 */
|
|
586
|
+
@media (pointer: coarse) {
|
|
587
|
+
.ui-toolbar > .ui-dropdown { min-height: var(--ui-filter-row-h); }
|
|
588
|
+
}
|
|
589
|
+
/* A small search field stops at the width of a small panel, and the free width goes
|
|
590
|
+
before the last control. A full-size field still takes the free width. At one column
|
|
591
|
+
each search field takes the line again. rev_f1d664c42a55/d2, #822
|
|
592
|
+
why: docs/components.md#a-toolbar-at-one-column */
|
|
593
|
+
@media not (pointer: coarse) {
|
|
594
|
+
.ui-toolbar > .ui-input-group:has(> .ui-input--sm) { max-width: var(--panel-sm); }
|
|
595
|
+
}
|
|
596
|
+
@media (max-width: 560px) {
|
|
597
|
+
.ui-toolbar > .ui-input-group:has(> .ui-input--sm) { max-width: none; }
|
|
598
|
+
}
|
|
552
599
|
|
|
553
600
|
/* -- The band's search at one column --------------------------------------- */
|
|
554
601
|
/* The band holds the trigger, the reader's mark and whatever the page puts between
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
min-height: var(--space-8);
|
|
43
43
|
padding: var(--space-1) var(--space-6) var(--space-1) var(--space-2);
|
|
44
44
|
font-size: var(--text-sm);
|
|
45
|
-
border-radius: var(--radius-
|
|
45
|
+
border-radius: var(--radius-pill);
|
|
46
46
|
background-position: right var(--space-2) center;
|
|
47
47
|
}
|
|
48
48
|
|
|
@@ -110,7 +110,7 @@
|
|
|
110
110
|
min-height: var(--space-8);
|
|
111
111
|
padding: var(--space-1) var(--space-2);
|
|
112
112
|
font-size: var(--text-sm);
|
|
113
|
-
border-radius: var(--radius-
|
|
113
|
+
border-radius: var(--radius-pill);
|
|
114
114
|
text-align: center;
|
|
115
115
|
}
|
|
116
116
|
|
package/src/styles/segmented.css
CHANGED
|
@@ -42,14 +42,11 @@
|
|
|
42
42
|
.ui-seg button.is-active,
|
|
43
43
|
.ui-seg button[aria-pressed="true"],
|
|
44
44
|
.ui-seg button[aria-selected="true"] {
|
|
45
|
+
/* The primary button's pair, so a selection and the main action share one fill. The
|
|
46
|
+
edge carries the 3:1 mark where that fill is faint on the track, as under the default accent in dark. #832 */
|
|
45
47
|
color: var(--accent-contrast);
|
|
46
|
-
background: var(--accent);
|
|
47
|
-
|
|
48
|
-
/* White ink falls below the text floor on the lighter dark-theme accents. */
|
|
49
|
-
:where(:root[data-theme="dark"]) .ui-seg button.is-active,
|
|
50
|
-
:where(:root[data-theme="dark"]) .ui-seg button[aria-pressed="true"],
|
|
51
|
-
:where(:root[data-theme="dark"]) .ui-seg button[aria-selected="true"] {
|
|
52
|
-
color: var(--signal-contrast);
|
|
48
|
+
background: var(--accent-strong);
|
|
49
|
+
box-shadow: inset 0 0 0 1px var(--accent);
|
|
53
50
|
}
|
|
54
51
|
|
|
55
52
|
/* A disabled selection stays readable without the active accent fill. */
|
|
@@ -57,6 +54,7 @@
|
|
|
57
54
|
.ui-seg button[aria-pressed="true"]:where(:disabled),
|
|
58
55
|
.ui-seg button[aria-selected="true"]:where(:disabled) {
|
|
59
56
|
background: var(--surface-3); /* code-bg: inherit — the selected control's own fill. */
|
|
57
|
+
box-shadow: none; /* No edge: on a control that takes no focus it reads as a ring. #832 */
|
|
60
58
|
}
|
|
61
59
|
|
|
62
60
|
/* Standard pills tighten on phones so six short month names fit one row. */
|
|
@@ -136,6 +134,7 @@
|
|
|
136
134
|
.ui-seg--underline button.is-active,
|
|
137
135
|
.ui-seg--underline button[aria-pressed="true"] {
|
|
138
136
|
background: none;
|
|
137
|
+
box-shadow: none; /* The bar is the one mark; the pill's edge goes with its fill. #832 */
|
|
139
138
|
color: var(--strong);
|
|
140
139
|
font-weight: var(--weight-semibold);
|
|
141
140
|
}
|
package/src/styles/table.css
CHANGED
|
@@ -50,6 +50,10 @@
|
|
|
50
50
|
.ui-table tfoot tr:first-child > :is(th, td) { border-top: 2px solid var(--border-strong); }
|
|
51
51
|
.ui-table tfoot th { text-align: right; }
|
|
52
52
|
.ui-table td.ui-table__title { color: var(--strong); font-weight: var(--weight-medium); width: 99%; white-space: normal; }
|
|
53
|
+
/* A floor, not a spacing step: a two-word name stays on one line when the table is
|
|
54
|
+
wider than its frame, so the frame scrolls instead of the title breaking at each word,
|
|
55
|
+
as a pinned subject column did in #832. A pinned column's own ceiling still wins. */
|
|
56
|
+
.ui-table td.ui-table__title { min-width: min(20ch, var(--ui-table-identity-max, 20ch)); }
|
|
53
57
|
.ui-table th:last-child { padding-right: 0; }
|
|
54
58
|
/* The last body cell ends where its header and the table end. A right-aligned amount in the
|
|
55
59
|
last column stood 16px in from both, because only the header and the action cell dropped
|
|
@@ -534,6 +538,16 @@ a.ui-identity:hover { text-decoration: underline; }
|
|
|
534
538
|
/* A pinned selection cell keeps its fixed, centred track. */
|
|
535
539
|
.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); }
|
|
536
540
|
.ui-table.ui-table--hover:not(.ui-table--zebra):not(.ui-table--dense) :is(th, td):last-child { padding-right: var(--cell-edge); }
|
|
541
|
+
/* A cell of the default density opens with no padding of its own, so the pinned cell gives half its gap to the
|
|
542
|
+
column after the divider, or that column's text touches the divider. The gap keeps its
|
|
543
|
+
size, so the table keeps one width whether the divider shows or not. #832 */
|
|
544
|
+
.ui-table--pinned:not(.ui-table--dense):not(.ui-table--compact) .ui-table__identity { padding-right: var(--space-2); }
|
|
545
|
+
.ui-table--pinned:not(.ui-table--dense):not(.ui-table--compact) .ui-table__identity + :is(th, td) { padding-left: var(--space-2); }
|
|
546
|
+
.ui-table.ui-table--hover:not(.ui-table--zebra):not(.ui-table--dense):is(.ui-table--pinned) .ui-table__identity { padding-right: calc(var(--cell-gap) / 2); }
|
|
547
|
+
.ui-table.ui-table--hover:not(.ui-table--zebra):not(.ui-table--dense):is(.ui-table--pinned) .ui-table__identity + :is(th, td) { padding-left: calc(var(--cell-gap) / 2); }
|
|
548
|
+
/* A link that fills a pinned cell carries the cell's padding, so it gives up the same half. */
|
|
549
|
+
.ui-table--pinned:not(.ui-table--dense):not(.ui-table--compact) td.ui-table__identity.ui-table__linked > :is(a:not([class]), a.ui-identity):only-child { padding-right: var(--space-2); }
|
|
550
|
+
.ui-table.ui-table--hover:not(.ui-table--zebra):not(.ui-table--dense):is(.ui-table--pinned) td.ui-table__identity.ui-table__linked > :is(a:not([class]), a.ui-identity):only-child { padding-right: calc(var(--cell-gap) / 2); }
|
|
537
551
|
/* 16px, so the box's 44px phone tap layer stops at the cell's edge and leaves the next cell's control whole. */
|
|
538
552
|
.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); }
|
|
539
553
|
.ui-table.ui-table--hover:not(.ui-table--zebra):not(.ui-table--dense) thead th { padding-block: var(--space-3); }
|
package/src/styles/tap-zone.css
CHANGED
|
@@ -181,6 +181,9 @@
|
|
|
181
181
|
other. A chart's switch there keeps the clearance .ui-seg declares. */
|
|
182
182
|
.ui-card__head { margin-bottom: var(--space-3, 12px) !important; }
|
|
183
183
|
.ui-card__tools { column-gap: var(--tap-gap) !important; --tap-clear-x: var(--tap-gap); --tap-clear-y: var(--tap-gap); }
|
|
184
|
+
/* The page's title row holds small tools the same way: the room beside them is title
|
|
185
|
+
text, and they stand under the title on a phone, so the layer has room on each side. #832 */
|
|
186
|
+
.ui-app__tools { gap: var(--tap-gap) !important; --tap-clear-x: var(--tap-gap); --tap-clear-y: var(--tap-gap); }
|
|
184
187
|
|
|
185
188
|
/* The selection box is 19px in a 58px row and a 34px header: the layer has room to reach the floor both ways. */
|
|
186
189
|
.ui-table__selection { --tap-clear-x: var(--tap-min); --tap-clear-y: var(--tap-min); }
|
|
@@ -242,6 +245,13 @@
|
|
|
242
245
|
--tap-clear-y: var(--tap-gap-bordered);
|
|
243
246
|
}
|
|
244
247
|
|
|
248
|
+
/* A value's icon button, such as a copy button: the value before it, the label above
|
|
249
|
+
and the next row's label below are text, so the layer may reach the floor. #832 */
|
|
250
|
+
.ui-drawer__row > dd {
|
|
251
|
+
--tap-clear-x: var(--tap-gap);
|
|
252
|
+
--tap-clear-y: var(--tap-gap);
|
|
253
|
+
}
|
|
254
|
+
|
|
245
255
|
/* Both ways: fixed squares cannot overflow the way labels can, and a drawer
|
|
246
256
|
header spends its column gap on the title. Not the accent picker — its
|
|
247
257
|
swatches are on no carrier list, so opening it bought no reach. */
|
package/src/styles/topbar.css
CHANGED
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
background: var(--surface); /* code-bg: inherit — control paint; the containing surface is the ground, for a chip and for a band alike. */
|
|
87
87
|
color: var(--text);
|
|
88
88
|
border: 1px solid var(--border);
|
|
89
|
-
border-radius:
|
|
89
|
+
border-radius: var(--radius-pill);
|
|
90
90
|
font: inherit;
|
|
91
91
|
transition:
|
|
92
92
|
transform var(--dur-fast) var(--ease),
|
|
@@ -216,11 +216,8 @@
|
|
|
216
216
|
@media (forced-colors: active) {
|
|
217
217
|
.vopt:hover { border: 1px solid Highlight; padding: 9px 12px; }
|
|
218
218
|
}
|
|
219
|
-
/* The row is a keyboard stop
|
|
220
|
-
|
|
221
|
-
the arrow keys, and this is one. It takes the ring on its own 10px radius, the
|
|
222
|
-
same way `.amenu a` above does. #482 */
|
|
223
|
-
.vopt:focus-visible { outline: var(--ring); outline-offset: var(--ring-offset); }
|
|
219
|
+
/* The row is a keyboard stop and a `.ui-dropdown__item`, so it takes the kit row's inward
|
|
220
|
+
ring on its own 10px radius. #482, #824 */
|
|
224
221
|
/* The selected version carries the kit's menu tick, as `.ui-dropdown__tick` does for
|
|
225
222
|
every other menu; the badge keeps its own place beside it. */
|
|
226
223
|
.vopt .vtick { margin-left: 8px; flex: none; display: none; color: var(--accent); margin-top: 1px; }
|
|
@@ -378,11 +375,12 @@
|
|
|
378
375
|
/* `margin` bleeds the head back through the 6px panel padding above, the way
|
|
379
376
|
`.ui-dropdown__panel > .ui-dropdown__head` already does for its own panel:
|
|
380
377
|
the border-bottom hairline reaches the panel's edge instead of stopping a
|
|
381
|
-
notch short of it. #641's warning.
|
|
378
|
+
notch short of it. #641's warning. The 5px below is the kit head's own gap, so the first
|
|
379
|
+
row's fill and ring stand clear of the hairline. #824
|
|
382
380
|
why: docs/components.md#the-dropdown-panel */
|
|
383
381
|
.amenu .ahead {
|
|
384
382
|
padding: 13px 15px;
|
|
385
|
-
margin: -6px -6px
|
|
383
|
+
margin: -6px -6px 5px;
|
|
386
384
|
border-bottom: 1px solid var(--border);
|
|
387
385
|
border-radius: 14px 14px 0 0;
|
|
388
386
|
display: flex; align-items: center; gap: 11px;
|
|
@@ -398,8 +396,12 @@
|
|
|
398
396
|
reserve too rather than leaving the start of the list short. #641's danger 2.
|
|
399
397
|
why: docs/components.md#a-menu-panel-does-not-cut-off-its-rows-ring */
|
|
400
398
|
.amenu a { display: flex; align-items: center; gap: 11px; padding: 10px 15px; color: var(--text); text-decoration: none; font-family: var(--font-sans); font-size: var(--text-sm); cursor: pointer; scroll-margin-block: 3px; }
|
|
401
|
-
|
|
402
|
-
.
|
|
399
|
+
/* The row is a `.ui-dropdown__item`, so the kit's menu row draws its hover fill, its corner
|
|
400
|
+
and its inward ring. A pointer draws no edge on a row. #824 */
|
|
401
|
+
@media (forced-colors: active) {
|
|
402
|
+
/* The kit's hover border is 1px; this padding keeps the row's text still under it. */
|
|
403
|
+
.amenu a:hover { padding: 9px 14px; }
|
|
404
|
+
}
|
|
403
405
|
.amenu a.cur { color: var(--accent); }
|
|
404
406
|
/* A custom account row keeps the Dropdown's disabled state without its row shape. */
|
|
405
407
|
.amenu a.is-disabled { /* muted-ink: state — unavailable account page */ color: var(--disabled-ink); cursor: not-allowed; pointer-events: none; }
|