@vonage/vivid 3.0.0-next.3 → 3.0.0-next.32
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 +49 -4
- package/accordion/index.js +61 -0
- package/accordion-item/index.js +133 -0
- package/action-group/index.js +49 -0
- package/badge/index.js +27 -22
- package/banner/index.js +148 -0
- package/breadcrumb/index.js +41 -150
- package/breadcrumb-item/index.js +18 -8
- package/button/index.js +40 -663
- package/calendar/index.js +1550 -0
- package/calendar-event/index.js +117 -0
- package/card/index.js +134 -0
- package/checkbox/index.js +176 -0
- package/dialog/index.js +277 -0
- package/divider/index.js +88 -0
- package/elevation/index.js +4 -38
- package/fab/index.js +101 -0
- package/focus/index.js +20 -3
- package/header/index.js +68 -0
- package/icon/index.js +40 -5
- package/index.d.ts +1 -0
- package/index.js +50 -14
- package/layout/index.js +5 -5
- package/lib/accordion/accordion.d.ts +9 -0
- package/lib/accordion/accordion.template.d.ts +4 -0
- package/lib/accordion/index.d.ts +2 -0
- package/lib/accordion-item/accordion-item.d.ts +13 -0
- package/lib/accordion-item/accordion-item.template.d.ts +4 -0
- package/lib/accordion-item/index.d.ts +4 -0
- package/lib/action-group/action-group.d.ts +10 -0
- package/lib/action-group/action-group.template.d.ts +4 -0
- package/lib/action-group/index.d.ts +2 -0
- package/lib/badge/badge.d.ts +8 -8
- package/lib/badge/index.d.ts +1 -1
- package/lib/banner/banner.d.ts +20 -0
- package/lib/banner/banner.template.d.ts +4 -0
- package/lib/banner/index.d.ts +3 -0
- package/lib/breadcrumb/breadcrumb.template.d.ts +4 -0
- package/lib/breadcrumb-item/breadcrumb-item.d.ts +1 -1
- package/lib/breadcrumb-item/breadcrumb-item.template.d.ts +0 -1
- package/lib/breadcrumb-item/index.d.ts +2 -0
- package/lib/button/button.d.ts +9 -8
- package/lib/button/index.d.ts +2 -19
- package/lib/calendar/calendar.d.ts +13 -0
- package/lib/calendar/calendar.template.d.ts +4 -0
- package/lib/calendar/helpers/calendar.date-functions.d.ts +2 -0
- package/lib/calendar/helpers/calendar.event-context.d.ts +6 -0
- package/lib/calendar/helpers/calendar.keyboard-interactions.d.ts +9 -0
- package/lib/calendar/index.d.ts +2 -0
- 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/card/card.template.d.ts +4 -0
- 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 +23 -5
- 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 +2 -1
- package/lib/elevation/index.d.ts +1 -1
- package/lib/enums.d.ts +14 -7
- 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 -5
- package/lib/layout/index.d.ts +1 -1
- package/lib/layout/layout.d.ts +3 -3
- package/lib/note/index.d.ts +2 -0
- package/lib/note/note.d.ts +10 -0
- package/lib/note/note.template.d.ts +5 -0
- package/lib/popup/index.d.ts +4 -0
- package/lib/popup/popup.d.ts +17 -0
- package/lib/popup/popup.template.d.ts +4 -0
- package/lib/progress/index.d.ts +2 -0
- package/lib/progress/progress.d.ts +9 -0
- package/lib/progress/progress.template.d.ts +5 -0
- package/lib/progress-ring/index.d.ts +2 -0
- package/lib/progress-ring/progress-ring.d.ts +7 -0
- package/lib/progress-ring/progress-ring.template.d.ts +4 -0
- package/lib/side-drawer/index.d.ts +2 -0
- package/lib/side-drawer/side-drawer.d.ts +7 -0
- package/lib/side-drawer/side-drawer.template.d.ts +4 -0
- package/lib/sidenav/index.d.ts +2 -0
- package/lib/sidenav/sidenav.d.ts +3 -0
- package/lib/sidenav/sidenav.template.d.ts +4 -0
- package/lib/sidenav-item/index.d.ts +1 -0
- package/lib/sidenav-item/sidenav-item.d.ts +4 -5
- package/lib/text/index.d.ts +2 -0
- package/lib/text/text.d.ts +10 -0
- package/lib/text/text.template.d.ts +4 -0
- package/lib/text-anchor/text-anchor.d.ts +4 -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/index.d.ts +3 -0
- package/lib/tooltip/tooltip.d.ts +8 -0
- package/lib/tooltip/tooltip.template.d.ts +4 -0
- package/note/index.js +68 -0
- package/package.json +39 -6
- package/popup/index.js +2118 -0
- package/progress/index.js +107 -0
- package/progress-ring/index.js +82 -0
- package/shared/_has.js +58 -0
- package/shared/affix.js +10 -25
- package/shared/anchor.js +10 -3
- package/shared/aria-global.js +20 -20
- package/shared/base-progress.js +70 -0
- package/shared/breadcrumb-item.js +2 -2
- 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 +69 -0
- package/shared/export.js +972 -0
- package/shared/focus.js +5 -0
- package/shared/focus2.js +11 -0
- package/shared/form-associated.js +548 -0
- package/shared/icon.js +1389 -0
- package/shared/index.js +4940 -1426
- package/shared/index2.js +27 -4901
- package/shared/iterators.js +61 -0
- package/shared/object-keys.js +13 -0
- package/shared/patterns/affix.d.ts +3 -4
- package/shared/patterns/focus.d.ts +3 -0
- package/shared/patterns/index.d.ts +1 -0
- package/shared/slotted.js +119 -0
- package/shared/text-anchor.js +12 -0
- package/shared/text-anchor.template.js +16 -6
- package/shared/to-string.js +51 -0
- package/shared/web.dom-collections.iterator.js +46 -1059
- package/shared/when.js +15 -0
- package/side-drawer/index.js +82 -0
- package/sidenav/index.js +17 -0
- package/sidenav-item/index.js +24 -61
- package/styles/themes/dark.css +16 -4
- package/styles/themes/light.css +16 -4
- package/text/index.js +48 -0
- package/text-anchor/index.js +13 -13
- package/text-field/index.js +411 -0
- package/tooltip/index.js +70 -0
- package/shared/index3.js +0 -21
package/breadcrumb/index.js
CHANGED
|
@@ -1,142 +1,15 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { F as FoundationElement, _ as __decorate, o as observable, h as html, d as designSystem } from '../shared/index.js';
|
|
2
|
+
import { s as slotted, e as elements } from '../shared/slotted.js';
|
|
2
3
|
import { s as styleInject } from '../shared/style-inject.es.js';
|
|
3
4
|
import { B as BreadcrumbItem } from '../shared/breadcrumb-item.js';
|
|
4
|
-
import '../shared/apply-mixins.js';
|
|
5
5
|
import '../shared/anchor.js';
|
|
6
|
+
import '../shared/apply-mixins.js';
|
|
6
7
|
import '../shared/aria-global.js';
|
|
7
8
|
|
|
8
|
-
/**
|
|
9
|
-
* Creates a function that can be used to filter a Node array, selecting only elements.
|
|
10
|
-
* @param selector - An optional selector to restrict the filter to.
|
|
11
|
-
* @public
|
|
12
|
-
*/
|
|
13
|
-
function elements(selector) {
|
|
14
|
-
if (selector) {
|
|
15
|
-
return function (value, index, array) {
|
|
16
|
-
return value.nodeType === 1 && value.matches(selector);
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
return function (value, index, array) {
|
|
20
|
-
return value.nodeType === 1;
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* A base class for node observation.
|
|
25
|
-
* @internal
|
|
26
|
-
*/
|
|
27
|
-
class NodeObservationBehavior {
|
|
28
|
-
/**
|
|
29
|
-
* Creates an instance of NodeObservationBehavior.
|
|
30
|
-
* @param target - The target to assign the nodes property on.
|
|
31
|
-
* @param options - The options to use in configuring node observation.
|
|
32
|
-
*/
|
|
33
|
-
constructor(target, options) {
|
|
34
|
-
this.target = target;
|
|
35
|
-
this.options = options;
|
|
36
|
-
this.source = null;
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* Bind this behavior to the source.
|
|
40
|
-
* @param source - The source to bind to.
|
|
41
|
-
* @param context - The execution context that the binding is operating within.
|
|
42
|
-
*/
|
|
43
|
-
bind(source) {
|
|
44
|
-
const name = this.options.property;
|
|
45
|
-
this.shouldUpdate = Observable.getAccessors(source).some((x) => x.name === name);
|
|
46
|
-
this.source = source;
|
|
47
|
-
this.updateTarget(this.computeNodes());
|
|
48
|
-
if (this.shouldUpdate) {
|
|
49
|
-
this.observe();
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
/**
|
|
53
|
-
* Unbinds this behavior from the source.
|
|
54
|
-
* @param source - The source to unbind from.
|
|
55
|
-
*/
|
|
56
|
-
unbind() {
|
|
57
|
-
this.updateTarget(emptyArray);
|
|
58
|
-
this.source = null;
|
|
59
|
-
if (this.shouldUpdate) {
|
|
60
|
-
this.disconnect();
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
/** @internal */
|
|
64
|
-
handleEvent() {
|
|
65
|
-
this.updateTarget(this.computeNodes());
|
|
66
|
-
}
|
|
67
|
-
computeNodes() {
|
|
68
|
-
let nodes = this.getNodes();
|
|
69
|
-
if (this.options.filter !== void 0) {
|
|
70
|
-
nodes = nodes.filter(this.options.filter);
|
|
71
|
-
}
|
|
72
|
-
return nodes;
|
|
73
|
-
}
|
|
74
|
-
updateTarget(value) {
|
|
75
|
-
this.source[this.options.property] = value;
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
/**
|
|
80
|
-
* The runtime behavior for slotted node observation.
|
|
81
|
-
* @public
|
|
82
|
-
*/
|
|
83
|
-
class SlottedBehavior extends NodeObservationBehavior {
|
|
84
|
-
/**
|
|
85
|
-
* Creates an instance of SlottedBehavior.
|
|
86
|
-
* @param target - The slot element target to observe.
|
|
87
|
-
* @param options - The options to use when observing the slot.
|
|
88
|
-
*/
|
|
89
|
-
constructor(target, options) {
|
|
90
|
-
super(target, options);
|
|
91
|
-
}
|
|
92
|
-
/**
|
|
93
|
-
* Begins observation of the nodes.
|
|
94
|
-
*/
|
|
95
|
-
observe() {
|
|
96
|
-
this.target.addEventListener("slotchange", this);
|
|
97
|
-
}
|
|
98
|
-
/**
|
|
99
|
-
* Disconnects observation of the nodes.
|
|
100
|
-
*/
|
|
101
|
-
disconnect() {
|
|
102
|
-
this.target.removeEventListener("slotchange", this);
|
|
103
|
-
}
|
|
104
|
-
/**
|
|
105
|
-
* Retrieves the nodes that should be assigned to the target.
|
|
106
|
-
*/
|
|
107
|
-
getNodes() {
|
|
108
|
-
return this.target.assignedNodes(this.options);
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
/**
|
|
112
|
-
* A directive that observes the `assignedNodes()` of a slot and updates a property
|
|
113
|
-
* whenever they change.
|
|
114
|
-
* @param propertyOrOptions - The options used to configure slotted node observation.
|
|
115
|
-
* @public
|
|
116
|
-
*/
|
|
117
|
-
function slotted(propertyOrOptions) {
|
|
118
|
-
if (typeof propertyOrOptions === "string") {
|
|
119
|
-
propertyOrOptions = { property: propertyOrOptions };
|
|
120
|
-
}
|
|
121
|
-
return new AttachedBehaviorHTMLDirective("fast-slotted", SlottedBehavior, propertyOrOptions);
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
/**
|
|
125
|
-
* The template for the {@link @microsoft/fast-foundation#Breadcrumb} component.
|
|
126
|
-
* @public
|
|
127
|
-
*/
|
|
128
|
-
const breadcrumbTemplate = (context, definition) => html `
|
|
129
|
-
<template role="navigation">
|
|
130
|
-
<div role="list" class="list" part="list">
|
|
131
|
-
<slot
|
|
132
|
-
${slotted({ property: "slottedBreadcrumbItems", filter: elements() })}
|
|
133
|
-
></slot>
|
|
134
|
-
</div>
|
|
135
|
-
</template>
|
|
136
|
-
`;
|
|
137
|
-
|
|
138
9
|
/**
|
|
139
10
|
* A Breadcrumb Custom HTML Element.
|
|
11
|
+
* @slot - The default slot for the breadcrumb items
|
|
12
|
+
* @csspart list - The element wrapping the slotted items
|
|
140
13
|
*
|
|
141
14
|
* @public
|
|
142
15
|
*/
|
|
@@ -148,22 +21,19 @@ class Breadcrumb$1 extends FoundationElement {
|
|
|
148
21
|
return;
|
|
149
22
|
}
|
|
150
23
|
const lastNode = this.slottedBreadcrumbItems[this.slottedBreadcrumbItems.length - 1];
|
|
151
|
-
this.
|
|
152
|
-
|
|
24
|
+
this.slottedBreadcrumbItems.forEach((item) => {
|
|
25
|
+
const itemIsLastNode = item === lastNode;
|
|
26
|
+
this.setItemSeparator(item, itemIsLastNode);
|
|
27
|
+
this.setAriaCurrent(item, itemIsLastNode);
|
|
28
|
+
});
|
|
153
29
|
}
|
|
154
30
|
}
|
|
155
|
-
setItemSeparator(
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
item.separator = true;
|
|
159
|
-
}
|
|
160
|
-
});
|
|
161
|
-
if (lastNode instanceof BreadcrumbItem) {
|
|
162
|
-
lastNode.separator = false;
|
|
31
|
+
setItemSeparator(item, isLastNode) {
|
|
32
|
+
if (item instanceof BreadcrumbItem) {
|
|
33
|
+
item.separator = !isLastNode;
|
|
163
34
|
}
|
|
164
35
|
}
|
|
165
36
|
/**
|
|
166
|
-
* @internal
|
|
167
37
|
* Finds href on childnodes in the light DOM or shadow DOM.
|
|
168
38
|
* We look in the shadow DOM because we insert an anchor when breadcrumb-item has an href.
|
|
169
39
|
*/
|
|
@@ -179,17 +49,23 @@ class Breadcrumb$1 extends FoundationElement {
|
|
|
179
49
|
return null;
|
|
180
50
|
}
|
|
181
51
|
/**
|
|
182
|
-
*
|
|
52
|
+
* Sets ARIA Current for the current node
|
|
53
|
+
* If child node with an anchor tag and with href is found then set aria-current to correct value for the child node,
|
|
54
|
+
* otherwise apply aria-current to the host element, with an href
|
|
183
55
|
*/
|
|
184
|
-
|
|
185
|
-
const childNodeWithHref = this.findChildWithHref(
|
|
56
|
+
setAriaCurrent(item, isLastNode) {
|
|
57
|
+
const childNodeWithHref = this.findChildWithHref(item);
|
|
186
58
|
if (childNodeWithHref === null &&
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
59
|
+
item.hasAttribute("href") &&
|
|
60
|
+
item instanceof BreadcrumbItem) {
|
|
61
|
+
isLastNode
|
|
62
|
+
? item.setAttribute("aria-current", "page")
|
|
63
|
+
: item.removeAttribute("aria-current");
|
|
190
64
|
}
|
|
191
65
|
else if (childNodeWithHref !== null) {
|
|
192
|
-
|
|
66
|
+
isLastNode
|
|
67
|
+
? childNodeWithHref.setAttribute("aria-current", "page")
|
|
68
|
+
: childNodeWithHref.removeAttribute("aria-current");
|
|
193
69
|
}
|
|
194
70
|
}
|
|
195
71
|
}
|
|
@@ -197,6 +73,21 @@ __decorate([
|
|
|
197
73
|
observable
|
|
198
74
|
], Breadcrumb$1.prototype, "slottedBreadcrumbItems", void 0);
|
|
199
75
|
|
|
76
|
+
let _ = t => t,
|
|
77
|
+
_t;
|
|
78
|
+
const breadcrumbTemplate = () => html(_t || (_t = _`
|
|
79
|
+
<nav aria-label="breadcrumbs" class="base">
|
|
80
|
+
<div role="list" class="list">
|
|
81
|
+
<slot
|
|
82
|
+
${0}
|
|
83
|
+
></slot>
|
|
84
|
+
</div>
|
|
85
|
+
</nav>
|
|
86
|
+
`), slotted({
|
|
87
|
+
property: 'slottedBreadcrumbItems',
|
|
88
|
+
filter: elements()
|
|
89
|
+
}));
|
|
90
|
+
|
|
200
91
|
var css_248z = ".list {\n display: flex;\n}";
|
|
201
92
|
styleInject(css_248z);
|
|
202
93
|
|
package/breadcrumb-item/index.js
CHANGED
|
@@ -1,21 +1,31 @@
|
|
|
1
|
-
import
|
|
1
|
+
import '../icon/index.js';
|
|
2
|
+
import '../focus/index.js';
|
|
3
|
+
import { _ as __decorate, a as attr, b as __metadata, h as html, d as designSystem } from '../shared/index.js';
|
|
2
4
|
import { s as styleInject } from '../shared/style-inject.es.js';
|
|
3
5
|
import { B as BreadcrumbItem$1 } from '../shared/breadcrumb-item.js';
|
|
4
6
|
import { t as textAnchorTemplate } from '../shared/text-anchor.template.js';
|
|
5
|
-
import { w as when } from '../shared/
|
|
7
|
+
import { w as when } from '../shared/when.js';
|
|
6
8
|
import { c as classNames } from '../shared/class-names.js';
|
|
7
|
-
import '../shared/
|
|
9
|
+
import '../shared/icon.js';
|
|
10
|
+
import '../shared/export.js';
|
|
11
|
+
import '../shared/iterators.js';
|
|
12
|
+
import '../shared/to-string.js';
|
|
13
|
+
import '../shared/_has.js';
|
|
14
|
+
import '../shared/focus.js';
|
|
8
15
|
import '../shared/anchor.js';
|
|
16
|
+
import '../shared/apply-mixins.js';
|
|
9
17
|
import '../shared/aria-global.js';
|
|
18
|
+
import '../shared/affix.js';
|
|
10
19
|
import '../shared/web.dom-collections.iterator.js';
|
|
20
|
+
import '../shared/object-keys.js';
|
|
21
|
+
import '../shared/focus2.js';
|
|
11
22
|
|
|
12
|
-
var css_248z = "/*\n Do not edit directly\n Generated on
|
|
23
|
+
var css_248z = "/*\n Do not edit directly\n Generated on Wed, 27 Apr 2022 11:58:36 GMT\n*/\n.base {\n font: 400 ultra-condensed 14px / 20px SpeziaWebVariable;\n letter-spacing: 0px;\n text-decoration: none;\n text-transform: none;\n display: flex;\n align-items: center;\n color: var(--vvd-color-on-canvas);\n}\n.base vwc-icon {\n margin: 0 16px;\n color: var(--vvd-color-neutral-70);\n font-size: 12px;\n}\n\n.control {\n position: relative;\n font: inherit;\n}\n@supports selector(:focus-visible) {\n .control:focus {\n outline: none;\n }\n}\n.control:any-link {\n color: var(--vvd-color-cta-70);\n text-decoration: none;\n}\n.control:any-link:hover {\n text-decoration: underline;\n}\n\n.control:not(:focus-visible) > .focus-indicator {\n display: none;\n}";
|
|
13
24
|
styleInject(css_248z);
|
|
14
25
|
|
|
15
26
|
class BreadcrumbItem extends BreadcrumbItem$1 {
|
|
16
27
|
constructor() {
|
|
17
28
|
super();
|
|
18
|
-
this.text = '';
|
|
19
29
|
}
|
|
20
30
|
|
|
21
31
|
}
|
|
@@ -28,16 +38,16 @@ let _2 = t => t,
|
|
|
28
38
|
_t3,
|
|
29
39
|
_t4;
|
|
30
40
|
|
|
31
|
-
const getClasses = _ => classNames('
|
|
41
|
+
const getClasses = _ => classNames('base');
|
|
32
42
|
|
|
33
43
|
const BreadcrumbItemTemplate = (context, definition) => html(_t || (_t = _2`
|
|
34
|
-
<div
|
|
44
|
+
<div role="listitem" class="${0}">
|
|
35
45
|
${0}
|
|
36
46
|
|
|
37
47
|
${0}
|
|
38
48
|
|
|
39
49
|
${0}
|
|
40
|
-
</div>`), getClasses, when(x => x.text && !x.href, html(_t2 || (_t2 = _2`${0}`), x => x.text)), when(x => x.text && x.href && x.href.length > 0, html(_t3 || (_t3 = _2`${0}`), textAnchorTemplate())), when(x => x.separator, html(_t4 || (_t4 = _2`<vwc-icon type="chevron-right-
|
|
50
|
+
</div>`), getClasses, when(x => x.text && !x.href, html(_t2 || (_t2 = _2`${0}`), x => x.text)), when(x => x.text && x.href && x.href.length > 0, html(_t3 || (_t3 = _2`${0}`), textAnchorTemplate(context))), when(x => x.separator, html(_t4 || (_t4 = _2`<vwc-icon type="chevron-right-solid"></vwc-icon>`))));
|
|
41
51
|
|
|
42
52
|
const vividBreadcrumbItem = BreadcrumbItem.compose({
|
|
43
53
|
baseName: 'breadcrumb-item',
|