@4sh/ui-kit 0.15.0 → 0.17.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 (220) hide show
  1. package/README.fr.md +18 -10
  2. package/README.md +18 -10
  3. package/fesm2022/4sh-ui-kit-actions-ui-button-split.mjs +542 -150
  4. package/fesm2022/4sh-ui-kit-actions-ui-button-split.mjs.map +1 -1
  5. package/fesm2022/4sh-ui-kit-actions-ui-button.mjs +622 -248
  6. package/fesm2022/4sh-ui-kit-actions-ui-button.mjs.map +1 -1
  7. package/fesm2022/4sh-ui-kit-actions-ui-link.mjs +385 -152
  8. package/fesm2022/4sh-ui-kit-actions-ui-link.mjs.map +1 -1
  9. package/fesm2022/4sh-ui-kit-actions-ui-speed-dial.mjs +748 -433
  10. package/fesm2022/4sh-ui-kit-actions-ui-speed-dial.mjs.map +1 -1
  11. package/fesm2022/4sh-ui-kit-base-ui-icon.mjs +227 -135
  12. package/fesm2022/4sh-ui-kit-base-ui-icon.mjs.map +1 -1
  13. package/fesm2022/4sh-ui-kit-base-ui-image.mjs +1200 -633
  14. package/fesm2022/4sh-ui-kit-base-ui-image.mjs.map +1 -1
  15. package/fesm2022/4sh-ui-kit-forms-ui-autocomplete.mjs +1675 -953
  16. package/fesm2022/4sh-ui-kit-forms-ui-autocomplete.mjs.map +1 -1
  17. package/fesm2022/4sh-ui-kit-forms-ui-checkbox.mjs +243 -117
  18. package/fesm2022/4sh-ui-kit-forms-ui-checkbox.mjs.map +1 -1
  19. package/fesm2022/4sh-ui-kit-forms-ui-datepicker.mjs +2294 -2039
  20. package/fesm2022/4sh-ui-kit-forms-ui-datepicker.mjs.map +1 -1
  21. package/fesm2022/4sh-ui-kit-forms-ui-editor.mjs +1058 -1113
  22. package/fesm2022/4sh-ui-kit-forms-ui-editor.mjs.map +1 -1
  23. package/fesm2022/4sh-ui-kit-forms-ui-field-sign.mjs +1108 -0
  24. package/fesm2022/4sh-ui-kit-forms-ui-field-sign.mjs.map +1 -0
  25. package/fesm2022/4sh-ui-kit-forms-ui-field.mjs +397 -141
  26. package/fesm2022/4sh-ui-kit-forms-ui-field.mjs.map +1 -1
  27. package/fesm2022/4sh-ui-kit-forms-ui-file-upload.mjs +1529 -583
  28. package/fesm2022/4sh-ui-kit-forms-ui-file-upload.mjs.map +1 -1
  29. package/fesm2022/4sh-ui-kit-forms-ui-input-date.mjs +383 -224
  30. package/fesm2022/4sh-ui-kit-forms-ui-input-date.mjs.map +1 -1
  31. package/fesm2022/4sh-ui-kit-forms-ui-input-group.mjs +345 -177
  32. package/fesm2022/4sh-ui-kit-forms-ui-input-group.mjs.map +1 -1
  33. package/fesm2022/4sh-ui-kit-forms-ui-input-mask.mjs +280 -130
  34. package/fesm2022/4sh-ui-kit-forms-ui-input-mask.mjs.map +1 -1
  35. package/fesm2022/4sh-ui-kit-forms-ui-input-number.mjs +507 -246
  36. package/fesm2022/4sh-ui-kit-forms-ui-input-number.mjs.map +1 -1
  37. package/fesm2022/4sh-ui-kit-forms-ui-input-otp.mjs +401 -291
  38. package/fesm2022/4sh-ui-kit-forms-ui-input-otp.mjs.map +1 -1
  39. package/fesm2022/4sh-ui-kit-forms-ui-input-tags.mjs +1277 -697
  40. package/fesm2022/4sh-ui-kit-forms-ui-input-tags.mjs.map +1 -1
  41. package/fesm2022/4sh-ui-kit-forms-ui-input.mjs +467 -194
  42. package/fesm2022/4sh-ui-kit-forms-ui-input.mjs.map +1 -1
  43. package/fesm2022/4sh-ui-kit-forms-ui-knob.mjs +394 -270
  44. package/fesm2022/4sh-ui-kit-forms-ui-knob.mjs.map +1 -1
  45. package/fesm2022/4sh-ui-kit-forms-ui-label.mjs +140 -60
  46. package/fesm2022/4sh-ui-kit-forms-ui-label.mjs.map +1 -1
  47. package/fesm2022/4sh-ui-kit-forms-ui-nudger.mjs +386 -167
  48. package/fesm2022/4sh-ui-kit-forms-ui-nudger.mjs.map +1 -1
  49. package/fesm2022/4sh-ui-kit-forms-ui-radio.mjs +150 -87
  50. package/fesm2022/4sh-ui-kit-forms-ui-radio.mjs.map +1 -1
  51. package/fesm2022/4sh-ui-kit-forms-ui-rating.mjs +345 -180
  52. package/fesm2022/4sh-ui-kit-forms-ui-rating.mjs.map +1 -1
  53. package/fesm2022/4sh-ui-kit-forms-ui-segment-control.mjs +582 -392
  54. package/fesm2022/4sh-ui-kit-forms-ui-segment-control.mjs.map +1 -1
  55. package/fesm2022/4sh-ui-kit-forms-ui-select.mjs +1552 -888
  56. package/fesm2022/4sh-ui-kit-forms-ui-select.mjs.map +1 -1
  57. package/fesm2022/4sh-ui-kit-forms-ui-slider.mjs +485 -338
  58. package/fesm2022/4sh-ui-kit-forms-ui-slider.mjs.map +1 -1
  59. package/fesm2022/4sh-ui-kit-forms-ui-swatch-picker.mjs +503 -311
  60. package/fesm2022/4sh-ui-kit-forms-ui-swatch-picker.mjs.map +1 -1
  61. package/fesm2022/4sh-ui-kit-forms-ui-textarea.mjs +271 -131
  62. package/fesm2022/4sh-ui-kit-forms-ui-textarea.mjs.map +1 -1
  63. package/fesm2022/4sh-ui-kit-forms-ui-toggle-block.mjs +457 -214
  64. package/fesm2022/4sh-ui-kit-forms-ui-toggle-block.mjs.map +1 -1
  65. package/fesm2022/4sh-ui-kit-forms-ui-toggle-button.mjs +711 -371
  66. package/fesm2022/4sh-ui-kit-forms-ui-toggle-button.mjs.map +1 -1
  67. package/fesm2022/4sh-ui-kit-forms-ui-toggle.mjs +235 -121
  68. package/fesm2022/4sh-ui-kit-forms-ui-toggle.mjs.map +1 -1
  69. package/fesm2022/4sh-ui-kit-forms.mjs +723 -596
  70. package/fesm2022/4sh-ui-kit-forms.mjs.map +1 -1
  71. package/fesm2022/4sh-ui-kit-informative-ui-accordion.mjs +546 -242
  72. package/fesm2022/4sh-ui-kit-informative-ui-accordion.mjs.map +1 -1
  73. package/fesm2022/4sh-ui-kit-informative-ui-alert.mjs +335 -157
  74. package/fesm2022/4sh-ui-kit-informative-ui-alert.mjs.map +1 -1
  75. package/fesm2022/4sh-ui-kit-informative-ui-avatar-group.mjs +53 -33
  76. package/fesm2022/4sh-ui-kit-informative-ui-avatar-group.mjs.map +1 -1
  77. package/fesm2022/4sh-ui-kit-informative-ui-avatar.mjs +218 -121
  78. package/fesm2022/4sh-ui-kit-informative-ui-avatar.mjs.map +1 -1
  79. package/fesm2022/4sh-ui-kit-informative-ui-badge.mjs +192 -100
  80. package/fesm2022/4sh-ui-kit-informative-ui-badge.mjs.map +1 -1
  81. package/fesm2022/4sh-ui-kit-informative-ui-chip.mjs +456 -204
  82. package/fesm2022/4sh-ui-kit-informative-ui-chip.mjs.map +1 -1
  83. package/fesm2022/4sh-ui-kit-informative-ui-empty-state.mjs +314 -147
  84. package/fesm2022/4sh-ui-kit-informative-ui-empty-state.mjs.map +1 -1
  85. package/fesm2022/4sh-ui-kit-informative-ui-helper.mjs +179 -82
  86. package/fesm2022/4sh-ui-kit-informative-ui-helper.mjs.map +1 -1
  87. package/fesm2022/4sh-ui-kit-informative-ui-progress-bar.mjs +268 -123
  88. package/fesm2022/4sh-ui-kit-informative-ui-progress-bar.mjs.map +1 -1
  89. package/fesm2022/4sh-ui-kit-informative-ui-read-only.mjs +391 -146
  90. package/fesm2022/4sh-ui-kit-informative-ui-read-only.mjs.map +1 -1
  91. package/fesm2022/4sh-ui-kit-informative-ui-separator.mjs +158 -76
  92. package/fesm2022/4sh-ui-kit-informative-ui-separator.mjs.map +1 -1
  93. package/fesm2022/4sh-ui-kit-informative-ui-skeleton.mjs +159 -80
  94. package/fesm2022/4sh-ui-kit-informative-ui-skeleton.mjs.map +1 -1
  95. package/fesm2022/4sh-ui-kit-informative-ui-spinner.mjs +295 -131
  96. package/fesm2022/4sh-ui-kit-informative-ui-spinner.mjs.map +1 -1
  97. package/fesm2022/4sh-ui-kit-informative-ui-tag.mjs +211 -83
  98. package/fesm2022/4sh-ui-kit-informative-ui-tag.mjs.map +1 -1
  99. package/fesm2022/4sh-ui-kit-informative-ui-toast.mjs +784 -414
  100. package/fesm2022/4sh-ui-kit-informative-ui-toast.mjs.map +1 -1
  101. package/fesm2022/4sh-ui-kit-informative-ui-tooltip.mjs +822 -476
  102. package/fesm2022/4sh-ui-kit-informative-ui-tooltip.mjs.map +1 -1
  103. package/fesm2022/4sh-ui-kit-layout-ui-bottom-sheet.mjs +1014 -599
  104. package/fesm2022/4sh-ui-kit-layout-ui-bottom-sheet.mjs.map +1 -1
  105. package/fesm2022/4sh-ui-kit-layout-ui-card.mjs +403 -189
  106. package/fesm2022/4sh-ui-kit-layout-ui-card.mjs.map +1 -1
  107. package/fesm2022/4sh-ui-kit-layout-ui-drawer.mjs +707 -272
  108. package/fesm2022/4sh-ui-kit-layout-ui-drawer.mjs.map +1 -1
  109. package/fesm2022/4sh-ui-kit-layout-ui-modal.mjs +1146 -568
  110. package/fesm2022/4sh-ui-kit-layout-ui-modal.mjs.map +1 -1
  111. package/fesm2022/4sh-ui-kit-layout-ui-popover.mjs +519 -308
  112. package/fesm2022/4sh-ui-kit-layout-ui-popover.mjs.map +1 -1
  113. package/fesm2022/4sh-ui-kit-motion.mjs +252 -150
  114. package/fesm2022/4sh-ui-kit-motion.mjs.map +1 -1
  115. package/fesm2022/4sh-ui-kit-navigation-ui-bottom-tab-bar.mjs +793 -341
  116. package/fesm2022/4sh-ui-kit-navigation-ui-bottom-tab-bar.mjs.map +1 -1
  117. package/fesm2022/4sh-ui-kit-navigation-ui-breadcrumb.mjs +351 -194
  118. package/fesm2022/4sh-ui-kit-navigation-ui-breadcrumb.mjs.map +1 -1
  119. package/fesm2022/4sh-ui-kit-navigation-ui-context-menu.mjs +511 -220
  120. package/fesm2022/4sh-ui-kit-navigation-ui-context-menu.mjs.map +1 -1
  121. package/fesm2022/4sh-ui-kit-navigation-ui-menu.mjs +910 -548
  122. package/fesm2022/4sh-ui-kit-navigation-ui-menu.mjs.map +1 -1
  123. package/fesm2022/4sh-ui-kit-navigation-ui-sidebar.mjs +1128 -555
  124. package/fesm2022/4sh-ui-kit-navigation-ui-sidebar.mjs.map +1 -1
  125. package/fesm2022/4sh-ui-kit-navigation-ui-stepper.mjs +915 -470
  126. package/fesm2022/4sh-ui-kit-navigation-ui-stepper.mjs.map +1 -1
  127. package/fesm2022/4sh-ui-kit-navigation-ui-tabs.mjs +931 -474
  128. package/fesm2022/4sh-ui-kit-navigation-ui-tabs.mjs.map +1 -1
  129. package/fesm2022/4sh-ui-kit-overlay.mjs +26 -109
  130. package/fesm2022/4sh-ui-kit-overlay.mjs.map +1 -1
  131. package/fesm2022/4sh-ui-kit-ripple.mjs +329 -290
  132. package/fesm2022/4sh-ui-kit-ripple.mjs.map +1 -1
  133. package/fesm2022/4sh-ui-kit-table-ui-paginator.mjs +709 -248
  134. package/fesm2022/4sh-ui-kit-table-ui-paginator.mjs.map +1 -1
  135. package/fesm2022/4sh-ui-kit-table-ui-table.mjs +2633 -1370
  136. package/fesm2022/4sh-ui-kit-table-ui-table.mjs.map +1 -1
  137. package/fesm2022/4sh-ui-kit-theming.mjs +112 -113
  138. package/fesm2022/4sh-ui-kit-theming.mjs.map +1 -1
  139. package/fesm2022/4sh-ui-kit-types.mjs +0 -12
  140. package/fesm2022/4sh-ui-kit.mjs +3 -15
  141. package/fesm2022/4sh-ui-kit.mjs.map +1 -1
  142. package/mcp/data/component-api.json +313 -2
  143. package/mcp/data/text-search-docs.json +177 -17
  144. package/mcp/data/ui-config.json +378 -1
  145. package/mcp/index.js +8190 -2876
  146. package/mcp/package.json +1 -1
  147. package/package.json +5 -1
  148. package/styles/component-vars.scss +22 -1
  149. package/styles/utils/_mixins.scss +11 -0
  150. package/types/4sh-ui-kit-actions-ui-button-split.d.ts +198 -87
  151. package/types/4sh-ui-kit-actions-ui-button.d.ts +240 -116
  152. package/types/4sh-ui-kit-actions-ui-link.d.ts +136 -67
  153. package/types/4sh-ui-kit-actions-ui-speed-dial.d.ts +287 -180
  154. package/types/4sh-ui-kit-base-ui-icon.d.ts +92 -58
  155. package/types/4sh-ui-kit-base-ui-image.d.ts +406 -205
  156. package/types/4sh-ui-kit-forms-ui-autocomplete.d.ts +577 -367
  157. package/types/4sh-ui-kit-forms-ui-checkbox.d.ts +77 -42
  158. package/types/4sh-ui-kit-forms-ui-datepicker.d.ts +953 -700
  159. package/types/4sh-ui-kit-forms-ui-editor.d.ts +374 -340
  160. package/types/4sh-ui-kit-forms-ui-field-sign.d.ts +325 -0
  161. package/types/4sh-ui-kit-forms-ui-field.d.ts +150 -64
  162. package/types/4sh-ui-kit-forms-ui-file-upload.d.ts +583 -241
  163. package/types/4sh-ui-kit-forms-ui-input-date.d.ts +152 -103
  164. package/types/4sh-ui-kit-forms-ui-input-group.d.ts +109 -63
  165. package/types/4sh-ui-kit-forms-ui-input-mask.d.ts +93 -57
  166. package/types/4sh-ui-kit-forms-ui-input-number.d.ts +171 -93
  167. package/types/4sh-ui-kit-forms-ui-input-otp.d.ts +137 -100
  168. package/types/4sh-ui-kit-forms-ui-input-tags.d.ts +469 -309
  169. package/types/4sh-ui-kit-forms-ui-input.d.ts +198 -116
  170. package/types/4sh-ui-kit-forms-ui-knob.d.ts +132 -80
  171. package/types/4sh-ui-kit-forms-ui-label.d.ts +47 -22
  172. package/types/4sh-ui-kit-forms-ui-nudger.d.ts +134 -67
  173. package/types/4sh-ui-kit-forms-ui-radio.d.ts +48 -33
  174. package/types/4sh-ui-kit-forms-ui-rating.d.ts +120 -86
  175. package/types/4sh-ui-kit-forms-ui-segment-control.d.ts +221 -147
  176. package/types/4sh-ui-kit-forms-ui-select.d.ts +561 -357
  177. package/types/4sh-ui-kit-forms-ui-slider.d.ts +156 -105
  178. package/types/4sh-ui-kit-forms-ui-swatch-picker.d.ts +133 -97
  179. package/types/4sh-ui-kit-forms-ui-textarea.d.ts +90 -54
  180. package/types/4sh-ui-kit-forms-ui-toggle-block.d.ts +158 -94
  181. package/types/4sh-ui-kit-forms-ui-toggle-button.d.ts +314 -178
  182. package/types/4sh-ui-kit-forms-ui-toggle.d.ts +88 -54
  183. package/types/4sh-ui-kit-forms.d.ts +291 -186
  184. package/types/4sh-ui-kit-informative-ui-accordion.d.ts +162 -92
  185. package/types/4sh-ui-kit-informative-ui-alert.d.ts +128 -62
  186. package/types/4sh-ui-kit-informative-ui-avatar-group.d.ts +8 -8
  187. package/types/4sh-ui-kit-informative-ui-avatar.d.ts +81 -44
  188. package/types/4sh-ui-kit-informative-ui-badge.d.ts +71 -41
  189. package/types/4sh-ui-kit-informative-ui-chip.d.ts +194 -99
  190. package/types/4sh-ui-kit-informative-ui-empty-state.d.ts +105 -65
  191. package/types/4sh-ui-kit-informative-ui-helper.d.ts +64 -34
  192. package/types/4sh-ui-kit-informative-ui-progress-bar.d.ts +120 -65
  193. package/types/4sh-ui-kit-informative-ui-read-only.d.ts +147 -67
  194. package/types/4sh-ui-kit-informative-ui-separator.d.ts +65 -35
  195. package/types/4sh-ui-kit-informative-ui-skeleton.d.ts +62 -32
  196. package/types/4sh-ui-kit-informative-ui-spinner.d.ts +111 -50
  197. package/types/4sh-ui-kit-informative-ui-tag.d.ts +77 -37
  198. package/types/4sh-ui-kit-informative-ui-toast.d.ts +300 -180
  199. package/types/4sh-ui-kit-informative-ui-tooltip.d.ts +269 -141
  200. package/types/4sh-ui-kit-layout-ui-bottom-sheet.d.ts +360 -221
  201. package/types/4sh-ui-kit-layout-ui-card.d.ts +119 -79
  202. package/types/4sh-ui-kit-layout-ui-drawer.d.ts +244 -120
  203. package/types/4sh-ui-kit-layout-ui-modal.d.ts +409 -222
  204. package/types/4sh-ui-kit-layout-ui-popover.d.ts +149 -91
  205. package/types/4sh-ui-kit-motion.d.ts +117 -67
  206. package/types/4sh-ui-kit-navigation-ui-bottom-tab-bar.d.ts +279 -145
  207. package/types/4sh-ui-kit-navigation-ui-breadcrumb.d.ts +134 -96
  208. package/types/4sh-ui-kit-navigation-ui-context-menu.d.ts +148 -89
  209. package/types/4sh-ui-kit-navigation-ui-menu.d.ts +282 -201
  210. package/types/4sh-ui-kit-navigation-ui-sidebar.d.ts +425 -261
  211. package/types/4sh-ui-kit-navigation-ui-stepper.d.ts +279 -183
  212. package/types/4sh-ui-kit-navigation-ui-tabs.d.ts +275 -173
  213. package/types/4sh-ui-kit-overlay.d.ts +6 -6
  214. package/types/4sh-ui-kit-ripple.d.ts +99 -74
  215. package/types/4sh-ui-kit-table-ui-paginator.d.ts +237 -133
  216. package/types/4sh-ui-kit-table-ui-table.d.ts +769 -470
  217. package/types/4sh-ui-kit-theming.d.ts +27 -29
  218. package/types/4sh-ui-kit-types.d.ts +6 -5
  219. package/types/4sh-ui-kit.d.ts +4 -3
  220. package/fesm2022/4sh-ui-kit-types.mjs.map +0 -1
