@mskcc/carbon-react
Version:
Carbon react components for the MSKCC DSM
65 lines (64 loc) • 2.66 kB
TypeScript
/**
* MSKCC DSM 2021, 2023
*/
import PropTypes from 'prop-types';
import { MouseEventHandler, PropsWithChildren } from 'react';
import { TableRowProps } from './TableRow';
interface TableExpandRowProps extends PropsWithChildren<TableRowProps> {
/**
* Specify the string read by a voice reader when the expand trigger is
* focused
*/
ariaLabel: string;
/**
* The id of the matching th node in the table head. Addresses a11y concerns outlined here: https://www.ibm.com/able/guidelines/ci162/info_and_relationships.html and https://www.w3.org/TR/WCAG20-TECHS/H43
*/
expandHeader?: string;
/**
* The description of the chevron right icon, to be put in its SVG `<title>` element.
*/
expandIconDescription?: string;
/**
* Specify whether this row is expanded or not. This helps coordinate data
* attributes so that `TableExpandRow` and `TableExpandedRow` work together
*/
isExpanded: boolean;
/**
* Hook for when a listener initiates a request to expand the given row
*/
onExpand: MouseEventHandler<HTMLButtonElement>;
}
declare const TableExpandRow: {
({ ariaLabel, className: rowClassName, children, isExpanded, onExpand, expandIconDescription, isSelected, expandHeader, ...rest }: TableExpandRowProps): JSX.Element;
propTypes: {
/**
* Specify the string read by a voice reader when the expand trigger is
* focused
*/
ariaLabel: PropTypes.Validator<string>;
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
className: PropTypes.Requireable<string>;
/**
* The id of the matching th node in the table head. Addresses a11y concerns outlined here: https://www.ibm.com/able/guidelines/ci162/info_and_relationships.html and https://www.w3.org/TR/WCAG20-TECHS/H43
*/
expandHeader: PropTypes.Requireable<string>;
/**
* The description of the chevron right icon, to be put in its SVG `<title>` element.
*/
expandIconDescription: PropTypes.Requireable<string>;
/**
* Specify whether this row is expanded or not. This helps coordinate data
* attributes so that `TableExpandRow` and `TableExpandedRow` work together
*/
isExpanded: PropTypes.Validator<boolean>;
/**
* Specify if the row is selected
*/
isSelected: PropTypes.Requireable<boolean>;
/**
* Hook for when a listener initiates a request to expand the given row
*/
onExpand: PropTypes.Validator<(...args: any[]) => any>;
};
};
export default TableExpandRow;