@vonage/vivid 3.0.0-next.21 → 3.0.0-next.22

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 (47) hide show
  1. package/README.md +2 -2
  2. package/accordion-item/index.js +11 -6
  3. package/badge/index.js +1 -1
  4. package/banner/index.js +9 -11
  5. package/breadcrumb/index.js +1 -0
  6. package/breadcrumb-item/index.js +11 -4
  7. package/button/index.js +5 -3
  8. package/calendar/index.js +31 -9
  9. package/calendar-event/index.js +19 -32
  10. package/card/index.js +10 -18
  11. package/fab/index.js +5 -3
  12. package/icon/index.js +1 -1
  13. package/index.js +11 -9
  14. package/lib/accordion-item/index.d.ts +2 -0
  15. package/lib/banner/banner.template.d.ts +0 -2
  16. package/lib/banner/index.d.ts +1 -0
  17. package/lib/breadcrumb-item/index.d.ts +1 -0
  18. package/lib/calendar/calendar.d.ts +3 -1
  19. package/lib/calendar/index.d.ts +0 -1
  20. package/lib/calendar-event/calendar-event.d.ts +3 -1
  21. package/lib/card/index.d.ts +0 -1
  22. package/lib/side-drawer/side-drawer.d.ts +8 -1
  23. package/lib/sidenav-item/index.d.ts +1 -0
  24. package/note/index.js +1 -1
  25. package/package.json +5 -2
  26. package/popup/index.js +6 -4
  27. package/progress/index.js +2 -2
  28. package/shared/aria-global.js +3 -40
  29. package/shared/button.js +1 -1
  30. package/shared/calendar-event.js +26 -0
  31. package/shared/es.object.assign.js +1 -1
  32. package/shared/export.js +444 -444
  33. package/shared/focus2.js +2 -459
  34. package/shared/form-associated.js +460 -0
  35. package/shared/icon.js +2 -2
  36. package/shared/{object-set-prototype-of.js → iterators.js} +20 -20
  37. package/shared/object-keys.js +1 -1
  38. package/shared/ref.js +41 -0
  39. package/shared/text-anchor.template.js +5 -2
  40. package/shared/to-string.js +1 -1
  41. package/shared/web.dom-collections.iterator.js +2 -2
  42. package/side-drawer/index.js +8587 -11
  43. package/sidenav-item/index.js +7 -6
  44. package/text/index.js +1 -1
  45. package/text-anchor/index.js +4 -1
  46. package/text-field/index.js +6 -4
  47. package/tooltip/index.js +4 -2
