@vonage/vivid 3.39.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.
Files changed (182) hide show
  1. package/accordion/index.js +2 -2
  2. package/accordion-item/index.js +2 -2
  3. package/alert/index.js +7 -5
  4. package/audio-player/index.js +33 -0
  5. package/avatar/index.js +2 -2
  6. package/badge/index.js +2 -2
  7. package/banner/index.js +9 -5
  8. package/breadcrumb/index.js +1 -1
  9. package/breadcrumb-item/index.js +3 -3
  10. package/button/index.js +5 -4
  11. package/calendar/index.js +1 -1
  12. package/calendar-event/index.js +1 -1
  13. package/card/index.js +4 -3
  14. package/checkbox/index.js +3 -3
  15. package/combobox/index.js +9 -7
  16. package/custom-elements.json +809 -5
  17. package/data-grid/index.js +3 -2
  18. package/date-picker/index.js +11 -9
  19. package/date-range-picker/index.js +11 -9
  20. package/dialog/index.js +10 -6
  21. package/divider/index.js +1 -1
  22. package/elevation/index.js +1 -1
  23. package/empty-state/index.js +2 -2
  24. package/fab/index.js +3 -3
  25. package/file-picker/index.js +6 -5
  26. package/focus/index.js +1 -1
  27. package/header/index.js +2 -2
  28. package/icon/index.js +1 -1
  29. package/index.js +60 -55
  30. package/layout/index.js +1 -1
  31. package/lib/alert/alert.d.ts +3 -1
  32. package/lib/alert/locale.d.ts +3 -0
  33. package/lib/audio-player/audio-player.d.ts +17 -0
  34. package/lib/audio-player/audio-player.template.d.ts +4 -0
  35. package/lib/audio-player/definition.d.ts +4 -0
  36. package/lib/audio-player/locale.d.ts +5 -0
  37. package/lib/banner/banner.d.ts +3 -1
  38. package/lib/banner/locale.d.ts +3 -0
  39. package/lib/card/card.d.ts +3 -0
  40. package/lib/card/card.template.d.ts +1 -1
  41. package/lib/card/definition.d.ts +1 -0
  42. package/lib/checkbox/checkbox.d.ts +2 -0
  43. package/lib/components.d.ts +2 -0
  44. package/lib/dialog/dialog.d.ts +4 -0
  45. package/lib/dialog/locale.d.ts +3 -0
  46. package/lib/enums.d.ts +2 -1
  47. package/lib/menu/menu.d.ts +1 -0
  48. package/lib/number-field/locale.d.ts +4 -0
  49. package/lib/number-field/number-field.d.ts +4 -2
  50. package/lib/progress/progress.d.ts +1 -0
  51. package/lib/progress-ring/progress-ring.d.ts +1 -0
  52. package/lib/radio/radio.d.ts +1 -0
  53. package/lib/selectable-box/definition.d.ts +3 -0
  54. package/lib/selectable-box/selectable-box.d.ts +12 -0
  55. package/lib/selectable-box/selectable-box.template.d.ts +4 -0
  56. package/lib/slider/definition.d.ts +1 -0
  57. package/lib/slider/slider.d.ts +5 -0
  58. package/lib/split-button/locale.d.ts +3 -0
  59. package/lib/split-button/split-button.d.ts +3 -1
  60. package/lib/text-area/text-area.d.ts +3 -0
  61. package/lib/text-field/text-field.d.ts +5 -2
  62. package/listbox/index.js +5 -4
  63. package/locales/en-GB.js +21 -0
  64. package/locales/en-US.js +21 -0
  65. package/locales/ja-JP.js +21 -0
  66. package/locales/zh-CN.js +21 -0
  67. package/menu/index.js +9 -8
  68. package/menu-item/index.js +3 -3
  69. package/nav/index.js +1 -1
  70. package/nav-disclosure/index.js +3 -3
  71. package/nav-item/index.js +3 -3
  72. package/note/index.js +2 -2
  73. package/number-field/index.js +8 -6
  74. package/option/index.js +3 -3
  75. package/package.json +1 -1
  76. package/pagination/index.js +6 -5
  77. package/popup/index.js +7 -6
  78. package/progress/index.js +1 -1
  79. package/progress-ring/index.js +1 -1
  80. package/radio/index.js +2 -2
  81. package/radio-group/index.js +2 -2
  82. package/select/index.js +10 -8
  83. package/selectable-box/index.js +23 -0
  84. package/shared/Reflector.js +65 -0
  85. package/shared/date-picker/calendar/segment.d.ts +21 -0
  86. package/shared/date-picker/date-picker-base.d.ts +1 -0
  87. package/shared/definition.js +3 -3
  88. package/shared/definition10.js +89 -227
  89. package/shared/definition11.js +151 -29
  90. package/shared/definition12.js +37 -766
  91. package/shared/definition13.js +747 -106
  92. package/shared/definition14.js +122 -192
  93. package/shared/definition15.js +156 -664
  94. package/shared/definition16.js +576 -1123
  95. package/shared/definition17.js +1278 -143
  96. package/shared/definition18.js +64 -298
  97. package/shared/definition19.js +358 -211
  98. package/shared/definition2.js +2 -2
  99. package/shared/definition20.js +259 -67
  100. package/shared/definition21.js +66 -58
  101. package/shared/definition22.js +43 -84
  102. package/shared/definition23.js +76 -2352
  103. package/shared/definition24.js +2362 -45
  104. package/shared/definition25.js +63 -27
  105. package/shared/definition26.js +24 -51
  106. package/shared/definition27.js +36 -813
  107. package/shared/definition28.js +837 -49
  108. package/shared/definition29.js +52 -89
  109. package/shared/definition3.js +1 -1
  110. package/shared/definition30.js +88 -24
  111. package/shared/definition31.js +25 -12
  112. package/shared/definition32.js +12 -52
  113. package/shared/definition33.js +28 -487
  114. package/shared/definition34.js +442 -197
  115. package/shared/definition35.js +260 -185
  116. package/shared/definition36.js +188 -69
  117. package/shared/definition37.js +72 -52
  118. package/shared/definition38.js +65 -421
  119. package/shared/definition39.js +435 -35
  120. package/shared/definition4.js +44 -16
  121. package/shared/definition40.js +32 -680
  122. package/shared/definition41.js +661 -77
  123. package/shared/definition42.js +103 -555
  124. package/shared/definition43.js +76 -103
  125. package/shared/definition44.js +522 -87
  126. package/shared/definition45.js +133 -22
  127. package/shared/definition46.js +131 -58
  128. package/shared/definition47.js +16 -501
  129. package/shared/definition48.js +69 -23
  130. package/shared/definition49.js +477 -108
  131. package/shared/definition5.js +160 -44
  132. package/shared/definition50.js +25 -271
  133. package/shared/definition51.js +103 -122
  134. package/shared/definition52.js +277 -122
  135. package/shared/definition53.js +274 -103
  136. package/shared/definition54.js +126 -71
  137. package/shared/definition55.js +128 -294
  138. package/shared/definition56.js +91 -13
  139. package/shared/definition57.js +298 -39
  140. package/shared/definition58.js +11 -175
  141. package/shared/definition59.js +47 -0
  142. package/shared/definition6.js +43 -33
  143. package/shared/definition60.js +181 -0
  144. package/shared/definition7.js +39 -105
  145. package/shared/definition8.js +122 -38
  146. package/shared/definition9.js +56 -89
  147. package/shared/enums.js +72 -0
  148. package/shared/icon.js +2 -2
  149. package/shared/index2.js +28 -1
  150. package/shared/key-codes.js +1 -1
  151. package/shared/key-codes2.js +9 -0
  152. package/shared/listbox.js +3 -8
  153. package/shared/localization/Locale.d.ts +12 -0
  154. package/shared/patterns/form-elements/form-elements.d.ts +6 -6
  155. package/shared/presentationDate.js +196 -143
  156. package/shared/radio.js +7 -0
  157. package/shared/text-field.js +1 -1
  158. package/shared/utils/Reflector.d.ts +8 -0
  159. package/shared/utils/randomId.d.ts +1 -0
  160. package/side-drawer/index.js +1 -1
  161. package/slider/index.js +3 -3
  162. package/split-button/index.js +6 -3
  163. package/style.css +889 -722
  164. package/styles/core/all.css +1 -1
  165. package/styles/core/theme.css +1 -1
  166. package/styles/core/typography.css +1 -1
  167. package/styles/tokens/theme-dark.css +4 -4
  168. package/styles/tokens/theme-light.css +4 -4
  169. package/styles/tokens/vivid-2-compat.css +1 -1
  170. package/switch/index.js +3 -3
  171. package/tab/index.js +3 -3
  172. package/tab-panel/index.js +1 -1
  173. package/tabs/index.js +5 -5
  174. package/tag/index.js +3 -3
  175. package/tag-group/index.js +1 -1
  176. package/text-area/index.js +4 -3
  177. package/text-field/index.js +4 -3
  178. package/toggletip/index.js +8 -7
  179. package/tooltip/index.js +8 -7
  180. package/tree-item/index.js +3 -3
  181. package/tree-view/index.js +1 -1
  182. package/vivid.api.json +392 -0
