@immich/ui 0.39.0 → 0.39.1

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.
@@ -6,10 +6,10 @@ declare class ToastManager {
6
6
  custom(item: ToastCustom, options?: ToastOptions): void;
7
7
  open(item: ToastItem, options?: ToastOptions): void;
8
8
  unmount(): Promise<void>;
9
- success(item: string | ToastShow): void;
10
- info(item: string | ToastShow): void;
11
- warning(item: string | ToastShow): void;
12
- danger(item: string | ToastShow): void;
9
+ success(item?: string | ToastShow, options?: ToastOptions): void;
10
+ info(item?: string | ToastShow, options?: ToastOptions): void;
11
+ warning(item?: string | ToastShow, options?: ToastOptions): void;
12
+ danger(item?: string | ToastShow, options?: ToastOptions): void;
13
13
  mount(): Promise<void>;
14
14
  private remove;
15
15
  }
@@ -3,7 +3,7 @@ import { t } from './translation.svelte.js';
3
3
  import { generateId } from '../utilities/internal.js';
4
4
  import { mount, unmount } from 'svelte';
5
5
  export const isCustomToast = (item) => !!item.component;
6
- const expand = (item) => (typeof item === 'string' ? { description: item } : item);
6
+ const expand = (item) => typeof item === 'string' ? { description: item } : (item ?? {});
7
7
  class ToastManager {
8
8
  #ref;
9
9
  #props = $state({ items: [] });
@@ -37,17 +37,17 @@ class ToastManager {
37
37
  await unmount(this.#ref);
38
38
  }
39
39
  }
40
- success(item) {
41
- this.show({ title: t('toast_success_title'), color: 'success', ...expand(item) });
40
+ success(item, options) {
41
+ this.show({ title: t('toast_success_title'), color: 'success', ...expand(item) }, options);
42
42
  }
43
- info(item) {
44
- this.show({ title: t('toast_info_title'), color: 'info', ...expand(item) });
43
+ info(item, options) {
44
+ this.show({ title: t('toast_info_title'), color: 'info', ...expand(item) }, options);
45
45
  }
46
- warning(item) {
47
- this.show({ title: t('toast_warning_title'), color: 'warning', ...expand(item) });
46
+ warning(item, options) {
47
+ this.show({ title: t('toast_warning_title'), color: 'warning', ...expand(item) }, options);
48
48
  }
49
- danger(item) {
50
- this.show({ title: t('toast_danger_title'), color: 'danger', ...expand(item) });
49
+ danger(item, options) {
50
+ this.show({ title: t('toast_danger_title'), color: 'danger', ...expand(item) }, options);
51
51
  }
52
52
  async mount() {
53
53
  if (!this.#ref) {
package/dist/types.d.ts CHANGED
@@ -184,6 +184,7 @@ export type ToastShow = {
184
184
  description?: string;
185
185
  color?: Color;
186
186
  shape?: Shape;
187
+ icon?: IconLike | false;
187
188
  size?: ContainerSize;
188
189
  variant?: ToastVariant;
189
190
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@immich/ui",
3
- "version": "0.39.0",
3
+ "version": "0.39.1",
4
4
  "license": "GNU Affero General Public License version 3",
5
5
  "repository": {
6
6
  "type": "git",