@vonage/vivid-react
Version:
Vivid wrapped for easy React usage & IDE autocomplete support & typescript typings
572 lines (567 loc) • 14.8 kB
JavaScript
/*
* DO NOT EDIT THIS FILE. IT IS GENERATED
*/
/*
Code in this file were generated using following JSON:
{
"kind": "class",
"description": "",
"name": "Switch",
"cssProperties": [
{
"name": "--vvd-switch-cta-primary-text",
"default": "var(--vvd-color-canvas)"
},
{
"name": "--vvd-switch-cta-primary",
"default": "var(--vvd-color-cta-500)"
},
{
"name": "--vvd-switch-cta-primary-increment",
"default": "var(--vvd-color-cta-600)"
},
{
"name": "--vvd-switch-cta-firm",
"default": "var(--vvd-color-cta-600)"
},
{
"name": "--vvd-switch-cta-intermediate",
"default": "var(--vvd-color-cta-500)"
},
{
"name": "--vvd-switch-cta-fierce",
"default": "var(--vvd-color-cta-700)"
},
{
"name": "--vvd-switch-alert-primary-text",
"default": "var(--vvd-color-canvas)"
},
{
"name": "--vvd-switch-alert-primary",
"default": "var(--vvd-color-alert-500)"
},
{
"name": "--vvd-switch-alert-primary-increment",
"default": "var(--vvd-color-alert-600)"
},
{
"name": "--vvd-switch-alert-firm",
"default": "var(--vvd-color-alert-600)"
},
{
"name": "--vvd-switch-alert-intermediate",
"default": "var(--vvd-color-alert-500)"
},
{
"name": "--vvd-switch-alert-fierce",
"default": "var(--vvd-color-alert-700)"
},
{
"name": "--vvd-switch-success-primary-text",
"default": "var(--vvd-color-canvas)"
},
{
"name": "--vvd-switch-success-primary",
"default": "var(--vvd-color-success-500)"
},
{
"name": "--vvd-switch-success-primary-increment",
"default": "var(--vvd-color-success-600)"
},
{
"name": "--vvd-switch-success-firm",
"default": "var(--vvd-color-success-600)"
},
{
"name": "--vvd-switch-success-intermediate",
"default": "var(--vvd-color-success-500)"
},
{
"name": "--vvd-switch-success-fierce",
"default": "var(--vvd-color-success-700)"
},
{
"name": "--vvd-switch-announcement-primary-text",
"default": "var(--vvd-color-canvas)"
},
{
"name": "--vvd-switch-announcement-primary",
"default": "var(--vvd-color-announcement-500)"
},
{
"name": "--vvd-switch-announcement-primary-increment",
"default": "var(--vvd-color-announcement-600)"
},
{
"name": "--vvd-switch-announcement-firm",
"default": "var(--vvd-color-announcement-600)"
},
{
"name": "--vvd-switch-announcement-intermediate",
"default": "var(--vvd-color-announcement-500)"
},
{
"name": "--vvd-switch-announcement-fierce",
"default": "var(--vvd-color-announcement-700)"
},
{
"name": "--vvd-switch-accent-primary-text",
"default": "var(--vvd-color-canvas)"
},
{
"name": "--vvd-switch-accent-primary",
"default": "var(--vvd-color-canvas-text)"
},
{
"name": "--vvd-switch-accent-primary-increment",
"default": "var(--vvd-color-neutral-800)"
},
{
"name": "--vvd-switch-accent-firm",
"default": "var(--vvd-color-canvas-text)"
},
{
"name": "--vvd-switch-accent-intermediate",
"default": "var(--vvd-color-neutral-500)"
},
{
"name": "--vvd-switch-accent-fierce",
"default": "var(--vvd-color-neutral-700)"
}
],
"members": [
{
"kind": "field",
"name": "label",
"type": {
"text": "string | undefined"
},
"description": "Indicates the switch's label.",
"privacy": "public"
},
{
"kind": "field",
"name": "connotation",
"type": {
"text": "SwitchConnotation | undefined"
},
"description": "Indicates the switch's connotation.",
"privacy": "public"
},
{
"kind": "field",
"name": "readOnly",
"type": {
"text": "boolean"
},
"description": "When true, the control will be immutable by user interaction. See https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/readonly | readonly HTML attribute for more information.",
"privacy": "public"
},
{
"kind": "field",
"name": "checked",
"type": {
"text": "boolean"
},
"description": "The current checkedness of the element.",
"privacy": "public",
"inheritedFrom": {
"name": "CheckableFormAssociated",
"module": "src/shared/foundation/form-associated/form-associated.ts"
}
},
{
"kind": "field",
"name": "_vividAriaBehaviour",
"default": "'delegate'",
"type": {
"text": "'delegate'"
},
"inheritedFrom": {
"name": "DelegatesAria",
"module": "src/shared/aria/delegates-aria.ts"
}
},
{
"kind": "field",
"name": "defaultChecked",
"type": {
"text": "boolean"
},
"default": "false",
"description": "The default checkedness of the element. This value sets the `checked` property\nonly when the `checked` property has not been explicitly set.",
"privacy": "public",
"inheritedFrom": {
"name": "CheckableFormAssociated",
"module": "src/shared/foundation/form-associated/form-associated.ts"
}
},
{
"kind": "field",
"name": "checkedAttribute",
"inheritedFrom": {
"name": "CheckableFormAssociated",
"module": "src/shared/foundation/form-associated/form-associated.ts"
}
},
{
"kind": "field",
"name": "currentChecked",
"inheritedFrom": {
"name": "CheckableFormAssociated",
"module": "src/shared/foundation/form-associated/form-associated.ts"
}
},
{
"kind": "field",
"name": "validity",
"type": {
"text": "ValidityState"
},
"description": "Returns the validity state of the element",
"readonly": true,
"inheritedFrom": {
"name": "FormAssociated",
"module": "src/shared/foundation/form-associated/form-associated.ts"
}
},
{
"kind": "field",
"name": "form",
"type": {
"text": "HTMLFormElement | null"
},
"description": "Retrieve a reference to the associated form.\nReturns null if not associated to any form.",
"readonly": true,
"inheritedFrom": {
"name": "FormAssociated",
"module": "src/shared/foundation/form-associated/form-associated.ts"
}
},
{
"kind": "field",
"name": "validationMessage",
"type": {
"text": "string"
},
"description": "Retrieve the localized validation message,\nor custom validation message if set.",
"readonly": true,
"inheritedFrom": {
"name": "FormAssociated",
"module": "src/shared/foundation/form-associated/form-associated.ts"
}
},
{
"kind": "field",
"name": "willValidate",
"type": {
"text": "boolean"
},
"description": "Whether the element will be validated when the\nform is submitted",
"readonly": true,
"inheritedFrom": {
"name": "FormAssociated",
"module": "src/shared/foundation/form-associated/form-associated.ts"
}
},
{
"kind": "field",
"name": "labels",
"type": {
"text": "ReadonlyArray<Node>"
},
"description": "A reference to all associated label elements",
"readonly": true,
"inheritedFrom": {
"name": "FormAssociated",
"module": "src/shared/foundation/form-associated/form-associated.ts"
}
},
{
"kind": "field",
"name": "value",
"type": {
"text": "string"
},
"description": "The current value of the element.",
"inheritedFrom": {
"name": "FormAssociated",
"module": "src/shared/foundation/form-associated/form-associated.ts"
}
},
{
"kind": "field",
"name": "currentValue",
"inheritedFrom": {
"name": "FormAssociated",
"module": "src/shared/foundation/form-associated/form-associated.ts"
}
},
{
"kind": "field",
"name": "initialValue",
"type": {
"text": "string"
},
"description": "The default value of the element. This value sets the `value` property\nonly when the `value` property has not been explicitly set.",
"inheritedFrom": {
"name": "FormAssociated",
"module": "src/shared/foundation/form-associated/form-associated.ts"
}
},
{
"kind": "field",
"name": "disabled",
"type": {
"text": "boolean"
},
"default": "false",
"description": "Sets the element's disabled state. A disabled element will not be included during form submission.",
"inheritedFrom": {
"name": "FormAssociated",
"module": "src/shared/foundation/form-associated/form-associated.ts"
}
},
{
"kind": "field",
"name": "name",
"type": {
"text": "string"
},
"description": "The name of the element. This element's value will be surfaced during form submission under the provided name.",
"inheritedFrom": {
"name": "FormAssociated",
"module": "src/shared/foundation/form-associated/form-associated.ts"
}
},
{
"kind": "field",
"name": "required",
"type": {
"text": "boolean"
},
"description": "Require the field to be completed prior to form submission.",
"default": "false",
"inheritedFrom": {
"name": "FormAssociated",
"module": "src/shared/foundation/form-associated/form-associated.ts"
}
},
{
"kind": "method",
"name": "checkValidity",
"return": {
"type": {
"text": "boolean"
}
},
"description": "Return the current validity of the element.",
"inheritedFrom": {
"name": "FormAssociated",
"module": "src/shared/foundation/form-associated/form-associated.ts"
}
},
{
"kind": "method",
"name": "reportValidity",
"return": {
"type": {
"text": "boolean"
}
},
"description": "Return the current validity of the element.\nIf false, fires an invalid event at the element.",
"inheritedFrom": {
"name": "FormAssociated",
"module": "src/shared/foundation/form-associated/form-associated.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": "Emits a custom change event when the checked state changes",
"name": "change"
}
],
"attributes": [
{
"name": "label",
"type": {
"text": "string | undefined"
},
"description": "Indicates the switch's label.",
"fieldName": "label"
},
{
"name": "connotation",
"type": {
"text": "SwitchConnotation | undefined"
},
"description": "Indicates the switch's connotation.",
"fieldName": "connotation"
},
{
"name": "readonly",
"type": {
"text": "boolean"
},
"description": "When true, the control will be immutable by user interaction. See https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/readonly | readonly HTML attribute for more information.",
"fieldName": "readOnly"
},
{
"name": "checked",
"type": {
"text": "boolean"
},
"default": "false",
"description": "The default checkedness of the element. This value sets the `checked` property\nonly when the `checked` property has not been explicitly set.",
"fieldName": "defaultChecked",
"inheritedFrom": {
"name": "CheckableFormAssociated",
"module": "src/shared/foundation/form-associated/form-associated.ts"
}
},
{
"name": "current-checked",
"type": {
"text": "boolean"
},
"description": "The current checkedness of the element.",
"fieldName": "checked",
"inheritedFrom": {
"name": "CheckableFormAssociated",
"module": "src/shared/foundation/form-associated/form-associated.ts"
}
},
{
"name": "current-value",
"type": {
"text": "string"
},
"description": "The current value of the element.",
"fieldName": "value",
"inheritedFrom": {
"name": "FormAssociated",
"module": "src/shared/foundation/form-associated/form-associated.ts"
}
},
{
"name": "value",
"type": {
"text": "string"
},
"description": "The default value of the element. This value sets the `value` property\nonly when the `value` property has not been explicitly set.",
"fieldName": "initialValue",
"inheritedFrom": {
"name": "FormAssociated",
"module": "src/shared/foundation/form-associated/form-associated.ts"
}
},
{
"name": "disabled",
"type": {
"text": "boolean"
},
"default": "false",
"description": "Sets the element's disabled state. A disabled element will not be included during form submission.",
"fieldName": "disabled",
"inheritedFrom": {
"name": "FormAssociated",
"module": "src/shared/foundation/form-associated/form-associated.ts"
}
},
{
"name": "name",
"type": {
"text": "string"
},
"description": "The name of the element. This element's value will be surfaced during form submission under the provided name.",
"fieldName": "name",
"inheritedFrom": {
"name": "FormAssociated",
"module": "src/shared/foundation/form-associated/form-associated.ts"
}
},
{
"name": "required",
"type": {
"text": "boolean"
},
"description": "Require the field to be completed prior to form submission.",
"default": "false",
"fieldName": "required",
"inheritedFrom": {
"name": "FormAssociated",
"module": "src/shared/foundation/form-associated/form-associated.ts"
}
}
],
"mixins": [
{
"name": "DelegatesAria",
"module": "/src/shared/aria/delegates-aria"
},
{
"name": "CheckableFormAssociated",
"module": "/src/shared/foundation/form-associated/form-associated"
}
],
"superclass": {
"name": "VividElement",
"module": "/src/shared/foundation/vivid-element/vivid-element"
},
"vividComponent": {
"public": true,
"name": "switch",
"vueModels": [
{
"name": "modelValue",
"propName": "checked",
"eventNames": [
"change"
],
"valueMapping": "event.currentTarget.checked"
}
]
}
}
*/
import wrapper from '@vonage/vivid-react-wrapper'
import { registerSwitch } from '@vonage/vivid'
registerSwitch('vvd3')
const VwcSwitch = wrapper(`vvd3-switch`, {
events: [{"name":"change","propName":"onChange"},{"name":"click","propName":"onClick"}],
attributes: [],
properties: ['checked', 'readonly', 'disabled', 'value', 'name', 'label', 'connotation', 'readOnly', 'checked', '_vividAriaBehaviour', 'defaultChecked', 'checkedAttribute', 'currentChecked', 'value', 'currentValue', 'initialValue', 'disabled', 'name', 'required', 'VIVID_VERSION', 'componentName']
})
VwcSwitch.displayName = 'VwcSwitch'
export default VwcSwitch