@vonage/vivid 3.36.0 → 3.38.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 (168) hide show
  1. package/accordion/index.js +3 -4
  2. package/accordion-item/index.js +3 -2
  3. package/alert/index.js +5 -4
  4. package/avatar/index.js +1 -1
  5. package/badge/index.js +2 -1
  6. package/banner/index.js +4 -3
  7. package/breadcrumb/index.js +0 -1
  8. package/breadcrumb-item/index.js +3 -2
  9. package/button/index.js +4 -3
  10. package/card/index.js +2 -3
  11. package/checkbox/index.js +3 -4
  12. package/combobox/index.js +7 -8
  13. package/custom-elements.json +386 -758
  14. package/data-grid/index.js +2 -3
  15. package/date-picker/index.js +10 -9
  16. package/date-range-picker/index.js +36 -0
  17. package/dialog/index.js +6 -7
  18. package/divider/index.js +1 -1
  19. package/elevation/index.js +1 -1
  20. package/empty-state/index.js +2 -3
  21. package/fab/index.js +4 -3
  22. package/file-picker/index.js +6 -4
  23. package/focus/index.js +1 -1
  24. package/header/index.js +2 -2
  25. package/icon/index.js +1 -1
  26. package/index.js +44 -42
  27. package/layout/index.js +1 -1
  28. package/lib/components.d.ts +1 -0
  29. package/lib/date-picker/date-picker.d.ts +5 -15
  30. package/lib/date-range-picker/date-range-picker.d.ts +16 -0
  31. package/lib/date-range-picker/definition.d.ts +3 -0
  32. package/lib/file-picker/file-picker.d.ts +8 -5
  33. package/lib/file-picker/file-picker.form-associated.d.ts +10 -0
  34. package/lib/file-picker/locale.d.ts +6 -0
  35. package/lib/number-field/number-field.d.ts +6 -2
  36. package/lib/tag-group/tag-group.d.ts +1 -0
  37. package/lib/tree-item/tree-item.template.d.ts +1 -1
  38. package/listbox/index.js +4 -5
  39. package/locales/en-GB.js +27 -3
  40. package/locales/en-US.js +27 -3
  41. package/locales/ja-JP.js +25 -1
  42. package/locales/zh-CN.js +25 -1
  43. package/menu/index.js +8 -9
  44. package/menu-item/index.js +4 -5
  45. package/nav/index.js +1 -1
  46. package/nav-disclosure/index.js +4 -3
  47. package/nav-item/index.js +4 -3
  48. package/note/index.js +3 -2
  49. package/number-field/index.js +6 -5
  50. package/option/index.js +4 -3
  51. package/package.json +1 -1
  52. package/pagination/index.js +5 -5
  53. package/popup/index.js +6 -5
  54. package/progress/index.js +1 -1
  55. package/progress-ring/index.js +1 -1
  56. package/radio/index.js +2 -2
  57. package/radio-group/index.js +2 -3
  58. package/select/index.js +8 -9
  59. package/shared/affix.js +5 -1
  60. package/shared/apply-mixins.js +1 -1
  61. package/shared/children.js +2 -2
  62. package/shared/date-picker/calendar/dateRange.d.ts +5 -0
  63. package/shared/date-picker/calendar/presentationDateRange.d.ts +5 -0
  64. package/shared/date-picker/date-picker-base.d.ts +20 -0
  65. package/shared/date-picker/date-picker-base.form-associated.d.ts +10 -0
  66. package/shared/date-picker/date-picker-base.template.d.ts +4 -0
  67. package/{lib → shared}/date-picker/locale.d.ts +6 -0
  68. package/shared/definition.js +5 -5
  69. package/shared/definition10.js +9 -14
  70. package/shared/definition11.js +1 -1
  71. package/shared/definition12.js +1 -1
  72. package/shared/definition13.js +3 -3
  73. package/shared/definition14.js +3 -3
  74. package/shared/definition15.js +5 -5
  75. package/shared/definition16.js +4 -5
  76. package/shared/definition17.js +59 -6016
  77. package/shared/definition18.js +350 -213
  78. package/shared/definition19.js +251 -67
  79. package/shared/definition2.js +2 -3
  80. package/shared/definition20.js +66 -58
  81. package/shared/definition21.js +43 -83
  82. package/shared/definition22.js +75 -2298
  83. package/shared/definition23.js +2361 -45
  84. package/shared/definition24.js +63 -27
  85. package/shared/definition25.js +24 -51
  86. package/shared/definition26.js +36 -806
  87. package/shared/definition27.js +820 -49
  88. package/shared/definition28.js +52 -89
  89. package/shared/definition29.js +88 -24
  90. package/shared/definition3.js +1 -1
  91. package/shared/definition30.js +25 -12
  92. package/shared/definition31.js +12 -53
  93. package/shared/definition32.js +29 -441
  94. package/shared/definition33.js +427 -197
  95. package/shared/definition34.js +260 -174
  96. package/shared/definition35.js +187 -69
  97. package/shared/definition36.js +68 -55
  98. package/shared/definition37.js +61 -422
  99. package/shared/definition38.js +435 -35
  100. package/shared/definition39.js +30 -679
  101. package/shared/definition4.js +3 -3
  102. package/shared/definition40.js +661 -77
  103. package/shared/definition41.js +77 -557
  104. package/shared/definition42.js +559 -106
  105. package/shared/definition43.js +105 -136
  106. package/shared/definition44.js +153 -17
  107. package/shared/definition45.js +16 -79
  108. package/shared/definition46.js +53 -475
  109. package/shared/definition47.js +506 -20
  110. package/shared/definition48.js +22 -121
  111. package/shared/definition49.js +115 -262
  112. package/shared/definition5.js +2 -2
  113. package/shared/definition50.js +248 -120
  114. package/shared/definition51.js +139 -123
  115. package/shared/definition52.js +84 -74
  116. package/shared/definition53.js +114 -70
  117. package/shared/definition54.js +81 -292
  118. package/shared/definition55.js +302 -13
  119. package/shared/definition56.js +11 -41
  120. package/shared/definition57.js +20 -154
  121. package/shared/definition58.js +181 -0
  122. package/shared/definition6.js +5 -5
  123. package/shared/definition7.js +4 -4
  124. package/shared/definition8.js +3 -3
  125. package/shared/definition9.js +1 -2
  126. package/shared/index.js +1 -1
  127. package/shared/index2.js +1 -1
  128. package/shared/listbox.js +1 -1
  129. package/shared/localization/Locale.d.ts +3 -1
  130. package/shared/localized.js +9 -0
  131. package/shared/patterns/affix.d.ts +3 -1
  132. package/shared/presentationDate.js +6133 -0
  133. package/shared/ref.js +1 -1
  134. package/shared/slotted.js +73 -3
  135. package/shared/text-anchor.template.js +4 -4
  136. package/shared/text-field.js +1 -1
  137. package/side-drawer/index.js +1 -1
  138. package/slider/index.js +2 -2
  139. package/split-button/index.js +4 -3
  140. package/style.css +265 -197
  141. package/styles/core/all.css +44 -13
  142. package/styles/core/theme.css +1 -1
  143. package/styles/core/typography.css +44 -13
  144. package/styles/tokens/theme-dark.css +4 -4
  145. package/styles/tokens/theme-light.css +4 -4
  146. package/styles/tokens/vivid-2-compat.css +1 -1
  147. package/switch/index.js +4 -3
  148. package/tab/index.js +4 -3
  149. package/tab-panel/index.js +1 -1
  150. package/tabs/index.js +6 -7
  151. package/tag/index.js +4 -3
  152. package/tag-group/index.js +1 -1
  153. package/text-anchor/index.js +1 -0
  154. package/text-area/index.js +4 -3
  155. package/text-field/index.js +4 -5
  156. package/toggletip/index.js +7 -6
  157. package/tooltip/index.js +7 -6
  158. package/tree-item/index.js +4 -5
  159. package/tree-view/index.js +1 -2
  160. package/vivid.api.json +105 -0
  161. package/lib/date-picker/date-picker.template.d.ts +0 -4
  162. package/shared/node-observation.js +0 -74
  163. /package/{lib → shared}/date-picker/calendar/calendarGrid.d.ts +0 -0
  164. /package/{lib → shared}/date-picker/calendar/dateStr.d.ts +0 -0
  165. /package/{lib → shared}/date-picker/calendar/month.d.ts +0 -0
  166. /package/{lib → shared}/date-picker/calendar/monthPickerGrid.d.ts +0 -0
  167. /package/{lib → shared}/date-picker/calendar/presentationDate.d.ts +0 -0
  168. /package/{lib → shared}/date-picker/calendar/year.d.ts +0 -0
