@vonage/vivid 3.36.0 → 3.38.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 (168) hide show
  1. package/accordion/index.js +3 -4
  2. package/accordion-item/index.js +3 -2
  3. package/alert/index.js +5 -4
  4. package/avatar/index.js +1 -1
  5. package/badge/index.js +2 -1
  6. package/banner/index.js +4 -3
  7. package/breadcrumb/index.js +0 -1
  8. package/breadcrumb-item/index.js +3 -2
  9. package/button/index.js +4 -3
  10. package/card/index.js +2 -3
  11. package/checkbox/index.js +3 -4
  12. package/combobox/index.js +7 -8
  13. package/custom-elements.json +386 -758
  14. package/data-grid/index.js +2 -3
  15. package/date-picker/index.js +10 -9
  16. package/date-range-picker/index.js +36 -0
  17. package/dialog/index.js +6 -7
  18. package/divider/index.js +1 -1
  19. package/elevation/index.js +1 -1
  20. package/empty-state/index.js +2 -3
  21. package/fab/index.js +4 -3
  22. package/file-picker/index.js +6 -4
  23. package/focus/index.js +1 -1
  24. package/header/index.js +2 -2
  25. package/icon/index.js +1 -1
  26. package/index.js +44 -42
  27. package/layout/index.js +1 -1
  28. package/lib/components.d.ts +1 -0
  29. package/lib/date-picker/date-picker.d.ts +5 -15
  30. package/lib/date-range-picker/date-range-picker.d.ts +16 -0
  31. package/lib/date-range-picker/definition.d.ts +3 -0
  32. package/lib/file-picker/file-picker.d.ts +8 -5
  33. package/lib/file-picker/file-picker.form-associated.d.ts +10 -0
  34. package/lib/file-picker/locale.d.ts +6 -0
  35. package/lib/number-field/number-field.d.ts +6 -2
  36. package/lib/tag-group/tag-group.d.ts +1 -0
  37. package/lib/tree-item/tree-item.template.d.ts +1 -1
  38. package/listbox/index.js +4 -5
  39. package/locales/en-GB.js +27 -3
  40. package/locales/en-US.js +27 -3
  41. package/locales/ja-JP.js +25 -1
  42. package/locales/zh-CN.js +25 -1
  43. package/menu/index.js +8 -9
  44. package/menu-item/index.js +4 -5
  45. package/nav/index.js +1 -1
  46. package/nav-disclosure/index.js +4 -3
  47. package/nav-item/index.js +4 -3
  48. package/note/index.js +3 -2
  49. package/number-field/index.js +6 -5
  50. package/option/index.js +4 -3
  51. package/package.json +1 -1
  52. package/pagination/index.js +5 -5
  53. package/popup/index.js +6 -5
  54. package/progress/index.js +1 -1
  55. package/progress-ring/index.js +1 -1
  56. package/radio/index.js +2 -2
  57. package/radio-group/index.js +2 -3
  58. package/select/index.js +8 -9
  59. package/shared/affix.js +5 -1
  60. package/shared/apply-mixins.js +1 -1
  61. package/shared/children.js +2 -2
  62. package/shared/date-picker/calendar/dateRange.d.ts +5 -0
  63. package/shared/date-picker/calendar/presentationDateRange.d.ts +5 -0
  64. package/shared/date-picker/date-picker-base.d.ts +20 -0
  65. package/shared/date-picker/date-picker-base.form-associated.d.ts +10 -0
  66. package/shared/date-picker/date-picker-base.template.d.ts +4 -0
  67. package/{lib → shared}/date-picker/locale.d.ts +6 -0
  68. package/shared/definition.js +5 -5
  69. package/shared/definition10.js +9 -14
  70. package/shared/definition11.js +1 -1
  71. package/shared/definition12.js +1 -1
  72. package/shared/definition13.js +3 -3
  73. package/shared/definition14.js +3 -3
  74. package/shared/definition15.js +5 -5
  75. package/shared/definition16.js +4 -5
  76. package/shared/definition17.js +59 -6016
  77. package/shared/definition18.js +350 -213
  78. package/shared/definition19.js +251 -67
  79. package/shared/definition2.js +2 -3
  80. package/shared/definition20.js +66 -58
  81. package/shared/definition21.js +43 -83
  82. package/shared/definition22.js +75 -2298
  83. package/shared/definition23.js +2361 -45
  84. package/shared/definition24.js +63 -27
  85. package/shared/definition25.js +24 -51
  86. package/shared/definition26.js +36 -806
  87. package/shared/definition27.js +820 -49
  88. package/shared/definition28.js +52 -89
  89. package/shared/definition29.js +88 -24
  90. package/shared/definition3.js +1 -1
  91. package/shared/definition30.js +25 -12
  92. package/shared/definition31.js +12 -53
  93. package/shared/definition32.js +29 -441
  94. package/shared/definition33.js +427 -197
  95. package/shared/definition34.js +260 -174
  96. package/shared/definition35.js +187 -69
  97. package/shared/definition36.js +68 -55
  98. package/shared/definition37.js +61 -422
  99. package/shared/definition38.js +435 -35
  100. package/shared/definition39.js +30 -679
  101. package/shared/definition4.js +3 -3
  102. package/shared/definition40.js +661 -77
  103. package/shared/definition41.js +77 -557
  104. package/shared/definition42.js +559 -106
  105. package/shared/definition43.js +105 -136
  106. package/shared/definition44.js +153 -17
  107. package/shared/definition45.js +16 -79
  108. package/shared/definition46.js +53 -475
  109. package/shared/definition47.js +506 -20
  110. package/shared/definition48.js +22 -121
  111. package/shared/definition49.js +115 -262
  112. package/shared/definition5.js +2 -2
  113. package/shared/definition50.js +248 -120
  114. package/shared/definition51.js +139 -123
  115. package/shared/definition52.js +84 -74
  116. package/shared/definition53.js +114 -70
  117. package/shared/definition54.js +81 -292
  118. package/shared/definition55.js +302 -13
  119. package/shared/definition56.js +11 -41
  120. package/shared/definition57.js +20 -154
  121. package/shared/definition58.js +181 -0
  122. package/shared/definition6.js +5 -5
  123. package/shared/definition7.js +4 -4
  124. package/shared/definition8.js +3 -3
  125. package/shared/definition9.js +1 -2
  126. package/shared/index.js +1 -1
  127. package/shared/index2.js +1 -1
  128. package/shared/listbox.js +1 -1
  129. package/shared/localization/Locale.d.ts +3 -1
  130. package/shared/localized.js +9 -0
  131. package/shared/patterns/affix.d.ts +3 -1
  132. package/shared/presentationDate.js +6133 -0
  133. package/shared/ref.js +1 -1
  134. package/shared/slotted.js +73 -3
  135. package/shared/text-anchor.template.js +4 -4
  136. package/shared/text-field.js +1 -1
  137. package/side-drawer/index.js +1 -1
  138. package/slider/index.js +2 -2
  139. package/split-button/index.js +4 -3
  140. package/style.css +265 -197
  141. package/styles/core/all.css +44 -13
  142. package/styles/core/theme.css +1 -1
  143. package/styles/core/typography.css +44 -13
  144. package/styles/tokens/theme-dark.css +4 -4
  145. package/styles/tokens/theme-light.css +4 -4
  146. package/styles/tokens/vivid-2-compat.css +1 -1
  147. package/switch/index.js +4 -3
  148. package/tab/index.js +4 -3
  149. package/tab-panel/index.js +1 -1
  150. package/tabs/index.js +6 -7
  151. package/tag/index.js +4 -3
  152. package/tag-group/index.js +1 -1
  153. package/text-anchor/index.js +1 -0
  154. package/text-area/index.js +4 -3
  155. package/text-field/index.js +4 -5
  156. package/toggletip/index.js +7 -6
  157. package/tooltip/index.js +7 -6
  158. package/tree-item/index.js +4 -5
  159. package/tree-view/index.js +1 -2
  160. package/vivid.api.json +105 -0
  161. package/lib/date-picker/date-picker.template.d.ts +0 -4
  162. package/shared/node-observation.js +0 -74
  163. /package/{lib → shared}/date-picker/calendar/calendarGrid.d.ts +0 -0
  164. /package/{lib → shared}/date-picker/calendar/dateStr.d.ts +0 -0
  165. /package/{lib → shared}/date-picker/calendar/month.d.ts +0 -0
  166. /package/{lib → shared}/date-picker/calendar/monthPickerGrid.d.ts +0 -0
  167. /package/{lib → shared}/date-picker/calendar/presentationDate.d.ts +0 -0
  168. /package/{lib → shared}/date-picker/calendar/year.d.ts +0 -0
