"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
exports.__esModule = true;
exports.default = void 0;
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
var _react = _interopRequireDefault(require("react"));
var _NavigationToastSt = require("./NavigationToast.st.css.js");
var _Toast = _interopRequireDefault(require("../Toast"));
var _TextButton = _interopRequireDefault(require("../TextButton"));
var _wixUiIconsCommon = require("@wix/wix-ui-icons-common");
var _useToastTimeout = require("../StatusToast/hooks/useToastTimeout");
var _NavigationToast = require("./NavigationToast.constants");
var _WixDesignSystemIconThemeProvider = require("../WixDesignSystemIconThemeProvider");
var _excluded = ["children", "dataHook", "prefixIcon", "onAction", "duration", "dismissible"];
var _jsxFileName = "/home/builduser/work/57e038ea7326c1ec/packages/wix-design-system/dist/cjs/NavigationToast/NavigationToast.tsx";
var NavigationToast = _ref => {
  var {
      children,
      dataHook,
      prefixIcon,
      onAction,
      duration = 0,
      dismissible = true
    } = _ref,
    rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
  var icons = (0, _WixDesignSystemIconThemeProvider.useIcons)('NavigationToast', {
    ArrowBentUpLeft: _wixUiIconsCommon.ArrowBentUpLeft
  });
  var defaultPrefixIcon = /*#__PURE__*/_react.default.createElement(icons.ArrowBentUpLeft, {
    __self: void 0,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 24,
      columnNumber: 29
    }
  });
  (0, _useToastTimeout.useToastTimeout)(duration || undefined, rest.onDismiss);
  return /*#__PURE__*/_react.default.createElement(_Toast.default, (0, _extends2.default)({
    dataHook: dataHook,
    className: _NavigationToastSt.classes.toast,
    dismissible: dismissible
  }, rest, {
    __self: void 0,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 29,
      columnNumber: 5
    }
  }), /*#__PURE__*/_react.default.createElement("div", {
    onClick: onAction,
    className: _NavigationToastSt.classes.root,
    "data-hook": _NavigationToast.dataHooks.actionContainer,
    __self: void 0,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 35,
      columnNumber: 7
    }
  }, /*#__PURE__*/_react.default.createElement(_TextButton.default, {
    className: _NavigationToastSt.classes.actionButton,
    skin: "light",
    size: "medium",
    weight: "normal",
    underline: "onHover",
    prefixIcon: prefixIcon === undefined ? defaultPrefixIcon : prefixIcon || undefined,
    dataHook: _NavigationToast.dataHooks.text,
    __self: void 0,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 40,
      columnNumber: 9
    }
  }, children)));
};
NavigationToast.displayName = 'NavigationToast';
var _default = exports.default = NavigationToast;
//# sourceMappingURL=NavigationToast.js.map