@alfadocs/ui-kit 1.1.0 → 1.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 (121) hide show
  1. package/dist/_chunks/{actions-cell-renderer-ClGCSQnA.js → actions-cell-renderer-Ceah0ywE.js} +2 -2
  2. package/dist/_chunks/anamnesis-i18n-DGRdwc0i.js +8720 -0
  3. package/dist/_chunks/arrow-up-BYvcvTkB.js +26 -0
  4. package/dist/_chunks/{editable-currency-cell-renderer-Dus_sBvX.js → editable-currency-cell-renderer-Uhzkd0ZP.js} +68 -88
  5. package/dist/_chunks/{exceljs.min-DUJ-5CGx.js → exceljs.min-D2MHbJsF.js} +10 -9
  6. package/dist/_chunks/{face-scheme-Cou2efl7.js → face-scheme-C00IvkUA.js} +237 -243
  7. package/dist/_chunks/{file-manager-CNSLiuLo.js → file-manager-lNjcSXoD.js} +174 -186
  8. package/dist/_chunks/minus-BQDHq1c1.js +12 -0
  9. package/dist/_chunks/notebook-pen-CO7HoM-W.js +25 -0
  10. package/dist/_chunks/notes-panel-DPsgB4Mv.js +351 -0
  11. package/dist/_chunks/{patient-table-DXk0wW8Q.js → patient-table-C7QHFC63.js} +2 -2
  12. package/dist/_chunks/share-2-B49jcW2I.js +18 -0
  13. package/dist/_chunks/sparkline-BTY4B5tv.js +509 -0
  14. package/dist/agent-catalog.json +27 -1
  15. package/dist/agent-i18n/en.json +4 -2
  16. package/dist/components/data-table/index.js +2 -2
  17. package/dist/components/face-scheme/index.js +1 -1
  18. package/dist/components/file-manager/index.js +1 -1
  19. package/dist/components/index.d.ts +1 -0
  20. package/dist/components/notes-panel/index.d.ts +1 -1
  21. package/dist/components/notes-panel/index.js +1 -1
  22. package/dist/components/notes-panel/notes-panel.d.ts +45 -2
  23. package/dist/components/patient-table/index.js +1 -1
  24. package/dist/components/sparkline/index.js +1 -1
  25. package/dist/components/sparkline/sparkline.d.ts +25 -0
  26. package/dist/host-compat.css +4 -1
  27. package/dist/i18n/locales/ar.d.ts +2 -0
  28. package/dist/i18n/locales/ar.js +2 -0
  29. package/dist/i18n/locales/de.d.ts +2 -0
  30. package/dist/i18n/locales/de.js +2 -0
  31. package/dist/i18n/locales/el.d.ts +2 -0
  32. package/dist/i18n/locales/el.js +2 -0
  33. package/dist/i18n/locales/en.d.ts +2 -0
  34. package/dist/i18n/locales/en.js +2 -0
  35. package/dist/i18n/locales/es.d.ts +2 -0
  36. package/dist/i18n/locales/es.js +2 -0
  37. package/dist/i18n/locales/fr.d.ts +2 -0
  38. package/dist/i18n/locales/fr.js +2 -0
  39. package/dist/i18n/locales/hi.d.ts +2 -0
  40. package/dist/i18n/locales/hi.js +2 -0
  41. package/dist/i18n/locales/it.d.ts +2 -0
  42. package/dist/i18n/locales/it.js +2 -0
  43. package/dist/i18n/locales/ja.d.ts +2 -0
  44. package/dist/i18n/locales/ja.js +2 -0
  45. package/dist/i18n/locales/nl.d.ts +2 -0
  46. package/dist/i18n/locales/nl.js +2 -0
  47. package/dist/i18n/locales/pl.d.ts +2 -0
  48. package/dist/i18n/locales/pl.js +2 -0
  49. package/dist/i18n/locales/pt.d.ts +2 -0
  50. package/dist/i18n/locales/pt.js +2 -0
  51. package/dist/i18n/locales/ro.d.ts +2 -0
  52. package/dist/i18n/locales/ro.js +2 -0
  53. package/dist/i18n/locales/ru.d.ts +2 -0
  54. package/dist/i18n/locales/ru.js +2 -0
  55. package/dist/i18n/locales/sq.d.ts +2 -0
  56. package/dist/i18n/locales/sq.js +2 -0
  57. package/dist/i18n/locales/sv.d.ts +2 -0
  58. package/dist/i18n/locales/sv.js +2 -0
  59. package/dist/i18n/locales/tr.d.ts +2 -0
  60. package/dist/i18n/locales/tr.js +2 -0
  61. package/dist/i18n/locales/zh.d.ts +2 -0
  62. package/dist/i18n/locales/zh.js +2 -0
  63. package/dist/index.js +132 -109
  64. package/dist/locales/ar.json +2 -0
  65. package/dist/locales/de.json +2 -0
  66. package/dist/locales/el.json +2 -0
  67. package/dist/locales/en.json +2 -0
  68. package/dist/locales/es.json +2 -0
  69. package/dist/locales/fr.json +2 -0
  70. package/dist/locales/hi.json +2 -0
  71. package/dist/locales/it.json +2 -0
  72. package/dist/locales/ja.json +2 -0
  73. package/dist/locales/nl.json +2 -0
  74. package/dist/locales/pl.json +2 -0
  75. package/dist/locales/pt.json +2 -0
  76. package/dist/locales/ro.json +2 -0
  77. package/dist/locales/ru.json +2 -0
  78. package/dist/locales/sq.json +2 -0
  79. package/dist/locales/sv.json +2 -0
  80. package/dist/locales/tr.json +2 -0
  81. package/dist/locales/zh.json +2 -0
  82. package/dist/patterns/_shared/target-tile.d.ts +31 -0
  83. package/dist/patterns/anamnesis/anamnesis-catalogue.d.ts +23 -0
  84. package/dist/patterns/anamnesis/anamnesis-compare-panel.d.ts +82 -0
  85. package/dist/patterns/anamnesis/anamnesis-compile-blocks.d.ts +46 -0
  86. package/dist/patterns/anamnesis/anamnesis-compile.d.ts +48 -0
  87. package/dist/patterns/anamnesis/anamnesis-config-editor.d.ts +26 -0
  88. package/dist/patterns/anamnesis/anamnesis-config.d.ts +62 -0
  89. package/dist/patterns/anamnesis/anamnesis-derive.d.ts +194 -0
  90. package/dist/patterns/anamnesis/anamnesis-digest.d.ts +84 -0
  91. package/dist/patterns/anamnesis/anamnesis-disclosure.d.ts +19 -0
  92. package/dist/patterns/anamnesis/anamnesis-event-bar.d.ts +12 -0
  93. package/dist/patterns/anamnesis/anamnesis-events.d.ts +60 -0
  94. package/dist/patterns/anamnesis/anamnesis-evolution-grid.d.ts +48 -0
  95. package/dist/patterns/anamnesis/anamnesis-evolution.d.ts +37 -0
  96. package/dist/patterns/anamnesis/anamnesis-export-download.d.ts +10 -0
  97. package/dist/patterns/anamnesis/anamnesis-export-menu.d.ts +23 -0
  98. package/dist/patterns/anamnesis/anamnesis-export-pdf.d.ts +36 -0
  99. package/dist/patterns/anamnesis/anamnesis-export.d.ts +143 -0
  100. package/dist/patterns/anamnesis/anamnesis-field.d.ts +14 -0
  101. package/dist/patterns/anamnesis/anamnesis-format.d.ts +67 -0
  102. package/dist/patterns/anamnesis/anamnesis-i18n.d.ts +6 -0
  103. package/dist/patterns/anamnesis/anamnesis-indicators.d.ts +53 -0
  104. package/dist/patterns/anamnesis/anamnesis-intake.d.ts +16 -0
  105. package/dist/patterns/anamnesis/anamnesis-matrix.d.ts +91 -0
  106. package/dist/patterns/anamnesis/anamnesis-notes.d.ts +19 -0
  107. package/dist/patterns/anamnesis/anamnesis-readonly.d.ts +17 -0
  108. package/dist/patterns/anamnesis/anamnesis-summary.d.ts +35 -0
  109. package/dist/patterns/anamnesis/anamnesis-target-editor.d.ts +18 -0
  110. package/dist/patterns/anamnesis/anamnesis-target-strip.d.ts +14 -0
  111. package/dist/patterns/anamnesis/anamnesis-targets.d.ts +58 -0
  112. package/dist/patterns/anamnesis/anamnesis-types.d.ts +336 -0
  113. package/dist/patterns/anamnesis/anamnesis-visit-note.d.ts +35 -0
  114. package/dist/patterns/anamnesis/anamnesis-window.d.ts +37 -0
  115. package/dist/patterns/anamnesis/anamnesis.d.ts +48 -0
  116. package/dist/patterns/anamnesis/index.d.ts +8 -0
  117. package/dist/patterns/anamnesis/index.js +26 -0
  118. package/dist/tokens.css +1 -1
  119. package/package.json +5 -1
  120. package/dist/_chunks/notes-panel-CTcOLLVo.js +0 -324
  121. package/dist/_chunks/sparkline-DLq7xwic.js +0 -394
