@alfadocs/ui-kit-debug 1.36.0 → 1.37.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-peek-5S4O1VQP.js +115 -0
- package/dist/_chunks/appointment-peek-5S4O1VQP.js.map +1 -0
- package/dist/_chunks/appointment-peek.agent-C539tNFM.js +17 -0
- package/dist/_chunks/appointment-peek.agent-C539tNFM.js.map +1 -0
- package/dist/_chunks/building-2-D33bLCWL.js +24 -0
- package/dist/_chunks/building-2-D33bLCWL.js.map +1 -0
- package/dist/_chunks/calendar-workspace-BqKBj26r.js +9715 -0
- package/dist/_chunks/calendar-workspace-BqKBj26r.js.map +1 -0
- package/dist/_chunks/{control-room-rail-Ds45_g4f.js → control-room-rail-DQoHdE1U.js} +2 -2
- package/dist/_chunks/{control-room-rail-Ds45_g4f.js.map → control-room-rail-DQoHdE1U.js.map} +1 -1
- package/dist/_chunks/editable-description-BOfAeY3T.js +112 -0
- package/dist/_chunks/editable-description-BOfAeY3T.js.map +1 -0
- package/dist/_chunks/editable-description.agent-Bm_LBV2j.js +21 -0
- package/dist/_chunks/editable-description.agent-Bm_LBV2j.js.map +1 -0
- package/dist/_chunks/{money.agent-Dw55UxUA.js → money-BY-HmKhZ.js} +33 -47
- package/dist/_chunks/money-BY-HmKhZ.js.map +1 -0
- package/dist/_chunks/money.agent-BjJ6gOkx.js +17 -0
- package/dist/_chunks/money.agent-BjJ6gOkx.js.map +1 -0
- package/dist/_chunks/notes-panel-4y5JioWN.js +556 -0
- package/dist/_chunks/notes-panel-4y5JioWN.js.map +1 -0
- package/dist/_chunks/panel-subview-BNXN8OEL.js +160 -0
- package/dist/_chunks/panel-subview-BNXN8OEL.js.map +1 -0
- package/dist/_chunks/panel-subview.agent-BIBvE-IW.js +17 -0
- package/dist/_chunks/panel-subview.agent-BIBvE-IW.js.map +1 -0
- package/dist/_chunks/{patient-details-f7SSXkTJ.js → patient-details-2cIaL-Zb.js} +2 -2
- package/dist/_chunks/{patient-details-f7SSXkTJ.js.map → patient-details-2cIaL-Zb.js.map} +1 -1
- package/dist/_chunks/{patient-field-row-BQZoP4m2.js → patient-field-row-IHb2VFc2.js} +193 -172
- package/dist/_chunks/patient-field-row-IHb2VFc2.js.map +1 -0
- package/dist/_chunks/{patient-summary-card-Bz7KdUin.js → patient-summary-card-BzmJH9a-.js} +2 -2
- package/dist/_chunks/{patient-summary-card-Bz7KdUin.js.map → patient-summary-card-BzmJH9a-.js.map} +1 -1
- package/dist/_chunks/{section-card.agent-W18CHEgX.js → section-card-XR2bW1Ie.js} +20 -34
- package/dist/_chunks/{section-card.agent-W18CHEgX.js.map → section-card-XR2bW1Ie.js.map} +1 -1
- package/dist/_chunks/section-card.agent-Bz1BhM_j.js +17 -0
- package/dist/_chunks/section-card.agent-Bz1BhM_j.js.map +1 -0
- package/dist/_chunks/smartphone-DaPcFw-X.js +32 -0
- package/dist/_chunks/smartphone-DaPcFw-X.js.map +1 -0
- package/dist/_chunks/{task-card-BalrLkSz.js → task-card-qTKD1fIT.js} +39 -57
- package/dist/_chunks/task-card-qTKD1fIT.js.map +1 -0
- package/dist/_chunks/{task-tray-wl9eti6J.js → task-tray-CQ8UAR2j.js} +2 -2
- package/dist/_chunks/{task-tray-wl9eti6J.js.map → task-tray-CQ8UAR2j.js.map} +1 -1
- package/dist/_chunks/{tasks-panel-BDNB7hsZ.js → tasks-panel-CBGMtQ_f.js} +2 -2
- package/dist/_chunks/{tasks-panel-BDNB7hsZ.js.map → tasks-panel-CBGMtQ_f.js.map} +1 -1
- package/dist/_chunks/{tool-rail-Bq5eiFMG.js → tool-rail-BP8sjxCw.js} +310 -231
- package/dist/_chunks/tool-rail-BP8sjxCw.js.map +1 -0
- package/dist/_chunks/treatment-receipt-D4kOLXOk.js +94 -0
- package/dist/_chunks/treatment-receipt-D4kOLXOk.js.map +1 -0
- package/dist/_chunks/treatment-receipt.agent-bpFm2RPH.js +21 -0
- package/dist/_chunks/treatment-receipt.agent-bpFm2RPH.js.map +1 -0
- package/dist/_chunks/use-presence-transition-cDwWUXV-.js +58 -0
- package/dist/_chunks/use-presence-transition-cDwWUXV-.js.map +1 -0
- package/dist/_chunks/{workflow-map-D-LEni11.js → workflow-map-CXdsxvUj.js} +140 -156
- package/dist/_chunks/workflow-map-CXdsxvUj.js.map +1 -0
- package/dist/agent-catalog.json +65 -1
- package/dist/components/appointment-peek/appointment-peek.agent.d.ts +3 -0
- package/dist/components/appointment-peek/appointment-peek.agent.d.ts.map +1 -0
- package/dist/components/appointment-peek/appointment-peek.d.ts +45 -0
- package/dist/components/appointment-peek/appointment-peek.d.ts.map +1 -0
- package/dist/components/appointment-peek/index.d.ts +4 -0
- package/dist/components/appointment-peek/index.d.ts.map +1 -0
- package/dist/components/appointment-peek/index.js +7 -0
- package/dist/components/appointment-peek/index.js.map +1 -0
- package/dist/components/control-room-rail/index.js +1 -1
- package/dist/components/editable-description/editable-description.agent.d.ts +3 -0
- package/dist/components/editable-description/editable-description.agent.d.ts.map +1 -0
- package/dist/components/editable-description/editable-description.d.ts +20 -0
- package/dist/components/editable-description/editable-description.d.ts.map +1 -0
- package/dist/components/editable-description/index.d.ts +4 -0
- package/dist/components/editable-description/index.d.ts.map +1 -0
- package/dist/components/editable-description/index.js +7 -0
- package/dist/components/editable-description/index.js.map +1 -0
- package/dist/components/index.d.ts +4 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/money/index.js +2 -1
- package/dist/components/money/index.js.map +1 -1
- package/dist/components/notes-panel/index.js +1 -1
- package/dist/components/notes-panel/notes-panel.d.ts +16 -0
- package/dist/components/notes-panel/notes-panel.d.ts.map +1 -1
- package/dist/components/panel-subview/index.d.ts +4 -0
- package/dist/components/panel-subview/index.d.ts.map +1 -0
- package/dist/components/panel-subview/index.js +7 -0
- package/dist/components/panel-subview/index.js.map +1 -0
- package/dist/components/panel-subview/panel-subview.agent.d.ts +3 -0
- package/dist/components/panel-subview/panel-subview.agent.d.ts.map +1 -0
- package/dist/components/panel-subview/panel-subview.d.ts +32 -0
- package/dist/components/panel-subview/panel-subview.d.ts.map +1 -0
- package/dist/components/patient-details/index.js +1 -1
- package/dist/components/patient-summary-card/index.js +1 -1
- package/dist/components/section-card/index.js +4 -3
- package/dist/components/section-card/index.js.map +1 -1
- package/dist/components/task-card/index.js +1 -1
- package/dist/components/task-tray/index.js +1 -1
- package/dist/components/tasks-panel/index.js +1 -1
- package/dist/components/tool-rail/index.js +1 -1
- package/dist/components/tool-rail/tool-rail.d.ts.map +1 -1
- package/dist/components/treatment-receipt/index.d.ts +4 -0
- package/dist/components/treatment-receipt/index.d.ts.map +1 -0
- package/dist/components/treatment-receipt/index.js +7 -0
- package/dist/components/treatment-receipt/index.js.map +1 -0
- package/dist/components/treatment-receipt/treatment-receipt.agent.d.ts +3 -0
- package/dist/components/treatment-receipt/treatment-receipt.agent.d.ts.map +1 -0
- package/dist/components/treatment-receipt/treatment-receipt.d.ts +30 -0
- package/dist/components/treatment-receipt/treatment-receipt.d.ts.map +1 -0
- package/dist/components/workflow/index.js +1 -1
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +9 -7
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/use-presence-transition.d.ts +40 -0
- package/dist/hooks/use-presence-transition.d.ts.map +1 -0
- package/dist/host-compat.css +7 -1
- package/dist/i18n/locales/ar.d.ts +29 -5
- package/dist/i18n/locales/ar.d.ts.map +1 -1
- package/dist/i18n/locales/ar.js +29 -5
- package/dist/i18n/locales/ar.js.map +1 -1
- package/dist/i18n/locales/de.d.ts +29 -5
- package/dist/i18n/locales/de.d.ts.map +1 -1
- package/dist/i18n/locales/de.js +29 -5
- package/dist/i18n/locales/de.js.map +1 -1
- package/dist/i18n/locales/el.d.ts +29 -5
- package/dist/i18n/locales/el.d.ts.map +1 -1
- package/dist/i18n/locales/el.js +29 -5
- package/dist/i18n/locales/el.js.map +1 -1
- package/dist/i18n/locales/en.d.ts +29 -5
- package/dist/i18n/locales/en.d.ts.map +1 -1
- package/dist/i18n/locales/en.js +29 -5
- package/dist/i18n/locales/en.js.map +1 -1
- package/dist/i18n/locales/es.d.ts +29 -5
- package/dist/i18n/locales/es.d.ts.map +1 -1
- package/dist/i18n/locales/es.js +29 -5
- package/dist/i18n/locales/es.js.map +1 -1
- package/dist/i18n/locales/fr.d.ts +29 -5
- package/dist/i18n/locales/fr.d.ts.map +1 -1
- package/dist/i18n/locales/fr.js +29 -5
- package/dist/i18n/locales/fr.js.map +1 -1
- package/dist/i18n/locales/hi.d.ts +29 -5
- package/dist/i18n/locales/hi.d.ts.map +1 -1
- package/dist/i18n/locales/hi.js +29 -5
- package/dist/i18n/locales/hi.js.map +1 -1
- package/dist/i18n/locales/it.d.ts +29 -5
- package/dist/i18n/locales/it.d.ts.map +1 -1
- package/dist/i18n/locales/it.js +29 -5
- package/dist/i18n/locales/it.js.map +1 -1
- package/dist/i18n/locales/ja.d.ts +29 -5
- package/dist/i18n/locales/ja.d.ts.map +1 -1
- package/dist/i18n/locales/ja.js +29 -5
- package/dist/i18n/locales/ja.js.map +1 -1
- package/dist/i18n/locales/nl.d.ts +29 -5
- package/dist/i18n/locales/nl.d.ts.map +1 -1
- package/dist/i18n/locales/nl.js +29 -5
- package/dist/i18n/locales/nl.js.map +1 -1
- package/dist/i18n/locales/pl.d.ts +29 -5
- package/dist/i18n/locales/pl.d.ts.map +1 -1
- package/dist/i18n/locales/pl.js +29 -5
- package/dist/i18n/locales/pl.js.map +1 -1
- package/dist/i18n/locales/pt.d.ts +29 -5
- package/dist/i18n/locales/pt.d.ts.map +1 -1
- package/dist/i18n/locales/pt.js +29 -5
- package/dist/i18n/locales/pt.js.map +1 -1
- package/dist/i18n/locales/ro.d.ts +29 -5
- package/dist/i18n/locales/ro.d.ts.map +1 -1
- package/dist/i18n/locales/ro.js +29 -5
- package/dist/i18n/locales/ro.js.map +1 -1
- package/dist/i18n/locales/ru.d.ts +29 -5
- package/dist/i18n/locales/ru.d.ts.map +1 -1
- package/dist/i18n/locales/ru.js +29 -5
- package/dist/i18n/locales/ru.js.map +1 -1
- package/dist/i18n/locales/sq.d.ts +29 -5
- package/dist/i18n/locales/sq.d.ts.map +1 -1
- package/dist/i18n/locales/sq.js +29 -5
- package/dist/i18n/locales/sq.js.map +1 -1
- package/dist/i18n/locales/sv.d.ts +29 -5
- package/dist/i18n/locales/sv.d.ts.map +1 -1
- package/dist/i18n/locales/sv.js +29 -5
- package/dist/i18n/locales/sv.js.map +1 -1
- package/dist/i18n/locales/tr.d.ts +29 -5
- package/dist/i18n/locales/tr.d.ts.map +1 -1
- package/dist/i18n/locales/tr.js +29 -5
- package/dist/i18n/locales/tr.js.map +1 -1
- package/dist/i18n/locales/zh.d.ts +29 -5
- package/dist/i18n/locales/zh.d.ts.map +1 -1
- package/dist/i18n/locales/zh.js +29 -5
- package/dist/i18n/locales/zh.js.map +1 -1
- package/dist/index.js +958 -940
- package/dist/index.js.map +1 -1
- package/dist/locales/ar.json +29 -5
- package/dist/locales/de.json +29 -5
- package/dist/locales/el.json +29 -5
- package/dist/locales/en.json +29 -5
- package/dist/locales/es.json +29 -5
- package/dist/locales/fr.json +29 -5
- package/dist/locales/hi.json +29 -5
- package/dist/locales/it.json +29 -5
- package/dist/locales/ja.json +29 -5
- package/dist/locales/nl.json +29 -5
- package/dist/locales/pl.json +29 -5
- package/dist/locales/pt.json +29 -5
- package/dist/locales/ro.json +29 -5
- package/dist/locales/ru.json +29 -5
- package/dist/locales/sq.json +29 -5
- package/dist/locales/sv.json +29 -5
- package/dist/locales/tr.json +29 -5
- package/dist/locales/zh.json +29 -5
- package/dist/patterns/calendar/calendar-appointment-details.d.ts +15 -6
- package/dist/patterns/calendar/calendar-appointment-details.d.ts.map +1 -1
- package/dist/patterns/calendar/calendar-appointment-details.sections.d.ts +23 -23
- package/dist/patterns/calendar/calendar-appointment-details.sections.d.ts.map +1 -1
- package/dist/patterns/calendar/calendar-info-hover.d.ts +18 -0
- package/dist/patterns/calendar/calendar-info-hover.d.ts.map +1 -0
- package/dist/patterns/calendar/calendar-workspace.d.ts.map +1 -1
- package/dist/patterns/calendar/calendar.journey.d.ts +10 -0
- package/dist/patterns/calendar/calendar.journey.d.ts.map +1 -1
- package/dist/patterns/calendar/calendar.sheets.d.ts +2 -2
- package/dist/patterns/calendar/calendar.sheets.d.ts.map +1 -1
- package/dist/patterns/calendar/calendar.surface.d.ts.map +1 -1
- package/dist/patterns/calendar/index.js +1 -1
- package/dist/tokens.css +1 -1
- package/package.json +17 -1
- package/dist/_chunks/calendar-workspace-Duv_5B4j.js +0 -9471
- package/dist/_chunks/calendar-workspace-Duv_5B4j.js.map +0 -1
- package/dist/_chunks/hourglass-BEAzW1wE.js +0 -26
- package/dist/_chunks/hourglass-BEAzW1wE.js.map +0 -1
- package/dist/_chunks/money.agent-Dw55UxUA.js.map +0 -1
- package/dist/_chunks/notes-panel-Co8D3uDd.js +0 -469
- package/dist/_chunks/notes-panel-Co8D3uDd.js.map +0 -1
- package/dist/_chunks/patient-field-row-BQZoP4m2.js.map +0 -1
- package/dist/_chunks/smartphone-C0rFF2if.js +0 -15
- package/dist/_chunks/smartphone-C0rFF2if.js.map +0 -1
- package/dist/_chunks/task-card-BalrLkSz.js.map +0 -1
- package/dist/_chunks/tool-rail-Bq5eiFMG.js.map +0 -1
- package/dist/_chunks/workflow-map-D-LEni11.js.map +0 -1
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { c as a } from "./createLucideIcon-DhHxpK9K.js";
|
|
2
|
-
/**
|
|
3
|
-
* @license lucide-react v1.22.0 - ISC
|
|
4
|
-
*
|
|
5
|
-
* This source code is licensed under the ISC license.
|
|
6
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
7
|
-
*/
|
|
8
|
-
const e = [
|
|
9
|
-
["path", { d: "M5 22h14", key: "ehvnwv" }],
|
|
10
|
-
["path", { d: "M5 2h14", key: "pdyrp9" }],
|
|
11
|
-
[
|
|
12
|
-
"path",
|
|
13
|
-
{
|
|
14
|
-
d: "M17 22v-4.172a2 2 0 0 0-.586-1.414L12 12l-4.414 4.414A2 2 0 0 0 7 17.828V22",
|
|
15
|
-
key: "1d314k"
|
|
16
|
-
}
|
|
17
|
-
],
|
|
18
|
-
[
|
|
19
|
-
"path",
|
|
20
|
-
{ d: "M7 2v4.172a2 2 0 0 0 .586 1.414L12 12l4.414-4.414A2 2 0 0 0 17 6.172V2", key: "1vvvr6" }
|
|
21
|
-
]
|
|
22
|
-
], t = a("hourglass", e);
|
|
23
|
-
export {
|
|
24
|
-
t as H
|
|
25
|
-
};
|
|
26
|
-
//# sourceMappingURL=hourglass-BEAzW1wE.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hourglass-BEAzW1wE.js","sources":["../../node_modules/lucide-react/dist/esm/icons/hourglass.mjs"],"sourcesContent":["/**\n * @license lucide-react v1.22.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconNode = [\n [\"path\", { d: \"M5 22h14\", key: \"ehvnwv\" }],\n [\"path\", { d: \"M5 2h14\", key: \"pdyrp9\" }],\n [\n \"path\",\n {\n d: \"M17 22v-4.172a2 2 0 0 0-.586-1.414L12 12l-4.414 4.414A2 2 0 0 0 7 17.828V22\",\n key: \"1d314k\"\n }\n ],\n [\n \"path\",\n { d: \"M7 2v4.172a2 2 0 0 0 .586 1.414L12 12l4.414-4.414A2 2 0 0 0 17 6.172V2\", key: \"1vvvr6\" }\n ]\n];\nconst Hourglass = createLucideIcon(\"hourglass\", __iconNode);\n\nexport { __iconNode, Hourglass as default };\n//# sourceMappingURL=hourglass.mjs.map\n"],"names":["__iconNode","Hourglass","createLucideIcon"],"mappings":";AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,MAAMA,IAAa;AAAA,EACjB,CAAC,QAAQ,EAAE,GAAG,YAAY,KAAK,SAAQ,CAAE;AAAA,EACzC,CAAC,QAAQ,EAAE,GAAG,WAAW,KAAK,SAAQ,CAAE;AAAA,EACxC;AAAA,IACE;AAAA,IACA;AAAA,MACE,GAAG;AAAA,MACH,KAAK;AAAA,IACX;AAAA,EACA;AAAA,EACE;AAAA,IACE;AAAA,IACA,EAAE,GAAG,0EAA0E,KAAK,SAAQ;AAAA,EAChG;AACA,GACMC,IAAYC,EAAiB,aAAaF,CAAU;","x_google_ignoreList":[0]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"money.agent-Dw55UxUA.js","sources":["../../src/components/money/money.tsx","../../src/components/money/money.agent.ts"],"sourcesContent":["/* -------------------------------------------------------------------- */\n/* Money — a formatted monetary amount. */\n/* */\n/* Every price in the kit arrives as an integer in the smallest currency */\n/* unit plus an ISO-4217 code, and the kit formats it (see */\n/* `_shared/format-price`). This is the read-only leaf that renders one, */\n/* so a price is not re-implemented per surface with its own */\n/* `Intl.NumberFormat` call and its own alignment and tone decisions. */\n/* */\n/* What it adds over a bare formatted string: */\n/* - tabular figures, so a column of prices lines up on the decimal; */\n/* - the fraction can be de-emphasised or dropped when it is zero, so */\n/* the whole units read first; */\n/* - tone follows the sign when asked, so money owed reads as owed; */\n/* - the visual parts are hidden from assistive tech and the full */\n/* formatted amount is announced once, so splitting the fraction into */\n/* its own element cannot fragment what a screen reader says. */\n/* -------------------------------------------------------------------- */\n\nimport { forwardRef, useMemo, type HTMLAttributes } from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\n\nimport { VisuallyHidden } from '../visually-hidden';\nimport { formatPrice, formatPriceParts } from '../_shared/format-price';\n\n/* ------------------------------------------------------------------ */\n/* CVA */\n/* ------------------------------------------------------------------ */\n\nconst moneyVariants = cva(\n [\n 'ds:inline-flex ds:items-baseline ds:whitespace-nowrap',\n // Lining, fixed-width figures: without these a column of amounts\n // wanders because glyph widths differ between digits.\n 'ds:tabular-nums',\n ].join(' '),\n {\n variants: {\n size: {\n sm: 'type-body-sm',\n md: 'type-body',\n lg: 'type-title-item',\n },\n tone: {\n default: 'ds:text-[color:var(--foreground)]',\n muted: 'ds:text-[color:var(--muted-foreground)]',\n positive: 'ds:text-[color:var(--success-foreground)]',\n negative: 'ds:text-[color:var(--destructive)]',\n },\n strikethrough: {\n true: 'ds:line-through ds:decoration-from-font',\n false: '',\n },\n },\n defaultVariants: { size: 'md', tone: 'default', strikethrough: false },\n },\n);\n\n/* ------------------------------------------------------------------ */\n/* Types */\n/* ------------------------------------------------------------------ */\n\nexport type MoneyDecimals = 'full' | 'muted' | 'hideWhenZero';\n\nexport interface MoneyProps\n extends\n Omit<HTMLAttributes<HTMLSpanElement>, 'children'>,\n Omit<VariantProps<typeof moneyVariants>, 'tone'> {\n /**\n * Amount in the SMALLEST currency unit (cents), the kit's price\n * convention — never a pre-formatted string. Zero-decimal currencies\n * (JPY, KRW …) take the major amount, as `formatPrice` expects.\n */\n value: number;\n /** ISO-4217 code. Defaults to EUR, the practice currency. */\n currency?: string;\n /** BCP 47 locale. Defaults to the active i18n language. */\n locale?: string;\n /**\n * Colour. `auto` follows the sign — a negative amount reads destructive,\n * everything else inherits the default. Explicit tones always win.\n */\n tone?: 'default' | 'muted' | 'positive' | 'negative' | 'auto';\n /**\n * What to do with the fraction:\n * `full` (default) leaves it alone;\n * `muted` de-emphasises it so the whole units read first;\n * `hideWhenZero` drops it ONLY when it is all zeros, so a price is\n * never rounded away in the display.\n */\n decimals?: MoneyDecimals;\n /** Force a leading `+` on positive amounts (a credit, a movement). */\n signDisplay?: 'auto' | 'always';\n}\n\n/* ------------------------------------------------------------------ */\n/* Component */\n/* ------------------------------------------------------------------ */\n\nexport const Money = forwardRef<HTMLSpanElement, MoneyProps>(\n (\n {\n value,\n currency = 'EUR',\n locale,\n size,\n tone = 'default',\n decimals = 'full',\n signDisplay = 'auto',\n strikethrough,\n className,\n ...rest\n },\n ref,\n ) => {\n const { i18n } = useTranslation();\n const resolvedLocale = locale ?? i18n.language;\n\n const { nodes, full } = useMemo(() => {\n const signOptions =\n signDisplay === 'always'\n ? ({ signDisplay: 'exceptZero' } as const)\n : {};\n const parts = formatPriceParts(\n value,\n currency,\n resolvedLocale,\n signOptions,\n );\n const plain = formatPrice(value, currency, resolvedLocale);\n\n // No parts means the locale or currency was rejected; the plain\n // string still honours the zero-decimal rule, so show that whole.\n if (!parts)\n return { nodes: [{ text: plain, muted: false }], full: plain };\n\n const text = parts.map((part) => part.value).join('');\n const fractionIsZero = parts\n .filter((part) => part.type === 'fraction')\n .every((part) => /^0+$/.test(part.value));\n\n // `decimal` and `fraction` are labelled by Intl, so this holds\n // wherever the locale puts them and whatever glyph it uses — an\n // it-IT group separator is a `group` part and is never touched.\n const isFractionPart = (type: Intl.NumberFormatPartTypes): boolean =>\n type === 'decimal' || type === 'fraction';\n\n if (decimals === 'hideWhenZero' && fractionIsZero) {\n const kept = parts.filter((part) => !isFractionPart(part.type));\n const trimmed = kept\n .map((part) => part.value)\n .join('')\n .trim();\n return { nodes: [{ text: trimmed, muted: false }], full: trimmed };\n }\n\n if (decimals === 'muted') {\n return {\n nodes: parts.map((part) => ({\n text: part.value,\n muted: isFractionPart(part.type),\n })),\n full: text,\n };\n }\n\n return { nodes: [{ text, muted: false }], full: text };\n }, [value, currency, resolvedLocale, decimals, signDisplay]);\n\n const resolvedTone =\n tone === 'auto' ? (value < 0 ? 'negative' : 'default') : tone;\n\n return (\n <span\n ref={ref}\n data-component=\"money\"\n data-currency={currency.toUpperCase()}\n className={moneyVariants({\n size,\n tone: resolvedTone,\n strikethrough,\n className,\n })}\n {...rest}\n >\n {/* The visual pieces are decorative: the amount is announced once,\n below, so a split fraction cannot be read as two numbers. */}\n {nodes.map((node, index) => (\n <span\n // Parts are positional and re-derived together, so the index is\n // the identity here.\n key={`${index}-${node.text}`}\n aria-hidden=\"true\"\n className={\n node.muted ? 'ds:opacity-70 ds:[font-size:0.85em]' : undefined\n }\n >\n {node.text}\n </span>\n ))}\n <VisuallyHidden>{full}</VisuallyHidden>\n </span>\n );\n },\n);\n\nMoney.displayName = 'Money';\n","/* -------------------------------------------------------------------- */\n/* Agent adapter — Money. */\n/* */\n/* A read-only formatted amount. It holds no state an agent can change */\n/* and exposes no actions. The root also carries `data-currency` (the */\n/* ISO-4217 code) so a reader can tell two amounts apart without */\n/* parsing the glyph; the hook vocabulary has no slot to declare it. */\n/* -------------------------------------------------------------------- */\n\nimport type { AgentAdapter } from '../../agent/types';\n\nexport const moneyAgent: AgentAdapter = {\n id: 'money',\n capabilities: [],\n state: {},\n actions: {},\n domHooks: {\n root: {\n attr: 'data-component',\n value: 'money',\n description: 'Marks the element as a kit Money amount.',\n },\n },\n};\n"],"names":["moneyVariants","cva","Money","forwardRef","value","currency","locale","size","tone","decimals","signDisplay","strikethrough","className","rest","ref","i18n","useTranslation","resolvedLocale","nodes","full","useMemo","parts","formatPriceParts","plain","formatPrice","text","part","fractionIsZero","isFractionPart","type","trimmed","resolvedTone","jsxs","node","index","jsx","VisuallyHidden","moneyAgent"],"mappings":";;;;;;AA8BA,MAAMA,IAAgBC;AAAA,EACpB;AAAA,IACE;AAAA;AAAA;AAAA,IAGA;AAAA,EAAA,EACA,KAAK,GAAG;AAAA,EACV;AAAA,IACE,UAAU;AAAA,MACR,MAAM;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MAAA;AAAA,MAEN,MAAM;AAAA,QACJ,SAAS;AAAA,QACT,OAAO;AAAA,QACP,UAAU;AAAA,QACV,UAAU;AAAA,MAAA;AAAA,MAEZ,eAAe;AAAA,QACb,MAAM;AAAA,QACN,OAAO;AAAA,MAAA;AAAA,IACT;AAAA,IAEF,iBAAiB,EAAE,MAAM,MAAM,MAAM,WAAW,eAAe,GAAA;AAAA,EAAM;AAEzE,GA2CaC,IAAQC;AAAA,EACnB,CACE;AAAA,IACE,OAAAC;AAAA,IACA,UAAAC,IAAW;AAAA,IACX,QAA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A,EAC/B;AAAA,QACF,MAAMD;AAAA,MAAA,IAIH,EAAE,OAAO,CAAC,EAAE,MAAAA,GAAM,OAAO,GAAA,CAAO,GAAG,MAAMA,EAAA;AAAA,IAClD,GAAG,CAACrB,GAAOC,GAAUY,GAAgBR,GAAUC,CAAW,CAAC,GAErDqB,IACJvB,MAAS,SAAUJ,IAAQ,IAAI,aAAa,YAAaI;AAE3D,WACE,gBAAAwB;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,KAAAlB;AAAA,QACA,kBAAe;AAAA,QACf,iBAAeT,EAAS,YAAA;AAAA,QACxB,WAAWL,EAAc;AAAA,UACvB,MAAAO;AAAA,UACA,MAAMwB;AAAA,UACN,eAAApB;AAAA,UACA,WAAAC;AAAA,QAAA,CACD;AAAA,QACA,GAAGC;AAAA,QAIH,UAAA;AAAA,UAAAK,EAAM,IAAI,CAACe,GAAMC,MAChB,gBAAAC;AAAA,YAAC;AAAA,YAAA;AAAA,cAIC,eAAY;AAAA,cACZ,WACEF,EAAK,QAAQ,wCAAwC;AAAA,cAGtD,UAAAA,EAAK;AAAA,YAAA;AAAA,YAND,GAAGC,CAAK,IAAID,EAAK,IAAI;AAAA,UAAA,CAQ7B;AAAA,UACD,gBAAAE,EAACC,KAAgB,UAAAjB,EAAA,CAAK;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAG5B;AACF;AAEAjB,EAAM,cAAc;ACpMb,MAAMmC,IAA2B;AAAA,EACtC,IAAI;AAAA,EACJ,cAAc,CAAA;AAAA,EACd,OAAO,CAAA;AAAA,EACP,SAAS,CAAA;AAAA,EACT,UAAU;AAAA,IACR,MAAM;AAAA,MACJ,MAAM;AAAA,MACN,OAAO;AAAA,MACP,aAAa;AAAA,IAAA;AAAA,EACf;AAEJ;"}
|
|
@@ -1,469 +0,0 @@
|
|
|
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-DdsGYMmI.js";
|
|
7
|
-
import { R as Me } from "./rich-text-editor-BTXlorm5.js";
|
|
8
|
-
import { T as We } from "./text-area-Bt3p7Pt0.js";
|
|
9
|
-
import { A as C } from "./alert-CiQ5Pa3Q.js";
|
|
10
|
-
import { B as A } from "./button-nJaPh_HC.js";
|
|
11
|
-
import { I as Fe } from "./icon-button-8xqRnkdG.js";
|
|
12
|
-
import { C as Oe } from "./checkbox-CZkipDn7.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-D_mTdhUp.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-Co8D3uDd.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"notes-panel-Co8D3uDd.js","sources":["../../src/components/_shared/get-error-message.ts","../../src/components/notes-panel/notes-panel.agent.ts","../../src/components/notes-panel/notes-panel.tsx"],"sourcesContent":["/** Read host error messages without relying on the host's JavaScript realm. */\nexport function getErrorMessage(error: unknown, fallback: string): string {\n if (\n typeof error === 'object' &&\n error !== null &&\n 'message' in error &&\n typeof error.message === 'string' &&\n error.message.trim()\n ) {\n return error.message;\n }\n return fallback;\n}\n","/* -------------------------------------------------------------------- */\n/* Agent adapter — NotesPanel. */\n/* */\n/* The Notes tool: a composer over a note timeline. The agent reads the */\n/* timeline STRUCTURE (note ids + pinned / flagged / clinical flags — */\n/* never the note body or author, both PHI), composes and commits a new */\n/* note, and toggles a note's pinned / flagged state. `add_note` carries */\n/* the `phi` safety class: a note body is patient-identifiable clinical */\n/* content, so the host gates it behind the same confirm-before-act as a */\n/* destructive write and never auto-confirms. A clinical submission also */\n/* requires the host's `practice_add_clinical_note` permission (the */\n/* handle drops it when the gate is closed). Host-owned per-note */\n/* `noteActions` (edit, delete…) sit outside this handle — an agent */\n/* reaches them through the host's own adapters. */\n/* -------------------------------------------------------------------- */\n\nimport type { AgentAdapter } from '../../agent/types';\nimport type { NotesPanelHandle } from './notes-panel';\n\nexport const notesPanelAgent: AgentAdapter<NotesPanelHandle> = {\n id: 'notes-panel',\n // 'submit' backs add_note (compose + commit a note). pin / flag are toggles\n // with no dedicated capability in the closed vocabulary.\n capabilities: ['submit'],\n state: {\n notes: {\n type: 'Array<{ id?: string; pinned: boolean; flagged: boolean; clinical: boolean }>',\n descriptionKey: 'ui.agent.notesPanel.state.notes',\n description:\n 'Timeline note ids + pinned / flagged / clinical flags. Never the note body or author (both PHI).',\n read: (handle) => handle.getNotes(),\n },\n canAddClinical: {\n type: 'boolean',\n descriptionKey: 'ui.agent.notesPanel.state.canAddClinical',\n description:\n 'Whether the current user may write clinical notes (the practice_add_clinical_note permission gate).',\n read: (handle) => handle.canAddClinical(),\n },\n currentNoteId: {\n type: 'string | null',\n descriptionKey: 'ui.agent.notesPanel.state.currentNoteId',\n description:\n '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.',\n read: (handle) => handle.getCurrentNoteId(),\n },\n },\n actions: {\n add_note: {\n // Writes a clinical/admin note body — patient-identifiable content. PHI.\n safety: 'phi',\n argsType: '{ content: string; clinical: boolean }',\n argsSchema: {\n type: 'object',\n properties: {\n content: {\n type: 'string',\n description:\n 'Note body. Rich HTML for the rich composer, else plain text.',\n },\n clinical: {\n type: 'boolean',\n description:\n 'Whether the note is clinical. Requires the clinical-note permission; the submission is dropped when the gate is closed.',\n },\n },\n required: ['content', 'clinical'],\n },\n openWorld: true,\n descriptionKey: 'ui.agent.notesPanel.actions.addNote',\n description:\n 'Compose and commit a new note. A clinical note requires the clinical-note permission (read canAddClinical first).',\n examples: [\n {\n args: { content: 'Patient reported improvement.', clinical: true },\n note: 'Add a clinical note.',\n },\n ],\n invoke: (handle, args: { content: string; clinical: boolean }) => {\n return handle.addNote(args);\n },\n },\n toggle_pin: {\n // Re-orders the timeline (pinned notes lead) — reversible view write.\n safety: 'write',\n argsType: '{ id: string }',\n argsSchema: {\n type: 'object',\n properties: { id: { type: 'string' } },\n required: ['id'],\n },\n idempotent: false,\n descriptionKey: 'ui.agent.notesPanel.actions.togglePin',\n description:\n 'Toggle the pinned state of the note with the given id. Refused for a deleted note or one whose actions.pin is false.',\n invoke: (handle, args: { id: string }) => {\n handle.togglePin(args.id);\n },\n },\n toggle_flag: {\n safety: 'write',\n argsType: '{ id: string }',\n argsSchema: {\n type: 'object',\n properties: { id: { type: 'string' } },\n required: ['id'],\n },\n idempotent: false,\n descriptionKey: 'ui.agent.notesPanel.actions.toggleFlag',\n description: 'Toggle the flagged state of the note with the given id.',\n invoke: (handle, args: { id: string }) => {\n handle.toggleFlag(args.id);\n },\n },\n },\n domHooks: {\n root: {\n attr: 'data-component',\n value: 'notes-panel',\n description: 'Marks the NotesPanel region.',\n },\n instanceId: {\n attr: 'data-component-id',\n sourceProp: 'id',\n description:\n 'Sourced from the id prop. Required to address a specific notes panel from the agent.',\n },\n },\n};\n","import {\n forwardRef,\n useCallback,\n useEffect,\n useId,\n useImperativeHandle,\n useMemo,\n useRef,\n useState,\n type HTMLAttributes,\n type ReactNode,\n} from 'react';\nimport { cva } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\nimport { getErrorMessage } from '../_shared/get-error-message';\nimport { useAgentRegistration } from '../../agent/registry';\nimport { notesPanelAgent } from './notes-panel.agent';\nimport { ClinicalNoteCard } from '../clinical-note-card';\nimport type { ClinicalNoteCardProps } from '../clinical-note-card';\nimport { RichTextEditor } from '../rich-text-editor';\nimport type {\n RichTextEditorHandle,\n RichTextEditorProps,\n RichTextEditorToolbar,\n RedactorFactory,\n} from '../rich-text-editor';\nimport { TextArea } from '../text-area';\nimport { Alert } from '../alert';\nimport { Button, IconButton } from '../button';\nimport { Checkbox } from '../checkbox';\nimport { Spinner } from '../spinner';\nimport { Dialog } from '../dialog';\nimport { NotebookPen, Trash2 } from 'lucide-react';\nimport { PanelHeader } from '../panel-header';\nimport { REFLOW_ROW_CLASS, useListReflow } from '../../hooks/use-list-reflow';\nimport { useExitTransition } from '../../hooks/use-exit-transition';\nimport { useTheme } from '../../hooks/use-theme';\n\n/* ------------------------------------------------------------------ */\n/* NotesPanel — the Notes tool for the Control Room rail. */\n/* */\n/* A composer over an elevated ClinicalNoteCard timeline. Drops */\n/* into a ControlRoomRail tool `panel`, the patient profile, or the */\n/* care-plan editor — anywhere notes about the open entity belong. */\n/* The composer is the kit RichTextEditor by default (degrades to a */\n/* textarea where Redactor is absent), carries a permission-gated */\n/* \"clinical note\" toggle, and forwards the editor's AI affordances. */\n/* The note attaches to whatever entity the host is showing — the */\n/* host owns the attachment; the panel only emits content + clinical. */\n/* Pinned notes lead; pin / flag are inline per-note toggles. */\n/* ------------------------------------------------------------------ */\n\n/**\n * One note in the panel — the data subset of `ClinicalNoteCard`.\n *\n * `aria-label` names the card for assistive tech. Set it whenever a row is not\n * a clinical note: the card's fallback name is \"Clinical note\", so an entry\n * that is something else (a dated event, an import) is announced as one.\n */\nexport type NotesPanelNote = Pick<\n ClinicalNoteCardProps,\n | 'id'\n | 'dateIso'\n | 'createdAtIso'\n | 'author'\n | 'clinical'\n | 'attachedTo'\n | 'content'\n | 'contentFormat'\n | 'pinned'\n | 'flagged'\n | 'aria-label'\n | 'deleted'\n | 'operatorName'\n> & {\n /** What the host lets the reader do with this note. */\n actions?: NotesPanelNoteActions;\n};\n\n/** Per-note write permissions; an absent key means allowed. The panel hides\n * the pin toggle on `pin: false` and on a deleted note. */\nexport type NotesPanelNoteActions = {\n edit?: boolean;\n delete?: boolean;\n pin?: boolean;\n};\n\n/**\n * Curated agent handle for NotesPanel. Reads the note timeline's STRUCTURE\n * (ids + pinned / flagged / clinical flags — never the note body or author,\n * both PHI) and drives the composer + per-note toggles. See\n * `notes-panel.agent.ts`.\n */\nexport interface NotesPanelHandle {\n /** Timeline snapshot — ids + flags only, never note content (PHI). */\n getNotes: () => Array<{\n id?: string;\n pinned: boolean;\n flagged: boolean;\n clinical: boolean;\n }>;\n /** Whether the composer is mounted (onAddNote is wired). */\n canAddNote: () => boolean;\n /** Whether clinical notes may be written (the permission gate). */\n canAddClinical: () => boolean;\n /** Id of the note the host has addressed, or null when none is. */\n getCurrentNoteId: () => string | null;\n /** Commit a new note with explicit content (mirrors the composer's submit). */\n addNote: (submission: NotesPanelSubmission) => void | Promise<void>;\n /** Toggle a note's pinned state (mirrors onTogglePin, with its gate). */\n togglePin: (id: string) => void;\n /** Toggle a note's flagged state (mirrors onToggleFlag). */\n toggleFlag: (id: string) => void;\n}\n\n/** Payload handed to `onAddNote` when the composer commits. */\nexport interface NotesPanelSubmission {\n /** The note body — rich HTML (`composer='rich'`) or plain text. */\n content: string;\n /** Whether the \"clinical note\" toggle was set. */\n clinical: boolean;\n}\n\nexport interface NotesPanelProps extends Omit<\n HTMLAttributes<HTMLElement>,\n 'title' | 'children'\n> {\n /**\n * Stable instance id. Surfaced on the root as `data-component-id` so an\n * agent / MCP UI bridge can address this specific notes panel.\n */\n id?: string;\n /** Notes to render, newest-first by convention. Pinned notes lead. */\n notes: NotesPanelNote[];\n /**\n * Commit a new note. Omit to hide the composer (read-only timeline). Return\n * a promise to keep the draft until the host has saved it: the draft clears\n * when it resolves, and a rejection keeps it and shows the error's message.\n */\n onAddNote?: (submission: NotesPanelSubmission) => void | Promise<void>;\n /** The host's notes read. `'loading'` and `'error'` never show the empty\n * text; notes already held still render. Default `'ready'`. */\n status?: 'ready' | 'loading' | 'error';\n /** Retry a failed read. Renders a retry button in the error state. */\n onRetry?: () => void;\n /**\n * The note the reader ASKED for, addressed by id from somewhere else in the\n * record — a marker in a chart, a row in a grid, an agent. The panel marks\n * it, scrolls it to the middle of its own scroll region and moves focus to\n * it, and renders it unclamped so the thing that was asked for is readable\n * in full without a second click.\n *\n * Opening a panel is not the same as answering a question: a rail's\n * `setActiveTool` moves no focus and announces nothing, so a control whose\n * name promises \"in the notes panel\" produces no perceivable change for a\n * keyboard or screen-reader reader unless the panel lands them on the note.\n * That is what this prop is for; without it, a host has to reach into the\n * panel's DOM to do the same job.\n *\n * Marked on three channels, never colour alone (WCAG 1.4.1): a solid\n * inline-start bar the other notes do not have, a tinted gutter, and\n * `aria-current` plus a visually-hidden sentence naming the mark.\n *\n * Ids that match no note are ignored. To address the SAME note twice — the\n * reader pressing the same marker again after scrolling away — bump\n * `currentNoteKey` alongside it; this prop alone is a value, not a request.\n */\n currentNoteId?: string;\n /**\n * Bump on every address to re-scroll and re-focus the note in `currentNoteId`\n * even when the id has not changed.\n *\n * Addressing is a request, not a value: a reader who presses the same marker\n * a second time (having scrolled away, or having moved focus off the note) is\n * asking to be taken back, and a control whose name promises the notes panel\n * must do something perceivable every time it is pressed. Without this the\n * second press is inert — the panel is already showing that note, so nothing\n * re-runs. Hosts increment a counter in the same handler that opens the tool.\n */\n currentNoteKey?: string | number;\n\n /* ----- Composer ----- */\n /**\n * `'rich'` (default) mounts the kit `RichTextEditor` (Redactor; degrades to a\n * textarea where Redactor is absent). `'plain'` keeps a simple `TextArea` for\n * lightweight surfaces / deterministic tests.\n */\n composer?: 'rich' | 'plain';\n /** Toolbar preset for the rich composer. Defaults to `'standard'`. */\n editorToolbar?: RichTextEditorToolbar;\n /** Inject the Redactor factory for the rich composer (else `window.$R`). */\n redactor?: RedactorFactory;\n /** Consumer image-upload endpoint for the rich composer. */\n imageUploadUrl?: string;\n\n /* ----- Clinical flag (permission-gated) ----- */\n /** Show the \"clinical note\" toggle in the composer. Default `true`. */\n showClinicalToggle?: boolean;\n /**\n * Permission gate — when `false` the clinical toggle is disabled and shows\n * `clinicalGatedReason` on hover/focus. Mirrors platform's\n * `practice_add_clinical_note` permission. Default `true`.\n */\n canAddClinicalNote?: boolean;\n /** Tooltip shown when the clinical toggle is gated off. */\n clinicalGatedReason?: string;\n /** Initial state of the clinical toggle. Default `false`. */\n defaultClinical?: boolean;\n\n /* ----- AI assistance (forwarded to RichTextEditor) ----- */\n onRequestAiDraft?: RichTextEditorProps['onRequestAiDraft'];\n aiDraftFormat?: RichTextEditorProps['aiDraftFormat'];\n aiPrivacyNotice?: RichTextEditorProps['aiPrivacyNotice'];\n onDictate?: RichTextEditorProps['onDictate'];\n onProofread?: RichTextEditorProps['onProofread'];\n onAutoFormat?: RichTextEditorProps['onAutoFormat'];\n\n /* ----- Per-note actions ----- */\n /** Toggle a note's pinned state — renders an inline pin button per note. */\n onTogglePin?: (id: string) => void;\n /** Toggle a note's flagged state — renders an inline flag button per note. */\n onToggleFlag?: (id: string) => void;\n /**\n * Host-owned actions for each note (edit, delete, share…), rendered by\n * the note card beside its pin and flag,\n * aligned to the inline end. The host supplies labelled controls and owns\n * what they do — the panel stays a timeline and never edits a note itself.\n */\n noteActions?: (note: NotesPanelNote) => ReactNode;\n /**\n * Request the host to delete a note. When provided, the panel holds the\n * row on screen long enough to fade it out before calling this, so the\n * removal reads as a removal rather than a vanish. Omit to let the host\n * own the timing entirely (the reflow animation still closes the gap).\n */\n onDeleteNote?: (id: string) => void;\n /**\n * Show a confirmation dialog before calling `onDeleteNote`. When `true`\n * (the default when `onDeleteNote` is provided), the built-in delete\n * button opens an alert dialog first; the exit fade only starts after\n * the user confirms. Pass `false` to delete immediately on click.\n */\n confirmDelete?: boolean;\n\n /* ----- Labels / chrome ----- */\n /** Panel heading. Defaults to the localised \"Notes\". */\n title?: string;\n /** Composer placeholder. */\n composerPlaceholder?: string;\n /** Save-button label. */\n addNoteLabel?: string;\n /** Rendered when there are no notes. */\n emptyState?: ReactNode;\n /** Accessible name for the panel region (defaults to `title`). */\n 'aria-label'?: string;\n}\n\n/* The timeline row. The addressed note wears a solid inline-start bar the\n others do not — a shape channel, so the mark is not colour alone. Every row\n reserves the bar's width in `transparent`, so marking one shifts nothing. */\nconst noteItemVariants = cva(\n 'ds:flex ds:flex-col ds:rounded-[var(--radius-md)] ds:border-s-2 ds:ps-[var(--spacing-sm)]',\n {\n variants: {\n current: {\n 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)]',\n false: 'ds:border-transparent',\n },\n },\n defaultVariants: { current: false },\n },\n);\n\n/* A row on its way out fades in place; the reflow hook then slides the\n rows below up to close the gap. Declared at rest so the transition has\n a value to animate from the moment the leaving class lands. */\nconst noteLeavingClass = 'ds:opacity-0';\nconst noteElevationClass = [\n 'ds:transition-opacity ds:duration-[var(--animation-duration)]',\n 'ds:ease-[var(--ease-out)] ds:motion-reduce:transition-none',\n].join(' ');\n\n/** Strip tags / entities to test whether a rich draft holds real content. */\nfunction hasRichContent(html: string): boolean {\n if (!html) return false;\n if (/<img\\b/i.test(html)) return true;\n return (\n html\n .replace(/<[^>]*>/g, '')\n .replace(/ /gi, ' ')\n .trim().length > 0\n );\n}\n\nexport const NotesPanel = forwardRef<HTMLElement, NotesPanelProps>(\n function NotesPanel(\n {\n id,\n notes,\n onAddNote,\n status = 'ready',\n onRetry,\n currentNoteId,\n currentNoteKey,\n composer = 'rich',\n editorToolbar = 'standard',\n redactor,\n imageUploadUrl,\n showClinicalToggle = true,\n canAddClinicalNote = true,\n clinicalGatedReason,\n defaultClinical = false,\n onRequestAiDraft,\n aiDraftFormat,\n aiPrivacyNotice,\n onDictate,\n onProofread,\n onAutoFormat,\n onTogglePin,\n onToggleFlag,\n noteActions,\n onDeleteNote,\n confirmDelete = true,\n title,\n composerPlaceholder,\n addNoteLabel,\n emptyState,\n className,\n 'aria-label': ariaLabel,\n ...rest\n },\n ref,\n ) {\n const { t } = useTranslation();\n const editorRef = useRef<RichTextEditorHandle>(null);\n const [draft, setDraft] = useState('');\n const [clinical, setClinical] = useState(defaultClinical);\n const [pending, setPending] = useState(false);\n const [addError, setAddError] = useState<string | null>(null);\n\n const heading = title ?? t('notesPanel.title', { defaultValue: 'Notes' });\n const headingId = useId();\n const placeholder =\n composerPlaceholder ??\n t('notesPanel.placeholder', { defaultValue: 'Add a note…' });\n const composerLabel = t('notesPanel.composerLabel', {\n defaultValue: 'New note',\n });\n\n // Live content check: plain reads the draft directly; rich strips the draft\n // (debounced) for the disabled state but commits from the editor handle.\n const hasContent =\n composer === 'rich' ? hasRichContent(draft) : draft.trim().length > 0;\n\n const commit = useCallback(() => {\n if (!onAddNote || pending) return;\n const rich = composer === 'rich';\n const content = rich\n ? (editorRef.current?.getHTML() ?? draft)\n : draft.trim();\n if (rich ? !hasRichContent(content) : !content) return;\n const reset = () => {\n if (rich) editorRef.current?.clear();\n setDraft('');\n setClinical(defaultClinical);\n };\n setAddError(null);\n let result: void | Promise<void>;\n try {\n result = onAddNote({ content, clinical });\n } catch (error: unknown) {\n setAddError(getErrorMessage(error, t('notesPanel.addFailed')));\n return;\n }\n if (!result || typeof result.then !== 'function') return reset();\n // A failed save keeps the draft, so nothing typed is lost.\n setPending(true);\n Promise.resolve(result)\n .then(reset, (error: unknown) =>\n setAddError(getErrorMessage(error, t('notesPanel.addFailed'))),\n )\n .finally(() => setPending(false));\n }, [composer, draft, clinical, defaultClinical, onAddNote, pending, t]);\n\n // Pinned notes lead; order within each group is preserved.\n const ordered = [...notes].sort(\n (a, b) => Number(b.pinned ?? false) - Number(a.pinned ?? false),\n );\n\n /* The accessible theme zeroes `--animation-duration`, so its CSS plays\n nothing — the JS must agree, or a row would sit still for the delay\n and then vanish anyway. `undefined` leaves the media query in charge. */\n const { resolvedTheme } = useTheme();\n const reduceMotion = resolvedTheme.endsWith('-accessible') || undefined;\n\n /* Closing the gap a removed row leaves: the rows below slide up rather\n than jumping, so the eye keeps its place in the list. Fires on add,\n delete, and re-order (pinning) — any change to the visible id\n sequence. */\n const { containerRef: reflowRef } = useListReflow<HTMLUListElement>({\n key: ordered.map((n) => n.id).join(),\n reduceMotion,\n });\n\n /* A note leaving the list fades out before the host drops it, so the\n removal reads as a removal rather than a vanish. The reflow hook\n then slides the rows below up to close the gap. */\n const deleteExit = useExitTransition({ reduceMotion });\n const [pendingDelete, setPendingDelete] = useState<string | null>(null);\n const handleDeleteNote = useCallback(\n (noteId: string) => {\n if (!onDeleteNote) return;\n if (confirmDelete) {\n setPendingDelete(noteId);\n } else {\n deleteExit.leave(noteId, () => onDeleteNote(noteId));\n }\n },\n [confirmDelete, deleteExit, onDeleteNote],\n );\n const confirmDeleteNote = useCallback(() => {\n if (!pendingDelete || !onDeleteNote) return;\n const noteId = pendingDelete;\n setPendingDelete(null);\n deleteExit.leave(noteId, () => onDeleteNote(noteId));\n }, [pendingDelete, onDeleteNote, deleteExit]);\n\n /* ----- The addressed note (see `currentNoteId`) ----- */\n const currentItemRef = useRef<HTMLLIElement>(null);\n useEffect(() => {\n if (!currentNoteId) return;\n // `center`, not `nearest`: nearest parks the note flush against the edge\n // of the scroll region, which is the least readable place to land.\n currentItemRef.current?.scrollIntoView({ block: 'center' });\n currentItemRef.current?.focus();\n // `currentNoteKey` is in the deps so a REPEAT address of the same note\n // re-runs — see the prop doc. Addressing is a request, not a value.\n }, [currentNoteId, currentNoteKey]);\n\n /* ----- Agent handle (structural reads + composer / toggles) ----- */\n const notesRef = useRef(notes);\n notesRef.current = notes;\n const onAddNoteRef = useRef(onAddNote);\n onAddNoteRef.current = onAddNote;\n const onTogglePinRef = useRef(onTogglePin);\n onTogglePinRef.current = onTogglePin;\n const onToggleFlagRef = useRef(onToggleFlag);\n onToggleFlagRef.current = onToggleFlag;\n const canAddClinicalRef = useRef(canAddClinicalNote);\n canAddClinicalRef.current = canAddClinicalNote;\n const currentNoteIdRef = useRef(currentNoteId);\n currentNoteIdRef.current = currentNoteId;\n\n const rootRef = useRef<HTMLElement>(null);\n useImperativeHandle(ref, () => rootRef.current as HTMLElement, []);\n\n const handle = useMemo<NotesPanelHandle>(\n () => ({\n // Ids + flags only — never the note body or author (both PHI).\n getNotes: () =>\n notesRef.current.map((n) => ({\n id: n.id,\n pinned: !!n.pinned,\n flagged: !!n.flagged,\n clinical: !!n.clinical,\n })),\n canAddNote: () => !!onAddNoteRef.current,\n canAddClinical: () => canAddClinicalRef.current,\n getCurrentNoteId: () => currentNoteIdRef.current ?? null,\n addNote: (submission) => {\n // A clinical submission requires the permission gate to be open.\n if (submission.clinical && !canAddClinicalRef.current) return;\n return onAddNoteRef.current?.(submission);\n },\n togglePin: (noteId) => {\n const note = notesRef.current.find((n) => n.id === noteId);\n if (note && (note.deleted || note.actions?.pin === false)) return;\n onTogglePinRef.current?.(noteId);\n },\n toggleFlag: (noteId) => onToggleFlagRef.current?.(noteId),\n }),\n [],\n );\n useAgentRegistration(notesPanelAgent, handle, id);\n\n return (\n <section\n ref={rootRef}\n data-component=\"notes-panel\"\n data-component-id={id}\n aria-labelledby={ariaLabel ? undefined : headingId}\n aria-label={ariaLabel}\n className={['ds:flex ds:flex-col', className].filter(Boolean).join(' ')}\n {...rest}\n >\n {/* Shared rail header — pins to the top of the panel's scroll region\n while the composer + note timeline scroll beneath it. The rail\n injects the favourite / close actions via PanelHeaderActionsProvider. */}\n <PanelHeader\n title={heading}\n icon={<NotebookPen aria-hidden=\"true\" />}\n headingId={ariaLabel ? undefined : headingId}\n sticky\n divider\n />\n\n <div className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-md)] ds:p-[var(--spacing-md)]\">\n {onAddNote ? (\n <div className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]\">\n {composer === 'rich' ? (\n <RichTextEditor\n ref={editorRef}\n ariaLabel={composerLabel}\n placeholder={placeholder}\n toolbar={editorToolbar}\n minHeight=\"fill\"\n redactor={redactor}\n imageUploadUrl={imageUploadUrl}\n readOnly={pending}\n onChange={({ html }) => setDraft(html)}\n onRequestAiDraft={onRequestAiDraft}\n aiDraftFormat={aiDraftFormat}\n aiPrivacyNotice={aiPrivacyNotice}\n onDictate={onDictate}\n onProofread={onProofread}\n onAutoFormat={onAutoFormat}\n />\n ) : (\n <TextArea\n value={draft}\n readOnly={pending}\n onChange={(event) => setDraft(event.target.value)}\n placeholder={placeholder}\n autoResize\n minRows={2}\n maxRows={6}\n aria-label={composerLabel}\n />\n )}\n <div\n className={[\n 'ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-sm)]',\n showClinicalToggle ? 'ds:justify-between' : 'ds:justify-end',\n ].join(' ')}\n >\n {showClinicalToggle ? (\n <Checkbox\n size=\"sm\"\n label={t('notesPanel.clinicalToggle', {\n defaultValue: 'Clinical note',\n })}\n checked={clinical}\n onCheckedChange={(next) => setClinical(next === true)}\n disabled={pending || !canAddClinicalNote}\n disabledReason={\n canAddClinicalNote\n ? undefined\n : (clinicalGatedReason ??\n t('notesPanel.clinicalGated', {\n defaultValue:\n 'You do not have permission to write clinical notes.',\n }))\n }\n />\n ) : null}\n <Button\n type=\"button\"\n size=\"sm\"\n onClick={commit}\n disabled={!hasContent}\n loading={pending}\n >\n {addNoteLabel ??\n t('notesPanel.add', { defaultValue: 'Add note' })}\n </Button>\n </div>\n {addError ? (\n <Alert variant=\"error\">\n <Alert.Description>{addError}</Alert.Description>\n </Alert>\n ) : null}\n </div>\n ) : null}\n\n {status === 'loading' ? (\n <p className=\"ds:m-0 ds:flex ds:items-center ds:gap-[var(--spacing-xs)] type-body-sm ds:text-[color:var(--muted-foreground)]\">\n <Spinner size=\"sm\" label={t('notesPanel.loading')} />\n <span aria-hidden=\"true\">{t('notesPanel.loading')}</span>\n </p>\n ) : status === 'error' ? (\n <Alert variant=\"error\">\n <Alert.Description>{t('notesPanel.loadError')}</Alert.Description>\n {onRetry ? (\n <Alert.Action>\n <Button intent=\"secondary\" size=\"sm\" onClick={onRetry}>\n {t('notesPanel.retry')}\n </Button>\n </Alert.Action>\n ) : null}\n </Alert>\n ) : null}\n\n {ordered.length > 0 ? (\n <ul\n ref={reflowRef}\n className=\"ds:m-0 ds:flex ds:list-none ds:flex-col ds:gap-[var(--spacing-sm)] ds:p-0\"\n >\n {ordered.map(({ actions, ...note }, index) => {\n const isCurrent =\n currentNoteId != null && note.id === currentNoteId;\n const noteId = note.id as string | undefined;\n const leaving = noteId != null && deleteExit.isLeaving(noteId);\n return (\n <li\n key={note.id ?? index}\n ref={isCurrent ? currentItemRef : undefined}\n // Focus lands on the row, not inside the card, so the\n // sentence below and `aria-current` are read out before the\n // note — and the rail's own Escape still bubbles.\n tabIndex={isCurrent ? -1 : undefined}\n aria-current={isCurrent ? 'true' : undefined}\n data-reflow-id={noteId}\n data-leaving={leaving ? '' : undefined}\n className={[\n noteItemVariants({ current: isCurrent }),\n noteElevationClass,\n REFLOW_ROW_CLASS,\n leaving ? noteLeavingClass : '',\n ]\n .filter(Boolean)\n .join(' ')}\n >\n {isCurrent ? (\n <span className=\"ds:sr-only\">\n {t('notesPanel.current', {\n defaultValue: 'Current note',\n })}\n </span>\n ) : null}\n {/* Elevated card per note; the list gap (not a separator)\n spaces them. Bodies clamp to five lines with read-more —\n except the addressed one, which is what the reader came\n for and opens in full. */}\n <ClinicalNoteCard\n surface=\"elevated\"\n truncate={!isCurrent}\n headerActions={\n <>\n {noteActions\n ? noteActions({ ...note, actions })\n : null}\n {onDeleteNote && noteId && !note.deleted ? (\n <IconButton\n icon={<Trash2 />}\n intent=\"ghost\"\n size=\"sm\"\n aria-label={t('notesPanel.delete', {\n defaultValue: 'Delete note',\n })}\n onClick={() => handleDeleteNote(noteId)}\n />\n ) : null}\n </>\n }\n {...note}\n onTogglePin={\n onTogglePin &&\n note.id &&\n actions?.pin !== false &&\n !note.deleted\n ? () => onTogglePin(note.id as string)\n : undefined\n }\n onToggleFlag={\n onToggleFlag && note.id\n ? () => onToggleFlag(note.id as string)\n : undefined\n }\n />\n </li>\n );\n })}\n </ul>\n ) : status !== 'ready' ? null : (\n (emptyState ?? (\n <p className=\"ds:m-0 type-body-sm ds:text-[color:var(--muted-foreground)]\">\n {t('notesPanel.empty', { defaultValue: 'No notes yet.' })}\n </p>\n ))\n )}\n </div>\n\n {onDeleteNote && confirmDelete ? (\n <Dialog\n open={pendingDelete !== null}\n onOpenChange={(next) => !next && setPendingDelete(null)}\n >\n <Dialog.Content variant=\"alert\" size=\"sm\">\n <Dialog.Header>\n <Dialog.Title>\n {t('notesPanel.deleteConfirmTitle', {\n defaultValue: 'Delete this note?',\n })}\n </Dialog.Title>\n </Dialog.Header>\n <Dialog.Body>\n <Dialog.Description>\n {t('notesPanel.deleteConfirmBody', {\n defaultValue: 'The note will be removed from the record.',\n })}\n </Dialog.Description>\n </Dialog.Body>\n <Dialog.Footer>\n <Dialog.Close asChild>\n <Button\n intent=\"secondary\"\n size=\"sm\"\n onClick={() => setPendingDelete(null)}\n >\n {t('notesPanel.deleteConfirmCancel', {\n defaultValue: 'Cancel',\n })}\n </Button>\n </Dialog.Close>\n <Button\n intent=\"destructive\"\n size=\"sm\"\n onClick={confirmDeleteNote}\n >\n {t('notesPanel.deleteConfirmAction', {\n defaultValue: 'Delete',\n })}\n </Button>\n </Dialog.Footer>\n </Dialog.Content>\n </Dialog>\n ) : null}\n </section>\n );\n },\n);\n"],"names":["getErrorMessage","error","fallback","notesPanelAgent","handle","args","noteItemVariants","cva","noteLeavingClass","noteElevationClass","hasRichContent","html","NotesPanel","forwardRef","id","notes","onAddNote","status","onRetry","currentNoteId","currentNoteKey","composer","editorToolbar","redactor","imageUploadUrl","showClinicalToggle","canAddClinicalNote","clinicalGatedReason","defaultClinical","onRequestAiDraft","aiDraftFormat","aiPrivacyNotice","onDictate","onProofread","onAutoFormat","onTogglePin","onToggleFlag","noteActions","onDeleteNote","confirmDelete","title","composerPlaceholder","addNoteLabel","emptyState","className","ariaLabel","rest","ref","t","useTranslation","editorRef","useRef","draft","setDraft","useState","clinical","setClinical","pending","setPending","addError","setAddError","heading","headingId","useId","placeholder","composerLabel","hasContent","commit","useCallback","rich","content","_a","reset","result","ordered","a","b","resolvedTheme","useTheme","reduceMotion","reflowRef","useListReflow","n","deleteExit","useExitTransition","pendingDelete","setPendingDelete","handleDeleteNote","noteId","confirmDeleteNote","currentItemRef","useEffect","_b","notesRef","onAddNoteRef","onTogglePinRef","onToggleFlagRef","canAddClinicalRef","currentNoteIdRef","rootRef","useImperativeHandle","useMemo","submission","note","useAgentRegistration","jsxs","jsx","PanelHeader","NotebookPen","RichTextEditor","TextArea","event","Checkbox","next","Button","Alert","Spinner","actions","index","isCurrent","leaving","REFLOW_ROW_CLASS","ClinicalNoteCard","Fragment","IconButton","Trash2","Dialog"],"mappings":";;;;;;;;;;;;;;;;;;;AACO,SAASA,GAAgBC,GAAgBC,GAA0B;AACxE,SACE,OAAOD,KAAU,YACjBA,MAAU,QACV,aAAaA,KACb,OAAOA,EAAM,WAAY,YACzBA,EAAM,QAAQ,SAEPA,EAAM,UAERC;AACT;ACOO,MAAMC,KAAkD;AAAA,EAC7D,IAAI;AAAA;AAAA;AAAA,EAGJ,cAAc,CAAC,QAAQ;AAAA,EACvB,OAAO;AAA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