@@ -1,78 +1,270 @@
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';
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 Tue, 17 Oct 2023 15:27:52 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}";
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
- class Divider extends Divider$1 {
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 = ({ orientation }) => classNames(
173
+ const getClasses = ({
174
+ iconPlacement,
175
+ bodySlottedContent,
176
+ footerSlottedContent,
177
+ actionItemsSlottedContent
178
+ }) => classNames(
60
179
  "base",
61
- [`${orientation}`, Boolean(orientation)]
180
+ [`icon-placement-${iconPlacement}`, Boolean(iconPlacement)],
181
+ ["hide-body", !bodySlottedContent?.length],
182
+ [
183
+ "hide-footer",
184
+ !(footerSlottedContent?.length || actionItemsSlottedContent?.length)
185
+ ]
62
186
  );
63
- const DividerTemplate = () => html`
64
- <span
65
- class="${getClasses}"
66
- orientation="${(x) => x.orientation}"
67
- role="${(x) => x.role}"
68
- ></span>`;
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 dividerDefinition = Divider.compose({
71
- baseName: "divider",
72
- template: DividerTemplate,
73
- styles
262
+ const dialogDefinition = Dialog.compose({
263
+ baseName: "dialog",
264
+ template: DialogTemplate,
265
+ styles: isDialogSupported ? [styles] : [styles, dialogPolyfillStyles]
74
266
  });
75
- const dividerRegistries = [dividerDefinition()];
76
- const registerDivider = registerFactory(dividerRegistries);
267
+ const dialogRegistries = [dialogDefinition(), ...iconRegistries, ...buttonRegistries, ...elevationRegistries];
268
+ const registerDialog = registerFactory(dialogRegistries);
77
269
 
78
- export { Divider as D, dividerRegistries as a, dividerDefinition as d, registerDivider as r };
270
+ export { dialogRegistries as a, dialogDefinition as d, registerDialog as r };
@@ -1,70 +1,78 @@
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 './definition25.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';
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
- const styles = "/**\n * Do not edit directly\n * Generated on Tue, 17 Oct 2023 15:27:52 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}";
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
- var __defProp = Object.defineProperty;
11
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
12
- var __decorateClass = (decorators, target, key, kind) => {
13
- var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
14
- for (var i = decorators.length - 1, decorator; i >= 0; i--)
15
- if (decorator = decorators[i])
16
- result = (kind ? decorator(target, key, result) : decorator(result)) || result;
17
- if (kind && result)
18
- __defProp(target, key, result);
19
- return result;
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
- class EmptyState extends FoundationElement {
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 = (x) => classNames(
59
+ const getClasses = ({ orientation }) => classNames(
34
60
  "base",
35
- ["no-actions", x.slottedActionItems?.length === 0]
61
+ [`${orientation}`, Boolean(orientation)]
36
62
  );
37
- const EmptyStateTemplate = (context) => {
38
- const iconTag = context.tagFor(Icon);
39
- return html`
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>`;
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 emptyStateDefinition = EmptyState.compose({
63
- baseName: "empty-state",
64
- template: EmptyStateTemplate,
70
+ const dividerDefinition = Divider.compose({
71
+ baseName: "divider",
72
+ template: DividerTemplate,
65
73
  styles
66
74
  });
67
- const emptyStateRegistries = [emptyStateDefinition(), ...iconRegistries];
68
- const registerEmptyState = registerFactory(emptyStateRegistries);
75
+ const dividerRegistries = [dividerDefinition()];
76
+ const registerDivider = registerFactory(dividerRegistries);
69
77
 
70
- export { emptyStateRegistries as a, emptyStateDefinition as e, registerEmptyState as r };
78
+ export { Divider as D, dividerRegistries as a, dividerDefinition as d, registerDivider as r };
@@ -1,14 +1,11 @@
1
- import { a as attr, h as html, r as registerFactory } from './index.js';
2
- import { a as iconRegistries } from './definition25.js';
3
- import { f as focusRegistries } from './definition56.js';
4
- import { b as AffixIconWithTrailing, a as affixIconTemplateFactory, I as IconWrapper } from './affix.js';
5
- import { a as applyMixins } from './apply-mixins.js';
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 Tue, 17 Oct 2023 15:27:52 GMT\n */\n.control {\n position: relative;\n display: inline-flex;\n box-sizing: border-box;\n align-items: center;\n border: 0 none;\n background: var(--_appearance-color-fill, var(--_elevation-fill));\n block-size: var(--_fab-block-size);\n border-radius: var(--_fab-border-radius);\n color: var(--_appearance-color-text, var(--vvd-color-canvas-text));\n column-gap: var(--fab-icon-gap);\n filter: var(--_elevation-shadow);\n font: var(--vvd-typography-base-bold);\n transition: background-color 0.15s linear, filter 0.15s linear;\n vertical-align: middle;\n /* Size */\n}\n.control.connotation-accent {\n /* @cssprop [--vvd-fab-accent-primary=var(--vvd-color-canvas-text)] */\n --_connotation-color-primary: var(--vvd-fab-accent-primary, var(--vvd-color-canvas-text));\n /* @cssprop [--vvd-fab-accent-primary-text=var(--vvd-color-canvas)] */\n --_connotation-color-primary-text: var(--vvd-fab-accent-primary-text, var(--vvd-color-canvas));\n /* @cssprop [--vvd-fab-accent-primary-increment=var(--vvd-color-neutral-800)] */\n --_connotation-color-primary-increment: var(--vvd-fab-accent-primary-increment, var(--vvd-color-neutral-800));\n /* @cssprop [--vvd-fab-accent-contrast=var(--vvd-color-neutral-800)] */\n --_connotation-color-contrast: var(--vvd-fab-accent-contrast, var(--vvd-color-neutral-800));\n /* @cssprop [--vvd-fab-accent-fierce=var(--vvd-color-neutral-700)] */\n --_connotation-color-fierce: var(--vvd-fab-accent-fierce, var(--vvd-color-neutral-700));\n /* @cssprop [--vvd-fab-accent-firm=var(--vvd-color-canvas-text)] */\n --_connotation-color-firm: var(--vvd-fab-accent-firm, var(--vvd-color-canvas-text));\n}\n.control.connotation-cta {\n /* @cssprop [--vvd-fab-cta-primary=var(--vvd-color-cta-500)] */\n --_connotation-color-primary: var(--vvd-fab-cta-primary, var(--vvd-color-cta-500));\n /* @cssprop [--vvd-fab-cta-primary-text=var(--vvd-color-canvas)] */\n --_connotation-color-primary-text: var(--vvd-fab-cta-primary-text, var(--vvd-color-canvas));\n /* @cssprop [--vvd-fab-cta-primary-increment=var(--vvd-color-cta-600)] */\n --_connotation-color-primary-increment: var(--vvd-fab-cta-primary-increment, var(--vvd-color-cta-600));\n /* @cssprop [--vvd-fab-cta-contrast=var(--vvd-color-cta-800)] */\n --_connotation-color-contrast: var(--vvd-fab-cta-contrast, var(--vvd-color-cta-800));\n /* @cssprop [--vvd-fab-cta-fierce=var(--vvd-color-cta-700)] */\n --_connotation-color-fierce: var(--vvd-fab-cta-fierce, var(--vvd-color-cta-700));\n /* @cssprop [--vvd-fab-cta-firm=var(--vvd-color-cta-600)] */\n --_connotation-color-firm: var(--vvd-fab-cta-firm, var(--vvd-color-cta-600));\n}\n.control {\n --_appearance-color-text: var(--_connotation-color-primary-text);\n --_appearance-color-fill: var(--_connotation-color-primary);\n --_appearance-color-outline: transparent;\n}\n.control:where(:hover, .hover):where(:not(:disabled, .disabled, .readonly)) {\n --_appearance-color-text: var(--_connotation-color-primary-text);\n --_appearance-color-fill: var(--_connotation-color-primary-increment);\n --_appearance-color-outline: transparent;\n}\n.control:where(:disabled, .disabled) {\n --_appearance-color-text: var(--vvd-color-neutral-300);\n --_appearance-color-fill: var(--vvd-color-neutral-100);\n --_appearance-color-outline: transparent;\n}\n.control:where(:active, .active):where(:not(:disabled, .disabled)) {\n --_appearance-color-text: var(--_connotation-color-primary-text);\n --_appearance-color-fill: var(--_connotation-color-fierce);\n --_appearance-color-outline: transparent;\n}\n@supports selector(:focus-visible) {\n .control:focus-visible {\n outline: none;\n }\n}\n@supports (user-select: none) {\n .control {\n user-select: none;\n }\n}\n.control.size-expanded {\n --_fab-border-radius: 30px;\n --_fab-block-size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) + 16));\n}\n.control:not(.size-expanded) {\n --_fab-border-radius: 24px;\n --_fab-block-size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2)));\n}\n.control.icon-only {\n border-radius: 50%;\n padding-inline: 0;\n place-content: center;\n}\n@supports (aspect-ratio: 1) {\n .control.icon-only {\n aspect-ratio: 1;\n }\n}\n@supports not (aspect-ratio: 1) {\n .control.icon-only {\n inline-size: var(--_fab-block-size);\n }\n}\n.control:not(.icon-only) {\n --fab-icon-gap: 10px;\n padding-inline: 20px;\n}\n.control:disabled {\n --_elevation-fill: var(--vvd-color-surface-0dp);\n --_elevation-shadow: var(--vvd-shadow-surface-0dp);\n cursor: not-allowed;\n}\n.control:not(:disabled) {\n --_elevation-fill: var(--vvd-color-surface-4dp);\n --_elevation-shadow: var(--vvd-shadow-surface-4dp);\n cursor: pointer;\n}\n.control:not(:disabled):hover {\n --_elevation-fill: var(--vvd-color-surface-12dp);\n --_elevation-shadow: var(--vvd-shadow-surface-12dp);\n}\n.control:not(:disabled):active {\n --_elevation-fill: var(--vvd-color-surface-24dp);\n --_elevation-shadow: var(--vvd-shadow-surface-24dp);\n}\n\n/* Icon */\nslot[name=icon] {\n line-height: 1;\n}\n.icon-trailing slot[name=icon] {\n display: inline-block;\n order: 1;\n}\n.control.size-extended slot[name=icon] {\n font-size: calc(calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) + 16)) / 2.3333);\n}\n.control:not(.size-extended) slot[name=icon] {\n font-size: calc(calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2))) / 2);\n}\n\n:not(:focus-visible) .focus-indicator {\n display: none;\n}\n.control:not(.connotation-accent, .connotation-cta) .focus-indicator {\n --focus-stroke-gap-color: transparent;\n}";
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 Fab extends Button$1 {
21
+ class EmptyState extends FoundationElement {
25
22
  }
26
23
  __decorateClass([
27
24
  attr
28
- ], Fab.prototype, "connotation", 2);
25
+ ], EmptyState.prototype, "headline", 2);
29
26
  __decorateClass([
30
27
  attr
31
- ], Fab.prototype, "size", 2);
28
+ ], EmptyState.prototype, "icon", 2);
32
29
  __decorateClass([
33
- attr
34
- ], Fab.prototype, "label", 2);
35
- applyMixins(Fab, AffixIconWithTrailing);
30
+ observable
31
+ ], EmptyState.prototype, "slottedActionItems", 2);
36
32
 