@@ -0,0 +1,509 @@
1
+ import { jsx as c, jsxs as D } from "react/jsx-runtime";
2
+ import { forwardRef as le, useId as ue, useMemo as A, useRef as P, useState as F, useEffect as U, useImperativeHandle as pe } from "react";
3
+ import { c as E } from "./index-D2ZczOXr.js";
4
+ import { useTranslation as me } from "react-i18next";
5
+ import he from "react-apexcharts";
6
+ import V from "apexcharts";
7
+ import { g as J, u as fe } from "./apexcharts-theme-B_AxGC_h.js";
8
+ import { m as ge } from "./annotation-marker-CsUJGZjQ.js";
9
+ import { u as ve } from "./registry-DvAUVLHh.js";
10
+ function ye(n) {
11
+ if (n.length < 2)
12
+ return { slope: 0, direction: "steady" };
13
+ const r = n.length, h = (r - 1) / 2, l = n.reduce((a, i) => a + i, 0) / r;
14
+ let s = 0, u = 0;
15
+ for (let a = 0; a < r; a++) {
16
+ const i = a - h;
17
+ s += i * (n[a] - l), u += i * i;
18
+ }
19
+ const m = u === 0 ? 0 : s / u, k = 0.01 * (Math.max(...n) - Math.min(...n) || 1), f = Math.abs(m) < k ? "steady" : m > 0 ? "increasing" : "decreasing";
20
+ return { slope: m, direction: f };
21
+ }
22
+ const be = {
23
+ id: "sparkline",
24
+ capabilities: [],
25
+ state: {},
26
+ actions: {
27
+ update_series: {
28
+ // Replacing the rendered series mutates what the chart displays — write,
29
+ // not read.
30
+ safety: "write",
31
+ argsType: "{ data: number[] }",
32
+ argsSchema: {
33
+ type: "object",
34
+ properties: {
35
+ data: {
36
+ type: "array",
37
+ items: { type: "number" },
38
+ description: "The new data points to render."
39
+ }
40
+ },
41
+ required: ["data"]
42
+ },
43
+ idempotent: !0,
44
+ descriptionKey: "ui.agent.sparkline.actions.updateSeries",
45
+ description: "Replace the sparkline data without remounting.",
46
+ invoke: (n, r) => {
47
+ n.updateSeries(r.data);
48
+ }
49
+ },
50
+ export_png: {
51
+ // Pure getter — returns an image of the current chart, no state change.
52
+ safety: "read",
53
+ returns: "string",
54
+ returnsSchema: {
55
+ type: "string",
56
+ description: "A PNG image of the sparkline encoded as a data URI."
57
+ },
58
+ descriptionKey: "ui.agent.sparkline.actions.exportPng",
59
+ description: "Return a PNG data URI of the sparkline.",
60
+ invoke: (n) => n.dataURI()
61
+ },
62
+ select_annotation: {
63
+ // Routes the host somewhere — the same thing a pointer press on the
64
+ // annotation's band does. Nothing in the chart changes, but the host's
65
+ // surface does, so it is not a read.
66
+ safety: "write",
67
+ argsType: "{ annotationId: string }",
68
+ argsSchema: {
69
+ type: "object",
70
+ properties: {
71
+ annotationId: {
72
+ type: "string",
73
+ description: "The annotation's id, as carried by data-annotation-hit-id on the pressable band. The decorative drawn marker carries the same value as data-annotation-id, but is not selectable."
74
+ }
75
+ },
76
+ required: ["annotationId"]
77
+ },
78
+ idempotent: !0,
79
+ descriptionKey: "ui.agent.sparkline.actions.selectAnnotation",
80
+ description: "Select a drawn annotation, as pressing its band would. No-op unless the host wired onAnnotationSelect and the id names an annotation that is currently drawn.",
81
+ invoke: (n, r) => {
82
+ n.selectAnnotation(r.annotationId);
83
+ }
84
+ }
85
+ },
86
+ domHooks: {
87
+ root: { attr: "data-component", value: "sparkline" },
88
+ instanceId: {
89
+ attr: "data-component-id",
90
+ sourceProp: "id",
91
+ description: "Sourced from the id prop."
92
+ }
93
+ }
94
+ }, Q = E("ds:relative ds:inline-block ds:w-full", {
95
+ variants: {
96
+ size: {
97
+ xs: "ds:h-6",
98
+ sm: "ds:h-8",
99
+ md: "ds:h-10",
100
+ // Applied when an explicit `height` prop is given: the wrapper
101
+ // grows with the svg instead of clipping at the size's fixed height.
102
+ auto: ""
103
+ }
104
+ },
105
+ defaultVariants: { size: "md" }
106
+ }), X = E("", {
107
+ variants: {
108
+ tone: {
109
+ neutral: "ds:[--annotation-color:var(--muted-foreground)]",
110
+ info: "ds:[--annotation-color:var(--info)]",
111
+ success: "ds:[--annotation-color:var(--success)]",
112
+ /* `--warning-readable`, not `--warning`: a 1.5px dashed line is a
113
+ * non-text graphic (WCAG 1.4.11, 3:1), and yellow-500 is ~1.6:1 on a
114
+ * light card. The token aliases back to `--warning` in dark. */
115
+ warning: "ds:[--annotation-color:var(--warning-readable)]",
116
+ error: "ds:[--annotation-color:var(--destructive)]",
117
+ accent: "ds:[--annotation-color:var(--accent)]"
118
+ }
119
+ },
120
+ defaultVariants: { tone: "neutral" }
121
+ }), we = E(
122
+ "ds:pointer-events-none ds:absolute ds:inset-x-[2px]",
123
+ {
124
+ variants: {
125
+ // Bleed to the target-size token, not a literal: (token − drawn)/−2 per
126
+ // size, so `.theme-accessible` (48px) widens the band automatically —
127
+ // the same calc idiom IconButton uses for its hit-area expansion.
128
+ size: {
129
+ xs: "ds:inset-y-[calc((var(--min-target-size)-24px)/-2)]",
130
+ sm: "ds:inset-y-[calc((var(--min-target-size)-32px)/-2)]",
131
+ md: "ds:inset-y-[calc((var(--min-target-size)-40px)/-2)]",
132
+ auto: "ds:inset-y-0"
133
+ }
134
+ },
135
+ defaultVariants: { size: "md" }
136
+ }
137
+ ), ke = {
138
+ increasing: "↑",
139
+ decreasing: "↓",
140
+ steady: "→"
141
+ }, xe = {
142
+ xs: 24,
143
+ sm: 32,
144
+ md: 40
145
+ }, I = 2, Y = 2.5, ee = 44;
146
+ function Ie(n, r, h = ee) {
147
+ const l = n.map((s) => ({
148
+ annotation: s,
149
+ centre: te(s.position) * r
150
+ })).sort((s, u) => s.centre - u.centre);
151
+ return l.map((s, u) => {
152
+ const m = l[u - 1], w = l[u + 1], k = m ? (m.centre + s.centre) / 2 : 0, f = w ? (s.centre + w.centre) / 2 : r, a = Math.max(0, k), i = Math.min(r, f), y = Math.min(h, Math.max(0, i - a)), N = Math.min(
153
+ Math.max(s.centre - y / 2, a),
154
+ i - y
155
+ );
156
+ return { annotation: s.annotation, x: N, width: y };
157
+ });
158
+ }
159
+ function te(n) {
160
+ return Number.isFinite(n) ? Math.min(1, Math.max(0, n)) : 0;
161
+ }
162
+ function Ne(n) {
163
+ return n.filter((r) => r != null);
164
+ }
165
+ function Me() {
166
+ return typeof window < "u" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
167
+ }
168
+ const Te = le(
169
+ ({
170
+ id: n,
171
+ data: r,
172
+ variant: h = "line",
173
+ size: l = "md",
174
+ label: s,
175
+ color: u,
176
+ showEndpoint: m = !1,
177
+ showTooltip: w = !1,
178
+ width: k,
179
+ height: f,
180
+ annotations: a,
181
+ onAnnotationSelect: i,
182
+ className: y,
183
+ ...N
184
+ }, ne) => {
185
+ var Z;
186
+ const { t: v, i18n: W } = me(), $ = ue(), x = A(
187
+ () => `sparkline-${$.replace(/[^a-zA-Z0-9-_]/g, "")}`,
188
+ [$]
189
+ ), M = P(null), [C, ae] = F(0), [re, se] = F(ee), p = A(() => Ne(r), [r]), { direction: O } = ye(p), j = A(() => {
190
+ const e = a && a.length > 0 ? v("sparkline.annotations", {
191
+ list: a.map((b) => b.label).join(", ")
192
+ }) : "", t = (b) => e ? `${b}. ${e}` : b;
193
+ if (p.length === 0)
194
+ return t(v("sparkline.noData", "No data"));
195
+ const o = (b) => new Intl.NumberFormat(W.language).format(b), g = v(`sparkline.direction.${O}`), d = {
196
+ min: o(Math.min(...p)),
197
+ max: o(Math.max(...p)),
198
+ current: o(p[p.length - 1]),
199
+ direction: g
200
+ };
201
+ return t(s ? v("sparkline.summary", { label: s, ...d }) : v("sparkline.summaryNoLabel", d));
202
+ }, [p, a, s, O, W.language, v]), [T, ie] = F(
203
+ () => {
204
+ try {
205
+ return J();
206
+ } catch {
207
+ return {};
208
+ }
209
+ }
210
+ );
211
+ U(() => {
212
+ let e;
213
+ const t = new MutationObserver(() => {
214
+ clearTimeout(e), e = setTimeout(() => {
215
+ try {
216
+ ie(J());
217
+ } catch {
218
+ }
219
+ }, 50);
220
+ });
221
+ return t.observe(document.documentElement, {
222
+ attributes: !0,
223
+ attributeFilter: ["class"]
224
+ }), () => {
225
+ clearTimeout(e), t.disconnect();
226
+ };
227
+ }, []), U(() => {
228
+ const e = M.current;
229
+ if (!e) return;
230
+ const t = () => {
231
+ const g = getComputedStyle(e).getPropertyValue("--min-target-size"), d = Number.parseFloat(g);
232
+ Number.isFinite(d) && d > 0 && se(d);
233
+ };
234
+ t();
235
+ const o = new ResizeObserver((g) => {
236
+ const d = g[0];
237
+ d && ae(Math.floor(d.contentRect.width)), t();
238
+ });
239
+ return o.observe(e), () => o.disconnect();
240
+ }, []), fe(M);
241
+ const R = P(i);
242
+ U(() => {
243
+ R.current = i;
244
+ }, [i]);
245
+ const B = P(a);
246
+ B.current = a;
247
+ const H = A(
248
+ () => ({
249
+ updateSeries(e) {
250
+ var t;
251
+ (t = V.getChartByID(x)) == null || t.updateSeries([{ data: e }]);
252
+ },
253
+ updateOptions(e) {
254
+ var t;
255
+ (t = V.getChartByID(x)) == null || t.updateOptions(e);
256
+ },
257
+ async dataURI() {
258
+ const e = V.getChartByID(x);
259
+ return e ? (await e.dataURI()).imgURI : "";
260
+ },
261
+ selectAnnotation(e) {
262
+ var o, g;
263
+ (o = B.current) != null && o.some((d) => d.id === e) && ((g = R.current) == null || g.call(R, e));
264
+ }
265
+ }),
266
+ [x]
267
+ );
268
+ pe(ne, () => H, [H]), ve(be, H, n);
269
+ const _ = u ?? ((Z = T.colors) == null ? void 0 : Z[0]) ?? "currentColor";
270
+ if (p.length === 0)
271
+ return /* @__PURE__ */ c(
272
+ "div",
273
+ {
274
+ ref: M,
275
+ role: "img",
276
+ "aria-label": j,
277
+ dir: "ltr",
278
+ className: Q({
279
+ size: f !== void 0 ? "auto" : l,
280
+ className: y
281
+ }),
282
+ "data-component": "sparkline",
283
+ "data-component-id": n,
284
+ ...N
285
+ }
286
+ );
287
+ const G = Me(), S = r.length > p.length, L = S ? r.flatMap((e, t) => e == null ? [] : [{ x: t, y: e }]) : p, oe = {
288
+ ...T,
289
+ chart: {
290
+ ...T.chart,
291
+ id: x,
292
+ type: h,
293
+ sparkline: { enabled: !0 },
294
+ toolbar: { show: !1 },
295
+ animations: {
296
+ enabled: !G,
297
+ // A gapped series is re-rendered as {x, y} pairs, and Apex's
298
+ // update tween interpolates between the old and new paths point by
299
+ // point. Across a width change the two have different lengths and
300
+ // the tween emits `d="… NaN …"` for a few frames. The finished
301
+ // render is correct either way; switching the tween off keeps the
302
+ // console clean.
303
+ dynamicAnimation: { enabled: !G && !S }
304
+ },
305
+ zoom: { enabled: !1 },
306
+ parentHeightOffset: 0
307
+ },
308
+ colors: [_],
309
+ stroke: {
310
+ curve: "smooth",
311
+ width: h === "bar" ? 0 : 2
312
+ },
313
+ fill: {
314
+ opacity: h === "area" ? 0.15 : 1
315
+ },
316
+ xaxis: {
317
+ crosshairs: { show: !1 },
318
+ // Pin the extent to the slot count so a gap at either end still holds
319
+ // its place — otherwise the plot would rescale to the measurements
320
+ // and the annotation fractions would no longer mean the same thing.
321
+ ...S ? { type: "numeric", min: 0, max: r.length - 1 } : {}
322
+ },
323
+ tooltip: { enabled: w },
324
+ markers: m ? {
325
+ size: [0],
326
+ discrete: [
327
+ {
328
+ // An index into the SERIES, whose holes have already been
329
+ // removed — so this is the last MEASURED point, never a slot
330
+ // the parameter was not measured at.
331
+ seriesIndex: 0,
332
+ dataPointIndex: L.length - 1,
333
+ fillColor: _,
334
+ strokeColor: _,
335
+ size: 4
336
+ }
337
+ ]
338
+ } : { size: 0 },
339
+ grid: {
340
+ ...T.grid,
341
+ show: !1,
342
+ // ApexCharts grid.padding uses physical keys (not CSS logical properties).
343
+ // The chart wrapper enforces dir="ltr" so these always resolve correctly.
344
+ padding: {
345
+ top: I,
346
+ right: I,
347
+ bottom: I,
348
+ left: I
349
+ }
350
+ }
351
+ }, de = k ?? (C > 0 ? C : "100%"), ce = f ?? xe[l ?? "md"], z = a != null && a.length ? a : void 0, K = C - I * 2, q = i && z && K > 0 ? Ie(z, K, re) : void 0;
352
+ return /* @__PURE__ */ D(
353
+ "div",
354
+ {
355
+ ref: M,
356
+ role: "img",
357
+ "aria-label": j,
358
+ dir: "ltr",
359
+ className: Q({
360
+ size: f !== void 0 ? "auto" : l,
361
+ className: y
362
+ }),
363
+ "data-component": "sparkline",
364
+ "data-component-id": n,
365
+ ...N,
366
+ children: [
367
+ /* @__PURE__ */ c(
368
+ he,
369
+ {
370
+ type: h,
371
+ series: [{ data: L }],
372
+ options: oe,
373
+ width: de,
374
+ height: ce,
375
+ "aria-hidden": "true"
376
+ }
377
+ ),
378
+ z && /* Drawn over the plot rather than through ApexCharts' own xaxis
379
+ annotations: a fraction of the measured extent is the one
380
+ positioning rule that survives series of different lengths, which
381
+ is what makes a column of sparklines share an x. */
382
+ /* The inset lives on a div: an <svg> is a replaced element, so
383
+ left+right do not size it and it would fall back to its intrinsic
384
+ 300px. The div is the plot box; the svg fills it. The 2px MUST
385
+ equal PLOT_EDGE_PADDING — Tailwind needs a static literal, so the
386
+ two cannot share one source; change them together or the first and
387
+ last annotation drift off the first and last data point. */
388
+ /* @__PURE__ */ c("div", { className: "ds:pointer-events-none ds:absolute ds:inset-y-0 ds:inset-x-[2px]", children: /* @__PURE__ */ c(
389
+ "svg",
390
+ {
391
+ "aria-hidden": "true",
392
+ focusable: "false",
393
+ "data-testid": "sparkline-annotations",
394
+ className: "ds:size-full",
395
+ children: z.map((e) => {
396
+ const t = te(e.position);
397
+ return (
398
+ /* A nested viewport placed at a percentage of the plot: the
399
+ one positioning rule that needs no measurement, so a column
400
+ of sparklines shares an x whatever their widths. */
401
+ /* @__PURE__ */ D(
402
+ "svg",
403
+ {
404
+ x: `${t * 100}%`,
405
+ y: "0",
406
+ width: "1",
407
+ height: "100%",
408
+ overflow: "visible",
409
+ "data-annotation-id": e.id,
410
+ "data-annotation-position": t,
411
+ className: X({ tone: e.tone }),
412
+ children: [
413
+ /* @__PURE__ */ c(
414
+ "line",
415
+ {
416
+ x1: 0,
417
+ x2: 0,
418
+ y1: 0,
419
+ y2: "100%",
420
+ className: "ds:[stroke:var(--annotation-color)] ds:[stroke-dasharray:2_3] ds:[stroke-width:1]"
421
+ }
422
+ ),
423
+ /* @__PURE__ */ c(
424
+ "path",
425
+ {
426
+ d: ge(
427
+ e.shape ?? "diamond",
428
+ 0,
429
+ Y,
430
+ Y
431
+ ),
432
+ className: "ds:[fill:var(--annotation-color)]"
433
+ }
434
+ )
435
+ ]
436
+ },
437
+ e.id
438
+ )
439
+ );
440
+ })
441
+ }
442
+ ) }),
443
+ q && i && /* Sized in px, not percentages: the target size is a measurement,
444
+ not a fraction of a box the reader can resize.
445
+ `pointer-events-none` holds all the way down to the bands, so the
446
+ only live pixels are the token-width each annotation owns. */
447
+ /* @__PURE__ */ c(
448
+ "div",
449
+ {
450
+ className: we({
451
+ size: f !== void 0 ? "auto" : l
452
+ }),
453
+ children: /* @__PURE__ */ c(
454
+ "svg",
455
+ {
456
+ "aria-hidden": "true",
457
+ focusable: "false",
458
+ "data-testid": "sparkline-annotation-hits",
459
+ className: "ds:size-full",
460
+ children: q.map(({ annotation: e, x: t, width: o }) => /* @__PURE__ */ D(
461
+ "g",
462
+ {
463
+ "data-annotation-hit-id": e.id,
464
+ onClick: () => i(e.id),
465
+ className: `ds:group ds:pointer-events-auto ds:cursor-pointer ${X(
466
+ { tone: e.tone }
467
+ )}`,
468
+ children: [
469
+ /* @__PURE__ */ c("title", { children: v("sparkline.annotationAction", {
470
+ label: e.label
471
+ }) }),
472
+ /* @__PURE__ */ c(
473
+ "rect",
474
+ {
475
+ x: t,
476
+ y: 0,
477
+ width: o,
478
+ height: "100%",
479
+ className: "ds:[fill:var(--annotation-color)] ds:opacity-0 ds:transition-opacity ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none ds:group-hover:opacity-20"
480
+ }
481
+ )
482
+ ]
483
+ },
484
+ e.id
485
+ ))
486
+ }
487
+ )
488
+ }
489
+ ),
490
+ m && /* @__PURE__ */ c(
491
+ "span",
492
+ {
493
+ "aria-hidden": "true",
494
+ className: "ds:pointer-events-none ds:absolute ds:end-0 ds:top-0 ds:text-[length:var(--font-size-xs)] ds:leading-none",
495
+ children: ke[O]
496
+ }
497
+ )
498
+ ]
499
+ }
500
+ );
501
+ }
502
+ );
503
+ Te.displayName = "Sparkline";
504
+ export {
505
+ Te as S,
506
+ be as s,
507
+ ye as u
508
+ };
509
+ //# sourceMappingURL=sparkline-BTY4B5tv.js.map
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
- "packageVersion": "1.1.0",
3
+ "packageVersion": "1.3.0",
4
4
  "components": [
5
5
  {
6
6
  "kind": "component",
@@ -6720,6 +6720,12 @@
6720
6720
  "type": "boolean",
6721
6721
  "description": "Whether the current user may write clinical notes (the practice_add_clinical_note permission gate).",
6722
6722
  "descriptionKey": "ui.agent.notesPanel.state.canAddClinical"
6723
+ },
6724
+ {
6725
+ "name": "currentNoteId",
6726
+ "type": "string | null",
6727
+ "description": "Id of the note the host has addressed — the one marked, scrolled to and focused. Null when none is. An id only, never note content.",
6728
+ "descriptionKey": "ui.agent.notesPanel.state.currentNoteId"
6723
6729
  }
6724
6730
  ],
