Skip to content

Commit f48d851

Browse files
feat: upgrade TypeScript to 6.0.1-rc
Update TypeScript from 5.9.3 to 6.0.1-rc with type fixes for combobox components. Extracted ComboboxProps type alias for better type safety and added module declarations for CSS and fonts. Co-authored-by: Claude <noreply@anthropic.com>
1 parent fd1afaa commit f48d851

7 files changed

Lines changed: 193 additions & 129 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@
152152
"resize-observer-polyfill": "1.5.1",
153153
"storybook": "10.2.14",
154154
"ts-plugin-sort-import-suggestions": "1.0.4",
155-
"typescript": "5.9.3",
155+
"typescript": "6.0.1-rc",
156156
"vite": "7.3.1",
157157
"vite-tsconfig-paths": "6.0.5",
158158
"vitest": "4.0.18",

pnpm-lock.yaml

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

src/components/form/field-combobox-multiple/index.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import {
2121
ComboboxEmpty,
2222
ComboboxItem,
2323
ComboboxList,
24+
type ComboboxProps,
2425
ComboboxValue,
2526
useComboboxAnchor,
2627
} from '@/components/ui/combobox';
@@ -37,7 +38,7 @@ export const FieldComboboxMultiple = <TItem extends Item>(
3738
containerProps?: ComponentProps<typeof FormFieldContainer>;
3839
inputProps?: ComponentProps<typeof ComboboxChipsInput>;
3940
} & Omit<
40-
ComponentProps<typeof Combobox>,
41+
ComboboxProps<TItem, true>,
4142
'items' | 'value' | 'multiple' | 'defaultValue' | 'children'
4243
> & {
4344
items: TItem[];

src/components/form/field-combobox/index.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import {
1313
ComboboxInput,
1414
ComboboxItem,
1515
ComboboxList,
16+
type ComboboxProps,
1617
} from '@/components/ui/combobox';
1718

1819
type Item = {
@@ -27,7 +28,7 @@ export const FieldCombobox = <TItem extends Item>(
2728
containerProps?: ComponentProps<typeof FormFieldContainer>;
2829
inputProps?: ComponentProps<typeof ComboboxInput>;
2930
} & Omit<
30-
ComponentProps<typeof Combobox>,
31+
ComboboxProps<TItem>,
3132
'items' | 'value' | 'multiple' | 'children'
3233
> & {
3334
items: TItem[];
@@ -66,7 +67,7 @@ export const FieldCombobox = <TItem extends Item>(
6667
}
6768
itemToStringLabel={(item: TItem) => item.label?.toString() ?? ''}
6869
itemToStringValue={(item: TItem) => item.value}
69-
onValueChange={(item: TItem, event) => {
70+
onValueChange={(item: TItem | null, event) => {
7071
field.onChange(item?.value ?? null, event);
7172
rest.onValueChange?.(item?.value ?? null, event);
7273
}}

src/components/ui/combobox.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,13 @@ import {
1414
InputGroupInput,
1515
} from '@/components/ui/input-group';
1616

17+
type ComboboxProps<
18+
Value = unknown,
19+
Multiple extends boolean | undefined = false,
20+
> = ComboboxPrimitive.Root.Props<Value, Multiple>;
21+
1722
function Combobox<Value, Multiple extends boolean | undefined = false>(
18-
props: ComboboxPrimitive.Root.Props<Value, Multiple>
23+
props: ComboboxProps<Value, Multiple>
1924
): React.JSX.Element {
2025
return <ComboboxPrimitive.Root autoHighlight {...props} />;
2126
}
@@ -334,6 +339,7 @@ export {
334339
ComboboxItem,
335340
ComboboxLabel,
336341
ComboboxList,
342+
type ComboboxProps,
337343
ComboboxSeparator,
338344
ComboboxTrigger,
339345
ComboboxValue,

src/global.d.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// ./src/globals.d.ts
2+
declare module '*.css';
3+
declare module '@fontsource/*' {}
4+
declare module '@fontsource-variable/*' {}

tsconfig.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
"strictNullChecks": true,
99
"noUncheckedIndexedAccess": true,
1010
"noImplicitAny": true,
11-
"baseUrl": ".",
1211
"paths": {
13-
"@/*": ["./src/*"]
12+
"@/*": ["./src/*"],
13+
"e2e/*": ["./e2e/*"]
1414
},
1515
"typeRoots": ["node_modules/@types", "src/types"],
1616
"plugins": [

0 commit comments

Comments
 (0)