@vonage/vivid 3.0.0-next.6 → 3.0.0-next.61
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 +135 -4
- package/accordion/index.js +2 -4
- package/accordion-item/index.js +26 -20
- package/action-group/index.js +47 -0
- package/avatar/index.js +51 -0
- package/badge/index.js +14 -20
- package/banner/index.js +21 -86
- package/breadcrumb/index.js +20 -18
- package/breadcrumb-item/index.js +14 -11
- package/button/index.js +28 -661
- package/calendar/index.js +67 -25
- package/calendar-event/index.js +115 -0
- package/card/index.js +132 -0
- package/checkbox/index.js +180 -0
- package/dialog/index.js +279 -0
- package/divider/index.js +86 -0
- package/elevation/index.js +3 -31
- package/fab/index.js +100 -0
- package/focus/index.js +18 -3
- package/header/index.js +66 -0
- package/icon/index.js +9 -5
- package/index.js +45 -20
- package/layout/index.js +4 -6
- package/lib/accordion-item/accordion-item.d.ts +2 -2
- package/lib/accordion-item/index.d.ts +2 -1
- package/lib/action-group/action-group.d.ts +10 -0
- package/lib/{sidenav-item/sidenav-item.template.d.ts → action-group/action-group.template.d.ts} +2 -2
- package/lib/{sidenav-item → action-group}/index.d.ts +1 -2
- package/lib/avatar/avatar.d.ts +14 -0
- package/lib/avatar/avatar.template.d.ts +4 -0
- package/lib/avatar/index.d.ts +3 -0
- package/lib/badge/badge.d.ts +6 -6
- package/lib/badge/index.d.ts +1 -1
- package/lib/banner/banner.d.ts +1 -1
- package/lib/banner/banner.template.d.ts +0 -2
- package/lib/banner/index.d.ts +1 -0
- package/lib/breadcrumb/breadcrumb.template.d.ts +4 -0
- package/lib/breadcrumb-item/breadcrumb-item.d.ts +1 -1
- package/lib/breadcrumb-item/index.d.ts +1 -0
- package/lib/button/button.d.ts +6 -5
- package/lib/button/index.d.ts +2 -19
- package/lib/calendar/calendar.d.ts +3 -1
- package/lib/calendar/index.d.ts +0 -1
- package/lib/calendar-event/calendar-event.d.ts +14 -0
- package/lib/calendar-event/calendar-event.template.d.ts +4 -0
- package/lib/calendar-event/index.d.ts +2 -0
- package/lib/card/card.d.ts +10 -0
- package/lib/{text/text.template.d.ts → card/card.template.d.ts} +2 -2
- package/lib/card/index.d.ts +4 -0
- package/lib/checkbox/checkbox.d.ts +5 -0
- package/lib/checkbox/checkbox.template.d.ts +4 -0
- package/lib/checkbox/index.d.ts +4 -0
- package/lib/components.d.ts +22 -10
- package/lib/dialog/dialog.d.ts +20 -0
- package/lib/dialog/dialog.template.d.ts +4 -0
- package/lib/dialog/index.d.ts +5 -0
- package/lib/divider/divider.d.ts +3 -0
- package/lib/divider/divider.template.d.ts +4 -0
- package/lib/divider/index.d.ts +2 -0
- package/lib/elevation/elevation.d.ts +1 -0
- package/lib/elevation/index.d.ts +1 -1
- package/lib/enums.d.ts +12 -6
- package/lib/fab/fab.d.ts +13 -0
- package/lib/fab/fab.template.d.ts +4 -0
- package/lib/fab/index.d.ts +4 -0
- package/lib/focus/index.d.ts +1 -1
- package/lib/header/header.d.ts +5 -0
- package/lib/header/header.template.d.ts +4 -0
- package/lib/header/index.d.ts +3 -0
- package/lib/icon/icon.d.ts +4 -3
- package/lib/layout/index.d.ts +1 -1
- package/lib/layout/layout.d.ts +3 -3
- package/lib/menu/index.d.ts +11 -0
- package/lib/menu/menu.d.ts +7 -0
- package/lib/menu/menu.template.d.ts +3 -0
- package/lib/nav/index.d.ts +2 -0
- package/lib/nav/nav.d.ts +3 -0
- package/lib/nav/nav.template.d.ts +4 -0
- package/lib/nav-disclosure/index.d.ts +4 -0
- package/lib/nav-disclosure/nav-disclosure.d.ts +10 -0
- package/lib/nav-disclosure/nav-disclosure.template.d.ts +4 -0
- package/lib/nav-item/index.d.ts +4 -0
- package/lib/{sidenav-item/sidenav-item.d.ts → nav-item/nav-item.d.ts} +2 -2
- package/lib/nav-item/nav-item.template.d.ts +4 -0
- package/lib/{text → note}/index.d.ts +1 -1
- package/lib/note/note.d.ts +10 -0
- package/lib/note/note.template.d.ts +5 -0
- package/lib/popup/index.d.ts +1 -1
- package/lib/popup/popup.d.ts +3 -15
- package/lib/progress/progress.d.ts +1 -1
- package/lib/progress-ring/progress-ring.d.ts +2 -1
- package/lib/side-drawer/index.d.ts +1 -1
- package/lib/side-drawer/side-drawer.d.ts +4 -7
- package/lib/side-drawer/side-drawer.template.d.ts +2 -2
- package/lib/text-anchor/text-anchor.d.ts +1 -1
- package/lib/text-area/index.d.ts +3 -0
- package/lib/text-area/text-area.d.ts +9 -0
- package/lib/text-area/text-area.template.d.ts +4 -0
- package/lib/text-field/index.d.ts +4 -0
- package/lib/text-field/text-field.d.ts +16 -0
- package/lib/text-field/text-field.template.d.ts +5 -0
- package/lib/tooltip/tooltip.d.ts +2 -4
- package/menu/index.js +659 -0
- package/nav/index.js +17 -0
- package/nav-disclosure/index.js +88 -0
- package/nav-item/index.js +41 -0
- package/note/index.js +66 -0
- package/package.json +49 -8
- package/popup/index.js +19 -2082
- package/progress/index.js +35 -28
- package/progress-ring/index.js +9 -5
- package/shared/anchor.js +8 -1
- package/shared/aria-global.js +3 -40
- package/shared/base-progress.js +5 -0
- package/shared/button.js +199 -0
- package/shared/calendar-event.js +26 -0
- package/shared/dialog-polyfill.esm.js +858 -0
- package/shared/enums.js +79 -0
- package/shared/es.object.assign.js +7 -6
- package/shared/export.js +995 -0
- package/shared/focus.js +5 -0
- package/shared/focus2.js +11 -0
- package/shared/form-associated.js +554 -0
- package/shared/form-elements.js +298 -0
- package/shared/icon.js +533 -520
- package/shared/index.js +79 -56
- package/shared/index2.js +26 -12
- package/shared/index3.js +2113 -0
- package/shared/iterators.js +61 -0
- package/shared/object-keys.js +13 -0
- package/shared/patterns/focus.d.ts +3 -0
- package/shared/patterns/form-elements.d.ts +22 -0
- package/shared/patterns/index.d.ts +1 -0
- package/shared/ref.js +41 -0
- package/shared/text-anchor.js +2 -11
- package/shared/text-anchor.template.js +5 -2
- package/shared/to-string.js +51 -0
- package/shared/web.dom-collections.iterator.js +78 -1083
- package/side-drawer/index.js +50 -51
- package/styles/core/all.css +75 -0
- package/styles/core/theme.css +11 -0
- package/styles/core/typography.css +69 -0
- package/styles/fonts/SpeziaCompleteVariableItalicWeb.woff +0 -0
- package/styles/fonts/SpeziaCompleteVariableItalicWeb.woff2 +0 -0
- package/styles/fonts/SpeziaCompleteVariableUprightWeb.woff +0 -0
- package/styles/fonts/SpeziaCompleteVariableUprightWeb.woff2 +0 -0
- package/styles/fonts/SpeziaMonoCompleteVariableWeb.woff +0 -0
- package/styles/fonts/SpeziaMonoCompleteVariableWeb.woff2 +0 -0
- package/styles/fonts/spezia.css +12 -12
- package/styles/tokens/theme-dark.css +210 -0
- package/styles/tokens/theme-light.css +210 -0
- package/text-anchor/index.js +8 -1
- package/text-area/index.js +302 -0
- package/text-field/index.js +150 -0
- package/tooltip/index.js +19 -23
- package/lib/text/text.d.ts +0 -10
- package/shared/style-inject.es.js +0 -28
- package/sidenav-item/index.js +0 -38
- package/styles/themes/dark.css +0 -193
- package/styles/themes/light.css +0 -193
- package/text/index.js +0 -45
package/progress/index.js
CHANGED
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
import { _ as __decorate, a as attr, b as __metadata, h as html, d as designSystem } from '../shared/index.js';
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
2
|
+
import '../shared/web.dom-collections.iterator.js';
|
|
3
|
+
import { c as classofRaw, _ as _export, f as functionUncurryThis } from '../shared/export.js';
|
|
4
4
|
import { B as BaseProgress } from '../shared/base-progress.js';
|
|
5
5
|
import { w as when } from '../shared/when.js';
|
|
6
6
|
import { c as classNames } from '../shared/class-names.js';
|
|
7
|
+
import '../shared/object-keys.js';
|
|
8
|
+
import '../shared/iterators.js';
|
|
7
9
|
|
|
8
|
-
var css_248z = ".base {\n height: 6px;\n align-items: center;\n margin: 0;\n outline: none;\n}\n.base.connotation-cta {\n --
|
|
9
|
-
styleInject(css_248z);
|
|
10
|
+
var css_248z = "/**\n * Do not edit directly\n * Generated on Sat, 17 Sep 2022 18:17:14 GMT\n */\n.base {\n height: 6px;\n align-items: center;\n margin: 0;\n outline: none;\n}\n.base:not(.connotation-pacific).connotation-cta {\n --_connotation-color-primary: var(--vvd-color-cta-500);\n}\n.base:not(.connotation-pacific).connotation-alert {\n --_connotation-color-primary: var(--vvd-color-alert-500);\n}\n.base:not(.connotation-pacific).connotation-success {\n --_connotation-color-primary: var(--vvd-color-success-500);\n}\n.base:not(.connotation-pacific):not(.connotation-cta, .connotation-alert, .connotation-success) {\n --_connotation-color-primary: var(--vvd-color-canvas-text);\n}\n.base.connotation-pacific {\n --_connotation-color-primary: linear-gradient(to right, var(--vvd-color-information-200), var(--vvd-color-cta-600));\n}\n\n.progress {\n position: relative;\n display: flex;\n overflow: hidden;\n align-items: center;\n background-color: var(--vvd-color-neutral-100);\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-300);\n}\n\n.indicator-1 {\n animation: indeterminate-1 2s infinite;\n inline-size: 30%;\n}\n\n.indicator-2 {\n animation: indeterminate-2 2s infinite;\n inline-size: 60%;\n}\n\n.indicator-1,\n.indicator-2 {\n position: absolute;\n animation-timing-function: cubic-bezier(0.4, 0, 0.6, 1);\n background-color: var(--vvd-color-neutral-100);\n block-size: 100%;\n opacity: 0;\n}\n.connotation-pacific .indicator-1,\n.connotation-pacific .indicator-2 {\n background-image: var(--_connotation-color-primary);\n}\n.paused .indicator-1,\n.paused .indicator-2 {\n animation-play-state: paused;\n background-color: var(--_connotation-color-primary);\n}\n.reverse .indicator-1,\n.reverse .indicator-2 {\n animation-direction: reverse;\n}\n\n@keyframes indeterminate-1 {\n 0% {\n opacity: 1;\n transform: translateX(-100%);\n }\n 70% {\n opacity: 1;\n transform: translateX(300%);\n }\n 70.01% {\n opacity: 0;\n }\n 100% {\n opacity: 0;\n transform: translateX(300%);\n }\n}\n@keyframes indeterminate-2 {\n 0% {\n opacity: 0;\n transform: translateX(-150%);\n }\n 29.99% {\n opacity: 0;\n }\n 30% {\n opacity: 1;\n transform: translateX(-150%);\n }\n 100% {\n opacity: 1;\n transform: translateX(166.66%);\n }\n}";
|
|
10
11
|
|
|
11
12
|
var classof = classofRaw;
|
|
12
13
|
|
|
13
14
|
// `IsArray` abstract operation
|
|
14
15
|
// https://tc39.es/ecma262/#sec-isarray
|
|
15
|
-
// eslint-disable-next-line es/no-array-isarray -- safe
|
|
16
|
+
// eslint-disable-next-line es-x/no-array-isarray -- safe
|
|
16
17
|
var isArray$1 = Array.isArray || function isArray(argument) {
|
|
17
18
|
return classof(argument) == 'Array';
|
|
18
19
|
};
|
|
@@ -21,7 +22,7 @@ var $ = _export;
|
|
|
21
22
|
var uncurryThis = functionUncurryThis;
|
|
22
23
|
var isArray = isArray$1;
|
|
23
24
|
|
|
24
|
-
var
|
|
25
|
+
var nativeReverse = uncurryThis([].reverse);
|
|
25
26
|
var test = [1, 2];
|
|
26
27
|
|
|
27
28
|
// `Array.prototype.reverse` method
|
|
@@ -32,7 +33,7 @@ $({ target: 'Array', proto: true, forced: String(test) === String(test.reverse()
|
|
|
32
33
|
reverse: function reverse() {
|
|
33
34
|
// eslint-disable-next-line no-self-assign -- dirty hack
|
|
34
35
|
if (isArray(this)) this.length = this.length;
|
|
35
|
-
return
|
|
36
|
+
return nativeReverse(this);
|
|
36
37
|
}
|
|
37
38
|
});
|
|
38
39
|
|
|
@@ -57,35 +58,41 @@ let _2 = t => t,
|
|
|
57
58
|
_t2,
|
|
58
59
|
_t3;
|
|
59
60
|
|
|
60
|
-
const getClasses =
|
|
61
|
+
const getClasses = ({
|
|
62
|
+
connotation,
|
|
63
|
+
shape,
|
|
64
|
+
reverse,
|
|
65
|
+
paused
|
|
66
|
+
}) => classNames('base', [`connotation-${connotation}`, Boolean(connotation)], [`shape-${shape}`, Boolean(shape)], ['reverse', Boolean(reverse)], ['paused', Boolean(paused)]);
|
|
61
67
|
|
|
62
|
-
|
|
68
|
+
function determinate() {
|
|
63
69
|
return html(_t || (_t = _2`
|
|
70
|
+
<span class="determinate" style="width: ${0}%"></span>`), x => x.percentComplete);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
function indeterminate() {
|
|
74
|
+
return html(_t2 || (_t2 = _2`
|
|
75
|
+
<span class="indeterminate" name="indeterminate">
|
|
76
|
+
<span class="indicator-1"></span>
|
|
77
|
+
<span class="indicator-2"></span>
|
|
78
|
+
</span>`));
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
const ProgressTemplate = _ => {
|
|
82
|
+
return html(_t3 || (_t3 = _2`
|
|
64
83
|
<div
|
|
65
84
|
role="progressbar"
|
|
66
85
|
aria-valuenow="${0}"
|
|
67
86
|
aria-valuemin="${0}"
|
|
68
87
|
aria-valuemax="${0}"
|
|
69
|
-
class="${0}
|
|
88
|
+
class="${0}"
|
|
70
89
|
>
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
class="determinate"
|
|
78
|
-
style="width: ${0}%"
|
|
79
|
-
></div>
|
|
80
|
-
</div>
|
|
81
|
-
`), x => x.percentComplete)), when(x => typeof x.value !== 'number', html(_t3 || (_t3 = _2`
|
|
82
|
-
<div class="progress indeterminate">
|
|
83
|
-
<span class="indeterminate" name="indeterminate">
|
|
84
|
-
<span class="indeterminate-indicator-1"></span>
|
|
85
|
-
<span class="indeterminate-indicator-2"></span>
|
|
86
|
-
</span>
|
|
87
|
-
</div>
|
|
88
|
-
`))));
|
|
90
|
+
<div class="progress">
|
|
91
|
+
${0}
|
|
92
|
+
${0}
|
|
93
|
+
</div>
|
|
94
|
+
</div>
|
|
95
|
+
`), x => x.value, x => x.min, x => x.max, getClasses, when(x => typeof x.value === 'number', determinate()), when(x => typeof x.value !== 'number', indeterminate()));
|
|
89
96
|
};
|
|
90
97
|
|
|
91
98
|
const vividProgress = Progress.compose({
|
package/progress-ring/index.js
CHANGED
|
@@ -1,22 +1,26 @@
|
|
|
1
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
2
|
import { B as BaseProgress } from '../shared/base-progress.js';
|
|
4
3
|
import { w as when } from '../shared/when.js';
|
|
5
4
|
import { c as classNames } from '../shared/class-names.js';
|
|
6
5
|
|
|
7
|
-
var css_248z = ".base {\n
|
|
8
|
-
styleInject(css_248z);
|
|
6
|
+
var css_248z = "/**\n * Do not edit directly\n * Generated on Sat, 17 Sep 2022 18:17:14 GMT\n */\n.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-500);\n}\n.base.connotation-alert {\n --_connotation-color-primary: var(--vvd-color-alert-500);\n}\n.base.connotation-success {\n --_connotation-color-primary: var(--vvd-color-success-500);\n}\n.base:not(.connotation-cta, .connotation-alert, .connotation-success) {\n --_connotation-color-primary: var(--vvd-color-canvas-text);\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-400);\n --_appearance-color-fill: transaprent;\n --_appearance-color-outline: transaprent;\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-9 {\n --_density: calc(9 * 4px);\n}\n.base.density-11 {\n --_density: calc(11 * 4px);\n}\n.base.density-12 {\n --_density: calc(12 * 4px);\n}\n.base.density-13 {\n --_density: calc(13 * 4px);\n}\n.base:not(.density-5, .density-6, .density-7, .density-8, .density-9, .density-11, .density-12, .density-13) {\n --_density: calc(10 * 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}";
|
|
9
7
|
|
|
10
8
|
class ProgressRing extends BaseProgress {}
|
|
11
9
|
|
|
12
|
-
__decorate([attr
|
|
10
|
+
__decorate([attr, __metadata("design:type", String)], ProgressRing.prototype, "connotation", void 0);
|
|
11
|
+
|
|
12
|
+
__decorate([attr, __metadata("design:type", Number)], ProgressRing.prototype, "density", void 0);
|
|
13
13
|
|
|
14
14
|
let _2 = t => t,
|
|
15
15
|
_t,
|
|
16
16
|
_t2,
|
|
17
17
|
_t3;
|
|
18
18
|
|
|
19
|
-
const getClasses =
|
|
19
|
+
const getClasses = ({
|
|
20
|
+
connotation,
|
|
21
|
+
density,
|
|
22
|
+
paused
|
|
23
|
+
}) => classNames('base', ['disabled', !!paused], [`connotation-${connotation}`, !!connotation], [`density-${(density ? Number(density) : 0) + 10}`, !!density]);
|
|
20
24
|
|
|
21
25
|
const progressSegments = 44;
|
|
22
26
|
const ProgressRingTemplate = _ => html(_t || (_t = _2`
|
package/shared/anchor.js
CHANGED
|
@@ -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") &&
|
|
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
|
};
|
package/shared/aria-global.js
CHANGED
|
@@ -1,42 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* The runtime behavior for template references.
|
|
5
|
-
* @public
|
|
6
|
-
*/
|
|
7
|
-
class RefBehavior {
|
|
8
|
-
/**
|
|
9
|
-
* Creates an instance of RefBehavior.
|
|
10
|
-
* @param target - The element to reference.
|
|
11
|
-
* @param propertyName - The name of the property to assign the reference to.
|
|
12
|
-
*/
|
|
13
|
-
constructor(target, propertyName) {
|
|
14
|
-
this.target = target;
|
|
15
|
-
this.propertyName = propertyName;
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Bind this behavior to the source.
|
|
19
|
-
* @param source - The source to bind to.
|
|
20
|
-
* @param context - The execution context that the binding is operating within.
|
|
21
|
-
*/
|
|
22
|
-
bind(source) {
|
|
23
|
-
source[this.propertyName] = this.target;
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Unbinds this behavior from the source.
|
|
27
|
-
* @param source - The source to unbind from.
|
|
28
|
-
*/
|
|
29
|
-
/* eslint-disable-next-line @typescript-eslint/no-empty-function */
|
|
30
|
-
unbind() { }
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* A directive that observes the updates a property with a reference to the element.
|
|
34
|
-
* @param propertyName - The name of the property to assign the reference to.
|
|
35
|
-
* @public
|
|
36
|
-
*/
|
|
37
|
-
function ref(propertyName) {
|
|
38
|
-
return new AttachedBehaviorHTMLDirective("fast-ref", RefBehavior, propertyName);
|
|
39
|
-
}
|
|
1
|
+
import { h as html, _ as __decorate, a as attr } from './index.js';
|
|
2
|
+
import { r as ref } from './ref.js';
|
|
40
3
|
|
|
41
4
|
/**
|
|
42
5
|
* A mixin class implementing start and end elements.
|
|
@@ -153,4 +116,4 @@ __decorate([
|
|
|
153
116
|
attr({ attribute: "aria-roledescription" })
|
|
154
117
|
], ARIAGlobalStatesAndProperties.prototype, "ariaRoledescription", void 0);
|
|
155
118
|
|
|
156
|
-
export { ARIAGlobalStatesAndProperties as A, StartEnd as S
|
|
119
|
+
export { ARIAGlobalStatesAndProperties as A, StartEnd as S };
|
package/shared/base-progress.js
CHANGED
|
@@ -4,6 +4,11 @@ import { F as FoundationElement, _ as __decorate, a as attr, n as nullableNumber
|
|
|
4
4
|
* An Progress HTML Element.
|
|
5
5
|
* Implements the {@link https://www.w3.org/TR/wai-aria-1.1/#progressbar | ARIA progressbar }.
|
|
6
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
|
+
*
|
|
7
12
|
* @public
|
|
8
13
|
*/
|
|
9
14
|
class BaseProgress extends FoundationElement {
|
package/shared/button.js
ADDED
|
@@ -0,0 +1,199 @@
|
|
|
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 { F as FormAssociated } from './form-associated.js';
|
|
4
|
+
import { A as ARIAGlobalStatesAndProperties, S as StartEnd } from './aria-global.js';
|
|
5
|
+
|
|
6
|
+
class _Button extends FoundationElement {
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* A form-associated base class for the {@link @microsoft/fast-foundation#(Button:class)} component.
|
|
10
|
+
*
|
|
11
|
+
* @internal
|
|
12
|
+
*/
|
|
13
|
+
class FormAssociatedButton extends FormAssociated(_Button) {
|
|
14
|
+
constructor() {
|
|
15
|
+
super(...arguments);
|
|
16
|
+
this.proxy = document.createElement("input");
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* A Button Custom HTML Element.
|
|
22
|
+
* Based largely on the {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button | <button> element }.
|
|
23
|
+
*
|
|
24
|
+
* @slot start - Content which can be provided before the button content
|
|
25
|
+
* @slot end - Content which can be provided after the button content
|
|
26
|
+
* @slot - The default slot for button content
|
|
27
|
+
* @csspart control - The button element
|
|
28
|
+
* @csspart content - The element wrapping button content
|
|
29
|
+
*
|
|
30
|
+
* @public
|
|
31
|
+
*/
|
|
32
|
+
class Button extends FormAssociatedButton {
|
|
33
|
+
constructor() {
|
|
34
|
+
super(...arguments);
|
|
35
|
+
/**
|
|
36
|
+
* Prevent events to propagate if disabled and has no slotted content wrapped in HTML elements
|
|
37
|
+
* @internal
|
|
38
|
+
*/
|
|
39
|
+
this.handleClick = (e) => {
|
|
40
|
+
var _a;
|
|
41
|
+
if (this.disabled && ((_a = this.defaultSlottedContent) === null || _a === void 0 ? void 0 : _a.length) <= 1) {
|
|
42
|
+
e.stopPropagation();
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* Submits the parent form
|
|
47
|
+
*/
|
|
48
|
+
this.handleSubmission = () => {
|
|
49
|
+
if (!this.form) {
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
const attached = this.proxy.isConnected;
|
|
53
|
+
if (!attached) {
|
|
54
|
+
this.attachProxy();
|
|
55
|
+
}
|
|
56
|
+
// Browser support for requestSubmit is not comprehensive
|
|
57
|
+
// so click the proxy if it isn't supported
|
|
58
|
+
typeof this.form.requestSubmit === "function"
|
|
59
|
+
? this.form.requestSubmit(this.proxy)
|
|
60
|
+
: this.proxy.click();
|
|
61
|
+
if (!attached) {
|
|
62
|
+
this.detachProxy();
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
/**
|
|
66
|
+
* Resets the parent form
|
|
67
|
+
*/
|
|
68
|
+
this.handleFormReset = () => {
|
|
69
|
+
var _a;
|
|
70
|
+
(_a = this.form) === null || _a === void 0 ? void 0 : _a.reset();
|
|
71
|
+
};
|
|
72
|
+
/**
|
|
73
|
+
* Overrides the focus call for where delegatesFocus is unsupported.
|
|
74
|
+
* This check works for Chrome, Edge Chromium, FireFox, and Safari
|
|
75
|
+
* Relevant PR on the Firefox browser: https://phabricator.services.mozilla.com/D123858
|
|
76
|
+
*/
|
|
77
|
+
this.handleUnsupportedDelegatesFocus = () => {
|
|
78
|
+
var _a;
|
|
79
|
+
// Check to see if delegatesFocus is supported
|
|
80
|
+
if (window.ShadowRoot &&
|
|
81
|
+
!window.ShadowRoot.prototype.hasOwnProperty("delegatesFocus") &&
|
|
82
|
+
((_a = this.$fastController.definition.shadowOptions) === null || _a === void 0 ? void 0 : _a.delegatesFocus)) {
|
|
83
|
+
this.focus = () => {
|
|
84
|
+
this.control.focus();
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
formactionChanged() {
|
|
90
|
+
if (this.proxy instanceof HTMLInputElement) {
|
|
91
|
+
this.proxy.formAction = this.formaction;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
formenctypeChanged() {
|
|
95
|
+
if (this.proxy instanceof HTMLInputElement) {
|
|
96
|
+
this.proxy.formEnctype = this.formenctype;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
formmethodChanged() {
|
|
100
|
+
if (this.proxy instanceof HTMLInputElement) {
|
|
101
|
+
this.proxy.formMethod = this.formmethod;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
formnovalidateChanged() {
|
|
105
|
+
if (this.proxy instanceof HTMLInputElement) {
|
|
106
|
+
this.proxy.formNoValidate = this.formnovalidate;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
formtargetChanged() {
|
|
110
|
+
if (this.proxy instanceof HTMLInputElement) {
|
|
111
|
+
this.proxy.formTarget = this.formtarget;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
typeChanged(previous, next) {
|
|
115
|
+
if (this.proxy instanceof HTMLInputElement) {
|
|
116
|
+
this.proxy.type = this.type;
|
|
117
|
+
}
|
|
118
|
+
next === "submit" && this.addEventListener("click", this.handleSubmission);
|
|
119
|
+
previous === "submit" && this.removeEventListener("click", this.handleSubmission);
|
|
120
|
+
next === "reset" && this.addEventListener("click", this.handleFormReset);
|
|
121
|
+
previous === "reset" && this.removeEventListener("click", this.handleFormReset);
|
|
122
|
+
}
|
|
123
|
+
/** {@inheritDoc (FormAssociated:interface).validate} */
|
|
124
|
+
validate() {
|
|
125
|
+
super.validate(this.control);
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* @internal
|
|
129
|
+
*/
|
|
130
|
+
connectedCallback() {
|
|
131
|
+
var _a;
|
|
132
|
+
super.connectedCallback();
|
|
133
|
+
this.proxy.setAttribute("type", this.type);
|
|
134
|
+
this.handleUnsupportedDelegatesFocus();
|
|
135
|
+
const elements = Array.from((_a = this.control) === null || _a === void 0 ? void 0 : _a.children);
|
|
136
|
+
if (elements) {
|
|
137
|
+
elements.forEach((span) => {
|
|
138
|
+
span.addEventListener("click", this.handleClick);
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* @internal
|
|
144
|
+
*/
|
|
145
|
+
disconnectedCallback() {
|
|
146
|
+
var _a;
|
|
147
|
+
super.disconnectedCallback();
|
|
148
|
+
const elements = Array.from((_a = this.control) === null || _a === void 0 ? void 0 : _a.children);
|
|
149
|
+
if (elements) {
|
|
150
|
+
elements.forEach((span) => {
|
|
151
|
+
span.removeEventListener("click", this.handleClick);
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
__decorate([
|
|
157
|
+
attr({ mode: "boolean" })
|
|
158
|
+
], Button.prototype, "autofocus", void 0);
|
|
159
|
+
__decorate([
|
|
160
|
+
attr({ attribute: "form" })
|
|
161
|
+
], Button.prototype, "formId", void 0);
|
|
162
|
+
__decorate([
|
|
163
|
+
attr
|
|
164
|
+
], Button.prototype, "formaction", void 0);
|
|
165
|
+
__decorate([
|
|
166
|
+
attr
|
|
167
|
+
], Button.prototype, "formenctype", void 0);
|
|
168
|
+
__decorate([
|
|
169
|
+
attr
|
|
170
|
+
], Button.prototype, "formmethod", void 0);
|
|
171
|
+
__decorate([
|
|
172
|
+
attr({ mode: "boolean" })
|
|
173
|
+
], Button.prototype, "formnovalidate", void 0);
|
|
174
|
+
__decorate([
|
|
175
|
+
attr
|
|
176
|
+
], Button.prototype, "formtarget", void 0);
|
|
177
|
+
__decorate([
|
|
178
|
+
attr
|
|
179
|
+
], Button.prototype, "type", void 0);
|
|
180
|
+
__decorate([
|
|
181
|
+
observable
|
|
182
|
+
], Button.prototype, "defaultSlottedContent", void 0);
|
|
183
|
+
/**
|
|
184
|
+
* Includes ARIA states and properties relating to the ARIA button role
|
|
185
|
+
*
|
|
186
|
+
* @public
|
|
187
|
+
*/
|
|
188
|
+
class DelegatesARIAButton {
|
|
189
|
+
}
|
|
190
|
+
__decorate([
|
|
191
|
+
attr({ attribute: "aria-expanded" })
|
|
192
|
+
], DelegatesARIAButton.prototype, "ariaExpanded", void 0);
|
|
193
|
+
__decorate([
|
|
194
|
+
attr({ attribute: "aria-pressed" })
|
|
195
|
+
], DelegatesARIAButton.prototype, "ariaPressed", void 0);
|
|
196
|
+
applyMixins(DelegatesARIAButton, ARIAGlobalStatesAndProperties);
|
|
197
|
+
applyMixins(Button, StartEnd, DelegatesARIAButton);
|
|
198
|
+
|
|
199
|
+
export { Button as B };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { F as FoundationElement, _ as __decorate, a as attr, b as __metadata, n as nullableNumberConverter } from './index.js';
|
|
2
|
+
|
|
3
|
+
class CalendarEvent extends FoundationElement {}
|
|
4
|
+
|
|
5
|
+
__decorate([attr, __metadata("design:type", String)], CalendarEvent.prototype, "heading", void 0);
|
|
6
|
+
|
|
7
|
+
__decorate([attr, __metadata("design:type", String)], CalendarEvent.prototype, "description", void 0);
|
|
8
|
+
|
|
9
|
+
__decorate([attr, __metadata("design:type", String)], CalendarEvent.prototype, "connotation", void 0);
|
|
10
|
+
|
|
11
|
+
__decorate([attr, __metadata("design:type", String)], CalendarEvent.prototype, "appearance", void 0);
|
|
12
|
+
|
|
13
|
+
__decorate([attr({
|
|
14
|
+
converter: nullableNumberConverter,
|
|
15
|
+
attribute: 'overlap-count'
|
|
16
|
+
}), __metadata("design:type", Number)], CalendarEvent.prototype, "overlapCount", void 0);
|
|
17
|
+
|
|
18
|
+
__decorate([attr({
|
|
19
|
+
converter: nullableNumberConverter
|
|
20
|
+
}), __metadata("design:type", Number)], CalendarEvent.prototype, "start", void 0);
|
|
21
|
+
|
|
22
|
+
__decorate([attr({
|
|
23
|
+
converter: nullableNumberConverter
|
|
24
|
+
}), __metadata("design:type", Number)], CalendarEvent.prototype, "duration", void 0);
|
|
25
|
+
|
|
26
|
+
export { CalendarEvent as C };
|