@k2b/ui 0.48.0 → 0.50.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 (304) hide show
  1. package/dist/base.css +40 -2
  2. package/dist/browser/actions/ContextMenu.js +3 -0
  3. package/dist/browser/actions/ContextMenu.js.map +1 -1
  4. package/dist/browser/actions/CopyButton.js +26 -18
  5. package/dist/browser/actions/CopyButton.js.map +1 -1
  6. package/dist/browser/charts/core/area.js +190 -0
  7. package/dist/browser/charts/core/area.js.map +1 -0
  8. package/dist/browser/charts/core/calendar.js +186 -0
  9. package/dist/browser/charts/core/calendar.js.map +1 -0
  10. package/dist/browser/charts/core/chart-map-data.js +9 -0
  11. package/dist/browser/charts/core/chart-map-data.js.map +1 -0
  12. package/dist/browser/charts/core/index.js +12 -0
  13. package/dist/browser/charts/core/index.js.map +1 -0
  14. package/dist/browser/charts/core/inspection.js +9 -0
  15. package/dist/browser/charts/core/inspection.js.map +1 -0
  16. package/dist/browser/charts/core/registry.js +28 -0
  17. package/dist/browser/charts/core/registry.js.map +1 -0
  18. package/dist/browser/charts/core/render.js +103 -0
  19. package/dist/browser/charts/core/render.js.map +1 -0
  20. package/dist/browser/charts/core/snapshot.js +65 -0
  21. package/dist/browser/charts/core/snapshot.js.map +1 -0
  22. package/dist/browser/charts/core/svg.js +2542 -0
  23. package/dist/browser/charts/core/svg.js.map +1 -0
  24. package/dist/browser/charts/core/termination.test-fixture.js +162 -0
  25. package/dist/browser/charts/core/termination.test-fixture.js.map +1 -0
  26. package/dist/browser/charts/core/text.js +13 -0
  27. package/dist/browser/charts/core/text.js.map +1 -0
  28. package/dist/browser/charts/core/types.js +8 -0
  29. package/dist/browser/charts/core/types.js.map +1 -0
  30. package/dist/browser/charts.js +4 -2
  31. package/dist/browser/charts.js.map +1 -1
  32. package/dist/browser/content/BalanceSummary.js +106 -0
  33. package/dist/browser/content/BalanceSummary.js.map +1 -0
  34. package/dist/browser/content/Chart.js +134 -115
  35. package/dist/browser/content/Chart.js.map +1 -1
  36. package/dist/browser/content/ChartExplorer.js +366 -122
  37. package/dist/browser/content/ChartExplorer.js.map +1 -1
  38. package/dist/browser/content/ChartSnapshotView.js +16 -9
  39. package/dist/browser/content/ChartSnapshotView.js.map +1 -1
  40. package/dist/browser/content/DataTable.js +676 -293
  41. package/dist/browser/content/DataTable.js.map +1 -1
  42. package/dist/browser/content/DataTableTools.js +119 -0
  43. package/dist/browser/content/DataTableTools.js.map +1 -0
  44. package/dist/browser/content/FlowAmount.js +82 -0
  45. package/dist/browser/content/FlowAmount.js.map +1 -0
  46. package/dist/browser/content/balance-summary-messages.js +26 -0
  47. package/dist/browser/content/balance-summary-messages.js.map +1 -0
  48. package/dist/browser/content/chart-bar.js +6 -6
  49. package/dist/browser/content/chart-bar.js.map +1 -1
  50. package/dist/browser/content/chart-calendar.js +43 -0
  51. package/dist/browser/content/chart-calendar.js.map +1 -0
  52. package/dist/browser/content/chart-inspection-core.js +164 -37
  53. package/dist/browser/content/chart-inspection-core.js.map +1 -1
  54. package/dist/browser/content/chart-inspection.js.map +1 -1
  55. package/dist/browser/content/chart-line-gaps.js +2 -2
  56. package/dist/browser/content/chart-line-gaps.js.map +1 -1
  57. package/dist/browser/content/chart-map-viewport.js.map +1 -1
  58. package/dist/browser/content/chart-message-catalog.js +164 -0
  59. package/dist/browser/content/chart-message-catalog.js.map +1 -0
  60. package/dist/browser/content/chart-messages.js +2 -138
  61. package/dist/browser/content/chart-messages.js.map +1 -1
  62. package/dist/browser/content/chart-snapshot.js +1 -62
  63. package/dist/browser/content/chart-snapshot.js.map +1 -1
  64. package/dist/browser/content/chart-state-timeline.js +1 -1
  65. package/dist/browser/content/chart-state-timeline.js.map +1 -1
  66. package/dist/browser/content/chart-svg.js +2 -1
  67. package/dist/browser/content/chart-svg.js.map +1 -1
  68. package/dist/browser/content/chart-time-axis.js +139 -0
  69. package/dist/browser/content/chart-time-axis.js.map +1 -0
  70. package/dist/browser/content/data-table-columns.js +160 -0
  71. package/dist/browser/content/data-table-columns.js.map +1 -0
  72. package/dist/browser/content/data-table-messages.js +38 -2
  73. package/dist/browser/content/data-table-messages.js.map +1 -1
  74. package/dist/browser/content/flow-amount-messages.js +26 -0
  75. package/dist/browser/content/flow-amount-messages.js.map +1 -0
  76. package/dist/browser/content/index.js +4 -0
  77. package/dist/browser/content/index.js.map +1 -1
  78. package/dist/browser/feedback/prompt-confirm.js +7 -4
  79. package/dist/browser/feedback/prompt-confirm.js.map +1 -1
  80. package/dist/browser/feedback/prompts.js +3 -3
  81. package/dist/browser/feedback/prompts.js.map +1 -1
  82. package/dist/browser/inputs/DatePicker.js +5 -4
  83. package/dist/browser/inputs/DatePicker.js.map +1 -1
  84. package/dist/browser/inputs/NumberInput.js +17 -5
  85. package/dist/browser/inputs/NumberInput.js.map +1 -1
  86. package/dist/browser/inputs/SelectChip.js +50 -17
  87. package/dist/browser/inputs/SelectChip.js.map +1 -1
  88. package/dist/browser/inputs/date-picker.js +13 -0
  89. package/dist/browser/inputs/date-picker.js.map +1 -1
  90. package/dist/browser/intl/Format.js +31 -8
  91. package/dist/browser/intl/Format.js.map +1 -1
  92. package/dist/browser/layout/AppWorkspace.js +580 -522
  93. package/dist/browser/layout/AppWorkspace.js.map +1 -1
  94. package/dist/browser/layout/MobileShell.js +26 -0
  95. package/dist/browser/layout/MobileShell.js.map +1 -1
  96. package/dist/browser/layout/index.js +1 -0
  97. package/dist/browser/layout/index.js.map +1 -1
  98. package/dist/browser/layout/sheet-handle.js +155 -0
  99. package/dist/browser/layout/sheet-handle.js.map +1 -0
  100. package/dist/browser/surfaces/BudgetList.js +281 -0
  101. package/dist/browser/surfaces/BudgetList.js.map +1 -0
  102. package/dist/browser/surfaces/NoticeCard.js +48 -29
  103. package/dist/browser/surfaces/NoticeCard.js.map +1 -1
  104. package/dist/browser/surfaces/ProgressBar.js +134 -21
  105. package/dist/browser/surfaces/ProgressBar.js.map +1 -1
  106. package/dist/browser/surfaces/StatCell.js +320 -144
  107. package/dist/browser/surfaces/StatCell.js.map +1 -1
  108. package/dist/browser/surfaces/StatGrid.js +75 -57
  109. package/dist/browser/surfaces/StatGrid.js.map +1 -1
  110. package/dist/browser/surfaces/budget-messages.js +64 -0
  111. package/dist/browser/surfaces/budget-messages.js.map +1 -0
  112. package/dist/browser/surfaces/delta-badge.js +65 -0
  113. package/dist/browser/surfaces/delta-badge.js.map +1 -0
  114. package/dist/browser/surfaces/index.js +2 -1
  115. package/dist/browser/surfaces/index.js.map +1 -1
  116. package/dist/browser/surfaces/person-color.js +2 -2
  117. package/dist/browser/surfaces/person-color.js.map +1 -1
  118. package/dist/browser/surfaces/stat-cell-messages.js +41 -0
  119. package/dist/browser/surfaces/stat-cell-messages.js.map +1 -0
  120. package/dist/browser/widgets/Dashboard.js +137 -0
  121. package/dist/browser/widgets/Dashboard.js.map +1 -0
  122. package/dist/browser/widgets/index.js +1 -0
  123. package/dist/browser/widgets/index.js.map +1 -1
  124. package/dist/ssr/actions/ContextMenu.js +3 -0
  125. package/dist/ssr/actions/ContextMenu.js.map +1 -1
  126. package/dist/ssr/actions/CopyButton.js +13 -8
  127. package/dist/ssr/actions/CopyButton.js.map +1 -1
  128. package/dist/ssr/charts/core/area.js +190 -0
  129. package/dist/ssr/charts/core/area.js.map +1 -0
  130. package/dist/ssr/charts/core/calendar.js +186 -0
  131. package/dist/ssr/charts/core/calendar.js.map +1 -0
  132. package/dist/ssr/charts/core/chart-map-data.js +9 -0
  133. package/dist/ssr/charts/core/chart-map-data.js.map +1 -0
  134. package/dist/ssr/charts/core/index.js +12 -0
  135. package/dist/ssr/charts/core/index.js.map +1 -0
  136. package/dist/ssr/charts/core/inspection.js +9 -0
  137. package/dist/ssr/charts/core/inspection.js.map +1 -0
  138. package/dist/ssr/charts/core/registry.js +28 -0
  139. package/dist/ssr/charts/core/registry.js.map +1 -0
  140. package/dist/ssr/charts/core/render.js +103 -0
  141. package/dist/ssr/charts/core/render.js.map +1 -0
  142. package/dist/ssr/charts/core/snapshot.js +65 -0
  143. package/dist/ssr/charts/core/snapshot.js.map +1 -0
  144. package/dist/ssr/charts/core/svg.js +2542 -0
  145. package/dist/ssr/charts/core/svg.js.map +1 -0
  146. package/dist/ssr/charts/core/termination.test-fixture.js +162 -0
  147. package/dist/ssr/charts/core/termination.test-fixture.js.map +1 -0
  148. package/dist/ssr/charts/core/text.js +13 -0
  149. package/dist/ssr/charts/core/text.js.map +1 -0
  150. package/dist/ssr/charts/core/types.js +8 -0
  151. package/dist/ssr/charts/core/types.js.map +1 -0
  152. package/dist/ssr/charts.js +4 -2
  153. package/dist/ssr/charts.js.map +1 -1
  154. package/dist/ssr/content/BalanceSummary.js +75 -0
  155. package/dist/ssr/content/BalanceSummary.js.map +1 -0
  156. package/dist/ssr/content/Chart.js +90 -95
  157. package/dist/ssr/content/Chart.js.map +1 -1
  158. package/dist/ssr/content/ChartExplorer.js +190 -46
  159. package/dist/ssr/content/ChartExplorer.js.map +1 -1
  160. package/dist/ssr/content/ChartSnapshotView.js +5 -1
  161. package/dist/ssr/content/ChartSnapshotView.js.map +1 -1
  162. package/dist/ssr/content/DataTable.js +287 -78
  163. package/dist/ssr/content/DataTable.js.map +1 -1
  164. package/dist/ssr/content/DataTableTools.js +106 -0
  165. package/dist/ssr/content/DataTableTools.js.map +1 -0
  166. package/dist/ssr/content/FlowAmount.js +58 -0
  167. package/dist/ssr/content/FlowAmount.js.map +1 -0
  168. package/dist/ssr/content/balance-summary-messages.js +26 -0
  169. package/dist/ssr/content/balance-summary-messages.js.map +1 -0
  170. package/dist/ssr/content/chart-bar.js +6 -6
  171. package/dist/ssr/content/chart-bar.js.map +1 -1
  172. package/dist/ssr/content/chart-calendar.js +43 -0
  173. package/dist/ssr/content/chart-calendar.js.map +1 -0
  174. package/dist/ssr/content/chart-inspection-core.js +164 -37
  175. package/dist/ssr/content/chart-inspection-core.js.map +1 -1
  176. package/dist/ssr/content/chart-inspection.js.map +1 -1
  177. package/dist/ssr/content/chart-line-gaps.js +2 -2
  178. package/dist/ssr/content/chart-line-gaps.js.map +1 -1
  179. package/dist/ssr/content/chart-map-viewport.js.map +1 -1
  180. package/dist/ssr/content/chart-message-catalog.js +164 -0
  181. package/dist/ssr/content/chart-message-catalog.js.map +1 -0
  182. package/dist/ssr/content/chart-messages.js +2 -138
  183. package/dist/ssr/content/chart-messages.js.map +1 -1
  184. package/dist/ssr/content/chart-snapshot.js +1 -62
  185. package/dist/ssr/content/chart-snapshot.js.map +1 -1
  186. package/dist/ssr/content/chart-state-timeline.js +1 -1
  187. package/dist/ssr/content/chart-state-timeline.js.map +1 -1
  188. package/dist/ssr/content/chart-svg.js +2 -1
  189. package/dist/ssr/content/chart-svg.js.map +1 -1
  190. package/dist/ssr/content/chart-time-axis.js +139 -0
  191. package/dist/ssr/content/chart-time-axis.js.map +1 -0
  192. package/dist/ssr/content/data-table-columns.js +160 -0
  193. package/dist/ssr/content/data-table-columns.js.map +1 -0
  194. package/dist/ssr/content/data-table-messages.js +38 -2
  195. package/dist/ssr/content/data-table-messages.js.map +1 -1
  196. package/dist/ssr/content/flow-amount-messages.js +26 -0
  197. package/dist/ssr/content/flow-amount-messages.js.map +1 -0
  198. package/dist/ssr/content/index.js +4 -0
  199. package/dist/ssr/content/index.js.map +1 -1
  200. package/dist/ssr/feedback/prompt-confirm.js +7 -4
  201. package/dist/ssr/feedback/prompt-confirm.js.map +1 -1
  202. package/dist/ssr/feedback/prompts.js +3 -3
  203. package/dist/ssr/feedback/prompts.js.map +1 -1
  204. package/dist/ssr/inputs/DatePicker.js +5 -4
  205. package/dist/ssr/inputs/DatePicker.js.map +1 -1
  206. package/dist/ssr/inputs/NumberInput.js +17 -5
  207. package/dist/ssr/inputs/NumberInput.js.map +1 -1
  208. package/dist/ssr/inputs/SelectChip.js +26 -9
  209. package/dist/ssr/inputs/SelectChip.js.map +1 -1
  210. package/dist/ssr/inputs/date-picker.js +13 -0
  211. package/dist/ssr/inputs/date-picker.js.map +1 -1
  212. package/dist/ssr/intl/Format.js +22 -2
  213. package/dist/ssr/intl/Format.js.map +1 -1
  214. package/dist/ssr/layout/AppWorkspace.js +158 -114
  215. package/dist/ssr/layout/AppWorkspace.js.map +1 -1
  216. package/dist/ssr/layout/MobileShell.js +26 -0
  217. package/dist/ssr/layout/MobileShell.js.map +1 -1
  218. package/dist/ssr/layout/index.js +1 -0
  219. package/dist/ssr/layout/index.js.map +1 -1
  220. package/dist/ssr/layout/sheet-handle.js +155 -0
  221. package/dist/ssr/layout/sheet-handle.js.map +1 -0
  222. package/dist/ssr/surfaces/BudgetList.js +170 -0
  223. package/dist/ssr/surfaces/BudgetList.js.map +1 -0
  224. package/dist/ssr/surfaces/NoticeCard.js +25 -10
  225. package/dist/ssr/surfaces/NoticeCard.js.map +1 -1
  226. package/dist/ssr/surfaces/ProgressBar.js +96 -5
  227. package/dist/ssr/surfaces/ProgressBar.js.map +1 -1
  228. package/dist/ssr/surfaces/StatCell.js +157 -51
  229. package/dist/ssr/surfaces/StatCell.js.map +1 -1
  230. package/dist/ssr/surfaces/StatGrid.js +24 -35
  231. package/dist/ssr/surfaces/StatGrid.js.map +1 -1
  232. package/dist/ssr/surfaces/budget-messages.js +64 -0
  233. package/dist/ssr/surfaces/budget-messages.js.map +1 -0
  234. package/dist/ssr/surfaces/delta-badge.js +41 -0
  235. package/dist/ssr/surfaces/delta-badge.js.map +1 -0
  236. package/dist/ssr/surfaces/index.js +2 -1
  237. package/dist/ssr/surfaces/index.js.map +1 -1
  238. package/dist/ssr/surfaces/person-color.js +2 -2
  239. package/dist/ssr/surfaces/person-color.js.map +1 -1
  240. package/dist/ssr/surfaces/stat-cell-messages.js +41 -0
  241. package/dist/ssr/surfaces/stat-cell-messages.js.map +1 -0
  242. package/dist/ssr/widgets/Dashboard.js +84 -0
  243. package/dist/ssr/widgets/Dashboard.js.map +1 -0
  244. package/dist/ssr/widgets/index.js +1 -0
  245. package/dist/ssr/widgets/index.js.map +1 -1
  246. package/dist/styles.css +1 -1
  247. package/dist/types/charts/core/area.d.ts +62 -0
  248. package/dist/types/charts/core/calendar.d.ts +57 -0
  249. package/dist/types/charts/core/chart-map-data.d.ts +3 -0
  250. package/dist/types/charts/core/index.d.ts +11 -0
  251. package/dist/types/charts/core/inspection.d.ts +16 -0
  252. package/dist/types/charts/core/registry.d.ts +27 -0
  253. package/dist/types/charts/core/render.d.ts +40 -0
  254. package/dist/types/charts/core/snapshot.d.ts +27 -0
  255. package/dist/types/charts/core/svg.d.ts +714 -0
  256. package/dist/types/charts/core/termination.test-fixture.d.ts +1 -0
  257. package/dist/types/charts/core/text.d.ts +5 -0
  258. package/dist/types/charts/core/types.d.ts +31 -0
  259. package/dist/types/charts.d.ts +4 -2
  260. package/dist/types/content/BalanceSummary.d.ts +29 -0
  261. package/dist/types/content/Chart.d.ts +26 -36
  262. package/dist/types/content/ChartExplorer.d.ts +43 -2
  263. package/dist/types/content/ChartSnapshotView.d.ts +1 -0
  264. package/dist/types/content/DataTable.d.ts +28 -0
  265. package/dist/types/content/DataTableTools.d.ts +44 -0
  266. package/dist/types/content/FlowAmount.d.ts +28 -0
  267. package/dist/types/content/balance-summary-messages.d.ts +11 -0
  268. package/dist/types/content/chart-bar.d.ts +1 -1
  269. package/dist/types/content/chart-calendar.d.ts +4 -0
  270. package/dist/types/content/chart-inspection-core.d.ts +21 -16
  271. package/dist/types/content/chart-inspection.d.ts +5 -1
  272. package/dist/types/content/chart-map-viewport.d.ts +1 -1
  273. package/dist/types/content/chart-message-catalog.d.ts +84 -0
  274. package/dist/types/content/chart-messages.d.ts +2 -33
  275. package/dist/types/content/chart-snapshot.d.ts +1 -26
  276. package/dist/types/content/chart-svg.d.ts +1 -1
  277. package/dist/types/content/chart-time-axis.d.ts +26 -0
  278. package/dist/types/content/data-table-columns.d.ts +72 -0
  279. package/dist/types/content/data-table-messages.d.ts +18 -0
  280. package/dist/types/content/flow-amount-messages.d.ts +11 -0
  281. package/dist/types/content/index.d.ts +10 -2
  282. package/dist/types/feedback/prompt-confirm.d.ts +3 -1
  283. package/dist/types/feedback/prompts.d.ts +2 -2
  284. package/dist/types/inputs/NumberInput.d.ts +1 -1
  285. package/dist/types/inputs/SelectChip.d.ts +2 -0
  286. package/dist/types/inputs/date-picker.d.ts +6 -0
  287. package/dist/types/intl/Format.d.ts +5 -0
  288. package/dist/types/layout/AppWorkspace.d.ts +21 -1
  289. package/dist/types/layout/MobileShell.d.ts +5 -0
  290. package/dist/types/layout/index.d.ts +2 -1
  291. package/dist/types/layout/sheet-handle.d.ts +21 -0
  292. package/dist/types/surfaces/BudgetList.d.ts +42 -0
  293. package/dist/types/surfaces/NoticeCard.d.ts +5 -2
  294. package/dist/types/surfaces/ProgressBar.d.ts +38 -2
  295. package/dist/types/surfaces/StatCell.d.ts +35 -2
  296. package/dist/types/surfaces/StatGrid.d.ts +3 -1
  297. package/dist/types/surfaces/budget-messages.d.ts +30 -0
  298. package/dist/types/surfaces/delta-badge.d.ts +10 -0
  299. package/dist/types/surfaces/index.d.ts +4 -3
  300. package/dist/types/surfaces/person-color.d.ts +2 -2
  301. package/dist/types/surfaces/stat-cell-messages.d.ts +19 -0
  302. package/dist/types/widgets/Dashboard.d.ts +42 -0
  303. package/dist/types/widgets/index.d.ts +1 -0
  304. package/package.json +7 -1
