@cosmicdrift/kumiko-renderer 0.413.1 → 0.414.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 (334) hide show
  1. package/dist/app/action-form-support.js +4 -0
  2. package/dist/app/content-previews.d.ts +39 -0
  3. package/dist/app/content-previews.js +28 -0
  4. package/dist/app/entity-edit-screen.js +2 -5
  5. package/dist/app/entity-list-screen.js +30 -50
  6. package/dist/app/form-schema.d.ts +1 -0
  7. package/dist/app/form-schema.js +24 -0
  8. package/dist/app/list-sort-options.d.ts +4 -0
  9. package/dist/app/list-sort-options.js +11 -0
  10. package/dist/app/named-filter-facet.d.ts +17 -3
  11. package/dist/app/named-filter-facet.js +88 -5
  12. package/dist/app/projection-detail-body.d.ts +2 -4
  13. package/dist/app/projection-detail-body.js +7 -1
  14. package/dist/app/projection-detail-guidance-data.d.ts +7 -0
  15. package/dist/app/projection-detail-guidance-data.js +101 -0
  16. package/dist/app/projection-detail-guidance.d.ts +13 -0
  17. package/dist/app/projection-detail-guidance.js +197 -0
  18. package/dist/app/projection-detail-header-model.d.ts +1 -3
  19. package/dist/app/projection-detail-header-model.js +4 -8
  20. package/dist/app/projection-detail-header-region.d.ts +2 -1
  21. package/dist/app/projection-detail-header-region.js +63 -23
  22. package/dist/app/projection-detail-header.d.ts +6 -1
  23. package/dist/app/projection-detail-header.js +75 -18
  24. package/dist/app/projection-detail-states.d.ts +3 -3
  25. package/dist/app/projection-list-body.js +4 -2
  26. package/dist/app/projection-list-render.js +3 -1
  27. package/dist/app/projection-list-shim.d.ts +4 -1
  28. package/dist/app/projection-list-shim.js +35 -8
  29. package/dist/app/reference-link.d.ts +3 -2
  30. package/dist/app/reference-link.js +19 -4
  31. package/dist/app/row-actions.js +3 -3
  32. package/dist/app/screen-access.d.ts +4 -0
  33. package/dist/app/screen-access.js +19 -0
  34. package/dist/app/screen-shared.js +3 -1
  35. package/dist/app/unique-label-keys.d.ts +1 -0
  36. package/dist/app/unique-label-keys.js +9 -0
  37. package/dist/app/use-entity-list-payload.d.ts +25 -0
  38. package/dist/app/use-entity-list-payload.js +57 -0
  39. package/dist/app/use-entity-range-facets.js +2 -3
  40. package/dist/app/use-facet-counts.d.ts +5 -0
  41. package/dist/app/use-facet-counts.js +7 -0
  42. package/dist/app/use-list-summary-row.d.ts +10 -0
  43. package/dist/app/use-list-summary-row.js +33 -0
  44. package/dist/app/use-named-filter-queue.d.ts +20 -0
  45. package/dist/app/use-named-filter-queue.js +9 -0
  46. package/dist/app/use-projection-detail-actions.d.ts +4 -4
  47. package/dist/app/use-projection-detail-actions.js +30 -1
  48. package/dist/app/use-projection-list-data.d.ts +5 -0
  49. package/dist/app/use-projection-list-data.js +35 -6
  50. package/dist/app/use-projection-list-query.d.ts +2 -0
  51. package/dist/app/use-projection-list-query.js +29 -16
  52. package/dist/app/use-related-list-tab-counts.js +5 -1
  53. package/dist/app/use-row-decoration.d.ts +11 -0
  54. package/dist/app/use-row-decoration.js +55 -0
  55. package/dist/app/use-screen-list-rows.d.ts +4 -1
  56. package/dist/app/use-screen-list-rows.js +14 -5
  57. package/dist/app/use-screen-list-table.d.ts +3 -1
  58. package/dist/app/use-screen-list-table.js +10 -1
  59. package/dist/app/write-failed-error.d.ts +1 -0
  60. package/dist/app/write-failed-error.js +10 -0
  61. package/dist/compact-tap-classes.d.ts +1 -0
  62. package/dist/compact-tap-classes.js +3 -0
  63. package/dist/components/embedded-list-field.js +13 -12
  64. package/dist/components/list-empty-state.d.ts +8 -1
  65. package/dist/components/list-empty-state.js +4 -1
  66. package/dist/components/list-group-page-bridges.d.ts +1 -1
  67. package/dist/components/list-group-page-bridges.js +2 -2
  68. package/dist/components/related-list-section.js +4 -22
  69. package/dist/components/render-edit-action-button.d.ts +3 -1
  70. package/dist/components/render-edit-action-button.js +5 -3
  71. package/dist/components/render-edit-render-model.d.ts +2 -2
  72. package/dist/components/render-edit-types.d.ts +4 -2
  73. package/dist/components/render-edit.js +3 -1
  74. package/dist/components/render-list-hint-columns.d.ts +8 -0
  75. package/dist/components/render-list-hint-columns.js +77 -0
  76. package/dist/components/render-list-reference-columns.js +4 -2
  77. package/dist/components/render-list-row-tone.d.ts +3 -0
  78. package/dist/components/render-list-row-tone.js +10 -0
  79. package/dist/components/render-list-table-props.d.ts +9 -1
  80. package/dist/components/render-list-table-props.js +4 -1
  81. package/dist/components/render-list-toolbar-action.d.ts +1 -2
  82. package/dist/components/render-list-toolbar-model.d.ts +3 -0
  83. package/dist/components/render-list-toolbar-model.js +21 -6
  84. package/dist/components/render-list-toolbar.d.ts +3 -2
  85. package/dist/components/render-list-toolbar.js +8 -6
  86. package/dist/components/render-list-types.d.ts +6 -1
  87. package/dist/components/render-list.js +26 -7
  88. package/dist/components/use-render-edit-controlled-sync.js +3 -5
  89. package/dist/components/use-render-edit-draft-save.js +7 -9
  90. package/dist/components/use-render-edit-schema.d.ts +3 -0
  91. package/dist/components/use-render-edit-schema.js +15 -0
  92. package/dist/components/use-render-edit-state.d.ts +1 -0
  93. package/dist/components/use-render-edit-state.js +4 -1
  94. package/dist/components/use-render-edit-steps.js +2 -3
  95. package/dist/components/use-render-list-columns.d.ts +3 -1
  96. package/dist/components/use-render-list-columns.js +22 -10
  97. package/dist/context/screen-focus-context.d.ts +14 -0
  98. package/dist/context/screen-focus-context.js +28 -0
  99. package/dist/data-table-facet-types.d.ts +2 -0
  100. package/dist/data-table-view-types.d.ts +20 -1
  101. package/dist/headless/form/form-controller.js +3 -1
  102. package/dist/headless/form/zod-bridge.d.ts +7 -1
  103. package/dist/headless/form/zod-bridge.js +10 -0
  104. package/dist/headless/index.d.ts +2 -1
  105. package/dist/headless/index.js +1 -0
  106. package/dist/headless/pwa-service-worker-meta.d.ts +1 -0
  107. package/dist/headless/pwa-service-worker-meta.js +3 -0
  108. package/dist/headless/view-model/index.d.ts +1 -1
  109. package/dist/headless/view-model/list-file-display.js +3 -2
  110. package/dist/headless/view-model/list.js +16 -0
  111. package/dist/headless/view-model/types.d.ts +33 -0
  112. package/dist/hooks/list-column-layout.js +2 -1
  113. package/dist/hooks/list-server-groups.js +14 -1
  114. package/dist/hooks/list-state-schema.d.ts +1 -0
  115. package/dist/hooks/list-state-schema.js +9 -1
  116. package/dist/hooks/use-debounced-value.d.ts +1 -0
  117. package/dist/hooks/use-debounced-value.js +11 -0
  118. package/dist/hooks/use-list-aggregates.d.ts +5 -1
  119. package/dist/hooks/use-list-aggregates.js +9 -5
  120. package/dist/hooks/use-list-table.d.ts +2 -1
  121. package/dist/hooks/use-list-table.js +3 -9
  122. package/dist/hooks/use-list-url-state.d.ts +2 -0
  123. package/dist/hooks/use-list-url-state.js +12 -4
  124. package/dist/hooks/use-list-view-state.js +23 -3
  125. package/dist/hooks/use-reference-lookup.js +7 -2
  126. package/dist/hooks/use-remembered-list-params.d.ts +6 -2
  127. package/dist/hooks/use-remembered-list-params.js +18 -3
  128. package/dist/hooks/use-store.js +0 -1
  129. package/dist/i18n-defaults.js +37 -2
  130. package/dist/index.d.ts +7 -2
  131. package/dist/index.js +4 -1
  132. package/dist/live/dispatcher-live.js +2 -0
  133. package/dist/metric-types.d.ts +2 -0
  134. package/dist/primitives-record-guidance.d.ts +53 -0
  135. package/dist/primitives-record-guidance.js +1 -0
  136. package/dist/primitives.d.ts +41 -31
  137. package/dist/server-clock.d.ts +6 -0
  138. package/dist/server-clock.js +20 -0
  139. package/dist/session/session-ended.d.ts +1 -0
  140. package/dist/session/session-ended.js +2 -2
  141. package/dist/status-tone.d.ts +1 -0
  142. package/dist/status-tone.js +5 -0
  143. package/dist/web/app/browser-locale.js +1 -1
  144. package/dist/web/app/client-plugin.d.ts +6 -1
  145. package/dist/web/app/create-app.d.ts +2 -1
  146. package/dist/web/app/create-app.js +15 -5
  147. package/dist/web/app/dashboard-body.js +25 -11
  148. package/dist/web/app/dashboard-header.d.ts +2 -1
  149. package/dist/web/app/dashboard-header.js +19 -7
  150. package/dist/web/app/dashboard-list-panel.d.ts +12 -0
  151. package/dist/web/app/dashboard-list-panel.js +149 -0
  152. package/dist/web/app/dashboard-narrow-gate.d.ts +6 -0
  153. package/dist/web/app/dashboard-narrow-gate.js +6 -0
  154. package/dist/web/app/dashboard-narrow-order.d.ts +3 -0
  155. package/dist/web/app/dashboard-narrow-order.js +6 -0
  156. package/dist/web/app/dashboard-navigation-link.d.ts +12 -0
  157. package/dist/web/app/dashboard-navigation-link.js +21 -0
  158. package/dist/web/app/dashboard-panels.d.ts +6 -23
  159. package/dist/web/app/dashboard-panels.js +53 -123
  160. package/dist/web/app/dashboard-reference-list-table.d.ts +5 -1
  161. package/dist/web/app/dashboard-reference-list-table.js +12 -4
  162. package/dist/web/app/dashboard-shared.d.ts +23 -7
  163. package/dist/web/app/dashboard-shared.js +44 -17
  164. package/dist/web/app/dashboard-stat-group-panel.d.ts +13 -0
  165. package/dist/web/app/dashboard-stat-group-panel.js +67 -0
  166. package/dist/web/app/dashboard-text-panel.d.ts +12 -0
  167. package/dist/web/app/dashboard-text-panel.js +163 -0
  168. package/dist/web/app/dashboard-text.d.ts +2 -0
  169. package/dist/web/app/dashboard-text.js +1 -1
  170. package/dist/web/app/dashboard-visibility.js +1 -1
  171. package/dist/web/app/relative-time.js +2 -1
  172. package/dist/web/editor/editor-footer.d.ts +28 -0
  173. package/dist/web/editor/editor-footer.js +23 -0
  174. package/dist/web/editor/editor-frame.d.ts +23 -0
  175. package/dist/web/editor/editor-frame.js +24 -0
  176. package/dist/web/editor/editor-header.d.ts +36 -0
  177. package/dist/web/editor/editor-header.js +30 -0
  178. package/dist/web/editor/editor-rail.d.ts +32 -0
  179. package/dist/web/editor/editor-rail.js +37 -0
  180. package/dist/web/editor/editor-workbench.d.ts +34 -0
  181. package/dist/web/editor/editor-workbench.js +19 -0
  182. package/dist/web/editor/index.d.ts +6 -0
  183. package/dist/web/editor/index.js +6 -0
  184. package/dist/web/editor/relative-when.d.ts +1 -0
  185. package/dist/web/editor/relative-when.js +18 -0
  186. package/dist/web/index.d.ts +7 -1
  187. package/dist/web/index.js +5 -1
  188. package/dist/web/layout/default-app-shell.js +6 -4
  189. package/dist/web/layout/focus-aware-sidebar.d.ts +4 -7
  190. package/dist/web/layout/focus-aware-sidebar.js +5 -7
  191. package/dist/web/layout/header-action-pinned.d.ts +8 -0
  192. package/dist/web/layout/header-action-pinned.js +25 -0
  193. package/dist/web/layout/nav-collapse-state.d.ts +5 -0
  194. package/dist/web/layout/nav-collapse-state.js +66 -0
  195. package/dist/web/layout/nav-tree.js +25 -5
  196. package/dist/web/layout/page-header-slot.d.ts +2 -0
  197. package/dist/web/layout/page-header-slot.js +4 -0
  198. package/dist/web/layout/screen-focus.d.ts +8 -0
  199. package/dist/web/layout/screen-focus.js +42 -0
  200. package/dist/web/layout/shell-focus.d.ts +6 -5
  201. package/dist/web/layout/shell-focus.js +12 -9
  202. package/dist/web/layout/shell-header.js +38 -10
  203. package/dist/web/layout/sidebar-open-state.d.ts +6 -0
  204. package/dist/web/layout/sidebar-open-state.js +28 -0
  205. package/dist/web/layout/uniform-bar-controls.d.ts +2 -2
  206. package/dist/web/layout/uniform-bar-controls.js +4 -3
  207. package/dist/web/layout/use-in-app-inbox.js +8 -1
  208. package/dist/web/layout/workspace-shell.js +6 -4
  209. package/dist/web/lib/upload-file-ref.d.ts +2 -2
  210. package/dist/web/lib/upload-file-ref.js +4 -9
  211. package/dist/web/presence/use-presence.js +7 -2
  212. package/dist/web/primitives/banner.d.ts +1 -1
  213. package/dist/web/primitives/banner.js +14 -6
  214. package/dist/web/primitives/calendar-day-picker.js +24 -5
  215. package/dist/web/primitives/card.js +1 -1
  216. package/dist/web/primitives/code-input.js +6 -1
  217. package/dist/web/primitives/data-table/actions-column.d.ts +1 -0
  218. package/dist/web/primitives/data-table/actions-column.js +4 -2
  219. package/dist/web/primitives/data-table/card-body.d.ts +5 -0
  220. package/dist/web/primitives/data-table/card-body.js +47 -5
  221. package/dist/web/primitives/data-table/card-frame.d.ts +8 -0
  222. package/dist/web/primitives/data-table/card-frame.js +9 -0
  223. package/dist/web/primitives/data-table/card-row.js +40 -7
  224. package/dist/web/primitives/data-table/card-sort-select.d.ts +6 -2
  225. package/dist/web/primitives/data-table/card-sort-select.js +10 -7
  226. package/dist/web/primitives/data-table/card-view.js +12 -2
  227. package/dist/web/primitives/data-table/column-picker-section.js +9 -2
  228. package/dist/web/primitives/data-table/column-resize-handle.js +3 -4
  229. package/dist/web/primitives/data-table/column-role.d.ts +1 -0
  230. package/dist/web/primitives/data-table/column-role.js +1 -0
  231. package/dist/web/primitives/data-table/data-cell-props.d.ts +5 -0
  232. package/dist/web/primitives/data-table/data-cell-props.js +5 -0
  233. package/dist/web/primitives/data-table/density.js +1 -0
  234. package/dist/web/primitives/data-table/facet-cluster.d.ts +2 -1
  235. package/dist/web/primitives/data-table/facet-cluster.js +2 -2
  236. package/dist/web/primitives/data-table/group-band.js +4 -0
  237. package/dist/web/primitives/data-table/hint-cell.d.ts +16 -0
  238. package/dist/web/primitives/data-table/hint-cell.js +74 -0
  239. package/dist/web/primitives/data-table/hint-column-width.d.ts +3 -0
  240. package/dist/web/primitives/data-table/hint-column-width.js +11 -0
  241. package/dist/web/primitives/data-table/measure-value.js +2 -3
  242. package/dist/web/primitives/data-table/row-action-column.d.ts +3 -0
  243. package/dist/web/primitives/data-table/row-action-column.js +4 -0
  244. package/dist/web/primitives/data-table/sort-options-select.d.ts +22 -0
  245. package/dist/web/primitives/data-table/sort-options-select.js +46 -0
  246. package/dist/web/primitives/data-table/sortable-header.d.ts +3 -1
  247. package/dist/web/primitives/data-table/sortable-header.js +5 -3
  248. package/dist/web/primitives/data-table/table-body.d.ts +1 -1
  249. package/dist/web/primitives/data-table/table-body.js +5 -3
  250. package/dist/web/primitives/data-table/table-chrome.js +3 -1
  251. package/dist/web/primitives/data-table/table-content.js +10 -5
  252. package/dist/web/primitives/data-table/table-data-cell.js +9 -3
  253. package/dist/web/primitives/data-table/table-header-row.js +5 -2
  254. package/dist/web/primitives/data-table/table-view.js +17 -3
  255. package/dist/web/primitives/data-table/toolbar-end-cluster.js +1 -1
  256. package/dist/web/primitives/data-table/toolbar.js +31 -3
  257. package/dist/web/primitives/data-table/totals-footer.d.ts +20 -0
  258. package/dist/web/primitives/data-table/totals-footer.js +40 -9
  259. package/dist/web/primitives/data-table/use-bulk-selection.js +2 -1
  260. package/dist/web/primitives/data-table/use-column-pins.js +4 -0
  261. package/dist/web/primitives/data-table/use-data-table-state.d.ts +1 -0
  262. package/dist/web/primitives/data-table/use-data-table-state.js +9 -5
  263. package/dist/web/primitives/data-table/use-measured-column-widths.js +5 -4
  264. package/dist/web/primitives/data-table/use-row-selection.js +22 -11
  265. package/dist/web/primitives/data-table/view-menu.js +7 -1
  266. package/dist/web/primitives/data-table-cell.d.ts +21 -2
  267. package/dist/web/primitives/data-table-cell.js +96 -19
  268. package/dist/web/primitives/embedded-file-cell.js +3 -2
  269. package/dist/web/primitives/embedded-list-cards.js +3 -4
  270. package/dist/web/primitives/facet-filter.d.ts +4 -2
  271. package/dist/web/primitives/facet-filter.js +26 -3
  272. package/dist/web/primitives/facet-search-filter.js +1 -1
  273. package/dist/web/primitives/file-thumbnail.d.ts +6 -2
  274. package/dist/web/primitives/file-thumbnail.js +13 -6
  275. package/dist/web/primitives/file-upload.js +3 -2
  276. package/dist/web/primitives/file-view-action.d.ts +6 -0
  277. package/dist/web/primitives/file-view-action.js +19 -0
  278. package/dist/web/primitives/files-dropzone.js +20 -9
  279. package/dist/web/primitives/form-footer-parts.d.ts +0 -1
  280. package/dist/web/primitives/form.js +0 -1
  281. package/dist/web/primitives/hint-reason-row.d.ts +32 -0
  282. package/dist/web/primitives/hint-reason-row.js +45 -0
  283. package/dist/web/primitives/index.js +6 -0
  284. package/dist/web/primitives/layout-elements.d.ts +1 -1
  285. package/dist/web/primitives/layout-elements.js +2 -2
  286. package/dist/web/primitives/metric.js +8 -6
  287. package/dist/web/primitives/page-header.d.ts +1 -1
  288. package/dist/web/primitives/page-header.js +8 -1
  289. package/dist/web/primitives/pager.js +29 -18
  290. package/dist/web/primitives/reason-box.d.ts +20 -0
  291. package/dist/web/primitives/reason-box.js +13 -0
  292. package/dist/web/primitives/record-breadcrumb.d.ts +3 -0
  293. package/dist/web/primitives/record-breadcrumb.js +11 -0
  294. package/dist/web/primitives/record-steps.d.ts +3 -0
  295. package/dist/web/primitives/record-steps.js +45 -0
  296. package/dist/web/primitives/record-summary.d.ts +3 -0
  297. package/dist/web/primitives/record-summary.js +18 -0
  298. package/dist/web/primitives/row-actions.d.ts +3 -1
  299. package/dist/web/primitives/row-actions.js +14 -5
  300. package/dist/web/primitives/segmented-select.js +5 -7
  301. package/dist/web/pwa/pwa-support.d.ts +4 -0
  302. package/dist/web/pwa/pwa-support.js +113 -0
  303. package/dist/web/sse/live-events.js +2 -2
  304. package/dist/web/tokens.js +0 -3
  305. package/dist/web/widgets/chart-parts.d.ts +7 -1
  306. package/dist/web/widgets/chart-parts.js +10 -4
  307. package/dist/web/widgets/collapsible-section.js +1 -1
  308. package/dist/web/widgets/dashboard-list-cards.d.ts +17 -0
  309. package/dist/web/widgets/dashboard-list-cards.js +54 -0
  310. package/dist/web/widgets/dashboard-list.d.ts +37 -5
  311. package/dist/web/widgets/dashboard-list.js +95 -20
  312. package/dist/web/widgets/drawer-sizing.js +1 -1
  313. package/dist/web/widgets/floating-panel.js +4 -2
  314. package/dist/web/widgets/index.d.ts +2 -0
  315. package/dist/web/widgets/index.js +2 -0
  316. package/dist/web/widgets/infinity-list.js +18 -11
  317. package/dist/web/widgets/preview-width-frame.d.ts +7 -0
  318. package/dist/web/widgets/preview-width-frame.js +10 -0
  319. package/dist/web/widgets/section-card.d.ts +1 -1
  320. package/dist/web/widgets/stacked-area-chrome.js +3 -3
  321. package/dist/web/widgets/stacked-area-tooltip.js +2 -10
  322. package/dist/web/widgets/stat-box-cell.d.ts +19 -0
  323. package/dist/web/widgets/stat-box-cell.js +10 -0
  324. package/dist/web/widgets/stat.d.ts +10 -1
  325. package/dist/web/widgets/stat.js +14 -5
  326. package/dist/web/widgets/status-badge.d.ts +7 -5
  327. package/dist/web/widgets/status-badge.js +2 -2
  328. package/dist/web/widgets/step-bar.d.ts +1 -1
  329. package/dist/web/widgets/step-bar.js +37 -7
  330. package/dist/web/widgets/upload-zone.d.ts +8 -1
  331. package/dist/web/widgets/upload-zone.js +13 -3
  332. package/package.json +5 -5
  333. package/src/changes.json +217 -0
  334. package/src/web/styles.css +9 -0
