@vonage/vivid 3.9.0 → 3.11.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.
Files changed (136) hide show
  1. package/accordion/index.js +1 -0
  2. package/alert/index.js +28 -0
  3. package/avatar/index.js +1 -1
  4. package/badge/index.js +1 -1
  5. package/banner/index.js +3 -3
  6. package/breadcrumb/index.js +2 -1
  7. package/breadcrumb-item/index.js +1 -1
  8. package/button/index.js +2 -2
  9. package/calendar/index.js +1 -1
  10. package/calendar-event/index.js +1 -1
  11. package/card/index.js +3 -2
  12. package/checkbox/index.js +1 -1
  13. package/combobox/index.js +7 -6
  14. package/custom-elements.json +589 -377
  15. package/data-grid/index.js +3 -2
  16. package/dialog/index.js +5 -4
  17. package/divider/index.js +1 -1
  18. package/elevation/index.js +1 -1
  19. package/fab/index.js +1 -1
  20. package/header/index.js +2 -2
  21. package/index.js +54 -52
  22. package/layout/index.js +1 -1
  23. package/lib/alert/alert.d.ts +24 -0
  24. package/lib/alert/alert.template.d.ts +4 -0
  25. package/lib/alert/definition.d.ts +2 -0
  26. package/lib/alert/index.d.ts +1 -0
  27. package/lib/components.d.ts +1 -0
  28. package/lib/enums.d.ts +10 -9
  29. package/lib/layout/layout.d.ts +2 -0
  30. package/lib/pagination/definition.d.ts +3 -0
  31. package/lib/pagination/index.d.ts +1 -0
  32. package/lib/pagination/pagination.d.ts +18 -0
  33. package/lib/pagination/pagination.template.d.ts +4 -0
  34. package/lib/popup/popup.d.ts +2 -2
  35. package/lib/text-area/text-area.d.ts +2 -1
  36. package/lib/tooltip/tooltip.d.ts +10 -4
  37. package/listbox/index.js +3 -2
  38. package/menu/index.js +7 -6
  39. package/menu-item/index.js +1 -1
  40. package/nav/index.js +1 -1
  41. package/nav-disclosure/index.js +1 -1
  42. package/nav-item/index.js +1 -1
  43. package/note/index.js +1 -1
  44. package/number-field/index.js +4 -4
  45. package/option/index.js +1 -1
  46. package/package.json +1 -1
  47. package/pagination/index.js +329 -0
  48. package/popup/index.js +4 -4
  49. package/progress/index.js +1 -1
  50. package/progress-ring/index.js +1 -1
  51. package/radio/index.js +1 -1
  52. package/radio-group/index.js +3 -2
  53. package/select/index.js +7 -6
  54. package/shared/children.js +1 -1
  55. package/shared/definition.js +3 -2
  56. package/shared/definition10.js +46 -63
  57. package/shared/definition11.js +38 -92
  58. package/shared/definition12.js +96 -31
  59. package/shared/definition13.js +85 -757
  60. package/shared/definition14.js +32 -95
  61. package/shared/definition15.js +758 -100
  62. package/shared/definition16.js +103 -24
  63. package/shared/definition17.js +96 -154
  64. package/shared/definition18.js +108 -663
  65. package/shared/definition19.js +667 -1532
  66. package/shared/definition2.js +1 -1
  67. package/shared/definition20.js +1532 -223
  68. package/shared/definition21.js +183 -964
  69. package/shared/definition22.js +1034 -218
  70. package/shared/definition23.js +226 -67
  71. package/shared/definition24.js +68 -77
  72. package/shared/definition25.js +76 -47
  73. package/shared/definition26.js +46 -32
  74. package/shared/definition27.js +39 -49
  75. package/shared/definition28.js +48 -344
  76. package/shared/definition29.js +273 -282
  77. package/shared/definition30.js +356 -14
  78. package/shared/definition31.js +13 -67
  79. package/shared/definition32.js +65 -21
  80. package/shared/definition33.js +21 -39
  81. package/shared/definition34.js +31 -432
  82. package/shared/definition35.js +432 -76
  83. package/shared/definition36.js +82 -33
  84. package/shared/definition37.js +31 -422
  85. package/shared/definition38.js +358 -564
  86. package/shared/definition39.js +628 -75
  87. package/shared/definition4.js +1 -1
  88. package/shared/definition40.js +70 -573
  89. package/shared/definition41.js +538 -81
  90. package/shared/definition42.js +127 -47
  91. package/shared/definition43.js +51 -16
  92. package/shared/definition44.js +17 -425
  93. package/shared/definition45.js +421 -103
  94. package/shared/definition46.js +114 -19
  95. package/shared/definition47.js +19 -269
  96. package/shared/definition48.js +244 -86
  97. package/shared/definition49.js +110 -70
  98. package/shared/definition5.js +1 -1
  99. package/shared/definition50.js +88 -67
  100. package/shared/definition51.js +69 -294
  101. package/shared/definition52.js +305 -0
  102. package/shared/definition6.js +142 -45
  103. package/shared/definition7.js +97 -24
  104. package/shared/definition8.js +22 -103
  105. package/shared/definition9.js +62 -102
  106. package/shared/enums.js +10 -9
  107. package/shared/es.object.assign.js +1 -1
  108. package/shared/form-associated.js +1 -1
  109. package/shared/form-elements.js +2 -2
  110. package/shared/index.js +1 -1
  111. package/shared/listbox.js +2 -2
  112. package/shared/node-observation.js +74 -0
  113. package/shared/patterns/form-elements/form-elements.d.ts +4 -4
  114. package/shared/repeat.js +1 -1
  115. package/shared/slotted.js +3 -73
  116. package/shared/text-field.js +1 -1
  117. package/shared/text-field2.js +1 -1
  118. package/side-drawer/index.js +1 -1
  119. package/slider/index.js +1 -1
  120. package/styles/core/all.css +1 -1
  121. package/styles/core/theme.css +1 -1
  122. package/styles/core/typography.css +1 -1
  123. package/styles/tokens/theme-dark.css +4 -4
  124. package/styles/tokens/theme-light.css +4 -4
  125. package/switch/index.js +1 -1
  126. package/tab/index.js +1 -1
  127. package/tab-panel/index.js +1 -1
  128. package/tabs/index.js +4 -3
  129. package/tag/index.js +1 -1
  130. package/tag-group/index.js +1 -1
  131. package/text-area/index.js +1 -1
  132. package/text-field/index.js +1 -1
  133. package/tooltip/index.js +5 -5
  134. package/tree-item/index.js +2 -1
  135. package/tree-view/index.js +2 -1
  136. package/vivid.api.json +128 -16
