UNPKG

@base-ui/react

Version:

Base UI is a library of headless ('unstyled') React components and low-level hooks. You gain complete control over your app's CSS and accessibility features.

21 lines 1.11 kB
import * as React from 'react'; type ItemRecord = Record<string, React.ReactNode>; type ItemsInput = ItemRecord | ReadonlyArray<LabeledItem> | ReadonlyArray<Group<LabeledItem>> | undefined; interface LabeledItem { value: any; label: React.ReactNode; } export interface Group<Item = any> { value: unknown; items: Item[]; } export declare function isGroupedItems(items: ReadonlyArray<any | Group<any>> | undefined): items is Group<any>[]; /** * Checks if the items array contains an item with a null value that has a non-null label. */ export declare function hasNullItemLabel(items: ItemsInput): boolean; export declare function stringifyAsLabel(item: any, itemToStringLabel?: (item: any) => string): string; export declare function stringifyAsValue(item: any, itemToStringValue?: (item: any) => string): string; export declare function resolveSelectedLabel(value: any, items: ItemsInput, itemToStringLabel?: (item: any) => string): React.ReactNode; export declare function resolveMultipleLabels(values: any[], items: ItemsInput, itemToStringLabel?: (item: any) => string): React.ReactNode; export {};