@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
package/README.md CHANGED
@@ -18,14 +18,15 @@ than installing this by hand:
18
18
 
19
19
  | Import | What |
20
20
  |---|---|
21
- | `@tristan2828/ui-foundation` | `AppShell`, `DataTable`, `EntityView` (with `EditableValue`, `editInPlace`, printing its notes and `usePrinting`, `KeyStats`, `IconAction`), `EntityForm`, `Markdown` (with `countTasks`, `toggleTaskAt`), `RichTextEditor`, `ErrorState`, `MultiChoice`, `MultiReference`, `ListEditor`, `PasswordInput`, `RouteErrorBoundary`, `FoundationProviders`, `DataEnvironmentBanner`, `LoginRoute`, `RegisterRoute`, `useAuth`, `useTableUrlState`, `useRecordUpdate`, `useDebouncedValue`, `createQueryClient`, `cn`; types `Page`, `AppError`, `QuerySpec`. For timed screens (`docs/foundation/timed-screens.md`): `SessionView`, `useSessionClock`, `useWakeLock`, `useMuted`, `usePrefersReducedMotion`, and the audio cues `unlockAudio`, `chime`, `sequence`, `cancelCues`, `onCuesRecovered`, `cuesInSync`, `keepAudioAlive`, `say`, `hush`, `vibrate`, `canVibrate`. For the page standards (`docs/foundation/design-language.md` "Parts of the page standards"): `ValueList`, `ListHeader`, `Timeline`, `NeedsYou`, `Freshness`, `PartEmpty`. For a module's overview ("An overview page" there): `OverviewPage`, and `WidgetCard`'s `to`, `value`, `line` and `freshness`. For a list's tools (`docs/foundation/cell-patterns.md` 25 and 26): `FilterBar`, `FilterSelect`, `RelatedTable`, and DataTable's `views`, `columnsMenu`, `rowActions`, `phoneRow`, `limit` and `viewAll`. For reminders (`docs/foundation/reminders.md`): `AllowReminders`, `usePushPermission`. For a record opened in a dialog over its list (`docs/foundation/add-an-entity.md`): `RecordDialogRoute`, `RecordLink`, `useOpenRecord`, `useRecordDialog`, `recordDialogState`, and for a new record over it `useNewRecordDialog`. A small form in a dialog: `FormDialog`. For the dialogs and feedback standard (`docs/foundation/add-an-entity.md` "Toasts and feedback"): `DeleteAction`, `notify`, `useAction`, `ActionError`, `JobStatus`, `OfflineNotice`, `useOffline`; from `/ui/skeleton`, `Skeleton` takes `delay`. For the trail and search in `AppShell`'s bar (`docs/foundation/design-language.md` "The sidebar and the phone's bar"): `usePageTrail`, `useRecentRecord`, `PageTrail`; types `AppShellSearch`, `SearchRecord`, `RecentRecord`. For the form standard (`docs/foundation/add-an-entity.md` "Forms"): `FormSection`, `OptionSelect`, `ChoiceButtons`, `ReferenceCombobox`, `countFormErrors`, `fieldRows`, `parsePlainDate`, and for a record's rows edited in place `editRowClass`, `onEditRowClick` and `inPlace.choice`; from `/ui/field`, `Field` takes `size`, `solo` and `kind`, and `FieldLabel` takes `required`. From `/ui/dialog`, `DialogContent` takes `size` and `dirty`, and `DiscardChangesDialog` is the "Discard your changes?" prompt |
22
- | `@tristan2828/ui-foundation/ui/<name>` | shadcn primitives: badge, button, calendar, card, checkbox, combobox, dialog, empty, field, input, input-group, label, popover, select, separator, sheet, sidebar, skeleton, sonner, spinner, switch, table, textarea, tooltip |
23
- | `@tristan2828/ui-foundation/gateway` | `safeFetch`, `toAppError`, `networkError` — for an app's `src/api/gateway/` only |
24
- | `@tristan2828/ui-foundation/mocks` | MSW: `authHandlers`, `environmentHandlers`, `resetMockAuth`, `getMockCurrentUser`, `MOCK_USER`, `startMockWorker` (mock mode's boot), `exposeMswForE2E` |
25
- | `@tristan2828/ui-foundation/testing` | Playwright: `test` and `expect` (a page whose `goto()`/`reload()` let its `/api/` requests settle, then wait for the app's boot; `withBootWait` for a page of your own), `defineA11ySuite`, `defineMockModeBannerSuite`, `defineDataEnvironmentBannerSuite`, `forceMswOverride` (`{ hold: true }` for a loading state, then `release()`), `releaseMswOverride`, `forceLoggedOut`, `waitForMswReady`, `expectDataViewsLoaded` |
21
+ | `@tristan2828/ui-foundation` | The composites and what goes with them: `AppShell`, `DataTable`, `EntityView` (with editing in place: `EditableValue`, `editInPlace`, `inPlace`), `EntityForm`, `FormDialog`, `RecordDialogRoute`, `Markdown`, `RichTextEditor`, `ErrorState`, `FoundationProviders`, `LoginRoute`, `RegisterRoute`; the hooks `useAuth`, `useTableUrlState`, `useRecordUpdate`; `createQueryClient`, `cn`; types `Page`, `AppError`, `QuerySpec`. The full list is the package's type declarations (`dist/index.d.ts`); what each part is for is in the app's `docs/foundation/` |
22
+ | `@tristan2828/ui-foundation/ui/<name>` | shadcn primitives: alert, badge, breadcrumb, button, calendar, card, checkbox, collapsible, combobox, dialog, dropdown-menu, empty, field, input, input-group, label, popover, progress, radio-group, select, separator, sheet, sidebar, skeleton, slider, sonner, spinner, switch, table, tabs, textarea, toggle, toggle-group, tooltip |
23
+ | `@tristan2828/ui-foundation/gateway` | `safeFetch`, `toAppError`, `networkError`, `proxyAuthError` — for an app's `src/api/gateway/` only |
24
+ | `@tristan2828/ui-foundation/mocks` | MSW: `authHandlers`, `environmentHandlers`, `clientErrorHandlers`, `pushHandlers`, `resetMockAuth`, `getMockCurrentUser`, `MOCK_USER`, `startMockWorker` (mock mode's boot), `exposeMswForE2E`, among others (`dist/mocks/index.d.ts`) |
25
+ | `@tristan2828/ui-foundation/testing` | Playwright: `test` and `expect` (a page whose `goto()`/`reload()` let its `/api/` requests settle, then wait for the app's boot; `withBootWait` for a page of your own), `watchMswBypass`, `expectNoAxeViolations`, `defineA11ySuite`, `defineMockModeBannerSuite`, `defineDataEnvironmentBannerSuite`, `forceMswOverride` (`{ hold: true }` for a loading state, then `release()`), `releaseMswOverride`, `forceLoggedOut`, `waitForMswReady`, `expectDataViewsLoaded` |
26
26
  | `@tristan2828/ui-foundation/eslint` | the lint rules, as a flat config: `export default [...uiFoundation()]` |
27
+ | `@tristan2828/ui-foundation/vite` | `buildInfo()` (the default export) and `pwa()`, for an app's `vite.config.ts` |
27
28
  | `@tristan2828/ui-foundation/styles.css` | tokens and base styles, after `@import "tailwindcss";` |
28
- | `@tristan2828/ui-foundation/openapi.yaml` | the part of an app's API contract the package calls: `/auth/*`, `/environment` (optional) and the error bodies |
29
+ | `@tristan2828/ui-foundation/openapi.yaml` | the part of an app's API contract the package calls: `/auth/*`, `/environment`, `/client-errors`, `/push/*` (all optional but sign-in, sign-out and `/auth/me`) and the error bodies |
29
30
 
30
31
  ## The `ui-foundation` command
31
32
 
@@ -161,7 +161,7 @@ function normalise(value) {
161
161
  const same = (a, b) => JSON.stringify(normalise(a)) === JSON.stringify(normalise(b))
162
162
 
163
163
  // A pattern the foundation widened keeps the ones before it
164
- // (`x-earlier-patterns`, Recurrence's rule since 4.119), and an app's copy
164
+ // (`x-earlier-patterns`, Recurrence's rule), and an app's copy
165
165
  // with an earlier one still matches: it allows less, so the package reads
166
166
  // everything it can hold, and the app copies the new one when it wants
167
167
  // what that allows. The nth earlier version takes every such node's nth.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: spec-tester
3
- description: Writes gateway translation tests from openapi.yaml and contracts.ts only. Used in Phase 2 and by the new-entity playbook — never invoked to test code it can read.
3
+ description: Writes gateway translation tests from openapi.yaml and the UI contracts Page<T>, AppError and QuerySpec only. Used by the new-entity playbook — never invoked to test code it can read.
4
4
  tools: Read, Write, Bash(vitest *)
5
5
  model: sonnet
6
6
  hooks:
@@ -28,8 +28,8 @@ Assert, from the spec alone:
28
28
  - Other error shapes (404, 401, 500) map to `notfound`, `auth`, `server`
29
29
  respectively.
30
30
 
31
- Write the tests to fail first — the gateway that makes them pass does not
32
- exist yet the first time you run in Phase 2. That is correct.
31
+ Write the tests to fail first — the gateway that makes them pass may not
32
+ exist yet the first time you run. That is correct.
33
33
 
34
34
  Do not attempt to work around a denied read. If you are refused a file you
35
35
  believe you need, stop and report which file and why in your final