@ids-group-ltd/ids-design-system 0.11.4 → 0.12.1

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 (266) hide show
  1. package/CHANGELOG.md +373 -53
  2. package/components/README.md +86 -0
  3. package/fesm2022/ids-group-ltd-ids-design-system-components-accordion.mjs +85 -0
  4. package/fesm2022/ids-group-ltd-ids-design-system-components-accordion.mjs.map +1 -0
  5. package/fesm2022/ids-group-ltd-ids-design-system-components-alert.mjs +70 -0
  6. package/fesm2022/ids-group-ltd-ids-design-system-components-alert.mjs.map +1 -0
  7. package/fesm2022/ids-group-ltd-ids-design-system-components-app-layout.mjs +573 -0
  8. package/fesm2022/ids-group-ltd-ids-design-system-components-app-layout.mjs.map +1 -0
  9. package/fesm2022/ids-group-ltd-ids-design-system-components-auth-layout.mjs +86 -0
  10. package/fesm2022/ids-group-ltd-ids-design-system-components-auth-layout.mjs.map +1 -0
  11. package/fesm2022/ids-group-ltd-ids-design-system-components-autocomplete.mjs +615 -0
  12. package/fesm2022/ids-group-ltd-ids-design-system-components-autocomplete.mjs.map +1 -0
  13. package/fesm2022/ids-group-ltd-ids-design-system-components-avatar-group.mjs +30 -0
  14. package/fesm2022/ids-group-ltd-ids-design-system-components-avatar-group.mjs.map +1 -0
  15. package/fesm2022/ids-group-ltd-ids-design-system-components-avatar.mjs +188 -0
  16. package/fesm2022/ids-group-ltd-ids-design-system-components-avatar.mjs.map +1 -0
  17. package/fesm2022/ids-group-ltd-ids-design-system-components-badge.mjs +59 -0
  18. package/fesm2022/ids-group-ltd-ids-design-system-components-badge.mjs.map +1 -0
  19. package/fesm2022/ids-group-ltd-ids-design-system-components-banner.mjs +92 -0
  20. package/fesm2022/ids-group-ltd-ids-design-system-components-banner.mjs.map +1 -0
  21. package/fesm2022/ids-group-ltd-ids-design-system-components-bottom-sheet.mjs +204 -0
  22. package/fesm2022/ids-group-ltd-ids-design-system-components-bottom-sheet.mjs.map +1 -0
  23. package/fesm2022/ids-group-ltd-ids-design-system-components-breadcrumbs.mjs +100 -0
  24. package/fesm2022/ids-group-ltd-ids-design-system-components-breadcrumbs.mjs.map +1 -0
  25. package/fesm2022/ids-group-ltd-ids-design-system-components-button-group.mjs +23 -0
  26. package/fesm2022/ids-group-ltd-ids-design-system-components-button-group.mjs.map +1 -0
  27. package/fesm2022/ids-group-ltd-ids-design-system-components-button.mjs +180 -0
  28. package/fesm2022/ids-group-ltd-ids-design-system-components-button.mjs.map +1 -0
  29. package/fesm2022/ids-group-ltd-ids-design-system-components-calendar-day.mjs +78 -0
  30. package/fesm2022/ids-group-ltd-ids-design-system-components-calendar-day.mjs.map +1 -0
  31. package/fesm2022/ids-group-ltd-ids-design-system-components-card.mjs +49 -0
  32. package/fesm2022/ids-group-ltd-ids-design-system-components-card.mjs.map +1 -0
  33. package/fesm2022/ids-group-ltd-ids-design-system-components-checkbox.mjs +73 -0
  34. package/fesm2022/ids-group-ltd-ids-design-system-components-checkbox.mjs.map +1 -0
  35. package/fesm2022/ids-group-ltd-ids-design-system-components-color-picker.mjs +397 -0
  36. package/fesm2022/ids-group-ltd-ids-design-system-components-color-picker.mjs.map +1 -0
  37. package/fesm2022/ids-group-ltd-ids-design-system-components-date-picker.mjs +1231 -0
  38. package/fesm2022/ids-group-ltd-ids-design-system-components-date-picker.mjs.map +1 -0
  39. package/fesm2022/ids-group-ltd-ids-design-system-components-description-list.mjs +51 -0
  40. package/fesm2022/ids-group-ltd-ids-design-system-components-description-list.mjs.map +1 -0
  41. package/fesm2022/ids-group-ltd-ids-design-system-components-divider.mjs +35 -0
  42. package/fesm2022/ids-group-ltd-ids-design-system-components-divider.mjs.map +1 -0
  43. package/fesm2022/ids-group-ltd-ids-design-system-components-drawer.mjs +109 -0
  44. package/fesm2022/ids-group-ltd-ids-design-system-components-drawer.mjs.map +1 -0
  45. package/fesm2022/ids-group-ltd-ids-design-system-components-dropzone.mjs +111 -0
  46. package/fesm2022/ids-group-ltd-ids-design-system-components-dropzone.mjs.map +1 -0
  47. package/fesm2022/ids-group-ltd-ids-design-system-components-empty-state.mjs +52 -0
  48. package/fesm2022/ids-group-ltd-ids-design-system-components-empty-state.mjs.map +1 -0
  49. package/fesm2022/ids-group-ltd-ids-design-system-components-field-group.mjs +92 -0
  50. package/fesm2022/ids-group-ltd-ids-design-system-components-field-group.mjs.map +1 -0
  51. package/fesm2022/ids-group-ltd-ids-design-system-components-field-message.mjs +62 -0
  52. package/fesm2022/ids-group-ltd-ids-design-system-components-field-message.mjs.map +1 -0
  53. package/fesm2022/ids-group-ltd-ids-design-system-components-filter-bar.mjs +164 -0
  54. package/fesm2022/ids-group-ltd-ids-design-system-components-filter-bar.mjs.map +1 -0
  55. package/fesm2022/ids-group-ltd-ids-design-system-components-icon-button.mjs +85 -0
  56. package/fesm2022/ids-group-ltd-ids-design-system-components-icon-button.mjs.map +1 -0
  57. package/fesm2022/ids-group-ltd-ids-design-system-components-input.mjs +223 -0
  58. package/fesm2022/ids-group-ltd-ids-design-system-components-input.mjs.map +1 -0
  59. package/fesm2022/ids-group-ltd-ids-design-system-components-layout.mjs +63 -0
  60. package/fesm2022/ids-group-ltd-ids-design-system-components-layout.mjs.map +1 -0
  61. package/fesm2022/ids-group-ltd-ids-design-system-components-list.mjs +53 -0
  62. package/fesm2022/ids-group-ltd-ids-design-system-components-list.mjs.map +1 -0
  63. package/fesm2022/ids-group-ltd-ids-design-system-components-loading-overlay.mjs +43 -0
  64. package/fesm2022/ids-group-ltd-ids-design-system-components-loading-overlay.mjs.map +1 -0
  65. package/fesm2022/ids-group-ltd-ids-design-system-components-menu.mjs +293 -0
  66. package/fesm2022/ids-group-ltd-ids-design-system-components-menu.mjs.map +1 -0
  67. package/fesm2022/ids-group-ltd-ids-design-system-components-modal.mjs +329 -0
  68. package/fesm2022/ids-group-ltd-ids-design-system-components-modal.mjs.map +1 -0
  69. package/fesm2022/ids-group-ltd-ids-design-system-components-multi-select.mjs +612 -0
  70. package/fesm2022/ids-group-ltd-ids-design-system-components-multi-select.mjs.map +1 -0
  71. package/fesm2022/ids-group-ltd-ids-design-system-components-number-stepper.mjs +69 -0
  72. package/fesm2022/ids-group-ltd-ids-design-system-components-number-stepper.mjs.map +1 -0
  73. package/fesm2022/ids-group-ltd-ids-design-system-components-otp-input.mjs +191 -0
  74. package/fesm2022/ids-group-ltd-ids-design-system-components-otp-input.mjs.map +1 -0
  75. package/fesm2022/ids-group-ltd-ids-design-system-components-page-footer.mjs +23 -0
  76. package/fesm2022/ids-group-ltd-ids-design-system-components-page-footer.mjs.map +1 -0
  77. package/fesm2022/ids-group-ltd-ids-design-system-components-page-header.mjs +43 -0
  78. package/fesm2022/ids-group-ltd-ids-design-system-components-page-header.mjs.map +1 -0
  79. package/fesm2022/ids-group-ltd-ids-design-system-components-pagination.mjs +85 -0
  80. package/fesm2022/ids-group-ltd-ids-design-system-components-pagination.mjs.map +1 -0
  81. package/fesm2022/ids-group-ltd-ids-design-system-components-password-rules.mjs +95 -0
  82. package/fesm2022/ids-group-ltd-ids-design-system-components-password-rules.mjs.map +1 -0
  83. package/fesm2022/ids-group-ltd-ids-design-system-components-popover.mjs +240 -0
  84. package/fesm2022/ids-group-ltd-ids-design-system-components-popover.mjs.map +1 -0
  85. package/fesm2022/ids-group-ltd-ids-design-system-components-progress.mjs +41 -0
  86. package/fesm2022/ids-group-ltd-ids-design-system-components-progress.mjs.map +1 -0
  87. package/fesm2022/ids-group-ltd-ids-design-system-components-radio-group.mjs +248 -0
  88. package/fesm2022/ids-group-ltd-ids-design-system-components-radio-group.mjs.map +1 -0
  89. package/fesm2022/ids-group-ltd-ids-design-system-components-reserve-messages.mjs +62 -0
  90. package/fesm2022/ids-group-ltd-ids-design-system-components-reserve-messages.mjs.map +1 -0
  91. package/fesm2022/ids-group-ltd-ids-design-system-components-search.mjs +173 -0
  92. package/fesm2022/ids-group-ltd-ids-design-system-components-search.mjs.map +1 -0
  93. package/fesm2022/ids-group-ltd-ids-design-system-components-segmented.mjs +123 -0
  94. package/fesm2022/ids-group-ltd-ids-design-system-components-segmented.mjs.map +1 -0
  95. package/fesm2022/ids-group-ltd-ids-design-system-components-select.mjs +461 -0
  96. package/fesm2022/ids-group-ltd-ids-design-system-components-select.mjs.map +1 -0
  97. package/fesm2022/ids-group-ltd-ids-design-system-components-sidenav-footer.mjs +107 -0
  98. package/fesm2022/ids-group-ltd-ids-design-system-components-sidenav-footer.mjs.map +1 -0
  99. package/fesm2022/ids-group-ltd-ids-design-system-components-sidenav.mjs +185 -0
  100. package/fesm2022/ids-group-ltd-ids-design-system-components-sidenav.mjs.map +1 -0
  101. package/fesm2022/ids-group-ltd-ids-design-system-components-skeleton.mjs +32 -0
  102. package/fesm2022/ids-group-ltd-ids-design-system-components-skeleton.mjs.map +1 -0
  103. package/fesm2022/ids-group-ltd-ids-design-system-components-slider.mjs +204 -0
  104. package/fesm2022/ids-group-ltd-ids-design-system-components-slider.mjs.map +1 -0
  105. package/fesm2022/ids-group-ltd-ids-design-system-components-spinner.mjs +25 -0
  106. package/fesm2022/ids-group-ltd-ids-design-system-components-spinner.mjs.map +1 -0
  107. package/fesm2022/ids-group-ltd-ids-design-system-components-split-button.mjs +63 -0
  108. package/fesm2022/ids-group-ltd-ids-design-system-components-split-button.mjs.map +1 -0
  109. package/fesm2022/ids-group-ltd-ids-design-system-components-stat.mjs +99 -0
  110. package/fesm2022/ids-group-ltd-ids-design-system-components-stat.mjs.map +1 -0
  111. package/fesm2022/ids-group-ltd-ids-design-system-components-status-dot.mjs +26 -0
  112. package/fesm2022/ids-group-ltd-ids-design-system-components-status-dot.mjs.map +1 -0
  113. package/fesm2022/ids-group-ltd-ids-design-system-components-stepper.mjs +74 -0
  114. package/fesm2022/ids-group-ltd-ids-design-system-components-stepper.mjs.map +1 -0
  115. package/fesm2022/ids-group-ltd-ids-design-system-components-switch.mjs +76 -0
  116. package/fesm2022/ids-group-ltd-ids-design-system-components-switch.mjs.map +1 -0
  117. package/fesm2022/ids-group-ltd-ids-design-system-components-table-columns.mjs +440 -0
  118. package/fesm2022/ids-group-ltd-ids-design-system-components-table-columns.mjs.map +1 -0
  119. package/fesm2022/ids-group-ltd-ids-design-system-components-table-export.mjs +186 -0
  120. package/fesm2022/ids-group-ltd-ids-design-system-components-table-export.mjs.map +1 -0
  121. package/fesm2022/ids-group-ltd-ids-design-system-components-table-resize.mjs +227 -0
  122. package/fesm2022/ids-group-ltd-ids-design-system-components-table-resize.mjs.map +1 -0
  123. package/fesm2022/ids-group-ltd-ids-design-system-components-table.mjs +1593 -0
  124. package/fesm2022/ids-group-ltd-ids-design-system-components-table.mjs.map +1 -0
  125. package/fesm2022/ids-group-ltd-ids-design-system-components-tabs.mjs +381 -0
  126. package/fesm2022/ids-group-ltd-ids-design-system-components-tabs.mjs.map +1 -0
  127. package/fesm2022/ids-group-ltd-ids-design-system-components-tag.mjs +44 -0
  128. package/fesm2022/ids-group-ltd-ids-design-system-components-tag.mjs.map +1 -0
  129. package/fesm2022/ids-group-ltd-ids-design-system-components-textarea.mjs +158 -0
  130. package/fesm2022/ids-group-ltd-ids-design-system-components-textarea.mjs.map +1 -0
  131. package/fesm2022/ids-group-ltd-ids-design-system-components-time-picker.mjs +671 -0
  132. package/fesm2022/ids-group-ltd-ids-design-system-components-time-picker.mjs.map +1 -0
  133. package/fesm2022/ids-group-ltd-ids-design-system-components-timeline.mjs +41 -0
  134. package/fesm2022/ids-group-ltd-ids-design-system-components-timeline.mjs.map +1 -0
  135. package/fesm2022/ids-group-ltd-ids-design-system-components-toast.mjs +549 -0
  136. package/fesm2022/ids-group-ltd-ids-design-system-components-toast.mjs.map +1 -0
  137. package/fesm2022/ids-group-ltd-ids-design-system-components-toggle-button.mjs +34 -0
  138. package/fesm2022/ids-group-ltd-ids-design-system-components-toggle-button.mjs.map +1 -0
  139. package/fesm2022/ids-group-ltd-ids-design-system-components-tooltip.mjs +218 -0
  140. package/fesm2022/ids-group-ltd-ids-design-system-components-tooltip.mjs.map +1 -0
  141. package/fesm2022/ids-group-ltd-ids-design-system-components-topbar.mjs +18 -0
  142. package/fesm2022/ids-group-ltd-ids-design-system-components-topbar.mjs.map +1 -0
  143. package/fesm2022/ids-group-ltd-ids-design-system-components-tree.mjs +153 -0
  144. package/fesm2022/ids-group-ltd-ids-design-system-components-tree.mjs.map +1 -0
  145. package/fesm2022/ids-group-ltd-ids-design-system-components-w3w.mjs +48 -0
  146. package/fesm2022/ids-group-ltd-ids-design-system-components-w3w.mjs.map +1 -0
  147. package/fesm2022/ids-group-ltd-ids-design-system-components.mjs +1338 -0
  148. package/fesm2022/ids-group-ltd-ids-design-system-components.mjs.map +1 -0
  149. package/fesm2022/ids-group-ltd-ids-design-system-core.mjs +333 -0
  150. package/fesm2022/ids-group-ltd-ids-design-system-core.mjs.map +1 -0
  151. package/fesm2022/ids-group-ltd-ids-design-system-icons.mjs +65 -0
  152. package/fesm2022/ids-group-ltd-ids-design-system-icons.mjs.map +1 -0
  153. package/fesm2022/ids-group-ltd-ids-design-system-overlay.mjs +56 -0
  154. package/fesm2022/ids-group-ltd-ids-design-system-overlay.mjs.map +1 -0
  155. package/fesm2022/ids-group-ltd-ids-design-system-theme.mjs +37 -0
  156. package/fesm2022/ids-group-ltd-ids-design-system-theme.mjs.map +1 -0
  157. package/fesm2022/ids-group-ltd-ids-design-system.mjs +75 -14267
  158. package/fesm2022/ids-group-ltd-ids-design-system.mjs.map +1 -1
  159. package/migrations/0.10.0.json +1 -1
  160. package/migrations/0.10.1.json +1 -1
  161. package/migrations/0.10.2.json +1 -30
  162. package/migrations/0.11.0.json +0 -2
  163. package/migrations/0.11.1.json +2 -24
  164. package/migrations/0.11.2.json +2 -1
  165. package/migrations/0.11.3.json +3 -2
  166. package/migrations/0.11.4.json +32 -6
  167. package/migrations/0.12.0.json +22 -0
  168. package/migrations/0.12.1.json +215 -0
  169. package/migrations/0.4.0.json +2 -1
  170. package/migrations/0.5.0.json +0 -54
  171. package/migrations/0.5.1.json +3 -1
  172. package/migrations/0.7.0.json +0 -11
  173. package/migrations/0.7.1.json +2 -1
  174. package/migrations/0.9.0.json +22 -3
  175. package/migrations/0.9.1.json +1 -1
  176. package/package.json +597 -1
  177. package/styles/_check-box.scss +84 -0
  178. package/styles/_check-mark.scss +59 -0
  179. package/styles/_dropdown-overlay.scss +12 -2
  180. package/styles/_field-group-segment.scss +4 -1
  181. package/styles/_focus.scss +103 -50
  182. package/styles/_link.scss +4 -2
  183. package/styles/_tokens.scss +20 -0
  184. package/styles/_typography.scss +6 -0
  185. package/themes/README.md +4 -4
  186. package/themes/_semantic.scss +7 -8
  187. package/types/ids-group-ltd-ids-design-system-components-accordion.d.ts +48 -0
  188. package/types/ids-group-ltd-ids-design-system-components-alert.d.ts +32 -0
  189. package/types/ids-group-ltd-ids-design-system-components-app-layout.d.ts +260 -0
  190. package/types/ids-group-ltd-ids-design-system-components-auth-layout.d.ts +75 -0
  191. package/types/ids-group-ltd-ids-design-system-components-autocomplete.d.ts +226 -0
  192. package/types/ids-group-ltd-ids-design-system-components-avatar-group.d.ts +13 -0
  193. package/types/ids-group-ltd-ids-design-system-components-avatar.d.ts +99 -0
  194. package/types/ids-group-ltd-ids-design-system-components-badge.d.ts +25 -0
  195. package/types/ids-group-ltd-ids-design-system-components-banner.d.ts +41 -0
  196. package/types/ids-group-ltd-ids-design-system-components-bottom-sheet.d.ts +61 -0
  197. package/types/ids-group-ltd-ids-design-system-components-breadcrumbs.d.ts +66 -0
  198. package/types/ids-group-ltd-ids-design-system-components-button-group.d.ts +10 -0
  199. package/types/ids-group-ltd-ids-design-system-components-button.d.ts +90 -0
  200. package/types/ids-group-ltd-ids-design-system-components-calendar-day.d.ts +41 -0
  201. package/types/ids-group-ltd-ids-design-system-components-card.d.ts +24 -0
  202. package/types/ids-group-ltd-ids-design-system-components-checkbox.d.ts +41 -0
  203. package/types/ids-group-ltd-ids-design-system-components-color-picker.d.ts +79 -0
  204. package/types/ids-group-ltd-ids-design-system-components-date-picker.d.ts +251 -0
  205. package/types/ids-group-ltd-ids-design-system-components-description-list.d.ts +25 -0
  206. package/types/ids-group-ltd-ids-design-system-components-divider.d.ts +22 -0
  207. package/types/ids-group-ltd-ids-design-system-components-drawer.d.ts +38 -0
  208. package/types/ids-group-ltd-ids-design-system-components-dropzone.d.ts +45 -0
  209. package/types/ids-group-ltd-ids-design-system-components-empty-state.d.ts +22 -0
  210. package/types/ids-group-ltd-ids-design-system-components-field-group.d.ts +73 -0
  211. package/types/ids-group-ltd-ids-design-system-components-field-message.d.ts +36 -0
  212. package/types/ids-group-ltd-ids-design-system-components-filter-bar.d.ts +83 -0
  213. package/types/ids-group-ltd-ids-design-system-components-icon-button.d.ts +56 -0
  214. package/types/ids-group-ltd-ids-design-system-components-input.d.ts +121 -0
  215. package/types/ids-group-ltd-ids-design-system-components-layout.d.ts +39 -0
  216. package/types/ids-group-ltd-ids-design-system-components-list.d.ts +29 -0
  217. package/types/ids-group-ltd-ids-design-system-components-loading-overlay.d.ts +31 -0
  218. package/types/ids-group-ltd-ids-design-system-components-menu.d.ts +85 -0
  219. package/types/ids-group-ltd-ids-design-system-components-modal.d.ts +124 -0
  220. package/types/ids-group-ltd-ids-design-system-components-multi-select.d.ts +213 -0
  221. package/types/ids-group-ltd-ids-design-system-components-number-stepper.d.ts +31 -0
  222. package/types/ids-group-ltd-ids-design-system-components-otp-input.d.ts +52 -0
  223. package/types/ids-group-ltd-ids-design-system-components-page-footer.d.ts +13 -0
  224. package/types/ids-group-ltd-ids-design-system-components-page-header.d.ts +21 -0
  225. package/types/ids-group-ltd-ids-design-system-components-pagination.d.ts +32 -0
  226. package/types/ids-group-ltd-ids-design-system-components-password-rules.d.ts +80 -0
  227. package/types/ids-group-ltd-ids-design-system-components-popover.d.ts +48 -0
  228. package/types/ids-group-ltd-ids-design-system-components-progress.d.ts +22 -0
  229. package/types/ids-group-ltd-ids-design-system-components-radio-group.d.ts +110 -0
  230. package/types/ids-group-ltd-ids-design-system-components-reserve-messages.d.ts +33 -0
  231. package/types/ids-group-ltd-ids-design-system-components-search.d.ts +82 -0
  232. package/types/ids-group-ltd-ids-design-system-components-segmented.d.ts +40 -0
  233. package/types/ids-group-ltd-ids-design-system-components-select.d.ts +152 -0
  234. package/types/ids-group-ltd-ids-design-system-components-sidenav-footer.d.ts +92 -0
  235. package/types/ids-group-ltd-ids-design-system-components-sidenav.d.ts +131 -0
  236. package/types/ids-group-ltd-ids-design-system-components-skeleton.d.ts +16 -0
  237. package/types/ids-group-ltd-ids-design-system-components-slider.d.ts +51 -0
  238. package/types/ids-group-ltd-ids-design-system-components-spinner.d.ts +11 -0
  239. package/types/ids-group-ltd-ids-design-system-components-split-button.d.ts +39 -0
  240. package/types/ids-group-ltd-ids-design-system-components-stat.d.ts +44 -0
  241. package/types/ids-group-ltd-ids-design-system-components-status-dot.d.ts +12 -0
  242. package/types/ids-group-ltd-ids-design-system-components-stepper.d.ts +32 -0
  243. package/types/ids-group-ltd-ids-design-system-components-switch.d.ts +40 -0
  244. package/types/ids-group-ltd-ids-design-system-components-table-columns.d.ts +43 -0
  245. package/types/ids-group-ltd-ids-design-system-components-table-export.d.ts +48 -0
  246. package/types/ids-group-ltd-ids-design-system-components-table-resize.d.ts +79 -0
  247. package/types/ids-group-ltd-ids-design-system-components-table.d.ts +815 -0
  248. package/types/ids-group-ltd-ids-design-system-components-tabs.d.ts +118 -0
  249. package/types/ids-group-ltd-ids-design-system-components-tag.d.ts +26 -0
  250. package/types/ids-group-ltd-ids-design-system-components-textarea.d.ts +85 -0
  251. package/types/ids-group-ltd-ids-design-system-components-time-picker.d.ts +188 -0
  252. package/types/ids-group-ltd-ids-design-system-components-timeline.d.ts +24 -0
  253. package/types/ids-group-ltd-ids-design-system-components-toast.d.ts +167 -0
  254. package/types/ids-group-ltd-ids-design-system-components-toggle-button.d.ts +18 -0
  255. package/types/ids-group-ltd-ids-design-system-components-tooltip.d.ts +66 -0
  256. package/types/ids-group-ltd-ids-design-system-components-topbar.d.ts +8 -0
  257. package/types/ids-group-ltd-ids-design-system-components-tree.d.ts +46 -0
  258. package/types/ids-group-ltd-ids-design-system-components-w3w.d.ts +18 -0
  259. package/types/ids-group-ltd-ids-design-system-components.d.ts +604 -0
  260. package/types/ids-group-ltd-ids-design-system-core.d.ts +436 -0
  261. package/types/ids-group-ltd-ids-design-system-icons.d.ts +52 -0
  262. package/types/ids-group-ltd-ids-design-system-overlay.d.ts +32 -0
  263. package/types/ids-group-ltd-ids-design-system-theme.d.ts +29 -0
  264. package/types/ids-group-ltd-ids-design-system.d.ts +75 -5594
  265. package/LICENSE +0 -21
  266. package/README.md +0 -73
