@ascentgl/ads-ui 22.12.0 → 22.13.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ascentgl/ads-ui",
3
- "version": "22.12.0",
3
+ "version": "22.13.0",
4
4
  "peerDependencies": {
5
5
  "@angular/animations": ">=22.0.0",
6
6
  "date-fns": ">=4.1.0",
@@ -20,6 +20,14 @@
20
20
  --mat-snack-bar-container-color: #{color(success)};
21
21
  }
22
22
 
23
+ &.warning {
24
+ --mat-snack-bar-container-color: #{color(alert)};
25
+
26
+ & > .button {
27
+ color: color(error);
28
+ }
29
+ }
30
+
23
31
  &.secondary {
24
32
  --mat-snack-bar-container-color: #{color(secondary)};
25
33
  }
@@ -36,5 +44,8 @@
36
44
  padding-right: 0;
37
45
  min-width: 200px;
38
46
  max-width: unset;
47
+ // Positioning context for the auto-close countdown bar
48
+ // (`.snackbar-progress`) rendered inside the snackbar component.
49
+ position: relative;
39
50
  }
40
51
  }
@@ -2100,6 +2100,12 @@ declare class AdsSliderComponent extends AdsCheckboxComponent {
2100
2100
  static ɵcmp: i0.ɵɵComponentDeclaration<AdsSliderComponent, "ads-slider", never, { "min": { "alias": "min"; "required": false; }; "max": { "alias": "max"; "required": false; }; "step": { "alias": "step"; "required": false; }; "tickInterval": { "alias": "tickInterval"; "required": false; }; "invert": { "alias": "invert"; "required": false; }; "thumbLabel": { "alias": "thumbLabel"; "required": false; }; }, {}, never, never, true, never>;
2101
2101
  }
2102
2102
 
2103
+ declare enum PanelClass {
2104
+ Success = "success",
2105
+ Error = "error",
2106
+ Warning = "warning",
2107
+ Primary = "primary"
2108
+ }
2103
2109
  type SnackBarData = {
2104
2110
  id?: string;
2105
2111
  message: string;
@@ -2109,29 +2115,49 @@ type SnackBarData = {
2109
2115
  onButtonClick?: () => void;
2110
2116
  /**
2111
2117
  * Optional duration in milliseconds to auto-close the snackbar.
2112
- * If not set and panel class is 'success', defaults to 4000ms.
2118
+ * If not set, the 'success' and 'warning' panel classes default to 5000ms.
2119
+ * Set to 0 to disable auto-close for any panel class.
2113
2120
  */
2114
2121
  autoCloseDuration?: number;
2122
+ /**
2123
+ * Optional override for the leading status icon. Each panel class renders a
2124
+ * predefined icon; set this to display a different one from the icon registry.
2125
+ */
2126
+ icon?: adsIcon;
2127
+ /** Hide the leading status icon entirely. */
2128
+ hideIcon?: boolean;
2129
+ };
2130
+ /** Leading status icon configuration for a panel class. */
2131
+ type SnackbarIcon = {
2132
+ name: adsIcon;
2133
+ color?: string;
2134
+ stroke?: keyof IconThemes;
2135
+ /** Rotate the glyph 180° (used to turn the information icon into a caution mark). */
2136
+ rotated?: boolean;
2115
2137
  };
2116
2138
  declare class AdsSnackbarComponent implements AfterViewInit, OnDestroy {
2117
2139
  private elementRef;
2118
2140
  data: SnackBarData;
2119
2141
  snackBarRef: MatSnackBarRef<any>;
2142
+ private registry;
2120
2143
  readonly defaultButtonCaption = "Close";
2121
2144
  protected readonly PanelClass: typeof PanelClass;
2122
2145
  private autoCloseTimeoutId?;
2123
2146
  /** @ignore */
2124
2147
  constructor(elementRef: ElementRef<HTMLElement>);
2148
+ /** @ignore */
2149
+ get panelClass(): PanelClass;
2125
2150
  get buttonPanelClass(): Variant;
2151
+ /** Resolved leading status icon for the current panel class, or null when hidden. */
2152
+ get icon(): SnackbarIcon | null;
2153
+ /** Resolved auto-close duration in ms, or null when the snackbar should not auto-close. */
2154
+ get autoCloseDuration(): number | null;
2155
+ /** Whether the countdown progress bar should be shown (only while auto-closing). */
2156
+ get showProgressBar(): boolean;
2126
2157
  /** @ignore */
2127
2158
  get id(): string;
2128
2159
  /** @ignore */
2129
2160
  ngAfterViewInit(): void;
2130
- /**
2131
- * Sets up the auto-close timer if required.
2132
- * If autoCloseDuration is 0, null, or undefined, disables auto-close even for 'success'.
2133
- */
2134
- private setupAutoCloseTimer;
2135
2161
  /** @ignore */
2136
2162
  ngOnDestroy(): void;
2137
2163
  /** @ignore */
@@ -2139,11 +2165,6 @@ declare class AdsSnackbarComponent implements AfterViewInit, OnDestroy {
2139
2165
  static ɵfac: i0.ɵɵFactoryDeclaration<AdsSnackbarComponent, never>;
2140
2166
  static ɵcmp: i0.ɵɵComponentDeclaration<AdsSnackbarComponent, "ads-snackbar", never, {}, {}, never, never, true, never>;
2141
2167
  }
2142
- declare enum PanelClass {
2143
- Success = "success",
2144
- Error = "error",
2145
- Primary = "primary"
2146
- }
2147
2168
 
2148
2169
  interface IViewportService {
2149
2170
  isMatched(breakpoints: string | string[]): boolean;