@cngx/common 0.1.0-rc.9 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (88) hide show
  1. package/a11y/README.md +15 -2
  2. package/button/README.md +258 -0
  3. package/command/README.md +19 -8
  4. package/data/README.md +10 -10
  5. package/fesm2022/cngx-common-a11y.mjs +701 -263
  6. package/fesm2022/cngx-common-a11y.mjs.map +1 -1
  7. package/fesm2022/cngx-common-audio.mjs +83 -64
  8. package/fesm2022/cngx-common-audio.mjs.map +1 -1
  9. package/fesm2022/cngx-common-button.mjs +1084 -0
  10. package/fesm2022/cngx-common-button.mjs.map +1 -0
  11. package/fesm2022/cngx-common-card.mjs +135 -76
  12. package/fesm2022/cngx-common-card.mjs.map +1 -1
  13. package/fesm2022/cngx-common-chart.mjs +749 -296
  14. package/fesm2022/cngx-common-chart.mjs.map +1 -1
  15. package/fesm2022/cngx-common-command.mjs +51 -29
  16. package/fesm2022/cngx-common-command.mjs.map +1 -1
  17. package/fesm2022/cngx-common-data.mjs +695 -405
  18. package/fesm2022/cngx-common-data.mjs.map +1 -1
  19. package/fesm2022/cngx-common-dialog.mjs +112 -112
  20. package/fesm2022/cngx-common-dialog.mjs.map +1 -1
  21. package/fesm2022/cngx-common-display.mjs +668 -308
  22. package/fesm2022/cngx-common-display.mjs.map +1 -1
  23. package/fesm2022/cngx-common-interactive.mjs +7066 -2739
  24. package/fesm2022/cngx-common-interactive.mjs.map +1 -1
  25. package/fesm2022/cngx-common-layout.mjs +2121 -492
  26. package/fesm2022/cngx-common-layout.mjs.map +1 -1
  27. package/fesm2022/cngx-common-menu-button.mjs +557 -0
  28. package/fesm2022/cngx-common-menu-button.mjs.map +1 -0
  29. package/fesm2022/cngx-common-popover.mjs +1207 -569
  30. package/fesm2022/cngx-common-popover.mjs.map +1 -1
  31. package/fesm2022/cngx-common-stepper.mjs +256 -261
  32. package/fesm2022/cngx-common-stepper.mjs.map +1 -1
  33. package/fesm2022/cngx-common-tabs.mjs +202 -262
  34. package/fesm2022/cngx-common-tabs.mjs.map +1 -1
  35. package/fesm2022/cngx-common-timeline.mjs +28 -61
  36. package/fesm2022/cngx-common-timeline.mjs.map +1 -1
  37. package/fesm2022/cngx-common.mjs +10 -10
  38. package/fesm2022/cngx-common.mjs.map +1 -1
  39. package/interactive/README.md +30 -19
  40. package/layout/README.md +1 -1
  41. package/menu-button/README.md +234 -0
  42. package/package.json +14 -4
  43. package/popover/README.md +42 -5
  44. package/popover/tooltip-indicator.scss +52 -0
  45. package/schematics/ng-add/index.js +7 -7
  46. package/schematics/ng-add/schema.json +5 -0
  47. package/stepper/README.md +0 -1
  48. package/theming/components/cngx-accordion.css +36 -7
  49. package/theming/components/cngx-async.css +185 -37
  50. package/theming/components/cngx-backdrop.css +3 -1
  51. package/theming/components/cngx-badge.css +20 -5
  52. package/theming/components/cngx-bottom-sheet.css +2 -0
  53. package/theming/components/cngx-breadcrumb.css +3 -1
  54. package/theming/components/cngx-button-group.css +325 -0
  55. package/theming/components/cngx-button-toggle.css +55 -23
  56. package/theming/components/cngx-button.css +975 -0
  57. package/theming/components/cngx-data-grid.css +2 -0
  58. package/theming/components/cngx-dialog.css +3 -1
  59. package/theming/components/cngx-divider.css +24 -9
  60. package/theming/components/cngx-drawer.css +153 -0
  61. package/theming/components/cngx-icon-glyph.css +76 -0
  62. package/theming/components/cngx-listbox.css +79 -25
  63. package/theming/components/cngx-menu.css +112 -52
  64. package/theming/components/cngx-nav.css +1220 -0
  65. package/theming/components/cngx-popover-sheet.css +43 -11
  66. package/theming/components/cngx-popover.css +37 -13
  67. package/theming/components/cngx-recycler-placeholder.css +2 -0
  68. package/theming/components/cngx-ripple.css +74 -16
  69. package/theming/components/cngx-sidebar.css +71 -0
  70. package/theming/components/cngx-slider.css +3 -1
  71. package/theming/components/cngx-tooltip.css +2 -0
  72. package/timeline/README.md +2 -2
  73. package/types/cngx-common-a11y.d.ts +343 -120
  74. package/types/cngx-common-audio.d.ts +60 -88
  75. package/types/cngx-common-button.d.ts +698 -0
  76. package/types/cngx-common-card.d.ts +104 -78
  77. package/types/cngx-common-chart.d.ts +671 -384
  78. package/types/cngx-common-command.d.ts +44 -47
  79. package/types/cngx-common-data.d.ts +350 -342
  80. package/types/cngx-common-dialog.d.ts +91 -120
  81. package/types/cngx-common-display.d.ts +475 -300
  82. package/types/cngx-common-interactive.d.ts +4350 -1723
  83. package/types/cngx-common-layout.d.ts +1365 -286
  84. package/types/cngx-common-menu-button.d.ts +382 -0
  85. package/types/cngx-common-popover.d.ts +671 -289
  86. package/types/cngx-common-stepper.d.ts +217 -347
  87. package/types/cngx-common-tabs.d.ts +173 -386
  88. package/types/cngx-common-timeline.d.ts +25 -104
@@ -1,22 +1,22 @@
1
1
  import * as _angular_core from '@angular/core';
2
2
  import { ElementRef, Signal, InjectionToken, Provider, TemplateRef } from '@angular/core';
3
- import * as i1 from '@cngx/common/a11y';
4
- import { CngxFocusTrapDriver, AriaLivePoliteness } from '@cngx/common/a11y';
5
3
  import * as _cngx_core_utils from '@cngx/core/utils';
6
4
  import { SlotRegistry, KeyedRegistry, CngxAsyncState, AsyncStatus } from '@cngx/core/utils';
7
- import { AsyncAction, CngxPending, CngxSucceeded, CngxFailed } from '@cngx/common/interactive';
8
- import * as i1$1 from '@cngx/common/display';
5
+ import * as i1 from '@cngx/common/a11y';
6
+ import { CngxFocusTrapDriver, AriaLivePoliteness } from '@cngx/common/a11y';
7
+ import { AsyncView } from '@cngx/common/data';
8
+ import * as i2 from '@cngx/common/interactive';
9
+ import { CngxAnnouncementCover } from '@cngx/common/interactive';
10
+ import * as i1$1 from '@cngx/common/button';
11
+ import { CngxButtonBrain, CngxButtonStart, CngxButtonEnd } from '@cngx/common/button';
12
+ import * as i1$2 from '@cngx/common/display';
9
13
 
10
14
  /**
11
15
  * Lifecycle state of a popover element.
12
- *
13
- * @category common/popover
14
16
  */
15
17
  type PopoverState = 'closed' | 'opening' | 'open' | 'closing';
16
18
  /**
17
19
  * Native popover attribute mode.
18
- *
19
- * @category common/popover
20
20
  */
21
21
  type PopoverMode = 'manual' | 'auto';
22
22
  /**
@@ -25,14 +25,10 @@ type PopoverMode = 'manual' | 'auto';
25
25
  * compatibility value. Composers (such as `CngxPopoverPanel`) write the
26
26
  * popover's `haspopup` signal to hint the trigger toward the right value
27
27
  * without forcing the consumer to repeat it.
28
- *
29
- * @category common/popover
30
28
  */
31
29
  type PopoverHaspopup = 'dialog' | 'listbox' | 'menu' | 'tree' | 'true';
32
30
  /**
33
31
  * ARIA roles applicable to a `CngxPopoverPanel` host element.
34
- *
35
- * @category common/popover
36
32
  */
37
33
  type PopoverPanelRole = 'dialog' | 'alertdialog' | 'tooltip' | 'menu' | 'group' | 'region';
38
34
  /**
@@ -40,8 +36,6 @@ type PopoverPanelRole = 'dialog' | 'alertdialog' | 'tooltip' | 'menu' | 'group'
40
36
  * driven shift / flip recovery. Driven by `CngxPopover.resolvedEdge`;
41
37
  * consumers projecting a `cngxPopoverArrow` template receive this value in
42
38
  * the slot context so they can rotate or position their glyph accordingly.
43
- *
44
- * @category common/popover
45
39
  */
46
40
  type ArrowEdge = 'top' | 'bottom' | 'left' | 'right';
47
41
  /**
@@ -53,14 +47,10 @@ type ArrowEdge = 'top' | 'bottom' | 'left' | 'right';
53
47
  * - `'manual'` - hover and focus are inert. Only `show()` / `hide()`
54
48
  * open or close the tooltip. Escape still dismisses an open tooltip
55
49
  * for keyboard accessibility.
56
- *
57
- * @category common/popover
58
50
  */
59
51
  type TooltipTriggerMode = 'auto' | 'manual';
60
52
  /**
61
53
  * Anchor-relative placement of a popover.
62
- *
63
- * @category common/popover
64
54
  */
65
55
  type PopoverPlacement = 'top' | 'top-start' | 'top-end' | 'bottom' | 'bottom-start' | 'bottom-end' | 'left' | 'left-start' | 'left-end' | 'right' | 'right-start' | 'right-end';
66
56
  /**
@@ -78,8 +68,6 @@ type PopoverPlacement = 'top' | 'top-start' | 'top-end' | 'bottom' | 'bottom-sta
78
68
  * Mirrors the precedent in `projects/forms/select/shared/select-base.css`
79
69
  * which already ships `position-try-fallbacks: flip-block, flip-inline,
80
70
  * flip-block flip-inline;` on select panels.
81
- *
82
- * @category common/popover
83
71
  */
84
72
  type PopoverPositionTryFallback = 'flip-block' | 'flip-inline' | 'flip-start' | 'flip-block flip-inline' | 'flip-inline flip-block' | 'flip-block flip-start' | 'flip-start flip-block' | 'flip-inline flip-start' | 'flip-start flip-inline' | 'flip-block flip-inline flip-start';
85
73
 
@@ -93,6 +81,8 @@ type PopoverPositionTryFallback = 'flip-block' | 'flip-inline' | 'flip-start' |
93
81
  * State lifecycle: `closed` → `opening` → `open` → `closing` → `closed`.
94
82
  * CSS classes `cngx-popover--opening`, `cngx-popover--open`, and
95
83
  * `cngx-popover--closing` are applied to the host for transition hooks.
84
+ * The host is `inert` while `closing`, so a reader and a pointer skip a
85
+ * panel that is fading out.
96
86
  *
97
87
  * ### Declarative click popover
98
88
  * ```html
@@ -108,11 +98,11 @@ type PopoverPositionTryFallback = 'flip-block' | 'flip-inline' | 'flip-start' |
108
98
  * {{ errorSummary() }}
109
99
  * </div>
110
100
  * ```
111
- * <example-url>http://localhost:4200/#/common/interactive/listbox/trigger/select-dropdown</example-url>
112
- * <example-url>http://localhost:4200/#/common/popover/click-popover</example-url>
113
- * <example-url>http://localhost:4200/#/common/popover/controlled-open</example-url>
114
- * <example-url>http://localhost:4200/#/common/popover/escape-mode</example-url>
115
- * <example-url>http://localhost:4200/#/common/popover/placement-variants</example-url>
101
+ * <example-url>/#/common/interactive/listbox/trigger/select-dropdown</example-url>
102
+ * <example-url>/#/common/popover/click-popover</example-url>
103
+ * <example-url>/#/common/popover/controlled-open</example-url>
104
+ * <example-url>/#/common/popover/escape-mode</example-url>
105
+ * <example-url>/#/common/popover/placement-variants</example-url>
116
106
  *
117
107
  * ### Collision recovery with `<try-tactic>` fallbacks
118
108
  * Apply CSS Anchor Positioning's `position-try-fallbacks` declaratively
@@ -133,12 +123,11 @@ type PopoverPositionTryFallback = 'flip-block' | 'flip-inline' | 'flip-start' |
133
123
  * `position-try-fallbacks` style - the browser positions the popover at
134
124
  * the declared `placement` regardless of viewport clipping.
135
125
  *
136
- * @category common/popover
137
- * @docsKind primary
138
126
  * @wcag AA
139
127
  * @github https://github.com/cngxjs/cngx/blob/main/projects/common/popover/popover.directive.ts
140
- * @since 0.1.0
128
+ * @since 0.3.0
141
129
  * @relatedTo CngxPopoverTrigger, CngxPopoverPanel, CngxTooltip
130
+ * @axis level molecule
142
131
  */
