@djcali570/component-lib 0.1.98 → 0.1.100

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.
package/README.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Svelte Component library
2
2
 
3
+ 0.1.100
4
+
5
+ - Removed padding from context menu content container.
6
+
7
+ 0.1.99
8
+
9
+ - Updated Context Menu to use an on open change callback. (Useful for multiple menus using same open state)
10
+
3
11
  0.1.98
4
12
 
5
13
  - Updated default colors for most components. Triggered by checkbox not that visible with
@@ -25,6 +25,7 @@
25
25
  ariaLabel = 'Open context menu',
26
26
  menuAlign = 'right',
27
27
  open = $bindable(),
28
+ onOpenChange,
28
29
  iconSize = '20px'
29
30
  }: {
30
31
  icon?: Snippet;
@@ -33,6 +34,7 @@
33
34
  ariaLabel?: string;
34
35
  menuAlign?: 'left' | 'right';
35
36
  open?: boolean;
37
+ onOpenChange?: (open: boolean) => void;
36
38
  iconSize?: string;
37
39
  } = $props();
38
40
 
@@ -75,9 +77,11 @@
75
77
 
76
78
  // Toggle menu
77
79
  function toggle() {
78
- open = !open;
80
+ const next = !open;
81
+ open = next;
82
+ onOpenChange?.(next); // 👈 notify parent
79
83
 
80
- if (open) {
84
+ if (next) {
81
85
  updatePosition();
82
86
  }
83
87
  }
@@ -85,6 +89,7 @@
85
89
  // Close menu
86
90
  function closeMenu() {
87
91
  open = false;
92
+ onOpenChange?.(false); // 👈 notify parent
88
93
  }
89
94
 
90
95
  // Click outside
@@ -230,8 +235,7 @@ top:{position.y}px;
230
235
 
231
236
  .context5__content {
232
237
  background-color: var(--context5__ContentBgColor);
233
- border-radius: 0.5rem;
234
- padding: 0.5rem;
238
+ border-radius: 0.5rem;
235
239
  border: 1px solid var(--context5__ContentBorderColor);
236
240
  }
237
241
  </style>
@@ -7,6 +7,7 @@ type $$ComponentProps = {
7
7
  ariaLabel?: string;
8
8
  menuAlign?: 'left' | 'right';
9
9
  open?: boolean;
10
+ onOpenChange?: (open: boolean) => void;
10
11
  iconSize?: string;
11
12
  };
12
13
  declare const ContextMenu5: import("svelte").Component<$$ComponentProps, {}, "open">;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@djcali570/component-lib",
3
- "version": "0.1.98",
3
+ "version": "0.1.100",
4
4
  "files": [
5
5
  "dist",
6
6
  "!dist/**/*.test.*",