'use strict';

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

var _tslib = require('../../../_virtual/_tslib.js');
var React = require('react');
var styles = require('./styles.js');
var index = require('../../../utils/index.js');
var index$1 = require('../../Button/index.js');
var utils = require('./utils.js');
var ToastIcon = require('./ToastIcon.js');

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

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

function ToastCompact(_a) {
    var { className, message, variant = 'neutral', icon, primaryAction } = _a, props = _tslib.__rest(_a, ["className", "message", "variant", "icon", "primaryAction"]);
    const appendTestId = index.getId(props['data-testid']);
    const appendTrackId = index.getId(props['data-trackid']);
    return (React__default['default'].createElement(styles.ToastCompactWrapper, { className: className, variant: variant, "data-testid": appendTestId('wrapper'), "data-trackid": appendTrackId('wrapper'), "aria-label": props['aria-label'], role: utils.getAriaRole(variant) },
        React__default['default'].createElement(styles.CompactWrapper, null,
            variant === 'neutral' && icon ? icon : React__default['default'].createElement(ToastIcon['default'], { variant: variant }),
            React__default['default'].createElement(styles.MessageWrapper, null, message),
            primaryAction && (React__default['default'].createElement(styles.CompactActionWrapper, null,
                React__default['default'].createElement(index$1.Button, { size: "xSmall", variant: "inverse-ghost", onClick: primaryAction.onClick, "data-testid": appendTestId('action-button') }, primaryAction.text))))));
}

exports.ToastCompact = ToastCompact;
