codexly-ui 0.9.0 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -11013,6 +11013,7 @@ class ClxToastComponent {
11013
11013
  _colorClass = computed(() => TOAST_COLOR_MAP[this.entry().type], ...(ngDevMode ? [{ debugName: "_colorClass" }] : /* istanbul ignore next */ []));
11014
11014
  _progressColor = computed(() => TOAST_PROGRESS_MAP[this.entry().type], ...(ngDevMode ? [{ debugName: "_progressColor" }] : /* istanbul ignore next */ []));
11015
11015
  _buttonColor = computed(() => this.entry().type, ...(ngDevMode ? [{ debugName: "_buttonColor" }] : /* istanbul ignore next */ []));
11016
+ _actions = computed(() => this.entry().actions ?? (this.entry().action ? [this.entry().action] : []), ...(ngDevMode ? [{ debugName: "_actions" }] : /* istanbul ignore next */ []));
11016
11017
  get _card() {
11017
11018
  return this._el.nativeElement.querySelector('.clx-toast-card');
11018
11019
  }
@@ -11042,8 +11043,8 @@ class ClxToastComponent {
11042
11043
  this._paused = false;
11043
11044
  }
11044
11045
  // ─── Action ────────────────────────────────────────────────────────────────
11045
- _onAction() {
11046
- this.entry().action?.onClick();
11046
+ _onAction(action) {
11047
+ action.onClick();
11047
11048
  this.dismiss.emit(this.entry().id);
11048
11049
  }
11049
11050
  // ─── Animated exit (called by container before removal) ───────────────────
@@ -11113,18 +11114,22 @@ class ClxToastComponent {
11113
11114
  <p class="text-sm text-clx-text-muted leading-snug wrap-break-word">
11114
11115
  {{ entry().message }}
11115
11116
  </p>
11116
- @if (entry().action) {
11117
- <button
11118
- clx-button
11119
- type="button"
11120
- variant="link"
11121
- [color]="_buttonColor()"
11122
- size="xs"
11123
- class="mt-1 -ml-1 h-auto p-0"
11124
- (click)="_onAction()"
11125
- >
11126
- {{ entry().action!.label }}
11127
- </button>
11117
+ @if (_actions().length) {
11118
+ <div class="flex items-center gap-3 mt-2">
11119
+ @for (a of _actions(); track a.label) {
11120
+ <button
11121
+ clx-button
11122
+ type="button"
11123
+ [variant]="a.variant ?? 'link'"
11124
+ [color]="_buttonColor()"
11125
+ size="xs"
11126
+ [class]="a.variant && a.variant !== 'link' ? '' : '-ml-1 h-auto p-0'"
11127
+ (click)="_onAction(a)"
11128
+ >
11129
+ {{ a.label }}
11130
+ </button>
11131
+ }
11132
+ </div>
11128
11133
  }
11129
11134
  </div>
11130
11135
 
@@ -11184,18 +11189,22 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.15", ngImpo
11184
11189
  <p class="text-sm text-clx-text-muted leading-snug wrap-break-word">
11185
11190
  {{ entry().message }}
11186
11191
  </p>
11187
- @if (entry().action) {
11188
- <button
11189
- clx-button
11190
- type="button"
11191
- variant="link"
11192
- [color]="_buttonColor()"
11193
- size="xs"
11194
- class="mt-1 -ml-1 h-auto p-0"
11195
- (click)="_onAction()"
11196
- >
11197
- {{ entry().action!.label }}
11198
- </button>
11192
+ @if (_actions().length) {
11193
+ <div class="flex items-center gap-3 mt-2">
11194
+ @for (a of _actions(); track a.label) {
11195
+ <button
11196
+ clx-button
11197
+ type="button"
11198
+ [variant]="a.variant ?? 'link'"
11199
+ [color]="_buttonColor()"
11200
+ size="xs"
11201
+ [class]="a.variant && a.variant !== 'link' ? '' : '-ml-1 h-auto p-0'"
11202
+ (click)="_onAction(a)"
11203
+ >
11204
+ {{ a.label }}
11205
+ </button>
11206
+ }
11207
+ </div>
11199
11208
  }
11200
11209
  </div>
11201
11210
 
@@ -15844,6 +15853,7 @@ class ClxToastService {
15844
15853
  animationOut: options.animationOut ?? TOAST_DEFAULTS.animationOut,
15845
15854
  animationDuration: options.animationDuration ?? TOAST_DEFAULTS.animationDuration,
15846
15855
  action: options.action,
15856
+ actions: options.actions,
15847
15857
  removing: false,
15848
15858
  };
15849
15859
  const isBottom = position.startsWith('bottom');