37
- const getClasses = ({
38
- connotation,
39
- size,
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 FabTemplate = (context) => {
54
- const affixIconTemplate = affixIconTemplateFactory(context);
55
- const focusTemplate = focusTemplateFactory(context);
37
+ const EmptyStateTemplate = (context) => {
38
+ const iconTag = context.tagFor(Icon);
56
39
  return html`
57
- <button
58
- class="${getClasses} "
59
- ?autofocus="${(x) => x.autofocus}"
60
- ?disabled="${(x) => x.disabled}"
61
- form="${(x) => x.formId}"
62
- formaction="${(x) => x.formaction}"
63
- formenctype="${(x) => x.formenctype}"
64
- formmethod="${(x) => x.formmethod}"
65
- formnovalidate="${(x) => x.formnovalidate}"
66
- formtarget="${(x) => x.formtarget}"
67
- name="${(x) => x.name}"
68
- type="${(x) => x.type}"
69
- value="${(x) => x.value}"
70
- aria-atomic="${(x) => x.ariaAtomic}"
71
- aria-busy="${(x) => x.ariaBusy}"
72
- aria-controls="${(x) => x.ariaControls}"
73
- aria-current="${(x) => x.ariaCurrent}"
74
- aria-describedby="${(x) => x.ariaDescribedby}"
75
- aria-details="${(x) => x.ariaDetails}"
76
- aria-disabled="${(x) => x.ariaDisabled}"
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 fabDefinition = Fab.compose({
101
- baseName: "fab",
102
- template: FabTemplate,
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 fabRegistries = [fabDefinition(), ...iconRegistries, ...focusRegistries];
109
- const registerFab = registerFactory(fabRegistries);
67
+ const emptyStateRegistries = [emptyStateDefinition(), ...iconRegistries];
68
+ const registerEmptyState = registerFactory(emptyStateRegistries);
110
69
 
111
- export { fabRegistries as a, fabDefinition as f, registerFab as r };
70
+ export { emptyStateRegistries as a, emptyStateDefinition as e, registerEmptyState as r };