'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

var _tslib = require('../../_virtual/_tslib.js');
var React = require('react');
var utils = require('./utils.js');

function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }

var React__default = /*#__PURE__*/_interopDefaultLegacy(React);

/**
 * When creating custom elements we need to ensure the accessibility
 * using both mouse and keyboard events
 * This component is a div element with the necessary controls to assura that
 */
const Interactive = React.forwardRef((_a, ref) => {
    var { children, onClick } = _a, props = _tslib.__rest(_a, ["children", "onClick"]);
    return (React__default['default'].createElement("div", Object.assign({ role: "button" }, props, { ref: ref, tabIndex: 0, onClick: onClick, onKeyDown: utils.handleInteractiveKeyEvent(onClick) }), children));
});

exports.Interactive = Interactive;
