{
  "name": "button",
  "version": "20.0.2",
  "jetVersion": "^20.0.2",
  "pack": "oj-c",
  "type": "composite",
  "dependencyScope": "runtime",
  "license": "https://opensource.org/licenses/UPL",
  "implements": [
    "CButtonElement"
  ],
  "description": "Buttons direct users to initiate or take actions and work with a single tap, click, or keystroke.",
  "displayName": "Button",
  "help": "oj-c.Button.html",
  "main": "oj-c/button",
  "extension": {
    "catalog": {
      "category": "Controls"
    },
    "vbdt": {
      "module": "oj-c/button"
    },
    "oracle": {
      "icon": "oj-ux-ico-button",
      "uxSpecs": [
        "button"
      ]
    },
    "webelement": {
      "package": "@oracle/oraclejet-core-pack",
      "version": "20.0.2",
      "docUrl": "https://www.oracle.com/webfolder/technetwork/jet/cpwdtsdoc/classes/ButtonWebElement.html",
      "export": "findButton",
      "main": "@oracle/oraclejet-core-pack/webdriver"
    }
  },
  "propertyLayout": [
    {
      "propertyGroup": "common",
      "items": [
        "label",
        "tooltip",
        "display",
        "chroming",
        "size",
        "width",
        "edge",
        "disabled"
      ]
    }
  ],
  "since": "13.0.0",
  "status": [
    {
      "type": "supersedes",
      "since": "15.0.0",
      "value": [
        "oj-button"
      ]
    }
  ],
  "requirements": [
    {
      "type": "anyOf",
      "label": "accessibility",
      "properties": [
        "label"
      ]
    },
    {
      "type": "not",
      "label": "accessibility",
      "properties": [
        "aria-label"
      ]
    }
  ],
  "properties": {
    "label": {
      "type": "string",
      "description": "Text to show in the button.",
      "help": "#label",
      "required": true,
      "translatable": true
    },
    "tooltip": {
      "type": "string",
      "description": "Text to show in the tooltip. This overrides the default tooltip that renders the label when in icon mode.",
      "help": "#tooltip",
      "translatable": true
    },
    "disabled": {
      "type": "boolean",
      "description": "Specifies that the button element should be disabled.",
      "help": "#disabled",
      "value": false
    },
    "width": {
      "type": "number|string",
      "description": "Specifies that the button style width",
      "help": "#width"
    },
    "display": {
      "type": "string",
      "description": "Display just the label, the icons, or all. Label is used as tooltip and should be set in all cases.",
      "help": "#display",
      "propertyEditorValues": {
        "all": {
          "description": "Display both the label and icons.",
          "displayName": "All"
        },
        "icons": {
          "description": "Display only the icons.",
          "displayName": "Icons"
        },
        "label": {
          "description": "Display only the text label.",
          "displayName": "label"
        }
      },
      "enumValues": [
        "all",
        "label",
        "icons"
      ],
      "value": "all"
    },
    "size": {
      "type": "string",
      "description": "Size of button",
      "help": "#size",
      "propertyEditorValues": {
        "xs": {
          "description": "Display an extra small button.  Only supported for component developers with ghost chroming in icon display mode.",
          "displayName": "Extra Small"
        },
        "sm": {
          "description": "Display a small button.",
          "displayName": "Small"
        },
        "md": {
          "description": "Display a default size button.",
          "displayName": "Medium"
        },
        "lg": {
          "description": "Display a large button.",
          "displayName": "Large"
        }
      },
      "enumValues": [
        "xs",
        "sm",
        "md",
        "lg"
      ],
      "value": "md"
    },
    "edge": {
      "type": "string",
      "description": "Specifies whether the button is attached to an edge. For example setting edge='bottom' can be used to attach a button to the bottom of a card. The button is then stretched to 100% width, and borders adjusted.",
      "help": "#edge",
      "propertyEditorValues": {
        "none": {
          "description": "Display a default standalone button.",
          "displayName": "Small"
        },
        "bottom": {
          "description": "Stretch the button to 100% width and adjust borders for usage at bottom of container.",
          "displayName": "Bottom"
        }
      },
      "enumValues": [
        "none",
        "bottom"
      ],
      "value": "none"
    },
    "chroming": {
      "type": "string",
      "description": "Indicates in what states the button has variants in background and border.",
      "help": "#chroming",
      "propertyEditorValues": {
        "ghost": {
          "description": "Ghost buttons are the least prominent variation. Ghost buttons are useful for performing low-priority tasks, such as manipulating the UI.",
          "displayName": "Ghost"
        },
        "borderless": {
          "description": "Borderless buttons are a more prominent variation. Borderless buttons are useful for supplemental actions that require minimal emphasis.",
          "displayName": "Borderless"
        },
        "outlined": {
          "description": "Outlined buttons are salient, but lighter weight than solid buttons. Outlined buttons are useful for secondary actions.",
          "displayName": "Outlined"
        },
        "solid": {
          "description": "Solid buttons stand out, and direct the user's attention to the most important actions in the UI.",
          "displayName": "Solid"
        },
        "callToAction": {
          "description": "A Call To Action (CTA) button guides the user to take or complete the action that is the main goal of the page or page section. There should only be one CTA button on a page at any given time.",
          "displayName": "Call To Action"
        },
        "danger": {
          "description": "A Danger button alerts the user to a dangerous situation.",
          "displayName": "Danger"
        }
      },
      "enumValues": [
        "solid",
        "ghost",
        "borderless",
        "outlined",
        "callToAction",
        "danger"
      ],
      "binding": {
        "consume": {
          "name": "containerChroming"
        }
      },
      "value": "outlined"
    },
    "buttonType": {
      "type": "string",
      "description": "Specifes the button type to be rendered. This can be used to prevent form submission from happening when the value is set to &quot;button&quot;.",
      "help": "#buttonType",
      "propertyEditorValues": {
        "button": {
          "description": "Renders a standard HTML button element.",
          "displayName": "Button"
        },
        "submit": {
          "description": "Renders an HTML submit button element.",
          "displayName": "Submit"
        }
      },
      "enumValues": [
        "button",
        "submit"
      ],
      "value": "submit"
    }
  },
  "slots": {
    "startIcon": {
      "description": "The startIcon slot is the button's start icon. The oj-c-button element accepts DOM nodes as children with the startIcon slot.",
      "help": "#startIcon"
    },
    "endIcon": {
      "description": "The endIcon slot is the button's end icon. The oj-c-button element accepts DOM nodes as children with the endIcon slot.",
      "help": "#endIcon"
    }
  },
  "events": {
    "ojAction": {
      "bubbles": true,
      "description": "Triggered when a button is clicked, whether by keyboard, mouse, or touch events. To meet accessibility requirements, the only supported way to react to the click of a button is to listen for this event.",
      "eventGroup": "common",
      "help": "#event:action",
      "detail": {
        "reason": {
          "type": "string",
          "description": "trigger for the button action",
          "enumValues": [
            "pointer",
            "keyboard"
          ]
        }
      }
    }
  },
  "methods": {
    "focus": {
      "return": "void"
    },
    "blur": {
      "return": "void"
    },
    "click": {
      "return": "void"
    },
    "setProperty": {
      "description": "Sets a property or a single subproperty for complex properties and notifies the component of the change, triggering a corresponding event.",
      "help": "#setProperty",
      "params": [
        {
          "name": "property",
          "description": "The property name to set. Supports dot notation for subproperty access.",
          "type": "string"
        },
        {
          "name": "value",
          "description": "The new value to set the property to.",
          "type": "any"
        }
      ],
      "return": "void"
    },
    "getProperty": {
      "description": "Retrieves the value of a property or a subproperty.",
      "help": "#getProperty",
      "params": [
        {
          "name": "property",
          "description": "The property name to get. Supports dot notation for subproperty access.",
          "type": "string"
        }
      ],
      "return": "any"
    },
    "setProperties": {
      "description": "Performs a batch set of properties.",
      "help": "#setProperties",
      "params": [
        {
          "name": "properties",
          "description": "An object containing the property and value pairs to set.",
          "type": "object"
        }
      ],
      "return": "void"
    }
  }
}