@4sh/ui-kit 0.16.0 → 0.17.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (219) hide show
  1. package/README.fr.md +10 -10
  2. package/README.md +10 -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 -1000
  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 -2048
  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 -138
  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 -257
  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 -312
  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 -199
  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 -137
  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 +721 -638
  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 +299 -2
  143. package/mcp/data/text-search-docs.json +149 -9
  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/types/4sh-ui-kit-actions-ui-button-split.d.ts +198 -87
  150. package/types/4sh-ui-kit-actions-ui-button.d.ts +240 -116
  151. package/types/4sh-ui-kit-actions-ui-link.d.ts +136 -67
  152. package/types/4sh-ui-kit-actions-ui-speed-dial.d.ts +287 -180
  153. package/types/4sh-ui-kit-base-ui-icon.d.ts +92 -58
  154. package/types/4sh-ui-kit-base-ui-image.d.ts +406 -205
  155. package/types/4sh-ui-kit-forms-ui-autocomplete.d.ts +573 -376
  156. package/types/4sh-ui-kit-forms-ui-checkbox.d.ts +77 -42
  157. package/types/4sh-ui-kit-forms-ui-datepicker.d.ts +953 -700
  158. package/types/4sh-ui-kit-forms-ui-editor.d.ts +374 -340
  159. package/types/4sh-ui-kit-forms-ui-field-sign.d.ts +325 -0
  160. package/types/4sh-ui-kit-forms-ui-field.d.ts +150 -64
  161. package/types/4sh-ui-kit-forms-ui-file-upload.d.ts +583 -241
  162. package/types/4sh-ui-kit-forms-ui-input-date.d.ts +152 -103
  163. package/types/4sh-ui-kit-forms-ui-input-group.d.ts +109 -63
  164. package/types/4sh-ui-kit-forms-ui-input-mask.d.ts +93 -59
  165. package/types/4sh-ui-kit-forms-ui-input-number.d.ts +171 -96
  166. package/types/4sh-ui-kit-forms-ui-input-otp.d.ts +137 -104
  167. package/types/4sh-ui-kit-forms-ui-input-tags.d.ts +469 -309
  168. package/types/4sh-ui-kit-forms-ui-input.d.ts +198 -118
  169. package/types/4sh-ui-kit-forms-ui-knob.d.ts +132 -80
  170. package/types/4sh-ui-kit-forms-ui-label.d.ts +47 -22
  171. package/types/4sh-ui-kit-forms-ui-nudger.d.ts +134 -67
  172. package/types/4sh-ui-kit-forms-ui-radio.d.ts +48 -33
  173. package/types/4sh-ui-kit-forms-ui-rating.d.ts +120 -86
  174. package/types/4sh-ui-kit-forms-ui-segment-control.d.ts +221 -147
  175. package/types/4sh-ui-kit-forms-ui-select.d.ts +561 -357
  176. package/types/4sh-ui-kit-forms-ui-slider.d.ts +156 -105
  177. package/types/4sh-ui-kit-forms-ui-swatch-picker.d.ts +133 -97
  178. package/types/4sh-ui-kit-forms-ui-textarea.d.ts +90 -56
  179. package/types/4sh-ui-kit-forms-ui-toggle-block.d.ts +158 -94
  180. package/types/4sh-ui-kit-forms-ui-toggle-button.d.ts +314 -178
  181. package/types/4sh-ui-kit-forms-ui-toggle.d.ts +88 -54
  182. package/types/4sh-ui-kit-forms.d.ts +275 -194
  183. package/types/4sh-ui-kit-informative-ui-accordion.d.ts +162 -92
  184. package/types/4sh-ui-kit-informative-ui-alert.d.ts +128 -62
  185. package/types/4sh-ui-kit-informative-ui-avatar-group.d.ts +8 -8
  186. package/types/4sh-ui-kit-informative-ui-avatar.d.ts +81 -44
  187. package/types/4sh-ui-kit-informative-ui-badge.d.ts +71 -41
  188. package/types/4sh-ui-kit-informative-ui-chip.d.ts +194 -99
  189. package/types/4sh-ui-kit-informative-ui-empty-state.d.ts +105 -65
  190. package/types/4sh-ui-kit-informative-ui-helper.d.ts +64 -34
  191. package/types/4sh-ui-kit-informative-ui-progress-bar.d.ts +120 -65
  192. package/types/4sh-ui-kit-informative-ui-read-only.d.ts +147 -67
  193. package/types/4sh-ui-kit-informative-ui-separator.d.ts +65 -35
  194. package/types/4sh-ui-kit-informative-ui-skeleton.d.ts +62 -32
  195. package/types/4sh-ui-kit-informative-ui-spinner.d.ts +111 -50
  196. package/types/4sh-ui-kit-informative-ui-tag.d.ts +77 -37
  197. package/types/4sh-ui-kit-informative-ui-toast.d.ts +300 -180
  198. package/types/4sh-ui-kit-informative-ui-tooltip.d.ts +269 -141
  199. package/types/4sh-ui-kit-layout-ui-bottom-sheet.d.ts +360 -221
  200. package/types/4sh-ui-kit-layout-ui-card.d.ts +119 -79
  201. package/types/4sh-ui-kit-layout-ui-drawer.d.ts +244 -120
  202. package/types/4sh-ui-kit-layout-ui-modal.d.ts +409 -222
  203. package/types/4sh-ui-kit-layout-ui-popover.d.ts +149 -91
  204. package/types/4sh-ui-kit-motion.d.ts +117 -67
  205. package/types/4sh-ui-kit-navigation-ui-bottom-tab-bar.d.ts +279 -145
  206. package/types/4sh-ui-kit-navigation-ui-breadcrumb.d.ts +134 -96
  207. package/types/4sh-ui-kit-navigation-ui-context-menu.d.ts +148 -89
  208. package/types/4sh-ui-kit-navigation-ui-menu.d.ts +282 -201
  209. package/types/4sh-ui-kit-navigation-ui-sidebar.d.ts +425 -261
  210. package/types/4sh-ui-kit-navigation-ui-stepper.d.ts +279 -183
  211. package/types/4sh-ui-kit-navigation-ui-tabs.d.ts +275 -173
  212. package/types/4sh-ui-kit-overlay.d.ts +6 -6
  213. package/types/4sh-ui-kit-ripple.d.ts +99 -74
  214. package/types/4sh-ui-kit-table-ui-paginator.d.ts +237 -133
  215. package/types/4sh-ui-kit-table-ui-table.d.ts +769 -470
  216. package/types/4sh-ui-kit-theming.d.ts +27 -29
  217. package/types/4sh-ui-kit-types.d.ts +6 -5
  218. package/types/4sh-ui-kit.d.ts +4 -3
  219. package/fesm2022/4sh-ui-kit-types.mjs.map +0 -1