@@ -0,0 +1,329 @@
1
+ import { B as Button, b as buttonRegistries } from '../shared/definition7.js';
2
+ import { g as global$1, l as fails$2, k as functionUncurryThis, G as _export, F as FoundationElement, _ as __decorate, a as attr, b as __metadata, o as observable, V as volatile, a7 as addToUnscopables$1, a8 as arrayIncludes, w as wellKnownSymbol$2, M as isObject$1, c as classofRaw, T as requireObjectCoercible$1, h as html, r as registerFactory } from '../shared/index.js';
3
+ import { t as toString$2 } from '../shared/to-string.js';
4
+ import { w as whitespaces$1, s as stringTrim } from '../shared/string-trim.js';
5
+ import '../shared/es.regexp.to-string.js';
6
+ import { a as Size } from '../shared/enums.js';
7
+ import { e as elements } from '../shared/node-observation.js';
8
+ import { r as ref } from '../shared/ref.js';
9
+ import { r as repeat } from '../shared/repeat.js';
10
+ import { c as children } from '../shared/children.js';
11
+ import { c as classNames } from '../shared/class-names.js';
12
+ import { w as when } from '../shared/when.js';
13
+ import '../shared/definition3.js';
14
+ import '../shared/icon.js';
15
+ import '../shared/_has.js';
16
+ import '../shared/definition4.js';
17
+ import '../shared/focus.js';
18
+ import '../shared/definition9.js';
19
+ import '../shared/base-progress.js';
20
+ import '../shared/affix.js';
21
+ import '../shared/button.js';
22
+ import '../shared/apply-mixins.js';
23
+ import '../shared/form-associated.js';
24
+ import '../shared/key-codes.js';
25
+ import '../shared/aria-global.js';
26
+ import '../shared/start-end.js';
27
+ import '../shared/focus2.js';
28
+
29
+ var css_248z = "/**\n * Do not edit directly\n * Generated on Mon, 08 May 2023 11:40:49 GMT\n */\n.control {\n display: inline-flex;\n justify-content: space-between;\n}\n\n.buttons-wrapper {\n display: flex;\n column-gap: 4px;\n}\n\n.dots {\n align-self: center;\n text-align: center;\n}\n.dots:not(.size-super-condensed) {\n font: var(--vvd-typography-base-bold);\n}\n.dots.size-super-condensed {\n font: var(--vvd-typography-base-condensed-bold);\n inline-size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) - 16));\n}\n.dots.size-condensed {\n inline-size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) - 8));\n}\n.dots.size-normal {\n inline-size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2)));\n}";
30
+
31
+ var global = global$1;
32
+ var fails$1 = fails$2;
33
+ var uncurryThis$1 = functionUncurryThis;
34
+ var toString$1 = toString$2;
35
+ var trim = stringTrim.trim;
36
+ var whitespaces = whitespaces$1;
37
+
38
+ var $parseInt$1 = global.parseInt;
39
+ var Symbol = global.Symbol;
40
+ var ITERATOR = Symbol && Symbol.iterator;
41
+ var hex = /^[+-]?0x/i;
42
+ var exec = uncurryThis$1(hex.exec);
43
+ var FORCED = $parseInt$1(whitespaces + '08') !== 8 || $parseInt$1(whitespaces + '0x16') !== 22
44
+ // MS Edge 18- broken with boxed symbols
45
+ || (ITERATOR && !fails$1(function () { $parseInt$1(Object(ITERATOR)); }));
46
+
47
+ // `parseInt` method
48
+ // https://tc39.es/ecma262/#sec-parseint-string-radix
49
+ var numberParseInt = FORCED ? function parseInt(string, radix) {
50
+ var S = trim(toString$1(string));
51
+ return $parseInt$1(S, (radix >>> 0) || (exec(hex, S) ? 16 : 10));
52
+ } : $parseInt$1;
53
+
54
+ var $$2 = _export;
55
+ var $parseInt = numberParseInt;
56
+
57
+ // `parseInt` method
58
+ // https://tc39.es/ecma262/#sec-parseint-string-radix
59
+ $$2({ global: true, forced: parseInt != $parseInt }, {
60
+ parseInt: $parseInt
61
+ });
62
+
63
+ const MAX_DIGITS_AND_PLACEHOLDERS = 7;
64
+ const totalConverter = {
65
+ fromView: value => parseInt(value, 10),
66
+ toView: value => value.toString()
67
+ };
68
+ class Pagination extends FoundationElement {
69
+ constructor() {
70
+ super();
71
+ this.navIcons = false;
72
+ this.total = 0;
73
+ this.selectedIndex = 0;
74
+ this.addEventListener('tabpressed', e => {
75
+ const {
76
+ value: currentLabel,
77
+ shiftKey
78
+ } = e.detail;
79
+ const index = this.paginationButtons.findIndex(button => Number(button.label) === currentLabel);
80
+ const focusDirection = shiftKey ? -1 : 1;
81
+ const newIndex = index + focusDirection;
82
+ if (newIndex < 0) {
83
+ return this.prevButton.focus();
84
+ }
85
+ if (newIndex > this.paginationButtons.length - 1) {
86
+ return this.nextButton.focus();
87
+ }
88
+ this.paginationButtons && this.paginationButtons[index + focusDirection].focus();
89
+ });
90
+ }
91
+ get pagesList() {
92
+ return new Array(this.total < MAX_DIGITS_AND_PLACEHOLDERS ? this.total : MAX_DIGITS_AND_PLACEHOLDERS).fill(0).map((_, i, arr) => {
93
+ if (i === 0) return 1;
94
+ if (i === arr.length - 1) return this.total;
95
+ if (this.selectedIndex !== undefined && this.total > MAX_DIGITS_AND_PLACEHOLDERS) {
96
+ if (this.selectedIndex < 4) {
97
+ if (i === MAX_DIGITS_AND_PLACEHOLDERS - 2) return '...';
98
+ }
99
+ if (this.selectedIndex >= 4 && this.selectedIndex <= this.total - 5) {
100
+ if (i > 1 && i < MAX_DIGITS_AND_PLACEHOLDERS - 2) return this.selectedIndex + (i - 2);
101
+ if (i === 1 || i === MAX_DIGITS_AND_PLACEHOLDERS - 2) return '...';
102
+ }
103
+ if (this.selectedIndex > this.total - 5) {
104
+ if (i > 1) return this.total - (6 - i);
105
+ if (i === 1) return '...';
106
+ }
107
+ }
108
+ return i + 1;
109
+ });
110
+ }
111
+ totalChanged(_, newValue) {
112
+ if (newValue < 0) {
113
+ this.total = 0;
114
+ }
115
+ this.selectedIndex = 0;
116
+ }
117
+ selectedIndexChanged(oldValue, newValue) {
118
+ if (oldValue === undefined) return;
119
+ this.$emit('vwc-pagination-change', {
120
+ selectedIndex: newValue,
121
+ total: this.total,
122
+ oldIndex: oldValue
123
+ });
124
+ }
125
+ paginationButtonsChanged(_, newValue) {
126
+ newValue.forEach(button => {
127
+ button.shadowRoot.querySelector('button').classList.add('icon-only');
128
+ });
129
+ }
130
+ }
131
+ __decorate([attr, __metadata("design:type", String)], Pagination.prototype, "size", void 0);
132
+ __decorate([observable, __metadata("design:type", Array)], Pagination.prototype, "paginationButtons", void 0);
133
+ __decorate([observable, __metadata("design:type", Function)], Pagination.prototype, "prevButton", void 0);
134
+ __decorate([observable, __metadata("design:type", Function)], Pagination.prototype, "nextButton", void 0);
135
+ __decorate([attr({
136
+ attribute: 'nav-icons',
137
+ mode: 'boolean'
138
+ }), __metadata("design:type", Object)], Pagination.prototype, "navIcons", void 0);
139
+ __decorate([volatile, __metadata("design:type", Object), __metadata("design:paramtypes", [])], Pagination.prototype, "pagesList", null);
140
+ __decorate([attr({
141
+ mode: 'reflect',
142
+ converter: totalConverter
143
+ }), __metadata("design:type", Number)], Pagination.prototype, "total", void 0);
144
+ __decorate([attr({
145
+ mode: 'reflect',
146
+ converter: totalConverter,
147
+ attribute: 'selected-index'
148
+ }), __metadata("design:type", Object)], Pagination.prototype, "selectedIndex", void 0);
149
+
150
+ var $$1 = _export;
151
+ var $includes = arrayIncludes.includes;
152
+ var fails = fails$2;
153
+ var addToUnscopables = addToUnscopables$1;
154
+
155
+ // FF99+ bug
156
+ var BROKEN_ON_SPARSE = fails(function () {
157
+ return !Array(1).includes();
158
+ });
159
+
160
+ // `Array.prototype.includes` method
161
+ // https://tc39.es/ecma262/#sec-array.prototype.includes
162
+ $$1({ target: 'Array', proto: true, forced: BROKEN_ON_SPARSE }, {
163
+ includes: function includes(el /* , fromIndex = 0 */) {
164
+ return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);
165
+ }
166
+ });
167
+
168
+ // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
169
+ addToUnscopables('includes');
170
+
171
+ var isObject = isObject$1;
172
+ var classof = classofRaw;
173
+ var wellKnownSymbol$1 = wellKnownSymbol$2;
174
+
175
+ var MATCH$1 = wellKnownSymbol$1('match');
176
+
177
+ // `IsRegExp` abstract operation
178
+ // https://tc39.es/ecma262/#sec-isregexp
179
+ var isRegexp = function (it) {
180
+ var isRegExp;
181
+ return isObject(it) && ((isRegExp = it[MATCH$1]) !== undefined ? !!isRegExp : classof(it) == 'RegExp');
182
+ };
183
+
184
+ var isRegExp = isRegexp;
185
+
186
+ var $TypeError = TypeError;
187
+
188
+ var notARegexp = function (it) {
189
+ if (isRegExp(it)) {
190
+ throw $TypeError("The method doesn't accept regular expressions");
191
+ } return it;
192
+ };
193
+
194
+ var wellKnownSymbol = wellKnownSymbol$2;
195
+
196
+ var MATCH = wellKnownSymbol('match');
197
+
198
+ var correctIsRegexpLogic = function (METHOD_NAME) {
199
+ var regexp = /./;
200
+ try {
201
+ '/./'[METHOD_NAME](regexp);
202
+ } catch (error1) {
203
+ try {
204
+ regexp[MATCH] = false;
205
+ return '/./'[METHOD_NAME](regexp);
206
+ } catch (error2) { /* empty */ }
207
+ } return false;
208
+ };
209
+
210
+ var $ = _export;
211
+ var uncurryThis = functionUncurryThis;
212
+ var notARegExp = notARegexp;
213
+ var requireObjectCoercible = requireObjectCoercible$1;
214
+ var toString = toString$2;
215
+ var correctIsRegExpLogic = correctIsRegexpLogic;
216
+
217
+ var stringIndexOf = uncurryThis(''.indexOf);
218
+
219
+ // `String.prototype.includes` method
220
+ // https://tc39.es/ecma262/#sec-string.prototype.includes
221
+ $({ target: 'String', proto: true, forced: !correctIsRegExpLogic('includes') }, {
222
+ includes: function includes(searchString /* , position = 0 */) {
223
+ return !!~stringIndexOf(
224
+ toString(requireObjectCoercible(this)),
225
+ toString(notARegExp(searchString)),
226
+ arguments.length > 1 ? arguments[1] : undefined
227
+ );
228
+ }
229
+ });
230
+
231
+ let _2 = t => t,
232
+ _t,
233
+ _t2,
234
+ _t3,
235
+ _t4;
236
+ const ALLOWED_SIZES = [Size.SuperCondensed, Size.Condensed, Size.Normal];
237
+ const handleSelection = (value, {
238
+ parent: x
239
+ }) => {
240
+ return x.selectedIndex = Number(value) - 1;
241
+ };
242
+ const handleKeyDown = (value, {
243
+ event,
244
+ parent
245
+ }) => {
246
+ if (event.key === ' ' || event.key === 'Enter') {
247
+ handleSelection(value, {
248
+ parent
249
+ });
250
+ }
251
+ if (event.key === 'Tab') {
252
+ event.target.dispatchEvent(new CustomEvent('tabpressed', {
253
+ detail: {
254
+ value,
255
+ shiftKey: event.shiftKey
256
+ },
257
+ bubbles: true,
258
+ composed: true
259
+ }));
260
+ }
261
+ };
262
+ const getClasses = _ => classNames('control');
263
+ function getButtonAppearance(value, {
264
+ parent
265
+ }) {
266
+ return parent.selectedIndex === Number(value) - 1 ? 'filled' : 'ghost';
267
+ }
268
+ const paginationButtonRenderer = buttonTag => html(_t || (_t = _2`
269
+ ${0}
270
+ ${0}`), when(value => value !== '...', html(_t2 || (_t2 = _2`
271
+ <${0} class="vwc-pagination-button"
272
+ label="${0}"
273
+ appearance="${0}"
274
+ size="${0}"
275
+ tabindex="0"
276
+ aria-pressed="${0}"
277
+ @click="${0}"
278
+ @keydown="${0}"
279
+ </${0}>
280
+ `), buttonTag, value => value, getButtonAppearance, (_, {
281
+ parent: x
282
+ }) => getPaginationSize(x), (value, {
283
+ parent
284
+ }) => parent.selectedIndex === Number(value) - 1, handleSelection, handleKeyDown, buttonTag)), when(value => value === '...', html(_t3 || (_t3 = _2`<div class="dots size-${0}">...</div>`), getPaginationSize)));
285
+ const getPaginationSize = x => {
286
+ if (!x.size || !ALLOWED_SIZES.includes(x.size)) {
287
+ return Size.SuperCondensed;
288
+ }
289
+ return x.size;
290
+ };
291
+ const PaginationTemplate = context => {
292
+ const buttonTag = context.tagFor(Button);
293
+ const paginationButtonTemplate = paginationButtonRenderer(buttonTag);
294
+ return html(_t4 || (_t4 = _2`
295
+ <div class="${0}">
296
+ <${0} class="prev-button" ${0}
297
+ label="${0}"
298
+ icon="${0}"
299
+ size="${0}"
300
+ ?disabled="${0}"
301
+ @click="${0}"
302
+ ></${0}>
303
+ <div id="buttons-wrapper" class="buttons-wrapper" ${0}>
304
+ ${0}
305
+ </div>
306
+ <${0} class="next-button" ${0}
307
+ label="${0}"
308
+ icon="${0}"
309
+ size="${0}"
310
+ ?disabled="${0}"
311
+ @click="${0}"
312
+ ></${0}>
313
+ </div>`), getClasses, buttonTag, ref('prevButton'), x => !x.navIcons ? 'Previous' : null, x => x.navIcons ? 'chevron-left-line' : null, getPaginationSize, x => x.total === 0 || x.selectedIndex === 0, x => x.selectedIndex !== undefined && x.selectedIndex--, buttonTag, children({
314
+ property: 'paginationButtons',
315
+ filter: elements(buttonTag)
316
+ }), repeat(x => x.pagesList, paginationButtonTemplate, {
317
+ positioning: true
318
+ }), buttonTag, ref('nextButton'), x => !x.navIcons ? 'Next' : null, x => x.navIcons ? 'chevron-right-line' : null, getPaginationSize, x => x.total === 0 || x.selectedIndex === x.total - 1, x => x.selectedIndex !== undefined && x.selectedIndex++, buttonTag);
319
+ };
320
+
321
+ const paginationDefinition = Pagination.compose({
322
+ baseName: 'pagination',
323
+ template: PaginationTemplate,
324
+ styles: css_248z
325
+ });
326
+ const paginationRegistries = [paginationDefinition(), buttonRegistries];
327
+ const registerPagination = registerFactory(paginationRegistries);
328
+
329
+ registerPagination();
package/popup/index.js CHANGED
@@ -1,6 +1,6 @@
1
- import { r as registerPopup } from '../shared/definition19.js';
1
+ import { r as registerPopup } from '../shared/definition20.js';
2
2
  import '../shared/index.js';