@@ -1,424 +1,794 @@
1
- import { isPlatformBrowser, NgTemplateOutlet } from '@angular/common';
2
- import * as i0 from '@angular/core';
3
- import { input, booleanAttribute, output, computed, Component, signal, Injectable, numberAttribute, inject, PLATFORM_ID, effect, DestroyRef } from '@angular/core';
4
- import { UiMotion } from '@4sh/ui-kit/motion';
5
- import { UiIcon } from '@4sh/ui-kit/base/ui-icon';
6
-
7
- /** All positions, in declaration order (handy for stories/docs). */
1
+ import { NgTemplateOutlet, isPlatformBrowser } from "@angular/common";
2
+ import * as i0 from "@angular/core";
3
+ import { Component, DestroyRef, Injectable, PLATFORM_ID, booleanAttribute, computed, effect, inject, input, numberAttribute, output, signal } from "@angular/core";
4
+ import { UiMotion } from "@4sh/ui-kit/motion";
5
+ import { UiIcon } from "@4sh/ui-kit/base/ui-icon";
8
6
  const UI_TOAST_POSITIONS = [
9
- 'top-left',
10
- 'top-center',
11
- 'top-right',
12
- 'bottom-left',
13
- 'bottom-center',
14
- 'bottom-right',
15
- 'center',
7
+ "top-left",
8
+ "top-center",
9
+ "top-right",
10
+ "bottom-left",
11
+ "bottom-center",
12
+ "bottom-right",
13
+ "center"
16
14
  ];
17
- /** Default leading icon per semantic level (FontAwesome names, from the Figma source). */
18
15
  const UI_TOAST_DEFAULT_ICONS = {
19
- default: 'info-circle',
20
- highlight: 'info-circle',
21
- success: 'check',
22
- warning: 'warning',
23
- error: 'times',
16
+ default: "info-circle",
17
+ highlight: "info-circle",
18
+ success: "check",
19
+ warning: "warning",
20
+ error: "times"
24
21
  };
