@hashrytech/quick-components-kit 0.6.0 → 0.6.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.
package/CHANGELOG.md
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
ariaLabel?: string;
|
|
13
13
|
transitionDuration?: number;
|
|
14
14
|
transitionDistance?: number;
|
|
15
|
-
|
|
15
|
+
position?: "left" | "right" | "top" | "bottom";
|
|
16
16
|
overlayClasses?: string;
|
|
17
17
|
children?: Snippet;
|
|
18
18
|
class?: ClassNameValue;
|
|
@@ -21,11 +21,11 @@
|
|
|
21
21
|
</script>
|
|
22
22
|
|
|
23
23
|
<script lang="ts">
|
|
24
|
-
let {open=$bindable(false), escapeKeyClose=true, disableBodyScroll=true, ariaLabel="Drawer",
|
|
24
|
+
let {open=$bindable(false), escapeKeyClose=true, disableBodyScroll=true, ariaLabel="Drawer", position="left", transitionDuration=200, transitionDistance=240, overlayClasses="", children, ...props}: DrawerProps = $props();
|
|
25
25
|
|
|
26
26
|
const transitionProperties = {
|
|
27
|
-
x:
|
|
28
|
-
y:
|
|
27
|
+
x: position == "left" ? -transitionDistance : position == "right" ? transitionDistance : 0,
|
|
28
|
+
y: position == "top" ? -transitionDistance : position == "bottom" ? transitionDistance : 0,
|
|
29
29
|
duration: transitionDuration
|
|
30
30
|
};
|
|
31
31
|
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
<div transition:fade={{duration: transitionDuration}} class={twMerge("fixed inset-0 bg-overlay-primary", overlayClasses)} role="presentation" onclick={() => open = false}></div>
|
|
74
74
|
|
|
75
75
|
<div role="dialog" aria-modal="true" aria-label={ariaLabel} tabindex="{open ? 0 : -1}" aria-hidden="{!open}"
|
|
76
|
-
class={twMerge("fixed flex flex-col items-center gap-2 bg-white outline-0 focus:outline-0 active:outline-focus-primary focus:outline-focus-primary overflow-y-auto", postionClasses[
|
|
76
|
+
class={twMerge("fixed flex flex-col items-center gap-2 bg-white outline-0 focus:outline-0 active:outline-focus-primary focus:outline-focus-primary overflow-y-auto", postionClasses[position], props.class)}
|
|
77
77
|
in:fly={transitionProperties}
|
|
78
78
|
out:fly={transitionProperties}>
|
|
79
79
|
{@render children?.()}
|
|
@@ -7,7 +7,7 @@ export type DrawerProps = {
|
|
|
7
7
|
ariaLabel?: string;
|
|
8
8
|
transitionDuration?: number;
|
|
9
9
|
transitionDistance?: number;
|
|
10
|
-
|
|
10
|
+
position?: "left" | "right" | "top" | "bottom";
|
|
11
11
|
overlayClasses?: string;
|
|
12
12
|
children?: Snippet;
|
|
13
13
|
class?: ClassNameValue;
|