@tristan2828/ui-foundation 4.96.0 → 4.97.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/conventions/AGENTS.md +1 -1
- package/conventions/docs/add-an-entity.md +38 -26
- package/conventions/docs/cell-patterns.md +57 -54
- package/conventions/docs/design-language.md +78 -42
- package/conventions/docs/reminders.md +2 -2
- package/conventions/docs/timed-screens.md +1 -1
- package/dist/components/app/action-error.js +1 -1
- package/dist/components/app/allow-reminders.js +1 -1
- package/dist/components/app/app-shell.js +4 -4
- package/dist/components/app/board.js +1 -1
- package/dist/components/app/choice-buttons.js +6 -1
- package/dist/components/app/data-table-tools.js +2 -2
- package/dist/components/app/data-table.js +4 -4
- package/dist/components/app/date-field.js +1 -1
- package/dist/components/app/emoji-field-data.js +7 -7
- package/dist/components/app/entity-form.js +1 -1
- package/dist/components/app/entity-view.js +5 -5
- package/dist/components/app/error-state.js +1 -1
- package/dist/components/app/field-rows.js +6 -3
- package/dist/components/app/fill-in-queue.js +2 -2
- package/dist/components/app/filter-bar.js +1 -1
- package/dist/components/app/form-dialog.js +1 -1
- package/dist/components/app/form-section.d.ts +1 -1
- package/dist/components/app/image-field.js +3 -2
- package/dist/components/app/list-header.js +2 -2
- package/dist/components/app/milkdown-editor.js +4 -4
- package/dist/components/app/month-day-field.js +3 -3
- package/dist/components/app/multi-pick.js +1 -1
- package/dist/components/app/needs-you.js +1 -1
- package/dist/components/app/notes-outline.js +1 -1
- package/dist/components/app/password-input.js +1 -1
- package/dist/components/app/record-dialog.js +1 -1
- package/dist/components/app/rich-text-format-items.js +6 -6
- package/dist/components/app/rich-text-highlight-menu.js +1 -1
- package/dist/components/app/rich-text-table-grips.js +16 -16
- package/dist/components/app/rich-text-toolbar.js +2 -2
- package/dist/components/app/rich-text-widgets.js +2 -2
- package/dist/components/app/secondary-filters.js +2 -2
- package/dist/components/app/session-view.js +1 -1
- package/dist/components/app/timeline.js +1 -1
- package/dist/components/app/widget-layout-sheet.js +1 -1
- package/dist/components/ui/combobox.js +1 -1
- package/dist/components/ui/dialog.js +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/lib/group-by-day.js +2 -2
- package/dist/lib/title-case.d.ts +13 -0
- package/dist/lib/title-case.js +66 -0
- package/dist/routes/login.js +4 -4
- package/dist/routes/register.js +1 -1
- package/package.json +1 -1
package/conventions/AGENTS.md
CHANGED
|
@@ -115,7 +115,7 @@ A notification at a time the user chose, with the app closed, is Web
|
|
|
115
115
|
Push: `pwa()` in `vite.config.ts`, `AllowReminders` with
|
|
116
116
|
`usePushPermission()`, and the backend's `send_push` and reminders job.
|
|
117
117
|
Follow `docs/foundation/reminders.md`. Never ask for notification
|
|
118
|
-
permission on page load: only from the click on "Allow
|
|
118
|
+
permission on page load: only from the click on "Allow Reminders".
|
|
119
119
|
|
|
120
120
|
## Scope and Stopping
|
|
121
121
|
- Do the task you were given and nothing beyond it. A task is done when
|
|
@@ -15,17 +15,17 @@
|
|
|
15
15
|
- Step 8: Add Playwright specs for all three screens · lines 752–830
|
|
16
16
|
- Step 9: Register the nav entry and route names · lines 831–845
|
|
17
17
|
- Step 10: `npm run verify`. · lines 846–848
|
|
18
|
-
- [How a list opens a record](#how-a-list-opens-a-record) · lines 850–
|
|
19
|
-
- [The record view](#the-record-view) · lines
|
|
20
|
-
- [Forms](#forms) · lines
|
|
21
|
-
- [Dialogs](#dialogs) · lines
|
|
22
|
-
- [Toasts and feedback](#toasts-and-feedback) · lines
|
|
23
|
-
- [What not to copy](#what-not-to-copy) · lines
|
|
24
|
-
- [After a commit, in the backend](#after-a-commit-in-the-backend) · lines
|
|
25
|
-
- [Deleting](#deleting) · lines
|
|
26
|
-
- [Fields only a script writes](#fields-only-a-script-writes) · lines
|
|
27
|
-
- [Searching one part of the app](#searching-one-part-of-the-app) · lines
|
|
28
|
-
- [What a chat is told about an entity](#what-a-chat-is-told-about-an-entity) · lines
|
|
18
|
+
- [How a list opens a record](#how-a-list-opens-a-record) · lines 850–1190
|
|
19
|
+
- [The record view](#the-record-view) · lines 1003–1054
|
|
20
|
+
- [Forms](#forms) · lines 1056–1110
|
|
21
|
+
- [Dialogs](#dialogs) · lines 1112–1140
|
|
22
|
+
- [Toasts and feedback](#toasts-and-feedback) · lines 1142–1190
|
|
23
|
+
- [What not to copy](#what-not-to-copy) · lines 1192–1218
|
|
24
|
+
- [After a commit, in the backend](#after-a-commit-in-the-backend) · lines 1220–1237
|
|
25
|
+
- [Deleting](#deleting) · lines 1239–1270
|
|
26
|
+
- [Fields only a script writes](#fields-only-a-script-writes) · lines 1272–1293
|
|
27
|
+
- [Searching one part of the app](#searching-one-part-of-the-app) · lines 1295–1304
|
|
28
|
+
- [What a chat is told about an entity](#what-a-chat-is-told-about-an-entity) · lines 1307–1349
|
|
29
29
|
|
|
30
30
|
<!-- /index -->
|
|
31
31
|
|
|
@@ -583,7 +583,7 @@ is a filled-in example while the Widgets demo is still here).
|
|
|
583
583
|
of its own; a removed page (soft-deleted) shows "Page removed" and,
|
|
584
584
|
with `onRestore` (the app's undelete, returning its promise),
|
|
585
585
|
Restore. Give the editor `onCreatePage={(title) => createPage(title).then((page) => pagePath(page))}`
|
|
586
|
-
too: "/page" (and Turn
|
|
586
|
+
too: "/page" (and Turn Into Page on selected words) asks for a
|
|
587
587
|
title, awaits the new page's address and puts in the link; a
|
|
588
588
|
rejection shows in the title box in the gateway's words and leaves
|
|
589
589
|
the text as it was. The page's own screen puts `PageTrail` above its
|
|
@@ -594,7 +594,7 @@ is a filled-in example while the Widgets demo is still here).
|
|
|
594
594
|
(under the record, or under the page whose note it's in).
|
|
595
595
|
- **Notes worth taking on paper** (a visit's prep and questions, a
|
|
596
596
|
guide, a checklist to tick by hand): mark each of those sections
|
|
597
|
-
`print: true`. The header gets a Print
|
|
597
|
+
`print: true`. The header gets a Print Notes icon (`printLabel`
|
|
598
598
|
renames its tooltip and name) that prints the marked sections alone, under the title
|
|
599
599
|
and subtitle: no rail, no shell, no buttons, light paper in either
|
|
600
600
|
theme, headings and bullets as written, nothing folded, tables
|
|
@@ -760,7 +760,7 @@ is a filled-in example while the Widgets demo is still here).
|
|
|
760
760
|
start), and load once more if the server refused one of its files,
|
|
761
761
|
so a spec's first expect never meets an empty page. The view's states are
|
|
762
762
|
loading, not found (a 404: "Not found", the way back, no retry), error
|
|
763
|
-
(a failed load, then Try
|
|
763
|
+
(a failed load, then Try Again recovering) and success (every section,
|
|
764
764
|
each value as its cell shows it), plus the sparse record showing its
|
|
765
765
|
"not set" labels and no blank value. Its flows: the table's title link
|
|
766
766
|
opens it, saving and cancelling the form return to it, creating opens
|
|
@@ -858,12 +858,16 @@ picks one per list (`docs/entities/<entity>.md` "List screen"):
|
|
|
858
858
|
|
|
859
859
|
| `opens.kind` | The record opens | Use it for |
|
|
860
860
|
| --- | --- | --- |
|
|
861
|
-
| `dialog` | in a dialog over the list, with Open
|
|
861
|
+
| `dialog` | in a dialog over the list, with Open Full Page; the record also has its page | most records |
|
|
862
862
|
| `dialog-only` | in a dialog over the list, and has no page of its own | a small record with no notes, where a page would only repeat the dialog |
|
|
863
863
|
| `page` | on its own page, `/<entity>/:id` | a record too big for a dialog: a drawing, an ordered sub-list, long writing |
|
|
864
864
|
| `panel` | in the panel beside the list (`detailPanel`) | reading records one after another |
|
|
865
865
|
| `rows` | nowhere: every value is edited in its row (cell pattern 18) | a record of a field or two |
|
|
866
866
|
|
|
867
|
+
A list's title, column headers, menus, view pills and buttons are Title
|
|
868
|
+
Case ("Rows per Page", "Show Deleted", "View All"); its empty state and
|
|
869
|
+
messages are sentences ("No books yet") ([design-language.md "Words on screen"](design-language.md#words-on-screen-title-case-and-sentence-case)).
|
|
870
|
+
|
|
867
871
|
Whichever it is, the record edits in place (cell pattern 18, EntityView's
|
|
868
872
|
`edit`) rather than through an Edit button and a form page, wherever the
|
|
869
873
|
plan allows it.
|
|
@@ -981,13 +985,13 @@ const created = useNewRecordDialog()
|
|
|
981
985
|
back to the list's entry (over every record opened inside the dialog,
|
|
982
986
|
a linked one included). Focus goes back to the row, on its own link
|
|
983
987
|
when it has one, or the link that opened it.
|
|
984
|
-
- **Open
|
|
988
|
+
- **Open Full Page**, in the dialog's bar (not with `fullPage={false}`),
|
|
985
989
|
swaps the entry for the same address as the full page; Back from there
|
|
986
990
|
is the list.
|
|
987
991
|
- **The view is unchanged.** `EntityView` sees the dialog: its title
|
|
988
992
|
names the dialog (`label` names it while loading or on an error), the
|
|
989
993
|
back link gives way to the dialog's bar, and not found's "Back to …"
|
|
990
|
-
closes the dialog. Loading, error with Try
|
|
994
|
+
closes the dialog. Loading, error with Try Again, and the plain 404
|
|
991
995
|
show inside it. A screen that isn't an `EntityView` can read
|
|
992
996
|
`useRecordDialog()` (null on the full page) for its `close`, as a
|
|
993
997
|
Delete should, rather than navigating to the list:
|
|
@@ -1000,7 +1004,10 @@ const created = useNewRecordDialog()
|
|
|
1000
1004
|
|
|
1001
1005
|
Every record a list opens is an `EntityView`, the same one in a dialog
|
|
1002
1006
|
and on its page, and every one has the same shape, so a change to the
|
|
1003
|
-
view reaches them all.
|
|
1007
|
+
view reaches them all. Its field labels, tab names and buttons are Title
|
|
1008
|
+
Case ("Print Notes", "Hide Empty"); an empty value's words and its
|
|
1009
|
+
messages are sentences ("Not set") ([design-language.md "Words on screen"](design-language.md#words-on-screen-title-case-and-sentence-case)).
|
|
1010
|
+
A record uses the parts it has, in this order:
|
|
1004
1011
|
|
|
1005
1012
|
- **Header**: the title, edited in place (`titleEdit`); under it a
|
|
1006
1013
|
one-line summary field, edited in place (`subtitle`: a goal, a
|
|
@@ -1017,7 +1024,7 @@ view reaches them all. A record uses the parts it has, in this order:
|
|
|
1017
1024
|
`mobileOrder="main-first"`: the label/value facts in the rail, the long
|
|
1018
1025
|
text in the main column, folded by its toggle headings (`foldKey`;
|
|
1019
1026
|
`## Safety {toggle="true"}`, the only headings that fold) with an
|
|
1020
|
-
Outline for a long one and Print
|
|
1027
|
+
Outline for a long one and Print Notes (`print`). Without long text,
|
|
1021
1028
|
one column. Every value edited in place (`edit`), a sub-item list
|
|
1022
1029
|
included (`editInPlace({ kind: 'list' })`).
|
|
1023
1030
|
- **Tabs** (4.76), for a main column with **three or more groups of
|
|
@@ -1067,8 +1074,10 @@ shape (4.85):
|
|
|
1067
1074
|
- **Required:** `<FieldLabel required>` (an asterisk, and `aria-required`
|
|
1068
1075
|
on the control it names). Nothing on an optional field: never
|
|
1069
1076
|
"(optional)".
|
|
1070
|
-
- **Labels** above the box,
|
|
1071
|
-
|
|
1077
|
+
- **Labels** above the box, in Title Case ("My Rating"), and the form's
|
|
1078
|
+
title, section titles and buttons too ("Save Changes"); help text,
|
|
1079
|
+
placeholders and messages stay sentence case ([design-language.md "Words on screen"](design-language.md#words-on-screen-title-case-and-sentence-case)).
|
|
1080
|
+
Help text (`FieldDescription`) only where the label can't say it, one short line.
|
|
1072
1081
|
A placeholder only for a format the box needs (`https://`), never an
|
|
1073
1082
|
example that looks like a value.
|
|
1074
1083
|
- **Messages say what to do**, in the app's voice: "Give it a title",
|
|
@@ -1082,7 +1091,7 @@ shape (4.85):
|
|
|
1082
1091
|
`ReferenceCombobox` (`inPlace.reference` in place), several are
|
|
1083
1092
|
`MultiReference`, and a set the app loads whole (tags, a few dozen
|
|
1084
1093
|
records from its list query) is `MultiPick`, whose chips wrap and which
|
|
1085
|
-
shows 30 before "Show
|
|
1094
|
+
shows 30 before "Show All". Where a missing record stops the form, give
|
|
1086
1095
|
the reference `onCreate(name)`: open the other entity's `FormDialog`
|
|
1087
1096
|
with the name filled in, and resolve with the record it saves (or
|
|
1088
1097
|
`null` on Cancel).
|
|
@@ -1095,7 +1104,7 @@ shape (4.85):
|
|
|
1095
1104
|
`isSubmitting` (the save's own move to the record) doesn't. With
|
|
1096
1105
|
`errors`, a refused Add moves to the first problem and the bar says
|
|
1097
1106
|
"2 to fix". Both come free; the form draws a failed save as a `Notice`
|
|
1098
|
-
with Try
|
|
1107
|
+
with Try Again in its bar, which sticks to the window's bottom on a long
|
|
1099
1108
|
form.
|
|
1100
1109
|
- **The words:** "New book", "Add book" (the word Add on every create
|
|
1101
1110
|
form), and the toast after it "Added The Long Walk".
|
|
@@ -1110,6 +1119,9 @@ Every dialog is one of three widths, `DialogContent`'s `size` (4.82):
|
|
|
1110
1119
|
| `form` | 640px | the whole screen, the title and buttons pinned | a small form (`FormDialog`, which is this size) |
|
|
1111
1120
|
| `record` | 1,120px | full width, the rail under the main column | a record over its list (`RecordDialogRoute`, which is this size) |
|
|
1112
1121
|
|
|
1122
|
+
- **A dialog's title and buttons are Title Case** ("New Book", "Keep
|
|
1123
|
+
Editing"); a question or a message in it is a sentence ("Discard your
|
|
1124
|
+
changes?") ([design-language.md "Words on screen"](design-language.md#words-on-screen-title-case-and-sentence-case)).
|
|
1113
1125
|
- **Never a width of its own** (`sm:max-w-…` on `DialogContent`). A
|
|
1114
1126
|
confirm's buttons go in `DialogFooter`, Cancel first, so the phone's
|
|
1115
1127
|
sheet stacks the action on top.
|
|
@@ -1121,7 +1133,7 @@ Every dialog is one of three widths, `DialogContent`'s `size` (4.82):
|
|
|
1121
1133
|
its own, for any other way of leaving with something unsaved.
|
|
1122
1134
|
- **A form in a dialog is a `FormDialog`**: the title, the fields
|
|
1123
1135
|
scrolling between it and the pinned Cancel and Add, a failed save as a
|
|
1124
|
-
destructive `Notice` above the buttons with Try
|
|
1136
|
+
destructive `Notice` above the buttons with Try Again, and `dirty`.
|
|
1125
1137
|
Opened from a page with `open`/`onOpenChange`; as a list's `new` route
|
|
1126
1138
|
with neither (above).
|
|
1127
1139
|
- **Always a dialog, never a side panel**, except a phone's filters
|
|
@@ -1138,7 +1150,7 @@ sight.** What happened where the person is looking says so there.
|
|
|
1138
1150
|
| A delete (soft: with Undo) | `DeleteAction`'s toast, "Deleted The Long Walk" |
|
|
1139
1151
|
| A record made, landing on its own page | a toast, "Added The Long Walk" |
|
|
1140
1152
|
| An edit in place, a quick action, a toggle | the value itself and its "Saved" (cell pattern 18). **Never a toast** |
|
|
1141
|
-
| An action that failed, its button still there | `ActionError` beside the button: the reason and Try
|
|
1153
|
+
| An action that failed, its button still there | `ActionError` beside the button: the reason and Try Again |
|
|
1142
1154
|
| An action that failed after its page was left | a toast that stays until it's closed (`useAction` does this) |
|
|
1143
1155
|
| A job that takes a while | `JobStatus` beside its button: "Checking 3 of 12…", then the result stays |
|
|
1144
1156
|
| A job that finished after its page was left | a toast (`useAction`'s `doneAway`) |
|
|
@@ -1160,7 +1172,7 @@ sight.** What happened where the person is looking says so there.
|
|
|
1160
1172
|
and `onDelete={(why) => remove({ id, reason: why })}`, `why` trimmed
|
|
1161
1173
|
and `''` when nothing's typed. The rest is the same confirm: 420px, a
|
|
1162
1174
|
bottom sheet on a phone, Cancel then the filled destructive button, a
|
|
1163
|
-
refusal in the dialog with Try
|
|
1175
|
+
refusal in the dialog with Try Again (sending the same words), and
|
|
1164
1176
|
closing with something typed asks "Discard your changes?" first. One
|
|
1165
1177
|
field only: a confirm that needs more is a `FormDialog`.
|
|
1166
1178
|
- **A toast's words come from `notify.done(verb, name, { undo })`**: the
|
|
@@ -3,46 +3,46 @@
|
|
|
3
3
|
<!-- index: written by `npm run docs:index` in the package from the headings below; never edit it by hand -->
|
|
4
4
|
## Index
|
|
5
5
|
|
|
6
|
-
- [The rules that apply to every cell](#the-rules-that-apply-to-every-cell) · lines 74–
|
|
7
|
-
- [1. Plain text](#1-plain-text) · lines
|
|
8
|
-
- [2. Icon + label](#2-icon--label) · lines
|
|
9
|
-
- [3. Icon in a badge](#3-icon-in-a-badge) · lines
|
|
10
|
-
- [4. Icon only, label in a tooltip](#4-icon-only-label-in-a-tooltip) · lines
|
|
11
|
-
- [Several values: the icons side by side, every name in one tooltip](#several-values-the-icons-side-by-side-every-name-in-one-tooltip) · lines
|
|
12
|
-
- [5. Enum → tone-mapped badge](#5-enum--tone-mapped-badge) · lines
|
|
13
|
-
- [6. Multi-value enum, clustered](#6-multi-value-enum-clustered) · lines
|
|
14
|
-
- [7. Link as an outline button](#7-link-as-an-outline-button) · lines
|
|
15
|
-
- [8. Date, relative](#8-date-relative) · lines
|
|
16
|
-
- [9. Ordinal scale (bounded integer)](#9-ordinal-scale-bounded-integer) · lines
|
|
17
|
-
- [Two variants the package draws: a step bar and a star](#two-variants-the-package-draws-a-step-bar-and-a-star) · lines
|
|
18
|
-
- [10. Summary in the cell, detail in a popover](#10-summary-in-the-cell-detail-in-a-popover) · lines
|
|
19
|
-
- [A second example: what a row depends on](#a-second-example-what-a-row-depends-on) · lines
|
|
20
|
-
- [11. Number or currency — Unproven](#11-number-or-currency--unproven) · lines
|
|
21
|
-
- [12. Boolean](#12-boolean) · lines
|
|
22
|
-
- [13. Progress bar — Unproven](#13-progress-bar--unproven) · lines
|
|
23
|
-
- [The compact form: `ProgressRing`](#the-compact-form-progressring) · lines
|
|
24
|
-
- [14. Avatar and name — Unproven](#14-avatar-and-name--unproven) · lines
|
|
25
|
-
- [15. Yes/no you flip in the row](#15-yesno-you-flip-in-the-row) · lines
|
|
26
|
-
- [A variant: a pressed icon inside another value's cell](#a-variant-a-pressed-icon-inside-another-values-cell) · lines
|
|
27
|
-
- [16. Title linking to the record's view](#16-title-linking-to-the-records-view) · lines
|
|
28
|
-
- [17. Quick action on the view](#17-quick-action-on-the-view) · lines
|
|
29
|
-
- [18. Editable value](#18-editable-value) · lines
|
|
30
|
-
- [Presets: one line per field](#presets-one-line-per-field) · lines
|
|
31
|
-
- [Several fields edited as one](#several-fields-edited-as-one) · lines
|
|
32
|
-
- [A link and its label](#a-link-and-its-label) · lines
|
|
33
|
-
- [A list of sub-items](#a-list-of-sub-items) · lines
|
|
34
|
-
- [In a table's rows](#in-a-tables-rows) · lines
|
|
35
|
-
- [A table of a few short columns: `width="content"`](#a-table-of-a-few-short-columns-widthcontent) · lines
|
|
36
|
-
- [19. Stage circle for an ordered status](#19-stage-circle-for-an-ordered-status) · lines
|
|
37
|
-
- [20. Count linking to the related records](#20-count-linking-to-the-related-records) · lines
|
|
38
|
-
- [21. Rows grouped under headings, and a pill filter](#21-rows-grouped-under-headings-and-a-pill-filter) · lines
|
|
39
|
-
- [22. A highlighted row, and rows that are done](#22-a-highlighted-row-and-rows-that-are-done) · lines
|
|
40
|
-
- [24. A list's rows: hover, lines, rows per page](#24-a-lists-rows-hover-lines-rows-per-page) · lines
|
|
41
|
-
- [23. A Group menu, and a record read beside the list](#23-a-group-menu-and-a-record-read-beside-the-list) · lines
|
|
42
|
-
- [24. A stored colour beside its name](#24-a-stored-colour-beside-its-name) · lines
|
|
43
|
-
- [25. A list's tools: views, filters, columns, row actions, a phone's rows](#25-a-lists-tools-views-filters-columns-row-actions-a-phones-rows) · lines
|
|
44
|
-
- [26. A record's related list, capped](#26-a-records-related-list-capped) · lines
|
|
45
|
-
- [27. A repeat and its next time](#27-a-repeat-and-its-next-time) · lines
|
|
6
|
+
- [The rules that apply to every cell](#the-rules-that-apply-to-every-cell) · lines 74–97
|
|
7
|
+
- [1. Plain text](#1-plain-text) · lines 99–152
|
|
8
|
+
- [2. Icon + label](#2-icon--label) · lines 154–177
|
|
9
|
+
- [3. Icon in a badge](#3-icon-in-a-badge) · lines 179–192
|
|
10
|
+
- [4. Icon only, label in a tooltip](#4-icon-only-label-in-a-tooltip) · lines 194–271
|
|
11
|
+
- [Several values: the icons side by side, every name in one tooltip](#several-values-the-icons-side-by-side-every-name-in-one-tooltip) · lines 219–271
|
|
12
|
+
- [5. Enum → tone-mapped badge](#5-enum--tone-mapped-badge) · lines 273–286
|
|
13
|
+
- [6. Multi-value enum, clustered](#6-multi-value-enum-clustered) · lines 288–300
|
|
14
|
+
- [7. Link as an outline button](#7-link-as-an-outline-button) · lines 302–323
|
|
15
|
+
- [8. Date, relative](#8-date-relative) · lines 325–362
|
|
16
|
+
- [9. Ordinal scale (bounded integer)](#9-ordinal-scale-bounded-integer) · lines 364–412
|
|
17
|
+
- [Two variants the package draws: a step bar and a star](#two-variants-the-package-draws-a-step-bar-and-a-star) · lines 382–412
|
|
18
|
+
- [10. Summary in the cell, detail in a popover](#10-summary-in-the-cell-detail-in-a-popover) · lines 414–464
|
|
19
|
+
- [A second example: what a row depends on](#a-second-example-what-a-row-depends-on) · lines 432–464
|
|
20
|
+
- [11. Number or currency — Unproven](#11-number-or-currency--unproven) · lines 466–506
|
|
21
|
+
- [12. Boolean](#12-boolean) · lines 508–538
|
|
22
|
+
- [13. Progress bar — Unproven](#13-progress-bar--unproven) · lines 540–576
|
|
23
|
+
- [The compact form: `ProgressRing`](#the-compact-form-progressring) · lines 560–576
|
|
24
|
+
- [14. Avatar and name — Unproven](#14-avatar-and-name--unproven) · lines 578–595
|
|
25
|
+
- [15. Yes/no you flip in the row](#15-yesno-you-flip-in-the-row) · lines 597–706
|
|
26
|
+
- [A variant: a pressed icon inside another value's cell](#a-variant-a-pressed-icon-inside-another-values-cell) · lines 623–706
|
|
27
|
+
- [16. Title linking to the record's view](#16-title-linking-to-the-records-view) · lines 708–743
|
|
28
|
+
- [17. Quick action on the view](#17-quick-action-on-the-view) · lines 745–818
|
|
29
|
+
- [18. Editable value](#18-editable-value) · lines 820–1498
|
|
30
|
+
- [Presets: one line per field](#presets-one-line-per-field) · lines 1130–1198
|
|
31
|
+
- [Several fields edited as one](#several-fields-edited-as-one) · lines 1200–1236
|
|
32
|
+
- [A link and its label](#a-link-and-its-label) · lines 1238–1262
|
|
33
|
+
- [A list of sub-items](#a-list-of-sub-items) · lines 1264–1397
|
|
34
|
+
- [In a table's rows](#in-a-tables-rows) · lines 1399–1484
|
|
35
|
+
- [A table of a few short columns: `width="content"`](#a-table-of-a-few-short-columns-widthcontent) · lines 1486–1498
|
|
36
|
+
- [19. Stage circle for an ordered status](#19-stage-circle-for-an-ordered-status) · lines 1500–1566
|
|
37
|
+
- [20. Count linking to the related records](#20-count-linking-to-the-related-records) · lines 1568–1632
|
|
38
|
+
- [21. Rows grouped under headings, and a pill filter](#21-rows-grouped-under-headings-and-a-pill-filter) · lines 1634–1732
|
|
39
|
+
- [22. A highlighted row, and rows that are done](#22-a-highlighted-row-and-rows-that-are-done) · lines 1734–1763
|
|
40
|
+
- [24. A list's rows: hover, lines, rows per page](#24-a-lists-rows-hover-lines-rows-per-page) · lines 1765–1803
|
|
41
|
+
- [23. A Group menu, and a record read beside the list](#23-a-group-menu-and-a-record-read-beside-the-list) · lines 1805–1881
|
|
42
|
+
- [24. A stored colour beside its name](#24-a-stored-colour-beside-its-name) · lines 1883–1906
|
|
43
|
+
- [25. A list's tools: views, filters, columns, row actions, a phone's rows](#25-a-lists-tools-views-filters-columns-row-actions-a-phones-rows) · lines 1908–1994
|
|
44
|
+
- [26. A record's related list, capped](#26-a-records-related-list-capped) · lines 1996–2032
|
|
45
|
+
- [27. A repeat and its next time](#27-a-repeat-and-its-next-time) · lines 2034–2079
|
|
46
46
|
|
|
47
47
|
<!-- /index -->
|
|
48
48
|
|
|
@@ -88,6 +88,9 @@ too, so it ships here for every app.
|
|
|
88
88
|
falling back.
|
|
89
89
|
- **A cell that reads across the row needs `row.original`**, not just
|
|
90
90
|
`getValue()`.
|
|
91
|
+
- **Column headers are Title Case** ("Available From", "Rows per Page");
|
|
92
|
+
a cell's value is written as its data is, and an empty value's words
|
|
93
|
+
("Not set") are a sentence ([design-language.md "Words on screen"](design-language.md#words-on-screen-title-case-and-sentence-case)).
|
|
91
94
|
- **Give a repeated control a row-specific `aria-label`.** Twenty-five
|
|
92
95
|
buttons all named "Link" are useless to a screen reader.
|
|
93
96
|
|
|
@@ -892,7 +895,7 @@ and in place: every option a toggle chip with its icon or colour where
|
|
|
892
895
|
the app draws one (`icon`), the picked ones pressed with a check, and a
|
|
893
896
|
filter box above them, not in front of them. The chips wrap at every
|
|
894
897
|
width (4.88); past 30 options (`limit`) it shows the picked ones and the
|
|
895
|
-
first 30, then "Show
|
|
898
|
+
first 30, then "Show All N", and a filter searches them all. The options
|
|
896
899
|
can be the app's list of records (its query's rows as `{ id, label }`,
|
|
897
900
|
`loading` meanwhile), so links to a few dozen other records use it too.
|
|
898
901
|
Larger sets, or ones that grow with the data, keep `MultiReference`
|
|
@@ -1037,7 +1040,7 @@ description: editInPlace({
|
|
|
1037
1040
|
```
|
|
1038
1041
|
|
|
1039
1042
|
**Leaving the page** (a link, Back) while a value holds unsaved text asks
|
|
1040
|
-
"Discard your changes?" first (Keep
|
|
1043
|
+
"Discard your changes?" first (Keep Editing / Discard); closing the tab
|
|
1041
1044
|
asks through the browser. A link press doesn't save the field on its
|
|
1042
1045
|
way out: the prompt decides.
|
|
1043
1046
|
|
|
@@ -1097,7 +1100,7 @@ const price = editInPlace({
|
|
|
1097
1100
|
highlighted in four colours (amber, yellow, green, red) from the
|
|
1098
1101
|
toolbars' Highlight menu or with "/highlight", and un-highlighted;
|
|
1099
1102
|
they're saved as `==words==` (`=={green}words==` for the others), plain
|
|
1100
|
-
Markdown, and `<Markdown>` shows them. The fixed toolbar's Full
|
|
1103
|
+
Markdown, and `<Markdown>` shows them. The fixed toolbar's Full Screen
|
|
1101
1104
|
button fills the window with the field (Esc leaves; nothing is lost or
|
|
1102
1105
|
saved by it), and on a touch screen or under 768px it carries Indent
|
|
1103
1106
|
and Outdent for list items, where there is no Tab. A field with only the
|
|
@@ -1631,7 +1634,7 @@ What the cell decides:
|
|
|
1631
1634
|
## 21. Rows grouped under headings, and a pill filter
|
|
1632
1635
|
|
|
1633
1636
|
A feed, an activity log or a timeline reads best as rows under day
|
|
1634
|
-
headings (Today, Yesterday, Earlier
|
|
1637
|
+
headings (Today, Yesterday, Earlier This Week, then each older week, then
|
|
1635
1638
|
months), each heading with a count and a summary ("4 · 1 h 12 m"). The
|
|
1636
1639
|
same screens usually want one quick filter as pills above the rows (All /
|
|
1637
1640
|
Video / Audio / Text, one pressed at a time) rather than a dropdown: there
|
|
@@ -1652,7 +1655,7 @@ const { page, filters, setFilter, setPage } = useTableUrlState(['kind'])
|
|
|
1652
1655
|
groupBy={byPublished}
|
|
1653
1656
|
groupSummary={(items) => `${items.length} · ${duration(sum(items, 'minutes'))}`}
|
|
1654
1657
|
emptyTitle={filters.kind ? `No ${KIND_LABELS[filters.kind].toLowerCase()} items` : 'Nothing in the feed yet'}
|
|
1655
|
-
emptyAction={filters.kind ? <Button variant="outline" onClick={() => setFilter('kind', '')}>Show
|
|
1658
|
+
emptyAction={filters.kind ? <Button variant="outline" onClick={() => setFilter('kind', '')}>Show All Types</Button> : undefined}
|
|
1656
1659
|
toolbar={
|
|
1657
1660
|
<PillFilter label="Type" value={filters.kind} onValueChange={(kind) => setFilter('kind', kind)}
|
|
1658
1661
|
options={KINDS.map((kind) => ({ value: kind, label: KIND_LABELS[kind] }))} />
|
|
@@ -1672,7 +1675,7 @@ const { page, filters, setFilter, setPage } = useTableUrlState(['kind'])
|
|
|
1672
1675
|
saving change never moves a row to the wrong day. Weeks start on
|
|
1673
1676
|
Monday (`weekStartsOn: 0` for Sunday). Four weeks back it switches to
|
|
1674
1677
|
months ("September", "December 2025"). A later date is Upcoming, no
|
|
1675
|
-
date is No
|
|
1678
|
+
date is No Date. Pin `now` in a test, as for pattern 8.
|
|
1676
1679
|
- **A heading is a row header for its group** (`<th scope="rowgroup">`
|
|
1677
1680
|
in the group's own `<tbody>`), so a screen reader names a cell's group
|
|
1678
1681
|
as it names its column. It stays in view while a wide table scrolls
|
|
@@ -1776,7 +1779,7 @@ standard), and the two choices it leaves an app.
|
|
|
1776
1779
|
- **No zebra stripes:** rows are told apart by the line under each.
|
|
1777
1780
|
`striped` brings the stripes back for an app that wants them. Tables in
|
|
1778
1781
|
notes keep theirs (4.67.1).
|
|
1779
|
-
- **Rows per
|
|
1782
|
+
- **Rows per Page:** a menu in the pagination bar, from
|
|
1780
1783
|
`useTableUrlState`, which keeps the pick in the URL (`?size=`) and on
|
|
1781
1784
|
this device:
|
|
1782
1785
|
|
|
@@ -1833,7 +1836,7 @@ const { grouping, setGrouping, ...table } = useTableUrlState(FILTERS, MULTI, VIE
|
|
|
1833
1836
|
- **None is the default**, and the table is exactly as it was until a
|
|
1834
1837
|
grouping is picked. The Group menu sits at the end of the toolbar
|
|
1835
1838
|
(before a layout switch): None, then each grouping. While grouped a
|
|
1836
|
-
Fold
|
|
1839
|
+
Fold All button joins it, and the menu says which ("Group: Status").
|
|
1837
1840
|
- **Only choice fields**: each group is one of the field's options, in
|
|
1838
1841
|
the options' order (the order the form lists them), so give the same
|
|
1839
1842
|
options list the column and the form use. A multi-value field (an
|
|
@@ -1954,7 +1957,7 @@ const { filters, multiFilters, setFilter, setFilters, setMultiFilter, activeView
|
|
|
1954
1957
|
views, each with its `label`, in order. The view on is pressed; none is
|
|
1955
1958
|
once the filters move off every view. Under 48rem they stay on one line
|
|
1956
1959
|
that scrolls sideways. Replaces a hand-written row of view buttons; a
|
|
1957
|
-
Deleted view goes in ListHeader's ⋯ menu as Show
|
|
1960
|
+
Deleted view goes in ListHeader's ⋯ menu as Show Deleted instead.
|
|
1958
1961
|
- **The filters** (L4): `FilterBar` holds search, the two filters used
|
|
1959
1962
|
most (`primary`), and the rest behind Filters (`secondary`, with their
|
|
1960
1963
|
chips, as `SecondaryFilters` draws them). No captions over controls:
|
|
@@ -1993,7 +1996,7 @@ const { filters, multiFilters, setFilter, setFilters, setMultiFilter, activeView
|
|
|
1993
1996
|
## 26. A record's related list, capped
|
|
1994
1997
|
|
|
1995
1998
|
A list of records related to this one, in a section of its view (a
|
|
1996
|
-
provider's visits, a project's tasks): the ten newest, then View
|
|
1999
|
+
provider's visits, a project's tasks): the ten newest, then View All N to
|
|
1997
2000
|
the whole list filtered to this record (R8), so a long list doesn't push
|
|
1998
2001
|
the rest of the record away. With tabs (EntityView's), each such list
|
|
1999
2002
|
counts as a group.
|
|
@@ -2017,16 +2020,16 @@ const visits = useVisits({ provider: provider.id, sort: 'date:desc', page: 1, pa
|
|
|
2017
2020
|
```
|
|
2018
2021
|
|
|
2019
2022
|
- **`limit`** is 10 unless set; ask the server for that many, newest
|
|
2020
|
-
first. No pagination bar, and the headers aren't sort buttons (View
|
|
2023
|
+
first. No pagination bar, and the headers aren't sort buttons (View All
|
|
2021
2024
|
has the list's own sorting).
|
|
2022
|
-
- **View
|
|
2023
|
-
"View
|
|
2025
|
+
- **View All** shows only when `total` is over the rows shown, its text
|
|
2026
|
+
"View All 19" unless `viewAll.label` says otherwise. It's a link, so a
|
|
2024
2027
|
modified click opens a tab.
|
|
2025
2028
|
- **`opens` is required**, as on any list. Everything else a DataTable
|
|
2026
2029
|
takes for its rows (`rowActions`, `phoneRow`, `highlightRow`) works.
|
|
2027
2030
|
- On a DataTable of your own, `limit` and `viewAll` do the same.
|
|
2028
2031
|
- The fixture `app/DataTable tools` Related draws a capped list and a
|
|
2029
|
-
short one with no link; the spec follows View
|
|
2032
|
+
short one with no link; the spec follows View All.
|
|
2030
2033
|
|
|
2031
2034
|
## 27. A repeat and its next time
|
|
2032
2035
|
|
|
@@ -3,39 +3,40 @@
|
|
|
3
3
|
<!-- index: written by `npm run docs:index` in the package from the headings below; never edit it by hand -->
|
|
4
4
|
## Index
|
|
5
5
|
|
|
6
|
-
- [Palettes](#palettes) · lines
|
|
7
|
-
- [Glow](#glow) · lines
|
|
8
|
-
- [Semantic tones](#semantic-tones) · lines
|
|
9
|
-
- [The three badge styles](#the-three-badge-styles) · lines
|
|
10
|
-
- [Mapping an enum to tones](#mapping-an-enum-to-tones) · lines
|
|
11
|
-
- [Glyphs and icons: 3:1](#glyphs-and-icons-31) · lines
|
|
12
|
-
- [Logos and brand marks](#logos-and-brand-marks) · lines
|
|
13
|
-
- [Categorical colour](#categorical-colour) · lines
|
|
14
|
-
- [Heat scale](#heat-scale) · lines
|
|
15
|
-
- [Depth ramps](#depth-ramps) · lines
|
|
16
|
-
- [A stored colour](#a-stored-colour) · lines
|
|
17
|
-
- [Shapes and sizes](#shapes-and-sizes) · lines
|
|
18
|
-
- [Typography](#typography) · lines
|
|
19
|
-
- [
|
|
20
|
-
- [
|
|
21
|
-
|
|
22
|
-
- [
|
|
23
|
-
- [
|
|
24
|
-
- [
|
|
25
|
-
- [
|
|
26
|
-
|
|
27
|
-
- [
|
|
28
|
-
- [A list as
|
|
29
|
-
- [
|
|
30
|
-
- [
|
|
31
|
-
- [
|
|
32
|
-
- [
|
|
33
|
-
- [
|
|
34
|
-
- [A record's
|
|
35
|
-
- [
|
|
36
|
-
- [
|
|
37
|
-
- [
|
|
38
|
-
- [
|
|
6
|
+
- [Palettes](#palettes) · lines 49–156
|
|
7
|
+
- [Glow](#glow) · lines 158–177
|
|
8
|
+
- [Semantic tones](#semantic-tones) · lines 179–207
|
|
9
|
+
- [The three badge styles](#the-three-badge-styles) · lines 209–226
|
|
10
|
+
- [Mapping an enum to tones](#mapping-an-enum-to-tones) · lines 228–257
|
|
11
|
+
- [Glyphs and icons: 3:1](#glyphs-and-icons-31) · lines 259–272
|
|
12
|
+
- [Logos and brand marks](#logos-and-brand-marks) · lines 274–318
|
|
13
|
+
- [Categorical colour](#categorical-colour) · lines 320–390
|
|
14
|
+
- [Heat scale](#heat-scale) · lines 392–453
|
|
15
|
+
- [Depth ramps](#depth-ramps) · lines 455–540
|
|
16
|
+
- [A stored colour](#a-stored-colour) · lines 542–590
|
|
17
|
+
- [Shapes and sizes](#shapes-and-sizes) · lines 592–613
|
|
18
|
+
- [Typography](#typography) · lines 615–772
|
|
19
|
+
- [Words on screen: Title Case and sentence case](#words-on-screen-title-case-and-sentence-case) · lines 649–682
|
|
20
|
+
- [Written text (notes)](#written-text-notes) · lines 684–772
|
|
21
|
+
- [Density](#density) · lines 774–867
|
|
22
|
+
- [Rows on this device](#rows-on-this-device) · lines 840–867
|
|
23
|
+
- [Widget cards (hub pages)](#widget-cards-hub-pages) · lines 869–983
|
|
24
|
+
- [Module cards (a hub's places)](#module-cards-a-hubs-places) · lines 985–1062
|
|
25
|
+
- [Notices](#notices) · lines 1064–1092
|
|
26
|
+
- [A value over time](#a-value-over-time) · lines 1094–1180
|
|
27
|
+
- [Several values over time](#several-values-over-time) · lines 1143–1180
|
|
28
|
+
- [A list as a board](#a-list-as-a-board) · lines 1182–1233
|
|
29
|
+
- [A list as cards](#a-list-as-cards) · lines 1235–1281
|
|
30
|
+
- [Key numbers on a record](#key-numbers-on-a-record) · lines 1283–1312
|
|
31
|
+
- [Parts of the page standards](#parts-of-the-page-standards) · lines 1314–1357
|
|
32
|
+
- [A few equal things](#a-few-equal-things) · lines 1359–1443
|
|
33
|
+
- [An overview page](#an-overview-page) · lines 1445–1508
|
|
34
|
+
- [A record's header and empty values](#a-records-header-and-empty-values) · lines 1509–1560
|
|
35
|
+
- [A record's tabs, mark and rail](#a-records-tabs-mark-and-rail) · lines 1562–1607
|
|
36
|
+
- [Picking at random](#picking-at-random) · lines 1609–1640
|
|
37
|
+
- [Filling in what's missing](#filling-in-whats-missing) · lines 1642–1709
|
|
38
|
+
- [Values edited in place: the presets' looks](#values-edited-in-place-the-presets-looks) · lines 1711–1736
|
|
39
|
+
- [The sidebar and the phone's bar](#the-sidebar-and-the-phones-bar) · lines 1738–1811
|
|
39
40
|
|
|
40
41
|
<!-- /index -->
|
|
41
42
|
|
|
@@ -645,6 +646,41 @@ height and weight together, from tokens in the package's `styles/theme.css`:
|
|
|
645
646
|
- A shadcn primitive keeps its own sizes (`CardTitle`, `Button`). Don't put
|
|
646
647
|
a role on one: its built-in size classes would then compete with the role.
|
|
647
648
|
|
|
649
|
+
### Words on screen: Title Case and sentence case
|
|
650
|
+
|
|
651
|
+
Two cases, chosen by what the words are (4.97; before it, everything was
|
|
652
|
+
sentence case):
|
|
653
|
+
|
|
654
|
+
- **Title Case names a thing you can see or press:** page, dialog, sheet,
|
|
655
|
+
form, card and section titles; buttons and links that act like
|
|
656
|
+
buttons; menu items and menu labels; tabs and pills; column headers;
|
|
657
|
+
field labels; a group's heading in a list ("Earlier This Week"); and a
|
|
658
|
+
control's accessible name (`aria-label="Next Page"`, an icon button's
|
|
659
|
+
tooltip). "Show Deleted", "Try Again", "Rows per Page", "View All 12",
|
|
660
|
+
"Back to the List", "Save and Next", "Move To".
|
|
661
|
+
- **Sentence case is anything said to the person:** messages, help text
|
|
662
|
+
(`FieldDescription`), toasts, placeholders, a form's error ("Give it a
|
|
663
|
+
title"), an empty or error state's words, even its heading line
|
|
664
|
+
("Nothing here yet", "Something went wrong", "Couldn't load"), a
|
|
665
|
+
notice's title, a question ("Discard your changes?"), and a sentence
|
|
666
|
+
read to a screen reader (a live announcement, "Moved Fix the latch to
|
|
667
|
+
Done"). A value the app shows is written as its data is (a status
|
|
668
|
+
label, a rule's phrase "Every weekday", "Not set").
|
|
669
|
+
- **The small words stay lowercase** unless first or last, or first
|
|
670
|
+
after a colon: a, an, the, and, but, or, nor, as, at, by, for, in, of,
|
|
671
|
+
on, per, to, with (`TITLE_CASE_SMALL_WORDS`). Every other word,
|
|
672
|
+
however short, is capitalised ("Turn Into Page", "Show All", "Is",
|
|
673
|
+
"It"), and so is each part of a hyphenated word ("Follow-Up"). A word
|
|
674
|
+
that is part of a verb ("Sign In", "Log Out", "Turn Off") is
|
|
675
|
+
capitalised even where it is a small word elsewhere.
|
|
676
|
+
- **A label written in the code is written in Title Case**; a label built
|
|
677
|
+
from a value goes through `titleCase()` (`` `Add ${titleCase(noun)}` ``).
|
|
678
|
+
`titleCase` leaves a word that already holds a capital as written, so
|
|
679
|
+
names and acronyms survive ("Open in GitHub").
|
|
680
|
+
- **The words around a name keep the name's own case:** `Back to
|
|
681
|
+
${list}` gets the list's title as it is, `Actions for ${row}` the row's
|
|
682
|
+
name.
|
|
683
|
+
|
|
648
684
|
### Written text (notes)
|
|
649
685
|
|
|
650
686
|
A one-line value written as Markdown (a cell, a card's line) is
|
|
@@ -1291,14 +1327,14 @@ into a table, a record or an overview.
|
|
|
1291
1327
|
`count`, `newAction` alone beside it, and one ⋯ menu for the rest. One
|
|
1292
1328
|
related link in `links` stays a button; two or more fold into ⋯ with
|
|
1293
1329
|
`more` (the page's own actions). `deleted={{ shown, onShownChange }}` adds
|
|
1294
|
-
"Show
|
|
1295
|
-
`Notice` with "Back to the
|
|
1330
|
+
"Show Deleted" as the menu's last item and, while it's on, an info
|
|
1331
|
+
`Notice` with "Back to the List" in a `role="status"` region that is
|
|
1296
1332
|
always there. It holds no state: the app keeps `shown`.
|
|
1297
1333
|
- **`Timeline`: a record's dated history.** `items` newest first
|
|
1298
1334
|
(`{ id, date, dateTime?, kind?, body, edit? }`): dates in a tabular
|
|
1299
1335
|
column on the left, a dot and a thin line, the entry on the right with
|
|
1300
1336
|
its `kind` as a muted line under it and `edit` (the entry's own
|
|
1301
|
-
control) at its end. The first `initial` (5) show, then "Show
|
|
1337
|
+
control) at its end. The first `initial` (5) show, then "Show All N";
|
|
1302
1338
|
under 24rem of its own width the date moves above its entry. Empty
|
|
1303
1339
|
reads `emptyText` ("Nothing yet").
|
|
1304
1340
|
- **`NeedsYou`: what waits on the user.** `items={[{ text, to, tone? }]}`:
|
|
@@ -1491,13 +1527,13 @@ data on each its own.
|
|
|
1491
1527
|
too long for both pushes them to the next line, starting under it.
|
|
1492
1528
|
`subtitle` is the line below, in muted body type.
|
|
1493
1529
|
- **Actions**: the record's own commands in words (New visit, Mark
|
|
1494
|
-
done), then the universal ones as `IconAction`s: Print
|
|
1530
|
+
done), then the universal ones as `IconAction`s: Print Notes
|
|
1495
1531
|
(`printer`, EntityView's own) and Delete (`trash-2`, the destructive
|
|
1496
1532
|
tone). Each is a square outline button at the header's 36px with its
|
|
1497
1533
|
words as both its tooltip and its accessible name. Icon alone is for
|
|
1498
|
-
the universal actions only (Delete, Print
|
|
1499
|
-
site, Restore, Open
|
|
1500
|
-
word. `printLook="words"` keeps Print
|
|
1534
|
+
the universal actions only (Delete, Print Notes, Copy link, Pin, Open
|
|
1535
|
+
site, Restore, Open Full Page, Close, More); everything else keeps its
|
|
1536
|
+
word. `printLook="words"` keeps Print Notes as a button with its words.
|
|
1501
1537
|
- **An empty value** reads as a dash (`emptyText`, default `'—'`), in the
|
|
1502
1538
|
muted text tone, read by a screen reader as "Not set": the same on
|
|
1503
1539
|
every field, the presets' included. A field's own `emptyLabel` still
|
|
@@ -1518,7 +1554,7 @@ data on each its own.
|
|
|
1518
1554
|
- **Folded empties** (`emptyFields="fold"`): each fields card lists its
|
|
1519
1555
|
filled fields, then a muted, underlined "N empty" with a down chevron
|
|
1520
1556
|
under them opens the rest in their places, each still edited in place,
|
|
1521
|
-
and reads "Hide
|
|
1557
|
+
and reads "Hide Empty" (the chevron up) while open. A card with
|
|
1522
1558
|
nothing empty has no toggle; one with nothing filled has the toggle
|
|
1523
1559
|
alone. A value set elsewhere moves its field into the card at once.
|
|
1524
1560
|
The fold is per card and isn't remembered.
|
|
@@ -1648,7 +1684,7 @@ size"); the list stays where a record is edited one field at a time.
|
|
|
1648
1684
|
clicked again to clear) for a short choice, any input for the rest.
|
|
1649
1685
|
A guess is a `suggestion`: drawn dashed in the info tone and said
|
|
1650
1686
|
under the row, never picked for the person.
|
|
1651
|
-
- **Quick from the keyboard:** Enter is Save and
|
|
1687
|
+
- **Quick from the keyboard:** Enter is Save and Next (not in a
|
|
1652
1688
|
textarea), and the one row marked `shortcut` takes the number keys.
|
|
1653
1689
|
After a move the focus is on the new record.
|
|
1654
1690
|
- A refused save keeps the record and says why under the buttons, not
|
|
@@ -39,8 +39,8 @@ const push = usePushPermission()
|
|
|
39
39
|
|
|
40
40
|
| `status` | Means | Shows |
|
|
41
41
|
|---|---|---|
|
|
42
|
-
| `off` | Can be turned on | The description and "Allow
|
|
43
|
-
| `on` | This device gets them | "Reminders are on for this device", and "Turn
|
|
42
|
+
| `off` | Can be turned on | The description and "Allow Reminders" |
|
|
43
|
+
| `on` | This device gets them | "Reminders are on for this device", and "Turn Off" |
|
|
44
44
|
| `needs-install` | iPhone or iPad in a browser tab | How to add the app to the Home Screen |
|
|
45
45
|
| `blocked` | The person said no | Where to allow it again |
|
|
46
46
|
| `unsupported` | No push in this browser | That it can't |
|
|
@@ -57,7 +57,7 @@ const primary = useRef<HTMLButtonElement>(null)
|
|
|
57
57
|
|
|
58
58
|
- **The title is required.** It names the dialog for screen readers and
|
|
59
59
|
heads the view. The header also holds Close and, with
|
|
60
|
-
`fullscreenControl`, a "Full
|
|
60
|
+
`fullscreenControl`, a "Full Screen" toggle.
|
|
61
61
|
- **Real fullscreen** asks the browser to take the whole screen too
|
|
62
62
|
(hiding its own bars). Where the browser can't (iOS Safari on a phone),
|
|
63
63
|
the control isn't shown. The view already covers the page. Closing the
|
|
@@ -11,5 +11,5 @@ import { Button } from '../ui/button.js';
|
|
|
11
11
|
import { Spinner } from '../ui/spinner.js';
|
|
12
12
|
import { Notice } from './notice.js';
|
|
13
13
|
export function ActionError({ action, title, className }) {
|
|
14
|
-
return (_jsx("div", { role: "status", "data-slot": "action-error", className: cn('empty:hidden', className), children: action.error && (_jsx(Notice, { tone: "destructive", title: title, action: _jsxs(Button, { type: "button", size: "sm", variant: "outline", disabled: action.pending, onClick: () => void action.retry(), children: [action.pending && _jsx(Spinner, { className: "size-4" }), "Try
|
|
14
|
+
return (_jsx("div", { role: "status", "data-slot": "action-error", className: cn('empty:hidden', className), children: action.error && (_jsx(Notice, { tone: "destructive", title: title, action: _jsxs(Button, { type: "button", size: "sm", variant: "outline", disabled: action.pending, onClick: () => void action.retry(), children: [action.pending && _jsx(Spinner, { className: "size-4" }), "Try Again"] }), children: action.error })) }));
|
|
15
15
|
}
|
|
@@ -7,5 +7,5 @@ import { Notice } from './notice.js';
|
|
|
7
7
|
const DEFAULT_DESCRIPTION = 'Get a notification on this device at the times you set, even when the app is closed. Your browser will ask first.';
|
|
8
8
|
export function AllowReminders({ push, description = DEFAULT_DESCRIPTION, className }) {
|
|
9
9
|
const { status, pending, error } = push;
|
|
10
|
-
return (_jsxs("div", { "data-slot": "allow-reminders", className: cn('flex flex-col gap-3', className), "aria-busy": status === undefined || pending, children: [status === undefined && _jsx(Skeleton, { className: "h-9 w-full max-w-md" }), status === 'off' && (_jsxs(_Fragment, { children: [_jsx("p", { className: "text-sm text-foreground", children: description }), _jsx("div", { children: _jsxs(Button, { onClick: push.enable, disabled: pending, children: [_jsx(BellIcon, { "aria-hidden": "true" }), pending ? 'Turning on…' : 'Allow
|
|
10
|
+
return (_jsxs("div", { "data-slot": "allow-reminders", className: cn('flex flex-col gap-3', className), "aria-busy": status === undefined || pending, children: [status === undefined && _jsx(Skeleton, { className: "h-9 w-full max-w-md" }), status === 'off' && (_jsxs(_Fragment, { children: [_jsx("p", { className: "text-sm text-foreground", children: description }), _jsx("div", { children: _jsxs(Button, { onClick: push.enable, disabled: pending, children: [_jsx(BellIcon, { "aria-hidden": "true" }), pending ? 'Turning on…' : 'Allow Reminders'] }) })] })), status === 'on' && (_jsx(Notice, { tone: "success", icon: BellIcon, action: _jsxs(Button, { size: "sm", variant: "outline", onClick: push.disable, disabled: pending, children: [_jsx(BellOffIcon, { "aria-hidden": "true" }), pending ? 'Turning off…' : 'Turn Off'] }), children: "Reminders are on for this device." })), status === 'needs-install' && (_jsx(Notice, { title: "Add the app to your Home Screen first", children: "On iPhone and iPad, reminders work in the app from the Home Screen. Tap Share, then Add to Home Screen, open the app from there and allow reminders." })), status === 'blocked' && (_jsx(Notice, { tone: "warning", title: "Notifications are blocked", icon: BellOffIcon, children: "This browser was told not to show this app\u2019s notifications. Allow them in the site\u2019s settings (the icon beside the address), then reload." })), status === 'unsupported' && (_jsx("p", { className: "text-sm text-muted-foreground", children: "This browser can\u2019t show reminders." })), status === 'mock' && (_jsx("p", { className: "text-sm text-muted-foreground", children: "Reminders need the real backend: with mock data nothing can send them." })), error && (_jsx("p", { role: "alert", className: "text-sm text-destructive-text", children: error }))] }));
|
|
11
11
|
}
|