import PropTypes from "prop-types";
import switchAriaProps from "./Switch.ariaPropTypes";
import tagAttributeProps, {
  tagAttributePropsName
} from "../../propTypes/htmlAttributes.propTypes";
import customClassProps, {
  customClassPropName
} from "../../propTypes/customClassName.propTypes";
import automationProps, {
  automationPropsName
} from "../../propTypes/automation.propTypes";
import defaultCustomIds from "./Switch.customId";
import constantProps from "./Switch.constantProps";

export default {
  size: PropTypes.oneOf([
    constantProps.size.small,
    constantProps.size.medium,
    constantProps.size.large
  ]),
  color: PropTypes.oneOf([
    constantProps.color.primary,
    constantProps.color.secondary
  ]),
  labelPlacement:PropTypes.oneOf([
    constantProps.labelPlacement.top,
    constantProps.labelPlacement.bottom,
    constantProps.labelPlacement.right,
    constantProps.labelPlacement.left
  ]),
  
  shape:PropTypes.oneOf([
    constantProps.shape.default,
    constantProps.shape.round,  
  ]),
  label: PropTypes.string,
  checked:PropTypes.bool,
  onChange:PropTypes.func,  
  onToggle:PropTypes.func,
  ...switchAriaProps,
  ...customClassProps,
  ...automationProps,
  ...tagAttributeProps
};

export const defaultProps = {
  size: constantProps.size.medium,
  color: constantProps.color.primary,
  checked:false,
  [automationPropsName]: defaultCustomIds,
  [customClassPropName]: {},
  [tagAttributePropsName]: {}
};

export const propsDescription = {
  size: "Helps to display switch in small,medium,large sizes",
  color: "To set the colors",
  checked: "To show the switch box in on/off mode",
  onToggle:"Function to toggle the switch state", 
  shape: "To render slider in square/round form",
  label: "To show the text inside the component",
  disabled:"To render switch in disabled mode",
  labelPlacement:"Helps to position label of the switch either in top/bottom/left/right."
};
