@alfadocs/ui-kit-debug 1.33.0 → 1.35.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 (217) hide show
  1. package/dist/_chunks/appointment-card-Bh_CIlc6.js +431 -0
  2. package/dist/_chunks/appointment-card-Bh_CIlc6.js.map +1 -0
  3. package/dist/_chunks/appointment-timeline-De-Wqdkw.js +449 -0
  4. package/dist/_chunks/appointment-timeline-De-Wqdkw.js.map +1 -0
  5. package/dist/_chunks/{appointment-tray-DCk8gHod.js → appointment-tray-4I9wTAi4.js} +2 -2
  6. package/dist/_chunks/{appointment-tray-DCk8gHod.js.map → appointment-tray-4I9wTAi4.js.map} +1 -1
  7. package/dist/_chunks/{calendar-workspace-BX-zDyVR.js → calendar-workspace-UywR5gUl.js} +7 -7
  8. package/dist/_chunks/{calendar-workspace-BX-zDyVR.js.map → calendar-workspace-UywR5gUl.js.map} +1 -1
  9. package/dist/_chunks/{care-plan-card-CZW476Kg.js → care-plan-card-DHVhBcvs.js} +3 -3
  10. package/dist/_chunks/{care-plan-card-CZW476Kg.js.map → care-plan-card-DHVhBcvs.js.map} +1 -1
  11. package/dist/_chunks/{care-plan-entry-card-BMUYagEw.js → care-plan-entry-card-Dx6IdTcR.js} +2 -2
  12. package/dist/_chunks/{care-plan-entry-card-BMUYagEw.js.map → care-plan-entry-card-Dx6IdTcR.js.map} +1 -1
  13. package/dist/_chunks/{care-plan-header-B5CBE0zu.js → care-plan-header-UTX5ZD74.js} +2 -2
  14. package/dist/_chunks/{care-plan-header-B5CBE0zu.js.map → care-plan-header-UTX5ZD74.js.map} +1 -1
  15. package/dist/_chunks/{clinical-note-card-D2WTV2CO.js → clinical-note-card-CTRzmqvv.js} +83 -81
  16. package/dist/_chunks/clinical-note-card-CTRzmqvv.js.map +1 -0
  17. package/dist/_chunks/{contact-profile-card-BZqi8Hck.js → contact-profile-card-DSI9uumA.js} +17 -16
  18. package/dist/_chunks/{contact-profile-card-BZqi8Hck.js.map → contact-profile-card-DSI9uumA.js.map} +1 -1
  19. package/dist/_chunks/{control-room-rail-iO_BCaq1.js → control-room-rail-5MbhjsxN.js} +2 -2
  20. package/dist/_chunks/{control-room-rail-iO_BCaq1.js.map → control-room-rail-5MbhjsxN.js.map} +1 -1
  21. package/dist/_chunks/{entity-card-DmrgYSEX.js → entity-card-9_62gY7l.js} +4 -4
  22. package/dist/_chunks/{entity-card-DmrgYSEX.js.map → entity-card-9_62gY7l.js.map} +1 -1
  23. package/dist/_chunks/format-price-BkMEbeW3.js +47 -0
  24. package/dist/_chunks/format-price-BkMEbeW3.js.map +1 -0
  25. package/dist/_chunks/{format-price-DNqXPa_q.js → languages-CZqBaPwI.js} +8 -38
  26. package/dist/_chunks/languages-CZqBaPwI.js.map +1 -0
  27. package/dist/_chunks/money.agent-Dw55UxUA.js +116 -0
  28. package/dist/_chunks/money.agent-Dw55UxUA.js.map +1 -0
  29. package/dist/_chunks/notes-panel-BjLt-kiP.js +469 -0
  30. package/dist/_chunks/notes-panel-BjLt-kiP.js.map +1 -0
  31. package/dist/_chunks/{operator-hero-D7-iiFQ9.js → operator-hero-aG_qyn6g.js} +2 -2
  32. package/dist/_chunks/{operator-hero-D7-iiFQ9.js.map → operator-hero-aG_qyn6g.js.map} +1 -1
  33. package/dist/_chunks/{payment-request-card-lmKLwsDs.js → payment-request-card-DvEsWEkC.js} +2 -2
  34. package/dist/_chunks/{payment-request-card-lmKLwsDs.js.map → payment-request-card-DvEsWEkC.js.map} +1 -1
  35. package/dist/_chunks/{practice-results-DjEzPgAK.js → practice-results-kayDEorM.js} +15 -14
  36. package/dist/_chunks/{practice-results-DjEzPgAK.js.map → practice-results-kayDEorM.js.map} +1 -1
  37. package/dist/_chunks/{rich-text-editor-CQ7yZdG3.js → rich-text-editor-CCI-Y3DN.js} +3 -5
  38. package/dist/_chunks/rich-text-editor-CCI-Y3DN.js.map +1 -0
  39. package/dist/_chunks/{task-card-BUgK6yZT.js → task-card-BalrLkSz.js} +41 -40
  40. package/dist/_chunks/task-card-BalrLkSz.js.map +1 -0
  41. package/dist/_chunks/{task-tray-CYG6rj2s.js → task-tray-COo-RlDv.js} +2 -2
  42. package/dist/_chunks/{task-tray-CYG6rj2s.js.map → task-tray-COo-RlDv.js.map} +1 -1
  43. package/dist/_chunks/tasks-panel-DLKpSNoE.js +844 -0
  44. package/dist/_chunks/tasks-panel-DLKpSNoE.js.map +1 -0
  45. package/dist/_chunks/tool-rail-ONaV-Nzz.js +588 -0
  46. package/dist/_chunks/tool-rail-ONaV-Nzz.js.map +1 -0
  47. package/dist/_chunks/use-check-animation--I3cS00X.js +28 -0
  48. package/dist/_chunks/use-check-animation--I3cS00X.js.map +1 -0
  49. package/dist/_chunks/use-list-reflow-Cw43nxw5.js +100 -0
  50. package/dist/_chunks/use-list-reflow-Cw43nxw5.js.map +1 -0
  51. package/dist/agent-catalog.json +15 -1
  52. package/dist/components/_shared/format-price.d.ts +15 -0
  53. package/dist/components/_shared/format-price.d.ts.map +1 -1
  54. package/dist/components/appointment-card/appointment-card.d.ts +36 -1
  55. package/dist/components/appointment-card/appointment-card.d.ts.map +1 -1
  56. package/dist/components/appointment-card/index.js +2 -2
  57. package/dist/components/appointment-timeline/appointment-timeline.d.ts +6 -0
  58. package/dist/components/appointment-timeline/appointment-timeline.d.ts.map +1 -1
  59. package/dist/components/appointment-timeline/index.js +1 -1
  60. package/dist/components/care-plan-card/index.js +1 -1
  61. package/dist/components/care-plan-entry-card/index.js +1 -1
  62. package/dist/components/care-plan-header/index.js +1 -1
  63. package/dist/components/clinical-note-card/clinical-note-card.d.ts +8 -1
  64. package/dist/components/clinical-note-card/clinical-note-card.d.ts.map +1 -1
  65. package/dist/components/clinical-note-card/index.js +1 -1
  66. package/dist/components/command-palette/command-palette.d.ts +7 -7
  67. package/dist/components/contact-profile-card/index.js +1 -1
  68. package/dist/components/control-room-rail/index.js +1 -1
  69. package/dist/components/index.d.ts +1 -0
  70. package/dist/components/index.d.ts.map +1 -1
  71. package/dist/components/money/index.d.ts +4 -0
  72. package/dist/components/money/index.d.ts.map +1 -0
  73. package/dist/components/money/index.js +6 -0
  74. package/dist/components/money/index.js.map +1 -0
  75. package/dist/components/money/money.agent.d.ts +3 -0
  76. package/dist/components/money/money.agent.d.ts.map +1 -0
  77. package/dist/components/money/money.d.ts +38 -0
  78. package/dist/components/money/money.d.ts.map +1 -0
  79. package/dist/components/notes-panel/index.js +1 -1
  80. package/dist/components/notes-panel/notes-panel.d.ts +16 -1
  81. package/dist/components/notes-panel/notes-panel.d.ts.map +1 -1
  82. package/dist/components/operator-hero/index.js +1 -1
  83. package/dist/components/payment-card/index.js +1 -1
  84. package/dist/components/practice-results/index.js +1 -1
  85. package/dist/components/rich-text-editor/help-me-write-overlay.d.ts.map +1 -1
  86. package/dist/components/rich-text-editor/index.js +1 -1
  87. package/dist/components/rich-text-editor/rich-text-editor.d.ts +1 -1
  88. package/dist/components/rich-text-editor/rich-text-editor.d.ts.map +1 -1
  89. package/dist/components/task-card/index.js +1 -1
  90. package/dist/components/task-card/task-card.d.ts +11 -3
  91. package/dist/components/task-card/task-card.d.ts.map +1 -1
  92. package/dist/components/task-tray/index.js +1 -1
  93. package/dist/components/tasks-panel/index.js +1 -1
  94. package/dist/components/tasks-panel/tasks-panel.d.ts +1 -1
  95. package/dist/components/tasks-panel/tasks-panel.d.ts.map +1 -1
  96. package/dist/components/tool-rail/index.js +1 -1
  97. package/dist/components/tool-rail/tool-rail.d.ts.map +1 -1
  98. package/dist/hooks/index.d.ts +3 -0
  99. package/dist/hooks/index.d.ts.map +1 -1
  100. package/dist/hooks/index.js +43 -37
  101. package/dist/hooks/index.js.map +1 -1
  102. package/dist/hooks/use-check-animation.d.ts +53 -0
  103. package/dist/hooks/use-check-animation.d.ts.map +1 -0
  104. package/dist/hooks/use-exit-transition.d.ts +48 -0
  105. package/dist/hooks/use-exit-transition.d.ts.map +1 -0
  106. package/dist/hooks/use-list-reflow.d.ts +47 -0
  107. package/dist/hooks/use-list-reflow.d.ts.map +1 -0
  108. package/dist/host-compat.css +8 -2
  109. package/dist/i18n/locales/ar.d.ts +10 -0
  110. package/dist/i18n/locales/ar.d.ts.map +1 -1
  111. package/dist/i18n/locales/ar.js +12 -2
  112. package/dist/i18n/locales/ar.js.map +1 -1
  113. package/dist/i18n/locales/de.d.ts +10 -0
  114. package/dist/i18n/locales/de.d.ts.map +1 -1
  115. package/dist/i18n/locales/de.js +12 -2
  116. package/dist/i18n/locales/de.js.map +1 -1
  117. package/dist/i18n/locales/el.d.ts +10 -0
  118. package/dist/i18n/locales/el.d.ts.map +1 -1
  119. package/dist/i18n/locales/el.js +12 -2
  120. package/dist/i18n/locales/el.js.map +1 -1
  121. package/dist/i18n/locales/en.d.ts +10 -0
  122. package/dist/i18n/locales/en.d.ts.map +1 -1
  123. package/dist/i18n/locales/en.js +12 -2
  124. package/dist/i18n/locales/en.js.map +1 -1
  125. package/dist/i18n/locales/es.d.ts +10 -0
  126. package/dist/i18n/locales/es.d.ts.map +1 -1
  127. package/dist/i18n/locales/es.js +12 -2
  128. package/dist/i18n/locales/es.js.map +1 -1
  129. package/dist/i18n/locales/fr.d.ts +10 -0
  130. package/dist/i18n/locales/fr.d.ts.map +1 -1
  131. package/dist/i18n/locales/fr.js +12 -2
  132. package/dist/i18n/locales/fr.js.map +1 -1
  133. package/dist/i18n/locales/hi.d.ts +10 -0
  134. package/dist/i18n/locales/hi.d.ts.map +1 -1
  135. package/dist/i18n/locales/hi.js +12 -2
  136. package/dist/i18n/locales/hi.js.map +1 -1
  137. package/dist/i18n/locales/it.d.ts +13 -3
  138. package/dist/i18n/locales/it.d.ts.map +1 -1
  139. package/dist/i18n/locales/it.js +14 -4
  140. package/dist/i18n/locales/it.js.map +1 -1
  141. package/dist/i18n/locales/ja.d.ts +10 -0
  142. package/dist/i18n/locales/ja.d.ts.map +1 -1
  143. package/dist/i18n/locales/ja.js +12 -2
  144. package/dist/i18n/locales/ja.js.map +1 -1
  145. package/dist/i18n/locales/nl.d.ts +10 -0
  146. package/dist/i18n/locales/nl.d.ts.map +1 -1
  147. package/dist/i18n/locales/nl.js +12 -2
  148. package/dist/i18n/locales/nl.js.map +1 -1
  149. package/dist/i18n/locales/pl.d.ts +10 -0
  150. package/dist/i18n/locales/pl.d.ts.map +1 -1
  151. package/dist/i18n/locales/pl.js +12 -2
  152. package/dist/i18n/locales/pl.js.map +1 -1
  153. package/dist/i18n/locales/pt.d.ts +10 -0
  154. package/dist/i18n/locales/pt.d.ts.map +1 -1
  155. package/dist/i18n/locales/pt.js +12 -2
  156. package/dist/i18n/locales/pt.js.map +1 -1
  157. package/dist/i18n/locales/ro.d.ts +10 -0
  158. package/dist/i18n/locales/ro.d.ts.map +1 -1
  159. package/dist/i18n/locales/ro.js +12 -2
  160. package/dist/i18n/locales/ro.js.map +1 -1
  161. package/dist/i18n/locales/ru.d.ts +10 -0
  162. package/dist/i18n/locales/ru.d.ts.map +1 -1
  163. package/dist/i18n/locales/ru.js +12 -2
  164. package/dist/i18n/locales/ru.js.map +1 -1
  165. package/dist/i18n/locales/sq.d.ts +10 -0
  166. package/dist/i18n/locales/sq.d.ts.map +1 -1
  167. package/dist/i18n/locales/sq.js +12 -2
  168. package/dist/i18n/locales/sq.js.map +1 -1
  169. package/dist/i18n/locales/sv.d.ts +10 -0
  170. package/dist/i18n/locales/sv.d.ts.map +1 -1
  171. package/dist/i18n/locales/sv.js +12 -2
  172. package/dist/i18n/locales/sv.js.map +1 -1
  173. package/dist/i18n/locales/tr.d.ts +10 -0
  174. package/dist/i18n/locales/tr.d.ts.map +1 -1
  175. package/dist/i18n/locales/tr.js +12 -2
  176. package/dist/i18n/locales/tr.js.map +1 -1
  177. package/dist/i18n/locales/zh.d.ts +10 -0
  178. package/dist/i18n/locales/zh.d.ts.map +1 -1
  179. package/dist/i18n/locales/zh.js +12 -2
  180. package/dist/i18n/locales/zh.js.map +1 -1
  181. package/dist/index.js +919 -916
  182. package/dist/index.js.map +1 -1
  183. package/dist/locales/ar.json +12 -2
  184. package/dist/locales/de.json +12 -2
  185. package/dist/locales/el.json +12 -2
  186. package/dist/locales/en.json +12 -2
  187. package/dist/locales/es.json +12 -2
  188. package/dist/locales/fr.json +12 -2
  189. package/dist/locales/hi.json +12 -2
  190. package/dist/locales/it.json +14 -4
  191. package/dist/locales/ja.json +12 -2
  192. package/dist/locales/nl.json +12 -2
  193. package/dist/locales/pl.json +12 -2
  194. package/dist/locales/pt.json +12 -2
  195. package/dist/locales/ro.json +12 -2
  196. package/dist/locales/ru.json +12 -2
  197. package/dist/locales/sq.json +12 -2
  198. package/dist/locales/sv.json +12 -2
  199. package/dist/locales/tr.json +12 -2
  200. package/dist/locales/zh.json +12 -2
  201. package/dist/patterns/calendar/index.js +1 -1
  202. package/dist/tokens.css +2 -1
  203. package/package.json +5 -1
  204. package/dist/_chunks/appointment-card-D-oj_ugh.js +0 -296
  205. package/dist/_chunks/appointment-card-D-oj_ugh.js.map +0 -1
  206. package/dist/_chunks/appointment-timeline-CymGHyIP.js +0 -403
  207. package/dist/_chunks/appointment-timeline-CymGHyIP.js.map +0 -1
  208. package/dist/_chunks/clinical-note-card-D2WTV2CO.js.map +0 -1
  209. package/dist/_chunks/format-price-DNqXPa_q.js.map +0 -1
  210. package/dist/_chunks/notes-panel-C4G-mhZ9.js +0 -380
  211. package/dist/_chunks/notes-panel-C4G-mhZ9.js.map +0 -1
  212. package/dist/_chunks/rich-text-editor-CQ7yZdG3.js.map +0 -1
  213. package/dist/_chunks/task-card-BUgK6yZT.js.map +0 -1
  214. package/dist/_chunks/tasks-panel-DQuaVvl5.js +0 -757
  215. package/dist/_chunks/tasks-panel-DQuaVvl5.js.map +0 -1
  216. package/dist/_chunks/tool-rail-8Scslq3X.js +0 -524
  217. package/dist/_chunks/tool-rail-8Scslq3X.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tool-rail-ONaV-Nzz.js","sources":["../../src/components/tool-rail/tool-rail.agent.ts","../../src/components/tool-rail/tool-rail.tsx"],"sourcesContent":["/* -------------------------------------------------------------------- */\n/* Agent adapter — ToolRail. */\n/* */\n/* Rail-level surface: open / close a tool's panel and read which tool */\n/* is active. State is strictly the active tool id — never any tool's */\n/* panel CONTENT (which may carry PHI). Tool ids + badge counts are */\n/* supplied by the host via props, not derived from panel bodies. */\n/* -------------------------------------------------------------------- */\n\nimport type { AgentAdapter } from '../../agent/types';\nimport type { ToolRailHandle } from './tool-rail';\n\nexport const toolRailAgent: AgentAdapter<ToolRailHandle> = {\n id: 'tool-rail',\n capabilities: ['open', 'close', 'select_single'],\n state: {\n activeToolId: {\n type: 'string | null',\n descriptionKey: 'ui.toolRail.agent.state.activeToolId',\n description:\n 'Id of the tool whose panel is currently open, or null when the rail is collapsed to its strip. No panel content is ever exposed.',\n read: (handle) => handle.getActiveToolId(),\n },\n },\n actions: {\n open: {\n // Pure ephemeral panel state (open) — no data loss, no external effect.\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 // descriptionKey shape is intentionally pre-existing — already resolves to\n // real multi-locale translations; do not canonicalise.\n descriptionKey: 'ui.toolRail.agent.actions.open',\n description: \"Open the given tool's panel.\",\n examples: [{ args: { id: 'inbox' }, note: 'Open the inbox tool panel.' }],\n invoke: (handle, args: { id: string }) => {\n handle.open(args.id);\n },\n },\n close: {\n safety: 'read',\n idempotent: true,\n descriptionKey: 'ui.toolRail.agent.actions.close',\n description: 'Collapse the rail to its strip (no active tool).',\n invoke: (handle) => {\n handle.close();\n },\n },\n select_tool: {\n safety: 'read',\n argsType: '{ id: string | null }',\n argsSchema: {\n type: 'object',\n properties: { id: { type: ['string', 'null'] } },\n required: ['id'],\n },\n idempotent: true,\n descriptionKey: 'ui.toolRail.agent.actions.selectTool',\n description:\n 'Set the active tool by id (opens its panel), or pass null to collapse.',\n invoke: (handle, args: { id: string | null }) => {\n handle.setActiveTool(args.id);\n },\n },\n },\n domHooks: {\n root: {\n attr: 'data-component',\n value: 'tool-rail',\n description: 'Marks the ToolRail 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 rail from the agent.',\n },\n item: {\n attr: 'data-tool-id',\n description:\n 'Stable tool id emitted on each strip IconButton. The active icon also carries data-active set to its id.',\n },\n },\n};\n","import {\n forwardRef,\n Fragment,\n useCallback,\n useEffect,\n useId,\n useImperativeHandle,\n useMemo,\n useRef,\n useState,\n type KeyboardEvent as ReactKeyboardEvent,\n type ReactNode,\n} from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\nimport { IconButton } from '../button/icon-button';\nimport { ScrollArea } from '../scroll-area/scroll-area';\nimport { TooltipProvider } from '../tooltip/tooltip';\nimport { useControllableState } from '../../hooks/use-controllable-state';\nimport { useEdgeResize } from '../../hooks/use-edge-resize';\nimport { useIsomorphicLayoutEffect } from '../../hooks/use-isomorphic-layout-effect';\nimport { REFLOW_ROW_CLASS, useListReflow } from '../../hooks/use-list-reflow';\nimport { useExitTransition } from '../../hooks/use-exit-transition';\nimport { useTheme } from '../../hooks/use-theme';\nimport { useAgentRegistration } from '../../agent/registry';\nimport type { AgentAdapter } from '../../agent/types';\nimport { toolRailAgent } from './tool-rail.agent';\n\n/* ------------------------------------------------------------------ */\n/* Tokenised widths */\n/* */\n/* Fixed + tokenised so the rail stays constraint-compliant — no */\n/* prop-driven inline styles. Bare `[inline-size:…]` is NOT a */\n/* recognised utility under the `ds:` prefix; it must carry the */\n/* prefix or Tailwind emits no rule. Consumers needing a different */\n/* size wrap the rail and override via CSS. */\n/* ------------------------------------------------------------------ */\nconst RAIL_WIDTH = 'ds:[inline-size:3rem]';\n// Panel width rides a consumer-overridable custom property (set\n// `--tool-rail-panel-inline-size` on the rail or a wrapper) so\n// content-heavy tools (e.g. an inbox feed) can widen their panel\n// without inline styles. Defaults to the 22rem tray-family width.\n// `--ai-tools-rail-panel-inline-size` is the deprecated alias var read\n// here as a fallback so external consumers that set the pre-rename name\n// keep working for one release; the resize hook only ever writes the new\n// `--tool-rail-panel-inline-size`.\nconst PANEL_WIDTH =\n 'ds:[inline-size:var(--tool-rail-panel-inline-size,var(--ai-tools-rail-panel-inline-size,22rem))]';\n// The custom property PANEL_WIDTH reads. The resize hook writes the\n// committed px width here (on the panel element, so it beats consumer\n// class overrides on the root) and removes it on reset.\nconst PANEL_SIZE_PROPERTY = '--tool-rail-panel-inline-size';\n// Resize clamp + nominal default, px (352px = the 22rem token default).\n// The ceiling is 880 so a form panel can reach a three-column layout:\n// pairing fields is the only way to shorten a long form without\n// shrinking a 44px target, and that needs real inline size.\nconst PANEL_MIN_SIZE = 288;\nconst PANEL_MAX_SIZE = 880;\nconst PANEL_DEFAULT_SIZE = 352;\n\n/* ------------------------------------------------------------------ */\n/* Public types */\n/* ------------------------------------------------------------------ */\n\nexport interface ToolRailTool {\n /** Stable tool id — used in `data-active`, the imperative handle, and\n * to label the open panel region. */\n id: string;\n /** Accessible name for the strip icon + tooltip, and the open panel's\n * region label. Never rendered as visible body text. */\n label: string;\n /** lucide-react glyph (rendered `aria-hidden` inside the IconButton). */\n icon: ReactNode;\n /** Panel body for this tool. Rendered inline-start of the strip when\n * `side='end'` (mirrored for `'start'`). The consumer composes it. */\n panel: ReactNode;\n /**\n * Optional non-scrolling header for this tool's panel. Rendered pinned at\n * the top of the open panel — above the scroll region — so a tool's title /\n * filters stay visible as the body scrolls. This is the rail-level home for\n * a sticky tool header; every tool gets it for free.\n */\n header?: ReactNode;\n /**\n * When true the panel body is NOT wrapped in the rail's `ScrollArea` — the\n * tool fills the (height-bounded) panel and owns its own scroll/layout.\n * Use for self-scrolling tools (e.g. `AppointmentTimeline`, whose infinite\n * scroll + today-anchoring + edge fades require it to be the scroll\n * container). Default `false` (the rail scrolls the body).\n */\n fill?: boolean;\n /** Optional unseen / notification count shown on the strip icon. */\n badgeCount?: number;\n /** When true the icon is non-interactive and skipped by roving focus. */\n disabled?: boolean;\n /**\n * Scope tier (drives the two-group divider). The two scope values render in\n * array order with a divider at the boundary between them — order the array\n * so the groups stay contiguous. A divider only appears when BOTH groups are\n * present; omit `scope` on every tool for an ungrouped strip (legacy). The\n * rail attaches no meaning beyond grouping — the host decides which value\n * leads (e.g. the Control Room pins favourites first).\n */\n scope?: 'global' | 'contextual';\n /**\n * When true this icon joins the drag-and-drop / `Alt`+Arrow reorder run.\n * The host supplies `onReorder` and owns the resulting order. Moves are\n * confined to the contiguous run of `reorderable` tools — so if EVERY tool\n * is `reorderable` the run is the whole strip and a tool can be dragged\n * across the scope divider; the host's `onReorder` decides what crossing it\n * means (e.g. the Control Room reads it as pin / unpin). Reordering never\n * changes focus roving — focus follows the moved tool to its new slot.\n */\n reorderable?: boolean;\n}\n\n/**\n * Curated imperative handle for ToolRail. Exposed as the forwardRef\n * target so a future agent / MCP UI bridge can drive the rail without\n * touching the DOM. See `tool-rail.agent.ts`.\n *\n * State surfaced here is strictly identifiers + counts — never any\n * tool's panel content (which may carry PHI).\n */\nexport interface ToolRailHandle {\n /** Currently-active tool id, or null when collapsed to strip-only. */\n getActiveToolId: () => string | null;\n /** Activate a tool by id (opens its panel), or null to collapse. */\n setActiveTool: (id: string | null) => void;\n /** Activate a tool by id (opens its panel). */\n open: (id: string) => void;\n /** Collapse to strip-only (no active tool). */\n close: () => void;\n}\n\n/* ------------------------------------------------------------------ */\n/* CVA — `side` drives the dock edge + which shadow faces main content */\n/* ------------------------------------------------------------------ */\n\nconst railVariants = cva(\n ['ds:flex ds:shrink-0 ds:h-full', 'ds:bg-[var(--background)]'].join(' '),\n {\n variants: {\n side: {\n // Strip docks inline-end; the panel mounts inline-start of it\n // (flex-row, panel rendered first). Shadow faces the main area —\n // no border against main (the rail stays line-free; the only seam\n // is the strip↔panel divider on the open panel, see render).\n // Accessible (AAA) theme swaps the soft chrome shadow for a solid 1px\n // border on the content-facing edge (border-s for end-docked).\n end: 'ds:flex-row ds:shadow-[var(--shadow-chrome-start)] ds:[.theme-accessible_&]:border-s ds:[.theme-accessible_&]:border-[var(--border)] ds:[.theme-accessible_&]:shadow-none',\n // Strip docks inline-start; the panel mounts inline-end of it.\n start:\n 'ds:flex-row-reverse ds:shadow-[var(--shadow-chrome-end)] ds:[.theme-accessible_&]:border-e ds:[.theme-accessible_&]:border-[var(--border)] ds:[.theme-accessible_&]:shadow-none',\n },\n },\n defaultVariants: { side: 'end' },\n },\n);\n\nconst stripVariants = cva(\n [\n 'ds:flex ds:shrink-0 ds:flex-col ds:items-center',\n 'ds:pt-[var(--spacing-md)] ds:pb-[var(--spacing-md)]',\n 'ds:gap-[var(--spacing-xs)]',\n RAIL_WIDTH,\n ].join(' '),\n);\n\nconst panelVariants = cva(\n [\n 'ds:relative ds:flex ds:min-h-0 ds:flex-col ds:h-full',\n 'ds:bg-[var(--background)]',\n PANEL_WIDTH,\n // Defensive: the panel doesn't animate its width today, but if a\n // consumer adds a transition on the var, suppress it mid-drag.\n 'ds:data-[resizing]:transition-none',\n ].join(' '),\n);\n\n// Resize handle on the panel's inner edge — mirrors Resizable's Handle\n// (::before hit area to --min-target-size, hover/focus/drag accent, token\n// focus ring) but absolutely positioned over the panel edge. Like the\n// Sidebar's handle it stays TRANSPARENT at rest: the rail root's\n// `shadow-chrome-*` (which faces the main content) carries the resting seam,\n// exactly as the start-docked Sidebar leans on its own shadow — so the rail\n// never shows the constant coloured bar it used to. The strip only tints\n// accent on hover / focus / drag.\nconst panelResizeHandleVariants = cva(\n [\n 'ds:absolute ds:[inset-block:0] ds:z-[1] ds:select-none ds:touch-none',\n 'ds:[inline-size:var(--resizable-handle-size)] ds:cursor-col-resize',\n 'ds:transition-colors ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none',\n 'ds:hover:bg-[var(--accent)] ds:focus-visible:bg-[var(--accent)] ds:data-[resizing]:bg-[var(--accent)]',\n 'ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid',\n 'ds:focus-visible:outline-[color:var(--ring)] ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]',\n 'ds:forced-colors:focus-visible:outline-[CanvasText]',\n \"ds:before:absolute ds:before:content-['']\",\n 'ds:before:[block-size:100%]',\n 'ds:before:[inline-size:var(--min-target-size)]',\n 'ds:before:[inset-block:0]',\n 'ds:before:[inset-inline:calc(0px_-_(var(--min-target-size)_-_var(--resizable-handle-size))_/_2)]',\n ],\n {\n variants: {\n edge: {\n 'inline-start': 'ds:start-0',\n 'inline-end': 'ds:end-0',\n },\n },\n defaultVariants: { edge: 'inline-start' },\n },\n);\n\n// Hand-rolled overlay count chip — mirrors the AliaSidebar / MessageTray\n// badge markup. A <Badge> would re-introduce its own landmark/role; the\n// strip icon already carries the count in its accessible name, so this\n// span is purely decorative (`aria-hidden`).\nconst badgeVariants = cva(\n [\n 'ds:absolute ds:-top-[var(--spacing-xs)] ds:-end-[var(--spacing-xs)]',\n 'ds:inline-flex ds:items-center ds:justify-center',\n 'ds:min-w-[calc(var(--spacing-md)+var(--spacing-xs))]',\n 'ds:h-[calc(var(--spacing-md)+var(--spacing-xs))]',\n 'ds:ps-[calc(var(--spacing-xs)/1.5)] ds:pe-[calc(var(--spacing-xs)/1.5)]',\n 'ds:rounded-[var(--radius-full)]',\n 'ds:bg-[color:var(--destructive)] ds:text-[color:var(--destructive-foreground)]',\n 'ds:text-[length:var(--font-size-xs)] ds:font-semibold ds:leading-none',\n 'ds:pointer-events-none ds:select-none',\n 'ds:forced-colors:outline ds:forced-colors:outline-1 ds:forced-colors:outline-[CanvasText]',\n ].join(' '),\n);\n\n// Per-icon slot — the positioned box that hosts the IconButton, its badge and\n// the optional affordance overlay. CVA carries the drag states: the dragged\n// icon dims; a hovered drop target shows a dashed accent ring (logical offset),\n// mirroring the Sidebar's favourite-row affordance.\nconst toolSlotVariants = cva(\n // `group/rail-tool` lets an affordance overlay (e.g. a pin star) reveal on\n // hover / focus-within of the whole slot.\n ['ds:group/rail-tool ds:relative', 'ds:rounded-[var(--radius-sm)]'],\n {\n variants: {\n dragging: { true: 'ds:opacity-60', false: '' },\n dropTarget: {\n true: 'ds:outline-[length:var(--focus-ring-width)] ds:outline-dashed ds:outline-[var(--accent)] ds:outline-offset-[length:var(--focus-ring-offset)]',\n false: '',\n },\n reorderable: {\n true: 'ds:cursor-grab ds:active:cursor-grabbing',\n false: '',\n },\n },\n defaultVariants: {\n dragging: false,\n dropTarget: false,\n reorderable: false,\n },\n },\n);\n\n/* A departing tool slot fades in place; the reflow hook then slides the\n surviving icons to close the gap. Declared at rest so the transition\n has a value to animate from the moment the leaving class lands. */\nconst toolLeavingClass = 'ds:opacity-0';\nconst toolElevationClass = [\n 'ds:transition-opacity ds:duration-[var(--animation-duration)]',\n 'ds:ease-[var(--ease-out)] ds:motion-reduce:transition-none',\n].join(' ');\n\n/* ------------------------------------------------------------------ */\n/* Props */\n/* ------------------------------------------------------------------ */\n\nexport interface ToolRailProps extends VariantProps<typeof railVariants> {\n /** Stable instance id, surfaced on the root as `data-component-id`. */\n id?: string;\n /** The tools shown as icons on the strip. */\n tools: ToolRailTool[];\n /** Controlled active tool id (null = collapsed / strip-only). */\n activeToolId?: string | null;\n /** Uncontrolled initial active tool id (default null). */\n defaultActiveToolId?: string | null;\n /** Fires whenever the active tool changes (incl. → null on collapse). */\n onActiveToolChange?: (id: string | null) => void;\n /** Which edge the rail docks to. Default `'end'` (inline-end). */\n side?: 'start' | 'end';\n /** Accessible label for the toolbar strip. */\n railLabel?: string;\n /**\n * Opt-in resize affordance for the open tool panel. Renders a\n * `role=\"separator\"` drag handle on the panel's inner edge (the edge\n * facing the main content). The committed width is written to\n * `--tool-rail-panel-inline-size` on the panel element (288–880px);\n * Enter / double-click resets to the token-driven default. Default `false`.\n */\n resizablePanel?: boolean;\n /**\n * Fires when the user reorders the `reorderable` run (drag-drop or\n * `Alt`+Arrow). `from` / `to` are indices into `tools`; the host applies the\n * move to the array it passes back. Reordering is enabled when this callback\n * is supplied AND at least one tool is `reorderable`. When the whole strip is\n * reorderable, `to` may land in the other scope group — the host interprets\n * the crossing (and may treat it as a no-op, e.g. reordering within a\n * host-ordered group).\n */\n onReorder?: (from: number, to: number) => void;\n /**\n * Optional override for the polite live-region message announced after a\n * reorder. Lets the host phrase membership-aware moves (e.g. \"Pinned X to\n * favourites\") instead of the generic \"moved to position N\". Return an empty\n * string to stay silent (e.g. for a move the host treats as a no-op). When\n * omitted, the rail announces the generic run-relative position.\n */\n formatReorderAnnouncement?: (args: {\n tool: ToolRailTool;\n from: number;\n to: number;\n }) => string;\n /**\n * Optional per-icon overlay control, rendered as a sibling of each strip\n * IconButton (the same positioned box the notification badge uses). Use for\n * a small affordance such as a pin toggle — the rail attaches no meaning to\n * what it renders. Receives the tool and its index / active state.\n */\n renderToolAffordance?: (\n tool: ToolRailTool,\n context: { index: number; isActive: boolean; isRovingTarget: boolean },\n ) => ReactNode;\n /**\n * Optional non-scrolling header rendered at the top of the OPEN tool panel,\n * above its scroll region. Host-owned content (e.g. a pin / unpin control) —\n * the rail attaches no meaning. Receives the active tool.\n */\n renderPanelHeader?: (\n tool: ToolRailTool,\n context: { isActive: boolean },\n ) => ReactNode;\n /**\n * Identity override for the root's `data-component` attribute. Defaults to\n * `'tool-rail'`. A product wrapper (e.g. ControlRoomRail) passes its own\n * kebab id so the DOM / cascade boundary — and an agent's `domHooks.root` —\n * can tell its surface apart from a bare ToolRail, without the engine ever\n * importing the wrapper.\n */\n dataComponent?: string;\n /**\n * Agent adapter registered for this rail instance. Defaults to\n * `toolRailAgent`. A wrapper passes its own adapter (matching\n * `dataComponent`) so the rail registers under the wrapper's identity. The\n * instance id is sourced from the `id` prop (also stamped as\n * `data-component-id`).\n */\n agentAdapter?: AgentAdapter<ToolRailHandle>;\n className?: string;\n}\n\n/* ------------------------------------------------------------------ */\n/* Helpers */\n/* ------------------------------------------------------------------ */\n\nfunction formatBadgeCount(count: number, overflowLabel: string): string {\n return count > 99 ? overflowLabel : String(count);\n}\n\n/* ------------------------------------------------------------------ */\n/* Root */\n/* ------------------------------------------------------------------ */\n\nexport const ToolRail = forwardRef<ToolRailHandle, ToolRailProps>(\n (\n {\n id,\n tools,\n activeToolId,\n defaultActiveToolId = null,\n onActiveToolChange,\n side = 'end',\n railLabel,\n resizablePanel = false,\n onReorder,\n formatReorderAnnouncement,\n renderToolAffordance,\n renderPanelHeader,\n dataComponent = 'tool-rail',\n agentAdapter = toolRailAgent,\n className,\n },\n ref,\n ) => {\n const { t } = useTranslation();\n\n // Controlled / uncontrolled bridge — the same hook MessageTray uses.\n const [activeRaw, setActiveRaw] = useControllableState<string | null>({\n value: activeToolId,\n defaultValue: defaultActiveToolId,\n onChange: onActiveToolChange,\n });\n const activeId = activeRaw ?? null;\n\n // Roving-tabindex bookkeeping for the vertical toolbar strip.\n const buttonsRef = useRef<Array<HTMLButtonElement | null>>([]);\n const panelRef = useRef<HTMLElement | null>(null);\n const [focusIndex, setFocusIndex] = useState(0);\n // Distinguishes keyboard activation (auto-focus into the panel) from\n // pointer activation (focus stays on the icon — less jarring).\n const activatedByKeyboardRef = useRef(false);\n // Set on Enter/Space keydown, read by the click handler that follows,\n // cleared on keyup — so a subsequent mouse click never inherits it.\n const keyboardActivateRef = useRef(false);\n\n const activeIndex = useMemo(\n () => tools.findIndex((tl) => tl.id === activeId),\n [tools, activeId],\n );\n const activeTool = activeIndex >= 0 ? tools[activeIndex] : null;\n\n // First non-disabled index — the resting roving stop when none active.\n const firstEnabledIndex = useMemo(\n () => tools.findIndex((tl) => !tl.disabled),\n [tools],\n );\n\n // Scope grouping: a divider marks the boundary between the two scope groups,\n // whichever order they appear in. The array is always grouped (all of one\n // scope, then the other); the divider precedes the first tool whose scope\n // differs from the lead tool's. `boundary > 0` guarantees both groups are\n // present. Render-only (not a `tools[]` member) so roving focus is untouched;\n // a legacy strip with no `scope` set stays ungrouped.\n const scopeDividerIndex = useMemo(() => {\n const lead = tools[0]?.scope;\n if (!lead) return -1;\n return tools.findIndex((tl) => tl.scope && tl.scope !== lead);\n }, [tools]);\n const showScopeDivider = scopeDividerIndex > 0;\n\n /* ---- Reorder (drag-and-drop + Alt+Arrow keyboard) ------------- */\n // The contiguous run of `reorderable` tools — a tool only moves within it.\n const reorderRun = useMemo(() => {\n const first = tools.findIndex((tl) => tl.reorderable);\n if (first < 0) return null;\n let last = first;\n while (last + 1 < tools.length && tools[last + 1]?.reorderable) last += 1;\n return { first, last };\n }, [tools]);\n const reorderEnabled = !!onReorder && reorderRun !== null;\n const reorderInstructionsId = useId();\n\n const [dragIndex, setDragIndex] = useState<number | null>(null);\n const [dropIndex, setDropIndex] = useState<number | null>(null);\n\n /* ---- Strip enter / exit / reflow animations ------------------ */\n /* The same hooks the note/task panels use, applied to the icon strip:\n when a contextual tool appears or disappears (e.g. selecting an\n appointment adds Notes + Details), surviving icons slide to their\n new positions and departing icons fade out in place. */\n const { resolvedTheme } = useTheme();\n const reduceMotion = resolvedTheme.endsWith('-accessible') || undefined;\n\n const { containerRef: reflowRef } = useListReflow<HTMLDivElement>({\n key: tools.map((tl) => tl.id).join(),\n reduceMotion,\n });\n\n const exit = useExitTransition({ reduceMotion });\n\n // Tools that were in the previous render but are gone now, kept around\n // until their exit fade completes. Rendered after the current tools\n // WITHOUT `data-reflow-id` so the reflow hook ignores them — they fade\n // out at the bottom of the strip while the surviving icons reflow.\n const [leavingTools, setLeavingTools] = useState<ToolRailTool[]>([]);\n const prevToolsRef = useRef<ToolRailTool[]>(tools);\n useEffect(() => {\n const prev = prevToolsRef.current;\n const currentIds = new Set(tools.map((tl) => tl.id));\n const removed = prev.filter((tl) => !currentIds.has(tl.id));\n if (removed.length > 0) {\n setLeavingTools((existing) => {\n const existingIds = new Set(existing.map((tl) => tl.id));\n return [\n ...existing,\n ...removed.filter((tl) => !existingIds.has(tl.id)),\n ];\n });\n for (const tl of removed) {\n exit.leave(tl.id, () => {\n setLeavingTools((existing) =>\n existing.filter((item) => item.id !== tl.id),\n );\n });\n }\n }\n prevToolsRef.current = tools;\n }, [tools, exit]);\n\n // sr-only announcement. The zero-width-space toggle forces a re-announce of\n // an identical message (e.g. moving the same item twice) — same technique\n // the Sidebar uses for its reorder live region.\n const [reorderMessage, setReorderMessage] = useState('');\n const announceToggle = useRef(false);\n const commitReorder = useCallback(\n (from: number, to: number) => {\n if (!onReorder || !reorderRun) return;\n const clamped = Math.max(\n reorderRun.first,\n Math.min(reorderRun.last, to),\n );\n if (clamped === from) return;\n onReorder(from, clamped);\n const moved = tools[from];\n if (moved) {\n // The host can phrase membership-aware moves (e.g. pin / unpin) and\n // can return '' to stay silent for a move it treats as a no-op.\n const text = formatReorderAnnouncement\n ? formatReorderAnnouncement({ tool: moved, from, to: clamped })\n : t('toolRail.reorderAnnounce', {\n tool: moved.label,\n to: clamped - reorderRun.first + 1,\n total: reorderRun.last - reorderRun.first + 1,\n defaultValue: '{{tool}} moved to position {{to}} of {{total}}',\n });\n if (text) {\n announceToggle.current = !announceToggle.current;\n setReorderMessage(announceToggle.current ? text : `${text}\\u200b`);\n }\n }\n },\n [onReorder, reorderRun, tools, t, formatReorderAnnouncement],\n );\n\n // The roving tab stop: the active icon when a tool is open, else the\n // index the user last focused, else the first enabled icon.\n const rovingIndex =\n activeIndex >= 0\n ? activeIndex\n : focusIndex >= 0 && !tools[focusIndex]?.disabled\n ? focusIndex\n : firstEnabledIndex;\n\n const selectTool = useCallback(\n (toolId: string, fromKeyboard: boolean) => {\n const tool = tools.find((tl) => tl.id === toolId);\n if (!tool || tool.disabled) return;\n activatedByKeyboardRef.current = fromKeyboard;\n // Clicking / activating the active tool collapses to strip-only.\n setActiveRaw(activeId === toolId ? null : toolId);\n },\n [tools, activeId, setActiveRaw],\n );\n\n /* ---- Roving arrow-key navigation (vertical toolbar) ----------- */\n const handleStripKeyDown = useCallback(\n (event: ReactKeyboardEvent<HTMLDivElement>) => {\n const count = tools.length;\n if (count === 0) return;\n // Alt+Arrow is reserved for reordering (handled on the icon); never\n // let it move focus roving as well.\n if (event.altKey) return;\n\n let next: number | null = null;\n if (event.key === 'ArrowDown') next = (rovingIndex + 1) % count;\n else if (event.key === 'ArrowUp')\n next = (rovingIndex - 1 + count) % count;\n else if (event.key === 'Home') next = 0;\n else if (event.key === 'End') next = count - 1;\n if (next === null) return;\n\n // Skip disabled icons in the travel direction.\n const goingBack = event.key === 'ArrowUp' || event.key === 'End';\n let candidate = next;\n let attempts = 0;\n while (attempts < count && tools[candidate]?.disabled) {\n candidate = goingBack\n ? (candidate - 1 + count) % count\n : (candidate + 1) % count;\n attempts += 1;\n }\n if (tools[candidate]?.disabled) return;\n\n event.preventDefault();\n setFocusIndex(candidate);\n buttonsRef.current[candidate]?.focus();\n },\n [tools, rovingIndex],\n );\n\n /* ---- Esc collapses + returns focus to the active tool's icon -- */\n // Attached imperatively via the root ref (not a JSX onKeyDown on the\n // static container) so the Escape shortcut works from anywhere inside the\n // open panel without an interaction handler on a non-interactive element.\n const rootRef = useRef<HTMLDivElement>(null);\n useEffect(() => {\n const node = rootRef.current;\n if (!node) return undefined;\n const onKeyDown = (event: KeyboardEvent) => {\n if (event.key !== 'Escape') return;\n if (activeIndex < 0) return;\n event.preventDefault();\n const returnIndex = activeIndex;\n setActiveRaw(null);\n setFocusIndex(returnIndex);\n // Defer until after the panel unmounts so focus lands cleanly.\n requestAnimationFrame(() => {\n buttonsRef.current[returnIndex]?.focus();\n });\n };\n node.addEventListener('keydown', onKeyDown);\n return () => node.removeEventListener('keydown', onKeyDown);\n }, [activeIndex, setActiveRaw]);\n\n /* ---- Move focus into the panel when opened by keyboard -------- */\n useIsomorphicLayoutEffect(() => {\n if (activeTool && activatedByKeyboardRef.current) {\n panelRef.current?.focus();\n }\n activatedByKeyboardRef.current = false;\n }, [activeTool]);\n\n /* ---- Opt-in panel resize (inner edge) -------------------------- */\n // The handle sits on the edge facing the main content: the panel's\n // inline-start edge for an end-docked rail, inline-end for start.\n const panelEdge = side === 'end' ? 'inline-start' : 'inline-end';\n const { separatorProps, isResizing, isResized } = useEdgeResize({\n edge: panelEdge,\n targetRef: panelRef,\n cssProperty: PANEL_SIZE_PROPERTY,\n minSize: PANEL_MIN_SIZE,\n maxSize: PANEL_MAX_SIZE,\n defaultSize: PANEL_DEFAULT_SIZE,\n disabled: !resizablePanel,\n });\n\n // The aside unmounts on collapse, dropping the hook's inline override.\n // Re-assert the committed width when a panel (re)mounts so a reopened\n // panel keeps the user's chosen size.\n const committedPanelWidth = separatorProps['aria-valuenow'];\n useIsomorphicLayoutEffect(() => {\n if (!resizablePanel || !isResized || !activeTool) return;\n panelRef.current?.style.setProperty(\n PANEL_SIZE_PROPERTY,\n `${committedPanelWidth}px`,\n );\n }, [activeTool, resizablePanel, isResized, committedPanelWidth]);\n\n /* ---- Curated imperative handle for agent integration ---------- */\n const activeIdRef = useRef<string | null>(activeId);\n activeIdRef.current = activeId;\n\n const handle = useMemo<ToolRailHandle>(\n () => ({\n getActiveToolId: () => activeIdRef.current,\n setActiveTool: (toolId) => {\n activatedByKeyboardRef.current = false;\n setActiveRaw(toolId);\n },\n open: (toolId) => {\n const tool = tools.find((tl) => tl.id === toolId);\n if (!tool || tool.disabled) return;\n activatedByKeyboardRef.current = false;\n setActiveRaw(toolId);\n },\n close: () => {\n const returnId = activeIdRef.current;\n activatedByKeyboardRef.current = false;\n setActiveRaw(null);\n // Return focus to the closed tool's strip icon (mirrors Escape) so a\n // close-button / pointer collapse never drops focus to <body>.\n if (returnId != null) {\n requestAnimationFrame(() => {\n rootRef.current\n ?.querySelector<HTMLButtonElement>(\n `[data-tool-id=\"${CSS.escape(returnId)}\"]`,\n )\n ?.focus();\n });\n }\n },\n }),\n [tools, setActiveRaw],\n );\n\n useImperativeHandle(ref, () => handle, [handle]);\n useAgentRegistration(agentAdapter, handle, id);\n\n const overflowLabel = t('toolRail.badgeCountOverflow', {\n defaultValue: '99+',\n });\n\n return (\n <div\n ref={rootRef}\n data-component={dataComponent}\n data-component-id={id}\n data-side={side}\n className={[railVariants({ side }), className]\n .filter(Boolean)\n .join(' ')}\n >\n {/* Reorder a11y: a polite live region announcing each move. Each\n reorderable icon carries its own keyboard instruction (rendered in\n its slot, referenced via aria-describedby). */}\n {reorderEnabled ? (\n <span role=\"status\" aria-live=\"polite\" className=\"ds:sr-only\">\n {reorderMessage}\n </span>\n ) : null}\n {/* The OPEN panel is the single complementary landmark, named by\n the active tool. Rendered only while a tool is active so two\n unnamed regions never coexist. */}\n {activeTool ? (\n <aside\n ref={panelRef}\n tabIndex={-1}\n aria-label={t('toolRail.panelLabel', {\n tool: activeTool.label,\n defaultValue: '{{tool}} panel',\n })}\n data-tool-rail-state=\"expanded\"\n data-active-tool={activeTool.id}\n data-resizing={isResizing ? '' : undefined}\n className={[\n panelVariants(),\n // Subtle shadow — not a line — separating the panel from the\n // icon strip (the tab row). The panel casts a soft chrome\n // shadow toward the strip on its strip-facing edge. `z-[1]`\n // lifts it above the adjacent strip (the panel is already\n // `relative`) so the shadow paints at the seam instead of being\n // covered by the strip's opaque background. Only renders while\n // the panel is open (the aside is unmounted when collapsed), so\n // it never doubles as a rail↔main seam. In the accessible (AAA)\n // theme the soft shadow becomes a solid 1px border on that same\n // strip-facing edge.\n 'ds:z-[1]',\n side === 'end'\n ? 'ds:shadow-[var(--shadow-chrome-end)] ds:[.theme-accessible_&]:border-e ds:[.theme-accessible_&]:border-[var(--border)] ds:[.theme-accessible_&]:shadow-none'\n : 'ds:shadow-[var(--shadow-chrome-start)] ds:[.theme-accessible_&]:border-s ds:[.theme-accessible_&]:border-[var(--border)] ds:[.theme-accessible_&]:shadow-none',\n 'ds:focus-visible:outline-none',\n ].join(' ')}\n >\n {/* Optional host-owned, non-scrolling panel header (e.g. the\n Control Room's add / remove favourite control). Sits above the\n scroll region so it stays put as the panel body scrolls. */}\n {renderPanelHeader\n ? renderPanelHeader(activeTool, { isActive: true })\n : null}\n {/* Optional per-tool pinned header — the rail-level home for a\n sticky tool header (title / filters). Non-scrolling, above the\n body, so it stays visible for every tool. */}\n {activeTool.header ? (\n <div className=\"ds:shrink-0\">{activeTool.header}</div>\n ) : null}\n {/* Body: a self-scrolling `fill` tool owns its own scroll inside\n the height-bounded panel; otherwise the rail scrolls it. */}\n {activeTool.fill ? (\n // data-tool-fill: a self-scrolling panel owns its own native\n // scroll (it can't use the rail's ScrollArea), so a token rule\n // paints its scrollbar to match the 8px overlay. See tokens/index.css.\n <div data-tool-fill=\"\" className=\"ds:flex-1 ds:min-h-0\">\n {activeTool.panel}\n </div>\n ) : (\n <ScrollArea\n orientation=\"vertical\"\n className=\"ds:flex-1 ds:min-h-0\"\n >\n {activeTool.panel}\n </ScrollArea>\n )}\n {/* Inside the aside (so it belongs to the complementary\n landmark) and outside the toolbar strip — the strip's\n roving handlers never see its key events, and Escape\n still bubbles to the root to collapse, as everywhere\n else in the panel. No stopPropagation needed. */}\n {resizablePanel ? (\n <div\n {...separatorProps}\n aria-label={t('toolRail.resizePanel', {\n defaultValue: 'Resize tool panel',\n })}\n data-resizing={isResizing ? '' : undefined}\n className={panelResizeHandleVariants({ edge: panelEdge })}\n />\n ) : null}\n </aside>\n ) : null}\n\n {/* The 3rem icon strip — a vertical toolbar with roving tabindex.\n Self-contained TooltipProvider so consumers needn't mount one;\n Radix providers compose, so a host-level provider still works. */}\n <TooltipProvider>\n <div\n ref={reflowRef}\n role=\"toolbar\"\n aria-orientation=\"vertical\"\n aria-label={\n railLabel ?? t('toolRail.railLabel', { defaultValue: 'Tools' })\n }\n className={stripVariants()}\n onKeyDown={handleStripKeyDown}\n >\n {tools.map((tool, index) => {\n const isActive = tool.id === activeId;\n const showBadge =\n typeof tool.badgeCount === 'number' && tool.badgeCount > 0;\n // Fold the count into the accessible name so SR users hear it\n // without relying on the decorative chip.\n const accessibleName = showBadge\n ? t('toolRail.toolWithCount', {\n tool: tool.label,\n count: tool.badgeCount,\n defaultValue: '{{tool}}, {{count}} updates',\n })\n : tool.label;\n const canReorderTool =\n reorderEnabled && !!tool.reorderable && !tool.disabled;\n const reorderDescId = canReorderTool\n ? `${reorderInstructionsId}-${tool.id}`\n : undefined;\n return (\n <Fragment key={tool.id}>\n {showScopeDivider && index === scopeDividerIndex ? (\n <div\n role=\"separator\"\n aria-orientation=\"horizontal\"\n className=\"ds:my-[var(--spacing-2xs)] ds:h-px ds:w-[var(--spacing-lg)] ds:shrink-0 ds:bg-[var(--border)] ds:forced-colors:bg-[CanvasText]\"\n />\n ) : null}\n <div\n className={[\n toolSlotVariants({\n dragging: dragIndex === index,\n dropTarget: dropIndex === index && dragIndex !== index,\n reorderable: canReorderTool,\n }),\n toolElevationClass,\n REFLOW_ROW_CLASS,\n ]\n .filter(Boolean)\n .join(' ')}\n data-reflow-id={tool.id}\n data-dragging={dragIndex === index ? '' : undefined}\n // Drag the whole slot — the icon button is an unreliable\n // HTML5 drag source across browsers. The button keeps its\n // click + Alt+Arrow keyboard reorder; drag is pointer-only.\n draggable={canReorderTool || undefined}\n onDragStart={\n canReorderTool\n ? (event) => {\n setDragIndex(index);\n event.dataTransfer.effectAllowed = 'move';\n // Firefox needs data set to initiate a drag.\n event.dataTransfer.setData(\n 'text/plain',\n String(index),\n );\n }\n : undefined\n }\n onDragOver={\n canReorderTool\n ? (event) => {\n if (dragIndex === null) return;\n event.preventDefault();\n event.dataTransfer.dropEffect = 'move';\n if (dropIndex !== index) setDropIndex(index);\n }\n : undefined\n }\n onDragLeave={\n canReorderTool\n ? () =>\n setDropIndex((cur) => (cur === index ? null : cur))\n : undefined\n }\n onDrop={\n canReorderTool\n ? (event) => {\n event.preventDefault();\n const from = dragIndex;\n setDropIndex(null);\n setDragIndex(null);\n if (from === null || from === index) return;\n commitReorder(from, index);\n }\n : undefined\n }\n onDragEnd={\n canReorderTool\n ? () => {\n setDragIndex(null);\n setDropIndex(null);\n }\n : undefined\n }\n >\n <IconButton\n ref={(el) => {\n buttonsRef.current[index] = el;\n }}\n icon={tool.icon}\n tooltip={tool.label}\n aria-label={accessibleName}\n intent=\"ghost\"\n size=\"sm\"\n disabled={tool.disabled}\n aria-pressed={isActive}\n aria-expanded={isActive}\n data-active={isActive ? tool.id : undefined}\n data-tool-id={tool.id}\n aria-describedby={reorderDescId}\n aria-keyshortcuts={\n canReorderTool ? 'Alt+ArrowUp Alt+ArrowDown' : undefined\n }\n tabIndex={index === rovingIndex ? 0 : -1}\n onFocus={() => {\n if (!tool.disabled) setFocusIndex(index);\n }}\n onClick={() =>\n selectTool(tool.id, keyboardActivateRef.current)\n }\n onKeyDown={(event) => {\n // Enter/Space activate via the native button's click,\n // which fires AFTER this keydown. Flag the upcoming\n // click as keyboard-driven so focus moves into the\n // panel; reset on keyup so a later mouse click doesn't\n // inherit the flag.\n if (event.key === 'Enter' || event.key === ' ') {\n keyboardActivateRef.current = true;\n return;\n }\n // Alt+Arrow / Alt+Home / Alt+End reorder within the run.\n // Focus follows the moved icon to its new index; roving\n // ignores Alt (see handleStripKeyDown).\n if (canReorderTool && event.altKey && reorderRun) {\n let target: number | null = null;\n if (event.key === 'ArrowUp') target = index - 1;\n else if (event.key === 'ArrowDown')\n target = index + 1;\n else if (event.key === 'Home')\n target = reorderRun.first;\n else if (event.key === 'End')\n target = reorderRun.last;\n if (target !== null) {\n event.preventDefault();\n const dest = Math.max(\n reorderRun.first,\n Math.min(reorderRun.last, target),\n );\n // Focus follows the moved TOOL (by id), not the\n // slot index — so it lands correctly however the\n // host reinterprets the move (reorder, cross-group\n // pin / unpin, or a no-op that leaves it in place).\n const movedId = tool.id;\n commitReorder(index, dest);\n requestAnimationFrame(() => {\n rootRef.current\n ?.querySelector<HTMLButtonElement>(\n `[data-tool-id=\"${CSS.escape(movedId)}\"]`,\n )\n ?.focus();\n });\n }\n }\n }}\n onKeyUp={(event) => {\n if (event.key === 'Enter' || event.key === ' ') {\n keyboardActivateRef.current = false;\n }\n }}\n />\n {showBadge ? (\n <span aria-hidden=\"true\" className={badgeVariants()}>\n {formatBadgeCount(\n tool.badgeCount as number,\n overflowLabel,\n )}\n </span>\n ) : null}\n {renderToolAffordance?.(tool, {\n index,\n isActive,\n isRovingTarget: index === rovingIndex,\n })}\n {reorderDescId ? (\n <span id={reorderDescId} className=\"ds:sr-only\">\n {t('toolRail.reorderInstructions', {\n tool: tool.label,\n defaultValue:\n 'Reorder {{tool}}. Press Alt + Up or Alt + Down to move.',\n })}\n </span>\n ) : null}\n </div>\n </Fragment>\n );\n })}\n {/* Departing tools: rendered without `data-reflow-id` so the\n reflow hook ignores them. They fade out here while the\n surviving icons above reflow to their new positions. */}\n {leavingTools.map((tool) =>\n exit.isLeaving(tool.id) ? (\n <div\n key={tool.id}\n className={[\n toolSlotVariants({\n dragging: false,\n dropTarget: false,\n reorderable: false,\n }),\n toolElevationClass,\n toolLeavingClass,\n ]\n .filter(Boolean)\n .join(' ')}\n aria-hidden=\"true\"\n >\n <IconButton\n icon={tool.icon}\n intent=\"ghost\"\n size=\"sm\"\n disabled\n tabIndex={-1}\n />\n </div>\n ) : null,\n )}\n </div>\n </TooltipProvider>\n </div>\n );\n },\n);\n\nToolRail.displayName = 'ToolRail';\n"],"names":["toolRailAgent","handle","args","RAIL_WIDTH","PANEL_WIDTH","PANEL_SIZE_PROPERTY","PANEL_MIN_SIZE","PANEL_MAX_SIZE","PANEL_DEFAULT_SIZE","railVariants","cva","stripVariants","panelVariants","panelResizeHandleVariants","badgeVariants","toolSlotVariants","toolLeavingClass","toolElevationClass","formatBadgeCount","count","overflowLabel","ToolRail","forwardRef","id","tools","activeToolId","defaultActiveToolId","onActiveToolChange","side","railLabel","resizablePanel","onReorder","formatReorderAnnouncement","renderToolAffordance","renderPanelHeader","dataComponent","agentAdapter","className","ref","t","useTranslation","activeRaw","setActiveRaw","useControllableState","activeId","buttonsRef","useRef","panelRef","focusIndex","setFocusIndex","useState","activatedByKeyboardRef","keyboardActivateRef","activeIndex","useMemo","tl","activeTool","firstEnabledIndex","scopeDividerIndex","lead","_a","showScopeDivider","reorderRun","first","last","reorderEnabled","reorderInstructionsId","useId","dragIndex","setDragIndex","dropIndex","setDropIndex","resolvedTheme","useTheme","reduceMotion","reflowRef","useListReflow","exit","useExitTransition","leavingTools","setLeavingTools","prevToolsRef","useEffect","prev","currentIds","removed","existing","existingIds","item","reorderMessage","setReorderMessage","announceToggle","commitReorder","useCallback","from","to","clamped","moved","text","rovingIndex","selectTool","toolId","fromKeyboard","tool","handleStripKeyDown","event","next","goingBack","candidate","attempts","_b","_c","rootRef","node","onKeyDown","returnIndex","useIsomorphicLayoutEffect","panelEdge","separatorProps","isResizing","isResized","useEdgeResize","committedPanelWidth","activeIdRef","returnId","useImperativeHandle","useAgentRegistration","jsxs","jsx","ScrollArea","TooltipProvider","index","isActive","showBadge","accessibleName","canReorderTool","reorderDescId","Fragment","REFLOW_ROW_CLASS","cur","IconButton","el","target","dest","movedId"],"mappings":";;;;;;;;;;;;;AAYO,MAAMA,KAA8C;AAAA,EACzD,IAAI;AAAA,EACJ,cAAc,CAAC,QAAQ,SAAS,eAAe;AAAA,EAC/C,OAAO;AAAA,IACL,cAAc;AAAA,MACZ,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aACE;AAAA,MACF,MAAM,CAACC,MAAWA,EAAO,gBAAA;AAAA,IAAgB;AAAA,EAC3C;AAAA,EAEF,SAAS;AAAA,IACP,MAAM;AAAA;AAAA,MAEJ,QAAQ;AAAA,MACR,UAAU;AAAA,MACV,YAAY;AAAA,QACV,MAAM;AAAA,QACN,YAAY,EAAE,IAAI,EAAE,MAAM,WAAS;AAAA,QACnC,UAAU,CAAC,IAAI;AAAA,MAAA;AAAA,MAEjB,YAAY;AAAA;AAAA;AAAA,MAGZ,gBAAgB;AAAA,MAChB,aAAa;AAAA,MACb,UAAU,CAAC,EAAE,MAAM,EAAE,IAAI,WAAW,MAAM,8BAA8B;AAAA,MACxE,QAAQ,CAACA,GAAQC,MAAyB;AACxC,QAAAD,EAAO,KAAKC,EAAK,EAAE;AAAA,MACrB;AAAA,IAAA;AAAA,IAEF,OAAO;AAAA,MACL,QAAQ;AAAA,MACR,YAAY;AAAA,MACZ,gBAAgB;AAAA,MAChB,aA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A,UAAAC;AAAA,4BACA,gBAAgBD,MAAUhC;AAAA,0BAAA;AAAA,0BAE3BqC,sBACE,QAAA,EAAK,IAAIA,GAAe,WAAU,cAChC,YAAE,gCAAgC;AAAA,4BACjC,MAAMjC,EAAK;AAAA,4BACX,cACE;AAAA,0BAAA,CACH,GACH,IACE;AAAA,wBAAA;AAAA,sBAAA;AAAA,oBAAA;AAAA,kBACN,EAAA,GA7KaA,EAAK,EA8KpB;AAAA,gBAEJ,CAAC;AAAA,gBAIAxB,GAAa;AAAA,kBAAI,CAACwB,MACjB1B,EAAK,UAAU0B,EAAK,EAAE,IACpB,gBAAAyB;AAAA,oBAAC;AAAA,oBAAA;AAAA,sBAEC,WAAW;AAAA,wBACTjH,GAAiB;AAAA,0BACf,UAAU;AAAA,0BACV,YAAY;AAAA,0BACZ,aAAa;AAAA,wBAAA,CACd;AAAA,wBACDE;AAAA,wBACAD;AAAA,sBAAA,EAEC,OAAO,OAAO,EACd,KAAK,GAAG;AAAA,sBACX,eAAY;AAAA,sBAEZ,UAAA,gBAAAgH;AAAA,wBAACY;AAAA,wBAAA;AAAA,0BACC,MAAMrC,EAAK;AAAA,0BACX,QAAO;AAAA,0BACP,MAAK;AAAA,0BACL,UAAQ;AAAA,0BACR,UAAU;AAAA,wBAAA;AAAA,sBAAA;AAAA,oBACZ;AAAA,oBApBKA,EAAK;AAAA,kBAAA,IAsBV;AAAA,gBAAA;AAAA,cACN;AAAA,YAAA;AAAA,UAAA,EACF,CACF;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAGN;AACF;AAEAlF,GAAS,cAAc;"}
@@ -0,0 +1,28 @@
1
+ import { useState as o, useRef as p, useEffect as c, useCallback as g } from "react";
2
+ import { u as R } from "./use-prefers-reduced-motion-BMwIQRjB.js";
3
+ function M({
4
+ checked: n,
5
+ durationMs: l = 200,
6
+ reduceMotion: f
7
+ }) {
8
+ const a = R(), r = f ?? a ? 0 : l, [t, i] = o(null), [m, s] = o(!1), e = p(null), d = t ?? n;
9
+ c(() => {
10
+ t !== null && t === n && i(null);
11
+ }, [t, n]), c(
12
+ () => () => {
13
+ e.current !== null && window.clearTimeout(e.current);
14
+ },
15
+ []
16
+ );
17
+ const w = g(() => {
18
+ const u = !(t ?? n);
19
+ return i(u), e.current !== null && window.clearTimeout(e.current), !u || r === 0 ? (s(!1), u) : (s(!0), e.current = window.setTimeout(() => {
20
+ e.current = null, s(!1);
21
+ }, r), u);
22
+ }, [t, n, r]);
23
+ return { checked: d, drawing: m, durationMs: r, toggle: w };
24
+ }
25
+ export {
26
+ M as u
27
+ };
28
+ //# sourceMappingURL=use-check-animation--I3cS00X.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-check-animation--I3cS00X.js","sources":["../../src/hooks/use-check-animation.ts"],"sourcesContent":["import { useCallback, useEffect, useRef, useState } from 'react';\nimport { usePrefersReducedMotion } from './use-prefers-reduced-motion';\n\n/* -------------------------------------------------------------------- */\n/* Types */\n/* -------------------------------------------------------------------- */\n\nexport interface UseCheckAnimationOptions {\n /**\n * The committed state, as the host holds it. The hook shows an optimistic\n * value while a toggle is in flight so the tick draws on the click rather\n * than waiting for the host's re-render.\n */\n checked: boolean;\n /**\n * How long the tick takes to draw, in milliseconds. Keep it in step with\n * the CSS transition the caller paints — `--duration-normal` (200ms) is\n * the kit's default and the hook's too.\n */\n durationMs?: number;\n /**\n * Force the reduced-motion branch. Defaults to reading\n * `prefers-reduced-motion: reduce`. Useful in tests and for callers that\n * already track the preference upstream. When reduced, the tick lands\n * immediately and `drawing` never turns true.\n */\n reduceMotion?: boolean;\n}\n\nexport interface UseCheckAnimationReturn {\n /** What to render: the optimistic value while a toggle is in flight. */\n checked: boolean;\n /**\n * True only while an unchecked → checked flip is drawing. Reflect it onto\n * the element (e.g. `data-drawing`) to trigger the stroke animation;\n * unticking is deliberately instant, since there is nothing to celebrate.\n */\n drawing: boolean;\n /** The effective duration — 0 under reduced motion. */\n durationMs: number;\n /**\n * Flip the box. Returns the value it flipped to, so the caller can pass it\n * straight to its own commit callback.\n */\n toggle: () => boolean;\n}\n\n/* -------------------------------------------------------------------- */\n/* Hook */\n/* -------------------------------------------------------------------- */\n\n/**\n * Drives an animated tick for a checkbox whose state lives with the host.\n *\n * A checkbox backed by host state cannot animate on click: the tick would\n * wait for the round trip, and when the row is about to leave the list the\n * host may never send the new value back at all. This hook holds an\n * optimistic value for the length of the animation so the tick draws\n * immediately, then defers to the host once its value agrees.\n *\n * The hook owns the timing only. Paint the tick in CSS — a\n * `stroke-dashoffset` transition keyed off `drawing` — so the animation\n * honours the `--animation-duration` token in the accessible theme.\n */\nexport function useCheckAnimation({\n checked,\n durationMs = 200,\n reduceMotion,\n}: UseCheckAnimationOptions): UseCheckAnimationReturn {\n const systemReduced = usePrefersReducedMotion();\n const reduced = reduceMotion ?? systemReduced;\n const effective = reduced ? 0 : durationMs;\n\n const [optimistic, setOptimistic] = useState<boolean | null>(null);\n const [drawing, setDrawing] = useState(false);\n const timer = useRef<number | null>(null);\n\n const current = optimistic ?? checked;\n\n // Once the host agrees with the optimistic value, stop overriding it.\n useEffect(() => {\n if (optimistic !== null && optimistic === checked) setOptimistic(null);\n }, [optimistic, checked]);\n\n useEffect(\n () => () => {\n if (timer.current !== null) window.clearTimeout(timer.current);\n },\n [],\n );\n\n const toggle = useCallback((): boolean => {\n const next = !(optimistic ?? checked);\n setOptimistic(next);\n if (timer.current !== null) window.clearTimeout(timer.current);\n // Only the tick draws; clearing it is instant.\n if (!next || effective === 0) {\n setDrawing(false);\n return next;\n }\n setDrawing(true);\n timer.current = window.setTimeout(() => {\n timer.current = null;\n setDrawing(false);\n }, effective);\n return next;\n }, [optimistic, checked, effective]);\n\n return { checked: current, drawing, durationMs: effective, toggle };\n}\n"],"names":["useCheckAnimation","checked","durationMs","reduceMotion","systemReduced","usePrefersReducedMotion","effective","optimistic","setOptimistic","useState","drawing","setDrawing","timer","useRef","current","useEffect","toggle","useCallback","next"],"mappings":";;AAgEO,SAASA,EAAkB;AAAA,EAChC,SAAAC;AAAA,EACA,YAAAC,IAAa;AAAA,EACb,cAAAC;AACF,GAAsD;AACpD,QAAMC,IAAgBC,EAAA,GAEhBC,IADUH,KAAgBC,IACJ,IAAIF,GAE1B,CAACK,GAAYC,CAAa,IAAIC,EAAyB,IAAI,GAC3D,CAACC,GAASC,CAAU,IAAIF,EAAS,EAAK,GACtCG,IAAQC,EAAsB,IAAI,GAElCC,IAAUP,KAAcN;AAG9B,EAAAc,EAAU,MAAM;AACd,IAAIR,MAAe,QAAQA,MAAeN,OAAuB,IAAI;AAAA,EACvE,GAAG,CAACM,GAAYN,CAAO,CAAC,GAExBc;AAAA,IACE,MAAM,MAAM;AACV,MAAIH,EAAM,YAAY,QAAM,OAAO,aAAaA,EAAM,OAAO;AAAA,IAC/D;AAAA,IACA,CAAA;AAAA,EAAC;AAGH,QAAMI,IAASC,EAAY,MAAe;AACxC,UAAMC,IAAO,EAAEX,KAAcN;AAI7B,WAHAO,EAAcU,CAAI,GACdN,EAAM,YAAY,QAAM,OAAO,aAAaA,EAAM,OAAO,GAEzD,CAACM,KAAQZ,MAAc,KACzBK,EAAW,EAAK,GACTO,MAETP,EAAW,EAAI,GACfC,EAAM,UAAU,OAAO,WAAW,MAAM;AACtC,MAAAA,EAAM,UAAU,MAChBD,EAAW,EAAK;AAAA,IAClB,GAAGL,CAAS,GACLY;AAAA,EACT,GAAG,CAACX,GAAYN,GAASK,CAAS,CAAC;AAEnC,SAAO,EAAE,SAASQ,GAAS,SAAAJ,GAAS,YAAYJ,GAAW,QAAAU,EAAA;AAC7D;"}
@@ -0,0 +1,100 @@
1
+ import { useState as h, useRef as R, useEffect as L, useCallback as g } from "react";
2
+ import { u as x } from "./use-prefers-reduced-motion-BMwIQRjB.js";
3
+ import { u as E } from "./use-isomorphic-layout-effect-BGfaCOP1.js";
4
+ function T({
5
+ durationMs: p = 200,
6
+ delayMs: y = 0,
7
+ reduceMotion: v
8
+ } = {}) {
9
+ const w = x(), u = v ?? w, r = u ? 0 : y, s = u ? 0 : p, a = r + s, [f, c] = h(
10
+ () => /* @__PURE__ */ new Set()
11
+ ), t = R(/* @__PURE__ */ new Map());
12
+ L(
13
+ () => () => {
14
+ t.current.forEach((e) => window.clearTimeout(e)), t.current.clear();
15
+ },
16
+ []
17
+ );
18
+ const i = g(
19
+ (e, n) => {
20
+ if (a === 0) {
21
+ n();
22
+ return;
23
+ }
24
+ if (t.current.has(e)) return;
25
+ const d = () => {
26
+ c((o) => {
27
+ const l = new Set(o);
28
+ return l.add(e), l;
29
+ });
30
+ const m = window.setTimeout(() => {
31
+ t.current.delete(e), c((o) => {
32
+ if (!o.has(e)) return o;
33
+ const l = new Set(o);
34
+ return l.delete(e), l;
35
+ }), n();
36
+ }, s);
37
+ t.current.set(e, m);
38
+ };
39
+ if (r === 0) {
40
+ d();
41
+ return;
42
+ }
43
+ t.current.set(e, window.setTimeout(d, r));
44
+ },
45
+ [a, r, s]
46
+ );
47
+ return { isLeaving: g((e) => f.has(e), [f]), leave: i, durationMs: a };
48
+ }
49
+ const b = [
50
+ "ds:[transform:translateY(var(--reflow-dy,0px))]",
51
+ "ds:transition-transform ds:duration-[var(--animation-duration)]",
52
+ "ds:ease-[var(--ease-out)]",
53
+ "ds:data-[reflow-snap]:transition-none",
54
+ "ds:motion-reduce:transition-none"
55
+ ].join(" ");
56
+ function C({
57
+ key: p,
58
+ durationMs: y = 200,
59
+ reduceMotion: v
60
+ }) {
61
+ const w = R(null), u = R(null), r = x(), s = v ?? r;
62
+ return E(() => {
63
+ const a = w.current;
64
+ if (!a) return;
65
+ const f = Array.from(
66
+ a.querySelectorAll("[data-reflow-id]")
67
+ ), c = /* @__PURE__ */ new Map();
68
+ for (const e of f) {
69
+ const n = e.dataset.reflowId;
70
+ n && c.set(n, e.getBoundingClientRect().top);
71
+ }
72
+ const t = u.current;
73
+ if (u.current = c, !t || s) return;
74
+ const i = [];
75
+ for (const e of f) {
76
+ const n = e.dataset.reflowId;
77
+ if (!n) continue;
78
+ const d = t.get(n), m = c.get(n);
79
+ if (d === void 0 || m === void 0) continue;
80
+ const o = d - m;
81
+ Math.abs(o) < 1 || (e.dataset.reflowSnap = "", e.style.setProperty("--reflow-dy", `${o}px`), i.push(e));
82
+ }
83
+ if (i.length === 0) return;
84
+ const S = window.requestAnimationFrame(() => {
85
+ for (const e of i)
86
+ delete e.dataset.reflowSnap, e.style.setProperty("--reflow-dy", "0px");
87
+ });
88
+ return () => {
89
+ window.cancelAnimationFrame(S);
90
+ for (const e of i)
91
+ delete e.dataset.reflowSnap, e.style.removeProperty("--reflow-dy");
92
+ };
93
+ }, [p, s, y]), { containerRef: w };
94
+ }
95
+ export {
96
+ b as R,
97
+ C as a,
98
+ T as u
99
+ };
100
+ //# sourceMappingURL=use-list-reflow-Cw43nxw5.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-list-reflow-Cw43nxw5.js","sources":["../../src/hooks/use-exit-transition.ts","../../src/hooks/use-list-reflow.ts"],"sourcesContent":["import { useCallback, useEffect, useRef, useState } from 'react';\nimport { usePrefersReducedMotion } from './use-prefers-reduced-motion';\n\n/* -------------------------------------------------------------------- */\n/* Types */\n/* -------------------------------------------------------------------- */\n\nexport interface UseExitTransitionOptions {\n /**\n * How long the exit takes, in milliseconds. Keep it in step with the CSS\n * transition the caller paints — `--duration-normal` (200ms) is the kit's\n * default and the hook's too.\n */\n durationMs?: number;\n /**\n * Hold this long before the exit begins. The row is not reported as\n * leaving until it elapses, so an animation already playing on the row (a\n * tick drawing in) finishes before the fade starts rather than sharing it.\n * Default 0.\n */\n delayMs?: number;\n /**\n * Force the reduced-motion branch. Defaults to reading\n * `prefers-reduced-motion: reduce`. When reduced, `leave` commits\n * synchronously and nothing is ever reported as leaving.\n */\n reduceMotion?: boolean;\n}\n\nexport interface UseExitTransitionReturn {\n /** Whether this id is mid-exit. Reflect it onto the row (e.g. `data-leaving`). */\n isLeaving: (id: string) => boolean;\n /**\n * Start `id` leaving, then run `commit` once the exit has played. Calling\n * it twice for the same id is a no-op, so a double click cannot remove a\n * row twice. Under reduced motion `commit` runs immediately.\n */\n leave: (id: string, commit: () => void) => void;\n /** The effective total delay + duration — 0 under reduced motion. */\n durationMs: number;\n}\n\n/* -------------------------------------------------------------------- */\n/* Hook */\n/* -------------------------------------------------------------------- */\n\n/**\n * Holds a row on screen long enough to fade out before the host removes it.\n *\n * A list that drops an item the instant it is actioned gives no sense of\n * where the item went. This hook inverts the order: mark the row as leaving,\n * let CSS fade it, and only then tell the host to drop it — so the removal\n * the user sees and the state change agree.\n *\n * The hook owns the timing only. Paint the exit in CSS, keyed off\n * `isLeaving`, so it honours the `--animation-duration` token in the\n * accessible theme. Pending exits are cancelled on unmount, so a commit\n * never fires against a list that has gone away.\n */\nexport function useExitTransition({\n durationMs = 200,\n delayMs = 0,\n reduceMotion,\n}: UseExitTransitionOptions = {}): UseExitTransitionReturn {\n const systemReduced = usePrefersReducedMotion();\n const reduced = reduceMotion ?? systemReduced;\n const effectiveDelay = reduced ? 0 : delayMs;\n const effectiveDuration = reduced ? 0 : durationMs;\n const effective = effectiveDelay + effectiveDuration;\n\n const [leaving, setLeaving] = useState<ReadonlySet<string>>(\n () => new Set<string>(),\n );\n const timers = useRef(new Map<string, number>());\n\n useEffect(\n () => () => {\n timers.current.forEach((timer) => window.clearTimeout(timer));\n timers.current.clear();\n },\n [],\n );\n\n const leave = useCallback(\n (id: string, commit: () => void) => {\n if (effective === 0) {\n commit();\n return;\n }\n // Already on its way out — the second click has nothing left to do.\n if (timers.current.has(id)) return;\n\n /* Phase two: the row is reported as leaving, CSS fades it, and only\n then is the host told. */\n const startExit = () => {\n setLeaving((prev) => {\n const next = new Set(prev);\n next.add(id);\n return next;\n });\n const done = window.setTimeout(() => {\n timers.current.delete(id);\n setLeaving((prev) => {\n if (!prev.has(id)) return prev;\n const next = new Set(prev);\n next.delete(id);\n return next;\n });\n commit();\n }, effectiveDuration);\n timers.current.set(id, done);\n };\n\n if (effectiveDelay === 0) {\n startExit();\n return;\n }\n // Phase one: hold, so whatever is already animating on the row lands\n // before the fade takes it away. The id counts as spoken for meanwhile.\n timers.current.set(id, window.setTimeout(startExit, effectiveDelay));\n },\n [effective, effectiveDelay, effectiveDuration],\n );\n\n const isLeaving = useCallback((id: string) => leaving.has(id), [leaving]);\n\n return { isLeaving, leave, durationMs: effective };\n}\n","import { useRef, type RefObject } from 'react';\nimport { useIsomorphicLayoutEffect } from './use-isomorphic-layout-effect';\nimport { usePrefersReducedMotion } from './use-prefers-reduced-motion';\n\n/* -------------------------------------------------------------------- */\n/* Types */\n/* -------------------------------------------------------------------- */\n\nexport interface UseListReflowOptions {\n /**\n * Changes to this string trigger a measurement pass — pass the rendered\n * ids in order (`items.map((i) => i.id).join()`), so the hook runs when\n * the list is reordered, added to or removed from, and not on every\n * unrelated re-render.\n */\n key: string;\n /**\n * How long a row takes to travel to its new place, in milliseconds.\n * Matches the CSS the row paints via {@link REFLOW_ROW_CLASS}.\n */\n durationMs?: number;\n /**\n * Force the reduced-motion branch. Defaults to reading\n * `prefers-reduced-motion: reduce`. When reduced, rows jump as before.\n */\n reduceMotion?: boolean;\n}\n\nexport interface UseListReflowReturn<T extends HTMLElement> {\n /** Attach to the element that contains the tracked rows. */\n containerRef: RefObject<T | null>;\n}\n\n/**\n * Every tracked row must carry this class and a `data-reflow-id`. It parks\n * the row at the offset the hook sets and animates it back to zero; the\n * snap frame that sets the offset is exempted, so the jump itself is never\n * animated.\n */\nexport const REFLOW_ROW_CLASS = [\n 'ds:[transform:translateY(var(--reflow-dy,0px))]',\n 'ds:transition-transform ds:duration-[var(--animation-duration)]',\n 'ds:ease-[var(--ease-out)]',\n 'ds:data-[reflow-snap]:transition-none',\n 'ds:motion-reduce:transition-none',\n].join(' ');\n\n/* -------------------------------------------------------------------- */\n/* Hook */\n/* -------------------------------------------------------------------- */\n\n/**\n * Slides the surviving rows of a list to their new positions instead of\n * letting them snap.\n *\n * When a row is removed the rows below it jump up by its height, and the eye\n * loses its place — the list looks like it re-rendered rather than like one\n * row left. This runs the standard invert-and-play: it records where each\n * row sat, and after the DOM changes it puts each moved row back where it\n * was and releases it, so the gap closes as a movement.\n *\n * Measurement happens before paint, so no intermediate frame is shown. Rows\n * that are new (no previous position) are left alone — this animates travel,\n * not arrival.\n */\nexport function useListReflow<T extends HTMLElement>({\n key,\n durationMs = 200,\n reduceMotion,\n}: UseListReflowOptions): UseListReflowReturn<T> {\n const containerRef = useRef<T | null>(null);\n const positions = useRef<Map<string, number> | null>(null);\n const systemReduced = usePrefersReducedMotion();\n const reduced = reduceMotion ?? systemReduced;\n\n useIsomorphicLayoutEffect(() => {\n const root = containerRef.current;\n if (!root) return;\n\n const rows = Array.from(\n root.querySelectorAll<HTMLElement>('[data-reflow-id]'),\n );\n const next = new Map<string, number>();\n for (const row of rows) {\n const id = row.dataset.reflowId;\n if (id) next.set(id, row.getBoundingClientRect().top);\n }\n\n const previous = positions.current;\n positions.current = next;\n // First pass has nothing to compare against, and reduced motion has\n // nothing to say.\n if (!previous || reduced) return;\n\n const moved: HTMLElement[] = [];\n for (const row of rows) {\n const id = row.dataset.reflowId;\n if (!id) continue;\n const before = previous.get(id);\n const after = next.get(id);\n if (before === undefined || after === undefined) continue;\n const delta = before - after;\n // Sub-pixel shifts are noise, not movement.\n if (Math.abs(delta) < 1) continue;\n row.dataset.reflowSnap = '';\n row.style.setProperty('--reflow-dy', `${delta}px`);\n moved.push(row);\n }\n if (moved.length === 0) return;\n\n // Release on the next frame: setting the offset and clearing it in one\n // frame is a no-op the browser never paints.\n const frame = window.requestAnimationFrame(() => {\n for (const row of moved) {\n delete row.dataset.reflowSnap;\n row.style.setProperty('--reflow-dy', '0px');\n }\n });\n\n return () => {\n window.cancelAnimationFrame(frame);\n // Leave nothing parked if the list re-renders mid-flight.\n for (const row of moved) {\n delete row.dataset.reflowSnap;\n row.style.removeProperty('--reflow-dy');\n }\n };\n }, [key, reduced, durationMs]);\n\n return { containerRef };\n}\n"],"names":["useExitTransition","durationMs","delayMs","reduceMotion","systemReduced","usePrefersReducedMotion","reduced","effectiveDelay","effectiveDuration","effective","leaving","setLeaving","useState","timers","useRef","useEffect","timer","leave","useCallback","id","commit","startExit","prev","next","done","REFLOW_ROW_CLASS","useListReflow","key","containerRef","positions","useIsomorphicLayoutEffect","root","rows","row","previous","moved","before","after","delta","frame"],"mappings":";;;AA2DO,SAASA,EAAkB;AAAA,EAChC,YAAAC,IAAa;AAAA,EACb,SAAAC,IAAU;AAAA,EACV,cAAAC;AACF,IAA8B,IAA6B;AACzD,QAAMC,IAAgBC,EAAA,GAChBC,IAAUH,KAAgBC,GAC1BG,IAAiBD,IAAU,IAAIJ,GAC/BM,IAAoBF,IAAU,IAAIL,GAClCQ,IAAYF,IAAiBC,GAE7B,CAACE,GAASC,CAAU,IAAIC;AAAA,IAC5B,0BAAU,IAAA;AAAA,EAAY,GAElBC,IAASC,EAAO,oBAAI,KAAqB;AAE/C,EAAAC;AAAA,IACE,MAAM,MAAM;AACV,MAAAF,EAAO,QAAQ,QAAQ,CAACG,MAAU,OAAO,aAAaA,CAAK,CAAC,GAC5DH,EAAO,QAAQ,MAAA;AAAA,IACjB;AAAA,IACA,CAAA;AAAA,EAAC;AAGH,QAAMI,IAAQC;AAAA,IACZ,CAACC,GAAYC,MAAuB;AAClC,UAAIX,MAAc,GAAG;AACnB,QAAAW,EAAA;AACA;AAAA,MACF;AAEA,UAAIP,EAAO,QAAQ,IAAIM,CAAE,EAAG;AAI5B,YAAME,IAAY,MAAM;AACtB,QAAAV,EAAW,CAACW,MAAS;AACnB,gBAAMC,IAAO,IAAI,IAAID,CAAI;AACzB,iBAAAC,EAAK,IAAIJ,CAAE,GACJI;AAAA,QACT,CAAC;AACD,cAAMC,IAAO,OAAO,WAAW,MAAM;AACnC,UAAAX,EAAO,QAAQ,OAAOM,CAAE,GACxBR,EAAW,CAACW,MAAS;AACnB,gBAAI,CAACA,EAAK,IAAIH,CAAE,EAAG,QAAOG;AAC1B,kBAAMC,IAAO,I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AAC7B,eAAWF,KAAOD,GAAM;AACtB,YAAMb,IAAKc,EAAI,QAAQ;AACvB,UAAI,CAACd,EAAI;AACT,YAAMiB,IAASF,EAAS,IAAIf,CAAE,GACxBkB,IAAQd,EAAK,IAAIJ,CAAE;AACzB,UAAIiB,MAAW,UAAaC,MAAU,OAAW;AACjD,YAAMC,IAAQF,IAASC;AAEvB,MAAI,KAAK,IAAIC,CAAK,IAAI,MACtBL,EAAI,QAAQ,aAAa,IACzBA,EAAI,MAAM,YAAY,eAAe,GAAGK,CAAK,IAAI,GACjDH,EAAM,KAAKF,CAAG;AAAA,IAChB;AACA,QAAIE,EAAM,WAAW,EAAG;AAIxB,UAAMI,IAAQ,OAAO,sBAAsB,MAAM;AAC/C,iBAAWN,KAAOE;AAChB,eAAOF,EAAI,QAAQ,YACnBA,EAAI,MAAM,YAAY,eAAe,KAAK;AAAA,IAE9C,CAAC;AAED,WAAO,MAAM;AACX,aAAO,qBAAqBM,CAAK;AAEjC,iBAAWN,KAAOE;AAChB,eAAOF,EAAI,QAAQ,YACnBA,EAAI,MAAM,eAAe,aAAa;AAAA,IAE1C;AAAA,EACF,GAAG,CAACN,GAAKrB,GAASL,CAAU,CAAC,GAEtB,EAAE,cAAA2B,EAAA;AACX;"}
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
- "packageVersion": "1.33.0",
3
+ "packageVersion": "1.35.0",
4
4
  "components": [
5
5
  {
6
6
  "kind": "component",
@@ -7074,6 +7074,20 @@
7074
7074
  }
7075
7075
  }
7076
7076
  },
7077
+ {
7078
+ "kind": "component",
7079
+ "id": "money",
7080
+ "capabilities": [],
7081
+ "state": [],
7082
+ "actions": [],
7083
+ "domHooks": {
7084
+ "root": {
7085
+ "attr": "data-component",
7086
+ "value": "money",
7087
+ "description": "Marks the element as a kit Money amount."
7088
+ }
7089
+ }
7090
+ },
7077
7091
  {
7078
7092
  "kind": "component",
7079
7093
  "id": "multi-select",
@@ -18,4 +18,19 @@
18
18
  * behaviour differs.
19
19
  */
20
20
  export declare function formatPrice(minorUnits: number, currency: string, locale: string): string;
21
+ /**
22
+ * The same amount as {@link formatPrice}, but broken into its typed parts so
23
+ * a renderer can treat the fraction differently from the rest.
24
+ *
25
+ * Splitting a formatted price with a regex is not safe across locales: in
26
+ * `it-IT` the group separator is `.` and the decimal is `,`, so `1.000 €`
27
+ * would read as a fraction of `000` and a "drop the zero fraction" rule
28
+ * would render it as `1 €`. `Intl.NumberFormat.formatToParts` labels each
29
+ * piece, so the fraction is whatever the locale says it is, wherever it
30
+ * sits relative to the currency symbol.
31
+ *
32
+ * Returns `null` when the locale or currency is rejected — callers fall
33
+ * back to {@link formatPrice}, which keeps the zero-decimal rule.
34
+ */
35
+ export declare function formatPriceParts(minorUnits: number, currency: string, locale: string, options?: Pick<Intl.NumberFormatOptions, 'signDisplay'>): Intl.NumberFormatPart[] | null;
21
36
  //# sourceMappingURL=format-price.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"format-price.d.ts","sourceRoot":"","sources":["../../../src/components/_shared/format-price.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAgCH,wBAAgB,WAAW,CACzB,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,GACb,MAAM,CAoBR"}
1
+ {"version":3,"file":"format-price.d.ts","sourceRoot":"","sources":["../../../src/components/_shared/format-price.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAgCH,wBAAgB,WAAW,CACzB,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,GACb,MAAM,CAoBR;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,gBAAgB,CAC9B,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,EACd,OAAO,GAAE,IAAI,CAAC,IAAI,CAAC,mBAAmB,EAAE,aAAa,CAAM,GAC1D,IAAI,CAAC,gBAAgB,EAAE,GAAG,IAAI,CAchC"}
@@ -13,12 +13,15 @@ export interface AppointmentOperator {
13
13
  /** Numeric palette colour id, resolved to a kit token for the colour dot. */
14
14
  colorId?: number | string;
15
15
  }
16
- /** Patient summary — identity only, drives the avatar. */
16
+ /** Patient summary — identity + optional age driver. */
17
17
  export interface AppointmentPatient {
18
18
  /** Patient display name. */
19
19
  name: string;
20
20
  /** Optional avatar image URL. */
21
21
  avatarUrl?: string;
22
+ /** ISO-8601 date of birth — when present, the card renders the age as a
23
+ * suffix on the name (e.g. "Carol Danvers · 45"). */
24
+ dobIso?: string;
22
25
  }
23
26
  /** One treatment line within the appointment. */
24
27
  export interface AppointmentTreatment {
@@ -38,6 +41,22 @@ export interface AppointmentBookingReason {
38
41
  /** Localised specialty label. */
39
42
  specialty?: string;
40
43
  }
44
+ /** Money summary for the appointment. */
45
+ export interface AppointmentMoney {
46
+ /** Total billable amount in cents. When present, rendered as a
47
+ * TransactionChip. */
48
+ billableAmountCents?: number;
49
+ /** Outstanding unpaid amount in cents. When > 0, rendered as a warning
50
+ * TransactionChip so the front desk can flag it at a glance. */
51
+ unpaidAmountCents?: number;
52
+ }
53
+ /** Signing status for documents attached to the appointment. */
54
+ export interface AppointmentSigning {
55
+ /** How many documents require a signature. */
56
+ required: number;
57
+ /** How many have been completed so far. */
58
+ toComplete: number;
59
+ }
41
60
  /** Boolean appointment flags surfaced as chips / indicators. */
42
61
  export interface AppointmentFlags {
43
62
  bookedOnline?: boolean;
@@ -80,6 +99,15 @@ export interface AppointmentItem {
80
99
  bookingReason?: AppointmentBookingReason;
81
100
  /** Boolean flags. */
82
101
  flags?: AppointmentFlags;
102
+ /** Money summary — billable + unpaid amounts. */
103
+ money?: AppointmentMoney;
104
+ /** Whether this appointment is part of a recurring series. */
105
+ recurring?: boolean;
106
+ /** Signing status for attached documents. */
107
+ signing?: AppointmentSigning;
108
+ /** A note left by the patient at booking time. When present, a small
109
+ * message icon signals it. */
110
+ bookingNote?: string;
83
111
  /** Optional deep link — when present (and safe) the row renders as an anchor. */
84
112
  url?: string;
85
113
  }
@@ -87,6 +115,7 @@ declare const appointmentCardVariants: (props?: ({
87
115
  size?: "sm" | "md" | null | undefined;
88
116
  interactive?: boolean | null | undefined;
89
117
  surface?: "elevated" | "flat" | null | undefined;
118
+ selected?: boolean | null | undefined;
90
119
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
91
120
  export interface AppointmentCardProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onClick' | 'title'>, VariantProps<typeof appointmentCardVariants> {
92
121
  /** The appointment to render. */
@@ -112,6 +141,12 @@ export interface AppointmentCardProps extends Omit<HTMLAttributes<HTMLDivElement
112
141
  showPatient?: boolean;
113
142
  /** Fires when the row is activated. */
114
143
  onActivate?: (item: AppointmentItem) => void;
144
+ /**
145
+ * Mark this row as the active/selected appointment — an info-tinted
146
+ * inline-start bar plus a soft wash, so the eye keeps its place in the
147
+ * list after a click. Renders `aria-current="true"` for assistive tech.
148
+ */
149
+ selected?: boolean;
115
150
  }
116
151
  export declare const AppointmentCard: import("react").ForwardRefExoticComponent<AppointmentCardProps & import("react").RefAttributes<HTMLDivElement>>;
117
152
  //# sourceMappingURL=appointment-card.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"appointment-card.d.ts","sourceRoot":"","sources":["../../../src/components/appointment-card/appointment-card.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,cAAc,EAAkB,MAAM,OAAO,CAAC;AACxE,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAsBlE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AA6C/D,OAAO,EAAE,eAAe,IAAI,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAMjF,oCAAoC;AACpC,MAAM,MAAM,eAAe,GAAG,YAAY,GAAG,YAAY,CAAC;AAE1D,kCAAkC;AAClC,MAAM,MA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8D;IAC9D,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,6CAA6C;IAC7C,OAAO,CAAC,EAAE,kBAAkB,CAAC;IAC7B;kCAC8B;IAC9B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iFAAiF;IACjF,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAMD,QAAA,MAAM,uBAAuB;;;;;8EA+C5B,CAAC;AAwBF,MAAM,WAAW,oBACf,SACE,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,SAAS,GAAG,OAAO,CAAC,EACzD,YAAY,CAAC,OAAO,uBAAuB,CAAC;IAC9C,iCAAiC;IACjC,IAAI,EAAE,eAAe,CAAC;IACtB,sBAAsB;IACtB,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACnB;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,UAAU,CAAC;IAC9B,2DAA2D;IAC3D,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,8EAA8E;IAC9E,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;;;OAKG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,uCAAuC;IACvC,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,eAAe,KAAK,IAAI,CAAC;IAC7C;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAMD,eAAO,MAAM,eAAe,iHAiX3B,CAAC"}
@@ -1,5 +1,5 @@
1
- import { A as p } from "../../_chunks/appointment-card-D-oj_ugh.js";
2
- import { A as e, a as o, b as r } from "../../_chunks/appointment-tray-DCk8gHod.js";
1
+ import { A as p } from "../../_chunks/appointment-card-Bh_CIlc6.js";
2
+ import { A as e, a as o, b as r } from "../../_chunks/appointment-tray-4I9wTAi4.js";
3
3
  import { i } from "../../_chunks/is-safe-url-DkETxeHz.js";
4
4
  export {
5
5
  p as AppointmentCard,
@@ -39,6 +39,12 @@ export interface AppointmentTimelineProps extends Omit<HTMLAttributes<HTMLElemen
39
39
  showPatient?: boolean;
40
40
  /** Fires when a row is activated. */
41
41
  onOpenAppointment?: (item: AppointmentItem) => void;
42
+ /**
43
+ * The id of the currently selected appointment. The matching card
44
+ * renders with `selected` (info-tinted accent + `aria-current`) so the
45
+ * eye keeps its place in the list after a click.
46
+ */
47
+ selectedId?: string;
42
48
  /** Load earlier (past) appointments — fired when the top edge is reached. */
43
49
  onLoadEarlier?: () => void;
44
50
  /** Load later (future) appointments — fired when the bottom edge is reached. */
@@ -1 +1 @@
1
- {"version":3,"file":"appointment-timeline.d.ts","sourceRoot":"","sources":["../../../src/components/appointment-timeline/appointment-timeline.tsx"],"names":[],"mappings":"AAAA,OAAO,EAQL,KAAK,cAAc,EAEpB,MAAM,OAAO,CAAC;AACf,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAGlE,OAAO,EAAmB,KAAK,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAqC5E,sEAAsE;AACtE,MAAM,WAAW,yBAAyB;IACxC,QAAQ,EAAE,MAAM,KAAK,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACrD,UAAU,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IACjC,WAAW,EAAE,MAAM,IAAI,CAAC;CACzB;AAED,MAAM,WAAW,wBAAyB,SAAQ,IAAI,CACpD,cAAc,CAAC,WAAW,CAAC,EAC3B,SAAS,GAAG,IAAI,GAAG,OAAO,CAC3B;IACC,2DAA2D;IAC3D,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,uEAAuE;IACvE,KAAK,EAAE,eAAe,EAAE,CAAC;IACzB;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,+DAA+D;IAC/D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,qEAAqE;IACrE,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,6DAA6D;IAC7D,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,qDAAqD;IACrD,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACnB;;;;;;OAMG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,qCAAqC;IACrC,iBAAiB,CAAC,EAAE,CAAC,IAAI,EAAE,eAAe,KAAK,IAAI,CAAC;IAGpD,6EAA6E;IAC7E,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;IAC3B,gFAAgF;IAChF,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;IACzB,4FAA4F;IAC5F,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,4FAA4F;IAC5F,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,0CAA0C;IAC1C,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,6CAA6C;IAC7C,YAAY,CAAC,EAAE,OAAO,CAAC;IAGvB,yEAAyE;IACzE,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;;;OAIG;IACH,YAAY,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IAGzC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B,kEAAkE;IAClE,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAMD,QAAA,MAAM,YAAY;;8EAMjB,CAAC;AAiEF,eAAO,MAAM,mBAAmB,kHAiV/B,CAAC;AAyEF,iEAAiE;AACjE,MAAM,MAAM,uBAAuB,GAAG,WAAW,CAC/C,YAAY,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,CAAC,CAC1C,CAAC"}
1
+ {"version":3,"file":"appointment-timeline.d.ts","sourceRoot":"","sources":["../../../src/components/appointment-timeline/appointment-timeline.tsx"],"names":[],"mappings":"AAAA,OAAO,EASL,KAAK,cAAc,EAEpB,MAAM,OAAO,CAAC;AACf,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0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AC1C,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,6CAA6C;IAC7C,YAAY,CAAC,EAAE,OAAO,CAAC;IAGvB,yEAAyE;IACzE,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;;;OAIG;IACH,YAAY,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IAGzC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B,kEAAkE;IAClE,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAMD,QAAA,MAAM,YAAY;;8EAMjB,CAAC;AAiEF,eAAO,MAAM,mBAAmB,kHAoZ/B,CAAC;AAyEF,iEAAiE;AACjE,MAAM,MAAM,uBAAuB,GAAG,WAAW,CAC/C,YAAY,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,CAAC,CAC1C,CAAC"}
@@ -1,4 +1,4 @@
1
- import { A as i, a as t } from "../../_chunks/appointment-timeline-CymGHyIP.js";
1
+ import { A as i, a as t } from "../../_chunks/appointment-timeline-De-Wqdkw.js";
2
2
  export {
3
3
  i as AppointmentTimeline,
4
4
  t as appointmentTimelineAgent
@@ -1,4 +1,4 @@
1
- import { C as e, c as C } from "../../_chunks/care-plan-card-CZW476Kg.js";
1
+ import { C as e, c as C } from "../../_chunks/care-plan-card-DHVhBcvs.js";
2
2
  export {
3
3
  e as CarePlanCard,
4
4
  C as carePlanCardAgent
@@ -1,4 +1,4 @@
1
- import { C as n, c as e } from "../../_chunks/care-plan-entry-card-BMUYagEw.js";
1
+ import { C as n, c as e } from "../../_chunks/care-plan-entry-card-Dx6IdTcR.js";
2
2
  export {
3
3
  n as CarePlanEntryCard,
4
4
  e as carePlanEntryCardAgent
@@ -1,4 +1,4 @@
1
- import { C as r, c as n } from "../../_chunks/care-plan-header-B5CBE0zu.js";
1
+ import { C as r, c as n } from "../../_chunks/care-plan-header-UTX5ZD74.js";
2
2
  export {
3
3
  r as CarePlanHeader,
4
4
  n as carePlanHeaderAgent
@@ -1,4 +1,4 @@
1
- import { type HTMLAttributes } from 'react';
1
+ import { type HTMLAttributes, type ReactNode } from 'react';
2
2
  import { type VariantProps } from 'class-variance-authority';
3
3
  /** Author identity — drives the avatar + visible byline. */
4
4
  export interface ClinicalNoteAuthor {
@@ -105,6 +105,13 @@ export interface ClinicalNoteCardProps extends Omit<HTMLAttributes<HTMLDivElemen
105
105
  * the note can be (un)pinned in place — the pin glyph fills and tints to the
106
106
  * accent when pinned (no button fill). Omit for a static, display-only card.
107
107
  */
108
+ /**
109
+ * Host-owned actions for this note (edit, delete, share …), rendered
110
+ * beside the pin and flag. They belong in the same cluster: a reader
111
+ * looking for what they can do to a note should find every affordance
112
+ * in one place, not some in the card and the rest below it.
113
+ */
114
+ headerActions?: ReactNode;
108
115
  onTogglePin?: () => void;
109
116
  /** As `onTogglePin`, for the flagged state (warning-tinted when flagged). */
110
117
  onToggleFlag?: () => void;
@@ -1 +1 @@
1
- {"version":3,"file":"clinical-note-card.d.ts","sourceRoot":"","sources":["../../../src/components/clinical-note-card/clinical-note-card.tsx"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,cAAc,EAEpB,MAAM,OAAO,CAAC;AACf,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAkClE,4DAA4D;AAC5D,MAAM,WAAW,kBAAkB;IACjC,oBAAoB;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,iCAAiC;IACjC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,cAAc,GACtB;IAAE,IAAI,EAAE,SAAS,CAAA;CAAE,GACnB;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GAClD;IACE,IAAI,EAAE,eAAe,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ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,CAAC;IACpC,qEAAqE;IACrE,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,wEAAwE;IACxE,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;IACzB,6EAA6E;IAC7E,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,UAAU,CAAC;IAC9B,8CAA8C;IAC9C,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAMD,QAAA,MAAM,YAAY;;8EAKhB,CAAC;AAiLH,eAAO,MAAM,gBAAgB,kHAgW5B,CAAC;AAIF,oEAAoE;AACpE,MAAM,MAAM,uBAAuB,GAAG,WAAW,CAC/C,YAAY,CAAC,OAAO,YAAY,CAAC,CAAC,SAAS,CAAC,CAC7C,CAAC"}
1
+ {"version":3,"file":"clinical-note-card.d.ts","sourceRoot":"","sources":["../../../src/components/clinical-note-card/clinical-note-card.tsx"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,cAAc,EACnB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAkClE,4DAA4D;AAC5D,MAAM,WAAW,kBAAkB;IACjC,oBAAoB;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,iCAAiC;IACjC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,cAAc,GACtB;IAAE,IAAI,EAAE,SAAS,CAAA;CAAE,GACnB;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GAClD;IACE,IAAI,EAAE,eAAe,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC;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GAAG,MAAM,CAAC;IACpC,qEAAqE;IACrE,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,wEAAwE;IACxE,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;OAIG;IACH;;;;;OAKG;IACH,aAAa,CAAC,EAAE,SAAS,CAAC;IAC1B,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;IACzB,6EAA6E;IAC7E,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,UAAU,CAAC;IAC9B,8CAA8C;IAC9C,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAMD,QAAA,MAAM,YAAY;;8EAKhB,CAAC;AAiLH,eAAO,MAAM,gBAAgB,kHAqW5B,CAAC;AAIF,oEAAoE;AACpE,MAAM,MAAM,uBAAuB,GAAG,WAAW,CAC/C,YAAY,CAAC,OAAO,YAAY,CAAC,CAAC,SAAS,CAAC,CAC7C,CAAC"}
@@ -1,4 +1,4 @@
1
- import { C as e, c as i } from "../../_chunks/clinical-note-card-D2WTV2CO.js";
1
+ import { C as e, c as i } from "../../_chunks/clinical-note-card-CTRzmqvv.js";
2
2
  export {
3
3
  e as ClinicalNoteCard,
4
4
  i as clinicalNoteCardAgent