25
-
26
- /**
27
- * ui-toast — presentational notification card.
28
- *
29
- * Headless & fully token-driven (the `informative` category): surface, content
30
- * and stroke all come from `--informative-{level}{sub}-*`. It renders the Figma
31
- * anatomy (leading icon · title/text · dismiss button) and projects `<ng-content>`
32
- * in the content region for custom bodies or action buttons.
33
- *
34
- * Usually rendered for you by {@link UiToastContainer} from a {@link UiToastService}
35
- * message, but it is a plain standalone card — drop `<ui-toast>` anywhere.
36
- *
37
- * @example
38
- * ```html
39
- * <ui-toast level="success" title="Enregistré" text="Profil mis à jour." (closed)="…" />
40
- * ```
41
- */
42
- class UiToast {
43
- constructor() {
44
- /** Bold heading line. */
45
- this.title = input(/* @ts-ignore */
46
- ...(ngDevMode ? [undefined, { debugName: "title" }] : /* istanbul ignore next */ []));
47
- /** Supporting body line. */
48
- this.text = input(/* @ts-ignore */
49
- ...(ngDevMode ? [undefined, { debugName: "text" }] : /* istanbul ignore next */ []));
50
- /** Semantic level — colours + default icon. */
51
- this.level = input('default', /* @ts-ignore */
52
- ...(ngDevMode ? [{ debugName: "level" }] : /* istanbul ignore next */ []));
53
- /** Hierarchical intensity (`high` = solid, `low` = subtle). */
54
- this.subLevel = input('high', /* @ts-ignore */
55
- ...(ngDevMode ? [{ debugName: "subLevel" }] : /* istanbul ignore next */ []));
56
- /**
57
- * Leading icon: a FontAwesome name to override the level default, `false`
58
- * to hide it, or `true` (default) for the level's default icon.
59
- */
60
- this.icon = input(true, /* @ts-ignore */
61
- ...(ngDevMode ? [{ debugName: "icon" }] : /* istanbul ignore next */ []));
62
- /** Show the dismiss button (default `true`). */
63
- this.closable = input(true, { ...(ngDevMode ? { debugName: "closable" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
64
- /** FontAwesome name of the dismiss icon. */
65
- this.closeIcon = input('times-circle', /* @ts-ignore */
66
- ...(ngDevMode ? [{ debugName: "closeIcon" }] : /* istanbul ignore next */ []));
67
- /** Accessible label of the dismiss button. */
68
- this.closeAriaLabel = input('Fermer', /* @ts-ignore */
69
- ...(ngDevMode ? [{ debugName: "closeAriaLabel" }] : /* istanbul ignore next */ []));
70
- /** Stretch the card to fill its region width (banner-style). */
71
- this.expanded = input(false, { ...(ngDevMode ? { debugName: "expanded" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
72
- /** Extra class(es) merged onto the card root. */
73
- this.styleClass = input(/* @ts-ignore */
74
- ...(ngDevMode ? [undefined, { debugName: "styleClass" }] : /* istanbul ignore next */ []));
75
- /** Emitted when the user clicks the dismiss button. */
76
- this.closed = output();
77
- /** @ignore Resolved leading icon name (null when hidden). */
78
- this.iconName = computed(() => {
79
- const icon = this.icon();
80
- if (icon === false)
81
- return null;
82
- if (typeof icon === 'string')
83
- return icon;
84
- return UI_TOAST_DEFAULT_ICONS[this.level()];
85
- }, /* @ts-ignore */
86
- ...(ngDevMode ? [{ debugName: "iconName" }] : /* istanbul ignore next */ []));
87
- /** @ignore ARIA role — assertive alert for error/warning, polite status otherwise
88
- * (mirrors ui-alert, so a standalone ui-toast self-announces without the container). */
89
- this.role = computed(() => this.level() === 'error' || this.level() === 'warning' ? 'alert' : 'status', /* @ts-ignore */
90
- ...(ngDevMode ? [{ debugName: "role" }] : /* istanbul ignore next */ []));
91
- /** @ignore */
92
- this.ariaLive = computed(() => this.level() === 'error' || this.level() === 'warning' ? 'assertive' : 'polite', /* @ts-ignore */
93
- ...(ngDevMode ? [{ debugName: "ariaLive" }] : /* istanbul ignore next */ []));
94
- /** @ignore */
95
- this.classes = computed(() => {
96
- const c = ['ui-toast', `_${this.level()}`, `_${this.subLevel()}`];
97
- if (this.expanded())
98
- c.push('_expanded');
99
- const sc = this.styleClass();
100
- if (sc)
101
- c.push(sc);
102
- return c.join(' ');
103
- }, /* @ts-ignore */
104
- ...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
105
- }
106
- /** @ignore */
107
- onClose(event) {
108
- this.closed.emit(event);
109
- }
110
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: UiToast, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
111
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.7", type: UiToast, isStandalone: true, selector: "ui-toast", inputs: { title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, text: { classPropertyName: "text", publicName: "text", isSignal: true, isRequired: false, transformFunction: null }, level: { classPropertyName: "level", publicName: "level", isSignal: true, isRequired: false, transformFunction: null }, subLevel: { classPropertyName: "subLevel", publicName: "subLevel", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, closable: { classPropertyName: "closable", publicName: "closable", isSignal: true, isRequired: false, transformFunction: null }, closeIcon: { classPropertyName: "closeIcon", publicName: "closeIcon", isSignal: true, isRequired: false, transformFunction: null }, closeAriaLabel: { classPropertyName: "closeAriaLabel", publicName: "closeAriaLabel", isSignal: true, isRequired: false, transformFunction: null }, expanded: { classPropertyName: "expanded", publicName: "expanded", isSignal: true, isRequired: false, transformFunction: null }, styleClass: { classPropertyName: "styleClass", publicName: "styleClass", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { closed: "closed" }, host: { properties: { "style.display": "'inline-flex'", "style.maxWidth": "'100%'" } }, ngImport: i0, template: "<div [class]=\"classes()\" [attr.role]=\"role()\" [attr.aria-live]=\"ariaLive()\" aria-atomic=\"true\">\n @if (iconName(); as name) {\n <span class=\"ui-toast-icon\">\n <ui-icon [name]=\"name\" size=\"md\" />\n </span>\n }\n\n <div class=\"ui-toast-content\">\n @if (title(); as t) {\n <span class=\"ui-toast-title\">{{ t }}</span>\n }\n @if (text(); as txt) {\n <span class=\"ui-toast-text\">{{ txt }}</span>\n }\n <ng-content />\n </div>\n\n @if (closable()) {\n <button\n type=\"button\"\n class=\"ui-toast-close\"\n [attr.aria-label]=\"closeAriaLabel()\"\n (click)=\"onClose($event)\"\n >\n <ui-icon [name]=\"closeIcon()\" size=\"sm\" />\n </button>\n }\n</div>\n", styles: [".ui-toast{display:inline-flex;align-items:var(--ui-toast-align, flex-start);gap:var(--units-sm);box-sizing:border-box;width:auto;max-width:100%;padding:var(--units-sm) var(--units-md);border:var(--stroke-default) solid transparent;border-radius:var(--radius-default);background-color:var(--ui-toast-surface, var(--informative-defaulthigh-surface-default));color:var(--ui-toast-color, var(--informative-defaulthigh-content-default));box-shadow:var(--shadow-default-md);font-family:var(--ui-toast-font-family, var(--fontfamily-base))}.ui-toast._expanded{display:flex;width:100%}.ui-toast-icon{flex:0 0 auto;display:flex;align-items:center;align-self:var(--ui-toast-icon-align, auto);padding-top:var(--ui-toast-icon-padding-top, var(--units-2xs));line-height:0}.ui-toast-content{flex:1 1 auto;min-width:0;display:flex;flex-direction:column;justify-content:center;gap:var(--units-2xs);padding-right:var(--units-sm)}.ui-toast-title{font-family:var(--ui-toast-title-font-family, var(--fontfamily-title));font-weight:var(--ui-toast-title-weight, var(--weight-bold));font-size:var(--size-typography-title-sm);line-height:1.3;overflow-wrap:break-word}.ui-toast-text{font-weight:var(--ui-toast-text-weight, var(--weight-light));font-size:var(--size-typography-text-md);line-height:1.3;overflow-wrap:break-word}.ui-toast-close{flex:0 0 auto;display:inline-flex;align-items:center;align-self:var(--ui-toast-close-align, auto);justify-content:center;padding:0;border:0;border-radius:var(--radius-xs);background:transparent;color:inherit;line-height:0;cursor:pointer;opacity:.7;transition:opacity var(--ui-motion-duration, var(--motion-toggle-duration, var(--transition-default))) var(--ui-motion-easing, var(--motion-toggle-easing, var(--transition-easeinout))) var(--ui-motion-delay, 0ms)}.ui-toast-close:hover{opacity:1}.ui-toast-close:focus-visible{outline:var(--ui-toast-focus-ring-width, var(--ui-focus-ring-width, var(--units-2xs))) solid currentColor;outline-offset:.125rem;opacity:1}@media(prefers-reduced-motion:reduce){.ui-toast-close{transition-duration:.01ms}}:root[data-motion=off] .ui-toast-close{transition-duration:.01ms}.ui-toast._default._high{background-color:var(--ui-toast-surface, var(--informative-defaulthigh-surface-default));color:var(--ui-toast-color, var(--informative-defaulthigh-content-default));border-color:var(--ui-toast-stroke, var(--informative-defaulthigh-stroke-default))}.ui-toast._default._low{background-color:var(--ui-toast-surface, var(--informative-defaultlow-surface-default));color:var(--ui-toast-color, var(--informative-defaultlow-content-default));border-color:var(--ui-toast-stroke, var(--informative-defaultlow-stroke-default))}.ui-toast._highlight._high{background-color:var(--ui-toast-surface, var(--informative-highlighthigh-surface-default));color:var(--ui-toast-color, var(--informative-highlighthigh-content-default));border-color:var(--ui-toast-stroke, var(--informative-highlighthigh-stroke-default))}.ui-toast._highlight._low{background-color:var(--ui-toast-surface, var(--informative-highlightlow-surface-default));color:var(--ui-toast-color, var(--informative-highlightlow-content-default));border-color:var(--ui-toast-stroke, var(--informative-highlightlow-stroke-default))}.ui-toast._success._high{background-color:var(--ui-toast-surface, var(--informative-successhigh-surface-default));color:var(--ui-toast-color, var(--informative-successhigh-content-default));border-color:var(--ui-toast-stroke, var(--informative-successhigh-stroke-default))}.ui-toast._success._low{background-color:var(--ui-toast-surface, var(--informative-successlow-surface-default));color:var(--ui-toast-color, var(--informative-successlow-content-default));border-color:var(--ui-toast-stroke, var(--informative-successlow-stroke-default))}.ui-toast._warning._high{background-color:var(--ui-toast-surface, var(--informative-warninghigh-surface-default));color:var(--ui-toast-color, var(--informative-warninghigh-content-default));border-color:var(--ui-toast-stroke, var(--informative-warninghigh-stroke-default))}.ui-toast._warning._low{background-color:var(--ui-toast-surface, var(--informative-warninglow-surface-default));color:var(--ui-toast-color, var(--informative-warninglow-content-default));border-color:var(--ui-toast-stroke, var(--informative-warninglow-stroke-default))}.ui-toast._error._high{background-color:var(--ui-toast-surface, var(--informative-errorhigh-surface-default));color:var(--ui-toast-color, var(--informative-errorhigh-content-default));border-color:var(--ui-toast-stroke, var(--informative-errorhigh-stroke-default))}.ui-toast._error._low{background-color:var(--ui-toast-surface, var(--informative-errorlow-surface-default));color:var(--ui-toast-color, var(--informative-errorlow-content-default));border-color:var(--ui-toast-stroke, var(--informative-errorlow-stroke-default))}\n"], dependencies: [{ kind: "component", type: UiIcon, selector: "ui-icon", inputs: ["name", "size", "type", "family", "decorative", "ariaLabel"] }] }); }
112
- }
113
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: UiToast, decorators: [{
114
- type: Component,
115
- args: [{ selector: 'ui-toast', imports: [UiIcon], host: {
116
- // Hug content by default; the container makes it fill the region in banner mode.
117
- '[style.display]': "'inline-flex'",
118
- '[style.maxWidth]': "'100%'",
119
- }, template: "<div [class]=\"classes()\" [attr.role]=\"role()\" [attr.aria-live]=\"ariaLive()\" aria-atomic=\"true\">\n @if (iconName(); as name) {\n <span class=\"ui-toast-icon\">\n <ui-icon [name]=\"name\" size=\"md\" />\n </span>\n }\n\n <div class=\"ui-toast-content\">\n @if (title(); as t) {\n <span class=\"ui-toast-title\">{{ t }}</span>\n }\n @if (text(); as txt) {\n <span class=\"ui-toast-text\">{{ txt }}</span>\n }\n <ng-content />\n </div>\n\n @if (closable()) {\n <button\n type=\"button\"\n class=\"ui-toast-close\"\n [attr.aria-label]=\"closeAriaLabel()\"\n (click)=\"onClose($event)\"\n >\n <ui-icon [name]=\"closeIcon()\" size=\"sm\" />\n </button>\n }\n</div>\n", styles: [".ui-toast{display:inline-flex;align-items:var(--ui-toast-align, flex-start);gap:var(--units-sm);box-sizing:border-box;width:auto;max-width:100%;padding:var(--units-sm) var(--units-md);border:var(--stroke-default) solid transparent;border-radius:var(--radius-default);background-color:var(--ui-toast-surface, var(--informative-defaulthigh-surface-default));color:var(--ui-toast-color, var(--informative-defaulthigh-content-default));box-shadow:var(--shadow-default-md);font-family:var(--ui-toast-font-family, var(--fontfamily-base))}.ui-toast._expanded{display:flex;width:100%}.ui-toast-icon{flex:0 0 auto;display:flex;align-items:center;align-self:var(--ui-toast-icon-align, auto);padding-top:var(--ui-toast-icon-padding-top, var(--units-2xs));line-height:0}.ui-toast-content{flex:1 1 auto;min-width:0;display:flex;flex-direction:column;justify-content:center;gap:var(--units-2xs);padding-right:var(--units-sm)}.ui-toast-title{font-family:var(--ui-toast-title-font-family, var(--fontfamily-title));font-weight:var(--ui-toast-title-weight, var(--weight-bold));font-size:var(--size-typography-title-sm);line-height:1.3;overflow-wrap:break-word}.ui-toast-text{font-weight:var(--ui-toast-text-weight, var(--weight-light));font-size:var(--size-typography-text-md);line-height:1.3;overflow-wrap:break-word}.ui-toast-close{flex:0 0 auto;display:inline-flex;align-items:center;align-self:var(--ui-toast-close-align, auto);justify-content:center;padding:0;border:0;border-radius:var(--radius-xs);background:transparent;color:inherit;line-height:0;cursor:pointer;opacity:.7;transition:opacity var(--ui-motion-duration, var(--motion-toggle-duration, var(--transition-default))) var(--ui-motion-easing, var(--motion-toggle-easing, var(--transition-easeinout))) var(--ui-motion-delay, 0ms)}.ui-toast-close:hover{opacity:1}.ui-toast-close:focus-visible{outline:var(--ui-toast-focus-ring-width, var(--ui-focus-ring-width, var(--units-2xs))) solid currentColor;outline-offset:.125rem;opacity:1}@media(prefers-reduced-motion:reduce){.ui-toast-close{transition-duration:.01ms}}:root[data-motion=off] .ui-toast-close{transition-duration:.01ms}.ui-toast._default._high{background-color:var(--ui-toast-surface, var(--informative-defaulthigh-surface-default));color:var(--ui-toast-color, var(--informative-defaulthigh-content-default));border-color:var(--ui-toast-stroke, var(--informative-defaulthigh-stroke-default))}.ui-toast._default._low{background-color:var(--ui-toast-surface, var(--informative-defaultlow-surface-default));color:var(--ui-toast-color, var(--informative-defaultlow-content-default));border-color:var(--ui-toast-stroke, var(--informative-defaultlow-stroke-default))}.ui-toast._highlight._high{background-color:var(--ui-toast-surface, var(--informative-highlighthigh-surface-default));color:var(--ui-toast-color, var(--informative-highlighthigh-content-default));border-color:var(--ui-toast-stroke, var(--informative-highlighthigh-stroke-default))}.ui-toast._highlight._low{background-color:var(--ui-toast-surface, var(--informative-highlightlow-surface-default));color:var(--ui-toast-color, var(--informative-highlightlow-content-default));border-color:var(--ui-toast-stroke, var(--informative-highlightlow-stroke-default))}.ui-toast._success._high{background-color:var(--ui-toast-surface, var(--informative-successhigh-surface-default));color:var(--ui-toast-color, var(--informative-successhigh-content-default));border-color:var(--ui-toast-stroke, var(--informative-successhigh-stroke-default))}.ui-toast._success._low{background-color:var(--ui-toast-surface, var(--informative-successlow-surface-default));color:var(--ui-toast-color, var(--informative-successlow-content-default));border-color:var(--ui-toast-stroke, var(--informative-successlow-stroke-default))}.ui-toast._warning._high{background-color:var(--ui-toast-surface, var(--informative-warninghigh-surface-default));color:var(--ui-toast-color, var(--informative-warninghigh-content-default));border-color:var(--ui-toast-stroke, var(--informative-warninghigh-stroke-default))}.ui-toast._warning._low{background-color:var(--ui-toast-surface, var(--informative-warninglow-surface-default));color:var(--ui-toast-color, var(--informative-warninglow-content-default));border-color:var(--ui-toast-stroke, var(--informative-warninglow-stroke-default))}.ui-toast._error._high{background-color:var(--ui-toast-surface, var(--informative-errorhigh-surface-default));color:var(--ui-toast-color, var(--informative-errorhigh-content-default));border-color:var(--ui-toast-stroke, var(--informative-errorhigh-stroke-default))}.ui-toast._error._low{background-color:var(--ui-toast-surface, var(--informative-errorlow-surface-default));color:var(--ui-toast-color, var(--informative-errorlow-content-default));border-color:var(--ui-toast-stroke, var(--informative-errorlow-stroke-default))}\n"] }]
120
- }], propDecorators: { title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], text: [{ type: i0.Input, args: [{ isSignal: true, alias: "text", required: false }] }], level: [{ type: i0.Input, args: [{ isSignal: true, alias: "level", required: false }] }], subLevel: [{ type: i0.Input, args: [{ isSignal: true, alias: "subLevel", required: false }] }], icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], closable: [{ type: i0.Input, args: [{ isSignal: true, alias: "closable", required: false }] }], closeIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "closeIcon", required: false }] }], closeAriaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "closeAriaLabel", required: false }] }], expanded: [{ type: i0.Input, args: [{ isSignal: true, alias: "expanded", required: false }] }], styleClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "styleClass", required: false }] }], closed: [{ type: i0.Output, args: ["closed"] }] } });
121
-
122
- /** Process-wide counter guaranteeing unique auto-generated toast ids. */
22
+ var UiToast = class UiToast {
23
+ constructor() {
24
+ this.title = input(...ngDevMode ? [void 0, { debugName: "title" }] : /* istanbul ignore next */ []);
25
+ this.text = input(...ngDevMode ? [void 0, { debugName: "text" }] : /* istanbul ignore next */ []);
26
+ this.level = input("default", ...ngDevMode ? [{ debugName: "level" }] : /* istanbul ignore next */ []);
27
+ this.subLevel = input("high", ...ngDevMode ? [{ debugName: "subLevel" }] : /* istanbul ignore next */ []);
28
+ this.icon = input(true, ...ngDevMode ? [{ debugName: "icon" }] : /* istanbul ignore next */ []);
29
+ this.closable = input(true, {
30
+ ...ngDevMode ? { debugName: "closable" } : /* istanbul ignore next */ {},
31
+ transform: booleanAttribute
32
+ });
33
+ this.closeIcon = input("times-circle", ...ngDevMode ? [{ debugName: "closeIcon" }] : /* istanbul ignore next */ []);
34
+ this.closeAriaLabel = input("Fermer", ...ngDevMode ? [{ debugName: "closeAriaLabel" }] : /* istanbul ignore next */ []);
35
+ this.expanded = input(false, {
36
+ ...ngDevMode ? { debugName: "expanded" } : /* istanbul ignore next */ {},
37
+ transform: booleanAttribute
38
+ });
39
+ this.styleClass = input(...ngDevMode ? [void 0, { debugName: "styleClass" }] : /* istanbul ignore next */ []);
40
+ this.closed = output();
41
+ this.iconName = computed(() => {
42
+ const icon = this.icon();
43
+ if (icon === false) return null;
44
+ if (typeof icon === "string") return icon;
45
+ return UI_TOAST_DEFAULT_ICONS[this.level()];
46
+ }, ...ngDevMode ? [{ debugName: "iconName" }] : /* istanbul ignore next */ []);
47
+ this.role = computed(() => this.level() === "error" || this.level() === "warning" ? "alert" : "status", ...ngDevMode ? [{ debugName: "role" }] : /* istanbul ignore next */ []);
48
+ this.ariaLive = computed(() => this.level() === "error" || this.level() === "warning" ? "assertive" : "polite", ...ngDevMode ? [{ debugName: "ariaLive" }] : /* istanbul ignore next */ []);
49
+ this.classes = computed(() => {
50
+ const c = [
51
+ "ui-toast",
52
+ `_${this.level()}`,
53
+ `_${this.subLevel()}`
54
+ ];
55
+ if (this.expanded()) c.push("_expanded");
56
+ const sc = this.styleClass();
57
+ if (sc) c.push(sc);
58
+ return c.join(" ");
59
+ }, ...ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []);
60
+ }
61
+ onClose(event) {
62
+ this.closed.emit(event);
63
+ }
64
+ static {
65
+ this.ɵfac = i0.ɵɵngDeclareFactory({
66
+ minVersion: "12.0.0",
67
+ version: "22.3.0",
68
+ ngImport: i0,
69
+ type: UiToast,
70
+ deps: [],
71
+ target: i0.ɵɵFactoryTarget.Component
72
+ });
73
+ }
74
+ static {
75
+ this.ɵcmp = i0.ɵɵngDeclareComponent({
76
+ minVersion: "17.0.0",
77
+ version: "22.3.0",
78
+ type: UiToast,
79
+ isStandalone: true,
80
+ selector: "ui-toast",
81
+ inputs: {
82
+ title: {
83
+ classPropertyName: "title",
84
+ publicName: "title",
85
+ isSignal: true,
86
+ isRequired: false,
87
+ transformFunction: null
88
+ },
89
+ text: {
90
+ classPropertyName: "text",
91
+ publicName: "text",
92
+ isSignal: true,
93
+ isRequired: false,
94
+ transformFunction: null
95
+ },
96
+ level: {
97
+ classPropertyName: "level",
98
+ publicName: "level",
99
+ isSignal: true,
100
+ isRequired: false,
101
+ transformFunction: null
102
+ },
103
+ subLevel: {
104
+ classPropertyName: "subLevel",
105
+ publicName: "subLevel",
106
+ isSignal: true,
107
+ isRequired: false,
108
+ transformFunction: null
109
+ },
110
+ icon: {
111
+ classPropertyName: "icon",
112
+ publicName: "icon",
113
+ isSignal: true,
114
+ isRequired: false,
115
+ transformFunction: null
116
+ },
117
+ closable: {
118
+ classPropertyName: "closable",
119
+ publicName: "closable",
120
+ isSignal: true,
121
+ isRequired: false,
122
+ transformFunction: null
123
+ },
124
+ closeIcon: {
125
+ classPropertyName: "closeIcon",
126
+ publicName: "closeIcon",
127
+ isSignal: true,
128
+ isRequired: false,
129
+ transformFunction: null
130
+ },
131
+ closeAriaLabel: {
132
+ classPropertyName: "closeAriaLabel",
133
+ publicName: "closeAriaLabel",
134
+ isSignal: true,
135
+ isRequired: false,
136
+ transformFunction: null
137
+ },
138
+ expanded: {
139
+ classPropertyName: "expanded",
140
+ publicName: "expanded",
141
+ isSignal: true,
142
+ isRequired: false,
143
+ transformFunction: null
144
+ },
145
+ styleClass: {
146
+ classPropertyName: "styleClass",
147
+ publicName: "styleClass",
148
+ isSignal: true,
149
+ isRequired: false,
150
+ transformFunction: null
151
+ }
152
+ },
153
+ outputs: { closed: "closed" },
154
+ host: { properties: {
155
+ "style.display": "'inline-flex'",
156
+ "style.maxWidth": "'100%'"
157
+ } },
158
+ ngImport: i0,
159
+ template: "<div [class]=\"classes()\" [attr.role]=\"role()\" [attr.aria-live]=\"ariaLive()\" aria-atomic=\"true\">\n @if (iconName(); as name) {\n <span class=\"ui-toast-icon\">\n <ui-icon [name]=\"name\" size=\"md\" />\n </span>\n }\n\n <div class=\"ui-toast-content\">\n @if (title(); as t) {\n <span class=\"ui-toast-title\">{{ t }}</span>\n }\n @if (text(); as txt) {\n <span class=\"ui-toast-text\">{{ txt }}</span>\n }\n <ng-content />\n </div>\n\n @if (closable()) {\n <button\n type=\"button\"\n class=\"ui-toast-close\"\n [attr.aria-label]=\"closeAriaLabel()\"\n (click)=\"onClose($event)\"\n >\n <ui-icon [name]=\"closeIcon()\" size=\"sm\" />\n </button>\n }\n</div>\n",
160
+ styles: [".ui-toast{display:inline-flex;align-items:var(--ui-toast-align, flex-start);gap:var(--units-sm);box-sizing:border-box;width:auto;max-width:100%;padding:var(--units-sm) var(--units-md);border:var(--stroke-default) solid transparent;border-radius:var(--radius-default);background-color:var(--ui-toast-surface, var(--informative-defaulthigh-surface-default));color:var(--ui-toast-color, var(--informative-defaulthigh-content-default));box-shadow:var(--shadow-default-md);font-family:var(--ui-toast-font-family, var(--fontfamily-base))}.ui-toast._expanded{display:flex;width:100%}.ui-toast-icon{flex:0 0 auto;display:flex;align-items:center;align-self:var(--ui-toast-icon-align, auto);padding-top:var(--ui-toast-icon-padding-top, var(--units-2xs));line-height:0}.ui-toast-content{flex:1 1 auto;min-width:0;display:flex;flex-direction:column;justify-content:center;gap:var(--units-2xs);padding-right:var(--units-sm)}.ui-toast-title{font-family:var(--ui-toast-title-font-family, var(--fontfamily-title));font-weight:var(--ui-toast-title-weight, var(--weight-bold));font-size:var(--size-typography-title-sm);line-height:1.3;overflow-wrap:break-word}.ui-toast-text{font-weight:var(--ui-toast-text-weight, var(--weight-light));font-size:var(--size-typography-text-md);line-height:1.3;overflow-wrap:break-word}.ui-toast-close{flex:0 0 auto;display:inline-flex;align-items:center;align-self:var(--ui-toast-close-align, auto);justify-content:center;padding:0;border:0;border-radius:var(--radius-xs);background:transparent;color:inherit;line-height:0;cursor:pointer;opacity:.7;transition:opacity var(--ui-motion-duration, var(--motion-toggle-duration, var(--transition-default))) var(--ui-motion-easing, var(--motion-toggle-easing, var(--transition-easeinout))) var(--ui-motion-delay, 0ms)}.ui-toast-close:hover{opacity:1}.ui-toast-close:focus-visible{outline:var(--ui-toast-focus-ring-width, var(--ui-focus-ring-width, var(--units-2xs))) solid currentColor;outline-offset:.125rem;opacity:1}@media(prefers-reduced-motion:reduce){.ui-toast-close{transition-duration:.01ms}}:root[data-motion=off] .ui-toast-close{transition-duration:.01ms}.ui-toast._default._high{background-color:var(--ui-toast-surface, var(--informative-defaulthigh-surface-default));color:var(--ui-toast-color, var(--informative-defaulthigh-content-default));border-color:var(--ui-toast-stroke, var(--informative-defaulthigh-stroke-default))}.ui-toast._default._low{background-color:var(--ui-toast-surface, var(--informative-defaultlow-surface-default));color:var(--ui-toast-color, var(--informative-defaultlow-content-default));border-color:var(--ui-toast-stroke, var(--informative-defaultlow-stroke-default))}.ui-toast._highlight._high{background-color:var(--ui-toast-surface, var(--informative-highlighthigh-surface-default));color:var(--ui-toast-color, var(--informative-highlighthigh-content-default));border-color:var(--ui-toast-stroke, var(--informative-highlighthigh-stroke-default))}.ui-toast._highlight._low{background-color:var(--ui-toast-surface, var(--informative-highlightlow-surface-default));color:var(--ui-toast-color, var(--informative-highlightlow-content-default));border-color:var(--ui-toast-stroke, var(--informative-highlightlow-stroke-default))}.ui-toast._success._high{background-color:var(--ui-toast-surface, var(--informative-successhigh-surface-default));color:var(--ui-toast-color, var(--informative-successhigh-content-default));border-color:var(--ui-toast-stroke, var(--informative-successhigh-stroke-default))}.ui-toast._success._low{background-color:var(--ui-toast-surface, var(--informative-successlow-surface-default));color:var(--ui-toast-color, var(--informative-successlow-content-default));border-color:var(--ui-toast-stroke, var(--informative-successlow-stroke-default))}.ui-toast._warning._high{background-color:var(--ui-toast-surface, var(--informative-warninghigh-surface-default));color:var(--ui-toast-color, var(--informative-warninghigh-content-default));border-color:var(--ui-toast-stroke, var(--informative-warninghigh-stroke-default))}.ui-toast._warning._low{background-color:var(--ui-toast-surface, var(--informative-warninglow-surface-default));color:var(--ui-toast-color, var(--informative-warninglow-content-default));border-color:var(--ui-toast-stroke, var(--informative-warninglow-stroke-default))}.ui-toast._error._high{background-color:var(--ui-toast-surface, var(--informative-errorhigh-surface-default));color:var(--ui-toast-color, var(--informative-errorhigh-content-default));border-color:var(--ui-toast-stroke, var(--informative-errorhigh-stroke-default))}.ui-toast._error._low{background-color:var(--ui-toast-surface, var(--informative-errorlow-surface-default));color:var(--ui-toast-color, var(--informative-errorlow-content-default));border-color:var(--ui-toast-stroke, var(--informative-errorlow-stroke-default))}\n"],
161
+ dependencies: [{
162
+ kind: "component",
163
+ type: UiIcon,
164
+ selector: "ui-icon",
165
+ inputs: [
166
+ "name",
167
+ "size",
168
+ "type",
169
+ "family",
170
+ "decorative",
171
+ "ariaLabel"
172
+ ]
173
+ }]
174
+ });
175
+ }
176
+ };
177
+ i0.ɵɵngDeclareClassMetadata({
178
+ minVersion: "12.0.0",
179
+ version: "22.3.0",
180
+ ngImport: i0,
181
+ type: UiToast,
182
+ decorators: [{
183
+ type: Component,
184
+ args: [{
185
+ selector: "ui-toast",
186
+ imports: [UiIcon],
187
+ host: {
188
+ "[style.display]": "'inline-flex'",
189
+ "[style.maxWidth]": "'100%'"
190
+ },
191
+ template: "<div [class]=\"classes()\" [attr.role]=\"role()\" [attr.aria-live]=\"ariaLive()\" aria-atomic=\"true\">\n @if (iconName(); as name) {\n <span class=\"ui-toast-icon\">\n <ui-icon [name]=\"name\" size=\"md\" />\n </span>\n }\n\n <div class=\"ui-toast-content\">\n @if (title(); as t) {\n <span class=\"ui-toast-title\">{{ t }}</span>\n }\n @if (text(); as txt) {\n <span class=\"ui-toast-text\">{{ txt }}</span>\n }\n <ng-content />\n </div>\n\n @if (closable()) {\n <button\n type=\"button\"\n class=\"ui-toast-close\"\n [attr.aria-label]=\"closeAriaLabel()\"\n (click)=\"onClose($event)\"\n >\n <ui-icon [name]=\"closeIcon()\" size=\"sm\" />\n </button>\n }\n</div>\n",
192
+ styles: [".ui-toast{display:inline-flex;align-items:var(--ui-toast-align, flex-start);gap:var(--units-sm);box-sizing:border-box;width:auto;max-width:100%;padding:var(--units-sm) var(--units-md);border:var(--stroke-default) solid transparent;border-radius:var(--radius-default);background-color:var(--ui-toast-surface, var(--informative-defaulthigh-surface-default));color:var(--ui-toast-color, var(--informative-defaulthigh-content-default));box-shadow:var(--shadow-default-md);font-family:var(--ui-toast-font-family, var(--fontfamily-base))}.ui-toast._expanded{display:flex;width:100%}.ui-toast-icon{flex:0 0 auto;display:flex;align-items:center;align-self:var(--ui-toast-icon-align, auto);padding-top:var(--ui-toast-icon-padding-top, var(--units-2xs));line-height:0}.ui-toast-content{flex:1 1 auto;min-width:0;display:flex;flex-direction:column;justify-content:center;gap:var(--units-2xs);padding-right:var(--units-sm)}.ui-toast-title{font-family:var(--ui-toast-title-font-family, var(--fontfamily-title));font-weight:var(--ui-toast-title-weight, var(--weight-bold));font-size:var(--size-typography-title-sm);line-height:1.3;overflow-wrap:break-word}.ui-toast-text{font-weight:var(--ui-toast-text-weight, var(--weight-light));font-size:var(--size-typography-text-md);line-height:1.3;overflow-wrap:break-word}.ui-toast-close{flex:0 0 auto;display:inline-flex;align-items:center;align-self:var(--ui-toast-close-align, auto);justify-content:center;padding:0;border:0;border-radius:var(--radius-xs);background:transparent;color:inherit;line-height:0;cursor:pointer;opacity:.7;transition:opacity var(--ui-motion-duration, var(--motion-toggle-duration, var(--transition-default))) var(--ui-motion-easing, var(--motion-toggle-easing, var(--transition-easeinout))) var(--ui-motion-delay, 0ms)}.ui-toast-close:hover{opacity:1}.ui-toast-close:focus-visible{outline:var(--ui-toast-focus-ring-width, var(--ui-focus-ring-width, var(--units-2xs))) solid currentColor;outline-offset:.125rem;opacity:1}@media(prefers-reduced-motion:reduce){.ui-toast-close{transition-duration:.01ms}}:root[data-motion=off] .ui-toast-close{transition-duration:.01ms}.ui-toast._default._high{background-color:var(--ui-toast-surface, var(--informative-defaulthigh-surface-default));color:var(--ui-toast-color, var(--informative-defaulthigh-content-default));border-color:var(--ui-toast-stroke, var(--informative-defaulthigh-stroke-default))}.ui-toast._default._low{background-color:var(--ui-toast-surface, var(--informative-defaultlow-surface-default));color:var(--ui-toast-color, var(--informative-defaultlow-content-default));border-color:var(--ui-toast-stroke, var(--informative-defaultlow-stroke-default))}.ui-toast._highlight._high{background-color:var(--ui-toast-surface, var(--informative-highlighthigh-surface-default));color:var(--ui-toast-color, var(--informative-highlighthigh-content-default));border-color:var(--ui-toast-stroke, var(--informative-highlighthigh-stroke-default))}.ui-toast._highlight._low{background-color:var(--ui-toast-surface, var(--informative-highlightlow-surface-default));color:var(--ui-toast-color, var(--informative-highlightlow-content-default));border-color:var(--ui-toast-stroke, var(--informative-highlightlow-stroke-default))}.ui-toast._success._high{background-color:var(--ui-toast-surface, var(--informative-successhigh-surface-default));color:var(--ui-toast-color, var(--informative-successhigh-content-default));border-color:var(--ui-toast-stroke, var(--informative-successhigh-stroke-default))}.ui-toast._success._low{background-color:var(--ui-toast-surface, var(--informative-successlow-surface-default));color:var(--ui-toast-color, var(--informative-successlow-content-default));border-color:var(--ui-toast-stroke, var(--informative-successlow-stroke-default))}.ui-toast._warning._high{background-color:var(--ui-toast-surface, var(--informative-warninghigh-surface-default));color:var(--ui-toast-color, var(--informative-warninghigh-content-default));border-color:var(--ui-toast-stroke, var(--informative-warninghigh-stroke-default))}.ui-toast._warning._low{background-color:var(--ui-toast-surface, var(--informative-warninglow-surface-default));color:var(--ui-toast-color, var(--informative-warninglow-content-default));border-color:var(--ui-toast-stroke, var(--informative-warninglow-stroke-default))}.ui-toast._error._high{background-color:var(--ui-toast-surface, var(--informative-errorhigh-surface-default));color:var(--ui-toast-color, var(--informative-errorhigh-content-default));border-color:var(--ui-toast-stroke, var(--informative-errorhigh-stroke-default))}.ui-toast._error._low{background-color:var(--ui-toast-surface, var(--informative-errorlow-surface-default));color:var(--ui-toast-color, var(--informative-errorlow-content-default));border-color:var(--ui-toast-stroke, var(--informative-errorlow-stroke-default))}\n"]
193
+ }]
194
+ }],
195
+ propDecorators: {
196
+ title: [{
197
+ type: i0.Input,
198
+ args: [{
199
+ isSignal: true,
200
+ alias: "title",
201
+ required: false
202
+ }]
203
+ }],
204
+ text: [{
205
+ type: i0.Input,
206
+ args: [{
207
+ isSignal: true,
208
+ alias: "text",
209
+ required: false
210
+ }]
211
+ }],
212
+ level: [{
213
+ type: i0.Input,
214
+ args: [{
215
+ isSignal: true,
216
+ alias: "level",
217
+ required: false
218
+ }]
219
+ }],
220
+ subLevel: [{
221
+ type: i0.Input,
222
+ args: [{
223
+ isSignal: true,
224
+ alias: "subLevel",
225
+ required: false
226
+ }]
227
+ }],
228
+ icon: [{
229
+ type: i0.Input,
230
+ args: [{
231
+ isSignal: true,
232
+ alias: "icon",
233
+ required: false
234
+ }]
235
+ }],
236
+ closable: [{
237
+ type: i0.Input,
238
+ args: [{
239
+ isSignal: true,
240
+ alias: "closable",
241
+ required: false
242
+ }]
243
+ }],
244
+ closeIcon: [{
245
+ type: i0.Input,
246
+ args: [{
247
+ isSignal: true,
248
+ alias: "closeIcon",
249
+ required: false
250
+ }]
251
+ }],
252
+ closeAriaLabel: [{
253
+ type: i0.Input,
254
+ args: [{
255
+ isSignal: true,
256
+ alias: "closeAriaLabel",
257
+ required: false
258
+ }]
259
+ }],
260
+ expanded: [{
261
+ type: i0.Input,
262
+ args: [{
263
+ isSignal: true,
264
+ alias: "expanded",
265
+ required: false
266
+ }]
267
+ }],
268
+ styleClass: [{
269
+ type: i0.Input,
270
+ args: [{
271
+ isSignal: true,
272
+ alias: "styleClass",
273
+ required: false
274
+ }]
275
+ }],
276
+ closed: [{
277
+ type: i0.Output,
278
+ args: ["closed"]
279
+ }]
280
+ }
281
+ });
123
282
  let nextId = 0;
