@vonage/vivid-react
Version:
Vivid wrapped for easy React usage & IDE autocomplete support & typescript typings
421 lines (416 loc) • 8.7 kB
JavaScript
/*
* DO NOT EDIT THIS FILE. IT IS GENERATED
*/
/*
Code in this file were generated using following JSON:
{
"kind": "class",
"description": "",
"name": "Alert",
"cssProperties": [
{
"name": "--vvd-alert-success-primary",
"default": "var(--vvd-color-success-500)"
},
{
"name": "--vvd-alert-success-primary-text",
"default": "var(--vvd-color-canvas)"
},
{
"name": "--vvd-alert-information-primary",
"default": "var(--vvd-color-information-500)"
},
{
"name": "--vvd-alert-information-primary-text",
"default": "var(--vvd-color-canvas)"
},
{
"name": "--vvd-alert-alert-primary",
"default": "var(--vvd-color-alert-500)"
},
{
"name": "--vvd-alert-alert-primary-text",
"default": "var(--vvd-color-canvas)"
},
{
"name": "--vvd-alert-warning-primary",
"default": "var(--vvd-color-warning-300)"
},
{
"name": "--vvd-alert-warning-primary-text",
"default": "var(--vvd-color-canvas-text)"
},
{
"name": "--vvd-alert-announcement-primary",
"default": "var(--vvd-color-announcement-500)"
},
{
"name": "--vvd-alert-announcement-primary-text",
"default": "var(--vvd-color-canvas)"
},
{
"name": "--vvd-alert-accent-primary",
"default": "var(--vvd-color-canvas-text)"
},
{
"name": "--vvd-alert-accent-primary-text",
"default": "var(--vvd-color-canvas)"
}
],
"slots": [
{
"description": "The main content of the Alert.",
"name": "main"
},
{
"description": "Add action items to the Alert using this slot.",
"name": "action-items"
},
{
"description": "The preferred way to add an icon to the component.",
"name": "icon"
}
],
"members": [
{
"kind": "field",
"name": "dismissButtonAriaLabel",
"type": {
"text": "| string\n\t\t| null"
},
"default": "null",
"description": "Allows setting a custom aria-label for the dismiss button.",
"privacy": "public"
},
{
"kind": "field",
"name": "#timeoutID",
"privacy": "private",
"type": {
"text": "NodeJS.Timeout | undefined"
}
},
{
"kind": "field",
"name": "removable",
"type": {
"text": "boolean"
},
"default": "false",
"description": "Adds a close button to the Alert.",
"privacy": "public"
},
{
"kind": "field",
"name": "placement",
"type": {
"text": "AlertPlacement | undefined"
},
"default": "'bottom'",
"description": "The placement of the Alert on the screen.",
"privacy": "public"
},
{
"kind": "field",
"name": "headline",
"type": {
"text": "string | undefined"
},
"description": "Adds a headline to the Alert.",
"privacy": "public"
},
{
"kind": "field",
"name": "text",
"type": {
"text": "string | undefined"
},
"description": "The main text of the Alert.",
"privacy": "public"
},
{
"kind": "field",
"name": "timeoutms",
"type": {
"text": "number"
},
"default": "0",
"description": "Timeout after which the Alert will close.",
"privacy": "public"
},
{
"kind": "field",
"name": "connotation",
"type": {
"text": "AlertConnotation | undefined"
},
"description": "Sets an appropriate icon / icon color for the connotation.",
"privacy": "public"
},
{
"kind": "field",
"name": "strategy",
"type": {
"text": "AlertStrategy | undefined"
},
"description": "Controls the `position` of the Alert.",
"privacy": "public"
},
{
"kind": "field",
"name": "open",
"type": {
"text": "boolean"
},
"default": "false",
"description": "Open state of the Alert.",
"privacy": "public"
},
{
"kind": "method",
"name": "openChanged",
"return": {
"type": {
"text": "void"
}
},
"parameters": [
{
"name": "oldValue",
"type": {
"text": "boolean"
}
},
{
"name": "newValue",
"type": {
"text": "boolean"
}
}
]
},
{
"kind": "field",
"name": "conditionedIcon",
"readonly": true
},
{
"kind": "method",
"name": "#setupTimeout"
},
{
"kind": "field",
"name": "#closeOnEscape",
"privacy": "private"
},
{
"kind": "field",
"name": "#onTransitionEnd",
"privacy": "private"
},
{
"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": "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": "Fired when the Alert is opened",
"name": "open"
},
{
"type": {
"text": "CustomEvent<undefined>"
},
"description": "Fired when the Alert is closed",
"name": "close"
}
],
"attributes": [
{
"name": "dismiss-button-aria-label",
"type": {
"text": "| string\n\t\t| null"
},
"default": "null",
"description": "Allows setting a custom aria-label for the dismiss button.",
"fieldName": "dismissButtonAriaLabel"
},
{
"name": "removable",
"type": {
"text": "boolean"
},
"default": "false",
"description": "Adds a close button to the Alert.",
"fieldName": "removable"
},
{
"name": "placement",
"type": {
"text": "AlertPlacement | undefined"
},
"default": "'bottom'",
"description": "The placement of the Alert on the screen.",
"fieldName": "placement"
},
{
"name": "headline",
"type": {
"text": "string | undefined"
},
"description": "Adds a headline to the Alert.",
"fieldName": "headline"
},
{
"name": "text",
"type": {
"text": "string | undefined"
},
"description": "The main text of the Alert.",
"fieldName": "text"
},
{
"name": "timeoutms",
"type": {
"text": "number"
},
"default": "0",
"description": "Timeout after which the Alert will close.",
"fieldName": "timeoutms"
},
{
"name": "connotation",
"type": {
"text": "AlertConnotation | undefined"
},
"description": "Sets an appropriate icon / icon color for the connotation.",
"fieldName": "connotation"
},
{
"name": "strategy",
"type": {
"text": "AlertStrategy | undefined"
},
"description": "Controls the `position` of the Alert.",
"fieldName": "strategy"
},
{
"name": "open",
"type": {
"text": "boolean"
},
"default": "false",
"description": "Open state of the Alert.",
"fieldName": "open"
},
{
"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"
}
],
"superclass": {
"name": "VividElement",
"module": "/src/shared/foundation/vivid-element/vivid-element"
},
"vividComponent": {
"public": true,
"name": "alert"
},
"vividTesting": {
"selectors": [
{
"name": "byHeadline",
"args": [
"byHeadline"
]
}
],
"actions": [],
"queries": [
{
"name": "open",
"args": [
"open",
"true"
]
},
{
"name": "closed",
"args": [
"open",
"false"
]
}
],
"refs": []
}
}
*/
import wrapper from '@vonage/vivid-react-wrapper'
import { registerAlert } from '@vonage/vivid'
registerAlert('vvd3')
const VwcAlert = wrapper(`vvd3-alert`, {
events: [{"name":"close","propName":"onClose"},{"name":"open","propName":"onOpen"}],
attributes: [],
properties: ['dismissButtonAriaLabel', 'removable', 'placement', 'headline', 'text', 'timeoutms', 'connotation', 'strategy', 'open', 'icon', 'VIVID_VERSION', 'componentName']
})
VwcAlert.displayName = 'VwcAlert'
export default VwcAlert