@cngx/ui 0.1.0-rc.7 → 0.1.0-rc.9

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 (101) hide show
  1. package/README.md +0 -1
  2. package/a11y/README.md +11 -5
  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 +227 -0
  7. package/data-grid-accordion/README.md +76 -2
  8. package/feedback/README.md +40 -0
  9. package/fesm2022/cngx-ui-a11y.mjs +189 -57
  10. package/fesm2022/cngx-ui-a11y.mjs.map +1 -1
  11. package/fesm2022/cngx-ui-accordion.mjs +120 -36
  12. package/fesm2022/cngx-ui-accordion.mjs.map +1 -1
  13. package/fesm2022/cngx-ui-action-button.mjs +121 -56
  14. package/fesm2022/cngx-ui-action-button.mjs.map +1 -1
  15. package/fesm2022/cngx-ui-breadcrumb.mjs +228 -108
  16. package/fesm2022/cngx-ui-breadcrumb.mjs.map +1 -1
  17. package/fesm2022/cngx-ui-chart-panel.mjs +180 -23
  18. package/fesm2022/cngx-ui-chart-panel.mjs.map +1 -1
  19. package/fesm2022/cngx-ui-collection.mjs +204 -62
  20. package/fesm2022/cngx-ui-collection.mjs.map +1 -1
  21. package/fesm2022/cngx-ui-command-palette.mjs +395 -119
  22. package/fesm2022/cngx-ui-command-palette.mjs.map +1 -1
  23. package/fesm2022/cngx-ui-context-menu.mjs +209 -40
  24. package/fesm2022/cngx-ui-context-menu.mjs.map +1 -1
  25. package/fesm2022/cngx-ui-data-grid-accordion.mjs +498 -101
  26. package/fesm2022/cngx-ui-data-grid-accordion.mjs.map +1 -1
  27. package/fesm2022/cngx-ui-empty-state.mjs +16 -6
  28. package/fesm2022/cngx-ui-empty-state.mjs.map +1 -1
  29. package/fesm2022/cngx-ui-feedback.mjs +1074 -460
  30. package/fesm2022/cngx-ui-feedback.mjs.map +1 -1
  31. package/fesm2022/cngx-ui-mat-accordion.mjs +76 -7
  32. package/fesm2022/cngx-ui-mat-accordion.mjs.map +1 -1
  33. package/fesm2022/cngx-ui-mat-paginator.mjs +67 -24
  34. package/fesm2022/cngx-ui-mat-paginator.mjs.map +1 -1
  35. package/fesm2022/cngx-ui-mat-stepper.mjs +72 -47
  36. package/fesm2022/cngx-ui-mat-stepper.mjs.map +1 -1
  37. package/fesm2022/cngx-ui-mat-tabs.mjs +555 -204
  38. package/fesm2022/cngx-ui-mat-tabs.mjs.map +1 -1
  39. package/fesm2022/cngx-ui-overlay.mjs +69 -13
  40. package/fesm2022/cngx-ui-overlay.mjs.map +1 -1
  41. package/fesm2022/cngx-ui-paginator.mjs +553 -198
  42. package/fesm2022/cngx-ui-paginator.mjs.map +1 -1
  43. package/fesm2022/cngx-ui-sidenav.mjs +344 -109
  44. package/fesm2022/cngx-ui-sidenav.mjs.map +1 -1
  45. package/fesm2022/cngx-ui-skeleton.mjs +4 -16
  46. package/fesm2022/cngx-ui-skeleton.mjs.map +1 -1
  47. package/fesm2022/cngx-ui-speak.mjs +107 -8
  48. package/fesm2022/cngx-ui-speak.mjs.map +1 -1
  49. package/fesm2022/cngx-ui-stat-card.mjs +146 -46
  50. package/fesm2022/cngx-ui-stat-card.mjs.map +1 -1
  51. package/fesm2022/cngx-ui-stepper.mjs +234 -99
  52. package/fesm2022/cngx-ui-stepper.mjs.map +1 -1
  53. package/fesm2022/cngx-ui-tabs.mjs +88 -25
  54. package/fesm2022/cngx-ui-tabs.mjs.map +1 -1
  55. package/fesm2022/cngx-ui-timeline.mjs +98 -23
  56. package/fesm2022/cngx-ui-timeline.mjs.map +1 -1
  57. package/fesm2022/cngx-ui-toc.mjs +101 -33
  58. package/fesm2022/cngx-ui-toc.mjs.map +1 -1
  59. package/fesm2022/cngx-ui.mjs +15 -20
  60. package/fesm2022/cngx-ui.mjs.map +1 -1
  61. package/mat-paginator/README.md +9 -2
  62. package/mat-tabs/README.md +30 -6
  63. package/mat-tabs/styles/mat-tabs.css +188 -42
  64. package/overlay/README.md +9 -4
  65. package/package.json +31 -7
  66. package/paginator/README.md +8 -4
  67. package/schematics/collection.json +9 -0
  68. package/schematics/ng-add/index.js +9 -0
  69. package/schematics/ng-add/schema.json +91 -0
  70. package/schematics/package.json +3 -0
  71. package/sidenav/README.md +33 -11
  72. package/speak/README.md +3 -2
  73. package/stepper/README.md +14 -2
  74. package/timeline/README.md +1 -1
  75. package/toc/README.md +4 -1
  76. package/types/cngx-ui-a11y.d.ts +121 -30
  77. package/types/cngx-ui-accordion.d.ts +100 -28
  78. package/types/cngx-ui-action-button.d.ts +44 -3
  79. package/types/cngx-ui-breadcrumb.d.ts +167 -60
  80. package/types/cngx-ui-chart-panel.d.ts +122 -18
  81. package/types/cngx-ui-collection.d.ts +157 -55
  82. package/types/cngx-ui-command-palette.d.ts +297 -183
  83. package/types/cngx-ui-context-menu.d.ts +140 -10
  84. package/types/cngx-ui-data-grid-accordion.d.ts +278 -39
  85. package/types/cngx-ui-empty-state.d.ts +9 -2
  86. package/types/cngx-ui-feedback.d.ts +605 -59
  87. package/types/cngx-ui-mat-accordion.d.ts +30 -1
  88. package/types/cngx-ui-mat-paginator.d.ts +37 -8
  89. package/types/cngx-ui-mat-stepper.d.ts +23 -11
  90. package/types/cngx-ui-mat-tabs.d.ts +250 -34
  91. package/types/cngx-ui-overlay.d.ts +56 -10
  92. package/types/cngx-ui-paginator.d.ts +425 -136
  93. package/types/cngx-ui-sidenav.d.ts +248 -74
  94. package/types/cngx-ui-skeleton.d.ts +6 -7
  95. package/types/cngx-ui-speak.d.ts +118 -5
  96. package/types/cngx-ui-stat-card.d.ts +117 -33
  97. package/types/cngx-ui-stepper.d.ts +88 -49
  98. package/types/cngx-ui-tabs.d.ts +6 -4
  99. package/types/cngx-ui-timeline.d.ts +35 -11
  100. package/types/cngx-ui-toc.d.ts +93 -16
  101. package/types/cngx-ui.d.ts +7 -4