@@ -0,0 +1,460 @@
1
+ import { e as emptyArray, D as DOM, a as attr, o as observable } from './index.js';
2
+
3
+ /**
4
+ * Key Code values
5
+ * @deprecated - KeyCodes are deprecated, use individual string key exports
6
+ */
7
+ var KeyCodes;
8
+ (function (KeyCodes) {
9
+ KeyCodes[KeyCodes["alt"] = 18] = "alt";
10
+ KeyCodes[KeyCodes["arrowDown"] = 40] = "arrowDown";
11
+ KeyCodes[KeyCodes["arrowLeft"] = 37] = "arrowLeft";
12
+ KeyCodes[KeyCodes["arrowRight"] = 39] = "arrowRight";
13
+ KeyCodes[KeyCodes["arrowUp"] = 38] = "arrowUp";
14
+ KeyCodes[KeyCodes["back"] = 8] = "back";
15
+ KeyCodes[KeyCodes["backSlash"] = 220] = "backSlash";
16
+ KeyCodes[KeyCodes["break"] = 19] = "break";
17
+ KeyCodes[KeyCodes["capsLock"] = 20] = "capsLock";
18
+ KeyCodes[KeyCodes["closeBracket"] = 221] = "closeBracket";
19
+ KeyCodes[KeyCodes["colon"] = 186] = "colon";
20
+ KeyCodes[KeyCodes["colon2"] = 59] = "colon2";
21
+ KeyCodes[KeyCodes["comma"] = 188] = "comma";
22
+ KeyCodes[KeyCodes["ctrl"] = 17] = "ctrl";
23
+ KeyCodes[KeyCodes["delete"] = 46] = "delete";
24
+ KeyCodes[KeyCodes["end"] = 35] = "end";
25
+ KeyCodes[KeyCodes["enter"] = 13] = "enter";
26
+ KeyCodes[KeyCodes["equals"] = 187] = "equals";
27
+ KeyCodes[KeyCodes["equals2"] = 61] = "equals2";
28
+ KeyCodes[KeyCodes["equals3"] = 107] = "equals3";
29
+ KeyCodes[KeyCodes["escape"] = 27] = "escape";
30
+ KeyCodes[KeyCodes["forwardSlash"] = 191] = "forwardSlash";
31
+ KeyCodes[KeyCodes["function1"] = 112] = "function1";
32
+ KeyCodes[KeyCodes["function10"] = 121] = "function10";
33
+ KeyCodes[KeyCodes["function11"] = 122] = "function11";
34
+ KeyCodes[KeyCodes["function12"] = 123] = "function12";
35
+ KeyCodes[KeyCodes["function2"] = 113] = "function2";
36
+ KeyCodes[KeyCodes["function3"] = 114] = "function3";
37
+ KeyCodes[KeyCodes["function4"] = 115] = "function4";
38
+ KeyCodes[KeyCodes["function5"] = 116] = "function5";
39
+ KeyCodes[KeyCodes["function6"] = 117] = "function6";
40
+ KeyCodes[KeyCodes["function7"] = 118] = "function7";
41
+ KeyCodes[KeyCodes["function8"] = 119] = "function8";
42
+ KeyCodes[KeyCodes["function9"] = 120] = "function9";
43
+ KeyCodes[KeyCodes["home"] = 36] = "home";
44
+ KeyCodes[KeyCodes["insert"] = 45] = "insert";
45
+ KeyCodes[KeyCodes["menu"] = 93] = "menu";
46
+ KeyCodes[KeyCodes["minus"] = 189] = "minus";
47
+ KeyCodes[KeyCodes["minus2"] = 109] = "minus2";
48
+ KeyCodes[KeyCodes["numLock"] = 144] = "numLock";
49
+ KeyCodes[KeyCodes["numPad0"] = 96] = "numPad0";
50
+ KeyCodes[KeyCodes["numPad1"] = 97] = "numPad1";
51
+ KeyCodes[KeyCodes["numPad2"] = 98] = "numPad2";
52
+ KeyCodes[KeyCodes["numPad3"] = 99] = "numPad3";
53
+ KeyCodes[KeyCodes["numPad4"] = 100] = "numPad4";
54
+ KeyCodes[KeyCodes["numPad5"] = 101] = "numPad5";
55
+ KeyCodes[KeyCodes["numPad6"] = 102] = "numPad6";
56
+ KeyCodes[KeyCodes["numPad7"] = 103] = "numPad7";
57
+ KeyCodes[KeyCodes["numPad8"] = 104] = "numPad8";
58
+ KeyCodes[KeyCodes["numPad9"] = 105] = "numPad9";
59
+ KeyCodes[KeyCodes["numPadDivide"] = 111] = "numPadDivide";
60
+ KeyCodes[KeyCodes["numPadDot"] = 110] = "numPadDot";
61
+ KeyCodes[KeyCodes["numPadMinus"] = 109] = "numPadMinus";
62
+ KeyCodes[KeyCodes["numPadMultiply"] = 106] = "numPadMultiply";
63
+ KeyCodes[KeyCodes["numPadPlus"] = 107] = "numPadPlus";
64
+ KeyCodes[KeyCodes["openBracket"] = 219] = "openBracket";
65
+ KeyCodes[KeyCodes["pageDown"] = 34] = "pageDown";
66
+ KeyCodes[KeyCodes["pageUp"] = 33] = "pageUp";
67
+ KeyCodes[KeyCodes["period"] = 190] = "period";
68
+ KeyCodes[KeyCodes["print"] = 44] = "print";
69
+ KeyCodes[KeyCodes["quote"] = 222] = "quote";
70
+ KeyCodes[KeyCodes["scrollLock"] = 145] = "scrollLock";
71
+ KeyCodes[KeyCodes["shift"] = 16] = "shift";
72
+ KeyCodes[KeyCodes["space"] = 32] = "space";
73
+ KeyCodes[KeyCodes["tab"] = 9] = "tab";
74
+ KeyCodes[KeyCodes["tilde"] = 192] = "tilde";
75
+ KeyCodes[KeyCodes["windowsLeft"] = 91] = "windowsLeft";
76
+ KeyCodes[KeyCodes["windowsOpera"] = 219] = "windowsOpera";
77
+ KeyCodes[KeyCodes["windowsRight"] = 92] = "windowsRight";
78
+ })(KeyCodes || (KeyCodes = {}));
79
+ const keyEnter = "Enter";
80
+
81
+ const proxySlotName = "form-associated-proxy";
82
+ const ElementInternalsKey = "ElementInternals";
83
+ /**
84
+ * @alpha
85
+ */
86
+ const supportsElementInternals = ElementInternalsKey in window &&
87
+ "setFormValue" in window[ElementInternalsKey].prototype;
88
+ const InternalsMap = new WeakMap();
89
+ /**
90
+ * Base function for providing Custom Element Form Association.
91
+ *
92
+ * @alpha
93
+ */
94
+ function FormAssociated(BaseCtor) {
95
+ const C = class extends BaseCtor {
96
+ constructor(...args) {
97
+ super(...args);
98
+ /**
99
+ * Track whether the value has been changed from the initial value
100
+ */
101
+ this.dirtyValue = false;
102
+ /**
103
+ * Sets the element's disabled state. A disabled element will not be included during form submission.
104
+ *
105
+ * @remarks
106
+ * HTML Attribute: disabled
107
+ */
108
+ this.disabled = false;
109
+ /**
110
+ * These are events that are still fired by the proxy
111
+ * element based on user / programmatic interaction.
112
+ *
113
+ * The proxy implementation should be transparent to
114
+ * the app author, so block these events from emitting.
115
+ */
116
+ this.proxyEventsToBlock = ["change", "click"];
117
+ this.proxyInitialized = false;
118
+ this.required = false;
119
+ this.initialValue = this.initialValue || "";
120
+ if (!this.elementInternals) {
121
+ // When elementInternals is not supported, formResetCallback is
122
+ // bound to an event listener, so ensure the handler's `this`
123
+ // context is correct.
124
+ this.formResetCallback = this.formResetCallback.bind(this);
125
+ }
126
+ }
127
+ /**
128
+ * Must evaluate to true to enable elementInternals.
129
+ * Feature detects API support and resolve respectively
130
+ *
131
+ * @internal
132
+ */
133
+ static get formAssociated() {
134
+ return supportsElementInternals;
135
+ }
136
+ /**
137
+ * Returns the validity state of the element
138
+ *
139
+ * @alpha
140
+ */
141
+ get validity() {
142
+ return this.elementInternals
143
+ ? this.elementInternals.validity
144
+ : this.proxy.validity;
145
+ }
146
+ /**
147
+ * Retrieve a reference to the associated form.
148
+ * Returns null if not associated to any form.
149
+ *
150
+ * @alpha
151
+ */
152
+ get form() {
153
+ return this.elementInternals ? this.elementInternals.form : this.proxy.form;
154
+ }
155
+ /**
156
+ * Retrieve the localized validation message,
157
+ * or custom validation message if set.
158
+ *
159
+ * @alpha
160
+ */
161
+ get validationMessage() {
162
+ return this.elementInternals
163
+ ? this.elementInternals.validationMessage
164
+ : this.proxy.validationMessage;
165
+ }
166
+ /**
167
+ * Whether the element will be validated when the
168
+ * form is submitted
169
+ */
170
+ get willValidate() {
171
+ return this.elementInternals
172
+ ? this.elementInternals.willValidate
173
+ : this.proxy.willValidate;
174
+ }
175
+ /**
176
+ * A reference to all associated label elements
177
+ */
178
+ get labels() {
179
+ if (this.elementInternals) {
180
+ return Object.freeze(Array.from(this.elementInternals.labels));
181
+ }
182
+ else if (this.proxy instanceof HTMLElement &&
183
+ this.proxy.ownerDocument &&
184
+ this.id) {
185
+ // Labels associated by wrapping the element: <label><custom-element></custom-element></label>
186
+ const parentLabels = this.proxy.labels;
187
+ // Labels associated using the `for` attribute
188
+ const forLabels = Array.from(this.proxy.getRootNode().querySelectorAll(`[for='${this.id}']`));
189
+ const labels = parentLabels
190
+ ? forLabels.concat(Array.from(parentLabels))
191
+ : forLabels;
192
+ return Object.freeze(labels);
193
+ }
194
+ else {
195
+ return emptyArray;
196
+ }
197
+ }
198
+ /**
199
+ * Invoked when the `value` property changes
200
+ * @param previous - the previous value
201
+ * @param next - the new value
202
+ *
203
+ * @remarks
204
+ * If elements extending `FormAssociated` implement a `valueChanged` method
205
+ * They must be sure to invoke `super.valueChanged(previous, next)` to ensure
206
+ * proper functioning of `FormAssociated`
207
+ */
208
+ valueChanged(previous, next) {
209
+ this.dirtyValue = true;
210
+ if (this.proxy instanceof HTMLElement) {
211
+ this.proxy.value = this.value;
212
+ }
213
+ this.currentValue = this.value;
214
+ this.setFormValue(this.value);
215
+ this.validate();
216
+ }
217
+ currentValueChanged() {
218
+ this.value = this.currentValue;
219
+ }
220
+ /**
221
+ * Invoked when the `initialValue` property changes
222
+ *
223
+ * @param previous - the previous value
224
+ * @param next - the new value
225
+ *
226
+ * @remarks
227
+ * If elements extending `FormAssociated` implement a `initialValueChanged` method
228
+ * They must be sure to invoke `super.initialValueChanged(previous, next)` to ensure
229
+ * proper functioning of `FormAssociated`
230
+ */
231
+ initialValueChanged(previous, next) {
232
+ // If the value is clean and the component is connected to the DOM
233
+ // then set value equal to the attribute value.
234
+ if (!this.dirtyValue) {
235
+ this.value = this.initialValue;
236
+ this.dirtyValue = false;
237
+ }
238
+ }
239
+ /**
240
+ * Invoked when the `disabled` property changes
241
+ *
242
+ * @param previous - the previous value
243
+ * @param next - the new value
244
+ *
245
+ * @remarks
246
+ * If elements extending `FormAssociated` implement a `disabledChanged` method
247
+ * They must be sure to invoke `super.disabledChanged(previous, next)` to ensure
248
+ * proper functioning of `FormAssociated`
249
+ */
250
+ disabledChanged(previous, next) {
251
+ if (this.proxy instanceof HTMLElement) {
252
+ this.proxy.disabled = this.disabled;
253
+ }
254
+ DOM.queueUpdate(() => this.classList.toggle("disabled", this.disabled));
255
+ }
256
+ /**
257
+ * Invoked when the `name` property changes
258
+ *
259
+ * @param previous - the previous value
260
+ * @param next - the new value
261
+ *
262
+ * @remarks
263
+ * If elements extending `FormAssociated` implement a `nameChanged` method
264
+ * They must be sure to invoke `super.nameChanged(previous, next)` to ensure
265
+ * proper functioning of `FormAssociated`
266
+ */
267
+ nameChanged(previous, next) {
268
+ if (this.proxy instanceof HTMLElement) {
269
+ this.proxy.name = this.name;
270
+ }
271
+ }
272
+ /**
273
+ * Invoked when the `required` property changes
274
+ *
275
+ * @param previous - the previous value
276
+ * @param next - the new value
277
+ *
278
+ * @remarks
279
+ * If elements extending `FormAssociated` implement a `requiredChanged` method
280
+ * They must be sure to invoke `super.requiredChanged(previous, next)` to ensure
281
+ * proper functioning of `FormAssociated`
282
+ */
283
+ requiredChanged(prev, next) {
284
+ if (this.proxy instanceof HTMLElement) {
285
+ this.proxy.required = this.required;
286
+ }
287
+ DOM.queueUpdate(() => this.classList.toggle("required", this.required));
288
+ this.validate();
289
+ }
290
+ /**
291
+ * The element internals object. Will only exist
292
+ * in browsers supporting the attachInternals API
293
+ */
294
+ get elementInternals() {
295
+ if (!supportsElementInternals) {
296
+ return null;
297
+ }
298
+ let internals = InternalsMap.get(this);
299
+ if (!internals) {
300
+ internals = this.attachInternals();
301
+ InternalsMap.set(this, internals);
302
+ }
303
+ return internals;
304
+ }
305
+ /**
306
+ * @internal
307
+ */
308
+ connectedCallback() {
309
+ super.connectedCallback();
310
+ this.addEventListener("keypress", this._keypressHandler);
311
+ if (!this.value) {
312
+ this.value = this.initialValue;
313
+ this.dirtyValue = false;
314
+ }
315
+ if (!this.elementInternals) {
316
+ this.attachProxy();
317
+ if (this.form) {
318
+ this.form.addEventListener("reset", this.formResetCallback);
319
+ }
320
+ }
321
+ }
322
+ /**
323
+ * @internal
324
+ */
325
+ disconnectedCallback() {
326
+ this.proxyEventsToBlock.forEach(name => this.proxy.removeEventListener(name, this.stopPropagation));
327
+ if (!this.elementInternals && this.form) {
328
+ this.form.removeEventListener("reset", this.formResetCallback);
329
+ }
330
+ }
331
+ /**
332
+ * Return the current validity of the element.
333
+ */
334
+ checkValidity() {
335
+ return this.elementInternals
336
+ ? this.elementInternals.checkValidity()
337
+ : this.proxy.checkValidity();
338
+ }
339
+ /**
340
+ * Return the current validity of the element.
341
+ * If false, fires an invalid event at the element.
342
+ */
343
+ reportValidity() {
344
+ return this.elementInternals
345
+ ? this.elementInternals.reportValidity()
346
+ : this.proxy.reportValidity();
347
+ }
348
+ /**
349
+ * Set the validity of the control. In cases when the elementInternals object is not
350
+ * available (and the proxy element is used to report validity), this function will
351
+ * do nothing unless a message is provided, at which point the setCustomValidity method
352
+ * of the proxy element will be invoked with the provided message.
353
+ * @param flags - Validity flags
354
+ * @param message - Optional message to supply
355
+ * @param anchor - Optional element used by UA to display an interactive validation UI
356
+ */
357
+ setValidity(flags, message, anchor) {
358
+ if (this.elementInternals) {
359
+ this.elementInternals.setValidity(flags, message, anchor);
360
+ }
361
+ else if (typeof message === "string") {
362
+ this.proxy.setCustomValidity(message);
363
+ }
364
+ }
365
+ /**
366
+ * Invoked when a connected component's form or fieldset has its disabled
367
+ * state changed.
368
+ * @param disabled - the disabled value of the form / fieldset
369
+ */
370
+ formDisabledCallback(disabled) {
371
+ this.disabled = disabled;
372
+ }
373
+ formResetCallback() {
374
+ this.value = this.initialValue;
375
+ this.dirtyValue = false;
376
+ }
377
+ /**
378
+ * Attach the proxy element to the DOM
379
+ */
380
+ attachProxy() {
381
+ var _a;
382
+ if (!this.proxyInitialized) {
383
+ this.proxyInitialized = true;
384
+ this.proxy.style.display = "none";
385
+ this.proxyEventsToBlock.forEach(name => this.proxy.addEventListener(name, this.stopPropagation));
386
+ // These are typically mapped to the proxy during
387
+ // property change callbacks, but during initialization
388
+ // on the initial call of the callback, the proxy is
389
+ // still undefined. We should find a better way to address this.
390
+ this.proxy.disabled = this.disabled;
391
+ this.proxy.required = this.required;
392
+ if (typeof this.name === "string") {
393
+ this.proxy.name = this.name;
394
+ }
395
+ if (typeof this.value === "string") {
396
+ this.proxy.value = this.value;
397
+ }
398
+ this.proxy.setAttribute("slot", proxySlotName);
399
+ this.proxySlot = document.createElement("slot");
400
+ this.proxySlot.setAttribute("name", proxySlotName);
401
+ }
402
+ (_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.appendChild(this.proxySlot);
403
+ this.appendChild(this.proxy);
404
+ }
405
+ /**
406
+ * Detach the proxy element from the DOM
407
+ */
408
+ detachProxy() {
409
+ var _a;
410
+ this.removeChild(this.proxy);
411
+ (_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.removeChild(this.proxySlot);
412
+ }
413
+ /**
414
+ * Sets the validity of the custom element. By default this uses the proxy element to determine
415
+ * validity, but this can be extended or replaced in implementation.
416
+ */
417
+ validate() {
418
+ if (this.proxy instanceof HTMLElement) {
419
+ this.setValidity(this.proxy.validity, this.proxy.validationMessage);
420
+ }
421
+ }
422
+ /**
423
+ * Associates the provided value (and optional state) with the parent form.
424
+ * @param value - The value to set
425
+ * @param state - The state object provided to during session restores and when autofilling.
426
+ */
427
+ setFormValue(value, state) {
428
+ if (this.elementInternals) {
429
+ this.elementInternals.setFormValue(value, state || value);
430
+ }
431
+ }
432
+ _keypressHandler(e) {
433
+ switch (e.key) {
434
+ case keyEnter:
435
+ if (this.form instanceof HTMLFormElement) {
436
+ // Implicit submission
437
+ const defaultButton = this.form.querySelector("[type=submit]");
438
+ defaultButton === null || defaultButton === void 0 ? void 0 : defaultButton.click();
439
+ }
440
+ break;
441
+ }
442
+ }
443
+ /**
444
+ * Used to stop propagation of proxy element events
445
+ * @param e - Event object
446
+ */
447
+ stopPropagation(e) {
448
+ e.stopPropagation();
449
+ }
450
+ };
451
+ attr({ mode: "boolean" })(C.prototype, "disabled");
452
+ attr({ mode: "fromView", attribute: "value" })(C.prototype, "initialValue");
453
+ attr({ attribute: "current-value" })(C.prototype, "currentValue");
454
+ attr(C.prototype, "name");
455
+ attr({ mode: "boolean" })(C.prototype, "required");
456
+ observable(C.prototype, "value");
457
+ return C;
458
+ }
459
+
460
+ export { FormAssociated as F };
package/shared/icon.js CHANGED
@@ -1,5 +1,5 @@
1
- import { r as classofRaw, q as global$8, w as wellKnownSymbol$6, u as getBuiltIn$5, o as objectDefineProperty, d as descriptors, x as objectIsPrototypeOf, y as functionUncurryThis, f as fails$4, i as isCallable$6, z as inspectSource$2, A as tryToString$3, a as anObject$5, B as functionBindNative, C as aCallable$6, D as engineUserAgent, b as documentCreateElement, c as hasOwnProperty_1, E as objectGetOwnPropertyDescriptor, F as isForced_1, G as engineV8Version, _ as _export, j as defineBuiltIn$3, m as functionCall, H as isObject$2, p as internalState, I as getMethod$2, J as lengthOfArrayLike$1, K as requireObjectCoercible$1, n as functionName } from './export.js';
2
- import { h as html$1, o as objectSetPrototypeOf, s as setToStringTag$1, i as iterators } from './object-set-prototype-of.js';
1
+ import { c as classofRaw, g as global$8, w as wellKnownSymbol$6, a as getBuiltIn$5, o as objectDefineProperty, d as descriptors, b as objectIsPrototypeOf, f as functionUncurryThis, e as fails$4, i as isCallable$6, h as inspectSource$2, t as tryToString$3, j as anObject$5, k as functionBindNative, l as aCallable$6, m as engineUserAgent, n as documentCreateElement, p as hasOwnProperty_1, q as objectGetOwnPropertyDescriptor, r as isForced_1, s as engineV8Version, _ as _export, u as defineBuiltIn$3, v as functionCall, x as isObject$2, y as internalState, z as getMethod$2, A as lengthOfArrayLike$1, B as requireObjectCoercible$1, C as functionName } from './export.js';
2
+ import { h as html$1, o as objectSetPrototypeOf, s as setToStringTag$1, i as iterators } from './iterators.js';
3
3
  import { c as classof$3, t as toString$1 } from './to-string.js';
4
4
  import { F as FoundationElement, _ as __decorate, a as attr, b as __metadata, o as observable } from './index.js';
5
5
  import { _ as _curry1, a as _curry2, b as _has } from './_has.js';
@@ -1,23 +1,4 @@
1
- import { u as getBuiltIn$1, o as objectDefineProperty, w as wellKnownSymbol$1, c as hasOwnProperty_1, i as isCallable$1, y as functionUncurryThis, a as anObject$1 } from './export.js';
2
-
3
- var getBuiltIn = getBuiltIn$1;
4
-
5
- var html = getBuiltIn('document', 'documentElement');
6
-
7
- var iterators = {};
8
-
9
- var defineProperty = objectDefineProperty.f;
10
- var hasOwn = hasOwnProperty_1;
11
- var wellKnownSymbol = wellKnownSymbol$1;
12
-
13
- var TO_STRING_TAG = wellKnownSymbol('toStringTag');
14
-
15
- var setToStringTag = function (target, TAG, STATIC) {
16
- if (target && !STATIC) target = target.prototype;
17
- if (target && !hasOwn(target, TO_STRING_TAG)) {
18
- defineProperty(target, TO_STRING_TAG, { configurable: true, value: TAG });
19
- }
20
- };
1
+ import { i as isCallable$1, f as functionUncurryThis, j as anObject$1, o as objectDefineProperty, w as wellKnownSymbol$1, p as hasOwnProperty_1, a as getBuiltIn$1 } from './export.js';
21
2
 
22
3
  var isCallable = isCallable$1;
23
4
 
@@ -58,4 +39,23 @@ var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? functio
58
39
  };
59
40
  }() : undefined);
