@alfadocs/ui-kit-debug 1.45.0 → 1.46.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 (284) hide show
  1. package/dist/_chunks/{actions-cell-renderer-BXBy9c0f.js → actions-cell-renderer-B5m9lwgC.js} +2 -2
  2. package/dist/_chunks/{actions-cell-renderer-BXBy9c0f.js.map → actions-cell-renderer-B5m9lwgC.js.map} +1 -1
  3. package/dist/_chunks/ai-credits-notice-xszqOZTC.js +90 -0
  4. package/dist/_chunks/ai-credits-notice-xszqOZTC.js.map +1 -0
  5. package/dist/_chunks/ai-credits-notice.agent-C9L7orrP.js +17 -0
  6. package/dist/_chunks/ai-credits-notice.agent-C9L7orrP.js.map +1 -0
  7. package/dist/_chunks/{ai-consent-banner-D7I2U-cz.js → ai-permission-notice-D7I2U-cz.js} +1 -1
  8. package/dist/_chunks/ai-permission-notice-D7I2U-cz.js.map +1 -0
  9. package/dist/_chunks/ai-sparkle-D23NT8Z_.js +45 -0
  10. package/dist/_chunks/ai-sparkle-D23NT8Z_.js.map +1 -0
  11. package/dist/_chunks/{anamnesis-summary-rows-DQUqwWc1.js → anamnesis-summary-rows-DI-UX5r6.js} +2 -2
  12. package/dist/_chunks/{anamnesis-summary-rows-DQUqwWc1.js.map → anamnesis-summary-rows-DI-UX5r6.js.map} +1 -1
  13. package/dist/_chunks/{appointment-card-TgR_2GKS.js → appointment-card-DluZy8Iv.js} +2 -2
  14. package/dist/_chunks/{appointment-card-TgR_2GKS.js.map → appointment-card-DluZy8Iv.js.map} +1 -1
  15. package/dist/_chunks/{appointment-peek-abiR0T9e.js → appointment-peek-BsfCpiJs.js} +3 -3
  16. package/dist/_chunks/{appointment-peek-abiR0T9e.js.map → appointment-peek-BsfCpiJs.js.map} +1 -1
  17. package/dist/_chunks/{appointment-timeline-CCnyUYKz.js → appointment-timeline-Cs5f9viN.js} +3 -3
  18. package/dist/_chunks/{appointment-timeline-CCnyUYKz.js.map → appointment-timeline-Cs5f9viN.js.map} +1 -1
  19. package/dist/_chunks/{appointment-tray-N0yEI8UF.js → appointment-tray-CLrGGnKR.js} +2 -2
  20. package/dist/_chunks/{appointment-tray-N0yEI8UF.js.map → appointment-tray-CLrGGnKR.js.map} +1 -1
  21. package/dist/_chunks/baby-Dku-Xvg9.js +23 -0
  22. package/dist/_chunks/baby-Dku-Xvg9.js.map +1 -0
  23. package/dist/_chunks/{balance-badge-cell-o6LldMUA.js → balance-badge-cell-YGrYdrvR.js} +3 -3
  24. package/dist/_chunks/{balance-badge-cell-o6LldMUA.js.map → balance-badge-cell-YGrYdrvR.js.map} +1 -1
  25. package/dist/_chunks/{booking-D43ASl8y.js → booking-B7gA9gFB.js} +279 -296
  26. package/dist/_chunks/booking-B7gA9gFB.js.map +1 -0
  27. package/dist/_chunks/button-group-CA1tmu39.js +325 -0
  28. package/dist/_chunks/button-group-CA1tmu39.js.map +1 -0
  29. package/dist/_chunks/{calendar-U6N0F99w.js → calendar-OzSeTb4V.js} +2 -2
  30. package/dist/_chunks/{calendar-U6N0F99w.js.map → calendar-OzSeTb4V.js.map} +1 -1
  31. package/dist/_chunks/{calendar-event-card-DKUnT9Be.js → calendar-event-card-B6N5h1dO.js} +57 -48
  32. package/dist/_chunks/{calendar-event-card-DKUnT9Be.js.map → calendar-event-card-B6N5h1dO.js.map} +1 -1
  33. package/dist/_chunks/{calendar-workspace-B7KvZ1_D.js → calendar-workspace-BB-BZT7W.js} +3002 -2912
  34. package/dist/_chunks/calendar-workspace-BB-BZT7W.js.map +1 -0
  35. package/dist/_chunks/{chart-PF2krCZC.js → chart-D8ucl8hH.js} +2 -2
  36. package/dist/_chunks/{chart-PF2krCZC.js.map → chart-D8ucl8hH.js.map} +1 -1
  37. package/dist/_chunks/{data-table-CcAx_I1w.js → data-table-DnKOmEVw.js} +2 -2
  38. package/dist/_chunks/{data-table-CcAx_I1w.js.map → data-table-DnKOmEVw.js.map} +1 -1
  39. package/dist/_chunks/{editable-currency-cell-renderer-Psb6XKHR.js → editable-currency-cell-renderer-OUkUv7U4.js} +2 -2
  40. package/dist/_chunks/{editable-currency-cell-renderer-Psb6XKHR.js.map → editable-currency-cell-renderer-OUkUv7U4.js.map} +1 -1
  41. package/dist/_chunks/{face-scheme-Bm6pe7R8.js → face-scheme-mIhwrQXt.js} +3 -3
  42. package/dist/_chunks/{face-scheme-Bm6pe7R8.js.map → face-scheme-mIhwrQXt.js.map} +1 -1
  43. package/dist/_chunks/{file-manager-BfLQxF5t.js → file-manager-DOcJGIx2.js} +4 -4
  44. package/dist/_chunks/{file-manager-BfLQxF5t.js.map → file-manager-DOcJGIx2.js.map} +1 -1
  45. package/dist/_chunks/{header-settings-CTe45iDy.js → header-settings-BEfx_-TF.js} +2 -2
  46. package/dist/_chunks/{header-settings-CTe45iDy.js.map → header-settings-BEfx_-TF.js.map} +1 -1
  47. package/dist/_chunks/{help-me-write-templates-GUeEn3Ff.js → help-me-write-templates-DHIwa4xR.js} +205 -199
  48. package/dist/_chunks/help-me-write-templates-DHIwa4xR.js.map +1 -0
  49. package/dist/_chunks/{hover-card-BMJBVqIf.js → hover-card-nUae8NPJ.js} +67 -62
  50. package/dist/_chunks/{hover-card-BMJBVqIf.js.map → hover-card-nUae8NPJ.js.map} +1 -1
  51. package/dist/_chunks/{icon-button-group-DkkdIygu.js → icon-button-group-DZKC6KGf.js} +181 -168
  52. package/dist/_chunks/icon-button-group-DZKC6KGf.js.map +1 -0
  53. package/dist/_chunks/kit-extensions-DuoFF1R3.js +94 -0
  54. package/dist/_chunks/kit-extensions-DuoFF1R3.js.map +1 -0
  55. package/dist/_chunks/{marketplace-app-shell-DdwPj03y.js → marketplace-app-shell-PB89Dkk_.js} +2 -2
  56. package/dist/_chunks/{marketplace-app-shell-DdwPj03y.js.map → marketplace-app-shell-PB89Dkk_.js.map} +1 -1
  57. package/dist/_chunks/{notes-panel-Dkk9QPPX.js → notes-panel-CHbDDMx8.js} +83 -73
  58. package/dist/_chunks/notes-panel-CHbDDMx8.js.map +1 -0
  59. package/dist/_chunks/{patient-details-C8ImUrVg.js → patient-details-DUj1htsH.js} +2 -2
  60. package/dist/_chunks/{patient-details-C8ImUrVg.js.map → patient-details-DUj1htsH.js.map} +1 -1
  61. package/dist/_chunks/{patient-field-row-BRSOKvme.js → patient-field-row-CO0WR7yA.js} +2 -2
  62. package/dist/_chunks/patient-field-row-CO0WR7yA.js.map +1 -0
  63. package/dist/_chunks/{patient-summary-card-BhmKB2KR.js → patient-summary-card-DNzdYjxE.js} +59 -45
  64. package/dist/_chunks/patient-summary-card-DNzdYjxE.js.map +1 -0
  65. package/dist/_chunks/rich-text-editor-BwDV2XkZ.js +4153 -0
  66. package/dist/_chunks/rich-text-editor-BwDV2XkZ.js.map +1 -0
  67. package/dist/_chunks/{tasks-panel-CpcikOeY.js → tasks-panel-DncuBPIZ.js} +2 -2
  68. package/dist/_chunks/{tasks-panel-CpcikOeY.js.map → tasks-panel-DncuBPIZ.js.map} +1 -1
  69. package/dist/_chunks/{theme-toggle-bI0pgDDv.js → theme-toggle-BP0XRGMM.js} +2 -2
  70. package/dist/_chunks/{theme-toggle-bI0pgDDv.js.map → theme-toggle-BP0XRGMM.js.map} +1 -1
  71. package/dist/_chunks/use-ai-sparkle-Cf4yVTLB.js +76 -0
  72. package/dist/_chunks/use-ai-sparkle-Cf4yVTLB.js.map +1 -0
  73. package/dist/_chunks/{workflow-status-xeaJTzD3.js → workflow-status-CuJAOuKL.js} +43 -42
  74. package/dist/_chunks/{workflow-status-xeaJTzD3.js.map → workflow-status-CuJAOuKL.js.map} +1 -1
  75. package/dist/agent-catalog.json +32 -4
  76. package/dist/agent-i18n/en.json +1 -1
  77. package/dist/components/_shared/field-value.d.ts.map +1 -1
  78. package/dist/components/ai-credits-notice/ai-credits-notice.agent.d.ts +3 -0
  79. package/dist/components/ai-credits-notice/ai-credits-notice.agent.d.ts.map +1 -0
  80. package/dist/components/ai-credits-notice/ai-credits-notice.d.ts +48 -0
  81. package/dist/components/ai-credits-notice/ai-credits-notice.d.ts.map +1 -0
  82. package/dist/components/ai-credits-notice/index.d.ts +4 -0
  83. package/dist/components/ai-credits-notice/index.d.ts.map +1 -0
  84. package/dist/components/ai-credits-notice/index.js +7 -0
  85. package/dist/components/ai-credits-notice/index.js.map +1 -0
  86. package/dist/components/{ai-consent-banner/ai-consent-banner.agent.d.ts → ai-permission-notice/ai-permission-notice.agent.d.ts} +2 -2
  87. package/dist/components/ai-permission-notice/ai-permission-notice.agent.d.ts.map +1 -0
  88. package/dist/components/{ai-consent-banner/ai-consent-banner.d.ts → ai-permission-notice/ai-permission-notice.d.ts} +1 -1
  89. package/dist/components/ai-permission-notice/ai-permission-notice.d.ts.map +1 -0
  90. package/dist/components/ai-permission-notice/index.d.ts +4 -0
  91. package/dist/components/ai-permission-notice/index.d.ts.map +1 -0
  92. package/dist/components/{ai-consent-banner → ai-permission-notice}/index.js +1 -1
  93. package/dist/components/ai-sparkle/ai-sparkle.d.ts +3 -3
  94. package/dist/components/ai-sparkle/ai-sparkle.d.ts.map +1 -1
  95. package/dist/components/ai-sparkle/index.js +1 -1
  96. package/dist/components/appointment-card/index.js +2 -2
  97. package/dist/components/appointment-peek/index.js +1 -1
  98. package/dist/components/appointment-timeline/index.js +1 -1
  99. package/dist/components/booking/index.js +1 -1
  100. package/dist/components/button-group/button-group.d.ts.map +1 -1
  101. package/dist/components/button-group/index.js +1 -1
  102. package/dist/components/calendar/index.js +1 -1
  103. package/dist/components/calendar-event-card/calendar-event-card.d.ts.map +1 -1
  104. package/dist/components/calendar-event-card/index.js +1 -1
  105. package/dist/components/chart/index.js +1 -1
  106. package/dist/components/data-table/index.js +3 -3
  107. package/dist/components/face-scheme/index.js +1 -1
  108. package/dist/components/file-manager/index.js +1 -1
  109. package/dist/components/header-settings/index.js +1 -1
  110. package/dist/components/hover-card/hover-card.d.ts +4 -0
  111. package/dist/components/hover-card/hover-card.d.ts.map +1 -1
  112. package/dist/components/hover-card/index.d.ts +1 -1
  113. package/dist/components/hover-card/index.d.ts.map +1 -1
  114. package/dist/components/hover-card/index.js +3 -2
  115. package/dist/components/icon-button-group/icon-button-group.d.ts.map +1 -1
  116. package/dist/components/icon-button-group/index.js +1 -1
  117. package/dist/components/index.d.ts +2 -1
  118. package/dist/components/index.d.ts.map +1 -1
  119. package/dist/components/notes-panel/index.js +1 -1
  120. package/dist/components/notes-panel/notes-panel.d.ts +10 -0
  121. package/dist/components/notes-panel/notes-panel.d.ts.map +1 -1
  122. package/dist/components/patient-details/index.js +1 -1
  123. package/dist/components/patient-summary-card/index.js +1 -1
  124. package/dist/components/patient-summary-card/patient-summary-card.d.ts.map +1 -1
  125. package/dist/components/patient-table/index.js +1 -1
  126. package/dist/components/rich-text-editor/editor-extensions.d.ts +54 -0
  127. package/dist/components/rich-text-editor/editor-extensions.d.ts.map +1 -0
  128. package/dist/components/rich-text-editor/editor-toolbar.d.ts +2 -1
  129. package/dist/components/rich-text-editor/editor-toolbar.d.ts.map +1 -1
  130. package/dist/components/rich-text-editor/help-me-write-overlay.d.ts +4 -0
  131. package/dist/components/rich-text-editor/help-me-write-overlay.d.ts.map +1 -1
  132. package/dist/components/rich-text-editor/index.d.ts +2 -0
  133. package/dist/components/rich-text-editor/index.d.ts.map +1 -1
  134. package/dist/components/rich-text-editor/index.js +6 -4
  135. package/dist/components/rich-text-editor/index.js.map +1 -1
  136. package/dist/components/rich-text-editor/kit-extensions.d.ts +4 -0
  137. package/dist/components/rich-text-editor/kit-extensions.d.ts.map +1 -0
  138. package/dist/components/rich-text-editor/rich-text-editor.d.ts +18 -2
  139. package/dist/components/rich-text-editor/rich-text-editor.d.ts.map +1 -1
  140. package/dist/components/tasks-panel/index.js +1 -1
  141. package/dist/components/theme-toggle/index.js +1 -1
  142. package/dist/components/workflow-status/index.js +1 -1
  143. package/dist/components/workflow-status/workflow-status.d.ts.map +1 -1
  144. package/dist/hooks/index.d.ts +1 -1
  145. package/dist/hooks/index.d.ts.map +1 -1
  146. package/dist/hooks/index.js +51 -53
  147. package/dist/hooks/use-ai-sparkle.d.ts +7 -25
  148. package/dist/hooks/use-ai-sparkle.d.ts.map +1 -1
  149. package/dist/host-compat.css +2 -2
  150. package/dist/i18n/locales/ar.d.ts +31 -0
  151. package/dist/i18n/locales/ar.d.ts.map +1 -1
  152. package/dist/i18n/locales/ar.js +33 -2
  153. package/dist/i18n/locales/ar.js.map +1 -1
  154. package/dist/i18n/locales/de.d.ts +31 -0
  155. package/dist/i18n/locales/de.d.ts.map +1 -1
  156. package/dist/i18n/locales/de.js +33 -2
  157. package/dist/i18n/locales/de.js.map +1 -1
  158. package/dist/i18n/locales/el.d.ts +31 -0
  159. package/dist/i18n/locales/el.d.ts.map +1 -1
  160. package/dist/i18n/locales/el.js +33 -2
  161. package/dist/i18n/locales/el.js.map +1 -1
  162. package/dist/i18n/locales/en.d.ts +31 -0
  163. package/dist/i18n/locales/en.d.ts.map +1 -1
  164. package/dist/i18n/locales/en.js +33 -2
  165. package/dist/i18n/locales/en.js.map +1 -1
  166. package/dist/i18n/locales/es.d.ts +31 -0
  167. package/dist/i18n/locales/es.d.ts.map +1 -1
  168. package/dist/i18n/locales/es.js +33 -2
  169. package/dist/i18n/locales/es.js.map +1 -1
  170. package/dist/i18n/locales/fr.d.ts +31 -0
  171. package/dist/i18n/locales/fr.d.ts.map +1 -1
  172. package/dist/i18n/locales/fr.js +33 -2
  173. package/dist/i18n/locales/fr.js.map +1 -1
  174. package/dist/i18n/locales/hi.d.ts +31 -0
  175. package/dist/i18n/locales/hi.d.ts.map +1 -1
  176. package/dist/i18n/locales/hi.js +33 -2
  177. package/dist/i18n/locales/hi.js.map +1 -1
  178. package/dist/i18n/locales/it.d.ts +31 -0
  179. package/dist/i18n/locales/it.d.ts.map +1 -1
  180. package/dist/i18n/locales/it.js +33 -2
  181. package/dist/i18n/locales/it.js.map +1 -1
  182. package/dist/i18n/locales/ja.d.ts +31 -0
  183. package/dist/i18n/locales/ja.d.ts.map +1 -1
  184. package/dist/i18n/locales/ja.js +33 -2
  185. package/dist/i18n/locales/ja.js.map +1 -1
  186. package/dist/i18n/locales/nl.d.ts +31 -0
  187. package/dist/i18n/locales/nl.d.ts.map +1 -1
  188. package/dist/i18n/locales/nl.js +33 -2
  189. package/dist/i18n/locales/nl.js.map +1 -1
  190. package/dist/i18n/locales/pl.d.ts +31 -0
  191. package/dist/i18n/locales/pl.d.ts.map +1 -1
  192. package/dist/i18n/locales/pl.js +33 -2
  193. package/dist/i18n/locales/pl.js.map +1 -1
  194. package/dist/i18n/locales/pt.d.ts +31 -0
  195. package/dist/i18n/locales/pt.d.ts.map +1 -1
  196. package/dist/i18n/locales/pt.js +33 -2
  197. package/dist/i18n/locales/pt.js.map +1 -1
  198. package/dist/i18n/locales/ro.d.ts +31 -0
  199. package/dist/i18n/locales/ro.d.ts.map +1 -1
  200. package/dist/i18n/locales/ro.js +33 -2
  201. package/dist/i18n/locales/ro.js.map +1 -1
  202. package/dist/i18n/locales/ru.d.ts +31 -0
  203. package/dist/i18n/locales/ru.d.ts.map +1 -1
  204. package/dist/i18n/locales/ru.js +33 -2
  205. package/dist/i18n/locales/ru.js.map +1 -1
  206. package/dist/i18n/locales/sq.d.ts +31 -0
  207. package/dist/i18n/locales/sq.d.ts.map +1 -1
  208. package/dist/i18n/locales/sq.js +33 -2
  209. package/dist/i18n/locales/sq.js.map +1 -1
  210. package/dist/i18n/locales/sv.d.ts +31 -0
  211. package/dist/i18n/locales/sv.d.ts.map +1 -1
  212. package/dist/i18n/locales/sv.js +33 -2
  213. package/dist/i18n/locales/sv.js.map +1 -1
  214. package/dist/i18n/locales/tr.d.ts +31 -0
  215. package/dist/i18n/locales/tr.d.ts.map +1 -1
  216. package/dist/i18n/locales/tr.js +33 -2
  217. package/dist/i18n/locales/tr.js.map +1 -1
  218. package/dist/i18n/locales/zh.d.ts +31 -0
  219. package/dist/i18n/locales/zh.d.ts.map +1 -1
  220. package/dist/i18n/locales/zh.js +33 -2
  221. package/dist/i18n/locales/zh.js.map +1 -1
  222. package/dist/index.js +646 -639
  223. package/dist/index.js.map +1 -1
  224. package/dist/locales/ar.json +33 -2
  225. package/dist/locales/de.json +33 -2
  226. package/dist/locales/el.json +33 -2
  227. package/dist/locales/en.json +33 -2
  228. package/dist/locales/es.json +33 -2
  229. package/dist/locales/fr.json +33 -2
  230. package/dist/locales/hi.json +33 -2
  231. package/dist/locales/it.json +33 -2
  232. package/dist/locales/ja.json +33 -2
  233. package/dist/locales/nl.json +33 -2
  234. package/dist/locales/pl.json +33 -2
  235. package/dist/locales/pt.json +33 -2
  236. package/dist/locales/ro.json +33 -2
  237. package/dist/locales/ru.json +33 -2
  238. package/dist/locales/sq.json +33 -2
  239. package/dist/locales/sv.json +33 -2
  240. package/dist/locales/tr.json +33 -2
  241. package/dist/locales/zh.json +33 -2
  242. package/dist/patterns/anamnesis/index.js +1 -1
  243. package/dist/patterns/calendar/calendar-appointment-details.d.ts.map +1 -1
  244. package/dist/patterns/calendar/calendar-appointment-details.sections.d.ts.map +1 -1
  245. package/dist/patterns/calendar/calendar-bookings-panel.d.ts.map +1 -1
  246. package/dist/patterns/calendar/calendar-workspace.d.ts +6 -4
  247. package/dist/patterns/calendar/calendar-workspace.d.ts.map +1 -1
  248. package/dist/patterns/calendar/calendar.data.d.ts +9 -0
  249. package/dist/patterns/calendar/calendar.data.d.ts.map +1 -1
  250. package/dist/patterns/calendar/calendar.journey.d.ts +1 -1
  251. package/dist/patterns/calendar/calendar.journey.d.ts.map +1 -1
  252. package/dist/patterns/calendar/calendar.sheets.d.ts +16 -5
  253. package/dist/patterns/calendar/calendar.sheets.d.ts.map +1 -1
  254. package/dist/patterns/calendar/calendar.surface.d.ts.map +1 -1
  255. package/dist/patterns/calendar/calendar.types.d.ts +3 -1
  256. package/dist/patterns/calendar/calendar.types.d.ts.map +1 -1
  257. package/dist/patterns/calendar/index.js +1 -1
  258. package/dist/patterns/help-me-write-templates/help-me-write-templates.d.ts +11 -2
  259. package/dist/patterns/help-me-write-templates/help-me-write-templates.d.ts.map +1 -1
  260. package/dist/patterns/help-me-write-templates/index.js +1 -1
  261. package/dist/patterns/marketplace-app-shell/index.js +1 -1
  262. package/dist/tokens.css +1 -1
  263. package/package.json +14 -4
  264. package/dist/_chunks/ai-consent-banner-D7I2U-cz.js.map +0 -1
  265. package/dist/_chunks/ai-sparkle-DXeP_6a0.js +0 -52
  266. package/dist/_chunks/ai-sparkle-DXeP_6a0.js.map +0 -1
  267. package/dist/_chunks/booking-D43ASl8y.js.map +0 -1
  268. package/dist/_chunks/button-group-R32U7SyV.js +0 -307
  269. package/dist/_chunks/button-group-R32U7SyV.js.map +0 -1
  270. package/dist/_chunks/calendar-workspace-B7KvZ1_D.js.map +0 -1
  271. package/dist/_chunks/help-me-write-templates-GUeEn3Ff.js.map +0 -1
  272. package/dist/_chunks/icon-button-group-DkkdIygu.js.map +0 -1
  273. package/dist/_chunks/notes-panel-Dkk9QPPX.js.map +0 -1
  274. package/dist/_chunks/patient-field-row-BRSOKvme.js.map +0 -1
  275. package/dist/_chunks/patient-summary-card-BhmKB2KR.js.map +0 -1
  276. package/dist/_chunks/rich-text-editor-BrAvNajV.js +0 -3779
  277. package/dist/_chunks/rich-text-editor-BrAvNajV.js.map +0 -1
  278. package/dist/_chunks/use-ai-sparkle-CyQSRTCe.js +0 -103
  279. package/dist/_chunks/use-ai-sparkle-CyQSRTCe.js.map +0 -1
  280. package/dist/components/ai-consent-banner/ai-consent-banner.agent.d.ts.map +0 -1
  281. package/dist/components/ai-consent-banner/ai-consent-banner.d.ts.map +0 -1
  282. package/dist/components/ai-consent-banner/index.d.ts +0 -4
  283. package/dist/components/ai-consent-banner/index.d.ts.map +0 -1
  284. /package/dist/components/{ai-consent-banner → ai-permission-notice}/index.js.map +0 -0