@@ -1,9 +1,10 @@
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, afterNextRender, 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
+ import { cngxDevWarn } from '@cngx/utils';
7
8
 
8
9
  /**
9
10
  * Action button organism with built-in status communication.
@@ -63,7 +64,10 @@ import { CngxToaster, CngxToastOn } from '@cngx/ui/feedback';
63
64
  */
64
65
  class CngxActionButton {
65
66
  toaster = inject(CngxToaster, { optional: true });
67
+ errorDetail = injectErrorDetail();
68
+ feedbackI18n = injectFeedbackI18n();
66
69
  externalToastOn = inject(CngxToastOn, { self: true, optional: true });
70
+ i18n = injectInteractiveI18n();
67
71
  /** The async action to execute on click. */
68
72
  action = input.required(...(ngDevMode ? [{ debugName: "action" }] : /* istanbul ignore next */ []));
69
73
  /** Duration in ms to show success/error feedback. Passed through to `cngxAsyncClick`. */
@@ -74,9 +78,15 @@ class CngxActionButton {
74
78
  type = input('button', ...(ngDevMode ? [{ debugName: "type" }] : /* istanbul ignore next */ []));
75
79
  /** Visual variant - sets CSS class `cngx-action-button--{variant}`. */
76
80
  variant = input('primary', ...(ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []));
77
- /** SR announcement on success. Falls back to `succeededLabel`, then `'Action succeeded'`. */
81
+ /**
82
+ * SR announcement on success. Falls back to `succeededLabel`, then
83
+ * `CNGX_INTERACTIVE_I18N.asyncClickSucceeded`.
84
+ */
78
85
  succeededAnnouncement = input(undefined, ...(ngDevMode ? [{ debugName: "succeededAnnouncement" }] : /* istanbul ignore next */ []));
79
- /** SR announcement on failure. Falls back to `failedLabel`, then `'Action failed'`. */
86
+ /**
87
+ * SR announcement on failure. Falls back to `failedLabel`, then
88
+ * `CNGX_INTERACTIVE_I18N.asyncClickFailed`.
89
+ */
80
90
  failedAnnouncement = input(undefined, ...(ngDevMode ? [{ debugName: "failedAnnouncement" }] : /* istanbul ignore next */ []));
81
91
  /** Fallback text while pending (when no `cngxPending` template is projected). */
82
92
  pendingLabel = input(undefined, ...(ngDevMode ? [{ debugName: "pendingLabel" }] : /* istanbul ignore next */ []));
@@ -89,6 +99,13 @@ class CngxActionButton {
89
99
  * When set, the button's status display follows `externalState.status()`.
90
100
  */
91
101
  externalState = input(undefined, ...(ngDevMode ? [{ debugName: "externalState" }] : /* istanbul ignore next */ []));
102
+ /**
103
+ * Reason the button is disabled, announced to screen readers while
104
+ * `[enabled]` is `false`. Rendered into a hidden region and referenced by
105
+ * `aria-describedby` only while disabled - an enabled button never carries
106
+ * the reference. No effect when `[enabled]` is `true`.
107
+ */
108
+ disabledReason = input(undefined, ...(ngDevMode ? [{ debugName: "disabledReason" }] : /* istanbul ignore next */ []));
92
109
  /**
93
110
  * Toast message on success. Requires `CngxToaster` (via `provideFeedback(withToasts())`
94
111
  * or `provideToasts()`). Silently ignored when toaster is not provided.
@@ -131,6 +148,41 @@ class CngxActionButton {
131
148
  const click = this.asyncClick();
132
149
  return click ? click.error() : undefined;
133
150
  }, ...(ngDevMode ? [{ debugName: "effectiveError" }] : /* istanbul ignore next */ []));
151
+ /** @internal - busy while the effective status (inner or external) is pending. */
152
+ effectiveBusy = computed(() => this.effectiveStatus() === 'pending', ...(ngDevMode ? [{ debugName: "effectiveBusy" }] : /* istanbul ignore next */ []));
153
+ /**
154
+ * @internal - what the inner `CngxAsyncClick` may act on: only when the
155
+ * consumer enabled it AND no effective operation is in flight. Feeding this
156
+ * as `[enabled]` routes external-pending through the atom's own click guard,
157
+ * so a click cannot start a second run while an external state is pending.
158
+ */
159
+ clickEnabled = computed(() => this.enabled() && this.effectiveStatus() !== 'pending', ...(ngDevMode ? [{ debugName: "clickEnabled" }] : /* istanbul ignore next */ []));
160
+ /**
161
+ * @internal - SR announcement derived from the effective status, so an
162
+ * external success/error settles audibly too (the inner directive only
163
+ * knows its own runs). Mirrors the label fallback chain the template uses.
164
+ */
165
+ effectiveAnnouncement = computed(() => {
166
+ switch (this.effectiveStatus()) {
167
+ case 'success':
168
+ return untracked(() => this.succeededAnnouncement() ??
169
+ this.succeededLabel() ??
170
+ this.i18n().asyncClickSucceeded);
171
+ case 'error':
172
+ return untracked(() => this.failedAnnouncement() ?? this.failedLabel() ?? this.i18n().asyncClickFailed);
173
+ default:
174
+ return '';
175
+ }
176
+ }, ...(ngDevMode ? [{ debugName: "effectiveAnnouncement" }] : /* istanbul ignore next */ []));
177
+ /** @internal - stable id for the disabled-reason region. */
178
+ reasonId = nextUid('cngx-action-button-reason');
179
+ /**
180
+ * @internal - reference the reason region only while actually disabled by
181
+ * intent and a reason exists. accname traverses a directly referenced hidden
182
+ * node, so the id must be gated on the state it describes rather than left
183
+ * permanently pointing at a hidden region.
184
+ */
185
+ describedBy = computed(() => !this.enabled() && this.disabledReason() ? this.reasonId : null, ...(ngDevMode ? [{ debugName: "describedBy" }] : /* istanbul ignore next */ []));
134
186
  lastUpdatedState = signal(undefined, ...(ngDevMode ? [{ debugName: "lastUpdatedState" }] : /* istanbul ignore next */ []));
135
187
  /**
136
188
  * Full `CngxAsyncState` view of this button's effective lifecycle.
@@ -154,12 +206,14 @@ class CngxActionButton {
154
206
  failedTpl = contentChild(CngxFailed, ...(ngDevMode ? [{ debugName: "failedTpl" }] : /* istanbul ignore next */ []));
