@cdevhub/ngx-tw 0.4.0 → 0.6.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 (209) hide show
  1. package/README.md +78 -15
  2. package/fesm2022/cdevhub-ngx-tw-accordion.mjs +16 -5
  3. package/fesm2022/cdevhub-ngx-tw-accordion.mjs.map +1 -1
  4. package/fesm2022/cdevhub-ngx-tw-avatar.mjs +26 -15
  5. package/fesm2022/cdevhub-ngx-tw-avatar.mjs.map +1 -1
  6. package/fesm2022/cdevhub-ngx-tw-badge.mjs +17 -5
  7. package/fesm2022/cdevhub-ngx-tw-badge.mjs.map +1 -1
  8. package/fesm2022/cdevhub-ngx-tw-breadcrumbs.mjs +27 -6
  9. package/fesm2022/cdevhub-ngx-tw-breadcrumbs.mjs.map +1 -1
  10. package/fesm2022/cdevhub-ngx-tw-button.mjs +23 -11
  11. package/fesm2022/cdevhub-ngx-tw-button.mjs.map +1 -1
  12. package/fesm2022/cdevhub-ngx-tw-calendar-luxon.mjs +5 -5
  13. package/fesm2022/cdevhub-ngx-tw-calendar-luxon.mjs.map +1 -1
  14. package/fesm2022/cdevhub-ngx-tw-calendar-testing.mjs +3 -3
  15. package/fesm2022/cdevhub-ngx-tw-calendar-testing.mjs.map +1 -1
  16. package/fesm2022/cdevhub-ngx-tw-calendar.mjs +427 -122
  17. package/fesm2022/cdevhub-ngx-tw-calendar.mjs.map +1 -1
  18. package/fesm2022/cdevhub-ngx-tw-card.mjs +21 -11
  19. package/fesm2022/cdevhub-ngx-tw-card.mjs.map +1 -1
  20. package/fesm2022/cdevhub-ngx-tw-carousel.mjs +215 -96
  21. package/fesm2022/cdevhub-ngx-tw-carousel.mjs.map +1 -1
  22. package/fesm2022/cdevhub-ngx-tw-checkbox.mjs +108 -64
  23. package/fesm2022/cdevhub-ngx-tw-checkbox.mjs.map +1 -1
  24. package/fesm2022/cdevhub-ngx-tw-code-block.mjs +18 -6
  25. package/fesm2022/cdevhub-ngx-tw-code-block.mjs.map +1 -1
  26. package/fesm2022/cdevhub-ngx-tw-collapsible.mjs +55 -30
  27. package/fesm2022/cdevhub-ngx-tw-collapsible.mjs.map +1 -1
  28. package/fesm2022/cdevhub-ngx-tw-combobox-testing.mjs +218 -0
  29. package/fesm2022/cdevhub-ngx-tw-combobox-testing.mjs.map +1 -0
  30. package/fesm2022/cdevhub-ngx-tw-combobox.mjs +236 -211
  31. package/fesm2022/cdevhub-ngx-tw-combobox.mjs.map +1 -1
  32. package/fesm2022/cdevhub-ngx-tw-command-palette-testing.mjs +200 -0
  33. package/fesm2022/cdevhub-ngx-tw-command-palette-testing.mjs.map +1 -0
  34. package/fesm2022/cdevhub-ngx-tw-command-palette.mjs +34 -7
  35. package/fesm2022/cdevhub-ngx-tw-command-palette.mjs.map +1 -1
  36. package/fesm2022/cdevhub-ngx-tw-core.mjs +135 -15
  37. package/fesm2022/cdevhub-ngx-tw-core.mjs.map +1 -1
  38. package/fesm2022/cdevhub-ngx-tw-date-picker-testing.mjs +203 -0
  39. package/fesm2022/cdevhub-ngx-tw-date-picker-testing.mjs.map +1 -0
  40. package/fesm2022/cdevhub-ngx-tw-date-picker.mjs +160 -102
  41. package/fesm2022/cdevhub-ngx-tw-date-picker.mjs.map +1 -1
  42. package/fesm2022/cdevhub-ngx-tw-date-range-picker-testing.mjs +209 -0
  43. package/fesm2022/cdevhub-ngx-tw-date-range-picker-testing.mjs.map +1 -0
  44. package/fesm2022/cdevhub-ngx-tw-date-range-picker.mjs +182 -107
  45. package/fesm2022/cdevhub-ngx-tw-date-range-picker.mjs.map +1 -1
  46. package/fesm2022/cdevhub-ngx-tw-dialog-dialog-renderer-DoIhoV3d.mjs +198 -0
  47. package/fesm2022/cdevhub-ngx-tw-dialog-dialog-renderer-DoIhoV3d.mjs.map +1 -0
  48. package/fesm2022/cdevhub-ngx-tw-dialog-testing.mjs +122 -0
  49. package/fesm2022/cdevhub-ngx-tw-dialog-testing.mjs.map +1 -0
  50. package/fesm2022/cdevhub-ngx-tw-dialog.mjs +199 -220
  51. package/fesm2022/cdevhub-ngx-tw-dialog.mjs.map +1 -1
  52. package/fesm2022/cdevhub-ngx-tw-empty-state.mjs +1 -1
  53. package/fesm2022/cdevhub-ngx-tw-empty-state.mjs.map +1 -1
  54. package/fesm2022/cdevhub-ngx-tw-file-upload-testing.mjs +149 -0
  55. package/fesm2022/cdevhub-ngx-tw-file-upload-testing.mjs.map +1 -0
  56. package/fesm2022/cdevhub-ngx-tw-file-upload.mjs +57 -67
  57. package/fesm2022/cdevhub-ngx-tw-file-upload.mjs.map +1 -1
  58. package/fesm2022/cdevhub-ngx-tw-flip-card.mjs +42 -24
  59. package/fesm2022/cdevhub-ngx-tw-flip-card.mjs.map +1 -1
  60. package/fesm2022/cdevhub-ngx-tw-form-field.mjs +114 -21
  61. package/fesm2022/cdevhub-ngx-tw-form-field.mjs.map +1 -1
  62. package/fesm2022/cdevhub-ngx-tw-icon.mjs +16 -6
  63. package/fesm2022/cdevhub-ngx-tw-icon.mjs.map +1 -1
  64. package/fesm2022/cdevhub-ngx-tw-input.mjs +52 -61
  65. package/fesm2022/cdevhub-ngx-tw-input.mjs.map +1 -1
  66. package/fesm2022/cdevhub-ngx-tw-item.mjs +18 -3
  67. package/fesm2022/cdevhub-ngx-tw-item.mjs.map +1 -1
  68. package/fesm2022/cdevhub-ngx-tw-menu-testing.mjs +168 -0
  69. package/fesm2022/cdevhub-ngx-tw-menu-testing.mjs.map +1 -0
  70. package/fesm2022/cdevhub-ngx-tw-menu.mjs +58 -21
  71. package/fesm2022/cdevhub-ngx-tw-menu.mjs.map +1 -1
  72. package/fesm2022/cdevhub-ngx-tw-number-input.mjs +34 -1
  73. package/fesm2022/cdevhub-ngx-tw-number-input.mjs.map +1 -1
  74. package/fesm2022/cdevhub-ngx-tw-paginator.mjs +95 -45
  75. package/fesm2022/cdevhub-ngx-tw-paginator.mjs.map +1 -1
  76. package/fesm2022/cdevhub-ngx-tw-popover.mjs +81 -32
  77. package/fesm2022/cdevhub-ngx-tw-popover.mjs.map +1 -1
  78. package/fesm2022/cdevhub-ngx-tw-progress-bar.mjs +1 -1
  79. package/fesm2022/cdevhub-ngx-tw-progress-bar.mjs.map +1 -1
  80. package/fesm2022/cdevhub-ngx-tw-radio.mjs +131 -98
  81. package/fesm2022/cdevhub-ngx-tw-radio.mjs.map +1 -1
  82. package/fesm2022/cdevhub-ngx-tw-segmented-control.mjs +207 -42
  83. package/fesm2022/cdevhub-ngx-tw-segmented-control.mjs.map +1 -1
  84. package/fesm2022/cdevhub-ngx-tw-select-testing.mjs +165 -0
  85. package/fesm2022/cdevhub-ngx-tw-select-testing.mjs.map +1 -0
  86. package/fesm2022/cdevhub-ngx-tw-select.mjs +386 -210
  87. package/fesm2022/cdevhub-ngx-tw-select.mjs.map +1 -1
  88. package/fesm2022/cdevhub-ngx-tw-sheet-sheet-renderer-CqVJwgmp.mjs +256 -0
  89. package/fesm2022/cdevhub-ngx-tw-sheet-sheet-renderer-CqVJwgmp.mjs.map +1 -0
  90. package/fesm2022/cdevhub-ngx-tw-sheet-testing.mjs +129 -0
  91. package/fesm2022/cdevhub-ngx-tw-sheet-testing.mjs.map +1 -0
  92. package/fesm2022/cdevhub-ngx-tw-sheet.mjs +197 -278
  93. package/fesm2022/cdevhub-ngx-tw-sheet.mjs.map +1 -1
  94. package/fesm2022/cdevhub-ngx-tw-slider.mjs +89 -54
  95. package/fesm2022/cdevhub-ngx-tw-slider.mjs.map +1 -1
  96. package/fesm2022/cdevhub-ngx-tw-sort.mjs +122 -17
  97. package/fesm2022/cdevhub-ngx-tw-sort.mjs.map +1 -1
  98. package/fesm2022/cdevhub-ngx-tw-split.mjs +72 -19
  99. package/fesm2022/cdevhub-ngx-tw-split.mjs.map +1 -1
  100. package/fesm2022/cdevhub-ngx-tw-stat.mjs +63 -25
  101. package/fesm2022/cdevhub-ngx-tw-stat.mjs.map +1 -1
  102. package/fesm2022/cdevhub-ngx-tw-stepper.mjs +35 -8
  103. package/fesm2022/cdevhub-ngx-tw-stepper.mjs.map +1 -1
  104. package/fesm2022/cdevhub-ngx-tw-switch.mjs +54 -48
  105. package/fesm2022/cdevhub-ngx-tw-switch.mjs.map +1 -1
  106. package/fesm2022/cdevhub-ngx-tw-tab-nav.mjs +12 -15
  107. package/fesm2022/cdevhub-ngx-tw-tab-nav.mjs.map +1 -1
  108. package/fesm2022/cdevhub-ngx-tw-table.mjs +74 -13
  109. package/fesm2022/cdevhub-ngx-tw-table.mjs.map +1 -1
  110. package/fesm2022/cdevhub-ngx-tw-tabs.mjs +84 -30
  111. package/fesm2022/cdevhub-ngx-tw-tabs.mjs.map +1 -1
  112. package/fesm2022/cdevhub-ngx-tw-tags-input-testing.mjs +172 -0
  113. package/fesm2022/cdevhub-ngx-tw-tags-input-testing.mjs.map +1 -0
  114. package/fesm2022/cdevhub-ngx-tw-tags-input.mjs +107 -71
  115. package/fesm2022/cdevhub-ngx-tw-tags-input.mjs.map +1 -1
  116. package/fesm2022/cdevhub-ngx-tw-textarea.mjs +41 -9
  117. package/fesm2022/cdevhub-ngx-tw-textarea.mjs.map +1 -1
  118. package/fesm2022/cdevhub-ngx-tw-theme.mjs +257 -45
  119. package/fesm2022/cdevhub-ngx-tw-theme.mjs.map +1 -1
  120. package/fesm2022/cdevhub-ngx-tw-time-picker-testing.mjs +201 -0
  121. package/fesm2022/cdevhub-ngx-tw-time-picker-testing.mjs.map +1 -0
  122. package/fesm2022/cdevhub-ngx-tw-time-picker.mjs +184 -77
  123. package/fesm2022/cdevhub-ngx-tw-time-picker.mjs.map +1 -1
  124. package/fesm2022/cdevhub-ngx-tw-timeline.mjs +110 -27
  125. package/fesm2022/cdevhub-ngx-tw-timeline.mjs.map +1 -1
  126. package/fesm2022/cdevhub-ngx-tw-toast-toast-renderer-BlDxemsU.mjs +616 -0
  127. package/fesm2022/cdevhub-ngx-tw-toast-toast-renderer-BlDxemsU.mjs.map +1 -0
  128. package/fesm2022/cdevhub-ngx-tw-toast.mjs +556 -945
  129. package/fesm2022/cdevhub-ngx-tw-toast.mjs.map +1 -1
  130. package/fesm2022/cdevhub-ngx-tw-tooltip.mjs +102 -15
  131. package/fesm2022/cdevhub-ngx-tw-tooltip.mjs.map +1 -1
  132. package/fesm2022/cdevhub-ngx-tw-transfer-testing.mjs +219 -0
  133. package/fesm2022/cdevhub-ngx-tw-transfer-testing.mjs.map +1 -0
  134. package/fesm2022/cdevhub-ngx-tw-transfer.mjs +88 -69
  135. package/fesm2022/cdevhub-ngx-tw-transfer.mjs.map +1 -1
  136. package/fesm2022/cdevhub-ngx-tw-tree.mjs +68 -19
  137. package/fesm2022/cdevhub-ngx-tw-tree.mjs.map +1 -1
  138. package/index.json +1 -1
  139. package/package.json +63 -2
  140. package/theme/_base.css +13 -0
  141. package/theme/_dark.css +110 -36
  142. package/theme/_high-contrast-dark.css +367 -0
  143. package/theme/_high-contrast.css +13 -2
  144. package/theme/_light.css +276 -0
  145. package/theme/_semantic.css +47 -12
  146. package/theme/_typography.css +17 -0
  147. package/theme/index.css +86 -7
  148. package/types/cdevhub-ngx-tw-accordion.d.ts +12 -4
  149. package/types/cdevhub-ngx-tw-avatar.d.ts +10 -3
  150. package/types/cdevhub-ngx-tw-button.d.ts +1 -0
  151. package/types/cdevhub-ngx-tw-calendar-luxon.d.ts +2 -2
  152. package/types/cdevhub-ngx-tw-calendar-testing.d.ts +1 -1
  153. package/types/cdevhub-ngx-tw-calendar.d.ts +179 -73
  154. package/types/cdevhub-ngx-tw-card.d.ts +11 -3
  155. package/types/cdevhub-ngx-tw-carousel.d.ts +89 -20
  156. package/types/cdevhub-ngx-tw-checkbox.d.ts +40 -12
  157. package/types/cdevhub-ngx-tw-code-block.d.ts +11 -2
  158. package/types/cdevhub-ngx-tw-collapsible.d.ts +32 -5
  159. package/types/cdevhub-ngx-tw-combobox-testing.d.ts +157 -0
  160. package/types/cdevhub-ngx-tw-combobox.d.ts +94 -53
  161. package/types/cdevhub-ngx-tw-command-palette-testing.d.ts +136 -0
  162. package/types/cdevhub-ngx-tw-command-palette.d.ts +33 -5
  163. package/types/cdevhub-ngx-tw-core.d.ts +152 -21
  164. package/types/cdevhub-ngx-tw-date-picker-testing.d.ts +141 -0
  165. package/types/cdevhub-ngx-tw-date-picker.d.ts +37 -29
  166. package/types/cdevhub-ngx-tw-date-range-picker-testing.d.ts +148 -0
  167. package/types/cdevhub-ngx-tw-date-range-picker.d.ts +36 -29
  168. package/types/cdevhub-ngx-tw-dialog-testing.d.ts +98 -0
  169. package/types/cdevhub-ngx-tw-dialog.d.ts +89 -19
  170. package/types/cdevhub-ngx-tw-file-upload-testing.d.ts +120 -0
  171. package/types/cdevhub-ngx-tw-file-upload.d.ts +8 -10
  172. package/types/cdevhub-ngx-tw-flip-card.d.ts +18 -11
  173. package/types/cdevhub-ngx-tw-form-field.d.ts +19 -2
  174. package/types/cdevhub-ngx-tw-icon.d.ts +3 -3
  175. package/types/cdevhub-ngx-tw-input.d.ts +5 -8
  176. package/types/cdevhub-ngx-tw-item.d.ts +2 -0
  177. package/types/cdevhub-ngx-tw-menu-testing.d.ts +131 -0
  178. package/types/cdevhub-ngx-tw-menu.d.ts +2 -2
  179. package/types/cdevhub-ngx-tw-number-input.d.ts +20 -0
  180. package/types/cdevhub-ngx-tw-paginator.d.ts +58 -24
  181. package/types/cdevhub-ngx-tw-popover.d.ts +41 -10
  182. package/types/cdevhub-ngx-tw-progress-bar.d.ts +1 -1
  183. package/types/cdevhub-ngx-tw-radio.d.ts +68 -25
  184. package/types/cdevhub-ngx-tw-segmented-control.d.ts +79 -16
  185. package/types/cdevhub-ngx-tw-select-testing.d.ts +114 -0
  186. package/types/cdevhub-ngx-tw-select.d.ts +104 -33
  187. package/types/cdevhub-ngx-tw-sheet-testing.d.ts +104 -0
  188. package/types/cdevhub-ngx-tw-sheet.d.ts +96 -21
  189. package/types/cdevhub-ngx-tw-slider.d.ts +79 -25
  190. package/types/cdevhub-ngx-tw-sort.d.ts +45 -4
  191. package/types/cdevhub-ngx-tw-split.d.ts +32 -2
  192. package/types/cdevhub-ngx-tw-stat.d.ts +14 -4
  193. package/types/cdevhub-ngx-tw-stepper.d.ts +16 -2
  194. package/types/cdevhub-ngx-tw-switch.d.ts +35 -13
  195. package/types/cdevhub-ngx-tw-tab-nav.d.ts +7 -6
  196. package/types/cdevhub-ngx-tw-table.d.ts +53 -10
  197. package/types/cdevhub-ngx-tw-tabs.d.ts +41 -10
  198. package/types/cdevhub-ngx-tw-tags-input-testing.d.ts +135 -0
  199. package/types/cdevhub-ngx-tw-tags-input.d.ts +26 -11
  200. package/types/cdevhub-ngx-tw-textarea.d.ts +3 -2
  201. package/types/cdevhub-ngx-tw-theme.d.ts +245 -39
  202. package/types/cdevhub-ngx-tw-time-picker-testing.d.ts +129 -0
  203. package/types/cdevhub-ngx-tw-time-picker.d.ts +76 -19
  204. package/types/cdevhub-ngx-tw-timeline.d.ts +36 -12
  205. package/types/cdevhub-ngx-tw-toast.d.ts +61 -12
  206. package/types/cdevhub-ngx-tw-tooltip.d.ts +28 -6
  207. package/types/cdevhub-ngx-tw-transfer-testing.d.ts +152 -0
  208. package/types/cdevhub-ngx-tw-transfer.d.ts +21 -8
  209. package/types/cdevhub-ngx-tw-tree.d.ts +6 -1