@@ -1,78 +1,262 @@
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 './definition25.js';
3
+ import { B as Button, a as buttonRegistries } from './definition10.js';
4
+ import { E as Elevation, e as elevationRegistries } from './definition57.js';
5
+ import { I as Icon } from './icon.js';
6
+ import { w as when } from './when.js';
7
+ import { s as slotted } from './slotted.js';
3
8
  import { c as classNames } from './class-names.js';
4
9
 
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);
10
+ 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
11
 
54
- const styles = "/**\n * Do not edit directly\n * Generated on Wed, 13 Sep 2023 10:58:27 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}";
12
+ const styles = "/**\n * Do not edit directly\n * Generated on Fri, 13 Oct 2023 14:45:50 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
13
 
56
- class Divider extends Divider$1 {
14
+ var __defProp = Object.defineProperty;
15
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
16
+ var __decorateClass = (decorators, target, key, kind) => {
17
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
18
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
19
+ if (decorator = decorators[i])
20
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
21
+ if (kind && result)
22
+ __defProp(target, key, result);
23
+ return result;
24
+ };
25
+ const isDialogSupported = Boolean(HTMLDialogElement && HTMLDialogElement.prototype.showModal);
26
+ let dialogPolyfill;
27
+ (async () => {
28
+ if (!isDialogSupported) {
29
+ delete window.HTMLDialogElement;
30
+ dialogPolyfill = await import('./dialog-polyfill.esm.js');
31
+ }
32
+ })();
33
+ class Dialog extends FoundationElement {
34
+ constructor() {
35
+ super(...arguments);
36
+ this.open = false;
37
+ this.fullWidthBody = false;
38
+ this.ariaLabelledBy = null;
39
+ this.ariaLabel = null;
40
+ this.ariaDescribedBy = null;
41
+ this.#modal = false;
42
+ this.#handleScrimClick = (event) => {
43
+ if (event.target !== this.#dialog) {
44
+ return;
45
+ }
46
+ const rect = this.#dialog.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
+ this.#handleInternalFormSubmit = (event) => {
51
+ if (event.target.method !== "dialog") {
52
+ return;
53
+ }
54
+ this.open = false;
55
+ };
56
+ }
57
+ #modal;
58
+ set returnValue(value) {
59
+ this.#dialog.returnValue = value;
60
+ }
61
+ get returnValue() {
62
+ return this.#dialog?.returnValue;
63
+ }
64
+ get modal() {
65
+ return this.#modal;
66
+ }
67
+ #dialogElement;
68
+ get #dialog() {
69
+ if (!this.#dialogElement) {
70
+ this.#dialogElement = this.shadowRoot.querySelector("dialog");
71
+ if (this.#dialogElement) {
72
+ this.#dialogElement.open = this.open;
73
+ if (dialogPolyfill) {
74
+ dialogPolyfill.registerDialog(this.#dialogElement);
75
+ }
76
+ }
77
+ }
78
+ return this.#dialogElement;
79
+ }
80
+ openChanged(oldValue, newValue) {
81
+ if (oldValue === void 0) {
82
+ return;
83
+ }
84
+ if (!newValue) {
85
+ this.close();
86
+ } else {
87
+ if (this.#dialog) {
88
+ this.#dialog.open = true;
89
+ }
90
+ }
91
+ }
92
+ #handleScrimClick;
93
+ #handleInternalFormSubmit;
94
+ close() {
95
+ if (this.#dialog.open) {
96
+ this.#dialog.close();
97
+ this.$emit("close", this.returnValue, { bubbles: false });
98
+ }
99
+ this.open = false;
100
+ this.#handleModal(false);
101
+ }
102
+ #handleModal(show) {
103
+ this.#modal = show;
104
+ this.#dialog.toggleAttribute("aria-modal", show);
105
+ this.#dialog.classList.toggle("modal", show);
106
+ }
107
+ show() {
108
+ this.#dialog.show();
109
+ this.open = true;
110
+ }
111
+ showModal() {
112
+ this.#handleModal(true);
113
+ this.#dialog.showModal();
114
+ this.open = true;
115
+ }
116
+ connectedCallback() {
117
+ super.connectedCallback();
118
+ this.#dialog.addEventListener("mousedown", this.#handleScrimClick);
119
+ this.#dialog.addEventListener("submit", this.#handleInternalFormSubmit);
120
+ }
121
+ disconnectedCallback() {
122
+ super.disconnectedCallback();
123
+ this.#dialog.removeEventListener("mousedown", this.#handleScrimClick);
124
+ this.#dialog.removeEventListener("submit", this.#handleInternalFormSubmit);
125
+ }
57
126
  }
