@vonage/vivid 3.0.0-next.50 → 3.0.0-next.53
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/README.md +6 -1
- package/accordion/index.js +1 -3
- package/accordion-item/index.js +1 -3
- package/action-group/index.js +1 -3
- package/avatar/index.js +51 -0
- package/badge/index.js +1 -3
- package/banner/index.js +3 -5
- package/breadcrumb/index.js +0 -2
- package/breadcrumb-item/index.js +1 -3
- package/button/index.js +1 -3
- package/calendar/index.js +1 -3
- package/calendar-event/index.js +1 -3
- package/card/index.js +1 -3
- package/checkbox/index.js +1 -3
- package/dialog/index.js +3 -6
- package/divider/index.js +1 -3
- package/elevation/index.js +0 -1
- package/fab/index.js +1 -3
- package/focus/index.js +1 -3
- package/header/index.js +1 -3
- package/icon/index.js +1 -3
- package/index.js +0 -1
- package/layout/index.js +1 -3
- package/lib/avatar/avatar.d.ts +14 -0
- package/lib/avatar/avatar.template.d.ts +4 -0
- package/lib/avatar/index.d.ts +3 -0
- package/lib/badge/badge.d.ts +1 -1
- package/lib/banner/banner.d.ts +1 -1
- package/lib/calendar-event/calendar-event.d.ts +1 -1
- package/lib/dialog/index.d.ts +1 -1
- package/lib/enums.d.ts +1 -1
- package/lib/icon/icon.d.ts +1 -1
- package/lib/note/note.d.ts +1 -1
- package/lib/text-field/text-field.d.ts +2 -9
- package/menu/index.js +0 -2
- package/nav-disclosure/index.js +1 -3
- package/nav-item/index.js +1 -3
- package/note/index.js +2 -4
- package/package.json +3 -2
- package/popup/index.js +0 -1
- package/progress/index.js +1 -3
- package/progress-ring/index.js +1 -3
- package/shared/enums.js +1 -1
- package/shared/index2.js +1 -3
- package/shared/index3.js +1 -3
- package/shared/patterns/form-elements.d.ts +22 -0
- package/side-drawer/index.js +1 -3
- package/styles/fonts/spezia.css +2 -2
- package/styles/themes/dark.css +182 -188
- package/styles/themes/light.css +182 -188
- package/styles/typography/desktop.css +77 -60
- package/text-field/index.js +67 -43
- package/tooltip/index.js +1 -3
- package/shared/style-inject.es.js +0 -28
package/text-field/index.js
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import '../icon/index.js';
|
|
2
2
|
import '../focus/index.js';
|
|
3
|
-
import { F as FoundationElement, D as DOM, _ as __decorate, a as attr, n as nullableNumberConverter, o as observable,
|
|
4
|
-
import '../shared/web.dom-collections.iterator.js';
|
|
3
|
+
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, h as html, d as designSystem } from '../shared/index.js';
|
|
5
4
|
import { b as AffixIcon, a as affixIconTemplateFactory } from '../shared/affix.js';
|
|
6
5
|
import '../shared/focus.js';
|
|
6
|
+
import '../shared/web.dom-collections.iterator.js';
|
|
7
7
|
import { a as applyMixins } from '../shared/apply-mixins.js';
|
|
8
8
|
import { F as FormAssociated } from '../shared/form-associated.js';
|
|
9
9
|
import { A as ARIAGlobalStatesAndProperties, S as StartEnd } from '../shared/aria-global.js';
|
|
10
|
-
import { s as styleInject } from '../shared/style-inject.es.js';
|
|
11
10
|
import { f as focusTemplateFactory } from '../shared/focus2.js';
|
|
12
11
|
import { w as when } from '../shared/when.js';
|
|
13
12
|
import { r as ref } from '../shared/ref.js';
|
|
@@ -233,51 +232,80 @@ class DelegatesARIATextbox {
|
|
|
233
232
|
applyMixins(DelegatesARIATextbox, ARIAGlobalStatesAndProperties);
|
|
234
233
|
applyMixins(TextField$1, StartEnd, DelegatesARIATextbox);
|
|
235
234
|
|
|
236
|
-
|
|
237
|
-
class TextField extends TextField$1 {
|
|
238
|
-
constructor() {
|
|
239
|
-
super();
|
|
240
|
-
this.charCount = false;
|
|
241
|
-
this.userValid = true;
|
|
235
|
+
const ElementInternalsKey = 'ElementInternals';
|
|
242
236
|
|
|
243
|
-
|
|
237
|
+
const supportsElementInternals = () => ElementInternalsKey in window && 'setFormValue' in window[ElementInternalsKey].prototype;
|
|
244
238
|
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
this.userValid = !this.userValid;
|
|
239
|
+
function formElements(constructor) {
|
|
240
|
+
var _Decorated_blurred;
|
|
248
241
|
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
242
|
+
class Decorated extends constructor {
|
|
243
|
+
constructor(...args) {
|
|
244
|
+
super(...args);
|
|
245
|
+
this.charCount = false;
|
|
246
|
+
this.userValid = true;
|
|
253
247
|
|
|
254
|
-
|
|
255
|
-
__classPrivateFieldSet(this, _TextField_blurred, true, "f");
|
|
248
|
+
_Decorated_blurred.set(this, false);
|
|
256
249
|
|
|
257
|
-
this.validate()
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
250
|
+
this.validate = () => {
|
|
251
|
+
if (supportsElementInternals() && this.proxy instanceof HTMLElement) {
|
|
252
|
+
this.setValidity(this.proxy.validity, this.proxy.validationMessage, this.control);
|
|
253
|
+
} else {
|
|
254
|
+
super.validate();
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
this.userValid = !this.userValid;
|
|
258
|
+
|
|
259
|
+
if (this.proxy instanceof HTMLElement) {
|
|
260
|
+
this.userValid = __classPrivateFieldGet(this, _Decorated_blurred, "f") && this.dirtyValue ? !this.validationMessage : true;
|
|
261
|
+
}
|
|
262
|
+
};
|
|
263
|
+
|
|
264
|
+
this.addEventListener('blur', () => {
|
|
265
|
+
__classPrivateFieldSet(this, _Decorated_blurred, true, "f");
|
|
266
|
+
|
|
267
|
+
this.validate();
|
|
268
|
+
});
|
|
269
|
+
this.addEventListener('focus', () => {
|
|
270
|
+
__classPrivateFieldSet(this, _Decorated_blurred, false, "f");
|
|
271
|
+
});
|
|
272
|
+
this.addEventListener('invalid', () => {
|
|
273
|
+
if (__classPrivateFieldGet(this, _Decorated_blurred, "f") && this.dirtyValue) return;
|
|
274
|
+
|
|
275
|
+
__classPrivateFieldSet(this, _Decorated_blurred, true, "f");
|
|
276
|
+
|
|
277
|
+
this.dirtyValue = true;
|
|
278
|
+
this.validate();
|
|
279
|
+
});
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
get errorValidationMessage() {
|
|
283
|
+
return this.userValid ? '' : this.validationMessage;
|
|
284
|
+
}
|
|
263
285
|
|
|
264
|
-
get errorValidationMessage() {
|
|
265
|
-
return this.userValid ? '' : this.validationMessage;
|
|
266
286
|
}
|
|
267
287
|
|
|
268
|
-
|
|
269
|
-
|
|
288
|
+
_Decorated_blurred = new WeakMap();
|
|
289
|
+
|
|
290
|
+
__decorate([attr, __metadata("design:type", String)], Decorated.prototype, "label", void 0);
|
|
270
291
|
|
|
271
|
-
__decorate([attr
|
|
292
|
+
__decorate([attr({
|
|
293
|
+
attribute: 'helper-text'
|
|
294
|
+
}), __metadata("design:type", String)], Decorated.prototype, "helperText", void 0);
|
|
272
295
|
|
|
273
|
-
__decorate([attr({
|
|
274
|
-
|
|
275
|
-
|
|
296
|
+
__decorate([attr({
|
|
297
|
+
attribute: 'char-count',
|
|
298
|
+
mode: 'boolean'
|
|
299
|
+
}), __metadata("design:type", Object)], Decorated.prototype, "charCount", void 0);
|
|
276
300
|
|
|
277
|
-
__decorate([
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
301
|
+
__decorate([observable, __metadata("design:type", Object)], Decorated.prototype, "userValid", void 0);
|
|
302
|
+
|
|
303
|
+
__decorate([volatile, __metadata("design:type", Object), __metadata("design:paramtypes", [])], Decorated.prototype, "errorValidationMessage", null);
|
|
304
|
+
|
|
305
|
+
return Decorated;
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
let TextField = class TextField extends TextField$1 {};
|
|
281
309
|
|
|
282
310
|
__decorate([attr, __metadata("design:type", String)], TextField.prototype, "density", void 0);
|
|
283
311
|
|
|
@@ -285,16 +313,12 @@ __decorate([attr, __metadata("design:type", String)], TextField.prototype, "appe
|
|
|
285
313
|
|
|
286
314
|
__decorate([attr, __metadata("design:type", String)], TextField.prototype, "shape", void 0);
|
|
287
315
|
|
|
288
|
-
__decorate([observable, __metadata("design:type", Object)], TextField.prototype, "userValid", void 0);
|
|
289
|
-
|
|
290
316
|
__decorate([attr, __metadata("design:type", String)], TextField.prototype, "autoComplete", void 0);
|
|
291
317
|
|
|
292
|
-
|
|
293
|
-
|
|
318
|
+
TextField = __decorate([formElements], TextField);
|
|
294
319
|
applyMixins(TextField, AffixIcon);
|
|
295
320
|
|
|
296
|
-
var css_248z = "
|
|
297
|
-
styleInject(css_248z);
|
|
321
|
+
var css_248z = "/**\n * Do not edit directly\n * Generated on Wed, 07 Sep 2022 15:12:22 GMT\n */\n:host {\n display: inline-block;\n}\n\n.base {\n display: inline-grid;\n width: 100%;\n gap: 4px;\n grid-template-columns: min-content 1fr max-content;\n}\n.base {\n --_appearance-color-text: var(--vvd-color-canvas-text);\n --_appearance-color-fill: var(--vvd-color-canvas);\n --_appearance-color-outline: var(--vvd-color-neutral-400);\n}\n.base.appearance-ghost {\n --_appearance-color-text: var(--_connotation-color-primary);\n --_appearance-color-fill: transaprent;\n --_appearance-color-outline: transaprent;\n}\n.base:where(:hover, .hover):where(:not(:disabled, .disabled)) {\n --_appearance-color-text: var(--vvd-color-canvas-text);\n --_appearance-color-fill: var(--vvd-color-canvas);\n --_appearance-color-outline: var(--vvd-color-canvas-text);\n}\n.base:where(:hover, .hover):where(:not(:disabled, .disabled)).appearance-ghost {\n --_appearance-color-text: var(--_connotation-color-primary);\n --_appearance-color-fill: var(--_connotation-color-faint);\n --_appearance-color-outline: transaprent;\n}\n.base:where(:disabled, .disabled) {\n --_appearance-color-text: var(--vvd-color-neutral-400);\n --_appearance-color-fill: var(--vvd-color-neutral-100);\n --_appearance-color-outline: var(--vvd-color-neutral-400);\n}\n.base:where(:disabled, .disabled).appearance-ghost {\n --_appearance-color-text: var(--vvd-color-neutral-400);\n --_appearance-color-fill: transaprent;\n --_appearance-color-outline: transaprent;\n}\n.base:where(:readonly, .readonly):where(:not(:disabled, .disabled, :hover, .hover, :active, .active)) {\n --_appearance-color-text: var(--vvd-color-canvas-text);\n --_appearance-color-fill: var(--vvd-color-neutral-100);\n --_appearance-color-outline: var(--vvd-color-neutral-400);\n}\n.base:where(:readonly, .readonly):where(:not(:disabled, .disabled, :hover, .hover, :active, .active)).appearance-ghost {\n --_appearance-color-text: var(--vvd-color-neutral-400);\n --_appearance-color-fill: transaprent;\n --_appearance-color-outline: transaprent;\n}\n.base:where(.error):where(:not(:disabled, .disabled)) {\n --_appearance-color-text: var(--vvd-color-alert-500);\n --_appearance-color-fill: var(--vvd-color-alert-100);\n --_appearance-color-outline: var(--vvd-color-alert-500);\n}\n.base:where(.error):where(:not(:disabled, .disabled)).appearance-ghost {\n --_appearance-color-text: transparent;\n --_appearance-color-fill: transparent;\n --_appearance-color-outline: transparent;\n}\n@supports (user-select: none) {\n .base {\n user-select: none;\n }\n}\n.base:not(.disabled) {\n --_low-ink-color: var(--vvd-color-neutral-600);\n}\n.base.disabled {\n --_low-ink-color: var(--vvd-color-neutral-400);\n}\n\n.label {\n contain: inline-size;\n font: var(--vvd-font-base);\n grid-column: 1/4;\n grid-row: 1;\n}\n.char-count + .label {\n grid-column: 1/3;\n}\n.base:not(.disabled) .label {\n color: var(--vvd-color-canvas-text);\n}\n.base.disabled .label {\n color: var(--vvd-color-neutral-400);\n}\n\n.char-count {\n color: var(--_low-ink-color);\n font: var(--vvd-font-base);\n grid-column: 3/4;\n}\n\n.fieldset {\n position: relative;\n display: flex;\n align-items: center;\n color: var(--_appearance-color-text);\n grid-column: 1/4;\n transition: color 0.2s;\n /* Size */\n /* Shape */\n}\n.base:not(.density-extended) > .fieldset {\n block-size: 40px;\n}\n.base.density-extended > .fieldset {\n block-size: 48px;\n}\n.base:not(.shape-pill) .fieldset {\n border-radius: 6px;\n}\n.base.shape-pill .fieldset {\n border-radius: 24px;\n}\n\n.control {\n width: 100%;\n border: 0 none;\n background-color: var(--_appearance-color-fill);\n block-size: 100%;\n border-radius: inherit;\n box-shadow: inset 0 0 0 1px var(--_appearance-color-outline);\n color: inherit;\n font: var(--vvd-font-base);\n padding-inline-end: 16px;\n padding-inline-start: 16px;\n transition: box-shadow 0.2s, background-color 0.2s;\n}\n@supports selector(:focus-visible) {\n .control:focus {\n outline: none;\n }\n}\n.control::placeholder {\n color: var(--_low-ink-color);\n}\n\n.icon {\n position: absolute;\n z-index: 1;\n color: var(--_low-ink-color);\n inset-inline-start: 16px;\n}\n.icon + .control {\n padding-inline-start: 44px;\n}\n\n.helper-text {\n color: var(--_low-ink-color);\n font: var(--vvd-font-base-condensed);\n grid-column: 1/4;\n margin-inline-start: 16px;\n}\n\n.error-message {\n display: flex;\n color: var(--vvd-color-canvas-text);\n contain: inline-size;\n font: var(--vvd-font-base-condensed);\n grid-column: 2/4;\n}\n.error-message-icon {\n color: var(--vvd-color-alert-500);\n font-size: 16px;\n grid-column: 1/2;\n}\n\n.focus-indicator {\n --focus-stroke-gap-color: transparent;\n pointer-events: none;\n}\n.fieldset:not(:focus-visible, :focus-within) > .focus-indicator {\n display: none;\n}";
|
|
298
322
|
|
|
299
323
|
let _ = t => t,
|
|
300
324
|
_t,
|
package/tooltip/index.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import '../shared/index3.js';
|
|
2
2
|
import { F as FoundationElement, _ as __decorate, a as attr, b as __metadata, h as html, d as designSystem } from '../shared/index.js';
|
|
3
|
-
import { s as styleInject } from '../shared/style-inject.es.js';
|
|
4
3
|
import '../shared/web.dom-collections.iterator.js';
|
|
5
4
|
import { c as classNames } from '../shared/class-names.js';
|
|
6
5
|
import '../shared/index2.js';
|
|
@@ -24,8 +23,7 @@ import '../shared/focus2.js';
|
|
|
24
23
|
import '../shared/object-keys.js';
|
|
25
24
|
import '../shared/es.object.assign.js';
|
|
26
25
|
|
|
27
|
-
var css_248z = "
|
|
28
|
-
styleInject(css_248z);
|
|
26
|
+
var css_248z = "/**\n * Do not edit directly\n * Generated on Wed, 07 Sep 2022 15:12:22 GMT\n */\n.control {\n pointer-events: none;\n}\n\n.tooltip {\n width: var(--tooltip-inline-size, 240px);\n}\n.tooltip-text {\n padding: 8px 12px;\n color: var(--vvd-color-canvas-text);\n font: var(--vvd-font-base-bold);\n}";
|
|
29
27
|
|
|
30
28
|
class Tooltip extends FoundationElement {
|
|
31
29
|
constructor() {
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
function styleInject(css, ref) {
|
|
2
|
-
if ( ref === void 0 ) ref = {};
|
|
3
|
-
var insertAt = ref.insertAt;
|
|
4
|
-
|
|
5
|
-
if (!css || typeof document === 'undefined') { return; }
|
|
6
|
-
|
|
7
|
-
var head = document.head || document.getElementsByTagName('head')[0];
|
|
8
|
-
var style = document.createElement('style');
|
|
9
|
-
style.type = 'text/css';
|
|
10
|
-
|
|
11
|
-
if (insertAt === 'top') {
|
|
12
|
-
if (head.firstChild) {
|
|
13
|
-
head.insertBefore(style, head.firstChild);
|
|
14
|
-
} else {
|
|
15
|
-
head.appendChild(style);
|
|
16
|
-
}
|
|
17
|
-
} else {
|
|
18
|
-
head.appendChild(style);
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
if (style.styleSheet) {
|
|
22
|
-
style.styleSheet.cssText = css;
|
|
23
|
-
} else {
|
|
24
|
-
style.appendChild(document.createTextNode(css));
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export { styleInject as s };
|