import * as React from 'react';
import type { ListComponents } from '../components/body/listComponents';
import type { PickerConfig } from '../config/config';
import type { ThemeValue } from '../types/exposedTypes';
import type { PickerComponents } from './components';
/**
* Appearance props owned by the default wrapper, plus the
* two that Root already accepts as native `aside` attributes. This list is
* short and stable; the behavior set is long and grows.
*/
export type PickerAppearanceProps = 'theme' | 'colorScheme' | 'width' | 'height' | 'className' | 'style' | 'unstyled';
/** Presence and placement belong to the caller's JSX, not Root switches. */
export type PickerCompositionProps = 'open' | 'searchDisabled' | 'skinTonesDisabled' | 'skinTonePickerLocation';
export type RootBehaviorProps = Omit & {
previewConfig?: Omit, 'showPreview'>;
};
export type RootProps = Omit, keyof RootBehaviorProps | 'children' | 'role' | 'dangerouslySetInnerHTML'> & RootBehaviorProps & {
children: React.ReactNode;
/** Built-in leaf appearance. Bare compositions default to 'none'. */
appearance?: 'none' | 'default';
/** Shared replacements for grid, variation, reaction and navigation controls. */
components?: PickerComponents;
/**
* Opt-in color scheme: applies the default light/dark color tokens as
* CSS variables on Root (no border, background or typography).
* Omit it to style a fully unbranded picker yourself. (Not `theme`:
* CSS-in-JS libraries reserve that prop on components they wrap.)
*/
colorScheme?: ThemeValue;
};
/**
* Children are trailing controls, e.g. ; nothing is inserted
* automatically.
*/
export type SearchProps = Omit, 'role' | 'dangerouslySetInnerHTML'> & {
/** Native attributes for the managed input; Root owns its value. */
inputProps?: Omit, 'type' | 'value' | 'defaultValue' | 'onChange' | 'autoFocus' | 'placeholder' | 'aria-controls' | 'role' | 'children' | 'dangerouslySetInnerHTML'>;
inputRef?: React.Ref;
};
export type SearchInputElement = 'input' | React.ComponentType;
type ManagedInputProps = Omit, 'type' | 'value' | 'defaultValue' | 'role' | 'aria-controls' | 'children' | 'dangerouslySetInnerHTML'>;
type ReservedInputProps = 'type' | 'value' | 'defaultValue' | 'role' | 'aria-controls' | 'children' | 'dangerouslySetInnerHTML' | 'as';
type InputBehaviorHandlers = 'onChange' | 'onFocus' | 'onCompositionStart' | 'onCompositionEnd';
/** Native input props plus the selected design-system input's own props. */
export type SearchInputProps = Omit> & Pick & Omit, ReservedInputProps | InputBehaviorHandlers> & {
/** Must forward its ref and supplied props to an actual input element. */
as?: T;
};
export type SearchInputComponent = (props: SearchInputProps & React.RefAttributes) => React.ReactElement | null;
export type CategoryNavProps = Omit, 'role' | 'children' | 'dangerouslySetInnerHTML'> & {
/**
* Tab axis. `vertical` stacks the tabs (e.g. a side rail) and switches
* keyboard navigation to Up/Down between tabs and Left/Right to leave,
* announced through aria-orientation. Default: 'horizontal'.
*/
orientation?: 'horizontal' | 'vertical';
};
export type PreviewProps = Omit, 'role' | 'dangerouslySetInnerHTML'>;
export type ListProps = Omit, 'role' | 'children' | 'dangerouslySetInnerHTML'> & {
/**
* Custom markup for emoji cells and category headers. Each receives the
* library-owned props to spread onto its element (see EmojiRenderProps /
* CategoryHeaderRenderProps).
*/
components?: ListComponents;
};
export type EmptyProps = Omit, 'role' | 'children' | 'dangerouslySetInnerHTML'> & {
children?: React.ReactNode | ((state: {
search: string;
}) => React.ReactNode);
};
export type SkinToneProps = Omit, 'role' | 'children' | 'dangerouslySetInnerHTML'> & {
/** Axis the tones fan out along. Default: 'horizontal'. */
orientation?: 'horizontal' | 'vertical';
};
export type LoadingProps = Omit, 'role' | 'children' | 'dangerouslySetInnerHTML'> & {
children?: React.ReactNode;
};
export type LoadErrorProps = Omit, 'role' | 'children' | 'dangerouslySetInnerHTML'> & {
children?: React.ReactNode | ((state: {
error: Error;
retry: () => void;
}) => React.ReactNode);
};
export {};