@cngx/ui 0.1.0-rc.6 → 0.1.0-rc.8

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 (102) hide show
  1. package/README.md +112 -1
  2. package/a11y/README.md +87 -0
  3. package/accordion/README.md +4 -2
  4. package/breadcrumb/README.md +262 -0
  5. package/collection/README.md +6 -0
  6. package/command-palette/README.md +224 -0
  7. package/context-menu/README.md +98 -0
  8. package/data-grid-accordion/README.md +103 -2
  9. package/feedback/README.md +42 -0
  10. package/fesm2022/cngx-ui-a11y.mjs +452 -0
  11. package/fesm2022/cngx-ui-a11y.mjs.map +1 -0
  12. package/fesm2022/cngx-ui-accordion.mjs +116 -38
  13. package/fesm2022/cngx-ui-accordion.mjs.map +1 -1
  14. package/fesm2022/cngx-ui-action-button.mjs +115 -50
  15. package/fesm2022/cngx-ui-action-button.mjs.map +1 -1
  16. package/fesm2022/cngx-ui-breadcrumb.mjs +181 -96
  17. package/fesm2022/cngx-ui-breadcrumb.mjs.map +1 -1
  18. package/fesm2022/cngx-ui-chart-panel.mjs +586 -0
  19. package/fesm2022/cngx-ui-chart-panel.mjs.map +1 -0
  20. package/fesm2022/cngx-ui-collection.mjs +207 -66
  21. package/fesm2022/cngx-ui-collection.mjs.map +1 -1
  22. package/fesm2022/cngx-ui-command-palette.mjs +1281 -0
  23. package/fesm2022/cngx-ui-command-palette.mjs.map +1 -0
  24. package/fesm2022/cngx-ui-context-menu.mjs +857 -0
  25. package/fesm2022/cngx-ui-context-menu.mjs.map +1 -0
  26. package/fesm2022/cngx-ui-data-grid-accordion.mjs +498 -111
  27. package/fesm2022/cngx-ui-data-grid-accordion.mjs.map +1 -1
  28. package/fesm2022/cngx-ui-empty-state.mjs +16 -6
  29. package/fesm2022/cngx-ui-empty-state.mjs.map +1 -1
  30. package/fesm2022/cngx-ui-feedback.mjs +1095 -521
  31. package/fesm2022/cngx-ui-feedback.mjs.map +1 -1
  32. package/fesm2022/cngx-ui-layout.mjs +18 -9
  33. package/fesm2022/cngx-ui-layout.mjs.map +1 -1
  34. package/fesm2022/cngx-ui-mat-accordion.mjs +84 -16
  35. package/fesm2022/cngx-ui-mat-accordion.mjs.map +1 -1
  36. package/fesm2022/cngx-ui-mat-paginator.mjs +67 -24
  37. package/fesm2022/cngx-ui-mat-paginator.mjs.map +1 -1
  38. package/fesm2022/cngx-ui-mat-stepper.mjs +72 -47
  39. package/fesm2022/cngx-ui-mat-stepper.mjs.map +1 -1
  40. package/fesm2022/cngx-ui-mat-tabs.mjs +370 -203
  41. package/fesm2022/cngx-ui-mat-tabs.mjs.map +1 -1
  42. package/fesm2022/cngx-ui-overlay.mjs +69 -13
  43. package/fesm2022/cngx-ui-overlay.mjs.map +1 -1
  44. package/fesm2022/cngx-ui-paginator.mjs +501 -182
  45. package/fesm2022/cngx-ui-paginator.mjs.map +1 -1
  46. package/fesm2022/cngx-ui-sidenav.mjs +327 -106
  47. package/fesm2022/cngx-ui-sidenav.mjs.map +1 -1
  48. package/fesm2022/cngx-ui-skeleton.mjs +22 -21
  49. package/fesm2022/cngx-ui-skeleton.mjs.map +1 -1
  50. package/fesm2022/cngx-ui-speak.mjs +107 -8
  51. package/fesm2022/cngx-ui-speak.mjs.map +1 -1
  52. package/fesm2022/cngx-ui-stat-card.mjs +718 -0
  53. package/fesm2022/cngx-ui-stat-card.mjs.map +1 -0
  54. package/fesm2022/cngx-ui-stepper.mjs +217 -76
  55. package/fesm2022/cngx-ui-stepper.mjs.map +1 -1
  56. package/fesm2022/cngx-ui-tabs.mjs +40 -19
  57. package/fesm2022/cngx-ui-tabs.mjs.map +1 -1
  58. package/fesm2022/cngx-ui-timeline.mjs +548 -0
  59. package/fesm2022/cngx-ui-timeline.mjs.map +1 -0
  60. package/fesm2022/cngx-ui-toc.mjs +748 -0
  61. package/fesm2022/cngx-ui-toc.mjs.map +1 -0
  62. package/fesm2022/cngx-ui.mjs +16 -21
  63. package/fesm2022/cngx-ui.mjs.map +1 -1
  64. package/mat-accordion/README.md +1 -1
  65. package/mat-paginator/README.md +9 -2
  66. package/mat-tabs/styles/mat-tabs.css +29 -27
  67. package/overlay/README.md +9 -4
  68. package/package.json +32 -1
  69. package/paginator/README.md +8 -4
  70. package/sidenav/README.md +33 -11
  71. package/skeleton/README.md +2 -0
  72. package/speak/README.md +3 -2
  73. package/stepper/README.md +15 -3
  74. package/timeline/README.md +350 -0
  75. package/toc/README.md +186 -0
  76. package/types/cngx-ui-a11y.d.ts +394 -0
  77. package/types/cngx-ui-accordion.d.ts +100 -30
  78. package/types/cngx-ui-action-button.d.ts +47 -3
  79. package/types/cngx-ui-breadcrumb.d.ts +159 -58
  80. package/types/cngx-ui-chart-panel.d.ts +382 -0
  81. package/types/cngx-ui-collection.d.ts +159 -58
  82. package/types/cngx-ui-command-palette.d.ts +565 -0
  83. package/types/cngx-ui-context-menu.d.ts +559 -0
  84. package/types/cngx-ui-data-grid-accordion.d.ts +344 -51
  85. package/types/cngx-ui-empty-state.d.ts +9 -2
  86. package/types/cngx-ui-feedback.d.ts +664 -73
  87. package/types/cngx-ui-layout.d.ts +8 -3
  88. package/types/cngx-ui-mat-accordion.d.ts +32 -4
  89. package/types/cngx-ui-mat-paginator.d.ts +37 -8
  90. package/types/cngx-ui-mat-stepper.d.ts +23 -11
  91. package/types/cngx-ui-mat-tabs.d.ts +218 -23
  92. package/types/cngx-ui-overlay.d.ts +56 -10
  93. package/types/cngx-ui-paginator.d.ts +416 -132
  94. package/types/cngx-ui-sidenav.d.ts +248 -74
  95. package/types/cngx-ui-skeleton.d.ts +18 -7
  96. package/types/cngx-ui-speak.d.ts +118 -5
  97. package/types/cngx-ui-stat-card.d.ts +411 -0
  98. package/types/cngx-ui-stepper.d.ts +81 -29
  99. package/types/cngx-ui-tabs.d.ts +22 -6
  100. package/types/cngx-ui-timeline.d.ts +495 -0
  101. package/types/cngx-ui-toc.d.ts +581 -0
  102. package/types/cngx-ui.d.ts +8 -5
@@ -1,9 +1,9 @@
1
1
  import { NgTemplateOutlet } from '@angular/common';
2
2
  import * as i0 from '@angular/core';
3
- import { inject, input, viewChild, computed, signal, contentChild, effect, ViewEncapsulation, ChangeDetectionStrategy, Component } from '@angular/core';
4
- import { CngxAsyncClick, reflectAsyncDisplayStatus, CngxPending, CngxSucceeded, CngxFailed } from '@cngx/common/interactive';
5
- import { buildAsyncStateView, createTransitionTracker } from '@cngx/core/utils';
6
- import { CngxToaster, CngxToastOn } from '@cngx/ui/feedback';
3
+ import { inject, input, viewChild, computed, untracked, signal, contentChild, effect, ViewEncapsulation, ChangeDetectionStrategy, Component } from '@angular/core';
4
+ import { injectInteractiveI18n, CngxAsyncClick, reflectAsyncDisplayStatus, CngxPending, CngxSucceeded, CngxFailed } from '@cngx/common/interactive';
5
+ import { nextUid, buildAsyncStateView, createTransitionTracker } from '@cngx/core/utils';
6
+ import { CngxToaster, injectErrorDetail, injectFeedbackI18n, CngxToastOn } from '@cngx/ui/feedback';
7
7
 
8
8
  /**
9
9
  * Action button organism with built-in status communication.
@@ -54,13 +54,19 @@ import { CngxToaster, CngxToastOn } from '@cngx/ui/feedback';
54
54
  * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/action-button/action-button.ts
55
55
  * @since 0.1.0
56
56
  * @relatedTo CngxAsyncClick, CngxPending, CngxSucceeded, CngxFailed, CngxToaster
57
+ * @slot cngxPending Replaces the label while the action runs.
58
+ * @slot cngxSucceeded Replaces the label after the action succeeds.
59
+ * @slot cngxFailed Replaces the label when the action fails; gets the error.
57
60
  * <example-url>http://localhost:4200/#/ui/action-button/async-button/random-outcome</example-url>
58
61
  * <example-url>http://localhost:4200/#/ui/action-button/async-button/string-labels</example-url>
59
62
  * <example-url>http://localhost:4200/#/ui/action-button/async-button/template-slots</example-url>
60
63
  */