@@ -1,132 +1,296 @@
1
- import * as i0 from '@angular/core';
2
- import { input, signal, computed, effect, Component } from '@angular/core';
3
- import { NgTemplateOutlet } from '@angular/common';
4
- import { UiIcon } from '@4sh/ui-kit/base/ui-icon';
5
-
6
- /**
7
- * ui-spinner — indeterminate loading indicator (headless).
8
- *
9
- * Renders a smooth, token-colored circular spinner by default. The animated
10
- * mark is fully swappable, in priority order:
11
- * 1. `spinnerTemplate` — any custom content (TemplateRef)
12
- * 2. `image` — an image URL (e.g. an animated GIF/SVG loader)
13
- * 3. `icon` — a FontAwesome icon name (rotated by the component)
14
- * 4. default — a built-in SVG circle (tunable stroke/fill/duration)
15
- *
16
- * Accessible: the root is a `role="status"` live region with an accessible
17
- * name; the mark is decorative (`aria-hidden`). Motion honours the OS
18
- * reduced-motion preference and the kit-wide `data-motion="off"` switch.
19
- */
20
- class UiSpinner {
21
- constructor() {
22
- /** Size preset (also override the raw box via the `--ui-spinner-size` CSS var). */
23
- this.size = input('default', /* @ts-ignore */
24
- ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
25
- /** Layout of the mark relative to the label (only relevant when `label` is set). */
26
- this.orientation = input('vertical', /* @ts-ignore */
27
- ...(ngDevMode ? [{ debugName: "orientation" }] : /* istanbul ignore next */ []));
28
- /** Optional visible loading text, rendered inside the live region. */
29
- this.label = input(/* @ts-ignore */
30
- ...(ngDevMode ? [undefined, { debugName: "label" }] : /* istanbul ignore next */ []));
31
- /** Accessible name. Falls back to the visible `label`, then to "Chargement". */
32
- this.ariaLabel = input(/* @ts-ignore */
33
- ...(ngDevMode ? [undefined, { debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
34
- // --- Swappable mark (priority: template > image > icon > default SVG) ---
35
- /** Custom mark content; takes precedence over every other mark source. */
36
- this.spinnerTemplate = input(/* @ts-ignore */
37
- ...(ngDevMode ? [undefined, { debugName: "spinnerTemplate" }] : /* istanbul ignore next */ []));
38
- /** Image URL used as the mark (shown as-is — carries its own motion). */
39
- this.image = input(/* @ts-ignore */
40
- ...(ngDevMode ? [undefined, { debugName: "image" }] : /* istanbul ignore next */ []));
41
- /** Alt text for the image mark (empty = decorative, the default). */
42
- this.imageAlt = input('', /* @ts-ignore */
43
- ...(ngDevMode ? [{ debugName: "imageAlt" }] : /* istanbul ignore next */ []));
44
- /** FontAwesome icon name used as the mark (rotated by the component). */
45
- this.icon = input(/* @ts-ignore */
46
- ...(ngDevMode ? [undefined, { debugName: "icon" }] : /* istanbul ignore next */ []));
47
- // --- Default SVG circle tuning (ignored by the other marks) ----------
48
- /** Stroke width of the default circle, in the 0–50 viewBox scale. */
49
- this.strokeWidth = input(4, /* @ts-ignore */
50
- ...(ngDevMode ? [{ debugName: "strokeWidth" }] : /* istanbul ignore next */ []));
51
- /** Fill of the default circle (`none` = ring only). */
52
- this.fill = input('none', /* @ts-ignore */
53
- ...(ngDevMode ? [{ debugName: "fill" }] : /* istanbul ignore next */ []));
54
- /** Duration of one rotation (any CSS time), shared with the icon mark. */
55
- this.animationDuration = input('1.2s', /* @ts-ignore */
56
- ...(ngDevMode ? [{ debugName: "animationDuration" }] : /* istanbul ignore next */ []));
57
- /**
58
- * Grace delay before the spinner appears, in ms. Prevents a flash of the
59
- * loader for waits shorter than the delay (a common loading UX best practice).
60
- */
61
- this.delay = input(0, /* @ts-ignore */
62
- ...(ngDevMode ? [{ debugName: "delay" }] : /* istanbul ignore next */ []));
63
- /** @ignore Visible once the grace delay (if any) has elapsed. */
64
- this.visible = signal(true, /* @ts-ignore */
65
- ...(ngDevMode ? [{ debugName: "visible" }] : /* istanbul ignore next */ []));
66
- /** @ignore Which mark to render. */
67
- this.markKind = computed(() => {
68
- if (this.spinnerTemplate())
69
- return 'template';
70
- if (this.image())
71
- return 'image';
72
- if (this.icon())
73
- return 'icon';
74
- return 'svg';
75
- }, /* @ts-ignore */
76
- ...(ngDevMode ? [{ debugName: "markKind" }] : /* istanbul ignore next */ []));
77
- /** @ignore Icon size matching the spinner box (default → xl, small → default). */
78
- this.iconSize = computed(() => this.size() === 'small' ? 'default' : 'xl', /* @ts-ignore */
79
- ...(ngDevMode ? [{ debugName: "iconSize" }] : /* istanbul ignore next */ []));
80
- /** @ignore Accessible name: explicit, else the visible label reads on its own, else a default. */
81
- this.rootAriaLabel = computed(() => {
82
- if (this.ariaLabel())
83
- return this.ariaLabel();
84
- if (this.label())
85
- return null; // visible text is announced by the live region
86
- return 'Chargement';
87
- }, /* @ts-ignore */
88
- ...(ngDevMode ? [{ debugName: "rootAriaLabel" }] : /* istanbul ignore next */ []));
89
- /** @ignore */
90
- this.classes = computed(() => {
91
- const c = ['ui-spinner'];
92
- if (this.size() !== 'default')
93
- c.push(`_${this.size()}`);
94
- if (this.orientation() === 'horizontal')
95
- c.push('_horizontal');
96
- return c.join(' ');
97
- }, /* @ts-ignore */
98
- ...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
99
- // Grace delay: hide until the timer fires. setTimeout (not rAF) so it still
100
- // resolves in a throttled/background tab. Cleaned up on re-run / destroy.
101
- effect((onCleanup) => {
102
- const ms = this.delay();
103
- if (ms > 0) {
104
- this.visible.set(false);
105
- const id = setTimeout(() => this.visible.set(true), ms);
106
- onCleanup(() => clearTimeout(id));
107
- }
108
- else {
109
- this.visible.set(true);
110
- }
111
- });
112
- }
113
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: UiSpinner, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
114
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.7", type: UiSpinner, isStandalone: true, selector: "ui-spinner", inputs: { size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, orientation: { classPropertyName: "orientation", publicName: "orientation", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, spinnerTemplate: { classPropertyName: "spinnerTemplate", publicName: "spinnerTemplate", isSignal: true, isRequired: false, transformFunction: null }, image: { classPropertyName: "image", publicName: "image", isSignal: true, isRequired: false, transformFunction: null }, imageAlt: { classPropertyName: "imageAlt", publicName: "imageAlt", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, strokeWidth: { classPropertyName: "strokeWidth", publicName: "strokeWidth", isSignal: true, isRequired: false, transformFunction: null }, fill: { classPropertyName: "fill", publicName: "fill", isSignal: true, isRequired: false, transformFunction: null }, animationDuration: { classPropertyName: "animationDuration", publicName: "animationDuration", isSignal: true, isRequired: false, transformFunction: null }, delay: { classPropertyName: "delay", publicName: "delay", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "style.--ui-spinner-duration": "animationDuration()" } }, ngImport: i0, template: "@if (visible()) {\n <div\n [class]=\"classes()\"\n role=\"status\"\n aria-live=\"polite\"\n [attr.aria-busy]=\"true\"\n [attr.aria-label]=\"rootAriaLabel()\"\n >\n <span class=\"ui-spinner-mark\" aria-hidden=\"true\">\n @switch (markKind()) {\n @case ('template') {\n <ng-container [ngTemplateOutlet]=\"spinnerTemplate()!\" />\n }\n @case ('image') {\n <img class=\"ui-spinner-image\" [src]=\"image()!\" [alt]=\"imageAlt()\" />\n }\n @case ('icon') {\n <span class=\"ui-spinner-spin\">\n <ui-icon [name]=\"icon()!\" [size]=\"iconSize()\" />\n </span>\n }\n @default {\n <svg class=\"ui-spinner-svg\" viewBox=\"0 0 50 50\">\n <circle\n class=\"ui-spinner-circle\"\n cx=\"25\"\n cy=\"25\"\n r=\"20\"\n [attr.fill]=\"fill()\"\n [attr.stroke-width]=\"strokeWidth()\"\n />\n </svg>\n }\n }\n </span>\n\n @if (label(); as text) {\n <span class=\"ui-spinner-label\">{{ text }}</span>\n }\n </div>\n}\n", styles: [".ui-spinner{display:inline-flex;flex-direction:column;align-items:center;justify-content:center;gap:var(--units-sm);color:var(--ui-spinner-color, var(--informative-highlightlow-content-default))}.ui-spinner._horizontal{flex-direction:row}.ui-spinner-mark{display:inline-flex;align-items:center;justify-content:center;width:var(--ui-spinner-size, 2rem);height:var(--ui-spinner-size, 2rem);line-height:0}.ui-spinner._small .ui-spinner-mark{width:var(--ui-spinner-size-small, 1.25rem);height:var(--ui-spinner-size-small, 1.25rem)}.ui-spinner._small .ui-spinner-label{font-size:var(--ui-spinner-font-size-small, var(--size-typography-text-sm))}.ui-spinner-svg{width:100%;height:100%;transform-origin:center;animation:ui-spinner-rotate var(--ui-spinner-duration, 1.2s) linear infinite}.ui-spinner-circle{stroke:currentColor;stroke-linecap:round;transform-origin:center;animation:ui-spinner-dash calc(var(--ui-spinner-duration, 1.2s) * 1.25) ease-in-out infinite}.ui-spinner-spin{display:inline-flex;transform-origin:center;animation:ui-spinner-rotate var(--ui-spinner-duration, 1.2s) linear infinite}.ui-spinner-image{width:100%;height:100%;object-fit:contain}.ui-spinner-label{color:var(--ui-spinner-label-color, var(--global-text-default));font-family:var(--ui-spinner-font-family, var(--fontfamily-base));font-weight:var(--ui-spinner-weight, var(--weight-bold));font-size:var(--ui-spinner-font-size, var(--size-typography-text-md));line-height:1.2;white-space:nowrap}@keyframes ui-spinner-rotate{to{transform:rotate(360deg)}}@keyframes ui-spinner-dash{0%{stroke-dasharray:1,125;stroke-dashoffset:0}50%{stroke-dasharray:90,125;stroke-dashoffset:-30}to{stroke-dasharray:90,125;stroke-dashoffset:-124}}@media(prefers-reduced-motion:reduce){.ui-spinner .ui-spinner-svg,.ui-spinner .ui-spinner-spin{animation:none}.ui-spinner .ui-spinner-circle{animation:none;stroke-dasharray:none;opacity:.65}}:root[data-motion=off] .ui-spinner .ui-spinner-svg,:root[data-motion=off] .ui-spinner .ui-spinner-spin{animation:none}:root[data-motion=off] .ui-spinner .ui-spinner-circle{animation:none;stroke-dasharray:none;opacity:.65}\n"], dependencies: [{ kind: "component", type: UiIcon, selector: "ui-icon", inputs: ["name", "size", "type", "family", "decorative", "ariaLabel"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] }); }
115
- }
116
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: UiSpinner, decorators: [{
117
- type: Component,
118
- args: [{ selector: 'ui-spinner', imports: [UiIcon, NgTemplateOutlet], host: {
119
- '[style.--ui-spinner-duration]': 'animationDuration()',
120
- }, template: "@if (visible()) {\n <div\n [class]=\"classes()\"\n role=\"status\"\n aria-live=\"polite\"\n [attr.aria-busy]=\"true\"\n [attr.aria-label]=\"rootAriaLabel()\"\n >\n <span class=\"ui-spinner-mark\" aria-hidden=\"true\">\n @switch (markKind()) {\n @case ('template') {\n <ng-container [ngTemplateOutlet]=\"spinnerTemplate()!\" />\n }\n @case ('image') {\n <img class=\"ui-spinner-image\" [src]=\"image()!\" [alt]=\"imageAlt()\" />\n }\n @case ('icon') {\n <span class=\"ui-spinner-spin\">\n <ui-icon [name]=\"icon()!\" [size]=\"iconSize()\" />\n </span>\n }\n @default {\n <svg class=\"ui-spinner-svg\" viewBox=\"0 0 50 50\">\n <circle\n class=\"ui-spinner-circle\"\n cx=\"25\"\n cy=\"25\"\n r=\"20\"\n [attr.fill]=\"fill()\"\n [attr.stroke-width]=\"strokeWidth()\"\n />\n </svg>\n }\n }\n </span>\n\n @if (label(); as text) {\n <span class=\"ui-spinner-label\">{{ text }}</span>\n }\n </div>\n}\n", styles: [".ui-spinner{display:inline-flex;flex-direction:column;align-items:center;justify-content:center;gap:var(--units-sm);color:var(--ui-spinner-color, var(--informative-highlightlow-content-default))}.ui-spinner._horizontal{flex-direction:row}.ui-spinner-mark{display:inline-flex;align-items:center;justify-content:center;width:var(--ui-spinner-size, 2rem);height:var(--ui-spinner-size, 2rem);line-height:0}.ui-spinner._small .ui-spinner-mark{width:var(--ui-spinner-size-small, 1.25rem);height:var(--ui-spinner-size-small, 1.25rem)}.ui-spinner._small .ui-spinner-label{font-size:var(--ui-spinner-font-size-small, var(--size-typography-text-sm))}.ui-spinner-svg{width:100%;height:100%;transform-origin:center;animation:ui-spinner-rotate var(--ui-spinner-duration, 1.2s) linear infinite}.ui-spinner-circle{stroke:currentColor;stroke-linecap:round;transform-origin:center;animation:ui-spinner-dash calc(var(--ui-spinner-duration, 1.2s) * 1.25) ease-in-out infinite}.ui-spinner-spin{display:inline-flex;transform-origin:center;animation:ui-spinner-rotate var(--ui-spinner-duration, 1.2s) linear infinite}.ui-spinner-image{width:100%;height:100%;object-fit:contain}.ui-spinner-label{color:var(--ui-spinner-label-color, var(--global-text-default));font-family:var(--ui-spinner-font-family, var(--fontfamily-base));font-weight:var(--ui-spinner-weight, var(--weight-bold));font-size:var(--ui-spinner-font-size, var(--size-typography-text-md));line-height:1.2;white-space:nowrap}@keyframes ui-spinner-rotate{to{transform:rotate(360deg)}}@keyframes ui-spinner-dash{0%{stroke-dasharray:1,125;stroke-dashoffset:0}50%{stroke-dasharray:90,125;stroke-dashoffset:-30}to{stroke-dasharray:90,125;stroke-dashoffset:-124}}@media(prefers-reduced-motion:reduce){.ui-spinner .ui-spinner-svg,.ui-spinner .ui-spinner-spin{animation:none}.ui-spinner .ui-spinner-circle{animation:none;stroke-dasharray:none;opacity:.65}}:root[data-motion=off] .ui-spinner .ui-spinner-svg,:root[data-motion=off] .ui-spinner .ui-spinner-spin{animation:none}:root[data-motion=off] .ui-spinner .ui-spinner-circle{animation:none;stroke-dasharray:none;opacity:.65}\n"] }]
121
- }], ctorParameters: () => [], propDecorators: { size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], orientation: [{ type: i0.Input, args: [{ isSignal: true, alias: "orientation", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], spinnerTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "spinnerTemplate", required: false }] }], image: [{ type: i0.Input, args: [{ isSignal: true, alias: "image", required: false }] }], imageAlt: [{ type: i0.Input, args: [{ isSignal: true, alias: "imageAlt", required: false }] }], icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], strokeWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "strokeWidth", required: false }] }], fill: [{ type: i0.Input, args: [{ isSignal: true, alias: "fill", required: false }] }], animationDuration: [{ type: i0.Input, args: [{ isSignal: true, alias: "animationDuration", required: false }] }], delay: [{ type: i0.Input, args: [{ isSignal: true, alias: "delay", required: false }] }] } });
122
-
123
- /*
124
- * Public API Surface of ui-kit/ui-spinner
125
- */
126
-
127
- /**
128
- * Generated bundle index. Do not edit.
129
- */
130
-
1
+ import * as i0 from "@angular/core";
2
+ import { Component, computed, effect, input, signal } from "@angular/core";
3
+ import { NgTemplateOutlet } from "@angular/common";
4
+ import { UiIcon } from "@4sh/ui-kit/base/ui-icon";
5
+ var UiSpinner = class UiSpinner {
6
+ constructor() {
7
+ this.size = input("default", ...ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []);
8
+ this.orientation = input("vertical", ...ngDevMode ? [{ debugName: "orientation" }] : /* istanbul ignore next */ []);
9
+ this.label = input(...ngDevMode ? [void 0, { debugName: "label" }] : /* istanbul ignore next */ []);
10
+ this.ariaLabel = input(...ngDevMode ? [void 0, { debugName: "ariaLabel" }] : /* istanbul ignore next */ []);
11
+ this.spinnerTemplate = input(...ngDevMode ? [void 0, { debugName: "spinnerTemplate" }] : /* istanbul ignore next */ []);
12
+ this.image = input(...ngDevMode ? [void 0, { debugName: "image" }] : /* istanbul ignore next */ []);
13
+ this.imageAlt = input("", ...ngDevMode ? [{ debugName: "imageAlt" }] : /* istanbul ignore next */ []);
14
+ this.icon = input(...ngDevMode ? [void 0, { debugName: "icon" }] : /* istanbul ignore next */ []);
15
+ this.strokeWidth = input(4, ...ngDevMode ? [{ debugName: "strokeWidth" }] : /* istanbul ignore next */ []);
16
+ this.fill = input("none", ...ngDevMode ? [{ debugName: "fill" }] : /* istanbul ignore next */ []);
17
+ this.animationDuration = input("1.2s", ...ngDevMode ? [{ debugName: "animationDuration" }] : /* istanbul ignore next */ []);
18
+ this.delay = input(0, ...ngDevMode ? [{ debugName: "delay" }] : /* istanbul ignore next */ []);
19
+ this.visible = signal(true, ...ngDevMode ? [{ debugName: "visible" }] : /* istanbul ignore next */ []);
20
+ this.markKind = computed(() => {
21
+ if (this.spinnerTemplate()) return "template";
22
+ if (this.image()) return "image";
23
+ if (this.icon()) return "icon";
24
+ return "svg";
25
+ }, ...ngDevMode ? [{ debugName: "markKind" }] : /* istanbul ignore next */ []);
26
+ this.iconSize = computed(() => this.size() === "small" ? "default" : "xl", ...ngDevMode ? [{ debugName: "iconSize" }] : /* istanbul ignore next */ []);
27
+ this.rootAriaLabel = computed(() => {
28
+ if (this.ariaLabel()) return this.ariaLabel();
29
+ if (this.label()) return null;
30
+ return "Chargement";
31
+ }, ...ngDevMode ? [{ debugName: "rootAriaLabel" }] : /* istanbul ignore next */ []);
32
+ this.classes = computed(() => {
33
+ const c = ["ui-spinner"];
34
+ if (this.size() !== "default") c.push(`_${this.size()}`);
35
+ if (this.orientation() === "horizontal") c.push("_horizontal");
36
+ return c.join(" ");
37
+ }, ...ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []);
38
+ effect((onCleanup) => {
39
+ const ms = this.delay();
40
+ if (ms > 0) {
41
+ this.visible.set(false);
42
+ const id = setTimeout(() => this.visible.set(true), ms);
43
+ onCleanup(() => clearTimeout(id));
44
+ } else this.visible.set(true);
45
+ });
46
+ }
47
+ static {
48
+ this.ɵfac = i0.ɵɵngDeclareFactory({
49
+ minVersion: "12.0.0",
50
+ version: "22.3.0",
51
+ ngImport: i0,
52
+ type: UiSpinner,
53
+ deps: [],
54
+ target: i0.ɵɵFactoryTarget.Component
55
+ });
56
+ }
57
+ static {
58
+ this.ɵcmp = i0.ɵɵngDeclareComponent({
59
+ minVersion: "17.0.0",
60
+ version: "22.3.0",
61
+ type: UiSpinner,
62
+ isStandalone: true,
63
+ selector: "ui-spinner",
64
+ inputs: {
65
+ size: {
66
+ classPropertyName: "size",
67
+ publicName: "size",
68
+ isSignal: true,
69
+ isRequired: false,
70
+ transformFunction: null
71
+ },
72
+ orientation: {
73
+ classPropertyName: "orientation",
74
+ publicName: "orientation",
75
+ isSignal: true,
76
+ isRequired: false,
77
+ transformFunction: null
78
+ },
79
+ label: {
80
+ classPropertyName: "label",
81
+ publicName: "label",
82
+ isSignal: true,
83
+ isRequired: false,
84
+ transformFunction: null
85
+ },
86
+ ariaLabel: {
87
+ classPropertyName: "ariaLabel",
88
+ publicName: "ariaLabel",
89
+ isSignal: true,
90
+ isRequired: false,
91
+ transformFunction: null
92
+ },
93
+ spinnerTemplate: {
94
+ classPropertyName: "spinnerTemplate",
95
+ publicName: "spinnerTemplate",
96
+ isSignal: true,
97
+ isRequired: false,
98
+ transformFunction: null
99
+ },
100
+ image: {
101
+ classPropertyName: "image",
102
+ publicName: "image",
103
+ isSignal: true,
104
+ isRequired: false,
105
+ transformFunction: null
106
+ },
107
+ imageAlt: {
108
+ classPropertyName: "imageAlt",
109
+ publicName: "imageAlt",
110
+ isSignal: true,
111
+ isRequired: false,
112
+ transformFunction: null
113
+ },
114
+ icon: {
115
+ classPropertyName: "icon",
116
+ publicName: "icon",
117
+ isSignal: true,
118
+ isRequired: false,
119
+ transformFunction: null
120
+ },
121
+ strokeWidth: {
122
+ classPropertyName: "strokeWidth",
123
+ publicName: "strokeWidth",
124
+ isSignal: true,
125
+ isRequired: false,
126
+ transformFunction: null
127
+ },
128
+ fill: {
129
+ classPropertyName: "fill",
130
+ publicName: "fill",
131
+ isSignal: true,
132
+ isRequired: false,
133
+ transformFunction: null
134
+ },
135
+ animationDuration: {
136
+ classPropertyName: "animationDuration",
137
+ publicName: "animationDuration",
138
+ isSignal: true,
139
+ isRequired: false,
140
+ transformFunction: null
141
+ },
142
+ delay: {
143
+ classPropertyName: "delay",
144
+ publicName: "delay",
145
+ isSignal: true,
146
+ isRequired: false,
147
+ transformFunction: null
148
+ }
149
+ },
150
+ host: { properties: { "style.--ui-spinner-duration": "animationDuration()" } },
151
+ ngImport: i0,
152
+ template: "@if (visible()) {\n <div\n [class]=\"classes()\"\n role=\"status\"\n aria-live=\"polite\"\n [attr.aria-busy]=\"true\"\n [attr.aria-label]=\"rootAriaLabel()\"\n >\n <span class=\"ui-spinner-mark\" aria-hidden=\"true\">\n @switch (markKind()) {\n @case ('template') {\n <ng-container [ngTemplateOutlet]=\"spinnerTemplate()!\" />\n }\n @case ('image') {\n <img class=\"ui-spinner-image\" [src]=\"image()!\" [alt]=\"imageAlt()\" />\n }\n @case ('icon') {\n <span class=\"ui-spinner-spin\">\n <ui-icon [name]=\"icon()!\" [size]=\"iconSize()\" />\n </span>\n }\n @default {\n <svg class=\"ui-spinner-svg\" viewBox=\"0 0 50 50\">\n <circle\n class=\"ui-spinner-circle\"\n cx=\"25\"\n cy=\"25\"\n r=\"20\"\n [attr.fill]=\"fill()\"\n [attr.stroke-width]=\"strokeWidth()\"\n />\n </svg>\n }\n }\n </span>\n\n @if (label(); as text) {\n <span class=\"ui-spinner-label\">{{ text }}</span>\n }\n </div>\n}\n",
153
+ styles: [".ui-spinner{display:inline-flex;flex-direction:column;align-items:center;justify-content:center;gap:var(--units-sm);color:var(--ui-spinner-color, var(--informative-highlightlow-content-default))}.ui-spinner._horizontal{flex-direction:row}.ui-spinner-mark{display:inline-flex;align-items:center;justify-content:center;width:var(--ui-spinner-size, 2rem);height:var(--ui-spinner-size, 2rem);line-height:0}.ui-spinner._small .ui-spinner-mark{width:var(--ui-spinner-size-small, 1.25rem);height:var(--ui-spinner-size-small, 1.25rem)}.ui-spinner._small .ui-spinner-label{font-size:var(--ui-spinner-font-size-small, var(--size-typography-text-sm))}.ui-spinner-svg{width:100%;height:100%;transform-origin:center;animation:ui-spinner-rotate var(--ui-spinner-duration, 1.2s) linear infinite}.ui-spinner-circle{stroke:currentColor;stroke-linecap:round;transform-origin:center;animation:ui-spinner-dash calc(var(--ui-spinner-duration, 1.2s) * 1.25) ease-in-out infinite}.ui-spinner-spin{display:inline-flex;transform-origin:center;animation:ui-spinner-rotate var(--ui-spinner-duration, 1.2s) linear infinite}.ui-spinner-image{width:100%;height:100%;object-fit:contain}.ui-spinner-label{color:var(--ui-spinner-label-color, var(--global-text-default));font-family:var(--ui-spinner-font-family, var(--fontfamily-base));font-weight:var(--ui-spinner-weight, var(--weight-bold));font-size:var(--ui-spinner-font-size, var(--size-typography-text-md));line-height:1.2;white-space:nowrap}@keyframes ui-spinner-rotate{to{transform:rotate(360deg)}}@keyframes ui-spinner-dash{0%{stroke-dasharray:1,125;stroke-dashoffset:0}50%{stroke-dasharray:90,125;stroke-dashoffset:-30}to{stroke-dasharray:90,125;stroke-dashoffset:-124}}@media(prefers-reduced-motion:reduce){.ui-spinner .ui-spinner-svg,.ui-spinner .ui-spinner-spin{animation:none}.ui-spinner .ui-spinner-circle{animation:none;stroke-dasharray:none;opacity:.65}}:root[data-motion=off] .ui-spinner .ui-spinner-svg,:root[data-motion=off] .ui-spinner .ui-spinner-spin{animation:none}:root[data-motion=off] .ui-spinner .ui-spinner-circle{animation:none;stroke-dasharray:none;opacity:.65}\n"],
154
+ dependencies: [{
155
+ kind: "component",
156
+ type: UiIcon,
157
+ selector: "ui-icon",
158
+ inputs: [
159
+ "name",
160
+ "size",
161
+ "type",
162
+ "family",
163
+ "decorative",
164
+ "ariaLabel"
165
+ ]
166
+ }, {
167
+ kind: "directive",
168
+ type: NgTemplateOutlet,
169
+ selector: "[ngTemplateOutlet]",
170
+ inputs: [
171
+ "ngTemplateOutletContext",
172
+ "ngTemplateOutlet",
173
+ "ngTemplateOutletInjector"
174
+ ]
175
+ }]
176
+ });
177
+ }
178
+ };
179
+ i0.ɵɵngDeclareClassMetadata({
180
+ minVersion: "12.0.0",
181
+ version: "22.3.0",
182
+ ngImport: i0,
183
+ type: UiSpinner,
184
+ decorators: [{
185
+ type: Component,
186
+ args: [{
187
+ selector: "ui-spinner",
188
+ imports: [UiIcon, NgTemplateOutlet],
189
+ host: { "[style.--ui-spinner-duration]": "animationDuration()" },
190
+ template: "@if (visible()) {\n <div\n [class]=\"classes()\"\n role=\"status\"\n aria-live=\"polite\"\n [attr.aria-busy]=\"true\"\n [attr.aria-label]=\"rootAriaLabel()\"\n >\n <span class=\"ui-spinner-mark\" aria-hidden=\"true\">\n @switch (markKind()) {\n @case ('template') {\n <ng-container [ngTemplateOutlet]=\"spinnerTemplate()!\" />\n }\n @case ('image') {\n <img class=\"ui-spinner-image\" [src]=\"image()!\" [alt]=\"imageAlt()\" />\n }\n @case ('icon') {\n <span class=\"ui-spinner-spin\">\n <ui-icon [name]=\"icon()!\" [size]=\"iconSize()\" />\n </span>\n }\n @default {\n <svg class=\"ui-spinner-svg\" viewBox=\"0 0 50 50\">\n <circle\n class=\"ui-spinner-circle\"\n cx=\"25\"\n cy=\"25\"\n r=\"20\"\n [attr.fill]=\"fill()\"\n [attr.stroke-width]=\"strokeWidth()\"\n />\n </svg>\n }\n }\n </span>\n\n @if (label(); as text) {\n <span class=\"ui-spinner-label\">{{ text }}</span>\n }\n </div>\n}\n",
191
+ styles: [".ui-spinner{display:inline-flex;flex-direction:column;align-items:center;justify-content:center;gap:var(--units-sm);color:var(--ui-spinner-color, var(--informative-highlightlow-content-default))}.ui-spinner._horizontal{flex-direction:row}.ui-spinner-mark{display:inline-flex;align-items:center;justify-content:center;width:var(--ui-spinner-size, 2rem);height:var(--ui-spinner-size, 2rem);line-height:0}.ui-spinner._small .ui-spinner-mark{width:var(--ui-spinner-size-small, 1.25rem);height:var(--ui-spinner-size-small, 1.25rem)}.ui-spinner._small .ui-spinner-label{font-size:var(--ui-spinner-font-size-small, var(--size-typography-text-sm))}.ui-spinner-svg{width:100%;height:100%;transform-origin:center;animation:ui-spinner-rotate var(--ui-spinner-duration, 1.2s) linear infinite}.ui-spinner-circle{stroke:currentColor;stroke-linecap:round;transform-origin:center;animation:ui-spinner-dash calc(var(--ui-spinner-duration, 1.2s) * 1.25) ease-in-out infinite}.ui-spinner-spin{display:inline-flex;transform-origin:center;animation:ui-spinner-rotate var(--ui-spinner-duration, 1.2s) linear infinite}.ui-spinner-image{width:100%;height:100%;object-fit:contain}.ui-spinner-label{color:var(--ui-spinner-label-color, var(--global-text-default));font-family:var(--ui-spinner-font-family, var(--fontfamily-base));font-weight:var(--ui-spinner-weight, var(--weight-bold));font-size:var(--ui-spinner-font-size, var(--size-typography-text-md));line-height:1.2;white-space:nowrap}@keyframes ui-spinner-rotate{to{transform:rotate(360deg)}}@keyframes ui-spinner-dash{0%{stroke-dasharray:1,125;stroke-dashoffset:0}50%{stroke-dasharray:90,125;stroke-dashoffset:-30}to{stroke-dasharray:90,125;stroke-dashoffset:-124}}@media(prefers-reduced-motion:reduce){.ui-spinner .ui-spinner-svg,.ui-spinner .ui-spinner-spin{animation:none}.ui-spinner .ui-spinner-circle{animation:none;stroke-dasharray:none;opacity:.65}}:root[data-motion=off] .ui-spinner .ui-spinner-svg,:root[data-motion=off] .ui-spinner .ui-spinner-spin{animation:none}:root[data-motion=off] .ui-spinner .ui-spinner-circle{animation:none;stroke-dasharray:none;opacity:.65}\n"]
192
+ }]
193
+ }],
194
+ ctorParameters: () => [],
195
+ propDecorators: {
196
+ size: [{
197
+ type: i0.Input,
198
+ args: [{
199
+ isSignal: true,
200
+ alias: "size",
201
+ required: false
202
+ }]
203
+ }],
204
+ orientation: [{
205
+ type: i0.Input,
206
+ args: [{
207
+ isSignal: true,
208
+ alias: "orientation",
209
+ required: false
210
+ }]
211
+ }],
212
+ label: [{
213
+ type: i0.Input,
214
+ args: [{
215
+ isSignal: true,
216
+ alias: "label",
217
+ required: false
218
+ }]
219
+ }],
220
+ ariaLabel: [{
221
+ type: i0.Input,
222
+ args: [{
223
+ isSignal: true,
224
+ alias: "ariaLabel",
225
+ required: false
226
+ }]
227
+ }],
228
+ spinnerTemplate: [{
229
+ type: i0.Input,
230
+ args: [{
231
+ isSignal: true,
232
+ alias: "spinnerTemplate",
233
+ required: false
234
+ }]
235
+ }],
236
+ image: [{
237
+ type: i0.Input,
238
+ args: [{
239
+ isSignal: true,
240
+ alias: "image",
241
+ required: false
242
+ }]
243
+ }],
244
+ imageAlt: [{
245
+ type: i0.Input,
246
+ args: [{
247
+ isSignal: true,
248
+ alias: "imageAlt",
249
+ required: false
250
+ }]
251
+ }],
252
+ icon: [{
253
+ type: i0.Input,
254
+ args: [{
255
+ isSignal: true,
256
+ alias: "icon",
257
+ required: false
258
+ }]
259
+ }],
260
+ strokeWidth: [{
261
+ type: i0.Input,
262
+ args: [{
263
+ isSignal: true,
264
+ alias: "strokeWidth",
265
+ required: false
266
+ }]
267
+ }],
268
+ fill: [{
269
+ type: i0.Input,
270
+ args: [{
271
+ isSignal: true,
272
+ alias: "fill",
273
+ required: false
274
+ }]
275
+ }],
276
+ animationDuration: [{
277
+ type: i0.Input,
278
+ args: [{
279
+ isSignal: true,
280
+ alias: "animationDuration",
281
+ required: false
282
+ }]
283
+ }],
284
+ delay: [{
285
+ type: i0.Input,
286
+ args: [{
287
+ isSignal: true,
288
+ alias: "delay",
289
+ required: false
290
+ }]
291
+ }]
292
+ }
293
+ });
131
294
  export { UiSpinner };
