@tolle_/tolle-ui 18.2.29 → 18.3.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 (294) hide show
  1. package/esm2022/lib/accordion-item.component.mjs +5 -11
  2. package/esm2022/lib/accordion.component.mjs +4 -9
  3. package/esm2022/lib/alert-dialog-dynamic.component.mjs +12 -12
  4. package/esm2022/lib/alert-dialog.component.mjs +82 -64
  5. package/esm2022/lib/alert-dialog.service.mjs +38 -6
  6. package/esm2022/lib/alert.component.mjs +5 -11
  7. package/esm2022/lib/aspect-ratio.component.mjs +119 -0
  8. package/esm2022/lib/attachment.component.mjs +334 -0
  9. package/esm2022/lib/avatar-fallback.component.mjs +3 -3
  10. package/esm2022/lib/avatar.component.mjs +4 -9
  11. package/esm2022/lib/badge.component.mjs +4 -9
  12. package/esm2022/lib/breadcrumb-item.component.mjs +3 -3
  13. package/esm2022/lib/breadcrumb-link.component.mjs +3 -3
  14. package/esm2022/lib/breadcrumb-separator.component.mjs +3 -3
  15. package/esm2022/lib/breadcrumb.component.mjs +3 -3
  16. package/esm2022/lib/bubble.component.mjs +301 -0
  17. package/esm2022/lib/button.component.mjs +5 -11
  18. package/esm2022/lib/calendar.component.mjs +5 -11
  19. package/esm2022/lib/card.component.mjs +14 -43
  20. package/esm2022/lib/carousel/carousel.component.mjs +5 -12
  21. package/esm2022/lib/chain-of-thought.component.mjs +380 -0
  22. package/esm2022/lib/chart-pie.component.mjs +386 -0
  23. package/esm2022/lib/chart.component.mjs +1146 -0
  24. package/esm2022/lib/chart.service.mjs +555 -0
  25. package/esm2022/lib/checkbox.component.mjs +5 -11
  26. package/esm2022/lib/checkpoint.component.mjs +134 -0
  27. package/esm2022/lib/collapsible.component.mjs +4 -11
  28. package/esm2022/lib/combobox.component.mjs +372 -0
  29. package/esm2022/lib/command-dialog.component.mjs +164 -0
  30. package/esm2022/lib/command.component.mjs +514 -0
  31. package/esm2022/lib/command.service.mjs +130 -0
  32. package/esm2022/lib/confirmation.component.mjs +219 -0
  33. package/esm2022/lib/context-menu-trigger.directive.mjs +36 -0
  34. package/esm2022/lib/context-menu.component.mjs +460 -0
  35. package/esm2022/lib/context-menu.service.mjs +125 -0
  36. package/esm2022/lib/context.component.mjs +377 -0
  37. package/esm2022/lib/conversation.component.mjs +442 -0
  38. package/esm2022/lib/country-selector.component.mjs +5 -11
  39. package/esm2022/lib/data-table.component.mjs +59 -12
  40. package/esm2022/lib/date-picker.component.mjs +251 -198
  41. package/esm2022/lib/date-range-picker.component.mjs +224 -116
  42. package/esm2022/lib/date-time-picker.component.mjs +506 -0
  43. package/esm2022/lib/direction.component.mjs +79 -0
  44. package/esm2022/lib/dropdown-item.component.mjs +3 -3
  45. package/esm2022/lib/dropdown-label.component.mjs +3 -3
  46. package/esm2022/lib/dropdown-menu.component.mjs +3 -3
  47. package/esm2022/lib/dropdown-separator.component.mjs +3 -3
  48. package/esm2022/lib/dropdown-trigger.directive.mjs +6 -4
  49. package/esm2022/lib/empty-state.component.mjs +4 -9
  50. package/esm2022/lib/field.component.mjs +394 -0
  51. package/esm2022/lib/hover-card.component.mjs +6 -16
  52. package/esm2022/lib/inline-citation.component.mjs +263 -0
  53. package/esm2022/lib/input-group.component.mjs +418 -0
  54. package/esm2022/lib/input.component.mjs +5 -11
  55. package/esm2022/lib/item.component.mjs +243 -0
  56. package/esm2022/lib/kbd.component.mjs +82 -0
  57. package/esm2022/lib/label.component.mjs +4 -9
  58. package/esm2022/lib/marker.component.mjs +135 -0
  59. package/esm2022/lib/masked-input.component.mjs +5 -11
  60. package/esm2022/lib/menubar.component.mjs +683 -0
  61. package/esm2022/lib/message-scroller.component.mjs +353 -0
  62. package/esm2022/lib/message-scroller.service.mjs +157 -0
  63. package/esm2022/lib/message.component.mjs +228 -0
  64. package/esm2022/lib/modal-ref.mjs +36 -7
  65. package/esm2022/lib/modal.component.mjs +42 -28
  66. package/esm2022/lib/modal.mjs +2 -29
  67. package/esm2022/lib/modal.service.mjs +26 -4
  68. package/esm2022/lib/model-selector.component.mjs +310 -0
  69. package/esm2022/lib/multi-select.component.mjs +155 -72
  70. package/esm2022/lib/native-select.component.mjs +201 -0
  71. package/esm2022/lib/navigation-menu.component.mjs +642 -0
  72. package/esm2022/lib/otp-group.component.mjs +3 -3
  73. package/esm2022/lib/otp-slot.component.mjs +4 -9
  74. package/esm2022/lib/otp.component.mjs +5 -11
  75. package/esm2022/lib/pagination.component.mjs +7 -10
  76. package/esm2022/lib/plan.component.mjs +335 -0
  77. package/esm2022/lib/popover-content.component.mjs +4 -9
  78. package/esm2022/lib/popover.component.mjs +15 -13
  79. package/esm2022/lib/progress.component.mjs +4 -9
  80. package/esm2022/lib/prompt-input.component.mjs +526 -0
  81. package/esm2022/lib/queue.component.mjs +280 -0
  82. package/esm2022/lib/radio-group.component.mjs +6 -13
  83. package/esm2022/lib/radio-item.component.mjs +4 -9
  84. package/esm2022/lib/range-calendar.component.mjs +5 -11
  85. package/esm2022/lib/reasoning.component.mjs +335 -0
  86. package/esm2022/lib/resizable-panel.component.mjs +5 -5
  87. package/esm2022/lib/resizable.component.mjs +219 -0
  88. package/esm2022/lib/segment.component.mjs +19 -9
  89. package/esm2022/lib/select-group.component.mjs +4 -8
  90. package/esm2022/lib/select-item.component.mjs +4 -9
  91. package/esm2022/lib/select-separator.component.mjs +4 -8
  92. package/esm2022/lib/select.component.mjs +133 -49
  93. package/esm2022/lib/separator.component.mjs +4 -9
  94. package/esm2022/lib/sheet.component.mjs +38 -56
  95. package/esm2022/lib/shimmer.component.mjs +84 -0
  96. package/esm2022/lib/sidebar.component.mjs +11 -1
  97. package/esm2022/lib/skeleton.component.mjs +4 -9
  98. package/esm2022/lib/sources.component.mjs +452 -0
  99. package/esm2022/lib/spinner.component.mjs +68 -0
  100. package/esm2022/lib/suggestion.component.mjs +207 -0
  101. package/esm2022/lib/switch.component.mjs +5 -11
  102. package/esm2022/lib/table.component.mjs +213 -0
  103. package/esm2022/lib/tabs.component.mjs +4 -11
  104. package/esm2022/lib/tag-input.component.mjs +5 -11
  105. package/esm2022/lib/task.component.mjs +359 -0
  106. package/esm2022/lib/textarea.component.mjs +5 -11
  107. package/esm2022/lib/theme.service.mjs +17 -6
  108. package/esm2022/lib/time-picker.component.mjs +923 -0
  109. package/esm2022/lib/toast.service.mjs +3 -2
  110. package/esm2022/lib/toaster.component.mjs +76 -39
  111. package/esm2022/lib/toggle-group.component.mjs +4 -9
  112. package/esm2022/lib/toggle.component.mjs +5 -11
  113. package/esm2022/lib/tool.component.mjs +462 -0
  114. package/esm2022/lib/typography.component.mjs +83 -0
  115. package/esm2022/lib/utils/color.mjs +140 -19
  116. package/esm2022/public-api.mjs +61 -1
  117. package/fesm2022/tolle-ui.mjs +16642 -1105
  118. package/fesm2022/tolle-ui.mjs.map +1 -1
  119. package/lib/alert-dialog-dynamic.component.d.ts +5 -0
  120. package/lib/alert-dialog.component.d.ts +23 -2
  121. package/lib/aspect-ratio.component.d.ts +20 -0
  122. package/lib/attachment.component.d.ts +101 -0
  123. package/lib/bubble.component.d.ts +112 -0
  124. package/lib/chain-of-thought.component.d.ts +166 -0
  125. package/lib/chart-pie.component.d.ts +108 -0
  126. package/lib/chart.component.d.ts +369 -0
  127. package/lib/chart.service.d.ts +222 -0
  128. package/lib/checkpoint.component.d.ts +51 -0
  129. package/lib/combobox.component.d.ts +90 -0
  130. package/lib/command-dialog.component.d.ts +53 -0
  131. package/lib/command.component.d.ts +189 -0
  132. package/lib/command.service.d.ts +67 -0
  133. package/lib/confirmation.component.d.ts +70 -0
  134. package/lib/context-menu-trigger.directive.d.ts +12 -0
  135. package/lib/context-menu.component.d.ts +41 -0
  136. package/lib/context-menu.service.d.ts +38 -0
  137. package/lib/context.component.d.ts +134 -0
  138. package/lib/conversation.component.d.ts +165 -0
  139. package/lib/data-table.component.d.ts +26 -1
  140. package/lib/date-picker.component.d.ts +72 -11
  141. package/lib/date-range-picker.component.d.ts +63 -6
  142. package/lib/date-time-picker.component.d.ts +119 -0
  143. package/lib/direction.component.d.ts +45 -0
  144. package/lib/field.component.d.ts +201 -0
  145. package/lib/inline-citation.component.d.ts +103 -0
  146. package/lib/input-group.component.d.ts +150 -0
  147. package/lib/item.component.d.ts +154 -0
  148. package/lib/kbd.component.d.ts +50 -0
  149. package/lib/marker.component.d.ts +58 -0
  150. package/lib/menubar.component.d.ts +247 -0
  151. package/lib/message-scroller.component.d.ts +159 -0
  152. package/lib/message-scroller.service.d.ts +73 -0
  153. package/lib/message.component.d.ts +128 -0
  154. package/lib/modal-ref.d.ts +6 -1
  155. package/lib/modal.component.d.ts +7 -4
  156. package/lib/modal.d.ts +9 -3
  157. package/lib/model-selector.component.d.ts +103 -0
  158. package/lib/multi-select.component.d.ts +66 -14
  159. package/lib/native-select.component.d.ts +57 -0
  160. package/lib/navigation-menu.component.d.ts +230 -0
  161. package/lib/plan.component.d.ts +120 -0
  162. package/lib/popover.component.d.ts +1 -0
  163. package/lib/prompt-input.component.d.ts +194 -0
  164. package/lib/queue.component.d.ts +106 -0
  165. package/lib/reasoning.component.d.ts +127 -0
  166. package/lib/resizable.component.d.ts +43 -0
  167. package/lib/segment.component.d.ts +13 -3
  168. package/lib/select.component.d.ts +37 -5
  169. package/lib/sheet.component.d.ts +3 -0
  170. package/lib/shimmer.component.d.ts +38 -0
  171. package/lib/sidebar.component.d.ts +2 -0
  172. package/lib/sources.component.d.ts +156 -0
  173. package/lib/spinner.component.d.ts +29 -0
  174. package/lib/suggestion.component.d.ts +96 -0
  175. package/lib/table.component.d.ts +106 -0
  176. package/lib/task.component.d.ts +151 -0
  177. package/lib/theme.service.d.ts +9 -0
  178. package/lib/time-picker.component.d.ts +243 -0
  179. package/lib/toast.service.d.ts +3 -1
  180. package/lib/toaster.component.d.ts +26 -9
  181. package/lib/tool.component.d.ts +158 -0
  182. package/lib/typography.component.d.ts +32 -0
  183. package/lib/utils/color.d.ts +19 -5
  184. package/package.json +3 -2
  185. package/preset.js +7 -1
  186. package/public-api.d.ts +50 -0
  187. package/registry/docs-content.json +8480 -1542
  188. package/registry/llms-full.txt +2679 -319
  189. package/registry/llms.txt +43 -4
  190. package/registry/manifest.json +9090 -1742
  191. package/registry/r/accordion-item.json +1 -1
  192. package/registry/r/accordion.json +1 -1
  193. package/registry/r/alert-dialog-dynamic.json +1 -1
  194. package/registry/r/alert-dialog.json +1 -1
  195. package/registry/r/alert.json +1 -1
  196. package/registry/r/attachment.json +23 -0
  197. package/registry/r/avatar-fallback.json +1 -1
  198. package/registry/r/avatar.json +1 -1
  199. package/registry/r/badge.json +1 -1
  200. package/registry/r/breadcrumb-item.json +1 -1
  201. package/registry/r/breadcrumb-link.json +1 -1
  202. package/registry/r/breadcrumb-separator.json +1 -1
  203. package/registry/r/breadcrumb.json +1 -1
  204. package/registry/r/bubble.json +23 -0
  205. package/registry/r/button.json +1 -1
  206. package/registry/r/calendar.json +1 -1
  207. package/registry/r/card.json +1 -1
  208. package/registry/r/carousel.json +1 -1
  209. package/registry/r/chain-of-thought.json +23 -0
  210. package/registry/r/chart-pie.json +30 -0
  211. package/registry/r/chart.json +28 -0
  212. package/registry/r/checkbox.json +1 -1
  213. package/registry/r/checkpoint.json +23 -0
  214. package/registry/r/collapsible.json +1 -1
  215. package/registry/r/combobox.json +31 -0
  216. package/registry/r/command-dialog.json +21 -0
  217. package/registry/r/command.json +26 -0
  218. package/registry/r/confirmation.json +23 -0
  219. package/registry/r/context-menu-trigger.json +1 -1
  220. package/registry/r/context-menu.json +1 -1
  221. package/registry/r/context.json +26 -0
  222. package/registry/r/conversation.json +23 -0
  223. package/registry/r/country-selector.json +1 -1
  224. package/registry/r/data-table.json +1 -1
  225. package/registry/r/date-picker.json +4 -4
  226. package/registry/r/date-range-picker.json +3 -3
  227. package/registry/r/date-time-picker.json +28 -0
  228. package/registry/r/direction.json +16 -0
  229. package/registry/r/dropdown-item.json +1 -1
  230. package/registry/r/dropdown-label.json +1 -1
  231. package/registry/r/dropdown-menu.json +1 -1
  232. package/registry/r/dropdown-separator.json +1 -1
  233. package/registry/r/dropdown-trigger.json +1 -1
  234. package/registry/r/empty-state.json +1 -1
  235. package/registry/r/field.json +23 -0
  236. package/registry/r/hover-card.json +1 -1
  237. package/registry/r/inline-citation.json +26 -0
  238. package/registry/r/input-group.json +23 -0
  239. package/registry/r/input.json +1 -1
  240. package/registry/r/item.json +23 -0
  241. package/registry/r/kbd.json +23 -0
  242. package/registry/r/label.json +1 -1
  243. package/registry/r/marker.json +23 -0
  244. package/registry/r/masked-input.json +1 -1
  245. package/registry/r/menubar.json +24 -0
  246. package/registry/r/message-scroller.json +26 -0
  247. package/registry/r/message.json +23 -0
  248. package/registry/r/modal.json +3 -3
  249. package/registry/r/model-selector.json +32 -0
  250. package/registry/r/multi-select.json +2 -2
  251. package/registry/r/native-select.json +23 -0
  252. package/registry/r/navigation-menu.json +24 -0
  253. package/registry/r/otp-group.json +1 -1
  254. package/registry/r/otp-slot.json +1 -1
  255. package/registry/r/otp.json +1 -1
  256. package/registry/r/pagination.json +3 -2
  257. package/registry/r/plan.json +23 -0
  258. package/registry/r/popover-content.json +1 -1
  259. package/registry/r/popover.json +1 -1
  260. package/registry/r/progress.json +1 -1
  261. package/registry/r/prompt-input.json +23 -0
  262. package/registry/r/queue.json +23 -0
  263. package/registry/r/radio-group.json +1 -1
  264. package/registry/r/radio-item.json +1 -1
  265. package/registry/r/range-calendar.json +1 -1
  266. package/registry/r/reasoning.json +23 -0
  267. package/registry/r/resizable-panel.json +1 -1
  268. package/registry/r/segment.json +1 -1
  269. package/registry/r/select-group.json +1 -1
  270. package/registry/r/select-item.json +1 -1
  271. package/registry/r/select-separator.json +1 -1
  272. package/registry/r/select.json +4 -3
  273. package/registry/r/separator.json +1 -1
  274. package/registry/r/sheet.json +1 -1
  275. package/registry/r/shimmer.json +23 -0
  276. package/registry/r/sidebar.json +1 -1
  277. package/registry/r/skeleton.json +1 -1
  278. package/registry/r/sources.json +23 -0
  279. package/registry/r/spinner.json +23 -0
  280. package/registry/r/suggestion.json +23 -0
  281. package/registry/r/switch.json +1 -1
  282. package/registry/r/table.json +21 -0
  283. package/registry/r/tabs.json +1 -1
  284. package/registry/r/tag-input.json +1 -1
  285. package/registry/r/task.json +23 -0
  286. package/registry/r/textarea.json +1 -1
  287. package/registry/r/time-picker.json +24 -0
  288. package/registry/r/toaster.json +2 -2
  289. package/registry/r/toggle-group.json +1 -1
  290. package/registry/r/toggle.json +1 -1
  291. package/registry/r/tool.json +23 -0
  292. package/registry/r/typography.json +23 -0
  293. package/registry/registry.json +915 -22
  294. package/theme.css +121 -8