124
- /**
125
- * ui-toast service — programmatic entry point to push and clear toasts.
126
- *
127
- * Signal-based store:
128
- * `add`/`addAll` append messages, `clear`/`remove` drop them. One or more
129
- * {@link UiToastContainer} instances read this store reactively and render the
130
- * slice that matches their `key`. Provided in root, so a single injection is
131
- * shared across the app.
132
- *
133
- * @example
134
- * ```ts
135
- * private readonly toast = inject(UiToastService);
136
- * this.toast.add({ level: 'success', title: 'Enregistré', text: 'Profil mis à jour.' });
137
- * ```
138
- */
139
- class UiToastService {
140
- constructor() {
141
- /** @ignore Backing store of live messages. */
142
- this._messages = signal([], /* @ts-ignore */
143
- ...(ngDevMode ? [{ debugName: "_messages" }] : /* istanbul ignore next */ []));
144
- /** Live messages, in insertion order (read-only). */
145
- this.messages = this._messages.asReadonly();
146
- /** Total number of live messages across every key. */
147
- this.count = computed(() => this._messages().length, /* @ts-ignore */
148
- ...(ngDevMode ? [{ debugName: "count" }] : /* istanbul ignore next */ []));
149
- }
150
- /**
151
- * Push a single message. Returns its (possibly generated) id so the caller
152
- * can dismiss it later (e.g. resolving a "loading" toast into a result).
153
- */
154
- add(message) {
155
- const id = message.id ?? `ui-toast-${nextId++}`;
156
- this._messages.update((list) => [...list, { ...message, id }]);
157
- return id;
158
- }
159
- /** Push several messages at once. Returns their ids, in order. */
160
- addAll(messages) {
161
- return messages.map((message) => this.add(message));
162
- }
163
- /**
164
- * Remove messages. With no argument, clears everything; with a `key`, clears
165
- * only the messages routed to that key.
166
- */
167
- clear(key) {
168
- if (key == null) {
169
- this._messages.set([]);
170
- return;
171
- }
172
- this._messages.update((list) => list.filter((m) => m.key !== key));
173
- }
174
- /** Remove a single message by id (no-op if it is already gone). */
175
- remove(id) {
176
- this._messages.update((list) => list.filter((m) => m.id !== id));
177
- }
178
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: UiToastService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
179
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: UiToastService, providedIn: 'root' }); }
180
- }
181
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: UiToastService, decorators: [{
182
- type: Injectable,
183
- args: [{ providedIn: 'root' }]
184
- }] });
185
-
186
- /** Enter/leave motion preset that best fits each anchor edge. */
283
+ var UiToastService = class UiToastService {
284
+ constructor() {
285
+ this._messages = signal([], ...ngDevMode ? [{ debugName: "_messages" }] : /* istanbul ignore next */ []);
286
+ this.messages = this._messages.asReadonly();
287
+ this.count = computed(() => this._messages().length, ...ngDevMode ? [{ debugName: "count" }] : /* istanbul ignore next */ []);
288
+ }
289
+ add(message) {
290
+ const id = message.id ?? `ui-toast-${nextId++}`;
291
+ this._messages.update((list) => [...list, {
292
+ ...message,
293
+ id
294
+ }]);
295
+ return id;
296
+ }
297
+ addAll(messages) {
298
+ return messages.map((message) => this.add(message));
299
+ }
300
+ clear(key) {
301
+ if (key == null) {
302
+ this._messages.set([]);
303
+ return;
304
+ }
305
+ this._messages.update((list) => list.filter((m) => m.key !== key));
306
+ }
307
+ remove(id) {
308
+ this._messages.update((list) => list.filter((m) => m.id !== id));
309
+ }
310
+ static {
311
+ this.ɵfac = i0.ɵɵngDeclareFactory({
312
+ minVersion: "12.0.0",
313
+ version: "22.3.0",
314
+ ngImport: i0,
315
+ type: UiToastService,
316
+ deps: [],
317
+ target: i0.ɵɵFactoryTarget.Injectable
318
+ });
319
+ }
320
+ static {
321
+ this.ɵprov = i0.ɵɵngDeclareInjectable({
322
+ minVersion: "12.0.0",
323
+ version: "22.3.0",
324
+ ngImport: i0,
325
+ type: UiToastService,
326
+ providedIn: "root"
327
+ });
328
+ }
329
+ };
330
+ i0.ɵɵngDeclareClassMetadata({
331
+ minVersion: "12.0.0",
332
+ version: "22.3.0",
333
+ ngImport: i0,
334
+ type: UiToastService,
335
+ decorators: [{
336
+ type: Injectable,
337
+ args: [{ providedIn: "root" }]
338
+ }]
339
+ });
187
340
  const MOTION_BY_POSITION = {
188
- 'top-left': 'slide-down',
189
- 'top-center': 'slide-down',
190
- 'top-right': 'slide-down',
191
- 'bottom-left': 'slide-up',
192
- 'bottom-center': 'slide-up',
193
- 'bottom-right': 'slide-up',
194
- center: 'zoom',
341
+ "top-left": "slide-down",
342
+ "top-center": "slide-down",
343
+ "top-right": "slide-down",
344
+ "bottom-left": "slide-up",
345
+ "bottom-center": "slide-up",
346
+ "bottom-right": "slide-up",
347
+ center: "zoom"
195
348
  };
