@ds-mo/ui 14.35.0 → 14.36.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 (326) hide show
  1. package/dist/.package-ready.json +1 -1
  2. package/dist/agent-patterns.json +1 -1
  3. package/dist/agent.json +1105 -187
  4. package/dist/angular/ds-button-inverted.d.ts +17 -0
  5. package/dist/angular/ds-button-inverted.js +46 -0
  6. package/dist/angular/ds-calendar.d.ts +15 -0
  7. package/dist/angular/ds-calendar.js +43 -0
  8. package/dist/angular/ds-field.d.ts +1 -1
  9. package/dist/angular/ds-field.js +1 -1
  10. package/dist/angular/ds-input-date.d.ts +15 -0
  11. package/dist/angular/ds-input-date.js +43 -0
  12. package/dist/angular/ds-input-time.d.ts +15 -0
  13. package/dist/angular/ds-input-time.js +43 -0
  14. package/dist/angular/ds-input.d.ts +1 -1
  15. package/dist/angular/ds-input.js +3 -3
  16. package/dist/angular/ds-select.d.ts +1 -1
  17. package/dist/angular/ds-select.js +3 -3
  18. package/dist/angular/ds-time-picker.d.ts +15 -0
  19. package/dist/angular/ds-time-picker.js +43 -0
  20. package/dist/angular/index.d.ts +1 -1
  21. package/dist/angular/index.js +5 -0
  22. package/dist/angular/proxies.d.ts +5 -0
  23. package/dist/angular/proxies.js +5 -0
  24. package/dist/angular/text-value-accessor.d.ts +1 -1
  25. package/dist/angular/text-value-accessor.js +2 -2
  26. package/dist/components/ds-agent-activity.js +1 -1
  27. package/dist/components/ds-agent-questionnaire.js +1 -1
  28. package/dist/components/ds-agent-response.js +1 -1
  29. package/dist/components/ds-agent-source-list.js +1 -1
  30. package/dist/components/ds-agent-tool-call.js +1 -1
  31. package/dist/components/ds-attachment-list.js +1 -1
  32. package/dist/components/ds-badge.js +1 -1
  33. package/dist/components/ds-banner.js +1 -1
  34. package/dist/components/ds-bar-action.js +1 -1
  35. package/dist/components/ds-bar-nav.js +1 -1
  36. package/dist/components/ds-bar-page-title.js +1 -1
  37. package/dist/components/ds-bar-title.js +1 -1
  38. package/dist/components/ds-bar-workflow.js +1 -1
  39. package/dist/components/ds-breadcrumb.js +1 -1
  40. package/dist/components/ds-button-filled.js +1 -1
  41. package/dist/components/ds-button-inverted.d.ts +11 -0
  42. package/dist/components/ds-button-inverted.js +2 -0
  43. package/dist/components/ds-button-inverted.js.map +1 -0
  44. package/dist/components/ds-button-unfilled.js +1 -1
  45. package/dist/components/ds-calendar.d.ts +11 -0
  46. package/dist/components/ds-calendar.js +2 -0
  47. package/dist/components/ds-calendar.js.map +1 -0
  48. package/dist/components/ds-card-action-center.js +1 -1
  49. package/dist/components/ds-card-chart.js +1 -1
  50. package/dist/components/ds-card-navigation.js +1 -1
  51. package/dist/components/ds-card-navigation.js.map +1 -1
  52. package/dist/components/ds-card-overview.js +1 -1
  53. package/dist/components/ds-card-setting.js +1 -1
  54. package/dist/components/ds-card-settings-scope.js +1 -1
  55. package/dist/components/ds-card-settings-scope.js.map +1 -1
  56. package/dist/components/ds-chart-legend.js +1 -1
  57. package/dist/components/ds-chart.js +1 -1
  58. package/dist/components/ds-checkbox.js +1 -1
  59. package/dist/components/ds-chip.js +1 -1
  60. package/dist/components/ds-code-block.js +1 -1
  61. package/dist/components/ds-conversation-list-item.js +1 -1
  62. package/dist/components/ds-conversation-list-item.js.map +1 -1
  63. package/dist/components/ds-conversation-list-section.js +1 -1
  64. package/dist/components/ds-conversation-list.js +1 -1
  65. package/dist/components/ds-divider.js +1 -1
  66. package/dist/components/ds-empty-state.js +1 -1
  67. package/dist/components/ds-field.js +1 -1
  68. package/dist/components/ds-filter-menu.js +1 -1
  69. package/dist/components/ds-input-date.d.ts +11 -0
  70. package/dist/components/ds-input-date.js +2 -0
  71. package/dist/components/ds-input-date.js.map +1 -0
  72. package/dist/components/ds-input-time.d.ts +11 -0
  73. package/dist/components/ds-input-time.js +2 -0
  74. package/dist/components/ds-input-time.js.map +1 -0
  75. package/dist/components/ds-input.js +1 -1
  76. package/dist/components/ds-markdown.js +1 -1
  77. package/dist/components/ds-menu.js +1 -1
  78. package/dist/components/ds-message-actions.js +1 -1
  79. package/dist/components/ds-message-bubble.js +1 -1
  80. package/dist/components/ds-message-bubble.js.map +1 -1
  81. package/dist/components/ds-message-composer.js +1 -1
  82. package/dist/components/ds-message-scroller.js +1 -1
  83. package/dist/components/ds-message.js +1 -1
  84. package/dist/components/ds-mobile-bar-nav.js +1 -1
  85. package/dist/components/ds-mobile-header.js +1 -1
  86. package/dist/components/ds-mobile-section-switcher.js +1 -1
  87. package/dist/components/ds-mobile-sheet-nav.js +1 -1
  88. package/dist/components/ds-modal.js +1 -1
  89. package/dist/components/ds-pagination.js +1 -1
  90. package/dist/components/ds-panel-nav.js +1 -1
  91. package/dist/components/ds-panel-sub-nav.js +1 -1
  92. package/dist/components/ds-panel-tool-header.js +1 -1
  93. package/dist/components/ds-panel-tool-search.js +1 -1
  94. package/dist/components/ds-panel-tools.js +1 -1
  95. package/dist/components/ds-paper-texture.js +1 -1
  96. package/dist/components/ds-radio.js +1 -1
  97. package/dist/components/ds-score.js +1 -1
  98. package/dist/components/ds-scroll-overlay.js +1 -1
  99. package/dist/components/ds-select.js +1 -1
  100. package/dist/components/ds-shell-app.js +1 -1
  101. package/dist/components/ds-shell-page.js +1 -1
  102. package/dist/components/ds-shell-tools.js +1 -1
  103. package/dist/components/ds-skeleton.js +1 -1
  104. package/dist/components/ds-slider.js +1 -1
  105. package/dist/components/ds-slider.js.map +1 -1
  106. package/dist/components/ds-swatch-picker.js +1 -1
  107. package/dist/components/ds-switch.js +1 -1
  108. package/dist/components/ds-tab-group.js +1 -1
  109. package/dist/components/ds-table-filter.js +1 -1
  110. package/dist/components/ds-table-filter.js.map +1 -1
  111. package/dist/components/ds-table-group.js +1 -1
  112. package/dist/components/ds-table-preferences.js +1 -1
  113. package/dist/components/ds-table-preferences.js.map +1 -1
  114. package/dist/components/ds-table-saved-views.js +1 -1
  115. package/dist/components/ds-table-saved-views.js.map +1 -1
  116. package/dist/components/ds-table-search.js +1 -1
  117. package/dist/components/ds-table-search.js.map +1 -1
  118. package/dist/components/ds-table-sort.js +1 -1
  119. package/dist/components/ds-table-sort.js.map +1 -1
  120. package/dist/components/ds-table-toolbar.js +1 -1
  121. package/dist/components/ds-table.js +1 -1
  122. package/dist/components/ds-tag.js +1 -1
  123. package/dist/components/ds-text.js +1 -1
  124. package/dist/components/ds-textarea.js +1 -1
  125. package/dist/components/ds-textarea.js.map +1 -1
  126. package/dist/components/ds-time-picker.d.ts +11 -0
  127. package/dist/components/ds-time-picker.js +2 -0
  128. package/dist/components/ds-time-picker.js.map +1 -0
  129. package/dist/components/ds-toast.js +1 -1
  130. package/dist/components/ds-tooltip-chart.js +1 -1
  131. package/dist/components/ds-tooltip.js +1 -1
  132. package/dist/components/ds-typing-indicator.js +1 -1
  133. package/dist/components/{p-CI7VfYC3.js → p-2GVGhrh0.js} +2 -2
  134. package/dist/components/p-7O-2D29W.js +2 -0
  135. package/dist/components/p-7O-2D29W.js.map +1 -0
  136. package/dist/components/{p-CE540WZ7.js → p-8oRkhvjy.js} +2 -2
  137. package/dist/components/p-B27_chI7.js +2 -0
  138. package/dist/components/p-B27_chI7.js.map +1 -0
  139. package/dist/components/{p-xHGqrz_p.js → p-BOhpMUwO.js} +2 -2
  140. package/dist/components/{p-DdspY23v.js → p-BV5T1hzN.js} +2 -2
  141. package/dist/components/{p-DTDLlinw.js → p-BWfzaSc3.js} +2 -2
  142. package/dist/components/{p-CLGtPE0K.js → p-BgLI9JoT.js} +2 -2
  143. package/dist/components/{p-DGzn4k4h.js → p-C-dHtQMi.js} +2 -2
  144. package/dist/components/p-C0CE2v5D.js +2 -0
  145. package/dist/components/{p-yZRXPHDe.js → p-C2JnoaWI.js} +2 -2
  146. package/dist/components/{p-umAf0fBn.js → p-C4m8y9ki.js} +2 -2
  147. package/dist/components/{p-CAxDdYjh.js → p-CDJ2Ntcq.js} +2 -2
  148. package/dist/components/{p-DQQFN2sw.js → p-CMQUuGvl.js} +2 -2
  149. package/dist/components/{p-BQaO7cg_.js → p-CQ5RwY2C.js} +2 -2
  150. package/dist/components/p-CQIh2yRP.js +2 -0
  151. package/dist/components/{p-C1_3CVma.js.map → p-CQIh2yRP.js.map} +1 -1
  152. package/dist/components/{p-DEGNrPLe.js → p-CWPT3aOB.js} +2 -2
  153. package/dist/components/p-CWog26I_.js +2 -0
  154. package/dist/components/p-CWog26I_.js.map +1 -0
  155. package/dist/components/{p-beRFLHbB.js → p-CaNCGKEJ.js} +2 -2
  156. package/dist/components/p-CbSUyv5B.js +2 -0
  157. package/dist/components/{p-BINSI_KF.js.map → p-CbSUyv5B.js.map} +1 -1
  158. package/dist/components/{p-Dhw_W8nk.js → p-Cc3ZUQlJ.js} +2 -2
  159. package/dist/components/p-Cc3ZUQlJ.js.map +1 -0
  160. package/dist/components/{p-DFjIBS5B.js → p-Ce4zy8q1.js} +2 -2
  161. package/dist/components/{p-BcdHgPi5.js → p-CeXf9-X3.js} +2 -2
  162. package/dist/components/{p-omPm8_vx.js → p-Cga6Ex0E.js} +2 -2
  163. package/dist/components/{p-y06IxxoN.js → p-Cl9phSf0.js} +2 -2
  164. package/dist/components/{p-Dk-8Ju0Q.js → p-ClJhuG5Y.js} +2 -2
  165. package/dist/components/{p-BmFeeR4q.js → p-CqW2eyiF.js} +2 -2
  166. package/dist/components/p-Cus1Sigh.js +2 -0
  167. package/dist/components/{p-N5SHSVo2.js.map → p-Cus1Sigh.js.map} +1 -1
  168. package/dist/components/{p-CzbsTZt7.js → p-Cxr0IQjC.js} +2 -2
  169. package/dist/components/{p-CwqFJMvP.js → p-D7yBIPB6.js} +2 -2
  170. package/dist/components/p-D8rpKod8.js +2 -0
  171. package/dist/components/p-D8rpKod8.js.map +1 -0
  172. package/dist/components/{p-DtLQIMsa.js → p-DBwa1OXP.js} +2 -2
  173. package/dist/components/{p-BQsVI_vO.js → p-DK9Ex3aY.js} +2 -2
  174. package/dist/components/{p-CqlBlv55.js → p-DLXXGgmf.js} +2 -2
  175. package/dist/components/{p-BnzsBNUY.js → p-DVd1TIxi.js} +2 -2
  176. package/dist/components/p-DZ58Sg5a.js.map +1 -1
  177. package/dist/components/{p-CZOiTaNa.js → p-DgG9W9N4.js} +2 -2
  178. package/dist/components/{p-mpk_Mm8_.js → p-DkfM55x8.js} +2 -2
  179. package/dist/components/p-DkikNSSO.js +2 -0
  180. package/dist/components/p-DkikNSSO.js.map +1 -0
  181. package/dist/components/{p-C7CZ9pnP.js → p-Dryt3COt.js} +2 -2
  182. package/dist/components/{p-eo_pmPqp.js → p-Ds51RgCi.js} +2 -2
  183. package/dist/components/p-DtkLtKY0.js +2 -0
  184. package/dist/components/p-DtkLtKY0.js.map +1 -0
  185. package/dist/components/{p-C8ek-1SP.js → p-DvzI2A_M.js} +2 -2
  186. package/dist/components/p-J5x-QtlD.js +2 -0
  187. package/dist/components/{p-beCz9OnD.js.map → p-J5x-QtlD.js.map} +1 -1
  188. package/dist/components/{p-CSnsz3Eb.js → p-Jaqdfw4E.js} +2 -2
  189. package/dist/components/p-MQ36mEgn.js +2 -0
  190. package/dist/components/{p-UAIxh67Q.js.map → p-MQ36mEgn.js.map} +1 -1
  191. package/dist/components/{p-BnWxbhFP.js → p-PmcUwTQ_.js} +2 -2
  192. package/dist/components/p-TjXGRPik.js +2 -0
  193. package/dist/components/{p-B-9fdIWv.js.map → p-TjXGRPik.js.map} +1 -1
  194. package/dist/components/{p-Cq_Qpe_C.js → p-bM3LH3kc.js} +2 -2
  195. package/dist/components/{p-BPhbwXOv.js → p-ji09W9el.js} +2 -2
  196. package/dist/components/{p-n68x-ZKp.js → p-neWTRxmf.js} +2 -2
  197. package/dist/components/{p-BPlWEidl.js → p-rYePOPbJ.js} +2 -2
  198. package/dist/components/{p-D44g2Kw1.js → p-su6y4hLK.js} +2 -2
  199. package/dist/components/p-su6y4hLK.js.map +1 -0
  200. package/dist/components/{p-DC69DgAR.js → p-tNQ0YulU.js} +2 -2
  201. package/dist/components/{p-Cwz9TPVS.js → p-x1wf38q3.js} +2 -2
  202. package/dist/docs/components.json +6485 -3451
  203. package/dist/lib/utils/button-render.d.ts +1 -1
  204. package/dist/lib/utils/clock-time.d.ts +22 -0
  205. package/dist/lib/utils/date-filter-value.d.ts +4 -0
  206. package/dist/lib/utils/index.d.ts +3 -1
  207. package/dist/lib/utils/index.js +133 -0
  208. package/dist/lib/utils/index.js.map +4 -4
  209. package/dist/mcp-data/registry/bar-title.json +2 -2
  210. package/dist/mcp-data/registry/button-inverted.json +580 -0
  211. package/dist/mcp-data/registry/calendar.json +273 -0
  212. package/dist/mcp-data/registry/card-navigation.json +4 -2
  213. package/dist/mcp-data/registry/field.json +19 -14
  214. package/dist/mcp-data/registry/filter-menu.json +6 -10
  215. package/dist/mcp-data/registry/input-date.json +516 -0
  216. package/dist/mcp-data/registry/input-time.json +535 -0
  217. package/dist/mcp-data/registry/input.json +56 -8
  218. package/dist/mcp-data/registry/registry.json +1118 -185
  219. package/dist/mcp-data/registry/select.json +63 -7
  220. package/dist/mcp-data/registry/table-saved-views.json +6 -4
  221. package/dist/mcp-data/registry/textarea.json +2 -2
  222. package/dist/mcp-data/registry/time-picker.json +259 -0
  223. package/dist/react/components.d.ts +5 -0
  224. package/dist/react/components.js +5 -0
  225. package/dist/react/ds-button-inverted.d.ts +13 -0
  226. package/dist/react/ds-button-inverted.js +15 -0
  227. package/dist/react/ds-calendar.d.ts +12 -0
  228. package/dist/react/ds-calendar.js +12 -0
  229. package/dist/react/ds-field.d.ts +1 -1
  230. package/dist/react/ds-input-date.d.ts +12 -0
  231. package/dist/react/ds-input-date.js +12 -0
  232. package/dist/react/ds-input-time.d.ts +12 -0
  233. package/dist/react/ds-input-time.js +12 -0
  234. package/dist/react/ds-time-picker.d.ts +12 -0
  235. package/dist/react/ds-time-picker.js +12 -0
  236. package/dist/types/components/BarTitle/BarTitle.d.ts +1 -0
  237. package/dist/types/components/BarTitle/bar-title-action-chrome.d.ts +2 -0
  238. package/dist/types/components/ButtonInverted/ButtonInverted.d.ts +83 -0
  239. package/dist/types/components/ButtonInverted/index.d.ts +2 -0
  240. package/dist/types/components/Calendar/Calendar.d.ts +32 -0
  241. package/dist/types/components/Calendar/calendar-grid.d.ts +19 -0
  242. package/dist/types/components/Field/Field.d.ts +7 -2
  243. package/dist/types/components/FilterMenu/FilterMenu.d.ts +0 -10
  244. package/dist/types/components/Input/Input.d.ts +10 -0
  245. package/dist/types/components/InputDate/InputDate.d.ts +78 -0
  246. package/dist/types/components/InputTime/InputTime.d.ts +80 -0
  247. package/dist/types/components/Select/Select.d.ts +8 -1
  248. package/dist/types/components/TimePicker/TimePicker.d.ts +33 -0
  249. package/dist/types/components.d.ts +858 -27
  250. package/dist/types/utils/button-render.d.ts +1 -1
  251. package/dist/types/utils/clock-time.d.ts +23 -0
  252. package/dist/types/utils/date-filter-value.d.ts +4 -0
  253. package/dist/types/utils/index.d.ts +3 -1
  254. package/dist/vue/components.d.ts +5 -0
  255. package/dist/vue/components.js +5 -0
  256. package/dist/vue/ds-button-inverted.d.ts +3 -0
  257. package/dist/vue/ds-button-inverted.js +33 -0
  258. package/dist/vue/ds-calendar.d.ts +3 -0
  259. package/dist/vue/ds-calendar.js +16 -0
  260. package/dist/vue/ds-input-date.d.ts +3 -0
  261. package/dist/vue/ds-input-date.js +31 -0
  262. package/dist/vue/ds-input-time.d.ts +3 -0
  263. package/dist/vue/ds-input-time.js +32 -0
  264. package/dist/vue/ds-input.js +2 -0
  265. package/dist/vue/ds-select.js +3 -0
  266. package/dist/vue/ds-time-picker.d.ts +3 -0
  267. package/dist/vue/ds-time-picker.js +16 -0
  268. package/package.json +1 -1
  269. package/dist/components/p-B-9fdIWv.js +0 -2
  270. package/dist/components/p-BINSI_KF.js +0 -2
  271. package/dist/components/p-BbfBvMRR.js +0 -2
  272. package/dist/components/p-BbfBvMRR.js.map +0 -1
  273. package/dist/components/p-C1_3CVma.js +0 -2
  274. package/dist/components/p-Cmj04E5Q.js +0 -2
  275. package/dist/components/p-Cmj04E5Q.js.map +0 -1
  276. package/dist/components/p-D44g2Kw1.js.map +0 -1
  277. package/dist/components/p-D_u8WhlU.js +0 -2
  278. package/dist/components/p-Dhw_W8nk.js.map +0 -1
  279. package/dist/components/p-FPZbS19l.js +0 -2
  280. package/dist/components/p-FPZbS19l.js.map +0 -1
  281. package/dist/components/p-N5SHSVo2.js +0 -2
  282. package/dist/components/p-QjkufCcn.js +0 -2
  283. package/dist/components/p-QjkufCcn.js.map +0 -1
  284. package/dist/components/p-UAIxh67Q.js +0 -2
  285. package/dist/components/p-beCz9OnD.js +0 -2
  286. package/dist/types/components/FilterMenu/filter-menu-calendar.d.ts +0 -13
  287. /package/dist/components/{p-CI7VfYC3.js.map → p-2GVGhrh0.js.map} +0 -0
  288. /package/dist/components/{p-CE540WZ7.js.map → p-8oRkhvjy.js.map} +0 -0
  289. /package/dist/components/{p-xHGqrz_p.js.map → p-BOhpMUwO.js.map} +0 -0
  290. /package/dist/components/{p-DdspY23v.js.map → p-BV5T1hzN.js.map} +0 -0
  291. /package/dist/components/{p-DTDLlinw.js.map → p-BWfzaSc3.js.map} +0 -0
  292. /package/dist/components/{p-CLGtPE0K.js.map → p-BgLI9JoT.js.map} +0 -0
  293. /package/dist/components/{p-DGzn4k4h.js.map → p-C-dHtQMi.js.map} +0 -0
  294. /package/dist/components/{p-D_u8WhlU.js.map → p-C0CE2v5D.js.map} +0 -0
  295. /package/dist/components/{p-yZRXPHDe.js.map → p-C2JnoaWI.js.map} +0 -0
  296. /package/dist/components/{p-umAf0fBn.js.map → p-C4m8y9ki.js.map} +0 -0
  297. /package/dist/components/{p-CAxDdYjh.js.map → p-CDJ2Ntcq.js.map} +0 -0
  298. /package/dist/components/{p-DQQFN2sw.js.map → p-CMQUuGvl.js.map} +0 -0
  299. /package/dist/components/{p-BQaO7cg_.js.map → p-CQ5RwY2C.js.map} +0 -0
  300. /package/dist/components/{p-DEGNrPLe.js.map → p-CWPT3aOB.js.map} +0 -0
  301. /package/dist/components/{p-beRFLHbB.js.map → p-CaNCGKEJ.js.map} +0 -0
  302. /package/dist/components/{p-DFjIBS5B.js.map → p-Ce4zy8q1.js.map} +0 -0
  303. /package/dist/components/{p-BcdHgPi5.js.map → p-CeXf9-X3.js.map} +0 -0
  304. /package/dist/components/{p-omPm8_vx.js.map → p-Cga6Ex0E.js.map} +0 -0
  305. /package/dist/components/{p-y06IxxoN.js.map → p-Cl9phSf0.js.map} +0 -0
  306. /package/dist/components/{p-Dk-8Ju0Q.js.map → p-ClJhuG5Y.js.map} +0 -0
  307. /package/dist/components/{p-BmFeeR4q.js.map → p-CqW2eyiF.js.map} +0 -0
  308. /package/dist/components/{p-CzbsTZt7.js.map → p-Cxr0IQjC.js.map} +0 -0
  309. /package/dist/components/{p-CwqFJMvP.js.map → p-D7yBIPB6.js.map} +0 -0
  310. /package/dist/components/{p-DtLQIMsa.js.map → p-DBwa1OXP.js.map} +0 -0
  311. /package/dist/components/{p-BQsVI_vO.js.map → p-DK9Ex3aY.js.map} +0 -0
  312. /package/dist/components/{p-CqlBlv55.js.map → p-DLXXGgmf.js.map} +0 -0
  313. /package/dist/components/{p-BnzsBNUY.js.map → p-DVd1TIxi.js.map} +0 -0
  314. /package/dist/components/{p-CZOiTaNa.js.map → p-DgG9W9N4.js.map} +0 -0
  315. /package/dist/components/{p-mpk_Mm8_.js.map → p-DkfM55x8.js.map} +0 -0
  316. /package/dist/components/{p-C7CZ9pnP.js.map → p-Dryt3COt.js.map} +0 -0
  317. /package/dist/components/{p-eo_pmPqp.js.map → p-Ds51RgCi.js.map} +0 -0
  318. /package/dist/components/{p-C8ek-1SP.js.map → p-DvzI2A_M.js.map} +0 -0
  319. /package/dist/components/{p-CSnsz3Eb.js.map → p-Jaqdfw4E.js.map} +0 -0
  320. /package/dist/components/{p-BnWxbhFP.js.map → p-PmcUwTQ_.js.map} +0 -0
  321. /package/dist/components/{p-Cq_Qpe_C.js.map → p-bM3LH3kc.js.map} +0 -0
  322. /package/dist/components/{p-BPhbwXOv.js.map → p-ji09W9el.js.map} +0 -0
  323. /package/dist/components/{p-n68x-ZKp.js.map → p-neWTRxmf.js.map} +0 -0
  324. /package/dist/components/{p-BPlWEidl.js.map → p-rYePOPbJ.js.map} +0 -0
  325. /package/dist/components/{p-DC69DgAR.js.map → p-tNQ0YulU.js.map} +0 -0
  326. /package/dist/components/{p-Cwz9TPVS.js.map → p-x1wf38q3.js.map} +0 -0
