import { CSSProperties } from 'react'; import { StylesConfig } from 'react-select'; import { User } from '@zeniai/client-epic-state'; import { TextStyle } from '../../../designSystem/zeniConstants'; export interface PickerStyles { backgroundColor: string; optionBackgroundColor: string; optionTextStyle: TextStyle; selectedOptionBackgroundColor: string; selectedOptionColor: string; titleTextAlignment: "flex-start" | "flex-end" | "center"; titleTextStyle: TextStyle; customStyleConfig?: StylesConfig; } export interface RoleSelectableUser extends User { isRoleSelected: boolean; isUserSelectionUpdated?: boolean; } export interface Props { allUsers: User[]; customization?: { placeholderLabel?: string; }; disable?: boolean; /** When true, typing in the control filters options by name or email. */ isSearchable?: boolean; /** * Target node for portaling the dropdown menu. Pass `document.body` when * the trigger lives inside a scrollable container (e.g. an * `overflow: auto` row list) so the absolutely-positioned menu does not * extend the parent's `scrollHeight`. */ menuPortalTarget?: HTMLElement | null; pickerStyles?: Partial; selectedUser?: User; showAddUser?: boolean; /** Applied to the outer wrapper (e.g. trim alignment padding in headers). */ style?: CSSProperties; onSelectedUserChanged: (selectedUser?: User) => void; } export interface OptionType extends User { label: string; value: string; } export default function UserSingleSelect({ allUsers, onSelectedUserChanged, selectedUser, disable, isSearchable, menuPortalTarget, pickerStyles: { optionBackgroundColor, selectedOptionBackgroundColor, optionTextStyle, titleTextStyle, backgroundColor, titleTextAlignment, selectedOptionColor, customStyleConfig, }, customization: { placeholderLabel }, showAddUser, style, }: Props): import("react/jsx-runtime").JSX.Element;