@@ -1,26 +1 @@
1
- import { type ChartDatum } from "@k2b/stdlib";
2
- import { type ChartKind, type ChartRenderOptions } from "./Chart";
3
- import { type ChartSelection, type ChartTooltip, type ChartTooltipFormatter } from "./chart-inspection-core";
4
- /** Trusted output of prepareChartSnapshot; never accept arbitrary user SVG. */
5
- export type ChartSnapshot = {
6
- kind: ChartKind;
7
- svg: string;
8
- width: number;
9
- height: number;
10
- stretch: boolean;
11
- marks: readonly {
12
- key: string;
13
- rowKey: string;
14
- datum: ChartDatum;
15
- tooltip: ChartTooltip;
16
- reference?: boolean;
17
- }[];
18
- };
19
- /** Pure SVG preparation for server or browser. Transfer only this output across SSR boundaries. */
20
- export declare function prepareChartSnapshot(options: ChartRenderOptions, inspection: {
21
- key: (selection: ChartSelection) => string;
22
- /** Defaults to the mark key for one-to-one charts. */
23
- rowKey?: (selection: ChartSelection) => string;
24
- tooltip: ChartTooltipFormatter;
25
- reference?: (selection: ChartSelection) => boolean;
26
- }): ChartSnapshot;
1
+ export { type ChartSnapshot, prepareChartSnapshot } from "../charts/core/snapshot";
@@ -1,4 +1,4 @@
1
- import type { MapViewport } from "@k2b/stdlib";
1
+ import type { MapViewport } from "../charts/core/svg";
2
2
  /** Give maps a CSS-sized viewport while retaining the renderer's projection.
3
3
  * The outer SVG uses pixels for headers/legend; the nested geographic viewport
4
4
  * keeps one fitted scale across zoom levels and clips only at the plot edges.
@@ -0,0 +1,26 @@
1
+ /**
2
+ * A line chart whose X values are instants (Unix milliseconds). Its axis ticks land on round times in `timeZone`:
3
+ * minutes, hours, days, weeks, months, or years, whichever step keeps the requested number of ticks.
4
+ */
5
+ export type ChartTimeAxis = {
6
+ /** IANA zone whose wall clock the ticks follow, such as the zone the data's buckets use. */
7
+ timeZone: string;
8
+ /** Locale of the default tick labels; `xAxis.format` replaces them. Defaults to `en`. */
9
+ locale?: string;
10
+ };
11
+ export type ChartTimeUnit = "minute" | "hour" | "day" | "week" | "month" | "year";
12
+ export type ChartTimeStep = {
13
+ unit: ChartTimeUnit;
14
+ size: number;
15
+ };
16
+ /** The round step for a time span: the finest one that keeps at most `maxTicks` ticks. */
17
+ export declare const chartTimeStep: (span: number, maxTicks: number) => ChartTimeStep;
18
+ /** Tick instants inside `domain` that fall on round wall times of `step` in `timeZone`. */
19
+ export declare const chartTimeTicks: (domain: readonly [number, number], timeZone: string, step: ChartTimeStep) => number[];
20
+ /** Default label of a tick: the clock time, the day at local midnight, the month or the year. */
21
+ export declare const chartTimeLabel: (tick: number, step: ChartTimeStep, axis: ChartTimeAxis) => string;
22
+ /**
23
+ * Replaces the renderer's X tick labels, which sit on decimal millisecond steps, with labels on round times. The
24
+ * renderer drew the X axis over the explicit `domain`, so its horizontal axis line gives the pixel scale.
25
+ */
26
+ export declare function timeAxisSvg(svg: string, domain: readonly [number, number], axis: ChartTimeAxis, maxTicks: number, format?: (value: number) => string): string;
@@ -0,0 +1,72 @@
1
+ import type { StatusTone } from "../surfaces/StatusBadge";
2
+ /**
3
+ * What a column holds. It decides alignment, wrapping, the shown text, search and sort:
4
+ * text wraps; number, amount, bar, flow and delta read right-aligned with equal-width digits; date reads in the
5
+ * reader's language; status shows a badge from `states`.
6
+ */
7
+ export type DataTableColumnType = "text" | "number" | "date" | "status" | "bar" | "amount" | "flow" | "delta";
8
+ /** A number format by name, as a portable description stores it. `decimals` fixes the fraction digits. */
9
+ export type DataTableNumberFormat = {
10
+ style?: "number" | "percent" | "currency";
11
+ /** ISO 4217 code; required for `style: "currency"`, `amount` and `flow`. */
12
+ currency?: string;
13
+ decimals?: number;
14
+ compact?: boolean;
15
+ };
16
+ /** The label and tone of one stored status value. */
17
+ export type DataTableStatusState = {
18
+ label: string;
19
+ tone: StatusTone;
20
+ };
21
+ /** The typed part of a column, independent of how the row stores its values. */
22
+ export type DataTableTypedColumn = {
23
+ type?: DataTableColumnType;
24
+ format?: DataTableNumberFormat;
25
+ /** Labels and tones of a status column, by stored value. */
26
+ states?: Readonly<Record<string, DataTableStatusState>>;
27
+ /** The value a bar column fills its track at; defaults to the largest value in the rows. */
28
+ max?: number;
29
+ /** The IANA zone a date column with a time reads in, such as the zone of the data's owner; defaults to the reader's. */
30
+ timeZone?: string;
31
+ /** How a delta column reads its change: `ratio` (default) `0.082` as `+8.2 %`, `points` `0.031` as `+3.1 pts`; `better` rates it. */
32
+ delta?: {
33
+ unit?: "ratio" | "points";
34
+ better?: "up" | "down";
35
+ };
36
+ };
37
+ export declare const isNumericColumnType: (type?: DataTableColumnType) => boolean;
38
+ /** Formats a number the way a typed column shows it: in the reader's language, by the column's format. */
39
+ export declare const formatTableNumber: (value: number, column: DataTableTypedColumn, locale: string) => string;
40
+ /** A date column reads ISO text, a timestamp or a Date; a day without a time stays that day in every zone. */
41
+ export declare const formatTableDate: (value: unknown, locale: string, timeZone?: string) => string | null;
42
+ /** True when the value is missing: such a cell shows a dash, sorts last and never counts as zero. */
43
+ export declare const isEmptyCell: (value: unknown) => boolean;
44
+ /**
45
+ * The text a typed cell shows, for search, grouping and copied rows. A flow is the amount without its sign, as the
46
+ * arrow says the direction; a delta is its signed change.
47
+ */
48
+ export declare const tableCellText: (value: unknown, column: DataTableTypedColumn, locale: string) => string;
49
+ /** The value a typed column sorts by: numbers by value, dates by time, a status by its label, the rest as text. */
50
+ export declare const tableSortValue: (value: unknown, column: DataTableTypedColumn, locale: string) => number | string | null;
51
+ type Readable<T> = DataTableTypedColumn & {
52
+ id: string;
53
+ value?: keyof T | ((row: T) => unknown);
54
+ };
55
+ export declare const readTableValue: <T>(row: T, column: Readable<T>) => unknown;
56
+ /**
57
+ * The rows any of whose shown values contains the query, ignoring case and accents. An empty query keeps every row.
58
+ * Matches the text a reader sees, so a status matches by its label and an amount as it is formatted.
59
+ */
60
+ export declare const filterRows: <T>(rows: readonly T[], columns: readonly Readable<T>[], query: string, locale: string) => T[];
61
+ /** Rows in the order of one column: values first, missing values last in both directions. */
62
+ export declare const sortRows: <T>(rows: readonly T[], columns: readonly Readable<T>[], sort: {
63
+ key: string;
64
+ direction: "asc" | "desc";
65
+ } | null | undefined, locale: string) => T[];
66
+ /** Rows split by one column, in the order each group first appears; the label is the group's shown value. */
67
+ export declare const groupRows: <T>(rows: readonly T[], column: Readable<T>, locale: string) => {
68
+ key: string;
69
+ label: string;
70
+ rows: T[];
71
+ }[];
72
+ export {};
@@ -3,6 +3,24 @@ declare const dataTableMessages: import("@k2b/stdlib").Catalog<{
3
3
  noColumns: string;
4
4
  noRecords: string;
5
5
  loadingRows: string;
6
+ noMatch: ({ query }: {
7
+ query: string;
8
+ }) => string;
9
+ clearSearch: string;
10
+ details: string;
11
+ showDetails: string;
12
+ rowCount: ({ count }: {
13
+ count: number;
14
+ }) => string;
15
+ search: string;
16
+ searchTable: ({ label }: {
17
+ label: string;
18
+ }) => string;
19
+ groupRows: string;
20
+ notGrouped: string;
21
+ groupedBy: ({ label }: {
22
+ label: string;
23
+ }) => string;
6
24
  }>;