3
- import '../shared/definition9.js';
3
+ import '../shared/definition7.js';
4
4
  import '../shared/definition3.js';
5
5
  import '../shared/icon.js';
6
6
  import '../shared/to-string.js';
@@ -10,7 +10,7 @@ import '../shared/class-names.js';
10
10
  import '../shared/when.js';
11
11
  import '../shared/definition4.js';
12
12
  import '../shared/focus.js';
13
- import '../shared/definition10.js';
13
+ import '../shared/definition9.js';
14
14
  import '../shared/base-progress.js';
15
15
  import '../shared/affix.js';
16
16
  import '../shared/button.js';
@@ -21,7 +21,7 @@ import '../shared/aria-global.js';
21
21
  import '../shared/start-end.js';
22
22
  import '../shared/ref.js';
23
23
  import '../shared/focus2.js';
24
- import '../shared/definition16.js';
24
+ import '../shared/definition8.js';
25
25
  import '../shared/es.object.assign.js';
26
26
 
27
27
  registerPopup();
package/progress/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { r as registerProgress } from '../shared/definition35.js';
1
+ import { r as registerProgress } from '../shared/definition36.js';
2
2
  import '../shared/index.js';
3
3
  import '../shared/base-progress.js';
4
4
  import '../shared/when.js';