155
207
  constructor() {
156
208
  // Double-toast guard, consumer placed [cngxToastOn] on the same element.
157
- if (typeof ngDevMode !== 'undefined' &&
158
- ngDevMode &&
159
- this.externalToastOn &&
160
- (this.toastSuccess() || this.toastError())) {
161
- console.warn('CngxActionButton: [toastSuccess]/[toastError] inputs and [cngxToastOn] ' +
162
- 'on the same element will fire duplicate toasts. Use one or the other.');
209
+ // After the first render: template-bound inputs are unset in the constructor.
210
+ if (typeof ngDevMode !== 'undefined' && ngDevMode && this.externalToastOn) {
211
+ afterNextRender(() => {
212
+ if (this.toastSuccess() || this.toastError()) {
213
+ cngxDevWarn('CNGX3008', '[cngx-action-button] [toastSuccess]/[toastError] inputs and [cngxToastOn] ' +
214
+ 'on the same element will fire duplicate toasts. Use one or the other.');
215
+ }
216
+ });
163
217
  }
164
218
  const tracker = createTransitionTracker(() => this.effectiveStatus());
165
219
  effect(() => {
@@ -168,52 +222,55 @@ class CngxActionButton {
168
222
  if (status === previous) {
169
223
  return;
170
224
  }
171
- if (status === 'success') {
172
- // Producer write for the buildAsyncStateView `lastUpdated` slot (no other
173
- // source feeds it) - state production, not derived-state sync. This is the
174
- // sanctioned signal-write-in-effect class, same as the async-state-view pattern.
175
- this.lastUpdatedState.set(new Date());
176
- const msg = this.toastSuccess();
177
- if (msg && this.toaster) {
178
- this.toaster.show({
179
- message: msg,
180
- severity: 'success',
181
- duration: this.toastSuccessDuration(),
182
- });
225
+ // Only the transition edge may re-run this body. The toast inputs and
226
+ // effectiveError are read untracked: previous() stays stale for the whole
227
+ // settled window, so a tracked read would re-fire the toast on any input
228
+ // rebind while status sits in success/error. Doctrine: bridge effects
229
+ // untrack service calls.
230
+ untracked(() => {
231
+ if (status === 'success') {
232
+ // Producer write for the buildAsyncStateView `lastUpdated` slot (no other
233
+ // source feeds it) - state production, not derived-state sync. This is the
234
+ // sanctioned signal-write-in-effect class, same as the async-state-view pattern.
235
+ this.lastUpdatedState.set(new Date());
236
+ const msg = this.toastSuccess();
237
+ if (msg && this.toaster) {
238
+ this.toaster.show({
239
+ message: msg,
240
+ severity: 'success',
241
+ duration: this.toastSuccessDuration(),
242
+ });
243
+ }
183
244
  }
184
- }
185
- if (status === 'error') {
186
- const msg = this.toastError();
187
- if (msg && this.toaster) {
188
- const err = this.effectiveError();
189
- const detail = this.toastErrorDetail() && err != null
190
- ? err instanceof Error
191
- ? err.message
192
- : typeof err === 'string'
193
- ? err
194
- : undefined
195
- : undefined;
196
- this.toaster.show({
197
- message: detail ? `${msg}: ${detail}` : msg,
198
- severity: 'error',
199
- duration: this.toastErrorDuration(),
200
- });
245
+ if (status === 'error') {
246
+ const msg = this.toastError();
247
+ if (msg && this.toaster) {
248
+ const err = this.effectiveError();
249
+ const detail = this.toastErrorDetail() && err != null ? this.errorDetail(err) : undefined;
250
+ this.toaster.show({
251
+ message: detail ? this.feedbackI18n().errorWithDetail(msg, detail) : msg,
252
+ severity: 'error',
253
+ duration: this.toastErrorDuration(),
254
+ });
255
+ }
201
256
  }
202
- }
257
+ });
203
258
  });
204
259
  }
205
260
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxActionButton, deps: [], target: i0.ɵɵFactoryTarget.Component });
206
- 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: `
261
+ 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: `
207
262
  <ng-template #idle><ng-content /></ng-template>
208
263
 
209
264
  <button
210
265
  [type]="type()"
211
266
  [cngxAsyncClick]="action()"
212
- #btn="cngxAsyncClick"
213
267
  [feedbackDuration]="feedbackDuration()"
214
- [enabled]="enabled()"
215
- [succeededAnnouncement]="succeededAnnouncement() ?? succeededLabel() ?? 'Action succeeded'"
216
- [failedAnnouncement]="failedAnnouncement() ?? failedLabel() ?? 'Action failed'"
268
+ [enabled]="clickEnabled()"
269
+ [busy]="effectiveBusy()"
270
+ [autoAnnounce]="false"
271
+ [succeededAnnouncement]="succeededAnnouncement() ?? succeededLabel()"
272
+ [failedAnnouncement]="failedAnnouncement() ?? failedLabel()"
273
+ [attr.aria-describedby]="describedBy()"
217
274
  [class]="'cngx-action-button cngx-action-button--' + variant()"
218
275
  >
219
276
  @switch (effectiveStatus()) {
@@ -251,10 +308,13 @@ class CngxActionButton {
251
308
  }
252
309
  }
253
310
  </button>
311
+ @if (disabledReason(); as reason) {
312
+ <span [id]="reasonId" class="cngx-action-button__sr-only">{{ reason }}</span>
313
+ }
254
314
  <span aria-live="polite" aria-atomic="true" class="cngx-action-button__sr-only">{{
255
- btn.announcement()
315
+ effectiveAnnouncement()
256
316
  }}</span>
257
- `, 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);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", "succeededAnnouncement", "failedAnnouncement"], exportAs: ["cngxAsyncClick"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
317
+ `, 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 });
258
318
  }
