@vonage/vivid 3.48.0 → 3.49.0-preview.1

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 (182) hide show
  1. package/accordion/index.cjs +21 -0
  2. package/accordion-item/index.cjs +18 -0
  3. package/action-group/index.cjs +7 -0
  4. package/alert/index.cjs +30 -0
  5. package/appearance-ui/index.cjs +96 -0
  6. package/audio-player/index.cjs +34 -0
  7. package/avatar/index.cjs +11 -0
  8. package/badge/index.cjs +14 -0
  9. package/banner/index.cjs +29 -0
  10. package/breadcrumb/index.cjs +13 -0
  11. package/breadcrumb-item/index.cjs +22 -0
  12. package/button/index.cjs +25 -0
  13. package/calendar/index.cjs +9 -0
  14. package/calendar-event/index.cjs +9 -0
  15. package/card/index.cjs +14 -0
  16. package/checkbox/index.cjs +21 -0
  17. package/combobox/index.cjs +39 -0
  18. package/data-grid/index.cjs +18 -0
  19. package/date-picker/index.cjs +40 -0
  20. package/date-range-picker/index.cjs +40 -0
  21. package/dialog/index.cjs +31 -0
  22. package/divider/index.cjs +8 -0
  23. package/elevation/index.cjs +7 -0
  24. package/empty-state/index.cjs +12 -0
  25. package/fab/index.cjs +22 -0
  26. package/file-picker/index.cjs +30 -0
  27. package/focus/index.cjs +7 -0
  28. package/header/index.cjs +8 -0
  29. package/icon/index.cjs +10 -0
  30. package/index.cjs +296 -0
  31. package/layout/index.cjs +7 -0
  32. package/listbox/index.cjs +77 -0
  33. package/locales/en-GB.cjs +106 -0
  34. package/locales/en-US.cjs +106 -0
  35. package/locales/ja-JP.cjs +106 -0
  36. package/locales/zh-CN.cjs +106 -0
  37. package/menu/index.cjs +32 -0
  38. package/menu-item/index.cjs +22 -0
  39. package/nav/index.cjs +6 -0
  40. package/nav-disclosure/index.cjs +17 -0
  41. package/nav-item/index.cjs +22 -0
  42. package/note/index.cjs +16 -0
  43. package/number-field/index.cjs +33 -0
  44. package/option/index.cjs +23 -0
  45. package/package.json +20 -2
  46. package/pagination/index.cjs +28 -0
  47. package/popup/index.cjs +27 -0
  48. package/progress/index.cjs +9 -0
  49. package/progress-ring/index.cjs +9 -0
  50. package/radio/index.cjs +14 -0
  51. package/radio-group/index.cjs +14 -0
  52. package/select/index.cjs +38 -0
  53. package/selectable-box/index.cjs +25 -0
  54. package/shared/Reflector.cjs +67 -0
  55. package/shared/_has.cjs +62 -0
  56. package/shared/affix.cjs +64 -0
  57. package/shared/affix.js +8 -4
  58. package/shared/anchor.cjs +90 -0
  59. package/shared/anchored.cjs +78 -0
  60. package/shared/apply-mixins.cjs +25 -0
  61. package/shared/aria-global.cjs +74 -0
  62. package/shared/aria.cjs +11 -0
  63. package/shared/aria2.cjs +11 -0
  64. package/shared/base-progress.cjs +72 -0
  65. package/shared/breadcrumb-item.cjs +27 -0
  66. package/shared/button.cjs +202 -0
  67. package/shared/calendar-event.cjs +41 -0
  68. package/shared/children.cjs +61 -0
  69. package/shared/class-names.cjs +17 -0
  70. package/shared/definition.cjs +165 -0
  71. package/shared/definition10.cjs +102 -0
  72. package/shared/definition11.cjs +164 -0
  73. package/shared/definition11.js +38 -36
  74. package/shared/definition12.cjs +50 -0
  75. package/shared/definition13.cjs +779 -0
  76. package/shared/definition14.cjs +157 -0
  77. package/shared/definition15.cjs +249 -0
  78. package/shared/definition16.cjs +746 -0
  79. package/shared/definition17.cjs +1372 -0
  80. package/shared/definition18.cjs +175 -0
  81. package/shared/definition19.cjs +416 -0
  82. package/shared/definition2.cjs +232 -0
  83. package/shared/definition20.cjs +278 -0
  84. package/shared/definition21.cjs +83 -0
  85. package/shared/definition22.cjs +74 -0
  86. package/shared/definition23.cjs +106 -0
  87. package/shared/definition24.cjs +2392 -0
  88. package/shared/definition25.cjs +75 -0
  89. package/shared/definition26.cjs +39 -0
  90. package/shared/definition27.cjs +66 -0
  91. package/shared/definition28.cjs +849 -0
  92. package/shared/definition29.cjs +72 -0
  93. package/shared/definition3.cjs +72 -0
  94. package/shared/definition30.cjs +98 -0
  95. package/shared/definition31.cjs +37 -0
  96. package/shared/definition32.cjs +24 -0
  97. package/shared/definition33.cjs +64 -0
  98. package/shared/definition34.cjs +533 -0
  99. package/shared/definition35.cjs +295 -0
  100. package/shared/definition36.cjs +219 -0
  101. package/shared/definition37.cjs +109 -0
  102. package/shared/definition38.cjs +92 -0
  103. package/shared/definition39.cjs +448 -0
  104. package/shared/definition4.cjs +198 -0
  105. package/shared/definition40.cjs +49 -0
  106. package/shared/definition41.cjs +694 -0
  107. package/shared/definition42.cjs +152 -0
  108. package/shared/definition43.cjs +113 -0
  109. package/shared/definition44.cjs +607 -0
  110. package/shared/definition45.cjs +152 -0
  111. package/shared/definition46.cjs +166 -0
  112. package/shared/definition47.cjs +35 -0
  113. package/shared/definition48.cjs +98 -0
  114. package/shared/definition49.cjs +543 -0
  115. package/shared/definition5.cjs +199 -0
  116. package/shared/definition50.cjs +52 -0
  117. package/shared/definition51.cjs +150 -0
  118. package/shared/definition52.cjs +304 -0
  119. package/shared/definition53.cjs +309 -0
  120. package/shared/definition54.cjs +146 -0
  121. package/shared/definition55.cjs +128 -0
  122. package/shared/definition56.cjs +99 -0
  123. package/shared/definition57.cjs +310 -0
  124. package/shared/definition58.cjs +20 -0
  125. package/shared/definition59.cjs +51 -0
  126. package/shared/definition6.cjs +83 -0
  127. package/shared/definition60.cjs +1810 -0
  128. package/shared/definition7.cjs +72 -0
  129. package/shared/definition8.cjs +152 -0
  130. package/shared/definition9.cjs +69 -0
  131. package/shared/dialog-polyfill.esm.cjs +862 -0
  132. package/shared/direction.cjs +22 -0
  133. package/shared/dom.cjs +23 -0
  134. package/shared/enums.cjs +87 -0
  135. package/shared/focus.cjs +8 -0
  136. package/shared/focus2.cjs +11 -0
  137. package/shared/form-associated.cjs +470 -0
  138. package/shared/icon.cjs +237 -0
  139. package/shared/index.cjs +5061 -0
  140. package/shared/index2.cjs +231 -0
  141. package/shared/key-codes.cjs +115 -0
  142. package/shared/key-codes2.cjs +14 -0
  143. package/shared/listbox.cjs +1072 -0
  144. package/shared/localized.cjs +11 -0
  145. package/shared/numbers.cjs +38 -0
  146. package/shared/patterns/affix.d.ts +5 -1
  147. package/shared/presentationDate.cjs +6192 -0
  148. package/shared/radio.cjs +153 -0
  149. package/shared/ref.cjs +43 -0
  150. package/shared/repeat.cjs +767 -0
  151. package/shared/select.options.cjs +12 -0
  152. package/shared/slotted.cjs +123 -0
  153. package/shared/start-end.cjs +52 -0
  154. package/shared/strings.cjs +11 -0
  155. package/shared/text-anchor.cjs +33 -0
  156. package/shared/text-anchor.template.cjs +48 -0
  157. package/shared/text-field.cjs +5 -0
  158. package/shared/text-field2.cjs +228 -0
  159. package/shared/tree-item.cjs +154 -0
  160. package/shared/when.cjs +31 -0
  161. package/side-drawer/index.cjs +8 -0
  162. package/slider/index.cjs +16 -0
  163. package/split-button/index.cjs +20 -0
  164. package/styles/core/all.css +1 -1
  165. package/styles/core/theme.css +1 -1
  166. package/styles/core/typography.css +1 -1
  167. package/styles/tokens/theme-dark.css +4 -4
  168. package/styles/tokens/theme-light.css +4 -4
  169. package/styles/tokens/vivid-2-compat.css +1 -1
  170. package/switch/index.cjs +15 -0
  171. package/tab/index.cjs +17 -0
  172. package/tab-panel/index.cjs +6 -0
  173. package/tabs/index.cjs +24 -0
  174. package/tag/index.cjs +17 -0
  175. package/tag-group/index.cjs +7 -0
  176. package/text-anchor/index.cjs +24 -0
  177. package/text-area/index.cjs +25 -0
  178. package/text-field/index.cjs +27 -0
  179. package/toggletip/index.cjs +29 -0
  180. package/tooltip/index.cjs +29 -0
  181. package/tree-item/index.cjs +22 -0
  182. package/tree-view/index.cjs +14 -0
