@ids-group-ltd/ids-design-system 0.13.3 → 0.14.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 (312) hide show
  1. package/CHANGELOG.md +1104 -14
  2. package/components.md +567 -34
  3. package/design-system.md +9 -0
  4. package/docs/agent/INDEX.md +57 -15
  5. package/docs/agent/charts/chart-colour-which-palette-a-chart-takes.md +1 -1
  6. package/docs/agent/charts/column-series-component.md +8 -0
  7. package/docs/agent/charts/ds-bar-chart.md +6 -1
  8. package/docs/agent/charts/ds-chart-data-table.md +10 -0
  9. package/docs/agent/charts/ds-chart.md +10 -0
  10. package/docs/agent/charts/ds-column-chart.md +5 -1
  11. package/docs/agent/charts/ds-funnel-chart.md +5 -1
  12. package/docs/agent/charts/ds-heatmap-chart.md +20 -0
  13. package/docs/agent/charts/ds-line-chart.md +8 -4
  14. package/docs/agent/charts/{ds-donut-chart.md → ds-pie-chart.md} +10 -6
  15. package/docs/agent/charts/ds-scatter-chart.md +20 -0
  16. package/docs/agent/charts/ds-waterfall-chart.md +20 -0
  17. package/docs/agent/charts/line-series-component.md +8 -0
  18. package/docs/agent/charts/reference-label-component.md +8 -0
  19. package/docs/agent/charts/reference-line-component.md +8 -0
  20. package/docs/agent/charts/series-annotation-component.md +10 -0
  21. package/docs/agent/feedback/ds-alert.md +4 -0
  22. package/docs/agent/feedback/ds-avatar-group.md +4 -0
  23. package/docs/agent/feedback/ds-avatar.md +4 -0
  24. package/docs/agent/feedback/ds-badge.md +4 -0
  25. package/docs/agent/feedback/ds-banner.md +5 -1
  26. package/docs/agent/feedback/ds-bar.md +4 -0
  27. package/docs/agent/feedback/ds-description-item.md +8 -0
  28. package/docs/agent/feedback/ds-description-list.md +8 -0
  29. package/docs/agent/feedback/ds-empty-state.md +4 -0
  30. package/docs/agent/feedback/ds-list-item.md +8 -0
  31. package/docs/agent/feedback/ds-list.md +8 -0
  32. package/docs/agent/feedback/ds-loading-overlay.md +8 -0
  33. package/docs/agent/feedback/ds-skeleton.md +4 -0
  34. package/docs/agent/feedback/ds-spinner.md +4 -0
  35. package/docs/agent/feedback/ds-stat.md +4 -0
  36. package/docs/agent/feedback/ds-status-dot.md +4 -0
  37. package/docs/agent/feedback/ds-tag.md +4 -0
  38. package/docs/agent/feedback/ds-timeline-item.md +8 -0
  39. package/docs/agent/feedback/ds-toast-region.md +8 -0
  40. package/docs/agent/feedback/ds-toast.md +4 -0
  41. package/docs/agent/feedback/ds-tree.md +8 -0
  42. package/docs/agent/forms/ds-autocomplete.md +4 -0
  43. package/docs/agent/forms/ds-button-group.md +8 -0
  44. package/docs/agent/forms/ds-button.md +6 -2
  45. package/docs/agent/forms/ds-checkbox.md +4 -0
  46. package/docs/agent/forms/ds-color-picker.md +8 -0
  47. package/docs/agent/forms/ds-date-picker.md +5 -1
  48. package/docs/agent/forms/ds-dropzone.md +4 -0
  49. package/docs/agent/forms/ds-field-group.md +8 -0
  50. package/docs/agent/forms/ds-filter-bar.md +8 -0
  51. package/docs/agent/forms/ds-icon-button.md +4 -0
  52. package/docs/agent/forms/ds-input.md +13 -1
  53. package/docs/agent/forms/ds-multi-select.md +4 -0
  54. package/docs/agent/forms/ds-number-stepper.md +4 -0
  55. package/docs/agent/forms/ds-otp-input.md +8 -0
  56. package/docs/agent/forms/ds-password-rules.md +8 -0
  57. package/docs/agent/forms/ds-radio-group.md +8 -0
  58. package/docs/agent/forms/ds-radio.md +4 -0
  59. package/docs/agent/forms/ds-search.md +5 -1
  60. package/docs/agent/forms/ds-segmented.md +8 -0
  61. package/docs/agent/forms/ds-select.md +4 -0
  62. package/docs/agent/forms/ds-slider.md +8 -0
  63. package/docs/agent/forms/ds-split-button.md +8 -0
  64. package/docs/agent/forms/ds-switch.md +7 -1
  65. package/docs/agent/forms/ds-textarea.md +6 -1
  66. package/docs/agent/forms/ds-time-picker.md +8 -0
  67. package/docs/agent/forms/ds-toggle-button.md +8 -0
  68. package/docs/agent/forms/filter-item-directive.md +8 -0
  69. package/docs/agent/forms/the-picker-family-ds-select-ds-multi-select-ds-autocomplete.md +4 -0
  70. package/docs/agent/navigation/ds-app-layout.md +6 -2
  71. package/docs/agent/navigation/ds-auth-layout.md +5 -1
  72. package/docs/agent/navigation/ds-breadcrumbs.md +4 -0
  73. package/docs/agent/navigation/ds-container.md +8 -0
  74. package/docs/agent/navigation/ds-divider.md +4 -0
  75. package/docs/agent/navigation/ds-inline.md +8 -0
  76. package/docs/agent/navigation/ds-page-footer.md +4 -0
  77. package/docs/agent/navigation/ds-page-header.md +5 -1
  78. package/docs/agent/navigation/ds-pagination.md +5 -1
  79. package/docs/agent/navigation/ds-sidenav-footer.md +8 -0
  80. package/docs/agent/navigation/ds-sidenav-group.md +4 -0
  81. package/docs/agent/navigation/ds-sidenav-item.md +4 -0
  82. package/docs/agent/navigation/ds-sidenav.md +4 -0
  83. package/docs/agent/navigation/ds-stack.md +8 -0
  84. package/docs/agent/navigation/ds-stepper.md +4 -0
  85. package/docs/agent/navigation/ds-tab.md +8 -0
  86. package/docs/agent/navigation/ds-tabs.md +5 -1
  87. package/docs/agent/overlays/ds-bottom-sheet.md +4 -0
  88. package/docs/agent/overlays/ds-drawer.md +4 -0
  89. package/docs/agent/overlays/ds-menu.md +4 -0
  90. package/docs/agent/overlays/ds-modal-card.md +4 -0
  91. package/docs/agent/overlays/ds-modal.md +4 -0
  92. package/docs/agent/overlays/ds-popover.md +4 -0
  93. package/docs/agent/overlays/ds-tooltip-panel.md +8 -0
  94. package/docs/agent/overlays/ds-tooltip.md +4 -0
  95. package/docs/agent/platform/ds-config.md +2 -1
  96. package/docs/agent/surfaces/ds-accordion-item.md +8 -0
  97. package/docs/agent/surfaces/ds-accordion.md +4 -0
  98. package/docs/agent/surfaces/ds-card.md +6 -2
  99. package/docs/agent/tables/ds-cell-template.md +8 -0
  100. package/docs/agent/tables/ds-table-columns.md +8 -0
  101. package/docs/agent/tables/ds-table-export.md +8 -0
  102. package/docs/agent/tables/ds-table.md +12 -4
  103. package/docs/agent/tables/header-filter-directive.md +8 -0
  104. package/fesm2022/ids-group-ltd-ids-design-system-components-accordion.mjs +4 -4
  105. package/fesm2022/ids-group-ltd-ids-design-system-components-accordion.mjs.map +1 -1
  106. package/fesm2022/ids-group-ltd-ids-design-system-components-alert.mjs +10 -8
  107. package/fesm2022/ids-group-ltd-ids-design-system-components-alert.mjs.map +1 -1
  108. package/fesm2022/ids-group-ltd-ids-design-system-components-app-layout.mjs +19 -19
  109. package/fesm2022/ids-group-ltd-ids-design-system-components-app-layout.mjs.map +1 -1
  110. package/fesm2022/ids-group-ltd-ids-design-system-components-auth-layout.mjs +2 -2
  111. package/fesm2022/ids-group-ltd-ids-design-system-components-auth-layout.mjs.map +1 -1
  112. package/fesm2022/ids-group-ltd-ids-design-system-components-autocomplete.mjs +7 -6
  113. package/fesm2022/ids-group-ltd-ids-design-system-components-autocomplete.mjs.map +1 -1
  114. package/fesm2022/ids-group-ltd-ids-design-system-components-badge.mjs +2 -2
  115. package/fesm2022/ids-group-ltd-ids-design-system-components-badge.mjs.map +1 -1
  116. package/fesm2022/ids-group-ltd-ids-design-system-components-banner.mjs +9 -6
  117. package/fesm2022/ids-group-ltd-ids-design-system-components-banner.mjs.map +1 -1
  118. package/fesm2022/ids-group-ltd-ids-design-system-components-bar-chart.mjs +140 -43
  119. package/fesm2022/ids-group-ltd-ids-design-system-components-bar-chart.mjs.map +1 -1
  120. package/fesm2022/ids-group-ltd-ids-design-system-components-bar.mjs +2 -2
  121. package/fesm2022/ids-group-ltd-ids-design-system-components-bar.mjs.map +1 -1
  122. package/fesm2022/ids-group-ltd-ids-design-system-components-bottom-sheet.mjs +3 -3
  123. package/fesm2022/ids-group-ltd-ids-design-system-components-bottom-sheet.mjs.map +1 -1
  124. package/fesm2022/ids-group-ltd-ids-design-system-components-button.mjs +7 -3
  125. package/fesm2022/ids-group-ltd-ids-design-system-components-button.mjs.map +1 -1
  126. package/fesm2022/ids-group-ltd-ids-design-system-components-card.mjs +2 -2
  127. package/fesm2022/ids-group-ltd-ids-design-system-components-card.mjs.map +1 -1
  128. package/fesm2022/ids-group-ltd-ids-design-system-components-chart-data-table.mjs +42 -0
  129. package/fesm2022/ids-group-ltd-ids-design-system-components-chart-data-table.mjs.map +1 -0
  130. package/fesm2022/ids-group-ltd-ids-design-system-components-chart-legend.mjs +2 -2
  131. package/fesm2022/ids-group-ltd-ids-design-system-components-chart-legend.mjs.map +1 -1
  132. package/fesm2022/ids-group-ltd-ids-design-system-components-chart-tooltip.mjs +39 -14
  133. package/fesm2022/ids-group-ltd-ids-design-system-components-chart-tooltip.mjs.map +1 -1
  134. package/fesm2022/ids-group-ltd-ids-design-system-components-chart.mjs +727 -93
  135. package/fesm2022/ids-group-ltd-ids-design-system-components-chart.mjs.map +1 -1
  136. package/fesm2022/ids-group-ltd-ids-design-system-components-checkbox.mjs +2 -2
  137. package/fesm2022/ids-group-ltd-ids-design-system-components-checkbox.mjs.map +1 -1
  138. package/fesm2022/ids-group-ltd-ids-design-system-components-color-picker.mjs +8 -6
  139. package/fesm2022/ids-group-ltd-ids-design-system-components-color-picker.mjs.map +1 -1
  140. package/fesm2022/ids-group-ltd-ids-design-system-components-column-chart.mjs +29 -12
  141. package/fesm2022/ids-group-ltd-ids-design-system-components-column-chart.mjs.map +1 -1
  142. package/fesm2022/ids-group-ltd-ids-design-system-components-date-picker.mjs +5 -3
  143. package/fesm2022/ids-group-ltd-ids-design-system-components-date-picker.mjs.map +1 -1
  144. package/fesm2022/ids-group-ltd-ids-design-system-components-description-list.mjs +4 -4
  145. package/fesm2022/ids-group-ltd-ids-design-system-components-description-list.mjs.map +1 -1
  146. package/fesm2022/ids-group-ltd-ids-design-system-components-dropzone.mjs +23 -16
  147. package/fesm2022/ids-group-ltd-ids-design-system-components-dropzone.mjs.map +1 -1
  148. package/fesm2022/ids-group-ltd-ids-design-system-components-empty-state.mjs +2 -2
  149. package/fesm2022/ids-group-ltd-ids-design-system-components-empty-state.mjs.map +1 -1
  150. package/fesm2022/ids-group-ltd-ids-design-system-components-field-group.mjs +2 -2
  151. package/fesm2022/ids-group-ltd-ids-design-system-components-field-group.mjs.map +1 -1
  152. package/fesm2022/ids-group-ltd-ids-design-system-components-filter-bar.mjs +1 -1
  153. package/fesm2022/ids-group-ltd-ids-design-system-components-filter-bar.mjs.map +1 -1
  154. package/fesm2022/ids-group-ltd-ids-design-system-components-funnel-chart.mjs +25 -24
  155. package/fesm2022/ids-group-ltd-ids-design-system-components-funnel-chart.mjs.map +1 -1
  156. package/fesm2022/ids-group-ltd-ids-design-system-components-heatmap-chart.mjs +217 -0
  157. package/fesm2022/ids-group-ltd-ids-design-system-components-heatmap-chart.mjs.map +1 -0
  158. package/fesm2022/ids-group-ltd-ids-design-system-components-input.mjs +2 -2
  159. package/fesm2022/ids-group-ltd-ids-design-system-components-input.mjs.map +1 -1
  160. package/fesm2022/ids-group-ltd-ids-design-system-components-layout.mjs +2 -2
  161. package/fesm2022/ids-group-ltd-ids-design-system-components-layout.mjs.map +1 -1
  162. package/fesm2022/ids-group-ltd-ids-design-system-components-line-chart.mjs +183 -501
  163. package/fesm2022/ids-group-ltd-ids-design-system-components-line-chart.mjs.map +1 -1
  164. package/fesm2022/ids-group-ltd-ids-design-system-components-list.mjs +2 -2
  165. package/fesm2022/ids-group-ltd-ids-design-system-components-list.mjs.map +1 -1
  166. package/fesm2022/ids-group-ltd-ids-design-system-components-loading-overlay.mjs +2 -2
  167. package/fesm2022/ids-group-ltd-ids-design-system-components-loading-overlay.mjs.map +1 -1
  168. package/fesm2022/ids-group-ltd-ids-design-system-components-menu.mjs +2 -2
  169. package/fesm2022/ids-group-ltd-ids-design-system-components-menu.mjs.map +1 -1
  170. package/fesm2022/ids-group-ltd-ids-design-system-components-modal.mjs +44 -8
  171. package/fesm2022/ids-group-ltd-ids-design-system-components-modal.mjs.map +1 -1
  172. package/fesm2022/ids-group-ltd-ids-design-system-components-multi-select.mjs +7 -5
  173. package/fesm2022/ids-group-ltd-ids-design-system-components-multi-select.mjs.map +1 -1
  174. package/fesm2022/ids-group-ltd-ids-design-system-components-number-stepper.mjs +2 -2
  175. package/fesm2022/ids-group-ltd-ids-design-system-components-number-stepper.mjs.map +1 -1
  176. package/fesm2022/ids-group-ltd-ids-design-system-components-otp-input.mjs +2 -2
  177. package/fesm2022/ids-group-ltd-ids-design-system-components-otp-input.mjs.map +1 -1
  178. package/fesm2022/ids-group-ltd-ids-design-system-components-page-header.mjs +2 -2
  179. package/fesm2022/ids-group-ltd-ids-design-system-components-page-header.mjs.map +1 -1
  180. package/fesm2022/ids-group-ltd-ids-design-system-components-pagination.mjs +22 -3
  181. package/fesm2022/ids-group-ltd-ids-design-system-components-pagination.mjs.map +1 -1
  182. package/fesm2022/ids-group-ltd-ids-design-system-components-pie-chart.mjs +382 -0
  183. package/fesm2022/ids-group-ltd-ids-design-system-components-pie-chart.mjs.map +1 -0
  184. package/fesm2022/ids-group-ltd-ids-design-system-components-popover.mjs +5 -3
  185. package/fesm2022/ids-group-ltd-ids-design-system-components-popover.mjs.map +1 -1
  186. package/fesm2022/ids-group-ltd-ids-design-system-components-radio-group.mjs +2 -2
  187. package/fesm2022/ids-group-ltd-ids-design-system-components-radio-group.mjs.map +1 -1
  188. package/fesm2022/ids-group-ltd-ids-design-system-components-scatter-chart.mjs +322 -0
  189. package/fesm2022/ids-group-ltd-ids-design-system-components-scatter-chart.mjs.map +1 -0
  190. package/fesm2022/ids-group-ltd-ids-design-system-components-search.mjs +6 -2
  191. package/fesm2022/ids-group-ltd-ids-design-system-components-search.mjs.map +1 -1
  192. package/fesm2022/ids-group-ltd-ids-design-system-components-segmented.mjs +9 -4
  193. package/fesm2022/ids-group-ltd-ids-design-system-components-segmented.mjs.map +1 -1
  194. package/fesm2022/ids-group-ltd-ids-design-system-components-select.mjs +7 -5
  195. package/fesm2022/ids-group-ltd-ids-design-system-components-select.mjs.map +1 -1
  196. package/fesm2022/ids-group-ltd-ids-design-system-components-sidenav-footer.mjs +2 -2
  197. package/fesm2022/ids-group-ltd-ids-design-system-components-sidenav-footer.mjs.map +1 -1
  198. package/fesm2022/ids-group-ltd-ids-design-system-components-sidenav.mjs +2 -2
  199. package/fesm2022/ids-group-ltd-ids-design-system-components-sidenav.mjs.map +1 -1
  200. package/fesm2022/ids-group-ltd-ids-design-system-components-skeleton.mjs +23 -4
  201. package/fesm2022/ids-group-ltd-ids-design-system-components-skeleton.mjs.map +1 -1
  202. package/fesm2022/ids-group-ltd-ids-design-system-components-slider.mjs +2 -2
  203. package/fesm2022/ids-group-ltd-ids-design-system-components-slider.mjs.map +1 -1
  204. package/fesm2022/ids-group-ltd-ids-design-system-components-split-button.mjs +2 -2
  205. package/fesm2022/ids-group-ltd-ids-design-system-components-split-button.mjs.map +1 -1
  206. package/fesm2022/ids-group-ltd-ids-design-system-components-stat.mjs +2 -2
  207. package/fesm2022/ids-group-ltd-ids-design-system-components-stat.mjs.map +1 -1
  208. package/fesm2022/ids-group-ltd-ids-design-system-components-switch.mjs +20 -5
  209. package/fesm2022/ids-group-ltd-ids-design-system-components-switch.mjs.map +1 -1
  210. package/fesm2022/ids-group-ltd-ids-design-system-components-table-columns.mjs +6 -6
  211. package/fesm2022/ids-group-ltd-ids-design-system-components-table-columns.mjs.map +1 -1
  212. package/fesm2022/ids-group-ltd-ids-design-system-components-table-export.mjs +4 -1
  213. package/fesm2022/ids-group-ltd-ids-design-system-components-table-export.mjs.map +1 -1
  214. package/fesm2022/ids-group-ltd-ids-design-system-components-table.mjs +36 -28
  215. package/fesm2022/ids-group-ltd-ids-design-system-components-table.mjs.map +1 -1
  216. package/fesm2022/ids-group-ltd-ids-design-system-components-tabs.mjs +2 -2
  217. package/fesm2022/ids-group-ltd-ids-design-system-components-tabs.mjs.map +1 -1
  218. package/fesm2022/ids-group-ltd-ids-design-system-components-tag.mjs +2 -2
  219. package/fesm2022/ids-group-ltd-ids-design-system-components-tag.mjs.map +1 -1
  220. package/fesm2022/ids-group-ltd-ids-design-system-components-textarea.mjs +23 -2
  221. package/fesm2022/ids-group-ltd-ids-design-system-components-textarea.mjs.map +1 -1
  222. package/fesm2022/ids-group-ltd-ids-design-system-components-time-picker.mjs +5 -3
  223. package/fesm2022/ids-group-ltd-ids-design-system-components-time-picker.mjs.map +1 -1
  224. package/fesm2022/ids-group-ltd-ids-design-system-components-timeline.mjs +2 -2
  225. package/fesm2022/ids-group-ltd-ids-design-system-components-timeline.mjs.map +1 -1
  226. package/fesm2022/ids-group-ltd-ids-design-system-components-toast.mjs +34 -21
  227. package/fesm2022/ids-group-ltd-ids-design-system-components-toast.mjs.map +1 -1
  228. package/fesm2022/ids-group-ltd-ids-design-system-components-tree.mjs +2 -2
  229. package/fesm2022/ids-group-ltd-ids-design-system-components-tree.mjs.map +1 -1
  230. package/fesm2022/ids-group-ltd-ids-design-system-components-waterfall-chart.mjs +252 -0
  231. package/fesm2022/ids-group-ltd-ids-design-system-components-waterfall-chart.mjs.map +1 -0
  232. package/fesm2022/ids-group-ltd-ids-design-system-components.mjs +361 -17
  233. package/fesm2022/ids-group-ltd-ids-design-system-components.mjs.map +1 -1
  234. package/fesm2022/ids-group-ltd-ids-design-system-core.mjs +2 -3
  235. package/fesm2022/ids-group-ltd-ids-design-system-core.mjs.map +1 -1
  236. package/fesm2022/ids-group-ltd-ids-design-system.mjs +7 -3
  237. package/fesm2022/ids-group-ltd-ids-design-system.mjs.map +1 -1
  238. package/migrations/0.10.0.json +2 -2
  239. package/migrations/0.10.1.json +3 -3
  240. package/migrations/0.10.2.json +8 -28
  241. package/migrations/0.11.0.json +3 -3
  242. package/migrations/0.11.1.json +15 -15
  243. package/migrations/0.11.2.json +9 -9
  244. package/migrations/0.11.3.json +1 -1
  245. package/migrations/0.11.4.json +8 -8
  246. package/migrations/0.12.1.json +1 -1
  247. package/migrations/0.12.2.json +5 -2
  248. package/migrations/0.12.3.json +3 -3
  249. package/migrations/0.13.0.json +24 -32
  250. package/migrations/0.13.1.json +5 -5
  251. package/migrations/0.13.3.json +32 -10
  252. package/migrations/0.13.4.json +2492 -0
  253. package/migrations/0.14.0.json +591 -0
  254. package/migrations/0.5.0.json +11 -5
  255. package/migrations/0.7.0.json +5 -2
  256. package/migrations/0.8.0.json +4 -3
  257. package/migrations/0.9.0.json +6 -3
  258. package/migrations/README.md +7 -2
  259. package/package.json +41 -9
  260. package/styles/_chart-frame.scss +19 -6
  261. package/styles/_chart-motion.scss +17 -10
  262. package/styles/_check-box.scss +12 -12
  263. package/styles/_dropdown-overlay.scss +14 -10
  264. package/styles/_field-box.scss +3 -3
  265. package/styles/_field-label.scss +7 -7
  266. package/styles/_overlay-motion.scss +15 -7
  267. package/styles/_skeleton-shimmer.scss +4 -1
  268. package/styles/_table-controls.scss +3 -3
  269. package/styles/_tokens-charts.scss +40 -7
  270. package/styles/_tokens.scss +3 -3
  271. package/styles/_typography.scss +101 -101
  272. package/themes/dark/_theme.scss +13 -0
  273. package/types/ids-group-ltd-ids-design-system-components-accordion.d.ts +3 -3
  274. package/types/ids-group-ltd-ids-design-system-components-alert.d.ts +5 -4
  275. package/types/ids-group-ltd-ids-design-system-components-app-layout.d.ts +17 -17
  276. package/types/ids-group-ltd-ids-design-system-components-autocomplete.d.ts +3 -1
  277. package/types/ids-group-ltd-ids-design-system-components-banner.d.ts +4 -2
  278. package/types/ids-group-ltd-ids-design-system-components-bar-chart.d.ts +40 -9
  279. package/types/ids-group-ltd-ids-design-system-components-bottom-sheet.d.ts +1 -1
  280. package/types/ids-group-ltd-ids-design-system-components-button.d.ts +8 -4
  281. package/types/ids-group-ltd-ids-design-system-components-chart-data-table.d.ts +34 -0
  282. package/types/ids-group-ltd-ids-design-system-components-chart-tooltip.d.ts +15 -3
  283. package/types/ids-group-ltd-ids-design-system-components-chart.d.ts +345 -60
  284. package/types/ids-group-ltd-ids-design-system-components-color-picker.d.ts +3 -1
  285. package/types/ids-group-ltd-ids-design-system-components-column-chart.d.ts +8 -2
  286. package/types/ids-group-ltd-ids-design-system-components-date-picker.d.ts +9 -7
  287. package/types/ids-group-ltd-ids-design-system-components-dropzone.d.ts +4 -4
  288. package/types/ids-group-ltd-ids-design-system-components-funnel-chart.d.ts +8 -7
  289. package/types/ids-group-ltd-ids-design-system-components-heatmap-chart.d.ts +124 -0
  290. package/types/ids-group-ltd-ids-design-system-components-line-chart.d.ts +88 -139
  291. package/types/ids-group-ltd-ids-design-system-components-modal.d.ts +4 -0
  292. package/types/ids-group-ltd-ids-design-system-components-multi-select.d.ts +3 -1
  293. package/types/ids-group-ltd-ids-design-system-components-pagination.d.ts +18 -1
  294. package/types/{ids-group-ltd-ids-design-system-components-donut-chart.d.ts → ids-group-ltd-ids-design-system-components-pie-chart.d.ts} +25 -23
  295. package/types/ids-group-ltd-ids-design-system-components-popover.d.ts +3 -1
  296. package/types/ids-group-ltd-ids-design-system-components-scatter-chart.d.ts +189 -0
  297. package/types/ids-group-ltd-ids-design-system-components-search.d.ts +2 -0
  298. package/types/ids-group-ltd-ids-design-system-components-segmented.d.ts +5 -1
  299. package/types/ids-group-ltd-ids-design-system-components-select.d.ts +3 -1
  300. package/types/ids-group-ltd-ids-design-system-components-skeleton.d.ts +1 -0
  301. package/types/ids-group-ltd-ids-design-system-components-switch.d.ts +10 -1
  302. package/types/ids-group-ltd-ids-design-system-components-table-export.d.ts +3 -0
  303. package/types/ids-group-ltd-ids-design-system-components-table.d.ts +44 -33
  304. package/types/ids-group-ltd-ids-design-system-components-textarea.d.ts +13 -0
  305. package/types/ids-group-ltd-ids-design-system-components-time-picker.d.ts +3 -1
  306. package/types/ids-group-ltd-ids-design-system-components-toast.d.ts +5 -2
  307. package/types/ids-group-ltd-ids-design-system-components-waterfall-chart.d.ts +116 -0
  308. package/types/ids-group-ltd-ids-design-system-components.d.ts +142 -6
  309. package/types/ids-group-ltd-ids-design-system-core.d.ts +42 -10
  310. package/types/ids-group-ltd-ids-design-system.d.ts +14 -10
  311. package/fesm2022/ids-group-ltd-ids-design-system-components-donut-chart.mjs +0 -382
  312. package/fesm2022/ids-group-ltd-ids-design-system-components-donut-chart.mjs.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"ids-group-ltd-ids-design-system-components-filter-bar.mjs","sources":["../../../src/lib/components/filter-bar/filter-item.directive.ts","../../../src/lib/components/filter-bar/filter-bar.component.ts","../../../src/lib/components/filter-bar/filter-bar.component.html","../../../src/lib/components/filter-bar/ids-group-ltd-ids-design-system-components-filter-bar.ts"],"sourcesContent":["import { Directive, TemplateRef, inject, input } from '@angular/core';\n\n/** Width assumed for a filter that declares none — roughly a `ds-select`. */\nconst DEFAULT_ITEM_WIDTH = 180;\n\nfunction toWidth(value: unknown): number {\n const width = Number(value);\n\n return Number.isFinite(width) && width > 0 ? width : DEFAULT_ITEM_WIDTH;\n}\n\n/**\n * One filter inside `ds-filter-bar`, with the width it should occupy:\n * `<ng-template [dsFilterItem]=\"220\"> <ds-date-picker … /> </ng-template>`.\n *\n * A template rather than plain projection because the bar has to MOVE the filters\n * that do not fit into its overflow panel, and projected DOM cannot be relocated\n * — it renders where it was projected. The cost is that crossing the boundary\n * destroys and re-creates the view, so a control's internal state (an open panel,\n * focus) does not survive a resize that collapses it. Its VALUE does: that lives\n * in the consumer's own signal or form control.\n *\n * The width is a contract, not a hint — the bar sizes the slot to exactly this\n * and decides the split from it, so a control that would render wider is\n * narrowed rather than allowed to break the row.\n */\n@Directive({\n selector: 'ng-template[dsFilterItem]',\n standalone: true,\n})\nexport class FilterItemDirective {\n readonly template = inject<TemplateRef<unknown>>(TemplateRef);\n\n /** Slot width in px. Bare `dsFilterItem` (or a non-positive value) means 180. */\n readonly width = input(DEFAULT_ITEM_WIDTH, {\n alias: 'dsFilterItem',\n transform: toWidth,\n });\n}\n","import { NgTemplateOutlet } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n ViewEncapsulation,\n computed,\n contentChildren,\n effect,\n input,\n isDevMode,\n signal,\n viewChild,\n} from '@angular/core';\nimport { ButtonComponent } from '@ids-group-ltd/ids-design-system/components/button';\nimport { PopoverComponent } from '@ids-group-ltd/ids-design-system/components/popover';\nimport { ProjectionDroppedDirective } from '@ids-group-ltd/ids-design-system/components';\nimport type { DsSize } from '@ids-group-ltd/ids-design-system/core';\nimport { FilterItemDirective } from './filter-item.directive';\n\n// Room kept for the \"+N more\" trigger, which only exists once something has\n// already collapsed. Measuring the real button would need it rendered first, and\n// its width then feeds back into the count that decides whether it renders at\n// all — a loop. A constant costs nothing: inline slots may shrink, so a longer\n// translation of the label takes space from them instead of breaking the row.\nconst MORE_TRIGGER_WIDTH = 132;\n\n/**\n * Priority+ filter row: renders as many filters as fit and collapses the rest\n * into a \"+N more\" panel. Every admin list past three filters hits the same wall\n * — the row wraps to a second line on a laptop, or the consumer hand-rolls this.\n *\n * The split is decided from each item's declared width plus one `ResizeObserver`\n * on the row, never by measuring the filters themselves: they would have to be in\n * the DOM to be measured, so anything that did not fit would flash before being\n * taken away. `[dsFilterItem]` carries the width.\n *\n * Anything marked `dsFilterBarTrailing` — search, a Clear button — sits at the\n * trailing edge and never collapses. Mark each control rather than wrapping them:\n * the bar owns that row's gap and alignment, and a projected wrapper would be a\n * plain block whose children stack. The trailing group is outside the measured\n * row, so flexbox subtracts its width before the row is measured and the\n * arithmetic needs no allowance for it.\n *\n * ```html\n * <ds-filter-bar>\n * <ng-template [dsFilterItem]=\"180\">\n * <ds-select label=\"Status\" … />\n * </ng-template>\n * <ng-template [dsFilterItem]=\"220\">\n * <ds-date-picker label=\"Opened\" … />\n * </ng-template>\n *\n * <ds-search dsFilterBarTrailing … />\n * <ds-button dsFilterBarTrailing variant=\"text\">Clear</ds-button>\n * </ds-filter-bar>\n * ```\n */\n@Component({\n selector: 'ds-filter-bar',\n standalone: true,\n imports: [\n NgTemplateOutlet,\n ButtonComponent,\n PopoverComponent,\n ProjectionDroppedDirective,\n ],\n templateUrl: './filter-bar.component.html',\n styleUrl: './filter-bar.component.scss',\n encapsulation: ViewEncapsulation.Emulated,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class FilterBarComponent {\n /** Trailing word of the trigger, after the count: \"+2 filters\". */\n readonly moreLabel = input<string>('more');\n /** Accessible name of the overflow panel. */\n readonly panelLabel = input<string>('More filters');\n /** Height of the \"+N\" trigger, to match the filters beside it. The bar cannot\n * infer this: `dsFilterItem` carries a WIDTH, and the filters are arbitrary\n * projected controls whose own `size` it never sees — so a row of `sm` filters\n * got an `md` trigger standing 8px taller under `align-items: flex-end`. */\n readonly triggerSize = input<DsSize>('md');\n\n protected readonly devMode = isDevMode();\n\n // descendants: true so a filter wrapped in @if or @for is still found — those\n // put it in an embedded view, which a direct-children query does not reach.\n protected readonly items = contentChildren(FilterItemDirective, {\n descendants: true,\n });\n\n private readonly row = viewChild<ElementRef<HTMLElement>>('row');\n private readonly rowWidth = signal(0);\n // Read off the row rather than hard-coded, so retuning --ds-filter-bar-gap\n // cannot silently desynchronise the arithmetic from what is rendered.\n private readonly gap = signal(0);\n\n protected readonly inlineCount = computed<number>(() => {\n const items = this.items();\n const available = this.rowWidth();\n if (!available) {\n return items.length;\n }\n\n const gap = this.gap();\n const total = items.reduce(\n (sum, item, index) => sum + (index > 0 ? gap : 0) + item.width(),\n 0,\n );\n if (total <= available) {\n return items.length;\n }\n\n // Only now is the trigger certain to render, so only now does it cost room.\n const budget = available - MORE_TRIGGER_WIDTH - gap;\n let used = 0;\n let count = 0;\n for (const item of items) {\n used += (count > 0 ? gap : 0) + item.width();\n if (used > budget) {\n break;\n }\n count++;\n }\n\n return count;\n });\n\n protected readonly inline = computed(() =>\n this.items().slice(0, this.inlineCount()),\n );\n\n /** The filters currently in the overflow panel. */\n readonly collapsed = computed(() => this.items().slice(this.inlineCount()));\n\n constructor() {\n effect((onCleanup) => {\n const row = this.row()?.nativeElement;\n if (!row) {\n return;\n }\n\n const measure = (): void => {\n this.rowWidth.set(row.clientWidth);\n this.gap.set(parseFloat(getComputedStyle(row).columnGap) || 0);\n };\n\n measure();\n const observer = new ResizeObserver(measure);\n observer.observe(row);\n onCleanup(() => observer.disconnect());\n });\n }\n}\n","<div\n #row\n class=\"row\">\n @for (item of inline(); track item) {\n <div\n class=\"item\"\n [style.width.px]=\"item.width()\">\n <ng-container [ngTemplateOutlet]=\"item.template\" />\n </div>\n }\n\n @if (collapsed().length) {\n <ds-button\n #moreTrigger\n class=\"more\"\n color=\"neutral\"\n variant=\"outline\"\n icon=\"filter\"\n [size]=\"triggerSize()\"\n [ariaExpanded]=\"more.opened()\"\n (pressed)=\"more.toggle(moreTrigger.controlRef().nativeElement)\">\n +{{ collapsed().length }} {{ moreLabel() }}\n </ds-button>\n\n <ds-popover\n #more\n align=\"end\"\n panelRole=\"dialog\"\n [panelLabel]=\"panelLabel()\">\n <div class=\"panel\">\n @for (item of collapsed(); track item) {\n <div\n class=\"item\"\n [style.width.px]=\"item.width()\">\n <ng-container [ngTemplateOutlet]=\"item.template\" />\n </div>\n }\n </div>\n </ds-popover>\n }\n</div>\n\n<div class=\"trailing\">\n <ng-content select=\"[dsFilterBarTrailing]\"></ng-content>\n</div>\n\n@if (devMode) {\n <span\n dsProjectionDropped=\"ds-filter-bar\"\n reason='a filter belongs in an <ng-template [dsFilterItem]=\"width\">, and anything else needs the dsFilterBarTrailing attribute to reach the trailing edge. Content carrying neither is not rendered.'>\n <ng-content></ng-content>\n </span>\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAEA;AACA,MAAM,kBAAkB,GAAG,GAAG;AAE9B,SAAS,OAAO,CAAC,KAAc,EAAA;AAC7B,IAAA,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC;AAE3B,IAAA,OAAO,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,KAAK,GAAG,CAAC,GAAG,KAAK,GAAG,kBAAkB;AACzE;AAEA;;;;;;;;;;;;;;AAcG;MAKU,mBAAmB,CAAA;AACrB,IAAA,QAAQ,GAAG,MAAM,CAAuB,WAAW,CAAC;;AAGpD,IAAA,KAAK,GAA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,EAAA,IAAA,EAAA,EAAA,CAAA,eAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,UAAA,CAAA,MAAA,mBAAmB,CAAA,EAAA,EAAA,GAAE;AAC9D,4BAAA,WAAW,EAAE,IAAI;AAClB,yBAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,GAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,SAAA,EAAA,IAAA,EAAA,CAEyD,KAAK,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AE3FjE;;AAEG;;;;"}
