@cosmicdrift/kumiko-renderer 0.388.0 → 0.390.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 (379) hide show
  1. package/dist/app/base-path-context.d.ts +9 -0
  2. package/dist/app/base-path-context.js +13 -0
  3. package/dist/app/base-path.d.ts +3 -0
  4. package/dist/app/base-path.js +27 -0
  5. package/dist/app/config-edit-body.d.ts +1 -1
  6. package/dist/app/config-edit-body.js +15 -6
  7. package/dist/app/config-edit-without-secret-fields.d.ts +2 -0
  8. package/dist/app/config-edit-without-secret-fields.js +28 -0
  9. package/dist/app/entity-list-facet-specs.d.ts +3 -0
  10. package/dist/app/entity-list-facet-specs.js +65 -0
  11. package/dist/app/entity-list-screen.js +74 -206
  12. package/dist/app/kumiko-screen.js +6 -14
  13. package/dist/app/list-bulk-actions.d.ts +18 -0
  14. package/dist/app/list-bulk-actions.js +54 -0
  15. package/dist/app/locked-screen-header.d.ts +9 -0
  16. package/dist/app/locked-screen-header.js +33 -0
  17. package/dist/app/projection-detail-body.js +59 -394
  18. package/dist/app/projection-detail-header-model.d.ts +11 -0
  19. package/dist/app/projection-detail-header-model.js +33 -0
  20. package/dist/app/projection-detail-header-region.d.ts +28 -0
  21. package/dist/app/projection-detail-header-region.js +81 -0
  22. package/dist/app/projection-detail-header.d.ts +29 -0
  23. package/dist/app/projection-detail-header.js +84 -0
  24. package/dist/app/projection-detail-navigation.d.ts +13 -0
  25. package/dist/app/projection-detail-navigation.js +91 -0
  26. package/dist/app/projection-detail-states.d.ts +22 -0
  27. package/dist/app/projection-detail-states.js +26 -0
  28. package/dist/app/projection-drawer-host.d.ts +12 -0
  29. package/dist/app/projection-drawer-host.js +10 -0
  30. package/dist/app/projection-list-body.d.ts +1 -1
  31. package/dist/app/projection-list-body.js +82 -197
  32. package/dist/app/projection-list-render-props.d.ts +56 -0
  33. package/dist/app/projection-list-render-props.js +47 -0
  34. package/dist/app/projection-list-render.d.ts +26 -0
  35. package/dist/app/projection-list-render.js +20 -0
  36. package/dist/app/projection-list-row-click.d.ts +12 -0
  37. package/dist/app/projection-list-row-click.js +14 -0
  38. package/dist/app/row-actions.d.ts +3 -0
  39. package/dist/app/row-actions.js +10 -5
  40. package/dist/app/screen-shared.js +9 -2
  41. package/dist/app/use-entity-range-facets.d.ts +24 -0
  42. package/dist/app/use-entity-range-facets.js +64 -0
  43. package/dist/app/use-projection-date-range.d.ts +12 -0
  44. package/dist/app/use-projection-date-range.js +21 -0
  45. package/dist/app/use-projection-detail-actions.d.ts +35 -0
  46. package/dist/app/use-projection-detail-actions.js +156 -0
  47. package/dist/app/use-projection-detail-data.d.ts +19 -0
  48. package/dist/app/use-projection-detail-data.js +47 -0
  49. package/dist/app/use-projection-detail-layout.d.ts +17 -0
  50. package/dist/app/use-projection-detail-layout.js +23 -0
  51. package/dist/app/use-projection-list-actions.d.ts +31 -0
  52. package/dist/app/use-projection-list-actions.js +73 -0
  53. package/dist/app/use-projection-list-data.d.ts +20 -0
  54. package/dist/app/use-projection-list-data.js +26 -0
  55. package/dist/app/use-projection-list-definitions.d.ts +11 -0
  56. package/dist/app/use-projection-list-definitions.js +20 -0
  57. package/dist/app/use-projection-list-query.d.ts +28 -0
  58. package/dist/app/use-projection-list-query.js +83 -0
  59. package/dist/app/use-screen-list-rows.d.ts +37 -0
  60. package/dist/app/use-screen-list-rows.js +104 -0
  61. package/dist/app/use-screen-list-table.d.ts +24 -0
  62. package/dist/app/use-screen-list-table.js +46 -0
  63. package/dist/components/list-group-page-bridges.d.ts +3 -0
  64. package/dist/components/list-group-page-bridges.js +31 -0
  65. package/dist/components/list-state-store.d.ts +16 -0
  66. package/dist/components/list-state-store.js +31 -0
  67. package/dist/components/related-list-section.js +37 -89
  68. package/dist/components/render-edit-banners.d.ts +12 -0
  69. package/dist/components/render-edit-banners.js +90 -0
  70. package/dist/components/render-edit-draft-save-helpers.d.ts +19 -0
  71. package/dist/components/render-edit-draft-save-helpers.js +42 -0
  72. package/dist/components/render-edit-field-grid.d.ts +4 -0
  73. package/dist/components/render-edit-field-grid.js +40 -0
  74. package/dist/components/render-edit-fields-section.d.ts +4 -0
  75. package/dist/components/render-edit-fields-section.js +76 -0
  76. package/dist/components/render-edit-form-actions.d.ts +4 -0
  77. package/dist/components/render-edit-form-actions.js +66 -0
  78. package/dist/components/render-edit-header-actions.d.ts +11 -0
  79. package/dist/components/render-edit-header-actions.js +120 -0
  80. package/dist/components/render-edit-layout-flags.d.ts +29 -0
  81. package/dist/components/render-edit-layout-flags.js +106 -0
  82. package/dist/components/render-edit-layout.d.ts +4 -0
  83. package/dist/components/render-edit-layout.js +79 -0
  84. package/dist/components/render-edit-render-model.d.ts +63 -0
  85. package/dist/components/render-edit-render-model.js +14 -0
  86. package/dist/components/render-edit-section-kinds.d.ts +4 -0
  87. package/dist/components/render-edit-section-kinds.js +115 -0
  88. package/dist/components/render-edit-submit-result.d.ts +8 -0
  89. package/dist/components/render-edit-submit-result.js +77 -0
  90. package/dist/components/render-edit-submit.d.ts +7 -0
  91. package/dist/components/render-edit-submit.js +113 -0
  92. package/dist/components/render-edit-titles.d.ts +17 -0
  93. package/dist/components/render-edit-titles.js +99 -0
  94. package/dist/components/render-edit-wizard-navigation.d.ts +11 -0
  95. package/dist/components/render-edit-wizard-navigation.js +115 -0
  96. package/dist/components/render-edit.d.ts +2 -2
  97. package/dist/components/render-edit.js +63 -1128
  98. package/dist/components/render-field-choice-inputs.d.ts +7 -0
  99. package/dist/components/render-field-choice-inputs.js +52 -0
  100. package/dist/components/render-field-control.d.ts +12 -0
  101. package/dist/components/render-field-control.js +93 -0
  102. package/dist/components/render-field-display-text.d.ts +4 -0
  103. package/dist/components/render-field-display-text.js +48 -0
  104. package/dist/components/render-field-fill-action.d.ts +13 -0
  105. package/dist/components/render-field-fill-action.js +63 -0
  106. package/dist/components/render-field-input-shared.d.ts +39 -0
  107. package/dist/components/render-field-input-shared.js +20 -0
  108. package/dist/components/render-field-input.d.ts +3 -0
  109. package/dist/components/render-field-input.js +34 -0
  110. package/dist/components/render-field-meta.d.ts +6 -0
  111. package/dist/components/render-field-meta.js +51 -0
  112. package/dist/components/render-field-read-only.d.ts +11 -0
  113. package/dist/components/render-field-read-only.js +75 -0
  114. package/dist/components/render-field-reference.d.ts +15 -0
  115. package/dist/components/render-field-reference.js +103 -0
  116. package/dist/components/render-field-scalar-inputs.d.ts +10 -0
  117. package/dist/components/render-field-scalar-inputs.js +35 -0
  118. package/dist/components/render-field-text-inputs.d.ts +3 -0
  119. package/dist/components/render-field-text-inputs.js +34 -0
  120. package/dist/components/render-field-values.d.ts +18 -0
  121. package/dist/components/render-field-values.js +111 -0
  122. package/dist/components/render-field-write-only.d.ts +9 -0
  123. package/dist/components/render-field-write-only.js +29 -0
  124. package/dist/components/render-field.d.ts +2 -2
  125. package/dist/components/render-field.js +39 -669
  126. package/dist/components/render-list-header-slot.d.ts +5 -0
  127. package/dist/components/render-list-header-slot.js +30 -0
  128. package/dist/components/render-list-reference-bridge.d.ts +3 -0
  129. package/dist/components/render-list-reference-bridge.js +25 -0
  130. package/dist/components/render-list-reference-columns.d.ts +25 -0
  131. package/dist/components/render-list-reference-columns.js +137 -0
  132. package/dist/components/render-list-table-props.d.ts +52 -0
  133. package/dist/components/render-list-table-props.js +53 -0
  134. package/dist/components/render-list-toolbar-action.d.ts +27 -0
  135. package/dist/components/render-list-toolbar-action.js +40 -0
  136. package/dist/components/render-list-toolbar-model.d.ts +42 -0
  137. package/dist/components/render-list-toolbar-model.js +82 -0
  138. package/dist/components/render-list-toolbar.d.ts +38 -0
  139. package/dist/components/render-list-toolbar.js +40 -0
  140. package/dist/components/render-list-types.d.ts +113 -0
  141. package/dist/components/render-list-types.js +1 -0
  142. package/dist/components/render-list.d.ts +5 -130
  143. package/dist/components/render-list.js +95 -319
  144. package/dist/components/use-reference-input-state.d.ts +20 -0
  145. package/dist/components/use-reference-input-state.js +85 -0
  146. package/dist/components/use-render-edit-controlled-sync.d.ts +3 -0
  147. package/dist/components/use-render-edit-controlled-sync.js +26 -0
  148. package/dist/components/use-render-edit-draft-save.d.ts +29 -0
  149. package/dist/components/use-render-edit-draft-save.js +141 -0
  150. package/dist/components/use-render-edit-form.d.ts +10 -0
  151. package/dist/components/use-render-edit-form.js +101 -0
  152. package/dist/components/use-render-edit-sections.d.ts +15 -0
  153. package/dist/components/use-render-edit-sections.js +100 -0
  154. package/dist/components/use-render-edit-state.d.ts +65 -0
  155. package/dist/components/use-render-edit-state.js +158 -0
  156. package/dist/components/use-render-edit-steps.d.ts +13 -0
  157. package/dist/components/use-render-edit-steps.js +52 -0
  158. package/dist/components/use-render-list-columns.d.ts +18 -0
  159. package/dist/components/use-render-list-columns.js +41 -0
  160. package/dist/components/use-render-list-search.d.ts +4 -0
  161. package/dist/components/use-render-list-search.js +50 -0
  162. package/dist/current-user.d.ts +2 -0
  163. package/dist/data-table-aggregate-types.d.ts +47 -0
  164. package/dist/data-table-aggregate-types.js +1 -0
  165. package/dist/data-table-bulk-types.d.ts +27 -0
  166. package/dist/data-table-bulk-types.js +1 -0
  167. package/dist/data-table-facet-types.d.ts +36 -0
  168. package/dist/data-table-facet-types.js +1 -0
  169. package/dist/data-table-view-types.d.ts +73 -0
  170. package/dist/data-table-view-types.js +1 -0
  171. package/dist/headless/view-model/edit.js +3 -1
  172. package/dist/headless/view-model/types.d.ts +4 -2
  173. package/dist/hooks/list-column-layout.d.ts +19 -0
  174. package/dist/hooks/list-column-layout.js +36 -0
  175. package/dist/hooks/list-group-pages.d.ts +26 -0
  176. package/dist/hooks/list-group-pages.js +37 -0
  177. package/dist/hooks/list-reset.d.ts +8 -0
  178. package/dist/hooks/list-reset.js +15 -0
  179. package/dist/hooks/list-server-groups.d.ts +39 -0
  180. package/dist/hooks/list-server-groups.js +84 -0
  181. package/dist/hooks/list-state-schema.d.ts +28 -0
  182. package/dist/hooks/list-state-schema.js +76 -0
  183. package/dist/hooks/use-bulk-run.d.ts +41 -0
  184. package/dist/hooks/use-bulk-run.js +65 -0
  185. package/dist/hooks/use-group-load-state.d.ts +11 -0
  186. package/dist/hooks/use-group-load-state.js +31 -0
  187. package/dist/hooks/use-list-aggregates.d.ts +38 -0
  188. package/dist/hooks/use-list-aggregates.js +107 -0
  189. package/dist/hooks/use-list-table.d.ts +38 -0
  190. package/dist/hooks/use-list-table.js +91 -0
  191. package/dist/hooks/use-list-view-state.d.ts +43 -0
  192. package/dist/hooks/use-list-view-state.js +161 -0
  193. package/dist/hooks/use-related-list-rows.d.ts +27 -0
  194. package/dist/hooks/use-related-list-rows.js +81 -0
  195. package/dist/hooks/use-related-list-state.d.ts +15 -0
  196. package/dist/hooks/use-related-list-state.js +31 -0
  197. package/dist/hooks/use-remembered-list-params.d.ts +13 -0
  198. package/dist/hooks/use-remembered-list-params.js +53 -0
  199. package/dist/hooks/use-remembered-local-list-state.d.ts +26 -0
  200. package/dist/hooks/use-remembered-local-list-state.js +63 -0
  201. package/dist/i18n-defaults.js +53 -0
  202. package/dist/index.d.ts +3 -1
  203. package/dist/index.js +2 -0
  204. package/dist/primitives.d.ts +11 -47
  205. package/dist/web/app/create-app.d.ts +5 -0
  206. package/dist/web/app/create-app.js +7 -4
  207. package/dist/web/app/dashboard-body.d.ts +1 -1
  208. package/dist/web/app/dashboard-body.js +42 -246
  209. package/dist/web/app/dashboard-header.d.ts +34 -0
  210. package/dist/web/app/dashboard-header.js +58 -0
  211. package/dist/web/app/dashboard-screen-controls.d.ts +11 -0
  212. package/dist/web/app/dashboard-screen-controls.js +42 -0
  213. package/dist/web/app/dashboard-screen-tiles.d.ts +8 -0
  214. package/dist/web/app/dashboard-screen-tiles.js +42 -0
  215. package/dist/web/app/dashboard-visibility.d.ts +42 -0
  216. package/dist/web/app/dashboard-visibility.js +102 -0
  217. package/dist/web/app/history-leave-guard.d.ts +6 -0
  218. package/dist/web/app/history-leave-guard.js +115 -0
  219. package/dist/web/app/list-state-store-boot.d.ts +6 -0
  220. package/dist/web/app/list-state-store-boot.js +15 -0
  221. package/dist/web/app/nav.js +7 -54
  222. package/dist/web/app/session-list-state-store.d.ts +15 -0
  223. package/dist/web/app/session-list-state-store.js +117 -0
  224. package/dist/web/app/use-dashboard-screen-state.d.ts +35 -0
  225. package/dist/web/app/use-dashboard-screen-state.js +69 -0
  226. package/dist/web/index.d.ts +1 -0
  227. package/dist/web/index.js +1 -0
  228. package/dist/web/lib/export-xlsx-request.d.ts +11 -0
  229. package/dist/web/lib/export-xlsx-request.js +46 -0
  230. package/dist/web/primitives/data-table/actions-column.d.ts +16 -0
  231. package/dist/web/primitives/data-table/actions-column.js +35 -0
  232. package/dist/web/primitives/data-table/bulk-selection-bar.d.ts +20 -0
  233. package/dist/web/primitives/data-table/bulk-selection-bar.js +37 -0
  234. package/dist/web/primitives/data-table/card-body.d.ts +6 -0
  235. package/dist/web/primitives/data-table/card-body.js +32 -0
  236. package/dist/web/primitives/data-table/card-row.d.ts +5 -0
  237. package/dist/web/primitives/data-table/card-row.js +31 -0
  238. package/dist/web/primitives/data-table/card-sort-select.d.ts +14 -0
  239. package/dist/web/primitives/data-table/card-sort-select.js +40 -0
  240. package/dist/web/primitives/data-table/card-view.d.ts +3 -0
  241. package/dist/web/primitives/data-table/card-view.js +13 -0
  242. package/dist/web/primitives/data-table/column-layout-mode.d.ts +5 -0
  243. package/dist/web/primitives/data-table/column-layout-mode.js +10 -0
  244. package/dist/web/primitives/data-table/column-picker-section.d.ts +7 -0
  245. package/dist/web/primitives/data-table/column-picker-section.js +35 -0
  246. package/dist/web/primitives/data-table/column-resize-handle.d.ts +14 -0
  247. package/dist/web/primitives/data-table/column-resize-handle.js +48 -0
  248. package/dist/web/primitives/data-table/data-cell-props.d.ts +7 -0
  249. package/dist/web/primitives/data-table/data-cell-props.js +8 -0
  250. package/dist/web/primitives/data-table/density.d.ts +14 -0
  251. package/dist/web/primitives/data-table/density.js +20 -0
  252. package/dist/web/primitives/data-table/export-button.d.ts +5 -0
  253. package/dist/web/primitives/data-table/export-button.js +37 -0
  254. package/dist/web/primitives/data-table/facet-cluster.d.ts +8 -0
  255. package/dist/web/primitives/data-table/facet-cluster.js +37 -0
  256. package/dist/web/primitives/data-table/group-band.d.ts +28 -0
  257. package/dist/web/primitives/data-table/group-band.js +53 -0
  258. package/dist/web/primitives/data-table/measure-value.d.ts +10 -0
  259. package/dist/web/primitives/data-table/measure-value.js +28 -0
  260. package/dist/web/primitives/data-table/pin-section.d.ts +8 -0
  261. package/dist/web/primitives/data-table/pin-section.js +20 -0
  262. package/dist/web/primitives/data-table/reset-all-button.d.ts +4 -0
  263. package/dist/web/primitives/data-table/reset-all-button.js +8 -0
  264. package/dist/web/primitives/data-table/row-render-parts.d.ts +8 -0
  265. package/dist/web/primitives/data-table/row-render-parts.js +35 -0
  266. package/dist/web/primitives/data-table/server-group-header.d.ts +11 -0
  267. package/dist/web/primitives/data-table/server-group-header.js +51 -0
  268. package/dist/web/primitives/data-table/sortable-header.d.ts +17 -0
  269. package/dist/web/primitives/data-table/sortable-header.js +41 -0
  270. package/dist/web/primitives/data-table/table-body.d.ts +3 -0
  271. package/dist/web/primitives/data-table/table-body.js +32 -0
  272. package/dist/web/primitives/data-table/table-chrome.d.ts +13 -0
  273. package/dist/web/primitives/data-table/table-chrome.js +30 -0
  274. package/dist/web/primitives/data-table/table-content.d.ts +3 -0
  275. package/dist/web/primitives/data-table/table-content.js +41 -0
  276. package/dist/web/primitives/data-table/table-data-cell.d.ts +4 -0
  277. package/dist/web/primitives/data-table/table-data-cell.js +25 -0
  278. package/dist/web/primitives/data-table/table-footer.d.ts +7 -0
  279. package/dist/web/primitives/data-table/table-footer.js +20 -0
  280. package/dist/web/primitives/data-table/table-header-row.d.ts +3 -0
  281. package/dist/web/primitives/data-table/table-header-row.js +21 -0
  282. package/dist/web/primitives/data-table/table-view.d.ts +3 -0
  283. package/dist/web/primitives/data-table/table-view.js +25 -0
  284. package/dist/web/primitives/data-table/toolbar-end-cluster.d.ts +10 -0
  285. package/dist/web/primitives/data-table/toolbar-end-cluster.js +13 -0
  286. package/dist/web/primitives/data-table/toolbar.d.ts +6 -0
  287. package/dist/web/primitives/data-table/toolbar.js +53 -0
  288. package/dist/web/primitives/data-table/totals-footer.d.ts +24 -0
  289. package/dist/web/primitives/data-table/totals-footer.js +48 -0
  290. package/dist/web/primitives/data-table/use-bulk-selection.d.ts +21 -0
  291. package/dist/web/primitives/data-table/use-bulk-selection.js +66 -0
  292. package/dist/web/primitives/data-table/use-column-pins.d.ts +32 -0
  293. package/dist/web/primitives/data-table/use-column-pins.js +117 -0
  294. package/dist/web/primitives/data-table/use-column-sizing.d.ts +22 -0
  295. package/dist/web/primitives/data-table/use-column-sizing.js +44 -0
  296. package/dist/web/primitives/data-table/use-data-table-state.d.ts +44 -0
  297. package/dist/web/primitives/data-table/use-data-table-state.js +123 -0
  298. package/dist/web/primitives/data-table/use-measured-column-widths.d.ts +15 -0
  299. package/dist/web/primitives/data-table/use-measured-column-widths.js +83 -0
  300. package/dist/web/primitives/data-table/use-row-keyboard-navigation.d.ts +22 -0
  301. package/dist/web/primitives/data-table/use-row-keyboard-navigation.js +65 -0
  302. package/dist/web/primitives/data-table/use-row-selection.d.ts +14 -0
  303. package/dist/web/primitives/data-table/use-row-selection.js +48 -0
  304. package/dist/web/primitives/data-table/use-view-columns.d.ts +6 -0
  305. package/dist/web/primitives/data-table/use-view-columns.js +17 -0
  306. package/dist/web/primitives/data-table/view-menu.d.ts +8 -0
  307. package/dist/web/primitives/data-table/view-menu.js +45 -0
  308. package/dist/web/primitives/data-table-cell.d.ts +0 -22
  309. package/dist/web/primitives/data-table-cell.js +1 -58
  310. package/dist/web/primitives/data-table.d.ts +3 -4
  311. package/dist/web/primitives/data-table.js +30 -272
  312. package/dist/web/primitives/file-value-list.d.ts +1 -1
  313. package/dist/web/primitives/file-value-list.js +5 -5
  314. package/dist/web/primitives/form-footer-parts.d.ts +25 -0
  315. package/dist/web/primitives/form-footer-parts.js +55 -0
  316. package/dist/web/primitives/form.js +33 -43
  317. package/dist/web/primitives/input-choice-kinds.d.ts +4 -0
  318. package/dist/web/primitives/input-choice-kinds.js +67 -0
  319. package/dist/web/primitives/input-file-kinds.d.ts +3 -0
  320. package/dist/web/primitives/input-file-kinds.js +6 -0
  321. package/dist/web/primitives/input-number-kinds.d.ts +4 -0
  322. package/dist/web/primitives/input-number-kinds.js +16 -0
  323. package/dist/web/primitives/input-optional-props.d.ts +20 -0
  324. package/dist/web/primitives/input-optional-props.js +24 -0
  325. package/dist/web/primitives/input-select-presentation.d.ts +13 -0
  326. package/dist/web/primitives/input-select-presentation.js +19 -0
  327. package/dist/web/primitives/input-shared.d.ts +22 -0
  328. package/dist/web/primitives/input-shared.js +10 -0
  329. package/dist/web/primitives/input-temporal-kinds.d.ts +5 -0
  330. package/dist/web/primitives/input-temporal-kinds.js +10 -0
  331. package/dist/web/primitives/input-text-kinds.d.ts +7 -0
  332. package/dist/web/primitives/input-text-kinds.js +33 -0
  333. package/dist/web/primitives/input.js +35 -161
  334. package/dist/web/primitives/number-range-facet.d.ts +7 -0
  335. package/dist/web/primitives/number-range-facet.js +33 -0
  336. package/dist/web/widgets/bounded-load-cache.d.ts +5 -1
  337. package/dist/web/widgets/bounded-load-cache.js +48 -26
  338. package/dist/web/widgets/chart-data.d.ts +35 -0
  339. package/dist/web/widgets/chart-data.js +37 -0
  340. package/dist/web/widgets/chart-markers.d.ts +26 -0
  341. package/dist/web/widgets/chart-markers.js +64 -0
  342. package/dist/web/widgets/chart-parts.d.ts +20 -0
  343. package/dist/web/widgets/chart-parts.js +15 -0
  344. package/dist/web/widgets/charts.d.ts +5 -78
  345. package/dist/web/widgets/charts.js +7 -485
  346. package/dist/web/widgets/drawer-panel-class.d.ts +3 -0
  347. package/dist/web/widgets/drawer-panel-class.js +40 -0
  348. package/dist/web/widgets/drawer-resize-controls.d.ts +11 -0
  349. package/dist/web/widgets/drawer-resize-controls.js +12 -0
  350. package/dist/web/widgets/drawer-sizing.d.ts +19 -0
  351. package/dist/web/widgets/drawer-sizing.js +60 -0
  352. package/dist/web/widgets/drawer.js +17 -116
  353. package/dist/web/widgets/pdf-preview.js +9 -4
  354. package/dist/web/widgets/stacked-area-brush.d.ts +13 -0
  355. package/dist/web/widgets/stacked-area-brush.js +91 -0
  356. package/dist/web/widgets/stacked-area-chart.d.ts +6 -0
  357. package/dist/web/widgets/stacked-area-chart.js +45 -0
  358. package/dist/web/widgets/stacked-area-chrome.d.ts +7 -0
  359. package/dist/web/widgets/stacked-area-chrome.js +77 -0
  360. package/dist/web/widgets/stacked-area-geometry.d.ts +54 -0
  361. package/dist/web/widgets/stacked-area-geometry.js +83 -0
  362. package/dist/web/widgets/stacked-area-model.d.ts +11 -0
  363. package/dist/web/widgets/stacked-area-model.js +1 -0
  364. package/dist/web/widgets/stacked-area-plot.d.ts +3 -0
  365. package/dist/web/widgets/stacked-area-plot.js +51 -0
  366. package/dist/web/widgets/stacked-area-props.d.ts +83 -0
  367. package/dist/web/widgets/stacked-area-props.js +16 -0
  368. package/dist/web/widgets/stacked-area-svg.d.ts +3 -0
  369. package/dist/web/widgets/stacked-area-svg.js +38 -0
  370. package/dist/web/widgets/stacked-area-tooltip.d.ts +3 -0
  371. package/dist/web/widgets/stacked-area-tooltip.js +86 -0
  372. package/dist/web/widgets/use-drawer-resize.d.ts +22 -0
  373. package/dist/web/widgets/use-drawer-resize.js +52 -0
  374. package/dist/web/widgets/use-stacked-area-tooltip.d.ts +9 -0
  375. package/dist/web/widgets/use-stacked-area-tooltip.js +34 -0
  376. package/dist/web/widgets/use-stacked-area-window.d.ts +20 -0
  377. package/dist/web/widgets/use-stacked-area-window.js +76 -0
  378. package/package.json +9 -9
  379. package/src/changes.json +163 -0
