@vonage/vivid 2.36.3 → 3.0.0-next.100

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 (237) hide show
  1. package/README.md +144 -0
  2. package/accordion/index.js +52 -0
  3. package/accordion-item/index.js +118 -0
  4. package/action-group/index.js +41 -0
  5. package/avatar/index.js +61 -0
  6. package/badge/index.js +51 -0
  7. package/banner/index.js +128 -0
  8. package/breadcrumb/index.js +103 -0
  9. package/breadcrumb-item/index.js +59 -0
  10. package/button/index.js +24 -0
  11. package/calendar/index.js +1526 -0
  12. package/calendar-event/index.js +112 -0
  13. package/card/index.js +114 -0
  14. package/checkbox/index.js +179 -0
  15. package/dialog/index.js +230 -0
  16. package/divider/index.js +4 -0
  17. package/elevation/index.js +3 -0
  18. package/fab/index.js +100 -0
  19. package/focus/index.js +18 -0
  20. package/header/index.js +61 -0
  21. package/icon/index.js +36 -0
  22. package/index.d.ts +2 -0
  23. package/index.js +76 -64
  24. package/layout/index.js +43 -0
  25. package/lib/accordion/accordion.d.ts +9 -0
  26. package/lib/accordion/accordion.template.d.ts +4 -0
  27. package/lib/accordion/index.d.ts +2 -0
  28. package/lib/accordion-item/accordion-item.d.ts +13 -0
  29. package/lib/accordion-item/accordion-item.template.d.ts +4 -0
  30. package/lib/accordion-item/index.d.ts +4 -0
  31. package/lib/action-group/action-group.d.ts +10 -0
  32. package/lib/action-group/action-group.template.d.ts +4 -0
  33. package/lib/action-group/index.d.ts +2 -0
  34. package/lib/avatar/avatar.d.ts +15 -0
  35. package/lib/avatar/avatar.template.d.ts +4 -0
  36. package/lib/avatar/index.d.ts +3 -0
  37. package/lib/badge/badge.d.ts +15 -0
  38. package/lib/badge/badge.template.d.ts +4 -0
  39. package/lib/badge/index.d.ts +3 -0
  40. package/lib/banner/banner.d.ts +20 -0
  41. package/lib/banner/banner.template.d.ts +4 -0
  42. package/lib/banner/index.d.ts +3 -0
  43. package/lib/breadcrumb/breadcrumb.d.ts +3 -0
  44. package/lib/breadcrumb/breadcrumb.template.d.ts +4 -0
  45. package/lib/breadcrumb/index.d.ts +2 -0
  46. package/lib/breadcrumb-item/breadcrumb-item.d.ts +5 -0
  47. package/lib/breadcrumb-item/breadcrumb-item.template.d.ts +4 -0
  48. package/lib/breadcrumb-item/index.d.ts +4 -0
  49. package/lib/button/button.d.ts +18 -0
  50. package/lib/button/button.template.d.ts +4 -0
  51. package/lib/button/index.d.ts +4 -0
  52. package/lib/calendar/calendar.d.ts +13 -0
  53. package/lib/calendar/calendar.template.d.ts +4 -0
  54. package/lib/calendar/helpers/calendar.date-functions.d.ts +2 -0
  55. package/lib/calendar/helpers/calendar.event-context.d.ts +6 -0
  56. package/lib/calendar/helpers/calendar.keyboard-interactions.d.ts +9 -0
  57. package/lib/calendar/index.d.ts +2 -0
  58. package/lib/calendar-event/calendar-event.d.ts +14 -0
  59. package/lib/calendar-event/calendar-event.template.d.ts +4 -0
  60. package/lib/calendar-event/index.d.ts +2 -0
  61. package/lib/card/card.d.ts +10 -0
  62. package/lib/card/card.template.d.ts +4 -0
  63. package/lib/card/index.d.ts +4 -0
  64. package/lib/checkbox/checkbox.d.ts +5 -0
  65. package/lib/checkbox/checkbox.template.d.ts +4 -0
  66. package/lib/checkbox/index.d.ts +4 -0
  67. package/lib/components.d.ts +38 -0
  68. package/lib/dialog/dialog.d.ts +20 -0
  69. package/lib/dialog/dialog.template.d.ts +4 -0
  70. package/lib/dialog/index.d.ts +5 -0
  71. package/lib/divider/divider.d.ts +3 -0
  72. package/lib/divider/divider.template.d.ts +4 -0
  73. package/lib/divider/index.d.ts +2 -0
  74. package/lib/elevation/elevation.d.ts +5 -0
  75. package/lib/elevation/elevation.template.d.ts +4 -0
  76. package/lib/elevation/index.d.ts +2 -0
  77. package/lib/enums.d.ts +59 -0
  78. package/lib/fab/fab.d.ts +13 -0
  79. package/lib/fab/fab.template.d.ts +4 -0
  80. package/lib/fab/index.d.ts +4 -0
  81. package/lib/focus/focus.d.ts +3 -0
  82. package/lib/focus/focus.template.d.ts +4 -0
  83. package/lib/focus/index.d.ts +2 -0
  84. package/lib/header/header.d.ts +5 -0
  85. package/lib/header/header.template.d.ts +4 -0
  86. package/lib/header/index.d.ts +3 -0
  87. package/lib/icon/icon.d.ts +12 -0
  88. package/lib/icon/icon.placeholder.d.ts +1 -0
  89. package/lib/icon/icon.template.d.ts +4 -0
  90. package/lib/icon/index.d.ts +2 -0
  91. package/lib/layout/index.d.ts +2 -0
  92. package/lib/layout/layout.d.ts +16 -0
  93. package/lib/layout/layout.template.d.ts +4 -0
  94. package/lib/listbox/index.d.ts +4 -0
  95. package/lib/listbox/listbox.d.ts +9 -0
  96. package/lib/listbox/listbox.template.d.ts +4 -0
  97. package/lib/listbox-option/index.d.ts +4 -0
  98. package/lib/listbox-option/listbox-option.d.ts +9 -0
  99. package/lib/listbox-option/listbox-option.template.d.ts +4 -0
  100. package/lib/menu/index.d.ts +12 -0
  101. package/lib/menu/menu.d.ts +10 -0
  102. package/lib/menu/menu.template.d.ts +3 -0
  103. package/lib/menu-item/index.d.ts +3 -0
  104. package/lib/menu-item/menu-item.d.ts +7 -0
  105. package/lib/menu-item/menu-item.template.d.ts +5 -0
  106. package/lib/nav/index.d.ts +2 -0
  107. package/lib/nav/nav.d.ts +3 -0
  108. package/lib/nav/nav.template.d.ts +4 -0
  109. package/lib/nav-disclosure/index.d.ts +4 -0
  110. package/lib/nav-disclosure/nav-disclosure.d.ts +10 -0
  111. package/lib/nav-disclosure/nav-disclosure.template.d.ts +4 -0
  112. package/lib/nav-item/index.d.ts +4 -0
  113. package/lib/nav-item/nav-item.d.ts +6 -0
  114. package/lib/nav-item/nav-item.template.d.ts +4 -0
  115. package/lib/note/index.d.ts +2 -0
  116. package/lib/note/note.d.ts +10 -0
  117. package/lib/note/note.template.d.ts +5 -0
  118. package/lib/number-field/index.d.ts +4 -0
  119. package/lib/number-field/number-field.d.ts +14 -0
  120. package/lib/number-field/number-field.template.d.ts +4 -0
  121. package/lib/popup/index.d.ts +4 -0
  122. package/lib/popup/popup.d.ts +18 -0
  123. package/lib/popup/popup.template.d.ts +4 -0
  124. package/lib/progress/index.d.ts +2 -0
  125. package/lib/progress/progress.d.ts +9 -0
  126. package/lib/progress/progress.template.d.ts +5 -0
  127. package/lib/progress-ring/index.d.ts +2 -0
  128. package/lib/progress-ring/progress-ring.d.ts +7 -0
  129. package/lib/progress-ring/progress-ring.template.d.ts +4 -0
  130. package/lib/radio/index.d.ts +3 -0
  131. package/lib/radio/radio.d.ts +4 -0
  132. package/lib/radio/radio.template.d.ts +4 -0
  133. package/lib/radio-group/index.d.ts +10 -0
  134. package/lib/radio-group/radio-group.d.ts +4 -0
  135. package/lib/radio-group/radio-group.template.d.ts +4 -0
  136. package/lib/side-drawer/index.d.ts +2 -0
  137. package/lib/side-drawer/side-drawer.d.ts +9 -0
  138. package/lib/side-drawer/side-drawer.template.d.ts +4 -0
  139. package/lib/slider/index.d.ts +3 -0
  140. package/lib/slider/slider.d.ts +4 -0
  141. package/lib/slider/slider.template.d.ts +4 -0
  142. package/lib/switch/index.d.ts +4 -0
  143. package/lib/switch/switch.d.ts +7 -0
  144. package/lib/switch/switch.template.d.ts +4 -0
  145. package/lib/text-anchor/index.d.ts +2 -0
  146. package/lib/text-anchor/text-anchor.d.ts +7 -0
  147. package/lib/text-anchor/text-anchor.template.d.ts +4 -0
  148. package/lib/text-area/index.d.ts +4 -0
  149. package/lib/text-area/text-area.d.ts +9 -0
  150. package/lib/text-area/text-area.template.d.ts +4 -0
  151. package/lib/text-field/index.d.ts +4 -0
  152. package/lib/text-field/text-field.d.ts +14 -0
  153. package/lib/text-field/text-field.template.d.ts +5 -0
  154. package/lib/tooltip/index.d.ts +3 -0
  155. package/lib/tooltip/tooltip.d.ts +8 -0
  156. package/lib/tooltip/tooltip.template.d.ts +4 -0
  157. package/listbox/index.js +1090 -0
  158. package/listbox-option/index.js +22 -0
  159. package/menu/index.js +371 -0
  160. package/menu-item/index.js +21 -0
  161. package/nav/index.js +17 -0
  162. package/nav-disclosure/index.js +82 -0
  163. package/nav-item/index.js +46 -0
  164. package/note/index.js +59 -0
  165. package/number-field/index.js +461 -0
  166. package/package.json +65 -323
  167. package/popup/index.js +27 -0
  168. package/progress/index.js +97 -0
  169. package/progress-ring/index.js +76 -0
  170. package/radio/index.js +47 -0
  171. package/radio-group/index.js +435 -0
  172. package/shared/_has.js +58 -0
  173. package/shared/affix.js +24 -0
  174. package/shared/anchor.js +86 -0
  175. package/shared/apply-mixins.js +23 -0
  176. package/shared/aria-global.js +72 -0
  177. package/shared/aria.js +9 -0
  178. package/shared/base-progress.js +70 -0
  179. package/shared/breadcrumb-item.js +25 -0
  180. package/shared/button.js +200 -0
  181. package/shared/calendar-event.js +19 -0
  182. package/shared/class-names.js +15 -0
  183. package/shared/design-system/index.d.ts +3 -0
  184. package/shared/dialog-polyfill.esm.js +858 -0
  185. package/shared/direction.js +20 -0
  186. package/shared/dom.js +8 -0
  187. package/shared/enums.js +70 -0
  188. package/shared/es.object.assign.js +69 -0
  189. package/shared/es.regexp.to-string.js +59 -0
  190. package/shared/export.js +1017 -0
  191. package/shared/focus.js +5 -0
  192. package/shared/focus2.js +11 -0
  193. package/shared/form-associated.js +466 -0
  194. package/shared/form-elements.js +331 -0
  195. package/shared/icon.js +1361 -0
  196. package/shared/index.js +5027 -0
  197. package/shared/index2.js +107 -0
  198. package/shared/index3.js +31 -0
  199. package/shared/index4.js +77 -0
  200. package/shared/index5.js +261 -0
  201. package/shared/index6.js +1525 -0
  202. package/shared/index7.js +349 -0
  203. package/shared/iterators.js +61 -0
  204. package/shared/key-codes.js +97 -0
  205. package/shared/numbers.js +25 -0
  206. package/shared/object-keys.js +13 -0
  207. package/shared/patterns/affix.d.ts +9 -0
  208. package/shared/patterns/focus.d.ts +3 -0
  209. package/shared/patterns/form-elements/form-elements.d.ts +28 -0
  210. package/shared/patterns/form-elements/index.d.ts +1 -0
  211. package/shared/patterns/index.d.ts +3 -0
  212. package/shared/radio.js +127 -0
  213. package/shared/ref.js +41 -0
  214. package/shared/slotted.js +119 -0
  215. package/shared/start-end.js +50 -0
  216. package/shared/string-trim.js +40 -0
  217. package/shared/text-anchor.js +10 -0
  218. package/shared/text-anchor.template.js +55 -0
  219. package/shared/to-string.js +51 -0
  220. package/shared/web.dom-collections.iterator.js +472 -0
  221. package/shared/when.js +15 -0
  222. package/side-drawer/index.js +89 -0
  223. package/slider/index.js +596 -0
  224. package/styles/core/all.css +75 -0
  225. package/styles/core/theme.css +11 -0
  226. package/styles/core/typography.css +69 -0
  227. package/styles/fonts/SpeziaCompleteVariableItalicWeb.woff2 +0 -0
  228. package/styles/fonts/SpeziaCompleteVariableUprightWeb.woff2 +0 -0
  229. package/styles/fonts/SpeziaMonoCompleteVariableWeb.woff2 +0 -0
  230. package/styles/fonts/spezia.css +20 -0
  231. package/styles/tokens/theme-dark.css +230 -0
  232. package/styles/tokens/theme-light.css +230 -0
  233. package/switch/index.js +153 -0
  234. package/text-anchor/index.js +28 -0
  235. package/text-area/index.js +289 -0
  236. package/text-field/index.js +130 -0
  237. package/tooltip/index.js +65 -0