1
+ {"version":3,"file":"ids-group-ltd-ids-design-system-components-filter-bar.mjs","sources":["../../../src/lib/components/filter-bar/filter-item.directive.ts","../../../src/lib/components/filter-bar/filter-bar.component.ts","../../../src/lib/components/filter-bar/filter-bar.component.html","../../../src/lib/components/filter-bar/ids-group-ltd-ids-design-system-components-filter-bar.ts"],"sourcesContent":["import { Directive, TemplateRef, inject, input } from '@angular/core';\n\n/** Width assumed for a filter that declares none — roughly a `ds-select`. */\nconst DEFAULT_ITEM_WIDTH = 180;\n\nfunction toWidth(value: unknown): number {\n const width = Number(value);\n\n return Number.isFinite(width) && width > 0 ? width : DEFAULT_ITEM_WIDTH;\n}\n\n/**\n * One filter inside `ds-filter-bar`, with the width it should occupy:\n * `<ng-template [dsFilterItem]=\"220\"> <ds-date-picker … /> </ng-template>`.\n *\n * A template rather than plain projection because the bar has to MOVE the filters\n * that do not fit into its overflow panel, and projected DOM cannot be relocated\n * — it renders where it was projected. The cost is that crossing the boundary\n * destroys and re-creates the view, so a control's internal state (an open panel,\n * focus) does not survive a resize that collapses it. Its VALUE does: that lives\n * in the consumer's own signal or form control.\n *\n * The width is a contract, not a hint — the bar sizes the slot to exactly this\n * and decides the split from it, so a control that would render wider is\n * narrowed rather than allowed to break the row.\n */\n@Directive({\n selector: 'ng-template[dsFilterItem]',\n standalone: true,\n})\nexport class FilterItemDirective {\n readonly template = inject<TemplateRef<unknown>>(TemplateRef);\n\n /** Slot width in px. Bare `dsFilterItem` (or a non-positive value) means 180. */\n readonly width = input(DEFAULT_ITEM_WIDTH, {\n alias: 'dsFilterItem',\n transform: toWidth,\n });\n}\n","import { NgTemplateOutlet } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n ViewEncapsulation,\n computed,\n contentChildren,\n effect,\n input,\n isDevMode,\n signal,\n viewChild,\n} from '@angular/core';\nimport { ButtonComponent } from '@ids-group-ltd/ids-design-system/components/button';\nimport { PopoverComponent } from '@ids-group-ltd/ids-design-system/components/popover';\nimport { ProjectionDroppedDirective } from '@ids-group-ltd/ids-design-system/components';\nimport type { DsSize } from '@ids-group-ltd/ids-design-system/core';\nimport { FilterItemDirective } from './filter-item.directive';\n\n// Room kept for the \"+N more\" trigger, which only exists once something has\n// already collapsed. Measuring the real button would need it rendered first, and\n// its width then feeds back into the count that decides whether it renders at\n// all — a loop. A constant costs nothing: inline slots may shrink, so a longer\n// translation of the label takes space from them instead of breaking the row.\nconst MORE_TRIGGER_WIDTH = 132;\n\n/**\n * Priority+ filter row: renders as many filters as fit and collapses the rest\n * into a \"+N more\" panel. Every admin list past three filters hits the same wall\n * — the row wraps to a second line on a laptop, or the consumer hand-rolls this.\n *\n * The split is decided from each item's declared width plus one `ResizeObserver`\n * on the row, never by measuring the filters themselves: they would have to be in\n * the DOM to be measured, so anything that did not fit would flash before being\n * taken away. `[dsFilterItem]` carries the width.\n *\n * Anything marked `dsFilterBarTrailing` — search, a Clear button — sits at the\n * trailing edge and never collapses. Mark each control rather than wrapping them:\n * the bar owns that row's gap and alignment, and a projected wrapper would be a\n * plain block whose children stack. The trailing group is outside the measured\n * row, so flexbox subtracts its width before the row is measured and the\n * arithmetic needs no allowance for it.\n *\n * ```html\n * <ds-filter-bar>\n * <ng-template [dsFilterItem]=\"180\">\n * <ds-select label=\"Status\" … />\n * </ng-template>\n * <ng-template [dsFilterItem]=\"220\">\n * <ds-date-picker label=\"Opened\" … />\n * </ng-template>\n *\n * <ds-search dsFilterBarTrailing … />\n * <ds-button dsFilterBarTrailing variant=\"text\">Clear</ds-button>\n * </ds-filter-bar>\n * ```\n */\n@Component({\n selector: 'ds-filter-bar',\n standalone: true,\n imports: [\n NgTemplateOutlet,\n ButtonComponent,\n PopoverComponent,\n ProjectionDroppedDirective,\n ],\n templateUrl: './filter-bar.component.html',\n styleUrl: './filter-bar.component.scss',\n encapsulation: ViewEncapsulation.Emulated,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class FilterBarComponent {\n /** Trailing word of the trigger, after the count: \"+2 filters\". */\n readonly moreLabel = input<string>('more');\n /** Accessible name of the overflow panel. */\n readonly panelLabel = input<string>('More filters');\n /** Height of the \"+N\" trigger, to match the filters beside it. The bar cannot\n * infer this: `dsFilterItem` carries a WIDTH, and the filters are arbitrary\n * projected controls whose own `size` it never sees — so a row of `sm` filters\n * got an `md` trigger standing 8px taller under `align-items: flex-end`. */\n readonly triggerSize = input<DsSize>('md');\n\n protected readonly devMode = isDevMode();\n\n // descendants: true so a filter wrapped in @if or @for is still found — those\n // put it in an embedded view, which a direct-children query does not reach.\n protected readonly items = contentChildren(FilterItemDirective, {\n descendants: true,\n });\n\n private readonly row = viewChild<ElementRef<HTMLElement>>('row');\n private readonly rowWidth = signal(0);\n // Read off the row rather than hard-coded, so retuning --ds-filter-bar-gap\n // cannot silently desynchronise the arithmetic from what is rendered.\n private readonly gap = signal(0);\n\n protected readonly inlineCount = computed<number>(() => {\n const items = this.items();\n const available = this.rowWidth();\n if (!available) {\n return items.length;\n }\n\n const gap = this.gap();\n const total = items.reduce(\n (sum, item, index) => sum + (index > 0 ? gap : 0) + item.width(),\n 0,\n );\n if (total <= available) {\n return items.length;\n }\n\n // Only now is the trigger certain to render, so only now does it cost room.\n const budget = available - MORE_TRIGGER_WIDTH - gap;\n let used = 0;\n let count = 0;\n for (const item of items) {\n used += (count > 0 ? gap : 0) + item.width();\n if (used > budget) {\n break;\n }\n count++;\n }\n\n return count;\n });\n\n protected readonly inline = computed(() =>\n this.items().slice(0, this.inlineCount()),\n );\n\n /** The filters currently in the overflow panel. */\n readonly collapsed = computed(() => this.items().slice(this.inlineCount()));\n\n constructor() {\n effect((onCleanup) => {\n const row = this.row()?.nativeElement;\n if (!row) {\n return;\n }\n\n const measure = (): void => {\n this.rowWidth.set(row.clientWidth);\n this.gap.set(parseFloat(getComputedStyle(row).columnGap) || 0);\n };\n\n measure();\n const observer = new ResizeObserver(measure);\n observer.observe(row);\n onCleanup(() => observer.disconnect());\n });\n }\n}\n","<div\n #row\n class=\"row\">\n @for (item of inline(); track item) {\n <div\n class=\"item\"\n [style.width.px]=\"item.width()\">\n <ng-container [ngTemplateOutlet]=\"item.template\" />\n </div>\n }\n\n @if (collapsed().length) {\n <ds-button\n #moreTrigger\n class=\"more\"\n color=\"neutral\"\n variant=\"outline\"\n icon=\"filter\"\n [size]=\"triggerSize()\"\n [ariaExpanded]=\"more.opened()\"\n (pressed)=\"more.toggle(moreTrigger.controlRef().nativeElement)\">\n +{{ collapsed().length }} {{ moreLabel() }}\n </ds-button>\n\n <ds-popover\n #more\n align=\"end\"\n panelRole=\"dialog\"\n [panelLabel]=\"panelLabel()\">\n <div class=\"panel\">\n @for (item of collapsed(); track item) {\n <div\n class=\"item\"\n [style.width.px]=\"item.width()\">\n <ng-container [ngTemplateOutlet]=\"item.template\" />\n </div>\n }\n </div>\n </ds-popover>\n }\n</div>\n\n<div class=\"trailing\">\n <ng-content select=\"[dsFilterBarTrailing]\"></ng-content>\n</div>\n\n@if (devMode) {\n <span\n dsProjectionDropped=\"ds-filter-bar\"\n reason='a filter belongs in an <ng-template [dsFilterItem]=\"width\">, and anything else needs the dsFilterBarTrailing attribute to reach the trailing edge. Content carrying neither is not rendered.'>\n <ng-content></ng-content>\n </span>\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;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UAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,YAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,WAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,aAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,KAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,eAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,UAAA,CAAA,MAAA,mBAAmB,CAAA,EAAA,EAAA,GAAE;AAC9D,4BAAA,WAAW,EAAE,IAAI;AAClB,yBAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,GAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,SAAA,EAAA,IAAA,EAAA,CAEyD,KAAK,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AE3FjE;;AAEG;;;;"}
@@ -1,9 +1,9 @@
1
1
  import * as i0 from '@angular/core';
2
- import { input, booleanAttribute, numberAttribute, output, contentChild, computed, signal, ChangeDetectionStrategy, ViewEncapsulation, Component } from '@angular/core';
3
- import { formatPercent, defaultChartFormat, staggerDelay, markAt, nextRovingIndex, focusMark, chartColors, CHART_RAMP_COLORS, describeSeries } from '@ids-group-ltd/ids-design-system/components';
2
+ import { input, booleanAttribute, numberAttribute, output, contentChild, computed, ChangeDetectionStrategy, ViewEncapsulation, Component } from '@angular/core';
3
+ import { formatPercent, leaveMark, resolveChartDefaults, staggerDelay, rovingMarks, markAt, chartColors, CHART_RAMP_COLORS, describeSeries } from '@ids-group-ltd/ids-design-system/components';
4
4
  import { SkeletonComponent } from '@ids-group-ltd/ids-design-system/components/skeleton';
5
5
  import { IconComponent } from '@ids-group-ltd/ids-design-system/icons';
6
- import { resolveWithConfig } from '@ids-group-ltd/ids-design-system/core';
6
+ import { ChartDataTableComponent } from '@ids-group-ltd/ids-design-system/components/chart-data-table';
7
7
  import { chartActiveMark, ChartTooltipDirective } from '@ids-group-ltd/ids-design-system/components/chart-tooltip';
8
8
 
9
9
  /** Bottom width of the fixed silhouette, as a fraction of the full width. The
@@ -225,6 +225,7 @@ function formatDrop(fraction, count, mode, format) {
225
225
  }
226
226
  const SKELETON_STAGE_WIDTHS = ['88%', '62%', '80%', '54%', '72%'];
227
227
  class FunnelChartComponent {
228
+ leaveMark = leaveMark;
228
229
  /** Drawn in the order given. The order of a funnel's stages is its meaning,
229
230
  * so they are never sorted. */
230
231
  data = input.required(...(ngDevMode ? [{ debugName: "data" }] : /* istanbul ignore next */ []));
@@ -281,11 +282,12 @@ class FunnelChartComponent {
281
282
  * included. Unset falls back to `DS_CONFIG.chart.valueFormat`, then the browser's locale
282
283
  * grouping with a K/M/B suffix past four digits. */
283
284
  valueFormat = input(null, ...(ngDevMode ? [{ debugName: "valueFormat" }] : /* istanbul ignore next */ []));
284
- frameResolved = resolveWithConfig(this.frame, (config) => config.chart?.frame, 'auto');
285
- dataTableResolved = resolveWithConfig(this.dataTable, (config) => config.chart?.dataTable, 'none');
286
- emptyTextResolved = resolveWithConfig(this.emptyText, (config) => config.chart?.emptyText, 'No data');
287
- errorTextResolved = resolveWithConfig(this.errorText, (config) => config.chart?.errorText, 'Could not load the data');
288
- valueFormatResolved = resolveWithConfig(this.valueFormat, (config) => config.chart?.valueFormat, defaultChartFormat);
285
+ defaults = resolveChartDefaults(this);
286
+ frameResolved = this.defaults.frame;
287
+ dataTableResolved = this.defaults.dataTable;
288
+ emptyTextResolved = this.defaults.emptyText;
289
+ errorTextResolved = this.defaults.errorText;
290
+ valueFormatResolved = this.defaults.valueFormat;
289
291
  /** Turns on the click affordance — the pointer cursor and any hover tint.
290
292
  * The click output fires whether or not this is set, so a consumer that
291
293
  * binds the output and forgets the flag still receives every click. */
@@ -315,7 +317,7 @@ class FunnelChartComponent {
315
317
  * funnel's stages are its categories, so an axis tooltip would repeat the item one. */
316
318
  tooltip = input('item', ...(ngDevMode ? [{ debugName: "tooltip" }] : /* istanbul ignore next */ []));
317
319
  tooltipTemplate = contentChild('dsChartTooltip', ...(ngDevMode ? [{ debugName: "tooltipTemplate" }] : /* istanbul ignore next */ []));
318
- tooltipLingerResolved = resolveWithConfig(this.tooltipLingerMs, (config) => config.chart?.tooltipLingerMs, 0);
320
+ tooltipLingerResolved = this.defaults.tooltipLingerMs;
319
321
  activeMark = chartActiveMark(() => this.tooltipLingerResolved());
320
322
  /** Where the badge goes, as a percentage of the shape's box. Percentages rather than viewBox
321
323
  * units because this svg is `preserveAspectRatio="none"`: it stretches horizontally with the
@@ -336,13 +338,9 @@ class FunnelChartComponent {
336
338
  this.activeMark.pin(index, event);
337
339
  }
338
340
  }
339
- /** One tab stop per chart, not one per mark: WCAG 2.1.1's Understanding is explicit that not
340
- * every mouse-operable control has to be separately focusable, and that is what keeps a
341
- * twenty-five mark chart from being twenty-five stops in the page's tab order. */
342
- rovingIndex = signal(0, ...(ngDevMode ? [{ debugName: "rovingIndex" }] : /* istanbul ignore next */ []));
343
- tabStopIndex = computed(() => Math.min(this.rovingIndex(), Math.max(0, this.stages().length - 1)), ...(ngDevMode ? [{ debugName: "tabStopIndex" }] : /* istanbul ignore next */ []));
341
+ roving = rovingMarks(() => this.stages().length);
344
342
  onMarkFocus(index, event) {
345
- this.rovingIndex.set(index);
343
+ this.roving.focus(index);
346
344
  this.activeMark.enter(index, event);
347
345
  }
348
346
  /** A table row stands for its band, so it opens the band's tooltip over the BAND and dims the
@@ -356,13 +354,7 @@ class FunnelChartComponent {
356
354
  this.activeMark.index() !== index);
357
355
  }
358
356
  onMarkNavigation(event, index) {
359
- const next = nextRovingIndex(event.key, index, this.stages().length);
360
- if (next === null) {
361
- return;
362
- }
363
- event.preventDefault();
364
- this.rovingIndex.set(next);
365
- focusMark(event.currentTarget.closest('svg'), next);
357
+ this.roving.navigate(event, index, event.currentTarget.closest('svg'));
366
358
  }
367
359
  tooltipContext = computed(() => {
368
360
  const entry = this.stages()[this.activeMark.index()];
@@ -389,6 +381,10 @@ class FunnelChartComponent {
389
381
  * edge it is drawn on, so each band claims half the gap above it and half below — the gap stays
390
382
  * exactly as wide to the eye and stops being dead space to the pointer. */
391
383
  hitGapUnits = computed(() => stageGapUnits(this.data().length, FUNNEL_VIEW_BOX_HEIGHT), ...(ngDevMode ? [{ debugName: "hitGapUnits" }] : /* istanbul ignore next */ []));
384
+ tableRows = computed(() => this.stages().map((entry) => ({
385
+ key: entry.stage.id,
386
+ cells: [entry.stage.label, entry.formattedValue],
387
+ })), ...(ngDevMode ? [{ debugName: "tableRows" }] : /* istanbul ignore next */ []));
392
388
  stages = computed(() => {
393
389
  const data = this.data();
394
390
  const values = data.map((stage) => stage.value);
@@ -448,11 +444,16 @@ class FunnelChartComponent {
448
444
  * table's skeleton rows. */
449
445
  skeletonStages = computed(() => Array.from({ length: Math.max(this.data().length, 3) }, (unusedEntry, index) => SKELETON_STAGE_WIDTHS[index % SKELETON_STAGE_WIDTHS.length]), ...(ngDevMode ? [{ debugName: "skeletonStages" }] : /* istanbul ignore next */ []));
450
446
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: FunnelChartComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
451
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: FunnelChartComponent, isStandalone: true, selector: "ds-funnel-chart", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: true, transformFunction: null }, shape: { classPropertyName: "shape", publicName: "shape", isSignal: true, isRequired: false, transformFunction: null }, showTable: { classPropertyName: "showTable", publicName: "showTable", isSignal: true, isRequired: false, transformFunction: null }, frame: { classPropertyName: "frame", publicName: "frame", isSignal: true, isRequired: false, transformFunction: null }, tooltipLingerMs: { classPropertyName: "tooltipLingerMs", publicName: "tooltipLingerMs", isSignal: true, isRequired: false, transformFunction: null }, caption: { classPropertyName: "caption", publicName: "caption", isSignal: true, isRequired: false, transformFunction: null }, summary: { classPropertyName: "summary", publicName: "summary", isSignal: true, isRequired: false, transformFunction: null }, dataTable: { classPropertyName: "dataTable", publicName: "dataTable", isSignal: true, isRequired: false, transformFunction: null }, drop: { classPropertyName: "drop", publicName: "drop", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, emptyText: { classPropertyName: "emptyText", publicName: "emptyText", isSignal: true, isRequired: false, transformFunction: null }, error: { classPropertyName: "error", publicName: "error", isSignal: true, isRequired: false, transformFunction: null }, errorText: { classPropertyName: "errorText", publicName: "errorText", isSignal: true, isRequired: false, transformFunction: null }, valueFormat: { classPropertyName: "valueFormat", publicName: "valueFormat", isSignal: true, isRequired: false, transformFunction: null }, interactive: { classPropertyName: "interactive", publicName: "interactive", isSignal: true, isRequired: false, transformFunction: null }, pinOnClick: { classPropertyName: "pinOnClick", publicName: "pinOnClick", isSignal: true, isRequired: false, transformFunction: null }, dimOthers: { classPropertyName: "dimOthers", publicName: "dimOthers", isSignal: true, isRequired: false, transformFunction: null }, staggerMs: { classPropertyName: "staggerMs", publicName: "staggerMs", isSignal: true, isRequired: false, transformFunction: null }, tooltip: { classPropertyName: "tooltip", publicName: "tooltip", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { stageClicked: "stageClicked" }, host: { properties: { "class.framed": "frameResolved() === 'auto'" } }, queries: [{ propertyName: "tooltipTemplate", first: true, predicate: ["dsChartTooltip"], descendants: true, isSignal: true }], ngImport: i0, template: "<figure class=\"funnel-chart\">\n @if (activeMark.pinned()) {\n <button\n class=\"pin-reset\"\n type=\"button\"\n (click)=\"activeMark.release()\">\n Unpin\n </button>\n }\n\n @if (caption()) {\n <figcaption>\n {{ caption() }}\n </figcaption>\n }\n\n @if (error()) {\n <p\n class=\"empty is-error\"\n role=\"status\">\n {{ errorTextResolved() }}\n </p>\n } @else if (loading()) {\n <div\n class=\"skeleton\"\n aria-hidden=\"true\">\n @for (placeholderWidth of skeletonStages(); track $index) {\n <ds-skeleton\n height=\"calc(var(--_funnel-chart-stage-height) - var(--_funnel-chart-stage-gap))\"\n [width]=\"placeholderWidth\" />\n }\n </div>\n } @else if (isEmpty()) {\n <p class=\"empty\">\n {{ emptyTextResolved() }}\n </p>\n } @else {\n <div\n class=\"shape\"\n [class.dims-others]=\"dimOthers()\"\n [attr.role]=\"interactive() ? 'group' : 'img'\"\n [attr.aria-label]=\"accessibleName()\"\n [dsChartTooltip]=\"tooltipContext()\"\n [dsChartTooltipPreferBelow]=\"activeMark.pinned()\"\n [dsChartTooltipOrigin]=\"activeMark.origin()\"\n [dsChartTooltipTemplate]=\"tooltipTemplate() ?? null\">\n <svg\n preserveAspectRatio=\"none\"\n [attr.aria-hidden]=\"interactive() ? null : true\"\n [attr.viewBox]=\"viewBox\"\n [style.block-size]=\"chartHeight()\">\n @for (entry of stages(); track entry.stage.id; let index = $index) {\n <polygon\n class=\"stage\"\n animate.enter=\"mark-enter\"\n animate.leave=\"mark-leave\"\n [attr.stroke-width]=\"hitGapUnits()\"\n [style.--_chart-mark-stagger]=\"markStagger(index)\"\n [class.interactive]=\"interactive()\"\n [class.is-pinned]=\"\n activeMark.pinned() && activeMark.index() === index\n \"\n [class.is-dimmed]=\"isDimmed(index)\"\n [attr.points]=\"entry.points\"\n [attr.fill]=\"entry.color\"\n [attr.role]=\"interactive() ? 'button' : null\"\n [attr.tabindex]=\"\n interactive() ? (index === tabStopIndex() ? 0 : -1) : null\n \"\n [attr.data-mark-index]=\"index\"\n [attr.aria-label]=\"interactive() ? entryLabel(entry) : null\"\n (pointerenter)=\"activeMark.enter(index, $event)\"\n (pointerleave)=\"activeMark.leave()\"\n (focus)=\"onMarkFocus(index, $event)\"\n (blur)=\"activeMark.leave()\"\n (keydown)=\"onMarkNavigation($event, index)\"\n (click)=\"onMarkClick(entry.stage, index, $event)\"\n (keydown.enter)=\"onStageKey(entry.stage, $event)\"\n (keydown.space)=\"onStageKey(entry.stage, $event)\">\n </polygon>\n }\n </svg>\n\n @if (pinnedCenter(); as center) {\n <span\n class=\"pin-marker\"\n [style.left.%]=\"center.xPercent\"\n [style.top.%]=\"center.yPercent\">\n <ds-icon\n name=\"pin\"\n [size]=\"13\" />\n </span>\n }\n </div>\n\n @if (showTable()) {\n <table class=\"stage-table\">\n <caption class=\"visually-hidden\">\n Each stage as a percentage of the first, and the drop from the stage\n above it.\n </caption>\n\n <thead>\n <tr>\n <th scope=\"col\">\n Stage\n </th>\n\n <th scope=\"col\">\n Value\n </th>\n\n <th scope=\"col\">\n Percent\n </th>\n\n @if (drop() !== 'none') {\n <th scope=\"col\">\n Drop\n </th>\n }\n </tr>\n </thead>\n\n <tbody>\n @for (entry of stages(); track entry.stage.id; let index = $index) {\n <tr\n (pointerenter)=\"onRowEnter(index, $event)\"\n (pointerleave)=\"activeMark.leave()\">\n <th scope=\"row\">\n <span\n class=\"swatch\"\n animate.enter=\"mark-enter\"\n aria-hidden=\"true\"\n [style.background]=\"entry.color\">\n </span>\n\n {{ entry.stage.label }}\n </th>\n\n <td>\n {{ entry.formattedValue }}\n </td>\n\n <td>\n {{ entry.formattedPercent }}\n </td>\n\n @if (drop() !== 'none') {\n <td>\n {{ entry.formattedDrop }}\n </td>\n }\n </tr>\n }\n </tbody>\n </table>\n }\n\n @if (showDataTable()) {\n <details\n class=\"data-table\"\n [open]=\"dataTableResolved() === 'visible'\">\n <summary>\n Data table\n </summary>\n\n <table>\n <caption>\n {{\n caption() ?? 'Chart data'\n }}\n </caption>\n\n <thead>\n <tr>\n <th scope=\"col\">\n Label\n </th>\n\n <th scope=\"col\">\n Value\n </th>\n </tr>\n </thead>\n\n <tbody>\n @for (entry of stages(); track entry.stage.id) {\n <tr>\n <td>\n {{ entry.stage.label }}\n </td>\n\n <td>\n {{ entry.formattedValue }}\n </td>\n </tr>\n }\n </tbody>\n </table>\n </details>\n }\n }\n</figure>\n", styles: ["@charset \"UTF-8\";:where(:focus-visible){outline:var(--focus-ring-width) solid var(--focus-ring-color);outline-offset:var(--focus-ring-offset);animation:ds-focus-ring-in var(--duration-fast) var(--ease-standard)}@keyframes ds-focus-ring-in{0%{outline-color:transparent}}:root[data-focus=ring]{--ds-field-focus-shadow: var(--focus-ring);--ds-field-focus-shadow-error: var(--focus-ring-error)}:root[data-focus=edge]{--focus-ring-offset: 0px;--ds-field-focus-shadow: 0 0 0 var(--border-width-default) var(--primary);--ds-field-focus-shadow-error: 0 0 0 var(--border-width-default) var(--error)}[data-focus=inset]{--focus-ring-offset: calc(-1 * var(--focus-ring-width));--ds-field-focus-shadow: var(--focus-ring-inset);--ds-field-focus-shadow-error: var(--focus-ring-inset-error)}@media(forced-colors:active){:where(:focus-visible){outline:var(--focus-ring-width) solid CanvasText;outline-offset:var(--focus-ring-offset)}}@keyframes ds-chart-mark-grow-y{0%{opacity:0;transform:scaleY(0)}}@keyframes ds-chart-mark-grow-x{0%{opacity:0;transform:scaleX(0)}}@keyframes ds-chart-mark-fade-in{0%{opacity:0}}@keyframes ds-chart-mark-exit{to{opacity:0}}.stage.mark-enter{animation:ds-chart-mark-fade-in var(--ds-motion-chart-mark-enter-duration) var(--ds-motion-chart-mark-enter-easing) calc(var(--ds-motion-chart-mark-exit-duration) + var(--_chart-mark-stagger, 0ms)) both}.stage.mark-leave{animation:ds-chart-mark-exit var(--ds-motion-chart-mark-exit-duration) var(--ds-motion-chart-mark-exit-easing) both}.swatch.mark-enter{animation:ds-chart-mark-fade-in var(--ds-motion-chart-mark-enter-duration) var(--ds-motion-chart-mark-enter-easing) calc(var(--ds-motion-chart-mark-exit-duration) + var(--_chart-mark-stagger, 0ms)) both}.swatch.mark-leave{animation:ds-chart-mark-exit var(--ds-motion-chart-mark-exit-duration) var(--ds-motion-chart-mark-exit-easing) both}:host{display:block;-webkit-user-select:none;user-select:none}:host(.framed){padding:var(--ds-chart-frame-padding);background:var(--ds-chart-frame-bg-color);border:var(--ds-chart-frame-border-width) solid var(--ds-chart-frame-border-color);border-radius:var(--ds-chart-frame-radius)}.data-table,.stage-table,figcaption{-webkit-user-select:text;user-select:text}@media not (forced-colors:active){.stage:focus{outline:none}}.data-table{--_chart-data-table-marker: var(--space-1);margin-block-start:var(--space-4);color:var(--text-secondary);font-size:var(--font-size-s)}.data-table>summary{display:inline-flex;align-items:center;gap:var(--space-1);padding-block:var(--space-1);color:var(--text-tertiary);font-size:var(--font-size-xs);cursor:pointer;list-style:none}.data-table>summary::-webkit-details-marker{display:none}.data-table>summary:before{content:\"\";inline-size:0;block-size:0;border-block-start:var(--_chart-data-table-marker) solid transparent;border-block-end:var(--_chart-data-table-marker) solid transparent;border-inline-start:calc(var(--_chart-data-table-marker) * 1.25) solid currentcolor;transition:transform var(--duration-fast) var(--ease-standard)}@media(prefers-reduced-motion:reduce){.data-table>summary:before{transition:none}}.data-table[open]>summary:before{transform:rotate(90deg)}.data-table>summary{border-radius:var(--radius-sm)}.data-table caption{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}.data-table table{inline-size:100%;margin-block-start:var(--space-2);border-collapse:collapse;font-variant-numeric:tabular-nums}.data-table th,.data-table td{padding-block:var(--space-2);border-block-end:var(--border-width-default) solid var(--ds-chart-grid-line-color);text-align:end}.data-table thead th{color:var(--text-tertiary);font-size:var(--font-size-xs);font-weight:600}.data-table th:first-child,.data-table td:first-child{text-align:start}.data-table td+td{padding-inline-start:var(--space-3)}.funnel-chart{--_funnel-chart-stage-height: var(--ds-funnel-chart-stage-height, 44px);--_funnel-chart-stage-gap: var(--ds-funnel-chart-stage-gap, var(--ds-chart-bar-gap));--_funnel-chart-row-gap: var(--ds-funnel-chart-row-gap, var(--space-4));--_funnel-chart-focus-color: var(--ds-funnel-chart-focus-color, var(--focus-ring-color));--_funnel-chart-focus-width: var(--ds-funnel-chart-focus-width, var(--focus-ring-width));position:relative;overflow-x:auto;margin:0}.visually-hidden{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}figcaption{margin-block-end:var(--space-3);color:var(--text-primary);font-weight:600}.empty{display:grid;place-items:center;min-block-size:calc(3 * (var(--_funnel-chart-stage-height) + var(--_funnel-chart-stage-gap)));margin:0;color:var(--text-secondary);text-align:center}.shape{display:block}svg{display:block;inline-size:100%}.stage{stroke:transparent}@media not (forced-colors:active){.stage.interactive:focus-visible{outline:none}}.stage.interactive:focus-visible{stroke:var(--ds-chart-focus-ring-color);stroke-width:var(--focus-ring-width);paint-order:stroke;filter:drop-shadow(0 0 var(--focus-ring-width) var(--ds-chart-focus-halo-color))}.skeleton{display:grid;row-gap:var(--_funnel-chart-stage-gap)}.stage-table{inline-size:100%;margin-block-start:var(--_funnel-chart-row-gap);border-collapse:collapse;font-variant-numeric:tabular-nums}.stage-table th,.stage-table td{padding-block:var(--space-2);border-block-end:var(--border-width-default) solid var(--ds-chart-grid-line-color);text-align:end}.stage-table thead th{color:var(--text-tertiary);font-size:var(--font-size-xs);font-weight:600}.stage-table thead th:first-child{text-align:start}.stage-table td{padding-inline-start:var(--space-3)}.stage-table th[scope=row]{color:var(--text-secondary);font-weight:400;text-align:start}.swatch{display:inline-block;inline-size:var(--space-2);block-size:var(--space-2);margin-inline-end:var(--space-2);border-radius:var(--radius-sm)}.empty.is-error{color:var(--error)}.shape .stage{transition:opacity var(--ds-motion-chart-state-duration) var(--ds-motion-chart-state-easing),fill var(--ds-motion-chart-mark-duration) var(--ds-motion-chart-mark-easing)}.shape .stage.is-dimmed{opacity:var(--ds-chart-dim-opacity)}.shape.dims-others:not(:has(.stage.is-pinned)):has(.stage.interactive:hover) .stage.interactive:not(:hover),.shape.dims-others:not(:has(.stage.is-pinned)):has(.stage.interactive:focus-visible) .stage.interactive:not(:focus-visible),.shape.dims-others:has(.stage.is-pinned) .stage:not(.is-pinned){opacity:var(--ds-chart-dim-opacity)}.shape .stage.interactive{cursor:pointer}@media(forced-colors:active){.axis-line,.grid-line{stroke:CanvasText}.axis-label,.category-label{fill:CanvasText}:focus-visible{stroke:Highlight;filter:none}}:host{position:relative}.pin-reset{position:absolute;inset-block-start:var(--space-2);inset-inline:0;z-index:1;justify-self:center;margin-inline:auto;display:inline-flex;align-items:center;gap:var(--space-1);min-block-size:var(--space-12);inline-size:fit-content;padding:var(--space-1) var(--space-3);border:var(--border-width-default) solid var(--border-divider);border-radius:var(--radius-pill);background:var(--surface-default);color:var(--text-secondary);font-size:var(--font-size-xs);line-height:1;box-shadow:var(--shadow-1);cursor:pointer}.pin-reset:hover{color:var(--text-primary);border-color:var(--border-strong)}.pin-marker{display:grid;place-items:center;inline-size:var(--ds-chart-pin-size, 22px);block-size:var(--ds-chart-pin-size, 22px);border:var(--border-width-default) solid var(--border-divider);border-radius:var(--radius-pill);background:var(--surface-default);color:var(--text-primary);box-shadow:var(--shadow-1);pointer-events:none}.shape{position:relative}.pin-marker{position:absolute;transform:translate(-50%,-50%)}\n"], dependencies: [{ kind: "component", type: SkeletonComponent, selector: "ds-skeleton", inputs: ["width", "height", "circle", "inline"] }, { kind: "directive", type: ChartTooltipDirective, selector: "[dsChartTooltip]", inputs: ["dsChartTooltip", "dsChartTooltipOrigin", "dsChartTooltipTemplate", "dsChartTooltipExtraGap", "dsChartTooltipPreferBelow"] }, { kind: "component", type: IconComponent, selector: "ds-icon", inputs: ["name", "size", "stroke", "ariaLabel"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
447
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: FunnelChartComponent, isStandalone: true, selector: "ds-funnel-chart", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: true, transformFunction: null }, shape: { classPropertyName: "shape", publicName: "shape", isSignal: true, isRequired: false, transformFunction: null }, showTable: { classPropertyName: "showTable", publicName: "showTable", isSignal: true, isRequired: false, transformFunction: null }, frame: { classPropertyName: "frame", publicName: "frame", isSignal: true, isRequired: false, transformFunction: null }, tooltipLingerMs: { classPropertyName: "tooltipLingerMs", publicName: "tooltipLingerMs", isSignal: true, isRequired: false, transformFunction: null }, caption: { classPropertyName: "caption", publicName: "caption", isSignal: true, isRequired: false, transformFunction: null }, summary: { classPropertyName: "summary", publicName: "summary", isSignal: true, isRequired: false, transformFunction: null }, dataTable: { classPropertyName: "dataTable", publicName: "dataTable", isSignal: true, isRequired: false, transformFunction: null }, drop: { classPropertyName: "drop", publicName: "drop", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, emptyText: { classPropertyName: "emptyText", publicName: "emptyText", isSignal: true, isRequired: false, transformFunction: null }, error: { classPropertyName: "error", publicName: "error", isSignal: true, isRequired: false, transformFunction: null }, errorText: { classPropertyName: "errorText", publicName: "errorText", isSignal: true, isRequired: false, transformFunction: null }, valueFormat: { classPropertyName: "valueFormat", publicName: "valueFormat", isSignal: true, isRequired: false, transformFunction: null }, interactive: { classPropertyName: "interactive", publicName: "interactive", isSignal: true, isRequired: false, transformFunction: null }, pinOnClick: { classPropertyName: "pinOnClick", publicName: "pinOnClick", isSignal: true, isRequired: false, transformFunction: null }, dimOthers: { classPropertyName: "dimOthers", publicName: "dimOthers", isSignal: true, isRequired: false, transformFunction: null }, staggerMs: { classPropertyName: "staggerMs", publicName: "staggerMs", isSignal: true, isRequired: false, transformFunction: null }, tooltip: { classPropertyName: "tooltip", publicName: "tooltip", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { stageClicked: "stageClicked" }, host: { properties: { "class.framed": "frameResolved() === 'auto'" } }, queries: [{ propertyName: "tooltipTemplate", first: true, predicate: ["dsChartTooltip"], descendants: true, isSignal: true }], ngImport: i0, template: "<figure class=\"funnel-chart\">\n @if (activeMark.pinned()) {\n <button\n class=\"pin-reset\"\n type=\"button\"\n (click)=\"activeMark.release()\">\n Unpin\n </button>\n }\n\n @if (caption()) {\n <figcaption>\n {{ caption() }}\n </figcaption>\n }\n\n @if (error()) {\n <p\n class=\"empty is-error\"\n role=\"status\">\n {{ errorTextResolved() }}\n </p>\n } @else if (loading()) {\n <div\n class=\"skeleton\"\n aria-hidden=\"true\">\n @for (placeholderWidth of skeletonStages(); track $index) {\n <ds-skeleton\n height=\"calc(var(--_funnel-chart-stage-height) - var(--_funnel-chart-stage-gap))\"\n [width]=\"placeholderWidth\" />\n }\n </div>\n } @else if (isEmpty()) {\n <p class=\"empty\">\n {{ emptyTextResolved() }}\n </p>\n } @else {\n <div\n class=\"shape\"\n [class.dims-others]=\"dimOthers()\"\n [attr.role]=\"interactive() ? 'group' : 'img'\"\n [attr.aria-label]=\"accessibleName()\"\n [dsChartTooltip]=\"tooltipContext()\"\n [dsChartTooltipPreferBelow]=\"activeMark.pinned()\"\n [dsChartTooltipPinned]=\"activeMark.pinned()\"\n [dsChartTooltipOrigin]=\"activeMark.origin()\"\n [dsChartTooltipTemplate]=\"tooltipTemplate() ?? null\">\n <svg\n preserveAspectRatio=\"none\"\n [attr.aria-hidden]=\"interactive() ? null : true\"\n [attr.viewBox]=\"viewBox\"\n [style.block-size]=\"chartHeight()\">\n @for (entry of stages(); track entry.stage.id; let index = $index) {\n <polygon\n class=\"stage\"\n [attr.stroke-width]=\"hitGapUnits()\"\n [style.--_chart-mark-stagger]=\"markStagger(index)\"\n [class.interactive]=\"interactive()\"\n [class.is-pinned]=\"\n activeMark.pinned() && activeMark.index() === index\n \"\n [class.is-dimmed]=\"isDimmed(index)\"\n [attr.points]=\"entry.points\"\n [attr.fill]=\"entry.color\"\n [attr.role]=\"interactive() ? 'button' : null\"\n [attr.tabindex]=\"\n interactive() ? (index === roving.tabStop() ? 0 : -1) : null\n \"\n [attr.data-mark-index]=\"index\"\n [attr.aria-label]=\"interactive() ? entryLabel(entry) : null\"\n (animate.leave)=\"leaveMark($event)\"\n (pointerenter)=\"activeMark.enter(index, $event)\"\n (pointerleave)=\"activeMark.leave()\"\n (focus)=\"onMarkFocus(index, $event)\"\n (blur)=\"activeMark.leave()\"\n (keydown)=\"onMarkNavigation($event, index)\"\n (click)=\"onMarkClick(entry.stage, index, $event)\"\n (keydown.enter)=\"onStageKey(entry.stage, $event)\"\n (keydown.space)=\"onStageKey(entry.stage, $event)\">\n </polygon>\n }\n </svg>\n\n @if (pinnedCenter(); as center) {\n <span\n class=\"pin-marker\"\n [style.left.%]=\"center.xPercent\"\n [style.top.%]=\"center.yPercent\">\n <ds-icon\n name=\"pin\"\n [size]=\"13\" />\n </span>\n }\n </div>\n\n @if (showTable()) {\n <table class=\"stage-table\">\n <caption class=\"visually-hidden\">\n Each stage as a percentage of the first, and the drop from the stage\n above it.\n </caption>\n\n <thead>\n <tr>\n <th scope=\"col\">\n Stage\n </th>\n\n <th scope=\"col\">\n Value\n </th>\n\n <th scope=\"col\">\n Percent\n </th>\n\n @if (drop() !== 'none') {\n <th scope=\"col\">\n Drop\n </th>\n }\n </tr>\n </thead>\n\n <tbody>\n @for (entry of stages(); track entry.stage.id; let index = $index) {\n <tr\n (pointerenter)=\"onRowEnter(index, $event)\"\n (pointerleave)=\"activeMark.leave()\">\n <th scope=\"row\">\n <span\n class=\"swatch\"\n aria-hidden=\"true\"\n [style.background]=\"entry.color\">\n </span>\n\n {{ entry.stage.label }}\n </th>\n\n <td>\n {{ entry.formattedValue }}\n </td>\n\n <td>\n {{ entry.formattedPercent }}\n </td>\n\n @if (drop() !== 'none') {\n <td>\n {{ entry.formattedDrop }}\n </td>\n }\n </tr>\n }\n </tbody>\n </table>\n }\n\n @if (showDataTable()) {\n <ds-chart-data-table\n [columns]=\"['Label', 'Value']\"\n [rows]=\"tableRows()\"\n [caption]=\"caption()\"\n [open]=\"dataTableResolved() === 'visible'\" />\n }\n }\n</figure>\n", styles: ["@charset \"UTF-8\";:where(:focus-visible){outline:var(--focus-ring-width) solid var(--focus-ring-color);outline-offset:var(--focus-ring-offset);animation:ds-focus-ring-in var(--duration-fast) var(--ease-standard)}@keyframes ds-focus-ring-in{0%{outline-color:transparent}}:root[data-focus=ring]{--ds-field-focus-shadow: var(--focus-ring);--ds-field-focus-shadow-error: var(--focus-ring-error)}:root[data-focus=edge]{--focus-ring-offset: 0px;--ds-field-focus-shadow: 0 0 0 var(--border-width-default) var(--primary);--ds-field-focus-shadow-error: 0 0 0 var(--border-width-default) var(--error)}[data-focus=inset]{--focus-ring-offset: calc(-1 * var(--focus-ring-width));--ds-field-focus-shadow: var(--focus-ring-inset);--ds-field-focus-shadow-error: var(--focus-ring-inset-error)}@media(forced-colors:active){:where(:focus-visible){outline:var(--focus-ring-width) solid CanvasText;outline-offset:var(--focus-ring-offset)}}@keyframes ds-chart-mark-grow-y{0%{opacity:0;transform:scaleY(0)}}@keyframes ds-chart-mark-grow-x{0%{opacity:0;transform:scaleX(0)}}@keyframes ds-chart-mark-fade-in{0%{opacity:0}}@keyframes ds-chart-mark-exit{to{opacity:0}}.stage{animation:ds-chart-mark-fade-in var(--ds-motion-chart-mark-enter-duration) var(--ds-motion-chart-mark-enter-easing) calc(var(--ds-motion-chart-mark-exit-duration) + var(--_chart-mark-stagger, 0ms)) backwards}.stage.mark-leave{animation:ds-chart-mark-exit var(--ds-motion-chart-mark-exit-duration) var(--ds-motion-chart-mark-exit-easing) both}.swatch{animation:ds-chart-mark-fade-in var(--ds-motion-chart-mark-enter-duration) var(--ds-motion-chart-mark-enter-easing) calc(var(--ds-motion-chart-mark-exit-duration) + var(--_chart-mark-stagger, 0ms)) backwards}.swatch.mark-leave{animation:ds-chart-mark-exit var(--ds-motion-chart-mark-exit-duration) var(--ds-motion-chart-mark-exit-easing) both}:host{display:block;-webkit-user-select:none;user-select:none}:host(.framed){padding:var(--ds-chart-frame-padding);background:var(--ds-chart-frame-bg-color);border:var(--ds-chart-frame-border-width) solid var(--ds-chart-frame-border-color);border-radius:var(--ds-chart-frame-radius)}.data-table,.stage-table{-webkit-user-select:text;user-select:text}figcaption{margin-block-end:var(--space-3);color:var(--text-primary);font-weight:var(--font-weight-semibold);-webkit-user-select:text;user-select:text}.empty.is-error,.empty-text.is-error{color:var(--error)}@media not (forced-colors:active){.stage:focus{outline:none}}.data-table{--_chart-data-table-marker: var(--space-1);margin-block-start:var(--space-4);color:var(--text-secondary);font-size:var(--font-size-s)}.data-table>summary{display:inline-flex;align-items:center;gap:var(--space-1);padding-block:var(--space-1);color:var(--text-tertiary);font-size:var(--font-size-xs);cursor:pointer;list-style:none}.data-table>summary::-webkit-details-marker{display:none}.data-table>summary:before{content:\"\";inline-size:0;block-size:0;border-block-start:var(--_chart-data-table-marker) solid transparent;border-block-end:var(--_chart-data-table-marker) solid transparent;border-inline-start:calc(var(--_chart-data-table-marker) * 1.25) solid currentcolor;transition:transform var(--duration-fast) var(--ease-standard)}@media(prefers-reduced-motion:reduce){.data-table>summary:before{transition:none}}.data-table[open]>summary:before{transform:rotate(90deg)}.data-table>summary{border-radius:var(--radius-sm)}.data-table caption{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}.data-table table{inline-size:100%;margin-block-start:var(--space-2);border-collapse:collapse;font-variant-numeric:tabular-nums}.data-table th,.data-table td{padding-block:var(--space-2);border-block-end:var(--border-width-default) solid var(--ds-chart-grid-line-color);text-align:end}.data-table thead th{color:var(--text-tertiary);font-size:var(--font-size-xs);font-weight:600}.data-table th:first-child,.data-table td:first-child{text-align:start}.data-table td+td{padding-inline-start:var(--space-3)}.funnel-chart{--_funnel-chart-stage-height: var(--ds-funnel-chart-stage-height, 44px);--_funnel-chart-stage-gap: var(--ds-funnel-chart-stage-gap, var(--ds-chart-bar-gap));--_funnel-chart-row-gap: var(--ds-funnel-chart-row-gap, var(--space-4));--_funnel-chart-focus-color: var(--ds-funnel-chart-focus-color, var(--focus-ring-color));--_funnel-chart-focus-width: var(--ds-funnel-chart-focus-width, var(--focus-ring-width));--ds-chart-focus-ring-color: var(--_funnel-chart-focus-color);--focus-ring-color: var(--_funnel-chart-focus-color);--focus-ring-width: var(--_funnel-chart-focus-width);position:relative;overflow-x:auto;margin:0}.visually-hidden{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}.empty{display:grid;place-items:center;min-block-size:calc(3 * (var(--_funnel-chart-stage-height) + var(--_funnel-chart-stage-gap)));margin:0;color:var(--text-secondary);text-align:center}.shape{display:block}svg{display:block;inline-size:100%}.stage{stroke:transparent}@media not (forced-colors:active){.stage.interactive:focus-visible{outline:none}}.stage.interactive:focus-visible{stroke:var(--ds-chart-focus-ring-color);stroke-width:var(--focus-ring-width);paint-order:stroke;filter:drop-shadow(0 0 var(--focus-ring-width) var(--ds-chart-focus-halo-color))}.skeleton{display:grid;row-gap:var(--_funnel-chart-stage-gap)}.stage-table{inline-size:100%;margin-block-start:var(--_funnel-chart-row-gap);border-collapse:collapse;font-variant-numeric:tabular-nums}.stage-table th,.stage-table td{padding-block:var(--space-2);border-block-end:var(--border-width-default) solid var(--ds-chart-grid-line-color);text-align:end}.stage-table thead th{color:var(--text-tertiary);font-size:var(--font-size-xs);font-weight:600}.stage-table thead th:first-child{text-align:start}.stage-table td{padding-inline-start:var(--space-3)}.stage-table th[scope=row]{color:var(--text-secondary);font-weight:400;text-align:start}.swatch{display:inline-block;inline-size:var(--space-2);block-size:var(--space-2);margin-inline-end:var(--space-2);border-radius:var(--radius-sm)}.shape .stage{transition:opacity var(--ds-motion-chart-state-duration) var(--ds-motion-chart-state-easing),fill var(--ds-motion-chart-mark-duration) var(--ds-motion-chart-mark-easing)}.shape .stage.is-dimmed{opacity:var(--ds-chart-dim-opacity)}.shape.dims-others:not(:has(.stage.is-pinned)):has(.stage.interactive:hover) .stage.interactive:not(:hover),.shape.dims-others:not(:has(.stage.is-pinned)):has(.stage.interactive:focus-visible) .stage.interactive:not(:focus-visible),.shape.dims-others:has(.stage.is-pinned) .stage:not(.is-pinned){opacity:var(--ds-chart-dim-opacity)}.shape .stage.interactive{cursor:pointer}@media(forced-colors:active){.axis-line,.grid-line{stroke:CanvasText}.axis-label,.category-label{fill:CanvasText}:focus-visible{stroke:Highlight;filter:none}}:host{position:relative}.pin-reset{position:absolute;inset-block-end:var(--space-2);inset-inline:0;z-index:1;justify-self:center;margin-inline:auto;display:inline-flex;align-items:center;gap:var(--space-1);min-block-size:var(--space-12);inline-size:fit-content;padding:var(--space-1) var(--space-3);border:var(--border-width-default) solid var(--border-divider);border-radius:var(--radius-pill);background:var(--surface-default);color:var(--text-secondary);font-size:var(--font-size-xs);line-height:1;box-shadow:var(--shadow-1);cursor:pointer}.pin-reset:hover{color:var(--text-primary);border-color:var(--border-strong)}.pin-marker{display:grid;place-items:center;inline-size:var(--ds-chart-pin-size, 22px);block-size:var(--ds-chart-pin-size, 22px);border:var(--border-width-default) solid var(--border-divider);border-radius:var(--radius-pill);background:var(--surface-default);color:var(--text-primary);box-shadow:var(--shadow-1);pointer-events:none}.shape{position:relative}.pin-marker{position:absolute;transform:translate(-50%,-50%)}\n"], dependencies: [{ kind: "component", type: SkeletonComponent, selector: "ds-skeleton", inputs: ["width", "height", "circle", "inline"] }, { kind: "directive", type: ChartTooltipDirective, selector: "[dsChartTooltip]", inputs: ["dsChartTooltip", "dsChartTooltipOrigin", "dsChartTooltipTemplate", "dsChartTooltipExtraGap", "dsChartTooltipPreferBelow", "dsChartTooltipPinned"] }, { kind: "component", type: IconComponent, selector: "ds-icon", inputs: ["name", "size", "stroke", "ariaLabel"] }, { kind: "component", type: ChartDataTableComponent, selector: "ds-chart-data-table", inputs: ["columns", "rows", "caption", "open", "rowHeader"], outputs: ["toggled"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
452
448
  }
453
449
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: FunnelChartComponent, decorators: [{
454
450
  type: Component,
455
- args: [{ selector: 'ds-funnel-chart', standalone: true, imports: [SkeletonComponent, ChartTooltipDirective, IconComponent], host: { '[class.framed]': "frameResolved() === 'auto'" }, encapsulation: ViewEncapsulation.Emulated, changeDetection: ChangeDetectionStrategy.OnPush, template: "<figure class=\"funnel-chart\">\n @if (activeMark.pinned()) {\n <button\n class=\"pin-reset\"\n type=\"button\"\n (click)=\"activeMark.release()\">\n Unpin\n </button>\n }\n\n @if (caption()) {\n <figcaption>\n {{ caption() }}\n </figcaption>\n }\n\n @if (error()) {\n <p\n class=\"empty is-error\"\n role=\"status\">\n {{ errorTextResolved() }}\n </p>\n } @else if (loading()) {\n <div\n class=\"skeleton\"\n aria-hidden=\"true\">\n @for (placeholderWidth of skeletonStages(); track $index) {\n <ds-skeleton\n height=\"calc(var(--_funnel-chart-stage-height) - var(--_funnel-chart-stage-gap))\"\n [width]=\"placeholderWidth\" />\n }\n </div>\n } @else if (isEmpty()) {\n <p class=\"empty\">\n {{ emptyTextResolved() }}\n </p>\n } @else {\n <div\n class=\"shape\"\n [class.dims-others]=\"dimOthers()\"\n [attr.role]=\"interactive() ? 'group' : 'img'\"\n [attr.aria-label]=\"accessibleName()\"\n [dsChartTooltip]=\"tooltipContext()\"\n [dsChartTooltipPreferBelow]=\"activeMark.pinned()\"\n [dsChartTooltipOrigin]=\"activeMark.origin()\"\n [dsChartTooltipTemplate]=\"tooltipTemplate() ?? null\">\n <svg\n preserveAspectRatio=\"none\"\n [attr.aria-hidden]=\"interactive() ? null : true\"\n [attr.viewBox]=\"viewBox\"\n [style.block-size]=\"chartHeight()\">\n @for (entry of stages(); track entry.stage.id; let index = $index) {\n <polygon\n class=\"stage\"\n animate.enter=\"mark-enter\"\n animate.leave=\"mark-leave\"\n [attr.stroke-width]=\"hitGapUnits()\"\n [style.--_chart-mark-stagger]=\"markStagger(index)\"\n [class.interactive]=\"interactive()\"\n [class.is-pinned]=\"\n activeMark.pinned() && activeMark.index() === index\n \"\n [class.is-dimmed]=\"isDimmed(index)\"\n [attr.points]=\"entry.points\"\n [attr.fill]=\"entry.color\"\n [attr.role]=\"interactive() ? 'button' : null\"\n [attr.tabindex]=\"\n interactive() ? (index === tabStopIndex() ? 0 : -1) : null\n \"\n [attr.data-mark-index]=\"index\"\n [attr.aria-label]=\"interactive() ? entryLabel(entry) : null\"\n (pointerenter)=\"activeMark.enter(index, $event)\"\n (pointerleave)=\"activeMark.leave()\"\n (focus)=\"onMarkFocus(index, $event)\"\n (blur)=\"activeMark.leave()\"\n (keydown)=\"onMarkNavigation($event, index)\"\n (click)=\"onMarkClick(entry.stage, index, $event)\"\n (keydown.enter)=\"onStageKey(entry.stage, $event)\"\n (keydown.space)=\"onStageKey(entry.stage, $event)\">\n </polygon>\n }\n </svg>\n\n @if (pinnedCenter(); as center) {\n <span\n class=\"pin-marker\"\n [style.left.%]=\"center.xPercent\"\n [style.top.%]=\"center.yPercent\">\n <ds-icon\n name=\"pin\"\n [size]=\"13\" />\n </span>\n }\n </div>\n\n @if (showTable()) {\n <table class=\"stage-table\">\n <caption class=\"visually-hidden\">\n Each stage as a percentage of the first, and the drop from the stage\n above it.\n </caption>\n\n <thead>\n <tr>\n <th scope=\"col\">\n Stage\n </th>\n\n <th scope=\"col\">\n Value\n </th>\n\n <th scope=\"col\">\n Percent\n </th>\n\n @if (drop() !== 'none') {\n <th scope=\"col\">\n Drop\n </th>\n }\n </tr>\n </thead>\n\n <tbody>\n @for (entry of stages(); track entry.stage.id; let index = $index) {\n <tr\n (pointerenter)=\"onRowEnter(index, $event)\"\n (pointerleave)=\"activeMark.leave()\">\n <th scope=\"row\">\n <span\n class=\"swatch\"\n animate.enter=\"mark-enter\"\n aria-hidden=\"true\"\n [style.background]=\"entry.color\">\n </span>\n\n {{ entry.stage.label }}\n </th>\n\n <td>\n {{ entry.formattedValue }}\n </td>\n\n <td>\n {{ entry.formattedPercent }}\n </td>\n\n @if (drop() !== 'none') {\n <td>\n {{ entry.formattedDrop }}\n </td>\n }\n </tr>\n }\n </tbody>\n </table>\n }\n\n @if (showDataTable()) {\n <details\n class=\"data-table\"\n [open]=\"dataTableResolved() === 'visible'\">\n <summary>\n Data table\n </summary>\n\n <table>\n <caption>\n {{\n caption() ?? 'Chart data'\n }}\n </caption>\n\n <thead>\n <tr>\n <th scope=\"col\">\n Label\n </th>\n\n <th scope=\"col\">\n Value\n </th>\n </tr>\n </thead>\n\n <tbody>\n @for (entry of stages(); track entry.stage.id) {\n <tr>\n <td>\n {{ entry.stage.label }}\n </td>\n\n <td>\n {{ entry.formattedValue }}\n </td>\n </tr>\n }\n </tbody>\n </table>\n </details>\n }\n }\n</figure>\n", styles: ["@charset \"UTF-8\";:where(:focus-visible){outline:var(--focus-ring-width) solid var(--focus-ring-color);outline-offset:var(--focus-ring-offset);animation:ds-focus-ring-in var(--duration-fast) var(--ease-standard)}@keyframes ds-focus-ring-in{0%{outline-color:transparent}}:root[data-focus=ring]{--ds-field-focus-shadow: var(--focus-ring);--ds-field-focus-shadow-error: var(--focus-ring-error)}:root[data-focus=edge]{--focus-ring-offset: 0px;--ds-field-focus-shadow: 0 0 0 var(--border-width-default) var(--primary);--ds-field-focus-shadow-error: 0 0 0 var(--border-width-default) var(--error)}[data-focus=inset]{--focus-ring-offset: calc(-1 * var(--focus-ring-width));--ds-field-focus-shadow: var(--focus-ring-inset);--ds-field-focus-shadow-error: var(--focus-ring-inset-error)}@media(forced-colors:active){:where(:focus-visible){outline:var(--focus-ring-width) solid CanvasText;outline-offset:var(--focus-ring-offset)}}@keyframes ds-chart-mark-grow-y{0%{opacity:0;transform:scaleY(0)}}@keyframes ds-chart-mark-grow-x{0%{opacity:0;transform:scaleX(0)}}@keyframes ds-chart-mark-fade-in{0%{opacity:0}}@keyframes ds-chart-mark-exit{to{opacity:0}}.stage.mark-enter{animation:ds-chart-mark-fade-in var(--ds-motion-chart-mark-enter-duration) var(--ds-motion-chart-mark-enter-easing) calc(var(--ds-motion-chart-mark-exit-duration) + var(--_chart-mark-stagger, 0ms)) both}.stage.mark-leave{animation:ds-chart-mark-exit var(--ds-motion-chart-mark-exit-duration) var(--ds-motion-chart-mark-exit-easing) both}.swatch.mark-enter{animation:ds-chart-mark-fade-in var(--ds-motion-chart-mark-enter-duration) var(--ds-motion-chart-mark-enter-easing) calc(var(--ds-motion-chart-mark-exit-duration) + var(--_chart-mark-stagger, 0ms)) both}.swatch.mark-leave{animation:ds-chart-mark-exit var(--ds-motion-chart-mark-exit-duration) var(--ds-motion-chart-mark-exit-easing) both}:host{display:block;-webkit-user-select:none;user-select:none}:host(.framed){padding:var(--ds-chart-frame-padding);background:var(--ds-chart-frame-bg-color);border:var(--ds-chart-frame-border-width) solid var(--ds-chart-frame-border-color);border-radius:var(--ds-chart-frame-radius)}.data-table,.stage-table,figcaption{-webkit-user-select:text;user-select:text}@media not (forced-colors:active){.stage:focus{outline:none}}.data-table{--_chart-data-table-marker: var(--space-1);margin-block-start:var(--space-4);color:var(--text-secondary);font-size:var(--font-size-s)}.data-table>summary{display:inline-flex;align-items:center;gap:var(--space-1);padding-block:var(--space-1);color:var(--text-tertiary);font-size:var(--font-size-xs);cursor:pointer;list-style:none}.data-table>summary::-webkit-details-marker{display:none}.data-table>summary:before{content:\"\";inline-size:0;block-size:0;border-block-start:var(--_chart-data-table-marker) solid transparent;border-block-end:var(--_chart-data-table-marker) solid transparent;border-inline-start:calc(var(--_chart-data-table-marker) * 1.25) solid currentcolor;transition:transform var(--duration-fast) var(--ease-standard)}@media(prefers-reduced-motion:reduce){.data-table>summary:before{transition:none}}.data-table[open]>summary:before{transform:rotate(90deg)}.data-table>summary{border-radius:var(--radius-sm)}.data-table caption{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}.data-table table{inline-size:100%;margin-block-start:var(--space-2);border-collapse:collapse;font-variant-numeric:tabular-nums}.data-table th,.data-table td{padding-block:var(--space-2);border-block-end:var(--border-width-default) solid var(--ds-chart-grid-line-color);text-align:end}.data-table thead th{color:var(--text-tertiary);font-size:var(--font-size-xs);font-weight:600}.data-table th:first-child,.data-table td:first-child{text-align:start}.data-table td+td{padding-inline-start:var(--space-3)}.funnel-chart{--_funnel-chart-stage-height: var(--ds-funnel-chart-stage-height, 44px);--_funnel-chart-stage-gap: var(--ds-funnel-chart-stage-gap, var(--ds-chart-bar-gap));--_funnel-chart-row-gap: var(--ds-funnel-chart-row-gap, var(--space-4));--_funnel-chart-focus-color: var(--ds-funnel-chart-focus-color, var(--focus-ring-color));--_funnel-chart-focus-width: var(--ds-funnel-chart-focus-width, var(--focus-ring-width));position:relative;overflow-x:auto;margin:0}.visually-hidden{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}figcaption{margin-block-end:var(--space-3);color:var(--text-primary);font-weight:600}.empty{display:grid;place-items:center;min-block-size:calc(3 * (var(--_funnel-chart-stage-height) + var(--_funnel-chart-stage-gap)));margin:0;color:var(--text-secondary);text-align:center}.shape{display:block}svg{display:block;inline-size:100%}.stage{stroke:transparent}@media not (forced-colors:active){.stage.interactive:focus-visible{outline:none}}.stage.interactive:focus-visible{stroke:var(--ds-chart-focus-ring-color);stroke-width:var(--focus-ring-width);paint-order:stroke;filter:drop-shadow(0 0 var(--focus-ring-width) var(--ds-chart-focus-halo-color))}.skeleton{display:grid;row-gap:var(--_funnel-chart-stage-gap)}.stage-table{inline-size:100%;margin-block-start:var(--_funnel-chart-row-gap);border-collapse:collapse;font-variant-numeric:tabular-nums}.stage-table th,.stage-table td{padding-block:var(--space-2);border-block-end:var(--border-width-default) solid var(--ds-chart-grid-line-color);text-align:end}.stage-table thead th{color:var(--text-tertiary);font-size:var(--font-size-xs);font-weight:600}.stage-table thead th:first-child{text-align:start}.stage-table td{padding-inline-start:var(--space-3)}.stage-table th[scope=row]{color:var(--text-secondary);font-weight:400;text-align:start}.swatch{display:inline-block;inline-size:var(--space-2);block-size:var(--space-2);margin-inline-end:var(--space-2);border-radius:var(--radius-sm)}.empty.is-error{color:var(--error)}.shape .stage{transition:opacity var(--ds-motion-chart-state-duration) var(--ds-motion-chart-state-easing),fill var(--ds-motion-chart-mark-duration) var(--ds-motion-chart-mark-easing)}.shape .stage.is-dimmed{opacity:var(--ds-chart-dim-opacity)}.shape.dims-others:not(:has(.stage.is-pinned)):has(.stage.interactive:hover) .stage.interactive:not(:hover),.shape.dims-others:not(:has(.stage.is-pinned)):has(.stage.interactive:focus-visible) .stage.interactive:not(:focus-visible),.shape.dims-others:has(.stage.is-pinned) .stage:not(.is-pinned){opacity:var(--ds-chart-dim-opacity)}.shape .stage.interactive{cursor:pointer}@media(forced-colors:active){.axis-line,.grid-line{stroke:CanvasText}.axis-label,.category-label{fill:CanvasText}:focus-visible{stroke:Highlight;filter:none}}:host{position:relative}.pin-reset{position:absolute;inset-block-start:var(--space-2);inset-inline:0;z-index:1;justify-self:center;margin-inline:auto;display:inline-flex;align-items:center;gap:var(--space-1);min-block-size:var(--space-12);inline-size:fit-content;padding:var(--space-1) var(--space-3);border:var(--border-width-default) solid var(--border-divider);border-radius:var(--radius-pill);background:var(--surface-default);color:var(--text-secondary);font-size:var(--font-size-xs);line-height:1;box-shadow:var(--shadow-1);cursor:pointer}.pin-reset:hover{color:var(--text-primary);border-color:var(--border-strong)}.pin-marker{display:grid;place-items:center;inline-size:var(--ds-chart-pin-size, 22px);block-size:var(--ds-chart-pin-size, 22px);border:var(--border-width-default) solid var(--border-divider);border-radius:var(--radius-pill);background:var(--surface-default);color:var(--text-primary);box-shadow:var(--shadow-1);pointer-events:none}.shape{position:relative}.pin-marker{position:absolute;transform:translate(-50%,-50%)}\n"] }]
451
+ args: [{ selector: 'ds-funnel-chart', standalone: true, imports: [
452
+ SkeletonComponent,
453
+ ChartTooltipDirective,
454
+ IconComponent,
455
+ ChartDataTableComponent,
456
+ ], host: { '[class.framed]': "frameResolved() === 'auto'" }, encapsulation: ViewEncapsulation.Emulated, changeDetection: ChangeDetectionStrategy.OnPush, template: "<figure class=\"funnel-chart\">\n @if (activeMark.pinned()) {\n <button\n class=\"pin-reset\"\n type=\"button\"\n (click)=\"activeMark.release()\">\n Unpin\n </button>\n }\n\n @if (caption()) {\n <figcaption>\n {{ caption() }}\n </figcaption>\n }\n\n @if (error()) {\n <p\n class=\"empty is-error\"\n role=\"status\">\n {{ errorTextResolved() }}\n </p>\n } @else if (loading()) {\n <div\n class=\"skeleton\"\n aria-hidden=\"true\">\n @for (placeholderWidth of skeletonStages(); track $index) {\n <ds-skeleton\n height=\"calc(var(--_funnel-chart-stage-height) - var(--_funnel-chart-stage-gap))\"\n [width]=\"placeholderWidth\" />\n }\n </div>\n } @else if (isEmpty()) {\n <p class=\"empty\">\n {{ emptyTextResolved() }}\n </p>\n } @else {\n <div\n class=\"shape\"\n [class.dims-others]=\"dimOthers()\"\n [attr.role]=\"interactive() ? 'group' : 'img'\"\n [attr.aria-label]=\"accessibleName()\"\n [dsChartTooltip]=\"tooltipContext()\"\n [dsChartTooltipPreferBelow]=\"activeMark.pinned()\"\n [dsChartTooltipPinned]=\"activeMark.pinned()\"\n [dsChartTooltipOrigin]=\"activeMark.origin()\"\n [dsChartTooltipTemplate]=\"tooltipTemplate() ?? null\">\n <svg\n preserveAspectRatio=\"none\"\n [attr.aria-hidden]=\"interactive() ? null : true\"\n [attr.viewBox]=\"viewBox\"\n [style.block-size]=\"chartHeight()\">\n @for (entry of stages(); track entry.stage.id; let index = $index) {\n <polygon\n class=\"stage\"\n [attr.stroke-width]=\"hitGapUnits()\"\n [style.--_chart-mark-stagger]=\"markStagger(index)\"\n [class.interactive]=\"interactive()\"\n [class.is-pinned]=\"\n activeMark.pinned() && activeMark.index() === index\n \"\n [class.is-dimmed]=\"isDimmed(index)\"\n [attr.points]=\"entry.points\"\n [attr.fill]=\"entry.color\"\n [attr.role]=\"interactive() ? 'button' : null\"\n [attr.tabindex]=\"\n interactive() ? (index === roving.tabStop() ? 0 : -1) : null\n \"\n [attr.data-mark-index]=\"index\"\n [attr.aria-label]=\"interactive() ? entryLabel(entry) : null\"\n (animate.leave)=\"leaveMark($event)\"\n (pointerenter)=\"activeMark.enter(index, $event)\"\n (pointerleave)=\"activeMark.leave()\"\n (focus)=\"onMarkFocus(index, $event)\"\n (blur)=\"activeMark.leave()\"\n (keydown)=\"onMarkNavigation($event, index)\"\n (click)=\"onMarkClick(entry.stage, index, $event)\"\n (keydown.enter)=\"onStageKey(entry.stage, $event)\"\n (keydown.space)=\"onStageKey(entry.stage, $event)\">\n </polygon>\n }\n </svg>\n\n @if (pinnedCenter(); as center) {\n <span\n class=\"pin-marker\"\n [style.left.%]=\"center.xPercent\"\n [style.top.%]=\"center.yPercent\">\n <ds-icon\n name=\"pin\"\n [size]=\"13\" />\n </span>\n }\n </div>\n\n @if (showTable()) {\n <table class=\"stage-table\">\n <caption class=\"visually-hidden\">\n Each stage as a percentage of the first, and the drop from the stage\n above it.\n </caption>\n\n <thead>\n <tr>\n <th scope=\"col\">\n Stage\n </th>\n\n <th scope=\"col\">\n Value\n </th>\n\n <th scope=\"col\">\n Percent\n </th>\n\n @if (drop() !== 'none') {\n <th scope=\"col\">\n Drop\n </th>\n }\n </tr>\n </thead>\n\n <tbody>\n @for (entry of stages(); track entry.stage.id; let index = $index) {\n <tr\n (pointerenter)=\"onRowEnter(index, $event)\"\n (pointerleave)=\"activeMark.leave()\">\n <th scope=\"row\">\n <span\n class=\"swatch\"\n aria-hidden=\"true\"\n [style.background]=\"entry.color\">\n </span>\n\n {{ entry.stage.label }}\n </th>\n\n <td>\n {{ entry.formattedValue }}\n </td>\n\n <td>\n {{ entry.formattedPercent }}\n </td>\n\n @if (drop() !== 'none') {\n <td>\n {{ entry.formattedDrop }}\n </td>\n }\n </tr>\n }\n </tbody>\n </table>\n }\n\n @if (showDataTable()) {\n <ds-chart-data-table\n [columns]=\"['Label', 'Value']\"\n [rows]=\"tableRows()\"\n [caption]=\"caption()\"\n [open]=\"dataTableResolved() === 'visible'\" />\n }\n }\n</figure>\n", styles: ["@charset \"UTF-8\";:where(:focus-visible){outline:var(--focus-ring-width) solid var(--focus-ring-color);outline-offset:var(--focus-ring-offset);animation:ds-focus-ring-in var(--duration-fast) var(--ease-standard)}@keyframes ds-focus-ring-in{0%{outline-color:transparent}}:root[data-focus=ring]{--ds-field-focus-shadow: var(--focus-ring);--ds-field-focus-shadow-error: var(--focus-ring-error)}:root[data-focus=edge]{--focus-ring-offset: 0px;--ds-field-focus-shadow: 0 0 0 var(--border-width-default) var(--primary);--ds-field-focus-shadow-error: 0 0 0 var(--border-width-default) var(--error)}[data-focus=inset]{--focus-ring-offset: calc(-1 * var(--focus-ring-width));--ds-field-focus-shadow: var(--focus-ring-inset);--ds-field-focus-shadow-error: var(--focus-ring-inset-error)}@media(forced-colors:active){:where(:focus-visible){outline:var(--focus-ring-width) solid CanvasText;outline-offset:var(--focus-ring-offset)}}@keyframes ds-chart-mark-grow-y{0%{opacity:0;transform:scaleY(0)}}@keyframes ds-chart-mark-grow-x{0%{opacity:0;transform:scaleX(0)}}@keyframes ds-chart-mark-fade-in{0%{opacity:0}}@keyframes ds-chart-mark-exit{to{opacity:0}}.stage{animation:ds-chart-mark-fade-in var(--ds-motion-chart-mark-enter-duration) var(--ds-motion-chart-mark-enter-easing) calc(var(--ds-motion-chart-mark-exit-duration) + var(--_chart-mark-stagger, 0ms)) backwards}.stage.mark-leave{animation:ds-chart-mark-exit var(--ds-motion-chart-mark-exit-duration) var(--ds-motion-chart-mark-exit-easing) both}.swatch{animation:ds-chart-mark-fade-in var(--ds-motion-chart-mark-enter-duration) var(--ds-motion-chart-mark-enter-easing) calc(var(--ds-motion-chart-mark-exit-duration) + var(--_chart-mark-stagger, 0ms)) backwards}.swatch.mark-leave{animation:ds-chart-mark-exit var(--ds-motion-chart-mark-exit-duration) var(--ds-motion-chart-mark-exit-easing) both}:host{display:block;-webkit-user-select:none;user-select:none}:host(.framed){padding:var(--ds-chart-frame-padding);background:var(--ds-chart-frame-bg-color);border:var(--ds-chart-frame-border-width) solid var(--ds-chart-frame-border-color);border-radius:var(--ds-chart-frame-radius)}.data-table,.stage-table{-webkit-user-select:text;user-select:text}figcaption{margin-block-end:var(--space-3);color:var(--text-primary);font-weight:var(--font-weight-semibold);-webkit-user-select:text;user-select:text}.empty.is-error,.empty-text.is-error{color:var(--error)}@media not (forced-colors:active){.stage:focus{outline:none}}.data-table{--_chart-data-table-marker: var(--space-1);margin-block-start:var(--space-4);color:var(--text-secondary);font-size:var(--font-size-s)}.data-table>summary{display:inline-flex;align-items:center;gap:var(--space-1);padding-block:var(--space-1);color:var(--text-tertiary);font-size:var(--font-size-xs);cursor:pointer;list-style:none}.data-table>summary::-webkit-details-marker{display:none}.data-table>summary:before{content:\"\";inline-size:0;block-size:0;border-block-start:var(--_chart-data-table-marker) solid transparent;border-block-end:var(--_chart-data-table-marker) solid transparent;border-inline-start:calc(var(--_chart-data-table-marker) * 1.25) solid currentcolor;transition:transform var(--duration-fast) var(--ease-standard)}@media(prefers-reduced-motion:reduce){.data-table>summary:before{transition:none}}.data-table[open]>summary:before{transform:rotate(90deg)}.data-table>summary{border-radius:var(--radius-sm)}.data-table caption{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}.data-table table{inline-size:100%;margin-block-start:var(--space-2);border-collapse:collapse;font-variant-numeric:tabular-nums}.data-table th,.data-table td{padding-block:var(--space-2);border-block-end:var(--border-width-default) solid var(--ds-chart-grid-line-color);text-align:end}.data-table thead th{color:var(--text-tertiary);font-size:var(--font-size-xs);font-weight:600}.data-table th:first-child,.data-table td:first-child{text-align:start}.data-table td+td{padding-inline-start:var(--space-3)}.funnel-chart{--_funnel-chart-stage-height: var(--ds-funnel-chart-stage-height, 44px);--_funnel-chart-stage-gap: var(--ds-funnel-chart-stage-gap, var(--ds-chart-bar-gap));--_funnel-chart-row-gap: var(--ds-funnel-chart-row-gap, var(--space-4));--_funnel-chart-focus-color: var(--ds-funnel-chart-focus-color, var(--focus-ring-color));--_funnel-chart-focus-width: var(--ds-funnel-chart-focus-width, var(--focus-ring-width));--ds-chart-focus-ring-color: var(--_funnel-chart-focus-color);--focus-ring-color: var(--_funnel-chart-focus-color);--focus-ring-width: var(--_funnel-chart-focus-width);position:relative;overflow-x:auto;margin:0}.visually-hidden{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}.empty{display:grid;place-items:center;min-block-size:calc(3 * (var(--_funnel-chart-stage-height) + var(--_funnel-chart-stage-gap)));margin:0;color:var(--text-secondary);text-align:center}.shape{display:block}svg{display:block;inline-size:100%}.stage{stroke:transparent}@media not (forced-colors:active){.stage.interactive:focus-visible{outline:none}}.stage.interactive:focus-visible{stroke:var(--ds-chart-focus-ring-color);stroke-width:var(--focus-ring-width);paint-order:stroke;filter:drop-shadow(0 0 var(--focus-ring-width) var(--ds-chart-focus-halo-color))}.skeleton{display:grid;row-gap:var(--_funnel-chart-stage-gap)}.stage-table{inline-size:100%;margin-block-start:var(--_funnel-chart-row-gap);border-collapse:collapse;font-variant-numeric:tabular-nums}.stage-table th,.stage-table td{padding-block:var(--space-2);border-block-end:var(--border-width-default) solid var(--ds-chart-grid-line-color);text-align:end}.stage-table thead th{color:var(--text-tertiary);font-size:var(--font-size-xs);font-weight:600}.stage-table thead th:first-child{text-align:start}.stage-table td{padding-inline-start:var(--space-3)}.stage-table th[scope=row]{color:var(--text-secondary);font-weight:400;text-align:start}.swatch{display:inline-block;inline-size:var(--space-2);block-size:var(--space-2);margin-inline-end:var(--space-2);border-radius:var(--radius-sm)}.shape .stage{transition:opacity var(--ds-motion-chart-state-duration) var(--ds-motion-chart-state-easing),fill var(--ds-motion-chart-mark-duration) var(--ds-motion-chart-mark-easing)}.shape .stage.is-dimmed{opacity:var(--ds-chart-dim-opacity)}.shape.dims-others:not(:has(.stage.is-pinned)):has(.stage.interactive:hover) .stage.interactive:not(:hover),.shape.dims-others:not(:has(.stage.is-pinned)):has(.stage.interactive:focus-visible) .stage.interactive:not(:focus-visible),.shape.dims-others:has(.stage.is-pinned) .stage:not(.is-pinned){opacity:var(--ds-chart-dim-opacity)}.shape .stage.interactive{cursor:pointer}@media(forced-colors:active){.axis-line,.grid-line{stroke:CanvasText}.axis-label,.category-label{fill:CanvasText}:focus-visible{stroke:Highlight;filter:none}}:host{position:relative}.pin-reset{position:absolute;inset-block-end:var(--space-2);inset-inline:0;z-index:1;justify-self:center;margin-inline:auto;display:inline-flex;align-items:center;gap:var(--space-1);min-block-size:var(--space-12);inline-size:fit-content;padding:var(--space-1) var(--space-3);border:var(--border-width-default) solid var(--border-divider);border-radius:var(--radius-pill);background:var(--surface-default);color:var(--text-secondary);font-size:var(--font-size-xs);line-height:1;box-shadow:var(--shadow-1);cursor:pointer}.pin-reset:hover{color:var(--text-primary);border-color:var(--border-strong)}.pin-marker{display:grid;place-items:center;inline-size:var(--ds-chart-pin-size, 22px);block-size:var(--ds-chart-pin-size, 22px);border:var(--border-width-default) solid var(--border-divider);border-radius:var(--radius-pill);background:var(--surface-default);color:var(--text-primary);box-shadow:var(--shadow-1);pointer-events:none}.shape{position:relative}.pin-marker{position:absolute;transform:translate(-50%,-50%)}\n"] }]
456
457
  }], propDecorators: { data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: true }] }], shape: [{ type: i0.Input, args: [{ isSignal: true, alias: "shape", required: false }] }], showTable: [{ type: i0.Input, args: [{ isSignal: true, alias: "showTable", required: false }] }], frame: [{ type: i0.Input, args: [{ isSignal: true, alias: "frame", required: false }] }], tooltipLingerMs: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltipLingerMs", required: false }] }], caption: [{ type: i0.Input, args: [{ isSignal: true, alias: "caption", required: false }] }], summary: [{ type: i0.Input, args: [{ isSignal: true, alias: "summary", required: false }] }], dataTable: [{ type: i0.Input, args: [{ isSignal: true, alias: "dataTable", required: false }] }], drop: [{ type: i0.Input, args: [{ isSignal: true, alias: "drop", required: false }] }], loading: [{ type: i0.Input, args: [{ isSignal: true, alias: "loading", required: false }] }], emptyText: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyText", required: false }] }], error: [{ type: i0.Input, args: [{ isSignal: true, alias: "error", required: false }] }], errorText: [{ type: i0.Input, args: [{ isSignal: true, alias: "errorText", required: false }] }], valueFormat: [{ type: i0.Input, args: [{ isSignal: true, alias: "valueFormat", required: false }] }], interactive: [{ type: i0.Input, args: [{ isSignal: true, alias: "interactive", required: false }] }], stageClicked: [{ type: i0.Output, args: ["stageClicked"] }], pinOnClick: [{ type: i0.Input, args: [{ isSignal: true, alias: "pinOnClick", required: false }] }], dimOthers: [{ type: i0.Input, args: [{ isSignal: true, alias: "dimOthers", required: false }] }], staggerMs: [{ type: i0.Input, args: [{ isSignal: true, alias: "staggerMs", required: false }] }], tooltip: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltip", required: false }] }], tooltipTemplate: [{ type: i0.ContentChild, args: ['dsChartTooltip', { isSignal: true }] }] } });
457
458
 
458
459
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"ids-group-ltd-ids-design-system-components-funnel-chart.mjs","sources":["../../../src/lib/components/funnel-chart/funnel-chart.math.ts","../../../src/lib/components/funnel-chart/funnel-chart.component.ts","../../../src/lib/components/funnel-chart/funnel-chart.component.html","../../../src/lib/components/funnel-chart/ids-group-ltd-ids-design-system-components-funnel-chart.ts"],"sourcesContent":["import type { FunnelChartShape } from './funnel-chart.types';\n\n/** Bottom width of the fixed silhouette, as a fraction of the full width. The\n * tail carries a label, so it never narrows past this. */\nexport const FUNNEL_TAIL_WIDTH = 0.38;\n\n/** Ramp step for one stage, spread across the whole ramp rather than taking its\n * first `rampedCount` entries — a three-stage funnel that used steps 1-3 would\n * never reach the deep end the ramp exists to provide. */\nexport function rampPosition(\n index: number,\n rampedCount: number,\n rampLength: number,\n): number {\n if (rampLength <= 0 || rampedCount <= 1) {\n return 0;\n }\n const position = Math.round((index / (rampedCount - 1)) * (rampLength - 1));\n\n return Math.min(Math.max(position, 0), rampLength - 1);\n}\n\n/** The viewBox is normalised: depth runs 0..100 whatever the stage count, and\n * the rendered block size carries the real height. */\nexport const FUNNEL_VIEW_BOX_WIDTH = 100;\n\nexport const FUNNEL_VIEW_BOX_HEIGHT = 100;\n\n/** One inter-stage gap, as a share of a single stage's own depth. A share and\n * not a count of units, because the viewBox depth is normalised: a fixed\n * number of units would grow on screen with every stage added. */\nconst FUNNEL_STAGE_GAP_SHARE = 0.14;\n\nexport interface FunnelStageGeometry {\n /** Fraction of the full width at the stage's top edge, 0..1. */\n readonly topWidth: number;\n readonly bottomWidth: number;\n /** Fraction of the total depth at the stage's top edge, 0..1. */\n readonly top: number;\n readonly bottom: number;\n}\n\n/** Every value as a finite, non-negative number. A negative would mirror a\n * stage about its own centre line, and a non-finite one reaches an SVG\n * attribute as `NaN`, where the renderer drops the whole shape without an\n * error. */\nexport function sanitizeValues(values: readonly number[]): number[] {\n return values.map((value) =>\n Number.isFinite(value) ? Math.max(value, 0) : 0,\n );\n}\n\nfunction clampFraction(value: number): number {\n if (!Number.isFinite(value)) {\n return 0;\n }\n\n return Math.min(Math.max(value, 0), 1);\n}\n\nfunction widthAtDepth(depth: number, tailWidth: number): number {\n return 1 - (1 - tailWidth) * clampFraction(depth);\n}\n\nfunction largestValue(values: readonly number[]): number {\n return values.reduce(\n (largest, value) => (value > largest ? value : largest),\n 0,\n );\n}\n\n/** The depth at which `areaShare` of the silhouette's area lies above. The area\n * down to depth `t` is `t - (1 - tail) * t² / 2` against a whole of\n * `(1 + tail) / 2`, so the depth is a root of that quadratic rather than a\n * ratio — this is the step that makes area, not width, carry the value. The\n * discriminant bottoms out at `tail²`, so the root is always real. */\nexport function depthForAreaShare(\n areaShare: number,\n tailWidth: number,\n): number {\n const share = clampFraction(areaShare);\n const tail = clampFraction(tailWidth);\n const narrowing = 1 - tail;\n // A silhouette that does not narrow is a rectangle, where area is linear in\n // depth and the quadratic degenerates to 0/0.\n if (narrowing <= 0) {\n return share;\n }\n const discriminant = Math.max(1 - narrowing * share * (1 + tail), 0);\n\n return clampFraction((1 - Math.sqrt(discriminant)) / narrowing);\n}\n\nfunction evenDepths(count: number): number[] {\n return Array.from({ length: count + 1 }, (_, index) => index / count);\n}\n\nfunction boundaryDepths(\n values: readonly number[],\n shape: FunnelChartShape,\n tailWidth: number,\n): number[] {\n const count = values.length;\n if (shape !== 'area') {\n return evenDepths(count);\n }\n const total = values.reduce((sum, value) => sum + value, 0);\n if (!Number.isFinite(total) || total <= 0) {\n return evenDepths(count);\n }\n const depths: number[] = [];\n let consumed = 0;\n for (let index = 0; index <= count; index += 1) {\n depths.push(depthForAreaShare(consumed / total, tailWidth));\n if (index < count) {\n consumed += values[index];\n }\n }\n\n return depths;\n}\n\nfunction boundaryWidths(\n values: readonly number[],\n shape: FunnelChartShape,\n depths: readonly number[],\n tailWidth: number,\n): number[] {\n if (shape !== 'width') {\n return depths.map((depth) => widthAtDepth(depth, tailWidth));\n }\n const count = values.length;\n const largest = largestValue(values);\n if (!Number.isFinite(largest) || largest <= 0) {\n return depths.map(() => 0);\n }\n\n // The last boundary repeats the last value, which flattens the closing edge:\n // there is no following stage to taper towards.\n return Array.from({ length: count + 1 }, (_, index) =>\n clampFraction(values[Math.min(index, count - 1)] / largest),\n );\n}\n\n/** One trapezoid per stage, in fractions of the full width and of the total\n * depth.\n *\n * `'taper'` and `'area'` share one fixed silhouette — full width at the top,\n * `FUNNEL_TAIL_WIDTH` at the bottom — and differ only in where the stage\n * boundaries land on it: evenly spaced for `'taper'`, so width encodes\n * nothing, and at the depths that make each band's area proportional to its\n * value for `'area'`. `'width'` abandons the silhouette and reads every\n * boundary straight off the values. */\nexport function funnelGeometry(\n values: readonly number[],\n shape: FunnelChartShape,\n tailWidth: number = FUNNEL_TAIL_WIDTH,\n): FunnelStageGeometry[] {\n const safeValues = sanitizeValues(values);\n if (safeValues.length === 0) {\n return [];\n }\n const tail = Number.isFinite(tailWidth)\n ? clampFraction(tailWidth)\n : FUNNEL_TAIL_WIDTH;\n const depths = boundaryDepths(safeValues, shape, tail);\n const widths = boundaryWidths(safeValues, shape, depths, tail);\n\n return safeValues.map((_, index) => ({\n top: depths[index],\n bottom: depths[index + 1],\n topWidth: widths[index],\n bottomWidth: widths[index + 1],\n }));\n}\n\n/** The fall from `previousValue` to `value`, as a fraction of `previousValue`.\n * Null where there is nothing to fall from — a zero or non-finite predecessor\n * makes the ratio 0/0. Negative where the stage grew, which is real data. */\nexport function stageDrop(previousValue: number, value: number): number | null {\n if (!Number.isFinite(previousValue) || !Number.isFinite(value)) {\n return null;\n }\n if (previousValue <= 0) {\n return null;\n }\n\n return (previousValue - value) / previousValue;\n}\n\n/** The drop into each stage. The first entry is null and not zero: a printed\n * `0%` there would claim nobody fell away, rather than that there was no\n * earlier stage to fall from. */\nexport function stageDrops(values: readonly number[]): (number | null)[] {\n return values.map((value, index) =>\n index === 0 ? null : stageDrop(values[index - 1], value),\n );\n}\n\n/** Depth of one inter-stage gap, in viewBox units. */\nexport function stageGapUnits(\n stageCount: number,\n viewBoxHeight: number,\n): number {\n if (\n !Number.isFinite(stageCount) ||\n !Number.isFinite(viewBoxHeight) ||\n stageCount <= 0\n ) {\n return 0;\n }\n\n return (FUNNEL_STAGE_GAP_SHARE * viewBoxHeight) / stageCount;\n}\n\nfunction roundCoordinate(value: number): number {\n return Math.round(value * 1000) / 1000;\n}\n\n/** The stage's four corners as an SVG `points` value, or an empty string when\n * any input is non-finite. An attribute holding `NaN` is discarded by the\n * renderer without an error, so the shape would go missing in silence. */\nexport function stagePolygonPoints(\n geometry: FunnelStageGeometry,\n viewBoxWidth: number,\n viewBoxHeight: number,\n gapUnits: number,\n): string {\n const inputs = [\n geometry.topWidth,\n geometry.bottomWidth,\n geometry.top,\n geometry.bottom,\n viewBoxWidth,\n viewBoxHeight,\n gapUnits,\n ];\n if (inputs.some((input) => !Number.isFinite(input))) {\n return '';\n }\n const halfGap = Math.max(gapUnits, 0) / 2;\n const bandTop = clampFraction(geometry.top) * viewBoxHeight;\n const bandBottom = clampFraction(geometry.bottom) * viewBoxHeight;\n let top = bandTop + halfGap;\n let bottom = bandBottom - halfGap;\n if (bottom < top) {\n // A band shallower than the gap it has to leave. Collapse it to a line\n // instead of letting the edges cross and draw a bow tie.\n const middle = (top + bottom) / 2;\n top = middle;\n bottom = middle;\n }\n const horizontalCentre = viewBoxWidth / 2;\n const topWidth = clampFraction(geometry.topWidth);\n const bottomWidth = clampFraction(geometry.bottomWidth);\n // The widths belong to the band's own boundaries, and the gap moves the drawn edges INSIDE them.\n // Drawing the boundary widths at the inset depths makes every band overhang the silhouette at its\n // top and fall short of it at its bottom, so the stack reads as a fir tree rather than a funnel.\n // The silhouette is linear in depth for every shape, so the inset widths interpolate exactly.\n const bandDepth = bandBottom - bandTop;\n // Capped at half: past that the band has collapsed to a line, and an uncapped fraction would\n // swap the two edges and draw the bow tie the collapse exists to prevent.\n const inset =\n bandDepth > 0 ? Math.min(Math.max(halfGap / bandDepth, 0), 0.5) : 0;\n const widthAt = (fraction: number) =>\n topWidth + (bottomWidth - topWidth) * fraction;\n const halfTopWidth = (widthAt(inset) * viewBoxWidth) / 2;\n const halfBottomWidth = (widthAt(1 - inset) * viewBoxWidth) / 2;\n\n return [\n `${roundCoordinate(horizontalCentre - halfTopWidth)},${roundCoordinate(top)}`,\n `${roundCoordinate(horizontalCentre + halfTopWidth)},${roundCoordinate(top)}`,\n `${roundCoordinate(horizontalCentre + halfBottomWidth)},${roundCoordinate(bottom)}`,\n `${roundCoordinate(horizontalCentre - halfBottomWidth)},${roundCoordinate(bottom)}`,\n ].join(' ');\n}\n\n/** The middle of a band, for placing a marker inside it. The x is the viewBox centre because every\n * funnel band is symmetrical about it, whatever its two widths.\n *\n * @internal */\nexport function stageCenter(\n geometry: FunnelStageGeometry,\n viewBoxWidth: number,\n viewBoxHeight: number,\n): { x: number; y: number } {\n const top = clampFraction(geometry.top) * viewBoxHeight;\n const bottom = clampFraction(geometry.bottom) * viewBoxHeight;\n\n return { x: viewBoxWidth / 2, y: (top + bottom) / 2 };\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n TemplateRef,\n ViewEncapsulation,\n booleanAttribute,\n computed,\n contentChild,\n input,\n numberAttribute,\n output,\n signal,\n} from '@angular/core';\nimport {\n CHART_RAMP_COLORS,\n chartColors,\n defaultChartFormat,\n describeSeries,\n formatPercent,\n focusMark,\n markAt,\n nextRovingIndex,\n staggerDelay,\n} from '@ids-group-ltd/ids-design-system/components';\nimport { SkeletonComponent } from '@ids-group-ltd/ids-design-system/components/skeleton';\nimport { IconComponent } from '@ids-group-ltd/ids-design-system/icons';\nimport { resolveWithConfig } from '@ids-group-ltd/ids-design-system/core';\nimport type {\n ChartDataTable,\n ChartFrame,\n ChartValueFormat,\n} from '@ids-group-ltd/ids-design-system/core';\nimport {\n ChartTooltipDirective,\n chartActiveMark,\n} from '@ids-group-ltd/ids-design-system/components/chart-tooltip';\nimport type {\n ChartItemTooltipTrigger,\n ChartTooltipContext,\n} from '@ids-group-ltd/ids-design-system/components/chart-tooltip';\nimport {\n FUNNEL_VIEW_BOX_HEIGHT,\n FUNNEL_VIEW_BOX_WIDTH,\n funnelGeometry,\n rampPosition,\n stageDrops,\n stageCenter,\n stageGapUnits,\n stagePolygonPoints,\n} from './funnel-chart.math';\nimport type {\n FunnelChartDrop,\n FunnelChartShape,\n FunnelChartStage,\n} from './funnel-chart.types';\n\n/** The Drop cell, in whichever unit the chart was asked for. A null fall is the first stage, which\n * has nothing above it to fall from. */\nfunction formatDrop(\n fraction: number | null,\n count: number | null,\n mode: FunnelChartDrop,\n format: (value: number) => string,\n): string {\n if (mode === 'none' || fraction === null) {\n return '—';\n }\n\n return mode === 'absolute' && count !== null\n ? `−${format(Math.abs(count))}`\n : formatPercent(fraction, 1);\n}\n\nconst SKELETON_STAGE_WIDTHS = ['88%', '62%', '80%', '54%', '72%'] as const;\n\n@Component({\n selector: 'ds-funnel-chart',\n standalone: true,\n imports: [SkeletonComponent, ChartTooltipDirective, IconComponent],\n templateUrl: './funnel-chart.component.html',\n styleUrl: './funnel-chart.component.scss',\n host: { '[class.framed]': \"frameResolved() === 'auto'\" },\n encapsulation: ViewEncapsulation.Emulated,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class FunnelChartComponent {\n /** Drawn in the order given. The order of a funnel's stages is its meaning,\n * so they are never sorted. */\n readonly data = input.required<readonly FunnelChartStage[]>();\n\n /** What the silhouette encodes. `'area'`, the default, makes each stage's AREA proportional to\n * its value, which is the honest encoding that still leaves a tail wide enough to label.\n * `'width'` reads the widths straight off the values, which collapses the tail of a steep\n * funnel below a labellable width. `'taper'` encodes NOTHING: the shape is fixed whatever the\n * data, and the numbers are read from the table beside it. */\n readonly shape = input<FunnelChartShape>('area');\n\n /** The value, percent and drop table printed under the funnel. It supersedes\n * `dataTable`: while this is on, the disclosure every chart carries would\n * repeat a strict subset of these same numbers, so it is not rendered. */\n readonly showTable = input(true, { transform: booleanAttribute });\n\n /** Whether the chart draws its own bordered, padded box. `'auto'`, the default, draws it;\n * `'none'` leaves the chart bare, for one placed inside a card the page has already drawn.\n * Unset falls back to `DS_CONFIG.chart.frame`, then `'auto'` — whether charts live inside cards\n * is one decision per app rather than per plot. */\n readonly frame = input<ChartFrame | null>(null);\n\n /** How long the tooltip stays after the pointer leaves the mark, in milliseconds. Zero, the\n * default, takes it away at once: a panel that outlives the pointer sits over the plot the\n * reader has moved on to.\n *\n * Raise it only for a panel a reader has to REACH — one carrying a link, a figure, or anything\n * selectable — which is WCAG 1.4.13's hoverable clause. The panel is portaled to the body, so\n * crossing the gap to it at an ordinary pointer speed needs about 140. Unset falls back to\n * `DS_CONFIG.chart.tooltipLingerMs`, then 0. */\n readonly tooltipLingerMs = input<number | null>(null, {\n transform: (raw: unknown) => (raw == null ? null : numberAttribute(raw)),\n });\n /** Printed above the plot as the chart's visible title, and reused as the annex table's\n * caption. */\n readonly caption = input<string | null>(null);\n\n /** Accessible name. Generated from the data when omitted. */\n readonly summary = input<string | null>(null);\n\n /** The label-and-value disclosure every chart carries. Ignored while `showTable` is on, which\n * already prints every label and value. Unset falls back to `DS_CONFIG.chart.dataTable`, then\n * `'toggle'`. */\n readonly dataTable = input<ChartDataTable | null>(null);\n /** What the Drop column reports: `'relative'` (the default) the share that leaked at this\n * stage, `'absolute'` the count, `'none'` no column at all. */\n readonly drop = input<FunnelChartDrop>('relative');\n\n /** Draws skeleton marks in place of the data, at the same count, so the chart does not resize\n * when the data lands. */\n readonly loading = input(false, { transform: booleanAttribute });\n /** Shown in place of the plot when `data` is empty. Unset falls back to\n * `DS_CONFIG.chart.emptyText`, then `'No data'`. */\n readonly emptyText = input<string | null>(null);\n\n /** Shows `errorText` in place of the plot. Separate from `loading` and from an empty `data`,\n * because \"the request failed\" and \"there is nothing to show\" read the same to a reader and\n * mean opposite things. */\n readonly error = input(false, { transform: booleanAttribute });\n\n /** The message the error state prints. Unset falls back to `DS_CONFIG.chart.errorText`, then\n * `'Could not load the data'`. */\n readonly errorText = input<string | null>(null);\n /** Formats every value the chart prints, the annex table and the generated description\n * included. Unset falls back to `DS_CONFIG.chart.valueFormat`, then the browser's locale\n * grouping with a K/M/B suffix past four digits. */\n readonly valueFormat = input<ChartValueFormat | null>(null);\n\n readonly frameResolved = resolveWithConfig(\n this.frame,\n (config) => config.chart?.frame,\n 'auto' as ChartFrame,\n );\n readonly dataTableResolved = resolveWithConfig(\n this.dataTable,\n (config) => config.chart?.dataTable,\n 'none' as ChartDataTable,\n );\n readonly emptyTextResolved = resolveWithConfig(\n this.emptyText,\n (config) => config.chart?.emptyText,\n 'No data',\n );\n readonly errorTextResolved = resolveWithConfig(\n this.errorText,\n (config) => config.chart?.errorText,\n 'Could not load the data',\n );\n readonly valueFormatResolved = resolveWithConfig(\n this.valueFormat,\n (config) => config.chart?.valueFormat,\n defaultChartFormat,\n );\n\n /** Turns on the click affordance — the pointer cursor and any hover tint.\n * The click output fires whether or not this is set, so a consumer that\n * binds the output and forgets the flag still receives every click. */\n readonly interactive = input(false, { transform: booleanAttribute });\n\n /** The stage that was clicked, or activated with Enter or Space. Fires whether or not\n * `interactive` is set. */\n readonly stageClicked = output<FunnelChartStage>();\n\n /** Holds the hovered mark and its tooltip in place when it is clicked, until Escape or a press\n * outside releases it. Off by default: a click is already the drill-down hook, and a mark left\n * lit after the pointer has gone needs a reader who knows why it is lit. `stageClicked` fires\n * either way — pinning is a state, not a handler. */\n readonly pinOnClick = input(false, { transform: booleanAttribute });\n\n /** Dims every OTHER mark while one is hovered or focused, so the reader's eye is held on the\n * one under the pointer. Off by default: the dimming costs the separation BETWEEN the dimmed\n * marks — measured 2026-09-13, the worst pair of three dimmed series falls from dE 14.8 at full\n * opacity to 2.1 at `--ds-chart-dim-opacity`'s default 0.3 — so it buys loudness for one mark\n * and pays for it with the rest of the chart. */\n readonly dimOthers = input(false, { transform: booleanAttribute });\n\n /** Milliseconds between one mark's entrance and the next. `0`, the default, is no stagger at\n * all; `40` is the documented non-zero step. The total is capped, so a long series does not\n * crawl in. */\n readonly staggerMs = input(0, { transform: numberAttribute });\n\n protected markStagger(index: number): string {\n return `${staggerDelay(index, this.staggerMs())}ms`;\n }\n\n /** Whether a hovered or focused stage opens a tooltip. `'axis'` is not offered — a\n * funnel's stages are its categories, so an axis tooltip would repeat the item one. */\n readonly tooltip = input<ChartItemTooltipTrigger>('item');\n\n protected readonly tooltipTemplate =\n contentChild<TemplateRef<{ $implicit: ChartTooltipContext }>>(\n 'dsChartTooltip',\n );\n\n private readonly tooltipLingerResolved = resolveWithConfig(\n this.tooltipLingerMs,\n (config) => config.chart?.tooltipLingerMs,\n 0,\n );\n\n protected readonly activeMark = chartActiveMark(() =>\n this.tooltipLingerResolved(),\n );\n\n /** Where the badge goes, as a percentage of the shape's box. Percentages rather than viewBox\n * units because this svg is `preserveAspectRatio=\"none\"`: it stretches horizontally with the\n * card, and anything measured in user units stretches with it. */\n protected readonly pinnedCenter = computed(() => {\n const entry = this.stages()[this.activeMark.index()];\n if (!this.activeMark.pinned() || !entry) {\n return null;\n }\n\n return {\n xPercent: (entry.center.x / FUNNEL_VIEW_BOX_WIDTH) * 100,\n yPercent: (entry.center.y / FUNNEL_VIEW_BOX_HEIGHT) * 100,\n };\n });\n\n protected onMarkClick(\n payload: FunnelChartStage,\n index: number,\n event: Event,\n ): void {\n this.stageClicked.emit(payload);\n if (this.pinOnClick()) {\n this.activeMark.pin(index, event);\n }\n }\n /** One tab stop per chart, not one per mark: WCAG 2.1.1's Understanding is explicit that not\n * every mouse-operable control has to be separately focusable, and that is what keeps a\n * twenty-five mark chart from being twenty-five stops in the page's tab order. */\n protected readonly rovingIndex = signal(0);\n\n protected readonly tabStopIndex = computed(() =>\n Math.min(this.rovingIndex(), Math.max(0, this.stages().length - 1)),\n );\n\n protected onMarkFocus(index: number, event: FocusEvent): void {\n this.rovingIndex.set(index);\n this.activeMark.enter(index, event);\n }\n\n /** A table row stands for its band, so it opens the band's tooltip over the BAND and dims the\n * others — the same state hovering the band itself produces. */\n protected onRowEnter(index: number, event: Event): void {\n this.activeMark.enter(\n index,\n event,\n markAt(\n (event.currentTarget as Element).closest('figure'),\n index,\n '.stage',\n ),\n );\n }\n\n protected isDimmed(index: number): boolean {\n return (\n this.dimOthers() &&\n this.activeMark.index() !== -1 &&\n this.activeMark.index() !== index\n );\n }\n\n protected onMarkNavigation(event: KeyboardEvent, index: number): void {\n const next = nextRovingIndex(event.key, index, this.stages().length);\n if (next === null) {\n return;\n }\n event.preventDefault();\n this.rovingIndex.set(next);\n focusMark((event.currentTarget as Element).closest('svg'), next);\n }\n\n protected readonly tooltipContext = computed<ChartTooltipContext | null>(\n () => {\n const entry = this.stages()[this.activeMark.index()];\n if (this.tooltip() === 'none' || !entry) {\n return null;\n }\n\n return {\n category: '',\n entries: [\n {\n label: entry.stage.label,\n value: entry.stage.value,\n formatted: `${entry.formattedValue} · ${entry.formattedPercent}`,\n color: entry.color,\n detail:\n entry.formattedDrop === '—'\n ? ''\n : `${entry.formattedDrop} fell away since the stage above`,\n },\n ],\n };\n },\n );\n\n protected readonly viewBox = `0 0 ${FUNNEL_VIEW_BOX_WIDTH} ${FUNNEL_VIEW_BOX_HEIGHT}`;\n\n /** The gap between two bands, painted as a TRANSPARENT STROKE on each. A stroke straddles the\n * edge it is drawn on, so each band claims half the gap above it and half below — the gap stays\n * exactly as wide to the eye and stops being dead space to the pointer. */\n protected readonly hitGapUnits = computed(() =>\n stageGapUnits(this.data().length, FUNNEL_VIEW_BOX_HEIGHT),\n );\n\n protected readonly stages = computed(() => {\n const data = this.data();\n const values = data.map((stage) => stage.value);\n const geometry = funnelGeometry(values, this.shape());\n const drops = stageDrops(values);\n const gapUnits = stageGapUnits(data.length, FUNNEL_VIEW_BOX_HEIGHT);\n const format = (value: number) =>\n this.valueFormatResolved()(value, 'tooltip');\n // Every stage is a share of the funnel's mouth, not of the column total:\n // the stages are nested subsets, so they do not add up to 100%.\n const firstValue = values.length ? values[0] : 0;\n // The stages are one quantity draining, not eight categories, so they take a\n // single-hue ramp. The last one is the outcome the funnel is read for, so it\n // leaves the ramp and takes the accent.\n const lastIndex = data.length - 1;\n\n return data.map((stage, index) => {\n const drop = drops[index];\n\n return {\n stage,\n // The middle of the band, for the marker that says this one is held. A polygon has no\n // centre of its own, and its bounding box centre drifts outside a steeply tapered band.\n center: stageCenter(\n geometry[index],\n FUNNEL_VIEW_BOX_WIDTH,\n FUNNEL_VIEW_BOX_HEIGHT,\n ),\n points: stagePolygonPoints(\n geometry[index],\n FUNNEL_VIEW_BOX_WIDTH,\n FUNNEL_VIEW_BOX_HEIGHT,\n gapUnits,\n ),\n formattedValue: format(stage.value),\n formattedPercent: formatPercent(stage.value, firstValue),\n formattedDrop: formatDrop(\n drop,\n index > 0 ? values[index - 1] - stage.value : null,\n this.drop(),\n format,\n ),\n color:\n index === lastIndex\n ? chartColors.seriesAccent\n : CHART_RAMP_COLORS[\n rampPosition(index, lastIndex, CHART_RAMP_COLORS.length)\n ],\n };\n });\n });\n\n protected readonly accessibleName = computed(\n () =>\n this.summary() ??\n describeSeries(\n this.caption() ?? 'Chart',\n this.data().map((stage) => ({\n label: stage.label,\n value: stage.value,\n })),\n (value) => this.valueFormatResolved()(value, 'tooltip'),\n this.showTable() || this.dataTableResolved() !== 'none',\n ),\n );\n\n protected entryLabel(entry: {\n stage: FunnelChartStage;\n formattedValue: string;\n }): string {\n return `${entry.stage.label}, ${entry.formattedValue}`;\n }\n\n protected onStageKey(stage: FunnelChartStage, event: Event): void {\n // A key pressed on a control inside the stage belongs to that control.\n if (!this.interactive() || event.target !== event.currentTarget) {\n return;\n }\n event.preventDefault();\n this.stageClicked.emit(stage);\n }\n\n protected readonly isEmpty = computed(() => this.data().length === 0);\n\n protected readonly showDataTable = computed(\n () => this.dataTableResolved() !== 'none' && !this.showTable(),\n );\n\n protected readonly chartHeight = computed(\n () =>\n `calc(var(--_funnel-chart-stage-height) * ${Math.max(this.data().length, 1)})`,\n );\n\n /** Placeholder stage widths while loading. The count follows the real stage\n * count so the chart does not resize when the data lands, falling back to\n * three when `data` is still empty. The widths vary — and deliberately do\n * not narrow in order — because a column of equal full-width bars is\n * indistinguishable from a funnel whose stages have all gone grey, and a\n * narrowing one just reads as the funnel itself. Same reasoning as the\n * table's skeleton rows. */\n protected readonly skeletonStages = computed(() =>\n Array.from(\n { length: Math.max(this.data().length, 3) },\n (unusedEntry, index) =>\n SKELETON_STAGE_WIDTHS[index % SKELETON_STAGE_WIDTHS.length],\n ),\n );\n}\n","<figure class=\"funnel-chart\">\n @if (activeMark.pinned()) {\n <button\n class=\"pin-reset\"\n type=\"button\"\n (click)=\"activeMark.release()\">\n Unpin\n </button>\n }\n\n @if (caption()) {\n <figcaption>\n {{ caption() }}\n </figcaption>\n }\n\n @if (error()) {\n <p\n class=\"empty is-error\"\n role=\"status\">\n {{ errorTextResolved() }}\n </p>\n } @else if (loading()) {\n <div\n class=\"skeleton\"\n aria-hidden=\"true\">\n @for (placeholderWidth of skeletonStages(); track $index) {\n <ds-skeleton\n height=\"calc(var(--_funnel-chart-stage-height) - var(--_funnel-chart-stage-gap))\"\n [width]=\"placeholderWidth\" />\n }\n </div>\n } @else if (isEmpty()) {\n <p class=\"empty\">\n {{ emptyTextResolved() }}\n </p>\n } @else {\n <div\n class=\"shape\"\n [class.dims-others]=\"dimOthers()\"\n [attr.role]=\"interactive() ? 'group' : 'img'\"\n [attr.aria-label]=\"accessibleName()\"\n [dsChartTooltip]=\"tooltipContext()\"\n [dsChartTooltipPreferBelow]=\"activeMark.pinned()\"\n [dsChartTooltipOrigin]=\"activeMark.origin()\"\n [dsChartTooltipTemplate]=\"tooltipTemplate() ?? null\">\n <svg\n preserveAspectRatio=\"none\"\n [attr.aria-hidden]=\"interactive() ? null : true\"\n [attr.viewBox]=\"viewBox\"\n [style.block-size]=\"chartHeight()\">\n @for (entry of stages(); track entry.stage.id; let index = $index) {\n <polygon\n class=\"stage\"\n animate.enter=\"mark-enter\"\n animate.leave=\"mark-leave\"\n [attr.stroke-width]=\"hitGapUnits()\"\n [style.--_chart-mark-stagger]=\"markStagger(index)\"\n [class.interactive]=\"interactive()\"\n [class.is-pinned]=\"\n activeMark.pinned() && activeMark.index() === index\n \"\n [class.is-dimmed]=\"isDimmed(index)\"\n [attr.points]=\"entry.points\"\n [attr.fill]=\"entry.color\"\n [attr.role]=\"interactive() ? 'button' : null\"\n [attr.tabindex]=\"\n interactive() ? (index === tabStopIndex() ? 0 : -1) : null\n \"\n [attr.data-mark-index]=\"index\"\n [attr.aria-label]=\"interactive() ? entryLabel(entry) : null\"\n (pointerenter)=\"activeMark.enter(index, $event)\"\n (pointerleave)=\"activeMark.leave()\"\n (focus)=\"onMarkFocus(index, $event)\"\n (blur)=\"activeMark.leave()\"\n (keydown)=\"onMarkNavigation($event, index)\"\n (click)=\"onMarkClick(entry.stage, index, $event)\"\n (keydown.enter)=\"onStageKey(entry.stage, $event)\"\n (keydown.space)=\"onStageKey(entry.stage, $event)\">\n </polygon>\n }\n </svg>\n\n @if (pinnedCenter(); as center) {\n <span\n class=\"pin-marker\"\n [style.left.%]=\"center.xPercent\"\n [style.top.%]=\"center.yPercent\">\n <ds-icon\n name=\"pin\"\n [size]=\"13\" />\n </span>\n }\n </div>\n\n @if (showTable()) {\n <table class=\"stage-table\">\n <caption class=\"visually-hidden\">\n Each stage as a percentage of the first, and the drop from the stage\n above it.\n </caption>\n\n <thead>\n <tr>\n <th scope=\"col\">\n Stage\n </th>\n\n <th scope=\"col\">\n Value\n </th>\n\n <th scope=\"col\">\n Percent\n </th>\n\n @if (drop() !== 'none') {\n <th scope=\"col\">\n Drop\n </th>\n }\n </tr>\n </thead>\n\n <tbody>\n @for (entry of stages(); track entry.stage.id; let index = $index) {\n <tr\n (pointerenter)=\"onRowEnter(index, $event)\"\n (pointerleave)=\"activeMark.leave()\">\n <th scope=\"row\">\n <span\n class=\"swatch\"\n animate.enter=\"mark-enter\"\n aria-hidden=\"true\"\n [style.background]=\"entry.color\">\n </span>\n\n {{ entry.stage.label }}\n </th>\n\n <td>\n {{ entry.formattedValue }}\n </td>\n\n <td>\n {{ entry.formattedPercent }}\n </td>\n\n @if (drop() !== 'none') {\n <td>\n {{ entry.formattedDrop }}\n </td>\n }\n </tr>\n }\n </tbody>\n </table>\n }\n\n @if (showDataTable()) {\n <details\n class=\"data-table\"\n [open]=\"dataTableResolved() === 'visible'\">\n <summary>\n Data table\n </summary>\n\n <table>\n <caption>\n {{\n caption() ?? 'Chart data'\n }}\n </caption>\n\n <thead>\n <tr>\n <th scope=\"col\">\n Label\n </th>\n\n <th scope=\"col\">\n Value\n </th>\n </tr>\n </thead>\n\n <tbody>\n @for (entry of stages(); track entry.stage.id) {\n <tr>\n <td>\n {{ entry.stage.label }}\n </td>\n\n <td>\n {{ entry.formattedValue }}\n </td>\n </tr>\n }\n </tbody>\n </table>\n </details>\n }\n }\n</figure>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;AAEA;AAC2D;AACpD,MAAM,iBAAiB,GAAG,IA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/funnel-chart.math.ts","../../../src/lib/components/funnel-chart/funnel-chart.component.ts","../../../src/lib/components/funnel-chart/funnel-chart.component.html","../../../src/lib/components/funnel-chart/ids-group-ltd-ids-design-system-components-funnel-chart.ts"],"sourcesContent":["import type { FunnelChartShape } from './funnel-chart.types';\n\n/** Bottom width of the fixed silhouette, as a fraction of the full width. The\n * tail carries a label, so it never narrows past this. */\nexport const FUNNEL_TAIL_WIDTH = 0.38;\n\n/** Ramp step for one stage, spread across the whole ramp rather than taking its\n * first `rampedCount` entries — a three-stage funnel that used steps 1-3 would\n * never reach the deep end the ramp exists to provide. */\nexport function rampPosition(\n index: number,\n rampedCount: number,\n rampLength: number,\n): number {\n if (rampLength <= 0 || rampedCount <= 1) {\n return 0;\n }\n const position = Math.round((index / (rampedCount - 1)) * (rampLength - 1));\n\n return Math.min(Math.max(position, 0), rampLength - 1);\n}\n\n/** The viewBox is normalised: depth runs 0..100 whatever the stage count, and\n * the rendered block size carries the real height. */\nexport const FUNNEL_VIEW_BOX_WIDTH = 100;\n\nexport const FUNNEL_VIEW_BOX_HEIGHT = 100;\n\n/** One inter-stage gap, as a share of a single stage's own depth. A share and\n * not a count of units, because the viewBox depth is normalised: a fixed\n * number of units would grow on screen with every stage added. */\nconst FUNNEL_STAGE_GAP_SHARE = 0.14;\n\nexport interface FunnelStageGeometry {\n /** Fraction of the full width at the stage's top edge, 0..1. */\n readonly topWidth: number;\n readonly bottomWidth: number;\n /** Fraction of the total depth at the stage's top edge, 0..1. */\n readonly top: number;\n readonly bottom: number;\n}\n\n/** Every value as a finite, non-negative number. A negative would mirror a\n * stage about its own centre line, and a non-finite one reaches an SVG\n * attribute as `NaN`, where the renderer drops the whole shape without an\n * error. */\nexport function sanitizeValues(values: readonly number[]): number[] {\n return values.map((value) =>\n Number.isFinite(value) ? Math.max(value, 0) : 0,\n );\n}\n\nfunction clampFraction(value: number): number {\n if (!Number.isFinite(value)) {\n return 0;\n }\n\n return Math.min(Math.max(value, 0), 1);\n}\n\nfunction widthAtDepth(depth: number, tailWidth: number): number {\n return 1 - (1 - tailWidth) * clampFraction(depth);\n}\n\nfunction largestValue(values: readonly number[]): number {\n return values.reduce(\n (largest, value) => (value > largest ? value : largest),\n 0,\n );\n}\n\n/** The depth at which `areaShare` of the silhouette's area lies above. The area\n * down to depth `t` is `t - (1 - tail) * t² / 2` against a whole of\n * `(1 + tail) / 2`, so the depth is a root of that quadratic rather than a\n * ratio — this is the step that makes area, not width, carry the value. The\n * discriminant bottoms out at `tail²`, so the root is always real. */\nexport function depthForAreaShare(\n areaShare: number,\n tailWidth: number,\n): number {\n const share = clampFraction(areaShare);\n const tail = clampFraction(tailWidth);\n const narrowing = 1 - tail;\n // A silhouette that does not narrow is a rectangle, where area is linear in\n // depth and the quadratic degenerates to 0/0.\n if (narrowing <= 0) {\n return share;\n }\n const discriminant = Math.max(1 - narrowing * share * (1 + tail), 0);\n\n return clampFraction((1 - Math.sqrt(discriminant)) / narrowing);\n}\n\nfunction evenDepths(count: number): number[] {\n return Array.from({ length: count + 1 }, (_, index) => index / count);\n}\n\nfunction boundaryDepths(\n values: readonly number[],\n shape: FunnelChartShape,\n tailWidth: number,\n): number[] {\n const count = values.length;\n if (shape !== 'area') {\n return evenDepths(count);\n }\n const total = values.reduce((sum, value) => sum + value, 0);\n if (!Number.isFinite(total) || total <= 0) {\n return evenDepths(count);\n }\n const depths: number[] = [];\n let consumed = 0;\n for (let index = 0; index <= count; index += 1) {\n depths.push(depthForAreaShare(consumed / total, tailWidth));\n if (index < count) {\n consumed += values[index];\n }\n }\n\n return depths;\n}\n\nfunction boundaryWidths(\n values: readonly number[],\n shape: FunnelChartShape,\n depths: readonly number[],\n tailWidth: number,\n): number[] {\n if (shape !== 'width') {\n return depths.map((depth) => widthAtDepth(depth, tailWidth));\n }\n const count = values.length;\n const largest = largestValue(values);\n if (!Number.isFinite(largest) || largest <= 0) {\n return depths.map(() => 0);\n }\n\n // The last boundary repeats the last value, which flattens the closing edge:\n // there is no following stage to taper towards.\n return Array.from({ length: count + 1 }, (_, index) =>\n clampFraction(values[Math.min(index, count - 1)] / largest),\n );\n}\n\n/** One trapezoid per stage, in fractions of the full width and of the total\n * depth.\n *\n * `'taper'` and `'area'` share one fixed silhouette — full width at the top,\n * `FUNNEL_TAIL_WIDTH` at the bottom — and differ only in where the stage\n * boundaries land on it: evenly spaced for `'taper'`, so width encodes\n * nothing, and at the depths that make each band's area proportional to its\n * value for `'area'`. `'width'` abandons the silhouette and reads every\n * boundary straight off the values. */\nexport function funnelGeometry(\n values: readonly number[],\n shape: FunnelChartShape,\n tailWidth: number = FUNNEL_TAIL_WIDTH,\n): FunnelStageGeometry[] {\n const safeValues = sanitizeValues(values);\n if (safeValues.length === 0) {\n return [];\n }\n const tail = Number.isFinite(tailWidth)\n ? clampFraction(tailWidth)\n : FUNNEL_TAIL_WIDTH;\n const depths = boundaryDepths(safeValues, shape, tail);\n const widths = boundaryWidths(safeValues, shape, depths, tail);\n\n return safeValues.map((_, index) => ({\n top: depths[index],\n bottom: depths[index + 1],\n topWidth: widths[index],\n bottomWidth: widths[index + 1],\n }));\n}\n\n/** The fall from `previousValue` to `value`, as a fraction of `previousValue`.\n * Null where there is nothing to fall from — a zero or non-finite predecessor\n * makes the ratio 0/0. Negative where the stage grew, which is real data. */\nexport function stageDrop(previousValue: number, value: number): number | null {\n if (!Number.isFinite(previousValue) || !Number.isFinite(value)) {\n return null;\n }\n if (previousValue <= 0) {\n return null;\n }\n\n return (previousValue - value) / previousValue;\n}\n\n/** The drop into each stage. The first entry is null and not zero: a printed\n * `0%` there would claim nobody fell away, rather than that there was no\n * earlier stage to fall from. */\nexport function stageDrops(values: readonly number[]): (number | null)[] {\n return values.map((value, index) =>\n index === 0 ? null : stageDrop(values[index - 1], value),\n );\n}\n\n/** Depth of one inter-stage gap, in viewBox units. */\nexport function stageGapUnits(\n stageCount: number,\n viewBoxHeight: number,\n): number {\n if (\n !Number.isFinite(stageCount) ||\n !Number.isFinite(viewBoxHeight) ||\n stageCount <= 0\n ) {\n return 0;\n }\n\n return (FUNNEL_STAGE_GAP_SHARE * viewBoxHeight) / stageCount;\n}\n\nfunction roundCoordinate(value: number): number {\n return Math.round(value * 1000) / 1000;\n}\n\n/** The stage's four corners as an SVG `points` value, or an empty string when\n * any input is non-finite. An attribute holding `NaN` is discarded by the\n * renderer without an error, so the shape would go missing in silence. */\nexport function stagePolygonPoints(\n geometry: FunnelStageGeometry,\n viewBoxWidth: number,\n viewBoxHeight: number,\n gapUnits: number,\n): string {\n const inputs = [\n geometry.topWidth,\n geometry.bottomWidth,\n geometry.top,\n geometry.bottom,\n viewBoxWidth,\n viewBoxHeight,\n gapUnits,\n ];\n if (inputs.some((input) => !Number.isFinite(input))) {\n return '';\n }\n const halfGap = Math.max(gapUnits, 0) / 2;\n const bandTop = clampFraction(geometry.top) * viewBoxHeight;\n const bandBottom = clampFraction(geometry.bottom) * viewBoxHeight;\n let top = bandTop + halfGap;\n let bottom = bandBottom - halfGap;\n if (bottom < top) {\n // A band shallower than the gap it has to leave. Collapse it to a line\n // instead of letting the edges cross and draw a bow tie.\n const middle = (top + bottom) / 2;\n top = middle;\n bottom = middle;\n }\n const horizontalCentre = viewBoxWidth / 2;\n const topWidth = clampFraction(geometry.topWidth);\n const bottomWidth = clampFraction(geometry.bottomWidth);\n // The widths belong to the band's own boundaries, and the gap moves the drawn edges INSIDE them.\n // Drawing the boundary widths at the inset depths makes every band overhang the silhouette at its\n // top and fall short of it at its bottom, so the stack reads as a fir tree rather than a funnel.\n // The silhouette is linear in depth for every shape, so the inset widths interpolate exactly.\n const bandDepth = bandBottom - bandTop;\n // Capped at half: past that the band has collapsed to a line, and an uncapped fraction would\n // swap the two edges and draw the bow tie the collapse exists to prevent.\n const inset =\n bandDepth > 0 ? Math.min(Math.max(halfGap / bandDepth, 0), 0.5) : 0;\n const widthAt = (fraction: number) =>\n topWidth + (bottomWidth - topWidth) * fraction;\n const halfTopWidth = (widthAt(inset) * viewBoxWidth) / 2;\n const halfBottomWidth = (widthAt(1 - inset) * viewBoxWidth) / 2;\n\n return [\n `${roundCoordinate(horizontalCentre - halfTopWidth)},${roundCoordinate(top)}`,\n `${roundCoordinate(horizontalCentre + halfTopWidth)},${roundCoordinate(top)}`,\n `${roundCoordinate(horizontalCentre + halfBottomWidth)},${roundCoordinate(bottom)}`,\n `${roundCoordinate(horizontalCentre - halfBottomWidth)},${roundCoordinate(bottom)}`,\n ].join(' ');\n}\n\n/** The middle of a band, for placing a marker inside it. The x is the viewBox centre because every\n * funnel band is symmetrical about it, whatever its two widths.\n *\n * @internal */\nexport function stageCenter(\n geometry: FunnelStageGeometry,\n viewBoxWidth: number,\n viewBoxHeight: number,\n): { x: number; y: number } {\n const top = clampFraction(geometry.top) * viewBoxHeight;\n const bottom = clampFraction(geometry.bottom) * viewBoxHeight;\n\n return { x: viewBoxWidth / 2, y: (top + bottom) / 2 };\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n TemplateRef,\n ViewEncapsulation,\n booleanAttribute,\n computed,\n contentChild,\n input,\n numberAttribute,\n output,\n} from '@angular/core';\nimport {\n CHART_RAMP_COLORS,\n chartColors,\n describeSeries,\n formatPercent,\n markAt,\n rovingMarks,\n leaveMark,\n staggerDelay,\n} from '@ids-group-ltd/ids-design-system/components';\nimport { SkeletonComponent } from '@ids-group-ltd/ids-design-system/components/skeleton';\nimport { IconComponent } from '@ids-group-ltd/ids-design-system/icons';\nimport { ChartDataTableComponent } from '@ids-group-ltd/ids-design-system/components/chart-data-table';\nimport type { ChartDataRow } from '@ids-group-ltd/ids-design-system/components/chart-data-table';\nimport { resolveChartDefaults } from '@ids-group-ltd/ids-design-system/components';\nimport type {\n ChartDataTable,\n ChartFrame,\n ChartValueFormat,\n} from '@ids-group-ltd/ids-design-system/core';\nimport {\n ChartTooltipDirective,\n chartActiveMark,\n} from '@ids-group-ltd/ids-design-system/components/chart-tooltip';\nimport type {\n ChartItemTooltipTrigger,\n ChartTooltipContext,\n} from '@ids-group-ltd/ids-design-system/components/chart-tooltip';\nimport {\n FUNNEL_VIEW_BOX_HEIGHT,\n FUNNEL_VIEW_BOX_WIDTH,\n funnelGeometry,\n rampPosition,\n stageDrops,\n stageCenter,\n stageGapUnits,\n stagePolygonPoints,\n} from './funnel-chart.math';\nimport type {\n FunnelChartDrop,\n FunnelChartShape,\n FunnelChartStage,\n} from './funnel-chart.types';\n\n/** The Drop cell, in whichever unit the chart was asked for. A null fall is the first stage, which\n * has nothing above it to fall from. */\nfunction formatDrop(\n fraction: number | null,\n count: number | null,\n mode: FunnelChartDrop,\n format: (value: number) => string,\n): string {\n if (mode === 'none' || fraction === null) {\n return '—';\n }\n\n return mode === 'absolute' && count !== null\n ? `−${format(Math.abs(count))}`\n : formatPercent(fraction, 1);\n}\n\nconst SKELETON_STAGE_WIDTHS = ['88%', '62%', '80%', '54%', '72%'] as const;\n\n@Component({\n selector: 'ds-funnel-chart',\n standalone: true,\n imports: [\n SkeletonComponent,\n ChartTooltipDirective,\n IconComponent,\n ChartDataTableComponent,\n ],\n templateUrl: './funnel-chart.component.html',\n styleUrl: './funnel-chart.component.scss',\n host: { '[class.framed]': \"frameResolved() === 'auto'\" },\n encapsulation: ViewEncapsulation.Emulated,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class FunnelChartComponent {\n protected readonly leaveMark = leaveMark;\n\n /** Drawn in the order given. The order of a funnel's stages is its meaning,\n * so they are never sorted. */\n readonly data = input.required<readonly FunnelChartStage[]>();\n\n /** What the silhouette encodes. `'area'`, the default, makes each stage's AREA proportional to\n * its value, which is the honest encoding that still leaves a tail wide enough to label.\n * `'width'` reads the widths straight off the values, which collapses the tail of a steep\n * funnel below a labellable width. `'taper'` encodes NOTHING: the shape is fixed whatever the\n * data, and the numbers are read from the table beside it. */\n readonly shape = input<FunnelChartShape>('area');\n\n /** The value, percent and drop table printed under the funnel. It supersedes\n * `dataTable`: while this is on, the disclosure every chart carries would\n * repeat a strict subset of these same numbers, so it is not rendered. */\n readonly showTable = input(true, { transform: booleanAttribute });\n\n /** Whether the chart draws its own bordered, padded box. `'auto'`, the default, draws it;\n * `'none'` leaves the chart bare, for one placed inside a card the page has already drawn.\n * Unset falls back to `DS_CONFIG.chart.frame`, then `'auto'` — whether charts live inside cards\n * is one decision per app rather than per plot. */\n readonly frame = input<ChartFrame | null>(null);\n\n /** How long the tooltip stays after the pointer leaves the mark, in milliseconds. Zero, the\n * default, takes it away at once: a panel that outlives the pointer sits over the plot the\n * reader has moved on to.\n *\n * Raise it only for a panel a reader has to REACH — one carrying a link, a figure, or anything\n * selectable — which is WCAG 1.4.13's hoverable clause. The panel is portaled to the body, so\n * crossing the gap to it at an ordinary pointer speed needs about 140. Unset falls back to\n * `DS_CONFIG.chart.tooltipLingerMs`, then 0. */\n readonly tooltipLingerMs = input<number | null>(null, {\n transform: (raw: unknown) => (raw == null ? null : numberAttribute(raw)),\n });\n /** Printed above the plot as the chart's visible title, and reused as the annex table's\n * caption. */\n readonly caption = input<string | null>(null);\n\n /** Accessible name. Generated from the data when omitted. */\n readonly summary = input<string | null>(null);\n\n /** The label-and-value disclosure every chart carries. Ignored while `showTable` is on, which\n * already prints every label and value. Unset falls back to `DS_CONFIG.chart.dataTable`, then\n * `'toggle'`. */\n readonly dataTable = input<ChartDataTable | null>(null);\n /** What the Drop column reports: `'relative'` (the default) the share that leaked at this\n * stage, `'absolute'` the count, `'none'` no column at all. */\n readonly drop = input<FunnelChartDrop>('relative');\n\n /** Draws skeleton marks in place of the data, at the same count, so the chart does not resize\n * when the data lands. */\n readonly loading = input(false, { transform: booleanAttribute });\n /** Shown in place of the plot when `data` is empty. Unset falls back to\n * `DS_CONFIG.chart.emptyText`, then `'No data'`. */\n readonly emptyText = input<string | null>(null);\n\n /** Shows `errorText` in place of the plot. Separate from `loading` and from an empty `data`,\n * because \"the request failed\" and \"there is nothing to show\" read the same to a reader and\n * mean opposite things. */\n readonly error = input(false, { transform: booleanAttribute });\n\n /** The message the error state prints. Unset falls back to `DS_CONFIG.chart.errorText`, then\n * `'Could not load the data'`. */\n readonly errorText = input<string | null>(null);\n /** Formats every value the chart prints, the annex table and the generated description\n * included. Unset falls back to `DS_CONFIG.chart.valueFormat`, then the browser's locale\n * grouping with a K/M/B suffix past four digits. */\n readonly valueFormat = input<ChartValueFormat | null>(null);\n\n private readonly defaults = resolveChartDefaults(this);\n readonly frameResolved = this.defaults.frame;\n readonly dataTableResolved = this.defaults.dataTable;\n readonly emptyTextResolved = this.defaults.emptyText;\n readonly errorTextResolved = this.defaults.errorText;\n readonly valueFormatResolved = this.defaults.valueFormat;\n\n /** Turns on the click affordance — the pointer cursor and any hover tint.\n * The click output fires whether or not this is set, so a consumer that\n * binds the output and forgets the flag still receives every click. */\n readonly interactive = input(false, { transform: booleanAttribute });\n\n /** The stage that was clicked, or activated with Enter or Space. Fires whether or not\n * `interactive` is set. */\n readonly stageClicked = output<FunnelChartStage>();\n\n /** Holds the hovered mark and its tooltip in place when it is clicked, until Escape or a press\n * outside releases it. Off by default: a click is already the drill-down hook, and a mark left\n * lit after the pointer has gone needs a reader who knows why it is lit. `stageClicked` fires\n * either way — pinning is a state, not a handler. */\n readonly pinOnClick = input(false, { transform: booleanAttribute });\n\n /** Dims every OTHER mark while one is hovered or focused, so the reader's eye is held on the\n * one under the pointer. Off by default: the dimming costs the separation BETWEEN the dimmed\n * marks — measured 2026-09-13, the worst pair of three dimmed series falls from dE 14.8 at full\n * opacity to 2.1 at `--ds-chart-dim-opacity`'s default 0.3 — so it buys loudness for one mark\n * and pays for it with the rest of the chart. */\n readonly dimOthers = input(false, { transform: booleanAttribute });\n\n /** Milliseconds between one mark's entrance and the next. `0`, the default, is no stagger at\n * all; `40` is the documented non-zero step. The total is capped, so a long series does not\n * crawl in. */\n readonly staggerMs = input(0, { transform: numberAttribute });\n\n protected markStagger(index: number): string {\n return `${staggerDelay(index, this.staggerMs())}ms`;\n }\n\n /** Whether a hovered or focused stage opens a tooltip. `'axis'` is not offered — a\n * funnel's stages are its categories, so an axis tooltip would repeat the item one. */\n readonly tooltip = input<ChartItemTooltipTrigger>('item');\n\n protected readonly tooltipTemplate =\n contentChild<TemplateRef<{ $implicit: ChartTooltipContext }>>(\n 'dsChartTooltip',\n );\n\n private readonly tooltipLingerResolved = this.defaults.tooltipLingerMs;\n\n protected readonly activeMark = chartActiveMark(() =>\n this.tooltipLingerResolved(),\n );\n\n /** Where the badge goes, as a percentage of the shape's box. Percentages rather than viewBox\n * units because this svg is `preserveAspectRatio=\"none\"`: it stretches horizontally with the\n * card, and anything measured in user units stretches with it. */\n protected readonly pinnedCenter = computed(() => {\n const entry = this.stages()[this.activeMark.index()];\n if (!this.activeMark.pinned() || !entry) {\n return null;\n }\n\n return {\n xPercent: (entry.center.x / FUNNEL_VIEW_BOX_WIDTH) * 100,\n yPercent: (entry.center.y / FUNNEL_VIEW_BOX_HEIGHT) * 100,\n };\n });\n\n protected onMarkClick(\n payload: FunnelChartStage,\n index: number,\n event: Event,\n ): void {\n this.stageClicked.emit(payload);\n if (this.pinOnClick()) {\n this.activeMark.pin(index, event);\n }\n }\n protected readonly roving = rovingMarks(() => this.stages().length);\n\n protected onMarkFocus(index: number, event: FocusEvent): void {\n this.roving.focus(index);\n this.activeMark.enter(index, event);\n }\n\n /** A table row stands for its band, so it opens the band's tooltip over the BAND and dims the\n * others — the same state hovering the band itself produces. */\n protected onRowEnter(index: number, event: Event): void {\n this.activeMark.enter(\n index,\n event,\n markAt(\n (event.currentTarget as Element).closest('figure'),\n index,\n '.stage',\n ),\n );\n }\n\n protected isDimmed(index: number): boolean {\n return (\n this.dimOthers() &&\n this.activeMark.index() !== -1 &&\n this.activeMark.index() !== index\n );\n }\n\n protected onMarkNavigation(event: KeyboardEvent, index: number): void {\n this.roving.navigate(\n event,\n index,\n (event.currentTarget as Element).closest('svg'),\n );\n }\n\n protected readonly tooltipContext = computed<ChartTooltipContext | null>(\n () => {\n const entry = this.stages()[this.activeMark.index()];\n if (this.tooltip() === 'none' || !entry) {\n return null;\n }\n\n return {\n category: '',\n entries: [\n {\n label: entry.stage.label,\n value: entry.stage.value,\n formatted: `${entry.formattedValue} · ${entry.formattedPercent}`,\n color: entry.color,\n detail:\n entry.formattedDrop === '—'\n ? ''\n : `${entry.formattedDrop} fell away since the stage above`,\n },\n ],\n };\n },\n );\n\n protected readonly viewBox = `0 0 ${FUNNEL_VIEW_BOX_WIDTH} ${FUNNEL_VIEW_BOX_HEIGHT}`;\n\n /** The gap between two bands, painted as a TRANSPARENT STROKE on each. A stroke straddles the\n * edge it is drawn on, so each band claims half the gap above it and half below — the gap stays\n * exactly as wide to the eye and stops being dead space to the pointer. */\n protected readonly hitGapUnits = computed(() =>\n stageGapUnits(this.data().length, FUNNEL_VIEW_BOX_HEIGHT),\n );\n\n protected readonly tableRows = computed<readonly ChartDataRow[]>(() =>\n this.stages().map((entry) => ({\n key: entry.stage.id,\n cells: [entry.stage.label, entry.formattedValue],\n })),\n );\n\n protected readonly stages = computed(() => {\n const data = this.data();\n const values = data.map((stage) => stage.value);\n const geometry = funnelGeometry(values, this.shape());\n const drops = stageDrops(values);\n const gapUnits = stageGapUnits(data.length, FUNNEL_VIEW_BOX_HEIGHT);\n const format = (value: number) =>\n this.valueFormatResolved()(value, 'tooltip');\n // Every stage is a share of the funnel's mouth, not of the column total:\n // the stages are nested subsets, so they do not add up to 100%.\n const firstValue = values.length ? values[0] : 0;\n // The stages are one quantity draining, not eight categories, so they take a\n // single-hue ramp. The last one is the outcome the funnel is read for, so it\n // leaves the ramp and takes the accent.\n const lastIndex = data.length - 1;\n\n return data.map((stage, index) => {\n const drop = drops[index];\n\n return {\n stage,\n // The middle of the band, for the marker that says this one is held. A polygon has no\n // centre of its own, and its bounding box centre drifts outside a steeply tapered band.\n center: stageCenter(\n geometry[index],\n FUNNEL_VIEW_BOX_WIDTH,\n FUNNEL_VIEW_BOX_HEIGHT,\n ),\n points: stagePolygonPoints(\n geometry[index],\n FUNNEL_VIEW_BOX_WIDTH,\n FUNNEL_VIEW_BOX_HEIGHT,\n gapUnits,\n ),\n formattedValue: format(stage.value),\n formattedPercent: formatPercent(stage.value, firstValue),\n formattedDrop: formatDrop(\n drop,\n index > 0 ? values[index - 1] - stage.value : null,\n this.drop(),\n format,\n ),\n color:\n index === lastIndex\n ? chartColors.seriesAccent\n : CHART_RAMP_COLORS[\n rampPosition(index, lastIndex, CHART_RAMP_COLORS.length)\n ],\n };\n });\n });\n\n protected readonly accessibleName = computed(\n () =>\n this.summary() ??\n describeSeries(\n this.caption() ?? 'Chart',\n this.data().map((stage) => ({\n label: stage.label,\n value: stage.value,\n })),\n (value) => this.valueFormatResolved()(value, 'tooltip'),\n this.showTable() || this.dataTableResolved() !== 'none',\n ),\n );\n\n protected entryLabel(entry: {\n stage: FunnelChartStage;\n formattedValue: string;\n }): string {\n return `${entry.stage.label}, ${entry.formattedValue}`;\n }\n\n protected onStageKey(stage: FunnelChartStage, event: Event): void {\n // A key pressed on a control inside the stage belongs to that control.\n if (!this.interactive() || event.target !== event.currentTarget) {\n return;\n }\n event.preventDefault();\n this.stageClicked.emit(stage);\n }\n\n protected readonly isEmpty = computed(() => this.data().length === 0);\n\n protected readonly showDataTable = computed(\n () => this.dataTableResolved() !== 'none' && !this.showTable(),\n );\n\n protected readonly chartHeight = computed(\n () =>\n `calc(var(--_funnel-chart-stage-height) * ${Math.max(this.data().length, 1)})`,\n );\n\n /** Placeholder stage widths while loading. The count follows the real stage\n * count so the chart does not resize when the data lands, falling back to\n * three when `data` is still empty. The widths vary — and deliberately do\n * not narrow in order — because a column of equal full-width bars is\n * indistinguishable from a funnel whose stages have all gone grey, and a\n * narrowing one just reads as the funnel itself. Same reasoning as the\n * table's skeleton rows. */\n protected readonly skeletonStages = computed(() =>\n Array.from(\n { length: Math.max(this.data().length, 3) },\n (unusedEntry, index) =>\n SKELETON_STAGE_WIDTHS[index % SKELETON_STAGE_WIDTHS.length],\n ),\n );\n}\n","<figure class=\"funnel-chart\">\n @if (activeMark.pinned()) {\n <button\n class=\"pin-reset\"\n type=\"button\"\n (click)=\"activeMark.release()\">\n Unpin\n </button>\n }\n\n @if (caption()) {\n <figcaption>\n {{ caption() }}\n </figcaption>\n }\n\n @if (error()) {\n <p\n class=\"empty is-error\"\n role=\"status\">\n {{ errorTextResolved() }}\n </p>\n } @else if (loading()) {\n <div\n class=\"skeleton\"\n aria-hidden=\"true\">\n @for (placeholderWidth of skeletonStages(); track $index) {\n <ds-skeleton\n height=\"calc(var(--_funnel-chart-stage-height) - var(--_funnel-chart-stage-gap))\"\n [width]=\"placeholderWidth\" />\n }\n </div>\n } @else if (isEmpty()) {\n <p class=\"empty\">\n {{ emptyTextResolved() }}\n </p>\n } @else {\n <div\n class=\"shape\"\n [class.dims-others]=\"dimOthers()\"\n [attr.role]=\"interactive() ? 'group' : 'img'\"\n [attr.aria-label]=\"accessibleName()\"\n [dsChartTooltip]=\"tooltipContext()\"\n [dsChartTooltipPreferBelow]=\"activeMark.pinned()\"\n [dsChartTooltipPinned]=\"activeMark.pinned()\"\n [dsChartTooltipOrigin]=\"activeMark.origin()\"\n [dsChartTooltipTemplate]=\"tooltipTemplate() ?? null\">\n <svg\n preserveAspectRatio=\"none\"\n [attr.aria-hidden]=\"interactive() ? null : true\"\n [attr.viewBox]=\"viewBox\"\n [style.block-size]=\"chartHeight()\">\n @for (entry of stages(); track entry.stage.id; let index = $index) {\n <polygon\n class=\"stage\"\n [attr.stroke-width]=\"hitGapUnits()\"\n [style.--_chart-mark-stagger]=\"markStagger(index)\"\n [class.interactive]=\"interactive()\"\n [class.is-pinned]=\"\n activeMark.pinned() && activeMark.index() === index\n \"\n [class.is-dimmed]=\"isDimmed(index)\"\n [attr.points]=\"entry.points\"\n [attr.fill]=\"entry.color\"\n [attr.role]=\"interactive() ? 'button' : null\"\n [attr.tabindex]=\"\n interactive() ? (index === roving.tabStop() ? 0 : -1) : null\n \"\n [attr.data-mark-index]=\"index\"\n [attr.aria-label]=\"interactive() ? entryLabel(entry) : null\"\n (animate.leave)=\"leaveMark($event)\"\n (pointerenter)=\"activeMark.enter(index, $event)\"\n (pointerleave)=\"activeMark.leave()\"\n (focus)=\"onMarkFocus(index, $event)\"\n (blur)=\"activeMark.leave()\"\n (keydown)=\"onMarkNavigation($event, index)\"\n (click)=\"onMarkClick(entry.stage, index, $event)\"\n (keydown.enter)=\"onStageKey(entry.stage, $event)\"\n (keydown.space)=\"onStageKey(entry.stage, $event)\">\n </polygon>\n }\n </svg>\n\n @if (pinnedCenter(); as center) {\n <span\n class=\"pin-marker\"\n [style.left.%]=\"center.xPercent\"\n [style.top.%]=\"center.yPercent\">\n <ds-icon\n name=\"pin\"\n [size]=\"13\" />\n </span>\n }\n </div>\n\n @if (showTable()) {\n <table class=\"stage-table\">\n <caption class=\"visually-hidden\">\n Each stage as a percentage of the first, and the drop from the stage\n above it.\n </caption>\n\n <thead>\n <tr>\n <th scope=\"col\">\n Stage\n </th>\n\n <th scope=\"col\">\n Value\n </th>\n\n <th scope=\"col\">\n Percent\n </th>\n\n @if (drop() !== 'none') {\n <th scope=\"col\">\n Drop\n </th>\n }\n </tr>\n </thead>\n\n <tbody>\n @for (entry of stages(); track entry.stage.id; let index = $index) {\n <tr\n (pointerenter)=\"onRowEnter(index, $event)\"\n (pointerleave)=\"activeMark.leave()\">\n <th scope=\"row\">\n <span\n class=\"swatch\"\n aria-hidden=\"true\"\n [style.background]=\"entry.color\">\n </span>\n\n {{ entry.stage.label }}\n </th>\n\n <td>\n {{ entry.formattedValue }}\n </td>\n\n <td>\n {{ entry.formattedPercent }}\n </td>\n\n @if (drop() !== 'none') {\n <td>\n {{ entry.formattedDrop }}\n </td>\n }\n </tr>\n }\n </tbody>\n </table>\n }\n\n @if (showDataTable()) {\n <ds-chart-data-table\n [columns]=\"['Label', 'Value']\"\n [rows]=\"tableRows()\"\n [caption]=\"caption()\"\n [open]=\"dataTableResolved() === 'visible'\" />\n }\n }\n</figure>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;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