@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.
Files changed (152) hide show
  1. package/README.md +49 -4
  2. package/accordion/index.js +61 -0
  3. package/accordion-item/index.js +133 -0
  4. package/action-group/index.js +49 -0
  5. package/badge/index.js +27 -22
  6. package/banner/index.js +148 -0
  7. package/breadcrumb/index.js +41 -150
  8. package/breadcrumb-item/index.js +18 -8
  9. package/button/index.js +40 -663
  10. package/calendar/index.js +1550 -0
  11. package/calendar-event/index.js +117 -0
  12. package/card/index.js +134 -0
  13. package/checkbox/index.js +176 -0
  14. package/dialog/index.js +277 -0
  15. package/divider/index.js +88 -0
  16. package/elevation/index.js +4 -38
  17. package/fab/index.js +101 -0
  18. package/focus/index.js +20 -3
  19. package/header/index.js +68 -0
  20. package/icon/index.js +40 -5
  21. package/index.d.ts +1 -0
  22. package/index.js +50 -14
  23. package/layout/index.js +5 -5
  24. package/lib/accordion/accordion.d.ts +9 -0
  25. package/lib/accordion/accordion.template.d.ts +4 -0
  26. package/lib/accordion/index.d.ts +2 -0
  27. package/lib/accordion-item/accordion-item.d.ts +13 -0
  28. package/lib/accordion-item/accordion-item.template.d.ts +4 -0
  29. package/lib/accordion-item/index.d.ts +4 -0
  30. package/lib/action-group/action-group.d.ts +10 -0
  31. package/lib/action-group/action-group.template.d.ts +4 -0
  32. package/lib/action-group/index.d.ts +2 -0
  33. package/lib/badge/badge.d.ts +8 -8
  34. package/lib/badge/index.d.ts +1 -1
  35. package/lib/banner/banner.d.ts +20 -0
  36. package/lib/banner/banner.template.d.ts +4 -0
  37. package/lib/banner/index.d.ts +3 -0
  38. package/lib/breadcrumb/breadcrumb.template.d.ts +4 -0
  39. package/lib/breadcrumb-item/breadcrumb-item.d.ts +1 -1
  40. package/lib/breadcrumb-item/breadcrumb-item.template.d.ts +0 -1
  41. package/lib/breadcrumb-item/index.d.ts +2 -0
  42. package/lib/button/button.d.ts +9 -8
  43. package/lib/button/index.d.ts +2 -19
  44. package/lib/calendar/calendar.d.ts +13 -0
  45. package/lib/calendar/calendar.template.d.ts +4 -0
  46. package/lib/calendar/helpers/calendar.date-functions.d.ts +2 -0
  47. package/lib/calendar/helpers/calendar.event-context.d.ts +6 -0
  48. package/lib/calendar/helpers/calendar.keyboard-interactions.d.ts +9 -0
  49. package/lib/calendar/index.d.ts +2 -0
  50. package/lib/calendar-event/calendar-event.d.ts +14 -0
  51. package/lib/calendar-event/calendar-event.template.d.ts +4 -0
  52. package/lib/calendar-event/index.d.ts +2 -0
  53. package/lib/card/card.d.ts +10 -0
  54. package/lib/card/card.template.d.ts +4 -0
  55. package/lib/card/index.d.ts +4 -0
  56. package/lib/checkbox/checkbox.d.ts +5 -0
  57. package/lib/checkbox/checkbox.template.d.ts +4 -0
  58. package/lib/checkbox/index.d.ts +4 -0
  59. package/lib/components.d.ts +23 -5
  60. package/lib/dialog/dialog.d.ts +20 -0
  61. package/lib/dialog/dialog.template.d.ts +4 -0
  62. package/lib/dialog/index.d.ts +5 -0
  63. package/lib/divider/divider.d.ts +3 -0
  64. package/lib/divider/divider.template.d.ts +4 -0
  65. package/lib/divider/index.d.ts +2 -0
  66. package/lib/elevation/elevation.d.ts +2 -1
  67. package/lib/elevation/index.d.ts +1 -1
  68. package/lib/enums.d.ts +14 -7
  69. package/lib/fab/fab.d.ts +13 -0
  70. package/lib/fab/fab.template.d.ts +4 -0
  71. package/lib/fab/index.d.ts +4 -0
  72. package/lib/focus/index.d.ts +1 -1
  73. package/lib/header/header.d.ts +5 -0
  74. package/lib/header/header.template.d.ts +4 -0
  75. package/lib/header/index.d.ts +3 -0
  76. package/lib/icon/icon.d.ts +4 -5
  77. package/lib/layout/index.d.ts +1 -1
  78. package/lib/layout/layout.d.ts +3 -3
  79. package/lib/note/index.d.ts +2 -0
  80. package/lib/note/note.d.ts +10 -0
  81. package/lib/note/note.template.d.ts +5 -0
  82. package/lib/popup/index.d.ts +4 -0
  83. package/lib/popup/popup.d.ts +17 -0
  84. package/lib/popup/popup.template.d.ts +4 -0
  85. package/lib/progress/index.d.ts +2 -0
  86. package/lib/progress/progress.d.ts +9 -0
  87. package/lib/progress/progress.template.d.ts +5 -0
  88. package/lib/progress-ring/index.d.ts +2 -0
  89. package/lib/progress-ring/progress-ring.d.ts +7 -0
  90. package/lib/progress-ring/progress-ring.template.d.ts +4 -0
  91. package/lib/side-drawer/index.d.ts +2 -0
  92. package/lib/side-drawer/side-drawer.d.ts +7 -0
  93. package/lib/side-drawer/side-drawer.template.d.ts +4 -0
  94. package/lib/sidenav/index.d.ts +2 -0
  95. package/lib/sidenav/sidenav.d.ts +3 -0
  96. package/lib/sidenav/sidenav.template.d.ts +4 -0
  97. package/lib/sidenav-item/index.d.ts +1 -0
  98. package/lib/sidenav-item/sidenav-item.d.ts +4 -5
  99. package/lib/text/index.d.ts +2 -0
  100. package/lib/text/text.d.ts +10 -0
  101. package/lib/text/text.template.d.ts +4 -0
  102. package/lib/text-anchor/text-anchor.d.ts +4 -1
  103. package/lib/text-field/index.d.ts +4 -0
  104. package/lib/text-field/text-field.d.ts +23 -0
  105. package/lib/text-field/text-field.template.d.ts +5 -0
  106. package/lib/tooltip/index.d.ts +3 -0
  107. package/lib/tooltip/tooltip.d.ts +8 -0
  108. package/lib/tooltip/tooltip.template.d.ts +4 -0
  109. package/note/index.js +68 -0
  110. package/package.json +39 -6
  111. package/popup/index.js +2118 -0
  112. package/progress/index.js +107 -0
  113. package/progress-ring/index.js +82 -0
  114. package/shared/_has.js +58 -0
  115. package/shared/affix.js +10 -25
  116. package/shared/anchor.js +10 -3
  117. package/shared/aria-global.js +20 -20
  118. package/shared/base-progress.js +70 -0
  119. package/shared/breadcrumb-item.js +2 -2
  120. package/shared/button.js +195 -0
  121. package/shared/calendar-event.js +26 -0
  122. package/shared/dialog-polyfill.esm.js +858 -0
  123. package/shared/enums.js +79 -0
  124. package/shared/es.object.assign.js +69 -0
  125. package/shared/export.js +972 -0
  126. package/shared/focus.js +5 -0
  127. package/shared/focus2.js +11 -0
  128. package/shared/form-associated.js +548 -0
  129. package/shared/icon.js +1389 -0
  130. package/shared/index.js +4940 -1426
  131. package/shared/index2.js +27 -4901
  132. package/shared/iterators.js +61 -0
  133. package/shared/object-keys.js +13 -0
  134. package/shared/patterns/affix.d.ts +3 -4
  135. package/shared/patterns/focus.d.ts +3 -0
  136. package/shared/patterns/index.d.ts +1 -0
  137. package/shared/slotted.js +119 -0
  138. package/shared/text-anchor.js +12 -0
  139. package/shared/text-anchor.template.js +16 -6
  140. package/shared/to-string.js +51 -0
  141. package/shared/web.dom-collections.iterator.js +46 -1059
  142. package/shared/when.js +15 -0
  143. package/side-drawer/index.js +82 -0
  144. package/sidenav/index.js +17 -0
  145. package/sidenav-item/index.js +24 -61
  146. package/styles/themes/dark.css +16 -4
  147. package/styles/themes/light.css +16 -4
  148. package/text/index.js +48 -0
  149. package/text-anchor/index.js +13 -13
  150. package/text-field/index.js +411 -0
  151. package/tooltip/index.js +70 -0
  152. package/shared/index3.js +0 -21
