@vonage/vivid-react
Version:
Vivid wrapped for easy React usage & IDE autocomplete support & typescript typings
569 lines (564 loc) • 13 kB
JavaScript
/*
* DO NOT EDIT THIS FILE. IT IS GENERATED
*/
/*
Code in this file were generated using following JSON:
{
"kind": "class",
"description": "",
"name": "SplitButton",
"cssProperties": [
{
"name": "--vvd-split-button-cta-primary",
"default": "var(--vvd-color-cta-500)"
},
{
"name": "--vvd-split-button-cta-primary-text",
"default": "var(--vvd-color-canvas)"
},
{
"name": "--vvd-split-button-cta-primary-increment",
"default": "var(--vvd-color-cta-600)"
},
{
"name": "--vvd-split-button-cta-contrast",
"default": "var(--vvd-color-cta-800)"
},
{
"name": "--vvd-split-button-cta-fierce",
"default": "var(--vvd-color-cta-700)"
},
{
"name": "--vvd-split-button-cta-firm",
"default": "var(--vvd-color-cta-600)"
},
{
"name": "--vvd-split-button-cta-soft",
"default": "var(--vvd-color-cta-100)"
},
{
"name": "--vvd-split-button-cta-faint",
"default": "var(--vvd-color-cta-50)"
},
{
"name": "--vvd-split-button-cta-fierce-primary",
"default": "var(--vvd-color-cta-700)"
},
{
"name": "--vvd-split-button-success-primary",
"default": "var(--vvd-color-success-500)"
},
{
"name": "--vvd-split-button-success-primary-text",
"default": "var(--vvd-color-canvas)"
},
{
"name": "--vvd-split-button-success-primary-increment",
"default": "var(--vvd-color-success-600)"
},
{
"name": "--vvd-split-button-success-contrast",
"default": "var(--vvd-color-success-800)"
},
{
"name": "--vvd-split-button-success-fierce",
"default": "var(--vvd-color-success-700)"
},
{
"name": "--vvd-split-button-success-firm",
"default": "var(--vvd-color-success-600)"
},
{
"name": "--vvd-split-button-success-soft",
"default": "var(--vvd-color-success-100)"
},
{
"name": "--vvd-split-button-success-faint",
"default": "var(--vvd-color-success-50)"
},
{
"name": "--vvd-split-button-success-fierce-primary",
"default": "var(--vvd-color-success-700)"
},
{
"name": "--vvd-split-button-alert-primary",
"default": "var(--vvd-color-alert-500)"
},
{
"name": "--vvd-split-button-alert-primary-text",
"default": "var(--vvd-color-canvas)"
},
{
"name": "--vvd-split-button-alert-primary-increment",
"default": "var(--vvd-color-alert-600)"
},
{
"name": "--vvd-split-button-alert-contrast",
"default": "var(--vvd-color-alert-800)"
},
{
"name": "--vvd-split-button-alert-fierce",
"default": "var(--vvd-color-alert-700)"
},
{
"name": "--vvd-split-button-alert-firm",
"default": "var(--vvd-color-alert-600)"
},
{
"name": "--vvd-split-button-alert-soft",
"default": "var(--vvd-color-alert-100)"
},
{
"name": "--vvd-split-button-alert-faint",
"default": "var(--vvd-color-alert-50)"
},
{
"name": "--vvd-split-button-alert-fierce-primary",
"default": "var(--vvd-color-alert-700)"
},
{
"name": "--vvd-split-button-announcement-primary",
"default": "var(--vvd-color-announcement-500)"
},
{
"name": "--vvd-split-button-announcement-primary-text",
"default": "var(--vvd-color-canvas)"
},
{
"name": "--vvd-split-button-announcement-primary-increment",
"default": "var(--vvd-color-announcement-600)"
},
{
"name": "--vvd-split-button-announcement-contrast",
"default": "var(--vvd-color-announcement-800)"
},
{
"name": "--vvd-split-button-announcement-fierce",
"default": "var(--vvd-color-announcement-700)"
},
{
"name": "--vvd-split-button-announcement-firm",
"default": "var(--vvd-color-announcement-600)"
},
{
"name": "--vvd-split-button-announcement-soft",
"default": "var(--vvd-color-announcement-100)"
},
{
"name": "--vvd-split-button-announcement-faint",
"default": "var(--vvd-color-announcement-50)"
},
{
"name": "--vvd-split-button-announcement-fierce-primary",
"default": "var(--vvd-color-announcement-700)"
},
{
"name": "--vvd-split-button-accent-primary",
"default": "var(--vvd-color-canvas-text)"
},
{
"name": "--vvd-split-button-accent-primary-text",
"default": "var(--vvd-color-canvas)"
},
{
"name": "--vvd-split-button-accent-primary-increment",
"default": "var(--vvd-color-neutral-800)"
},
{
"name": "--vvd-split-button-accent-contrast",
"default": "var(--vvd-color-neutral-800)"
},
{
"name": "--vvd-split-button-accent-fierce",
"default": "var(--vvd-color-neutral-700)"
},
{
"name": "--vvd-split-button-accent-firm",
"default": "var(--vvd-color-canvas-text)"
},
{
"name": "--vvd-split-button-accent-soft",
"default": "var(--vvd-color-neutral-100)"
},
{
"name": "--vvd-split-button-accent-faint",
"default": "var(--vvd-color-neutral-50)"
},
{
"name": "--vvd-split-button-accent-fierce-primary",
"default": "var(--vvd-color-canvas-text)"
}
],
"slots": [
{
"description": "Default slot.",
"name": ""
},
{
"description": "The preferred way to add an icon to the component.",
"name": "icon"
}
],
"members": [
{
"kind": "field",
"name": "_action",
"type": {
"text": "HTMLButtonElement"
},
"description": "Action HTML button element",
"privacy": "public"
},
{
"kind": "field",
"name": "action",
"type": {
"text": "HTMLButtonElement"
},
"readonly": true
},
{
"kind": "field",
"name": "_indicator",
"type": {
"text": "HTMLButtonElement"
},
"description": "Indicator HTML button element",
"privacy": "public"
},
{
"kind": "field",
"name": "indicator",
"type": {
"text": "HTMLButtonElement"
},
"readonly": true
},
{
"kind": "field",
"name": "connotation",
"type": {
"text": "SplitButtonConnotation | undefined"
},
"description": "The connotation the split button should have.",
"privacy": "public"
},
{
"kind": "field",
"name": "shape",
"type": {
"text": "SplitButtonShape | undefined"
},
"description": "The shape the split button should have.",
"privacy": "public"
},
{
"kind": "field",
"name": "appearance",
"type": {
"text": "SplitButtonAppearance | undefined"
},
"description": "The appearance the split button should have.",
"privacy": "public"
},
{
"kind": "field",
"name": "size",
"type": {
"text": "SplitButtonSize | undefined"
},
"description": "The size the split button should have.",
"privacy": "public"
},
{
"kind": "field",
"name": "label",
"type": {
"text": "string | undefined"
},
"description": "Indicates the split button's label.",
"privacy": "public"
},
{
"kind": "field",
"name": "splitIndicator",
"type": {
"text": "string"
},
"default": "'chevron-down-line'",
"description": "Indicates the split button's icon indicator.",
"privacy": "public"
},
{
"kind": "field",
"name": "disabled",
"type": {
"text": "boolean"
},
"default": "false",
"description": "Indicates if the button is disabled.",
"privacy": "public"
},
{
"kind": "field",
"name": "indicatorAriaLabel",
"type": {
"text": "| string\n\t\t| null"
},
"default": "null",
"description": "Defines a string value that labels the indicator element.\n\nhttps://www.w3.org/TR/wai-aria-1.1/#aria-label",
"privacy": "public"
},
{
"kind": "method",
"name": "handleActionClick",
"parameters": [
{
"name": "event",
"type": {
"text": "Event"
}
}
],
"description": "Handles action click events.\nPrevents interaction when disabled or pending."
},
{
"kind": "method",
"name": "handleIndicatorClick",
"parameters": [
{
"name": "event",
"type": {
"text": "Event"
}
}
],
"description": "Handles indicator click events.\nPrevents interaction when disabled or pending."
},
{
"kind": "field",
"name": "icon",
"type": {
"text": "string | undefined"
},
"description": "A decorative icon the custom element should have.",
"privacy": "public",
"inheritedFrom": {
"name": "AffixIcon",
"module": "src/shared/patterns/affix.ts"
}
},
{
"kind": "field",
"name": "_vividAriaBehaviour",
"default": "'delegate'",
"type": {
"text": "'delegate'"
},
"inheritedFrom": {
"name": "DelegatesAria",
"module": "src/shared/aria/delegates-aria.ts"
}
},
{
"kind": "field",
"name": "VIVID_VERSION",
"static": true,
"default": "__PACKAGE_VERSION__",
"description": "The current version of the Vivid library, which is useful for debugging.\nIt can be accessed from any Vivid element via `<el>.constructor.VIVID_VERSION`.",
"type": {
"text": "string"
},
"inheritedFrom": {
"name": "VividElement",
"module": "src/shared/foundation/vivid-element/vivid-element.ts"
}
},
{
"kind": "field",
"name": "componentName",
"type": {
"text": "string"
},
"static": true,
"description": "Core component name, without prefix",
"inheritedFrom": {
"name": "VividElement",
"module": "src/shared/foundation/vivid-element/vivid-element.ts"
}
}
],
"events": [
{
"type": {
"text": "CustomEvent<undefined>"
},
"description": "Event emitted when the action button is clicked",
"name": "action-click"
},
{
"type": {
"text": "CustomEvent<undefined>"
},
"description": "Event emitted when the indicator button is clicked",
"name": "indicator-click"
}
],
"attributes": [
{
"name": "connotation",
"type": {
"text": "SplitButtonConnotation | undefined"
},
"description": "The connotation the split button should have.",
"fieldName": "connotation"
},
{
"name": "shape",
"type": {
"text": "SplitButtonShape | undefined"
},
"description": "The shape the split button should have.",
"fieldName": "shape"
},
{
"name": "appearance",
"type": {
"text": "SplitButtonAppearance | undefined"
},
"description": "The appearance the split button should have.",
"fieldName": "appearance"
},
{
"name": "size",
"type": {
"text": "SplitButtonSize | undefined"
},
"description": "The size the split button should have.",
"fieldName": "size"
},
{
"name": "label",
"type": {
"text": "string | undefined"
},
"description": "Indicates the split button's label.",
"fieldName": "label"
},
{
"name": "split-indicator",
"type": {
"text": "string"
},
"default": "'chevron-down-line'",
"description": "Indicates the split button's icon indicator.",
"fieldName": "splitIndicator"
},
{
"name": "disabled",
"type": {
"text": "boolean"
},
"default": "false",
"description": "Indicates if the button is disabled.",
"fieldName": "disabled"
},
{
"name": "indicator-aria-label",
"type": {
"text": "| string\n\t\t| null"
},
"default": "null",
"description": "Defines a string value that labels the indicator element.\n\nhttps://www.w3.org/TR/wai-aria-1.1/#aria-label",
"fieldName": "indicatorAriaLabel"
},
{
"name": "icon",
"type": {
"text": "string | undefined"
},
"description": "A decorative icon the custom element should have.",
"fieldName": "icon",
"inheritedFrom": {
"name": "AffixIcon",
"module": "src/shared/patterns/affix.ts"
}
}
],
"mixins": [
{
"name": "AffixIcon",
"module": "/src/shared/patterns/affix"
},
{
"name": "Localized",
"module": "/src/shared/patterns"
},
{
"name": "DelegatesAria",
"module": "/src/shared/aria/delegates-aria"
}
],
"superclass": {
"name": "VividElement",
"module": "/src/shared/foundation/vivid-element/vivid-element"
},
"vividComponent": {
"public": true,
"name": "split-button"
},
"vividTesting": {
"selectors": [
{
"name": "byLabel",
"args": [
"byLabel"
]
}
],
"actions": [
{
"name": "clickAction",
"args": [
"click",
"#actionButton"
]
},
{
"name": "clickIndicator",
"args": [
"click",
"#indicatorButton"
]
}
],
"queries": [],
"refs": [
{
"name": "actionButton",
"args": [
"shadow",
"button.control"
]
},
{
"name": "indicatorButton",
"args": [
"shadow",
"button.indicator"
]
}
]
}
}
*/
import wrapper from '@vonage/vivid-react-wrapper'
import { registerSplitButton } from '@vonage/vivid'
registerSplitButton('vvd3')
const VwcSplitButton = wrapper(`vvd3-split-button`, {
events: [{"name":"click","propName":"onClick"},{"name":"indicator-click","propName":"onIndicatorClick"},{"name":"action-click","propName":"onActionClick"}],
attributes: [],
properties: ['_action', '_indicator', 'connotation', 'shape', 'appearance', 'size', 'label', 'splitIndicator', 'disabled', 'indicatorAriaLabel', 'icon', '_vividAriaBehaviour', 'VIVID_VERSION', 'componentName']
})
VwcSplitButton.displayName = 'VwcSplitButton'
export default VwcSplitButton