@vonage/vivid 3.0.0-next.5 → 3.0.0-next.50
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 +133 -4
- package/accordion/index.js +2 -2
- package/accordion-item/index.js +26 -18
- package/action-group/index.js +49 -0
- package/badge/index.js +14 -18
- package/banner/index.js +18 -81
- package/breadcrumb/index.js +20 -16
- package/breadcrumb-item/index.js +14 -9
- package/button/index.js +28 -659
- package/calendar/index.js +37 -8
- package/calendar-event/index.js +117 -0
- package/card/index.js +134 -0
- package/checkbox/index.js +173 -0
- package/dialog/index.js +282 -0
- package/divider/index.js +88 -0
- package/elevation/index.js +4 -31
- package/fab/index.js +102 -0
- package/focus/index.js +20 -3
- package/header/index.js +68 -0
- package/icon/index.js +9 -3
- package/index.js +45 -20
- package/layout/index.js +4 -4
- package/lib/accordion-item/accordion-item.d.ts +2 -2
- package/lib/accordion-item/index.d.ts +2 -1
- package/lib/action-group/action-group.d.ts +10 -0
- package/lib/{sidenav-item/sidenav-item.template.d.ts → action-group/action-group.template.d.ts} +2 -2
- package/lib/{sidenav-item → action-group}/index.d.ts +1 -2
- package/lib/badge/badge.d.ts +6 -6
- package/lib/badge/index.d.ts +1 -1
- package/lib/banner/banner.template.d.ts +0 -2
- package/lib/banner/index.d.ts +1 -0
- package/lib/breadcrumb/breadcrumb.template.d.ts +4 -0
- package/lib/breadcrumb-item/breadcrumb-item.d.ts +1 -1
- package/lib/breadcrumb-item/index.d.ts +1 -0
- package/lib/button/button.d.ts +6 -5
- package/lib/button/index.d.ts +2 -19
- package/lib/calendar/calendar.d.ts +3 -1
- package/lib/calendar/index.d.ts +0 -1
- package/lib/calendar-event/calendar-event.d.ts +14 -0
- package/lib/calendar-event/calendar-event.template.d.ts +4 -0
- package/lib/calendar-event/index.d.ts +2 -0
- package/lib/card/card.d.ts +10 -0
- package/lib/{text/text.template.d.ts → card/card.template.d.ts} +2 -2
- package/lib/card/index.d.ts +4 -0
- package/lib/checkbox/checkbox.d.ts +5 -0
- package/lib/checkbox/checkbox.template.d.ts +4 -0
- package/lib/checkbox/index.d.ts +4 -0
- package/lib/components.d.ts +22 -10
- package/lib/dialog/dialog.d.ts +20 -0
- package/lib/dialog/dialog.template.d.ts +4 -0
- package/lib/dialog/index.d.ts +5 -0
- package/lib/divider/divider.d.ts +3 -0
- package/lib/divider/divider.template.d.ts +4 -0
- package/lib/divider/index.d.ts +2 -0
- package/lib/elevation/elevation.d.ts +1 -0
- package/lib/elevation/index.d.ts +1 -1
- package/lib/enums.d.ts +11 -5
- package/lib/fab/fab.d.ts +13 -0
- package/lib/fab/fab.template.d.ts +4 -0
- package/lib/fab/index.d.ts +4 -0
- package/lib/focus/index.d.ts +1 -1
- package/lib/header/header.d.ts +5 -0
- package/lib/header/header.template.d.ts +4 -0
- package/lib/header/index.d.ts +3 -0
- package/lib/icon/icon.d.ts +4 -3
- package/lib/layout/index.d.ts +1 -1
- package/lib/layout/layout.d.ts +3 -3
- package/lib/menu/index.d.ts +11 -0
- package/lib/menu/menu.d.ts +7 -0
- package/lib/menu/menu.template.d.ts +3 -0
- package/lib/nav/index.d.ts +2 -0
- package/lib/nav/nav.d.ts +3 -0
- package/lib/nav/nav.template.d.ts +4 -0
- package/lib/nav-disclosure/index.d.ts +4 -0
- package/lib/nav-disclosure/nav-disclosure.d.ts +10 -0
- package/lib/nav-disclosure/nav-disclosure.template.d.ts +4 -0
- package/lib/nav-item/index.d.ts +4 -0
- package/lib/{sidenav-item/sidenav-item.d.ts → nav-item/nav-item.d.ts} +2 -2
- package/lib/nav-item/nav-item.template.d.ts +4 -0
- package/lib/{text → note}/index.d.ts +1 -1
- package/lib/note/note.d.ts +10 -0
- package/lib/note/note.template.d.ts +5 -0
- package/lib/popup/index.d.ts +1 -1
- package/lib/popup/popup.d.ts +3 -15
- package/lib/progress/progress.d.ts +1 -1
- package/lib/progress-ring/progress-ring.d.ts +2 -1
- package/lib/side-drawer/index.d.ts +1 -1
- package/lib/side-drawer/side-drawer.d.ts +2 -7
- package/lib/side-drawer/side-drawer.template.d.ts +2 -2
- package/lib/text-anchor/text-anchor.d.ts +1 -1
- package/lib/text-field/index.d.ts +4 -0
- package/lib/text-field/text-field.d.ts +23 -0
- package/lib/text-field/text-field.template.d.ts +5 -0
- package/lib/tooltip/tooltip.d.ts +2 -4
- package/menu/index.js +661 -0
- package/nav/index.js +17 -0
- package/nav-disclosure/index.js +90 -0
- package/nav-item/index.js +43 -0
- package/note/index.js +68 -0
- package/package.json +48 -8
- package/popup/index.js +20 -2082
- package/progress/index.js +33 -24
- package/progress-ring/index.js +9 -3
- package/shared/anchor.js +8 -1
- package/shared/aria-global.js +3 -40
- package/shared/base-progress.js +5 -0
- package/shared/button.js +195 -0
- package/shared/calendar-event.js +26 -0
- package/shared/dialog-polyfill.esm.js +858 -0
- package/shared/enums.js +79 -0
- package/shared/es.object.assign.js +7 -6
- package/shared/export.js +972 -0
- package/shared/focus.js +5 -0
- package/shared/focus2.js +11 -0
- package/shared/form-associated.js +557 -0
- package/shared/icon.js +504 -508
- package/shared/index.js +79 -56
- package/shared/index2.js +26 -10
- package/shared/index3.js +2109 -0
- package/shared/iterators.js +61 -0
- package/shared/object-keys.js +13 -0
- package/shared/patterns/focus.d.ts +3 -0
- package/shared/patterns/index.d.ts +1 -0
- package/shared/ref.js +41 -0
- package/shared/text-anchor.js +2 -11
- package/shared/text-anchor.template.js +5 -2
- package/shared/to-string.js +51 -0
- package/shared/web.dom-collections.iterator.js +61 -1074
- package/side-drawer/index.js +33 -51
- package/styles/fonts/SpeziaCompleteVariableItalicWeb.woff +0 -0
- package/styles/fonts/SpeziaCompleteVariableItalicWeb.woff2 +0 -0
- package/styles/fonts/SpeziaCompleteVariableUprightWeb.woff +0 -0
- package/styles/fonts/SpeziaCompleteVariableUprightWeb.woff2 +0 -0
- package/styles/fonts/SpeziaMonoCompleteVariableWeb.woff +0 -0
- package/styles/fonts/SpeziaMonoCompleteVariableWeb.woff2 +0 -0
- package/styles/fonts/spezia.css +11 -11
- package/styles/themes/dark.css +12 -0
- package/styles/themes/light.css +12 -0
- package/styles/typography/desktop.css +72 -0
- package/text-anchor/index.js +8 -1
- package/text-field/index.js +412 -0
- package/tooltip/index.js +19 -21
- package/lib/text/text.d.ts +0 -10
- package/sidenav-item/index.js +0 -38
- package/text/index.js +0 -45
package/shared/index.js
CHANGED
|
@@ -275,30 +275,6 @@ const DOM = Object.freeze({
|
|
|
275
275
|
},
|
|
276
276
|
});
|
|
277
277
|
|
|
278
|
-
function spilloverSubscribe(subscriber) {
|
|
279
|
-
const spillover = this.spillover;
|
|
280
|
-
const index = spillover.indexOf(subscriber);
|
|
281
|
-
if (index === -1) {
|
|
282
|
-
spillover.push(subscriber);
|
|
283
|
-
}
|
|
284
|
-
}
|
|
285
|
-
function spilloverUnsubscribe(subscriber) {
|
|
286
|
-
const spillover = this.spillover;
|
|
287
|
-
const index = spillover.indexOf(subscriber);
|
|
288
|
-
if (index !== -1) {
|
|
289
|
-
spillover.splice(index, 1);
|
|
290
|
-
}
|
|
291
|
-
}
|
|
292
|
-
function spilloverNotifySubscribers(args) {
|
|
293
|
-
const spillover = this.spillover;
|
|
294
|
-
const source = this.source;
|
|
295
|
-
for (let i = 0, ii = spillover.length; i < ii; ++i) {
|
|
296
|
-
spillover[i].handleChange(source, args);
|
|
297
|
-
}
|
|
298
|
-
}
|
|
299
|
-
function spilloverHas(subscriber) {
|
|
300
|
-
return this.spillover.indexOf(subscriber) !== -1;
|
|
301
|
-
}
|
|
302
278
|
/**
|
|
303
279
|
* An implementation of {@link Notifier} that efficiently keeps track of
|
|
304
280
|
* subscribers interested in a specific change notification on an
|
|
@@ -328,42 +304,58 @@ class SubscriberSet {
|
|
|
328
304
|
* @param subscriber - The subscriber to test for inclusion in this set.
|
|
329
305
|
*/
|
|
330
306
|
has(subscriber) {
|
|
331
|
-
return this.
|
|
307
|
+
return this.spillover === void 0
|
|
308
|
+
? this.sub1 === subscriber || this.sub2 === subscriber
|
|
309
|
+
: this.spillover.indexOf(subscriber) !== -1;
|
|
332
310
|
}
|
|
333
311
|
/**
|
|
334
312
|
* Subscribes to notification of changes in an object's state.
|
|
335
313
|
* @param subscriber - The object that is subscribing for change notification.
|
|
336
314
|
*/
|
|
337
315
|
subscribe(subscriber) {
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
316
|
+
const spillover = this.spillover;
|
|
317
|
+
if (spillover === void 0) {
|
|
318
|
+
if (this.has(subscriber)) {
|
|
319
|
+
return;
|
|
320
|
+
}
|
|
321
|
+
if (this.sub1 === void 0) {
|
|
322
|
+
this.sub1 = subscriber;
|
|
323
|
+
return;
|
|
324
|
+
}
|
|
325
|
+
if (this.sub2 === void 0) {
|
|
326
|
+
this.sub2 = subscriber;
|
|
327
|
+
return;
|
|
328
|
+
}
|
|
329
|
+
this.spillover = [this.sub1, this.sub2, subscriber];
|
|
330
|
+
this.sub1 = void 0;
|
|
331
|
+
this.sub2 = void 0;
|
|
344
332
|
}
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
333
|
+
else {
|
|
334
|
+
const index = spillover.indexOf(subscriber);
|
|
335
|
+
if (index === -1) {
|
|
336
|
+
spillover.push(subscriber);
|
|
337
|
+
}
|
|
348
338
|
}
|
|
349
|
-
this.spillover = [this.sub1, this.sub2, subscriber];
|
|
350
|
-
this.subscribe = spilloverSubscribe;
|
|
351
|
-
this.unsubscribe = spilloverUnsubscribe;
|
|
352
|
-
this.notify = spilloverNotifySubscribers;
|
|
353
|
-
this.has = spilloverHas;
|
|
354
|
-
this.sub1 = void 0;
|
|
355
|
-
this.sub2 = void 0;
|
|
356
339
|
}
|
|
357
340
|
/**
|
|
358
341
|
* Unsubscribes from notification of changes in an object's state.
|
|
359
342
|
* @param subscriber - The object that is unsubscribing from change notification.
|
|
360
343
|
*/
|
|
361
344
|
unsubscribe(subscriber) {
|
|
362
|
-
|
|
363
|
-
|
|
345
|
+
const spillover = this.spillover;
|
|
346
|
+
if (spillover === void 0) {
|
|
347
|
+
if (this.sub1 === subscriber) {
|
|
348
|
+
this.sub1 = void 0;
|
|
349
|
+
}
|
|
350
|
+
else if (this.sub2 === subscriber) {
|
|
351
|
+
this.sub2 = void 0;
|
|
352
|
+
}
|
|
364
353
|
}
|
|
365
|
-
else
|
|
366
|
-
|
|
354
|
+
else {
|
|
355
|
+
const index = spillover.indexOf(subscriber);
|
|
356
|
+
if (index !== -1) {
|
|
357
|
+
spillover.splice(index, 1);
|
|
358
|
+
}
|
|
367
359
|
}
|
|
368
360
|
}
|
|
369
361
|
/**
|
|
@@ -371,14 +363,22 @@ class SubscriberSet {
|
|
|
371
363
|
* @param args - Data passed along to subscribers during notification.
|
|
372
364
|
*/
|
|
373
365
|
notify(args) {
|
|
374
|
-
const
|
|
375
|
-
const sub2 = this.sub2;
|
|
366
|
+
const spillover = this.spillover;
|
|
376
367
|
const source = this.source;
|
|
377
|
-
if (
|
|
378
|
-
sub1.
|
|
368
|
+
if (spillover === void 0) {
|
|
369
|
+
const sub1 = this.sub1;
|
|
370
|
+
const sub2 = this.sub2;
|
|
371
|
+
if (sub1 !== void 0) {
|
|
372
|
+
sub1.handleChange(source, args);
|
|
373
|
+
}
|
|
374
|
+
if (sub2 !== void 0) {
|
|
375
|
+
sub2.handleChange(source, args);
|
|
376
|
+
}
|
|
379
377
|
}
|
|
380
|
-
|
|
381
|
-
|
|
378
|
+
else {
|
|
379
|
+
for (let i = 0, ii = spillover.length; i < ii; ++i) {
|
|
380
|
+
spillover[i].handleChange(source, args);
|
|
381
|
+
}
|
|
382
382
|
}
|
|
383
383
|
}
|
|
384
384
|
}
|
|
@@ -424,7 +424,8 @@ class PropertyChangeNotifier {
|
|
|
424
424
|
subscribers.subscribe(subscriber);
|
|
425
425
|
}
|
|
426
426
|
else {
|
|
427
|
-
this.sourceSubscribers =
|
|
427
|
+
this.sourceSubscribers =
|
|
428
|
+
(_a = this.sourceSubscribers) !== null && _a !== void 0 ? _a : new SubscriberSet(this.source);
|
|
428
429
|
this.sourceSubscribers.subscribe(subscriber);
|
|
429
430
|
}
|
|
430
431
|
}
|
|
@@ -568,6 +569,7 @@ const Observable = FAST.getById(2 /* observable */, () => {
|
|
|
568
569
|
watcher = void 0;
|
|
569
570
|
/* eslint-disable-next-line */
|
|
570
571
|
prevValue = prev.propertySource[prev.propertyName];
|
|
572
|
+
/* eslint-disable-next-line @typescript-eslint/no-this-alias */
|
|
571
573
|
watcher = this;
|
|
572
574
|
if (propertySource === prevValue) {
|
|
573
575
|
this.needsRefresh = true;
|
|
@@ -707,6 +709,21 @@ const Observable = FAST.getById(2 /* observable */, () => {
|
|
|
707
709
|
function observable(target, nameOrAccessor) {
|
|
708
710
|
Observable.defineProperty(target, nameOrAccessor);
|
|
709
711
|
}
|
|
712
|
+
/**
|
|
713
|
+
* Decorator: Marks a property getter as having volatile observable dependencies.
|
|
714
|
+
* @param target - The target that the property is defined on.
|
|
715
|
+
* @param name - The property name.
|
|
716
|
+
* @param name - The existing descriptor.
|
|
717
|
+
* @public
|
|
718
|
+
*/
|
|
719
|
+
function volatile(target, name, descriptor) {
|
|
720
|
+
return Object.assign({}, descriptor, {
|
|
721
|
+
get: function () {
|
|
722
|
+
Observable.trackVolatile();
|
|
723
|
+
return descriptor.get.apply(this);
|
|
724
|
+
},
|
|
725
|
+
});
|
|
726
|
+
}
|
|
710
727
|
const contextEvent = FAST.getById(3 /* contextEvent */, () => {
|
|
711
728
|
let current = null;
|
|
712
729
|
return {
|
|
@@ -1128,6 +1145,7 @@ class CompilationContext {
|
|
|
1128
1145
|
this.targetIndex = -1;
|
|
1129
1146
|
}
|
|
1130
1147
|
release() {
|
|
1148
|
+
/* eslint-disable-next-line @typescript-eslint/no-this-alias */
|
|
1131
1149
|
sharedContext = this;
|
|
1132
1150
|
}
|
|
1133
1151
|
static borrow(directives) {
|
|
@@ -1606,8 +1624,6 @@ function html(strings, ...values) {
|
|
|
1606
1624
|
class ElementStyles {
|
|
1607
1625
|
constructor() {
|
|
1608
1626
|
this.targets = new WeakSet();
|
|
1609
|
-
/** @internal */
|
|
1610
|
-
this.behaviors = null;
|
|
1611
1627
|
}
|
|
1612
1628
|
/** @internal */
|
|
1613
1629
|
addStylesTo(target) {
|
|
@@ -2473,7 +2489,7 @@ class CSSDirective {
|
|
|
2473
2489
|
}
|
|
2474
2490
|
}
|
|
2475
2491
|
|
|
2476
|
-
|
|
2492
|
+
/******************************************************************************
|
|
2477
2493
|
Copyright (c) Microsoft Corporation.
|
|
2478
2494
|
|
|
2479
2495
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
@@ -2503,6 +2519,13 @@ function __classPrivateFieldGet(receiver, state, kind, f) {
|
|
|
2503
2519
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
2504
2520
|
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
2505
2521
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
2522
|
+
}
|
|
2523
|
+
|
|
2524
|
+
function __classPrivateFieldSet(receiver, state, value, kind, f) {
|
|
2525
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
2526
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
2527
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
2528
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
2506
2529
|
}
|
|
2507
2530
|
|
|
2508
2531
|
/**
|
|
@@ -4988,4 +5011,4 @@ function provideVividDesignSystem(element) {
|
|
|
4988
5011
|
}
|
|
4989
5012
|
const designSystem = provideVividDesignSystem();
|
|
4990
5013
|
|
|
4991
|
-
export { AttachedBehaviorHTMLDirective as A, DOM as D, FoundationElement as F, HTMLDirective as H, Observable as O, SubscriberSet as S, __decorate as _, attr as a, __metadata as b, __classPrivateFieldGet as c, designSystem as d, emptyArray as e,
|
|
5014
|
+
export { AttachedBehaviorHTMLDirective as A, DOM as D, FoundationElement as F, HTMLDirective as H, Observable as O, SubscriberSet as S, __decorate as _, attr as a, __metadata as b, __classPrivateFieldGet as c, designSystem as d, emptyArray as e, booleanConverter as f, HTMLView as g, html as h, __classPrivateFieldSet as i, nullableNumberConverter as n, observable as o, provideVividDesignSystem as p, volatile as v };
|
package/shared/index2.js
CHANGED
|
@@ -1,21 +1,37 @@
|
|
|
1
|
-
import { F as FoundationElement, h as html, d as designSystem } from './index.js';
|
|
1
|
+
import { F as FoundationElement, _ as __decorate, a as attr, b as __metadata, h as html, d as designSystem } from './index.js';
|
|
2
2
|
import { s as styleInject } from './style-inject.es.js';
|
|
3
|
+
import { c as classNames } from './class-names.js';
|
|
3
4
|
|
|
4
|
-
class
|
|
5
|
+
class Elevation extends FoundationElement {}
|
|
5
6
|
|
|
6
|
-
|
|
7
|
+
__decorate([attr, __metadata("design:type", Number)], Elevation.prototype, "dp", void 0);
|
|
8
|
+
|
|
9
|
+
__decorate([attr({
|
|
10
|
+
attribute: 'no-shadow',
|
|
11
|
+
mode: 'boolean'
|
|
12
|
+
}), __metadata("design:type", Boolean)], Elevation.prototype, "noShadow", void 0);
|
|
13
|
+
|
|
14
|
+
var css_248z = ":host {\n display: contents;\n}\n\n.control {\n display: contents;\n}\n.control.dp-0 {\n --_elevation-fill: var(--vvd-color-surface-0dp);\n --_elevation-shadow: var(--vvd-shadow-surface-0dp);\n}\n.control.dp-4 {\n --_elevation-fill: var(--vvd-color-surface-4dp);\n --_elevation-shadow: var(--vvd-shadow-surface-4dp);\n}\n.control.dp-8 {\n --_elevation-fill: var(--vvd-color-surface-8dp);\n --_elevation-shadow: var(--vvd-shadow-surface-8dp);\n}\n.control.dp-12 {\n --_elevation-fill: var(--vvd-color-surface-12dp);\n --_elevation-shadow: var(--vvd-shadow-surface-12dp);\n}\n.control.dp-16 {\n --_elevation-fill: var(--vvd-color-surface-16dp);\n --_elevation-shadow: var(--vvd-shadow-surface-16dp);\n}\n.control.dp-24 {\n --_elevation-fill: var(--vvd-color-surface-24dp);\n --_elevation-shadow: var(--vvd-shadow-surface-24dp);\n}\n.control:not(.dp-0, .dp-4, .dp-8, .dp-12, .dp-16, .dp-24) {\n --_elevation-fill: var(--vvd-color-surface-2dp);\n --_elevation-shadow: var(--vvd-shadow-surface-2dp);\n}\n.control ::slotted(*) {\n background-color: var(--_elevation-fill);\n filter: var(--_elevation-shadow);\n transition: background-color 0.15s linear, filter 0.15s linear;\n}\n.control.no-shadow ::slotted(*) {\n filter: none;\n}";
|
|
7
15
|
styleInject(css_248z);
|
|
8
16
|
|
|
9
17
|
let _ = t => t,
|
|
10
18
|
_t;
|
|
11
|
-
const focusTemplate = () => html(_t || (_t = _`
|
|
12
|
-
<span class="control"></span>`));
|
|
13
19
|
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
|
|
20
|
+
const getClasses = ({
|
|
21
|
+
dp,
|
|
22
|
+
noShadow
|
|
23
|
+
}) => classNames('control', [`dp-${dp}`, Boolean(dp)], ['no-shadow', Boolean(noShadow)]);
|
|
24
|
+
|
|
25
|
+
const elevationTemplate = () => html(_t || (_t = _`
|
|
26
|
+
<div class="${0}" part="base">
|
|
27
|
+
<slot></slot>
|
|
28
|
+
</div>`), getClasses);
|
|
29
|
+
|
|
30
|
+
const vividElevation = Elevation.compose({
|
|
31
|
+
baseName: 'elevation',
|
|
32
|
+
template: elevationTemplate,
|
|
17
33
|
styles: css_248z
|
|
18
34
|
});
|
|
19
|
-
designSystem.register(
|
|
35
|
+
designSystem.register(vividElevation());
|
|
20
36
|
|
|
21
|
-
export {
|
|
37
|
+
export { Elevation as E, vividElevation as v };
|