60
41
 
42
+ var defineProperty = objectDefineProperty.f;
43
+ var hasOwn = hasOwnProperty_1;
44
+ var wellKnownSymbol = wellKnownSymbol$1;
45
+
46
+ var TO_STRING_TAG = wellKnownSymbol('toStringTag');
47
+
48
+ var setToStringTag = function (target, TAG, STATIC) {
49
+ if (target && !STATIC) target = target.prototype;
50
+ if (target && !hasOwn(target, TO_STRING_TAG)) {
51
+ defineProperty(target, TO_STRING_TAG, { configurable: true, value: TAG });
52
+ }
53
+ };
54
+
55
+ var getBuiltIn = getBuiltIn$1;
56
+
57
+ var html = getBuiltIn('document', 'documentElement');
58
+
59
+ var iterators = {};
60
+
61
61
  export { html as h, iterators as i, objectSetPrototypeOf as o, setToStringTag as s };
@@ -1,4 +1,4 @@
1
- import { L as objectKeysInternal, e as enumBugKeys$1 } from './export.js';
1
+ import { L as objectKeysInternal, H as enumBugKeys$1 } from './export.js';
2
2
 
3
3
  var internalObjectKeys = objectKeysInternal;
4
4
  var enumBugKeys = enumBugKeys$1;
