"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = exports.TreeGridCell = void 0;
var _element = require("@wordpress/element");
var _item = _interopRequireDefault(require("./item"));
var _jsxRuntime = require("react/jsx-runtime");
/**
 * WordPress dependencies
 */

/**
 * Internal dependencies
 */

function UnforwardedTreeGridCell({
  children,
  withoutGridItem = false,
  ...props
}, ref) {
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("td", {
    ...props,
    role: "gridcell",
    children: withoutGridItem ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
      children: children
    }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_item.default, {
      ref: ref,
      children: children
    })
  });
}

/**
 * `TreeGridCell` 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 TreeGridCell = exports.TreeGridCell = (0, _element.forwardRef)(UnforwardedTreeGridCell);
var _default = exports.default = TreeGridCell;
//# sourceMappingURL=cell.js.map