@tristan2828/ui-foundation 4.136.0 → 4.137.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/README.md +7 -6
- package/bin/ui-foundation.mjs +1 -1
- package/conventions/agents/spec-tester.md +3 -3
- package/conventions/docs/add-an-entity.md +722 -714
- package/conventions/docs/cell-patterns.md +206 -378
- package/conventions/docs/column-options.md +6 -12
- package/conventions/docs/design-language.md +293 -515
- package/conventions/docs/entity-plan-template.md +9 -7
- package/conventions/docs/reminders.md +12 -17
- package/conventions/docs/timed-screens.md +17 -20
- package/dist/components/app/action-error.js +1 -1
- package/dist/components/app/action-hint.js +1 -1
- package/dist/components/app/app-shell-bottom-bar.js +4 -4
- package/dist/components/app/app-shell-nav.d.ts +1 -1
- package/dist/components/app/app-shell-nav.js +1 -1
- package/dist/components/app/app-shell.d.ts +1 -1
- package/dist/components/app/app-shell.js +9 -9
- package/dist/components/app/board.d.ts +13 -13
- package/dist/components/app/board.js +3 -3
- package/dist/components/app/choice-buttons.d.ts +1 -1
- package/dist/components/app/data-table-tools.d.ts +3 -3
- package/dist/components/app/data-table.d.ts +11 -13
- package/dist/components/app/data-table.js +5 -5
- package/dist/components/app/date-field.js +1 -1
- package/dist/components/app/delete-action.d.ts +1 -1
- package/dist/components/app/delete-action.js +4 -4
- package/dist/components/app/edit-caret.js +1 -1
- package/dist/components/app/edit-in-place-presets.d.ts +4 -4
- package/dist/components/app/edit-in-place-store.d.ts +3 -3
- package/dist/components/app/edit-in-place-store.js +7 -7
- package/dist/components/app/editable-list.js +2 -3
- package/dist/components/app/editable-value.d.ts +2 -2
- package/dist/components/app/editable-value.js +20 -20
- package/dist/components/app/entity-form.js +2 -2
- package/dist/components/app/entity-view-facts.d.ts +12 -12
- package/dist/components/app/entity-view-facts.js +1 -1
- package/dist/components/app/entity-view.d.ts +16 -16
- package/dist/components/app/entity-view.js +28 -33
- package/dist/components/app/equal-items.js +4 -4
- package/dist/components/app/fact-extras.js +5 -5
- package/dist/components/app/field-rows.js +5 -5
- package/dist/components/app/fill-in-queue.js +2 -3
- package/dist/components/app/filter-bar.d.ts +1 -1
- package/dist/components/app/filter-date.js +1 -1
- package/dist/components/app/filter-name.js +1 -1
- package/dist/components/app/form-dialog.js +2 -2
- package/dist/components/app/form-leave-guard.js +2 -2
- package/dist/components/app/form-section.js +1 -1
- package/dist/components/app/icon-action.d.ts +1 -1
- package/dist/components/app/icon-action.js +2 -2
- package/dist/components/app/image-field.js +0 -1
- package/dist/components/app/keep-pencil-room.js +1 -1
- package/dist/components/app/key-stats.d.ts +3 -3
- package/dist/components/app/line-chart.d.ts +1 -1
- package/dist/components/app/line-chart.js +3 -3
- package/dist/components/app/list-editor-rows.js +1 -1
- package/dist/components/app/list-editor.js +1 -1
- package/dist/components/app/list-header.d.ts +6 -6
- package/dist/components/app/list-header.js +8 -8
- package/dist/components/app/markdown.js +30 -37
- package/dist/components/app/milkdown-editor.js +37 -62
- package/dist/components/app/module-card.js +6 -7
- package/dist/components/app/month-calendar.d.ts +46 -0
- package/dist/components/app/month-calendar.js +160 -0
- package/dist/components/app/month-day-field.js +0 -1
- package/dist/components/app/multi-choice.d.ts +1 -1
- package/dist/components/app/multi-choice.js +3 -3
- package/dist/components/app/multi-line-chart.js +1 -1
- package/dist/components/app/multi-pick.js +9 -10
- package/dist/components/app/multi-reference.js +2 -2
- package/dist/components/app/notes-outline.js +0 -1
- package/dist/components/app/notify.js +2 -2
- package/dist/components/app/offline-notice.js +1 -1
- package/dist/components/app/option-icon.js +1 -1
- package/dist/components/app/option-select.d.ts +1 -1
- package/dist/components/app/overview-page.d.ts +2 -2
- package/dist/components/app/overview-page.js +1 -1
- package/dist/components/app/page-trail-context.js +1 -1
- package/dist/components/app/pill-filter.d.ts +2 -2
- package/dist/components/app/prose-look.js +1 -1
- package/dist/components/app/rating-input.js +1 -1
- package/dist/components/app/rating-score.js +1 -1
- package/dist/components/app/record-dialog.js +25 -40
- package/dist/components/app/recurrence-field.js +6 -6
- package/dist/components/app/reference-combobox.js +1 -2
- package/dist/components/app/rich-text-box-anchor.js +0 -1
- package/dist/components/app/rich-text-edges.js +2 -2
- package/dist/components/app/rich-text-editor.d.ts +2 -3
- package/dist/components/app/rich-text-editor.js +19 -32
- package/dist/components/app/rich-text-empty-paragraph.d.ts +6 -7
- package/dist/components/app/rich-text-empty-paragraph.js +6 -7
- package/dist/components/app/rich-text-floating-toolbar.js +0 -1
- package/dist/components/app/rich-text-formats.js +2 -2
- package/dist/components/app/rich-text-input-rules.js +1 -2
- package/dist/components/app/rich-text-keyboard-bar.js +6 -7
- package/dist/components/app/rich-text-node-views.js +1 -2
- package/dist/components/app/rich-text-shortcuts.js +8 -8
- package/dist/components/app/rich-text-slash-menu.js +22 -12
- package/dist/components/app/rich-text-slash.d.ts +2 -2
- package/dist/components/app/rich-text-slash.js +2 -2
- package/dist/components/app/rich-text-table-grips.d.ts +1 -1
- package/dist/components/app/rich-text-table-grips.js +1 -2
- package/dist/components/app/rich-text-tasks.d.ts +1 -1
- package/dist/components/app/rich-text-tasks.js +1 -1
- package/dist/components/app/rich-text-touch.js +1 -1
- package/dist/components/app/search-palette.js +1 -2
- package/dist/components/app/secondary-filters.js +2 -3
- package/dist/components/app/session-view.js +1 -1
- package/dist/components/app/stacked-area-chart.js +1 -1
- package/dist/components/app/step-track.d.ts +1 -1
- package/dist/components/app/step-track.js +3 -3
- package/dist/components/app/widget-card.js +26 -30
- package/dist/components/app/widget-layout-sheet.js +1 -1
- package/dist/components/ui/calendar.js +2 -2
- package/dist/components/ui/combobox.d.ts +1 -1
- package/dist/components/ui/combobox.js +2 -2
- package/dist/components/ui/field.d.ts +1 -1
- package/dist/components/ui/field.js +6 -6
- package/dist/components/ui/skeleton.js +1 -1
- package/dist/components/ui/sonner.js +1 -1
- package/dist/components/ui/tabs.js +1 -1
- package/dist/error-reporting/reporter.d.ts +1 -1
- package/dist/error-reporting/reporter.js +1 -1
- package/dist/hooks/table-url-changes.d.ts +2 -2
- package/dist/hooks/table-url-changes.js +5 -6
- package/dist/hooks/use-action.js +1 -1
- package/dist/hooks/use-record-update.js +1 -1
- package/dist/hooks/use-table-url-state.d.ts +1 -1
- package/dist/hooks/use-table-url-state.js +2 -2
- package/dist/index.d.ts +1 -0
- package/dist/index.js +3 -2
- package/dist/lib/audio-cues.js +2 -2
- package/dist/lib/connection.js +1 -1
- package/dist/lib/date-filter.js +1 -1
- package/dist/lib/entity-view-tab.js +1 -1
- package/dist/lib/field-rows.js +2 -2
- package/dist/lib/form-errors.d.ts +1 -1
- package/dist/lib/form-errors.js +1 -1
- package/dist/lib/keep-audio-alive.js +1 -1
- package/dist/lib/line-chart-layout.js +3 -3
- package/dist/lib/markdown-inline.js +0 -2
- package/dist/lib/markdown-merge.js +2 -2
- package/dist/lib/markdown-table-widths.js +1 -1
- package/dist/lib/markdown-table.js +1 -2
- package/dist/lib/markdown-toggle.js +1 -1
- package/dist/lib/page-leaving.js +1 -1
- package/dist/lib/recurrence-format.d.ts +2 -2
- package/dist/lib/recurrence-format.js +1 -1
- package/dist/lib/recurrence-phrase.d.ts +1 -1
- package/dist/lib/recurrence-phrase.js +2 -2
- package/dist/lib/recurrence.d.ts +1 -1
- package/dist/lib/recurrence.js +2 -2
- package/dist/lib/stale-chunk-reload.js +1 -1
- package/dist/lib/status-kinds.d.ts +1 -1
- package/dist/lib/status-kinds.js +2 -2
- package/dist/mocks/start-worker.js +2 -2
- package/dist/routes/login.js +1 -1
- package/dist/testing/index.d.ts +7 -4
- package/dist/testing/index.js +10 -13
- package/package.json +1 -1
- package/styles/index.css +3 -3
- package/styles/theme.css +14 -20
- package/vite/pwa.js +1 -1
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
# <Entity> — entity plan
|
|
2
2
|
|
|
3
|
-
The input to the entity playbook (`docs/foundation/add-an-entity.md
|
|
4
|
-
tool can follow; Claude Code's `/new-entity` is a shortcut). It builds
|
|
3
|
+
The input to the entity playbook (`docs/foundation/add-an-entity.md`). It builds
|
|
5
4
|
exactly what this file says — no invented fields, options or rules. Copy
|
|
6
5
|
this file to `docs/entities/<entity>.md` (kebab-case, singular: `game.md`)
|
|
7
6
|
and fill it in, or ask your AI tool to plan the entity with you and it
|
|
@@ -59,7 +58,9 @@ One or two sentences: what one record is, and who uses the screens.
|
|
|
59
58
|
foundation's `Recurrence` schema and `RecurrenceField`; say whether
|
|
60
59
|
it's optional, whether its times are the record's own fields
|
|
61
60
|
(`times={false}`), and the day the app's weeks start on when it
|
|
62
|
-
isn't Monday (`weekStart`))
|
|
61
|
+
isn't Monday (`weekStart`)), `image` (a photo of the record: the
|
|
62
|
+
stored file's id; the foundation's `ImageField`; the upload endpoint
|
|
63
|
+
and the storage are the app's own).
|
|
63
64
|
- *Not supported yet:* a yes/no that can also be unset (three states),
|
|
64
65
|
file, and anything else.
|
|
65
66
|
Write it anyway with a note; the playbook will stop and raise it
|
|
@@ -168,7 +169,7 @@ does, except the quick actions, if any.
|
|
|
168
169
|
- Sections, in order. Each lists its fields in the order they show. A
|
|
169
170
|
section holding a single long text or a single sub-records list shows
|
|
170
171
|
it under the section's heading, with no label of its own. Placement
|
|
171
|
-
(the record standard
|
|
172
|
+
(the record standard: no right rail): `details` for the short
|
|
172
173
|
label/value facts, which are the record's last tab, Details, when it
|
|
173
174
|
has tabs (Tab), and stay in the column, labels beside values, when it
|
|
174
175
|
has none; `main` for everything else. A `details` section with a Tab is
|
|
@@ -183,7 +184,7 @@ does, except the quick actions, if any.
|
|
|
183
184
|
|
|
184
185
|
- "Not set" labels: what an empty optional field reads as on the view
|
|
185
186
|
(`dueDate`: No due date; `checklist`: No items). A field not listed here
|
|
186
|
-
|
|
187
|
+
shows a dash (read aloud as "Not set"). A `yes/no` is never empty: it reads Yes or No.
|
|
187
188
|
- Quick actions (optional; delete if none): the values the view changes
|
|
188
189
|
with one click, each saved on its own the moment it changes, without
|
|
189
190
|
the form: a `yes/no` (a switch), or a sub-records list (its yes/no item
|
|
@@ -199,8 +200,9 @@ does, except the quick actions, if any.
|
|
|
199
200
|
their form control where the view shows them and save when you leave
|
|
200
201
|
them (cell pattern 18): the title, a badge field, a field row, a long
|
|
201
202
|
text, a sub-records list (its items added, edited, moved and removed on
|
|
202
|
-
the view). Text, long text,
|
|
203
|
-
|
|
203
|
+
the view). Text, long text, an integer or a decimal, a date, a
|
|
204
|
+
month-day, a recurrence, a single choice, a yes/no, a single or multi
|
|
205
|
+
reference, a multi marked `small`, a sub-records list. Never a
|
|
204
206
|
computed field. Every value not named here, or under Quick actions,
|
|
205
207
|
stays read-only. Say any rule the server enforces on one (its refusal
|
|
206
208
|
shows under the field) and any side effect:
|
|
@@ -34,8 +34,7 @@ const push = usePushPermission()
|
|
|
34
34
|
says what reminders are first; `enable()` asks then, from the click.
|
|
35
35
|
- **Put it where reminders are set**: the top of the reminders list, or a
|
|
36
36
|
settings page. One per device: each phone or browser allows its own.
|
|
37
|
-
- **Every state says what to do next.** `AllowReminders` shows them all
|
|
38
|
-
(the package's fixtures, `app/AllowReminders`):
|
|
37
|
+
- **Every state says what to do next.** `AllowReminders` shows them all:
|
|
39
38
|
|
|
40
39
|
| `status` | Means | Shows |
|
|
41
40
|
|---|---|---|
|
|
@@ -129,7 +128,7 @@ Scope it to the signed-in user, as Widgets are.
|
|
|
129
128
|
that's the `tzdata` package, which the backend doesn't install: a
|
|
130
129
|
Windows dev machine reads only `UTC` until it's added.
|
|
131
130
|
|
|
132
|
-
## Repeating reminders
|
|
131
|
+
## Repeating reminders
|
|
133
132
|
|
|
134
133
|
A weekday set and one time is the simple schedule. For anything more
|
|
135
134
|
(every 2nd Tuesday, the last day of the month, several times a day, an
|
|
@@ -145,11 +144,11 @@ the same rules and agree on every next occurrence.
|
|
|
145
144
|
`rule` is RFC 5545's RRULE without DTSTART (`FREQ=MONTHLY;BYDAY=2TU`):
|
|
146
145
|
FREQ daily to yearly, INTERVAL, BYDAY with an nth (`2TU`, `-1FR`),
|
|
147
146
|
BYMONTHDAY (`-1` the last day), BYMONTH, UNTIL (a date) or COUNT, and
|
|
148
|
-
WKST (
|
|
147
|
+
WKST (below).
|
|
149
148
|
`start` is the first day it can fall on; each of `times` is an
|
|
150
149
|
occurrence on every day the rule falls on, read in `timeZone`. A day a
|
|
151
150
|
month lacks is skipped (the 31st, Feb 29), as in RFC 5545.
|
|
152
|
-
- **Which day a week starts on (WKST
|
|
151
|
+
- **Which day a week starts on (WKST)**: weeks start on Monday
|
|
153
152
|
unless the rule says `WKST=SU` (or any weekday; `WKST=MO` is the
|
|
154
153
|
default and isn't stored). It moves only an every-N-weeks rule with
|
|
155
154
|
days: from Wednesday 2026-11-04, `FREQ=WEEKLY;INTERVAL=2;BYDAY=SU,WE`
|
|
@@ -164,7 +163,7 @@ the same rules and agree on every next occurrence.
|
|
|
164
163
|
where it matters. A rule stored without WKST keeps counting from
|
|
165
164
|
Monday; an app that wants its old every-N-weeks rules counted from
|
|
166
165
|
Sunday rewrites them in a migration of its own (append `;WKST=SU`).
|
|
167
|
-
The rule pattern in `openapi/foundation.yaml` allows WKST
|
|
166
|
+
The rule pattern in `openapi/foundation.yaml` allows WKST:
|
|
168
167
|
an app copies the new `Recurrence` when it stores one (an older copy
|
|
169
168
|
still passes `check-contract`, but its mocks and spec refuse WKST).
|
|
170
169
|
- **The columns**: the app's reminders model inherits
|
|
@@ -173,7 +172,7 @@ the same rules and agree on every next occurrence.
|
|
|
173
172
|
`last_sent_at`, `done_occurrence`, `done_at` (timestamps with time
|
|
174
173
|
zone), `nag_count` (integer, default 0), `nag_every_minutes` and
|
|
175
174
|
`nag_limit` (integers, null for no nagging). `days` and `time_of_day`
|
|
176
|
-
become nullable. Hand the model to the job
|
|
175
|
+
become nullable. Hand the model to the job
|
|
177
176
|
(`reminders.register(model=MyReminder)`).
|
|
178
177
|
- **What the job does with a row whose `recurrence` is set**: each
|
|
179
178
|
occurrence is due from its time until 15 minutes have passed, so
|
|
@@ -182,7 +181,7 @@ the same rules and agree on every next occurrence.
|
|
|
182
181
|
every `nag_every_minutes`, at most `nag_limit` times (3 when only the
|
|
183
182
|
interval is set). The next occurrence coming round ends the wait; a
|
|
184
183
|
`fromCompletion` rule waits for done instead. A row with no
|
|
185
|
-
`recurrence` is the weekday set
|
|
184
|
+
`recurrence` is the weekday set.
|
|
186
185
|
- **Done**: the app's Done button (or a notification action that calls
|
|
187
186
|
the app) runs `reminders.mark_done(row)` and commits: the occurrence is
|
|
188
187
|
recorded (`done_occurrence`, `done_at`), nagging stops, and the next is
|
|
@@ -196,13 +195,10 @@ the same rules and agree on every next occurrence.
|
|
|
196
195
|
`model_dump(by_alias=True, mode="json")` in `recurrence`.
|
|
197
196
|
`recurrence.as_weekdays(rule)` goes back when a rule is still that
|
|
198
197
|
simple.
|
|
199
|
-
- **On screens**: `
|
|
200
|
-
|
|
201
|
-
list `formatRecurrence` for a Repeats column and `nextOccurrence` with
|
|
202
|
-
`formatOccurrence` for a Next one (cell-patterns.md "A repeat and its
|
|
203
|
-
next time").
|
|
198
|
+
- **On screens**: add-an-entity.md "A `recurrence`" (the form and the
|
|
199
|
+
view) and cell-patterns.md "A repeat and its next time" (the list).
|
|
204
200
|
- **A record whose times are its own fields** (a calendar event with a
|
|
205
|
-
start and an end
|
|
201
|
+
start and an end): `RecurrenceField times={false}` (and
|
|
206
202
|
`inPlace.recurrence({ times: false })`) says only dates: the preview
|
|
207
203
|
lists the next days from today on ("Sun, Nov 15"), the label and the
|
|
208
204
|
box leave the times out, and "at 9am" typed is refused. The value still
|
|
@@ -211,7 +207,7 @@ the same rules and agree on every next occurrence.
|
|
|
211
207
|
calendar). In the list, `formatRecurrence(value, { times: false })` and
|
|
212
208
|
`formatOccurrence(next, zone, { time: false })`.
|
|
213
209
|
|
|
214
|
-
## A Done button on the notification
|
|
210
|
+
## A Done button on the notification
|
|
215
211
|
|
|
216
212
|
A repeating reminder's push can carry a **Done** button that marks the
|
|
217
213
|
occurrence done without opening the app. The app names its own endpoint;
|
|
@@ -254,8 +250,7 @@ reminders.register(
|
|
|
254
250
|
renotify=True, action=PushAction(...))` does the same for an app's own
|
|
255
251
|
pushes.
|
|
256
252
|
- **A weekday-set reminder** (no `recurrence`) has no occurrence to mark,
|
|
257
|
-
so it gets no button. Left out, `done_action` adds none
|
|
258
|
-
before.
|
|
253
|
+
so it gets no button. Left out, `done_action` adds none.
|
|
259
254
|
|
|
260
255
|
## Testing
|
|
261
256
|
|
|
@@ -3,14 +3,14 @@
|
|
|
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 view](#the-view) · lines
|
|
7
|
-
- [The dark stage](#the-dark-stage) · lines
|
|
6
|
+
- [The view](#the-view) · lines 37–109
|
|
7
|
+
- [The dark stage](#the-dark-stage) · lines 74–109
|
|
8
8
|
- [The clock](#the-clock) · lines 111–141
|
|
9
|
-
- [Sound](#sound) · lines 143–
|
|
10
|
-
- [Background tabs](#background-tabs) · lines
|
|
11
|
-
- [Interruptions](#interruptions) · lines
|
|
12
|
-
- [Motion](#motion) · lines
|
|
13
|
-
- [Testing a timed screen in Playwright](#testing-a-timed-screen-in-playwright) · lines
|
|
9
|
+
- [Sound](#sound) · lines 143–192
|
|
10
|
+
- [Background tabs](#background-tabs) · lines 194–248
|
|
11
|
+
- [Interruptions](#interruptions) · lines 228–248
|
|
12
|
+
- [Motion](#motion) · lines 250–254
|
|
13
|
+
- [Testing a timed screen in Playwright](#testing-a-timed-screen-in-playwright) · lines 256–408
|
|
14
14
|
|
|
15
15
|
<!-- /index -->
|
|
16
16
|
|
|
@@ -29,9 +29,10 @@ package has the parts, so a screen like this is assembled, not rebuilt:
|
|
|
29
29
|
| `useMuted` | A mute toggle remembered on this device |
|
|
30
30
|
| `usePrefersReducedMotion` | Whether to swap movement for a fade |
|
|
31
31
|
|
|
32
|
-
All of them are imported from `@tristan2828/ui-foundation`.
|
|
33
|
-
|
|
34
|
-
Timer story, and the same run
|
|
32
|
+
All of them are imported from `@tristan2828/ui-foundation`. In the
|
|
33
|
+
foundation repo, the package's fixtures have the whole thing working
|
|
34
|
+
together (`session-view.fixtures.tsx`): the Timer story, and the same run
|
|
35
|
+
on the dark stage, DarkStage.
|
|
35
36
|
|
|
36
37
|
## The view
|
|
37
38
|
|
|
@@ -101,12 +102,11 @@ outlines.
|
|
|
101
102
|
on an outline `Button`: no fill, a faint border, dimmed text that
|
|
102
103
|
brightens on hover. **`sessionStageMain`** on the main control (Start,
|
|
103
104
|
Done, `variant="outline"`): an outline too, in the foreground colour.
|
|
104
|
-
- **Contrast is checked in dark only**, since the stage is never light
|
|
105
|
-
the package's axe run covers the DarkStage story in both app themes. An
|
|
105
|
+
- **Contrast is checked in dark only**, since the stage is never light. An
|
|
106
106
|
app's own Playwright runs axe on its screen with the stage on, under a
|
|
107
107
|
light and a dark app theme.
|
|
108
108
|
- **Make it a setting**, remembered per device like Mute, when the app's
|
|
109
|
-
own look is the default
|
|
109
|
+
own look is the default.
|
|
110
110
|
|
|
111
111
|
## The clock
|
|
112
112
|
|
|
@@ -160,8 +160,7 @@ Browsers block sound until the person has clicked or tapped. So:
|
|
|
160
160
|
session stops or the view closes.
|
|
161
161
|
- `vibrate(pattern)` only works on Android. Elsewhere it does nothing.
|
|
162
162
|
- **A Vibrate setting is offered only where `canVibrate()` is true.**
|
|
163
|
-
|
|
164
|
-
that does nothing. `canVibrate()` is the same test `vibrate()` makes, so
|
|
163
|
+
`canVibrate()` is the same test `vibrate()` makes, so
|
|
165
164
|
the two never disagree. Read it once, since it doesn't change during a
|
|
166
165
|
session: `const [vibrates] = useState(canVibrate)`. Show the toggle (a
|
|
167
166
|
pressed button named "Vibrate", like Mute) only when `vibrates` is
|
|
@@ -214,7 +213,7 @@ phase ends. Web Audio's own clock keeps time, so:
|
|
|
214
213
|
closing cue is sounding then.
|
|
215
214
|
- **Do it in the handlers**, where you know why counting stopped, not in
|
|
216
215
|
an effect on `paused`: an effect's cleanup can't tell pause from done.
|
|
217
|
-
The Timer story
|
|
216
|
+
The Timer story does exactly this.
|
|
218
217
|
- **Speech can't be booked.** `say()` still comes when the clock's slow
|
|
219
218
|
tick reaches the moment, so in a background tab it may be late. Keep
|
|
220
219
|
what must be on time to chimes.
|
|
@@ -279,8 +278,7 @@ test('running, paused and done', async ({ page }) => {
|
|
|
279
278
|
|
|
280
279
|
- **`fastForward`, not `runFor`.** `runFor` over a long span doesn't fire
|
|
281
280
|
every animation frame. A screen that adds time up per frame comes out
|
|
282
|
-
short
|
|
283
|
-
app's tests. `useSessionClock` reads the time each frame, so one frame
|
|
281
|
+
short. `useSessionClock` reads the time each frame, so one frame
|
|
284
282
|
after `fastForward` lands on the right state.
|
|
285
283
|
- Give the time on screen `role="timer"` and a name, and the state line
|
|
286
284
|
`role="status"`, so tests (and screen readers) find them by role.
|
|
@@ -404,8 +402,7 @@ test('the hold counts up until the tap', async ({ page }) => {
|
|
|
404
402
|
Never at one read after it (`pauseAt(Date.now() + 50)` after Start):
|
|
405
403
|
until the pause lands the page's fake clock runs in real time, so a
|
|
406
404
|
slow round trip or a busy first frame puts it past that time, and
|
|
407
|
-
`pauseAt` fails with "Cannot fast-forward to the past".
|
|
408
|
-
on from `install` is still ahead however slow the machine is.
|
|
405
|
+
`pauseAt` fails with "Cannot fast-forward to the past".
|
|
409
406
|
- **`clock.resume()` before axe or closing the view.** With the clock
|
|
410
407
|
paused, axe's scan never finishes and the dialog's close animation
|
|
411
408
|
never ends, so the test times out with nothing pointing at the clock.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
// An action's error beside its button (
|
|
2
|
+
// An action's error beside its button (the dialogs and feedback
|
|
3
3
|
// standard D6): a destructive Notice with the reason and Try again, which
|
|
4
4
|
// runs the action again. Not a toast: the error stays next to what failed
|
|
5
5
|
// until it's tried again or the action works. Give it a useAction.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
// A short line under a header button
|
|
2
|
+
// A short line under a header button: what the button has left
|
|
3
3
|
// or costs ("12 searches left"), in caption type and the muted tone,
|
|
4
4
|
// centred under it on one line. The row it's in lines its buttons up by
|
|
5
5
|
// their tops (ListHeader and EntityView do, while one has a hint), so the
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
// AppShell's bottom bar on a phone
|
|
2
|
+
// AppShell's bottom bar on a phone: Home and a few of the nav's
|
|
3
3
|
// sections in thumb reach, where the sidebar is a sheet behind the
|
|
4
4
|
// header's menu button. An item is a link, or a nav section by its label,
|
|
5
5
|
// which opens a sheet from the bottom listing that section's entries (and
|
|
@@ -75,15 +75,15 @@ function SheetChildren({ items, activeTo }) {
|
|
|
75
75
|
const PAGE_TILE_CLASS = 'relative flex min-h-11 min-w-0 flex-1 flex-col items-center justify-center gap-0.5 rounded-md px-1 py-1.5 text-center type-caption ' +
|
|
76
76
|
'text-foreground outline-none hover:bg-accent focus-visible:ring-3 focus-visible:ring-ring/50 ' +
|
|
77
77
|
'aria-[current=page]:bg-accent aria-[current=page]:font-medium [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-muted-foreground';
|
|
78
|
-
// The current entry's pages under a tiles section's tiles
|
|
78
|
+
// The current entry's pages under a tiles section's tiles: a
|
|
79
79
|
// hairline, then its pages as small tiles, each heading a hairline of its
|
|
80
80
|
// own with its list still named by it.
|
|
81
81
|
function SheetPageTiles({ items, activeTo }) {
|
|
82
82
|
const open = items.filter((item) => childrenOpen(item, activeTo));
|
|
83
83
|
return open.map((item) => (_jsx("div", { role: "group", "aria-label": `${item.label} pages`, "data-slot": "app-shell-sheet-pages", className: "flex flex-col", children: childRuns(item).map((run, runIndex) => (_jsxs("div", { className: "flex flex-col", children: [_jsx("div", { role: "separator", className: "my-2 h-px bg-border" }), _jsx("ul", { "aria-label": run.label, className: "grid grid-cols-4 gap-1.5", children: run.items.map(({ to, label, icon: Icon, count, countLabel }) => (_jsx("li", { className: "flex min-w-0", children: _jsxs(Link, { to: to, "aria-current": to === activeTo ? 'page' : undefined, className: PAGE_TILE_CLASS, children: [_jsx(Icon, { "aria-hidden": "true" }), _jsx(CountedLabel, { label: label, count: count, countLabel: countLabel, className: "max-w-full break-words" }), _jsx(TileCount, { count: count })] }) }, to))) })] }, run.label ?? `run:${runIndex}`))) }, item.to)));
|
|
84
84
|
}
|
|
85
|
-
// The tiles
|
|
86
|
-
// unless the section's look is tiles
|
|
85
|
+
// The tiles: one per entry. Its pages are left to the module itself,
|
|
86
|
+
// unless the section's look is tiles: then the current entry's are
|
|
87
87
|
// under the tiles. The tile holding the current page, its own or one of
|
|
88
88
|
// its pages, is marked.
|
|
89
89
|
function SheetTiles({ items, activeTo, withPages, }) {
|
|
@@ -154,7 +154,7 @@ export declare function navBackTarget(nav: readonly NavEntry[], pathname: string
|
|
|
154
154
|
to: string;
|
|
155
155
|
} | undefined;
|
|
156
156
|
/**
|
|
157
|
-
* The bar's trail for a page that names none of its own
|
|
157
|
+
* The bar's trail for a page that names none of its own: the active
|
|
158
158
|
* entry, after the entry it sits under when it's one of a module's own
|
|
159
159
|
* pages ("Finance / Accounts"). The entry is the trail's last crumb even
|
|
160
160
|
* on a page below it. Nothing on a page no entry covers.
|
|
@@ -135,7 +135,7 @@ export function navBackTarget(nav, pathname) {
|
|
|
135
135
|
return trimmed === path ? undefined : { label: item.label, to: item.to };
|
|
136
136
|
}
|
|
137
137
|
/**
|
|
138
|
-
* The bar's trail for a page that names none of its own
|
|
138
|
+
* The bar's trail for a page that names none of its own: the active
|
|
139
139
|
* entry, after the entry it sits under when it's one of a module's own
|
|
140
140
|
* pages ("Finance / Accounts"). The entry is the trail's last crumb even
|
|
141
141
|
* on a page below it. Nothing on a page no entry covers.
|
|
@@ -85,7 +85,7 @@ export type AppShellProps = {
|
|
|
85
85
|
*/
|
|
86
86
|
navLook?: NavLook;
|
|
87
87
|
/**
|
|
88
|
-
* Search in the header
|
|
88
|
+
* Search in the header: a box ("Search", or `placeholder`) from
|
|
89
89
|
* md up and a button on a phone, both opening a palette (Ctrl K, ⌘K on
|
|
90
90
|
* a Mac) that finds the nav's pages by name and, with `findRecords`,
|
|
91
91
|
* the app's records, listed under their kinds; Enter opens the one
|
|
@@ -91,11 +91,11 @@ function VersionEntry({ version }) {
|
|
|
91
91
|
const className = 'block truncate px-2 type-caption text-sidebar-foreground/70 group-data-[collapsible=icon]:hidden';
|
|
92
92
|
return href ? (_jsx("a", { href: href, target: "_blank", rel: "noreferrer", className: `${className} hover:underline`, children: label })) : (_jsx("span", { className: className, children: label }));
|
|
93
93
|
}
|
|
94
|
-
// The current entry's mark
|
|
94
|
+
// The current entry's mark: the sidebar's tint and a 3px bar in
|
|
95
95
|
// the accent at its start, the same mark as a selected or hovered table
|
|
96
96
|
// row, in the sidebar and on the rail.
|
|
97
97
|
const ACTIVE_MARK = 'data-active:shadow-[inset_3px_0_0_0_var(--primary)]';
|
|
98
|
-
// An entry's count
|
|
98
|
+
// An entry's count: a plain number at its end in the muted tone,
|
|
99
99
|
// read with what it counts; on the icon rail, a dot on the icon.
|
|
100
100
|
function NavCount({ count, countLabel }) {
|
|
101
101
|
const text = navCountText(count);
|
|
@@ -108,7 +108,7 @@ function NavSubLink({ item, activeTo }) {
|
|
|
108
108
|
const isActive = to === activeTo;
|
|
109
109
|
return (_jsx(SidebarMenuSubItem, { children: _jsxs(SidebarMenuSubButton, { isActive: isActive, className: ACTIVE_MARK, render: _jsx(Link, { to: to, "aria-current": isActive ? 'page' : undefined }), children: [_jsx(Icon, {}), _jsx("span", { className: "min-w-0 flex-1 truncate", children: label }), _jsx(NavCount, { count: count, countLabel: countLabel })] }) }));
|
|
110
110
|
}
|
|
111
|
-
// A heading among a module's pages
|
|
111
|
+
// A heading among a module's pages: a small label over its pages,
|
|
112
112
|
// a list named by it, so a screen reader hears "Money, list".
|
|
113
113
|
function NavSubGroup({ group, activeTo }) {
|
|
114
114
|
const headingId = useId();
|
|
@@ -118,7 +118,7 @@ function NavSubGroup({ group, activeTo }) {
|
|
|
118
118
|
// matching entry current, and only the most specific one should be
|
|
119
119
|
// (activeNavTo).
|
|
120
120
|
//
|
|
121
|
-
// An entry's children
|
|
121
|
+
// An entry's children are a list inside its item, so they're read
|
|
122
122
|
// as its pages, shown while you're in them (childrenOpen) and otherwise
|
|
123
123
|
// in the page but hidden, as a folded section's are. The icon rail has no
|
|
124
124
|
// room for them: there the entry looks current while one of them is, and
|
|
@@ -133,7 +133,7 @@ function NavMenu({ items, activeTo, label, }) {
|
|
|
133
133
|
return (_jsxs(SidebarMenuItem, { children: [_jsxs(SidebarMenuButton, { isActive: isActive || (rail && childActive), tooltip: navTooltip(item), className: cn('relative', ACTIVE_MARK), render: _jsx(Link, { to: to, "aria-current": isActive ? 'page' : undefined }), children: [_jsx(Icon, {}), _jsx("span", { className: "min-w-0 flex-1 truncate", children: label }), _jsx(NavCount, { count: count, countLabel: countLabel })] }), children && children.length > 0 && (_jsx(SidebarMenuSub, { hidden: !childrenOpen(item, activeTo), children: children.map((child) => isNavItemGroup(child) ? (_jsx(NavSubGroup, { group: child, activeTo: activeTo }, `group:${child.label}`)) : (_jsx(NavSubLink, { item: child, activeTo: activeTo }, child.to))) }))] }, to));
|
|
134
134
|
}) }));
|
|
135
135
|
}
|
|
136
|
-
// A tile in the tiles look
|
|
136
|
+
// A tile in the tiles look: the entry's icon over its label, a
|
|
137
137
|
// finger's target at least, its count in the corner. The current one,
|
|
138
138
|
// or the one holding the current page, has the tint and a --primary ring.
|
|
139
139
|
const NAV_TILE_CLASS = 'relative flex min-h-14 w-full min-w-0 flex-col items-center justify-center gap-1 rounded-lg bg-sidebar-accent/50 px-1 py-2 ' +
|
|
@@ -147,7 +147,7 @@ function NavTile({ item, activeTo }) {
|
|
|
147
147
|
const current = to === activeTo ? 'page' : childItems(item).some((child) => child.to === activeTo) ? 'true' : undefined;
|
|
148
148
|
return (_jsx("li", { className: "flex min-w-0", children: _jsxs(Link, { to: to, "aria-current": current, "data-slot": "nav-tile", "data-active": current ? '' : undefined, className: NAV_TILE_CLASS, children: [_jsx(Icon, { "aria-hidden": "true" }), _jsx("span", { className: "max-w-full break-words", children: label }), navCountText(count) !== undefined ? (_jsxs(_Fragment, { children: [_jsx("span", { "aria-hidden": "true", "data-slot": "nav-count", className: "absolute top-1 right-1.5 type-caption leading-none text-sidebar-foreground tabular-nums", children: navCountText(count) }), _jsx("span", { className: "sr-only", children: navCountSpoken(count, countLabel) })] })) : null] }) }));
|
|
149
149
|
}
|
|
150
|
-
// A group in the tiles look
|
|
150
|
+
// A group in the tiles look: its entries as a three-column grid,
|
|
151
151
|
// its label for screen readers only (the grid is a list named by it), and
|
|
152
152
|
// under the grid the pages of the entry you're in, as the list look's
|
|
153
153
|
// children, each heading a hairline (its list still named by it). On the
|
|
@@ -182,7 +182,7 @@ function storeSectionOpen(label, open) {
|
|
|
182
182
|
// Not remembered; the state still holds until the page reloads.
|
|
183
183
|
}
|
|
184
184
|
}
|
|
185
|
-
// A section whose label folds it
|
|
185
|
+
// A section whose label folds it. On the icon rail (the collapsed
|
|
186
186
|
// sidebar on a wide screen) its items always show and its label stays the
|
|
187
187
|
// rail's hidden one, so no page is out of reach and no hidden button
|
|
188
188
|
// takes a tab stop. The section holding the current page is always open:
|
|
@@ -210,7 +210,7 @@ function CollapsibleNavGroup({ group, activeTo }) {
|
|
|
210
210
|
storeSectionOpen(group.label, !open);
|
|
211
211
|
} }), className: "w-full justify-between text-left hover:bg-sidebar-accent hover:text-sidebar-accent-foreground aria-disabled:hover:bg-transparent aria-disabled:hover:text-sidebar-foreground/70", children: [group.label, _jsx(ChevronRightIcon, { "aria-hidden": "true", className: cn('transition-transform', open && 'rotate-90') })] }), _jsx(SidebarGroupContent, { id: contentId, hidden: !open, children: _jsx(NavMenu, { items: group.items, activeTo: activeTo }) })] }));
|
|
212
212
|
}
|
|
213
|
-
// The phone's back arrow
|
|
213
|
+
// The phone's back arrow, below the md breakpoint only: the
|
|
214
214
|
// shell's own way up from a page below a nav entry. Its label is the
|
|
215
215
|
// place it goes, so it reads "Back to Accounts".
|
|
216
216
|
function PhoneBack({ back }) {
|
|
@@ -229,7 +229,7 @@ export function AppShell({ title, logo: Logo, nav, sidebarExtra, defaultSidebarO
|
|
|
229
229
|
// component then renders starts a second navigation that wins.
|
|
230
230
|
const [isLoggingOut, setIsLoggingOut] = useState(false);
|
|
231
231
|
useShellDocumentTitle(title, navPageLabel(nav, location.pathname));
|
|
232
|
-
// The trail a page put up (usePageTrail
|
|
232
|
+
// The trail a page put up (usePageTrail), for the bar.
|
|
233
233
|
const [pageTrail, setPageTrail] = useState(null);
|
|
234
234
|
const set = useCallback((owner, crumbs) => setPageTrail({ owner, crumbs }), []);
|
|
235
235
|
const clear = useCallback((owner) => setPageTrail((current) => (current?.owner === owner ? null : current)), []);
|
|
@@ -41,19 +41,19 @@ export type BoardColumn<V extends string, G extends string = string> = {
|
|
|
41
41
|
empty?: ReactNode;
|
|
42
42
|
/** Under the cards: "Showing 100 of 240", a link to the whole list. */
|
|
43
43
|
footer?: ReactNode;
|
|
44
|
-
/** The column's groups, in order
|
|
44
|
+
/** The column's groups, in order. Needs the board's `getGroup`. */
|
|
45
45
|
groups?: readonly BoardGroup<G>[];
|
|
46
|
-
/** Default: the board's `ordered`. `false` gives this column no order
|
|
46
|
+
/** Default: the board's `ordered`. `false` gives this column no order. */
|
|
47
47
|
ordered?: boolean;
|
|
48
|
-
/** A caption under the column's name
|
|
48
|
+
/** A caption under the column's name. */
|
|
49
49
|
description?: ReactNode;
|
|
50
|
-
/** A control at the end of the header, a
|
|
50
|
+
/** A control at the end of the header, a +. */
|
|
51
51
|
action?: ReactNode;
|
|
52
|
-
/** Short muted text in the header before the action: "3 need review"
|
|
52
|
+
/** Short muted text in the header before the action: "3 need review". */
|
|
53
53
|
note?: ReactNode;
|
|
54
|
-
/** The lead column, outlined: where the list starts
|
|
54
|
+
/** The lead column, outlined: where the list starts. */
|
|
55
55
|
lead?: boolean;
|
|
56
|
-
/** Its name in the phone's row of counts
|
|
56
|
+
/** Its name in the phone's row of counts. Default: its name. */
|
|
57
57
|
shortName?: string;
|
|
58
58
|
};
|
|
59
59
|
/** A value a card can be moved to from its Move menu. */
|
|
@@ -78,17 +78,17 @@ export type BoardProps<T, V extends string, G extends string = string> = {
|
|
|
78
78
|
moveTo?: readonly BoardMoveTarget<V>[];
|
|
79
79
|
/** The columns' heading level: 2 under the page's h1 (the default), deeper under a section. */
|
|
80
80
|
headingLevel?: 2 | 3 | 4 | 5 | 6;
|
|
81
|
-
/** Cards keep `items`' order and can be reordered
|
|
81
|
+
/** Cards keep `items`' order and can be reordered. Only with `onMove`. */
|
|
82
82
|
ordered?: boolean;
|
|
83
|
-
/** Which group of its column a card is in
|
|
83
|
+
/** Which group of its column a card is in, for a column with `groups`. */
|
|
84
84
|
getGroup?: (item: T) => G;
|
|
85
|
-
/** Each column, or group, shows this many cards, then "Show N More"
|
|
85
|
+
/** Each column, or group, shows this many cards, then "Show N More". */
|
|
86
86
|
pageSize?: number;
|
|
87
|
-
/** When it changes, every column and group goes back to its first page
|
|
87
|
+
/** When it changes, every column and group goes back to its first page. */
|
|
88
88
|
pageKey?: string;
|
|
89
|
-
/** The app's own items, after the board's in the card's menu
|
|
89
|
+
/** The app's own items, after the board's in the card's menu. */
|
|
90
90
|
menu?: (item: T) => ReactNode;
|
|
91
|
-
/** Below lg: one column with the next one's edge (`swipe`, the default), or a row of counts that picks it
|
|
91
|
+
/** Below lg: one column with the next one's edge (`swipe`, the default), or a row of counts that picks it. */
|
|
92
92
|
phone?: 'swipe' | 'counts';
|
|
93
93
|
isLoading?: boolean;
|
|
94
94
|
error?: AppError | null;
|
|
@@ -16,14 +16,14 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
16
16
|
// columns' values, in `items`' order; a record whose value has no column
|
|
17
17
|
// isn't shown. `renderCard` is the card's content: the title (a link to
|
|
18
18
|
// the record's page) and a few values.
|
|
19
|
-
// - Groups
|
|
19
|
+
// - Groups: a column with `groups` splits its cards by `getGroup`,
|
|
20
20
|
// each group a heading with its count that folds its cards. A card whose
|
|
21
21
|
// group isn't one of the column's isn't shown.
|
|
22
|
-
// - Order
|
|
22
|
+
// - Order: with `ordered`, cards keep `items`' order and a drag
|
|
23
23
|
// within a column (or a group) reorders them, a line showing where the
|
|
24
24
|
// card will land; the menu has Move Up, Move Down and Move to Top. A
|
|
25
25
|
// column with `ordered: false` (a Done column, by date) has none of it.
|
|
26
|
-
// - Paging
|
|
26
|
+
// - Paging: with `pageSize`, a column or a group shows its first
|
|
27
27
|
// cards, then "Show N More". `pageKey` changing (the filters) folds every
|
|
28
28
|
// one back to its first page.
|
|
29
29
|
// - Moving: with `onMove`, a card drags to another column (a pointer) and
|
|
@@ -4,7 +4,7 @@ import type { IconComponent } from './icon-component.js';
|
|
|
4
4
|
export type ChoiceButtonsOption<T> = {
|
|
5
5
|
value: T;
|
|
6
6
|
label: string;
|
|
7
|
-
/** A status kind
|
|
7
|
+
/** A status kind: its icon, in its colour, before the word, as StatusMark draws it. */
|
|
8
8
|
kind?: StatusKind;
|
|
9
9
|
/** An icon before the word; with `kind`, in place of the kind's. Uncoloured without a `kind`. */
|
|
10
10
|
icon?: IconComponent;
|
|
@@ -12,8 +12,8 @@ export type DataTableView = {
|
|
|
12
12
|
/** The columns this view shows; while it's on they win over the Columns menu. */
|
|
13
13
|
columns?: readonly string[];
|
|
14
14
|
/**
|
|
15
|
-
* How many records the view holds, after its label: "Needs a Look · 3"
|
|
16
|
-
*
|
|
15
|
+
* How many records the view holds, after its label: "Needs a Look · 3".
|
|
16
|
+
* The app counts them with its own query; the table doesn't.
|
|
17
17
|
* null, undefined and 0 show no count, as the sidebar's counts and
|
|
18
18
|
* EntityView's tab counts don't, and past 99 it reads "99+". It's part
|
|
19
19
|
* of the pill's name ("Needs a Look, 3"). A view that has the key at all,
|
|
@@ -85,7 +85,7 @@ export type DataTablePhoneRow<TData> = {
|
|
|
85
85
|
/** The facts that matter (two, usually) on one muted line under it, between dots; empty ones are left out. */
|
|
86
86
|
facts?: (row: TData) => readonly ReactNode[];
|
|
87
87
|
/**
|
|
88
|
-
* A control at the row's start, outside the link
|
|
88
|
+
* A control at the row's start, outside the link: the tick that
|
|
89
89
|
* completes a to-do from its row, say. Its clicks are its own, so it
|
|
90
90
|
* never opens the record; it gets a 44px-wide column, centred, and its
|
|
91
91
|
* own label (the row's title is in the link, not around it).
|
|
@@ -30,8 +30,7 @@ declare module '@tanstack/table-core' {
|
|
|
30
30
|
* The title column (the table's first, the row's name): wrap at
|
|
31
31
|
* `maxWidth` (`'24rem'` unless set) instead of the default, one line cut
|
|
32
32
|
* at 24rem with an ellipsis. For a title worth reading whole in the row.
|
|
33
|
-
* A title column with `maxWidth: 'none'` has no cap at all
|
|
34
|
-
* before 4.103); one with its own `clip` or `maxWidth` is cut or wrapped
|
|
33
|
+
* A title column with `maxWidth: 'none'` has no cap at all; one with its own `clip` or `maxWidth` is cut or wrapped
|
|
35
34
|
* at it, as any column is.
|
|
36
35
|
*/
|
|
37
36
|
wrap?: boolean;
|
|
@@ -101,7 +100,7 @@ export type DataTableProps<TData extends Record<string, unknown>, TView extends
|
|
|
101
100
|
*/
|
|
102
101
|
visibleColumns?: readonly string[];
|
|
103
102
|
/**
|
|
104
|
-
* `content` (the default
|
|
103
|
+
* `content` (the default): the table and its pagination are as wide
|
|
105
104
|
* as the columns need, at least 36rem (or the whole width, when that's
|
|
106
105
|
* less), with empty space at the right, so a name stays close to its
|
|
107
106
|
* values at any screen size; wider than the area, the table scrolls
|
|
@@ -109,13 +108,12 @@ export type DataTableProps<TData extends Record<string, unknown>, TView extends
|
|
|
109
108
|
* don't move between lists. While loading, empty or failed after a
|
|
110
109
|
* load, it keeps the width it last had, so paging and filtering don't
|
|
111
110
|
* move it (only the first load can). `full`: the table takes the whole
|
|
112
|
-
* width too
|
|
111
|
+
* width too. A card layout takes the whole
|
|
113
112
|
* width either way.
|
|
114
113
|
*/
|
|
115
114
|
width?: DataTableWidth;
|
|
116
115
|
/**
|
|
117
|
-
* Zebra stripes on the body rows (every other row tinted)
|
|
118
|
-
* 4.83. Off by default: rows are told apart by the line under each.
|
|
116
|
+
* Zebra stripes on the body rows (every other row tinted). Off by default: rows are told apart by the line under each.
|
|
119
117
|
*/
|
|
120
118
|
striped?: boolean;
|
|
121
119
|
/**
|
|
@@ -200,8 +198,8 @@ export type DataTableProps<TData extends Record<string, unknown>, TView extends
|
|
|
200
198
|
detailPanel?: (row: TData) => ReactNode;
|
|
201
199
|
/**
|
|
202
200
|
* What a click on a row (or Enter on it) does: open its page, or open it
|
|
203
|
-
* in a dialog over the list (`useOpenRecord`, add-an-entity.md "
|
|
204
|
-
*
|
|
201
|
+
* in a dialog over the list (`useOpenRecord`, add-an-entity.md "How a list
|
|
202
|
+
* opens a record"). The rows then take a pointer and the keyboard
|
|
205
203
|
* (↑/↓ between rows, Enter). A link or control inside the row keeps its
|
|
206
204
|
* own click. With a `detailPanel` it replaces picking the row, and the
|
|
207
205
|
* panel is then opened from the app's own control through `detailRow`.
|
|
@@ -270,7 +268,7 @@ export type DataTableProps<TData extends Record<string, unknown>, TView extends
|
|
|
270
268
|
* filters move off every view. Under 48rem they stay on one line that
|
|
271
269
|
* scrolls sideways. A view with `columns` shows those while it's on, over
|
|
272
270
|
* the Columns menu's pick. A view with `count` shows it after its label
|
|
273
|
-
* ("Needs a Look · 3"
|
|
271
|
+
* ("Needs a Look · 3").
|
|
274
272
|
*/
|
|
275
273
|
views?: Readonly<Record<string, TView>>;
|
|
276
274
|
/** The view on: useTableUrlState's `activeView`, or null. */
|
|
@@ -280,17 +278,17 @@ export type DataTableProps<TData extends Record<string, unknown>, TView extends
|
|
|
280
278
|
/** The pills' group name: "Views" unless set. */
|
|
281
279
|
viewsLabel?: string;
|
|
282
280
|
/**
|
|
283
|
-
* The list page's header (
|
|
281
|
+
* The list page's header (the list standard's C3): its
|
|
284
282
|
* `<ListHeader>`, drawn above the views. In the framed look with
|
|
285
283
|
* `width="content"` the header, the views and the card share one width,
|
|
286
284
|
* the table's, so the header's ⋯ and New end on the card's right edge
|
|
287
285
|
* above a short table instead of at the page's far edge. With
|
|
288
286
|
* `width="full"`, a table wider than the page, or the row list on a
|
|
289
|
-
* phone, it spans the page
|
|
287
|
+
* phone, it spans the page.
|
|
290
288
|
*/
|
|
291
289
|
pageHeader?: ReactNode;
|
|
292
290
|
/**
|
|
293
|
-
* A bar between the page header and the list
|
|
291
|
+
* A bar between the page header and the list: something about
|
|
294
292
|
* the whole page that belongs above its rows, such as a deals bar, an
|
|
295
293
|
* "Allow reminders" notice or a budget's totals. Drawn under
|
|
296
294
|
* `pageHeader` and above the views, so C3 holds: the header, the bar and
|
|
@@ -336,7 +334,7 @@ export type DataTableProps<TData extends Record<string, unknown>, TView extends
|
|
|
336
334
|
*/
|
|
337
335
|
viewAll?: DataTableViewAll;
|
|
338
336
|
/**
|
|
339
|
-
* How the list is drawn around its rows
|
|
337
|
+
* How the list is drawn around its rows. `plain` (the default):
|
|
340
338
|
* the toolbar above the whole width, the Columns and Group menus as
|
|
341
339
|
* buttons at its end, the pagination under the rows. `framed`: the
|
|
342
340
|
* list is a card with a border, as wide as the table under `width`'s
|
|
@@ -196,7 +196,7 @@ function TableSkeleton({ columnCount }) {
|
|
|
196
196
|
// the columns scrolling behind show through at 40% opacity — exactly the
|
|
197
197
|
// bleed-through a solid background avoids. With `striped`, on an even row
|
|
198
198
|
// it's the stripe pre-mixed onto the page (--table-stripe), so the stripe
|
|
199
|
-
// runs the whole row's width
|
|
199
|
+
// runs the whole row's width; `:where()` keeps that rule's
|
|
200
200
|
// specificity at the background's, so the row's hover below still wins.
|
|
201
201
|
const PINNED_CELL_CLASS = 'z-10 bg-background';
|
|
202
202
|
const PINNED_STRIPED_CELL_CLASS = '[:where(tbody>tr:nth-child(even))>&]:bg-(--table-stripe)';
|
|
@@ -205,11 +205,11 @@ const PINNED_LAST_COLUMN_CLASS = `sticky right-0 border-l ${PINNED_CELL_CLASS}`;
|
|
|
205
205
|
// The totals row's label, pinned with the first column (`totals`): the
|
|
206
206
|
// same opaque cell, with no hover, since the row isn't one to pick.
|
|
207
207
|
const PINNED_TOTALS_LABEL_CLASS = PINNED_COLUMN_CLASS;
|
|
208
|
-
// `striped` off (the default
|
|
208
|
+
// `striped` off (the default): table.tsx's zebra taken back off the
|
|
209
209
|
// body (tailwind-merge drops its even-row tint for this one), so rows are
|
|
210
210
|
// told apart by the line under each.
|
|
211
211
|
const UNSTRIPED_BODY_CLASS = '[&_tr:nth-child(even)]:bg-transparent';
|
|
212
|
-
// A body row under the pointer
|
|
212
|
+
// A body row under the pointer: every cell, pinned ones included,
|
|
213
213
|
// in --table-hover (solid, so a pinned cell can wear it), with a bar in
|
|
214
214
|
// --primary on the first cell, so it reads without colour too; an inset
|
|
215
215
|
// shadow rather than a border, so nothing reflows. On a cell, not the row,
|
|
@@ -232,7 +232,7 @@ const TITLE_CLIP_CLASS = cn(CLIP_CLASS, '-m-1 p-1');
|
|
|
232
232
|
// A pinned first column's content, capped below md at 45% of the table's
|
|
233
233
|
// scroll area (`cqw`: the container is an inline-size query container)
|
|
234
234
|
// and wrapping, so a long title can't widen the column past the screen
|
|
235
|
-
// and leave every other column scrolling underneath it
|
|
235
|
+
// and leave every other column scrolling underneath it.
|
|
236
236
|
// The title inside is capped at every width too (cut at 24rem, or
|
|
237
237
|
// wrapped with `meta.wrap`), so wider screens don't overrun either.
|
|
238
238
|
const PINNED_FIRST_CONTENT_CLASS = 'max-md:max-w-[45cqw] max-md:whitespace-normal max-md:break-words';
|
|
@@ -257,7 +257,7 @@ const TOTALS_LABEL_CLASS = 'h-auto py-(--table-cell-py)';
|
|
|
257
257
|
// its column header for a screen reader, but takes no room: each header
|
|
258
258
|
// is its name in an sr-only span, in a cell with no height or padding.
|
|
259
259
|
const HIDDEN_HEAD_CLASS = 'h-0 p-0';
|
|
260
|
-
// The column header row
|
|
260
|
+
// The column header row: the muted fill on every header cell, so
|
|
261
261
|
// the row of names reads apart from the rows of data, in the plain and
|
|
262
262
|
// framed looks alike. On the cells, not the row, so a pinned or stuck
|
|
263
263
|
// header cell (opaque, bg-background above) wears it too: listed after
|
|
@@ -4,7 +4,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
4
4
|
// not set, and it's read as a calendar day, never an instant: nothing here
|
|
5
5
|
// goes through the browser's time zone, so Sep 2 is Sep 2 everywhere.
|
|
6
6
|
//
|
|
7
|
-
// Typed (the default
|
|
7
|
+
// Typed (the default): a box that reads "3/14", "Mar 14",
|
|
8
8
|
// "2026-03-14" or "today" (`parsePlainDate`), with the package's Calendar
|
|
9
9
|
// on its button. Something it can't read says "Try a date like 3/14 or
|
|
10
10
|
// Mar 14" under the box once it's left, and gives `''`, so a form never
|