@@ -0,0 +1,32 @@
1
+ import { type ReactNode } from "react";
2
+ import type { ListColumnHintViewModel } from "../../headless/index.ts";
3
+ export type HintReasonRowControl = {
4
+ readonly hint: ListColumnHintViewModel;
5
+ readonly open: boolean;
6
+ readonly onToggle: () => void;
7
+ readonly boxId: string;
8
+ };
9
+ /**
10
+ * Set when the row of `hint` owns the reason state, because it draws the box as a row of its own.
11
+ * The match is by object identity: the scope and the cell must both take `hint` from the same
12
+ * `m.columns` entry, so a copy such as `cardHint` deliberately does not match.
13
+ */
14
+ export declare function useHintReasonRowControl(hint: ListColumnHintViewModel): HintReasonRowControl | undefined;
15
+ export declare function nonEmptyText(value: unknown): string | undefined;
16
+ export type HintReason = {
17
+ readonly text: string;
18
+ readonly title: string | undefined;
19
+ };
20
+ export declare function hintReasonOf(hint: ListColumnHintViewModel, row: Readonly<Record<string, unknown>>): HintReason | undefined;
21
+ export declare function isReasonOpenByDefault(hint: ListColumnHintViewModel, row: Readonly<Record<string, unknown>>): boolean;
22
+ /**
23
+ * Keeps the open state of a row's reason and draws the box as a row below the row, over its full
24
+ * width. Without a `hint` it only renders its children, so the row does not remount when a reason
25
+ * appears or disappears. The default-open state counts at the first render only, and not below sm.
26
+ */
27
+ export declare function HintReasonRowScope({ hint, row, renderBoxRow, children, }: {
28
+ readonly hint: ListColumnHintViewModel | undefined;
29
+ readonly row: Readonly<Record<string, unknown>>;
30
+ readonly renderBoxRow: (box: ReactNode) => ReactNode;
31
+ readonly children: ReactNode;
32
+ }): ReactNode;
@@ -0,0 +1,45 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { createContext, useContext, useId, useState } from "react";
3
+ import { ReasonBox } from "./reason-box.js";
4
+ import { useIsBelowSmViewport } from "./use-narrow-viewport.js";
5
+ const HintReasonRowContext = createContext(undefined);
6
+ /**
7
+ * Set when the row of `hint` owns the reason state, because it draws the box as a row of its own.
8
+ * The match is by object identity: the scope and the cell must both take `hint` from the same
9
+ * `m.columns` entry, so a copy such as `cardHint` deliberately does not match.
10
+ */
11
+ export function useHintReasonRowControl(hint) {
12
+ const control = useContext(HintReasonRowContext);
13
+ return control?.hint === hint ? control : undefined;
14
+ }
15
+ export function nonEmptyText(value) {
16
+ if (typeof value !== "string")
17
+ return undefined;
18
+ const trimmed = value.trim();
19
+ return trimmed === "" ? undefined : trimmed;
20
+ }
21
+ export function hintReasonOf(hint, row) {
22
+ const text = hint.reasonField === undefined ? undefined : nonEmptyText(row[hint.reasonField]);
23
+ if (text === undefined)
24
+ return undefined;
25
+ const title = hint.reasonTitleField === undefined ? undefined : nonEmptyText(row[hint.reasonTitleField]);
26
+ return { text, title };
27
+ }
28
+ export function isReasonOpenByDefault(hint, row) {
29
+ return hint.reasonOpenField !== undefined && row[hint.reasonOpenField] === true;
30
+ }
31
+ /**
32
+ * Keeps the open state of a row's reason and draws the box as a row below the row, over its full
33
+ * width. Without a `hint` it only renders its children, so the row does not remount when a reason
34
+ * appears or disappears. The default-open state counts at the first render only, and not below sm.
35
+ */
36
+ export function HintReasonRowScope({ hint, row, renderBoxRow, children, }) {
37
+ const belowSm = useIsBelowSmViewport();
38
+ const boxId = useId();
39
+ const [open, setOpen] = useState(() => hint !== undefined && !belowSm && isReasonOpenByDefault(hint, row));
40
+ const reason = hint === undefined ? undefined : hintReasonOf(hint, row);
41
+ const control = hint === undefined ? undefined : { hint, open, onToggle: () => setOpen((was) => !was), boxId };
42
+ return (_jsxs(HintReasonRowContext.Provider, { value: control, children: [children, open &&
43
+ reason !== undefined &&
44
+ renderBoxRow(_jsx(ReasonBox, { id: boxId, "data-hint-reason": "true", ...(reason.title !== undefined && { title: reason.title }), children: reason.text }))] }));
45
+ }
@@ -16,6 +16,9 @@ import { DefaultMetric, DefaultMetricBand } from "./metric.js";
16
16
  import { DefaultModal } from "./modal.js";
