@immich/ui 0.62.2 → 0.63.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.
@@ -20,6 +20,7 @@
20
20
  size?: ModalSize;
21
21
  preventDefault?: boolean;
22
22
  onClose: () => void;
23
+ onOpenAutoFocus?: (event: Event) => void;
23
24
  onReset?: (event: Event) => void;
24
25
  onSubmit: (event: SubmitEvent) => void;
25
26
  children: Snippet<[{ formId: string }]>;
@@ -36,6 +37,7 @@
36
37
  size = 'small',
37
38
  preventDefault = true,
38
39
  onClose = () => {},
40
+ onOpenAutoFocus,
39
41
  onReset,
40
42
  onSubmit,
41
43
  children,
@@ -60,7 +62,7 @@
60
62
  const formId = generateId();
61
63
  </script>
62
64
 
63
- <Modal {title} {onClose} {size} {icon}>
65
+ <Modal {title} {onClose} {size} {icon} {onOpenAutoFocus}>
64
66
  <ModalBody>
65
67
  <form {onsubmit} {onreset} id={formId}>
66
68
  {@render children({ formId })}
@@ -11,6 +11,7 @@ type Props = {
11
11
  size?: ModalSize;
12
12
  preventDefault?: boolean;
13
13
  onClose: () => void;
14
+ onOpenAutoFocus?: (event: Event) => void;
14
15
  onReset?: (event: Event) => void;
15
16
  onSubmit: (event: SubmitEvent) => void;
16
17
  children: Snippet<[{
@@ -28,6 +28,7 @@
28
28
  children: Snippet;
29
29
  onClose?: () => void;
30
30
  onEscapeKeydown?: (event: KeyboardEvent) => void;
31
+ onOpenAutoFocus?: (event: Event) => void;
31
32
  };
32
33
 
33
34
  let {
@@ -40,6 +41,7 @@
40
41
  closeOnEsc = true,
41
42
  closeOnBackdropClick = false,
42
43
  children,
44
+ onOpenAutoFocus,
43
45
  }: Props = $props();
44
46
 
45
47
  const modalStyles = tv({
@@ -105,6 +107,7 @@
105
107
  <Dialog.Portal>
106
108
  <Dialog.Overlay class="{zIndex.ModalBackdrop} fixed start-0 top-0 flex h-dvh max-h-dvh w-screen bg-black/30" />
107
109
  <Dialog.Content
110
+ {onOpenAutoFocus}
108
111
  onEscapeKeydown={handleEscapeKeydown}
109
112
  {escapeKeydownBehavior}
110
113
  {interactOutsideBehavior}
@@ -11,6 +11,7 @@ type Props = {
11
11
  children: Snippet;
12
12
  onClose?: () => void;
13
13
  onEscapeKeydown?: (event: KeyboardEvent) => void;
14
+ onOpenAutoFocus?: (event: Event) => void;
14
15
  };
15
16
  declare const Modal: import("svelte").Component<Props, {}, "">;
16
17
  type Modal = ReturnType<typeof Modal>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@immich/ui",
3
- "version": "0.62.2",
3
+ "version": "0.63.0",
4
4
  "license": "GNU Affero General Public License version 3",
5
5
  "repository": {
6
6
  "type": "git",