@vonage/vivid 2.30.0 → 3.0.0-next.12
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.
- package/README.md +7 -0
- package/accordion/index.js +61 -0
- package/accordion-item/index.js +120 -0
- package/badge/index.js +57 -0
- package/banner/index.js +214 -0
- package/breadcrumb/index.js +100 -0
- package/breadcrumb-item/index.js +53 -0
- package/button/index.js +754 -0
- package/calendar/index.js +1522 -0
- package/elevation/index.js +31 -0
- package/focus/index.js +3 -0
- package/icon/index.js +38 -0
- package/index.d.ts +2 -0
- package/index.js +33 -63
- package/layout/index.js +53 -0
- package/lib/accordion/accordion.d.ts +9 -0
- package/lib/accordion/accordion.template.d.ts +4 -0
- package/lib/accordion/index.d.ts +2 -0
- package/lib/accordion-item/accordion-item.d.ts +13 -0
- package/lib/accordion-item/accordion-item.template.d.ts +4 -0
- package/lib/accordion-item/index.d.ts +3 -0
- package/lib/badge/badge.d.ts +17 -0
- package/lib/badge/badge.template.d.ts +4 -0
- package/lib/badge/index.d.ts +3 -0
- package/lib/banner/banner.d.ts +20 -0
- package/lib/banner/banner.template.d.ts +6 -0
- package/lib/banner/index.d.ts +2 -0
- package/lib/breadcrumb/breadcrumb.d.ts +3 -0
- package/lib/breadcrumb/index.d.ts +2 -0
- package/lib/breadcrumb-item/breadcrumb-item.d.ts +5 -0
- package/lib/breadcrumb-item/breadcrumb-item.template.d.ts +4 -0
- package/lib/breadcrumb-item/index.d.ts +3 -0
- package/lib/button/button.d.ts +17 -0
- package/lib/button/button.template.d.ts +4 -0
- package/lib/button/index.d.ts +21 -0
- package/lib/calendar/calendar.d.ts +11 -0
- package/lib/calendar/calendar.template.d.ts +4 -0
- package/lib/calendar/helpers/calendar.date-functions.d.ts +2 -0
- package/lib/calendar/helpers/calendar.event-context.d.ts +6 -0
- package/lib/calendar/helpers/calendar.keyboard-interactions.d.ts +9 -0
- package/lib/calendar/index.d.ts +3 -0
- package/lib/components.d.ts +16 -0
- package/lib/elevation/elevation.d.ts +4 -0
- package/lib/elevation/elevation.template.d.ts +4 -0
- package/lib/elevation/index.d.ts +2 -0
- package/lib/enums.d.ts +46 -0
- package/lib/focus/focus.d.ts +3 -0
- package/lib/focus/focus.template.d.ts +4 -0
- package/lib/focus/index.d.ts +2 -0
- package/lib/icon/icon.d.ts +11 -0
- package/lib/icon/icon.placeholder.d.ts +1 -0
- package/lib/icon/icon.template.d.ts +4 -0
- package/lib/icon/index.d.ts +2 -0
- package/lib/layout/index.d.ts +2 -0
- package/lib/layout/layout.d.ts +16 -0
- package/lib/layout/layout.template.d.ts +4 -0
- package/lib/popup/index.d.ts +4 -0
- package/lib/popup/popup.d.ts +17 -0
- package/lib/popup/popup.template.d.ts +4 -0
- package/lib/progress/index.d.ts +2 -0
- package/lib/progress/progress.d.ts +9 -0
- package/lib/progress/progress.template.d.ts +5 -0
- package/lib/progress-ring/index.d.ts +2 -0
- package/lib/progress-ring/progress-ring.d.ts +6 -0
- package/lib/progress-ring/progress-ring.template.d.ts +4 -0
- package/lib/side-drawer/index.d.ts +2 -0
- package/lib/side-drawer/side-drawer.d.ts +8 -0
- package/lib/side-drawer/side-drawer.template.d.ts +4 -0
- package/lib/sidenav-item/index.d.ts +3 -0
- package/lib/sidenav-item/sidenav-item.d.ts +6 -0
- package/lib/sidenav-item/sidenav-item.template.d.ts +4 -0
- package/lib/text/index.d.ts +2 -0
- package/lib/text/text.d.ts +10 -0
- package/lib/text/text.template.d.ts +4 -0
- package/lib/text-anchor/index.d.ts +2 -0
- package/lib/text-anchor/text-anchor.d.ts +7 -0
- package/lib/text-anchor/text-anchor.template.d.ts +4 -0
- package/lib/tooltip/index.d.ts +3 -0
- package/lib/tooltip/tooltip.d.ts +8 -0
- package/lib/tooltip/tooltip.template.d.ts +4 -0
- package/package.json +13 -317
- package/popup/index.js +2066 -0
- package/progress/index.js +99 -0
- package/progress-ring/index.js +76 -0
- package/shared/_has.js +58 -0
- package/shared/affix.js +29 -0
- package/shared/anchor.js +78 -0
- package/shared/apply-mixins.js +22 -0
- package/shared/aria-global.js +156 -0
- package/shared/base-progress.js +65 -0
- package/shared/breadcrumb-item.js +25 -0
- package/shared/class-names.js +15 -0
- package/shared/design-system/index.d.ts +3 -0
- package/shared/es.object.assign.js +69 -0
- package/shared/icon.js +1388 -0
- package/shared/index.js +4998 -0
- package/shared/index2.js +21 -0
- package/shared/object-set-prototype-of.js +1009 -0
- package/shared/patterns/affix.d.ts +9 -0
- package/shared/patterns/index.d.ts +1 -0
- package/shared/slotted.js +119 -0
- package/shared/style-inject.es.js +28 -0
- package/shared/text-anchor.js +12 -0
- package/shared/text-anchor.template.js +54 -0
- package/shared/web.dom-collections.iterator.js +473 -0
- package/shared/when.js +15 -0
- package/side-drawer/index.js +82 -0
- package/sidenav-item/index.js +39 -0
- package/styles/fonts/spezia.css +23 -0
- package/styles/themes/dark.css +205 -0
- package/styles/themes/light.css +205 -0
- package/text/index.js +46 -0
- package/text-anchor/index.js +20 -0
- package/tooltip/index.js +63 -0
|
@@ -0,0 +1,99 @@
|
|
|
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 { F as classofRaw, _ as _export, C as functionUncurryThis } from '../shared/object-set-prototype-of.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
|
+
|
|
9
|
+
var css_248z = ".base {\n height: 6px;\n align-items: center;\n margin: 0;\n outline: none;\n}\n.base.connotation-cta {\n --connotation: var(--vvd-color-cta);\n --on-connotation: var(--vvd-color-on-cta);\n}\n\n.base:not(.connotation-pacific):not(.connotation-cta):not(.connotation-alert):not(.connotation-success) {\n --connotation: var(--vvd-color-primary);\n --on-connotation: var(--vvd-color-on-primary);\n}\n\n.base.connotation-alert {\n --connotation: var(--vvd-color-alert);\n --on-connotation: var(--vvd-color-on-alert);\n}\n\n.base.connotation-success {\n --connotation: var(--vvd-color-success);\n --on-connotation: var(--vvd-color-on-success);\n}\n\n.base.connotation-pacific {\n --connotation: 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);\n}\n\n.determinate {\n background-color: var(--connotation);\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);\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);\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);\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}";
|
|
10
|
+
styleInject(css_248z);
|
|
11
|
+
|
|
12
|
+
var classof = classofRaw;
|
|
13
|
+
|
|
14
|
+
// `IsArray` abstract operation
|
|
15
|
+
// https://tc39.es/ecma262/#sec-isarray
|
|
16
|
+
// eslint-disable-next-line es/no-array-isarray -- safe
|
|
17
|
+
var isArray$1 = Array.isArray || function isArray(argument) {
|
|
18
|
+
return classof(argument) == 'Array';
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
var $ = _export;
|
|
22
|
+
var uncurryThis = functionUncurryThis;
|
|
23
|
+
var isArray = isArray$1;
|
|
24
|
+
|
|
25
|
+
var un$Reverse = uncurryThis([].reverse);
|
|
26
|
+
var test = [1, 2];
|
|
27
|
+
|
|
28
|
+
// `Array.prototype.reverse` method
|
|
29
|
+
// https://tc39.es/ecma262/#sec-array.prototype.reverse
|
|
30
|
+
// fix for Safari 12.0 bug
|
|
31
|
+
// https://bugs.webkit.org/show_bug.cgi?id=188794
|
|
32
|
+
$({ target: 'Array', proto: true, forced: String(test) === String(test.reverse()) }, {
|
|
33
|
+
reverse: function reverse() {
|
|
34
|
+
// eslint-disable-next-line no-self-assign -- dirty hack
|
|
35
|
+
if (isArray(this)) this.length = this.length;
|
|
36
|
+
return un$Reverse(this);
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
class Progress extends BaseProgress {
|
|
41
|
+
constructor() {
|
|
42
|
+
super(...arguments);
|
|
43
|
+
this.reverse = false;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
__decorate([attr(), __metadata("design:type", String)], Progress.prototype, "shape", void 0);
|
|
49
|
+
|
|
50
|
+
__decorate([attr(), __metadata("design:type", String)], Progress.prototype, "connotation", void 0);
|
|
51
|
+
|
|
52
|
+
__decorate([attr({
|
|
53
|
+
mode: 'boolean'
|
|
54
|
+
}), __metadata("design:type", Object)], Progress.prototype, "reverse", void 0);
|
|
55
|
+
|
|
56
|
+
let _2 = t => t,
|
|
57
|
+
_t,
|
|
58
|
+
_t2,
|
|
59
|
+
_t3;
|
|
60
|
+
|
|
61
|
+
const getClasses = _ => classNames('base', [`connotation-${_.connotation}`, !!_.connotation], [`shape-${_.shape}`, !!_.shape], ['reverse', _.reverse]);
|
|
62
|
+
|
|
63
|
+
const ProgressTemplate = _ => {
|
|
64
|
+
return html(_t || (_t = _2`
|
|
65
|
+
<div
|
|
66
|
+
role="progressbar"
|
|
67
|
+
aria-valuenow="${0}"
|
|
68
|
+
aria-valuemin="${0}"
|
|
69
|
+
aria-valuemax="${0}"
|
|
70
|
+
class="${0} ${0}"
|
|
71
|
+
>
|
|
72
|
+
${0}
|
|
73
|
+
${0}
|
|
74
|
+
</div>
|
|
75
|
+
`), x => x.value, x => x.min, x => x.max, x => x.paused ? 'paused' : '', getClasses, when(x => typeof x.value === 'number', html(_t2 || (_t2 = _2`
|
|
76
|
+
<div class="progress">
|
|
77
|
+
<div
|
|
78
|
+
class="determinate"
|
|
79
|
+
style="width: ${0}%"
|
|
80
|
+
></div>
|
|
81
|
+
</div>
|
|
82
|
+
`), x => x.percentComplete)), when(x => typeof x.value !== 'number', html(_t3 || (_t3 = _2`
|
|
83
|
+
<div class="progress indeterminate">
|
|
84
|
+
<span class="indeterminate" name="indeterminate">
|
|
85
|
+
<span class="indeterminate-indicator-1"></span>
|
|
86
|
+
<span class="indeterminate-indicator-2"></span>
|
|
87
|
+
</span>
|
|
88
|
+
</div>
|
|
89
|
+
`))));
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
const vividProgress = Progress.compose({
|
|
93
|
+
baseName: 'progress',
|
|
94
|
+
template: ProgressTemplate,
|
|
95
|
+
styles: css_248z
|
|
96
|
+
});
|
|
97
|
+
designSystem.register(vividProgress());
|
|
98
|
+
|
|
99
|
+
export { vividProgress };
|
|
@@ -0,0 +1,76 @@
|
|
|
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 width: 36px;\n height: 36px;\n align-items: center;\n outline: none;\n}\n.base.connotation-cta {\n --connotation: var(--vvd-color-cta);\n --on-connotation: var(--vvd-color-on-cta);\n}\n\n.base:not(.connotation-cta):not(.connotation-alert):not(.connotation-success) {\n --connotation: var(--vvd-color-primary);\n --on-connotation: var(--vvd-color-on-primary);\n}\n\n.base.connotation-alert {\n --connotation: var(--vvd-color-alert);\n --on-connotation: var(--vvd-color-on-alert);\n}\n\n.base.connotation-success {\n --connotation: var(--vvd-color-success);\n --on-connotation: var(--vvd-color-on-success);\n}\n\n.base.base-large {\n width: 48px;\n height: 48px;\n}\n\n.base.base-small {\n width: 24px;\n height: 24px;\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: var(--connotation);\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: var(--connotation);\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 stroke: var(--vvd-color-neutral);\n}\n\n.base.paused .determinate {\n stroke: var(--vvd-color-neutral);\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
|
+
let _2 = t => t,
|
|
15
|
+
_t,
|
|
16
|
+
_t2,
|
|
17
|
+
_t3;
|
|
18
|
+
|
|
19
|
+
const getClasses = _ => classNames('base', [`connotation-${_.connotation}`, !!_.connotation]);
|
|
20
|
+
|
|
21
|
+
const progressSegments = 44;
|
|
22
|
+
const ProgressRingTemplate = _ => html(_t || (_t = _2`
|
|
23
|
+
<div
|
|
24
|
+
role="progressbar"
|
|
25
|
+
aria-valuenow="${0}"
|
|
26
|
+
aria-valuemin="${0}"
|
|
27
|
+
aria-valuemax="${0}"
|
|
28
|
+
class="${0} ${0}"
|
|
29
|
+
>
|
|
30
|
+
${0}
|
|
31
|
+
${0}
|
|
32
|
+
</div>
|
|
33
|
+
`), x => x.value, x => x.min, x => x.max, x => x.paused ? 'paused' : '', getClasses, when(x => typeof x.value === 'number', html(_t2 || (_t2 = _2`
|
|
34
|
+
<svg
|
|
35
|
+
class="progress"
|
|
36
|
+
viewBox="0 0 16 16"
|
|
37
|
+
>
|
|
38
|
+
<circle
|
|
39
|
+
class="background"
|
|
40
|
+
cx="8px"
|
|
41
|
+
cy="8px"
|
|
42
|
+
r="7px"
|
|
43
|
+
></circle>
|
|
44
|
+
<circle
|
|
45
|
+
class="determinate"
|
|
46
|
+
style="stroke-dasharray: ${0}px ${0}px"
|
|
47
|
+
cx="8px"
|
|
48
|
+
cy="8px"
|
|
49
|
+
r="7px"
|
|
50
|
+
></circle>
|
|
51
|
+
</svg>
|
|
52
|
+
`), x => progressSegments * x.percentComplete / 100, progressSegments)), when(x => typeof x.value !== 'number', html(_t3 || (_t3 = _2`
|
|
53
|
+
<svg class="progress" viewBox="0 0 16 16">
|
|
54
|
+
<circle
|
|
55
|
+
class="background"
|
|
56
|
+
cx="8px"
|
|
57
|
+
cy="8px"
|
|
58
|
+
r="7px"
|
|
59
|
+
></circle>
|
|
60
|
+
<circle
|
|
61
|
+
class="indeterminate-indicator-1"
|
|
62
|
+
cx="8px"
|
|
63
|
+
cy="8px"
|
|
64
|
+
r="7px"
|
|
65
|
+
></circle>
|
|
66
|
+
</svg>
|
|
67
|
+
`))));
|
|
68
|
+
|
|
69
|
+
const vividProgressRing = ProgressRing.compose({
|
|
70
|
+
baseName: 'progress-ring',
|
|
71
|
+
template: ProgressRingTemplate,
|
|
72
|
+
styles: css_248z
|
|
73
|
+
});
|
|
74
|
+
designSystem.register(vividProgressRing());
|
|
75
|
+
|
|
76
|
+
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
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import './web.dom-collections.iterator.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';
|
|
4
|
+
|
|
5
|
+
let _ = t => t,
|
|
6
|
+
_t;
|
|
7
|
+
class AffixIcon {}
|
|
8
|
+
|
|
9
|
+
__decorate([attr, __metadata("design:type", String)], AffixIcon.prototype, "icon", void 0);
|
|
10
|
+
|
|
11
|
+
class AffixIconWithTrailing extends AffixIcon {
|
|
12
|
+
constructor() {
|
|
13
|
+
super(...arguments);
|
|
14
|
+
this.iconTrailing = false;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
__decorate([attr({
|
|
20
|
+
mode: 'boolean',
|
|
21
|
+
attribute: 'icon-trailing'
|
|
22
|
+
}), __metadata("design:type", Object)], AffixIconWithTrailing.prototype, "iconTrailing", void 0);
|
|
23
|
+
|
|
24
|
+
const affixIconTemplateFactory = context => {
|
|
25
|
+
const iconTag = context.tagFor(Icon);
|
|
26
|
+
return icon => icon ? html(_t || (_t = _`<span class="icon"><${0} :type="${0}"></${0}></span>`), iconTag, () => icon, iconTag) : null;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export { AffixIconWithTrailing as A, affixIconTemplateFactory as a, AffixIcon as b };
|
package/shared/anchor.js
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { F as FoundationElement, _ as __decorate, a as attr, o as observable } from './index.js';
|
|
2
|
+
import { a as applyMixins } from './apply-mixins.js';
|
|
3
|
+
import { A as ARIAGlobalStatesAndProperties, S as StartEnd } from './aria-global.js';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* An Anchor Custom HTML Element.
|
|
7
|
+
* Based largely on the {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a | <a> element }.
|
|
8
|
+
*
|
|
9
|
+
* @public
|
|
10
|
+
*/
|
|
11
|
+
class Anchor extends FoundationElement {
|
|
12
|
+
constructor() {
|
|
13
|
+
super(...arguments);
|
|
14
|
+
/**
|
|
15
|
+
* Overrides the focus call for where delegatesFocus is unsupported.
|
|
16
|
+
* This check works for Chrome, Edge Chromium, FireFox, and Safari
|
|
17
|
+
* Relevant PR on the Firefox browser: https://phabricator.services.mozilla.com/D123858
|
|
18
|
+
*/
|
|
19
|
+
this.handleUnsupportedDelegatesFocus = () => {
|
|
20
|
+
var _a;
|
|
21
|
+
// Check to see if delegatesFocus is supported
|
|
22
|
+
if (window.ShadowRoot &&
|
|
23
|
+
!window.ShadowRoot.prototype.hasOwnProperty("delegatesFocus") && ((_a = this.$fastController.definition.shadowOptions) === null || _a === void 0 ? void 0 : _a.delegatesFocus)) {
|
|
24
|
+
this.focus = () => {
|
|
25
|
+
this.control.focus();
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* @internal
|
|
32
|
+
*/
|
|
33
|
+
connectedCallback() {
|
|
34
|
+
super.connectedCallback();
|
|
35
|
+
this.handleUnsupportedDelegatesFocus();
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
__decorate([
|
|
39
|
+
attr
|
|
40
|
+
], Anchor.prototype, "download", void 0);
|
|
41
|
+
__decorate([
|
|
42
|
+
attr
|
|
43
|
+
], Anchor.prototype, "href", void 0);
|
|
44
|
+
__decorate([
|
|
45
|
+
attr
|
|
46
|
+
], Anchor.prototype, "hreflang", void 0);
|
|
47
|
+
__decorate([
|
|
48
|
+
attr
|
|
49
|
+
], Anchor.prototype, "ping", void 0);
|
|
50
|
+
__decorate([
|
|
51
|
+
attr
|
|
52
|
+
], Anchor.prototype, "referrerpolicy", void 0);
|
|
53
|
+
__decorate([
|
|
54
|
+
attr
|
|
55
|
+
], Anchor.prototype, "rel", void 0);
|
|
56
|
+
__decorate([
|
|
57
|
+
attr
|
|
58
|
+
], Anchor.prototype, "target", void 0);
|
|
59
|
+
__decorate([
|
|
60
|
+
attr
|
|
61
|
+
], Anchor.prototype, "type", void 0);
|
|
62
|
+
__decorate([
|
|
63
|
+
observable
|
|
64
|
+
], Anchor.prototype, "defaultSlottedContent", void 0);
|
|
65
|
+
/**
|
|
66
|
+
* Includes ARIA states and properties relating to the ARIA link role
|
|
67
|
+
*
|
|
68
|
+
* @public
|
|
69
|
+
*/
|
|
70
|
+
class DelegatesARIALink {
|
|
71
|
+
}
|
|
72
|
+
__decorate([
|
|
73
|
+
attr({ attribute: "aria-expanded" })
|
|
74
|
+
], DelegatesARIALink.prototype, "ariaExpanded", void 0);
|
|
75
|
+
applyMixins(DelegatesARIALink, ARIAGlobalStatesAndProperties);
|
|
76
|
+
applyMixins(Anchor, StartEnd, DelegatesARIALink);
|
|
77
|
+
|
|
78
|
+
export { Anchor as A, DelegatesARIALink as D };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Apply mixins to a constructor.
|
|
3
|
+
* Sourced from {@link https://www.typescriptlang.org/docs/handbook/mixins.html | TypeScript Documentation }.
|
|
4
|
+
* @public
|
|
5
|
+
*/
|
|
6
|
+
function applyMixins(derivedCtor, ...baseCtors) {
|
|
7
|
+
baseCtors.forEach(baseCtor => {
|
|
8
|
+
Object.getOwnPropertyNames(baseCtor.prototype).forEach(name => {
|
|
9
|
+
if (name !== "constructor") {
|
|
10
|
+
Object.defineProperty(derivedCtor.prototype, name,
|
|
11
|
+
/* eslint-disable-next-line @typescript-eslint/no-non-null-assertion */
|
|
12
|
+
Object.getOwnPropertyDescriptor(baseCtor.prototype, name));
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
if (baseCtor.attributes) {
|
|
16
|
+
const existing = derivedCtor.attributes || [];
|
|
17
|
+
derivedCtor.attributes = existing.concat(baseCtor.attributes);
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export { applyMixins as a };
|
|
@@ -0,0 +1,156 @@
|
|
|
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
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* A mixin class implementing start and end elements.
|
|
43
|
+
* These are generally used to decorate text elements with icons or other visual indicators.
|
|
44
|
+
* @public
|
|
45
|
+
*/
|
|
46
|
+
class StartEnd {
|
|
47
|
+
handleStartContentChange() {
|
|
48
|
+
this.startContainer.classList.toggle("start", this.start.assignedNodes().length > 0);
|
|
49
|
+
}
|
|
50
|
+
handleEndContentChange() {
|
|
51
|
+
this.endContainer.classList.toggle("end", this.end.assignedNodes().length > 0);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* The template for the end element.
|
|
56
|
+
* For use with {@link StartEnd}
|
|
57
|
+
*
|
|
58
|
+
* @public
|
|
59
|
+
* @deprecated - use endSlotTemplate
|
|
60
|
+
*/
|
|
61
|
+
html `
|
|
62
|
+
<span part="end" ${ref("endContainer")}>
|
|
63
|
+
<slot
|
|
64
|
+
name="end"
|
|
65
|
+
${ref("end")}
|
|
66
|
+
@slotchange="${x => x.handleEndContentChange()}"
|
|
67
|
+
></slot>
|
|
68
|
+
</span>
|
|
69
|
+
`;
|
|
70
|
+
/**
|
|
71
|
+
* The template for the start element.
|
|
72
|
+
* For use with {@link StartEnd}
|
|
73
|
+
*
|
|
74
|
+
* @public
|
|
75
|
+
* @deprecated - use startSlotTemplate
|
|
76
|
+
*/
|
|
77
|
+
html `
|
|
78
|
+
<span part="start" ${ref("startContainer")}>
|
|
79
|
+
<slot
|
|
80
|
+
name="start"
|
|
81
|
+
${ref("start")}
|
|
82
|
+
@slotchange="${x => x.handleStartContentChange()}"
|
|
83
|
+
></slot>
|
|
84
|
+
</span>
|
|
85
|
+
`;
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Some states and properties are applicable to all host language elements regardless of whether a role is applied.
|
|
89
|
+
* The following global states and properties are supported by all roles and by all base markup elements.
|
|
90
|
+
* {@link https://www.w3.org/TR/wai-aria-1.1/#global_states}
|
|
91
|
+
*
|
|
92
|
+
* This is intended to be used as a mixin. Be sure you extend FASTElement.
|
|
93
|
+
*
|
|
94
|
+
* @public
|
|
95
|
+
*/
|
|
96
|
+
class ARIAGlobalStatesAndProperties {
|
|
97
|
+
}
|
|
98
|
+
__decorate([
|
|
99
|
+
attr({ attribute: "aria-atomic" })
|
|
100
|
+
], ARIAGlobalStatesAndProperties.prototype, "ariaAtomic", void 0);
|
|
101
|
+
__decorate([
|
|
102
|
+
attr({ attribute: "aria-busy" })
|
|
103
|
+
], ARIAGlobalStatesAndProperties.prototype, "ariaBusy", void 0);
|
|
104
|
+
__decorate([
|
|
105
|
+
attr({ attribute: "aria-controls" })
|
|
106
|
+
], ARIAGlobalStatesAndProperties.prototype, "ariaControls", void 0);
|
|
107
|
+
__decorate([
|
|
108
|
+
attr({ attribute: "aria-current" })
|
|
109
|
+
], ARIAGlobalStatesAndProperties.prototype, "ariaCurrent", void 0);
|
|
110
|
+
__decorate([
|
|
111
|
+
attr({ attribute: "aria-describedby" })
|
|
112
|
+
], ARIAGlobalStatesAndProperties.prototype, "ariaDescribedby", void 0);
|
|
113
|
+
__decorate([
|
|
114
|
+
attr({ attribute: "aria-details" })
|
|
115
|
+
], ARIAGlobalStatesAndProperties.prototype, "ariaDetails", void 0);
|
|
116
|
+
__decorate([
|
|
117
|
+
attr({ attribute: "aria-disabled" })
|
|
118
|
+
], ARIAGlobalStatesAndProperties.prototype, "ariaDisabled", void 0);
|
|
119
|
+
__decorate([
|
|
120
|
+
attr({ attribute: "aria-errormessage" })
|
|
121
|
+
], ARIAGlobalStatesAndProperties.prototype, "ariaErrormessage", void 0);
|
|
122
|
+
__decorate([
|
|
123
|
+
attr({ attribute: "aria-flowto" })
|
|
124
|
+
], ARIAGlobalStatesAndProperties.prototype, "ariaFlowto", void 0);
|
|
125
|
+
__decorate([
|
|
126
|
+
attr({ attribute: "aria-haspopup" })
|
|
127
|
+
], ARIAGlobalStatesAndProperties.prototype, "ariaHaspopup", void 0);
|
|
128
|
+
__decorate([
|
|
129
|
+
attr({ attribute: "aria-hidden" })
|
|
130
|
+
], ARIAGlobalStatesAndProperties.prototype, "ariaHidden", void 0);
|
|
131
|
+
__decorate([
|
|
132
|
+
attr({ attribute: "aria-invalid" })
|
|
133
|
+
], ARIAGlobalStatesAndProperties.prototype, "ariaInvalid", void 0);
|
|
134
|
+
__decorate([
|
|
135
|
+
attr({ attribute: "aria-keyshortcuts" })
|
|
136
|
+
], ARIAGlobalStatesAndProperties.prototype, "ariaKeyshortcuts", void 0);
|
|
137
|
+
__decorate([
|
|
138
|
+
attr({ attribute: "aria-label" })
|
|
139
|
+
], ARIAGlobalStatesAndProperties.prototype, "ariaLabel", void 0);
|
|
140
|
+
__decorate([
|
|
141
|
+
attr({ attribute: "aria-labelledby" })
|
|
142
|
+
], ARIAGlobalStatesAndProperties.prototype, "ariaLabelledby", void 0);
|
|
143
|
+
__decorate([
|
|
144
|
+
attr({ attribute: "aria-live" })
|
|
145
|
+
], ARIAGlobalStatesAndProperties.prototype, "ariaLive", void 0);
|
|
146
|
+
__decorate([
|
|
147
|
+
attr({ attribute: "aria-owns" })
|
|
148
|
+
], ARIAGlobalStatesAndProperties.prototype, "ariaOwns", void 0);
|
|
149
|
+
__decorate([
|
|
150
|
+
attr({ attribute: "aria-relevant" })
|
|
151
|
+
], ARIAGlobalStatesAndProperties.prototype, "ariaRelevant", void 0);
|
|
152
|
+
__decorate([
|
|
153
|
+
attr({ attribute: "aria-roledescription" })
|
|
154
|
+
], ARIAGlobalStatesAndProperties.prototype, "ariaRoledescription", void 0);
|
|
155
|
+
|
|
156
|
+
export { ARIAGlobalStatesAndProperties as A, StartEnd as S, ref as r };
|
|
@@ -0,0 +1,65 @@
|
|
|
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
|
+
* @public
|
|
8
|
+
*/
|
|
9
|
+
class BaseProgress extends FoundationElement {
|
|
10
|
+
constructor() {
|
|
11
|
+
super(...arguments);
|
|
12
|
+
/**
|
|
13
|
+
* Indicates progress in %
|
|
14
|
+
* @internal
|
|
15
|
+
*/
|
|
16
|
+
this.percentComplete = 0;
|
|
17
|
+
}
|
|
18
|
+
valueChanged() {
|
|
19
|
+
if (this.$fastController.isConnected) {
|
|
20
|
+
this.updatePercentComplete();
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
minChanged() {
|
|
24
|
+
if (this.$fastController.isConnected) {
|
|
25
|
+
this.updatePercentComplete();
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
maxChanged() {
|
|
29
|
+
if (this.$fastController.isConnected) {
|
|
30
|
+
this.updatePercentComplete();
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* @internal
|
|
35
|
+
*/
|
|
36
|
+
connectedCallback() {
|
|
37
|
+
super.connectedCallback();
|
|
38
|
+
this.updatePercentComplete();
|
|
39
|
+
}
|
|
40
|
+
updatePercentComplete() {
|
|
41
|
+
const min = typeof this.min === "number" ? this.min : 0;
|
|
42
|
+
const max = typeof this.max === "number" ? this.max : 100;
|
|
43
|
+
const value = typeof this.value === "number" ? this.value : 0;
|
|
44
|
+
const range = max - min;
|
|
45
|
+
this.percentComplete =
|
|
46
|
+
range === 0 ? 0 : Math.fround(((value - min) / range) * 100);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
__decorate([
|
|
50
|
+
attr({ converter: nullableNumberConverter })
|
|
51
|
+
], BaseProgress.prototype, "value", void 0);
|
|
52
|
+
__decorate([
|
|
53
|
+
attr({ converter: nullableNumberConverter })
|
|
54
|
+
], BaseProgress.prototype, "min", void 0);
|
|
55
|
+
__decorate([
|
|
56
|
+
attr({ converter: nullableNumberConverter })
|
|
57
|
+
], BaseProgress.prototype, "max", void 0);
|
|
58
|
+
__decorate([
|
|
59
|
+
attr({ mode: "boolean" })
|
|
60
|
+
], BaseProgress.prototype, "paused", void 0);
|
|
61
|
+
__decorate([
|
|
62
|
+
observable
|
|
63
|
+
], BaseProgress.prototype, "percentComplete", void 0);
|
|
64
|
+
|
|
65
|
+
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 };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
function classNames(...args) {
|
|
2
|
+
return args.reduce((accum, value) => {
|
|
3
|
+
const leadingChar = accum.length ? " " : "";
|
|
4
|
+
const normalizedValue = Array.isArray(value) && value[1]
|
|
5
|
+
? classNames.call(null, value[0])
|
|
6
|
+
: typeof value === "function"
|
|
7
|
+
? value()
|
|
8
|
+
: typeof value === "string"
|
|
9
|
+
? value
|
|
10
|
+
: "";
|
|
11
|
+
return !normalizedValue.length ? accum : accum + leadingChar + normalizedValue;
|
|
12
|
+
}, "");
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export { classNames as c };
|