import PropTypes from "prop-types";
import checkboxAriaProps,{checkboxGroupDefaultAriaProps as checkboxGroupAriaProps} from "./Checkbox.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 "./Checkbox.customIds";
import CheckboxConstants,{CheckboxGroupConstant} from "./Checkbox.constantProps";

export default {
  text : PropTypes.string,
  name : PropTypes.string.isRequired,
  id: PropTypes.string,
  value : PropTypes.string,
  size : PropTypes.oneOf([  
      CheckboxConstants.size.small, 
      CheckboxConstants.size.medium, 
      CheckboxConstants.size.large]
  ),
  color : PropTypes.oneOf([
      CheckboxConstants.color.primary, 
      CheckboxConstants.color.danger, 
      CheckboxConstants.color.success
  ]),
  children: PropTypes.any,
  selectedValue : PropTypes.array,
  disabled : PropTypes.bool,
  onChange : PropTypes.func,
  checkboxCondition : PropTypes.func,
  ...customClassProps,
  ...automationProps,
  ...tagAttributeProps,
  ...checkboxAriaProps
}

export const checkboxDefaultProps = {
  size : CheckboxConstants.size.medium,
  color : CheckboxConstants.color.primary,
  disabled : false,
  [automationPropsName] : defaultCustomIds,
  [customClassPropName] : {},
  [tagAttributePropsName] : {}
}

export const checkboxPropsDescription = {
    text:"This defines the text that is show the name",
    size:"This defines the size of Checkbox",
    id: "This defaines the id of the chekbox",
    name:"it unique identification for checkboxgroup",
    color:"This defines the color of Checkbox",
    disabled:"This defines the disabled state",
    tagAttributeProps : "The tag Attribute props defines the attributes that can be directly given to the tag",
    customClassName : "The CustomClassName defines the classnames that can be directly given to the component",
    customId:"This defines the dataId that are used by automation purpose",
    customIdPrefix: "This defines the dataId that are used by automation purpose",
    customIdSuffix: "This defines the dataId that are used by automation purpose",
    onChange : "This define the function, on checkbox button current selected value"
};


export const checkboxGroupProps={
    children: PropTypes.node,
    name: PropTypes.string.isRequired,
    onChange: PropTypes.func,
    selectedValue : PropTypes.func,
    direction : PropTypes.oneOf([
        CheckboxGroupConstant.direction.row,
        CheckboxGroupConstant.direction.column]
    ),
    gap: PropTypes.oneOf([
        CheckboxGroupConstant.gap.xSmall,
        CheckboxGroupConstant.gap.small,
        CheckboxGroupConstant.gap.medium,
        CheckboxGroupConstant.gap.large,
        CheckboxGroupConstant.gap.none
    ]),
    defaultValue: PropTypes.array,
    selectedId : PropTypes.string,
    ...customClassProps,
    ...tagAttributeProps,
    ...automationProps,
    ...checkboxGroupAriaProps
}

export const checkboxGroupDefaultProps = {
    direction : CheckboxGroupConstant.direction.row,
    [customClassPropName] : {},
    [tagAttributePropsName] : {},
    [automationPropsName] : defaultCustomIds,
}

export const checkboxGroupPropsDescription = {
    children:"This defines the children of the component",
    name:"it's defined for unique identification",
    direction : "This define the checkbox direction",
    defaultValue: "This define the default selected checkbox value",
    selectedvalue : "This define the state handling default selected checkbox value",
    customClassName : "The CustomClassName defines the classnames that can be directly given to the component",
    tagAttributeProps : "The tag Attribute props defines the attributes that can be directly given to the tag",
    customId:"This defines the dataId that are used by automation purpose",
    customIdPrefix: "This defines the dataId that are used by automation purpose",
    customIdSuffix: "This defines the dataId that are used by automation purpose",
    onChange: "This define the function, on checkbox button current selected value",
}

export const checkboxContextProps={
    children: PropTypes.node.isRequired,
    name: PropTypes.string.isRequired,
    onChange: PropTypes.func,
    selectedValue : PropTypes.func,
    defaultValue: PropTypes.array,
    ...customClassProps,
    ...tagAttributeProps,
    ...automationProps
}

export const checkboxContextDefaultProps={
    [customClassPropName] : {},
    [tagAttributePropsName] : {},
    [automationPropsName] : defaultCustomIds,
}

export const checkboxContextPropsDescription={
    children:"This defines the children of the component",
    name:"it's defined for unique identification",
    defaultValue: "This define the default selected checkbox value",
    selectedValue : "This define the state handling default selected checkbox value",
    customClassName : "The CustomClassName defines the classnames that can be directly given to the component",
    tagAttributeProps : "The tag Attribute props defines the attributes that can be directly given to the tag",
    customId:"This defines the dataId that are used by automation purpose",
    customIdPrefix: "This defines the dataId that are used by automation purpose",
    customIdSuffix: "This defines the dataId that are used by automation purpose",
    onChange: "This define the function, on checkbox button current selected value",
}
