@carbon/react
Version:
React components for the Carbon Design System
296 lines (295 loc) • 9.92 kB
TypeScript
/**
* 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, type ReactNode, type KeyboardEvent, type ChangeEvent, type MouseEvent } from 'react';
import PropTypes from 'prop-types';
type DivAttrs = HTMLAttributes<HTMLDivElement>;
export interface StructuredListWrapperProps extends DivAttrs {
/**
* Specify a label to be read by screen readers on the container node
*/
'aria-label'?: string;
/**
* Provide the contents of your StructuredListWrapper
*/
children?: ReactNode;
/**
* Specify an optional className to be applied to the container node
*/
className?: string;
/**
* Specify if structured list is condensed, default is false
*/
isCondensed?: boolean;
/**
* Specify if structured list is flush, default is false
*/
isFlush?: boolean;
/**
* Specify whether your StructuredListWrapper should have selections
*/
selection?: boolean;
/**
* Specify which row will be selected initially
*/
selectedInitialRow?: string;
}
export declare function StructuredListWrapper(props: StructuredListWrapperProps): import("react/jsx-runtime").JSX.Element;
export declare namespace StructuredListWrapper {
var propTypes: {
/**
* Specify a label to be read by screen readers on the container node
*/
"aria-label": PropTypes.Requireable<string>;
/**
* Deprecated, please use `aria-label` instead.
* Specify a label to be read by screen readers on the container note.
*/
ariaLabel: (props: Record<string, any>, propName: string, componentName: string, ...rest: any[]) => any;
/**
* Provide the contents of your StructuredListWrapper
*/
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
/**
* Specify an optional className to be applied to the container node
*/
className: PropTypes.Requireable<string>;
/**
* Specify if structured list is condensed, default is false
*/
isCondensed: PropTypes.Requireable<boolean>;
/**
* Specify if structured list is flush, not valid for selection variant, default is false
*/
isFlush: PropTypes.Requireable<boolean>;
/**
* Specify whether your StructuredListWrapper should have selections
*/
selection: PropTypes.Requireable<boolean>;
/**
* Specify which row will be selected initially
*/
selectedInitialRow: PropTypes.Requireable<string>;
};
}
export interface StructuredListHeadProps extends DivAttrs {
/**
* Provide the contents of your StructuredListHead
*/
children?: ReactNode;
/**
* Specify an optional className to be applied to the node
*/
className?: string;
}
export declare function StructuredListHead(props: any): import("react/jsx-runtime").JSX.Element;
export declare namespace StructuredListHead {
var propTypes: {
/**
* Provide the contents of your StructuredListHead
*/
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
/**
* Specify an optional className to be applied to the node
*/
className: PropTypes.Requireable<string>;
};
}
export interface StructuredListBodyProps extends DivAttrs {
/**
* Provide the contents of your StructuredListBody
*/
children?: ReactNode;
/**
* Specify an optional className to be applied to the container node
*/
className?: string;
head?: boolean;
/**
* Provide a handler that is invoked on the key down event for the control
*/
onKeyDown?(event: KeyboardEvent): void;
}
export declare function StructuredListBody(props: StructuredListBodyProps): import("react/jsx-runtime").JSX.Element;
export declare namespace StructuredListBody {
var propTypes: {
/**
* Provide the contents of your StructuredListBody
*/
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
/**
* Specify an optional className to be applied to the container node
*/
className: PropTypes.Requireable<string>;
head: PropTypes.Requireable<boolean>;
/**
* Provide a handler that is invoked on the key down event for the control
*/
onKeyDown: PropTypes.Requireable<(...args: any[]) => any>;
};
}
export interface StructuredListRowProps extends DivAttrs {
/**
* Provide the contents of your StructuredListRow
*/
children?: ReactNode;
/**
* Specify an optional className to be applied to the container node
*/
className?: string;
/**
* Specify whether your StructuredListRow should be used as a header row
*/
head?: boolean;
/**
* Provide a handler that is invoked on the click
*/
onClick?(event: MouseEvent): void;
/**
* Provide a handler that is invoked on the key down event for the control
*/
onKeyDown?(event: KeyboardEvent): void;
/**
* Mark if this row should be selectable
*/
selection?: boolean;
/**
* Specify row id so that it can be used for initial selection
*/
id?: string;
}
export declare function StructuredListRow(props: StructuredListRowProps): import("react/jsx-runtime").JSX.Element;
export declare namespace StructuredListRow {
var propTypes: {
/**
* Provide the contents of your StructuredListRow
*/
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
/**
* Specify an optional className to be applied to the container node
*/
className: PropTypes.Requireable<string>;
/**
* Specify whether your StructuredListRow should be used as a header row
*/
head: PropTypes.Requireable<boolean>;
/**
* Specify whether a `<label>` should be used
*/
label: (props: Record<string, any>, propName: string, componentName: string, ...rest: any[]) => any;
/**
* Provide a handler that is invoked on the click
*/
onClick: PropTypes.Requireable<(...args: any[]) => any>;
/**
* Provide a handler that is invoked on the key down event for the control,
*/
onKeyDown: PropTypes.Requireable<(...args: any[]) => any>;
/**
* Mark if this row should be selectable
*/
selection: PropTypes.Requireable<boolean>;
/**
* Specify row id so that it can be used for initial selection
*/
id: PropTypes.Requireable<string>;
};
}
export interface StructuredListInputProps extends DivAttrs {
/**
* Specify an optional className to be applied to the input
*/
className?: string;
/**
* Specify a custom `id` for the input
*/
id?: string;
/**
* Provide a `name` for the input
*/
name?: string;
/**
* Provide an optional hook that is called each time the input is updated
*/
onChange?(event: ChangeEvent<HTMLInputElement>): void;
/**
* Provide a `title` for the input
*/
title?: string;
}
export declare function StructuredListInput(props: StructuredListInputProps): import("react/jsx-runtime").JSX.Element;
export declare namespace StructuredListInput {
var propTypes: {
/**
* Specify an optional className to be applied to the input
*/
className: PropTypes.Requireable<string>;
/**
* Specify whether the underlying input should be checked by default
*/
defaultChecked: (props: Record<string, any>, propName: string, componentName: string, ...rest: any[]) => any;
/**
* Specify a custom `id` for the input
*/
id: PropTypes.Requireable<string>;
/**
* Provide a `name` for the input
*/
name: PropTypes.Requireable<string>;
/**
* Provide an optional hook that is called each time the input is updated
*/
onChange: PropTypes.Requireable<(...args: any[]) => any>;
/**
* Provide a `title` for the input
*/
title: PropTypes.Requireable<string>;
/**
* Specify the value of the input
*/
value: (props: Record<string, any>, propName: string, componentName: string, ...rest: any[]) => any;
};
}
export interface StructuredListCellProps extends DivAttrs {
/**
* Provide the contents of your StructuredListCell
*/
children?: ReactNode;
/**
* Specify an optional className to be applied to the container node
*/
className?: string;
/**
* Specify whether your StructuredListCell should be used as a header cell
*/
head?: boolean;
/**
* Specify whether your StructuredListCell should have text wrapping
*/
noWrap?: boolean;
}
export declare function StructuredListCell(props: StructuredListCellProps): import("react/jsx-runtime").JSX.Element;
export declare namespace StructuredListCell {
var propTypes: {
/**
* Provide the contents of your StructuredListCell
*/
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
/**
* Specify an optional className to be applied to the container node
*/
className: PropTypes.Requireable<string>;
/**
* Specify whether your StructuredListCell should be used as a header cell
*/
head: PropTypes.Requireable<boolean>;
/**
* Specify whether your StructuredListCell should have text wrapping
*/
noWrap: PropTypes.Requireable<boolean>;
};
}
export {};