noph-ui 0.30.3 → 0.30.4

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/LICENSE.md ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Noph
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -2,8 +2,8 @@
2
2
  import Item from '../list/Item.svelte'
3
3
  import Menu from '../menu/Menu.svelte'
4
4
  import VirtualList from '../select/VirtualList.svelte'
5
- import type { AutoCompleteOption, AutoCompleteProps } from './types.ts'
6
5
  import TextField from '../text-field/TextField.svelte'
6
+ import type { AutoCompleteOption, AutoCompleteProps } from './types.ts'
7
7
 
8
8
  let {
9
9
  options = [],
@@ -38,7 +38,7 @@
38
38
  let clientWidth = $state(0)
39
39
  let menuElement = $state<HTMLDivElement>()
40
40
  let menuOpen = $state(false)
41
- let finalPopulated = $state(populated)
41
+ let finalPopulated = $derived(populated)
42
42
  let activeIndex = $state(NO_INDEX)
43
43
 
44
44
  const setActive = (index: number) => {
@@ -1,9 +1,9 @@
1
1
  <script lang="ts">
2
+ import CircularProgress from '../progress/CircularProgress.svelte'
2
3
  import Ripple from '../ripple/Ripple.svelte'
3
4
  import Tooltip from '../tooltip/Tooltip.svelte'
4
5
  import type { HTMLButtonAttributes, MouseEventHandler } from 'svelte/elements'
5
6
  import type { ButtonProps } from './types.ts'
6
- import CircularProgress from '../progress/CircularProgress.svelte'
7
7
 
8
8
  let {
9
9
  variant = 'outlined',
@@ -2,8 +2,8 @@
2
2
  import CircularProgress from '../progress/CircularProgress.svelte'
3
3
  import Ripple from '../ripple/Ripple.svelte'
4
4
  import Tooltip from '../tooltip/Tooltip.svelte'
5
- import type { IconButtonProps } from './types.ts'
6
5
  import type { HTMLButtonAttributes, MouseEventHandler } from 'svelte/elements'
6
+ import type { IconButtonProps } from './types.ts'
7
7
 
8
8
  let {
9
9
  variant = 'text',
@@ -19,7 +19,7 @@
19
19
  }: ItemProps = $props()
20
20
 
21
21
  let focused = $derived(softFocus)
22
- let visible = $state(!lazy)
22
+ let visible = $derived(!lazy)
23
23
  let element: HTMLButtonElement | HTMLAnchorElement | HTMLDivElement | undefined = $state()
24
24
  let observer: IntersectionObserver | undefined
25
25
  onMount(() => {
@@ -27,7 +27,7 @@
27
27
  ...attributes
28
28
  }: SelectProps = $props()
29
29
  const uid = $props.id()
30
- const selectId = id ?? `select-${uid}`
30
+ const selectId = $derived(id ?? `select-${uid}`)
31
31
 
32
32
  let animateLabel = $state(false)
33
33
  let errorText = $derived(issues?.map((issue) => issue.message).join(', '))
@@ -1,10 +1,10 @@
1
1
  <script lang="ts">
2
- import Menu from '../menu/Menu.svelte'
3
- import type { SelectOption, SelectProps } from './types.ts'
4
2
  import Item from '../list/Item.svelte'
5
- import { tick } from 'svelte'
3
+ import Menu from '../menu/Menu.svelte'
6
4
  import Check from './Check.svelte'
7
5
  import VirtualList from './VirtualList.svelte'
6
+ import { tick } from 'svelte'
7
+ import type { SelectOption, SelectProps } from './types.ts'
8
8
 
9
9
  let {
10
10
  options = [],
@@ -34,13 +34,15 @@
34
34
  }: SelectProps = $props()
35
35
 
36
36
  const uid = $props.id()
37
- if (value === undefined) {
38
- if (multiple) {
39
- value = options.filter((option) => option.selected).map((option) => option.value)
40
- } else {
41
- value = options.find((option) => option.selected)?.value
37
+ $effect(() => {
38
+ if (value === undefined) {
39
+ if (multiple) {
40
+ value = options.filter((option) => option.selected).map((option) => option.value)
41
+ } else {
42
+ value = options.find((option) => option.selected)?.value
43
+ }
42
44
  }
43
- }
45
+ })
44
46
 
45
47
  let valueArray = $derived<unknown[]>(
46
48
  Array.isArray(value) ? value : value === undefined || value === null ? [] : [value],
@@ -34,7 +34,7 @@
34
34
 
35
35
  let top = $state(0)
36
36
  let bottom = $state(0)
37
- let average_height: number = $state(itemHeight || 0)
37
+ let average_height: number = $derived(itemHeight || 0)
38
38
 
39
39
  $effect(() => {
40
40
  if (mounted) {
@@ -1,7 +1,7 @@
1
1
  <script lang="ts">
2
2
  import Divider from '../divider/Divider.svelte'
3
- import type { TabsContext, TabsProps } from './types.ts'
4
3
  import { setTabsContext } from './context.js'
4
+ import type { TabsContext, TabsProps } from './types.ts'
5
5
 
6
6
  let {
7
7
  children,
@@ -12,6 +12,8 @@
12
12
  }: TabsProps = $props()
13
13
 
14
14
  let uid = $props.id()
15
+
16
+ // svelte-ignore state_referenced_locally
15
17
  let tabsContext = $state<TabsContext>({
16
18
  value,
17
19
  variant,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "noph-ui",
3
- "version": "0.30.3",
3
+ "version": "0.30.4",
4
4
  "license": "MIT",
5
5
  "homepage": "https://noph.dev",
6
6
  "repository": {
@@ -56,25 +56,25 @@
56
56
  "devDependencies": {
57
57
  "@eslint/js": "^9.39.1",
58
58
  "@material/material-color-utilities": "^0.3.0",
59
- "@playwright/test": "^1.56.1",
59
+ "@playwright/test": "^1.57.0",
60
60
  "@sveltejs/adapter-auto": "^7.0.0",
61
- "@sveltejs/kit": "^2.48.4",
62
- "@sveltejs/package": "^2.5.4",
61
+ "@sveltejs/kit": "^2.49.1",
62
+ "@sveltejs/package": "^2.5.7",
63
63
  "@sveltejs/vite-plugin-svelte": "^6.2.1",
64
64
  "@types/eslint": "^9.6.1",
65
65
  "eslint": "^9.39.1",
66
66
  "eslint-config-prettier": "^10.1.8",
67
- "eslint-plugin-svelte": "^3.13.0",
67
+ "eslint-plugin-svelte": "^3.13.1",
68
68
  "globals": "^16.5.0",
69
- "prettier": "^3.6.2",
69
+ "prettier": "^3.7.4",
70
70
  "prettier-plugin-svelte": "^3.4.0",
71
71
  "publint": "^0.3.15",
72
- "svelte": "^5.43.3",
73
- "svelte-check": "^4.3.3",
72
+ "svelte": "^5.45.5",
73
+ "svelte-check": "^4.3.4",
74
74
  "typescript": "^5.9.3",
75
- "typescript-eslint": "^8.46.3",
76
- "vite": "^7.1.12",
77
- "vitest": "^4.0.6"
75
+ "typescript-eslint": "^8.48.1",
76
+ "vite": "^7.2.6",
77
+ "vitest": "^4.0.15"
78
78
  },
79
79
  "svelte": "./dist/index.js",
80
80
  "types": "./dist/index.d.ts",