@@ -568,12 +568,12 @@
568
568
  },
569
569
  {
570
570
  "path": "src/wc/components/BarTitle/BarTitle.tsx",
571
- "content": "import {\n Component,\n Element,\n Event,\n EventEmitter,\n h,\n Host,\n Prop,\n State,\n Watch,\n} from '@stencil/core';\nimport type { BreadcrumbItem, BreadcrumbSelectDetail } from '../Breadcrumb/breadcrumb-types';\nimport type { MenuItemData, MenuSection } from '../Menu/menu-types';\nimport {\n type BarTitleActionConfigItem,\n type BarTitleActionItem,\n type BarTitlePrimaryAction,\n type BarTitleSectionItem,\n type BarTitlePlacement,\n type BarTitleVariant,\n} from './bar-title-types';\nimport {\n availableBarTitleActionMenuIds,\n barTitleActionIdIssues,\n findBarTitleAction,\n overflowBarTitleActionSections,\n resolveBarTitleActionItems,\n visibleBarTitleActions,\n} from './bar-title-actions';\nimport {\n type FocusableBarTitleButton,\n barTitleActionMenuDomId,\n renderBarTitleActionMenus,\n renderBarTitleActions,\n renderBarTitleBack,\n renderBarTitleOverflowMenu,\n renderBarTitleSectionTrigger,\n restoreBarTitleActionFocus,\n} from './bar-title-action-chrome';\nimport {\n barTitleSectionMenuSections,\n barTitleSectionTriggerAriaLabel,\n effectiveBarTitleSectionValue,\n selectableBarTitleSections,\n selectedBarTitleSectionLabel,\n} from './bar-title-sections';\n\nlet nextBarTitleId = 0;\n\n@Component({\n tag: 'ds-bar-title',\n styleUrl: 'BarTitle.css',\n scoped: true,\n})\nexport class BarTitle {\n @Element() el!: HTMLElement;\n\n /** The page's single visible h1. */\n @Prop() heading!: string;\n\n /** Optional supporting copy shown in the expanded presentation. */\n @Prop() description: string = '';\n\n /** Show the leading page-level Back action. */\n @Prop({ attribute: 'show-back' }) showBack: boolean = false;\n\n /** Accessible name for the leading Back action. */\n @Prop() backAriaLabel: string = 'Back';\n\n /** Visible parent-page label used by the expanded breadcrumb when breadcrumbs is empty. */\n @Prop() backLabel: string = 'Back';\n\n /** Optional expanded ancestor path. Compact variants continue to use the Back action. */\n @Prop() breadcrumbs: BreadcrumbItem[] = [];\n\n /** Accessible name for the expanded breadcrumb navigation landmark. */\n @Prop() breadcrumbAriaLabel: string = 'Breadcrumb';\n\n /** Optional page sections exposed through the active-section menu. */\n @Prop() sections: BarTitleSectionItem[] = [];\n\n /** Id of the active page section. */\n @Prop() value: string = '';\n\n /** Accessible name for the page-section menu. */\n @Prop() sectionsAriaLabel: string = 'Change page section';\n\n /** The one highest-emphasis page action. */\n @Prop() primaryAction: BarTitlePrimaryAction | null = null;\n\n /** Secondary page actions shown in the overflow menu. Dividers create groups. */\n @Prop() actions: BarTitleActionItem[] = [];\n\n /**\n * Ordered page-header actions. When supplied, this replaces the legacy\n * primaryAction/actions presentation while preserving the same dsAction event.\n */\n @Prop() actionItems?: BarTitleActionConfigItem[];\n\n /** Accessible name for the page-actions menu. */\n @Prop() actionsAriaLabel: string = 'More page actions';\n\n /** Explicit visual/capacity variant. ShellPage owns automatic selection. */\n @Prop() variant: BarTitleVariant = 'expanded';\n\n /** Page-header placement, or compact application-shell bar placement. */\n @Prop({ reflect: true }) placement: BarTitlePlacement = 'page';\n\n /** Draw the page-title divider beneath the header. */\n @Prop() showDivider: boolean = true;\n\n /** Override divider visibility for compact and constrained variants. */\n @Prop() showCompactDivider?: boolean;\n\n /** Emitted when the leading Back action is activated. */\n @Event() dsBack!: EventEmitter<MouseEvent>;\n\n /** Emitted when an authored expanded breadcrumb item is activated. */\n @Event({ cancelable: true }) dsBreadcrumbSelect!: EventEmitter<BreadcrumbSelectDetail>;\n\n /** Emitted with the newly selected page-section id. */\n @Event() dsSectionChange!: EventEmitter<string>;\n\n /** Emitted with the activated primary or overflow action id. */\n @Event() dsAction!: EventEmitter<string>;\n\n @State() private sectionMenuOpen = false;\n @State() private openActionMenuId = '';\n @State() private surfaceActionMenuId = '';\n @State() private sectionSurfaceOpen = false;\n @State() private sectionMenuInitialFocusVisible = false;\n @State() private actionMenuInitialFocusVisible = false;\n\n private readonly instanceId = nextBarTitleId++;\n private readonly sectionMenuTriggerId = `bar-title-section-trigger-${this.instanceId}`;\n private readonly sectionMenuId = `bar-title-section-menu-${this.instanceId}`;\n private readonly actionMenuTriggerId = `bar-title-action-trigger-${this.instanceId}`;\n private readonly actionMenuId = `bar-title-action-menu-${this.instanceId}`;\n private sectionTriggerEl: HTMLButtonElement | null = null;\n private actionTriggerEl: FocusableBarTitleButton | null = null;\n private actionTriggerEls = new Map<string, FocusableBarTitleButton>();\n\n componentWillLoad() {\n if (this.el.closest('ds-shell-page')) {\n this.el.setAttribute('data-shell-page-syncing', '');\n }\n this.reportActionIdIssues();\n }\n\n @Watch('sections')\n handleSectionsChange() {\n if (!this.hasSectionSelector) {\n this.closeSectionMenu();\n this.sectionSurfaceOpen = false;\n }\n }\n\n @Watch('actions')\n @Watch('primaryAction')\n @Watch('actionItems')\n handleActionsChange() {\n this.reportActionIdIssues();\n if (!this.availableActionMenuIds.has(this.openActionMenuId)) this.closeActionMenu();\n if (!this.availableActionMenuIds.has(this.surfaceActionMenuId)) this.surfaceActionMenuId = '';\n }\n\n private reportActionIdIssues() {\n for (const issue of barTitleActionIdIssues(this.resolvedActionItems)) {\n console.warn(`[ds-bar-title] ${issue}`);\n }\n }\n\n private get compact(): boolean {\n return this.effectiveVariant !== 'expanded';\n }\n\n private get effectiveVariant(): BarTitleVariant {\n return this.placement === 'shell-bar' ? 'compact' : this.variant;\n }\n\n private get dividerVisible(): boolean {\n return this.compact ? (this.showCompactDivider ?? this.showDivider) : this.showDivider;\n }\n\n private get expandedBreadcrumbItems(): BreadcrumbItem[] {\n if (this.breadcrumbs.length > 0) return this.breadcrumbs;\n if (!this.showBack) return [];\n return [\n {\n id: 'back',\n label: this.backLabel,\n ariaLabel: this.backAriaLabel,\n },\n ];\n }\n\n private get primaryCollapsed(): boolean {\n return (\n this.actionItems === undefined &&\n this.effectiveVariant === 'constrained' &&\n this.primaryAction !== null &&\n (this.primaryAction.collapse ?? 'auto') === 'auto'\n );\n }\n\n private get selectableSections() {\n return selectableBarTitleSections(this.sections);\n }\n\n private get hasSectionSelector(): boolean {\n return this.selectableSections.length > 1;\n }\n\n private get effectiveValue(): string {\n return effectiveBarTitleSectionValue(this.sections, this.value);\n }\n\n private get selectedSectionLabel(): string {\n return selectedBarTitleSectionLabel(this.sections, this.value);\n }\n\n private get sectionTriggerAriaLabel(): string {\n return barTitleSectionTriggerAriaLabel(this.sectionsAriaLabel, this.selectedSectionLabel);\n }\n\n private get sectionMenuSections() {\n return barTitleSectionMenuSections(this.sections, this.effectiveValue);\n }\n\n private get resolvedActionItems(): BarTitleActionConfigItem[] {\n return resolveBarTitleActionItems(this.actionItems, this.primaryAction, this.actions);\n }\n\n private get visibleActions(): BarTitleActionConfigItem[] {\n return visibleBarTitleActions(this.resolvedActionItems, this.effectiveVariant);\n }\n\n private get actionMenuSections(): MenuSection[] {\n return overflowBarTitleActionSections(this.resolvedActionItems, this.effectiveVariant);\n }\n\n private get showActionMenuTrigger(): boolean {\n return this.actionMenuSections.length > 0;\n }\n\n private get availableActionMenuIds(): Set<string> {\n return availableBarTitleActionMenuIds(this.visibleActions, this.showActionMenuTrigger);\n }\n\n private toggleSectionMenu = (event: MouseEvent) => {\n this.sectionMenuInitialFocusVisible = event.detail === 0;\n this.openActionMenuId = '';\n this.sectionMenuOpen = !this.sectionMenuOpen;\n if (this.sectionMenuOpen) this.sectionSurfaceOpen = true;\n };\n\n private closeSectionMenu = () => {\n this.sectionMenuOpen = false;\n };\n\n private handleSectionSelect = (event: CustomEvent<MenuItemData>) => {\n const id = String(event.detail?.value ?? '');\n const selected = this.selectableSections.find(section => section.id === id);\n if (!selected || selected.isInactive) return;\n this.closeSectionMenu();\n this.dsSectionChange.emit(id);\n requestAnimationFrame(() => this.sectionTriggerEl?.focus());\n };\n\n private toggleActionMenu = (id: string, event: MouseEvent) => {\n this.actionMenuInitialFocusVisible = event.detail === 0;\n this.sectionMenuOpen = false;\n this.openActionMenuId = this.openActionMenuId === id ? '' : id;\n if (this.openActionMenuId) this.surfaceActionMenuId = this.openActionMenuId;\n };\n\n private finishActionMenuClose = (event: CustomEvent<void>) => {\n const id = this.surfaceActionMenuId;\n const domId =\n id === '__overflow'\n ? this.actionMenuId\n : barTitleActionMenuDomId('bar-title', this.instanceId, this.resolvedActionItems, id);\n if (this.openActionMenuId !== id && (event.target as HTMLElement).id === domId) {\n this.surfaceActionMenuId = '';\n }\n };\n\n private closeActionMenu = () => {\n this.openActionMenuId = '';\n };\n\n private handleActionSelect = (event: CustomEvent<MenuItemData>) => {\n const id = String(event.detail?.value ?? '');\n const action = findBarTitleAction(this.resolvedActionItems, id);\n if (!action || action.isInactive || ('isLoading' in action && action.isLoading)) return;\n const menuId = this.openActionMenuId;\n this.closeActionMenu();\n this.dsAction.emit(id);\n requestAnimationFrame(() => {\n void restoreBarTitleActionFocus({\n menuId,\n overflowTrigger: this.actionTriggerEl,\n actionTriggers: this.actionTriggerEls,\n resolvedActionItems: this.resolvedActionItems,\n });\n });\n };\n\n private chromeActionOptions() {\n return {\n classPrefix: 'bar-title',\n compact: this.compact,\n visibleActions: this.visibleActions,\n showOverflowTrigger: this.showActionMenuTrigger,\n actionItems: this.actionItems,\n primaryAction: this.primaryAction,\n resolvedActionItems: this.resolvedActionItems,\n instanceId: this.instanceId,\n openActionMenuId: this.openActionMenuId,\n surfaceActionMenuId: this.surfaceActionMenuId,\n actionsAriaLabel: this.actionsAriaLabel,\n actionMenuTriggerId: this.actionMenuTriggerId,\n actionMenuId: this.actionMenuId,\n actionTriggers: this.actionTriggerEls,\n setOverflowTriggerEl: (el: FocusableBarTitleButton | null) => {\n this.actionTriggerEl = el;\n },\n toggleActionMenu: this.toggleActionMenu,\n emitAction: (id: string) => this.dsAction.emit(id),\n };\n }\n\n private renderSectionSelector() {\n if (!this.hasSectionSelector) return null;\n return [\n <div class=\"bar-title__divider\" aria-hidden=\"true\" />,\n renderBarTitleSectionTrigger({\n classPrefix: 'bar-title',\n triggerId: this.sectionMenuTriggerId,\n menuId: this.sectionMenuId,\n open: this.sectionMenuOpen,\n surfaceOpen: this.sectionSurfaceOpen,\n ariaLabel: this.sectionTriggerAriaLabel,\n selectedLabel: this.selectedSectionLabel,\n setTriggerEl: el => {\n this.sectionTriggerEl = el;\n },\n onToggle: this.toggleSectionMenu,\n }),\n ];\n }\n\n private renderActions() {\n return renderBarTitleActions(this.chromeActionOptions());\n }\n\n private renderActionMenus() {\n return renderBarTitleActionMenus({\n classPrefix: 'bar-title',\n visibleActions: this.visibleActions,\n instanceId: this.instanceId,\n resolvedActionItems: this.resolvedActionItems,\n openActionMenuId: this.openActionMenuId,\n actionMenuInitialFocusVisible: this.actionMenuInitialFocusVisible,\n overflowTrigger: this.actionTriggerEl,\n actionTriggers: this.actionTriggerEls,\n closeActionMenu: this.closeActionMenu,\n finishActionMenuClose: this.finishActionMenuClose,\n handleActionSelect: this.handleActionSelect,\n });\n }\n\n private handleBreadcrumbSelect = (event: CustomEvent<BreadcrumbSelectDetail>) => {\n if (this.breadcrumbs.length === 0) {\n this.dsBack.emit(event.detail.originalEvent);\n return;\n }\n const forwarded = this.dsBreadcrumbSelect.emit(event.detail);\n if (forwarded.defaultPrevented) event.preventDefault();\n };\n\n private renderBreadcrumb() {\n const items = this.expandedBreadcrumbItems;\n if (items.length === 0) return null;\n return (\n <ds-breadcrumb\n class=\"bar-title__breadcrumb\"\n items={items}\n ariaLabel={this.breadcrumbAriaLabel}\n onDsSelect={this.handleBreadcrumbSelect}\n />\n );\n }\n\n private renderBack() {\n return renderBarTitleBack({\n classPrefix: 'bar-title',\n showBack: this.showBack,\n backAriaLabel: this.backAriaLabel,\n onBack: event => this.dsBack.emit(event),\n });\n }\n\n render() {\n const compact = this.compact;\n return (\n <Host\n class={{\n 'bar-title-host--compact': compact,\n 'bar-title-host--expanded': this.effectiveVariant === 'expanded',\n 'bar-title-host--constrained': this.effectiveVariant === 'constrained',\n 'bar-title-host--has-description': !!this.description,\n 'bar-title-host--has-back': this.showBack,\n 'bar-title-host--has-breadcrumb': !compact && this.expandedBreadcrumbItems.length > 0,\n 'bar-title-host--shell-bar': this.placement === 'shell-bar',\n }}\n >\n <div\n class={{\n 'bar-title': true,\n 'bar-title--divider-hidden': !this.dividerVisible,\n 'ds-chrome-header': compact,\n }}\n >\n <div class=\"bar-title__inner\">\n {!compact ? this.renderBreadcrumb() : null}\n <div class=\"bar-title__row\">\n <div class=\"bar-title__leading\">\n <div class=\"bar-title__title-row\" data-shell-page-header-anchor>\n <div class=\"bar-title__identity\">\n {compact ? this.renderBack() : null}\n <ds-text\n class=\"bar-title__heading ds-control--md\"\n variant={compact ? 'text-title-small' : 'text-title-medium'}\n emphasis\n color=\"primary\"\n as=\"h1\"\n lineTruncation={1}\n >\n {this.heading}\n </ds-text>\n </div>\n {this.renderSectionSelector()}\n </div>\n {this.description && !compact ? (\n <ds-text\n class=\"bar-title__description\"\n variant=\"text-body-small\"\n color=\"secondary\"\n lineTruncation={2}\n wrap=\"wrap\"\n as=\"p\"\n >\n {this.description}\n </ds-text>\n ) : null}\n </div>\n {this.renderActions()}\n </div>\n </div>\n </div>\n\n {this.hasSectionSelector ? (\n <ds-menu\n id={this.sectionMenuId}\n class=\"bar-title__section-menu\"\n anchorId={this.sectionMenuTriggerId}\n menuLabel={this.sectionsAriaLabel}\n open={this.sectionMenuOpen}\n initialFocusVisible={this.sectionMenuInitialFocusVisible}\n sections={this.sectionMenuSections}\n onDsClose={this.closeSectionMenu}\n onDsAfterClose={() => {\n if (!this.sectionMenuOpen) this.sectionSurfaceOpen = false;\n }}\n onDsSelect={this.handleSectionSelect}\n />\n ) : null}\n\n {this.renderActionMenus()}\n\n {renderBarTitleOverflowMenu({\n classPrefix: 'bar-title',\n showOverflowTrigger: this.showActionMenuTrigger,\n actionMenuId: this.actionMenuId,\n actionMenuTriggerId: this.actionMenuTriggerId,\n actionsAriaLabel: this.actionsAriaLabel,\n open: this.openActionMenuId === '__overflow',\n actionMenuInitialFocusVisible: this.actionMenuInitialFocusVisible,\n actionMenuSections: this.actionMenuSections,\n closeActionMenu: this.closeActionMenu,\n finishActionMenuClose: this.finishActionMenuClose,\n handleActionSelect: this.handleActionSelect,\n })}\n </Host>\n );\n }\n}\n",
571
+ "content": "import {\n Component,\n Element,\n Event,\n EventEmitter,\n h,\n Host,\n Prop,\n State,\n Watch,\n} from '@stencil/core';\nimport type { BreadcrumbItem, BreadcrumbSelectDetail } from '../Breadcrumb/breadcrumb-types';\nimport type { MenuItemData, MenuSection } from '../Menu/menu-types';\nimport {\n type BarTitleActionConfigItem,\n type BarTitleActionItem,\n type BarTitlePrimaryAction,\n type BarTitleSectionItem,\n type BarTitlePlacement,\n type BarTitleVariant,\n} from './bar-title-types';\nimport {\n availableBarTitleActionMenuIds,\n barTitleActionIdIssues,\n findBarTitleAction,\n overflowBarTitleActionSections,\n resolveBarTitleActionItems,\n visibleBarTitleActions,\n} from './bar-title-actions';\nimport {\n type FocusableBarTitleButton,\n barTitleActionMenuDomId,\n renderBarTitleActionMenus,\n renderBarTitleActions,\n renderBarTitleBack,\n renderBarTitleOverflowMenu,\n renderBarTitleSectionTrigger,\n restoreBarTitleActionFocus,\n} from './bar-title-action-chrome';\nimport {\n barTitleSectionMenuSections,\n barTitleSectionTriggerAriaLabel,\n effectiveBarTitleSectionValue,\n selectableBarTitleSections,\n selectedBarTitleSectionLabel,\n} from './bar-title-sections';\n\nlet nextBarTitleId = 0;\n\nconst BAR_TITLE_SHELL_BAR_MENU_SIDE_OFFSET =\n 'calc(var(--dimension-space-100) + var(--dimension-space-050))';\n\n@Component({\n tag: 'ds-bar-title',\n styleUrl: 'BarTitle.css',\n scoped: true,\n})\nexport class BarTitle {\n @Element() el!: HTMLElement;\n\n /** The page's single visible h1. */\n @Prop() heading!: string;\n\n /** Optional supporting copy shown in the expanded presentation. */\n @Prop() description: string = '';\n\n /** Show the leading page-level Back action. */\n @Prop({ attribute: 'show-back' }) showBack: boolean = false;\n\n /** Accessible name for the leading Back action. */\n @Prop() backAriaLabel: string = 'Back';\n\n /** Visible parent-page label used by the expanded breadcrumb when breadcrumbs is empty. */\n @Prop() backLabel: string = 'Back';\n\n /** Optional expanded ancestor path. Compact variants continue to use the Back action. */\n @Prop() breadcrumbs: BreadcrumbItem[] = [];\n\n /** Accessible name for the expanded breadcrumb navigation landmark. */\n @Prop() breadcrumbAriaLabel: string = 'Breadcrumb';\n\n /** Optional page sections exposed through the active-section menu. */\n @Prop() sections: BarTitleSectionItem[] = [];\n\n /** Id of the active page section. */\n @Prop() value: string = '';\n\n /** Accessible name for the page-section menu. */\n @Prop() sectionsAriaLabel: string = 'Change page section';\n\n /** The one highest-emphasis page action. */\n @Prop() primaryAction: BarTitlePrimaryAction | null = null;\n\n /** Secondary page actions shown in the overflow menu. Dividers create groups. */\n @Prop() actions: BarTitleActionItem[] = [];\n\n /**\n * Ordered page-header actions. When supplied, this replaces the legacy\n * primaryAction/actions presentation while preserving the same dsAction event.\n */\n @Prop() actionItems?: BarTitleActionConfigItem[];\n\n /** Accessible name for the page-actions menu. */\n @Prop() actionsAriaLabel: string = 'More page actions';\n\n /** Explicit visual/capacity variant. ShellPage owns automatic selection. */\n @Prop() variant: BarTitleVariant = 'expanded';\n\n /** Page-header placement, or compact application-shell bar placement. */\n @Prop({ reflect: true }) placement: BarTitlePlacement = 'page';\n\n /** Draw the page-title divider beneath the header. */\n @Prop() showDivider: boolean = true;\n\n /** Override divider visibility for compact and constrained variants. */\n @Prop() showCompactDivider?: boolean;\n\n /** Emitted when the leading Back action is activated. */\n @Event() dsBack!: EventEmitter<MouseEvent>;\n\n /** Emitted when an authored expanded breadcrumb item is activated. */\n @Event({ cancelable: true }) dsBreadcrumbSelect!: EventEmitter<BreadcrumbSelectDetail>;\n\n /** Emitted with the newly selected page-section id. */\n @Event() dsSectionChange!: EventEmitter<string>;\n\n /** Emitted with the activated primary or overflow action id. */\n @Event() dsAction!: EventEmitter<string>;\n\n @State() private sectionMenuOpen = false;\n @State() private openActionMenuId = '';\n @State() private surfaceActionMenuId = '';\n @State() private sectionSurfaceOpen = false;\n @State() private sectionMenuInitialFocusVisible = false;\n @State() private actionMenuInitialFocusVisible = false;\n\n private readonly instanceId = nextBarTitleId++;\n private readonly sectionMenuTriggerId = `bar-title-section-trigger-${this.instanceId}`;\n private readonly sectionMenuId = `bar-title-section-menu-${this.instanceId}`;\n private readonly actionMenuTriggerId = `bar-title-action-trigger-${this.instanceId}`;\n private readonly actionMenuId = `bar-title-action-menu-${this.instanceId}`;\n private sectionTriggerEl: HTMLButtonElement | null = null;\n private actionTriggerEl: FocusableBarTitleButton | null = null;\n private actionTriggerEls = new Map<string, FocusableBarTitleButton>();\n\n componentWillLoad() {\n if (this.el.closest('ds-shell-page')) {\n this.el.setAttribute('data-shell-page-syncing', '');\n }\n this.reportActionIdIssues();\n }\n\n @Watch('sections')\n handleSectionsChange() {\n if (!this.hasSectionSelector) {\n this.closeSectionMenu();\n this.sectionSurfaceOpen = false;\n }\n }\n\n @Watch('actions')\n @Watch('primaryAction')\n @Watch('actionItems')\n handleActionsChange() {\n this.reportActionIdIssues();\n if (!this.availableActionMenuIds.has(this.openActionMenuId)) this.closeActionMenu();\n if (!this.availableActionMenuIds.has(this.surfaceActionMenuId)) this.surfaceActionMenuId = '';\n }\n\n private reportActionIdIssues() {\n for (const issue of barTitleActionIdIssues(this.resolvedActionItems)) {\n console.warn(`[ds-bar-title] ${issue}`);\n }\n }\n\n private get compact(): boolean {\n return this.effectiveVariant !== 'expanded';\n }\n\n private get menuSideOffset(): string | undefined {\n return this.placement === 'shell-bar' ? BAR_TITLE_SHELL_BAR_MENU_SIDE_OFFSET : undefined;\n }\n\n private get effectiveVariant(): BarTitleVariant {\n return this.placement === 'shell-bar' ? 'compact' : this.variant;\n }\n\n private get dividerVisible(): boolean {\n return this.compact ? (this.showCompactDivider ?? this.showDivider) : this.showDivider;\n }\n\n private get expandedBreadcrumbItems(): BreadcrumbItem[] {\n if (this.breadcrumbs.length > 0) return this.breadcrumbs;\n if (!this.showBack) return [];\n return [\n {\n id: 'back',\n label: this.backLabel,\n ariaLabel: this.backAriaLabel,\n },\n ];\n }\n\n private get primaryCollapsed(): boolean {\n return (\n this.actionItems === undefined &&\n this.effectiveVariant === 'constrained' &&\n this.primaryAction !== null &&\n (this.primaryAction.collapse ?? 'auto') === 'auto'\n );\n }\n\n private get selectableSections() {\n return selectableBarTitleSections(this.sections);\n }\n\n private get hasSectionSelector(): boolean {\n return this.selectableSections.length > 1;\n }\n\n private get effectiveValue(): string {\n return effectiveBarTitleSectionValue(this.sections, this.value);\n }\n\n private get selectedSectionLabel(): string {\n return selectedBarTitleSectionLabel(this.sections, this.value);\n }\n\n private get sectionTriggerAriaLabel(): string {\n return barTitleSectionTriggerAriaLabel(this.sectionsAriaLabel, this.selectedSectionLabel);\n }\n\n private get sectionMenuSections() {\n return barTitleSectionMenuSections(this.sections, this.effectiveValue);\n }\n\n private get resolvedActionItems(): BarTitleActionConfigItem[] {\n return resolveBarTitleActionItems(this.actionItems, this.primaryAction, this.actions);\n }\n\n private get visibleActions(): BarTitleActionConfigItem[] {\n return visibleBarTitleActions(this.resolvedActionItems, this.effectiveVariant);\n }\n\n private get actionMenuSections(): MenuSection[] {\n return overflowBarTitleActionSections(this.resolvedActionItems, this.effectiveVariant);\n }\n\n private get showActionMenuTrigger(): boolean {\n return this.actionMenuSections.length > 0;\n }\n\n private get availableActionMenuIds(): Set<string> {\n return availableBarTitleActionMenuIds(this.visibleActions, this.showActionMenuTrigger);\n }\n\n private toggleSectionMenu = (event: MouseEvent) => {\n this.sectionMenuInitialFocusVisible = event.detail === 0;\n this.openActionMenuId = '';\n this.sectionMenuOpen = !this.sectionMenuOpen;\n if (this.sectionMenuOpen) this.sectionSurfaceOpen = true;\n };\n\n private closeSectionMenu = () => {\n this.sectionMenuOpen = false;\n };\n\n private handleSectionSelect = (event: CustomEvent<MenuItemData>) => {\n const id = String(event.detail?.value ?? '');\n const selected = this.selectableSections.find(section => section.id === id);\n if (!selected || selected.isInactive) return;\n this.closeSectionMenu();\n this.dsSectionChange.emit(id);\n requestAnimationFrame(() => this.sectionTriggerEl?.focus());\n };\n\n private toggleActionMenu = (id: string, event: MouseEvent) => {\n this.actionMenuInitialFocusVisible = event.detail === 0;\n this.sectionMenuOpen = false;\n this.openActionMenuId = this.openActionMenuId === id ? '' : id;\n if (this.openActionMenuId) this.surfaceActionMenuId = this.openActionMenuId;\n };\n\n private finishActionMenuClose = (event: CustomEvent<void>) => {\n const id = this.surfaceActionMenuId;\n const domId =\n id === '__overflow'\n ? this.actionMenuId\n : barTitleActionMenuDomId('bar-title', this.instanceId, this.resolvedActionItems, id);\n if (this.openActionMenuId !== id && (event.target as HTMLElement).id === domId) {\n this.surfaceActionMenuId = '';\n }\n };\n\n private closeActionMenu = () => {\n this.openActionMenuId = '';\n };\n\n private handleActionSelect = (event: CustomEvent<MenuItemData>) => {\n const id = String(event.detail?.value ?? '');\n const action = findBarTitleAction(this.resolvedActionItems, id);\n if (!action || action.isInactive || ('isLoading' in action && action.isLoading)) return;\n const menuId = this.openActionMenuId;\n this.closeActionMenu();\n this.dsAction.emit(id);\n requestAnimationFrame(() => {\n void restoreBarTitleActionFocus({\n menuId,\n overflowTrigger: this.actionTriggerEl,\n actionTriggers: this.actionTriggerEls,\n resolvedActionItems: this.resolvedActionItems,\n });\n });\n };\n\n private chromeActionOptions() {\n return {\n classPrefix: 'bar-title',\n compact: this.compact,\n visibleActions: this.visibleActions,\n showOverflowTrigger: this.showActionMenuTrigger,\n actionItems: this.actionItems,\n primaryAction: this.primaryAction,\n resolvedActionItems: this.resolvedActionItems,\n instanceId: this.instanceId,\n openActionMenuId: this.openActionMenuId,\n surfaceActionMenuId: this.surfaceActionMenuId,\n actionsAriaLabel: this.actionsAriaLabel,\n actionMenuTriggerId: this.actionMenuTriggerId,\n actionMenuId: this.actionMenuId,\n actionTriggers: this.actionTriggerEls,\n setOverflowTriggerEl: (el: FocusableBarTitleButton | null) => {\n this.actionTriggerEl = el;\n },\n toggleActionMenu: this.toggleActionMenu,\n emitAction: (id: string) => this.dsAction.emit(id),\n };\n }\n\n private renderSectionSelector() {\n if (!this.hasSectionSelector) return null;\n return [\n <div class=\"bar-title__divider\" aria-hidden=\"true\" />,\n renderBarTitleSectionTrigger({\n classPrefix: 'bar-title',\n triggerId: this.sectionMenuTriggerId,\n menuId: this.sectionMenuId,\n open: this.sectionMenuOpen,\n surfaceOpen: this.sectionSurfaceOpen,\n ariaLabel: this.sectionTriggerAriaLabel,\n selectedLabel: this.selectedSectionLabel,\n setTriggerEl: el => {\n this.sectionTriggerEl = el;\n },\n onToggle: this.toggleSectionMenu,\n }),\n ];\n }\n\n private renderActions() {\n return renderBarTitleActions(this.chromeActionOptions());\n }\n\n private renderActionMenus() {\n return renderBarTitleActionMenus({\n classPrefix: 'bar-title',\n visibleActions: this.visibleActions,\n instanceId: this.instanceId,\n resolvedActionItems: this.resolvedActionItems,\n sideOffset: this.menuSideOffset,\n openActionMenuId: this.openActionMenuId,\n actionMenuInitialFocusVisible: this.actionMenuInitialFocusVisible,\n overflowTrigger: this.actionTriggerEl,\n actionTriggers: this.actionTriggerEls,\n closeActionMenu: this.closeActionMenu,\n finishActionMenuClose: this.finishActionMenuClose,\n handleActionSelect: this.handleActionSelect,\n });\n }\n\n private handleBreadcrumbSelect = (event: CustomEvent<BreadcrumbSelectDetail>) => {\n if (this.breadcrumbs.length === 0) {\n this.dsBack.emit(event.detail.originalEvent);\n return;\n }\n const forwarded = this.dsBreadcrumbSelect.emit(event.detail);\n if (forwarded.defaultPrevented) event.preventDefault();\n };\n\n private renderBreadcrumb() {\n const items = this.expandedBreadcrumbItems;\n if (items.length === 0) return null;\n return (\n <ds-breadcrumb\n class=\"bar-title__breadcrumb\"\n items={items}\n ariaLabel={this.breadcrumbAriaLabel}\n onDsSelect={this.handleBreadcrumbSelect}\n />\n );\n }\n\n private renderBack() {\n return renderBarTitleBack({\n classPrefix: 'bar-title',\n showBack: this.showBack,\n backAriaLabel: this.backAriaLabel,\n onBack: event => this.dsBack.emit(event),\n });\n }\n\n render() {\n const compact = this.compact;\n return (\n <Host\n class={{\n 'bar-title-host--compact': compact,\n 'bar-title-host--expanded': this.effectiveVariant === 'expanded',\n 'bar-title-host--constrained': this.effectiveVariant === 'constrained',\n 'bar-title-host--has-description': !!this.description,\n 'bar-title-host--has-back': this.showBack,\n 'bar-title-host--has-breadcrumb': !compact && this.expandedBreadcrumbItems.length > 0,\n 'bar-title-host--shell-bar': this.placement === 'shell-bar',\n }}\n >\n <div\n class={{\n 'bar-title': true,\n 'bar-title--divider-hidden': !this.dividerVisible,\n 'ds-chrome-header': compact,\n }}\n >\n <div class=\"bar-title__inner\">\n {!compact ? this.renderBreadcrumb() : null}\n <div class=\"bar-title__row\">\n <div class=\"bar-title__leading\">\n <div class=\"bar-title__title-row\" data-shell-page-header-anchor>\n <div class=\"bar-title__identity\">\n {compact ? this.renderBack() : null}\n <ds-text\n class=\"bar-title__heading ds-control--md\"\n variant={compact ? 'text-title-small' : 'text-title-medium'}\n emphasis\n color=\"primary\"\n as=\"h1\"\n lineTruncation={1}\n >\n {this.heading}\n </ds-text>\n </div>\n {this.renderSectionSelector()}\n </div>\n {this.description && !compact ? (\n <ds-text\n class=\"bar-title__description\"\n variant=\"text-body-small\"\n color=\"secondary\"\n lineTruncation={2}\n wrap=\"wrap\"\n as=\"p\"\n >\n {this.description}\n </ds-text>\n ) : null}\n </div>\n {this.renderActions()}\n </div>\n </div>\n </div>\n\n {this.hasSectionSelector ? (\n <ds-menu\n id={this.sectionMenuId}\n class=\"bar-title__section-menu\"\n anchorId={this.sectionMenuTriggerId}\n sideOffset={this.menuSideOffset}\n menuLabel={this.sectionsAriaLabel}\n open={this.sectionMenuOpen}\n initialFocusVisible={this.sectionMenuInitialFocusVisible}\n sections={this.sectionMenuSections}\n onDsClose={this.closeSectionMenu}\n onDsAfterClose={() => {\n if (!this.sectionMenuOpen) this.sectionSurfaceOpen = false;\n }}\n onDsSelect={this.handleSectionSelect}\n />\n ) : null}\n\n {this.renderActionMenus()}\n\n {renderBarTitleOverflowMenu({\n classPrefix: 'bar-title',\n showOverflowTrigger: this.showActionMenuTrigger,\n actionMenuId: this.actionMenuId,\n actionMenuTriggerId: this.actionMenuTriggerId,\n sideOffset: this.menuSideOffset,\n actionsAriaLabel: this.actionsAriaLabel,\n open: this.openActionMenuId === '__overflow',\n actionMenuInitialFocusVisible: this.actionMenuInitialFocusVisible,\n actionMenuSections: this.actionMenuSections,\n closeActionMenu: this.closeActionMenu,\n finishActionMenuClose: this.finishActionMenuClose,\n handleActionSelect: this.handleActionSelect,\n })}\n </Host>\n );\n }\n}\n",
572
572
  "type": "registry:ui"
573
573
  },
