Export SelectProperties type.
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
ci/woodpecker/tag/woodpecker Pipeline was successful

This commit is contained in:
Madeorsk 2024-09-24 19:54:18 +02:00
parent 72a3b9b9d2
commit 23d0ab147b
Signed by: Madeorsk
GPG key ID: 677E51CA765BB79F

View file

@ -5,22 +5,9 @@ import {classes, Modify, normalizeString} from "../../Utils";
import {CaretDown, Check, X} from "@phosphor-icons/react"; import {CaretDown, Check, X} from "@phosphor-icons/react";
/** /**
* Generic select component. * Generic select component properties.
*/ */
export function Select<OptionKey extends keyof any, Option>( export type SelectProperties<OptionKey extends keyof any, Option> = React.PropsWithChildren<Modify<React.InputHTMLAttributes<HTMLInputElement>, {
{
className,
value, onChange,
options, renderOption, match,
selectibleMaxCount, multiple,
blurOnSelect, blurWhenMaxCountSelected,
// Properties to pass down.
onKeyDown,
// Already set properties.
type, role,
children,
...props
}: React.PropsWithChildren<Modify<React.InputHTMLAttributes<HTMLInputElement>, {
/** /**
* The currently selected option(s). * The currently selected option(s).
*/ */
@ -77,7 +64,25 @@ export function Select<OptionKey extends keyof any, Option>(
// Already set properties. // Already set properties.
type?: never; type?: never;
role?: never; role?: never;
}>>): React.ReactElement }>>;
/**
* Generic select component.
*/
export function Select<OptionKey extends keyof any, Option>(
{
className,
value, onChange,
options, renderOption, match,
selectibleMaxCount, multiple,
blurOnSelect, blurWhenMaxCountSelected,
// Properties to pass down.
onKeyDown,
// Already set properties.
type, role,
children,
...props
}: SelectProperties<OptionKey, Option>): React.ReactElement
{ {
const [search, setSearch] = React.useState(""); const [search, setSearch] = React.useState("");