@@ -1,142 +1,15 @@
1
- import { O as Observable, e as emptyArray, A as AttachedBehaviorHTMLDirective, h as html, F as FoundationElement, _ as __decorate, o as observable, d as designSystem } from '../shared/index2.js';
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.setItemSeparator(lastNode);
152
- this.setLastItemAriaCurrent(lastNode);
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(lastNode) {
156
- this.slottedBreadcrumbItems.forEach((item) => {
157
- if (item instanceof BreadcrumbItem) {
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
- * If child node with an anchor tag and with href is found then apply aria-current to child node otherwise apply aria-current to the host element, with an href
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
- setLastItemAriaCurrent(lastNode) {
185
- const childNodeWithHref = this.findChildWithHref(lastNode);
56
+ setAriaCurrent(item, isLastNode) {
57
+ const childNodeWithHref = this.findChildWithHref(item);
186
58
  if (childNodeWithHref === null &&
187
- lastNode.hasAttribute("href") &&
188
- lastNode instanceof BreadcrumbItem) {
189
- lastNode.ariaCurrent = "page";
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
- childNodeWithHref.setAttribute("aria-current", "page");
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
 
@@ -1,21 +1,31 @@
1
- import { _ as __decorate, a as attr, b as __metadata, h as html, d as designSystem } from '../shared/index2.js';
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/index.js';
7
+ import { w as when } from '../shared/when.js';
6
8
  import { c as classNames } from '../shared/class-names.js';
7
- import '../shared/apply-mixins.js';
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 Sun, 23 Jan 2022 11:15:05 GMT\n*/\n.breadcrumb-item {\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-neutral-70);\n}\n.breadcrumb-item a {\n color: var(--vvd-color-cta-70);\n text-decoration: none;\n}\n.breadcrumb-item a:hover {\n text-decoration: underline;\n}\n.breadcrumb-item vwc-icon {\n margin: 0 16px;\n color: var(--vvd-color-on-canvas);\n}";
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('control', 'breadcrumb-item');
41
+ const getClasses = _ => classNames('base');
32
42
 
33
43
  const BreadcrumbItemTemplate = (context, definition) => html(_t || (_t = _2`
34
- <div roll="listitem" part="listitem" class="${0}">
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-line"></vwc-icon>`))));
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',