61
64
  class CngxActionButton {
62
65
  toaster = inject(CngxToaster, { optional: true });
66
+ errorDetail = injectErrorDetail();
67
+ feedbackI18n = injectFeedbackI18n();
63
68
  externalToastOn = inject(CngxToastOn, { self: true, optional: true });
69
+ i18n = injectInteractiveI18n();
64
70
  /** The async action to execute on click. */
65
71
  action = input.required(...(ngDevMode ? [{ debugName: "action" }] : /* istanbul ignore next */ []));
66
72
  /** Duration in ms to show success/error feedback. Passed through to `cngxAsyncClick`. */
@@ -71,9 +77,15 @@ class CngxActionButton {
71
77
  type = input('button', ...(ngDevMode ? [{ debugName: "type" }] : /* istanbul ignore next */ []));
72
78
  /** Visual variant - sets CSS class `cngx-action-button--{variant}`. */
73
79
  variant = input('primary', ...(ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []));
74
- /** SR announcement on success. Falls back to `succeededLabel`, then `'Action succeeded'`. */
80
+ /**
81
+ * SR announcement on success. Falls back to `succeededLabel`, then
82
+ * `CNGX_INTERACTIVE_I18N.asyncClickSucceeded`.
83
+ */
75
84
  succeededAnnouncement = input(undefined, ...(ngDevMode ? [{ debugName: "succeededAnnouncement" }] : /* istanbul ignore next */ []));
76
- /** SR announcement on failure. Falls back to `failedLabel`, then `'Action failed'`. */
85
+ /**
86
+ * SR announcement on failure. Falls back to `failedLabel`, then
87
+ * `CNGX_INTERACTIVE_I18N.asyncClickFailed`.
88
+ */
77
89
  failedAnnouncement = input(undefined, ...(ngDevMode ? [{ debugName: "failedAnnouncement" }] : /* istanbul ignore next */ []));
78
90
  /** Fallback text while pending (when no `cngxPending` template is projected). */
79
91
  pendingLabel = input(undefined, ...(ngDevMode ? [{ debugName: "pendingLabel" }] : /* istanbul ignore next */ []));
@@ -86,6 +98,13 @@ class CngxActionButton {
86
98
  * When set, the button's status display follows `externalState.status()`.
87
99
  */
88
100
  externalState = input(undefined, ...(ngDevMode ? [{ debugName: "externalState" }] : /* istanbul ignore next */ []));
101
+ /**
102
+ * Reason the button is disabled, announced to screen readers while
103
+ * `[enabled]` is `false`. Rendered into a hidden region and referenced by
104
+ * `aria-describedby` only while disabled - an enabled button never carries
105
+ * the reference. No effect when `[enabled]` is `true`.
106
+ */
107
+ disabledReason = input(undefined, ...(ngDevMode ? [{ debugName: "disabledReason" }] : /* istanbul ignore next */ []));
89
108
  /**
90
109
  * Toast message on success. Requires `CngxToaster` (via `provideFeedback(withToasts())`
91
110
  * or `provideToasts()`). Silently ignored when toaster is not provided.
@@ -128,6 +147,41 @@ class CngxActionButton {
128
147
  const click = this.asyncClick();
129
148
  return click ? click.error() : undefined;
130
149
  }, ...(ngDevMode ? [{ debugName: "effectiveError" }] : /* istanbul ignore next */ []));
150
+ /** @internal - busy while the effective status (inner or external) is pending. */
151
+ effectiveBusy = computed(() => this.effectiveStatus() === 'pending', ...(ngDevMode ? [{ debugName: "effectiveBusy" }] : /* istanbul ignore next */ []));
152
+ /**
153
+ * @internal - what the inner `CngxAsyncClick` may act on: only when the
154
+ * consumer enabled it AND no effective operation is in flight. Feeding this
155
+ * as `[enabled]` routes external-pending through the atom's own click guard,
156
+ * so a click cannot start a second run while an external state is pending.
157
+ */
158
+ clickEnabled = computed(() => this.enabled() && this.effectiveStatus() !== 'pending', ...(ngDevMode ? [{ debugName: "clickEnabled" }] : /* istanbul ignore next */ []));
159
+ /**
160
+ * @internal - SR announcement derived from the effective status, so an
161
+ * external success/error settles audibly too (the inner directive only
162
+ * knows its own runs). Mirrors the label fallback chain the template uses.
163
+ */
164
+ effectiveAnnouncement = computed(() => {
165
+ switch (this.effectiveStatus()) {
166
+ case 'success':
167
+ return untracked(() => this.succeededAnnouncement() ??
168
+ this.succeededLabel() ??
169
+ this.i18n().asyncClickSucceeded);
170
+ case 'error':
171
+ return untracked(() => this.failedAnnouncement() ?? this.failedLabel() ?? this.i18n().asyncClickFailed);
172
+ default:
173
+ return '';
174
+ }
175
+ }, ...(ngDevMode ? [{ debugName: "effectiveAnnouncement" }] : /* istanbul ignore next */ []));
176
+ /** @internal - stable id for the disabled-reason region. */
177
+ reasonId = nextUid('cngx-action-button-reason');
178
+ /**
179
+ * @internal - reference the reason region only while actually disabled by
180
+ * intent and a reason exists. accname traverses a directly referenced hidden
181
+ * node, so the id must be gated on the state it describes rather than left
182
+ * permanently pointing at a hidden region.
183
+ */
184
+ describedBy = computed(() => !this.enabled() && this.disabledReason() ? this.reasonId : null, ...(ngDevMode ? [{ debugName: "describedBy" }] : /* istanbul ignore next */ []));
131
185
  lastUpdatedState = signal(undefined, ...(ngDevMode ? [{ debugName: "lastUpdatedState" }] : /* istanbul ignore next */ []));
132
186
  /**
133
187
  * Full `CngxAsyncState` view of this button's effective lifecycle.
@@ -165,52 +219,55 @@ class CngxActionButton {
165
219
  if (status === previous) {
166
220
  return;
167
221
  }
168
- if (status === 'success') {
169
- // Producer write for the buildAsyncStateView `lastUpdated` slot (no other
170
- // source feeds it) - state production, not derived-state sync. This is the
171
- // sanctioned signal-write-in-effect class, same as the async-state-view pattern.
172
- this.lastUpdatedState.set(new Date());
173
- const msg = this.toastSuccess();
174
- if (msg && this.toaster) {
175
- this.toaster.show({
176
- message: msg,
177
- severity: 'success',
178
- duration: this.toastSuccessDuration(),
179
- });
222
+ // Only the transition edge may re-run this body. The toast inputs and
223
+ // effectiveError are read untracked: previous() stays stale for the whole
224
+ // settled window, so a tracked read would re-fire the toast on any input
225
+ // rebind while status sits in success/error. Doctrine: bridge effects
226
+ // untrack service calls.
227
+ untracked(() => {
228
+ if (status === 'success') {
229
+ // Producer write for the buildAsyncStateView `lastUpdated` slot (no other
230
+ // source feeds it) - state production, not derived-state sync. This is the
231
+ // sanctioned signal-write-in-effect class, same as the async-state-view pattern.
232
+ this.lastUpdatedState.set(new Date());
233
+ const msg = this.toastSuccess();
234
+ if (msg && this.toaster) {
235
+ this.toaster.show({
236
+ message: msg,
237
+ severity: 'success',
238
+ duration: this.toastSuccessDuration(),
239
+ });
240
+ }
180
241
  }
181
- }
182
- if (status === 'error') {
183
- const msg = this.toastError();
184
- if (msg && this.toaster) {
185
- const err = this.effectiveError();
186
- const detail = this.toastErrorDetail() && err != null
187
- ? err instanceof Error
188
- ? err.message
189
- : typeof err === 'string'
190
- ? err
191
- : undefined
192
- : undefined;
193
- this.toaster.show({
194
- message: detail ? `${msg}: ${detail}` : msg,
195
- severity: 'error',
196
- duration: this.toastErrorDuration(),
197
- });
242
+ if (status === 'error') {
243
+ const msg = this.toastError();
244
+ if (msg && this.toaster) {
245
+ const err = this.effectiveError();
246
+ const detail = this.toastErrorDetail() && err != null ? this.errorDetail(err) : undefined;
247
+ this.toaster.show({
248
+ message: detail ? this.feedbackI18n().errorWithDetail(msg, detail) : msg,
249
+ severity: 'error',
250
+ duration: this.toastErrorDuration(),
251
+ });
252
+ }
198
253
  }
199
- }
254
+ });
200
255
  });
201
256
  }
202
257
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxActionButton, deps: [], target: i0.ɵɵFactoryTarget.Component });
203
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.4", type: CngxActionButton, isStandalone: true, selector: "cngx-action-button", inputs: { action: { classPropertyName: "action", publicName: "action", isSignal: true, isRequired: true, transformFunction: null }, feedbackDuration: { classPropertyName: "feedbackDuration", publicName: "feedbackDuration", isSignal: true, isRequired: false, transformFunction: null }, enabled: { classPropertyName: "enabled", publicName: "enabled", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, succeededAnnouncement: { classPropertyName: "succeededAnnouncement", publicName: "succeededAnnouncement", isSignal: true, isRequired: false, transformFunction: null }, failedAnnouncement: { classPropertyName: "failedAnnouncement", publicName: "failedAnnouncement", isSignal: true, isRequired: false, transformFunction: null }, pendingLabel: { classPropertyName: "pendingLabel", publicName: "pendingLabel", isSignal: true, isRequired: false, transformFunction: null }, succeededLabel: { classPropertyName: "succeededLabel", publicName: "succeededLabel", isSignal: true, isRequired: false, transformFunction: null }, failedLabel: { classPropertyName: "failedLabel", publicName: "failedLabel", isSignal: true, isRequired: false, transformFunction: null }, externalState: { classPropertyName: "externalState", publicName: "externalState", isSignal: true, isRequired: false, transformFunction: null }, toastSuccess: { classPropertyName: "toastSuccess", publicName: "toastSuccess", isSignal: true, isRequired: false, transformFunction: null }, toastError: { classPropertyName: "toastError", publicName: "toastError", isSignal: true, isRequired: false, transformFunction: null }, toastErrorDetail: { classPropertyName: "toastErrorDetail", publicName: "toastErrorDetail", isSignal: true, isRequired: false, transformFunction: null }, toastSuccessDuration: { classPropertyName: "toastSuccessDuration", publicName: "toastSuccessDuration", isSignal: true, isRequired: false, transformFunction: null }, toastErrorDuration: { classPropertyName: "toastErrorDuration", publicName: "toastErrorDuration", isSignal: true, isRequired: false, transformFunction: null } }, host: { styleAttribute: "display: contents" }, queries: [{ propertyName: "pendingTpl", first: true, predicate: CngxPending, descendants: true, isSignal: true }, { propertyName: "succeededTpl", first: true, predicate: CngxSucceeded, descendants: true, isSignal: true }, { propertyName: "failedTpl", first: true, predicate: CngxFailed, descendants: true, isSignal: true }], viewQueries: [{ propertyName: "asyncClick", first: true, predicate: CngxAsyncClick, descendants: true, isSignal: true }], exportAs: ["cngxActionButton"], ngImport: i0, template: `
258
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.4", type: CngxActionButton, isStandalone: true, selector: "cngx-action-button", inputs: { action: { classPropertyName: "action", publicName: "action", isSignal: true, isRequired: true, transformFunction: null }, feedbackDuration: { classPropertyName: "feedbackDuration", publicName: "feedbackDuration", isSignal: true, isRequired: false, transformFunction: null }, enabled: { classPropertyName: "enabled", publicName: "enabled", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, succeededAnnouncement: { classPropertyName: "succeededAnnouncement", publicName: "succeededAnnouncement", isSignal: true, isRequired: false, transformFunction: null }, failedAnnouncement: { classPropertyName: "failedAnnouncement", publicName: "failedAnnouncement", isSignal: true, isRequired: false, transformFunction: null }, pendingLabel: { classPropertyName: "pendingLabel", publicName: "pendingLabel", isSignal: true, isRequired: false, transformFunction: null }, succeededLabel: { classPropertyName: "succeededLabel", publicName: "succeededLabel", isSignal: true, isRequired: false, transformFunction: null }, failedLabel: { classPropertyName: "failedLabel", publicName: "failedLabel", isSignal: true, isRequired: false, transformFunction: null }, externalState: { classPropertyName: "externalState", publicName: "externalState", isSignal: true, isRequired: false, transformFunction: null }, disabledReason: { classPropertyName: "disabledReason", publicName: "disabledReason", isSignal: true, isRequired: false, transformFunction: null }, toastSuccess: { classPropertyName: "toastSuccess", publicName: "toastSuccess", isSignal: true, isRequired: false, transformFunction: null }, toastError: { classPropertyName: "toastError", publicName: "toastError", isSignal: true, isRequired: false, transformFunction: null }, toastErrorDetail: { classPropertyName: "toastErrorDetail", publicName: "toastErrorDetail", isSignal: true, isRequired: false, transformFunction: null }, toastSuccessDuration: { classPropertyName: "toastSuccessDuration", publicName: "toastSuccessDuration", isSignal: true, isRequired: false, transformFunction: null }, toastErrorDuration: { classPropertyName: "toastErrorDuration", publicName: "toastErrorDuration", isSignal: true, isRequired: false, transformFunction: null } }, host: { styleAttribute: "display: contents" }, queries: [{ propertyName: "pendingTpl", first: true, predicate: CngxPending, descendants: true, isSignal: true }, { propertyName: "succeededTpl", first: true, predicate: CngxSucceeded, descendants: true, isSignal: true }, { propertyName: "failedTpl", first: true, predicate: CngxFailed, descendants: true, isSignal: true }], viewQueries: [{ propertyName: "asyncClick", first: true, predicate: CngxAsyncClick, descendants: true, isSignal: true }], exportAs: ["cngxActionButton"], ngImport: i0, template: `
204
259
  <ng-template #idle><ng-content /></ng-template>
205
260
 
206
261
  <button
207
262
  [type]="type()"
208
263
  [cngxAsyncClick]="action()"
209
- #btn="cngxAsyncClick"
210
264
  [feedbackDuration]="feedbackDuration()"
211
- [enabled]="enabled()"
212
- [succeededAnnouncement]="succeededAnnouncement() ?? succeededLabel() ?? 'Action succeeded'"
213
- [failedAnnouncement]="failedAnnouncement() ?? failedLabel() ?? 'Action failed'"
265
+ [enabled]="clickEnabled()"
266
+ [busy]="effectiveBusy()"
267
+ [autoAnnounce]="false"
268
+ [succeededAnnouncement]="succeededAnnouncement() ?? succeededLabel()"
269
+ [failedAnnouncement]="failedAnnouncement() ?? failedLabel()"
270
+ [attr.aria-describedby]="describedBy()"
214
271
  [class]="'cngx-action-button cngx-action-button--' + variant()"
215
272
  >
216
273
  @switch (effectiveStatus()) {
@@ -248,10 +305,13 @@ class CngxActionButton {
248
305
  }
249
306
  }
250
307
  </button>
308
+ @if (disabledReason(); as reason) {
309
+ <span [id]="reasonId" class="cngx-action-button__sr-only">{{ reason }}</span>
310
+ }
251
311
  <span aria-live="polite" aria-atomic="true" class="cngx-action-button__sr-only">{{
252
- btn.announcement()
312
+ effectiveAnnouncement()
253
313
  }}</span>
254
- `, isInline: true, styles: ["@layer cngx.tokens{@property --cngx-action-btn-transition{syntax: \"*\"; inherits: false; initial-value: .2s ease;}@property --cngx-action-btn-radius{syntax: \"<length>\"; inherits: false; initial-value: 6px;}@property --cngx-action-btn-padding{syntax: \"*\"; inherits: false; initial-value: 8px 16px;}@property --cngx-action-btn-border{syntax: \"<color>\"; inherits: false; initial-value: oklch(.87 0 0);}@property --cngx-action-btn-bg{syntax: \"<color>\"; inherits: false; initial-value: transparent;}@property --cngx-action-btn-pending-opacity{syntax: \"<number>\"; inherits: false; initial-value: .7;}@property --cngx-action-btn-succeeded-bg{syntax: \"<color>\"; inherits: false; initial-value: oklch(.95 .04 145);}@property --cngx-action-btn-succeeded-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.5 .15 145);}@property --cngx-action-btn-succeeded-border{syntax: \"<color>\"; inherits: false; initial-value: oklch(.5 .15 145);}@property --cngx-action-btn-failed-bg{syntax: \"<color>\"; inherits: false; initial-value: oklch(.95 .025 25);}@property --cngx-action-btn-failed-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.45 .15 25);}@property --cngx-action-btn-failed-border{syntax: \"<color>\"; inherits: false; initial-value: oklch(.45 .15 25);}@property --cngx-action-btn-ghost-hover-bg{syntax: \"<color>\"; inherits: false; initial-value: oklch(0 0 0 / .04);}@property --cngx-action-btn-primary-bg{syntax: \"<color>\"; inherits: false; initial-value: oklch(.55 .15 250);}@property --cngx-action-btn-primary-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(1 0 0);}@property --cngx-action-btn-secondary-bg{syntax: \"<color>\"; inherits: false; initial-value: transparent;}@property --cngx-action-btn-secondary-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.55 .15 250);}@property --cngx-action-btn-secondary-border{syntax: \"<color>\"; inherits: false; initial-value: oklch(.55 .005 290);}@property --cngx-action-btn-ghost-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.34 .005 290);}}@layer cngx.components{.cngx-action-button{--cngx-action-btn-padding: var(--cngx-space-sm) var(--cngx-space-md);cursor:pointer;border:1px solid var(--cngx-action-btn-border, var(--cngx-color-border, oklch(.87 0 0)));border-radius:var(--cngx-action-btn-radius, 6px);padding:var(--cngx-action-btn-padding, 8px 16px);font:inherit;background:var(--cngx-action-btn-bg, transparent);color:inherit;transition:background-color var(--cngx-action-btn-transition, .2s ease),color var(--cngx-action-btn-transition, .2s ease),border-color var(--cngx-action-btn-transition, .2s ease),opacity var(--cngx-action-btn-transition, .2s ease)}.cngx-action-button--primary{background:var(--cngx-action-btn-primary-bg, var(--cngx-color-primary, oklch(.55 .15 250)));color:var(--cngx-action-btn-primary-color, oklch(1 0 0));border-color:var( --cngx-action-btn-primary-bg, var(--cngx-color-primary, oklch(.55 .15 250)) )}.cngx-action-button--secondary{background:var(--cngx-action-btn-secondary-bg, transparent);color:var(--cngx-action-btn-secondary-color, var(--cngx-color-primary, oklch(.55 .15 250)));border-color:var( --cngx-action-btn-secondary-border, var(--cngx-color-border, oklch(.55 .005 290)) )}.cngx-action-button--ghost{background:transparent;color:var(--cngx-action-btn-ghost-color, var(--cngx-color-text, oklch(.34 .005 290)));border-color:transparent}.cngx-action-button--ghost:hover{background:var(--cngx-action-btn-ghost-hover-bg, oklch(0 0 0 / .04))}.cngx-action-button__sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: CngxAsyncClick, selector: "[cngxAsyncClick]", inputs: ["cngxAsyncClick", "feedbackDuration", "enabled", "succeededAnnouncement", "failedAnnouncement"], exportAs: ["cngxAsyncClick"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
314
+ `, isInline: true, styles: ["@layer cngx.tokens{@property --cngx-action-btn-transition{syntax: \"*\"; inherits: false; initial-value: .2s ease;}:where(.cngx-action-button){--cngx-action-btn-transition: var(--cngx-duration-base) ease}@property --cngx-action-btn-radius{syntax: \"<length>\"; inherits: false; initial-value: 6px;}@property --cngx-action-btn-padding{syntax: \"*\"; inherits: false; initial-value: 8px 16px;}@property --cngx-action-btn-border{syntax: \"<color>\"; inherits: false; initial-value: oklch(.87 0 0);}@property --cngx-action-btn-bg{syntax: \"<color>\"; inherits: false; initial-value: transparent;}@property --cngx-action-btn-pending-opacity{syntax: \"<number>\"; inherits: false; initial-value: .7;}@property --cngx-action-btn-succeeded-bg{syntax: \"<color>\"; inherits: false; initial-value: oklch(.95 .04 145);}@property --cngx-action-btn-succeeded-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.5 .15 145);}@property --cngx-action-btn-succeeded-border{syntax: \"<color>\"; inherits: false; initial-value: oklch(.5 .15 145);}@property --cngx-action-btn-failed-bg{syntax: \"<color>\"; inherits: false; initial-value: oklch(.95 .025 25);}@property --cngx-action-btn-failed-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.45 .15 25);}@property --cngx-action-btn-failed-border{syntax: \"<color>\"; inherits: false; initial-value: oklch(.45 .15 25);}@property --cngx-action-btn-ghost-hover-bg{syntax: \"<color>\"; inherits: false; initial-value: oklch(0 0 0 / .04);}@property --cngx-action-btn-primary-bg{syntax: \"<color>\"; inherits: false; initial-value: oklch(.55 .15 250);}@property --cngx-action-btn-primary-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(1 0 0);}@property --cngx-action-btn-secondary-bg{syntax: \"<color>\"; inherits: false; initial-value: transparent;}@property --cngx-action-btn-secondary-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.55 .15 250);}@property --cngx-action-btn-secondary-border{syntax: \"<color>\"; inherits: false; initial-value: oklch(.55 .005 290);}@property --cngx-action-btn-ghost-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.34 .005 290);}}@layer cngx.components{.cngx-action-button{--cngx-action-btn-padding: var(--cngx-space-sm) var(--cngx-space-md);cursor:pointer;border:1px solid var(--cngx-action-btn-border, var(--cngx-color-border, oklch(.87 0 0)));border-radius:var(--cngx-action-btn-radius, 6px);padding:var(--cngx-action-btn-padding, 8px 16px);min-block-size:var(--cngx-target-min, 0px);font:inherit;background:var(--cngx-action-btn-bg, transparent);color:inherit;transition:background-color var(--cngx-action-btn-transition, .2s ease),color var(--cngx-action-btn-transition, .2s ease),border-color var(--cngx-action-btn-transition, .2s ease),opacity var(--cngx-action-btn-transition, .2s ease)}.cngx-action-button--primary{background:var(--cngx-action-btn-primary-bg, var(--cngx-color-primary, oklch(.55 .15 250)));color:var(--cngx-action-btn-primary-color, oklch(1 0 0));border-color:var( --cngx-action-btn-primary-bg, var(--cngx-color-primary, oklch(.55 .15 250)) )}.cngx-action-button--secondary{background:var(--cngx-action-btn-secondary-bg, transparent);color:var(--cngx-action-btn-secondary-color, var(--cngx-color-primary, oklch(.55 .15 250)));border-color:var( --cngx-action-btn-secondary-border, var(--cngx-color-border, oklch(.55 .005 290)) )}.cngx-action-button--ghost{background:transparent;color:var(--cngx-action-btn-ghost-color, var(--cngx-color-text, oklch(.34 .005 290)));border-color:transparent}.cngx-action-button--ghost:hover{background:var(--cngx-action-btn-ghost-hover-bg, oklch(0 0 0 / .04))}.cngx-action-button__sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: CngxAsyncClick, selector: "[cngxAsyncClick]", inputs: ["cngxAsyncClick", "feedbackDuration", "enabled", "busy", "succeededAnnouncement", "failedAnnouncement", "autoAnnounce"], exportAs: ["cngxAsyncClick"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
255
315
  }
256
316
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxActionButton, decorators: [{
257
317
  type: Component,
@@ -263,11 +323,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
263
323
  <button
264
324
  [type]="type()"
265
325
  [cngxAsyncClick]="action()"
266
- #btn="cngxAsyncClick"
267
326
  [feedbackDuration]="feedbackDuration()"
268
- [enabled]="enabled()"
269
- [succeededAnnouncement]="succeededAnnouncement() ?? succeededLabel() ?? 'Action succeeded'"
270
- [failedAnnouncement]="failedAnnouncement() ?? failedLabel() ?? 'Action failed'"
327
+ [enabled]="clickEnabled()"
328
+ [busy]="effectiveBusy()"
329
+ [autoAnnounce]="false"
330
+ [succeededAnnouncement]="succeededAnnouncement() ?? succeededLabel()"
331
+ [failedAnnouncement]="failedAnnouncement() ?? failedLabel()"
332
+ [attr.aria-describedby]="describedBy()"
271
333
  [class]="'cngx-action-button cngx-action-button--' + variant()"
272
334
  >
273
335
  @switch (effectiveStatus()) {
@@ -305,11 +367,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
305
367
  }
306
368
  }
307
369
  </button>
370
+ @if (disabledReason(); as reason) {
371
+ <span [id]="reasonId" class="cngx-action-button__sr-only">{{ reason }}</span>
372
+ }
308
373
  <span aria-live="polite" aria-atomic="true" class="cngx-action-button__sr-only">{{
309
- btn.announcement()
374
+ effectiveAnnouncement()
310
375
  }}</span>
311
- `, styles: ["@layer cngx.tokens{@property --cngx-action-btn-transition{syntax: \"*\"; inherits: false; initial-value: .2s ease;}@property --cngx-action-btn-radius{syntax: \"<length>\"; inherits: false; initial-value: 6px;}@property --cngx-action-btn-padding{syntax: \"*\"; inherits: false; initial-value: 8px 16px;}@property --cngx-action-btn-border{syntax: \"<color>\"; inherits: false; initial-value: oklch(.87 0 0);}@property --cngx-action-btn-bg{syntax: \"<color>\"; inherits: false; initial-value: transparent;}@property --cngx-action-btn-pending-opacity{syntax: \"<number>\"; inherits: false; initial-value: .7;}@property --cngx-action-btn-succeeded-bg{syntax: \"<color>\"; inherits: false; initial-value: oklch(.95 .04 145);}@property --cngx-action-btn-succeeded-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.5 .15 145);}@property --cngx-action-btn-succeeded-border{syntax: \"<color>\"; inherits: false; initial-value: oklch(.5 .15 145);}@property --cngx-action-btn-failed-bg{syntax: \"<color>\"; inherits: false; initial-value: oklch(.95 .025 25);}@property --cngx-action-btn-failed-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.45 .15 25);}@property --cngx-action-btn-failed-border{syntax: \"<color>\"; inherits: false; initial-value: oklch(.45 .15 25);}@property --cngx-action-btn-ghost-hover-bg{syntax: \"<color>\"; inherits: false; initial-value: oklch(0 0 0 / .04);}@property --cngx-action-btn-primary-bg{syntax: \"<color>\"; inherits: false; initial-value: oklch(.55 .15 250);}@property --cngx-action-btn-primary-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(1 0 0);}@property --cngx-action-btn-secondary-bg{syntax: \"<color>\"; inherits: false; initial-value: transparent;}@property --cngx-action-btn-secondary-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.55 .15 250);}@property --cngx-action-btn-secondary-border{syntax: \"<color>\"; inherits: false; initial-value: oklch(.55 .005 290);}@property --cngx-action-btn-ghost-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.34 .005 290);}}@layer cngx.components{.cngx-action-button{--cngx-action-btn-padding: var(--cngx-space-sm) var(--cngx-space-md);cursor:pointer;border:1px solid var(--cngx-action-btn-border, var(--cngx-color-border, oklch(.87 0 0)));border-radius:var(--cngx-action-btn-radius, 6px);padding:var(--cngx-action-btn-padding, 8px 16px);font:inherit;background:var(--cngx-action-btn-bg, transparent);color:inherit;transition:background-color var(--cngx-action-btn-transition, .2s ease),color var(--cngx-action-btn-transition, .2s ease),border-color var(--cngx-action-btn-transition, .2s ease),opacity var(--cngx-action-btn-transition, .2s ease)}.cngx-action-button--primary{background:var(--cngx-action-btn-primary-bg, var(--cngx-color-primary, oklch(.55 .15 250)));color:var(--cngx-action-btn-primary-color, oklch(1 0 0));border-color:var( --cngx-action-btn-primary-bg, var(--cngx-color-primary, oklch(.55 .15 250)) )}.cngx-action-button--secondary{background:var(--cngx-action-btn-secondary-bg, transparent);color:var(--cngx-action-btn-secondary-color, var(--cngx-color-primary, oklch(.55 .15 250)));border-color:var( --cngx-action-btn-secondary-border, var(--cngx-color-border, oklch(.55 .005 290)) )}.cngx-action-button--ghost{background:transparent;color:var(--cngx-action-btn-ghost-color, var(--cngx-color-text, oklch(.34 .005 290)));border-color:transparent}.cngx-action-button--ghost:hover{background:var(--cngx-action-btn-ghost-hover-bg, oklch(0 0 0 / .04))}.cngx-action-button__sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}}\n"] }]
312
- }], ctorParameters: () => [], propDecorators: { action: [{ type: i0.Input, args: [{ isSignal: true, alias: "action", required: true }] }], feedbackDuration: [{ type: i0.Input, args: [{ isSignal: true, alias: "feedbackDuration", required: false }] }], enabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "enabled", required: false }] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], succeededAnnouncement: [{ type: i0.Input, args: [{ isSignal: true, alias: "succeededAnnouncement", required: false }] }], failedAnnouncement: [{ type: i0.Input, args: [{ isSignal: true, alias: "failedAnnouncement", required: false }] }], pendingLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "pendingLabel", required: false }] }], succeededLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "succeededLabel", required: false }] }], failedLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "failedLabel", required: false }] }], externalState: [{ type: i0.Input, args: [{ isSignal: true, alias: "externalState", required: false }] }], toastSuccess: [{ type: i0.Input, args: [{ isSignal: true, alias: "toastSuccess", required: false }] }], toastError: [{ type: i0.Input, args: [{ isSignal: true, alias: "toastError", required: false }] }], toastErrorDetail: [{ type: i0.Input, args: [{ isSignal: true, alias: "toastErrorDetail", required: false }] }], toastSuccessDuration: [{ type: i0.Input, args: [{ isSignal: true, alias: "toastSuccessDuration", required: false }] }], toastErrorDuration: [{ type: i0.Input, args: [{ isSignal: true, alias: "toastErrorDuration", required: false }] }], asyncClick: [{ type: i0.ViewChild, args: [i0.forwardRef(() => CngxAsyncClick), { isSignal: true }] }], pendingTpl: [{ type: i0.ContentChild, args: [i0.forwardRef(() => CngxPending), { isSignal: true }] }], succeededTpl: [{ type: i0.ContentChild, args: [i0.forwardRef(() => CngxSucceeded), { isSignal: true }] }], failedTpl: [{ type: i0.ContentChild, args: [i0.forwardRef(() => CngxFailed), { isSignal: true }] }] } });
376
+ `, styles: ["@layer cngx.tokens{@property --cngx-action-btn-transition{syntax: \"*\"; inherits: false; initial-value: .2s ease;}:where(.cngx-action-button){--cngx-action-btn-transition: var(--cngx-duration-base) ease}@property --cngx-action-btn-radius{syntax: \"<length>\"; inherits: false; initial-value: 6px;}@property --cngx-action-btn-padding{syntax: \"*\"; inherits: false; initial-value: 8px 16px;}@property --cngx-action-btn-border{syntax: \"<color>\"; inherits: false; initial-value: oklch(.87 0 0);}@property --cngx-action-btn-bg{syntax: \"<color>\"; inherits: false; initial-value: transparent;}@property --cngx-action-btn-pending-opacity{syntax: \"<number>\"; inherits: false; initial-value: .7;}@property --cngx-action-btn-succeeded-bg{syntax: \"<color>\"; inherits: false; initial-value: oklch(.95 .04 145);}@property --cngx-action-btn-succeeded-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.5 .15 145);}@property --cngx-action-btn-succeeded-border{syntax: \"<color>\"; inherits: false; initial-value: oklch(.5 .15 145);}@property --cngx-action-btn-failed-bg{syntax: \"<color>\"; inherits: false; initial-value: oklch(.95 .025 25);}@property --cngx-action-btn-failed-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.45 .15 25);}@property --cngx-action-btn-failed-border{syntax: \"<color>\"; inherits: false; initial-value: oklch(.45 .15 25);}@property --cngx-action-btn-ghost-hover-bg{syntax: \"<color>\"; inherits: false; initial-value: oklch(0 0 0 / .04);}@property --cngx-action-btn-primary-bg{syntax: \"<color>\"; inherits: false; initial-value: oklch(.55 .15 250);}@property --cngx-action-btn-primary-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(1 0 0);}@property --cngx-action-btn-secondary-bg{syntax: \"<color>\"; inherits: false; initial-value: transparent;}@property --cngx-action-btn-secondary-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.55 .15 250);}@property --cngx-action-btn-secondary-border{syntax: \"<color>\"; inherits: false; initial-value: oklch(.55 .005 290);}@property --cngx-action-btn-ghost-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.34 .005 290);}}@layer cngx.components{.cngx-action-button{--cngx-action-btn-padding: var(--cngx-space-sm) var(--cngx-space-md);cursor:pointer;border:1px solid var(--cngx-action-btn-border, var(--cngx-color-border, oklch(.87 0 0)));border-radius:var(--cngx-action-btn-radius, 6px);padding:var(--cngx-action-btn-padding, 8px 16px);min-block-size:var(--cngx-target-min, 0px);font:inherit;background:var(--cngx-action-btn-bg, transparent);color:inherit;transition:background-color var(--cngx-action-btn-transition, .2s ease),color var(--cngx-action-btn-transition, .2s ease),border-color var(--cngx-action-btn-transition, .2s ease),opacity var(--cngx-action-btn-transition, .2s ease)}.cngx-action-button--primary{background:var(--cngx-action-btn-primary-bg, var(--cngx-color-primary, oklch(.55 .15 250)));color:var(--cngx-action-btn-primary-color, oklch(1 0 0));border-color:var( --cngx-action-btn-primary-bg, var(--cngx-color-primary, oklch(.55 .15 250)) )}.cngx-action-button--secondary{background:var(--cngx-action-btn-secondary-bg, transparent);color:var(--cngx-action-btn-secondary-color, var(--cngx-color-primary, oklch(.55 .15 250)));border-color:var( --cngx-action-btn-secondary-border, var(--cngx-color-border, oklch(.55 .005 290)) )}.cngx-action-button--ghost{background:transparent;color:var(--cngx-action-btn-ghost-color, var(--cngx-color-text, oklch(.34 .005 290)));border-color:transparent}.cngx-action-button--ghost:hover{background:var(--cngx-action-btn-ghost-hover-bg, oklch(0 0 0 / .04))}.cngx-action-button__sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}}\n"] }]
377
+ }], ctorParameters: () => [], propDecorators: { action: [{ type: i0.Input, args: [{ isSignal: true, alias: "action", required: true }] }], feedbackDuration: [{ type: i0.Input, args: [{ isSignal: true, alias: "feedbackDuration", required: false }] }], enabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "enabled", required: false }] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], succeededAnnouncement: [{ type: i0.Input, args: [{ isSignal: true, alias: "succeededAnnouncement", required: false }] }], failedAnnouncement: [{ type: i0.Input, args: [{ isSignal: true, alias: "failedAnnouncement", required: false }] }], pendingLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "pendingLabel", required: false }] }], succeededLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "succeededLabel", required: false }] }], failedLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "failedLabel", required: false }] }], externalState: [{ type: i0.Input, args: [{ isSignal: true, alias: "externalState", required: false }] }], disabledReason: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabledReason", required: false }] }], toastSuccess: [{ type: i0.Input, args: [{ isSignal: true, alias: "toastSuccess", required: false }] }], toastError: [{ type: i0.Input, args: [{ isSignal: true, alias: "toastError", required: false }] }], toastErrorDetail: [{ type: i0.Input, args: [{ isSignal: true, alias: "toastErrorDetail", required: false }] }], toastSuccessDuration: [{ type: i0.Input, args: [{ isSignal: true, alias: "toastSuccessDuration", required: false }] }], toastErrorDuration: [{ type: i0.Input, args: [{ isSignal: true, alias: "toastErrorDuration", required: false }] }], asyncClick: [{ type: i0.ViewChild, args: [i0.forwardRef(() => CngxAsyncClick), { isSignal: true }] }], pendingTpl: [{ type: i0.ContentChild, args: [i0.forwardRef(() => CngxPending), { isSignal: true }] }], succeededTpl: [{ type: i0.ContentChild, args: [i0.forwardRef(() => CngxSucceeded), { isSignal: true }] }], failedTpl: [{ type: i0.ContentChild, args: [i0.forwardRef(() => CngxFailed), { isSignal: true }] }] } });
313
378
 
314
379
  /**
315
380
  * @module @cngx/ui/action-button
@@ -1 +1 @@
1
- {"version":3,"file":"cngx-ui-action-button.mjs","sources":["../../../projects/ui/action-button/action-button.ts","../../../projects/ui/action-button/public-api.ts","../../../projects/ui/action-button/cngx-ui-action-button.ts"],"sourcesContent":["import { NgTemplateOutlet } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n computed,\n contentChild,\n effect,\n inject,\n input,\n signal,\n viewChild,\n ViewEncapsulation,\n} from '@angular/core';\nimport {\n CngxAsyncClick,\n CngxFailed,\n CngxPending,\n CngxSucceeded,\n reflectAsyncDisplayStatus,\n type AsyncAction,\n} from '@cngx/common/interactive';\nimport {\n buildAsyncStateView,\n createTransitionTracker,\n type CngxAsyncState,\n} from '@cngx/core/utils';\nimport { CngxToastOn, CngxToaster } from '@cngx/ui/feedback';\n\n/**\n * Visual variant for the action button - maps to a CSS class.\n *\n * @category ui/action-button\n */\nexport type ActionButtonVariant = 'primary' | 'secondary' | 'ghost';\n\n/**\n * Action button organism with built-in status communication.\n *\n * Coordinates between the `CngxAsyncClick` atom (mechanism, ARIA, lifecycle)\n * and the consumer (intent, styling, labels). Provides template projection\n * for pending/succeeded/failed states and an `aria-live` region for screen\n * reader announcements.\n *\n * Uses `display: contents` - the host produces no DOM box. The inner `<button>`\n * carries the `[cngxAsyncClick]` directive directly.\n *\n * For full control, use `[cngxAsyncClick]` directly on any element instead.\n *\n * ### Minimal (covers 80% of cases)\n * ```html\n * <cngx-action-button [action]=\"save\">Save</cngx-action-button>\n * ```\n *\n * ### With string labels\n * ```html\n * <cngx-action-button [action]=\"save\"\n * pendingLabel=\"Saving...\" succeededLabel=\"Saved!\" failedLabel=\"Failed\">\n * Save\n * </cngx-action-button>\n * ```\n *\n * ### With template slots\n * ```html\n * <cngx-action-button [action]=\"save\">\n * Save Draft\n * <ng-template cngxPending><mat-spinner diameter=\"18\" /> Saving...</ng-template>\n * <ng-template cngxSucceeded>Saved!</ng-template>\n * <ng-template cngxFailed let-err>{{ err }} - retry?</ng-template>\n * </cngx-action-button>\n * ```\n *\n * ### With toast feedback\n * ```html\n * <cngx-action-button [action]=\"save\" toastSuccess=\"Saved\" toastError=\"Save failed\">\n * Save\n * </cngx-action-button>\n * ```\n *\n * @category ui/action-button\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/action-button/action-button.ts\n * @since 0.1.0\n * @relatedTo CngxAsyncClick, CngxPending, CngxSucceeded, CngxFailed, CngxToaster\n * <example-url>http://localhost:4200/#/ui/action-button/async-button/random-outcome</example-url>\n * <example-url>http://localhost:4200/#/ui/action-button/async-button/string-labels</example-url>\n * <example-url>http://localhost:4200/#/ui/action-button/async-button/template-slots</example-url>\n */\n@Component({\n selector: 'cngx-action-button',\n standalone: true,\n imports: [NgTemplateOutlet, CngxAsyncClick],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n exportAs: 'cngxActionButton',\n host: {\n style: 'display: contents',\n },\n template: `\n <ng-template #idle><ng-content /></ng-template>\n\n <button\n [type]=\"type()\"\n [cngxAsyncClick]=\"action()\"\n #btn=\"cngxAsyncClick\"\n [feedbackDuration]=\"feedbackDuration()\"\n [enabled]=\"enabled()\"\n [succeededAnnouncement]=\"succeededAnnouncement() ?? succeededLabel() ?? 'Action succeeded'\"\n [failedAnnouncement]=\"failedAnnouncement() ?? failedLabel() ?? 'Action failed'\"\n [class]=\"'cngx-action-button cngx-action-button--' + variant()\"\n >\n @switch (effectiveStatus()) {\n @case ('pending') {\n @if (pendingTpl(); as tpl) {\n <ng-container *ngTemplateOutlet=\"tpl.templateRef\" />\n } @else if (pendingLabel()) {\n {{ pendingLabel() }}\n } @else {\n <ng-container *ngTemplateOutlet=\"idle\" />\n }\n }\n @case ('success') {\n @if (succeededTpl(); as tpl) {\n <ng-container *ngTemplateOutlet=\"tpl.templateRef\" />\n } @else if (succeededLabel()) {\n {{ succeededLabel() }}\n } @else {\n <ng-container *ngTemplateOutlet=\"idle\" />\n }\n }\n @case ('error') {\n @if (failedTpl(); as tpl) {\n <ng-container\n *ngTemplateOutlet=\"tpl.templateRef; context: { $implicit: effectiveError() }\"\n />\n } @else if (failedLabel()) {\n {{ failedLabel() }}\n } @else {\n <ng-container *ngTemplateOutlet=\"idle\" />\n }\n }\n @default {\n <ng-container *ngTemplateOutlet=\"idle\" />\n }\n }\n </button>\n <span aria-live=\"polite\" aria-atomic=\"true\" class=\"cngx-action-button__sr-only\">{{\n btn.announcement()\n }}</span>\n `,\n styleUrls: ['./action-button.css'],\n})\nexport class CngxActionButton {\n private readonly toaster = inject(CngxToaster, { optional: true });\n private readonly externalToastOn = inject(CngxToastOn, { self: true, optional: true });\n\n /** The async action to execute on click. */\n readonly action = input.required<AsyncAction>();\n\n /** Duration in ms to show success/error feedback. Passed through to `cngxAsyncClick`. */\n readonly feedbackDuration = input<number>(2000);\n\n /** When `false`, clicks are ignored. Passed through to `cngxAsyncClick`. */\n readonly enabled = input<boolean>(true);\n\n /** Button type attribute. Defaults to `'button'` to prevent accidental form submits. */\n readonly type = input<'button' | 'submit' | 'reset'>('button');\n\n /** Visual variant - sets CSS class `cngx-action-button--{variant}`. */\n readonly variant = input<ActionButtonVariant>('primary');\n\n /** SR announcement on success. Falls back to `succeededLabel`, then `'Action succeeded'`. */\n readonly succeededAnnouncement = input<string | undefined>(undefined);\n\n /** SR announcement on failure. Falls back to `failedLabel`, then `'Action failed'`. */\n readonly failedAnnouncement = input<string | undefined>(undefined);\n\n /** Fallback text while pending (when no `cngxPending` template is projected). */\n readonly pendingLabel = input<string | undefined>(undefined);\n\n /** Fallback text after success (when no `cngxSucceeded` template is projected). */\n readonly succeededLabel = input<string | undefined>(undefined);\n\n /** Fallback text after failure (when no `cngxFailed` template is projected). */\n readonly failedLabel = input<string | undefined>(undefined);\n\n /**\n * Bind an external async state to derive visual status from.\n * When set, the button's status display follows `externalState.status()`.\n */\n readonly externalState = input<CngxAsyncState<unknown> | undefined>(undefined);\n\n /**\n * Toast message on success. Requires `CngxToaster` (via `provideFeedback(withToasts())`\n * or `provideToasts()`). Silently ignored when toaster is not provided.\n *\n * `toastSuccessDuration` should be >= `feedbackDuration` to avoid rapid re-fire\n * on repeated clicks that floods the SR announcement queue.\n */\n readonly toastSuccess = input<string | undefined>(undefined);\n\n /** Toast message on error. */\n readonly toastError = input<string | undefined>(undefined);\n\n /** Include the error detail message in the error toast body. */\n readonly toastErrorDetail = input<boolean>(false);\n\n /** Duration for success toasts in ms. */\n readonly toastSuccessDuration = input<number>(3000);\n\n /** Duration for error toasts - `'persistent'` means manual dismiss only. */\n readonly toastErrorDuration = input<number | 'persistent'>('persistent');\n\n /** @internal - inner CngxAsyncClick directive instance. Non-required to allow safe pre-view-init reads. */\n private readonly asyncClick = viewChild(CngxAsyncClick);\n\n /**\n * @internal - effective status: reflects external `[externalState]` if\n * bound (through the shared `CngxAsyncStatus` reflection - one home for\n * the state→display-bucket mapping), otherwise reads the inner\n * `CngxAsyncClick` directive.\n */\n protected readonly effectiveStatus = computed(() => {\n const ext = this.externalState();\n if (ext) {\n return reflectAsyncDisplayStatus(ext);\n }\n // Guard against pre-view-init reads of `state` from consumers.\n const click = this.asyncClick();\n return click ? click.status() : ('idle' as const);\n });\n\n /** @internal - effective error value from external state or inner directive. */\n protected readonly effectiveError = computed(() => {\n const ext = this.externalState();\n if (ext) {\n return ext.error();\n }\n const click = this.asyncClick();\n return click ? click.error() : undefined;\n });\n\n private readonly lastUpdatedState = signal<Date | undefined>(undefined);\n\n /**\n * Full `CngxAsyncState` view of this button's effective lifecycle.\n *\n * Reflects the external state when `[externalState]` is bound,\n * otherwise the inner `CngxAsyncClick` directive's state.\n *\n * Bind to any state consumer: `<cngx-alert [state]=\"btn.state\" />`.\n */\n readonly state: CngxAsyncState<unknown> = buildAsyncStateView<unknown>({\n status: this.effectiveStatus,\n data: computed(() => undefined),\n error: this.effectiveError,\n lastUpdated: this.lastUpdatedState.asReadonly(),\n });\n\n /** @internal */\n protected readonly pendingTpl = contentChild(CngxPending);\n /** @internal */\n protected readonly succeededTpl = contentChild(CngxSucceeded);\n /** @internal */\n protected readonly failedTpl = contentChild(CngxFailed);\n\n constructor() {\n // Double-toast guard, consumer placed [cngxToastOn] on the same element.\n if (\n typeof ngDevMode !== 'undefined' &&\n ngDevMode &&\n this.externalToastOn &&\n (this.toastSuccess() || this.toastError())\n ) {\n console.warn(\n 'CngxActionButton: [toastSuccess]/[toastError] inputs and [cngxToastOn] ' +\n 'on the same element will fire duplicate toasts. Use one or the other.',\n );\n }\n\n const tracker = createTransitionTracker(() => this.effectiveStatus());\n\n effect(() => {\n const status = tracker.current();\n const previous = tracker.previous();\n\n if (status === previous) {\n return;\n }\n\n if (status === 'success') {\n // Producer write for the buildAsyncStateView `lastUpdated` slot (no other\n // source feeds it) - state production, not derived-state sync. This is the\n // sanctioned signal-write-in-effect class, same as the async-state-view pattern.\n this.lastUpdatedState.set(new Date());\n const msg = this.toastSuccess();\n if (msg && this.toaster) {\n this.toaster.show({\n message: msg,\n severity: 'success',\n duration: this.toastSuccessDuration(),\n });\n }\n }\n\n if (status === 'error') {\n const msg = this.toastError();\n if (msg && this.toaster) {\n const err = this.effectiveError();\n const detail =\n this.toastErrorDetail() && err != null\n ? err instanceof Error\n ? err.message\n : typeof err === 'string'\n ? err\n : undefined\n : undefined;\n this.toaster.show({\n message: detail ? `${msg}: ${detail}` : msg,\n severity: 'error',\n duration: this.toastErrorDuration(),\n });\n }\n }\n });\n }\n}\n","/**\n * @module @cngx/ui/action-button\n */\n\nexport { CngxActionButton, type ActionButtonVariant } from './action-button';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;AAmCA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoDG;MAiEU,gBAAgB,CAAA;IACV,OAAO,GAAG,MAAM,CAAC,WAAW,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;AACjD,IAAA,eAAe,GAAG,MAAM,CAAC,WAAW,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;AAG7E,IAAA,MAAM,GAAG,KAAK,CAAC,QAAQ,4EAAe;;AAGtC,IAAA,gBAAgB,GAAG,KAAK,CAAS,IAAI,uFAAC;;AAGtC,IAAA,OAAO,GAAG,KAAK,CAAU,IAAI,8EAAC;;AAG9B,IAAA,IAAI,GAAG,KAAK,CAAgC,QAAQ,2EAAC;;AAGrD,IAAA,OAAO,GAAG,KAAK,CAAsB,SAAS,8EAAC;;AAG/C,IAAA,qBAAqB,GAAG,KAAK,CAAqB,SAAS,4FAAC;;AAG5D,IAAA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x-ui-action-button.mjs","sources":["../../../projects/ui/action-button/action-button.ts","../../../projects/ui/action-button/public-api.ts","../../../projects/ui/action-button/cngx-ui-action-button.ts"],"sourcesContent":["import { NgTemplateOutlet } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n computed,\n contentChild,\n effect,\n inject,\n input,\n signal,\n untracked,\n viewChild,\n ViewEncapsulation,\n} from '@angular/core';\nimport {\n CngxAsyncClick,\n CngxFailed,\n CngxPending,\n CngxSucceeded,\n injectInteractiveI18n,\n reflectAsyncDisplayStatus,\n type AsyncAction,\n} from '@cngx/common/interactive';\nimport {\n buildAsyncStateView,\n createTransitionTracker,\n nextUid,\n type CngxAsyncState,\n} from '@cngx/core/utils';\nimport { CngxToastOn, CngxToaster, injectErrorDetail, injectFeedbackI18n } from '@cngx/ui/feedback';\n\n/**\n * Visual variant for the action button - maps to a CSS class.\n *\n * @category ui/action-button\n */\nexport type ActionButtonVariant = 'primary' | 'secondary' | 'ghost';\n\n/**\n * Action button organism with built-in status communication.\n *\n * Coordinates between the `CngxAsyncClick` atom (mechanism, ARIA, lifecycle)\n * and the consumer (intent, styling, labels). Provides template projection\n * for pending/succeeded/failed states and an `aria-live` region for screen\n * reader announcements.\n *\n * Uses `display: contents` - the host produces no DOM box. The inner `<button>`\n * carries the `[cngxAsyncClick]` directive directly.\n *\n * For full control, use `[cngxAsyncClick]` directly on any element instead.\n *\n * ### Minimal (covers 80% of cases)\n * ```html\n * <cngx-action-button [action]=\"save\">Save</cngx-action-button>\n * ```\n *\n * ### With string labels\n * ```html\n * <cngx-action-button [action]=\"save\"\n * pendingLabel=\"Saving...\" succeededLabel=\"Saved!\" failedLabel=\"Failed\">\n * Save\n * </cngx-action-button>\n * ```\n *\n * ### With template slots\n * ```html\n * <cngx-action-button [action]=\"save\">\n * Save Draft\n * <ng-template cngxPending><mat-spinner diameter=\"18\" /> Saving...</ng-template>\n * <ng-template cngxSucceeded>Saved!</ng-template>\n * <ng-template cngxFailed let-err>{{ err }} - retry?</ng-template>\n * </cngx-action-button>\n * ```\n *\n * ### With toast feedback\n * ```html\n * <cngx-action-button [action]=\"save\" toastSuccess=\"Saved\" toastError=\"Save failed\">\n * Save\n * </cngx-action-button>\n * ```\n *\n * @category ui/action-button\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/action-button/action-button.ts\n * @since 0.1.0\n * @relatedTo CngxAsyncClick, CngxPending, CngxSucceeded, CngxFailed, CngxToaster\n * @slot cngxPending Replaces the label while the action runs.\n * @slot cngxSucceeded Replaces the label after the action succeeds.\n * @slot cngxFailed Replaces the label when the action fails; gets the error.\n * <example-url>http://localhost:4200/#/ui/action-button/async-button/random-outcome</example-url>\n * <example-url>http://localhost:4200/#/ui/action-button/async-button/string-labels</example-url>\n * <example-url>http://localhost:4200/#/ui/action-button/async-button/template-slots</example-url>\n */\n@Component({\n selector: 'cngx-action-button',\n standalone: true,\n imports: [NgTemplateOutlet, CngxAsyncClick],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n exportAs: 'cngxActionButton',\n host: {\n style: 'display: contents',\n },\n template: `\n <ng-template #idle><ng-content /></ng-template>\n\n <button\n [type]=\"type()\"\n [cngxAsyncClick]=\"action()\"\n [feedbackDuration]=\"feedbackDuration()\"\n [enabled]=\"clickEnabled()\"\n [busy]=\"effectiveBusy()\"\n [autoAnnounce]=\"false\"\n [succeededAnnouncement]=\"succeededAnnouncement() ?? succeededLabel()\"\n [failedAnnouncement]=\"failedAnnouncement() ?? failedLabel()\"\n [attr.aria-describedby]=\"describedBy()\"\n [class]=\"'cngx-action-button cngx-action-button--' + variant()\"\n >\n @switch (effectiveStatus()) {\n @case ('pending') {\n @if (pendingTpl(); as tpl) {\n <ng-container *ngTemplateOutlet=\"tpl.templateRef\" />\n } @else if (pendingLabel()) {\n {{ pendingLabel() }}\n } @else {\n <ng-container *ngTemplateOutlet=\"idle\" />\n }\n }\n @case ('success') {\n @if (succeededTpl(); as tpl) {\n <ng-container *ngTemplateOutlet=\"tpl.templateRef\" />\n } @else if (succeededLabel()) {\n {{ succeededLabel() }}\n } @else {\n <ng-container *ngTemplateOutlet=\"idle\" />\n }\n }\n @case ('error') {\n @if (failedTpl(); as tpl) {\n <ng-container\n *ngTemplateOutlet=\"tpl.templateRef; context: { $implicit: effectiveError() }\"\n />\n } @else if (failedLabel()) {\n {{ failedLabel() }}\n } @else {\n <ng-container *ngTemplateOutlet=\"idle\" />\n }\n }\n @default {\n <ng-container *ngTemplateOutlet=\"idle\" />\n }\n }\n </button>\n @if (disabledReason(); as reason) {\n <span [id]=\"reasonId\" class=\"cngx-action-button__sr-only\">{{ reason }}</span>\n }\n <span aria-live=\"polite\" aria-atomic=\"true\" class=\"cngx-action-button__sr-only\">{{\n effectiveAnnouncement()\n }}</span>\n `,\n styleUrls: ['./action-button.css'],\n})\nexport class CngxActionButton {\n private readonly toaster = inject(CngxToaster, { optional: true });\n private readonly errorDetail = injectErrorDetail();\n private readonly feedbackI18n = injectFeedbackI18n();\n private readonly externalToastOn = inject(CngxToastOn, { self: true, optional: true });\n protected readonly i18n = injectInteractiveI18n();\n\n /** The async action to execute on click. */\n readonly action = input.required<AsyncAction>();\n\n /** Duration in ms to show success/error feedback. Passed through to `cngxAsyncClick`. */\n readonly feedbackDuration = input<number>(2000);\n\n /** When `false`, clicks are ignored. Passed through to `cngxAsyncClick`. */\n readonly enabled = input<boolean>(true);\n\n /** Button type attribute. Defaults to `'button'` to prevent accidental form submits. */\n readonly type = input<'button' | 'submit' | 'reset'>('button');\n\n /** Visual variant - sets CSS class `cngx-action-button--{variant}`. */\n readonly variant = input<ActionButtonVariant>('primary');\n\n /**\n * SR announcement on success. Falls back to `succeededLabel`, then\n * `CNGX_INTERACTIVE_I18N.asyncClickSucceeded`.\n */\n readonly succeededAnnouncement = input<string | undefined>(undefined);\n\n /**\n * SR announcement on failure. Falls back to `failedLabel`, then\n * `CNGX_INTERACTIVE_I18N.asyncClickFailed`.\n */\n readonly failedAnnouncement = input<string | undefined>(undefined);\n\n /** Fallback text while pending (when no `cngxPending` template is projected). */\n readonly pendingLabel = input<string | undefined>(undefined);\n\n /** Fallback text after success (when no `cngxSucceeded` template is projected). */\n readonly succeededLabel = input<string | undefined>(undefined);\n\n /** Fallback text after failure (when no `cngxFailed` template is projected). */\n readonly failedLabel = input<string | undefined>(undefined);\n\n /**\n * Bind an external async state to derive visual status from.\n * When set, the button's status display follows `externalState.status()`.\n */\n readonly externalState = input<CngxAsyncState<unknown> | undefined>(undefined);\n\n /**\n * Reason the button is disabled, announced to screen readers while\n * `[enabled]` is `false`. Rendered into a hidden region and referenced by\n * `aria-describedby` only while disabled - an enabled button never carries\n * the reference. No effect when `[enabled]` is `true`.\n */\n readonly disabledReason = input<string | undefined>(undefined);\n\n /**\n * Toast message on success. Requires `CngxToaster` (via `provideFeedback(withToasts())`\n * or `provideToasts()`). Silently ignored when toaster is not provided.\n *\n * `toastSuccessDuration` should be >= `feedbackDuration` to avoid rapid re-fire\n * on repeated clicks that floods the SR announcement queue.\n */\n readonly toastSuccess = input<string | undefined>(undefined);\n\n /** Toast message on error. */\n readonly toastError = input<string | undefined>(undefined);\n\n /** Include the error detail message in the error toast body. */\n readonly toastErrorDetail = input<boolean>(false);\n\n /** Duration for success toasts in ms. */\n readonly toastSuccessDuration = input<number>(3000);\n\n /** Duration for error toasts - `'persistent'` means manual dismiss only. */\n readonly toastErrorDuration = input<number | 'persistent'>('persistent');\n\n /** @internal - inner CngxAsyncClick directive instance. Non-required to allow safe pre-view-init reads. */\n private readonly asyncClick = viewChild(CngxAsyncClick);\n\n /**\n * @internal - effective status: reflects external `[externalState]` if\n * bound (through the shared `CngxAsyncStatus` reflection - one home for\n * the state→display-bucket mapping), otherwise reads the inner\n * `CngxAsyncClick` directive.\n */\n protected readonly effectiveStatus = computed(() => {\n const ext = this.externalState();\n if (ext) {\n return reflectAsyncDisplayStatus(ext);\n }\n // Guard against pre-view-init reads of `state` from consumers.\n const click = this.asyncClick();\n return click ? click.status() : ('idle' as const);\n });\n\n /** @internal - effective error value from external state or inner directive. */\n protected readonly effectiveError = computed(() => {\n const ext = this.externalState();\n if (ext) {\n return ext.error();\n }\n const click = this.asyncClick();\n return click ? click.error() : undefined;\n });\n\n /** @internal - busy while the effective status (inner or external) is pending. */\n protected readonly effectiveBusy = computed(() => this.effectiveStatus() === 'pending');\n\n /**\n * @internal - what the inner `CngxAsyncClick` may act on: only when the\n * consumer enabled it AND no effective operation is in flight. Feeding this\n * as `[enabled]` routes external-pending through the atom's own click guard,\n * so a click cannot start a second run while an external state is pending.\n */\n protected readonly clickEnabled = computed(\n () => this.enabled() && this.effectiveStatus() !== 'pending',\n );\n\n /**\n * @internal - SR announcement derived from the effective status, so an\n * external success/error settles audibly too (the inner directive only\n * knows its own runs). Mirrors the label fallback chain the template uses.\n */\n protected readonly effectiveAnnouncement = computed(() => {\n switch (this.effectiveStatus()) {\n case 'success':\n return untracked(\n () =>\n this.succeededAnnouncement() ??\n this.succeededLabel() ??\n this.i18n().asyncClickSucceeded,\n );\n case 'error':\n return untracked(\n () => this.failedAnnouncement() ?? this.failedLabel() ?? this.i18n().asyncClickFailed,\n );\n default:\n return '';\n }\n });\n\n /** @internal - stable id for the disabled-reason region. */\n protected readonly reasonId = nextUid('cngx-action-button-reason');\n\n /**\n * @internal - reference the reason region only while actually disabled by\n * intent and a reason exists. accname traverses a directly referenced hidden\n * node, so the id must be gated on the state it describes rather than left\n * permanently pointing at a hidden region.\n */\n protected readonly describedBy = computed(() =>\n !this.enabled() && this.disabledReason() ? this.reasonId : null,\n );\n\n private readonly lastUpdatedState = signal<Date | undefined>(undefined);\n\n /**\n * Full `CngxAsyncState` view of this button's effective lifecycle.\n *\n * Reflects the external state when `[externalState]` is bound,\n * otherwise the inner `CngxAsyncClick` directive's state.\n *\n * Bind to any state consumer: `<cngx-alert [state]=\"btn.state\" />`.\n */\n readonly state: CngxAsyncState<unknown> = buildAsyncStateView<unknown>({\n status: this.effectiveStatus,\n data: computed(() => undefined),\n error: this.effectiveError,\n lastUpdated: this.lastUpdatedState.asReadonly(),\n });\n\n /** @internal */\n protected readonly pendingTpl = contentChild(CngxPending);\n /** @internal */\n protected readonly succeededTpl = contentChild(CngxSucceeded);\n /** @internal */\n protected readonly failedTpl = contentChild(CngxFailed);\n\n constructor() {\n // Double-toast guard, consumer placed [cngxToastOn] on the same element.\n if (\n typeof ngDevMode !== 'undefined' &&\n ngDevMode &&\n this.externalToastOn &&\n (this.toastSuccess() || this.toastError())\n ) {\n console.warn(\n 'CngxActionButton: [toastSuccess]/[toastError] inputs and [cngxToastOn] ' +\n 'on the same element will fire duplicate toasts. Use one or the other.',\n );\n }\n\n const tracker = createTransitionTracker(() => this.effectiveStatus());\n\n effect(() => {\n const status = tracker.current();\n const previous = tracker.previous();\n\n if (status === previous) {\n return;\n }\n\n // Only the transition edge may re-run this body. The toast inputs and\n // effectiveError are read untracked: previous() stays stale for the whole\n // settled window, so a tracked read would re-fire the toast on any input\n // rebind while status sits in success/error. Doctrine: bridge effects\n // untrack service calls.\n untracked(() => {\n if (status === 'success') {\n // Producer write for the buildAsyncStateView `lastUpdated` slot (no other\n // source feeds it) - state production, not derived-state sync. This is the\n // sanctioned signal-write-in-effect class, same as the async-state-view pattern.\n this.lastUpdatedState.set(new Date());\n const msg = this.toastSuccess();\n if (msg && this.toaster) {\n this.toaster.show({\n message: msg,\n severity: 'success',\n duration: this.toastSuccessDuration(),\n });\n }\n }\n\n if (status === 'error') {\n const msg = this.toastError();\n if (msg && this.toaster) {\n const err = this.effectiveError();\n const detail =\n this.toastErrorDetail() && err != null ? this.errorDetail(err) : undefined;\n this.toaster.show({\n message: detail ? this.feedbackI18n().errorWithDetail(msg, detail) : msg,\n severity: 'error',\n duration: this.toastErrorDuration(),\n });\n }\n }\n });\n });\n }\n}\n","/**\n * @module @cngx/ui/action-button\n */\n\nexport { CngxActionButton, type ActionButtonVariant } from './action-button';\n","/**\n * Generated bundle index. Do not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