@@ -1,400 +1,9 @@
1
- import { F as FoundationElement, _ as __decorate, a as attr, o as observable, h as html, r as registerFactory } from './index.js';
2
- import { D as Direction, g as getDirection } from './direction.js';
3
- import { h as keyArrowRight, i as keyArrowLeft, A as ArrowKeys, e as keyArrowUp, d as keyArrowDown, k as keyEnter } from './key-codes.js';
4
- import { O as Orientation } from './aria.js';
5
- import { R as Radio } from './radio.js';
6
- import { O as Orientation$1 } from './aria2.js';
7
- import { e as elements } from './node-observation.js';
1
+ import { a as attr, h as html, r as registerFactory } from './index.js';
2
+ import { B as BaseProgress } from './base-progress.js';
8
3
  import { w as when } from './when.js';
9
- import { s as slotted } from './slotted.js';
4
+ import { c as classNames } from './class-names.js';
10
5
 
11
- /**
12
- * An Radio Group Custom HTML Element.
13
- * Implements the {@link https://www.w3.org/TR/wai-aria-1.1/#radiogroup | ARIA radiogroup }.
14
- *
15
- * @slot label - The slot for the label
16
- * @slot - The default slot for radio buttons
17
- * @csspart positioning-region - The positioning region for laying out the radios
18
- * @fires change - Fires a custom 'change' event when the value changes
19
- *
20
- * @public
21
- */
22
- let RadioGroup$1 = class RadioGroup extends FoundationElement {
23
- constructor() {
24
- super(...arguments);
25
- /**
26
- * The orientation of the group
27
- *
28
- * @public
29
- * @remarks
30
- * HTML Attribute: orientation
31
- */
32
- this.orientation = Orientation.horizontal;
33
- this.radioChangeHandler = (e) => {
34
- const changedRadio = e.target;
35
- if (changedRadio.checked) {
36
- this.slottedRadioButtons.forEach((radio) => {
37
- if (radio !== changedRadio) {
38
- radio.checked = false;
39
- if (!this.isInsideFoundationToolbar) {
40
- radio.setAttribute("tabindex", "-1");
41
- }
42
- }
43
- });
44
- this.selectedRadio = changedRadio;
45
- this.value = changedRadio.value;
46
- changedRadio.setAttribute("tabindex", "0");
47
- this.focusedRadio = changedRadio;
48
- }
49
- e.stopPropagation();
50
- };
51
- this.moveToRadioByIndex = (group, index) => {
52
- const radio = group[index];
53
- if (!this.isInsideToolbar) {
54
- radio.setAttribute("tabindex", "0");
55
- if (radio.readOnly) {
56
- this.slottedRadioButtons.forEach((nextRadio) => {
57
- if (nextRadio !== radio) {
58
- nextRadio.setAttribute("tabindex", "-1");
59
- }
60
- });
61
- }
62
- else {
63
- radio.checked = true;
64
- this.selectedRadio = radio;
65
- }
66
- }
67
- this.focusedRadio = radio;
68
- radio.focus();
69
- };
70
- this.moveRightOffGroup = () => {
71
- var _a;
72
- (_a = this.nextElementSibling) === null || _a === void 0 ? void 0 : _a.focus();
73
- };
74
- this.moveLeftOffGroup = () => {
75
- var _a;
76
- (_a = this.previousElementSibling) === null || _a === void 0 ? void 0 : _a.focus();
77
- };
78
- /**
79
- * @internal
80
- */
81
- this.focusOutHandler = (e) => {
82
- const group = this.slottedRadioButtons;
83
- const radio = e.target;
84
- const index = radio !== null ? group.indexOf(radio) : 0;
85
- const focusedIndex = this.focusedRadio
86
- ? group.indexOf(this.focusedRadio)
87
- : -1;
88
- if ((focusedIndex === 0 && index === focusedIndex) ||
89
- (focusedIndex === group.length - 1 && focusedIndex === index)) {
90
- if (!this.selectedRadio) {
91
- this.focusedRadio = group[0];
92
- this.focusedRadio.setAttribute("tabindex", "0");
93
- group.forEach((nextRadio) => {
94
- if (nextRadio !== this.focusedRadio) {
95
- nextRadio.setAttribute("tabindex", "-1");
96
- }
97
- });
98
- }
99
- else {
100
- this.focusedRadio = this.selectedRadio;
101
- if (!this.isInsideFoundationToolbar) {
102
- this.selectedRadio.setAttribute("tabindex", "0");
103
- group.forEach((nextRadio) => {
104
- if (nextRadio !== this.selectedRadio) {
105
- nextRadio.setAttribute("tabindex", "-1");
106
- }
107
- });
108
- }
109
- }
110
- }
111
- return true;
112
- };
113
- /**
114
- * @internal
115
- */
116
- this.clickHandler = (e) => {
117
- const radio = e.target;
118
- if (radio) {
119
- const group = this.slottedRadioButtons;
120
- if (radio.checked || group.indexOf(radio) === 0) {
121
- radio.setAttribute("tabindex", "0");
122
- this.selectedRadio = radio;
123
- }
124
- else {
125
- radio.setAttribute("tabindex", "-1");
126
- this.selectedRadio = null;
127
- }
128
- this.focusedRadio = radio;
129
- }
130
- e.preventDefault();
131
- };
132
- this.shouldMoveOffGroupToTheRight = (index, group, key) => {
133
- return index === group.length && this.isInsideToolbar && key === keyArrowRight;
134
- };
135
- this.shouldMoveOffGroupToTheLeft = (group, key) => {
136
- const index = this.focusedRadio ? group.indexOf(this.focusedRadio) - 1 : 0;
137
- return index < 0 && this.isInsideToolbar && key === keyArrowLeft;
138
- };
139
- this.checkFocusedRadio = () => {
140
- if (this.focusedRadio !== null &&
141
- !this.focusedRadio.readOnly &&
142
- !this.focusedRadio.checked) {
143
- this.focusedRadio.checked = true;
144
- this.focusedRadio.setAttribute("tabindex", "0");
145
- this.focusedRadio.focus();
146
- this.selectedRadio = this.focusedRadio;
147
- }
148
- };
149
- this.moveRight = (e) => {
150
- const group = this.slottedRadioButtons;
151
- let index = 0;
152
- index = this.focusedRadio ? group.indexOf(this.focusedRadio) + 1 : 1;
153
- if (this.shouldMoveOffGroupToTheRight(index, group, e.key)) {
154
- this.moveRightOffGroup();
155
- return;
156
- }
157
- else if (index === group.length) {
158
- index = 0;
159
- }
160
- /* looping to get to next radio that is not disabled */
161
- /* matching native radio/radiogroup which does not select an item if there is only 1 in the group */
162
- while (index < group.length && group.length > 1) {
163
- if (!group[index].disabled) {
164
- this.moveToRadioByIndex(group, index);
165
- break;
166
- }
167
- else if (this.focusedRadio && index === group.indexOf(this.focusedRadio)) {
168
- break;
169
- }
170
- else if (index + 1 >= group.length) {
171
- if (this.isInsideToolbar) {
172
- break;
173
- }
174
- else {
175
- index = 0;
176
- }
177
- }
178
- else {
179
- index += 1;
180
- }
181
- }
182
- };
183
- this.moveLeft = (e) => {
184
- const group = this.slottedRadioButtons;
185
- let index = 0;
186
- index = this.focusedRadio ? group.indexOf(this.focusedRadio) - 1 : 0;
187
- index = index < 0 ? group.length - 1 : index;
188
- if (this.shouldMoveOffGroupToTheLeft(group, e.key)) {
189
- this.moveLeftOffGroup();
190
- return;
191
- }
192
- /* looping to get to next radio that is not disabled */
193
- while (index >= 0 && group.length > 1) {
194
- if (!group[index].disabled) {
195
- this.moveToRadioByIndex(group, index);
196
- break;
197
- }
198
- else if (this.focusedRadio && index === group.indexOf(this.focusedRadio)) {
199
- break;
200
- }
201
- else if (index - 1 < 0) {
202
- index = group.length - 1;
203
- }
204
- else {
205
- index -= 1;
206
- }
207
- }
208
- };
209
- /**
210
- * keyboard handling per https://w3c.github.io/aria-practices/#for-radio-groups-not-contained-in-a-toolbar
211
- * navigation is different when there is an ancestor with role='toolbar'
212
- *
213
- * @internal
214
- */
215
- this.keydownHandler = (e) => {
216
- const key = e.key;
217
- if (key in ArrowKeys && this.isInsideFoundationToolbar) {
218
- return true;
219
- }
220
- switch (key) {
221
- case keyEnter: {
222
- this.checkFocusedRadio();
223
- break;
224
- }
225
- case keyArrowRight:
226
- case keyArrowDown: {
227
- if (this.direction === Direction.ltr) {
228
- this.moveRight(e);
229
- }
230
- else {
231
- this.moveLeft(e);
232
- }
233
- break;
234
- }
235
- case keyArrowLeft:
236
- case keyArrowUp: {
237
- if (this.direction === Direction.ltr) {
238
- this.moveLeft(e);
239
- }
240
- else {
241
- this.moveRight(e);
242
- }
243
- break;
244
- }
245
- default: {
246
- return true;
247
- }
248
- }
249
- };
250
- }
251
- readOnlyChanged() {
252
- if (this.slottedRadioButtons !== undefined) {
253
- this.slottedRadioButtons.forEach((radio) => {
254
- if (this.readOnly) {
255
- radio.readOnly = true;
256
- }
257
- else {
258
- radio.readOnly = false;
259
- }
260
- });
261
- }
262
- }
263
- disabledChanged() {
264
- if (this.slottedRadioButtons !== undefined) {
265
- this.slottedRadioButtons.forEach((radio) => {
266
- if (this.disabled) {
267
- radio.disabled = true;
268
- }
269
- else {
270
- radio.disabled = false;
271
- }
272
- });
273
- }
274
- }
275
- nameChanged() {
276
- if (this.slottedRadioButtons) {
277
- this.slottedRadioButtons.forEach((radio) => {
278
- radio.setAttribute("name", this.name);
279
- });
280
- }
281
- }
282
- valueChanged() {
283
- if (this.slottedRadioButtons) {
284
- this.slottedRadioButtons.forEach((radio) => {
285
- if (radio.value === this.value) {
286
- radio.checked = true;
287
- this.selectedRadio = radio;
288
- }
289
- });
290
- }
291
- this.$emit("change");
292
- }
293
- slottedRadioButtonsChanged(oldValue, newValue) {
294
- if (this.slottedRadioButtons && this.slottedRadioButtons.length > 0) {
295
- this.setupRadioButtons();
296
- }
297
- }
298
- get parentToolbar() {
299
- return this.closest('[role="toolbar"]');
300
- }
301
- get isInsideToolbar() {
302
- var _a;
303
- return ((_a = this.parentToolbar) !== null && _a !== void 0 ? _a : false);
304
- }
305
- get isInsideFoundationToolbar() {
306
- var _a;
307
- return !!((_a = this.parentToolbar) === null || _a === void 0 ? void 0 : _a["$fastController"]);
308
- }
309
- /**
310
- * @internal
311
- */
312
- connectedCallback() {
313
- super.connectedCallback();
314
- this.direction = getDirection(this);
315
- this.setupRadioButtons();
316
- }
317
- disconnectedCallback() {
318
- this.slottedRadioButtons.forEach((radio) => {
319
- radio.removeEventListener("change", this.radioChangeHandler);
320
- });
321
- }
322
- setupRadioButtons() {
323
- const checkedRadios = this.slottedRadioButtons.filter((radio) => {
324
- return radio.hasAttribute("checked");
325
- });
326
- const numberOfCheckedRadios = checkedRadios ? checkedRadios.length : 0;
327
- if (numberOfCheckedRadios > 1) {
328
- const lastCheckedRadio = checkedRadios[numberOfCheckedRadios - 1];
329
- lastCheckedRadio.checked = true;
330
- }
331
- let foundMatchingVal = false;
332
- this.slottedRadioButtons.forEach((radio) => {
333
- if (this.name !== undefined) {
334
- radio.setAttribute("name", this.name);
335
- }
336
- if (this.disabled) {
337
- radio.disabled = true;
338
- }
339
- if (this.readOnly) {
340
- radio.readOnly = true;
341
- }
342
- if (this.value && this.value === radio.value) {
343
- this.selectedRadio = radio;
344
- this.focusedRadio = radio;
345
- radio.checked = true;
346
- radio.setAttribute("tabindex", "0");
347
- foundMatchingVal = true;
348
- }
349
- else {
350
- if (!this.isInsideFoundationToolbar) {
351
- radio.setAttribute("tabindex", "-1");
352
- }
353
- radio.checked = false;
354
- }
355
- radio.addEventListener("change", this.radioChangeHandler);
356
- });
357
- if (this.value === undefined && this.slottedRadioButtons.length > 0) {
358
- const checkedRadios = this.slottedRadioButtons.filter((radio) => {
359
- return radio.hasAttribute("checked");
360
- });
361
- const numberOfCheckedRadios = checkedRadios !== null ? checkedRadios.length : 0;
362
- if (numberOfCheckedRadios > 0 && !foundMatchingVal) {
363
- const lastCheckedRadio = checkedRadios[numberOfCheckedRadios - 1];
364
- lastCheckedRadio.checked = true;
365
- this.focusedRadio = lastCheckedRadio;
366
- lastCheckedRadio.setAttribute("tabindex", "0");
367
- }
368
- else {
369
- this.slottedRadioButtons[0].setAttribute("tabindex", "0");
370
- this.focusedRadio = this.slottedRadioButtons[0];
371
- }
372
- }
373
- }
374
- };
375
- __decorate([
376
- attr({ attribute: "readonly", mode: "boolean" })
377
- ], RadioGroup$1.prototype, "readOnly", void 0);
378
- __decorate([
379
- attr({ attribute: "disabled", mode: "boolean" })
380
- ], RadioGroup$1.prototype, "disabled", void 0);
381
- __decorate([
382
- attr
383
- ], RadioGroup$1.prototype, "name", void 0);
384
- __decorate([
385
- attr
386
- ], RadioGroup$1.prototype, "value", void 0);
387
- __decorate([
388
- attr
389
- ], RadioGroup$1.prototype, "orientation", void 0);
390
- __decorate([
391
- observable
392
- ], RadioGroup$1.prototype, "childItems", void 0);
393
- __decorate([
394
- observable
395
- ], RadioGroup$1.prototype, "slottedRadioButtons", void 0);
396
-
397
- const styles = "/**\n * Do not edit directly\n * Generated on Wed, 13 Sep 2023 10:58:27 GMT\n */\n.positioning-region {\n display: flex;\n flex-wrap: wrap;\n gap: 8px;\n}\n.positioning-region.vertical {\n flex-direction: column;\n}\nlabel + .positioning-region {\n margin-block-start: 8px;\n}\n\nlabel {\n color: var(--vvd-color-canvas-text);\n font: var(--vvd-typography-base);\n}";
6
+ const styles = "/**\n * Do not edit directly\n * Generated on Fri, 13 Oct 2023 14:45:50 GMT\n */\n.base {\n height: 6px;\n align-items: center;\n margin: 0;\n outline: none;\n}\n.base:not(.connotation-pacific).connotation-cta {\n /* @cssprop [--vvd-progress-cta-primary=var(--vvd-color-cta-500)] */\n --_connotation-color-primary: var(--vvd-progress-cta-primary, var(--vvd-color-cta-500));\n /* @cssprop [--vvd-progress-cta-soft=var(--vvd-color-cta-100)] */\n --_connotation-color-soft: var(--vvd-progress-cta-soft, var(--vvd-color-cta-100));\n}\n.base:not(.connotation-pacific).connotation-alert {\n /* @cssprop [--vvd-progress-alert-primary=var(--vvd-color-alert-500)] */\n --_connotation-color-primary: var(--vvd-progress-alert-primary, var(--vvd-color-alert-500));\n /* @cssprop [--vvd-progress-alert-soft=var(--vvd-color-alert-100)] */\n --_connotation-color-soft: var(--vvd-progress-alert-soft, var(--vvd-color-alert-100));\n}\n.base:not(.connotation-pacific).connotation-success {\n /* @cssprop [--vvd-progress-success-primary=var(--vvd-color-success-500)] */\n --_connotation-color-primary: var(--vvd-progress-success-primary, var(--vvd-color-success-500));\n /* @cssprop [--vvd-progress-success-soft=var(--vvd-color-success-100)] */\n --_connotation-color-soft: var(--vvd-progress-success-soft, var(--vvd-color-success-100));\n}\n.base:not(.connotation-pacific):not(.connotation-cta, .connotation-alert, .connotation-success) {\n /* @cssprop [--vvd-progress-accent-primary=var(--vvd-color-canvas-text)] */\n --_connotation-color-primary: var(--vvd-progress-accent-primary, var(--vvd-color-canvas-text));\n /* @cssprop [--vvd-progress-accent-soft=var(--vvd-color-neutral-100)] */\n --_connotation-color-soft: var(--vvd-progress-accent-soft, var(--vvd-color-neutral-100));\n}\n.base:not(.connotation-pacific) {\n --_appearance-color-text: var(--_connotation-color-contrast);\n --_appearance-color-fill: var(--_connotation-color-soft);\n --_appearance-color-outline: transparent;\n}\n.base.connotation-pacific {\n --_connotation-color-primary: linear-gradient(to right, var(--vvd-color-information-200), var(--vvd-color-cta-600));\n}\n\n.progress {\n position: relative;\n display: flex;\n overflow: hidden;\n align-items: center;\n block-size: 100%;\n inline-size: 100%;\n /* Shape */\n}\n.base:not(.connotation-pacific) .progress {\n background-color: var(--_appearance-color-fill);\n}\n.base.connotation-pacific .progress {\n background-color: var(--vvd-color-neutral-100);\n}\n.base:not(.shape-sharp) .progress {\n border-radius: 3px;\n}\n\n.indeterminate {\n display: flex;\n background-color: var(--_connotation-color-primary);\n block-size: 100%;\n border-radius: inherit;\n inline-size: 100%;\n}\n\n.determinate {\n background-color: var(--_connotation-color-primary);\n block-size: 100%;\n border-radius: inherit;\n transition: all 0.2s ease-in-out;\n}\n.connotation-pacific .determinate {\n background-image: var(--_connotation-color-primary);\n}\n.reverse .determinate {\n position: absolute;\n right: 0;\n}\n.paused .determinate {\n background: var(--vvd-color-neutral-300);\n}\n\n.indicator-1 {\n animation: indeterminate-1 2s infinite;\n inline-size: 30%;\n}\n\n.indicator-2 {\n animation: indeterminate-2 2s infinite;\n inline-size: 60%;\n}\n\n.indicator-1,\n.indicator-2 {\n position: absolute;\n animation-timing-function: cubic-bezier(0.4, 0, 0.6, 1);\n background-color: var(--vvd-color-neutral-100);\n block-size: 100%;\n opacity: 0;\n}\n.connotation-pacific .indicator-1,\n.connotation-pacific .indicator-2 {\n background-image: var(--_connotation-color-primary);\n}\n.paused .indicator-1,\n.paused .indicator-2 {\n animation-play-state: paused;\n background-color: var(--_connotation-color-primary);\n}\n.reverse .indicator-1,\n.reverse .indicator-2 {\n animation-direction: reverse;\n}\n\n@keyframes indeterminate-1 {\n 0% {\n opacity: 1;\n transform: translateX(-100%);\n }\n 70% {\n opacity: 1;\n transform: translateX(300%);\n }\n 70.01% {\n opacity: 0;\n }\n 100% {\n opacity: 0;\n transform: translateX(300%);\n }\n}\n@keyframes indeterminate-2 {\n 0% {\n opacity: 0;\n transform: translateX(-150%);\n }\n 29.99% {\n opacity: 0;\n }\n 30% {\n opacity: 1;\n transform: translateX(-150%);\n }\n 100% {\n opacity: 1;\n transform: translateX(166.66%);\n }\n}";
398
7
 
