@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.
Files changed (165) hide show
  1. package/README.md +7 -6
  2. package/bin/ui-foundation.mjs +1 -1
  3. package/conventions/agents/skills/new-entity/SKILL.md +5 -2
  4. package/conventions/agents/spec-tester.md +3 -3
  5. package/conventions/docs/add-an-entity.md +722 -714
  6. package/conventions/docs/cell-patterns.md +206 -378
  7. package/conventions/docs/column-options.md +6 -12
  8. package/conventions/docs/design-language.md +294 -516
  9. package/conventions/docs/entity-plan-template.md +9 -7
  10. package/conventions/docs/reminders.md +12 -17
  11. package/conventions/docs/timed-screens.md +17 -20
  12. package/dist/components/app/action-error.js +1 -1
  13. package/dist/components/app/action-hint.js +1 -1
  14. package/dist/components/app/app-shell-bottom-bar.js +4 -4
  15. package/dist/components/app/app-shell-nav.d.ts +1 -1
  16. package/dist/components/app/app-shell-nav.js +1 -1
  17. package/dist/components/app/app-shell.d.ts +1 -1
  18. package/dist/components/app/app-shell.js +9 -9
  19. package/dist/components/app/board.d.ts +13 -13
  20. package/dist/components/app/board.js +3 -3
  21. package/dist/components/app/choice-buttons.d.ts +1 -1
  22. package/dist/components/app/data-table-tools.d.ts +3 -3
  23. package/dist/components/app/data-table.d.ts +11 -13
  24. package/dist/components/app/data-table.js +5 -5
  25. package/dist/components/app/date-field.js +1 -1
  26. package/dist/components/app/delete-action.d.ts +1 -1
  27. package/dist/components/app/delete-action.js +4 -4
  28. package/dist/components/app/edit-caret.js +1 -1
  29. package/dist/components/app/edit-in-place-presets.d.ts +4 -4
  30. package/dist/components/app/edit-in-place-store.d.ts +3 -3
  31. package/dist/components/app/edit-in-place-store.js +7 -7
  32. package/dist/components/app/editable-list.js +2 -3
  33. package/dist/components/app/editable-value.d.ts +2 -2
  34. package/dist/components/app/editable-value.js +20 -20
  35. package/dist/components/app/entity-form.js +2 -2
  36. package/dist/components/app/entity-view-facts.d.ts +12 -12
  37. package/dist/components/app/entity-view-facts.js +1 -1
  38. package/dist/components/app/entity-view.d.ts +16 -16
  39. package/dist/components/app/entity-view.js +28 -33
  40. package/dist/components/app/equal-items.js +4 -4
  41. package/dist/components/app/fact-extras.js +5 -5
  42. package/dist/components/app/field-rows.js +5 -5
  43. package/dist/components/app/fill-in-queue.js +2 -3
  44. package/dist/components/app/filter-bar.d.ts +1 -1
  45. package/dist/components/app/filter-date.js +1 -1
  46. package/dist/components/app/filter-name.js +1 -1
  47. package/dist/components/app/form-dialog.js +2 -2
  48. package/dist/components/app/form-leave-guard.js +2 -2
  49. package/dist/components/app/form-section.js +1 -1
  50. package/dist/components/app/icon-action.d.ts +1 -1
  51. package/dist/components/app/icon-action.js +2 -2
  52. package/dist/components/app/image-field.js +0 -1
  53. package/dist/components/app/keep-pencil-room.js +1 -1
  54. package/dist/components/app/key-stats.d.ts +3 -3
  55. package/dist/components/app/line-chart.d.ts +1 -1
  56. package/dist/components/app/line-chart.js +4 -4
  57. package/dist/components/app/list-editor-rows.js +1 -1
  58. package/dist/components/app/list-editor.js +1 -1
  59. package/dist/components/app/list-header.d.ts +6 -6
  60. package/dist/components/app/list-header.js +8 -8
  61. package/dist/components/app/markdown.js +30 -37
  62. package/dist/components/app/milkdown-editor.js +37 -62
  63. package/dist/components/app/module-card.js +6 -7
  64. package/dist/components/app/month-calendar.d.ts +46 -0
  65. package/dist/components/app/month-calendar.js +160 -0
  66. package/dist/components/app/month-day-field.js +0 -1
  67. package/dist/components/app/multi-choice.d.ts +1 -1
  68. package/dist/components/app/multi-choice.js +3 -3
  69. package/dist/components/app/multi-line-chart.js +5 -5
  70. package/dist/components/app/multi-pick.js +9 -10
  71. package/dist/components/app/multi-reference.js +2 -2
  72. package/dist/components/app/notes-outline.js +0 -1
  73. package/dist/components/app/notify.js +2 -2
  74. package/dist/components/app/offline-notice.js +1 -1
  75. package/dist/components/app/option-icon.js +1 -1
  76. package/dist/components/app/option-select.d.ts +1 -1
  77. package/dist/components/app/overview-page.d.ts +2 -2
  78. package/dist/components/app/overview-page.js +1 -1
  79. package/dist/components/app/page-trail-context.js +1 -1
  80. package/dist/components/app/pill-filter.d.ts +2 -2
  81. package/dist/components/app/prose-look.js +1 -1
  82. package/dist/components/app/quick-add-input.js +1 -1
  83. package/dist/components/app/rating-input.js +1 -1
  84. package/dist/components/app/rating-score.js +1 -1
  85. package/dist/components/app/record-dialog.js +25 -40
  86. package/dist/components/app/recurrence-field.js +6 -6
  87. package/dist/components/app/reference-combobox.js +1 -2
  88. package/dist/components/app/rich-text-box-anchor.js +0 -1
  89. package/dist/components/app/rich-text-edges.js +2 -2
  90. package/dist/components/app/rich-text-editor.d.ts +2 -3
  91. package/dist/components/app/rich-text-editor.js +19 -32
  92. package/dist/components/app/rich-text-empty-paragraph.d.ts +6 -7
  93. package/dist/components/app/rich-text-empty-paragraph.js +6 -7
  94. package/dist/components/app/rich-text-floating-toolbar.js +0 -1
  95. package/dist/components/app/rich-text-formats.js +2 -2
  96. package/dist/components/app/rich-text-input-rules.js +1 -2
  97. package/dist/components/app/rich-text-keyboard-bar.js +6 -7
  98. package/dist/components/app/rich-text-node-views.js +1 -2
  99. package/dist/components/app/rich-text-shortcuts.js +8 -8
  100. package/dist/components/app/rich-text-slash-menu.js +4 -6
  101. package/dist/components/app/rich-text-slash.d.ts +2 -2
  102. package/dist/components/app/rich-text-slash.js +2 -2
  103. package/dist/components/app/rich-text-table-grips.d.ts +1 -1
  104. package/dist/components/app/rich-text-table-grips.js +1 -2
  105. package/dist/components/app/rich-text-tasks.d.ts +1 -1
  106. package/dist/components/app/rich-text-tasks.js +1 -1
  107. package/dist/components/app/rich-text-touch.js +1 -1
  108. package/dist/components/app/search-palette.js +1 -2
  109. package/dist/components/app/secondary-filters.js +2 -3
  110. package/dist/components/app/session-view.js +1 -1
  111. package/dist/components/app/stacked-area-chart.js +1 -1
  112. package/dist/components/app/step-track.d.ts +1 -1
  113. package/dist/components/app/step-track.js +3 -3
  114. package/dist/components/app/widget-card.js +26 -30
  115. package/dist/components/app/widget-layout-sheet.js +1 -1
  116. package/dist/components/ui/calendar.js +2 -2
  117. package/dist/components/ui/combobox.d.ts +1 -1
  118. package/dist/components/ui/combobox.js +2 -2
  119. package/dist/components/ui/field.d.ts +1 -1
  120. package/dist/components/ui/field.js +6 -6
  121. package/dist/components/ui/skeleton.js +1 -1
  122. package/dist/components/ui/sonner.js +1 -1
  123. package/dist/components/ui/tabs.js +1 -1
  124. package/dist/error-reporting/reporter.d.ts +1 -1
  125. package/dist/error-reporting/reporter.js +1 -1
  126. package/dist/hooks/table-url-changes.d.ts +2 -2
  127. package/dist/hooks/table-url-changes.js +5 -6
  128. package/dist/hooks/use-action.js +1 -1
  129. package/dist/hooks/use-record-update.js +1 -1
  130. package/dist/hooks/use-table-url-state.d.ts +1 -1
  131. package/dist/hooks/use-table-url-state.js +2 -2
  132. package/dist/index.d.ts +1 -0
  133. package/dist/index.js +3 -2
  134. package/dist/lib/audio-cues.js +2 -2
  135. package/dist/lib/connection.js +1 -1
  136. package/dist/lib/date-filter.js +1 -1
  137. package/dist/lib/entity-view-tab.js +1 -1
  138. package/dist/lib/field-rows.js +2 -2
  139. package/dist/lib/form-errors.d.ts +1 -1
  140. package/dist/lib/form-errors.js +1 -1
  141. package/dist/lib/keep-audio-alive.js +1 -1
  142. package/dist/lib/line-chart-layout.js +4 -4
  143. package/dist/lib/markdown-inline.js +0 -2
  144. package/dist/lib/markdown-merge.js +2 -2
  145. package/dist/lib/markdown-table-widths.js +1 -1
  146. package/dist/lib/markdown-table.js +1 -2
  147. package/dist/lib/markdown-toggle.js +1 -1
  148. package/dist/lib/page-leaving.js +1 -1
  149. package/dist/lib/recurrence-format.d.ts +2 -2
  150. package/dist/lib/recurrence-format.js +1 -1
  151. package/dist/lib/recurrence-phrase.d.ts +1 -1
  152. package/dist/lib/recurrence-phrase.js +2 -2
  153. package/dist/lib/recurrence.d.ts +1 -1
  154. package/dist/lib/recurrence.js +2 -2
  155. package/dist/lib/stale-chunk-reload.js +1 -1
  156. package/dist/lib/status-kinds.d.ts +1 -1
  157. package/dist/lib/status-kinds.js +2 -2
  158. package/dist/mocks/start-worker.js +2 -2
  159. package/dist/routes/login.js +1 -1
  160. package/dist/testing/index.d.ts +7 -4
  161. package/dist/testing/index.js +10 -13
  162. package/package.json +2 -2
  163. package/styles/index.css +4 -4
  164. package/styles/theme.css +14 -20
  165. package/vite/pwa.js +1 -1
