@ds-mo/ui 9.1.0 → 9.2.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 (318) hide show
  1. package/dist/.build-stamp +1 -1
  2. package/dist/agent-patterns.json +165 -1
  3. package/dist/agent.json +2110 -634
  4. package/dist/angular/ds-agent-activity.d.ts +12 -0
  5. package/dist/angular/ds-agent-activity.js +38 -0
  6. package/dist/angular/ds-agent-response.d.ts +12 -0
  7. package/dist/angular/ds-agent-response.js +38 -0
  8. package/dist/angular/ds-agent-source-list.d.ts +12 -0
  9. package/dist/angular/ds-agent-source-list.js +38 -0
  10. package/dist/angular/ds-agent-tool-call.d.ts +12 -0
  11. package/dist/angular/ds-agent-tool-call.js +38 -0
  12. package/dist/angular/ds-attachment-list.d.ts +12 -0
  13. package/dist/angular/ds-attachment-list.js +38 -0
  14. package/dist/angular/ds-avatar.d.ts +12 -0
  15. package/dist/angular/ds-avatar.js +38 -0
  16. package/dist/angular/ds-code-block.d.ts +12 -0
  17. package/dist/angular/ds-code-block.js +38 -0
  18. package/dist/angular/ds-conversation-list-item.d.ts +19 -0
  19. package/dist/angular/ds-conversation-list-item.js +42 -0
  20. package/dist/angular/ds-conversation-list-section.d.ts +12 -0
  21. package/dist/angular/ds-conversation-list-section.js +38 -0
  22. package/dist/angular/ds-conversation-list.d.ts +12 -0
  23. package/dist/angular/ds-conversation-list.js +37 -0
  24. package/dist/angular/ds-markdown.d.ts +12 -0
  25. package/dist/angular/ds-markdown.js +38 -0
  26. package/dist/angular/ds-menu.d.ts +1 -1
  27. package/dist/angular/ds-menu.js +3 -3
  28. package/dist/angular/ds-message-bubble.d.ts +12 -0
  29. package/dist/angular/ds-message-bubble.js +38 -0
  30. package/dist/angular/ds-message-composer.d.ts +23 -0
  31. package/dist/angular/ds-message-composer.js +49 -0
  32. package/dist/angular/ds-message-scroller.d.ts +15 -0
  33. package/dist/angular/ds-message-scroller.js +43 -0
  34. package/dist/angular/ds-message.d.ts +12 -0
  35. package/dist/angular/ds-message.js +38 -0
  36. package/dist/angular/ds-panel-tool-header.d.ts +25 -0
  37. package/dist/angular/ds-panel-tool-header.js +49 -0
  38. package/dist/angular/ds-panel-tool-search.d.ts +19 -0
  39. package/dist/angular/ds-panel-tool-search.js +49 -0
  40. package/dist/angular/ds-panel-tools.d.ts +30 -1
  41. package/dist/angular/ds-panel-tools.js +14 -5
  42. package/dist/angular/index.d.ts +1 -1
  43. package/dist/angular/index.js +17 -0
  44. package/dist/angular/proxies.d.ts +17 -0
  45. package/dist/angular/proxies.js +17 -0
  46. package/dist/components/ds-agent-activity.d.ts +11 -0
  47. package/dist/components/ds-agent-activity.js +2 -0
  48. package/dist/components/ds-agent-activity.js.map +1 -0
  49. package/dist/components/ds-agent-response.d.ts +11 -0
  50. package/dist/components/ds-agent-response.js +2 -0
  51. package/dist/components/ds-agent-response.js.map +1 -0
  52. package/dist/components/ds-agent-source-list.d.ts +11 -0
  53. package/dist/components/ds-agent-source-list.js +2 -0
  54. package/dist/components/ds-agent-source-list.js.map +1 -0
  55. package/dist/components/ds-agent-tool-call.d.ts +11 -0
  56. package/dist/components/ds-agent-tool-call.js +2 -0
  57. package/dist/components/ds-agent-tool-call.js.map +1 -0
  58. package/dist/components/ds-app-shell.js +1 -1
  59. package/dist/components/ds-app-shell.js.map +1 -1
  60. package/dist/components/ds-attachment-list.d.ts +11 -0
  61. package/dist/components/ds-attachment-list.js +2 -0
  62. package/dist/components/ds-attachment-list.js.map +1 -0
  63. package/dist/components/ds-avatar.d.ts +11 -0
  64. package/dist/components/ds-avatar.js +2 -0
  65. package/dist/components/ds-avatar.js.map +1 -0
  66. package/dist/components/ds-badge.js +1 -1
  67. package/dist/components/ds-banner.js +1 -1
  68. package/dist/components/ds-bar-nav.js +1 -1
  69. package/dist/components/ds-bar-nav.js.map +1 -1
  70. package/dist/components/ds-button-filled.js +1 -1
  71. package/dist/components/ds-button-unfilled.js +1 -1
  72. package/dist/components/ds-card-data-viz-donut.js +1 -1
  73. package/dist/components/ds-card-setting.js +1 -1
  74. package/dist/components/ds-card-shell-data-viz.js +1 -1
  75. package/dist/components/ds-card.js +1 -1
  76. package/dist/components/ds-chart-bar.js +1 -1
  77. package/dist/components/ds-chart-bar.js.map +1 -1
  78. package/dist/components/ds-chart-donut.js +1 -1
  79. package/dist/components/ds-chart-legend.js +1 -1
  80. package/dist/components/ds-chart-line.js +1 -1
  81. package/dist/components/ds-checkbox.js +1 -1
  82. package/dist/components/ds-chip.js +1 -1
  83. package/dist/components/ds-code-block.d.ts +11 -0
  84. package/dist/components/ds-code-block.js +2 -0
  85. package/dist/components/ds-code-block.js.map +1 -0
  86. package/dist/components/ds-conversation-list-item.d.ts +11 -0
  87. package/dist/components/ds-conversation-list-item.js +2 -0
  88. package/dist/components/ds-conversation-list-item.js.map +1 -0
  89. package/dist/components/ds-conversation-list-section.d.ts +11 -0
  90. package/dist/components/ds-conversation-list-section.js +2 -0
  91. package/dist/components/ds-conversation-list-section.js.map +1 -0
  92. package/dist/components/ds-conversation-list.d.ts +11 -0
  93. package/dist/components/ds-conversation-list.js +2 -0
  94. package/dist/components/ds-conversation-list.js.map +1 -0
  95. package/dist/components/ds-divider.js +1 -1
  96. package/dist/components/ds-divider.js.map +1 -1
  97. package/dist/components/ds-empty-state.js +1 -1
  98. package/dist/components/ds-field.js +1 -1
  99. package/dist/components/ds-icon.js +1 -1
  100. package/dist/components/ds-input.js +1 -1
  101. package/dist/components/ds-markdown.d.ts +11 -0
  102. package/dist/components/ds-markdown.js +2 -0
  103. package/dist/components/ds-markdown.js.map +1 -0
  104. package/dist/components/ds-menu.js +1 -1
  105. package/dist/components/ds-message-bubble.d.ts +11 -0
  106. package/dist/components/ds-message-bubble.js +2 -0
  107. package/dist/components/ds-message-bubble.js.map +1 -0
  108. package/dist/components/ds-message-composer.d.ts +11 -0
  109. package/dist/components/ds-message-composer.js +2 -0
  110. package/dist/components/ds-message-composer.js.map +1 -0
  111. package/dist/components/ds-message-scroller.d.ts +11 -0
  112. package/dist/components/ds-message-scroller.js +2 -0
  113. package/dist/components/ds-message-scroller.js.map +1 -0
  114. package/dist/components/ds-message.d.ts +11 -0
  115. package/dist/components/ds-message.js +2 -0
  116. package/dist/components/ds-message.js.map +1 -0
  117. package/dist/components/ds-modal.js +1 -1
  118. package/dist/components/ds-panel-nav.js +1 -1
  119. package/dist/components/ds-panel-nav.js.map +1 -1
  120. package/dist/components/ds-panel-sub-nav.js +1 -1
  121. package/dist/components/ds-panel-tool-header.d.ts +11 -0
  122. package/dist/components/ds-panel-tool-header.js +2 -0
  123. package/dist/components/ds-panel-tool-header.js.map +1 -0
  124. package/dist/components/ds-panel-tool-search.d.ts +11 -0
  125. package/dist/components/ds-panel-tool-search.js +2 -0
  126. package/dist/components/ds-panel-tool-search.js.map +1 -0
  127. package/dist/components/ds-panel-tools.js +1 -1
  128. package/dist/components/ds-panel-tools.js.map +1 -1
  129. package/dist/components/ds-radio.js +1 -1
  130. package/dist/components/ds-select-multi.js +1 -1
  131. package/dist/components/ds-select-multi.js.map +1 -1
  132. package/dist/components/ds-select.js +1 -1
  133. package/dist/components/ds-select.js.map +1 -1
  134. package/dist/components/ds-shell-gradient-picker.js +1 -1
  135. package/dist/components/ds-shell-gradient-picker.js.map +1 -1
  136. package/dist/components/ds-shell-gradient-swatch.js +1 -1
  137. package/dist/components/ds-skeleton.js +1 -1
  138. package/dist/components/ds-slider.js +1 -1
  139. package/dist/components/ds-slider.js.map +1 -1
  140. package/dist/components/ds-swatch-picker.js +1 -1
  141. package/dist/components/ds-switch.js +1 -1
  142. package/dist/components/ds-tab-group.js +1 -1
  143. package/dist/components/ds-tab-group.js.map +1 -1
  144. package/dist/components/ds-tag.js +1 -1
  145. package/dist/components/ds-text.js +1 -1
  146. package/dist/components/ds-tooltip-data-viz.js +1 -1
  147. package/dist/components/ds-tooltip.js +1 -1
  148. package/dist/components/index.d.ts +14 -0
  149. package/dist/components/p--KbMQblZ.js +2 -0
  150. package/dist/components/p--KbMQblZ.js.map +1 -0
  151. package/dist/components/p-2br9YDbG.js +2 -0
  152. package/dist/components/p-2br9YDbG.js.map +1 -0
  153. package/dist/components/p-41UAx2eq.js +2 -0
  154. package/dist/components/p-41UAx2eq.js.map +1 -0
  155. package/dist/components/{p-HBIxvS5C.js → p-B1pWGQn1.js} +2 -2
  156. package/dist/components/p-B7NbIYjS.js +2 -0
  157. package/dist/components/p-B7NbIYjS.js.map +1 -0
  158. package/dist/components/p-BBu_Svz7.js +2 -0
  159. package/dist/components/p-BBu_Svz7.js.map +1 -0
  160. package/dist/components/p-BEQB8EnB.js +2 -0
  161. package/dist/components/p-BEQB8EnB.js.map +1 -0
  162. package/dist/components/{p-CZ9wemOA.js → p-BFWC17em.js} +2 -2
  163. package/dist/components/{p-KRGBGTu5.js → p-BO6C8abO.js} +2 -2
  164. package/dist/components/{p-CbS_WWs2.js → p-BSOZXagj.js} +2 -2
  165. package/dist/components/p-BSOZXagj.js.map +1 -0
  166. package/dist/components/{p-DT2MK8Kt.js → p-BZAEZENv.js} +2 -2
  167. package/dist/components/p-BhC1YyId.js +2 -0
  168. package/dist/components/p-BhC1YyId.js.map +1 -0
  169. package/dist/components/p-BjtXYFhw.js +2 -0
  170. package/dist/components/p-BjtXYFhw.js.map +1 -0
  171. package/dist/components/{p-B-zhgAvL.js → p-Bo5wikia.js} +2 -2
  172. package/dist/components/p-Bx1G7P6W.js +2 -0
  173. package/dist/components/p-Bx1G7P6W.js.map +1 -0
  174. package/dist/components/p-C0sq948W.js +2 -0
  175. package/dist/components/p-C0sq948W.js.map +1 -0
  176. package/dist/components/p-CC1C8s6m.js +2 -0
  177. package/dist/components/p-CC1C8s6m.js.map +1 -0
  178. package/dist/components/p-CKaJx0IX.js +2 -0
  179. package/dist/components/p-CKaJx0IX.js.map +1 -0
  180. package/dist/components/{p-DyZj3k9S.js → p-CZMEhdlA.js} +2 -2
  181. package/dist/components/{p-BbV68F23.js → p-CiwdnKKp.js} +2 -2
  182. package/dist/components/{p-BLzivrE3.js → p-CnM9SW_8.js} +2 -2
  183. package/dist/components/{p-C7UFYvsO.js → p-CuKn9I5f.js} +2 -2
  184. package/dist/components/p-DFMM60My.js +2 -0
  185. package/dist/components/p-DFMM60My.js.map +1 -0
  186. package/dist/components/p-DIsDiGcp.js +2 -0
  187. package/dist/components/p-DIsDiGcp.js.map +1 -0
  188. package/dist/components/p-DVsje4AY.js +2 -0
  189. package/dist/components/p-DVsje4AY.js.map +1 -0
  190. package/dist/components/p-Di-ThR90.js +2 -0
  191. package/dist/components/p-Di-ThR90.js.map +1 -0
  192. package/dist/components/{p-C7RObioO.js → p-Di4HBckb.js} +2 -2
  193. package/dist/components/p-a9nGf1s6.js +2 -0
  194. package/dist/components/p-a9nGf1s6.js.map +1 -0
  195. package/dist/components/p-gidVv1FX.js +2 -0
  196. package/dist/components/p-gidVv1FX.js.map +1 -0
  197. package/dist/components/p-rEe-3KR_.js +2 -0
  198. package/dist/components/p-rEe-3KR_.js.map +1 -0
  199. package/dist/components/p-t9Ei1kHP.js +2 -0
  200. package/dist/components/p-t9Ei1kHP.js.map +1 -0
  201. package/dist/docs/components.json +7834 -3899
  202. package/dist/lib/components/Menu/menu-placement.d.ts +13 -0
  203. package/dist/lib/shell/index.d.ts +1 -1
  204. package/dist/lib/shell/index.js +8 -0
  205. package/dist/lib/shell/index.js.map +2 -2
  206. package/dist/mcp-data/registry/agent-activity.json +158 -0
  207. package/dist/mcp-data/registry/agent-response.json +211 -0
  208. package/dist/mcp-data/registry/agent-source-list.json +153 -0
  209. package/dist/mcp-data/registry/agent-tool-call.json +213 -0
  210. package/dist/mcp-data/registry/app-shell.json +2 -2
  211. package/dist/mcp-data/registry/attachment-list.json +137 -0
  212. package/dist/mcp-data/registry/avatar.json +136 -0
  213. package/dist/mcp-data/registry/bar-nav.json +2 -2
  214. package/dist/mcp-data/registry/code-block.json +150 -0
  215. package/dist/mcp-data/registry/conversation-list-item.json +265 -0
  216. package/dist/mcp-data/registry/conversation-list-section.json +139 -0
  217. package/dist/mcp-data/registry/conversation-list.json +101 -0
  218. package/dist/mcp-data/registry/markdown.json +141 -0
  219. package/dist/mcp-data/registry/menu.json +27 -7
  220. package/dist/mcp-data/registry/message-bubble.json +119 -0
  221. package/dist/mcp-data/registry/message-composer.json +265 -0
  222. package/dist/mcp-data/registry/message-scroller.json +217 -0
  223. package/dist/mcp-data/registry/message.json +255 -0
  224. package/dist/mcp-data/registry/panel-nav.json +2 -2
  225. package/dist/mcp-data/registry/panel-tool-header.json +342 -0
  226. package/dist/mcp-data/registry/panel-tool-search.json +387 -0
  227. package/dist/mcp-data/registry/panel-tools.json +150 -10
  228. package/dist/mcp-data/registry/registry.json +2146 -619
  229. package/dist/mcp-data/registry/select.json +1 -1
  230. package/dist/mcp-data/registry/slider.json +4 -4
  231. package/dist/mcp-data/registry/tab-group.json +2 -2
  232. package/dist/mcp-data/registry/text.json +1 -1
  233. package/dist/react/components.d.ts +17 -0
  234. package/dist/react/components.js +17 -0
  235. package/dist/react/ds-agent-activity.d.ts +9 -0
  236. package/dist/react/ds-agent-activity.js +12 -0
  237. package/dist/react/ds-agent-response.d.ts +9 -0
  238. package/dist/react/ds-agent-response.js +12 -0
  239. package/dist/react/ds-agent-source-list.d.ts +9 -0
  240. package/dist/react/ds-agent-source-list.js +12 -0
  241. package/dist/react/ds-agent-tool-call.d.ts +9 -0
  242. package/dist/react/ds-agent-tool-call.js +12 -0
  243. package/dist/react/ds-attachment-list.d.ts +9 -0
  244. package/dist/react/ds-attachment-list.js +12 -0
  245. package/dist/react/ds-avatar.d.ts +9 -0
  246. package/dist/react/ds-avatar.js +12 -0
  247. package/dist/react/ds-code-block.d.ts +9 -0
  248. package/dist/react/ds-code-block.js +12 -0
  249. package/dist/react/ds-conversation-list-item.d.ts +14 -0
  250. package/dist/react/ds-conversation-list-item.js +12 -0
  251. package/dist/react/ds-conversation-list-section.d.ts +9 -0
  252. package/dist/react/ds-conversation-list-section.js +12 -0
  253. package/dist/react/ds-conversation-list.d.ts +9 -0
  254. package/dist/react/ds-conversation-list.js +12 -0
  255. package/dist/react/ds-markdown.d.ts +9 -0
  256. package/dist/react/ds-markdown.js +12 -0
  257. package/dist/react/ds-message-bubble.d.ts +9 -0
  258. package/dist/react/ds-message-bubble.js +12 -0
  259. package/dist/react/ds-message-composer.d.ts +16 -0
  260. package/dist/react/ds-message-composer.js +16 -0
  261. package/dist/react/ds-message-scroller.d.ts +12 -0
  262. package/dist/react/ds-message-scroller.js +12 -0
  263. package/dist/react/ds-message.d.ts +9 -0
  264. package/dist/react/ds-message.js +12 -0
  265. package/dist/react/ds-panel-tool-header.d.ts +17 -0
  266. package/dist/react/ds-panel-tool-header.js +16 -0
  267. package/dist/react/ds-panel-tool-search.d.ts +14 -0
  268. package/dist/react/ds-panel-tool-search.js +16 -0
  269. package/dist/react/ds-panel-tools.d.ts +10 -0
  270. package/dist/react/ds-panel-tools.js +3 -0
  271. package/dist/types/components/AgentActivity/AgentActivity.d.ts +14 -0
  272. package/dist/types/components/AgentResponse/AgentResponse.d.ts +12 -0
  273. package/dist/types/components/AgentSourceList/AgentSourceList.d.ts +9 -0
  274. package/dist/types/components/AgentToolCall/AgentToolCall.d.ts +13 -0
  275. package/dist/types/components/AppShell/AppShell.d.ts +4 -0
  276. package/dist/types/components/AttachmentList/AttachmentList.d.ts +8 -0
  277. package/dist/types/components/Avatar/Avatar.d.ts +8 -0
  278. package/dist/types/components/CodeBlock/CodeBlock.d.ts +11 -0
  279. package/dist/types/components/ConversationList/ConversationList.d.ts +4 -0
  280. package/dist/types/components/ConversationListItem/ConversationListItem.d.ts +22 -0
  281. package/dist/types/components/ConversationListSection/ConversationListSection.d.ts +9 -0
  282. package/dist/types/components/Markdown/Markdown.d.ts +15 -0
  283. package/dist/types/components/Menu/Menu.d.ts +3 -0
  284. package/dist/types/components/Menu/menu-placement.d.ts +13 -0
  285. package/dist/types/components/Menu/menu-types.d.ts +1 -1
  286. package/dist/types/components/Message/Message.d.ts +17 -0
  287. package/dist/types/components/MessageBubble/MessageBubble.d.ts +6 -0
  288. package/dist/types/components/MessageComposer/MessageComposer.d.ts +29 -0
  289. package/dist/types/components/MessageScroller/MessageScroller.d.ts +37 -0
  290. package/dist/types/components/PanelNav/PanelNav.d.ts +3 -0
  291. package/dist/types/components/PanelToolHeader/PanelToolHeader.d.ts +34 -0
  292. package/dist/types/components/PanelToolSearch/PanelToolSearch.d.ts +35 -0
  293. package/dist/types/components/PanelTools/PanelTools.d.ts +40 -1
  294. package/dist/types/components/PanelTools/panel-tools-types.d.ts +20 -0
  295. package/dist/types/components/PanelTools/panel-tools-utils.d.ts +2 -0
  296. package/dist/types/components/Slider/Slider.d.ts +1 -1
  297. package/dist/types/components/conversation-types.d.ts +55 -0
  298. package/dist/types/components.d.ts +1185 -8
  299. package/dist/types/shell/index.d.ts +1 -1
  300. package/dist/types/utils/choice-list-parts.d.ts +4 -1
  301. package/package.json +4 -1
  302. package/dist/components/p-CXF8yd-g.js +0 -2
  303. package/dist/components/p-CXF8yd-g.js.map +0 -1
  304. package/dist/components/p-CbS_WWs2.js.map +0 -1
  305. package/dist/components/p-VKIsOVza.js +0 -2
  306. package/dist/components/p-VKIsOVza.js.map +0 -1
  307. package/dist/components/p-tQ1QHeOE.js +0 -2
  308. package/dist/components/p-tQ1QHeOE.js.map +0 -1
  309. /package/dist/components/{p-HBIxvS5C.js.map → p-B1pWGQn1.js.map} +0 -0
  310. /package/dist/components/{p-CZ9wemOA.js.map → p-BFWC17em.js.map} +0 -0
  311. /package/dist/components/{p-KRGBGTu5.js.map → p-BO6C8abO.js.map} +0 -0
  312. /package/dist/components/{p-DT2MK8Kt.js.map → p-BZAEZENv.js.map} +0 -0
  313. /package/dist/components/{p-B-zhgAvL.js.map → p-Bo5wikia.js.map} +0 -0
  314. /package/dist/components/{p-DyZj3k9S.js.map → p-CZMEhdlA.js.map} +0 -0
  315. /package/dist/components/{p-BbV68F23.js.map → p-CiwdnKKp.js.map} +0 -0
  316. /package/dist/components/{p-BLzivrE3.js.map → p-CnM9SW_8.js.map} +0 -0
  317. /package/dist/components/{p-C7UFYvsO.js.map → p-CuKn9I5f.js.map} +0 -0
  318. /package/dist/components/{p-C7RObioO.js.map → p-Di4HBckb.js.map} +0 -0
