@alfadocs/ui-kit-debug 1.37.0 → 1.38.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (101) hide show
  1. package/dist/_chunks/{agenda-tray-DYGCTIWB.js → agenda-tray-CG6jUjKc.js} +2 -2
  2. package/dist/_chunks/{agenda-tray-DYGCTIWB.js.map → agenda-tray-CG6jUjKc.js.map} +1 -1
  3. package/dist/_chunks/{anamnesis-summary-card-GYHa7VGp.js → anamnesis-summary-card-CclBbiXg.js} +2 -2
  4. package/dist/_chunks/{anamnesis-summary-card-GYHa7VGp.js.map → anamnesis-summary-card-CclBbiXg.js.map} +1 -1
  5. package/dist/_chunks/{appointment-timeline-ByfovxqR.js → appointment-timeline-D-rNwKpS.js} +2 -2
  6. package/dist/_chunks/{appointment-timeline-ByfovxqR.js.map → appointment-timeline-D-rNwKpS.js.map} +1 -1
  7. package/dist/_chunks/{appointment-tray-D6UyJHej.js → appointment-tray-CK2CULg_.js} +2 -2
  8. package/dist/_chunks/{appointment-tray-D6UyJHej.js.map → appointment-tray-CK2CULg_.js.map} +1 -1
  9. package/dist/_chunks/{balance-badge-cell-B0Z8Dwn8.js → balance-badge-cell-DHs5p0bA.js} +2 -2
  10. package/dist/_chunks/{balance-badge-cell-B0Z8Dwn8.js.map → balance-badge-cell-DHs5p0bA.js.map} +1 -1
  11. package/dist/_chunks/{booking-Dp-9qR6F.js → booking-x3J7sS2G.js} +3 -3
  12. package/dist/_chunks/{booking-Dp-9qR6F.js.map → booking-x3J7sS2G.js.map} +1 -1
  13. package/dist/_chunks/{calendar-workspace-BqKBj26r.js → calendar-workspace-Cc1LRVWY.js} +1665 -1480
  14. package/dist/_chunks/calendar-workspace-Cc1LRVWY.js.map +1 -0
  15. package/dist/_chunks/{data-table-BYGK-gUJ.js → data-table-Dy1lyumT.js} +2 -2
  16. package/dist/_chunks/{data-table-BYGK-gUJ.js.map → data-table-Dy1lyumT.js.map} +1 -1
  17. package/dist/_chunks/editable-description-7ptNpJEg.js +142 -0
  18. package/dist/_chunks/editable-description-7ptNpJEg.js.map +1 -0
  19. package/dist/_chunks/{file-manager-DvkFgj7d.js → file-manager-UlcYQv8n.js} +3 -3
  20. package/dist/_chunks/{file-manager-DvkFgj7d.js.map → file-manager-UlcYQv8n.js.map} +1 -1
  21. package/dist/_chunks/{message-tray-BcLyaO-G.js → message-tray-CXjVsKqp.js} +2 -2
  22. package/dist/_chunks/{message-tray-BcLyaO-G.js.map → message-tray-CXjVsKqp.js.map} +1 -1
  23. package/dist/_chunks/{note-timeline-CXfSV3yX.js → note-timeline-D2oPuQP6.js} +134 -73
  24. package/dist/_chunks/note-timeline-D2oPuQP6.js.map +1 -0
  25. package/dist/_chunks/notes-panel-CkbfDDzj.js +614 -0
  26. package/dist/_chunks/notes-panel-CkbfDDzj.js.map +1 -0
  27. package/dist/_chunks/{notification-tray-CJ8jOe-U.js → notification-tray-_NoChRKi.js} +2 -2
  28. package/dist/_chunks/{notification-tray-CJ8jOe-U.js.map → notification-tray-_NoChRKi.js.map} +1 -1
  29. package/dist/_chunks/{patient-summary-card-BzmJH9a-.js → patient-summary-card-B131Q7Bp.js} +2 -2
  30. package/dist/_chunks/{patient-summary-card-BzmJH9a-.js.map → patient-summary-card-B131Q7Bp.js.map} +1 -1
  31. package/dist/_chunks/{practice-results-DOcORTkP.js → practice-results-CBNRJNnY.js} +2 -2
  32. package/dist/_chunks/{practice-results-DOcORTkP.js.map → practice-results-CBNRJNnY.js.map} +1 -1
  33. package/dist/_chunks/{product-hub-panel-C0TO69P7.js → product-hub-panel-C3bMjscm.js} +2 -2
  34. package/dist/_chunks/{product-hub-panel-C0TO69P7.js.map → product-hub-panel-C3bMjscm.js.map} +1 -1
  35. package/dist/_chunks/{reviews-panel-BaHZb_ai.js → reviews-panel-Cy969x7q.js} +2 -2
  36. package/dist/_chunks/{reviews-panel-BaHZb_ai.js.map → reviews-panel-Cy969x7q.js.map} +1 -1
  37. package/dist/_chunks/{signature-request-Dej2g86d.js → signature-request-b-86AGlT.js} +2 -2
  38. package/dist/_chunks/{signature-request-Dej2g86d.js.map → signature-request-b-86AGlT.js.map} +1 -1
  39. package/dist/_chunks/{skeleton-CZbwyJAA.js → skeleton-B1KTdJ4N.js} +46 -33
  40. package/dist/_chunks/skeleton-B1KTdJ4N.js.map +1 -0
  41. package/dist/_chunks/{slot-grid-8Ko6thzz.js → slot-grid-Bk3GZL1p.js} +2 -2
  42. package/dist/_chunks/{slot-grid-8Ko6thzz.js.map → slot-grid-Bk3GZL1p.js.map} +1 -1
  43. package/dist/_chunks/{task-tray-CQ8UAR2j.js → task-tray-5co9Jr2L.js} +2 -2
  44. package/dist/_chunks/{task-tray-CQ8UAR2j.js.map → task-tray-5co9Jr2L.js.map} +1 -1
  45. package/dist/_chunks/{tasks-panel-CBGMtQ_f.js → tasks-panel-BpH-x7U3.js} +2 -2
  46. package/dist/_chunks/{tasks-panel-CBGMtQ_f.js.map → tasks-panel-BpH-x7U3.js.map} +1 -1
  47. package/dist/_chunks/treatment-receipt-dUm99mdn.js +160 -0
  48. package/dist/_chunks/treatment-receipt-dUm99mdn.js.map +1 -0
  49. package/dist/agent-catalog.json +1 -1
  50. package/dist/components/agenda-tray/index.js +1 -1
  51. package/dist/components/anamnesis-summary-card/index.js +1 -1
  52. package/dist/components/appointment-card/index.js +1 -1
  53. package/dist/components/appointment-timeline/index.js +1 -1
  54. package/dist/components/booking/index.js +1 -1
  55. package/dist/components/data-table/index.js +1 -1
  56. package/dist/components/editable-description/editable-description.d.ts +6 -0
  57. package/dist/components/editable-description/editable-description.d.ts.map +1 -1
  58. package/dist/components/editable-description/index.js +1 -1
  59. package/dist/components/file-manager/index.js +1 -1
  60. package/dist/components/message-tray/index.js +1 -1
  61. package/dist/components/note-timeline/index.js +1 -1
  62. package/dist/components/note-timeline/note-timeline.d.ts +8 -0
  63. package/dist/components/note-timeline/note-timeline.d.ts.map +1 -1
  64. package/dist/components/notes-panel/index.js +1 -1
  65. package/dist/components/notes-panel/notes-panel.d.ts.map +1 -1
  66. package/dist/components/notification-tray/index.js +1 -1
  67. package/dist/components/patient-summary-card/index.js +1 -1
  68. package/dist/components/patient-table/index.js +1 -1
  69. package/dist/components/practice-results/index.js +1 -1
  70. package/dist/components/product-hub-tray/index.js +1 -1
  71. package/dist/components/reviews-panel/index.js +1 -1
  72. package/dist/components/skeleton/index.d.ts +1 -1
  73. package/dist/components/skeleton/index.d.ts.map +1 -1
  74. package/dist/components/skeleton/index.js +3 -2
  75. package/dist/components/skeleton/skeleton.d.ts +12 -0
  76. package/dist/components/skeleton/skeleton.d.ts.map +1 -1
  77. package/dist/components/slot-grid/index.js +1 -1
  78. package/dist/components/task-tray/index.js +1 -1
  79. package/dist/components/tasks-panel/index.js +1 -1
  80. package/dist/components/treatment-receipt/index.js +1 -1
  81. package/dist/components/treatment-receipt/treatment-receipt.d.ts +8 -0
  82. package/dist/components/treatment-receipt/treatment-receipt.d.ts.map +1 -1
  83. package/dist/index.js +755 -754
  84. package/dist/patterns/calendar/calendar-appointment-details.d.ts +1 -1
  85. package/dist/patterns/calendar/calendar-appointment-details.d.ts.map +1 -1
  86. package/dist/patterns/calendar/calendar-editor-hydration.d.ts +0 -2
  87. package/dist/patterns/calendar/calendar-editor-hydration.d.ts.map +1 -1
  88. package/dist/patterns/calendar/calendar.sheets.d.ts.map +1 -1
  89. package/dist/patterns/calendar/index.js +1 -1
  90. package/dist/patterns/signature-request/index.js +1 -1
  91. package/dist/tokens.css +1 -1
  92. package/package.json +1 -1
  93. package/dist/_chunks/calendar-workspace-BqKBj26r.js.map +0 -1
  94. package/dist/_chunks/editable-description-BOfAeY3T.js +0 -112
  95. package/dist/_chunks/editable-description-BOfAeY3T.js.map +0 -1
  96. package/dist/_chunks/note-timeline-CXfSV3yX.js.map +0 -1
  97. package/dist/_chunks/notes-panel-4y5JioWN.js +0 -556
  98. package/dist/_chunks/notes-panel-4y5JioWN.js.map +0 -1
  99. package/dist/_chunks/skeleton-CZbwyJAA.js.map +0 -1
  100. package/dist/_chunks/treatment-receipt-D4kOLXOk.js +0 -94
  101. package/dist/_chunks/treatment-receipt-D4kOLXOk.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notes-panel-CkbfDDzj.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 { Card } from '../card/card';\nimport { CONTENT_ENTER_CLASS, Skeleton } from '../skeleton/skeleton';\nimport { Dialog } from '../dialog';\nimport { NotebookPen, Pencil, 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 * Save an edit to an existing note. When provided, each note the reader may\n * edit gets a pencil; it loads the note into the SAME composer that writes\n * new notes, in place, so a rich note is edited as rich text and keeps its\n * formatting. Return a promise to hold the pending state; a rejection keeps\n * the draft. Hidden on `actions.edit: false` and on a deleted note.\n */\n onEditNote?: (\n id: string,\n submission: NotesPanelSubmission,\n ) => void | Promise<void>;\n /**\n * Let an edit change a note's clinical flag. Default `false`: the \"Clinical\n * note\" toggle is hidden while editing and the submission carries the\n * note's existing flag. Most hosts save a note's content only, and a live\n * toggle that changes nothing is a lie. Set `true` only when the host\n * persists `submission.clinical` on edit.\n */\n editClinical?: boolean;\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/* Body lines per placeholder note. Uneven, so three cards do not read as one\n repeated stamp. */\nconst NOTE_SKELETON_LINES = [3, 2, 3] as const;\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(/&nbsp;/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 onEditNote,\n editClinical = false,\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, i18n } = 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 // The note loaded into the composer for editing, or null when composing.\n const [editingId, setEditingId] = useState<string | null>(null);\n /* Settle in only when this content REPLACES a skeleton. Content that was\n simply there from the start must not fade: it would read as invisible\n for one animation to any test or reader that looks at once. */\n const followedLoading = useRef(false);\n if (status === 'loading') followedLoading.current = true;\n const enterClass = followedLoading.current ? CONTENT_ENTER_CLASS : '';\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 =\n editingId !== null\n ? t('notesPanel.edit', { defaultValue: 'Edit note' })\n : t('notesPanel.composerLabel', { defaultValue: 'New note' });\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 const save = editingId !== null ? onEditNote : onAddNote;\n if (!save || 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 setEditingId(null);\n };\n setAddError(null);\n let result: void | Promise<void>;\n try {\n result =\n editingId !== null && onEditNote\n ? onEditNote(editingId, { content, clinical })\n : 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 }, [\n composer,\n draft,\n clinical,\n defaultClinical,\n editingId,\n onAddNote,\n onEditNote,\n pending,\n t,\n ]);\n\n const clinicalToggleShown =\n showClinicalToggle && (editingId === null || editClinical);\n\n /* Every row carries the SAME action words, so each accessible name adds\n the note's own date: otherwise a screen reader hears a list of\n identical \"Edit note\" buttons. The tooltip keeps the short words. */\n const noteStamp = useCallback(\n (note: NotesPanelNote): string => {\n try {\n return new Intl.DateTimeFormat(i18n.language, {\n day: 'numeric',\n month: 'long',\n year: 'numeric',\n hour: '2-digit',\n minute: '2-digit',\n }).format(new Date(note.dateIso));\n } catch {\n return note.dateIso;\n }\n },\n [i18n.language],\n );\n\n /* ----- Edit in place: the composer takes the note, and gives it back ----- */\n const startEdit = useCallback(\n (note: NotesPanelNote) => {\n if (!note.id || pending) return;\n const content = note.content ?? '';\n setAddError(null);\n setEditingId(note.id);\n setClinical(note.clinical ?? false);\n setDraft(content);\n if (composer === 'rich') {\n editorRef.current?.clear();\n editorRef.current?.insertAtCursor(content, { asHtml: true });\n }\n editorRef.current?.focus();\n },\n [composer, pending],\n );\n const cancelEdit = useCallback(() => {\n if (composer === 'rich') editorRef.current?.clear();\n setDraft('');\n setClinical(defaultClinical);\n setAddError(null);\n setEditingId(null);\n }, [composer, defaultClinical]);\n // The note being edited went away (deleted, or another patient's notes\n // arrived): its draft must not be saved against whatever comes next.\n const editingStillThere =\n editingId === null ||\n notes.some((note) => note.id === editingId && !note.deleted);\n useEffect(() => {\n if (!editingStillThere) cancelEdit();\n }, [editingStillThere, cancelEdit]);\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 || editingId !== null ? (\n <div\n data-notes-panel-composer={editingId !== null ? 'edit' : 'add'}\n className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]\"\n >\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 clinicalToggleShown ? 'ds:justify-between' : 'ds:justify-end',\n ].join(' ')}\n >\n {clinicalToggleShown ? (\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 <span className=\"ds:flex ds:items-center ds:gap-[var(--spacing-xs)]\">\n {editingId !== null ? (\n <Button\n type=\"button\"\n size=\"sm\"\n intent=\"ghost\"\n onClick={cancelEdit}\n disabled={pending}\n >\n {t('notesPanel.cancelEdit', { defaultValue: 'Cancel' })}\n </Button>\n ) : null}\n <Button\n type=\"button\"\n size=\"sm\"\n onClick={commit}\n disabled={!hasContent}\n loading={pending}\n >\n {editingId !== null\n ? t('notesPanel.saveEdit', { defaultValue: 'Save note' })\n : (addNoteLabel ??\n t('notesPanel.add', { defaultValue: 'Add note' }))}\n </Button>\n </span>\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' && ordered.length === 0 ? (\n /* Note-shaped placeholders, not a spinner: the reader sees where\n the notes will land and how many to expect. The status text is\n for assistive tech only; sighted readers get the motion. */\n <div\n data-notes-panel-loading=\"\"\n aria-busy=\"true\"\n className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]\"\n >\n <span role=\"status\" className=\"ds:sr-only\">\n {t('notesPanel.loading')}\n </span>\n {NOTE_SKELETON_LINES.map((lines, index) => (\n <Card key={index} variant=\"elevated\" aria-hidden=\"true\">\n <Card.Body>\n <div className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]\">\n <div className=\"ds:flex ds:items-center ds:gap-[var(--spacing-sm)]\">\n <Skeleton\n variant=\"circular\"\n size=\"sm\"\n stagger={index * 2}\n />\n <div className=\"ds:flex ds:flex-1 ds:flex-col ds:gap-[var(--spacing-xs)]\">\n <Skeleton\n variant=\"text\"\n size=\"sm\"\n stagger={index * 2}\n width=\"40%\"\n />\n <Skeleton\n variant=\"text\"\n size=\"sm\"\n stagger={index * 2}\n width=\"25%\"\n />\n </div>\n </div>\n <Skeleton\n variant=\"text\"\n size=\"sm\"\n lines={lines}\n stagger={index * 2 + 1}\n />\n </div>\n </Card.Body>\n </Card>\n ))}\n </div>\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 {/* A refresh keeps the notes it has: real notes never give way to\n placeholders. The list is marked busy and says so to a reader. */}\n {status === 'loading' && ordered.length > 0 ? (\n <span role=\"status\" className=\"ds:sr-only\">\n {t('notesPanel.loading')}\n </span>\n ) : null}\n {ordered.length > 0 ? (\n <ul\n ref={reflowRef}\n aria-busy={status === 'loading' || undefined}\n className={`ds:m-0 ds:flex ds:list-none ds:flex-col ds:gap-[var(--spacing-sm)] ds:p-0 ${enterClass}`.trim()}\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 data-editing={editingId === noteId ? '' : undefined}\n className={[\n noteItemVariants({\n current: isCurrent || editingId === noteId,\n }),\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 {onEditNote &&\n noteId &&\n !note.deleted &&\n actions?.edit !== false ? (\n <IconButton\n icon={<Pencil />}\n intent=\"ghost\"\n size=\"sm\"\n aria-label={t('notesPanel.editNamed', {\n date: noteStamp(note),\n defaultValue: 'Edit note · {{date}}',\n })}\n tooltip={t('notesPanel.edit', {\n defaultValue: 'Edit note',\n })}\n aria-pressed={editingId === noteId}\n disabled={pending}\n data-notes-panel-edit=\"\"\n onClick={() =>\n editingId === noteId\n ? cancelEdit()\n : startEdit(note)\n }\n />\n ) : null}\n {onDeleteNote && noteId && !note.deleted ? (\n <IconButton\n icon={<Trash2 />}\n intent=\"ghost\"\n size=\"sm\"\n aria-label={t('notesPanel.deleteNamed', {\n date: noteStamp(note),\n defaultValue: 'Delete note · {{date}}',\n })}\n tooltip={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","NOTE_SKELETON_LINES","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","onEditNote","editClinical","onDeleteNote","confirmDelete","title","composerPlaceholder","addNoteLabel","emptyState","className","ariaLabel","rest","ref","t","i18n","useTranslation","editorRef","useRef","draft","setDraft","useState","clinical","setClinical","pending","setPending","addError","setAddError","editingId","setEditingId","followedLoading","enterClass","CONTENT_ENTER_CLASS","heading","headingId","useId","placeholder","composerLabel","hasContent","commit","useCallback","rich","content","_a","reset","result","clinicalToggleShown","noteStamp","note","startEdit","_b","_c","cancelEdit","editingStillThere","useEffect","ordered","a","b","resolvedTheme","useTheme","reduceMotion","reflowRef","useListReflow","n","deleteExit","useExitTransition","pendingDelete","setPendingDelete","handleDeleteNote","noteId","confirmDeleteNote","currentItemRef","notesRef","onAddNoteRef","onTogglePinRef","onToggleFlagRef","canAddClinicalRef","currentNoteIdRef","rootRef","useImperativeHandle","useMemo","submission","useAgentRegistration","jsxs","jsx","PanelHeader","NotebookPen","RichTextEditor","TextArea","event","Checkbox","next","Button","Alert","lines","index","Card","Skeleton","actions","isCurrent","leaving","REFLOW_ROW_CLASS","ClinicalNoteCard","Fragment","IconButton","Pencil","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;AAAA,IACL,OAAO;AAAA,MACL,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aACE;AAAA,MACF,MAAM,CAACC,MAAWA,EAAO,SAAA;AAAA,IAAS;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AS,CAACA,KAAQxB,EAAiB,IAAI;AAAA,cAEtD,4BAACwC,EAAO,SAAP,EAAe,SAAQ,SAAQ,MAAK,MACnC,UAAA;AAAA,gBAAA,gBAAAvB,EAACuB,EAAO,QAAP,EACC,UAAA,gBAAAvB,EAACuB,EAAO,OAAP,EACE,YAAE,iCAAiC;AAAA,kBAClC,cAAc;AAAA,gBAAA,CACf,GACH,EAAA,CACF;AAAA,gBACA,gBAAAvB,EAACuB,EAAO,MAAP,EACC,4BAACA,EAAO,aAAP,EACE,UAAA7F,EAAE,gCAAgC;AAAA,kBACjC,cAAc;AAAA,gBAAA,CACf,GACH,EAAA,CACF;AAAA,gBACA,gBAAAqE,EAACwB,EAAO,QAAP,EACC,UAAA;AAAA,kBAAA,gBAAAvB,EAACuB,EAAO,OAAP,EAAa,SAAO,IACnB,UAAA,gBAAAvB;AAAA,oBAACQ;AAAA,oBAAA;AAAA,sBACC,QAAO;AAAA,sBACP,MAAK;AAAA,sBACL,SAAS,MAAMzB,EAAiB,IAAI;AAAA,sBAEnC,YAAE,kCAAkC;AAAA,wBACnC,cAAc;AAAA,sBAAA,CACf;AAAA,oBAAA;AAAA,kBAAA,GAEL;AAAA,kBACA,gBAAAiB;AAAA,oBAACQ;AAAA,oBAAA;AAAA,sBACC,QAAO;AAAA,sBACP,MAAK;AAAA,sBACL,SAAStB;AAAA,sBAER,YAAE,kCAAkC;AAAA,wBACnC,cAAc;AAAA,sBAAA,CACf;AAAA,oBAAA;AAAA,kBAAA;AAAA,gBACH,EAAA,CACF;AAAA,cAAA,EAAA,CACF;AAAA,YAAA;AAAA,UAAA,IAEA;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAGV;AACF;"}
@@ -8,7 +8,7 @@ import { u as le } from "./use-isomorphic-layout-effect-BGfaCOP1.js";
8
8
  import { I as pe } from "./icon-button-8xqRnkdG.js";
9
9
  import { B as F } from "./button-nJaPh_HC.js";
10
10
  import { S as H } from "./separator-CYU_bGFn.js";
11
- import { S as b } from "./skeleton-CZbwyJAA.js";
11
+ import { S as b } from "./skeleton-B1KTdJ4N.js";
12
12
  import { C as fe } from "./counter-WsvRuum1.js";
13
13
  import { S as me } from "./scroll-area-BZOvUhwQ.js";
14
14
  import { N as ue } from "./notification-card-ChcK9Wat.js";
@@ -496,4 +496,4 @@ export {
496
496
  ze as N,
497
497
  ye as n
498
498
  };
499
- //# sourceMappingURL=notification-tray-CJ8jOe-U.js.map
499
+ //# sourceMappingURL=notification-tray-_NoChRKi.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"notification-tray-CJ8jOe-U.js","sources":["../../node_modules/lucide-react/dist/esm/icons/bell.mjs","../../src/components/notification-tray/notification-tray.agent.ts","../../src/components/notification-tray/notification-tray.tsx"],"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: \"M10.268 21a2 2 0 0 0 3.464 0\", key: \"vwvbt9\" }],\n [\n \"path\",\n {\n d: \"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326\",\n key: \"11g9vi\"\n }\n ]\n];\nconst Bell = createLucideIcon(\"bell\", __iconNode);\n\nexport { __iconNode, Bell as default };\n//# sourceMappingURL=bell.mjs.map\n","/* -------------------------------------------------------------------- */\n/* Agent adapter — NotificationTray. */\n/* */\n/* Tray-level surface: an agent can open / close the panel, read the */\n/* current items (id + read flag only — never PHI), and route per-item */\n/* operations (dismiss, mark_read, select) through the curated handle. */\n/* All actions are routed through the imperative handle; the adapter */\n/* never touches the DOM directly. */\n/* -------------------------------------------------------------------- */\n\nimport type { AgentAdapter } from '../../agent/types';\nimport type { NotificationTrayHandle } from './notification-tray';\n\nexport const notificationTrayAgent: AgentAdapter<NotificationTrayHandle> = {\n id: 'notification-tray',\n capabilities: ['open', 'close', 'select_single', 'dismiss', 'navigate'],\n state: {\n items: {\n type: 'Array<{ id: string; read: boolean }>',\n descriptionKey: 'ui.agent.notificationTray.state.items',\n description:\n 'Currently-displayed notifications. Ids + read flag only — no PHI.',\n read: (handle) => handle.getItems(),\n },\n unreadCount: {\n type: 'number',\n descriptionKey: 'ui.agent.notificationTray.state.unreadCount',\n description: 'Badge unread count surfaced by the host.',\n read: (handle) => handle.getUnreadCount(),\n },\n isOpen: {\n type: 'boolean',\n descriptionKey: 'ui.agent.notificationTray.state.isOpen',\n description: 'Whether the dropdown panel is currently open.',\n read: (handle) => handle.isOpen(),\n },\n },\n actions: {\n open: {\n safety: 'read',\n idempotent: true,\n descriptionKey: 'ui.agent.notificationTray.actions.open',\n description: 'Open the notification panel.',\n invoke: (handle) => {\n handle.open();\n },\n },\n close: {\n safety: 'read',\n idempotent: true,\n descriptionKey: 'ui.agent.notificationTray.actions.close',\n description: 'Close the notification panel.',\n invoke: (handle) => {\n handle.close();\n },\n },\n select_item: {\n safety: 'read',\n argsType: '{ id: string }',\n argsSchema: {\n type: 'object',\n properties: { id: { type: 'string' } },\n required: ['id'],\n },\n idempotent: true,\n errors: ['No notification matches the given id.'],\n examples: [{ args: { id: 'notif-1' } }],\n descriptionKey: 'ui.agent.notificationTray.actions.selectItem',\n description: 'Activate the notification with the given id.',\n invoke: (handle, args: { id: string }) => {\n handle.selectItem(args.id);\n },\n },\n mark_read: {\n safety: 'write',\n argsType: '{ id: string }',\n argsSchema: {\n type: 'object',\n properties: { id: { type: 'string' } },\n required: ['id'],\n },\n idempotent: true,\n errors: ['No notification matches the given id.'],\n examples: [{ args: { id: 'notif-1' } }],\n descriptionKey: 'ui.agent.notificationTray.actions.markRead',\n description: 'Request the host to mark a notification as read.',\n invoke: (handle, args: { id: string }) => {\n handle.markRead(args.id);\n },\n },\n dismiss: {\n safety: 'destructive',\n argsType: '{ id: string }',\n argsSchema: {\n type: 'object',\n properties: { id: { type: 'string' } },\n required: ['id'],\n },\n idempotent: true,\n errors: ['No notification matches the given id.'],\n examples: [{ args: { id: 'notif-1' } }],\n descriptionKey: 'ui.agent.notificationTray.actions.dismiss',\n description:\n 'Request the host to dismiss the notification with the given id.',\n invoke: (handle, args: { id: string }) => {\n handle.dismiss(args.id);\n },\n },\n mark_all_read: {\n safety: 'write',\n idempotent: true,\n descriptionKey: 'ui.agent.notificationTray.actions.markAllRead',\n description: 'Request the host to mark every notification as read.',\n invoke: (handle) => {\n handle.markAllRead();\n },\n },\n view_all: {\n safety: 'read',\n idempotent: true,\n descriptionKey: 'ui.agent.notificationTray.actions.viewAll',\n description: 'Navigate to the full notification list.',\n invoke: (handle) => {\n handle.viewAll();\n },\n },\n },\n domHooks: {\n root: {\n attr: 'data-component',\n value: 'notification-tray',\n description: 'Marks the NotificationTray wrapper.',\n },\n instanceId: {\n attr: 'data-component-id',\n sourceProp: 'id',\n description:\n 'Sourced from the id prop. Required to address a specific tray from the agent.',\n },\n item: {\n attr: 'data-notification-id',\n description:\n 'Stable notification id emitted on each rendered NotificationCard inside the tray.',\n },\n },\n};\n","import {\n forwardRef,\n useCallback,\n useEffect,\n useImperativeHandle,\n useMemo,\n useRef,\n useState,\n type HTMLAttributes,\n} from 'react';\nimport * as RadixPopover from '@radix-ui/react-popover';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\nimport { useControllableState } from '../../hooks/use-controllable-state';\nimport { useIsomorphicLayoutEffect } from '../../hooks/use-isomorphic-layout-effect';\nimport { Bell } from 'lucide-react';\nimport { IconButton } from '../button/icon-button';\nimport { Button } from '../button/button';\nimport { Separator } from '../separator/separator';\nimport { Skeleton } from '../skeleton/skeleton';\nimport { Counter } from '../counter/counter';\nimport { ScrollArea } from '../scroll-area/scroll-area';\nimport {\n NotificationCard,\n type NotificationItem,\n} from '../notification-card/notification-card';\nimport { useAgentRegistration } from '../../agent/registry';\nimport { notificationTrayAgent } from './notification-tray.agent';\n\n/* ------------------------------------------------------------------ */\n/* Types */\n/* ------------------------------------------------------------------ */\n\n/**\n * Curated imperative handle for NotificationTray. Exposed as the\n * forwardRef target so a future agent / MCP UI bridge can drive the\n * tray without touching the DOM. See `notification-tray.agent.ts`.\n */\nexport interface NotificationTrayHandle {\n open: () => void;\n close: () => void;\n isOpen: () => boolean;\n getItems: () => Array<{ id: string; read: boolean }>;\n getUnreadCount: () => number;\n selectItem: (id: string) => void;\n markRead: (id: string) => void;\n dismiss: (id: string) => void;\n /** Request the host to mark every notification as read (mirrors onMarkAllRead). */\n markAllRead: () => void;\n /** Navigate to the full notification list (mirrors onViewAll). */\n viewAll: () => void;\n}\n\nexport interface NotificationTrayProps\n extends\n Omit<\n HTMLAttributes<HTMLDivElement>,\n 'onClick' | 'children' | 'role' | 'id'\n >,\n VariantProps<typeof notificationTrayVariants> {\n /**\n * Stable instance id. Surfaced on the root as `data-component-id` so\n * an agent / MCP UI bridge can address this specific tray.\n */\n id?: string;\n /** Fires when the host should mark a single notification as read (used by agent integration). */\n onMarkRead?: (item: NotificationItem) => void;\n /** Notifications rendered in the dropdown panel. */\n items: NotificationItem[];\n /** Number of unseen notifications. Drives the badge count. */\n unseenCount?: number;\n /** Controlled open state. */\n open?: boolean;\n /** Fires when the open state changes. */\n onOpenChange?: (open: boolean) => void;\n /** Fires when the user activates an item (click or Enter/Space). */\n onItemClick?: (item: NotificationItem) => void;\n /** Fires when the user dismisses a notification. */\n onDismiss?: (item: NotificationItem) => void;\n /** Fires when the user clicks the header \"Mark all as read\" action. */\n onMarkAllRead?: () => void;\n /** When true the panel shows skeleton placeholders. */\n loading?: boolean;\n /** Advisory item count before the list scrolls. Consumers override the cap\n * via the `--notification-tray-max-block-size` custom property. */\n maxVisible?: number;\n /** When set renders a footer link that invokes `onViewAll`. */\n viewAllLabel?: string;\n /** Fires when the footer \"View all\" link is clicked. */\n onViewAll?: () => void;\n /** Panel alignment relative to the trigger. Default `'end'`. */\n align?: 'start' | 'center' | 'end';\n /** Side of the trigger to open on. Default `'bottom'`. */\n side?: 'top' | 'bottom';\n}\n\n/* ------------------------------------------------------------------ */\n/* CVA */\n/* ------------------------------------------------------------------ */\n\nconst notificationTrayVariants = cva(\n 'ds:relative ds:inline-flex ds:items-center',\n {\n variants: {\n size: {\n sm: '',\n md: '',\n },\n },\n defaultVariants: {\n size: 'md',\n },\n },\n);\n\nconst panelVariants = cva(\n [\n 'ds:flex ds:flex-col',\n 'ds:bg-[var(--popover)] ds:text-[var(--popover-foreground)]',\n // Subtle tokenized border pairs with the drop-shadow so the panel's\n // edge stays legible in dark themes (where the shadow alone reads as a\n // faint halo). `--card-border` is alpha-based (32% in dark, lighter in\n // light) so the edge cue stays soft rather than turning into a heavy\n // outline. The forced-colors override below upgrades the border to\n // `CanvasText` so HCM repaints a fully visible edge.\n 'ds:border ds:border-[color:var(--card-border)]',\n 'ds:rounded-[var(--radius-md)]',\n 'ds:shadow-[var(--shadow-lg)]',\n 'ds:z-[var(--z-popover)]',\n // Width: fluid below the design cap so narrow viewports keep a visible\n // gutter on *both* sides of the panel (shadow included). The legacy\n // `min-w` approach clamped at 20rem, which flush-mounted the panel\n // against the inline-start viewport edge on phones.\n 'ds:w-[min(24rem,calc(100vw-2*var(--spacing-md)))]',\n // Height: below the `sm` breakpoint the panel takes a near-full-screen\n // sheet shape so the user gets room to triage messages / notifications\n // without scrolling a tiny popover. `6rem` reserves space for the\n // Header (≈4rem) plus the sideOffset + collisionPadding (≈2rem).\n // Above `sm` it returns to `h-auto` so the list's own\n // `--*-tray-max-block-size` cap governs the height.\n 'ds:h-[calc(100dvh-6rem)] ds:sm:h-auto',\n 'ds:data-[state=open]:animate-in ds:data-[state=closed]:animate-out',\n 'ds:data-[state=closed]:fade-out-0 ds:data-[state=open]:fade-in-0',\n 'ds:data-[state=closed]:zoom-out-95 ds:data-[state=open]:zoom-in-95',\n 'ds:motion-reduce:transition-none ds:motion-reduce:animate-none',\n 'ds:focus-visible:outline-none',\n 'ds:forced-colors:border-[CanvasText]',\n ].join(' '),\n {\n variants: {\n size: {\n sm: 'ds:p-[var(--spacing-xs)]',\n md: 'ds:p-[var(--spacing-sm)]',\n },\n },\n defaultVariants: {\n size: 'md',\n },\n },\n);\n\n// The unread overlay is the kit `Counter` (variant `notification`, size\n// `md`) — a single source of truth for the red count badge. This tray only\n// owns the *placement*: anchored to the trigger's top-end corner, nudged\n// outward so the bell icon isn't covered.\nconst badgeOverlay =\n 'ds:absolute ds:-top-[var(--spacing-xs)] ds:-end-[var(--spacing-xs)] ds:pointer-events-none';\n\n/* ------------------------------------------------------------------ */\n/* Helpers */\n/* ------------------------------------------------------------------ */\n\nfunction formatBadgeCount(count: number, overflowLabel: string): string {\n return count > 99 ? overflowLabel : String(count);\n}\n\nfunction SkeletonRow() {\n return (\n <div\n aria-hidden=\"true\"\n className=\"ds:flex ds:items-start ds:gap-[var(--spacing-sm)] ds:p-[var(--spacing-sm)]\"\n >\n <Skeleton variant=\"circular\" size=\"sm\" />\n <div className=\"ds:flex-1 ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]\">\n <Skeleton variant=\"text\" size=\"md\" width=\"70%\" />\n <Skeleton variant=\"text\" size=\"sm\" width=\"90%\" />\n <Skeleton variant=\"text\" size=\"sm\" width=\"30%\" />\n </div>\n </div>\n );\n}\n\nfunction EmptyPanel() {\n const { t } = useTranslation();\n return (\n <div\n role=\"status\"\n aria-live=\"polite\"\n className=\"ds:flex ds:flex-col ds:items-center ds:justify-center ds:gap-[var(--spacing-xs)] ds:p-[var(--spacing-lg)] ds:text-center\"\n >\n <span\n aria-hidden=\"true\"\n className=\"ds:inline-flex ds:items-center ds:justify-center ds:size-10 ds:rounded-[var(--radius-full)] ds:bg-[color:var(--muted)] ds:text-[color:var(--muted-foreground)] ds:[&>svg]:size-5\"\n >\n <Bell />\n </span>\n <p className=\"type-title-item ds:text-[color:var(--foreground)]\">\n {t('notificationTray.noNotifications', 'No notifications')}\n </p>\n <p className=\"type-meta ds:text-[color:var(--muted-foreground)]\">\n {t(\n 'notificationTray.noNotificationsDescription',\n \"You're all caught up.\",\n )}\n </p>\n </div>\n );\n}\n\n/* ------------------------------------------------------------------ */\n/* Root */\n/* ------------------------------------------------------------------ */\n\nexport const NotificationTray = forwardRef<\n HTMLDivElement,\n NotificationTrayProps\n>(\n (\n {\n id,\n items,\n unseenCount,\n open,\n onOpenChange,\n onItemClick,\n onDismiss,\n onMarkRead,\n onMarkAllRead,\n loading = false,\n maxVisible,\n viewAllLabel,\n onViewAll,\n align = 'end',\n side = 'bottom',\n size = 'md',\n className,\n ...rest\n },\n ref,\n ) => {\n const { t } = useTranslation();\n\n const [isOpenRaw, handleOpenChange] = useControllableState<boolean>({\n value: open,\n defaultValue: false,\n onChange: onOpenChange,\n });\n const isOpen = isOpenRaw ?? false;\n\n /* Exit-animation list (AnimatePresence-style).\n * `displayed` holds an entry per card that's currently mounted, even\n * briefly after the consumer removes an item from `items`. When the\n * consumer drops an id from `items`, we flip that entry to\n * `leaving: true` for one animation cycle, then prune it. */\n type Displayed = { item: NotificationItem; leaving: boolean };\n const [displayed, setDisplayed] = useState<Displayed[]>(() =>\n items.map((item) => ({ item, leaving: false })),\n );\n\n const animationDurationMs = useCallback((): number => {\n if (typeof window === 'undefined') return 200;\n const raw = window\n .getComputedStyle(document.documentElement)\n .getPropertyValue('--animation-duration');\n if (!raw) return 200;\n const trimmed = raw.trim();\n const n = parseFloat(trimmed);\n if (!Number.isFinite(n)) return 200;\n return trimmed.endsWith('ms') ? n : n * 1000;\n }, []);\n\n // `useLayoutEffect` so the `leaving=true` flip applies in the same paint\n // as the consumer's `items` update. With `useEffect` the browser paints\n // once with the dismissed card still at `leaving=false` (no animation)\n // before the flag flips — a visible lag before the exit animation starts.\n useIsomorphicLayoutEffect(() => {\n setDisplayed((prev) => {\n const nextIds = new Set(items.map((i) => i.id));\n const prevIds = new Set(prev.map((d) => d.item.id));\n\n const merged: Displayed[] = prev.map((d) => {\n if (nextIds.has(d.item.id)) {\n const fresh = items.find((i) => i.id === d.item.id);\n return fresh\n ? { item: fresh, leaving: false }\n : { ...d, leaving: true };\n }\n return { ...d, leaving: true };\n });\n\n for (const i of items) {\n if (!prevIds.has(i.id)) merged.push({ item: i, leaving: false });\n }\n return merged;\n });\n }, [items]);\n\n useEffect(() => {\n if (!displayed.some((d) => d.leaving)) return;\n const ms = animationDurationMs();\n const timer = setTimeout(() => {\n setDisplayed((prev) => prev.filter((d) => !d.leaving));\n }, ms);\n return () => clearTimeout(timer);\n }, [displayed, animationDurationMs]);\n\n /* Polite live region — announces when a new unread notification\n floats to the top of the list, even with the panel closed. */\n const liveRegionRef = useRef<HTMLDivElement | null>(null);\n const lastTopIdRef = useRef<string | undefined>(items[0]?.id);\n\n useEffect(() => {\n const topId = items[0]?.id;\n const prev = lastTopIdRef.current;\n if (prev && topId && prev !== topId && liveRegionRef.current) {\n const newest = items[0];\n if (newest && !newest.read) {\n liveRegionRef.current.textContent = t(\n 'notificationTray.newNotification',\n {\n title: newest.title,\n defaultValue: 'New notification: {{title}}',\n },\n );\n }\n }\n lastTopIdRef.current = topId;\n }, [items, t]);\n\n const displayCount = unseenCount ?? 0;\n const triggerAriaLabel =\n displayCount > 0\n ? t('notificationTray.triggerLabel', {\n count: displayCount,\n defaultValue: 'Notifications, {{count}} unread',\n })\n : t('notificationTray.triggerLabelNone', 'Notifications, none unread');\n\n const badgeLabel = formatBadgeCount(\n displayCount,\n t('notificationTray.badgeCountOverflow', '99+'),\n );\n\n const panelClass = panelVariants({ size });\n\n /* Curated imperative handle for agent integration. Pure look-ups +\n * delegations into the consumer-supplied callbacks; never touches the\n * DOM. See notification-tray.agent.ts. */\n const itemsRef = useRef<NotificationItem[]>(items);\n itemsRef.current = items;\n const unseenRef = useRef<number | undefined>(unseenCount);\n unseenRef.current = unseenCount;\n const isOpenRef = useRef<boolean>(isOpen);\n isOpenRef.current = isOpen;\n\n const handle = useMemo<NotificationTrayHandle>(\n () => ({\n open: () => handleOpenChange(true),\n close: () => handleOpenChange(false),\n isOpen: () => isOpenRef.current,\n getItems: () =>\n itemsRef.current.map((i) => ({ id: i.id, read: !!i.read })),\n getUnreadCount: () =>\n unseenRef.current ?? itemsRef.current.filter((i) => !i.read).length,\n selectItem: (targetId: string) => {\n const found = itemsRef.current.find((i) => i.id === targetId);\n if (found) onItemClick?.(found);\n },\n markRead: (targetId: string) => {\n const found = itemsRef.current.find((i) => i.id === targetId);\n if (found) onMarkRead?.(found);\n },\n dismiss: (targetId: string) => {\n const found = itemsRef.current.find((i) => i.id === targetId);\n if (found) onDismiss?.(found);\n },\n markAllRead: () => onMarkAllRead?.(),\n viewAll: () => onViewAll?.(),\n }),\n [\n handleOpenChange,\n onItemClick,\n onMarkRead,\n onDismiss,\n onMarkAllRead,\n onViewAll,\n ],\n );\n\n const rootRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => rootRef.current as HTMLDivElement, []);\n useAgentRegistration(notificationTrayAgent, handle, id);\n\n return (\n <div\n ref={rootRef}\n data-component=\"notification-tray\"\n data-component-id={id}\n className={[notificationTrayVariants({ size }), className]\n .filter(Boolean)\n .join(' ')}\n {...rest}\n >\n <RadixPopover.Root open={isOpen} onOpenChange={handleOpenChange}>\n <RadixPopover.Trigger asChild>\n <IconButton\n icon={<Bell />}\n intent=\"outline\"\n size={size === 'sm' ? 'sm' : 'md'}\n aria-label={triggerAriaLabel}\n aria-haspopup=\"dialog\"\n />\n </RadixPopover.Trigger>\n {displayCount > 0 ? (\n <Counter\n variant=\"notification\"\n size=\"md\"\n aria-hidden=\"true\"\n data-testid=\"notification-tray-badge\"\n className={badgeOverlay}\n >\n {badgeLabel}\n </Counter>\n ) : null}\n {/* Live region sits outside the popover so it announces even\n while the panel is closed. */}\n <div\n ref={liveRegionRef}\n aria-live=\"polite\"\n aria-atomic=\"true\"\n className=\"ds:sr-only\"\n />\n <RadixPopover.Portal>\n <RadixPopover.Content\n role=\"dialog\"\n aria-label={t('notificationTray.panelTitle', 'Notifications')}\n side={side}\n align={align}\n sideOffset={8}\n // `spacing-md` (16px) keeps Radix's collision-avoidance from\n // flush-mounting the panel against the viewport edge when the\n // trigger is near the inline-end of a narrow screen.\n collisionPadding={16}\n className={panelClass}\n >\n <div className=\"ds:flex ds:items-center ds:justify-between ds:gap-[var(--spacing-sm)] ds:ps-[var(--spacing-sm)] ds:pe-[var(--spacing-sm)] ds:pb-[var(--spacing-xs)]\">\n <h3 className=\"ds:m-0 type-title-card ds:text-[color:var(--foreground)]\">\n {t('notificationTray.panelTitle', 'Notifications')}\n </h3>\n {onMarkAllRead && items.some((item) => !item.read) ? (\n <Button\n intent=\"link\"\n size=\"sm\"\n onClick={onMarkAllRead}\n className=\"ds:text-[length:var(--font-size-xs)]\"\n >\n {t('notificationTray.markAllRead', 'Mark all as read')}\n </Button>\n ) : null}\n </div>\n <Separator />\n {/* Cap at ~24rem so ~5 items fit before the list scrolls.\n Consumers override via the --notification-tray-max-block-size\n custom property on the root element. */}\n {/* Below `sm` the panel is a near-full-screen sheet (see\n `panelVariants`) and the list expands to fill the remaining\n space with `flex-1`. Above `sm` the list caps at the\n `--notification-tray-max-block-size` custom property so the\n popover stays compact. ScrollArea owns the overflow + the\n token-styled 8px overlay scrollbar. */}\n <ScrollArea\n orientation=\"vertical\"\n className=\"ds:flex-1 ds:sm:flex-none ds:sm:[max-block-size:var(--notification-tray-max-block-size,24rem)]\"\n >\n <div\n // `role=\"list\"` requires `listitem` children — applied only\n // when we render NotificationCards. The empty / loading\n // states render a `role=\"status\"` panel which would violate\n // aria-required-children if the list role were always on.\n role={loading || displayed.length === 0 ? undefined : 'list'}\n data-max-visible={maxVisible}\n className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-xs)] ds:pt-[var(--spacing-xs)]\"\n >\n {loading ? (\n <>\n <SkeletonRow />\n <SkeletonRow />\n <SkeletonRow />\n </>\n ) : displayed.length === 0 ? (\n <EmptyPanel />\n ) : (\n displayed.map(({ item, leaving }) => (\n <NotificationCard\n key={item.id}\n item={item}\n variant=\"compact\"\n leaving={leaving}\n onActivate={onItemClick}\n onDismiss={onDismiss}\n data-notification-id={item.id}\n />\n ))\n )}\n </div>\n </ScrollArea>\n {viewAllLabel ? (\n <>\n <Separator />\n <div className=\"ds:pt-[var(--spacing-xs)]\">\n <Button\n intent=\"link\"\n size=\"sm\"\n onClick={onViewAll}\n className=\"ds:w-full ds:justify-center\"\n >\n {viewAllLabel}\n </Button>\n </div>\n </>\n ) : null}\n </RadixPopover.Content>\n </RadixPopover.Portal>\n </RadixPopover.Root>\n </div>\n );\n },\n);\n\nNotificationTray.displayName = 'NotificationTray';\n"],"names":["__iconNode","Bell","createLucideIcon","notificationTrayAgent","handle","args","notificationTrayVariants","cva","panelVariants","badgeOverlay","formatBadgeCount","count","overflowLabel","SkeletonRow","jsxs","jsx","Skeleton","EmptyPanel","useTranslation","NotificationTray","forwardRef","id","items","unseenCount","open","onOpenChange","onItemClick","onDismiss","onMarkRead","onMarkAllRead","loading","maxVisible","viewAllLabel","onViewAll","align","side","size","className","rest","ref","t","isOpenRaw","handleOpenChange","useControllableState","isOpen","displayed","setDisplayed","useState","item","animationDurationMs","useCallback","raw","trimmed","n","useIsomorphicLayoutEffect","prev","nextIds","i","prevIds","d","merged","fresh","useEffect","ms","timer","liveRegionRef","useRef","lastTopIdRef","_a","topId","newest","displayCount","triggerAriaLabel","badgeLabel","panelClass","itemsRef","unseenRef","isOpenRef","useMemo","targetId","found","rootRef","useImperativeHandle","useAgentRegistration","RadixPopover","IconButton","Counter","Button","Separator","ScrollArea","Fragment","leaving","NotificationCard"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,MAAMA,KAAa;AAAA,EACjB,CAAC,QAAQ,EAAE,GAAG,gCAAgC,KAAK,SAAQ,CAAE;AAAA,EAC7D;AAAA,IACE;AAAA,IACA;AAAA,MACE,GAAG;AAAA,MACH,KAAK;AAAA,IACX;AAAA,EACA;AACA,GACMC,IAAOC,GA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,WAAAC;AAAA,4BACA,wBAAsBqB,EAAK;AAAA,0BAAA;AAAA,0BANtBA,EAAK;AAAA,wBAAA,CAQb;AAAA,sBAAA;AAAA,oBAAA;AAAA,kBAEL;AAAA,gBAAA;AAAA,gBAEDhB,IACC,gBAAAlB,EAAA4E,GAAA,EACE,UAAA;AAAA,kBAAA,gBAAA3E,EAACyE,GAAA,EAAU;AAAA,kBACX,gBAAAzE,EAAC,OAAA,EAAI,WAAU,6BACb,UAAA,gBAAAA;AAAA,oBAACwE;AAAA,oBAAA;AAAA,sBACC,QAAO;AAAA,sBACP,MAAK;AAAA,sBACL,SAAStD;AAAA,sBACT,WAAU;AAAA,sBAET,UAAAD;AAAA,oBAAA;AAAA,kBAAA,EACH,CACF;AAAA,gBAAA,EAAA,CACF,IACE;AAAA,cAAA;AAAA,YAAA;AAAA,UAAA,EACN,CACF;AAAA,QAAA,EAAA,CACF;AAAA,MAAA;AAAA,IAAA;AAAA,EAGN;AACF;AAEAb,GAAiB,cAAc;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"notification-tray-_NoChRKi.js","sources":["../../node_modules/lucide-react/dist/esm/icons/bell.mjs","../../src/components/notification-tray/notification-tray.agent.ts","../../src/components/notification-tray/notification-tray.tsx"],"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: \"M10.268 21a2 2 0 0 0 3.464 0\", key: \"vwvbt9\" }],\n [\n \"path\",\n {\n d: \"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326\",\n key: \"11g9vi\"\n }\n ]\n];\nconst Bell = createLucideIcon(\"bell\", __iconNode);\n\nexport { __iconNode, Bell as default };\n//# sourceMappingURL=bell.mjs.map\n","/* -------------------------------------------------------------------- */\n/* Agent adapter — NotificationTray. */\n/* */\n/* Tray-level surface: an agent can open / close the panel, read the */\n/* current items (id + read flag only — never PHI), and route per-item */\n/* operations (dismiss, mark_read, select) through the curated handle. */\n/* All actions are routed through the imperative handle; the adapter */\n/* never touches the DOM directly. */\n/* -------------------------------------------------------------------- */\n\nimport type { AgentAdapter } from '../../agent/types';\nimport type { NotificationTrayHandle } from './notification-tray';\n\nexport const notificationTrayAgent: AgentAdapter<NotificationTrayHandle> = {\n id: 'notification-tray',\n capabilities: ['open', 'close', 'select_single', 'dismiss', 'navigate'],\n state: {\n items: {\n type: 'Array<{ id: string; read: boolean }>',\n descriptionKey: 'ui.agent.notificationTray.state.items',\n description:\n 'Currently-displayed notifications. Ids + read flag only — no PHI.',\n read: (handle) => handle.getItems(),\n },\n unreadCount: {\n type: 'number',\n descriptionKey: 'ui.agent.notificationTray.state.unreadCount',\n description: 'Badge unread count surfaced by the host.',\n read: (handle) => handle.getUnreadCount(),\n },\n isOpen: {\n type: 'boolean',\n descriptionKey: 'ui.agent.notificationTray.state.isOpen',\n description: 'Whether the dropdown panel is currently open.',\n read: (handle) => handle.isOpen(),\n },\n },\n actions: {\n open: {\n safety: 'read',\n idempotent: true,\n descriptionKey: 'ui.agent.notificationTray.actions.open',\n description: 'Open the notification panel.',\n invoke: (handle) => {\n handle.open();\n },\n },\n close: {\n safety: 'read',\n idempotent: true,\n descriptionKey: 'ui.agent.notificationTray.actions.close',\n description: 'Close the notification panel.',\n invoke: (handle) => {\n handle.close();\n },\n },\n select_item: {\n safety: 'read',\n argsType: '{ id: string }',\n argsSchema: {\n type: 'object',\n properties: { id: { type: 'string' } },\n required: ['id'],\n },\n idempotent: true,\n errors: ['No notification matches the given id.'],\n examples: [{ args: { id: 'notif-1' } }],\n descriptionKey: 'ui.agent.notificationTray.actions.selectItem',\n description: 'Activate the notification with the given id.',\n invoke: (handle, args: { id: string }) => {\n handle.selectItem(args.id);\n },\n },\n mark_read: {\n safety: 'write',\n argsType: '{ id: string }',\n argsSchema: {\n type: 'object',\n properties: { id: { type: 'string' } },\n required: ['id'],\n },\n idempotent: true,\n errors: ['No notification matches the given id.'],\n examples: [{ args: { id: 'notif-1' } }],\n descriptionKey: 'ui.agent.notificationTray.actions.markRead',\n description: 'Request the host to mark a notification as read.',\n invoke: (handle, args: { id: string }) => {\n handle.markRead(args.id);\n },\n },\n dismiss: {\n safety: 'destructive',\n argsType: '{ id: string }',\n argsSchema: {\n type: 'object',\n properties: { id: { type: 'string' } },\n required: ['id'],\n },\n idempotent: true,\n errors: ['No notification matches the given id.'],\n examples: [{ args: { id: 'notif-1' } }],\n descriptionKey: 'ui.agent.notificationTray.actions.dismiss',\n description:\n 'Request the host to dismiss the notification with the given id.',\n invoke: (handle, args: { id: string }) => {\n handle.dismiss(args.id);\n },\n },\n mark_all_read: {\n safety: 'write',\n idempotent: true,\n descriptionKey: 'ui.agent.notificationTray.actions.markAllRead',\n description: 'Request the host to mark every notification as read.',\n invoke: (handle) => {\n handle.markAllRead();\n },\n },\n view_all: {\n safety: 'read',\n idempotent: true,\n descriptionKey: 'ui.agent.notificationTray.actions.viewAll',\n description: 'Navigate to the full notification list.',\n invoke: (handle) => {\n handle.viewAll();\n },\n },\n },\n domHooks: {\n root: {\n attr: 'data-component',\n value: 'notification-tray',\n description: 'Marks the NotificationTray wrapper.',\n },\n instanceId: {\n attr: 'data-component-id',\n sourceProp: 'id',\n description:\n 'Sourced from the id prop. Required to address a specific tray from the agent.',\n },\n item: {\n attr: 'data-notification-id',\n description:\n 'Stable notification id emitted on each rendered NotificationCard inside the tray.',\n },\n },\n};\n","import {\n forwardRef,\n useCallback,\n useEffect,\n useImperativeHandle,\n useMemo,\n useRef,\n useState,\n type HTMLAttributes,\n} from 'react';\nimport * as RadixPopover from '@radix-ui/react-popover';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\nimport { useControllableState } from '../../hooks/use-controllable-state';\nimport { useIsomorphicLayoutEffect } from '../../hooks/use-isomorphic-layout-effect';\nimport { Bell } from 'lucide-react';\nimport { IconButton } from '../button/icon-button';\nimport { Button } from '../button/button';\nimport { Separator } from '../separator/separator';\nimport { Skeleton } from '../skeleton/skeleton';\nimport { Counter } from '../counter/counter';\nimport { ScrollArea } from '../scroll-area/scroll-area';\nimport {\n NotificationCard,\n type NotificationItem,\n} from '../notification-card/notification-card';\nimport { useAgentRegistration } from '../../agent/registry';\nimport { notificationTrayAgent } from './notification-tray.agent';\n\n/* ------------------------------------------------------------------ */\n/* Types */\n/* ------------------------------------------------------------------ */\n\n/**\n * Curated imperative handle for NotificationTray. Exposed as the\n * forwardRef target so a future agent / MCP UI bridge can drive the\n * tray without touching the DOM. See `notification-tray.agent.ts`.\n */\nexport interface NotificationTrayHandle {\n open: () => void;\n close: () => void;\n isOpen: () => boolean;\n getItems: () => Array<{ id: string; read: boolean }>;\n getUnreadCount: () => number;\n selectItem: (id: string) => void;\n markRead: (id: string) => void;\n dismiss: (id: string) => void;\n /** Request the host to mark every notification as read (mirrors onMarkAllRead). */\n markAllRead: () => void;\n /** Navigate to the full notification list (mirrors onViewAll). */\n viewAll: () => void;\n}\n\nexport interface NotificationTrayProps\n extends\n Omit<\n HTMLAttributes<HTMLDivElement>,\n 'onClick' | 'children' | 'role' | 'id'\n >,\n VariantProps<typeof notificationTrayVariants> {\n /**\n * Stable instance id. Surfaced on the root as `data-component-id` so\n * an agent / MCP UI bridge can address this specific tray.\n */\n id?: string;\n /** Fires when the host should mark a single notification as read (used by agent integration). */\n onMarkRead?: (item: NotificationItem) => void;\n /** Notifications rendered in the dropdown panel. */\n items: NotificationItem[];\n /** Number of unseen notifications. Drives the badge count. */\n unseenCount?: number;\n /** Controlled open state. */\n open?: boolean;\n /** Fires when the open state changes. */\n onOpenChange?: (open: boolean) => void;\n /** Fires when the user activates an item (click or Enter/Space). */\n onItemClick?: (item: NotificationItem) => void;\n /** Fires when the user dismisses a notification. */\n onDismiss?: (item: NotificationItem) => void;\n /** Fires when the user clicks the header \"Mark all as read\" action. */\n onMarkAllRead?: () => void;\n /** When true the panel shows skeleton placeholders. */\n loading?: boolean;\n /** Advisory item count before the list scrolls. Consumers override the cap\n * via the `--notification-tray-max-block-size` custom property. */\n maxVisible?: number;\n /** When set renders a footer link that invokes `onViewAll`. */\n viewAllLabel?: string;\n /** Fires when the footer \"View all\" link is clicked. */\n onViewAll?: () => void;\n /** Panel alignment relative to the trigger. Default `'end'`. */\n align?: 'start' | 'center' | 'end';\n /** Side of the trigger to open on. Default `'bottom'`. */\n side?: 'top' | 'bottom';\n}\n\n/* ------------------------------------------------------------------ */\n/* CVA */\n/* ------------------------------------------------------------------ */\n\nconst notificationTrayVariants = cva(\n 'ds:relative ds:inline-flex ds:items-center',\n {\n variants: {\n size: {\n sm: '',\n md: '',\n },\n },\n defaultVariants: {\n size: 'md',\n },\n },\n);\n\nconst panelVariants = cva(\n [\n 'ds:flex ds:flex-col',\n 'ds:bg-[var(--popover)] ds:text-[var(--popover-foreground)]',\n // Subtle tokenized border pairs with the drop-shadow so the panel's\n // edge stays legible in dark themes (where the shadow alone reads as a\n // faint halo). `--card-border` is alpha-based (32% in dark, lighter in\n // light) so the edge cue stays soft rather than turning into a heavy\n // outline. The forced-colors override below upgrades the border to\n // `CanvasText` so HCM repaints a fully visible edge.\n 'ds:border ds:border-[color:var(--card-border)]',\n 'ds:rounded-[var(--radius-md)]',\n 'ds:shadow-[var(--shadow-lg)]',\n 'ds:z-[var(--z-popover)]',\n // Width: fluid below the design cap so narrow viewports keep a visible\n // gutter on *both* sides of the panel (shadow included). The legacy\n // `min-w` approach clamped at 20rem, which flush-mounted the panel\n // against the inline-start viewport edge on phones.\n 'ds:w-[min(24rem,calc(100vw-2*var(--spacing-md)))]',\n // Height: below the `sm` breakpoint the panel takes a near-full-screen\n // sheet shape so the user gets room to triage messages / notifications\n // without scrolling a tiny popover. `6rem` reserves space for the\n // Header (≈4rem) plus the sideOffset + collisionPadding (≈2rem).\n // Above `sm` it returns to `h-auto` so the list's own\n // `--*-tray-max-block-size` cap governs the height.\n 'ds:h-[calc(100dvh-6rem)] ds:sm:h-auto',\n 'ds:data-[state=open]:animate-in ds:data-[state=closed]:animate-out',\n 'ds:data-[state=closed]:fade-out-0 ds:data-[state=open]:fade-in-0',\n 'ds:data-[state=closed]:zoom-out-95 ds:data-[state=open]:zoom-in-95',\n 'ds:motion-reduce:transition-none ds:motion-reduce:animate-none',\n 'ds:focus-visible:outline-none',\n 'ds:forced-colors:border-[CanvasText]',\n ].join(' '),\n {\n variants: {\n size: {\n sm: 'ds:p-[var(--spacing-xs)]',\n md: 'ds:p-[var(--spacing-sm)]',\n },\n },\n defaultVariants: {\n size: 'md',\n },\n },\n);\n\n// The unread overlay is the kit `Counter` (variant `notification`, size\n// `md`) — a single source of truth for the red count badge. This tray only\n// owns the *placement*: anchored to the trigger's top-end corner, nudged\n// outward so the bell icon isn't covered.\nconst badgeOverlay =\n 'ds:absolute ds:-top-[var(--spacing-xs)] ds:-end-[var(--spacing-xs)] ds:pointer-events-none';\n\n/* ------------------------------------------------------------------ */\n/* Helpers */\n/* ------------------------------------------------------------------ */\n\nfunction formatBadgeCount(count: number, overflowLabel: string): string {\n return count > 99 ? overflowLabel : String(count);\n}\n\nfunction SkeletonRow() {\n return (\n <div\n aria-hidden=\"true\"\n className=\"ds:flex ds:items-start ds:gap-[var(--spacing-sm)] ds:p-[var(--spacing-sm)]\"\n >\n <Skeleton variant=\"circular\" size=\"sm\" />\n <div className=\"ds:flex-1 ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]\">\n <Skeleton variant=\"text\" size=\"md\" width=\"70%\" />\n <Skeleton variant=\"text\" size=\"sm\" width=\"90%\" />\n <Skeleton variant=\"text\" size=\"sm\" width=\"30%\" />\n </div>\n </div>\n );\n}\n\nfunction EmptyPanel() {\n const { t } = useTranslation();\n return (\n <div\n role=\"status\"\n aria-live=\"polite\"\n className=\"ds:flex ds:flex-col ds:items-center ds:justify-center ds:gap-[var(--spacing-xs)] ds:p-[var(--spacing-lg)] ds:text-center\"\n >\n <span\n aria-hidden=\"true\"\n className=\"ds:inline-flex ds:items-center ds:justify-center ds:size-10 ds:rounded-[var(--radius-full)] ds:bg-[color:var(--muted)] ds:text-[color:var(--muted-foreground)] ds:[&>svg]:size-5\"\n >\n <Bell />\n </span>\n <p className=\"type-title-item ds:text-[color:var(--foreground)]\">\n {t('notificationTray.noNotifications', 'No notifications')}\n </p>\n <p className=\"type-meta ds:text-[color:var(--muted-foreground)]\">\n {t(\n 'notificationTray.noNotificationsDescription',\n \"You're all caught up.\",\n )}\n </p>\n </div>\n );\n}\n\n/* ------------------------------------------------------------------ */\n/* Root */\n/* ------------------------------------------------------------------ */\n\nexport const NotificationTray = forwardRef<\n HTMLDivElement,\n NotificationTrayProps\n>(\n (\n {\n id,\n items,\n unseenCount,\n open,\n onOpenChange,\n onItemClick,\n onDismiss,\n onMarkRead,\n onMarkAllRead,\n loading = false,\n maxVisible,\n viewAllLabel,\n onViewAll,\n align = 'end',\n side = 'bottom',\n size = 'md',\n className,\n ...rest\n },\n ref,\n ) => {\n const { t } = useTranslation();\n\n const [isOpenRaw, handleOpenChange] = useControllableState<boolean>({\n value: open,\n defaultValue: false,\n onChange: onOpenChange,\n });\n const isOpen = isOpenRaw ?? false;\n\n /* Exit-animation list (AnimatePresence-style).\n * `displayed` holds an entry per card that's currently mounted, even\n * briefly after the consumer removes an item from `items`. When the\n * consumer drops an id from `items`, we flip that entry to\n * `leaving: true` for one animation cycle, then prune it. */\n type Displayed = { item: NotificationItem; leaving: boolean };\n const [displayed, setDisplayed] = useState<Displayed[]>(() =>\n items.map((item) => ({ item, leaving: false })),\n );\n\n const animationDurationMs = useCallback((): number => {\n if (typeof window === 'undefined') return 200;\n const raw = window\n .getComputedStyle(document.documentElement)\n .getPropertyValue('--animation-duration');\n if (!raw) return 200;\n const trimmed = raw.trim();\n const n = parseFloat(trimmed);\n if (!Number.isFinite(n)) return 200;\n return trimmed.endsWith('ms') ? n : n * 1000;\n }, []);\n\n // `useLayoutEffect` so the `leaving=true` flip applies in the same paint\n // as the consumer's `items` update. With `useEffect` the browser paints\n // once with the dismissed card still at `leaving=false` (no animation)\n // before the flag flips — a visible lag before the exit animation starts.\n useIsomorphicLayoutEffect(() => {\n setDisplayed((prev) => {\n const nextIds = new Set(items.map((i) => i.id));\n const prevIds = new Set(prev.map((d) => d.item.id));\n\n const merged: Displayed[] = prev.map((d) => {\n if (nextIds.has(d.item.id)) {\n const fresh = items.find((i) => i.id === d.item.id);\n return fresh\n ? { item: fresh, leaving: false }\n : { ...d, leaving: true };\n }\n return { ...d, leaving: true };\n });\n\n for (const i of items) {\n if (!prevIds.has(i.id)) merged.push({ item: i, leaving: false });\n }\n return merged;\n });\n }, [items]);\n\n useEffect(() => {\n if (!displayed.some((d) => d.leaving)) return;\n const ms = animationDurationMs();\n const timer = setTimeout(() => {\n setDisplayed((prev) => prev.filter((d) => !d.leaving));\n }, ms);\n return () => clearTimeout(timer);\n }, [displayed, animationDurationMs]);\n\n /* Polite live region — announces when a new unread notification\n floats to the top of the list, even with the panel closed. */\n const liveRegionRef = useRef<HTMLDivElement | null>(null);\n const lastTopIdRef = useRef<string | undefined>(items[0]?.id);\n\n useEffect(() => {\n const topId = items[0]?.id;\n const prev = lastTopIdRef.current;\n if (prev && topId && prev !== topId && liveRegionRef.current) {\n const newest = items[0];\n if (newest && !newest.read) {\n liveRegionRef.current.textContent = t(\n 'notificationTray.newNotification',\n {\n title: newest.title,\n defaultValue: 'New notification: {{title}}',\n },\n );\n }\n }\n lastTopIdRef.current = topId;\n }, [items, t]);\n\n const displayCount = unseenCount ?? 0;\n const triggerAriaLabel =\n displayCount > 0\n ? t('notificationTray.triggerLabel', {\n count: displayCount,\n defaultValue: 'Notifications, {{count}} unread',\n })\n : t('notificationTray.triggerLabelNone', 'Notifications, none unread');\n\n const badgeLabel = formatBadgeCount(\n displayCount,\n t('notificationTray.badgeCountOverflow', '99+'),\n );\n\n const panelClass = panelVariants({ size });\n\n /* Curated imperative handle for agent integration. Pure look-ups +\n * delegations into the consumer-supplied callbacks; never touches the\n * DOM. See notification-tray.agent.ts. */\n const itemsRef = useRef<NotificationItem[]>(items);\n itemsRef.current = items;\n const unseenRef = useRef<number | undefined>(unseenCount);\n unseenRef.current = unseenCount;\n const isOpenRef = useRef<boolean>(isOpen);\n isOpenRef.current = isOpen;\n\n const handle = useMemo<NotificationTrayHandle>(\n () => ({\n open: () => handleOpenChange(true),\n close: () => handleOpenChange(false),\n isOpen: () => isOpenRef.current,\n getItems: () =>\n itemsRef.current.map((i) => ({ id: i.id, read: !!i.read })),\n getUnreadCount: () =>\n unseenRef.current ?? itemsRef.current.filter((i) => !i.read).length,\n selectItem: (targetId: string) => {\n const found = itemsRef.current.find((i) => i.id === targetId);\n if (found) onItemClick?.(found);\n },\n markRead: (targetId: string) => {\n const found = itemsRef.current.find((i) => i.id === targetId);\n if (found) onMarkRead?.(found);\n },\n dismiss: (targetId: string) => {\n const found = itemsRef.current.find((i) => i.id === targetId);\n if (found) onDismiss?.(found);\n },\n markAllRead: () => onMarkAllRead?.(),\n viewAll: () => onViewAll?.(),\n }),\n [\n handleOpenChange,\n onItemClick,\n onMarkRead,\n onDismiss,\n onMarkAllRead,\n onViewAll,\n ],\n );\n\n const rootRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => rootRef.current as HTMLDivElement, []);\n useAgentRegistration(notificationTrayAgent, handle, id);\n\n return (\n <div\n ref={rootRef}\n data-component=\"notification-tray\"\n data-component-id={id}\n className={[notificationTrayVariants({ size }), className]\n .filter(Boolean)\n .join(' ')}\n {...rest}\n >\n <RadixPopover.Root open={isOpen} onOpenChange={handleOpenChange}>\n <RadixPopover.Trigger asChild>\n <IconButton\n icon={<Bell />}\n intent=\"outline\"\n size={size === 'sm' ? 'sm' : 'md'}\n aria-label={triggerAriaLabel}\n aria-haspopup=\"dialog\"\n />\n </RadixPopover.Trigger>\n {displayCount > 0 ? (\n <Counter\n variant=\"notification\"\n size=\"md\"\n aria-hidden=\"true\"\n data-testid=\"notification-tray-badge\"\n className={badgeOverlay}\n >\n {badgeLabel}\n </Counter>\n ) : null}\n {/* Live region sits outside the popover so it announces even\n while the panel is closed. */}\n <div\n ref={liveRegionRef}\n aria-live=\"polite\"\n aria-atomic=\"true\"\n className=\"ds:sr-only\"\n />\n <RadixPopover.Portal>\n <RadixPopover.Content\n role=\"dialog\"\n aria-label={t('notificationTray.panelTitle', 'Notifications')}\n side={side}\n align={align}\n sideOffset={8}\n // `spacing-md` (16px) keeps Radix's collision-avoidance from\n // flush-mounting the panel against the viewport edge when the\n // trigger is near the inline-end of a narrow screen.\n collisionPadding={16}\n className={panelClass}\n >\n <div className=\"ds:flex ds:items-center ds:justify-between ds:gap-[var(--spacing-sm)] ds:ps-[var(--spacing-sm)] ds:pe-[var(--spacing-sm)] ds:pb-[var(--spacing-xs)]\">\n <h3 className=\"ds:m-0 type-title-card ds:text-[color:var(--foreground)]\">\n {t('notificationTray.panelTitle', 'Notifications')}\n </h3>\n {onMarkAllRead && items.some((item) => !item.read) ? (\n <Button\n intent=\"link\"\n size=\"sm\"\n onClick={onMarkAllRead}\n className=\"ds:text-[length:var(--font-size-xs)]\"\n >\n {t('notificationTray.markAllRead', 'Mark all as read')}\n </Button>\n ) : null}\n </div>\n <Separator />\n {/* Cap at ~24rem so ~5 items fit before the list scrolls.\n Consumers override via the --notification-tray-max-block-size\n custom property on the root element. */}\n {/* Below `sm` the panel is a near-full-screen sheet (see\n `panelVariants`) and the list expands to fill the remaining\n space with `flex-1`. Above `sm` the list caps at the\n `--notification-tray-max-block-size` custom property so the\n popover stays compact. ScrollArea owns the overflow + the\n token-styled 8px overlay scrollbar. */}\n <ScrollArea\n orientation=\"vertical\"\n className=\"ds:flex-1 ds:sm:flex-none ds:sm:[max-block-size:var(--notification-tray-max-block-size,24rem)]\"\n >\n <div\n // `role=\"list\"` requires `listitem` children — applied only\n // when we render NotificationCards. The empty / loading\n // states render a `role=\"status\"` panel which would violate\n // aria-required-children if the list role were always on.\n role={loading || displayed.length === 0 ? undefined : 'list'}\n data-max-visible={maxVisible}\n className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-xs)] ds:pt-[var(--spacing-xs)]\"\n >\n {loading ? (\n <>\n <SkeletonRow />\n <SkeletonRow />\n <SkeletonRow />\n </>\n ) : displayed.length === 0 ? (\n <EmptyPanel />\n ) : (\n displayed.map(({ item, leaving }) => (\n <NotificationCard\n key={item.id}\n item={item}\n variant=\"compact\"\n leaving={leaving}\n onActivate={onItemClick}\n onDismiss={onDismiss}\n data-notification-id={item.id}\n />\n ))\n )}\n </div>\n </ScrollArea>\n {viewAllLabel ? (\n <>\n <Separator />\n <div className=\"ds:pt-[var(--spacing-xs)]\">\n <Button\n intent=\"link\"\n size=\"sm\"\n onClick={onViewAll}\n className=\"ds:w-full ds:justify-center\"\n >\n {viewAllLabel}\n </Button>\n </div>\n </>\n ) : null}\n </RadixPopover.Content>\n </RadixPopover.Portal>\n </RadixPopover.Root>\n </div>\n );\n },\n);\n\nNotificationTray.displayName = 'NotificationTray';\n"],"names":["__iconNode","Bell","createLucideIcon","notificationTrayAgent","handle","args","notificationTrayVariants","cva","panelVariants","badgeOverlay","formatBadgeCount","count","overflowLabel","SkeletonRow","jsxs","jsx","Skeleton","EmptyPanel","useTranslation","NotificationTray","forwardRef","id","items","unseenCount","open","onOpenChange","onItemClick","onDismiss","onMarkRead","onMarkAllRead","loading","maxVisible","viewAllLabel","onViewAll","align","side","size","className","rest","ref","t","isOpenRaw","handleOpenChange","useControllableState","isOpen","displayed","setDisplayed","useState","item","animationDurationMs","useCallback","raw","trimmed","n","useIsomorphicLayoutEffect","prev","nextIds","i","prevIds","d","merged","fresh","useEffect","ms","timer","liveRegionRef","useRef","lastTopIdRef","_a","topId","newest","displayCount","triggerAriaLabel","badgeLabel","panelClass","itemsRef","unseenRef","isOpenRef","useMemo","targetId","found","rootRef","useImperativeHandle","useAgentRegistration","RadixPopover","IconButton","Counter","Button","Separator","ScrollArea","Fragment","leaving","NotificationCard"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,MAAMA,KAAa;AAAA,EACjB,CAAC,QAAQ,EAAE,GAAG,gCAAgC,KAAK,SAAQ,CAAE;AAAA,EAC7D;AAAA,IACE;AAAA,IACA;AAAA,MACE,GAAG;AAAA,MACH,KAAK;AAAA,IACX;AAAA,EACA;AACA,GACMC,IAAOC,GAAiB,QAAQF,EAAU,GCNnCG,KAA8D;AAAA,EACzE,IAAI;AAAA,EACJ,cAAc,CAAC,QAAQ,SAAS,iBAAiB,WAAW,UAAU;AAAA,EACtE,OAAO;AAAA,IACL,OAAO;AAAA,MACL,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aACE;AAAA,MACF,MAAM,CAACC,MAAWA,EAAO,SAAA;AAAA,IAAS;AAAA,IAEpC,aAAa;AAAA,MACX,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aAAa;AAAA,MACb,MAAM,CAACA,MAAWA,EAAO,eAAA;AAAA,IAAe;AAAA,IAE1C,QAAQ;AAAA,MACN,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aAAa;AAAA,MACb,MAAM,CAACA,MAAWA,EAAO,OAAA;AAAA,IAAO;AAAA,EAClC;AAAA,EAEF,SAAS;AAAA,IACP,MAAM;AAAA,MACJ,QAAQ;AAAA,MACR,YAAY;AAAA,MACZ,gBAAgB;AAAA,MAChB,aAAa;AAAA,MACb,QAAQ,CAACA,MAAW;AAClB,QAAAA,EAAO,KAAA;AAAA,MACT;AAAA,IAAA;AAAA,IAEF,OAAO;AAAA,MACL,QAAQ;AAAA,MACR,YAAY;AAAA,MACZ,gBAAgB;AAAA,MAChB,aAAa;AAAA,MACb,QAAQ,CAACA,MAAW;AAClB,QAAAA,EAAO,MAAA;AAAA,MACT;AAAA,IAAA;AAAA,IAEF,aAAa;AAAA,MACX,QAAQ;AAAA,MACR,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;AAAA,4CACZA,GAAA,CAAA,CAAY;AAAA,wBAAA,EAAA,CACf,IACEgC,EAAU,WAAW,IACvB,gBAAA9B,EAACE,IAAA,CAAA,CAAW,IAEZ4B,EAAU,IAAI,CAAC,EAAE,MAAAG,GAAM,SAAA2C,QACrB,gBAAA5E;AAAA,0BAAC6E;AAAA,0BAAA;AAAA,4BAEC,MAAA5C;AAAA,4BACA,SAAQ;AAAA,4BACR,SAAA2C;AAAA,4BACA,YAAYjE;AAAA,4BACZ,WAAAC;AAAA,4BACA,wBAAsBqB,EAAK;AAAA,0BAAA;AAAA,0BANtBA,EAAK;AAAA,wBAAA,CAQb;AAAA,sBAAA;AAAA,oBAAA;AAAA,kBAEL;AAAA,gBAAA;AAAA,gBAEDhB,IACC,gBAAAlB,EAAA4E,GAAA,EACE,UAAA;AAAA,kBAAA,gBAAA3E,EAACyE,GAAA,EAAU;AAAA,kBACX,gBAAAzE,EAAC,OAAA,EAAI,WAAU,6BACb,UAAA,gBAAAA;AAAA,oBAACwE;AAAA,oBAAA;AAAA,sBACC,QAAO;AAAA,sBACP,MAAK;AAAA,sBACL,SAAStD;AAAA,sBACT,WAAU;AAAA,sBAET,UAAAD;AAAA,oBAAA;AAAA,kBAAA,EACH,CACF;AAAA,gBAAA,EAAA,CACF,IACE;AAAA,cAAA;AAAA,YAAA;AAAA,UAAA,EACN,CACF;AAAA,QAAA,EAAA,CACF;AAAA,MAAA;AAAA,IAAA;AAAA,EAGN;AACF;AAEAb,GAAiB,cAAc;","x_google_ignoreList":[0]}
@@ -8,7 +8,7 @@ import { I as Ue } from "./icon-button-8xqRnkdG.js";
8
8
  import { C as le } from "./card-DPmk26CL.js";
9
9
  import { K as Be, a as Re } from "./key-value-pair-DczGb4yz.js";
10
10
  import { L as V } from "./link-CPb_pZPr.js";
11
- import { S as k } from "./skeleton-CZbwyJAA.js";
11
+ import { S as k } from "./skeleton-B1KTdJ4N.js";
12
12
  import { T as oe } from "./tag-Ci3xJPcH.js";
13
13
  import { T as Ke } from "./transaction-chip-Dth1nThY.js";
14
14
  import { T as je } from "./tooltip-Cp-PLePW.js";
@@ -530,4 +530,4 @@ export {
530
530
  Ca as P,
531
531
  ma as p
532
532
  };
533
- //# sourceMappingURL=patient-summary-card-BzmJH9a-.js.map
533
+ //# sourceMappingURL=patient-summary-card-B131Q7Bp.js.map