@marianmeres/stuic 1.96.0 → 1.97.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.
|
@@ -45,7 +45,7 @@ $:
|
|
|
45
45
|
on:keydown={(e) => e.code === 'Escape' && dispatch('escape')}
|
|
46
46
|
in:fade={{ duration: fadeInDuration }}
|
|
47
47
|
out:fade={{ duration: fadeOutDuration }}
|
|
48
|
-
use:focusTrap={{
|
|
48
|
+
use:focusTrap={{ enabled: useFocusTrap, ...(focusTrapOptions || {}) }}
|
|
49
49
|
role="presentation"
|
|
50
50
|
tabindex="-1"
|
|
51
51
|
>
|
|
@@ -25,6 +25,7 @@ export let describedby = "";
|
|
|
25
25
|
export let transitionDuration = 250;
|
|
26
26
|
export let transitionEnabled = !$prefersReducedMotionStore;
|
|
27
27
|
export let animOffset = "66vw";
|
|
28
|
+
export let backdropFocusTrapOptions = {};
|
|
28
29
|
$:
|
|
29
30
|
fadeInDuration = transitionEnabled ? Math.min(transitionDuration * 0.66, 200) : 0;
|
|
30
31
|
const _presetsClsBackdrop = {
|
|
@@ -60,6 +61,7 @@ $:
|
|
|
60
61
|
{fadeInDuration}
|
|
61
62
|
fadeOutDuration={transitionEnabled ? transitionDuration : 0}
|
|
62
63
|
on:element
|
|
64
|
+
focusTrapOptions={backdropFocusTrapOptions}
|
|
63
65
|
>
|
|
64
66
|
<!--
|
|
65
67
|
svelte-ignore
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { SvelteComponent } from "svelte";
|
|
2
|
+
import type { FocusTrapOptions } from '../../actions/focus-trap.js';
|
|
2
3
|
export type DrawerStore = ReturnType<typeof createDrawerStore>;
|
|
3
4
|
export declare const createDrawerStore: (open?: boolean) => import("@marianmeres/switch-store").SwitchStore<any>;
|
|
4
5
|
declare const __propDef: {
|
|
@@ -12,6 +13,7 @@ declare const __propDef: {
|
|
|
12
13
|
transitionDuration?: number | undefined;
|
|
13
14
|
transitionEnabled?: boolean | undefined;
|
|
14
15
|
animOffset?: string | number | undefined;
|
|
16
|
+
backdropFocusTrapOptions?: Partial<FocusTrapOptions> | undefined;
|
|
15
17
|
};
|
|
16
18
|
events: {
|
|
17
19
|
escape: CustomEvent<any>;
|