@@ -24,30 +24,26 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
24
24
  // sit: `#` and `##` on a tinted band, `###` a small uppercase label, and
25
25
  // the text under them lined up with the words in the band (prose-look.ts).
26
26
  //
27
- // A table's columns fit their words (a cell wraps at 18rem; a right-
28
- // aligned column, numbers, never wraps), in one of two looks
29
- // (`tableLook`, as on RichTextEditor: styles/index.css "Tables in written
30
- // text"). A cell whose whole text is one highlight is painted in it, and
31
- // a first column of bold cells is row headers (src/lib/markdown-table.ts).
32
- // A column the rich-text editor set a width for keeps it, from the comment
33
- // after the table (src/lib/markdown-table-widths.ts); on a phone columns
34
- // still fit their words, and on paper the widths scale to the page.
35
- // A table wider than the text scrolls sideways, and while it does, its
36
- // box is a tab stop, named for its columns, that the arrow keys scroll
37
- // (prose-table-scroll.ts). Its cells wrap first, so that's only a table
38
- // with many columns, or a long word in one.
27
+ // A table's columns fit their words (a cell wraps at 18rem; a right-aligned
28
+ // column never wraps), in one of two looks (`tableLook`, as on
29
+ // RichTextEditor: styles/index.css "Tables in written text"). A cell whose
30
+ // whole text is one highlight is painted in it, and a first column of bold
31
+ // cells is row headers (src/lib/markdown-table.ts). Column widths the
32
+ // rich-text editor set are read from the comment after the table
33
+ // (src/lib/markdown-table-widths.ts); a phone still fits columns to their
34
+ // words, and on paper the widths scale to the page. A table wider than the
35
+ // text scrolls sideways in a tab stop, named for its columns, that the
36
+ // arrow keys scroll (prose-table-scroll.ts).
39
37
  //
40
- // An image (`![alt](url)`, one the rich-text editor uploaded) stays inside
41
- // the text's width, loads only as it nears the screen, and keeps its alt
42
- // text; with none (`![](url)`) it's decorative to a screen reader. Its
43
- // address goes through the same urlTransform: a web address or a path on
44
- // the site (`/api/files/7/content`), never `javascript:` or `data:`.
38
+ // An image stays inside the text's width, loads as it nears the screen and
39
+ // keeps its alt text; with none (`![](url)`) it's decorative to a screen
40
+ // reader. Its address goes through the same urlTransform: a web address or
41
+ // a path on the site (`/api/files/7/content`), never `javascript:` or
42
+ // `data:`.
45
43
  //
46
- // A quote that starts `[!NOTE]` (GitHub's alert syntax) is a callout: a
47
- // tinted box with its kind's icon (src/lib/markdown-callout.ts).
48
- //
49
- // `==words==` is highlighted words (amber, or `=={green}words==`: yellow,
50
- // green, red): a <mark> on the colour's wash (src/lib/markdown-highlight.ts).
44
+ // A quote that starts `[!NOTE]` (GitHub's alert syntax) is a callout
45
+ // (src/lib/markdown-callout.ts); `==words==` is highlighted words, or
46
+ // `=={green}words==` (src/lib/markdown-highlight.ts).
51
47
  //
52
48
  // With `foldKey`, each toggle heading (`## Safety {toggle="true"}`,
53
49
  // src/lib/markdown-toggle.ts) at the text's top level has a button before
@@ -59,27 +55,24 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
59
55
  // Printed (EntityView's Print notes, PrintingContext), it's the whole
