/**
 * @file ComplexSelector.tsx
 * @input Uses React, StyleX, Field, usePopover
 * @output Exports ComplexSelector component for custom selector surfaces
 * @position Core implementation; consumed by index.ts
 *
 * SYNC: When modified, update:
 * - /packages/core/src/ComplexSelector/ComplexSelector.doc.mjs
 * - /packages/core/src/ComplexSelector/ComplexSelector.test.tsx
 * - /packages/core/src/ComplexSelector/index.ts
 * - /apps/storybook/stories/ComplexSelector.stories.tsx
 */
import React, { type ReactNode } from 'react';
import type { StyleXStyles } from '@stylexjs/stylex';
import type { BaseProps } from '../BaseProps';
import { type FieldStatusVariant } from '../Field';
import type { SizeValue } from '../utils/types';
export type ComplexSelectorSize = 'sm' | 'md' | 'lg';
export interface ComplexSelectorRenderState {
    /** Whether the selector surface is open. */
    isOpen: boolean;
    /** Whether changeAction/isLoading is pending. */
    isBusy: boolean;
    /** ID of the trigger button. */
    triggerId: string;
    /** ID of the popup content container. */
    contentId: string;
}
export interface ComplexSelectorStatus {
    type: 'warning' | 'error' | 'success';
    message?: string;
}
export interface ComplexSelectorProps<Value> extends Omit<BaseProps<HTMLDivElement>, 'children' | 'onChange'> {
    /** Label text for accessibility and the field label. */
    label: string;
    /** Current controlled value. */
    value: Value;
    /** Called when custom content commits a new value. */
    onChange?: (value: Value) => void;
    /** Optional async action after onChange; drives optimistic UI. */
    changeAction?: (value: Value) => void | Promise<void>;
    /** Custom selector surface content rendered inside a dialog popover. */
    children: (value: Value, onChange: (value: Value) => void, close: () => void, state: ComplexSelectorRenderState) => ReactNode;
    /** Label/content shown in the closed trigger. */
    triggerLabel?: ReactNode;
    /** Placeholder shown when triggerLabel is omitted. */
    placeholder?: ReactNode;
    /** Whether to visually hide the field label. */
    isLabelHidden?: boolean;
    /** Helper text displayed below the label. */
    description?: string;
    /** Marks the field optional. */
    isOptional?: boolean;
    /** Marks the field required. */
    isRequired?: boolean;
    /** Disables the selector. */
    isDisabled?: boolean;
    /** Shows loading state on the trigger. */
    isLoading?: boolean;
    /** Validation status. */
    status?: ComplexSelectorStatus;
    /** Status placement. */
    statusVariant?: FieldStatusVariant;
    /** Tooltip text displayed next to the label. */
    labelTooltip?: string;
    /** Trigger and field size. */
    size?: ComplexSelectorSize;
    /** Width of the field. */
    width?: SizeValue;
    /** Popup placement. */
    placement?: 'above' | 'below' | 'start' | 'end';
    /** StyleX styles for the popup content container. */
    contentXstyle?: StyleXStyles;
    /** Test ID for the trigger container. */
    'data-testid'?: string;
}
/**
 * A selector shell for rich, custom selection surfaces.
 *
 * ComplexSelector owns the field, trigger, popover, focus restore, and async
 * change action flow. Consumers provide the dialog content as a render function,
 * using the supplied `value`, `onChange`, and `close` helpers to compose the
 * right accessible structure for the custom selector.
 *
 * @example
 * ```
 * <ComplexSelector
 *   label="Fruit"
 *   value={value}
 *   onChange={setValue}
 *   triggerLabel={`${value.fruit} ${value.ripeness}`}>
 *   {(value, onChange, close) => (
 *     <FruitGrid
 *       value={value}
 *       onChange={nextValue => {
 *         onChange(nextValue);
 *         close();
 *       }}
 *     />
 *   )}
 * </ComplexSelector>
 * ```
 */
export declare function ComplexSelector<Value>({ label, value, onChange, changeAction, children, triggerLabel, placeholder: placeholderFromProps, isLabelHidden, description, isOptional, isRequired, isDisabled, isLoading, status, statusVariant, labelTooltip, size, width, placement, contentXstyle, xstyle, className, style, 'data-testid': testId, ...props }: ComplexSelectorProps<Value>): React.JSX.Element;
export declare namespace ComplexSelector {
    var displayName: string;
}
//# sourceMappingURL=ComplexSelector.d.ts.map