@vonage/vivid 3.0.0-next.8 → 3.0.0-next.80

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 (176) hide show
  1. package/README.md +141 -4
  2. package/accordion/index.js +2 -4
  3. package/accordion-item/index.js +26 -20
  4. package/action-group/index.js +47 -0
  5. package/avatar/index.js +70 -0
  6. package/badge/index.js +17 -21
  7. package/banner/index.js +23 -87
  8. package/breadcrumb/index.js +21 -18
  9. package/breadcrumb-item/index.js +19 -12
  10. package/button/index.js +19 -757
  11. package/calendar/index.js +67 -25
  12. package/calendar-event/index.js +115 -0
  13. package/card/index.js +132 -0
  14. package/checkbox/index.js +184 -0
  15. package/dialog/index.js +281 -0
  16. package/divider/index.js +3 -0
  17. package/elevation/index.js +3 -31
  18. package/fab/index.js +105 -0
  19. package/focus/index.js +18 -3
  20. package/header/index.js +66 -0
  21. package/icon/index.js +9 -5
  22. package/index.js +53 -20
  23. package/layout/index.js +4 -6
  24. package/lib/accordion-item/accordion-item.d.ts +2 -2
  25. package/lib/accordion-item/index.d.ts +2 -1
  26. package/lib/action-group/action-group.d.ts +10 -0
  27. package/lib/{sidenav-item/sidenav-item.template.d.ts → action-group/action-group.template.d.ts} +2 -2
  28. package/lib/{sidenav-item → action-group}/index.d.ts +1 -2
  29. package/lib/avatar/avatar.d.ts +15 -0
  30. package/lib/avatar/avatar.template.d.ts +4 -0
  31. package/lib/avatar/index.d.ts +3 -0
  32. package/lib/badge/badge.d.ts +5 -5
  33. package/lib/badge/index.d.ts +1 -1
  34. package/lib/banner/banner.d.ts +1 -1
  35. package/lib/banner/banner.template.d.ts +0 -2
  36. package/lib/banner/index.d.ts +1 -0
  37. package/lib/breadcrumb/breadcrumb.template.d.ts +4 -0
  38. package/lib/breadcrumb-item/breadcrumb-item.d.ts +1 -1
  39. package/lib/breadcrumb-item/index.d.ts +1 -0
  40. package/lib/button/button.d.ts +6 -5
  41. package/lib/button/index.d.ts +2 -19
  42. package/lib/calendar/calendar.d.ts +3 -1
  43. package/lib/calendar/index.d.ts +0 -1
  44. package/lib/calendar-event/calendar-event.d.ts +14 -0
  45. package/lib/calendar-event/calendar-event.template.d.ts +4 -0
  46. package/lib/calendar-event/index.d.ts +2 -0
  47. package/lib/card/card.d.ts +10 -0
  48. package/lib/{text/text.template.d.ts → card/card.template.d.ts} +2 -2
  49. package/lib/card/index.d.ts +4 -0
  50. package/lib/checkbox/checkbox.d.ts +5 -0
  51. package/lib/checkbox/checkbox.template.d.ts +4 -0
  52. package/lib/checkbox/index.d.ts +4 -0
  53. package/lib/components.d.ts +27 -10
  54. package/lib/dialog/dialog.d.ts +20 -0
  55. package/lib/dialog/dialog.template.d.ts +4 -0
  56. package/lib/dialog/index.d.ts +5 -0
  57. package/lib/divider/divider.d.ts +3 -0
  58. package/lib/divider/divider.template.d.ts +4 -0
  59. package/lib/divider/index.d.ts +2 -0
  60. package/lib/elevation/elevation.d.ts +1 -0
  61. package/lib/elevation/index.d.ts +1 -1
  62. package/lib/enums.d.ts +11 -6
  63. package/lib/fab/fab.d.ts +13 -0
  64. package/lib/fab/fab.template.d.ts +4 -0
  65. package/lib/fab/index.d.ts +4 -0
  66. package/lib/focus/index.d.ts +1 -1
  67. package/lib/header/header.d.ts +5 -0
  68. package/lib/header/header.template.d.ts +4 -0
  69. package/lib/header/index.d.ts +3 -0
  70. package/lib/icon/icon.d.ts +4 -3
  71. package/lib/layout/index.d.ts +1 -1
  72. package/lib/layout/layout.d.ts +3 -3
  73. package/lib/menu/index.d.ts +12 -0
  74. package/lib/menu/menu.d.ts +10 -0
  75. package/lib/menu/menu.template.d.ts +3 -0
  76. package/lib/menu-item/index.d.ts +3 -0
  77. package/lib/menu-item/menu-item.d.ts +7 -0
  78. package/lib/menu-item/menu-item.template.d.ts +5 -0
  79. package/lib/nav/index.d.ts +2 -0
  80. package/lib/nav/nav.d.ts +3 -0
  81. package/lib/nav/nav.template.d.ts +4 -0
  82. package/lib/nav-disclosure/index.d.ts +4 -0
  83. package/lib/nav-disclosure/nav-disclosure.d.ts +10 -0
  84. package/lib/nav-disclosure/nav-disclosure.template.d.ts +4 -0
  85. package/lib/nav-item/index.d.ts +4 -0
  86. package/lib/{sidenav-item/sidenav-item.d.ts → nav-item/nav-item.d.ts} +2 -2
  87. package/lib/nav-item/nav-item.template.d.ts +4 -0
  88. package/lib/{text → note}/index.d.ts +1 -1
  89. package/lib/note/note.d.ts +10 -0
  90. package/lib/note/note.template.d.ts +5 -0
  91. package/lib/number-field/index.d.ts +4 -0
  92. package/lib/number-field/number-field.d.ts +16 -0
  93. package/lib/number-field/number-field.template.d.ts +4 -0
  94. package/lib/popup/index.d.ts +1 -1
  95. package/lib/popup/popup.d.ts +2 -1
  96. package/lib/progress/progress.d.ts +1 -1
  97. package/lib/progress-ring/progress-ring.d.ts +2 -1
  98. package/lib/radio/index.d.ts +3 -0
  99. package/lib/radio/radio.d.ts +4 -0
  100. package/lib/radio/radio.template.d.ts +4 -0
  101. package/lib/side-drawer/index.d.ts +1 -1
  102. package/lib/side-drawer/side-drawer.d.ts +3 -2
  103. package/lib/text-anchor/text-anchor.d.ts +1 -1
  104. package/lib/text-area/index.d.ts +3 -0
  105. package/lib/text-area/text-area.d.ts +9 -0
  106. package/lib/text-area/text-area.template.d.ts +4 -0
  107. package/lib/text-field/index.d.ts +4 -0
  108. package/lib/text-field/text-field.d.ts +16 -0
  109. package/lib/text-field/text-field.template.d.ts +5 -0
  110. package/lib/tooltip/tooltip.d.ts +2 -2
  111. package/menu/index.js +381 -0
  112. package/menu-item/index.js +19 -0
  113. package/nav/index.js +17 -0
  114. package/nav-disclosure/index.js +88 -0
  115. package/nav-item/index.js +45 -0
  116. package/note/index.js +66 -0
  117. package/number-field/index.js +529 -0
  118. package/package.json +51 -7
  119. package/popup/index.js +23 -2061
  120. package/progress/index.js +35 -28
  121. package/progress-ring/index.js +9 -5
  122. package/radio/index.js +174 -0
  123. package/shared/anchor.js +10 -2
  124. package/shared/aria-global.js +2 -86
  125. package/shared/base-progress.js +5 -0
  126. package/shared/breadcrumb-item.js +1 -1
  127. package/shared/button.js +200 -0
  128. package/shared/calendar-event.js +26 -0
  129. package/shared/dialog-polyfill.esm.js +858 -0
  130. package/shared/enums.js +79 -0
  131. package/shared/es.object.assign.js +7 -6
  132. package/shared/export.js +995 -0
  133. package/shared/focus.js +5 -0
  134. package/shared/focus2.js +11 -0
  135. package/shared/form-associated.js +466 -0
  136. package/shared/form-elements.js +299 -0
  137. package/shared/icon.js +533 -520
  138. package/shared/index.js +71 -55
  139. package/shared/index2.js +110 -13
  140. package/shared/index3.js +35 -0
  141. package/shared/index4.js +86 -0
  142. package/shared/index5.js +2100 -0
  143. package/shared/index6.js +371 -0
  144. package/shared/iterators.js +61 -0
  145. package/shared/key-codes.js +90 -0
  146. package/shared/object-keys.js +13 -0
  147. package/shared/patterns/focus.d.ts +3 -0
  148. package/shared/patterns/form-elements.d.ts +22 -0
  149. package/shared/patterns/index.d.ts +1 -0
  150. package/shared/ref.js +41 -0
  151. package/shared/regexp-flags.js +21 -0
  152. package/shared/start-end.js +50 -0
  153. package/shared/text-anchor.js +2 -11
  154. package/shared/text-anchor.template.js +5 -2
  155. package/shared/to-string.js +51 -0
  156. package/shared/web.dom-collections.iterator.js +78 -1083
  157. package/side-drawer/index.js +44 -23
  158. package/styles/core/all.css +75 -0
  159. package/styles/core/theme.css +11 -0
  160. package/styles/core/typography.css +69 -0
  161. package/styles/fonts/SpeziaCompleteVariableItalicWeb.woff2 +0 -0
  162. package/styles/fonts/SpeziaCompleteVariableUprightWeb.woff2 +0 -0
  163. package/styles/fonts/SpeziaMonoCompleteVariableWeb.woff2 +0 -0
  164. package/styles/fonts/spezia.css +9 -12
  165. package/styles/tokens/theme-dark.css +211 -0
  166. package/styles/tokens/theme-light.css +211 -0
  167. package/text-anchor/index.js +9 -1
  168. package/text-area/index.js +304 -0
  169. package/text-field/index.js +152 -0
  170. package/tooltip/index.js +23 -16
  171. package/lib/text/text.d.ts +0 -10
  172. package/shared/style-inject.es.js +0 -28
  173. package/sidenav-item/index.js +0 -38
  174. package/styles/themes/dark.css +0 -205
  175. package/styles/themes/light.css +0 -205
  176. package/text/index.js +0 -45
