@tristan2828/ui-foundation 4.136.1 → 4.137.1
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/skills/new-entity/SKILL.md +5 -2
- 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 +294 -516
- 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 +4 -4
- 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 +5 -5
- 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/quick-add-input.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 +4 -6
- 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 +4 -4
- 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 +2 -2
- package/styles/index.css +4 -4
- package/styles/theme.css +14 -20
- package/vite/pwa.js +1 -1
|
@@ -22,8 +22,8 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
22
22
|
// title marked `edit` turns into its form control where it's shown, and
|
|
23
23
|
// saves when you leave it. This component runs it (one field open at a
|
|
24
24
|
// time, the leave-page prompt); EditableValue is each value's side, and a
|
|
25
|
-
// header badge uses it directly. A field not marked
|
|
26
|
-
//
|
|
25
|
+
// header badge uses it directly. A field not marked is read-only.
|
|
26
|
+
// Edit, in `actions`, stays for everything else. A sub-item list
|
|
27
27
|
// edits in place too (editInPlace's `list` kind, editable-list.tsx): its
|
|
28
28
|
// items added, edited, moved and removed on the page. Long text can
|
|
29
29
|
// autosave as it's typed (`autosave`), and be the editor itself, with no
|
|
@@ -45,25 +45,20 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
45
45
|
// button, which prints those sections alone under the title and
|
|
46
46
|
// subtitle, with no rail, shell or buttons, on light paper.
|
|
47
47
|
//
|
|
48
|
-
// Three layouts. `tabs` (the default
|
|
49
|
-
//
|
|
50
|
-
//
|
|
51
|
-
//
|
|
52
|
-
//
|
|
53
|
-
//
|
|
54
|
-
//
|
|
55
|
-
//
|
|
56
|
-
//
|
|
57
|
-
//
|
|
58
|
-
//
|
|
59
|
-
//
|
|
60
|
-
// columns need, one column: header, rail, main, or header, main, rail with
|
|
61
|
-
// `mobileOrder="main-first"` (a record whose long content is what you open
|
|
62
|
-
// it for: notes, a checklist). The DOM is in that order at every width, so
|
|
63
|
-
// reading and tab order match the screen: beside each other, the columns'
|
|
64
|
-
// places come from the grid, not the DOM.
|
|
48
|
+
// Three layouts. `tabs` (the default, record standard 1A): every section in
|
|
49
|
+
// one column capped at max-w-4xl, with no right rail. The short facts
|
|
50
|
+
// (sections placed `rail` with no `tab`) are the record's last tab, Details
|
|
51
|
+
// (`detailsTab`); a record with no other tab shows them in the column. A
|
|
52
|
+
// section placed `rail` *with* a `tab` is a narrow box beside that tab's
|
|
53
|
+
// sections (on a phone, under them): short facts only, never free text.
|
|
54
|
+
// `column`: one column, `placement` ignored. `rail` (legacy; consuming.md
|
|
55
|
+
// "4.98"): a narrow column on the right that stays in view while the main
|
|
56
|
+
// column scrolls, one column below the width two need (`mobileOrder`). The
|
|
57
|
+
// DOM is in that order at every width, so reading and tab order match the
|
|
58
|
+
// screen: beside each other, the columns' places come from the grid, not
|
|
59
|
+
// the DOM.
|
|
65
60
|
//
|
|
66
|
-
// Tabs
|
|
61
|
+
// Tabs: a main section with a `tab` goes under a tab list at
|
|
67
62
|
// the top of the main column, one tab per distinct name in the order the
|
|
68
63
|
// sections first give it, and only the selected tab's sections show. The
|
|
69
64
|
// rest of the main column stays above the list, and the rail always shows.
|
|
@@ -73,10 +68,10 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
73
68
|
// sections stay mounted, hidden, so a field open in place survives a
|
|
74
69
|
// switch. With no `tab` on any section, nothing changes.
|
|
75
70
|
//
|
|
76
|
-
// The tab bar (
|
|
77
|
-
// semibold, 14px on a phone), the open one plainly marked
|
|
71
|
+
// The tab bar (record standard 3B): bigger underline tabs (16px
|
|
72
|
+
// semibold, 14px on a phone), the open one plainly marked: a 3px
|
|
78
73
|
// primary line, a primary tint behind it (ui/tabs' line look) and its name
|
|
79
|
-
// bold in the theme colour (`text-primary-text
|
|
74
|
+
// bold in the theme colour (`text-primary-text`), each
|
|
80
75
|
// tab's count beside its name (`tabCounts`; none for zero). The bar sticks
|
|
81
76
|
// to the top of whatever scrolls (the page, or a record dialog's body) as
|
|
82
77
|
// the record scrolls under it, `tabsStickyTop` below the top, and once
|
|
@@ -86,11 +81,11 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
86
81
|
//
|
|
87
82
|
// `leading`, left of the title: the record's mark or avatar, with the
|
|
88
83
|
// title, subtitle and badges beside it at every width. A rail field's
|
|
89
|
-
// label sits to the left of its value (`railFields`, `beside` by default
|
|
90
|
-
//
|
|
84
|
+
// label sits to the left of its value (`railFields`, `beside` by default),
|
|
85
|
+
// as in an issue tracker's sidebar, stacked again where the
|
|
91
86
|
// rail's list is too narrow for both.
|
|
92
87
|
//
|
|
93
|
-
// The record page standard
|
|
88
|
+
// The record page standard: `badges` sit on the title's line,
|
|
94
89
|
// wrapping under a long title; Print notes is an icon (`IconAction`, its
|
|
95
90
|
// words the tooltip and name); an empty value reads as a dash
|
|
96
91
|
// (`emptyText`), and `emptyFields="fold"` folds each fields card's empty
|
|
@@ -125,11 +120,11 @@ import { factsAsFields, statusSectionFirst, useWideParent } from './entity-view-
|
|
|
125
120
|
// The view's empty text and whether fields cards fold their empty ones,
|
|
126
121
|
// for every section without threading them through each layout.
|
|
127
122
|
const EmptyContext = createContext({ text: EMPTY_DASH, fold: false });
|
|
128
|
-
// Whether the facts rail is drawn
|
|
123
|
+
// Whether the facts rail is drawn: the record's column then fills
|
|
129
124
|
// the room up to the rail (Details' reading-width cap off), and its fields
|
|
130
125
|
// rows keep a compact label (`FIELD_ROW.wide`) so the values get the rest.
|
|
131
126
|
const BesideFactsRailContext = createContext(false);
|
|
132
|
-
// The record's trail
|
|
127
|
+
// The record's trail: the crumbs above it, then its own title
|
|
133
128
|
// once it has loaded; the list's crumb is the last until then.
|
|
134
129
|
function recordTrail(back, title) {
|
|
135
130
|
if (!back.trail)
|
|
@@ -147,12 +142,12 @@ function OrEmpty({ value, emptyLabel }) {
|
|
|
147
142
|
const fieldValue = (field) => (field.value !== undefined ? field.value : field.edit?.shown);
|
|
148
143
|
function FieldRow({ field, place }) {
|
|
149
144
|
const value = fieldValue(field);
|
|
150
|
-
// An editable row is the target as a whole
|
|
145
|
+
// An editable row is the target as a whole: the list's
|
|
151
146
|
// row hover, its pencil at the end, a chevron on a phone.
|
|
152
147
|
const editable = Boolean(field.edit);
|
|
153
148
|
const shown = field.edit ? (_jsx(EditableValue, { label: field.label, edit: field.edit, look: "row", children: _jsx(OrEmpty, { value: value, emptyLabel: field.emptyLabel }) })) : (_jsx(OrEmpty, { value: value, emptyLabel: field.emptyLabel }));
|
|
154
149
|
return (_jsxs("div", { className: cn(FIELD_ROW_BASE, FIELD_ROW[place], editable && cn(editRowClass, '-mx-2 px-2 first:pt-2 last:pb-2'),
|
|
155
|
-
// Stars to tap (RatingInput
|
|
150
|
+
// Stars to tap (RatingInput) are five 44px targets on a
|
|
156
151
|
// touch screen: wider than a narrow row's value column, so the
|
|
157
152
|
// label goes above them there.
|
|
158
153
|
'pointer-coarse:has-[[data-slot=rating-input]]:flex!'), onClick: editable ? onEditRowClick : undefined, children: [_jsx("dt", { className: FIELD_LABEL, children: field.label }), _jsxs("dd", { className: cn(FIELD_VALUE, field.action && 'flex flex-col items-start gap-1.5'), "data-record-status": field.recordStatus ? '' : undefined, children: [field.hint ? (_jsxs("span", { className: "inline-flex max-w-full flex-wrap items-center gap-x-1", children: [_jsx("span", { className: "min-w-0 max-w-full", children: shown }), _jsx(FactHint, { label: field.label, hint: field.hint })] })) : (shown), field.action && _jsx(FactAction, { action: field.action })] })] }));
|
|
@@ -211,7 +206,7 @@ const RAIL_LAYOUT = {
|
|
|
211
206
|
// (max-w-4xl) and a 300px rail beside it. The strip stays above both, at
|
|
212
207
|
// full width; the rail starts level with the first content under it: the
|
|
213
208
|
// first section of the open tab (beside the tab's content, never its bar),
|
|
214
|
-
// or the first card when the record's first content isn't the tabs
|
|
209
|
+
// or the first card when the record's first content isn't the tabs.
|
|
215
210
|
const FACTS_RAIL = {
|
|
216
211
|
// Page width wide (data-width="wide" on <html>): no cap, the column fills the page.
|
|
217
212
|
page: 'max-w-[calc(var(--container-4xl)+var(--spacing)*6+300px)] page-wide:max-w-none',
|
|
@@ -301,7 +296,7 @@ function TabBody({ tab, railFields }) {
|
|
|
301
296
|
if (tab.details) {
|
|
302
297
|
// The facts on their own: a reading width, never the whole page. Beside
|
|
303
298
|
// the facts rail the column is already that (the page's own cap), so
|
|
304
|
-
// they fill it up to the rail, level with the tab bar
|
|
299
|
+
// they fill it up to the rail, level with the tab bar.
|
|
305
300
|
return (_jsx("div", { "data-slot": "entity-view-details", className: cn('flex w-full min-w-0 flex-col gap-6', !besideFactsRail && 'max-w-2xl'), children: tab.sections.map((section) => (_jsx(ViewSection, { section: section, inRail: true, railFields: railFields }, section.title))) }));
|
|
306
301
|
}
|
|
307
302
|
const main = tab.sections.map((section) => _jsx(ViewSection, { section: section }, section.title));
|
|
@@ -391,7 +386,7 @@ function tabsLayout(sections, detailsTab) {
|
|
|
391
386
|
return { above: main.filter((section) => section.tab === undefined), tabs, factsInColumn: false };
|
|
392
387
|
}
|
|
393
388
|
export function EntityView({ title, documentTitle, titleEdit, leading, subtitle, badges, actions, notice, strip, cardStrip = false, sections: givenSections, footer, layout = 'tabs', detailsTab = 'Details', tabCounts, tabsStickyTop, mobileOrder = 'rail-first', railLabel, factsRail = false, factsRailLabel, railFields = 'beside', emptyFields = 'show', emptyText = EMPTY_DASH, printLabel = 'Print Notes', printLook = 'icon', isLoading, error, onRetry, back, }) {
|
|
394
|
-
// The record's status first among the sections in its place
|
|
389
|
+
// The record's status first among the sections in its place.
|
|
395
390
|
const sections = statusSectionFirst(givenSections);
|
|
396
391
|
// Editing in place: one store per view, and the leave-page prompt only
|
|
397
392
|
// while a field is open (or one is always editable).
|
|
@@ -15,14 +15,14 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
15
15
|
// - `panels`: a panel per item side by side, every detail labelled above
|
|
16
16
|
// its value, stacking on a phone. For things with several details each
|
|
17
17
|
// that need to read as separate.
|
|
18
|
-
// - `stepper
|
|
18
|
+
// - `stepper`: the items in order as a row of numbered steps, each
|
|
19
19
|
// done, current or upcoming (an item's `step`), picking the one item
|
|
20
20
|
// whose panel shows under it; it opens on the current step. For a
|
|
21
21
|
// sequence where one is running and the others are looked at in turn (a
|
|
22
22
|
// plan's phases). The steps are a tablist: arrow keys, Home and End move
|
|
23
23
|
// and pick; on a phone the row scrolls sideways in its own box, as the
|
|
24
|
-
// record's tab bar does. Its marks are StepTrack's (step-track.tsx,
|
|
25
|
-
//
|
|
24
|
+
// record's tab bar does. Its marks are StepTrack's (step-track.tsx),
|
|
25
|
+
// the same row read only, for a display with no panels.
|
|
26
26
|
//
|
|
27
27
|
// The parts are the record's own: a state is a `Badge` in the outline
|
|
28
28
|
// style (design-language.md "The three badge styles"), a field is the
|
|
@@ -31,7 +31,7 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
31
31
|
// no items reads `emptyText` ("Nothing yet"), an item with no fields
|
|
32
32
|
// `noFieldsText` ("No details").
|
|
33
33
|
//
|
|
34
|
-
// An item can carry its own parts too
|
|
34
|
+
// An item can carry its own parts too: `content`, anything of the
|
|
35
35
|
// app's (an editor of several fields, a note, a chart), drawn under its
|
|
36
36
|
// fields at the item's full width, never in the label/value grid; and
|
|
37
37
|
// `actions`, its own buttons (Edit, Remove), at the end of its title line,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
// A fact's extras
|
|
3
|
-
// strip's values (KeyStats
|
|
4
|
-
// small action button under the value. And a `switch` fact's switch
|
|
2
|
+
// A fact's extras, shared by the facts rail, Details and the
|
|
3
|
+
// strip's values (KeyStats): a hint behind an info button, and a
|
|
4
|
+
// small action button under the value. And a `switch` fact's switch.
|
|
5
5
|
import { useId, useState } from 'react';
|
|
6
6
|
import { InfoIcon } from 'lucide-react';
|
|
7
7
|
import { cn } from 'cn';
|
|
@@ -9,7 +9,7 @@ import { Button } from '../ui/button.js';
|
|
|
9
9
|
import { Switch } from '../ui/switch.js';
|
|
10
10
|
import { Tooltip, TooltipContent, TooltipTrigger } from '../ui/tooltip.js';
|
|
11
11
|
import { usePrinting } from './print-context.js';
|
|
12
|
-
// A fact's hint
|
|
12
|
+
// A fact's hint: an info button after the value, its words in a
|
|
13
13
|
// tooltip on hover and on keyboard focus. On a touch screen, where a
|
|
14
14
|
// tooltip has no hover to open it, the words are a line under the value
|
|
15
15
|
// instead (and the button goes). A screen reader reads the words with the
|
|
@@ -19,7 +19,7 @@ export function FactHint({ label, hint }) {
|
|
|
19
19
|
const id = useId();
|
|
20
20
|
return (_jsxs(_Fragment, { children: [_jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { render: _jsx("button", { type: "button", "data-slot": "entity-view-fact-hint", "aria-label": `About ${label}`, "aria-describedby": id, className: "inline-flex size-6 shrink-0 items-center justify-center rounded-sm text-muted-foreground outline-none hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50 pointer-coarse:hidden" }), children: _jsx(InfoIcon, { "aria-hidden": "true", className: "size-3.5" }) }), _jsx(TooltipContent, { children: hint })] }), _jsx("span", { id: id, "data-slot": "entity-view-fact-hint-text", className: "sr-only basis-full type-caption text-muted-foreground pointer-coarse:not-sr-only", children: hint })] }));
|
|
21
21
|
}
|
|
22
|
-
// A fact's action
|
|
22
|
+
// A fact's action: a small button under its value, or the app's
|
|
23
23
|
// own action given that button (`render`), so its dialog opens from it.
|
|
24
24
|
export function FactAction({ action }) {
|
|
25
25
|
const Icon = action.icon;
|
|
@@ -5,12 +5,12 @@
|
|
|
5
5
|
// Label beside value from `sm` up, once the list itself is 24rem wide;
|
|
6
6
|
// below either (a phone, or a narrow box on a wide screen: a panel, a
|
|
7
7
|
// dialog's column) the label sits above its value, so nothing is squeezed
|
|
8
|
-
// into a narrow second column (
|
|
9
|
-
//
|
|
8
|
+
// into a narrow second column (a value column squeezed to nothing
|
|
9
|
+
// cuts off an editor's controls, ChoiceButtons' among them). In
|
|
10
10
|
// the rail the list's own width decides instead (a container query on the
|
|
11
11
|
// <dl>): label above value in the narrow rail, beside it once the rail's
|
|
12
12
|
// sections stack full width under the header.
|
|
13
|
-
// `railFields="beside"`
|
|
13
|
+
// `railFields="beside"` puts them side by side in the rail too,
|
|
14
14
|
// from an 18rem list (a rail card beside the main column is ~19rem
|
|
15
15
|
// inside), with a narrower label column, and stacked below that. Each
|
|
16
16
|
// container query needs an `@container/fields` on the <dl>.
|
|
@@ -18,10 +18,10 @@ export const FIELD_ROW = {
|
|
|
18
18
|
page: 'sm:@sm/fields:grid sm:@sm/fields:grid-cols-[minmax(--spacing(32),--spacing(48))_minmax(0,1fr)] sm:@sm/fields:gap-6',
|
|
19
19
|
rail: '@lg/fields:grid @lg/fields:grid-cols-[minmax(--spacing(32),--spacing(48))_1fr] @lg/fields:gap-6',
|
|
20
20
|
railBeside: '@2xs/fields:grid @2xs/fields:grid-cols-[minmax(--spacing(24),--spacing(28))_minmax(0,1fr)] @2xs/fields:items-baseline @2xs/fields:gap-4 @2xs/fields:py-2.5 @lg/fields:grid-cols-[minmax(--spacing(32),--spacing(48))_1fr] @lg/fields:gap-6',
|
|
21
|
-
// The facts rail
|
|
21
|
+
// The facts rail: a 300px card, so side by side from a
|
|
22
22
|
// 16rem list, the label column a little narrower again.
|
|
23
23
|
facts: '@3xs/fields:grid @3xs/fields:grid-cols-[--spacing(24)_minmax(0,1fr)] @3xs/fields:items-baseline @3xs/fields:gap-3 @3xs/fields:py-2.5',
|
|
24
|
-
// Beside the facts rail
|
|
24
|
+
// Beside the facts rail: the cards fill the column up to the
|
|
25
25
|
// rail, so the label keeps a compact 10rem and the value takes the rest
|
|
26
26
|
// (a 12rem label, a third of a 36rem card, wrapped most values onto two
|
|
27
27
|
// lines). Stacked below `sm` or a 24rem list, as on the page.
|
|
@@ -26,8 +26,8 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
26
26
|
// and, when the group has its own `progress`, "3 of 12 filled" beside
|
|
27
27
|
// it. With more than one group counted, each one's count is listed
|
|
28
28
|
// under the bar.
|
|
29
|
-
// - States: `loading
|
|
30
|
-
//
|
|
29
|
+
// - States: `loading`, `error` (with `onRetry`) and an empty queue
|
|
30
|
+
// (`empty`).
|
|
31
31
|
//
|
|
32
32
|
// The record is a centred column, 40rem at most; the buttons sit under it,
|
|
33
33
|
// Skip at the start and Save and next at the end.
|
|
@@ -96,7 +96,6 @@ export function FillInQueue({ items, getKey, renderItem, onSave, canSave = true,
|
|
|
96
96
|
// (adjusting state while rendering, so nothing draws the old one).
|
|
97
97
|
if (index !== -1 && (held.key !== currentKey || held.index !== index))
|
|
98
98
|
setHeld({ key: currentKey, index });
|
|
99
|
-
// The app moving the queue to an index.
|
|
100
99
|
const appliedIndex = useRef(indexProp);
|
|
101
100
|
useEffect(() => {
|
|
102
101
|
if (indexProp === undefined || indexProp === appliedIndex.current)
|
|
@@ -8,7 +8,7 @@ export type FilterBarSearch = {
|
|
|
8
8
|
/** The box's accessible name: "Search" unless set. */
|
|
9
9
|
label?: string;
|
|
10
10
|
/**
|
|
11
|
-
* A key pressed in the box
|
|
11
|
+
* A key pressed in the box: Enter opening the one match, or
|
|
12
12
|
* "#12" going straight to record 12. Called before the box's own
|
|
13
13
|
* handling; `event.preventDefault()` keeps the key from it.
|
|
14
14
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
// A list's date filter
|
|
2
|
+
// A list's date filter, for FilterBar: a select that names itself
|
|
3
3
|
// like FilterSelect ("Any due date" while off, "Due: Before today" on),
|
|
4
4
|
// with the relative presets (lib/date-filter.ts) and Between dates, which
|
|
5
5
|
// shows a From and a To day beside it. Its value is one string, so it's a
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// A filter select's accessible name (
|
|
1
|
+
// A filter select's accessible name (FilterSelect and FilterDate):
|
|
2
2
|
// what it filters first, so it's found by its label ("Status") whatever it
|
|
3
3
|
// shows, then the words shown unless they already say the label, so voice
|
|
4
4
|
// control can say them too. "Status" while it shows "Any status", "Status:
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
// A small form in a dialog
|
|
2
|
+
// A small form in a dialog: a new record of up to about eight
|
|
3
3
|
// fields over its list, or any short form a page opens (a weak spot, a
|
|
4
4
|
// quick add). The title and the buttons stay put and the fields scroll
|
|
5
5
|
// between them; 640px wide (DialogContent `size="form"`), the whole screen
|
|
@@ -16,7 +16,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
16
16
|
// `dirty` (react-hook-form's `formState.isDirty`) makes Esc, the close
|
|
17
17
|
// button, a click outside and Cancel ask "Discard your changes?" first.
|
|
18
18
|
// As a list's `new` route, `dirty` also guards leaving by a link, Back or
|
|
19
|
-
// the sidebar (FormLeaveGuard
|
|
19
|
+
// the sidebar (FormLeaveGuard), as EntityForm's does.
|
|
20
20
|
// A failed save is a Notice above the buttons with Try again, which
|
|
21
21
|
// submits again unless `onRetry` says otherwise; what was typed stays.
|
|
22
22
|
// An edit refused because the record changed elsewhere (`conflict`, from
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
// Leaving a form with something typed (
|
|
2
|
+
// Leaving a form with something typed (the form standard):
|
|
3
3
|
// "Discard your changes?" (Keep editing, Discard), the prompt a dialog
|
|
4
4
|
// and a value edited in place ask with, before a link, Back or the
|
|
5
5
|
// sidebar moves to another page; the browser's own prompt before a reload
|
|
@@ -21,7 +21,7 @@ export function FormLeaveGuard({ dirty, letThrough }) {
|
|
|
21
21
|
useLayoutEffect(() => {
|
|
22
22
|
latest.current = { dirty, letThrough };
|
|
23
23
|
});
|
|
24
|
-
//
|
|
24
|
+
// A rich-text field's held-back typing is reported first; the form
|
|
25
25
|
// marks itself dirty from it as it does from any change.
|
|
26
26
|
const blocker = useBlocker(({ currentLocation, nextLocation }) => {
|
|
27
27
|
flushPendingEdits();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
// A group of a form's fields in a card (
|
|
2
|
+
// A group of a form's fields in a card (the form standard),
|
|
3
3
|
// drawn as a record's section is (EntityView): the card surface, its title
|
|
4
4
|
// on the heading band. Only on a form of eight fields or more, and never
|
|
5
5
|
// in a dialog; a short form is one run of fields. Its fields are a
|
|
@@ -7,7 +7,7 @@ export type IconActionProps = Omit<ComponentProps<typeof Button>, 'children' | '
|
|
|
7
7
|
/** What the action does ("Delete", "Print notes"): its tooltip and accessible name. */
|
|
8
8
|
label: string;
|
|
9
9
|
/**
|
|
10
|
-
* The accessible name, when it says more than the tooltip
|
|
10
|
+
* The accessible name, when it says more than the tooltip:
|
|
11
11
|
* "Delete The Long Walk" for a tooltip of "Delete", so several on a page
|
|
12
12
|
* are told apart. Start it with `label`, so what's seen is what's said.
|
|
13
13
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
// A command drawn as its icon alone (record page standard 3.2
|
|
2
|
+
// A command drawn as its icon alone (record page standard 3.2): an
|
|
3
3
|
// outline icon button at the header's button size, its `label` both the
|
|
4
4
|
// tooltip shown on hover or focus and the button's accessible name. For
|
|
5
5
|
// the universal actions only (Delete, Print notes, Copy link, Pin, Open
|
|
@@ -9,7 +9,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
9
9
|
// It takes every Button prop, so it can be a dialog's trigger as it is:
|
|
10
10
|
// `<DialogTrigger render={<IconAction icon={Trash2Icon} label="Delete" tone="destructive" />} />`.
|
|
11
11
|
//
|
|
12
|
-
// A link
|
|
12
|
+
// A link: `render={<Link to="/print" />}` or `render={<a href=… />}`
|
|
13
13
|
// draws the icon as that link, its tooltip and name kept: the link is the
|
|
14
14
|
// tooltip's trigger itself, drawn as the button, so it stays a link with
|
|
15
15
|
// its href. A link takes no Button props.
|
|
@@ -25,7 +25,6 @@ export function ImageField({ id, value, thumbUrl, onChange, upload, accept = DEF
|
|
|
25
25
|
const input = useRef(null);
|
|
26
26
|
const main = useRef(null);
|
|
27
27
|
const [busy, setBusy] = useState(false);
|
|
28
|
-
// Why the last file picked isn't the field's image.
|
|
29
28
|
const [problem, setProblem] = useState(null);
|
|
30
29
|
// What a screen reader hears of an upload: started, done.
|
|
31
30
|
const [status, setStatus] = useState('');
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// Set by a container whose inline <EditableValue>s must keep their
|
|
2
|
-
// pencil's room at rest (KeyStats
|
|
2
|
+
// pencil's room at rest (KeyStats), as `keepPencilRoom` does for
|
|
3
3
|
// one: a value growing on hover moved the values after it along a
|
|
4
4
|
// wrapping row, and a nearly full row wrapped, so the hovered value slid
|
|
5
5
|
// out from under the mouse and a click opened the next one.
|
|
@@ -9,12 +9,12 @@ export type KeyStat = {
|
|
|
9
9
|
/** The concept's icon, drawn at 13px before the label (decorative: the label still says it). */
|
|
10
10
|
icon?: IconComponent;
|
|
11
11
|
/**
|
|
12
|
-
* A few words on the value
|
|
12
|
+
* A few words on the value, behind an info button after it: a
|
|
13
13
|
* tooltip on hover and keyboard focus, a line under the value on a touch
|
|
14
14
|
* screen. A screen reader reads it with the value.
|
|
15
15
|
*/
|
|
16
16
|
info?: string;
|
|
17
|
-
/** A small button under the value
|
|
17
|
+
/** A small button under the value, as a rail fact's `action`. */
|
|
18
18
|
action?: EntityViewFactAction;
|
|
19
19
|
};
|
|
20
20
|
/** A strip value's action: the same shape as a rail fact's. */
|
|
@@ -23,7 +23,7 @@ export type KeyStatsProps = {
|
|
|
23
23
|
stats: readonly KeyStat[];
|
|
24
24
|
/** What an empty value reads as. Defaults to a dash, read as "Not set". */
|
|
25
25
|
emptyLabel?: string;
|
|
26
|
-
/** `content` (the default
|
|
26
|
+
/** `content` (the default): as wide as its numbers. `full`: across the page. */
|
|
27
27
|
width?: 'content' | 'full';
|
|
28
28
|
className?: string;
|
|
29
29
|
};
|
|
@@ -24,7 +24,7 @@ export type LineChartProps = {
|
|
|
24
24
|
/**
|
|
25
25
|
* Named steps, lowest first: `['Very low', 'Low', 'Moderate', 'High']`.
|
|
26
26
|
* Each point's y is its step's index. The steps are named on the plot's
|
|
27
|
-
* left, the range is all of them, and the line steps
|
|
27
|
+
* left, the range is all of them, and the line steps.
|
|
28
28
|
*/
|
|
29
29
|
levels?: readonly string[];
|
|
30
30
|
/** A value as shown: `usd`. Defaults to the number as the browser writes it. */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsxs as _jsxs, jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
// A small value-over-time chart for a record's page
|
|
2
|
+
// A small value-over-time chart for a record's page: one series (a
|
|
3
3
|
// price checked daily, a weight, a balance) against an optional dashed
|
|
4
4
|
// target, with its lowest, highest or latest point marked. Plain SVG, no
|
|
5
5
|
// chart library: one line, a few dozen points, nothing to zoom.
|
|
@@ -15,12 +15,12 @@ import { jsxs as _jsxs, jsx as _jsx, Fragment as _Fragment } from "react/jsx-run
|
|
|
15
15
|
// a summary (first, last, lowest, highest, the target) and a table of
|
|
16
16
|
// every point, all visually hidden.
|
|
17
17
|
//
|
|
18
|
-
// A `projection`
|
|
18
|
+
// A `projection` carries the line on past its last point, dashed in
|
|
19
19
|
// the same colour: where a balance may go, not where it went. It shares
|
|
20
20
|
// the plot's x and y ranges, so the target and the projection meet where
|
|
21
21
|
// they would.
|
|
22
22
|
//
|
|
23
|
-
// `levels`
|
|
23
|
+
// `levels` is for a value that is one of a few named steps (a
|
|
24
24
|
// confidence, Very low to High): each y is its step's index. The steps
|
|
25
25
|
// are named down the plot's left with a faint rule at each, the range is
|
|
26
26
|
// every step, and the line holds each value until the next point, then
|
|
@@ -78,5 +78,5 @@ export function LineChart({ label, points, target, projection, mark, levels, for
|
|
|
78
78
|
return (_jsxs("figure", { "data-slot": "line-chart", "data-state": "success", "aria-label": label, className: cn('grid min-w-0 gap-x-2 gap-y-1.5', steps ? 'grid-cols-[auto_minmax(0,1fr)]' : 'grid-cols-1', className), children: [steps && (_jsxs("div", { "aria-hidden": "true", "data-slot": "line-chart-levels", className: "relative", style: { height }, children: [levels.map((name, index) => (_jsx("span", { className: "absolute right-0 -translate-y-1/2 type-caption whitespace-nowrap text-muted-foreground", style: { top: percent(layout.levelYs[index]) }, children: name }, name))), _jsx("span", { className: "invisible flex h-0 flex-col overflow-hidden type-caption whitespace-nowrap", children: levels.map((name) => (_jsx("span", { children: name }, name))) })] })), _jsxs("div", { "aria-hidden": "true", className: "relative border-b border-border", style: { height }, children: [steps &&
|
|
79
79
|
layout.levelYs.map((y, index) => (_jsx("span", { "data-slot": "line-chart-level-rule", className: "absolute inset-x-0 border-t border-dashed border-border", style: { top: percent(y) } }, index))), target && layout.targetY !== undefined && (_jsxs(_Fragment, { children: [_jsx("svg", { viewBox: "0 0 100 100", preserveAspectRatio: "none", className: "absolute inset-0 size-full overflow-visible text-success-text", children: _jsx("line", { x1: "0", x2: "100", y1: layout.targetY * 100, y2: layout.targetY * 100, strokeWidth: 1.5, strokeDasharray: "6 4", vectorEffect: "non-scaling-stroke", className: "stroke-current" }) }), _jsxs("span", { className: cn('absolute right-0 -translate-y-full type-caption text-success-text tabular-nums', PLATE), style: { top: percent(layout.targetY) }, children: [target.label, " ", formatY(target.y)] })] })), points.length > 1 && (_jsx("svg", { viewBox: "0 0 100 100", preserveAspectRatio: "none", className: "absolute inset-0 size-full overflow-visible text-info-text", children: _jsx("polyline", { points: line, fill: "none", strokeWidth: 2, strokeLinejoin: "round", strokeLinecap: "round", vectorEffect: "non-scaling-stroke", className: "stroke-current" }) })), projected.length > 1 && (_jsx("svg", { "data-slot": "line-chart-projection", viewBox: "0 0 100 100", preserveAspectRatio: "none", className: "absolute inset-0 size-full overflow-visible text-info-text", children: _jsx("polyline", { points: toLine(projected), fill: "none", strokeWidth: 2, strokeDasharray: "6 4", strokeLinejoin: "round", vectorEffect: "non-scaling-stroke", className: "stroke-current" }) })), dot && (_jsxs(_Fragment, { children: [_jsx("span", { "data-slot": "line-chart-mark", className: "absolute size-2.5 -translate-x-1/2 -translate-y-1/2 rounded-full bg-info-text ring-2 ring-card", style: { left: percent(dot.x), top: percent(dot.y) } }), _jsx("span", { className: cn('absolute type-caption font-medium text-foreground tabular-nums', PLATE, besides(dot.x),
|
|
80
80
|
// Under the lowest point, where the line isn't; over any other.
|
|
81
|
-
mark === 'min' ? 'mt-1' : '-translate-y-full -mt-1'), style: { left: percent(dot.x), top: percent(dot.y) }, children: formatY(points[marked ? layout.markIndex : 0].y) })] }))] }), _jsxs("div", { "aria-hidden": "true", className: cn('flex justify-between gap-3 type-caption text-muted-foreground tabular-nums', steps && 'col-start-2'), children: [_jsx("span", { children: formatX(points[0].x) }), (points.length > 1 || ahead.length > 0) && _jsx("span", { children: formatX(lastX) })] }), _jsx("figcaption", { className: "sr-only", children: steps ? `${summary}; one of ${levels.join(', ')}` : summary }),
|
|
81
|
+
mark === 'min' ? 'mt-1' : '-translate-y-full -mt-1'), style: { left: percent(dot.x), top: percent(dot.y) }, children: formatY(points[marked ? layout.markIndex : 0].y) })] }))] }), _jsxs("div", { "aria-hidden": "true", className: cn('flex justify-between gap-3 type-caption text-muted-foreground tabular-nums', steps && 'col-start-2'), children: [_jsx("span", { children: formatX(points[0].x) }), (points.length > 1 || ahead.length > 0) && _jsx("span", { children: formatX(lastX) })] }), _jsx("figcaption", { className: "sr-only", children: steps ? `${summary}; one of ${levels.join(', ')}` : summary }), _jsx("div", { className: "sr-only", children: _jsxs("table", { children: [_jsx("caption", { children: label }), _jsx("thead", { children: _jsxs("tr", { children: [_jsx("th", { scope: "col", children: "When" }), _jsx("th", { scope: "col", children: "Value" })] }) }), _jsxs("tbody", { children: [points.map((point, index) => (_jsxs("tr", { children: [_jsx("th", { scope: "row", children: formatX(point.x) }), _jsx("td", { children: formatY(point.y) })] }, index))), ahead.map((point, index) => (_jsxs("tr", { children: [_jsx("th", { scope: "row", children: formatX(point.x) }), _jsxs("td", { children: [formatY(point.y), " (", projection.label, ")"] })] }, `ahead-${index}`)))] })] }) })] }));
|
|
82
82
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// Which of ListEditor's items are open, when its items show as summary
|
|
2
|
-
// lines (`summary
|
|
2
|
+
// lines (`summary`). One item is open at a time, held by its stable
|
|
3
3
|
// id (useFieldArray's `field.id`), so it stays open while rows move and
|
|
4
4
|
// closes when it's removed. An item that was just added or duplicated
|
|
5
5
|
// opens, and one with a validation error is open whatever else is.
|
|
@@ -10,7 +10,7 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
|
|
|
10
10
|
// useFieldArray `fields`, `append`, `remove` and `move`, so the items save
|
|
11
11
|
// with the parent's form and their errors bind like any other field.
|
|
12
12
|
//
|
|
13
|
-
// A long list of rich items
|
|
13
|
+
// A long list of rich items can show each item as one line instead
|
|
14
14
|
// (`summary`): the line is a button that opens the item to its fields,
|
|
15
15
|
// one item at a time (list-editor-rows.ts), with the row buttons beside
|
|
16
16
|
// it. And `onDuplicate` puts a Duplicate button beside Remove, for lists
|
|
@@ -9,17 +9,17 @@ export type ListHeaderAction = {
|
|
|
9
9
|
label: string;
|
|
10
10
|
onSelect: () => void;
|
|
11
11
|
icon?: IconComponent;
|
|
12
|
-
/** Can't be used now
|
|
12
|
+
/** Can't be used now: an import already running, nothing to export. The item stays in ⋯, greyed. */
|
|
13
13
|
disabled?: boolean;
|
|
14
14
|
};
|
|
15
|
-
/** The one button beside New
|
|
15
|
+
/** The one button beside New: a link to a page, or a function. */
|
|
16
16
|
export type ListHeaderSecondaryAction = {
|
|
17
17
|
label: string;
|
|
18
18
|
/** Drawn before the words, in the button and in ⋯. */
|
|
19
19
|
icon?: IconComponent;
|
|
20
20
|
/** Can't be used now (a refresh in flight): the button and its menu item are disabled. */
|
|
21
21
|
disabled?: boolean;
|
|
22
|
-
/** A few words under the button
|
|
22
|
+
/** A few words under the button: "12 searches left". In ⋯ on a phone, under its words. */
|
|
23
23
|
hint?: string;
|
|
24
24
|
} & ({
|
|
25
25
|
to: To;
|
|
@@ -47,7 +47,7 @@ export type ListHeaderProps = {
|
|
|
47
47
|
/** How many records there are, beside the title in the muted tone. Left out while loading. */
|
|
48
48
|
count?: number;
|
|
49
49
|
/**
|
|
50
|
-
* One short line under the title
|
|
50
|
+
* One short line under the title, in the muted tone: a sentence
|
|
51
51
|
* of context for a list that needs it. Wraps in the header's width.
|
|
52
52
|
*/
|
|
53
53
|
description?: string;
|
|
@@ -64,7 +64,7 @@ export type ListHeaderProps = {
|
|
|
64
64
|
to?: never;
|
|
65
65
|
};
|
|
66
66
|
/**
|
|
67
|
-
* One more button beside New
|
|
67
|
+
* One more button beside New, for the list's second most common
|
|
68
68
|
* action ("Refresh Now", "Add from Catalog"). An outline button before
|
|
69
69
|
* New, which stays the primary. On a phone it's the first item in ⋯.
|
|
70
70
|
*/
|
|
@@ -82,7 +82,7 @@ export type ListHeaderProps = {
|
|
|
82
82
|
noun?: string;
|
|
83
83
|
};
|
|
84
84
|
/**
|
|
85
|
-
* Lists that are this one's peers
|
|
85
|
+
* Lists that are this one's peers: a switch beside the title,
|
|
86
86
|
* this list among them. Two or more; fewer draws nothing.
|
|
87
87
|
*/
|
|
88
88
|
siblings?: readonly ListHeaderSibling[];
|
|
@@ -12,21 +12,21 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
12
12
|
// are routes, `more` are the app's own actions. The ⋯ button has an
|
|
13
13
|
// accessible name and is left out when the menu would be empty.
|
|
14
14
|
//
|
|
15
|
-
// `siblings`
|
|
15
|
+
// `siblings` is a switch beside the title between lists that are
|
|
16
16
|
// one thing seen three ways (Exercises / Targets / Weak spots): links in a
|
|
17
17
|
// segmented row, the one on marked as the current page. They're the
|
|
18
18
|
// page's own peers, so they aren't in ⋯, which keeps only what's left
|
|
19
19
|
// (Show deleted). On a phone the switch takes its own line under the
|
|
20
20
|
// title and scrolls sideways if it must.
|
|
21
21
|
//
|
|
22
|
-
// `secondaryAction`
|
|
23
|
-
//
|
|
24
|
-
//
|
|
25
|
-
//
|
|
26
|
-
//
|
|
27
|
-
//
|
|
22
|
+
// `secondaryAction` is one more button, beside New and before it, for a
|
|
23
|
+
// list's second most common action ("Refresh Now", "Add from Catalog"): an
|
|
24
|
+
// outline button, so New stays the primary. On a phone it folds into ⋯,
|
|
25
|
+
// the menu's first item, so the row keeps the title, ⋯ and New. Its `hint`
|
|
26
|
+
// is a short line under the button ("12 searches left", ActionHint), and
|
|
27
|
+
// the line under its words in ⋯ on a phone.
|
|
28
28
|
//
|
|
29
|
-
// `description`
|
|
29
|
+
// `description` is one short muted line under the title, for a
|
|
30
30
|
// list that needs a sentence of context ("Searches run against the
|
|
31
31
|
// catalog once a day."). It wraps in the header's width (under a framed
|
|
32
32
|
// table's, where DataTable's `pageHeader` shares it), never widening it,
|