import type * as React from "react"; import type { AllowClearProp, ControlStatusProp, ControlVariantProp, MaxTagPlaceholderProp, SizeProp } from "../../props/vocabulary/index.js"; /** * The DOM attributes that put a control on the `variant` × `status` × `size` matrix owned by * `.ui-control-surface` in `src/styles/control.css`. * * Written once, here, rather than five times: every member of the select family (Select, * SearchSelect, Cascader, TreeSelect, TagInput) states the antd surface contract the same way, and * a per-component copy is how the five drift apart. Each default (`outlined`, `md`) emits NO * attribute at all, so a control that says nothing keeps the exact DOM it had. */ export declare function controlSurfaceAttrs(props: { variant?: ControlVariantProp; status?: ControlStatusProp; size?: SizeProp; }): { "data-variant"?: ControlVariantProp; "data-status"?: ControlStatusProp; "data-size"?: SizeProp; }; /** * `status="error"` must also reach assistive tech, so it folds into `aria-invalid`. * * antd's own `status="error"` is a pure recolour — a state announced by hue alone, which WCAG 2.2 * SC 1.4.1 does not accept. An `aria-invalid` arriving from `FormField` always wins: the field's * validation state is the authority, and a `status` prop must never be able to talk it down. */ export declare function resolveAriaInvalid(ariaInvalid: T, status: ControlStatusProp | undefined): T | true | undefined; /** The normalised clear affordance: whether to offer it, with what icon, under what label. */ export type ResolvedAllowClear = { enabled: boolean; clearIcon?: React.ReactNode; label?: string; }; /** * Reconcile antd's `allowClear` with this library's own `clearable`. * * `allowClear` wins when present because it is the more specific statement — the object form * carries an icon and a label that `clearable` has no way to express. `clearable` stays as this * library's own alias with the SAME default as antd's `allowClear` for the control: the caller * passes that default (`undefined` reads as OFF — antd Select/TreeSelect/Input; a picker whose antd * default is ON, DatePicker/TimePicker/Cascader, passes `true`). An antd-named prop takes antd's * default too (docs/DESIGN-AUTHORITY.md), so a required select is not one click from empty. */ export declare function resolveAllowClear(allowClear: AllowClearProp | undefined, clearable: boolean | undefined, fallbackLabel?: string): ResolvedAllowClear; /** * Apply antd's `maxTagCount` / `maxTagPlaceholder` to a list of selected values. * * Returns the values that stay visible plus the overflow node, so the three call sites (Cascader, * TreeSelect, TagInput) agree on what "+2" means. `maxTagCount` is only honoured when it is a * non-negative number — `undefined` shows everything, which is the antd default. * * `overflow` is `undefined` when the consumer supplied no `maxTagPlaceholder`: the fallback wording * is a COUNT, and a count has to go through `t()` + `Intl.PluralRules` at the call site rather than * be concatenated here. */ export declare function applyMaxTagCount(items: T[], maxTagCount: number | undefined, maxTagPlaceholder: MaxTagPlaceholderProp | undefined): { visible: T[]; omitted: T[]; overflow: React.ReactNode | undefined; }; /** * Split a run of text on antd's `tokenSeparators` — the contract behind "paste a column out of a * spreadsheet and get one value per line". * * Shared by `TagInput` and the tags/multiple `Select`: they are the two controls that turn typing * into several values, and two copies of this would be two answers to "what is a separator". */ export declare function splitByTokenSeparators(text: string, separators: string[]): string[];