@alfadocs/ui-kit 1.32.0 → 1.34.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.
- package/dist/_chunks/{appointment-card-D-oj_ugh.js → appointment-card-D6mk39NB.js} +3 -3
- package/dist/_chunks/{appointment-timeline-CymGHyIP.js → appointment-timeline-D-V97Bhc.js} +2 -2
- package/dist/_chunks/{appointment-tray-DCk8gHod.js → appointment-tray-6rg071CL.js} +2 -2
- package/dist/_chunks/{booking-l6UGNiE1.js → booking-BqkEtsKx.js} +777 -747
- package/dist/_chunks/{calendar-workspace-BX-zDyVR.js → calendar-workspace-4NH1Z47_.js} +7 -7
- package/dist/_chunks/{clinical-note-card-D2WTV2CO.js → clinical-note-card-CTRzmqvv.js} +83 -81
- package/dist/_chunks/{contact-profile-card-BZqi8Hck.js → contact-profile-card-DSI9uumA.js} +17 -16
- package/dist/_chunks/{control-room-rail-iO_BCaq1.js → control-room-rail-5MbhjsxN.js} +2 -2
- package/dist/_chunks/format-price-BkMEbeW3.js +47 -0
- package/dist/_chunks/{format-price-DNqXPa_q.js → languages-CZqBaPwI.js} +8 -38
- package/dist/_chunks/money.agent-Dw55UxUA.js +116 -0
- package/dist/_chunks/notes-panel-BjLt-kiP.js +469 -0
- package/dist/_chunks/{practice-results-DjEzPgAK.js → practice-results-kayDEorM.js} +15 -14
- package/dist/_chunks/{rich-text-editor-CQ7yZdG3.js → rich-text-editor-CCI-Y3DN.js} +3 -5
- package/dist/_chunks/{task-card-BUgK6yZT.js → task-card-BalrLkSz.js} +41 -40
- package/dist/_chunks/{task-tray-CYG6rj2s.js → task-tray-COo-RlDv.js} +2 -2
- package/dist/_chunks/tasks-panel-DLKpSNoE.js +844 -0
- package/dist/_chunks/tool-rail-ONaV-Nzz.js +588 -0
- package/dist/_chunks/use-check-animation--I3cS00X.js +28 -0
- package/dist/_chunks/use-list-reflow-Cw43nxw5.js +100 -0
- package/dist/agent-catalog.json +15 -1
- package/dist/components/_shared/format-price.d.ts +15 -0
- package/dist/components/appointment-card/index.js +2 -2
- package/dist/components/appointment-timeline/index.js +1 -1
- package/dist/components/booking/index.js +1 -1
- package/dist/components/clinical-note-card/clinical-note-card.d.ts +8 -1
- package/dist/components/clinical-note-card/index.js +1 -1
- package/dist/components/command-palette/command-palette.d.ts +7 -7
- package/dist/components/contact-profile-card/index.js +1 -1
- package/dist/components/control-room-rail/index.js +1 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/components/money/index.d.ts +4 -0
- package/dist/components/money/index.js +6 -0
- package/dist/components/money/money.agent.d.ts +3 -0
- package/dist/components/money/money.d.ts +38 -0
- package/dist/components/notes-panel/index.js +1 -1
- package/dist/components/notes-panel/notes-panel.d.ts +16 -1
- package/dist/components/practice-results/index.js +1 -1
- package/dist/components/rich-text-editor/index.js +1 -1
- package/dist/components/rich-text-editor/rich-text-editor.d.ts +1 -1
- package/dist/components/task-card/index.js +1 -1
- package/dist/components/task-card/task-card.d.ts +11 -3
- package/dist/components/task-tray/index.js +1 -1
- package/dist/components/tasks-panel/index.js +1 -1
- package/dist/components/tasks-panel/tasks-panel.d.ts +1 -1
- package/dist/components/tool-rail/index.js +1 -1
- package/dist/hooks/index.d.ts +3 -0
- package/dist/hooks/index.js +43 -37
- package/dist/hooks/use-check-animation.d.ts +53 -0
- package/dist/hooks/use-exit-transition.d.ts +48 -0
- package/dist/hooks/use-list-reflow.d.ts +47 -0
- package/dist/host-compat.css +8 -2
- package/dist/i18n/locales/ar.d.ts +5 -0
- package/dist/i18n/locales/ar.js +6 -1
- package/dist/i18n/locales/de.d.ts +5 -0
- package/dist/i18n/locales/de.js +6 -1
- package/dist/i18n/locales/el.d.ts +5 -0
- package/dist/i18n/locales/el.js +6 -1
- package/dist/i18n/locales/en.d.ts +5 -0
- package/dist/i18n/locales/en.js +6 -1
- package/dist/i18n/locales/es.d.ts +5 -0
- package/dist/i18n/locales/es.js +6 -1
- package/dist/i18n/locales/fr.d.ts +5 -0
- package/dist/i18n/locales/fr.js +6 -1
- package/dist/i18n/locales/hi.d.ts +5 -0
- package/dist/i18n/locales/hi.js +6 -1
- package/dist/i18n/locales/it.d.ts +5 -0
- package/dist/i18n/locales/it.js +6 -1
- package/dist/i18n/locales/ja.d.ts +5 -0
- package/dist/i18n/locales/ja.js +6 -1
- package/dist/i18n/locales/nl.d.ts +5 -0
- package/dist/i18n/locales/nl.js +6 -1
- package/dist/i18n/locales/pl.d.ts +5 -0
- package/dist/i18n/locales/pl.js +6 -1
- package/dist/i18n/locales/pt.d.ts +5 -0
- package/dist/i18n/locales/pt.js +6 -1
- package/dist/i18n/locales/ro.d.ts +5 -0
- package/dist/i18n/locales/ro.js +6 -1
- package/dist/i18n/locales/ru.d.ts +5 -0
- package/dist/i18n/locales/ru.js +6 -1
- package/dist/i18n/locales/sq.d.ts +5 -0
- package/dist/i18n/locales/sq.js +6 -1
- package/dist/i18n/locales/sv.d.ts +5 -0
- package/dist/i18n/locales/sv.js +6 -1
- package/dist/i18n/locales/tr.d.ts +5 -0
- package/dist/i18n/locales/tr.js +6 -1
- package/dist/i18n/locales/zh.d.ts +5 -0
- package/dist/i18n/locales/zh.js +6 -1
- package/dist/index.js +919 -916
- package/dist/locales/ar.json +6 -1
- package/dist/locales/de.json +6 -1
- package/dist/locales/el.json +6 -1
- package/dist/locales/en.json +6 -1
- package/dist/locales/es.json +6 -1
- package/dist/locales/fr.json +6 -1
- package/dist/locales/hi.json +6 -1
- package/dist/locales/it.json +6 -1
- package/dist/locales/ja.json +6 -1
- package/dist/locales/nl.json +6 -1
- package/dist/locales/pl.json +6 -1
- package/dist/locales/pt.json +6 -1
- package/dist/locales/ro.json +6 -1
- package/dist/locales/ru.json +6 -1
- package/dist/locales/sq.json +6 -1
- package/dist/locales/sv.json +6 -1
- package/dist/locales/tr.json +6 -1
- package/dist/locales/zh.json +6 -1
- package/dist/patterns/calendar/index.js +1 -1
- package/dist/tokens.css +2 -1
- package/package.json +5 -1
- package/dist/_chunks/notes-panel-C4G-mhZ9.js +0 -380
- package/dist/_chunks/tasks-panel-DQuaVvl5.js +0 -757
- package/dist/_chunks/tool-rail-8Scslq3X.js +0 -524
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { jsxs as V, jsx as p } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as z, useMemo as N } from "react";
|
|
3
|
+
import { c as Z } from "./index-D2ZczOXr.js";
|
|
4
|
+
import { useTranslation as $ } from "react-i18next";
|
|
5
|
+
import { V as H } from "./visually-hidden-BHxEUGyT.js";
|
|
6
|
+
import { f as O, a as R } from "./format-price-BkMEbeW3.js";
|
|
7
|
+
const T = Z(
|
|
8
|
+
[
|
|
9
|
+
"ds:inline-flex ds:items-baseline ds:whitespace-nowrap",
|
|
10
|
+
// Lining, fixed-width figures: without these a column of amounts
|
|
11
|
+
// wanders because glyph widths differ between digits.
|
|
12
|
+
"ds:tabular-nums"
|
|
13
|
+
].join(" "),
|
|
14
|
+
{
|
|
15
|
+
variants: {
|
|
16
|
+
size: {
|
|
17
|
+
sm: "type-body-sm",
|
|
18
|
+
md: "type-body",
|
|
19
|
+
lg: "type-title-item"
|
|
20
|
+
},
|
|
21
|
+
tone: {
|
|
22
|
+
default: "ds:text-[color:var(--foreground)]",
|
|
23
|
+
muted: "ds:text-[color:var(--muted-foreground)]",
|
|
24
|
+
positive: "ds:text-[color:var(--success-foreground)]",
|
|
25
|
+
negative: "ds:text-[color:var(--destructive)]"
|
|
26
|
+
},
|
|
27
|
+
strikethrough: {
|
|
28
|
+
true: "ds:line-through ds:decoration-from-font",
|
|
29
|
+
false: ""
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
defaultVariants: { size: "md", tone: "default", strikethrough: !1 }
|
|
33
|
+
}
|
|
34
|
+
), U = z(
|
|
35
|
+
({
|
|
36
|
+
value: o,
|
|
37
|
+
currency: s = "EUR",
|
|
38
|
+
locale: y,
|
|
39
|
+
size: v,
|
|
40
|
+
tone: l = "default",
|
|
41
|
+
decimals: n = "full",
|
|
42
|
+
signDisplay: m = "auto",
|
|
43
|
+
strikethrough: x,
|
|
44
|
+
className: g,
|
|
45
|
+
...h
|
|
46
|
+
}, k) => {
|
|
47
|
+
const { i18n: M } = $(), r = y ?? M.language, { nodes: b, full: j } = N(() => {
|
|
48
|
+
const e = O(
|
|
49
|
+
o,
|
|
50
|
+
s,
|
|
51
|
+
r,
|
|
52
|
+
m === "always" ? { signDisplay: "exceptZero" } : {}
|
|
53
|
+
), u = R(o, s, r);
|
|
54
|
+
if (!e)
|
|
55
|
+
return { nodes: [{ text: u, muted: !1 }], full: u };
|
|
56
|
+
const i = e.map((t) => t.value).join(""), P = e.filter((t) => t.type === "fraction").every((t) => /^0+$/.test(t.value)), f = (t) => t === "decimal" || t === "fraction";
|
|
57
|
+
if (n === "hideWhenZero" && P) {
|
|
58
|
+
const c = e.filter((d) => !f(d.type)).map((d) => d.value).join("").trim();
|
|
59
|
+
return { nodes: [{ text: c, muted: !1 }], full: c };
|
|
60
|
+
}
|
|
61
|
+
return n === "muted" ? {
|
|
62
|
+
nodes: e.map((t) => ({
|
|
63
|
+
text: t.value,
|
|
64
|
+
muted: f(t.type)
|
|
65
|
+
})),
|
|
66
|
+
full: i
|
|
67
|
+
} : { nodes: [{ text: i, muted: !1 }], full: i };
|
|
68
|
+
}, [o, s, r, n, m]), w = l === "auto" ? o < 0 ? "negative" : "default" : l;
|
|
69
|
+
return /* @__PURE__ */ V(
|
|
70
|
+
"span",
|
|
71
|
+
{
|
|
72
|
+
ref: k,
|
|
73
|
+
"data-component": "money",
|
|
74
|
+
"data-currency": s.toUpperCase(),
|
|
75
|
+
className: T({
|
|
76
|
+
size: v,
|
|
77
|
+
tone: w,
|
|
78
|
+
strikethrough: x,
|
|
79
|
+
className: g
|
|
80
|
+
}),
|
|
81
|
+
...h,
|
|
82
|
+
children: [
|
|
83
|
+
b.map((a, e) => /* @__PURE__ */ p(
|
|
84
|
+
"span",
|
|
85
|
+
{
|
|
86
|
+
"aria-hidden": "true",
|
|
87
|
+
className: a.muted ? "ds:opacity-70 ds:[font-size:0.85em]" : void 0,
|
|
88
|
+
children: a.text
|
|
89
|
+
},
|
|
90
|
+
`${e}-${a.text}`
|
|
91
|
+
)),
|
|
92
|
+
/* @__PURE__ */ p(H, { children: j })
|
|
93
|
+
]
|
|
94
|
+
}
|
|
95
|
+
);
|
|
96
|
+
}
|
|
97
|
+
);
|
|
98
|
+
U.displayName = "Money";
|
|
99
|
+
const W = {
|
|
100
|
+
id: "money",
|
|
101
|
+
capabilities: [],
|
|
102
|
+
state: {},
|
|
103
|
+
actions: {},
|
|
104
|
+
domHooks: {
|
|
105
|
+
root: {
|
|
106
|
+
attr: "data-component",
|
|
107
|
+
value: "money",
|
|
108
|
+
description: "Marks the element as a kit Money amount."
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
};
|
|
112
|
+
export {
|
|
113
|
+
U as M,
|
|
114
|
+
W as m
|
|
115
|
+
};
|
|
116
|
+
//# sourceMappingURL=money.agent-Dw55UxUA.js.map
|
|
@@ -0,0 +1,469 @@
|
|
|
1
|
+
import { jsxs as l, jsx as t, Fragment as Ie } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as Ee, useRef as c, useState as P, useId as ze, useCallback as O, useEffect as Se, useImperativeHandle as He, useMemo as Le } from "react";
|
|
3
|
+
import { c as _e } from "./index-D2ZczOXr.js";
|
|
4
|
+
import { useTranslation as Be } from "react-i18next";
|
|
5
|
+
import { u as qe } from "./registry-DvAUVLHh.js";
|
|
6
|
+
import { C as Ke } from "./clinical-note-card-CTRzmqvv.js";
|
|
7
|
+
import { R as Me } from "./rich-text-editor-CCI-Y3DN.js";
|
|
8
|
+
import { T as We } from "./text-area-Bt3p7Pt0.js";
|
|
9
|
+
import { A as C } from "./alert-CiJT540z.js";
|
|
10
|
+
import { B as A } from "./button-nJaPh_HC.js";
|
|
11
|
+
import { I as Fe } from "./icon-button-DA2CAGHZ.js";
|
|
12
|
+
import { C as Oe } from "./checkbox-BuZ1u__2.js";
|
|
13
|
+
import { S as De } from "./spinner-hbwuKwMf.js";
|
|
14
|
+
import { D as f } from "./dialog-BJiLqhx6.js";
|
|
15
|
+
import { P as Ge } from "./panel-header-D313n_9-.js";
|
|
16
|
+
import { a as Ye, u as Je, R as Qe } from "./use-list-reflow-Cw43nxw5.js";
|
|
17
|
+
import { u as Ue } from "./use-theme-CAuo6EYT.js";
|
|
18
|
+
import { N as Xe } from "./notebook-pen-CO7HoM-W.js";
|
|
19
|
+
import { T as Ze } from "./trash-2-uumy3fy1.js";
|
|
20
|
+
function ie(i, s) {
|
|
21
|
+
return typeof i == "object" && i !== null && "message" in i && typeof i.message == "string" && i.message.trim() ? i.message : s;
|
|
22
|
+
}
|
|
23
|
+
const $e = {
|
|
24
|
+
id: "notes-panel",
|
|
25
|
+
// 'submit' backs add_note (compose + commit a note). pin / flag are toggles
|
|
26
|
+
// with no dedicated capability in the closed vocabulary.
|
|
27
|
+
capabilities: ["submit"],
|
|
28
|
+
state: {
|
|
29
|
+
notes: {
|
|
30
|
+
type: "Array<{ id?: string; pinned: boolean; flagged: boolean; clinical: boolean }>",
|
|
31
|
+
descriptionKey: "ui.agent.notesPanel.state.notes",
|
|
32
|
+
description: "Timeline note ids + pinned / flagged / clinical flags. Never the note body or author (both PHI).",
|
|
33
|
+
read: (i) => i.getNotes()
|
|
34
|
+
},
|
|
35
|
+
canAddClinical: {
|
|
36
|
+
type: "boolean",
|
|
37
|
+
descriptionKey: "ui.agent.notesPanel.state.canAddClinical",
|
|
38
|
+
description: "Whether the current user may write clinical notes (the practice_add_clinical_note permission gate).",
|
|
39
|
+
read: (i) => i.canAddClinical()
|
|
40
|
+
},
|
|
41
|
+
currentNoteId: {
|
|
42
|
+
type: "string | null",
|
|
43
|
+
descriptionKey: "ui.agent.notesPanel.state.currentNoteId",
|
|
44
|
+
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.",
|
|
45
|
+
read: (i) => i.getCurrentNoteId()
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
actions: {
|
|
49
|
+
add_note: {
|
|
50
|
+
// Writes a clinical/admin note body — patient-identifiable content. PHI.
|
|
51
|
+
safety: "phi",
|
|
52
|
+
argsType: "{ content: string; clinical: boolean }",
|
|
53
|
+
argsSchema: {
|
|
54
|
+
type: "object",
|
|
55
|
+
properties: {
|
|
56
|
+
content: {
|
|
57
|
+
type: "string",
|
|
58
|
+
description: "Note body. Rich HTML for the rich composer, else plain text."
|
|
59
|
+
},
|
|
60
|
+
clinical: {
|
|
61
|
+
type: "boolean",
|
|
62
|
+
description: "Whether the note is clinical. Requires the clinical-note permission; the submission is dropped when the gate is closed."
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
required: ["content", "clinical"]
|
|
66
|
+
},
|
|
67
|
+
openWorld: !0,
|
|
68
|
+
descriptionKey: "ui.agent.notesPanel.actions.addNote",
|
|
69
|
+
description: "Compose and commit a new note. A clinical note requires the clinical-note permission (read canAddClinical first).",
|
|
70
|
+
examples: [
|
|
71
|
+
{
|
|
72
|
+
args: { content: "Patient reported improvement.", clinical: !0 },
|
|
73
|
+
note: "Add a clinical note."
|
|
74
|
+
}
|
|
75
|
+
],
|
|
76
|
+
invoke: (i, s) => i.addNote(s)
|
|
77
|
+
},
|
|
78
|
+
toggle_pin: {
|
|
79
|
+
// Re-orders the timeline (pinned notes lead) — reversible view write.
|
|
80
|
+
safety: "write",
|
|
81
|
+
argsType: "{ id: string }",
|
|
82
|
+
argsSchema: {
|
|
83
|
+
type: "object",
|
|
84
|
+
properties: { id: { type: "string" } },
|
|
85
|
+
required: ["id"]
|
|
86
|
+
},
|
|
87
|
+
idempotent: !1,
|
|
88
|
+
descriptionKey: "ui.agent.notesPanel.actions.togglePin",
|
|
89
|
+
description: "Toggle the pinned state of the note with the given id. Refused for a deleted note or one whose actions.pin is false.",
|
|
90
|
+
invoke: (i, s) => {
|
|
91
|
+
i.togglePin(s.id);
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
toggle_flag: {
|
|
95
|
+
safety: "write",
|
|
96
|
+
argsType: "{ id: string }",
|
|
97
|
+
argsSchema: {
|
|
98
|
+
type: "object",
|
|
99
|
+
properties: { id: { type: "string" } },
|
|
100
|
+
required: ["id"]
|
|
101
|
+
},
|
|
102
|
+
idempotent: !1,
|
|
103
|
+
descriptionKey: "ui.agent.notesPanel.actions.toggleFlag",
|
|
104
|
+
description: "Toggle the flagged state of the note with the given id.",
|
|
105
|
+
invoke: (i, s) => {
|
|
106
|
+
i.toggleFlag(s.id);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
domHooks: {
|
|
111
|
+
root: {
|
|
112
|
+
attr: "data-component",
|
|
113
|
+
value: "notes-panel",
|
|
114
|
+
description: "Marks the NotesPanel region."
|
|
115
|
+
},
|
|
116
|
+
instanceId: {
|
|
117
|
+
attr: "data-component-id",
|
|
118
|
+
sourceProp: "id",
|
|
119
|
+
description: "Sourced from the id prop. Required to address a specific notes panel from the agent."
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}, en = _e(
|
|
123
|
+
"ds:flex ds:flex-col ds:rounded-[var(--radius-md)] ds:border-s-2 ds:ps-[var(--spacing-sm)]",
|
|
124
|
+
{
|
|
125
|
+
variants: {
|
|
126
|
+
current: {
|
|
127
|
+
true: "ds:border-[color:var(--info)] ds:bg-[color:var(--info)]/10 ds:focus:outline-[length:var(--focus-ring-width)] ds:focus:outline-solid ds:focus:outline-[color:var(--ring)] ds:focus:outline-offset-[length:var(--focus-ring-offset)]",
|
|
128
|
+
false: "ds:border-transparent"
|
|
129
|
+
}
|
|
130
|
+
},
|
|
131
|
+
defaultVariants: { current: !1 }
|
|
132
|
+
}
|
|
133
|
+
), nn = "ds:opacity-0", tn = [
|
|
134
|
+
"ds:transition-opacity ds:duration-[var(--animation-duration)]",
|
|
135
|
+
"ds:ease-[var(--ease-out)] ds:motion-reduce:transition-none"
|
|
136
|
+
].join(" ");
|
|
137
|
+
function re(i) {
|
|
138
|
+
return i ? /<img\b/i.test(i) ? !0 : i.replace(/<[^>]*>/g, "").replace(/ /gi, " ").trim().length > 0 : !1;
|
|
139
|
+
}
|
|
140
|
+
const Rn = Ee(
|
|
141
|
+
function({
|
|
142
|
+
id: s,
|
|
143
|
+
notes: I,
|
|
144
|
+
onAddNote: m,
|
|
145
|
+
status: E = "ready",
|
|
146
|
+
onRetry: D,
|
|
147
|
+
currentNoteId: g,
|
|
148
|
+
currentNoteKey: ae,
|
|
149
|
+
composer: x = "rich",
|
|
150
|
+
editorToolbar: se = "standard",
|
|
151
|
+
redactor: oe,
|
|
152
|
+
imageUploadUrl: le,
|
|
153
|
+
showClinicalToggle: G = !0,
|
|
154
|
+
canAddClinicalNote: R = !0,
|
|
155
|
+
clinicalGatedReason: de,
|
|
156
|
+
defaultClinical: z = !1,
|
|
157
|
+
onRequestAiDraft: ce,
|
|
158
|
+
aiDraftFormat: ue,
|
|
159
|
+
aiPrivacyNotice: fe,
|
|
160
|
+
onDictate: pe,
|
|
161
|
+
onProofread: me,
|
|
162
|
+
onAutoFormat: ge,
|
|
163
|
+
onTogglePin: w,
|
|
164
|
+
onToggleFlag: k,
|
|
165
|
+
noteActions: Y,
|
|
166
|
+
onDeleteNote: u,
|
|
167
|
+
confirmDelete: S = !0,
|
|
168
|
+
title: he,
|
|
169
|
+
composerPlaceholder: ve,
|
|
170
|
+
addNoteLabel: ye,
|
|
171
|
+
emptyState: be,
|
|
172
|
+
className: Pe,
|
|
173
|
+
"aria-label": H,
|
|
174
|
+
...Ce
|
|
175
|
+
}, xe) {
|
|
176
|
+
const { t: r } = Be(), L = c(null), [h, _] = P(""), [B, J] = P(z), [v, Q] = P(!1), [U, q] = P(null), Re = he ?? r("notesPanel.title", { defaultValue: "Notes" }), X = ze(), Z = ve ?? r("notesPanel.placeholder", { defaultValue: "Add a note…" }), $ = r("notesPanel.composerLabel", {
|
|
177
|
+
defaultValue: "New note"
|
|
178
|
+
}), we = x === "rich" ? re(h) : h.trim().length > 0, ke = O(() => {
|
|
179
|
+
var o;
|
|
180
|
+
if (!m || v) return;
|
|
181
|
+
const e = x === "rich", n = e ? ((o = L.current) == null ? void 0 : o.getHTML()) ?? h : h.trim();
|
|
182
|
+
if (e ? !re(n) : !n) return;
|
|
183
|
+
const p = () => {
|
|
184
|
+
var d;
|
|
185
|
+
e && ((d = L.current) == null || d.clear()), _(""), J(z);
|
|
186
|
+
};
|
|
187
|
+
q(null);
|
|
188
|
+
let a;
|
|
189
|
+
try {
|
|
190
|
+
a = m({ content: n, clinical: B });
|
|
191
|
+
} catch (d) {
|
|
192
|
+
q(ie(d, r("notesPanel.addFailed")));
|
|
193
|
+
return;
|
|
194
|
+
}
|
|
195
|
+
if (!a || typeof a.then != "function") return p();
|
|
196
|
+
Q(!0), Promise.resolve(a).then(
|
|
197
|
+
p,
|
|
198
|
+
(d) => q(ie(d, r("notesPanel.addFailed")))
|
|
199
|
+
).finally(() => Q(!1));
|
|
200
|
+
}, [x, h, B, z, m, v, r]), K = [...I].sort(
|
|
201
|
+
(e, n) => Number(n.pinned ?? !1) - Number(e.pinned ?? !1)
|
|
202
|
+
), { resolvedTheme: Ne } = Ue(), ee = Ne.endsWith("-accessible") || void 0, { containerRef: Ve } = Ye({
|
|
203
|
+
key: K.map((e) => e.id).join(),
|
|
204
|
+
reduceMotion: ee
|
|
205
|
+
}), y = Je({ reduceMotion: ee }), [N, V] = P(null), Te = O(
|
|
206
|
+
(e) => {
|
|
207
|
+
u && (S ? V(e) : y.leave(e, () => u(e)));
|
|
208
|
+
},
|
|
209
|
+
[S, y, u]
|
|
210
|
+
), je = O(() => {
|
|
211
|
+
if (!N || !u) return;
|
|
212
|
+
const e = N;
|
|
213
|
+
V(null), y.leave(e, () => u(e));
|
|
214
|
+
}, [N, u, y]), M = c(null);
|
|
215
|
+
Se(() => {
|
|
216
|
+
var e, n;
|
|
217
|
+
g && ((e = M.current) == null || e.scrollIntoView({ block: "center" }), (n = M.current) == null || n.focus());
|
|
218
|
+
}, [g, ae]);
|
|
219
|
+
const W = c(I);
|
|
220
|
+
W.current = I;
|
|
221
|
+
const b = c(m);
|
|
222
|
+
b.current = m;
|
|
223
|
+
const T = c(w);
|
|
224
|
+
T.current = w;
|
|
225
|
+
const j = c(k);
|
|
226
|
+
j.current = k;
|
|
227
|
+
const F = c(R);
|
|
228
|
+
F.current = R;
|
|
229
|
+
const ne = c(g);
|
|
230
|
+
ne.current = g;
|
|
231
|
+
const te = c(null);
|
|
232
|
+
He(xe, () => te.current, []);
|
|
233
|
+
const Ae = Le(
|
|
234
|
+
() => ({
|
|
235
|
+
// Ids + flags only — never the note body or author (both PHI).
|
|
236
|
+
getNotes: () => W.current.map((e) => ({
|
|
237
|
+
id: e.id,
|
|
238
|
+
pinned: !!e.pinned,
|
|
239
|
+
flagged: !!e.flagged,
|
|
240
|
+
clinical: !!e.clinical
|
|
241
|
+
})),
|
|
242
|
+
canAddNote: () => !!b.current,
|
|
243
|
+
canAddClinical: () => F.current,
|
|
244
|
+
getCurrentNoteId: () => ne.current ?? null,
|
|
245
|
+
addNote: (e) => {
|
|
246
|
+
var n;
|
|
247
|
+
if (!(e.clinical && !F.current))
|
|
248
|
+
return (n = b.current) == null ? void 0 : n.call(b, e);
|
|
249
|
+
},
|
|
250
|
+
togglePin: (e) => {
|
|
251
|
+
var p, a;
|
|
252
|
+
const n = W.current.find((o) => o.id === e);
|
|
253
|
+
n && (n.deleted || ((p = n.actions) == null ? void 0 : p.pin) === !1) || (a = T.current) == null || a.call(T, e);
|
|
254
|
+
},
|
|
255
|
+
toggleFlag: (e) => {
|
|
256
|
+
var n;
|
|
257
|
+
return (n = j.current) == null ? void 0 : n.call(j, e);
|
|
258
|
+
}
|
|
259
|
+
}),
|
|
260
|
+
[]
|
|
261
|
+
);
|
|
262
|
+
return qe($e, Ae, s), /* @__PURE__ */ l(
|
|
263
|
+
"section",
|
|
264
|
+
{
|
|
265
|
+
ref: te,
|
|
266
|
+
"data-component": "notes-panel",
|
|
267
|
+
"data-component-id": s,
|
|
268
|
+
"aria-labelledby": H ? void 0 : X,
|
|
269
|
+
"aria-label": H,
|
|
270
|
+
className: ["ds:flex ds:flex-col", Pe].filter(Boolean).join(" "),
|
|
271
|
+
...Ce,
|
|
272
|
+
children: [
|
|
273
|
+
/* @__PURE__ */ t(
|
|
274
|
+
Ge,
|
|
275
|
+
{
|
|
276
|
+
title: Re,
|
|
277
|
+
icon: /* @__PURE__ */ t(Xe, { "aria-hidden": "true" }),
|
|
278
|
+
headingId: H ? void 0 : X,
|
|
279
|
+
sticky: !0,
|
|
280
|
+
divider: !0
|
|
281
|
+
}
|
|
282
|
+
),
|
|
283
|
+
/* @__PURE__ */ l("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)] ds:p-[var(--spacing-md)]", children: [
|
|
284
|
+
m ? /* @__PURE__ */ l("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", children: [
|
|
285
|
+
x === "rich" ? /* @__PURE__ */ t(
|
|
286
|
+
Me,
|
|
287
|
+
{
|
|
288
|
+
ref: L,
|
|
289
|
+
ariaLabel: $,
|
|
290
|
+
placeholder: Z,
|
|
291
|
+
toolbar: se,
|
|
292
|
+
minHeight: "fill",
|
|
293
|
+
redactor: oe,
|
|
294
|
+
imageUploadUrl: le,
|
|
295
|
+
readOnly: v,
|
|
296
|
+
onChange: ({ html: e }) => _(e),
|
|
297
|
+
onRequestAiDraft: ce,
|
|
298
|
+
aiDraftFormat: ue,
|
|
299
|
+
aiPrivacyNotice: fe,
|
|
300
|
+
onDictate: pe,
|
|
301
|
+
onProofread: me,
|
|
302
|
+
onAutoFormat: ge
|
|
303
|
+
}
|
|
304
|
+
) : /* @__PURE__ */ t(
|
|
305
|
+
We,
|
|
306
|
+
{
|
|
307
|
+
value: h,
|
|
308
|
+
readOnly: v,
|
|
309
|
+
onChange: (e) => _(e.target.value),
|
|
310
|
+
placeholder: Z,
|
|
311
|
+
autoResize: !0,
|
|
312
|
+
minRows: 2,
|
|
313
|
+
maxRows: 6,
|
|
314
|
+
"aria-label": $
|
|
315
|
+
}
|
|
316
|
+
),
|
|
317
|
+
/* @__PURE__ */ l(
|
|
318
|
+
"div",
|
|
319
|
+
{
|
|
320
|
+
className: [
|
|
321
|
+
"ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-sm)]",
|
|
322
|
+
G ? "ds:justify-between" : "ds:justify-end"
|
|
323
|
+
].join(" "),
|
|
324
|
+
children: [
|
|
325
|
+
G ? /* @__PURE__ */ t(
|
|
326
|
+
Oe,
|
|
327
|
+
{
|
|
328
|
+
size: "sm",
|
|
329
|
+
label: r("notesPanel.clinicalToggle", {
|
|
330
|
+
defaultValue: "Clinical note"
|
|
331
|
+
}),
|
|
332
|
+
checked: B,
|
|
333
|
+
onCheckedChange: (e) => J(e === !0),
|
|
334
|
+
disabled: v || !R,
|
|
335
|
+
disabledReason: R ? void 0 : de ?? r("notesPanel.clinicalGated", {
|
|
336
|
+
defaultValue: "You do not have permission to write clinical notes."
|
|
337
|
+
})
|
|
338
|
+
}
|
|
339
|
+
) : null,
|
|
340
|
+
/* @__PURE__ */ t(
|
|
341
|
+
A,
|
|
342
|
+
{
|
|
343
|
+
type: "button",
|
|
344
|
+
size: "sm",
|
|
345
|
+
onClick: ke,
|
|
346
|
+
disabled: !we,
|
|
347
|
+
loading: v,
|
|
348
|
+
children: ye ?? r("notesPanel.add", { defaultValue: "Add note" })
|
|
349
|
+
}
|
|
350
|
+
)
|
|
351
|
+
]
|
|
352
|
+
}
|
|
353
|
+
),
|
|
354
|
+
U ? /* @__PURE__ */ t(C, { variant: "error", children: /* @__PURE__ */ t(C.Description, { children: U }) }) : null
|
|
355
|
+
] }) : null,
|
|
356
|
+
E === "loading" ? /* @__PURE__ */ l("p", { className: "ds:m-0 ds:flex ds:items-center ds:gap-[var(--spacing-xs)] type-body-sm ds:text-[color:var(--muted-foreground)]", children: [
|
|
357
|
+
/* @__PURE__ */ t(De, { size: "sm", label: r("notesPanel.loading") }),
|
|
358
|
+
/* @__PURE__ */ t("span", { "aria-hidden": "true", children: r("notesPanel.loading") })
|
|
359
|
+
] }) : E === "error" ? /* @__PURE__ */ l(C, { variant: "error", children: [
|
|
360
|
+
/* @__PURE__ */ t(C.Description, { children: r("notesPanel.loadError") }),
|
|
361
|
+
D ? /* @__PURE__ */ t(C.Action, { children: /* @__PURE__ */ t(A, { intent: "secondary", size: "sm", onClick: D, children: r("notesPanel.retry") }) }) : null
|
|
362
|
+
] }) : null,
|
|
363
|
+
K.length > 0 ? /* @__PURE__ */ t(
|
|
364
|
+
"ul",
|
|
365
|
+
{
|
|
366
|
+
ref: Ve,
|
|
367
|
+
className: "ds:m-0 ds:flex ds:list-none ds:flex-col ds:gap-[var(--spacing-sm)] ds:p-0",
|
|
368
|
+
children: K.map(({ actions: e, ...n }, p) => {
|
|
369
|
+
const a = g != null && n.id === g, o = n.id, d = o != null && y.isLeaving(o);
|
|
370
|
+
return /* @__PURE__ */ l(
|
|
371
|
+
"li",
|
|
372
|
+
{
|
|
373
|
+
ref: a ? M : void 0,
|
|
374
|
+
tabIndex: a ? -1 : void 0,
|
|
375
|
+
"aria-current": a ? "true" : void 0,
|
|
376
|
+
"data-reflow-id": o,
|
|
377
|
+
"data-leaving": d ? "" : void 0,
|
|
378
|
+
className: [
|
|
379
|
+
en({ current: a }),
|
|
380
|
+
tn,
|
|
381
|
+
Qe,
|
|
382
|
+
d ? nn : ""
|
|
383
|
+
].filter(Boolean).join(" "),
|
|
384
|
+
children: [
|
|
385
|
+
a ? /* @__PURE__ */ t("span", { className: "ds:sr-only", children: r("notesPanel.current", {
|
|
386
|
+
defaultValue: "Current note"
|
|
387
|
+
}) }) : null,
|
|
388
|
+
/* @__PURE__ */ t(
|
|
389
|
+
Ke,
|
|
390
|
+
{
|
|
391
|
+
surface: "elevated",
|
|
392
|
+
truncate: !a,
|
|
393
|
+
headerActions: /* @__PURE__ */ l(Ie, { children: [
|
|
394
|
+
Y ? Y({ ...n, actions: e }) : null,
|
|
395
|
+
u && o && !n.deleted ? /* @__PURE__ */ t(
|
|
396
|
+
Fe,
|
|
397
|
+
{
|
|
398
|
+
icon: /* @__PURE__ */ t(Ze, {}),
|
|
399
|
+
intent: "ghost",
|
|
400
|
+
size: "sm",
|
|
401
|
+
"aria-label": r("notesPanel.delete", {
|
|
402
|
+
defaultValue: "Delete note"
|
|
403
|
+
}),
|
|
404
|
+
onClick: () => Te(o)
|
|
405
|
+
}
|
|
406
|
+
) : null
|
|
407
|
+
] }),
|
|
408
|
+
...n,
|
|
409
|
+
onTogglePin: w && n.id && (e == null ? void 0 : e.pin) !== !1 && !n.deleted ? () => w(n.id) : void 0,
|
|
410
|
+
onToggleFlag: k && n.id ? () => k(n.id) : void 0
|
|
411
|
+
}
|
|
412
|
+
)
|
|
413
|
+
]
|
|
414
|
+
},
|
|
415
|
+
n.id ?? p
|
|
416
|
+
);
|
|
417
|
+
})
|
|
418
|
+
}
|
|
419
|
+
) : E !== "ready" ? null : be ?? /* @__PURE__ */ t("p", { className: "ds:m-0 type-body-sm ds:text-[color:var(--muted-foreground)]", children: r("notesPanel.empty", { defaultValue: "No notes yet." }) })
|
|
420
|
+
] }),
|
|
421
|
+
u && S ? /* @__PURE__ */ t(
|
|
422
|
+
f,
|
|
423
|
+
{
|
|
424
|
+
open: N !== null,
|
|
425
|
+
onOpenChange: (e) => !e && V(null),
|
|
426
|
+
children: /* @__PURE__ */ l(f.Content, { variant: "alert", size: "sm", children: [
|
|
427
|
+
/* @__PURE__ */ t(f.Header, { children: /* @__PURE__ */ t(f.Title, { children: r("notesPanel.deleteConfirmTitle", {
|
|
428
|
+
defaultValue: "Delete this note?"
|
|
429
|
+
}) }) }),
|
|
430
|
+
/* @__PURE__ */ t(f.Body, { children: /* @__PURE__ */ t(f.Description, { children: r("notesPanel.deleteConfirmBody", {
|
|
431
|
+
defaultValue: "The note will be removed from the record."
|
|
432
|
+
}) }) }),
|
|
433
|
+
/* @__PURE__ */ l(f.Footer, { children: [
|
|
434
|
+
/* @__PURE__ */ t(f.Close, { asChild: !0, children: /* @__PURE__ */ t(
|
|
435
|
+
A,
|
|
436
|
+
{
|
|
437
|
+
intent: "secondary",
|
|
438
|
+
size: "sm",
|
|
439
|
+
onClick: () => V(null),
|
|
440
|
+
children: r("notesPanel.deleteConfirmCancel", {
|
|
441
|
+
defaultValue: "Cancel"
|
|
442
|
+
})
|
|
443
|
+
}
|
|
444
|
+
) }),
|
|
445
|
+
/* @__PURE__ */ t(
|
|
446
|
+
A,
|
|
447
|
+
{
|
|
448
|
+
intent: "destructive",
|
|
449
|
+
size: "sm",
|
|
450
|
+
onClick: je,
|
|
451
|
+
children: r("notesPanel.deleteConfirmAction", {
|
|
452
|
+
defaultValue: "Delete"
|
|
453
|
+
})
|
|
454
|
+
}
|
|
455
|
+
)
|
|
456
|
+
] })
|
|
457
|
+
] })
|
|
458
|
+
}
|
|
459
|
+
) : null
|
|
460
|
+
]
|
|
461
|
+
}
|
|
462
|
+
);
|
|
463
|
+
}
|
|
464
|
+
);
|
|
465
|
+
export {
|
|
466
|
+
Rn as N,
|
|
467
|
+
ie as g
|
|
468
|
+
};
|
|
469
|
+
//# sourceMappingURL=notes-panel-BjLt-kiP.js.map
|
|
@@ -14,12 +14,13 @@ import { S as rt } from "./skeleton-CZbwyJAA.js";
|
|
|
14
14
|
import { S as ot } from "./spinner-hbwuKwMf.js";
|
|
15
15
|
import { B as O } from "./badge-sTusUqZD.js";
|
|
16
16
|
import { u as ct } from "./use-media-query-CcAx5SMM.js";
|
|
17
|
-
import {
|
|
18
|
-
import { u as
|
|
19
|
-
import { c as
|
|
20
|
-
import { R as
|
|
21
|
-
import { C as
|
|
17
|
+
import { a as lt } from "./format-price-BkMEbeW3.js";
|
|
18
|
+
import { u as dt } from "./registry-DvAUVLHh.js";
|
|
19
|
+
import { c as ut } from "./createLucideIcon-DhHxpK9K.js";
|
|
20
|
+
import { R as pt } from "./refresh-cw-DnI0cLFC.js";
|
|
21
|
+
import { C as Se } from "./chevron-down-DWE7GSq9.js";
|
|
22
22
|
import { M as ne } from "./map-pin-BaY37-Km.js";
|
|
23
|
+
import { L as Pe, B as mt } from "./languages-CZqBaPwI.js";
|
|
23
24
|
import { S as Ae } from "./shield-check-DCJALLVh.js";
|
|
24
25
|
import { H as Me } from "./heart--qCA4ffe.js";
|
|
25
26
|
import { C as ft } from "./calendar-clock-hbObjfGY.js";
|
|
@@ -40,7 +41,7 @@ const gt = [
|
|
|
40
41
|
],
|
|
41
42
|
["path", { d: "M15 5.764v15", key: "1pn4in" }],
|
|
42
43
|
["path", { d: "M9 3.236v15", key: "1uimfh" }]
|
|
43
|
-
], vt =
|
|
44
|
+
], vt = ut("map", gt), bt = {
|
|
44
45
|
id: "practice-results",
|
|
45
46
|
// `scroll` backs scroll_to_result; `pick` backs focus_pin (a non-persisting
|
|
46
47
|
// pin highlight). The active variant is consumer-owned via props, so there is
|
|
@@ -367,7 +368,7 @@ function Te({
|
|
|
367
368
|
b
|
|
368
369
|
] }),
|
|
369
370
|
/* @__PURE__ */ t(
|
|
370
|
-
|
|
371
|
+
Se,
|
|
371
372
|
{
|
|
372
373
|
"aria-hidden": "true",
|
|
373
374
|
className: "ds:size-3.5 ds:shrink-0"
|
|
@@ -431,7 +432,7 @@ function ue({ value: e, onChange: n }) {
|
|
|
431
432
|
": ",
|
|
432
433
|
r(e)
|
|
433
434
|
] }),
|
|
434
|
-
/* @__PURE__ */ t(
|
|
435
|
+
/* @__PURE__ */ t(Se, { "aria-hidden": "true", className: "ds:size-3.5 ds:shrink-0" })
|
|
435
436
|
]
|
|
436
437
|
}
|
|
437
438
|
) }),
|
|
@@ -565,7 +566,7 @@ function Be({
|
|
|
565
566
|
className: "type-body-sm ds:inline-flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-xs)] ds:text-[var(--muted-foreground)]",
|
|
566
567
|
children: [
|
|
567
568
|
/* @__PURE__ */ t(
|
|
568
|
-
|
|
569
|
+
mt,
|
|
569
570
|
{
|
|
570
571
|
"aria-hidden": "true",
|
|
571
572
|
className: "ds:size-4 ds:shrink-0 ds:text-[var(--primary)]"
|
|
@@ -739,7 +740,7 @@ function _t({
|
|
|
739
740
|
O,
|
|
740
741
|
{
|
|
741
742
|
variant: "neutral",
|
|
742
|
-
leading: /* @__PURE__ */ t(
|
|
743
|
+
leading: /* @__PURE__ */ t(Pe, { "aria-hidden": "true" }),
|
|
743
744
|
children: Ie(k, x, b)
|
|
744
745
|
},
|
|
745
746
|
`lang-${k}`
|
|
@@ -877,7 +878,7 @@ function Tt({
|
|
|
877
878
|
O,
|
|
878
879
|
{
|
|
879
880
|
variant: "neutral",
|
|
880
|
-
leading: /* @__PURE__ */ t(
|
|
881
|
+
leading: /* @__PURE__ */ t(Pe, { "aria-hidden": "true" }),
|
|
881
882
|
children: Ie(w, u, o)
|
|
882
883
|
},
|
|
883
884
|
`lang-${w}`
|
|
@@ -1144,7 +1145,7 @@ function ve({ onRetry: e }) {
|
|
|
1144
1145
|
{
|
|
1145
1146
|
intent: "secondary",
|
|
1146
1147
|
size: "sm",
|
|
1147
|
-
startIcon: /* @__PURE__ */ t(
|
|
1148
|
+
startIcon: /* @__PURE__ */ t(pt, { "aria-hidden": "true" }),
|
|
1148
1149
|
onClick: e,
|
|
1149
1150
|
children: n("practiceResults.error.retry")
|
|
1150
1151
|
}
|
|
@@ -1572,7 +1573,7 @@ const Dt = nt(function({
|
|
|
1572
1573
|
}),
|
|
1573
1574
|
[n]
|
|
1574
1575
|
);
|
|
1575
|
-
at(Oe, () => re, [re]),
|
|
1576
|
+
at(Oe, () => re, [re]), dt(bt, re, H);
|
|
1576
1577
|
const Ee = G ? q ?? ae("practiceResults.card.open") : void 0, je = U ?? ae("practiceResults.card.book"), qe = D(
|
|
1577
1578
|
(v) => {
|
|
1578
1579
|
if (v.nextAvailableSlot)
|
|
@@ -1736,4 +1737,4 @@ export {
|
|
|
1736
1737
|
Dt as P,
|
|
1737
1738
|
bt as p
|
|
1738
1739
|
};
|
|
1739
|
-
//# sourceMappingURL=practice-results-
|
|
1740
|
+
//# sourceMappingURL=practice-results-kayDEorM.js.map
|