60
56
  // text: nothing folded, no fold buttons, task boxes as glyphs.
61
57
  //
62
- // With `pageLink`, a link the app says is one of its pages (a child page
63
- // of the record, or of a page, to any depth: src/lib/page-link.ts) is a
64
- // page link: the page icon and the page's title, opening the page in this
65
- // tab. Alone in its paragraph, it's a page line, a row of its own. A page
66
- // the app reports removed shows "Page removed", with Restore when the app
67
- // gives one. Every other link is as it was; the text is never changed.
58
+ // With `pageLink`, a link the app says is one of its pages (src/lib/page-link.ts)
59
+ // is a page link: the page icon and the page's title, opening the page in
60
+ // this tab, a row of its own when alone in a paragraph. A page the app
61
+ // reports removed shows "Page removed", with Restore when the app gives
62
+ // one. Every other link is untouched, and so is the text.
68
63
  //
69
64
  // With `inline`, it's a one-line value's Markdown (a table cell, a card's
70
65
  // line): bold, italic, code and links on one run of words, in the font and
71
66
  // colour of wherever it sits, with no block margins, so a row it's in
72
67
  // keeps its height. Blocks written in it become their words, joined so
73
- // they still read (a list's items with " · ", a table's rows as
74
- // `Header: value` pairs: src/lib/markdown-inline.ts). A link's click and
75
- // Enter stay its own: they never reach a row or card it sits in.
68
+ // they still read (src/lib/markdown-inline.ts). A link's click and Enter
69
+ // stay its own: they never reach a row or card it sits in.
76
70
  //
77
- // A task item (`- [ ] to do`, `- [x] done`) shows its box as a glyph
78
- // with its state in words: read-only text has nothing to tick. With
79
- // `onTasksChange`, each box is a real checkbox, named for its item's
80
- // words, that ticks or unticks the item in the text and hands the whole
81
- // new text over to save (src/lib/markdown-tasks.ts): only that item's
82
- // `[ ]` or `[x]` changes, the rest stays exactly as written.
71
+ // A task item (`- [ ] to do`) shows its box as a glyph with its state in
72
+ // words: read-only text has nothing to tick. With `onTasksChange`, each box
73
+ // is a real checkbox, named for its item's words, that ticks or unticks the
74
+ // item and hands the whole new text over to save (src/lib/markdown-tasks.ts):
75
+ // only that item's `[ ]` or `[x]` changes.
83
76
  import { createContext, useCallback, useContext, useEffect, useMemo, useRef, useState } from 'react';
84
77
  import ReactMarkdown, {} from 'react-markdown';
85
78
  import remarkGfm from 'remark-gfm';
@@ -6,7 +6,7 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
6
6
  // docs/ARCHITECTURE.md "Decisions".
7
7
  //
8
8
  // What this file (the wiring) and the rich-text-* files beside it add to
9
- // Milkdown's own presets:
9
+ // Milkdown's own presets; each feature's detail is in its own file:
10
10
  // - Saves go through mergeMarkdown: an untouched document, and every block
11
11
  // the person didn't change, saves back as originally written.
12
12
  // - No HTML in, ever. The preset's "preserve empty line" plugin is left
@@ -20,70 +20,48 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
20
20
  // outline, as it does <Markdown>'s; only the element moves, never the
21
21
  // level the Markdown is saved with (a node view draws it, from the
22
22
  // node's own level: rich-text-heading-view.ts). They look like
23
- // <Markdown>'s (prose-look.ts). A task-list item renders a real checkbox
24
- // that toggles it (rich-text-task-item-view.ts).
25
- // - Callouts (`> [!NOTE]`, src/lib/markdown-callout.ts): a node of their
26
- // own, drawn as <Markdown> draws them, the icon a menu of kinds.
27
- // - Tables whose columns fit their words, in a box that scrolls sideways
28
- // (a tab stop the arrow keys scroll while it does: rich-text-node-views.ts),
29
- // in one of two looks (`tableLook`: styles/index.css "Tables in written
30
- // text"). Notion's "add a row" and "add a column" bars, and its grips: one
31
- // on the column and one on the row the pointer or the caret is in, each
32
- // a menu to insert, move, delete, align, sort and colour
33
- // (rich-text-table-grips.tsx); right-click or Shift+F10 in a cell opens
34
- // the cell's. A column's right edge drags to a width (double-click:
35
- // back to fit its words), and the menus hold Narrower, Wider and Fit to
36
- // content; none of that on a phone, which fits columns to their words.
37
- // Tab in the last cell adds a row and Enter goes down a
38
- // column (rich-text-table.ts). Colours and a header column are kept as
39
- // Markdown writes them (src/lib/markdown-table.ts).
40
- // - Edited blocks are written in the document's own bullet and rule marks.
23
+ // <Markdown>'s (prose-look.ts).
24
+ // - Callouts (src/lib/markdown-callout.ts), highlighted words
25
+ // (src/lib/markdown-highlight.ts), toggle headings
26
+ // (rich-text-toggle-heading.ts), task items (rich-text-tasks.ts), page
27
+ // links (rich-text-page-links.ts) and tables (rich-text-table.ts,
28
+ // rich-text-table-grips.tsx, rich-text-node-views.ts) are nodes and
29
+ // plugins of their own, drawn as <Markdown> draws them. None of the
30
+ // table's menus or grips show on a phone, which fits columns to their
31
+ // words. Edited blocks are written in the document's own bullet and rule
32
+ // marks.
41
33
  // - Markdown pasted as plain text arrives formatted (still no HTML), and a
42
- // copy out of the editor is Markdown. A paste keeps its lines, Word's
43
- // and Notion's lists and to-dos, and code's language; an address pasted
44
- // or typed becomes a link; a paste can't bring in a link that runs code
45
- // or an image as `data:` (rich-text-paste.ts, rich-text-autolink.ts).
34
+ // copy out of the editor is Markdown. A paste can't bring in a link that
35
+ // runs code or an image as `data:` (rich-text-paste.ts,
36
+ // rich-text-autolink.ts).
46
37
  // - An edit the merge refuses is never saved quietly: the field is marked
47
38
  // invalid, and says why in itself when the app gives no `onProblem`
48
39
  // (with one, the app shows it: a form's field error, editing in
49
40
  // place's line).
50
41
  // - Full screen holds focus: the page behind it is inert until it ends
51
42
  // (rich-text-full-screen.ts).
