/* flyout-menu-item-trigger.tsx generated by @compiled/babel-plugin v0.38.1 */
import "./flyout-menu-item-trigger.compiled.css";
import * as React from 'react';
import { ax, ix } from "@compiled/react/runtime";
import { forwardRef } from 'react';
import mergeRefs from '@atlaskit/ds-lib/merge-refs';
import ChevronRightIcon from '@atlaskit/icon/core/chevron-right';
import { fg } from '@atlaskit/platform-feature-flags';
import { PopupTrigger } from '@atlaskit/popup/experimental';
import { MenuItemBase } from '../menu-item';
var elemAfterStyles = {
  root: "_18zr12x7 _1tz3r0mg"
};
/**
 * __FlyoutMenuItemTrigger__
 *
 * The button that toggles the flyout menu.
 */
export var FlyoutMenuItemTrigger = /*#__PURE__*/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(PopupTrigger, null, function (_ref2) {
    var ref = _ref2.ref,
      ariaControls = _ref2['aria-controls'],
      ariaExpanded = _ref2['aria-expanded'],
      ariaHasPopup = _ref2['aria-haspopup'];
    return /*#__PURE__*/React.createElement(MenuItemBase, {
      testId: testId,
      ref: mergeRefs([ref, forwardedRef]),
      visualContentRef: visualContentRef,
      elemBefore: elemBefore,
      elemAfter: /*#__PURE__*/React.createElement("div", {
        className: ax([elemAfterStyles.root])
      }, /*#__PURE__*/React.createElement(ChevronRightIcon, {
        label: "",
        color: 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);
  });
});