@marianmeres/stuic 1.37.0 → 1.38.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.
@@ -98,7 +98,7 @@ $:
98
98
  <header
99
99
  bind:this={header}
100
100
  data-shell="header"
101
- class={twMerge(`flex-none z-10 ${headerClass}`)}
101
+ class={twMerge(`flex-none ${headerClass}`)}
102
102
  >
103
103
  <slot name="header" />
104
104
  </header>
@@ -2,9 +2,9 @@
2
2
  import { createEventDispatcher } from "svelte";
3
3
  import { get } from "svelte/store";
4
4
  import { twMerge } from "tailwind-merge";
5
+ import { DevicePointer } from "../../index.js";
5
6
  import { prefersReducedMotionStore } from "../../utils/prefers-reduced-motion.js";
6
7
  import { windowSize } from "../../utils/window-size.js";
7
- import { DevicePointer } from "../../index.js";
8
8
  const clog = createClog("HoverExpandableWidth");
9
9
  const dispatch = createEventDispatcher();
10
10
  export let enabled = DevicePointer.isFine;
@@ -15,8 +15,7 @@ export let delayIn = 400;
15
15
  export let delayOut = 100;
16
16
  let _class = "";
17
17
  export { _class as class };
18
- $:
19
- _isExpanded = false;
18
+ let _isExpanded = false;
20
19
  let _isShrinking = false;
21
20
  let _isExpanding = false;
22
21
  let el;
@@ -33,6 +32,7 @@ const _planDelayedExec = (_fn, _delay) => {
33
32
  _resetDelayTimer();
34
33
  }, _delay);
35
34
  };
35
+ let box;
36
36
  const _expand = () => {
37
37
  if (!enabled)
38
38
  return;
@@ -40,22 +40,22 @@ const _expand = () => {
40
40
  return;
41
41
  _isExpanded = true;
42
42
  _isExpanding = true;
43
- const box = el.getBoundingClientRect();
44
- const w = get(windowSize);
43
+ box = el.getBoundingClientRect();
44
+ const win = get(windowSize);
45
45
  const pos = {
46
46
  top: box.top,
47
- bottom: w.height - box.bottom,
47
+ bottom: win.height - box.bottom,
48
48
  left: box.left,
49
- right: w.width - box.right
49
+ right: win.width - box.right
50
50
  };
51
51
  el.style.boxShadow = `16px 0 24px -16px rgb(0 0 0 / ${shadowOpacity})`;
52
- el.style.zIndex = `1`;
53
52
  el.style.top = `${pos.top}px`;
54
53
  el.style.right = `${pos.right}px`;
55
54
  el.style.bottom = `${pos.bottom}px`;
56
55
  el.style.left = `${pos.left}px`;
57
56
  el.style.width = "auto";
58
57
  el.style.height = "auto";
58
+ el.style.zIndex = "1";
59
59
  setTimeout(
60
60
  () => _isExpanding = false,
61
61
  duration + 1e3 / 60 * 3
@@ -79,17 +79,18 @@ const _shrink = () => {
79
79
  return;
80
80
  _isExpanded = false;
81
81
  _isShrinking = true;
82
- el.style.position = `static`;
83
- el.style.zIndex = `auto`;
84
- el.style.top = "auto";
85
- el.style.right = "auto";
86
- el.style.bottom = "auto";
87
- el.style.left = "auto";
88
- el.style.width = "100%";
89
- el.style.height = "100%";
90
82
  el.style.boxShadow = "none";
83
+ el.style.width = `${box.width}px`;
91
84
  setTimeout(() => {
92
85
  _isShrinking = false;
86
+ el.style.position = `static`;
87
+ el.style.top = "auto";
88
+ el.style.right = "auto";
89
+ el.style.bottom = "auto";
90
+ el.style.left = "auto";
91
+ el.style.width = "100%";
92
+ el.style.height = "100%";
93
+ el.style.zIndex = "0";
93
94
  el.style.transitionProperty = "none";
94
95
  }, duration);
95
96
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@marianmeres/stuic",
3
- "version": "1.37.0",
3
+ "version": "1.38.0",
4
4
  "scripts": {
5
5
  "dev": "vite dev",
6
6
  "build": "vite build && npm run package && node ./scripts/date.js",