399
8
  var __defProp = Object.defineProperty;
400
9
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -407,39 +16,69 @@ var __decorateClass = (decorators, target, key, kind) => {
407
16
  __defProp(target, key, result);
408
17
  return result;
409
18
  };
410
- class RadioGroup extends RadioGroup$1 {
19
+ class Progress extends BaseProgress {
20
+ constructor() {
21
+ super(...arguments);
22
+ this.reverse = false;
23
+ }
411
24
  }
412
25
  __decorateClass([
413
- attr
414
- ], RadioGroup.prototype, "label", 2);
26
+ attr()
27
+ ], Progress.prototype, "shape", 2);
28
+ __decorateClass([
29
+ attr()
30
+ ], Progress.prototype, "connotation", 2);
31
+ __decorateClass([
32
+ attr({ mode: "boolean" })
33
+ ], Progress.prototype, "reverse", 2);
415
34
 
416
- const RadioGroupTemplate = (context) => {
35
+ const getClasses = ({
36
+ connotation,
37
+ shape,
38
+ reverse,
39
+ paused
40
+ }) => classNames(
41
+ "base",
42
+ [`connotation-${connotation}`, Boolean(connotation)],
43
+ [`shape-${shape}`, Boolean(shape)],
44
+ ["reverse", Boolean(reverse)],
45
+ ["paused", Boolean(paused)]
46
+ );
47
+ function determinate() {
417
48
  return html`
418
- <template
419
- role="radiogroup"
420
- aria-disabled="${(x) => x.disabled}"
421
- aria-readonly="${(x) => x.readOnly}"
422
- aria-orientation="${(x) => x.orientation}"
423
- @click="${(x, c) => x.clickHandler(c.event)}"
424
- @keydown="${(x, c) => x.keydownHandler(c.event)}"
425
- @focusout="${(x, c) => x.focusOutHandler(c.event)}"
426
- >
427
-
428
- ${when((x) => x.label, html`<label>${(x) => x.label}</label>`)}
429
-
430
- <div class="positioning-region ${(x) => x.orientation === Orientation$1.horizontal ? "horizontal" : "vertical"}">
431
- <slot ${slotted({ property: "slottedRadioButtons", filter: elements(context.tagFor(Radio)) })}></slot>
432
- </div>
433
- </template>
434
- `;
49
+ <span class="determinate" style="width: ${(x) => x.percentComplete}%"></span>`;
50
+ }
51
+ function indeterminate() {
52
+ return html`
53
+ <span class="indeterminate" name="indeterminate">
54
+ <span class="indicator-1"></span>
55
+ <span class="indicator-2"></span>
56
+ </span>`;
57
+ }
58
+ const ProgressTemplate = (_) => {
59
+ return html`
60
+ <div
61
+ role="progressbar"
62
+ aria-label="${(x) => x.ariaLabel}"
63
+ aria-valuenow="${(x) => x.value}"
64
+ aria-valuemin="${(x) => x.min}"
65
+ aria-valuemax="${(x) => x.max}"
66
+ class="${getClasses}"
67
+ >
68
+ <div class="progress">
69
+ ${when((x) => typeof x.value === "number", determinate())}
70
+ ${when((x) => typeof x.value !== "number", indeterminate())}
71
+ </div>
72
+ </div>
73
+ `;
435
74
  };
436
75
 
437
- const radioGroupDefinition = RadioGroup.compose({
438
- baseName: "radio-group",
439
- template: RadioGroupTemplate,
76
+ const progressDefinition = Progress.compose({
77
+ baseName: "progress",
78
+ template: ProgressTemplate,
440
79
  styles
441
80
  });
442
- const radioGroupRegistries = [radioGroupDefinition()];
443
- const registerRadioGroup = registerFactory(radioGroupRegistries);
81
+ const progressRegistries = [progressDefinition()];
82
+ const registerProgress = registerFactory(progressRegistries);
444
83
 
445
- export { radioGroupRegistries as a, registerRadioGroup as b, radioGroupDefinition as r };
84
+ export { progressRegistries as a, progressDefinition as p, registerProgress as r };