@@ -24,3 +24,16 @@ export declare const PANEL_NAV_USER_MENU_PLACEMENT: {
24
24
  readonly sideOffset: "calc(var(--dimension-space-100) + var(--dimension-space-050))";
25
25
  readonly alignOffset: 0;
26
26
  };
27
+ /**
28
+ * Canonical placement for a menu opened by a PanelTools header action.
29
+ * Matches BarNav overflow: the 32px trigger is 8px inside the 48px header, so
30
+ * a 12px side offset places the popup 4px below the header edge. Choice-cell
31
+ * alignment keeps the final menu item edge aligned with the trigger.
32
+ */
33
+ export declare const PANEL_TOOLS_HEADER_MENU_PLACEMENT: {
34
+ readonly side: "bottom";
35
+ readonly align: "end";
36
+ readonly anchorAlignment: "choice-cell";
37
+ readonly sideOffset: "calc(var(--dimension-space-100) + var(--dimension-space-050))";
38
+ readonly alignOffset: 0;
39
+ };
@@ -5,7 +5,7 @@ export type { ShellNavRevealOrigin } from './shell-view-transition';
5
5
  export { SHELL_GRADIENT_IMAGE_VAR, SHELL_GRADIENT_SIZE_VAR, SHELL_GRADIENT_POSITION_PANEL_VAR, SHELL_GRADIENT_POSITION_BAR_VAR, SHELL_GRADIENT_OPACITY_VAR, SHELL_CHROME_SURFACE_POSITION_VAR, buildShellRadialGradient, shellGradientImage, shellGradientSize, shellGradientPositionPanel, shellGradientPositionBar, shellChromeSurfacePosition, shellChromeLayerActive, readShellViewportDimensions, } from './shell-gradient';
6
6
  export type { ShellGradientLayout, ShellViewportDimensions } from './shell-gradient';
7
7
  export type { MenuPlacement } from '../components/Menu/menu-placement';
8
- export { PANEL_NAV_USER_MENU_PLACEMENT, } from '../components/Menu/menu-placement';
8
+ export { PANEL_NAV_USER_MENU_PLACEMENT, PANEL_TOOLS_HEADER_MENU_PLACEMENT, } from '../components/Menu/menu-placement';
9
9
  export type { ShellGradientPickerOption, ShellGradientPickerPreview, ShellGradientPickerSection, ShellGradientPreset, } from './shell-gradient-presets';
10
10
  export { DEFAULT_SHELL_GRADIENT_PRESET, SHELL_GRADIENT_PRESETS, SHELL_GRADIENT_PRESET_LABELS, buildShellRadialGradientForPreset, isShellGradientPreset, normalizeShellGradientPreset, shellGradientPickerSections, shellGradientPresetStopToken, } from './shell-gradient-presets';
11
11
  export type { ChromeTransitionDetail, ChromeTransitionSource } from './chrome-transition';
@@ -283,6 +283,13 @@ var PANEL_NAV_USER_MENU_PLACEMENT = {
283
283
  sideOffset: "calc(var(--dimension-space-100) + var(--dimension-space-050))",
284
284
  alignOffset: 0
285
285
  };
286
+ var PANEL_TOOLS_HEADER_MENU_PLACEMENT = {
287
+ side: "bottom",
288
+ align: "end",
289
+ anchorAlignment: "choice-cell",
290
+ sideOffset: "calc(var(--dimension-space-100) + var(--dimension-space-050))",
291
+ alignOffset: 0
292
+ };
286
293
 
287
294
  // src/wc/shell/chrome-transition.ts
288
295
  var CHROME_TRANSITION_START = "dsChromeTransitionStart";
