@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.
Files changed (163) hide show
  1. package/README.md +7 -6
  2. package/bin/ui-foundation.mjs +1 -1
  3. package/conventions/agents/spec-tester.md +3 -3
  4. package/conventions/docs/add-an-entity.md +722 -714
  5. package/conventions/docs/cell-patterns.md +206 -378
  6. package/conventions/docs/column-options.md +6 -12
  7. package/conventions/docs/design-language.md +293 -515
  8. package/conventions/docs/entity-plan-template.md +9 -7
  9. package/conventions/docs/reminders.md +12 -17
  10. package/conventions/docs/timed-screens.md +17 -20
  11. package/dist/components/app/action-error.js +1 -1
  12. package/dist/components/app/action-hint.js +1 -1
  13. package/dist/components/app/app-shell-bottom-bar.js +4 -4
  14. package/dist/components/app/app-shell-nav.d.ts +1 -1
  15. package/dist/components/app/app-shell-nav.js +1 -1
  16. package/dist/components/app/app-shell.d.ts +1 -1
  17. package/dist/components/app/app-shell.js +9 -9
  18. package/dist/components/app/board.d.ts +13 -13
  19. package/dist/components/app/board.js +3 -3
  20. package/dist/components/app/choice-buttons.d.ts +1 -1
  21. package/dist/components/app/data-table-tools.d.ts +3 -3
  22. package/dist/components/app/data-table.d.ts +11 -13
  23. package/dist/components/app/data-table.js +5 -5
  24. package/dist/components/app/date-field.js +1 -1
  25. package/dist/components/app/delete-action.d.ts +1 -1
  26. package/dist/components/app/delete-action.js +4 -4
  27. package/dist/components/app/edit-caret.js +1 -1
  28. package/dist/components/app/edit-in-place-presets.d.ts +4 -4
  29. package/dist/components/app/edit-in-place-store.d.ts +3 -3
  30. package/dist/components/app/edit-in-place-store.js +7 -7
  31. package/dist/components/app/editable-list.js +2 -3
  32. package/dist/components/app/editable-value.d.ts +2 -2
  33. package/dist/components/app/editable-value.js +20 -20
  34. package/dist/components/app/entity-form.js +2 -2
  35. package/dist/components/app/entity-view-facts.d.ts +12 -12
  36. package/dist/components/app/entity-view-facts.js +1 -1
  37. package/dist/components/app/entity-view.d.ts +16 -16
  38. package/dist/components/app/entity-view.js +28 -33
  39. package/dist/components/app/equal-items.js +4 -4
  40. package/dist/components/app/fact-extras.js +5 -5
  41. package/dist/components/app/field-rows.js +5 -5
  42. package/dist/components/app/fill-in-queue.js +2 -3
  43. package/dist/components/app/filter-bar.d.ts +1 -1
  44. package/dist/components/app/filter-date.js +1 -1
  45. package/dist/components/app/filter-name.js +1 -1
  46. package/dist/components/app/form-dialog.js +2 -2
  47. package/dist/components/app/form-leave-guard.js +2 -2
  48. package/dist/components/app/form-section.js +1 -1
  49. package/dist/components/app/icon-action.d.ts +1 -1
  50. package/dist/components/app/icon-action.js +2 -2
  51. package/dist/components/app/image-field.js +0 -1
  52. package/dist/components/app/keep-pencil-room.js +1 -1
  53. package/dist/components/app/key-stats.d.ts +3 -3
  54. package/dist/components/app/line-chart.d.ts +1 -1
  55. package/dist/components/app/line-chart.js +3 -3
  56. package/dist/components/app/list-editor-rows.js +1 -1
  57. package/dist/components/app/list-editor.js +1 -1
  58. package/dist/components/app/list-header.d.ts +6 -6
  59. package/dist/components/app/list-header.js +8 -8
  60. package/dist/components/app/markdown.js +30 -37
  61. package/dist/components/app/milkdown-editor.js +37 -62
  62. package/dist/components/app/module-card.js +6 -7
  63. package/dist/components/app/month-calendar.d.ts +46 -0
  64. package/dist/components/app/month-calendar.js +160 -0
  65. package/dist/components/app/month-day-field.js +0 -1
  66. package/dist/components/app/multi-choice.d.ts +1 -1
  67. package/dist/components/app/multi-choice.js +3 -3
  68. package/dist/components/app/multi-line-chart.js +1 -1
  69. package/dist/components/app/multi-pick.js +9 -10
  70. package/dist/components/app/multi-reference.js +2 -2
  71. package/dist/components/app/notes-outline.js +0 -1
  72. package/dist/components/app/notify.js +2 -2
  73. package/dist/components/app/offline-notice.js +1 -1
  74. package/dist/components/app/option-icon.js +1 -1
  75. package/dist/components/app/option-select.d.ts +1 -1
  76. package/dist/components/app/overview-page.d.ts +2 -2
  77. package/dist/components/app/overview-page.js +1 -1
  78. package/dist/components/app/page-trail-context.js +1 -1
  79. package/dist/components/app/pill-filter.d.ts +2 -2
  80. package/dist/components/app/prose-look.js +1 -1
  81. package/dist/components/app/rating-input.js +1 -1
  82. package/dist/components/app/rating-score.js +1 -1
  83. package/dist/components/app/record-dialog.js +25 -40
  84. package/dist/components/app/recurrence-field.js +6 -6
  85. package/dist/components/app/reference-combobox.js +1 -2
  86. package/dist/components/app/rich-text-box-anchor.js +0 -1
  87. package/dist/components/app/rich-text-edges.js +2 -2
  88. package/dist/components/app/rich-text-editor.d.ts +2 -3
  89. package/dist/components/app/rich-text-editor.js +19 -32
  90. package/dist/components/app/rich-text-empty-paragraph.d.ts +6 -7
  91. package/dist/components/app/rich-text-empty-paragraph.js +6 -7
  92. package/dist/components/app/rich-text-floating-toolbar.js +0 -1
  93. package/dist/components/app/rich-text-formats.js +2 -2
  94. package/dist/components/app/rich-text-input-rules.js +1 -2
  95. package/dist/components/app/rich-text-keyboard-bar.js +6 -7
  96. package/dist/components/app/rich-text-node-views.js +1 -2
  97. package/dist/components/app/rich-text-shortcuts.js +8 -8
  98. package/dist/components/app/rich-text-slash-menu.js +22 -12
  99. package/dist/components/app/rich-text-slash.d.ts +2 -2
  100. package/dist/components/app/rich-text-slash.js +2 -2
  101. package/dist/components/app/rich-text-table-grips.d.ts +1 -1
  102. package/dist/components/app/rich-text-table-grips.js +1 -2
  103. package/dist/components/app/rich-text-tasks.d.ts +1 -1
  104. package/dist/components/app/rich-text-tasks.js +1 -1
  105. package/dist/components/app/rich-text-touch.js +1 -1
  106. package/dist/components/app/search-palette.js +1 -2
  107. package/dist/components/app/secondary-filters.js +2 -3
  108. package/dist/components/app/session-view.js +1 -1
  109. package/dist/components/app/stacked-area-chart.js +1 -1
  110. package/dist/components/app/step-track.d.ts +1 -1
  111. package/dist/components/app/step-track.js +3 -3
  112. package/dist/components/app/widget-card.js +26 -30
  113. package/dist/components/app/widget-layout-sheet.js +1 -1
  114. package/dist/components/ui/calendar.js +2 -2
  115. package/dist/components/ui/combobox.d.ts +1 -1
  116. package/dist/components/ui/combobox.js +2 -2
  117. package/dist/components/ui/field.d.ts +1 -1
  118. package/dist/components/ui/field.js +6 -6
  119. package/dist/components/ui/skeleton.js +1 -1
  120. package/dist/components/ui/sonner.js +1 -1
  121. package/dist/components/ui/tabs.js +1 -1
  122. package/dist/error-reporting/reporter.d.ts +1 -1
  123. package/dist/error-reporting/reporter.js +1 -1
  124. package/dist/hooks/table-url-changes.d.ts +2 -2
  125. package/dist/hooks/table-url-changes.js +5 -6
  126. package/dist/hooks/use-action.js +1 -1
  127. package/dist/hooks/use-record-update.js +1 -1
  128. package/dist/hooks/use-table-url-state.d.ts +1 -1
  129. package/dist/hooks/use-table-url-state.js +2 -2
  130. package/dist/index.d.ts +1 -0
  131. package/dist/index.js +3 -2
  132. package/dist/lib/audio-cues.js +2 -2
  133. package/dist/lib/connection.js +1 -1
  134. package/dist/lib/date-filter.js +1 -1
  135. package/dist/lib/entity-view-tab.js +1 -1
  136. package/dist/lib/field-rows.js +2 -2
  137. package/dist/lib/form-errors.d.ts +1 -1
  138. package/dist/lib/form-errors.js +1 -1
  139. package/dist/lib/keep-audio-alive.js +1 -1
  140. package/dist/lib/line-chart-layout.js +3 -3
  141. package/dist/lib/markdown-inline.js +0 -2
  142. package/dist/lib/markdown-merge.js +2 -2
  143. package/dist/lib/markdown-table-widths.js +1 -1
  144. package/dist/lib/markdown-table.js +1 -2
  145. package/dist/lib/markdown-toggle.js +1 -1
  146. package/dist/lib/page-leaving.js +1 -1
  147. package/dist/lib/recurrence-format.d.ts +2 -2
  148. package/dist/lib/recurrence-format.js +1 -1
  149. package/dist/lib/recurrence-phrase.d.ts +1 -1
  150. package/dist/lib/recurrence-phrase.js +2 -2
  151. package/dist/lib/recurrence.d.ts +1 -1
  152. package/dist/lib/recurrence.js +2 -2
  153. package/dist/lib/stale-chunk-reload.js +1 -1
  154. package/dist/lib/status-kinds.d.ts +1 -1
  155. package/dist/lib/status-kinds.js +2 -2
  156. package/dist/mocks/start-worker.js +2 -2
  157. package/dist/routes/login.js +1 -1
  158. package/dist/testing/index.d.ts +7 -4
  159. package/dist/testing/index.js +10 -13
  160. package/package.json +1 -1
  161. package/styles/index.css +3 -3
  162. package/styles/theme.css +14 -20
  163. package/vite/pwa.js +1 -1
