@lincyaw/aegis-ui 0.10.0 → 0.11.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 (334) hide show
  1. package/dist/agent/ask/AskPanel.cjs +1 -1
  2. package/dist/agent/ask/AskPanel.cjs.map +1 -1
  3. package/dist/agent/ask/AskPanel.d.ts +5 -0
  4. package/dist/agent/ask/AskPanel.js +107 -100
  5. package/dist/agent/ask/AskPanel.js.map +1 -1
  6. package/dist/commands/commandContext.cjs.map +1 -1
  7. package/dist/commands/commandContext.d.ts +4 -1
  8. package/dist/commands/commandContext.js.map +1 -1
  9. package/dist/components/ui/AgentPanel.cjs +1 -1
  10. package/dist/components/ui/AgentPanel.cjs.map +1 -1
  11. package/dist/components/ui/AgentPanel.js +15 -14
  12. package/dist/components/ui/AgentPanel.js.map +1 -1
  13. package/dist/components/ui/Avatar.cjs +1 -1
  14. package/dist/components/ui/Avatar.cjs.map +1 -1
  15. package/dist/components/ui/Avatar.js +21 -19
  16. package/dist/components/ui/Avatar.js.map +1 -1
  17. package/dist/components/ui/BlastRadiusBar.cjs +1 -1
  18. package/dist/components/ui/BlastRadiusBar.cjs.map +1 -1
  19. package/dist/components/ui/BlastRadiusBar.d.ts +16 -4
  20. package/dist/components/ui/BlastRadiusBar.js +27 -23
  21. package/dist/components/ui/BlastRadiusBar.js.map +1 -1
  22. package/dist/components/ui/ChatComposer.cjs +1 -1
  23. package/dist/components/ui/ChatComposer.cjs.map +1 -1
  24. package/dist/components/ui/ChatComposer.js +32 -31
  25. package/dist/components/ui/ChatComposer.js.map +1 -1
  26. package/dist/components/ui/ChatSessionList.cjs +1 -1
  27. package/dist/components/ui/ChatSessionList.cjs.map +1 -1
  28. package/dist/components/ui/ChatSessionList.js +68 -66
  29. package/dist/components/ui/ChatSessionList.js.map +1 -1
  30. package/dist/components/ui/Checkbox.cjs +1 -1
  31. package/dist/components/ui/Checkbox.cjs.map +1 -1
  32. package/dist/components/ui/Checkbox.d.ts +6 -2
  33. package/dist/components/ui/Checkbox.js +21 -17
  34. package/dist/components/ui/Checkbox.js.map +1 -1
  35. package/dist/components/ui/ChoiceCardGroup.cjs +1 -1
  36. package/dist/components/ui/ChoiceCardGroup.cjs.map +1 -1
  37. package/dist/components/ui/ChoiceCardGroup.d.ts +13 -4
  38. package/dist/components/ui/ChoiceCardGroup.js +47 -35
  39. package/dist/components/ui/ChoiceCardGroup.js.map +1 -1
  40. package/dist/components/ui/CodeEditor.cjs +1 -1
  41. package/dist/components/ui/CodeEditor.cjs.map +1 -1
  42. package/dist/components/ui/CodeEditor.d.ts +11 -1
  43. package/dist/components/ui/CodeEditor.js +100 -74
  44. package/dist/components/ui/CodeEditor.js.map +1 -1
  45. package/dist/components/ui/CommandInvocationCard.cjs +1 -1
  46. package/dist/components/ui/CommandInvocationCard.cjs.map +1 -1
  47. package/dist/components/ui/CommandInvocationCard.js +28 -31
  48. package/dist/components/ui/CommandInvocationCard.js.map +1 -1
  49. package/dist/components/ui/CommandPalette.cjs +1 -1
  50. package/dist/components/ui/CommandPalette.cjs.map +1 -1
  51. package/dist/components/ui/CommandPalette.d.ts +3 -3
  52. package/dist/components/ui/CommandPalette.js +75 -75
  53. package/dist/components/ui/CommandPalette.js.map +1 -1
  54. package/dist/components/ui/CommitGraph.cjs +1 -1
  55. package/dist/components/ui/CommitGraph.cjs.map +1 -1
  56. package/dist/components/ui/CommitGraph.d.ts +3 -1
  57. package/dist/components/ui/CommitGraph.js +77 -74
  58. package/dist/components/ui/CommitGraph.js.map +1 -1
  59. package/dist/components/ui/ContentInspectorDialog.cjs +1 -1
  60. package/dist/components/ui/ContentInspectorDialog.cjs.map +1 -1
  61. package/dist/components/ui/ContentInspectorDialog.js +25 -31
  62. package/dist/components/ui/ContentInspectorDialog.js.map +1 -1
  63. package/dist/components/ui/ContentPreview.cjs +2 -2
  64. package/dist/components/ui/ContentPreview.cjs.map +1 -1
  65. package/dist/components/ui/ContentPreview.js +55 -56
  66. package/dist/components/ui/ContentPreview.js.map +1 -1
  67. package/dist/components/ui/DangerZone.cjs +1 -1
  68. package/dist/components/ui/DangerZone.cjs.map +1 -1
  69. package/dist/components/ui/DangerZone.js +13 -12
  70. package/dist/components/ui/DangerZone.js.map +1 -1
  71. package/dist/components/ui/DataList.cjs +1 -1
  72. package/dist/components/ui/DataList.cjs.map +1 -1
  73. package/dist/components/ui/DataList.js +25 -24
  74. package/dist/components/ui/DataList.js.map +1 -1
  75. package/dist/components/ui/DataTable.cjs +1 -1
  76. package/dist/components/ui/DataTable.cjs.map +1 -1
  77. package/dist/components/ui/DataTable.js +41 -41
  78. package/dist/components/ui/DataTable.js.map +1 -1
  79. package/dist/components/ui/DropdownMenu.cjs +1 -1
  80. package/dist/components/ui/DropdownMenu.cjs.map +1 -1
  81. package/dist/components/ui/DropdownMenu.js +41 -40
  82. package/dist/components/ui/DropdownMenu.js.map +1 -1
  83. package/dist/components/ui/EnvironmentSwitcher.cjs +1 -1
  84. package/dist/components/ui/EnvironmentSwitcher.cjs.map +1 -1
  85. package/dist/components/ui/EnvironmentSwitcher.js +26 -24
  86. package/dist/components/ui/EnvironmentSwitcher.js.map +1 -1
  87. package/dist/components/ui/EventTable.cjs +1 -1
  88. package/dist/components/ui/EventTable.cjs.map +1 -1
  89. package/dist/components/ui/EventTable.js +60 -53
  90. package/dist/components/ui/EventTable.js.map +1 -1
  91. package/dist/components/ui/FileDropzone.cjs +1 -1
  92. package/dist/components/ui/FileDropzone.cjs.map +1 -1
  93. package/dist/components/ui/FileDropzone.js +38 -40
  94. package/dist/components/ui/FileDropzone.js.map +1 -1
  95. package/dist/components/ui/FilePreview.cjs +1 -1
  96. package/dist/components/ui/FilePreview.cjs.map +1 -1
  97. package/dist/components/ui/FilePreview.js +60 -61
  98. package/dist/components/ui/FilePreview.js.map +1 -1
  99. package/dist/components/ui/FolderDropzone.cjs +1 -1
  100. package/dist/components/ui/FolderDropzone.cjs.map +1 -1
  101. package/dist/components/ui/FolderDropzone.js +114 -84
  102. package/dist/components/ui/FolderDropzone.js.map +1 -1
  103. package/dist/components/ui/ForgotPasswordForm.cjs +1 -1
  104. package/dist/components/ui/ForgotPasswordForm.cjs.map +1 -1
  105. package/dist/components/ui/ForgotPasswordForm.js +22 -21
  106. package/dist/components/ui/ForgotPasswordForm.js.map +1 -1
  107. package/dist/components/ui/FormRow.cjs +1 -1
  108. package/dist/components/ui/FormRow.cjs.map +1 -1
  109. package/dist/components/ui/FormRow.d.ts +32 -11
  110. package/dist/components/ui/FormRow.js +24 -15
  111. package/dist/components/ui/FormRow.js.map +1 -1
  112. package/dist/components/ui/InboxPage.cjs +1 -1
  113. package/dist/components/ui/InboxPage.cjs.map +1 -1
  114. package/dist/components/ui/InboxPage.d.ts +12 -3
  115. package/dist/components/ui/InboxPage.js +91 -77
  116. package/dist/components/ui/InboxPage.js.map +1 -1
  117. package/dist/components/ui/LoginForm.cjs +1 -1
  118. package/dist/components/ui/LoginForm.cjs.map +1 -1
  119. package/dist/components/ui/LoginForm.js +43 -43
  120. package/dist/components/ui/LoginForm.js.map +1 -1
  121. package/dist/components/ui/MonoValue.cjs +1 -1
  122. package/dist/components/ui/MonoValue.cjs.map +1 -1
  123. package/dist/components/ui/MonoValue.d.ts +5 -1
  124. package/dist/components/ui/MonoValue.js +17 -17
  125. package/dist/components/ui/MonoValue.js.map +1 -1
  126. package/dist/components/ui/NotificationBell.cjs +1 -1
  127. package/dist/components/ui/NotificationBell.cjs.map +1 -1
  128. package/dist/components/ui/NotificationBell.d.ts +17 -1
  129. package/dist/components/ui/NotificationBell.js +129 -75
  130. package/dist/components/ui/NotificationBell.js.map +1 -1
  131. package/dist/components/ui/NumberField.cjs +1 -1
  132. package/dist/components/ui/NumberField.cjs.map +1 -1
  133. package/dist/components/ui/NumberField.d.ts +3 -1
  134. package/dist/components/ui/NumberField.js +52 -49
  135. package/dist/components/ui/NumberField.js.map +1 -1
  136. package/dist/components/ui/ObjectBrowser.cjs +1 -1
  137. package/dist/components/ui/ObjectBrowser.cjs.map +1 -1
  138. package/dist/components/ui/ObjectBrowser.js +83 -78
  139. package/dist/components/ui/ObjectBrowser.js.map +1 -1
  140. package/dist/components/ui/PageSizeSelect.cjs +1 -1
  141. package/dist/components/ui/PageSizeSelect.cjs.map +1 -1
  142. package/dist/components/ui/PageSizeSelect.js +30 -29
  143. package/dist/components/ui/PageSizeSelect.js.map +1 -1
  144. package/dist/components/ui/Panel.cjs.map +1 -1
  145. package/dist/components/ui/Panel.d.ts +5 -2
  146. package/dist/components/ui/Panel.js.map +1 -1
  147. package/dist/components/ui/ParquetViewer.cjs +1 -1
  148. package/dist/components/ui/ParquetViewer.cjs.map +1 -1
  149. package/dist/components/ui/ParquetViewer.js +69 -74
  150. package/dist/components/ui/ParquetViewer.js.map +1 -1
  151. package/dist/components/ui/PasswordField.cjs +1 -1
  152. package/dist/components/ui/PasswordField.cjs.map +1 -1
  153. package/dist/components/ui/PasswordField.js +28 -27
  154. package/dist/components/ui/PasswordField.js.map +1 -1
  155. package/dist/components/ui/PickerField.cjs +1 -1
  156. package/dist/components/ui/PickerField.cjs.map +1 -1
  157. package/dist/components/ui/PickerField.d.ts +25 -6
  158. package/dist/components/ui/PickerField.js +20 -17
  159. package/dist/components/ui/PickerField.js.map +1 -1
  160. package/dist/components/ui/ProjectSelector.cjs +1 -1
  161. package/dist/components/ui/ProjectSelector.cjs.map +1 -1
  162. package/dist/components/ui/ProjectSelector.js +40 -37
  163. package/dist/components/ui/ProjectSelector.js.map +1 -1
  164. package/dist/components/ui/QueryAutocomplete.cjs +1 -1
  165. package/dist/components/ui/QueryAutocomplete.cjs.map +1 -1
  166. package/dist/components/ui/QueryAutocomplete.d.ts +7 -1
  167. package/dist/components/ui/QueryAutocomplete.js +141 -134
  168. package/dist/components/ui/QueryAutocomplete.js.map +1 -1
  169. package/dist/components/ui/RegisterForm.cjs +1 -1
  170. package/dist/components/ui/RegisterForm.cjs.map +1 -1
  171. package/dist/components/ui/RegisterForm.js +41 -40
  172. package/dist/components/ui/RegisterForm.js.map +1 -1
  173. package/dist/components/ui/ResizableSidePanel.cjs +1 -1
  174. package/dist/components/ui/ResizableSidePanel.cjs.map +1 -1
  175. package/dist/components/ui/ResizableSidePanel.js +41 -40
  176. package/dist/components/ui/ResizableSidePanel.js.map +1 -1
  177. package/dist/components/ui/SavedQueryBar.cjs +1 -1
  178. package/dist/components/ui/SavedQueryBar.cjs.map +1 -1
  179. package/dist/components/ui/SavedQueryBar.d.ts +1 -1
  180. package/dist/components/ui/SavedQueryBar.js +375 -277
  181. package/dist/components/ui/SavedQueryBar.js.map +1 -1
  182. package/dist/components/ui/SearchInput.cjs +1 -1
  183. package/dist/components/ui/SearchInput.cjs.map +1 -1
  184. package/dist/components/ui/SearchInput.d.ts +5 -1
  185. package/dist/components/ui/SearchInput.js +28 -24
  186. package/dist/components/ui/SearchInput.js.map +1 -1
  187. package/dist/components/ui/Select.cjs +1 -1
  188. package/dist/components/ui/Select.cjs.map +1 -1
  189. package/dist/components/ui/Select.d.ts +3 -1
  190. package/dist/components/ui/Select.js +21 -19
  191. package/dist/components/ui/Select.js.map +1 -1
  192. package/dist/components/ui/ServiceMap.cjs +1 -1
  193. package/dist/components/ui/ServiceMap.cjs.map +1 -1
  194. package/dist/components/ui/ServiceMap.d.ts +9 -3
  195. package/dist/components/ui/ServiceMap.js +291 -231
  196. package/dist/components/ui/ServiceMap.js.map +1 -1
  197. package/dist/components/ui/Slider.cjs +1 -1
  198. package/dist/components/ui/Slider.cjs.map +1 -1
  199. package/dist/components/ui/Slider.d.ts +3 -1
  200. package/dist/components/ui/Slider.js +11 -9
  201. package/dist/components/ui/Slider.js.map +1 -1
  202. package/dist/components/ui/SparkLine.cjs +1 -1
  203. package/dist/components/ui/SparkLine.cjs.map +1 -1
  204. package/dist/components/ui/SparkLine.js +24 -23
  205. package/dist/components/ui/SparkLine.js.map +1 -1
  206. package/dist/components/ui/Steps.cjs +1 -1
  207. package/dist/components/ui/Steps.cjs.map +1 -1
  208. package/dist/components/ui/Steps.js +25 -29
  209. package/dist/components/ui/Steps.js.map +1 -1
  210. package/dist/components/ui/Terminal.cjs +1 -1
  211. package/dist/components/ui/Terminal.cjs.map +1 -1
  212. package/dist/components/ui/Terminal.js +18 -17
  213. package/dist/components/ui/Terminal.js.map +1 -1
  214. package/dist/components/ui/TextField.cjs +1 -1
  215. package/dist/components/ui/TextField.cjs.map +1 -1
  216. package/dist/components/ui/TextField.js +6 -6
  217. package/dist/components/ui/TextField.js.map +1 -1
  218. package/dist/components/ui/ThemeToggle.cjs +1 -1
  219. package/dist/components/ui/ThemeToggle.cjs.map +1 -1
  220. package/dist/components/ui/ThemeToggle.js +15 -18
  221. package/dist/components/ui/ThemeToggle.js.map +1 -1
  222. package/dist/components/ui/TimeDisplay.cjs +1 -1
  223. package/dist/components/ui/TimeDisplay.cjs.map +1 -1
  224. package/dist/components/ui/TimeDisplay.js +12 -12
  225. package/dist/components/ui/TimeDisplay.js.map +1 -1
  226. package/dist/components/ui/TimeRangePicker.cjs +1 -1
  227. package/dist/components/ui/TimeRangePicker.cjs.map +1 -1
  228. package/dist/components/ui/TimeRangePicker.js +128 -111
  229. package/dist/components/ui/TimeRangePicker.js.map +1 -1
  230. package/dist/components/ui/TraceSpanInspector.cjs +1 -1
  231. package/dist/components/ui/TraceSpanInspector.cjs.map +1 -1
  232. package/dist/components/ui/TraceSpanInspector.js +43 -46
  233. package/dist/components/ui/TraceSpanInspector.js.map +1 -1
  234. package/dist/components/ui/TraceTree.cjs +1 -1
  235. package/dist/components/ui/TraceTree.cjs.map +1 -1
  236. package/dist/components/ui/TraceTree.d.ts +1 -1
  237. package/dist/components/ui/TraceTree.js +33 -33
  238. package/dist/components/ui/TraceTree.js.map +1 -1
  239. package/dist/components/ui/UploadQueue.cjs +1 -1
  240. package/dist/components/ui/UploadQueue.cjs.map +1 -1
  241. package/dist/components/ui/UploadQueue.js +59 -70
  242. package/dist/components/ui/UploadQueue.js.map +1 -1
  243. package/dist/components/ui/authValidation.cjs +1 -1
  244. package/dist/components/ui/authValidation.cjs.map +1 -1
  245. package/dist/components/ui/authValidation.d.ts +2 -2
  246. package/dist/components/ui/authValidation.js +4 -5
  247. package/dist/components/ui/authValidation.js.map +1 -1
  248. package/dist/components/ui/classifyContent.cjs +3 -3
  249. package/dist/components/ui/classifyContent.cjs.map +1 -1
  250. package/dist/components/ui/classifyContent.d.ts +2 -1
  251. package/dist/components/ui/classifyContent.js +52 -54
  252. package/dist/components/ui/classifyContent.js.map +1 -1
  253. package/dist/components/ui/relativeTime.cjs +1 -1
  254. package/dist/components/ui/relativeTime.cjs.map +1 -1
  255. package/dist/components/ui/relativeTime.d.ts +5 -3
  256. package/dist/components/ui/relativeTime.js +15 -6
  257. package/dist/components/ui/relativeTime.js.map +1 -1
  258. package/dist/hooks/popoverOverflow.cjs +2 -0
  259. package/dist/hooks/popoverOverflow.cjs.map +1 -0
  260. package/dist/hooks/popoverOverflow.d.ts +8 -0
  261. package/dist/hooks/popoverOverflow.js +9 -0
  262. package/dist/hooks/popoverOverflow.js.map +1 -0
  263. package/dist/hooks/useDialogPopover.cjs +2 -0
  264. package/dist/hooks/useDialogPopover.cjs.map +1 -0
  265. package/dist/hooks/useDialogPopover.d.ts +23 -0
  266. package/dist/hooks/useDialogPopover.js +48 -0
  267. package/dist/hooks/useDialogPopover.js.map +1 -0
  268. package/dist/hooks/useMenuPopover.cjs +1 -1
  269. package/dist/hooks/useMenuPopover.cjs.map +1 -1
  270. package/dist/hooks/useMenuPopover.d.ts +0 -8
  271. package/dist/hooks/useMenuPopover.js +17 -22
  272. package/dist/hooks/useMenuPopover.js.map +1 -1
  273. package/dist/hooks/useSavedQueries.cjs +1 -1
  274. package/dist/hooks/useSavedQueries.cjs.map +1 -1
  275. package/dist/hooks/useSavedQueries.js +29 -28
  276. package/dist/hooks/useSavedQueries.js.map +1 -1
  277. package/dist/index.d.ts +1 -1
  278. package/dist/layouts/shell/AegisShell.cjs +1 -1
  279. package/dist/layouts/shell/AegisShell.cjs.map +1 -1
  280. package/dist/layouts/shell/AegisShell.js +41 -41
  281. package/dist/layouts/shell/AegisShell.js.map +1 -1
  282. package/dist/layouts/shell/AppSwitcher.cjs +1 -1
  283. package/dist/layouts/shell/AppSwitcher.cjs.map +1 -1
  284. package/dist/layouts/shell/AppSwitcher.js +53 -36
  285. package/dist/layouts/shell/AppSwitcher.js.map +1 -1
  286. package/dist/layouts/shell/AuthRequiredCard.cjs +1 -1
  287. package/dist/layouts/shell/AuthRequiredCard.cjs.map +1 -1
  288. package/dist/layouts/shell/AuthRequiredCard.js +24 -22
  289. package/dist/layouts/shell/AuthRequiredCard.js.map +1 -1
  290. package/dist/layouts/shell/RouteErrorBoundary.cjs +1 -1
  291. package/dist/layouts/shell/RouteErrorBoundary.cjs.map +1 -1
  292. package/dist/layouts/shell/RouteErrorBoundary.d.ts +4 -1
  293. package/dist/layouts/shell/RouteErrorBoundary.js +15 -10
  294. package/dist/layouts/shell/RouteErrorBoundary.js.map +1 -1
  295. package/dist/layouts/shell/ShellInboxPage.cjs +1 -1
  296. package/dist/layouts/shell/ShellInboxPage.cjs.map +1 -1
  297. package/dist/layouts/shell/ShellInboxPage.js +17 -16
  298. package/dist/layouts/shell/ShellInboxPage.js.map +1 -1
  299. package/dist/layouts/shell/ShellNotificationBell.cjs +1 -1
  300. package/dist/layouts/shell/ShellNotificationBell.cjs.map +1 -1
  301. package/dist/layouts/shell/ShellNotificationBell.js +20 -14
  302. package/dist/layouts/shell/ShellNotificationBell.js.map +1 -1
  303. package/dist/layouts/shell/TopHeader.cjs +1 -1
  304. package/dist/layouts/shell/TopHeader.cjs.map +1 -1
  305. package/dist/layouts/shell/TopHeader.js +74 -74
  306. package/dist/layouts/shell/TopHeader.js.map +1 -1
  307. package/dist/layouts/shell/useShellUser.cjs +1 -1
  308. package/dist/layouts/shell/useShellUser.cjs.map +1 -1
  309. package/dist/layouts/shell/useShellUser.js +15 -13
  310. package/dist/layouts/shell/useShellUser.js.map +1 -1
  311. package/dist/lib/chart.cjs +1 -1
  312. package/dist/lib/chart.cjs.map +1 -1
  313. package/dist/lib/chart.d.ts +5 -7
  314. package/dist/lib/chart.js +49 -34
  315. package/dist/lib/chart.js.map +1 -1
  316. package/dist/lib/timeRange.cjs +1 -1
  317. package/dist/lib/timeRange.cjs.map +1 -1
  318. package/dist/lib/timeRange.d.ts +14 -4
  319. package/dist/lib/timeRange.js +41 -40
  320. package/dist/lib/timeRange.js.map +1 -1
  321. package/dist/locale/strings.cjs +1 -1
  322. package/dist/locale/strings.cjs.map +1 -1
  323. package/dist/locale/strings.d.ts +241 -2
  324. package/dist/locale/strings.js +543 -26
  325. package/dist/locale/strings.js.map +1 -1
  326. package/dist/notifications/notificationContext.cjs.map +1 -1
  327. package/dist/notifications/notificationContext.d.ts +12 -2
  328. package/dist/notifications/notificationContext.js.map +1 -1
  329. package/dist/style.css +1 -1
  330. package/dist/theme/antdTheme.cjs +1 -1
  331. package/dist/theme/antdTheme.cjs.map +1 -1
  332. package/dist/theme/antdTheme.js +2 -0
  333. package/dist/theme/antdTheme.js.map +1 -1
  334. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"LoginForm.js","sources":["../../../src/components/ui/LoginForm.tsx"],"sourcesContent":["import { type FormEvent, type ReactElement, useState } from 'react';\n\nimport { Alert } from './Alert';\nimport { Button } from './Button';\nimport { Checkbox } from './Checkbox';\nimport './LoginForm.css';\nimport { PasswordField } from './PasswordField';\nimport { TextField } from './TextField';\nimport { EMAIL_REQUIRED } from './authValidation';\n\ninterface LoginFormValues {\n email: string;\n password: string;\n remember: boolean;\n}\n\ninterface LoginFormProps {\n /** Called only once both fields are filled; `email` arrives trimmed. */\n onSubmit?: (values: LoginFormValues) => void | Promise<void>;\n submitting?: boolean;\n error?: string;\n onForgotPassword?: () => void;\n showRememberMe?: boolean;\n // When set, a filled-in form submits natively to this URL so the\n // browser's password manager can detect the credential submission.\n // onSubmit is still invoked (without preventDefault) for caller-side\n // bookkeeping.\n action?: string;\n method?: 'GET' | 'POST';\n // Extra hidden inputs co-submitted with username/password — e.g. PKCE\n // params for an SSO authorization endpoint.\n hiddenFields?: Record<string, string>;\n}\n\nexport function LoginForm({\n onSubmit,\n submitting = false,\n error,\n onForgotPassword,\n showRememberMe = true,\n action,\n method = 'POST',\n hiddenFields,\n}: LoginFormProps): ReactElement {\n const [email, setEmail] = useState('');\n const [password, setPassword] = useState('');\n const [remember, setRemember] = useState(false);\n const [submitted, setSubmitted] = useState(false);\n\n const trimmedEmail = email.trim();\n const errors = {\n email: trimmedEmail === '' ? EMAIL_REQUIRED : undefined,\n password: password === '' ? 'Enter your password.' : undefined,\n };\n\n const handleSubmit = (e: FormEvent<HTMLFormElement>): void => {\n setSubmitted(true);\n if (errors.email ?? errors.password) {\n e.preventDefault();\n return;\n }\n if (!action) {\n e.preventDefault();\n }\n void onSubmit?.({ email: trimmedEmail, password, remember });\n };\n\n return (\n <form\n className=\"aegis-loginform\"\n onSubmit={handleSubmit}\n action={action}\n method={action ? method : undefined}\n noValidate\n >\n {error && <Alert tone=\"error\">{error}</Alert>}\n {hiddenFields &&\n Object.entries(hiddenFields).map(([k, v]) => (\n <input key={k} type=\"hidden\" name={k} value={v} />\n ))}\n {/* readOnly (not disabled) while submitting: disabled inputs are excluded\n from native form submission per the HTML spec, which breaks the\n action-URL path (SSO/PKCE) since React flushes setSubmitting(true)\n synchronously inside the submit handler — the browser would then\n serialize the form with username/password missing. */}\n <TextField\n label=\"Email\"\n type=\"email\"\n name=\"username\"\n autoComplete=\"username\"\n placeholder=\"you@example.com\"\n value={email}\n onChange={(e) => setEmail(e.target.value)}\n readOnly={submitting}\n required\n error={submitted ? errors.email : undefined}\n />\n <PasswordField\n label=\"Password\"\n name=\"password\"\n autoComplete=\"current-password\"\n placeholder=\"••••••••\"\n value={password}\n onChange={(e) => setPassword(e.target.value)}\n readOnly={submitting}\n required\n error={submitted ? errors.password : undefined}\n />\n {(showRememberMe || onForgotPassword) && (\n <div className=\"aegis-loginform__row\">\n {showRememberMe ? (\n <Checkbox\n checked={remember}\n onChange={setRemember}\n disabled={submitting}\n label=\"Remember me\"\n />\n ) : (\n <span />\n )}\n {onForgotPassword && (\n <button\n type=\"button\"\n className=\"aegis-loginform__forgot\"\n onClick={onForgotPassword}\n disabled={submitting}\n >\n Forgot password?\n </button>\n )}\n </div>\n )}\n <Button\n tone=\"primary\"\n type=\"submit\"\n className=\"aegis-loginform__submit\"\n disabled={submitting}\n >\n {submitting ? 'Signing in…' : 'Sign in'}\n </Button>\n </form>\n );\n}\n"],"names":["LoginForm","onSubmit","submitting","error","onForgotPassword","showRememberMe","action","method","hiddenFields","email","setEmail","useState","password","setPassword","remember","setRemember","submitted","setSubmitted","trimmedEmail","errors","EMAIL_REQUIRED","jsxs","jsx","Alert","k","v","TextField","PasswordField","Checkbox","Button"],"mappings":";;;;;;;;;AAkCO,SAASA,EAAU;AAAA,EACxB,UAAAC;AAAA,EACA,YAAAC,IAAa;AAAA,EACb,OAAAC;AAAA,EACA,kBAAAC;AAAA,EACA,gBAAAC,IAAiB;AAAA,EACjB,QAAAC;AAAA,EACA,QAAAC,IAAS;AAAA,EACT,cAAAC;AACF,GAAiC;AAC/B,QAAM,CAACC,GAAOC,CAAQ,IAAIC,EAAS,EAAE,GAC/B,CAACC,GAAUC,CAAW,IAAIF,EAAS,EAAE,GACrC,CAACG,GAAUC,CAAW,IAAIJ,EAAS,EAAK,GACxC,CAACK,GAAWC,CAAY,IAAIN,EAAS,EAAK,GAE1CO,IAAeT,EAAM,KAAA,GACrBU,IAAS;AAAA,IACb,OAAOD,MAAiB,KAAKE,IAAiB;AAAA,IAC9C,UAAUR,MAAa,KAAK,yBAAyB;AAAA,EAAA;AAevD,SACE,gBAAAS;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAU;AAAA,MACV,UAfiB,CAAC,MAAwC;AAE5D,YADAJ,EAAa,EAAI,GACbE,EAAO,SAASA,EAAO,UAAU;AACnC,YAAE,eAAA;AACF;AAAA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UAAA,sBAGP,QAAA,EAAK;AAAA,UAEPE,KACC,gBAAAkB;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,MAAK;AAAA,cACL,WAAU;AAAA,cACV,SAASlB;AAAA,cACT,UAAUF;AAAA,cACX,UAAA;AAAA,YAAA;AAAA,UAAA;AAAA,QAED,GAEJ;AAAA,QAEF,gBAAAoB;AAAA,UAACO;AAAA,UAAA;AAAA,YACC,MAAK;AAAA,YACL,MAAK;AAAA,YACL,WAAU;AAAA,YACV,UAAU3B;AAAA,YAET,cAAa,gBAAgB;AAAA,UAAA;AAAA,QAAA;AAAA,MAChC;AAAA,IAAA;AAAA,EAAA;AAGN;"}