7
25
  export type DataTableMessages = ReturnType<(typeof dataTableMessages)["resolve"]>["t"];
8
26
  /** Resolved from the inherited render locale. */
@@ -0,0 +1,11 @@
1
+ declare const flowAmountMessages: import("@k2b/stdlib").Catalog<{
2
+ in: string;
3
+ out: string;
4
+ none: string;
5
+ invalid: string;
6
+ }>;
7
+ export type FlowAmountMessages = ReturnType<(typeof flowAmountMessages)["resolve"]>["t"];
8
+ /** Resolved from an explicit locale override, else the inherited render locale. */
9
+ export declare const useFlowAmountMessages: (override?: () => string | undefined) => (() => FlowAmountMessages);
10
+ export declare const checkFlowAmountMessages: () => import("@k2b/stdlib").CatalogIssue[];
11
+ export {};
@@ -1,8 +1,10 @@
1
+ export type { ChartDateFormat, ChartDatum, ChartDatumRole, ChartFormat, ChartNumberFormat } from "../charts/core";
2
+ export { BalanceSummary, type BalanceSummaryProps } from "./BalanceSummary";
1
3
  export type { CalendarAttendee, CalendarCommand, CalendarController, CalendarCustomView, CalendarDayBadge, CalendarEvent, CalendarEventColor, CalendarEventLink, CalendarEventRenderContext, CalendarEventTimeChange, CalendarExternalDrag, CalendarLabels, CalendarProps, CalendarQuickCreateControls, CalendarRange, CalendarRecurrence, CalendarResource, CalendarSelectionControls, CalendarView, } from "./Calendar";
