@alfadocs/ui-kit-debug 1.2.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 (120) hide show
  1. package/dist/_chunks/{actions-cell-renderer-ClGCSQnA.js → actions-cell-renderer-Ceah0ywE.js} +2 -2
  2. package/dist/_chunks/{actions-cell-renderer-ClGCSQnA.js.map → actions-cell-renderer-Ceah0ywE.js.map} +1 -1
  3. package/dist/_chunks/anamnesis-i18n-DGRdwc0i.js +8720 -0
  4. package/dist/_chunks/anamnesis-i18n-DGRdwc0i.js.map +1 -0
  5. package/dist/_chunks/arrow-up-BYvcvTkB.js +26 -0
  6. package/dist/_chunks/arrow-up-BYvcvTkB.js.map +1 -0
  7. package/dist/_chunks/{editable-currency-cell-renderer-Dus_sBvX.js → editable-currency-cell-renderer-Uhzkd0ZP.js} +68 -88
  8. package/dist/_chunks/editable-currency-cell-renderer-Uhzkd0ZP.js.map +1 -0
  9. package/dist/_chunks/{exceljs.min-DUJ-5CGx.js → exceljs.min-D2MHbJsF.js} +10 -9
  10. package/dist/_chunks/{exceljs.min-DUJ-5CGx.js.map → exceljs.min-D2MHbJsF.js.map} +1 -1
  11. package/dist/_chunks/{face-scheme-Cou2efl7.js → face-scheme-C00IvkUA.js} +237 -243
  12. package/dist/_chunks/face-scheme-C00IvkUA.js.map +1 -0
  13. package/dist/_chunks/{file-manager-CNSLiuLo.js → file-manager-lNjcSXoD.js} +174 -186
  14. package/dist/_chunks/file-manager-lNjcSXoD.js.map +1 -0
  15. package/dist/_chunks/minus-BQDHq1c1.js +12 -0
  16. package/dist/_chunks/minus-BQDHq1c1.js.map +1 -0
  17. package/dist/_chunks/notebook-pen-CO7HoM-W.js +25 -0
  18. package/dist/_chunks/notebook-pen-CO7HoM-W.js.map +1 -0
  19. package/dist/_chunks/{notes-panel-CCz0J140.js → notes-panel-DPsgB4Mv.js} +73 -92
  20. package/dist/_chunks/notes-panel-DPsgB4Mv.js.map +1 -0
  21. package/dist/_chunks/{patient-table-DXk0wW8Q.js → patient-table-C7QHFC63.js} +2 -2
  22. package/dist/_chunks/{patient-table-DXk0wW8Q.js.map → patient-table-C7QHFC63.js.map} +1 -1
  23. package/dist/_chunks/share-2-B49jcW2I.js +18 -0
  24. package/dist/_chunks/share-2-B49jcW2I.js.map +1 -0
  25. package/dist/_chunks/{sparkline-DJtZBe7O.js → sparkline-BTY4B5tv.js} +153 -145
  26. package/dist/_chunks/sparkline-BTY4B5tv.js.map +1 -0
  27. package/dist/agent-catalog.json +1 -1
  28. package/dist/components/data-table/index.js +2 -2
  29. package/dist/components/face-scheme/index.js +1 -1
  30. package/dist/components/file-manager/index.js +1 -1
  31. package/dist/components/index.d.ts +1 -0
  32. package/dist/components/index.d.ts.map +1 -1
  33. package/dist/components/notes-panel/index.d.ts +1 -1
  34. package/dist/components/notes-panel/index.d.ts.map +1 -1
  35. package/dist/components/notes-panel/index.js +1 -1
  36. package/dist/components/patient-table/index.js +1 -1
  37. package/dist/components/sparkline/index.js +1 -1
  38. package/dist/components/sparkline/sparkline.d.ts +5 -4
  39. package/dist/components/sparkline/sparkline.d.ts.map +1 -1
  40. package/dist/index.js +132 -109
  41. package/dist/index.js.map +1 -1
  42. package/dist/patterns/_shared/target-tile.d.ts +31 -0
  43. package/dist/patterns/_shared/target-tile.d.ts.map +1 -0
  44. package/dist/patterns/anamnesis/anamnesis-catalogue.d.ts +23 -0
  45. package/dist/patterns/anamnesis/anamnesis-catalogue.d.ts.map +1 -0
  46. package/dist/patterns/anamnesis/anamnesis-compare-panel.d.ts +82 -0
  47. package/dist/patterns/anamnesis/anamnesis-compare-panel.d.ts.map +1 -0
  48. package/dist/patterns/anamnesis/anamnesis-compile-blocks.d.ts +46 -0
  49. package/dist/patterns/anamnesis/anamnesis-compile-blocks.d.ts.map +1 -0
  50. package/dist/patterns/anamnesis/anamnesis-compile.d.ts +48 -0
  51. package/dist/patterns/anamnesis/anamnesis-compile.d.ts.map +1 -0
  52. package/dist/patterns/anamnesis/anamnesis-config-editor.d.ts +26 -0
  53. package/dist/patterns/anamnesis/anamnesis-config-editor.d.ts.map +1 -0
  54. package/dist/patterns/anamnesis/anamnesis-config.d.ts +62 -0
  55. package/dist/patterns/anamnesis/anamnesis-config.d.ts.map +1 -0
  56. package/dist/patterns/anamnesis/anamnesis-derive.d.ts +194 -0
  57. package/dist/patterns/anamnesis/anamnesis-derive.d.ts.map +1 -0
  58. package/dist/patterns/anamnesis/anamnesis-digest.d.ts +84 -0
  59. package/dist/patterns/anamnesis/anamnesis-digest.d.ts.map +1 -0
  60. package/dist/patterns/anamnesis/anamnesis-disclosure.d.ts +19 -0
  61. package/dist/patterns/anamnesis/anamnesis-disclosure.d.ts.map +1 -0
  62. package/dist/patterns/anamnesis/anamnesis-event-bar.d.ts +12 -0
  63. package/dist/patterns/anamnesis/anamnesis-event-bar.d.ts.map +1 -0
  64. package/dist/patterns/anamnesis/anamnesis-events.d.ts +60 -0
  65. package/dist/patterns/anamnesis/anamnesis-events.d.ts.map +1 -0
  66. package/dist/patterns/anamnesis/anamnesis-evolution-grid.d.ts +48 -0
  67. package/dist/patterns/anamnesis/anamnesis-evolution-grid.d.ts.map +1 -0
  68. package/dist/patterns/anamnesis/anamnesis-evolution.d.ts +37 -0
  69. package/dist/patterns/anamnesis/anamnesis-evolution.d.ts.map +1 -0
  70. package/dist/patterns/anamnesis/anamnesis-export-download.d.ts +10 -0
  71. package/dist/patterns/anamnesis/anamnesis-export-download.d.ts.map +1 -0
  72. package/dist/patterns/anamnesis/anamnesis-export-menu.d.ts +23 -0
  73. package/dist/patterns/anamnesis/anamnesis-export-menu.d.ts.map +1 -0
  74. package/dist/patterns/anamnesis/anamnesis-export-pdf.d.ts +36 -0
  75. package/dist/patterns/anamnesis/anamnesis-export-pdf.d.ts.map +1 -0
  76. package/dist/patterns/anamnesis/anamnesis-export.d.ts +143 -0
  77. package/dist/patterns/anamnesis/anamnesis-export.d.ts.map +1 -0
  78. package/dist/patterns/anamnesis/anamnesis-field.d.ts +14 -0
  79. package/dist/patterns/anamnesis/anamnesis-field.d.ts.map +1 -0
  80. package/dist/patterns/anamnesis/anamnesis-format.d.ts +67 -0
  81. package/dist/patterns/anamnesis/anamnesis-format.d.ts.map +1 -0
  82. package/dist/patterns/anamnesis/anamnesis-i18n.d.ts +6 -0
  83. package/dist/patterns/anamnesis/anamnesis-i18n.d.ts.map +1 -0
  84. package/dist/patterns/anamnesis/anamnesis-indicators.d.ts +53 -0
  85. package/dist/patterns/anamnesis/anamnesis-indicators.d.ts.map +1 -0
  86. package/dist/patterns/anamnesis/anamnesis-intake.d.ts +16 -0
  87. package/dist/patterns/anamnesis/anamnesis-intake.d.ts.map +1 -0
  88. package/dist/patterns/anamnesis/anamnesis-matrix.d.ts +91 -0
  89. package/dist/patterns/anamnesis/anamnesis-matrix.d.ts.map +1 -0
  90. package/dist/patterns/anamnesis/anamnesis-notes.d.ts +19 -0
  91. package/dist/patterns/anamnesis/anamnesis-notes.d.ts.map +1 -0
  92. package/dist/patterns/anamnesis/anamnesis-readonly.d.ts +17 -0
  93. package/dist/patterns/anamnesis/anamnesis-readonly.d.ts.map +1 -0
  94. package/dist/patterns/anamnesis/anamnesis-summary.d.ts +35 -0
  95. package/dist/patterns/anamnesis/anamnesis-summary.d.ts.map +1 -0
  96. package/dist/patterns/anamnesis/anamnesis-target-editor.d.ts +18 -0
  97. package/dist/patterns/anamnesis/anamnesis-target-editor.d.ts.map +1 -0
  98. package/dist/patterns/anamnesis/anamnesis-target-strip.d.ts +14 -0
  99. package/dist/patterns/anamnesis/anamnesis-target-strip.d.ts.map +1 -0
  100. package/dist/patterns/anamnesis/anamnesis-targets.d.ts +58 -0
  101. package/dist/patterns/anamnesis/anamnesis-targets.d.ts.map +1 -0
  102. package/dist/patterns/anamnesis/anamnesis-types.d.ts +336 -0
  103. package/dist/patterns/anamnesis/anamnesis-types.d.ts.map +1 -0
  104. package/dist/patterns/anamnesis/anamnesis-visit-note.d.ts +35 -0
  105. package/dist/patterns/anamnesis/anamnesis-visit-note.d.ts.map +1 -0
  106. package/dist/patterns/anamnesis/anamnesis-window.d.ts +37 -0
  107. package/dist/patterns/anamnesis/anamnesis-window.d.ts.map +1 -0
  108. package/dist/patterns/anamnesis/anamnesis.d.ts +48 -0
  109. package/dist/patterns/anamnesis/anamnesis.d.ts.map +1 -0
  110. package/dist/patterns/anamnesis/index.d.ts +8 -0
  111. package/dist/patterns/anamnesis/index.d.ts.map +1 -0
  112. package/dist/patterns/anamnesis/index.js +26 -0
  113. package/dist/patterns/anamnesis/index.js.map +1 -0
  114. package/dist/tokens.css +1 -1
  115. package/package.json +5 -1
  116. package/dist/_chunks/editable-currency-cell-renderer-Dus_sBvX.js.map +0 -1
  117. package/dist/_chunks/face-scheme-Cou2efl7.js.map +0 -1
  118. package/dist/_chunks/file-manager-CNSLiuLo.js.map +0 -1
  119. package/dist/_chunks/notes-panel-CCz0J140.js.map +0 -1
  120. package/dist/_chunks/sparkline-DJtZBe7O.js.map +0 -1
