@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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alfadocs/ui-kit",
3
- "version": "1.1.0",
3
+ "version": "1.3.0",
4
4
  "type": "module",
5
5
  "description": "AlfaDocs shared design system — tokens, components, patterns, and translations for platform, booking, and alfascribe.",
6
6
  "license": "BUSL-1.1",
@@ -769,6 +769,10 @@
769
769
  "types": "./dist/patterns/alia-assistant/index.d.ts",
770
770
  "import": "./dist/patterns/alia-assistant/index.js"
771
771
  },
772
+ "./patterns/anamnesis": {
773
+ "types": "./dist/patterns/anamnesis/index.d.ts",
774
+ "import": "./dist/patterns/anamnesis/index.js"
775
+ },
772
776
  "./patterns/marketplace-app-shell": {
773
777
  "types": "./dist/patterns/marketplace-app-shell/index.d.ts",
774
778
  "import": "./dist/patterns/marketplace-app-shell/index.js"
@@ -1,324 +0,0 @@
1
- import { jsxs as y, jsx as i } from "react/jsx-runtime";
2
- import { forwardRef as ne, useRef as o, useState as V, useId as ie, useCallback as ae, useImperativeHandle as re, useMemo as se } from "react";
3
- import { useTranslation as oe } from "react-i18next";
4
- import { u as le } from "./registry-DvAUVLHh.js";
5
- import { C as ce } from "./clinical-note-card-D63x_AkK.js";
6
- import { R as de } from "./rich-text-editor-CfeXPPWs.js";
7
- import { T as pe } from "./text-area-Bt3p7Pt0.js";
8
- import { B as ue } from "./button-CPGiR_bH.js";
9
- import { C as me } from "./checkbox-BuZ1u__2.js";
10
- import { P as ge } from "./panel-header-D313n_9-.js";
11
- import { c as he } from "./createLucideIcon-DhHxpK9K.js";
12
- /**
13
- * @license lucide-react v1.22.0 - ISC
14
- *
15
- * This source code is licensed under the ISC license.
16
- * See the LICENSE file in the root directory of this source tree.
17
- */
18
- const fe = [
19
- ["path", { d: "M13.4 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-7.4", key: "re6nr2" }],
20
- ["path", { d: "M2 6h4", key: "aawbzj" }],
21
- ["path", { d: "M2 10h4", key: "l0bgd4" }],
22
- ["path", { d: "M2 14h4", key: "1gsvsf" }],
23
- ["path", { d: "M2 18h4", key: "1bu2t1" }],
24
- [
25
- "path",
26
- {
27
- d: "M21.378 5.626a1 1 0 1 0-3.004-3.004l-5.01 5.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z",
28
- key: "pqwjuv"
29
- }
30
- ]
31
- ], be = he("notebook-pen", fe), ye = {
32
- id: "notes-panel",
33
- // 'submit' backs add_note (compose + commit a note). pin / flag are toggles
34
- // with no dedicated capability in the closed vocabulary.
35
- capabilities: ["submit"],
36
- state: {
37
- notes: {
38
- type: "Array<{ id?: string; pinned: boolean; flagged: boolean; clinical: boolean }>",
39
- descriptionKey: "ui.agent.notesPanel.state.notes",
40
- description: "Timeline note ids + pinned / flagged / clinical flags. Never the note body or author (both PHI).",
41
- read: (n) => n.getNotes()
42
- },
43
- canAddClinical: {
44
- type: "boolean",
45
- descriptionKey: "ui.agent.notesPanel.state.canAddClinical",
46
- description: "Whether the current user may write clinical notes (the practice_add_clinical_note permission gate).",
47
- read: (n) => n.canAddClinical()
48
- }
49
- },
50
- actions: {
51
- add_note: {
52
- // Writes a clinical/admin note body — patient-identifiable content. PHI.
53
- safety: "phi",
54
- argsType: "{ content: string; clinical: boolean }",
55
- argsSchema: {
56
- type: "object",
57
- properties: {
58
- content: {
59
- type: "string",
60
- description: "Note body. Rich HTML for the rich composer, else plain text."
61
- },
62
- clinical: {
63
- type: "boolean",
64
- description: "Whether the note is clinical. Requires the clinical-note permission; the submission is dropped when the gate is closed."
65
- }
66
- },
67
- required: ["content", "clinical"]
68
- },
69
- openWorld: !0,
70
- descriptionKey: "ui.agent.notesPanel.actions.addNote",
71
- description: "Compose and commit a new note. A clinical note requires the clinical-note permission (read canAddClinical first).",
72
- examples: [
73
- {
74
- args: { content: "Patient reported improvement.", clinical: !0 },
75
- note: "Add a clinical note."
76
- }
77
- ],
78
- invoke: (n, a) => {
79
- n.addNote(a);
80
- }
81
- },
82
- toggle_pin: {
83
- // Re-orders the timeline (pinned notes lead) — reversible view write.
84
- safety: "write",
85
- argsType: "{ id: string }",
86
- argsSchema: {
87
- type: "object",
88
- properties: { id: { type: "string" } },
89
- required: ["id"]
90
- },
91
- idempotent: !1,
92
- descriptionKey: "ui.agent.notesPanel.actions.togglePin",
93
- description: "Toggle the pinned state of the note with the given id.",
94
- invoke: (n, a) => {
95
- n.togglePin(a.id);
96
- }
97
- },
98
- toggle_flag: {
99
- safety: "write",
100
- argsType: "{ id: string }",
101
- argsSchema: {
102
- type: "object",
103
- properties: { id: { type: "string" } },
104
- required: ["id"]
105
- },
106
- idempotent: !1,
107
- descriptionKey: "ui.agent.notesPanel.actions.toggleFlag",
108
- description: "Toggle the flagged state of the note with the given id.",
109
- invoke: (n, a) => {
110
- n.toggleFlag(a.id);
111
- }
112
- }
113
- },
114
- domHooks: {
115
- root: {
116
- attr: "data-component",
117
- value: "notes-panel",
118
- description: "Marks the NotesPanel region."
119
- },
120
- instanceId: {
121
- attr: "data-component-id",
122
- sourceProp: "id",
123
- description: "Sourced from the id prop. Required to address a specific notes panel from the agent."
124
- }
125
- }
126
- };
127
- function T(n) {
128
- return n ? /<img\b/i.test(n) ? !0 : n.replace(/<[^>]*>/g, "").replace(/&nbsp;/gi, " ").trim().length > 0 : !1;
129
- }
130
- const _e = ne(
131
- function({
132
- id: a,
133
- notes: v,
134
- onAddNote: r,
135
- composer: p = "rich",
136
- editorToolbar: z = "standard",
137
- redactor: A,
138
- imageUploadUrl: K,
139
- showClinicalToggle: w = !0,
140
- canAddClinicalNote: u = !0,
141
- clinicalGatedReason: S,
142
- defaultClinical: x = !1,
143
- onRequestAiDraft: L,
144
- aiDraftFormat: B,
145
- aiPrivacyNotice: W,
146
- onDictate: D,
147
- onProofread: E,
148
- onAutoFormat: G,
149
- onTogglePin: m,
150
- onToggleFlag: g,
151
- title: Y,
152
- composerPlaceholder: F,
153
- addNoteLabel: J,
154
- emptyState: O,
155
- className: Q,
156
- "aria-label": P,
157
- ...U
158
- }, X) {
159
- const { t: s } = oe(), k = o(null), [l, N] = V(""), [h, R] = V(x), Z = Y ?? s("notesPanel.title", { defaultValue: "Notes" }), j = ie(), M = F ?? s("notesPanel.placeholder", { defaultValue: "Add a note…" }), H = s("notesPanel.composerLabel", {
160
- defaultValue: "New note"
161
- }), $ = p === "rich" ? T(l) : l.trim().length > 0, ee = ae(() => {
162
- var e, t;
163
- if (r) {
164
- if (p === "rich") {
165
- const d = ((e = k.current) == null ? void 0 : e.getHTML()) ?? l;
166
- if (!T(d)) return;
167
- r({ content: d, clinical: h }), (t = k.current) == null || t.clear();
168
- } else {
169
- const d = l.trim();
170
- if (!d) return;
171
- r({ content: d, clinical: h });
172
- }
173
- N(""), R(x);
174
- }
175
- }, [p, l, h, x, r]), _ = [...v].sort(
176
- (e, t) => Number(t.pinned ?? !1) - Number(e.pinned ?? !1)
177
- ), q = o(v);
178
- q.current = v;
179
- const c = o(r);
180
- c.current = r;
181
- const f = o(m);
182
- f.current = m;
183
- const b = o(g);
184
- b.current = g;
185
- const C = o(u);
186
- C.current = u;
187
- const I = o(null);
188
- re(X, () => I.current, []);
189
- const te = se(
190
- () => ({
191
- // Ids + flags only — never the note body or author (both PHI).
192
- getNotes: () => q.current.map((e) => ({
193
- id: e.id,
194
- pinned: !!e.pinned,
195
- flagged: !!e.flagged,
196
- clinical: !!e.clinical
197
- })),
198
- canAddNote: () => !!c.current,
199
- canAddClinical: () => C.current,
200
- addNote: (e) => {
201
- var t;
202
- e.clinical && !C.current || (t = c.current) == null || t.call(c, e);
203
- },
204
- togglePin: (e) => {
205
- var t;
206
- return (t = f.current) == null ? void 0 : t.call(f, e);
207
- },
208
- toggleFlag: (e) => {
209
- var t;
210
- return (t = b.current) == null ? void 0 : t.call(b, e);
211
- }
212
- }),
213
- []
214
- );
215
- return le(ye, te, a), /* @__PURE__ */ y(
216
- "section",
217
- {
218
- ref: I,
219
- "data-component": "notes-panel",
220
- "data-component-id": a,
221
- "aria-labelledby": P ? void 0 : j,
222
- "aria-label": P,
223
- className: ["ds:flex ds:flex-col", Q].filter(Boolean).join(" "),
224
- ...U,
225
- children: [
226
- /* @__PURE__ */ i(
227
- ge,
228
- {
229
- title: Z,
230
- icon: /* @__PURE__ */ i(be, { "aria-hidden": "true" }),
231
- headingId: P ? void 0 : j,
232
- sticky: !0,
233
- divider: !0
234
- }
235
- ),
236
- /* @__PURE__ */ y("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)] ds:p-[var(--spacing-md)]", children: [
237
- r ? /* @__PURE__ */ y("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
238
- p === "rich" ? /* @__PURE__ */ i(
239
- de,
240
- {
241
- ref: k,
242
- ariaLabel: H,
243
- placeholder: M,
244
- toolbar: z,
245
- minHeight: "sm",
246
- redactor: A,
247
- imageUploadUrl: K,
248
- onChange: ({ html: e }) => N(e),
249
- onRequestAiDraft: L,
250
- aiDraftFormat: B,
251
- aiPrivacyNotice: W,
252
- onDictate: D,
253
- onProofread: E,
254
- onAutoFormat: G
255
- }
256
- ) : /* @__PURE__ */ i(
257
- pe,
258
- {
259
- value: l,
260
- onChange: (e) => N(e.target.value),
261
- placeholder: M,
262
- autoResize: !0,
263
- minRows: 2,
264
- maxRows: 6,
265
- "aria-label": H
266
- }
267
- ),
268
- /* @__PURE__ */ y(
269
- "div",
270
- {
271
- className: [
272
- "ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-sm)]",
273
- w ? "ds:justify-between" : "ds:justify-end"
274
- ].join(" "),
275
- children: [
276
- w ? /* @__PURE__ */ i(
277
- me,
278
- {
279
- size: "sm",
280
- label: s("notesPanel.clinicalToggle", {
281
- defaultValue: "Clinical note"
282
- }),
283
- checked: h,
284
- onCheckedChange: (e) => R(e === !0),
285
- disabled: !u,
286
- disabledReason: u ? void 0 : S ?? s("notesPanel.clinicalGated", {
287
- defaultValue: "You do not have permission to write clinical notes."
288
- })
289
- }
290
- ) : null,
291
- /* @__PURE__ */ i(
292
- ue,
293
- {
294
- type: "button",
295
- size: "sm",
296
- onClick: ee,
297
- disabled: !$,
298
- children: J ?? s("notesPanel.add", { defaultValue: "Add note" })
299
- }
300
- )
301
- ]
302
- }
303
- )
304
- ] }) : null,
305
- _.length > 0 ? /* @__PURE__ */ i("ul", { className: "ds:m-0 ds:flex ds:list-none ds:flex-col ds:gap-[var(--spacing-sm)] ds:p-0", children: _.map((e, t) => /* @__PURE__ */ i("li", { className: "ds:flex ds:flex-col", children: /* @__PURE__ */ i(
306
- ce,
307
- {
308
- surface: "elevated",
309
- truncate: !0,
310
- ...e,
311
- onTogglePin: m && e.id ? () => m(e.id) : void 0,
312
- onToggleFlag: g && e.id ? () => g(e.id) : void 0
313
- }
314
- ) }, e.id ?? t)) }) : O ?? /* @__PURE__ */ i("p", { className: "ds:m-0 type-body-sm ds:text-[color:var(--muted-foreground)]", children: s("notesPanel.empty", { defaultValue: "No notes yet." }) })
315
- ] })
316
- ]
317
- }
318
- );
319
- }
320
- );
321
- export {
322
- _e as N
323
- };
324
- //# sourceMappingURL=notes-panel-CTcOLLVo.js.map