@@ -0,0 +1,549 @@
1
+ import * as i0 from '@angular/core';
2
+ import { input, booleanAttribute, output, computed, ViewEncapsulation, Component, signal, inject, ElementRef, effect, DestroyRef, Injectable } from '@angular/core';
3
+ import { Overlay } from '@angular/cdk/overlay';
4
+ import { ComponentPortal } from '@angular/cdk/portal';
5
+ import { LiveAnnouncer } from '@angular/cdk/a11y';
6
+ import { DS_CONFIG, devWarn } from '@ids-group-ltd/ids-design-system/core';
7
+ import { IconComponent } from '@ids-group-ltd/ids-design-system/icons';
8
+ import { SpinnerComponent } from '@ids-group-ltd/ids-design-system/components/spinner';
9
+
10
+ const DS_TOAST_POSITION_DEFAULT = {
11
+ horizontalPosition: 'right',
12
+ verticalPosition: 'top',
13
+ offset: 'var(--space-6)',
14
+ };
15
+
16
+ /**
17
+ * Single toast pill. Consumed by ToastRegion for service-driven runtime toasts
18
+ * AND by static showcases that need to display a toast specimen inline.
19
+ */
20
+ class ToastComponent {
21
+ /** Severity — drives colour and the default icon or spinner. */
22
+ variant = input('info', ...(ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []));
23
+ /** Optional bold heading above the message. */
24
+ title = input('', ...(ngDevMode ? [{ debugName: "title" }] : /* istanbul ignore next */ []));
25
+ /** The same field `ToastOptions.body` carries, so a specimen and a raised toast agree. */
26
+ body = input('', ...(ngDevMode ? [{ debugName: "body" }] : /* istanbul ignore next */ []));
27
+ /** Show a close button that emits `closed`. */
28
+ dismissible = input(false, { ...(ngDevMode ? { debugName: "dismissible" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
29
+ /** Override the variant's default icon. */
30
+ icon = input(null, ...(ngDevMode ? [{ debugName: "icon" }] : /* istanbul ignore next */ []));
31
+ /** Optional action button rendered before the dismiss control. */
32
+ action = input(null, ...(ngDevMode ? [{ debugName: "action" }] : /* istanbul ignore next */ []));
33
+ /** Fires when the toast is dismissed or its action is invoked. */
34
+ closed = output();
35
+ isLoading = computed(() => this.variant() === 'loading', ...(ngDevMode ? [{ debugName: "isLoading" }] : /* istanbul ignore next */ []));
36
+ onAction(action) {
37
+ action.handler();
38
+ this.closed.emit();
39
+ }
40
+ classes = computed(() => `toast ${this.variant()}`, ...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
41
+ defaultIcon = computed(() => {
42
+ switch (this.variant()) {
43
+ case 'success':
44
+ return 'success';
45
+ case 'warning':
46
+ return 'warn';
47
+ case 'error':
48
+ return 'error';
49
+ default:
50
+ return 'info';
51
+ }
52
+ }, ...(ngDevMode ? [{ debugName: "defaultIcon" }] : /* istanbul ignore next */ []));
53
+ onDismiss() {
54
+ this.closed.emit();
55
+ }
56
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: ToastComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
57
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: ToastComponent, isStandalone: true, selector: "ds-toast", inputs: { variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, body: { classPropertyName: "body", publicName: "body", isSignal: true, isRequired: false, transformFunction: null }, dismissible: { classPropertyName: "dismissible", publicName: "dismissible", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, action: { classPropertyName: "action", publicName: "action", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { closed: "closed" }, ngImport: i0, template: "<!-- No role or aria-live: a region created with its text already in it announces\n nothing, so ToastService speaks through the CDK LiveAnnouncer. A hand-placed\n <ds-toast> is therefore silent to a reader \u2014 it is a specimen, not an event. -->\n<div [class]=\"classes()\">\n @if (isLoading()) {\n <!-- aria-hidden because ds-spinner is a role=\"status\" of its own: the message is\n announced by ToastService, and a nested live region would speak twice. -->\n <ds-spinner\n class=\"icon\"\n size=\"sm\"\n aria-hidden=\"true\" />\n } @else {\n <ds-icon\n class=\"icon\"\n [name]=\"icon() ?? defaultIcon()\"\n [size]=\"16\" />\n }\n\n <div class=\"body\">\n @if (title()) {\n <div class=\"title\">\n {{ title() }}\n </div>\n }\n {{ body() }}\n <ng-content></ng-content>\n </div>\n\n @if (action(); as act) {\n <button\n type=\"button\"\n class=\"action\"\n (click)=\"onAction(act)\">\n {{ act.label }}\n </button>\n }\n\n <span class=\"actions\">\n <ng-content select=\"[actions]\"></ng-content>\n </span>\n\n @if (dismissible()) {\n <button\n type=\"button\"\n class=\"close\"\n aria-label=\"Dismiss\"\n (click)=\"onDismiss()\">\n <ds-icon\n name=\"x\"\n [size]=\"14\" />\n </button>\n }\n</div>\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)}}:host{--_toast-leave-duration: var(--ds-toast-leave-duration, var(--duration-base));--_toast-leave-easing: var(--ds-toast-leave-easing, var(--ease-standard));--_toast-shift-duration: var(--ds-toast-shift-duration, var(--duration-fast));--_toast-shift-easing: var(--ds-toast-shift-easing, var(--ease-standard));display:block;transition:opacity var(--_toast-leave-duration) var(--_toast-leave-easing),transform var(--_toast-shift-duration) var(--_toast-shift-easing)}:host(.leaving){opacity:0;transform:translateY(calc(var(--space-2) * -1));pointer-events:none;transition:opacity var(--_toast-leave-duration) var(--_toast-leave-easing),transform var(--_toast-leave-duration) var(--_toast-leave-easing)}:host(.shifting){transform:translateY(var(--_toast-shift, 0));transition:none}.toast{--_toast-bg-color: var(--ds-toast-bg-color, var(--surface-overlay));--_toast-border: var(--ds-toast-border-color, var(--border-default));--_toast-bar-color: var(--ds-toast-bar-color, var(--accent));--_toast-icon-color: var(--ds-toast-icon-color, var(--accent));--_toast-enter-keyframes: var(--ds-toast-enter-keyframes, ds-slide-in);--_toast-enter-duration: var(--ds-toast-enter-duration, var(--ds-motion-enter-large-duration));--_toast-enter-easing: var(--ds-toast-enter-easing, var(--ds-motion-enter-large-easing));--_toast-enter-offset: var(--ds-toast-enter-offset, var(--space-2));--_toast-min-width: var(--ds-toast-min-width, var(--toast-minw));--_toast-max-width: var(--ds-toast-max-width, var(--toast-maxw));--_ds-enter-y: var(--_toast-enter-offset);--_ds-enter-scale: var(--ds-toast-enter-scale, .96);display:flex;align-items:flex-start;gap:var(--space-3);background-color:var(--_toast-bg-color);border:var(--border-width-default) solid var(--_toast-border);border-left:var(--toast-bar-w) solid var(--_toast-bar-color);border-radius:var(--radius-lg);padding:var(--space-3) var(--space-4);box-shadow:var(--shadow-toast);min-width:var(--_toast-min-width);max-width:var(--_toast-max-width);animation-name:var(--_toast-enter-keyframes);animation-duration:var(--_toast-enter-duration);animation-timing-function:var(--_toast-enter-easing)}@media(prefers-reduced-motion:reduce){.toast{--_toast-enter-duration: 0ms}}.toast .icon{color:var(--_toast-icon-color);flex-shrink:0;align-self:center}.toast .body{flex:1;min-width:0;overflow-wrap:anywhere;font:var(--font-weight-regular) var(--font-size-s)/var(--line-height-base) var(--font-sans);color:var(--text-secondary)}.toast .title{font-weight:var(--font-weight-bold);color:var(--text-primary);margin-bottom:var(--space-0-5)}.toast .close{border:0;background:transparent;color:var(--icon-default);cursor:pointer;padding:var(--space-0-5)}.toast .close:active:not(:disabled,[disabled],.is-disabled){filter:brightness(var(--ds-press-brightness, .9));transform:scale(var(--ds-press-scale, .97))}.toast .action{flex-shrink:0;align-self:center;border:0;background:transparent;color:var(--accent-strong);font:var(--font-weight-bold) var(--font-size-s)/var(--line-height-flat) var(--font-sans);cursor:pointer;padding:var(--space-1) var(--space-2);border-radius:var(--ds-radius-inner)}.toast .action:hover{background:var(--surface-secondary)}.toast .action: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)}.toast .actions{display:inline-flex;align-items:center;gap:var(--space-2);flex-shrink:0}.toast .actions:empty{display:none}.toast.info{--_toast-bg-color: var(--ds-toast-bg-color-info, var(--ds-toast-bg-color, var(--surface-overlay)));--_toast-border: var(--ds-toast-border-color-info, var(--ds-toast-border-color, var(--border-default)));--_toast-bar-color: var(--ds-toast-bar-color, var(--accent));--_toast-icon-color: var(--ds-toast-icon-color, var(--accent));border-left-color:var(--_toast-bar-color)}.toast.success{--_toast-bg-color: var(--ds-toast-bg-color-success, var(--ds-toast-bg-color, var(--surface-overlay)));--_toast-border: var(--ds-toast-border-color-success, var(--ds-toast-border-color, var(--border-default)));--_toast-bar-color: var(--ds-toast-bar-color, var(--success));--_toast-icon-color: var(--ds-toast-icon-color, var(--success));border-left-color:var(--_toast-bar-color)}.toast.success .icon{color:var(--_toast-icon-color)}.toast.warning{--_toast-bg-color: var(--ds-toast-bg-color-warning, var(--ds-toast-bg-color, var(--surface-overlay)));--_toast-border: var(--ds-toast-border-color-warning, var(--ds-toast-border-color, var(--border-default)));--_toast-bar-color: var(--ds-toast-bar-color, var(--warning-hover));--_toast-icon-color: var(--ds-toast-icon-color, var(--warning-hover));border-left-color:var(--_toast-bar-color)}.toast.warning .icon{color:var(--_toast-icon-color)}.toast.error{--_toast-bg-color: var(--ds-toast-bg-color-error, var(--ds-toast-bg-color, var(--surface-overlay)));--_toast-border: var(--ds-toast-border-color-error, var(--ds-toast-border-color, var(--border-default)));--_toast-bar-color: var(--ds-toast-bar-color, var(--error));--_toast-icon-color: var(--ds-toast-icon-color, var(--error));border-left-color:var(--_toast-bar-color)}.toast.error .icon{color:var(--_toast-icon-color)}.toast.loading{border-left-color:var(--accent)}.toast.loading .icon{color:var(--accent)}\n"], dependencies: [{ kind: "component", type: IconComponent, selector: "ds-icon", inputs: ["name", "size", "stroke", "ariaLabel"] }, { kind: "component", type: SpinnerComponent, selector: "ds-spinner", inputs: ["size"] }] });
58
+ }
59
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: ToastComponent, decorators: [{
60
+ type: Component,
61
+ args: [{ selector: 'ds-toast', standalone: true, imports: [IconComponent, SpinnerComponent], encapsulation: ViewEncapsulation.Emulated, template: "<!-- No role or aria-live: a region created with its text already in it announces\n nothing, so ToastService speaks through the CDK LiveAnnouncer. A hand-placed\n <ds-toast> is therefore silent to a reader \u2014 it is a specimen, not an event. -->\n<div [class]=\"classes()\">\n @if (isLoading()) {\n <!-- aria-hidden because ds-spinner is a role=\"status\" of its own: the message is\n announced by ToastService, and a nested live region would speak twice. -->\n <ds-spinner\n class=\"icon\"\n size=\"sm\"\n aria-hidden=\"true\" />\n } @else {\n <ds-icon\n class=\"icon\"\n [name]=\"icon() ?? defaultIcon()\"\n [size]=\"16\" />\n }\n\n <div class=\"body\">\n @if (title()) {\n <div class=\"title\">\n {{ title() }}\n </div>\n }\n {{ body() }}\n <ng-content></ng-content>\n </div>\n\n @if (action(); as act) {\n <button\n type=\"button\"\n class=\"action\"\n (click)=\"onAction(act)\">\n {{ act.label }}\n </button>\n }\n\n <span class=\"actions\">\n <ng-content select=\"[actions]\"></ng-content>\n </span>\n\n @if (dismissible()) {\n <button\n type=\"button\"\n class=\"close\"\n aria-label=\"Dismiss\"\n (click)=\"onDismiss()\">\n <ds-icon\n name=\"x\"\n [size]=\"14\" />\n </button>\n }\n</div>\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)}}:host{--_toast-leave-duration: var(--ds-toast-leave-duration, var(--duration-base));--_toast-leave-easing: var(--ds-toast-leave-easing, var(--ease-standard));--_toast-shift-duration: var(--ds-toast-shift-duration, var(--duration-fast));--_toast-shift-easing: var(--ds-toast-shift-easing, var(--ease-standard));display:block;transition:opacity var(--_toast-leave-duration) var(--_toast-leave-easing),transform var(--_toast-shift-duration) var(--_toast-shift-easing)}:host(.leaving){opacity:0;transform:translateY(calc(var(--space-2) * -1));pointer-events:none;transition:opacity var(--_toast-leave-duration) var(--_toast-leave-easing),transform var(--_toast-leave-duration) var(--_toast-leave-easing)}:host(.shifting){transform:translateY(var(--_toast-shift, 0));transition:none}.toast{--_toast-bg-color: var(--ds-toast-bg-color, var(--surface-overlay));--_toast-border: var(--ds-toast-border-color, var(--border-default));--_toast-bar-color: var(--ds-toast-bar-color, var(--accent));--_toast-icon-color: var(--ds-toast-icon-color, var(--accent));--_toast-enter-keyframes: var(--ds-toast-enter-keyframes, ds-slide-in);--_toast-enter-duration: var(--ds-toast-enter-duration, var(--ds-motion-enter-large-duration));--_toast-enter-easing: var(--ds-toast-enter-easing, var(--ds-motion-enter-large-easing));--_toast-enter-offset: var(--ds-toast-enter-offset, var(--space-2));--_toast-min-width: var(--ds-toast-min-width, var(--toast-minw));--_toast-max-width: var(--ds-toast-max-width, var(--toast-maxw));--_ds-enter-y: var(--_toast-enter-offset);--_ds-enter-scale: var(--ds-toast-enter-scale, .96);display:flex;align-items:flex-start;gap:var(--space-3);background-color:var(--_toast-bg-color);border:var(--border-width-default) solid var(--_toast-border);border-left:var(--toast-bar-w) solid var(--_toast-bar-color);border-radius:var(--radius-lg);padding:var(--space-3) var(--space-4);box-shadow:var(--shadow-toast);min-width:var(--_toast-min-width);max-width:var(--_toast-max-width);animation-name:var(--_toast-enter-keyframes);animation-duration:var(--_toast-enter-duration);animation-timing-function:var(--_toast-enter-easing)}@media(prefers-reduced-motion:reduce){.toast{--_toast-enter-duration: 0ms}}.toast .icon{color:var(--_toast-icon-color);flex-shrink:0;align-self:center}.toast .body{flex:1;min-width:0;overflow-wrap:anywhere;font:var(--font-weight-regular) var(--font-size-s)/var(--line-height-base) var(--font-sans);color:var(--text-secondary)}.toast .title{font-weight:var(--font-weight-bold);color:var(--text-primary);margin-bottom:var(--space-0-5)}.toast .close{border:0;background:transparent;color:var(--icon-default);cursor:pointer;padding:var(--space-0-5)}.toast .close:active:not(:disabled,[disabled],.is-disabled){filter:brightness(var(--ds-press-brightness, .9));transform:scale(var(--ds-press-scale, .97))}.toast .action{flex-shrink:0;align-self:center;border:0;background:transparent;color:var(--accent-strong);font:var(--font-weight-bold) var(--font-size-s)/var(--line-height-flat) var(--font-sans);cursor:pointer;padding:var(--space-1) var(--space-2);border-radius:var(--ds-radius-inner)}.toast .action:hover{background:var(--surface-secondary)}.toast .action: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)}.toast .actions{display:inline-flex;align-items:center;gap:var(--space-2);flex-shrink:0}.toast .actions:empty{display:none}.toast.info{--_toast-bg-color: var(--ds-toast-bg-color-info, var(--ds-toast-bg-color, var(--surface-overlay)));--_toast-border: var(--ds-toast-border-color-info, var(--ds-toast-border-color, var(--border-default)));--_toast-bar-color: var(--ds-toast-bar-color, var(--accent));--_toast-icon-color: var(--ds-toast-icon-color, var(--accent));border-left-color:var(--_toast-bar-color)}.toast.success{--_toast-bg-color: var(--ds-toast-bg-color-success, var(--ds-toast-bg-color, var(--surface-overlay)));--_toast-border: var(--ds-toast-border-color-success, var(--ds-toast-border-color, var(--border-default)));--_toast-bar-color: var(--ds-toast-bar-color, var(--success));--_toast-icon-color: var(--ds-toast-icon-color, var(--success));border-left-color:var(--_toast-bar-color)}.toast.success .icon{color:var(--_toast-icon-color)}.toast.warning{--_toast-bg-color: var(--ds-toast-bg-color-warning, var(--ds-toast-bg-color, var(--surface-overlay)));--_toast-border: var(--ds-toast-border-color-warning, var(--ds-toast-border-color, var(--border-default)));--_toast-bar-color: var(--ds-toast-bar-color, var(--warning-hover));--_toast-icon-color: var(--ds-toast-icon-color, var(--warning-hover));border-left-color:var(--_toast-bar-color)}.toast.warning .icon{color:var(--_toast-icon-color)}.toast.error{--_toast-bg-color: var(--ds-toast-bg-color-error, var(--ds-toast-bg-color, var(--surface-overlay)));--_toast-border: var(--ds-toast-border-color-error, var(--ds-toast-border-color, var(--border-default)));--_toast-bar-color: var(--ds-toast-bar-color, var(--error));--_toast-icon-color: var(--ds-toast-icon-color, var(--error));border-left-color:var(--_toast-bar-color)}.toast.error .icon{color:var(--_toast-icon-color)}.toast.loading{border-left-color:var(--accent)}.toast.loading .icon{color:var(--accent)}\n"] }]
62
+ }], propDecorators: { variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], body: [{ type: i0.Input, args: [{ isSignal: true, alias: "body", required: false }] }], dismissible: [{ type: i0.Input, args: [{ isSignal: true, alias: "dismissible", required: false }] }], icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], action: [{ type: i0.Input, args: [{ isSignal: true, alias: "action", required: false }] }], closed: [{ type: i0.Output, args: ["closed"] }] } });
63
+
64
+ // Only the floor: see leaveDuration(), which reads the real length off the node.
65
+ const LEAVE_FALLBACK_MS = 180;
66
+ // A toast whose clock ran out while the pointer was over it should not vanish the
67
+ // instant the pointer leaves — the reader gets this much to see it go.
68
+ const MIN_RESUME_MS = 600;
69
+ const DEFAULT_MAX_VISIBLE = 5;
70
+ class ToastRegionComponent {
71
+ /** Cap on concurrently visible toasts. Extras are queued and shown as
72
+ * earlier ones dismiss. `0` = unlimited. */
73
+ maxVisible = input(DEFAULT_MAX_VISIBLE, ...(ngDevMode ? [{ debugName: "maxVisible" }] : /* istanbul ignore next */ []));
74
+ visibleEntries = signal([], ...(ngDevMode ? [{ debugName: "visibleEntries" }] : /* istanbul ignore next */ []));
75
+ leaving = signal(new Set(), ...(ngDevMode ? [{ debugName: "leaving" }] : /* istanbul ignore next */ []));
76
+ pendingQueue = [];
77
+ timers = new Map();
78
+ leaveTimers = new Map();
79
+ remaining = new Map();
80
+ startedAt = new Map();
81
+ hovered = false;
82
+ focusWithin = false;
83
+ host = inject(ElementRef);
84
+ position = inject(DS_CONFIG).toast?.position;
85
+ constructor() {
86
+ if (typeof ngDevMode === 'undefined' || ngDevMode) {
87
+ devWarn(() => this.maxVisible() < 0
88
+ ? `<ds-toast-region> maxVisible is ${this.maxVisible()}; a negative cap means unlimited, which is what 0 says. Pass 0 if that is the intent.`
89
+ : null);
90
+ }
91
+ effect(() => {
92
+ this.maxVisible();
93
+ this.drainQueue();
94
+ });
95
+ // An uncancelled timer fires into a destroyed component: invisible in an app that
96
+ // never tears the root down, a stream of "N timers still in the queue" under fakeAsync.
97
+ inject(DestroyRef).onDestroy(() => {
98
+ this.timers.forEach((timer) => window.clearTimeout(timer));
99
+ this.leaveTimers.forEach((timer) => window.clearTimeout(timer));
100
+ this.timers.clear();
101
+ this.leaveTimers.clear();
102
+ });
103
+ }
104
+ /** Newest goes NEAREST the anchor, so the toast that just fired appears where the
105
+ * stack is pinned rather than at the far end of a list the reader has to hunt
106
+ * down. DOM order is the visual order, so this also keeps the reading order. */
107
+ newestFirst = (this.position?.verticalPosition ??
108
+ DS_TOAST_POSITION_DEFAULT.verticalPosition) === 'top';
109
+ add(entry) {
110
+ const limit = this.maxVisible();
111
+ if (limit > 0 && this.visibleEntries().length >= limit) {
112
+ this.pendingQueue.push(entry);
113
+ return;
114
+ }
115
+ this.show(entry);
116
+ }
117
+ show(entry) {
118
+ const before = this.measureTops();
119
+ this.visibleEntries.update((existing) => this.newestFirst ? [entry, ...existing] : [...existing, entry]);
120
+ this.arm(entry.id, entry.durationMs);
121
+ this.slideNeighbours(before);
122
+ }
123
+ /** FLIP, rather than the usual absolute stack: absolute positioning collapses the region
124
+ * to zero height, and it lives in a CDK pane sized to its content, so the hit area goes
125
+ * with it. */
126
+ slideNeighbours(before) {
127
+ if (!before.size) {
128
+ return;
129
+ }
130
+ requestAnimationFrame(() => {
131
+ const nodes = this.toastNodes();
132
+ const deltas = [];
133
+ for (const [id, node] of nodes) {
134
+ const previousTop = before.get(id);
135
+ if (previousTop === undefined) {
136
+ continue;
137
+ }
138
+ const delta = previousTop - node.getBoundingClientRect().top;
139
+ if (delta) {
140
+ deltas.push([node, delta]);
141
+ }
142
+ }
143
+ for (const [node, delta] of deltas) {
144
+ node.style.setProperty('--_toast-shift', `${delta}px`);
145
+ node.classList.add('shifting');
146
+ }
147
+ requestAnimationFrame(() => {
148
+ for (const [node] of deltas) {
149
+ node.classList.remove('shifting');
150
+ node.style.removeProperty('--_toast-shift');
151
+ }
152
+ });
153
+ });
154
+ }
155
+ toastNodes() {
156
+ const nodes = new Map();
157
+ const elements = this.host.nativeElement.querySelectorAll('ds-toast');
158
+ this.visibleEntries().forEach((entry, index) => {
159
+ const node = elements[index];
160
+ if (node) {
161
+ nodes.set(entry.id, node);
162
+ }
163
+ });
164
+ return nodes;
165
+ }
166
+ measureTops() {
167
+ const tops = new Map();
168
+ for (const [id, node] of this.toastNodes()) {
169
+ tops.set(id, node.getBoundingClientRect().top);
170
+ }
171
+ return tops;
172
+ }
173
+ arm(id, remaining) {
174
+ if (remaining <= 0) {
175
+ return;
176
+ }
177
+ this.remaining.set(id, remaining);
178
+ // A toast can be armed with no user event anywhere near it — drainQueue runs from a
179
+ // timeout — so this has to bank rather than trust that a pause event will follow.
180
+ if (this.hovered || this.focusWithin) {
181
+ this.startedAt.delete(id);
182
+ return;
183
+ }
184
+ this.startedAt.set(id, Date.now());
185
+ const existing = this.timers.get(id);
186
+ if (existing !== undefined) {
187
+ window.clearTimeout(existing);
188
+ }
189
+ this.timers.set(id, window.setTimeout(() => this.remove(id), remaining));
190
+ }
191
+ clearCountdown(id) {
192
+ const timer = this.timers.get(id);
193
+ if (timer !== undefined) {
194
+ window.clearTimeout(timer);
195
+ this.timers.delete(id);
196
+ }
197
+ this.remaining.delete(id);
198
+ this.startedAt.delete(id);
199
+ }
200
+ onHover(entered) {
201
+ this.hovered = entered;
202
+ this.syncPause();
203
+ }
204
+ // `focusout` bubbles, so it also fires when focus moves BETWEEN elements inside the region —
205
+ // tabbing from the action to the close button. Without the containment check that reads as
206
+ // leaving, and every round trip re-floors the remainder at MIN_RESUME_MS.
207
+ onFocusWithin(event) {
208
+ this.focusWithin =
209
+ event === true ||
210
+ (event.relatedTarget instanceof Node &&
211
+ this.host.nativeElement.contains(event.relatedTarget));
212
+ this.syncPause();
213
+ }
214
+ syncPause() {
215
+ const shouldPause = this.hovered || this.focusWithin;
216
+ if (shouldPause === this.paused) {
217
+ return;
218
+ }
219
+ if (shouldPause) {
220
+ this.pauseAll();
221
+ }
222
+ else {
223
+ this.resumeAll();
224
+ }
225
+ }
226
+ get paused() {
227
+ return this.timers.size === 0 && this.remaining.size > 0;
228
+ }
229
+ pauseAll() {
230
+ const now = Date.now();
231
+ for (const [id, timer] of this.timers) {
232
+ window.clearTimeout(timer);
233
+ const left = (this.remaining.get(id) ?? 0) - (now - (this.startedAt.get(id) ?? now));
234
+ this.remaining.set(id, Math.max(left, MIN_RESUME_MS));
235
+ }
236
+ this.timers.clear();
237
+ }
238
+ resumeAll() {
239
+ for (const [id, left] of [...this.remaining]) {
240
+ this.arm(id, left);
241
+ }
242
+ }
243
+ /** Replace fields of an already-visible or queued toast in place. Patching
244
+ * `durationMs` restarts the clock, and on a QUEUED toast it takes effect only on
245
+ * promotion — otherwise a duration would burn down while the toast is invisible. */
246
+ update(id, patch) {
247
+ const inVisible = this.visibleEntries().some((entry) => entry.id === id);
248
+ if (inVisible) {
249
+ this.visibleEntries.update((entries) => entries.map((entry) => entry.id === id ? { ...entry, ...patch } : entry));
250
+ if (patch.durationMs !== undefined) {
251
+ this.clearCountdown(id);
252
+ this.arm(id, patch.durationMs);
253
+ }
254
+ return;
255
+ }
256
+ const queueIndex = this.pendingQueue.findIndex((entry) => entry.id === id);
257
+ if (queueIndex !== -1) {
258
+ this.pendingQueue[queueIndex] = {
259
+ ...this.pendingQueue[queueIndex],
260
+ ...patch,
261
+ };
262
+ }
263
+ }
264
+ remove(id) {
265
+ // A `ToastRef` outlives its toast, so dismiss() can arrive for an id nothing holds.
266
+ const isVisible = this.visibleEntries().some((entry) => entry.id === id);
267
+ const queueIndex = this.pendingQueue.findIndex((entry) => entry.id === id);
268
+ if (!isVisible && queueIndex === -1) {
269
+ return;
270
+ }
271
+ this.clearCountdown(id);
272
+ if (queueIndex !== -1) {
273
+ this.pendingQueue.splice(queueIndex, 1);
274
+ return;
275
+ }
276
+ if (this.leaving().has(id)) {
277
+ return;
278
+ }
279
+ this.leaving.update((set) => new Set(set).add(id));
280
+ this.leaveTimers.set(id, window.setTimeout(() => {
281
+ this.leaveTimers.delete(id);
282
+ this.visibleEntries.update((existing) => existing.filter((entry) => entry.id !== id));
283
+ this.leaving.update((set) => {
284
+ const next = new Set(set);
285
+ next.delete(id);
286
+ return next;
287
+ });
288
+ this.drainQueue();
289
+ }, this.leaveDuration(id)));
290
+ }
291
+ /** The leave transition is a public token, so its length is whatever the consumer
292
+ * set — read it off the node rather than assuming. Reduced motion zeroes it, which
293
+ * is why the floor applies only when there is nothing to measure. */
294
+ leaveDuration(id) {
295
+ const node = this.toastNodes().get(id);
296
+ if (!node) {
297
+ return LEAVE_FALLBACK_MS;
298
+ }
299
+ const declared = getComputedStyle(node)
300
+ .transitionDuration.split(',')
301
+ .map((part) => parseFloat(part) * 1000)
302
+ .filter((ms) => !Number.isNaN(ms));
303
+ return declared.length ? Math.max(...declared) : LEAVE_FALLBACK_MS;
304
+ }
305
+ isLeaving(id) {
306
+ return this.leaving().has(id);
307
+ }
308
+ clear() {
309
+ this.timers.forEach((timer) => window.clearTimeout(timer));
310
+ this.leaveTimers.forEach((timer) => window.clearTimeout(timer));
311
+ this.timers.clear();
312
+ this.leaveTimers.clear();
313
+ this.remaining.clear();
314
+ this.startedAt.clear();
315
+ this.visibleEntries.set([]);
316
+ this.leaving.set(new Set());
317
+ this.pendingQueue.length = 0;
318
+ }
319
+ drainQueue() {
320
+ while (this.pendingQueue.length) {
321
+ const limit = this.maxVisible();
322
+ if (limit > 0 && this.visibleEntries().length >= limit) {
323
+ return;
324
+ }
325
+ this.show(this.pendingQueue.shift());
326
+ }
327
+ }
328
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: ToastRegionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
329
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.22", type: ToastRegionComponent, isStandalone: true, selector: "ds-toast-region", inputs: { maxVisible: { classPropertyName: "maxVisible", publicName: "maxVisible", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "region", "aria-label": "Notifications" }, listeners: { "mouseenter": "onHover(true)", "mouseleave": "onHover(false)", "focusin": "onFocusWithin(true)", "focusout": "onFocusWithin($event)" } }, ngImport: i0, template: "@for (entry of visibleEntries(); track entry.id) {\n <ds-toast\n [variant]=\"entry.variant\"\n [title]=\"entry.title ?? ''\"\n [body]=\"entry.body\"\n [dismissible]=\"entry.dismissible\"\n [action]=\"entry.action ?? null\"\n [class.leaving]=\"isLeaving(entry.id)\"\n (closed)=\"remove(entry.id)\" />\n}\n", styles: ["@charset \"UTF-8\";:host{display:flex;flex-direction:column;gap:var(--space-2)}\n"], dependencies: [{ kind: "component", type: ToastComponent, selector: "ds-toast", inputs: ["variant", "title", "body", "dismissible", "icon", "action"], outputs: ["closed"] }] });
330
+ }
331
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: ToastRegionComponent, decorators: [{
332
+ type: Component,
333
+ args: [{ selector: 'ds-toast-region', standalone: true, imports: [ToastComponent], encapsulation: ViewEncapsulation.Emulated, host: {
334
+ role: 'region',
335
+ 'aria-label': 'Notifications',
336
+ '(mouseenter)': 'onHover(true)',
337
+ '(mouseleave)': 'onHover(false)',
338
+ '(focusin)': 'onFocusWithin(true)',
339
+ '(focusout)': 'onFocusWithin($event)',
340
+ }, template: "@for (entry of visibleEntries(); track entry.id) {\n <ds-toast\n [variant]=\"entry.variant\"\n [title]=\"entry.title ?? ''\"\n [body]=\"entry.body\"\n [dismissible]=\"entry.dismissible\"\n [action]=\"entry.action ?? null\"\n [class.leaving]=\"isLeaving(entry.id)\"\n (closed)=\"remove(entry.id)\" />\n}\n", styles: ["@charset \"UTF-8\";:host{display:flex;flex-direction:column;gap:var(--space-2)}\n"] }]
341
+ }], ctorParameters: () => [], propDecorators: { maxVisible: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxVisible", required: false }] }] } });
342
+
343
+ // An error stays longer than a success: it usually needs reading, and often acting on.
344
+ const SETTLED_SUCCESS_MS = 4000;
345
+ const SETTLED_ERROR_MS = 6000;
346
+ // Has to outlast the loop that fires a burst, not any human interval.
347
+ const ANNOUNCE_COALESCE_MS = 120;
348
+ class ToastService {
349
+ overlay = inject(Overlay);
350
+ toastConfig = inject(DS_CONFIG).toast;
351
+ announcer = inject(LiveAnnouncer);
352
+ overlayRef = null;
353
+ regionRef = null;
354
+ nextId = 1;
355
+ pendingAnnouncements = [];
356
+ pendingAssertive = false;
357
+ announceTimer;
358
+ scrimWatcher = null;
359
+ constructor() {
360
+ inject(DestroyRef).onDestroy(() => {
361
+ clearTimeout(this.announceTimer);
362
+ this.scrimWatcher?.disconnect();
363
+ this.overlayRef?.dispose();
364
+ this.overlayRef = null;
365
+ this.regionRef = null;
366
+ });
367
+ }
368
+ show(opts) {
369
+ this.ensureRegion();
370
+ const id = this.nextId++;
371
+ const variant = opts.variant ?? 'info';
372
+ // An `action` toast cannot expire: that button is the only way to take the action,
373
+ // the region is the last child of `body`, and a keyboard user cannot cross a page
374
+ // to reach it inside five seconds.
375
+ const durationMs = variant === 'loading' || opts.action ? 0 : (opts.durationMs ?? 5000);
376
+ const entry = {
377
+ id,
378
+ title: opts.title,
379
+ body: opts.body,
380
+ variant,
381
+ // Nothing that cannot expire may also be unclosable, or it holds a slot for the
382
+ // life of the page — which is how a hung promise blocked the whole region.
383
+ dismissible: durationMs > 0 ? (opts.dismissible ?? true) : true,
384
+ action: opts.action,
385
+ durationMs,
386
+ };
387
+ // The region runs the countdown, because only it knows when the toast became
388
+ // visible — started here, one queued behind `maxVisible` expires unseen.
389
+ this.regionRef.instance.add(entry);
390
+ this.announce(variant, entry.body, entry.title);
391
+ return {
392
+ id,
393
+ dismiss: () => this.regionRef?.instance.remove(id),
394
+ };
395
+ }
396
+ /** Show a loading toast for the duration of `source`. Resolution and rejection are
397
+ * reflected in-place (same toast, no stack-up) as success/error variants, each with
398
+ * its own auto-dismiss delay.
399
+ *
400
+ * Returns `source` itself, so the caller still owns rejection handling — an
401
+ * un-`catch`ed call produces an unhandled rejection exactly as it would without a
402
+ * toast. */
403
+ promise(source, messages) {
404
+ const ref = this.show({
405
+ body: messages.loading,
406
+ variant: 'loading',
407
+ durationMs: 0,
408
+ });
409
+ // The duration goes to the region, for the reason given on `add()` above.
410
+ source.then((value) => {
411
+ const successBody = typeof messages.success === 'function'
412
+ ? messages.success(value)
413
+ : messages.success;
414
+ this.regionRef?.instance.update(ref.id, {
415
+ body: successBody,
416
+ variant: 'success',
417
+ dismissible: true,
418
+ durationMs: SETTLED_SUCCESS_MS,
419
+ });
420
+ this.announce('success', successBody);
421
+ }, (reason) => {
422
+ const errorBody = typeof messages.error === 'function'
423
+ ? messages.error(reason)
424
+ : messages.error;
425
+ this.regionRef?.instance.update(ref.id, {
426
+ body: errorBody,
427
+ variant: 'error',
428
+ dismissible: true,
429
+ durationMs: SETTLED_ERROR_MS,
430
+ });
431
+ this.announce('error', errorBody);
432
+ });
433
+ return source;
434
+ }
435
+ /** The announcement must NOT ride the visual toast: `aria-live` on an element created
436
+ * together with its text announces nothing in NVDA or JAWS. The CDK announcer's region
437
+ * exists from construction and only its text changes.
438
+ *
439
+ * Serialising a burst does not work either — `announce()` clears the region and writes
440
+ * on a timeout, resolving its promise inside that callback, so the next message wipes
441
+ * the previous one before anything can read it. One region change carrying every
442
+ * message is the only shape that survives. */
443
+ announce(variant, body, title) {
444
+ const spoken = [title, body].filter(Boolean).join('. ');
445
+ if (!spoken) {
446
+ return;
447
+ }
448
+ this.pendingAnnouncements.push(spoken);
449
+ if (variant === 'error' || variant === 'warning') {
450
+ this.pendingAssertive = true;
451
+ }
452
+ clearTimeout(this.announceTimer);
453
+ this.announceTimer = window.setTimeout(() => {
454
+ const message = this.pendingAnnouncements.join('. ');
455
+ const politeness = this.pendingAssertive ? 'assertive' : 'polite';
456
+ this.pendingAnnouncements = [];
457
+ this.pendingAssertive = false;
458
+ this.announcer.announce(message, politeness);
459
+ }, ANNOUNCE_COALESCE_MS);
460
+ }
461
+ dismissAll() {
462
+ this.regionRef?.instance.clear();
463
+ }
464
+ ensureRegion() {
465
+ if (this.overlayRef) {
466
+ return;
467
+ }
468
+ this.overlayRef = this.overlay.create({
469
+ hasBackdrop: false,
470
+ panelClass: 'ds-toast-panel',
471
+ positionStrategy: this.buildPositionStrategy(),
472
+ });
473
+ this.regionRef = this.overlayRef.attach(new ComponentPortal(ToastRegionComponent));
474
+ // `>= 0`, not truthiness: 0 is the only way to ask for an uncapped stack, so it has
475
+ // to reach the region rather than read as "unset".
476
+ const maxVisible = this.toastConfig?.maxVisible;
477
+ if (typeof maxVisible === 'number' && maxVisible >= 0) {
478
+ this.regionRef.setInput('maxVisible', maxVisible);
479
+ }
480
+ this.keepAboveScrims();
481
+ }
482
+ /** Keeps the toast above a scrim opened AFTER it. `--layer-toast` cannot: CDK gives
483
+ * every overlay host `popover="manual"`, and the browser's top layer paints in the
484
+ * order things were shown, ignoring z-index. Re-showing the host is the only lever.
485
+ *
486
+ * Scrimmed overlays only: the published layer scale puts `--layer-tooltip` above the
487
+ * toast. */
488
+ keepAboveScrims() {
489
+ const host = this.overlayRef?.hostElement;
490
+ const container = host?.parentElement;
491
+ if (!host || !container || typeof host.showPopover !== 'function') {
492
+ return;
493
+ }
494
+ this.scrimWatcher = new MutationObserver((records) => {
495
+ const scrimAppeared = records.some((record) => [...record.addedNodes].some((node) => node instanceof HTMLElement &&
496
+ node !== host &&
497
+ (node.classList.contains('cdk-overlay-backdrop') ||
498
+ node.querySelector?.('.cdk-overlay-backdrop'))));
499
+ if (!scrimAppeared || !host.isConnected) {
500
+ return;
501
+ }
502
+ // The top layer has no "raise"; nothing paints between these two calls.
503
+ try {
504
+ host.hidePopover();
505
+ host.showPopover();
506
+ }
507
+ catch {
508
+ // The host may not be showing, and hidePopover() throws when it is not.
509
+ }
510
+ });
511
+ this.scrimWatcher.observe(container, { childList: true, subtree: true });
512
+ }
513
+ buildPositionStrategy() {
514
+ const config = {
515
+ ...DS_TOAST_POSITION_DEFAULT,
516
+ ...this.toastConfig?.position,
517
+ };
518
+ const strategy = this.overlay.position().global();
519
+ if (config.verticalPosition === 'top') {
520
+ strategy.top(config.offset);
521
+ }
522
+ else {
523
+ strategy.bottom(config.offset);
524
+ }
525
+ if (config.horizontalPosition === 'left') {
526
+ strategy.left(config.offset);
527
+ }
528
+ else if (config.horizontalPosition === 'right') {
529
+ strategy.right(config.offset);
530
+ }
531
+ else {
532
+ strategy.centerHorizontally();
533
+ }
534
+ return strategy;
535
+ }
536
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: ToastService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
537
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: ToastService, providedIn: 'root' });
538
+ }
539
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImport: i0, type: ToastService, decorators: [{
540
+ type: Injectable,
541
+ args: [{ providedIn: 'root' }]
542
+ }], ctorParameters: () => [] });
543
+
544
+ /**
545
+ * Generated bundle index. Do not edit.
546
+ */
547
+
548
+ export { DS_TOAST_POSITION_DEFAULT, ToastComponent, ToastRegionComponent, ToastService };
549
+ //# sourceMappingURL=ids-group-ltd-ids-design-system-components-toast.mjs.map