import { default as React } from 'react'; import { DataSource, LookupFilterDef } from '@object-ui/types'; /** * PeoplePicker — the Tier 0, search-first user picker (issue #2112). * * A single-column picker: search box → recent contacts → rich candidate rows * (avatar + name + department·email) → a live SelectionTray for multi-select. * Composed from the reusable {@link useRecordQuery} kernel and * {@link SelectionTray}; a future org-tree tier reuses both beside a left tree. * * Container is responsive: a centered Dialog on desktop, a bottom Sheet on * mobile (<768px). Interaction: full keyboard model (↑/↓ move the cursor, ↵ * toggles/commits, Backspace on an empty search removes the last chip, Esc * closes), matched-term highlighting in rows, skeletons on first load with no * flash-to-empty on refetch, and friendly empty / error+retry states. * * Candidate hygiene (e.g. `banned != true`), the department `$expand`, and the * avatar/subtitle field config are supplied by the caller (UserField). Pinyin / * employee-id search is server-side and transparent — the client only sends the * term. */ export interface PeoplePickerProps { open: boolean; onOpenChange: (open: boolean) => void; title?: string; multiple?: boolean; dataSource: DataSource; /** Object to query — `sys_user` for user fields. */ objectName: string; displayField?: string; idField?: string; /** Dotted field paths for the row subtitle, e.g. `['primary_business_unit_id.name','email']`. */ subtitleFields?: string[]; avatarField?: string; /** Related entities to expand (e.g. `['primary_business_unit_id']` for the department name). */ expand?: string[]; /** Narrow the server searchable set (ADR-0061). */ searchFields?: string[]; pageSize?: number; /** Base candidate filters (e.g. exclude banned users). */ lookupFilters?: LookupFilterDef[]; /** * Hard filter constraints in QueryParams.$filter record form — the * dependent (cascading) lookup chain (#2215). Always ANDed into the * candidate query; spread after `lookupFilters` so it wins on conflicts. */ baseFilter?: Record; /** Current selection (id, or id[] when `multiple`). */ value?: any; onSelect: (value: any) => void; onSelectRecords?: (records: any[]) => void; /** * Render as an inline combobox anchored to {@link trigger} — a Popover * dropdown on desktop, a bottom Sheet on mobile — instead of a centered * modal Dialog. In inline mode multi-select commits live on each toggle * (the caller's field chips are the selection), so there's no staging tray * or confirm button. */ inline?: boolean; /** The element the inline dropdown/sheet anchors to (the field trigger). */ trigger?: React.ReactNode; } export declare function PeoplePicker({ open, onOpenChange, title, multiple, dataSource, objectName, displayField, idField, subtitleFields, avatarField, expand, searchFields, pageSize, lookupFilters, baseFilter: baseFilterProp, value, onSelect, onSelectRecords, inline, trigger, }: PeoplePickerProps): React.JSX.Element;