@@ -0,0 +1,472 @@
1
+ import { d as descriptors, D as v8PrototypeDefineBug, o as objectDefineProperty, j as anObject$2, E as toIndexedObject$2, F as sharedKey$2, G as enumBugKeys$1, H as hiddenKeys$1, p as documentCreateElement$2, w as wellKnownSymbol$4, e as fails$2, q as hasOwnProperty_1, i as isCallable$3, I as toObject$1, z as isObject$1, v as defineBuiltIn$2, J as createPropertyDescriptor$1, _ as _export, K as createNonEnumerableProperty$2, x as functionCall, C as functionName, y as internalState, g as global$1 } from './export.js';
2
+ import { o as objectKeys$1 } from './object-keys.js';
3
+ import { h as html$1, s as setToStringTag$2, i as iterators, o as objectSetPrototypeOf } from './iterators.js';
4
+
5
+ var objectDefineProperties = {};
6
+
7
+ var DESCRIPTORS$1 = descriptors;
8
+ var V8_PROTOTYPE_DEFINE_BUG = v8PrototypeDefineBug;
9
+ var definePropertyModule = objectDefineProperty;
10
+ var anObject$1 = anObject$2;
11
+ var toIndexedObject$1 = toIndexedObject$2;
12
+ var objectKeys = objectKeys$1;
13
+
14
+ // `Object.defineProperties` method
15
+ // https://tc39.es/ecma262/#sec-object.defineproperties
16
+ // eslint-disable-next-line es/no-object-defineproperties -- safe
17
+ objectDefineProperties.f = DESCRIPTORS$1 && !V8_PROTOTYPE_DEFINE_BUG ? Object.defineProperties : function defineProperties(O, Properties) {
18
+ anObject$1(O);
19
+ var props = toIndexedObject$1(Properties);
20
+ var keys = objectKeys(Properties);
21
+ var length = keys.length;
22
+ var index = 0;
23
+ var key;
24
+ while (length > index) definePropertyModule.f(O, key = keys[index++], props[key]);
25
+ return O;
26
+ };
27
+
28
+ /* global ActiveXObject -- old IE, WSH */
29
+
30
+ var anObject = anObject$2;
31
+ var definePropertiesModule = objectDefineProperties;
32
+ var enumBugKeys = enumBugKeys$1;
33
+ var hiddenKeys = hiddenKeys$1;
34
+ var html = html$1;
35
+ var documentCreateElement$1 = documentCreateElement$2;
36
+ var sharedKey$1 = sharedKey$2;
37
+
38
+ var GT = '>';
39
+ var LT = '<';
40
+ var PROTOTYPE = 'prototype';
41
+ var SCRIPT = 'script';
42
+ var IE_PROTO$1 = sharedKey$1('IE_PROTO');
43
+
44
+ var EmptyConstructor = function () { /* empty */ };
45
+
46
+ var scriptTag = function (content) {
47
+ return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;
48
+ };
49
+
50
+ // Create object with fake `null` prototype: use ActiveX Object with cleared prototype
51
+ var NullProtoObjectViaActiveX = function (activeXDocument) {
52
+ activeXDocument.write(scriptTag(''));
53
+ activeXDocument.close();
54
+ var temp = activeXDocument.parentWindow.Object;
55
+ activeXDocument = null; // avoid memory leak
56
+ return temp;
57
+ };
58
+
59
+ // Create object with fake `null` prototype: use iframe Object with cleared prototype
60
+ var NullProtoObjectViaIFrame = function () {
61
+ // Thrash, waste and sodomy: IE GC bug
62
+ var iframe = documentCreateElement$1('iframe');
63
+ var JS = 'java' + SCRIPT + ':';
64
+ var iframeDocument;
65
+ iframe.style.display = 'none';
66
+ html.appendChild(iframe);
67
+ // https://github.com/zloirock/core-js/issues/475
68
+ iframe.src = String(JS);
69
+ iframeDocument = iframe.contentWindow.document;
70
+ iframeDocument.open();
71
+ iframeDocument.write(scriptTag('document.F=Object'));
72
+ iframeDocument.close();
73
+ return iframeDocument.F;
74
+ };
75
+
76
+ // Check for document.domain and active x support
77
+ // No need to use active x approach when document.domain is not set
78
+ // see https://github.com/es-shims/es5-shim/issues/150
79
+ // variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346
80
+ // avoid IE GC bug
81
+ var activeXDocument;
82
+ var NullProtoObject = function () {
83
+ try {
84
+ activeXDocument = new ActiveXObject('htmlfile');
85
+ } catch (error) { /* ignore */ }
86
+ NullProtoObject = typeof document != 'undefined'
87
+ ? document.domain && activeXDocument
88
+ ? NullProtoObjectViaActiveX(activeXDocument) // old IE
89
+ : NullProtoObjectViaIFrame()
90
+ : NullProtoObjectViaActiveX(activeXDocument); // WSH
91
+ var length = enumBugKeys.length;
92
+ while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
93
+ return NullProtoObject();
94
+ };
95
+
96
+ hiddenKeys[IE_PROTO$1] = true;
97
+
98
+ // `Object.create` method
99
+ // https://tc39.es/ecma262/#sec-object.create
100
+ // eslint-disable-next-line es/no-object-create -- safe
101
+ var objectCreate = Object.create || function create(O, Properties) {
102
+ var result;
103
+ if (O !== null) {
104
+ EmptyConstructor[PROTOTYPE] = anObject(O);
105
+ result = new EmptyConstructor();
106
+ EmptyConstructor[PROTOTYPE] = null;
107
+ // add "__proto__" for Object.getPrototypeOf polyfill
108
+ result[IE_PROTO$1] = O;
109
+ } else result = NullProtoObject();
110
+ return Properties === undefined ? result : definePropertiesModule.f(result, Properties);
111
+ };
112
+
113
+ var wellKnownSymbol$3 = wellKnownSymbol$4;
114
+ var create$1 = objectCreate;
115
+ var defineProperty$1 = objectDefineProperty.f;
116
+
117
+ var UNSCOPABLES = wellKnownSymbol$3('unscopables');
118
+ var ArrayPrototype = Array.prototype;
119
+
120
+ // Array.prototype[@@unscopables]
121
+ // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
122
+ if (ArrayPrototype[UNSCOPABLES] == undefined) {
123
+ defineProperty$1(ArrayPrototype, UNSCOPABLES, {
124
+ configurable: true,
125
+ value: create$1(null)
126
+ });
127
+ }
128
+
129
+ // add a key to Array.prototype[@@unscopables]
130
+ var addToUnscopables$1 = function (key) {
131
+ ArrayPrototype[UNSCOPABLES][key] = true;
132
+ };
133
+
134
+ var fails$1 = fails$2;
135
+
136
+ var correctPrototypeGetter = !fails$1(function () {
137
+ function F() { /* empty */ }
138
+ F.prototype.constructor = null;
139
+ // eslint-disable-next-line es/no-object-getprototypeof -- required for testing
140
+ return Object.getPrototypeOf(new F()) !== F.prototype;
141
+ });
142
+
143
+ var hasOwn = hasOwnProperty_1;
144
+ var isCallable$2 = isCallable$3;
145
+ var toObject = toObject$1;
146
+ var sharedKey = sharedKey$2;
147
+ var CORRECT_PROTOTYPE_GETTER = correctPrototypeGetter;
148
+
149
+ var IE_PROTO = sharedKey('IE_PROTO');
150
+ var $Object = Object;
151
+ var ObjectPrototype = $Object.prototype;
152
+
153
+ // `Object.getPrototypeOf` method
154
+ // https://tc39.es/ecma262/#sec-object.getprototypeof
155
+ // eslint-disable-next-line es/no-object-getprototypeof -- safe
156
+ var objectGetPrototypeOf = CORRECT_PROTOTYPE_GETTER ? $Object.getPrototypeOf : function (O) {
157
+ var object = toObject(O);
158
+ if (hasOwn(object, IE_PROTO)) return object[IE_PROTO];
159
+ var constructor = object.constructor;
160
+ if (isCallable$2(constructor) && object instanceof constructor) {
161
+ return constructor.prototype;
162
+ } return object instanceof $Object ? ObjectPrototype : null;
163
+ };
164
+
165
+ var fails = fails$2;
166
+ var isCallable$1 = isCallable$3;
167
+ var isObject = isObject$1;
168
+ var getPrototypeOf$1 = objectGetPrototypeOf;
169
+ var defineBuiltIn$1 = defineBuiltIn$2;
170
+ var wellKnownSymbol$2 = wellKnownSymbol$4;
171
+
172
+ var ITERATOR$2 = wellKnownSymbol$2('iterator');
173
+ var BUGGY_SAFARI_ITERATORS$1 = false;
174
+
175
+ // `%IteratorPrototype%` object
176
+ // https://tc39.es/ecma262/#sec-%iteratorprototype%-object
177
+ var IteratorPrototype$2, PrototypeOfArrayIteratorPrototype, arrayIterator;
178
+
179
+ /* eslint-disable es/no-array-prototype-keys -- safe */
180
+ if ([].keys) {
181
+ arrayIterator = [].keys();
182
+ // Safari 8 has buggy iterators w/o `next`
183
+ if (!('next' in arrayIterator)) BUGGY_SAFARI_ITERATORS$1 = true;
184
+ else {
185
+ PrototypeOfArrayIteratorPrototype = getPrototypeOf$1(getPrototypeOf$1(arrayIterator));
186
+ if (PrototypeOfArrayIteratorPrototype !== Object.prototype) IteratorPrototype$2 = PrototypeOfArrayIteratorPrototype;
187
+ }
188
+ }
189
+
190
+ var NEW_ITERATOR_PROTOTYPE = !isObject(IteratorPrototype$2) || fails(function () {
191
+ var test = {};
192
+ // FF44- legacy iterators case
193
+ return IteratorPrototype$2[ITERATOR$2].call(test) !== test;
194
+ });
195
+
196
+ if (NEW_ITERATOR_PROTOTYPE) IteratorPrototype$2 = {};
197
+
198
+ // `%IteratorPrototype%[@@iterator]()` method
199
+ // https://tc39.es/ecma262/#sec-%iteratorprototype%-@@iterator
200
+ if (!isCallable$1(IteratorPrototype$2[ITERATOR$2])) {
201
+ defineBuiltIn$1(IteratorPrototype$2, ITERATOR$2, function () {
202
+ return this;
203
+ });
204
+ }
205
+
206
+ var iteratorsCore = {
207
+ IteratorPrototype: IteratorPrototype$2,
208
+ BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS$1
209
+ };
210
+
211
+ var IteratorPrototype$1 = iteratorsCore.IteratorPrototype;
212
+ var create = objectCreate;
213
+ var createPropertyDescriptor = createPropertyDescriptor$1;
214
+ var setToStringTag$1 = setToStringTag$2;
215
+ var Iterators$2 = iterators;
216
+
217
+ var returnThis$1 = function () { return this; };
218
+
219
+ var iteratorCreateConstructor = function (IteratorConstructor, NAME, next, ENUMERABLE_NEXT) {
220
+ var TO_STRING_TAG = NAME + ' Iterator';
221
+ IteratorConstructor.prototype = create(IteratorPrototype$1, { next: createPropertyDescriptor(+!ENUMERABLE_NEXT, next) });
222
+ setToStringTag$1(IteratorConstructor, TO_STRING_TAG, false);
223
+ Iterators$2[TO_STRING_TAG] = returnThis$1;
224
+ return IteratorConstructor;
225
+ };
226
+
227
+ var $ = _export;
228
+ var call = functionCall;
229
+ var FunctionName = functionName;
230
+ var isCallable = isCallable$3;
231
+ var createIteratorConstructor = iteratorCreateConstructor;
232
+ var getPrototypeOf = objectGetPrototypeOf;
233
+ var setPrototypeOf = objectSetPrototypeOf;
234
+ var setToStringTag = setToStringTag$2;
235
+ var createNonEnumerableProperty$1 = createNonEnumerableProperty$2;
236
+ var defineBuiltIn = defineBuiltIn$2;
237
+ var wellKnownSymbol$1 = wellKnownSymbol$4;
238
+ var Iterators$1 = iterators;
239
+ var IteratorsCore = iteratorsCore;
240
+
241
+ var PROPER_FUNCTION_NAME = FunctionName.PROPER;
242
+ var CONFIGURABLE_FUNCTION_NAME = FunctionName.CONFIGURABLE;
243
+ var IteratorPrototype = IteratorsCore.IteratorPrototype;
244
+ var BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS;
245
+ var ITERATOR$1 = wellKnownSymbol$1('iterator');
246
+ var KEYS = 'keys';
247
+ var VALUES = 'values';
248
+ var ENTRIES = 'entries';
249
+
250
+ var returnThis = function () { return this; };
251
+
252
+ var iteratorDefine = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) {
253
+ createIteratorConstructor(IteratorConstructor, NAME, next);
254
+
255
+ var getIterationMethod = function (KIND) {
256
+ if (KIND === DEFAULT && defaultIterator) return defaultIterator;
257
+ if (!BUGGY_SAFARI_ITERATORS && KIND in IterablePrototype) return IterablePrototype[KIND];
258
+ switch (KIND) {
259
+ case KEYS: return function keys() { return new IteratorConstructor(this, KIND); };
260
+ case VALUES: return function values() { return new IteratorConstructor(this, KIND); };
261
+ case ENTRIES: return function entries() { return new IteratorConstructor(this, KIND); };
262
+ } return function () { return new IteratorConstructor(this); };
263
+ };
264
+
265
+ var TO_STRING_TAG = NAME + ' Iterator';
266
+ var INCORRECT_VALUES_NAME = false;
267
+ var IterablePrototype = Iterable.prototype;
268
+ var nativeIterator = IterablePrototype[ITERATOR$1]
269
+ || IterablePrototype['@@iterator']
270
+ || DEFAULT && IterablePrototype[DEFAULT];
271
+ var defaultIterator = !BUGGY_SAFARI_ITERATORS && nativeIterator || getIterationMethod(DEFAULT);
272
+ var anyNativeIterator = NAME == 'Array' ? IterablePrototype.entries || nativeIterator : nativeIterator;
273
+ var CurrentIteratorPrototype, methods, KEY;
274
+
275
+ // fix native
276
+ if (anyNativeIterator) {
277
+ CurrentIteratorPrototype = getPrototypeOf(anyNativeIterator.call(new Iterable()));
278
+ if (CurrentIteratorPrototype !== Object.prototype && CurrentIteratorPrototype.next) {
279
+ if (getPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype) {
280
+ if (setPrototypeOf) {
281
+ setPrototypeOf(CurrentIteratorPrototype, IteratorPrototype);
282
+ } else if (!isCallable(CurrentIteratorPrototype[ITERATOR$1])) {
283
+ defineBuiltIn(CurrentIteratorPrototype, ITERATOR$1, returnThis);
284
+ }
285
+ }
286
+ // Set @@toStringTag to native iterators
287
+ setToStringTag(CurrentIteratorPrototype, TO_STRING_TAG, true);
288
+ }
289
+ }
290
+
291
+ // fix Array.prototype.{ values, @@iterator }.name in V8 / FF
292
+ if (PROPER_FUNCTION_NAME && DEFAULT == VALUES && nativeIterator && nativeIterator.name !== VALUES) {
293
+ if (CONFIGURABLE_FUNCTION_NAME) {
294
+ createNonEnumerableProperty$1(IterablePrototype, 'name', VALUES);
295
+ } else {
296
+ INCORRECT_VALUES_NAME = true;
297
+ defaultIterator = function values() { return call(nativeIterator, this); };
298
+ }
299
+ }
300
+
301
+ // export additional methods
302
+ if (DEFAULT) {
303
+ methods = {
304
+ values: getIterationMethod(VALUES),
305
+ keys: IS_SET ? defaultIterator : getIterationMethod(KEYS),
306
+ entries: getIterationMethod(ENTRIES)
307
+ };
308
+ if (FORCED) for (KEY in methods) {
309
+ if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) {
310
+ defineBuiltIn(IterablePrototype, KEY, methods[KEY]);
311
+ }
312
+ } else $({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods);
313
+ }
314
+
315
+ // define iterator
316
+ if (IterablePrototype[ITERATOR$1] !== defaultIterator) {
317
+ defineBuiltIn(IterablePrototype, ITERATOR$1, defaultIterator, { name: DEFAULT });
318
+ }
319
+ Iterators$1[NAME] = defaultIterator;
320
+
321
+ return methods;
322
+ };
323
+
324
+ // `CreateIterResultObject` abstract operation
325
+ // https://tc39.es/ecma262/#sec-createiterresultobject
326
+ var createIterResultObject$1 = function (value, done) {
327
+ return { value: value, done: done };
328
+ };
329
+
330
+ var toIndexedObject = toIndexedObject$2;
331
+ var addToUnscopables = addToUnscopables$1;
332
+ var Iterators = iterators;
333
+ var InternalStateModule = internalState;
334
+ var defineProperty = objectDefineProperty.f;
335
+ var defineIterator = iteratorDefine;
336
+ var createIterResultObject = createIterResultObject$1;
337
+ var DESCRIPTORS = descriptors;
338
+
339
+ var ARRAY_ITERATOR = 'Array Iterator';
340
+ var setInternalState = InternalStateModule.set;
341
+ var getInternalState = InternalStateModule.getterFor(ARRAY_ITERATOR);
342
+
343
+ // `Array.prototype.entries` method
344
+ // https://tc39.es/ecma262/#sec-array.prototype.entries
345
+ // `Array.prototype.keys` method
346
+ // https://tc39.es/ecma262/#sec-array.prototype.keys
347
+ // `Array.prototype.values` method
348
+ // https://tc39.es/ecma262/#sec-array.prototype.values
349
+ // `Array.prototype[@@iterator]` method
350
+ // https://tc39.es/ecma262/#sec-array.prototype-@@iterator
351
+ // `CreateArrayIterator` internal method
352
+ // https://tc39.es/ecma262/#sec-createarrayiterator
353
+ var es_array_iterator = defineIterator(Array, 'Array', function (iterated, kind) {
354
+ setInternalState(this, {
355
+ type: ARRAY_ITERATOR,
356
+ target: toIndexedObject(iterated), // target
357
+ index: 0, // next index
358
+ kind: kind // kind
359
+ });
360
+ // `%ArrayIteratorPrototype%.next` method
361
+ // https://tc39.es/ecma262/#sec-%arrayiteratorprototype%.next
362
+ }, function () {
363
+ var state = getInternalState(this);
364
+ var target = state.target;
365
+ var kind = state.kind;
366
+ var index = state.index++;
367
+ if (!target || index >= target.length) {
368
+ state.target = undefined;
369
+ return createIterResultObject(undefined, true);
370
+ }
371
+ if (kind == 'keys') return createIterResultObject(index, false);
372
+ if (kind == 'values') return createIterResultObject(target[index], false);
373
+ return createIterResultObject([index, target[index]], false);
374
+ }, 'values');
375
+
376
+ // argumentsList[@@iterator] is %ArrayProto_values%
377
+ // https://tc39.es/ecma262/#sec-createunmappedargumentsobject
378
+ // https://tc39.es/ecma262/#sec-createmappedargumentsobject
379
+ var values = Iterators.Arguments = Iterators.Array;
380
+
381
+ // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
382
+ addToUnscopables('keys');
383
+ addToUnscopables('values');
384
+ addToUnscopables('entries');
385
+
386
+ // V8 ~ Chrome 45- bug
387
+ if (DESCRIPTORS && values.name !== 'values') try {
388
+ defineProperty(values, 'name', { value: 'values' });
389
+ } catch (error) { /* empty */ }
390
+
391
+ // iterable DOM collections
392
+ // flag - `iterable` interface - 'entries', 'keys', 'values', 'forEach' methods
393
+ var domIterables = {
394
+ CSSRuleList: 0,
395
+ CSSStyleDeclaration: 0,
396
+ CSSValueList: 0,
397
+ ClientRectList: 0,
398
+ DOMRectList: 0,
399
+ DOMStringList: 0,
400
+ DOMTokenList: 1,
401
+ DataTransferItemList: 0,
402
+ FileList: 0,
403
+ HTMLAllCollection: 0,
404
+ HTMLCollection: 0,
405
+ HTMLFormElement: 0,
406
+ HTMLSelectElement: 0,
407
+ MediaList: 0,
408
+ MimeTypeArray: 0,
409
+ NamedNodeMap: 0,
410
+ NodeList: 1,
411
+ PaintRequestList: 0,
412
+ Plugin: 0,
413
+ PluginArray: 0,
414
+ SVGLengthList: 0,
415
+ SVGNumberList: 0,
416
+ SVGPathSegList: 0,
417
+ SVGPointList: 0,
418
+ SVGStringList: 0,
419
+ SVGTransformList: 0,
420
+ SourceBufferList: 0,
421
+ StyleSheetList: 0,
422
+ TextTrackCueList: 0,
423
+ TextTrackList: 0,
424
+ TouchList: 0
425
+ };
426
+
427
+ // in old WebKit versions, `element.classList` is not an instance of global `DOMTokenList`
428
+ var documentCreateElement = documentCreateElement$2;
429
+
430
+ var classList = documentCreateElement('span').classList;
431
+ var DOMTokenListPrototype$1 = classList && classList.constructor && classList.constructor.prototype;
432
+
433
+ var domTokenListPrototype = DOMTokenListPrototype$1 === Object.prototype ? undefined : DOMTokenListPrototype$1;
434
+
435
+ var global = global$1;
436
+ var DOMIterables = domIterables;
437
+ var DOMTokenListPrototype = domTokenListPrototype;
438
+ var ArrayIteratorMethods = es_array_iterator;
439
+ var createNonEnumerableProperty = createNonEnumerableProperty$2;
440
+ var wellKnownSymbol = wellKnownSymbol$4;
441
+
442
+ var ITERATOR = wellKnownSymbol('iterator');
443
+ var TO_STRING_TAG = wellKnownSymbol('toStringTag');
444
+ var ArrayValues = ArrayIteratorMethods.values;
445
+
446
+ var handlePrototype = function (CollectionPrototype, COLLECTION_NAME) {
447
+ if (CollectionPrototype) {
448
+ // some Chrome versions have non-configurable methods on DOMTokenList
449
+ if (CollectionPrototype[ITERATOR] !== ArrayValues) try {
450
+ createNonEnumerableProperty(CollectionPrototype, ITERATOR, ArrayValues);
451
+ } catch (error) {
452
+ CollectionPrototype[ITERATOR] = ArrayValues;
453
+ }
454
+ if (!CollectionPrototype[TO_STRING_TAG]) {
455
+ createNonEnumerableProperty(CollectionPrototype, TO_STRING_TAG, COLLECTION_NAME);
456
+ }
457
+ if (DOMIterables[COLLECTION_NAME]) for (var METHOD_NAME in ArrayIteratorMethods) {
458
+ // some Chrome versions have non-configurable methods on DOMTokenList
459
+ if (CollectionPrototype[METHOD_NAME] !== ArrayIteratorMethods[METHOD_NAME]) try {
460
+ createNonEnumerableProperty(CollectionPrototype, METHOD_NAME, ArrayIteratorMethods[METHOD_NAME]);
461
+ } catch (error) {
462
+ CollectionPrototype[METHOD_NAME] = ArrayIteratorMethods[METHOD_NAME];
463
+ }
464
+ }
465
+ }
466
+ };
467
+
468
+ for (var COLLECTION_NAME in DOMIterables) {
469
+ handlePrototype(global[COLLECTION_NAME] && global[COLLECTION_NAME].prototype, COLLECTION_NAME);
470
+ }
471
+
472
+ handlePrototype(DOMTokenListPrototype, 'DOMTokenList');
package/shared/when.js ADDED
@@ -0,0 +1,15 @@
1
+ /**
2
+ * A directive that enables basic conditional rendering in a template.
3
+ * @param binding - The condition to test for rendering.
4
+ * @param templateOrTemplateBinding - The template or a binding that gets
5
+ * the template to render when the condition is true.
6
+ * @public
7
+ */
8
+ function when(binding, templateOrTemplateBinding) {
9
+ const getTemplate = typeof templateOrTemplateBinding === "function"
10
+ ? templateOrTemplateBinding
11
+ : () => templateOrTemplateBinding;
12
+ return (source, context) => binding(source, context) ? getTemplate(source, context) : null;
13
+ }
14
+
15
+ export { when as w };
@@ -0,0 +1,89 @@
1
+ import { F as FoundationElement, c as __classPrivateFieldGet, _ as __decorate, a as attr, b as __metadata, h as html, d as designSystem } from '../shared/index.js';
2
+ import '../shared/web.dom-collections.iterator.js';
3
+ import { w as when } from '../shared/when.js';
4
+ import { c as classNames } from '../shared/class-names.js';
5
+ import '../shared/export.js';
6
+ import '../shared/object-keys.js';
7
+ import '../shared/iterators.js';
8
+
9
+ var _SideDrawer_instances, _SideDrawer_close, _SideDrawer_open;
10
+ class SideDrawer extends FoundationElement {
11
+ constructor() {
12
+ super(...arguments);
13
+ _SideDrawer_instances.add(this);
14
+ this.alternate = false;
15
+ this.modal = false;
16
+ this.open = false;
17
+ this.trailing = false;
18
+ }
19
+ attributeChangedCallback(name, oldValue, newValue) {
20
+ super.attributeChangedCallback(name, oldValue, newValue);
21
+ switch (name) {
22
+ case 'open':
23
+ {
24
+ this.open ? __classPrivateFieldGet(this, _SideDrawer_instances, "m", _SideDrawer_open).call(this) : __classPrivateFieldGet(this, _SideDrawer_instances, "m", _SideDrawer_close).call(this);
25
+ }
26
+ }
27
+ }
28
+ }
29
+ _SideDrawer_instances = new WeakSet(), _SideDrawer_close = function _SideDrawer_close() {
30
+ this.$emit('close');
31
+ }, _SideDrawer_open = function _SideDrawer_open() {
32
+ this.$emit('open');
33
+ };
34
+ __decorate([attr({
35
+ mode: 'boolean'
36
+ }), __metadata("design:type", Object)], SideDrawer.prototype, "alternate", void 0);
37
+ __decorate([attr({
38
+ mode: 'boolean'
39
+ }), __metadata("design:type", Object)], SideDrawer.prototype, "modal", void 0);
40
+ __decorate([attr({
41
+ mode: 'boolean'
42
+ }), __metadata("design:type", Object)], SideDrawer.prototype, "open", void 0);
43
+ __decorate([attr({
44
+ mode: 'boolean'
45
+ }), __metadata("design:type", Object)], SideDrawer.prototype, "trailing", void 0);
46
+
47
+ var css_248z = "/**\n * Do not edit directly\n * Generated on Tue, 15 Nov 2022 13:39:19 GMT\n */\n.control {\n position: fixed;\n z-index: 1;\n background-color: var(--vvd-color-canvas);\n color: var(--vvd-color-canvas-text);\n inline-size: 280px;\n inset-block: 0;\n overflow-y: auto;\n}\n.control[part~=vvd-theme-alternate] {\n background-color: var(--vvd-color-canvas);\n color: var(--vvd-color-canvas-text);\n color-scheme: var(--vvd-color-scheme);\n}\n.control.trailing {\n inset-inline-end: 0;\n}\n.control:not(.open).trailing {\n transform: translateX(100%);\n}\n.control:not(.open):not(.trailing) {\n transform: translateX(-100%);\n}\n.control.open:not(.modal).trailing + .side-drawer-app-content {\n margin-inline-end: var(--side-drawer-app-content-offset, 280px);\n}\n.control.open:not(.modal):not(.trailing) + .side-drawer-app-content {\n margin-inline-start: var(--side-drawer-app-content-offset, 280px);\n}\n@media (prefers-reduced-motion: no-preference) {\n .control {\n transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);\n }\n}\n\n.scrim {\n background-color: var(--vvd-color-canvas-text);\n opacity: 0.5;\n position: fixed;\n inset: 0;\n}\n.scrim:not(.open) {\n display: none;\n}";
48
+
49
+ let _ = t => t,
50
+ _t,
51
+ _t2;
52
+ const getClasses = ({
53
+ modal,
54
+ open,
55
+ trailing
56
+ }) => classNames('control', ['modal', modal], ['open', open], ['trailing', trailing]);
57
+ const getScrimClasses = ({
58
+ open
59
+ }) => classNames('scrim', ['open', open]);
60
+ const sideDrawerTemplate = () => html(_t || (_t = _`
61
+ <aside class="${0}" part="base ${0}"
62
+ @keydown="${0}">
63
+ <slot></slot>
64
+ </aside>
65
+
66
+ <div class="side-drawer-app-content" ?inert="${0}">
67
+ <slot name="app-content"></slot>
68
+ </div>
69
+
70
+ ${0}
71
+ `), getClasses, x => x.alternate ? 'vvd-theme-alternate' : '', (x, c) => handleKeydown(x, c.event), x => x.open && x.modal, when(x => x.modal, html(_t2 || (_t2 = _`<div class="${0}" @click="${0}"></div>`), getScrimClasses, x => x.open = false)));
72
+ const handleKeydown = (x, {
73
+ key
74
+ }) => {
75
+ if (key === 'Escape') {
76
+ x.open = false;
77
+ } else {
78
+ return true;
79
+ }
80
+ };
81
+
82
+ const vividSideDrawer = SideDrawer.compose({
83
+ baseName: 'side-drawer',
84
+ template: sideDrawerTemplate,
85
+ styles: css_248z
86
+ });
87
+ designSystem.register(vividSideDrawer());
88
+
89
+ export { vividSideDrawer };