@vonage/vivid 3.0.0-next.119 → 3.0.0-next.120
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 +11 -6
- package/accordion/index.js +4 -51
- package/accordion-item/index.js +11 -109
- package/action-group/index.js +4 -36
- package/avatar/index.js +8 -64
- package/badge/index.js +9 -48
- package/banner/index.js +15 -117
- package/breadcrumb/index.js +5 -97
- package/breadcrumb-item/index.js +14 -53
- package/button/index.js +14 -92
- package/calendar/index.js +5 -1520
- package/calendar-event/index.js +7 -107
- package/card/index.js +10 -117
- package/checkbox/index.js +13 -175
- package/custom-elements.json +1827 -8
- package/dialog/index.js +14 -227
- package/divider/index.js +4 -25
- package/elevation/index.js +4 -24
- package/fab/index.js +13 -89
- package/focus/index.js +4 -17
- package/header/index.js +7 -12
- package/icon/index.js +7 -28
- package/index.js +49 -55
- package/layout/index.js +4 -42
- package/lib/accordion/definition.d.ts +3 -0
- package/lib/accordion/index.d.ts +1 -2
- package/lib/accordion-item/definition.d.ts +3 -0
- package/lib/accordion-item/index.d.ts +1 -2
- package/lib/action-group/definition.d.ts +3 -0
- package/lib/action-group/index.d.ts +1 -2
- package/lib/avatar/definition.d.ts +3 -0
- package/lib/avatar/index.d.ts +1 -2
- package/lib/badge/definition.d.ts +3 -0
- package/lib/badge/index.d.ts +1 -2
- package/lib/banner/definition.d.ts +3 -0
- package/lib/banner/index.d.ts +1 -2
- package/lib/breadcrumb/definition.d.ts +3 -0
- package/lib/breadcrumb/index.d.ts +1 -2
- package/lib/breadcrumb-item/definition.d.ts +3 -0
- package/lib/breadcrumb-item/index.d.ts +1 -2
- package/lib/button/definition.d.ts +3 -0
- package/lib/calendar/definition.d.ts +3 -0
- package/lib/calendar/index.d.ts +1 -2
- package/lib/calendar-event/definition.d.ts +3 -0
- package/lib/calendar-event/index.d.ts +1 -2
- package/lib/card/definition.d.ts +3 -0
- package/lib/card/index.d.ts +1 -2
- package/lib/checkbox/definition.d.ts +3 -0
- package/lib/checkbox/index.d.ts +1 -2
- package/lib/components.d.ts +38 -38
- package/lib/dialog/definition.d.ts +3 -0
- package/lib/dialog/index.d.ts +1 -2
- package/lib/divider/definition.d.ts +3 -0
- package/lib/divider/index.d.ts +1 -2
- package/lib/elevation/definition.d.ts +3 -0
- package/lib/elevation/index.d.ts +1 -2
- package/lib/fab/definition.d.ts +3 -0
- package/lib/fab/index.d.ts +1 -2
- package/lib/focus/definition.d.ts +3 -0
- package/lib/focus/index.d.ts +1 -2
- package/lib/header/definition.d.ts +3 -0
- package/lib/header/index.d.ts +1 -2
- package/lib/icon/definition.d.ts +3 -0
- package/lib/icon/index.d.ts +1 -2
- package/lib/layout/definition.d.ts +3 -0
- package/lib/layout/index.d.ts +1 -2
- package/lib/listbox/definition.d.ts +3 -0
- package/lib/menu/definition.d.ts +7 -0
- package/lib/menu/index.d.ts +1 -10
- package/lib/menu-item/definition.d.ts +3 -0
- package/lib/menu-item/index.d.ts +1 -2
- package/lib/nav/definition.d.ts +3 -0
- package/lib/nav/index.d.ts +1 -2
- package/lib/nav-disclosure/definition.d.ts +3 -0
- package/lib/nav-disclosure/index.d.ts +1 -2
- package/lib/nav-item/definition.d.ts +3 -0
- package/lib/nav-item/index.d.ts +1 -2
- package/lib/note/definition.d.ts +3 -0
- package/lib/note/index.d.ts +1 -2
- package/lib/number-field/definition.d.ts +3 -0
- package/lib/number-field/index.d.ts +1 -2
- package/lib/option/definition.d.ts +3 -0
- package/lib/option/index.d.ts +1 -2
- package/lib/popup/definition.d.ts +4 -0
- package/lib/popup/index.d.ts +1 -2
- package/lib/progress/definition.d.ts +3 -0
- package/lib/progress/index.d.ts +1 -2
- package/lib/progress-ring/definition.d.ts +3 -0
- package/lib/progress-ring/index.d.ts +1 -2
- package/lib/radio/definition.d.ts +3 -0
- package/lib/radio/index.d.ts +1 -2
- package/lib/radio-group/definition.d.ts +7 -0
- package/lib/radio-group/index.d.ts +1 -10
- package/lib/side-drawer/definition.d.ts +3 -0
- package/lib/side-drawer/index.d.ts +1 -2
- package/lib/slider/definition.d.ts +3 -0
- package/lib/slider/index.d.ts +1 -2
- package/lib/switch/definition.d.ts +3 -0
- package/lib/switch/index.d.ts +1 -2
- package/lib/text-anchor/definition.d.ts +3 -0
- package/lib/text-anchor/index.d.ts +1 -2
- package/lib/text-area/definition.d.ts +3 -0
- package/lib/text-area/index.d.ts +1 -2
- package/lib/text-field/definition.d.ts +3 -0
- package/lib/text-field/index.d.ts +1 -2
- package/lib/tooltip/definition.d.ts +3 -0
- package/lib/tooltip/index.d.ts +1 -2
- package/listbox/index.js +18 -1080
- package/menu/index.js +27 -354
- package/menu-item/index.js +11 -81
- package/nav/index.js +3 -16
- package/nav-disclosure/index.js +13 -77
- package/nav-item/index.js +13 -35
- package/note/index.js +13 -60
- package/number-field/index.js +14 -16
- package/option/index.js +13 -68
- package/package.json +2 -2
- package/popup/index.js +17 -55
- package/progress/index.js +6 -92
- package/progress-ring/index.js +6 -75
- package/radio/index.js +8 -48
- package/radio-group/index.js +9 -433
- package/shared/anchor.js +1 -1
- package/shared/apply-mixins.js +1 -1
- package/shared/base-progress.js +1 -1
- package/shared/breadcrumb-item.js +1 -1
- package/shared/button.js +195 -18
- package/shared/calendar-event.js +1 -1
- package/shared/definition.js +53 -0
- package/shared/definition10.js +99 -0
- package/shared/definition11.js +48 -0
- package/shared/definition12.js +1523 -0
- package/shared/definition13.js +111 -0
- package/shared/definition14.js +114 -0
- package/shared/definition15.js +32 -0
- package/shared/definition16.js +172 -0
- package/shared/definition17.js +223 -0
- package/shared/{divider.js → definition18.js} +25 -2
- package/shared/definition19.js +87 -0
- package/shared/definition2.js +106 -0
- package/shared/definition20.js +44 -0
- package/shared/definition21.js +1078 -0
- package/shared/{listbox-option.js → definition22.js} +71 -11
- package/shared/definition23.js +348 -0
- package/shared/{popup.js → definition24.js} +46 -3
- package/shared/{menu-item.js → definition25.js} +87 -13
- package/shared/definition26.js +18 -0
- package/shared/definition27.js +75 -0
- package/shared/definition28.js +31 -0
- package/shared/definition29.js +56 -0
- package/shared/definition3.js +29 -0
- package/shared/definition30.js +94 -0
- package/shared/definition31.js +77 -0
- package/shared/definition32.js +45 -0
- package/shared/definition33.js +435 -0
- package/shared/definition34.js +86 -0
- package/shared/definition35.js +592 -0
- package/shared/definition36.js +147 -0
- package/shared/definition37.js +279 -0
- package/shared/definition38.js +119 -0
- package/shared/definition39.js +77 -0
- package/shared/definition4.js +19 -0
- package/shared/definition5.js +38 -0
- package/shared/definition6.js +60 -0
- package/shared/definition7.js +45 -0
- package/shared/definition8.js +113 -0
- package/shared/definition9.js +107 -0
- package/shared/design-system/index.d.ts +1 -2
- package/shared/es.object.assign.js +58 -1
- package/shared/es.regexp.to-string.js +2 -1
- package/shared/focus.js +3 -9
- package/shared/focus2.js +9 -3
- package/shared/form-associated.js +1 -1
- package/shared/form-elements.js +2 -2
- package/shared/icon.js +1096 -9
- package/shared/index.js +385 -2501
- package/shared/patterns/form-elements/form-elements.d.ts +2 -2
- package/shared/radio.js +1 -1
- package/shared/ref.js +1 -1
- package/shared/slotted.js +1 -1
- package/shared/string-trim.js +2 -1
- package/shared/text-anchor.template.js +1 -1
- package/shared/to-string.js +51 -0
- package/side-drawer/index.js +5 -84
- package/slider/index.js +14 -593
- package/styles/core/all.css +1 -1
- package/styles/core/theme.css +1 -1
- package/styles/core/typography.css +1 -1
- package/styles/tokens/theme-dark.css +4 -4
- package/styles/tokens/theme-light.css +4 -4
- package/switch/index.js +13 -149
- package/text-anchor/index.js +8 -7
- package/text-area/index.js +16 -282
- package/text-field/index.js +14 -121
- package/tooltip/index.js +24 -82
- package/vivid.api.json +1640 -850
- package/shared/button2.js +0 -200
- package/shared/elevation.js +0 -10
- package/shared/es.promise.resolve.js +0 -944
- package/shared/index2.js +0 -9
- package/shared/utils/index.d.ts +0 -1
package/dialog/index.js
CHANGED
|
@@ -1,237 +1,24 @@
|
|
|
1
|
-
import '../shared/
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import { B as Button } from '../shared/button.js';
|
|
7
|
-
import { w as when } from '../shared/when.js';
|
|
8
|
-
import { c as classNames } from '../shared/class-names.js';
|
|
1
|
+
import { r as registerDialog } from '../shared/definition17.js';
|
|
2
|
+
import '../shared/index.js';
|
|
3
|
+
import '../shared/definition3.js';
|
|
4
|
+
import '../shared/icon.js';
|
|
5
|
+
import '../shared/to-string.js';
|
|
9
6
|
import '../shared/string-trim.js';
|
|
10
7
|
import '../shared/_has.js';
|
|
8
|
+
import '../shared/when.js';
|
|
9
|
+
import '../shared/class-names.js';
|
|
10
|
+
import '../shared/definition9.js';
|
|
11
|
+
import '../shared/definition4.js';
|
|
12
|
+
import '../shared/focus.js';
|
|
11
13
|
import '../shared/affix.js';
|
|
12
|
-
import '../shared/
|
|
14
|
+
import '../shared/button.js';
|
|
13
15
|
import '../shared/apply-mixins.js';
|
|
14
16
|
import '../shared/form-associated.js';
|
|
15
17
|
import '../shared/key-codes.js';
|
|
16
18
|
import '../shared/aria-global.js';
|
|
17
19
|
import '../shared/start-end.js';
|
|
18
20
|
import '../shared/ref.js';
|
|
21
|
+
import '../shared/focus2.js';
|
|
22
|
+
import '../shared/definition15.js';
|
|
19
23
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
var css_248z = "/**\n * Do not edit directly\n * Generated on Wed, 14 Dec 2022 14:20:57 GMT\n */\n.base {\n box-sizing: border-box;\n padding: 0;\n border: none;\n background: var(--_elevation-fill);\n border-radius: 6px;\n color: var(--vvd-color-canvas-text);\n max-block-size: var(--dialog-max-block-size, calc(100vh - 64px));\n max-inline-size: var(--dialog-max-inline-size);\n min-inline-size: var(--dialog-min-inline-size, 280px);\n overflow-x: hidden;\n overflow-y: auto;\n}\n@media not all and (min-width: 600px) {\n .base {\n --dialog-max-inline-size: 90vw;\n }\n}\n@media (min-width: 600px) {\n .base {\n --dialog-max-inline-size: 560px;\n }\n}\n.base:not(.modal) {\n z-index: var(--dialog-z-index, 1);\n}\n\n.main-wrapper {\n display: flex;\n flex-direction: column;\n padding: 24px;\n gap: 8px;\n}\n\n.header {\n display: flex;\n align-items: flex-start;\n justify-content: space-between;\n gap: 4px;\n inline-size: 100%;\n}\n\n.dismiss-button {\n flex-shrink: 0;\n margin-top: -8px;\n margin-right: -8px;\n}\n\n.headline {\n font: var(--vvd-typography-heading-4);\n}\n.headline-wrapper {\n display: flex;\n align-items: flex-start;\n}\n.base:not(.icon-placement-side) .headline-wrapper {\n flex-direction: column;\n row-gap: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) - 16));\n}\n.base:not(.icon-placement-side) .headline-wrapper .icon {\n font-size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) - 8));\n}\n.base.icon-placement-side .headline-wrapper {\n column-gap: calc(calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) - 8)) - calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) - 16)));\n}\n.base.icon-placement-side .headline-wrapper .icon {\n font-size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) - 12));\n}\n\n.content {\n font: var(--vvd-typography-base);\n}";
|
|
23
|
-
|
|
24
|
-
var _Dialog_instances, _Dialog_modal, _Dialog_dialogElement, _Dialog_dialog_get, _Dialog_handleScrimClick, _Dialog_handleInternalFormSubmit, _Dialog_handleModal;
|
|
25
|
-
let dialogPolyfill;
|
|
26
|
-
(async () => {
|
|
27
|
-
if (!HTMLDialogElement || !HTMLDialogElement.prototype.showModal) {
|
|
28
|
-
delete window.HTMLDialogElement;
|
|
29
|
-
dialogPolyfill = await import('../shared/dialog-polyfill.esm.js');
|
|
30
|
-
}
|
|
31
|
-
})();
|
|
32
|
-
class Dialog extends FoundationElement {
|
|
33
|
-
constructor() {
|
|
34
|
-
super(...arguments);
|
|
35
|
-
_Dialog_instances.add(this);
|
|
36
|
-
this.open = false;
|
|
37
|
-
this.ariaLabelledBy = null;
|
|
38
|
-
this.ariaLabel = null;
|
|
39
|
-
this.ariaDescribedBy = null;
|
|
40
|
-
_Dialog_modal.set(this, false);
|
|
41
|
-
_Dialog_dialogElement.set(this, void 0);
|
|
42
|
-
_Dialog_handleScrimClick.set(this, event => {
|
|
43
|
-
if (event.target !== __classPrivateFieldGet(this, _Dialog_instances, "a", _Dialog_dialog_get)) {
|
|
44
|
-
return;
|
|
45
|
-
}
|
|
46
|
-
const rect = __classPrivateFieldGet(this, _Dialog_instances, "a", _Dialog_dialog_get).getBoundingClientRect();
|
|
47
|
-
const clickedInDialog = rect.top <= event.clientY && event.clientY <= rect.top + rect.height && rect.left <= event.clientX && event.clientX <= rect.left + rect.width;
|
|
48
|
-
this.open = clickedInDialog;
|
|
49
|
-
});
|
|
50
|
-
_Dialog_handleInternalFormSubmit.set(this, event => {
|
|
51
|
-
if (event.target.method !== 'dialog') {
|
|
52
|
-
return;
|
|
53
|
-
}
|
|
54
|
-
this.open = false;
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
set returnValue(value) {
|
|
58
|
-
__classPrivateFieldGet(this, _Dialog_instances, "a", _Dialog_dialog_get).returnValue = value;
|
|
59
|
-
}
|
|
60
|
-
get returnValue() {
|
|
61
|
-
var _a;
|
|
62
|
-
return (_a = __classPrivateFieldGet(this, _Dialog_instances, "a", _Dialog_dialog_get)) === null || _a === void 0 ? void 0 : _a.returnValue;
|
|
63
|
-
}
|
|
64
|
-
get modal() {
|
|
65
|
-
return __classPrivateFieldGet(this, _Dialog_modal, "f");
|
|
66
|
-
}
|
|
67
|
-
openChanged(oldValue, newValue) {
|
|
68
|
-
if (oldValue === undefined) {
|
|
69
|
-
return;
|
|
70
|
-
}
|
|
71
|
-
if (!newValue) {
|
|
72
|
-
this.close();
|
|
73
|
-
} else {
|
|
74
|
-
if (__classPrivateFieldGet(this, _Dialog_instances, "a", _Dialog_dialog_get)) {
|
|
75
|
-
__classPrivateFieldGet(this, _Dialog_instances, "a", _Dialog_dialog_get).open = true;
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
close() {
|
|
80
|
-
if (__classPrivateFieldGet(this, _Dialog_instances, "a", _Dialog_dialog_get).open) {
|
|
81
|
-
__classPrivateFieldGet(this, _Dialog_instances, "a", _Dialog_dialog_get).close();
|
|
82
|
-
this.dispatchEvent(new CustomEvent('close', {
|
|
83
|
-
bubbles: true,
|
|
84
|
-
composed: true,
|
|
85
|
-
detail: this.returnValue
|
|
86
|
-
}));
|
|
87
|
-
}
|
|
88
|
-
this.open = false;
|
|
89
|
-
__classPrivateFieldGet(this, _Dialog_instances, "m", _Dialog_handleModal).call(this, false);
|
|
90
|
-
}
|
|
91
|
-
show() {
|
|
92
|
-
__classPrivateFieldGet(this, _Dialog_instances, "a", _Dialog_dialog_get).show();
|
|
93
|
-
this.open = true;
|
|
94
|
-
}
|
|
95
|
-
showModal() {
|
|
96
|
-
__classPrivateFieldGet(this, _Dialog_instances, "a", _Dialog_dialog_get).showModal();
|
|
97
|
-
this.open = true;
|
|
98
|
-
__classPrivateFieldGet(this, _Dialog_instances, "m", _Dialog_handleModal).call(this, true);
|
|
99
|
-
}
|
|
100
|
-
connectedCallback() {
|
|
101
|
-
super.connectedCallback();
|
|
102
|
-
__classPrivateFieldGet(this, _Dialog_instances, "a", _Dialog_dialog_get).addEventListener('click', __classPrivateFieldGet(this, _Dialog_handleScrimClick, "f"));
|
|
103
|
-
__classPrivateFieldGet(this, _Dialog_instances, "a", _Dialog_dialog_get).addEventListener('submit', __classPrivateFieldGet(this, _Dialog_handleInternalFormSubmit, "f"));
|
|
104
|
-
}
|
|
105
|
-
disconnectedCallback() {
|
|
106
|
-
super.disconnectedCallback();
|
|
107
|
-
__classPrivateFieldGet(this, _Dialog_instances, "a", _Dialog_dialog_get).removeEventListener('click', __classPrivateFieldGet(this, _Dialog_handleScrimClick, "f"));
|
|
108
|
-
__classPrivateFieldGet(this, _Dialog_instances, "a", _Dialog_dialog_get).removeEventListener('submit', __classPrivateFieldGet(this, _Dialog_handleInternalFormSubmit, "f"));
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
_Dialog_modal = new WeakMap(), _Dialog_dialogElement = new WeakMap(), _Dialog_handleScrimClick = new WeakMap(), _Dialog_handleInternalFormSubmit = new WeakMap(), _Dialog_instances = new WeakSet(), _Dialog_dialog_get = function _Dialog_dialog_get() {
|
|
112
|
-
if (!__classPrivateFieldGet(this, _Dialog_dialogElement, "f")) {
|
|
113
|
-
__classPrivateFieldSet(this, _Dialog_dialogElement, this.shadowRoot.querySelector('dialog'), "f");
|
|
114
|
-
if (__classPrivateFieldGet(this, _Dialog_dialogElement, "f")) {
|
|
115
|
-
__classPrivateFieldGet(this, _Dialog_dialogElement, "f").open = this.open;
|
|
116
|
-
if (dialogPolyfill) {
|
|
117
|
-
dialogPolyfill.registerDialog(__classPrivateFieldGet(this, _Dialog_dialogElement, "f"));
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
return __classPrivateFieldGet(this, _Dialog_dialogElement, "f");
|
|
122
|
-
}, _Dialog_handleModal = function _Dialog_handleModal(show) {
|
|
123
|
-
__classPrivateFieldSet(this, _Dialog_modal, show, "f");
|
|
124
|
-
__classPrivateFieldGet(this, _Dialog_instances, "a", _Dialog_dialog_get).toggleAttribute('aria-modal', show);
|
|
125
|
-
__classPrivateFieldGet(this, _Dialog_instances, "a", _Dialog_dialog_get).classList.toggle('modal', show);
|
|
126
|
-
};
|
|
127
|
-
__decorate([attr({
|
|
128
|
-
mode: 'boolean'
|
|
129
|
-
}), __metadata("design:type", Object)], Dialog.prototype, "open", void 0);
|
|
130
|
-
__decorate([attr, __metadata("design:type", String)], Dialog.prototype, "icon", void 0);
|
|
131
|
-
__decorate([attr({
|
|
132
|
-
attribute: 'icon-placement'
|
|
133
|
-
}), __metadata("design:type", String)], Dialog.prototype, "iconPlacement", void 0);
|
|
134
|
-
__decorate([attr, __metadata("design:type", String)], Dialog.prototype, "text", void 0);
|
|
135
|
-
__decorate([attr, __metadata("design:type", String)], Dialog.prototype, "headline", void 0);
|
|
136
|
-
__decorate([attr({
|
|
137
|
-
attribute: 'aria-labelledby'
|
|
138
|
-
}), __metadata("design:type", Object)], Dialog.prototype, "ariaLabelledBy", void 0);
|
|
139
|
-
__decorate([attr({
|
|
140
|
-
attribute: 'aria-label'
|
|
141
|
-
}), __metadata("design:type", Object)], Dialog.prototype, "ariaLabel", void 0);
|
|
142
|
-
__decorate([attr({
|
|
143
|
-
attribute: 'aria-describedby'
|
|
144
|
-
}), __metadata("design:type", Object)], Dialog.prototype, "ariaDescribedBy", void 0);
|
|
145
|
-
|
|
146
|
-
let _ = t => t,
|
|
147
|
-
_t,
|
|
148
|
-
_t2,
|
|
149
|
-
_t3,
|
|
150
|
-
_t4,
|
|
151
|
-
_t5;
|
|
152
|
-
const getClasses = ({
|
|
153
|
-
iconPlacement
|
|
154
|
-
}) => classNames('base', [`icon-placement-${iconPlacement}`, Boolean(iconPlacement)]);
|
|
155
|
-
function icon(iconTag) {
|
|
156
|
-
return html(_t || (_t = _`
|
|
157
|
-
<${0} class="icon" name="${0}"></${0}>
|
|
158
|
-
`), iconTag, x => x.icon, iconTag);
|
|
159
|
-
}
|
|
160
|
-
function headline() {
|
|
161
|
-
return html(_t2 || (_t2 = _`
|
|
162
|
-
<div class="headline">
|
|
163
|
-
${0}
|
|
164
|
-
</div>
|
|
165
|
-
`), x => x.headline);
|
|
166
|
-
}
|
|
167
|
-
function renderDismissButton(buttonTag) {
|
|
168
|
-
return html(_t3 || (_t3 = _`
|
|
169
|
-
<${0}
|
|
170
|
-
size="condensed"
|
|
171
|
-
class="dismiss-button"
|
|
172
|
-
icon="close-line"
|
|
173
|
-
@click="${0}">
|
|
174
|
-
</${0}>`), buttonTag, x => {
|
|
175
|
-
x.open = false;
|
|
176
|
-
}, buttonTag);
|
|
177
|
-
}
|
|
178
|
-
function handleEscapeKey(dialog, event) {
|
|
179
|
-
if (event.key === 'Escape' && dialog.modal) {
|
|
180
|
-
dialog.open = false;
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
function content() {
|
|
184
|
-
return html(_t4 || (_t4 = _`
|
|
185
|
-
<div class="content">
|
|
186
|
-
${0}
|
|
187
|
-
</div>
|
|
188
|
-
`), x => x.text);
|
|
189
|
-
}
|
|
190
|
-
const DialogTemplate = context => {
|
|
191
|
-
const elevationTag = context.tagFor(Elevation);
|
|
192
|
-
const iconTag = context.tagFor(Icon);
|
|
193
|
-
const buttonTag = context.tagFor(Button);
|
|
194
|
-
return html(_t5 || (_t5 = _`
|
|
195
|
-
<${0} dp="12">
|
|
196
|
-
<div>
|
|
197
|
-
<dialog class="${0}"
|
|
198
|
-
@keydown="${0}"
|
|
199
|
-
returnValue="${0}"
|
|
200
|
-
aria-labelledby="${0}"
|
|
201
|
-
aria-label="${0}"
|
|
202
|
-
aria-describedby="${0}"
|
|
203
|
-
>
|
|
204
|
-
<slot name="main">
|
|
205
|
-
<div class="main-wrapper">
|
|
206
|
-
<div class="header">
|
|
207
|
-
<div class="headline-wrapper">
|
|
208
|
-
<slot name="graphic">
|
|
209
|
-
${0}
|
|
210
|
-
</slot>
|
|
211
|
-
${0}
|
|
212
|
-
</div>
|
|
213
|
-
${0}
|
|
214
|
-
</div>
|
|
215
|
-
<slot name="content">
|
|
216
|
-
${0}
|
|
217
|
-
</slot>
|
|
218
|
-
<slot name="footer"></slot>
|
|
219
|
-
</div>
|
|
220
|
-
</slot>
|
|
221
|
-
</dialog>
|
|
222
|
-
</div>
|
|
223
|
-
</${0}>`), elevationTag, getClasses, (x, c) => handleEscapeKey(x, c.event), x => x.returnValue, x => x.ariaLabelledBy, x => x.ariaLabel, x => x.ariaDescribedBy, when(x => x.icon, icon(iconTag)), when(x => x.headline, headline()), renderDismissButton(buttonTag), when(x => x.text, content()), elevationTag);
|
|
224
|
-
};
|
|
225
|
-
|
|
226
|
-
const prefix = getPrefix(import.meta.url);
|
|
227
|
-
const vividDialog = Dialog.compose({
|
|
228
|
-
baseName: 'dialog',
|
|
229
|
-
template: DialogTemplate,
|
|
230
|
-
styles: [css_248z, css_248z$1]
|
|
231
|
-
});
|
|
232
|
-
(async () => {
|
|
233
|
-
await loadComponentsModules(['icon', 'button', 'elevation'], prefix);
|
|
234
|
-
designSystem.withPrefix(prefix).register(vividDialog());
|
|
235
|
-
})();
|
|
236
|
-
|
|
237
|
-
export { vividDialog };
|
|
24
|
+
registerDialog();
|
package/divider/index.js
CHANGED
|
@@ -1,27 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import { c as classNames } from '../shared/class-names.js';
|
|
1
|
+
import { r as registerDivider } from '../shared/definition18.js';
|
|
2
|
+
import '../shared/index.js';
|
|
4
3
|
import '../shared/aria.js';
|
|
4
|
+
import '../shared/class-names.js';
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
let _ = t => t,
|
|
9
|
-
_t;
|
|
10
|
-
const getClasses = ({
|
|
11
|
-
orientation
|
|
12
|
-
}) => classNames('base', [`${orientation}`, Boolean(orientation)]);
|
|
13
|
-
const DividerTemplate = () => html(_t || (_t = _`
|
|
14
|
-
<span
|
|
15
|
-
class="${0}"
|
|
16
|
-
orientation="${0}"
|
|
17
|
-
role="${0}"
|
|
18
|
-
></span>`), getClasses, x => x.orientation, x => x.role);
|
|
19
|
-
|
|
20
|
-
const vividDivider = Divider.compose({
|
|
21
|
-
baseName: 'divider',
|
|
22
|
-
template: DividerTemplate,
|
|
23
|
-
styles: css_248z
|
|
24
|
-
});
|
|
25
|
-
designSystem.withPrefix(getPrefix(import.meta.url)).register(vividDivider());
|
|
26
|
-
|
|
27
|
-
export { vividDivider };
|
|
6
|
+
registerDivider();
|
package/elevation/index.js
CHANGED
|
@@ -1,25 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import { r as registerElevation } from '../shared/definition15.js';
|
|
2
|
+
import '../shared/index.js';
|
|
3
|
+
import '../shared/class-names.js';
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
let _ = t => t,
|
|
8
|
-
_t;
|
|
9
|
-
const getClasses = ({
|
|
10
|
-
dp,
|
|
11
|
-
noShadow
|
|
12
|
-
}) => classNames('control', [`dp-${dp}`, Boolean(dp)], ['no-shadow', Boolean(noShadow)]);
|
|
13
|
-
const elevationTemplate = () => html(_t || (_t = _`
|
|
14
|
-
<div class="${0}" part="base">
|
|
15
|
-
<slot></slot>
|
|
16
|
-
</div>`), getClasses);
|
|
17
|
-
|
|
18
|
-
const vividElevation = Elevation.compose({
|
|
19
|
-
baseName: 'elevation',
|
|
20
|
-
template: elevationTemplate,
|
|
21
|
-
styles: css_248z
|
|
22
|
-
});
|
|
23
|
-
designSystem.withPrefix(getPrefix(import.meta.url)).register(vividElevation());
|
|
24
|
-
|
|
25
|
-
export { vividElevation };
|
|
5
|
+
registerElevation();
|
package/fab/index.js
CHANGED
|
@@ -1,98 +1,22 @@
|
|
|
1
|
-
import '../shared/
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import { A as AffixIconWithTrailing, a as affixIconTemplateFactory } from '../shared/affix.js';
|
|
5
|
-
import { B as Button } from '../shared/button2.js';
|
|
6
|
-
import { a as applyMixins } from '../shared/apply-mixins.js';
|
|
7
|
-
import { f as focusTemplateFactory } from '../shared/focus.js';
|
|
8
|
-
import { r as ref } from '../shared/ref.js';
|
|
9
|
-
import { c as classNames } from '../shared/class-names.js';
|
|
1
|
+
import { r as registerFab } from '../shared/definition19.js';
|
|
2
|
+
import '../shared/index.js';
|
|
3
|
+
import '../shared/definition3.js';
|
|
10
4
|
import '../shared/icon.js';
|
|
5
|
+
import '../shared/to-string.js';
|
|
11
6
|
import '../shared/string-trim.js';
|
|
12
7
|
import '../shared/_has.js';
|
|
8
|
+
import '../shared/when.js';
|
|
9
|
+
import '../shared/class-names.js';
|
|
10
|
+
import '../shared/definition4.js';
|
|
11
|
+
import '../shared/focus.js';
|
|
12
|
+
import '../shared/affix.js';
|
|
13
|
+
import '../shared/button.js';
|
|
14
|
+
import '../shared/apply-mixins.js';
|
|
13
15
|
import '../shared/form-associated.js';
|
|
14
16
|
import '../shared/key-codes.js';
|
|
15
17
|
import '../shared/aria-global.js';
|
|
16
18
|
import '../shared/start-end.js';
|
|
19
|
+
import '../shared/ref.js';
|
|
17
20
|
import '../shared/focus2.js';
|
|
18
21
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
class Fab extends Button {}
|
|
22
|
-
__decorate([attr, __metadata("design:type", String)], Fab.prototype, "connotation", void 0);
|
|
23
|
-
__decorate([attr, __metadata("design:type", String)], Fab.prototype, "size", void 0);
|
|
24
|
-
__decorate([attr, __metadata("design:type", String)], Fab.prototype, "label", void 0);
|
|
25
|
-
applyMixins(Fab, AffixIconWithTrailing);
|
|
26
|
-
|
|
27
|
-
let _ = t => t,
|
|
28
|
-
_t;
|
|
29
|
-
const getClasses = ({
|
|
30
|
-
connotation,
|
|
31
|
-
size,
|
|
32
|
-
icon,
|
|
33
|
-
label,
|
|
34
|
-
iconTrailing,
|
|
35
|
-
disabled
|
|
36
|
-
}) => classNames('control', [`connotation-${connotation}`, Boolean(connotation)], [`size-${size}`, Boolean(size)], ['icon-only', !label && !!icon], ['icon-trailing', iconTrailing], ['disabled', disabled]);
|
|
37
|
-
const FabTemplate = context => {
|
|
38
|
-
const affixIconTemplate = affixIconTemplateFactory(context);
|
|
39
|
-
const focusTemplate = focusTemplateFactory(context);
|
|
40
|
-
return html(_t || (_t = _`
|
|
41
|
-
<button
|
|
42
|
-
class="${0} "
|
|
43
|
-
?autofocus="${0}"
|
|
44
|
-
?disabled="${0}"
|
|
45
|
-
form="${0}"
|
|
46
|
-
formaction="${0}"
|
|
47
|
-
formenctype="${0}"
|
|
48
|
-
formmethod="${0}"
|
|
49
|
-
formnovalidate="${0}"
|
|
50
|
-
formtarget="${0}"
|
|
51
|
-
name="${0}"
|
|
52
|
-
type="${0}"
|
|
53
|
-
value="${0}"
|
|
54
|
-
aria-atomic="${0}"
|
|
55
|
-
aria-busy="${0}"
|
|
56
|
-
aria-controls="${0}"
|
|
57
|
-
aria-current="${0}"
|
|
58
|
-
aria-describedby="${0}"
|
|
59
|
-
aria-details="${0}"
|
|
60
|
-
aria-disabled="${0}"
|
|
61
|
-
aria-errormessage="${0}"
|
|
62
|
-
aria-expanded="${0}"
|
|
63
|
-
aria-flowto="${0}"
|
|
64
|
-
aria-haspopup="${0}"
|
|
65
|
-
aria-hidden="${0}"
|
|
66
|
-
aria-invalid="${0}"
|
|
67
|
-
aria-keyshortcuts="${0}"
|
|
68
|
-
aria-label="${0}"
|
|
69
|
-
aria-labelledby="${0}"
|
|
70
|
-
aria-live="${0}"
|
|
71
|
-
aria-owns="${0}"
|
|
72
|
-
aria-pressed="${0}"
|
|
73
|
-
aria-relevant="${0}"
|
|
74
|
-
aria-roledescription="${0}"
|
|
75
|
-
${0}
|
|
76
|
-
>
|
|
77
|
-
${0}
|
|
78
|
-
${0}
|
|
79
|
-
${0}
|
|
80
|
-
</button>
|
|
81
|
-
`), getClasses, x => x.autofocus, x => x.disabled, x => x.formId, x => x.formaction, x => x.formenctype, x => x.formmethod, x => x.formnovalidate, x => x.formtarget, x => x.name, x => x.type, x => x.value, x => x.ariaAtomic, x => x.ariaBusy, x => x.ariaControls, x => x.ariaCurrent, x => x.ariaDescribedby, x => x.ariaDetails, x => x.ariaDisabled, x => x.ariaErrormessage, x => x.ariaExpanded, x => x.ariaFlowto, x => x.ariaHaspopup, x => x.ariaHidden, x => x.ariaInvalid, x => x.ariaKeyshortcuts, x => x.ariaLabel, x => x.ariaLabelledby, x => x.ariaLive, x => x.ariaOwns, x => x.ariaPressed, x => x.ariaRelevant, x => x.ariaRoledescription, ref('control'), () => focusTemplate, x => affixIconTemplate(x.icon), x => x.label);
|
|
82
|
-
};
|
|
83
|
-
|
|
84
|
-
const prefix = getPrefix(import.meta.url);
|
|
85
|
-
const vividFab = Fab.compose({
|
|
86
|
-
baseName: 'fab',
|
|
87
|
-
template: FabTemplate,
|
|
88
|
-
styles: css_248z,
|
|
89
|
-
shadowOptions: {
|
|
90
|
-
delegatesFocus: true
|
|
91
|
-
}
|
|
92
|
-
});
|
|
93
|
-
(async () => {
|
|
94
|
-
await loadComponentsModules(['icon', 'focus'], prefix);
|
|
95
|
-
designSystem.withPrefix(prefix).register(vividFab());
|
|
96
|
-
})();
|
|
97
|
-
|
|
98
|
-
export { vividFab };
|
|
22
|
+
registerFab();
|
package/focus/index.js
CHANGED
|
@@ -1,18 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
1
|
+
import { r as registerFocus } from '../shared/definition4.js';
|
|
2
|
+
import '../shared/index.js';
|
|
3
|
+
import '../shared/focus.js';
|
|
3
4
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
let _ = t => t,
|
|
7
|
-
_t;
|
|
8
|
-
const focusTemplate = () => html(_t || (_t = _`
|
|
9
|
-
<span class="control"></span>`));
|
|
10
|
-
|
|
11
|
-
const vividFocus = Focus.compose({
|
|
12
|
-
baseName: 'focus',
|
|
13
|
-
template: focusTemplate,
|
|
14
|
-
styles: css_248z
|
|
15
|
-
});
|
|
16
|
-
designSystem.withPrefix(getPrefix(import.meta.url)).register(vividFocus());
|
|
17
|
-
|
|
18
|
-
export { vividFocus };
|
|
5
|
+
registerFocus();
|
package/header/index.js
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import '../shared/
|
|
2
|
-
import {
|
|
3
|
-
import { l as loadComponentsModules } from '../shared/index2.js';
|
|
4
|
-
import { E as Elevation } from '../shared/elevation.js';
|
|
1
|
+
import { F as FoundationElement, _ as __decorate, a as attr, b as __metadata, h as html, r as registerFactorial } from '../shared/index.js';
|
|
2
|
+
import { E as Elevation, e as elevationElements } from '../shared/definition15.js';
|
|
5
3
|
import { c as classNames } from '../shared/class-names.js';
|
|
6
4
|
|
|
7
|
-
var css_248z = "/**\n * Do not edit directly\n * Generated on Wed, 14 Dec 2022
|
|
5
|
+
var css_248z = "/**\n * Do not edit directly\n * Generated on Wed, 14 Dec 2022 16:38:57 GMT\n */\n.base {\n z-index: 1;\n block-size: calc(calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2))) + calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) - 16)));\n font: var(--vvd-typography-heading-4);\n inline-size: 100%;\n}\n.base .header-content {\n display: inline-flex;\n align-items: center;\n column-gap: 4px;\n}\n\n.container {\n display: flex;\n box-sizing: border-box;\n justify-content: space-between;\n block-size: inherit;\n color: var(--vvd-color-canvas-text);\n column-gap: 12px;\n padding-block: 8px;\n padding-inline: 16px;\n}\n.container[part~=vvd-theme-alternate] {\n background-color: var(--vvd-color-canvas);\n color: var(--vvd-color-canvas-text);\n color-scheme: var(--vvd-color-scheme);\n}\n\n.app-content {\n --vvd-header-block-size: calc(calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2))) + calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) - 16)));\n}";
|
|
8
6
|
|
|
9
7
|
class Header extends FoundationElement {
|
|
10
8
|
constructor() {
|
|
@@ -49,15 +47,12 @@ const headerTemplate = context => {
|
|
|
49
47
|
`), elevationTag, x => !x.elevationShadow, getPartAlternate, elevationTag);
|
|
50
48
|
};
|
|
51
49
|
|
|
52
|
-
const
|
|
53
|
-
const vividHeader = Header.compose({
|
|
50
|
+
const header = Header.compose({
|
|
54
51
|
baseName: 'header',
|
|
55
52
|
template: headerTemplate,
|
|
56
53
|
styles: css_248z
|
|
57
|
-
});
|
|
58
|
-
(async () => {
|
|
59
|
-
await loadComponentsModules(['elevation'], prefix);
|
|
60
|
-
designSystem.withPrefix(prefix).register(vividHeader());
|
|
61
54
|
})();
|
|
55
|
+
const headerElements = [header, ...elevationElements];
|
|
56
|
+
const registerHeader = registerFactorial(headerElements);
|
|
62
57
|
|
|
63
|
-
|
|
58
|
+
registerHeader();
|
package/icon/index.js
CHANGED
|
@@ -1,31 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import '../shared/es.promise.resolve.js';
|
|
1
|
+
import { r as registerIcon } from '../shared/definition3.js';
|
|
2
|
+
import '../shared/index.js';
|
|
3
|
+
import '../shared/icon.js';
|
|
4
|
+
import '../shared/to-string.js';
|
|
6
5
|
import '../shared/string-trim.js';
|
|
7
6
|
import '../shared/_has.js';
|
|
7
|
+
import '../shared/when.js';
|
|
8
|
+
import '../shared/class-names.js';
|
|
8
9
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
let _ = t => t,
|
|
12
|
-
_t,
|
|
13
|
-
_t2;
|
|
14
|
-
const getClasses = ({
|
|
15
|
-
connotation,
|
|
16
|
-
size
|
|
17
|
-
}) => classNames('control', [`connotation-${connotation}`, Boolean(connotation)], [`size-${size}`, Boolean(size)]);
|
|
18
|
-
const iconTemplate = () => html(_t || (_t = _`
|
|
19
|
-
<figure class="${0}">
|
|
20
|
-
<slot>${0}</slot>
|
|
21
|
-
</figure>
|
|
22
|
-
`), getClasses, when(x => x._svg, x => html(_t2 || (_t2 = _`${0}`), x._svg)));
|
|
23
|
-
|
|
24
|
-
const vividIcon = Icon.compose({
|
|
25
|
-
baseName: 'icon',
|
|
26
|
-
template: iconTemplate,
|
|
27
|
-
styles: css_248z
|
|
28
|
-
});
|
|
29
|
-
designSystem.withPrefix(getPrefix(import.meta.url)).register(vividIcon());
|
|
30
|
-
|
|
31
|
-
export { vividIcon };
|
|
10
|
+
registerIcon();
|