package/shared/ref.js ADDED
@@ -0,0 +1,41 @@
1
+ import { A as AttachedBehaviorHTMLDirective } from './index.js';
2
+
3
+ /**
4
+ * The runtime behavior for template references.
5
+ * @public
6
+ */
7
+ class RefBehavior {
8
+ /**
9
+ * Creates an instance of RefBehavior.
10
+ * @param target - The element to reference.
11
+ * @param propertyName - The name of the property to assign the reference to.
12
+ */
13
+ constructor(target, propertyName) {
14
+ this.target = target;
15
+ this.propertyName = propertyName;
16
+ }
17
+ /**
18
+ * Bind this behavior to the source.
19
+ * @param source - The source to bind to.
20
+ * @param context - The execution context that the binding is operating within.
21
+ */
22
+ bind(source) {
23
+ source[this.propertyName] = this.target;
24
+ }
25
+ /**
26
+ * Unbinds this behavior from the source.
27
+ * @param source - The source to unbind from.
28
+ */
29
+ /* eslint-disable-next-line @typescript-eslint/no-empty-function */
30
+ unbind() { }
31
+ }
32
+ /**
33
+ * A directive that observes the updates a property with a reference to the element.
34
+ * @param propertyName - The name of the property to assign the reference to.
35
+ * @public
36
+ */
37
+ function ref(propertyName) {
38
+ return new AttachedBehaviorHTMLDirective("fast-ref", RefBehavior, propertyName);
39
+ }
40
+
41
+ export { ref as r };
@@ -1,6 +1,7 @@
1
1
  import { a as affixIconTemplateFactory } from './affix.js';