@@ -0,0 +1,369 @@
1
+ import { EventEmitter, ChangeDetectorRef, ElementRef, OnInit, OnChanges, OnDestroy, AfterViewInit } from '@angular/core';
2
+ import { Subscription } from 'rxjs';
3
+ import { type VariantProps } from 'class-variance-authority';
4
+ import { ChartService, type ChartSeries, type ChartMargin } from './chart.service';
5
+ import * as i0 from "@angular/core";
6
+ export type { ChartSeries, ChartMargin, ChartTick, ChartBand } from './chart.service';
7
+ /**
8
+ * Base for every chart part that has to redraw when the shared scales change.
9
+ * Parts subscribe to the service rather than reading the container component,
10
+ * so an OnPush child still updates when the container's inputs or width change.
11
+ */
12
+ export declare abstract class ChartChild implements OnChanges, OnInit, OnDestroy {
13
+ /**
14
+ * Angular writes a bound `class` input through its styling path, which does
15
+ * not mark an OnPush component dirty — without this hook subclasses keep
16
+ * rendering the class they were born with.
17
+ */
18
+ ngOnChanges(): void;
19
+ protected readonly chart: ChartService;
20
+ protected readonly cdr: ChangeDetectorRef;
21
+ protected readonly subscriptions: Subscription;
22
+ /**
23
+ * Identity for the mark `*ngFor`s. The collections behind them are rebuilt on
24
+ * every read, so without this `*ngFor` sees new identities each pass and
25
+ * replaces every node instead of patching it. Marks are positional, so the
26
+ * index IS the identity.
27
+ */
28
+ trackByIndex: (index: number) => number;
29
+ ngOnInit(): void;
30
+ ngOnDestroy(): void;
31
+ /** Hook for parts that need to influence the shared scales before first paint. */
32
+ protected register(): void;
33
+ static ɵfac: i0.ɵɵFactoryDeclaration<ChartChild, never>;
34
+ static ɵdir: i0.ɵɵDirectiveDeclaration<ChartChild, never, never, {}, {}, never, never, false, never>;
35
+ }
36
+ /**
37
+ * The floating readout for the hovered x position. Lists every series at that
38
+ * x, so the pointer never has to land on a particular line to get a value.
39
+ * Rendered automatically by `tolle-chart` when `hover` is on.
40
+ */
41
+ export declare class ChartTooltipComponent implements OnChanges, OnInit, OnDestroy {
42
+ /**
43
+ * Angular writes a bound `class` input through its styling path, which does
44
+ * not mark an OnPush component dirty — without this hook the component keeps
45
+ * rendering the class it was born with.
46
+ */
47
+ ngOnChanges(): void;
48
+ /** Identity for `*ngFor`, so a redraw patches nodes instead of replacing them. */
49
+ trackByIndex: (index: number) => number;
50
+ /** Distance in px the tooltip sits from the crosshair. @default 12 */
51
+ offset: number;
52
+ /** Assumed tooltip width in px, used to flip it near the right edge. @default 160 */
53
+ estimatedWidth: number;
54
+ /** Extra Tailwind classes merged onto the tooltip via `cn()` (last-wins). */
55
+ class: string;
56
+ private readonly chart;
57
+ private readonly cdr;
58
+ private readonly subscriptions;
59
+ /** Row index the tooltip is describing, or null when nothing is hovered. */
60
+ index: number | null;
61
+ ngOnInit(): void;
62
+ ngOnDestroy(): void;
63
+ get xLabel(): string;
64
+ /** One row per series: colour key, label, and the formatted value. */
65
+ get rows(): {
66
+ label: string;
67
+ value: string;
68
+ color: string;
69
+ }[];
70
+ get left(): number;
71
+ get top(): number;
72
+ get computedClass(): string;
73
+ static ɵfac: i0.ɵɵFactoryDeclaration<ChartTooltipComponent, never>;
74
+ static ɵcmp: i0.ɵɵComponentDeclaration<ChartTooltipComponent, "tolle-chart-tooltip", never, { "offset": { "alias": "offset"; "required": false; }; "estimatedWidth": { "alias": "estimatedWidth"; "required": false; }; "class": { "alias": "class"; "required": false; }; }, {}, never, never, true, never>;
75
+ }
76
+ declare const chartLegendVariants: (props?: ({
77
+ align?: "start" | "end" | "center" | null | undefined;
78
+ size?: "default" | "sm" | null | undefined;
79
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
80
+ export type ChartLegendProps = VariantProps<typeof chartLegendVariants>;
81
+ /**
82
+ * Swatch and label per series. Rendered automatically by `tolle-chart` whenever
83
+ * there are two or more series, so identity is never carried by colour alone.
84
+ * A single series gets no legend — the chart's own label already names it.
85
+ */
86
+ export declare class ChartLegendComponent implements OnChanges, OnInit, OnDestroy {
87
+ /**
88
+ * Angular writes a bound `class` input through its styling path, which does
89
+ * not mark an OnPush component dirty — without this hook the component keeps
90
+ * rendering the class it was born with.
91
+ */
92
+ ngOnChanges(): void;
93
+ /** Identity for `*ngFor`, so a redraw patches nodes instead of replacing them. */
94
+ trackByIndex: (index: number) => number;
95
+ /** Horizontal alignment of the legend row. @default 'center' */
96
+ align: ChartLegendProps['align'];
97
+ /** Text size of the legend. @default 'default' */
98
+ size: ChartLegendProps['size'];
99
+ /** Extra Tailwind classes merged onto the legend via `cn()` (last-wins). */
100
+ class: string;
101
+ private readonly chart;
102
+ private readonly cdr;
103
+ private readonly subscriptions;
104
+ ngOnInit(): void;
105
+ ngOnDestroy(): void;
106
+ /** One entry per series, coloured by series identity. */
107
+ get entries(): {
108
+ label: string;
109
+ color: string;
110
+ }[];
111
+ get computedClass(): string;
112
+ static ɵfac: i0.ɵɵFactoryDeclaration<ChartLegendComponent, never>;
113
+ static ɵcmp: i0.ɵɵComponentDeclaration<ChartLegendComponent, "tolle-chart-legend", never, { "align": { "alias": "align"; "required": false; }; "size": { "alias": "size"; "required": false; }; "class": { "alias": "class"; "required": false; }; }, {}, never, never, true, never>;
114
+ }
115
+ declare const chartTableVariants: (props?: ({
116
+ visible?: boolean | null | undefined;
117
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
118
+ export type ChartTableProps = VariantProps<typeof chartTableVariants>;
119
+ /**
120
+ * The chart's data as a real `<table>`. Visually hidden by default and pointed
121
+ * at by the svg's `aria-describedby`, so every value the chart encodes in
122
+ * colour stays reachable without seeing or hovering it. Set `visible` to show it.
123
+ */
124
+ export declare class ChartTableComponent implements OnChanges, OnInit, OnDestroy {
125
+ /**
126
+ * Angular writes a bound `class` input through its styling path, which does
127
+ * not mark an OnPush component dirty — without this hook the component keeps
128
+ * rendering the class it was born with.
129
+ */
130
+ ngOnChanges(): void;
131
+ /** Identity for `*ngFor`, so a redraw patches nodes instead of replacing them. */
132
+ trackByIndex: (index: number) => number;
133
+ /** Shows the table instead of hiding it from sighted readers. @default false */
134
+ visible: boolean;
135
+ /** Id applied to the wrapper, for the chart's `aria-describedby`. @default '' */
136
+ tableId: string;
137
+ /** Column header for the x category. @default 'Category' */
138
+ xHeader: string;
139
+ /** Accessible caption for the table. @default 'Chart data' */
140
+ caption: string;
141
+ /** Extra Tailwind classes merged onto the table via `cn()` (last-wins). */
142
+ class: string;
143
+ protected readonly chart: ChartService;
144
+ private readonly cdr;
145
+ private readonly subscriptions;
146
+ ngOnInit(): void;
147
+ ngOnDestroy(): void;
148
+ /** One row per x position, with a formatted cell per series. */
149
+ get rows(): {
150
+ label: string;
151
+ cells: string[];
152
+ }[];
153
+ get computedClass(): string;
154
+ static ɵfac: i0.ɵɵFactoryDeclaration<ChartTableComponent, never>;
155
+ static ɵcmp: i0.ɵɵComponentDeclaration<ChartTableComponent, "tolle-chart-table", never, { "visible": { "alias": "visible"; "required": false; }; "tableId": { "alias": "tableId"; "required": false; }; "xHeader": { "alias": "xHeader"; "required": false; }; "caption": { "alias": "caption"; "required": false; }; "class": { "alias": "class"; "required": false; }; }, {}, never, never, true, never>;
156
+ }
157
+ declare const chartVariants: (props?: ({
158
+ variant?: "default" | "card" | null | undefined;
159
+ density?: "default" | "compact" | null | undefined;
160
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
161
+ export type ChartProps = VariantProps<typeof chartVariants>;
162
+ /**
163
+ * Container for a hand-rolled SVG chart. Owns the responsive `<svg>`, the
164
+ * shared scales (via the `ChartService` it provides), the hover layer, the
165
+ * legend and the accessible table fallback.
166
+ *
167
+ * Marks and axes are projected as SVG children. They use attribute selectors on
168
+ * `svg:g` rather than element selectors, because a custom element is created in
169
+ * the HTML namespace and an HTML element inside an `<svg>` never renders its
170
+ * SVG subtree:
171
+ *
172
+ * ```html
173
+ * <tolle-chart [data]="rows" [series]="series" xKey="month" ariaLabel="Revenue">
174
+ * <svg:g tolle-chart-grid></svg:g>
175
+ * <svg:g tolle-chart-y-axis></svg:g>
176
+ * <svg:g tolle-chart-x-axis></svg:g>
177
+ * <svg:g tolle-chart-line seriesKey="revenue" curve="smooth"></svg:g>
178
+ * </tolle-chart>
179
+ * ```
180
+ *
181
+ * There is deliberately no secondary y-axis: two measures on two scales in one
182
+ * frame let the author choose where the lines cross, so the reader sees a
183
+ * relationship the data does not contain. Use two charts, small multiples, or
184
+ * index both series to a common base instead.
185
+ * @new
186
+ */
187
+ export declare class ChartComponent implements OnInit, OnChanges, AfterViewInit, OnDestroy {
188
+ /** Identity for `*ngFor`, so a redraw patches nodes instead of replacing them. */
189
+ trackByIndex: (index: number) => number;
190
+ /** Rows to plot, in x order. @default [] */
191
+ data: Record<string, any>[];
192
+ /** Series to draw, in the order they take palette steps `--chart-1`..`--chart-5`. @default [] */
193
+ series: ChartSeries[];
194
+ /** Row key holding each row's x category label. @default '' */
195
+ xKey: string;
196
+ /** Height of the chart in px. @default 260 */
197
+ height: number;
198
+ /** Space reserved around the plot for axis labels. @default { top: 8, right: 8, bottom: 24, left: 44 } */
199
+ margin: ChartMargin;
200
+ /** Accessible name for the chart, used as the svg `<title>`. @default '' */
201
+ ariaLabel: string;
202
+ /** Longer summary used as the svg `<desc>`. Falls back to `ariaLabel`. @default '' */
203
+ description: string;
204
+ /** Stacks marks on a shared baseline instead of grouping them. @default false */
205
+ stacked: boolean;
206
+ /** Renders the crosshair, hit layer and shared tooltip. @default true */
207
+ hover: boolean;
208
+ /** Shows the data table instead of leaving it visually hidden. @default false */
209
+ showTable: boolean;
210
+ /** Column header the table fallback gives the x category. @default 'Category' */
211
+ xHeader: string;
212
+ /** Visual treatment of the chart frame. @default 'default' */
213
+ variant: ChartProps['variant'];
214
+ /** Text density of the chart chrome. @default 'default' */
215
+ density: ChartProps['density'];
216
+ /** Extra Tailwind classes merged onto the chart via `cn()` (last-wins). */
217
+ class: string;
218
+ /** Emitted with the hovered row index, or null when the pointer leaves. */
219
+ activeIndexChange: EventEmitter<number | null>;
220
+ plotRef?: ElementRef<HTMLElement>;
221
+ protected readonly chart: ChartService;
222
+ private readonly cdr;
223
+ private readonly subscriptions;
224
+ private resizeObserver?;
225
+ /** Width used until the container has been measured. */
226
+ static readonly fallbackWidth = 600;
227
+ /** Id of the table fallback, referenced by the svg's `aria-describedby`. */
228
+ readonly tableId: string;
229
+ /** X of the crosshair, or null when nothing is hovered or the scale is banded. */
230
+ crosshairX: number | null;
231
+ ngOnInit(): void;
232
+ ngOnChanges(): void;
233
+ ngAfterViewInit(): void;
234
+ ngOnDestroy(): void;
235
+ private measure;
236
+ private push;
237
+ get viewBox(): string;
238
+ /**
239
+ * One catchment rect per x position, deliberately wider than the marks it
240
+ * covers — readers aim at a category, never at a 2px line or an 8px dot.
241
+ */
242
+ get hitBands(): import("./chart.service").ChartBand[];
243
+ onEnterBand(index: number): void;
244
+ onPointerLeave(): void;
245
+ get computedClass(): string;
246
+ static ɵfac: i0.ɵɵFactoryDeclaration<ChartComponent, never>;
247
+ static ɵcmp: i0.ɵɵComponentDeclaration<ChartComponent, "tolle-chart", never, { "data": { "alias": "data"; "required": false; }; "series": { "alias": "series"; "required": false; }; "xKey": { "alias": "xKey"; "required": false; }; "height": { "alias": "height"; "required": false; }; "margin": { "alias": "margin"; "required": false; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; }; "description": { "alias": "description"; "required": false; }; "stacked": { "alias": "stacked"; "required": false; }; "hover": { "alias": "hover"; "required": false; }; "showTable": { "alias": "showTable"; "required": false; }; "xHeader": { "alias": "xHeader"; "required": false; }; "variant": { "alias": "variant"; "required": false; }; "density": { "alias": "density"; "required": false; }; "class": { "alias": "class"; "required": false; }; }, { "activeIndexChange": "activeIndexChange"; }, never, ["*"], true, never>;
248
+ }
249
+ /** Horizontal rules at the y ticks, with optional vertical rules at the x positions. */
250
+ export declare class ChartGridComponent extends ChartChild {
251
+ /** Also draws a rule at every x position. @default false */
252
+ vertical: boolean;
253
+ /** Extra Tailwind classes merged onto each rule via `cn()` (last-wins). */
254
+ class: string;
255
+ get verticalXs(): number[];
256
+ get lineClass(): string;
257
+ static ɵfac: i0.ɵɵFactoryDeclaration<ChartGridComponent, never>;
258
+ static ɵcmp: i0.ɵɵComponentDeclaration<ChartGridComponent, "svg:g[tolle-chart-grid]", never, { "vertical": { "alias": "vertical"; "required": false; }; "class": { "alias": "class"; "required": false; }; }, {}, never, never, true, never>;
259
+ }
260
+ /** X-axis tick labels, thinned so they never collide. */
261
+ export declare class ChartXAxisComponent extends ChartChild {
262
+ /** Approximate px per character, used to decide when labels would collide. @default 7 */
263
+ charWidth: number;
264
+ /** Extra Tailwind classes merged onto each label via `cn()` (last-wins). */
265
+ class: string;
266
+ /**
267
+ * Draw every nth label. Derived from the widest label and the space each one
268
+ * gets, so a dense axis thins out instead of overprinting itself.
269
+ */
270
+ get stride(): number;
271
+ get visibleTicks(): {
272
+ x: number;
273
+ label: string;
274
+ }[];
275
+ get labelY(): number;
276
+ get labelClass(): string;
277
+ static ɵfac: i0.ɵɵFactoryDeclaration<ChartXAxisComponent, never>;
278
+ static ɵcmp: i0.ɵɵComponentDeclaration<ChartXAxisComponent, "svg:g[tolle-chart-x-axis]", never, { "charWidth": { "alias": "charWidth"; "required": false; }; "class": { "alias": "class"; "required": false; }; }, {}, never, never, true, never>;
279
+ }
280
+ /** Y-axis tick labels at the nice tick values. */
281
+ export declare class ChartYAxisComponent extends ChartChild {
282
+ /** Gap in px between the labels and the plot edge. @default 8 */
283
+ offset: number;
284
+ /** Extra Tailwind classes merged onto each label via `cn()` (last-wins). */
285
+ class: string;
286
+ get labelX(): number;
287
+ get labelClass(): string;
288
+ static ɵfac: i0.ɵɵFactoryDeclaration<ChartYAxisComponent, never>;
289
+ static ɵcmp: i0.ɵɵComponentDeclaration<ChartYAxisComponent, "svg:g[tolle-chart-y-axis]", never, { "offset": { "alias": "offset"; "required": false; }; "class": { "alias": "class"; "required": false; }; }, {}, never, never, true, never>;
290
+ }
291
+ /** A line mark for one series, optionally monotone-smoothed and dotted. */
292
+ export declare class ChartLineComponent extends ChartChild {
293
+ /** Key of the series to draw. @default '' */
294
+ seriesKey: string;
295
+ /** Interpolation between points; smooth is monotone cubic, so it never overshoots. @default 'linear' */
296
+ curve: 'linear' | 'smooth';
297
+ /** Draws a marker at every point. @default false */
298
+ showDots: boolean;
299
+ /** Marker radius in px; 4 gives the 8px minimum diameter. @default 4 */
300
+ dotRadius: number;
301
+ /** Extra Tailwind classes merged onto the path via `cn()` (last-wins). */
302
+ class: string;
303
+ get path(): string;
304
+ get color(): string;
305
+ get dots(): {
306
+ x: number;
307
+ y: number;
308
+ index: number;
309
+ }[];
310
+ static ɵfac: i0.ɵɵFactoryDeclaration<ChartLineComponent, never>;
311
+ static ɵcmp: i0.ɵɵComponentDeclaration<ChartLineComponent, "svg:g[tolle-chart-line]", never, { "seriesKey": { "alias": "seriesKey"; "required": false; }; "curve": { "alias": "curve"; "required": false; }; "showDots": { "alias": "showDots"; "required": false; }; "dotRadius": { "alias": "dotRadius"; "required": false; }; "class": { "alias": "class"; "required": false; }; }, {}, never, never, true, never>;
312
+ }
313
+ /** A filled area for one series: a low-opacity wash under a 2px stroke. */
314
+ export declare class ChartAreaComponent extends ChartChild {
315
+ /** Key of the series to draw. @default '' */
316
+ seriesKey: string;
317
+ /** Interpolation between points. @default 'linear' */
318
+ curve: 'linear' | 'smooth';
319
+ /** Opacity of the fill — a wash, never a saturated block. @default 0.1 */
320
+ fillOpacity: number;
321
+ /** Extra Tailwind classes merged onto the stroke via `cn()` (last-wins). */
322
+ class: string;
323
+ /** An area is anchored to a baseline, so zero has to be in the domain. */
324
+ protected register(): void;
325
+ get areaPath(): string;
326
+ get linePath(): string;
327
+ get color(): string;
328
+ static ɵfac: i0.ɵɵFactoryDeclaration<ChartAreaComponent, never>;
329
+ static ɵcmp: i0.ɵɵComponentDeclaration<ChartAreaComponent, "svg:g[tolle-chart-area]", never, { "seriesKey": { "alias": "seriesKey"; "required": false; }; "curve": { "alias": "curve"; "required": false; }; "fillOpacity": { "alias": "fillOpacity"; "required": false; }; "class": { "alias": "class"; "required": false; }; }, {}, never, never, true, never>;
330
+ }
331
+ /**
332
+ * Builds a bar whose data end is rounded and whose baseline end stays square.
333
+ * Handles both directions, so a negative value rounds downward.
334
+ */
335
+ export declare function barPath(x: number, width: number, yBase: number, yValue: number, radius: number): string;
336
+ /**
337
+ * A bar mark for one series. Grouped beside its siblings by default, stacked
338
+ * when the container's `stacked` is set. The data end carries a 4px radius, the
339
+ * baseline end stays square, and neighbours are separated by surface, not ink.
340
+ */
341
+ export declare class ChartBarComponent extends ChartChild {
342
+ /** Key of the series to draw. @default '' */
343
+ seriesKey: string;
344
+ /** Corner radius on the data end in px. @default 4 */
345
+ radius: number;
346
+ /** Largest bar thickness in px; a wider band becomes air, not a fatter bar. @default 24 */
347
+ maxWidth: number;
348
+ /** Gap in px between adjacent bars and between stacked segments. @default 2 */
349
+ gap: number;
350
+ /** Extra Tailwind classes merged onto each bar via `cn()` (last-wins). */
351
+ class: string;
352
+ /** Index currently hovered, so the bar under the pointer can lift. */
353
+ activeIndex: number | null;
354
+ /** Bars need a band scale and a zero baseline; both belong to the whole chart. */
355
+ protected register(): void;
356
+ ngOnInit(): void;
357
+ get color(): string;
358
+ /** Geometry for every bar this series contributes. */
359
+ get bars(): {
360
+ d: string;
361
+ active: boolean;
362
+ x: number;
363
+ width: number;
364
+ yBase: number;
365
+ yValue: number;
366
+ }[];
367
+ static ɵfac: i0.ɵɵFactoryDeclaration<ChartBarComponent, never>;
368
+ static ɵcmp: i0.ɵɵComponentDeclaration<ChartBarComponent, "svg:g[tolle-chart-bar]", never, { "seriesKey": { "alias": "seriesKey"; "required": false; }; "radius": { "alias": "radius"; "required": false; }; "maxWidth": { "alias": "maxWidth"; "required": false; }; "gap": { "alias": "gap"; "required": false; }; "class": { "alias": "class"; "required": false; }; }, {}, never, never, true, never>;
369
+ }
@@ -0,0 +1,222 @@
1
+ import * as i0 from "@angular/core";
2
+ /** One plotted series: which key to read off each row, and how to name it. */
3
+ export interface ChartSeries {
4
+ key: string;
5
+ label: string;
6
+ }
7
+ /** Space reserved around the plot area for axes and labels. */
8
+ export interface ChartMargin {
9
+ top: number;
10
+ right: number;
11
+ bottom: number;
12
+ left: number;
13
+ }
14
+ /** A y-axis tick: its data value, its resolved svg y, and its formatted label. */
15
+ export interface ChartTick {
16
+ value: number;
17
+ y: number;
18
+ label: string;
19
+ }
20
+ /** A horizontal slice of the plot belonging to one x position. */
21
+ export interface ChartBand {
22
+ start: number;
23
+ centre: number;
24
+ width: number;
25
+ }
26
+ /** How x positions are resolved: discrete bands (bars) or points (line/area). */
27
+ export type ChartScaleMode = 'point' | 'band';
28
+ /** Number of chart palette steps that exist. A 6th series does not get a colour. */
29
+ export declare const CHART_COLOR_LIMIT = 5;
30
+ /**
31
+ * The paint used for a series past `CHART_COLOR_LIMIT`.
32
+ *
33
+ * The palette is validated for lightness, chroma and colour-blind separation at
34
+ * exactly five steps; generating a sixth would land outside that validation, and
35
+ * wrapping back to step 1 would make two series share an identity. Both are
36
+ * worse than dropping to a neutral, so the overflow is explicitly uncoloured.
37
+ */
38
+ export declare const CHART_OVERFLOW_COLOR = "rgb(var(--muted-foreground))";
39
+ /**
40
+ * Hands out palette steps by entity key rather than by position.
41
+ *
42
+ * A key keeps its slot for the lifetime of the scale, which is what makes
43
+ * colour follow the entity: filtering a series out and back in, or removing an
44
+ * earlier one, must never repaint the survivors. Past the fifth distinct key
45
+ * the scale stops colouring rather than inventing a step or wrapping around.
46
+ */
47
+ export declare class ChartColorScale {
48
+ private readonly slots;
49
+ private next;
50
+ /** Reserves slots for `keys` in order, leaving already-known keys alone. */
51
+ register(keys: string[]): void;
52
+ /** Paint for `key`, registering it on first sight. */
53
+ colorFor(key: string): string;
54
+ /** True when `key` fell past the palette and renders neutral. */
55
+ isOverflow(key: string): boolean;
56
+ /** Slot index assigned to `key`, or undefined when it is unknown. */
57
+ slotOf(key: string): number | undefined;
58
+ }
59
+ /**
60
+ * Owns layout, scales and colour assignment for one `tolle-chart`, so every
61
+ * child draws into the same coordinate space. Renders nothing itself.
62
+ *
63
+ * Provided on `ChartComponent`, so each chart gets its own instance.
64
+ */
65
+ export declare class ChartService {
66
+ /** Rows being plotted, in x order. */
67
+ data: Record<string, any>[];
68
+ /** Series definitions, in the order they should take palette steps. */
69
+ series: ChartSeries[];
70
+ /** Row key holding the x category/label. */
71
+ xKey: string;
72
+ /** Whether marks stack on a shared baseline rather than sitting side by side. */
73
+ stacked: boolean;
74
+ /** Full svg width in px, tracked from the container's ResizeObserver. */
75
+ width: number;
76
+ /** Full svg height in px. */
77
+ height: number;
78
+ /** Space reserved around the plot area. */
79
+ margin: ChartMargin;
80
+ /** Fraction of a band's step spent on padding, split either side. */
81
+ bandPadding: number;
82
+ private scaleMode;
83
+ private zeroRequired;
84
+ private domainMin;
85
+ private domainMax;
86
+ private tickValues;
87
+ private tickStep;
88
+ /** Palette assignment, keyed by series identity. */
89
+ private readonly colors;
90
+ private readonly layoutSubject;
91
+ /** Emits a version number whenever scales, dimensions or data change. */
92
+ readonly layout$: import("rxjs").Observable<number>;
93
+ private readonly activeIndexSubject;
94
+ /** Index of the x position under the pointer, or null when not hovering. */
95
+ readonly activeIndex$: import("rxjs").Observable<number | null>;
96
+ private layoutVersion;
97
+ private emitScheduled;
98
+ get plotLeft(): number;
99
+ get plotTop(): number;
100
+ get plotWidth(): number;
101
+ get plotHeight(): number;
102
+ get plotRight(): number;
103
+ get plotBottom(): number;
104
+ /** Number of x positions. */
105
+ get count(): number;
106
+ /** How x is currently resolved. Bars flip this to 'band'. */
107
+ get mode(): ChartScaleMode;
108
+ /** Resolved y ticks, with svg coordinates and formatted labels. */
109
+ get ticks(): ChartTick[];
110
+ /** Current y domain as [min, max]. */
111
+ get domain(): [number, number];
112
+ /** The x-axis category labels, one per row. */
113
+ get xLabels(): string[];
114
+ /**
115
+ * Replaces the chart's configuration and recomputes the scales.
116
+ * Called by the container on input changes and on resize.
117
+ */
118
+ configure(config: Partial<Pick<ChartService, 'data' | 'series' | 'xKey' | 'stacked' | 'width' | 'height' | 'margin' | 'bandPadding'>>): void;
119
+ /** Switches x to a band scale. Bars call this; it also forces zero into the domain. */
120
+ useBandScale(): void;
121
+ /** Forces zero into the y domain, for marks anchored to a baseline. */
122
+ requireZero(): void;
123
+ /** Reserves palette slots in series order, leaving known keys untouched. */
124
+ private syncColorSlots;
125
+ /**
126
+ * Paint for a series, keyed by identity rather than by index in the visible
127
+ * array. Past the fifth distinct key this returns the neutral overflow colour.
128
+ */
129
+ colorFor(seriesKey: string): string;
130
+ /** True when this series fell past the palette and renders neutral. */
131
+ isOverflowSeries(seriesKey: string): boolean;
132
+ /** Reads a series value off a row, or null when it is missing/non-numeric. */
133
+ valueAt(seriesKey: string, index: number): number | null;
134
+ /** Sum of every series below `seriesKey` at `index`, for stacked marks. */
135
+ stackBase(seriesKey: string, index: number): number;
136
+ /** Sum of every series at `index`. */
137
+ stackTotal(index: number): number;
138
+ /**
139
+ * Maps a data value to an svg y. SVG y grows downward, so the domain maximum
140
+ * lands on `plotTop` and the minimum on `plotBottom`.
141
+ */
142
+ yFor(value: number): number;
143
+ /** The svg y of the zero line, clamped into the plot. */
144
+ get baselineY(): number;
145
+ /** Width of one band, excluding its padding. Meaningful in band mode. */
146
+ get bandWidth(): number;
147
+ /** Distance between adjacent band starts. Bands tile the plot exactly. */
148
+ get bandStep(): number;
149
+ /** Geometry of the band at `index`. */
150
+ bandFor(index: number): ChartBand;
151
+ /** x of the data point at `index` on the point scale. */
152
+ pointX(index: number): number;
153
+ /** x of `index` under whichever scale the chart is currently using. */
154
+ xFor(index: number): number;
155
+ /**
156
+ * The pointer catchment area for `index` — deliberately wider than the mark.
157
+ * In band mode it is the whole band step; on the point scale it runs to the
158
+ * midpoints of the neighbouring points, so the pointer only has to be nearest.
159
+ */
160
+ hitBandFor(index: number): ChartBand;
161
+ /** Index currently under the pointer, or null. */
162
+ get activeIndex(): number | null;
163
+ setActiveIndex(index: number | null): void;
164
+ private recompute;
165
+ /** Everything a subscriber would render differently, flattened for comparison. */
166
+ private lastSignature;
167
+ private layoutSignature;
168
+ /**
169
+ * Coalesces layout notifications into a microtask, so several children
170
+ * registering in the same change-detection pass produce one emission after
171
+ * they have all settled rather than one each mid-pass.
172
+ */
173
+ private scheduleEmit;
174
+ /** Formats a value for a tick label at the current tick step's precision. */
175
+ formatValue(value: number): string;
176
+ /** Straight-segment path through the series' defined points. */
177
+ linePath(seriesKey: string): string;
178
+ /** Monotone-cubic path through the series' defined points. */
179
+ smoothPath(seriesKey: string): string;
180
+ /**
181
+ * Filled-area path: the series' line, closed back along its baseline. When
182
+ * stacked, the floor is the top of the series below rather than zero.
183
+ */
184
+ areaPath(seriesKey: string, smooth: boolean): string;
185
+ /** Resolved svg points for a series, skipping rows where it has no value. */
186
+ pointsFor(seriesKey: string): {
187
+ x: number;
188
+ y: number;
189
+ index: number;
190
+ }[];
191
+ static ɵfac: i0.ɵɵFactoryDeclaration<ChartService, never>;
192
+ static ɵprov: i0.ɵɵInjectableDeclaration<ChartService>;
193
+ }
194
+ /** Decimal places worth showing for a given tick step. */
195
+ export declare function decimalsFor(step: number): number;
196
+ /**
197
+ * Rounds a raw step up to the next 1/2/5 x 10^n.
198
+ *
199
+ * Dividing the range by a tick count instead would produce steps like 19.4 and
200
+ * so axis labels like 19.4 / 38.8 / 58.2, which nobody can read a value off.
201
+ */
202
+ export declare function niceStep(rawStep: number): number;
203
+ /**
204
+ * Builds a readable y scale over `values`: returns `[min, max, step, ticks]`
205
+ * with the domain snapped outward to whole steps.
206
+ *
207
+ * Degenerate inputs (empty, all-identical) still produce a usable one-unit
208
+ * domain rather than a zero-height plot.
209
+ */
210
+ export declare function niceScale(values: number[], targetTicks?: number): [number, number, number, number[]];
211
+ /**
212
+ * Monotone-cubic tangents (Fritsch-Carlson). Limiting each tangent to the
213
+ * neighbouring secants is what stops the curve overshooting: a plain
214
+ * Catmull-Rom spline bulges past the data and invents peaks that were never
215
+ * measured, which on a chart is a false statement about the numbers.
216
+ */
217
+ export declare function monotoneTangents(xs: number[], ys: number[]): number[];
218
+ /** Turns resolved points into an svg path, optionally monotone-smoothed. */
219
+ export declare function buildPath(points: {
220
+ x: number;
221
+ y: number;
222
+ }[], smooth: boolean): string;
@@ -0,0 +1,51 @@
1
+ import { EventEmitter, OnChanges } from '@angular/core';
2
+ import { type VariantProps } from 'class-variance-authority';
3
+ import * as i0 from "@angular/core";
4
+ declare const checkpointPillVariants: (props?: ({
5
+ active?: boolean | null | undefined;
6
+ size?: "default" | "sm" | null | undefined;
7
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
8
+ export type CheckpointProps = VariantProps<typeof checkpointPillVariants>;
9
+ /**
10
+ * A labelled marker in a conversation that the user can rewind to. Renders as a
11
+ * horizontal rule with a centred, clickable pill.
12
+ *
13
+ * ```html
14
+ * <tolle-checkpoint label="Before refactor" timestamp="14:02" (restore)="rewind()"></tolle-checkpoint>
15
+ * ```
16
+ * @new
17
+ */
18
+ export declare class CheckpointComponent implements OnChanges {
19
+ private readonly cdr;
20
+ /**
21
+ * Angular writes a bound `class` input through its styling path, which does
22
+ * not mark an OnPush component dirty — without this hook the component keeps
23
+ * rendering the class it was born with.
24
+ */
25
+ ngOnChanges(): void;
26
+ /** Name of the checkpoint shown in the pill. @default 'Checkpoint' */
27
+ label: string;
28
+ /** Pre-formatted time shown after the label. @default '' */
29
+ timestamp: string;
30
+ /** Highlights this checkpoint as the one currently restored to. @default false */
31
+ active: boolean;
32
+ /** Prevents the pill from being activated. @default false */
33
+ disabled: boolean;
34
+ /** Verb used to build the pill's accessible name. @default 'Restore checkpoint' */
35
+ restoreLabel: string;
36
+ /** Overrides the pill's accessible name entirely. @default '' */
37
+ ariaLabel: string;
38
+ /** Remixicon class shown before the label. @default 'ri-history-line' */
39
+ icon: string;
40
+ /** Size of the pill. @default 'default' */
41
+ size: CheckpointProps['size'];
42
+ /** Extra Tailwind classes merged onto the row via `cn()` (last-wins). */
43
+ class: string;
44
+ /** Emitted when the user asks to restore this checkpoint. */
45
+ restore: EventEmitter<void>;
46
+ get computedClass(): string;
47
+ get pillClass(): string;
48
+ static ɵfac: i0.ɵɵFactoryDeclaration<CheckpointComponent, never>;
49
+ static ɵcmp: i0.ɵɵComponentDeclaration<CheckpointComponent, "tolle-checkpoint", never, { "label": { "alias": "label"; "required": false; }; "timestamp": { "alias": "timestamp"; "required": false; }; "active": { "alias": "active"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "restoreLabel": { "alias": "restoreLabel"; "required": false; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; }; "icon": { "alias": "icon"; "required": false; }; "size": { "alias": "size"; "required": false; }; "class": { "alias": "class"; "required": false; }; }, { "restore": "restore"; }, never, ["*"], true, never>;
50
+ }
51
+ export {};