@@ -1,5 +1,5 @@
1
- // Where LineChart's points, target and mark go (#238), React-free so the
2
- // rules are unit tested on their own (tests/line-chart-layout.test.ts).
1
+ // Where LineChart's points, target and mark go, React-free so the
2
+ // rules are unit tested on their own (tests/line-chart.test.tsx).
3
3
  // Positions are fractions of the plot, 0…1, x from the left and y from
4
4
  // the top, so the chart fills whatever width it's given.
5
5
  // A point's position along x: a number as it is, a day or a timestamp as
@@ -10,7 +10,7 @@ function along(x) {
10
10
  // Room above and below the values, as a share of their range, so the line
11
11
  // never runs along the plot's edge.
12
12
  const PAD = 0.1;
13
- // `levels` (4.64): the count of named steps a value is one of (a
13
+ // `levels`: the count of named steps a value is one of (a
14
14
  // confidence, Very low to High), each value its step's index. The range is
15
15
  // then every step, whatever the values, so a move from one step to the
16
16
  // next looks as big as it is, not the plot's whole height.
@@ -30,7 +30,6 @@ function plain(node) {
30
30
  return (node.children ?? []).map(plain).join('');
31
31
  }
32
32
  const hasWords = (nodes) => nodes.some((node) => plain(node).trim() !== '');
33
- // Parts joined with a separator, leaving out the empty ones.
34
33
  function join(parts, separator) {
35
34
  const out = [];
36
35
  for (const part of parts.filter(hasWords)) {
@@ -186,7 +185,6 @@ function blocks(nodes) {
186
185
  flush();
187
186
  return trim(out);
188
187
  }
189
- // No space at either end of the line.
190
188
  function trim(nodes) {
191
189
  const out = [...nodes];
192
190
  if (out[0]?.type === 'text')
@@ -21,7 +21,7 @@
21
21
  // padded, marks it nested differently) and that `meaning` still misses is
22
22
  // written as the editor shows it, as long as nothing in it is lost
23
23
  // (`content`): no text, address or image. A block the editor drops part
24
- // of (until 4.28, every image) is kept as written, and the guard refuses.
24
+ // of (an image, say) is kept as written, and the guard refuses.
25
25
  // - Guard: the result must mean exactly what the editor shows. If it
26
26
  // wouldn't (two blocks fusing, say), the merge throws instead of saving
27
27
  // something else; the draft stays on screen.
@@ -179,7 +179,7 @@ function uses(node, references = new Set(), urls = new Set()) {
179
179
  }
180
180
  // The blocks of the texts merged lately, by text: an editor merges the
181
181
  // same original and baseline against each edit, so each is parsed once
182
- // per mount, not once per merge (F6). A few, most recent last.
182
+ // per mount, not once per merge. A few, most recent last.
183
183
  const PARSED = 8;
184
184
  const parsed = new Map();
185
185
  function blocks(markdown) {
@@ -1,5 +1,5 @@
1
1
  // A table's column widths, kept in the Markdown as one comment after the
2
- // table, naming its columns (the developer's choice, 2026-11-09):
2
+ // table, naming its columns:
3
3
  //
4
4
  // | Item | Room | Cost |
5
5
  // | ---- | ---- | ---: |
@@ -1,6 +1,5 @@
1
1
  // What a GFM table holds beyond its cells, read from the Markdown it
2
- // already has, so nothing new is written into the text (the developer's
3
- // choice A, 2026-11-04):
2
+ // already has, so nothing new is written into the text :
4
3
  //
5
4
  // - A column's alignment: GFM's own (`:---:`, `---:`).
6
5
  // - A cell's colour: its whole text in one highlight, `=={green}$4.99==`
@@ -1,6 +1,6 @@
1
1
  // Toggle headings (Notion's): the only headings that fold. A plain
2
2
  // heading never folds and never shows a fold button; a toggle heading
3
- // folds its section, as every heading did before 4.66.0.
3
+ // folds its section.
4
4
  //
5
5
  // In Markdown a toggle heading is a heading whose line ends in Notion's
6
6
  // own attribute, so a chat that writes Notion's Markdown writes it, and a
@@ -1,6 +1,6 @@
1
1
  // The page is going away (closing the tab, hidden on a phone): requests
2
2
  // started now ask the browser to finish them after the page is gone
3
- // (`keepalive`), so the last autosave still arrives (F13). LeaveGuard
3
+ // (`keepalive`), so the last autosave still arrives. LeaveGuard
4
4
  // marks it; the transport reads it. Only a body that fits the browser's
5
5
  // keepalive budget (64 KB across the page's keepalive requests) goes
6
6
  // that way: a longer note's save goes as an ordinary request, which the
@@ -4,7 +4,7 @@ export type RecurrenceFormatOptions = {
4
4
  /** Leave the times out ("Every 2nd Tue"), for a cell beside a separate time. */
5
5
  times?: boolean;
6
6
  /**
7
- * The app's week start (4.114; Monday when left out). An every-N-weeks
7
+ * The app's week start (Monday when left out). An every-N-weeks
8
8
  * rule whose WKST differs says so: "Every other week on Sun and Wed,
9
9
  * weeks start Sun".
10
10
  */
@@ -23,7 +23,7 @@ export type OccurrenceFormatOptions = {
23
23
  locale?: string;
24
24
  /** What "now" is, for leaving out this year. Defaults to the clock. */
25
25
  now?: Date;
26
- /** Leave the time out ("Tue, Dec 8"), for a record whose times are its own (4.114). */
26
+ /** Leave the time out ("Tue, Dec 8"), for a record whose times are its own. */
27
27
  time?: boolean;
28
28
  };
29
29
  /**
@@ -1,4 +1,4 @@
1
- // A repeat in words (#326): its label for a list's Repeats cell and the
1
+ // A repeat in words: its label for a list's Repeats cell and the
2
2
  // field's preview ("Every 2nd Tue at 9:00 AM"), and an occurrence's
3
3
  // date and time for a Next cell ("Tue, Dec 8, 9:00 AM"), both read in the
4
4
  // rule's own zone. Day and month names and times come from Intl, in the
@@ -9,7 +9,7 @@ export type PhraseOptions = {
9
9
  /** The start when the phrase has no "starting". Defaults to `today`. */
10
10
  start?: string;
11
11
  /**
12
- * The day weeks start on (4.114): a weekly rule read with no "weeks
12
+ * The day weeks start on: a weekly rule read with no "weeks
13
13
  * start" gets it as its WKST (`'SU'` adds `WKST=SU`). Defaults to
14
14
  * Monday, which is no WKST.
15
15
  */
@@ -1,4 +1,4 @@
1
- // How a repeat is typed (#326): a task app's phrases ("every 2nd tue at
1
+ // How a repeat is typed: a task app's phrases ("every 2nd tue at
2
2
  // 9am", "every! 3 days", "every jan 1 until mar 1") read into a Recurrence
3
3
  // as you type, with a clear refusal for what can't be read, and the way
4
4
  // back, a Recurrence written as a phrase the reader takes again.
@@ -14,7 +14,7 @@
14
14
  //
15
15
  // then, in any order: `at 9am, 5:30pm` (`noon`, `17:00`), `starting dec 1`
16
16
  // (`from`), `until mar 1` (`ending`), `for 10 times`, `weeks start sun`
17
- // (WKST, 4.114). A day with no year is the next one: from today for
17
+ // (WKST). A day with no year is the next one: from today for
18
18
  // `starting`, from the start for `until`.
19
19
  import { formatRule, normalizeRecurrence, parseRule, RecurrenceError, WEEKDAY_CODES, weekStartMatters, } from './recurrence.js';
20
20
  const WEEKDAY_WORDS = [
@@ -23,7 +23,7 @@ export type RuleParts = {
23
23
  /**
24
24
  * WKST: the day weeks start on (Monday 0 to Sunday 6), or null for
25
25
  * Monday, RFC 5545's default. `WKST=MO` reads as null, so it isn't stored.
26
- * Optional (4.114), so parts an app builds without it still are parts.
26
+ * Optional, so parts an app builds without it still are parts.
27
27
  */
28
28
  weekStart?: number | null;
29
29
  };
@@ -1,4 +1,4 @@
1
- // Repeating schedules (#326): one rule, stored RRULE-shaped (RFC 5545), and
1
+ // Repeating schedules: one rule, stored RRULE-shaped (RFC 5545), and
2
2
  // when it falls next. The backend's `foundation_backend.recurrence` is the
3
3
  // same rules in Python; both read tests/fixtures/recurrence-cases.json, so
4
4
  // a screen and the server agree on every next occurrence.
@@ -17,7 +17,7 @@
17
17
  // days, Feb 29 only in leap years, and -1 is every month's last day. COUNT
18
18
  // counts occurrences, each time of each day.
19
19
  //
20
- // WKST (4.114) says which day a week starts on, for the weeks an
20
+ // WKST says which day a week starts on, for the weeks an
21
21
  // every-N-weeks rule counts: `FREQ=WEEKLY;INTERVAL=2;BYDAY=SU,WE;WKST=SU`
22
22
  // from Wednesday 2026-11-04 next falls on Sunday the 15th (with weeks from
23
23
  // Monday, the default, on the 8th). It changes nothing else here; a rule
@@ -1,7 +1,7 @@
1
1
  // After a deploy, a tab opened on the build before it still runs that
2
2
  // build, and its content-hashed chunks are gone from the server: the next
3
3
  // lazy import (the rich-text editor's, say) fails with "Failed to fetch
4
- // dynamically imported module" (#206). Vite's preload helper announces it
4
+ // dynamically imported module". Vite's preload helper announces it
5
5
  // first as a cancelable `vite:preloadError` on `window`, for the package's
6
6
  // own lazy chunks too once the app's build bundles them. On it, the page
7
7
  // reloads once onto the new build, and the failure is not reported.
@@ -8,7 +8,7 @@ export declare const STATUS_KIND_ICONS: Record<StatusKind, IconComponent>;
8
8
  export declare const STATUS_KIND_LABELS: Record<StatusKind, string>;
9
9
  /**
10
10
  * Each kind's colour, for the icon and the word: *-text tokens only. Done
11
- * is a teal and ended a soft rose (4.110, --status-done-text and
11
+ * is a teal and ended a soft rose (--status-done-text and
12
12
  * --status-ended-text), so a finished or stopped record no longer reads as
13
13
  * a grey, disabled one.
14
14
  */
@@ -1,4 +1,4 @@
1
- // The six status kinds (4.98, record standard 5B) and how each is drawn:
1
+ // The six status kinds (record standard 5B) and how each is drawn:
2
2
  // StatusMark (components/app/status-mark.tsx) reads these. The icons are
3
3
  // one map, STATUS_KIND_ICONS: changing one here changes it everywhere.
4
4
  import { CircleCheckIcon, CircleDashedIcon, CircleDotIcon, CirclePauseIcon, CircleSlash2Icon, TriangleAlertIcon, } from 'lucide-react';
@@ -24,7 +24,7 @@ export const STATUS_KIND_LABELS = {
24
24
  };
25
25
  /**
26
26
  * Each kind's colour, for the icon and the word: *-text tokens only. Done
27
- * is a teal and ended a soft rose (4.110, --status-done-text and
27
+ * is a teal and ended a soft rose (--status-done-text and
28
28
  * --status-ended-text), so a finished or stopped record no longer reads as
29
29
  * a grey, disabled one.
30
30
  */
@@ -16,8 +16,8 @@
16
16
  // only a runtime handler answers is made first; until it comes back
17
17
  // mocked, the page joins the list again.
18
18
  //
19
- // After boot the same restart can happen mid-session (#367: requests from a
20
- // booted page went to the network, five at once from one page). Nothing in
19
+ // After boot the same restart can happen mid-session (requests from a
20
+ // booted page go to the network). Nothing in
21
21
  // the page hears it: a restarted worker is the same `controller`, so no
22
22
  // `controllerchange` fires. What the page can see is a request the worker
23
23
  // never handed it: MSW's client emits `request:start` for every request the
@@ -6,7 +6,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
6
6
  // destination — so this uses the same mandated FieldGroup/Field primitives
7
7
  // directly (AGENTS.md "Correct Patterns").
8
8
  //
9
- // Two steps when the account has TOTP (4.0): the password, then a code
9
+ // Two steps when the account has TOTP: the password, then a code
10
10
  // from an authenticator app or a recovery code. No session exists between
11
11
  // them; the server keeps a pending sign-in for a few minutes, and when it
12
12
  // has gone (expired, out of tries) the screen goes back to the password
@@ -7,9 +7,12 @@ export { expect };
7
7
  /**
8
8
  * Makes the page's `goto()` and `reload()` wait first until none of the
9
9
  * page's own `/api/` requests has been in flight for 150 ms (at most 3 s,
10
- * and reaching that never fails the test), so a save's follow-up refresh
11
- * is answered by the page that sent it, on the mocks, not sent by the
12
- * unloading page past them. They then return once the app has
10
+ * and reaching that never fails the test). Why: a save's answer comes from
11
+ * the mocks, but its follow-up refresh is sent by the page as it unloads,
12
+ * after MSW's client has told the worker the page is gone, so the worker
13
+ * passes it to the network and the bypass check fails the test (about 1 run
14
+ * in 20 in one app). Waiting lets the page that sent the refresh get its
15
+ * answer on the mocks. They then return once the app has
13
16
  * booted (its first render into `#root`), not at the load event, and load
14
17
  * the page once more when one of the app's own files is refused before
15
18
  * then; a second refusal fails naming the file. The wait is bounded by
@@ -39,7 +42,7 @@ export type MswBypassWatch = {
39
42
  * the mock service worker (`response.fromServiceWorker()` false), which
40
43
  * means the request went to the network: to the preview server's proxy,
41
44
  * and from there to whatever listens on its port. A test that passed on
42
- * data from there didn't test the mocks (#367).
45
+ * data from there didn't test the mocks.
43
46
  *
44
47
  * A bypass the app healed doesn't count: since the rejoin in
45
48
  * `startMockWorker`, a page whose worker forgot it makes the request again
@@ -57,15 +57,9 @@ async function boot(page, load, again) {
57
57
  }
58
58
  }
59
59
  }
60
- // A test that leaves a page right after a save: the save's answer comes
61
- // from the mocks, but its follow-up refresh is sent by the page as it
62
- // unloads, after MSW's client has said goodbye to the worker, so the
63
- // worker passes it to the network and the bypass check fails the test
64
- // (about 1 run in 20 in one app). So before the page navigates, wait
65
- // until none of its own /api/ requests has been in flight for SETTLE_QUIET_MS,
66
- // at most SETTLE_CAP_MS: the refresh then lands on the page that sent it.
67
- // The cap only bounds the wait (a request that never ends, a stream);
68
- // reaching it never fails the test.
60
+ // The settle wait before a navigation (why: `withBootWait`'s JSDoc). Quiet for
61
+ // SETTLE_QUIET_MS, at most SETTLE_CAP_MS; the cap only bounds the wait (a
62
+ // request that never ends, a stream) and never fails the test.
69
63
  const SETTLE_QUIET_MS = 150;
70
64
  const SETTLE_CAP_MS = 3000;
71
65
  const SETTLE_POLL_MS = 25;
@@ -114,9 +108,12 @@ function trackApi(page) {
114
108
  /**
115
109
  * Makes the page's `goto()` and `reload()` wait first until none of the
116
110
  * page's own `/api/` requests has been in flight for 150 ms (at most 3 s,
117
- * and reaching that never fails the test), so a save's follow-up refresh
118
- * is answered by the page that sent it, on the mocks, not sent by the
119
- * unloading page past them. They then return once the app has
111
+ * and reaching that never fails the test). Why: a save's answer comes from
112
+ * the mocks, but its follow-up refresh is sent by the page as it unloads,
113
+ * after MSW's client has told the worker the page is gone, so the worker
114
+ * passes it to the network and the bypass check fails the test (about 1 run
115
+ * in 20 in one app). Waiting lets the page that sent the refresh get its
116
+ * answer on the mocks. They then return once the app has
120
117
  * booted (its first render into `#root`), not at the load event, and load
121
118
  * the page once more when one of the app's own files is refused before
122
119
  * then; a second refusal fails naming the file. The wait is bounded by
@@ -143,7 +140,7 @@ export function withBootWait(page) {
143
140
  * the mock service worker (`response.fromServiceWorker()` false), which
144
141
  * means the request went to the network: to the preview server's proxy,
145
142
  * and from there to whatever listens on its port. A test that passed on
146
- * data from there didn't test the mocks (#367).
143
+ * data from there didn't test the mocks.
147
144
  *
148
145
  * A bypass the app healed doesn't count: since the rejoin in
149
146
  * `startMockWorker`, a page whose worker forgot it makes the request again
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tristan2828/ui-foundation",
3
- "version": "4.136.0",
3
+ "version": "4.137.0",
4
4
  "description": "Shared UI foundation for contract-first, database-backed React apps: shadcn primitives, DataTable/EntityForm composites, auth, the gateway error seam, design tokens, lint rules and the AI playbook.",
5
5
  "license": "MIT",
6
6
  "repository": {
package/styles/index.css CHANGED
@@ -636,7 +636,7 @@
636
636
  margin-inline: 0;
637
637
  }
638
638
 
639
- /* Forms (4.85, the form standard; field.tsx and entity-form.tsx).
639
+ /* Forms (the form standard; field.tsx and entity-form.tsx).
640
640
  Compact: controls inside a FieldGroup and on a form's bar read
641
641
  --control-height (Input, SelectTrigger, InputGroup, the combobox's chips
642
642
  box and a default Button), 32px, or 40px under 48rem or on a touch
@@ -680,7 +680,7 @@
680
680
  [data-slot="field-group"] > [data-field-row][data-phone-pair] {
681
681
  width: calc((100% - var(--spacing) * 3) / 2 - 0.05px);
682
682
  }
683
- /* Two choices (4.98, 9C): each starts as wide as its buttons on one
683
+ /* Two choices (9C): each starts as wide as its buttons on one
684
684
  line (up to the row), so two that fit share the row, growing into
685
685
  what's left, and when they don't the second wraps under the first
686
686
  and each grows to the row. */
@@ -705,7 +705,7 @@
705
705
  }
706
706
  }
707
707
 
708
- /* Toasts on a phone sit at the bottom (4.90, ui/sonner.tsx), above
708
+ /* Toasts on a phone sit at the bottom (ui/sonner.tsx), above
709
709
  whatever is pinned there: EntityForm's stuck bar sets
710
710
  --toast-bottom-offset itself; failing that, the shell's bottom bar is
711
711
  the room to clear, or the phone's safe area. */
package/styles/theme.css CHANGED
@@ -7,9 +7,7 @@
7
7
  * text-muted-foreground, ...). Remapped per theme/mode; primitives are not.
8
8
  *
9
9
  * The values below are shadcn's generated defaults (Nova preset),
10
- * reorganized into the two-layer shape. Phase 1 only needs the structure to
11
- * exist; Phase 5 is where the primitive palette itself is deliberately
12
- * chosen and this file's diff should be small.
10
+ * reorganized into the two-layer shape.
13
11
  */
14
12
 
15
13
  :root {
@@ -42,7 +40,7 @@
42
40
  * Reusing a fill shade as text is the classic failure: it was chosen to
43
41
  * contrast with white, not with the page behind it. Every ratio below is
44
42
  * measured (WCAG 2.x, sRGB), and axe re-checks them against the rendered
45
- * DOM in both themes — see e2e/storybook-visual.spec.ts.
43
+ * DOM in both themes — see e2e/fixtures-visual.spec.ts.
46
44
  */
47
45
  --red-500: oklch(0.577 0.245 27.325); /* white on it: 4.76 */
48
46
  --red-700: oklch(0.5 0.21 27.325); /* on white: 6.57 */
@@ -56,7 +54,7 @@
56
54
  --blue-700: oklch(0.52 0.17 255); /* white on it: 5.59 */
57
55
  --blue-800: oklch(0.45 0.15 255); /* on white: 7.54 */
58
56
  --blue-400: oklch(0.75 0.12 255); /* on near-black: 8.90 */
59
- /* The two status kinds that have stopped (4.110, StatusMark's done and
57
+ /* The two status kinds that have stopped (StatusMark's done and
60
58
  ended): text shades only, nothing fills with them. A teal for done,
61
59
  a hue away from success's green, and a soft rose for ended, a hue
62
60
  away from destructive's red. On white / gray-100 / gray-200, and on
@@ -75,7 +73,7 @@
75
73
  * to a slot in its own columns file, so a new enum value costs a line
76
74
  * there rather than three tokens here.
77
75
  *
78
- * Chosen to be told apart (#108), not spaced by hue: twelve colours a
76
+ * Chosen to be told apart, not spaced by hue: twelve colours a
79
77
  * person names differently, from the whole hue circle, with lightness and
80
78
  * chroma varied per slot as well as hue. Red, orange, brown and green are
81
79
  * in: a category is a tinted glyph beside its name, never a status badge,
@@ -91,8 +89,7 @@
91
89
  *
92
90
  * Ratios are against the page, measured (WCAG 2.x, sRGB): all clear the
93
91
  * 3:1 non-text minimum in both themes (3.75:1 at the least, orange and
94
- * teal on white). axe does NOT check icon contrast; the Storybook glyph
95
- * check re-measures every slot on the page and on a card
92
+ * teal on white). axe does NOT check icon contrast; the glyph check in e2e/fixtures-visual.spec.ts re-measures every slot on the page and on a card
96
93
  * (patterns/CategoricalColour).
97
94
  */
98
95
  --category-1-700: oklch(0.44 0.11 245); /* blue */
@@ -160,10 +157,7 @@
160
157
  * One hue per slot, the slot's own (its --category-N hue), across all five
161
158
  * steps in both themes; only lightness and chroma change. Depth is
162
159
  * contrast with the page, so a higher step is darker in light and
163
- * brighter in dark, and the order survives in greyscale. (Until 4.91 hue
164
- * was bent a little to push neighbours apart, which read as drift, orange
165
- * to pink and purple to magenta, and dark ran the wrong way, a higher
166
- * step darker, ending in a step almost grey.) Chroma follows what the
160
+ * brighter in dark, and the order survives in greyscale. Chroma follows what the
167
161
  * gamut allows at each lightness, so each ramp reads as one tint, and no
168
162
  * step falls under oklch chroma 0.03. Every dark palette takes dark's;
169
163
  * Palm LCD, the light one, has its own on the same rule (its primitives).
@@ -395,7 +389,7 @@
395
389
  --palette-success: #66d69a;
396
390
  --palette-warning: #e0b152;
397
391
  --palette-danger: #df7a72;
398
- /* Done (a teal) and ended (a soft rose), the stopped status kinds (4.110).
392
+ /* Done (a teal) and ended (a soft rose), the stopped status kinds.
399
393
  On bg / card / raised, the lowest palette: done 8.86 / 7.86 / 6.80,
400
394
  ended 7.37 / 6.54 / 5.66. */
401
395
  --palette-done: #56c6cf;
@@ -658,14 +652,14 @@
658
652
  --success-text: var(--green-800);
659
653
  --warning-text: var(--amber-800);
660
654
  --info-text: var(--blue-800);
661
- /* The status kinds that have stopped (4.110): done and ended, for
655
+ /* The status kinds that have stopped: done and ended, for
662
656
  StatusMark's icon and word (lib/status-kinds.ts). */
663
657
  --status-done-text: var(--teal-800);
664
658
  --status-ended-text: var(--rose-700);
665
659
  /* A link in written text: coloured as well as underlined, so it reads
666
660
  as a link at a glance (on white: 5.59). */
667
661
  --link: var(--blue-700);
668
- /* The theme colour as text (4.105): what's picked or open, such as the
662
+ /* The theme colour as text: what's picked or open, such as the
669
663
  open tab's name and a picked choice, in the primary's own colour where
670
664
  it reads as text. Here it's the primary (near-black, 17.7 on white). */
671
665
  --primary-text: var(--primary);
@@ -682,8 +676,8 @@
682
676
  /* The band behind a `#` heading in written text: one step stronger than
683
677
  --muted, which `##`'s band takes. Its foot is a 2px --rule. */
684
678
  --heading-band: var(--gray-200);
685
- /* Written text's headings drew a bar in this until 4.24.0; nothing in
686
- the package uses it now. Kept for an app that does (on white: 5.59). */
679
+ /* A heading bar colour; nothing in the package uses it. Kept for an app
680
+ that does (on white: 5.59). */
687
681
  --heading-bar: var(--blue-700);
688
682
  /* Categorical slots — a glyph tint, never a fill behind text. */
689
683
  --category-1: var(--category-1-700);
@@ -835,14 +829,14 @@
835
829
  matches the row without letting scrolled columns show through. Mixed
836
830
  in sRGB, as the browser composites the translucent stripe. */
837
831
  --table-stripe: color-mix(in srgb, var(--muted) 40%, var(--background));
838
- /* A highlighted row (DataTable's highlightRow, #156): info's wash
832
+ /* A highlighted row (DataTable's highlightRow): info's wash
839
833
  pre-mixed onto the page, opaque so pinned cells can wear it. Muted
840
834
  text measures 4.09:1 on it (below 4.5 at 12px; no lighter tint gets
841
835
  there: 4.47 at 4%), so inside the row muted text takes a darker grey:
842
836
  6.75:1. In dark the usual muted already clears it (6.61:1). */
843
837
  --table-highlight: color-mix(in srgb, var(--info) 10%, var(--background));
844
838
  --table-highlight-muted-foreground: var(--gray-600);
845
- /* A body row under the pointer (DataTable, 4.83): the muted fill, solid
839
+ /* A body row under the pointer (DataTable): the muted fill, solid
846
840
  so pinned cells can wear it. Muted text measures 4.34:1 on it, so the
847
841
  row takes --table-highlight-muted-foreground's darker grey (7.0:1).
848
842
  In dark the usual muted clears it (5.9:1); a palette's dim, 5.8. */
@@ -879,7 +873,7 @@
879
873
  /*
880
874
  * Regular rows, a device's pick in the shell's look menu (lib/rows.ts,
881
875
  * FoundationProviders' rowsPicker): RowsProvider puts data-rows on <html>.
882
- * The size every table had before 4.63. A data-density on a nearer
876
+ * The compact row size. A data-density on a nearer
883
877
  * ancestor still wins, since it is declared closer to the cells.
884
878
  */
885
879
  [data-rows="regular"] {
package/vite/pwa.js CHANGED
@@ -1,6 +1,6 @@
1
1
  // `pwa()` from `@tristan2828/ui-foundation/vite`: the app installable (a web
2
2
  // manifest and icons) and the service worker reminders arrive through
3
- // (issue #167). An app's vite.config.ts:
3
+ //. An app's vite.config.ts:
4
4
  //
5
5
  // import buildInfo, { pwa } from '@tristan2828/ui-foundation/vite'
6
6
  // plugins: [react(), tailwindcss(), buildInfo(), pwa({ name: 'Morning Routines', shortName: 'Routines' })]