@marianmeres/stuic 1.5.0 → 1.7.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.
|
@@ -7,8 +7,8 @@ import { twMerge } from "tailwind-merge";
|
|
|
7
7
|
const clog = createClog("HoverExpandableWidth");
|
|
8
8
|
const dispatch = createEventDispatcher();
|
|
9
9
|
export let shadowOpacity = 0.5;
|
|
10
|
-
export let
|
|
11
|
-
export let targetWidth =
|
|
10
|
+
export let duration = 150;
|
|
11
|
+
export let targetWidth = 256;
|
|
12
12
|
let _class = "";
|
|
13
13
|
export { _class as class };
|
|
14
14
|
$:
|
|
@@ -49,7 +49,7 @@ const _expand = () => {
|
|
|
49
49
|
_isExpanding = false;
|
|
50
50
|
_maybeTodo();
|
|
51
51
|
},
|
|
52
|
-
|
|
52
|
+
duration + 1e3 / 60 * 3
|
|
53
53
|
// 3 x raf
|
|
54
54
|
);
|
|
55
55
|
requestAnimationFrame(() => {
|
|
@@ -82,7 +82,7 @@ const _shrink = () => {
|
|
|
82
82
|
_isShrinking = false;
|
|
83
83
|
el.style.transitionProperty = "none";
|
|
84
84
|
_maybeTodo();
|
|
85
|
-
},
|
|
85
|
+
}, duration);
|
|
86
86
|
};
|
|
87
87
|
$:
|
|
88
88
|
dispatch("change", _isExpanded);
|
|
@@ -96,7 +96,7 @@ $:
|
|
|
96
96
|
on:click
|
|
97
97
|
aria-expanded={_isExpanded}
|
|
98
98
|
class={twMerge(`${_class}`)}
|
|
99
|
-
style="width: 100%; height: 100%; transition-duration: {
|
|
99
|
+
style="width: 100%; height: 100%; transition-duration: {duration}ms;"
|
|
100
100
|
>
|
|
101
101
|
<slot isExpanded={_isExpanded} inTransition={_isExpanding || _isShrinking} />
|
|
102
102
|
</div>
|