52
- // - A click on a link opens it in a new tab, as the read view's links do,
53
- // so notes that are always the editor still follow their links
54
- // (followLink, rich-text-links.ts). Ctrl/Cmd+K adds or edits a link (a
55
- // box at the caret, rich-text-link-box.tsx: web
56
- // and email addresses only); Ctrl/Cmd+Shift+Enter ticks the task item the caret is
57
- // in. `[] ` at a line's start makes a task item, and Enter in one the
58
- // next, unticked (rich-text-tasks.ts). Ctrl/Cmd+Enter stays the field's
59
- // save, in a table too. Notion's block keys (Ctrl+Shift+1 for a
60
- // heading, +5 for bullets, …: rich-text-shortcuts.ts).
61
- // - A placeholder in an empty document, and a count of the Markdown's
62
- // length as it nears `maxLength`.
63
- // - A fixed toolbar above the text (rich-text-toolbar.tsx), and a
64
- // floating one over selected words (rich-text-floating-toolbar.tsx),
65
- // unless `toolbar={false}`; `toolbar="floating"` leaves out the fixed
66
- // one. Alt+F10 reaches the floating one when it shows, else the fixed one.
67
- // - A slash menu (rich-text-slash.ts, rich-text-slash-menu.tsx): "/" at a
68
- // line's start lists the blocks it can become, also unless
69
- // `toolbar={false}`.
43
+ // - A click on a link opens it in a new tab, as the read view's links do
44
+ // (followLink, rich-text-links.ts). Ctrl/Cmd+K adds or edits a link
45
+ // (rich-text-link-box.tsx: web and email addresses only).
46
+ // Ctrl/Cmd+Enter stays the field's save, in a table too. The editing
47
+ // keys are in rich-text-shortcuts.ts.
48
+ // - A fixed toolbar above the text (rich-text-toolbar.tsx) and a floating
49
+ // one over selected words (rich-text-floating-toolbar.tsx), unless
50
+ // `toolbar={false}`; `toolbar="floating"` leaves out the fixed one.
51
+ // Alt+F10 reaches the floating one when it shows, else the fixed one.
52
+ // The slash menu (rich-text-slash.ts) goes with them.
70
53
  // - `inline`: the field drawn as the text it edits (no border, no box),
71
54
  // for notes that are always editable where they're read.
72
- // - Images in the text show (`![alt](url)`), at most the field's width.
73
- // With `upload`, an image pasted, dropped or picked with the toolbar's
74
- // Image button (the fixed toolbar's, the tools strip's with
75
- // `toolbar="floating"`, the phone's row) is uploaded through it and goes in as `![](url)`
55
+ // - Images show at most the field's width. With `upload`, an image pasted,
56
+ // dropped or picked is uploaded through it and goes in as `![](url)`
76
57
  // (rich-text-image-upload.ts); a refusal or a failed upload is a toast.
77
- // - Toggle headings (`## Safety {toggle="true"}`, rich-text-toggle-heading.ts):
78
- // a heading's `toggle` attribute, typed as `>## `, picked from the slash
79
- // menu or the toolbar. A plain heading is the default.
80
58
  // - `foldKey`: the text folds by its toggle headings, as <Markdown> does
81
59
  // (rich-text-fold.ts), remembered on this device and shared with
82
60
  // NotesOutline; the document never changes.
83
- // - `pageLink`: links the app marks as its pages drawn as page links
84
- // (rich-text-page-links.ts), opened in this tab; `onCreatePage`: "/page"
85
- // and Turn into page make one through the app and link it (a title box,
86
- // rich-text-page-box.tsx). The Markdown stays a plain link.
61
+ // - `pageLink`: links the app marks as its pages drawn as page links,
62
+ // opened in this tab; `onCreatePage`: "/page" and Turn into page make
63
+ // one through the app and link it (a title box, rich-text-page-box.tsx).
64
+ // The Markdown stays a plain link.
87
65
  import { useEffect, useId, useRef, useState } from 'react';
88
66
  import { createPortal } from 'react-dom';
89
67
  import { useInRouterContext, useNavigate } from 'react-router';
