'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

var _extends = require('@babel/runtime/helpers/extends');
var _typeof = require('@babel/runtime/helpers/typeof');
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
var _slicedToArray = require('@babel/runtime/helpers/slicedToArray');
require('core-js/modules/es.symbol.js');
require('core-js/modules/es.array.concat.js');
require('core-js/modules/es.array.filter.js');
require('core-js/modules/es.object.get-own-property-descriptor.js');
require('core-js/modules/es.object.get-own-property-descriptors.js');
require('core-js/modules/es.object.keys.js');
require('core-js/modules/es.object.to-string.js');
require('core-js/modules/es.string.ends-with.js');
require('core-js/modules/web.dom-collections.for-each.js');
var React = require('react');
var classnames = require('classnames');
var PropTypes = require('prop-types');
var Button = require('../Button/Button.js');
var index = require('../ToggleTip/index.js');
var Settings = require('../../constants/Settings.js');
var usePopoverPositioning = require('../../hooks/usePopoverPositioning.js');
var iconsReact = require('@carbon/icons-react');

function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }

var _extends__default = /*#__PURE__*/_interopDefault(_extends);
var _typeof__default = /*#__PURE__*/_interopDefault(_typeof);
var _defineProperty__default = /*#__PURE__*/_interopDefault(_defineProperty);
var _slicedToArray__default = /*#__PURE__*/_interopDefault(_slicedToArray);
var React__default = /*#__PURE__*/_interopDefault(React);
var classnames__default = /*#__PURE__*/_interopDefault(classnames);
var PropTypes__default = /*#__PURE__*/_interopDefault(PropTypes);

