UNPKG

@wordpress/block-editor

Version:
51 lines (49 loc) 2.19 kB
"use strict"; var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; var __hasOwnProp = Object.prototype.hasOwnProperty; var __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true }); }; var __copyProps = (to, from, except, desc) => { if (from && typeof from === "object" || typeof from === "function") { for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); } return to; }; var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); // packages/block-editor/src/components/list-view/expander.js var expander_exports = {}; __export(expander_exports, { default: () => ListViewExpander }); module.exports = __toCommonJS(expander_exports); var import_icons = require("@wordpress/icons"); var import_i18n = require("@wordpress/i18n"); var import_jsx_runtime = require("react/jsx-runtime"); function ListViewExpander({ onClick }) { 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. /* @__PURE__ */ (0, import_jsx_runtime.jsx)( "span", { className: "block-editor-list-view__expander", onClick: (event) => onClick(event, { forceToggle: true }), "aria-hidden": "true", "data-testid": "list-view-expander", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.Icon, { icon: (0, import_i18n.isRTL)() ? import_icons.chevronLeftSmall : import_icons.chevronRightSmall }) } ) ); } //# sourceMappingURL=expander.js.map