noph-ui 0.8.1 → 0.8.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.
package/dist/index.d.ts CHANGED
@@ -10,6 +10,7 @@ export * from './navigation-rail/index.js';
10
10
  export * from './progress/index.js';
11
11
  export * from './radio/index.js';
12
12
  export * from './ripple/index.js';
13
+ export * from './select/index.js';
13
14
  export * from './snackbar/index.js';
14
15
  export * from './text-field/index.js';
15
16
  export * from './tooltip/index.js';
package/dist/index.js CHANGED
@@ -10,6 +10,7 @@ export * from './navigation-rail/index.js';
10
10
  export * from './progress/index.js';
11
11
  export * from './radio/index.js';
12
12
  export * from './ripple/index.js';
13
+ export * from './select/index.js';
13
14
  export * from './snackbar/index.js';
14
15
  export * from './text-field/index.js';
15
16
  export * from './tooltip/index.js';
@@ -1,7 +1,7 @@
1
1
  <script lang="ts">
2
2
  import Menu from '../menu/Menu.svelte'
3
3
  import { isFirstInvalidControlInForm } from '../text-field/report-validity.js'
4
- import { generateUUIDv4 } from '../utils.ts'
4
+ import { generateUUIDv4 } from '../utils.js'
5
5
  import type { SelectProps } from './types.ts'
6
6
  import Item from '../list/Item.svelte'
7
7
 
@@ -28,9 +28,9 @@
28
28
  let menuElement: HTMLDivElement | undefined = $state()
29
29
  let menuId = $state(`--select-${generateUUIDv4()}`)
30
30
  let menuOpen = $state(false)
31
- let selectedLabel = $derived<string>(
32
- options.find((option) => option.value === value)?.label || '',
33
- )
31
+ let selectedLabel = $derived.by<string>(() => {
32
+ return options.find((option) => option.value === value)?.label || ''
33
+ })
34
34
  let clientWidth = $state(0)
35
35
  $effect(() => {
36
36
  if (value !== '') {
@@ -139,12 +139,12 @@
139
139
  aria-label={label}
140
140
  {...attributes}
141
141
  onclick={(event) => {
142
- menuElement?.togglePopover(true)
143
142
  event.preventDefault()
143
+ menuElement?.showPopover()
144
144
  }}
145
145
  onkeydown={(event) => {
146
146
  if (event.key === 'Tab') {
147
- menuElement?.togglePopover(false)
147
+ menuElement?.hidePopover()
148
148
  } else {
149
149
  event.preventDefault()
150
150
  if (
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "noph-ui",
3
- "version": "0.8.1",
3
+ "version": "0.8.3",
4
4
  "license": "MIT",
5
5
  "homepage": "https://noph.dev",
6
6
  "repository": {