@@ -1,4 +1,4 @@
1
- import { r as registerProgressRing } from '../shared/definition10.js';
1
+ import { r as registerProgressRing } from '../shared/definition9.js';
2
2
  import '../shared/index.js';
3
3
  import '../shared/base-progress.js';
4
4
  import '../shared/when.js';
package/radio/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { r as registerRadio } from '../shared/definition36.js';
1
+ import { r as registerRadio } from '../shared/definition37.js';
2
2
  import '../shared/index.js';
3
3
  import '../shared/definition4.js';
4
4
  import '../shared/focus.js';
@@ -1,12 +1,13 @@
1
- import { r as registerRadioGroup } from '../shared/definition37.js';
1
+ import { r as registerRadioGroup } from '../shared/definition38.js';
2
2
  import '../shared/index.js';
3
3
  import '../shared/direction.js';
4
4
  import '../shared/key-codes.js';
5
5
  import '../shared/aria.js';
6
6
  import '../shared/radio.js';
7
7
  import '../shared/form-associated.js';
8
- import '../shared/slotted.js';
8
+ import '../shared/node-observation.js';
9
9
  import '../shared/aria2.js';
10
+ import '../shared/slotted.js';
10
11
  import '../shared/when.js';
11
12
 
12
13
  registerRadioGroup();