@@ -2,7 +2,7 @@ import { jsxs as m, jsx as o } from "react/jsx-runtime";
2
2
  import { isValidElement as w, cloneElement as A, forwardRef as B } from "react";
3
3
  import { useTranslation as R } from "react-i18next";
4
4
  import { I as f } from "./icon-button-CehAeZoP.js";
5
- import { I as S } from "./icon-button-group-DkkdIygu.js";
5
+ import { I as S } from "./icon-button-group-DZKC6KGf.js";
6
6
  import { D as l } from "./dropdown-menu-DU-Hrf33.js";
7
7
  import { E as T } from "./ellipsis-dRo9ouSU.js";
8
8
  function h(s) {
@@ -134,4 +134,4 @@ export {
134
134
  V as A,
135
135
  G as a
136
136
  };
137
- //# sourceMappingURL=actions-cell-renderer-BXBy9c0f.js.map
137
+ //# sourceMappingURL=actions-cell-renderer-B5m9lwgC.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"actions-cell-renderer-BXBy9c0f.js","sources":["../../src/components/data-table/cell-renderers/actions-cell-renderer.tsx"],"sourcesContent":["import {\n type ReactElement,\n cloneElement,\n isValidElement,\n type ReactNode,\n forwardRef,\n type ForwardedRef,\n} from 'react';\nimport type { CustomCellRendererProps } from 'ag-grid-react';\nimport { useTranslation } from 'react-i18next';\nimport { Ellipsis } from 'lucide-react';\nimport { IconButton, type IconButtonProps } from '../../button/icon-button';\nimport { IconButtonGroup } from '../../icon-button-group';\nimport { DropdownMenu } from '../../dropdown-menu';\n\n// Lucide icons render at their intrinsic 24×24 unless given a `size` prop or\n// `size-*` class. The IconButton's wrapping span is only `size-4` (16px), so a\n// bare `<Trash2 />` overflows and, inside AG Grid's `overflow: hidden` cells,\n// gets clipped into horizontal slivers. Coerce icon nodes to the expected size.\nfunction sizeIcon(node: ReactNode): ReactNode {\n if (!isValidElement(node)) return node;\n const element = node as React.ReactElement<{\n className?: string;\n size?: number;\n }>;\n const existingClass = element.props.className ?? '';\n const className = /\\bsize-|\\bw-|\\bh-/.test(existingClass)\n ? existingClass\n : `${existingClass} size-4`.trim();\n return cloneElement(element, { className, size: element.props.size ?? 16 });\n}\n\nexport interface ActionDef<TData = unknown> {\n /** Lucide-style icon node. */\n icon: ReactNode;\n /** Accessible label — also used as the tooltip. */\n label: string;\n /** Invoked with the row data. */\n onClick: (data: TData) => void;\n /** Disable the action. Pass a predicate for per-row disablement. */\n disabled?: boolean | ((data: TData) => boolean);\n /** Human-readable reason shown in the tooltip when disabled. */\n disabledReason?: string;\n /** `destructive` swaps the button intent. */\n variant?: 'default' | 'destructive';\n /** Hide the action entirely. Pass a predicate for per-row hiding. */\n hidden?: boolean | ((data: TData) => boolean);\n}\n\nexport interface ActionsCellRendererParams<TData = unknown> {\n actions: ActionDef<TData>[];\n /** Intent of the inline buttons / the collapsed trigger (default `ghost`). */\n intent?: 'ghost' | 'outline';\n /**\n * Render the inline buttons as a connected `IconButtonGroup` (a segmented\n * control) rather than a loose row. Requires `label` for the group name.\n */\n group?: boolean;\n /** Accessible name for the group and the collapsed overflow trigger. */\n label?: string;\n /**\n * Collapse the actions into a single \"…\" overflow menu instead of inline\n * buttons. Pass a getter to flip it at runtime — call\n * `api.refreshCells({ force: true })` after the underlying value changes so\n * the cells re-read it (this preserves column state, unlike rebuilding defs).\n */\n collapsed?: boolean | (() => boolean);\n /**\n * Split button: keep the first `maxInline` visible actions as inline buttons\n * and fold the rest into a trailing \"…\" menu at the end of the row. The\n * column then needs `actionsColumnWidth(maxInline + 1)`. Ignored while\n * `collapsed`; `0` is the same as `collapsed`.\n */\n maxInline?: number;\n}\n\n/**\n * Pixel width an actions column needs so `count` inline `sm` IconButtons (32px\n * each — whether segmented via `group` or loose) plus the data-table cell's\n * inline padding never clip. AG Grid gives a column ONE width for every row, so\n * pass the TOTAL number of actions (the worst case where a single row shows them\n * all) — not the per-row visible count, which varies with `hidden` predicates.\n *\n * Use it as the column `width` so a fully-actioned row can't overflow:\n *\n * {\n * colId: 'actions',\n * cellRenderer: ActionsCellRenderer,\n * cellRendererParams: { actions, group: true },\n * width: actionsColumnWidth(actions.length),\n * // minWidth stays at the collapsed footprint when `collapsed` is used.\n * }\n */\nexport function actionsColumnWidth(count: number): number {\n const SM_BUTTON = 32; // sm IconButton (`w-8`)\n // Segmented-group chrome + the cell's inline padding:\n // 12 segmented-group borders and seams around the buttons\n // + 16 --spacing-sm each side, the reduced padding the theme gives\n // graphic-only cells (a text cell's 30px would clip the group).\n const CELL_INSET = 28;\n return Math.max(1, count) * SM_BUTTON + CELL_INSET;\n}\n\nfunction resolve<T>(\n flag: boolean | ((data: T) => boolean) | undefined,\n data: T,\n): boolean {\n if (typeof flag === 'function') return flag(data);\n return Boolean(flag);\n}\n\nconst destructiveInline =\n 'ds:text-[color:var(--destructive)] ds:hover:text-[color:var(--destructive-hover)]';\n\nexport function ActionsCellRenderer<TData = unknown>(\n props: CustomCellRendererProps<TData> & ActionsCellRendererParams<TData>,\n) {\n const {\n data,\n actions,\n intent = 'ghost',\n group,\n label,\n collapsed,\n maxInline,\n } = props;\n const { t } = useTranslation();\n if (!data) return null;\n\n const visible = actions.filter((action) => !resolve(action.hidden, data));\n const isCollapsed =\n typeof collapsed === 'function' ? collapsed() : Boolean(collapsed);\n const inline =\n maxInline === undefined\n ? visible\n : visible.slice(0, Math.max(0, maxInline));\n const overflow =\n maxInline === undefined ? [] : visible.slice(Math.max(0, maxInline));\n\n // Collapsed: one \"…\" trigger opening a DropdownMenu of the actions. Disabled\n // actions stay in the menu but inert (the per-action `disabledReason` is an\n // inline-only affordance — a menu row has no tooltip surface).\n if (isCollapsed) {\n return (\n <DropdownMenu.Root>\n <DropdownMenu.Trigger asChild>\n <IconButton\n size=\"sm\"\n intent={intent}\n icon={<Ellipsis aria-hidden />}\n aria-label={label ?? t('dataTable.actions', 'Actions')}\n />\n </DropdownMenu.Trigger>\n <DropdownMenu.Content align=\"end\">\n {visible.map((action, index) => (\n <DropdownMenu.Item\n // Action defs are referentially stable; index is safe as actions\n // do not reorder within a row.\n key={index}\n startIcon={sizeIcon(action.icon)}\n disabled={resolve(action.disabled, data)}\n onSelect={() => action.onClick(data)}\n className={\n action.variant === 'destructive'\n ? 'ds:text-[color:var(--destructive)]'\n : undefined\n }\n >\n {action.label}\n </DropdownMenu.Item>\n ))}\n </DropdownMenu.Content>\n </DropdownMenu.Root>\n );\n }\n\n const buttons = inline.map((action, index) => {\n const isDisabled = resolve(action.disabled, data);\n const tooltip =\n isDisabled && action.disabledReason\n ? action.disabledReason\n : action.label;\n return (\n <IconButton\n // See note above on index keys.\n key={index}\n size=\"sm\"\n intent={intent}\n icon={sizeIcon(action.icon)}\n tooltip={tooltip}\n aria-label={action.label}\n disabled={isDisabled}\n onClick={(event) => {\n event.stopPropagation();\n action.onClick(data);\n }}\n className={\n action.variant === 'destructive' ? destructiveInline : undefined\n }\n />\n );\n });\n\n const more =\n overflow.length > 0 ? (\n <OverflowActionsMenu\n key=\"overflow\"\n data={data}\n actions={overflow}\n intent={intent}\n label={label ?? t('dataTable.actions', 'Actions')}\n />\n ) : null;\n\n return group ? (\n <IconButtonGroup\n aria-label={label ?? t('dataTable.actions', 'Actions')}\n size=\"sm\"\n >\n {buttons}\n {more}\n </IconButtonGroup>\n ) : (\n <span className=\"ds:inline-flex ds:items-center ds:gap-[var(--spacing-xs)]\">\n {buttons}\n {more}\n </span>\n );\n}\n\ninterface OverflowActionsMenuProps<TData> extends Omit<\n IconButtonProps,\n 'icon' | 'aria-label' | 'onClick'\n> {\n data: TData;\n actions: ActionDef<TData>[];\n label: string;\n}\n\n/**\n * The \"…\" end of a split actions button. Forwards its ref and the rest of its\n * props to the trigger IconButton, so an IconButtonGroup can seat it as the\n * last segment exactly like a plain button (the same contract ExportMenu\n * follows in the toolbar).\n */\nconst OverflowActionsMenu = forwardRef(function OverflowActionsMenu<TData>(\n {\n data,\n actions,\n label,\n intent = 'ghost',\n ...rest\n }: OverflowActionsMenuProps<TData>,\n ref: ForwardedRef<HTMLButtonElement>,\n) {\n return (\n <DropdownMenu.Root>\n <DropdownMenu.Trigger asChild>\n <IconButton\n ref={ref}\n type=\"button\"\n size=\"sm\"\n intent={intent}\n icon={<Ellipsis aria-hidden />}\n tooltip={label}\n aria-label={label}\n onClick={(event) => event.stopPropagation()}\n {...rest}\n />\n </DropdownMenu.Trigger>\n <DropdownMenu.Content align=\"end\">\n {actions.map((action, index) => (\n <DropdownMenu.Item\n key={index}\n startIcon={sizeIcon(action.icon)}\n disabled={resolve(action.disabled, data)}\n onSelect={() => action.onClick(data)}\n className={\n action.variant === 'destructive'\n ? 'ds:text-[color:var(--destructive)]'\n : undefined\n }\n >\n {action.label}\n </DropdownMenu.Item>\n ))}\n </DropdownMenu.Content>\n </DropdownMenu.Root>\n );\n}) as <TData>(\n props: OverflowActionsMenuProps<TData> & {\n ref?: ForwardedRef<HTMLButtonElement>;\n },\n) => ReactElement;\n"],"names":["sizeIcon","node","isValidElement","element","existingClass","className","cloneElement","actionsColumnWidth","count","resolve","flag","data","destructiveInline","ActionsCellRenderer","props","actions","intent","group","label","collapsed","maxInline","t","useTranslation","visible","action","isCollapsed","inline","overflow","jsxs","DropdownMenu","jsx","IconButton","Ellipsis","index","buttons","isDisabled","tooltip","event","more","OverflowActionsMenu","IconButtonGroup","forwardRef","rest","ref"],"mappings":";;;;;;;AAmBA,SAASA,EAASC,GAA4B;AAC5C,MAAI,CAACC,EAAeD,CAAI,EAAG,QAAOA;AAClC,QAAME,IAAUF,GAIVG,IAAgBD,EAAQ,MAAM,aAAa,IAC3CE,IAAY,oBAAoB,KAAKD,CAAa,IACpDA,IACA,GAAGA,CAAa,UAAU,KAAA;AAC9B,SAAOE,EAAaH,GAAS,EAAE,WAAAE,GAAW,MAAMF,EAAQ,MAAM,QAAQ,IAAI;AAC5E;AA+DO,SAASI,EAAmBC,GAAuB;AAOxD,SAAO,KAAK,IAAI,GAAGA,CAAK,IAAI,KAAY;AAC1C;AAEA,SAASC,EACPC,GACAC,GACS;AACT,SAAI,OAAOD,KAAS,aAAmBA,EAAKC,CAAI,IACzC,EAAQD;AACjB;AAEA,MAAME,IACJ;AAEK,SAASC,EACdC,GACA;AACA,QAAM;AAAA,IACJ,MAAAH;AAAA,IACA,SAAAI;AAAA,IACA,QAAAC,IAAS;AAAA,IACT,OAAAC;AAAA,IACA,OAAAC;AAAA,IACA,WAAAC;AAAA,IACA,WAAAC;AAAA,EAAA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AA,QACA,MAAK;AAAA,QACL,MAAK;AAAA,QACL,QAAA3B;AAAA,QACA,MAAM,gBAAAc,EAACE,GAAA,EAAS,eAAW,GAAA,CAAC;AAAA,QAC5B,SAASd;AAAA,QACT,cAAYA;AAAA,QACZ,SAAS,CAACmB,MAAUA,EAAM,gBAAA;AAAA,QACzB,GAAGK;AAAA,MAAA;AAAA,IAAA,GAER;AAAA,IACA,gBAAAZ,EAACD,EAAa,SAAb,EAAqB,OAAM,OACzB,UAAAd,EAAQ,IAAI,CAACS,GAAQS,MACpB,gBAAAH;AAAA,MAACD,EAAa;AAAA,MAAb;AAAA,QAEC,WAAW7B,EAASwB,EAAO,IAAI;AAAA,QAC/B,UAAUf,EAAQe,EAAO,UAAUb,CAAI;AAAA,QACvC,UAAU,MAAMa,EAAO,QAAQb,CAAI;AAAA,QACnC,WACEa,EAAO,YAAY,gBACf,uCACA;AAAA,QAGL,UAAAA,EAAO;AAAA,MAAA;AAAA,MAVHS;AAAA,IAAA,CAYR,EAAA,CACH;AAAA,EAAA,GACF;AAEJ,CAAC;"}
1
+ {"version":3,"file":"actions-cell-renderer-B5m9lwgC.js","sources":["../../src/components/data-table/cell-renderers/actions-cell-renderer.tsx"],"sourcesContent":["import {\n type ReactElement,\n cloneElement,\n isValidElement,\n type ReactNode,\n forwardRef,\n type ForwardedRef,\n} from 'react';\nimport type { CustomCellRendererProps } from 'ag-grid-react';\nimport { useTranslation } from 'react-i18next';\nimport { Ellipsis } from 'lucide-react';\nimport { IconButton, type IconButtonProps } from '../../button/icon-button';\nimport { IconButtonGroup } from '../../icon-button-group';\nimport { DropdownMenu } from '../../dropdown-menu';\n\n// Lucide icons render at their intrinsic 24×24 unless given a `size` prop or\n// `size-*` class. The IconButton's wrapping span is only `size-4` (16px), so a\n// bare `<Trash2 />` overflows and, inside AG Grid's `overflow: hidden` cells,\n// gets clipped into horizontal slivers. Coerce icon nodes to the expected size.\nfunction sizeIcon(node: ReactNode): ReactNode {\n if (!isValidElement(node)) return node;\n const element = node as React.ReactElement<{\n className?: string;\n size?: number;\n }>;\n const existingClass = element.props.className ?? '';\n const className = /\\bsize-|\\bw-|\\bh-/.test(existingClass)\n ? existingClass\n : `${existingClass} size-4`.trim();\n return cloneElement(element, { className, size: element.props.size ?? 16 });\n}\n\nexport interface ActionDef<TData = unknown> {\n /** Lucide-style icon node. */\n icon: ReactNode;\n /** Accessible label — also used as the tooltip. */\n label: string;\n /** Invoked with the row data. */\n onClick: (data: TData) => void;\n /** Disable the action. Pass a predicate for per-row disablement. */\n disabled?: boolean | ((data: TData) => boolean);\n /** Human-readable reason shown in the tooltip when disabled. */\n disabledReason?: string;\n /** `destructive` swaps the button intent. */\n variant?: 'default' | 'destructive';\n /** Hide the action entirely. Pass a predicate for per-row hiding. */\n hidden?: boolean | ((data: TData) => boolean);\n}\n\nexport interface ActionsCellRendererParams<TData = unknown> {\n actions: ActionDef<TData>[];\n /** Intent of the inline buttons / the collapsed trigger (default `ghost`). */\n intent?: 'ghost' | 'outline';\n /**\n * Render the inline buttons as a connected `IconButtonGroup` (a segmented\n * control) rather than a loose row. Requires `label` for the group name.\n */\n group?: boolean;\n /** Accessible name for the group and the collapsed overflow trigger. */\n label?: string;\n /**\n * Collapse the actions into a single \"…\" overflow menu instead of inline\n * buttons. Pass a getter to flip it at runtime — call\n * `api.refreshCells({ force: true })` after the underlying value changes so\n * the cells re-read it (this preserves column state, unlike rebuilding defs).\n */\n collapsed?: boolean | (() => boolean);\n /**\n * Split button: keep the first `maxInline` visible actions as inline buttons\n * and fold the rest into a trailing \"…\" menu at the end of the row. The\n * column then needs `actionsColumnWidth(maxInline + 1)`. Ignored while\n * `collapsed`; `0` is the same as `collapsed`.\n */\n maxInline?: number;\n}\n\n/**\n * Pixel width an actions column needs so `count` inline `sm` IconButtons (32px\n * each — whether segmented via `group` or loose) plus the data-table cell's\n * inline padding never clip. AG Grid gives a column ONE width for every row, so\n * pass the TOTAL number of actions (the worst case where a single row shows them\n * all) — not the per-row visible count, which varies with `hidden` predicates.\n *\n * Use it as the column `width` so a fully-actioned row can't overflow:\n *\n * {\n * colId: 'actions',\n * cellRenderer: ActionsCellRenderer,\n * cellRendererParams: { actions, group: true },\n * width: actionsColumnWidth(actions.length),\n * // minWidth stays at the collapsed footprint when `collapsed` is used.\n * }\n */\nexport function actionsColumnWidth(count: number): number {\n const SM_BUTTON = 32; // sm IconButton (`w-8`)\n // Segmented-group chrome + the cell's inline padding:\n // 12 segmented-group borders and seams around the buttons\n // + 16 --spacing-sm each side, the reduced padding the theme gives\n // graphic-only cells (a text cell's 30px would clip the group).\n const CELL_INSET = 28;\n return Math.max(1, count) * SM_BUTTON + CELL_INSET;\n}\n\nfunction resolve<T>(\n flag: boolean | ((data: T) => boolean) | undefined,\n data: T,\n): boolean {\n if (typeof flag === 'function') return flag(data);\n return Boolean(flag);\n}\n\nconst destructiveInline =\n 'ds:text-[color:var(--destructive)] ds:hover:text-[color:var(--destructive-hover)]';\n\nexport function ActionsCellRenderer<TData = unknown>(\n props: CustomCellRendererProps<TData> & ActionsCellRendererParams<TData>,\n) {\n const {\n data,\n actions,\n intent = 'ghost',\n group,\n label,\n collapsed,\n maxInline,\n } = props;\n const { t } = useTranslation();\n if (!data) return null;\n\n const visible = actions.filter((action) => !resolve(action.hidden, data));\n const isCollapsed =\n typeof collapsed === 'function' ? collapsed() : Boolean(collapsed);\n const inline =\n maxInline === undefined\n ? visible\n : visible.slice(0, Math.max(0, maxInline));\n const overflow =\n maxInline === undefined ? [] : visible.slice(Math.max(0, maxInline));\n\n // Collapsed: one \"…\" trigger opening a DropdownMenu of the actions. Disabled\n // actions stay in the menu but inert (the per-action `disabledReason` is an\n // inline-only affordance — a menu row has no tooltip surface).\n if (isCollapsed) {\n return (\n <DropdownMenu.Root>\n <DropdownMenu.Trigger asChild>\n <IconButton\n size=\"sm\"\n intent={intent}\n icon={<Ellipsis aria-hidden />}\n aria-label={label ?? t('dataTable.actions', 'Actions')}\n />\n </DropdownMenu.Trigger>\n <DropdownMenu.Content align=\"end\">\n {visible.map((action, index) => (\n <DropdownMenu.Item\n // Action defs are referentially stable; index is safe as actions\n // do not reorder within a row.\n key={index}\n startIcon={sizeIcon(action.icon)}\n disabled={resolve(action.disabled, data)}\n onSelect={() => action.onClick(data)}\n className={\n action.variant === 'destructive'\n ? 'ds:text-[color:var(--destructive)]'\n : undefined\n }\n >\n {action.label}\n </DropdownMenu.Item>\n ))}\n </DropdownMenu.Content>\n </DropdownMenu.Root>\n );\n }\n\n const buttons = inline.map((action, index) => {\n const isDisabled = resolve(action.disabled, data);\n const tooltip =\n isDisabled && action.disabledReason\n ? action.disabledReason\n : action.label;\n return (\n <IconButton\n // See note above on index keys.\n key={index}\n size=\"sm\"\n intent={intent}\n icon={sizeIcon(action.icon)}\n tooltip={tooltip}\n aria-label={action.label}\n disabled={isDisabled}\n onClick={(event) => {\n event.stopPropagation();\n action.onClick(data);\n }}\n className={\n action.variant === 'destructive' ? destructiveInline : undefined\n }\n />\n );\n });\n\n const more =\n overflow.length > 0 ? (\n <OverflowActionsMenu\n key=\"overflow\"\n data={data}\n actions={overflow}\n intent={intent}\n label={label ?? t('dataTable.actions', 'Actions')}\n />\n ) : null;\n\n return group ? (\n <IconButtonGroup\n aria-label={label ?? t('dataTable.actions', 'Actions')}\n size=\"sm\"\n >\n {buttons}\n {more}\n </IconButtonGroup>\n ) : (\n <span className=\"ds:inline-flex ds:items-center ds:gap-[var(--spacing-xs)]\">\n {buttons}\n {more}\n </span>\n );\n}\n\ninterface OverflowActionsMenuProps<TData> extends Omit<\n IconButtonProps,\n 'icon' | 'aria-label' | 'onClick'\n> {\n data: TData;\n actions: ActionDef<TData>[];\n label: string;\n}\n\n/**\n * The \"…\" end of a split actions button. Forwards its ref and the rest of its\n * props to the trigger IconButton, so an IconButtonGroup can seat it as the\n * last segment exactly like a plain button (the same contract ExportMenu\n * follows in the toolbar).\n */\nconst OverflowActionsMenu = forwardRef(function OverflowActionsMenu<TData>(\n {\n data,\n actions,\n label,\n intent = 'ghost',\n ...rest\n }: OverflowActionsMenuProps<TData>,\n ref: ForwardedRef<HTMLButtonElement>,\n) {\n return (\n <DropdownMenu.Root>\n <DropdownMenu.Trigger asChild>\n <IconButton\n ref={ref}\n type=\"button\"\n size=\"sm\"\n intent={intent}\n icon={<Ellipsis aria-hidden />}\n tooltip={label}\n aria-label={label}\n onClick={(event) => event.stopPropagation()}\n {...rest}\n />\n </DropdownMenu.Trigger>\n <DropdownMenu.Content align=\"end\">\n {actions.map((action, index) => (\n <DropdownMenu.Item\n key={index}\n startIcon={sizeIcon(action.icon)}\n disabled={resolve(action.disabled, data)}\n onSelect={() => action.onClick(data)}\n className={\n action.variant === 'destructive'\n ? 'ds:text-[color:var(--destructive)]'\n : undefined\n }\n >\n {action.label}\n </DropdownMenu.Item>\n ))}\n </DropdownMenu.Content>\n </DropdownMenu.Root>\n );\n}) as <TData>(\n props: OverflowActionsMenuProps<TData> & {\n ref?: ForwardedRef<HTMLButtonElement>;\n },\n) => ReactElement;\n"],"names":["sizeIcon","node","isValidElement","element","existingClass","className","cloneElement","actionsColumnWidth","count","resolve","flag","data","destructiveInline","ActionsCellRenderer","props","actions","intent","group","label","collapsed","maxInline","t","useTranslation","visible","action","isCollapsed","inline","overflow","jsxs","DropdownMenu","jsx","IconButton","Ellipsis","index","buttons","isDisabled","tooltip","event","more","OverflowActionsMenu","IconButtonGroup","forwardRef","rest","ref"],"mappings":";;;;;;;AAmBA,SAASA,EAASC,GAA4B;AAC5C,MAAI,CAACC,EAAeD,CAAI,EAAG,QAAOA;AAClC,QAAME,IAAUF,GAIVG,IAAgBD,EAAQ,MAAM,aAAa,IAC3CE,IAAY,oBAAoB,KAAKD,CAAa,IACpDA,IACA,GAAGA,CAAa,UAAU,KAAA;AAC9B,SAAOE,EAAaH,GAAS,EAAE,WAAAE,GAAW,MAAMF,EAAQ,MAAM,QAAQ,IAAI;AAC5E;AA+DO,SAASI,EAAmBC,GAAuB;AAOxD,SAAO,KAAK,IAAI,G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AAEJ;AAiBA,MAAMC,IAAsBE,EAAW,SACrC;AAAA,EACE,MAAA9B;AAAA,EACA,SAAAI;AAAA,EACA,OAAAG;AAAA,EACA,QAAAF,IAAS;AAAA,EACT,GAAG0B;AACL,GACAC,GACA;AACA,SACE,gBAAAf,EAACC,EAAa,MAAb,EACC,UAAA;AAAA,IAAA,gBAAAC,EAACD,EAAa,SAAb,EAAqB,SAAO,IAC3B,UAAA,gBAAAC;AAAA,MAACC;AAAA,MAAA;AAAA,QACC,KAAAY;AAAA,QACA,MAAK;AAAA,QACL,MAAK;AAAA,QACL,QAAA3B;AAAA,QACA,MAAM,gBAAAc,EAACE,GAAA,EAAS,eAAW,GAAA,CAAC;AAAA,QAC5B,SAASd;AAAA,QACT,cAAYA;AAAA,QACZ,SAAS,CAACmB,MAAUA,EAAM,gBAAA;AAAA,QACzB,GAAGK;AAAA,MAAA;AAAA,IAAA,GAER;AAAA,IACA,gBAAAZ,EAACD,EAAa,SAAb,EAAqB,OAAM,OACzB,UAAAd,EAAQ,IAAI,CAACS,GAAQS,MACpB,gBAAAH;AAAA,MAACD,EAAa;AAAA,MAAb;AAAA,QAEC,WAAW7B,EAASwB,EAAO,IAAI;AAAA,QAC/B,UAAUf,EAAQe,EAAO,UAAUb,CAAI;AAAA,QACvC,UAAU,MAAMa,EAAO,QAAQb,CAAI;AAAA,QACnC,WACEa,EAAO,YAAY,gBACf,uCACA;AAAA,QAGL,UAAAA,EAAO;AAAA,MAAA;AAAA,MAVHS;AAAA,IAAA,CAYR,EAAA,CACH;AAAA,EAAA,GACF;AAEJ,CAAC;"}
@@ -0,0 +1,90 @@
1
+ import { jsxs as d, jsx as n } from "react/jsx-runtime";
2
+ import { forwardRef as f } from "react";
3
+ import { c as v } from "./index-D2ZczOXr.js";
4
+ import { useTranslation as x } from "react-i18next";
5
+ import { B as l } from "./button-CaUe1uyd.js";
6
+ import { P as y } from "./progress-CK8otcQ-.js";
7
+ import { H as o } from "./hover-card-nUae8NPJ.js";
8
+ const w = v("ds:flex ds:flex-col ds:items-start", {
9
+ variants: {
10
+ mode: {
11
+ included: "",
12
+ bundles: ""
13
+ }
14
+ },
15
+ defaultVariants: {
16
+ mode: "included"
17
+ }
18
+ }), k = f((i, m) => {
19
+ const { t: e, i18n: u } = x(), { allowance: s, className: C, mode: t, ...N } = i, {
20
+ onLearnMore: D,
21
+ onDismiss: B,
22
+ onViewBundles: L,
23
+ onSeeCosts: M,
24
+ ...h
25
+ } = N, a = !!(s && s.limit > 0), r = a && (s != null && s.resetsOn) ? new Intl.DateTimeFormat(u.language, {
26
+ day: "numeric",
27
+ month: "long"
28
+ }).format(s.resetsOn) : void 0, c = a ? e("aiCreditsNotice.included.allowance", {
29
+ remaining: s.remaining,
30
+ limit: s.limit
31
+ }) : void 0, b = t === "included" ? e("aiCreditsNotice.included.heading") : a ? e("aiCreditsNotice.bundles.headingWithAllowance", {
32
+ remaining: s.remaining,
33
+ limit: s.limit
34
+ }) : e("aiCreditsNotice.bundles.eyebrow"), g = t === "included" ? e("aiCreditsNotice.included.body") : a ? e("aiCreditsNotice.bundles.body", { limit: s.limit }) : e("aiCreditsNotice.bundles.bodyGeneric");
35
+ return /* @__PURE__ */ d(
36
+ "div",
37
+ {
38
+ ...h,
39
+ ref: m,
40
+ "data-component": "ai-credits-notice",
41
+ "data-mode": t,
42
+ className: w({ mode: t, className: C }),
43
+ children: [
44
+ /* @__PURE__ */ n(o.Eyebrow, { children: e(t === "included" ? "aiCreditsNotice.included.eyebrow" : "aiCreditsNotice.bundles.eyebrow") }),
45
+ /* @__PURE__ */ n(o.Heading, { children: b }),
46
+ /* @__PURE__ */ d(o.Body, { children: [
47
+ /* @__PURE__ */ n("p", { className: "ds:m-0", children: g }),
48
+ t === "included" && a ? /* @__PURE__ */ d("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-2xs)] ds:[margin-block-start:var(--spacing-sm)]", children: [
49
+ /* @__PURE__ */ n("div", { className: "ds:flex ds:items-center ds:gap-[var(--spacing-xs)]", children: /* @__PURE__ */ n("span", { className: "type-label", children: c }) }),
50
+ /* @__PURE__ */ n(
51
+ y,
52
+ {
53
+ value: Math.max(0, s.limit - s.remaining),
54
+ max: s.limit,
55
+ size: "sm",
56
+ ariaLabel: e("aiCreditsNotice.included.eyebrow"),
57
+ ariaValueText: c
58
+ }
59
+ ),
60
+ r ? /* @__PURE__ */ n("p", { className: "ds:m-0 type-body-sm ds:text-[color:var(--muted-foreground)]", children: e("aiCreditsNotice.included.resetsOn", { date: r }) }) : null
61
+ ] }) : null
62
+ ] }),
63
+ t === "included" ? i.onLearnMore || i.onDismiss ? /* @__PURE__ */ d(o.Footer, { children: [
64
+ i.onDismiss ? /* @__PURE__ */ n(
65
+ l,
66
+ {
67
+ intent: "link",
68
+ size: "sm",
69
+ onClick: i.onDismiss,
70
+ className: "ds:me-auto",
71
+ children: e("aiCreditsNotice.dismiss")
72
+ }
73
+ ) : null,
74
+ i.onLearnMore ? /* @__PURE__ */ n(l, { intent: "link", size: "sm", onClick: i.onLearnMore, children: e("aiCreditsNotice.included.learnMore") }) : null
75
+ ] }) : null : /* @__PURE__ */ d(o.Footer, { children: [
76
+ i.onSeeCosts || i.onDismiss ? /* @__PURE__ */ d("div", { className: "ds:me-auto ds:flex ds:items-center ds:gap-[var(--spacing-sm)]", children: [
77
+ i.onSeeCosts ? /* @__PURE__ */ n(l, { intent: "link", size: "sm", onClick: i.onSeeCosts, children: e("aiCreditsNotice.bundles.seeCosts") }) : null,
78
+ i.onDismiss ? /* @__PURE__ */ n(l, { intent: "link", size: "sm", onClick: i.onDismiss, children: e("aiCreditsNotice.dismiss") }) : null
79
+ ] }) : null,
80
+ /* @__PURE__ */ n(l, { intent: "tonal", size: "sm", onClick: i.onViewBundles, children: e("aiCreditsNotice.bundles.viewBundles") })
81
+ ] })
82
+ ]
83
+ }
84
+ );
85
+ });
86
+ k.displayName = "AiCreditsNotice";
87
+ export {
88
+ k as A
89
+ };
90
+ //# sourceMappingURL=ai-credits-notice-xszqOZTC.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ai-credits-notice-xszqOZTC.js","sources":["../../src/components/ai-credits-notice/ai-credits-notice.tsx"],"sourcesContent":["import { forwardRef, type HTMLAttributes } from 'react';\nimport { cva } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\nimport { Button } from '../button';\nimport { Progress } from '../progress';\nimport { HoverCard } from '../hover-card';\n\n/* -------------------------------------------------------------------- */\n/* AiCreditsNotice */\n/* */\n/* The body of the hover card every AI action trigger in the kit shows: */\n/* AI features cost nothing extra today ('included'), or — once paid */\n/* credit bundles ship with a free tier underneath — a nudge toward */\n/* them ('bundles'). The host decides which by passing `mode`; nothing */\n/* here reaches a backend or owns the upsell page itself — `onViewBundles` */\n/* is a seam, not a router. */\n/* */\n/* Renders INSIDE a `HoverCard.Content` (it uses `HoverCard.Eyebrow` / */\n/* `.Heading` / `.Body` / `.Footer`, the same composition `AppointmentPeek` */\n/* uses) — it never renders its own `HoverCard.Root`/`Trigger`. Callers */\n/* wrap it: `<HoverCard><HoverCard.Trigger asChild>{button}</HoverCard.Trigger>` */\n/* `<HoverCard.Content side=\"bottom\" align=\"start\" size=\"sm\"><AiCreditsNotice … /></HoverCard.Content></HoverCard>`. */\n/* -------------------------------------------------------------------- */\n\nconst rootVariants = cva('ds:flex ds:flex-col ds:items-start', {\n variants: {\n mode: {\n included: '',\n bundles: '',\n },\n },\n defaultVariants: {\n mode: 'included',\n },\n});\n\n/** The practice's current AI allowance, when the host tracks one. */\nexport interface AiCreditsNoticeAllowance {\n /** AI actions left in the current period. */\n remaining: number;\n /** The monthly cap. */\n limit: number;\n /** When the allowance next resets. Omit if unknown. */\n resetsOn?: Date;\n}\n\ninterface AiCreditsNoticeSharedProps {\n /**\n * The practice's current AI allowance. In `included` mode it renders as an\n * optional usage line + meter; in `bundles` mode it drives the heading\n * (\"{{remaining}} of {{limit}} credits\") and the free-tier line in the\n * body. Omit either mode's allowance to fall back to a generic line.\n */\n allowance?: AiCreditsNoticeAllowance;\n className?: string;\n}\n\nexport interface AiCreditsNoticeIncludedProps extends AiCreditsNoticeSharedProps {\n mode: 'included';\n /** Shows a quiet \"Learn more\" link — wire it once the credits upsell page ships. */\n onLearnMore?: () => void;\n /**\n * Shows a quiet \"Don't show again\" link. The host decides what \"again\"\n * means — typically stop rendering `aiCreditsNotice` on the editor for the\n * rest of this mount, and persist the choice if it should survive a\n * reload (see the component's docs for a `usePersistentState` example).\n * Use a storage key scoped to the mode: switching from `included` to\n * `bundles` is a different message and should show once more.\n */\n onDismiss?: () => void;\n}\n\nexport interface AiCreditsNoticeBundlesProps extends AiCreditsNoticeSharedProps {\n mode: 'bundles';\n /** Opens the host's AI-credits bundle picker. The kit never builds that page itself. */\n onViewBundles: () => void;\n /** Shows a quiet \"What each action costs\" link. */\n onSeeCosts?: () => void;\n /** Shows a quiet \"Don't show again\" link. See the `included` prop of the\n * same name — the same mode-scoped-key guidance applies here too. */\n onDismiss?: () => void;\n}\n\nexport type AiCreditsNoticeProps =\n | AiCreditsNoticeIncludedProps\n | AiCreditsNoticeBundlesProps;\n\n/* Every callback either mode can carry, all optional at once. The footer\n reads them from `props`; this shape exists only so the component can\n destructure them OUT of the `rest` it spreads onto the root `<div>`.\n React resolves any `on[A-Z]…` prop as a DOM event, so leaving them in\n `rest` logged \"Unknown event handler property: onLearnMore\" (and one per\n sibling) on every render — and the editor renders this card on every AI\n trigger, so the warnings repeated on every hover (caught in review on\n #180). A cast, not four narrowed reads: `props` is a discriminated union\n and TypeScript refuses `onViewBundles` off the `included` arm. */\ntype AiCreditsNoticeCallbacks = Partial<\n Pick<AiCreditsNoticeIncludedProps, 'onLearnMore' | 'onDismiss'> &\n Pick<AiCreditsNoticeBundlesProps, 'onViewBundles' | 'onSeeCosts'>\n>;\n\nexport const AiCreditsNotice = forwardRef<\n HTMLDivElement,\n AiCreditsNoticeProps & Omit<HTMLAttributes<HTMLDivElement>, 'className'>\n>((props, ref) => {\n const { t, i18n } = useTranslation();\n // Two steps, not one. The first reads straight off `props` so that\n // `mode === 'included'` below still narrows `props` itself (TypeScript's\n // aliased-discriminant narrowing) — destructuring off a cast breaks that\n // link and the footer's `props.onLearnMore` stops compiling. The second\n // strips the callbacks out of what is left, so `rest` reaches the DOM node\n // carrying only real HTML attributes. See `AiCreditsNoticeCallbacks`.\n const { allowance, className, mode, ...restWithCallbacks } = props;\n const {\n onLearnMore: _onLearnMore,\n onDismiss: _onDismiss,\n onViewBundles: _onViewBundles,\n onSeeCosts: _onSeeCosts,\n ...rest\n } = restWithCallbacks as typeof restWithCallbacks & AiCreditsNoticeCallbacks;\n\n // A `limit` of 0 (a host still loading, or a plan with no allowance at\n // all) would divide by zero in the Progress meter — treat it the same as\n // no allowance rather than rendering a broken 0/0 meter.\n const hasUsableAllowance = Boolean(allowance && allowance.limit > 0);\n\n const resetsOnText =\n hasUsableAllowance && allowance?.resetsOn\n ? new Intl.DateTimeFormat(i18n.language, {\n day: 'numeric',\n month: 'long',\n }).format(allowance.resetsOn)\n : undefined;\n\n const allowanceLine = hasUsableAllowance\n ? t('aiCreditsNotice.included.allowance', {\n remaining: allowance!.remaining,\n limit: allowance!.limit,\n })\n : undefined;\n\n // `hasUsableAllowance`, not a bare `allowance` check: a host still loading\n // sends `{ remaining: 0, limit: 0 }`, which read literally becomes \"0 of 0\n // credits\" and \"the free tier includes 0 actions a month\" — two sentences\n // that are wrong rather than merely vague. `included` already treated a\n // zero limit as no allowance; `bundles` now agrees and falls back to the\n // generic lines (caught in review on #180).\n const heading =\n mode === 'included'\n ? t('aiCreditsNotice.included.heading')\n : hasUsableAllowance\n ? t('aiCreditsNotice.bundles.headingWithAllowance', {\n remaining: allowance!.remaining,\n limit: allowance!.limit,\n })\n : t('aiCreditsNotice.bundles.eyebrow');\n\n const body =\n mode === 'included'\n ? t('aiCreditsNotice.included.body')\n : hasUsableAllowance\n ? t('aiCreditsNotice.bundles.body', { limit: allowance!.limit })\n : t('aiCreditsNotice.bundles.bodyGeneric');\n\n return (\n <div\n {...rest}\n ref={ref}\n // AFTER `rest`, not before: these are the required agent-readiness DOM\n // hooks (see 26-agent-readiness.mdx §A3) and must always win over\n // anything a caller passes through the HTMLAttributes spread — a\n // caller-supplied `data-component` must never be able to replace the\n // component's own marker.\n data-component=\"ai-credits-notice\"\n data-mode={mode}\n className={rootVariants({ mode, className })}\n >\n <HoverCard.Eyebrow>\n {mode === 'included'\n ? t('aiCreditsNotice.included.eyebrow')\n : t('aiCreditsNotice.bundles.eyebrow')}\n </HoverCard.Eyebrow>\n <HoverCard.Heading>{heading}</HoverCard.Heading>\n <HoverCard.Body>\n <p className=\"ds:m-0\">{body}</p>\n {mode === 'included' && hasUsableAllowance ? (\n <div className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-2xs)] ds:[margin-block-start:var(--spacing-sm)]\">\n <div className=\"ds:flex ds:items-center ds:gap-[var(--spacing-xs)]\">\n <span className=\"type-label\">{allowanceLine}</span>\n </div>\n <Progress\n value={Math.max(0, allowance!.limit - allowance!.remaining)}\n max={allowance!.limit}\n size=\"sm\"\n ariaLabel={t('aiCreditsNotice.included.eyebrow')}\n ariaValueText={allowanceLine}\n />\n {resetsOnText ? (\n <p className=\"ds:m-0 type-body-sm ds:text-[color:var(--muted-foreground)]\">\n {t('aiCreditsNotice.included.resetsOn', { date: resetsOnText })}\n </p>\n ) : null}\n </div>\n ) : null}\n </HoverCard.Body>\n {mode === 'included' ? (\n props.onLearnMore || props.onDismiss ? (\n <HoverCard.Footer>\n {props.onDismiss ? (\n <Button\n intent=\"link\"\n size=\"sm\"\n onClick={props.onDismiss}\n className=\"ds:me-auto\"\n >\n {t('aiCreditsNotice.dismiss')}\n </Button>\n ) : null}\n {props.onLearnMore ? (\n <Button intent=\"link\" size=\"sm\" onClick={props.onLearnMore}>\n {t('aiCreditsNotice.included.learnMore')}\n </Button>\n ) : null}\n </HoverCard.Footer>\n ) : null\n ) : (\n <HoverCard.Footer>\n {props.onSeeCosts || props.onDismiss ? (\n <div className=\"ds:me-auto ds:flex ds:items-center ds:gap-[var(--spacing-sm)]\">\n {props.onSeeCosts ? (\n <Button intent=\"link\" size=\"sm\" onClick={props.onSeeCosts}>\n {t('aiCreditsNotice.bundles.seeCosts')}\n </Button>\n ) : null}\n {props.onDismiss ? (\n <Button intent=\"link\" size=\"sm\" onClick={props.onDismiss}>\n {t('aiCreditsNotice.dismiss')}\n </Button>\n ) : null}\n </div>\n ) : null}\n <Button intent=\"tonal\" size=\"sm\" onClick={props.onViewBundles}>\n {t('aiCreditsNotice.bundles.viewBundles')}\n </Button>\n </HoverCard.Footer>\n )}\n </div>\n );\n});\nAiCreditsNotice.displayName = 'AiCreditsNotice';\n"],"names":["rootVariants","cva","AiCreditsNotice","forwardRef","props","ref","t","i18n","useTranslation","allowance","className","mode","restWithCallbacks","_onLearnMore","_onDismiss","_onViewBundles","_onSeeCosts","rest","hasUsableAllowance","resetsOnText","allowanceLine","heading","body","jsxs","jsx","HoverCard","Progress","Button"],"mappings":";;;;;;;AAwBA,MAAMA,IAAeC,EAAI,sCAAsC;AAAA,EAC7D,UAAU;AAAA,IACR,MAAM;AAAA,MACJ,UAAU;AAAA,MACV,SAAS;AAAA,IAAA;AAAA,EACX;AAAA,EAEF,iBAAiB;AAAA,IACf,MAAM;AAAA,EAAA;AAEV,CAAC,GAmEYC,IAAkBC,EAG7B,CAACC,GAAOC,MAAQ;AAChB,QAAM,EAAE,GAAAC,GAAG,MAAAC,EAAA,IAASC,EAAA,GAOd,EAAE,WAAAC,GAAW,WAAAC,GAAW,MAAAC,GAAM,GAAGC,MAAsBR,GACvD;AAAA,IACJ,aAAaS;AAAA,IACb,WAAWC;AAAA,IACX,eAAeC;AAAA,IACf,YAAYC;AAAA,IACZ,GAAGC;AAAA,EAAA,IACDL,GAKEM,IAAqB,GAAQT,KAAaA,EAAU,QAAQ,IAE5DU,IACJD,MAAsBT,KAAA,QAAAA,EAAW,YAC7B,IAAI,KAAK,eAAeF,EAAK,UAAU;AAAA,IACr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AE,EAAE,qCAAqC,EAAA,CAC1C;AAAA,QAAA,EAAA,CACF;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAIR,CAAC;AACDJ,EAAgB,cAAc;"}
@@ -0,0 +1,17 @@
1
+ const i = {
2
+ id: "ai-credits-notice",
3
+ capabilities: [],
4
+ state: {},
5
+ actions: {},
6
+ domHooks: {
7
+ root: {
8
+ attr: "data-component",
9
+ value: "ai-credits-notice",
10
+ description: 'Marks the element as a kit AiCreditsNotice card body. Carries a sibling `data-mode="included|bundles"` attribute for which notice is showing.'
11
+ }
12
+ }
13
+ };
14
+ export {
15
+ i as a
16
+ };
17
+ //# sourceMappingURL=ai-credits-notice.agent-C9L7orrP.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ai-credits-notice.agent-C9L7orrP.js","sources":["../../src/components/ai-credits-notice/ai-credits-notice.agent.ts"],"sourcesContent":["/* -------------------------------------------------------------------- */\n/* Agent adapter — AiCreditsNotice. */\n/* */\n/* Pure presentation: the body of a hover card explaining whether AI is */\n/* free today ('included') or metered ('bundles'). Its actions */\n/* (`onLearnMore` / `onViewBundles` / `onSeeCosts`) are host-supplied */\n/* seams with no return value, so the kit exposes only the DOM hooks a */\n/* future runtime would click through — no imperative handle to register. */\n/* -------------------------------------------------------------------- */\n\nimport type { AgentAdapter } from '../../agent/types';\n\nexport const aiCreditsNoticeAgent: AgentAdapter = {\n id: 'ai-credits-notice',\n capabilities: [],\n state: {},\n actions: {},\n domHooks: {\n root: {\n attr: 'data-component',\n value: 'ai-credits-notice',\n description:\n 'Marks the element as a kit AiCreditsNotice card body. Carries a ' +\n 'sibling `data-mode=\"included|bundles\"` attribute for which notice is showing.',\n },\n },\n};\n"],"names":["aiCreditsNoticeAgent"],"mappings":"AAYO,MAAMA,IAAqC;AAAA,EAChD,IAAI;AAAA,EACJ,cAAc,CAAA;AAAA,EACd,OAAO,CAAA;AAAA,EACP,SAAS,CAAA;AAAA,EACT,UAAU;AAAA,IACR,MAAM;AAAA,MACJ,MAAM;AAAA,MACN,OAAO;AAAA,MACP,aACE;AAAA,IAAA;AAAA,EAEJ;AAEJ;"}
@@ -168,4 +168,4 @@ export {
168
168
  D as A,
169
169
  M as a
170
170
  };
