noph-ui 0.9.4 → 0.9.6

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.
@@ -14,7 +14,6 @@
14
14
  let clientWidth = $state(0)
15
15
  let clientHeight = $state(0)
16
16
  let innerHeight = $state(0)
17
- let innerWidth = $state(0)
18
17
 
19
18
  showPopover = () => {
20
19
  element?.showPopover()
@@ -1,8 +1,14 @@
1
1
  <script lang="ts">
2
- import { generateUUIDv4 } from '../utils.ts'
2
+ import { generateUUIDv4 } from '../utils.js'
3
3
  import type { TooltipProps } from './types.ts'
4
4
 
5
- let { children, element = $bindable(), id, ...attributes }: TooltipProps = $props()
5
+ let {
6
+ children,
7
+ element = $bindable(),
8
+ id,
9
+ ignoreAnchorClick = false,
10
+ ...attributes
11
+ }: TooltipProps = $props()
6
12
  let clientWidth = $state(0)
7
13
  let clientHeight = $state(0)
8
14
  let innerHeight = $state(0)
@@ -48,9 +54,11 @@
48
54
  anchor.addEventListener('mouseleave', () => {
49
55
  element?.hidePopover()
50
56
  })
51
- anchor.addEventListener('click', () => {
52
- element?.hidePopover()
53
- })
57
+ if (!ignoreAnchorClick) {
58
+ anchor.addEventListener('mouseup', () => {
59
+ element?.hidePopover()
60
+ })
61
+ }
54
62
  }
55
63
  })
56
64
  </script>
@@ -1,4 +1,5 @@
1
1
  import type { HTMLAttributes } from 'svelte/elements';
2
2
  export interface TooltipProps extends Omit<HTMLAttributes<HTMLDivElement>, 'role'> {
3
+ ignoreAnchorClick?: boolean;
3
4
  element?: HTMLDivElement;
4
5
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "noph-ui",
3
- "version": "0.9.4",
3
+ "version": "0.9.6",
4
4
  "license": "MIT",
5
5
  "homepage": "https://noph.dev",
6
6
  "repository": {