@@ -256,9 +234,8 @@ const imageTitles = $remark('imageTitles', () => () => (tree) => emptyImageTitle
256
234
  // What the field says when the merge refuses an edit (markdown-merge.ts):
257
235
  // to the app's `onProblem`, and in the field itself.
258
236
  // How long typing has to stop before the edit is turned back into
259
- // Markdown (mergeMarkdown) and reported through onChange (F6).
237
+ // Markdown (mergeMarkdown) and reported through onChange.
260
238
  export const MERGE_PAUSE_MS = 300;
261
- // Every format a toolbar can show as on.
262
239
  const SHOWN_FORMATS = [
263
240
  ...new Set([...FORMAT_GROUPS.flat(), ...TOGGLE_HEADING_VARIANTS, ...CALLOUT_VARIANTS, ...HIGHLIGHT_VARIANTS].map((item) => item.id)),
264
241
  ];
@@ -266,7 +243,7 @@ const SHOWN_FORMATS = [
266
243
  // formats on, the selection (where only when there is one: a caret's
267
244
  // place matters to nothing drawn but the slash menu and a table's grips),
268
245
  // the slash menu's query, a table's caret cell and the uploads. A key
269
- // that doesn't change it re-renders nothing (F6).
246
+ // that doesn't change it re-renders nothing.
270
247
  function shownKey(state) {
271
248
  const { selection } = state;
272
249
  const parts = [selection.empty ? 'caret' : `${selection.from}-${selection.to}`];
@@ -327,7 +304,7 @@ export default function MilkdownEditor({ id, defaultValue, onChange, onProblem,
327
304
  const [focused, setFocused] = useState(false);
328
305
  const [selecting, setSelectingState] = useState(false);
329
306
  // Set only when it changes: a key sets it false, and React would draw
330
- // the whole editor again for the first key after a click (F6).
307
+ // the whole editor again for the first key after a click.
331
308
  const selectingRef = useRef(false);
332
309
  const setSelecting = (next) => {
333
310
  if (selectingRef.current === next)
@@ -377,7 +354,6 @@ export default function MilkdownEditor({ id, defaultValue, onChange, onProblem,
377
354
  }, [fullScreen]);
378
355
  // The page behind full screen is inert meanwhile (rich-text-full-screen.ts).
379
356
  useHoldFocus(field, fullScreen);
380
- // The toolbar's Image button opens this file picker.
381
357
  const imageInputRef = useRef(null);
382
358
  // The fixed bar above the text, and the menus over it (the floating
383
359
  // toolbar and the slash menu), which `'floating'` keeps on their own.
@@ -442,10 +418,9 @@ export default function MilkdownEditor({ id, defaultValue, onChange, onProblem,
442
418
  const textTop = headingFrom === 'text' ? textTopHeading(original) : 1;
443
419
  let baseline = null;
444
420
  let cancelled = false;
445
- // The last shownKey React drew.
446
421
  let shown = '';
447
422
  // The merge runs a pause after typing stops (MERGE_PAUSE_MS), not on
448
- // every key: its cost grows with the note (F6). Anything about to read
423
+ // every key: its cost grows with the note. Anything about to read
449
424
  // the value first asks for it (flushPendingEdits, src/lib/pending-edits.ts),
450
425
  // and leaving the text, Esc, Ctrl/Cmd+Enter, hiding the page and
451
426
  // unmounting report it at once.
@@ -658,7 +633,7 @@ export default function MilkdownEditor({ id, defaultValue, onChange, onProblem,
658
633
  return false;
659
634
  },
660
635
  // Moving to the floating toolbar keeps it showing.
661
- // Leaving the text reports what was typed (F6).
636
+ // Leaving the text reports what was typed.
662
637
  blur: (_view, event) => {
663
638
  emit();
664
639
  if (!inFloating(event.relatedTarget))
@@ -685,7 +660,7 @@ export default function MilkdownEditor({ id, defaultValue, onChange, onProblem,
685
660
  handleKeyDown: (view, event) => {
686
661
  setSelecting(false);
687
662
  // Esc and Ctrl/Cmd+Enter are the field's (save, close): what
688
- // was typed is reported before they reach it (F6).
663
+ // was typed is reported before they reach it.
689
664
  if (event.key === 'Escape' || (event.key === 'Enter' && (event.metaKey || event.ctrlKey)))
690
665
  emit();
691
666
  // Alt+F10: to the floating toolbar when it shows, else the
@@ -934,7 +909,7 @@ export default function MilkdownEditor({ id, defaultValue, onChange, onProblem,
934
909
  // The toolbar's Image button: the file picker, then each file picked
935
910
  // uploaded in place of the selection, and focus back in the text.
936
911
  const pickImages = () => imageInputRef.current?.click();
937
- // The slash menu's Image (4.123): the "/…" goes, then the file picker;
912
+ // The slash menu's Image: the "/…" goes, then the file picker;
938
913
  // the images go in at the caret, where the "/" was.
939
914
  // A tick later: Chrome opens no picker for a click made inside the
940
915
  // editor's own keydown (Enter on the item); the key's activation lasts.
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
- // A place on a hub page (issue #224): one of the app's modules, or a site
2
+ // A place on a hub page: one of the app's modules, or a site
3
3
  // outside it, as a small card in a strip across the top of the page.
4
4
  //
5
5
  // - The band: the place's icon, tinted with its categorical slot, and its
@@ -26,12 +26,11 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
26
26
  // the sidebar's breakpoint (md) instead, so a hub's widgets start on the
27
27
  // first screen: each place's icon in its slot's colour, its name and its
28
28
  // number, a skeleton while that loads and a dash when it fails (Retry is
29
- // the card's; the place's own page says what went wrong). Each ModuleCard
30
- // renders its chip beside its card, one shown at each width. The row
31
- // scrolls inside itself and is `relative`, so a chip's sr-only text
32
- // (absolutely placed) scrolls with it instead of widening the page.
33
- // `noteOnChip` adds the note after the number, on the chip's one line and
34
- // cut off at a fixed width, so a long note can't crowd the row.
29
+ // the card's). Each ModuleCard renders its chip beside its card, one shown
30
+ // at each width. The row scrolls inside itself and is `relative`, so a
31
+ // chip's sr-only text (absolutely placed) scrolls with it instead of
32
+ // widening the page. `noteOnChip` adds the note after the number, cut off
33
+ // at a fixed width so a long note can't crowd the row.
35
34
  import { Children, createContext, useContext, useId } from 'react';
36
35
  import { Link } from 'react-router';
37
36
  import { AlertCircleIcon, ExternalLinkIcon } from 'lucide-react';
@@ -0,0 +1,46 @@
1
+ import { type ReactNode } from 'react';
2
+ import { type To } from 'react-router';
3
+ import type { AppError } from '../../api/contracts.js';
4
+ import { type PlainDate } from '../../lib/plain-date.js';
5
+ export type MonthCalendarTone = 'neutral' | 'info' | 'success' | 'warning' | 'destructive';
6
+ /** One thing on a day. */
7
+ export type MonthCalendarItem = {
8
+ id: string | number;
9
+ /** Its day, `'YYYY-MM-DD'`. */
10
+ day: PlainDate;
11
+ title: string;
12
+ /** `'HH:MM'`, or none for all day. */
13
+ time?: string | null;
14
+ /** Its dot and mark (design-language.md "Semantic tones"). Defaults to `info`. */
15
+ tone?: MonthCalendarTone;
16
+ /** Where its row in the day's list goes. */
17
+ to?: To;
18
+ /** A word after the time in the day's list ("Visit"). */
19
+ detail?: string;
20
+ };
21
+ export type MonthCalendarProps = {
22
+ /** The month's name for a screen reader is added to this ("Events"). */
23
+ label: string;
24
+ items?: MonthCalendarItem[];
25
+ /** Today, `'YYYY-MM-DD'` in the app's zone (todayIn). */
26
+ today: PlainDate;
27
+ /** The picked day, when the app holds it. */
28
+ selected?: PlainDate;
29
+ /** A day picked by click, Enter or the arrows; the app says what that does. */
30
+ onSelect?: (day: PlainDate) => void;
31
+ /** The month shown, `'YYYY-MM'`, when the app holds it. Defaults to the picked day's. */
32
+ month?: string;
33
+ onMonthChange?: (month: string) => void;
34
+ /** The app's actions for the picked day, beside its heading (an Add button). */
35
+ dayActions?: (day: PlainDate) => ReactNode;
36
+ /** The first day of the week. Defaults to Monday. */
37
+ weekStart?: 'MO' | 'SU';
38
+ isLoading?: boolean;
39
+ error?: AppError | null;
40
+ onRetry?: () => void;
41
+ /** Over the days when the month has nothing. Defaults to "Nothing this month". */
42
+ emptyText?: ReactNode;
43
+ locale?: string;
44
+ className?: string;
45
+ };
46
+ export declare function MonthCalendar({ label, items, today, selected, onSelect, month, onMonthChange, dayActions, weekStart, isLoading, error, onRetry, emptyText, locale, className, }: MonthCalendarProps): import("react").JSX.Element;
@@ -0,0 +1,160 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ // A month of days holding the app's items: events,
3
+ // visits, anything with a day. On a laptop each day shows its items by
4
+ // title, two to a day and the rest folded to a count; on a phone each day
5
+ // shows a dot per item in its tone. The picked day's items are listed
6
+ // under the month, each a link, with the app's own actions for that day
7
+ // beside its heading (Add, say). Not a date picker: that's `Calendar`.
8
+ //
9
+ // The month is a grid (role="grid", a table): one tab stop on the picked
10
+ // day, the arrows move it a day or a week, Home and End to the week's
11
+ // ends, Page Up and Page Down a month, Enter or a click picks it. Moving
12
+ // past the month's edge turns the page. Every day is a plain day
13
+ // (`'YYYY-MM-DD'`), never an instant, so no zone shifts one.
14
+ //
15
+ // Four states: loading (the month's frame with placeholders), error
16
+ // (ErrorState in place of the days, the arrows still there), empty
17
+ // ("Nothing this month" over the days) and success.
18
+ import { useEffect, useMemo, useRef, useState } from 'react';
19
+ import { ChevronLeftIcon, ChevronRightIcon } from 'lucide-react';
20
+ import { Link } from 'react-router';
21
+ import { cn } from 'cn';
22
+ import { Button } from '../ui/button.js';
23
+ import { Skeleton } from '../ui/skeleton.js';
24
+ import { formatPlainDate, localToPlainDate } from '../../lib/plain-date.js';
25
+ import { ErrorState } from './error-state.js';
26
+ const TONE_DOT = {
27
+ neutral: 'bg-muted-foreground',
28
+ info: 'bg-info',
29
+ success: 'bg-success',
30
+ warning: 'bg-warning',
31
+ destructive: 'bg-destructive',
32
+ };
33
+ const pad = (value) => String(value).padStart(2, '0');
34
+ const monthOf = (day) => day.slice(0, 7);
35
+ function parts(day) {
36
+ const [year, month, date] = day.split('-').map(Number);
37
+ return [year, month, date];
38
+ }
39
+ function shift(day, days) {
40
+ const [year, month, date] = parts(day);
41
+ return localToPlainDate(new Date(year, month - 1, date + days));
42
+ }
43
+ function shiftMonth(month, by) {
44
+ const [year, number] = month.split('-').map(Number);
45
+ const next = new Date(year, number - 1 + by, 1);
46
+ return `${next.getFullYear()}-${pad(next.getMonth() + 1)}`;
47
+ }
48
+ /** The same day in another month, or that month's last day. */
49
+ function sameDayIn(day, month) {
50
+ const [year, number] = month.split('-').map(Number);
51
+ const last = new Date(year, number, 0).getDate();
52
+ return `${month}-${pad(Math.min(parts(day)[2], last))}`;
53
+ }
54
+ function clock(time, locale) {
55
+ const [hour, minute] = time.split(':').map(Number);
56
+ return new Intl.DateTimeFormat(locale, { hour: 'numeric', minute: '2-digit', timeZone: 'UTC' }).format(Date.UTC(2001, 0, 1, hour, minute));
57
+ }
58
+ /** Monday 0 … Sunday 6. */
59
+ function weekdayIndex(day) {
60
+ const [year, month, date] = parts(day);
61
+ return (new Date(Date.UTC(year, month - 1, date)).getUTCDay() + 6) % 7;
62
+ }
63
+ const byTime = (a, b) => (a.time ?? '').localeCompare(b.time ?? '');
64
+ export function MonthCalendar({ label, items = [], today, selected, onSelect, month, onMonthChange, dayActions, weekStart = 'MO', isLoading, error, onRetry, emptyText = 'Nothing this month', locale, className, }) {
65
+ const [ownSelected, setOwnSelected] = useState(selected ?? today);
66
+ const picked = selected ?? ownSelected;
67
+ const [ownMonth, setOwnMonth] = useState(month ?? monthOf(picked));
68
+ const shown = month ?? ownMonth;
69
+ const gridRef = useRef(null);
70
+ const focusAfter = useRef(false);
71
+ const byDay = useMemo(() => {
72
+ const map = new Map();
73
+ for (const item of items)
74
+ map.set(item.day, [...(map.get(item.day) ?? []), item]);
75
+ for (const list of map.values())
76
+ list.sort(byTime);
77
+ return map;
78
+ }, [items]);
79
+ function showMonth(next) {
80
+ if (month === undefined)
81
+ setOwnMonth(next);
82
+ onMonthChange?.(next);
83
+ }
84
+ function pick(day, focus = false) {
85
+ if (selected === undefined)
86
+ setOwnSelected(day);
87
+ onSelect?.(day);
88
+ if (monthOf(day) !== shown)
89
+ showMonth(monthOf(day));
90
+ focusAfter.current = focus;
91
+ }
92
+ // After a key moves the pick, the focus follows it (into the new month too).
93
+ useEffect(() => {
94
+ if (!focusAfter.current)
95
+ return;
96
+ focusAfter.current = false;
97
+ gridRef.current?.querySelector(`[data-day="${picked}"]`)?.focus();
98
+ });
99
+ const firstDay = `${shown}-01`;
100
+ const [year, monthNumber] = shown.split('-').map(Number);
101
+ const daysIn = new Date(year, monthNumber, 0).getDate();
102
+ const startIndex = weekStart === 'SU' ? 6 : 0;
103
+ const lead = (weekdayIndex(firstDay) - startIndex + 7) % 7;
104
+ const weeks = [];
105
+ for (let cell = 0; cell < Math.ceil((lead + daysIn) / 7) * 7; cell++) {
106
+ const date = cell - lead + 1;
107
+ if (cell % 7 === 0)
108
+ weeks.push([]);
109
+ weeks[weeks.length - 1].push(date >= 1 && date <= daysIn ? `${shown}-${pad(date)}` : null);
110
+ }
111
+ const weekdayNames = Array.from({ length: 7 }, (_, i) => {
112
+ // 2024-01-01 was a Monday.
113
+ const at = Date.UTC(2024, 0, 1 + ((i + startIndex) % 7));
114
+ return {
115
+ short: new Intl.DateTimeFormat(locale, { weekday: 'short', timeZone: 'UTC' }).format(at),
116
+ narrow: new Intl.DateTimeFormat(locale, { weekday: 'narrow', timeZone: 'UTC' }).format(at),
117
+ long: new Intl.DateTimeFormat(locale, { weekday: 'long', timeZone: 'UTC' }).format(at),
118
+ };
119
+ });
120
+ const monthName = formatPlainDate(firstDay, { month: 'long', year: 'numeric' }, locale);
121
+ const monthHasItems = items.some((item) => monthOf(item.day) === shown);
122
+ // The pick the grid's tab stop sits on: in this month, or its first day.
123
+ const stop = monthOf(picked) === shown ? picked : firstDay;
124
+ function onKeyDown(event, day) {
125
+ const index = (weekdayIndex(day) - startIndex + 7) % 7;
126
+ const moves = {
127
+ ArrowLeft: () => shift(day, -1),
128
+ ArrowRight: () => shift(day, 1),
129
+ ArrowUp: () => shift(day, -7),
130
+ ArrowDown: () => shift(day, 7),
131
+ Home: () => shift(day, -index),
132
+ End: () => shift(day, 6 - index),
133
+ PageUp: () => sameDayIn(day, shiftMonth(monthOf(day), -1)),
134
+ PageDown: () => sameDayIn(day, shiftMonth(monthOf(day), 1)),
135
+ };
136
+ if (moves[event.key]) {
137
+ event.preventDefault();
138
+ pick(moves[event.key](), true);
139
+ }
140
+ else if (event.key === 'Enter' || event.key === ' ') {
141
+ event.preventDefault();
142
+ pick(day, true);
143
+ }
144
+ }
145
+ const dayLabel = (day) => formatPlainDate(day, { weekday: 'long', month: 'long', day: 'numeric' }, locale);
146
+ const pickedItems = byDay.get(picked) ?? [];
147
+ return (_jsxs("div", { "data-slot": "month-calendar", className: cn('flex min-w-0 flex-col gap-3', className), children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx("h2", { className: "mr-auto type-body font-semibold text-foreground", "aria-live": "polite", children: monthName }), _jsx(Button, { variant: "outline", size: "icon-sm", "aria-label": "Previous month", onClick: () => showMonth(shiftMonth(shown, -1)), children: _jsx(ChevronLeftIcon, { "aria-hidden": "true" }) }), _jsx(Button, { variant: "outline", size: "sm", onClick: () => pick(today), children: "Today" }), _jsx(Button, { variant: "outline", size: "icon-sm", "aria-label": "Next month", onClick: () => showMonth(shiftMonth(shown, 1)), children: _jsx(ChevronRightIcon, { "aria-hidden": "true" }) })] }), error ? (_jsx(ErrorState, { error: error, onRetry: onRetry })) : (_jsxs(_Fragment, { children: [!isLoading && !monthHasItems && (_jsx("p", { "data-slot": "month-calendar-empty", className: "text-sm text-muted-foreground", children: emptyText })), _jsxs("table", { ref: gridRef, role: "grid", "aria-label": `${label}, ${monthName}`, "aria-busy": isLoading || undefined, className: "w-full table-fixed border-separate border-spacing-0 overflow-hidden rounded-md border-t border-l border-border", children: [_jsx("thead", { children: _jsx("tr", { children: weekdayNames.map((name) => (_jsxs("th", { scope: "col", abbr: name.long, className: "border-r border-b border-border bg-muted/40 px-1 py-1 text-left text-xs font-medium text-muted-foreground uppercase max-md:text-center", children: [_jsx("span", { className: "sr-only", children: name.long }), _jsx("span", { className: "max-md:hidden", "aria-hidden": "true", children: name.short }), _jsx("span", { className: "md:hidden", "aria-hidden": "true", children: name.narrow })] }, name.long))) }) }), _jsx("tbody", { children: weeks.map((week, row) => (_jsx("tr", { children: week.map((day, column) => {
148
+ if (!day)
149
+ return _jsx("td", { className: "border-r border-b border-border bg-muted/20" }, column);
150
+ const list = byDay.get(day) ?? [];
151
+ const isToday = day === today;
152
+ const isPicked = day === picked;
153
+ const count = list.length;
154
+ return (_jsxs("td", { "data-day": day, "aria-selected": isPicked, "aria-current": isToday ? 'date' : undefined, tabIndex: day === stop ? 0 : -1, onClick: () => pick(day), onKeyDown: (event) => onKeyDown(event, day), className: cn('h-11 cursor-pointer border-r border-b border-border bg-card p-1 align-top outline-none md:h-20', 'hover:bg-muted/40 focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:ring-inset', isPicked && 'shadow-[inset_0_0_0_2px_var(--color-ring)]'), children: [_jsxs("span", { className: "sr-only", children: [`${dayLabel(day)}${isToday ? ', today' : ''}, ${count === 0 ? 'nothing' : count === 1 ? '1 item' : `${count} items`}`, count > 0 && `: ${list.map((item) => item.title).join(', ')}`] }), _jsxs("div", { className: "flex flex-col max-md:items-center", "aria-hidden": "true", children: [_jsx("span", { className: cn('w-fit rounded px-1 text-xs tabular-nums', isToday ? 'bg-primary font-semibold text-primary-foreground' : 'text-muted-foreground'), children: Number(day.slice(8)) }), isLoading ? (_jsx(Skeleton, { className: "mt-1 h-3 w-3/4 max-md:hidden" })) : (_jsxs(_Fragment, { children: [_jsxs("ul", { className: "mt-0.5 flex min-w-0 flex-col gap-0.5 max-md:hidden", children: [list.slice(0, 2).map((item) => (_jsxs("li", { className: "flex min-w-0 items-center gap-1 text-xs text-foreground", children: [_jsx("span", { className: cn('size-1.5 shrink-0 rounded-full', TONE_DOT[item.tone ?? 'info']) }), _jsx("span", { className: "truncate", children: item.title })] }, item.id))), count > 2 && _jsxs("li", { className: "pl-2.5 text-xs text-muted-foreground", children: ["+", count - 2, " more"] })] }), count > 0 && (_jsx("span", { className: "mt-1 flex justify-center gap-0.5 md:hidden", children: list.slice(0, 4).map((item) => (_jsx("span", { className: cn('size-1.5 rounded-full', TONE_DOT[item.tone ?? 'info']) }, item.id))) }))] }))] })] }, day));
155
+ }) }, row))) })] }), _jsxs("div", { role: "group", "aria-label": `${dayLabel(picked)}${picked === today ? ', today' : ''}`, "data-slot": "month-calendar-day", className: "flex flex-col gap-1", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsxs("h3", { className: cn('mr-auto text-sm font-semibold', picked === today ? 'text-link' : 'text-foreground'), children: [dayLabel(picked), picked === today && ' · Today'] }), dayActions?.(picked)] }), isLoading ? (_jsxs("div", { className: "flex flex-col gap-2 py-1", children: [_jsx(Skeleton, { className: "h-4 w-2/3" }), _jsx(Skeleton, { className: "h-4 w-1/2" })] })) : pickedItems.length === 0 ? (_jsx("p", { className: "border-t border-border py-1.5 text-sm text-muted-foreground", children: "Nothing that day." })) : (_jsx("ul", { className: "flex flex-col", children: pickedItems.map((item) => {
156
+ const when = [item.time ? clock(item.time, locale) : 'All day', item.detail].filter(Boolean).join(' · ');
157
+ const body = (_jsxs(_Fragment, { children: [_jsx("span", { className: cn('size-2 shrink-0 rounded-full', TONE_DOT[item.tone ?? 'info']), "aria-hidden": "true" }), _jsx("span", { className: "min-w-0 flex-1 truncate", children: item.title }), _jsx("span", { className: "shrink-0 text-xs text-muted-foreground", children: when })] }));
158
+ return (_jsx("li", { className: "border-t border-border", children: item.to ? (_jsx(Link, { to: item.to, className: "flex min-h-10 items-center gap-2 py-1.5 text-sm text-foreground outline-none hover:underline focus-visible:ring-3 focus-visible:ring-ring/50", children: body })) : (_jsx("div", { className: "flex min-h-10 items-center gap-2 py-1.5 text-sm text-foreground", children: body })) }, item.id));
159
+ }) }))] })] }))] }));
160
+ }
@@ -44,7 +44,6 @@ function moveInGrid(key, at, count, columns) {
44
44
  return null;
45
45
  return Math.min(Math.max(next, 0), count - 1);
46
46
  }
47
- // The month after (or before) one, round the year.
48
47
  const nextMonth = (month, by) => ((month - 1 + by + 12) % 12) + 1;
49
48
  export function MonthDayField({ id, value, onChange, placeholder = 'Pick a day', clearable = false, invalid = false, readOnly = false, defaultOpen = false, modal, onOpenChange, format, locale, className, ...aria }) {
50
49
  const [open, setOpen] = useState(defaultOpen && !readOnly);
@@ -4,7 +4,7 @@ import type { OptionSelectOption } from './option-select.js';
4
4
  export type MultiChoiceOption<T extends string> = OptionSelectOption<T>;
5
5
  export type MultiChoiceProps<T extends string> = {
6
6
  /**
7
- * Every allowed option, in display order: bare values, or (4.130)
7
+ * Every allowed option, in display order: bare values, or
8
8
  * OptionSelect's `{ value, label, kind?, icon? }`, whose `label` names it
9
9
  * and whose `kind` or `icon` is drawn before the words, as OptionSelect
10
10
  * draws it.
@@ -11,10 +11,10 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
11
11
  // typed-text match all use the label, and the value is what's emitted.
12
12
  //
13
13
  // A toolbar filter's summary ("Status: Active +1", `label`) keeps the
14
- // control one line high however narrow it is (4.109): it truncates, and
14
+ // control one line high however narrow it is: it truncates, and
15
15
  // the text box beside it takes no room until it's focused.
16
16
  //
17
- // An option can carry a status kind or an icon (4.130), as OptionSelect's
17
+ // An option can carry a status kind or an icon, as OptionSelect's
18
18
  // and ChoiceButtons' do, drawn by the same OptionIcon: pass the options as
19
19
  // `{ value, label, kind?, icon? }` (OptionSelectOption) in place of bare
20
20
  // values. The icon goes before the words on the option in the list, on its
@@ -49,7 +49,7 @@ export function MultiChoice({ options, value, onValueChange, getLabel, id, place
49
49
  const summarised = label !== undefined && value.length > 0;
50
50
  return (_jsxs(Combobox, { multiple: true, autoHighlight: true, items: values, value: value, onValueChange: (next, details) => {
51
51
  // Base UI empties the value on Escape while the list is closed, so
52
- // a second Escape after a pick wiped every chip (issue #123). Escape
52
+ // a second Escape after a pick wiped every chip. Escape
53
53
  // never removes picks here: a chip's remove button, Backspace or
54
54
  // unpicking in the list does. Let the key go on, so a dialog or an
55
55
  // edit in place gets its own Escape.
@@ -1,5 +1,5 @@
1
1
  import { jsxs as _jsxs, jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
2
- // Several values over time on one plot (4.51): a net worth beside its
2
+ // Several values over time on one plot: a net worth beside its
3
3
  // assets and debts, or a balance's history beside low, middle and high
4
4
  // projections. LineChart's sibling, plain SVG the same way: each series is
5
5
  // its own <svg> drawing in currentColor in a text tone, so the package's
@@ -68,8 +68,8 @@ export function MultiLineChart({ label, series, target, formatY = defaultY, form
68
68
  return (_jsx("span", { "data-slot": "multi-line-chart-dot", className: cn('absolute size-2.5 -translate-x-1/2 -translate-y-1/2 rounded-full ring-2 ring-card', DOT[tone]), style: { left: percent(places[0].x), top: percent(places[0].y) } }, s));
69
69
  }
70
70
  return (_jsx("svg", { "data-slot": "multi-line-chart-series", viewBox: "0 0 100 100", preserveAspectRatio: "none", className: cn('absolute inset-0 size-full overflow-visible', TONE[tone]), children: _jsx("polyline", { points: places.map((place) => `${place.x * 100},${place.y * 100}`).join(' '), fill: "none", strokeWidth: 2, strokeDasharray: one.dashed ? DASH : undefined, strokeLinejoin: "round", strokeLinecap: one.dashed ? undefined : 'round', vectorEffect: "non-scaling-stroke", className: "stroke-current" }) }, s));
71
- })] }), _jsxs("div", { "aria-hidden": "true", className: "flex justify-between gap-3 type-caption text-muted-foreground tabular-nums", children: [_jsx("span", { children: formatX(left.x) }), right.at > left.at && _jsx("span", { children: formatX(right.x) })] }), _jsx("ul", { "aria-hidden": "true", "data-slot": "multi-line-chart-legend", className: "flex flex-wrap gap-x-4 gap-y-1 type-caption text-foreground", children: drawn.map((one, s) => (_jsxs("li", { className: "flex items-center gap-1.5", children: [_jsx("svg", { viewBox: "0 0 16 4", className: cn('h-1 w-4 shrink-0', TONE[one.tone ?? 'info']), children: _jsx("line", { x1: "0", x2: "16", y1: "2", y2: "2", strokeWidth: 2, strokeDasharray: one.dashed ? '4 2' : undefined, className: "stroke-current" }) }), _jsx("span", { children: one.label }), _jsx("span", { className: "font-medium tabular-nums", children: formatY(one.points[one.points.length - 1].y) })] }, s))) }), _jsx("figcaption", { className: "sr-only", children: summary }), _jsxs("table", { className: "sr-only", children: [_jsx("caption", { children: label }), _jsx("thead", { children: _jsxs("tr", { children: [_jsx("th", { scope: "col", children: "When" }), drawn.map((one, s) => (_jsx("th", { scope: "col", children: one.label }, s)))] }) }), _jsx("tbody", { children: rows.map((x) => (_jsxs("tr", { children: [_jsx("th", { scope: "row", children: formatX(x) }), drawn.map((one, s) => {
72
- const point = one.points.find((p) => String(p.x) === String(x));
73
- return _jsx("td", { children: point ? formatY(point.y) : '' }, s);
74
- })] }, String(x)))) })] })] }));
71
+ })] }), _jsxs("div", { "aria-hidden": "true", className: "flex justify-between gap-3 type-caption text-muted-foreground tabular-nums", children: [_jsx("span", { children: formatX(left.x) }), right.at > left.at && _jsx("span", { children: formatX(right.x) })] }), _jsx("ul", { "aria-hidden": "true", "data-slot": "multi-line-chart-legend", className: "flex flex-wrap gap-x-4 gap-y-1 type-caption text-foreground", children: drawn.map((one, s) => (_jsxs("li", { className: "flex items-center gap-1.5", children: [_jsx("svg", { viewBox: "0 0 16 4", className: cn('h-1 w-4 shrink-0', TONE[one.tone ?? 'info']), children: _jsx("line", { x1: "0", x2: "16", y1: "2", y2: "2", strokeWidth: 2, strokeDasharray: one.dashed ? '4 2' : undefined, className: "stroke-current" }) }), _jsx("span", { children: one.label }), _jsx("span", { className: "font-medium tabular-nums", children: formatY(one.points[one.points.length - 1].y) })] }, s))) }), _jsx("figcaption", { className: "sr-only", children: 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" }), drawn.map((one, s) => (_jsx("th", { scope: "col", children: one.label }, s)))] }) }), _jsx("tbody", { children: rows.map((x) => (_jsxs("tr", { children: [_jsx("th", { scope: "row", children: formatX(x) }), drawn.map((one, s) => {
72
+ const point = one.points.find((p) => String(p.x) === String(x));
73
+ return _jsx("td", { children: point ? formatY(point.y) : '' }, s);
74
+ })] }, String(x)))) })] }) })] }));
75
75
  }