@vonage/vivid 3.0.0-next.3 → 3.0.0-next.30

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 (143) 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/elevation/index.js +4 -38
  15. package/fab/index.js +101 -0
  16. package/focus/index.js +20 -3
  17. package/header/index.js +68 -0
  18. package/icon/index.js +40 -5
  19. package/index.d.ts +1 -0
  20. package/index.js +50 -14
  21. package/layout/index.js +5 -5
  22. package/lib/accordion/accordion.d.ts +9 -0
  23. package/lib/accordion/accordion.template.d.ts +4 -0
  24. package/lib/accordion/index.d.ts +2 -0
  25. package/lib/accordion-item/accordion-item.d.ts +13 -0
  26. package/lib/accordion-item/accordion-item.template.d.ts +4 -0
  27. package/lib/accordion-item/index.d.ts +4 -0
  28. package/lib/action-group/action-group.d.ts +10 -0
  29. package/lib/action-group/action-group.template.d.ts +4 -0
  30. package/lib/action-group/index.d.ts +2 -0
  31. package/lib/badge/badge.d.ts +8 -8
  32. package/lib/badge/index.d.ts +1 -1
  33. package/lib/banner/banner.d.ts +20 -0
  34. package/lib/banner/banner.template.d.ts +4 -0
  35. package/lib/banner/index.d.ts +3 -0
  36. package/lib/breadcrumb/breadcrumb.template.d.ts +4 -0
  37. package/lib/breadcrumb-item/breadcrumb-item.d.ts +1 -1
  38. package/lib/breadcrumb-item/breadcrumb-item.template.d.ts +0 -1
  39. package/lib/breadcrumb-item/index.d.ts +2 -0
  40. package/lib/button/button.d.ts +9 -8
  41. package/lib/button/index.d.ts +2 -19
  42. package/lib/calendar/calendar.d.ts +13 -0
  43. package/lib/calendar/calendar.template.d.ts +4 -0
  44. package/lib/calendar/helpers/calendar.date-functions.d.ts +2 -0
  45. package/lib/calendar/helpers/calendar.event-context.d.ts +6 -0
  46. package/lib/calendar/helpers/calendar.keyboard-interactions.d.ts +9 -0
  47. package/lib/calendar/index.d.ts +2 -0
  48. package/lib/calendar-event/calendar-event.d.ts +14 -0
  49. package/lib/calendar-event/calendar-event.template.d.ts +4 -0
  50. package/lib/calendar-event/index.d.ts +2 -0
  51. package/lib/card/card.d.ts +10 -0
  52. package/lib/card/card.template.d.ts +4 -0
  53. package/lib/card/index.d.ts +4 -0
  54. package/lib/checkbox/checkbox.d.ts +5 -0
  55. package/lib/checkbox/checkbox.template.d.ts +4 -0
  56. package/lib/checkbox/index.d.ts +4 -0
  57. package/lib/components.d.ts +23 -5
  58. package/lib/elevation/elevation.d.ts +2 -1
  59. package/lib/elevation/index.d.ts +1 -1
  60. package/lib/enums.d.ts +14 -7
  61. package/lib/fab/fab.d.ts +13 -0
  62. package/lib/fab/fab.template.d.ts +4 -0
  63. package/lib/fab/index.d.ts +4 -0
  64. package/lib/focus/index.d.ts +1 -1
  65. package/lib/header/header.d.ts +5 -0
  66. package/lib/header/header.template.d.ts +4 -0
  67. package/lib/header/index.d.ts +3 -0
  68. package/lib/icon/icon.d.ts +4 -5
  69. package/lib/layout/index.d.ts +1 -1
  70. package/lib/layout/layout.d.ts +3 -3
  71. package/lib/note/index.d.ts +2 -0
  72. package/lib/note/note.d.ts +10 -0
  73. package/lib/note/note.template.d.ts +5 -0
  74. package/lib/popup/index.d.ts +4 -0
  75. package/lib/popup/popup.d.ts +17 -0
  76. package/lib/popup/popup.template.d.ts +4 -0
  77. package/lib/progress/index.d.ts +2 -0
  78. package/lib/progress/progress.d.ts +9 -0
  79. package/lib/progress/progress.template.d.ts +5 -0
  80. package/lib/progress-ring/index.d.ts +2 -0
  81. package/lib/progress-ring/progress-ring.d.ts +7 -0
  82. package/lib/progress-ring/progress-ring.template.d.ts +4 -0
  83. package/lib/side-drawer/index.d.ts +2 -0
  84. package/lib/side-drawer/side-drawer.d.ts +7 -0
  85. package/lib/side-drawer/side-drawer.template.d.ts +4 -0
  86. package/lib/sidenav/index.d.ts +2 -0
  87. package/lib/sidenav/sidenav.d.ts +3 -0
  88. package/lib/sidenav/sidenav.template.d.ts +4 -0
  89. package/lib/sidenav-item/index.d.ts +1 -0
  90. package/lib/sidenav-item/sidenav-item.d.ts +4 -5
  91. package/lib/text/index.d.ts +2 -0
  92. package/lib/text/text.d.ts +10 -0
  93. package/lib/text/text.template.d.ts +4 -0
  94. package/lib/text-anchor/text-anchor.d.ts +4 -1
  95. package/lib/text-field/index.d.ts +4 -0
  96. package/lib/text-field/text-field.d.ts +23 -0
  97. package/lib/text-field/text-field.template.d.ts +5 -0
  98. package/lib/tooltip/index.d.ts +3 -0
  99. package/lib/tooltip/tooltip.d.ts +8 -0
  100. package/lib/tooltip/tooltip.template.d.ts +4 -0
  101. package/note/index.js +68 -0
  102. package/package.json +36 -6
  103. package/popup/index.js +2110 -0
  104. package/progress/index.js +107 -0
  105. package/progress-ring/index.js +82 -0
  106. package/shared/_has.js +58 -0
  107. package/shared/affix.js +10 -25
  108. package/shared/anchor.js +10 -3
  109. package/shared/aria-global.js +20 -20
  110. package/shared/base-progress.js +70 -0
  111. package/shared/breadcrumb-item.js +2 -2
  112. package/shared/button.js +195 -0
  113. package/shared/calendar-event.js +26 -0
  114. package/shared/enums.js +79 -0
  115. package/shared/es.object.assign.js +69 -0
  116. package/shared/export.js +972 -0
  117. package/shared/focus.js +5 -0
  118. package/shared/focus2.js +11 -0
  119. package/shared/form-associated.js +547 -0
  120. package/shared/icon.js +1389 -0
  121. package/shared/index.js +4940 -1426
  122. package/shared/index2.js +27 -4901
  123. package/shared/iterators.js +61 -0
  124. package/shared/object-keys.js +13 -0
  125. package/shared/patterns/affix.d.ts +3 -4
  126. package/shared/patterns/focus.d.ts +3 -0
  127. package/shared/patterns/index.d.ts +1 -0
  128. package/shared/slotted.js +119 -0
  129. package/shared/text-anchor.js +12 -0
  130. package/shared/text-anchor.template.js +16 -6
  131. package/shared/to-string.js +51 -0
  132. package/shared/web.dom-collections.iterator.js +46 -1059
  133. package/shared/when.js +15 -0
  134. package/side-drawer/index.js +82 -0
  135. package/sidenav/index.js +17 -0
  136. package/sidenav-item/index.js +24 -61
  137. package/styles/themes/dark.css +16 -4
  138. package/styles/themes/light.css +16 -4
  139. package/text/index.js +48 -0
  140. package/text-anchor/index.js +13 -13
  141. package/text-field/index.js +411 -0
  142. package/tooltip/index.js +70 -0
  143. 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 };
