carbon-custom-elements
Version:
A Carbon Design System variant that's as easy to use as native HTML elements, with no framework tax, no framework silo.
115 lines (95 loc) • 2.41 kB
TypeScript
/**
* @license
*
* Copyright IBM Corp. 2019, 2020
*
* 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 { Component } from 'react';
interface ComponentProps {
/* eslint-enable class-methods-use-this */
/**
* The color scheme.
*/
colorScheme?: string;
/**
* `true` if this dropdown should be disabled.
*/
disabled?: boolean;
/**
* The helper text.
*/
helperText?: string;
/**
* `true` to show the UI of the invalid state.
*/
invalid?: boolean;
/**
* The label text.
*/
labelText?: string;
/**
* `true` if this dropdown should be open.
*/
open?: boolean;
/**
* `true` if the value is required.
*/
required?: boolean;
/**
* The special validity message for `required`.
*/
requiredValidityMessage?: string;
/**
* An assistive text for screen reader to announce, telling the open state.
*/
selectingItemsAssistiveText?: string;
/**
* An assistive text for screen reader to announce, telling that an item is selected.
*/
selectedItemAssistiveText?: string;
/**
* Dropdown size.
*/
size?: string;
/**
* The `aria-label` attribute for the UI indicating the closed state.
*/
toggleLabelClosed?: string;
/**
* The `aria-label` attribute for the UI indicating the open state.
*/
toggleLabelOpen?: string;
/**
* The content of the trigger button.
*/
triggerContent?: string;
/**
* `true` if this dropdown should use the inline UI variant.
*/
type?: string;
/**
* The validity message.
*/
validityMessage?: string;
/**
* The value of the selected item.
*/
value?: string;
}
/**
* Dropdown.
* @element bx-dropdown
* @csspart label-text The label text.
* @csspart helper-text The helper text.
* @csspart trigger-button The trigger button.
* @csspart menu-body The menu body.
* @csspart validity-message The validity message.
* @fires bx-dropdown-beingselected
* The custom event fired before a dropdown item is selected upon a user gesture.
* Cancellation of this event stops changing the user-initiated selection.
* @fires bx-dropdown-selected - The custom event fired after a a dropdown item is selected upon a user gesture.
*/
declare class BXDropdown extends Component<ComponentProps> {}
export default BXDropdown;