@vonage/vivid 3.0.0-next.3 → 3.0.0-next.30

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 (143) hide show
  1. package/README.md +49 -4
  2. package/accordion/index.js +61 -0
  3. package/accordion-item/index.js +133 -0
  4. package/action-group/index.js +49 -0
  5. package/badge/index.js +27 -22
  6. package/banner/index.js +148 -0
  7. package/breadcrumb/index.js +41 -150
  8. package/breadcrumb-item/index.js +18 -8
  9. package/button/index.js +40 -663
  10. package/calendar/index.js +1550 -0
  11. package/calendar-event/index.js +117 -0
  12. package/card/index.js +134 -0
  13. package/checkbox/index.js +176 -0
  14. package/elevation/index.js +4 -38
  15. package/fab/index.js +101 -0
  16. package/focus/index.js +20 -3
  17. package/header/index.js +68 -0
  18. package/icon/index.js +40 -5
  19. package/index.d.ts +1 -0
  20. package/index.js +50 -14
  21. package/layout/index.js +5 -5
  22. package/lib/accordion/accordion.d.ts +9 -0
  23. package/lib/accordion/accordion.template.d.ts +4 -0
  24. package/lib/accordion/index.d.ts +2 -0
  25. package/lib/accordion-item/accordion-item.d.ts +13 -0
  26. package/lib/accordion-item/accordion-item.template.d.ts +4 -0
  27. package/lib/accordion-item/index.d.ts +4 -0
  28. package/lib/action-group/action-group.d.ts +10 -0
  29. package/lib/action-group/action-group.template.d.ts +4 -0
  30. package/lib/action-group/index.d.ts +2 -0
  31. package/lib/badge/badge.d.ts +8 -8
  32. package/lib/badge/index.d.ts +1 -1
  33. package/lib/banner/banner.d.ts +20 -0
  34. package/lib/banner/banner.template.d.ts +4 -0
  35. package/lib/banner/index.d.ts +3 -0
  36. package/lib/breadcrumb/breadcrumb.template.d.ts +4 -0
  37. package/lib/breadcrumb-item/breadcrumb-item.d.ts +1 -1
  38. package/lib/breadcrumb-item/breadcrumb-item.template.d.ts +0 -1
  39. package/lib/breadcrumb-item/index.d.ts +2 -0
  40. package/lib/button/button.d.ts +9 -8
  41. package/lib/button/index.d.ts +2 -19
  42. package/lib/calendar/calendar.d.ts +13 -0
  43. package/lib/calendar/calendar.template.d.ts +4 -0
  44. package/lib/calendar/helpers/calendar.date-functions.d.ts +2 -0
  45. package/lib/calendar/helpers/calendar.event-context.d.ts +6 -0
  46. package/lib/calendar/helpers/calendar.keyboard-interactions.d.ts +9 -0
  47. package/lib/calendar/index.d.ts +2 -0
  48. package/lib/calendar-event/calendar-event.d.ts +14 -0
  49. package/lib/calendar-event/calendar-event.template.d.ts +4 -0
  50. package/lib/calendar-event/index.d.ts +2 -0
  51. package/lib/card/card.d.ts +10 -0
  52. package/lib/card/card.template.d.ts +4 -0
  53. package/lib/card/index.d.ts +4 -0
  54. package/lib/checkbox/checkbox.d.ts +5 -0
  55. package/lib/checkbox/checkbox.template.d.ts +4 -0
  56. package/lib/checkbox/index.d.ts +4 -0
  57. package/lib/components.d.ts +23 -5
  58. package/lib/elevation/elevation.d.ts +2 -1
  59. package/lib/elevation/index.d.ts +1 -1
  60. package/lib/enums.d.ts +14 -7
  61. package/lib/fab/fab.d.ts +13 -0
  62. package/lib/fab/fab.template.d.ts +4 -0
  63. package/lib/fab/index.d.ts +4 -0
  64. package/lib/focus/index.d.ts +1 -1
  65. package/lib/header/header.d.ts +5 -0
  66. package/lib/header/header.template.d.ts +4 -0
  67. package/lib/header/index.d.ts +3 -0
  68. package/lib/icon/icon.d.ts +4 -5
  69. package/lib/layout/index.d.ts +1 -1
  70. package/lib/layout/layout.d.ts +3 -3
  71. package/lib/note/index.d.ts +2 -0
  72. package/lib/note/note.d.ts +10 -0
  73. package/lib/note/note.template.d.ts +5 -0
  74. package/lib/popup/index.d.ts +4 -0
  75. package/lib/popup/popup.d.ts +17 -0
  76. package/lib/popup/popup.template.d.ts +4 -0
  77. package/lib/progress/index.d.ts +2 -0
  78. package/lib/progress/progress.d.ts +9 -0
  79. package/lib/progress/progress.template.d.ts +5 -0
  80. package/lib/progress-ring/index.d.ts +2 -0
  81. package/lib/progress-ring/progress-ring.d.ts +7 -0
  82. package/lib/progress-ring/progress-ring.template.d.ts +4 -0
  83. package/lib/side-drawer/index.d.ts +2 -0
  84. package/lib/side-drawer/side-drawer.d.ts +7 -0
  85. package/lib/side-drawer/side-drawer.template.d.ts +4 -0
  86. package/lib/sidenav/index.d.ts +2 -0
  87. package/lib/sidenav/sidenav.d.ts +3 -0
  88. package/lib/sidenav/sidenav.template.d.ts +4 -0
  89. package/lib/sidenav-item/index.d.ts +1 -0
  90. package/lib/sidenav-item/sidenav-item.d.ts +4 -5
  91. package/lib/text/index.d.ts +2 -0
  92. package/lib/text/text.d.ts +10 -0
  93. package/lib/text/text.template.d.ts +4 -0
  94. package/lib/text-anchor/text-anchor.d.ts +4 -1
  95. package/lib/text-field/index.d.ts +4 -0
  96. package/lib/text-field/text-field.d.ts +23 -0
  97. package/lib/text-field/text-field.template.d.ts +5 -0
  98. package/lib/tooltip/index.d.ts +3 -0
  99. package/lib/tooltip/tooltip.d.ts +8 -0
  100. package/lib/tooltip/tooltip.template.d.ts +4 -0
  101. package/note/index.js +68 -0
  102. package/package.json +36 -6
  103. package/popup/index.js +2110 -0
  104. package/progress/index.js +107 -0
  105. package/progress-ring/index.js +82 -0
  106. package/shared/_has.js +58 -0
  107. package/shared/affix.js +10 -25
  108. package/shared/anchor.js +10 -3
  109. package/shared/aria-global.js +20 -20
  110. package/shared/base-progress.js +70 -0
  111. package/shared/breadcrumb-item.js +2 -2
  112. package/shared/button.js +195 -0
  113. package/shared/calendar-event.js +26 -0
  114. package/shared/enums.js +79 -0
  115. package/shared/es.object.assign.js +69 -0
  116. package/shared/export.js +972 -0
  117. package/shared/focus.js +5 -0
  118. package/shared/focus2.js +11 -0
  119. package/shared/form-associated.js +547 -0
  120. package/shared/icon.js +1389 -0
  121. package/shared/index.js +4940 -1426
  122. package/shared/index2.js +27 -4901
  123. package/shared/iterators.js +61 -0
  124. package/shared/object-keys.js +13 -0
  125. package/shared/patterns/affix.d.ts +3 -4
  126. package/shared/patterns/focus.d.ts +3 -0
  127. package/shared/patterns/index.d.ts +1 -0
  128. package/shared/slotted.js +119 -0
  129. package/shared/text-anchor.js +12 -0
  130. package/shared/text-anchor.template.js +16 -6
  131. package/shared/to-string.js +51 -0
  132. package/shared/web.dom-collections.iterator.js +46 -1059
  133. package/shared/when.js +15 -0
  134. package/side-drawer/index.js +82 -0
  135. package/sidenav/index.js +17 -0
  136. package/sidenav-item/index.js +24 -61
  137. package/styles/themes/dark.css +16 -4
  138. package/styles/themes/light.css +16 -4
  139. package/text/index.js +48 -0
  140. package/text-anchor/index.js +13 -13
  141. package/text-field/index.js +411 -0
  142. package/tooltip/index.js +70 -0
  143. package/shared/index3.js +0 -21