259
319
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxActionButton, decorators: [{
260
320
  type: Component,
@@ -266,11 +326,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
266
326
  <button
267
327
  [type]="type()"
268
328
  [cngxAsyncClick]="action()"
269
- #btn="cngxAsyncClick"
270
329
  [feedbackDuration]="feedbackDuration()"
271
- [enabled]="enabled()"
272
- [succeededAnnouncement]="succeededAnnouncement() ?? succeededLabel() ?? 'Action succeeded'"
273
- [failedAnnouncement]="failedAnnouncement() ?? failedLabel() ?? 'Action failed'"
330
+ [enabled]="clickEnabled()"
331
+ [busy]="effectiveBusy()"
332
+ [autoAnnounce]="false"
333
+ [succeededAnnouncement]="succeededAnnouncement() ?? succeededLabel()"
334
+ [failedAnnouncement]="failedAnnouncement() ?? failedLabel()"
335
+ [attr.aria-describedby]="describedBy()"
274
336
  [class]="'cngx-action-button cngx-action-button--' + variant()"
275
337
  >
276
338
  @switch (effectiveStatus()) {
@@ -308,11 +370,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
308
370
  }
309
371
  }
310
372
  </button>
373
+ @if (disabledReason(); as reason) {
374
+ <span [id]="reasonId" class="cngx-action-button__sr-only">{{ reason }}</span>
375
+ }
311
376
  <span aria-live="polite" aria-atomic="true" class="cngx-action-button__sr-only">{{
312
- btn.announcement()
377
+ effectiveAnnouncement()
313
378
  }}</span>
314
- `, 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);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"] }]
315
- }], 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 }] }] } });
379
+ `, 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"] }]
380
+ }], 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 }] }] } });
316
381
 
