"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
exports.__esModule = true;
exports.default = void 0;
var _react = _interopRequireDefault(require("react"));
var _CloseButton = _interopRequireDefault(require("../CloseButton"));
var _ = require("..");
var _TopBanner = require("./TopBanner.constants");
var _ActionLink = require("./components/ActionLink/ActionLink");
var _ActionButton = require("./components/ActionButton/ActionButton");
var _TopBannerSt = require("./TopBanner.st.css.js");
var _ZIndex = require("../common/ZIndex");
var _jsxFileName = "/home/builduser/work/57e038ea7326c1ec/packages/wix-design-system/dist/cjs/TopBanner/TopBanner.tsx";
var TopBanner = _ref => {
  var {
    dismissible = true,
    dismissLabel,
    zIndex,
    position = 'static',
    onDismiss,
    action,
    dataHook,
    className,
    children
  } = _ref;
  return /*#__PURE__*/_react.default.createElement("div", {
    "data-hook": dataHook,
    role: "status",
    "aria-live": "polite",
    style: {
      zIndex: zIndex !== null && zIndex !== void 0 ? zIndex : _ZIndex.ZIndex.topBanner
    },
    className: (0, _TopBannerSt.st)(_TopBannerSt.classes.root, {
      dismissible,
      position
    }, className),
    __self: void 0,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 22,
      columnNumber: 3
    }
  }, /*#__PURE__*/_react.default.createElement("div", {
    className: _TopBannerSt.classes.contentContainer,
    __self: void 0,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 29,
      columnNumber: 5
    }
  }, /*#__PURE__*/_react.default.createElement(_.Text, {
    light: true,
    size: "medium",
    weight: "normal",
    dataHook: _TopBanner.dataHooks.content,
    __self: void 0,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 30,
      columnNumber: 7
    }
  }, children), action && /*#__PURE__*/_react.default.createElement("div", {
    className: _TopBannerSt.classes.action,
    "data-hook": _TopBanner.dataHooks.action,
    __self: void 0,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 34,
      columnNumber: 9
    }
  }, action)), dismissible && /*#__PURE__*/_react.default.createElement(_CloseButton.default, {
    dataHook: _TopBanner.dataHooks.dismissButton,
    skin: "lightFilled",
    size: "small",
    "aria-label": dismissLabel,
    onClick: onDismiss,
    __self: void 0,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 41,
      columnNumber: 7
    }
  }));
};
TopBanner.displayName = 'TopBanner';
TopBanner.ActionButton = _ActionButton.ActionButton;
TopBanner.ActionLink = _ActionLink.ActionLink;
var _default = exports.default = TopBanner;
//# sourceMappingURL=TopBanner.js.map