UNPKG

@gechiui/block-editor

Version:
31 lines (30 loc) 1.11 kB
import { createElement } from "@gechiui/element"; /** * GeChiUI dependencies */ import { chevronRightSmall, Icon } from '@gechiui/icons'; export default function ListViewExpander(_ref) { let { onClick } = _ref; return (// Keyboard events are handled by TreeGrid see: components/src/tree-grid/index.js // // The expander component is implemented as a pseudo element in the w3 example // https://www.w3.org/TR/wai-aria-practices/examples/treegrid/treegrid-1.html // // We've mimicked this by adding an icon with aria-hidden set to true to hide this from the accessibility tree. // For the current tree grid implementation, please do not try to make this a button. // // eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions createElement("span", { className: "block-editor-list-view__expander", onClick: event => onClick(event, { forceToggle: true }), "aria-hidden": "true" }, createElement(Icon, { icon: chevronRightSmall })) ); } //# sourceMappingURL=expander.js.map