/* search.tsx generated by @compiled/babel-plugin v0.38.1 */
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
var _typeof = require("@babel/runtime/helpers/typeof");
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.Search = void 0;
require("./search.compiled.css");
var _runtime = require("@compiled/react/runtime");
var _react = _interopRequireWildcard(require("react"));
var _css = require("@atlaskit/css");
var _search = _interopRequireDefault(require("@atlaskit/icon/core/search"));
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
var _compiled = require("@atlaskit/primitives/compiled");
var _migration = require("./themed/migration");
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
var styles = {
  root: "_2rko12b0 _1rjcze3t _18zr12x7 _yv0e1mfv _4cvr1h6o _bfhk1j9a _vchhusvi _80om1kdv _1e0cglyw _4t3izwfg _p12f1kvu _1bsb1osq _irr3l4ek _1di6r01l _114b11p5",
  buttonText: "_yyhyjvu9 _1ii7kb7n",
  iconBefore: "_yyhykb7n _1ii7kb7n _1e0c1txw",
  elemAfter: "_yyhy11wp _1ii7kb7n _1e0c1txw",
  fullHeightSidebar: "_p12fktbq"
};

/**
 * __Search__
 *
 * The search element for the top navigation.
 */
var Search = exports.Search = function Search(_ref) {
  var label = _ref.label,
    onClick = _ref.onClick,
    _ref$iconBefore = _ref.iconBefore,
    IconBefore = _ref$iconBefore === void 0 ? _search.default : _ref$iconBefore,
    elemAfter = _ref.elemAfter,
    interactionName = _ref.interactionName,
    ariaHaspopup = _ref['aria-haspopup'];
  return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, /*#__PURE__*/_react.default.createElement(_compiled.Pressable, {
    style: {
      // To win the specificity war against Emotion we move this into inline styles
      // When Emotion has been stripped from the Design System move this to Compiled.
      // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
      cursor: 'text',
      border: "var(--ds-border-width, 1px)".concat(" solid ", "var(--ds-border-input, #8C8F97)")
    },
    onClick: onClick,
    xcss: (0, _css.cx)(styles.root, (0, _platformFeatureFlags.fg)('navx-full-height-sidebar') && styles.fullHeightSidebar),
    interactionName: interactionName,
    "aria-haspopup": ariaHaspopup
  }, /*#__PURE__*/_react.default.createElement("span", {
    className: (0, _runtime.ax)([styles.iconBefore])
  }, /*#__PURE__*/_react.default.createElement(IconBefore, {
    color: "var(--ds-icon-subtle, #505258)",
    spacing: "spacious",
    label: ""
  })), /*#__PURE__*/_react.default.createElement("div", {
    className: (0, _runtime.ax)([styles.buttonText])
  }, /*#__PURE__*/_react.default.createElement(_compiled.Text, {
    color: "color.text.subtlest"
  }, label)), elemAfter && /*#__PURE__*/_react.default.createElement("span", {
    className: (0, _runtime.ax)([styles.elemAfter])
  }, elemAfter)), /*#__PURE__*/_react.default.createElement(_compiled.Show, {
    below: "xs"
  }, /*#__PURE__*/_react.default.createElement(_migration.IconButton, {
    label: label,
    appearance: "subtle",
    icon: _search.default,
    onClick: onClick,
    interactionName: interactionName,
    "aria-haspopup": ariaHaspopup
  })));
};