/* flyout-menu-item-trigger.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.FlyoutMenuItemTrigger = void 0;
require("./flyout-menu-item-trigger.compiled.css");
var _react = _interopRequireWildcard(require("react"));
var React = _react;
var _runtime = require("@compiled/react/runtime");
var _mergeRefs = _interopRequireDefault(require("@atlaskit/ds-lib/merge-refs"));
var _chevronRight = _interopRequireDefault(require("@atlaskit/icon/core/chevron-right"));
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
var _experimental = require("@atlaskit/popup/experimental");
var _menuItem = require("../menu-item");
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 elemAfterStyles = {
  root: "_18zr12x7 _1tz3r0mg"
};
/**
 * __FlyoutMenuItemTrigger__
 *
 * The button that toggles the flyout menu.
 */
var FlyoutMenuItemTrigger = exports.FlyoutMenuItemTrigger = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, forwardedRef) {
  var children = _ref.children,
    elemBefore = _ref.elemBefore,
    onClick = _ref.onClick,
    isSelected = _ref.isSelected,
    interactionName = _ref.interactionName,
    testId = _ref.testId,
    isContentTooltipDisabled = _ref.isContentTooltipDisabled,
    visualContentRef = _ref.visualContentRef,
    isDragging = _ref.isDragging,
    hasDragIndicator = _ref.hasDragIndicator,
    dropIndicator = _ref.dropIndicator;
  return /*#__PURE__*/React.createElement(_experimental.PopupTrigger, null, function (_ref2) {
    var ref = _ref2.ref,
      ariaControls = _ref2['aria-controls'],
      ariaExpanded = _ref2['aria-expanded'],
      ariaHasPopup = _ref2['aria-haspopup'];
    return /*#__PURE__*/React.createElement(_menuItem.MenuItemBase, {
      testId: testId,
      ref: (0, _mergeRefs.default)([ref, forwardedRef]),
      visualContentRef: visualContentRef,
      elemBefore: elemBefore,
      elemAfter: /*#__PURE__*/React.createElement("div", {
        className: (0, _runtime.ax)([elemAfterStyles.root])
      }, /*#__PURE__*/React.createElement(_chevronRight.default, {
        label: "",
        color: (0, _platformFeatureFlags.fg)('platform_dst_flyout_menu_item_chevron_color') ? 'currentColor' : "var(--ds-icon, #44546F)",
        size: "small"
      })),
      onClick: onClick,
      ariaControls: ariaControls,
      ariaExpanded: ariaExpanded,
      ariaHasPopup: ariaHasPopup,
      interactionName: interactionName,
      isContentTooltipDisabled: isContentTooltipDisabled,
      isSelected: isSelected,
      isDragging: isDragging,
      hasDragIndicator: hasDragIndicator,
      dropIndicator: dropIndicator
    }, children);
  });
});