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

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 (61) hide show
  1. package/README.md +2 -2
  2. package/accordion-item/index.js +12 -7
  3. package/action-group/index.js +19 -4
  4. package/badge/index.js +1 -1
  5. package/banner/index.js +9 -11
  6. package/breadcrumb/index.js +1 -0
  7. package/breadcrumb-item/index.js +11 -4
  8. package/button/index.js +5 -3
  9. package/calendar/index.js +31 -9
  10. package/calendar-event/index.js +19 -32
  11. package/card/index.js +11 -19
  12. package/checkbox/index.js +176 -0
  13. package/elevation/index.js +1 -1
  14. package/fab/index.js +5 -3
  15. package/focus/index.js +1 -1
  16. package/header/index.js +91 -0
  17. package/icon/index.js +1 -1
  18. package/index.js +13 -9
  19. package/lib/accordion-item/index.d.ts +2 -0
  20. package/lib/action-group/action-group.d.ts +1 -0
  21. package/lib/banner/banner.template.d.ts +0 -2
  22. package/lib/banner/index.d.ts +1 -0
  23. package/lib/breadcrumb-item/index.d.ts +1 -0
  24. package/lib/calendar/calendar.d.ts +3 -1
  25. package/lib/calendar/index.d.ts +0 -1
  26. package/lib/calendar-event/calendar-event.d.ts +3 -1
  27. package/lib/card/index.d.ts +0 -1
  28. package/lib/checkbox/checkbox.d.ts +5 -0
  29. package/lib/checkbox/checkbox.template.d.ts +4 -0
  30. package/lib/checkbox/index.d.ts +4 -0
  31. package/lib/components.d.ts +2 -0
  32. package/lib/header/header.d.ts +11 -0
  33. package/lib/header/header.template.d.ts +4 -0
  34. package/lib/header/index.d.ts +2 -0
  35. package/lib/side-drawer/side-drawer.d.ts +8 -1
  36. package/lib/sidenav-item/index.d.ts +1 -0
  37. package/note/index.js +1 -1
  38. package/package.json +7 -3
  39. package/popup/index.js +7 -5
  40. package/progress/index.js +30 -24
  41. package/shared/aria-global.js +3 -40
  42. package/shared/button.js +1 -1
  43. package/shared/calendar-event.js +26 -0
  44. package/shared/es.object.assign.js +1 -1
  45. package/shared/export.js +444 -444
  46. package/shared/focus2.js +2 -459
  47. package/shared/form-associated.js +547 -0
  48. package/shared/icon.js +2 -2
  49. package/shared/index.js +1 -1
  50. package/shared/{object-set-prototype-of.js → iterators.js} +20 -20
  51. package/shared/object-keys.js +1 -1
  52. package/shared/ref.js +41 -0
  53. package/shared/text-anchor.template.js +5 -2
  54. package/shared/to-string.js +1 -1
  55. package/shared/web.dom-collections.iterator.js +2 -2
  56. package/side-drawer/index.js +8587 -11
  57. package/sidenav-item/index.js +7 -6
  58. package/text/index.js +1 -1
  59. package/text-anchor/index.js +4 -1
  60. package/text-field/index.js +7 -5
  61. package/tooltip/index.js +4 -2
package/progress/index.js CHANGED
@@ -1,14 +1,14 @@
1
1
  import { _ as __decorate, a as attr, b as __metadata, h as html, d as designSystem } from '../shared/index.js';
2
2
  import { s as styleInject } from '../shared/style-inject.es.js';
3
3
  import '../shared/web.dom-collections.iterator.js';
4
- import { r as classofRaw, _ as _export, y as functionUncurryThis } from '../shared/export.js';
4
+ import { c as classofRaw, _ as _export, f as functionUncurryThis } from '../shared/export.js';
5
5
  import { B as BaseProgress } from '../shared/base-progress.js';
6
6
  import { w as when } from '../shared/when.js';
7
7
  import { c as classNames } from '../shared/class-names.js';
8
8
  import '../shared/object-keys.js';
9
- import '../shared/object-set-prototype-of.js';
9
+ import '../shared/iterators.js';
10
10
 
