@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 +1 @@
1
- {"version":3,"file":"4sh-ui-kit-layout-ui-popover.mjs","sources":["../../../projects/ui-kit/layout/ui-popover/src/lib/ui-popover.ts","../../../projects/ui-kit/layout/ui-popover/src/lib/ui-popover.html","../../../projects/ui-kit/layout/ui-popover/src/public-api.ts","../../../projects/ui-kit/layout/ui-popover/src/4sh-ui-kit-layout-ui-popover.ts"],"sourcesContent":["import {\n booleanAttribute,\n Component,\n computed,\n DOCUMENT,\n effect,\n ElementRef,\n inject,\n input,\n isDevMode,\n output,\n signal,\n viewChild,\n} from '@angular/core';\nimport {\n ConnectedOverlayPositionChange,\n ConnectedPosition,\n OverlayModule,\n} from '@angular/cdk/overlay';\nimport { A11yModule } from '@angular/cdk/a11y';\nimport { UiMotion } from '@4sh/ui-kit/motion';\nimport { closeOnNavigation } from '@4sh/ui-kit/overlay';\n\n/** Preferred side of the trigger the panel is displayed on (drives the arrow). */\nexport type PopoverPosition = 'top' | 'bottom' | 'left' | 'right';\n\n/** Accepted shapes for the anchor passed to `show` / `toggle`. */\nexport type PopoverTarget = HTMLElement | ElementRef<HTMLElement>;\n\n/** Gap (px) between the trigger and the panel, leaving room for the arrow — mirrors `$popover-arrow-size` in the SCSS. */\nconst ARROW_GAP = 8;\n\n/** Focusable descendants used to move focus into the panel on open. */\nconst FOCUSABLE_SELECTOR = [\n 'a[href]',\n 'button:not([disabled])',\n 'input:not([disabled])',\n 'select:not([disabled])',\n 'textarea:not([disabled])',\n '[tabindex]:not([tabindex=\"-1\"])',\n].join(',');\n\n/** Process-wide counter for unique panel ids (aria-controls wiring). */\nlet nextId = 0;\n\n/**\n * ui-popover — headless floating panel anchored to a trigger.\n *\n * A token-styled surface (shared `overlay-panel` shell + `global.*` tokens)\n * rendered in a CDK connected overlay, driven imperatively through the public\n * `show` / `hide` / `toggle` methods. The consumer keeps a template reference\n * variable on the popover and wires a trigger to it; the panel holds arbitrary\n * projected content.\n *\n * Built for accessibility: `role=\"dialog\"`, non-modal WAI-ARIA pattern by\n * default (no `aria-modal`, focus not trapped — see the `modal` input to opt\n * into a blocking dialog with `aria-modal` + a permanent focus trap via\n * `@angular/cdk/a11y`), the first focusable element (or an element carrying\n * `autofocus`) focused on open, `Escape` to close and return focus to the\n * trigger, and `aria-expanded` / `aria-controls` reflected on the trigger.\n *\n * Positioning, viewport flipping and scroll re-alignment are delegated to the\n * CDK connected overlay (no manual geometry); the arrow follows the effective\n * side.\n *\n * @example\n * ```html\n * <!-- Basic: the trigger's click event carries the anchor -->\n * <ui-button label=\"Détails\" (buttonClick)=\"op.toggle($event)\" />\n * <ui-popover #op ariaLabel=\"Détails du produit\">…</ui-popover>\n *\n * <!-- Controlled: pass the trigger element as the second argument -->\n * <span #anchor>Ancre</span>\n * <ui-button label=\"Ouvrir\" (buttonClick)=\"op.show($event, anchor)\" />\n * <ui-popover #op ariaLabel=\"Détails\">…</ui-popover>\n * ```\n */\n@Component({\n selector: 'ui-popover',\n imports: [OverlayModule, A11yModule, UiMotion],\n templateUrl: './ui-popover.html',\n styleUrl: './ui-popover.scss',\n})\nexport class UiPopover {\n /** Hide the panel when a click lands outside it (and outside the trigger). */\n dismissable = input(true, { transform: booleanAttribute });\n /** Preferred side of the trigger; the overlay flips it when space is lacking. */\n position = input<PopoverPosition>('bottom');\n /** Render the arrow pointing back to the trigger. */\n showArrow = input(true, { transform: booleanAttribute });\n /** Make the panel modal: `aria-modal` reflected + permanent focus trap. */\n modal = input(false, { transform: booleanAttribute });\n /** ARIA role of the panel. */\n role = input<string>('dialog');\n /** Accessible name of the panel (recommended). */\n ariaLabel = input<string>();\n /** Id of an external element naming the panel. */\n ariaLabelledBy = input<string>();\n /** Move focus into the panel when it opens. */\n focusOnShow = input(true, { transform: booleanAttribute });\n /** Close the panel when `Escape` is pressed. */\n closeOnEscape = input(true, { transform: booleanAttribute });\n /** Animate the panel entrance (reduced-motion / `data-motion=\"off\"` always win). */\n motion = input(true, { transform: booleanAttribute });\n /** Extra class(es) applied to the panel (scoped custom styling). */\n styleClass = input<string>();\n\n /** Emitted after the panel becomes visible. */\n shown = output<void>();\n /** Emitted after the panel is hidden. */\n hidden = output<void>();\n\n /** @ignore */\n private readonly doc = inject(DOCUMENT);\n /** @ignore Panel root (only present while open — queried after the overlay attaches). */\n private readonly panel = viewChild<ElementRef<HTMLElement>>('panel');\n\n /** @ignore Panel visibility. */\n private readonly _open = signal(false);\n /** Read-only open state (for host bindings / conditional logic). */\n readonly visible = this._open.asReadonly();\n\n /** @ignore Element the overlay is anchored to. */\n protected readonly origin = signal<HTMLElement | null>(null);\n /** @ignore Effective side (updated from the CDK connection pair) — drives the arrow. */\n protected readonly side = signal<PopoverPosition>('bottom');\n /** @ignore Unique panel id, wired to the trigger via `aria-controls`. */\n protected readonly panelId = `ui-popover-${nextId++}`;\n\n /** @ignore Resolved trigger element (kept for focus restore + aria cleanup). */\n private targetEl: HTMLElement | null = null;\n\n constructor() {\n // A popover declared in an app shell outlives the routed view: dismiss it\n // rather than carrying it over to the next page.\n closeOnNavigation(() => this.hide());\n\n // A11y safeguard: an open dialog must have an accessible name.\n if (isDevMode()) {\n effect(() => {\n if (this._open() && !this.ariaLabel() && !this.ariaLabelledBy()) {\n console.warn(\n '[ui-popover] Popover has no accessible name: provide `ariaLabel` or `ariaLabelledBy`.',\n );\n }\n });\n }\n }\n\n // --- Public API ---------------------------------------------------------\n\n /**\n * Show the panel anchored to `target` (or the event's `currentTarget`).\n * @param event Browser event whose `currentTarget` is used as a fallback anchor.\n * @param target Explicit anchor element (kept anchored to it).\n */\n show(event?: Event, target?: PopoverTarget): void {\n const anchor = this.resolveTarget(target) ?? this.resolveEventTarget(event);\n if (!anchor) return;\n event?.stopPropagation();\n\n this.targetEl = anchor;\n this.origin.set(anchor);\n if (!this._open()) {\n this._open.set(true);\n this.applyTriggerAria(anchor);\n this.shown.emit();\n }\n if (this.focusOnShow()) this.queueFocus();\n }\n\n /** Hide the panel; returns focus to the trigger when focus was inside it. */\n hide(): void {\n if (!this._open()) return;\n const panelEl = this.panel()?.nativeElement;\n const active = this.doc.activeElement;\n const focusWasInside = !!panelEl && active instanceof Node && panelEl.contains(active);\n\n this._open.set(false);\n this.clearTriggerAria();\n if (focusWasInside) this.targetEl?.focus();\n this.hidden.emit();\n }\n\n /** Toggle the panel, anchoring it like {@link show} when it opens. */\n toggle(event?: Event, target?: PopoverTarget): void {\n this._open() ? this.hide() : this.show(event, target);\n }\n\n // --- Positioning ----------------------------------------------------------\n\n /** @ignore Ordered positions (preferred first, then fallbacks) for CDK auto-flip. */\n protected readonly positions = computed<ConnectedPosition[]>(() => {\n const top: ConnectedPosition = {\n originX: 'center',\n originY: 'top',\n overlayX: 'center',\n overlayY: 'bottom',\n offsetY: -ARROW_GAP,\n };\n const bottom: ConnectedPosition = {\n originX: 'center',\n originY: 'bottom',\n overlayX: 'center',\n overlayY: 'top',\n offsetY: ARROW_GAP,\n };\n const left: ConnectedPosition = {\n originX: 'start',\n originY: 'center',\n overlayX: 'end',\n overlayY: 'center',\n offsetX: -ARROW_GAP,\n };\n const right: ConnectedPosition = {\n originX: 'end',\n originY: 'center',\n overlayX: 'start',\n overlayY: 'center',\n offsetX: ARROW_GAP,\n };\n const order: Record<PopoverPosition, ConnectedPosition[]> = {\n top: [top, bottom, right, left],\n bottom: [bottom, top, right, left],\n left: [left, right, top, bottom],\n right: [right, left, top, bottom],\n };\n return order[this.position()];\n });\n\n /** @ignore */\n protected readonly panelClasses = computed(() => {\n const c = ['ui-popover', `_${this.side()}`];\n if (!this.showArrow()) c.push('_no-arrow');\n const extra = this.styleClass();\n if (extra) c.push(extra);\n return c.join(' ');\n });\n\n /** @ignore Map the active CDK connection pair back to the visual side (for the arrow). */\n protected onPositionChange(change: ConnectedOverlayPositionChange): void {\n // The trigger can be gone while the popover lives on (its page was\n // destroyed): re-positioning on a detached anchor measures 0×0 and would\n // snap the panel to the top-left corner.\n if (this.targetEl && !this.targetEl.isConnected) {\n this.hide();\n return;\n }\n const pair = change.connectionPair;\n if (pair.overlayY === 'bottom') this.side.set('top');\n else if (pair.overlayY === 'top' && pair.originY === 'bottom') this.side.set('bottom');\n else if (pair.overlayX === 'end') this.side.set('left');\n else if (pair.overlayX === 'start' && pair.originX === 'end') this.side.set('right');\n else this.side.set(this.position());\n }\n\n // --- Interactions ---------------------------------------------------------\n\n /** @ignore A click outside the panel closes it — unless it lands on the trigger,\n * whose own handler owns the toggle (avoids close-then-reopen races). */\n protected onOutsideClick(event: MouseEvent): void {\n if (!this.dismissable()) return;\n const target = event.target;\n if (target instanceof Node && this.targetEl?.contains(target)) return;\n this.hide();\n }\n\n /** @ignore */\n protected onEscape(event: Event): void {\n if (!this.closeOnEscape()) return;\n event.stopPropagation();\n this.hide();\n }\n\n // --- Internals ------------------------------------------------------------\n\n /** @ignore */\n private resolveTarget(target?: PopoverTarget): HTMLElement | null {\n if (!target) return null;\n return target instanceof ElementRef ? target.nativeElement : target;\n }\n\n /** @ignore */\n private resolveEventTarget(event?: Event): HTMLElement | null {\n const el = event?.currentTarget ?? event?.target;\n return el instanceof HTMLElement ? el : null;\n }\n\n /** @ignore Reflect the open relationship on the trigger. */\n private applyTriggerAria(el: HTMLElement): void {\n el.setAttribute('aria-expanded', 'true');\n el.setAttribute('aria-controls', this.panelId);\n }\n\n /** @ignore */\n private clearTriggerAria(): void {\n const el = this.targetEl;\n if (!el) return;\n el.setAttribute('aria-expanded', 'false');\n el.removeAttribute('aria-controls');\n }\n\n /** @ignore Focus the first focusable (or `[autofocus]`) once the overlay renders.\n * The overlay attaches after change detection: retry over macrotasks\n * (NOT rAF — it never fires in throttled/background tabs). */\n private queueFocus(attempts = 20): void {\n setTimeout(() => {\n const panelEl = this.panel()?.nativeElement;\n if (panelEl) this.focusFirst(panelEl);\n else if (attempts > 0) this.queueFocus(attempts - 1);\n });\n }\n\n /** @ignore */\n private focusFirst(panelEl: HTMLElement): void {\n const auto = panelEl.querySelector<HTMLElement>('[autofocus]');\n if (auto) {\n auto.focus();\n return;\n }\n const focusable = panelEl.querySelector<HTMLElement>(FOCUSABLE_SELECTOR);\n (focusable ?? panelEl).focus();\n }\n}\n","<ng-template\n cdkConnectedOverlay\n [cdkConnectedOverlayOrigin]=\"origin()!\"\n [cdkConnectedOverlayOpen]=\"visible()\"\n [cdkConnectedOverlayPositions]=\"positions()\"\n [cdkConnectedOverlayHasBackdrop]=\"false\"\n [cdkConnectedOverlayPush]=\"false\"\n [cdkConnectedOverlayFlexibleDimensions]=\"false\"\n [cdkConnectedOverlayViewportMargin]=\"8\"\n (overlayOutsideClick)=\"onOutsideClick($event)\"\n (positionChange)=\"onPositionChange($event)\"\n (detach)=\"hide()\"\n>\n <div\n #panel\n [class]=\"panelClasses()\"\n [attr.id]=\"panelId\"\n [attr.role]=\"role()\"\n [attr.aria-modal]=\"modal() ? 'true' : null\"\n [attr.aria-label]=\"ariaLabel()\"\n [attr.aria-labelledby]=\"ariaLabelledBy()\"\n tabindex=\"-1\"\n [cdkTrapFocus]=\"modal()\"\n [uiMotion]=\"'zoom'\"\n [motionDisabled]=\"!motion()\"\n #panelMotion=\"uiMotion\"\n motionOnInsert\n (keydown.escape)=\"onEscape($event)\"\n >\n @if (showArrow()) {\n <span class=\"ui-popover-arrow\" aria-hidden=\"true\"></span>\n }\n <div class=\"ui-popover-content\">\n <ng-content />\n </div>\n </div>\n</ng-template>\n","/*\n * Public API Surface of ui-kit/ui-popover\n */\n\nexport * from './lib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AAA,EAAA,OAAA,EAAA,CAAA,eAAA,EAAA,gBAAA,EAAA,QAAA,EAAA,QAAA,EAAA,gBAAA,EAAA,qBAAA,CAAA,EAAA,QAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EAAE,UAAU,0LAAE,QAAQ,EAAA,QAAA,EAAA,YAAA,EAAA,MAAA,EAAA,CAAA,UAAA,EAAA,gBAAA,EAAA,aAAA,EAAA,cAAA,EAAA,mBAAA,EAAA,mBAAA,EAAA,gBAAA,EAAA,aAAA,EAAA,gBAAA,EAAA,gBAAA,CAAA,EAAA,QAAA,EAAA,CAAA,UAAA,CAAA,EAAA,CAAA,EAAA,CAAA,CAAA;;2FAIlC,SAAS,EAAA,UAAA,EAAA,CAAA;kBANrB,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,YAAY,WACb,CAAC,aAAa,EAAE,UAAU,EAAE,QAAQ,CAAC,EAAA,QAAA,EAAA,6nCAAA,EAAA,MAAA,EAAA,CAAA,8kEAAA,CAAA,EAAA;qvCAoCc,OAAO,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AEnHrE;;AAEG;;ACFH;;AAEG;;"}
1
+ {"version":3,"file":"4sh-ui-kit-layout-ui-popover.mjs","names":[],"sources":["../../../projects/ui-kit/layout/ui-popover/src/lib/ui-popover.ts","../../../projects/ui-kit/layout/ui-popover/src/lib/ui-popover.html"],"sourcesContent":["import {\n booleanAttribute,\n Component,\n computed,\n DOCUMENT,\n effect,\n ElementRef,\n inject,\n input,\n isDevMode,\n output,\n signal,\n viewChild,\n} from '@angular/core';\nimport {\n ConnectedOverlayPositionChange,\n ConnectedPosition,\n OverlayModule,\n} from '@angular/cdk/overlay';\nimport { A11yModule } from '@angular/cdk/a11y';\nimport { UiMotion } from '@4sh/ui-kit/motion';\nimport { closeOnNavigation } from '@4sh/ui-kit/overlay';\n\n/** Preferred side of the trigger the panel is displayed on (drives the arrow). */\nexport type PopoverPosition = 'top' | 'bottom' | 'left' | 'right';\n\n/** Accepted shapes for the anchor passed to `show` / `toggle`. */\nexport type PopoverTarget = HTMLElement | ElementRef<HTMLElement>;\n\n/** Gap (px) between the trigger and the panel, leaving room for the arrow — mirrors `$popover-arrow-size` in the SCSS. */\nconst ARROW_GAP = 8;\n\n/** Focusable descendants used to move focus into the panel on open. */\nconst FOCUSABLE_SELECTOR = [\n 'a[href]',\n 'button:not([disabled])',\n 'input:not([disabled])',\n 'select:not([disabled])',\n 'textarea:not([disabled])',\n '[tabindex]:not([tabindex=\"-1\"])',\n].join(',');\n\n/** Process-wide counter for unique panel ids (aria-controls wiring). */\nlet nextId = 0;\n\n/**\n * ui-popover — headless floating panel anchored to a trigger.\n *\n * A token-styled surface (shared `overlay-panel` shell + `global.*` tokens)\n * rendered in a CDK connected overlay, driven imperatively through the public\n * `show` / `hide` / `toggle` methods. The consumer keeps a template reference\n * variable on the popover and wires a trigger to it; the panel holds arbitrary\n * projected content.\n *\n * Built for accessibility: `role=\"dialog\"`, non-modal WAI-ARIA pattern by\n * default (no `aria-modal`, focus not trapped — see the `modal` input to opt\n * into a blocking dialog with `aria-modal` + a permanent focus trap via\n * `@angular/cdk/a11y`), the first focusable element (or an element carrying\n * `autofocus`) focused on open, `Escape` to close and return focus to the\n * trigger, and `aria-expanded` / `aria-controls` reflected on the trigger.\n *\n * Positioning, viewport flipping and scroll re-alignment are delegated to the\n * CDK connected overlay (no manual geometry); the arrow follows the effective\n * side.\n *\n * @example\n * ```html\n * <!-- Basic: the trigger's click event carries the anchor -->\n * <ui-button label=\"Détails\" (buttonClick)=\"op.toggle($event)\" />\n * <ui-popover #op ariaLabel=\"Détails du produit\">…</ui-popover>\n *\n * <!-- Controlled: pass the trigger element as the second argument -->\n * <span #anchor>Ancre</span>\n * <ui-button label=\"Ouvrir\" (buttonClick)=\"op.show($event, anchor)\" />\n * <ui-popover #op ariaLabel=\"Détails\">…</ui-popover>\n * ```\n */\n@Component({\n selector: 'ui-popover',\n imports: [OverlayModule, A11yModule, UiMotion],\n templateUrl: './ui-popover.html',\n styleUrl: './ui-popover.scss',\n})\nexport class UiPopover {\n /** Hide the panel when a click lands outside it (and outside the trigger). */\n dismissable = input(true, { transform: booleanAttribute });\n /** Preferred side of the trigger; the overlay flips it when space is lacking. */\n position = input<PopoverPosition>('bottom');\n /** Render the arrow pointing back to the trigger. */\n showArrow = input(true, { transform: booleanAttribute });\n /** Make the panel modal: `aria-modal` reflected + permanent focus trap. */\n modal = input(false, { transform: booleanAttribute });\n /** ARIA role of the panel. */\n role = input<string>('dialog');\n /** Accessible name of the panel (recommended). */\n ariaLabel = input<string>();\n /** Id of an external element naming the panel. */\n ariaLabelledBy = input<string>();\n /** Move focus into the panel when it opens. */\n focusOnShow = input(true, { transform: booleanAttribute });\n /** Close the panel when `Escape` is pressed. */\n closeOnEscape = input(true, { transform: booleanAttribute });\n /** Animate the panel entrance (reduced-motion / `data-motion=\"off\"` always win). */\n motion = input(true, { transform: booleanAttribute });\n /** Extra class(es) applied to the panel (scoped custom styling). */\n styleClass = input<string>();\n\n /** Emitted after the panel becomes visible. */\n shown = output<void>();\n /** Emitted after the panel is hidden. */\n hidden = output<void>();\n\n /** @ignore */\n private readonly doc = inject(DOCUMENT);\n /** @ignore Panel root (only present while open — queried after the overlay attaches). */\n private readonly panel = viewChild<ElementRef<HTMLElement>>('panel');\n\n /** @ignore Panel visibility. */\n private readonly _open = signal(false);\n /** Read-only open state (for host bindings / conditional logic). */\n readonly visible = this._open.asReadonly();\n\n /** @ignore Element the overlay is anchored to. */\n protected readonly origin = signal<HTMLElement | null>(null);\n /** @ignore Effective side (updated from the CDK connection pair) — drives the arrow. */\n protected readonly side = signal<PopoverPosition>('bottom');\n /** @ignore Unique panel id, wired to the trigger via `aria-controls`. */\n protected readonly panelId = `ui-popover-${nextId++}`;\n\n /** @ignore Resolved trigger element (kept for focus restore + aria cleanup). */\n private targetEl: HTMLElement | null = null;\n\n constructor() {\n // A popover declared in an app shell outlives the routed view: dismiss it\n // rather than carrying it over to the next page.\n closeOnNavigation(() => this.hide());\n\n // A11y safeguard: an open dialog must have an accessible name.\n if (isDevMode()) {\n effect(() => {\n if (this._open() && !this.ariaLabel() && !this.ariaLabelledBy()) {\n console.warn(\n '[ui-popover] Popover has no accessible name: provide `ariaLabel` or `ariaLabelledBy`.',\n );\n }\n });\n }\n }\n\n // --- Public API ---------------------------------------------------------\n\n /**\n * Show the panel anchored to `target` (or the event's `currentTarget`).\n * @param event Browser event whose `currentTarget` is used as a fallback anchor.\n * @param target Explicit anchor element (kept anchored to it).\n */\n show(event?: Event, target?: PopoverTarget): void {\n const anchor = this.resolveTarget(target) ?? this.resolveEventTarget(event);\n if (!anchor) return;\n event?.stopPropagation();\n\n this.targetEl = anchor;\n this.origin.set(anchor);\n if (!this._open()) {\n this._open.set(true);\n this.applyTriggerAria(anchor);\n this.shown.emit();\n }\n if (this.focusOnShow()) this.queueFocus();\n }\n\n /** Hide the panel; returns focus to the trigger when focus was inside it. */\n hide(): void {\n if (!this._open()) return;\n const panelEl = this.panel()?.nativeElement;\n const active = this.doc.activeElement;\n const focusWasInside = !!panelEl && active instanceof Node && panelEl.contains(active);\n\n this._open.set(false);\n this.clearTriggerAria();\n if (focusWasInside) this.targetEl?.focus();\n this.hidden.emit();\n }\n\n /** Toggle the panel, anchoring it like {@link show} when it opens. */\n toggle(event?: Event, target?: PopoverTarget): void {\n this._open() ? this.hide() : this.show(event, target);\n }\n\n // --- Positioning ----------------------------------------------------------\n\n /** @ignore Ordered positions (preferred first, then fallbacks) for CDK auto-flip. */\n protected readonly positions = computed<ConnectedPosition[]>(() => {\n const top: ConnectedPosition = {\n originX: 'center',\n originY: 'top',\n overlayX: 'center',\n overlayY: 'bottom',\n offsetY: -ARROW_GAP,\n };\n const bottom: ConnectedPosition = {\n originX: 'center',\n originY: 'bottom',\n overlayX: 'center',\n overlayY: 'top',\n offsetY: ARROW_GAP,\n };\n const left: ConnectedPosition = {\n originX: 'start',\n originY: 'center',\n overlayX: 'end',\n overlayY: 'center',\n offsetX: -ARROW_GAP,\n };\n const right: ConnectedPosition = {\n originX: 'end',\n originY: 'center',\n overlayX: 'start',\n overlayY: 'center',\n offsetX: ARROW_GAP,\n };\n const order: Record<PopoverPosition, ConnectedPosition[]> = {\n top: [top, bottom, right, left],\n bottom: [bottom, top, right, left],\n left: [left, right, top, bottom],\n right: [right, left, top, bottom],\n };\n return order[this.position()];\n });\n\n /** @ignore */\n protected readonly panelClasses = computed(() => {\n const c = ['ui-popover', `_${this.side()}`];\n if (!this.showArrow()) c.push('_no-arrow');\n const extra = this.styleClass();\n if (extra) c.push(extra);\n return c.join(' ');\n });\n\n /** @ignore Map the active CDK connection pair back to the visual side (for the arrow). */\n protected onPositionChange(change: ConnectedOverlayPositionChange): void {\n // The trigger can be gone while the popover lives on (its page was\n // destroyed): re-positioning on a detached anchor measures 0×0 and would\n // snap the panel to the top-left corner.\n if (this.targetEl && !this.targetEl.isConnected) {\n this.hide();\n return;\n }\n const pair = change.connectionPair;\n if (pair.overlayY === 'bottom') this.side.set('top');\n else if (pair.overlayY === 'top' && pair.originY === 'bottom') this.side.set('bottom');\n else if (pair.overlayX === 'end') this.side.set('left');\n else if (pair.overlayX === 'start' && pair.originX === 'end') this.side.set('right');\n else this.side.set(this.position());\n }\n\n // --- Interactions ---------------------------------------------------------\n\n /** @ignore A click outside the panel closes it — unless it lands on the trigger,\n * whose own handler owns the toggle (avoids close-then-reopen races). */\n protected onOutsideClick(event: MouseEvent): void {\n if (!this.dismissable()) return;\n const target = event.target;\n if (target instanceof Node && this.targetEl?.contains(target)) return;\n this.hide();\n }\n\n /** @ignore */\n protected onEscape(event: Event): void {\n if (!this.closeOnEscape()) return;\n event.stopPropagation();\n this.hide();\n }\n\n // --- Internals ------------------------------------------------------------\n\n /** @ignore */\n private resolveTarget(target?: PopoverTarget): HTMLElement | null {\n if (!target) return null;\n return target instanceof ElementRef ? target.nativeElement : target;\n }\n\n /** @ignore */\n private resolveEventTarget(event?: Event): HTMLElement | null {\n const el = event?.currentTarget ?? event?.target;\n return el instanceof HTMLElement ? el : null;\n }\n\n /** @ignore Reflect the open relationship on the trigger. */\n private applyTriggerAria(el: HTMLElement): void {\n el.setAttribute('aria-expanded', 'true');\n el.setAttribute('aria-controls', this.panelId);\n }\n\n /** @ignore */\n private clearTriggerAria(): void {\n const el = this.targetEl;\n if (!el) return;\n el.setAttribute('aria-expanded', 'false');\n el.removeAttribute('aria-controls');\n }\n\n /** @ignore Focus the first focusable (or `[autofocus]`) once the overlay renders.\n * The overlay attaches after change detection: retry over macrotasks\n * (NOT rAF — it never fires in throttled/background tabs). */\n private queueFocus(attempts = 20): void {\n setTimeout(() => {\n const panelEl = this.panel()?.nativeElement;\n if (panelEl) this.focusFirst(panelEl);\n else if (attempts > 0) this.queueFocus(attempts - 1);\n });\n }\n\n /** @ignore */\n private focusFirst(panelEl: HTMLElement): void {\n const auto = panelEl.querySelector<HTMLElement>('[autofocus]');\n if (auto) {\n auto.focus();\n return;\n }\n const focusable = panelEl.querySelector<HTMLElement>(FOCUSABLE_SELECTOR);\n (focusable ?? panelEl).focus();\n }\n}\n","<ng-template\n cdkConnectedOverlay\n [cdkConnectedOverlayOrigin]=\"origin()!\"\n [cdkConnectedOverlayOpen]=\"visible()\"\n [cdkConnectedOverlayPositions]=\"positions()\"\n [cdkConnectedOverlayHasBackdrop]=\"false\"\n [cdkConnectedOverlayPush]=\"false\"\n [cdkConnectedOverlayFlexibleDimensions]=\"false\"\n [cdkConnectedOverlayViewportMargin]=\"8\"\n (overlayOutsideClick)=\"onOutsideClick($event)\"\n (positionChange)=\"onPositionChange($event)\"\n (detach)=\"hide()\"\n>\n <div\n #panel\n [class]=\"panelClasses()\"\n [attr.id]=\"panelId\"\n [attr.role]=\"role()\"\n [attr.aria-modal]=\"modal() ? 'true' : null\"\n [attr.aria-label]=\"ariaLabel()\"\n [attr.aria-labelledby]=\"ariaLabelledBy()\"\n tabindex=\"-1\"\n [cdkTrapFocus]=\"modal()\"\n [uiMotion]=\"'zoom'\"\n [motionDisabled]=\"!motion()\"\n #panelMotion=\"uiMotion\"\n motionOnInsert\n (keydown.escape)=\"onEscape($event)\"\n >\n @if (showArrow()) {\n <span class=\"ui-popover-arrow\" aria-hidden=\"true\"></span>\n }\n <div class=\"ui-popover-content\">\n <ng-content />\n </div>\n </div>\n</ng-template>\n"],"mappings":";;;;;;;;AA8BA,MAAM,YAAY;AAGlB,MAAM,qBAAqB;CACzB;CACA;CACA;CACA;CACA;CACA;AACD,CAAA,CAAC,KAAK,GAAG;AAGV,IAAI,SAAS;AAwCb,IAAa,YAAb,MAAa,UAAS;CAiDpB,cAAA;EA/CA,KAAA,cAAc,MAAM,MAAI;GAAA,GAAA,YAAA,EAAA,WAAA,cAAA,+BAAA,CAAA;GAAI,WAAW;EAAgB,CAAA;EAEvD,KAAA,WAAW,MAAuB,UAAS,GAAA,YAAA,CAAA,EAAA,WAAA,WAAA,CAAA,+BAAA,CAAA,CAAA;EAE3C,KAAA,YAAY,MAAM,MAAI;GAAA,GAAA,YAAA,EAAA,WAAA,YAAA,+BAAA,CAAA;GAAI,WAAW;EAAgB,CAAA;EAErD,KAAA,QAAQ,MAAM,OAAK;GAAA,GAAA,YAAA,EAAA,WAAA,QAAA,+BAAA,CAAA;GAAI,WAAW;EAAgB,CAAA;EAElD,KAAA,OAAO,MAAc,UAAS,GAAA,YAAA,CAAA,EAAA,WAAA,OAAA,CAAA,+BAAA,CAAA,CAAA;EAE9B,KAAA,YAAY,MAAe,GAAA,YAAA,CAAA,QAAA,EAAA,WAAA,YAAA,CAAA,+BAAA,CAAA,CAAA;EAE3B,KAAA,iBAAiB,MAAe,GAAA,YAAA,CAAA,QAAA,EAAA,WAAA,iBAAA,CAAA,+BAAA,CAAA,CAAA;EAEhC,KAAA,cAAc,MAAM,MAAI;GAAA,GAAA,YAAA,EAAA,WAAA,cAAA,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;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,eAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,QAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,YAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,OAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,OAAA;EAAA,CAAA;EAAA,QAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,QAAA;EAAA,CAAA;EAAA,OAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,SAAO,EAAA,UAAA,KAAA,CAAA;EAAA,CAAA;CAAA;AAAA,CAAA"}
@@ -1,155 +1,257 @@
1
- import * as i0 from '@angular/core';
2
- import { input, booleanAttribute, computed, Directive } from '@angular/core';
3
-
4
- /** All preset keys, in declaration order (handy for stories/docs). */
1
+ import * as i0 from "@angular/core";
2
+ import { Directive, booleanAttribute, computed, input } from "@angular/core";
5
3
  const UI_MOTION_PRESETS = [
6
- 'fade',
7
- 'slide-up',
8
- 'slide-down',
9
- 'slide-left',
10
- 'slide-right',
11
- 'zoom',
12
- 'collapse',
4
+ "fade",
5
+ "slide-up",
6
+ "slide-down",
7
+ "slide-left",
8
+ "slide-right",
9
+ "zoom",
10
+ "collapse"
13
11
  ];
14
- /** CSS class to bind to `animate.enter` for a preset. */
15
12
  const motionEnterClass = (preset) => `ui-motion-${preset}-enter`;
16
- /** CSS class to bind to `animate.leave` for a preset. */
17
13
  const motionLeaveClass = (preset) => `ui-motion-${preset}-leave`;
18
- /**
19
- * uiMotion — ergonomic wiring for the motion system on a conditionally
20
- * rendered element (`@if`, `@for`, control-flow insert/remove).
21
- *
22
- * It selects an enter/leave **preset** and exposes the matching class names for
23
- * Angular's native `animate.enter` / `animate.leave`, while letting you re-time
24
- * a single instance through the `--ui-motion-*` custom properties — no extra
25
- * CSS. Set `motionDisabled` (or the global `data-motion="off"` switch / the
26
- * user's reduced-motion preference) to opt out.
27
- *
28
- * The enter/leave bindings stay in the template (Angular resolves them at the
29
- * insertion/removal boundary); the directive supplies the class strings and the
30
- * timing variables:
31
- *
32
- * @example
33
- * ```html
34
- * @if (open()) {
35
- * <div class="panel"
36
- * [uiMotion]="'zoom'" #m="uiMotion"
37
- * [animate.enter]="m.enter()" [animate.leave]="m.leave()">…</div>
38
- * }
39
- *
40
- * <!-- faster, custom easing, disabled on demand -->
41
- * <div [uiMotion]="'slide-down'" motionDuration="120ms"
42
- * [motionDisabled]="prefersStillness()" #m="uiMotion"
43
- * [animate.enter]="m.enter()" [animate.leave]="m.leave()">…</div>
44
- * ```
45
- */
46
- class UiMotion {
47
- constructor() {
48
- /** Motion preset (enter/leave pair). */
49
- this.preset = input.required({ ...(ngDevMode ? { debugName: "preset" } : /* istanbul ignore next */ {}), alias: 'uiMotion' });
50
- /** Override the duration for this element (e.g. `"120ms"`). */
51
- this.motionDuration = input(/* @ts-ignore */
52
- ...(ngDevMode ? [undefined, { debugName: "motionDuration" }] : /* istanbul ignore next */ []));
53
- /** Override the delay before the animation starts (e.g. `"40ms"`). */
54
- this.motionDelay = input(/* @ts-ignore */
55
- ...(ngDevMode ? [undefined, { debugName: "motionDelay" }] : /* istanbul ignore next */ []));
56
- /** Override both enter and leave easing (CSS timing function). */
57
- this.motionEasing = input(/* @ts-ignore */
58
- ...(ngDevMode ? [undefined, { debugName: "motionEasing" }] : /* istanbul ignore next */ []));
59
- /** Override only the enter easing (falls back to `motionEasing`). */
60
- this.motionEnterEasing = input(/* @ts-ignore */
61
- ...(ngDevMode ? [undefined, { debugName: "motionEnterEasing" }] : /* istanbul ignore next */ []));
62
- /** Override only the leave easing (falls back to `motionEasing`). */
63
- this.motionLeaveEasing = input(/* @ts-ignore */
64
- ...(ngDevMode ? [undefined, { debugName: "motionLeaveEasing" }] : /* istanbul ignore next */ []));
65
- /** Override the slide offset for the directional presets (e.g. `"12px"`). */
66
- this.motionDistance = input(/* @ts-ignore */
67
- ...(ngDevMode ? [undefined, { debugName: "motionDistance" }] : /* istanbul ignore next */ []));
68
- /** Override the start/end scale for the `zoom` preset (e.g. `0.9`). */
69
- this.motionScale = input(/* @ts-ignore */
70
- ...(ngDevMode ? [undefined, { debugName: "motionScale" }] : /* istanbul ignore next */ []));
71
- /** Disable motion for this element (renders/removes with no animation). */
72
- this.motionDisabled = input(false, { ...(ngDevMode ? { debugName: "motionDisabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
73
- /**
74
- * Play the enter preset through a class the directive applies itself, instead
75
- * of binding `animate.enter` in the template — the preset classes are plain
76
- * CSS animations, they need no framework hook to run once on insertion.
77
- *
78
- * **Mandatory for anything rendered in a CDK overlay** (dropdown panels,
79
- * menus, popovers). `animate.enter` registers the node in Angular's animation
80
- * queue, and that queue is unwound through the injector when the node goes
81
- * away; if the application is torn down while the overlay is still attached,
82
- * the unwind throws (`NG0205`) in the middle of the teardown and everything
83
- * after it is skipped — including the overlay's own `dispose()`. The panel
84
- * then stays in the document, detached from its anchor, in the top-left
85
- * corner of whatever renders next. No queue, no orphan.
86
- *
87
- * Leave it off for content inserted by `@if` / `@for` in a normal view, where
88
- * `animate.enter` also buys the leave animation.
89
- */
90
- this.motionOnInsert = input(false, { ...(ngDevMode ? { debugName: "motionOnInsert" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
91
- /** Class to bind to `animate.enter` (empty when disabled → instant appear). */
92
- this.enter = computed(() => (this.motionDisabled() ? '' : motionEnterClass(this.preset())), /* @ts-ignore */
93
- ...(ngDevMode ? [{ debugName: "enter" }] : /* istanbul ignore next */ []));
94
- /** Class to bind to `animate.leave` (empty when disabled → instant removal). */
95
- this.leave = computed(() => (this.motionDisabled() ? '' : motionLeaveClass(this.preset())), /* @ts-ignore */
96
- ...(ngDevMode ? [{ debugName: "leave" }] : /* istanbul ignore next */ []));
97
- /** @ignore Enter class applied by the directive in `motionOnInsert` mode. */
98
- this._insertClass = computed(() => (this.motionOnInsert() ? this.enter() : ''), /* @ts-ignore */
99
- ...(ngDevMode ? [{ debugName: "_insertClass" }] : /* istanbul ignore next */ []));
100
- /** @ignore */
101
- this._duration = computed(() => this.motionDuration() ?? null, /* @ts-ignore */
102
- ...(ngDevMode ? [{ debugName: "_duration" }] : /* istanbul ignore next */ []));
103
- /** @ignore */
104
- this._delay = computed(() => this.motionDelay() ?? null, /* @ts-ignore */
105
- ...(ngDevMode ? [{ debugName: "_delay" }] : /* istanbul ignore next */ []));
106
- /** @ignore */
107
- this._enterEasing = computed(() => this.motionEnterEasing() ?? this.motionEasing() ?? null, /* @ts-ignore */
108
- ...(ngDevMode ? [{ debugName: "_enterEasing" }] : /* istanbul ignore next */ []));
109
- /** @ignore */
110
- this._leaveEasing = computed(() => this.motionLeaveEasing() ?? this.motionEasing() ?? null, /* @ts-ignore */
111
- ...(ngDevMode ? [{ debugName: "_leaveEasing" }] : /* istanbul ignore next */ []));
112
- /** @ignore */
113
- this._distance = computed(() => this.motionDistance() ?? null, /* @ts-ignore */
114
- ...(ngDevMode ? [{ debugName: "_distance" }] : /* istanbul ignore next */ []));
115
- /** @ignore */
116
- this._scale = computed(() => {
117
- const s = this.motionScale();
118
- return s === undefined ? null : String(s);
119
- }, /* @ts-ignore */
120
- ...(ngDevMode ? [{ debugName: "_scale" }] : /* istanbul ignore next */ []));
121
- }
122
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: UiMotion, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
123
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.7", type: UiMotion, isStandalone: true, selector: "[uiMotion]", inputs: { preset: { classPropertyName: "preset", publicName: "uiMotion", isSignal: true, isRequired: true, transformFunction: null }, motionDuration: { classPropertyName: "motionDuration", publicName: "motionDuration", isSignal: true, isRequired: false, transformFunction: null }, motionDelay: { classPropertyName: "motionDelay", publicName: "motionDelay", isSignal: true, isRequired: false, transformFunction: null }, motionEasing: { classPropertyName: "motionEasing", publicName: "motionEasing", isSignal: true, isRequired: false, transformFunction: null }, motionEnterEasing: { classPropertyName: "motionEnterEasing", publicName: "motionEnterEasing", isSignal: true, isRequired: false, transformFunction: null }, motionLeaveEasing: { classPropertyName: "motionLeaveEasing", publicName: "motionLeaveEasing", isSignal: true, isRequired: false, transformFunction: null }, motionDistance: { classPropertyName: "motionDistance", publicName: "motionDistance", isSignal: true, isRequired: false, transformFunction: null }, motionScale: { classPropertyName: "motionScale", publicName: "motionScale", isSignal: true, isRequired: false, transformFunction: null }, motionDisabled: { classPropertyName: "motionDisabled", publicName: "motionDisabled", isSignal: true, isRequired: false, transformFunction: null }, motionOnInsert: { classPropertyName: "motionOnInsert", publicName: "motionOnInsert", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "_insertClass()", "style.--ui-motion-duration": "_duration()", "style.--ui-motion-delay": "_delay()", "style.--ui-motion-easing-enter": "_enterEasing()", "style.--ui-motion-easing-leave": "_leaveEasing()", "style.--ui-motion-distance": "_distance()", "style.--ui-motion-scale": "_scale()" } }, exportAs: ["uiMotion"], ngImport: i0 }); }
124
- }
125
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: UiMotion, decorators: [{
126
- type: Directive,
127
- args: [{
128
- selector: '[uiMotion]',
129
- exportAs: 'uiMotion',
130
- host: {
131
- '[class]': '_insertClass()',
132
- '[style.--ui-motion-duration]': '_duration()',
133
- '[style.--ui-motion-delay]': '_delay()',
134
- '[style.--ui-motion-easing-enter]': '_enterEasing()',
135
- '[style.--ui-motion-easing-leave]': '_leaveEasing()',
136
- '[style.--ui-motion-distance]': '_distance()',
137
- '[style.--ui-motion-scale]': '_scale()',
138
- },
139
- }]
140
- }], propDecorators: { preset: [{ type: i0.Input, args: [{ isSignal: true, alias: "uiMotion", required: true }] }], motionDuration: [{ type: i0.Input, args: [{ isSignal: true, alias: "motionDuration", required: false }] }], motionDelay: [{ type: i0.Input, args: [{ isSignal: true, alias: "motionDelay", required: false }] }], motionEasing: [{ type: i0.Input, args: [{ isSignal: true, alias: "motionEasing", required: false }] }], motionEnterEasing: [{ type: i0.Input, args: [{ isSignal: true, alias: "motionEnterEasing", required: false }] }], motionLeaveEasing: [{ type: i0.Input, args: [{ isSignal: true, alias: "motionLeaveEasing", required: false }] }], motionDistance: [{ type: i0.Input, args: [{ isSignal: true, alias: "motionDistance", required: false }] }], motionScale: [{ type: i0.Input, args: [{ isSignal: true, alias: "motionScale", required: false }] }], motionDisabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "motionDisabled", required: false }] }], motionOnInsert: [{ type: i0.Input, args: [{ isSignal: true, alias: "motionOnInsert", required: false }] }] } });
141
-
142
- /*
143
- * Public API Surface of ui-kit/motion
144
- *
145
- * `UiMotion` directive + presets. The enter/leave CSS classes it toggles live
146
- * in the package's global stylesheet (`styles/base/_motion.scss` → `styles.css`), shipped with
147
- * the design tokens.
148
- */
149
-
150
- /**
151
- * Generated bundle index. Do not edit.
152
- */
153
-
14
+ var UiMotion = class UiMotion {
15
+ constructor() {
16
+ this.preset = input.required({
17
+ ...ngDevMode ? { debugName: "preset" } : /* istanbul ignore next */ {},
18
+ alias: "uiMotion"
19
+ });
20
+ this.motionDuration = input(...ngDevMode ? [void 0, { debugName: "motionDuration" }] : /* istanbul ignore next */ []);
21
+ this.motionDelay = input(...ngDevMode ? [void 0, { debugName: "motionDelay" }] : /* istanbul ignore next */ []);
22
+ this.motionEasing = input(...ngDevMode ? [void 0, { debugName: "motionEasing" }] : /* istanbul ignore next */ []);
23
+ this.motionEnterEasing = input(...ngDevMode ? [void 0, { debugName: "motionEnterEasing" }] : /* istanbul ignore next */ []);
24
+ this.motionLeaveEasing = input(...ngDevMode ? [void 0, { debugName: "motionLeaveEasing" }] : /* istanbul ignore next */ []);
25
+ this.motionDistance = input(...ngDevMode ? [void 0, { debugName: "motionDistance" }] : /* istanbul ignore next */ []);
26
+ this.motionScale = input(...ngDevMode ? [void 0, { debugName: "motionScale" }] : /* istanbul ignore next */ []);
27
+ this.motionDisabled = input(false, {
28
+ ...ngDevMode ? { debugName: "motionDisabled" } : /* istanbul ignore next */ {},
29
+ transform: booleanAttribute
30
+ });
31
+ this.motionOnInsert = input(false, {
32
+ ...ngDevMode ? { debugName: "motionOnInsert" } : /* istanbul ignore next */ {},
33
+ transform: booleanAttribute
34
+ });
35
+ this.enter = computed(() => this.motionDisabled() ? "" : motionEnterClass(this.preset()), ...ngDevMode ? [{ debugName: "enter" }] : /* istanbul ignore next */ []);
36
+ this.leave = computed(() => this.motionDisabled() ? "" : motionLeaveClass(this.preset()), ...ngDevMode ? [{ debugName: "leave" }] : /* istanbul ignore next */ []);
37
+ this._insertClass = computed(() => this.motionOnInsert() ? this.enter() : "", ...ngDevMode ? [{ debugName: "_insertClass" }] : /* istanbul ignore next */ []);
38
+ this._duration = computed(() => this.motionDuration() ?? null, ...ngDevMode ? [{ debugName: "_duration" }] : /* istanbul ignore next */ []);
39
+ this._delay = computed(() => this.motionDelay() ?? null, ...ngDevMode ? [{ debugName: "_delay" }] : /* istanbul ignore next */ []);
40
+ this._enterEasing = computed(() => this.motionEnterEasing() ?? this.motionEasing() ?? null, ...ngDevMode ? [{ debugName: "_enterEasing" }] : /* istanbul ignore next */ []);
41
+ this._leaveEasing = computed(() => this.motionLeaveEasing() ?? this.motionEasing() ?? null, ...ngDevMode ? [{ debugName: "_leaveEasing" }] : /* istanbul ignore next */ []);
42
+ this._distance = computed(() => this.motionDistance() ?? null, ...ngDevMode ? [{ debugName: "_distance" }] : /* istanbul ignore next */ []);
43
+ this._scale = computed(() => {
44
+ const s = this.motionScale();
45
+ return s === void 0 ? null : String(s);
46
+ }, ...ngDevMode ? [{ debugName: "_scale" }] : /* istanbul ignore next */ []);
47
+ }
48
+ static {
49
+ this.ɵfac = i0.ɵɵngDeclareFactory({
50
+ minVersion: "12.0.0",
51
+ version: "22.3.0",
52
+ ngImport: i0,
53
+ type: UiMotion,
54
+ deps: [],
55
+ target: i0.ɵɵFactoryTarget.Directive
56
+ });
57
+ }
58
+ static {
59
+ this.ɵdir = i0.ɵɵngDeclareDirective({
60
+ minVersion: "17.1.0",
61
+ version: "22.3.0",
62
+ type: UiMotion,
63
+ isStandalone: true,
64
+ selector: "[uiMotion]",
65
+ inputs: {
66
+ preset: {
67
+ classPropertyName: "preset",
68
+ publicName: "uiMotion",
69
+ isSignal: true,
70
+ isRequired: true,
71
+ transformFunction: null
72
+ },
73
+ motionDuration: {
74
+ classPropertyName: "motionDuration",
75
+ publicName: "motionDuration",
76
+ isSignal: true,
77
+ isRequired: false,
78
+ transformFunction: null
79
+ },
80
+ motionDelay: {
81
+ classPropertyName: "motionDelay",
82
+ publicName: "motionDelay",
83
+ isSignal: true,
84
+ isRequired: false,
85
+ transformFunction: null
86
+ },
87
+ motionEasing: {
88
+ classPropertyName: "motionEasing",
89
+ publicName: "motionEasing",
90
+ isSignal: true,
91
+ isRequired: false,
92
+ transformFunction: null
93
+ },
94
+ motionEnterEasing: {
95
+ classPropertyName: "motionEnterEasing",
96
+ publicName: "motionEnterEasing",
97
+ isSignal: true,
98
+ isRequired: false,
99
+ transformFunction: null
100
+ },
101
+ motionLeaveEasing: {
102
+ classPropertyName: "motionLeaveEasing",
103
+ publicName: "motionLeaveEasing",
104
+ isSignal: true,
105
+ isRequired: false,
106
+ transformFunction: null
107
+ },
108
+ motionDistance: {
109
+ classPropertyName: "motionDistance",
110
+ publicName: "motionDistance",
111
+ isSignal: true,
112
+ isRequired: false,
113
+ transformFunction: null
114
+ },
115
+ motionScale: {
116
+ classPropertyName: "motionScale",
117
+ publicName: "motionScale",
118
+ isSignal: true,
119
+ isRequired: false,
120
+ transformFunction: null
121
+ },
122
+ motionDisabled: {
123
+ classPropertyName: "motionDisabled",
124
+ publicName: "motionDisabled",
125
+ isSignal: true,
126
+ isRequired: false,
127
+ transformFunction: null
128
+ },
129
+ motionOnInsert: {
130
+ classPropertyName: "motionOnInsert",
131
+ publicName: "motionOnInsert",
132
+ isSignal: true,
133
+ isRequired: false,
134
+ transformFunction: null
135
+ }
136
+ },
137
+ host: { properties: {
138
+ "class": "_insertClass()",
139
+ "style.--ui-motion-duration": "_duration()",
140
+ "style.--ui-motion-delay": "_delay()",
141
+ "style.--ui-motion-easing-enter": "_enterEasing()",
142
+ "style.--ui-motion-easing-leave": "_leaveEasing()",
143
+ "style.--ui-motion-distance": "_distance()",
144
+ "style.--ui-motion-scale": "_scale()"
145
+ } },
146
+ exportAs: ["uiMotion"],
147
+ ngImport: i0
148
+ });
149
+ }
150
+ };
151
+ i0.ɵɵngDeclareClassMetadata({
152
+ minVersion: "12.0.0",
153
+ version: "22.3.0",
154
+ ngImport: i0,
155
+ type: UiMotion,
156
+ decorators: [{
157
+ type: Directive,
158
+ args: [{
159
+ selector: "[uiMotion]",
160
+ exportAs: "uiMotion",
161
+ host: {
162
+ "[class]": "_insertClass()",
163
+ "[style.--ui-motion-duration]": "_duration()",
164
+ "[style.--ui-motion-delay]": "_delay()",
165
+ "[style.--ui-motion-easing-enter]": "_enterEasing()",
166
+ "[style.--ui-motion-easing-leave]": "_leaveEasing()",
167
+ "[style.--ui-motion-distance]": "_distance()",
168
+ "[style.--ui-motion-scale]": "_scale()"
169
+ }
170
+ }]
171
+ }],
172
+ propDecorators: {
173
+ preset: [{
174
+ type: i0.Input,
175
+ args: [{
176
+ isSignal: true,
177
+ alias: "uiMotion",
178
+ required: true
179
+ }]
180
+ }],
181
+ motionDuration: [{
182
+ type: i0.Input,
183
+ args: [{
184
+ isSignal: true,
185
+ alias: "motionDuration",
186
+ required: false
187
+ }]
188
+ }],
189
+ motionDelay: [{
190
+ type: i0.Input,
191
+ args: [{
192
+ isSignal: true,
193
+ alias: "motionDelay",
194
+ required: false
195
+ }]
196
+ }],
197
+ motionEasing: [{
198
+ type: i0.Input,
199
+ args: [{
200
+ isSignal: true,
201
+ alias: "motionEasing",
202
+ required: false
203
+ }]
204
+ }],
205
+ motionEnterEasing: [{
206
+ type: i0.Input,
207
+ args: [{
208
+ isSignal: true,
209
+ alias: "motionEnterEasing",
210
+ required: false
211
+ }]
212
+ }],
213
+ motionLeaveEasing: [{
214
+ type: i0.Input,
215
+ args: [{
216
+ isSignal: true,
217
+ alias: "motionLeaveEasing",
218
+ required: false
219
+ }]
220
+ }],
221
+ motionDistance: [{
222
+ type: i0.Input,
223
+ args: [{
224
+ isSignal: true,
225
+ alias: "motionDistance",
226
+ required: false
227
+ }]
228
+ }],
229
+ motionScale: [{
230
+ type: i0.Input,
231
+ args: [{
232
+ isSignal: true,
233
+ alias: "motionScale",
234
+ required: false
235
+ }]
236
+ }],
237
+ motionDisabled: [{
238
+ type: i0.Input,
239
+ args: [{
240
+ isSignal: true,
241
+ alias: "motionDisabled",
242
+ required: false
243
+ }]
244
+ }],
245
+ motionOnInsert: [{
246
+ type: i0.Input,
247
+ args: [{
248
+ isSignal: true,
249
+ alias: "motionOnInsert",
250
+ required: false
251
+ }]
252
+ }]
253
+ }
254
+ });
154
255
  export { UI_MOTION_PRESETS, UiMotion, motionEnterClass, motionLeaveClass };
155
- //# sourceMappingURL=4sh-ui-kit-motion.mjs.map
256
+
257
+ //# sourceMappingURL=4sh-ui-kit-motion.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"4sh-ui-kit-motion.mjs","sources":["../../../projects/ui-kit/motion/src/lib/ui-motion.ts","../../../projects/ui-kit/motion/src/public-api.ts","../../../projects/ui-kit/motion/src/4sh-ui-kit-motion.ts"],"sourcesContent":["import { booleanAttribute, computed, Directive, input } from '@angular/core';\n\n/**\n * Built-in motion presets. Each maps to a pair of global CSS classes\n * (`ui-motion-<preset>-enter` / `ui-motion-<preset>-leave`) defined in\n * `styles/base/_motion.scss`, compiled into the package's `styles.css`.\n *\n * - `fade` — opacity only (neutral).\n * - `slide-up` — rise + fade (toasts, tooltips above a trigger).\n * - `slide-down` — drop + fade (menus/dropdowns below a trigger).\n * - `slide-left` — enter from the right (drawers/panels).\n * - `slide-right` — enter from the left.\n * - `zoom` — scale + fade (modals, dialogs, popovers).\n * - `collapse` — grid-row height + fade (accordions, panels; needs a grid wrapper).\n */\nexport type UiMotionPreset =\n 'fade' | 'slide-up' | 'slide-down' | 'slide-left' | 'slide-right' | 'zoom' | 'collapse';\n\n/** All preset keys, in declaration order (handy for stories/docs). */\nexport const UI_MOTION_PRESETS: readonly UiMotionPreset[] = [\n 'fade',\n 'slide-up',\n 'slide-down',\n 'slide-left',\n 'slide-right',\n 'zoom',\n 'collapse',\n];\n\n/** CSS class to bind to `animate.enter` for a preset. */\nexport const motionEnterClass = (preset: UiMotionPreset): string => `ui-motion-${preset}-enter`;\n/** CSS class to bind to `animate.leave` for a preset. */\nexport const motionLeaveClass = (preset: UiMotionPreset): string => `ui-motion-${preset}-leave`;\n\n/**\n * uiMotion — ergonomic wiring for the motion system on a conditionally\n * rendered element (`@if`, `@for`, control-flow insert/remove).\n *\n * It selects an enter/leave **preset** and exposes the matching class names for\n * Angular's native `animate.enter` / `animate.leave`, while letting you re-time\n * a single instance through the `--ui-motion-*` custom properties — no extra\n * CSS. Set `motionDisabled` (or the global `data-motion=\"off\"` switch / the\n * user's reduced-motion preference) to opt out.\n *\n * The enter/leave bindings stay in the template (Angular resolves them at the\n * insertion/removal boundary); the directive supplies the class strings and the\n * timing variables:\n *\n * @example\n * ```html\n * @if (open()) {\n * <div class=\"panel\"\n * [uiMotion]=\"'zoom'\" #m=\"uiMotion\"\n * [animate.enter]=\"m.enter()\" [animate.leave]=\"m.leave()\">…</div>\n * }\n *\n * <!-- faster, custom easing, disabled on demand -->\n * <div [uiMotion]=\"'slide-down'\" motionDuration=\"120ms\"\n * [motionDisabled]=\"prefersStillness()\" #m=\"uiMotion\"\n * [animate.enter]=\"m.enter()\" [animate.leave]=\"m.leave()\">…</div>\n * ```\n */\n@Directive({\n selector: '[uiMotion]',\n exportAs: 'uiMotion',\n host: {\n '[class]': '_insertClass()',\n '[style.--ui-motion-duration]': '_duration()',\n '[style.--ui-motion-delay]': '_delay()',\n '[style.--ui-motion-easing-enter]': '_enterEasing()',\n '[style.--ui-motion-easing-leave]': '_leaveEasing()',\n '[style.--ui-motion-distance]': '_distance()',\n '[style.--ui-motion-scale]': '_scale()',\n },\n})\nexport class UiMotion {\n /** Motion preset (enter/leave pair). */\n preset = input.required<UiMotionPreset>({ alias: 'uiMotion' });\n /** Override the duration for this element (e.g. `\"120ms\"`). */\n motionDuration = input<string>();\n /** Override the delay before the animation starts (e.g. `\"40ms\"`). */\n motionDelay = input<string>();\n /** Override both enter and leave easing (CSS timing function). */\n motionEasing = input<string>();\n /** Override only the enter easing (falls back to `motionEasing`). */\n motionEnterEasing = input<string>();\n /** Override only the leave easing (falls back to `motionEasing`). */\n motionLeaveEasing = input<string>();\n /** Override the slide offset for the directional presets (e.g. `\"12px\"`). */\n motionDistance = input<string>();\n /** Override the start/end scale for the `zoom` preset (e.g. `0.9`). */\n motionScale = input<number | string>();\n /** Disable motion for this element (renders/removes with no animation). */\n motionDisabled = input(false, { transform: booleanAttribute });\n /**\n * Play the enter preset through a class the directive applies itself, instead\n * of binding `animate.enter` in the template — the preset classes are plain\n * CSS animations, they need no framework hook to run once on insertion.\n *\n * **Mandatory for anything rendered in a CDK overlay** (dropdown panels,\n * menus, popovers). `animate.enter` registers the node in Angular's animation\n * queue, and that queue is unwound through the injector when the node goes\n * away; if the application is torn down while the overlay is still attached,\n * the unwind throws (`NG0205`) in the middle of the teardown and everything\n * after it is skipped — including the overlay's own `dispose()`. The panel\n * then stays in the document, detached from its anchor, in the top-left\n * corner of whatever renders next. No queue, no orphan.\n *\n * Leave it off for content inserted by `@if` / `@for` in a normal view, where\n * `animate.enter` also buys the leave animation.\n */\n motionOnInsert = input(false, { transform: booleanAttribute });\n\n /** Class to bind to `animate.enter` (empty when disabled → instant appear). */\n readonly enter = computed(() => (this.motionDisabled() ? '' : motionEnterClass(this.preset())));\n /** Class to bind to `animate.leave` (empty when disabled → instant removal). */\n readonly leave = computed(() => (this.motionDisabled() ? '' : motionLeaveClass(this.preset())));\n\n /** @ignore Enter class applied by the directive in `motionOnInsert` mode. */\n protected readonly _insertClass = computed(() => (this.motionOnInsert() ? this.enter() : ''));\n /** @ignore */\n protected readonly _duration = computed(() => this.motionDuration() ?? null);\n /** @ignore */\n protected readonly _delay = computed(() => this.motionDelay() ?? null);\n /** @ignore */\n protected readonly _enterEasing = computed(\n () => this.motionEnterEasing() ?? this.motionEasing() ?? null,\n );\n /** @ignore */\n protected readonly _leaveEasing = computed(\n () => this.motionLeaveEasing() ?? this.motionEasing() ?? null,\n );\n /** @ignore */\n protected readonly _distance = computed(() => this.motionDistance() ?? null);\n /** @ignore */\n protected readonly _scale = computed(() => {\n const s = this.motionScale();\n return s === undefined ? null : String(s);\n });\n}\n","/*\n * Public API Surface of ui-kit/motion\n *\n * `UiMotion` directive + presets. The enter/leave CSS classes it toggles live\n * in the package's global stylesheet (`styles/base/_motion.scss` → `styles.css`), shipped with\n * the design tokens.\n */\n\nexport * from './lib/ui-motion';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;AAkBA;AACO,MAAM,iBAAiB,GAA8B;IAC1D,MAAM;IACN,UAAU;IACV,YAAY;IACZ,YAAY;IACZ,aAAa;IACb,MAAM;IACN,UAAU;;AAGZ;AACO,MAAM,gBAAgB,GAAG,CAAC,MAAsB,KAAa,CAAA,UAAA,EAAa,MAAM,CAAA,MAAA;AACvF;AACO,MAAM,gBAAgB,GAAG,CAAC,MAAsB,KAAa,CAAA,UAAA,EAAa,MAAM,CAAA,MAAA;AAEvF;;;;;;;;;;;;;;;;;;;;;;;;;;;A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A,yBAAA,EAAA,UAAA,EAAA,gCAAA,EAAA,gBAAA,EAAA,gCAAA,EAAA,gBAAA,EAAA,4BAAA,EAAA,aAAA,EAAA,yBAAA,EAAA,UAAA,EAAA,EAAA,EAAA,QAAA,EAAA,CAAA,UAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;2FAAR,QAAQ,EAAA,UAAA,EAAA,CAAA;kBAbpB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,YAAY;AACtB,oBAAA,QAAQ,EAAE,UAAU;AACpB,oBAAA,IAAI,EAAE;AACJ,wBAAA,SAAS,EAAE,gBAAgB;AAC3B,wBAAA,8BAA8B,EAAE,aAAa;AAC7C,wBAAA,2BAA2B,EAAE,UAAU;AACvC,wBAAA,kCAAkC,EAAE,gBAAgB;AACpD,wBAAA,kCAAkC,EAAE,gBAAgB;AACpD,wBAAA,8BAA8B,EAAE,aAAa;AAC7C,wBAAA,2BAA2B,EAAE,UAAU;AACxC,qBAAA;AACF,iBAAA;;;AC1ED;;;;;;AAMG;;ACNH;;AAEG;;"}
1
+ {"version":3,"file":"4sh-ui-kit-motion.mjs","names":[],"sources":["../../../projects/ui-kit/motion/src/lib/ui-motion.ts"],"sourcesContent":["import { booleanAttribute, computed, Directive, input } from '@angular/core';\n\n/**\n * Built-in motion presets. Each maps to a pair of global CSS classes\n * (`ui-motion-<preset>-enter` / `ui-motion-<preset>-leave`) defined in\n * `styles/base/_motion.scss`, compiled into the package's `styles.css`.\n *\n * - `fade` — opacity only (neutral).\n * - `slide-up` — rise + fade (toasts, tooltips above a trigger).\n * - `slide-down` — drop + fade (menus/dropdowns below a trigger).\n * - `slide-left` — enter from the right (drawers/panels).\n * - `slide-right` — enter from the left.\n * - `zoom` — scale + fade (modals, dialogs, popovers).\n * - `collapse` — grid-row height + fade (accordions, panels; needs a grid wrapper).\n */\nexport type UiMotionPreset =\n 'fade' | 'slide-up' | 'slide-down' | 'slide-left' | 'slide-right' | 'zoom' | 'collapse';\n\n/** All preset keys, in declaration order (handy for stories/docs). */\nexport const UI_MOTION_PRESETS: readonly UiMotionPreset[] = [\n 'fade',\n 'slide-up',\n 'slide-down',\n 'slide-left',\n 'slide-right',\n 'zoom',\n 'collapse',\n];\n\n/** CSS class to bind to `animate.enter` for a preset. */\nexport const motionEnterClass = (preset: UiMotionPreset): string => `ui-motion-${preset}-enter`;\n/** CSS class to bind to `animate.leave` for a preset. */\nexport const motionLeaveClass = (preset: UiMotionPreset): string => `ui-motion-${preset}-leave`;\n\n/**\n * uiMotion — ergonomic wiring for the motion system on a conditionally\n * rendered element (`@if`, `@for`, control-flow insert/remove).\n *\n * It selects an enter/leave **preset** and exposes the matching class names for\n * Angular's native `animate.enter` / `animate.leave`, while letting you re-time\n * a single instance through the `--ui-motion-*` custom properties — no extra\n * CSS. Set `motionDisabled` (or the global `data-motion=\"off\"` switch / the\n * user's reduced-motion preference) to opt out.\n *\n * The enter/leave bindings stay in the template (Angular resolves them at the\n * insertion/removal boundary); the directive supplies the class strings and the\n * timing variables:\n *\n * @example\n * ```html\n * @if (open()) {\n * <div class=\"panel\"\n * [uiMotion]=\"'zoom'\" #m=\"uiMotion\"\n * [animate.enter]=\"m.enter()\" [animate.leave]=\"m.leave()\">…</div>\n * }\n *\n * <!-- faster, custom easing, disabled on demand -->\n * <div [uiMotion]=\"'slide-down'\" motionDuration=\"120ms\"\n * [motionDisabled]=\"prefersStillness()\" #m=\"uiMotion\"\n * [animate.enter]=\"m.enter()\" [animate.leave]=\"m.leave()\">…</div>\n * ```\n */\n@Directive({\n selector: '[uiMotion]',\n exportAs: 'uiMotion',\n host: {\n '[class]': '_insertClass()',\n '[style.--ui-motion-duration]': '_duration()',\n '[style.--ui-motion-delay]': '_delay()',\n '[style.--ui-motion-easing-enter]': '_enterEasing()',\n '[style.--ui-motion-easing-leave]': '_leaveEasing()',\n '[style.--ui-motion-distance]': '_distance()',\n '[style.--ui-motion-scale]': '_scale()',\n },\n})\nexport class UiMotion {\n /** Motion preset (enter/leave pair). */\n preset = input.required<UiMotionPreset>({ alias: 'uiMotion' });\n /** Override the duration for this element (e.g. `\"120ms\"`). */\n motionDuration = input<string>();\n /** Override the delay before the animation starts (e.g. `\"40ms\"`). */\n motionDelay = input<string>();\n /** Override both enter and leave easing (CSS timing function). */\n motionEasing = input<string>();\n /** Override only the enter easing (falls back to `motionEasing`). */\n motionEnterEasing = input<string>();\n /** Override only the leave easing (falls back to `motionEasing`). */\n motionLeaveEasing = input<string>();\n /** Override the slide offset for the directional presets (e.g. `\"12px\"`). */\n motionDistance = input<string>();\n /** Override the start/end scale for the `zoom` preset (e.g. `0.9`). */\n motionScale = input<number | string>();\n /** Disable motion for this element (renders/removes with no animation). */\n motionDisabled = input(false, { transform: booleanAttribute });\n /**\n * Play the enter preset through a class the directive applies itself, instead\n * of binding `animate.enter` in the template — the preset classes are plain\n * CSS animations, they need no framework hook to run once on insertion.\n *\n * **Mandatory for anything rendered in a CDK overlay** (dropdown panels,\n * menus, popovers). `animate.enter` registers the node in Angular's animation\n * queue, and that queue is unwound through the injector when the node goes\n * away; if the application is torn down while the overlay is still attached,\n * the unwind throws (`NG0205`) in the middle of the teardown and everything\n * after it is skipped — including the overlay's own `dispose()`. The panel\n * then stays in the document, detached from its anchor, in the top-left\n * corner of whatever renders next. No queue, no orphan.\n *\n * Leave it off for content inserted by `@if` / `@for` in a normal view, where\n * `animate.enter` also buys the leave animation.\n */\n motionOnInsert = input(false, { transform: booleanAttribute });\n\n /** Class to bind to `animate.enter` (empty when disabled → instant appear). */\n readonly enter = computed(() => (this.motionDisabled() ? '' : motionEnterClass(this.preset())));\n /** Class to bind to `animate.leave` (empty when disabled → instant removal). */\n readonly leave = computed(() => (this.motionDisabled() ? '' : motionLeaveClass(this.preset())));\n\n /** @ignore Enter class applied by the directive in `motionOnInsert` mode. */\n protected readonly _insertClass = computed(() => (this.motionOnInsert() ? this.enter() : ''));\n /** @ignore */\n protected readonly _duration = computed(() => this.motionDuration() ?? null);\n /** @ignore */\n protected readonly _delay = computed(() => this.motionDelay() ?? null);\n /** @ignore */\n protected readonly _enterEasing = computed(\n () => this.motionEnterEasing() ?? this.motionEasing() ?? null,\n );\n /** @ignore */\n protected readonly _leaveEasing = computed(\n () => this.motionLeaveEasing() ?? this.motionEasing() ?? null,\n );\n /** @ignore */\n protected readonly _distance = computed(() => this.motionDistance() ?? null);\n /** @ignore */\n protected readonly _scale = computed(() => {\n const s = this.motionScale();\n return s === undefined ? null : String(s);\n });\n}\n"],"mappings":";;AAmBA,MAAa,oBAA+C;CAC1D;CACA;CACA;CACA;CACA;CACA;CACA;AACD;AAGD,MAAa,oBAAoB,WAAmC,aAAa,OAAM;AAEvF,MAAa,oBAAoB,WAAmC,aAAa,OAAM;AA2CvF,IAAa,WAAb,MAAa,SAAQ;CAbrB,cAAA;EAeE,KAAA,SAAS,MAAM,SAAQ;GAAA,GAAA,YAAA,EAAA,WAAA,SAAA,+BAAA,CAAA;GAAmB,OAAO;EAAU,CAAA;EAE3D,KAAA,iBAAiB,MAAe,GAAA,YAAA,CAAA,QAAA,EAAA,WAAA,iBAAA,CAAA,+BAAA,CAAA,CAAA;EAEhC,KAAA,cAAc,MAAe,GAAA,YAAA,CAAA,QAAA,EAAA,WAAA,cAAA,CAAA,+BAAA,CAAA,CAAA;EAE7B,KAAA,eAAe,MAAe,GAAA,YAAA,CAAA,QAAA,EAAA,WAAA,eAAA,CAAA,+BAAA,CAAA,CAAA;EAE9B,KAAA,oBAAoB,MAAe,GAAA,YAAA,CAAA,QAAA,EAAA,WAAA,oBAAA,CAAA,+BAAA,CAAA,CAAA;EAEnC,KAAA,oBAAoB,MAAe,GAAA,YAAA,CAAA,QAAA,EAAA,WAAA,oBAAA,CAAA,+BAAA,CAAA,CAAA;EAEnC,KAAA,iBAAiB,MAAe,GAAA,YAAA,CAAA,QAAA,EAAA,WAAA,iBAAA,CAAA,+BAAA,CAAA,CAAA;EAEhC,KAAA,cAAc,M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