package/select/index.js CHANGED
@@ -1,9 +1,9 @@
1
- import { r as registerSelect } from '../shared/definition38.js';
1
+ import { r as registerSelect } from '../shared/definition39.js';
2
2
  import '../shared/index.js';
3
3
  import '../shared/definition4.js';
4
4
  import '../shared/focus.js';
5
- import '../shared/definition19.js';
6
- import '../shared/definition9.js';
5
+ import '../shared/definition20.js';
6
+ import '../shared/definition7.js';
7
7
  import '../shared/definition3.js';
8
8
  import '../shared/icon.js';
9
9
  import '../shared/to-string.js';
@@ -11,7 +11,7 @@ import '../shared/string-trim.js';
11
11
  import '../shared/_has.js';
12
12
  import '../shared/class-names.js';
13
13
  import '../shared/when.js';
14
- import '../shared/definition10.js';
14
+ import '../shared/definition9.js';
15
15
  import '../shared/base-progress.js';
16
16
  import '../shared/affix.js';
17
17
  import '../shared/button.js';
@@ -22,9 +22,9 @@ import '../shared/aria-global.js';
22
22
  import '../shared/start-end.js';
23
23
  import '../shared/ref.js';
24
24
  import '../shared/focus2.js';
25
- import '../shared/definition16.js';
25
+ import '../shared/definition8.js';
26
26
  import '../shared/es.object.assign.js';
