@vonage/vivid 3.40.0 → 3.41.0
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/accordion/index.js +2 -2
- package/accordion-item/index.js +2 -2
- package/alert/index.js +6 -5
- package/audio-player/index.js +33 -0
- package/avatar/index.js +2 -2
- package/badge/index.js +2 -2
- package/banner/index.js +8 -5
- package/breadcrumb/index.js +1 -1
- package/breadcrumb-item/index.js +3 -3
- package/button/index.js +4 -4
- package/calendar/index.js +1 -1
- package/calendar-event/index.js +1 -1
- package/card/index.js +4 -3
- package/checkbox/index.js +3 -3
- package/combobox/index.js +8 -8
- package/custom-elements.json +330 -38
- package/data-grid/index.js +2 -2
- package/date-picker/index.js +9 -9
- package/date-range-picker/index.js +8 -8
- package/dialog/index.js +6 -6
- package/divider/index.js +1 -1
- package/elevation/index.js +1 -1
- package/empty-state/index.js +2 -2
- package/fab/index.js +3 -3
- package/file-picker/index.js +5 -5
- package/focus/index.js +1 -1
- package/header/index.js +2 -2
- package/icon/index.js +1 -1
- package/index.js +57 -56
- package/layout/index.js +1 -1
- package/lib/alert/alert.d.ts +3 -1
- package/lib/alert/locale.d.ts +3 -0
- package/lib/audio-player/audio-player.d.ts +17 -0
- package/lib/audio-player/audio-player.template.d.ts +4 -0
- package/lib/audio-player/definition.d.ts +4 -0
- package/lib/audio-player/locale.d.ts +5 -0
- package/lib/banner/banner.d.ts +3 -1
- package/lib/banner/locale.d.ts +3 -0
- package/lib/card/card.d.ts +3 -0
- package/lib/card/card.template.d.ts +1 -1
- package/lib/card/definition.d.ts +1 -0
- package/lib/checkbox/checkbox.d.ts +1 -0
- package/lib/components.d.ts +1 -0
- package/lib/enums.d.ts +2 -1
- package/lib/selectable-box/selectable-box.d.ts +1 -2
- package/lib/split-button/locale.d.ts +3 -0
- package/lib/split-button/split-button.d.ts +3 -1
- package/listbox/index.js +4 -4
- package/locales/en-GB.js +14 -0
- package/locales/en-US.js +14 -0
- package/locales/ja-JP.js +14 -0
- package/locales/zh-CN.js +14 -0
- package/menu/index.js +8 -8
- package/menu-item/index.js +3 -3
- package/nav/index.js +1 -1
- package/nav-disclosure/index.js +3 -3
- package/nav-item/index.js +3 -3
- package/note/index.js +2 -2
- package/number-field/index.js +6 -6
- package/option/index.js +3 -3
- package/package.json +1 -1
- package/pagination/index.js +5 -5
- package/popup/index.js +6 -6
- package/progress/index.js +1 -1
- package/progress-ring/index.js +1 -1
- package/radio/index.js +2 -2
- package/radio-group/index.js +2 -2
- package/select/index.js +8 -8
- package/selectable-box/index.js +5 -5
- package/shared/definition.js +3 -3
- package/shared/definition10.js +90 -159
- package/shared/definition11.js +151 -29
- package/shared/definition12.js +37 -766
- package/shared/definition13.js +747 -106
- package/shared/definition14.js +121 -198
- package/shared/definition15.js +156 -664
- package/shared/definition16.js +576 -1137
- package/shared/definition17.js +1278 -143
- package/shared/definition18.js +64 -305
- package/shared/definition19.js +357 -218
- package/shared/definition2.js +1 -1
- package/shared/definition20.js +259 -67
- package/shared/definition21.js +66 -58
- package/shared/definition22.js +43 -84
- package/shared/definition23.js +76 -2353
- package/shared/definition24.js +2362 -45
- package/shared/definition25.js +63 -27
- package/shared/definition26.js +24 -51
- package/shared/definition27.js +36 -822
- package/shared/definition28.js +837 -49
- package/shared/definition29.js +52 -89
- package/shared/definition3.js +1 -1
- package/shared/definition30.js +88 -24
- package/shared/definition31.js +25 -12
- package/shared/definition32.js +12 -52
- package/shared/definition33.js +28 -502
- package/shared/definition34.js +442 -197
- package/shared/definition35.js +260 -186
- package/shared/definition36.js +186 -75
- package/shared/definition37.js +70 -54
- package/shared/definition38.js +65 -421
- package/shared/definition39.js +437 -38
- package/shared/definition4.js +43 -16
- package/shared/definition40.js +32 -680
- package/shared/definition41.js +654 -105
- package/shared/definition42.js +105 -77
- package/shared/definition43.js +74 -567
- package/shared/definition44.js +568 -102
- package/shared/definition45.js +110 -135
- package/shared/definition46.js +153 -17
- package/shared/definition47.js +16 -79
- package/shared/definition48.js +53 -475
- package/shared/definition49.js +493 -25
- package/shared/definition5.js +160 -44
- package/shared/definition50.js +22 -121
- package/shared/definition51.js +113 -271
- package/shared/definition52.js +249 -243
- package/shared/definition53.js +270 -109
- package/shared/definition54.js +84 -74
- package/shared/definition55.js +114 -69
- package/shared/definition56.js +81 -292
- package/shared/definition57.js +302 -13
- package/shared/definition58.js +11 -41
- package/shared/definition59.js +20 -154
- package/shared/definition6.js +43 -33
- package/shared/definition60.js +181 -0
- package/shared/definition7.js +39 -106
- package/shared/definition8.js +122 -38
- package/shared/definition9.js +56 -89
- package/shared/enums.js +1 -0
- package/shared/icon.js +2 -2
- package/shared/index2.js +1 -1
- package/shared/listbox.js +1 -1
- package/shared/localization/Locale.d.ts +8 -0
- package/shared/patterns/form-elements/form-elements.d.ts +6 -6
- package/shared/presentationDate.js +5 -5
- package/shared/text-field.js +1 -1
- package/side-drawer/index.js +1 -1
- package/slider/index.js +3 -3
- package/split-button/index.js +6 -3
- package/style.css +248 -208
- 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/styles/tokens/vivid-2-compat.css +1 -1
- package/switch/index.js +3 -3
- package/tab/index.js +3 -3
- package/tab-panel/index.js +1 -1
- package/tabs/index.js +5 -5
- package/tag/index.js +3 -3
- package/tag-group/index.js +1 -1
- package/text-area/index.js +3 -3
- package/text-field/index.js +3 -3
- package/toggletip/index.js +7 -7
- package/tooltip/index.js +7 -7
- package/tree-item/index.js +3 -3
- package/tree-view/index.js +1 -1
- package/vivid.api.json +251 -0
package/shared/definition20.js
CHANGED
|
@@ -1,78 +1,270 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { a as attr, F as FoundationElement, o as observable, h as html, r as registerFactory } from './index.js';
|
|
2
|
+
import { a as iconRegistries } from './definition26.js';
|
|
3
|
+
import { B as Button, a as buttonRegistries } from './definition11.js';
|
|
4
|
+
import { E as Elevation, e as elevationRegistries } from './definition59.js';
|
|
5
|
+
import './affix.js';
|
|
6
|
+
import './index2.js';
|
|
7
|
+
import { L as Localized } from './localized.js';
|
|
8
|
+
import { a as applyMixins } from './apply-mixins.js';
|
|
9
|
+
import { I as Icon } from './icon.js';
|
|
10
|
+
import { w as when } from './when.js';
|
|
11
|
+
import { s as slotted } from './slotted.js';
|
|
3
12
|
import { c as classNames } from './class-names.js';
|
|
4
13
|
|
|
5
|
-
|
|
6
|
-
* Divider roles
|
|
7
|
-
* @public
|
|
8
|
-
*/
|
|
9
|
-
const DividerRole = {
|
|
10
|
-
/**
|
|
11
|
-
* The divider semantically separates content
|
|
12
|
-
*/
|
|
13
|
-
separator: "separator",
|
|
14
|
-
/**
|
|
15
|
-
* The divider has no semantic value and is for visual presentation only.
|
|
16
|
-
*/
|
|
17
|
-
presentation: "presentation",
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* A Divider Custom HTML Element.
|
|
22
|
-
* Implements the {@link https://www.w3.org/TR/wai-aria-1.1/#separator | ARIA separator } or {@link https://www.w3.org/TR/wai-aria-1.1/#presentation | ARIA presentation}.
|
|
23
|
-
*
|
|
24
|
-
* @public
|
|
25
|
-
*/
|
|
26
|
-
let Divider$1 = class Divider extends FoundationElement {
|
|
27
|
-
constructor() {
|
|
28
|
-
super(...arguments);
|
|
29
|
-
/**
|
|
30
|
-
* The role of the element.
|
|
31
|
-
*
|
|
32
|
-
* @public
|
|
33
|
-
* @remarks
|
|
34
|
-
* HTML Attribute: role
|
|
35
|
-
*/
|
|
36
|
-
this.role = DividerRole.separator;
|
|
37
|
-
/**
|
|
38
|
-
* The orientation of the divider.
|
|
39
|
-
*
|
|
40
|
-
* @public
|
|
41
|
-
* @remarks
|
|
42
|
-
* HTML Attribute: orientation
|
|
43
|
-
*/
|
|
44
|
-
this.orientation = Orientation.horizontal;
|
|
45
|
-
}
|
|
46
|
-
};
|
|
47
|
-
__decorate([
|
|
48
|
-
attr
|
|
49
|
-
], Divider$1.prototype, "role", void 0);
|
|
50
|
-
__decorate([
|
|
51
|
-
attr
|
|
52
|
-
], Divider$1.prototype, "orientation", void 0);
|
|
14
|
+
const dialogPolyfillStyles = "dialog {\n position: absolute;\n left: 0; right: 0;\n width: -moz-fit-content;\n width: -webkit-fit-content;\n width: fit-content;\n height: -moz-fit-content;\n height: -webkit-fit-content;\n height: fit-content;\n margin: auto;\n border: solid;\n padding: 1em;\n background: white;\n color: black;\n display: block;\n}\n\ndialog:not([open]) {\n display: none;\n}\n\ndialog + .backdrop {\n position: fixed;\n top: 0; right: 0; bottom: 0; left: 0;\n background: rgba(0,0,0,0.1);\n}\n\n._dialog_overlay {\n position: fixed;\n top: 0; right: 0; bottom: 0; left: 0;\n}\n\ndialog.fixed {\n position: fixed;\n top: 50%;\n transform: translate(0, -50%);\n}";
|
|
53
15
|
|
|
54
|
-
const styles = "/**\n * Do not edit directly\n * Generated on Wed,
|
|
16
|
+
const styles = "/**\n * Do not edit directly\n * Generated on Wed, 22 Nov 2023 16:09:43 GMT\n */\n.base {\n box-sizing: border-box;\n padding: 0;\n border: none;\n background-color: transparent;\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, var(--_dialog-default-max-inline-size));\n min-inline-size: var(--dialog-min-inline-size, 280px);\n}\n@media not all and (min-width: 600px) {\n .base {\n --_dialog-default-max-inline-size: 90vw;\n }\n}\n@media (min-width: 600px) {\n .base {\n --_dialog-default-max-inline-size: 560px;\n }\n}\n.base:not(.modal) {\n z-index: var(--dialog-z-index, 1);\n}\n.base.modal {\n position: fixed;\n box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);\n}\n.base.modal::backdrop {\n background-color: var(--vvd-color-canvas-text, currentColor);\n opacity: 0.5;\n}\n\n.main-wrapper {\n display: flex;\n box-sizing: border-box;\n flex-direction: column;\n gap: 24px;\n padding-block: 24px;\n}\n.main-wrapper > * {\n box-sizing: border-box;\n}\n\n.header {\n display: grid;\n align-items: flex-start;\n justify-content: space-between;\n inline-size: 100%;\n padding-inline: 24px;\n}\n.base:not(.icon-placement-side) .header {\n grid-template-columns: 1fr auto;\n grid-template-rows: auto auto auto;\n}\n.base:not(.icon-placement-side) .header .icon {\n font-size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) - 8));\n grid-column: 1/2;\n grid-row: 1/2;\n line-height: 1;\n margin-block-end: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) - 16));\n}\n.base.icon-placement-side .header {\n grid-template-columns: auto 1fr auto;\n grid-template-rows: auto auto;\n}\n.base.icon-placement-side .header .icon {\n font-size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) - 12));\n}\n.base.icon-placement-side .header ::slotted(*),\n.base.icon-placement-side .header .icon {\n grid-column: 1/2;\n grid-row: 1/-1;\n margin-inline-end: calc(calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) - 8)) / 2);\n}\n.header.border {\n position: relative;\n}\n.header.border::after {\n position: absolute;\n bottom: -24px;\n left: 0;\n background-color: var(--vvd-color-neutral-200);\n block-size: 1px;\n content: \"\";\n inline-size: 100%;\n}\n.base.hide-body .header.border::after {\n content: none;\n}\n\n.body:not(.full-width) {\n padding-inline: 24px;\n}\n.hide-body .body {\n display: none;\n}\n\n.footer {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 24px;\n padding-inline: 24px;\n}\n.hide-footer .footer {\n display: none;\n}\n.footer .actions {\n display: flex;\n align-self: flex-end;\n gap: 8px;\n}\n\n.dismiss-button {\n flex-shrink: 0;\n grid-column: -2/-1;\n grid-row: 1/-1;\n margin-block-start: -8px;\n margin-inline-end: -8px;\n margin-inline-start: 4px;\n}\n\n.headline {\n font: var(--vvd-typography-heading-4);\n}\n\n.subtitle {\n font: var(--vvd-typography-base);\n}\n\nslot[name=main] {\n display: block;\n overflow: hidden auto;\n max-width: inherit;\n max-height: inherit;\n border-radius: inherit;\n}";
|
|
55
17
|
|
|
56
|
-
|
|
18
|
+
var __defProp = Object.defineProperty;
|
|
19
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
20
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
21
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
22
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
23
|
+
if (decorator = decorators[i])
|
|
24
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
25
|
+
if (kind && result)
|
|
26
|
+
__defProp(target, key, result);
|
|
27
|
+
return result;
|
|
28
|
+
};
|
|
29
|
+
const isDialogSupported = Boolean(HTMLDialogElement && HTMLDialogElement.prototype.showModal);
|
|
30
|
+
let dialogPolyfill;
|
|
31
|
+
(async () => {
|
|
32
|
+
if (!isDialogSupported) {
|
|
33
|
+
delete window.HTMLDialogElement;
|
|
34
|
+
dialogPolyfill = await import('./dialog-polyfill.esm.js');
|
|
35
|
+
}
|
|
36
|
+
})();
|
|
37
|
+
class Dialog extends FoundationElement {
|
|
38
|
+
constructor() {
|
|
39
|
+
super(...arguments);
|
|
40
|
+
this.open = false;
|
|
41
|
+
this.fullWidthBody = false;
|
|
42
|
+
this.ariaLabelledBy = null;
|
|
43
|
+
this.ariaLabel = null;
|
|
44
|
+
this.ariaDescribedBy = null;
|
|
45
|
+
this.dismissButtonAriaLabel = null;
|
|
46
|
+
this.#modal = false;
|
|
47
|
+
this.#handleScrimClick = (event) => {
|
|
48
|
+
if (event.target !== this.#dialog) {
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
const rect = this.#dialog.getBoundingClientRect();
|
|
52
|
+
const clickedInDialog = rect.top <= event.clientY && event.clientY <= rect.top + rect.height && rect.left <= event.clientX && event.clientX <= rect.left + rect.width;
|
|
53
|
+
this.open = clickedInDialog;
|
|
54
|
+
};
|
|
55
|
+
this.#handleInternalFormSubmit = (event) => {
|
|
56
|
+
if (event.target.method !== "dialog") {
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
this.open = false;
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
#modal;
|
|
63
|
+
set returnValue(value) {
|
|
64
|
+
this.#dialog.returnValue = value;
|
|
65
|
+
}
|
|
66
|
+
get returnValue() {
|
|
67
|
+
return this.#dialog?.returnValue;
|
|
68
|
+
}
|
|
69
|
+
get modal() {
|
|
70
|
+
return this.#modal;
|
|
71
|
+
}
|
|
72
|
+
#dialogElement;
|
|
73
|
+
get #dialog() {
|
|
74
|
+
if (!this.#dialogElement) {
|
|
75
|
+
this.#dialogElement = this.shadowRoot.querySelector("dialog");
|
|
76
|
+
if (this.#dialogElement) {
|
|
77
|
+
this.#dialogElement.open = this.open;
|
|
78
|
+
if (dialogPolyfill) {
|
|
79
|
+
dialogPolyfill.registerDialog(this.#dialogElement);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
return this.#dialogElement;
|
|
84
|
+
}
|
|
85
|
+
openChanged(oldValue, newValue) {
|
|
86
|
+
if (oldValue === void 0) {
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
if (!newValue) {
|
|
90
|
+
this.close();
|
|
91
|
+
} else {
|
|
92
|
+
if (this.#dialog) {
|
|
93
|
+
this.#dialog.open = true;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
#handleScrimClick;
|
|
98
|
+
#handleInternalFormSubmit;
|
|
99
|
+
close() {
|
|
100
|
+
if (this.#dialog.open) {
|
|
101
|
+
this.#dialog.close();
|
|
102
|
+
this.$emit("close", this.returnValue, { bubbles: false });
|
|
103
|
+
}
|
|
104
|
+
this.open = false;
|
|
105
|
+
this.#handleModal(false);
|
|
106
|
+
}
|
|
107
|
+
#handleModal(show) {
|
|
108
|
+
this.#modal = show;
|
|
109
|
+
this.#dialog.toggleAttribute("aria-modal", show);
|
|
110
|
+
this.#dialog.classList.toggle("modal", show);
|
|
111
|
+
}
|
|
112
|
+
show() {
|
|
113
|
+
this.#dialog.show();
|
|
114
|
+
this.open = true;
|
|
115
|
+
}
|
|
116
|
+
showModal() {
|
|
117
|
+
this.#handleModal(true);
|
|
118
|
+
this.#dialog.showModal();
|
|
119
|
+
this.open = true;
|
|
120
|
+
}
|
|
121
|
+
connectedCallback() {
|
|
122
|
+
super.connectedCallback();
|
|
123
|
+
this.#dialog.addEventListener("mousedown", this.#handleScrimClick);
|
|
124
|
+
this.#dialog.addEventListener("submit", this.#handleInternalFormSubmit);
|
|
125
|
+
}
|
|
126
|
+
disconnectedCallback() {
|
|
127
|
+
super.disconnectedCallback();
|
|
128
|
+
this.#dialog.removeEventListener("mousedown", this.#handleScrimClick);
|
|
129
|
+
this.#dialog.removeEventListener("submit", this.#handleInternalFormSubmit);
|
|
130
|
+
}
|
|
57
131
|
}
|
|
132
|
+
__decorateClass([
|
|
133
|
+
attr({ mode: "boolean" })
|
|
134
|
+
], Dialog.prototype, "open", 2);
|
|
135
|
+
__decorateClass([
|
|
136
|
+
attr
|
|
137
|
+
], Dialog.prototype, "icon", 2);
|
|
138
|
+
__decorateClass([
|
|
139
|
+
attr({ attribute: "icon-placement" })
|
|
140
|
+
], Dialog.prototype, "iconPlacement", 2);
|
|
141
|
+
__decorateClass([
|
|
142
|
+
attr
|
|
143
|
+
], Dialog.prototype, "subtitle", 2);
|
|
144
|
+
__decorateClass([
|
|
145
|
+
attr
|
|
146
|
+
], Dialog.prototype, "headline", 2);
|
|
147
|
+
__decorateClass([
|
|
148
|
+
attr({ attribute: "full-width-body", mode: "boolean" })
|
|
149
|
+
], Dialog.prototype, "fullWidthBody", 2);
|
|
150
|
+
__decorateClass([
|
|
151
|
+
attr({ attribute: "aria-labelledby" })
|
|
152
|
+
], Dialog.prototype, "ariaLabelledBy", 2);
|
|
153
|
+
__decorateClass([
|
|
154
|
+
attr({ attribute: "aria-label" })
|
|
155
|
+
], Dialog.prototype, "ariaLabel", 2);
|
|
156
|
+
__decorateClass([
|
|
157
|
+
attr({ attribute: "aria-describedby" })
|
|
158
|
+
], Dialog.prototype, "ariaDescribedBy", 2);
|
|
159
|
+
__decorateClass([
|
|
160
|
+
attr({ attribute: "dismiss-button-aria-label" })
|
|
161
|
+
], Dialog.prototype, "dismissButtonAriaLabel", 2);
|
|
162
|
+
__decorateClass([
|
|
163
|
+
observable
|
|
164
|
+
], Dialog.prototype, "bodySlottedContent", 2);
|
|
165
|
+
__decorateClass([
|
|
166
|
+
observable
|
|
167
|
+
], Dialog.prototype, "footerSlottedContent", 2);
|
|
168
|
+
__decorateClass([
|
|
169
|
+
observable
|
|
170
|
+
], Dialog.prototype, "actionItemsSlottedContent", 2);
|
|
171
|
+
applyMixins(Dialog, Localized);
|
|
58
172
|
|
|
59
|
-
const getClasses = ({
|
|
173
|
+
const getClasses = ({
|
|
174
|
+
iconPlacement,
|
|
175
|
+
bodySlottedContent,
|
|
176
|
+
footerSlottedContent,
|
|
177
|
+
actionItemsSlottedContent
|
|
178
|
+
}) => classNames(
|
|
60
179
|
"base",
|
|
61
|
-
[
|
|
180
|
+
[`icon-placement-${iconPlacement}`, Boolean(iconPlacement)],
|
|
181
|
+
["hide-body", !bodySlottedContent?.length],
|
|
182
|
+
[
|
|
183
|
+
"hide-footer",
|
|
184
|
+
!(footerSlottedContent?.length || actionItemsSlottedContent?.length)
|
|
185
|
+
]
|
|
62
186
|
);
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
187
|
+
function icon(iconTag) {
|
|
188
|
+
return html`
|
|
189
|
+
<${iconTag} class="icon" name="${(x) => x.icon}"></${iconTag}>
|
|
190
|
+
`;
|
|
191
|
+
}
|
|
192
|
+
function headline() {
|
|
193
|
+
return html`
|
|
194
|
+
<div class="headline">
|
|
195
|
+
${(x) => x.headline}
|
|
196
|
+
</div>
|
|
197
|
+
`;
|
|
198
|
+
}
|
|
199
|
+
function subtitle() {
|
|
200
|
+
return html`
|
|
201
|
+
<div class="subtitle">
|
|
202
|
+
${(x) => x.subtitle}
|
|
203
|
+
</div>
|
|
204
|
+
`;
|
|
205
|
+
}
|
|
206
|
+
function renderDismissButton(buttonTag) {
|
|
207
|
+
return html`
|
|
208
|
+
<${buttonTag}
|
|
209
|
+
aria-label="${(x) => x.dismissButtonAriaLabel || x.locale.dialog.dismissButtonLabel}"
|
|
210
|
+
size="condensed"
|
|
211
|
+
class="dismiss-button"
|
|
212
|
+
icon="close-line"
|
|
213
|
+
@click="${(x) => x.open = false}"
|
|
214
|
+
></${buttonTag}>`;
|
|
215
|
+
}
|
|
216
|
+
function handleEscapeKey(dialog, event) {
|
|
217
|
+
if (event.key === "Escape" && dialog.modal) {
|
|
218
|
+
dialog.open = false;
|
|
219
|
+
}
|
|
220
|
+
return true;
|
|
221
|
+
}
|
|
222
|
+
const DialogTemplate = (context) => {
|
|
223
|
+
const elevationTag = context.tagFor(Elevation);
|
|
224
|
+
const iconTag = context.tagFor(Icon);
|
|
225
|
+
const buttonTag = context.tagFor(Button);
|
|
226
|
+
return html`
|
|
227
|
+
<${elevationTag} dp="8">
|
|
228
|
+
<dialog class="${getClasses}"
|
|
229
|
+
@keydown="${(x, c) => handleEscapeKey(x, c.event)}"
|
|
230
|
+
returnValue="${(x) => x.returnValue}"
|
|
231
|
+
aria-labelledby="${(x) => x.ariaLabelledBy}"
|
|
232
|
+
aria-label="${(x) => x.ariaLabel}"
|
|
233
|
+
aria-describedby="${(x) => x.ariaDescribedBy}"
|
|
234
|
+
>
|
|
235
|
+
<slot name="main">
|
|
236
|
+
<div class="main-wrapper">
|
|
237
|
+
<div class="header ${(x) => x.subtitle ? "border" : ""}">
|
|
238
|
+
<slot name="graphic">
|
|
239
|
+
${when((x) => x.icon, icon(iconTag))}
|
|
240
|
+
</slot>
|
|
241
|
+
${when((x) => x.headline, headline())}
|
|
242
|
+
${when((x) => x.subtitle, subtitle())}
|
|
243
|
+
${renderDismissButton(buttonTag)}
|
|
244
|
+
</div>
|
|
245
|
+
<div class="body ${(x) => x.fullWidthBody ? "full-width" : ""}" >
|
|
246
|
+
<slot name="body" ${slotted("bodySlottedContent")}></slot>
|
|
247
|
+
</div>
|
|
248
|
+
<div class="footer">
|
|
249
|
+
<div>
|
|
250
|
+
<slot name="footer" ${slotted("footerSlottedContent")}></slot>
|
|
251
|
+
</div>
|
|
252
|
+
<div class="actions">
|
|
253
|
+
<slot name="action-items" ${slotted("actionItemsSlottedContent")}></slot>
|
|
254
|
+
</div>
|
|
255
|
+
</div>
|
|
256
|
+
</div>
|
|
257
|
+
</slot>
|
|
258
|
+
</dialog>
|
|
259
|
+
</${elevationTag}>`;
|
|
260
|
+
};
|
|
69
261
|
|
|
70
|
-
const
|
|
71
|
-
baseName: "
|
|
72
|
-
template:
|
|
73
|
-
styles
|
|
262
|
+
const dialogDefinition = Dialog.compose({
|
|
263
|
+
baseName: "dialog",
|
|
264
|
+
template: DialogTemplate,
|
|
265
|
+
styles: isDialogSupported ? [styles] : [styles, dialogPolyfillStyles]
|
|
74
266
|
});
|
|
75
|
-
const
|
|
76
|
-
const
|
|
267
|
+
const dialogRegistries = [dialogDefinition(), ...iconRegistries, ...buttonRegistries, ...elevationRegistries];
|
|
268
|
+
const registerDialog = registerFactory(dialogRegistries);
|
|
77
269
|
|
|
78
|
-
export {
|
|
270
|
+
export { dialogRegistries as a, dialogDefinition as d, registerDialog as r };
|
package/shared/definition21.js
CHANGED
|
@@ -1,70 +1,78 @@
|
|
|
1
|
-
import { F as FoundationElement,
|
|
2
|
-
import {
|
|
3
|
-
import { I as Icon } from './icon.js';
|
|
4
|
-
import { w as when } from './when.js';
|
|
5
|
-
import { s as slotted } from './slotted.js';
|
|
1
|
+
import { F as FoundationElement, _ as __decorate, a as attr, h as html, r as registerFactory } from './index.js';
|
|
2
|
+
import { O as Orientation } from './aria.js';
|
|
6
3
|
import { c as classNames } from './class-names.js';
|
|
7
4
|
|
|
8
|
-
|
|
5
|
+
/**
|
|
6
|
+
* Divider roles
|
|
7
|
+
* @public
|
|
8
|
+
*/
|
|
9
|
+
const DividerRole = {
|
|
10
|
+
/**
|
|
11
|
+
* The divider semantically separates content
|
|
12
|
+
*/
|
|
13
|
+
separator: "separator",
|
|
14
|
+
/**
|
|
15
|
+
* The divider has no semantic value and is for visual presentation only.
|
|
16
|
+
*/
|
|
17
|
+
presentation: "presentation",
|
|
18
|
+
};
|
|
9
19
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
+
/**
|
|
21
|
+
* A Divider Custom HTML Element.
|
|
22
|
+
* Implements the {@link https://www.w3.org/TR/wai-aria-1.1/#separator | ARIA separator } or {@link https://www.w3.org/TR/wai-aria-1.1/#presentation | ARIA presentation}.
|
|
23
|
+
*
|
|
24
|
+
* @public
|
|
25
|
+
*/
|
|
26
|
+
let Divider$1 = class Divider extends FoundationElement {
|
|
27
|
+
constructor() {
|
|
28
|
+
super(...arguments);
|
|
29
|
+
/**
|
|
30
|
+
* The role of the element.
|
|
31
|
+
*
|
|
32
|
+
* @public
|
|
33
|
+
* @remarks
|
|
34
|
+
* HTML Attribute: role
|
|
35
|
+
*/
|
|
36
|
+
this.role = DividerRole.separator;
|
|
37
|
+
/**
|
|
38
|
+
* The orientation of the divider.
|
|
39
|
+
*
|
|
40
|
+
* @public
|
|
41
|
+
* @remarks
|
|
42
|
+
* HTML Attribute: orientation
|
|
43
|
+
*/
|
|
44
|
+
this.orientation = Orientation.horizontal;
|
|
45
|
+
}
|
|
20
46
|
};
|
|
21
|
-
|
|
47
|
+
__decorate([
|
|
48
|
+
attr
|
|
49
|
+
], Divider$1.prototype, "role", void 0);
|
|
50
|
+
__decorate([
|
|
51
|
+
attr
|
|
52
|
+
], Divider$1.prototype, "orientation", void 0);
|
|
53
|
+
|
|
54
|
+
const styles = "/**\n * Do not edit directly\n * Generated on Wed, 22 Nov 2023 16:09:43 GMT\n */\n:host {\n display: block;\n}\n\n.base {\n display: block;\n background-color: var(--vvd-color-neutral-200);\n}\n.base:not(.vertical) {\n block-size: 1px;\n inline-size: 100%;\n}\n.base.vertical {\n block-size: 100%;\n inline-size: 1px;\n}";
|
|
55
|
+
|
|
56
|
+
class Divider extends Divider$1 {
|
|
22
57
|
}
|
|
23
|
-
__decorateClass([
|
|
24
|
-
attr
|
|
25
|
-
], EmptyState.prototype, "headline", 2);
|
|
26
|
-
__decorateClass([
|
|
27
|
-
attr
|
|
28
|
-
], EmptyState.prototype, "icon", 2);
|
|
29
|
-
__decorateClass([
|
|
30
|
-
observable
|
|
31
|
-
], EmptyState.prototype, "slottedActionItems", 2);
|
|
32
58
|
|
|
33
|
-
const getClasses = (
|
|
59
|
+
const getClasses = ({ orientation }) => classNames(
|
|
34
60
|
"base",
|
|
35
|
-
[
|
|
61
|
+
[`${orientation}`, Boolean(orientation)]
|
|
36
62
|
);
|
|
37
|
-
const
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
(x) => x.icon,
|
|
44
|
-
html`<div class="icon-container">
|
|
45
|
-
<${iconTag} class="icon" name="${(x) => x.icon}" size="5"></${iconTag}>
|
|
46
|
-
</div>`
|
|
47
|
-
)}
|
|
48
|
-
</slot>
|
|
49
|
-
<div class="content">
|
|
50
|
-
${when(
|
|
51
|
-
(x) => x.headline,
|
|
52
|
-
html`<header>${(x) => x.headline}</header>`
|
|
53
|
-
)}
|
|
54
|
-
<slot></slot>
|
|
55
|
-
</div>
|
|
56
|
-
<div class="actions">
|
|
57
|
-
<slot name="action-items" ${slotted("slottedActionItems")}></slot>
|
|
58
|
-
</div>
|
|
59
|
-
</div>`;
|
|
60
|
-
};
|
|
63
|
+
const DividerTemplate = () => html`
|
|
64
|
+
<span
|
|
65
|
+
class="${getClasses}"
|
|
66
|
+
orientation="${(x) => x.orientation}"
|
|
67
|
+
role="${(x) => x.role}"
|
|
68
|
+
></span>`;
|
|
61
69
|
|
|
62
|
-
const
|
|
63
|
-
baseName: "
|
|
64
|
-
template:
|
|
70
|
+
const dividerDefinition = Divider.compose({
|
|
71
|
+
baseName: "divider",
|
|
72
|
+
template: DividerTemplate,
|
|
65
73
|
styles
|
|
66
74
|
});
|
|
67
|
-
const
|
|
68
|
-
const
|
|
75
|
+
const dividerRegistries = [dividerDefinition()];
|
|
76
|
+
const registerDivider = registerFactory(dividerRegistries);
|
|
69
77
|
|
|
70
|
-
export {
|
|
78
|
+
export { Divider as D, dividerRegistries as a, dividerDefinition as d, registerDivider as r };
|
package/shared/definition22.js
CHANGED
|
@@ -1,14 +1,11 @@
|
|
|
1
|
-
import { a as attr, h as html, r as registerFactory } from './index.js';
|
|
2
|
-
import { a as iconRegistries } from './
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { B as Button$1 } from './button.js';
|
|
7
|
-
import { f as focusTemplateFactory } from './focus2.js';
|
|
8
|
-
import { r as ref } from './ref.js';
|
|
1
|
+
import { F as FoundationElement, a as attr, o as observable, h as html, r as registerFactory } from './index.js';
|
|
2
|
+
import { a as iconRegistries } from './definition26.js';
|
|
3
|
+
import { I as Icon } from './icon.js';
|
|
4
|
+
import { w as when } from './when.js';
|
|
5
|
+
import { s as slotted } from './slotted.js';
|
|
9
6
|
import { c as classNames } from './class-names.js';
|
|
10
7
|
|
|
11
|
-
const styles = "/**\n * Do not edit directly\n * Generated on Wed,
|
|
8
|
+
const styles = "/**\n * Do not edit directly\n * Generated on Wed, 22 Nov 2023 16:09:43 GMT\n */\n:host {\n display: block;\n}\n\n.base {\n display: flex;\n box-sizing: border-box;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n block-size: 100%;\n gap: 24px;\n}\n\n.icon-container {\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: var(--vvd-color-neutral-100);\n block-size: 120px;\n border-radius: 50%;\n inline-size: 120px;\n}\n\n.content {\n display: flex;\n flex-direction: column;\n font: var(--vvd-typography-base);\n gap: 8px;\n text-align: center;\n}\n\nheader {\n font: var(--vvd-typography-base-bold);\n}\n\n.actions {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n justify-content: center;\n gap: 8px;\n}\n.base.no-actions .actions {\n display: none;\n}";
|
|
12
9
|
|
|
13
10
|
var __defProp = Object.defineProperty;
|
|
14
11
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -21,91 +18,53 @@ var __decorateClass = (decorators, target, key, kind) => {
|
|
|
21
18
|
__defProp(target, key, result);
|
|
22
19
|
return result;
|
|
23
20
|
};
|
|
24
|
-
class
|
|
21
|
+
class EmptyState extends FoundationElement {
|
|
25
22
|
}
|
|
26
23
|
__decorateClass([
|
|
27
24
|
attr
|
|
28
|
-
],
|
|
25
|
+
], EmptyState.prototype, "headline", 2);
|
|
29
26
|
__decorateClass([
|
|
30
27
|
attr
|
|
31
|
-
],
|
|
28
|
+
], EmptyState.prototype, "icon", 2);
|
|
32
29
|
__decorateClass([
|
|
33
|
-
|
|
34
|
-
],
|
|
35
|
-
applyMixins(Fab, AffixIconWithTrailing);
|
|
30
|
+
observable
|
|
31
|
+
], EmptyState.prototype, "slottedActionItems", 2);
|
|
36
32
|
|
|
37
|
-
const getClasses = (
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
icon,
|
|
41
|
-
label,
|
|
42
|
-
iconTrailing,
|
|
43
|
-
disabled,
|
|
44
|
-
iconSlottedContent
|
|
45
|
-
}) => classNames(
|
|
46
|
-
"control",
|
|
47
|
-
[`connotation-${connotation}`, Boolean(connotation)],
|
|
48
|
-
[`size-${size}`, Boolean(size)],
|
|
49
|
-
["icon-only", !label && !!(icon || iconSlottedContent?.length)],
|
|
50
|
-
["icon-trailing", iconTrailing],
|
|
51
|
-
["disabled", disabled]
|
|
33
|
+
const getClasses = (x) => classNames(
|
|
34
|
+
"base",
|
|
35
|
+
["no-actions", x.slottedActionItems?.length === 0]
|
|
52
36
|
);
|
|
53
|
-
const
|
|
54
|
-
const
|
|
55
|
-
const focusTemplate = focusTemplateFactory(context);
|
|
37
|
+
const EmptyStateTemplate = (context) => {
|
|
38
|
+
const iconTag = context.tagFor(Icon);
|
|
56
39
|
return html`
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
aria-errormessage="${(x) => x.ariaErrormessage}"
|
|
78
|
-
aria-expanded="${(x) => x.ariaExpanded}"
|
|
79
|
-
aria-flowto="${(x) => x.ariaFlowto}"
|
|
80
|
-
aria-haspopup="${(x) => x.ariaHaspopup}"
|
|
81
|
-
aria-hidden="${(x) => x.ariaHidden}"
|
|
82
|
-
aria-invalid="${(x) => x.ariaInvalid}"
|
|
83
|
-
aria-keyshortcuts="${(x) => x.ariaKeyshortcuts}"
|
|
84
|
-
aria-label="${(x) => x.ariaLabel}"
|
|
85
|
-
aria-labelledby="${(x) => x.ariaLabelledby}"
|
|
86
|
-
aria-live="${(x) => x.ariaLive}"
|
|
87
|
-
aria-owns="${(x) => x.ariaOwns}"
|
|
88
|
-
aria-pressed="${(x) => x.ariaPressed}"
|
|
89
|
-
aria-relevant="${(x) => x.ariaRelevant}"
|
|
90
|
-
aria-roledescription="${(x) => x.ariaRoledescription}"
|
|
91
|
-
${ref("control")}
|
|
92
|
-
>
|
|
93
|
-
${() => focusTemplate}
|
|
94
|
-
${(x) => affixIconTemplate(x.icon, IconWrapper.Slot)}
|
|
95
|
-
${(x) => x.label}
|
|
96
|
-
</button>
|
|
97
|
-
`;
|
|
40
|
+
<div class="${getClasses}">
|
|
41
|
+
<slot name="graphic">
|
|
42
|
+
${when(
|
|
43
|
+
(x) => x.icon,
|
|
44
|
+
html`<div class="icon-container">
|
|
45
|
+
<${iconTag} class="icon" name="${(x) => x.icon}" size="5"></${iconTag}>
|
|
46
|
+
</div>`
|
|
47
|
+
)}
|
|
48
|
+
</slot>
|
|
49
|
+
<div class="content">
|
|
50
|
+
${when(
|
|
51
|
+
(x) => x.headline,
|
|
52
|
+
html`<header>${(x) => x.headline}</header>`
|
|
53
|
+
)}
|
|
54
|
+
<slot></slot>
|
|
55
|
+
</div>
|
|
56
|
+
<div class="actions">
|
|
57
|
+
<slot name="action-items" ${slotted("slottedActionItems")}></slot>
|
|
58
|
+
</div>
|
|
59
|
+
</div>`;
|
|
98
60
|
};
|
|
99
61
|
|
|
100
|
-
const
|
|
101
|
-
baseName: "
|
|
102
|
-
template:
|
|
103
|
-
styles
|
|
104
|
-
shadowOptions: {
|
|
105
|
-
delegatesFocus: true
|
|
106
|
-
}
|
|
62
|
+
const emptyStateDefinition = EmptyState.compose({
|
|
63
|
+
baseName: "empty-state",
|
|
64
|
+
template: EmptyStateTemplate,
|
|
65
|
+
styles
|
|
107
66
|
});
|
|
108
|
-
const
|
|
109
|
-
const
|
|
67
|
+
const emptyStateRegistries = [emptyStateDefinition(), ...iconRegistries];
|
|
68
|
+
const registerEmptyState = registerFactory(emptyStateRegistries);
|
|
110
69
|
|
|
111
|
-
export {
|
|
70
|
+
export { emptyStateRegistries as a, emptyStateDefinition as e, registerEmptyState as r };
|