@marianmeres/stuic 1.3.0 → 1.5.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,7 +6,7 @@ import { windowSize } from "../../utils/window-size.js";
|
|
|
6
6
|
import { twMerge } from "tailwind-merge";
|
|
7
7
|
const clog = createClog("HoverExpandableWidth");
|
|
8
8
|
const dispatch = createEventDispatcher();
|
|
9
|
-
export let shadowOpacity = 0.
|
|
9
|
+
export let shadowOpacity = 0.5;
|
|
10
10
|
export let transitionDuration = 150;
|
|
11
11
|
export let targetWidth = 300;
|
|
12
12
|
let _class = "";
|
|
@@ -36,7 +36,7 @@ const _expand = () => {
|
|
|
36
36
|
left: box.left,
|
|
37
37
|
right: w.width - box.right
|
|
38
38
|
};
|
|
39
|
-
el.style.boxShadow = `
|
|
39
|
+
el.style.boxShadow = `16px 0 24px -16px rgb(0 0 0 / ${shadowOpacity})`;
|
|
40
40
|
el.style.zIndex = `1`;
|
|
41
41
|
el.style.top = `${pos.top}px`;
|
|
42
42
|
el.style.right = `${pos.right}px`;
|
|
@@ -11,4 +11,13 @@ export declare const windowSize: {
|
|
|
11
11
|
scale: number;
|
|
12
12
|
}> | undefined): import("svelte/store").Unsubscriber;
|
|
13
13
|
};
|
|
14
|
-
|
|
14
|
+
interface Breakpoint {
|
|
15
|
+
__current__: null | string;
|
|
16
|
+
sm: boolean;
|
|
17
|
+
md: boolean;
|
|
18
|
+
lg: boolean;
|
|
19
|
+
xl: boolean;
|
|
20
|
+
'2xl': boolean;
|
|
21
|
+
}
|
|
22
|
+
export declare const breakpoint: import("svelte/store").Readable<Breakpoint>;
|
|
23
|
+
export {};
|
|
@@ -17,7 +17,6 @@ windowSize.touch();
|
|
|
17
17
|
// intentionally not debounced
|
|
18
18
|
window?.visualViewport?.addEventListener('resize', windowSize.touch);
|
|
19
19
|
window?.visualViewport?.addEventListener('scroll', windowSize.touch);
|
|
20
|
-
// https://tailwindcss.com/docs/responsive-design
|
|
21
20
|
export const breakpoint = derived([windowSize], ([{ width: w }]) => {
|
|
22
21
|
const list = [
|
|
23
22
|
['sm', 640],
|
|
@@ -26,5 +25,10 @@ export const breakpoint = derived([windowSize], ([{ width: w }]) => {
|
|
|
26
25
|
['xl', 1280],
|
|
27
26
|
['2xl', 1536],
|
|
28
27
|
];
|
|
29
|
-
return list.reduce((m, [k, v]) => (w && w >= v ? k : m), null);
|
|
28
|
+
// return list.reduce<string | null>((m, [k, v]) => (w && w >= v ? k : m), null);
|
|
29
|
+
return list.reduce((m, [k, v]) => {
|
|
30
|
+
const flag = w && w >= v;
|
|
31
|
+
m = { ...m, [k]: flag, __current__: flag ? k : m.__current__ };
|
|
32
|
+
return m;
|
|
33
|
+
}, { __current__: null, sm: false, md: false, lg: false, xl: false, '2xl': false });
|
|
30
34
|
});
|