2
+ import { f as focusTemplateFactory } from './focus2.js';
2
3
  import { h as html } from './index.js';
3
- import { r as ref } from './aria-global.js';
4
+ import { r as ref } from './ref.js';
4
5
  import { c as classNames } from './class-names.js';
5
6
 
6
7
  let _ = t => t,
@@ -13,6 +14,7 @@ const getClasses = ({
13
14
 
14
15
  const textAnchorTemplate = context => {
15
16
  const affixIconTemplate = affixIconTemplateFactory(context);
17
+ const focusTemplate = focusTemplateFactory(context);
16
18
  return html(_t || (_t = _`<a
17
19
  class="${0}"
18
20
  download="${0}"
@@ -47,8 +49,9 @@ const textAnchorTemplate = context => {
47
49
  >
48
50
  ${0}
49
51
  ${0}
52
+ ${0}
50
53
  </a>
51
- `), getClasses, x => x.download, x => x.href, x => x.hreflang, x => x.ping, x => x.referrerpolicy, x => x.rel, x => x.target, x => x.type, x => x.ariaAtomic, x => x.ariaBusy, x => x.ariaControls, x => x.ariaCurrent, x => x.ariaDescribedby, x => x.ariaDetails, x => x.ariaDisabled, x => x.ariaErrormessage, x => x.ariaExpanded, x => x.ariaFlowto, x => x.ariaHaspopup, x => x.ariaHidden, x => x.ariaInvalid, x => x.ariaKeyshortcuts, x => x.ariaLabel, x => x.ariaLabelledby, x => x.ariaLive, x => x.ariaOwns, x => x.ariaRelevant, x => x.ariaRoledescription, ref('control'), x => affixIconTemplate(x.icon), x => x.text);
54
+ `), getClasses, x => x.download, x => x.href, x => x.hreflang, x => x.ping, x => x.referrerpolicy, x => x.rel, x => x.target, x => x.type, x => x.ariaAtomic, x => x.ariaBusy, x => x.ariaControls, x => x.ariaCurrent, x => x.ariaDescribedby, x => x.ariaDetails, x => x.ariaDisabled, x => x.ariaErrormessage, x => x.ariaExpanded, x => x.ariaFlowto, x => x.ariaHaspopup, x => x.ariaHidden, x => x.ariaInvalid, x => x.ariaKeyshortcuts, x => x.ariaLabel, x => x.ariaLabelledby, x => x.ariaLive, x => x.ariaOwns, x => x.ariaRelevant, x => x.ariaRoledescription, ref('control'), () => focusTemplate, x => affixIconTemplate(x.icon), x => x.text);
52
55
  };
53
56
 
54
57
  export { textAnchorTemplate as t };
@@ -1,4 +1,4 @@
1
- import { w as wellKnownSymbol$2, r as classofRaw$1, i as isCallable$1 } from './export.js';
1
+ import { w as wellKnownSymbol$2, c as classofRaw$1, i as isCallable$1 } from './export.js';
2
2
 
3
3
  var wellKnownSymbol$1 = wellKnownSymbol$2;
4
4
 
@@ -1,6 +1,6 @@
1
- import { d as descriptors, v as v8PrototypeDefineBug, o as objectDefineProperty, a as anObject$2, t as toIndexedObject$2, h as hiddenKeys$1, s as sharedKey$2, e as enumBugKeys$1, b as documentCreateElement$2, w as wellKnownSymbol$4, f as fails$2, c as hasOwnProperty_1, i as isCallable$3, g as toObject$1, j as defineBuiltIn$2, k as createPropertyDescriptor$1, _ as _export, l as createNonEnumerableProperty$2, m as functionCall, n as functionName, p as internalState, q as global$1 } from './export.js';
1
+ import { d as descriptors, D as v8PrototypeDefineBug, o as objectDefineProperty, j as anObject$2, E as toIndexedObject$2, F as hiddenKeys$1, G as sharedKey$2, H as enumBugKeys$1, n as documentCreateElement$2, w as wellKnownSymbol$4, e as fails$2, p as hasOwnProperty_1, i as isCallable$3, I as toObject$1, u as defineBuiltIn$2, J as createPropertyDescriptor$1, _ as _export, K as createNonEnumerableProperty$2, v as functionCall, C as functionName, y as internalState, g as global$1 } from './export.js';
2
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 './object-set-prototype-of.js';
3
+ import { h as html$1, s as setToStringTag$2, i as iterators, o as objectSetPrototypeOf } from './iterators.js';
4
4
 
5
5
  var objectDefineProperties = {};
6
6