27
- import '../shared/definition20.js';
27
+ import '../shared/definition21.js';
28
28
  import '../shared/dom.js';
29
29
  import '../shared/form-elements.js';
30
30
  import '../shared/listbox.js';
@@ -32,5 +32,6 @@ import '../shared/strings.js';
32
32
  import '../shared/numbers.js';
33
33
  import '../shared/select.options.js';
34
34
  import '../shared/slotted.js';
35
+ import '../shared/node-observation.js';
35
36
 
36
37
  registerSelect();
@@ -1,5 +1,5 @@
1
1
  import { A as AttachedBehaviorHTMLDirective } from './index.js';
2
- import { N as NodeObservationBehavior } from './slotted.js';
2
+ import { N as NodeObservationBehavior } from './node-observation.js';
3
3
 
4
4
  /**
5
5
  * The runtime behavior for child node observation.
@@ -2,7 +2,8 @@ import { F as FoundationElement, _ as __decorate, a as attr, o as observable, h
2
2
  import { A as AccordionItem, a as accordionItemRegistries } from './definition2.js';
3
3
  import { k as keyEnd, a as keyHome, b as keyArrowDown, c as keyArrowUp } from './key-codes.js';
4
4
  import { w as wrapInBounds } from './numbers.js';
5
- import { s as slotted, e as elements } from './slotted.js';
5
+ import { e as elements } from './node-observation.js';
6
+ import { s as slotted } from './slotted.js';
6
7
  import { c as classNames } from './class-names.js';
7
8
 
8
9
  /**
@@ -186,7 +187,7 @@ __decorate([
186
187
  observable
187
188
  ], Accordion$1.prototype, "accordionItems", void 0);
188
189
 
189
- var css_248z = "/**\n * Do not edit directly\n * Generated on Mon, 24 Apr 2023 10:27:51 GMT\n */\n.base {\n display: flex;\n box-sizing: border-box;\n flex-direction: column;\n}\n\n::slotted(:not(:only-of-type)) {\n border-bottom: 1px solid var(--vvd-color-neutral-200);\n}";
190
+ var css_248z = "/**\n * Do not edit directly\n * Generated on Mon, 08 May 2023 11:40:49 GMT\n */\n.base {\n display: flex;\n box-sizing: border-box;\n flex-direction: column;\n}\n\n::slotted(:not(:only-of-type)) {\n border-bottom: 1px solid var(--vvd-color-neutral-200);\n}";
190
191
 