@@ -427,6 +434,7 @@ export {
427
434
  DEFAULT_SHELL_GRADIENT_PRESET,
428
435
  NAV_STYLE_HINT_ATTR,
429
436
  PANEL_NAV_USER_MENU_PLACEMENT,
437
+ PANEL_TOOLS_HEADER_MENU_PLACEMENT,
430
438
  SHELL_BAR_NAV_VT_NAME,
431
439
  SHELL_CHROME_SURFACE_POSITION_VAR,
432
440
  SHELL_GRADIENT_IMAGE_VAR,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/wc/shell/nav-chrome.ts", "../../../src/wc/utils/resolve-css-time-ms.ts", "../../../src/wc/shell/shell-view-transition.ts", "../../../src/wc/shell/shell-gradient-presets.ts", "../../../src/wc/shell/shell-gradient.ts", "../../../src/wc/components/Menu/menu-placement.ts", "../../../src/wc/shell/chrome-transition.ts", "../../../src/wc/shell/shell-chrome-metrics.ts", "../../../src/wc/shell/badge-gradient-ring.ts"],
4
- "sourcesContent": ["/** Nav chrome style slot \u2014 dashboard vs settings. Colors unified for now; texture hooks use the class. */\nexport type NavChromeStyle = 'dashboard' | 'settings';\n\n/** Document hint for first paint before framework props land. */\nexport const NAV_STYLE_HINT_ATTR = 'data-nav-style';\n\nexport function readNavStyleAttr(attr: string | null): NavChromeStyle | undefined {\n if (attr === 'dashboard' || attr === 'settings') return attr;\n return undefined;\n}\n\nexport function setNavStyleHint(style: NavChromeStyle): void {\n if (typeof document === 'undefined') return;\n document.documentElement.setAttribute(NAV_STYLE_HINT_ATTR, style);\n}\n\nexport function clearNavStyleHint(): void {\n if (typeof document === 'undefined') return;\n document.documentElement.removeAttribute(NAV_STYLE_HINT_ATTR);\n}\n\nexport function resolveNavChromeStyle(\n styleProp: NavChromeStyle,\n hostAttr: string | null,\n docHint?: string | null,\n): NavChromeStyle {\n const fromHost = readNavStyleAttr(hostAttr);\n if (fromHost) return fromHost;\n\n const hint =\n docHint !== undefined\n ? docHint\n : typeof document !== 'undefined'\n ? document.documentElement.getAttribute(NAV_STYLE_HINT_ATTR)\n : null;\n const fromHint = readNavStyleAttr(hint);\n if (fromHint) return fromHint;\n\n return styleProp;\n}\n\nexport function shouldResyncNavChromeStyle(\n renderedStyle: NavChromeStyle,\n style: NavChromeStyle,\n): boolean {\n return renderedStyle !== style;\n}\n", "/** Parse a CSS <time> value (or motion shorthand's first token) to milliseconds. */\nexport function parseCssTimeMs(value: string, fallback: number): number {\n const firstToken = value.trim().split(/\\s+/)[0] ?? '';\n const num = parseFloat(firstToken);\n if (Number.isNaN(num)) return fallback;\n if (/ms\\s*$/.test(firstToken)) return num;\n if (/s\\s*$/.test(firstToken)) return num * 1000;\n return num;\n}\n\nfunction extractCssCustomProp(ref: string): string | null {\n const varMatch = ref.match(/^var\\(\\s*(--[^),]+)/);\n if (varMatch) return varMatch[1].trim();\n if (ref.startsWith('--')) return ref.trim();\n return null;\n}\n\nfunction readTokenTimeMs(token: string, fallback: number): number {\n if (typeof document === 'undefined') return fallback;\n\n const prop = extractCssCustomProp(token);\n if (!prop) return parseCssTimeMs(token, fallback);\n\n const raw = getComputedStyle(document.documentElement).getPropertyValue(prop).trim();\n return parseCssTimeMs(raw, fallback);\n}\n\n/**\n * Resolve a duration to milliseconds for JS timers aligned with CSS motion tokens.\n * Accepts numbers (ms), raw times (`200ms`, `0.75s`), or `var(--effect-*)` references.\n */\nexport function resolveCssTimeMs(\n value: number | string | undefined,\n fallbackToken: string,\n): number {\n if (typeof value === 'number') return value;\n\n const token = typeof value === 'string' && value.trim() ? value.trim() : fallbackToken;\n const prop = extractCssCustomProp(token);\n\n if (prop) {\n return readTokenTimeMs(token, readTokenTimeMs(fallbackToken, 200));\n }\n\n return parseCssTimeMs(token, readTokenTimeMs(fallbackToken, 200));\n}\n\n/** Whether the user has requested reduced non-essential motion. */\nexport function prefersReducedMotion(): boolean {\n return typeof window !== 'undefined' &&\n typeof window.matchMedia === 'function' &&\n window.matchMedia('(prefers-reduced-motion: reduce)').matches;\n}\n\n/**\n * Resolve an animation-coupled duration. Returns zero under reduced motion so\n * JS cleanup stays synchronized with CSS that removes the corresponding motion.\n */\nexport function resolveMotionTimeMs(\n value: number | string | undefined,\n fallbackToken: string,\n): number {\n return prefersReducedMotion() ? 0 : resolveCssTimeMs(value, fallbackToken);\n}\n", "import { parseCssTimeMs, prefersReducedMotion } from '../utils/resolve-css-time-ms';\n\n/** `view-transition-name` on `ds-bar-nav` \u2014 pairs with root reveal in shell apps. */\nexport const SHELL_BAR_NAV_VT_NAME = 'ds-shell-bar-nav';\n\nexport { parseCssTimeMs };\n\nconst VT_STYLE_ID = 'ds-shell-nav-vt-style';\n\n/** TokoMo tokens for the dashboard \u2194 settings radial reveal (WAAPI). */\nexport const SHELL_NAV_REVEAL_DURATION_VAR = '--effect-animation-duration-medium-3';\nexport const SHELL_NAV_REVEAL_EASING_VAR = '--effect-animation-easing-ease-in-out';\nconst SHELL_NAV_REVEAL_DURATION_FALLBACK_MS = 500;\nconst SHELL_NAV_REVEAL_EASING_FALLBACK = 'ease-in-out';\n\nfunction readCssCustomProperty(name: string, fallback: string): string {\n if (typeof document === 'undefined') return fallback;\n const value = getComputedStyle(document.documentElement).getPropertyValue(name).trim();\n return value || fallback;\n}\n\n/** Suppress default cross-fade and pin new snapshots to a 0px circle for WAAPI reveal. */\nexport function ensureShellNavVtStyle(): void {\n if (typeof document === 'undefined') return;\n\n const reduceMotion = prefersReducedMotion();\n const content = [\n '::view-transition-old(root),::view-transition-new(root){animation:none;mix-blend-mode:normal}',\n `::view-transition-old(${SHELL_BAR_NAV_VT_NAME}),::view-transition-new(${SHELL_BAR_NAV_VT_NAME}){animation:none;mix-blend-mode:normal}`,\n `::view-transition-old(${SHELL_BAR_NAV_VT_NAME}){z-index:1}`,\n `::view-transition-new(${SHELL_BAR_NAV_VT_NAME}){z-index:2${reduceMotion ? '' : ';clip-path:circle(0px at var(--vt-x,50%) var(--vt-y,50%))'}}`,\n reduceMotion ? '' : '::view-transition-new(root){clip-path:circle(0px at var(--vt-x,50%) var(--vt-y,50%))}',\n ].join('\\n');\n\n const existing = document.getElementById(VT_STYLE_ID) as HTMLStyleElement | null;\n if (existing) {\n if (existing.textContent !== content) existing.textContent = content;\n return;\n }\n\n const style = document.createElement('style');\n style.id = VT_STYLE_ID;\n style.textContent = content;\n document.head.appendChild(style);\n}\n\nexport interface ShellNavRevealOrigin {\n x: number;\n y: number;\n maxRadius: number;\n}\n\n/** Origin for the radial reveal \u2014 defaults to panel-nav footer gear, then viewport center. */\nexport function resolveShellNavRevealOrigin(originEl?: HTMLElement | null): ShellNavRevealOrigin {\n const btn =\n originEl ??\n document.querySelector<HTMLElement>('.panel-nav__footer-btn');\n const rect = btn?.getBoundingClientRect();\n const x = rect ? Math.round(rect.left + rect.width / 2) : Math.round(window.innerWidth / 2);\n const y = rect ? Math.round(rect.top + rect.height / 2) : Math.round(window.innerHeight / 2);\n const maxRadius = Math.ceil(\n Math.hypot(Math.max(x, window.innerWidth - x), Math.max(y, window.innerHeight - y)),\n );\n return { x, y, maxRadius };\n}\n\nexport function setShellNavRevealOriginVars(origin: ShellNavRevealOrigin): void {\n document.documentElement.style.setProperty('--vt-x', `${origin.x}px`);\n document.documentElement.style.setProperty('--vt-y', `${origin.y}px`);\n}\n\n/** Animate root + bar-nav snapshots with the same radial clip-path reveal. */\nexport function animateShellNavRadialReveal(\n origin: ShellNavRevealOrigin,\n durationMs?: number,\n): void {\n if (prefersReducedMotion()) {\n ensureShellNavVtStyle();\n return;\n }\n\n const duration =\n durationMs ??\n parseCssTimeMs(\n readCssCustomProperty(SHELL_NAV_REVEAL_DURATION_VAR, '400ms'),\n SHELL_NAV_REVEAL_DURATION_FALLBACK_MS,\n );\n const easing = readCssCustomProperty(\n SHELL_NAV_REVEAL_EASING_VAR,\n SHELL_NAV_REVEAL_EASING_FALLBACK,\n );\n const keyframes = {\n clipPath: [\n `circle(0px at ${origin.x}px ${origin.y}px)`,\n `circle(${origin.maxRadius}px at ${origin.x}px ${origin.y}px)`,\n ],\n };\n const options = {\n duration,\n easing,\n fill: 'forwards' as const,\n };\n\n document.documentElement.animate(keyframes, {\n ...options,\n pseudoElement: '::view-transition-new(root)',\n });\n document.documentElement.animate(keyframes, {\n ...options,\n pseudoElement: `::view-transition-new(${SHELL_BAR_NAV_VT_NAME})`,\n });\n}\n\n/** Run radial reveal when a view transition's `ready` promise settles (app/router driver). */\nexport function runShellNavStyleRevealOnReady(\n transition: { ready: Promise<void> },\n originEl?: HTMLElement | null,\n): void {\n ensureShellNavVtStyle();\n if (prefersReducedMotion()) {\n transition.ready.catch(() => {\n /* transition skipped or superseded */\n });\n return;\n }\n const origin = resolveShellNavRevealOrigin(originEl);\n setShellNavRevealOriginVars(origin);\n\n transition.ready\n .then(() => animateShellNavRadialReveal(origin))\n .catch(() => {\n /* transition skipped or superseded */\n });\n}\n", "/** Built-in shell chrome wash presets. */\nexport type ShellGradientPreset = 'none' | 'cool' | 'neutral' | 'warm' | 'fresh';\n\nexport const SHELL_GRADIENT_PRESETS: ShellGradientPreset[] = [\n 'none',\n 'cool',\n 'neutral',\n 'warm',\n 'fresh',\n];\n\n/** Wash presets shown after the `none` option in pickers. */\nexport const SHELL_GRADIENT_WASH_PRESETS: Exclude<ShellGradientPreset, 'none'>[] = [\n 'cool',\n 'neutral',\n 'warm',\n 'fresh',\n];\n\n/** Default wash when `gradient-preset` is omitted. */\nexport const DEFAULT_SHELL_GRADIENT_PRESET: ShellGradientPreset = 'neutral';\n\nexport const SHELL_GRADIENT_PRESET_LABELS: Record<ShellGradientPreset, string> = {\n none: 'None',\n cool: 'Cool',\n neutral: 'Neutral',\n warm: 'Warm',\n fresh: 'Fresh',\n};\n\nexport interface ShellGradientStop {\n color: string;\n position: number;\n}\n\nexport interface ShellGradientRecipe {\n opacity: number;\n stops: readonly ShellGradientStop[];\n}\n\nexport interface ShellGradientPickerPreview {\n backgroundColor: string;\n backgroundImage?: string;\n opacity?: number;\n}\n\nexport interface ShellGradientPickerOption {\n value: ShellGradientPreset;\n label: string;\n preview: ShellGradientPickerPreview;\n}\n\nexport interface ShellGradientPickerSection {\n options: ShellGradientPickerOption[];\n}\n\nconst SHELL_GRADIENT_RECIPES: Record<Exclude<ShellGradientPreset, 'none'>, ShellGradientRecipe> = {\n cool: {\n opacity: 0.1,\n stops: [\n { color: 'var(--color-background-transparent)', position: 0 },\n { color: 'var(--color-color-intent-blue-strong-background)', position: 100 },\n ],\n },\n neutral: {\n opacity: 0.1,\n stops: [\n { color: 'var(--color-background-transparent)', position: 0 },\n { color: 'var(--color-color-intent-grey-strong-background)', position: 100 },\n ],\n },\n warm: {\n opacity: 0.1,\n stops: [\n { color: 'var(--color-background-transparent)', position: 0 },\n { color: 'var(--color-color-intent-yellow-strong-background)', position: 100 },\n ],\n },\n fresh: {\n opacity: 0.4,\n stops: [\n { color: 'var(--color-color-intent-cyan-faint-background)', position: 0 },\n { color: 'var(--color-background-transparent)', position: 47 },\n { color: 'var(--color-background-transparent)', position: 58 },\n { color: 'var(--color-color-intent-red-faint-background)', position: 83 },\n { color: 'var(--color-color-intent-pink-faint-background)', position: 100 },\n ],\n },\n};\n\nconst GRADIENT_GEOMETRY = '100% 100% at 0% 0%';\n\nexport function shellGradientPresetStopToken(preset: ShellGradientPreset): string | null {\n if (preset === 'none') return null;\n const stops = SHELL_GRADIENT_RECIPES[preset].stops;\n return stops[stops.length - 1]?.color ?? null;\n}\n\nexport function shellGradientPresetRecipe(preset: ShellGradientPreset): ShellGradientRecipe | null {\n const normalized = normalizeShellGradientPreset(preset);\n return normalized === 'none' ? null : SHELL_GRADIENT_RECIPES[normalized];\n}\n\nexport function shellGradientPresetOpacity(preset: ShellGradientPreset): string {\n return String(shellGradientPresetRecipe(preset)?.opacity ?? 0);\n}\n\nexport function isShellGradientPreset(value: string): value is ShellGradientPreset {\n return (SHELL_GRADIENT_PRESETS as string[]).includes(value);\n}\n\n/**\n * Coerce unknown/absent presets to the default. Runtime values escape the\n * type: removing the reflected `gradient-preset` attribute (e.g. an Angular\n * `[attr.gradient-preset]=\"null\"` binding) drives the prop to null past its\n * field default \u2014 without normalization the stop lookup interpolates the\n * literal string \"undefined\" into CSS and the wash silently disappears.\n */\nexport function normalizeShellGradientPreset(\n value: string | null | undefined,\n): ShellGradientPreset {\n return value != null && isShellGradientPreset(value) ? value : DEFAULT_SHELL_GRADIENT_PRESET;\n}\n\n/** Radial wash for a preset \u2014 transparent at top-left into the intent stop. `none` returns no image. */\nexport function buildShellRadialGradientForPreset(preset: ShellGradientPreset): string {\n const normalized = normalizeShellGradientPreset(preset);\n if (normalized === 'none') return 'none';\n\n return buildShellRadialGradientFromStops(SHELL_GRADIENT_RECIPES[normalized].stops);\n}\n\n/** Build the production shell geometry from an ordered set of design-time stops. */\nexport function buildShellRadialGradientFromStops(stops: readonly ShellGradientStop[]): string {\n const serialized = stops.map(stop => `${stop.color} ${stop.position}%`).join(', ');\n return `radial-gradient(${GRADIENT_GEOMETRY}, ${serialized})`;\n}\n\n/** Generic SwatchPicker sections for the fixed shell appearance presets. */\nexport function shellGradientPickerSections(): ShellGradientPickerSection[] {\n return [\n {\n options: [{\n value: 'none',\n label: SHELL_GRADIENT_PRESET_LABELS.none,\n preview: {\n backgroundColor: 'var(--color-background-secondary)',\n },\n }],\n },\n {\n options: SHELL_GRADIENT_WASH_PRESETS.map(preset => ({\n value: preset,\n label: SHELL_GRADIENT_PRESET_LABELS[preset],\n preview: {\n backgroundColor: 'var(--color-background-secondary)',\n backgroundImage: buildShellRadialGradientForPreset(preset),\n opacity: Number(shellGradientPresetOpacity(preset)),\n },\n })),\n },\n ];\n}\n", "/** CSS var names consumed by `ds-panel-nav` / `ds-bar-nav` inside `ds-app-shell`. */\nimport type { ShellGradientPreset } from './shell-gradient-presets';\nimport {\n DEFAULT_SHELL_GRADIENT_PRESET,\n buildShellRadialGradientForPreset,\n normalizeShellGradientPreset,\n} from './shell-gradient-presets';\n\nexport type { ShellGradientPreset } from './shell-gradient-presets';\nexport {\n DEFAULT_SHELL_GRADIENT_PRESET,\n SHELL_GRADIENT_PRESETS,\n SHELL_GRADIENT_PRESET_LABELS,\n buildShellRadialGradientForPreset,\n buildShellRadialGradientFromStops,\n isShellGradientPreset,\n shellGradientPresetOpacity,\n shellGradientPresetRecipe,\n shellGradientPresetStopToken,\n} from './shell-gradient-presets';\n\nexport const SHELL_GRADIENT_IMAGE_VAR = '--ds-shell-gradient-image';\nexport const SHELL_GRADIENT_SIZE_VAR = '--ds-shell-gradient-size';\nexport const SHELL_GRADIENT_POSITION_PANEL_VAR = '--ds-shell-gradient-position-panel';\nexport const SHELL_GRADIENT_POSITION_BAR_VAR = '--ds-shell-gradient-position-bar';\nexport const SHELL_GRADIENT_OPACITY_VAR = '--ds-shell-gradient-opacity';\n/** Per chrome-surface background-position \u2014 offsets wash + grid to shell row origin. */\nexport const SHELL_CHROME_SURFACE_POSITION_VAR = '--ds-shell-chrome-surface-position';\n\n/** Whether the shared chrome layer (secondary bg + optional wash) should mount. */\nexport function shellChromeLayerActive(preset: ShellGradientPreset): boolean {\n return normalizeShellGradientPreset(preset) !== 'none';\n}\n\n/**\n * Shell radial wash \u2014 same for panel and bar nav.\n * Tokens follow `data-theme` (light/dark intent stops).\n */\nexport function buildShellRadialGradient(\n preset: ShellGradientPreset = DEFAULT_SHELL_GRADIENT_PRESET,\n): string {\n return buildShellRadialGradientForPreset(preset);\n}\n\n/** Built-in radial image for the selected shell preset. */\nexport function shellGradientImage(\n preset: ShellGradientPreset = DEFAULT_SHELL_GRADIENT_PRESET,\n): string {\n return buildShellRadialGradient(preset);\n}\n\nexport interface ShellViewportDimensions {\n width: number;\n height: number;\n}\n\n/**\n * Viewport size for shell chrome with `background-attachment: fixed`.\n * Must not use the `ds-app-shell` element box \u2014 the shell can be shorter or\n * taller than the viewport when host height chains break or content overflows.\n */\nexport function readShellViewportDimensions(win?: Window): ShellViewportDimensions {\n const w = win ?? (typeof globalThis.window !== 'undefined' ? globalThis.window : undefined);\n if (!w) return { width: 0, height: 0 };\n\n const visual = w.visualViewport;\n return {\n width: Math.round(visual?.width ?? w.innerWidth),\n height: Math.round(visual?.height ?? w.innerHeight),\n };\n}\n\nexport interface ShellGradientLayout {\n width: number;\n height: number;\n panelWidth: number;\n}\n\n/** Pixel `background-size` for the fixed-attachment radial wash. */\nexport function shellGradientSize(layout: Pick<ShellGradientLayout, 'width' | 'height'>): string {\n return `${Math.round(layout.width)}px ${Math.round(layout.height)}px`;\n}\n\nexport function shellGradientPositionPanel(): string {\n return '0 0';\n}\n\nexport function shellGradientPositionBar(panelWidth: number): string {\n return `${-Math.round(panelWidth)}px 0`;\n}\n\n/** Phase-lock a chrome rect to the shell row coordinate system (wash + grid). */\nexport function shellChromeSurfacePosition(leftPx: number, topPx: number): string {\n return `${-Math.round(leftPx)}px ${-Math.round(topPx)}px`;\n}\n", "import type { ChoicePopupAnchorAlignment } from '../../utils/choice-popup-alignment';\nimport type { MenuAlign, MenuSide } from './menu-position';\n\n/** Placement props bindable on `ds-menu` (side, align, offsets). */\nexport interface MenuPlacement {\n side: MenuSide;\n align: MenuAlign;\n anchorAlignment: ChoicePopupAnchorAlignment;\n sideOffset: number | string;\n alignOffset: number | string;\n}\n\n/**\n * Canonical `ds-menu` placement for the **panel-nav footer user menu**.\n * Anchor from `dsNavUserAction` detail `{ anchor }` (id `ds-panel-nav-user-menu-anchor`).\n *\n * Not for BarNav overflow menus \u2014 those use `side=\"bottom\"` / `align=\"end\"` internally.\n * `align: 'end'` bottom-aligns the last choice cell on the anchor; the side offset nudges into the content area:\n * - `sideOffset` space-100 + space-050 (12px): 4px past the panel-nav outer edge (anchor is ~8px inset).\n * - `anchorAlignment: 'choice-cell'`: the shared section inset puts the last row edge on the footer user row.\n */\nexport const PANEL_NAV_USER_MENU_PLACEMENT = {\n side: 'right',\n align: 'end',\n anchorAlignment: 'choice-cell',\n sideOffset: 'calc(var(--dimension-space-100) + var(--dimension-space-050))',\n alignOffset: 0,\n} as const satisfies MenuPlacement;\n", "/** Bubbling/composed events \u2014 `ds-app-shell` and `ds-bar-nav` coordinate during width motion. */\n\nexport const CHROME_TRANSITION_START = 'dsChromeTransitionStart';\nexport const CHROME_TRANSITION_END = 'dsChromeTransitionEnd';\n\nexport type ChromeTransitionSource = 'panel-nav' | 'panel-tools';\n\nexport interface ChromeTransitionDetail {\n source: ChromeTransitionSource;\n /** Panel-tools drawer motion direction; omitted for panel-nav. */\n phase?: 'opening' | 'closing';\n}\n\n/** Reference-counted gate \u2014 used while panel-nav width is transitioning. */\nexport class ChromeTransitionDepth {\n private depth = 0;\n\n enter(): void {\n this.depth += 1;\n }\n\n exit(): void {\n this.depth = Math.max(0, this.depth - 1);\n }\n\n get isActive(): boolean {\n return this.depth > 0;\n }\n}\n\n/** Idempotent gate for one physical chrome surface.\n * Duplicate start notifications still require only one matching end. */\nexport class ChromeTransitionGate {\n private active = false;\n\n enter(): void {\n this.active = true;\n }\n\n exit(): void {\n this.active = false;\n }\n\n get isActive(): boolean {\n return this.active;\n }\n}\n\nexport interface RafCoalescer {\n schedule(): void;\n cancel(): void;\n}\n\n/** Coalesce bursty layout work (ResizeObserver, prop churn) to one callback per frame. */\nexport function createRafCoalescer(onFrame: () => void): RafCoalescer {\n let rafId = 0;\n return {\n schedule() {\n if (rafId !== 0) return;\n rafId = requestAnimationFrame(() => {\n rafId = 0;\n onFrame();\n });\n },\n cancel() {\n if (rafId !== 0) {\n cancelAnimationFrame(rafId);\n rafId = 0;\n }\n },\n };\n}\n\nexport function readChromeTransitionSource(event: Event): ChromeTransitionSource | undefined {\n return (event as CustomEvent<ChromeTransitionDetail>).detail?.source;\n}\n\nexport function readChromeTransitionPhase(event: Event): ChromeTransitionDetail['phase'] {\n return (event as CustomEvent<ChromeTransitionDetail>).detail?.phase;\n}\n", "import { shellGradientPositionBar } from './shell-gradient';\n\n/** Read a `var(--token)` width in px using a hidden probe (works with calc() tokens). */\nexport function readCssVarWidthPx(context: HTMLElement, cssVarName: string): number {\n if (typeof document === 'undefined') return 0;\n\n const probe = document.createElement('div');\n probe.style.cssText =\n 'position:absolute;visibility:hidden;pointer-events:none;height:0;width:var(' +\n cssVarName +\n ');';\n context.appendChild(probe);\n const width = probe.getBoundingClientRect().width;\n context.removeChild(probe);\n return width;\n}\n\nexport interface PanelNavWidthTokens {\n expandedPx: number;\n collapsedPx: number;\n}\n\n/** Resolve panel-nav expanded/collapsed widths from scoped CSS vars on `.panel-nav`. */\nexport function readPanelNavWidthTokens(navRoot: HTMLElement): PanelNavWidthTokens {\n return {\n expandedPx: readCssVarWidthPx(navRoot, '--_nav-width'),\n collapsedPx: readCssVarWidthPx(navRoot, '--_nav-width-collapsed'),\n };\n}\n\nexport function isPanelNavCollapsed(\n panelNavHost: HTMLElement | null,\n navRoot: HTMLElement | null,\n): boolean {\n if (navRoot?.classList.contains('panel-nav--collapsed')) return true;\n const collapsedProp = (panelNavHost as (HTMLElement & { collapsed?: boolean }) | null)?.collapsed;\n return collapsedProp === true;\n}\n\nexport function panelWidthPxFromTokens(\n tokens: PanelNavWidthTokens,\n collapsed: boolean,\n): number {\n return collapsed ? tokens.collapsedPx : tokens.expandedPx;\n}\n\nexport function barGradientPositionFromPanelWidth(panelWidthPx: number): string {\n return shellGradientPositionBar(panelWidthPx);\n}\n", "import {\n SHELL_GRADIENT_POSITION_BAR_VAR,\n SHELL_GRADIENT_POSITION_PANEL_VAR,\n} from './shell-gradient';\n\n/** Per-badge background-position for shell gradient ring sampling. */\nexport const BADGE_GRADIENT_POSITION_VAR = '--_badge-gradient-position';\n\nexport interface GradientSurface {\n element: HTMLElement;\n chromeHost: HTMLElement;\n positionVar: string;\n}\n\n/** Whether the badge sits under a shell with an active wash preset. */\nexport function isShellGradientActive(from: HTMLElement): boolean {\n // Explicit <HTMLElement>: the inferred HTMLDsAppShellElement type only\n // resolves where @stencil/core types are installed \u2014 consumers importing\n // `@ds-mo/ui/shell` (raw TS) compile this without them.\n const shell = from.closest<HTMLElement>('ds-app-shell');\n return shell !== null && shell.getAttribute('gradient-preset') !== 'none';\n}\n\n/** Bar or panel chrome surface that owns the shell gradient stack. */\nexport function findGradientSurface(from: HTMLElement): GradientSurface | null {\n const barHost = from.closest('ds-bar-nav') as HTMLElement | null;\n if (barHost) {\n const root = barHost.shadowRoot ?? barHost;\n const element = root.querySelector('.bar-nav');\n if (element) {\n return {\n element: element as HTMLElement,\n chromeHost: barHost,\n positionVar: SHELL_GRADIENT_POSITION_BAR_VAR,\n };\n }\n }\n\n const panelHost = from.closest('ds-panel-nav') as HTMLElement | null;\n if (panelHost) {\n const root = panelHost.shadowRoot ?? panelHost;\n const element = root.querySelector('.panel-nav');\n if (element) {\n return {\n element: element as HTMLElement,\n chromeHost: panelHost,\n positionVar: SHELL_GRADIENT_POSITION_PANEL_VAR,\n };\n }\n }\n\n return null;\n}\n\ninterface ParsedPosition {\n x: number;\n y: number;\n}\n\n/** Parse a two-value CSS background-position (e.g. `-200px 0`). */\nexport function parseCssBackgroundPosition(value: string): ParsedPosition {\n const trimmed = value.trim();\n if (!trimmed) return { x: 0, y: 0 };\n\n const parts = trimmed.split(/\\s+/);\n const x = parseLength(parts[0] ?? '0');\n const y = parseLength(parts[1] ?? '0');\n return { x, y };\n}\n\nfunction parseLength(token: string): number {\n const px = token.match(/^(-?[\\d.]+)px$/);\n if (px) return Number(px[1]);\n return 0;\n}\n\n/**\n * Background position for a badge ring so the shell gradient aligns with nav chrome.\n * Uses badge center relative to the painted chrome surface.\n */\nexport function badgeGradientPosition(\n badgeHost: HTMLElement,\n surface: GradientSurface,\n shellPosition: string,\n): string {\n const badgeRect = badgeHost.getBoundingClientRect();\n const surfaceRect = surface.element.getBoundingClientRect();\n const anchorX = badgeRect.left + badgeRect.width / 2 - surfaceRect.left;\n const anchorY = badgeRect.top + badgeRect.height / 2 - surfaceRect.top;\n const { x, y } = parseCssBackgroundPosition(shellPosition);\n\n return `${Math.round(x - anchorX)}px ${Math.round(y - anchorY)}px`;\n}\n\n/** Resolve shell gradient position from chrome host custom properties. */\nexport function readShellGradientPosition(surface: GradientSurface): string {\n const styles = getComputedStyle(surface.chromeHost);\n return styles.getPropertyValue(surface.positionVar).trim() || '0 0';\n}\n\n/** Stamp `--_badge-gradient-position` on the badge host (fixed viewport chrome). */\nexport function syncBadgeGradientPosition(badgeHost: HTMLElement): void {\n if (!isShellGradientActive(badgeHost)) {\n badgeHost.style.removeProperty(BADGE_GRADIENT_POSITION_VAR);\n return;\n }\n\n badgeHost.style.setProperty(BADGE_GRADIENT_POSITION_VAR, '0 0');\n}\n"],
5
- "mappings": ";AAIO,IAAM,sBAAsB;AAE5B,SAAS,iBAAiB,MAAiD;AAChF,MAAI,SAAS,eAAe,SAAS,WAAY,QAAO;AACxD,SAAO;AACT;AAEO,SAAS,gBAAgB,OAA6B;AAC3D,MAAI,OAAO,aAAa,YAAa;AACrC,WAAS,gBAAgB,aAAa,qBAAqB,KAAK;AAClE;AAEO,SAAS,oBAA0B;AACxC,MAAI,OAAO,aAAa,YAAa;AACrC,WAAS,gBA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*/\nexport type NavChromeStyle = 'dashboard' | 'settings';\n\n/** Document hint for first paint before framework props land. */\nexport const NAV_STYLE_HINT_ATTR = 'data-nav-style';\n\nexport function readNavStyleAttr(attr: string | null): NavChromeStyle | undefined {\n if (attr === 'dashboard' || attr === 'settings') return attr;\n return undefined;\n}\n\nexport function setNavStyleHint(style: NavChromeStyle): void {\n if (typeof document === 'undefined') return;\n document.documentElement.setAttribute(NAV_STYLE_HINT_ATTR, style);\n}\n\nexport function clearNavStyleHint(): void {\n if (typeof document === 'undefined') return;\n document.documentElement.removeAttribute(NAV_STYLE_HINT_ATTR);\n}\n\nexport function resolveNavChromeStyle(\n styleProp: NavChromeStyle,\n hostAttr: string | null,\n docHint?: string | null,\n): NavChromeStyle {\n const fromHost = readNavStyleAttr(hostAttr);\n if (fromHost) return fromHost;\n\n const hint =\n docHint !== undefined\n ? docHint\n : typeof document !== 'undefined'\n ? document.documentElement.getAttribute(NAV_STYLE_HINT_ATTR)\n : null;\n const fromHint = readNavStyleAttr(hint);\n if (fromHint) return fromHint;\n\n return styleProp;\n}\n\nexport function shouldResyncNavChromeStyle(\n renderedStyle: NavChromeStyle,\n style: NavChromeStyle,\n): boolean {\n return renderedStyle !== style;\n}\n", "/** Parse a CSS <time> value (or motion shorthand's first token) to milliseconds. */\nexport function parseCssTimeMs(value: string, fallback: number): number {\n const firstToken = value.trim().split(/\\s+/)[0] ?? '';\n const num = parseFloat(firstToken);\n if (Number.isNaN(num)) return fallback;\n if (/ms\\s*$/.test(firstToken)) return num;\n if (/s\\s*$/.test(firstToken)) return num * 1000;\n return num;\n}\n\nfunction extractCssCustomProp(ref: string): string | null {\n const varMatch = ref.match(/^var\\(\\s*(--[^),]+)/);\n if (varMatch) return varMatch[1].trim();\n if (ref.startsWith('--')) return ref.trim();\n return null;\n}\n\nfunction readTokenTimeMs(token: string, fallback: number): number {\n if (typeof document === 'undefined') return fallback;\n\n const prop = extractCssCustomProp(token);\n if (!prop) return parseCssTimeMs(token, fallback);\n\n const raw = getComputedStyle(document.documentElement).getPropertyValue(prop).trim();\n return parseCssTimeMs(raw, fallback);\n}\n\n/**\n * Resolve a duration to milliseconds for JS timers aligned with CSS motion tokens.\n * Accepts numbers (ms), raw times (`200ms`, `0.75s`), or `var(--effect-*)` references.\n */\nexport function resolveCssTimeMs(\n value: number | string | undefined,\n fallbackToken: string,\n): number {\n if (typeof value === 'number') return value;\n\n const token = typeof value === 'string' && value.trim() ? value.trim() : fallbackToken;\n const prop = extractCssCustomProp(token);\n\n if (prop) {\n return readTokenTimeMs(token, readTokenTimeMs(fallbackToken, 200));\n }\n\n return parseCssTimeMs(token, readTokenTimeMs(fallbackToken, 200));\n}\n\n/** Whether the user has requested reduced non-essential motion. */\nexport function prefersReducedMotion(): boolean {\n return typeof window !== 'undefined' &&\n typeof window.matchMedia === 'function' &&\n window.matchMedia('(prefers-reduced-motion: reduce)').matches;\n}\n\n/**\n * Resolve an animation-coupled duration. Returns zero under reduced motion so\n * JS cleanup stays synchronized with CSS that removes the corresponding motion.\n */\nexport function resolveMotionTimeMs(\n value: number | string | undefined,\n fallbackToken: string,\n): number {\n return prefersReducedMotion() ? 0 : resolveCssTimeMs(value, fallbackToken);\n}\n", "import { parseCssTimeMs, prefersReducedMotion } from '../utils/resolve-css-time-ms';\n\n/** `view-transition-name` on `ds-bar-nav` \u2014 pairs with root reveal in shell apps. */\nexport const SHELL_BAR_NAV_VT_NAME = 'ds-shell-bar-nav';\n\nexport { parseCssTimeMs };\n\nconst VT_STYLE_ID = 'ds-shell-nav-vt-style';\n\n/** TokoMo tokens for the dashboard \u2194 settings radial reveal (WAAPI). */\nexport const SHELL_NAV_REVEAL_DURATION_VAR = '--effect-animation-duration-medium-3';\nexport const SHELL_NAV_REVEAL_EASING_VAR = '--effect-animation-easing-ease-in-out';\nconst SHELL_NAV_REVEAL_DURATION_FALLBACK_MS = 500;\nconst SHELL_NAV_REVEAL_EASING_FALLBACK = 'ease-in-out';\n\nfunction readCssCustomProperty(name: string, fallback: string): string {\n if (typeof document === 'undefined') return fallback;\n const value = getComputedStyle(document.documentElement).getPropertyValue(name).trim();\n return value || fallback;\n}\n\n/** Suppress default cross-fade and pin new snapshots to a 0px circle for WAAPI reveal. */\nexport function ensureShellNavVtStyle(): void {\n if (typeof document === 'undefined') return;\n\n const reduceMotion = prefersReducedMotion();\n const content = [\n '::view-transition-old(root),::view-transition-new(root){animation:none;mix-blend-mode:normal}',\n `::view-transition-old(${SHELL_BAR_NAV_VT_NAME}),::view-transition-new(${SHELL_BAR_NAV_VT_NAME}){animation:none;mix-blend-mode:normal}`,\n `::view-transition-old(${SHELL_BAR_NAV_VT_NAME}){z-index:1}`,\n `::view-transition-new(${SHELL_BAR_NAV_VT_NAME}){z-index:2${reduceMotion ? '' : ';clip-path:circle(0px at var(--vt-x,50%) var(--vt-y,50%))'}}`,\n reduceMotion ? '' : '::view-transition-new(root){clip-path:circle(0px at var(--vt-x,50%) var(--vt-y,50%))}',\n ].join('\\n');\n\n const existing = document.getElementById(VT_STYLE_ID) as HTMLStyleElement | null;\n if (existing) {\n if (existing.textContent !== content) existing.textContent = content;\n return;\n }\n\n const style = document.createElement('style');\n style.id = VT_STYLE_ID;\n style.textContent = content;\n document.head.appendChild(style);\n}\n\nexport interface ShellNavRevealOrigin {\n x: number;\n y: number;\n maxRadius: number;\n}\n\n/** Origin for the radial reveal \u2014 defaults to panel-nav footer gear, then viewport center. */\nexport function resolveShellNavRevealOrigin(originEl?: HTMLElement | null): ShellNavRevealOrigin {\n const btn =\n originEl ??\n document.querySelector<HTMLElement>('.panel-nav__footer-btn');\n const rect = btn?.getBoundingClientRect();\n const x = rect ? Math.round(rect.left + rect.width / 2) : Math.round(window.innerWidth / 2);\n const y = rect ? Math.round(rect.top + rect.height / 2) : Math.round(window.innerHeight / 2);\n const maxRadius = Math.ceil(\n Math.hypot(Math.max(x, window.innerWidth - x), Math.max(y, window.innerHeight - y)),\n );\n return { x, y, maxRadius };\n}\n\nexport function setShellNavRevealOriginVars(origin: ShellNavRevealOrigin): void {\n document.documentElement.style.setProperty('--vt-x', `${origin.x}px`);\n document.documentElement.style.setProperty('--vt-y', `${origin.y}px`);\n}\n\n/** Animate root + bar-nav snapshots with the same radial clip-path reveal. */\nexport function animateShellNavRadialReveal(\n origin: ShellNavRevealOrigin,\n durationMs?: number,\n): void {\n if (prefersReducedMotion()) {\n ensureShellNavVtStyle();\n return;\n }\n\n const duration =\n durationMs ??\n parseCssTimeMs(\n readCssCustomProperty(SHELL_NAV_REVEAL_DURATION_VAR, '400ms'),\n SHELL_NAV_REVEAL_DURATION_FALLBACK_MS,\n );\n const easing = readCssCustomProperty(\n SHELL_NAV_REVEAL_EASING_VAR,\n SHELL_NAV_REVEAL_EASING_FALLBACK,\n );\n const keyframes = {\n clipPath: [\n `circle(0px at ${origin.x}px ${origin.y}px)`,\n `circle(${origin.maxRadius}px at ${origin.x}px ${origin.y}px)`,\n ],\n };\n const options = {\n duration,\n easing,\n fill: 'forwards' as const,\n };\n\n document.documentElement.animate(keyframes, {\n ...options,\n pseudoElement: '::view-transition-new(root)',\n });\n document.documentElement.animate(keyframes, {\n ...options,\n pseudoElement: `::view-transition-new(${SHELL_BAR_NAV_VT_NAME})`,\n });\n}\n\n/** Run radial reveal when a view transition's `ready` promise settles (app/router driver). */\nexport function runShellNavStyleRevealOnReady(\n transition: { ready: Promise<void> },\n originEl?: HTMLElement | null,\n): void {\n ensureShellNavVtStyle();\n if (prefersReducedMotion()) {\n transition.ready.catch(() => {\n /* transition skipped or superseded */\n });\n return;\n }\n const origin = resolveShellNavRevealOrigin(originEl);\n setShellNavRevealOriginVars(origin);\n\n transition.ready\n .then(() => animateShellNavRadialReveal(origin))\n .catch(() => {\n /* transition skipped or superseded */\n });\n}\n", "/** Built-in shell chrome wash presets. */\nexport type ShellGradientPreset = 'none' | 'cool' | 'neutral' | 'warm' | 'fresh';\n\nexport const SHELL_GRADIENT_PRESETS: ShellGradientPreset[] = [\n 'none',\n 'cool',\n 'neutral',\n 'warm',\n 'fresh',\n];\n\n/** Wash presets shown after the `none` option in pickers. */\nexport const SHELL_GRADIENT_WASH_PRESETS: Exclude<ShellGradientPreset, 'none'>[] = [\n 'cool',\n 'neutral',\n 'warm',\n 'fresh',\n];\n\n/** Default wash when `gradient-preset` is omitted. */\nexport const DEFAULT_SHELL_GRADIENT_PRESET: ShellGradientPreset = 'neutral';\n\nexport const SHELL_GRADIENT_PRESET_LABELS: Record<ShellGradientPreset, string> = {\n none: 'None',\n cool: 'Cool',\n neutral: 'Neutral',\n warm: 'Warm',\n fresh: 'Fresh',\n};\n\nexport interface ShellGradientStop {\n color: string;\n position: number;\n}\n\nexport interface ShellGradientRecipe {\n opacity: number;\n stops: readonly ShellGradientStop[];\n}\n\nexport interface ShellGradientPickerPreview {\n backgroundColor: string;\n backgroundImage?: string;\n opacity?: number;\n}\n\nexport interface ShellGradientPickerOption {\n value: ShellGradientPreset;\n label: string;\n preview: ShellGradientPickerPreview;\n}\n\nexport interface ShellGradientPickerSection {\n options: ShellGradientPickerOption[];\n}\n\nconst SHELL_GRADIENT_RECIPES: Record<Exclude<ShellGradientPreset, 'none'>, ShellGradientRecipe> = {\n cool: {\n opacity: 0.1,\n stops: [\n { color: 'var(--color-background-transparent)', position: 0 },\n { color: 'var(--color-color-intent-blue-strong-background)', position: 100 },\n ],\n },\n neutral: {\n opacity: 0.1,\n stops: [\n { color: 'var(--color-background-transparent)', position: 0 },\n { color: 'var(--color-color-intent-grey-strong-background)', position: 100 },\n ],\n },\n warm: {\n opacity: 0.1,\n stops: [\n { color: 'var(--color-background-transparent)', position: 0 },\n { color: 'var(--color-color-intent-yellow-strong-background)', position: 100 },\n ],\n },\n fresh: {\n opacity: 0.4,\n stops: [\n { color: 'var(--color-color-intent-cyan-faint-background)', position: 0 },\n { color: 'var(--color-background-transparent)', position: 47 },\n { color: 'var(--color-background-transparent)', position: 58 },\n { color: 'var(--color-color-intent-red-faint-background)', position: 83 },\n { color: 'var(--color-color-intent-pink-faint-background)', position: 100 },\n ],\n },\n};\n\nconst GRADIENT_GEOMETRY = '100% 100% at 0% 0%';\n\nexport function shellGradientPresetStopToken(preset: ShellGradientPreset): string | null {\n if (preset === 'none') return null;\n const stops = SHELL_GRADIENT_RECIPES[preset].stops;\n return stops[stops.length - 1]?.color ?? null;\n}\n\nexport function shellGradientPresetRecipe(preset: ShellGradientPreset): ShellGradientRecipe | null {\n const normalized = normalizeShellGradientPreset(preset);\n return normalized === 'none' ? null : SHELL_GRADIENT_RECIPES[normalized];\n}\n\nexport function shellGradientPresetOpacity(preset: ShellGradientPreset): string {\n return String(shellGradientPresetRecipe(preset)?.opacity ?? 0);\n}\n\nexport function isShellGradientPreset(value: string): value is ShellGradientPreset {\n return (SHELL_GRADIENT_PRESETS as string[]).includes(value);\n}\n\n/**\n * Coerce unknown/absent presets to the default. Runtime values escape the\n * type: removing the reflected `gradient-preset` attribute (e.g. an Angular\n * `[attr.gradient-preset]=\"null\"` binding) drives the prop to null past its\n * field default \u2014 without normalization the stop lookup interpolates the\n * literal string \"undefined\" into CSS and the wash silently disappears.\n */\nexport function normalizeShellGradientPreset(\n value: string | null | undefined,\n): ShellGradientPreset {\n return value != null && isShellGradientPreset(value) ? value : DEFAULT_SHELL_GRADIENT_PRESET;\n}\n\n/** Radial wash for a preset \u2014 transparent at top-left into the intent stop. `none` returns no image. */\nexport function buildShellRadialGradientForPreset(preset: ShellGradientPreset): string {\n const normalized = normalizeShellGradientPreset(preset);\n if (normalized === 'none') return 'none';\n\n return buildShellRadialGradientFromStops(SHELL_GRADIENT_RECIPES[normalized].stops);\n}\n\n/** Build the production shell geometry from an ordered set of design-time stops. */\nexport function buildShellRadialGradientFromStops(stops: readonly ShellGradientStop[]): string {\n const serialized = stops.map(stop => `${stop.color} ${stop.position}%`).join(', ');\n return `radial-gradient(${GRADIENT_GEOMETRY}, ${serialized})`;\n}\n\n/** Generic SwatchPicker sections for the fixed shell appearance presets. */\nexport function shellGradientPickerSections(): ShellGradientPickerSection[] {\n return [\n {\n options: [{\n value: 'none',\n label: SHELL_GRADIENT_PRESET_LABELS.none,\n preview: {\n backgroundColor: 'var(--color-background-secondary)',\n },\n }],\n },\n {\n options: SHELL_GRADIENT_WASH_PRESETS.map(preset => ({\n value: preset,\n label: SHELL_GRADIENT_PRESET_LABELS[preset],\n preview: {\n backgroundColor: 'var(--color-background-secondary)',\n backgroundImage: buildShellRadialGradientForPreset(preset),\n opacity: Number(shellGradientPresetOpacity(preset)),\n },\n })),\n },\n ];\n}\n", "/** CSS var names consumed by `ds-panel-nav` / `ds-bar-nav` inside `ds-app-shell`. */\nimport type { ShellGradientPreset } from './shell-gradient-presets';\nimport {\n DEFAULT_SHELL_GRADIENT_PRESET,\n buildShellRadialGradientForPreset,\n normalizeShellGradientPreset,\n} from './shell-gradient-presets';\n\nexport type { ShellGradientPreset } from './shell-gradient-presets';\nexport {\n DEFAULT_SHELL_GRADIENT_PRESET,\n SHELL_GRADIENT_PRESETS,\n SHELL_GRADIENT_PRESET_LABELS,\n buildShellRadialGradientForPreset,\n buildShellRadialGradientFromStops,\n isShellGradientPreset,\n shellGradientPresetOpacity,\n shellGradientPresetRecipe,\n shellGradientPresetStopToken,\n} from './shell-gradient-presets';\n\nexport const SHELL_GRADIENT_IMAGE_VAR = '--ds-shell-gradient-image';\nexport const SHELL_GRADIENT_SIZE_VAR = '--ds-shell-gradient-size';\nexport const SHELL_GRADIENT_POSITION_PANEL_VAR = '--ds-shell-gradient-position-panel';\nexport const SHELL_GRADIENT_POSITION_BAR_VAR = '--ds-shell-gradient-position-bar';\nexport const SHELL_GRADIENT_OPACITY_VAR = '--ds-shell-gradient-opacity';\n/** Per chrome-surface background-position \u2014 offsets wash + grid to shell row origin. */\nexport const SHELL_CHROME_SURFACE_POSITION_VAR = '--ds-shell-chrome-surface-position';\n\n/** Whether the shared chrome layer (secondary bg + optional wash) should mount. */\nexport function shellChromeLayerActive(preset: ShellGradientPreset): boolean {\n return normalizeShellGradientPreset(preset) !== 'none';\n}\n\n/**\n * Shell radial wash \u2014 same for panel and bar nav.\n * Tokens follow `data-theme` (light/dark intent stops).\n */\nexport function buildShellRadialGradient(\n preset: ShellGradientPreset = DEFAULT_SHELL_GRADIENT_PRESET,\n): string {\n return buildShellRadialGradientForPreset(preset);\n}\n\n/** Built-in radial image for the selected shell preset. */\nexport function shellGradientImage(\n preset: ShellGradientPreset = DEFAULT_SHELL_GRADIENT_PRESET,\n): string {\n return buildShellRadialGradient(preset);\n}\n\nexport interface ShellViewportDimensions {\n width: number;\n height: number;\n}\n\n/**\n * Viewport size for shell chrome with `background-attachment: fixed`.\n * Must not use the `ds-app-shell` element box \u2014 the shell can be shorter or\n * taller than the viewport when host height chains break or content overflows.\n */\nexport function readShellViewportDimensions(win?: Window): ShellViewportDimensions {\n const w = win ?? (typeof globalThis.window !== 'undefined' ? globalThis.window : undefined);\n if (!w) return { width: 0, height: 0 };\n\n const visual = w.visualViewport;\n return {\n width: Math.round(visual?.width ?? w.innerWidth),\n height: Math.round(visual?.height ?? w.innerHeight),\n };\n}\n\nexport interface ShellGradientLayout {\n width: number;\n height: number;\n panelWidth: number;\n}\n\n/** Pixel `background-size` for the fixed-attachment radial wash. */\nexport function shellGradientSize(layout: Pick<ShellGradientLayout, 'width' | 'height'>): string {\n return `${Math.round(layout.width)}px ${Math.round(layout.height)}px`;\n}\n\nexport function shellGradientPositionPanel(): string {\n return '0 0';\n}\n\nexport function shellGradientPositionBar(panelWidth: number): string {\n return `${-Math.round(panelWidth)}px 0`;\n}\n\n/** Phase-lock a chrome rect to the shell row coordinate system (wash + grid). */\nexport function shellChromeSurfacePosition(leftPx: number, topPx: number): string {\n return `${-Math.round(leftPx)}px ${-Math.round(topPx)}px`;\n}\n", "import type { ChoicePopupAnchorAlignment } from '../../utils/choice-popup-alignment';\nimport type { MenuAlign, MenuSide } from './menu-position';\n\n/** Placement props bindable on `ds-menu` (side, align, offsets). */\nexport interface MenuPlacement {\n side: MenuSide;\n align: MenuAlign;\n anchorAlignment: ChoicePopupAnchorAlignment;\n sideOffset: number | string;\n alignOffset: number | string;\n}\n\n/**\n * Canonical `ds-menu` placement for the **panel-nav footer user menu**.\n * Anchor from `dsNavUserAction` detail `{ anchor }` (id `ds-panel-nav-user-menu-anchor`).\n *\n * Not for BarNav overflow menus \u2014 those use `side=\"bottom\"` / `align=\"end\"` internally.\n * `align: 'end'` bottom-aligns the last choice cell on the anchor; the side offset nudges into the content area:\n * - `sideOffset` space-100 + space-050 (12px): 4px past the panel-nav outer edge (anchor is ~8px inset).\n * - `anchorAlignment: 'choice-cell'`: the shared section inset puts the last row edge on the footer user row.\n */\nexport const PANEL_NAV_USER_MENU_PLACEMENT = {\n side: 'right',\n align: 'end',\n anchorAlignment: 'choice-cell',\n sideOffset: 'calc(var(--dimension-space-100) + var(--dimension-space-050))',\n alignOffset: 0,\n} as const satisfies MenuPlacement;\n\n/**\n * Canonical placement for a menu opened by a PanelTools header action.\n * Matches BarNav overflow: the 32px trigger is 8px inside the 48px header, so\n * a 12px side offset places the popup 4px below the header edge. Choice-cell\n * alignment keeps the final menu item edge aligned with the trigger.\n */\nexport const PANEL_TOOLS_HEADER_MENU_PLACEMENT = {\n side: 'bottom',\n align: 'end',\n anchorAlignment: 'choice-cell',\n sideOffset: 'calc(var(--dimension-space-100) + var(--dimension-space-050))',\n alignOffset: 0,\n} as const satisfies MenuPlacement;\n", "/** Bubbling/composed events \u2014 `ds-app-shell` and `ds-bar-nav` coordinate during width motion. */\n\nexport const CHROME_TRANSITION_START = 'dsChromeTransitionStart';\nexport const CHROME_TRANSITION_END = 'dsChromeTransitionEnd';\n\nexport type ChromeTransitionSource = 'panel-nav' | 'panel-tools';\n\nexport interface ChromeTransitionDetail {\n source: ChromeTransitionSource;\n /** Panel-tools drawer motion direction; omitted for panel-nav. */\n phase?: 'opening' | 'closing';\n}\n\n/** Reference-counted gate \u2014 used while panel-nav width is transitioning. */\nexport class ChromeTransitionDepth {\n private depth = 0;\n\n enter(): void {\n this.depth += 1;\n }\n\n exit(): void {\n this.depth = Math.max(0, this.depth - 1);\n }\n\n get isActive(): boolean {\n return this.depth > 0;\n }\n}\n\n/** Idempotent gate for one physical chrome surface.\n * Duplicate start notifications still require only one matching end. */\nexport class ChromeTransitionGate {\n private active = false;\n\n enter(): void {\n this.active = true;\n }\n\n exit(): void {\n this.active = false;\n }\n\n get isActive(): boolean {\n return this.active;\n }\n}\n\nexport interface RafCoalescer {\n schedule(): void;\n cancel(): void;\n}\n\n/** Coalesce bursty layout work (ResizeObserver, prop churn) to one callback per frame. */\nexport function createRafCoalescer(onFrame: () => void): RafCoalescer {\n let rafId = 0;\n return {\n schedule() {\n if (rafId !== 0) return;\n rafId = requestAnimationFrame(() => {\n rafId = 0;\n onFrame();\n });\n },\n cancel() {\n if (rafId !== 0) {\n cancelAnimationFrame(rafId);\n rafId = 0;\n }\n },\n };\n}\n\nexport function readChromeTransitionSource(event: Event): ChromeTransitionSource | undefined {\n return (event as CustomEvent<ChromeTransitionDetail>).detail?.source;\n}\n\nexport function readChromeTransitionPhase(event: Event): ChromeTransitionDetail['phase'] {\n return (event as CustomEvent<ChromeTransitionDetail>).detail?.phase;\n}\n", "import { shellGradientPositionBar } from './shell-gradient';\n\n/** Read a `var(--token)` width in px using a hidden probe (works with calc() tokens). */\nexport function readCssVarWidthPx(context: HTMLElement, cssVarName: string): number {\n if (typeof document === 'undefined') return 0;\n\n const probe = document.createElement('div');\n probe.style.cssText =\n 'position:absolute;visibility:hidden;pointer-events:none;height:0;width:var(' +\n cssVarName +\n ');';\n context.appendChild(probe);\n const width = probe.getBoundingClientRect().width;\n context.removeChild(probe);\n return width;\n}\n\nexport interface PanelNavWidthTokens {\n expandedPx: number;\n collapsedPx: number;\n}\n\n/** Resolve panel-nav expanded/collapsed widths from scoped CSS vars on `.panel-nav`. */\nexport function readPanelNavWidthTokens(navRoot: HTMLElement): PanelNavWidthTokens {\n return {\n expandedPx: readCssVarWidthPx(navRoot, '--_nav-width'),\n collapsedPx: readCssVarWidthPx(navRoot, '--_nav-width-collapsed'),\n };\n}\n\nexport function isPanelNavCollapsed(\n panelNavHost: HTMLElement | null,\n navRoot: HTMLElement | null,\n): boolean {\n if (navRoot?.classList.contains('panel-nav--collapsed')) return true;\n const collapsedProp = (panelNavHost as (HTMLElement & { collapsed?: boolean }) | null)?.collapsed;\n return collapsedProp === true;\n}\n\nexport function panelWidthPxFromTokens(\n tokens: PanelNavWidthTokens,\n collapsed: boolean,\n): number {\n return collapsed ? tokens.collapsedPx : tokens.expandedPx;\n}\n\nexport function barGradientPositionFromPanelWidth(panelWidthPx: number): string {\n return shellGradientPositionBar(panelWidthPx);\n}\n", "import {\n SHELL_GRADIENT_POSITION_BAR_VAR,\n SHELL_GRADIENT_POSITION_PANEL_VAR,\n} from './shell-gradient';\n\n/** Per-badge background-position for shell gradient ring sampling. */\nexport const BADGE_GRADIENT_POSITION_VAR = '--_badge-gradient-position';\n\nexport interface GradientSurface {\n element: HTMLElement;\n chromeHost: HTMLElement;\n positionVar: string;\n}\n\n/** Whether the badge sits under a shell with an active wash preset. */\nexport function isShellGradientActive(from: HTMLElement): boolean {\n // Explicit <HTMLElement>: the inferred HTMLDsAppShellElement type only\n // resolves where @stencil/core types are installed \u2014 consumers importing\n // `@ds-mo/ui/shell` (raw TS) compile this without them.\n const shell = from.closest<HTMLElement>('ds-app-shell');\n return shell !== null && shell.getAttribute('gradient-preset') !== 'none';\n}\n\n/** Bar or panel chrome surface that owns the shell gradient stack. */\nexport function findGradientSurface(from: HTMLElement): GradientSurface | null {\n const barHost = from.closest('ds-bar-nav') as HTMLElement | null;\n if (barHost) {\n const root = barHost.shadowRoot ?? barHost;\n const element = root.querySelector('.bar-nav');\n if (element) {\n return {\n element: element as HTMLElement,\n chromeHost: barHost,\n positionVar: SHELL_GRADIENT_POSITION_BAR_VAR,\n };\n }\n }\n\n const panelHost = from.closest('ds-panel-nav') as HTMLElement | null;\n if (panelHost) {\n const root = panelHost.shadowRoot ?? panelHost;\n const element = root.querySelector('.panel-nav');\n if (element) {\n return {\n element: element as HTMLElement,\n chromeHost: panelHost,\n positionVar: SHELL_GRADIENT_POSITION_PANEL_VAR,\n };\n }\n }\n\n return null;\n}\n\ninterface ParsedPosition {\n x: number;\n y: number;\n}\n\n/** Parse a two-value CSS background-position (e.g. `-200px 0`). */\nexport function parseCssBackgroundPosition(value: string): ParsedPosition {\n const trimmed = value.trim();\n if (!trimmed) return { x: 0, y: 0 };\n\n const parts = trimmed.split(/\\s+/);\n const x = parseLength(parts[0] ?? '0');\n const y = parseLength(parts[1] ?? '0');\n return { x, y };\n}\n\nfunction parseLength(token: string): number {\n const px = token.match(/^(-?[\\d.]+)px$/);\n if (px) return Number(px[1]);\n return 0;\n}\n\n/**\n * Background position for a badge ring so the shell gradient aligns with nav chrome.\n * Uses badge center relative to the painted chrome surface.\n */\nexport function badgeGradientPosition(\n badgeHost: HTMLElement,\n surface: GradientSurface,\n shellPosition: string,\n): string {\n const badgeRect = badgeHost.getBoundingClientRect();\n const surfaceRect = surface.element.getBoundingClientRect();\n const anchorX = badgeRect.left + badgeRect.width / 2 - surfaceRect.left;\n const anchorY = badgeRect.top + badgeRect.height / 2 - surfaceRect.top;\n const { x, y } = parseCssBackgroundPosition(shellPosition);\n\n return `${Math.round(x - anchorX)}px ${Math.round(y - anchorY)}px`;\n}\n\n/** Resolve shell gradient position from chrome host custom properties. */\nexport function readShellGradientPosition(surface: GradientSurface): string {\n const styles = getComputedStyle(surface.chromeHost);\n return styles.getPropertyValue(surface.positionVar).trim() || '0 0';\n}\n\n/** Stamp `--_badge-gradient-position` on the badge host (fixed viewport chrome). */\nexport function syncBadgeGradientPosition(badgeHost: HTMLElement): void {\n if (!isShellGradientActive(badgeHost)) {\n badgeHost.style.removeProperty(BADGE_GRADIENT_POSITION_VAR);\n return;\n }\n\n badgeHost.style.setProperty(BADGE_GRADIENT_POSITION_VAR, '0 0');\n}\n"],
5
+ "mappings": ";AAIO,IAAM,sBAAsB;AAE5B,SAAS,iBAAiB,MAAi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BAA0B,SAAkC;AAC1E,QAAM,SAAS,iBAAiB,QAAQ,UAAU;AAClD,SAAO,OAAO,iBAAiB,QAAQ,WAAW,EAAE,KAAK,KAAK;AAChE;AAGO,SAAS,0BAA0B,WAA8B;AACtE,MAAI,CAAC,sBAAsB,SAAS,GAAG;AACrC,cAAU,MAAM,eAAe,2BAA2B;AAC1D;AAAA,EACF;AAEA,YAAU,MAAM,YAAY,6BAA6B,KAAK;AAChE;",
6
6
  "names": []