196
- /** Base stacking level — mirrors `$toast-z-index` in the SCSS. */
197
349
  const TOAST_BASE_Z_INDEX = 1100;
198
- /** Process-wide sequence so `autoZIndex` layers later stacks above earlier ones. */
199
350
  let zIndexSeq = 0;
200
- /**
201
- * ui-toast-container — the viewport-pinned stack that renders {@link UiToastService}
202
- * messages as {@link UiToast} cards.
203
- *
204
- * Drop one near the app root (e.g. in `app.html`). It reads the service store
205
- * reactively, shows the slice matching its `key`, animates insert/remove through
206
- * the shared motion system (`animate.enter` / `animate.leave`), and auto-dismisses
207
- * non-sticky toasts after `life` ms — pausing the countdown while hovered.
208
- *
209
- * Positioning is `fixed` by default (relative to the viewport); set `contained`
210
- * to switch to `absolute` so the stack stays inside the nearest positioned
211
- * ancestor (used by the Storybook demos).
212
- *
213
- * @example
214
- * ```html
215
- * <ui-toast-container position="top-right" [life]="4000" />
216
- * ```
217
- */
218
- class UiToastContainer {
219
- constructor() {
220
- /** Only render messages whose `key` matches (omit to render key-less messages). */
221
- this.key = input(/* @ts-ignore */
222
- ...(ngDevMode ? [undefined, { debugName: "key" }] : /* istanbul ignore next */ []));
223
- /** Where the stack is pinned in the viewport. */
224
- this.position = input('top-right', /* @ts-ignore */
225
- ...(ngDevMode ? [{ debugName: "position" }] : /* istanbul ignore next */ []));
226
- /** Default auto-dismiss delay (ms) for non-sticky toasts. Per-message `life` wins. */
227
- this.life = input(4000, { ...(ngDevMode ? { debugName: "life" } : /* istanbul ignore next */ {}), transform: numberAttribute });
228
- /** Render toasts as full-width banners (fill the region width). */
229
- this.expanded = input(false, { ...(ngDevMode ? { debugName: "expanded" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
230
- /** Motion preset override. Defaults to a per-position choice. */
231
- this.motion = input(/* @ts-ignore */
232
- ...(ngDevMode ? [undefined, { debugName: "motion" }] : /* istanbul ignore next */ []));
233
- /** Disable enter/leave animation for this stack. */
234
- this.motionDisabled = input(false, { ...(ngDevMode ? { debugName: "motionDisabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
235
- /** Use `position: absolute` (scoped to a positioned ancestor) instead of `fixed`. */
236
- this.contained = input(false, { ...(ngDevMode ? { debugName: "contained" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
237
- /**
238
- * Custom content template rendered inside each card in place of `title`/`text`.
239
- * Context: `{ $implicit: message, closeFn }`.
240
- */
241
- this.template = input(/* @ts-ignore */
242
- ...(ngDevMode ? [undefined, { debugName: "template" }] : /* istanbul ignore next */ []));
243
- /** Extra class(es) merged onto the region root. */
244
- this.styleClass = input(/* @ts-ignore */
245
- ...(ngDevMode ? [undefined, { debugName: "styleClass" }] : /* istanbul ignore next */ []));
246
- /** Show only the N most recent toasts; older ones wait their turn (`0` = no limit). */
247
- this.stackVisibleLimit = input(0, { ...(ngDevMode ? { debugName: "stackVisibleLimit" } : /* istanbul ignore next */ {}), transform: numberAttribute });
248
- /** Gap between stacked cards in px (overrides the `--units-sm` token default). */
249
- this.stackGap = input(/* @ts-ignore */
250
- ...(ngDevMode ? [undefined, { debugName: "stackGap" }] : /* istanbul ignore next */ []));
251
- /** Skip a new toast whose content (level + title + text) matches a live one. */
252
- this.preventDuplicates = input(false, { ...(ngDevMode ? { debugName: "preventDuplicates" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
253
- /** Automatically layer this stack above earlier ones (later container wins). */
254
- this.autoZIndex = input(true, { ...(ngDevMode ? { debugName: "autoZIndex" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
255
- /** Floor z-index for the stack (added to the auto value, or used as-is when `autoZIndex=false`). */
256
- this.baseZIndex = input(0, { ...(ngDevMode ? { debugName: "baseZIndex" } : /* istanbul ignore next */ {}), transform: numberAttribute });
257
- /** @ignore */
258
- this.service = inject(UiToastService);
259
- /** @ignore Per-instance layering rank for `autoZIndex`. */
260
- this.zSeq = ++zIndexSeq;
261
- /** @ignore */
262
- this.isBrowser = isPlatformBrowser(inject(PLATFORM_ID));
263
- /** @ignore All live messages routed to this container (drives timers/dedup). */
264
- this.keyed = computed(() => this.service.messages().filter((m) => m.key === this.key()), /* @ts-ignore */
265
- ...(ngDevMode ? [{ debugName: "keyed" }] : /* istanbul ignore next */ []));
266
- /** @ignore Rendered slice — the most recent `stackVisibleLimit` toasts. */
267
- this.items = computed(() => {
268
- const all = this.keyed();
269
- const limit = this.stackVisibleLimit();
270
- return limit > 0 ? all.slice(-limit) : all;
271
- }, /* @ts-ignore */
272
- ...(ngDevMode ? [{ debugName: "items" }] : /* istanbul ignore next */ []));
273
- /** @ignore Effective stacking level. */
274
- this.zIndex = computed(() => {
275
- const base = this.baseZIndex();
276
- if (this.autoZIndex())
277
- return TOAST_BASE_Z_INDEX + base + this.zSeq;
278
- return base > 0 ? base : TOAST_BASE_Z_INDEX;
279
- }, /* @ts-ignore */
280
- ...(ngDevMode ? [{ debugName: "zIndex" }] : /* istanbul ignore next */ []));
281
- /** @ignore Resolved enter/leave preset. */
282
- this.motionPreset = computed(() => this.motion() ?? MOTION_BY_POSITION[this.position()], /* @ts-ignore */
283
- ...(ngDevMode ? [{ debugName: "motionPreset" }] : /* istanbul ignore next */ []));
284
- /** @ignore */
285
- this.regionClass = computed(() => {
286
- const c = ['ui-toast-region', `_${this.position()}`];
287
- if (this.contained())
288
- c.push('_contained');
289
- if (this.expanded())
290
- c.push('_expanded');
291
- // Anchor at the bottom edge → newest toast nearest the edge (column-reverse in SCSS).
292
- if (this.position().startsWith('bottom'))
293
- c.push('_reverse');
294
- const sc = this.styleClass();
295
- if (sc)
296
- c.push(sc);
297
- return c.join(' ');
298
- }, /* @ts-ignore */
299
- ...(ngDevMode ? [{ debugName: "regionClass" }] : /* istanbul ignore next */ []));
300
- // --- Life timers (auto-dismiss, hover-pausable) ----------------------
301
- /** @ignore Active timeout handles, keyed by message id. */
302
- this.timers = new Map();
303
- /** @ignore Remaining ms per message (survives hover pause). */
304
- this.remaining = new Map();
305
- /** @ignore Wall-clock start of the running countdown, per message. */
306
- this.startedAt = new Map();
307
- // Reconcile dedup + life timers whenever this container's message set changes.
308
- effect(() => {
309
- const keyed = this.keyed();
310
- // preventDuplicates: drop later toasts whose content matches an earlier one.
311
- if (this.preventDuplicates()) {
312
- const seen = new Set();
313
- const dupes = [];
314
- for (const m of keyed) {
315
- const sig = `${m.level ?? 'default'}|${m.title ?? ''}|${m.text ?? ''}`;
316
- if (seen.has(sig))
317
- dupes.push(m.id);
318
- else
319
- seen.add(sig);
320
- }
321
- if (dupes.length) {
322
- // Store mutation re-runs this effect on the deduplicated set.
323
- dupes.forEach((id) => this.service.remove(id));
324
- return;
325
- }
326
- }
327
- const shown = this.items();
328
- const shownIds = new Set(shown.map((m) => m.id));
329
- // Drop timer bookkeeping for messages that are gone or no longer shown.
330
- for (const id of [...this.timers.keys()]) {
331
- if (!shownIds.has(id))
332
- this.forget(id);
333
- }
334
- for (const id of [...this.remaining.keys()]) {
335
- if (!shownIds.has(id))
336
- this.remaining.delete(id);
337
- }
338
- if (!this.isBrowser)
339
- return;
340
- // Arm a countdown for each newly shown, non-sticky message.
341
- for (const message of shown) {
342
- const id = message.id;
343
- if (message.sticky)
344
- continue;
345
- if (this.timers.has(id) || this.remaining.has(id))
346
- continue;
347
- const life = message.life ?? this.life();
348
- if (life > 0)
349
- this.arm(id, life);
350
- }
351
- });
352
- inject(DestroyRef).onDestroy(() => {
353
- for (const id of [...this.timers.keys()])
354
- this.forget(id);
355
- });
356
- }
357
- /** @ignore Start (or restart) a countdown of `ms` for a message. */
358
- arm(id, ms) {
359
- this.remaining.set(id, ms);
360
- this.startedAt.set(id, Date.now());
361
- this.timers.set(id, setTimeout(() => {
362
- this.timers.delete(id);
363
- this.service.remove(id);
364
- }, ms));
365
- }
366
- /** @ignore Cancel and drop all timer bookkeeping for a message. */
367
- forget(id) {
368
- const handle = this.timers.get(id);
369
- if (handle)
370
- clearTimeout(handle);
371
- this.timers.delete(id);
372
- this.startedAt.delete(id);
373
- }
374
- /** @ignore Pause the countdown on hover/focus (banks the remaining time). */
375
- pause(id) {
376
- if (id == null)
377
- return;
378
- const handle = this.timers.get(id);
379
- if (!handle)
380
- return;
381
- clearTimeout(handle);
382
- this.timers.delete(id);
383
- const banked = this.remaining.get(id) ?? 0;
384
- const elapsed = Date.now() - (this.startedAt.get(id) ?? Date.now());
385
- this.remaining.set(id, Math.max(banked - elapsed, 0));
386
- }
387
- /** @ignore Resume a paused countdown when the pointer/focus leaves. */
388
- resume(id) {
389
- if (id == null || !this.isBrowser)
390
- return;
391
- if (this.timers.has(id))
392
- return;
393
- const left = this.remaining.get(id);
394
- if (left == null || left <= 0)
395
- return;
396
- this.arm(id, left);
397
- }
398
- /** @ignore Dismiss a toast (close button or a custom template's `closeFn`). */
399
- dismiss(message) {
400
- if (message.id != null)
401
- this.service.remove(message.id);
402
- }
403
- /** @ignore Template-context factory: a bound close handler for one message. */
404
- closeFn(message) {
405
- return () => this.dismiss(message);
406
- }
407
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: UiToastContainer, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
408
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.7", type: UiToastContainer, isStandalone: true, selector: "ui-toast-container", inputs: { key: { classPropertyName: "key", publicName: "key", isSignal: true, isRequired: false, transformFunction: null }, position: { classPropertyName: "position", publicName: "position", isSignal: true, isRequired: false, transformFunction: null }, life: { classPropertyName: "life", publicName: "life", isSignal: true, isRequired: false, transformFunction: null }, expanded: { classPropertyName: "expanded", publicName: "expanded", isSignal: true, isRequired: false, transformFunction: null }, motion: { classPropertyName: "motion", publicName: "motion", isSignal: true, isRequired: false, transformFunction: null }, motionDisabled: { classPropertyName: "motionDisabled", publicName: "motionDisabled", isSignal: true, isRequired: false, transformFunction: null }, contained: { classPropertyName: "contained", publicName: "contained", isSignal: true, isRequired: false, transformFunction: null }, template: { classPropertyName: "template", publicName: "template", isSignal: true, isRequired: false, transformFunction: null }, styleClass: { classPropertyName: "styleClass", publicName: "styleClass", isSignal: true, isRequired: false, transformFunction: null }, stackVisibleLimit: { classPropertyName: "stackVisibleLimit", publicName: "stackVisibleLimit", isSignal: true, isRequired: false, transformFunction: null }, stackGap: { classPropertyName: "stackGap", publicName: "stackGap", isSignal: true, isRequired: false, transformFunction: null }, preventDuplicates: { classPropertyName: "preventDuplicates", publicName: "preventDuplicates", isSignal: true, isRequired: false, transformFunction: null }, autoZIndex: { classPropertyName: "autoZIndex", publicName: "autoZIndex", isSignal: true, isRequired: false, transformFunction: null }, baseZIndex: { classPropertyName: "baseZIndex", publicName: "baseZIndex", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<div [class]=\"regionClass()\" [style.z-index]=\"zIndex()\" [style.gap.px]=\"stackGap() ?? null\">\n @for (item of items(); track item.id) {\n <div\n class=\"ui-toast-region-item\"\n [uiMotion]=\"motionPreset()\"\n [motionDisabled]=\"motionDisabled()\"\n #m=\"uiMotion\"\n [animate.enter]=\"m.enter()\"\n [animate.leave]=\"m.leave()\"\n >\n <ui-toast\n (mouseenter)=\"pause(item.id)\"\n (mouseleave)=\"resume(item.id)\"\n (focusin)=\"pause(item.id)\"\n (focusout)=\"resume(item.id)\"\n [level]=\"item.level ?? 'default'\"\n [subLevel]=\"item.subLevel ?? 'high'\"\n [title]=\"template() ? undefined : item.title\"\n [text]=\"template() ? undefined : item.text\"\n [icon]=\"item.icon ?? true\"\n [closable]=\"item.closable ?? true\"\n [expanded]=\"expanded()\"\n [styleClass]=\"item.styleClass\"\n (closed)=\"dismiss(item)\"\n >\n @if (template(); as tpl) {\n <ng-container\n *ngTemplateOutlet=\"tpl; context: { $implicit: item, closeFn: closeFn(item) }\"\n />\n }\n </ui-toast>\n </div>\n }\n</div>\n", styles: [".ui-toast-region{position:fixed;z-index:var(--ui-toast-z-index, 1100);display:flex;flex-direction:column;gap:var(--ui-toast-stack-gap, var(--units-sm));width:min(var(--ui-toast-width, 22.5rem),100vw - var(--ui-toast-edge-gap, var(--units-lg)) * 2);pointer-events:none}.ui-toast-region._contained{position:absolute}.ui-toast-region._expanded{width:min(var(--ui-toast-width-expanded, 30rem),100vw - var(--ui-toast-edge-gap, var(--units-lg)) * 2)}.ui-toast-region._expanded .ui-toast-region-item>ui-toast{flex:1 1 auto}.ui-toast-region._reverse{flex-direction:column-reverse}.ui-toast-region-item{display:flex;pointer-events:none}.ui-toast-region-item>ui-toast{pointer-events:auto}.ui-toast-region._top-left .ui-toast-region-item,.ui-toast-region._bottom-left .ui-toast-region-item{justify-content:flex-start}.ui-toast-region._top-right .ui-toast-region-item,.ui-toast-region._bottom-right .ui-toast-region-item{justify-content:flex-end}.ui-toast-region._top-center .ui-toast-region-item,.ui-toast-region._bottom-center .ui-toast-region-item,.ui-toast-region._center .ui-toast-region-item{justify-content:center}.ui-toast-region._top-left{top:var(--ui-toast-edge-gap, var(--units-lg));left:var(--ui-toast-edge-gap, var(--units-lg))}.ui-toast-region._top-right{top:var(--ui-toast-edge-gap, var(--units-lg));right:var(--ui-toast-edge-gap, var(--units-lg))}.ui-toast-region._top-center{top:var(--ui-toast-edge-gap, var(--units-lg));left:50%;transform:translate(-50%)}.ui-toast-region._bottom-left{bottom:var(--ui-toast-edge-gap, var(--units-lg));left:var(--ui-toast-edge-gap, var(--units-lg))}.ui-toast-region._bottom-right{bottom:var(--ui-toast-edge-gap, var(--units-lg));right:var(--ui-toast-edge-gap, var(--units-lg))}.ui-toast-region._bottom-center{bottom:var(--ui-toast-edge-gap, var(--units-lg));left:50%;transform:translate(-50%)}.ui-toast-region._center{top:50%;left:50%;transform:translate(-50%,-50%)}\n"], dependencies: [{ kind: "component", type: UiToast, selector: "ui-toast", inputs: ["title", "text", "level", "subLevel", "icon", "closable", "closeIcon", "closeAriaLabel", "expanded", "styleClass"], outputs: ["closed"] }, { kind: "directive", type: UiMotion, selector: "[uiMotion]", inputs: ["uiMotion", "motionDuration", "motionDelay", "motionEasing", "motionEnterEasing", "motionLeaveEasing", "motionDistance", "motionScale", "motionDisabled", "motionOnInsert"], exportAs: ["uiMotion"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] }); }
409
- }
410
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: UiToastContainer, decorators: [{
411
- type: Component,
412
- args: [{ selector: 'ui-toast-container', imports: [UiToast, UiMotion, NgTemplateOutlet], template: "<div [class]=\"regionClass()\" [style.z-index]=\"zIndex()\" [style.gap.px]=\"stackGap() ?? null\">\n @for (item of items(); track item.id) {\n <div\n class=\"ui-toast-region-item\"\n [uiMotion]=\"motionPreset()\"\n [motionDisabled]=\"motionDisabled()\"\n #m=\"uiMotion\"\n [animate.enter]=\"m.enter()\"\n [animate.leave]=\"m.leave()\"\n >\n <ui-toast\n (mouseenter)=\"pause(item.id)\"\n (mouseleave)=\"resume(item.id)\"\n (focusin)=\"pause(item.id)\"\n (focusout)=\"resume(item.id)\"\n [level]=\"item.level ?? 'default'\"\n [subLevel]=\"item.subLevel ?? 'high'\"\n [title]=\"template() ? undefined : item.title\"\n [text]=\"template() ? undefined : item.text\"\n [icon]=\"item.icon ?? true\"\n [closable]=\"item.closable ?? true\"\n [expanded]=\"expanded()\"\n [styleClass]=\"item.styleClass\"\n (closed)=\"dismiss(item)\"\n >\n @if (template(); as tpl) {\n <ng-container\n *ngTemplateOutlet=\"tpl; context: { $implicit: item, closeFn: closeFn(item) }\"\n />\n }\n </ui-toast>\n </div>\n }\n</div>\n", styles: [".ui-toast-region{position:fixed;z-index:var(--ui-toast-z-index, 1100);display:flex;flex-direction:column;gap:var(--ui-toast-stack-gap, var(--units-sm));width:min(var(--ui-toast-width, 22.5rem),100vw - var(--ui-toast-edge-gap, var(--units-lg)) * 2);pointer-events:none}.ui-toast-region._contained{position:absolute}.ui-toast-region._expanded{width:min(var(--ui-toast-width-expanded, 30rem),100vw - var(--ui-toast-edge-gap, var(--units-lg)) * 2)}.ui-toast-region._expanded .ui-toast-region-item>ui-toast{flex:1 1 auto}.ui-toast-region._reverse{flex-direction:column-reverse}.ui-toast-region-item{display:flex;pointer-events:none}.ui-toast-region-item>ui-toast{pointer-events:auto}.ui-toast-region._top-left .ui-toast-region-item,.ui-toast-region._bottom-left .ui-toast-region-item{justify-content:flex-start}.ui-toast-region._top-right .ui-toast-region-item,.ui-toast-region._bottom-right .ui-toast-region-item{justify-content:flex-end}.ui-toast-region._top-center .ui-toast-region-item,.ui-toast-region._bottom-center .ui-toast-region-item,.ui-toast-region._center .ui-toast-region-item{justify-content:center}.ui-toast-region._top-left{top:var(--ui-toast-edge-gap, var(--units-lg));left:var(--ui-toast-edge-gap, var(--units-lg))}.ui-toast-region._top-right{top:var(--ui-toast-edge-gap, var(--units-lg));right:var(--ui-toast-edge-gap, var(--units-lg))}.ui-toast-region._top-center{top:var(--ui-toast-edge-gap, var(--units-lg));left:50%;transform:translate(-50%)}.ui-toast-region._bottom-left{bottom:var(--ui-toast-edge-gap, var(--units-lg));left:var(--ui-toast-edge-gap, var(--units-lg))}.ui-toast-region._bottom-right{bottom:var(--ui-toast-edge-gap, var(--units-lg));right:var(--ui-toast-edge-gap, var(--units-lg))}.ui-toast-region._bottom-center{bottom:var(--ui-toast-edge-gap, var(--units-lg));left:50%;transform:translate(-50%)}.ui-toast-region._center{top:50%;left:50%;transform:translate(-50%,-50%)}\n"] }]
413
- }], ctorParameters: () => [], propDecorators: { key: [{ type: i0.Input, args: [{ isSignal: true, alias: "key", required: false }] }], position: [{ type: i0.Input, args: [{ isSignal: true, alias: "position", required: false }] }], life: [{ type: i0.Input, args: [{ isSignal: true, alias: "life", required: false }] }], expanded: [{ type: i0.Input, args: [{ isSignal: true, alias: "expanded", required: false }] }], motion: [{ type: i0.Input, args: [{ isSignal: true, alias: "motion", required: false }] }], motionDisabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "motionDisabled", required: false }] }], contained: [{ type: i0.Input, args: [{ isSignal: true, alias: "contained", required: false }] }], template: [{ type: i0.Input, args: [{ isSignal: true, alias: "template", required: false }] }], styleClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "styleClass", required: false }] }], stackVisibleLimit: [{ type: i0.Input, args: [{ isSignal: true, alias: "stackVisibleLimit", required: false }] }], stackGap: [{ type: i0.Input, args: [{ isSignal: true, alias: "stackGap", required: false }] }], preventDuplicates: [{ type: i0.Input, args: [{ isSignal: true, alias: "preventDuplicates", required: false }] }], autoZIndex: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoZIndex", required: false }] }], baseZIndex: [{ type: i0.Input, args: [{ isSignal: true, alias: "baseZIndex", required: false }] }] } });
414
-
415
- /*
416
- * Public API Surface of ui-kit/ui-toast
417
- */
418
-
419
- /**
420
- * Generated bundle index. Do not edit.
421
- */
422
-
351
+ var UiToastContainer = class UiToastContainer {
352
+ constructor() {
353
+ this.key = input(...ngDevMode ? [void 0, { debugName: "key" }] : /* istanbul ignore next */ []);
354
+ this.position = input("top-right", ...ngDevMode ? [{ debugName: "position" }] : /* istanbul ignore next */ []);
355
+ this.life = input(4e3, {
356
+ ...ngDevMode ? { debugName: "life" } : /* istanbul ignore next */ {},
357
+ transform: numberAttribute
358
+ });
359
+ this.expanded = input(false, {
360
+ ...ngDevMode ? { debugName: "expanded" } : /* istanbul ignore next */ {},
361
+ transform: booleanAttribute
362
+ });
363
+ this.motion = input(...ngDevMode ? [void 0, { debugName: "motion" }] : /* istanbul ignore next */ []);
364
+ this.motionDisabled = input(false, {
365
+ ...ngDevMode ? { debugName: "motionDisabled" } : /* istanbul ignore next */ {},
366
+ transform: booleanAttribute
367
+ });
368
+ this.contained = input(false, {
369
+ ...ngDevMode ? { debugName: "contained" } : /* istanbul ignore next */ {},
370
+ transform: booleanAttribute
371
+ });
372
+ this.template = input(...ngDevMode ? [void 0, { debugName: "template" }] : /* istanbul ignore next */ []);
373
+ this.styleClass = input(...ngDevMode ? [void 0, { debugName: "styleClass" }] : /* istanbul ignore next */ []);
374
+ this.stackVisibleLimit = input(0, {
375
+ ...ngDevMode ? { debugName: "stackVisibleLimit" } : /* istanbul ignore next */ {},
376
+ transform: numberAttribute
377
+ });
378
+ this.stackGap = input(...ngDevMode ? [void 0, { debugName: "stackGap" }] : /* istanbul ignore next */ []);
379
+ this.preventDuplicates = input(false, {
380
+ ...ngDevMode ? { debugName: "preventDuplicates" } : /* istanbul ignore next */ {},
381
+ transform: booleanAttribute
382
+ });
383
+ this.autoZIndex = input(true, {
384
+ ...ngDevMode ? { debugName: "autoZIndex" } : /* istanbul ignore next */ {},
385
+ transform: booleanAttribute
386
+ });
387
+ this.baseZIndex = input(0, {
388
+ ...ngDevMode ? { debugName: "baseZIndex" } : /* istanbul ignore next */ {},
389
+ transform: numberAttribute
390
+ });
391
+ this.service = inject(UiToastService);
392
+ this.zSeq = ++zIndexSeq;
393
+ this.isBrowser = isPlatformBrowser(inject(PLATFORM_ID));
394
+ this.keyed = computed(() => this.service.messages().filter((m) => m.key === this.key()), ...ngDevMode ? [{ debugName: "keyed" }] : /* istanbul ignore next */ []);
395
+ this.items = computed(() => {
396
+ const all = this.keyed();
397
+ const limit = this.stackVisibleLimit();
398
+ return limit > 0 ? all.slice(-limit) : all;
399
+ }, ...ngDevMode ? [{ debugName: "items" }] : /* istanbul ignore next */ []);
400
+ this.zIndex = computed(() => {
401
+ const base = this.baseZIndex();
402
+ if (this.autoZIndex()) return TOAST_BASE_Z_INDEX + base + this.zSeq;
403
+ return base > 0 ? base : TOAST_BASE_Z_INDEX;
404
+ }, ...ngDevMode ? [{ debugName: "zIndex" }] : /* istanbul ignore next */ []);
405
+ this.motionPreset = computed(() => this.motion() ?? MOTION_BY_POSITION[this.position()], ...ngDevMode ? [{ debugName: "motionPreset" }] : /* istanbul ignore next */ []);
406
+ this.regionClass = computed(() => {
407
+ const c = ["ui-toast-region", `_${this.position()}`];
408
+ if (this.contained()) c.push("_contained");
409
+ if (this.expanded()) c.push("_expanded");
410
+ if (this.position().startsWith("bottom")) c.push("_reverse");
411
+ const sc = this.styleClass();
412
+ if (sc) c.push(sc);
413
+ return c.join(" ");
414
+ }, ...ngDevMode ? [{ debugName: "regionClass" }] : /* istanbul ignore next */ []);
415
+ this.timers = /* @__PURE__ */ new Map();
416
+ this.remaining = /* @__PURE__ */ new Map();
417
+ this.startedAt = /* @__PURE__ */ new Map();
418
+ effect(() => {
419
+ const keyed = this.keyed();
420
+ if (this.preventDuplicates()) {
421
+ const seen = /* @__PURE__ */ new Set();
422
+ const dupes = [];
423
+ for (const m of keyed) {
424
+ const sig = `${m.level ?? "default"}|${m.title ?? ""}|${m.text ?? ""}`;
425
+ if (seen.has(sig)) dupes.push(m.id);
426
+ else seen.add(sig);
427
+ }
428
+ if (dupes.length) {
429
+ dupes.forEach((id) => this.service.remove(id));
430
+ return;
431
+ }
432
+ }
433
+ const shown = this.items();
434
+ const shownIds = new Set(shown.map((m) => m.id));
435
+ for (const id of [...this.timers.keys()]) if (!shownIds.has(id)) this.forget(id);
436
+ for (const id of [...this.remaining.keys()]) if (!shownIds.has(id)) this.remaining.delete(id);
437
+ if (!this.isBrowser) return;
438
+ for (const message of shown) {
439
+ const id = message.id;
440
+ if (message.sticky) continue;
441
+ if (this.timers.has(id) || this.remaining.has(id)) continue;
442
+ const life = message.life ?? this.life();
443
+ if (life > 0) this.arm(id, life);
444
+ }
445
+ });
446
+ inject(DestroyRef).onDestroy(() => {
447
+ for (const id of [...this.timers.keys()]) this.forget(id);
448
+ });
449
+ }
450
+ arm(id, ms) {
451
+ this.remaining.set(id, ms);
452
+ this.startedAt.set(id, Date.now());
453
+ this.timers.set(id, setTimeout(() => {
454
+ this.timers.delete(id);
455
+ this.service.remove(id);
456
+ }, ms));
457
+ }
458
+ forget(id) {
459
+ const handle = this.timers.get(id);
460
+ if (handle) clearTimeout(handle);
461
+ this.timers.delete(id);
462
+ this.startedAt.delete(id);
463
+ }
464
+ pause(id) {
465
+ if (id == null) return;
466
+ const handle = this.timers.get(id);
467
+ if (!handle) return;
468
+ clearTimeout(handle);
469
+ this.timers.delete(id);
470
+ const banked = this.remaining.get(id) ?? 0;
471
+ const elapsed = Date.now() - (this.startedAt.get(id) ?? Date.now());
472
+ this.remaining.set(id, Math.max(banked - elapsed, 0));
473
+ }
474
+ resume(id) {
475
+ if (id == null || !this.isBrowser) return;
476
+ if (this.timers.has(id)) return;
477
+ const left = this.remaining.get(id);
478
+ if (left == null || left <= 0) return;
479
+ this.arm(id, left);
480
+ }
481
+ dismiss(message) {
482
+ if (message.id != null) this.service.remove(message.id);
483
+ }
484
+ closeFn(message) {
485
+ return () => this.dismiss(message);
486
+ }
487
+ static {
488
+ this.ɵfac = i0.ɵɵngDeclareFactory({
489
+ minVersion: "12.0.0",
490
+ version: "22.3.0",
491
+ ngImport: i0,
492
+ type: UiToastContainer,
493
+ deps: [],
494
+ target: i0.ɵɵFactoryTarget.Component
495
+ });
496
+ }
497
+ static {
498
+ this.ɵcmp = i0.ɵɵngDeclareComponent({
499
+ minVersion: "17.0.0",
500
+ version: "22.3.0",
501
+ type: UiToastContainer,
502
+ isStandalone: true,
503
+ selector: "ui-toast-container",
504
+ inputs: {
505
+ key: {
506
+ classPropertyName: "key",
507
+ publicName: "key",
508
+ isSignal: true,
509
+ isRequired: false,
510
+ transformFunction: null
511
+ },
512
+ position: {
513
+ classPropertyName: "position",
514
+ publicName: "position",
515
+ isSignal: true,
516
+ isRequired: false,
517
+ transformFunction: null
518
+ },
519
+ life: {
520
+ classPropertyName: "life",
521
+ publicName: "life",
522
+ isSignal: true,
523
+ isRequired: false,
524
+ transformFunction: null
525
+ },
526
+ expanded: {
527
+ classPropertyName: "expanded",
528
+ publicName: "expanded",
529
+ isSignal: true,
530
+ isRequired: false,
531
+ transformFunction: null
532
+ },
533
+ motion: {
534
+ classPropertyName: "motion",
535
+ publicName: "motion",
536
+ isSignal: true,
537
+ isRequired: false,
538
+ transformFunction: null
539
+ },
540
+ motionDisabled: {
541
+ classPropertyName: "motionDisabled",
542
+ publicName: "motionDisabled",
543
+ isSignal: true,
544
+ isRequired: false,
545
+ transformFunction: null
546
+ },
547
+ contained: {
548
+ classPropertyName: "contained",
549
+ publicName: "contained",
550
+ isSignal: true,
551
+ isRequired: false,
552
+ transformFunction: null
553
+ },
554
+ template: {
555
+ classPropertyName: "template",
556
+ publicName: "template",
557
+ isSignal: true,
558
+ isRequired: false,
559
+ transformFunction: null
560
+ },
561
+ styleClass: {
562
+ classPropertyName: "styleClass",
563
+ publicName: "styleClass",
564
+ isSignal: true,
565
+ isRequired: false,
566
+ transformFunction: null
567
+ },
568
+ stackVisibleLimit: {
569
+ classPropertyName: "stackVisibleLimit",
570
+ publicName: "stackVisibleLimit",
571
+ isSignal: true,
572
+ isRequired: false,
573
+ transformFunction: null
574
+ },
575
+ stackGap: {
576
+ classPropertyName: "stackGap",
577
+ publicName: "stackGap",
578
+ isSignal: true,
579
+ isRequired: false,
580
+ transformFunction: null
581
+ },
582
+ preventDuplicates: {
583
+ classPropertyName: "preventDuplicates",
584
+ publicName: "preventDuplicates",
585
+ isSignal: true,
586
+ isRequired: false,
587
+ transformFunction: null
588
+ },
589
+ autoZIndex: {
590
+ classPropertyName: "autoZIndex",
591
+ publicName: "autoZIndex",
592
+ isSignal: true,
593
+ isRequired: false,
594
+ transformFunction: null
595
+ },
596
+ baseZIndex: {
597
+ classPropertyName: "baseZIndex",
598
+ publicName: "baseZIndex",
599
+ isSignal: true,
600
+ isRequired: false,
601
+ transformFunction: null
602
+ }
603
+ },
604
+ ngImport: i0,
605
+ template: "<div [class]=\"regionClass()\" [style.z-index]=\"zIndex()\" [style.gap.px]=\"stackGap() ?? null\">\n @for (item of items(); track item.id) {\n <div\n class=\"ui-toast-region-item\"\n [uiMotion]=\"motionPreset()\"\n [motionDisabled]=\"motionDisabled()\"\n #m=\"uiMotion\"\n [animate.enter]=\"m.enter()\"\n [animate.leave]=\"m.leave()\"\n >\n <ui-toast\n (mouseenter)=\"pause(item.id)\"\n (mouseleave)=\"resume(item.id)\"\n (focusin)=\"pause(item.id)\"\n (focusout)=\"resume(item.id)\"\n [level]=\"item.level ?? 'default'\"\n [subLevel]=\"item.subLevel ?? 'high'\"\n [title]=\"template() ? undefined : item.title\"\n [text]=\"template() ? undefined : item.text\"\n [icon]=\"item.icon ?? true\"\n [closable]=\"item.closable ?? true\"\n [expanded]=\"expanded()\"\n [styleClass]=\"item.styleClass\"\n (closed)=\"dismiss(item)\"\n >\n @if (template(); as tpl) {\n <ng-container\n *ngTemplateOutlet=\"tpl; context: { $implicit: item, closeFn: closeFn(item) }\"\n />\n }\n </ui-toast>\n </div>\n }\n</div>\n",
606
+ styles: [".ui-toast-region{position:fixed;z-index:var(--ui-toast-z-index, 1100);display:flex;flex-direction:column;gap:var(--ui-toast-stack-gap, var(--units-sm));width:min(var(--ui-toast-width, 22.5rem),100vw - var(--ui-toast-edge-gap, var(--units-lg)) * 2);pointer-events:none}.ui-toast-region._contained{position:absolute}.ui-toast-region._expanded{width:min(var(--ui-toast-width-expanded, 30rem),100vw - var(--ui-toast-edge-gap, var(--units-lg)) * 2)}.ui-toast-region._expanded .ui-toast-region-item>ui-toast{flex:1 1 auto}.ui-toast-region._reverse{flex-direction:column-reverse}.ui-toast-region-item{display:flex;pointer-events:none}.ui-toast-region-item>ui-toast{pointer-events:auto}.ui-toast-region._top-left .ui-toast-region-item,.ui-toast-region._bottom-left .ui-toast-region-item{justify-content:flex-start}.ui-toast-region._top-right .ui-toast-region-item,.ui-toast-region._bottom-right .ui-toast-region-item{justify-content:flex-end}.ui-toast-region._top-center .ui-toast-region-item,.ui-toast-region._bottom-center .ui-toast-region-item,.ui-toast-region._center .ui-toast-region-item{justify-content:center}.ui-toast-region._top-left{top:var(--ui-toast-edge-gap, var(--units-lg));left:var(--ui-toast-edge-gap, var(--units-lg))}.ui-toast-region._top-right{top:var(--ui-toast-edge-gap, var(--units-lg));right:var(--ui-toast-edge-gap, var(--units-lg))}.ui-toast-region._top-center{top:var(--ui-toast-edge-gap, var(--units-lg));left:50%;transform:translate(-50%)}.ui-toast-region._bottom-left{bottom:var(--ui-toast-edge-gap, var(--units-lg));left:var(--ui-toast-edge-gap, var(--units-lg))}.ui-toast-region._bottom-right{bottom:var(--ui-toast-edge-gap, var(--units-lg));right:var(--ui-toast-edge-gap, var(--units-lg))}.ui-toast-region._bottom-center{bottom:var(--ui-toast-edge-gap, var(--units-lg));left:50%;transform:translate(-50%)}.ui-toast-region._center{top:50%;left:50%;transform:translate(-50%,-50%)}\n"],
607
+ dependencies: [
608
+ {
609
+ kind: "component",
610
+ type: UiToast,
611
+ selector: "ui-toast",
612
+ inputs: [
613
+ "title",
614
+ "text",
615
+ "level",
616
+ "subLevel",
617
+ "icon",
618
+ "closable",
619
+ "closeIcon",
620
+ "closeAriaLabel",
621
+ "expanded",
622
+ "styleClass"
623
+ ],
624
+ outputs: ["closed"]
625
+ },
626
+ {
627
+ kind: "directive",
628
+ type: UiMotion,
629
+ selector: "[uiMotion]",
630
+ inputs: [
631
+ "uiMotion",
632
+ "motionDuration",
633
+ "motionDelay",
634
+ "motionEasing",
635
+ "motionEnterEasing",
636
+ "motionLeaveEasing",
637
+ "motionDistance",
638
+ "motionScale",
639
+ "motionDisabled",
640
+ "motionOnInsert"
641
+ ],
642
+ exportAs: ["uiMotion"]
643
+ },
644
+ {
645
+ kind: "directive",
646
+ type: NgTemplateOutlet,
647
+ selector: "[ngTemplateOutlet]",
648
+ inputs: [
649
+ "ngTemplateOutletContext",
650
+ "ngTemplateOutlet",
651
+ "ngTemplateOutletInjector"
652
+ ]
653
+ }
654
+ ]
655
+ });
656
+ }
657
+ };
658
+ i0.ɵɵngDeclareClassMetadata({
659
+ minVersion: "12.0.0",
660
+ version: "22.3.0",
661
+ ngImport: i0,
662
+ type: UiToastContainer,
663
+ decorators: [{
664
+ type: Component,
665
+ args: [{
666
+ selector: "ui-toast-container",
667
+ imports: [
668
+ UiToast,
669
+ UiMotion,
670
+ NgTemplateOutlet
671
+ ],
672
+ template: "<div [class]=\"regionClass()\" [style.z-index]=\"zIndex()\" [style.gap.px]=\"stackGap() ?? null\">\n @for (item of items(); track item.id) {\n <div\n class=\"ui-toast-region-item\"\n [uiMotion]=\"motionPreset()\"\n [motionDisabled]=\"motionDisabled()\"\n #m=\"uiMotion\"\n [animate.enter]=\"m.enter()\"\n [animate.leave]=\"m.leave()\"\n >\n <ui-toast\n (mouseenter)=\"pause(item.id)\"\n (mouseleave)=\"resume(item.id)\"\n (focusin)=\"pause(item.id)\"\n (focusout)=\"resume(item.id)\"\n [level]=\"item.level ?? 'default'\"\n [subLevel]=\"item.subLevel ?? 'high'\"\n [title]=\"template() ? undefined : item.title\"\n [text]=\"template() ? undefined : item.text\"\n [icon]=\"item.icon ?? true\"\n [closable]=\"item.closable ?? true\"\n [expanded]=\"expanded()\"\n [styleClass]=\"item.styleClass\"\n (closed)=\"dismiss(item)\"\n >\n @if (template(); as tpl) {\n <ng-container\n *ngTemplateOutlet=\"tpl; context: { $implicit: item, closeFn: closeFn(item) }\"\n />\n }\n </ui-toast>\n </div>\n }\n</div>\n",
673
+ styles: [".ui-toast-region{position:fixed;z-index:var(--ui-toast-z-index, 1100);display:flex;flex-direction:column;gap:var(--ui-toast-stack-gap, var(--units-sm));width:min(var(--ui-toast-width, 22.5rem),100vw - var(--ui-toast-edge-gap, var(--units-lg)) * 2);pointer-events:none}.ui-toast-region._contained{position:absolute}.ui-toast-region._expanded{width:min(var(--ui-toast-width-expanded, 30rem),100vw - var(--ui-toast-edge-gap, var(--units-lg)) * 2)}.ui-toast-region._expanded .ui-toast-region-item>ui-toast{flex:1 1 auto}.ui-toast-region._reverse{flex-direction:column-reverse}.ui-toast-region-item{display:flex;pointer-events:none}.ui-toast-region-item>ui-toast{pointer-events:auto}.ui-toast-region._top-left .ui-toast-region-item,.ui-toast-region._bottom-left .ui-toast-region-item{justify-content:flex-start}.ui-toast-region._top-right .ui-toast-region-item,.ui-toast-region._bottom-right .ui-toast-region-item{justify-content:flex-end}.ui-toast-region._top-center .ui-toast-region-item,.ui-toast-region._bottom-center .ui-toast-region-item,.ui-toast-region._center .ui-toast-region-item{justify-content:center}.ui-toast-region._top-left{top:var(--ui-toast-edge-gap, var(--units-lg));left:var(--ui-toast-edge-gap, var(--units-lg))}.ui-toast-region._top-right{top:var(--ui-toast-edge-gap, var(--units-lg));right:var(--ui-toast-edge-gap, var(--units-lg))}.ui-toast-region._top-center{top:var(--ui-toast-edge-gap, var(--units-lg));left:50%;transform:translate(-50%)}.ui-toast-region._bottom-left{bottom:var(--ui-toast-edge-gap, var(--units-lg));left:var(--ui-toast-edge-gap, var(--units-lg))}.ui-toast-region._bottom-right{bottom:var(--ui-toast-edge-gap, var(--units-lg));right:var(--ui-toast-edge-gap, var(--units-lg))}.ui-toast-region._bottom-center{bottom:var(--ui-toast-edge-gap, var(--units-lg));left:50%;transform:translate(-50%)}.ui-toast-region._center{top:50%;left:50%;transform:translate(-50%,-50%)}\n"]
674
+ }]
675
+ }],
676
+ ctorParameters: () => [],
677
+ propDecorators: {
678
+ key: [{
679
+ type: i0.Input,
680
+ args: [{
681
+ isSignal: true,
682
+ alias: "key",
683
+ required: false
684
+ }]
685
+ }],
686
+ position: [{
687
+ type: i0.Input,
688
+ args: [{
689
+ isSignal: true,
690
+ alias: "position",
691
+ required: false
692
+ }]
693
+ }],
694
+ life: [{
695
+ type: i0.Input,
696
+ args: [{
697
+ isSignal: true,
698
+ alias: "life",
699
+ required: false
700
+ }]
701
+ }],
702
+ expanded: [{
703
+ type: i0.Input,
704
+ args: [{
705
+ isSignal: true,
706
+ alias: "expanded",
707
+ required: false
708
+ }]
709
+ }],
710
+ motion: [{
711
+ type: i0.Input,
712
+ args: [{
713
+ isSignal: true,
714
+ alias: "motion",
715
+ required: false
716
+ }]
717
+ }],
718
+ motionDisabled: [{
719
+ type: i0.Input,
720
+ args: [{
721
+ isSignal: true,
722
+ alias: "motionDisabled",
723
+ required: false
724
+ }]
725
+ }],
726
+ contained: [{
727
+ type: i0.Input,
728
+ args: [{
729
+ isSignal: true,
730
+ alias: "contained",
731
+ required: false
732
+ }]
733
+ }],
734
+ template: [{
735
+ type: i0.Input,
736
+ args: [{
737
+ isSignal: true,
738
+ alias: "template",
739
+ required: false
740
+ }]
741
+ }],
742
+ styleClass: [{
743
+ type: i0.Input,
744
+ args: [{
745
+ isSignal: true,
746
+ alias: "styleClass",
747
+ required: false
748
+ }]
749
+ }],
750
+ stackVisibleLimit: [{
751
+ type: i0.Input,
752
+ args: [{
753
+ isSignal: true,
754
+ alias: "stackVisibleLimit",
755
+ required: false
756
+ }]
757
+ }],
758
+ stackGap: [{
759
+ type: i0.Input,
760
+ args: [{
761
+ isSignal: true,
762
+ alias: "stackGap",
763
+ required: false
764
+ }]
765
+ }],
766
+ preventDuplicates: [{
767
+ type: i0.Input,
768
+ args: [{
769
+ isSignal: true,
770
+ alias: "preventDuplicates",
771
+ required: false
772
+ }]
773
+ }],
774
+ autoZIndex: [{
775
+ type: i0.Input,
776
+ args: [{
777
+ isSignal: true,
778
+ alias: "autoZIndex",
779
+ required: false
780
+ }]
781
+ }],
782
+ baseZIndex: [{
783
+ type: i0.Input,
784
+ args: [{
785
+ isSignal: true,
786
+ alias: "baseZIndex",
787
+ required: false
788
+ }]
789
+ }]
790
+ }
791
+ });
423
792
  export { UI_TOAST_DEFAULT_ICONS, UI_TOAST_POSITIONS, UiToast, UiToastContainer, UiToastService };
424
- //# sourceMappingURL=4sh-ui-kit-informative-ui-toast.mjs.map
793
+
794
+ //# sourceMappingURL=4sh-ui-kit-informative-ui-toast.mjs.map