UNPKG

@stratakit/react

Version:

A React component library for StrataKit

31 lines (30 loc) 1.5 kB
import * as React from "react"; import type { Select as IuiSelect } from "@itwin/itwinui-react"; import type { PolymorphicForwardRefComponent } from "./~utils.tsx"; type IuiSelectProps = React.ComponentProps<typeof IuiSelect>; type IuiNativeSelectProps = IuiSelectProps & { native: true; }; interface IuiNativeSelectTransformedProps extends Pick<IuiNativeSelectProps, "native" | "disabled" | "size" | "status" | "value" | "onChange" | "options" | "defaultValue" | "triggerProps" | "required" | "multiple" | "styleType" | "placeholder"> { /** NOT IMPLEMENTED */ size?: IuiNativeSelectProps["size"]; /** NOT IMPLEMENTED */ status?: IuiNativeSelectProps["status"]; /** NOT IMPLEMENTED */ styleType?: IuiNativeSelectProps["styleType"]; /** NOT IMPLEMENTED */ placeholder?: IuiNativeSelectProps["placeholder"]; } type SelectProps = Omit<IuiNativeSelectTransformedProps, "native"> & { /** NO-OP: Will always be in native mode. */ native?: boolean; } & Omit<React.ComponentPropsWithoutRef<"div">, "onChange" | "placeholder" | "value" | "defaultValue">; /** * @see https://itwinui.bentley.com/docs/Select * * **IMPORTANT**: Regardless of the `native` prop, the `Select` will always be in native mode. * Thus, all other props have to be updated, added, or removed to match native `Select`'s props. * E.g. `value` must be a string, no `multiple` support, etc. */ export declare const Select: PolymorphicForwardRefComponent<"div", SelectProps>; export {};