@dryui/ui 1.7.1 → 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.
@@ -77,7 +77,7 @@
77
77
  --dry-alert-border: var(--dry-color-stroke-info);
78
78
  --dry-alert-icon-color: var(--dry-color-fill-info);
79
79
  --dry-radius-nested: max(
80
- 0px,
80
+ var(--dry-radius-sm),
81
81
  calc(
82
82
  var(--dry-alert-radius, var(--dry-surface-radius, var(--dry-radius-lg))) -
83
83
  var(--dry-alert-padding, var(--dry-space-6))
@@ -66,7 +66,7 @@
66
66
  [data-card] {
67
67
  --dry-card-radius: var(--dry-radius-2xl);
68
68
  --dry-radius-nested: max(
69
- 0px,
69
+ var(--dry-radius-sm),
70
70
  calc(var(--dry-card-radius) - var(--dry-card-padding, var(--dry-space-8)))
71
71
  );
72
72
  --dry-btn-radius: var(--dry-radius-nested);
@@ -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 { createDismiss, createMenuNavigation } from '@dryui/primitives';
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
- if (!node.matches(':popover-open')) {
38
- node.showPopover();
39
- menu.focusFirst();
40
- }
41
- } else if (node.matches(':popover-open')) {
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
 
@@ -93,7 +93,7 @@
93
93
  grid-template-columns: minmax(12rem, auto);
94
94
  padding: var(--dry-menu-padding, var(--dry-space-2));
95
95
  --dry-radius-nested: max(
96
- 0px,
96
+ var(--dry-radius-sm),
97
97
  calc(
98
98
  var(--dry-menu-radius, var(--dry-radius-lg)) - var(--dry-menu-padding, var(--dry-space-2))
99
99
  )
@@ -126,7 +126,7 @@
126
126
  --dry-dialog-border: var(--dry-overlay-border, var(--dry-color-stroke-weak));
127
127
  --dry-dialog-padding: var(--dry-space-8);
128
128
  --dry-radius-nested: max(
129
- 0px,
129
+ var(--dry-radius-sm),
130
130
  calc(
131
131
  var(--dry-dialog-radius, var(--dry-overlay-radius, var(--dry-radius-2xl))) -
132
132
  var(--dry-dialog-padding)
@@ -195,7 +195,10 @@
195
195
  --dry-dialog-shadow: var(--dry-shadow-overlay);
196
196
  --dry-dialog-padding: var(--dry-space-6);
197
197
  --dry-dialog-max-width: 32rem;
198
- --dry-radius-nested: max(0px, calc(var(--dry-dialog-radius) - var(--dry-dialog-padding)));
198
+ --dry-radius-nested: max(
199
+ var(--dry-radius-sm),
200
+ calc(var(--dry-dialog-radius) - var(--dry-dialog-padding))
201
+ );
199
202
  --dry-btn-radius: var(--dry-radius-nested);
200
203
 
201
204
  container-type: inline-size;
@@ -100,6 +100,8 @@
100
100
  --dry-btn-accent-weak: var(--dry-list-item-hover-bg);
101
101
  --dry-btn-on-accent: inherit;
102
102
  --dry-btn-radius: var(--dry-list-item-radius);
103
+ --dry-btn-justify: stretch;
104
+ --dry-btn-align: stretch;
103
105
  box-shadow: none;
104
106
  cursor: pointer;
105
107
  }
@@ -60,7 +60,10 @@
60
60
  --dry-popover-radius: var(--dry-overlay-radius, var(--dry-radius-lg));
61
61
  --dry-popover-shadow: var(--dry-overlay-shadow, var(--dry-shadow-lg));
62
62
  --dry-popover-padding: var(--dry-space-4);
63
- --dry-radius-nested: max(0px, calc(var(--dry-popover-radius) - var(--dry-popover-padding)));
63
+ --dry-radius-nested: max(
64
+ var(--dry-radius-sm),
65
+ calc(var(--dry-popover-radius) - var(--dry-popover-padding))
66
+ );
64
67
  --dry-btn-radius: var(--dry-radius-nested);
65
68
 
66
69
  inset: unset;
@@ -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
- try {
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
 
@@ -59,7 +59,7 @@
59
59
  <style>
60
60
  [data-part='root'] {
61
61
  --dry-toast-accent: var(--dry-color-fill-info);
62
- --dry-radius-nested: max(0px, calc(var(--dry-radius-lg) - var(--dry-space-4)));
62
+ --dry-radius-nested: max(var(--dry-radius-sm), calc(var(--dry-radius-lg) - var(--dry-space-4)));
63
63
  --dry-btn-radius: var(--dry-radius-nested);
64
64
 
65
65
  position: relative;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dryui/ui",
3
- "version": "1.7.1",
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.1"
787
+ "@dryui/primitives": "^1.7.3"
788
788
  },
789
789
  "peerDependencies": {
790
790
  "svelte": "^5.55.1"