import { AllHTMLAttributes } from 'react';
import type { ChangeEvent } from 'react';
import { ChangeEventHandler } from 'react';
import { CountryCode } from 'libphonenumber-js';
import { CSSProperties } from 'react';
import { E164Number } from 'libphonenumber-js';
import { FocusEventHandler } from 'react';
import { FormEvent } from 'react';
import { FunctionComponent } from 'react';
import { HTMLAttributes } from 'react';
import type { InputHTMLAttributes } from 'react';
import { JSX as JSX_2 } from 'react';
import { MouseEventHandler } from 'react';
import { MutableRefObject } from 'react';
import { default as React_2 } from 'react';
import { ReactNode } from 'react';
import { RefCallback } from 'react';
export declare const AdvancedTable: React_2.FunctionComponent;
declare interface AdvancedTableAction {
label: React_2.ReactNode | ((row?: AdvancedTableRow) => React_2.ReactNode);
action: (row?: AdvancedTableRow) => void;
isDisabled?: (row?: AdvancedTableRow) => boolean | boolean;
isExcluded?: (row?: AdvancedTableRow) => boolean | boolean;
actionId?: string;
}
declare interface AdvancedTableActionGroup {
header?: string;
actions: AdvancedTableAction[];
}
declare interface AdvancedTableCellProps extends Omit, 'value'> {
value: any;
renderCellContent?: RenderCellContent;
isCellContentInteractive?: boolean;
width?: string | number;
widthBuffer?: number;
alignment?: Alignment;
rowId: string;
columnId: string;
rowIndex: number;
columnIndex: number;
'data-testid'?: string;
isFocused: boolean;
onKeyDown: React_2.KeyboardEventHandler;
onFocus: React_2.FocusEventHandler;
isDragging: boolean;
rowPropReference: AdvancedTableRow;
rowsProp: AdvancedTableRow[];
depth: number;
onRowsChange?: (newRows: AdvancedTableRow[]) => void;
}
export declare interface AdvancedTableColumnConfig {
id: string;
headerLabel: React_2.ReactNode | React_2.ComponentType;
width?: string | number;
alignment?: 'left' | 'center' | 'right';
sortOptions?: {
ascendingLabel: string;
descendingLabel: string;
ascendingIcon?: React_2.ComponentType;
descendingIcon?: React_2.ComponentType;
sort?: (selectedSortOption: AdvancedTableSelectedSortOption) => AdvancedTableRow[];
}[];
renderCellContent?: (cellParams: {
value: AdvancedTableCellProps['value'];
setValue: (newValue: any) => void;
focusCell: () => void;
focusableElementRef: React_2.Ref;
isEditing: boolean;
rowId: string;
columnId: string;
rowIndex: number;
columnIndex: number;
}) => React_2.ReactNode;
isCellContentInteractive?: boolean;
}
export declare interface AdvancedTableHeaderLabelProps {
sortIndicator: React_2.ReactNode;
focusSource?: 'keyboard' | 'mouse' | null;
contentId?: string;
shouldShowTooltip?: boolean;
isMenuOpen?: boolean;
}
declare interface AdvancedTablePaginationProps {
rowsPerPage: number;
currentPage: number;
setCurrentPage: React_2.Dispatch>;
rows: AdvancedTableRow[];
ariaLabel?: AdvancedTableProps['paginationAriaLabel'];
onPageChange?: (pageNumber: number) => void;
className?: string;
'data-testid'?: string;
}
export declare interface AdvancedTableProps {
/** An array of column config objects that configure each column. */
columnConfigs: AdvancedTableColumnConfig[];
/** An array of row objects to define the rows.
* @defaultValue []
*/
rows?: AdvancedTableRow[];
/** Handler to be called whenever the rows change. In case of modifiable cell content, it should trigger state changes (e.g. `setRows`). */
onRowsChange?: (newRows: AdvancedTableRow[]) => void;
/** Handler to be called whenever a row is selected from click or Enter. When defined, enables the ability to focus an entire row via keyboard navigation. */
onRowSelect?: (row: AdvancedTableRow) => void;
/** Used to control which row is selected. */
selectedRowId?: string;
/** Handler to be called whenever a row checkbox is toggled. When defined, adds a checkbox to each row and enables the ability to focus an entire row via keyboard navigation. */
onCheckedRowIdsChange?: (newCheckedRowIds: string[]) => void;
/** Used to control which rows are checked. */
checkedRowIds?: string[];
/** Handler to be called whenever a sort option is selected. */
onSelectedSortOptionChange?: (newSelectedSortOption: AdvancedTableSelectedSortOption) => void;
/** Control which sort option is initially selected. */
defaultSelectedSortOption?: AdvancedTableSelectedSortOption;
/** Control which sort option is selected. */
selectedSortOption?: AdvancedTableSelectedSortOption;
/** Prevents users from pinning/unpinning columns.
* @defaultValue false */
disableUserPinnableColumns?: boolean;
/** An array of column ids to control which columns are intitially pinned.
* @defaultValue [] */
initialPinnedColumns?: string[];
/** An array of column ids to control which columns are pinned. */
pinnedColumns?: string[];
/** Handler to be called whenever a user pins/unpins a column. */
onPinnedColumnsChange?: (newPinnedColumns: string[]) => void;
/** Prevents users from moving columns left/right.
* @defaultValue false */
disableUserReorderableColumns?: boolean;
/** An array of column ids to control the order the columns are rendered in.
* When not defined, the initial column order defaults to the order of the `columnConfigs` prop. */
columnOrder?: string[];
/** Handler to be called whenever a user moves a column. */
onColumnOrderChange?: (newColumnOrder: string[]) => void;
/** Prevents users from changing column widths.
* @defaultValue false */
disableUserResizableColumns?: boolean;
/** An object used to control the column widths where the keys are columnIds and the values are widths.
* When not defined, the initial column widths default to the width specified in the `columnConfigs` prop. */
columnWidths?: Record;
/** Handler to be called whenever a user resizes a column. */
onColumnWidthsChange?: (newColumnWidths: Record) => void;
/** Number of lines to allow text to wrap in column headers.
* @defaultValue 1
*/
headerMaxLines?: number;
/** Determines the number of rows for each page. Default is all rows. */
rowsPerPage?: number;
/** Determines the starting page; must be used with `rowsPerPage`.
* @defaultValue 1
*/
initialPage?: number;
/** Handler to be called whenever the page changes. */
onPageChange?: AdvancedTablePaginationProps['onPageChange'];
/** Appended to internal classes on the pagination interface. */
paginationClassName?: string;
/** The aria-label applied to the pagination interface. */
paginationAriaLabel?: string;
/** The id of the element that serves as an accessible label for the AdvancedTable. */
'aria-labelledby'?: string;
/** An accessible label for the `AdvancedTable` for when it does not have a visible label. */
'aria-label'?: string;
/** The id of the element that describes `AdvancedTable`. Internally this is combined with the screen reader descriptions mentioned in the localization section. */
'aria-describedby'?: string;
/** Forwarded to the containing `div` element and to the sub-elements, each with their own suffix:
* - columnheader: `-`, or `-CheckboxColumnHeader` for the checkbox column
* - columnheader menu: `--ColumnHeaderMenu`
* - pin column: `-PinColumn`
* - move column left: `-MoveColumnLeft`
* - move column right: `-MoveColumnRight`
* - sort: `-Sort--`
* - row: `-row-`
* - row checkbox: `-row--Checkbox`
* - row action button: `-row--RowActionButton`
* - row action menu: `-row--RowActionMenu`
* - action: `-action-`
* - gridcell: `-cell--`
* - pagination: `-TablePagination`
* - previous button: `-PreviousButton`
* - page input: `-PageInput`
* - next button: `-NextButton` */
'data-testid'?: string;
/** Controls which actions appear beside each row. */
rowActions?: AdvancedTableActionGroup[];
/** The aria-label applied to the row actions button. */
rowActionsButtonAriaLabel?: string;
/** Where to prioritize placement of the rowActions pane relative to the button.
* @defaultValue 'bottom-end'
*/
rowActionsPlacement?: DropdownListProps['placement'];
/** A unique id for the AdvancedTable. */
id?: string;
}
export declare interface AdvancedTableRow {
id: string;
data: Record;
isExpanded?: boolean;
isCheckboxDisabled?: boolean;
childRows?: AdvancedTableRow[];
unsafe_rowProps?: Record;
}
export declare interface AdvancedTableSelectedSortOption {
columnId: string;
index: number;
direction: 'ascending' | 'descending' | 'none';
}
declare type Alignment = AdvancedTableColumnConfig['alignment'];
declare interface ButtonProps extends React_2.AllHTMLAttributes {
/** The contents of the button. */
children?: React_2.ReactNode;
/** Specifies the use of the button and customizes its color.
* @defaultValue 'default'*/
kind?: 'default' | 'primary' | 'secondary' | 'tertiary' | 'link' | 'danger';
/** Disables click events on the button and styles it to look as though it cannot be clicked.
* @defaultValue false */
disabled?: boolean;
/** Makes the button take up the full width of its container.
* @defaultValue false */
full?: boolean;
/** Makes the button smaller.
* @defaultValue false */
small?: boolean;
/** Appended to internal classes on the `button` element. */
className?: string;
/** Specifies the type of the button.
* @defaultValue 'button' */
type?: 'button' | 'submit' | 'reset';
/** Handler to be called when the button is clicked. Use to handle user interaction with the button. */
onClick?: (event: React_2.MouseEvent) => void;
/** Handler to be called when a keyboard key is pressed down while button has focus. */
onKeyDown?: (event: React_2.KeyboardEvent) => void;
/** Causes the button to be declared as disabled by screen readers. If not defined, `aria-disabled` defaults to the value of the `disabled` prop. */
'aria-disabled'?: boolean;
[prop: string]: any;
}
export declare const Chat: React_2.ForwardRefExoticComponent>;
export declare const ChatInput: React_2.ForwardRefExoticComponent>;
export declare interface ChatInputProps {
/** Function to call when the send button is clicked
* or "enter" is pressed on the input or send button */
onMessageSend?: (message: string) => void;
/** Whether the input and button should be disabled */
isDisabled?: boolean;
/** The value of the underlying `textarea`
* @defaultValue false
*/
value?: string;
/** Function to call whenever the value of theunderlying `textarea` changes */
onChange?: (newValue: string) => void;
/** Forwarded to sub-components with the following suffixes
* * `-input`
* * `-button`
*/
'data-testid'?: string;
/**
* The value of the placeholder of the `textarea`
* @defaultValue translate('chat.inputLabel')
*/
placeholderText?: string;
/**
* Identifier for this component.
* * Input will receive -chat-input
* * Helper text will receive -input-helper-text
* * Error text will receive -input-error-text
*/
id?: string;
/**
* Max character limit that can be submitted to component, set to undefined/less or equal 0 to disable
*/
characterLimit?: number;
/**
* Helper text content for characterLimit
* @defaultValue translate('chat.inputHelperText')
*/
helperText?: string;
}
export declare const ChatMessage: React_2.ForwardRefExoticComponent & React_2.RefAttributes>;
export declare const ChatMessageList: React_2.ForwardRefExoticComponent>;
export declare interface ChatMessageListProps {
/** The `Message`s to display */
children?: ReactNode;
/** Used to control which child in the message list should be part of the page's tab order.
* See the accessibility notes for details on if/how you should use this prop */
focusedMessageIndex?: number;
/** Used to control which child in the message list should be part of the page's tab order.
* See the accessibility notes for details on if/how you should use this prop */
onFocusedMessageIndexChange?: (newFocusedMessageIndex: number) => void;
/** Forwarded to the `div` element */
'data-testid'?: string;
}
export declare interface ChatMessageProps {
/** The message's content */
children: ReactNode;
/** Who the message is from. Sets the message's style and labels */
variant: Variant;
/** The type of message. Updates the message's style and labels
* @defaultValue 'default'
*/
messageLevel?: MessageLevel;
/** Forwarded to the `li` element */
'data-testid'?: string;
/** Sets the message text to be used in the message's accessible label.
* See the accessibility notes for details on if/how you should use this prop */
accessibleText?: string;
/** Sets the message header to be used in the message's accessible label.
* See the accessibility notes for details on if/how you should use this prop */
accessibleHeader?: string;
}
export declare interface ChatProps {
/** The `ChatMessageList` and `ChatInput` */
children: ReactNode;
/** Function to call whenever the cancel button (visible when `isLoading` is `true`) is clicked */
onMessageCancel?: () => void;
/** Displays a loading spinner and a button to cancel the last message
* @defaultValue false
*/
isLoading?: boolean;
/** Forwarded to the `div` element */
'data-testid'?: string;
}
declare interface CheckboxRegisterProps {
name: keyof V;
type: 'checkbox';
checked: boolean;
onBlur: FocusEventHandler;
onChange: ChangeEventHandler;
ref: RefCallback;
}
declare type ChildrenType = React_2.ReactNode & React_2.RefAttributes;
declare type ChildrenType_2 = React_2.ReactNode & React_2.RefAttributes;
export declare const CollapsibleSearchInput: React_2.ForwardRefExoticComponent>;
export declare interface CollapsibleSearchInputProps {
/** The initial value for the search input.
* @defaultValue ''
*/
defaultValue?: string;
/** The value for the search input. */
value?: string;
/** Handler to be called when the value of the search input changes. */
onValueChange?: (newValue: string) => void;
/** A custom placeholder for the search input. */
placeholder?: string;
/** The initial value for the expanded state
* @defaultValue false
*/
defaultIsExpanded?: boolean;
/** If true, expands into a search input. If false, collapses into an icon button. */
isExpanded?: boolean;
/** Handler to be called when the `isExpanded` value changes. */
onIsExpandedChange?: (newIsExpanded: boolean) => void;
/** The width of the component when it is expanded. This can be any valid CSS `width` value. Use this prop instead of setting a `max-width` on the component.
* @defaultValue 100%
*/
widthWhenExpanded?: string | number;
/** Forwarded to the [`SearchInput`](/components/search-input) component's `aria-label` prop. */
searchInputAriaLabel?: string;
/** Forwarded to the [`SearchInput`](/components/search-input) component's `aria-labelledby` prop. */
searchInputAriaLabelledBy?: string;
/** Forwarded to the [`SearchInput`](/components/search-input) component's `aria-describedby` prop. */
searchInputAriaDescribedBy?: string;
/** Forwarded to the containing `span` element, the [`SearchInput`](/components/search-input), and the [`IconButton`](/components/icon-button). The subcomponents each get their own suffix:
* * `SearchInput`: `-SearchInput`
* * `IconButton`: `-IconButton`
* */
'data-testid'?: string;
}
export declare const CollectionGrid: React_2.ForwardRefExoticComponent>;
export declare const CollectionGridItem: React_2.ForwardRefExoticComponent>;
export declare interface CollectionGridItemProps {
/** Replaces the `CollectionGridItem`'s default element with its single child and merges `CollectionGridItem`'s props and behavior into the child's. This is especially useful if your grid item should be represented by a semantic HTML element. Use this prop with caution, as any future changes we make to the component may override the child's props.
* @defaultValue false
*/
asChild?: boolean;
/** Content to display inside of the grid item */
children?: ChildrenType;
/** Added to the containing `div` */
'data-testid'?: string;
}
export declare interface CollectionGridProps extends CollectionGridItemProps {
/** Sets the minimum width that a column in the grid will shrink to */
minColumnWidth?: string;
/** Sets the maximum width that a column in the grid will take up
* @defaultValue 1fr
*/
maxColumnWidth?: string;
/** Sets the number of columns in the grid. The two non-numeric options you will generally use are `auto-fit` and `auto-fill`. `auto-fill` means "fill the row with as many columns as possible, even if some are empty". `auto-fit` does the same thing, but extra space is distributed among non-empty columns instead of leaving empty space.
* @defaultValue auto-fit
*/
numColumns?: number | string;
/** Sets the height of rows in the grid. If not provided, row heights are established by the height of the grid's children */
rowHeight?: React_2.CSSProperties['gridAutoRows'];
/** Sets the size of the gap between columns in the grid */
columnGap?: React_2.CSSProperties['columnGap'];
/** Sets the size of the gap between rows in the grid */
rowGap?: React_2.CSSProperties['rowGap'];
/** Sets `columnGap` and `rowGap` */
gap?: React_2.CSSProperties['gap'];
}
export declare function Combobox({ initialValue, value, onChange, onSubmit, isDisabled, isInvalid, isRequired, isLoading, isOpen: externalIsOpen, onIsOpenChange: externalOnIsOpenChange, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy, 'data-testid': dataTestId, children, }: ComboboxProps): React_2.ReactElement;
export declare const ComboboxFlyout: FunctionComponent;
export declare interface ComboboxFlyoutProps {
/** The `ComboboxOption`s and `ComboboxGroup`s. */
children?: ReactNode;
/** Forwarded to the element with `role="listbox"`. If defined, it will override the `aria-label` prop value provided to `Combobox`. */
'aria-label'?: string;
/** Forwarded to the element with `role="listbox"`. If defined, it will override the `aria-labelledby` prop value provided to `Combobox`. */
'aria-labelledby'?: string;
/** Forwarded to the element with `role="listbox"`. */
'aria-describedby'?: string;
}
export declare function ComboboxGroup({ label, 'aria-describedby': ariaDescribedBy, children, }: ComboboxGroupProps): React_2.ReactElement;
export declare interface ComboboxGroupProps {
/** The `ComboboxOption`s. */
children: ReactNode;
/** Rendered as text that represents the name of the group. The label needs to be unique across all `ComboboxGroup`s for a given `Combobox` instance. */
label: string;
/** Forwarded to the element with `role="group"`. */
'aria-describedby'?: string;
}
export declare const ComboboxInput: React_2.ForwardRefExoticComponent>;
export declare interface ComboboxInputProps {
/** Forwarded to the `placeholder` prop of [Input](/next/input). */
placeholder?: string;
/** Forwarded to the `leftAddOn` prop of [Input](/next/input). */
leftAddOn?: InputProps['leftAddOn'];
/** Forwarded to the `className` prop of [Input](/next/input). */
className?: string;
/** Forwarded to the `style` prop of [Input](/next/input). */
style?: CSSProperties;
/** Forwarded to the `id` prop of [Input](/next/input). */
id?: string;
/**
* Disables search filtering. Useful for custom search behavior.
* @defaultValue false
*/
isSearchFilteringDisabled?: boolean;
/** Forwarded to the `aria-label` prop of [Input](/next/input). If defined, it will override the `aria-label` prop value provided to `Combobox` */
'aria-label'?: string;
/** Forwarded to the `aria-labelledby` prop of [Input](/next/input). If defined, it will override the `aria-labelledby` prop value provided to `Combobox` */
'aria-labelledby'?: string;
/** Forwarded to the `aria-describedby` prop of [Input](/next/input). */
'aria-describedby'?: string;
}
export declare function ComboboxOption({ label }: ComboboxOptionProps): React_2.ReactElement | null;
export declare interface ComboboxOptionProps {
/** Rendered as text that represents the name of the option. The label needs to be unique across all `ComboboxOption`s for a given `Combobox` instance. */
label: string;
}
export declare interface ComboboxProps {
/** The `ComboboxInput` and `ComboboxFlyout`. */
children: ReactNode;
/** The initial value of the input.
* @defaultValue ''
*/
initialValue?: string;
/** The current value of the combobox. */
value?: string;
/** Handler to be called whenever `value` changes. */
onChange?: (newValue: string) => void;
/** Handler to be called whenever `enter` is pressed or a value is selected.
*/
onSubmit?: (value: string) => void;
/**
* * Removes the component from the page tab order.
* * Adds styling to the ComboboxInput to indicate that it is disabled.
* * Closes the flyout.
* @defaultValue false
*/
isDisabled?: boolean;
/** Tells the screen reader that the `ComboboxInput` is invalid. Also adds styling to the `ComboboxInput` to indicate that it is invalid.
* * @defaultValue false
*/
isInvalid?: boolean;
/** Tells the screen reader that the `ComboboxInput` is required.
* * @defaultValue false
*/
isRequired?: boolean;
/** Indicates that new `ComboboxOption`s are loading. If this prop is used, be sure to set the `width` CSS property on the `ComboboxInput` so that the loading spinner doesn't make the input wider when `isLoading` is `true`.
* @defaultValue false
*/
isLoading?: boolean;
/** Controls the open state of the flyout. */
isOpen?: boolean;
/** Handler to be called whenever the open state changes. */
onIsOpenChange?: (shouldOpen: boolean) => void;
/** Forwarded to the `ComboboxInput` and `ComboboxFlyout`. */
'aria-label'?: string;
/** Forwarded to the `ComboboxInput` and `ComboboxFlyout`. */
'aria-labelledby'?: string;
/** Forwarded to sub-components with the following suffixes:
* * `ComboboxInput`: `-input`
* * `ComboboxFlyout`: `-flyout`
* * `ComboboxGroup`: `-group-