6725
6731
  "actions": [
@@ -11099,6 +11105,26 @@
11099
11105
  },
11100
11106
  "description": "Return a PNG data URI of the sparkline.",
11101
11107
  "descriptionKey": "ui.agent.sparkline.actions.exportPng"
11108
+ },
11109
+ {
11110
+ "name": "select_annotation",
11111
+ "safety": "write",
11112
+ "argsType": "{ annotationId: string }",
11113
+ "argsSchema": {
11114
+ "type": "object",
11115
+ "properties": {
11116
+ "annotationId": {
11117
+ "type": "string",
11118
+ "description": "The annotation's id, as carried by data-annotation-hit-id on the pressable band. The decorative drawn marker carries the same value as data-annotation-id, but is not selectable."
11119
+ }
11120
+ },
11121
+ "required": [
11122
+ "annotationId"
11123
+ ]
11124
+ },
11125
+ "idempotent": true,
11126
+ "description": "Select a drawn annotation, as pressing its band would. No-op unless the host wired onAnnotationSelect and the id names an annotation that is currently drawn.",
11127
+ "descriptionKey": "ui.agent.sparkline.actions.selectAnnotation"
11102
11128
  }
11103
11129
  ],
11104
11130
  "domHooks": {
@@ -688,7 +688,8 @@
688
688
  "notesPanel": {
689
689
  "state": {
690
690
  "notes": "Timeline note ids + pinned / flagged / clinical flags. Never the note body or author (both PHI).",
691
- "canAddClinical": "Whether the current user may write clinical notes (the practice_add_clinical_note permission gate)."
691
+ "canAddClinical": "Whether the current user may write clinical notes (the practice_add_clinical_note permission gate).",
692
+ "currentNoteId": "Id of the note the host has addressed — the one marked, scrolled to and focused. Null when none is. An id only, never note content."
692
693
  },
693
694
  "actions": {
694
695
  "addNote": "Compose and commit a new note. A clinical note requires the clinical-note permission (read canAddClinical first).",
@@ -1137,7 +1138,8 @@
1137
1138
  "sparkline": {
1138
1139
  "actions": {
1139
1140
  "updateSeries": "Replace the sparkline data without remounting.",
1140
- "exportPng": "Return a PNG data URI of the sparkline."
1141
+ "exportPng": "Return a PNG data URI of the sparkline.",
1142
+ "selectAnnotation": "Select a drawn annotation, as pressing its band would. No-op unless the host wired onAnnotationSelect and the id names an annotation that is currently drawn."
1141
1143
  }
1142
1144
  },
1143
1145
  "stepperAccordion": {
@@ -1,5 +1,5 @@
1
- import { A as r, D as l, T as t, a as s, b as n, c as o, d, e as i, f as C } from "../../_chunks/actions-cell-renderer-ClGCSQnA.js";
2
- import { B as T, C as F, E as g, a as b, R as u, T as c, b as m, r as f, u as x } from "../../_chunks/editable-currency-cell-renderer-Dus_sBvX.js";
1
+ import { A as r, D as l, T as t, a as s, b as n, c as o, d, e as i, f as C } from "../../_chunks/actions-cell-renderer-Ceah0ywE.js";
2
+ import { B as T, C as F, E as g, a as b, R as u, T as c, b as m, r as f, u as x } from "../../_chunks/editable-currency-cell-renderer-Uhzkd0ZP.js";
3
3
  import { C as p, D as h, a as y, b as E, I as S, L as A, N as L, c as N, S as B, d as I, e as P, T as U, f as W, g as k, U as v } from "../../_chunks/link-cell-renderer-_DlEZHLI.js";
4
4
  export {
5
5
  r as ActionsCellRenderer,
@@ -1,4 +1,4 @@
1
- import { A as e, F as o, a as n, b as A, c as i, d as f, e as t, I, f as N, g as T, h as F, i as _, j as E, k as c, l as h, m as r, n as p, o as O, p as S, q as m, r as l, s as d, t as C, u as D } from "../../_chunks/face-scheme-Cou2efl7.js";
1
+ import { A as e, F as o, a as n, b as A, c as i, d as f, e as t, I, f as N, g as T, h as F, i as _, j as E, k as c, l as h, m as r, n as p, o as O, p as S, q as m, r as l, s as d, t as C, u as D } from "../../_chunks/face-scheme-C00IvkUA.js";
2
2
  export {
3
3
  e as ANNOTATION_TOOL_KIND,
4
4
  o as FACE_ANNOTATION_TOOLS,
@@ -1,4 +1,4 @@
1
- import { F as r, f } from "../../_chunks/file-manager-CNSLiuLo.js";
1
+ import { F as r, f } from "../../_chunks/file-manager-lNjcSXoD.js";
2
2
  export {
3
3
  r as FileManager,
4
4
  f as fileManagerAgent
@@ -198,6 +198,7 @@ export * from './transaction-chip';
198
198
  export * from './whatsapp-button';
199
199
  export * from './workflow';
200
200
  export * from '../patterns/alia-assistant';
201
+ export * from '../patterns/anamnesis';
201
202
  export * from '../patterns/marketplace-app-shell';
202
203
  export * from '../patterns/payment-automation-upsell';
203
204
  export * from '../patterns/signature-request';
@@ -1,3 +1,3 @@
1
1
  export { NotesPanel } from './notes-panel';
2
- export type { NotesPanelProps, NotesPanelNote } from './notes-panel';
2
+ export type { NotesPanelProps, NotesPanelNote, NotesPanelSubmission, } from './notes-panel';
3
3
  //# sourceMappingURL=index.d.ts.map
@@ -1,4 +1,4 @@
1
- import { N as a } from "../../_chunks/notes-panel-CTcOLLVo.js";
1
+ import { N as a } from "../../_chunks/notes-panel-DPsgB4Mv.js";
2
2
  export {
3
3
  a as NotesPanel
4
4
  };