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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (133) hide show
  1. package/README.md +49 -4
  2. package/accordion/index.js +61 -0
  3. package/accordion-item/index.js +128 -0
  4. package/action-group/index.js +34 -0
  5. package/badge/index.js +27 -22
  6. package/banner/index.js +149 -0
  7. package/breadcrumb/index.js +103 -0
  8. package/breadcrumb-item/index.js +26 -11
  9. package/button/index.js +41 -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/elevation/index.js +8 -15
  14. package/fab/index.js +99 -0
  15. package/focus/index.js +20 -3
  16. package/icon/index.js +40 -5
  17. package/index.d.ts +1 -0
  18. package/index.js +49 -12
  19. package/layout/index.js +5 -5
  20. package/lib/accordion/accordion.d.ts +9 -0
  21. package/lib/accordion/accordion.template.d.ts +4 -0
  22. package/lib/accordion/index.d.ts +2 -0
  23. package/lib/accordion-item/accordion-item.d.ts +13 -0
  24. package/lib/accordion-item/accordion-item.template.d.ts +4 -0
  25. package/lib/accordion-item/index.d.ts +5 -0
  26. package/lib/action-group/action-group.d.ts +9 -0
  27. package/lib/action-group/action-group.template.d.ts +4 -0
  28. package/lib/action-group/index.d.ts +2 -0
  29. package/lib/badge/badge.d.ts +8 -8
  30. package/lib/badge/index.d.ts +1 -1
  31. package/lib/banner/banner.d.ts +20 -0
  32. package/lib/banner/banner.template.d.ts +4 -0
  33. package/lib/banner/index.d.ts +3 -0
  34. package/lib/breadcrumb/breadcrumb.d.ts +3 -0
  35. package/lib/breadcrumb/index.d.ts +2 -0
  36. package/lib/breadcrumb-item/breadcrumb-item.d.ts +3 -3
  37. package/lib/breadcrumb-item/breadcrumb-item.template.d.ts +0 -1
  38. package/lib/breadcrumb-item/index.d.ts +2 -0
  39. package/lib/button/button.d.ts +9 -8
  40. package/lib/button/index.d.ts +2 -19
  41. package/lib/calendar/calendar.d.ts +13 -0
  42. package/lib/calendar/calendar.template.d.ts +4 -0
  43. package/lib/calendar/helpers/calendar.date-functions.d.ts +2 -0
  44. package/lib/calendar/helpers/calendar.event-context.d.ts +6 -0
  45. package/lib/calendar/helpers/calendar.keyboard-interactions.d.ts +9 -0
  46. package/lib/calendar/index.d.ts +2 -0
  47. package/lib/calendar-event/calendar-event.d.ts +14 -0
  48. package/lib/calendar-event/calendar-event.template.d.ts +4 -0
  49. package/lib/calendar-event/index.d.ts +2 -0
  50. package/lib/card/card.d.ts +10 -0
  51. package/lib/card/card.template.d.ts +4 -0
  52. package/lib/card/index.d.ts +4 -0
  53. package/lib/components.d.ts +20 -3
  54. package/lib/elevation/elevation.d.ts +1 -1
  55. package/lib/elevation/index.d.ts +1 -1
  56. package/lib/enums.d.ts +14 -7
  57. package/lib/fab/fab.d.ts +10 -0
  58. package/lib/fab/fab.template.d.ts +4 -0
  59. package/lib/fab/index.d.ts +4 -0
  60. package/lib/focus/index.d.ts +1 -1
  61. package/lib/icon/icon.d.ts +4 -5
  62. package/lib/layout/index.d.ts +1 -1
  63. package/lib/layout/layout.d.ts +3 -3
  64. package/lib/note/index.d.ts +2 -0
  65. package/lib/note/note.d.ts +10 -0
  66. package/lib/note/note.template.d.ts +5 -0
  67. package/lib/popup/index.d.ts +4 -0
  68. package/lib/popup/popup.d.ts +17 -0
  69. package/lib/popup/popup.template.d.ts +4 -0
  70. package/lib/progress/index.d.ts +2 -0
  71. package/lib/progress/progress.d.ts +9 -0
  72. package/lib/progress/progress.template.d.ts +5 -0
  73. package/lib/progress-ring/index.d.ts +2 -0
  74. package/lib/progress-ring/progress-ring.d.ts +7 -0
  75. package/lib/progress-ring/progress-ring.template.d.ts +4 -0
  76. package/lib/side-drawer/index.d.ts +2 -0
  77. package/lib/side-drawer/side-drawer.d.ts +15 -0
  78. package/lib/side-drawer/side-drawer.template.d.ts +4 -0
  79. package/lib/sidenav-item/index.d.ts +1 -0
  80. package/lib/sidenav-item/sidenav-item.d.ts +4 -5
  81. package/lib/text/index.d.ts +2 -0
  82. package/lib/text/text.d.ts +10 -0
  83. package/lib/text/text.template.d.ts +4 -0
  84. package/lib/text-anchor/text-anchor.d.ts +4 -1
  85. package/lib/text-field/index.d.ts +4 -0
  86. package/lib/text-field/text-field.d.ts +21 -0
  87. package/lib/text-field/text-field.template.d.ts +5 -0
  88. package/lib/tooltip/index.d.ts +3 -0
  89. package/lib/tooltip/tooltip.d.ts +8 -0
  90. package/lib/tooltip/tooltip.template.d.ts +4 -0
  91. package/note/index.js +68 -0
  92. package/package.json +37 -6
  93. package/popup/index.js +2111 -0
  94. package/progress/index.js +101 -0
  95. package/progress-ring/index.js +82 -0
  96. package/shared/_has.js +58 -0
  97. package/shared/affix.js +10 -25
  98. package/shared/anchor.js +11 -4
  99. package/shared/aria-global.js +22 -59
  100. package/shared/base-progress.js +70 -0
  101. package/shared/breadcrumb-item.js +25 -0
  102. package/shared/button.js +195 -0
  103. package/shared/calendar-event.js +26 -0
  104. package/shared/enums.js +79 -0
  105. package/shared/es.object.assign.js +69 -0
  106. package/shared/export.js +972 -0
  107. package/shared/focus.js +5 -0
  108. package/shared/focus2.js +11 -0
  109. package/shared/form-associated.js +460 -0
  110. package/shared/icon.js +1389 -0
  111. package/shared/index.js +4940 -1426
  112. package/shared/iterators.js +61 -0
  113. package/shared/object-keys.js +13 -0
  114. package/shared/patterns/affix.d.ts +3 -4
  115. package/shared/patterns/focus.d.ts +3 -0
  116. package/shared/patterns/index.d.ts +1 -0
  117. package/shared/ref.js +41 -0
  118. package/shared/slotted.js +119 -0
  119. package/shared/text-anchor.js +12 -0
  120. package/shared/text-anchor.template.js +18 -20
  121. package/shared/to-string.js +51 -0
  122. package/shared/web.dom-collections.iterator.js +46 -1059
  123. package/shared/when.js +15 -0
  124. package/side-drawer/index.js +8660 -0
  125. package/sidenav-item/index.js +25 -61
  126. package/styles/themes/dark.css +16 -4
  127. package/styles/themes/light.css +16 -4
  128. package/text/index.js +48 -0
  129. package/text-anchor/index.js +13 -2
  130. package/text-field/index.js +398 -0
  131. package/tooltip/index.js +71 -0
  132. package/shared/index2.js +0 -4911
  133. package/shared/index3.js +0 -21