143
132
  declare class CngxPopover {
144
133
  /**
@@ -158,6 +147,7 @@ declare class CngxPopover {
158
147
  private readonly _injector;
159
148
  private readonly direction;
160
149
  private pendingClose;
150
+ private ownsFadeInert;
161
151
  /**
162
152
  * Arrow-bounds contract resolved lazily on first use.
163
153
  * Eager inject() would loop: CngxPopover (host directive on the panel)
@@ -185,20 +175,32 @@ declare class CngxPopover {
185
175
  /** Anchor-relative placement. */
186
176
  readonly placement: _angular_core.InputSignal<PopoverPlacement>;
187
177
  /**
188
- * CSS `<try-tactic>` fallbacks for `position-try-fallbacks`. Empty
189
- * array (default) means the host does not write the property at all.
190
- * Non-empty entries are written verbatim, comma-joined, in declaration
191
- * order. Spec-compatible vocabulary only (no cngx placement tokens).
178
+ * CSS `<try-tactic>` fallbacks for `position-try-fallbacks`. Unbound
179
+ * (default) defers to a composer claim ({@link claimPositionTryFallbacks},
180
+ * a menu trigger claims a flip chain), else writes nothing. A bound
181
+ * empty array writes nothing and opts out of every claim. Non-empty
182
+ * entries are written verbatim, comma-joined, in declaration order.
183
+ * Spec-compatible vocabulary only (no cngx placement tokens).
192
184
  */
193
- readonly positionTryFallbacks: _angular_core.InputSignal<readonly PopoverPositionTryFallback[]>;
185
+ readonly positionTryFallbacks: _angular_core.InputSignal<readonly PopoverPositionTryFallback[] | undefined>;
194
186
  /**
195
187
  * Gap between anchor and popover in px, on the placement's main axis
196
188
  * (block axis for `top` / `bottom`, inline axis for `left` / `right`);
197
189
  * the cross axis stays flush. Same on both positioning engines.
198
190
  */
199
191
  readonly offset: _angular_core.InputSignal<number>;
200
- /** Whether Escape key dismisses the popover. */
201
- readonly closeOnEscape: _angular_core.InputSignal<boolean>;
192
+ /**
193
+ * Whether Escape key dismisses the popover. Bind a `Signal<boolean>` (not
194
+ * its value) when the gate flips inside an event handler: the popover then
195
+ * reads it at keydown time, so an Escape right after the flip, before the
196
+ * next change detection, already sees the new value.
197
+ */
198
+ readonly closeOnEscape: _angular_core.InputSignal<boolean | Signal<boolean>>;
199
+ /**
200
+ * Current Escape gate, resolved from {@link closeOnEscape}. Read it instead
201
+ * of the input: a bound signal is read live.
202
+ */
203
+ readonly escapeEnabled: Signal<boolean>;
202
204
  /**
203
205
  * Whether a `pointerdown` outside both the popover and its anchor (trigger)
204
206
  * dismisses it - menu / listbox light-dismiss. Opt-in (default `false`) so
@@ -225,6 +227,20 @@ declare class CngxPopover {
225
227
  * never evicts its ancestor.
226
228
  */
227
229
  readonly exclusive: _angular_core.InputSignal<boolean>;
230
+ /**
231
+ * Emits once each time the popover opens: at the end of `show()`, in the
232
+ * caller's task, after the native `showPopover()` call. A `show()` that
233
+ * returns early (already open, no Popover API) emits nothing. Bind it to
234
+ * react to the open as an event instead of watching `state` in an effect.
235
+ */
236
+ readonly opened: _angular_core.OutputEmitterRef<void>;
237
+ /**
238
+ * Emits once each time the popover reaches `closed`: after `hide()` (at
239
+ * the end of the exit transition when there is one) and after the
240
+ * browser's own light dismiss. A no-op `hide()` and the teardown on
241
+ * destroy emit nothing.
242
+ */
243
+ readonly closed: _angular_core.OutputEmitterRef<void>;
228
244
  /**
229
245
  * Programmatic override of {@link exclusive}. `null` (default) defers to the
230
246
  * `[exclusive]` input; a boolean wins over it. Lets a composing organism
@@ -238,7 +254,7 @@ declare class CngxPopover {
238
254
  * @internal Read-only view of the programmatic {@link exclusive} override.
239
255
  * Written via {@link setExclusiveOverride}.
240
256
  */
241
- readonly exclusiveOverride: _angular_core.Signal<boolean | null>;
257
+ readonly exclusiveOverride: Signal<boolean | null>;
242
258
  /** Effective exclusivity - override wins, else the `[exclusive]` input. */
243
259
  private readonly effectiveExclusive;
244
260
  /**
@@ -254,7 +270,7 @@ declare class CngxPopover {
254
270
  * @internal Read-only view of the programmatic {@link placement} override.
255
271
  * Written via {@link setPlacementOverride}.
256
272
  */
257
- readonly placementOverride: _angular_core.Signal<PopoverPlacement | null>;
273
+ readonly placementOverride: Signal<PopoverPlacement | null>;
258
274
  /**
259
275
  * Effective placement for the CSS-anchor path - override wins, else the
260
276
  * `[placement]` input, then fully mirrored against the ambient writing
@@ -277,22 +293,28 @@ declare class CngxPopover {
277
293
  /**
278
294
  * Programmatic override of {@link positionTryFallbacks}, paired with
279
295
  * {@link placementOverride} so a submenu wiring installs the flip chain too.
280
- * `null` (default) defers to the `[positionTryFallbacks]` input.
296
+ * `null` (default) defers to the `[positionTryFallbacks]` input, then to
297
+ * the last live composer claim ({@link claimPositionTryFallbacks}).
281
298
  */
282
299
  private readonly positionTryFallbacksOverrideState;
283
300
  /**
284
301
  * @internal Read-only view of the programmatic {@link positionTryFallbacks}
285
302
  * override. Written via {@link setPositionTryFallbacksOverride}.
286
303
  */
287
- readonly positionTryFallbacksOverride: _angular_core.Signal<readonly PopoverPositionTryFallback[] | null>;
288
- /** Effective try-fallbacks - override wins, else the `[positionTryFallbacks]` input. */
304
+ readonly positionTryFallbacksOverride: Signal<readonly PopoverPositionTryFallback[] | null>;
305
+ /** Owner-keyed claims behind the composer default of {@link positionTryFallbacks}. */
306
+ private readonly positionTryFallbacksClaims;
307
+ /**
308
+ * Effective try-fallbacks: the override, else the `[positionTryFallbacks]`
309
+ * input, else the last live composer claim, else none.
310
+ */
289
311
  private readonly effectivePositionTryFallbacks;
290
312
  private readonly stateSignal;
291
313
  private readonly idSignal;
292
314
  /** Current lifecycle state. */
293
- readonly state: _angular_core.Signal<PopoverState>;
315
+ readonly state: Signal<PopoverState>;
294
316
  /** Unique auto-generated ID for this popover instance. */
295
- readonly id: _angular_core.Signal<string>;
317
+ readonly id: Signal<string>;
296
318
  /** Backing state for {@link focusOrigin}. */
297
319
  private readonly focusOriginState;
298
320
  /**
@@ -302,12 +324,25 @@ declare class CngxPopover {
302
324
  * `CngxPopoverTrigger`'s `restoreFocus` reads it as the restore
303
325
  * target; cleared on finalize.
304
326
  */
305
- readonly focusOrigin: _angular_core.Signal<HTMLElement | null>;
327
+ readonly focusOrigin: Signal<HTMLElement | null>;
328
+ /**
329
+ * @internal Single close-listener slot, claimed by `CngxPopoverTrigger`
330
+ * through {@link registerCloseListener}. Last registration wins, like the
331
+ * implicit anchor slot: one trigger per popover.
332
+ */
333
+ private readonly closeListenerSlot;
306
334
  /**
307
335
  * Implicit anchor slot, written by `CngxPopoverTrigger` and composing
308
336
  * organisms via {@link setAnchorElement}.
309
337
  */
310
338
  private readonly anchorElementState;
339
+ /**
340
+ * @internal The implicit anchor ({@link setAnchorElement}) even while an
341
+ * explicit anchor shadows it. Read by `CngxPopoverSheet` only: its focus
342
+ * fallback needs a focusable opener when the explicit anchor is a
343
+ * non-focusable box.
344
+ */
345
+ readonly implicitAnchorElement: Signal<HTMLElement | null>;
311
346
  /** Explicit anchor slot, claimed by `CngxPopoverAnchor`. */
312
347
  private readonly explicitAnchorElementSlot;
313
348
  /**
@@ -316,7 +351,7 @@ declare class CngxPopover {
316
351
  * the implicit anchor and `CngxPopoverTrigger` yields its
317
352
  * `anchor-name`.
318
353
  */
319
- readonly explicitAnchorElement: _angular_core.Signal<HTMLElement | null>;
354
+ readonly explicitAnchorElement: Signal<HTMLElement | null>;
320
355
  /**
321
356
  * The anchor element for Floating UI fallback positioning, the
322
357
  * arrow-offset geometry and the outside-click guard. Precedence: the
@@ -324,7 +359,7 @@ declare class CngxPopover {
324
359
  * wins over the implicit one ({@link setAnchorElement},
325
360
  * `CngxPopoverTrigger` or a composing organism).
326
361
  */
327
- readonly anchorElement: _angular_core.Signal<HTMLElement | null>;
362
+ readonly anchorElement: Signal<HTMLElement | null>;
328
363
  /**
329
364
  * Inline-axis position the arrow ornament should sit at, expressed as
330
365
  * a CSS length pinned to the anchor's centre. Computed from
@@ -346,22 +381,46 @@ declare class CngxPopover {
346
381
  * `cngxPopoverArrow` template use this to render their own glyph at
347
382
  * the same coordinate the default arrow ornament would.
348
383
  */
349
- readonly arrowOffset: _angular_core.Signal<string | null>;
350
- /** Backing state for {@link haspopup}. */
351
- private readonly haspopupState;
384
+ readonly arrowOffset: Signal<string | null>;
385
+ /** Owner-keyed claims behind {@link haspopup}. */
386
+ private readonly haspopupClaims;
352
387
  /**
353
388
  * Hint for the `CngxPopoverTrigger`'s `aria-haspopup` value. Composers
354
- * such as `CngxPopoverPanel` install it via {@link setHaspopup} so any
389
+ * such as `CngxPopoverPanel` claim it via {@link claimHaspopup} so any
355
390
  * trigger pointing at the popover defaults to the right role without
356
- * the consumer having to set `haspopup` on every trigger element.
357
- * Consumer-supplied `haspopup` on the trigger still wins.
358
- */
359
- readonly haspopup: _angular_core.Signal<PopoverHaspopup | undefined>;
360
- protected readonly isOpening: _angular_core.Signal<boolean>;
361
- protected readonly isOpen: _angular_core.Signal<boolean>;
362
- protected readonly isClosing: _angular_core.Signal<boolean>;
363
- readonly isVisible: _angular_core.Signal<boolean>;
364
- protected readonly cssAnchorRef: _angular_core.Signal<string | null>;
391
+ * the consumer having to set `haspopup` on every trigger element. With
392
+ * several composers the last live claim wins, and a release keeps the
393
+ * others. Consumer-supplied `haspopup` on the trigger still wins.
394
+ */
395
+ readonly haspopup: Signal<PopoverHaspopup | undefined>;
396
+ /** Owner-keyed claims behind {@link controlsHint}: each holds an id source. */
397
+ private readonly controlsClaims;
398
+ /**
399
+ * Hint for the `CngxPopoverTrigger`'s `aria-controls` value: the id of the
400
+ * popup element inside the popover (a `role="menu"`), read from the source
401
+ * a composer claims via {@link claimControls}. Derived, so a change of
402
+ * that source id reaches every trigger without another claim. The last
403
+ * live claim wins. `null` in a sheet or fullscreen presentation, where the
404
+ * popup is the dialog itself, so the trigger names the popover. A
405
+ * `controls` bound on the trigger still wins.
406
+ */
407
+ readonly controlsHint: Signal<string | null>;
408
+ /** Owner-keyed claims behind {@link restoreFocusHint}. */
409
+ private readonly restoreFocusClaims;
410
+ /**
411
+ * Hint for the `CngxPopoverTrigger`'s focus return on close, used when the
412
+ * trigger binds no `[restoreFocus]`. Composers claim it via
413
+ * {@link claimRestoreFocus}: `CngxPopoverPanel` claims `true` (dialog
414
+ * pattern), a menu trigger claims `false` because its focus stack restores.
415
+ * The last live claim wins. `false` in a sheet or fullscreen presentation,
416
+ * where `CngxPopoverSheet` restores focus itself.
417
+ */
418
+ readonly restoreFocusHint: Signal<boolean | undefined>;
419
+ protected readonly isOpening: Signal<boolean>;
420
+ protected readonly isOpen: Signal<boolean>;
421
+ protected readonly isClosing: Signal<boolean>;
422
+ readonly isVisible: Signal<boolean>;
423
+ protected readonly cssAnchorRef: Signal<string | null>;
365
424
  /**
366
425
  * Primary edge of the placement, written from the live trigger and panel
367
426
  * rects so the arrow lands on the side that actually faces the trigger.
@@ -378,18 +437,30 @@ declare class CngxPopover {
378
437
  * so consumers projecting a `cngxPopoverArrow` template can rotate
379
438
  * their own glyph to match the rendered placement.
380
439
  */
381
- readonly resolvedEdge: _angular_core.Signal<ArrowEdge>;
382
- protected readonly cssMargin: _angular_core.Signal<string | null>;
440
+ readonly resolvedEdge: Signal<ArrowEdge>;
441
+ protected readonly cssMargin: Signal<string | null>;
442
+ /**
443
+ * The same offset as one length, for `calc()` consumers: the margin above
444
+ * is a shorthand (`8px 0`) and cannot be multiplied. The sheet skin caps
445
+ * an anchored sheet with it.
446
+ */
447
+ protected readonly cssOffset: Signal<string | null>;
383
448
  /**
384
449
  * Comma-joined `position-try-fallbacks` value, or `null` to skip the
385
- * style write. Bound via host binding so empty / cleared lists drop the
386
- * property cleanly. Unsupported browsers ignore the unknown property -
387
- * gating on `SUPPORTS_ANCHOR` would only suppress a harmless write.
450
+ * style write. Written by `writeAnchorPlacement()` so empty / cleared lists
451
+ * drop the property cleanly. Unsupported browsers ignore the unknown
452
+ * property - gating on `SUPPORTS_ANCHOR` would only suppress a harmless write.
388
453
  */
389
- protected readonly cssPositionTryFallbacks: _angular_core.Signal<string | null>;
454
+ protected readonly cssPositionTryFallbacks: Signal<string | null>;
390
455
  constructor();
391
456
  /** Open the popover. No-op if not `closed`. */
392
457
  show(): void;
458
+ /**
459
+ * Writes `position-area`, `position-try-fallbacks` and the anchor margin from
460
+ * their computeds. `position-area` goes through a style call because its
461
+ * property name differs per browser (`ANCHOR_AREA_PROPERTY`).
462
+ */
463
+ private writeAnchorPlacement;
393
464
  /** Close the popover. No-op if already `closed` or `closing`. */
394
465
  hide(): void;
395
466
  /** Toggle between open and closed. */
@@ -422,11 +493,69 @@ declare class CngxPopover {
422
493
  */
423
494
  unregisterAnchorElement(element: HTMLElement): void;
424
495
  /**
425
- * Install the `aria-haspopup` hint triggers fall back to when the
426
- * consumer sets none. Composers (`CngxPopoverPanel`, menu wirings)
427
- * call this once at construction; `undefined` clears the hint.
496
+ * Claim the `aria-haspopup` hint triggers fall back to when the consumer
497
+ * sets none. Composers (`CngxPopoverPanel`, menu wirings) claim with
498
+ * themselves as `owner` and release on destroy. The last live claim wins;
499
+ * a re-claim by the same owner replaces its earlier one.
500
+ */
501
+ claimHaspopup(owner: object, value: PopoverHaspopup): void;
502
+ /**
503
+ * Release `owner`'s `aria-haspopup` claim. Release removes only this
504
+ * owner's claim, so a co-composer's hint survives it.
505
+ */
506
+ releaseHaspopup(owner: object): void;
507
+ /**
508
+ * Claim the id source triggers name in `aria-controls` when the consumer
509
+ * sets none. Composers (menu wirings) pass the popup element's id Signal,
510
+ * not its value. The last live claim wins; a re-claim by the same owner
511
+ * replaces its earlier one.
512
+ */
513
+ claimControls(owner: object, source: Signal<string>): void;
514
+ /**
515
+ * Release `owner`'s `aria-controls` claim. Release removes only this
516
+ * owner's claim, so a co-composer's hint survives it.
517
+ */
518
+ releaseControls(owner: object): void;
519
+ /**
520
+ * Claim the `position-try-fallbacks` chain the popover falls back to
521
+ * while the consumer binds no `[positionTryFallbacks]`. Composers (menu
522
+ * wirings) claim with themselves as `owner` and release on destroy. The
523
+ * last live claim wins; a re-claim by the same owner replaces its
524
+ * earlier one. A bound list, including an empty one, wins over every
525
+ * claim.
428
526
  */
429
- setHaspopup(value: PopoverHaspopup | undefined): void;
527
+ claimPositionTryFallbacks(owner: object, value: readonly PopoverPositionTryFallback[]): void;
528
+ /**
529
+ * Release `owner`'s `position-try-fallbacks` claim. Release removes only
530
+ * this owner's claim, so a co-composer's chain survives it.
531
+ */
532
+ releasePositionTryFallbacks(owner: object): void;
533
+ /**
534
+ * Claim the focus-return hint triggers fall back to when the consumer
535
+ * binds no `[restoreFocus]`. The last live claim wins; a re-claim by the
536
+ * same owner replaces its earlier one.
537
+ */
538
+ claimRestoreFocus(owner: object, value: boolean): void;
539
+ /**
540
+ * Release `owner`'s focus-return claim. Release removes only this owner's
541
+ * claim, so a co-composer's hint survives it.
542
+ */
543
+ releaseRestoreFocus(owner: object): void;
544
+ /**
545
+ * @internal Install the listener `finalize()` calls synchronously at the
546
+ * end of every close, with the {@link focusOrigin} captured before it is
547
+ * cleared. Runs on every close path (`hide()`, light dismiss), so a close
548
+ * that lands before the next change detection pass still reaches it. A
549
+ * fading close also calls it once at its start, in the `closing` state and
550
+ * before the panel turns `inert`, with the same origin.
551
+ * Replacing a different live listener warns in dev mode (CNGX1081).
552
+ */
553
+ registerCloseListener(fn: (origin: HTMLElement | null) => void): void;
554
+ /**
555
+ * @internal Release `fn`. Clears the slot only while `fn` still holds it,
556
+ * so a stale trigger's teardown leaves a successor registered.
557
+ */
558
+ releaseCloseListener(fn: (origin: HTMLElement | null) => void): void;
430
559
  /**
431
560
  * @internal Install or clear the programmatic {@link exclusive} override.
432
561
  * `null` defers back to the `[exclusive]` input.
@@ -439,7 +568,8 @@ declare class CngxPopover {
439
568
  setPlacementOverride(value: PopoverPlacement | null): void;
440
569
  /**
441
570
  * @internal Install or clear the programmatic {@link positionTryFallbacks}
442
- * override. `null` defers back to the `[positionTryFallbacks]` input.
571
+ * override. `null` defers back to the `[positionTryFallbacks]` input, then
572
+ * to the last live composer claim.
443
573
  */
444
574
  setPositionTryFallbacksOverride(value: readonly PopoverPositionTryFallback[] | null): void;
445
575
  protected handleToggle(e: ToggleEvent): void;
@@ -474,9 +604,11 @@ declare class CngxPopover {
474
604
  private cancelArrowFrame;
475
605
  private get popoverElement();
476
606
  private startClosing;
607
+ private claimFadeInert;
608
+ private releaseFadeInert;
477
609
  private finalize;
478
610
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxPopover, never>;
479
- static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CngxPopover, "[cngxPopover]", ["cngxPopover"], { "placement": { "alias": "placement"; "required": false; "isSignal": true; }; "positionTryFallbacks": { "alias": "positionTryFallbacks"; "required": false; "isSignal": true; }; "offset": { "alias": "offset"; "required": false; "isSignal": true; }; "closeOnEscape": { "alias": "closeOnEscape"; "required": false; "isSignal": true; }; "closeOnOutsideClick": { "alias": "closeOnOutsideClick"; "required": false; "isSignal": true; }; "mode": { "alias": "mode"; "required": false; "isSignal": true; }; "controlledOpen": { "alias": "cngxPopoverOpen"; "required": false; "isSignal": true; }; "exclusive": { "alias": "exclusive"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
611
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CngxPopover, "[cngxPopover]", ["cngxPopover"], { "placement": { "alias": "placement"; "required": false; "isSignal": true; }; "positionTryFallbacks": { "alias": "positionTryFallbacks"; "required": false; "isSignal": true; }; "offset": { "alias": "offset"; "required": false; "isSignal": true; }; "closeOnEscape": { "alias": "closeOnEscape"; "required": false; "isSignal": true; }; "closeOnOutsideClick": { "alias": "closeOnOutsideClick"; "required": false; "isSignal": true; }; "mode": { "alias": "mode"; "required": false; "isSignal": true; }; "controlledOpen": { "alias": "cngxPopoverOpen"; "required": false; "isSignal": true; }; "exclusive": { "alias": "exclusive"; "required": false; "isSignal": true; }; }, { "opened": "opened"; "closed": "closed"; }, never, never, true, never>;
480
612
  }
481
613
 
482
614
  /**
@@ -498,27 +630,35 @@ declare class CngxPopover {
498
630
  * ```
499
631
  *
500
632
  * ### Focus restoration
501
- * Opt in with `[restoreFocus]="true"` to restore focus on close to the
502
- * element that was focused before the popover opened (the popover
503
- * snapshots it synchronously in `show()`, so content autofocus cannot
504
- * displace the restore target). Useful for menus, confirm panels, and
505
- * dialogs that steal focus from the trigger.
506
- *
507
- * @category common/popover
508
- * @docsKind primary
633
+ * On close, the trigger can return focus to the element that was focused
634
+ * before the popover opened (the popover snapshots it synchronously in
635
+ * `show()`, so content autofocus cannot displace the restore target). The
636
+ * popover calls the trigger synchronously at the end of every close, so the
637
+ * decision is made at close time and a close that lands before the next
638
+ * change detection pass (a fast Enter then Escape) still restores. The
639
+ * decision resolves in this order: the `[restoreFocus]` input, then the
640
+ * composer claim on the popover (`CngxPopoverPanel` claims `true`, a menu
641
+ * trigger claims `false` because its focus stack restores), then `false`.
642
+ * A bare popover therefore stays opt-in, and the restore runs only when
643
+ * focus is lost at close time. One trigger per popover: a later trigger
644
+ * takes over the close listener, as it does the implicit anchor slot.
645
+ *
509
646
  * @wcag AA
510
647
  * @github https://github.com/cngxjs/cngx/blob/main/projects/common/popover/popover-trigger.directive.ts
511
- * @since 0.1.0
512
- * @relatedTo CngxPopover, CngxPopoverAnchor, CngxPopoverPanel, CngxTooltip
513
- * <example-url>http://localhost:4200/#/common/popover/click-popover</example-url>
514
- * <example-url>http://localhost:4200/#/common/popover/controlled-open</example-url>
515
- * <example-url>http://localhost:4200/#/common/popover/escape-mode</example-url>
516
- * <example-url>http://localhost:4200/#/common/popover/placement-variants</example-url>
517
- * <example-url>http://localhost:4200/#/common/popover/anchor/field-box-anchor</example-url>
648
+ * @since 0.3.0
649
+ * @relatedTo CngxPopover, CngxPopoverAnchor, CngxPopoverPanel, CngxTooltip, CngxMenuButton, CngxDisclosure
650
+ * <example-url>/#/common/popover/click-popover</example-url>
651
+ * <example-url>/#/common/popover/disclosure/link-list</example-url>
652
+ * <example-url>/#/common/popover/controlled-open</example-url>
653
+ * <example-url>/#/common/popover/escape-mode</example-url>
654
+ * <example-url>/#/common/popover/placement-variants</example-url>
655
+ * <example-url>/#/common/popover/anchor/field-box-anchor</example-url>
656
+ * <example-url>/#/common/menu-button/menu-button/basic</example-url>
518
657
  */
519
658
  declare class CngxPopoverTrigger {
520
659
  private readonly elRef;
521
660
  private readonly destroyRef;
661
+ private readonly doc;
522
662
  /** Explicit reference to the popover this trigger controls. */
523
663
  readonly popoverRef: _angular_core.InputSignal<CngxPopover>;
524
664
  /**
@@ -539,18 +679,32 @@ declare class CngxPopoverTrigger {
539
679
  * ARIA controls override. When set, `aria-controls` names this id instead
540
680
  * of the popover element - correct when the popup role sits on an element
541
681
  * inside the popover (a `role="listbox"` or `role="tree"` panel). `null`
542
- * or unset falls back to `popoverRef().id()`.
682
+ * or unset falls back to the popover's `controlsHint()` (installed by a
683
+ * composer such as a menu trigger), then to `popoverRef().id()`.
543
684
  */
544
685
  readonly controlsInput: _angular_core.InputSignal<string | null | undefined>;
545
686
  /**
546
- * When `true`, remembers the popover's pre-open focus target (the
547
- * popover snapshots `document.activeElement` synchronously inside
548
- * `show()`, before content autofocus can land in the panel) and
549
- * restores focus to it when the popover closes. Defaults to `false`
550
- * so the trigger stays a passive ARIA atom; opt in for menus,
551
- * confirm panels, and dialogs that move focus away from the trigger.
687
+ * When `true` at close time, restores focus to the popover's pre-open
688
+ * focus target (the popover snapshots `document.activeElement`
689
+ * synchronously inside `show()`, before content autofocus can land in
690
+ * the panel and hands it to the trigger when it closes). The value is
691
+ * read when the popover closes, not when it opens. A snapshot of `body`
692
+ * (a browser that does not focus a clicked button, such as Safari)
693
+ * falls back to this trigger. The restore runs only when focus is
694
+ * lost at close time - on `body` or inside the panel - so a close
695
+ * caused by a click or Escape in another control leaves focus there.
696
+ * Unbound, the popover's composer claim decides
697
+ * (`popoverRef().restoreFocusHint()`: `CngxPopoverPanel` claims `true`, a
698
+ * menu trigger `false`), and without a claim it stays `false`, so a bare
699
+ * popover trigger is a passive ARIA atom. Bind `true` or `false` to
700
+ * override the composer.
552
701
  */
553
- readonly restoreFocus: _angular_core.InputSignal<boolean>;
702
+ readonly restoreFocusInput: _angular_core.InputSignal<boolean | undefined>;
703
+ /**
704
+ * @internal Resolved focus return: the `[restoreFocus]` input, then the
705
+ * popover's composer claim, then `false`.
706
+ */
707
+ protected readonly restoreFocus: _angular_core.Signal<boolean>;
554
708
  /**
555
709
  * Resolved `aria-haspopup`. Consumer override (`haspopup` on the
556
710
  * trigger element) wins; otherwise the popover's `haspopup` signal
@@ -559,17 +713,29 @@ declare class CngxPopoverTrigger {
559
713
  * binding drops the attribute entirely.
560
714
  */
561
715
  protected readonly haspopup: _angular_core.Signal<PopoverHaspopup | null>;
562
- /** Resolved `aria-controls`: the consumer override, else the popover id. */
716
+ /**
717
+ * Resolved `aria-controls`: the consumer override, else the popover's
718
+ * composer hint, else the popover id.
719
+ */
563
720
  protected readonly controls: _angular_core.Signal<string>;
564
721
  /**
565
722
  * CSS anchor name, yielded (`null`) while a `CngxPopoverAnchor` holds
566
723
  * the popover's explicit anchor slot.
567
724
  */
568
725
  protected readonly cssAnchorName: _angular_core.Signal<string | null>;
569
- private savedFocus;
726
+ /**
727
+ * Close-time focus return, called synchronously by the popover at the end
728
+ * of every close with its pre-open focus origin, and once more at the
729
+ * start of a fading close, before the panel turns `inert`. Whichever call
730
+ * finds focus lost restores it; the other is a no-op. The decision is read
731
+ * here, not sampled on open: a close in a sheet presentation resolves
732
+ * `restoreFocus()` to `false` by itself.
733
+ */
734
+ private readonly handleClose;
570
735
  constructor();
736
+ private isFocusLost;
571
737
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxPopoverTrigger, never>;
572
- static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CngxPopoverTrigger, "[cngxPopoverTrigger]", ["cngxPopoverTrigger"], { "popoverRef": { "alias": "cngxPopoverTrigger"; "required": true; "isSignal": true; }; "haspopupInput": { "alias": "haspopup"; "required": false; "isSignal": true; }; "controlsInput": { "alias": "controls"; "required": false; "isSignal": true; }; "restoreFocus": { "alias": "restoreFocus"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
738
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CngxPopoverTrigger, "[cngxPopoverTrigger]", ["cngxPopoverTrigger"], { "popoverRef": { "alias": "cngxPopoverTrigger"; "required": true; "isSignal": true; }; "haspopupInput": { "alias": "haspopup"; "required": false; "isSignal": true; }; "controlsInput": { "alias": "controls"; "required": false; "isSignal": true; }; "restoreFocusInput": { "alias": "restoreFocus"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
573
739
  }
574
740
 
575
741
  /**
@@ -600,11 +766,11 @@ declare class CngxPopoverTrigger {
600
766
  * releases the slot identity-guarded and the trigger becomes the anchor
601
767
  * again.
602
768
  *
603
- * @category common/popover
604
769
  * @github https://github.com/cngxjs/cngx/blob/main/projects/common/popover/popover-anchor.directive.ts
605
- * @since 0.1.0
770
+ * @since 0.3.0
606
771
  * @relatedTo CngxPopover, CngxPopoverTrigger
607
- * <example-url>http://localhost:4200/#/common/popover/anchor/field-box-anchor</example-url>
772
+ * <example-url>/#/common/popover/anchor/field-box-anchor</example-url>
773
+ * @axis level atom
608
774
  */
609
775
  declare class CngxPopoverAnchor {
610
776
  private readonly host;
@@ -627,6 +793,13 @@ declare class CngxPopoverAnchor {
627
793
  *
628
794
  * The consumer sees only the attribute - no extra elements in the template.
629
795
  *
796
+ * The tooltip joins the host's `aria-describedby` instead of replacing it. On
797
+ * a plain host the static `aria-describedby` ids are kept and the tooltip id
798
+ * is appended after them. When the host provides `CNGX_DESCRIBED_BY`
799
+ * (`CngxButton`, `CngxIconButton`), the tooltip contributes its id to that
800
+ * registry next to the host's own ids. The id is referenced while the
801
+ * tooltip is `enabled`, whether or not the popup is open.
802
+ *
630
803
  * ### Basic
631
804
  * ```html
632
805
  * <button cngxTooltip="Ctrl+S">Save</button>
@@ -639,18 +812,17 @@ declare class CngxPopoverAnchor {
639
812
  * </button>
640
813
  * ```
641
814
  *
642
- * @category common/popover
643
- * @docsKind primary
644
815
  * @wcag AA
645
816
  * @github https://github.com/cngxjs/cngx/blob/main/projects/common/popover/tooltip.directive.ts
646
- * @since 0.1.0
647
- * @relatedTo CngxPopover, CngxPopoverTrigger
648
- * <example-url>http://localhost:4200/#/common/popover/tooltip/basic-tooltip</example-url>
649
- * <example-url>http://localhost:4200/#/common/popover/tooltip/custom-delay</example-url>
650
- * <example-url>http://localhost:4200/#/common/popover/tooltip/disabled-state</example-url>
651
- * <example-url>http://localhost:4200/#/common/popover/tooltip/keyboard-navigation</example-url>
652
- * <example-url>http://localhost:4200/#/common/popover/tooltip/placement</example-url>
653
- * <example-url>http://localhost:4200/#/common/popover/tooltip/programmatic-control</example-url>
817
+ * @since 0.3.0
818
+ * @relatedTo CngxPopover, CngxPopoverTrigger, CNGX_DESCRIBED_BY
819
+ * <example-url>/#/common/popover/tooltip/basic-tooltip</example-url>
820
+ * <example-url>/#/common/popover/tooltip/custom-delay</example-url>
821
+ * <example-url>/#/common/popover/tooltip/disabled-state</example-url>
822
+ * <example-url>/#/common/popover/tooltip/keyboard-navigation</example-url>
823
+ * <example-url>/#/common/popover/tooltip/placement</example-url>
824
+ * <example-url>/#/common/popover/tooltip/programmatic-control</example-url>
825
+ * @axis level atom
654
826
  */
655
827
  declare class CngxTooltip {
656
828
  private readonly renderer;
@@ -658,6 +830,13 @@ declare class CngxTooltip {
658
830
  private readonly destroyRef;
659
831
  private readonly floatingFallback;
660
832
  private readonly direction;
833
+ private readonly motion;
834
+ /**
835
+ * @internal
836
+ * Drives the `cngx-reduced-motion` class on the trigger from the app motion
837
+ * axis (`CNGX_MOTION`), falling back to the OS preference on `auto`.
838
+ */
839
+ protected readonly reducedMotion: _angular_core.Signal<boolean>;
661
840
  /** Tooltip text content. */
662
841
  readonly text: _angular_core.InputSignal<string>;
663
842
  /** Anchor-relative placement. */
@@ -706,6 +885,16 @@ declare class CngxTooltip {
706
885
  private tooltipEl;
707
886
  private openTimer;
708
887
  private closeTimer;
888
+ private readonly ownDescribedBy;
889
+ /**
890
+ * A host that owns `aria-describedby` (`CngxButton`, `CngxIconButton`)
891
+ * provides `CNGX_DESCRIBED_BY` on its element: the tooltip id joins that
892
+ * registry and this binding renders the merged value the host renders, so
893
+ * neither binding drops the other's ids. Without one, the tooltip owns a
894
+ * local registry seeded with the static `aria-describedby`, so the
895
+ * consumer's ids stay ahead of the tooltip id instead of being overwritten.
896
+ */
897
+ private readonly describedByRegistry;
709
898
  protected readonly ariaDescribedBy: _angular_core.Signal<string | null>;
710
899
  protected readonly cssAnchorName: _angular_core.Signal<string | null>;
711
900
  constructor();
@@ -733,21 +922,21 @@ declare class CngxTooltip {
733
922
  */
734
923
  private readonly floatingPositioner;
735
924
  private applyFloatingPosition;
925
+ private createLocalDescribedBy;
736
926
  private createTooltipElement;
737
927
  private finalize;
738
928
  private clearTimers;
739
929
  private clearOpenTimer;
740
930
  private clearCloseTimer;
741
931
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxTooltip, never>;
742
- static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CngxTooltip, "[cngxTooltip]", ["cngxTooltip"], { "text": { "alias": "cngxTooltip"; "required": true; "isSignal": true; }; "placement": { "alias": "tooltipPlacement"; "required": false; "isSignal": true; }; "offset": { "alias": "tooltipOffset"; "required": false; "isSignal": true; }; "openDelay": { "alias": "tooltipDelay"; "required": false; "isSignal": true; }; "closeDelay": { "alias": "closeDelay"; "required": false; "isSignal": true; }; "enabled": { "alias": "enabled"; "required": false; "isSignal": true; }; "triggers": { "alias": "triggers"; "required": false; "isSignal": true; }; "positionTryFallbacks": { "alias": "tooltipPositionTryFallbacks"; "required": false; "isSignal": true; }; }, {}, never, never, true, [{ directive: typeof i1.CngxReducedMotion; inputs: {}; outputs: {}; }]>;
932
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CngxTooltip, "[cngxTooltip]", ["cngxTooltip"], { "text": { "alias": "cngxTooltip"; "required": true; "isSignal": true; }; "placement": { "alias": "tooltipPlacement"; "required": false; "isSignal": true; }; "offset": { "alias": "tooltipOffset"; "required": false; "isSignal": true; }; "openDelay": { "alias": "tooltipDelay"; "required": false; "isSignal": true; }; "closeDelay": { "alias": "closeDelay"; "required": false; "isSignal": true; }; "enabled": { "alias": "enabled"; "required": false; "isSignal": true; }; "triggers": { "alias": "triggers"; "required": false; "isSignal": true; }; "positionTryFallbacks": { "alias": "tooltipPositionTryFallbacks"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
743
933
  }
744
934
 
745
935
  /**
746
936
  * How an open popover is laid out: anchored to its trigger, as a bottom
747
937
  * sheet, or filling the viewport.
748
938
  *
749
- * @category common/popover
750
- * @since 0.1.0
939
+ * @since 0.3.0
751
940
  */
752
941
  type CngxPopoverPresentation = 'anchored' | 'sheet' | 'fullscreen';
753
942
  /**
@@ -768,8 +957,6 @@ interface CngxPopoverPresentationSeam {
768
957
  /**
769
958
  * Why a sheet asked to close: a swipe on the header or handle, a tap outside
770
959
  * the panel, the Android back gesture, or a close control inside the sheet.
771
- *
772
- * @category common/popover
773
960
  */
774
961
  type CngxPopoverSheetCloseReason = 'swipe' | 'backdrop' | 'back' | 'close';
775
962
  /** @internal Handle a `CngxPopoverSheetTitle` registers. */
@@ -799,8 +986,6 @@ interface CngxPopoverSheetPartsHost {
799
986
  /**
800
987
  * What a consumer asks for: a fixed presentation, or `'auto'` to let the
801
988
  * breakpoint in `cngx-popover-sheet.css` decide.
802
- *
803
- * @category common/popover
804
989
  */
805
990
  type CngxPopoverPresentationRequest = 'auto' | CngxPopoverPresentation;
806
991
  /**
@@ -843,14 +1028,13 @@ type CngxPopoverPresentationRequest = 'auto' | CngxPopoverPresentation;
843
1028
  * </div>
844
1029
  * ```
845
1030
  *
846
- * @category common/popover
847
- * @docsKind primary
848
1031
  * @wcag AA
849
1032
  * @github https://github.com/cngxjs/cngx/blob/main/projects/common/popover/popover-sheet.directive.ts
850
- * @since 0.1.0
1033
+ * @since 0.3.0
851
1034
  * @relatedTo CngxPopover, CngxSwipeDismiss, CngxFocusTrap, createPinnedScrollLock, injectScopedLiveRegion
852
- * <example-url>http://localhost:4200/#/common/popover/sheet/bottom-sheet</example-url>
853
- * <example-url>http://localhost:4200/#/common/popover/sheet/fullscreen-search</example-url>
1035
+ * <example-url>/#/common/popover/sheet/bottom-sheet</example-url>
1036
+ * <example-url>/#/common/popover/sheet/fullscreen-search</example-url>
1037
+ * @axis level molecule
854
1038
  */
855
1039
  declare class CngxPopoverSheet implements CngxPopoverPresentationSeam, CngxPopoverSheetPartsHost, CngxFocusTrapDriver {
856
1040
  private readonly popover;
@@ -901,7 +1085,13 @@ declare class CngxPopoverSheet implements CngxPopoverPresentationSeam, CngxPopov
901
1085
  readonly presentation: _angular_core.Signal<CngxPopoverPresentation>;
902
1086
  /** `true` in the sheet and fullscreen presentations. */
903
1087
  readonly modal: _angular_core.Signal<boolean>;
904
- /** @internal Drives the composed `CngxFocusTrap`: Tab stays inside while modal and visible. */
1088
+ private readonly showing;
1089
+ private readonly modalShowing;
1090
+ /**
1091
+ * @internal Drives the composed `CngxFocusTrap`: Tab stays inside while
1092
+ * modal and opening or open, so the trap anchors leave the Tab order when
1093
+ * the close starts.
1094
+ */
905
1095
  readonly focusTrapEnabled: _angular_core.Signal<boolean>;
906
1096
  /** @internal The sheet moves focus itself, inside `show()`. */
907
1097
  readonly focusTrapAutoFocus = false;
@@ -920,14 +1110,14 @@ declare class CngxPopoverSheet implements CngxPopoverPresentationSeam, CngxPopov
920
1110
  private lifted;
921
1111
  private releaseLock;
922
1112
  private settlingFrame;
923
- private warnedTitle;
924
- private warnedMode;
925
- private closeWatcher;
1113
+ private readonly devWarned;
1114
+ private readonly closeWatcher;
926
1115
  private readonly outsidePointerDown;
927
1116
  private clickSwallowTimer;
928
1117
  private escapeKeyTimer;
929
1118
  private readonly escapeKeydown;
930
1119
  private readonly swallowClick;
1120
+ private readonly swallowMouseDown;
931
1121
  constructor();
932
1122
  /** @internal Seam call from `CngxPopover.show()`, after `showPopover()`. */
933
1123
  onShown(): void;
@@ -955,15 +1145,15 @@ declare class CngxPopoverSheet implements CngxPopoverPresentationSeam, CngxPopov
955
1145
  protected handleBeforeToggle(event: ToggleEvent): void;
956
1146
  private disengage;
957
1147
  private engage;
1148
+ private rehomeFocusIntoSheet;
958
1149
  private rehomeFocusAfterFlip;
959
1150
  private focusFirstTaker;
960
1151
  private focusableAnchor;
961
1152
  private openerToRestore;
962
1153
  private release;
963
- private armCloseWatcher;
1154
+ private handleBackGesture;
964
1155
  private armClickSwallow;
965
1156
  private disarmClickSwallow;
966
- private disarmCloseWatcher;
967
1157
  private liftOwnInert;
968
1158
  private applyInert;
969
1159
  private skipsInert;
@@ -971,7 +1161,6 @@ declare class CngxPopoverSheet implements CngxPopoverPresentationSeam, CngxPopov
971
1161
  private handOffPendingAnnouncements;
972
1162
  private startSettling;
973
1163
  private stopSettling;
974
- private warnOnMisconfiguration;
975
1164
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxPopoverSheet, never>;
976
1165
  static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CngxPopoverSheet, "[cngxPopoverSheet]", ["cngxPopoverSheet"], { "request": { "alias": "cngxPopoverSheet"; "required": false; "isSignal": true; }; "autoPresentation": { "alias": "autoPresentation"; "required": false; "isSignal": true; }; "labelledBy": { "alias": "labelledBy"; "required": false; "isSignal": true; }; "restoreFocus": { "alias": "restoreFocus"; "required": false; "isSignal": true; }; "restoreTarget": { "alias": "restoreTarget"; "required": false; "isSignal": true; }; "closeOnRequest": { "alias": "closeOnRequest"; "required": false; "isSignal": true; }; }, { "closeRequested": "closeRequested"; "closing": "closing"; }, never, never, true, [{ directive: typeof i1.CngxFocusTrap; inputs: {}; outputs: {}; }]>;
977
1166
  }
@@ -980,8 +1169,7 @@ declare class CngxPopoverSheet implements CngxPopoverPresentationSeam, CngxPopov
980
1169
  * Header row of a `CngxPopoverSheet`. Stays put while the content below it
981
1170
  * scrolls; add `cngxSwipeDismiss="down"` to close the sheet by swiping it.
982
1171
  *
983
- * @category common/popover
984
- * @since 0.1.0
1172
+ * @since 0.3.0
985
1173
  * @relatedTo CngxPopoverSheet, CngxSwipeDismiss
986
1174
  */
987
1175
  declare class CngxPopoverSheetHeader {
@@ -993,8 +1181,7 @@ declare class CngxPopoverSheetHeader {
993
1181
  * The element that names a modal `CngxPopoverSheet`. The sheet points its
994
1182
  * `aria-labelledby` here, never at the header that also holds buttons.
995
1183
  *
996
- * @category common/popover
997
- * @since 0.1.0
1184
+ * @since 0.3.0
998
1185
  * @relatedTo CngxPopoverSheet
999
1186
  */
1000
1187
  declare class CngxPopoverSheetTitle implements CngxPopoverSheetTitleHandle {
@@ -1009,8 +1196,7 @@ declare class CngxPopoverSheetTitle implements CngxPopoverSheetTitleHandle {
1009
1196
  * the sheet through its close control, since their swipe is consumed by
1010
1197
  * navigation.
1011
1198
  *
1012
- * @category common/popover
1013
- * @since 0.1.0
1199
+ * @since 0.3.0
1014
1200
  * @relatedTo CngxPopoverSheet
1015
1201
  */
1016
1202
  declare class CngxPopoverSheetHandle {
@@ -1029,8 +1215,7 @@ declare class CngxPopoverSheetHandle {
1029
1215
  * the bare attribute as the default target. The condition is read when the
1030
1216
  * sheet opens.
1031
1217
  *
1032
- * @category common/popover
1033
- * @since 0.1.0
1218
+ * @since 0.3.0
1034
1219
  * @relatedTo CngxPopoverSheet
1035
1220
  */
1036
1221
  declare class CngxPopoverSheetInitialFocus implements CngxPopoverSheetFocusHandle {
@@ -1062,14 +1247,10 @@ interface ComputePositionSignature {
1062
1247
  /**
1063
1248
  * Signature matching `@floating-ui/dom` `computePosition`.
1064
1249
  * The consumer provides the actual function - the library never imports it directly.
1065
- *
1066
- * @category common/popover
1067
1250
  */
1068
1251
  type ComputePositionFn = ComputePositionSignature['computePosition'];
1069
1252
  /**
1070
1253
  * Configuration for the Floating UI positioning fallback.
1071
- *
1072
- * @category common/popover
1073
1254
  */
1074
1255
  interface FloatingFallbackConfig {
1075
1256
  /** The `computePosition` function from `@floating-ui/dom`. */
@@ -1084,9 +1265,8 @@ interface FloatingFallbackConfig {
1084
1265
  * Injection token for the Floating UI fallback.
1085
1266
  * `null` when not provided - CSS Anchor Positioning is used instead.
1086
1267
  *
1087
- * @category common/popover
1088
1268
  * @github https://github.com/cngxjs/cngx/blob/main/projects/common/popover/floating-fallback.ts
1089
- * @since 0.1.0
1269
+ * @since 0.3.0
1090
1270
  */
1091
1271
  declare const CNGX_FLOATING_FALLBACK: InjectionToken<FloatingFallbackConfig | null>;
1092
1272
  /**
@@ -1104,8 +1284,6 @@ declare const CNGX_FLOATING_FALLBACK: InjectionToken<FloatingFallbackConfig | nu
1104
1284
  * provideFloatingFallback(computePosition, [flip(), shift()]),
1105
1285
  * ]
1106
1286
  * ```
1107
- *
1108
- * @category common/popover
1109
1287
  */
1110
1288
  declare function provideFloatingFallback(computePosition: ComputePositionFn, middleware?: unknown[]): Provider;
1111
1289
 
@@ -1114,20 +1292,33 @@ declare function provideFloatingFallback(computePosition: ComputePositionFn, mid
1114
1292
  * `CngxPopoverPanel`. `providePopoverPanel(withPopoverPanelLabels(...))`
1115
1293
  * overrides single keys on top of it.
1116
1294
  *
1117
- * @category common/popover
1118
- * @since 0.1.0
1295
+ * @since 0.3.0
1119
1296
  * @relatedTo CngxPopoverPanel, withPopoverPanelLabels
1120
1297
  */
1121
1298
  interface CngxPopoverLanguageSection {
1122
1299
  /** Accessible name of the built-in close button. */
1123
1300
  readonly close: string;
1301
+ /**
1302
+ * Text of the loading view. A projected `*cngxPopoverLoading` template
1303
+ * replaces it.
1304
+ */
1305
+ readonly loading: string;
1306
+ /**
1307
+ * Text of the error view, and the panel's description there. A projected
1308
+ * `*cngxPopoverError` template replaces it.
1309
+ */
1310
+ readonly error: string;
1311
+ /**
1312
+ * Text of the empty view, and the panel's description there. A projected
1313
+ * `*cngxPopoverEmpty` template replaces it.
1314
+ */
1315
+ readonly empty: string;
1124
1316
  }
1125
1317
  /**
1126
1318
  * The English popover section: the single source of the popover panel's
1127
1319
  * English copy.
1128
1320
  *
1129
- * @category common/popover
1130
- * @since 0.1.0
1321
+ * @since 0.3.0
1131
1322
  * @relatedTo CngxPopoverPanel
1132
1323
  */
1133
1324
  declare const CNGX_POPOVER_LANGUAGE_EN: CngxPopoverLanguageSection;
@@ -1144,8 +1335,6 @@ declare module '@cngx/core/i18n' {
1144
1335
  * `left` / `right`) and the inline-axis offset in CSS pixels that the
1145
1336
  * library would have placed the default diamond at. Either can be used to
1146
1337
  * rotate, translate, or theme the custom glyph so it tracks the trigger.
1147
- *
1148
- * @category common/popover
1149
1338
  */
1150
1339
  interface CngxPopoverArrowContext {
1151
1340
  /** Primary edge of the panel facing the trigger. */
@@ -1161,9 +1350,8 @@ interface CngxPopoverArrowContext {
1161
1350
  /**
1162
1351
  * Marks the header content inside `cngx-popover-panel`.
1163
1352
  *
1164
- * @category common/popover
1165
1353
  * @github https://github.com/cngxjs/cngx/blob/main/projects/common/popover/popover-panel-slots.ts
1166
- * @since 0.1.0
1354
+ * @since 0.3.0
1167
1355
  * @relatedTo CngxPopoverPanel, CngxPopoverBody, CngxPopoverFooter
1168
1356
  */
1169
1357
  declare class CngxPopoverHeader {
@@ -1173,9 +1361,8 @@ declare class CngxPopoverHeader {
1173
1361
  /**
1174
1362
  * Marks the body content inside `cngx-popover-panel`.
1175
1363
  *
1176
- * @category common/popover
1177
1364
  * @github https://github.com/cngxjs/cngx/blob/main/projects/common/popover/popover-panel-slots.ts
1178
- * @since 0.1.0
1365
+ * @since 0.3.0
1179
1366
  * @relatedTo CngxPopoverPanel, CngxPopoverHeader, CngxPopoverFooter
1180
1367
  */
1181
1368
  declare class CngxPopoverBody {
@@ -1185,9 +1372,8 @@ declare class CngxPopoverBody {
1185
1372
  /**
1186
1373
  * Marks the footer content inside `cngx-popover-panel`.
1187
1374
  *
1188
- * @category common/popover
1189
1375
  * @github https://github.com/cngxjs/cngx/blob/main/projects/common/popover/popover-panel-slots.ts
1190
- * @since 0.1.0
1376
+ * @since 0.3.0
1191
1377
  * @relatedTo CngxPopoverPanel, CngxPopoverHeader, CngxPopoverBody, CngxPopoverAction
1192
1378
  */
1193
1379
  declare class CngxPopoverFooter {
@@ -1205,9 +1391,8 @@ declare class CngxPopoverFooter {
1205
1391
  * </ng-template>
1206
1392
  * ```
1207
1393
  *
1208
- * @category common/popover
1209
1394
  * @github https://github.com/cngxjs/cngx/blob/main/projects/common/popover/popover-panel-slots.ts
1210
- * @since 0.1.0
1395
+ * @since 0.3.0
1211
1396
  * @relatedTo CngxPopoverPanel
1212
1397
  */
1213
1398
  declare class CngxPopoverClose {
@@ -1216,41 +1401,84 @@ declare class CngxPopoverClose {
1216
1401
  static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CngxPopoverClose, "ng-template[cngxPopoverClose]", never, {}, {}, never, never, true, never>;
1217
1402
  }
1218
1403
  /**
1219
- * Template shown while panel content is loading.
1404
+ * Context passed to a `*cngxPopoverLoading` or `*cngxPopoverEmpty` template:
1405
+ * the copy the panel would render without the template, resolved from the
1406
+ * `[loadingText]` / `[emptyText]` input, then `withPopoverPanelLabels(...)`,
1407
+ * then the `popover` section of the active language pack. A template that
1408
+ * only restyles the state can print it instead of carrying its own string.
1409
+ *
1410
+ * @since 0.3.0
1411
+ */
1412
+ interface CngxPopoverStateCopyContext {
1413
+ /** The resolved default copy of the state view. */
1414
+ readonly $implicit: string;
1415
+ /** Same value as `$implicit`, for a named `let-text="text"`. */
1416
+ readonly text: string;
1417
+ }
1418
+ /**
1419
+ * Context passed to a `*cngxPopoverError` template.
1420
+ *
1421
+ * `$implicit` stays the raw error (from `[error]` or the bound `[state]`),
1422
+ * `text` is the copy the panel would render without the template, resolved
1423
+ * from `[errorText]`, then `withPopoverPanelLabels(...)`, then the language
1424
+ * pack.
1425
+ *
1426
+ * @since 0.3.0
1427
+ */
1428
+ interface CngxPopoverErrorContext {
1429
+ /** The raw error behind the error view. */
1430
+ readonly $implicit: unknown;
1431
+ /** Same value as `$implicit`, for a named `let-error="error"`. */
1432
+ readonly error: unknown;
1433
+ /** The resolved default error copy. */
1434
+ readonly text: string;
1435
+ }
1436
+ /**
1437
+ * Template shown while panel content is loading. Context:
1438
+ * `CngxPopoverStateCopyContext` (`$implicit` / `text` = resolved loading copy).
1439
+ *
1440
+ * ```html
1441
+ * <ng-template cngxPopoverLoading let-text>
1442
+ * <span class="brand-spinner" aria-hidden="true"></span> {{ text }}
1443
+ * </ng-template>
1444
+ * ```
1220
1445
  *
1221
- * @category common/popover
1222
1446
  * @github https://github.com/cngxjs/cngx/blob/main/projects/common/popover/popover-panel-slots.ts
1223
- * @since 0.1.0
1447
+ * @since 0.3.0
1224
1448
  * @relatedTo CngxPopoverPanel, CngxPopoverEmpty, CngxPopoverError
1225
1449
  */
1226
1450
  declare class CngxPopoverLoading {
1227
- readonly templateRef: TemplateRef<any>;
1451
+ readonly templateRef: TemplateRef<CngxPopoverStateCopyContext>;
1452
+ static ngTemplateContextGuard(_dir: CngxPopoverLoading, ctx: unknown): ctx is CngxPopoverStateCopyContext;
1228
1453
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxPopoverLoading, never>;
1229
1454
  static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CngxPopoverLoading, "ng-template[cngxPopoverLoading]", never, {}, {}, never, never, true, never>;
1230
1455
  }
1231
1456
  /**
1232
- * Template shown when panel content is empty.
1457
+ * Template shown when panel content is empty. Context:
1458
+ * `CngxPopoverStateCopyContext` (`$implicit` / `text` = resolved empty copy).
1233
1459
  *
1234
- * @category common/popover
1235
1460
  * @github https://github.com/cngxjs/cngx/blob/main/projects/common/popover/popover-panel-slots.ts
1236
- * @since 0.1.0
1461
+ * @since 0.3.0
1237
1462
  * @relatedTo CngxPopoverPanel, CngxPopoverLoading, CngxPopoverError
1238
1463
  */
1239
1464
  declare class CngxPopoverEmpty {
1240
- readonly templateRef: TemplateRef<any>;
1465
+ readonly templateRef: TemplateRef<CngxPopoverStateCopyContext>;
1466
+ static ngTemplateContextGuard(_dir: CngxPopoverEmpty, ctx: unknown): ctx is CngxPopoverStateCopyContext;
1241
1467
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxPopoverEmpty, never>;
1242
1468
  static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CngxPopoverEmpty, "ng-template[cngxPopoverEmpty]", never, {}, {}, never, never, true, never>;
1243
1469
  }
1244
1470
  /**
1245
- * Template shown when panel content failed to load. Context: `$implicit` = error.
1471
+ * Template shown when panel content failed to load. Context:
1472
+ * `CngxPopoverErrorContext` (`$implicit` / `error` = the raw error, `text` =
1473
+ * resolved error copy).
1246
1474
  *
1247
- * @category common/popover
1248
1475
  * @github https://github.com/cngxjs/cngx/blob/main/projects/common/popover/popover-panel-slots.ts
1249
- * @since 0.1.0
1476
+ * @since 0.3.0
1250
1477
  * @relatedTo CngxPopoverPanel, CngxPopoverLoading, CngxPopoverEmpty
1251
1478
  */
1252
1479
  declare class CngxPopoverError {
1253
- readonly templateRef: TemplateRef<any>;
1480
+ readonly templateRef: TemplateRef<CngxPopoverErrorContext>;
1481
+ static ngTemplateContextGuard(_dir: CngxPopoverError, ctx: unknown): ctx is CngxPopoverErrorContext;
1254
1482
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxPopoverError, never>;
1255
1483
  static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CngxPopoverError, "ng-template[cngxPopoverError]", never, {}, {}, never, never, true, never>;
1256
1484
  }
@@ -1271,9 +1499,8 @@ declare class CngxPopoverError {
1271
1499
  * </cngx-popover-panel>
1272
1500
  * ```
1273
1501
  *
1274
- * @category common/popover
1275
1502
  * @github https://github.com/cngxjs/cngx/blob/main/projects/common/popover/popover-panel-slots.ts
1276
- * @since 0.1.0
1503
+ * @since 0.3.0
1277
1504
  * @relatedTo CngxPopoverPanel, CngxPopover
1278
1505
  */
1279
1506
  declare class CngxPopoverArrow {
@@ -1284,8 +1511,6 @@ declare class CngxPopoverArrow {
1284
1511
 
1285
1512
  /**
1286
1513
  * Configuration for `CngxPopoverPanel` provided via `providePopoverPanel()`.
1287
- *
1288
- * @category common/popover
1289
1514
  */
1290
1515
  interface CngxPopoverPanelConfig {
1291
1516
  /**
@@ -1331,23 +1556,19 @@ interface CngxPopoverPanelConfig {
1331
1556
  * same shape as the popover section of a language pack, declared once as
1332
1557
  * {@link CngxPopoverLanguageSection}.
1333
1558
  *
1334
- * @category common/popover
1335
- * @since 0.1.0
1559
+ * @since 0.3.0
1336
1560
  */
1337
1561
  type CngxPopoverPanelLabels = CngxPopoverLanguageSection;
1338
1562
  /**
1339
1563
  * Feature function signature for `providePopoverPanel()`.
1340
- *
1341
- * @category common/popover
1342
1564
  */
1343
1565
  type PopoverPanelFeature = (config: CngxPopoverPanelConfig) => CngxPopoverPanelConfig;
1344
1566
 
1345
1567
  /**
1346
1568
  * Injection token for popover panel configuration.
1347
1569
  *
1348
- * @category common/popover
1349
1570
  * @github https://github.com/cngxjs/cngx/blob/main/projects/common/popover/popover-panel.config.ts
1350
- * @since 0.1.0
1571
+ * @since 0.3.0
1351
1572
  */
1352
1573
  declare const CNGX_POPOVER_PANEL_CONFIG: InjectionToken<CngxPopoverPanelConfig>;
1353
1574
  /**
@@ -1361,8 +1582,6 @@ declare const CNGX_POPOVER_PANEL_CONFIG: InjectionToken<CngxPopoverPanelConfig>;
1361
1582
  * ),
1362
1583
  * ]
1363
1584
  * ```
1364
- *
1365
- * @category common/popover
1366
1585
  */
1367
1586
  declare function providePopoverPanel(...features: PopoverPanelFeature[]): Provider;
1368
1587
  /**
@@ -1372,34 +1591,24 @@ declare function providePopoverPanel(...features: PopoverPanelFeature[]): Provid
1372
1591
  * ```typescript
1373
1592
  * withAutoDismiss({ info: 5000, success: 3000 })
1374
1593
  * ```
1375
- *
1376
- * @category common/popover
1377
1594
  */
1378
1595
  declare function withAutoDismiss(timing: Record<string, number>): PopoverPanelFeature;
1379
1596
  /**
1380
1597
  * Auto-close the panel after an async action in the footer succeeds.
1381
1598
  *
1382
1599
  * @param delay - Delay in ms before closing. Defaults to `300`.
1383
- *
1384
- * @category common/popover
1385
1600
  */
1386
1601
  declare function withCloseOnSuccess(delay?: number): PopoverPanelFeature;
1387
1602
  /**
1388
1603
  * Set the default variant applied when no `variant` input is set.
1389
- *
1390
- * @category common/popover
1391
1604
  */
1392
1605
  declare function withDefaultVariant(variant: string): PopoverPanelFeature;
1393
1606
  /**
1394
1607
  * Show the close button on all panels by default.
1395
- *
1396
- * @category common/popover
1397
1608
  */
1398
1609
  declare function withCloseButton(show?: boolean): PopoverPanelFeature;
1399
1610
  /**
1400
1611
  * Show the arrow on all panels by default.
1401
- *
1402
- * @category common/popover
1403
1612
  */
1404
1613
  declare function withArrow(show?: boolean): PopoverPanelFeature;
1405
1614
  /**
@@ -1416,8 +1625,6 @@ declare function withArrow(show?: boolean): PopoverPanelFeature;
1416
1625
  * providePopoverPanel(withArrowTemplate(brandArrowTpl)),
1417
1626
  * ]
1418
1627
  * ```
1419
- *
1420
- * @category common/popover
1421
1628
  */
1422
1629
  declare function withArrowTemplate(tpl: TemplateRef<CngxPopoverArrowContext>): PopoverPanelFeature;
1423
1630
  /**
@@ -1432,8 +1639,7 @@ declare function withArrowTemplate(tpl: TemplateRef<CngxPopoverArrowContext>): P
1432
1639
  * ]
1433
1640
  * ```
1434
1641
  *
1435
- * @category common/popover
1436
- * @since 0.1.0
1642
+ * @since 0.3.0
1437
1643
  */
1438
1644
  declare function withPopoverPanelLabels(labels: Partial<CngxPopoverPanelLabels> | Signal<Partial<CngxPopoverPanelLabels>>): PopoverPanelFeature;
1439
1645
 
@@ -1452,8 +1658,6 @@ declare function withPopoverPanelLabels(labels: Partial<CngxPopoverPanelLabels>
1452
1658
  * working when used outside a `CngxPopoverPanel` (e.g. bare `[cngxPopover]`
1453
1659
  * on a `<div>`). The fallback value matches the panel's default
1454
1660
  * border-radius initial value (12 px).
1455
- *
1456
- * @category common/popover
1457
1661
  */
1458
1662
  interface CngxPopoverArrowBounds {
1459
1663
  /**
@@ -1465,9 +1669,8 @@ interface CngxPopoverArrowBounds {
1465
1669
  /**
1466
1670
  * Injection token for the arrow-bounds contract.
1467
1671
  *
1468
- * @category common/popover
1469
1672
  * @github https://github.com/cngxjs/cngx/blob/main/projects/common/popover/popover-arrow-bounds.ts
1470
- * @since 0.1.0
1673
+ * @since 0.3.0
1471
1674
  */
1472
1675
  declare const CNGX_POPOVER_ARROW_BOUNDS: InjectionToken<CngxPopoverArrowBounds>;
1473
1676
 
@@ -1480,6 +1683,13 @@ declare const CNGX_POPOVER_ARROW_BOUNDS: InjectionToken<CngxPopoverArrowBounds>;
1480
1683
  * `closeOnOutsideClick`, `mode`, `exclusive`, `cngxPopoverOpen`) are
1481
1684
  * forwarded.
1482
1685
  *
1686
+ * ### Focus return
1687
+ * On by default: when the panel closes and focus would otherwise be lost
1688
+ * (on `body` or inside the panel), its `CngxPopoverTrigger` returns focus
1689
+ * to the element focused before open. Opt out with `[restoreFocus]="false"`
1690
+ * on the trigger. A close that moves focus to another control leaves it
1691
+ * there.
1692
+ *
1483
1693
  * The `variant` input is a free-form string mapped to a CSS class
1484
1694
  * (`cngx-popover-panel--{variant}`). Five variants are pre-themed
1485
1695
  * in `popover-panel-theme.scss`: `default`, `info`, `warning`,
@@ -1492,10 +1702,8 @@ declare const CNGX_POPOVER_ARROW_BOUNDS: InjectionToken<CngxPopoverArrowBounds>;
1492
1702
  * <span cngxPopoverHeader>Delete Item?</span>
1493
1703
  * <p cngxPopoverBody>This action cannot be undone.</p>
1494
1704
  * <div cngxPopoverFooter>
1495
- * <cngx-popover-action role="dismiss">Cancel</cngx-popover-action>
1496
- * <cngx-popover-action role="confirm" [action]="delete" variant="danger">
1497
- * Delete
1498
- * </cngx-popover-action>
1705
+ * <button cngxPopoverDismiss>Cancel</button>
1706
+ * <button cngxPopoverAction="solid" tone="danger" [action]="delete">Delete</button>
1499
1707
  * </div>
1500
1708
  * </cngx-popover-panel>
1501
1709
  * ```
@@ -1509,20 +1717,28 @@ declare const CNGX_POPOVER_ARROW_BOUNDS: InjectionToken<CngxPopoverArrowBounds>;
1509
1717
  * </cngx-popover-panel>
1510
1718
  * ```
1511
1719
  *
1512
- * @category common/popover
1513
- * @docsKind primary
1720
+ * ### State copy
1721
+ * The loading, error and empty views never render an empty box. Without a
1722
+ * slot template each shows default copy, resolved in this order: the
1723
+ * projected `*cngxPopoverLoading` / `*cngxPopoverError` / `*cngxPopoverEmpty`
1724
+ * template (replaces the whole node), then `[loadingText]` / `[errorText]` /
1725
+ * `[emptyText]`, then `withPopoverPanelLabels(...)`, then the `popover`
1726
+ * section of the language pack. The header row (title and close button)
1727
+ * stays in every view.
1728
+ *
1514
1729
  * @wcag AA
1515
1730
  * @github https://github.com/cngxjs/cngx/blob/main/projects/common/popover/popover-panel.component.ts
1516
- * @since 0.1.0
1517
- * @relatedTo CngxPopover, CngxPopoverAction, CngxPopoverHeader, CngxPopoverBody, CngxPopoverFooter
1731
+ * @since 0.3.0
1732
+ * @relatedTo CngxPopover, CngxPopoverAction, CngxPopoverDismiss, CngxPopoverHeader, CngxPopoverBody, CngxPopoverFooter
1518
1733
  * @slot cngxPopoverArrow Replaces the pointer that ties the panel to its trigger.
1519
1734
  * @slot cngxPopoverClose Replaces the dismiss control.
1520
1735
  * @slot cngxPopoverLoading Rendered while the panel's content is loading.
1521
1736
  * @slot cngxPopoverEmpty Rendered when the panel has nothing to show.
1522
1737
  * @slot cngxPopoverError Rendered when the panel's content failed to load.
1523
- * <example-url>http://localhost:4200/#/common/popover/popover-panel/content-states</example-url>
1524
- * <example-url>http://localhost:4200/#/common/popover/popover-panel/variants</example-url>
1525
- * <example-url>http://localhost:4200/#/common/popover/popover-panel/with-footer-actions</example-url>
1738
+ * <example-url>/#/common/popover/popover-panel/content-states</example-url>
1739
+ * <example-url>/#/common/popover/popover-panel/variants</example-url>
1740
+ * <example-url>/#/common/popover/popover-panel/with-footer-actions</example-url>
1741
+ * @axis level organism
1526
1742
  */
1527
1743
  declare class CngxPopoverPanel implements CngxPopoverArrowBounds {
1528
1744
  /** The underlying popover state machine. */
@@ -1569,6 +1785,15 @@ declare class CngxPopoverPanel implements CngxPopoverArrowBounds {
1569
1785
  private readonly labels;
1570
1786
  /** Accessible name of the built-in close button. */
1571
1787
  protected readonly closeLabel: _angular_core.Signal<string>;
1788
+ /**
1789
+ * Copy of the state views: rendered without a slot template, handed to a
1790
+ * slot template as its `text` context. Input, then config, then pack.
1791
+ * Read tracked on purpose - the panel has no live region, so a language
1792
+ * flip only updates the visible text in place.
1793
+ */
1794
+ protected readonly resolvedLoadingText: _angular_core.Signal<string>;
1795
+ protected readonly resolvedErrorText: _angular_core.Signal<string>;
1796
+ protected readonly resolvedEmptyText: _angular_core.Signal<string>;
1572
1797
  /** Resolved showClose - input takes precedence over config. */
1573
1798
  readonly showClose: _angular_core.Signal<boolean>;
1574
1799
  /** Resolved showArrow - input takes precedence over config. */
@@ -1584,12 +1809,34 @@ declare class CngxPopoverPanel implements CngxPopoverArrowBounds {
1584
1809
  readonly error: _angular_core.InputSignal<unknown>;
1585
1810
  /** Whether the panel content is empty. Fallback when `[state]` is not set. */
1586
1811
  readonly empty: _angular_core.InputSignal<boolean>;
1587
- /** @internal Resolved loading - state takes precedence over boolean input. */
1588
- protected readonly effectiveLoading: _angular_core.Signal<boolean>;
1589
- /** @internal Resolved error - state takes precedence over direct input. */
1590
- protected readonly effectiveError: _angular_core.Signal<unknown>;
1591
- /** @internal Resolved empty - state takes precedence over boolean input. */
1592
- protected readonly effectiveEmpty: _angular_core.Signal<boolean>;
1812
+ /**
1813
+ * Text shown in the loading view when no `*cngxPopoverLoading` template is
1814
+ * projected. Unbound, it falls back to `withPopoverPanelLabels` and the
1815
+ * `popover` section of the language pack.
1816
+ */
1817
+ readonly loadingText: _angular_core.InputSignal<string | undefined>;
1818
+ /**
1819
+ * Text shown in the error view when no `*cngxPopoverError` template is
1820
+ * projected. Unbound, it falls back to `withPopoverPanelLabels` and the
1821
+ * `popover` section of the language pack.
1822
+ */
1823
+ readonly errorText: _angular_core.InputSignal<string | undefined>;
1824
+ /**
1825
+ * Text shown in the empty view when no `*cngxPopoverEmpty` template is
1826
+ * projected. Unbound, it falls back to `withPopoverPanelLabels` and the
1827
+ * `popover` section of the language pack.
1828
+ */
1829
+ readonly emptyText: _angular_core.InputSignal<string | undefined>;
1830
+ /**
1831
+ * @internal The one view the panel body renders. A bound `[state]` goes
1832
+ * through the shared `resolveAsyncView` table (the same derivation the
1833
+ * select panel uses), so a first-load error shows the error slot and an
1834
+ * idle state renders no body (`'none'`). Without `[state]` the manual
1835
+ * inputs resolve in the order loading, error, empty.
1836
+ */
1837
+ protected readonly view: _angular_core.Signal<AsyncView>;
1838
+ /** @internal The error handed to the `*cngxPopoverError` template. */
1839
+ protected readonly viewError: _angular_core.Signal<unknown>;
1593
1840
  protected readonly headerSlot: _angular_core.Signal<CngxPopoverHeader | undefined>;
1594
1841
  protected readonly footerSlot: _angular_core.Signal<CngxPopoverFooter | undefined>;
1595
1842
  protected readonly closeTpl: _angular_core.Signal<CngxPopoverClose | undefined>;
@@ -1619,105 +1866,241 @@ declare class CngxPopoverPanel implements CngxPopoverArrowBounds {
1619
1866
  private readonly uid;
1620
1867
  protected readonly headerId: string;
1621
1868
  protected readonly bodyId: string;
1869
+ protected readonly errorId: string;
1870
+ protected readonly emptyId: string;
1622
1871
  /**
1623
- * Only point to the header when one is projected - a bare id reference
1624
- * resolves even against an element that never renders (the header row is
1625
- * gated on `hasHeader()`), leaving AT with an empty accessible name.
1872
+ * Only point to the header when one is projected. The header row renders
1873
+ * in every view (loading, error, empty, content), so `hasHeader()` alone is
1874
+ * the gate: with a header the reference always resolves, and without one a
1875
+ * bare id would leave AT with an empty accessible name.
1626
1876
  */
1627
1877
  protected readonly ariaLabelledBy: _angular_core.Signal<string | null>;
1628
- /** Only point to body when default content is showing (not loading/error/empty). */
1878
+ /**
1879
+ * The surface that describes the current view: the body in `content`, the
1880
+ * error surface in `error` / `content+error`, the empty surface in `empty`.
1881
+ * Loading speaks through `aria-busy` and its visible text, and `none`
1882
+ * renders nothing, so both emit no reference. Every emitted id resolves
1883
+ * because each surface always renders in its view.
1884
+ */
1629
1885
  protected readonly ariaDescribedBy: _angular_core.Signal<string | null>;
1630
1886
  protected readonly hostClass: _angular_core.Signal<string>;
1631
1887
  private autoDismissTimer;
1632
1888
  constructor();
1633
1889
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxPopoverPanel, never>;
1634
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<CngxPopoverPanel, "cngx-popover-panel", ["cngxPopoverPanel"], { "variant": { "alias": "variant"; "required": false; "isSignal": true; }; "role": { "alias": "role"; "required": false; "isSignal": true; }; "showCloseInput": { "alias": "showClose"; "required": false; "isSignal": true; }; "showArrowInput": { "alias": "showArrow"; "required": false; "isSignal": true; }; "state": { "alias": "state"; "required": false; "isSignal": true; }; "loading": { "alias": "loading"; "required": false; "isSignal": true; }; "error": { "alias": "error"; "required": false; "isSignal": true; }; "empty": { "alias": "empty"; "required": false; "isSignal": true; }; }, {}, ["headerSlot", "footerSlot", "closeTpl", "loadingTpl", "emptyTpl", "errorTpl", "arrowTplDirective"], ["[cngxPopoverHeader]", "[cngxPopoverBody]", "*", "[cngxPopoverFooter]"], true, [{ directive: typeof CngxPopover; inputs: { "placement": "placement"; "positionTryFallbacks": "positionTryFallbacks"; "offset": "offset"; "closeOnEscape": "closeOnEscape"; "closeOnOutsideClick": "closeOnOutsideClick"; "mode": "mode"; "exclusive": "exclusive"; "cngxPopoverOpen": "cngxPopoverOpen"; }; outputs: {}; }]>;
1890
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<CngxPopoverPanel, "cngx-popover-panel", ["cngxPopoverPanel"], { "variant": { "alias": "variant"; "required": false; "isSignal": true; }; "role": { "alias": "role"; "required": false; "isSignal": true; }; "showCloseInput": { "alias": "showClose"; "required": false; "isSignal": true; }; "showArrowInput": { "alias": "showArrow"; "required": false; "isSignal": true; }; "state": { "alias": "state"; "required": false; "isSignal": true; }; "loading": { "alias": "loading"; "required": false; "isSignal": true; }; "error": { "alias": "error"; "required": false; "isSignal": true; }; "empty": { "alias": "empty"; "required": false; "isSignal": true; }; "loadingText": { "alias": "loadingText"; "required": false; "isSignal": true; }; "errorText": { "alias": "errorText"; "required": false; "isSignal": true; }; "emptyText": { "alias": "emptyText"; "required": false; "isSignal": true; }; }, {}, ["headerSlot", "footerSlot", "closeTpl", "loadingTpl", "emptyTpl", "errorTpl", "arrowTplDirective"], ["[cngxPopoverHeader]", "[cngxPopoverBody]", "*", "[cngxPopoverFooter]"], true, [{ directive: typeof CngxPopover; inputs: { "placement": "placement"; "positionTryFallbacks": "positionTryFallbacks"; "offset": "offset"; "closeOnEscape": "closeOnEscape"; "closeOnOutsideClick": "closeOnOutsideClick"; "mode": "mode"; "exclusive": "exclusive"; "cngxPopoverOpen": "cngxPopoverOpen"; }; outputs: { "opened": "opened"; "closed": "closed"; }; }]>;
1635
1891
  }
1636
1892
 
1637
1893
  /**
1638
- * Visual variant for the action button.
1894
+ * Closes the composing `CngxPopover` after each success outcome of the
1895
+ * co-hosted `CngxActionStatusBrain` (an own run, or a `success` edge of a
1896
+ * bound `[externalState]`): `CNGX_POPOVER_PANEL_CONFIG.closeOnSuccessDelay`
1897
+ * (`withCloseOnSuccess()`), or `[closeOnSuccessDelay]` per instance. A
1898
+ * follow-up run cancels a scheduled close. Focus returns to the trigger
1899
+ * through the panel's restore claim; this directive restores nothing.
1900
+ *
1901
+ * The runner's live region sits inside the panel, which hides after the
1902
+ * delay (maybe 0 ms) and can take the text with it before AT reads it. So
1903
+ * a success that arms a close is covered (`CNGX_ANNOUNCEMENT_COVER`, the
1904
+ * region gets `''`) and spoken through `CngxLiveAnnouncer` outside, scoped
1905
+ * to the popover's parent, once, with the text `CNGX_ACTION_STATUS` resolves
1906
+ * for it, unless another co-hosted cover (a toast) voices it already. Only
1907
+ * this arming case is covered here: the runner speaks any other settle in a
1908
+ * closed panel through `CngxLiveAnnouncer` itself. A selector-less host
1909
+ * directive; `CngxPopoverAction` co-hosts it
1910
+ * next to `CngxActionStatusBrain`.
1639
1911
  *
1640
- * @category common/popover
1912
+ * @wcag AA
1913
+ * @github https://github.com/cngxjs/cngx/blob/main/projects/common/popover/popover-close-on-success.directive.ts
1914
+ * @since 0.3.0
1915
+ * @relatedTo CngxPopoverAction, CngxActionStatusBrain, CNGX_ANNOUNCEMENT_COVER, CNGX_POPOVER_PANEL_CONFIG
1916
+ * <example-url>/#/common/popover/popover-panel/close-on-success</example-url>
1917
+ * @axis level molecule
1641
1918
  */
1642
- type PopoverActionVariant = 'primary' | 'secondary' | 'danger' | 'ghost';
1919
+ declare class CngxPopoverCloseOnSuccess implements CngxAnnouncementCover {
1920
+ private readonly popover;
1921
+ private readonly config;
1922
+ private readonly announcer;
1923
+ private readonly status;
1924
+ private readonly injector;
1925
+ private readonly coverUnits;
1926
+ /**
1927
+ * Per-instance close-on-success, named after the
1928
+ * `CNGX_POPOVER_PANEL_CONFIG.closeOnSuccessDelay` it overrides. A number
1929
+ * closes the composing popover that many ms after each success, also
1930
+ * without `withCloseOnSuccess()`; `null` keeps this confirm's popover open
1931
+ * although the config closes it; unbound (`undefined`) uses the config.
1932
+ */
1933
+ readonly closeOnSuccessDelay: _angular_core.InputSignal<number | null | undefined>;
1934
+ private closeOnSuccessTimer;
1935
+ constructor();
1936
+ /** `true` for a success that arms a close: it is spoken outside the panel instead. */
1937
+ covers(status: 'success' | 'error'): boolean;
1938
+ /** One outcome: re-arms the close and speaks a closing success outside the panel. */
1939
+ private handleOutcome;
1940
+ private announceOutside;
1941
+ /** `true` when another co-hosted cover (a toast) already voices the success. */
1942
+ private coveredElsewhere;
1943
+ /** The close delay an outcome arms, or `undefined` when it closes nothing. */
1944
+ private closeDelayFor;
1945
+ private clearCloseOnSuccessTimer;
1946
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxPopoverCloseOnSuccess, never>;
1947
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CngxPopoverCloseOnSuccess, never, ["cngxPopoverCloseOnSuccess"], { "closeOnSuccessDelay": { "alias": "closeOnSuccessDelay"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
1948
+ }
1949
+
1643
1950
  /**
1644
- * Action button for use inside `cngx-popover-panel` footer.
1645
- *
1646
- * Two roles:
1647
- * - `'dismiss'` - closes the panel on click (no async action).
1648
- * - `'confirm'` - executes an async action, shows status templates,
1649
- * optionally auto-closes the panel on success.
1650
- *
1651
- * Supports the same `cngxPending`/`cngxSucceeded`/`cngxFailed` templates
1652
- * as `CngxActionButton`, or use `status()` + `@switch` for full control.
1653
- *
1654
- * ### Dismiss button
1655
- * ```html
1656
- * <cngx-popover-action role="dismiss">Cancel</cngx-popover-action>
1657
- * ```
1951
+ * Async confirm button for a `cngx-popover-panel` footer. A
1952
+ * `CngxButtonBrain` host on the native `<button>` with `cngxAsyncClick`
1953
+ * co-hosted: `[action]` (required) runs on click, and the button stylesheet
1954
+ * paints it. The variant is the selector's own value (default `outline`),
1955
+ * `tone` and `size` are inputs, and the size is pinned to `sm` against the
1956
+ * group and the config (the input still wins). Tone comes from the button
1957
+ * family, not from the panel variant. To close without a run, use
1958
+ * `button[cngxPopoverDismiss]`.
1959
+ *
1960
+ * `disabled` renders `aria-disabled="true"`, keeps the button focusable,
1961
+ * refuses the run and references a `disabledReason` through
1962
+ * `aria-describedby`. `aria-busy`, `data-pending` and `data-busy` come from
1963
+ * the brain over the co-hosted run.
1964
+ *
1965
+ * Supports the `cngxPending` / `cngxSucceeded` / `cngxFailed` templates and
1966
+ * the `pendingLabel` / `succeededLabel` / `failedLabel` strings of
1967
+ * `CngxActionButton`, or use `status()` + `@switch` for full control.
1968
+ * `[externalState]` reflects a run started elsewhere, `(outcome)` emits once
1969
+ * per own settle and per external `success` / `error` edge. The
1970
+ * label follows the busy gate (`CNGX_LOADING_CONFIG.showDelay`, held for
1971
+ * `minDwell`; `[showDelay]` / `[minDwell]` per button): while the busy
1972
+ * visual shows, through the run and its dwell after the settle, the pending
1973
+ * template stays visible with no spinner, and without one the spinner covers
1974
+ * the idle label. The result templates show once the busy visual releases, so
1975
+ * a fast run goes from the idle label straight to the result. Every label
1976
+ * cell stays mounted in one grid cell (the inactive ones `visibility: hidden`
1977
+ * and `aria-hidden`), so the button keeps the width of its widest label and a
1978
+ * right-aligned footer never shifts; the active cell alone names it. `status()`
1979
+ * stays immediate; branch a hand-rolled `@switch` on {@link busyVisible} for
1980
+ * the same timing.
1981
+ *
1982
+ * The status layer comes from the `CngxActionStatusBrain` host directive
1983
+ * (read through `CNGX_ACTION_STATUS`) and close-on-success from the
1984
+ * `CngxPopoverCloseOnSuccess` host directive; the component is the skin.
1985
+ * Each settle is spoken once through the `cngxAsyncClick` live region next
1986
+ * to the button: `succeededAnnouncement` / `failedAnnouncement`, else the
1987
+ * text of the rendered result template (`aria-hidden` parts skipped; read
1988
+ * from its cell even while the dwell still hides it), else
1989
+ * `CNGX_INTERACTIVE_I18N.asyncClickSucceeded` / `asyncClickFailed`.
1990
+ * `announce="never"` keeps the region empty. Under
1991
+ * `withCloseOnSuccess()` the panel closes once per success; focus returns
1992
+ * to the trigger through the panel's restore claim; `[closeOnSuccessDelay]`
1993
+ * overrides the config per confirm (`null` turns it off). A success that closes
1994
+ * the panel is spoken through `CngxLiveAnnouncer` outside it instead (the
1995
+ * sibling region hides with the panel), still once.
1996
+ *
1997
+ * Migration from `cngx-popover-action`: `variant="primary"` is
1998
+ * `cngxPopoverAction="solid" tone="primary"`, `variant="danger"` is
1999
+ * `cngxPopoverAction="solid" tone="danger"`, `variant="ghost"` is
2000
+ * `cngxPopoverAction="ghost"`, `variant="secondary"` is the default
2001
+ * `outline`; `role="dismiss"` is `button[cngxPopoverDismiss]`.
1658
2002
  *
1659
2003
  * ### Confirm with templates
1660
2004
  * ```html
1661
- * <cngx-popover-action role="confirm" [action]="save" variant="primary">
2005
+ * <button cngxPopoverAction="solid" tone="primary" [action]="save">
1662
2006
  * Save
1663
2007
  * <ng-template cngxPending>Saving...</ng-template>
1664
2008
  * <ng-template cngxSucceeded>Saved!</ng-template>
1665
2009
  * <ng-template cngxFailed let-err>{{ err }}</ng-template>
1666
- * </cngx-popover-action>
2010
+ * </button>
1667
2011
  * ```
1668
2012
  *
1669
- * ### With @switch
2013
+ * ### With `@switch`
1670
2014
  * ```html
1671
- * <cngx-popover-action role="confirm" [action]="save" #act="cngxPopoverAction">
2015
+ * <button cngxPopoverAction [action]="save" #act="cngxPopoverAction">
1672
2016
  * @switch (act.status()) {
1673
- * @case ('pending') { Saving... }
2017
+ * @case ('pending') { Saving... }
1674
2018
  * @case ('success') { Done }
1675
- * @default { Save }
2019
+ * @default { Save }
1676
2020
  * }
1677
- * </cngx-popover-action>
2021
+ * </button>
1678
2022
  * ```
1679
2023
  *
1680
- * @category common/popover
1681
- * @docsKind primary
1682
2024
  * @wcag AA
1683
2025
  * @github https://github.com/cngxjs/cngx/blob/main/projects/common/popover/popover-action.component.ts
1684
- * @since 0.1.0
1685
- * @relatedTo CngxPopoverPanel, CngxPopoverFooter
1686
- * @slot cngxPending Rendered while the action is running.
1687
- * @slot cngxSucceeded Rendered after the action succeeds.
1688
- * @slot cngxFailed Rendered when the action fails; gets the error.
1689
- * <example-url>http://localhost:4200/#/common/popover/popover-panel/content-states</example-url>
1690
- * <example-url>http://localhost:4200/#/common/popover/popover-panel/variants</example-url>
1691
- * <example-url>http://localhost:4200/#/common/popover/popover-panel/with-footer-actions</example-url>
2026
+ * @since 0.3.0
2027
+ * @relatedTo CngxPopoverDismiss, CngxPopoverPanel, CngxPopoverFooter, CngxButtonBrain, CngxAsyncClick, CngxActionStatusBrain, CngxPopoverCloseOnSuccess
2028
+ * @slot cngxPending Replaces the label while the action runs, once the run outlasts the show delay.
2029
+ * @slot cngxSucceeded Replaces the label after the action succeeds, once the busy visual releases.
2030
+ * @slot cngxFailed Replaces the label when the action fails, once the busy visual releases; gets the error.
2031
+ * <example-url>/#/common/popover/popover-panel/with-footer-actions</example-url>
2032
+ * <example-url>/#/common/popover/popover-panel/with-dividers</example-url>
2033
+ * <example-url>/#/common/popover/popover-panel/footer-actions-plain</example-url>
2034
+ * <example-url>/#/common/popover/popover-panel/close-on-success</example-url>
2035
+ * @axis level organism
1692
2036
  */
1693
2037
  declare class CngxPopoverAction {
1694
- private readonly popover;
1695
- private readonly config;
1696
- private readonly destroyRef;
1697
- /** Button role: `'dismiss'` closes immediately, `'confirm'` runs an async action. */
1698
- readonly role: _angular_core.InputSignal<"dismiss" | "confirm">;
1699
- /** The async action to execute (only for `role="confirm"`). */
1700
- readonly action: _angular_core.InputSignal<AsyncAction | undefined>;
1701
- /** Visual variant for the button. */
1702
- readonly variant: _angular_core.InputSignal<PopoverActionVariant>;
1703
- /** Duration in ms to show success/error feedback. */
1704
- readonly feedbackDuration: _angular_core.InputSignal<number>;
1705
- protected readonly pendingTpl: _angular_core.Signal<CngxPending | undefined>;
1706
- protected readonly succeededTpl: _angular_core.Signal<CngxSucceeded | undefined>;
1707
- protected readonly failedTpl: _angular_core.Signal<CngxFailed | undefined>;
1708
- private readonly asyncClick;
1709
- /**
1710
- * Lifecycle status of the confirm action - `'idle' | 'pending' | 'success'
1711
- * | 'error'`, mirroring the internal `CngxAsyncClick`. Always `'idle'` for
1712
- * `role="dismiss"` (there is no async lifecycle to report).
1713
- */
1714
- readonly status: _angular_core.Signal<AsyncStatus>;
1715
- private closeOnSuccessTimer;
1716
- constructor();
1717
- protected handleDismiss(): void;
1718
- private clearCloseOnSuccessTimer;
2038
+ protected readonly brain: CngxButtonBrain;
2039
+ protected readonly actionStatus: i2.CngxActionStatus;
2040
+ protected readonly startSlot: Signal<CngxButtonStart | undefined>;
2041
+ protected readonly endSlot: Signal<CngxButtonEnd | undefined>;
2042
+ /**
2043
+ * Effective status - `'idle' | 'pending' | 'success' | 'error'`:
2044
+ * `[externalState]` when bound, else the run. Immediate, not gated.
2045
+ */
2046
+ readonly status: Signal<AsyncStatus>;
2047
+ /**
2048
+ * `true` while the busy visual shows: the run after the loading config's
2049
+ * show delay, held for its min-dwell.
2050
+ */
2051
+ readonly busyVisible: Signal<boolean>;
2052
+ /**
2053
+ * `CngxAsyncState` view of the effective lifecycle (`[externalState]` when
2054
+ * bound, else the run). Bind it to a state consumer: `[state]="act.state"`
2055
+ * on `cngxToastOn` or `cngxAlertOn`.
2056
+ */
2057
+ readonly state: CngxAsyncState<unknown>;
1719
2058
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxPopoverAction, never>;
1720
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<CngxPopoverAction, "cngx-popover-action", ["cngxPopoverAction"], { "role": { "alias": "role"; "required": false; "isSignal": true; }; "action": { "alias": "action"; "required": false; "isSignal": true; }; "variant": { "alias": "variant"; "required": false; "isSignal": true; }; "feedbackDuration": { "alias": "feedbackDuration"; "required": false; "isSignal": true; }; }, {}, ["pendingTpl", "succeededTpl", "failedTpl"], ["*"], true, never>;
2059
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<CngxPopoverAction, "button[cngxPopoverAction]", ["cngxPopoverAction"], {}, {}, ["startSlot", "endSlot"], ["[cngxButtonStart]", "*", "[cngxButtonEnd]"], true, [{ directive: typeof i1$1.CngxButtonBrain; inputs: { "variant": "cngxPopoverAction"; "tone": "tone"; "size": "size"; "disabled": "disabled"; "disabledReason": "disabledReason"; "cngxDescribedBy": "cngxDescribedBy"; "type": "type"; }; outputs: {}; }, { directive: typeof i2.CngxAsyncClick; inputs: { "cngxAsyncClick": "action"; "feedbackDuration": "feedbackDuration"; "showDelay": "showDelay"; "minDwell": "minDwell"; }; outputs: { "settled": "settled"; }; }, { directive: typeof i2.CngxActionStatusBrain; inputs: { "succeededAnnouncement": "succeededAnnouncement"; "failedAnnouncement": "failedAnnouncement"; "announce": "announce"; "pendingLabel": "pendingLabel"; "succeededLabel": "succeededLabel"; "failedLabel": "failedLabel"; "externalState": "externalState"; }; outputs: { "outcome": "outcome"; }; }, { directive: typeof CngxPopoverCloseOnSuccess; inputs: { "closeOnSuccessDelay": "closeOnSuccessDelay"; }; outputs: {}; }]>;
2060
+ }
2061
+
2062
+ /**
2063
+ * Footer button that closes the popover it sits in. A `CngxButtonBrain`
2064
+ * host on the native `<button>`, painted by the button stylesheet: the
2065
+ * variant is the selector's own value (default `outline`), `tone` and
2066
+ * `size` are inputs, and the size is pinned to `sm` against the group and
2067
+ * the config (the input still wins).
2068
+ *
2069
+ * `disabled` renders `aria-disabled="true"`, keeps the button focusable,
2070
+ * swallows the click (the popover stays open) and references a
2071
+ * `disabledReason` through `aria-describedby`. Focus returns to the
2072
+ * trigger through the composing `CngxPopoverPanel`, which claims the
2073
+ * restore; the button has no restore of its own. Outside a popover the
2074
+ * click does nothing.
2075
+ *
2076
+ * For an async confirm next to it, use `button[cngxPopoverAction]`.
2077
+ *
2078
+ * ```html
2079
+ * <div cngxPopoverFooter>
2080
+ * <button cngxPopoverDismiss>Cancel</button>
2081
+ * <button cngxPopoverAction="solid" tone="danger" [action]="delete">Delete</button>
2082
+ * </div>
2083
+ * ```
2084
+ *
2085
+ * @wcag AA
2086
+ * @github https://github.com/cngxjs/cngx/blob/main/projects/common/popover/popover-dismiss.component.ts
2087
+ * @since 0.3.0
2088
+ * @relatedTo CngxPopoverAction, CngxPopoverPanel, CngxPopoverFooter, CngxButtonBrain
2089
+ * <example-url>/#/common/popover/popover-panel/with-footer-actions</example-url>
2090
+ * <example-url>/#/common/popover/popover-panel/with-dividers</example-url>
2091
+ * <example-url>/#/common/popover/popover-panel/footer-actions-plain</example-url>
2092
+ * <example-url>/#/common/popover/popover-panel/close-on-success</example-url>
2093
+ * @axis level molecule
2094
+ */
2095
+ declare class CngxPopoverDismiss {
2096
+ private readonly popover;
2097
+ /** @internal */
2098
+ protected readonly brain: CngxButtonBrain;
2099
+ protected readonly startSlot: _angular_core.Signal<CngxButtonStart | undefined>;
2100
+ protected readonly endSlot: _angular_core.Signal<CngxButtonEnd | undefined>;
2101
+ protected handleClick(): void;
2102
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxPopoverDismiss, never>;
2103
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<CngxPopoverDismiss, "button[cngxPopoverDismiss]", ["cngxPopoverDismiss"], {}, {}, ["startSlot", "endSlot"], ["[cngxButtonStart]", "*", "[cngxButtonEnd]"], true, [{ directive: typeof i1$1.CngxButtonBrain; inputs: { "variant": "cngxPopoverDismiss"; "tone": "tone"; "size": "size"; "disabled": "disabled"; "disabledReason": "disabledReason"; "cngxDescribedBy": "cngxDescribedBy"; "type": "type"; }; outputs: {}; }]>;
1721
2104
  }
1722
2105
 
1723
2106
  /**
@@ -1746,21 +2129,20 @@ declare class CngxPopoverAction {
1746
2129
  * ### Vertical separator between footer action groups
1747
2130
  * ```html
1748
2131
  * <div cngxPopoverFooter>
1749
- * <cngx-popover-action role="dismiss">Cancel</cngx-popover-action>
2132
+ * <button cngxPopoverDismiss>Cancel</button>
1750
2133
  * <span cngxPopoverDivider orientation="vertical"></span>
1751
- * <cngx-popover-action role="confirm" [action]="save">Save</cngx-popover-action>
2134
+ * <button cngxPopoverAction [action]="save">Save</button>
1752
2135
  * </div>
1753
2136
  * ```
1754
2137
  *
1755
- * @category common/popover
1756
2138
  * @github https://github.com/cngxjs/cngx/blob/main/projects/common/popover/popover-divider.directive.ts
1757
- * @since 0.1.0
2139
+ * @since 0.3.0
1758
2140
  * @relatedTo CngxPopoverPanel, CngxDivider
1759
2141
  */
1760
2142
  declare class CngxPopoverDivider {
1761
2143
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxPopoverDivider, never>;
1762
- static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CngxPopoverDivider, "[cngxPopoverDivider]", ["cngxPopoverDivider"], {}, {}, never, never, true, [{ directive: typeof i1$1.CngxDivider; inputs: { "orientation": "orientation"; "inset": "inset"; }; outputs: {}; }]>;
2144
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CngxPopoverDivider, "[cngxPopoverDivider]", ["cngxPopoverDivider"], {}, {}, never, never, true, [{ directive: typeof i1$2.CngxDivider; inputs: { "orientation": "orientation"; "inset": "inset"; }; outputs: {}; }]>;
1763
2145
  }
1764
2146
 
1765
- export { CNGX_FLOATING_FALLBACK, CNGX_POPOVER_ARROW_BOUNDS, CNGX_POPOVER_LANGUAGE_EN, CNGX_POPOVER_PANEL_CONFIG, CngxPopover, CngxPopoverAction, CngxPopoverAnchor, CngxPopoverArrow, CngxPopoverBody, CngxPopoverClose, CngxPopoverDivider, CngxPopoverEmpty, CngxPopoverError, CngxPopoverFooter, CngxPopoverHeader, CngxPopoverLoading, CngxPopoverPanel, CngxPopoverSheet, CngxPopoverSheetHandle, CngxPopoverSheetHeader, CngxPopoverSheetInitialFocus, CngxPopoverSheetTitle, CngxPopoverTrigger, CngxTooltip, provideFloatingFallback, providePopoverPanel, withArrow, withArrowTemplate, withAutoDismiss, withCloseButton, withCloseOnSuccess, withDefaultVariant, withPopoverPanelLabels };
1766
- export type { ArrowEdge, CngxPopoverArrowBounds, CngxPopoverArrowContext, CngxPopoverLanguageSection, CngxPopoverPanelConfig, CngxPopoverPanelLabels, CngxPopoverPresentation, CngxPopoverPresentationRequest, CngxPopoverSheetCloseReason, ComputePositionFn, FloatingFallbackConfig, PopoverActionVariant, PopoverHaspopup, PopoverMode, PopoverPanelFeature, PopoverPanelRole, PopoverPlacement, PopoverPositionTryFallback, PopoverState, TooltipTriggerMode };
2147
+ export { CNGX_FLOATING_FALLBACK, CNGX_POPOVER_ARROW_BOUNDS, CNGX_POPOVER_LANGUAGE_EN, CNGX_POPOVER_PANEL_CONFIG, CngxPopover, CngxPopoverAction, CngxPopoverAnchor, CngxPopoverArrow, CngxPopoverBody, CngxPopoverClose, CngxPopoverCloseOnSuccess, CngxPopoverDismiss, CngxPopoverDivider, CngxPopoverEmpty, CngxPopoverError, CngxPopoverFooter, CngxPopoverHeader, CngxPopoverLoading, CngxPopoverPanel, CngxPopoverSheet, CngxPopoverSheetHandle, CngxPopoverSheetHeader, CngxPopoverSheetInitialFocus, CngxPopoverSheetTitle, CngxPopoverTrigger, CngxTooltip, provideFloatingFallback, providePopoverPanel, withArrow, withArrowTemplate, withAutoDismiss, withCloseButton, withCloseOnSuccess, withDefaultVariant, withPopoverPanelLabels };
2148
+ export type { ArrowEdge, CngxPopoverArrowBounds, CngxPopoverArrowContext, CngxPopoverErrorContext, CngxPopoverLanguageSection, CngxPopoverPanelConfig, CngxPopoverPanelLabels, CngxPopoverPresentation, CngxPopoverPresentationRequest, CngxPopoverSheetCloseReason, CngxPopoverStateCopyContext, ComputePositionFn, FloatingFallbackConfig, PopoverHaspopup, PopoverMode, PopoverPanelFeature, PopoverPanelRole, PopoverPlacement, PopoverPositionTryFallback, PopoverState, TooltipTriggerMode };