Skip to content

Commit 9ae9567

Browse files
committed
fix: type updates
1 parent 45e24eb commit 9ae9567

File tree

60 files changed

+239
-494
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+239
-494
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@
7070
"publint": "^0.2.11",
7171
"runatics": "^0.1.3",
7272
"runes-meta-tags": "^0.3.2",
73-
"svelte": "5.0.0-next.250",
74-
"svelte-check": "^3.8.6",
73+
"svelte": "5.0.0-next.257",
74+
"svelte-check": "^4.0.2",
7575
"svelte-lib-helpers": "^0.4.8",
7676
"svelte-rune-highlight": "^0.5.11",
7777
"tailwindcss": "^3.4.12",

pnpm-lock.yaml

Lines changed: 167 additions & 424 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/lib/forms/fileupload/Fileupload.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<script lang="ts">
22
import { type FileuploadProps as Props, fileupload } from '.';
33
4-
let { files = $bindable(), size = 'md', class: className, ...restProps }: Props = $props();
4+
let { files = $bindable<FileList | undefined>(), size = 'md', class: className, ...restProps }: Props<unknown> = $props();
55
const base = $derived(fileupload({ size, class: className }));
66
</script>
77

src/lib/forms/fileupload/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ import type { HTMLInputAttributes } from 'svelte/elements';
33
import type { InputProps } from '$lib';
44
import { fileupload } from './theme';
55

6-
interface FileuploadProps extends Omit<HTMLInputAttributes, 'size'> {
6+
interface FileuploadProps<T> extends Omit<HTMLInputAttributes, 'size'> {
77
files?: FileList;
8-
size?: InputProps['size'];
9-
color?: InputProps['color'];
8+
size?: InputProps<never>['size'];
9+
color?: InputProps<never>['color'];
1010
}
1111

1212
export { Fileupload, fileupload, type FileuploadProps };

src/lib/forms/input/Input.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import { getContext } from 'svelte';
44
import { type InputProps as Props, input, clampSize } from '.';
55
6-
let { children, left, right, value = $bindable(), size, color = 'default', class: className, classLeft, classRight, ...restProps }: Props = $props();
6+
let { children, left, right, value = $bindable<unknown>(), size, color = 'default', class: className, classLeft, classRight, ...restProps }: Props<unknown> = $props();
77
88
// tinted if put in component having its own background
99
let background: boolean = getContext('background');

src/lib/forms/input/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ import type { FormSizeType, ColorName, SizeType } from '$lib/types';
44
import type { Snippet } from 'svelte';
55
import { input } from './theme';
66

7-
interface InputProps extends Omit<HTMLInputAttributes, 'size'> {
7+
interface InputProps<T = string> extends Omit<HTMLInputAttributes, 'size'> {
88
children?: Snippet;
99
left?: Snippet;
1010
right?: Snippet;
1111
size?: FormSizeType;
12-
value?: string | number | readonly string[] | undefined;
12+
value?: T;
1313
color?: ColorName | 'default' | 'tinted';
1414
classLeft?: string;
1515
classRight?: string;

src/lib/forms/radio-button/RadioButton.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import Button from '$lib/buttons/Button.svelte';
33
import { type RadioButtonProps as Props, radioButton } from '.';
44
5-
let { children, group = $bindable(), value, inline = true, pill, outline, buttonSize, color, shadow, class: className, ...restProps }: Props = $props();
5+
let { children, group = $bindable<unknown>(), value, inline = true, pill, outline, buttonSize, color, shadow, class: className, ...restProps }: Props<unknown> = $props();
66
77
const base = $derived(radioButton({ inline, className }));
88

src/lib/forms/radio-button/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ import type { SizeType, ColorName } from '$lib/types';
44
import type { HTMLInputAttributes } from 'svelte/elements';
55
import { radioButton } from './theme';
66

7-
interface RadioButtonProps extends HTMLInputAttributes {
7+
interface RadioButtonProps<T> extends HTMLInputAttributes {
88
children: Snippet;
9-
group?: string | number;
10-
value?: string | number;
9+
group?: T;
10+
value?: T;
1111
inline?: boolean;
1212
pill?: boolean;
1313
outline?: boolean;

src/lib/forms/radio/Radio.svelte

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
import Label from '../label/Label.svelte';
44
import { type RadioProps as Props, radio } from '.';
55
6-
let { children, aria_describedby, labelClass, color = 'primary', group = $bindable(), value = $bindable(), inputClass, ...restProps }: Props = $props();
6+
let { children, aria_describedby, labelClass, color = 'primary', group = $bindable<unknown>(), value = $bindable<unknown>(), inputClass, ...restProps }: Props<unknown> = $props();
7+
78
const { input, label } = $derived(radio({ color, tinted: !!getContext('background') }));
89
</script>
910

src/lib/forms/radio/index.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,12 @@ import type { VariantProps } from 'tailwind-variants';
55
import { radio } from './theme';
66

77
type ColorType = VariantProps<typeof radio>['color'];
8-
interface RadioProps extends HTMLInputAttributes {
8+
interface RadioProps<T> extends HTMLInputAttributes {
99
children: Snippet;
1010
aria_describedby?: string;
1111
color?: ColorType;
12-
group?: number | string | undefined;
12+
group?: T;
13+
value?: T;
1314
inputClass?: string;
1415
labelClass?: string;
1516
}

0 commit comments

Comments
 (0)