@marianmeres/stuic 1.9.0 → 1.10.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.
@@ -6,6 +6,7 @@ import { prefersReducedMotionStore } from "../../utils/prefers-reduced-motion.js
6
6
  import { windowSize } from "../../utils/window-size.js";
7
7
  const clog = createClog("HoverExpandableWidth");
8
8
  const dispatch = createEventDispatcher();
9
+ export let enabled = true;
9
10
  export let shadowOpacity = 0.5;
10
11
  export let duration = 150;
11
12
  export let targetWidth = 256;
@@ -32,6 +33,8 @@ const _planDelayedExec = (_fn, _delay) => {
32
33
  }, _delay);
33
34
  };
34
35
  const _expand = () => {
36
+ if (!enabled)
37
+ return;
35
38
  if (_isExpanding || _isShrinking || _isExpanded)
36
39
  return;
37
40
  _isExpanded = true;
@@ -71,6 +74,8 @@ const _expand = () => {
71
74
  });
72
75
  };
73
76
  const _shrink = () => {
77
+ if (!enabled)
78
+ return;
74
79
  if (_isExpanding || _isShrinking || !_isExpanded)
75
80
  return;
76
81
  _isExpanded = false;
@@ -103,5 +108,10 @@ $:
103
108
  class={twMerge(`overflow-x-hidden overflow-y-auto ${_class}`)}
104
109
  style="width: 100%; height: 100%; transition-duration: {duration}ms;"
105
110
  >
106
- <slot isExpanded={_isExpanded} inTransition={_isExpanding || _isShrinking} />
111
+ <slot
112
+ isExpanded={_isExpanded}
113
+ isExpanding={_isExpanding}
114
+ isShrinking={_isShrinking}
115
+ inTransition={_isExpanding || _isShrinking}
116
+ />
107
117
  </div>
@@ -1,6 +1,7 @@
1
1
  import { SvelteComponent } from "svelte";
2
2
  declare const __propDef: {
3
3
  props: {
4
+ enabled?: boolean | undefined;
4
5
  shadowOpacity?: number | undefined;
5
6
  duration?: number | undefined;
6
7
  targetWidth?: number | undefined;
@@ -17,6 +18,8 @@ declare const __propDef: {
17
18
  slots: {
18
19
  default: {
19
20
  isExpanded: boolean;
21
+ isExpanding: boolean;
22
+ isShrinking: boolean;
20
23
  inTransition: boolean;
21
24
  };
22
25
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@marianmeres/stuic",
3
- "version": "1.9.0",
3
+ "version": "1.10.0",
4
4
  "scripts": {
5
5
  "dev": "vite dev",
6
6
  "build": "vite build && npm run package",