7
7
  }
@@ -0,0 +1,158 @@
1
+ {
2
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
3
+ "name": "agent-activity",
4
+ "title": "AgentActivity",
5
+ "description": "Collapsible, user-safe summary of agent work steps without private reasoning.",
6
+ "type": "registry:ui",
7
+ "meta": {
8
+ "library": "@ds-mo/ui",
9
+ "distribution": "npm",
10
+ "storybook": "https://zainadeel.github.io/compomo/?path=/story/agent-activity",
11
+ "source": "src/wc/components/AgentActivity/AgentActivity.tsx",
12
+ "intentStatus": "complete",
13
+ "intent": {
14
+ "audience": "specialized",
15
+ "status": "experimental",
16
+ "summary": "Collapsible, user-safe summary of agent work steps without private reasoning.",
17
+ "useWhen": [
18
+ "An agent response benefits from concise progress or completion summaries."
19
+ ],
20
+ "avoidWhen": [
21
+ "The content would reveal private chain-of-thought, hidden prompts, secrets, or raw internal traces."
22
+ ],
23
+ "commonlyComposedWith": [
24
+ "component:ds-agent-response",
25
+ "component:ds-loader"
26
+ ],
27
+ "patterns": [
28
+ "pattern:agent-chat"
29
+ ],
30
+ "accessibility": [
31
+ "Each step has textual state and description; animation and color are supplementary.",
32
+ "The disclosure uses native keyboard and expanded-state semantics."
33
+ ],
34
+ "states": [
35
+ "While collapsed, the summary follows the current user-safe activity and shimmers only while active; while expanded, the heading becomes Activity and the ordered list exposes every step.",
36
+ "Pending, active, complete, and error describe user-safe workflow progress."
37
+ ],
38
+ "responsiveBehavior": [
39
+ "Steps wrap within the response width."
40
+ ],
41
+ "references": [
42
+ {
43
+ "label": "Storybook examples",
44
+ "path": "src/wc/components/MessageScroller/MessageScroller.stories.ts"
45
+ }
46
+ ]
47
+ },
48
+ "api": {
49
+ "props": {
50
+ "heading": {
51
+ "type": "string",
52
+ "resolvedType": "string",
53
+ "attribute": "heading",
54
+ "default": "'Activity'",
55
+ "required": false,
56
+ "mutable": false
57
+ },
58
+ "items": {
59
+ "type": "AgentActivityItem[]",
60
+ "resolvedType": "AgentActivityItem[]",
61
+ "default": "[]",
62
+ "required": false,
63
+ "mutable": false
64
+ },
65
+ "open": {
66
+ "type": "boolean",
67
+ "resolvedType": "boolean",
68
+ "attribute": "open",
69
+ "default": "false",
70
+ "required": false,
71
+ "mutable": false
72
+ }
73
+ },
74
+ "events": [],
75
+ "methods": [],
76
+ "slots": []
77
+ },
78
+ "props": {
79
+ "heading": {
80
+ "type": "string",
81
+ "resolvedType": "string",
82
+ "attribute": "heading",
83
+ "default": "'Activity'",
84
+ "required": false,
85
+ "mutable": false
86
+ },
87
+ "items": {
88
+ "type": "AgentActivityItem[]",
89
+ "resolvedType": "AgentActivityItem[]",
90
+ "default": "[]",
91
+ "required": false,
92
+ "mutable": false
93
+ },
94
+ "open": {
95
+ "type": "boolean",
96
+ "resolvedType": "boolean",
97
+ "attribute": "open",
98
+ "default": "false",
99
+ "required": false,
100
+ "mutable": false
101
+ }
102
+ },
103
+ "events": [],
104
+ "methods": [],
105
+ "slots": [],
106
+ "exports": {
107
+ "customElement": "ds-agent-activity",
108
+ "react": "DsAgentActivity",
109
+ "angular": "DsAgentActivity"
110
+ },
111
+ "consumption": {
112
+ "install": "npm install @ds-mo/ui @ds-mo/tokens @ds-mo/icons",
113
+ "cssSetup": "import '@ds-mo/tokens';\nimport '@ds-mo/tokens/reset';\nimport '@ds-mo/tokens/globals';",
114
+ "customElements": {
115
+ "import": "import '@ds-mo/ui/dist/components/ds-agent-activity.js';",
116
+ "example": "<ds-agent-activity></ds-agent-activity>"
117
+ },
118
+ "react": {
119
+ "import": "import { DsAgentActivity } from '@ds-mo/ui/react';",
120
+ "example": "<DsAgentActivity />"
121
+ },
122
+ "angular": {
123
+ "import": "import { DsAgentActivity } from '@ds-mo/ui/angular/ds-agent-activity';",
124
+ "example": "<ds-agent-activity></ds-agent-activity>"
125
+ },
126
+ "complexPropertyNote": "Assign these non-primitive values as JavaScript properties: items.",
127
+ "peerDependencies": {
128
+ "required": [
129
+ "@ds-mo/tokens ^3.1.1",
130
+ "@ds-mo/icons ^6.2.0"
131
+ ],
132
+ "frameworks": "Custom Elements; React 18/19 wrappers; Angular 19-22 standalone adapters."
133
+ }
134
+ }
135
+ },
136
+ "dependencies": [
137
+ "@ds-mo/ui",
138
+ "@ds-mo/tokens",
139
+ "@ds-mo/icons"
140
+ ],
141
+ "registryDependencies": [
142
+ "icon",
143
+ "loader",
144
+ "text"
145
+ ],
146
+ "files": [
147
+ {
148
+ "path": "src/wc/components/AgentActivity/AgentActivity.css",
149
+ "content": ":host {\n display: block;\n}\n.agent-activity {\n margin: 0;\n}\nsummary {\n align-items: center;\n color: var(--color-foreground-secondary);\n cursor: pointer;\n display: flex;\n gap: var(--dimension-space-050);\n list-style: none;\n padding: var(--dimension-space-025) 0;\n}\nsummary::-webkit-details-marker {\n display: none;\n}\ndetails[open] summary ds-icon {\n transform: rotate(90deg);\n}\nds-text.agent-activity__summary-label {\n min-width: 0;\n}\nol {\n display: grid;\n gap: var(--dimension-space-075);\n list-style: none;\n margin: 0;\n padding: var(--dimension-space-100) 0 0 var(--dimension-space-200);\n}\n.agent-activity__item {\n align-items: start;\n display: grid;\n gap: var(--dimension-space-050);\n grid-template-columns: auto minmax(0, 1fr);\n}\n.agent-activity__marker {\n align-items: center;\n color: var(--color-foreground-faint-neutral);\n display: flex;\n padding-block-start: var(--dimension-space-025);\n}\n.agent-activity__item--active .agent-activity__marker {\n color: var(--color-foreground-faint-brand);\n}\n.agent-activity__item--error .agent-activity__marker {\n color: var(--color-foreground-bold-negative);\n}\n.agent-activity__item span:last-child {\n display: grid;\n gap: var(--dimension-space-025);\n}\n.agent-activity__pending-dot {\n width: var(--dimension-size-050);\n height: var(--dimension-size-050);\n border-radius: var(--dimension-radius-half);\n background: currentColor;\n}\n.agent-activity__state {\n position: absolute;\n width: var(--dimension-size-050);\n height: var(--dimension-size-050);\n overflow: hidden;\n clip-path: inset(50%);\n white-space: nowrap;\n}\n\n@media (prefers-reduced-motion: no-preference) {\n summary ds-icon {\n transition: transform var(--effect-motion-short-2);\n }\n}\n",
150
+ "type": "registry:ui"
151
+ },
152
+ {
153
+ "path": "src/wc/components/AgentActivity/AgentActivity.tsx",
154
+ "content": "import { Component, Prop, State, Watch, h, Host } from '@stencil/core';\nimport type { AgentActivityItem } from '../conversation-types';\n\n@Component({\n tag: 'ds-agent-activity',\n styleUrl: 'AgentActivity.css',\n scoped: true,\n})\nexport class AgentActivity {\n @Prop() items: AgentActivityItem[] = [];\n @Prop() heading: string = 'Activity';\n @Prop() open: boolean = false;\n\n @State() private expanded: boolean = false;\n\n componentWillLoad() {\n this.expanded = this.open;\n }\n\n @Watch('open')\n handleOpenChange(open: boolean) {\n this.expanded = open;\n }\n\n private get currentItem(): AgentActivityItem | undefined {\n return (\n this.items.find(item => item.state === 'active') ??\n this.items.find(item => item.state === 'error') ??\n [...this.items].reverse().find(item => item.state === 'complete') ??\n this.items.find(item => item.state === 'pending')\n );\n }\n\n private handleToggle = (event: Event) => {\n this.expanded = (event.currentTarget as HTMLDetailsElement).open;\n };\n\n private stateLabel(item: AgentActivityItem): string {\n if (item.state === 'active') return 'In progress';\n if (item.state === 'complete') return 'Complete';\n if (item.state === 'error') return 'Error';\n return 'Pending';\n }\n\n render() {\n return (\n <Host>\n <details class=\"agent-activity\" open={this.open} onToggle={this.handleToggle}>\n <summary>\n <ds-icon name=\"ChevronRight\" size=\"xs\" color=\"inherit\" />\n <ds-text\n class=\"agent-activity__summary-label\"\n variant=\"text-body-small\"\n shimmer={!this.expanded && this.currentItem?.state === 'active'}\n >\n {this.expanded ? this.heading : this.currentItem?.label ?? this.heading}\n </ds-text>\n </summary>\n <ol>\n {this.items.map(item => (\n <li class={`agent-activity__item agent-activity__item--${item.state}`}>\n <span class=\"agent-activity__marker\" aria-hidden=\"true\">\n {item.state === 'active' ? (\n <ds-loader size=\"xs\" color=\"inherit\" />\n ) : item.state === 'pending' ? (\n <span class=\"agent-activity__pending-dot\" />\n ) : (\n <ds-icon\n name={item.state === 'error' ? 'ErrorTriangle' : 'Check'}\n size=\"xs\"\n color=\"inherit\"\n />\n )}\n </span>\n <span>\n <ds-text variant=\"text-body-small\" shimmer={item.state === 'active'}>\n {item.label}\n </ds-text>\n {item.detail ? (\n <ds-text variant=\"text-caption\" color=\"secondary\">\n {item.detail}\n </ds-text>\n ) : null}\n <span class=\"agent-activity__state\">{this.stateLabel(item)}</span>\n </span>\n </li>\n ))}\n </ol>\n </details>\n </Host>\n );\n }\n}\n",
155
+ "type": "registry:ui"
156
+ }
157
+ ]
158
+ }
@@ -0,0 +1,211 @@
1
+ {
2
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
3
+ "name": "agent-response",
4
+ "title": "AgentResponse",
5
+ "description": "Ordered renderer for normalized immutable agent response parts inside a generic incoming message.",
6
+ "type": "registry:ui",
7
+ "meta": {
8
+ "library": "@ds-mo/ui",
9
+ "distribution": "npm",
10
+ "storybook": "https://zainadeel.github.io/compomo/?path=/story/agent-response",
11
+ "source": "src/wc/components/AgentResponse/AgentResponse.tsx",
12
+ "intentStatus": "complete",
13
+ "intent": {
14
+ "audience": "specialized",
15
+ "status": "experimental",
16
+ "summary": "Ordered renderer for normalized immutable agent response parts inside a generic incoming message.",
17
+ "useWhen": [
18
+ "An agent response combines Markdown, user-safe activity, display-only tools, attachments, and sources in authored order."
19
+ ],
20
+ "avoidWhen": [
21
+ "The component would be expected to own a model, transport, persistence, title generation, approval policy, or private reasoning."
22
+ ],
23
+ "commonlyComposedWith": [
24
+ "component:ds-message",
25
+ "component:ds-markdown",
26
+ "component:ds-agent-activity",
27
+ "component:ds-agent-tool-call",
28
+ "component:ds-agent-source-list"
29
+ ],
30
+ "patterns": [
31
+ "pattern:agent-chat"
32
+ ],
33
+ "accessibility": [
34
+ "Part order matches authored reading order and remains inside generic message semantics.",
35
+ "Streaming state supplements rather than replaces meaningful textual status."
36
+ ],
37
+ "states": [
38
+ "The owner replaces immutable part arrays as scripted or live output changes."
39
+ ],
40
+ "responsiveBehavior": [
41
+ "Rich content uses the wider ghost message treatment while respecting transcript constraints."
42
+ ],
43
+ "references": [
44
+ {
45
+ "label": "Storybook examples",
46
+ "path": "src/wc/components/MessageScroller/MessageScroller.stories.ts"
47
+ }
48
+ ]
49
+ },
50
+ "api": {
51
+ "props": {
52
+ "author": {
53
+ "type": "string",
54
+ "resolvedType": "string",
55
+ "attribute": "author",
56
+ "default": "''",
57
+ "required": false,
58
+ "mutable": false
59
+ },
60
+ "messageId": {
61
+ "type": "string",
62
+ "resolvedType": "string",
63
+ "attribute": "message-id",
64
+ "default": "''",
65
+ "required": false,
66
+ "mutable": false
67
+ },
68
+ "parts": {
69
+ "type": "AgentResponsePart[]",
70
+ "resolvedType": "AgentResponsePart[]",
71
+ "default": "[]",
72
+ "required": false,
73
+ "mutable": false
74
+ },
75
+ "showAuthor": {
76
+ "type": "boolean",
77
+ "resolvedType": "boolean",
78
+ "attribute": "show-author",
79
+ "default": "true",
80
+ "required": false,
81
+ "mutable": false
82
+ },
83
+ "streaming": {
84
+ "type": "boolean",
85
+ "resolvedType": "boolean",
86
+ "attribute": "streaming",
87
+ "default": "false",
88
+ "required": false,
89
+ "mutable": false
90
+ },
91
+ "timestamp": {
92
+ "type": "string",
93
+ "resolvedType": "string",
94
+ "attribute": "timestamp",
95
+ "default": "''",
96
+ "required": false,
97
+ "mutable": false
98
+ }
99
+ },
100
+ "events": [],
101
+ "methods": [],
102
+ "slots": []
103
+ },
104
+ "props": {
105
+ "author": {
106
+ "type": "string",
107
+ "resolvedType": "string",
108
+ "attribute": "author",
109
+ "default": "''",
110
+ "required": false,
111
+ "mutable": false
112
+ },
113
+ "messageId": {
114
+ "type": "string",
115
+ "resolvedType": "string",
116
+ "attribute": "message-id",
117
+ "default": "''",
118
+ "required": false,
119
+ "mutable": false
120
+ },
121
+ "parts": {
122
+ "type": "AgentResponsePart[]",
123
+ "resolvedType": "AgentResponsePart[]",
124
+ "default": "[]",
125
+ "required": false,
126
+ "mutable": false
127
+ },
128
+ "showAuthor": {
129
+ "type": "boolean",
130
+ "resolvedType": "boolean",
131
+ "attribute": "show-author",
132
+ "default": "true",
133
+ "required": false,
134
+ "mutable": false
135
+ },
136
+ "streaming": {
137
+ "type": "boolean",
138
+ "resolvedType": "boolean",
139
+ "attribute": "streaming",
140
+ "default": "false",
141
+ "required": false,
142
+ "mutable": false
143
+ },
144
+ "timestamp": {
145
+ "type": "string",
146
+ "resolvedType": "string",
147
+ "attribute": "timestamp",
148
+ "default": "''",
149
+ "required": false,
150
+ "mutable": false
151
+ }
152
+ },
153
+ "events": [],
154
+ "methods": [],
155
+ "slots": [],
156
+ "exports": {
157
+ "customElement": "ds-agent-response",
158
+ "react": "DsAgentResponse",
159
+ "angular": "DsAgentResponse"
160
+ },
161
+ "consumption": {
162
+ "install": "npm install @ds-mo/ui @ds-mo/tokens @ds-mo/icons",
163
+ "cssSetup": "import '@ds-mo/tokens';\nimport '@ds-mo/tokens/reset';\nimport '@ds-mo/tokens/globals';",
164
+ "customElements": {
165
+ "import": "import '@ds-mo/ui/dist/components/ds-agent-response.js';",
166
+ "example": "<ds-agent-response></ds-agent-response>"
167
+ },
168
+ "react": {
169
+ "import": "import { DsAgentResponse } from '@ds-mo/ui/react';",
170
+ "example": "<DsAgentResponse />"
171
+ },
172
+ "angular": {
173
+ "import": "import { DsAgentResponse } from '@ds-mo/ui/angular/ds-agent-response';",
174
+ "example": "<ds-agent-response></ds-agent-response>"
175
+ },
176
+ "complexPropertyNote": "Assign these non-primitive values as JavaScript properties: parts.",
177
+ "peerDependencies": {
178
+ "required": [
179
+ "@ds-mo/tokens ^3.1.1",
180
+ "@ds-mo/icons ^6.2.0"
181
+ ],
182
+ "frameworks": "Custom Elements; React 18/19 wrappers; Angular 19-22 standalone adapters."
183
+ }
184
+ }
185
+ },
186
+ "dependencies": [
187
+ "@ds-mo/ui",
188
+ "@ds-mo/tokens"
189
+ ],
190
+ "registryDependencies": [
191
+ "agent-activity",
192
+ "agent-source-list",
193
+ "agent-tool-call",
194
+ "attachment-list",
195
+ "markdown",
196
+ "message",
197
+ "message-bubble"
198
+ ],
199
+ "files": [
200
+ {
201
+ "path": "src/wc/components/AgentResponse/AgentResponse.css",
202
+ "content": ":host {\n display: block;\n width: 100%;\n}\n.agent-response {\n display: grid;\n gap: var(--dimension-space-150);\n min-width: 0;\n width: 100%;\n}\n",
203
+ "type": "registry:ui"
204
+ },
205
+ {
206
+ "path": "src/wc/components/AgentResponse/AgentResponse.tsx",
207
+ "content": "import { Component, Prop, h, Host } from '@stencil/core';\nimport type { AgentResponsePart } from '../conversation-types';\n\n@Component({ tag: 'ds-agent-response', styleUrl: 'AgentResponse.css', scoped: true })\nexport class AgentResponse {\n @Prop() messageId: string = '';\n @Prop() author: string = '';\n @Prop() showAuthor: boolean = true;\n @Prop() timestamp: string = '';\n @Prop() parts: AgentResponsePart[] = [];\n @Prop() streaming: boolean = false;\n\n private renderPart(part: AgentResponsePart) {\n switch (part.type) {\n case 'markdown':\n return (\n <ds-markdown\n key={part.id}\n content={part.content}\n streaming={part.state === 'streaming'}\n />\n );\n case 'activity':\n return <ds-agent-activity key={part.id} items={part.items} />;\n case 'tool':\n return (\n <ds-agent-tool-call\n key={part.id}\n name={part.name}\n label={part.label}\n state={part.state}\n input={part.input}\n output={part.output}\n error={part.error}\n />\n );\n case 'attachments':\n return <ds-attachment-list key={part.id} items={part.items} />;\n case 'sources':\n return <ds-agent-source-list key={part.id} items={part.items} />;\n }\n }\n\n render() {\n return (\n <Host>\n <ds-message\n messageId={this.messageId}\n direction=\"incoming\"\n author={this.author}\n showAuthor={this.showAuthor}\n timestamp={this.timestamp}\n streaming={this.streaming}\n >\n <slot name=\"avatar\" slot=\"avatar\" />\n <ds-message-bubble variant=\"ghost\">\n <div class=\"agent-response\">{this.parts.map(part => this.renderPart(part))}</div>\n </ds-message-bubble>\n <slot name=\"footer\" slot=\"footer\" />\n <slot name=\"actions\" slot=\"actions\" />\n </ds-message>\n </Host>\n );\n }\n}\n",
208
+ "type": "registry:ui"
209
+ }
210
+ ]
211
+ }