@@ -1 +1 @@
1
- {"version":3,"file":"cdevhub-ngx-tw-toast.mjs","sources":["../../../projects/ngx-tw/toast/toast-config.ts","../../../projects/ngx-tw/toast/toast-component.ts","../../../projects/ngx-tw/toast/toast-container.ts","../../../projects/ngx-tw/toast/toast-ref.ts","../../../projects/ngx-tw/toast/toast.ts","../../../projects/ngx-tw/toast/cdevhub-ngx-tw-toast.ts"],"sourcesContent":["import { InjectionToken, type TemplateRef, type Type } from '@angular/core';\nimport type { ToastRef } from './toast-ref';\n\n/** Severity variant — drives color palette, default icon, and live-region politeness. */\nexport type ToastSeverity = 'info' | 'success' | 'warning' | 'error' | 'neutral';\n\n/** Screen anchor for a stack of toasts. One CDK overlay is created per position on first use. */\nexport type ToastPosition =\n | 'top-left'\n | 'top-center'\n | 'top-right'\n | 'bottom-left'\n | 'bottom-center'\n | 'bottom-right';\n\n/** Lifecycle state of a single toast. */\nexport type ToastState = 'entering' | 'visible' | 'paused' | 'dismissing' | 'dismissed';\n\n/** Reason a toast was dismissed. */\nexport type ToastDismissReason =\n | 'action'\n | 'timeout'\n | 'swipe'\n | 'manual'\n | 'programmatic'\n | 'max-exceeded';\n\n/** Payload forwarded to `afterDismissed()` subscribers. */\nexport interface ToastDismissal<R = unknown> {\n /** Why the toast closed. */\n reason: ToastDismissReason;\n /** Optional value forwarded from `ref.dismiss(result)`. */\n result?: R;\n}\n\n/** Context object handed to `TemplateRef` content (`let-data let-ref=\"ref\"`). */\nexport interface ToastTemplateContext<T = unknown> {\n /** Data value from `config.data`, unwrapped as the template's `$implicit`. */\n $implicit: T;\n /** Reference to the toast itself, bound as `let-ref=\"ref\"`. */\n ref: ToastRef<unknown, unknown>;\n}\n\n/** Action button configuration. When `handler` is omitted the button dismisses the toast with reason `'action'`. */\nexport interface ToastAction {\n /** Visible label of the action button. */\n label: string;\n /** Optional callback invoked when the action is clicked or `ref.triggerAction()` is called. */\n handler?: (ref: ToastRef) => void;\n}\n\n/**\n * Per-call configuration for {@link ToastService} methods. Also used as the\n * payload of {@link TW_TOAST_DEFAULT_OPTIONS} for app-wide defaults.\n */\n// `R` is a phantom result-type kept for parity with `ToastRef<D, R>` / service\n// generics — consumers pass it through `ToastConfig<D, R>` so the resulting\n// `ToastRef.afterClosed()` is correctly typed.\nexport class ToastConfig<D = unknown, _R = unknown> {\n /** Severity of the toast. Defaults to `'info'`. */\n severity?: ToastSeverity = 'info';\n\n /** Screen position of the toast stack. Defaults to `'bottom-right'`. */\n position?: ToastPosition = 'bottom-right';\n\n /** Auto-dismiss duration in ms. `0` disables auto-dismiss. Defaults to `5000`. */\n duration?: number = 5000;\n\n // Default true: toasts must offer an escape hatch — sticky / long-duration toasts\n // otherwise trap users; opt-out only for ephemeral progress markers paired with `duration`.\n /** When true, renders a close (×) button. Defaults to `true`. */\n dismissible?: boolean = true;\n\n /**\n * Live-region politeness. When omitted, resolves to `'assertive'` for\n * `severity: 'error'` and `'polite'` otherwise. Pass `'off'` to skip\n * `LiveAnnouncer` entirely.\n */\n politeness?: 'polite' | 'assertive' | 'off';\n\n /** Action button configuration. Omit to hide the action button. */\n action?: ToastAction;\n\n /** Arbitrary data provided to component / template content via `TW_TOAST_DATA`. */\n data?: D | null = null;\n\n /** Extra CSS classes merged onto the toast panel root via `twMerge`. */\n panelClass?: string | string[];\n\n /**\n * Icon override. Pass a string (treated as text glyph / icon name) or\n * `false` to hide the icon. When omitted the severity-default icon is used.\n *\n * Note: To render arbitrary icon markup, pass a `TemplateRef` to `show()`\n * itself (the whole toast is a custom template) — the icon slot accepts only\n * primitives for the string-content path.\n */\n icon?: string | false;\n\n // Default true: matches Material/Radix/Sonner conventions — prevents a toast from\n // disappearing mid-read; opt-out only for fully ambient progress indicators.\n /** When true, pause the auto-dismiss timer while the toast is hovered or holds focus. Defaults to `true`. */\n pauseOnInteraction?: boolean = true;\n\n // Default true: matches mobile-platform expectations and gives non-precise pointers\n // (touch) an easy dismiss gesture; opt-out only if the gesture conflicts with content.\n /** Enable horizontal swipe-to-dismiss via pointer gestures. Defaults to `true`. */\n swipeToDismiss?: boolean = true;\n\n /**\n * Maximum visible toasts *per position*. When exceeded, the oldest toast in\n * that position dismisses with reason `'max-exceeded'`. Defaults to `5`.\n */\n maxVisible?: number = 5;\n\n /** Explicit id. When omitted a unique id is generated. */\n id?: string;\n\n /** Accessible label applied to the toast element. When omitted, text content is used. */\n ariaLabel?: string;\n\n /** Accessible label applied to the per-position `role=\"region\"` container. Defaults to `'Notifications'`. */\n regionAriaLabel?: string;\n}\n\n/** Injection token providing `config.data` to projected component / template content. */\nexport const TW_TOAST_DATA = new InjectionToken<unknown>('TW_TOAST_DATA');\n\n/** Injection token providing the owning {@link ToastRef} to projected component content. */\nexport const TW_TOAST_REF = new InjectionToken<ToastRef>('TW_TOAST_REF');\n\n/** Injection token carrying application-wide toast defaults. Set via `provideToast(defaults)`. */\nexport const TW_TOAST_DEFAULT_OPTIONS = new InjectionToken<Partial<ToastConfig>>(\n 'TW_TOAST_DEFAULT_OPTIONS',\n);\n\n/** Accepted content forms for `ToastService.show()`. */\nexport type ToastContent = string | TemplateRef<ToastTemplateContext> | Type<unknown>;\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n contentChild,\n Directive,\n inject,\n input,\n output,\n} from '@angular/core';\nimport { tv } from 'tailwind-variants';\nimport type { ToastSeverity } from './toast-config';\n\nconst toastVariants = tv(\n {\n slots: {\n root:\n 'pointer-events-auto relative flex items-start gap-3 w-full max-w-sm p-4 rounded-lg border shadow-md text-sm will-change-transform transition-colors duration-normal motion-reduce:transition-none',\n icon: 'size-5 shrink-0 mt-0.5',\n title: 'text-sm font-semibold',\n description: 'text-sm',\n content: 'flex-1 min-w-0',\n action:\n 'inline-flex items-center justify-center px-3 py-1.5 rounded-md text-sm font-medium cursor-pointer transition-colors duration-normal motion-reduce:transition-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary-500',\n // Dismiss container is `size-6` (24px — xs square-interactive-target\n // scale per CLAUDE.md icon sub-scale). The inner SVG is `size-4` (16px\n // glyph scale), centred via flex; the larger container gives the\n // touch/click affordance without enlarging the visual glyph.\n dismiss:\n 'absolute top-3 right-3 inline-flex items-center justify-center size-6 rounded-md cursor-pointer transition-colors duration-normal motion-reduce:transition-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary-500',\n },\n variants: {\n severity: {\n info: {},\n success: {},\n warning: {},\n error: {},\n neutral: {},\n },\n },\n // Color slot tokens (`{role}-soft`, `-soft-fg`, `-icon`, …) own light/dark\n // contrast — components consume the slot only. See `_semantic.css`.\n // Slot-token safelist: see `projects/ngx-tw/theme/index.css` `@source inline(...)`\n // — Tailwind v4's JIT cannot scan template-literal class names, so every\n // `bg-${severity}-soft` / `text-${severity}-icon` permutation below must be\n // enumerated there.\n compoundVariants: (['info', 'success', 'warning', 'error', 'neutral'] as const).map(\n (severity) => ({\n severity,\n class: {\n root: `bg-${severity}-soft text-${severity}-soft-fg-muted border-${severity}-border`,\n icon: `text-${severity}-icon`,\n title: `text-${severity}-soft-fg`,\n description: `text-${severity}-soft-fg-muted`,\n action: `text-${severity}-soft-fg hover:bg-${severity}-soft-hover`,\n dismiss: `text-${severity}-icon hover:bg-${severity}-soft-hover`,\n },\n }),\n ),\n defaultVariants: {\n severity: 'info',\n },\n },\n { twMerge: true },\n);\n\n/** Slot directive for the icon. When projected, overrides the severity-default icon. */\n@Directive({\n selector: '[twToastIcon]',\n host: {\n '[class]': 'classes()',\n 'aria-hidden': 'true',\n },\n})\nexport class ToastIconDirective {\n private readonly toast = inject(ToastComponent);\n /** @internal */\n readonly classes = this.toast.iconClasses;\n}\n\n/** Slot directive for the bold title line inside a toast. */\n@Directive({\n selector: '[twToastTitle]',\n host: {\n '[class]': 'classes()',\n },\n})\nexport class ToastTitleDirective {\n private readonly toast = inject(ToastComponent);\n /** @internal */\n readonly classes = this.toast.titleClasses;\n}\n\n/** Slot directive for a secondary description line inside a toast. */\n@Directive({\n selector: '[twToastDescription]',\n host: {\n '[class]': 'classes()',\n },\n})\nexport class ToastDescriptionDirective {\n private readonly toast = inject(ToastComponent);\n /** @internal */\n readonly classes = this.toast.descriptionClasses;\n}\n\n/** Slot directive for the action button. Apply to a native `<button>` to inherit the severity-aware styling. */\n@Directive({\n selector: '[twToastAction]',\n host: {\n type: 'button',\n '[class]': 'classes()',\n '(click)': 'onClick()',\n },\n})\nexport class ToastActionDirective {\n private readonly toast = inject(ToastComponent);\n /** @internal */\n readonly classes = this.toast.actionClasses;\n /** @internal */\n protected onClick(): void {\n this.toast.actionClicked.emit();\n }\n}\n\n/**\n * Visual toast / snackbar panel. Rendered internally by {@link ToastService} for\n * string content, and exported for consumers who want to compose the same\n * visual inside a custom `TemplateRef` or component class passed to `show()`.\n */\n@Component({\n selector: 'tw-toast',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '[class]': 'rootClasses()',\n '[attr.role]': 'roleAttr()',\n '[attr.aria-live]': 'ariaLiveAttr()',\n 'aria-atomic': 'true',\n '[attr.aria-label]': 'ariaLabel() || null',\n '[attr.data-severity]': 'severity()',\n },\n template: `\n @if (hasProjectedIcon()) {\n <ng-content select=\"[twToastIcon]\" />\n } @else if (icon() !== false) {\n <span [class]=\"iconClasses()\" aria-hidden=\"true\">\n @switch (severity()) {\n @case ('info') {\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 20 20\" fill=\"currentColor\" class=\"size-full\">\n <path fill-rule=\"evenodd\" d=\"M10 18a8 8 0 1 0 0-16 8 8 0 0 0 0 16Zm0-11a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm-.75 2.5a.75.75 0 0 0 0 1.5h.25v3h-.25a.75.75 0 0 0 0 1.5h2a.75.75 0 0 0 0-1.5h-.25v-3.75a.75.75 0 0 0-.75-.75h-1Z\" clip-rule=\"evenodd\"/>\n </svg>\n }\n @case ('success') {\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 20 20\" fill=\"currentColor\" class=\"size-full\">\n <path fill-rule=\"evenodd\" d=\"M10 18a8 8 0 1 0 0-16 8 8 0 0 0 0 16Zm3.857-9.809a.75.75 0 0 0-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 1 0-1.06 1.061l2.5 2.5a.75.75 0 0 0 1.137-.089l4-5.5Z\" clip-rule=\"evenodd\"/>\n </svg>\n }\n @case ('warning') {\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 20 20\" fill=\"currentColor\" class=\"size-full\">\n <path fill-rule=\"evenodd\" d=\"M8.485 2.495c.673-1.167 2.357-1.167 3.03 0l6.28 10.875c.673 1.167-.17 2.625-1.516 2.625H3.72c-1.347 0-2.189-1.458-1.515-2.625L8.485 2.495ZM10 5a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 10 5Zm0 9a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z\" clip-rule=\"evenodd\"/>\n </svg>\n }\n @case ('error') {\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 20 20\" fill=\"currentColor\" class=\"size-full\">\n <path fill-rule=\"evenodd\" d=\"M18 10a8 8 0 1 1-16 0 8 8 0 0 1 16 0Zm-8-5a.75.75 0 0 1 .75.75v4.5a.75.75 0 0 1-1.5 0v-4.5A.75.75 0 0 1 10 5Zm0 10a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z\" clip-rule=\"evenodd\"/>\n </svg>\n }\n @default {\n @if (icon() && icon() !== false) {\n {{ icon() }}\n }\n }\n }\n </span>\n }\n <div [class]=\"contentClasses()\">\n <ng-content select=\"[twToastTitle]\" />\n <ng-content select=\"[twToastDescription]\" />\n <ng-content />\n <ng-content select=\"[twToastAction]\" />\n </div>\n @if (dismissible()) {\n <button\n type=\"button\"\n aria-label=\"Dismiss\"\n [class]=\"dismissClasses()\"\n (click)=\"dismissed.emit()\"\n >\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" fill=\"currentColor\" class=\"size-4\">\n <path d=\"M5.28 4.22a.75.75 0 0 0-1.06 1.06L6.94 8l-2.72 2.72a.75.75 0 1 0 1.06 1.06L8 9.06l2.72 2.72a.75.75 0 1 0 1.06-1.06L9.06 8l2.72-2.72a.75.75 0 0 0-1.06-1.06L8 6.94 5.28 4.22Z\"/>\n </svg>\n </button>\n }\n `,\n})\nexport class ToastComponent {\n /** Severity variant. Drives color palette, default icon, and ARIA role / live politeness. Defaults to `'info'`. */\n readonly severity = input<ToastSeverity>('info');\n\n // Default true: mirrors `ToastConfig.dismissible` — toasts must offer an escape\n // hatch by default; opt-out only for ephemeral progress markers paired with `duration`.\n /** Whether to render the close button. Defaults to `true`. */\n readonly dismissible = input<boolean>(true);\n\n /**\n * Icon override. Pass a string to render as text inside the icon slot, or\n * `false` to hide the built-in severity icon. Ignored when a `[twToastIcon]`\n * child is projected. When omitted, the severity-default icon renders.\n *\n * For arbitrary icon markup, project a `[twToastIcon]` child instead.\n */\n readonly icon = input<string | false | undefined>(undefined);\n\n /** Explicit aria-label for the toast wrapper. When omitted, text content is used by assistive tech. */\n readonly ariaLabel = input<string | undefined>(undefined);\n\n /** Fires when the close button is clicked. */\n readonly dismissed = output<void>();\n\n /** Fires when a `[twToastAction]` button is clicked. */\n readonly actionClicked = output<void>();\n\n /** @internal */\n readonly projectedIcon = contentChild(ToastIconDirective);\n\n /** @internal */\n readonly hasProjectedIcon = computed(() => !!this.projectedIcon());\n\n private readonly variantResult = computed(() => toastVariants({ severity: this.severity() }));\n\n /** @internal */\n readonly rootClasses = computed(() => {\n const base = this.variantResult().root();\n return this.dismissible() ? `${base} pr-10` : base;\n });\n\n /** @internal */\n readonly iconClasses = computed(() => this.variantResult().icon());\n /** @internal */\n readonly titleClasses = computed(() => this.variantResult().title());\n /** @internal */\n readonly descriptionClasses = computed(() => this.variantResult().description());\n /** @internal */\n readonly contentClasses = computed(() => this.variantResult().content());\n /** @internal */\n readonly actionClasses = computed(() => this.variantResult().action());\n /** @internal */\n readonly dismissClasses = computed(() => this.variantResult().dismiss());\n\n /** @internal */\n protected readonly roleAttr = computed(() =>\n this.severity() === 'error' ? 'alert' : 'status',\n );\n\n /** @internal */\n protected readonly ariaLiveAttr = computed(() =>\n this.severity() === 'error' ? 'assertive' : 'polite',\n );\n}\n","import { NgTemplateOutlet } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n type ComponentRef,\n Component,\n computed,\n ElementRef,\n Injector,\n TemplateRef,\n ViewEncapsulation,\n inject,\n signal,\n untracked,\n} from '@angular/core';\nimport {\n CdkPortalOutlet,\n type CdkPortalOutletAttachedRef,\n} from '@angular/cdk/portal';\nimport { LiveAnnouncer } from '@angular/cdk/a11y';\nimport { ToastActionDirective, ToastComponent } from './toast-component';\nimport {\n TW_TOAST_DATA,\n TW_TOAST_REF,\n type ToastPosition,\n type ToastTemplateContext,\n} from './toast-config';\nimport type { ToastRef } from './toast-ref';\n\ntype ToastKind = 'string' | 'template' | 'component';\n\ninterface Entry {\n ref: ToastRef;\n kind: ToastKind;\n enterClass: string;\n leaveClass: string;\n}\n\nconst POSITION_AXIS: Record<ToastPosition, 'right' | 'left' | 'top' | 'bottom'> = {\n 'top-right': 'right',\n 'bottom-right': 'right',\n 'top-left': 'left',\n 'bottom-left': 'left',\n 'top-center': 'top',\n 'bottom-center': 'bottom',\n};\n\nconst POSITION_HOST_CLASSES: Record<ToastPosition, string> = {\n 'top-right': 'items-end',\n 'bottom-right': 'items-end',\n 'top-left': 'items-start',\n 'bottom-left': 'items-start',\n 'top-center': 'items-center',\n 'bottom-center': 'items-center',\n};\n\nconst POSITION_ORDER_REVERSED: Record<ToastPosition, boolean> = {\n 'top-right': false,\n 'top-left': false,\n 'top-center': false,\n 'bottom-right': true,\n 'bottom-left': true,\n 'bottom-center': true,\n};\n\nconst SWIPE_DISMISS_FRACTION = 0.4;\nconst SWIPE_MAX_OPACITY_FADE = 0.6;\n\n/**\n * Internal flex-column host rendered inside each per-position CDK overlay.\n * Stacks visible toasts via `@for`, wires pause-on-interaction, Escape\n * dismissal, swipe gestures, and `LiveAnnouncer` announcements.\n *\n * @docs-private\n */\n@Component({\n selector: 'tw-toast-container',\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n imports: [NgTemplateOutlet, CdkPortalOutlet, ToastComponent, ToastActionDirective],\n host: {\n role: 'region',\n '[class]': 'hostClasses()',\n '[attr.aria-label]': 'regionLabel()',\n '[attr.data-position]': 'position()',\n },\n template: `\n @for (entry of orderedEntries(); track entry.ref.id) {\n <!-- Toast entry wrapper; the projected <tw-toast> is the focusable affordance.\n This element only forwards pointer/focus events so the container can\n pause auto-dismiss while the user is interacting. -->\n <!-- eslint-disable-next-line @angular-eslint/template/interactive-supports-focus -->\n <div\n class=\"pointer-events-auto w-full max-w-sm\"\n [attr.data-toast-id]=\"entry.ref.id\"\n [style.transform]=\"entry.ref.swipeTransform() || null\"\n [style.opacity]=\"entry.ref.swipeOpacity() ?? null\"\n [style.touch-action]=\"'pan-y'\"\n [animate.enter]=\"entry.enterClass\"\n [animate.leave]=\"entry.ref.leaveAnimationOverride() ?? entry.leaveClass\"\n (pointerenter)=\"onPointerEnter(entry.ref)\"\n (pointerleave)=\"onPointerLeave(entry.ref)\"\n (focusin)=\"onFocusIn(entry.ref)\"\n (focusout)=\"onFocusOut(entry.ref, $event)\"\n (keydown.escape)=\"onEscape(entry.ref, $event)\"\n (pointerdown)=\"onSwipeStart(entry.ref, $event, swipeEl)\"\n #swipeEl\n >\n @switch (entry.kind) {\n @case ('string') {\n <tw-toast\n [severity]=\"entry.ref.severity()\"\n [dismissible]=\"entry.ref.dismissible()\"\n [icon]=\"entry.ref.icon()\"\n [ariaLabel]=\"entry.ref.ariaLabel()\"\n [class]=\"panelClassFor(entry.ref)\"\n (dismissed)=\"entry.ref._dismissWith('manual')\"\n (actionClicked)=\"entry.ref.triggerAction()\"\n >\n {{ asString(entry.ref.content()) }}\n @if (entry.ref.action(); as action) {\n <button twToastAction>{{ action.label }}</button>\n }\n </tw-toast>\n }\n @case ('template') {\n <tw-toast\n [severity]=\"entry.ref.severity()\"\n [dismissible]=\"entry.ref.dismissible()\"\n [icon]=\"entry.ref.icon()\"\n [ariaLabel]=\"entry.ref.ariaLabel()\"\n [class]=\"panelClassFor(entry.ref)\"\n (dismissed)=\"entry.ref._dismissWith('manual')\"\n (actionClicked)=\"entry.ref.triggerAction()\"\n >\n <ng-container\n [ngTemplateOutlet]=\"asTemplate(entry.ref.content())\"\n [ngTemplateOutletContext]=\"templateContext(entry.ref)\"\n />\n @if (entry.ref.action(); as action) {\n <button twToastAction>{{ action.label }}</button>\n }\n </tw-toast>\n }\n @case ('component') {\n <ng-template\n [cdkPortalOutlet]=\"entry.ref._portal\"\n (attached)=\"onPortalAttached(entry.ref, $event)\"\n />\n }\n }\n </div>\n }\n `,\n})\nexport class ToastContainerComponent {\n /** Per-position stacking anchor. Mutated from {@link ToastService} via `.instance.position.set(...)`. */\n readonly position = signal<ToastPosition>('bottom-right');\n\n /** Accessible label applied to the `role=\"region\"` host. Mutated from the service on init. */\n readonly regionLabel = signal<string>('Notifications');\n\n /**\n * Toasts currently assigned to this container. The service pushes toasts\n * into this signal; the container filters by state to drive `animate.leave`.\n */\n readonly visibleRefs = signal<readonly ToastRef[]>([]);\n\n private readonly injector = inject(Injector);\n private readonly liveAnnouncer = inject(LiveAnnouncer);\n private readonly host = inject(ElementRef<HTMLElement>);\n\n private readonly swipeSessions = new WeakMap<\n ToastRef,\n { pointerId: number; startX: number; width: number; active: boolean }\n >();\n\n private readonly entries = computed<readonly Entry[]>(() => {\n const pos = this.position();\n const axis = POSITION_AXIS[pos];\n const enter = `toast-enter-${axis}`;\n const leave = `toast-leave-${axis}`;\n const refs = this.visibleRefs().filter((ref) => {\n const s = ref.state();\n return s === 'entering' || s === 'visible' || s === 'paused';\n });\n return refs.map((ref) => ({\n ref,\n kind: resolveKind(ref.content()),\n enterClass: enter,\n leaveClass: leave,\n }));\n });\n\n protected readonly orderedEntries = computed(() => {\n const list = this.entries();\n return POSITION_ORDER_REVERSED[this.position()] ? [...list].reverse() : list;\n });\n\n protected readonly hostClasses = computed(() => {\n const base = 'flex flex-col gap-2 w-full max-w-sm';\n const align = POSITION_HOST_CLASSES[this.position()];\n return `${base} ${align}`;\n });\n\n /** @internal Called by the service right after attaching a new toast. Runs `LiveAnnouncer`. */\n _announceOpen(ref: ToastRef): void {\n const politeness = this.resolvePoliteness(ref);\n if (politeness === 'off') return;\n const msg = this.resolveAnnouncementText(ref);\n if (msg) this.liveAnnouncer.announce(msg, politeness);\n }\n\n /** @internal Called by the service when `ref.update()` fires — re-announces with the new severity / content. */\n _announceUpdate(ref: ToastRef): void {\n this._announceOpen(ref);\n }\n\n /** @internal Captures the component instance after `cdkPortalOutlet` attaches. */\n protected onPortalAttached(ref: ToastRef, attached: CdkPortalOutletAttachedRef): void {\n if (attached && 'instance' in attached) {\n ref.componentInstance = (attached as ComponentRef<unknown>).instance;\n }\n }\n\n /** @internal Injector factory for component-class content. Provides `TW_TOAST_DATA` + `TW_TOAST_REF`. */\n _createContentInjector(ref: ToastRef): Injector {\n return Injector.create({\n parent: this.injector,\n providers: [\n { provide: TW_TOAST_REF, useValue: ref },\n { provide: TW_TOAST_DATA, useValue: ref.data() },\n ],\n });\n }\n\n // ── Template helpers ──\n\n protected asString(content: unknown): string {\n return typeof content === 'string' ? content : '';\n }\n\n protected asTemplate(content: unknown): TemplateRef<ToastTemplateContext> | null {\n return content instanceof TemplateRef ? (content as TemplateRef<ToastTemplateContext>) : null;\n }\n\n protected templateContext(ref: ToastRef): ToastTemplateContext {\n return { $implicit: ref.data() as never, ref };\n }\n\n protected panelClassFor(ref: ToastRef): string {\n const raw = ref.config.panelClass;\n if (!raw) return '';\n return Array.isArray(raw) ? raw.join(' ') : raw;\n }\n\n // ── Interaction handlers ──\n\n protected onPointerEnter(ref: ToastRef): void {\n ref._setHovered(true);\n }\n\n protected onPointerLeave(ref: ToastRef): void {\n ref._setHovered(false);\n }\n\n protected onFocusIn(ref: ToastRef): void {\n ref._setFocused(true);\n }\n\n protected onFocusOut(ref: ToastRef, event: FocusEvent): void {\n const related = event.relatedTarget as Node | null;\n const target = event.currentTarget as Node | null;\n if (related && target && target.contains(related)) return;\n ref._setFocused(false);\n }\n\n protected onEscape(ref: ToastRef, event: Event): void {\n event.stopPropagation();\n event.preventDefault();\n ref._dismissWith('manual');\n }\n\n protected onSwipeStart(ref: ToastRef, event: PointerEvent, el: HTMLElement): void {\n if (!ref.config.swipeToDismiss) return;\n if (event.button !== 0) return;\n const target = event.target as HTMLElement | null;\n if (target?.closest('button, a, input, select, textarea, [role=\"button\"]')) return;\n\n const width = el.getBoundingClientRect().width;\n this.swipeSessions.set(ref, {\n pointerId: event.pointerId,\n startX: event.clientX,\n width,\n active: false,\n });\n el.setPointerCapture(event.pointerId);\n\n const onMove = (e: PointerEvent) => this.onSwipeMove(ref, e, el);\n const onUp = (e: PointerEvent) => this.onSwipeEnd(ref, e, el, onMove, onUp);\n el.addEventListener('pointermove', onMove);\n el.addEventListener('pointerup', onUp);\n el.addEventListener('pointercancel', onUp);\n }\n\n private onSwipeMove(ref: ToastRef, event: PointerEvent, _el: HTMLElement): void {\n const session = this.swipeSessions.get(ref);\n if (!session || event.pointerId !== session.pointerId) return;\n const dx = event.clientX - session.startX;\n if (!session.active && Math.abs(dx) < 6) return;\n session.active = true;\n ref.swipeTransform.set(`translate3d(${dx}px, 0, 0)`);\n const fade = 1 - Math.min(Math.abs(dx) / session.width, 1) * SWIPE_MAX_OPACITY_FADE;\n ref.swipeOpacity.set(fade);\n }\n\n private onSwipeEnd(\n ref: ToastRef,\n event: PointerEvent,\n el: HTMLElement,\n onMove: (e: PointerEvent) => void,\n onUp: (e: PointerEvent) => void,\n ): void {\n const session = this.swipeSessions.get(ref);\n el.removeEventListener('pointermove', onMove);\n el.removeEventListener('pointerup', onUp);\n el.removeEventListener('pointercancel', onUp);\n if (!session || event.pointerId !== session.pointerId) return;\n try {\n el.releasePointerCapture(session.pointerId);\n } catch {\n /* no-op */\n }\n this.swipeSessions.delete(ref);\n\n if (!session.active) return;\n const dx = event.clientX - session.startX;\n const threshold = session.width * SWIPE_DISMISS_FRACTION;\n const allowed = this.swipeDirectionAllowed(dx);\n if (Math.abs(dx) >= threshold && allowed) {\n untracked(() => {\n ref.swipeTransform.set(`translate3d(${Math.sign(dx) * session.width * 1.2}px, 0, 0)`);\n ref.swipeOpacity.set(0);\n ref.leaveAnimationOverride.set('fade-out');\n });\n ref._dismissWith('swipe');\n } else {\n ref.swipeTransform.set(null);\n ref.swipeOpacity.set(null);\n }\n }\n\n private swipeDirectionAllowed(dx: number): boolean {\n const pos = this.position();\n if (pos === 'top-right' || pos === 'bottom-right') return dx > 0;\n if (pos === 'top-left' || pos === 'bottom-left') return dx < 0;\n return true;\n }\n\n private resolvePoliteness(ref: ToastRef): 'polite' | 'assertive' | 'off' {\n if (ref.config.politeness) return ref.config.politeness;\n return ref.severity() === 'error' ? 'assertive' : 'polite';\n }\n\n private resolveAnnouncementText(ref: ToastRef): string {\n const explicit = ref.ariaLabel();\n if (explicit) return explicit;\n const content = ref.content();\n if (typeof content === 'string') return content;\n const host = this.host.nativeElement.querySelector(\n `[data-toast-id=\"${ref.id}\"]`,\n ) as HTMLElement | null;\n if (host) return host.textContent?.trim() ?? '';\n return this.host.nativeElement.textContent?.trim() ?? '';\n }\n}\n\nfunction resolveKind(content: unknown): ToastKind {\n if (typeof content === 'string') return 'string';\n if (content instanceof TemplateRef) return 'template';\n return 'component';\n}\n\n","import { signal, type Signal, type WritableSignal } from '@angular/core';\nimport type { Portal } from '@angular/cdk/portal';\nimport { type Observable, ReplaySubject, Subject } from 'rxjs';\nimport type {\n ToastAction,\n ToastConfig,\n ToastContent,\n ToastDismissReason,\n ToastDismissal,\n ToastSeverity,\n ToastState,\n} from './toast-config';\n\n/** Duration (ms) of the toast enter / leave animation. Must match `_base.css` toast-slide keyframes. */\nexport const TOAST_ANIMATION_DURATION = 150;\n\n/** Padding added to animation fallback timers to guarantee cleanup if the CSS event is swallowed. */\nexport const TOAST_ANIMATION_FALLBACK_PADDING = 50;\n\n/** Patch accepted by {@link ToastRef.update}. Mirrors the subset of `ToastConfig` that is safe to mutate live. */\nexport interface ToastUpdatePatch {\n /** New severity — updates color, default icon, and (for `'error'`) live-region politeness. */\n severity?: ToastSeverity;\n /** New auto-dismiss duration in ms. Restarts the timer if the toast is visible. `0` disables auto-dismiss. */\n duration?: number;\n /** Replace or clear the action button. Pass `null` to remove. */\n action?: ToastAction | null;\n /** Override the icon slot. */\n icon?: string | false | undefined;\n /** Replace the `TW_TOAST_DATA` payload. */\n data?: unknown;\n /** Replace the aria-label applied to the toast wrapper. */\n ariaLabel?: string;\n /** Replace the toast's content (string, template, or component). */\n content?: ToastContent;\n /** Whether the close button is shown. */\n dismissible?: boolean;\n}\n\n/**\n * Reference to a toast opened via {@link ToastService}. Use to dismiss the\n * toast, pause / resume its auto-dismiss timer, or observe its lifecycle.\n *\n * The service returns a ref synchronously from every open method; the toast\n * itself is attached asynchronously inside the CDK overlay.\n */\nexport class ToastRef<C = unknown, R = unknown> {\n /** Unique id. Generated if `config.id` was not provided. */\n readonly id: string;\n\n /** Instance of the component rendered inside the toast (only for component-class content). */\n componentInstance: C | null = null;\n\n /** Resolved static config for this toast (defaults merged, severity shorthand applied). */\n readonly config: Readonly<ToastConfig<unknown, R>>;\n\n /** Reactive lifecycle state. */\n readonly state: Signal<ToastState>;\n\n /** Reactive severity — may change after `update()` (used by the `promise()` helper). */\n readonly severity: Signal<ToastSeverity>;\n\n /** Reactive dismissibility. */\n readonly dismissible: Signal<boolean>;\n\n /** Reactive icon override. */\n readonly icon: Signal<string | false | undefined>;\n\n /** Reactive content (the source of truth for what gets rendered). */\n readonly content: Signal<ToastContent>;\n\n /** Reactive action button configuration. */\n readonly action: Signal<ToastAction | undefined>;\n\n /** Reactive accessible label. */\n readonly ariaLabel: Signal<string | undefined>;\n\n /** Reactive data payload — re-read by the container to update `TW_TOAST_DATA`. */\n readonly data: Signal<unknown>;\n\n /** @internal Reactive \"transient\" class applied by swipe gestures (e.g. `translate3d(...)`). */\n readonly swipeTransform = signal<string | null>(null);\n\n /** @internal Reactive opacity applied during swipe gestures. */\n readonly swipeOpacity = signal<number | null>(null);\n\n /** @internal Leave-animation class override. When non-null, container uses this instead of the position default. */\n readonly leaveAnimationOverride = signal<string | null>(null);\n\n /** @internal Portal for component-class content. Set by the service; null for string / template content. */\n _portal: Portal<unknown> | null = null;\n\n /** @internal True while the pointer hovers this toast. */\n _hovered = false;\n\n /** @internal True while focus is within this toast. */\n _focused = false;\n\n /** @internal Set by the service so the ref can reach the CDK-owned OverlayRef if it needs to. */\n _overlayPanelElement: HTMLElement | null = null;\n\n private readonly stateSignal = signal<ToastState>('entering');\n private readonly severitySignal: WritableSignal<ToastSeverity>;\n private readonly dismissibleSignal: WritableSignal<boolean>;\n private readonly iconSignal: WritableSignal<string | false | undefined>;\n private readonly contentSignal: WritableSignal<ToastContent>;\n private readonly actionSignal: WritableSignal<ToastAction | undefined>;\n private readonly ariaLabelSignal: WritableSignal<string | undefined>;\n private readonly dataSignal: WritableSignal<unknown>;\n\n private readonly afterOpenedSubject = new ReplaySubject<void>(1);\n private readonly beforeDismissedSubject = new ReplaySubject<R | undefined>(1);\n private readonly afterDismissedSubject = new ReplaySubject<ToastDismissal<R>>(1);\n private readonly updatedSubject = new Subject<ToastUpdatePatch>();\n\n private dismissReason: ToastDismissReason = 'programmatic';\n private dismissResult: R | undefined;\n private autoDismissTimer: ReturnType<typeof setTimeout> | null = null;\n private autoDismissStartedAt = 0;\n private autoDismissRemaining = 0;\n private paused = false;\n private enterTimer: ReturnType<typeof setTimeout> | null = null;\n private leaveTimer: ReturnType<typeof setTimeout> | null = null;\n\n constructor(\n id: string,\n content: ToastContent,\n config: ToastConfig<unknown, R>,\n private readonly dismissCallback: (ref: ToastRef) => void,\n ) {\n this.id = id;\n this.config = config;\n this.severitySignal = signal(config.severity ?? 'info');\n this.dismissibleSignal = signal(config.dismissible ?? true);\n this.iconSignal = signal<string | false | undefined>(\n typeof config.icon === 'string' || config.icon === false ? config.icon : undefined,\n );\n this.contentSignal = signal(content);\n this.actionSignal = signal(config.action);\n this.ariaLabelSignal = signal(config.ariaLabel);\n this.dataSignal = signal(config.data ?? null);\n\n this.state = this.stateSignal.asReadonly();\n this.severity = this.severitySignal.asReadonly();\n this.dismissible = this.dismissibleSignal.asReadonly();\n this.icon = this.iconSignal.asReadonly();\n this.content = this.contentSignal.asReadonly();\n this.action = this.actionSignal.asReadonly();\n this.ariaLabel = this.ariaLabelSignal.asReadonly();\n this.data = this.dataSignal.asReadonly();\n\n this.autoDismissRemaining = config.duration ?? 0;\n\n this.enterTimer = setTimeout(\n () => this._markVisible(),\n TOAST_ANIMATION_DURATION + TOAST_ANIMATION_FALLBACK_PADDING,\n );\n }\n\n /**\n * Dismiss the toast programmatically. The leave animation plays before the\n * element is removed and subscribers are notified. Safe to call multiple times.\n */\n dismiss(result?: R): void {\n this._dismissWith('programmatic', result);\n }\n\n /** Pause the auto-dismiss timer (if any). Called automatically on hover / focus when `pauseOnInteraction` is true. */\n pause(): void {\n if (this.paused) return;\n this.paused = true;\n if (this.autoDismissTimer !== null) {\n const elapsed = Date.now() - this.autoDismissStartedAt;\n this.autoDismissRemaining = Math.max(0, this.autoDismissRemaining - elapsed);\n clearTimeout(this.autoDismissTimer);\n this.autoDismissTimer = null;\n }\n const current = this.stateSignal();\n if (current === 'visible') this.stateSignal.set('paused');\n }\n\n /** Resume the auto-dismiss timer with the remaining time. */\n resume(): void {\n if (!this.paused) return;\n this.paused = false;\n if (this.stateSignal() === 'paused') this.stateSignal.set('visible');\n if (this.config.duration && this.config.duration > 0) {\n if (this.autoDismissRemaining <= 0) {\n this._dismissWith('timeout');\n return;\n }\n this._startAutoDismissTimer();\n }\n }\n\n /**\n * @internal Update the hover state. When `pauseOnInteraction` is set and\n * either hover or focus is active, the auto-dismiss timer is paused.\n */\n _setHovered(hovered: boolean): void {\n this._hovered = hovered;\n this._syncInteractionPause();\n }\n\n /** @internal Update the focus-within state. See `_setHovered`. */\n _setFocused(focused: boolean): void {\n this._focused = focused;\n this._syncInteractionPause();\n }\n\n private _syncInteractionPause(): void {\n if (!this.config.pauseOnInteraction) return;\n if (this._hovered || this._focused) {\n this.pause();\n } else {\n this.resume();\n }\n }\n\n /** Invoke the configured action handler (or dismiss with reason `'action'` if none is set). */\n triggerAction(): void {\n const action = this.actionSignal();\n if (!action) return;\n if (action.handler) {\n action.handler(this as unknown as ToastRef);\n } else {\n this._dismissWith('action');\n }\n }\n\n /** Mutate the live toast in place. Used by the `promise()` helper to swap loading → success / error. */\n update(patch: ToastUpdatePatch): void {\n const currentState = this.stateSignal();\n if (currentState === 'dismissing' || currentState === 'dismissed') return;\n\n if (patch.severity !== undefined) this.severitySignal.set(patch.severity);\n if (patch.dismissible !== undefined) this.dismissibleSignal.set(patch.dismissible);\n if (patch.icon !== undefined) this.iconSignal.set(patch.icon);\n if (patch.content !== undefined) this.contentSignal.set(patch.content);\n if (patch.action !== undefined) this.actionSignal.set(patch.action ?? undefined);\n if (patch.ariaLabel !== undefined) this.ariaLabelSignal.set(patch.ariaLabel);\n if (patch.data !== undefined) this.dataSignal.set(patch.data);\n\n if (patch.duration !== undefined) {\n (this.config as { duration?: number }).duration = patch.duration;\n this.autoDismissRemaining = patch.duration;\n if (this.autoDismissTimer !== null) {\n clearTimeout(this.autoDismissTimer);\n this.autoDismissTimer = null;\n }\n if (!this.paused && (currentState === 'visible' || currentState === 'paused')) {\n this._startAutoDismissTimer();\n }\n }\n\n this.updatedSubject.next(patch);\n }\n\n /** Observable that emits once after the enter animation completes. */\n afterOpened(): Observable<void> {\n return this.afterOpenedSubject.asObservable();\n }\n\n /** Observable that emits once when the dismiss sequence starts. */\n beforeDismissed(): Observable<R | undefined> {\n return this.beforeDismissedSubject.asObservable();\n }\n\n /** Observable that emits once after the leave animation completes and the ref is cleaned up. */\n afterDismissed(): Observable<ToastDismissal<R>> {\n return this.afterDismissedSubject.asObservable();\n }\n\n /** @internal Observable of `update()` calls. The container subscribes to re-announce to `LiveAnnouncer`. */\n _updates(): Observable<ToastUpdatePatch> {\n return this.updatedSubject.asObservable();\n }\n\n /** @internal Called by the service when the max-visible cap is exceeded. */\n _dismissAsMaxExceeded(): void {\n this._dismissWith('max-exceeded');\n }\n\n /** @internal Start the dismiss sequence with the given reason. */\n _dismissWith(reason: ToastDismissReason, result?: R): void {\n const currentState = this.stateSignal();\n if (currentState === 'dismissing' || currentState === 'dismissed') return;\n\n this.dismissReason = reason;\n this.dismissResult = result;\n this.stateSignal.set('dismissing');\n\n if (this.autoDismissTimer !== null) {\n clearTimeout(this.autoDismissTimer);\n this.autoDismissTimer = null;\n }\n if (this.enterTimer !== null) {\n clearTimeout(this.enterTimer);\n this.enterTimer = null;\n }\n\n this.beforeDismissedSubject.next(result);\n this.beforeDismissedSubject.complete();\n\n this.leaveTimer = setTimeout(\n () => this._finishDismiss(),\n TOAST_ANIMATION_DURATION + TOAST_ANIMATION_FALLBACK_PADDING,\n );\n }\n\n /** @internal Finalise dismissal — clears timers, emits `afterDismissed`, and hands control back to the service. */\n _finishDismiss(): void {\n if (this.stateSignal() === 'dismissed') return;\n this.stateSignal.set('dismissed');\n\n if (this.leaveTimer !== null) {\n clearTimeout(this.leaveTimer);\n this.leaveTimer = null;\n }\n\n const dismissal: ToastDismissal<R> = {\n reason: this.dismissReason,\n result: this.dismissResult,\n };\n this.afterDismissedSubject.next(dismissal);\n this.afterDismissedSubject.complete();\n this.updatedSubject.complete();\n\n this.dismissCallback(this as unknown as ToastRef);\n }\n\n private _markVisible(): void {\n if (this.enterTimer !== null) {\n clearTimeout(this.enterTimer);\n this.enterTimer = null;\n }\n const current = this.stateSignal();\n if (current !== 'entering') return;\n this.stateSignal.set('visible');\n this.afterOpenedSubject.next();\n this.afterOpenedSubject.complete();\n if (this.config.duration && this.config.duration > 0 && !this.paused) {\n this._startAutoDismissTimer();\n }\n }\n\n private _startAutoDismissTimer(): void {\n if (this.autoDismissRemaining <= 0) return;\n if (this.autoDismissTimer !== null) clearTimeout(this.autoDismissTimer);\n this.autoDismissStartedAt = Date.now();\n this.autoDismissTimer = setTimeout(\n () => this._dismissWith('timeout'),\n this.autoDismissRemaining,\n );\n }\n}\n","import {\n type ComponentRef,\n type EnvironmentProviders,\n Injectable,\n Injector,\n type OnDestroy,\n type Provider,\n type Signal,\n TemplateRef,\n type Type,\n inject,\n makeEnvironmentProviders,\n signal,\n} from '@angular/core';\nimport {\n createGlobalPositionStrategy,\n Overlay,\n type OverlayRef,\n} from '@angular/cdk/overlay';\nimport { ComponentPortal } from '@angular/cdk/portal';\nimport { type Observable, Subject, defer, startWith } from 'rxjs';\nimport {\n TW_TOAST_DATA,\n TW_TOAST_DEFAULT_OPTIONS,\n TW_TOAST_REF,\n ToastConfig,\n type ToastContent,\n type ToastPosition,\n type ToastSeverity,\n type ToastTemplateContext,\n} from './toast-config';\nimport { ToastContainerComponent } from './toast-container';\nimport { ToastRef } from './toast-ref';\n\nconst OVERLAY_EDGE_OFFSET = '1rem';\n\ninterface PositionOverlay {\n overlayRef: OverlayRef;\n containerRef: ComponentRef<ToastContainerComponent>;\n}\n\ninterface PromiseMessages<T> {\n loading: string;\n success: string | ((value: T) => string);\n error: string | ((err: unknown) => string);\n}\n\nlet nextToastId = 0;\n\nfunction generateId(): string {\n return `tw-toast-${++nextToastId}`;\n}\n\n/**\n * Opens Tailwind-styled toasts / snackbars inside CDK overlays. One overlay is\n * created per `ToastPosition` on first use and reused for the lifetime of the\n * service; toasts stack vertically inside their position container.\n *\n * Not `providedIn: 'root'` — register via {@link provideToast}.\n */\n@Injectable()\nexport class ToastService implements OnDestroy {\n private readonly overlay = inject(Overlay);\n private readonly injector = inject(Injector);\n private readonly defaultOptions =\n inject(TW_TOAST_DEFAULT_OPTIONS, { optional: true }) ?? {};\n private readonly parent = inject(ToastService, { optional: true, skipSelf: true });\n\n private readonly positionOverlays = new Map<ToastPosition, PositionOverlay>();\n private readonly activeRefsAtThisLevel = signal<readonly ToastRef[]>([]);\n private readonly afterOpenedSubject = new Subject<ToastRef>();\n private readonly afterAllDismissedSubject = new Subject<void>();\n\n /** Reactive list of every toast that has not yet fully dismissed. */\n readonly activeToasts: Signal<readonly ToastRef[]> = this.parent\n ? this.parent.activeToasts\n : this.activeRefsAtThisLevel.asReadonly();\n\n /** Emits every time a new toast is opened. */\n readonly afterOpened: Observable<ToastRef> = this.parent\n ? this.parent.afterOpened\n : this.afterOpenedSubject.asObservable();\n\n /** Emits when the active-toasts list transitions back to empty. Emits immediately on subscribe if none are open. */\n readonly afterAllDismissed: Observable<void> = defer(() =>\n this.activeToasts().length\n ? this.getAfterAllDismissedSource()\n : this.getAfterAllDismissedSource().pipe(startWith(undefined as void)),\n );\n\n /**\n * Open a toast. Content may be a string (rendered inside the default\n * `ToastComponent`), a `TemplateRef` (rendered via `TemplatePortal`), or a\n * component class (rendered via `ComponentPortal` with `TW_TOAST_REF` +\n * `TW_TOAST_DATA` injected).\n */\n show<R = void, D = unknown>(\n content: ToastContent,\n config?: ToastConfig<D, R>,\n ): ToastRef<unknown, R> {\n const merged = this.resolveConfig<D, R>(config);\n return this.openInternal<R>(content, merged);\n }\n\n /** Shorthand for `show(message, { severity: 'success', ... })`. */\n success<R = void>(message: string, config?: ToastConfig<unknown, R>): ToastRef<unknown, R> {\n return this.openWithSeverity('success', message, config);\n }\n\n /** Shorthand for `show(message, { severity: 'error', politeness: 'assertive', ... })`. */\n error<R = void>(message: string, config?: ToastConfig<unknown, R>): ToastRef<unknown, R> {\n return this.openWithSeverity('error', message, config, 'assertive');\n }\n\n /** Shorthand for `show(message, { severity: 'warning', ... })`. */\n warning<R = void>(message: string, config?: ToastConfig<unknown, R>): ToastRef<unknown, R> {\n return this.openWithSeverity('warning', message, config);\n }\n\n /** Shorthand for `show(message, { severity: 'info', ... })`. */\n info<R = void>(message: string, config?: ToastConfig<unknown, R>): ToastRef<unknown, R> {\n return this.openWithSeverity('info', message, config);\n }\n\n /**\n * Show a loading toast, then swap it to success / error when the promise\n * settles. The same ref is returned and re-used across all three states.\n * The loading toast is pinned (duration forced to 0, dismissible forced to\n * false) until the promise resolves.\n */\n promise<T, R = void>(\n promise: Promise<T>,\n messages: PromiseMessages<T>,\n config?: ToastConfig<unknown, R>,\n ): ToastRef<unknown, R> {\n const resolvedDuration = config?.duration ?? this.defaultOptions.duration ?? 5000;\n const ref = this.show<R>(messages.loading, {\n ...(config as ToastConfig<unknown, R>),\n severity: 'neutral',\n duration: 0,\n dismissible: false,\n });\n\n promise.then(\n (value) => {\n if (ref.state() === 'dismissed' || ref.state() === 'dismissing') return;\n const msg = typeof messages.success === 'function' ? messages.success(value) : messages.success;\n ref.update({\n severity: 'success',\n content: msg,\n duration: resolvedDuration,\n dismissible: config?.dismissible ?? true,\n });\n this.announceUpdate(ref);\n },\n (err) => {\n if (ref.state() === 'dismissed' || ref.state() === 'dismissing') return;\n const msg = typeof messages.error === 'function' ? messages.error(err) : messages.error;\n ref.update({\n severity: 'error',\n content: msg,\n duration: resolvedDuration,\n dismissible: config?.dismissible ?? true,\n });\n this.announceUpdate(ref);\n },\n );\n\n return ref;\n }\n\n /** Dismiss a toast by id. No-op if no matching toast is active. */\n dismiss(id: string): void {\n const match = this.activeToasts().find((ref) => ref.id === id);\n if (match) match.dismiss();\n }\n\n /** Dismiss every active toast across every position. */\n dismissAll(): void {\n const refs = [...this.activeToasts()];\n for (let i = refs.length - 1; i >= 0; i--) refs[i].dismiss();\n }\n\n /** Look up an active toast by id. */\n getToastById<R = unknown>(id: string): ToastRef<unknown, R> | undefined {\n return this.activeToasts().find((ref) => ref.id === id) as\n | ToastRef<unknown, R>\n | undefined;\n }\n\n ngOnDestroy(): void {\n const refs = [...this.activeRefsAtThisLevel()];\n for (let i = refs.length - 1; i >= 0; i--) refs[i]._finishDismiss();\n for (const { overlayRef } of this.positionOverlays.values()) {\n overlayRef.dispose();\n }\n this.positionOverlays.clear();\n this.afterOpenedSubject.complete();\n this.afterAllDismissedSubject.complete();\n }\n\n private openWithSeverity<R>(\n severity: ToastSeverity,\n message: string,\n config?: ToastConfig<unknown, R>,\n forcedPoliteness?: 'polite' | 'assertive' | 'off',\n ): ToastRef<unknown, R> {\n const merged = this.resolveConfig<unknown, R>(config);\n merged.severity = severity;\n if (forcedPoliteness && !config?.politeness) merged.politeness = forcedPoliteness;\n return this.openInternal<R>(message, merged);\n }\n\n private openInternal<R>(\n content: ToastContent,\n config: ToastConfig<unknown, R>,\n ): ToastRef<unknown, R> {\n const id = config.id ?? generateId();\n config.id = id;\n\n const ref = new ToastRef<unknown, R>(id, content, config, (dismissed) =>\n this.handleDismissed(dismissed),\n );\n\n if (isComponentConstructor(content)) {\n const injector = this.getContainerForPosition(\n config.position!,\n ).containerRef.instance._createContentInjector(ref as ToastRef<unknown, unknown>);\n ref._portal = new ComponentPortal(content, null, injector);\n }\n\n this.enforceMaxVisible(config.position!, config.maxVisible ?? 5);\n this.registerOpen(ref);\n this.attachToContainer(ref, config.position!);\n this.announceOpen(ref);\n return ref;\n }\n\n private enforceMaxVisible(position: ToastPosition, max: number): void {\n if (max <= 0) return;\n const atPosition = this.activeToasts().filter(\n (ref) =>\n (ref.config.position ?? 'bottom-right') === position &&\n ref.state() !== 'dismissing' &&\n ref.state() !== 'dismissed',\n );\n while (atPosition.length >= max) {\n const oldest = atPosition.shift();\n if (!oldest) break;\n oldest._dismissAsMaxExceeded();\n }\n }\n\n private registerOpen<R>(ref: ToastRef<unknown, R>): void {\n const scope = this.parent ?? this;\n const anyRef = ref as ToastRef<unknown, unknown>;\n scope.activeRefsAtThisLevel.update((list) => [...list, anyRef]);\n scope.afterOpenedSubject.next(anyRef);\n }\n\n private handleDismissed(ref: ToastRef): void {\n const scope = this.parent ?? this;\n scope.activeRefsAtThisLevel.update((list) => list.filter((r) => r !== ref));\n\n const position = ref.config.position ?? 'bottom-right';\n const entry = this.positionOverlays.get(position);\n if (entry) {\n const instance = entry.containerRef.instance;\n instance.visibleRefs.update((list) => list.filter((r) => r !== ref));\n }\n\n if (scope.activeRefsAtThisLevel().length === 0) {\n scope.afterAllDismissedSubject.next();\n }\n }\n\n private attachToContainer<R>(ref: ToastRef<unknown, R>, position: ToastPosition): void {\n const entry = this.getContainerForPosition(position);\n const instance = entry.containerRef.instance;\n const anyRef = ref as ToastRef<unknown, unknown>;\n instance.visibleRefs.update((list) => [...list, anyRef]);\n ref._overlayPanelElement = entry.overlayRef.overlayElement;\n }\n\n private announceOpen<R>(ref: ToastRef<unknown, R>): void {\n const entry = this.positionOverlays.get(ref.config.position ?? 'bottom-right');\n entry?.containerRef.instance._announceOpen(ref as ToastRef<unknown, unknown>);\n }\n\n private announceUpdate<R>(ref: ToastRef<unknown, R>): void {\n const entry = this.positionOverlays.get(ref.config.position ?? 'bottom-right');\n entry?.containerRef.instance._announceUpdate(ref as ToastRef<unknown, unknown>);\n }\n\n private getContainerForPosition(position: ToastPosition): PositionOverlay {\n const existing = this.positionOverlays.get(position);\n if (existing) return existing;\n\n const overlayRef = this.overlay.create({\n positionStrategy: this.buildPositionStrategy(position),\n scrollStrategy: this.overlay.scrollStrategies.noop(),\n hasBackdrop: false,\n panelClass: ['tw-toast-overlay', `tw-toast-overlay-${position}`],\n });\n\n const containerPortal = new ComponentPortal(ToastContainerComponent, null, this.injector);\n const containerRef = overlayRef.attach(containerPortal);\n containerRef.instance.position.set(position);\n containerRef.instance.regionLabel.set(\n this.defaultOptions.regionAriaLabel ?? 'Notifications',\n );\n\n const entry: PositionOverlay = { overlayRef, containerRef };\n this.positionOverlays.set(position, entry);\n return entry;\n }\n\n private buildPositionStrategy(position: ToastPosition) {\n const strategy = createGlobalPositionStrategy(this.injector);\n switch (position) {\n case 'top-right':\n strategy.top(OVERLAY_EDGE_OFFSET).right(OVERLAY_EDGE_OFFSET);\n break;\n case 'top-left':\n strategy.top(OVERLAY_EDGE_OFFSET).left(OVERLAY_EDGE_OFFSET);\n break;\n case 'top-center':\n strategy.top(OVERLAY_EDGE_OFFSET).centerHorizontally();\n break;\n case 'bottom-right':\n strategy.bottom(OVERLAY_EDGE_OFFSET).right(OVERLAY_EDGE_OFFSET);\n break;\n case 'bottom-left':\n strategy.bottom(OVERLAY_EDGE_OFFSET).left(OVERLAY_EDGE_OFFSET);\n break;\n case 'bottom-center':\n strategy.bottom(OVERLAY_EDGE_OFFSET).centerHorizontally();\n break;\n }\n return strategy;\n }\n\n private resolveConfig<D, R>(config: ToastConfig<D, R> | undefined): ToastConfig<D, R> {\n const merged = new ToastConfig<D, R>();\n Object.assign(merged, this.defaultOptions, config);\n return merged;\n }\n\n private getAfterAllDismissedSource(): Subject<void> {\n return this.parent ? this.parent.getAfterAllDismissedSource() : this.afterAllDismissedSubject;\n }\n}\n\nfunction isComponentConstructor(value: unknown): value is Type<unknown> {\n return typeof value === 'function' && !(value instanceof TemplateRef);\n}\n\n/**\n * Registers {@link ToastService} for dependency injection and installs optional\n * application-wide defaults.\n *\n * @example\n * ```ts\n * bootstrapApplication(AppComponent, {\n * providers: [provideToast({ position: 'top-right', duration: 4000 })]\n * });\n * ```\n */\nexport function provideToast(\n defaultOptions?: Partial<ToastConfig>,\n): EnvironmentProviders {\n const providers: Provider[] = [ToastService];\n if (defaultOptions) {\n providers.push({ provide: TW_TOAST_DEFAULT_OPTIONS, useValue: defaultOptions });\n }\n return makeEnvironmentProviders(providers);\n}\n\n/** Re-exported helpers so `inject(TW_TOAST_DATA)` / `inject(TW_TOAST_REF)` work from component content. */\nexport { TW_TOAST_DATA, TW_TOAST_REF };\n\n// Re-exports to keep the barrel tidy.\nexport type { ToastContent, ToastTemplateContext };\n\nexport const ToastInternals = {\n /** @internal Reset id counter for tests. */\n _resetIdForTesting(): void {\n nextToastId = 0;\n },\n};\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;AAmDA;;;AAGG;AACH;AACA;AACA;MACa,WAAW,CAAA;;IAEtB,QAAQ,GAAmB,MAAM;;IAGjC,QAAQ,GAAmB,cAAc;;IAGzC,QAAQ,GAAY,IAAI;;;;IAKxB,WAAW,GAAa,IAAI;AAE5B;;;;AAIG;AACH,IAAA,UAAU;;AAGV,IAAA,MAAM;;IAGN,IAAI,GAAc,IAAI;;AAGtB,IAAA,UAAU;AAEV;;;;;;;AAOG;AACH,IAAA,IAAI;;;;IAKJ,kBAAkB,GAAa,IAAI;;;;IAKnC,cAAc,GAAa,IAAI;AAE/B;;;AAGG;IACH,UAAU,GAAY,CAAC;;AAGvB,IAAA,EAAE;;AAGF,IAAA,SAAS;;AAGT,IAAA,eAAe;AAChB;AAED;MACa,aAAa,GAAG,IAAI,cAAc,CAAU,eAAe;AAExE;MACa,YAAY,GAAG,IAAI,cAA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AC,KAAc,EAAA;IAC5C,OAAO,OAAO,KAAK,KAAK,UAAU,IAAI,EAAE,KAAK,YAAY,WAAW,CAAC;AACvE;AAEA;;;;;;;;;;AAUG;AACG,SAAU,YAAY,CAC1B,cAAqC,EAAA;AAErC,IAAA,MAAM,SAAS,GAAe,CAAC,YAAY,CAAC;IAC5C,IAAI,cAAc,EAAE;AAClB,QAAA,SAAS,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,wBAAwB,EAAE,QAAQ,EAAE,cAAc,EAAE,CAAC;IACjF;AACA,IAAA,OAAO,wBAAwB,CAAC,SAAS,CAAC;AAC5C;AAQO,MAAM,cAAc,GAAG;;IAE5B,kBAAkB,GAAA;QAChB,WAAW,GAAG,CAAC;IACjB,CAAC;CACF;;ACrYD;;AAEG;;;;"}
1
+ {"version":3,"file":"cdevhub-ngx-tw-toast.mjs","sources":["../../../projects/ngx-tw/toast/toast-config.ts","../../../projects/ngx-tw/toast/toast-ref.ts","../../../projects/ngx-tw/toast/toast.ts","../../../projects/ngx-tw/toast/toast-component.ts","../../../projects/ngx-tw/toast/cdevhub-ngx-tw-toast.ts"],"sourcesContent":["import { InjectionToken, type TemplateRef, type Type } from '@angular/core';\nimport type { ToastRef } from './toast-ref';\n\n/** Severity variant — drives color palette, default icon, and live-region politeness. */\nexport type ToastSeverity = 'info' | 'success' | 'warning' | 'error' | 'neutral';\n\n/** Screen anchor for a stack of toasts. One CDK overlay is created per position on first use. */\nexport type ToastPosition =\n | 'top-left'\n | 'top-center'\n | 'top-right'\n | 'bottom-left'\n | 'bottom-center'\n | 'bottom-right';\n\n/** Lifecycle state of a single toast. */\nexport type ToastState = 'entering' | 'visible' | 'paused' | 'dismissing' | 'dismissed';\n\n/** Reason a toast was dismissed. */\nexport type ToastDismissReason =\n | 'action'\n | 'timeout'\n | 'swipe'\n | 'manual'\n | 'programmatic'\n | 'max-exceeded';\n\n/** Payload forwarded to `afterDismissed()` subscribers. */\nexport interface ToastDismissal<R = unknown> {\n /** Why the toast closed. */\n reason: ToastDismissReason;\n /** Optional value forwarded from `ref.dismiss(result)`. */\n result?: R;\n}\n\n/** Context object handed to `TemplateRef` content (`let-data let-ref=\"ref\"`). */\nexport interface ToastTemplateContext<T = unknown> {\n /** Data value from `config.data`, unwrapped as the template's `$implicit`. */\n $implicit: T;\n /** Reference to the toast itself, bound as `let-ref=\"ref\"`. */\n ref: ToastRef<unknown, unknown>;\n}\n\n/** Action button configuration. When `handler` is omitted the button dismisses the toast with reason `'action'`. */\nexport interface ToastAction {\n /** Visible label of the action button. */\n label: string;\n /** Optional callback invoked when the action is clicked or `ref.triggerAction()` is called. */\n handler?: (ref: ToastRef) => void;\n}\n\n/**\n * Per-call configuration for {@link ToastService} methods. Also used as the\n * payload of {@link TW_TOAST_DEFAULT_OPTIONS} for app-wide defaults.\n */\n// `R` is a phantom result-type kept for parity with `ToastRef<D, R>` / service\n// generics — consumers pass it through `ToastConfig<D, R>` so the resulting\n// `ToastRef.afterClosed()` is correctly typed.\nexport class ToastConfig<D = unknown, _R = unknown> {\n /** Severity of the toast. Defaults to `'info'`. */\n severity?: ToastSeverity = 'info';\n\n /** Screen position of the toast stack. Defaults to `'bottom-right'`. */\n position?: ToastPosition = 'bottom-right';\n\n /**\n * Auto-dismiss duration in ms. `0` disables auto-dismiss. Defaults to `5000`.\n *\n * The duration alone would fail SC 2.2.1 (Timing Adjustable) — a time limit the\n * user cannot influence. What makes 5s conformant is `pauseOnInteraction`\n * (default `true`): the clock stops while the pointer is over the toast or\n * focus is anywhere inside it, and resumes on leave / blur. Setting\n * `pauseOnInteraction: false` alongside a non-zero duration re-introduces the\n * failure, so pair it with `duration: 0`.\n */\n duration?: number = 5000;\n\n // Default true: toasts must offer an escape hatch — sticky / long-duration toasts\n // otherwise trap users; opt-out only for ephemeral progress markers paired with `duration`.\n /** When true, renders a close (×) button. Defaults to `true`. */\n dismissible?: boolean = true;\n\n /**\n * Live-region politeness. When omitted, resolves to `'assertive'` for\n * `severity: 'error'` and `'polite'` otherwise. Pass `'off'` to skip\n * `LiveAnnouncer` entirely.\n */\n politeness?: 'polite' | 'assertive' | 'off';\n\n /** Action button configuration. Omit to hide the action button. */\n action?: ToastAction;\n\n /** Arbitrary data provided to component / template content via `TW_TOAST_DATA`. */\n data?: D | null = null;\n\n /** Extra CSS classes merged onto the toast panel root via `twMerge`. */\n panelClass?: string | string[];\n\n /**\n * Icon override. Pass a string (treated as text glyph / icon name) or\n * `false` to hide the icon. When omitted the severity-default icon is used.\n *\n * Note: To render arbitrary icon markup, pass a `TemplateRef` to `show()`\n * itself (the whole toast is a custom template) — the icon slot accepts only\n * primitives for the string-content path.\n */\n icon?: string | false;\n\n // Default true: this is what keeps a non-zero `duration` conformant with\n // SC 2.2.1 (Timing Adjustable) — it is the user's control over the time limit,\n // not a nicety. Also matches Material/Radix/Sonner. Opt out only together with\n // `duration: 0`, for fully ambient progress indicators.\n /** When true, pause the auto-dismiss timer while the toast is hovered or holds focus anywhere inside it, resuming on leave / blur. Defaults to `true`. */\n pauseOnInteraction?: boolean = true;\n\n // Default true: matches mobile-platform expectations and gives non-precise pointers\n // (touch) an easy dismiss gesture; opt-out only if the gesture conflicts with content.\n /** Enable horizontal swipe-to-dismiss via pointer gestures. Defaults to `true`. */\n swipeToDismiss?: boolean = true;\n\n /**\n * Maximum visible toasts *per position*. When exceeded, the oldest toast in\n * that position dismisses with reason `'max-exceeded'`. Defaults to `5`.\n */\n maxVisible?: number = 5;\n\n /** Explicit id. When omitted a unique id is generated. */\n id?: string;\n\n /** Accessible label applied to the toast element. When omitted, text content is used. */\n ariaLabel?: string;\n\n /** Accessible label applied to the per-position `role=\"region\"` container. Defaults to `'Notifications'`. */\n regionAriaLabel?: string;\n}\n\n/** Injection token providing `config.data` to projected component / template content. */\nexport const TW_TOAST_DATA = new InjectionToken<unknown>('TW_TOAST_DATA');\n\n/** Injection token providing the owning {@link ToastRef} to projected component content. */\nexport const TW_TOAST_REF = new InjectionToken<ToastRef>('TW_TOAST_REF');\n\n/** Injection token carrying application-wide toast defaults. Set via `provideToast(defaults)`. */\nexport const TW_TOAST_DEFAULT_OPTIONS = new InjectionToken<Partial<ToastConfig>>(\n 'TW_TOAST_DEFAULT_OPTIONS',\n);\n\n/** Accepted content forms for `ToastService.show()`. */\nexport type ToastContent = string | TemplateRef<ToastTemplateContext> | Type<unknown>;\n","import { signal, type Signal, type WritableSignal } from '@angular/core';\nimport type { Portal } from '@angular/cdk/portal';\nimport { type Observable, ReplaySubject, Subject } from 'rxjs';\nimport type {\n ToastAction,\n ToastConfig,\n ToastContent,\n ToastDismissReason,\n ToastDismissal,\n ToastSeverity,\n ToastState,\n} from './toast-config';\n\n/** Duration (ms) of the toast enter / leave animation. Must match `_base.css` toast-slide keyframes. */\nexport const TOAST_ANIMATION_DURATION = 150;\n\n/** Padding added to animation fallback timers to guarantee cleanup if the CSS event is swallowed. */\nexport const TOAST_ANIMATION_FALLBACK_PADDING = 50;\n\n/** Patch accepted by {@link ToastRef.update}. Mirrors the subset of `ToastConfig` that is safe to mutate live. */\nexport interface ToastUpdatePatch {\n /** New severity — updates color, default icon, and (for `'error'`) live-region politeness. */\n severity?: ToastSeverity;\n /** New auto-dismiss duration in ms. Restarts the timer if the toast is visible. `0` disables auto-dismiss. */\n duration?: number;\n /** Replace or clear the action button. Pass `null` to remove. */\n action?: ToastAction | null;\n /** Override the icon slot. */\n icon?: string | false | undefined;\n /** Replace the `TW_TOAST_DATA` payload. */\n data?: unknown;\n /** Replace the aria-label applied to the toast wrapper. */\n ariaLabel?: string;\n /** Replace the toast's content (string, template, or component). */\n content?: ToastContent;\n /** Whether the close button is shown. */\n dismissible?: boolean;\n}\n\n/**\n * Reference to a toast opened via {@link ToastService}. Use to dismiss the\n * toast, pause / resume its auto-dismiss timer, or observe its lifecycle.\n *\n * The service returns a ref synchronously from every open method; the toast\n * itself is attached asynchronously inside the CDK overlay.\n */\nexport class ToastRef<C = unknown, R = unknown> {\n /** Unique id. Generated if `config.id` was not provided. */\n readonly id: string;\n\n /** Instance of the component rendered inside the toast (only for component-class content). */\n componentInstance: C | null = null;\n\n /** Resolved static config for this toast (defaults merged, severity shorthand applied). */\n readonly config: Readonly<ToastConfig<unknown, R>>;\n\n /** Reactive lifecycle state. */\n readonly state: Signal<ToastState>;\n\n /** Reactive severity — may change after `update()` (used by the `promise()` helper). */\n readonly severity: Signal<ToastSeverity>;\n\n /** Reactive dismissibility. */\n readonly dismissible: Signal<boolean>;\n\n /** Reactive icon override. */\n readonly icon: Signal<string | false | undefined>;\n\n /** Reactive content (the source of truth for what gets rendered). */\n readonly content: Signal<ToastContent>;\n\n /** Reactive action button configuration. */\n readonly action: Signal<ToastAction | undefined>;\n\n /** Reactive accessible label. */\n readonly ariaLabel: Signal<string | undefined>;\n\n /** Reactive data payload — re-read by the container to update `TW_TOAST_DATA`. */\n readonly data: Signal<unknown>;\n\n /** @internal Reactive \"transient\" class applied by swipe gestures (e.g. `translate3d(...)`). */\n readonly swipeTransform = signal<string | null>(null);\n\n /** @internal Reactive opacity applied during swipe gestures. */\n readonly swipeOpacity = signal<number | null>(null);\n\n /** @internal Leave-animation class override. When non-null, container uses this instead of the position default. */\n readonly leaveAnimationOverride = signal<string | null>(null);\n\n /** @internal Portal for component-class content. Set by the service; null for string / template content. */\n _portal: Portal<unknown> | null = null;\n\n /** @internal True while the pointer hovers this toast. */\n _hovered = false;\n\n /** @internal True while focus is within this toast. */\n _focused = false;\n\n /** @internal Set by the service so the ref can reach the CDK-owned OverlayRef if it needs to. */\n _overlayPanelElement: HTMLElement | null = null;\n\n private readonly stateSignal = signal<ToastState>('entering');\n private readonly severitySignal: WritableSignal<ToastSeverity>;\n private readonly dismissibleSignal: WritableSignal<boolean>;\n private readonly iconSignal: WritableSignal<string | false | undefined>;\n private readonly contentSignal: WritableSignal<ToastContent>;\n private readonly actionSignal: WritableSignal<ToastAction | undefined>;\n private readonly ariaLabelSignal: WritableSignal<string | undefined>;\n private readonly dataSignal: WritableSignal<unknown>;\n\n private readonly afterOpenedSubject = new ReplaySubject<void>(1);\n private readonly beforeDismissedSubject = new ReplaySubject<R | undefined>(1);\n private readonly afterDismissedSubject = new ReplaySubject<ToastDismissal<R>>(1);\n private readonly updatedSubject = new Subject<ToastUpdatePatch>();\n\n private dismissReason: ToastDismissReason = 'programmatic';\n private dismissResult: R | undefined;\n private autoDismissTimer: ReturnType<typeof setTimeout> | null = null;\n private autoDismissStartedAt = 0;\n private autoDismissRemaining = 0;\n private paused = false;\n private enterTimer: ReturnType<typeof setTimeout> | null = null;\n private leaveTimer: ReturnType<typeof setTimeout> | null = null;\n\n constructor(\n id: string,\n content: ToastContent,\n config: ToastConfig<unknown, R>,\n private readonly dismissCallback: (ref: ToastRef) => void,\n ) {\n this.id = id;\n this.config = config;\n this.severitySignal = signal(config.severity ?? 'info');\n this.dismissibleSignal = signal(config.dismissible ?? true);\n this.iconSignal = signal<string | false | undefined>(\n typeof config.icon === 'string' || config.icon === false ? config.icon : undefined,\n );\n this.contentSignal = signal(content);\n this.actionSignal = signal(config.action);\n this.ariaLabelSignal = signal(config.ariaLabel);\n this.dataSignal = signal(config.data ?? null);\n\n this.state = this.stateSignal.asReadonly();\n this.severity = this.severitySignal.asReadonly();\n this.dismissible = this.dismissibleSignal.asReadonly();\n this.icon = this.iconSignal.asReadonly();\n this.content = this.contentSignal.asReadonly();\n this.action = this.actionSignal.asReadonly();\n this.ariaLabel = this.ariaLabelSignal.asReadonly();\n this.data = this.dataSignal.asReadonly();\n\n this.autoDismissRemaining = config.duration ?? 0;\n }\n\n /**\n * @internal Start the enter animation clock. Called by the service once the\n * toast has actually been attached to its container.\n *\n * This deliberately does NOT run from the constructor. The renderer is loaded\n * through a dynamic `import()`, so a ref can exist for an arbitrary stretch\n * before anything is on screen — starting the clock at construction would let\n * a toast burn part (or all) of its auto-dismiss duration while still\n * invisible on a slow connection. Idempotent and safe to call after dismissal.\n */\n _startEnterSequence(): void {\n if (this.enterTimer !== null) return;\n if (this.stateSignal() !== 'entering') return;\n this.enterTimer = setTimeout(\n () => this._markVisible(),\n TOAST_ANIMATION_DURATION + TOAST_ANIMATION_FALLBACK_PADDING,\n );\n }\n\n /**\n * Dismiss the toast programmatically. The leave animation plays before the\n * element is removed and subscribers are notified. Safe to call multiple times.\n */\n dismiss(result?: R): void {\n this._dismissWith('programmatic', result);\n }\n\n /** Pause the auto-dismiss timer (if any). Called automatically on hover / focus when `pauseOnInteraction` is true. */\n pause(): void {\n if (this.paused) return;\n this.paused = true;\n if (this.autoDismissTimer !== null) {\n const elapsed = Date.now() - this.autoDismissStartedAt;\n this.autoDismissRemaining = Math.max(0, this.autoDismissRemaining - elapsed);\n clearTimeout(this.autoDismissTimer);\n this.autoDismissTimer = null;\n }\n const current = this.stateSignal();\n if (current === 'visible') this.stateSignal.set('paused');\n }\n\n /** Resume the auto-dismiss timer with the remaining time. */\n resume(): void {\n if (!this.paused) return;\n this.paused = false;\n if (this.stateSignal() === 'paused') this.stateSignal.set('visible');\n if (this.config.duration && this.config.duration > 0) {\n if (this.autoDismissRemaining <= 0) {\n this._dismissWith('timeout');\n return;\n }\n this._startAutoDismissTimer();\n }\n }\n\n /**\n * @internal Update the hover state. When `pauseOnInteraction` is set and\n * either hover or focus is active, the auto-dismiss timer is paused.\n */\n _setHovered(hovered: boolean): void {\n this._hovered = hovered;\n this._syncInteractionPause();\n }\n\n /** @internal Update the focus-within state. See `_setHovered`. */\n _setFocused(focused: boolean): void {\n this._focused = focused;\n this._syncInteractionPause();\n }\n\n private _syncInteractionPause(): void {\n if (!this.config.pauseOnInteraction) return;\n if (this._hovered || this._focused) {\n this.pause();\n } else {\n this.resume();\n }\n }\n\n /** Invoke the configured action handler (or dismiss with reason `'action'` if none is set). */\n triggerAction(): void {\n const action = this.actionSignal();\n if (!action) return;\n if (action.handler) {\n action.handler(this as unknown as ToastRef);\n } else {\n this._dismissWith('action');\n }\n }\n\n /** Mutate the live toast in place. Used by the `promise()` helper to swap loading → success / error. */\n update(patch: ToastUpdatePatch): void {\n const currentState = this.stateSignal();\n if (currentState === 'dismissing' || currentState === 'dismissed') return;\n\n if (patch.severity !== undefined) this.severitySignal.set(patch.severity);\n if (patch.dismissible !== undefined) this.dismissibleSignal.set(patch.dismissible);\n if (patch.icon !== undefined) this.iconSignal.set(patch.icon);\n if (patch.content !== undefined) this.contentSignal.set(patch.content);\n if (patch.action !== undefined) this.actionSignal.set(patch.action ?? undefined);\n if (patch.ariaLabel !== undefined) this.ariaLabelSignal.set(patch.ariaLabel);\n if (patch.data !== undefined) this.dataSignal.set(patch.data);\n\n if (patch.duration !== undefined) {\n (this.config as { duration?: number }).duration = patch.duration;\n this.autoDismissRemaining = patch.duration;\n if (this.autoDismissTimer !== null) {\n clearTimeout(this.autoDismissTimer);\n this.autoDismissTimer = null;\n }\n if (!this.paused && (currentState === 'visible' || currentState === 'paused')) {\n this._startAutoDismissTimer();\n }\n }\n\n this.updatedSubject.next(patch);\n }\n\n /** Observable that emits once after the enter animation completes. */\n afterOpened(): Observable<void> {\n return this.afterOpenedSubject.asObservable();\n }\n\n /** Observable that emits once when the dismiss sequence starts. */\n beforeDismissed(): Observable<R | undefined> {\n return this.beforeDismissedSubject.asObservable();\n }\n\n /** Observable that emits once after the leave animation completes and the ref is cleaned up. */\n afterDismissed(): Observable<ToastDismissal<R>> {\n return this.afterDismissedSubject.asObservable();\n }\n\n /** @internal Observable of `update()` calls. The container subscribes to re-announce to `LiveAnnouncer`. */\n _updates(): Observable<ToastUpdatePatch> {\n return this.updatedSubject.asObservable();\n }\n\n /** @internal Called by the service when the max-visible cap is exceeded. */\n _dismissAsMaxExceeded(): void {\n this._dismissWith('max-exceeded');\n }\n\n /** @internal Start the dismiss sequence with the given reason. */\n _dismissWith(reason: ToastDismissReason, result?: R): void {\n const currentState = this.stateSignal();\n if (currentState === 'dismissing' || currentState === 'dismissed') return;\n\n this.dismissReason = reason;\n this.dismissResult = result;\n this.stateSignal.set('dismissing');\n\n if (this.autoDismissTimer !== null) {\n clearTimeout(this.autoDismissTimer);\n this.autoDismissTimer = null;\n }\n if (this.enterTimer !== null) {\n clearTimeout(this.enterTimer);\n this.enterTimer = null;\n }\n\n this.beforeDismissedSubject.next(result);\n this.beforeDismissedSubject.complete();\n\n this.leaveTimer = setTimeout(\n () => this._finishDismiss(),\n TOAST_ANIMATION_DURATION + TOAST_ANIMATION_FALLBACK_PADDING,\n );\n }\n\n /** @internal Finalise dismissal — clears timers, emits `afterDismissed`, and hands control back to the service. */\n _finishDismiss(): void {\n if (this.stateSignal() === 'dismissed') return;\n this.stateSignal.set('dismissed');\n\n if (this.leaveTimer !== null) {\n clearTimeout(this.leaveTimer);\n this.leaveTimer = null;\n }\n\n const dismissal: ToastDismissal<R> = {\n reason: this.dismissReason,\n result: this.dismissResult,\n };\n this.afterDismissedSubject.next(dismissal);\n this.afterDismissedSubject.complete();\n this.updatedSubject.complete();\n\n this.dismissCallback(this as unknown as ToastRef);\n }\n\n private _markVisible(): void {\n if (this.enterTimer !== null) {\n clearTimeout(this.enterTimer);\n this.enterTimer = null;\n }\n const current = this.stateSignal();\n if (current !== 'entering') return;\n this.stateSignal.set('visible');\n this.afterOpenedSubject.next();\n this.afterOpenedSubject.complete();\n if (this.config.duration && this.config.duration > 0 && !this.paused) {\n this._startAutoDismissTimer();\n }\n }\n\n private _startAutoDismissTimer(): void {\n if (this.autoDismissRemaining <= 0) return;\n if (this.autoDismissTimer !== null) clearTimeout(this.autoDismissTimer);\n this.autoDismissStartedAt = Date.now();\n this.autoDismissTimer = setTimeout(\n () => this._dismissWith('timeout'),\n this.autoDismissRemaining,\n );\n }\n}\n","import {\n type EnvironmentProviders,\n Injectable,\n Injector,\n type OnDestroy,\n type Provider,\n type Signal,\n inject,\n makeEnvironmentProviders,\n signal,\n} from '@angular/core';\nimport { type Observable, Subject, defer, startWith } from 'rxjs';\nimport {\n TW_TOAST_DATA,\n TW_TOAST_DEFAULT_OPTIONS,\n TW_TOAST_REF,\n ToastConfig,\n type ToastContent,\n type ToastPosition,\n type ToastSeverity,\n type ToastTemplateContext,\n} from './toast-config';\nimport { ToastRef } from './toast-ref';\n// Type-only: importing `ToastRenderer` as a value here would drag CDK overlay\n// and the toast components back into the eager chunk. See `toast-renderer.ts`.\nimport type { ToastRenderer } from './toast-renderer';\n\n/**\n * The three messages {@link ToastService.promise} shows as a promise settles.\n * `success` and `error` may be functions, receiving the resolved value or the\n * rejection reason so the message can quote it.\n */\nexport interface PromiseMessages<T> {\n loading: string;\n success: string | ((value: T) => string);\n error: string | ((err: unknown) => string);\n}\n\nlet nextToastId = 0;\n\nfunction generateId(): string {\n return `tw-toast-${++nextToastId}`;\n}\n\n/**\n * Opens Tailwind-styled toasts / snackbars inside CDK overlays. One overlay is\n * created per `ToastPosition` on first use and reused for the lifetime of the\n * service; toasts stack vertically inside their position container.\n *\n * The rendering layer (CDK overlay + the toast components) is loaded through a\n * dynamic `import()` on the first `show()` call, so merely registering this\n * service costs nothing in the initial bundle. Every open method still returns\n * its {@link ToastRef} synchronously — the toast is attached once the chunk\n * lands, and `update()` / `dismiss()` called in the meantime are honoured.\n *\n * Not `providedIn: 'root'` — register via {@link provideToast}.\n */\n@Injectable()\nexport class ToastService implements OnDestroy {\n private readonly injector = inject(Injector);\n private readonly defaultOptions =\n inject(TW_TOAST_DEFAULT_OPTIONS, { optional: true }) ?? {};\n private readonly parent = inject(ToastService, { optional: true, skipSelf: true });\n\n /** Cached renderer chunk. Non-null once the first `show()` has kicked off the import. */\n private rendererPromise: Promise<ToastRenderer | null> | null = null;\n private renderer: ToastRenderer | null = null;\n private destroyed = false;\n\n private readonly activeRefsAtThisLevel = signal<readonly ToastRef[]>([]);\n private readonly afterOpenedSubject = new Subject<ToastRef>();\n private readonly afterAllDismissedSubject = new Subject<void>();\n\n /** Reactive list of every toast that has not yet fully dismissed. */\n readonly activeToasts: Signal<readonly ToastRef[]> = this.parent\n ? this.parent.activeToasts\n : this.activeRefsAtThisLevel.asReadonly();\n\n /** Emits every time a new toast is opened. */\n readonly afterOpened: Observable<ToastRef> = this.parent\n ? this.parent.afterOpened\n : this.afterOpenedSubject.asObservable();\n\n /** Emits when the active-toasts list transitions back to empty. Emits immediately on subscribe if none are open. */\n readonly afterAllDismissed: Observable<void> = defer(() =>\n this.activeToasts().length\n ? this.getAfterAllDismissedSource()\n : this.getAfterAllDismissedSource().pipe(startWith(undefined as void)),\n );\n\n /**\n * Open a toast. Content may be a string (rendered inside the default\n * `ToastComponent`), a `TemplateRef` (rendered via `TemplatePortal`), or a\n * component class (rendered via `ComponentPortal` with `TW_TOAST_REF` +\n * `TW_TOAST_DATA` injected).\n */\n show<R = void, D = unknown>(\n content: ToastContent,\n config?: ToastConfig<D, R>,\n ): ToastRef<unknown, R> {\n const merged = this.resolveConfig<D, R>(config);\n return this.openInternal<R>(content, merged);\n }\n\n /** Shorthand for `show(message, { severity: 'success', ... })`. */\n success<R = void>(message: string, config?: ToastConfig<unknown, R>): ToastRef<unknown, R> {\n return this.openWithSeverity('success', message, config);\n }\n\n /** Shorthand for `show(message, { severity: 'error', politeness: 'assertive', ... })`. */\n error<R = void>(message: string, config?: ToastConfig<unknown, R>): ToastRef<unknown, R> {\n return this.openWithSeverity('error', message, config, 'assertive');\n }\n\n /** Shorthand for `show(message, { severity: 'warning', ... })`. */\n warning<R = void>(message: string, config?: ToastConfig<unknown, R>): ToastRef<unknown, R> {\n return this.openWithSeverity('warning', message, config);\n }\n\n /** Shorthand for `show(message, { severity: 'info', ... })`. */\n info<R = void>(message: string, config?: ToastConfig<unknown, R>): ToastRef<unknown, R> {\n return this.openWithSeverity('info', message, config);\n }\n\n /**\n * Show a loading toast, then swap it to success / error when the promise\n * settles. The same ref is returned and re-used across all three states.\n * The loading toast is pinned (duration forced to 0, dismissible forced to\n * false) until the promise resolves.\n */\n promise<T, R = void>(\n promise: Promise<T>,\n messages: PromiseMessages<T>,\n config?: ToastConfig<unknown, R>,\n ): ToastRef<unknown, R> {\n const resolvedDuration = config?.duration ?? this.defaultOptions.duration ?? 5000;\n const ref = this.show<R>(messages.loading, {\n ...(config as ToastConfig<unknown, R>),\n severity: 'neutral',\n duration: 0,\n dismissible: false,\n });\n\n promise.then(\n (value) => {\n if (ref.state() === 'dismissed' || ref.state() === 'dismissing') return;\n const msg = typeof messages.success === 'function' ? messages.success(value) : messages.success;\n ref.update({\n severity: 'success',\n content: msg,\n duration: resolvedDuration,\n dismissible: config?.dismissible ?? true,\n });\n this.announceUpdate(ref);\n },\n (err) => {\n if (ref.state() === 'dismissed' || ref.state() === 'dismissing') return;\n const msg = typeof messages.error === 'function' ? messages.error(err) : messages.error;\n ref.update({\n severity: 'error',\n content: msg,\n duration: resolvedDuration,\n dismissible: config?.dismissible ?? true,\n });\n this.announceUpdate(ref);\n },\n );\n\n return ref;\n }\n\n /** Dismiss a toast by id. No-op if no matching toast is active. */\n dismiss(id: string): void {\n const match = this.activeToasts().find((ref) => ref.id === id);\n if (match) match.dismiss();\n }\n\n /** Dismiss every active toast across every position. */\n dismissAll(): void {\n const refs = [...this.activeToasts()];\n for (let i = refs.length - 1; i >= 0; i--) refs[i].dismiss();\n }\n\n /** Look up an active toast by id. */\n getToastById<R = unknown>(id: string): ToastRef<unknown, R> | undefined {\n return this.activeToasts().find((ref) => ref.id === id) as\n | ToastRef<unknown, R>\n | undefined;\n }\n\n ngOnDestroy(): void {\n // Set first: an in-flight renderer import resolves after this and must not\n // instantiate overlays for a service that is already gone.\n this.destroyed = true;\n const refs = [...this.activeRefsAtThisLevel()];\n for (let i = refs.length - 1; i >= 0; i--) refs[i]._finishDismiss();\n this.renderer?.dispose();\n this.renderer = null;\n this.afterOpenedSubject.complete();\n this.afterAllDismissedSubject.complete();\n }\n\n private openWithSeverity<R>(\n severity: ToastSeverity,\n message: string,\n config?: ToastConfig<unknown, R>,\n forcedPoliteness?: 'polite' | 'assertive' | 'off',\n ): ToastRef<unknown, R> {\n const merged = this.resolveConfig<unknown, R>(config);\n merged.severity = severity;\n if (forcedPoliteness && !config?.politeness) merged.politeness = forcedPoliteness;\n return this.openInternal<R>(message, merged);\n }\n\n private openInternal<R>(\n content: ToastContent,\n config: ToastConfig<unknown, R>,\n ): ToastRef<unknown, R> {\n const id = config.id ?? generateId();\n config.id = id;\n\n const ref = new ToastRef<unknown, R>(id, content, config, (dismissed) =>\n this.handleDismissed(dismissed),\n );\n\n this.enforceMaxVisible(config.position!, config.maxVisible ?? 5);\n this.registerOpen(ref);\n void this.attachWhenRendererReady(ref as ToastRef<unknown, unknown>, config.position!);\n return ref;\n }\n\n /**\n * Attach a toast once the renderer chunk has loaded. The ref was already\n * returned to the caller, so it may have been dismissed (or the service\n * destroyed) while the import was in flight — both are checked before\n * anything is put on screen.\n */\n private async attachWhenRendererReady(\n ref: ToastRef<unknown, unknown>,\n position: ToastPosition,\n ): Promise<void> {\n const renderer = await this.loadRenderer();\n if (!renderer || this.destroyed) return;\n\n const state = ref.state();\n if (state === 'dismissing' || state === 'dismissed') return;\n\n if (!renderer.attach(ref, position)) return;\n // Only now does the enter animation — and with it the auto-dismiss\n // countdown — begin. See `ToastRef._startEnterSequence`.\n ref._startEnterSequence();\n renderer.announceOpen(ref);\n }\n\n /**\n * @internal Resolves once the renderer chunk has loaded and pending toasts\n * have been attached. Exposed for tests, which must await the dynamic import\n * before asserting on rendered DOM.\n */\n async _whenRendered(): Promise<void> {\n await this.loadRenderer();\n // Let the per-toast `attachWhenRendererReady` continuations run.\n await Promise.resolve();\n }\n\n /** Load (once) and instantiate the rendering layer. Resolves to `null` if the service was destroyed mid-import. */\n private loadRenderer(): Promise<ToastRenderer | null> {\n if (!this.rendererPromise) {\n this.rendererPromise = import('./toast-renderer').then(({ ToastRenderer }) => {\n if (this.destroyed) return null;\n this.renderer = new ToastRenderer(\n this.injector,\n this.defaultOptions.regionAriaLabel ?? 'Notifications',\n );\n return this.renderer;\n });\n }\n return this.rendererPromise;\n }\n\n private enforceMaxVisible(position: ToastPosition, max: number): void {\n if (max <= 0) return;\n const atPosition = this.activeToasts().filter(\n (ref) =>\n (ref.config.position ?? 'bottom-right') === position &&\n ref.state() !== 'dismissing' &&\n ref.state() !== 'dismissed',\n );\n while (atPosition.length >= max) {\n const oldest = atPosition.shift();\n if (!oldest) break;\n oldest._dismissAsMaxExceeded();\n }\n }\n\n private registerOpen<R>(ref: ToastRef<unknown, R>): void {\n const scope = this.parent ?? this;\n const anyRef = ref as ToastRef<unknown, unknown>;\n scope.activeRefsAtThisLevel.update((list) => [...list, anyRef]);\n scope.afterOpenedSubject.next(anyRef);\n }\n\n private handleDismissed(ref: ToastRef): void {\n const scope = this.parent ?? this;\n scope.activeRefsAtThisLevel.update((list) => list.filter((r) => r !== ref));\n\n this.renderer?.detach(ref);\n\n if (scope.activeRefsAtThisLevel().length === 0) {\n scope.afterAllDismissedSubject.next();\n }\n }\n\n /**\n * Re-announce an updated toast. If the renderer has not landed yet there is\n * nothing on screen to announce — the announcement that fires on attach\n * reads the ref's current (already updated) content, so nothing is lost.\n */\n private announceUpdate<R>(ref: ToastRef<unknown, R>): void {\n this.renderer?.announceUpdate(ref as ToastRef<unknown, unknown>);\n }\n\n private resolveConfig<D, R>(config: ToastConfig<D, R> | undefined): ToastConfig<D, R> {\n const merged = new ToastConfig<D, R>();\n Object.assign(merged, this.defaultOptions, config);\n return merged;\n }\n\n private getAfterAllDismissedSource(): Subject<void> {\n return this.parent ? this.parent.getAfterAllDismissedSource() : this.afterAllDismissedSubject;\n }\n}\n\n/**\n * Registers {@link ToastService} for dependency injection and installs optional\n * application-wide defaults.\n *\n * @example\n * ```ts\n * bootstrapApplication(AppComponent, {\n * providers: [provideToast({ position: 'top-right', duration: 4000 })]\n * });\n * ```\n */\nexport function provideToast(\n defaultOptions?: Partial<ToastConfig>,\n): EnvironmentProviders {\n const providers: Provider[] = [ToastService];\n if (defaultOptions) {\n providers.push({ provide: TW_TOAST_DEFAULT_OPTIONS, useValue: defaultOptions });\n }\n return makeEnvironmentProviders(providers);\n}\n\n/** Re-exported helpers so `inject(TW_TOAST_DATA)` / `inject(TW_TOAST_REF)` work from component content. */\nexport { TW_TOAST_DATA, TW_TOAST_REF };\n\n// Re-exports to keep the barrel tidy.\nexport type { ToastContent, ToastTemplateContext };\n\nexport const ToastInternals = {\n /** @internal Reset id counter for tests. */\n _resetIdForTesting(): void {\n nextToastId = 0;\n },\n};\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n contentChild,\n Directive,\n inject,\n input,\n output,\n} from '@angular/core';\nimport { tv } from 'tailwind-variants';\nimport type { ToastSeverity } from './toast-config';\n\nconst toastVariants = tv(\n {\n slots: {\n root:\n 'pointer-events-auto relative flex items-start gap-3 w-full max-w-sm p-4 rounded-lg border shadow-md text-sm will-change-transform transition-colors duration-normal motion-reduce:transition-none',\n icon: 'size-5 shrink-0 mt-0.5',\n title: 'text-sm font-semibold',\n description: 'text-sm',\n content: 'flex-1 min-w-0',\n action:\n 'inline-flex items-center justify-center px-3 py-1.5 rounded-md text-sm font-medium cursor-pointer transition-colors duration-normal motion-reduce:transition-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary-500',\n // Dismiss container is `size-6` (24px — xs square-interactive-target\n // scale per CLAUDE.md icon sub-scale). The inner SVG is `size-4` (16px\n // glyph scale), centred via flex; the larger container gives the\n // touch/click affordance without enlarging the visual glyph.\n dismiss:\n 'absolute top-3 right-3 inline-flex items-center justify-center size-6 rounded-md cursor-pointer transition-colors duration-normal motion-reduce:transition-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary-500',\n },\n variants: {\n severity: {\n info: {},\n success: {},\n warning: {},\n error: {},\n neutral: {},\n },\n },\n // Color slot tokens (`{role}-soft`, `-soft-fg`, `-icon`, …) own light/dark\n // contrast — components consume the slot only. See `_semantic.css`.\n // Slot-token safelist: see `projects/ngx-tw/theme/index.css` `@source inline(...)`\n // — Tailwind v4's JIT cannot scan template-literal class names, so every\n // `bg-${severity}-soft` / `text-${severity}-icon` permutation below must be\n // enumerated there.\n compoundVariants: (['info', 'success', 'warning', 'error', 'neutral'] as const).map(\n (severity) => ({\n severity,\n class: {\n root: `bg-${severity}-soft text-${severity}-soft-fg-muted border-${severity}-border`,\n icon: `text-${severity}-icon`,\n title: `text-${severity}-soft-fg`,\n description: `text-${severity}-soft-fg-muted`,\n action: `text-${severity}-soft-fg hover:bg-${severity}-soft-hover`,\n dismiss: `text-${severity}-icon hover:bg-${severity}-soft-hover`,\n },\n }),\n ),\n defaultVariants: {\n severity: 'info',\n },\n },\n { twMerge: true },\n);\n\n/** Slot directive for the icon. When projected, overrides the severity-default icon. */\n@Directive({\n selector: '[twToastIcon]',\n host: {\n '[class]': 'classes()',\n 'aria-hidden': 'true',\n },\n})\nexport class ToastIconDirective {\n private readonly toast = inject(ToastComponent);\n /** @internal */\n readonly classes = this.toast.iconClasses;\n}\n\n/** Slot directive for the bold title line inside a toast. */\n@Directive({\n selector: '[twToastTitle]',\n host: {\n '[class]': 'classes()',\n },\n})\nexport class ToastTitleDirective {\n private readonly toast = inject(ToastComponent);\n /** @internal */\n readonly classes = this.toast.titleClasses;\n}\n\n/** Slot directive for a secondary description line inside a toast. */\n@Directive({\n selector: '[twToastDescription]',\n host: {\n '[class]': 'classes()',\n },\n})\nexport class ToastDescriptionDirective {\n private readonly toast = inject(ToastComponent);\n /** @internal */\n readonly classes = this.toast.descriptionClasses;\n}\n\n/** Slot directive for the action button. Apply to a native `<button>` to inherit the severity-aware styling. */\n@Directive({\n selector: '[twToastAction]',\n host: {\n type: 'button',\n '[class]': 'classes()',\n '(click)': 'onClick()',\n },\n})\nexport class ToastActionDirective {\n private readonly toast = inject(ToastComponent);\n /** @internal */\n readonly classes = this.toast.actionClasses;\n /** @internal */\n protected onClick(): void {\n this.toast.actionClicked.emit();\n }\n}\n\n/**\n * Visual toast / snackbar panel. Rendered internally by {@link ToastService} for\n * string content, and exported for consumers who want to compose the same\n * visual inside a custom `TemplateRef` or component class passed to `show()`.\n */\n@Component({\n selector: 'tw-toast',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n '[class]': 'rootClasses()',\n '[attr.role]': 'roleAttr()',\n '[attr.aria-live]': 'ariaLiveAttr()',\n 'aria-atomic': 'true',\n '[attr.aria-label]': 'ariaLabel() || null',\n '[attr.data-severity]': 'severity()',\n },\n template: `\n @if (hasProjectedIcon()) {\n <ng-content select=\"[twToastIcon]\" />\n } @else if (icon() !== false) {\n <span [class]=\"iconClasses()\" aria-hidden=\"true\">\n @switch (severity()) {\n @case ('info') {\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 20 20\" fill=\"currentColor\" class=\"size-full\">\n <path fill-rule=\"evenodd\" d=\"M10 18a8 8 0 1 0 0-16 8 8 0 0 0 0 16Zm0-11a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm-.75 2.5a.75.75 0 0 0 0 1.5h.25v3h-.25a.75.75 0 0 0 0 1.5h2a.75.75 0 0 0 0-1.5h-.25v-3.75a.75.75 0 0 0-.75-.75h-1Z\" clip-rule=\"evenodd\"/>\n </svg>\n }\n @case ('success') {\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 20 20\" fill=\"currentColor\" class=\"size-full\">\n <path fill-rule=\"evenodd\" d=\"M10 18a8 8 0 1 0 0-16 8 8 0 0 0 0 16Zm3.857-9.809a.75.75 0 0 0-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 1 0-1.06 1.061l2.5 2.5a.75.75 0 0 0 1.137-.089l4-5.5Z\" clip-rule=\"evenodd\"/>\n </svg>\n }\n @case ('warning') {\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 20 20\" fill=\"currentColor\" class=\"size-full\">\n <path fill-rule=\"evenodd\" d=\"M8.485 2.495c.673-1.167 2.357-1.167 3.03 0l6.28 10.875c.673 1.167-.17 2.625-1.516 2.625H3.72c-1.347 0-2.189-1.458-1.515-2.625L8.485 2.495ZM10 5a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 10 5Zm0 9a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z\" clip-rule=\"evenodd\"/>\n </svg>\n }\n @case ('error') {\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 20 20\" fill=\"currentColor\" class=\"size-full\">\n <path fill-rule=\"evenodd\" d=\"M18 10a8 8 0 1 1-16 0 8 8 0 0 1 16 0Zm-8-5a.75.75 0 0 1 .75.75v4.5a.75.75 0 0 1-1.5 0v-4.5A.75.75 0 0 1 10 5Zm0 10a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z\" clip-rule=\"evenodd\"/>\n </svg>\n }\n @default {\n @if (icon() && icon() !== false) {\n {{ icon() }}\n }\n }\n }\n </span>\n }\n <div [class]=\"contentClasses()\">\n <ng-content select=\"[twToastTitle]\" />\n <ng-content select=\"[twToastDescription]\" />\n <ng-content />\n <ng-content select=\"[twToastAction]\" />\n </div>\n @if (dismissible()) {\n <button\n type=\"button\"\n aria-label=\"Dismiss\"\n [class]=\"dismissClasses()\"\n (click)=\"dismissed.emit()\"\n >\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" fill=\"currentColor\" class=\"size-4\">\n <path d=\"M5.28 4.22a.75.75 0 0 0-1.06 1.06L6.94 8l-2.72 2.72a.75.75 0 1 0 1.06 1.06L8 9.06l2.72 2.72a.75.75 0 1 0 1.06-1.06L9.06 8l2.72-2.72a.75.75 0 0 0-1.06-1.06L8 6.94 5.28 4.22Z\"/>\n </svg>\n </button>\n }\n `,\n})\nexport class ToastComponent {\n /** Severity variant. Drives color palette, default icon, and ARIA role / live politeness. Defaults to `'info'`. */\n readonly severity = input<ToastSeverity>('info');\n\n /** Whether to render the close button. Defaults to `true` — mirroring `ToastConfig.dismissible`, toasts must offer an escape hatch; the special case is an ephemeral progress marker paired with `duration`. */\n readonly dismissible = input<boolean>(true);\n\n /**\n * Icon override. Pass a string to render as text inside the icon slot, or\n * `false` to hide the built-in severity icon. Ignored when a `[twToastIcon]`\n * child is projected. When omitted, the severity-default icon renders.\n *\n * For arbitrary icon markup, project a `[twToastIcon]` child instead.\n */\n readonly icon = input<string | false | undefined>(undefined);\n\n /** Explicit aria-label for the toast wrapper. Mirrored to `aria-label`. When omitted, text content is used by assistive tech. Defaults to `undefined`. */\n readonly ariaLabel = input<string | undefined>(undefined, { alias: 'aria-label' });\n\n /** Fires when the close button is clicked. */\n readonly dismissed = output<void>();\n\n /** Fires when a `[twToastAction]` button is clicked. */\n readonly actionClicked = output<void>();\n\n /** @internal */\n readonly projectedIcon = contentChild(ToastIconDirective);\n\n /** @internal */\n readonly hasProjectedIcon = computed(() => !!this.projectedIcon());\n\n private readonly variantResult = computed(() => toastVariants({ severity: this.severity() }));\n\n /** @internal */\n readonly rootClasses = computed(() => {\n const base = this.variantResult().root();\n return this.dismissible() ? `${base} pr-10` : base;\n });\n\n /** @internal */\n readonly iconClasses = computed(() => this.variantResult().icon());\n /** @internal */\n readonly titleClasses = computed(() => this.variantResult().title());\n /** @internal */\n readonly descriptionClasses = computed(() => this.variantResult().description());\n /** @internal */\n readonly contentClasses = computed(() => this.variantResult().content());\n /** @internal */\n readonly actionClasses = computed(() => this.variantResult().action());\n /** @internal */\n readonly dismissClasses = computed(() => this.variantResult().dismiss());\n\n /** @internal */\n protected readonly roleAttr = computed(() =>\n this.severity() === 'error' ? 'alert' : 'status',\n );\n\n /** @internal */\n protected readonly ariaLiveAttr = computed(() =>\n this.severity() === 'error' ? 'assertive' : 'polite',\n );\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAmDA;;;AAGG;AACH;AACA;AACA;MACa,WAAW,CAAA;;IAEtB,QAAQ,GAAmB,MAAM;;IAGjC,QAAQ,GAAmB,cAAc;AAEzC;;;;;;;;;AASG;IACH,QAAQ,GAAY,IAAI;;;;IAKxB,WAAW,GAAa,IAAI;AAE5B;;;;AAIG;AACH,IAAA,UAAU;;AAGV,IAAA,MAAM;;IAGN,IAAI,GAAc,IAAI;;AAGtB,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoDT,EAAA,CAAA;AACF,iBAAA;ylBA2BuC,kBAAkB,CAAA,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AC7N1D;;AAEG;;;;"}
@@ -2,6 +2,7 @@ import * as i0 from '@angular/core';
2
2
  import { signal, computed, TemplateRef, ChangeDetectionStrategy, Component, input, output, inject, ElementRef, DestroyRef, effect, Directive } from '@angular/core';
3
3
  import { NgTemplateOutlet } from '@angular/common';
4
4
  import { Overlay } from '@angular/cdk/overlay';
5
+ import { ESCAPE, hasModifierKey } from '@angular/cdk/keycodes';
5
6
  import { ComponentPortal } from '@angular/cdk/portal';
6
7
  import { AriaDescriber } from '@angular/cdk/a11y';
7
8
  import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
@@ -10,7 +11,12 @@ import { tv } from 'tailwind-variants';
10
11
  // ── Variant config ──
11
12
  const tooltipVariants = tv({
12
13
  slots: {
13
- wrapper: 'relative pointer-events-none',
14
+ // No `pointer-events-none`: WCAG 2.1 SC 1.4.13 requires hover content to
15
+ // be *hoverable* — the pointer must be able to travel from the trigger
16
+ // onto the tooltip without dismissing it. The directive re-arms the hide
17
+ // timer on the panel's own `mouseleave`, so the panel is only pointer-
18
+ // opaque for as long as the user is actually pointing at it.
19
+ wrapper: 'relative',
14
20
  panel: 'rounded-md shadow-md',
15
21
  arrow: 'absolute size-2 rotate-45',
16
22
  },
@@ -294,23 +300,22 @@ class TooltipDirective {
294
300
  twTooltipShowDelay = input(200, /* @ts-ignore */
295
301
  ...(ngDevMode ? [{ debugName: "twTooltipShowDelay" }] : /* istanbul ignore next */ []));
296
302
  /**
297
- * Milliseconds to wait before hiding after trigger ends. Defaults to `0`
298
- * (immediate dismiss). The asymmetry with `twTooltipShowDelay` is
299
- * intentional show is gated to filter noise, hide is instant so the
300
- * tooltip never lingers over content the user has moved on from.
303
+ * Milliseconds to wait before hiding after the trigger is left. Defaults to
304
+ * `150` a grace period, not a lingering delay: WCAG 2.1 SC 1.4.13 requires
305
+ * the tooltip to be hoverable, and the panel sits 8px clear of its trigger,
306
+ * so the pointer needs a window in which to cross that gap. Hovering the
307
+ * panel itself cancels the pending hide entirely. Set `0` to opt out (the
308
+ * tooltip is then dismissible by Escape but not reachable by pointer).
301
309
  */
302
- twTooltipHideDelay = input(0, /* @ts-ignore */
310
+ twTooltipHideDelay = input(150, /* @ts-ignore */
303
311
  ...(ngDevMode ? [{ debugName: "twTooltipHideDelay" }] : /* istanbul ignore next */ []));
304
312
  /** When true, tooltip never shows. Defaults to `false`. */
305
313
  twTooltipDisabled = input(false, /* @ts-ignore */
306
314
  ...(ngDevMode ? [{ debugName: "twTooltipDisabled" }] : /* istanbul ignore next */ []));
307
- // Arrows reinforce the visual association between the floating panel and its trigger
308
- // and match every other ngx-tw overlay (popover/menu); opt-out is for compact iconic
309
- // contexts only.
310
- /** When true, renders an arrow pointing to the trigger. Defaults to `true`. */
315
+ /** When true, renders an arrow pointing to the trigger. Defaults to `true` — arrows reinforce the visual association between the floating panel and its trigger and match every other ngx-tw overlay (popover, menu); the special case is a compact iconic context. */
311
316
  twTooltipArrow = input(true, /* @ts-ignore */
312
317
  ...(ngDevMode ? [{ debugName: "twTooltipArrow" }] : /* istanbul ignore next */ []));
313
- /** Optional class string (space-separated) merged into the panel slot for consumer customization. */
318
+ /** Optional class string (space-separated) merged into the panel slot for consumer customization. Defaults to an empty string. */
314
319
  twTooltipPanelClass = input('', /* @ts-ignore */
315
320
  ...(ngDevMode ? [{ debugName: "twTooltipPanelClass" }] : /* istanbul ignore next */ []));
316
321
  /** Fires when the tooltip becomes visible. */
@@ -326,9 +331,18 @@ class TooltipDirective {
326
331
  // appended. Mirrors the `sort-header` pattern.
327
332
  ariaDescriber = inject(AriaDescriber, { optional: true });
328
333
  overlayRef = null;
334
+ /**
335
+ * The live position strategy. Held as a field so every show can re-apply
336
+ * `twTooltipPosition` onto it — see `applyPositions`.
337
+ */
338
+ positionStrategy = null;
339
+ /** The `twTooltipPosition` value currently baked into `positionStrategy`. */
340
+ appliedPosition = null;
329
341
  tooltipInstance = null;
330
342
  showTimer = null;
331
343
  hideTimer = null;
344
+ /** Removes the panel's hover listeners. Set in `createOverlay`, invoked from `disposeOverlay`. */
345
+ overlayHoverCleanup = null;
332
346
  /** Last description string handed to `AriaDescriber.describe` — required so the symmetrical `removeDescription` call passes the same key. */
333
347
  _describedBy = null;
334
348
  /** True when the trigger's `aria-describedby` was set directly to the overlay id (TemplateRef fallback path); used by `removeAriaDescription` to choose the symmetrical teardown. */
@@ -393,12 +407,14 @@ class TooltipDirective {
393
407
  }
394
408
  // ── Private ──
395
409
  createAndShow() {
410
+ // Called before the `tooltipInstance` check so that a tooltip already on
411
+ // screen also picks up a changed `twTooltipPosition`.
412
+ this.createOverlay();
396
413
  if (this.tooltipInstance) {
397
414
  this.updateTooltip();
398
415
  this.applyAriaDescription();
399
416
  return;
400
417
  }
401
- this.createOverlay();
402
418
  const portal = new ComponentPortal(TooltipOverlayComponent);
403
419
  const componentRef = this.overlayRef.attach(portal);
404
420
  this.tooltipInstance = componentRef.instance;
@@ -407,15 +423,23 @@ class TooltipDirective {
407
423
  this.twTooltipShown.emit();
408
424
  }
409
425
  createOverlay() {
410
- if (this.overlayRef)
426
+ if (this.overlayRef) {
427
+ // The OverlayRef is built once per directive lifetime (hiding only
428
+ // detaches), so `twTooltipPosition` has to be re-applied on every show or
429
+ // a binding like `[twTooltipPosition]="isMobile() ? 'bottom' : 'right'"`
430
+ // stays frozen at whatever it read on the first hover.
431
+ this.applyPositions();
411
432
  return;
412
- const positions = buildPositions(this.twTooltipPosition());
433
+ }
434
+ this.appliedPosition = this.twTooltipPosition();
435
+ const positions = buildPositions(this.appliedPosition);
413
436
  const positionStrategy = this.overlay
414
437
  .position()
415
438
  .flexibleConnectedTo(this.elementRef)
416
439
  .withPositions(positions)
417
440
  .withPush(true)
418
441
  .withViewportMargin(8);
442
+ this.positionStrategy = positionStrategy;
419
443
  this.overlayRef = this.overlay.create({
420
444
  positionStrategy,
421
445
  // Close on ancestor scroll — tooltips are transient and should not chase a
@@ -431,6 +455,59 @@ class TooltipDirective {
431
455
  this.tooltipInstance.arrowDirection.set(dir);
432
456
  }
433
457
  });
458
+ // SC 1.4.13 "Dismissible": Escape must dismiss the tooltip wherever focus
459
+ // currently is, not only when the trigger itself has it — a tooltip shown
460
+ // by hover while focus sits in an unrelated field was previously
461
+ // undismissable without moving the pointer. CDK's OverlayKeyboardDispatcher
462
+ // listens on `body` and forwards keydowns to the top-most attached overlay
463
+ // with subscribers, which is this tooltip whenever it is showing. The
464
+ // trigger's own `(keydown.escape)` binding stays as the direct path; the
465
+ // second `detach()` is a no-op.
466
+ this.overlayRef
467
+ .keydownEvents()
468
+ .pipe(takeUntilDestroyed(this.destroyRef))
469
+ .subscribe((event) => {
470
+ if (event.keyCode === ESCAPE && !hasModifierKey(event)) {
471
+ this.detach();
472
+ }
473
+ });
474
+ // SC 1.4.13 "Hoverable" / "Persistent": entering the panel cancels the
475
+ // pending hide so the tooltip survives the trip across the 8px offset;
476
+ // leaving it re-arms the hide exactly as leaving the trigger does. Wired
477
+ // on the overlay element rather than the portal component because this
478
+ // element outlives every attach/detach cycle of a given overlayRef, so the
479
+ // listeners are added once and removed once.
480
+ const panel = this.overlayRef.overlayElement;
481
+ const onEnter = () => this.clearTimers();
482
+ const onLeave = () => this.hide();
483
+ panel.addEventListener('mouseenter', onEnter);
484
+ panel.addEventListener('mouseleave', onLeave);
485
+ this.overlayHoverCleanup = () => {
486
+ panel.removeEventListener('mouseenter', onEnter);
487
+ panel.removeEventListener('mouseleave', onLeave);
488
+ this.overlayHoverCleanup = null;
489
+ };
490
+ }
491
+ /**
492
+ * Pushes the current `twTooltipPosition` onto the live position strategy.
493
+ *
494
+ * Updating the strategy in place rather than disposing the `OverlayRef` on
495
+ * hide is not just the cheaper option — it is the correct one. `createOverlay`
496
+ * subscribes to `positionStrategy.positionChanges` exactly once, and that feed
497
+ * is what drives the arrow direction; `FlexibleConnectedPositionStrategy`
498
+ * completes that subject in `dispose()`, so a dispose-on-hide would silently
499
+ * kill arrow placement from the second show onward.
500
+ */
501
+ applyPositions() {
502
+ const position = this.twTooltipPosition();
503
+ if (!this.positionStrategy || position === this.appliedPosition)
504
+ return;
505
+ this.appliedPosition = position;
506
+ this.positionStrategy.withPositions(buildPositions(position));
507
+ // `withPositions` only stores the list; a tooltip that is currently on
508
+ // screen needs an explicit reflow. (Attaching later applies it anyway.)
509
+ if (this.overlayRef?.hasAttached())
510
+ this.overlayRef.updatePosition();
434
511
  }
435
512
  updateTooltip() {
436
513
  if (!this.tooltipInstance)
@@ -511,10 +588,13 @@ class TooltipDirective {
511
588
  }
512
589
  }
513
590
  disposeOverlay() {
591
+ this.overlayHoverCleanup?.();
514
592
  if (this.overlayRef) {
515
593
  this.overlayRef.dispose();
516
594
  this.overlayRef = null;
517
595
  }
596
+ this.positionStrategy = null;
597
+ this.appliedPosition = null;
518
598
  this.tooltipInstance = null;
519
599
  }
520
600
  clearTimers() {
@@ -528,7 +608,7 @@ class TooltipDirective {
528
608
  }
529
609
  }
530
610
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: TooltipDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
531
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.7", type: TooltipDirective, isStandalone: true, selector: "[twTooltip]", inputs: { twTooltip: { classPropertyName: "twTooltip", publicName: "twTooltip", isSignal: true, isRequired: true, transformFunction: null }, twTooltipPosition: { classPropertyName: "twTooltipPosition", publicName: "twTooltipPosition", isSignal: true, isRequired: false, transformFunction: null }, twTooltipColor: { classPropertyName: "twTooltipColor", publicName: "twTooltipColor", isSignal: true, isRequired: false, transformFunction: null }, twTooltipSize: { classPropertyName: "twTooltipSize", publicName: "twTooltipSize", isSignal: true, isRequired: false, transformFunction: null }, twTooltipShowDelay: { classPropertyName: "twTooltipShowDelay", publicName: "twTooltipShowDelay", isSignal: true, isRequired: false, transformFunction: null }, twTooltipHideDelay: { classPropertyName: "twTooltipHideDelay", publicName: "twTooltipHideDelay", isSignal: true, isRequired: false, transformFunction: null }, twTooltipDisabled: { classPropertyName: "twTooltipDisabled", publicName: "twTooltipDisabled", isSignal: true, isRequired: false, transformFunction: null }, twTooltipArrow: { classPropertyName: "twTooltipArrow", publicName: "twTooltipArrow", isSignal: true, isRequired: false, transformFunction: null }, twTooltipPanelClass: { classPropertyName: "twTooltipPanelClass", publicName: "twTooltipPanelClass", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { twTooltipShown: "twTooltipShown", twTooltipHidden: "twTooltipHidden" }, host: { listeners: { "mouseenter": "onMouseEnter()", "mouseleave": "onMouseLeave()", "focusin": "onFocusIn()", "focusout": "onFocusOut()", "keydown.escape": "onEscape()", "touchstart": "onTouchStart()", "touchend": "onTouchEnd()" } }, exportAs: ["twTooltip"], ngImport: i0 });
611
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.7", type: TooltipDirective, isStandalone: true, selector: "[twTooltip]", inputs: { twTooltip: { classPropertyName: "twTooltip", publicName: "twTooltip", isSignal: true, isRequired: true, transformFunction: null }, twTooltipPosition: { classPropertyName: "twTooltipPosition", publicName: "twTooltipPosition", isSignal: true, isRequired: false, transformFunction: null }, twTooltipColor: { classPropertyName: "twTooltipColor", publicName: "twTooltipColor", isSignal: true, isRequired: false, transformFunction: null }, twTooltipSize: { classPropertyName: "twTooltipSize", publicName: "twTooltipSize", isSignal: true, isRequired: false, transformFunction: null }, twTooltipShowDelay: { classPropertyName: "twTooltipShowDelay", publicName: "twTooltipShowDelay", isSignal: true, isRequired: false, transformFunction: null }, twTooltipHideDelay: { classPropertyName: "twTooltipHideDelay", publicName: "twTooltipHideDelay", isSignal: true, isRequired: false, transformFunction: null }, twTooltipDisabled: { classPropertyName: "twTooltipDisabled", publicName: "twTooltipDisabled", isSignal: true, isRequired: false, transformFunction: null }, twTooltipArrow: { classPropertyName: "twTooltipArrow", publicName: "twTooltipArrow", isSignal: true, isRequired: false, transformFunction: null }, twTooltipPanelClass: { classPropertyName: "twTooltipPanelClass", publicName: "twTooltipPanelClass", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { twTooltipShown: "twTooltipShown", twTooltipHidden: "twTooltipHidden" }, host: { attributes: { "data-tw-tooltip-trigger": "" }, listeners: { "mouseenter": "onMouseEnter()", "mouseleave": "onMouseLeave()", "focusin": "onFocusIn()", "focusout": "onFocusOut()", "keydown.escape": "onEscape()", "touchstart": "onTouchStart()", "touchend": "onTouchEnd()" } }, exportAs: ["twTooltip"], ngImport: i0 });
532
612
  }
533
613
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: TooltipDirective, decorators: [{
534
614
  type: Directive,
@@ -536,6 +616,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImpor
536
616
  selector: '[twTooltip]',
537
617
  exportAs: 'twTooltip',
538
618
  host: {
619
+ // Static marker so the directive is locatable in tests and by consumers.
620
+ // Its own selector is not usable for that: `[twTooltip]` takes a required
621
+ // `TemplateRef`, so it is ALWAYS property-bound and Angular emits no
622
+ // attribute for a bound input. Material solves this with a class
623
+ // (`.mat-mdc-menu-trigger`); `data-tw-*` is this repo's existing convention
624
+ // (see `data-tw-table-loading`, `data-tw-sort-arrow`) and carries no styling.
625
+ 'data-tw-tooltip-trigger': '',
539
626
  '(mouseenter)': 'onMouseEnter()',
540
627
  '(mouseleave)': 'onMouseLeave()',
541
628
  '(focusin)': 'onFocusIn()',