@@ -0,0 +1,79 @@
1
+ var Connotation;
2
+
3
+ (function (Connotation) {
4
+ Connotation["Accent"] = "accent";
5
+ Connotation["CTA"] = "cta";
6
+ Connotation["Success"] = "success";
7
+ Connotation["Alert"] = "alert";
8
+ Connotation["Warning"] = "warning";
9
+ Connotation["Info"] = "info";
10
+ Connotation["Announcement"] = "announcement";
11
+ })(Connotation || (Connotation = {}));
12
+
13
+ var ConnotationDecorative;
14
+
15
+ (function (ConnotationDecorative) {
16
+ ConnotationDecorative["Pacific"] = "pacific";
17
+ })(ConnotationDecorative || (ConnotationDecorative = {}));
18
+
19
+ var Shape;
20
+
21
+ (function (Shape) {
22
+ Shape["Rounded"] = "rounded";
23
+ Shape["Pill"] = "pill";
24
+ Shape["Circled"] = "circled";
25
+ Shape["Sharp"] = "sharp";
26
+ })(Shape || (Shape = {}));
27
+
28
+ var Appearance;
29
+
30
+ (function (Appearance) {
31
+ Appearance["Filled"] = "filled";
32
+ Appearance["Outlined"] = "outlined";
33
+ Appearance["Duotone"] = "duotone";
34
+ Appearance["Fieldset"] = "fieldset";
35
+ Appearance["Subtle"] = "subtle";
36
+ Appearance["Ghost"] = "ghost";
37
+ })(Appearance || (Appearance = {}));
38
+
39
+ var Density;
40
+
41
+ (function (Density) {
42
+ Density["Condensed"] = "condensed";
43
+ Density["Normal"] = "normal";
44
+ Density["Extended"] = "extended";
45
+ })(Density || (Density = {}));
46
+
47
+ var Size;
48
+
49
+ (function (Size) {
50
+ Size["Small"] = "small";
51
+ Size["Medium"] = "medium";
52
+ Size["Large"] = "large";
53
+ })(Size || (Size = {}));
54
+
55
+ var Position;
56
+
57
+ (function (Position) {
58
+ Position["Top"] = "TOP";
59
+ Position["Bottom"] = "BOTTOM";
60
+ Position["Start"] = "START";
61
+ Position["Center"] = "CENTER";
62
+ Position["End"] = "END";
63
+ })(Position || (Position = {}));
64
+
65
+ var Role;
66
+
67
+ (function (Role) {
68
+ Role["Status"] = "status";
69
+ Role["Alert"] = "alert";
70
+ })(Role || (Role = {}));
71
+
72
+ var AriaLive;
73
+
74
+ (function (AriaLive) {
75
+ AriaLive["Polite"] = "polite";
76
+ AriaLive["Assertive"] = "assertive";
77
+ })(AriaLive || (AriaLive = {}));
78
+
79
+ export { Connotation as C };
@@ -0,0 +1,69 @@
1
+ import { d as descriptors, f as functionUncurryThis, v as functionCall, e as fails$1, I as toObject$1, M as indexedObject, N as objectGetOwnPropertySymbols, O as objectPropertyIsEnumerable, _ as _export } from './export.js';
2
+ import { o as objectKeys$1 } from './object-keys.js';
3
+
4
+ var DESCRIPTORS = descriptors;
5
+ var uncurryThis = functionUncurryThis;
6
+ var call = functionCall;
7
+ var fails = fails$1;
8
+ var objectKeys = objectKeys$1;
9
+ var getOwnPropertySymbolsModule = objectGetOwnPropertySymbols;
10
+ var propertyIsEnumerableModule = objectPropertyIsEnumerable;
11
+ var toObject = toObject$1;
12
+ var IndexedObject = indexedObject;
13
+
14
+ // eslint-disable-next-line es-x/no-object-assign -- safe
15
+ var $assign = Object.assign;
16
+ // eslint-disable-next-line es-x/no-object-defineproperty -- required for testing
17
+ var defineProperty = Object.defineProperty;
18
+ var concat = uncurryThis([].concat);
19
+
20
+ // `Object.assign` method
21
+ // https://tc39.es/ecma262/#sec-object.assign
22
+ var objectAssign = !$assign || fails(function () {
23
+ // should have correct order of operations (Edge bug)
24
+ if (DESCRIPTORS && $assign({ b: 1 }, $assign(defineProperty({}, 'a', {
25
+ enumerable: true,
26
+ get: function () {
27
+ defineProperty(this, 'b', {
28
+ value: 3,
29
+ enumerable: false
30
+ });
31
+ }
32
+ }), { b: 2 })).b !== 1) return true;
33
+ // should work with symbols and should have deterministic property order (V8 bug)
34
+ var A = {};
35
+ var B = {};
36
+ // eslint-disable-next-line es-x/no-symbol -- safe
37
+ var symbol = Symbol();
38
+ var alphabet = 'abcdefghijklmnopqrst';
39
+ A[symbol] = 7;
40
+ alphabet.split('').forEach(function (chr) { B[chr] = chr; });
41
+ return $assign({}, A)[symbol] != 7 || objectKeys($assign({}, B)).join('') != alphabet;
42
+ }) ? function assign(target, source) { // eslint-disable-line no-unused-vars -- required for `.length`
43
+ var T = toObject(target);
44
+ var argumentsLength = arguments.length;
45
+ var index = 1;
46
+ var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
47
+ var propertyIsEnumerable = propertyIsEnumerableModule.f;
48
+ while (argumentsLength > index) {
49
+ var S = IndexedObject(arguments[index++]);
50
+ var keys = getOwnPropertySymbols ? concat(objectKeys(S), getOwnPropertySymbols(S)) : objectKeys(S);
51
+ var length = keys.length;
52
+ var j = 0;
53
+ var key;
54
+ while (length > j) {
55
+ key = keys[j++];
56
+ if (!DESCRIPTORS || call(propertyIsEnumerable, S, key)) T[key] = S[key];
57
+ }
58
+ } return T;
59
+ } : $assign;
60
+
61
+ var $ = _export;
62
+ var assign = objectAssign;
63
+
64
+ // `Object.assign` method
65
+ // https://tc39.es/ecma262/#sec-object.assign
66
+ // eslint-disable-next-line es-x/no-object-assign -- required for testing
67
+ $({ target: 'Object', stat: true, arity: 2, forced: Object.assign !== assign }, {
68
+ assign: assign
69
+ });