@trinityui/design-system 2.11.1 → 2.13.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 (515) hide show
  1. package/CHANGELOG.md +2155 -0
  2. package/CONTRIBUTING.md +180 -69
  3. package/LICENSE +21 -0
  4. package/MIGRATION.md +505 -28
  5. package/README.md +281 -120
  6. package/dist/IllustratedMessage.js +546 -1341
  7. package/dist/accessibility.d.ts +596 -18
  8. package/dist/accessibility.d.ts.map +1 -1
  9. package/dist/accessibility.js +458 -0
  10. package/dist/app-shell.js +18458 -10385
  11. package/dist/assets/index.d.ts +1 -1
  12. package/dist/charts.js +8507 -6059
  13. package/dist/color-contrast.d.ts +35 -0
  14. package/dist/color-contrast.d.ts.map +1 -0
  15. package/dist/commonjs-helpers.js +8 -0
  16. package/dist/component-color-references.d.ts +175 -0
  17. package/dist/component-color-references.d.ts.map +1 -0
  18. package/dist/components/AI/AIActions.d.ts +72 -12
  19. package/dist/components/AI/AIActions.d.ts.map +1 -1
  20. package/dist/components/AI/AIAvatar.d.ts +31 -3
  21. package/dist/components/AI/AIAvatar.d.ts.map +1 -1
  22. package/dist/components/AI/AIChainOfThought.d.ts +159 -77
  23. package/dist/components/AI/AIChainOfThought.d.ts.map +1 -1
  24. package/dist/components/AI/AIChainOfThought.types.d.ts +292 -40
  25. package/dist/components/AI/AIChainOfThought.types.d.ts.map +1 -1
  26. package/dist/components/AI/AIChainOfThought.utils.d.ts +25 -7
  27. package/dist/components/AI/AIChainOfThought.utils.d.ts.map +1 -1
  28. package/dist/components/AI/AIChat.d.ts +12 -0
  29. package/dist/components/AI/AIChat.d.ts.map +1 -1
  30. package/dist/components/AI/AIChatWelcome.d.ts +254 -0
  31. package/dist/components/AI/AIChatWelcome.d.ts.map +1 -0
  32. package/dist/components/AI/AIClarificationPrompt.d.ts +134 -0
  33. package/dist/components/AI/AIClarificationPrompt.d.ts.map +1 -0
  34. package/dist/components/AI/AIConfidenceBadge.d.ts +117 -0
  35. package/dist/components/AI/AIConfidenceBadge.d.ts.map +1 -0
  36. package/dist/components/AI/AIConfigContext.d.ts +100 -0
  37. package/dist/components/AI/AIConfigContext.d.ts.map +1 -0
  38. package/dist/components/AI/AIConfigProvider.d.ts +66 -0
  39. package/dist/components/AI/AIConfigProvider.d.ts.map +1 -0
  40. package/dist/components/AI/AIContainer.d.ts +80 -11
  41. package/dist/components/AI/AIContainer.d.ts.map +1 -1
  42. package/dist/components/AI/AIExplainability.d.ts +39 -5
  43. package/dist/components/AI/AIExplainability.d.ts.map +1 -1
  44. package/dist/components/AI/AIFeedbackControl.d.ts +113 -0
  45. package/dist/components/AI/AIFeedbackControl.d.ts.map +1 -0
  46. package/dist/components/AI/AIFeedbackForm.d.ts +117 -0
  47. package/dist/components/AI/AIFeedbackForm.d.ts.map +1 -0
  48. package/dist/components/AI/AIFeedbackHostContext.d.ts +16 -0
  49. package/dist/components/AI/AIFeedbackHostContext.d.ts.map +1 -0
  50. package/dist/components/AI/AILabel.d.ts +39 -6
  51. package/dist/components/AI/AILabel.d.ts.map +1 -1
  52. package/dist/components/AI/AIMessage.d.ts +337 -42
  53. package/dist/components/AI/AIMessage.d.ts.map +1 -1
  54. package/dist/components/AI/AIPlanReview.d.ts +194 -0
  55. package/dist/components/AI/AIPlanReview.d.ts.map +1 -0
  56. package/dist/components/AI/AIQueryDisclosure.d.ts +119 -0
  57. package/dist/components/AI/AIQueryDisclosure.d.ts.map +1 -0
  58. package/dist/components/AI/AIRelatedQuestions.d.ts +50 -11
  59. package/dist/components/AI/AIRelatedQuestions.d.ts.map +1 -1
  60. package/dist/components/AI/AIResponseRenderer.d.ts +133 -21
  61. package/dist/components/AI/AIResponseRenderer.d.ts.map +1 -1
  62. package/dist/components/AI/AIResponseSourcesContext.d.ts +83 -0
  63. package/dist/components/AI/AIResponseSourcesContext.d.ts.map +1 -0
  64. package/dist/components/AI/AIReviewItem.d.ts +142 -0
  65. package/dist/components/AI/AIReviewItem.d.ts.map +1 -0
  66. package/dist/components/AI/AISourceChip.d.ts +135 -0
  67. package/dist/components/AI/AISourceChip.d.ts.map +1 -0
  68. package/dist/components/AI/AISources.d.ts +81 -11
  69. package/dist/components/AI/AISources.d.ts.map +1 -1
  70. package/dist/components/AI/AISourcesPanel.d.ts +43 -7
  71. package/dist/components/AI/AISourcesPanel.d.ts.map +1 -1
  72. package/dist/components/AI/AITextBlock.d.ts +104 -16
  73. package/dist/components/AI/AITextBlock.d.ts.map +1 -1
  74. package/dist/components/AI/AITextBlock.parser.d.ts +153 -0
  75. package/dist/components/AI/AITextBlock.parser.d.ts.map +1 -0
  76. package/dist/components/AI/AIVerificationBadge.d.ts +94 -0
  77. package/dist/components/AI/AIVerificationBadge.d.ts.map +1 -0
  78. package/dist/components/AI/AIVisuals.d.ts +92 -23
  79. package/dist/components/AI/AIVisuals.d.ts.map +1 -1
  80. package/dist/components/AI/AIVoiceInput.d.ts +42 -11
  81. package/dist/components/AI/AIVoiceInput.d.ts.map +1 -1
  82. package/dist/components/AI/AIVoiceMode.d.ts +16 -2
  83. package/dist/components/AI/AIVoiceMode.d.ts.map +1 -1
  84. package/dist/components/AI/BlockErrorBoundary.d.ts +77 -0
  85. package/dist/components/AI/BlockErrorBoundary.d.ts.map +1 -0
  86. package/dist/components/AI/ChatHeader.d.ts +41 -4
  87. package/dist/components/AI/ChatHeader.d.ts.map +1 -1
  88. package/dist/components/AI/ChatHistoryList.d.ts +25 -12
  89. package/dist/components/AI/ChatHistoryList.d.ts.map +1 -1
  90. package/dist/components/AI/ChatThread.d.ts +263 -13
  91. package/dist/components/AI/ChatThread.d.ts.map +1 -1
  92. package/dist/components/AI/InThreadContext.d.ts +14 -0
  93. package/dist/components/AI/InThreadContext.d.ts.map +1 -0
  94. package/dist/components/AI/InsightEngine.d.ts +270 -46
  95. package/dist/components/AI/InsightEngine.d.ts.map +1 -1
  96. package/dist/components/AI/InsightEngineInput.d.ts +47 -4
  97. package/dist/components/AI/InsightEngineInput.d.ts.map +1 -1
  98. package/dist/components/AI/MessageActionButton.d.ts +72 -0
  99. package/dist/components/AI/MessageActionButton.d.ts.map +1 -0
  100. package/dist/components/AI/QueryInput.d.ts.map +1 -1
  101. package/dist/components/AI/UserAvatar.d.ts +50 -4
  102. package/dist/components/AI/UserAvatar.d.ts.map +1 -1
  103. package/dist/components/AI/UserMessage.d.ts +32 -3
  104. package/dist/components/AI/UserMessage.d.ts.map +1 -1
  105. package/dist/components/AI/blockRendererContext.d.ts +64 -0
  106. package/dist/components/AI/blockRendererContext.d.ts.map +1 -0
  107. package/dist/components/AI/hitlBlockRenderers.d.ts +48 -0
  108. package/dist/components/AI/hitlBlockRenderers.d.ts.map +1 -0
  109. package/dist/components/AI/index.d.ts +23 -6
  110. package/dist/components/AI/index.d.ts.map +1 -1
  111. package/dist/components/AI/moleculeBlockRenderers.d.ts +15 -0
  112. package/dist/components/AI/moleculeBlockRenderers.d.ts.map +1 -0
  113. package/dist/components/AI/planReviewBlockRenderer.d.ts +8 -0
  114. package/dist/components/AI/planReviewBlockRenderer.d.ts.map +1 -0
  115. package/dist/components/AI/strings/defaults.d.ts +31 -0
  116. package/dist/components/AI/strings/defaults.d.ts.map +1 -0
  117. package/dist/components/AI/tokens.d.ts +185 -20
  118. package/dist/components/AI/tokens.d.ts.map +1 -1
  119. package/dist/components/AI/types/hitl.d.ts +2294 -0
  120. package/dist/components/AI/types/hitl.d.ts.map +1 -0
  121. package/dist/components/AI/types/index.d.ts +2 -1
  122. package/dist/components/AI/types/index.d.ts.map +1 -1
  123. package/dist/components/AI/types/response.d.ts +428 -40
  124. package/dist/components/AI/types/response.d.ts.map +1 -1
  125. package/dist/components/AI/useBlockSources.d.ts +67 -0
  126. package/dist/components/AI/useBlockSources.d.ts.map +1 -0
  127. package/dist/components/AI/useBrowserVoiceMode.d.ts +31 -2
  128. package/dist/components/AI/useBrowserVoiceMode.d.ts.map +1 -1
  129. package/dist/components/AI/useWelcomeComposerHandoff.d.ts +30 -0
  130. package/dist/components/AI/useWelcomeComposerHandoff.d.ts.map +1 -0
  131. package/dist/components/AI/utils/alphaIndex.d.ts +19 -0
  132. package/dist/components/AI/utils/alphaIndex.d.ts.map +1 -0
  133. package/dist/components/AI/utils/blockReady.d.ts +54 -0
  134. package/dist/components/AI/utils/blockReady.d.ts.map +1 -0
  135. package/dist/components/AI/utils/blocks.d.ts +28 -0
  136. package/dist/components/AI/utils/blocks.d.ts.map +1 -0
  137. package/dist/components/AI/utils/confidence.d.ts +182 -0
  138. package/dist/components/AI/utils/confidence.d.ts.map +1 -0
  139. package/dist/components/AI/utils/filters.d.ts +31 -0
  140. package/dist/components/AI/utils/filters.d.ts.map +1 -0
  141. package/dist/components/AI/utils/responseText.d.ts +8 -0
  142. package/dist/components/AI/utils/responseText.d.ts.map +1 -0
  143. package/dist/components/AI/utils/sources.d.ts +110 -0
  144. package/dist/components/AI/utils/sources.d.ts.map +1 -0
  145. package/dist/components/AIDigestCard/AIDigestCard.d.ts.map +1 -1
  146. package/dist/components/AIDigestCard/types.d.ts +42 -5
  147. package/dist/components/AIDigestCard/types.d.ts.map +1 -1
  148. package/dist/components/AppLayout/AIFab.d.ts +33 -6
  149. package/dist/components/AppLayout/AIFab.d.ts.map +1 -1
  150. package/dist/components/AppLayout/AIFabLayout.deprecated.d.ts.map +1 -1
  151. package/dist/components/AppLayout/AppLayout.d.ts +135 -7
  152. package/dist/components/AppLayout/AppLayout.d.ts.map +1 -1
  153. package/dist/components/AppLayout/InsightEnginePanel.d.ts +315 -21
  154. package/dist/components/AppLayout/InsightEnginePanel.d.ts.map +1 -1
  155. package/dist/components/AppLayout/ResizablePanel.d.ts +145 -8
  156. package/dist/components/AppLayout/ResizablePanel.d.ts.map +1 -1
  157. package/dist/components/AppLayout/ThreadHistorySidebar.d.ts +6 -0
  158. package/dist/components/AppLayout/ThreadHistorySidebar.d.ts.map +1 -1
  159. package/dist/components/AppLayout/index.d.ts +3 -3
  160. package/dist/components/AppLayout/index.d.ts.map +1 -1
  161. package/dist/components/AppLayout/insightEnginePanel.demo.d.ts +32 -0
  162. package/dist/components/AppLayout/insightEnginePanel.demo.d.ts.map +1 -0
  163. package/dist/components/AppLayout/panelPropsPath.d.ts +26 -0
  164. package/dist/components/AppLayout/panelPropsPath.d.ts.map +1 -0
  165. package/dist/components/AppLayout/panelResizeTransition.d.ts +49 -0
  166. package/dist/components/AppLayout/panelResizeTransition.d.ts.map +1 -0
  167. package/dist/components/AppLayout/toChatThreadMessage.d.ts +40 -0
  168. package/dist/components/AppLayout/toChatThreadMessage.d.ts.map +1 -0
  169. package/dist/components/AssessmentDrawer/AssessmentDrawer.d.ts +5 -1
  170. package/dist/components/AssessmentDrawer/AssessmentDrawer.d.ts.map +1 -1
  171. package/dist/components/AuditDrawer/AuditDrawer.d.ts +4 -3
  172. package/dist/components/AuditDrawer/AuditDrawer.d.ts.map +1 -1
  173. package/dist/components/AuditDrawer/index.d.ts +1 -1
  174. package/dist/components/AuditDrawer/index.d.ts.map +1 -1
  175. package/dist/components/AuditDrawer/types.d.ts +39 -5
  176. package/dist/components/AuditDrawer/types.d.ts.map +1 -1
  177. package/dist/components/Autocomplete/Autocomplete.d.ts +6 -1
  178. package/dist/components/Autocomplete/Autocomplete.d.ts.map +1 -1
  179. package/dist/components/BulkActionDock/BulkActionDock.d.ts.map +1 -1
  180. package/dist/components/Carousel/Carousel.d.ts +10 -2
  181. package/dist/components/Carousel/Carousel.d.ts.map +1 -1
  182. package/dist/components/Charts/AreaChart.d.ts.map +1 -1
  183. package/dist/components/Charts/BarChart.d.ts.map +1 -1
  184. package/dist/components/Charts/ChartWrapper.d.ts.map +1 -1
  185. package/dist/components/Charts/ComposedChart.d.ts.map +1 -1
  186. package/dist/components/Charts/CustomLegend.d.ts +11 -2
  187. package/dist/components/Charts/CustomLegend.d.ts.map +1 -1
  188. package/dist/components/Charts/LineChart.d.ts.map +1 -1
  189. package/dist/components/Charts/PieChart.d.ts.map +1 -1
  190. package/dist/components/Charts/RadialChart.d.ts.map +1 -1
  191. package/dist/components/Charts/ScatterChart.d.ts.map +1 -1
  192. package/dist/components/Charts/Sparkline.d.ts.map +1 -1
  193. package/dist/components/Charts/gaugeGeometry.d.ts +35 -0
  194. package/dist/components/Charts/gaugeGeometry.d.ts.map +1 -0
  195. package/dist/components/Charts/highcharts.d.ts +23 -0
  196. package/dist/components/Charts/highcharts.d.ts.map +1 -0
  197. package/dist/components/Charts/highchartsUtils.d.ts +101 -6
  198. package/dist/components/Charts/highchartsUtils.d.ts.map +1 -1
  199. package/dist/components/Charts/index.d.ts +1 -1
  200. package/dist/components/Charts/index.d.ts.map +1 -1
  201. package/dist/components/Charts/tokens.d.ts +21 -0
  202. package/dist/components/Charts/tokens.d.ts.map +1 -1
  203. package/dist/components/Charts/types.d.ts +7 -7
  204. package/dist/components/Charts/types.d.ts.map +1 -1
  205. package/dist/components/ChipsInput/ChipsInput.d.ts.map +1 -1
  206. package/dist/components/ChoiceChips/ChoiceChips.d.ts +106 -0
  207. package/dist/components/ChoiceChips/ChoiceChips.d.ts.map +1 -0
  208. package/dist/components/ClearableTextField/ClearableTextField.d.ts +23 -2
  209. package/dist/components/ClearableTextField/ClearableTextField.d.ts.map +1 -1
  210. package/dist/components/CodeBlock/CodeBlock.d.ts +80 -0
  211. package/dist/components/CodeBlock/CodeBlock.d.ts.map +1 -0
  212. package/dist/components/Combobox/Combobox.d.ts +3 -2
  213. package/dist/components/Combobox/Combobox.d.ts.map +1 -1
  214. package/dist/components/CommandPalette/CommandPalette.d.ts +54 -3
  215. package/dist/components/CommandPalette/CommandPalette.d.ts.map +1 -1
  216. package/dist/components/CommandPalette/index.d.ts +1 -1
  217. package/dist/components/CommandPalette/index.d.ts.map +1 -1
  218. package/dist/components/CopyButton/CopyButton.d.ts +80 -0
  219. package/dist/components/CopyButton/CopyButton.d.ts.map +1 -0
  220. package/dist/components/DataCard/DataCard.d.ts +11 -1
  221. package/dist/components/DataCard/DataCard.d.ts.map +1 -1
  222. package/dist/components/DataTable/CellRenderers.d.ts +8 -11
  223. package/dist/components/DataTable/CellRenderers.d.ts.map +1 -1
  224. package/dist/components/DataTable/DataTable.d.ts +1 -1
  225. package/dist/components/DataTable/DataTable.d.ts.map +1 -1
  226. package/dist/components/DataTable/InlineAddRow.d.ts.map +1 -1
  227. package/dist/components/DataTable/columnContext.d.ts +8 -0
  228. package/dist/components/DataTable/columnContext.d.ts.map +1 -0
  229. package/dist/components/DataTable/index.d.ts +2 -2
  230. package/dist/components/DataTable/index.d.ts.map +1 -1
  231. package/dist/components/DataTable/labels.d.ts +13 -0
  232. package/dist/components/DataTable/labels.d.ts.map +1 -0
  233. package/dist/components/DataTable/types.d.ts +34 -0
  234. package/dist/components/DataTable/types.d.ts.map +1 -1
  235. package/dist/components/DateRangePicker/DateRangePicker.d.ts.map +1 -1
  236. package/dist/components/DetailsPopover/DetailsPopover.d.ts +185 -0
  237. package/dist/components/DetailsPopover/DetailsPopover.d.ts.map +1 -0
  238. package/dist/components/DiffViewer/DiffViewer.d.ts +3 -2
  239. package/dist/components/DiffViewer/DiffViewer.d.ts.map +1 -1
  240. package/dist/components/Disclosure/Disclosure.d.ts +83 -0
  241. package/dist/components/Disclosure/Disclosure.d.ts.map +1 -0
  242. package/dist/components/DockLayout/DockLayout.d.ts +58 -0
  243. package/dist/components/DockLayout/DockLayout.d.ts.map +1 -1
  244. package/dist/components/DockLayout/index.d.ts +1 -1
  245. package/dist/components/DockLayout/index.d.ts.map +1 -1
  246. package/dist/components/DocumentCard/DocumentCard.d.ts +5 -1
  247. package/dist/components/DocumentCard/DocumentCard.d.ts.map +1 -1
  248. package/dist/components/EntityDetailPanel/EntityDetailPanel.d.ts +6 -2
  249. package/dist/components/EntityDetailPanel/EntityDetailPanel.d.ts.map +1 -1
  250. package/dist/components/FileUpload/FileUpload.d.ts +141 -6
  251. package/dist/components/FileUpload/FileUpload.d.ts.map +1 -1
  252. package/dist/components/FileUpload/index.d.ts +1 -1
  253. package/dist/components/FileUpload/index.d.ts.map +1 -1
  254. package/dist/components/FilterBar/FilterBar.d.ts +27 -1
  255. package/dist/components/FilterBar/FilterBar.d.ts.map +1 -1
  256. package/dist/components/FilterBar/index.d.ts +1 -1
  257. package/dist/components/FilterBar/index.d.ts.map +1 -1
  258. package/dist/components/FlowAutoLayout/useFlowAutoLayout.d.ts.map +1 -1
  259. package/dist/components/GanttView/GanttView.d.ts +24 -0
  260. package/dist/components/GanttView/GanttView.d.ts.map +1 -1
  261. package/dist/components/GanttView/types.d.ts +33 -7
  262. package/dist/components/GanttView/types.d.ts.map +1 -1
  263. package/dist/components/GaugeCard/GaugeCard.d.ts +4 -3
  264. package/dist/components/GaugeCard/GaugeCard.d.ts.map +1 -1
  265. package/dist/components/GaugeCard/geometry.d.ts +59 -0
  266. package/dist/components/GaugeCard/geometry.d.ts.map +1 -0
  267. package/dist/components/GeoStatusMap/GeoStatusMap.d.ts.map +1 -1
  268. package/dist/components/GeoStatusMap/types.d.ts +8 -5
  269. package/dist/components/GeoStatusMap/types.d.ts.map +1 -1
  270. package/dist/components/GoToTop/GoToTop.d.ts +1 -1
  271. package/dist/components/GoToTop/GoToTop.d.ts.map +1 -1
  272. package/dist/components/HierarchicalDrillDown/HierarchicalDrillDown.d.ts.map +1 -1
  273. package/dist/components/HistoricalDataIndicator/HistoricalDataIndicator.d.ts.map +1 -1
  274. package/dist/components/HtmlToMui/HtmlToMui.d.ts.map +1 -1
  275. package/dist/components/Icon.d.ts +567 -10
  276. package/dist/components/Icon.d.ts.map +1 -1
  277. package/dist/components/IllustratedMessage.d.ts +52 -3
  278. package/dist/components/IllustratedMessage.d.ts.map +1 -1
  279. package/dist/components/InlineEditableText/InlineEditableText.d.ts +117 -0
  280. package/dist/components/InlineEditableText/InlineEditableText.d.ts.map +1 -0
  281. package/dist/components/InsightCard/InsightCard.d.ts.map +1 -1
  282. package/dist/components/InsightCard/types.d.ts +10 -3
  283. package/dist/components/InsightCard/types.d.ts.map +1 -1
  284. package/dist/components/KeyValueList/KeyValueList.d.ts +94 -0
  285. package/dist/components/KeyValueList/KeyValueList.d.ts.map +1 -0
  286. package/dist/components/LandingPage/FeatureCard.d.ts +4 -0
  287. package/dist/components/LandingPage/FeatureCard.d.ts.map +1 -1
  288. package/dist/components/LandingPage/LandingPage.d.ts +43 -4
  289. package/dist/components/LandingPage/LandingPage.d.ts.map +1 -1
  290. package/dist/components/LandingPage/heroTone.d.ts +54 -0
  291. package/dist/components/LandingPage/heroTone.d.ts.map +1 -0
  292. package/dist/components/MentionsInput/MentionsInput.d.ts.map +1 -1
  293. package/dist/components/MetaChip/MetaChip.d.ts +113 -0
  294. package/dist/components/MetaChip/MetaChip.d.ts.map +1 -0
  295. package/dist/components/Modal/Modal.d.ts +222 -20
  296. package/dist/components/Modal/Modal.d.ts.map +1 -1
  297. package/dist/components/Modal/index.d.ts +1 -1
  298. package/dist/components/Modal/index.d.ts.map +1 -1
  299. package/dist/components/NotificationCenter/NotificationCenter.d.ts.map +1 -1
  300. package/dist/components/OrgChart/OrgChart.d.ts +5 -0
  301. package/dist/components/OrgChart/OrgChart.d.ts.map +1 -1
  302. package/dist/components/OrgChart/types.d.ts +31 -7
  303. package/dist/components/OrgChart/types.d.ts.map +1 -1
  304. package/dist/components/OverflowTooltip/OverflowTooltip.d.ts +1 -1
  305. package/dist/components/OverflowTooltip/OverflowTooltip.d.ts.map +1 -1
  306. package/dist/components/PageHeader/PageHeader.d.ts.map +1 -1
  307. package/dist/components/PageTOC/PageTOC.d.ts +2 -1
  308. package/dist/components/PageTOC/PageTOC.d.ts.map +1 -1
  309. package/dist/components/Popper/Popper.d.ts +80 -9
  310. package/dist/components/Popper/Popper.d.ts.map +1 -1
  311. package/dist/components/Popper/index.d.ts +1 -1
  312. package/dist/components/Popper/index.d.ts.map +1 -1
  313. package/dist/components/PredictiveTextInput/PredictiveTextInput.d.ts +5 -1
  314. package/dist/components/PredictiveTextInput/PredictiveTextInput.d.ts.map +1 -1
  315. package/dist/components/SearchInput/SearchInput.d.ts +49 -0
  316. package/dist/components/SearchInput/SearchInput.d.ts.map +1 -1
  317. package/dist/components/SearchInput/index.d.ts +1 -1
  318. package/dist/components/SearchInput/index.d.ts.map +1 -1
  319. package/dist/components/SimpleTable/SimpleTable.d.ts +11 -2
  320. package/dist/components/SimpleTable/SimpleTable.d.ts.map +1 -1
  321. package/dist/components/SplitPane/SplitPane.d.ts +2 -1
  322. package/dist/components/SplitPane/SplitPane.d.ts.map +1 -1
  323. package/dist/components/StatusHero/StatusHero.d.ts.map +1 -1
  324. package/dist/components/StatusIndicator/Badge.d.ts +6 -1
  325. package/dist/components/StatusIndicator/Badge.d.ts.map +1 -1
  326. package/dist/components/StatusIndicator/Chip.d.ts +3 -1
  327. package/dist/components/StatusIndicator/Chip.d.ts.map +1 -1
  328. package/dist/components/StatusIndicator/Indicators.d.ts +5 -1
  329. package/dist/components/StatusIndicator/Indicators.d.ts.map +1 -1
  330. package/dist/components/StatusIndicator/Legend.d.ts.map +1 -1
  331. package/dist/components/StatusIndicator/StatusIndicator.d.ts +98 -4
  332. package/dist/components/StatusIndicator/StatusIndicator.d.ts.map +1 -1
  333. package/dist/components/StatusIndicator/index.d.ts +2 -2
  334. package/dist/components/StatusIndicator/index.d.ts.map +1 -1
  335. package/dist/components/StatusIndicator/types.d.ts +48 -1
  336. package/dist/components/StatusIndicator/types.d.ts.map +1 -1
  337. package/dist/components/StepList/StepList.d.ts +80 -0
  338. package/dist/components/StepList/StepList.d.ts.map +1 -0
  339. package/dist/components/StepList/StepStatusMarker.d.ts +39 -0
  340. package/dist/components/StepList/StepStatusMarker.d.ts.map +1 -0
  341. package/dist/components/StepList/stepStatus.d.ts +30 -0
  342. package/dist/components/StepList/stepStatus.d.ts.map +1 -0
  343. package/dist/components/SystemBanner/SystemBanner.d.ts.map +1 -1
  344. package/dist/components/Timeline/Timeline.d.ts +57 -3
  345. package/dist/components/Timeline/Timeline.d.ts.map +1 -1
  346. package/dist/components/Timeline/index.d.ts +1 -1
  347. package/dist/components/Timeline/index.d.ts.map +1 -1
  348. package/dist/components/Timeline/timelineLabels.d.ts +70 -0
  349. package/dist/components/Timeline/timelineLabels.d.ts.map +1 -0
  350. package/dist/components/Toast/Toast.d.ts.map +1 -1
  351. package/dist/components/TopNavHeader.d.ts +6 -0
  352. package/dist/components/TopNavHeader.d.ts.map +1 -1
  353. package/dist/components/TopNavWithSidebar.d.ts +49 -1
  354. package/dist/components/TopNavWithSidebar.d.ts.map +1 -1
  355. package/dist/components/Tour/Tour.d.ts +18 -1
  356. package/dist/components/Tour/Tour.d.ts.map +1 -1
  357. package/dist/components/TransferList/TransferList.d.ts +123 -4
  358. package/dist/components/TransferList/TransferList.d.ts.map +1 -1
  359. package/dist/components/TransferList/index.d.ts +1 -1
  360. package/dist/components/TransferList/index.d.ts.map +1 -1
  361. package/dist/components/TreeView/TreeView.d.ts +97 -8
  362. package/dist/components/TreeView/TreeView.d.ts.map +1 -1
  363. package/dist/components/TreeView/index.d.ts +1 -1
  364. package/dist/components/TreeView/index.d.ts.map +1 -1
  365. package/dist/components/TrinityLoader.d.ts.map +1 -1
  366. package/dist/components/icons/featherExtensions.d.ts +55 -0
  367. package/dist/components/icons/featherExtensions.d.ts.map +1 -0
  368. package/dist/components/icons/materialExtensions.d.ts +20 -0
  369. package/dist/components/icons/materialExtensions.d.ts.map +1 -0
  370. package/dist/components/internal/index.d.ts +87 -0
  371. package/dist/components/internal/index.d.ts.map +1 -1
  372. package/dist/components/navigation/MenuListWithHeading.d.ts +33 -0
  373. package/dist/components/navigation/MenuListWithHeading.d.ts.map +1 -0
  374. package/dist/components/navigation/clientSelectorLabels.d.ts +13 -0
  375. package/dist/components/navigation/clientSelectorLabels.d.ts.map +1 -0
  376. package/dist/components/navigation/components.d.ts +6 -0
  377. package/dist/components/navigation/components.d.ts.map +1 -1
  378. package/dist/components/shared/AsyncOutcomeAlert.d.ts +91 -0
  379. package/dist/components/shared/AsyncOutcomeAlert.d.ts.map +1 -0
  380. package/dist/components/shared/TrinityIconSvg.d.ts.map +1 -1
  381. package/dist/components/shared/TrinityLogoSvg.d.ts.map +1 -1
  382. package/dist/components/shared/bidi.d.ts +44 -0
  383. package/dist/components/shared/bidi.d.ts.map +1 -0
  384. package/dist/components/shared/bidiText.d.ts +25 -0
  385. package/dist/components/shared/bidiText.d.ts.map +1 -0
  386. package/dist/components/shared/containerQueries.d.ts +73 -0
  387. package/dist/components/shared/containerQueries.d.ts.map +1 -0
  388. package/dist/components/shared/createStringsContext.d.ts +69 -0
  389. package/dist/components/shared/createStringsContext.d.ts.map +1 -0
  390. package/dist/components/shared/direction.d.ts +46 -0
  391. package/dist/components/shared/direction.d.ts.map +1 -0
  392. package/dist/components/shared/focusTrap.d.ts +36 -0
  393. package/dist/components/shared/focusTrap.d.ts.map +1 -0
  394. package/dist/components/shared/getInitials.d.ts +29 -0
  395. package/dist/components/shared/getInitials.d.ts.map +1 -0
  396. package/dist/components/shared/headingLevel.d.ts +69 -0
  397. package/dist/components/shared/headingLevel.d.ts.map +1 -0
  398. package/dist/components/shared/mergeSlotProps.d.ts +50 -0
  399. package/dist/components/shared/mergeSlotProps.d.ts.map +1 -0
  400. package/dist/components/shared/mergeSx.d.ts +26 -0
  401. package/dist/components/shared/mergeSx.d.ts.map +1 -0
  402. package/dist/components/shared/motion.d.ts +110 -0
  403. package/dist/components/shared/motion.d.ts.map +1 -0
  404. package/dist/components/shared/occurrenceKeys.d.ts +23 -0
  405. package/dist/components/shared/occurrenceKeys.d.ts.map +1 -0
  406. package/dist/components/shared/primaryAction.d.ts +89 -0
  407. package/dist/components/shared/primaryAction.d.ts.map +1 -0
  408. package/dist/components/shared/resizeKeyboard.d.ts +68 -0
  409. package/dist/components/shared/resizeKeyboard.d.ts.map +1 -0
  410. package/dist/components/shared/rootProps.d.ts +117 -0
  411. package/dist/components/shared/rootProps.d.ts.map +1 -0
  412. package/dist/components/shared/safeContent.d.ts +9 -2
  413. package/dist/components/shared/safeContent.d.ts.map +1 -1
  414. package/dist/components/shared/targetSize.d.ts +64 -0
  415. package/dist/components/shared/targetSize.d.ts.map +1 -0
  416. package/dist/components/shared/useContainerInlineSize.d.ts +43 -0
  417. package/dist/components/shared/useContainerInlineSize.d.ts.map +1 -0
  418. package/dist/components/shared/useCopyAction.d.ts +35 -0
  419. package/dist/components/shared/useCopyAction.d.ts.map +1 -0
  420. package/dist/components/shared/useOverflow.d.ts +44 -0
  421. package/dist/components/shared/useOverflow.d.ts.map +1 -0
  422. package/dist/components/shared/useResizable.d.ts +106 -7
  423. package/dist/components/shared/useResizable.d.ts.map +1 -1
  424. package/dist/components/shared/warnDeprecated.d.ts +89 -15
  425. package/dist/components/shared/warnDeprecated.d.ts.map +1 -1
  426. package/dist/components/shared/zIndexRoles.d.ts +62 -0
  427. package/dist/components/shared/zIndexRoles.d.ts.map +1 -0
  428. package/dist/components/templates/AIReviewQueue/AIReviewQueueTemplate.d.ts +213 -0
  429. package/dist/components/templates/AIReviewQueue/AIReviewQueueTemplate.d.ts.map +1 -0
  430. package/dist/components/templates/AIReviewQueue/index.d.ts +2 -0
  431. package/dist/components/templates/AIReviewQueue/index.d.ts.map +1 -0
  432. package/dist/components/templates/Auth/AuthTemplate.d.ts.map +1 -1
  433. package/dist/components/templates/Auth/types.d.ts +4 -1
  434. package/dist/components/templates/Auth/types.d.ts.map +1 -1
  435. package/dist/components/templates/Catalog/CatalogTemplate.d.ts.map +1 -1
  436. package/dist/components/templates/ConnectorWizard/ConnectorWizardTemplate.d.ts.map +1 -1
  437. package/dist/components/templates/InsightsCenter/InsightsCenterTemplate.d.ts.map +1 -1
  438. package/dist/components/templates/IntegrationDetail/IntegrationDetailTemplate.d.ts.map +1 -1
  439. package/dist/components/templates/ListDetail/ListDetailTemplate.d.ts +168 -10
  440. package/dist/components/templates/ListDetail/ListDetailTemplate.d.ts.map +1 -1
  441. package/dist/components/templates/ListDetail/index.d.ts +1 -1
  442. package/dist/components/templates/ListDetail/index.d.ts.map +1 -1
  443. package/dist/components/templates/ListDetail/listDetailLabels.d.ts +106 -0
  444. package/dist/components/templates/ListDetail/listDetailLabels.d.ts.map +1 -0
  445. package/dist/components/templates/Onboarding/OnboardingTemplate.d.ts.map +1 -1
  446. package/dist/components/templates/Settings/SettingsTemplate.d.ts +0 -3
  447. package/dist/components/templates/Settings/SettingsTemplate.d.ts.map +1 -1
  448. package/dist/components/templates/Wizard/WizardTemplate.d.ts +4 -1
  449. package/dist/components/templates/Wizard/WizardTemplate.d.ts.map +1 -1
  450. package/dist/components/templates/index.d.ts +2 -1
  451. package/dist/components/templates/index.d.ts.map +1 -1
  452. package/dist/data-table.d.ts +1 -1
  453. package/dist/data-table.d.ts.map +1 -1
  454. package/dist/data-table.js +1 -0
  455. package/dist/data-table2.js +13522 -13465
  456. package/dist/data.js +213 -194
  457. package/dist/elk.bundled.js +47371 -0
  458. package/dist/essentials.d.ts +3 -3
  459. package/dist/essentials.d.ts.map +1 -1
  460. package/dist/essentials.js +179 -147
  461. package/dist/focus-on-replace.js +49 -0
  462. package/dist/form.d.ts +26 -4
  463. package/dist/form.d.ts.map +1 -1
  464. package/dist/forms.js +575 -483
  465. package/dist/foundation.js +3704 -0
  466. package/dist/hooks/storageStore.d.ts +51 -0
  467. package/dist/hooks/storageStore.d.ts.map +1 -0
  468. package/dist/hooks/useAsyncAction.d.ts +65 -0
  469. package/dist/hooks/useAsyncAction.d.ts.map +1 -0
  470. package/dist/hooks/useDisclosure.d.ts +190 -0
  471. package/dist/hooks/useDisclosure.d.ts.map +1 -0
  472. package/dist/hooks/useFocusOnReplace.d.ts +95 -0
  473. package/dist/hooks/useFocusOnReplace.d.ts.map +1 -0
  474. package/dist/hooks/useTrinityPalette.d.ts +38 -40
  475. package/dist/hooks/useTrinityPalette.d.ts.map +1 -1
  476. package/dist/hooks.d.ts +44 -6
  477. package/dist/hooks.d.ts.map +1 -1
  478. package/dist/hooks.js +301 -0
  479. package/dist/index.d.ts +71 -26
  480. package/dist/index.d.ts.map +1 -1
  481. package/dist/index.js +13923 -60619
  482. package/dist/patterns/AICopilotPattern/AICopilotPattern.d.ts +203 -0
  483. package/dist/patterns/AICopilotPattern/AICopilotPattern.d.ts.map +1 -0
  484. package/dist/patterns/AICopilotPattern/index.d.ts +3 -0
  485. package/dist/patterns/AICopilotPattern/index.d.ts.map +1 -0
  486. package/dist/patterns/index.d.ts +15 -0
  487. package/dist/patterns/index.d.ts.map +1 -0
  488. package/dist/presets/analytics.d.ts +8 -1
  489. package/dist/presets/analytics.d.ts.map +1 -1
  490. package/dist/presets/crm.d.ts +8 -1
  491. package/dist/presets/crm.d.ts.map +1 -1
  492. package/dist/presets/index.d.ts +1 -1
  493. package/dist/presets/portal.d.ts +8 -1
  494. package/dist/presets/portal.d.ts.map +1 -1
  495. package/dist/safe-content.js +69 -69
  496. package/dist/theme-augmentation.d.ts +388 -0
  497. package/dist/theme-augmentation.d.ts.map +1 -0
  498. package/dist/theme.d.ts +116 -30
  499. package/dist/theme.d.ts.map +1 -1
  500. package/dist/theme.js +891 -436
  501. package/dist/token-color.d.ts +14 -0
  502. package/dist/token-color.d.ts.map +1 -0
  503. package/dist/token-merge.d.ts +56 -0
  504. package/dist/token-merge.d.ts.map +1 -0
  505. package/dist/token-serialization.d.ts +65 -0
  506. package/dist/token-serialization.d.ts.map +1 -0
  507. package/dist/tokens.d.ts +882 -13
  508. package/dist/tokens.d.ts.map +1 -1
  509. package/dist/tokens.js +21 -19
  510. package/dist/trinity.css +1077 -414
  511. package/package.json +111 -90
  512. package/dist/components/index.d.ts +0 -145
  513. package/dist/components/index.d.ts.map +0 -1
  514. package/dist/components/shared.d.ts +0 -92
  515. package/dist/components/shared.d.ts.map +0 -1