127
+ __decorateClass([
128
+ attr({ mode: "boolean" })
129
+ ], Dialog.prototype, "open", 2);
130
+ __decorateClass([
131
+ attr
132
+ ], Dialog.prototype, "icon", 2);
133
+ __decorateClass([
134
+ attr({ attribute: "icon-placement" })
135
+ ], Dialog.prototype, "iconPlacement", 2);
136
+ __decorateClass([
137
+ attr
138
+ ], Dialog.prototype, "subtitle", 2);
139
+ __decorateClass([
140
+ attr
141
+ ], Dialog.prototype, "headline", 2);
142
+ __decorateClass([
143
+ attr({ attribute: "full-width-body", mode: "boolean" })
144
+ ], Dialog.prototype, "fullWidthBody", 2);
145
+ __decorateClass([
146
+ attr({ attribute: "aria-labelledby" })
147
+ ], Dialog.prototype, "ariaLabelledBy", 2);
148
+ __decorateClass([
149
+ attr({ attribute: "aria-label" })
150
+ ], Dialog.prototype, "ariaLabel", 2);
151
+ __decorateClass([
152
+ attr({ attribute: "aria-describedby" })
153
+ ], Dialog.prototype, "ariaDescribedBy", 2);
154
+ __decorateClass([
155
+ observable
156
+ ], Dialog.prototype, "bodySlottedContent", 2);
157
+ __decorateClass([
158
+ observable
159
+ ], Dialog.prototype, "footerSlottedContent", 2);
160
+ __decorateClass([
161
+ observable
162
+ ], Dialog.prototype, "actionItemsSlottedContent", 2);
58
163
 
