UNPKG

@wordpress/components

Version:
38 lines (37 loc) • 1.51 kB
"use strict"; Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } }); let _wordpress_compose = require("@wordpress/compose"); let _wordpress_element = require("@wordpress/element"); let __use_validate_tree_grid_structure_ts = require("./use-validate-tree-grid-structure.cjs"); let react_jsx_runtime = require("react/jsx-runtime"); // packages/components/src/tree-grid/row.tsx function UnforwardedTreeGridRow({ children, level, positionInSet, setSize, isExpanded, ...props }, ref) { const rowRef = (0, _wordpress_element.useRef)(null); const refs = (0, _wordpress_compose.useMergeRefs)([rowRef, ref]); (0, __use_validate_tree_grid_structure_ts.useValidateTreeGridStructure)("TreeGridRow", rowRef); return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("tr", { ...props, ref: refs, role: "row", "aria-level": level, "aria-posinset": positionInSet, "aria-setsize": setSize, "aria-expanded": isExpanded, children }); } /** * `TreeGridRow` is used to create a tree hierarchy. * It is not a visually styled component, but instead helps with adding * keyboard navigation and roving tab index behaviors to tree grid structures. * * @see {@link https://www.w3.org/TR/wai-aria-practices/examples/treegrid/treegrid-1.html} */ const TreeGridRow = (0, _wordpress_element.forwardRef)(UnforwardedTreeGridRow); TreeGridRow.displayName = "TreeGridRow"; exports.TreeGridRow = TreeGridRow; exports.default = TreeGridRow; //# sourceMappingURL=row.cjs.map