2
4
  export { default as Calendar } from "./Calendar";
3
- export type { ChartKind, ChartLabels, ChartProps, ChartRenderOptions } from "./Chart";
5
+ export type { ChartKind, ChartKindProps, ChartLabels, ChartProps, ChartRenderOptions } from "./Chart";
4
6
  export { default as Chart } from "./Chart";
5
- export type { ChartExplorerColumn, ChartExplorerProps, ChartLegendEntry } from "./ChartExplorer";
7
+ export type { ChartExplorerColumn, ChartExplorerProps, ChartFrameRequest, ChartLegendEntry } from "./ChartExplorer";
6
8
  export { ChartExplorer } from "./ChartExplorer";
7
9
  export type { ChartExplorerControlsProps } from "./ChartExplorerControls";
8
10
  export { ChartExplorerControls } from "./ChartExplorerControls";
@@ -17,17 +19,23 @@ export type { ChartDatumRef, ChartSelection, ChartTooltip, ChartTooltipFormatter
17
19
  export type { ChartSnapshot } from "./chart-snapshot";
18
20
  export { prepareChartSnapshot } from "./chart-snapshot";
19
21
  export type { StateTimelineChartOptions, StateTimelineDomain, StateTimelineInterval, StateTimelineRow, StateTimelineState, } from "./chart-state-timeline";
22
+ export type { ChartTimeAxis } from "./chart-time-axis";
20
23
  export { highlightSql } from "./code-highlight";
21
24
  export { type CollectionSelection, createCollectionSelection, type SelectionModifiers } from "./collection-selection";
22
25
  export type { DataTableColumn, DataTableControlsProps, DataTableFooter, DataTableHeaderProps, DataTablePanelFooterProps, DataTablePanelProps, DataTableProps, DataTableRenderCell, DataTableRenderHeader, DataTableSort, } from "./DataTable";
23
26
  export { default as DataTable } from "./DataTable";
27
+ export type { DataTableToolsProps, DataTableView, DataTableViewOptions } from "./DataTableTools";
28
+ export { createDataTableView, DataTableTools } from "./DataTableTools";
24
29
  export type { DocCodeHighlighter, DocCodeProps, DocConcept, DocNoteVariant, DocRow } from "./Docs";
25
30
  export { DocCode, DocConceptGrid, DocInlineCode, DocLead, DocNote, DocPage, DocRows, DocSection } from "./Docs";
31
+ export type { DataTableColumnType, DataTableNumberFormat, DataTableStatusState, DataTableTypedColumn, } from "./data-table-columns";
32
+ export { filterRows, sortRows } from "./data-table-columns";
26
33
  export { FileBrowserPanel, type FileBrowserPanelProps, type FileSource, openFileBrowser } from "./FileBrowser";
27
34
  export { FileGrid, type FileGridGroup, type FileGridOpenProps, type FileGridProps, type FileGridSelectableProps } from "./FileGrid";
28
35
  export { default as FileTree, type FileTreeActions, type FileTreeEntry, type FileTreeProps } from "./FileTree";
29
36
  export { type FileType, FileTypeIcon, type FileTypeIconProps, fileKindLabel, fileTypeOf } from "./FileTypeIcon";
30
37
  export { canPreviewFile, default as FileView, type FileViewContent, type FileViewFile, type FileViewPreviewKind, type FileViewProps, type FileViewRenderer, type FileViewRendererProps, formatFileViewSize, getFileViewPreviewKind, } from "./FileView";
38
+ export { FlowAmount, type FlowAmountDirection, type FlowAmountProps, flowDirection } from "./FlowAmount";
31
39
  export type { KbdProps } from "./Kbd";
32
40
  export { Kbd } from "./Kbd";
33
41
  export type { LabelChipProps } from "./LabelChip";
@@ -2,8 +2,10 @@ import { type JSX } from "solid-js";
2
2
  import { type DialogTone } from "./dialog-tone";
3
3
  import type { ConfirmOptions, DialogOptions } from "./prompts";
4
4
  export type PromptContent = string | HTMLElement | JSX.Element;
5
- /** A prompt's `variant` is its tone too: a success or danger prompt carries the dialog tone of that name. */
5
+ /** A prompt's `variant` is its tone too: a success, warning or danger prompt carries the dialog tone of that name. */
6
6
  export declare const promptTone: (variant: DialogOptions["variant"]) => DialogTone | undefined;
7
+ /** A warning asks for care, not for a destructive act: its confirm button stays primary. */
8
+ export declare const promptButtonVariant: (variant: DialogOptions["variant"]) => "danger" | "primary" | "success";
7
9
  export declare const DialogHeader: (props: {
8
10
  close: () => void;
9
11
  title?: string;
@@ -9,7 +9,7 @@ export interface DialogOptions {
9
9
  icon?: string;
10
10
  confirmText?: string;
11
11
  cancelText?: string | false;
12
- variant?: "danger" | "primary" | "success";
12
+ variant?: "danger" | "primary" | "success" | "warning";
13
13
  /** `full` fills the available viewport and becomes edge-to-edge on narrow screens. */
14
14
  size?: "small" | "medium" | "large" | "wide" | "full";
15
15
  surface?: "default" | "bare";
@@ -143,7 +143,7 @@ type PromptFormOptions<T extends Record<string, FieldSchema>> = {
143
143
  fields: T;
144
144
  confirmText?: string;
145
145
  cancelText?: string | false;
146
- variant?: "danger" | "primary" | "success";
146
+ variant?: "danger" | "primary" | "success" | "warning";
147
147
  size?: DialogOptions["size"];
148
148
  cancelBehavior?: DialogOptions["cancelBehavior"];
149
149
  };
@@ -6,7 +6,7 @@ export type NumberInputProps = Omit<JSX.InputHTMLAttributes<HTMLInputElement>, "
6
6
  min?: number;
7
7
  /** Stepper increment and commit grid; defaults to `1`. A fractional step also sets the default `decimalPlaces`. */
8
8
  step?: number;
9
- /** Accepted fraction digits. Defaults to the fraction digits of `step` (`0.01` → `2`, `1` → `0`); an explicit value wins. */
9
+ /** Accepted and displayed fraction digits. Defaults to the fraction digits of `step` (`0.01` → `2`, `1` → `0`); an explicit value wins. */
10
10
  decimalPlaces?: number;
11
11
  allowNegative?: boolean;
12
12
  clearable?: boolean;
@@ -27,6 +27,8 @@ export type SelectChipProps<T extends string | number = string> = ValueFieldProp
27
27
  loading?: boolean;
28
28
  open?: boolean;
29
29
  onOpenChange?: (open: boolean) => void;
30
+ /** Keeps the width of the longest option label, so a new choice never moves what sits beside the chip. */
31
+ stableWidth?: boolean;
30
32
  };
31
33
  export declare function SelectChip<T extends string | number = string>(props: SelectChipProps<T>): JSX.Element;
32
34
  export default SelectChip;
@@ -42,6 +42,12 @@ export declare const splitDateTime: (value: string | null | undefined, context?:
42
42
  };
43
43
  export declare const isCompleteTime: (value: string) => boolean;
44
44
  export declare const toDateTimeValue: (date: string, time: string, context?: DateContext) => string | null;
45
+ /**
46
+ * The value an applied draft commits. An untouched draft keeps the exact value: the panel shows minutes in the
47
+ * picker's zone, and a wall time that a daylight-saving change repeats names two instants, so rebuilding it could
48
+ * move the value by an hour or drop its seconds.
49
+ */
50
+ export declare const draftDateTimeValue: (value: string | null | undefined, date: string, time: string, context?: DateContext) => string | null;
45
51
  export declare const formatDateTimeValue: (value: string | null | undefined, context?: DateContext) => string;
46
52
  export declare const normalizeTimeInput: (value: string) => string;
47
53
  export declare const filterTimeInput: (value: string) => string;
@@ -31,6 +31,11 @@ export type FormatCurrencyProps = SpanProps & LocaleProp & FallbackProp & {
31
31
  currency: string;
32
32
  /** Fixed fraction digits. Defaults to the currency's standard digits. */
33
33
  decimals?: number;
34
+ /**
35
+ * When the sign shows, as in `Intl.NumberFormat`: `"exceptZero"` writes `+1.234,50 €` and `-80,00 €` for a
36
+ * balance change or net amount, `"never"` drops it. Defaults to `"auto"` (only negative amounts carry a sign).
37
+ */
38
+ signDisplay?: Intl.NumberFormatOptions["signDisplay"];
34
39
  };
35
40
  export type FormatBytesProps = SpanProps & LocaleProp & FallbackProp & {
36
41
  value: number | null | undefined;
@@ -2,6 +2,7 @@ import { type AppWorkspaceSidebarItemStatusProps } from "./AppWorkspaceSidebarIt
2
2
  export type { AppWorkspaceSidebarItemStatusProps } from "./AppWorkspaceSidebarItemStatus";
3
3
  import { type LinkNavigateEvent, type NavigationScrollMode } from "@k2b/ssr/nav";
4
4
  import { type JSX } from "solid-js";
5
+ import { type DropdownItem, type DropdownSearch } from "../actions/Dropdown";
5
6
  import { type AppWorkspaceLayoutState } from "./app-workspace-state";
6
7
  import { type AppWorkspaceWidthShare } from "./app-workspace-width";
7
8
  import type { ScrollAreaProps } from "./ScrollArea";
@@ -118,6 +119,12 @@ export type AppWorkspaceMainPaneProps = {
118
119
  };
119
120
  /** Controls at the end of the level head. */
120
121
  actions?: JSX.Element;
122
+ /**
123
+ * Levels mode: the title opens a menu of places to switch to, such as the person's work and each Space; on a phone
124
+ * it opens as a sheet. The title stays the level's heading and gains a chevron; the server HTML already says that
125
+ * it opens a menu.
126
+ */
127
+ switcher?: AppWorkspaceLevelSwitcher;
121
128
  /**
122
129
  * Levels mode: `"page"` marks the level that holds the page itself, such as a settings form or the list of an
123
130
  * area, rather than a column that leads there or a detail beside it. Its title takes the page step of the type
@@ -141,6 +148,13 @@ export type AppWorkspaceMainPaneProps = {
141
148
  scrollFade?: boolean;
142
149
  children: JSX.Element;
143
150
  };
151
+ /** The places a level title switches between; `label` names the menu, such as "Switch Space". */
152
+ export type AppWorkspaceLevelSwitcher = {
153
+ label: string;
154
+ items: readonly DropdownItem[];
155
+ /** A search field above the places, for a long list. */
156
+ search?: DropdownSearch;
157
+ };
144
158
  export type AppWorkspaceDetailWidth = "sm" | "md" | "lg" | "xl";
145
159
  export type AppWorkspaceDetailProps = {
146
160
  children: JSX.Element;
@@ -292,10 +306,16 @@ export type AppWorkspaceSidebarItemProps = {
292
306
  scroll?: NavigationScrollMode;
293
307
  onNavigate?: (event: LinkNavigateEvent) => void | Promise<void>;
294
308
  onClick?: (event: MouseEvent) => void;
309
+ /**
310
+ * Makes a row without `href` a disclosure: it shows or hides the rows after
311
+ * it, and assistive technology hears whether they are shown.
312
+ */
313
+ expanded?: boolean;
295
314
  /**
296
315
  * Marks the current page (`aria-current="page"`). On a page deeper than the
297
316
  * sidebar lists, pass `"ancestor"` for the item that contains it: it keeps
298
- * the highlight, and the page keeps its back link.
317
+ * the highlight and, while the sidebar shows, is the way up, so the head
318
+ * drops its back link as beside the current page.
299
319
  */
300
320
  active?: boolean | "ancestor";
301
321
  activeClass?: string;
@@ -43,6 +43,11 @@ export type MobileShellHeaderProps = {
43
43
  /** Controls after the title, such as a menu. */
44
44
  actions?: JSX.Element;
45
45
  };
46
+ /**
47
+ * The height the on-screen keyboard covers at the bottom of the layout viewport, from the visual viewport; zero
48
+ * without a keyboard or without `visualViewport`.
49
+ */
50
+ export declare const keyboardInset: (view: Pick<Window, "innerHeight" | "visualViewport">) => number;
46
51
  /**
47
52
  * Marks the shell around `from` as showing a screen of its own, or not, after the first paint; the server renders
48
53
  * the first state with the `screen` prop. Does nothing outside a shell.
@@ -1,7 +1,7 @@
1
1
  export { AnchoredPopover, type AnchoredPopoverProps } from "./AnchoredPopover";
2
2
  export type { AppOverviewCardsProps, AppOverviewEmptyStateProps, AppOverviewPanelProps, AppOverviewProps, } from "./AppOverview";
3
3
  export { default as AppOverview } from "./AppOverview";
4
- export type { AppWorkspaceBottomDrawerHeight, AppWorkspaceBottomDrawerProps, AppWorkspaceContentProps, AppWorkspaceDetailProps, AppWorkspaceDetailWidth, AppWorkspaceHeadProps, AppWorkspaceMainPaneProps, AppWorkspaceMainProps, AppWorkspaceNavTreeItemProps, AppWorkspaceNavTreeMove, AppWorkspaceNavTreeProps, AppWorkspaceProps, AppWorkspaceSidebarAccessoryVisibility, AppWorkspaceSidebarBodyProps, AppWorkspaceSidebarIconActionProps, AppWorkspaceSidebarIconActionTone, AppWorkspaceSidebarIconGridProps, AppWorkspaceSidebarItemActionProps, AppWorkspaceSidebarItemActionsProps, AppWorkspaceSidebarItemIconProps, AppWorkspaceSidebarItemLabelProps, AppWorkspaceSidebarItemMetaProps, AppWorkspaceSidebarItemProps, AppWorkspaceSidebarItemStatusProps, AppWorkspaceSidebarItemTone, AppWorkspaceSidebarProps, AppWorkspaceSidebarSectionProps, AppWorkspaceSidebarVisibility, AppWorkspaceWidthShare, } from "./AppWorkspace";
4
+ export type { AppWorkspaceBottomDrawerHeight, AppWorkspaceBottomDrawerProps, AppWorkspaceContentProps, AppWorkspaceDetailProps, AppWorkspaceDetailWidth, AppWorkspaceHeadProps, AppWorkspaceLevelSwitcher, AppWorkspaceMainPaneProps, AppWorkspaceMainProps, AppWorkspaceNavTreeItemProps, AppWorkspaceNavTreeMove, AppWorkspaceNavTreeProps, AppWorkspaceProps, AppWorkspaceSidebarAccessoryVisibility, AppWorkspaceSidebarBodyProps, AppWorkspaceSidebarIconActionProps, AppWorkspaceSidebarIconActionTone, AppWorkspaceSidebarIconGridProps, AppWorkspaceSidebarItemActionProps, AppWorkspaceSidebarItemActionsProps, AppWorkspaceSidebarItemIconProps, AppWorkspaceSidebarItemLabelProps, AppWorkspaceSidebarItemMetaProps, AppWorkspaceSidebarItemProps, AppWorkspaceSidebarItemStatusProps, AppWorkspaceSidebarItemTone, AppWorkspaceSidebarProps, AppWorkspaceSidebarSectionProps, AppWorkspaceSidebarVisibility, AppWorkspaceWidthShare, } from "./AppWorkspace";
5
5
  export { appWorkspaceDetailElementId, default as AppWorkspace } from "./AppWorkspace";
6
6
  export { AppWorkspaceSidebarItemStatus } from "./AppWorkspaceSidebarItemStatus";
7
7
  export { watchAppHostWidth } from "./app-host-width";
@@ -50,6 +50,7 @@ export type { SettingsModalFooterProps, SettingsModalGroupProps, SettingsModalPr
50
50
  export { default as SettingsModal } from "./SettingsModal";
51
51
  export { APP_WORKSPACE_SWITCHER_SEARCH_FROM, type AppWorkspaceSidebarSwitcherProps, type AppWorkspaceSwitcherAction, type AppWorkspaceSwitcherOption, } from "./SidebarSwitcher";
52
52
  export { measureScrollFade } from "./scroll-fade";
53
+ export { attachSheetHandle, type SheetHandleOptions } from "./sheet-handle";
53
54
  export type { TabBarItem, TabBarProps } from "./TabBar";
54
55
  export { default as TabBar } from "./TabBar";
55
56
  export type { TableOfContentsItem, TableOfContentsProps } from "./TableOfContents";
@@ -0,0 +1,21 @@
1
+ export type SheetHandleOptions = {
2
+ /** The sheet the handle sits on. It carries the current detent in `data-sheet-detent`. */
3
+ sheet: HTMLElement;
4
+ /** The detents' names, lowest first. The stylesheet gives each `[data-sheet-detent="…"]` its height. */
5
+ detents: readonly string[];
6
+ /** The detent the stylesheet draws while the sheet has no `data-sheet-detent`, such as in the server's markup. */
7
+ initial: string;
8
+ /** After a drag or a press moved the sheet to another detent, for example to rename the handle. */
9
+ onChange?: (detent: string) => void;
10
+ /** Without it, a drag stops at the lowest detent; with it, a drag well below that detent asks to close. */
11
+ onDismiss?: () => void;
12
+ };
13
+ /**
14
+ * Lets a sheet's handle drag it between detents. The handle stays a button: a press, by pointer, Enter or Space,
15
+ * moves the sheet to the next detent up, and from the highest back to the lowest. A drag follows the pointer with an
16
+ * inline height and, on release, snaps to the detent nearest to where the pointer's speed would carry it. The snap
17
+ * animates with the sheet's own height transition, so reduced motion makes it instant. The stylesheet owns every
18
+ * resting height, which keeps the server's first frame and a rotation correct without script; the handle measures
19
+ * them when a drag starts.
20
+ */
21
+ export declare function attachSheetHandle(handle: HTMLElement, options: SheetHandleOptions): () => void;
@@ -0,0 +1,42 @@
1
+ import { type JSX } from "solid-js";
2
+ /** One budget: `used` is booked, `expected` comes on top; over the budget is `used + expected - limit`. */
3
+ export type BudgetItem = {
4
+ id?: string;
5
+ label: string;
6
+ used: number;
7
+ expected?: number;
8
+ limit: number;
9
+ };
10
+ export type BudgetListProps = {
11
+ items: readonly BudgetItem[];
12
+ /** ISO 4217 currency code, e.g. `"EUR"`. */
13
+ currency: string;
14
+ /** Explicit locale override; defaults to the inherited render locale. */
15
+ locale?: string;
16
+ /** Fixed fraction digits. Defaults to 0. */
17
+ decimals?: number;
18
+ /** The sentence shown when there is no budget. */
19
+ empty?: string;
20
+ /** Hides the legend under the rows when the host explains the colours elsewhere. */
21
+ legend?: boolean;
22
+ class?: string;
23
+ };
24
+ /** "near" from 80 % of the budget, "over" beyond it. */
25
+ export type BudgetLevel = "ok" | "near" | "over";
26
+ /** The figures of one budget row; the share counts booked and expected together. */
27
+ export declare const budgetState: (item: Pick<BudgetItem, "used" | "expected" | "limit">) => {
28
+ used: number;
29
+ expected: number;
30
+ limit: number;
31
+ total: number;
32
+ over: number;
33
+ free: number;
34
+ ratio: number;
35
+ level: BudgetLevel;
36
+ };
37
+ /**
38
+ * Budgets as rows: label and "spent of budget", a bar with booked (solid), expected (hatched) and over the budget
39
+ * (red, with a mark at the limit), and a hint that turns amber from 80 % and red beyond the budget.
40
+ */
41
+ export declare function BudgetList(props: BudgetListProps): JSX.Element;
42
+ export default BudgetList;
@@ -14,8 +14,11 @@ type NoticeCardContentProps = {
14
14
  };
15
15
  export type NoticeCardProps = Omit<JSX.HTMLAttributes<HTMLElement>, "children" | "class" | "title"> & NoticeCardContentProps & {
16
16
  tone?: NoticeTone;
17
- /** A Tabler icon class. Turns the notice into a compact status line whose icon and text take the tone colour. */
18
- icon?: string;
17
+ /**
18
+ * A Tabler icon class. Turns the notice into a compact status line whose icon and text take the tone colour. `true`
19
+ * takes the tone's own icon, the one a toned dialog shows, and names the tone for screen readers.
20
+ */
21
+ icon?: string | true;
19
22
  class?: string;
20
23
  bodyClass?: string;
21
24
  };
@@ -1,13 +1,49 @@
1
- import type { JSX } from "solid-js";
1
+ import { type JSX } from "solid-js";
2
2
  import type { IntentTone } from "../semantics";
3
3
  export type ProgressBarTone = Extract<IntentTone, "info" | "success" | "warning" | "danger">;
4
- export type ProgressBarProps = {
4
+ /** One part of a segmented bar, in the unit of `limit`. `"hatched"` marks an expected, not yet booked part. */
5
+ export type ProgressBarSegment = {
5
6
  value: number;
7
+ pattern?: "solid" | "hatched";
8
+ };
9
+ export type ProgressBarProps = {
10
+ /** Percent from 0 to 100. With `segments`, the share of `limit` the segments fill. */
11
+ value?: number;
6
12
  size?: "xs" | "sm" | "md";
7
13
  tone?: ProgressBarTone;
8
14
  showValue?: boolean;
9
15
  label: string;
16
+ /** Parts drawn in order, such as booked and expected spending. Negative and non-finite values count as 0. */
17
+ segments?: readonly ProgressBarSegment[];
18
+ /** The budget the segments fill. What goes beyond it is drawn red, with a mark at the limit. */
19
+ limit?: number;
20
+ /** Spoken value, such as "1,240 € of 1,500 €"; defaults to the percent. */
21
+ valueText?: string;
10
22
  class?: string;
11
23
  };
24
+ export type ProgressBarPart = {
25
+ pattern: "solid" | "hatched" | "over";
26
+ width: number;
27
+ };
28
+ /**
29
+ * Sum minus limit, without float residue: `0.1 + 0.2` against `0.3` is not over. Amounts within a billionth of the
30
+ * larger of both count as equal.
31
+ */
32
+ export declare const budgetOverrun: (total: number, limit: number) => number;
33
+ /** Sum over limit; an empty budget with spending is infinitely full. */
34
+ export declare const budgetRatio: (total: number, limit: number) => number;
35
+ /**
36
+ * The drawn parts of a segmented bar, each as a percent of the track. The track spans the larger of the limit and the
37
+ * sum, so an overrun stays visible: segments fill up to the limit in order, the rest is one "over" part, and `mark`
38
+ * places the limit line (only when the sum goes beyond it). Without `limit` the segments fill the track; a limit of 0,
39
+ * below 0 or not finite is an empty budget, so any spending is over it.
40
+ */
41
+ export declare const progressBarParts: (segments: readonly ProgressBarSegment[], limit?: number) => {
42
+ parts: ProgressBarPart[];
43
+ total: number;
44
+ over: number;
45
+ mark: number | null;
46
+ ratio: number;
47
+ };
12
48
  export declare function ProgressBar(props: ProgressBarProps): JSX.Element;
13
49
  export default ProgressBar;
@@ -8,12 +8,35 @@ export type StatCellAccent = {
8
8
  icon: string;
9
9
  text?: string;
10
10
  };
11
+ /**
12
+ * The change against a comparison period. `unit: "ratio"` (default) reads `0.082` as `+8.2 %`; `"points"` is the
13
+ * difference of two shares in ratio units, so `0.031` reads `+3.1 pts`. Only with `better` does the badge carry a tone
14
+ * and say "better" or "worse"; without it the change stays unrated.
15
+ */
16
+ export type StatCellDelta = {
17
+ value: number;
18
+ unit?: "ratio" | "points";
19
+ better?: "up" | "down";
20
+ };
21
+ /** The value the change compares against, shown under the figure, such as "Last month 44,560". */
22
+ export type StatCellCompare = {
23
+ label: string;
24
+ value: string | number;
25
+ };
26
+ export type StatCellSize = StatGridSize;
11
27
  export type StatCellProps = {
12
28
  label: string;
13
- value: string | number | JSX.Element;
29
+ /** The figure. `null` shows the empty dash; `sub` then says why. */
30
+ value: string | number | JSX.Element | null;
14
31
  sub?: string;
15
32
  valueClass?: string;
33
+ /** An icon in a chip before the label, in `tone`. `"in"` and `"out"` are the money colours of `FlowAmount`. */
34
+ icon?: string;
35
+ /** The chip colour of `icon`. Defaults to zinc. */
36
+ tone?: StatCellTone | "in" | "out";
16
37
  accent?: StatCellAccent;
38
+ delta?: StatCellDelta;
39
+ compare?: StatCellCompare;
17
40
  href?: string;
18
41
  title?: string;
19
42
  trend?: readonly number[];
@@ -22,12 +45,22 @@ export type StatCellProps = {
22
45
  * `selection.datum.index` is the source index into `trend`.
23
46
  */
24
47
  trendTooltip?: ChartTooltipFormatter;
25
- size?: StatGridSize;
48
+ size?: StatCellSize;
26
49
  /**
27
50
  * Wraps the label, value and support line instead of truncating them. Use it for a cell whose height nothing
28
51
  * reserves, such as one figure on its own; cells compared in a row keep one line each.
29
52
  */
30
53
  wrap?: boolean;
54
+ /** `"loading"` keeps the tile's size with placeholders; `"error"` says the figure did not load. */
55
+ status?: "loading" | "error";
56
+ /** Offers "Try again" after an error and "Reload" beside `stale`. */
57
+ onRetry?: () => void;
58
+ /** The figure is not current: a short note such as "As of 09:12 · not current" replaces the support line. */
59
+ stale?: string;
31
60
  };
61
+ /**
62
+ * One key figure as a framed tile: icon and label, the figure with its change, and a support line with the comparison
63
+ * and the trend. Each state (loading, error, stale, empty) keeps the tile's place and size.
64
+ */
32
65
  export declare function StatCell(props: StatCellProps): JSX.Element;
33
66
  export default StatCell;
@@ -1,5 +1,5 @@
1
1
  import { type JSX } from "solid-js";
2
- export type StatGridSize = "md" | "sm";
2
+ export type StatGridSize = "lg" | "md" | "sm";
3
3
  export type StatGridSurface = "white" | "muted";
4
4
  export type StatGridColumns = 1 | 2 | 3 | 4 | 5 | 6;
5
5
  export type StatGridAction = {
@@ -10,6 +10,7 @@ export type StatGridProps = {
10
10
  children: JSX.Element;
11
11
  title?: string;
12
12
  action?: StatGridAction;
13
+ /** Tiles per row on a wide container. Defaults to 4; at 600 px or less two share a row, and five or six take three up to 900 px. */
13
14
  columns?: StatGridColumns;
14
15
  size?: StatGridSize;
15
16
  surface?: StatGridSurface;
@@ -17,5 +18,6 @@ export type StatGridProps = {
17
18
  };
18
19
  export declare const useStatGridSize: () => StatGridSize;
19
20
  export declare const useStatGridSurface: () => StatGridSurface;
21
+ /** A row of key figures, each a framed tile of its own; the optional title and action sit above the row. */
20
22
  export declare function StatGrid(props: StatGridProps): JSX.Element;
21
23
  export default StatGrid;
@@ -0,0 +1,30 @@
1
+ declare const budgetMessages: import("@k2b/stdlib").Catalog<{
2
+ of: ({ limit }: {
3
+ limit: string;
4
+ }) => string;
5
+ free: ({ amount }: {
6
+ amount: string;
7
+ }) => string;
8
+ near: ({ amount }: {
9
+ amount: string;
10
+ }) => string;
11
+ over: ({ amount }: {
12
+ amount: string;
13
+ }) => string;
14
+ used: string;
15
+ expected: string;
16
+ overLegend: string;
17
+ budget: string;
18
+ left: string;
19
+ overBy: string;
20
+ valueText: ({ used, expected, limit }: {
21
+ used: string;
22
+ expected?: string;
23
+ limit: string;
24
+ }) => string;
25
+ }>;
26
+ export type BudgetMessages = ReturnType<(typeof budgetMessages)["resolve"]>["t"];
27
+ /** Resolved from an explicit locale override, else the inherited render locale. */
28
+ export declare const useBudgetMessages: (override?: () => string | undefined) => (() => BudgetMessages);
29
+ export declare const checkBudgetMessages: () => import("@k2b/stdlib").CatalogIssue[];
30
+ export {};
@@ -0,0 +1,10 @@
1
+ import type { JSX } from "solid-js";
2
+ import type { StatCellCompare, StatCellDelta } from "./StatCell";
3
+ import { type StatCellMessages } from "./stat-cell-messages";
4
+ /** Signed with a true minus sign (U+2212), as figures are typeset. */
5
+ export declare const deltaText: (delta: StatCellDelta, locale: string, t: StatCellMessages) => string;
6
+ /** A change badge: arrow, signed text, and a spoken label that names the comparison and, with `better`, the rating. */
7
+ export declare function DeltaBadge(props: {
8
+ delta: StatCellDelta;
9
+ compare?: StatCellCompare;
10
+ }): JSX.Element;