🏷️(react) move SelectProps to index.tsx

It makes more sense for this type to be next to the Select component.
This commit is contained in:
Nathan Vasse
2023-10-04 15:48:22 +02:00
committed by NathanVss
parent 1c7a114b6e
commit b5c91d429d
7 changed files with 33 additions and 37 deletions

View File

@@ -1,15 +1,9 @@
import React, {
forwardRef,
PropsWithChildren,
useEffect,
useState,
} from "react";
import React, { forwardRef, useEffect, useState } from "react";
import { UseSelectStateChange } from "downshift";
import { FieldProps } from ":/components/Forms/Field";
import { optionToValue, SubProps } from ":/components/Forms/Select/mono-common";
import { SelectMonoSearchable } from ":/components/Forms/Select/mono-searchable";
import { SelectMonoSimple } from ":/components/Forms/Select/mono-simple";
import { SelectHandle } from ":/components/Forms/Select/index";
import { SelectHandle, SelectProps } from ":/components/Forms/Select";
export interface Option {
value?: string;
@@ -17,26 +11,6 @@ export interface Option {
disabled?: boolean;
}
export type SelectProps = PropsWithChildren &
FieldProps & {
label: string;
hideLabel?: boolean;
options: Option[];
searchable?: boolean;
name?: string;
defaultValue?: string | number | string[];
value?: string | number | string[];
onChange?: (event: {
target: { value: string | number | undefined | string[] };
}) => void;
onBlur?: (event: {
target: { value: string | number | undefined | string[] };
}) => void;
disabled?: boolean;
clearable?: boolean;
multi?: boolean;
};
export const SelectMono = forwardRef<SelectHandle, SelectProps>(
(props, ref) => {
const defaultSelectedItem = props.defaultValue