@@ -0,0 +1,101 @@
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.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}";
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 = _ => classNames('base', [`connotation-${_.connotation}`, !!_.connotation], [`shape-${_.shape}`, !!_.shape], ['reverse', _.reverse]);
64
+
65
+ const ProgressTemplate = _ => {
66
+ return html(_t || (_t = _2`
67
+ <div
68
+ role="progressbar"
69
+ aria-valuenow="${0}"
70
+ aria-valuemin="${0}"
71
+ aria-valuemax="${0}"
72
+ class="${0} ${0}"
73
+ >
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
+ };
93
+
94
+ const vividProgress = Progress.compose({
95
+ baseName: 'progress',
96
+ template: ProgressTemplate,
97
+ styles: css_248z
98
+ });
99
+ designSystem.register(vividProgress());
100
+
101
+ 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,9 +77,9 @@ __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);
77
84
 
78
- export { Anchor as A };
85
+ export { Anchor as A, DelegatesARIALink as D };
@@ -1,42 +1,5 @@
1
- import { A as AttachedBehaviorHTMLDirective, h as html, _ as __decorate, a as attr } from './index2.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.
@@ -96,61 +59,61 @@ html `
96
59
  class ARIAGlobalStatesAndProperties {
97
60
  }
98
61
  __decorate([
99
- attr({ attribute: "aria-atomic", mode: "fromView" })
62
+ attr({ attribute: "aria-atomic" })
100
63
  ], ARIAGlobalStatesAndProperties.prototype, "ariaAtomic", void 0);
101
64
  __decorate([
102
- attr({ attribute: "aria-busy", mode: "fromView" })
65
+ attr({ attribute: "aria-busy" })
103
66
  ], ARIAGlobalStatesAndProperties.prototype, "ariaBusy", void 0);
104
67
  __decorate([
105
- attr({ attribute: "aria-controls", mode: "fromView" })
68
+ attr({ attribute: "aria-controls" })
106
69
  ], ARIAGlobalStatesAndProperties.prototype, "ariaControls", void 0);
107
70
  __decorate([
108
- attr({ attribute: "aria-current", mode: "fromView" })
71
+ attr({ attribute: "aria-current" })
109
72
  ], ARIAGlobalStatesAndProperties.prototype, "ariaCurrent", void 0);
110
73
  __decorate([
111
- attr({ attribute: "aria-describedby", mode: "fromView" })
74
+ attr({ attribute: "aria-describedby" })
112
75
  ], ARIAGlobalStatesAndProperties.prototype, "ariaDescribedby", void 0);
113
76
  __decorate([
114
- attr({ attribute: "aria-details", mode: "fromView" })
77
+ attr({ attribute: "aria-details" })
115
78
  ], ARIAGlobalStatesAndProperties.prototype, "ariaDetails", void 0);
116
79
  __decorate([
117
- attr({ attribute: "aria-disabled", mode: "fromView" })
80
+ attr({ attribute: "aria-disabled" })
118
81
  ], ARIAGlobalStatesAndProperties.prototype, "ariaDisabled", void 0);
119
82
  __decorate([
120
- attr({ attribute: "aria-errormessage", mode: "fromView" })
83
+ attr({ attribute: "aria-errormessage" })
121
84
  ], ARIAGlobalStatesAndProperties.prototype, "ariaErrormessage", void 0);
122
85
  __decorate([
123
- attr({ attribute: "aria-flowto", mode: "fromView" })
86
+ attr({ attribute: "aria-flowto" })
124
87
  ], ARIAGlobalStatesAndProperties.prototype, "ariaFlowto", void 0);
125
88
  __decorate([
126
- attr({ attribute: "aria-haspopup", mode: "fromView" })
89
+ attr({ attribute: "aria-haspopup" })
127
90
  ], ARIAGlobalStatesAndProperties.prototype, "ariaHaspopup", void 0);
128
91
  __decorate([
129
- attr({ attribute: "aria-hidden", mode: "fromView" })
92
+ attr({ attribute: "aria-hidden" })
130
93
  ], ARIAGlobalStatesAndProperties.prototype, "ariaHidden", void 0);
131
94
  __decorate([
132
- attr({ attribute: "aria-invalid", mode: "fromView" })
95
+ attr({ attribute: "aria-invalid" })
133
96
  ], ARIAGlobalStatesAndProperties.prototype, "ariaInvalid", void 0);
134
97
  __decorate([
135
- attr({ attribute: "aria-keyshortcuts", mode: "fromView" })
98
+ attr({ attribute: "aria-keyshortcuts" })
136
99
  ], ARIAGlobalStatesAndProperties.prototype, "ariaKeyshortcuts", void 0);
137
100
  __decorate([
138
- attr({ attribute: "aria-label", mode: "fromView" })
101
+ attr({ attribute: "aria-label" })
139
102
  ], ARIAGlobalStatesAndProperties.prototype, "ariaLabel", void 0);
140
103
  __decorate([
141
- attr({ attribute: "aria-labelledby", mode: "fromView" })
104
+ attr({ attribute: "aria-labelledby" })
142
105
  ], ARIAGlobalStatesAndProperties.prototype, "ariaLabelledby", void 0);
143
106
  __decorate([
144
- attr({ attribute: "aria-live", mode: "fromView" })
107
+ attr({ attribute: "aria-live" })
145
108
  ], ARIAGlobalStatesAndProperties.prototype, "ariaLive", void 0);
146
109
  __decorate([
147
- attr({ attribute: "aria-owns", mode: "fromView" })
110
+ attr({ attribute: "aria-owns" })
148
111
  ], ARIAGlobalStatesAndProperties.prototype, "ariaOwns", void 0);
149
112
  __decorate([
150
- attr({ attribute: "aria-relevant", mode: "fromView" })
113
+ attr({ attribute: "aria-relevant" })
151
114
  ], ARIAGlobalStatesAndProperties.prototype, "ariaRelevant", void 0);
152
115
  __decorate([
153
- attr({ attribute: "aria-roledescription", mode: "fromView" })
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 };
@@ -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 };
@@ -0,0 +1,25 @@
1
+ import { _ as __decorate, o as observable } from './index.js';
2
+ import { A as Anchor, D as DelegatesARIALink } from './anchor.js';
3
+ import { a as applyMixins } from './apply-mixins.js';
4
+ import { S as StartEnd } from './aria-global.js';
5
+
6
+ /**
7
+ * A Breadcrumb Item Custom HTML Element.
8
+ *
9
+ * @public
10
+ */
11
+ class BreadcrumbItem extends Anchor {
12
+ constructor() {
13
+ super(...arguments);
14
+ /**
15
+ * @internal
16
+ */
17
+ this.separator = true;
18
+ }
19
+ }
20
+ __decorate([
21
+ observable
22
+ ], BreadcrumbItem.prototype, "separator", void 0);
23
+ applyMixins(BreadcrumbItem, StartEnd, DelegatesARIALink);
24
+
25
+ export { BreadcrumbItem as B };