@dryui/ui 1.7.2 → 1.7.3
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.
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import type { Snippet } from 'svelte';
|
|
3
3
|
import type { HTMLAttributes } from 'svelte/elements';
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
createDismiss,
|
|
6
|
+
createMenuNavigation,
|
|
7
|
+
tryShowPopover,
|
|
8
|
+
tryHidePopover
|
|
9
|
+
} from '@dryui/primitives';
|
|
5
10
|
import { getContextMenuCtx } from './context.svelte.js';
|
|
6
11
|
|
|
7
12
|
interface Props extends HTMLAttributes<HTMLDivElement> {
|
|
@@ -34,12 +39,11 @@
|
|
|
34
39
|
node.style.position = 'fixed';
|
|
35
40
|
node.style.left = `${ctx.position.x}px`;
|
|
36
41
|
node.style.top = `${ctx.position.y}px`;
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
node.hidePopover();
|
|
42
|
+
const wasOpen = node.matches(':popover-open');
|
|
43
|
+
tryShowPopover(node);
|
|
44
|
+
if (!wasOpen) menu.focusFirst();
|
|
45
|
+
} else {
|
|
46
|
+
tryHidePopover(node);
|
|
43
47
|
}
|
|
44
48
|
}
|
|
45
49
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import type { Snippet } from 'svelte';
|
|
3
3
|
import type { HTMLAttributes } from 'svelte/elements';
|
|
4
|
-
import { toastStore } from '@dryui/primitives';
|
|
4
|
+
import { toastStore, tryShowPopover, tryHidePopover } from '@dryui/primitives';
|
|
5
5
|
import ToastRoot from './toast-root.svelte';
|
|
6
6
|
import ToastTitle from './toast-title.svelte';
|
|
7
7
|
import ToastDescription from './toast-description.svelte';
|
|
@@ -25,19 +25,8 @@
|
|
|
25
25
|
|
|
26
26
|
$effect(() => {
|
|
27
27
|
if (!panelEl) return;
|
|
28
|
-
if (visible)
|
|
29
|
-
|
|
30
|
-
if (!panelEl.matches(':popover-open')) panelEl.showPopover();
|
|
31
|
-
} catch {
|
|
32
|
-
// already open
|
|
33
|
-
}
|
|
34
|
-
} else {
|
|
35
|
-
try {
|
|
36
|
-
if (panelEl.matches(':popover-open')) panelEl.hidePopover();
|
|
37
|
-
} catch {
|
|
38
|
-
// already closed
|
|
39
|
-
}
|
|
40
|
-
}
|
|
28
|
+
if (visible) tryShowPopover(panelEl);
|
|
29
|
+
else tryHidePopover(panelEl);
|
|
41
30
|
});
|
|
42
31
|
</script>
|
|
43
32
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dryui/ui",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.3",
|
|
4
4
|
"description": "Zero-dependency styled Svelte 5 components with scoped styles and --dry-* CSS variable theming.",
|
|
5
5
|
"author": "Rob Balfre",
|
|
6
6
|
"license": "MIT",
|
|
@@ -784,7 +784,7 @@
|
|
|
784
784
|
"postpack": "bun ../../scripts/postpack-exports.ts"
|
|
785
785
|
},
|
|
786
786
|
"dependencies": {
|
|
787
|
-
"@dryui/primitives": "^1.7.
|
|
787
|
+
"@dryui/primitives": "^1.7.3"
|
|
788
788
|
},
|
|
789
789
|
"peerDependencies": {
|
|
790
790
|
"svelte": "^5.55.1"
|