@@ -0,0 +1,119 @@
1
+ /**
2
+ * @fileoverview AIQueryDisclosure: the query behind an AI answer, shown on demand (master-plan F-14).
3
+ * @module components/AI/AIQueryDisclosure
4
+ *
5
+ * A thin composition of the shared blocks (no local reimplementation):
6
+ *
7
+ * - **Trigger.** D's Disclosure (useDisclosure's inline mode): a `<button type="button">` with
8
+ * `aria-expanded` and `aria-controls`. The label is constant ('Query', or 'SQL query' through
9
+ * `titleWithLanguage`); `aria-expanded` carries the state and the label never toggles (APG).
10
+ * No heading by default (ADR-19); `headingLevel` wraps the trigger in one.
11
+ * - **Code.** D's CodeBlock: `<pre dir="ltr"><code>`, so the query never mirrors in a
12
+ * right-to-left page. While it scrolls it is a focusable group named `codeLabel` (axe
13
+ * scrollable-region-focusable). The code area scrolls past `maxHeight`
14
+ * (default `theme.spacing(40)`).
15
+ * - **Copy.** D's CopyButton after the code (Tab reaches the code, then the button): the copy goes
16
+ * through `useClipboard` (useCopyAction); 'Query copied' or 'Copy failed' is announced once.
17
+ * `onCopy(query)` runs after a successful write, and `AICopyInteraction { success }` is
18
+ * reported to AIConfigProvider either way.
19
+ * - **Metadata.** D's KeyValueList (inline tiles): rows, duration (Intl.NumberFormat, unit
20
+ * 'second'), dataset, dialect and executed-at (`useFormatAsOf`: the provider's time zone, else
21
+ * 'UTC' while hydrating, so server and client agree). An inner container query stacks the
22
+ * tiles below the 'compact' container width (E-19).
23
+ * - **Streaming.** A Skeleton replaces the code; the trigger is `aria-disabled` and described by
24
+ * the visible reason ('The query is still being generated'). Nothing is announced.
25
+ * - **Empty.** An empty query that is not streaming renders nothing, with one development warning
26
+ * from an effect (ADR-30).
27
+ * - **Reveal.** With `metadata.queryId` inside a response (AIResponseSourcesProvider, F-08), the
28
+ * view registers `{ reveal }`: a source chip's 'Show query' opens it and, after the open
29
+ * commit, moves focus to its trigger.
30
+ * - **Naming.** `expanded`, `defaultExpanded` and `onExpandedChange(expanded, event?)` follow the
31
+ * AI family (AISourcesPanel) with the ADR-04 (9) event argument; they map onto useDisclosure's
32
+ * open state (the NAMING exception, F-20).
33
+ * - **Telemetry.** `AIQueryViewInteraction` on expand and collapse; never the query text.
34
+ *
35
+ * @example
36
+ * ```tsx
37
+ * import { AIQueryDisclosure } from '@trinityui/design-system';
38
+ *
39
+ * <AIQueryDisclosure
40
+ * query="SELECT region, SUM(net) FROM revenue GROUP BY region"
41
+ * language="SQL"
42
+ * metadata={{ rowCount: 4, durationMs: 845, dataset: 'finance.revenue' }}
43
+ * />
44
+ * ```
45
+ */
46
+ import * as React from 'react';
47
+ import { type SxProps, type Theme } from '@mui/material/styles';
48
+ import type { HeadingLevel } from '../shared/headingLevel';
49
+ import { type TrinitySlotProps } from '../shared/rootProps';
50
+ import type { AIQueryMetadata } from './types/hitl';
51
+ /**
52
+ * AIQueryDisclosure's own props.
53
+ *
54
+ * @since 2.13.0
55
+ */
56
+ export interface AIQueryDisclosureOwnProps {
57
+ /** The query text, as it ran. An empty query renders nothing unless `streaming`. */
58
+ query: string;
59
+ /**
60
+ * The query language as shown, for example 'SQL'. The trigger reads 'SQL query' and the
61
+ * scrolling code area is named 'SQL query text'.
62
+ */
63
+ language?: string;
64
+ /** The trigger label. It never changes with the state. @default 'Query' (or `titleWithLanguage`) */
65
+ title?: string;
66
+ /** Facts about the run: row count, duration, dataset, dialect, when it ran, and its `queryId`. */
67
+ metadata?: AIQueryMetadata;
68
+ /** Controlled expansion. */
69
+ expanded?: boolean;
70
+ /** Initial expansion when uncontrolled. @default false */
71
+ defaultExpanded?: boolean;
72
+ /**
73
+ * Called with the requested expansion and, when the user caused it, the event. A reveal from a
74
+ * source chip's 'Show query' has no event.
75
+ */
76
+ onExpandedChange?: (expanded: boolean, event?: React.SyntheticEvent) => void;
77
+ /** The code area scrolls vertically beyond this height. @default theme.spacing(40) */
78
+ maxHeight?: number | string;
79
+ /**
80
+ * The query is still being generated: a Skeleton replaces the code and the trigger is
81
+ * `aria-disabled` with its visible reason. Adapters map a block's `status` onto it.
82
+ * @default false
83
+ */
84
+ streaming?: boolean;
85
+ /** Called with the query after it was written to the clipboard. */
86
+ onCopy?: (query: string) => void | Promise<void>;
87
+ /** Id of the response block that holds the query, reported with the interactions. */
88
+ blockId?: string;
89
+ /** Wraps the trigger in a heading of this level. No heading by default (ADR-19). */
90
+ headingLevel?: HeadingLevel;
91
+ className?: string;
92
+ sx?: SxProps<Theme>;
93
+ /**
94
+ * Props for the parts (ADR-04 (6)): `trigger` (the disclosure button), `panel` (the region it
95
+ * shows), `code` (the `<pre>`), `metadata` (the `<dl>`) and `copyButton`.
96
+ */
97
+ slotProps?: {
98
+ trigger?: TrinitySlotProps<HTMLButtonElement>;
99
+ panel?: TrinitySlotProps<HTMLDivElement>;
100
+ code?: TrinitySlotProps<HTMLPreElement>;
101
+ metadata?: TrinitySlotProps<HTMLDListElement>;
102
+ copyButton?: TrinitySlotProps<HTMLButtonElement>;
103
+ };
104
+ }
105
+ /**
106
+ * Props of {@link AIQueryDisclosure}: its own props plus the root `<div>`'s HTML attributes
107
+ * (ADR-04).
108
+ *
109
+ * @since 2.13.0
110
+ */
111
+ export type AIQueryDisclosureProps = AIQueryDisclosureOwnProps & Omit<React.HTMLAttributes<HTMLDivElement>, 'color' | 'title' | keyof AIQueryDisclosureOwnProps>;
112
+ /**
113
+ * The query behind an AI answer, shown on demand: a disclosure with the query as left-to-right
114
+ * code, a copy button and the run's metadata. See the module notes.
115
+ *
116
+ * @since 2.13.0
117
+ */
118
+ export declare const AIQueryDisclosure: React.ForwardRefExoticComponent<AIQueryDisclosureOwnProps & Omit<React.HTMLAttributes<HTMLDivElement>, "color" | keyof AIQueryDisclosureOwnProps> & React.RefAttributes<HTMLDivElement>>;
119
+ //# sourceMappingURL=AIQueryDisclosure.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AIQueryDisclosure.d.ts","sourceRoot":"","sources":["../../../src/components/AI/AIQueryDisclosure.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AACH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAY,KAAK,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAS1E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAG3D,OAAO,EAAgB,KAAK,gBA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CAAC,CAAC;QAC9C,UAAU,CAAC,EAAE,gBAAgB,CAAC,iBAAiB,CAAC,CAAC;KAClD,CAAC;CACH;AAED;;;;;GAKG;AACH,MAAM,MAAM,sBAAsB,GAAG,yBAAyB,GAC5D,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,OAAO,GAAG,OAAO,GAAG,MAAM,yBAAyB,CAAC,CAAC;AA4ClG;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,0LAgK5B,CAAC"}
@@ -2,28 +2,56 @@
2
2
  * @fileoverview AIRelatedQuestions component.
