@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
@@ -0,0 +1,195 @@
1
+ import { F as FoundationElement, _ as __decorate, a as attr, o as observable } 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
+
6
+ class _Button extends FoundationElement {
7
+ }
8
+ /**
9
+ * A form-associated base class for the {@link @microsoft/fast-foundation#(Button:class)} component.
10
+ *
11
+ * @internal
12
+ */
13
+ class FormAssociatedButton extends FormAssociated(_Button) {
14
+ constructor() {
15
+ super(...arguments);
16
+ this.proxy = document.createElement("input");
17
+ }
18
+ }
19
+
20
+ /**
21
+ * A Button Custom HTML Element.
22
+ * Based largely on the {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button | <button> element }.
23
+ *
24
+ * @slot start - Content which can be provided before the button content
25
+ * @slot end - Content which can be provided after the button content
26
+ * @slot - The default slot for button content
27
+ * @csspart control - The button element
28
+ * @csspart content - The element wrapping button content
29
+ *
30
+ * @public
31
+ */
32
+ class Button extends FormAssociatedButton {
33
+ constructor() {
34
+ super(...arguments);
35
+ /**
36
+ * Prevent events to propagate if disabled and has no slotted content wrapped in HTML elements
37
+ * @internal
38
+ */
39
+ this.handleClick = (e) => {
40
+ var _a;
41
+ if (this.disabled && ((_a = this.defaultSlottedContent) === null || _a === void 0 ? void 0 : _a.length) <= 1) {
42
+ e.stopPropagation();
43
+ }
44
+ };
45
+ /**
46
+ * Submits the parent form
47
+ */
48
+ this.handleSubmission = () => {
49
+ if (!this.form) {
50
+ return;
51
+ }
52
+ const attached = this.proxy.isConnected;
53
+ if (!attached) {
54
+ this.attachProxy();
55
+ }
56
+ // Browser support for requestSubmit is not comprehensive
57
+ // so click the proxy if it isn't supported
58
+ typeof this.form.requestSubmit === "function"
59
+ ? this.form.requestSubmit(this.proxy)
60
+ : this.proxy.click();
61
+ if (!attached) {
62
+ this.detachProxy();
63
+ }
64
+ };
65
+ /**
66
+ * Resets the parent form
67
+ */
68
+ this.handleFormReset = () => {
69
+ var _a;
70
+ (_a = this.form) === null || _a === void 0 ? void 0 : _a.reset();
71
+ };
72
+ /**
73
+ * Overrides the focus call for where delegatesFocus is unsupported.
74
+ * This check works for Chrome, Edge Chromium, FireFox, and Safari
75
+ * Relevant PR on the Firefox browser: https://phabricator.services.mozilla.com/D123858
76
+ */
77
+ this.handleUnsupportedDelegatesFocus = () => {
78
+ var _a;
79
+ // Check to see if delegatesFocus is supported
80
+ if (window.ShadowRoot &&
81
+ !window.ShadowRoot.prototype.hasOwnProperty("delegatesFocus") &&
82
+ ((_a = this.$fastController.definition.shadowOptions) === null || _a === void 0 ? void 0 : _a.delegatesFocus)) {
83
+ this.focus = () => {
84
+ this.control.focus();
85
+ };
86
+ }
87
+ };
88
+ }
89
+ formactionChanged() {
90
+ if (this.proxy instanceof HTMLInputElement) {
91
+ this.proxy.formAction = this.formaction;
92
+ }
93
+ }
94
+ formenctypeChanged() {
95
+ if (this.proxy instanceof HTMLInputElement) {
96
+ this.proxy.formEnctype = this.formenctype;
97
+ }
98
+ }
99
+ formmethodChanged() {
100
+ if (this.proxy instanceof HTMLInputElement) {
101
+ this.proxy.formMethod = this.formmethod;
102
+ }
103
+ }
104
+ formnovalidateChanged() {
105
+ if (this.proxy instanceof HTMLInputElement) {
106
+ this.proxy.formNoValidate = this.formnovalidate;
107
+ }
108
+ }
109
+ formtargetChanged() {
110
+ if (this.proxy instanceof HTMLInputElement) {
111
+ this.proxy.formTarget = this.formtarget;
112
+ }
113
+ }
114
+ typeChanged(previous, next) {
115
+ if (this.proxy instanceof HTMLInputElement) {
116
+ this.proxy.type = this.type;
117
+ }
118
+ next === "submit" && this.addEventListener("click", this.handleSubmission);
119
+ previous === "submit" && this.removeEventListener("click", this.handleSubmission);
120
+ next === "reset" && this.addEventListener("click", this.handleFormReset);
121
+ previous === "reset" && this.removeEventListener("click", this.handleFormReset);
122
+ }
123
+ /**
124
+ * @internal
125
+ */
126
+ connectedCallback() {
127
+ var _a;
128
+ super.connectedCallback();
129
+ this.proxy.setAttribute("type", this.type);
130
+ this.handleUnsupportedDelegatesFocus();
131
+ const elements = Array.from((_a = this.control) === null || _a === void 0 ? void 0 : _a.children);
132
+ if (elements) {
133
+ elements.forEach((span) => {
134
+ span.addEventListener("click", this.handleClick);
135
+ });
136
+ }
137
+ }
138
+ /**
139
+ * @internal
140
+ */
141
+ disconnectedCallback() {
142
+ var _a;
143
+ super.disconnectedCallback();
144
+ const elements = Array.from((_a = this.control) === null || _a === void 0 ? void 0 : _a.children);
145
+ if (elements) {
146
+ elements.forEach((span) => {
147
+ span.removeEventListener("click", this.handleClick);
148
+ });
149
+ }
150
+ }
151
+ }
152
+ __decorate([
153
+ attr({ mode: "boolean" })
154
+ ], Button.prototype, "autofocus", void 0);
155
+ __decorate([
156
+ attr({ attribute: "form" })
157
+ ], Button.prototype, "formId", void 0);
158
+ __decorate([
159
+ attr
160
+ ], Button.prototype, "formaction", void 0);
161
+ __decorate([
162
+ attr
163
+ ], Button.prototype, "formenctype", void 0);
164
+ __decorate([
165
+ attr
166
+ ], Button.prototype, "formmethod", void 0);
167
+ __decorate([
168
+ attr({ mode: "boolean" })
169
+ ], Button.prototype, "formnovalidate", void 0);
170
+ __decorate([
171
+ attr
172
+ ], Button.prototype, "formtarget", void 0);
173
+ __decorate([
174
+ attr
175
+ ], Button.prototype, "type", void 0);
176
+ __decorate([
177
+ observable
178
+ ], Button.prototype, "defaultSlottedContent", void 0);
179
+ /**
180
+ * Includes ARIA states and properties relating to the ARIA button role
181
+ *
182
+ * @public
183
+ */
184
+ class DelegatesARIAButton {
185
+ }
186
+ __decorate([
187
+ attr({ attribute: "aria-expanded" })
188
+ ], DelegatesARIAButton.prototype, "ariaExpanded", void 0);
189
+ __decorate([
190
+ attr({ attribute: "aria-pressed" })
191
+ ], DelegatesARIAButton.prototype, "ariaPressed", void 0);
192
+ applyMixins(DelegatesARIAButton, ARIAGlobalStatesAndProperties);
193
+ applyMixins(Button, StartEnd, DelegatesARIAButton);
194
+
195
+ export { Button as B };
@@ -0,0 +1,26 @@
1
+ import { F as FoundationElement, _ as __decorate, a as attr, b as __metadata, n as nullableNumberConverter } from './index.js';
2
+
3
+ class CalendarEvent extends FoundationElement {}
4
+
5
+ __decorate([attr, __metadata("design:type", String)], CalendarEvent.prototype, "heading", void 0);
6
+
7
+ __decorate([attr, __metadata("design:type", String)], CalendarEvent.prototype, "description", void 0);
8
+
9
+ __decorate([attr, __metadata("design:type", String)], CalendarEvent.prototype, "connotation", void 0);
10
+
11
+ __decorate([attr, __metadata("design:type", String)], CalendarEvent.prototype, "appearance", void 0);
12
+
13
+ __decorate([attr({
14
+ converter: nullableNumberConverter,
15
+ attribute: 'overlap-count'
16
+ }), __metadata("design:type", Number)], CalendarEvent.prototype, "overlapCount", void 0);
17
+
18
+ __decorate([attr({
19
+ converter: nullableNumberConverter
20
+ }), __metadata("design:type", Number)], CalendarEvent.prototype, "start", void 0);
21
+
22
+ __decorate([attr({
23
+ converter: nullableNumberConverter
24
+ }), __metadata("design:type", Number)], CalendarEvent.prototype, "duration", void 0);
25
+
26
+ export { CalendarEvent as C };