@@ -0,0 +1,107 @@
1
+ import { _ as __decorate, a as attr, b as __metadata, h as html, d as designSystem } from '../shared/index.js';
2
+ import { s as styleInject } from '../shared/style-inject.es.js';
3
+ import '../shared/web.dom-collections.iterator.js';
4
+ import { c as classofRaw, _ as _export, f as functionUncurryThis } from '../shared/export.js';
5
+ import { B as BaseProgress } from '../shared/base-progress.js';
6
+ import { w as when } from '../shared/when.js';
7
+ import { c as classNames } from '../shared/class-names.js';
8
+ import '../shared/object-keys.js';
9
+ import '../shared/iterators.js';
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.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
+ styleInject(css_248z);
13
+
14
+ var classof = classofRaw;
15
+
16
+ // `IsArray` abstract operation
17
+ // https://tc39.es/ecma262/#sec-isarray
18
+ // eslint-disable-next-line es-x/no-array-isarray -- safe
19
+ var isArray$1 = Array.isArray || function isArray(argument) {
20
+ return classof(argument) == 'Array';
21
+ };
22
+
23
+ var $ = _export;
24
+ var uncurryThis = functionUncurryThis;
25
+ var isArray = isArray$1;
26
+
27
+ var un$Reverse = uncurryThis([].reverse);
28
+ var test = [1, 2];
29
+
30
+ // `Array.prototype.reverse` method
31
+ // https://tc39.es/ecma262/#sec-array.prototype.reverse
32
+ // fix for Safari 12.0 bug
33
+ // https://bugs.webkit.org/show_bug.cgi?id=188794
34
+ $({ target: 'Array', proto: true, forced: String(test) === String(test.reverse()) }, {
35
+ reverse: function reverse() {
36
+ // eslint-disable-next-line no-self-assign -- dirty hack
37
+ if (isArray(this)) this.length = this.length;
38
+ return un$Reverse(this);
39
+ }
40
+ });
41
+
42
+ class Progress extends BaseProgress {
43
+ constructor() {
44
+ super(...arguments);
45
+ this.reverse = false;
46
+ }
47
+
48
+ }
49
+
50
+ __decorate([attr(), __metadata("design:type", String)], Progress.prototype, "shape", void 0);
51
+
52
+ __decorate([attr(), __metadata("design:type", String)], Progress.prototype, "connotation", void 0);
53
+
54
+ __decorate([attr({
55
+ mode: 'boolean'
56
+ }), __metadata("design:type", Object)], Progress.prototype, "reverse", void 0);
57
+
58
+ let _2 = t => t,
59
+ _t,
60
+ _t2,
61
+ _t3;
62
+
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)]);
69
+
70
+ function determinate() {
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`
85
+ <div
86
+ role="progressbar"
87
+ aria-valuenow="${0}"
88
+ aria-valuemin="${0}"
89
+ aria-valuemax="${0}"
90
+ class="${0}"
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()));
98
+ };
99
+
100
+ const vividProgress = Progress.compose({
101
+ baseName: 'progress',
102
+ template: ProgressTemplate,
103
+ styles: css_248z
104
+ });
105
+ designSystem.register(vividProgress());
106
+
107
+ export { vividProgress };
@@ -0,0 +1,82 @@
1
+ import { _ as __decorate, a as attr, b as __metadata, h as html, d as designSystem } from '../shared/index.js';
2
+ import { s as styleInject } from '../shared/style-inject.es.js';
3
+ import { B as BaseProgress } from '../shared/base-progress.js';
4
+ import { w as when } from '../shared/when.js';
5
+ import { c as classNames } from '../shared/class-names.js';
6
+
7
+ var css_248z = ".base {\n align-items: center;\n block-size: var(--_density);\n color: var(--_appearance-color-text);\n inline-size: var(--_density);\n outline: none;\n}\n.base.connotation-cta {\n --_connotation-color-primary: var(--vvd-color-cta);\n}\n.base.connotation-alert {\n --_connotation-color-primary: var(--vvd-color-alert);\n}\n.base.connotation-success {\n --_connotation-color-primary: var(--vvd-color-success);\n}\n.base:not(.connotation-cta, .connotation-alert, .connotation-success) {\n --_connotation-color-primary: var(--vvd-color-on-canvas);\n}\n.base {\n --_appearance-color-text: var(--_connotation-color-primary);\n --_appearance-color-fill: transaprent;\n --_appearance-color-outline: transaprent;\n}\n.base:where(:disabled, .disabled) {\n --_appearance-color-text: var(--vvd-color-neutral-50);\n --_appearance-color-fill: transaprent;\n --_appearance-color-outline: transaprent;\n}\n.base.density-4 {\n --_density: calc(4 * 4px);\n}\n.base.density-5 {\n --_density: calc(5 * 4px);\n}\n.base.density-6 {\n --_density: calc(6 * 4px);\n}\n.base.density-7 {\n --_density: calc(7 * 4px);\n}\n.base.density-8 {\n --_density: calc(8 * 4px);\n}\n.base.density-10 {\n --_density: calc(10 * 4px);\n}\n.base.density-11 {\n --_density: calc(11 * 4px);\n}\n.base.density-12 {\n --_density: calc(12 * 4px);\n}\n.base:not(.density-4, .density-5, .density-6, .density-7, .density-8, .density-10, .density-11, .density-12) {\n --_density: calc(9 * 4px);\n}\n\n.progress {\n width: 100%;\n height: 100%;\n}\n\n.background {\n fill: none;\n stroke: transparent;\n stroke-width: 2px;\n}\n\n.determinate {\n fill: none;\n stroke: currentColor;\n stroke-linecap: round;\n stroke-width: 2px;\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: 2px;\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}";
8
+ styleInject(css_248z);
9
+
10
+ class ProgressRing extends BaseProgress {}
11
+
12
+ __decorate([attr, __metadata("design:type", String)], ProgressRing.prototype, "connotation", void 0);
13
+
14
+ __decorate([attr, __metadata("design:type", Number)], ProgressRing.prototype, "density", void 0);
15
+
16
+ let _2 = t => t,
17
+ _t,
18
+ _t2,
19
+ _t3;
20
+
21
+ const getClasses = ({
22
+ connotation,
23
+ density,
24
+ paused
25
+ }) => classNames('base', ['disabled', !!paused], [`connotation-${connotation}`, !!connotation], [`density-${(density ? Number(density) : 0) + 9}`, !!density]);
26
+
27
+ const progressSegments = 44;
28
+ const ProgressRingTemplate = _ => html(_t || (_t = _2`
29
+ <div
30
+ role="progressbar"
31
+ aria-valuenow="${0}"
32
+ aria-valuemin="${0}"
33
+ aria-valuemax="${0}"
34
+ class="${0} ${0}"
35
+ >
36
+ ${0}
37
+ ${0}
38
+ </div>
39
+ `), x => x.value, x => x.min, x => x.max, x => x.paused ? 'paused' : '', getClasses, when(x => typeof x.value === 'number', html(_t2 || (_t2 = _2`
40
+ <svg
41
+ class="progress"
42
+ viewBox="0 0 16 16"
43
+ >
44
+ <circle
45
+ class="background"
46
+ cx="8px"
47
+ cy="8px"
48
+ r="7px"
49
+ ></circle>
50
+ <circle
51
+ class="determinate"
52
+ style="stroke-dasharray: ${0}px ${0}px"
53
+ cx="8px"
54
+ cy="8px"
55
+ r="7px"
56
+ ></circle>
57
+ </svg>
58
+ `), x => progressSegments * x.percentComplete / 100, progressSegments)), when(x => typeof x.value !== 'number', html(_t3 || (_t3 = _2`
59
+ <svg class="progress" viewBox="0 0 16 16">
60
+ <circle
61
+ class="background"
62
+ cx="8px"
63
+ cy="8px"
64
+ r="7px"
65
+ ></circle>
66
+ <circle
67
+ class="indeterminate-indicator-1"
68
+ cx="8px"
69
+ cy="8px"
70
+ r="7px"
71
+ ></circle>
72
+ </svg>
73
+ `))));
74
+
75
+ const vividProgressRing = ProgressRing.compose({
76
+ baseName: 'progress-ring',
77
+ template: ProgressRingTemplate,
78
+ styles: css_248z
79
+ });
80
+ designSystem.register(vividProgressRing());
81
+
82
+ export { vividProgressRing };
package/shared/_has.js ADDED
@@ -0,0 +1,58 @@
1
+ function _isPlaceholder(a) {
2
+ return a != null && typeof a === 'object' && a['@@functional/placeholder'] === true;
3
+ }
4
+
5
+ /**
6
+ * Optimized internal one-arity curry function.
7
+ *
8
+ * @private
9
+ * @category Function
10
+ * @param {Function} fn The function to curry.
11
+ * @return {Function} The curried function.
12
+ */
13
+
14
+ function _curry1(fn) {
15
+ return function f1(a) {
16
+ if (arguments.length === 0 || _isPlaceholder(a)) {
17
+ return f1;
18
+ } else {
19
+ return fn.apply(this, arguments);
20
+ }
21
+ };
22
+ }
23
+
24
+ /**
25
+ * Optimized internal two-arity curry function.
26
+ *
27
+ * @private
28
+ * @category Function
29
+ * @param {Function} fn The function to curry.
30
+ * @return {Function} The curried function.
31
+ */
32
+
33
+ function _curry2(fn) {
34
+ return function f2(a, b) {
35
+ switch (arguments.length) {
36
+ case 0:
37
+ return f2;
38
+
39
+ case 1:
40
+ return _isPlaceholder(a) ? f2 : _curry1(function (_b) {
41
+ return fn(a, _b);
42
+ });
43
+
44
+ default:
45
+ return _isPlaceholder(a) && _isPlaceholder(b) ? f2 : _isPlaceholder(a) ? _curry1(function (_a) {
46
+ return fn(_a, b);
47
+ }) : _isPlaceholder(b) ? _curry1(function (_b) {
48
+ return fn(a, _b);
49
+ }) : fn(a, b);
50
+ }
51
+ };
52
+ }
53
+
54
+ function _has(prop, obj) {
55
+ return Object.prototype.hasOwnProperty.call(obj, prop);
56
+ }
57
+
58
+ export { _curry1 as _, _curry2 as a, _has as b };
package/shared/affix.js CHANGED
@@ -1,18 +1,14 @@
1
1
  import './web.dom-collections.iterator.js';
2
- import { _ as __decorate, a as attr, b as __metadata, h as html } from './index2.js';
3
- import { I as Icon } from './index.js';
4
- import { c as classNames } from './class-names.js';
2
+ import { _ as __decorate, a as attr, b as __metadata, h as html } from './index.js';
3
+ import { I as Icon } from './icon.js';
5
4
 
6
5
  let _ = t => t,
7
- _t,
8
- _t2,
9
- _t3,
10
- _t4;
11
- class Prefix {}
6
+ _t;
7
+ class AffixIcon {}
12
8
 
13
- __decorate([attr, __metadata("design:type", String)], Prefix.prototype, "icon", void 0);
9
+ __decorate([attr, __metadata("design:type", String)], AffixIcon.prototype, "icon", void 0);
14
10
 
15
- class PrefixOrSuffix extends Prefix {
11
+ class AffixIconWithTrailing extends AffixIcon {
16
12
  constructor() {
17
13
  super(...arguments);
18
14
  this.iconTrailing = false;
@@ -23,22 +19,11 @@ class PrefixOrSuffix extends Prefix {
23
19
  __decorate([attr({
24
20
  mode: 'boolean',
25
21
  attribute: 'icon-trailing'
26
- }), __metadata("design:type", Object)], PrefixOrSuffix.prototype, "iconTrailing", void 0);
22
+ }), __metadata("design:type", Object)], AffixIconWithTrailing.prototype, "iconTrailing", void 0);
27
23
 
28
- const prefixTemplate = context => {
24
+ const affixIconTemplateFactory = context => {
29
25
  const iconTag = context.tagFor(Icon);
30
- const iconTemplate = html(_t || (_t = _`<span class="icon"><${0} :type="${0}"></${0}></span>`), iconTag, x => x.icon, iconTag);
31
- return html(_t2 || (_t2 = _`${0}`), x => x.icon ? iconTemplate : '');
32
- };
33
- const prefixOrSuffixTemplate = context => {
34
- const iconTag = context.tagFor(Icon);
35
-
36
- const classes = ({
37
- iconTrailing
38
- }) => classNames('icon', ['icon-trailing', iconTrailing]);
39
-
40
- const iconTemplate = html(_t3 || (_t3 = _`<span class="${0}"><${0} :type="${0}"></${0}></span>`), classes, iconTag, x => x.icon, iconTag);
41
- return html(_t4 || (_t4 = _`${0}`), x => x.icon ? iconTemplate : '');
26
+ return icon => icon ? html(_t || (_t = _`<span class="icon"><${0} :type="${0}"></${0}></span>`), iconTag, () => icon, iconTag) : null;
42
27
  };
43
28
 
44
- export { PrefixOrSuffix as P, Prefix as a, prefixTemplate as b, prefixOrSuffixTemplate as p };
29
+ export { AffixIconWithTrailing as A, affixIconTemplateFactory as a, AffixIcon as b };
package/shared/anchor.js CHANGED
@@ -1,4 +1,4 @@
1
- import { F as FoundationElement, _ as __decorate, a as attr, o as observable } from './index2.js';
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
3
  import { A as ARIAGlobalStatesAndProperties, S as StartEnd } from './aria-global.js';
4
4
 
@@ -6,6 +6,12 @@ import { A as ARIAGlobalStatesAndProperties, S as StartEnd } from './aria-global
6
6
  * An Anchor Custom HTML Element.
7
7
  * Based largely on the {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a | <a> element }.
8
8
  *
9
+ * @slot start - Content which can be provided before the anchor content
10
+ * @slot end - Content which can be provided after the anchor content
11
+ * @slot - The default slot for anchor content
12
+ * @csspart control - The anchor element
13
+ * @csspart content - The element wrapping anchor content
14
+ *
9
15
  * @public
10
16
  */
11
17
  class Anchor extends FoundationElement {
@@ -20,7 +26,8 @@ class Anchor extends FoundationElement {
20
26
  var _a;
21
27
  // Check to see if delegatesFocus is supported
22
28
  if (window.ShadowRoot &&
23
- !window.ShadowRoot.prototype.hasOwnProperty("delegatesFocus") && ((_a = this.$fastController.definition.shadowOptions) === null || _a === void 0 ? void 0 : _a.delegatesFocus)) {
29
+ !window.ShadowRoot.prototype.hasOwnProperty("delegatesFocus") &&
30
+ ((_a = this.$fastController.definition.shadowOptions) === null || _a === void 0 ? void 0 : _a.delegatesFocus)) {
24
31
  this.focus = () => {
25
32
  this.control.focus();
26
33
  };
@@ -70,7 +77,7 @@ __decorate([
70
77
  class DelegatesARIALink {
71
78
  }
72
79
  __decorate([
73
- attr({ attribute: "aria-expanded", mode: "fromView" })
80
+ attr({ attribute: "aria-expanded" })
74
81
  ], DelegatesARIALink.prototype, "ariaExpanded", void 0);
75
82
  applyMixins(DelegatesARIALink, ARIAGlobalStatesAndProperties);
76
83
  applyMixins(Anchor, StartEnd, DelegatesARIALink);
@@ -1,4 +1,4 @@
1
- import { A as AttachedBehaviorHTMLDirective, h as html, _ as __decorate, a as attr } from './index2.js';
1
+ import { A as AttachedBehaviorHTMLDirective, h as html, _ as __decorate, a as attr } from './index.js';
2
2
 
3
3
  /**
4
4
  * The runtime behavior for template references.
@@ -96,61 +96,61 @@ html `
96
96
  class ARIAGlobalStatesAndProperties {
97
97
  }
98
98
  __decorate([
99
- attr({ attribute: "aria-atomic", mode: "fromView" })
99
+ attr({ attribute: "aria-atomic" })
100
100
  ], ARIAGlobalStatesAndProperties.prototype, "ariaAtomic", void 0);
101
101
  __decorate([
102
- attr({ attribute: "aria-busy", mode: "fromView" })
102
+ attr({ attribute: "aria-busy" })
103
103
  ], ARIAGlobalStatesAndProperties.prototype, "ariaBusy", void 0);
104
104
  __decorate([
105
- attr({ attribute: "aria-controls", mode: "fromView" })
105
+ attr({ attribute: "aria-controls" })
106
106
  ], ARIAGlobalStatesAndProperties.prototype, "ariaControls", void 0);
107
107
  __decorate([
108
- attr({ attribute: "aria-current", mode: "fromView" })
108
+ attr({ attribute: "aria-current" })
109
109
  ], ARIAGlobalStatesAndProperties.prototype, "ariaCurrent", void 0);
110
110
  __decorate([
111
- attr({ attribute: "aria-describedby", mode: "fromView" })
111
+ attr({ attribute: "aria-describedby" })
112
112
  ], ARIAGlobalStatesAndProperties.prototype, "ariaDescribedby", void 0);
113
113
  __decorate([
114
- attr({ attribute: "aria-details", mode: "fromView" })
114
+ attr({ attribute: "aria-details" })
115
115
  ], ARIAGlobalStatesAndProperties.prototype, "ariaDetails", void 0);
116
116
  __decorate([
117
- attr({ attribute: "aria-disabled", mode: "fromView" })
117
+ attr({ attribute: "aria-disabled" })
118
118
  ], ARIAGlobalStatesAndProperties.prototype, "ariaDisabled", void 0);
119
119
  __decorate([
120
- attr({ attribute: "aria-errormessage", mode: "fromView" })
120
+ attr({ attribute: "aria-errormessage" })
121
121
  ], ARIAGlobalStatesAndProperties.prototype, "ariaErrormessage", void 0);
122
122
  __decorate([
123
- attr({ attribute: "aria-flowto", mode: "fromView" })
123
+ attr({ attribute: "aria-flowto" })
124
124
  ], ARIAGlobalStatesAndProperties.prototype, "ariaFlowto", void 0);
125
125
  __decorate([
126
- attr({ attribute: "aria-haspopup", mode: "fromView" })
126
+ attr({ attribute: "aria-haspopup" })
127
127
  ], ARIAGlobalStatesAndProperties.prototype, "ariaHaspopup", void 0);
128
128
  __decorate([
129
- attr({ attribute: "aria-hidden", mode: "fromView" })
129
+ attr({ attribute: "aria-hidden" })
130
130
  ], ARIAGlobalStatesAndProperties.prototype, "ariaHidden", void 0);
131
131
  __decorate([
132
- attr({ attribute: "aria-invalid", mode: "fromView" })
132
+ attr({ attribute: "aria-invalid" })
133
133
  ], ARIAGlobalStatesAndProperties.prototype, "ariaInvalid", void 0);
134
134
  __decorate([
135
- attr({ attribute: "aria-keyshortcuts", mode: "fromView" })
135
+ attr({ attribute: "aria-keyshortcuts" })
136
136
  ], ARIAGlobalStatesAndProperties.prototype, "ariaKeyshortcuts", void 0);
137
137
  __decorate([
138
- attr({ attribute: "aria-label", mode: "fromView" })
138
+ attr({ attribute: "aria-label" })
139
139
  ], ARIAGlobalStatesAndProperties.prototype, "ariaLabel", void 0);
140
140
  __decorate([
141
- attr({ attribute: "aria-labelledby", mode: "fromView" })
141
+ attr({ attribute: "aria-labelledby" })
142
142
  ], ARIAGlobalStatesAndProperties.prototype, "ariaLabelledby", void 0);
143
143
  __decorate([
144
- attr({ attribute: "aria-live", mode: "fromView" })
144
+ attr({ attribute: "aria-live" })
145
145
  ], ARIAGlobalStatesAndProperties.prototype, "ariaLive", void 0);
146
146
  __decorate([
147
- attr({ attribute: "aria-owns", mode: "fromView" })
147
+ attr({ attribute: "aria-owns" })
148
148
  ], ARIAGlobalStatesAndProperties.prototype, "ariaOwns", void 0);
149
149
  __decorate([
150
- attr({ attribute: "aria-relevant", mode: "fromView" })
150
+ attr({ attribute: "aria-relevant" })
151
151
  ], ARIAGlobalStatesAndProperties.prototype, "ariaRelevant", void 0);
152
152
  __decorate([
153
- attr({ attribute: "aria-roledescription", mode: "fromView" })
153
+ attr({ attribute: "aria-roledescription" })
154
154
  ], ARIAGlobalStatesAndProperties.prototype, "ariaRoledescription", void 0);
155
155
 
156
156
  export { ARIAGlobalStatesAndProperties as A, StartEnd as S, ref as r };
@@ -0,0 +1,70 @@
1
+ import { F as FoundationElement, _ as __decorate, a as attr, n as nullableNumberConverter, o as observable } from './index.js';
2
+
3
+ /**
4
+ * An Progress HTML Element.
5
+ * Implements the {@link https://www.w3.org/TR/wai-aria-1.1/#progressbar | ARIA progressbar }.
6
+ *
7
+ * @slot indeterminate - The slot for a custom indeterminate indicator
8
+ * @csspart progress - Represents the progress element
9
+ * @csspart determinate - The determinate indicator
10
+ * @csspart indeterminate - The indeterminate indicator
11
+ *
12
+ * @public
13
+ */
14
+ class BaseProgress extends FoundationElement {
15
+ constructor() {
16
+ super(...arguments);
17
+ /**
18
+ * Indicates progress in %
19
+ * @internal
20
+ */
21
+ this.percentComplete = 0;
22
+ }
23
+ valueChanged() {
24
+ if (this.$fastController.isConnected) {
25
+ this.updatePercentComplete();
26
+ }
27
+ }
28
+ minChanged() {
29
+ if (this.$fastController.isConnected) {
30
+ this.updatePercentComplete();
31
+ }
32
+ }
33
+ maxChanged() {
34
+ if (this.$fastController.isConnected) {
35
+ this.updatePercentComplete();
36
+ }
37
+ }
38
+ /**
39
+ * @internal
40
+ */
41
+ connectedCallback() {
42
+ super.connectedCallback();
43
+ this.updatePercentComplete();
44
+ }
45
+ updatePercentComplete() {
46
+ const min = typeof this.min === "number" ? this.min : 0;
47
+ const max = typeof this.max === "number" ? this.max : 100;
48
+ const value = typeof this.value === "number" ? this.value : 0;
49
+ const range = max - min;
50
+ this.percentComplete =
51
+ range === 0 ? 0 : Math.fround(((value - min) / range) * 100);
52
+ }
53
+ }
54
+ __decorate([
55
+ attr({ converter: nullableNumberConverter })
56
+ ], BaseProgress.prototype, "value", void 0);
57
+ __decorate([
58
+ attr({ converter: nullableNumberConverter })
59
+ ], BaseProgress.prototype, "min", void 0);
60
+ __decorate([
61
+ attr({ converter: nullableNumberConverter })
62
+ ], BaseProgress.prototype, "max", void 0);
63
+ __decorate([
64
+ attr({ mode: "boolean" })
65
+ ], BaseProgress.prototype, "paused", void 0);
66
+ __decorate([
67
+ observable
68
+ ], BaseProgress.prototype, "percentComplete", void 0);
69
+
70
+ export { BaseProgress as B };
@@ -1,6 +1,6 @@
1
- import { _ as __decorate, o as observable } from './index2.js';
2
- import { a as applyMixins } from './apply-mixins.js';
1
+ import { _ as __decorate, o as observable } from './index.js';
3
2
  import { A as Anchor, D as DelegatesARIALink } from './anchor.js';
3
+ import { a as applyMixins } from './apply-mixins.js';
4
4
  import { S as StartEnd } from './aria-global.js';
5
5
 
6
6
  /**