171
- //# sourceMappingURL=ai-consent-banner-D7I2U-cz.js.map
171
+ //# sourceMappingURL=ai-permission-notice-D7I2U-cz.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ai-permission-notice-D7I2U-cz.js","sources":["../../src/components/ai-permission-notice/ai-permission-notice.agent.ts","../../src/components/ai-permission-notice/ai-permission-notice.tsx"],"sourcesContent":["/* -------------------------------------------------------------------- */\n/* Agent adapter — AiConsentBanner. */\n/* */\n/* Read-only structural surface: the current consent state and whether */\n/* the grant affordance is armed. Identifiers / structural state ONLY — */\n/* never the grantee's name or any PHI. The real consent gate lives */\n/* server-side; this adapter does not expose a grant action so an agent */\n/* cannot consent on a user's behalf. */\n/* -------------------------------------------------------------------- */\n\nimport type { AgentAdapter } from '../../agent/types';\nimport type { AiConsentBannerHandle } from './ai-permission-notice';\n\nexport const aiConsentBannerAgent: AgentAdapter<AiConsentBannerHandle> = {\n id: 'ai-consent-banner',\n capabilities: [],\n state: {\n consentState: {\n type: \"'granted' | 'required' | 'pending'\",\n descriptionKey: 'ui.agent.aiConsentBanner.state.consentState',\n description:\n 'Current consent state. Structural only — never the grantee identity.',\n read: (handle) => handle.getState(),\n },\n armed: {\n type: 'boolean',\n descriptionKey: 'ui.agent.aiConsentBanner.state.armed',\n description:\n 'Whether the consent confirmation checkbox is ticked (required state only).',\n read: (handle) => handle.isArmed(),\n },\n },\n actions: {},\n domHooks: {\n root: {\n attr: 'data-component',\n value: 'ai-consent-banner',\n description: 'Marks the AiConsentBanner root region.',\n },\n instanceId: {\n attr: 'data-component-id',\n sourceProp: 'id',\n description:\n 'Sourced from the id prop. Required to address a specific banner from the agent.',\n },\n },\n};\n","import {\n forwardRef,\n useMemo,\n useRef,\n useState,\n type ComponentPropsWithoutRef,\n} from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\nimport { Alert } from '../alert/alert';\nimport { Badge } from '../badge/badge';\nimport { Button } from '../button/button';\nimport { Checkbox } from '../checkbox/checkbox';\nimport { Spinner } from '../spinner/spinner';\nimport { Timestamp } from '../timestamp/timestamp';\nimport { useAgentRegistration } from '../../agent/registry';\nimport { aiConsentBannerAgent } from './ai-permission-notice.agent';\n\n/* -------------------------------------------------------------------- */\n/* AiConsentBanner */\n/* */\n/* Presentational AI-consent gate surfaced above an AI-assisted surface */\n/* (e.g. Alfascribe consultation transcription). The SERVER owns the */\n/* real gate — this component only reflects the consent record and lets */\n/* the operator initiate a grant; it never enforces access itself. */\n/* */\n/* Three states drive the Alert variant + body: */\n/* - granted → success Alert with a Badge + when/who it was granted. */\n/* - required → info Alert with a Checkbox-gated Grant Button. */\n/* - pending → info Alert in a disabled, Spinner-busy state while the */\n/* server persists the grant. */\n/* */\n/* All visible text flows through useTranslation('ui') against the */\n/* `aiConsentBanner.*` namespace. */\n/* -------------------------------------------------------------------- */\n\n/* -------------------------------------------------------------------- */\n/* CVA — root */\n/* -------------------------------------------------------------------- */\n\nconst rootVariants = cva('ds:w-full ds:text-[color:var(--foreground)]', {\n variants: {\n state: {\n granted: '',\n required: '',\n pending: '',\n },\n },\n defaultVariants: {\n state: 'required',\n },\n});\n\n/* -------------------------------------------------------------------- */\n/* State derivation */\n/* -------------------------------------------------------------------- */\n\nexport type AiConsentState = NonNullable<\n VariantProps<typeof rootVariants>['state']\n>;\n\n/** Heading levels `AiConsentBanner.headingLevel` accepts. */\nexport type AiConsentBannerHeadingLevel = 1 | 2 | 3 | 4 | 5 | 6;\n\n/** Pending wins over granted/required so the busy state is never masked. */\nfunction deriveState(granted: boolean, pending: boolean): AiConsentState {\n if (pending) return 'pending';\n return granted ? 'granted' : 'required';\n}\n\n/* -------------------------------------------------------------------- */\n/* Public types */\n/* -------------------------------------------------------------------- */\n\n/** Agent-readiness curated handle. Exposes the structural consent state only. */\nexport interface AiConsentBannerHandle {\n /** Current derived state: 'granted' | 'required' | 'pending'. */\n getState: () => AiConsentState;\n /** Whether the Grant affordance is currently armed (checkbox ticked). */\n isArmed: () => boolean;\n}\n\nexport interface AiConsentBannerProps extends Omit<\n ComponentPropsWithoutRef<'div'>,\n 'aria-label' | 'children' | 'role'\n> {\n /**\n * Stable instance id. Surfaced on the root as `data-component-id` so an\n * agent / MCP UI bridge can address this specific banner. Mirrored to the\n * real DOM `id`.\n */\n id?: string;\n /** Whether consent has already been granted. Server-sourced. */\n granted: boolean;\n /**\n * When consent was granted — ISO-8601 string, ms-epoch, or Date. Rendered\n * via `Timestamp` in the granted state.\n */\n grantedAt?: string | number | Date;\n /** Who granted consent (operator display name / role). Granted state only. */\n grantedBy?: string;\n /**\n * Whether the current user is allowed to grant consent. When `false`, the\n * required-state Grant affordance is hidden and a not-allowed note shows.\n * Default `true`.\n */\n canGrant?: boolean;\n /** The grant is being persisted server-side — shows the busy Spinner state. */\n pending?: boolean;\n /** Fired when the operator confirms the consent grant. */\n onGrantConsent?: () => void;\n /**\n * Heading level for the banner's own title, so it can be nested under a\n * host section's heading without skipping levels (axe `heading-order`).\n * Additive: default `5` matches the banner's original, unconditional\n * `<h5>` — every existing consumer is unaffected.\n */\n headingLevel?: AiConsentBannerHeadingLevel;\n /** Override the region's accessible name. */\n 'aria-label'?: string;\n}\n\n/* -------------------------------------------------------------------- */\n/* Component */\n/* -------------------------------------------------------------------- */\n\nexport const AiConsentBanner = forwardRef<HTMLDivElement, AiConsentBannerProps>(\n (\n {\n id,\n granted,\n grantedAt,\n grantedBy,\n canGrant = true,\n pending = false,\n onGrantConsent,\n headingLevel = 5,\n 'aria-label': ariaLabel,\n className,\n ...rest\n },\n ref,\n ) => {\n const { t } = useTranslation();\n const state = deriveState(granted, pending);\n\n // Local arm switch — the required state gates the Grant Button behind an\n // explicit \"I understand\" checkbox so consent is never one mis-click away.\n const [armed, setArmed] = useState(false);\n\n const armedRef = useRef(armed);\n armedRef.current = armed;\n\n const handle = useMemo<AiConsentBannerHandle>(\n () => ({\n getState: () => deriveState(granted, pending),\n isArmed: () => armedRef.current,\n }),\n [granted, pending],\n );\n useAgentRegistration(aiConsentBannerAgent, handle, id);\n\n const resolvedAriaLabel =\n ariaLabel ?? t('aiConsentBanner.regionLabel', 'AI assistance consent');\n\n // Alert variant per state: granted → success, required/pending → info.\n const alertVariant = state === 'granted' ? 'success' : 'info';\n\n let body: React.ReactNode;\n if (state === 'granted') {\n body = (\n <div className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]\">\n <div className=\"ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-sm)]\">\n <Badge variant=\"success\">\n {t('aiConsentBanner.badge.granted', 'Consent granted')}\n </Badge>\n {grantedAt !== undefined ? (\n <span className=\"type-body-sm ds:text-[color:var(--muted-foreground)]\">\n {t('aiConsentBanner.grantedAtPrefix', 'Granted')}{' '}\n <Timestamp value={grantedAt} format=\"relative\" shape=\"inline\" />\n </span>\n ) : null}\n </div>\n {grantedBy ? (\n <p className=\"type-body-sm ds:m-0 ds:text-[color:var(--muted-foreground)]\">\n {t('aiConsentBanner.grantedBy', {\n name: grantedBy,\n defaultValue: 'By {{name}}',\n })}\n </p>\n ) : null}\n </div>\n );\n } else if (state === 'pending') {\n body = (\n <div className=\"ds:flex ds:items-center ds:gap-[var(--spacing-sm)]\">\n <Spinner\n variant=\"pulse\"\n size=\"sm\"\n label={t('aiConsentBanner.pendingLabel', 'Saving consent…')}\n />\n <span className=\"type-body-sm ds:text-[color:var(--muted-foreground)]\">\n {t('aiConsentBanner.pendingLabel', 'Saving consent…')}\n </span>\n </div>\n );\n } else {\n // required\n body = canGrant ? (\n <div className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]\">\n <Checkbox\n checked={armed}\n onCheckedChange={(next) => setArmed(next === true)}\n label={t(\n 'aiConsentBanner.confirmLabel',\n 'I confirm consent has been obtained for AI assistance.',\n )}\n />\n <Alert.Action>\n <Button\n intent=\"primary\"\n size=\"sm\"\n disabled={!armed}\n onClick={onGrantConsent}\n >\n {t('aiConsentBanner.grantButton', 'Grant consent')}\n </Button>\n </Alert.Action>\n </div>\n ) : (\n <p className=\"type-body-sm ds:m-0 ds:text-[color:var(--muted-foreground)]\">\n {t(\n 'aiConsentBanner.notAllowed',\n 'You do not have permission to grant AI assistance consent.',\n )}\n </p>\n );\n }\n\n return (\n <div\n ref={ref}\n role=\"region\"\n aria-label={resolvedAriaLabel}\n aria-busy={state === 'pending' ? true : undefined}\n data-component=\"ai-consent-banner\"\n data-component-id={id}\n data-state={state}\n id={id}\n className={rootVariants({ state, className })}\n {...rest}\n >\n <Alert\n variant={alertVariant}\n icon={state === 'pending' ? null : undefined}\n >\n <Alert.Title as={`h${headingLevel}` as const}>\n {t('aiConsentBanner.title', 'AI assistance consent')}\n </Alert.Title>\n <Alert.Description>\n {state === 'granted'\n ? t(\n 'aiConsentBanner.description.granted',\n 'AI assistance is enabled for this record.',\n )\n : t(\n 'aiConsentBanner.description.required',\n 'AI assistance requires recorded consent before it can run.',\n )}\n </Alert.Description>\n {body}\n </Alert>\n </div>\n );\n },\n);\n\nAiConsentBanner.displayName = 'AiConsentBanner';\n"],"names":["aiConsentBannerAgent","handle","rootVariants","cva","deriveState","granted","pending","AiConsentBanner","forwardRef","id","grantedAt","grantedBy","canGrant","onGrantConsent","headingLevel","ariaLabel","className","rest","ref","t","useTranslation","state","armed","setArmed","useState","armedRef","useRef","useMemo","useAgentRegistration","resolvedAriaLabel","alertVariant","body","jsxs","jsx","Badge","Timestamp","Spinner","Checkbox","next","Alert","Button"],"mappings":";;;;;;;;;;;AAaO,MAAMA,IAA4D;AAAA,EACvE,IAAI;AAAA,EACJ,cAAc,CAAA;AAAA,EACd,OAAO;AAAA,IACL,cAAc;AAAA,MACZ,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aACE;AAAA,MACF,MAAM,CAACC,MAAWA,EAAO,SAAA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GN;AACF;AAEAxB,EAAgB,cAAc;"}
@@ -0,0 +1,45 @@
1
+ import { jsxs as e, jsx as r } from "react/jsx-runtime";
2
+ import { forwardRef as i } from "react";
3
+ import { c as l } from "./index-D2ZczOXr.js";
4
+ import { C as p, a as o, b as n } from "./use-ai-sparkle-Cf4yVTLB.js";
5
+ import { A as m } from "./astroid-BN4f5VXU.js";
6
+ const t = l("ds:pointer-events-none", {
7
+ variants: {
8
+ state: {
9
+ intro: "",
10
+ working: "",
11
+ landed: ""
12
+ }
13
+ }
14
+ }), c = i(
15
+ ({ state: a }, d) => a ? /* @__PURE__ */ e(
16
+ "span",
17
+ {
18
+ ref: d,
19
+ "data-component": "ai-sparkle",
20
+ "aria-hidden": "true",
21
+ className: t({ state: a }),
22
+ children: [
23
+ p.map((s) => /* @__PURE__ */ r(
24
+ "span",
25
+ {
26
+ className: `${o} ${n[a]} ${s.lag}`,
27
+ children: /* @__PURE__ */ r(
28
+ "span",
29
+ {
30
+ className: `ds:block ds:rounded-full ds:bg-[var(--ai-sparkle)] ds:shadow-[0_0_var(--spacing-2xs)_var(--ai-sparkle)] ${s.dot}`
31
+ }
32
+ )
33
+ },
34
+ s.key
35
+ )),
36
+ /* @__PURE__ */ r("span", { className: `${o} ${n[a]}`, children: /* @__PURE__ */ r(m, { className: "ds:block ds:size-3 ds:fill-current ds:text-[color:var(--primary-foreground)] ds:drop-shadow-[0_0_var(--spacing-2xs)_var(--ai-sparkle)]" }) })
37
+ ]
38
+ }
39
+ ) : null
40
+ );
41
+ c.displayName = "AiSparkle";
42
+ export {
43
+ c as A
44
+ };
45
+ //# sourceMappingURL=ai-sparkle-D23NT8Z_.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ai-sparkle-D23NT8Z_.js","sources":["../../src/components/ai-sparkle/ai-sparkle.tsx"],"sourcesContent":["import { forwardRef } from 'react';\nimport { cva } from 'class-variance-authority';\nimport { Astroid } from 'lucide-react';\nimport {\n type AiSparkleState,\n COMET_CLASS,\n COMET_TAIL,\n COMET_WRAPPER_CLASS,\n} from '../../hooks/use-ai-sparkle';\n\nexport type { AiSparkleState };\n\nexport interface AiSparkleProps {\n /**\n * The current phase, from `useAiSparkle`. Renders nothing when `null` —\n * callers don't need to guard the mount themselves.\n */\n state: AiSparkleState | null;\n}\n\n// No visual differs by variant today (each state's look lives in the class\n// tables the hook exports) — the CVA still names `state` as the component's\n// one variant axis, per the kit's \"CVA for variants\" rule, and is the seam\n// a future state-specific wrapper class would hang off.\nconst sparkleVariants = cva('ds:pointer-events-none', {\n variants: {\n state: {\n intro: '',\n working: '',\n landed: '',\n },\n },\n});\n\n/**\n * The AI pill's comet sparkle: a comet with a six-dot tail riding the\n * host's rounded outline — once on `intro`, looping while an action runs,\n * and a faster lap as the result lands.\n *\n * Purely decorative (`aria-hidden`) and stateless — pass the `state` from\n * `useAiSparkle`. The shimmer layer (a light sweep across the host itself)\n * is not part of this component: it needs no extra DOM, so it travels as\n * a class string on `useAiSparkle(...).props.className` instead. Position\n * this component's host with `relative` (or `absolute`) sizing that matches\n * the surface the sparkle decorates — it fills `inset-0` of its offset\n * parent via the comet's `offset-path`.\n */\nexport const AiSparkle = forwardRef<HTMLSpanElement, AiSparkleProps>(\n ({ state }, ref) => {\n if (!state) return null;\n\n return (\n <span\n ref={ref}\n data-component=\"ai-sparkle\"\n aria-hidden=\"true\"\n className={sparkleVariants({ state })}\n >\n {COMET_TAIL.map((piece) => (\n <span\n key={piece.key}\n className={`${COMET_WRAPPER_CLASS} ${COMET_CLASS[state]} ${piece.lag}`}\n >\n <span\n className={`ds:block ds:rounded-full ds:bg-[var(--ai-sparkle)] ds:shadow-[0_0_var(--spacing-2xs)_var(--ai-sparkle)] ${piece.dot}`}\n />\n </span>\n ))}\n <span className={`${COMET_WRAPPER_CLASS} ${COMET_CLASS[state]}`}>\n <Astroid className=\"ds:block ds:size-3 ds:fill-current ds:text-[color:var(--primary-foreground)] ds:drop-shadow-[0_0_var(--spacing-2xs)_var(--ai-sparkle)]\" />\n </span>\n </span>\n );\n },\n);\n\nAiSparkle.displayName = 'AiSparkle';\n"],"names":["sparkleVariants","cva","AiSparkle","forwardRef","state","ref","jsxs","COMET_TAIL","piece","jsx","COMET_WRAPPER_CLASS","COMET_CLASS","Astroid"],"mappings":";;;;;AAwBA,MAAMA,IAAkBC,EAAI,0BAA0B;AAAA,EACpD,UAAU;AAAA,IACR,OAAO;AAAA,MACL,OAAO;AAAA,MACP,SAAS;AAAA,MACT,QAAQ;AAAA,IAAA;AAAA,EACV;AAEJ,CAAC,GAeYC,IAAYC;AAAA,EACvB,CAAC,EAAE,OAAAC,EAAA,GAASC,MACLD,IAGH,gBAAAE;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,KAAAD;AAAA,MACA,kBAAe;AAAA,MACf,eAAY;AAAA,MACZ,WAAWL,EAAgB,EAAE,OAAAI,GAAO;AAAA,MAEnC,UAAA;AAAA,QAAAG,EAAW,IAAI,CAACC,MACf,gBAAAC;AAAA,UAAC;AAAA,UAAA;AAAA,YAEC,WAAW,GAAGC,CAAmB,IAAIC,EAAYP,CAAK,CAAC,IAAII,EAAM,GAAG;AAAA,YAEpE,UAAA,gBAAAC;AAAA,cAAC;AAAA,cAAA;AAAA,gBACC,WAAW,2GAA2GD,EAAM,GAAG;AAAA,cAAA;AAAA,YAAA;AAAA,UACjI;AAAA,UALKA,EAAM;AAAA,QAAA,CAOd;AAAA,QACD,gBAAAC,EAAC,QAAA,EAAK,WAAW,GAAGC,CAAmB,IAAIC,EAAYP,CAAK,CAAC,IAC3D,UAAA,gBAAAK,EAACG,GAAA,EAAQ,WAAU,0IAAyI,EAAA,CAC9J;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA,IArBe;AAyBvB;AAEAV,EAAU,cAAc;"}
@@ -45,7 +45,7 @@ import { T as Ci } from "./trash-2-uumy3fy1.js";
45
45
  import { A as Si, b as Ei, c as Ai, a as Di } from "./accordion-C11v9ouP.js";
46
46
  import { P as Ii } from "./progress-CK8otcQ-.js";
47
47
  import { c as rt } from "./createLucideIcon-DhHxpK9K.js";
48
- import { I as Tn } from "./icon-button-group-DkkdIygu.js";
48
+ import { I as Tn } from "./icon-button-group-DZKC6KGf.js";
49
49
  import { L as nn } from "./list-DgE1xWBM.js";
50
50
  import { S as lt } from "./switch-OILsBLWo.js";
51
51
  import { G as Li } from "./grip-vertical-onSb1JXO.js";
@@ -9413,4 +9413,4 @@ export {
9413
9413
  Ba as t,
9414
9414
  Bl as u
9415
9415
  };
9416
- //# sourceMappingURL=anamnesis-summary-rows-DQUqwWc1.js.map
9416
+ //# sourceMappingURL=anamnesis-summary-rows-DI-UX5r6.js.map