132
- //# sourceMappingURL=4sh-ui-kit-informative-ui-spinner.mjs.map
295
+
296
+ //# sourceMappingURL=4sh-ui-kit-informative-ui-spinner.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"4sh-ui-kit-informative-ui-spinner.mjs","sources":["../../../projects/ui-kit/informative/ui-spinner/src/lib/ui-spinner.ts","../../../projects/ui-kit/informative/ui-spinner/src/lib/ui-spinner.html","../../../projects/ui-kit/informative/ui-spinner/src/public-api.ts","../../../projects/ui-kit/informative/ui-spinner/src/4sh-ui-kit-informative-ui-spinner.ts"],"sourcesContent":["import { Component, computed, effect, input, signal, TemplateRef } from '@angular/core';\nimport { NgTemplateOutlet } from '@angular/common';\nimport { UiIcon, UiIconSize } from '@4sh/ui-kit/base/ui-icon';\n\nexport type UiSpinnerSize = 'default' | 'small';\nexport type UiSpinnerOrientation = 'vertical' | 'horizontal';\n\n/** How the animated mark is rendered (derived from which input is set). */\ntype SpinnerMark = 'template' | 'image' | 'icon' | 'svg';\n\n/**\n * ui-spinner — indeterminate loading indicator (headless).\n *\n * Renders a smooth, token-colored circular spinner by default. The animated\n * mark is fully swappable, in priority order:\n * 1. `spinnerTemplate` — any custom content (TemplateRef)\n * 2. `image` — an image URL (e.g. an animated GIF/SVG loader)\n * 3. `icon` — a FontAwesome icon name (rotated by the component)\n * 4. default — a built-in SVG circle (tunable stroke/fill/duration)\n *\n * Accessible: the root is a `role=\"status\"` live region with an accessible\n * name; the mark is decorative (`aria-hidden`). Motion honours the OS\n * reduced-motion preference and the kit-wide `data-motion=\"off\"` switch.\n */\n@Component({\n selector: 'ui-spinner',\n imports: [UiIcon, NgTemplateOutlet],\n templateUrl: './ui-spinner.html',\n styleUrl: './ui-spinner.scss',\n host: {\n '[style.--ui-spinner-duration]': 'animationDuration()',\n },\n})\nexport class UiSpinner {\n /** Size preset (also override the raw box via the `--ui-spinner-size` CSS var). */\n size = input<UiSpinnerSize>('default');\n /** Layout of the mark relative to the label (only relevant when `label` is set). */\n orientation = input<UiSpinnerOrientation>('vertical');\n /** Optional visible loading text, rendered inside the live region. */\n label = input<string>();\n /** Accessible name. Falls back to the visible `label`, then to \"Chargement\". */\n ariaLabel = input<string>();\n\n // --- Swappable mark (priority: template > image > icon > default SVG) ---\n /** Custom mark content; takes precedence over every other mark source. */\n spinnerTemplate = input<TemplateRef<unknown>>();\n /** Image URL used as the mark (shown as-is — carries its own motion). */\n image = input<string>();\n /** Alt text for the image mark (empty = decorative, the default). */\n imageAlt = input<string>('');\n /** FontAwesome icon name used as the mark (rotated by the component). */\n icon = input<string>();\n\n // --- Default SVG circle tuning (ignored by the other marks) ----------\n /** Stroke width of the default circle, in the 0–50 viewBox scale. */\n strokeWidth = input<string | number>(4);\n /** Fill of the default circle (`none` = ring only). */\n fill = input<string>('none');\n /** Duration of one rotation (any CSS time), shared with the icon mark. */\n animationDuration = input<string>('1.2s');\n\n /**\n * Grace delay before the spinner appears, in ms. Prevents a flash of the\n * loader for waits shorter than the delay (a common loading UX best practice).\n */\n delay = input(0);\n\n /** @ignore Visible once the grace delay (if any) has elapsed. */\n protected readonly visible = signal(true);\n\n constructor() {\n // Grace delay: hide until the timer fires. setTimeout (not rAF) so it still\n // resolves in a throttled/background tab. Cleaned up on re-run / destroy.\n effect((onCleanup) => {\n const ms = this.delay();\n if (ms > 0) {\n this.visible.set(false);\n const id = setTimeout(() => this.visible.set(true), ms);\n onCleanup(() => clearTimeout(id));\n } else {\n this.visible.set(true);\n }\n });\n }\n\n /** @ignore Which mark to render. */\n protected readonly markKind = computed<SpinnerMark>(() => {\n if (this.spinnerTemplate()) return 'template';\n if (this.image()) return 'image';\n if (this.icon()) return 'icon';\n return 'svg';\n });\n\n /** @ignore Icon size matching the spinner box (default → xl, small → default). */\n protected readonly iconSize = computed<UiIconSize>(() =>\n this.size() === 'small' ? 'default' : 'xl',\n );\n\n /** @ignore Accessible name: explicit, else the visible label reads on its own, else a default. */\n protected readonly rootAriaLabel = computed(() => {\n if (this.ariaLabel()) return this.ariaLabel()!;\n if (this.label()) return null; // visible text is announced by the live region\n return 'Chargement';\n });\n\n /** @ignore */\n protected readonly classes = computed(() => {\n const c = ['ui-spinner'];\n if (this.size() !== 'default') c.push(`_${this.size()}`);\n if (this.orientation() === 'horizontal') c.push('_horizontal');\n return c.join(' ');\n });\n}\n","@if (visible()) {\n <div\n [class]=\"classes()\"\n role=\"status\"\n aria-live=\"polite\"\n [attr.aria-busy]=\"true\"\n [attr.aria-label]=\"rootAriaLabel()\"\n >\n <span class=\"ui-spinner-mark\" aria-hidden=\"true\">\n @switch (markKind()) {\n @case ('template') {\n <ng-container [ngTemplateOutlet]=\"spinnerTemplate()!\" />\n }\n @case ('image') {\n <img class=\"ui-spinner-image\" [src]=\"image()!\" [alt]=\"imageAlt()\" />\n }\n @case ('icon') {\n <span class=\"ui-spinner-spin\">\n <ui-icon [name]=\"icon()!\" [size]=\"iconSize()\" />\n </span>\n }\n @default {\n <svg class=\"ui-spinner-svg\" viewBox=\"0 0 50 50\">\n <circle\n class=\"ui-spinner-circle\"\n cx=\"25\"\n cy=\"25\"\n r=\"20\"\n [attr.fill]=\"fill()\"\n [attr.stroke-width]=\"strokeWidth()\"\n />\n </svg>\n }\n }\n </span>\n\n @if (label(); as text) {\n <span class=\"ui-spinner-label\">{{ text }}</span>\n }\n </div>\n}\n","/*\n * Public API Surface of ui-kit/ui-spinner\n */\n\nexport * from './lib/ui-spinner';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;AAUA;;;;;;;;;;;;;AAaG;MAUU,SAAS,CAAA;AAqCpB,IAAA,WAAA,GAAA;;QAnCA,IAAA,CAAA,IAAI,GAAG,KAAK,CAAgB,SAAS;iFAAC;;QAEtC,IAAA,CAAA,WAAW,GAAG,KAAK,CAAuB,UAAU;wFAAC;;AAErD,QAAA,IAAA,CAAA,KAAK,GAAG,KAAK;6FAAU;;AAEvB,QAAA,IAAA,CAAA,SAAS,GAAG,KAAK;iGA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["../../../projects/ui-kit/informative/ui-spinner/src/lib/ui-spinner.ts","../../../projects/ui-kit/informative/ui-spinner/src/lib/ui-spinner.html"],"sourcesContent":["import { Component, computed, effect, input, signal, TemplateRef } from '@angular/core';\nimport { NgTemplateOutlet } from '@angular/common';\nimport { UiIcon, UiIconSize } from '@4sh/ui-kit/base/ui-icon';\n\nexport type UiSpinnerSize = 'default' | 'small';\nexport type UiSpinnerOrientation = 'vertical' | 'horizontal';\n\n/** How the animated mark is rendered (derived from which input is set). */\ntype SpinnerMark = 'template' | 'image' | 'icon' | 'svg';\n\n/**\n * ui-spinner — indeterminate loading indicator (headless).\n *\n * Renders a smooth, token-colored circular spinner by default. The animated\n * mark is fully swappable, in priority order:\n * 1. `spinnerTemplate` — any custom content (TemplateRef)\n * 2. `image` — an image URL (e.g. an animated GIF/SVG loader)\n * 3. `icon` — a FontAwesome icon name (rotated by the component)\n * 4. default — a built-in SVG circle (tunable stroke/fill/duration)\n *\n * Accessible: the root is a `role=\"status\"` live region with an accessible\n * name; the mark is decorative (`aria-hidden`). Motion honours the OS\n * reduced-motion preference and the kit-wide `data-motion=\"off\"` switch.\n */\n@Component({\n selector: 'ui-spinner',\n imports: [UiIcon, NgTemplateOutlet],\n templateUrl: './ui-spinner.html',\n styleUrl: './ui-spinner.scss',\n host: {\n '[style.--ui-spinner-duration]': 'animationDuration()',\n },\n})\nexport class UiSpinner {\n /** Size preset (also override the raw box via the `--ui-spinner-size` CSS var). */\n size = input<UiSpinnerSize>('default');\n /** Layout of the mark relative to the label (only relevant when `label` is set). */\n orientation = input<UiSpinnerOrientation>('vertical');\n /** Optional visible loading text, rendered inside the live region. */\n label = input<string>();\n /** Accessible name. Falls back to the visible `label`, then to \"Chargement\". */\n ariaLabel = input<string>();\n\n // --- Swappable mark (priority: template > image > icon > default SVG) ---\n /** Custom mark content; takes precedence over every other mark source. */\n spinnerTemplate = input<TemplateRef<unknown>>();\n /** Image URL used as the mark (shown as-is — carries its own motion). */\n image = input<string>();\n /** Alt text for the image mark (empty = decorative, the default). */\n imageAlt = input<string>('');\n /** FontAwesome icon name used as the mark (rotated by the component). */\n icon = input<string>();\n\n // --- Default SVG circle tuning (ignored by the other marks) ----------\n /** Stroke width of the default circle, in the 0–50 viewBox scale. */\n strokeWidth = input<string | number>(4);\n /** Fill of the default circle (`none` = ring only). */\n fill = input<string>('none');\n /** Duration of one rotation (any CSS time), shared with the icon mark. */\n animationDuration = input<string>('1.2s');\n\n /**\n * Grace delay before the spinner appears, in ms. Prevents a flash of the\n * loader for waits shorter than the delay (a common loading UX best practice).\n */\n delay = input(0);\n\n /** @ignore Visible once the grace delay (if any) has elapsed. */\n protected readonly visible = signal(true);\n\n constructor() {\n // Grace delay: hide until the timer fires. setTimeout (not rAF) so it still\n // resolves in a throttled/background tab. Cleaned up on re-run / destroy.\n effect((onCleanup) => {\n const ms = this.delay();\n if (ms > 0) {\n this.visible.set(false);\n const id = setTimeout(() => this.visible.set(true), ms);\n onCleanup(() => clearTimeout(id));\n } else {\n this.visible.set(true);\n }\n });\n }\n\n /** @ignore Which mark to render. */\n protected readonly markKind = computed<SpinnerMark>(() => {\n if (this.spinnerTemplate()) return 'template';\n if (this.image()) return 'image';\n if (this.icon()) return 'icon';\n return 'svg';\n });\n\n /** @ignore Icon size matching the spinner box (default → xl, small → default). */\n protected readonly iconSize = computed<UiIconSize>(() =>\n this.size() === 'small' ? 'default' : 'xl',\n );\n\n /** @ignore Accessible name: explicit, else the visible label reads on its own, else a default. */\n protected readonly rootAriaLabel = computed(() => {\n if (this.ariaLabel()) return this.ariaLabel()!;\n if (this.label()) return null; // visible text is announced by the live region\n return 'Chargement';\n });\n\n /** @ignore */\n protected readonly classes = computed(() => {\n const c = ['ui-spinner'];\n if (this.size() !== 'default') c.push(`_${this.size()}`);\n if (this.orientation() === 'horizontal') c.push('_horizontal');\n return c.join(' ');\n });\n}\n","@if (visible()) {\n <div\n [class]=\"classes()\"\n role=\"status\"\n aria-live=\"polite\"\n [attr.aria-busy]=\"true\"\n [attr.aria-label]=\"rootAriaLabel()\"\n >\n <span class=\"ui-spinner-mark\" aria-hidden=\"true\">\n @switch (markKind()) {\n @case ('template') {\n <ng-container [ngTemplateOutlet]=\"spinnerTemplate()!\" />\n }\n @case ('image') {\n <img class=\"ui-spinner-image\" [src]=\"image()!\" [alt]=\"imageAlt()\" />\n }\n @case ('icon') {\n <span class=\"ui-spinner-spin\">\n <ui-icon [name]=\"icon()!\" [size]=\"iconSize()\" />\n </span>\n }\n @default {\n <svg class=\"ui-spinner-svg\" viewBox=\"0 0 50 50\">\n <circle\n class=\"ui-spinner-circle\"\n cx=\"25\"\n cy=\"25\"\n r=\"20\"\n [attr.fill]=\"fill()\"\n [attr.stroke-width]=\"strokeWidth()\"\n />\n </svg>\n }\n }\n </span>\n\n @if (label(); as text) {\n <span class=\"ui-spinner-label\">{{ text }}</span>\n }\n </div>\n}\n"],"mappings":";;;;AAiCA,IAAa,YAAb,MAAa,UAAS;CAqCpB,cAAA;EAnCA,KAAA,OAAO,MAAqB,WAAU,GAAA,YAAA,CAAA,EAAA,WAAA,OAAA,CAAA,+BAAA,CAAA,CAAA;EAEtC,KAAA,cAAc,MAA4B,YAAW,GAAA,YAAA,CAAA,EAAA,WAAA,cAAA,CAAA,+BAAA,CAAA,CAAA;EAErD,KAAA,QAAQ,MAAe,GAAA,YAAA,CAAA,QAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;EAEvB,KAAA,YAAY,MAAe,GAAA,YAAA,CAAA,QAAA,EAAA,WAAA,YAAA,CAAA,+BAAA,CAAA,CAAA;EAI3B,KAAA,kBAAkB,MAA6B,GAAA,YAAA,CAAA,QAAA,EAAA,WAAA,kBAAA,CAAA,+BAAA,CAAA,CAAA;EAE/C,KAAA,QAAQ,MAAe,GAAA,YAAA,CAAA,QAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;EAEvB,KAAA,WAAW,MAAc,IAAG,GAAA,YAAA,CAAA,EAAA,W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