{
    "description": {
        "author": "Salesforce",
        "text": [
            "Page Object: addComponentModal",
            "Selector: mcontent_lightning_types-add-component-modal",
            "Modal for selecting and adding components to Lightning Type configuration"
        ]
    },
    "root": true,
    "selector": {
        "css": "mcontent_lightning_types-add-component-modal"
    },
    "shadow": {
        "elements": [
            {
                "public": true,
                "name": "modalHeader",
                "type": "utam-lightning/pageObjects/modalHeader",
                "selector": {
                    "css": "lightning-modal-header"
                }
            },
            {
                "public": true,
                "name": "closeButton",
                "type": "utam-lightning/pageObjects/buttonIcon",
                "selector": {
                    "css": "lightning-button-icon[icon-name='utility:close']"
                }
            },
            {
                "public": true,
                "name": "modalBody",
                "type": "utam-lightning/pageObjects/modalBody",
                "selector": {
                    "css": "lightning-modal-body"
                }
            },
            {
                "public": true,
                "name": "componentSelectionWrapper",
                "type": [],
                "selector": {
                    "css": "mcontent_lightning_types-component-selection-wrapper"
                }
            },
            {
                "public": true,
                "name": "modalFooter",
                "type": "utam-lightning/pageObjects/modalFooter",
                "selector": {
                    "css": "lightning-modal-footer"
                }
            },
            {
                "public": true,
                "name": "errorPopover",
                "type": [],
                "nullable": true,
                "selector": {
                    "css": "mcontent_lightning_types-popover-error"
                }
            },
            {
                "public": true,
                "name": "cancelButton",
                "type": "utam-lightning/pageObjects/button",
                "selector": {
                    "css": "lightning-modal-footer lightning-button:first-of-type"
                }
            },
            {
                "public": true,
                "name": "doneButton",
                "type": "utam-lightning/pageObjects/button",
                "selector": {
                    "css": "lightning-modal-footer lightning-button[variant='brand']"
                }
            }
        ]
    },
    "methods": [
        {
            "name": "waitForModalVisible",
            "description": "Waits for the add component modal to be visible",
            "compose": [
                {
                    "element": "modalHeader",
                    "apply": "waitForVisible"
                }
            ]
        },
        {
            "name": "clickCancel",
            "description": "Clicks the Cancel button to close the modal",
            "compose": [
                {
                    "element": "cancelButton",
                    "apply": "click"
                }
            ]
        },
        {
            "name": "clickDone",
            "description": "Clicks the Done button to save and close the modal",
            "compose": [
                {
                    "element": "doneButton",
                    "apply": "click"
                }
            ]
        },
        {
            "name": "clickClose",
            "description": "Clicks the close icon button",
            "compose": [
                {
                    "element": "closeButton",
                    "apply": "clickButton"
                }
            ]
        },
        {
            "name": "isDoneButtonDisabled",
            "description": {
                "text": [
                    "Checks if the Done button is disabled"
                ],
                "return": "boolean"
            },
            "compose": [
                {
                    "element": "doneButton",
                    "apply": "isDisabled"
                }
            ]
        },
        {
            "name": "hasError",
            "description": "Checks if error popover is displayed",
            "compose": [
                {
                    "element": "errorPopover",
                    "matcher": {
                        "type": "notNull"
                    }
                }
            ]
        }
    ]
}