packageDocumentation module import "./ExpansionToggle.scss" ; import classnames from "classnames" ; import * as React from "react" ; import { CommonProps } from "../utils/Props" ; import { UiCore } from "../UiCore" ; public export interface ExpansionToggleProps extends CommonProps { isExpanded ? : boolean ; onClick ? : ( e : React . MouseEvent < HTMLDivElement > ) => void ; [ "data-testid" ] ? : string ; } public export class ExpansionToggle extends React . PureComponent < ExpansionToggleProps > { public override render ( ) { const className = classnames ( "core-tree-expansionToggle" , this . props . isExpanded && "is-expanded" , this . props . className ) ; const label = UiCore . translate ( this . props . isExpanded ? "tree.collapse" : "tree.expand" ) ; return ( < div onClick = { this . props . onClick } className = { className } style = { this . props . style } data - testid = { this . props [ "data-testid" ] } role = "button" tabIndex = { - 1 } aria - label = { label } > < i className = "toggle icon icon-chevron-right" / > < /div>); } }