@vonage/vivid 3.47.0 → 3.49.0-preview.0
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.
- package/README.md +3 -403
- package/accordion/index.cjs +21 -0
- package/accordion-item/index.cjs +18 -0
- package/action-group/index.cjs +7 -0
- package/alert/index.cjs +30 -0
- package/alert/index.js +0 -1
- package/appearance-ui/index.cjs +96 -0
- package/audio-player/index.cjs +34 -0
- package/audio-player/index.js +0 -1
- package/avatar/index.cjs +11 -0
- package/badge/index.cjs +14 -0
- package/banner/index.cjs +29 -0
- package/banner/index.js +0 -1
- package/breadcrumb/index.cjs +13 -0
- package/breadcrumb-item/index.cjs +22 -0
- package/button/index.cjs +25 -0
- package/button/index.js +0 -1
- package/calendar/index.cjs +9 -0
- package/calendar-event/index.cjs +9 -0
- package/card/index.cjs +14 -0
- package/checkbox/index.cjs +21 -0
- package/combobox/index.cjs +39 -0
- package/combobox/index.js +1 -1
- package/custom-elements.json +30 -35
- package/data-grid/index.cjs +18 -0
- package/date-picker/index.cjs +40 -0
- package/date-picker/index.js +1 -1
- package/date-range-picker/index.cjs +40 -0
- package/date-range-picker/index.js +1 -1
- package/dialog/index.cjs +31 -0
- package/dialog/index.js +1 -1
- package/divider/index.cjs +8 -0
- package/elevation/index.cjs +7 -0
- package/empty-state/index.cjs +12 -0
- package/fab/index.cjs +22 -0
- package/file-picker/index.cjs +30 -0
- package/file-picker/index.js +1 -1
- package/focus/index.cjs +7 -0
- package/header/index.cjs +8 -0
- package/icon/index.cjs +10 -0
- package/index.cjs +296 -0
- package/index.js +1 -1
- package/layout/index.cjs +7 -0
- package/lib/menu-item/menu-item.d.ts +1 -0
- package/lib/tabs/tabs.d.ts +1 -0
- package/listbox/index.cjs +77 -0
- package/locales/en-GB.cjs +106 -0
- package/locales/en-US.cjs +106 -0
- package/locales/ja-JP.cjs +106 -0
- package/locales/zh-CN.cjs +106 -0
- package/menu/index.cjs +32 -0
- package/menu/index.js +0 -1
- package/menu-item/index.cjs +22 -0
- package/menu-item/index.js +0 -1
- package/nav/index.cjs +6 -0
- package/nav-disclosure/index.cjs +17 -0
- package/nav-disclosure/index.js +0 -1
- package/nav-item/index.cjs +22 -0
- package/note/index.cjs +16 -0
- package/number-field/index.cjs +33 -0
- package/number-field/index.js +1 -1
- package/option/index.cjs +23 -0
- package/package.json +20 -2
- package/pagination/index.cjs +28 -0
- package/pagination/index.js +0 -1
- package/popup/index.cjs +27 -0
- package/popup/index.js +0 -1
- package/progress/index.cjs +9 -0
- package/progress-ring/index.cjs +9 -0
- package/radio/index.cjs +14 -0
- package/radio-group/index.cjs +14 -0
- package/select/index.cjs +38 -0
- package/select/index.js +1 -1
- package/selectable-box/index.cjs +25 -0
- package/shared/Reflector.cjs +67 -0
- package/shared/_has.cjs +62 -0
- package/shared/affix.cjs +64 -0
- package/shared/affix.js +8 -4
- package/shared/anchor.cjs +90 -0
- package/shared/anchored.cjs +78 -0
- package/shared/apply-mixins.cjs +25 -0
- package/shared/aria-global.cjs +74 -0
- package/shared/aria.cjs +11 -0
- package/shared/aria2.cjs +11 -0
- package/shared/base-progress.cjs +72 -0
- package/shared/breadcrumb-item.cjs +27 -0
- package/shared/button.cjs +202 -0
- package/shared/calendar-event.cjs +41 -0
- package/shared/children.cjs +61 -0
- package/shared/class-names.cjs +17 -0
- package/shared/definition.cjs +165 -0
- package/shared/definition10.cjs +102 -0
- package/shared/definition11.cjs +164 -0
- package/shared/definition11.js +39 -42
- package/shared/definition12.cjs +50 -0
- package/shared/definition13.cjs +779 -0
- package/shared/definition14.cjs +157 -0
- package/shared/definition15.cjs +249 -0
- package/shared/definition16.cjs +746 -0
- package/shared/definition17.cjs +1372 -0
- package/shared/definition18.cjs +175 -0
- package/shared/definition19.cjs +416 -0
- package/shared/definition2.cjs +232 -0
- package/shared/definition20.cjs +278 -0
- package/shared/definition21.cjs +83 -0
- package/shared/definition22.cjs +74 -0
- package/shared/definition23.cjs +106 -0
- package/shared/definition24.cjs +2392 -0
- package/shared/definition25.cjs +75 -0
- package/shared/definition26.cjs +39 -0
- package/shared/definition27.cjs +66 -0
- package/shared/definition28.cjs +849 -0
- package/shared/definition28.js +5 -4
- package/shared/definition29.cjs +72 -0
- package/shared/definition29.js +1 -1
- package/shared/definition3.cjs +72 -0
- package/shared/definition30.cjs +98 -0
- package/shared/definition30.js +1 -4
- package/shared/definition31.cjs +37 -0
- package/shared/definition32.cjs +24 -0
- package/shared/definition33.cjs +64 -0
- package/shared/definition34.cjs +533 -0
- package/shared/definition35.cjs +295 -0
- package/shared/definition36.cjs +219 -0
- package/shared/definition37.cjs +109 -0
- package/shared/definition38.cjs +92 -0
- package/shared/definition39.cjs +448 -0
- package/shared/definition4.cjs +198 -0
- package/shared/definition40.cjs +49 -0
- package/shared/definition41.cjs +694 -0
- package/shared/definition41.js +1 -6
- package/shared/definition42.cjs +152 -0
- package/shared/definition43.cjs +113 -0
- package/shared/definition44.cjs +607 -0
- package/shared/definition45.cjs +152 -0
- package/shared/definition45.js +1 -6
- package/shared/definition46.cjs +166 -0
- package/shared/definition46.js +2 -7
- package/shared/definition47.cjs +35 -0
- package/shared/definition48.cjs +98 -0
- package/shared/definition49.cjs +543 -0
- package/shared/definition49.js +12 -3
- package/shared/definition5.cjs +199 -0
- package/shared/definition50.cjs +52 -0
- package/shared/definition51.cjs +150 -0
- package/shared/definition52.cjs +304 -0
- package/shared/definition53.cjs +309 -0
- package/shared/definition54.cjs +146 -0
- package/shared/definition55.cjs +128 -0
- package/shared/definition56.cjs +99 -0
- package/shared/definition57.cjs +310 -0
- package/shared/definition58.cjs +20 -0
- package/shared/definition59.cjs +51 -0
- package/shared/definition6.cjs +83 -0
- package/shared/definition60.cjs +1810 -0
- package/shared/definition7.cjs +72 -0
- package/shared/definition8.cjs +152 -0
- package/shared/definition9.cjs +69 -0
- package/shared/dialog-polyfill.esm.cjs +862 -0
- package/shared/direction.cjs +22 -0
- package/shared/dom.cjs +23 -0
- package/shared/enums.cjs +87 -0
- package/shared/focus.cjs +8 -0
- package/shared/focus2.cjs +11 -0
- package/shared/form-associated.cjs +470 -0
- package/shared/icon.cjs +237 -0
- package/shared/index.cjs +5061 -0
- package/shared/index2.cjs +231 -0
- package/shared/key-codes.cjs +115 -0
- package/shared/key-codes2.cjs +14 -0
- package/shared/listbox.cjs +1072 -0
- package/shared/localized.cjs +11 -0
- package/shared/numbers.cjs +38 -0
- package/shared/patterns/affix.d.ts +5 -1
- package/shared/presentationDate.cjs +6192 -0
- package/shared/presentationDate.js +1 -6
- package/shared/radio.cjs +153 -0
- package/shared/ref.cjs +43 -0
- package/shared/repeat.cjs +767 -0
- package/shared/select.options.cjs +12 -0
- package/shared/slotted.cjs +123 -0
- package/shared/start-end.cjs +52 -0
- package/shared/strings.cjs +11 -0
- package/shared/text-anchor.cjs +33 -0
- package/shared/text-anchor.template.cjs +48 -0
- package/shared/text-field.cjs +5 -0
- package/shared/text-field2.cjs +228 -0
- package/shared/tree-item.cjs +154 -0
- package/shared/when.cjs +31 -0
- package/side-drawer/index.cjs +8 -0
- package/slider/index.cjs +16 -0
- package/split-button/index.cjs +20 -0
- package/split-button/index.js +0 -1
- package/style.css +1 -1
- package/styles/core/all.css +1 -1
- package/styles/core/theme.css +1 -1
- package/styles/core/typography.css +1 -1
- package/styles/tokens/theme-dark.css +4 -4
- package/styles/tokens/theme-light.css +4 -4
- package/styles/tokens/vivid-2-compat.css +1 -1
- package/switch/index.cjs +15 -0
- package/switch/index.js +0 -5
- package/tab/index.cjs +17 -0
- package/tab-panel/index.cjs +6 -0
- package/tabs/index.cjs +24 -0
- package/tag/index.cjs +17 -0
- package/tag-group/index.cjs +7 -0
- package/text-anchor/index.cjs +24 -0
- package/text-area/index.cjs +25 -0
- package/text-field/index.cjs +27 -0
- package/toggletip/index.cjs +29 -0
- package/toggletip/index.js +0 -1
- package/tooltip/index.cjs +29 -0
- package/tooltip/index.js +0 -1
- package/tree-item/index.cjs +22 -0
- package/tree-view/index.cjs +14 -0
package/shared/icon.cjs
ADDED
|
@@ -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;
|