noph-ui 0.21.3 → 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.
@@ -94,6 +94,9 @@
94
94
  {:else if isLink(attributes)}
95
95
  <a
96
96
  {...attributes}
97
+ onclick={(event) => {
98
+ ;(onclick as MouseEventHandler<HTMLAnchorElement>)?.(event)
99
+ }}
97
100
  aria-describedby={title ? uid : attributes['aria-describedby']}
98
101
  aria-label={title || attributes['aria-label']}
99
102
  bind:this={element}
@@ -86,6 +86,9 @@
86
86
  {:else if isLink(attributes)}
87
87
  <a
88
88
  {...attributes}
89
+ onclick={(event) => {
90
+ ;(onclick as MouseEventHandler<HTMLAnchorElement>)?.(event)
91
+ }}
89
92
  aria-describedby={title ? uid : undefined}
90
93
  aria-label={title}
91
94
  bind:this={element}
@@ -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.3",
3
+ "version": "0.21.5",
4
4
  "license": "MIT",
5
5
  "homepage": "https://noph.dev",
6
6
  "repository": {