function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty__default.default(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
var iotPrefix = Settings.settings.iotPrefix;
var FlyoutMenuDirection = {
  BottomStart: 'bottom-start',
  BottomEnd: 'bottom-end',
  TopStart: 'top-start',
  TopEnd: 'top-end',
  LeftStart: 'left-start',
  LeftEnd: 'left-end',
  RightStart: 'right-start',
  RightEnd: 'right-end'
};
var FlyoutMenuButtonSize = {
  Default: 'default',
  Field: 'field',
  Small: 'small'
};
var getButtonSize = function getButtonSize(size) {
  switch (size) {
    case FlyoutMenuButtonSize.Field:
      return 'xs';
    case FlyoutMenuButtonSize.Default:
      return 'md';
    case FlyoutMenuButtonSize.Small:
    default:
      return 'sm';
  }
};
var getTooltipDirection = function getTooltipDirection(direction) {
  switch (direction) {
    case FlyoutMenuDirection.TopStart:
    case FlyoutMenuDirection.TopEnd:
      return 'top';
    case FlyoutMenuDirection.RightStart:
    case FlyoutMenuDirection.RightEnd:
      return 'right';
    case FlyoutMenuDirection.LeftStart:
    case FlyoutMenuDirection.LeftEnd:
      return 'left';
    default:
      return 'bottom';
  }
};
var getTooltipPosition = function getTooltipPosition(menuDirection) {
  switch (menuDirection) {
    case FlyoutMenuDirection.TopStart:
    case FlyoutMenuDirection.TopEnd:
      return 'bottom';
    case FlyoutMenuDirection.RightStart:
    case FlyoutMenuDirection.RightEnd:
      return 'left';
    case FlyoutMenuDirection.LeftStart:
    case FlyoutMenuDirection.LeftEnd:
      return 'right';
    default:
      return 'top';
  }
};

// No need to do prop checks since these are alredy done in flyout

/* eslint-disable react/prop-types */
var DefaultFooter = function DefaultFooter(_ref) {
  var setIsOpen = _ref.setIsOpen,
    onCancel = _ref.onCancel,
    onApply = _ref.onApply,
    i18n = _ref.i18n;
  return /*#__PURE__*/React__default.default.createElement(React__default.default.Fragment, null, /*#__PURE__*/React__default.default.createElement(Button, {
    className: "".concat(iotPrefix, "--flyout-menu__cancel"),
    kind: "secondary"
    // TODO: in v3 pass testId from parent and insert here to allow it to be configurable
    // ie. `${testId}-menu-cancel`
    ,
    testId: "flyout-menu-cancel",
    onClick: function onClick() {
      setIsOpen(false);
      if (onCancel) {
        onCancel();
      }
    },
    "aria-label": i18n.cancelButtonText
  }, i18n.cancelButtonText), /*#__PURE__*/React__default.default.createElement(Button, {
    className: "".concat(iotPrefix, "--flyout-menu__submit"),
    "aria-label": i18n.applyButtonText
    // TODO: in v3 pass testId from parent and insert here to allow it to be configurable
    // ie. `${testId}-menu-cancel`
    ,
    testId: "flyout-menu-apply",
    onClick: function onClick() {
      setIsOpen(false);
      if (onApply) {
        onApply();
      }
    }
  }, i18n.applyButtonText));
};
/* eslint-enable react/prop-types */

var FlyoutMenu = function FlyoutMenu(_ref2) {
  var _buttonProps$size;
  var buttonProps = _ref2.buttonProps,
    buttonSize = _ref2.buttonSize,
    direction = _ref2.direction,
    menuOffset = _ref2.menuOffset,
    defaultOpen = _ref2.defaultOpen,
    iconDescription = _ref2.iconDescription,
    children = _ref2.children,
    disabled = _ref2.disabled,
    i18n = _ref2.i18n,
    light = _ref2.light,
    renderIcon = _ref2.renderIcon,
    testId = _ref2.testId,
    tooltipId = _ref2.tooltipId,
    tabIndex = _ref2.tabIndex,
    className = _ref2.className,
    tooltipClassName = _ref2.tooltipClassName,
    tooltipContentClassName = _ref2.tooltipContentClassName,
    passive = _ref2.passive,
    hideTooltip = _ref2.hideTooltip,
    CustomFooter = _ref2.customFooter,
    onApply = _ref2.onApply,
    onCancel = _ref2.onCancel,
    useAutoPositioning = _ref2.useAutoPositioning,
    isOpen = _ref2.isOpen,
    renderInPortal = _ref2.renderInPortal,
    style = _ref2.style;
  var _useState = React.useState(defaultOpen),
    _useState2 = _slicedToArray__default.default(_useState, 2),
    isControlledOpen = _useState2[0],
    setIsOpen = _useState2[1];
  var _useState3 = React.useState(getTooltipDirection(direction)),
    _useState4 = _slicedToArray__default.default(_useState3, 2),
    tooltipDirection = _useState4[0],
    setTooltipDirection = _useState4[1];
  var buttonRef = React.useRef(null);
  var updatedStyle = React.useMemo(function () {
    var _style$zIndex;
    return _objectSpread(_objectSpread({}, style), {}, {
      '--zIndex': (_style$zIndex = style.zIndex) !== null && _style$zIndex !== void 0 ? _style$zIndex : 0,
      '--top': style.scrollTop,
      '--left': style.scrollLeft
    });
  }, [style]);
  var getFlyoutMenuOffset = React__default.default.useCallback(function (tooltipElement, flyoutDirection, tooltipButtonElement, flipped) {
    var topOffset = 0;
    var leftOffset = -2;
    var caretWidth = 16;
    var caretHeight = 12;
    var borderWidth = 2;
    var tooltipContent = tooltipElement.querySelector('[role="dialog"]');
    var tooltipWidth = tooltipContent ? tooltipContent.getBoundingClientRect().width : 0;
    var tooltipHeight = tooltipContent ? tooltipContent.getBoundingClientRect().height : 0;
    var buttonWidth = buttonRef.current ? buttonRef.current.getBoundingClientRect().width : 0;
    var rtlOffset = buttonWidth;
    switch (flyoutDirection) {
      case FlyoutMenuDirection.LeftStart:
        topOffset = tooltipHeight / 2 - 2 * borderWidth - borderWidth;
        rtlOffset = 0;
        break;

      // off
      case FlyoutMenuDirection.LeftEnd:
        topOffset = -tooltipHeight / 2 + 2 * caretHeight + caretWidth - (48 - buttonWidth) + borderWidth;
        leftOffset = -caretWidth / 2;
        rtlOffset = 0;
        break;
      case FlyoutMenuDirection.RightStart:
        topOffset = tooltipHeight / 2 - caretHeight - 2 * borderWidth;
        rtlOffset = -rtlOffset;
        break;

      // off
      case FlyoutMenuDirection.RightEnd:
        topOffset = -tooltipHeight / 2 + 2 * caretWidth + borderWidth;
        rtlOffset = -rtlOffset;
        break;
      case FlyoutMenuDirection.TopStart:
        leftOffset = tooltipWidth / 2;
        topOffset = caretHeight;
        break;
      case FlyoutMenuDirection.TopEnd:
        leftOffset = -tooltipWidth / 2 + buttonWidth;
        topOffset = caretHeight - 2 * borderWidth;
        break;
      case FlyoutMenuDirection.BottomEnd:
        topOffset = -caretHeight + 2 * borderWidth;
        leftOffset = -tooltipWidth / 2 + buttonWidth;
        break;
      default:
        // Bottom Start
        leftOffset = tooltipWidth / 2;
        topOffset = -caretHeight - 2 * borderWidth;
    }
    if (document.dir === 'rtl') {
      leftOffset -= rtlOffset;
    }
    var propTop = 0;
    var propLeft = 0;
    if (typeof menuOffset === 'function') {
      var _menuOffset = menuOffset(tooltipElement, flyoutDirection, tooltipButtonElement, flipped),
        top = _menuOffset.top,
        left = _menuOffset.left;
      propTop = top;
      propLeft = left;
    } else if (_typeof__default.default(menuOffset) === 'object' && (menuOffset.hasOwnProperty('top') || menuOffset.hasOwnProperty('left'))) {
      var _menuOffset$top = menuOffset.top,
        _top = _menuOffset$top === void 0 ? 0 : _menuOffset$top,
        _menuOffset$left = menuOffset.left,
        _left = _menuOffset$left === void 0 ? 0 : _menuOffset$left;
      propTop = _top;
      propLeft = _left;
    }
    return {
      top: topOffset + propTop,
      left: leftOffset + propLeft
    };
  }, [menuOffset]);
  var _usePopoverPositionin = usePopoverPositioning.usePopoverPositioning({
      direction: direction,
      menuOffset: getFlyoutMenuOffset,
      useAutoPositioning: useAutoPositioning,
      parenElementTop: menuOffset === null || menuOffset === void 0 ? void 0 : menuOffset.inputTop,
      parentElementBottom: menuOffset === null || menuOffset === void 0 ? void 0 : menuOffset.inputBottom
    }),
    _usePopoverPositionin2 = _slicedToArray__default.default(_usePopoverPositionin, 2),
    adjustedDirection = _usePopoverPositionin2[1].adjustedDirection;
  React.useEffect(function () {
    if (useAutoPositioning) {
      setTooltipDirection(getTooltipDirection(adjustedDirection));
    } else {
      setTooltipDirection(getTooltipDirection(direction));
    }
  }, [adjustedDirection, direction, useAutoPositioning]);
  var Footer = CustomFooter ? /*#__PURE__*/React__default.default.createElement(CustomFooter, {
    setIsOpen: setIsOpen,
    isOpen: isControlledOpen
  }) : (testId === null || testId === void 0 ? void 0 : testId.endsWith('-datepicker-flyout')) === true ? '' : /*#__PURE__*/React__default.default.createElement(DefaultFooter, {
    setIsOpen: setIsOpen,
    onCancel: onCancel,
    onApply: onApply,
    i18n: i18n
  });
  return /*#__PURE__*/React__default.default.createElement("div", {
    "data-testid": "".concat(testId, "-container"),
    style: {
      '--tooltip-visibility': hideTooltip ? 'hidden' : 'visible'
    },
    ref: buttonRef,
    className: classnames__default.default(["".concat(iotPrefix, "--flyout-menu")], "".concat(iotPrefix, "--flyout-menu__").concat(tooltipDirection), _defineProperty__default.default(_defineProperty__default.default(_defineProperty__default.default(_defineProperty__default.default({}, "".concat(iotPrefix, "--flyout-menu__light"), light), "".concat(iotPrefix, "--flyout-menu__open"), isControlledOpen), "".concat(iotPrefix, "--flyout-menu__hide-icon-btn-tooltip"), !iconDescription), className, !!className))
  }, /*#__PURE__*/React__default.default.createElement("div", _extends__default.default({
    className: "".concat(iotPrefix, "--flyout-menu--tooltip-anchor")
  }, !renderInPortal ? {
    'data-floating-menu-container': true
  } : {}), /*#__PURE__*/React__default.default.createElement(index.ToggleTip, {
    disabled: disabled,
    className: classnames__default.default(tooltipClassName, "".concat(iotPrefix, "--flyout-menu--body"), "".concat(iotPrefix, "--flyout-menu--body__").concat(useAutoPositioning ? adjustedDirection : direction), _defineProperty__default.default(_defineProperty__default.default(_defineProperty__default.default({}, "".concat(iotPrefix, "--flyout-menu--body__light"), light), "".concat(iotPrefix, "--flyout-menu--body__open"), typeof isOpen === 'boolean' ? isOpen : isControlledOpen), "".concat(iotPrefix, "--flyout-menu--body__").concat(buttonSize), buttonSize !== 'default')),
    align: useAutoPositioning ? direction : undefined,
    iconDescription: iconDescription,
    "data-testid": testId,
    open: typeof isOpen === 'boolean' ? isOpen : isControlledOpen,
    direction: tooltipDirection,
    tooltipId: tooltipId,
    id: tooltipId // https://github.com/carbon-design-system/carbon/pull/6744
    ,
    tabIndex: tabIndex,
    useAutoPositioning: useAutoPositioning,
    action: !passive ? Footer : null,
    triggerBtn: /*#__PURE__*/React__default.default.createElement(Button, _extends__default.default({}, buttonProps, {
      "aria-label": iconDescription,
      iconDescription: iconDescription,
      className: classnames__default.default("".concat(iotPrefix, "--flyout-menu--trigger-button"), buttonProps === null || buttonProps === void 0 ? void 0 : buttonProps.className),
      tooltipPosition: getTooltipPosition(direction),
      disabled: disabled,
      hasIconOnly: true,
      kind: "ghost",
      testId: "".concat(testId, "-button"),
      size: (_buttonProps$size = buttonProps.size) !== null && _buttonProps$size !== void 0 ? _buttonProps$size : getButtonSize(buttonSize),
      renderIcon: renderIcon,
      onClick: function onClick() {
        if (typeof buttonProps.onClick === 'function') {
          buttonProps.onClick();
        }
        setIsOpen(!isControlledOpen);
      }
    })),
    content: /*#__PURE__*/React__default.default.createElement("div", {
      className: classnames__default.default("".concat(iotPrefix, "--flyout-menu--content"), tooltipContentClassName),
      style: updatedStyle
    }, children)
  })));
};
var propTypes = {
  tooltipId: PropTypes__default.default.string,
  /**
   * The ID of the trigger button.
   */
  triggerId: PropTypes__default.default.string,
  /**
   * Optional starting value for uncontrolled state
   */
  defaultOpen: PropTypes__default.default.bool,
  /**
   * Contents to put into the flyout menu.
   */
  children: PropTypes__default.default.node,
  /**
   * Flyout menu wrapper className
   */
  className: PropTypes__default.default.node,
  /**
   * The CSS class names of the flyout menu.
   */
  tooltipClassName: PropTypes__default.default.string,
  /**
   * The CSS class names of the tooltip content.
   */
  tooltipContentClassName: PropTypes__default.default.string,
  /**
   * whether to send focus to the tooltip when it's expanded
   */
  tooltipFocusTrap: PropTypes__default.default.bool,
  /**
   * Where to put the flyout menu, relative to the trigger UI.
   */
  direction: PropTypes__default.default.oneOf([FlyoutMenuDirection.BottomStart, FlyoutMenuDirection.BottomEnd, FlyoutMenuDirection.TopStart, FlyoutMenuDirection.TopEnd, FlyoutMenuDirection.LeftStart, FlyoutMenuDirection.LeftEnd, FlyoutMenuDirection.RightStart, FlyoutMenuDirection.RightEnd]),
  /**
   * The adjustment of the flyout position.
   */
  menuOffset: PropTypes__default.default.oneOfType([PropTypes__default.default.shape({
    top: PropTypes__default.default.number,
    left: PropTypes__default.default.number,
    inputTop: PropTypes__default.default.number,
    inputBottom: PropTypes__default.default.number
  }), PropTypes__default.default.func]),
  /**
   * The description of the default flyout icon
   */
  iconDescription: PropTypes__default.default.string.isRequired,
  /**
   * Optional prop to specify the tabIndex of the Tooltip
   */
  tabIndex: PropTypes__default.default.number,
  /**
   * Optional prop to specify the test id of the flyout
   */
  testId: PropTypes__default.default.string,
  /**
   * Will not render a footer
   */
  passive: PropTypes__default.default.bool,
  /**
   * Whether to show the iconDescription tooltip on the trigger button
   */
  hideTooltip: PropTypes__default.default.bool,
  /**
   * Content to be rendered in place of the normal footer (ie. MyComponent).
   */
  customFooter: PropTypes__default.default.elementType,
  /**
   * On Cancel button callback
   */
  onCancel: PropTypes__default.default.func,
  /**
   * On Apply button callback
   */
  onApply: PropTypes__default.default.func,
  /** Set of internationalized button names */
  i18n: PropTypes__default.default.shape({
    cancelButtonText: PropTypes__default.default.string,
    applyButtonText: PropTypes__default.default.string
  }),
  /**
   * Define the icon render to be rendered.
   * Can be a React component class
   */
  renderIcon: PropTypes__default.default.oneOfType([PropTypes__default.default.func, PropTypes__default.default.object]),
  /**
   *  Disable the button and tooltip
   */
  disabled: PropTypes__default.default.bool,
  buttonSize: PropTypes__default.default.string,
  light: PropTypes__default.default.bool,
  useAutoPositioning: PropTypes__default.default.bool,
  onChange: PropTypes__default.default.func,
  /** classes that can be passed to the button used for the flyout menu */
  buttonProps: PropTypes__default.default.shape({
    tooltipPosition: PropTypes__default.default.oneOf(['top', 'right', 'bottom', 'left']),
    size: PropTypes__default.default.oneOf(['sm', 'md', 'lg', 'xl']),
    className: PropTypes__default.default.string,
    onClick: PropTypes__default.default.func
  }),
  isOpen: PropTypes__default.default.bool,
  /** by default the flyout menu will render as a child, if you set this to true it will render outside of the current DOM in a portal */
  renderInPortal: PropTypes__default.default.bool,
  style: PropTypes__default.default.objectOf(PropTypes__default.default.oneOfType([PropTypes__default.default.string, PropTypes__default.default.number]))
};
var defaultProps = {
  buttonProps: {},
  renderIcon: iconsReact.SettingsAdjust,
  buttonSize: 'default',
  tooltipId: 'flyout-tooltip',
  triggerId: 'flyout-trigger-id',
  defaultOpen: false,
  children: undefined,
  className: undefined,
  tooltipClassName: '',
  tooltipContentClassName: '',
  tooltipFocusTrap: true,
  passive: false,
  hideTooltip: true,
  customFooter: null,
  tabIndex: 0,
  testId: 'flyout-menu',
  direction: FlyoutMenuDirection.BottomStart,
  menuOffset: {
    top: 0,
    left: 0,
    inputTop: null,
    inputBottom: null
  },
  i18n: {
    cancelButtonText: 'Cancel',
    applyButtonText: 'Apply'
  },
  isOpen: null,
  onCancel: null,
  onApply: null,
  disabled: false,
  light: true,
  useAutoPositioning: false,
  onChange: function onChange() {},
  renderInPortal: false,
  style: {}
};
FlyoutMenu.propTypes = propTypes;
FlyoutMenu.defaultProps = defaultProps;
FlyoutMenu.__docgenInfo = {
  "description": "",
  "methods": [],
  "displayName": "FlyoutMenu",
  "props": {
    "buttonProps": {
      "defaultValue": {
        "value": "{}",
        "computed": false
      },
      "description": "classes that can be passed to the button used for the flyout menu",
      "type": {
        "name": "shape",
        "value": {
          "tooltipPosition": {
            "name": "enum",
            "value": [{
              "value": "'top'",
              "computed": false
            }, {
              "value": "'right'",
              "computed": false
            }, {
              "value": "'bottom'",
              "computed": false
            }, {
              "value": "'left'",
              "computed": false
            }],
            "required": false
          },
          "size": {
            "name": "enum",
            "value": [{
              "value": "'sm'",
              "computed": false
            }, {
              "value": "'md'",
              "computed": false
            }, {
              "value": "'lg'",
              "computed": false
            }, {
              "value": "'xl'",
              "computed": false
            }],
            "required": false
          },
          "className": {
            "name": "string",
            "required": false
          },
          "onClick": {
            "name": "func",
            "required": false
          }
        }
      },
      "required": false
    },
    "renderIcon": {
      "defaultValue": {
        "value": "SettingsAdjust",
        "computed": true
      },
      "description": "Define the icon render to be rendered.\nCan be a React component class",
      "type": {
        "name": "union",
        "value": [{
          "name": "func"
        }, {
          "name": "object"
        }]
      },
      "required": false
    },
    "buttonSize": {
      "defaultValue": {
        "value": "'default'",
        "computed": false
      },
      "description": "",
      "type": {
        "name": "string"
      },
      "required": false
    },
    "tooltipId": {
      "defaultValue": {
        "value": "'flyout-tooltip'",
        "computed": false
      },
      "description": "",
      "type": {
        "name": "string"
      },
      "required": false
    },
    "triggerId": {
      "defaultValue": {
        "value": "'flyout-trigger-id'",
        "computed": false
      },
      "description": "The ID of the trigger button.",
      "type": {
        "name": "string"
      },
      "required": false
    },
    "defaultOpen": {
      "defaultValue": {
        "value": "false",
        "computed": false
      },
      "description": "Optional starting value for uncontrolled state",
      "type": {
        "name": "bool"
      },
      "required": false
    },
    "children": {
      "defaultValue": {
        "value": "undefined",
        "computed": true
      },
      "description": "Contents to put into the flyout menu.",
      "type": {
        "name": "node"
      },
      "required": false
    },
    "className": {
      "defaultValue": {
        "value": "undefined",
        "computed": true
      },
      "description": "Flyout menu wrapper className",
      "type": {
        "name": "node"
      },
      "required": false
    },
    "tooltipClassName": {
      "defaultValue": {
        "value": "''",
        "computed": false
      },
      "description": "The CSS class names of the flyout menu.",
      "type": {
        "name": "string"
      },
      "required": false
    },
    "tooltipContentClassName": {
      "defaultValue": {
        "value": "''",
        "computed": false
      },
      "description": "The CSS class names of the tooltip content.",
      "type": {
        "name": "string"
      },
      "required": false
    },
    "tooltipFocusTrap": {
      "defaultValue": {
        "value": "true",
        "computed": false
      },
      "description": "whether to send focus to the tooltip when it's expanded",
      "type": {
        "name": "bool"
      },
      "required": false
    },
    "passive": {
      "defaultValue": {
        "value": "false",
        "computed": false
      },
      "description": "Will not render a footer",
      "type": {
        "name": "bool"
      },
      "required": false
    },
    "hideTooltip": {
      "defaultValue": {
        "value": "true",
        "computed": false
      },
      "description": "Whether to show the iconDescription tooltip on the trigger button",
      "type": {
        "name": "bool"
      },
      "required": false
    },
    "customFooter": {
      "defaultValue": {
        "value": "null",
        "computed": false
      },
      "description": "Content to be rendered in place of the normal footer (ie. MyComponent).",
      "type": {
        "name": "elementType"
      },
      "required": false
    },
    "tabIndex": {
      "defaultValue": {
        "value": "0",
        "computed": false
      },
      "description": "Optional prop to specify the tabIndex of the Tooltip",
      "type": {
        "name": "number"
      },
      "required": false
    },
    "testId": {
      "defaultValue": {
        "value": "'flyout-menu'",
        "computed": false
      },
      "description": "Optional prop to specify the test id of the flyout",
      "type": {
        "name": "string"
      },
      "required": false
    },
    "direction": {
      "defaultValue": {
        "value": "'bottom-start'",
        "computed": false
      },
      "description": "Where to put the flyout menu, relative to the trigger UI.",
      "type": {
        "name": "enum",
        "value": [{
          "value": "'bottom-start'",
          "computed": false
        }, {
          "value": "'bottom-end'",
          "computed": false
        }, {
          "value": "'top-start'",
          "computed": false
        }, {
          "value": "'top-end'",
          "computed": false
        }, {
          "value": "'left-start'",
          "computed": false
        }, {
          "value": "'left-end'",
          "computed": false
        }, {
          "value": "'right-start'",
          "computed": false
        }, {
          "value": "'right-end'",
          "computed": false
        }]
      },
      "required": false
    },
    "menuOffset": {
      "defaultValue": {
        "value": "{\n  top: 0,\n  left: 0,\n  inputTop: null,\n  inputBottom: null,\n}",
        "computed": false
      },
      "description": "The adjustment of the flyout position.",
      "type": {
        "name": "union",
        "value": [{
          "name": "shape",
          "value": {
            "top": {
              "name": "number",
              "required": false
            },
            "left": {
              "name": "number",
              "required": false
            },
            "inputTop": {
              "name": "number",
              "required": false
            },
            "inputBottom": {
              "name": "number",
              "required": false
            }
          }
        }, {
          "name": "func"
        }]
      },
      "required": false
    },
    "i18n": {
      "defaultValue": {
        "value": "{\n  cancelButtonText: 'Cancel',\n  applyButtonText: 'Apply',\n}",
        "computed": false
      },
      "description": "Set of internationalized button names",
      "type": {
        "name": "shape",
        "value": {
          "cancelButtonText": {
            "name": "string",
            "required": false
          },
          "applyButtonText": {
            "name": "string",
            "required": false
          }
        }
      },
      "required": false
    },
    "isOpen": {
      "defaultValue": {
        "value": "null",
        "computed": false
      },
      "description": "",
      "type": {
        "name": "bool"
      },
      "required": false
    },
    "onCancel": {
      "defaultValue": {
        "value": "null",
        "computed": false
      },
      "description": "On Cancel button callback",
      "type": {
        "name": "func"
      },
      "required": false
    },
    "onApply": {
      "defaultValue": {
        "value": "null",
        "computed": false
      },
      "description": "On Apply button callback",
      "type": {
        "name": "func"
      },
      "required": false
    },
    "disabled": {
      "defaultValue": {
        "value": "false",
        "computed": false
      },
      "description": "Disable the button and tooltip",
      "type": {
        "name": "bool"
      },
      "required": false
    },
    "light": {
      "defaultValue": {
        "value": "true",
        "computed": false
      },
      "description": "",
      "type": {
        "name": "bool"
      },
      "required": false
    },
    "useAutoPositioning": {
      "defaultValue": {
        "value": "false",
        "computed": false
      },
      "description": "",
      "type": {
        "name": "bool"
      },
      "required": false
    },
    "onChange": {
      "defaultValue": {
        "value": "() => {}",
        "computed": false
      },
      "description": "",
      "type": {
        "name": "func"
      },
      "required": false
    },
    "renderInPortal": {
      "defaultValue": {
        "value": "false",
        "computed": false
      },
      "description": "by default the flyout menu will render as a child, if you set this to true it will render outside of the current DOM in a portal",
      "type": {
        "name": "bool"
      },
      "required": false
    },
    "style": {
      "defaultValue": {
        "value": "{}",
        "computed": false
      },
      "description": "",
      "type": {
        "name": "objectOf",
        "value": {
          "name": "union",
          "value": [{
            "name": "string"
          }, {
            "name": "number"
          }]
        }
      },
      "required": false
    },
    "iconDescription": {
      "description": "The description of the default flyout icon",
      "type": {
        "name": "string"
      },
      "required": true
    }
  }
};
var FlyoutMenu$1 = FlyoutMenu;

exports.FlyoutMenuButtonSize = FlyoutMenuButtonSize;
exports.FlyoutMenuDirection = FlyoutMenuDirection;
exports.default = FlyoutMenu$1;
