@immich/ui 0.55.0 → 0.56.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.
@@ -11,13 +11,12 @@
11
11
  interface Props {
12
12
  title?: string;
13
13
  icon?: string | boolean;
14
- prompt?: string;
14
+ prompt?: string | Snippet;
15
15
  confirmText?: string;
16
16
  confirmColor?: Color;
17
17
  disabled?: boolean;
18
18
  size?: ModalSize;
19
19
  onClose: (confirmed: boolean) => void;
20
- promptSnippet?: Snippet;
21
20
  }
22
21
 
23
22
  let {
@@ -29,7 +28,6 @@
29
28
  disabled = false,
30
29
  size = 'small',
31
30
  onClose,
32
- promptSnippet,
33
31
  }: Props = $props();
34
32
 
35
33
  const handleConfirm = () => {
@@ -39,8 +37,10 @@
39
37
 
40
38
  <Modal {title} onClose={() => onClose(false)} {size} {icon}>
41
39
  <ModalBody>
42
- {#if promptSnippet}{@render promptSnippet()}{:else}
40
+ {#if typeof prompt === 'string'}
43
41
  <p>{prompt}</p>
42
+ {:else}
43
+ {@render prompt()}
44
44
  {/if}
45
45
  </ModalBody>
46
46
 
@@ -3,13 +3,12 @@ import type { Snippet } from 'svelte';
3
3
  interface Props {
4
4
  title?: string;
5
5
  icon?: string | boolean;
6
- prompt?: string;
6
+ prompt?: string | Snippet;
7
7
  confirmText?: string;
8
8
  confirmColor?: Color;
9
9
  disabled?: boolean;
10
10
  size?: ModalSize;
11
11
  onClose: (confirmed: boolean) => void;
12
- promptSnippet?: Snippet;
13
12
  }
14
13
  declare const ConfirmModal: import("svelte").Component<Props, {}, "">;
15
14
  type ConfirmModal = ReturnType<typeof ConfirmModal>;
@@ -14,6 +14,8 @@
14
14
  icon?: string | boolean;
15
15
  submitText?: string;
16
16
  submitColor?: Color;
17
+ cancelText?: string;
18
+ cancelColor?: Color;
17
19
  disabled?: boolean;
18
20
  size?: ModalSize;
19
21
  preventDefault?: boolean;
@@ -28,6 +30,8 @@
28
30
  icon,
29
31
  submitText = t('save'),
30
32
  submitColor = 'primary',
33
+ cancelText = t('cancel'),
34
+ cancelColor = 'secondary',
31
35
  disabled = false,
32
36
  size = 'small',
33
37
  preventDefault = true,
@@ -64,8 +68,8 @@
64
68
  </ModalBody>
65
69
  <ModalFooter>
66
70
  <HStack fullWidth>
67
- <Button shape="round" color="secondary" fullWidth onclick={onClose}>
68
- {t('cancel')}
71
+ <Button shape="round" color={cancelColor} fullWidth onclick={() => onClose()}>
72
+ {cancelText}
69
73
  </Button>
70
74
  <Button shape="round" type="submit" tabindex={1} color={submitColor} fullWidth {disabled} form={formId}>
71
75
  {submitText}
@@ -5,6 +5,8 @@ type Props = {
5
5
  icon?: string | boolean;
6
6
  submitText?: string;
7
7
  submitColor?: Color;
8
+ cancelText?: string;
9
+ cancelColor?: Color;
8
10
  disabled?: boolean;
9
11
  size?: ModalSize;
10
12
  preventDefault?: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@immich/ui",
3
- "version": "0.55.0",
3
+ "version": "0.56.1",
4
4
  "license": "GNU Affero General Public License version 3",
5
5
  "repository": {
6
6
  "type": "git",