var _excluded = ["children", "isActive", "onClick", "onMouseEnter", "onMouseLeave", "title"];
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
import React from 'react';
import { IconChevronRight } from '@defencedigital/icon-library';
import { StyledItem } from './partials/StyledItem';
import { StyledItemContent } from './partials/StyledItemContent';
import { StyledItemTitle } from './partials/StyledItemTitle';
import { StyledItemDescription } from './partials/StyledItemDescription';
import { StyledItemAction } from './partials/StyledItemAction';
import { useExternalId } from '../../hooks/useExternalId';
export var ListItem = function ListItem(_ref) {
  var children = _ref.children,
    isActive = _ref.isActive,
    onClick = _ref.onClick,
    onMouseEnter = _ref.onMouseEnter,
    onMouseLeave = _ref.onMouseLeave,
    title = _ref.title,
    rest = _objectWithoutProperties(_ref, _excluded);
  var titleId = useExternalId('list-title');
  return /*#__PURE__*/React.createElement(StyledItem, _extends({
    $isInactive: isActive === false,
    "aria-labelledby": titleId
  }, rest), /*#__PURE__*/React.createElement(StyledItemContent, {
    onClick: onClick,
    onMouseEnter: onMouseEnter,
    onMouseLeave: onMouseLeave
  }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(StyledItemTitle, {
    id: titleId
  }, title), /*#__PURE__*/React.createElement(StyledItemDescription, null, children)), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(StyledItemAction, null, /*#__PURE__*/React.createElement(IconChevronRight, null)))));
};
ListItem.displayName = 'ListItem';