@vonage/vivid 3.14.0 → 3.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/checkbox/index.js +3 -0
- package/custom-elements.json +203 -24
- package/empty-state/index.js +14 -0
- package/fab/index.js +1 -1
- package/header/index.js +1 -1
- package/index.js +31 -29
- package/layout/index.js +1 -1
- package/lib/checkbox/checkbox.d.ts +6 -3
- package/lib/components.d.ts +2 -0
- package/lib/data-grid/data-grid-row.d.ts +1 -0
- package/lib/empty-state/definition.d.ts +3 -0
- package/lib/empty-state/empty-state.d.ts +5 -0
- package/lib/empty-state/empty-state.template.d.ts +4 -0
- package/lib/empty-state/index.d.ts +1 -0
- package/listbox/index.js +1 -1
- package/menu/index.js +2 -2
- package/menu-item/index.js +1 -1
- package/nav/index.js +1 -1
- package/nav-disclosure/index.js +1 -1
- package/nav-item/index.js +1 -1
- package/note/index.js +1 -1
- package/number-field/index.js +1 -1
- package/package.json +1 -1
- package/pagination/index.js +14 -232
- package/progress/index.js +1 -1
- package/radio/index.js +1 -1
- package/radio-group/index.js +1 -1
- package/select/index.js +1 -1
- package/shared/definition.js +1 -1
- package/shared/definition10.js +1 -1
- package/shared/definition11.js +1 -1
- package/shared/definition12.js +1 -1
- package/shared/definition14.js +1 -1
- package/shared/definition15.js +1 -1
- package/shared/definition16.js +1 -1
- package/shared/definition17.js +1 -1
- package/shared/definition18.js +23 -8
- package/shared/definition19.js +1 -1
- package/shared/definition2.js +1 -1
- package/shared/definition21.js +1 -1
- package/shared/definition22.js +73 -31
- package/shared/definition23.js +1 -1
- package/shared/definition24.js +1 -1
- package/shared/definition25.js +39 -76
- package/shared/definition26.js +76 -47
- package/shared/definition27.js +46 -36
- package/shared/definition28.js +39 -49
- package/shared/definition29.js +48 -344
- package/shared/definition30.js +272 -291
- package/shared/definition31.js +366 -14
- package/shared/definition32.js +13 -67
- package/shared/definition33.js +66 -21
- package/shared/definition34.js +21 -39
- package/shared/definition35.js +31 -432
- package/shared/definition36.js +432 -76
- package/shared/definition37.js +223 -34
- package/shared/definition38.js +82 -425
- package/shared/definition39.js +30 -635
- package/shared/definition4.js +1 -1
- package/shared/definition40.js +420 -73
- package/shared/definition41.js +530 -484
- package/shared/definition42.js +76 -133
- package/shared/definition43.js +577 -40
- package/shared/definition44.js +135 -20
- package/shared/definition45.js +42 -423
- package/shared/definition46.js +22 -112
- package/shared/definition47.js +440 -18
- package/shared/definition48.js +92 -247
- package/shared/definition49.js +20 -112
- package/shared/definition5.js +1 -1
- package/shared/definition50.js +259 -590
- package/shared/definition51.js +110 -91
- package/shared/definition52.js +602 -67
- package/shared/definition53.js +89 -294
- package/shared/definition54.js +80 -0
- package/shared/definition55.js +305 -0
- package/shared/definition6.js +1 -1
- package/shared/definition7.js +1 -1
- package/shared/definition9.js +1 -1
- package/shared/form-elements.js +1 -1
- package/shared/icon.js +1 -1
- package/shared/patterns/form-elements/form-elements.d.ts +4 -4
- package/shared/text-field.js +1 -1
- package/side-drawer/index.js +1 -1
- package/slider/index.js +1 -1
- package/styles/core/all.css +1 -1
- package/styles/core/theme.css +1 -1
- package/styles/core/typography.css +1 -1
- package/styles/tokens/theme-dark.css +4 -4
- package/styles/tokens/theme-light.css +4 -4
- package/switch/index.js +1 -1
- package/tab/index.js +1 -1
- package/tab-panel/index.js +1 -1
- package/tabs/index.js +3 -3
- package/tag/index.js +1 -1
- package/tag-group/index.js +1 -1
- package/text-area/index.js +1 -1
- package/text-field/index.js +1 -1
- package/toggletip/index.js +1 -1
- package/tooltip/index.js +1 -1
- package/tree-item/index.js +1 -1
- package/tree-view/index.js +1 -1
- package/vivid.api.json +210 -0
package/shared/definition51.js
CHANGED
|
@@ -1,100 +1,119 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { _ as __decorate, a as attr, b as __metadata, h as html, r as registerFactory } from './index.js';
|
|
2
|
+
import { f as focusRegistries } from './definition4.js';
|
|
3
|
+
import { i as iconRegistries } from './definition3.js';
|
|
4
|
+
import { b as AffixIcon, a as affixIconTemplateFactory } from './affix.js';
|
|
5
|
+
import './focus.js';
|
|
6
|
+
import { e as errorText, f as formElements, F as FormElementSuccessText, a as FormElementHelperText, b as FormElementCharCount, g as getFeedbackTemplate } from './form-elements.js';
|
|
7
|
+
import { T as TextField$1 } from './text-field2.js';
|
|
8
|
+
import { a as applyMixins } from './apply-mixins.js';
|
|
9
|
+
import { c as css_248z } from './text-field.js';
|
|
10
|
+
import { f as focusTemplateFactory } from './focus2.js';
|
|
11
|
+
import { w as when } from './when.js';
|
|
12
|
+
import { r as ref } from './ref.js';
|
|
3
13
|
import { c as classNames } from './class-names.js';
|
|
4
14
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
_Tooltip_instances.add(this);
|
|
12
|
-
_Tooltip_anchorEl.set(this, null);
|
|
13
|
-
this.open = false;
|
|
14
|
-
_Tooltip_show.set(this, () => {
|
|
15
|
-
this.open = true;
|
|
16
|
-
});
|
|
17
|
-
_Tooltip_hide.set(this, () => {
|
|
18
|
-
this.open = false;
|
|
19
|
-
});
|
|
20
|
-
_Tooltip_closeOnEscape.set(this, e => {
|
|
21
|
-
if (e.key === 'Escape') __classPrivateFieldGet(this, _Tooltip_hide, "f").call(this);
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
anchorChanged(_, newValue) {
|
|
25
|
-
if (__classPrivateFieldGet(this, _Tooltip_anchorEl, "f")) __classPrivateFieldGet(this, _Tooltip_instances, "m", _Tooltip_removeEventListener).call(this);
|
|
26
|
-
__classPrivateFieldSet(this, _Tooltip_anchorEl, newValue instanceof HTMLElement ? newValue : document.getElementById(newValue), "f");
|
|
27
|
-
if (__classPrivateFieldGet(this, _Tooltip_anchorEl, "f")) __classPrivateFieldGet(this, _Tooltip_instances, "m", _Tooltip_anchorUpdated).call(this);
|
|
28
|
-
}
|
|
29
|
-
disconnectedCallback() {
|
|
30
|
-
super.disconnectedCallback();
|
|
31
|
-
__classPrivateFieldGet(this, _Tooltip_instances, "m", _Tooltip_removeEventListener).call(this);
|
|
32
|
-
document.removeEventListener('keydown', __classPrivateFieldGet(this, _Tooltip_closeOnEscape, "f"));
|
|
33
|
-
}
|
|
34
|
-
openChanged(_, newValue) {
|
|
35
|
-
if (_ === undefined) return;
|
|
36
|
-
if (newValue) {
|
|
37
|
-
document.addEventListener('keydown', __classPrivateFieldGet(this, _Tooltip_closeOnEscape, "f"));
|
|
38
|
-
} else {
|
|
39
|
-
document.removeEventListener('keydown', __classPrivateFieldGet(this, _Tooltip_closeOnEscape, "f"));
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
_Tooltip_anchorEl = new WeakMap(), _Tooltip_show = new WeakMap(), _Tooltip_hide = new WeakMap(), _Tooltip_closeOnEscape = new WeakMap(), _Tooltip_instances = new WeakSet(), _Tooltip_anchorUpdated = function _Tooltip_anchorUpdated() {
|
|
44
|
-
__classPrivateFieldGet(this, _Tooltip_instances, "m", _Tooltip_removeEventListener).call(this);
|
|
45
|
-
__classPrivateFieldGet(this, _Tooltip_instances, "m", _Tooltip_addEventListener).call(this);
|
|
46
|
-
}, _Tooltip_addEventListener = function _Tooltip_addEventListener() {
|
|
47
|
-
if (__classPrivateFieldGet(this, _Tooltip_anchorEl, "f")) {
|
|
48
|
-
__classPrivateFieldGet(this, _Tooltip_anchorEl, "f").addEventListener('mouseover', __classPrivateFieldGet(this, _Tooltip_show, "f"));
|
|
49
|
-
__classPrivateFieldGet(this, _Tooltip_anchorEl, "f").addEventListener('mouseout', __classPrivateFieldGet(this, _Tooltip_hide, "f"));
|
|
50
|
-
__classPrivateFieldGet(this, _Tooltip_anchorEl, "f").addEventListener('focusin', __classPrivateFieldGet(this, _Tooltip_show, "f"));
|
|
51
|
-
__classPrivateFieldGet(this, _Tooltip_anchorEl, "f").addEventListener('focusout', __classPrivateFieldGet(this, _Tooltip_hide, "f"));
|
|
52
|
-
}
|
|
53
|
-
}, _Tooltip_removeEventListener = function _Tooltip_removeEventListener() {
|
|
54
|
-
var _a, _b, _c, _d;
|
|
55
|
-
(_a = __classPrivateFieldGet(this, _Tooltip_anchorEl, "f")) === null || _a === void 0 ? void 0 : _a.removeEventListener('mouseover', __classPrivateFieldGet(this, _Tooltip_show, "f"));
|
|
56
|
-
(_b = __classPrivateFieldGet(this, _Tooltip_anchorEl, "f")) === null || _b === void 0 ? void 0 : _b.removeEventListener('mouseout', __classPrivateFieldGet(this, _Tooltip_hide, "f"));
|
|
57
|
-
(_c = __classPrivateFieldGet(this, _Tooltip_anchorEl, "f")) === null || _c === void 0 ? void 0 : _c.removeEventListener('focusin', __classPrivateFieldGet(this, _Tooltip_show, "f"));
|
|
58
|
-
(_d = __classPrivateFieldGet(this, _Tooltip_anchorEl, "f")) === null || _d === void 0 ? void 0 : _d.removeEventListener('focusout', __classPrivateFieldGet(this, _Tooltip_hide, "f"));
|
|
59
|
-
};
|
|
60
|
-
__decorate([attr, __metadata("design:type", String)], Tooltip.prototype, "text", void 0);
|
|
61
|
-
__decorate([attr({
|
|
62
|
-
mode: 'fromView'
|
|
63
|
-
}), __metadata("design:type", String)], Tooltip.prototype, "placement", void 0);
|
|
64
|
-
__decorate([attr({
|
|
65
|
-
mode: 'boolean'
|
|
66
|
-
}), __metadata("design:type", Object)], Tooltip.prototype, "open", void 0);
|
|
67
|
-
__decorate([attr({
|
|
68
|
-
mode: 'fromView'
|
|
69
|
-
}), __metadata("design:type", Object)], Tooltip.prototype, "anchor", void 0);
|
|
15
|
+
let TextField = class TextField extends TextField$1 {};
|
|
16
|
+
__decorate([attr, __metadata("design:type", String)], TextField.prototype, "appearance", void 0);
|
|
17
|
+
__decorate([attr, __metadata("design:type", String)], TextField.prototype, "shape", void 0);
|
|
18
|
+
__decorate([attr, __metadata("design:type", String)], TextField.prototype, "autoComplete", void 0);
|
|
19
|
+
TextField = __decorate([errorText, formElements], TextField);
|
|
20
|
+
applyMixins(TextField, AffixIcon, FormElementCharCount, FormElementHelperText, FormElementSuccessText);
|
|
70
21
|
|
|
71
22
|
let _ = t => t,
|
|
72
|
-
_t
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
23
|
+
_t,
|
|
24
|
+
_t2,
|
|
25
|
+
_t3;
|
|
26
|
+
const getStateClasses = ({
|
|
27
|
+
errorValidationMessage,
|
|
28
|
+
disabled,
|
|
29
|
+
value,
|
|
30
|
+
readOnly,
|
|
31
|
+
placeholder,
|
|
32
|
+
appearance,
|
|
33
|
+
shape,
|
|
34
|
+
label,
|
|
35
|
+
successText
|
|
36
|
+
}) => classNames(['error connotation-alert', Boolean(errorValidationMessage)], ['disabled', disabled], ['has-value', Boolean(value)], ['readonly', readOnly], ['placeholder', Boolean(placeholder)], [`appearance-${appearance}`, Boolean(appearance)], [`shape-${shape}`, Boolean(shape)], ['no-label', !label], ['success connotation-success', Boolean(successText)]);
|
|
37
|
+
function renderLabel() {
|
|
78
38
|
return html(_t || (_t = _`
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
39
|
+
<label for="control" class="label">
|
|
40
|
+
${0}
|
|
41
|
+
</label>`), x => x.label);
|
|
42
|
+
}
|
|
43
|
+
function renderCharCount() {
|
|
44
|
+
return html(_t2 || (_t2 = _`
|
|
45
|
+
<span class="char-count">${0} / ${0}</span>
|
|
46
|
+
`), x => x.value ? x.value.length : 0, x => x.maxlength);
|
|
47
|
+
}
|
|
48
|
+
const TextfieldTemplate = context => {
|
|
49
|
+
const affixIconTemplate = affixIconTemplateFactory(context);
|
|
50
|
+
const focusTemplate = focusTemplateFactory(context);
|
|
51
|
+
return html(_t3 || (_t3 = _`
|
|
52
|
+
<div class="base ${0}">
|
|
53
|
+
${0}
|
|
54
|
+
${0}
|
|
55
|
+
<div class="fieldset">
|
|
56
|
+
${0}
|
|
57
|
+
<input class="control"
|
|
58
|
+
id="control"
|
|
59
|
+
@input="${0}"
|
|
60
|
+
@change="${0}"
|
|
61
|
+
?autofocus="${0}"
|
|
62
|
+
?disabled="${0}"
|
|
63
|
+
list="${0}"
|
|
64
|
+
maxlength="${0}"
|
|
65
|
+
minlength="${0}"
|
|
66
|
+
pattern="${0}"
|
|
67
|
+
placeholder="${0}"
|
|
68
|
+
?readonly="${0}"
|
|
69
|
+
?required="${0}"
|
|
70
|
+
size="${0}"
|
|
71
|
+
autocomplete="${0}"
|
|
72
|
+
name="${0}"
|
|
73
|
+
?spellcheck="${0}"
|
|
74
|
+
:value="${0}"
|
|
75
|
+
type="${0}"
|
|
76
|
+
aria-atomic="${0}"
|
|
77
|
+
aria-busy="${0}"
|
|
78
|
+
aria-controls="${0}"
|
|
79
|
+
aria-current="${0}"
|
|
80
|
+
aria-describedby="${0}"
|
|
81
|
+
aria-details="${0}"
|
|
82
|
+
aria-disabled="${0}"
|
|
83
|
+
aria-errormessage="${0}"
|
|
84
|
+
aria-flowto="${0}"
|
|
85
|
+
aria-haspopup="${0}"
|
|
86
|
+
aria-hidden="${0}"
|
|
87
|
+
aria-invalid="${0}"
|
|
88
|
+
aria-keyshortcuts="${0}"
|
|
89
|
+
aria-label="${0}"
|
|
90
|
+
aria-labelledby="${0}"
|
|
91
|
+
aria-live="${0}"
|
|
92
|
+
aria-owns="${0}"
|
|
93
|
+
aria-relevant="${0}"
|
|
94
|
+
aria-roledescription="${0}"
|
|
95
|
+
${0}
|
|
96
|
+
/>
|
|
97
|
+
${0}
|
|
98
|
+
</div>
|
|
99
|
+
${0}
|
|
100
|
+
${0}
|
|
101
|
+
${0}
|
|
102
|
+
</div>`), getStateClasses, when(x => x.charCount && x.maxlength, renderCharCount()), when(x => x.label, renderLabel()), x => affixIconTemplate(x.icon), x => x.handleTextInput(), x => x.handleChange(), x => x.autofocus, x => x.disabled, x => x.list, x => x.maxlength, x => x.minlength, x => x.pattern, x => x.placeholder, x => x.readOnly, x => x.required, x => x.size, x => x.autoComplete, x => x.name, x => x.spellcheck, x => x.value, x => x.type, x => x.ariaAtomic, x => x.ariaBusy, x => x.ariaControls, x => x.ariaCurrent, x => x.ariaDescribedby, x => x.ariaDetails, x => x.ariaDisabled, x => x.ariaErrormessage, x => x.ariaFlowto, x => x.ariaHaspopup, x => x.ariaHidden, x => x.ariaInvalid, x => x.ariaKeyshortcuts, x => x.ariaLabel, x => x.ariaLabelledby, x => x.ariaLive, x => x.ariaOwns, x => x.ariaRelevant, x => x.ariaRoledescription, ref('control'), () => focusTemplate, when(x => {
|
|
103
|
+
var _a;
|
|
104
|
+
return !x.successText && !x.errorValidationMessage && ((_a = x.helperText) === null || _a === void 0 ? void 0 : _a.length);
|
|
105
|
+
}, getFeedbackTemplate('helper', context)), when(x => !x.successText && x.errorValidationMessage, getFeedbackTemplate('error', context)), when(x => x.successText, getFeedbackTemplate('success', context)));
|
|
90
106
|
};
|
|
91
107
|
|
|
92
|
-
const
|
|
93
|
-
baseName: '
|
|
94
|
-
template:
|
|
95
|
-
styles: css_248z
|
|
108
|
+
const textFieldDefinition = TextField.compose({
|
|
109
|
+
baseName: 'text-field',
|
|
110
|
+
template: TextfieldTemplate,
|
|
111
|
+
styles: css_248z,
|
|
112
|
+
shadowOptions: {
|
|
113
|
+
delegatesFocus: true
|
|
114
|
+
}
|
|
96
115
|
});
|
|
97
|
-
const
|
|
98
|
-
const
|
|
116
|
+
const textFieldRegistries = [textFieldDefinition(), ...iconRegistries, ...focusRegistries];
|
|
117
|
+
const registerTextField = registerFactory(textFieldRegistries);
|
|
99
118
|
|
|
100
|
-
export {
|
|
119
|
+
export { textFieldRegistries as a, registerTextField as r, textFieldDefinition as t };
|