17
17
  import { DefaultPageHeader } from "./page-header.js";
18
18
  import { PromoPanel } from "./promo-panel.js";
19
+ import { DefaultRecordBreadcrumb } from "./record-breadcrumb.js";
20
+ import { DefaultRecordSteps } from "./record-steps.js";
21
+ import { DefaultRecordSummary } from "./record-summary.js";
19
22
  import { CopyButton, ShareButton } from "./share-actions.js";
20
23
  import { DefaultStatusBadge } from "./status-badge.js";
21
24
  import { StickyActionBar } from "./sticky-action-bar.js";
@@ -68,6 +71,9 @@ export const defaultPrimitives = {
68
71
  StatusBadge: DefaultStatusBadge,
69
72
  Metric: DefaultMetric,
70
73
  MetricBand: DefaultMetricBand,
74
+ RecordBreadcrumb: DefaultRecordBreadcrumb,
75
+ RecordSummary: DefaultRecordSummary,
76
+ RecordSteps: DefaultRecordSteps,
71
77
  PageHeader: DefaultPageHeader,
72
78
  JsonView: DefaultJsonView,
73
79
  FileValueList,
@@ -2,7 +2,7 @@ import { type MouseEvent, type ReactNode } from "react";
2
2
  import type { FillContainerProps, GridCellProps, GridProps, HeadingProps, LinkProps, ProgressProps, SectionProps, StepBarProps, TextProps, WizardStepGroupProps } from "../../index.ts";
3
3
  import "../react-css-custom-properties.ts";
4
4
  export declare function DefaultSection({ id, title, subtitle, subtitleBelowLgOnly, children, actions, variant, layout, testId, icon, }: SectionProps): ReactNode;
5
- export declare function DefaultFillContainer({ children, testId, grow }: FillContainerProps): ReactNode;
5
+ export declare function DefaultFillContainer({ children, testId, grow, className, }: FillContainerProps): ReactNode;
6
6
  export declare function DefaultGrid({ columns, children, testId, maxRows, flow, list, ariaLabelledBy, }: GridProps): ReactNode;
7
7
  export declare function DefaultGridCell({ span, width, children }: GridCellProps): ReactNode;
8
8
  export declare function DefaultText({ variant, decorative, children, testId, }: TextProps): ReactNode;
@@ -45,11 +45,11 @@ export function DefaultSection({ id, title, subtitle, subtitleBelowLgOnly, child
45
45
  // non-portaled overlay.
46
46
  return (_jsx("div", { "data-slot": "card", "data-testid": testId, className: cn(cardSurface(), "overflow-hidden", variant === "destructive" && "border-destructive/40"), children: _jsxs("div", { className: "flex flex-col gap-4 px-6 py-6", children: [header, children] }) }));
47
47
  }
48
- export function DefaultFillContainer({ children, testId, grow }) {
48
+ export function DefaultFillContainer({ children, testId, grow, className, }) {
49
49
  // flex-1 only on request (`grow`, set under fillScreenHeight): without it the
50
50
  // container sizes to its content and only shrinks (min-h-0), so a two-row
51
51
  // table in a non-fixed-height screen does not stretch.
52
- return (_jsx("div", { "data-testid": testId, className: cn("flex min-h-0 flex-col", grow === true && "flex-1"), children: children }));
52
+ return (_jsx("div", { "data-testid": testId, className: cn("flex min-h-0 flex-col", grow === true && "flex-1", className), children: children }));
53
53
  }
54
54
  const DRAWER_FIELD_CELL_WIDTH_CLASS = {
55
55
  money: "w-full sm:w-[200px] [&_label]:whitespace-nowrap",
@@ -2,7 +2,9 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Children, createContext, useContext } from "react";
3
3
  import { Icon } from "../icons.js";
4
4
  import { cn } from "../lib/cn.js";
5
- import { STAT_CARD_GRID_CLASSES, StatCard } from "../widgets/stat.js";
5
+ import { StatCard } from "../widgets/stat.js";
6
+ // Two tiles per row on phones, then the dashboard stat-group fill.
7
+ const METRIC_TILE_GRID_CLASSES = "grid grid-cols-2 gap-3 md:grid-cols-[repeat(auto-fit,minmax(min(12rem,100%),1fr))]";
6
8
  const InsideMetricBandContext = createContext(false);
7
9
  // The screen-form column already insets and spaces its children; a band in its
8
10
  // header region must not add its own padding on top. DefaultCard resets this
@@ -13,17 +15,17 @@ export function DefaultMetricBand({ lead, subtitle, children, testId, tiles, })
13
15
  const insideScreenFormColumn = useContext(InsideScreenFormColumnContext);
14
16
  const hasMetrics = Children.toArray(children).length > 0;
15
17
  return (_jsxs("div", { className: cn("flex shrink-0 flex-col gap-3", !insideScreenFormColumn && "px-6 pb-4 pt-3.5"), "data-testid": testId, children: [lead !== undefined && _jsx("div", { "data-kumiko-layout": "metric-band-lead", children: lead }), subtitle !== undefined && (_jsx("div", { className: "flex flex-wrap items-center gap-x-2 text-[13px] text-foreground-secondary [&_a]:text-primary", children: subtitle })), hasMetrics &&
16
- (tiles === true ? (_jsx("div", { className: STAT_CARD_GRID_CLASSES, children: children })) : (_jsx(InsideMetricBandContext.Provider, { value: true, children: _jsx("dl", { className: "m-0 grid grid-cols-2 gap-6 md:grid-cols-3 lg:grid-cols-5", children: children }) })))] }));
18
+ (tiles === true ? (_jsx("div", { className: METRIC_TILE_GRID_CLASSES, children: children })) : (_jsx(InsideMetricBandContext.Provider, { value: true, children: _jsx("dl", { className: "m-0 grid grid-cols-2 gap-6 md:grid-cols-3 lg:grid-cols-5", children: children }) })))] }));
17
19
  }