191
192
  class Accordion extends Accordion$1 {
192
193
  constructor() {
@@ -1,77 +1,60 @@
1
- import { _ as __decorate, a as attr, b as __metadata, h as html, r as registerFactory } from './index.js';
2
- import { B as BaseProgress } from './base-progress.js';
1
+ import { F as FoundationElement, _ as __decorate, a as attr, b as __metadata, h as html, r as registerFactory } from './index.js';
2
+ import { i as iconRegistries } from './definition3.js';
3
+ import { I as Icon } from './icon.js';
3
4
  import { w as when } from './when.js';
4
5
  import { c as classNames } from './class-names.js';
5
6
 
6
- var css_248z = "/**\n * Do not edit directly\n * Generated on Mon, 24 Apr 2023 10:27:51 GMT\n */\n.base {\n align-items: center;\n block-size: var(--_size);\n color: var(--_appearance-color-text);\n inline-size: var(--_size);\n outline: none;\n}\n.base.connotation-cta {\n --_connotation-color-primary: var(--vvd-color-cta-500);\n}\n.base.connotation-alert {\n --_connotation-color-primary: var(--vvd-color-alert-500);\n}\n.base.connotation-success {\n --_connotation-color-primary: var(--vvd-color-success-500);\n}\n.base:not(.connotation-cta, .connotation-alert, .connotation-success) {\n --_connotation-color-primary: var(--vvd-color-canvas-text);\n}\n.base {\n --_appearance-color-text: var(--_connotation-color-primary);\n --_appearance-color-fill: transparent;\n --_appearance-color-outline: transparent;\n}\n.base:where(:disabled, .disabled) {\n --_appearance-color-text: var(--vvd-color-neutral-400);\n --_appearance-color-fill: transparent;\n --_appearance-color-outline: transparent;\n}\n.base.size--5 {\n --_size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) - 20));\n}\n.base.size--4 {\n --_size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) - 16));\n}\n.base.size--3 {\n --_size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) - 12));\n}\n.base.size--2 {\n --_size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) - 8));\n}\n.base.size--1 {\n --_size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) - 4));\n}\n.base.size-1 {\n --_size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) + 4));\n}\n.base.size-2 {\n --_size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) + 8));\n}\n.base.size-3 {\n --_size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) + 12));\n}\n.base.size-4 {\n --_size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) + 16));\n}\n.base.size-5 {\n --_size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) + 20));\n}\n.base:not(.size--5, .size--4, .size--3, .size--2, .size--1, .size-1, .size-2, .size-3, .size-4, .size-5) {\n --_size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2)));\n}\n\n.progress {\n width: 100%;\n height: 100%;\n}\n\n.background {\n fill: none;\n stroke: transparent;\n stroke-width: 1px;\n}\n\n.determinate {\n fill: none;\n stroke: currentColor;\n stroke-linecap: round;\n stroke-width: 1px;\n transform: rotate(-90deg);\n transform-origin: 50% 50%;\n transition: all 0.2s ease-in-out;\n}\n\n.indeterminate-indicator-1 {\n animation: spin-infinite 2s linear infinite;\n fill: none;\n stroke: currentColor;\n stroke-linecap: round;\n stroke-width: 1px;\n transform: rotate(-90deg);\n transform-origin: 50% 50%;\n transition: all 0.2s ease-in-out;\n}\n\n.base.paused .indeterminate-indicator-1 {\n animation-play-state: paused;\n}\n\n@keyframes spin-infinite {\n 0% {\n stroke-dasharray: 0.01px 43.97px;\n transform: rotate(0deg);\n }\n 50% {\n stroke-dasharray: 21.99px 21.99px;\n transform: rotate(450deg);\n }\n 100% {\n stroke-dasharray: 0.01px 43.97px;\n transform: rotate(1080deg);\n }\n}";
7
+ var css_248z = "/**\n * Do not edit directly\n * Generated on Mon, 08 May 2023 11:40:49 GMT\n */\n.base {\n display: inline-flex;\n overflow: hidden;\n align-items: center;\n justify-content: center;\n background-color: var(--_appearance-color-fill);\n block-size: var(--_size);\n box-shadow: inset 0 0 0 1px var(--_appearance-color-outline);\n color: var(--_appearance-color-text);\n inline-size: var(--_size);\n vertical-align: middle;\n}\n.base.connotation-cta {\n --_connotation-color-primary: var(--vvd-color-cta-500);\n --_connotation-color-primary-text: var(--vvd-color-canvas);\n --_connotation-color-firm: var(--vvd-color-cta-600);\n --_connotation-color-fierce: var(--vvd-color-cta-700);\n --_connotation-color-pale: var(--vvd-color-cta-300);\n}\n.base:not(.connotation-cta) {\n --_connotation-color-primary: var(--vvd-color-canvas-text);\n --_connotation-color-primary-text: var(--vvd-color-canvas);\n --_connotation-color-firm: var(--vvd-color-canvas-text);\n --_connotation-color-fierce: var(--vvd-color-neutral-700);\n --_connotation-color-pale: var(--vvd-color-neutral-300);\n}\n.base {\n --_appearance-color-text: var(--_connotation-color-primary-text);\n --_appearance-color-fill: var(--_connotation-color-primary);\n --_appearance-color-outline: transparent;\n}\n.base.appearance-outlined {\n --_appearance-color-text: var(--_connotation-color-firm);\n --_appearance-color-fill: transparent;\n --_appearance-color-outline: var(--_connotation-color-firm);\n}\n.base.appearance-duotone {\n --_appearance-color-text: var(--_connotation-color-fierce);\n --_appearance-color-fill: transparent;\n --_appearance-color-outline: var(--_connotation-color-pale);\n}\n.base.size-condensed {\n --_size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) - 8));\n}\n.base.size-condensed .initials {\n font: var(--vvd-typography-base-condensed-bold);\n}\n.base.size-condensed .icon {\n font-size: calc(calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) - 8)) / 2);\n line-height: 1;\n}\n.base.size-expanded {\n --_size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) + 8));\n}\n.base.size-expanded .initials {\n font: var(--vvd-typography-heading-4);\n}\n.base.size-expanded .icon {\n font-size: calc(calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) + 8)) / 2);\n line-height: 1;\n}\n.base:not(.size-condensed, .size-expanded) {\n --_size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2)));\n}\n.base:not(.size-condensed, .size-expanded) .initials {\n font: var(--vvd-typography-base-extended-bold);\n}\n.base:not(.size-condensed, .size-expanded) .icon {\n font-size: calc(calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2))) / 2);\n line-height: 1;\n}\n.base:not(.shape-pill) {\n border-radius: 6px;\n}\n.base.shape-pill {\n border-radius: 50%;\n}\n.base .initials {\n text-transform: uppercase;\n}\n.base ::slotted(*) {\n block-size: 100%;\n inline-size: 100%;\n object-fit: cover;\n}";
7
8
 
8
- class ProgressRing extends BaseProgress {}
9
- __decorate([attr, __metadata("design:type", String)], ProgressRing.prototype, "connotation", void 0);
10
- __decorate([attr, __metadata("design:type", Number)], ProgressRing.prototype, "size", void 0);
9
+ class Avatar extends FoundationElement {}
10
+ __decorate([attr, __metadata("design:type", String)], Avatar.prototype, "connotation", void 0);
11
+ __decorate([attr, __metadata("design:type", String)], Avatar.prototype, "shape", void 0);
12
+ __decorate([attr, __metadata("design:type", String)], Avatar.prototype, "appearance", void 0);
13
+ __decorate([attr, __metadata("design:type", String)], Avatar.prototype, "size", void 0);
14
+ __decorate([attr, __metadata("design:type", String)], Avatar.prototype, "icon", void 0);
15
+ __decorate([attr, __metadata("design:type", String)], Avatar.prototype, "initials", void 0);
11
16
 
12
- let _2 = t => t,
17
+ let _ = t => t,
13
18
  _t,
14
19
  _t2,
15
20
  _t3;
16
21
  const getClasses = ({
22
+ appearance,
17
23
  connotation,
18
- size,
19
- paused
20
- }) => classNames('base', ['disabled', !!paused], [`connotation-${connotation}`, !!connotation], [`size-${size}`, !!size]);
21
- const progressSegments = 44;
22
- const ProgressRingTemplate = _ => html(_t || (_t = _2`
23
- <div
24
- role="progressbar"
25
- aria-valuenow="${0}"
26
- aria-valuemin="${0}"
27
- aria-valuemax="${0}"
28
- class="${0} ${0}"
29
- >
30
- ${0}
31
- ${0}
32
- </div>
33
- `), x => x.value, x => x.min, x => x.max, x => x.paused ? 'paused' : '', getClasses, when(x => typeof x.value === 'number', html(_t2 || (_t2 = _2`
34
- <svg
35
- class="progress"
36
- viewBox="0 0 16 16"
37
- >
38
- <circle
39
- class="background"
40
- cx="8px"
41
- cy="8px"
42
- r="7px"
43
- ></circle>
44
- <circle
45
- class="determinate"
46
- style="stroke-dasharray: ${0}px ${0}px"
47
- cx="8px"
48
- cy="8px"
49
- r="7px"
50
- ></circle>
51
- </svg>
52
- `), x => progressSegments * x.percentComplete / 100, progressSegments)), when(x => typeof x.value !== 'number', html(_t3 || (_t3 = _2`
53
- <svg class="progress" viewBox="0 0 16 16">
54
- <circle
55
- class="background"
56
- cx="8px"
57
- cy="8px"
58
- r="7px"
59
- ></circle>
60
- <circle
61
- class="indeterminate-indicator-1"
62
- cx="8px"
63
- cy="8px"
64
- r="7px"
65
- ></circle>
66
- </svg>
67
- `))));
24
+ shape,
25
+ size
26
+ }) => classNames('base', [`connotation-${connotation}`, Boolean(connotation)], [`appearance-${appearance}`, Boolean(appearance)], [`shape-${shape}`, Boolean(shape)], [`size-${size}`, Boolean(size)]);
27
+ function renderIcon(iconTag) {
28
+ return html(_t || (_t = _`
29
+ <span class="icon">
30
+ <${0} name="${0}"></${0}>
31
+ </span>
32
+ `), iconTag, x => x.icon ? `${x.icon}` : 'user-line', iconTag);
33
+ }
34
+ function renderInitials() {
35
+ return html(_t2 || (_t2 = _`
36
+ <span class="initials">${0}</span>
37
+ `), ({
38
+ initials
39
+ }) => initials.substring(0, 2));
40
+ }
41
+ const AvatarTemplate = context => {
42
+ const iconTag = context.tagFor(Icon);
43
+ return html(_t3 || (_t3 = _`
44
+ <span class="${0}">
45
+ <slot name="graphic">
46
+ ${0}
47
+ ${0}
48
+ </slot>
49
+ </span>`), getClasses, when(x => x.initials, renderInitials()), when(x => !x.initials, renderIcon(iconTag)));
50
+ };
68
51
 
69
- const progressRingDefinition = ProgressRing.compose({
70
- baseName: 'progress-ring',
71
- template: ProgressRingTemplate,
52
+ const avatarDefinition = Avatar.compose({
53
+ baseName: 'avatar',
54
+ template: AvatarTemplate,
72
55
  styles: css_248z
73
56
  });
74
- const progressRingRegistries = [progressRingDefinition()];
75
- const registerProgressRing = registerFactory(progressRingRegistries);
57
+ const avatarRegistries = [avatarDefinition(), ...iconRegistries];
58
+ const registerAvatar = registerFactory(avatarRegistries);
76
59
 
77
- export { ProgressRing as P, progressRingDefinition as a, progressRingRegistries as p, registerProgressRing as r };
60
+ export { avatarDefinition as a, avatarRegistries as b, registerAvatar as r };