@@ -0,0 +1,299 @@
1
+ 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 } 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 } from './aria-global.js';
5
+ import { S as StartEnd } from './start-end.js';
6
+ import './web.dom-collections.iterator.js';
7
+
8
+ class _TextField extends FoundationElement {
9
+ }
10
+ /**
11
+ * A form-associated base class for the {@link @microsoft/fast-foundation#(TextField:class)} component.
12
+ *
13
+ * @internal
14
+ */
15
+ class FormAssociatedTextField extends FormAssociated(_TextField) {
16
+ constructor() {
17
+ super(...arguments);
18
+ this.proxy = document.createElement("input");
19
+ }
20
+ }
21
+
22
+ /**
23
+ * Text field sub-types
24
+ * @public
25
+ */
26
+ const TextFieldType = {
27
+ /**
28
+ * An email TextField
29
+ */
30
+ email: "email",
31
+ /**
32
+ * A password TextField
33
+ */
34
+ password: "password",
35
+ /**
36
+ * A telephone TextField
37
+ */
38
+ tel: "tel",
39
+ /**
40
+ * A text TextField
41
+ */
42
+ text: "text",
43
+ /**
44
+ * A URL TextField
45
+ */
46
+ url: "url",
47
+ };
48
+
49
+ /**
50
+ * A Text Field Custom HTML Element.
51
+ * Based largely on the {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/text | <input type="text" /> element }.
52
+ *
53
+ * @slot start - Content which can be provided before the number field input
54
+ * @slot end - Content which can be provided after the number field input
55
+ * @slot - The default slot for the label
56
+ * @csspart label - The label
57
+ * @csspart root - The element wrapping the control, including start and end slots
58
+ * @csspart control - The text field element
59
+ * @fires change - Fires a custom 'change' event when the value has changed
60
+ *
61
+ * @public
62
+ */
63
+ class TextField extends FormAssociatedTextField {
64
+ constructor() {
65
+ super(...arguments);
66
+ /**
67
+ * Allows setting a type or mode of text.
68
+ * @public
69
+ * @remarks
70
+ * HTML Attribute: type
71
+ */
72
+ this.type = TextFieldType.text;
73
+ }
74
+ readOnlyChanged() {
75
+ if (this.proxy instanceof HTMLInputElement) {
76
+ this.proxy.readOnly = this.readOnly;
77
+ this.validate();
78
+ }
79
+ }
80
+ autofocusChanged() {
81
+ if (this.proxy instanceof HTMLInputElement) {
82
+ this.proxy.autofocus = this.autofocus;
83
+ this.validate();
84
+ }
85
+ }
86
+ placeholderChanged() {
87
+ if (this.proxy instanceof HTMLInputElement) {
88
+ this.proxy.placeholder = this.placeholder;
89
+ }
90
+ }
91
+ typeChanged() {
92
+ if (this.proxy instanceof HTMLInputElement) {
93
+ this.proxy.type = this.type;
94
+ this.validate();
95
+ }
96
+ }
97
+ listChanged() {
98
+ if (this.proxy instanceof HTMLInputElement) {
99
+ this.proxy.setAttribute("list", this.list);
100
+ this.validate();
101
+ }
102
+ }
103
+ maxlengthChanged() {
104
+ if (this.proxy instanceof HTMLInputElement) {
105
+ this.proxy.maxLength = this.maxlength;
106
+ this.validate();
107
+ }
108
+ }
109
+ minlengthChanged() {
110
+ if (this.proxy instanceof HTMLInputElement) {
111
+ this.proxy.minLength = this.minlength;
112
+ this.validate();
113
+ }
114
+ }
115
+ patternChanged() {
116
+ if (this.proxy instanceof HTMLInputElement) {
117
+ this.proxy.pattern = this.pattern;
118
+ this.validate();
119
+ }
120
+ }
121
+ sizeChanged() {
122
+ if (this.proxy instanceof HTMLInputElement) {
123
+ this.proxy.size = this.size;
124
+ }
125
+ }
126
+ spellcheckChanged() {
127
+ if (this.proxy instanceof HTMLInputElement) {
128
+ this.proxy.spellcheck = this.spellcheck;
129
+ }
130
+ }
131
+ /**
132
+ * @internal
133
+ */
134
+ connectedCallback() {
135
+ super.connectedCallback();
136
+ this.proxy.setAttribute("type", this.type);
137
+ this.validate();
138
+ if (this.autofocus) {
139
+ DOM.queueUpdate(() => {
140
+ this.focus();
141
+ });
142
+ }
143
+ }
144
+ /**
145
+ * Selects all the text in the text field
146
+ *
147
+ * @public
148
+ */
149
+ select() {
150
+ this.control.select();
151
+ /**
152
+ * The select event does not permeate the shadow DOM boundary.
153
+ * This fn effectively proxies the select event,
154
+ * emitting a `select` event whenever the internal
155
+ * control emits a `select` event
156
+ */
157
+ this.$emit("select");
158
+ }
159
+ /**
160
+ * Handles the internal control's `input` event
161
+ * @internal
162
+ */
163
+ handleTextInput() {
164
+ this.value = this.control.value;
165
+ }
166
+ /**
167
+ * Change event handler for inner control.
168
+ * @remarks
169
+ * "Change" events are not `composable` so they will not
170
+ * permeate the shadow DOM boundary. This fn effectively proxies
171
+ * the change event, emitting a `change` event whenever the internal
172
+ * control emits a `change` event
173
+ * @internal
174
+ */
175
+ handleChange() {
176
+ this.$emit("change");
177
+ }
178
+ /** {@inheritDoc (FormAssociated:interface).validate} */
179
+ validate() {
180
+ super.validate(this.control);
181
+ }
182
+ }
183
+ __decorate([
184
+ attr({ attribute: "readonly", mode: "boolean" })
185
+ ], TextField.prototype, "readOnly", void 0);
186
+ __decorate([
187
+ attr({ mode: "boolean" })
188
+ ], TextField.prototype, "autofocus", void 0);
189
+ __decorate([
190
+ attr
191
+ ], TextField.prototype, "placeholder", void 0);
192
+ __decorate([
193
+ attr
194
+ ], TextField.prototype, "type", void 0);
195
+ __decorate([
196
+ attr
197
+ ], TextField.prototype, "list", void 0);
198
+ __decorate([
199
+ attr({ converter: nullableNumberConverter })
200
+ ], TextField.prototype, "maxlength", void 0);
201
+ __decorate([
202
+ attr({ converter: nullableNumberConverter })
203
+ ], TextField.prototype, "minlength", void 0);
204
+ __decorate([
205
+ attr
206
+ ], TextField.prototype, "pattern", void 0);
207
+ __decorate([
208
+ attr({ converter: nullableNumberConverter })
209
+ ], TextField.prototype, "size", void 0);
210
+ __decorate([
211
+ attr({ mode: "boolean" })
212
+ ], TextField.prototype, "spellcheck", void 0);
213
+ __decorate([
214
+ observable
215
+ ], TextField.prototype, "defaultSlottedNodes", void 0);
216
+ /**
217
+ * Includes ARIA states and properties relating to the ARIA textbox role
218
+ *
219
+ * @public
220
+ */
221
+ class DelegatesARIATextbox {
222
+ }
223
+ applyMixins(DelegatesARIATextbox, ARIAGlobalStatesAndProperties);
224
+ applyMixins(TextField, StartEnd, DelegatesARIATextbox);
225
+
226
+ const ElementInternalsKey = 'ElementInternals';
227
+
228
+ const supportsElementInternals = () => ElementInternalsKey in window && 'setFormValue' in window[ElementInternalsKey].prototype;
229
+
230
+ function formElements(constructor) {
231
+ var _Decorated_blurred;
232
+
233
+ class Decorated extends constructor {
234
+ constructor(...args) {
235
+ super(...args);
236
+ this.charCount = false;
237
+ this.userValid = true;
238
+
239
+ _Decorated_blurred.set(this, false);
240
+
241
+ this.validate = () => {
242
+ if (supportsElementInternals() && this.proxy instanceof HTMLElement) {
243
+ this.setValidity(this.proxy.validity, this.proxy.validationMessage, this.control);
244
+ } else {
245
+ super.validate();
246
+ }
247
+
248
+ this.userValid = !this.userValid;
249
+
250
+ if (this.proxy instanceof HTMLElement) {
251
+ this.userValid = __classPrivateFieldGet(this, _Decorated_blurred, "f") && this.dirtyValue ? !this.validationMessage : true;
252
+ }
253
+ };
254
+
255
+ this.addEventListener('blur', () => {
256
+ __classPrivateFieldSet(this, _Decorated_blurred, true, "f");
257
+
258
+ this.validate();
259
+ });
260
+ this.addEventListener('focus', () => {
261
+ __classPrivateFieldSet(this, _Decorated_blurred, false, "f");
262
+ });
263
+ this.addEventListener('invalid', () => {
264
+ if (__classPrivateFieldGet(this, _Decorated_blurred, "f") && this.dirtyValue) return;
265
+
266
+ __classPrivateFieldSet(this, _Decorated_blurred, true, "f");
267
+
268
+ this.dirtyValue = true;
269
+ this.validate();
270
+ });
271
+ }
272
+
273
+ get errorValidationMessage() {
274
+ return this.userValid ? '' : this.validationMessage;
275
+ }
276
+
277
+ }
278
+
279
+ _Decorated_blurred = new WeakMap();
280
+
281
+ __decorate([attr, __metadata("design:type", String)], Decorated.prototype, "label", void 0);
282
+
283
+ __decorate([attr({
284
+ attribute: 'helper-text'
285
+ }), __metadata("design:type", String)], Decorated.prototype, "helperText", void 0);
286
+
287
+ __decorate([attr({
288
+ attribute: 'char-count',
289
+ mode: 'boolean'
290
+ }), __metadata("design:type", Object)], Decorated.prototype, "charCount", void 0);
291
+
292
+ __decorate([observable, __metadata("design:type", Object)], Decorated.prototype, "userValid", void 0);
293
+
294
+ __decorate([volatile, __metadata("design:type", Object), __metadata("design:paramtypes", [])], Decorated.prototype, "errorValidationMessage", null);
295
+
296
+ return Decorated;
297
+ }
298
+
299
+ export { DelegatesARIATextbox as D, TextField as T, formElements as f };