@@ -1,31 +1,53 @@
1
- // Evicts the oldest entry once `max` is exceeded and disposes only that one,
2
- // so several documents on one page keep their own loading tasks alive. A
3
- // resolved value that `shouldKeep` rejects (a handled failure) is dropped so
4
- // the next mount retries.
5
1
  export function createBoundedLoadCache(max, dispose, shouldKeep = () => true) {
6
2
  const entries = new Map();
7
- return (key, load) => {
8
- const cached = entries.get(key);
9
- if (cached !== undefined)
10
- return cached;
11
- const loading = load();
12
- entries.set(key, loading);
13
- // A failed load must not stick: the next mount retries instead of replaying the rejection.
14
- const forget = () => {
15
- if (entries.get(key) === loading)
16
- entries.delete(key);
17
- };
18
- loading.then((value) => {
19
- if (!shouldKeep(value))
20
- forget();
21
- }, forget);
22
- if (entries.size > max) {
23
- const [oldestKey, oldest] = entries.entries().next().value ?? [];
24
- if (oldestKey !== undefined && oldest !== undefined) {
25
- entries.delete(oldestKey);
26
- void oldest.then(dispose);
27
- }
3
+ const users = new Map();
4
+ const everRetained = new Set();
5
+ const evictIdle = (protectedKey) => {
6
+ for (const [key, entry] of entries) {
7
+ // skip: back within the bound, nothing more to evict
8
+ if (entries.size <= max)
9
+ return;
10
+ const idle = (users.get(key) ?? 0) === 0;
11
+ const settled = everRetained.has(key) || entries.size > max * 2;
12
+ if (key === protectedKey || !idle || !settled)
13
+ continue;
14
+ entries.delete(key);
15
+ everRetained.delete(key);
16
+ void entry.then(dispose);
28
17
  }
29
- return loading;
18
+ };
19
+ return {
20
+ load: (key, load) => {
21
+ const cached = entries.get(key);
22
+ if (cached !== undefined)
23
+ return cached;
24
+ const loading = load();
25
+ entries.set(key, loading);
26
+ // A failed load must not stick: the next mount retries instead of replaying the rejection.
27
+ const forget = () => {
28
+ if (entries.get(key) === loading)
29
+ entries.delete(key);
30
+ };
31
+ loading.then((value) => {
32
+ if (!shouldKeep(value))
33
+ forget();
34
+ }, forget);
35
+ evictIdle(key);
36
+ return loading;
37
+ },
38
+ retain: (key) => {
39
+ users.set(key, (users.get(key) ?? 0) + 1);
40
+ everRetained.add(key);
41
+ return () => {
42
+ const remaining = (users.get(key) ?? 1) - 1;
43
+ if (remaining > 0) {
44
+ users.set(key, remaining);
45
+ // skip: other consumers still hold the entry
46
+ return;
47
+ }
48
+ users.delete(key);
49
+ evictIdle();
50
+ };
51
+ },
30
52
  };
31
53
  }
@@ -0,0 +1,35 @@
1
+ export type TimeseriesPoint = {
2
+ readonly atMs: number;
3
+ /** null = outage/no value → falls to the baseline for a visible drop. */
4
+ readonly value: number | null;
5
+ };
6
+ export declare const SINGLE_POINT_RADIUS = 3;
7
+ export declare function clampDotY(y: number, height: number): number;
8
+ export type ChartTone = "positive" | "negative" | "active" | "neutral";
9
+ export declare function chartToneColor(tone: ChartTone): string;
10
+ export type ChartSeries = {
11
+ readonly key: string;
12
+ /** Translated by the caller. */
13
+ readonly label: string;
14
+ readonly points: readonly TimeseriesPoint[];
15
+ };
16
+ export type ChartMarker = {
17
+ readonly atMs: number;
18
+ readonly label: string;
19
+ /** Colors the pin and, on StackedAreaChart, draws a dashed guide line in the plot. */
20
+ readonly color?: string;
21
+ /** Translated by the caller. Groups markers into one legend entry when `markerLegend` is "legend". */
22
+ readonly legendLabel?: string;
23
+ };
24
+ /** Unstacked line drawn over a StackedAreaChart on the same y scale. */
25
+ export type ChartLine = ChartSeries & {
26
+ readonly dashed?: boolean;
27
+ };
28
+ export type ToneMap = Readonly<Record<string, ChartTone>>;
29
+ /** Key -> raw CSS color; wins over the tone map. */
30
+ export type ColorMap = Readonly<Record<string, string>>;
31
+ export declare function chartColor(key: string, index: number, tones: ToneMap | undefined, colors?: ColorMap): string;
32
+ export declare function bucketTimes(series: readonly ChartSeries[]): readonly number[];
33
+ export declare function valueAt(series: ChartSeries, atMs: number): number;
34
+ export declare function seriesTotal(series: ChartSeries): number;
35
+ export declare function percent(fraction: number): string;
@@ -0,0 +1,37 @@
1
+ export const SINGLE_POINT_RADIUS = 3;
2
+ export function clampDotY(y, height) {
3
+ return Math.max(SINGLE_POINT_RADIUS, Math.min(height - SINGLE_POINT_RADIUS, y));
4
+ }
5
+ const CHART_TONE_VAR = {
6
+ positive: "var(--color-status-ok)",
7
+ negative: "var(--color-status-bad)",
8
+ active: "var(--color-status-active)",
9
+ neutral: "var(--color-status-neutral)",
10
+ };
11
+ export function chartToneColor(tone) {
12
+ return CHART_TONE_VAR[tone];
13
+ }
14
+ const CHART_FALLBACK_TONES = ["active", "positive", "negative", "neutral"];
15
+ export function chartColor(key, index, tones, colors) {
16
+ const color = colors?.[key];
17
+ if (color !== undefined)
18
+ return color;
19
+ const tone = tones?.[key] ?? CHART_FALLBACK_TONES[index % CHART_FALLBACK_TONES.length] ?? "active";
20
+ return CHART_TONE_VAR[tone];
21
+ }
22
+ export function bucketTimes(series) {
23
+ const times = new Set();
24
+ for (const s of series)
25
+ for (const p of s.points)
26
+ times.add(p.atMs);
27
+ return [...times].sort((a, b) => a - b);
28
+ }
29
+ export function valueAt(series, atMs) {
30
+ return series.points.find((p) => p.atMs === atMs)?.value ?? 0;
31
+ }
32
+ export function seriesTotal(series) {
33
+ return series.points.reduce((sum, p) => sum + (p.value ?? 0), 0);
34
+ }
35
+ export function percent(fraction) {
36
+ return `${(fraction * 100).toFixed(2)}%`;
37
+ }
@@ -0,0 +1,26 @@
1
+ import type { ReactNode } from "react";
2
+ import { type ChartMarker } from "./chart-data.ts";
3
+ export declare function assignPinRows(fractions: readonly number[]): readonly number[];
4
+ export type KeyedMarker = ChartMarker & {
5
+ readonly key: string;
6
+ };
7
+ export declare function sortMarkers(markers: readonly ChartMarker[]): readonly KeyedMarker[];
8
+ export declare function MarkerPins({ markers, windowStartMs, windowEndMs, numbered, formatMarkerTime, className, }: {
9
+ readonly className?: string;
10
+ readonly markers: readonly ChartMarker[];
11
+ readonly windowStartMs: number;
12
+ readonly windowEndMs: number;
13
+ /** false: plain colored dots whose tooltip carries label and time. */
14
+ readonly numbered?: boolean;
15
+ readonly formatMarkerTime?: (atMs: number) => string;
16
+ }): ReactNode;
17
+ export declare function markerLegendItems(markers: readonly ChartMarker[]): readonly {
18
+ readonly key: string;
19
+ readonly label: string;
20
+ readonly color: string;
21
+ }[];
22
+ export declare function MarkerLegend({ markers, formatMarkerTime, className, }: {
23
+ readonly className?: string;
24
+ readonly markers: readonly ChartMarker[];
25
+ readonly formatMarkerTime?: (atMs: number) => string;
26
+ }): ReactNode;
@@ -0,0 +1,64 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { cn } from "../lib/cn.js";
3
+ import { percent } from "./chart-data.js";
4
+ // A 16px pin on a ~230px-wide plot (390px viewport) collides when markers sit
5
+ // within ~7% of each other, so close pins are staggered into extra rows.
6
+ const MARKER_PIN_MIN_GAP_FRACTION = 0.07;
7
+ const MARKER_PIN_MAX_ROWS = 3;
8
+ const MARKER_PIN_ROW_HEIGHT_PX = 18;
9
+ export function assignPinRows(fractions) {
10
+ const lastFractionPerRow = [];
11
+ return fractions.map((fraction) => {
12
+ let row = lastFractionPerRow.findIndex((last) => fraction - last >= MARKER_PIN_MIN_GAP_FRACTION);
13
+ if (row === -1) {
14
+ row =
15
+ lastFractionPerRow.length < MARKER_PIN_MAX_ROWS
16
+ ? lastFractionPerRow.length
17
+ : MARKER_PIN_MAX_ROWS - 1;
18
+ }
19
+ lastFractionPerRow[row] = fraction;
20
+ return row;
21
+ });
22
+ }
23
+ // Two markers may share atMs and label, so the occurrence count keeps React keys unique.
24
+ export function sortMarkers(markers) {
25
+ const seen = new Map();
26
+ return [...markers]
27
+ .sort((a, b) => a.atMs - b.atMs)
28
+ .map((marker) => {
29
+ const base = `${marker.atMs}-${marker.label}`;
30
+ const occurrence = seen.get(base) ?? 0;
31
+ seen.set(base, occurrence + 1);
32
+ return { ...marker, key: `${base}-${occurrence}` };
33
+ });
34
+ }
35
+ export function MarkerPins({ markers, windowStartMs, windowEndMs, numbered = true, formatMarkerTime, className, }) {
36
+ const span = Math.max(1, windowEndMs - windowStartMs);
37
+ const sorted = sortMarkers(markers);
38
+ const fractions = sorted.map((marker) => Math.max(0, Math.min(1, (marker.atMs - windowStartMs) / span)));
39
+ const rows = assignPinRows(fractions);
40
+ const rowCount = Math.max(1, ...rows.map((row) => row + 1));
41
+ return (_jsx("div", { "aria-hidden": "true", className: cn("relative mt-1", className), style: { height: rowCount * MARKER_PIN_ROW_HEIGHT_PX }, children: sorted.map((marker, i) => (_jsx("span", { "data-testid": "chart-marker-pin", title: numbered
42
+ ? undefined
43
+ : formatMarkerTime === undefined
44
+ ? marker.label
45
+ : `${marker.label} · ${formatMarkerTime(marker.atMs)}`, className: cn("absolute flex -translate-x-1/2 items-center justify-center rounded-full text-[10px] font-medium text-background", numbered ? "size-4" : "size-2", marker.color === undefined && "bg-foreground"), style: {
46
+ left: percent(fractions[i] ?? 0),
47
+ top: (rows[i] ?? 0) * MARKER_PIN_ROW_HEIGHT_PX + (numbered ? 0 : 4),
48
+ ...(marker.color !== undefined && { backgroundColor: marker.color }),
49
+ }, children: numbered ? i + 1 : null }, marker.key))) }));
50
+ }
51
+ export function markerLegendItems(markers) {
52
+ const items = new Map();
53
+ for (const marker of markers) {
54
+ const label = marker.legendLabel ?? marker.label;
55
+ const color = marker.color ?? "var(--color-foreground)";
56
+ const key = `marker-${label}-${color}`;
57
+ if (!items.has(key))
58
+ items.set(key, { key, label, color });
59
+ }
60
+ return [...items.values()];
61
+ }
62
+ export function MarkerLegend({ markers, formatMarkerTime, className, }) {
63
+ return (_jsx("ol", { className: cn("flex flex-col gap-1 text-xs text-muted-foreground", className), children: sortMarkers(markers).map((marker, i) => (_jsxs("li", { "data-testid": "chart-marker-item", className: "flex gap-2", children: [_jsx("span", { className: "w-4 shrink-0 text-center tabular-nums text-foreground", style: marker.color !== undefined ? { color: marker.color } : undefined, children: i + 1 }), _jsx("span", { children: marker.label }), formatMarkerTime !== undefined && (_jsx("span", { className: "ml-auto tabular-nums", children: formatMarkerTime(marker.atMs) }))] }, marker.key))) }));
64
+ }
@@ -0,0 +1,20 @@
1
+ import type { ReactNode } from "react";
2
+ export declare function ChartLegend({ items, formatValue, }: {
3
+ readonly items: readonly {
4
+ readonly key: string;
5
+ /** Defaults to the key; set when the key is prefixed to avoid collisions. */
6
+ readonly testIdKey?: string;
7
+ readonly label: string;
8
+ readonly color: string;
9
+ /** Omitted: no sum next to the label. */
10
+ readonly total?: number;
11
+ readonly swatch?: "area" | "line" | "dashed-line";
12
+ }[];
13
+ readonly formatValue: (value: number) => string;
14
+ }): ReactNode;
15
+ export declare function evenYTickValues(max: number): readonly number[];
16
+ export declare function YTicks({ values, formatValue, className, }: {
17
+ readonly values: readonly number[];
18
+ readonly formatValue: (value: number) => string;
19
+ readonly className?: string;
20
+ }): ReactNode;
@@ -0,0 +1,15 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { cn } from "../lib/cn.js";
3
+ export function ChartLegend({ items, formatValue, }) {
4
+ return (_jsx("ul", { className: "flex flex-wrap gap-x-4 gap-y-1 text-xs text-muted-foreground", children: items.map((item) => (_jsxs("li", { "data-testid": `chart-legend-${item.testIdKey ?? item.key}`, className: "flex items-center gap-1.5", children: [item.swatch === undefined || item.swatch === "area" ? (_jsx("span", { "aria-hidden": "true", className: "size-2 rounded-[2px]", style: { backgroundColor: item.color } })) : (_jsx("span", { "aria-hidden": "true", className: "w-3 border-t-2", style: {
5
+ borderColor: item.color,
6
+ borderTopStyle: item.swatch === "dashed-line" ? "dashed" : "solid",
7
+ } })), _jsx("span", { children: item.label }), item.total !== undefined && (_jsx("span", { className: "tabular-nums text-foreground", children: formatValue(item.total) }))] }, item.key))) }));
8
+ }
9
+ const Y_TICK_COUNT = 3;
10
+ export function evenYTickValues(max) {
11
+ return Array.from({ length: Y_TICK_COUNT }, (_, i) => (max / (Y_TICK_COUNT - 1)) * i);
12
+ }
13
+ export function YTicks({ values, formatValue, className, }) {
14
+ return (_jsx("div", { "aria-hidden": "true", className: cn("flex flex-col-reverse justify-between text-right text-[11px] tabular-nums text-muted-foreground", className), children: values.map((value, i) => (_jsx("span", { children: formatValue(value) }, i))) }));
15
+ }
@@ -1,5 +1,5 @@
1
1
  import { type ReactNode } from "react";
2
- import { type StackedAreaDateFormat, type StackedAreaInitialWindow, type StackedAreaRanges, type StackedAreaWindowSelection } from "./chart-window.ts";
2
+ import { type ChartMarker, type ChartSeries, type ColorMap, type TimeseriesPoint, type ToneMap } from "./chart-data.ts";
3
3
  import { type StatusTone } from "./status-badge.tsx";
4
4
  export type StatusBarEntry = {
5
5
  /** Stable key (z.B. ISO-Datum). */
@@ -31,11 +31,6 @@ export declare function smoothPath(pts: ReadonlyArray<{
31
31
  readonly x: number;
32
32
  readonly y: number;
33
33
  }>): string;
34
- export type TimeseriesPoint = {
35
- readonly atMs: number;
36
- /** null = outage/no value → falls to the baseline for a visible drop. */
37
- readonly value: number | null;
38
- };
39
34
  export type TimeseriesYAxis = {
40
35
  /** Number of gridlines including the zero baseline (min 2). Tick values are
41
36
  * rounded to 1/2/5 x 10^n steps and the y-scale reaches the top tick. */
@@ -97,26 +92,6 @@ export declare function TimeseriesChart({ points, windowStartMs, windowEndMs, to
97
92
  readonly emptyContent?: ReactNode;
98
93
  readonly testId?: string;
99
94
  }): ReactNode;
100
- export type ChartTone = "positive" | "negative" | "active" | "neutral";
101
- export declare function chartToneColor(tone: ChartTone): string;
102
- export type ChartSeries = {
103
- readonly key: string;
104
- /** Translated by the caller. */
105
- readonly label: string;
106
- readonly points: readonly TimeseriesPoint[];
107
- };
108
- export type ChartMarker = {
109
- readonly atMs: number;
110
- readonly label: string;
111
- /** Colors the pin and, on StackedAreaChart, draws a dashed guide line in the plot. */
112
- readonly color?: string;
113
- /** Translated by the caller. Groups markers into one legend entry when `markerLegend` is "legend". */
114
- readonly legendLabel?: string;
115
- };
116
- /** Unstacked line drawn over a StackedAreaChart on the same y scale. */
117
- export type ChartLine = ChartSeries & {
118
- readonly dashed?: boolean;
119
- };
120
95
  export type SegmentBarRow = {
121
96
  readonly key: string;
122
97
  readonly label: string;
@@ -127,10 +102,6 @@ export type SegmentBarRow = {
127
102
  readonly value: number;
128
103
  }[];
129
104
  };
130
- type ToneMap = Readonly<Record<string, ChartTone>>;
131
- /** Key -> raw CSS color; wins over the tone map. */
132
- type ColorMap = Readonly<Record<string, string>>;
133
- export declare function assignPinRows(fractions: readonly number[]): readonly number[];
134
105
  /** Vertically stacked bars per bucket (x axis = bucket, not time).
135
106
  * The last bucket carries `todayLabel` when it contains `windowEndMs` and
136
107
  * has day granularity. */
@@ -158,51 +129,7 @@ export declare function SegmentBarChart({ rows, tones, colors, ariaLabel, format
158
129
  readonly formatValue?: (value: number) => string;
159
130
  readonly testId?: string;
160
131
  }): ReactNode;
161
- /** Stacked bands over time. Right of `todayMs` is the forecast: lighter
162
- * fill plus a vertical "today" line. */
163
- export declare function StackedAreaChart({ series: allSeries, windowStartMs: fullWindowStartMs, windowEndMs: fullWindowEndMs, todayMs, tones, colors, markers: allMarkers, lines: allLines, ranges, initialWindow, brush, windowSelection, onWindowSelectionChange, brushLabels, ariaLabel, todayLabel, formatBucketLabel, formatValue, formatAxisValue, formatMarkerTime, dateFormat, timeZone, markerLegend, markerLabels, scrollable, showLegendTotals, emptyContent, testId, }: {
164
- readonly series: readonly ChartSeries[];
165
- readonly windowStartMs: number;
166
- readonly windowEndMs: number;
167
- readonly todayMs?: number;
168
- readonly tones?: ToneMap;
169
- readonly colors?: ColorMap;
170
- readonly markers?: readonly ChartMarker[];
171
- /** Drawn over the bands, not stacked. A `null` value breaks the line. */
172
- readonly lines?: readonly ChartLine[];
173
- /** Range presets anchored at today; uncontrolled, the widget renders the switch itself. */
174
- readonly ranges?: StackedAreaRanges;
175
- /** Uncontrolled start window; "from-today" ignores the default range and starts at today. */
176
- readonly initialWindow?: StackedAreaInitialWindow;
177
- /** Scrubber under the plot to drag the visible window; starts at today without `ranges`. */
178
- readonly brush?: boolean;
179
- readonly windowSelection?: StackedAreaWindowSelection;
180
- /** Makes the window controlled: no own range switch, `windowSelection` is the only source. */
181
- readonly onWindowSelectionChange?: (selection: StackedAreaWindowSelection) => void;
182
- /** aria-labels of the two brush handles. */
183
- readonly brushLabels?: {
184
- readonly start: string;
185
- readonly end: string;
186
- };
187
- readonly ariaLabel: string;
188
- readonly todayLabel: string;
189
- readonly formatBucketLabel: (atMs: number, format: StackedAreaDateFormat) => string;
190
- readonly formatValue?: (value: number) => string;
191
- /** y-axis tick labels only (legend and totals keep `formatValue`); defaults to `formatValue`. */
192
- readonly formatAxisValue?: (value: number) => string;
193
- readonly formatMarkerTime?: (atMs: number, format: StackedAreaDateFormat) => string;
194
- /** Overrides the automatic format (month and year once the visible window spans 18 months). */
195
- readonly dateFormat?: StackedAreaDateFormat;
196
- /** Zone the x-axis ticks align to; must match the zone `formatBucketLabel` formats in. Default UTC. */
197
- readonly timeZone?: string;
198
- /** "legend": unnumbered pins with tooltip, one dashed legend entry per marker label and color. */
199
- readonly markerLegend?: "list" | "legend";
200
- /** Writes each marker label vertically next to its guide line on wide containers; narrow ones keep the pins. */
201
- readonly markerLabels?: boolean;
202
- /** Fixed width per bucket; the plot scrolls horizontally, y ticks stay put. */
203
- readonly scrollable?: boolean;
204
- readonly showLegendTotals?: boolean;
205
- readonly emptyContent?: ReactNode;
206
- readonly testId?: string;
207
- }): ReactNode;
208
- export {};
132
+ export type { ChartLine, ChartMarker, ChartSeries, ChartTone, TimeseriesPoint, } from "./chart-data.ts";
133
+ export { chartToneColor } from "./chart-data.ts";
134
+ export { assignPinRows } from "./chart-markers.tsx";
135
+ export { StackedAreaChart } from "./stacked-area-chart.tsx";