11
- var css_248z = ".base {\n height: 6px;\n align-items: center;\n margin: 0;\n outline: none;\n}\n.base:not(.connotation-pacific).connotation-cta {\n --_connotation-color-primary: var(--vvd-color-cta);\n}\n.base:not(.connotation-pacific).connotation-alert {\n --_connotation-color-primary: var(--vvd-color-alert);\n}\n.base:not(.connotation-pacific).connotation-success {\n --_connotation-color-primary: var(--vvd-color-success);\n}\n.base:not(.connotation-pacific):not(.connotation-cta, .connotation-alert, .connotation-success) {\n --_connotation-color-primary: var(--vvd-color-on-canvas);\n}\n.base.connotation-pacific {\n --_connotation-color-primary: linear-gradient(to right, var(--vvd-color-info-30), var(--vvd-color-cta-70));\n}\n\n.indeterminate {\n display: flex;\n overflow: hidden;\n width: 100%;\n height: 100%;\n border-radius: 3px;\n}\n\n.progress {\n position: relative;\n display: flex;\n align-items: center;\n background-color: var(--vvd-color-neutral-20);\n block-size: 100%;\n inline-size: 100%;\n}\n.progress .indeterminate {\n background-color: var(--_connotation-color-primary);\n}\n\n.determinate {\n background-color: var(--_connotation-color-primary);\n block-size: 100%;\n border-radius: 3px;\n transition: all 0.2s ease-in-out;\n}\n.connotation-pacific .determinate {\n background-image: var(--_connotation-color-primary);\n}\n\n.indeterminate-indicator-1, .indeterminate-indicator-2 {\n position: absolute;\n animation: indeterminate-1 2s infinite;\n animation-timing-function: cubic-bezier(0.4, 0, 0.6, 1);\n background-color: var(--vvd-color-neutral-20);\n block-size: 100%;\n inline-size: 30%;\n opacity: 0;\n}\n\n.indeterminate-indicator-2 {\n animation: indeterminate-2 2s infinite;\n inline-size: 60%;\n}\n\n.connotation-pacific .indeterminate-indicator-1, .connotation-pacific .indeterminate-indicator-2 {\n background-image: var(--_connotation-color-primary);\n}\n\n.reverse .indeterminate-indicator-1, .reverse .indeterminate-indicator-2 {\n animation-direction: reverse;\n}\n.reverse .determinate {\n position: absolute;\n right: 0;\n}\n\n.base.shape-sharp .determinate, .base.shape-sharp .indeterminate {\n border-radius: 0;\n}\n\n.base.paused .indeterminate-indicator-1,\n.base.paused .indeterminate-indicator-2 {\n animation-play-state: paused;\n background-color: var(--_connotation-color-primary);\n}\n\n.base.paused .determinate {\n background-color: var(--vvd-color-neutral-40);\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}";
11
+ var css_248z = ".base {\n height: 6px;\n align-items: center;\n margin: 0;\n outline: none;\n}\n.base:not(.connotation-pacific).connotation-cta {\n --_connotation-color-primary: var(--vvd-color-cta);\n}\n.base:not(.connotation-pacific).connotation-alert {\n --_connotation-color-primary: var(--vvd-color-alert);\n}\n.base:not(.connotation-pacific).connotation-success {\n --_connotation-color-primary: var(--vvd-color-success);\n}\n.base:not(.connotation-pacific):not(.connotation-cta, .connotation-alert, .connotation-success) {\n --_connotation-color-primary: var(--vvd-color-on-canvas);\n}\n.base.connotation-pacific {\n --_connotation-color-primary: linear-gradient(to right, var(--vvd-color-info-30), var(--vvd-color-cta-70));\n}\n\n.progress {\n position: relative;\n display: flex;\n overflow: hidden;\n align-items: center;\n background-color: var(--vvd-color-neutral-20);\n block-size: 100%;\n inline-size: 100%;\n /* Shape */\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-color: var(--vvd-color-neutral-40);\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-20);\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}";
12
12
  styleInject(css_248z);
13
13
 
14
14
  var classof = classofRaw;
@@ -60,35 +60,41 @@ let _2 = t => t,
60
60
  _t2,
61
61
  _t3;
62
62
 
63
- const getClasses = _ => classNames('base', [`connotation-${_.connotation}`, !!_.connotation], [`shape-${_.shape}`, !!_.shape], ['reverse', _.reverse]);
63
+ const getClasses = ({
64
+ connotation,
65
+ shape,
66
+ reverse,
67
+ paused
68
+ }) => classNames('base', [`connotation-${connotation}`, Boolean(connotation)], [`shape-${shape}`, Boolean(shape)], ['reverse', Boolean(reverse)], ['paused', Boolean(paused)]);
64
69
 