@@ -0,0 +1,84 @@
1
+ import type { RefObject } from 'react';
2
+ import type { TFunction } from 'i18next';
3
+ import { type AlertAnnounce } from '../../components/alert';
4
+ import type { IntakeAnswer, IntakeSectionDef, PatientSex } from './anamnesis-types';
5
+ /** How one digest group is built. Phase 3 adds a group by adding an entry
6
+ * here — the renderer switches on `kind` and never on a group id. */
7
+ export type DigestGroupKind = 'prose' | 'facts' | 'flags';
8
+ export type DigestGroupDef = {
9
+ id: string;
10
+ kind: 'prose';
11
+ fieldKeys: readonly string[];
12
+ } | {
13
+ id: string;
14
+ kind: 'facts';
15
+ fieldKeys: readonly string[];
16
+ } | {
17
+ id: string;
18
+ kind: 'flags';
19
+ };
20
+ /** Reading order for a clinician with the patient in the room: why they came,
21
+ * what they already carry, what they report, what they do every day. */
22
+ export declare const DIGEST_GROUPS: readonly DigestGroupDef[];
23
+ /** Reads one answer by field key. Both surfaces hold their answers in a
24
+ * different shape (a working map vs `Sourced<IntakeAnswer>`), so the digest
25
+ * takes a reader rather than either shape. */
26
+ export type AnswerReader = (key: string) => IntakeAnswer | undefined;
27
+ export interface DigestItem {
28
+ key: string;
29
+ label: string;
30
+ /** Already display-ready. Absent numerics are an em dash, never "NaN". */
31
+ value: string;
32
+ }
33
+ export interface DigestGroup {
34
+ id: string;
35
+ kind: DigestGroupKind;
36
+ items: DigestItem[];
37
+ }
38
+ export interface IntakeDigest {
39
+ /** Only groups that have something to say. */
40
+ groups: DigestGroup[];
41
+ answered: number;
42
+ total: number;
43
+ }
44
+ export interface MissingAnswer {
45
+ key: string;
46
+ sectionKey: string;
47
+ label: string;
48
+ }
49
+ /** The whole digest. Pure apart from `t`; safe on an absent questionnaire, a
50
+ * half-answered one, and a practice that archived half the form. */
51
+ export declare function buildIntakeDigest(sections: readonly IntakeSectionDef[], read: AnswerReader, sex: PatientSex, t: TFunction): IntakeDigest;
52
+ /** Mandatory questions the patient has not answered, in questionnaire order.
53
+ * "Not sure" counts as unanswered — provisional, and flagged in the `.mdx`. */
54
+ export declare function missingMandatoryAnswers(sections: readonly IntakeSectionDef[], read: AnswerReader, sex: PatientSex, t: TFunction): MissingAnswer[];
55
+ /** Jump-to-field seam. The caller opens whatever disclosures hide the target
56
+ * (on compile that is BOTH the section block and the answer review), then asks
57
+ * for the jump; this waits for the reveal to mount before moving focus. */
58
+ export declare function useFieldJump(): {
59
+ containerRef: RefObject<HTMLDivElement | null>;
60
+ requestJump: (key: string) => void;
61
+ };
62
+ export interface AnamnesisMissingAnswersProps {
63
+ missing: readonly MissingAnswer[];
64
+ t: TFunction;
65
+ /** Reveals the first missing answer and moves focus to it. */
66
+ onJump: (missing: MissingAnswer) => void;
67
+ /** How loudly this is announced. Pass `'off'` where the list RECOMPUTES as
68
+ * the user types — a live region re-announces its whole content on every
69
+ * change, so a per-keystroke summary is noise, not help. Default `'polite'`
70
+ * suits a list fixed at mount. */
71
+ announce?: AlertAnnounce;
72
+ /** Label for the jump action. Override where the jump LEAVES the surface —
73
+ * a button that changes tab has to say so before it moves focus. */
74
+ jumpKey?: string;
75
+ }
76
+ /** Guidance, not an interruption. Tint and urgency are independent in the kit,
77
+ * so the `info` tint here is a visual choice, separate from `announce`. */
78
+ export declare function AnamnesisMissingAnswers({ missing, t, onJump, announce, jumpKey, }: AnamnesisMissingAnswersProps): import("react/jsx-runtime").JSX.Element | null;
79
+ export interface AnamnesisDigestProps {
80
+ digest: IntakeDigest;
81
+ t: TFunction;
82
+ }
83
+ export declare function AnamnesisDigest({ digest, t }: AnamnesisDigestProps): import("react/jsx-runtime").JSX.Element;
84
+ //# sourceMappingURL=anamnesis-digest.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"anamnesis-digest.d.ts","sourceRoot":"","sources":["../../../src/patterns/anamnesis/anamnesis-digest.tsx"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,EAAS,KAAK,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAUnE,OAAO,KAAK,EACV,YAAY,EAEZ,gBAAgB,EAChB,UAAU,EACX,MAAM,mBAAmB,CAAC;AAI3B;qEACqE;AACrE,MAAM,MAAM,eAAe,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,CAAC;AAE1D,MAAM,MAAM,cAAc,GACtB;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,OAAO,CAAC;IAAC,SAAS,EAAE,SAAS,MAAM,EAAE,CAAA;CAAE,GAC3D;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,OAAO,CAAC;IAAC,SAAS,EAAE,SAAS,MAAM,EAAE,CAAA;CAAE,GAC3D;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,OAAO,CAAA;CAAE,CAAC;AAElC;wEACwE;AACxE,eAAO,MAAM,aAAa,EAAE,SAAS,cAAc,E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C,EAAE,SAAS,CAAC;IACb,8DAA8D;IAC9D,MAAM,EAAE,CAAC,OAAO,EAAE,aAAa,KAAK,IAAI,CAAC;IACzC;;;sCAGkC;IAClC,QAAQ,CAAC,EAAE,aAAa,CAAC;IACzB;wEACoE;IACpE,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;2EAC2E;AAC3E,wBAAgB,uBAAuB,CAAC,EACtC,OAAO,EACP,CAAC,EACD,MAAM,EACN,QAAmB,EACnB,OAAyC,GAC1C,EAAE,4BAA4B,kDA8B9B;AAID,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,YAAY,CAAC;IACrB,CAAC,EAAE,SAAS,CAAC;CACd;AA8BD,wBAAgB,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,EAAE,oBAAoB,2CAqBlE"}
@@ -0,0 +1,19 @@
1
+ /** Who a concept may be disclosed to. `clinician` is implicit on every row. */
2
+ export type DisclosureAudience = 'clinician' | 'patient' | 'external';
3
+ export interface DisclosureRule {
4
+ /** Stable concept id — never a UI label, never a data-model field path. */
5
+ id: string;
6
+ /** Where the concept is captured or rendered. */
7
+ surface: 'intake' | 'compile' | 'evolution' | 'readOnly' | 'export';
8
+ /** Audiences allowed to see it. Always includes 'clinician'. */
9
+ audiences: readonly DisclosureAudience[];
10
+ /** One English sentence, for the customer sign-off walkthrough. */
11
+ rationale: string;
12
+ /** 'provisional' = our judgement, not the customer's. */
13
+ status: 'provisional' | 'signedOff';
14
+ }
15
+ export declare const DISCLOSURE_RULES: readonly DisclosureRule[];
16
+ /** The one resolver. Never inline this logic. An unknown id is NOT disclosed —
17
+ * a concept with no row is a concept nobody has thought about yet. */
18
+ export declare function disclosedTo(id: string, audience: DisclosureAudience): boolean;
19
+ //# sourceMappingURL=anamnesis-disclosure.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"anamnesis-disclosure.d.ts","sourceRoot":"","sources":["../../../src/patterns/anamnesis/anamnesis-disclosure.ts"],"names":[],"mappings":"AAmBA,+EAA+E;AAC/E,MAAM,MAAM,kBAAkB,GAAG,WAAW,GAAG,SAAS,GAAG,UAAU,CAAC;AAEtE,MAAM,WAAW,cAAc;IAC7B,2EAA2E;IAC3E,EAAE,EAAE,MAAM,CAAC;IACX,iDAAiD;IACjD,OAAO,EAAE,QAAQ,GAAG,SAAS,GAAG,WAAW,GAAG,UAAU,GAAG,QAAQ,CAAC;IACpE,gEAAgE;IAChE,SAAS,EAAE,SAAS,kBAAkB,EAAE,CAAC;IACzC,mEAAmE;IACnE,SAAS,EAAE,MAAM,CAAC;IAClB,yDAAyD;IACzD,MAAM,EAAE,aAAa,GAAG,WAAW,CAAC;CACrC;AAQD,eAAO,MAAM,gBAAgB,EAAE,SAAS,cAAc,EAiMrD,CAAC;AAMF;sEACsE;AACtE,wBAAgB,WAAW,CAAC,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,kBAAkB,GAAG,OAAO,CAI7E"}
@@ -0,0 +1,12 @@
1
+ import type { TFunction } from 'i18next';
2
+ import { type EventMark } from './anamnesis-events';
3
+ export interface AnamnesisEventBarProps {
4
+ /** Events that HAVE a position on the plot, in the order they happened.
5
+ * One with no place on it never reaches here — see `eventMarks`. */
6
+ marks: readonly EventMark[];
7
+ activeIds: ReadonlySet<string>;
8
+ onToggle: (eventId: string) => void;
9
+ t: TFunction;
10
+ }
11
+ export declare function AnamnesisEventBar({ marks, activeIds, onToggle, t, }: AnamnesisEventBarProps): import("react/jsx-runtime").JSX.Element | null;
12
+ //# sourceMappingURL=anamnesis-event-bar.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"anamnesis-event-bar.d.ts","sourceRoot":"","sources":["../../../src/patterns/anamnesis/anamnesis-event-bar.tsx"],"names":[],"mappings":"AAsCA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAGzC,OAAO,EAKL,KAAK,SAAS,EACf,MAAM,oBAAoB,CAAC;AAI5B,MAAM,WAAW,sBAAsB;IACrC;wEACoE;IACpE,KAAK,EAAE,SAAS,SAAS,EAAE,CAAC;IAC5B,SAAS,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC/B,QAAQ,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IACpC,CAAC,EAAE,SAAS,CAAC;CACd;AAID,wBAAgB,iBAAiB,CAAC,EAChC,KAAK,EACL,SAAS,EACT,QAAQ,EACR,CAAC,GACF,EAAE,sBAAsB,kDAuExB"}
@@ -0,0 +1,60 @@
1
+ import type { TFunction } from 'i18next';
2
+ import type { MarkerShape } from '../../components/annotation-marker';
3
+ import type { SparklineAnnotation, SparklineAnnotationTone } from '../../components/sparkline';
4
+ import type { ClinicalEvent, ClinicalEventCategory, Visit } from './anamnesis-types';
5
+ /**
6
+ * ONE shape per category, and that is the whole vocabulary — five distinct
7
+ * glyphs, no per-category hue.
8
+ *
9
+ * Five saturated semantic tones (error / success / accent / warning / info)
10
+ * used to ride these shapes. Three or four events picked at once put four
11
+ * competing hues across a 32px-tall sparkline, nineteen rows deep, and the
12
+ * annotations then out-shouted the trend line they exist to annotate. Shape
13
+ * is already the accessible channel here (WCAG 1.4.1, and the kit's rule in
14
+ * `src/components/annotation-marker/`), so the hue was reinforcement the
15
+ * reader was paying for in noise.
16
+ */
17
+ export declare const EVENT_SHAPE: Record<ClinicalEventCategory, MarkerShape>;
18
+ /**
19
+ * The single restrained tone every annotation wears, chip and line alike.
20
+ *
21
+ * `neutral` resolves to `--muted-foreground`, the only hueless token that
22
+ * clears WCAG 1.4.11's 3:1 for a non-text graphic in all four themes
23
+ * (measured 6.9:1 light, 7.5:1 dark, 18.4:1 / 13.9:1 accessible, against
24
+ * `--card`). Hueless is the point: the trend line is tinted by VALENCE —
25
+ * green improving, red worsening — and an annotation with a hue of its own
26
+ * competes with that read.
27
+ */
28
+ export declare const EVENT_TONE: SparklineAnnotationTone;
29
+ /** An event that HAS a place on the plot, with the fraction it sits at. */
30
+ export interface EventMark {
31
+ event: ClinicalEvent;
32
+ /** Fraction of the shared x domain: 0 = first visit, 1 = latest. */
33
+ position: number;
34
+ }
35
+ /**
36
+ * Where an event sits on the domain every row shares, or `null` when it has
37
+ * no place on the plot.
38
+ *
39
+ * `null` — rather than a clamp to 0 or 1 — for an event outside the visit
40
+ * span: the plot covers first visit → latest, and pinning an event that
41
+ * predates the record to the left edge would invent a correlation with a
42
+ * measurement taken before it happened. Also `null` below two visits (no
43
+ * extent to sit on) and on any unreadable date.
44
+ *
45
+ * `visits` is read in ARRAY ORDER, and chronological order is an UNCHECKED
46
+ * precondition: an out-of-order array can bracket the event on a span that
47
+ * runs backwards and place the marker accordingly.
48
+ */
49
+ export declare function eventPosition(event: ClinicalEvent, visits: readonly Visit[]): number | null;
50
+ /** The events that can be drawn, in the order they happened. */
51
+ export declare function eventMarks(events: readonly ClinicalEvent[] | undefined, visits: readonly Visit[]): EventMark[];
52
+ /** "Chemotherapy started · 2 Sep 2024" — what the chip says. */
53
+ export declare function eventLabel(event: ClinicalEvent, t: TFunction): string;
54
+ /** Rides the chip as its accessible description: what kind of thing this was,
55
+ * and — when it was not this practice's own decision — who recorded it. */
56
+ export declare function eventDetail(event: ClinicalEvent, t: TFunction): string;
57
+ /** The picked events as sparkline annotations. Every row of the grid is given
58
+ * this SAME array, which is what pins one event to one x down the column. */
59
+ export declare function eventAnnotations(marks: readonly EventMark[], activeIds: ReadonlySet<string>, t: TFunction): SparklineAnnotation[];
60
+ //# sourceMappingURL=anamnesis-events.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"anamnesis-events.d.ts","sourceRoot":"","sources":["../../../src/patterns/anamnesis/anamnesis-events.ts"],"names":[],"mappings":"AA8BA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AACtE,OAAO,KAAK,EACV,mBAAmB,EACnB,uBAAuB,EACxB,MAAM,4BAA4B,CAAC;AAGpC,OAAO,KAAK,EACV,aAAa,EACb,qBAAqB,EACrB,KAAK,EACN,MAAM,mBAAmB,CAAC;AAI3B;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,WAAW,EAAE,MAAM,CAAC,qBAAqB,EAAE,WAAW,CAMlE,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,UAAU,EAAE,uBAAmC,CAAC;AAE7D,2EAA2E;AAC3E,MAAM,WAAW,SAAS;IACxB,KAAK,EAAE,aAAa,CAAC;IACrB,oEAAoE;IACpE,QAAQ,EAAE,MAAM,CAAC;CAClB;AAID;;;;;;;;;;;;;GAaG;AACH,wBAAgB,aAAa,CAC3B,KAAK,EAAE,aAAa,EACpB,MAAM,EAAE,SAAS,KAAK,EAAE,GACvB,MAAM,GAAG,IAAI,CAmBf;AAED,gEAAgE;AAChE,wBAAgB,UAAU,CACxB,MAAM,EAAE,SAAS,aAAa,EAAE,GAAG,SAAS,EAC5C,MAAM,EAAE,SAAS,KAAK,EAAE,GACvB,SAAS,EAAE,CAOb;AAID,gEAAgE;AAChE,wBAAgB,UAAU,CAAC,KAAK,EAAE,aAAa,EAAE,CAAC,EAAE,SAAS,GAAG,MAAM,CAKrE;AAED;2EAC2E;AAC3E,wBAAgB,WAAW,CAAC,KAAK,EAAE,aAAa,EAAE,CAAC,EAAE,SAAS,GAAG,MAAM,CAOtE;AAED;6EAC6E;AAC7E,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,SAAS,SAAS,EAAE,EAC3B,SAAS,EAAE,WAAW,CAAC,MAAM,CAAC,EAC9B,CAAC,EAAE,SAAS,GACX,mBAAmB,EAAE,CAUvB"}
@@ -0,0 +1,48 @@
1
+ import type { TFunction } from 'i18next';
2
+ import type { SparklineAnnotation } from '../../components/sparkline';
3
+ import { type VisitColumn } from './anamnesis-window';
4
+ import type { AnamnesisRecord, NumericParameterDef, OpenAnamnesisNote, Visit } from './anamnesis-types';
5
+ export interface AnamnesisEvolutionGridProps {
6
+ record: AnamnesisRecord;
7
+ defs: NumericParameterDef[];
8
+ t: TFunction;
9
+ /** Make the newest visit column editable (compile mode). */
10
+ editable?: boolean;
11
+ onCellChange?: (visit: Visit, def: NumericParameterDef, value: number | null) => void;
12
+ /** Compare mode: the visit ids under comparison (two or more) + the CELLS
13
+ * that differ from the compared column before them, keyed
14
+ * `<visitId>:<parameterKey>`. Per cell, never per parameter: at three or
15
+ * more compared visits a column equal to its predecessor did not change. */
16
+ compare?: {
17
+ visitIds: ReadonlySet<string>;
18
+ changedCells: ReadonlySet<string>;
19
+ } | null;
20
+ /** Draw the outer border + surface (standalone use). Set `false` when the
21
+ * grid already sits inside a card, to avoid a box-in-a-box. */
22
+ framed?: boolean;
23
+ /** Mount this visit's note popover already open. Demo/story hook only —
24
+ * Chromatic skips play functions, so a click-opened popover is never
25
+ * snapshotted. Ignored once `onOpenNote` is wired. */
26
+ defaultOpenNoteVisitId?: string;
27
+ /** Route a visit's note to the host's side panel instead of opening it in
28
+ * place. Omitted = read in place, which is all a standalone grid can do. */
29
+ onOpenNote?: OpenAnamnesisNote;
30
+ /** Which columns render, from the visit window. Omitted = every visit.
31
+ * Column order and `index` always follow `record.visits`; the window
32
+ * changes what is SHOWN, never what was computed. */
33
+ visitColumns?: readonly VisitColumn[];
34
+ /** Keys the practice still captures. A key outside this set renders its
35
+ * history read-only: archiving stops capture, it never erases the record.
36
+ * Omitted = every def is capturable. */
37
+ capturableKeys?: ReadonlySet<string>;
38
+ /** Event reference lines, positioned as a fraction of the record's visit
39
+ * span. Every row gets this SAME array, which is what makes one event one
40
+ * vertical line down the whole grid rather than one line per row. */
41
+ annotations?: readonly SparklineAnnotation[];
42
+ /** Make those lines pointer-selectable — pressing one is pressing the
43
+ * event's chip in the bar above. Omitted = the lines stay decorative, which
44
+ * is all a grid with no event bar above it can honestly offer. */
45
+ onSelectAnnotation?: (eventId: string) => void;
46
+ }
47
+ export declare function AnamnesisEvolutionGrid({ record, defs, t, editable, onCellChange, compare, framed, defaultOpenNoteVisitId, onOpenNote, visitColumns, capturableKeys, annotations, onSelectAnnotation, }: AnamnesisEvolutionGridProps): import("react/jsx-runtime").JSX.Element;
48
+ //# sourceMappingURL=anamnesis-evolution-grid.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"anamnesis-evolution-grid.d.ts","sourceRoot":"","sources":["../../../src/patterns/anamnesis/anamnesis-evolution-grid.tsx"],"names":[],"mappings":"AA6BA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAGzC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAsBtE,OAAO,EAAmB,KAAK,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACvE,OAAO,KAAK,EACV,eAAe,EACf,mBAAmB,EACnB,iBAAiB,EACjB,KAAK,EACN,MAAM,mBAAmB,CAAC;AA0C3B,MAAM,WAAW,2BAA2B;IAC1C,MAAM,EAAE,eAAe,CAAC;IACxB,IAAI,EAAE,mBAAmB,EAAE,CAAC;IAC5B,CAAC,EAAE,SAAS,CAAC;IACb,4DAA4D;IAC5D,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,YAAY,CAAC,EAAE,CACb,KAAK,EAAE,KAAK,EACZ,GAAG,EAAE,mBAAmB,EACxB,KAAK,EAAE,MAAM,GAAG,IAAI,KACjB,IAAI,CAAC;IACV;;;gFAG4E;IAC5E,OAAO,CAAC,EAAE;QACR,QAAQ,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;QAC9B,YAAY,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;KACnC,GAAG,IAAI,CAAC;IACT;mEAC+D;IAC/D,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;0DAEsD;IACtD,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC;gFAC4E;IAC5E,UAAU,CAAC,EAAE,iBAAiB,CAAC;IAC/B;;yDAEqD;IACrD,YAAY,CAAC,EAAE,SAAS,WAAW,EAAE,CAAC;IACtC;;4CAEwC;IACxC,cAAc,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IACrC;;yEAEqE;IACrE,WAAW,CAAC,EAAE,SAAS,mBAAmB,EAAE,CAAC;IAC7C;;sEAEkE;IAClE,kBAAkB,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CAChD;AAID,wBAAgB,sBAAsB,CAAC,EACrC,MAAM,EACN,IAAI,EACJ,CAAC,EACD,QAAgB,EAChB,YAAY,EACZ,OAAc,EACd,MAAa,EACb,sBAAsB,EACtB,UAAU,EACV,YAAY,EACZ,cAAc,EACd,WAAW,EACX,kBAAkB,GACnB,EAAE,2BAA2B,2CAwL7B"}
@@ -0,0 +1,37 @@
1
+ import type { TFunction } from 'i18next';
2
+ import { type PracticeAnamnesisConfig } from './anamnesis-config';
3
+ import type { AnamnesisRecord, NumericParameterDef, OpenAnamnesisNote, Visit } from './anamnesis-types';
4
+ export interface AnamnesisEvolutionProps {
5
+ record: AnamnesisRecord;
6
+ t: TFunction;
7
+ editable?: boolean;
8
+ onCellChange?: (visit: Visit, def: NumericParameterDef, value: number | null) => void;
9
+ /** Draw the grid's own border/surface. `false` when this sits inside a card. */
10
+ framed?: boolean;
11
+ /** The practice's configured vocabulary. Omitted = the kit-seeded default. */
12
+ config?: PracticeAnamnesisConfig;
13
+ /** Mount with the compare panel already open. Demo/story hook only —
14
+ * Chromatic skips play functions, so a click-opened panel is never
15
+ * snapshotted. */
16
+ defaultCompareOpen?: boolean;
17
+ /** Mount with this visit selection instead of first + latest. Demo/story
18
+ * hook only, for the same Chromatic reason. */
19
+ defaultVisitIds?: readonly string[];
20
+ /** Mount the compare panel on this set of visits instead of first + latest.
21
+ * Demo/story hook only, for the same Chromatic reason. */
22
+ defaultCompareVisitIds?: readonly string[];
23
+ /** Mount with these events already drawn. Demo/story hook only — the
24
+ * arrival state picks none, and Chromatic skips play functions. */
25
+ defaultEventIds?: readonly string[];
26
+ /** The picker's live selection, whenever it changes (and once on mount).
27
+ * The Diagnosis surface's one export control needs to know which visit
28
+ * columns are on screen — the file must be the view that was asked for. */
29
+ onVisitSelectionChange?: (visitIds: readonly string[]) => void;
30
+ /** The host's side panel. Wired ⇒ a visit's note trigger routes there
31
+ * instead of opening a popover, and turning an event chip on navigates the
32
+ * panel to that event. Omitted ⇒ the note opens in place and the chip only
33
+ * draws its line, which is all a standalone surface can do. */
34
+ onOpenNote?: OpenAnamnesisNote;
35
+ }
36
+ export declare function AnamnesisEvolution({ record, t, editable, onCellChange, framed, config, defaultCompareOpen, defaultVisitIds, defaultCompareVisitIds, defaultEventIds, onVisitSelectionChange, onOpenNote, }: AnamnesisEvolutionProps): import("react/jsx-runtime").JSX.Element;
37
+ //# sourceMappingURL=anamnesis-evolution.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"anamnesis-evolution.d.ts","sourceRoot":"","sources":["../../../src/patterns/anamnesis/anamnesis-evolution.tsx"],"names":[],"mappings":"AAyBA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAQzC,OAAO,EAIL,KAAK,uBAAuB,EAC7B,MAAM,oBAAoB,CAAC;AAY5B,OAAO,KAAK,EACV,eAAe,EACf,mBAAmB,EACnB,iBAAiB,EACjB,KAAK,EACN,MAAM,mBAAmB,CAAC;AAI3B,MAAM,WAAW,uBAAuB;IACtC,MAAM,EAAE,eAAe,CAAC;IACxB,CAAC,EAAE,SAAS,CAAC;IACb,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,YAAY,CAAC,EAAE,CACb,KAAK,EAAE,KAAK,EACZ,GAAG,EAAE,mBAAmB,EACxB,KAAK,EAAE,MAAM,GAAG,IAAI,KACjB,IAAI,CAAC;IACV,gFAAgF;IAChF,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,8EAA8E;IAC9E,MAAM,CAAC,EAAE,uBAAuB,CAAC;IACjC;;sBAEkB;IAClB,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B;mDAC+C;IAC/C,eAAe,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACpC;8DAC0D;IAC1D,sBAAsB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC3C;uEACmE;IACnE,eAAe,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACpC;;+EAE2E;IAC3E,sBAAsB,CAAC,EAAE,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,KAAK,IAAI,CAAC;IAC/D;;;mEAG+D;IAC/D,UAAU,CAAC,EAAE,iBAAiB,CAAC;CAChC;AAID,wBAAgB,kBAAkB,CAAC,EACjC,MAAM,EACN,CAAC,EACD,QAAgB,EAChB,YAAY,EACZ,MAAa,EACb,MAAM,EACN,kBAA0B,EAC1B,eAAe,EACf,sBAAsB,EACtB,eAAe,EACf,sBAAsB,EACtB,UAAU,GACX,EAAE,uBAAuB,2CAmXzB"}
@@ -0,0 +1,10 @@
1
+ import { type CsvDialect, type ExportDocument } from './anamnesis-export';
2
+ /** Hand a Blob to the browser as a download. Returns `false` where there is no
3
+ * DOM to hand it to (SSR, a node test), so callers can fall back rather than
4
+ * throw. */
5
+ export declare function downloadBlob(blob: Blob, filename: string): boolean;
6
+ /** Download the document as a `.csv` in the dialect its locale calls for. */
7
+ export declare function downloadCsv(doc: ExportDocument, dialect?: CsvDialect): boolean;
8
+ /** Download the document as an `.xlsx`. Async: exceljs is dynamic-imported. */
9
+ export declare function downloadXlsx(doc: ExportDocument): Promise<boolean>;
10
+ //# sourceMappingURL=anamnesis-export-download.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"anamnesis-export-download.d.ts","sourceRoot":"","sources":["../../../src/patterns/anamnesis/anamnesis-export-download.ts"],"names":[],"mappings":"AAUA,OAAO,EACL,KAAK,UAAU,EAEf,KAAK,cAAc,EAIpB,MAAM,oBAAoB,CAAC;AAE5B;;YAEY;AACZ,wBAAgB,YAAY,CAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAqBlE;AAED,6EAA6E;AAC7E,wBAAgB,WAAW,CACzB,GAAG,EAAE,cAAc,EACnB,OAAO,GAAE,UAAsC,GAC9C,OAAO,CAET;AAED,+EAA+E;AAC/E,wBAAsB,YAAY,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,OAAO,CAAC,CAExE"}
@@ -0,0 +1,23 @@
1
+ import type { TFunction } from 'i18next';
2
+ import type { PracticeAnamnesisConfig } from './anamnesis-config';
3
+ import type { DisclosureAudience } from './anamnesis-disclosure';
4
+ import { type AnamnesisExportTab } from './anamnesis-export';
5
+ import type { AnamnesisRecord } from './anamnesis-types';
6
+ export interface AnamnesisExportMenuProps {
7
+ /** The tab the surface is showing. The control acts on THIS view. */
8
+ tab: AnamnesisExportTab;
9
+ record: AnamnesisRecord;
10
+ t: TFunction;
11
+ config?: PracticeAnamnesisConfig;
12
+ /** Evolution only: the visit columns the grid is currently showing. */
13
+ shownVisitIds?: readonly string[];
14
+ /** Mount with the menu open. Demo/story hook only — Chromatic skips play
15
+ * functions, so a click-opened menu is never snapshotted. */
16
+ defaultOpen?: boolean;
17
+ /** Mount with the share preview open. Demo/story hook, same reason. */
18
+ defaultShareOpen?: boolean;
19
+ /** Mount on this audience instead of the practice copy. Demo/story hook. */
20
+ defaultAudience?: DisclosureAudience;
21
+ }
22
+ export declare function AnamnesisExportMenu({ tab, record, t, config, shownVisitIds, defaultOpen, defaultShareOpen, defaultAudience, }: AnamnesisExportMenuProps): import("react/jsx-runtime").JSX.Element;
23
+ //# sourceMappingURL=anamnesis-export-menu.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"anamnesis-export-menu.d.ts","sourceRoot":"","sources":["../../../src/patterns/anamnesis/anamnesis-export-menu.tsx"],"names":[],"mappings":"AAuBA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAuBzC,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAClE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,EACL,KAAK,kBAAkB,EAIxB,MAAM,oBAAoB,CAAC;AAG5B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AASzD,MAAM,WAAW,wBAAwB;IACvC,qEAAqE;IACrE,GAAG,EAAE,kBAAkB,CAAC;IACxB,MAAM,EAAE,eAAe,CAAC;IACxB,CAAC,EAAE,SAAS,CAAC;IACb,MAAM,CAAC,EAAE,uBAAuB,CAAC;IACjC,uEAAuE;IACvE,aAAa,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAClC;iEAC6D;IAC7D,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,uEAAuE;IACvE,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,4EAA4E;IAC5E,eAAe,CAAC,EAAE,kBAAkB,CAAC;CACtC;AAED,wBAAgB,mBAAmB,CAAC,EAClC,GAAG,EACH,MAAM,EACN,CAAC,EACD,MAAM,EACN,aAAa,EACb,WAAmB,EACnB,gBAAwB,EACxB,eAA6B,GAC9B,EAAE,wBAAwB,2CA+U1B"}
@@ -0,0 +1,36 @@
1
+ import { type ExportDocument } from './anamnesis-export';
2
+ export declare const PDF_MIME = "application/pdf";
3
+ export type PdfRgb = [number, number, number];
4
+ export interface PdfPalette {
5
+ headerFill: PdfRgb;
6
+ headerText: PdfRgb;
7
+ bodyText: PdfRgb;
8
+ mutedText: PdfRgb;
9
+ zebraFill: PdfRgb;
10
+ sectionFill: PdfRgb;
11
+ }
12
+ /** The document palette for the theme `scope` is rendered in. Pass the pattern
13
+ * root; omit it and the fallback greys are used. */
14
+ export declare function pdfPalette(scope?: Element | null): PdfPalette;
15
+ /** True when jsPDF can draw `text` with a built-in face — i.e. it will not be
16
+ * silently re-encoded as UTF-16. */
17
+ export declare function isWinAnsiSafe(text: string): boolean;
18
+ /** Respell the symbols a standard-14 face cannot draw. Applied at the writer
19
+ * boundary, so the arrow survives on screen and in the spreadsheet. */
20
+ export declare function pdfSafeText(text: string): string;
21
+ export interface PdfOptions {
22
+ palette?: PdfPalette;
23
+ /** Set the PDF's own open action so the viewer raises the print dialog.
24
+ * This is what the Print item uses; a downloaded PDF leaves it off. */
25
+ autoPrint?: boolean;
26
+ }
27
+ /** The document as a paged PDF. jspdf + jspdf-autotable are dynamic-imported,
28
+ * so neither ships to a consumer who never exports. */
29
+ export declare function toPdfBlob(document: ExportDocument, options?: PdfOptions): Promise<Blob>;
30
+ /** Download the document as a `.pdf`. */
31
+ export declare function downloadPdf(document: ExportDocument, options?: PdfOptions): Promise<boolean>;
32
+ /** Point an off-screen frame at the document with the print action armed, and
33
+ * hand the object URL back so the caller can revoke it. `null` means there was
34
+ * no frame or no `URL.createObjectURL` to build one with. */
35
+ export declare function printPdf(document: ExportDocument, frame: HTMLIFrameElement | null, options?: PdfOptions): Promise<string | null>;
36
+ //# sourceMappingURL=anamnesis-export-pdf.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"anamnesis-export-pdf.d.ts","sourceRoot":"","sources":["../../../src/patterns/anamnesis/anamnesis-export-pdf.ts"],"names":[],"mappings":"AAoBA,OAAO,EACL,KAAK,cAAc,EAKpB,MAAM,oBAAoB,CAAC;AAG5B,eAAO,MAAM,QAAQ,oBAAoB,CAAC;AAI1C,MAAM,MAAM,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;AAE9C,MAAM,WAAW,UAAU;IACzB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;CACrB;AAqDD;oDACoD;AACpD,wBAAgB,UAAU,CAAC,KAAK,CAAC,EAAE,OAAO,GAAG,IAAI,GAAG,UAAU,CAiB7D;AA8CD;oCACoC;AACpC,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAUnD;AAED;uEACuE;AACvE,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAMhD;AAmED,MAAM,WAAW,UAAU;IACzB,OAAO,CAAC,EAAE,UAAU,CAAC;IACrB;2EACuE;IACvE,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED;uDACuD;AACvD,wBAAsB,SAAS,CAC7B,QAAQ,EAAE,cAAc,EACxB,OAAO,GAAE,UAAe,GACvB,OAAO,CAAC,IAAI,CAAC,CA2Jf;AAID,yCAAyC;AACzC,wBAAsB,WAAW,CAC/B,QAAQ,EAAE,cAAc,EACxB,OAAO,GAAE,UAAe,GACvB,OAAO,CAAC,OAAO,CAAC,CAKlB;AAED;;6DAE6D;AAC7D,wBAAsB,QAAQ,CAC5B,QAAQ,EAAE,cAAc,EACxB,KAAK,EAAE,iBAAiB,GAAG,IAAI,EAC/B,OAAO,GAAE,UAAe,GACvB,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAQxB"}
@@ -0,0 +1,143 @@
1
+ import type { TFunction } from 'i18next';
2
+ import { type PracticeAnamnesisConfig } from './anamnesis-config';
3
+ import { type DisclosureAudience } from './anamnesis-disclosure';
4
+ import type { AnamnesisRecord, NumericParameterDef } from './anamnesis-types';
5
+ /** A cell. `null` is ABSENT and every writer renders it as an empty cell —
6
+ * never the em dash the screen uses, which a spreadsheet cannot compute on. */
7
+ export type ExportValue = string | number | null;
8
+ export interface ExportColumn {
9
+ /** Stable key — the Excel column key, never rendered. */
10
+ key: string;
11
+ /** Translated header text. */
12
+ header: string;
13
+ /** Numbers land in this column: right-aligned and number-formatted. */
14
+ numeric?: boolean;
15
+ /** Decimal places for numeric cells, when the whole column shares one. */
16
+ precision?: number;
17
+ }
18
+ export interface ExportRow {
19
+ /** `section` is a group banner: cell 0 carries the label, the rest is blank. */
20
+ kind?: 'data' | 'section';
21
+ /** Aligned to `columns` by index; short rows are padded by the writer. */
22
+ cells: ExportValue[];
23
+ /** Decimal places for THIS row's numeric cells — a parameter row carries its
24
+ * own precision, and the column cannot know it. Wins over the column. */
25
+ precision?: number;
26
+ }
27
+ export interface ExportTable {
28
+ /** Stable id — the worksheet key and the PDF anchor. */
29
+ id: string;
30
+ title: string;
31
+ columns: ExportColumn[];
32
+ rows: ExportRow[];
33
+ /** Rendered in place of the rows when there are none. */
34
+ emptyText?: string;
35
+ }
36
+ export interface ExportMetaEntry {
37
+ label: string;
38
+ value: string;
39
+ }
40
+ /** Which tab was exported. */
41
+ export type AnamnesisExportTab = 'summary' | 'compile' | 'evolution';
42
+ export interface ExportDocument {
43
+ tab: AnamnesisExportTab;
44
+ audience: DisclosureAudience;
45
+ /** Filename without an extension — see `exportFileName`. */
46
+ fileStem: string;
47
+ title: string;
48
+ /** Who the copy names, or `null` when identity is not disclosed to this
49
+ * audience. Lifted out of `meta` so a writer can stamp every page with it. */
50
+ patientName: string | null;
51
+ /** The audience, translated — the "Copy for" value, in one place. */
52
+ audienceLabel: string;
53
+ meta: ExportMetaEntry[];
54
+ tables: ExportTable[];
55
+ /** Translated notes rendered under the tables. */
56
+ footnotes: string[];
57
+ /** Disclosure concept IDS held back from this document. Metadata for the UI
58
+ * and the tests — writers never print it, because an id is not a value. */
59
+ withheld: string[];
60
+ /** App locale, resolved from `t`. Drives the CSV dialect. */
61
+ locale?: string;
62
+ }
63
+ export interface AnamnesisExportOptions {
64
+ record: AnamnesisRecord;
65
+ /** Who the file is for. Filters every table through `disclosedTo`. */
66
+ audience: DisclosureAudience;
67
+ t: TFunction;
68
+ config?: PracticeAnamnesisConfig;
69
+ /** Generation instant. Defaults to now — pass one to keep a test stable. */
70
+ generatedAtIso?: string;
71
+ }
72
+ /** `selected` exports the columns the picker is showing; `all` exports every
73
+ * visit. Defaults to `selected`: exporting thirteen visits from a screen
74
+ * showing three is a different document from the one that was asked for. */
75
+ export type EvolutionExportScope = 'selected' | 'all';
76
+ export interface EvolutionExportOptions extends AnamnesisExportOptions {
77
+ /** The picker's current selection. Omitted = the picker's own default
78
+ * (first visit + latest), never "everything". */
79
+ selectedVisitIds?: Iterable<string>;
80
+ scope?: EvolutionExportScope;
81
+ }
82
+ /** A parameter's disclosure concept, from its DISPLAY group — not from
83
+ * `parameterStorage`, which routes a practice-added anthropometric through the
84
+ * `labs` array and would classify it as a lab value. */
85
+ export declare function parameterConcept(def: NumericParameterDef): string;
86
+ /** The Summary tab: the patient's own questionnaire, one row per answered
87
+ * question, grouped by section, with who authored each answer. */
88
+ export declare function buildSummaryExport(options: AnamnesisExportOptions): ExportDocument;
89
+ /** The Compile tab: the visit being recorded, block by block, in the order the
90
+ * form presents them. Each block is gated on its own disclosure concept. */
91
+ export declare function buildCompileExport(options: AnamnesisExportOptions): ExportDocument;
92
+ /** The Evolution tab: parameters as rows, the SHOWN visits as columns, plus
93
+ * target, window change and which visits fell out of range. */
94
+ export declare function buildEvolutionExport(options: EvolutionExportOptions): ExportDocument;
95
+ /** One entry point for a tab id — the UI stage switches on the active tab. */
96
+ export declare function buildAnamnesisExport(tab: AnamnesisExportTab, options: EvolutionExportOptions): ExportDocument;
97
+ /** A withheld concept's translated name. The id carries dots and i18next reads
98
+ * a dot as a level, so the key flattens them — `lab.values` reads
99
+ * `anamnesis.export.concept.lab_values`. An id with no key falls back to the
100
+ * id rather than to a blank, so a rule nobody has named still shows up. */
101
+ export declare function conceptLabel(conceptId: string, t: TFunction): string;
102
+ export interface DocumentDisclosure {
103
+ /** Table titles the document actually carries, in document order. */
104
+ included: string[];
105
+ /** Translated names of the concepts held back, alphabetical. */
106
+ excluded: string[];
107
+ }
108
+ /** What this document gives the audience and what it holds back — the share
109
+ * dialog's whole content, and the menu's exclusion line. Reads the built
110
+ * document rather than re-deriving the rules, so the preview cannot disagree
111
+ * with the file. */
112
+ export declare function documentDisclosure(document: ExportDocument, t: TFunction): DocumentDisclosure;
113
+ export declare const CSV_MIME = "text/csv;charset=utf-8";
114
+ export declare const XLSX_MIME = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
115
+ export interface CsvDialect {
116
+ /** Field separator. `;` wherever the decimal mark is a comma. */
117
+ delimiter: ',' | ';';
118
+ decimal: '.' | ',';
119
+ eol: string;
120
+ /** Emit a UTF-8 BOM so Excel detects the encoding instead of guessing. */
121
+ bom: boolean;
122
+ }
123
+ /** The CSV convention Excel expects for a locale. Italian (and every other
124
+ * decimal-comma locale) gets `;` + `,`; English gets `,` + `.`. A locale whose
125
+ * decimal mark is neither — Arabic's `٫` — takes the point convention, because
126
+ * the numbers written here are Latin digits either way. */
127
+ export declare function csvDialectFor(locale?: string): CsvDialect;
128
+ /** One cell, escaped. Exported for the tests that pin the escaping rules. */
129
+ export declare function csvCell(value: ExportValue, dialect: CsvDialect, precision?: number): string;
130
+ /** The document as one CSV. Tables run in order, each behind its own title
131
+ * row and separated by a blank line — the report shape every spreadsheet
132
+ * reader already understands. */
133
+ export declare function toCsv(document: ExportDocument, dialect?: CsvDialect): string;
134
+ export declare function toCsvBlob(document: ExportDocument, dialect?: CsvDialect): Blob;
135
+ /** The document as an `.xlsx` — the info block on its own sheet, then one
136
+ * sheet per table. No colour: the kit's tokens are CSS custom properties that
137
+ * only resolve against a live DOM, and this module has none. Weight and
138
+ * freeze-panes carry the hierarchy instead. */
139
+ export declare function toXlsxBlob(document: ExportDocument): Promise<Blob>;
140
+ export type ExportFormat = 'csv' | 'xlsx' | 'pdf';
141
+ /** Deterministic, meaningful, and free of anything a filesystem rejects. */
142
+ export declare function exportFileName(document: ExportDocument, format: ExportFormat): string;
143
+ //# sourceMappingURL=anamnesis-export.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"anamnesis-export.d.ts","sourceRoot":"","sources":["../../../src/patterns/anamnesis/anamnesis-export.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,EAIL,KAAK,uBAAuB,EAE7B,MAAM,oBA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BAAgB,cAAc,CAC5B,QAAQ,EAAE,cAAc,EACxB,MAAM,EAAE,YAAY,GACnB,MAAM,CAER"}
@@ -0,0 +1,14 @@
1
+ import type { TFunction } from 'i18next';
2
+ import type { AnswerOrigin, IntakeAnswer, IntakeFieldDef } from './anamnesis-types';
3
+ export interface AnamnesisFieldProps {
4
+ def: IntakeFieldDef;
5
+ answer?: IntakeAnswer;
6
+ onChange: (answer: IntakeAnswer) => void;
7
+ /** Show the "from patient" marker when the value still carries patient origin
8
+ * (compile mode). Intake mode leaves this off — the patient owns the form. */
9
+ showOrigin?: boolean;
10
+ origin?: AnswerOrigin;
11
+ t: TFunction;
12
+ }
13
+ export declare function AnamnesisField({ def, answer, onChange, showOrigin, origin, t, }: AnamnesisFieldProps): import("react/jsx-runtime").JSX.Element;
14
+ //# sourceMappingURL=anamnesis-field.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"anamnesis-field.d.ts","sourceRoot":"","sources":["../../../src/patterns/anamnesis/anamnesis-field.tsx"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAYzC,OAAO,KAAK,EACV,YAAY,EACZ,YAAY,EACZ,cAAc,EAEf,MAAM,mBAAmB,CAAC;AAqB3B,MAAM,WAAW,mBAAmB;IAClC,GAAG,EAAE,cAAc,CAAC;IACpB,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB,QAAQ,EAAE,CAAC,MAAM,EAAE,YAAY,KAAK,IAAI,CAAC;IACzC;kFAC8E;IAC9E,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB,CAAC,EAAE,SAAS,CAAC;CACd;AAID,wBAAgB,cAAc,CAAC,EAC7B,GAAG,EACH,MAAM,EACN,QAAQ,EACR,UAAkB,EAClB,MAAM,EACN,CAAC,GACF,EAAE,mBAAmB,2CA8QrB"}
@@ -0,0 +1,67 @@
1
+ import type { TFunction } from 'i18next';
2
+ import type { AnamnesisRecord, IntakeAnswer, IntakeFieldDef, IntakeSectionDef, NumericParameterDef, PathologyCode, PatientSex, Visit } from './anamnesis-types';
3
+ /** Only show a field when it is relevant to the patient's recorded sex.
4
+ * Single definition — this previously existed three times (intake, compile,
5
+ * read-only) and drifting copies are a correctness risk, not just noise. */
6
+ export declare function fieldVisible(def: IntakeFieldDef, sex: PatientSex): boolean;
7
+ /** The locale a `t` is fixed to. Both `useTranslation()` and a locale-pinned
8
+ * `getFixedT(lng, ns)` set it, so this is the app language on every surface. */
9
+ export declare function localeOf(t: TFunction): string | undefined;
10
+ /** Every stored date rendered outside a JSX `<Timestamp>`. Pins UTC AND the
11
+ * app locale, so one visit cannot render two ways on one screen. */
12
+ export declare function visitDateLabel(iso: string, t: TFunction): string;
13
+ /** A stored `YYYY-MM-DD` as a LOCAL calendar date. `new Date(iso)` would parse
14
+ * it as UTC midnight and render the previous day west of Greenwich — the
15
+ * off-by-one this pattern has already had to fix once. */
16
+ export declare function parseCalendarDate(iso: string): Date | undefined;
17
+ /** A local calendar date back to `YYYY-MM-DD`. `toISOString()` would convert to
18
+ * UTC first and can land on the wrong day; these are the local components. */
19
+ export declare function toCalendarIso(date: Date): string;
20
+ /** One visit as an option label. The ordinal disambiguates two visits recorded
21
+ * on the same calendar day, which would otherwise read identically.
22
+ *
23
+ * `hasNote` marks a visit whose note is only readable once that visit is a
24
+ * column — without it the picker gives the reader no reason to pick it, and
25
+ * the note is unreachable in practice rather than one tick away. */
26
+ export declare function visitOptionLabel(visit: Visit, index: number, t: TFunction, hasNote?: boolean): string;
27
+ /** Age at an EXPLICIT reference instant. An unreadable date of birth or
28
+ * reference date renders the em dash — the same absence marker every other
29
+ * unknown uses, and never the "NaN years" the raw subtraction used to print.
30
+ * Surfaces call `patientAgeLabel`; this stays for a caller that genuinely has
31
+ * its own reference date. */
32
+ export declare function ageLabel(dateOfBirthIso: string, referenceIso: string, t: TFunction): string;
33
+ /** The patient header's age line, on every surface. Takes the RECORD rather
34
+ * than a date, so no call site can pick its own reference visit — picking one
35
+ * per surface is exactly how intake and compile came to print two different
36
+ * ages for the same patient. A record with no visit has no age to state. */
37
+ export declare function patientAgeLabel(record: AnamnesisRecord, t: TFunction): string;
38
+ /** Numeric parameter label — practice wording, else `anamnesis.param.<key>`. */
39
+ export declare function parameterLabel(def: NumericParameterDef, t: TFunction): string;
40
+ /** Parameter label with its unit appended, as the form fields render it. Unit
41
+ * symbols (kg, mg/dL) are locale-invariant scientific notation. */
42
+ export declare function parameterLabelWithUnit(def: NumericParameterDef, t: TFunction): string;
43
+ /** Intake field label — practice wording, else `anamnesis.field.<key>.label`. */
44
+ export declare function intakeFieldLabel(def: IntakeFieldDef, t: TFunction): string;
45
+ /** Optional help text under an intake field. Practice help text wins; the kit
46
+ * key is optional and resolves to `undefined` when unset. */
47
+ export declare function intakeFieldHelp(def: IntakeFieldDef, t: TFunction): string | undefined;
48
+ /** Section heading — practice wording, else `anamnesis.section.<key>`. */
49
+ export declare function sectionLabel(section: IntakeSectionDef, t: TFunction): string;
50
+ /** Pathology description. The code itself is never translated; the entry may
51
+ * be absent from the taxonomy entirely, in which case the code stands alone.
52
+ * `pathologyLabelKey` sanitises the dot — i18next reads `.` as a separator, so
53
+ * `E66.0` must never be concatenated into a key by hand. */
54
+ export declare function pathologyLabel(code: string, t: TFunction, entry?: PathologyCode): string;
55
+ /** `E66.0 — Obesity due to excess calories`, the form the pickers and badges
56
+ * render. Falls back to the bare code when nothing describes it. */
57
+ export declare function pathologyCodeWithLabel(code: string, t: TFunction, entry?: PathologyCode): string;
58
+ /** Whether an answer carries a real response. Shared by the progress meter,
59
+ * the digest and the mandatory-answer check, so all three agree. "Not sure"
60
+ * counts as UNANSWERED — provisional, pending the customer's own rule. Zero is
61
+ * a value: every numeric branch is `!= null`, never a truthiness test. */
62
+ export declare function isIntakeAnswered(answer: IntakeAnswer | undefined): boolean;
63
+ /** One intake answer as a read-only string. Absent values render an em dash —
64
+ * never "undefined", never a bare hyphen. Zero is a value: every check here is
65
+ * `!= null`, never a truthiness test on a number. */
66
+ export declare function formatIntakeAnswer(answer: IntakeAnswer, def: IntakeFieldDef, t: TFunction): string;
67
+ //# sourceMappingURL=anamnesis-format.d.ts.map