18
- function MetricTile({ label, value, testId, onPress, tone, icon }) {
19
- const card = (_jsx(StatCard, { label: label, value: value, ...(icon !== undefined && { icon: _jsx(Icon, { name: icon, className: "size-4" }) }), ...(tone !== undefined && { tone }), ...(testId !== undefined && { testId }) }));
20
+ function MetricTile({ label, value, testId, onPress, tone, icon, sub }) {
21
+ const card = (_jsx(StatCard, { label: label, value: value, ...(sub !== undefined && { sub }), ...(onPress !== undefined && { navigable: true }), ...(icon !== undefined && { icon: _jsx(Icon, { name: icon, className: "size-4" }) }), ...(tone !== undefined && { tone }), ...(testId !== undefined && { testId }) }));
20
22
  return onPress !== undefined ? (_jsx("button", { type: "button", className: "text-left", onClick: onPress, children: card })) : (card);
21
23
  }
22
24
  export function DefaultMetric(props) {
23
25
  const insideBand = useContext(InsideMetricBandContext);
24
26
  if (props.tile === true)
25
27
  return _jsx(MetricTile, { ...props });
26
- const { label, value, testId, onPress } = props;
27
- const item = (_jsxs("div", { "data-testid": testId, className: cn("flex min-w-0 flex-col gap-0.5", onPress !== undefined && "cursor-pointer"), ...(onPress !== undefined && { onClick: onPress }), children: [_jsx("dt", { className: "text-xs text-muted-foreground", "data-testid": testId !== undefined ? `${testId}-label` : undefined, children: label }), _jsx("dd", { className: "m-0 text-base font-medium tabular-nums text-foreground", "data-testid": testId !== undefined ? `${testId}-value` : undefined, children: onPress !== undefined ? (_jsx("button", { type: "button", className: "text-left hover:underline", children: value })) : (value) })] }));
28
+ const { label, value, testId, onPress, sub } = props;
29
+ const item = (_jsxs("div", { "data-testid": testId, className: cn("flex min-w-0 flex-col gap-0.5", onPress !== undefined && "cursor-pointer"), ...(onPress !== undefined && { onClick: onPress }), children: [_jsx("dt", { className: "text-xs text-muted-foreground", "data-testid": testId !== undefined ? `${testId}-label` : undefined, children: label }), _jsxs("dd", { className: "m-0 text-base font-medium tabular-nums text-foreground", "data-testid": testId !== undefined ? `${testId}-value` : undefined, children: [onPress !== undefined ? (_jsx("button", { type: "button", className: "text-left hover:underline", children: value })) : (value), sub !== undefined && (_jsx("span", { className: "block text-xs font-normal text-muted-foreground", "data-testid": testId !== undefined ? `${testId}-sub` : undefined, children: sub }))] })] }));
28
30
  return insideBand ? item : _jsx("dl", { className: "m-0", children: item });
29
31
  }
@@ -1,3 +1,3 @@
1
1
  import { type ReactNode } from "react";
2
2
  import type { PageHeaderProps } from "../../index.ts";
3
- export declare function DefaultPageHeader({ title, recordTitle, status, actions, overflowItems, hideBreadcrumb, breadcrumbScreenId, }: PageHeaderProps): ReactNode;
3
+ export declare function DefaultPageHeader({ title, recordTitle, status, actions, bodyTitle, overflowItems, hideBreadcrumb, breadcrumbScreenId, }: PageHeaderProps): ReactNode;
@@ -4,11 +4,12 @@ import { createPortal } from "react-dom";
4
4
  import { usePageHeaderSlot } from "../layout/page-header-slot.js";
5
5
  import { UNIFORM_BAR_CONTROLS_CLASSES } from "../layout/uniform-bar-controls.js";
6
6
  import { cn } from "../lib/cn.js";
7
- export function DefaultPageHeader({ title, recordTitle, status, actions, overflowItems, hideBreadcrumb, breadcrumbScreenId, }) {
7
+ export function DefaultPageHeader({ title, recordTitle, status, actions, bodyTitle, overflowItems, hideBreadcrumb, breadcrumbScreenId, }) {
8
8
  const slot = usePageHeaderSlot();
9
9
  const setOverflowItems = slot?.setOverflowItems;
10
10
  const setTitle = slot?.setTitle;
11
11
  const setRecordTitle = slot?.setRecordTitle;
12
+ const setBodyTitle = slot?.setBodyTitle;
12
13
  const setBreadcrumbHidden = slot?.setBreadcrumbHidden;
13
14
  const setBreadcrumbScreenId = slot?.setBreadcrumbScreenId;
14
15
  useEffect(() => {
@@ -23,6 +24,12 @@ export function DefaultPageHeader({ title, recordTitle, status, actions, overflo
23
24
  setBreadcrumbScreenId(breadcrumbScreenId);
24
25
  return () => setBreadcrumbScreenId(undefined);
25
26
  }, [setBreadcrumbScreenId, breadcrumbScreenId]);
27
+ useEffect(() => {
28
+ if (setBodyTitle === undefined || bodyTitle !== true)
29
+ return;
30
+ setBodyTitle(true);
31
+ return () => setBodyTitle(false);
32
+ }, [setBodyTitle, bodyTitle]);
26
33
  useEffect(() => {
27
34
  if (setRecordTitle === undefined || recordTitle === undefined)
28
35
  return;
@@ -52,8 +52,8 @@ export function InfiniteSentinel({ onReachEnd, loadingMore, hasMore, rowsCount,
52
52
  const showEndLabel = !hasMore && rowsCount >= END_LABEL_MIN_ROWS;
53
53
  return (_jsx("div", { ref: ref, "data-testid": testId, className: cn("flex items-center justify-center text-sm text-muted-foreground", showEndLabel || loadingMore ? "py-4" : ""), children: showEndLabel ? (_jsx("span", { "data-testid": testId !== undefined ? `${testId}-end` : undefined, children: t("kumiko.list.end-of-list") })) : loadingMore ? (_jsx(Loader2, { className: "size-4 animate-spin", "aria-hidden": "true" })) : hasMore ? (_jsx("span", { "aria-hidden": "true", children: "\u00A0" })) : null }));
54
54
  }
55
- // Pager — status text on the left ("X – Y of Z"), "Page X of Y" and the
56
- // prev/next arrows on the right. No numbered page list: the board shows none.
55
+ // Pager — left "X – Y of Z · N per page" (the page size is a select in text
56
+ // style), right "‹ 1 2 3 ›" from sm; below sm only the arrows.
57
57
  // `pinned` renders the footer bar of a scrollBody table (fixed height, top
58
58
  // border); unpinned it sits as a plain row below the table.
59
59
  //
@@ -68,22 +68,33 @@ export function Pager({ page, limit, total, onPageChange, pageSizeOptions, onPag
68
68
  const to = Math.min(safePage * limit, total);
69
69
  return (_jsxs("div", { "data-testid": testId, className: pinned === true
70
70
  ? TABLE_FOOTER_BAR_CLASS
71
- : "mt-3 flex items-center gap-4 text-[13px] tabular-nums text-foreground-secondary", children: [_jsx("div", { "data-testid": testId !== undefined ? `${testId}-status` : undefined, className: "flex-1", children: itemNoun !== undefined
72
- ? t("kumiko.pager.status.noun", {
73
- from: from.toLocaleString(),
74
- to: to.toLocaleString(),
75
- total: total.toLocaleString(),
76
- noun: itemNoun(total),
77
- })
78
- : t("kumiko.pager.status", {
79
- from: from.toLocaleString(),
80
- to: to.toLocaleString(),
81
- total: total.toLocaleString(),
82
- }) }), pageSizeOptions !== undefined && onPageSizeChange !== undefined && (_jsxs("div", { className: "relative hidden md:block", children: [_jsx("select", { "aria-label": t("kumiko.pager.pageSizeLabel"), "data-testid": testId !== undefined ? `${testId}-page-size` : undefined, value: limit, onChange: (e) => onPageSizeChange(Number(e.target.value)), className: "h-7 appearance-none rounded-md border border-input bg-card pl-2 pr-7 text-[13px] text-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring", children: pageSizeOptions.map((size) => (_jsx("option", { value: size, children: t("kumiko.pager.pageSize", { size: size.toLocaleString() }) }, size))) }), _jsx(ChevronDown, { className: "pointer-events-none absolute right-2 top-1/2 size-4 -translate-y-1/2 opacity-50", "aria-hidden": "true" })] })), _jsx("div", { className: "hidden md:block", children: t("kumiko.pager.pageOf", {
83
- page: safePage.toLocaleString(),
84
- pages: totalPages.toLocaleString(),
85
- }) }), _jsxs("div", { className: "flex items-center gap-2", children: [_jsx(PagerButton, { ariaLabel: t("kumiko.pager.previousPage"), disabled: safePage <= 1, onClick: () => onPageChange(safePage - 1), testId: testId !== undefined ? `${testId}-prev` : undefined, children: _jsx(ChevronLeft, { className: "size-3.5", "aria-hidden": "true" }) }), _jsx(PagerButton, { ariaLabel: t("kumiko.pager.nextPage"), disabled: safePage >= totalPages, onClick: () => onPageChange(safePage + 1), testId: testId !== undefined ? `${testId}-next` : undefined, children: _jsx(ChevronRight, { className: "size-3.5", "aria-hidden": "true" }) })] })] }));
71
+ : "mt-3 flex items-center gap-4 text-[13px] tabular-nums text-foreground-secondary", children: [_jsxs("div", { className: "flex min-w-0 flex-1 items-center gap-1", children: [_jsx("div", { "data-testid": testId !== undefined ? `${testId}-status` : undefined, children: itemNoun !== undefined
72
+ ? t("kumiko.pager.status.noun", {
73
+ from: from.toLocaleString(),
74
+ to: to.toLocaleString(),
75
+ total: total.toLocaleString(),
76
+ noun: itemNoun(total),
77
+ })
78
+ : t("kumiko.pager.status", {
79
+ from: from.toLocaleString(),
80
+ to: to.toLocaleString(),
81
+ total: total.toLocaleString(),
82
+ }) }), pageSizeOptions !== undefined && onPageSizeChange !== undefined && (_jsxs("div", { className: "relative hidden items-center sm:flex", children: [_jsx("span", { "aria-hidden": "true", children: "\u00B7" }), _jsx("select", { "aria-label": t("kumiko.pager.pageSizeLabel"), "data-testid": testId !== undefined ? `${testId}-page-size` : undefined, value: limit, onChange: (e) => onPageSizeChange(Number(e.target.value)), className: "h-7 cursor-pointer appearance-none rounded-md border-0 bg-transparent pl-1.5 pr-5 text-[13px] text-foreground-secondary hover:text-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring", children: pageSizeOptions.map((size) => (_jsx("option", { value: size, children: t("kumiko.pager.pageSize", { size: size.toLocaleString() }) }, size))) }), _jsx(ChevronDown, { className: "pointer-events-none absolute right-0.5 top-1/2 size-3.5 -translate-y-1/2 opacity-50", "aria-hidden": "true" })] }))] }), _jsxs("div", { className: "flex items-center gap-1", children: [_jsx(PagerButton, { ariaLabel: t("kumiko.pager.previousPage"), disabled: safePage <= 1, onClick: () => onPageChange(safePage - 1), testId: testId !== undefined ? `${testId}-prev` : undefined, children: _jsx(ChevronLeft, { className: "size-3.5", "aria-hidden": "true" }) }), _jsx("div", { className: "hidden items-center gap-1 sm:flex", children: pageNumbersAround(safePage, totalPages).map((entry) => typeof entry !== "number" ? (_jsx("span", { "aria-hidden": "true", className: "px-1", children: "\u2026" }, `gap-${entry.gapBefore}`)) : (_jsx(PageNumberButton, { page: entry, current: entry === safePage, label: t("kumiko.pager.goToPage", { page: entry.toLocaleString() }), onClick: () => onPageChange(entry), testId: testId !== undefined ? `${testId}-page-${entry}` : undefined }, entry))) }), _jsx(PagerButton, { ariaLabel: t("kumiko.pager.nextPage"), disabled: safePage >= totalPages, onClick: () => onPageChange(safePage + 1), testId: testId !== undefined ? `${testId}-next` : undefined, children: _jsx(ChevronRight, { className: "size-3.5", "aria-hidden": "true" }) })] })] }));
83
+ }
84
+ // All pages up to 7, else first, last and the neighbours of the current page, gaps in between.
85
+ function pageNumbersAround(current, totalPages) {
86
+ if (totalPages <= 7)
87
+ return Array.from({ length: totalPages }, (_, i) => i + 1);
88
+ const wanted = new Set([1, current - 1, current, current + 1, totalPages]);
89
+ const pages = [...wanted].filter((page) => page >= 1 && page <= totalPages).sort((a, b) => a - b);
90
+ return pages.flatMap((page, index) => {
91
+ const previous = pages[index - 1];
92
+ return previous !== undefined && page - previous > 1 ? [{ gapBefore: page }, page] : [page];
93
+ });
94
+ }
95
+ function PageNumberButton({ page, current, label, onClick, testId, }) {
96
+ return (_jsx("button", { type: "button", onClick: onClick, "aria-label": label, "aria-current": current ? "page" : undefined, "data-testid": testId, className: cn("inline-flex h-7 min-w-7 items-center justify-center rounded-md px-1.5", "hover:bg-muted focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring", current && "bg-muted font-semibold text-foreground"), children: page.toLocaleString() }));
86
97
  }
87
98
  function PagerButton({ children, onClick, ariaLabel, disabled, testId, }) {
88
- return (_jsx("button", { type: "button", onClick: onClick, disabled: disabled, "aria-label": ariaLabel, "data-testid": testId, className: cn("inline-flex size-11 items-center justify-center rounded-md border border-border md:size-7", "hover:bg-muted focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring", "disabled:pointer-events-none disabled:text-foreground-disabled"), children: children }));
99
+ return (_jsx("button", { type: "button", onClick: onClick, disabled: disabled, "aria-label": ariaLabel, "data-testid": testId, className: cn("inline-flex size-11 items-center justify-center rounded-md border border-border sm:size-7", "hover:bg-muted focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring", "disabled:pointer-events-none disabled:text-foreground-disabled"), children: children }));
89
100
  }
@@ -0,0 +1,20 @@
1
+ import type { ReactNode } from "react";
2
+ /** The opened "why" of a hint or step: a dark note box with a small arrow at the top left, so it reads as a note on top of the row tint. */
3
+ export declare function ReasonBox({ children, title, testId, id, ...dataAttributes }: {
4
+ readonly children: ReactNode;
5
+ /** Bold lead-in of the paragraph. */
6
+ readonly title?: string;
7
+ readonly testId?: string;
8
+ /** Target of the info button's `aria-controls`. */
9
+ readonly id?: string;
10
+ readonly "data-hint-reason"?: "true";
11
+ }): ReactNode;
12
+ /** Info icon that opens a ReasonBox; sits next to a title and never opens a clickable row around it. */
13
+ export declare function ReasonInfoButton({ label, open, onToggle, controls, ...dataAttributes }: {
14
+ readonly label: string;
15
+ readonly open: boolean;
16
+ readonly onToggle: () => void;
17
+ /** Id of the box this button opens; only referenced while open. */
18
+ readonly controls?: string;
19
+ readonly "data-hint-reason-toggle"?: "true";
20
+ }): ReactNode;
@@ -0,0 +1,13 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Info } from "lucide-react";
3
+ /** The opened "why" of a hint or step: a dark note box with a small arrow at the top left, so it reads as a note on top of the row tint. */
4
+ export function ReasonBox({ children, title, testId, id, ...dataAttributes }) {
5
+ return (_jsxs("span", { "data-testid": testId, id: id, ...dataAttributes, className: "relative mt-1 block rounded-md bg-sidebar px-3 py-2.5 text-[12.5px] leading-[1.45] text-sidebar-foreground whitespace-pre-line before:absolute before:-top-[5px] before:left-[18px] before:border-[5px] before:border-t-0 before:border-transparent before:border-b-sidebar before:content-['']", children: [title !== undefined && _jsxs("b", { className: "font-semibold", children: [title, " "] }), children] }));
6
+ }
7
+ /** Info icon that opens a ReasonBox; sits next to a title and never opens a clickable row around it. */
8
+ export function ReasonInfoButton({ label, open, onToggle, controls, ...dataAttributes }) {
9
+ return (_jsx("button", { type: "button", "aria-expanded": open, "aria-controls": open ? controls : undefined, "aria-label": label, title: label, ...dataAttributes, className: "shrink-0 text-muted-foreground hover:text-foreground", onClick: (event) => {
10
+ event.stopPropagation();
11
+ onToggle();
12
+ }, children: _jsx(Info, { className: "size-4", "aria-hidden": "true" }) }));
13
+ }
@@ -0,0 +1,3 @@
1
+ import { type ReactNode } from "react";
2
+ import type { RecordBreadcrumbProps } from "../../index.ts";
3
+ export declare function DefaultRecordBreadcrumb({ items, ariaLabel, testId, }: RecordBreadcrumbProps): ReactNode;
@@ -0,0 +1,11 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Fragment, useContext } from "react";
3
+ import { uniqueLabelKeys } from "../../app/unique-label-keys.js";
4
+ import { cn } from "../lib/cn.js";
5
+ import { DefaultLink } from "./layout-elements.js";
6
+ import { InsideScreenFormColumnContext } from "./metric.js";
7
+ export function DefaultRecordBreadcrumb({ items, ariaLabel, testId, }) {
8
+ const insideScreenFormColumn = useContext(InsideScreenFormColumnContext);
9
+ const keys = uniqueLabelKeys(items.map((item) => item.label));
10
+ return (_jsx("nav", { "aria-label": ariaLabel, "data-testid": testId, className: cn("flex shrink-0 flex-wrap items-center gap-2 text-[13px] text-muted-foreground", !insideScreenFormColumn && "px-6 pt-3.5"), children: items.map((item, index) => (_jsxs(Fragment, { children: [index > 0 && _jsx("span", { "aria-hidden": "true", children: "\u203A" }), item.link !== undefined ? (_jsx(DefaultLink, { href: item.link.href, onPress: item.link.onPress, className: "text-foreground-secondary", children: item.label })) : (_jsx("span", { className: "font-medium text-foreground", children: item.label }))] }, keys[index]))) }));
11
+ }
@@ -0,0 +1,3 @@
1
+ import { type ReactNode } from "react";
2
+ import type { RecordStepsProps } from "../../index.ts";
3
+ export declare function DefaultRecordSteps({ title, subtitle, emptyLabel, reasonLabel, narrowLimit, moreLabel, lessLabel, items, count, testId, }: RecordStepsProps): ReactNode;
@@ -0,0 +1,45 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useContext, useId, useState } from "react";
3
+ import { cn } from "../lib/cn.js";
4
+ import { InsideScreenFormColumnContext } from "./metric.js";
5
+ import { ReasonBox, ReasonInfoButton } from "./reason-box.js";
6
+ import { useIsBelowSmViewport } from "./use-narrow-viewport.js";
7
+ const STEP_STRIPE_CLASS = {
8
+ bad: "bg-status-bad",
9
+ warn: "bg-status-warn",
10
+ critical: "bg-status-critical",
11
+ ok: "bg-status-ok",
12
+ accent: "bg-primary",
13
+ neutral: "bg-border-strong",
14
+ };
15
+ function StepDetail({ item }) {
16
+ const narrow = useIsBelowSmViewport();
17
+ const detail = narrow ? (item.narrowDetail ?? item.detail) : item.detail;
18
+ if (detail === undefined)
19
+ return null;
20
+ return _jsx("small", { className: "block text-xs text-muted-foreground", children: detail });
21
+ }
22
+ function StepRow({ item, reasonLabel }) {
23
+ const [reasonOpen, setReasonOpen] = useState(item.reasonOpen === true);
24
+ const reasonBoxId = useId();
25
+ return (_jsxs("li", { "data-testid": `record-step-${item.id}`, "data-tone": item.tone, className: "relative grid grid-cols-[minmax(0,1fr)_auto] gap-x-3 gap-y-1 py-3 pl-5 pr-4 max-sm:py-1.5 max-sm:pl-3.5 max-sm:pr-0", children: [_jsx("span", { "aria-hidden": "true", className: cn("absolute inset-y-2 left-0 w-1 rounded-full max-sm:inset-y-0 max-sm:w-[3px]", STEP_STRIPE_CLASS[item.tone ?? "neutral"]) }), _jsxs("div", { className: "col-start-1 row-start-1 flex min-w-0 items-start gap-2", children: [_jsx("span", { className: "font-medium text-foreground max-sm:text-sm", children: item.title }), item.reason !== undefined && (_jsx("span", { className: "flex max-sm:hidden", children: _jsx(ReasonInfoButton, { label: reasonLabel, open: reasonOpen, controls: reasonBoxId, onToggle: () => setReasonOpen((open) => !open) }) }))] }), _jsxs("div", { className: "col-start-2 row-start-1 flex shrink-0 items-center gap-3 max-sm:row-span-2 max-sm:self-center max-sm:[&_button]:h-8 max-sm:[&_button]:text-[13px]", children: [item.moreActions !== undefined && _jsx("div", { className: "max-sm:hidden", children: item.moreActions }), item.actions] }), _jsx("div", { className: "col-start-1 row-start-2 min-w-0 sm:col-span-2", children: _jsx(StepDetail, { item: item }) }), item.reason !== undefined && reasonOpen && (_jsx("div", { className: "col-span-2 row-start-3 max-sm:hidden", children: _jsx(ReasonBox, { id: reasonBoxId, testId: `record-step-${item.id}-reason`, ...(item.reasonTitle !== undefined && { title: item.reasonTitle }), children: item.reason }) }))] }));
26
+ }
27
+ function StepsHeader({ title, subtitle, count, testId, }) {
28
+ return (_jsxs("header", { className: "flex flex-wrap items-baseline gap-x-3 gap-y-1 px-4 py-3 sm:border-b max-sm:px-0 max-sm:pt-1", children: [_jsx("h3", { className: "m-0 text-sm font-semibold text-foreground", children: title }), subtitle !== undefined && (_jsx("span", { className: "text-[13px] text-muted-foreground max-sm:hidden", children: subtitle })), count !== undefined && (_jsx("span", { "data-testid": `${testId ?? "record-steps"}-count`, className: "ml-auto text-xs text-muted-foreground sm:hidden", children: count }))] }));
29
+ }
30
+ function StepsMoreToggle({ testId, expanded, label, onToggle, }) {
31
+ return (_jsxs("button", { type: "button", "data-testid": `${testId ?? "record-steps"}-toggle`, "aria-expanded": expanded, className: "relative w-full border-t px-4 py-3 text-left text-sm font-medium text-primary hover:underline max-sm:mt-2.5 max-sm:border-t-0 max-sm:py-1 max-sm:pl-3.5 max-sm:pr-0 max-sm:text-xs max-sm:font-normal max-sm:text-muted-foreground max-sm:no-underline", onClick: onToggle, children: [_jsx("span", { "aria-hidden": "true", className: "absolute inset-y-0 left-0 w-[3px] rounded-full bg-border sm:hidden" }), label] }));
32
+ }
33
+ export function DefaultRecordSteps({ title, subtitle, emptyLabel, reasonLabel, narrowLimit, moreLabel, lessLabel, items, count, testId, }) {
34
+ const insideScreenFormColumn = useContext(InsideScreenFormColumnContext);
35
+ const narrow = useIsBelowSmViewport();
36
+ const [expanded, setExpanded] = useState(false);
37
+ const limited = narrow && narrowLimit !== undefined && items.length > narrowLimit;
38
+ const visible = limited && !expanded ? items.slice(0, narrowLimit) : items;
39
+ const toggleLabel = moreLabel === undefined || lessLabel === undefined
40
+ ? undefined
41
+ : expanded
42
+ ? lessLabel
43
+ : moreLabel(items.length - visible.length);
44
+ return (_jsx("section", { "data-testid": testId, className: cn("shrink-0", !insideScreenFormColumn && "px-6 py-2"), children: _jsxs("div", { className: "sm:rounded-md sm:border sm:bg-card", children: [_jsx(StepsHeader, { title: title, subtitle: subtitle, count: count, testId: testId }), items.length === 0 ? (_jsx("p", { className: "m-0 px-4 py-3 text-sm text-muted-foreground", children: emptyLabel })) : (_jsx("ul", { className: "m-0 flex list-none flex-col p-0 max-sm:gap-2.5 sm:divide-y", children: visible.map((item) => (_jsx(StepRow, { item: item, reasonLabel: reasonLabel }, item.id))) })), limited && toggleLabel !== undefined && (_jsx(StepsMoreToggle, { testId: testId, expanded: expanded, label: toggleLabel, onToggle: () => setExpanded((open) => !open) }))] }) }));
45
+ }
@@ -0,0 +1,3 @@
1
+ import { type ReactNode } from "react";
2
+ import type { RecordSummaryProps } from "../../index.ts";
3
+ export declare function DefaultRecordSummary({ text, narrowText, tone, testId, }: RecordSummaryProps): ReactNode;
@@ -0,0 +1,18 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useContext } from "react";
3
+ import { cn } from "../lib/cn.js";
4
+ import { InsideScreenFormColumnContext } from "./metric.js";
5
+ import { useIsBelowSmViewport } from "./use-narrow-viewport.js";
6
+ const SUMMARY_BORDER_CLASS = {
7
+ bad: "border-status-bad",
8
+ warn: "border-status-warn",
9
+ critical: "border-status-critical",
10
+ ok: "border-status-ok",
11
+ accent: "border-primary",
12
+ neutral: "border-border-strong",
13
+ };
14
+ export function DefaultRecordSummary({ text, narrowText, tone, testId, }) {
15
+ const insideScreenFormColumn = useContext(InsideScreenFormColumnContext);
16
+ const narrow = useIsBelowSmViewport();
17
+ return (_jsx("div", { className: cn("shrink-0", !insideScreenFormColumn && "px-6 py-2"), children: _jsx("p", { "data-testid": testId, "data-tone": tone, className: cn("m-0 rounded-md border border-l-[3px] bg-card px-4 py-3 font-heading text-[15.5px] leading-[1.5] sm:text-[17px] sm:leading-relaxed text-foreground", tone === undefined ? "border-l-primary" : SUMMARY_BORDER_CLASS[tone]), children: narrow && narrowText !== undefined ? narrowText : text }) }));
18
+ }
@@ -3,11 +3,13 @@ import type { ListRowViewModel } from "../../headless/index.ts";
3
3
  import type { DataTableRowAction, DataTableRowActionMode } from "../../index.ts";
4
4
  import { type ActionOverflowMenuProps } from "../../index.ts";
5
5
  import "../react-css-custom-properties.ts";
6
- export declare function RowActionsCell({ row, actions, mode, rowIsLink, compact, }: {
6
+ export declare function RowActionsCell({ row, actions, mode, rowIsLink, compact, small, }: {
7
7
  readonly row: ListRowViewModel;
8
8
  readonly actions: readonly DataTableRowAction[];
9
9
  readonly mode?: DataTableRowActionMode;
10
10
  readonly rowIsLink?: boolean;
11
11
  readonly compact?: boolean;
12
+ /** Small bordered buttons without the phone touch height; for buttons sitting inside a card. */
13
+ readonly small?: boolean;
12
14
  }): ReactNode;
13
15
  export declare function ActionOverflowMenu({ items, label, testId }: ActionOverflowMenuProps): ReactNode;
@@ -1,6 +1,7 @@
1
1
  import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Loader2, MoreHorizontal } from "lucide-react";
3
3
  import { useState } from "react";
4
+ import { COMPACT_TAP_CLASSES } from "../../compact-tap-classes.js";
4
5
  import { needsActionConfirm, shouldRenderActionsIconOnly, useTranslation, WriteFailedError, } from "../../index.js";
5
6
  import { Icon } from "../icons.js";
6
7
  import { cn } from "../lib/cn.js";
@@ -24,14 +25,18 @@ function primaryRowAction(actions) {
24
25
  // >2 (no kebab). `w-full justify-start` pins the first button to the
25
26
  // column's left edge so it sits at the same position across rows
26
27
  // (otherwise it would drift with differently-sized labels).
28
+ // - "menu": every action in the kebab, whatever its `display`.
27
29
  // The isVisible filter runs here; an action hidden for a given row never
28
30
  // reaches render. If every action is hidden, the cell stays empty (no
29
31
  // phantom column).
30
- export function RowActionsCell({ row, actions, mode = "adaptive", rowIsLink = false, compact = false, }) {
32
+ export function RowActionsCell({ row, actions, mode = "adaptive", rowIsLink = false, compact = false, small = false, }) {
31
33
  const visible = actions.filter((a) => a.isVisible === undefined || a.isVisible(row));
32
34
  if (visible.length === 0)
33
35
  return null;
34
36
  const hasExplicitDisplay = visible.some((a) => a.display !== undefined);
37
+ if (mode === "menu") {
38
+ return (_jsx("div", { className: "inline-flex items-center justify-end", children: _jsx(RowActionsKebab, { row: row, actions: visible }) }));
39
+ }
35
40
  if (mode === "inline") {
36
41
  // Teil C: >2 actions all carrying an icon collapse to icon-only —
37
42
  // otherwise "inline" is exactly the wall-to-wall text-button problem
@@ -42,7 +47,7 @@ export function RowActionsCell({ row, actions, mode = "adaptive", rowIsLink = fa
42
47
  if (hasExplicitDisplay) {
43
48
  const inline = visible.filter((a) => a.display !== undefined);
44
49
  const rest = visible.filter((a) => a.display === undefined);
45
- return (_jsxs("div", { className: "inline-flex flex-nowrap items-center gap-1 justify-end whitespace-nowrap", children: [inline.map((a) => (_jsx(RowActionButton, { row: row, action: a, compact: compact }, a.id))), rest.length > 0 && _jsx(RowActionsKebab, { row: row, actions: rest })] }));
50
+ return (_jsxs("div", { className: "inline-flex flex-nowrap items-center gap-1 justify-end whitespace-nowrap", children: [inline.map((a) => (_jsx(RowActionButton, { row: row, action: a, compact: compact, small: small }, a.id))), rest.length > 0 && _jsx(RowActionsKebab, { row: row, actions: rest })] }));
46
51
  }
47
52
  if (rowIsLink) {
48
53
  return (_jsx("div", { className: "inline-flex items-center justify-end", children: _jsx(RowActionsKebab, { row: row, actions: visible }) }));
@@ -93,11 +98,13 @@ function effectiveRowActionDisplay(display, hasIcon, compact) {
93
98
  return "link";
94
99
  return display;
95
100
  }
96
- function RowActionButton({ row, action, iconOnly = false, asLink = false, compact = false, }) {
101
+ function RowActionButton({ row, action, iconOnly = false, asLink = false, compact = false, small = false, }) {
97
102
  const { busy, triggerNow } = useRowActionTrigger(row);
98
103
  const [confirmOpen, setConfirmOpen] = useState(false);
99
104
  const resolvedIcon = actionIconFor(action.icon);
100
- const display = effectiveRowActionDisplay(action.display, resolvedIcon !== undefined, compact);
105
+ const resolvedDisplay = effectiveRowActionDisplay(action.display, resolvedIcon !== undefined, compact);
106
+ // A card's small row action is always an outlined button, also when the author asked for a link.
107
+ const display = small && resolvedDisplay === "link" ? "button" : resolvedDisplay;
101
108
  const isBorderedButton = display === "button";
102
109
  const showIconOnly = display === "icon" || (display === undefined && iconOnly && resolvedIcon !== undefined);
103
110
  const linkLike = display === "link" || (display === undefined && asLink);
@@ -123,7 +130,9 @@ function RowActionButton({ row, action, iconOnly = false, asLink = false, compac
123
130
  void triggerNow(action);
124
131
  }
125
132
  }, className: cn("inline-flex items-center justify-center gap-1.5 text-sm", isBorderedButton
126
- ? "h-8 rounded-md px-3 font-medium max-md:h-11"
133
+ ? small
134
+ ? cn("rounded-md font-medium", COMPACT_TAP_CLASSES)
135
+ : "h-8 rounded-md px-3 font-medium max-md:h-11"
127
136
  : linkLike
128
137
  ? "h-7 rounded-md px-2.5 max-md:h-11"
129
138
  : "h-8 rounded-sm max-md:h-11", showIconOnly ? "w-8 max-md:w-11" : !linkLike && !isBorderedButton && "px-2", "focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring", "disabled:opacity-50 disabled:pointer-events-none", variantClass), children: busy ? (_jsx(Loader2, { className: "size-3.5 animate-spin", "aria-hidden": "true" })) : resolvedIcon === undefined || (linkLike && !showIconOnly) ? (action.label) : showIconOnly ? (_jsx(Icon, { name: resolvedIcon, className: "size-4" })) : (_jsxs(_Fragment, { children: [_jsx(Icon, { name: resolvedIcon, className: "size-4" }), action.label] })) }), _jsx(DefaultDialog, { open: confirmOpen, onOpenChange: setConfirmOpen, title: action.label, ...(action.confirm !== undefined && { description: action.confirm }), confirmLabel: action.confirmLabel ?? action.label, ...(action.style === "danger" && { variant: "danger" }), onConfirm: () => triggerNow(action), testId: `row-${row.id}-action-${action.id}-dialog` })] }));
@@ -3,7 +3,6 @@ import { useRef } from "react";
3
3
  import { statusToneForOptionTone } from "../../index.js";
4
4
  import { cn } from "../lib/cn.js";
5
5
  import { TONE_PILL } from "../widgets/status-badge.js";
6
- const EQUAL_WIDTH_MAX_SEGMENTS = 4;
7
6
  // WAI-ARIA radiogroup pattern (role="radiogroup" + role="radio" children):
8
7
  // arrow keys move focus AND selection in the same step, only the checked
9
8
  // segment (or the first when none is checked) sits in the tab order.
@@ -39,11 +38,10 @@ export function SegmentedControl({ id, name, value, onChange, options, disabled,
39
38
  }
40
39
  };
41
40
  return (_jsxs("div", { role: "radiogroup", ...labelProps, "aria-required": required, "aria-invalid": hasError === true ? true : undefined, "data-testid": `segmented-${id}`, className: cn(
42
- // Few segments share one row at equal width so labels wrap inside
43
- // their segment instead of leaving one tall and its siblings short.
44
- options.length <= EQUAL_WIDTH_MAX_SEGMENTS
45
- ? "inline-grid max-w-full grid-flow-col auto-cols-fr"
46
- : "inline-flex w-fit flex-wrap", size === "touch" ? "min-h-11" : "min-h-9", "overflow-hidden rounded-md border", hasError === true ? "border-destructive" : "border-input"), children: [_jsx("input", { type: "hidden", name: name, value: value }), options.map((opt, index) => {
41
+ // Labels stay whole (nowrap on the segment, whose min-content is then the full
42
+ // label); when the column is too narrow the segment moves to the next row
43
+ // instead of breaking a word or spilling into its neighbour.
44
+ "inline-flex w-fit max-w-full flex-wrap", size === "touch" ? "min-h-11" : "min-h-9", "overflow-hidden rounded-md border", hasError === true ? "border-destructive" : "border-input"), children: [_jsx("input", { type: "hidden", name: name, value: value }), options.map((opt, index) => {
47
45
  const checked = opt.value === value;
48
46
  const declaredTone = tones !== undefined && Object.hasOwn(tones, opt.value) ? tones[opt.value] : undefined;
49
47
  const badgeTone = declaredTone !== undefined ? statusToneForOptionTone(declaredTone) : undefined;
@@ -65,7 +63,7 @@ export function SegmentedControl({ id, name, value, onChange, options, disabled,
65
63
  // and the next row's top border cut a notch into the row above.
66
64
  // Harmless on a single-row layout: there's no leftover space to
67
65
  // grow into, so `w-fit` on the container still holds.
68
- "-ml-px -mt-px grow border-l border-t px-3 py-1.5 text-center text-sm transition-colors", "focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring", "disabled:pointer-events-none disabled:opacity-50", hasError === true ? "border-destructive/50" : "border-border", size === "touch" && "min-h-11", checked
66
+ "-ml-px -mt-px grow basis-0 whitespace-nowrap border-l border-t px-3 py-1.5 text-center text-sm transition-colors", "focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring", "disabled:pointer-events-none disabled:opacity-50", hasError === true ? "border-destructive/50" : "border-border", size === "touch" && "min-h-11", checked
69
67
  ? cn("font-semibold", badgeTone !== undefined ? TONE_PILL[badgeTone] : "bg-primary/10 text-primary")
70
68
  : "bg-transparent font-medium text-foreground hover:bg-accent"), children: opt.label }, opt.value));
71
69
  })] }));
@@ -0,0 +1,4 @@
1
+ import { type ReactNode } from "react";
2
+ export declare const PWA_INSTALL_HINT_DISMISSED_KEY = "kumiko:pwa-install-hint-dismissed";
3
+ export declare function readPwaServiceWorkerUrl(): string | undefined;
4
+ export declare function PwaSupport(): ReactNode;