59
- const getClasses = ({ orientation }) => classNames(
164
+ const getClasses = ({
165
+ iconPlacement,
166
+ bodySlottedContent,
167
+ footerSlottedContent,
168
+ actionItemsSlottedContent
169
+ }) => classNames(
60
170
  "base",
61
- [`${orientation}`, Boolean(orientation)]
171
+ [`icon-placement-${iconPlacement}`, Boolean(iconPlacement)],
172
+ ["hide-body", !bodySlottedContent?.length],
173
+ [
174
+ "hide-footer",
175
+ !(footerSlottedContent?.length || actionItemsSlottedContent?.length)
176
+ ]
62
177
  );
63
- const DividerTemplate = () => html`
64
- <span
65
- class="${getClasses}"
66
- orientation="${(x) => x.orientation}"
67
- role="${(x) => x.role}"
68
- ></span>`;
178
+ function icon(iconTag) {
179
+ return html`
180
+ <${iconTag} class="icon" name="${(x) => x.icon}"></${iconTag}>
181
+ `;
182
+ }
183
+ function headline() {
184
+ return html`
185
+ <div class="headline">
186
+ ${(x) => x.headline}
187
+ </div>
188
+ `;
189
+ }
190
+ function subtitle() {
191
+ return html`
192
+ <div class="subtitle">
193
+ ${(x) => x.subtitle}
194
+ </div>
195
+ `;
196
+ }
197
+ function renderDismissButton(buttonTag) {
198
+ return html`
199
+ <${buttonTag}
200
+ size="condensed"
201
+ class="dismiss-button"
202
+ icon="close-line"
203
+ @click="${(x) => {
204
+ x.open = false;
205
+ }}">
206
+ </${buttonTag}>`;
207
+ }
208
+ function handleEscapeKey(dialog, event) {
209
+ if (event.key === "Escape" && dialog.modal) {
210
+ dialog.open = false;
211
+ }
212
+ return true;
213
+ }
214
+ const DialogTemplate = (context) => {
215
+ const elevationTag = context.tagFor(Elevation);
216
+ const iconTag = context.tagFor(Icon);
217
+ const buttonTag = context.tagFor(Button);
218
+ return html`
219
+ <${elevationTag} dp="8">
220
+ <dialog class="${getClasses}"
221
+ @keydown="${(x, c) => handleEscapeKey(x, c.event)}"
222
+ returnValue="${(x) => x.returnValue}"
223
+ aria-labelledby="${(x) => x.ariaLabelledBy}"
224
+ aria-label="${(x) => x.ariaLabel}"
225
+ aria-describedby="${(x) => x.ariaDescribedBy}"
226
+ >
227
+ <slot name="main">
228
+ <div class="main-wrapper">
229
+ <div class="header ${(x) => x.subtitle ? "border" : ""}">
230
+ <slot name="graphic">
231
+ ${when((x) => x.icon, icon(iconTag))}
232
+ </slot>
233
+ ${when((x) => x.headline, headline())}
234
+ ${when((x) => x.subtitle, subtitle())}
235
+ ${renderDismissButton(buttonTag)}
236
+ </div>
237
+ <div class="body ${(x) => x.fullWidthBody ? "full-width" : ""}" >
238
+ <slot name="body" ${slotted("bodySlottedContent")}></slot>
239
+ </div>
240
+ <div class="footer">
241
+ <div>
242
+ <slot name="footer" ${slotted("footerSlottedContent")}></slot>
243
+ </div>
244
+ <div class="actions">
245
+ <slot name="action-items" ${slotted("actionItemsSlottedContent")}></slot>
246
+ </div>
247
+ </div>
248
+ </div>
249
+ </slot>
250
+ </dialog>
251
+ </${elevationTag}>`;
252
+ };
69
253
 
70
- const dividerDefinition = Divider.compose({
71
- baseName: "divider",
72
- template: DividerTemplate,
73
- styles
254
+ const dialogDefinition = Dialog.compose({
255
+ baseName: "dialog",
256
+ template: DialogTemplate,
257
+ styles: isDialogSupported ? [styles] : [styles, dialogPolyfillStyles]
74
258
  });
75
- const dividerRegistries = [dividerDefinition()];
76
- const registerDivider = registerFactory(dividerRegistries);
259
+ const dialogRegistries = [dialogDefinition(), ...iconRegistries, ...buttonRegistries, ...elevationRegistries];
260
+ const registerDialog = registerFactory(dialogRegistries);
77
261
 
78
- export { Divider as D, dividerRegistries as a, dividerDefinition as d, registerDivider as r };
262
+ export { dialogRegistries as a, dialogDefinition as d, registerDialog as r };
@@ -2,8 +2,7 @@ import { F as FoundationElement, _ as __decorate, a as attr, o as observable, h
2
2
  import { A as AccordionItem$1, b as accordionItemRegistries } from './definition.js';
3
3
  import { b as keyEnd, c as keyHome, d as keyArrowDown, e as keyArrowUp } from './key-codes.js';
4
4
  import { w as wrapInBounds } from './numbers.js';
5
- import { e as elements } from './node-observation.js';
6
- import { s as slotted } from './slotted.js';
5
+ import { s as slotted, e as elements } from './slotted.js';
7
6
  import { c as classNames } from './class-names.js';
8
7
 
9
8
  /**
@@ -187,7 +186,7 @@ __decorate([
187
186
  observable
188
187
  ], Accordion$1.prototype, "accordionItems", void 0);
189
188
 
190
- const styles = "/**\n * Do not edit directly\n * Generated on Wed, 13 Sep 2023 10:58:27 GMT\n */\n.base {\n display: flex;\n box-sizing: border-box;\n flex-direction: column;\n}\n\n::slotted(:not(:only-of-type)) {\n border-bottom: 1px solid var(--vvd-color-neutral-200);\n}";
189
+ const styles = "/**\n * Do not edit directly\n * Generated on Fri, 13 Oct 2023 14:45:50 GMT\n */\n.base {\n display: flex;\n box-sizing: border-box;\n flex-direction: column;\n}\n\n::slotted(:not(:only-of-type)) {\n border-bottom: 1px solid var(--vvd-color-neutral-200);\n}";
191
190
 
192
191
  class Accordion extends Accordion$1 {
193
192
  constructor() {
@@ -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 './definition24.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 Wed, 13 Sep 2023 10:58:27 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 Fri, 13 Oct 2023 14:45:50 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 './definition24.js';
3
- import { f as focusRegistries } from './definition55.js';
4
- import { b as AffixIconWithTrailing, a as affixIconTemplateFactory } 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 './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';
9
6
  import { c as classNames } from './class-names.js';
10
7
 
11
- const styles = "/**\n * Do not edit directly\n * Generated on Wed, 13 Sep 2023 10:58:27 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 */\n.icon {\n line-height: 1;\n}\n.icon-trailing .icon {\n order: 1;\n}\n.control.size-extended .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) .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 Fri, 13 Oct 2023 14:45:50 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,90 +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
- }) => classNames(
45
- "control",
46
- [`connotation-${connotation}`, Boolean(connotation)],
47
- [`size-${size}`, Boolean(size)],
48
- ["icon-only", !label && !!icon],
49
- ["icon-trailing", iconTrailing],
50
- ["disabled", disabled]
33
+ const getClasses = (x) => classNames(
34
+ "base",
35
+ ["no-actions", x.slottedActionItems?.length === 0]
51
36
  );
52
- const FabTemplate = (context) => {
53
- const affixIconTemplate = affixIconTemplateFactory(context);
54
- const focusTemplate = focusTemplateFactory(context);
37
+ const EmptyStateTemplate = (context) => {
38
+ const iconTag = context.tagFor(Icon);
55
39
  return html`
56
- <button
57
- class="${getClasses} "
58
- ?autofocus="${(x) => x.autofocus}"
59
- ?disabled="${(x) => x.disabled}"
60
- form="${(x) => x.formId}"
61
- formaction="${(x) => x.formaction}"
62
- formenctype="${(x) => x.formenctype}"
63
- formmethod="${(x) => x.formmethod}"
64
- formnovalidate="${(x) => x.formnovalidate}"
65
- formtarget="${(x) => x.formtarget}"
66
- name="${(x) => x.name}"
67
- type="${(x) => x.type}"
68
- value="${(x) => x.value}"
69
- aria-atomic="${(x) => x.ariaAtomic}"
70
- aria-busy="${(x) => x.ariaBusy}"
71
- aria-controls="${(x) => x.ariaControls}"
72
- aria-current="${(x) => x.ariaCurrent}"
73
- aria-describedby="${(x) => x.ariaDescribedby}"
74
- aria-details="${(x) => x.ariaDetails}"
75
- aria-disabled="${(x) => x.ariaDisabled}"
76
- aria-errormessage="${(x) => x.ariaErrormessage}"
77
- aria-expanded="${(x) => x.ariaExpanded}"
78
- aria-flowto="${(x) => x.ariaFlowto}"
79
- aria-haspopup="${(x) => x.ariaHaspopup}"
80
- aria-hidden="${(x) => x.ariaHidden}"
81
- aria-invalid="${(x) => x.ariaInvalid}"
82
- aria-keyshortcuts="${(x) => x.ariaKeyshortcuts}"
83
- aria-label="${(x) => x.ariaLabel}"
84
- aria-labelledby="${(x) => x.ariaLabelledby}"
85
- aria-live="${(x) => x.ariaLive}"
86
- aria-owns="${(x) => x.ariaOwns}"
87
- aria-pressed="${(x) => x.ariaPressed}"
88
- aria-relevant="${(x) => x.ariaRelevant}"
89
- aria-roledescription="${(x) => x.ariaRoledescription}"
90
- ${ref("control")}
91
- >
92
- ${() => focusTemplate}
93
- ${(x) => affixIconTemplate(x.icon)}
94
- ${(x) => x.label}
95
- </button>
96
- `;
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>`;
97
60
  };
98
61
 
99
- const fabDefinition = Fab.compose({
100
- baseName: "fab",
101
- template: FabTemplate,
102
- styles,
103
- shadowOptions: {
104
- delegatesFocus: true
105
- }
62
+ const emptyStateDefinition = EmptyState.compose({
63
+ baseName: "empty-state",
64
+ template: EmptyStateTemplate,
65
+ styles
106
66
  });
107
- const fabRegistries = [fabDefinition(), ...iconRegistries, ...focusRegistries];
108
- const registerFab = registerFactory(fabRegistries);
67
+ const emptyStateRegistries = [emptyStateDefinition(), ...iconRegistries];
68
+ const registerEmptyState = registerFactory(emptyStateRegistries);
109
69
 
110
- export { fabRegistries as a, fabDefinition as f, registerFab as r };
70
+ export { emptyStateRegistries as a, emptyStateDefinition as e, registerEmptyState as r };