"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = exports.TabPanel = void 0;

var _propTypes = _interopRequireDefault(require("prop-types"));

var _react = _interopRequireDefault(require("react"));

var _classnames = _interopRequireDefault(require("classnames"));

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var TabPanel = function TabPanel(props) {
  var classes = (0, _classnames.default)('ds-c-tabs__panel', props.className);
  return /*#__PURE__*/_react.default.createElement("div", {
    "aria-labelledby": props.tabId,
    "aria-hidden": !props.selected,
    "aria-disabled": props.disabled,
    className: classes,
    id: props.id,
    role: "tabpanel"
  }, props.children);
}; // Set component name to make child.type.displayName available to other components (eg. Tab)


exports.TabPanel = TabPanel;
TabPanel.propTypes = {
  children: _propTypes.default.node.isRequired,

  /**
     * Additional classes to be added to the root element.
     */
  className: _propTypes.default.string,

  /**
     * A unique `id`, to be used on the rendered panel element.
     */
  id: _propTypes.default.string.isRequired,
  selected: _propTypes.default.bool,
  disabled: _propTypes.default.bool,

  /**
     * The associated tab's label. Only applicable when the panel is a
     * child of `Tabs`.
     */
  tab: _propTypes.default.string,

  /**
     * Additional classes for the associated tab. Only applicable when the panel
     * is a child of `Tabs`.
     */
  tabClassName: _propTypes.default.string,

  /**
     * The associated tab's `href`. Only applicable when the panel is a
     * child of `Tabs`.
     */
  tabHref: _propTypes.default.string,

  /**
     * The `id` of the associated `Tab`. Used for the `aria-labelledby` attribute.
     */

  /* though it's ultimately being passed in.*/

  /* this id within the Tabs component. Otherwise React will yell at you even*/

  /* tabId is actually required, but it's not marked here since we generate*/
  tabId: _propTypes.default.string
};
TabPanel.displayName = 'TabPanel';
TabPanel.defaultProps = {
  selected: false
};
var _default = TabPanel;
exports.default = _default;