@vonage/vivid 3.0.0-next.53 → 3.0.0-next.56
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/accordion/index.js +1 -1
- package/accordion-item/index.js +1 -1
- package/action-group/index.js +1 -1
- package/avatar/index.js +1 -1
- package/badge/index.js +1 -1
- package/banner/index.js +1 -1
- package/breadcrumb-item/index.js +1 -1
- package/button/index.js +1 -1
- package/calendar/index.js +1 -1
- package/calendar-event/index.js +1 -1
- package/card/index.js +1 -1
- package/checkbox/index.js +1 -1
- package/dialog/index.js +1 -1
- package/divider/index.js +1 -1
- package/fab/index.js +1 -1
- package/focus/index.js +1 -1
- package/header/index.js +1 -1
- package/index.js +1 -0
- package/lib/text-area/index.d.ts +3 -0
- package/lib/text-area/text-area.d.ts +9 -0
- package/lib/text-area/text-area.template.d.ts +4 -0
- package/nav-disclosure/index.js +1 -1
- package/nav-item/index.js +1 -1
- package/note/index.js +1 -1
- package/package.json +3 -2
- package/progress/index.js +1 -1
- package/progress-ring/index.js +1 -1
- package/shared/form-elements.js +294 -0
- package/shared/patterns/form-elements.d.ts +1 -1
- package/side-drawer/index.js +1 -1
- package/styles/themes/dark.css +2 -2
- package/styles/themes/light.css +2 -2
- package/styles/typography/desktop.css +29 -14
- package/text-area/index.js +298 -0
- package/text-field/index.js +6 -292
- package/tooltip/index.js +1 -1
|
@@ -0,0 +1,294 @@
|
|
|
1
|
+
import { F as FoundationElement, D as DOM, _ as __decorate, a as attr, n as nullableNumberConverter, o as observable, b as __metadata, v as volatile, c as __classPrivateFieldGet, i as __classPrivateFieldSet } from './index.js';
|
|
2
|
+
import { a as applyMixins } from './apply-mixins.js';
|
|
3
|
+
import { F as FormAssociated } from './form-associated.js';
|
|
4
|
+
import { A as ARIAGlobalStatesAndProperties, S as StartEnd } from './aria-global.js';
|
|
5
|
+
import './web.dom-collections.iterator.js';
|
|
6
|
+
|
|
7
|
+
class _TextField extends FoundationElement {
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* A form-associated base class for the {@link @microsoft/fast-foundation#(TextField:class)} component.
|
|
11
|
+
*
|
|
12
|
+
* @internal
|
|
13
|
+
*/
|
|
14
|
+
class FormAssociatedTextField extends FormAssociated(_TextField) {
|
|
15
|
+
constructor() {
|
|
16
|
+
super(...arguments);
|
|
17
|
+
this.proxy = document.createElement("input");
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Text field sub-types
|
|
23
|
+
* @public
|
|
24
|
+
*/
|
|
25
|
+
const TextFieldType = {
|
|
26
|
+
/**
|
|
27
|
+
* An email TextField
|
|
28
|
+
*/
|
|
29
|
+
email: "email",
|
|
30
|
+
/**
|
|
31
|
+
* A password TextField
|
|
32
|
+
*/
|
|
33
|
+
password: "password",
|
|
34
|
+
/**
|
|
35
|
+
* A telephone TextField
|
|
36
|
+
*/
|
|
37
|
+
tel: "tel",
|
|
38
|
+
/**
|
|
39
|
+
* A text TextField
|
|
40
|
+
*/
|
|
41
|
+
text: "text",
|
|
42
|
+
/**
|
|
43
|
+
* A URL TextField
|
|
44
|
+
*/
|
|
45
|
+
url: "url",
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* A Text Field Custom HTML Element.
|
|
50
|
+
* Based largely on the {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/text | <input type="text" /> element }.
|
|
51
|
+
*
|
|
52
|
+
* @slot start - Content which can be provided before the number field input
|
|
53
|
+
* @slot end - Content which can be provided after the number field input
|
|
54
|
+
* @slot - The default slot for the label
|
|
55
|
+
* @csspart label - The label
|
|
56
|
+
* @csspart root - The element wrapping the control, including start and end slots
|
|
57
|
+
* @csspart control - The text field element
|
|
58
|
+
* @fires change - Fires a custom 'change' event when the value has changed
|
|
59
|
+
*
|
|
60
|
+
* @public
|
|
61
|
+
*/
|
|
62
|
+
class TextField extends FormAssociatedTextField {
|
|
63
|
+
constructor() {
|
|
64
|
+
super(...arguments);
|
|
65
|
+
/**
|
|
66
|
+
* Allows setting a type or mode of text.
|
|
67
|
+
* @public
|
|
68
|
+
* @remarks
|
|
69
|
+
* HTML Attribute: type
|
|
70
|
+
*/
|
|
71
|
+
this.type = TextFieldType.text;
|
|
72
|
+
}
|
|
73
|
+
readOnlyChanged() {
|
|
74
|
+
if (this.proxy instanceof HTMLInputElement) {
|
|
75
|
+
this.proxy.readOnly = this.readOnly;
|
|
76
|
+
this.validate();
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
autofocusChanged() {
|
|
80
|
+
if (this.proxy instanceof HTMLInputElement) {
|
|
81
|
+
this.proxy.autofocus = this.autofocus;
|
|
82
|
+
this.validate();
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
placeholderChanged() {
|
|
86
|
+
if (this.proxy instanceof HTMLInputElement) {
|
|
87
|
+
this.proxy.placeholder = this.placeholder;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
typeChanged() {
|
|
91
|
+
if (this.proxy instanceof HTMLInputElement) {
|
|
92
|
+
this.proxy.type = this.type;
|
|
93
|
+
this.validate();
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
listChanged() {
|
|
97
|
+
if (this.proxy instanceof HTMLInputElement) {
|
|
98
|
+
this.proxy.setAttribute("list", this.list);
|
|
99
|
+
this.validate();
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
maxlengthChanged() {
|
|
103
|
+
if (this.proxy instanceof HTMLInputElement) {
|
|
104
|
+
this.proxy.maxLength = this.maxlength;
|
|
105
|
+
this.validate();
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
minlengthChanged() {
|
|
109
|
+
if (this.proxy instanceof HTMLInputElement) {
|
|
110
|
+
this.proxy.minLength = this.minlength;
|
|
111
|
+
this.validate();
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
patternChanged() {
|
|
115
|
+
if (this.proxy instanceof HTMLInputElement) {
|
|
116
|
+
this.proxy.pattern = this.pattern;
|
|
117
|
+
this.validate();
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
sizeChanged() {
|
|
121
|
+
if (this.proxy instanceof HTMLInputElement) {
|
|
122
|
+
this.proxy.size = this.size;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
spellcheckChanged() {
|
|
126
|
+
if (this.proxy instanceof HTMLInputElement) {
|
|
127
|
+
this.proxy.spellcheck = this.spellcheck;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* @internal
|
|
132
|
+
*/
|
|
133
|
+
connectedCallback() {
|
|
134
|
+
super.connectedCallback();
|
|
135
|
+
this.proxy.setAttribute("type", this.type);
|
|
136
|
+
this.validate();
|
|
137
|
+
if (this.autofocus) {
|
|
138
|
+
DOM.queueUpdate(() => {
|
|
139
|
+
this.focus();
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Selects all the text in the text field
|
|
145
|
+
*
|
|
146
|
+
* @public
|
|
147
|
+
*/
|
|
148
|
+
select() {
|
|
149
|
+
this.control.select();
|
|
150
|
+
/**
|
|
151
|
+
* The select event does not permeate the shadow DOM boundary.
|
|
152
|
+
* This fn effectively proxies the select event,
|
|
153
|
+
* emitting a `select` event whenever the internal
|
|
154
|
+
* control emits a `select` event
|
|
155
|
+
*/
|
|
156
|
+
this.$emit("select");
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Handles the internal control's `input` event
|
|
160
|
+
* @internal
|
|
161
|
+
*/
|
|
162
|
+
handleTextInput() {
|
|
163
|
+
this.value = this.control.value;
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Change event handler for inner control.
|
|
167
|
+
* @remarks
|
|
168
|
+
* "Change" events are not `composable` so they will not
|
|
169
|
+
* permeate the shadow DOM boundary. This fn effectively proxies
|
|
170
|
+
* the change event, emitting a `change` event whenever the internal
|
|
171
|
+
* control emits a `change` event
|
|
172
|
+
* @internal
|
|
173
|
+
*/
|
|
174
|
+
handleChange() {
|
|
175
|
+
this.$emit("change");
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
__decorate([
|
|
179
|
+
attr({ attribute: "readonly", mode: "boolean" })
|
|
180
|
+
], TextField.prototype, "readOnly", void 0);
|
|
181
|
+
__decorate([
|
|
182
|
+
attr({ mode: "boolean" })
|
|
183
|
+
], TextField.prototype, "autofocus", void 0);
|
|
184
|
+
__decorate([
|
|
185
|
+
attr
|
|
186
|
+
], TextField.prototype, "placeholder", void 0);
|
|
187
|
+
__decorate([
|
|
188
|
+
attr
|
|
189
|
+
], TextField.prototype, "type", void 0);
|
|
190
|
+
__decorate([
|
|
191
|
+
attr
|
|
192
|
+
], TextField.prototype, "list", void 0);
|
|
193
|
+
__decorate([
|
|
194
|
+
attr({ converter: nullableNumberConverter })
|
|
195
|
+
], TextField.prototype, "maxlength", void 0);
|
|
196
|
+
__decorate([
|
|
197
|
+
attr({ converter: nullableNumberConverter })
|
|
198
|
+
], TextField.prototype, "minlength", void 0);
|
|
199
|
+
__decorate([
|
|
200
|
+
attr
|
|
201
|
+
], TextField.prototype, "pattern", void 0);
|
|
202
|
+
__decorate([
|
|
203
|
+
attr({ converter: nullableNumberConverter })
|
|
204
|
+
], TextField.prototype, "size", void 0);
|
|
205
|
+
__decorate([
|
|
206
|
+
attr({ mode: "boolean" })
|
|
207
|
+
], TextField.prototype, "spellcheck", void 0);
|
|
208
|
+
__decorate([
|
|
209
|
+
observable
|
|
210
|
+
], TextField.prototype, "defaultSlottedNodes", void 0);
|
|
211
|
+
/**
|
|
212
|
+
* Includes ARIA states and properties relating to the ARIA textbox role
|
|
213
|
+
*
|
|
214
|
+
* @public
|
|
215
|
+
*/
|
|
216
|
+
class DelegatesARIATextbox {
|
|
217
|
+
}
|
|
218
|
+
applyMixins(DelegatesARIATextbox, ARIAGlobalStatesAndProperties);
|
|
219
|
+
applyMixins(TextField, StartEnd, DelegatesARIATextbox);
|
|
220
|
+
|
|
221
|
+
const ElementInternalsKey = 'ElementInternals';
|
|
222
|
+
|
|
223
|
+
const supportsElementInternals = () => ElementInternalsKey in window && 'setFormValue' in window[ElementInternalsKey].prototype;
|
|
224
|
+
|
|
225
|
+
function formElements(constructor) {
|
|
226
|
+
var _Decorated_blurred;
|
|
227
|
+
|
|
228
|
+
class Decorated extends constructor {
|
|
229
|
+
constructor(...args) {
|
|
230
|
+
super(...args);
|
|
231
|
+
this.charCount = false;
|
|
232
|
+
this.userValid = true;
|
|
233
|
+
|
|
234
|
+
_Decorated_blurred.set(this, false);
|
|
235
|
+
|
|
236
|
+
this.validate = () => {
|
|
237
|
+
if (supportsElementInternals() && this.proxy instanceof HTMLElement) {
|
|
238
|
+
this.setValidity(this.proxy.validity, this.proxy.validationMessage, this.control);
|
|
239
|
+
} else {
|
|
240
|
+
super.validate();
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
this.userValid = !this.userValid;
|
|
244
|
+
|
|
245
|
+
if (this.proxy instanceof HTMLElement) {
|
|
246
|
+
this.userValid = __classPrivateFieldGet(this, _Decorated_blurred, "f") && this.dirtyValue ? !this.validationMessage : true;
|
|
247
|
+
}
|
|
248
|
+
};
|
|
249
|
+
|
|
250
|
+
this.addEventListener('blur', () => {
|
|
251
|
+
__classPrivateFieldSet(this, _Decorated_blurred, true, "f");
|
|
252
|
+
|
|
253
|
+
this.validate();
|
|
254
|
+
});
|
|
255
|
+
this.addEventListener('focus', () => {
|
|
256
|
+
__classPrivateFieldSet(this, _Decorated_blurred, false, "f");
|
|
257
|
+
});
|
|
258
|
+
this.addEventListener('invalid', () => {
|
|
259
|
+
if (__classPrivateFieldGet(this, _Decorated_blurred, "f") && this.dirtyValue) return;
|
|
260
|
+
|
|
261
|
+
__classPrivateFieldSet(this, _Decorated_blurred, true, "f");
|
|
262
|
+
|
|
263
|
+
this.dirtyValue = true;
|
|
264
|
+
this.validate();
|
|
265
|
+
});
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
get errorValidationMessage() {
|
|
269
|
+
return this.userValid ? '' : this.validationMessage;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
_Decorated_blurred = new WeakMap();
|
|
275
|
+
|
|
276
|
+
__decorate([attr, __metadata("design:type", String)], Decorated.prototype, "label", void 0);
|
|
277
|
+
|
|
278
|
+
__decorate([attr({
|
|
279
|
+
attribute: 'helper-text'
|
|
280
|
+
}), __metadata("design:type", String)], Decorated.prototype, "helperText", void 0);
|
|
281
|
+
|
|
282
|
+
__decorate([attr({
|
|
283
|
+
attribute: 'char-count',
|
|
284
|
+
mode: 'boolean'
|
|
285
|
+
}), __metadata("design:type", Object)], Decorated.prototype, "charCount", void 0);
|
|
286
|
+
|
|
287
|
+
__decorate([observable, __metadata("design:type", Object)], Decorated.prototype, "userValid", void 0);
|
|
288
|
+
|
|
289
|
+
__decorate([volatile, __metadata("design:type", Object), __metadata("design:paramtypes", [])], Decorated.prototype, "errorValidationMessage", null);
|
|
290
|
+
|
|
291
|
+
return Decorated;
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
export { DelegatesARIATextbox as D, TextField as T, formElements as f };
|
|
@@ -15,7 +15,7 @@ export declare function formElements<T extends {
|
|
|
15
15
|
helperText?: string | undefined;
|
|
16
16
|
charCount: boolean;
|
|
17
17
|
userValid: boolean;
|
|
18
|
-
"__#
|
|
18
|
+
"__#5963@#blurred": boolean;
|
|
19
19
|
readonly errorValidationMessage: any;
|
|
20
20
|
validate: () => void;
|
|
21
21
|
};
|
package/side-drawer/index.js
CHANGED
|
@@ -33,7 +33,7 @@ __decorate([attr({
|
|
|
33
33
|
mode: 'boolean'
|
|
34
34
|
}), __metadata("design:type", Object)], SideDrawer.prototype, "trailing", void 0);
|
|
35
35
|
|
|
36
|
-
var css_248z = "/**\n * Do not edit directly\n * Generated on
|
|
36
|
+
var css_248z = "/**\n * Do not edit directly\n * Generated on Fri, 09 Sep 2022 16:43:40 GMT\n */\n.control {\n position: fixed;\n z-index: 1;\n background-color: var(--vvd-color-canvas);\n color: var(--vvd-color-canvas-text);\n inline-size: 280px;\n inset-block: 0;\n overflow-y: auto;\n}\n.control.alternate {\n background-color: var(--vvd-color-canvas);\n}\n.control.trailing {\n inset-inline-end: 0;\n}\n.control:not(.open).trailing {\n transform: translateX(100%);\n}\n.control:not(.open):not(.trailing) {\n transform: translateX(-100%);\n}\n.control.open:not(.modal).trailing + .side-drawer-app-content {\n margin-inline-end: var(--side-drawer-app-content-offset, 280px);\n}\n.control.open:not(.modal):not(.trailing) + .side-drawer-app-content {\n margin-inline-start: var(--side-drawer-app-content-offset, 280px);\n}\n@media (prefers-reduced-motion: no-preference) {\n .control {\n transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);\n }\n}\n\n.scrim {\n background-color: var(--vvd-color-canvas-text);\n opacity: 0.5;\n position: fixed;\n inset: 0;\n}\n.scrim:not(.open) {\n display: none;\n}";
|
|
37
37
|
|
|
38
38
|
let _ = t => t,
|
|
39
39
|
_t,
|
package/styles/themes/dark.css
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Do not edit directly
|
|
3
|
-
* Generated on
|
|
3
|
+
* Generated on Fri, 09 Sep 2022 16:43:40 GMT
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
6
6
|
* Do not edit directly
|
|
7
|
-
* Generated on
|
|
7
|
+
* Generated on Fri, 09 Sep 2022 16:43:40 GMT
|
|
8
8
|
*/
|
|
9
9
|
:root, .vvd-theme-main, ::part(vvd-theme-main) {
|
|
10
10
|
--vvd-color-canvas: #000000;
|
package/styles/themes/light.css
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Do not edit directly
|
|
3
|
-
* Generated on
|
|
3
|
+
* Generated on Fri, 09 Sep 2022 16:43:40 GMT
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
6
6
|
* Do not edit directly
|
|
7
|
-
* Generated on
|
|
7
|
+
* Generated on Fri, 09 Sep 2022 16:43:40 GMT
|
|
8
8
|
*/
|
|
9
9
|
:root, .vvd-theme-main, ::part(vvd-theme-main) {
|
|
10
10
|
--vvd-color-canvas: #ffffff;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Do not edit directly
|
|
3
|
-
* Generated on
|
|
3
|
+
* Generated on Fri, 09 Sep 2022 16:43:41 GMT
|
|
4
4
|
*/
|
|
5
5
|
/**
|
|
6
6
|
* Do not edit directly
|
|
7
|
-
* Generated on
|
|
7
|
+
* Generated on Fri, 09 Sep 2022 16:43:40 GMT
|
|
8
8
|
*/
|
|
9
9
|
:root {
|
|
10
10
|
--vvd-font-headline: 500 condensed 66px/88px SpeziaCompleteVariableUpright;
|
|
@@ -22,7 +22,6 @@
|
|
|
22
22
|
--vvd-font-base-condensed: 400 ultra-condensed 12px/16px SpeziaCompleteVariableUpright;
|
|
23
23
|
--vvd-font-base-condensed-bold: 600 ultra-condensed 12px/16px SpeziaCompleteVariableUpright;
|
|
24
24
|
--vvd-font-base-condensed-code: 400 ultra-condensed 12px/16px SpeziaMonoCompleteVariable;
|
|
25
|
-
font-size: 62.5%;
|
|
26
25
|
}
|
|
27
26
|
|
|
28
27
|
body {
|
|
@@ -30,14 +29,19 @@ body {
|
|
|
30
29
|
text-rendering: optimizeLegibility; /* emphasise on legibility when rendering, turns on ligatures and kerning */
|
|
31
30
|
-webkit-font-smoothing: antialiased; /* apply font anti-aliasing for Webkit on OSX */
|
|
32
31
|
-moz-osx-font-smoothing: grayscale; /* apply font anti-aliasing for Firefox on OSX */
|
|
33
|
-
font: var(--vvd-font-base
|
|
32
|
+
font: var(--vvd-font-base);
|
|
34
33
|
}
|
|
35
34
|
|
|
36
|
-
|
|
35
|
+
p {
|
|
36
|
+
font: var(--vvd-font-base);
|
|
37
|
+
margin-block: 16px;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
b, strong {
|
|
37
41
|
font: var(--vvd-font-base-bold);
|
|
38
42
|
}
|
|
39
43
|
|
|
40
|
-
code {
|
|
44
|
+
pre, var, code, kbd, samp {
|
|
41
45
|
font: var(--vvd-font-base-code);
|
|
42
46
|
}
|
|
43
47
|
|
|
@@ -71,19 +75,30 @@ h4, .heading4 {
|
|
|
71
75
|
margin-block: 24px;
|
|
72
76
|
}
|
|
73
77
|
|
|
74
|
-
|
|
75
|
-
font: var(--vvd-font-base-
|
|
78
|
+
small, figcaption {
|
|
79
|
+
font: var(--vvd-font-base-condensed);
|
|
80
|
+
}
|
|
81
|
+
small b, small strong, figcaption b, figcaption strong {
|
|
82
|
+
font: var(--vvd-font-base-condensed-bold);
|
|
83
|
+
}
|
|
84
|
+
small pre, small var, small code, small kbd, small samp, figcaption pre, figcaption var, figcaption code, figcaption kbd, figcaption samp {
|
|
85
|
+
font: var(--vvd-font-base-condensed-code);
|
|
76
86
|
}
|
|
77
87
|
|
|
78
|
-
|
|
79
|
-
|
|
88
|
+
sub,
|
|
89
|
+
sup {
|
|
90
|
+
font: 75%;
|
|
91
|
+
line-height: 0;
|
|
92
|
+
position: relative;
|
|
93
|
+
vertical-align: baseline;
|
|
80
94
|
}
|
|
81
95
|
|
|
82
|
-
|
|
83
|
-
|
|
96
|
+
sub {
|
|
97
|
+
bottom: -0.25em;
|
|
84
98
|
}
|
|
85
|
-
|
|
86
|
-
|
|
99
|
+
|
|
100
|
+
sup {
|
|
101
|
+
top: -0.5em;
|
|
87
102
|
}
|
|
88
103
|
|
|
89
104
|
/*# sourceMappingURL=desktop.css.map */
|