noph-ui 0.21.4 → 0.21.5

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.
@@ -18,7 +18,7 @@
18
18
 
19
19
  let focused = $state(false)
20
20
  let visible = $state(false)
21
- let element: HTMLButtonElement | HTMLAnchorElement | undefined = $state()
21
+ let element: HTMLButtonElement | HTMLAnchorElement | HTMLDivElement | undefined = $state()
22
22
  onMount(() => {
23
23
  const observer = new IntersectionObserver((entries) => {
24
24
  entries.forEach((entry) => {
@@ -35,6 +35,7 @@
35
35
 
36
36
  return () => observer.disconnect()
37
37
  })
38
+ $inspect(visible)
38
39
  </script>
39
40
 
40
41
  {#snippet content()}
@@ -64,8 +65,10 @@
64
65
  {/snippet}
65
66
 
66
67
  {#if disabled}
67
- <div aria-disabled="true" class={['np-item disabled', attributes.class]}>
68
- {@render content()}
68
+ <div bind:this={element} aria-disabled="true" class={['np-item disabled', attributes.class]}>
69
+ {#if visible}
70
+ {@render content()}
71
+ {/if}
69
72
  </div>
70
73
  {:else if attributes.variant === 'text' || attributes.variant === undefined}
71
74
  <div {...attributes} class={['np-item', selected && 'selected', attributes.class]}>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "noph-ui",
3
- "version": "0.21.4",
3
+ "version": "0.21.5",
4
4
  "license": "MIT",
5
5
  "homepage": "https://noph.dev",
6
6
  "repository": {