UNPKG

@carbon/react

Version:

React components for the Carbon Design System

50 lines (49 loc) 1.86 kB
/** * Copyright IBM Corp. 2016, 2025 * * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. */ import { type HTMLAttributes } from 'react'; import PropTypes from 'prop-types'; export interface ListBoxFieldProps extends HTMLAttributes<HTMLDivElement> { /** * Specify if the parent <ListBox> is disabled */ disabled?: boolean; } /** * `ListBoxField` is responsible for creating the containing node for valid * elements inside of a field. It also provides a11y-related attributes like * `role` to make sure a user can focus the given field. */ declare function ListBoxField({ children, disabled, tabIndex, ...rest }: ListBoxFieldProps): import("react/jsx-runtime").JSX.Element; declare namespace ListBoxField { var propTypes: { /** * Typically set by `getToggleButtonProps`, this should specify whether the * field has a popup. */ 'aria-haspopup': PropTypes.Requireable<NonNullable<string | boolean | null | undefined>>; /** * Provide the contents of your ListBoxField */ children: PropTypes.Requireable<PropTypes.ReactNodeLike>; /** * Specify if the parent <ListBox> is disabled */ disabled: PropTypes.Requireable<boolean>; /** * The role for the component, should be set by `getToggleButtonProps` coming * from Downshift */ role: PropTypes.Requireable<string>; /** * Optional prop to specify the tabIndex of the <ListBox> trigger button */ tabIndex: PropTypes.Requireable<NonNullable<string | number | null | undefined>>; }; } export type ListBoxFieldComponent = typeof ListBoxField; declare const _default: ListBoxFieldComponent; export default _default;