@@ -0,0 +1,237 @@
1
+ 'use strict';
2
+
3
+ const _has = require('./_has.cjs');
4
+ const index = require('./index.cjs');
5
+
6
+ function _arity(n, fn) {
7
+ /* eslint-disable no-unused-vars */
8
+ switch (n) {
9
+ case 0:
10
+ return function () {
11
+ return fn.apply(this, arguments);
12
+ };
13
+
14
+ case 1:
15
+ return function (a0) {
16
+ return fn.apply(this, arguments);
17
+ };
18
+
19
+ case 2:
20
+ return function (a0, a1) {
21
+ return fn.apply(this, arguments);
22
+ };
23
+
24
+ case 3:
25
+ return function (a0, a1, a2) {
26
+ return fn.apply(this, arguments);
27
+ };
28
+
29
+ case 4:
30
+ return function (a0, a1, a2, a3) {
31
+ return fn.apply(this, arguments);
32
+ };
33
+
34
+ case 5:
35
+ return function (a0, a1, a2, a3, a4) {
36
+ return fn.apply(this, arguments);
37
+ };
38
+
39
+ case 6:
40
+ return function (a0, a1, a2, a3, a4, a5) {
41
+ return fn.apply(this, arguments);
42
+ };
43
+
44
+ case 7:
45
+ return function (a0, a1, a2, a3, a4, a5, a6) {
46
+ return fn.apply(this, arguments);
47
+ };
48
+
49
+ case 8:
50
+ return function (a0, a1, a2, a3, a4, a5, a6, a7) {
51
+ return fn.apply(this, arguments);
52
+ };
53
+
54
+ case 9:
55
+ return function (a0, a1, a2, a3, a4, a5, a6, a7, a8) {
56
+ return fn.apply(this, arguments);
57
+ };
58
+
59
+ case 10:
60
+ return function (a0, a1, a2, a3, a4, a5, a6, a7, a8, a9) {
61
+ return fn.apply(this, arguments);
62
+ };
63
+
64
+ default:
65
+ throw new Error('First argument to _arity must be a non-negative integer no greater than ten');
66
+ }
67
+ }
68
+
69
+ function _identity(x) {
70
+ return x;
71
+ }
72
+
73
+ /**
74
+ * A function that does nothing but return the parameter supplied to it. Good
75
+ * as a default or placeholder function.
76
+ *
77
+ * @func
78
+ * @memberOf R
79
+ * @since v0.1.0
80
+ * @category Function
81
+ * @sig a -> a
82
+ * @param {*} x The value to return.
83
+ * @return {*} The input value, `x`.
84
+ * @example
85
+ *
86
+ * R.identity(1); //=> 1
87
+ *
88
+ * const obj = {};
89
+ * R.identity(obj) === obj; //=> true
90
+ * @symb R.identity(a) = a
91
+ */
92
+
93
+ var identity =
94
+ /*#__PURE__*/
95
+ _has._curry1(_identity);
96
+
97
+ const identity$1 = identity;
98
+
99
+ /**
100
+ * Creates a new function that, when invoked, caches the result of calling `fn`
101
+ * for a given argument set and returns the result. Subsequent calls to the
102
+ * memoized `fn` with the same argument set will not result in an additional
103
+ * call to `fn`; instead, the cached result for that set of arguments will be
104
+ * returned.
105
+ *
106
+ * Care must be taken when implementing key generation to avoid key collision,
107
+ * or if tracking references, memory leaks and mutating arguments.
108
+ *
109
+ * @func
110
+ * @memberOf R
111
+ * @since v0.24.0
112
+ * @category Function
113
+ * @sig (*... -> String) -> (*... -> a) -> (*... -> a)
114
+ * @param {Function} fn The function to generate the cache key.
115
+ * @param {Function} fn The function to memoize.
116
+ * @return {Function} Memoized version of `fn`.
117
+ * @example
118
+ *
119
+ * let count = 0;
120
+ * const factorial = R.memoizeWith(Number, n => {
121
+ * count += 1;
122
+ * return R.product(R.range(1, n + 1));
123
+ * });
124
+ * factorial(5); //=> 120
125
+ * factorial(5); //=> 120
126
+ * factorial(5); //=> 120
127
+ * count; //=> 1
128
+ */
129
+
130
+ var memoizeWith =
131
+ /*#__PURE__*/
132
+ _has._curry2(function memoizeWith(mFn, fn) {
133
+ var cache = {};
134
+ return _arity(fn.length, function () {
135
+ var key = mFn.apply(this, arguments);
136
+
137
+ if (!_has._has(key, cache)) {
138
+ cache[key] = fn.apply(this, arguments);
139
+ }
140
+
141
+ return cache[key];
142
+ });
143
+ });
144
+
145
+ const memoizeWith$1 = memoizeWith;
146
+
147
+ const ICONS_BASE_URL = "https://icon.resources.vonage.com";
148
+ const ICONS_VERSION = "4.5.2";
149
+
150
+ const PLACEHOLDER_ICON = `<svg width="80%" height="80%" viewBox="0 0 64 64">
151
+ <g>
152
+ <g stroke-width="6" stroke-linecap="round" fill="none">
153
+ <path stroke="currentColor" d="M4,32 c0,15,12,28,28,28c8,0,16-4,21-9">
154
+ </path>
155
+ <path d="M60,32 C60,16,47.464,4,32,4S4,16,4,32">
156
+ </path>
157
+ <animateTransform values="0,32,32;360,32,32" attributeName="transform" type="rotate" repeatCount="indefinite" dur="750ms">
158
+ </animateTransform>
159
+ </g>
160
+ </g>
161
+ </svg>`;
162
+
163
+ var __defProp = Object.defineProperty;
164
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
165
+ var __decorateClass = (decorators, target, key, kind) => {
166
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
167
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
168
+ if (decorator = decorators[i])
169
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
170
+ if (kind && result)
171
+ __defProp(target, key, result);
172
+ return result;
173
+ };
174
+ const PLACEHOLDER_DELAY = 500;
175
+ const PLACEHOLDER_TIMEOUT = 2e3;
176
+ const baseUrlTemplate = (resource, version) => [ICONS_BASE_URL, `v${version}`, resource].join("/");
177
+ const assertIsValidResponse = ({ ok, headers }) => {
178
+ if (!ok || headers.get("content-type") !== "image/svg+xml") {
179
+ throw new Error("Something went wrong");
180
+ }
181
+ };
182
+ const extractSvg = (response) => {
183
+ assertIsValidResponse(response);
184
+ return response.text();
185
+ };
186
+ const loadSvg = (iconId) => fetch(baseUrlTemplate([iconId, "svg"].join("."), ICONS_VERSION)).then(extractSvg);
187
+ const resolveIcon = memoizeWith$1(identity$1, (iconId = "") => iconId.trim() ? loadSvg(iconId) : Promise.resolve(""));
188
+ class Icon extends index.FoundationElement {
189
+ constructor() {
190
+ super(...arguments);
191
+ this.iconLoaded = false;
192
+ }
193
+ get iconUrl() {
194
+ return !this.name ? this._svg : baseUrlTemplate(`${this.name}.svg`, ICONS_VERSION);
195
+ }
196
+ async nameChanged() {
197
+ this._svg = void 0;
198
+ this.iconLoaded = false;
199
+ let timeout = setTimeout(() => {
200
+ this._svg = PLACEHOLDER_ICON;
201
+ timeout = setTimeout(() => {
202
+ if (this._svg === PLACEHOLDER_ICON) {
203
+ this._svg = void 0;
204
+ }
205
+ }, PLACEHOLDER_TIMEOUT);
206
+ }, PLACEHOLDER_DELAY);
207
+ await resolveIcon(this.name).then((svg) => {
208
+ this._svg = svg;
209
+ }).catch(() => {
210
+ this._svg = void 0;
211
+ }).finally(() => {
212
+ clearTimeout(timeout);
213
+ this.iconLoaded = true;
214
+ });
215
+ }
216
+ }
217
+ __decorateClass([
218
+ index.attr
219
+ ], Icon.prototype, "connotation", 2);
220
+ __decorateClass([
221
+ index.attr
222
+ ], Icon.prototype, "size", 2);
223
+ __decorateClass([
224
+ index.observable
225
+ ], Icon.prototype, "_svg", 2);
226
+ __decorateClass([
227
+ index.observable
228
+ ], Icon.prototype, "iconLoaded", 2);
229
+ __decorateClass([
230
+ index.attr
231
+ ], Icon.prototype, "name", 2);
232
+ __decorateClass([
233
+ index.volatile
234
+ ], Icon.prototype, "iconUrl", 1);
235
+
236
+ exports.Icon = Icon;
237
+ exports.memoizeWith = memoizeWith$1;