317
382
  /**
318
383
  * @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 * @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 #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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuDG;MAiEU,gBAAgB,CAAA;IACV,OAAO,GAAG,MAAM,CAAC,WAAW,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;AACjD,IAAA,eAAe,GAAG,MAAM,CAAC,WAAW,E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CAAA,YAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,UAAA,CAAA,MA8CT,WAAW,CAAA,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,YAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,UAAA,CAAA,MAET,aAAa,2FAEhB,UAAU,CAAA,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AC3QxD;;AAEG;;ACFH;;AAEG;;;;"}
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 afterNextRender,\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';\nimport { cngxDevWarn } from '@cngx/utils';\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 // After the first render: template-bound inputs are unset in the constructor.\n if (typeof ngDevMode !== 'undefined' && ngDevMode && this.externalToastOn) {\n afterNextRender(() => {\n if (this.toastSuccess() || this.toastError()) {\n cngxDevWarn(\n 'CNGX3008',\n '[cngx-action-button] [toastSuccess]/[toastError] inputs and [cngxToastOn] ' +\n 'on the same element will fire duplicate toasts. Use one or the other.',\n );\n }\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 edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;AAwCA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuDG;MAsEU,gBAAgB,CAAA;IACV,OAAO,GAAG,MAAM,CAAC,WAAW,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IACjD,WAAW,GAAG,iBAAiB,EAAE;IACjC,YAAY,GAAG,kBAAkB,EAAE;AACnC,IAAA,eAAe,GAAG,MAAM,CAAC,WAAW,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IACnE,IAAI,GAAG,qBAAqB,EAAE;;AAGxC,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;AAExD;;;AAGG;AACM,IAAA,qBAAq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