3
3
  * @module components/AI/AIRelatedQuestions
4
4
  * AI Related Questions Component
5
- * Collapsible panel displaying related/follow-up questions with filled background surface
5
+ * Collapsible panel displaying related/follow-up questions with filled background surface.
6
+ * A question is a string or an {@link AIRelatedQuestion}; a verified one shows the
7
+ * AIVerificationBadge ('Verified', glyph and text) after its text (G-24a).
6
8
  *
7
9
  * @example
8
10
  * ```tsx
9
11
  * import { AIRelatedQuestions } from '@trinityui/design-system';
10
12
  *
11
13
  * <AIRelatedQuestions
12
- * questions="Example"
14
+ * questions={['Compare by region', { id: 'q4', text: 'Project Q4', verified: true }]}
15
+ * onQuestionSelect={(question, index) => ask(question.text)}
13
16
  * />
14
17
  * ```
15
18
  */
16
19
  import React from 'react';
17
20
  import { SxProps, Theme } from '@mui/material';
21
+ import { type TrinityRootProps } from '../shared/rootProps';
18
22
  /**
19
- * Props for AIRelatedQuestions component.
23
+ * One related question, when it carries more than its text (G-24a).
24
+ * @since 2.13.0
20
25
  */
21
- export interface AIRelatedQuestionsProps {
22
- /** List of related questions */
23
- questions: string[];
24
- /** Callback when a question is clicked */
26
+ export interface AIRelatedQuestion {
27
+ /** A stable id, used as the list key. Without one the key is the text and its occurrence. */
28
+ id?: string;
29
+ /** The question: shown, and passed to `onQuestionClick`. */
30
+ text: string;
31
+ /**
32
+ * A pre-checked suggestion (R15): the verification badge ('Verified', a glyph and the word,
33
+ * never colour alone) follows the text and is part of the button's name.
34
+ */
35
+ verified?: boolean;
36
+ }
37
+ /**
38
+ * AIRelatedQuestions' own props.
39
+ */
40
+ export interface AIRelatedQuestionsOwnProps {
41
+ /**
42
+ * List of related questions: strings, or {@link AIRelatedQuestion} objects (since 2.13.0)
43
+ * for an id and the verified flag. Both can be mixed.
44
+ */
45
+ questions: Array<string | AIRelatedQuestion>;
46
+ /** Callback when a question is clicked: the question's text. */
25
47
  onQuestionClick?: (question: string) => void;
26
- /** Panel title */
48
+ /**
49
+ * Callback when a question is clicked: the question (a string is passed as `{ text }`) and its
50
+ * index. Fires alongside `onQuestionClick`.
51
+ * @since 2.13.0
52
+ */
53
+ onQuestionSelect?: (question: AIRelatedQuestion, index: number) => void;
54
+ /** Panel title. Default: the `ai.relatedQuestions.title` string ('Related questions'). */
27
55
  title?: string;
28
56
  /** Whether panel is initially expanded */
29
57
  defaultExpanded?: boolean;
@@ -31,15 +59,26 @@ export interface AIRelatedQuestionsProps {
31
59
  expanded?: boolean;
32
60
  /** Callback when expanded state changes */
33
61
  onExpandedChange?: (expanded: boolean) => void;
34
- /** Empty state title when no questions */
62
+ /** Empty state title when no questions. Default: `ai.relatedQuestions.emptyTitle`. */
35
63
  emptyTitle?: string;
36
- /** Empty state description */
64
+ /** Empty state description. Default: `ai.relatedQuestions.emptyDescription`. */
37
65
  emptyDescription?: string;
38
66
  /** Show empty state instead of hiding */
39
67
  showEmpty?: boolean;
40
- /** Custom sx props */
68
+ /**
69
+ * Added to the root's own class names.
70
+ * @since 2.13.0
71
+ */
72
+ className?: string;
73
+ /** Custom sx props, applied after the panel's own styles (object, array or function). */
41
74
  sx?: SxProps<Theme>;
42
75
  }
76
+ /**
77
+ * Props for AIRelatedQuestions: its own props, plus the HTML attributes of its root `div`
78
+ * (`id`, `data-*`, `aria-*`), which reach the root (ADR-04, WI-40).
79
+ */
80
+ export interface AIRelatedQuestionsProps extends AIRelatedQuestionsOwnProps, TrinityRootProps<HTMLDivElement, AIRelatedQuestionsOwnProps> {
81
+ }
43
82
  /**
44
83
  * AI Related Questions - Collapsible panel with clickable follow-up questions
45
84
  * Features:
@@ -1 +1 @@
1
- {"version":3,"file":"AIRelatedQuestions.d.ts","sourceRoot":"","sources":["../../../src/components/AI/AIRelatedQuestions.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAmB,MAAM,OAAO,CAAC;AACxC,OAAO,EAWL,OAAO,EACP,KAAK,EACN,MAAM,eAAe,CAAC;AAQvB;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC,gCAAgC;IAChC,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,0CAA0C;IAC1C,eAAe,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7C,kBAAkB;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,0CAA0C;IAC1C,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,gCAAgC;IAChC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,2CAA2C;IAC3C,gBAAgB,CAAC,EAAE,CAAC,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAC;IAC/C,0CAA0C;IAC1C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,8BAA8B;IAC9B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,yCAAyC;IACzC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,sBAAsB;IACtB,EAAE,CAAC,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC;CACrB;AAMD;;;;;;;GAOG;AACH,eAAO,MAAM,kBAAkB,gGAiM9B,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
1
+ {"version":3,"file":"AIRelatedQuestions.d.ts","sourceRoot":"","sources":["../../../src/components/AI/AIRelatedQuestions.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAUL,O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M5I;;;;;;;GAOG;AACH,eAAO,MAAM,kBAAkB,gGA4M9B,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
@@ -5,48 +5,160 @@
5
5
  * Iterates over `AIResponse.blocks` and dispatches each block to a renderer.
6
6
  * Pure rendering — no layout wrapper, no business logic, no AIMessage chrome.
7
7
  *
8
- * **Block types supported natively:**
9
- * - `text` — rendered via `AITextBlock`
8
+ * **Resolution order** (ADR-05 (2)), for each block, the first step that answers wins:
9
+ * 1. `renderBlock(block)`: a node renders, `null` skips the block, `undefined` falls through
10
+ * (`onRenderBlock` is its deprecated alias; `renderBlock` wins when both are passed);
11
+ * 2. `blockRenderers[block.type]`: a block renderer component (`null` skips the block);
12
+ * 3. the renderers a host provides (ChatThread and the other organisms; `null` skips the block);
13
+ * 4. the built-in renderer: `text` blocks render through `AITextBlock`;
14
+ * 5. nothing: the block is skipped, with one development warning per block type.
10
15
  *
11
- * **Everything else** (table / chart / image / form / actions / custom types)
12
- * goes through the `onRenderBlock` escape hatch, giving the consumer full
13
- * control over rendering. If `onRenderBlock` is not provided and the block
14
- * type is not `text`, the block is skipped with a console warning.
16
+ * Table, chart, image, form and actions blocks are consumer-rendered. The interactive blocks
17
+ * (query, clarification, plan-review) render through block renderers, which receive
18
+ * `onBlockEvent`, `readOnly` and `onActionError`.
15
19
  *
16
- * This design keeps the component focused (text-only natively) while giving
17
- * consumers a clean extension point. The previous version embedded hard-coded
18
- * placeholders for block types that were never implemented — those are now
19
- * the consumer's responsibility via `onRenderBlock`.
20
+ * **Ids.** A block id comes from the model, so it is data, never a DOM id: each block's root
21
+ * carries `data-block-id={block.id}` and the DOM id `getBlockDomId(idPrefix, block.id)` (G-OD12).
22
+ * Equal ids inside one response still get their own React keys and DOM ids.
23
+ *
24
+ * **Sources.** The renderer provides the response's `sources` to its blocks, so a consumer table
25
+ * or chart renderer reads a cell's or point's sources with `useBlockSources(block.id)` (F-08).
26
+ * Text blocks with `citations: true` render their `[^id]` markers as source chips numbered by
27
+ * `response.sources` (F-13, G-37+). While `streaming`, a marker that names no source yet is
28
+ * hidden instead of shown as written; when the response completes the markers resolve in place.
29
+ *
30
+ * **Headings.** `headingOffset` moves markdown headings down (`#` becomes h2 with 1). It defaults
31
+ * to 1 inside a ChatThread, so a response's `#` is never the page's h1 there, and to 0 standalone.
32
+ *
33
+ * **Error** (G-34, G-OD8): `response.error` renders after the blocks as an inline error Alert
34
+ * titled 'This response failed' (`ai.responseRenderer.errorTitle`), with `error.message` as plain
35
+ * text. The Alert has no live role: standalone, the renderer announces the title and message
36
+ * once, assertively, through `useAnnounce`; inside a thread (InThreadContext) it announces
37
+ * nothing, because the thread's log reads the added content. Retry belongs to AIMessage's footer.
38
+ *
39
+ * **Isolation** (G-39+): each block renders inside its own error boundary. A block whose renderer
40
+ * throws shows 'This part of the response is unavailable' (`ai.responseRenderer.blockUnavailable`)
41
+ * in its place, read-only and not live, and `onBlockError` reports it; the other blocks and
42
+ * messages keep rendering. A text block whose `content` is not a string shows the same state.
43
+ *
44
+ * **Diagnostics** (development only, once each, from effects): a block type with no renderer, an
45
+ * interactive block without an id, repeated block ids, and a renderer whose identity changes on
46
+ * three commits in a row (define renderers at module scope or memoize them).
20
47
  *
21
48
  * @example
22
49
  * ```tsx
23
50
  * <AIResponseRenderer
24
51
  * response={response}
25
- * onRenderBlock={(block) => {
52
+ * renderBlock={(block) => {
26
53
  * if (block.type === 'chart') return <MyChart data={block.data} />;
27
- * if (block.type === 'table') return <MyTable rows={block.rows} />;
28
- * return null; // fall back to default handling
54
+ * if (block.type === 'image') return null; // skip the block
55
+ * return undefined; // fall through to blockRenderers and the built-in text renderer
29
56
  * }}
30
57
  * />
58
+ *
59
+ * const blockRenderers = {
60
+ * table: ({ block, id }) => <MyTable id={id} data-block-id={block.id} rows={block.rows} />,
61
+ * } satisfies AIResponseRendererProps['blockRenderers'];
62
+ *
63
+ * <AIResponseRenderer response={response} blockRenderers={blockRenderers} />
31
64
  * ```
32
65
  */
33
66
  import React from 'react';
34
- import { type AIResponse, type AIResponseBlock } from './types';
67
+ import type { SxProps, Theme } from '@mui/material/styles';
68
+ import { type AIResponse, type AIResponseBlock } from './types/response';
69
+ import type { AIActionErrorContext, AIBlockEvent } from './types/hitl';
70
+ import { type AIBlockRendererMap } from './blockRendererContext';
35
71
  /**
36
- * Props for AIResponseRenderer component.
72
+ * Props for AIResponseRenderer component: its own props plus the root `<div>`'s HTML
73
+ * attributes (ADR-04). The renderer owns no root attribute, so `className`, `id`, `data-*` and
74
+ * `aria-*` all reach the root.
37
75
  */
38
- export interface AIResponseRendererProps {
76
+ export interface AIResponseRendererProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'color'> {
39
77
  /** The AIResponse object to render */
40
78
  response: AIResponse;
41
- /** Gap between blocks (default: aiSpacing.sm) */
79
+ /**
80
+ * Gap between blocks. A number is pixels (`blockGap={12}` is 12px); omit it to use theme
81
+ * spacing, `theme.spacing(aiSpacing.sm)` (8px in the default theme), which follows the theme's
82
+ * spacing and its presets. Values below 2 or with a fraction log a development warning: they
83
+ * are usually theme spacing units passed as pixels.
84
+ */
42
85
  blockGap?: number;
43
86
  /**
44
- * Extensibility hook for non-text block types (table, chart, image, form,
45
- * actions, custom). Called for every block the renderer encounters. Return
46
- * a ReactNode to render, `null` to skip, or `undefined` to fall back to the
47
- * default handling (which renders text blocks and skips everything else).
87
+ * Renders any block first (step 1 of the resolution order), text blocks included. Called for
88
+ * every block. Return a node to render it, `null` to skip it, or `undefined` to fall through to
89
+ * `blockRenderers`, a host's renderers and the built-in text renderer.
90
+ *
91
+ * @since 2.13.0
92
+ */
93
+ renderBlock?: (block: AIResponseBlock) => React.ReactNode | null | undefined;
94
+ /**
95
+ * @deprecated Use `renderBlock`, which takes the same function (or `blockRenderers` for one
96
+ * component per block type). Removed in v3.0. Passing it logs one development warning;
97
+ * `renderBlock` wins when both are passed.
48
98
  */
49
99
  onRenderBlock?: (block: AIResponseBlock) => React.ReactNode | undefined;
100
+ /**
101
+ * Block renderers by block type (step 2 of the resolution order). Each receives
102
+ * `AIBlockRendererProps` for its own block type. An entry wins over a renderer a host provides;
103
+ * `null` skips that block type. Keep the object and its components stable (module scope or
104
+ * `useMemo`).
105
+ *
106
+ * @since 2.13.0
107
+ */
108
+ blockRenderers?: AIBlockRendererMap;
109
+ /**
110
+ * Called with what the user did in an interactive block (`AIBlockEvent`). A returned promise
111
+ * drives the block's pending state, and its rejection the block's error.
112
+ *
113
+ * @since 2.13.0
114
+ */
115
+ onBlockEvent?: (event: AIBlockEvent) => void | Promise<void>;
116
+ /**
117
+ * The response is history: block renderers show content and recorded answers without controls.
118
+ * @default false
119
+ * @since 2.13.0
120
+ */
121
+ readOnly?: boolean;
122
+ /**
123
+ * Called when an action inside a block fails, with `{ source: 'block', blockId }`.
124
+ *
125
+ * @since 2.13.0
126
+ */
127
+ onActionError?: (error: unknown, context: AIActionErrorContext) => void;
128
+ /**
129
+ * Called when a block fails to render: its renderer threw, so the block shows a read-only
130
+ * 'unavailable' state while the other blocks keep rendering. Receives the error and the block's
131
+ * `id` and `type`.
132
+ *
133
+ * @since 2.13.0
134
+ */
135
+ onBlockError?: (error: unknown, context: {
136
+ blockId?: string;
137
+ type: string;
138
+ }) => void;
139
+ /**
140
+ * Prefix of the blocks' DOM ids (`getBlockDomId(idPrefix, block.id)`). Defaults to the root's
141
+ * `id`, which is generated when you pass none.
142
+ *
143
+ * @since 2.13.0
144
+ */
145
+ idPrefix?: string;
146
+ /**
147
+ * The response is still streaming in: a citation marker that names no source yet is hidden
148
+ * (it may be cut off or its source may not have arrived), not shown as written.
149
+ * @default false
150
+ * @since 2.13.0
151
+ */
152
+ streaming?: boolean;
153
+ /**
154
+ * Moves the markdown headings of text blocks down by this many levels (clamped at h6). Default:
155
+ * 1 inside a ChatThread (InThreadContext), so `#` renders as h2 under the page's h1; 0
156
+ * standalone.
157
+ * @since 2.13.0
158
+ */
159
+ headingOffset?: 0 | 1 | 2 | 3 | 4 | 5;
160
+ /** Styles for the root, applied after the renderer's own (object, function or array). */
161
+ sx?: SxProps<Theme>;
50
162
  }
51
163
  /**
52
164
  * AIResponseRenderer - Iterates over AIResponse blocks and dispatches each
@@ -1 +1 @@
1
- {"version":3,"file":"AIResponseRenderer.d.ts","sourceRoot":"","sources":["../../../src/components/AI/AIResponseRenderer.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,KAAK,UAAU,EAAE,KAAK,eAAe,EAAe,MAAM,SAAS,CAAC;AAQ7E;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC,sCAAsC;IACtC,QAAQ,EAAE,UAAU,CAAC;IACrB,iDAAiD;IACjD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;;;OAKG;IACH,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,eAAe,KAAK,KAAK,CAAC,SAAS,GAAG,SAAS,CAAC;CACzE;AAMD;;;GAGG;AACH,eAAO,MAAM,kBAAkB,gGA2B9B,CAAC;AAqDF,eAAe,kBAAkB,CAAC"}
1
+ {"version":3,"file":"AIResponseRenderer.d.ts","sourceRoot":"","sources":["../../../src/components/AI/AIResponseRenderer.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgEG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EAKL,KAAK,UAAU,EACf,KAAK,eAAe,EACrB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,oBAAoB,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAQvE,OAAO,EAAyC,KAAK,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAcxG;;;;GAIG;AACH,MAAM,WAAW,u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AAkB,gGAuF9B,CAAC;AAmIF,eAAe,kBAAkB,CAAC"}
@@ -0,0 +1,83 @@
1
+ import type { Context, ReactElement, ReactNode } from 'react';
2
+ import type { AIResponseSource } from './types/response';
3
+ /** The key of a table cell: block id, row (rowKey value or 0-based index) and column key. */
4
+ export declare function cellKey(blockId: string, row: string | number, column: string): string;
5
+ /** The key of a chart point: block id, series `dataKey` and 0-based data index. */
6
+ export declare function pointKey(blockId: string, series: string, index: number): string;
7
+ /** The lookups of one `sources` array. Built once per array identity. */
8
+ export interface ResponseSourcesIndex {
9
+ /** The sources, as given. */
10
+ readonly sources: readonly AIResponseSource[];
11
+ /** Source id to its 1-based number. The first occurrence of a repeated id wins. */
12
+ readonly numberById: ReadonlyMap<string, number>;
13
+ /** Block id to the sources that list it in `blockIds`, in `sources` order. */
14
+ readonly byBlock: ReadonlyMap<string, readonly AIResponseSource[]>;
15
+ /** `cellKey(...)` to the sources whose `cellRefs` name that cell, in `sources` order. */
16
+ readonly byCell: ReadonlyMap<string, readonly AIResponseSource[]>;
17
+ /** `pointKey(...)` to the sources whose `pointRefs` name that point, in `sources` order. */
18
+ readonly byPoint: ReadonlyMap<string, readonly AIResponseSource[]>;
19
+ }
20
+ /** Builds every lookup in one pass over the sources and their refs (no rescans later). */
21
+ export declare function indexResponseSources(sources: readonly AIResponseSource[]): ResponseSourcesIndex;
22
+ /** What a query view registers: how to open itself and move focus to its trigger. */
23
+ export interface QueryRegistration {
24
+ reveal: () => void;
25
+ }
26
+ /** The registry of query views by `queryId`. One per provider, created once. */
27
+ export interface QueryRegistry {
28
+ /** Registers a query view. Returns the function that unregisters it (only that registration). */
29
+ registerQuery(queryId: string, registration: QueryRegistration): () => void;
30
+ /** Reveals the query with `queryId`. `false` when no view registered it. */
31
+ revealQuery(queryId: string): boolean;
32
+ /** Whether a view registered `queryId`. Read it through `useIsQueryRegistered` to re-render on changes. */
33
+ isQueryRegistered(queryId: string): boolean;
34
+ /** Subscribes to registrations and unregistrations (`useSyncExternalStore`). */
35
+ subscribe(listener: () => void): () => void;
36
+ }
37
+ /** Creates an empty query registry. */
38
+ export declare function createQueryRegistry(): QueryRegistry;
39
+ /** What `useResponseSources` returns inside a provider. Stable while `sources` and `unresolvedCitations` stay the same. */
40
+ export interface ResponseSourcesContextValue extends QueryRegistry {
41
+ /** The indexed sources. */
42
+ readonly index: ResponseSourcesIndex;
43
+ /** How text blocks render a citation marker that names no source: as written, or not at all (while streaming). */
44
+ readonly unresolvedCitations: 'literal' | 'hide';
45
+ /** The 1-based number of a source, `undefined` for an unknown id. */
46
+ getSourceNumber(sourceId: string): number | undefined;
47
+ }
48
+ /**
49
+ * The context behind `useResponseSources`. Created with `@__PURE__` and no other module-level
50
+ * statement, so bundles that never mount the provider drop it (OD-A3).
51
+ *
52
+ * @internal
53
+ */
54
+ export declare const AIResponseSourcesContext: Context<ResponseSourcesContextValue | null>;
55
+ /** Props of {@link AIResponseSourcesProvider}. */
56
+ export interface AIResponseSourcesProviderProps {
57
+ /** The response's sources. Keep the array's identity while it does not change; append while streaming. */
58
+ sources?: readonly AIResponseSource[];
59
+ /** How text blocks render a citation marker that names no source. Default `'literal'`; G passes `'hide'` while streaming. */
60
+ unresolvedCitations?: 'literal' | 'hide';
61
+ children?: ReactNode;
62
+ }
63
+ /**
64
+ * Provides a response's sources, their lookups and the query registry to the blocks inside it.
65
+ *
66
+ * @internal
67
+ */
68
+ export declare function AIResponseSourcesProvider({ sources, unresolvedCitations, children }: AIResponseSourcesProviderProps): ReactElement;
69
+ /**
70
+ * The nearest response's sources, lookups and query registry; `null` outside an
71
+ * `AIResponseSourcesProvider`.
72
+ *
73
+ * @internal
74
+ */
75
+ export declare function useResponseSources(): ResponseSourcesContextValue | null;
76
+ /**
77
+ * Whether a query view registered `queryId` in the nearest provider; re-renders when that
78
+ * changes. `false` outside a provider, during server rendering and for an undefined id.
79
+ *
80
+ * @internal
81
+ */
82
+ export declare function useIsQueryRegistered(queryId: string | undefined): boolean;
83
+ //# sourceMappingURL=AIResponseSourcesContext.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AIResponseSourcesContext.d.ts","sourceRoot":"","sources":["../../../src/components/AI/AIResponseSourcesContext.ts"],"names":[],"mappings":"AAqCA,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAG9D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AASzD,6FAA6F;AAC7F,wBAAgB,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAErF;AAED,mFAAmF;AACnF,wBAAgB,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAE/E;AAED,yEAAyE;AACzE,MAAM,WAAW,oBAAoB;IACnC,6BAA6B;IAC7B,QAAQ,CAAC,OAAO,EAAE,SAAS,gBAAgB,EAAE,CAAC;IAC9C,mFAAmF;IACnF,QAAQ,CAAC,UAAU,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjD,8EAA8E;IAC9E,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAC,MAAM,EAAE,SAAS,gBAAgB,EAAE,CAAC,CAAC;IACnE,yFAAyF;IACzF,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC,MAAM,EAAE,SAAS,gBAAgB,EAAE,CAAC,CAAC;IAClE,4FAA4F;IAC5F,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAC,MAAM,EAAE,SAAS,gBAAgB,EAAE,CAAC,CAAC;CACpE;AAQD,0FAA0F;AAC1F,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,SAAS,gBAAgB,EAAE,GAAG,oBAAoB,CAY/F;AAMD,qFAAqF;AACrF,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,MAAM,IAAI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