@vonage/vivid 3.37.0 → 3.39.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 (157) hide show
  1. package/accordion/index.js +2 -2
  2. package/accordion-item/index.js +2 -2
  3. package/alert/index.js +4 -4
  4. package/avatar/index.js +1 -1
  5. package/badge/index.js +1 -1
  6. package/banner/index.js +3 -3
  7. package/breadcrumb-item/index.js +2 -2
  8. package/button/index.js +3 -3
  9. package/card/index.js +2 -2
  10. package/checkbox/index.js +2 -2
  11. package/combobox/index.js +6 -6
  12. package/custom-elements.json +4199 -3875
  13. package/data-grid/index.js +1 -1
  14. package/date-picker/index.js +9 -7
  15. package/date-range-picker/index.js +36 -0
  16. package/dialog/index.js +5 -5
  17. package/divider/index.js +1 -1
  18. package/elevation/index.js +1 -1
  19. package/empty-state/index.js +2 -2
  20. package/fab/index.js +3 -3
  21. package/file-picker/index.js +5 -4
  22. package/focus/index.js +1 -1
  23. package/header/index.js +2 -2
  24. package/icon/index.js +1 -1
  25. package/index.js +43 -40
  26. package/layout/index.js +1 -1
  27. package/lib/components.d.ts +1 -0
  28. package/lib/date-picker/date-picker.d.ts +4 -14
  29. package/lib/date-range-picker/date-range-picker.d.ts +15 -0
  30. package/lib/date-range-picker/definition.d.ts +3 -0
  31. package/lib/file-picker/file-picker.d.ts +8 -5
  32. package/lib/file-picker/file-picker.form-associated.d.ts +10 -0
  33. package/lib/file-picker/locale.d.ts +6 -0
  34. package/lib/menu-item/menu-item.d.ts +6 -0
  35. package/lib/tag-group/tag-group.d.ts +1 -0
  36. package/listbox/index.js +4 -4
  37. package/locales/en-GB.js +27 -3
  38. package/locales/en-US.js +27 -3
  39. package/locales/ja-JP.js +25 -1
  40. package/locales/zh-CN.js +25 -1
  41. package/menu/index.js +7 -7
  42. package/menu-item/index.js +3 -3
  43. package/nav/index.js +1 -1
  44. package/nav-disclosure/index.js +3 -3
  45. package/nav-item/index.js +3 -3
  46. package/note/index.js +2 -2
  47. package/number-field/index.js +5 -5
  48. package/option/index.js +3 -3
  49. package/package.json +1 -1
  50. package/pagination/index.js +4 -4
  51. package/popup/index.js +5 -5
  52. package/progress/index.js +1 -1
  53. package/progress-ring/index.js +1 -1
  54. package/radio/index.js +2 -2
  55. package/radio-group/index.js +1 -1
  56. package/select/index.js +7 -7
  57. package/shared/date-picker/calendar/dateRange.d.ts +5 -0
  58. package/shared/date-picker/calendar/presentationDateRange.d.ts +5 -0
  59. package/shared/date-picker/date-picker-base.d.ts +19 -0
  60. package/shared/date-picker/date-picker-base.form-associated.d.ts +10 -0
  61. package/shared/date-picker/date-picker-base.template.d.ts +4 -0
  62. package/{lib → shared}/date-picker/locale.d.ts +6 -0
  63. package/shared/definition.js +4 -4
  64. package/shared/definition10.js +9 -14
  65. package/shared/definition11.js +1 -1
  66. package/shared/definition12.js +1 -1
  67. package/shared/definition13.js +3 -3
  68. package/shared/definition14.js +3 -3
  69. package/shared/definition15.js +5 -5
  70. package/shared/definition16.js +3 -3
  71. package/shared/definition17.js +44 -6055
  72. package/shared/definition18.js +353 -213
  73. package/shared/definition19.js +251 -67
  74. package/shared/definition2.js +1 -1
  75. package/shared/definition20.js +66 -58
  76. package/shared/definition21.js +43 -84
  77. package/shared/definition22.js +75 -2298
  78. package/shared/definition23.js +2361 -45
  79. package/shared/definition24.js +63 -27
  80. package/shared/definition25.js +24 -51
  81. package/shared/definition26.js +36 -805
  82. package/shared/definition27.js +828 -49
  83. package/shared/definition28.js +52 -89
  84. package/shared/definition29.js +88 -24
  85. package/shared/definition3.js +1 -1
  86. package/shared/definition30.js +25 -12
  87. package/shared/definition31.js +12 -53
  88. package/shared/definition32.js +28 -487
  89. package/shared/definition33.js +427 -197
  90. package/shared/definition34.js +260 -174
  91. package/shared/definition35.js +187 -69
  92. package/shared/definition36.js +68 -55
  93. package/shared/definition37.js +61 -421
  94. package/shared/definition38.js +435 -35
  95. package/shared/definition39.js +30 -679
  96. package/shared/definition4.js +3 -3
  97. package/shared/definition40.js +661 -77
  98. package/shared/definition41.js +77 -557
  99. package/shared/definition42.js +559 -106
  100. package/shared/definition43.js +105 -136
  101. package/shared/definition44.js +153 -17
  102. package/shared/definition45.js +16 -79
  103. package/shared/definition46.js +53 -475
  104. package/shared/definition47.js +506 -20
  105. package/shared/definition48.js +22 -121
  106. package/shared/definition49.js +115 -262
  107. package/shared/definition5.js +2 -2
  108. package/shared/definition50.js +248 -120
  109. package/shared/definition51.js +139 -123
  110. package/shared/definition52.js +84 -74
  111. package/shared/definition53.js +114 -69
  112. package/shared/definition54.js +81 -292
  113. package/shared/definition55.js +302 -13
  114. package/shared/definition56.js +11 -41
  115. package/shared/definition57.js +20 -154
  116. package/shared/definition58.js +181 -0
  117. package/shared/definition6.js +2 -2
  118. package/shared/definition7.js +2 -2
  119. package/shared/definition8.js +3 -3
  120. package/shared/index2.js +1 -1
  121. package/shared/listbox.js +1 -1
  122. package/shared/localization/Locale.d.ts +3 -1
  123. package/shared/localized.js +9 -0
  124. package/shared/presentationDate.js +6133 -0
  125. package/shared/text-anchor.template.js +4 -4
  126. package/shared/text-field.js +1 -1
  127. package/side-drawer/index.js +1 -1
  128. package/slider/index.js +2 -2
  129. package/split-button/index.js +3 -3
  130. package/style.css +246 -183
  131. package/styles/core/all.css +1 -1
  132. package/styles/core/theme.css +1 -1
  133. package/styles/core/typography.css +1 -1
  134. package/styles/tokens/theme-dark.css +4 -4
  135. package/styles/tokens/theme-light.css +4 -4
  136. package/styles/tokens/vivid-2-compat.css +1 -1
  137. package/switch/index.js +3 -3
  138. package/tab/index.js +3 -3
  139. package/tab-panel/index.js +1 -1
  140. package/tabs/index.js +5 -5
  141. package/tag/index.js +3 -3
  142. package/tag-group/index.js +1 -1
  143. package/text-area/index.js +3 -3
  144. package/text-field/index.js +3 -3
  145. package/toggletip/index.js +6 -6
  146. package/tooltip/index.js +6 -6
  147. package/tree-item/index.js +3 -3
  148. package/tree-view/index.js +1 -1
  149. package/vivid.api.json +105 -0
  150. package/lib/date-picker/date-picker.form-associated.d.ts +0 -11
  151. package/lib/date-picker/date-picker.template.d.ts +0 -4
  152. /package/{lib → shared}/date-picker/calendar/calendarGrid.d.ts +0 -0
  153. /package/{lib → shared}/date-picker/calendar/dateStr.d.ts +0 -0
  154. /package/{lib → shared}/date-picker/calendar/month.d.ts +0 -0
  155. /package/{lib → shared}/date-picker/calendar/monthPickerGrid.d.ts +0 -0
  156. /package/{lib → shared}/date-picker/calendar/presentationDate.d.ts +0 -0
  157. /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 Tue, 26 Sep 2023 13:00:58 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 Tue, 17 Oct 2023 15:27:52 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 };
@@ -186,7 +186,7 @@ __decorate([
186
186
  observable
187
187
  ], Accordion$1.prototype, "accordionItems", void 0);
188
188
 
189
- const styles = "/**\n * Do not edit directly\n * Generated on Tue, 26 Sep 2023 13:00:58 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 Tue, 17 Oct 2023 15:27:52 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}";
190
190
 
191
191
  class Accordion extends Accordion$1 {
192
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 Tue, 26 Sep 2023 13:00:58 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 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}";
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, 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 './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 Tue, 26 Sep 2023 13:00:58 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 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}";
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 };