65
- const ProgressTemplate = _ => {
70
+ function determinate() {
66
71
  return html(_t || (_t = _2`
72
+ <span class="determinate" style="width: ${0}%"></span>`), x => x.percentComplete);
73
+ }
74
+
75
+ function indeterminate() {
76
+ return html(_t2 || (_t2 = _2`
77
+ <span class="indeterminate" name="indeterminate">
78
+ <span class="indicator-1"></span>
79
+ <span class="indicator-2"></span>
80
+ </span>`));
81
+ }
82
+
83
+ const ProgressTemplate = _ => {
84
+ return html(_t3 || (_t3 = _2`
67
85
  <div
68
86
  role="progressbar"
69
87
  aria-valuenow="${0}"
70
88
  aria-valuemin="${0}"
71
89
  aria-valuemax="${0}"
72
- class="${0} ${0}"
90
+ class="${0}"
73
91
  >
74
- ${0}
75
- ${0}
76
- </div>
77
- `), x => x.value, x => x.min, x => x.max, x => x.paused ? 'paused' : '', getClasses, when(x => typeof x.value === 'number', html(_t2 || (_t2 = _2`
78
- <div class="progress">
79
- <div
80
- class="determinate"
81
- style="width: ${0}%"
82
- ></div>
83
- </div>
84
- `), x => x.percentComplete)), when(x => typeof x.value !== 'number', html(_t3 || (_t3 = _2`
85
- <div class="progress indeterminate">
86
- <span class="indeterminate" name="indeterminate">
87
- <span class="indeterminate-indicator-1"></span>
88
- <span class="indeterminate-indicator-2"></span>
89
- </span>
90
- </div>
91
- `))));
92
+ <div class="progress">
93
+ ${0}
94
+ ${0}
95
+ </div>
96
+ </div>
97
+ `), x => x.value, x => x.min, x => x.max, getClasses, when(x => typeof x.value === 'number', determinate()), when(x => typeof x.value !== 'number', indeterminate()));
92
98
  };
93
99
 
94
100
  const vividProgress = Progress.compose({
@@ -1,42 +1,5 @@
1
- import { A as AttachedBehaviorHTMLDirective, h as html, _ as __decorate, a as attr } 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
- }
1
+ import { h as html, _ as __decorate, a as attr } from './index.js';
2
+ import { r as ref } from './ref.js';
40
3
 
41
4
  /**
42
5
  * A mixin class implementing start and end elements.
@@ -153,4 +116,4 @@ __decorate([
153
116
  attr({ attribute: "aria-roledescription" })
154
117
  ], ARIAGlobalStatesAndProperties.prototype, "ariaRoledescription", void 0);
155
118
 
156
- export { ARIAGlobalStatesAndProperties as A, StartEnd as S, ref as r };
119
+ export { ARIAGlobalStatesAndProperties as A, StartEnd as S };
package/shared/button.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { F as FoundationElement, _ as __decorate, a as attr, o as observable } from './index.js';
2
2
  import { a as applyMixins } from './apply-mixins.js';
3
- import { F as FormAssociated } from './focus2.js';
3
+ import { F as FormAssociated } from './form-associated.js';
4
4
  import { A as ARIAGlobalStatesAndProperties, S as StartEnd } from './aria-global.js';
5
5
 
6
6
  class _Button extends FoundationElement {
@@ -0,0 +1,26 @@
1
+ import { F as FoundationElement, _ as __decorate, a as attr, b as __metadata, n as nullableNumberConverter } from './index.js';
2
+
3
+ class CalendarEvent extends FoundationElement {}
4
+
5
+ __decorate([attr, __metadata("design:type", String)], CalendarEvent.prototype, "heading", void 0);
6
+
7
+ __decorate([attr, __metadata("design:type", String)], CalendarEvent.prototype, "description", void 0);
8
+
9
+ __decorate([attr, __metadata("design:type", String)], CalendarEvent.prototype, "connotation", void 0);
10
+
11
+ __decorate([attr, __metadata("design:type", String)], CalendarEvent.prototype, "appearance", void 0);
12
+
13
+ __decorate([attr({
14
+ converter: nullableNumberConverter,
15
+ attribute: 'overlap-count'
16
+ }), __metadata("design:type", Number)], CalendarEvent.prototype, "overlapCount", void 0);
17
+
18
+ __decorate([attr({
19
+ converter: nullableNumberConverter
20
+ }), __metadata("design:type", Number)], CalendarEvent.prototype, "start", void 0);
21
+
22
+ __decorate([attr({
23
+ converter: nullableNumberConverter
24
+ }), __metadata("design:type", Number)], CalendarEvent.prototype, "duration", void 0);
25
+
26
+ export { CalendarEvent as C };
@@ -1,4 +1,4 @@
1
- import { d as descriptors, y as functionUncurryThis, m as functionCall, f as fails$1, g as toObject$1, M as indexedObject, N as objectGetOwnPropertySymbols, O as objectPropertyIsEnumerable, _ as _export } from './export.js';
1
+ import { d as descriptors, f as functionUncurryThis, v as functionCall, e as fails$1, I as toObject$1, M as indexedObject, N as objectGetOwnPropertySymbols, O as objectPropertyIsEnumerable, _ as _export } from './export.js';
2
2
  import { o as objectKeys$1 } from './object-keys.js';
3
3
 
4
4
  var DESCRIPTORS = descriptors;