574
574
  {
575
575
  "path": "src/wc/components/BarTitle/bar-title-action-chrome.tsx",
576
- "content": "import { h } from '@stencil/core';\nimport type { MenuItemData, MenuSection } from '../Menu/menu-types';\nimport { isBarTitleDivider } from './bar-title-types';\nimport type {\n BarTitleActionConfigItem,\n BarTitleMenuAction,\n BarTitlePrimaryAction,\n BarTitleSplitAction,\n} from './bar-title-types';\nimport { barTitleChoiceSections } from './bar-title-actions';\n\nexport type FocusableBarTitleButton = HTMLElement & {\n setFocus?: (segment?: 'primary' | 'menu') => Promise<void>;\n};\n\nexport function barTitleActionMenuDomId(\n classPrefix: string,\n instanceId: number,\n resolvedActionItems: BarTitleActionConfigItem[],\n id: string\n): string {\n const index = resolvedActionItems.findIndex(item => !isBarTitleDivider(item) && item.id === id);\n return `${classPrefix}-action-menu-${instanceId}-${index}`;\n}\n\nexport function barTitleActionMenuAnchor(\n id: string,\n overflowTrigger: FocusableBarTitleButton | null,\n actionTriggers: Map<string, FocusableBarTitleButton>\n): HTMLElement | undefined {\n if (id === '__overflow') return overflowTrigger ?? undefined;\n const trigger = actionTriggers.get(id);\n if (!trigger) return undefined;\n const splitMenu = trigger.querySelector<HTMLElement>('.ds-button-split__menu');\n return splitMenu ?? trigger;\n}\n\nexport async function restoreBarTitleActionFocus(options: {\n menuId: string;\n overflowTrigger: FocusableBarTitleButton | null;\n actionTriggers: Map<string, FocusableBarTitleButton>;\n resolvedActionItems: BarTitleActionConfigItem[];\n}): Promise<void> {\n if (options.menuId === '__overflow') {\n await options.overflowTrigger?.setFocus?.();\n return;\n }\n const trigger = options.actionTriggers.get(options.menuId);\n if (!trigger || !('setFocus' in trigger)) return;\n const split = options.resolvedActionItems.some(\n item => !isBarTitleDivider(item) && item.id === options.menuId && item.type === 'split'\n );\n await trigger.setFocus?.(split ? 'menu' : undefined);\n}\n\nfunction className(prefix: string, part: string): string {\n return `${prefix}__${part}`;\n}\n\nexport function renderBarTitleBack(options: {\n classPrefix: string;\n showBack: boolean;\n backAriaLabel: string;\n onBack: (event: MouseEvent) => void;\n}) {\n if (!options.showBack) return null;\n return (\n <ds-tooltip label=\"Go back\" side=\"bottom\" size=\"sm\">\n <ds-button-unfilled\n class={className(options.classPrefix, 'back')}\n variant=\"icon\"\n icon=\"ChevronLeft\"\n aria-label={options.backAriaLabel}\n size=\"md\"\n activeFill={false}\n hasBorder={false}\n onDsClick={(event: CustomEvent<MouseEvent>) => options.onBack(event.detail)}\n />\n </ds-tooltip>\n );\n}\n\nexport function renderBarTitleSectionTrigger(options: {\n classPrefix: string;\n triggerId: string;\n menuId: string;\n open: boolean;\n surfaceOpen: boolean;\n ariaLabel: string;\n selectedLabel: string;\n setTriggerEl: (el: HTMLButtonElement | null) => void;\n onToggle: (event: MouseEvent) => void;\n}) {\n const prefix = options.classPrefix;\n return (\n <div class={className(prefix, 'section-selector')}>\n <button\n ref={el => {\n options.setTriggerEl((el as HTMLButtonElement | null) ?? null);\n }}\n id={options.triggerId}\n class={{\n [className(prefix, 'section-trigger')]: true,\n [`${className(prefix, 'section-trigger')}--expanded`]: options.open,\n 'ds-interaction-fill--surface-open': options.surfaceOpen,\n 'ds-control--md': true,\n 'ds-focus-ring-inset': true,\n 'ds-interaction-fill': true,\n }}\n type=\"button\"\n aria-haspopup=\"menu\"\n aria-controls={options.menuId}\n aria-expanded={String(options.open)}\n aria-label={options.ariaLabel}\n onClick={options.onToggle}\n >\n <ds-text\n class={`${className(prefix, 'section-label')} ds-interaction-fill__content`}\n as=\"span\"\n variant=\"text-body-medium\"\n emphasis\n color=\"primary\"\n lineTruncation={1}\n >\n {options.selectedLabel}\n </ds-text>\n <ds-icon\n class={`${className(prefix, 'section-chevron')} ds-interaction-fill__content`}\n name=\"ChevronUpDown\"\n size=\"md\"\n color=\"inherit\"\n aria-hidden=\"true\"\n />\n </button>\n </div>\n );\n}\n\nfunction renderVisibleAction(\n action: BarTitleActionConfigItem,\n options: {\n classPrefix: string;\n compact: boolean;\n actionItems: BarTitleActionConfigItem[] | undefined;\n primaryAction: BarTitlePrimaryAction | null;\n resolvedActionItems: BarTitleActionConfigItem[];\n instanceId: number;\n openActionMenuId: string;\n surfaceActionMenuId: string;\n actionTriggers: Map<string, FocusableBarTitleButton>;\n toggleActionMenu: (id: string, event: MouseEvent) => void;\n emitAction: (id: string) => void;\n }\n) {\n if (isBarTitleDivider(action) || action.type === 'overflow') return null;\n const appearance = action.appearance ?? (action.type === 'split' ? 'filled' : 'unfilled');\n const variant: 'icon' | 'icon-label' | 'label' =\n action.type === 'icon' ? 'icon' : action.icon ? 'icon-label' : 'label';\n const menu = action.type === 'menu';\n const menuId = menu\n ? barTitleActionMenuDomId(\n options.classPrefix,\n options.instanceId,\n options.resolvedActionItems,\n action.id\n )\n : undefined;\n const prefix = options.classPrefix;\n\n if (action.type === 'split') {\n const splitMenuId = barTitleActionMenuDomId(\n options.classPrefix,\n options.instanceId,\n options.resolvedActionItems,\n action.id\n );\n const splitProps = {\n key: action.id,\n ref: (el: FocusableBarTitleButton | undefined) => {\n if (el) options.actionTriggers.set(action.id, el);\n else options.actionTriggers.delete(action.id);\n },\n class: `${className(prefix, 'action')} ${className(prefix, 'split-action')}`,\n split: true,\n variant,\n label: action.label,\n icon: action.icon ?? '',\n menuAriaLabel: action.menuAriaLabel,\n controls: splitMenuId,\n expanded: options.openActionMenuId === action.id,\n surfaceOpen: options.surfaceActionMenuId === action.id,\n size: 'md' as const,\n type: action.buttonType ?? 'button',\n isInactive: action.isInactive,\n isLoading: action.isLoading,\n onDsClick: () => options.emitAction(action.id),\n onDsMenuClick: (event: CustomEvent<MouseEvent>) =>\n options.toggleActionMenu(action.id, event.detail),\n };\n return appearance === 'filled' ? (\n <ds-button-filled\n {...splitProps}\n intent={action.intent ?? 'brand'}\n contrast={action.contrast ?? 'bold'}\n />\n ) : (\n <ds-button-unfilled {...splitProps} />\n );\n }\n\n const buttonProps = {\n key: action.id,\n ref: (el: FocusableBarTitleButton | undefined) => {\n if (el) options.actionTriggers.set(action.id, el);\n else options.actionTriggers.delete(action.id);\n },\n class: `${className(prefix, 'action')} ${className(prefix, 'action')}--${action.type}${\n options.actionItems === undefined && action.id === options.primaryAction?.id\n ? ` ${className(prefix, 'primary-action')}`\n : ''\n }`,\n variant,\n icon: action.icon ?? '',\n label: action.label,\n ariaLabel: action.ariaLabel ?? (action.type === 'icon' ? action.label : undefined),\n size: 'md' as const,\n type: action.buttonType ?? 'button',\n isInactive: action.isInactive,\n isLoading: action.isLoading,\n controls: menuId,\n expanded: menu ? options.openActionMenuId === action.id : undefined,\n surfaceOpen: menu && options.surfaceActionMenuId === action.id,\n hasMenu: menu,\n onDsClick: (event: CustomEvent<MouseEvent>) => {\n if (menu) options.toggleActionMenu(action.id, event.detail);\n else options.emitAction(action.id);\n },\n };\n\n const button =\n appearance === 'filled' ? (\n <ds-button-filled\n {...buttonProps}\n intent={action.intent ?? 'brand'}\n contrast={action.contrast ?? 'bold'}\n />\n ) : (\n <ds-button-unfilled {...buttonProps} />\n );\n\n return action.type === 'icon' ? (\n <ds-tooltip key={action.id} label={action.label} side=\"bottom\" size=\"sm\">\n {button}\n </ds-tooltip>\n ) : (\n button\n );\n}\n\nexport function renderBarTitleActions(options: {\n classPrefix: string;\n compact: boolean;\n visibleActions: BarTitleActionConfigItem[];\n showOverflowTrigger: boolean;\n actionItems: BarTitleActionConfigItem[] | undefined;\n primaryAction: BarTitlePrimaryAction | null;\n resolvedActionItems: BarTitleActionConfigItem[];\n instanceId: number;\n openActionMenuId: string;\n surfaceActionMenuId: string;\n actionsAriaLabel: string;\n actionMenuTriggerId: string;\n actionMenuId: string;\n actionTriggers: Map<string, FocusableBarTitleButton>;\n setOverflowTriggerEl: (el: FocusableBarTitleButton | null) => void;\n toggleActionMenu: (id: string, event: MouseEvent) => void;\n emitAction: (id: string) => void;\n}) {\n if (options.visibleActions.length === 0 && !options.showOverflowTrigger) return null;\n const prefix = options.classPrefix;\n\n return (\n <div class={className(prefix, 'actions')}>\n {options.visibleActions.map(action => renderVisibleAction(action, options))}\n {options.showOverflowTrigger ? (\n <ds-tooltip label=\"Page options\" side=\"bottom\" size=\"sm\">\n <ds-button-unfilled\n ref={el => {\n options.setOverflowTriggerEl((el as FocusableBarTitleButton | null) ?? null);\n }}\n id={options.actionMenuTriggerId}\n class={className(prefix, 'more-actions')}\n variant=\"icon\"\n icon=\"Ellipses\"\n aria-label={options.actionsAriaLabel}\n size=\"md\"\n activeFill={!options.compact}\n hasBorder={options.visibleActions.length > 0}\n haspopup=\"menu\"\n controls={options.actionMenuId}\n expanded={options.openActionMenuId === '__overflow'}\n surfaceOpen={options.surfaceActionMenuId === '__overflow'}\n onDsClick={(event: CustomEvent<MouseEvent>) =>\n options.toggleActionMenu('__overflow', event.detail)\n }\n />\n </ds-tooltip>\n ) : null}\n </div>\n );\n}\n\nexport function renderBarTitleActionMenus(options: {\n classPrefix: string;\n visibleActions: BarTitleActionConfigItem[];\n instanceId: number;\n resolvedActionItems: BarTitleActionConfigItem[];\n openActionMenuId: string;\n actionMenuInitialFocusVisible: boolean;\n overflowTrigger: FocusableBarTitleButton | null;\n actionTriggers: Map<string, FocusableBarTitleButton>;\n closeActionMenu: () => void;\n finishActionMenuClose: (event: CustomEvent<void>) => void;\n handleActionSelect: (event: CustomEvent<MenuItemData>) => void;\n}) {\n const prefix = options.classPrefix;\n return options.visibleActions.flatMap(action => {\n if (isBarTitleDivider(action) || (action.type !== 'menu' && action.type !== 'split')) {\n return [];\n }\n const menuAction = action as BarTitleMenuAction | BarTitleSplitAction;\n const menuLabel = menuAction.menuAriaLabel ?? menuAction.ariaLabel ?? menuAction.label;\n return [\n <ds-menu\n key={action.id}\n id={barTitleActionMenuDomId(\n options.classPrefix,\n options.instanceId,\n options.resolvedActionItems,\n action.id\n )}\n class={className(prefix, 'action-menu')}\n anchor={barTitleActionMenuAnchor(\n action.id,\n options.overflowTrigger,\n options.actionTriggers\n )}\n align=\"end\"\n menuLabel={menuLabel}\n open={options.openActionMenuId === action.id}\n initialFocusVisible={options.actionMenuInitialFocusVisible}\n sections={barTitleChoiceSections(menuAction.choices)}\n onDsClose={options.closeActionMenu}\n onDsAfterClose={options.finishActionMenuClose}\n onDsSelect={options.handleActionSelect}\n />,\n ];\n });\n}\n\nexport function renderBarTitleOverflowMenu(options: {\n classPrefix: string;\n showOverflowTrigger: boolean;\n actionMenuId: string;\n actionMenuTriggerId: string;\n actionsAriaLabel: string;\n open: boolean;\n actionMenuInitialFocusVisible: boolean;\n actionMenuSections: MenuSection[];\n closeActionMenu: () => void;\n finishActionMenuClose: (event: CustomEvent<void>) => void;\n handleActionSelect: (event: CustomEvent<MenuItemData>) => void;\n}) {\n if (!options.showOverflowTrigger) return null;\n return (\n <ds-menu\n id={options.actionMenuId}\n class={className(options.classPrefix, 'action-menu')}\n anchorId={options.actionMenuTriggerId}\n align=\"end\"\n menuLabel={options.actionsAriaLabel}\n open={options.open}\n initialFocusVisible={options.actionMenuInitialFocusVisible}\n sections={options.actionMenuSections}\n onDsClose={options.closeActionMenu}\n onDsAfterClose={options.finishActionMenuClose}\n onDsSelect={options.handleActionSelect}\n />\n );\n}\n",
576
+ "content": "import { h } from '@stencil/core';\nimport type { MenuItemData, MenuSection } from '../Menu/menu-types';\nimport { isBarTitleDivider } from './bar-title-types';\nimport type {\n BarTitleActionConfigItem,\n BarTitleMenuAction,\n BarTitlePrimaryAction,\n BarTitleSplitAction,\n} from './bar-title-types';\nimport { barTitleChoiceSections } from './bar-title-actions';\n\nexport type FocusableBarTitleButton = HTMLElement & {\n setFocus?: (segment?: 'primary' | 'menu') => Promise<void>;\n};\n\nexport function barTitleActionMenuDomId(\n classPrefix: string,\n instanceId: number,\n resolvedActionItems: BarTitleActionConfigItem[],\n id: string\n): string {\n const index = resolvedActionItems.findIndex(item => !isBarTitleDivider(item) && item.id === id);\n return `${classPrefix}-action-menu-${instanceId}-${index}`;\n}\n\nexport function barTitleActionMenuAnchor(\n id: string,\n overflowTrigger: FocusableBarTitleButton | null,\n actionTriggers: Map<string, FocusableBarTitleButton>\n): HTMLElement | undefined {\n if (id === '__overflow') return overflowTrigger ?? undefined;\n const trigger = actionTriggers.get(id);\n if (!trigger) return undefined;\n const splitMenu = trigger.querySelector<HTMLElement>('.ds-button-split__menu');\n return splitMenu ?? trigger;\n}\n\nexport async function restoreBarTitleActionFocus(options: {\n menuId: string;\n overflowTrigger: FocusableBarTitleButton | null;\n actionTriggers: Map<string, FocusableBarTitleButton>;\n resolvedActionItems: BarTitleActionConfigItem[];\n}): Promise<void> {\n if (options.menuId === '__overflow') {\n await options.overflowTrigger?.setFocus?.();\n return;\n }\n const trigger = options.actionTriggers.get(options.menuId);\n if (!trigger || !('setFocus' in trigger)) return;\n const split = options.resolvedActionItems.some(\n item => !isBarTitleDivider(item) && item.id === options.menuId && item.type === 'split'\n );\n await trigger.setFocus?.(split ? 'menu' : undefined);\n}\n\nfunction className(prefix: string, part: string): string {\n return `${prefix}__${part}`;\n}\n\nexport function renderBarTitleBack(options: {\n classPrefix: string;\n showBack: boolean;\n backAriaLabel: string;\n onBack: (event: MouseEvent) => void;\n}) {\n if (!options.showBack) return null;\n return (\n <ds-tooltip label=\"Go back\" side=\"bottom\" size=\"sm\">\n <ds-button-unfilled\n class={className(options.classPrefix, 'back')}\n variant=\"icon\"\n icon=\"ChevronLeft\"\n aria-label={options.backAriaLabel}\n size=\"md\"\n activeFill={false}\n hasBorder={false}\n onDsClick={(event: CustomEvent<MouseEvent>) => options.onBack(event.detail)}\n />\n </ds-tooltip>\n );\n}\n\nexport function renderBarTitleSectionTrigger(options: {\n classPrefix: string;\n triggerId: string;\n menuId: string;\n open: boolean;\n surfaceOpen: boolean;\n ariaLabel: string;\n selectedLabel: string;\n setTriggerEl: (el: HTMLButtonElement | null) => void;\n onToggle: (event: MouseEvent) => void;\n}) {\n const prefix = options.classPrefix;\n return (\n <div class={className(prefix, 'section-selector')}>\n <button\n ref={el => {\n options.setTriggerEl((el as HTMLButtonElement | null) ?? null);\n }}\n id={options.triggerId}\n class={{\n [className(prefix, 'section-trigger')]: true,\n [`${className(prefix, 'section-trigger')}--expanded`]: options.open,\n 'ds-interaction-fill--surface-open': options.surfaceOpen,\n 'ds-control--md': true,\n 'ds-focus-ring-inset': true,\n 'ds-interaction-fill': true,\n }}\n type=\"button\"\n aria-haspopup=\"menu\"\n aria-controls={options.menuId}\n aria-expanded={String(options.open)}\n aria-label={options.ariaLabel}\n onClick={options.onToggle}\n >\n <ds-text\n class={`${className(prefix, 'section-label')} ds-interaction-fill__content`}\n as=\"span\"\n variant=\"text-body-medium\"\n emphasis\n color=\"primary\"\n lineTruncation={1}\n >\n {options.selectedLabel}\n </ds-text>\n <ds-icon\n class={`${className(prefix, 'section-chevron')} ds-interaction-fill__content`}\n name=\"ChevronUpDown\"\n size=\"md\"\n color=\"inherit\"\n aria-hidden=\"true\"\n />\n </button>\n </div>\n );\n}\n\nfunction renderVisibleAction(\n action: BarTitleActionConfigItem,\n options: {\n classPrefix: string;\n compact: boolean;\n actionItems: BarTitleActionConfigItem[] | undefined;\n primaryAction: BarTitlePrimaryAction | null;\n resolvedActionItems: BarTitleActionConfigItem[];\n instanceId: number;\n openActionMenuId: string;\n surfaceActionMenuId: string;\n actionTriggers: Map<string, FocusableBarTitleButton>;\n toggleActionMenu: (id: string, event: MouseEvent) => void;\n emitAction: (id: string) => void;\n }\n) {\n if (isBarTitleDivider(action) || action.type === 'overflow') return null;\n const appearance = action.appearance ?? (action.type === 'split' ? 'filled' : 'unfilled');\n const variant: 'icon' | 'icon-label' | 'label' =\n action.type === 'icon' ? 'icon' : action.icon ? 'icon-label' : 'label';\n const menu = action.type === 'menu';\n const menuId = menu\n ? barTitleActionMenuDomId(\n options.classPrefix,\n options.instanceId,\n options.resolvedActionItems,\n action.id\n )\n : undefined;\n const prefix = options.classPrefix;\n\n if (action.type === 'split') {\n const splitMenuId = barTitleActionMenuDomId(\n options.classPrefix,\n options.instanceId,\n options.resolvedActionItems,\n action.id\n );\n const splitProps = {\n key: action.id,\n ref: (el: FocusableBarTitleButton | undefined) => {\n if (el) options.actionTriggers.set(action.id, el);\n else options.actionTriggers.delete(action.id);\n },\n class: `${className(prefix, 'action')} ${className(prefix, 'split-action')}`,\n split: true,\n variant,\n label: action.label,\n icon: action.icon ?? '',\n menuAriaLabel: action.menuAriaLabel,\n controls: splitMenuId,\n expanded: options.openActionMenuId === action.id,\n surfaceOpen: options.surfaceActionMenuId === action.id,\n size: 'md' as const,\n type: action.buttonType ?? 'button',\n isInactive: action.isInactive,\n isLoading: action.isLoading,\n onDsClick: () => options.emitAction(action.id),\n onDsMenuClick: (event: CustomEvent<MouseEvent>) =>\n options.toggleActionMenu(action.id, event.detail),\n };\n return appearance === 'filled' ? (\n <ds-button-filled\n {...splitProps}\n intent={action.intent ?? 'brand'}\n contrast={action.contrast ?? 'bold'}\n />\n ) : (\n <ds-button-unfilled {...splitProps} />\n );\n }\n\n const buttonProps = {\n key: action.id,\n ref: (el: FocusableBarTitleButton | undefined) => {\n if (el) options.actionTriggers.set(action.id, el);\n else options.actionTriggers.delete(action.id);\n },\n class: `${className(prefix, 'action')} ${className(prefix, 'action')}--${action.type}${\n options.actionItems === undefined && action.id === options.primaryAction?.id\n ? ` ${className(prefix, 'primary-action')}`\n : ''\n }`,\n variant,\n icon: action.icon ?? '',\n label: action.label,\n ariaLabel: action.ariaLabel ?? (action.type === 'icon' ? action.label : undefined),\n size: 'md' as const,\n type: action.buttonType ?? 'button',\n isInactive: action.isInactive,\n isLoading: action.isLoading,\n controls: menuId,\n expanded: menu ? options.openActionMenuId === action.id : undefined,\n surfaceOpen: menu && options.surfaceActionMenuId === action.id,\n hasMenu: menu,\n onDsClick: (event: CustomEvent<MouseEvent>) => {\n if (menu) options.toggleActionMenu(action.id, event.detail);\n else options.emitAction(action.id);\n },\n };\n\n const button =\n appearance === 'filled' ? (\n <ds-button-filled\n {...buttonProps}\n intent={action.intent ?? 'brand'}\n contrast={action.contrast ?? 'bold'}\n />\n ) : (\n <ds-button-unfilled {...buttonProps} />\n );\n\n return action.type === 'icon' ? (\n <ds-tooltip key={action.id} label={action.label} side=\"bottom\" size=\"sm\">\n {button}\n </ds-tooltip>\n ) : (\n button\n );\n}\n\nexport function renderBarTitleActions(options: {\n classPrefix: string;\n compact: boolean;\n visibleActions: BarTitleActionConfigItem[];\n showOverflowTrigger: boolean;\n actionItems: BarTitleActionConfigItem[] | undefined;\n primaryAction: BarTitlePrimaryAction | null;\n resolvedActionItems: BarTitleActionConfigItem[];\n instanceId: number;\n openActionMenuId: string;\n surfaceActionMenuId: string;\n actionsAriaLabel: string;\n actionMenuTriggerId: string;\n actionMenuId: string;\n actionTriggers: Map<string, FocusableBarTitleButton>;\n setOverflowTriggerEl: (el: FocusableBarTitleButton | null) => void;\n toggleActionMenu: (id: string, event: MouseEvent) => void;\n emitAction: (id: string) => void;\n}) {\n if (options.visibleActions.length === 0 && !options.showOverflowTrigger) return null;\n const prefix = options.classPrefix;\n\n return (\n <div class={className(prefix, 'actions')}>\n {options.visibleActions.map(action => renderVisibleAction(action, options))}\n {options.showOverflowTrigger ? (\n <ds-tooltip label=\"Page options\" side=\"bottom\" size=\"sm\">\n <ds-button-unfilled\n ref={el => {\n options.setOverflowTriggerEl((el as FocusableBarTitleButton | null) ?? null);\n }}\n id={options.actionMenuTriggerId}\n class={className(prefix, 'more-actions')}\n variant=\"icon\"\n icon=\"Ellipses\"\n aria-label={options.actionsAriaLabel}\n size=\"md\"\n activeFill={!options.compact}\n hasBorder={options.visibleActions.length > 0}\n haspopup=\"menu\"\n controls={options.actionMenuId}\n expanded={options.openActionMenuId === '__overflow'}\n surfaceOpen={options.surfaceActionMenuId === '__overflow'}\n onDsClick={(event: CustomEvent<MouseEvent>) =>\n options.toggleActionMenu('__overflow', event.detail)\n }\n />\n </ds-tooltip>\n ) : null}\n </div>\n );\n}\n\nexport function renderBarTitleActionMenus(options: {\n classPrefix: string;\n visibleActions: BarTitleActionConfigItem[];\n instanceId: number;\n resolvedActionItems: BarTitleActionConfigItem[];\n sideOffset?: number | string;\n openActionMenuId: string;\n actionMenuInitialFocusVisible: boolean;\n overflowTrigger: FocusableBarTitleButton | null;\n actionTriggers: Map<string, FocusableBarTitleButton>;\n closeActionMenu: () => void;\n finishActionMenuClose: (event: CustomEvent<void>) => void;\n handleActionSelect: (event: CustomEvent<MenuItemData>) => void;\n}) {\n const prefix = options.classPrefix;\n return options.visibleActions.flatMap(action => {\n if (isBarTitleDivider(action) || (action.type !== 'menu' && action.type !== 'split')) {\n return [];\n }\n const menuAction = action as BarTitleMenuAction | BarTitleSplitAction;\n const menuLabel = menuAction.menuAriaLabel ?? menuAction.ariaLabel ?? menuAction.label;\n return [\n <ds-menu\n key={action.id}\n id={barTitleActionMenuDomId(\n options.classPrefix,\n options.instanceId,\n options.resolvedActionItems,\n action.id\n )}\n class={className(prefix, 'action-menu')}\n anchor={barTitleActionMenuAnchor(\n action.id,\n options.overflowTrigger,\n options.actionTriggers\n )}\n align=\"end\"\n sideOffset={options.sideOffset}\n menuLabel={menuLabel}\n open={options.openActionMenuId === action.id}\n initialFocusVisible={options.actionMenuInitialFocusVisible}\n sections={barTitleChoiceSections(menuAction.choices)}\n onDsClose={options.closeActionMenu}\n onDsAfterClose={options.finishActionMenuClose}\n onDsSelect={options.handleActionSelect}\n />,\n ];\n });\n}\n\nexport function renderBarTitleOverflowMenu(options: {\n classPrefix: string;\n showOverflowTrigger: boolean;\n actionMenuId: string;\n actionMenuTriggerId: string;\n sideOffset?: number | string;\n actionsAriaLabel: string;\n open: boolean;\n actionMenuInitialFocusVisible: boolean;\n actionMenuSections: MenuSection[];\n closeActionMenu: () => void;\n finishActionMenuClose: (event: CustomEvent<void>) => void;\n handleActionSelect: (event: CustomEvent<MenuItemData>) => void;\n}) {\n if (!options.showOverflowTrigger) return null;\n return (\n <ds-menu\n id={options.actionMenuId}\n class={className(options.classPrefix, 'action-menu')}\n anchorId={options.actionMenuTriggerId}\n align=\"end\"\n sideOffset={options.sideOffset}\n menuLabel={options.actionsAriaLabel}\n open={options.open}\n initialFocusVisible={options.actionMenuInitialFocusVisible}\n sections={options.actionMenuSections}\n onDsClose={options.closeActionMenu}\n onDsAfterClose={options.finishActionMenuClose}\n onDsSelect={options.handleActionSelect}\n />\n );\n}\n",
577
577
  "type": "registry:ui"
578
578
  },
579
579
  {