import PropTypes from "prop-types";

import tagAttributeProps, {
    tagAttributePropsName
  } from "../../propTypes/htmlAttributes.propTypes";
  import customClassProps, {
    customClassPropName
  } from "../../propTypes/customClassName.propTypes";
  import automationProps, {
    automationPropsName
  } from "../../propTypes/automation.propTypes";
  import defaultCustomIds from "./Modal.customId";

export default {
  modalrootNode:PropTypes.object,
  pageElementNode:PropTypes.object,
  closeDialogReference:PropTypes.func,
  focusDialogReference:PropTypes.func, 
  freezeLayer:PropTypes.func,  
  children:PropTypes.node,
  isTrapFocusNeeded:PropTypes.bool,  
  isCloseOnEscapeNeeded:PropTypes.bool,

  ...customClassProps,
  ...automationProps,
  ...tagAttributeProps
};
export const defaultProps = {
  isTrapFocusNeeded:true,
  isCloseOnEscapeNeeded:true,
  isOverlayNeeded:true, 
  [automationPropsName]: defaultCustomIds,
  [customClassPropName]: {},
  [tagAttributePropsName]: {}
  };

export const propsDescription = {
  modalrootNode: "HTML Id(Unique identifier). Inside the container modal will inject it's children like dialog, popover,notification message,etc...",
  closeDalogReference: "Modal helps to handle escape key by closing the top most floating UI when user presses it from anywhere inside the document.Once the event captured, it invokes the close function reference",
  focusDialogReference: "Once the floating UIs rendered inside the modal component, it will invoke the funcion to set focus. Function reference helps to restore the focus to appropriate floating UIs also",
  freezeLayer:"To apply overlay over the page or a previously invoked floating dialog to set priority for the current floating UI", 
  children:"Component definitions of floating UIs like pop-over, notification dialog, dialog,etc..",
  isTrapFocusNeeded:"Helps to prevent the focus to go out of the current floating UI when user presses tab key or shift-tab combo",
  isCloseOnEscapeNeeded:"Based on this configuration, when user presses escape key anywhere in the document, the action to close the top most floating UI may or may not be invoked."
};