1
+ {"version":3,"file":"LoginForm.js","sources":["../../../src/components/ui/LoginForm.tsx"],"sourcesContent":["import { type FormEvent, type ReactElement, useState } from 'react';\n\nimport { useStrings } from '../../locale';\nimport { Alert } from './Alert';\nimport { Button } from './Button';\nimport { Checkbox } from './Checkbox';\nimport './LoginForm.css';\nimport { PasswordField } from './PasswordField';\nimport { TextField } from './TextField';\n\ninterface LoginFormValues {\n email: string;\n password: string;\n remember: boolean;\n}\n\ninterface LoginFormProps {\n /** Called only once both fields are filled; `email` arrives trimmed. */\n onSubmit?: (values: LoginFormValues) => void | Promise<void>;\n submitting?: boolean;\n error?: string;\n onForgotPassword?: () => void;\n showRememberMe?: boolean;\n // When set, a filled-in form submits natively to this URL so the\n // browser's password manager can detect the credential submission.\n // onSubmit is still invoked (without preventDefault) for caller-side\n // bookkeeping.\n action?: string;\n method?: 'GET' | 'POST';\n // Extra hidden inputs co-submitted with username/password — e.g. PKCE\n // params for an SSO authorization endpoint.\n hiddenFields?: Record<string, string>;\n}\n\nexport function LoginForm({\n onSubmit,\n submitting = false,\n error,\n onForgotPassword,\n showRememberMe = true,\n action,\n method = 'POST',\n hiddenFields,\n}: LoginFormProps): ReactElement {\n const strings = useStrings();\n const [email, setEmail] = useState('');\n const [password, setPassword] = useState('');\n const [remember, setRemember] = useState(false);\n const [submitted, setSubmitted] = useState(false);\n\n const trimmedEmail = email.trim();\n const errors = {\n email: trimmedEmail === '' ? strings.authEmailRequired : undefined,\n password: password === '' ? strings.authPasswordRequired : undefined,\n };\n\n const handleSubmit = (e: FormEvent<HTMLFormElement>): void => {\n setSubmitted(true);\n if (errors.email ?? errors.password) {\n e.preventDefault();\n return;\n }\n if (!action) {\n e.preventDefault();\n }\n void onSubmit?.({ email: trimmedEmail, password, remember });\n };\n\n return (\n <form\n className=\"aegis-loginform\"\n onSubmit={handleSubmit}\n action={action}\n method={action ? method : undefined}\n noValidate\n >\n {error && <Alert tone=\"error\">{error}</Alert>}\n {hiddenFields &&\n Object.entries(hiddenFields).map(([k, v]) => (\n <input key={k} type=\"hidden\" name={k} value={v} />\n ))}\n {/* readOnly (not disabled) while submitting: disabled inputs are excluded\n from native form submission per the HTML spec, which breaks the\n action-URL path (SSO/PKCE) since React flushes setSubmitting(true)\n synchronously inside the submit handler — the browser would then\n serialize the form with username/password missing. */}\n <TextField\n label={strings.authEmail}\n type=\"email\"\n name=\"username\"\n autoComplete=\"username\"\n placeholder=\"you@example.com\"\n value={email}\n onChange={(e) => setEmail(e.target.value)}\n readOnly={submitting}\n required\n error={submitted ? errors.email : undefined}\n />\n <PasswordField\n label={strings.authPassword}\n name=\"password\"\n autoComplete=\"current-password\"\n placeholder=\"••••••••\"\n value={password}\n onChange={(e) => setPassword(e.target.value)}\n readOnly={submitting}\n required\n error={submitted ? errors.password : undefined}\n />\n {(showRememberMe || onForgotPassword) && (\n <div className=\"aegis-loginform__row\">\n {showRememberMe ? (\n <Checkbox\n checked={remember}\n onChange={setRemember}\n disabled={submitting}\n label={strings.authRememberMe}\n />\n ) : (\n <span />\n )}\n {onForgotPassword && (\n <button\n type=\"button\"\n className=\"aegis-loginform__forgot\"\n onClick={onForgotPassword}\n disabled={submitting}\n >\n {strings.authForgotPassword}\n </button>\n )}\n </div>\n )}\n <Button\n tone=\"primary\"\n type=\"submit\"\n className=\"aegis-loginform__submit\"\n disabled={submitting}\n >\n {submitting ? strings.authSigningIn : strings.signIn}\n </Button>\n </form>\n );\n}\n"],"names":["LoginForm","onSubmit","submitting","error","onForgotPassword","showRememberMe","action","method","hiddenFields","strings","useStrings","email","setEmail","useState","password","setPassword","remember","setRemember","submitted","setSubmitted","trimmedEmail","errors","jsxs","jsx","Alert","k","v","TextField","PasswordField","Checkbox","Button"],"mappings":";;;;;;;;;AAkCO,SAASA,EAAU;AAAA,EACxB,UAAAC;AAAA,EACA,YAAAC,IAAa;AAAA,EACb,OAAAC;AAAA,EACA,kBAAAC;AAAA,EACA,gBAAAC,IAAiB;AAAA,EACjB,QAAAC;AAAA,EACA,QAAAC,IAAS;AAAA,EACT,cAAAC;AACF,GAAiC;AAC/B,QAAMC,IAAUC,EAAA,GACV,CAACC,GAAOC,CAAQ,IAAIC,EAAS,EAAE,GAC/B,CAACC,GAAUC,CAAW,IAAIF,EAAS,EAAE,GACrC,CAACG,GAAUC,CAAW,IAAIJ,EAAS,EAAK,GACxC,CAACK,GAAWC,CAAY,IAAIN,EAAS,EAAK,GAE1CO,IAAeT,EAAM,KAAA,GACrBU,IAAS;AAAA,IACb,OAAOD,MAAiB,KAAKX,EAAQ,oBAAoB;AAAA,IACzD,UAAUK,MAAa,KAAKL,EAAQ,uBAAuB;AAAA,EAAA;AAe7D,SACE,gBAAAa;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAU;AAAA,MACV,UAfiB,CAAC,MAAwC;AAE5D,YADAH,EAAa,EAAI,GACbE,EAAO,SAASA,EAAO,UAAU;AACnC,YAAE,eAAA;AACF;AAAA,QACF;AACA,QAAKf,KACH,EAAE,eAAA,GAECL,IAAW,EAAE,OAAOmB,GAAc,UAAAN,GAAU,UAAAE,GAAU;AAAA,MAC7D;AAAA,MAMI,QAAAV;AAAA,MACA,QAAQA,IAASC,IAAS;AAAA,MAC1B,YAAU;AAAA,MAET,UAAA;AAAA,QAAAJ,KAAS,gBAAAoB,EAACC,GAAA,EAAM,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J;AAAA,QAEF,gBAAAc;AAAA,UAACO;AAAA,UAAA;AAAA,YACC,MAAK;AAAA,YACL,MAAK;AAAA,YACL,WAAU;AAAA,YACV,UAAU5B;AAAA,YAET,UAAAA,IAAaO,EAAQ,gBAAgBA,EAAQ;AAAA,UAAA;AAAA,QAAA;AAAA,MAChD;AAAA,IAAA;AAAA,EAAA;AAGN;"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("react/jsx-runtime"),d=require("react"),v=require("../../agent/core/usePrimitiveSurface.cjs");;/* empty css */function j({children:e,size:a="base",weight:i="medium",tone:o="default",inverted:n=!1,wrap:r=!1,as:t="span",className:u,style:l,surface:c}){const s=d.useRef(null),m=v.usePrimitiveSurface(c,e,"value",s),f=["aegis-mono",`aegis-mono--${a}`,`aegis-mono--${i}`,o==="default"?"":`aegis-mono--${o}`,n?"aegis-mono--inverted":"",r?"aegis-mono--wrap":"",u??""].filter(Boolean).join(" ");return g.jsx(t,{ref:s,className:f,style:l,...m,children:e})}exports.MonoValue=j;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const S=require("react/jsx-runtime"),p=require("react"),y=require("../../agent/core/usePrimitiveSurface.cjs");;/* empty css */function b({children:e,size:i="base",weight:r="medium",tone:o="default",inverted:u=!1,wrap:t=!1,as:l="span",className:g,style:s,surface:m}){const n=p.useRef(null),f=y.usePrimitiveSurface(m,e,"value",n),c=["aegis-mono",`aegis-mono--${i}`,`aegis-mono--${r}`,o==="default"?"":`aegis-mono--${o}`,u?"aegis-mono--inverted":"",t?"aegis-mono--wrap":"",g??""].filter(Boolean).join(" "),a=typeof e=="string"||typeof e=="number"?String(e).length:void 0,v=t&&a!==void 0?{"--aegis-mono-length":a,...s}:s;return S.jsx(l,{ref:n,className:c,style:v,...f,children:e})}exports.MonoValue=b;
2
2
  //# sourceMappingURL=MonoValue.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"MonoValue.cjs","sources":["../../../src/components/ui/MonoValue.tsx"],"sourcesContent":["import { type CSSProperties, type ReactNode, useRef } from 'react';\n\nimport {\n type PrimitiveSurface,\n usePrimitiveSurface,\n} from '../../agent/core/usePrimitiveSurface';\nimport './MonoValue.css';\n\nexport type MonoValueSurface = PrimitiveSurface<ReactNode>;\n\ninterface MonoValueProps {\n children: ReactNode;\n size?: 'sm' | 'base' | 'lg';\n weight?: 'regular' | 'medium';\n /** Ink colour. `danger` is the anomaly red — failures only. */\n tone?: 'default' | 'success' | 'danger' | 'muted';\n inverted?: boolean;\n /** Break the value at any character, so a long id such as a digest fits a narrow column. */\n wrap?: boolean;\n as?: 'span' | 'div';\n className?: string;\n style?: CSSProperties;\n surface?: MonoValueSurface;\n}\n\n/**\n * An id, a path or a piece of code in the mono face. Numbers, durations and\n * times are not set in it: they take the numeric face (`--font-numeric`) with\n * tabular figures.\n */\nexport function MonoValue({\n children,\n size = 'base',\n weight = 'medium',\n tone = 'default',\n inverted = false,\n wrap = false,\n as: Tag = 'span',\n className,\n style,\n surface,\n}: MonoValueProps) {\n const wrapRef = useRef<HTMLDivElement | null>(null);\n const agentAttrs = usePrimitiveSurface(surface, children, 'value', wrapRef);\n const cls = [\n 'aegis-mono',\n `aegis-mono--${size}`,\n `aegis-mono--${weight}`,\n tone === 'default' ? '' : `aegis-mono--${tone}`,\n inverted ? 'aegis-mono--inverted' : '',\n wrap ? 'aegis-mono--wrap' : '',\n className ?? '',\n ]\n .filter(Boolean)\n .join(' ');\n return (\n <Tag ref={wrapRef} className={cls} style={style} {...agentAttrs}>\n {children}\n </Tag>\n );\n}\n"],"names":["MonoValue","children","size","weight","tone","inverted","wrap","Tag","className","style","surface","wrapRef","useRef","agentAttrs","usePrimitiveSurface","cls","jsx"],"mappings":"6NA8BO,SAASA,EAAU,CACxB,SAAAC,EACA,KAAAC,EAAO,OACP,OAAAC,EAAS,SACT,KAAAC,EAAO,UACP,SAAAC,EAAW,GACX,KAAAC,EAAO,GACP,GAAIC,EAAM,OACV,UAAAC,EACA,MAAAC,EACA,QAAAC,CACF,EAAmB,CACjB,MAAMC,EAAUC,EAAAA,OAA8B,IAAI,EAC5CC,EAAaC,EAAAA,oBAAoBJ,EAAST,EAAU,QAASU,CAAO,EACpEI,EAAM,CACV,aACA,eAAeb,CAAI,GACnB,eAAeC,CAAM,GACrBC,IAAS,UAAY,GAAK,eAAeA,CAAI,GAC7CC,EAAW,uBAAyB,GACpCC,EAAO,mBAAqB,GAC5BE,GAAa,EAAA,EAEZ,OAAO,OAAO,EACd,KAAK,GAAG,EACX,OACEQ,MAACT,GAAI,IAAKI,EAAS,UAAWI,EAAK,MAAAN,EAAe,GAAGI,EAClD,SAAAZ,CAAA,CACH,CAEJ"}
1
+ {"version":3,"file":"MonoValue.cjs","sources":["../../../src/components/ui/MonoValue.tsx"],"sourcesContent":["import { type CSSProperties, type ReactNode, useRef } from 'react';\n\nimport {\n type PrimitiveSurface,\n usePrimitiveSurface,\n} from '../../agent/core/usePrimitiveSurface';\nimport './MonoValue.css';\n\nexport type MonoValueSurface = PrimitiveSurface<ReactNode>;\n\ninterface MonoValueProps {\n children: ReactNode;\n size?: 'sm' | 'base' | 'lg';\n weight?: 'regular' | 'medium';\n /** Ink colour. `danger` is the anomaly red — failures only. */\n tone?: 'default' | 'success' | 'danger' | 'muted';\n inverted?: boolean;\n /**\n * Break a long value at any character, so an id such as a digest fits a\n * narrow column. A text or number value is never broken narrower than\n * itself or 16 characters, whichever is less, so `null` and `1` stay whole.\n */\n wrap?: boolean;\n as?: 'span' | 'div';\n className?: string;\n style?: CSSProperties;\n surface?: MonoValueSurface;\n}\n\n/**\n * An id, a path or a piece of code in the mono face. Numbers, durations and\n * times are not set in it: they take the numeric face (`--font-numeric`) with\n * tabular figures.\n */\nexport function MonoValue({\n children,\n size = 'base',\n weight = 'medium',\n tone = 'default',\n inverted = false,\n wrap = false,\n as: Tag = 'span',\n className,\n style,\n surface,\n}: MonoValueProps) {\n const wrapRef = useRef<HTMLDivElement | null>(null);\n const agentAttrs = usePrimitiveSurface(surface, children, 'value', wrapRef);\n const cls = [\n 'aegis-mono',\n `aegis-mono--${size}`,\n `aegis-mono--${weight}`,\n tone === 'default' ? '' : `aegis-mono--${tone}`,\n inverted ? 'aegis-mono--inverted' : '',\n wrap ? 'aegis-mono--wrap' : '',\n className ?? '',\n ]\n .filter(Boolean)\n .join(' ');\n const length =\n typeof children === 'string' || typeof children === 'number'\n ? String(children).length\n : undefined;\n const lengthStyle =\n wrap && length !== undefined\n ? ({ '--aegis-mono-length': length, ...style } as CSSProperties)\n : style;\n return (\n <Tag ref={wrapRef} className={cls} style={lengthStyle} {...agentAttrs}>\n {children}\n </Tag>\n );\n}\n"],"names":["MonoValue","children","size","weight","tone","inverted","wrap","Tag","className","style","surface","wrapRef","useRef","agentAttrs","usePrimitiveSurface","cls","length","lengthStyle","jsx"],"mappings":"6NAkCO,SAASA,EAAU,CACxB,SAAAC,EACA,KAAAC,EAAO,OACP,OAAAC,EAAS,SACT,KAAAC,EAAO,UACP,SAAAC,EAAW,GACX,KAAAC,EAAO,GACP,GAAIC,EAAM,OACV,UAAAC,EACA,MAAAC,EACA,QAAAC,CACF,EAAmB,CACjB,MAAMC,EAAUC,EAAAA,OAA8B,IAAI,EAC5CC,EAAaC,EAAAA,oBAAoBJ,EAAST,EAAU,QAASU,CAAO,EACpEI,EAAM,CACV,aACA,eAAeb,CAAI,GACnB,eAAeC,CAAM,GACrBC,IAAS,UAAY,GAAK,eAAeA,CAAI,GAC7CC,EAAW,uBAAyB,GACpCC,EAAO,mBAAqB,GAC5BE,GAAa,EAAA,EAEZ,OAAO,OAAO,EACd,KAAK,GAAG,EACLQ,EACJ,OAAOf,GAAa,UAAY,OAAOA,GAAa,SAChD,OAAOA,CAAQ,EAAE,OACjB,OACAgB,EACJX,GAAQU,IAAW,OACd,CAAE,sBAAuBA,EAAQ,GAAGP,CAAA,EACrCA,EACN,OACES,MAACX,EAAA,CAAI,IAAKI,EAAS,UAAWI,EAAK,MAAOE,EAAc,GAAGJ,EACxD,SAAAZ,CAAA,CACH,CAEJ"}
@@ -8,7 +8,11 @@ interface MonoValueProps {
8
8
  /** Ink colour. `danger` is the anomaly red — failures only. */
9
9
  tone?: 'default' | 'success' | 'danger' | 'muted';
10
10
  inverted?: boolean;
11
- /** Break the value at any character, so a long id such as a digest fits a narrow column. */
11
+ /**
12
+ * Break a long value at any character, so an id such as a digest fits a
13
+ * narrow column. A text or number value is never broken narrower than
14
+ * itself or 16 characters, whichever is less, so `null` and `1` stay whole.
15
+ */
12
16
  wrap?: boolean;
13
17
  as?: 'span' | 'div';
14
18
  className?: string;
@@ -1,29 +1,29 @@
1
- import { jsx as g } from "react/jsx-runtime";
2
- import { useRef as c } from "react";
3
- import { usePrimitiveSurface as d } from "../../agent/core/usePrimitiveSurface.js";
1
+ import { jsx as v } from "react/jsx-runtime";
2
+ import { useRef as y } from "react";
3
+ import { usePrimitiveSurface as S } from "../../agent/core/usePrimitiveSurface.js";
4
4
  /* empty css */
5
5
  function x({
6
6
  children: o,
7
- size: s = "base",
8
- weight: i = "medium",
7
+ size: i = "base",
8
+ weight: m = "medium",
9
9
  tone: e = "default",
10
- inverted: m = !1,
11
- wrap: n = !1,
12
- as: r = "span",
13
- className: t,
14
- style: f,
10
+ inverted: r = !1,
11
+ wrap: t = !1,
12
+ as: f = "span",
13
+ className: g,
14
+ style: s,
15
15
  surface: l
16
16
  }) {
17
- const a = c(null), u = d(l, o, "value", a), p = [
17
+ const n = y(null), u = S(l, o, "value", n), p = [
18
18
  "aegis-mono",
19
- `aegis-mono--${s}`,
20
19
  `aegis-mono--${i}`,
20
+ `aegis-mono--${m}`,
21
21
  e === "default" ? "" : `aegis-mono--${e}`,
22
- m ? "aegis-mono--inverted" : "",
23
- n ? "aegis-mono--wrap" : "",
24
- t ?? ""
25
- ].filter(Boolean).join(" ");
26
- return /* @__PURE__ */ g(r, { ref: a, className: p, style: f, ...u, children: o });
22
+ r ? "aegis-mono--inverted" : "",
23
+ t ? "aegis-mono--wrap" : "",
24
+ g ?? ""
25
+ ].filter(Boolean).join(" "), a = typeof o == "string" || typeof o == "number" ? String(o).length : void 0, c = t && a !== void 0 ? { "--aegis-mono-length": a, ...s } : s;
26
+ return /* @__PURE__ */ v(f, { ref: n, className: p, style: c, ...u, children: o });
27
27
  }
28
28
  export {
29
29
  x as MonoValue
@@ -1 +1 @@
1
- {"version":3,"file":"MonoValue.js","sources":["../../../src/components/ui/MonoValue.tsx"],"sourcesContent":["import { type CSSProperties, type ReactNode, useRef } from 'react';\n\nimport {\n type PrimitiveSurface,\n usePrimitiveSurface,\n} from '../../agent/core/usePrimitiveSurface';\nimport './MonoValue.css';\n\nexport type MonoValueSurface = PrimitiveSurface<ReactNode>;\n\ninterface MonoValueProps {\n children: ReactNode;\n size?: 'sm' | 'base' | 'lg';\n weight?: 'regular' | 'medium';\n /** Ink colour. `danger` is the anomaly red — failures only. */\n tone?: 'default' | 'success' | 'danger' | 'muted';\n inverted?: boolean;\n /** Break the value at any character, so a long id such as a digest fits a narrow column. */\n wrap?: boolean;\n as?: 'span' | 'div';\n className?: string;\n style?: CSSProperties;\n surface?: MonoValueSurface;\n}\n\n/**\n * An id, a path or a piece of code in the mono face. Numbers, durations and\n * times are not set in it: they take the numeric face (`--font-numeric`) with\n * tabular figures.\n */\nexport function MonoValue({\n children,\n size = 'base',\n weight = 'medium',\n tone = 'default',\n inverted = false,\n wrap = false,\n as: Tag = 'span',\n className,\n style,\n surface,\n}: MonoValueProps) {\n const wrapRef = useRef<HTMLDivElement | null>(null);\n const agentAttrs = usePrimitiveSurface(surface, children, 'value', wrapRef);\n const cls = [\n 'aegis-mono',\n `aegis-mono--${size}`,\n `aegis-mono--${weight}`,\n tone === 'default' ? '' : `aegis-mono--${tone}`,\n inverted ? 'aegis-mono--inverted' : '',\n wrap ? 'aegis-mono--wrap' : '',\n className ?? '',\n ]\n .filter(Boolean)\n .join(' ');\n return (\n <Tag ref={wrapRef} className={cls} style={style} {...agentAttrs}>\n {children}\n </Tag>\n );\n}\n"],"names":["MonoValue","children","size","weight","tone","inverted","wrap","Tag","className","style","surface","wrapRef","useRef","agentAttrs","usePrimitiveSurface","cls","jsx"],"mappings":";;;;AA8BO,SAASA,EAAU;AAAA,EACxB,UAAAC;AAAA,EACA,MAAAC,IAAO;AAAA,EACP,QAAAC,IAAS;AAAA,EACT,MAAAC,IAAO;AAAA,EACP,UAAAC,IAAW;AAAA,EACX,MAAAC,IAAO;AAAA,EACP,IAAIC,IAAM;AAAA,EACV,WAAAC;AAAA,EACA,OAAAC;AAAA,EACA,SAAAC;AACF,GAAmB;AACjB,QAAMC,IAAUC,EAA8B,IAAI,GAC5CC,IAAaC,EAAoBJ,GAAST,GAAU,SAASU,CAAO,GACpEI,IAAM;AAAA,IACV;AAAA,IACA,eAAeb,CAAI;AAAA,IACnB,eAAeC,CAAM;AAAA,IACrBC,MAAS,YAAY,KAAK,eAAeA,CAAI;AAAA,IAC7CC,IAAW,yBAAyB;AAAA,IACpCC,IAAO,qBAAqB;AAAA,IAC5BE,KAAa;AAAA,EAAA,EAEZ,OAAO,OAAO,EACd,KAAK,GAAG;AACX,SACE,gBAAAQ,EAACT,KAAI,KAAKI,GAAS,WAAWI,GAAK,OAAAN,GAAe,GAAGI,GAClD,UAAAZ,EAAA,CACH;AAEJ;"}
1
+ {"version":3,"file":"MonoValue.js","sources":["../../../src/components/ui/MonoValue.tsx"],"sourcesContent":["import { type CSSProperties, type ReactNode, useRef } from 'react';\n\nimport {\n type PrimitiveSurface,\n usePrimitiveSurface,\n} from '../../agent/core/usePrimitiveSurface';\nimport './MonoValue.css';\n\nexport type MonoValueSurface = PrimitiveSurface<ReactNode>;\n\ninterface MonoValueProps {\n children: ReactNode;\n size?: 'sm' | 'base' | 'lg';\n weight?: 'regular' | 'medium';\n /** Ink colour. `danger` is the anomaly red — failures only. */\n tone?: 'default' | 'success' | 'danger' | 'muted';\n inverted?: boolean;\n /**\n * Break a long value at any character, so an id such as a digest fits a\n * narrow column. A text or number value is never broken narrower than\n * itself or 16 characters, whichever is less, so `null` and `1` stay whole.\n */\n wrap?: boolean;\n as?: 'span' | 'div';\n className?: string;\n style?: CSSProperties;\n surface?: MonoValueSurface;\n}\n\n/**\n * An id, a path or a piece of code in the mono face. Numbers, durations and\n * times are not set in it: they take the numeric face (`--font-numeric`) with\n * tabular figures.\n */\nexport function MonoValue({\n children,\n size = 'base',\n weight = 'medium',\n tone = 'default',\n inverted = false,\n wrap = false,\n as: Tag = 'span',\n className,\n style,\n surface,\n}: MonoValueProps) {\n const wrapRef = useRef<HTMLDivElement | null>(null);\n const agentAttrs = usePrimitiveSurface(surface, children, 'value', wrapRef);\n const cls = [\n 'aegis-mono',\n `aegis-mono--${size}`,\n `aegis-mono--${weight}`,\n tone === 'default' ? '' : `aegis-mono--${tone}`,\n inverted ? 'aegis-mono--inverted' : '',\n wrap ? 'aegis-mono--wrap' : '',\n className ?? '',\n ]\n .filter(Boolean)\n .join(' ');\n const length =\n typeof children === 'string' || typeof children === 'number'\n ? String(children).length\n : undefined;\n const lengthStyle =\n wrap && length !== undefined\n ? ({ '--aegis-mono-length': length, ...style } as CSSProperties)\n : style;\n return (\n <Tag ref={wrapRef} className={cls} style={lengthStyle} {...agentAttrs}>\n {children}\n </Tag>\n );\n}\n"],"names":["MonoValue","children","size","weight","tone","inverted","wrap","Tag","className","style","surface","wrapRef","useRef","agentAttrs","usePrimitiveSurface","cls","length","lengthStyle","jsx"],"mappings":";;;;AAkCO,SAASA,EAAU;AAAA,EACxB,UAAAC;AAAA,EACA,MAAAC,IAAO;AAAA,EACP,QAAAC,IAAS;AAAA,EACT,MAAAC,IAAO;AAAA,EACP,UAAAC,IAAW;AAAA,EACX,MAAAC,IAAO;AAAA,EACP,IAAIC,IAAM;AAAA,EACV,WAAAC;AAAA,EACA,OAAAC;AAAA,EACA,SAAAC;AACF,GAAmB;AACjB,QAAMC,IAAUC,EAA8B,IAAI,GAC5CC,IAAaC,EAAoBJ,GAAST,GAAU,SAASU,CAAO,GACpEI,IAAM;AAAA,IACV;AAAA,IACA,eAAeb,CAAI;AAAA,IACnB,eAAeC,CAAM;AAAA,IACrBC,MAAS,YAAY,KAAK,eAAeA,CAAI;AAAA,IAC7CC,IAAW,yBAAyB;AAAA,IACpCC,IAAO,qBAAqB;AAAA,IAC5BE,KAAa;AAAA,EAAA,EAEZ,OAAO,OAAO,EACd,KAAK,GAAG,GACLQ,IACJ,OAAOf,KAAa,YAAY,OAAOA,KAAa,WAChD,OAAOA,CAAQ,EAAE,SACjB,QACAgB,IACJX,KAAQU,MAAW,SACd,EAAE,uBAAuBA,GAAQ,GAAGP,EAAA,IACrCA;AACN,SACE,gBAAAS,EAACX,GAAA,EAAI,KAAKI,GAAS,WAAWI,GAAK,OAAOE,GAAc,GAAGJ,GACxD,UAAAZ,EAAA,CACH;AAEJ;"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),m=require("react"),h=require("@ant-design/icons"),N=require("antd"),j=require("../../agent/core/hooks.cjs");;/* empty css */const u=require("./linkComponent.cjs"),x=require("./relativeTime.cjs"),b=8,v=360;function y({items:t,unreadCount:s=t.filter(o=>!o.read).length,onOpen:c,inboxPath:r,linkComponent:p=u.DefaultLink,width:d=v,action:a}){const[o,n]=m.useState(!1),_=j.useAegisAction(a),l=t.slice(0,b),f=i=>{n(!1),c?.(i)},g=e.jsxs("div",{className:"aegis-notif-pop",style:{width:d},children:[e.jsxs("div",{className:"aegis-notif-pop__head",children:[e.jsx("span",{className:"aegis-notif-pop__title",children:"Notifications"}),s>0&&e.jsxs("span",{className:"aegis-notif-pop__count",children:[s," unread"]})]}),l.length===0?e.jsx("div",{className:"aegis-notif-pop__empty",children:"You're all caught up."}):e.jsx("ul",{className:"aegis-notif-pop__list",children:l.map(i=>e.jsx("li",{className:"aegis-notif-pop__item-wrap",children:e.jsxs("button",{type:"button",className:["aegis-notif-pop__item",i.read?"":"aegis-notif-pop__item--unread"].filter(Boolean).join(" "),onClick:()=>{f(i)},children:[e.jsx("span",{className:"aegis-notif-pop__dot","aria-hidden":"true","data-unread":!i.read}),e.jsxs("span",{className:"aegis-notif-pop__body",children:[e.jsxs("span",{className:"aegis-notif-pop__row",children:[e.jsx("span",{className:"aegis-notif-pop__item-title",children:i.title}),e.jsx("span",{className:"aegis-notif-pop__time",children:x.relativeTime(i.timestamp)})]}),i.body&&e.jsx("span",{className:"aegis-notif-pop__item-body",children:i.body})]})]})},i.id))}),e.jsx("div",{className:"aegis-notif-pop__foot",onClickCapture:()=>{n(!1)},children:e.jsx(p,{to:r,className:"aegis-notif-pop__view-all",children:"View all"})})]});return e.jsx(N.Popover,{content:g,trigger:"click",open:o,onOpenChange:n,placement:"bottomRight",arrow:!1,classNames:{root:"aegis-notif-pop__overlay"},children:e.jsxs("button",{type:"button",className:"aegis-notif-bell","aria-label":s>0?`Notifications: ${String(s)} unread`:"Notifications","data-agent-action-id":a?.id,onClick:a?()=>void _.invoke():void 0,children:[e.jsx(h.BellOutlined,{className:"aegis-notif-bell__icon"}),s>0&&e.jsx("span",{className:"aegis-notif-bell__badge","aria-hidden":"true",children:s>99?"99+":s})]})})}exports.NotificationBell=y;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),x=require("react"),f=require("@ant-design/icons"),C=require("antd"),S=require("../../agent/core/hooks.cjs"),w=require("../../hooks/popoverOverflow.cjs"),B=require("../../hooks/useDialogPopover.cjs"),j=require("./Button.cjs"),I=require("./ErrorState.cjs");;/* empty css */const P=require("./linkComponent.cjs"),F=require("./relativeTime.cjs"),A=require("../../locale/useStrings.cjs"),L=8,T=360;function D({items:d,unreadCount:o=d.filter(i=>!i.read).length,onOpen:N,inboxPath:b,linkComponent:v=P.DefaultLink,width:y=T,action:p,liveError:E,error:_,onRetry:r}){const i=A.useStrings(),a=B.useDialogPopover(),{open:g,focusPanel:u}=a,t=x.useId(),m=`${t}-stale`,q=S.useAegisAction(p),h=d.slice(0,L),n=d.length===0?_??null:null,l=n?null:E??_??null;let c=null;n?c=i.notificationsLoadFailedNote(n.message):l&&(c=i.notificationsStaleNote(l.message)),x.useEffect(()=>{g&&document.activeElement===document.body&&u()},[n,l,g,u]);const k=s=>{a.close(),N?.(s)},O=e.jsxs("div",{ref:a.panelRef,id:t,className:"aegis-notif-pop",style:{width:y},role:"dialog","aria-labelledby":`${t}-title`,tabIndex:-1,children:[e.jsxs("div",{className:"aegis-notif-pop__head",children:[e.jsx("span",{id:`${t}-title`,className:"aegis-notif-pop__title",children:i.notifications}),o>0&&e.jsx("span",{className:"aegis-notif-pop__count",children:i.unreadCount(o)})]}),l&&e.jsxs("div",{className:"aegis-notif-pop__stale",children:[e.jsx(f.ExclamationCircleFilled,{className:"aegis-notif-pop__stale-icon","aria-hidden":!0}),e.jsxs("div",{className:"aegis-notif-pop__stale-body",children:[e.jsxs("span",{children:[e.jsx("span",{className:"aegis-notif-pop__stale-title",children:i.notificationsStale})," ",l.message]}),r&&e.jsx(j.Button,{tone:"secondary",onClick:r,children:i.retry})]})]}),n?e.jsx(I.ErrorState,{size:"compact",title:i.notificationsLoadFailed,description:n.message,action:r&&e.jsx(j.Button,{tone:"secondary",onClick:r,children:i.retry})}):h.length===0?e.jsx("div",{className:"aegis-notif-pop__empty",children:i.notificationsCaughtUp}):e.jsx("ul",{className:"aegis-notif-pop__list",children:h.map(s=>e.jsx("li",{className:"aegis-notif-pop__item-wrap",children:e.jsxs("button",{type:"button",className:["aegis-notif-pop__item",s.read?"":"aegis-notif-pop__item--unread"].filter(Boolean).join(" "),onClick:()=>{k(s)},children:[e.jsx("span",{className:"aegis-notif-pop__dot","aria-hidden":"true","data-unread":!s.read}),e.jsxs("span",{className:"aegis-notif-pop__body",children:[e.jsxs("span",{className:"aegis-notif-pop__row",children:[e.jsx("span",{className:"aegis-notif-pop__item-title",children:s.title}),e.jsx("span",{className:"aegis-notif-pop__time",children:F.relativeTime(s.timestamp,i)})]}),s.body&&e.jsx("span",{className:"aegis-notif-pop__item-body",children:s.body})]})]})},s.id))}),e.jsx("div",{className:"aegis-notif-pop__foot",onClickCapture:a.close,children:e.jsx(v,{to:b,className:"aegis-notif-pop__view-all",children:i.viewAll})})]});return e.jsx(C.Popover,{content:O,trigger:"click",open:a.open,onOpenChange:a.setOpen,placement:"bottomRight",autoAdjustOverflow:w.POPOVER_OVERFLOW,arrow:!1,classNames:{root:"aegis-notif-pop__overlay"},children:e.jsx("span",{className:"aegis-notif-bell__anchor",children:e.jsxs("button",{ref:a.triggerRef,type:"button",className:"aegis-notif-bell","aria-describedby":c?m:void 0,"aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.open?t:void 0,"aria-label":i.notificationBellLabel(o),"data-agent-action-id":p?.id,onClick:p?()=>void q.invoke():void 0,children:[e.jsx(f.BellOutlined,{className:"aegis-notif-bell__icon"}),o>0&&e.jsx("span",{className:"aegis-notif-bell__badge","aria-hidden":"true",children:o>99?"99+":o}),c&&e.jsxs(e.Fragment,{children:[e.jsx(f.ExclamationCircleFilled,{className:"aegis-notif-bell__stale","aria-hidden":!0}),e.jsx("span",{id:m,className:"aegis-notif-bell__description",children:c})]})]})})})}exports.NotificationBell=D;
2
2
  //# sourceMappingURL=NotificationBell.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"NotificationBell.cjs","sources":["../../../src/components/ui/NotificationBell.tsx"],"sourcesContent":["import { type ReactElement, useState } from 'react';\n\nimport { BellOutlined } from '@ant-design/icons';\nimport { Popover } from 'antd';\n\nimport { useAegisAction } from '../../agent/core/hooks';\nimport type { AegisAction } from '../../agent/core/types';\nimport type { AegisNotification } from '../../notifications';\nimport './NotificationBell.css';\nimport { DefaultLink, type LinkComponent } from './linkComponent';\nimport { relativeTime } from './relativeTime';\n\nexport interface NotificationBellProps {\n /** Newest first; the popover previews the first few. */\n items: AegisNotification[];\n /** Shown on the badge. Defaults to the number of unread `items`. */\n unreadCount?: number;\n /**\n * Fired when the user opens an item; the popover closes first. The host\n * marks it read and navigates to `item.to`.\n */\n onOpen?: (item: AegisNotification) => void;\n /** Path to the full inbox page, e.g. '/inbox'. */\n inboxPath: string;\n /** Renders the \"View all\" link. Defaults to an `<a href>`. */\n linkComponent?: LinkComponent;\n /** Override popover width in px. Defaults to 360. */\n width?: number;\n /** Optional aegis-ui agent action — fired when the bell is clicked. */\n action?: AegisAction<void, unknown>;\n}\n\nconst MAX_PREVIEW_ITEMS = 8;\nconst DEFAULT_WIDTH = 360;\n\nexport function NotificationBell({\n items,\n unreadCount = items.filter((n) => !n.read).length,\n onOpen,\n inboxPath,\n linkComponent: LinkImpl = DefaultLink,\n width = DEFAULT_WIDTH,\n action,\n}: NotificationBellProps): ReactElement {\n const [open, setOpen] = useState(false);\n const bound = useAegisAction<void, unknown>(action);\n\n const preview = items.slice(0, MAX_PREVIEW_ITEMS);\n\n const handleItemClick = (item: AegisNotification): void => {\n setOpen(false);\n onOpen?.(item);\n };\n\n const content = (\n <div className=\"aegis-notif-pop\" style={{ width }}>\n <div className=\"aegis-notif-pop__head\">\n <span className=\"aegis-notif-pop__title\">Notifications</span>\n {unreadCount > 0 && (\n <span className=\"aegis-notif-pop__count\">{unreadCount} unread</span>\n )}\n </div>\n {preview.length === 0 ? (\n <div className=\"aegis-notif-pop__empty\">You&apos;re all caught up.</div>\n ) : (\n <ul className=\"aegis-notif-pop__list\">\n {preview.map((item) => (\n <li key={item.id} className=\"aegis-notif-pop__item-wrap\">\n <button\n type=\"button\"\n className={[\n 'aegis-notif-pop__item',\n item.read ? '' : 'aegis-notif-pop__item--unread',\n ]\n .filter(Boolean)\n .join(' ')}\n onClick={() => {\n handleItemClick(item);\n }}\n >\n <span\n className=\"aegis-notif-pop__dot\"\n aria-hidden=\"true\"\n data-unread={!item.read}\n />\n <span className=\"aegis-notif-pop__body\">\n <span className=\"aegis-notif-pop__row\">\n <span className=\"aegis-notif-pop__item-title\">\n {item.title}\n </span>\n <span className=\"aegis-notif-pop__time\">\n {relativeTime(item.timestamp)}\n </span>\n </span>\n {item.body && (\n <span className=\"aegis-notif-pop__item-body\">\n {item.body}\n </span>\n )}\n </span>\n </button>\n </li>\n ))}\n </ul>\n )}\n {/* Following the link closes the popover. */}\n <div\n className=\"aegis-notif-pop__foot\"\n onClickCapture={() => {\n setOpen(false);\n }}\n >\n <LinkImpl to={inboxPath} className=\"aegis-notif-pop__view-all\">\n View all\n </LinkImpl>\n </div>\n </div>\n );\n\n return (\n <Popover\n content={content}\n trigger=\"click\"\n open={open}\n onOpenChange={setOpen}\n placement=\"bottomRight\"\n arrow={false}\n classNames={{ root: 'aegis-notif-pop__overlay' }}\n >\n <button\n type=\"button\"\n className=\"aegis-notif-bell\"\n aria-label={\n unreadCount > 0\n ? `Notifications: ${String(unreadCount)} unread`\n : 'Notifications'\n }\n data-agent-action-id={action?.id}\n onClick={action ? () => void bound.invoke() : undefined}\n >\n <BellOutlined className=\"aegis-notif-bell__icon\" />\n {unreadCount > 0 && (\n <span className=\"aegis-notif-bell__badge\" aria-hidden=\"true\">\n {unreadCount > 99 ? '99+' : unreadCount}\n </span>\n )}\n </button>\n </Popover>\n );\n}\n"],"names":["MAX_PREVIEW_ITEMS","DEFAULT_WIDTH","NotificationBell","items","unreadCount","n","onOpen","inboxPath","LinkImpl","DefaultLink","width","action","open","setOpen","useState","bound","useAegisAction","preview","handleItemClick","item","content","jsxs","jsx","relativeTime","Popover","BellOutlined"],"mappings":"8UAgCMA,EAAoB,EACpBC,EAAgB,IAEf,SAASC,EAAiB,CAC/B,MAAAC,EACA,YAAAC,EAAcD,EAAM,OAAQE,GAAM,CAACA,EAAE,IAAI,EAAE,OAC3C,OAAAC,EACA,UAAAC,EACA,cAAeC,EAAWC,EAAAA,YAC1B,MAAAC,EAAQT,EACR,OAAAU,CACF,EAAwC,CACtC,KAAM,CAACC,EAAMC,CAAO,EAAIC,EAAAA,SAAS,EAAK,EAChCC,EAAQC,EAAAA,eAA8BL,CAAM,E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IAAC,MAAA,CACC,UAAU,wBACV,eAAgB,IAAM,CACpBT,EAAQ,EAAK,CACf,EAEA,eAACL,EAAA,CAAS,GAAID,EAAW,UAAU,4BAA4B,SAAA,UAAA,CAE/D,CAAA,CAAA,CACF,EACF,EAGF,OACEe,EAAAA,IAACE,EAAAA,QAAA,CACC,QAAAJ,EACA,QAAQ,QACR,KAAAR,EACA,aAAcC,EACd,UAAU,cACV,MAAO,GACP,WAAY,CAAE,KAAM,0BAAA,EAEpB,SAAAQ,EAAAA,KAAC,SAAA,CACC,KAAK,SACL,UAAU,mBACV,aACEjB,EAAc,EACV,kBAAkB,OAAOA,CAAW,CAAC,UACrC,gBAEN,uBAAsBO,GAAQ,GAC9B,QAASA,EAAS,IAAM,KAAKI,EAAM,SAAW,OAE9C,SAAA,CAAAO,EAAAA,IAACG,EAAAA,aAAA,CAAa,UAAU,wBAAA,CAAyB,EAChDrB,EAAc,GACbkB,EAAAA,IAAC,OAAA,CAAK,UAAU,0BAA0B,cAAY,OACnD,SAAAlB,EAAc,GAAK,MAAQA,CAAA,CAC9B,CAAA,CAAA,CAAA,CAEJ,CAAA,CAGN"}
1
+ {"version":3,"file":"NotificationBell.cjs","sources":["../../../src/components/ui/NotificationBell.tsx"],"sourcesContent":["import { type ReactElement, useEffect, useId } from 'react';\n\nimport { BellOutlined, ExclamationCircleFilled } from '@ant-design/icons';\nimport { Popover } from 'antd';\n\nimport { useAegisAction } from '../../agent/core/hooks';\nimport type { AegisAction } from '../../agent/core/types';\nimport { POPOVER_OVERFLOW } from '../../hooks/popoverOverflow';\nimport { useDialogPopover } from '../../hooks/useDialogPopover';\nimport { useStrings } from '../../locale';\nimport type { AegisNotification } from '../../notifications';\nimport { Button } from './Button';\nimport { ErrorState } from './ErrorState';\nimport './NotificationBell.css';\nimport { DefaultLink, type LinkComponent } from './linkComponent';\nimport { relativeTime } from './relativeTime';\n\nexport interface NotificationBellProps {\n /** Newest first; the popover previews the first few. */\n items: AegisNotification[];\n /** Shown on the badge. Defaults to the number of unread `items`. */\n unreadCount?: number;\n /**\n * Fired when the user opens an item; the popover closes first. The host\n * marks it read and navigates to `item.to`.\n */\n onOpen?: (item: AegisNotification) => void;\n /** Path to the full inbox page, e.g. '/inbox'. */\n inboxPath: string;\n /** Renders the \"View all\" link. Defaults to an `<a href>`. */\n linkComponent?: LinkComponent;\n /** Override popover width in px. Defaults to 360. */\n width?: number;\n /** Optional aegis-ui agent action — fired when the bell is clicked. */\n action?: AegisAction<void, unknown>;\n /**\n * Set while live updates are failing: the bell shows a caution mark and\n * the popover says the items may be out of date. The count stays.\n */\n liveError?: Error | null;\n /**\n * Why loading failed. With no `items`, the bell shows the caution mark and\n * the popover says the notifications couldn't load; with `items`, it is\n * shown like `liveError`.\n */\n error?: Error | null;\n /**\n * Renders a retry button where the popover says loading failed or the\n * items may be out of date.\n */\n onRetry?: () => void;\n}\n\nconst MAX_PREVIEW_ITEMS = 8;\nconst DEFAULT_WIDTH = 360;\n\nexport function NotificationBell({\n items,\n unreadCount = items.filter((n) => !n.read).length,\n onOpen,\n inboxPath,\n linkComponent: LinkImpl = DefaultLink,\n width = DEFAULT_WIDTH,\n action,\n liveError,\n error,\n onRetry,\n}: NotificationBellProps): ReactElement {\n const strings = useStrings();\n const popover = useDialogPopover<HTMLDivElement>();\n const { open, focusPanel } = popover;\n const panelId = useId();\n const staleId = `${panelId}-stale`;\n const bound = useAegisAction<void, unknown>(action);\n\n const preview = items.slice(0, MAX_PREVIEW_ITEMS);\n const loadError = items.length === 0 ? (error ?? null) : null;\n const staleError = loadError ? null : (liveError ?? error ?? null);\n let caution: string | null = null;\n if (loadError) {\n caution = strings.notificationsLoadFailedNote(loadError.message);\n } else if (staleError) {\n caution = strings.notificationsStaleNote(staleError.message);\n }\n\n // A retry that works removes the retry button that had focus, which\n // would leave the open panel without it.\n useEffect(() => {\n if (open && document.activeElement === document.body) {\n focusPanel();\n }\n }, [loadError, staleError, open, focusPanel]);\n\n const handleItemClick = (item: AegisNotification): void => {\n popover.close();\n onOpen?.(item);\n };\n\n const content = (\n <div\n ref={popover.panelRef}\n id={panelId}\n className=\"aegis-notif-pop\"\n style={{ width }}\n role=\"dialog\"\n aria-labelledby={`${panelId}-title`}\n tabIndex={-1}\n >\n <div className=\"aegis-notif-pop__head\">\n <span id={`${panelId}-title`} className=\"aegis-notif-pop__title\">\n {strings.notifications}\n </span>\n {unreadCount > 0 && (\n <span className=\"aegis-notif-pop__count\">\n {strings.unreadCount(unreadCount)}\n </span>\n )}\n </div>\n {staleError && (\n <div className=\"aegis-notif-pop__stale\">\n <ExclamationCircleFilled\n className=\"aegis-notif-pop__stale-icon\"\n aria-hidden\n />\n <div className=\"aegis-notif-pop__stale-body\">\n <span>\n <span className=\"aegis-notif-pop__stale-title\">\n {strings.notificationsStale}\n </span>{' '}\n {staleError.message}\n </span>\n {onRetry && (\n <Button tone=\"secondary\" onClick={onRetry}>\n {strings.retry}\n </Button>\n )}\n </div>\n </div>\n )}\n {loadError ? (\n <ErrorState\n size=\"compact\"\n title={strings.notificationsLoadFailed}\n description={loadError.message}\n action={\n onRetry && (\n <Button tone=\"secondary\" onClick={onRetry}>\n {strings.retry}\n </Button>\n )\n }\n />\n ) : preview.length === 0 ? (\n <div className=\"aegis-notif-pop__empty\">\n {strings.notificationsCaughtUp}\n </div>\n ) : (\n <ul className=\"aegis-notif-pop__list\">\n {preview.map((item) => (\n <li key={item.id} className=\"aegis-notif-pop__item-wrap\">\n <button\n type=\"button\"\n className={[\n 'aegis-notif-pop__item',\n item.read ? '' : 'aegis-notif-pop__item--unread',\n ]\n .filter(Boolean)\n .join(' ')}\n onClick={() => {\n handleItemClick(item);\n }}\n >\n <span\n className=\"aegis-notif-pop__dot\"\n aria-hidden=\"true\"\n data-unread={!item.read}\n />\n <span className=\"aegis-notif-pop__body\">\n <span className=\"aegis-notif-pop__row\">\n <span className=\"aegis-notif-pop__item-title\">\n {item.title}\n </span>\n <span className=\"aegis-notif-pop__time\">\n {relativeTime(item.timestamp, strings)}\n </span>\n </span>\n {item.body && (\n <span className=\"aegis-notif-pop__item-body\">\n {item.body}\n </span>\n )}\n </span>\n </button>\n </li>\n ))}\n </ul>\n )}\n {/* Following the link closes the popover. */}\n <div className=\"aegis-notif-pop__foot\" onClickCapture={popover.close}>\n <LinkImpl to={inboxPath} className=\"aegis-notif-pop__view-all\">\n {strings.viewAll}\n </LinkImpl>\n </div>\n </div>\n );\n\n return (\n <Popover\n content={content}\n trigger=\"click\"\n open={popover.open}\n onOpenChange={popover.setOpen}\n placement=\"bottomRight\"\n autoAdjustOverflow={POPOVER_OVERFLOW}\n arrow={false}\n classNames={{ root: 'aegis-notif-pop__overlay' }}\n >\n {/* antd sets aria-describedby on its child to the popover's id, so\n the wrapper takes that and the bell keeps its own description. */}\n <span className=\"aegis-notif-bell__anchor\">\n <button\n ref={popover.triggerRef}\n type=\"button\"\n className=\"aegis-notif-bell\"\n aria-describedby={caution ? staleId : undefined}\n aria-haspopup=\"dialog\"\n aria-expanded={popover.open}\n aria-controls={popover.open ? panelId : undefined}\n aria-label={strings.notificationBellLabel(unreadCount)}\n data-agent-action-id={action?.id}\n onClick={action ? () => void bound.invoke() : undefined}\n >\n <BellOutlined className=\"aegis-notif-bell__icon\" />\n {unreadCount > 0 && (\n <span className=\"aegis-notif-bell__badge\" aria-hidden=\"true\">\n {unreadCount > 99 ? '99+' : unreadCount}\n </span>\n )}\n {caution && (\n <>\n <ExclamationCircleFilled\n className=\"aegis-notif-bell__stale\"\n aria-hidden\n />\n <span id={staleId} className=\"aegis-notif-bell__description\">\n {caution}\n </span>\n </>\n )}\n </button>\n </span>\n </Popover>\n );\n}\n"],"names":["MAX_PREVIEW_ITEMS","DEFAULT_WIDTH","NotificationBell","items","unreadCount","n","onOpen","inboxPath","LinkImpl","DefaultLink","width","action","liveError","error","onRetry","strings","useStrings","popover","useDialogPopover","open","focusPanel","panelId","useId","staleId","bound","useAegisAction","preview","loadError","staleError","caution","useEffect","handleItemClick","item","content","jsxs","jsx","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,EAEDyB,GACCK,EAAAA,KAAAQ,WAAA,CACE,SAAA,CAAAP,EAAAA,IAACC,EAAAA,wBAAA,CACC,UAAU,0BACV,cAAW,EAAA,CAAA,QAEZ,OAAA,CAAK,GAAIb,EAAS,UAAU,gCAC1B,SAAAM,CAAA,CACH,CAAA,CAAA,CACF,CAAA,CAAA,CAAA,CAEJ,CACF,CAAA,CAAA,CAGN"}
@@ -20,5 +20,21 @@ export interface NotificationBellProps {
20
20
  width?: number;
21
21
  /** Optional aegis-ui agent action — fired when the bell is clicked. */
22
22
  action?: AegisAction<void, unknown>;
23
+ /**
24
+ * Set while live updates are failing: the bell shows a caution mark and
25
+ * the popover says the items may be out of date. The count stays.
26
+ */
27
+ liveError?: Error | null;
28
+ /**
29
+ * Why loading failed. With no `items`, the bell shows the caution mark and
30
+ * the popover says the notifications couldn't load; with `items`, it is
31
+ * shown like `liveError`.
32
+ */
33
+ error?: Error | null;
34
+ /**
35
+ * Renders a retry button where the popover says loading failed or the
36
+ * items may be out of date.
37
+ */
38
+ onRetry?: () => void;
23
39
  }
24
- export declare function NotificationBell({ items, unreadCount, onOpen, inboxPath, linkComponent: LinkImpl, width, action, }: NotificationBellProps): ReactElement;
40
+ export declare function NotificationBell({ items, unreadCount, onOpen, inboxPath, linkComponent: LinkImpl, width, action, liveError, error, onRetry, }: NotificationBellProps): ReactElement;
@@ -1,100 +1,154 @@
1
- import { jsxs as o, jsx as i } from "react/jsx-runtime";
2
- import { useState as h } from "react";
3
- import { BellOutlined as N } from "@ant-design/icons";
4
- import { Popover as b } from "antd";
5
- import { useAegisAction as v } from "../../agent/core/hooks.js";
1
+ import { jsxs as o, jsx as e, Fragment as x } from "react/jsx-runtime";
2
+ import { useId as A, useEffect as F } from "react";
3
+ import { ExclamationCircleFilled as u, BellOutlined as L } from "@ant-design/icons";
4
+ import { Popover as P } from "antd";
5
+ import { useAegisAction as B } from "../../agent/core/hooks.js";
6
+ import { POPOVER_OVERFLOW as S } from "../../hooks/popoverOverflow.js";
7
+ import { useDialogPopover as j } from "../../hooks/useDialogPopover.js";
8
+ import { Button as b } from "./Button.js";
9
+ import { ErrorState as D } from "./ErrorState.js";
6
10
  /* empty css */
7
- import { DefaultLink as u } from "./linkComponent.js";
8
- import { relativeTime as y } from "./relativeTime.js";
9
- const k = 8, w = 360;
10
- function O({
11
- items: l,
12
- unreadCount: a = l.filter((t) => !t.read).length,
13
- onOpen: c,
14
- inboxPath: r,
15
- linkComponent: d = u,
16
- width: m = w,
17
- action: s
11
+ import { DefaultLink as T } from "./linkComponent.js";
12
+ import { relativeTime as R } from "./relativeTime.js";
13
+ import { useStrings as V } from "../../locale/useStrings.js";
14
+ const W = 8, $ = 360;
15
+ function ie({
16
+ items: d,
17
+ unreadCount: n = d.filter((i) => !i.read).length,
18
+ onOpen: v,
19
+ inboxPath: y,
20
+ linkComponent: E = T,
21
+ width: k = $,
22
+ action: m,
23
+ liveError: I,
24
+ error: f,
25
+ onRetry: p
18
26
  }) {
19
- const [t, n] = h(!1), f = v(s), p = l.slice(0, k), _ = (e) => {
20
- n(!1), c?.(e);
21
- }, g = /* @__PURE__ */ o("div", { className: "aegis-notif-pop", style: { width: m }, children: [
22
- /* @__PURE__ */ o("div", { className: "aegis-notif-pop__head", children: [
23
- /* @__PURE__ */ i("span", { className: "aegis-notif-pop__title", children: "Notifications" }),
24
- a > 0 && /* @__PURE__ */ o("span", { className: "aegis-notif-pop__count", children: [
25
- a,
26
- " unread"
27
- ] })
28
- ] }),
29
- p.length === 0 ? /* @__PURE__ */ i("div", { className: "aegis-notif-pop__empty", children: "You're all caught up." }) : /* @__PURE__ */ i("ul", { className: "aegis-notif-pop__list", children: p.map((e) => /* @__PURE__ */ i("li", { className: "aegis-notif-pop__item-wrap", children: /* @__PURE__ */ o(
30
- "button",
31
- {
32
- type: "button",
33
- className: [
34
- "aegis-notif-pop__item",
35
- e.read ? "" : "aegis-notif-pop__item--unread"
36
- ].filter(Boolean).join(" "),
37
- onClick: () => {
38
- _(e);
39
- },
40
- children: [
41
- /* @__PURE__ */ i(
42
- "span",
27
+ const i = V(), t = j(), { open: _, focusPanel: g } = t, l = A(), h = `${l}-stale`, O = B(m), N = d.slice(0, W), s = d.length === 0 ? f ?? null : null, c = s ? null : I ?? f ?? null;
28
+ let r = null;
29
+ s ? r = i.notificationsLoadFailedNote(s.message) : c && (r = i.notificationsStaleNote(c.message)), F(() => {
30
+ _ && document.activeElement === document.body && g();
31
+ }, [s, c, _, g]);
32
+ const w = (a) => {
33
+ t.close(), v?.(a);
34
+ }, C = /* @__PURE__ */ o(
35
+ "div",
36
+ {
37
+ ref: t.panelRef,
38
+ id: l,
39
+ className: "aegis-notif-pop",
40
+ style: { width: k },
41
+ role: "dialog",
42
+ "aria-labelledby": `${l}-title`,
43
+ tabIndex: -1,
44
+ children: [
45
+ /* @__PURE__ */ o("div", { className: "aegis-notif-pop__head", children: [
46
+ /* @__PURE__ */ e("span", { id: `${l}-title`, className: "aegis-notif-pop__title", children: i.notifications }),
47
+ n > 0 && /* @__PURE__ */ e("span", { className: "aegis-notif-pop__count", children: i.unreadCount(n) })
48
+ ] }),
49
+ c && /* @__PURE__ */ o("div", { className: "aegis-notif-pop__stale", children: [
50
+ /* @__PURE__ */ e(
51
+ u,
43
52
  {
44
- className: "aegis-notif-pop__dot",
45
- "aria-hidden": "true",
46
- "data-unread": !e.read
53
+ className: "aegis-notif-pop__stale-icon",
54
+ "aria-hidden": !0
47
55
  }
48
56
  ),
49
- /* @__PURE__ */ o("span", { className: "aegis-notif-pop__body", children: [
50
- /* @__PURE__ */ o("span", { className: "aegis-notif-pop__row", children: [
51
- /* @__PURE__ */ i("span", { className: "aegis-notif-pop__item-title", children: e.title }),
52
- /* @__PURE__ */ i("span", { className: "aegis-notif-pop__time", children: y(e.timestamp) })
57
+ /* @__PURE__ */ o("div", { className: "aegis-notif-pop__stale-body", children: [
58
+ /* @__PURE__ */ o("span", { children: [
59
+ /* @__PURE__ */ e("span", { className: "aegis-notif-pop__stale-title", children: i.notificationsStale }),
60
+ " ",
61
+ c.message
53
62
  ] }),
54
- e.body && /* @__PURE__ */ i("span", { className: "aegis-notif-pop__item-body", children: e.body })
63
+ p && /* @__PURE__ */ e(b, { tone: "secondary", onClick: p, children: i.retry })
55
64
  ] })
56
- ]
57
- }
58
- ) }, e.id)) }),
59
- /* @__PURE__ */ i(
60
- "div",
61
- {
62
- className: "aegis-notif-pop__foot",
63
- onClickCapture: () => {
64
- n(!1);
65
- },
66
- children: /* @__PURE__ */ i(d, { to: r, className: "aegis-notif-pop__view-all", children: "View all" })
67
- }
68
- )
69
- ] });
70
- return /* @__PURE__ */ i(
71
- b,
65
+ ] }),
66
+ s ? /* @__PURE__ */ e(
67
+ D,
68
+ {
69
+ size: "compact",
70
+ title: i.notificationsLoadFailed,
71
+ description: s.message,
72
+ action: p && /* @__PURE__ */ e(b, { tone: "secondary", onClick: p, children: i.retry })
73
+ }
74
+ ) : N.length === 0 ? /* @__PURE__ */ e("div", { className: "aegis-notif-pop__empty", children: i.notificationsCaughtUp }) : /* @__PURE__ */ e("ul", { className: "aegis-notif-pop__list", children: N.map((a) => /* @__PURE__ */ e("li", { className: "aegis-notif-pop__item-wrap", children: /* @__PURE__ */ o(
75
+ "button",
76
+ {
77
+ type: "button",
78
+ className: [
79
+ "aegis-notif-pop__item",
80
+ a.read ? "" : "aegis-notif-pop__item--unread"
81
+ ].filter(Boolean).join(" "),
82
+ onClick: () => {
83
+ w(a);
84
+ },
85
+ children: [
86
+ /* @__PURE__ */ e(
87
+ "span",
88
+ {
89
+ className: "aegis-notif-pop__dot",
90
+ "aria-hidden": "true",
91
+ "data-unread": !a.read
92
+ }
93
+ ),
94
+ /* @__PURE__ */ o("span", { className: "aegis-notif-pop__body", children: [
95
+ /* @__PURE__ */ o("span", { className: "aegis-notif-pop__row", children: [
96
+ /* @__PURE__ */ e("span", { className: "aegis-notif-pop__item-title", children: a.title }),
97
+ /* @__PURE__ */ e("span", { className: "aegis-notif-pop__time", children: R(a.timestamp, i) })
98
+ ] }),
99
+ a.body && /* @__PURE__ */ e("span", { className: "aegis-notif-pop__item-body", children: a.body })
100
+ ] })
101
+ ]
102
+ }
103
+ ) }, a.id)) }),
104
+ /* @__PURE__ */ e("div", { className: "aegis-notif-pop__foot", onClickCapture: t.close, children: /* @__PURE__ */ e(E, { to: y, className: "aegis-notif-pop__view-all", children: i.viewAll }) })
105
+ ]
106
+ }
107
+ );
108
+ return /* @__PURE__ */ e(
109
+ P,
72
110
  {
73
- content: g,
111
+ content: C,
74
112
  trigger: "click",
75
- open: t,
76
- onOpenChange: n,
113
+ open: t.open,
114
+ onOpenChange: t.setOpen,
77
115
  placement: "bottomRight",
116
+ autoAdjustOverflow: S,
78
117
  arrow: !1,
79
118
  classNames: { root: "aegis-notif-pop__overlay" },
80
- children: /* @__PURE__ */ o(
119
+ children: /* @__PURE__ */ e("span", { className: "aegis-notif-bell__anchor", children: /* @__PURE__ */ o(
81
120
  "button",
82
121
  {
122
+ ref: t.triggerRef,
83
123
  type: "button",
84
124
  className: "aegis-notif-bell",
85
- "aria-label": a > 0 ? `Notifications: ${String(a)} unread` : "Notifications",
86
- "data-agent-action-id": s?.id,
87
- onClick: s ? () => void f.invoke() : void 0,
125
+ "aria-describedby": r ? h : void 0,
126
+ "aria-haspopup": "dialog",
127
+ "aria-expanded": t.open,
128
+ "aria-controls": t.open ? l : void 0,
129
+ "aria-label": i.notificationBellLabel(n),
130
+ "data-agent-action-id": m?.id,
131
+ onClick: m ? () => void O.invoke() : void 0,
88
132
  children: [
89
- /* @__PURE__ */ i(N, { className: "aegis-notif-bell__icon" }),
90
- a > 0 && /* @__PURE__ */ i("span", { className: "aegis-notif-bell__badge", "aria-hidden": "true", children: a > 99 ? "99+" : a })
133
+ /* @__PURE__ */ e(L, { className: "aegis-notif-bell__icon" }),
134
+ n > 0 && /* @__PURE__ */ e("span", { className: "aegis-notif-bell__badge", "aria-hidden": "true", children: n > 99 ? "99+" : n }),
135
+ r && /* @__PURE__ */ o(x, { children: [
136
+ /* @__PURE__ */ e(
137
+ u,
138
+ {
139
+ className: "aegis-notif-bell__stale",
140
+ "aria-hidden": !0
141
+ }
142
+ ),
143
+ /* @__PURE__ */ e("span", { id: h, className: "aegis-notif-bell__description", children: r })
144
+ ] })
91
145
  ]
92
146
  }
93
- )
147
+ ) })
94
148
  }
95
149
  );
96
150
  }
97
151
  export {
98
- O as NotificationBell
152
+ ie as NotificationBell
99
153
  };
100
154
  //# sourceMappingURL=NotificationBell.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"NotificationBell.js","sources":["../../../src/components/ui/NotificationBell.tsx"],"sourcesContent":["import { type ReactElement, useState } from 'react';\n\nimport { BellOutlined } from '@ant-design/icons';\nimport { Popover } from 'antd';\n\nimport { useAegisAction } from '../../agent/core/hooks';\nimport type { AegisAction } from '../../agent/core/types';\nimport type { AegisNotification } from '../../notifications';\nimport './NotificationBell.css';\nimport { DefaultLink, type LinkComponent } from './linkComponent';\nimport { relativeTime } from './relativeTime';\n\nexport interface NotificationBellProps {\n /** Newest first; the popover previews the first few. */\n items: AegisNotification[];\n /** Shown on the badge. Defaults to the number of unread `items`. */\n unreadCount?: number;\n /**\n * Fired when the user opens an item; the popover closes first. The host\n * marks it read and navigates to `item.to`.\n */\n onOpen?: (item: AegisNotification) => void;\n /** Path to the full inbox page, e.g. '/inbox'. */\n inboxPath: string;\n /** Renders the \"View all\" link. Defaults to an `<a href>`. */\n linkComponent?: LinkComponent;\n /** Override popover width in px. Defaults to 360. */\n width?: number;\n /** Optional aegis-ui agent action — fired when the bell is clicked. */\n action?: AegisAction<void, unknown>;\n}\n\nconst MAX_PREVIEW_ITEMS = 8;\nconst DEFAULT_WIDTH = 360;\n\nexport function NotificationBell({\n items,\n unreadCount = items.filter((n) => !n.read).length,\n onOpen,\n inboxPath,\n linkComponent: LinkImpl = DefaultLink,\n width = DEFAULT_WIDTH,\n action,\n}: NotificationBellProps): ReactElement {\n const [open, setOpen] = useState(false);\n const bound = useAegisAction<void, unknown>(action);\n\n const preview = items.slice(0, MAX_PREVIEW_ITEMS);\n\n const handleItemClick = (item: AegisNotification): void => {\n setOpen(false);\n onOpen?.(item);\n };\n\n const content = (\n <div className=\"aegis-notif-pop\" style={{ width }}>\n <div className=\"aegis-notif-pop__head\">\n <span className=\"aegis-notif-pop__title\">Notifications</span>\n {unreadCount > 0 && (\n <span className=\"aegis-notif-pop__count\">{unreadCount} unread</span>\n )}\n </div>\n {preview.length === 0 ? (\n <div className=\"aegis-notif-pop__empty\">You&apos;re all caught up.</div>\n ) : (\n <ul className=\"aegis-notif-pop__list\">\n {preview.map((item) => (\n <li key={item.id} className=\"aegis-notif-pop__item-wrap\">\n <button\n type=\"button\"\n className={[\n 'aegis-notif-pop__item',\n item.read ? '' : 'aegis-notif-pop__item--unread',\n ]\n .filter(Boolean)\n .join(' ')}\n onClick={() => {\n handleItemClick(item);\n }}\n >\n <span\n className=\"aegis-notif-pop__dot\"\n aria-hidden=\"true\"\n data-unread={!item.read}\n />\n <span className=\"aegis-notif-pop__body\">\n <span className=\"aegis-notif-pop__row\">\n <span className=\"aegis-notif-pop__item-title\">\n {item.title}\n </span>\n <span className=\"aegis-notif-pop__time\">\n {relativeTime(item.timestamp)}\n </span>\n </span>\n {item.body && (\n <span className=\"aegis-notif-pop__item-body\">\n {item.body}\n </span>\n )}\n </span>\n </button>\n </li>\n ))}\n </ul>\n )}\n {/* Following the link closes the popover. */}\n <div\n className=\"aegis-notif-pop__foot\"\n onClickCapture={() => {\n setOpen(false);\n }}\n >\n <LinkImpl to={inboxPath} className=\"aegis-notif-pop__view-all\">\n View all\n </LinkImpl>\n </div>\n </div>\n );\n\n return (\n <Popover\n content={content}\n trigger=\"click\"\n open={open}\n onOpenChange={setOpen}\n placement=\"bottomRight\"\n arrow={false}\n classNames={{ root: 'aegis-notif-pop__overlay' }}\n >\n <button\n type=\"button\"\n className=\"aegis-notif-bell\"\n aria-label={\n unreadCount > 0\n ? `Notifications: ${String(unreadCount)} unread`\n : 'Notifications'\n }\n data-agent-action-id={action?.id}\n onClick={action ? () => void bound.invoke() : undefined}\n >\n <BellOutlined className=\"aegis-notif-bell__icon\" />\n {unreadCount > 0 && (\n <span className=\"aegis-notif-bell__badge\" aria-hidden=\"true\">\n {unreadCount > 99 ? '99+' : unreadCount}\n </span>\n )}\n </button>\n </Popover>\n );\n}\n"],"names":["MAX_PREVIEW_ITEMS","DEFAULT_WIDTH","NotificationBell","items","unreadCount","n","onOpen","inboxPath","LinkImpl","DefaultLink","width","action","open","setOpen","useState","bound","useAegisAction","preview","handleItemClick","item","content","jsxs","jsx","relativeTime","Popover","BellOutlined"],"mappings":";;;;;;;;AAgCA,MAAMA,IAAoB,GACpBC,IAAgB;AAEf,SAASC,EAAiB;AAAA,EAC/B,OAAAC;AAAA,EACA,aAAAC,IAAcD,EAAM,OAAO,CAACE,MAAM,CAACA,EAAE,IAAI,EAAE;AAAA,EAC3C,QAAAC;AAAA,EACA,WAAAC;AAAA,EACA,eAAeC,IAAWC;AAAA,EAC1B,OAAAC,IAAQT;AAAA,EACR,QAAAU;AACF,GAAwC;AACtC,QAAM,CAACC,GAAMC,CAAO,IAAIC,EAAS,EAAK,GAChCC,IAAQC,EAA8BL,CAAM,GAE5CM,IAAUd,EAAM,MAAM,GAAGH,CAAiB,GAE1CkB,IAAkB,CAACC,MAAkC;AACzD,IAAAN,EAAQ,EAAK,GACbP,IAASa,CAAI;AAAA,EACf,GAEMC,sBACH,OAAA,EAAI,WAAU,mBAAkB,OAAO,EAAE,OAAAV,KACxC,UAAA;AAAA,IAAA,gBAAAW,EAAC,OAAA,EAAI,WAAU,yBACb,UAAA;AAAA,MAAA,gBAAAC,EAAC,QAAA,EAAK,WAAU,0BAAyB,UAAA,iBAAa;AAAA,MACrDlB,IAAc,KACb,gBAAAiB,EAAC,QAAA,EAAK,WAAU,0BAA0B,UAAA;AAAA,QAAAjB;AAAA,QAAY;AAAA,MAAA,EAAA,CAAO;AAAA,IAAA,GAEjE;AAAA,IACCa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GF,SACE,gBAAAe;AAAA,IAACE;AAAA,IAAA;AAAA,MACC,SAAAJ;AAAA,MACA,SAAQ;AAAA,MACR,MAAAR;AAAA,MACA,cAAcC;AAAA,MACd,WAAU;AAAA,MACV,OAAO;AAAA,MACP,YAAY,EAAE,MAAM,2BAAA;AAAA,MAEpB,UAAA,gBAAAQ;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,MAAK;AAAA,UACL,WAAU;AAAA,UACV,cACEjB,IAAc,IACV,kBAAkB,OAAOA,CAAW,CAAC,YACrC;AAAA,UAEN,wBAAsBO,GAAQ;AAAA,UAC9B,SAASA,IAAS,MAAM,KAAKI,EAAM,WAAW;AAAA,UAE9C,UAAA;AAAA,YAAA,gBAAAO,EAACG,GAAA,EAAa,WAAU,yBAAA,CAAyB;AAAA,YAChDrB,IAAc,KACb,gBAAAkB,EAAC,QAAA,EAAK,WAAU,2BAA0B,eAAY,QACnD,UAAAlB,IAAc,KAAK,QAAQA,EAAA,CAC9B;AAAA,UAAA;AAAA,QAAA;AAAA,MAAA;AAAA,IAEJ;AAAA,EAAA;AAGN;"}
1
+ {"version":3,"file":"NotificationBell.js","sources":["../../../src/components/ui/NotificationBell.tsx"],"sourcesContent":["import { type ReactElement, useEffect, useId } from 'react';\n\nimport { BellOutlined, ExclamationCircleFilled } from '@ant-design/icons';\nimport { Popover } from 'antd';\n\nimport { useAegisAction } from '../../agent/core/hooks';\nimport type { AegisAction } from '../../agent/core/types';\nimport { POPOVER_OVERFLOW } from '../../hooks/popoverOverflow';\nimport { useDialogPopover } from '../../hooks/useDialogPopover';\nimport { useStrings } from '../../locale';\nimport type { AegisNotification } from '../../notifications';\nimport { Button } from './Button';\nimport { ErrorState } from './ErrorState';\nimport './NotificationBell.css';\nimport { DefaultLink, type LinkComponent } from './linkComponent';\nimport { relativeTime } from './relativeTime';\n\nexport interface NotificationBellProps {\n /** Newest first; the popover previews the first few. */\n items: AegisNotification[];\n /** Shown on the badge. Defaults to the number of unread `items`. */\n unreadCount?: number;\n /**\n * Fired when the user opens an item; the popover closes first. The host\n * marks it read and navigates to `item.to`.\n */\n onOpen?: (item: AegisNotification) => void;\n /** Path to the full inbox page, e.g. '/inbox'. */\n inboxPath: string;\n /** Renders the \"View all\" link. Defaults to an `<a href>`. */\n linkComponent?: LinkComponent;\n /** Override popover width in px. Defaults to 360. */\n width?: number;\n /** Optional aegis-ui agent action — fired when the bell is clicked. */\n action?: AegisAction<void, unknown>;\n /**\n * Set while live updates are failing: the bell shows a caution mark and\n * the popover says the items may be out of date. The count stays.\n */\n liveError?: Error | null;\n /**\n * Why loading failed. With no `items`, the bell shows the caution mark and\n * the popover says the notifications couldn't load; with `items`, it is\n * shown like `liveError`.\n */\n error?: Error | null;\n /**\n * Renders a retry button where the popover says loading failed or the\n * items may be out of date.\n */\n onRetry?: () => void;\n}\n\nconst MAX_PREVIEW_ITEMS = 8;\nconst DEFAULT_WIDTH = 360;\n\nexport function NotificationBell({\n items,\n unreadCount = items.filter((n) => !n.read).length,\n onOpen,\n inboxPath,\n linkComponent: LinkImpl = DefaultLink,\n width = DEFAULT_WIDTH,\n action,\n liveError,\n error,\n onRetry,\n}: NotificationBellProps): ReactElement {\n const strings = useStrings();\n const popover = useDialogPopover<HTMLDivElement>();\n const { open, focusPanel } = popover;\n const panelId = useId();\n const staleId = `${panelId}-stale`;\n const bound = useAegisAction<void, unknown>(action);\n\n const preview = items.slice(0, MAX_PREVIEW_ITEMS);\n const loadError = items.length === 0 ? (error ?? null) : null;\n const staleError = loadError ? null : (liveError ?? error ?? null);\n let caution: string | null = null;\n if (loadError) {\n caution = strings.notificationsLoadFailedNote(loadError.message);\n } else if (staleError) {\n caution = strings.notificationsStaleNote(staleError.message);\n }\n\n // A retry that works removes the retry button that had focus, which\n // would leave the open panel without it.\n useEffect(() => {\n if (open && document.activeElement === document.body) {\n focusPanel();\n }\n }, [loadError, staleError, open, focusPanel]);\n\n const handleItemClick = (item: AegisNotification): void => {\n popover.close();\n onOpen?.(item);\n };\n\n const content = (\n <div\n ref={popover.panelRef}\n id={panelId}\n className=\"aegis-notif-pop\"\n style={{ width }}\n role=\"dialog\"\n aria-labelledby={`${panelId}-title`}\n tabIndex={-1}\n >\n <div className=\"aegis-notif-pop__head\">\n <span id={`${panelId}-title`} className=\"aegis-notif-pop__title\">\n {strings.notifications}\n </span>\n {unreadCount > 0 && (\n <span className=\"aegis-notif-pop__count\">\n {strings.unreadCount(unreadCount)}\n </span>\n )}\n </div>\n {staleError && (\n <div className=\"aegis-notif-pop__stale\">\n <ExclamationCircleFilled\n className=\"aegis-notif-pop__stale-icon\"\n aria-hidden\n />\n <div className=\"aegis-notif-pop__stale-body\">\n <span>\n <span className=\"aegis-notif-pop__stale-title\">\n {strings.notificationsStale}\n </span>{' '}\n {staleError.message}\n </span>\n {onRetry && (\n <Button tone=\"secondary\" onClick={onRetry}>\n {strings.retry}\n </Button>\n )}\n </div>\n </div>\n )}\n {loadError ? (\n <ErrorState\n size=\"compact\"\n title={strings.notificationsLoadFailed}\n description={loadError.message}\n action={\n onRetry && (\n <Button tone=\"secondary\" onClick={onRetry}>\n {strings.retry}\n </Button>\n )\n }\n />\n ) : preview.length === 0 ? (\n <div className=\"aegis-notif-pop__empty\">\n {strings.notificationsCaughtUp}\n </div>\n ) : (\n <ul className=\"aegis-notif-pop__list\">\n {preview.map((item) => (\n <li key={item.id} className=\"aegis-notif-pop__item-wrap\">\n <button\n type=\"button\"\n className={[\n 'aegis-notif-pop__item',\n item.read ? '' : 'aegis-notif-pop__item--unread',\n ]\n .filter(Boolean)\n .join(' ')}\n onClick={() => {\n handleItemClick(item);\n }}\n >\n <span\n className=\"aegis-notif-pop__dot\"\n aria-hidden=\"true\"\n data-unread={!item.read}\n />\n <span className=\"aegis-notif-pop__body\">\n <span className=\"aegis-notif-pop__row\">\n <span className=\"aegis-notif-pop__item-title\">\n {item.title}\n </span>\n <span className=\"aegis-notif-pop__time\">\n {relativeTime(item.timestamp, strings)}\n </span>\n </span>\n {item.body && (\n <span className=\"aegis-notif-pop__item-body\">\n {item.body}\n </span>\n )}\n </span>\n </button>\n </li>\n ))}\n </ul>\n )}\n {/* Following the link closes the popover. */}\n <div className=\"aegis-notif-pop__foot\" onClickCapture={popover.close}>\n <LinkImpl to={inboxPath} className=\"aegis-notif-pop__view-all\">\n {strings.viewAll}\n </LinkImpl>\n </div>\n </div>\n );\n\n return (\n <Popover\n content={content}\n trigger=\"click\"\n open={popover.open}\n onOpenChange={popover.setOpen}\n placement=\"bottomRight\"\n autoAdjustOverflow={POPOVER_OVERFLOW}\n arrow={false}\n classNames={{ root: 'aegis-notif-pop__overlay' }}\n >\n {/* antd sets aria-describedby on its child to the popover's id, so\n the wrapper takes that and the bell keeps its own description. */}\n <span className=\"aegis-notif-bell__anchor\">\n <button\n ref={popover.triggerRef}\n type=\"button\"\n className=\"aegis-notif-bell\"\n aria-describedby={caution ? staleId : undefined}\n aria-haspopup=\"dialog\"\n aria-expanded={popover.open}\n aria-controls={popover.open ? panelId : undefined}\n aria-label={strings.notificationBellLabel(unreadCount)}\n data-agent-action-id={action?.id}\n onClick={action ? () => void bound.invoke() : undefined}\n >\n <BellOutlined className=\"aegis-notif-bell__icon\" />\n {unreadCount > 0 && (\n <span className=\"aegis-notif-bell__badge\" aria-hidden=\"true\">\n {unreadCount > 99 ? '99+' : unreadCount}\n </span>\n )}\n {caution && (\n <>\n <ExclamationCircleFilled\n className=\"aegis-notif-bell__stale\"\n aria-hidden\n />\n <span id={staleId} className=\"aegis-notif-bell__description\">\n {caution}\n </span>\n </>\n )}\n </button>\n </span>\n </Popover>\n );\n}\n"],"names":["MAX_PREVIEW_ITEMS","DEFAULT_WIDTH","NotificationBell","items","unreadCount","n","onOpen","inboxPath","LinkImpl","DefaultLink","width","action","liveError","error","onRetry","strings","useStrings","popover","useDialogPopover","open","focusPanel","panelId","useId","staleId","bound","useAegisAction","preview","loadError","staleError","caution","useEffect","handleItemClick","item","content","jsxs","jsx","ExclamationCircleFilled","Button","ErrorState","Popover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AAA,MACpB,OAAO;AAAA,MACP,YAAY,EAAE,MAAM,2BAAA;AAAA,MAIpB,UAAA,gBAAAL,EAAC,QAAA,EAAK,WAAU,4BACd,UAAA,gBAAAD;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,KAAKjB,EAAQ;AAAA,UACb,MAAK;AAAA,UACL,WAAU;AAAA,UACV,oBAAkBY,IAAUN,IAAU;AAAA,UACtC,iBAAc;AAAA,UACd,iBAAeN,EAAQ;AAAA,UACvB,iBAAeA,EAAQ,OAAOI,IAAU;AAAA,UACxC,cAAYN,EAAQ,sBAAsBX,CAAW;AAAA,UACrD,wBAAsBO,GAAQ;AAAA,UAC9B,SAASA,IAAS,MAAM,KAAKa,EAAM,WAAW;AAAA,UAE9C,UAAA;AAAA,YAAA,gBAAAW,EAACM,GAAA,EAAa,WAAU,yBAAA,CAAyB;AAAA,YAChDrC,IAAc,KACb,gBAAA+B,EAAC,QAAA,EAAK,WAAU,2BAA0B,eAAY,QACnD,UAAA/B,IAAc,KAAK,QAAQA,EAAA,CAC9B;AAAA,YAEDyB,KACC,gBAAAK,EAAAQ,GAAA,EACE,UAAA;AAAA,cAAA,gBAAAP;AAAA,gBAACC;AAAA,gBAAA;AAAA,kBACC,WAAU;AAAA,kBACV,eAAW;AAAA,gBAAA;AAAA,cAAA;AAAA,gCAEZ,QAAA,EAAK,IAAIb,GAAS,WAAU,iCAC1B,UAAAM,EAAA,CACH;AAAA,YAAA,EAAA,CACF;AAAA,UAAA;AAAA,QAAA;AAAA,MAAA,EAEJ,CACF;AAAA,IAAA;AAAA,EAAA;AAGN;"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const q=require("react/jsx-runtime"),b=require("react");;/* empty css */const F=require("./TextField.cjs"),L=/^-?\d+$/,$=/^-?(\d+\.?\d*|\.\d+)$/,C=/^-?$/,V=/^-?\.?$/;function m(e){return e===void 0?"":String(e)}function B(e,r,s){return Math.min(s??1/0,Math.max(r??-1/0,e))}function G({value:e,onChange:r,label:s,ariaLabel:v,integer:i=!1,min:n,max:p,step:w=1,unit:x,placeholder:E,helperText:I,error:y,disabled:A=!1,id:N,className:T}){const g=i?L:$,l=t=>g.test(t.trim())?Number(t.trim()):void 0,[a,u]=b.useState(()=>m(e)),[D,d]=b.useState(e);e!==D&&(d(e),e!==l(a)&&u(m(e)));const f=l(a),M=(i?C:V).test(a.trim())||f!==void 0?void 0:i?"Enter a whole number":"Enter a number",S=t=>{const c=l(t);u(t),d(c),r(c)},h=t=>{const o=B((f??n??0)+t*w,n,p);u(m(o)),d(o),r(o)},P=t=>{const o={ArrowUp:1,ArrowDown:-1,PageUp:10,PageDown:-10}[t.key];o!==void 0&&(t.preventDefault(),h(o))},R=n===void 0||n<0?"text":i?"numeric":"decimal",j=["aegis-number-field",T??""].filter(Boolean).join(" ");return q.jsx(F.TextField,{className:j,id:N,label:s,"aria-label":s===void 0?v:void 0,role:"spinbutton","aria-valuenow":f,"aria-valuemin":n,"aria-valuemax":p,inputMode:R,autoComplete:"off",value:a,placeholder:E,disabled:A,error:M??y,helperText:I,trailingIcon:x,onChange:t=>{S(t.target.value)},onKeyDown:P})}exports.NumberField=G;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const L=require("react/jsx-runtime"),g=require("react");;/* empty css */const $=require("./TextField.cjs"),C=require("../../locale/useStrings.cjs"),V=/^-?\d+$/,B=/^-?(\d+\.?\d*|\.\d+)$/,G=/^-?$/,U=/^-?\.?$/;function m(e){return e===void 0?"":String(e)}function _(e,n,s){return Math.min(s??1/0,Math.max(n??-1/0,e))}function k({value:e,onChange:n,label:s,ariaLabel:v,integer:i=!1,min:r,max:p,step:y=1,unit:N,placeholder:w,helperText:x,error:I,disabled:A=!1,id:S,"aria-describedby":T,className:E}){const b=C.useStrings(),D=i?V:B,u=t=>D.test(t.trim())?Number(t.trim()):void 0,[a,l]=g.useState(()=>m(e)),[M,d]=g.useState(e);e!==M&&(d(e),e!==u(a)&&l(m(e)));const f=u(a),h=(i?G:U).test(a.trim())||f!==void 0?void 0:i?b.enterWholeNumber:b.enterNumber,q=t=>{const c=u(t);l(t),d(c),n(c)},P=t=>{const o=_((f??r??0)+t*y,r,p);l(m(o)),d(o),n(o)},R=t=>{const o={ArrowUp:1,ArrowDown:-1,PageUp:10,PageDown:-10}[t.key];o!==void 0&&(t.preventDefault(),P(o))},j=r===void 0||r<0?"text":i?"numeric":"decimal",F=["aegis-number-field",E??""].filter(Boolean).join(" ");return L.jsx($.TextField,{className:F,id:S,label:s,"aria-label":s===void 0?v:void 0,"aria-describedby":T,role:"spinbutton","aria-valuenow":f,"aria-valuemin":r,"aria-valuemax":p,inputMode:j,autoComplete:"off",value:a,placeholder:w,disabled:A,error:h??I,helperText:x,trailingIcon:N,onChange:t=>{q(t.target.value)},onKeyDown:R})}exports.NumberField=k;
2
2
  //# sourceMappingURL=NumberField.cjs.map