/**
 * @file PowerSearch.tsx
 * @input PowerSearchConfig, filters, onChange
 * @output Structured filter bar with token-based filter management
 * @position Main component; forwards DOM ref and exposes tokenizer control via
 *   handleRef
 *
 * SYNC: When modified, update:
 * - /packages/core/src/PowerSearch/index.ts
 * - /packages/cli/assets/templates/blocks/components/PowerSearch/ (showcase blocks)
 */
import React, { type ReactNode } from 'react';
import type { BaseProps } from '../BaseProps';
import { type TokenizerOverflowBehavior } from '../Tokenizer';
import type { IconType } from '../Icon';
import type { InputStatus, FieldStatusVariant } from '../Field';
import type { PowerSearchConfig, PowerSearchFilter, PowerSearchChangeType, PowerSearchHandle, PowerSearchComponents } from './types';
export type PowerSearchSize = 'sm' | 'md' | 'lg';
export interface PowerSearchProps extends Omit<BaseProps<HTMLElement>, 'onChange'> {
    /** PowerSearch configuration defining available fields and operators. */
    config: PowerSearchConfig;
    /** Currently active filters. */
    filters: ReadonlyArray<PowerSearchFilter>;
    /** Called when filters change. */
    onChange: (filters: ReadonlyArray<PowerSearchFilter>, changeType: PowerSearchChangeType, index: number) => void;
    /** Accessible label. @default 'Search' */
    label?: string;
    /** Visually hide the label. @default true */
    isLabelHidden?: boolean;
    /** Placeholder text. @default 'Search...' */
    placeholder?: string;
    /** Auto-focus on mount. @default false */
    hasAutoFocus?: boolean;
    /** Show clear button. @default true */
    hasClear?: boolean;
    /** Whether the input is read-only. @default false */
    isReadOnly?: boolean;
    /** Whether the input is disabled. @default false */
    isDisabled?: boolean;
    /**
     * Explains why the search is disabled. When set together with `isDisabled`,
     * the search shows a tooltip with this text on hover and keyboard focus, and
     * the input stays focusable (via `aria-disabled`) so the reason is
     * discoverable by keyboard and assistive technology. Input stays blocked.
     *
     * Use this instead of wrapping a disabled PowerSearch in `Tooltip` — disabled
     * controls don't emit the pointer events an external tooltip needs.
     */
    disabledMessage?: string;
    /**
     * Icon to display at the start of the input.
     * Accepts a ReactNode (e.g. `<Icon icon={SearchIcon} />`) or an SVG icon component directly.
     */
    startIcon?: ReactNode | IconType;
    /** Fires when focus enters the search input from outside. */
    onFocus?: (e: React.FocusEvent) => void;
    /** Fires when focus leaves the search input entirely. */
    onBlur?: (e: React.FocusEvent) => void;
    /** Validation status. */
    status?: InputStatus;
    /**
     * How the status message is placed relative to the input.
     * - 'attached': message overlaps directly below the input (bordered treatment)
     * - 'detached': message floats below as a separate element with spacing
     * @default 'attached'
     */
    statusVariant?: FieldStatusVariant;
    /** Max width for dropdown menu. */
    menuWidth?: number;
    /** Max display length for filter token values. @default 40 */
    maxTokenLength?: number;
    /** Max items in operator dropdown. */
    maxOperatorMenuItems?: number;
    /** Label for the save button in edit popover. @default 'Apply' */
    popoverSaveButtonLabel?: string;
    /** Timezone ID for date formatting. */
    timezoneID?: string;
    /**
     * Controls how tokens overflow when the container is too narrow.
     * Forwarded to Tokenizer.
     * @default 'none'
     */
    tokenOverflowBehavior?: TokenizerOverflowBehavior;
    /**
     * Content to display at the end of the input row.
     * Useful for action buttons or other controls.
     */
    endContent?: React.ReactNode;
    /**
     * Number of results matching the current filters.
     * When a number, formatted as "N results". When a string, displayed as-is.
     */
    resultCount?: number | string;
    /** Ref forwarded to the root element. */
    ref?: React.Ref<HTMLDivElement>;
    /** Imperative handle ref. */
    handleRef?: React.Ref<PowerSearchHandle>;
    /**
     * Size of the search input.
     * @default 'md'
     */
    size?: PowerSearchSize;
    /**
     * Per-type component overrides for token and editor rendering.
     * Keys are operator value types (e.g. 'string', 'enum', 'date_absolute').
     */
    components?: PowerSearchComponents;
}
/**
 * Structured filter bar where each token represents a filter (field + operator + value).
 *
 * Users select a field from a typeahead dropdown, then configure the operator
 * and value in an edit popover. Filters appear as tokens that can be clicked
 * to edit or removed individually.
 *
 * @example
 * ```
 * const config = {
 *   name: 'MySearch',
 *   fields: [
 *     {
 *       key: 'status',
 *       label: 'Status',
 *       operators: [
 *         {
 *           key: 'is',
 *           label: 'is',
 *           value: {
 *             type: 'enum',
 *             values: [
 *               { value: 'open', label: 'Open' },
 *               { value: 'closed', label: 'Closed' },
 *             ],
 *           },
 *         },
 *       ],
 *     },
 *   ],
 * };
 * const [filters, setFilters] = useState([]);
 * <PowerSearch
 *   config={config}
 *   filters={filters}
 *   onChange={(newFilters) => setFilters(newFilters)}
 * />
 * ```
 *
 * Use contentSearchFieldKey to designate a field for free-text search.
 * When set, unstructured text input is routed to that field.
 *
 * @example
 * ```
 * const config = {
 *   name: 'IssueSearch',
 *   contentSearchFieldKey: 'title',
 *   fields: [
 *     {
 *       key: 'title',
 *       label: 'Title',
 *       operators: [
 *         { key: 'contains', label: 'contains', value: { type: 'string' } },
 *       ],
 *     },
 *     {
 *       key: 'status',
 *       label: 'Status',
 *       operators: [
 *         { key: 'is', label: 'is', value: { type: 'enum', values: [...] } },
 *       ],
 *     },
 *   ],
 * };
 * ```
 */
export declare function PowerSearch({ config: configProp, filters, onChange, label: labelFromProps, isLabelHidden, placeholder: placeholderFromProps, hasAutoFocus, hasClear, isReadOnly, isDisabled, disabledMessage, startIcon, onFocus, onBlur, status, statusVariant, maxTokenLength, popoverSaveButtonLabel: popoverSaveButtonLabelFromProps, timezoneID, tokenOverflowBehavior, endContent, resultCount, ref, handleRef, size: sizeProp, 'data-testid': testId, xstyle, className, style, components: componentOverrides, }: PowerSearchProps): React.JSX.Element;
export declare namespace PowerSearch {
    var displayName: string;
}
//# sourceMappingURL=PowerSearch.d.ts.map