@vonage/vivid 3.0.0-next.5 → 3.0.0-next.52

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 (147) hide show
  1. package/README.md +135 -4
  2. package/accordion/index.js +2 -2
  3. package/accordion-item/index.js +26 -18
  4. package/action-group/index.js +49 -0
  5. package/badge/index.js +14 -18
  6. package/banner/index.js +20 -83
  7. package/breadcrumb/index.js +20 -16
  8. package/breadcrumb-item/index.js +14 -9
  9. package/button/index.js +28 -659
  10. package/calendar/index.js +37 -8
  11. package/calendar-event/index.js +117 -0
  12. package/card/index.js +134 -0
  13. package/checkbox/index.js +173 -0
  14. package/dialog/index.js +282 -0
  15. package/divider/index.js +88 -0
  16. package/elevation/index.js +4 -31
  17. package/fab/index.js +102 -0
  18. package/focus/index.js +20 -3
  19. package/header/index.js +68 -0
  20. package/icon/index.js +9 -3
  21. package/index.js +45 -20
  22. package/layout/index.js +4 -4
  23. package/lib/accordion-item/accordion-item.d.ts +2 -2
  24. package/lib/accordion-item/index.d.ts +2 -1
  25. package/lib/action-group/action-group.d.ts +10 -0
  26. package/lib/{sidenav-item/sidenav-item.template.d.ts → action-group/action-group.template.d.ts} +2 -2
  27. package/lib/{sidenav-item → action-group}/index.d.ts +1 -2
  28. package/lib/badge/badge.d.ts +6 -6
  29. package/lib/badge/index.d.ts +1 -1
  30. package/lib/banner/banner.d.ts +1 -1
  31. package/lib/banner/banner.template.d.ts +0 -2
  32. package/lib/banner/index.d.ts +1 -0
  33. package/lib/breadcrumb/breadcrumb.template.d.ts +4 -0
  34. package/lib/breadcrumb-item/breadcrumb-item.d.ts +1 -1
  35. package/lib/breadcrumb-item/index.d.ts +1 -0
  36. package/lib/button/button.d.ts +6 -5
  37. package/lib/button/index.d.ts +2 -19
  38. package/lib/calendar/calendar.d.ts +3 -1
  39. package/lib/calendar/index.d.ts +0 -1
  40. package/lib/calendar-event/calendar-event.d.ts +14 -0
  41. package/lib/calendar-event/calendar-event.template.d.ts +4 -0
  42. package/lib/calendar-event/index.d.ts +2 -0
  43. package/lib/card/card.d.ts +10 -0
  44. package/lib/{text/text.template.d.ts → card/card.template.d.ts} +2 -2
  45. package/lib/card/index.d.ts +4 -0
  46. package/lib/checkbox/checkbox.d.ts +5 -0
  47. package/lib/checkbox/checkbox.template.d.ts +4 -0
  48. package/lib/checkbox/index.d.ts +4 -0
  49. package/lib/components.d.ts +22 -10
  50. package/lib/dialog/dialog.d.ts +20 -0
  51. package/lib/dialog/dialog.template.d.ts +4 -0
  52. package/lib/dialog/index.d.ts +5 -0
  53. package/lib/divider/divider.d.ts +3 -0
  54. package/lib/divider/divider.template.d.ts +4 -0
  55. package/lib/divider/index.d.ts +2 -0
  56. package/lib/elevation/elevation.d.ts +1 -0
  57. package/lib/elevation/index.d.ts +1 -1
  58. package/lib/enums.d.ts +12 -6
  59. package/lib/fab/fab.d.ts +13 -0
  60. package/lib/fab/fab.template.d.ts +4 -0
  61. package/lib/fab/index.d.ts +4 -0
  62. package/lib/focus/index.d.ts +1 -1
  63. package/lib/header/header.d.ts +5 -0
  64. package/lib/header/header.template.d.ts +4 -0
  65. package/lib/header/index.d.ts +3 -0
  66. package/lib/icon/icon.d.ts +4 -3
  67. package/lib/layout/index.d.ts +1 -1
  68. package/lib/layout/layout.d.ts +3 -3
  69. package/lib/menu/index.d.ts +11 -0
  70. package/lib/menu/menu.d.ts +7 -0
  71. package/lib/menu/menu.template.d.ts +3 -0
  72. package/lib/nav/index.d.ts +2 -0
  73. package/lib/nav/nav.d.ts +3 -0
  74. package/lib/nav/nav.template.d.ts +4 -0
  75. package/lib/nav-disclosure/index.d.ts +4 -0
  76. package/lib/nav-disclosure/nav-disclosure.d.ts +10 -0
  77. package/lib/nav-disclosure/nav-disclosure.template.d.ts +4 -0
  78. package/lib/nav-item/index.d.ts +4 -0
  79. package/lib/{sidenav-item/sidenav-item.d.ts → nav-item/nav-item.d.ts} +2 -2
  80. package/lib/nav-item/nav-item.template.d.ts +4 -0
  81. package/lib/{text → note}/index.d.ts +1 -1
  82. package/lib/note/note.d.ts +10 -0
  83. package/lib/note/note.template.d.ts +5 -0
  84. package/lib/popup/index.d.ts +1 -1
  85. package/lib/popup/popup.d.ts +3 -15
  86. package/lib/progress/progress.d.ts +1 -1
  87. package/lib/progress-ring/progress-ring.d.ts +2 -1
  88. package/lib/side-drawer/index.d.ts +1 -1
  89. package/lib/side-drawer/side-drawer.d.ts +2 -7
  90. package/lib/side-drawer/side-drawer.template.d.ts +2 -2
  91. package/lib/text-anchor/text-anchor.d.ts +1 -1
  92. package/lib/text-field/index.d.ts +4 -0
  93. package/lib/text-field/text-field.d.ts +16 -0
  94. package/lib/text-field/text-field.template.d.ts +5 -0
  95. package/lib/tooltip/tooltip.d.ts +2 -4
  96. package/menu/index.js +661 -0
  97. package/nav/index.js +17 -0
  98. package/nav-disclosure/index.js +90 -0
  99. package/nav-item/index.js +43 -0
  100. package/note/index.js +68 -0
  101. package/package.json +48 -8
  102. package/popup/index.js +20 -2082
  103. package/progress/index.js +33 -24
  104. package/progress-ring/index.js +9 -3
  105. package/shared/anchor.js +8 -1
  106. package/shared/aria-global.js +3 -40
  107. package/shared/base-progress.js +5 -0
  108. package/shared/button.js +195 -0
  109. package/shared/calendar-event.js +26 -0
  110. package/shared/dialog-polyfill.esm.js +858 -0
  111. package/shared/enums.js +79 -0
  112. package/shared/es.object.assign.js +7 -6
  113. package/shared/export.js +972 -0
  114. package/shared/focus.js +5 -0
  115. package/shared/focus2.js +11 -0
  116. package/shared/form-associated.js +557 -0
  117. package/shared/icon.js +504 -508
  118. package/shared/index.js +79 -56
  119. package/shared/index2.js +26 -10
  120. package/shared/index3.js +2109 -0
  121. package/shared/iterators.js +61 -0
  122. package/shared/object-keys.js +13 -0
  123. package/shared/patterns/focus.d.ts +3 -0
  124. package/shared/patterns/form-elements.d.ts +22 -0
  125. package/shared/patterns/index.d.ts +1 -0
  126. package/shared/ref.js +41 -0
  127. package/shared/text-anchor.js +2 -11
  128. package/shared/text-anchor.template.js +5 -2
  129. package/shared/to-string.js +51 -0
  130. package/shared/web.dom-collections.iterator.js +61 -1074
  131. package/side-drawer/index.js +33 -51
  132. package/styles/fonts/SpeziaCompleteVariableItalicWeb.woff +0 -0
  133. package/styles/fonts/SpeziaCompleteVariableItalicWeb.woff2 +0 -0
  134. package/styles/fonts/SpeziaCompleteVariableUprightWeb.woff +0 -0
  135. package/styles/fonts/SpeziaCompleteVariableUprightWeb.woff2 +0 -0
  136. package/styles/fonts/SpeziaMonoCompleteVariableWeb.woff +0 -0
  137. package/styles/fonts/SpeziaMonoCompleteVariableWeb.woff2 +0 -0
  138. package/styles/fonts/spezia.css +12 -12
  139. package/styles/themes/dark.css +182 -176
  140. package/styles/themes/light.css +182 -176
  141. package/styles/typography/desktop.css +89 -0
  142. package/text-anchor/index.js +8 -1
  143. package/text-field/index.js +438 -0
  144. package/tooltip/index.js +19 -21
  145. package/lib/text/text.d.ts +0 -10
  146. package/sidenav-item/index.js +0 -38
  147. package/text/index.js +0 -45
@@ -0,0 +1,282 @@
1
+ import '../icon/index.js';
2
+ import '../button/index.js';
3
+ import '../shared/index2.js';
4
+ import { s as styleInject } from '../shared/style-inject.es.js';
5
+ import { F as FoundationElement, c as __classPrivateFieldGet, i as __classPrivateFieldSet, _ as __decorate, a as attr, b as __metadata, h as html, d as designSystem } from '../shared/index.js';
6
+ import '../shared/icon.js';
7
+ import '../shared/web.dom-collections.iterator.js';
8
+ import { w as when } from '../shared/when.js';
9
+ import { c as classNames } from '../shared/class-names.js';
10
+ import '../shared/export.js';
11
+ import '../shared/iterators.js';
12
+ import '../shared/to-string.js';
13
+ import '../shared/_has.js';
14
+ import '../focus/index.js';
15
+ import '../shared/focus.js';
16
+ import '../shared/affix.js';
17
+ import '../shared/button.js';
18
+ import '../shared/apply-mixins.js';
19
+ import '../shared/form-associated.js';
20
+ import '../shared/aria-global.js';
21
+ import '../shared/ref.js';
22
+ import '../shared/focus2.js';
23
+ import '../shared/object-keys.js';
24
+
25
+ var css_248z$1 = "dialog {\n position: absolute;\n left: 0; right: 0;\n width: -moz-fit-content;\n width: fit-content;\n height: -moz-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}";
26
+ styleInject(css_248z$1);
27
+
28
+ var css_248z = "/**\n * Do not edit directly\n * Generated on Mon, 05 Sep 2022 17:52:00 GMT\n */\n.base {\n box-sizing: border-box;\n padding: 0;\n border: none;\n background: var(--_elevation-fill);\n border-radius: 6px;\n color: var(--vvd-color-canvas-text);\n max-block-size: var(--dialog-max-block-size, calc(100vh - 64px));\n max-inline-size: var(--dialog-max-inline-size);\n min-inline-size: var(--dialog-min-inline-size, 280px);\n overflow-x: hidden;\n overflow-y: auto;\n}\n@media not all and (min-width: 600px) {\n .base {\n --dialog-max-inline-size: 90vw;\n }\n}\n@media (min-width: 600px) {\n .base {\n --dialog-max-inline-size: 560px;\n }\n}\n.base:not(.modal) {\n z-index: var(--dialog-z-index, 1);\n}\n\n.main-wrapper {\n display: flex;\n flex-direction: column;\n padding: 24px;\n gap: 8px;\n}\n\n.header {\n display: flex;\n align-items: flex-start;\n justify-content: space-between;\n gap: 4px;\n inline-size: 100%;\n}\n\n.dismiss-button {\n flex-shrink: 0;\n margin-top: -8px;\n margin-right: -8px;\n}\n\n.headline {\n font: var(--vvd-font-heading4);\n}\n.headline-wrapper {\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n row-gap: 24px;\n}\n\n.content {\n font: var(--vvd-font-base);\n}";
29
+ styleInject(css_248z);
30
+
31
+ var _Dialog_instances, _Dialog_modal, _Dialog_dialogElement, _Dialog_dialog_get, _Dialog_handleScrimClick, _Dialog_handleInternalFormSubmit, _Dialog_handleModal;
32
+ let dialogPolyfill;
33
+
34
+ (async () => {
35
+ if (!HTMLDialogElement || !HTMLDialogElement.prototype.showModal) {
36
+ delete window.HTMLDialogElement;
37
+ dialogPolyfill = await import('../shared/dialog-polyfill.esm.js');
38
+ }
39
+ })();
40
+
41
+ class Dialog extends FoundationElement {
42
+ constructor() {
43
+ super(...arguments);
44
+
45
+ _Dialog_instances.add(this);
46
+
47
+ this.open = false;
48
+ this.ariaLabelledBy = null;
49
+ this.ariaLabel = null;
50
+ this.ariaDescribedBy = null;
51
+
52
+ _Dialog_modal.set(this, false);
53
+
54
+ _Dialog_dialogElement.set(this, void 0);
55
+
56
+ _Dialog_handleScrimClick.set(this, event => {
57
+ if (event.target !== __classPrivateFieldGet(this, _Dialog_instances, "a", _Dialog_dialog_get)) {
58
+ return;
59
+ }
60
+
61
+ const rect = __classPrivateFieldGet(this, _Dialog_instances, "a", _Dialog_dialog_get).getBoundingClientRect();
62
+
63
+ const clickedInDialog = rect.top <= event.clientY && event.clientY <= rect.top + rect.height && rect.left <= event.clientX && event.clientX <= rect.left + rect.width;
64
+ this.open = clickedInDialog;
65
+ });
66
+
67
+ _Dialog_handleInternalFormSubmit.set(this, event => {
68
+ if (event.target.method !== 'dialog') {
69
+ return;
70
+ }
71
+
72
+ this.open = false;
73
+ });
74
+ }
75
+
76
+ set returnValue(value) {
77
+ __classPrivateFieldGet(this, _Dialog_instances, "a", _Dialog_dialog_get).returnValue = value;
78
+ }
79
+
80
+ get returnValue() {
81
+ var _a;
82
+
83
+ return (_a = __classPrivateFieldGet(this, _Dialog_instances, "a", _Dialog_dialog_get)) === null || _a === void 0 ? void 0 : _a.returnValue;
84
+ }
85
+
86
+ get modal() {
87
+ return __classPrivateFieldGet(this, _Dialog_modal, "f");
88
+ }
89
+
90
+ openChanged(oldValue, newValue) {
91
+ if (oldValue === undefined) {
92
+ return;
93
+ }
94
+
95
+ if (!newValue) {
96
+ this.close();
97
+ } else {
98
+ if (__classPrivateFieldGet(this, _Dialog_instances, "a", _Dialog_dialog_get)) {
99
+ __classPrivateFieldGet(this, _Dialog_instances, "a", _Dialog_dialog_get).open = true;
100
+ }
101
+ }
102
+ }
103
+
104
+ close() {
105
+ if (__classPrivateFieldGet(this, _Dialog_instances, "a", _Dialog_dialog_get).open) {
106
+ __classPrivateFieldGet(this, _Dialog_instances, "a", _Dialog_dialog_get).close();
107
+
108
+ this.dispatchEvent(new CustomEvent('close', {
109
+ bubbles: true,
110
+ composed: true,
111
+ detail: this.returnValue
112
+ }));
113
+ }
114
+
115
+ this.open = false;
116
+
117
+ __classPrivateFieldGet(this, _Dialog_instances, "m", _Dialog_handleModal).call(this, false);
118
+ }
119
+
120
+ show() {
121
+ __classPrivateFieldGet(this, _Dialog_instances, "a", _Dialog_dialog_get).show();
122
+
123
+ this.open = true;
124
+ }
125
+
126
+ showModal() {
127
+ __classPrivateFieldGet(this, _Dialog_instances, "a", _Dialog_dialog_get).showModal();
128
+
129
+ this.open = true;
130
+
131
+ __classPrivateFieldGet(this, _Dialog_instances, "m", _Dialog_handleModal).call(this, true);
132
+ }
133
+
134
+ connectedCallback() {
135
+ super.connectedCallback();
136
+
137
+ __classPrivateFieldGet(this, _Dialog_instances, "a", _Dialog_dialog_get).addEventListener('click', __classPrivateFieldGet(this, _Dialog_handleScrimClick, "f"));
138
+
139
+ __classPrivateFieldGet(this, _Dialog_instances, "a", _Dialog_dialog_get).addEventListener('submit', __classPrivateFieldGet(this, _Dialog_handleInternalFormSubmit, "f"));
140
+ }
141
+
142
+ disconnectedCallback() {
143
+ super.disconnectedCallback();
144
+
145
+ __classPrivateFieldGet(this, _Dialog_instances, "a", _Dialog_dialog_get).removeEventListener('click', __classPrivateFieldGet(this, _Dialog_handleScrimClick, "f"));
146
+
147
+ __classPrivateFieldGet(this, _Dialog_instances, "a", _Dialog_dialog_get).removeEventListener('submit', __classPrivateFieldGet(this, _Dialog_handleInternalFormSubmit, "f"));
148
+ }
149
+
150
+ }
151
+ _Dialog_modal = new WeakMap(), _Dialog_dialogElement = new WeakMap(), _Dialog_handleScrimClick = new WeakMap(), _Dialog_handleInternalFormSubmit = new WeakMap(), _Dialog_instances = new WeakSet(), _Dialog_dialog_get = function _Dialog_dialog_get() {
152
+ if (!__classPrivateFieldGet(this, _Dialog_dialogElement, "f")) {
153
+ __classPrivateFieldSet(this, _Dialog_dialogElement, this.shadowRoot.querySelector('dialog'), "f");
154
+
155
+ if (__classPrivateFieldGet(this, _Dialog_dialogElement, "f")) {
156
+ __classPrivateFieldGet(this, _Dialog_dialogElement, "f").open = this.open;
157
+
158
+ if (dialogPolyfill) {
159
+ dialogPolyfill.registerDialog(__classPrivateFieldGet(this, _Dialog_dialogElement, "f"));
160
+ }
161
+ }
162
+ }
163
+
164
+ return __classPrivateFieldGet(this, _Dialog_dialogElement, "f");
165
+ }, _Dialog_handleModal = function _Dialog_handleModal(show) {
166
+ __classPrivateFieldSet(this, _Dialog_modal, show, "f");
167
+
168
+ __classPrivateFieldGet(this, _Dialog_instances, "a", _Dialog_dialog_get).toggleAttribute('aria-modal', show);
169
+
170
+ __classPrivateFieldGet(this, _Dialog_instances, "a", _Dialog_dialog_get).classList.toggle('modal', show);
171
+ };
172
+
173
+ __decorate([attr({
174
+ mode: 'boolean'
175
+ }), __metadata("design:type", Object)], Dialog.prototype, "open", void 0);
176
+
177
+ __decorate([attr, __metadata("design:type", String)], Dialog.prototype, "icon", void 0);
178
+
179
+ __decorate([attr, __metadata("design:type", String)], Dialog.prototype, "text", void 0);
180
+
181
+ __decorate([attr, __metadata("design:type", String)], Dialog.prototype, "headline", void 0);
182
+
183
+ __decorate([attr({
184
+ attribute: 'aria-labelledby'
185
+ }), __metadata("design:type", Object)], Dialog.prototype, "ariaLabelledBy", void 0);
186
+
187
+ __decorate([attr({
188
+ attribute: 'aria-label'
189
+ }), __metadata("design:type", Object)], Dialog.prototype, "ariaLabel", void 0);
190
+
191
+ __decorate([attr({
192
+ attribute: 'aria-describedby'
193
+ }), __metadata("design:type", Object)], Dialog.prototype, "ariaDescribedBy", void 0);
194
+
195
+ let _2 = t => t,
196
+ _t,
197
+ _t2,
198
+ _t3,
199
+ _t4,
200
+ _t5;
201
+
202
+ const getClasses = _ => classNames('base');
203
+
204
+ function icon() {
205
+ return html(_t || (_t = _2`
206
+ <vwc-icon class="icon" size="large" type="${0}"></vwc-icon>
207
+ `), x => x.icon);
208
+ }
209
+
210
+ function headline() {
211
+ return html(_t2 || (_t2 = _2`
212
+ <div class="headline">
213
+ ${0}
214
+ </div>
215
+ `), x => x.headline);
216
+ }
217
+
218
+ function renderDismissButton() {
219
+ return html(_t3 || (_t3 = _2`
220
+ <vwc-button
221
+ density="condensed"
222
+ class="dismiss-button"
223
+ icon="close-line"
224
+ @click="${0}">
225
+ </vwc-button>`), x => {
226
+ x.open = false;
227
+ });
228
+ }
229
+
230
+ function handleEscapeKey(dialog, event) {
231
+ if (event.key === 'Escape' && dialog.modal) {
232
+ dialog.open = false;
233
+ }
234
+ }
235
+
236
+ function content() {
237
+ return html(_t4 || (_t4 = _2`
238
+ <div class="content">
239
+ ${0}
240
+ </div>
241
+ `), x => x.text);
242
+ }
243
+
244
+ const DialogTemplate = () => html(_t5 || (_t5 = _2`
245
+ <vwc-elevation dp="12">
246
+ <div>
247
+ <dialog class="${0}"
248
+ @keydown="${0}"
249
+ returnValue="${0}"
250
+ aria-labelledby="${0}"
251
+ aria-label="${0}"
252
+ aria-describedby="${0}"
253
+ >
254
+ <slot name="main">
255
+ <div class="main-wrapper">
256
+ <div class="header">
257
+ <div class="headline-wrapper">
258
+ <slot name="graphic">
259
+ ${0}
260
+ </slot>
261
+ ${0}
262
+ </div>
263
+ ${0}
264
+ </div>
265
+ <slot name="content">
266
+ ${0}
267
+ </slot>
268
+ <slot name="footer"></slot>
269
+ </div>
270
+ </slot>
271
+ </dialog>
272
+ </div>
273
+ </vwc-elevation>`), getClasses, (x, c) => handleEscapeKey(x, c.event), x => x.returnValue, x => x.ariaLabelledBy, x => x.ariaLabel, x => x.ariaDescribedBy, when(x => x.icon, icon()), when(x => x.headline, headline()), renderDismissButton(), when(x => x.text, content()));
274
+
275
+ const vividDialog = Dialog.compose({
276
+ baseName: 'dialog',
277
+ template: DialogTemplate,
278
+ styles: [css_248z, css_248z$1]
279
+ });
280
+ designSystem.register(vividDialog());
281
+
282
+ export { vividDialog };
@@ -0,0 +1,88 @@
1
+ import { F as FoundationElement, _ as __decorate, a as attr, h as html, d as designSystem } from '../shared/index.js';
2
+ import { s as styleInject } from '../shared/style-inject.es.js';
3
+ import { c as classNames } from '../shared/class-names.js';
4
+
5
+ /**
6
+ * Standard orientation values
7
+ */
8
+ const Orientation = {
9
+ horizontal: "horizontal",
10
+ vertical: "vertical",
11
+ };
12
+
13
+ /**
14
+ * Divider roles
15
+ * @public
16
+ */
17
+ const DividerRole = {
18
+ /**
19
+ * The divider semantically separates content
20
+ */
21
+ separator: "separator",
22
+ /**
23
+ * The divider has no semantic value and is for visual presentation only.
24
+ */
25
+ presentation: "presentation",
26
+ };
27
+
28
+ /**
29
+ * A Divider Custom HTML Element.
30
+ * 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}.
31
+ *
32
+ * @public
33
+ */
34
+ class Divider$1 extends FoundationElement {
35
+ constructor() {
36
+ super(...arguments);
37
+ /**
38
+ * The role of the element.
39
+ *
40
+ * @public
41
+ * @remarks
42
+ * HTML Attribute: role
43
+ */
44
+ this.role = DividerRole.separator;
45
+ /**
46
+ * The orientation of the divider.
47
+ *
48
+ * @public
49
+ * @remarks
50
+ * HTML Attribute: orientation
51
+ */
52
+ this.orientation = Orientation.horizontal;
53
+ }
54
+ }
55
+ __decorate([
56
+ attr
57
+ ], Divider$1.prototype, "role", void 0);
58
+ __decorate([
59
+ attr
60
+ ], Divider$1.prototype, "orientation", void 0);
61
+
62
+ var css_248z = "/**\n * Do not edit directly\n * Generated on Mon, 05 Sep 2022 17:52:00 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}";
63
+ styleInject(css_248z);
64
+
65
+ class Divider extends Divider$1 {}
66
+
67
+ let _ = t => t,
68
+ _t;
69
+
70
+ const getClasses = ({
71
+ orientation
72
+ }) => classNames('base', [`${orientation}`, Boolean(orientation)]);
73
+
74
+ const DividerTemplate = () => html(_t || (_t = _`
75
+ <span
76
+ class="${0}"
77
+ orientation="${0}"
78
+ role="${0}"
79
+ ></span>`), getClasses, x => x.orientation, x => x.role);
80
+
81
+ const vividDivider = Divider.compose({
82
+ baseName: 'divider',
83
+ template: DividerTemplate,
84
+ styles: css_248z
85
+ });
86
+ designSystem.register(vividDivider());
87
+
88
+ export { vividDivider };
@@ -1,31 +1,4 @@
1
- import { F as FoundationElement, _ as __decorate, a as attr, b as __metadata, h as html, d as designSystem } from '../shared/index.js';
2
- import { s as styleInject } from '../shared/style-inject.es.js';
3
- import { c as classNames } from '../shared/class-names.js';
4
-
5
- class Elevation extends FoundationElement {}
6
-
7
- __decorate([attr, __metadata("design:type", Number)], Elevation.prototype, "dp", void 0);
8
-
9
- var css_248z = ".control.dp-0 ::slotted(*) {\n background-color: var(--vvd-color-surface-0dp);\n filter: var(--vvd-shadow-surface-0dp);\n}\n.control.dp-2 ::slotted(*) {\n background-color: var(--vvd-color-surface-2dp);\n filter: var(--vvd-shadow-surface-2dp);\n}\n.control.dp-4 ::slotted(*) {\n background-color: var(--vvd-color-surface-4dp);\n filter: var(--vvd-shadow-surface-4dp);\n}\n.control.dp-8 ::slotted(*) {\n background-color: var(--vvd-color-surface-8dp);\n filter: var(--vvd-shadow-surface-8dp);\n}\n.control.dp-12 ::slotted(*) {\n background-color: var(--vvd-color-surface-12dp);\n filter: var(--vvd-shadow-surface-12dp);\n}\n.control.dp-16 ::slotted(*) {\n background-color: var(--vvd-color-surface-16dp);\n filter: var(--vvd-shadow-surface-16dp);\n}\n.control.dp-24 ::slotted(*) {\n background-color: var(--vvd-color-surface-24dp);\n filter: var(--vvd-shadow-surface-24dp);\n}\n.control:not(.dp-0, .dp-4, .dp-8, .dp-12, .dp-16, .dp-24) ::slotted(*) {\n background-color: var(--vvd-color-surface-2dp);\n filter: var(--vvd-shadow-surface-2dp);\n}";
10
- styleInject(css_248z);
11
-
12
- let _ = t => t,
13
- _t;
14
-
15
- const getClasses = ({
16
- dp
17
- }) => classNames('control', [`dp-${dp}`, Boolean(dp)]);
18
-
19
- const elevationTemplate = () => html(_t || (_t = _`
20
- <div class="${0}" part="base">
21
- <slot></slot>
22
- </div>`), getClasses);
23
-
24
- const VIVIDElevation = Elevation.compose({
25
- baseName: 'elevation',
26
- template: elevationTemplate,
27
- styles: css_248z
28
- });
29
- designSystem.register(VIVIDElevation());
30
-
31
- export { VIVIDElevation };
1
+ import '../shared/index.js';
2
+ export { v as vividElevation } from '../shared/index2.js';
3
+ import '../shared/style-inject.es.js';
4
+ import '../shared/class-names.js';
package/fab/index.js ADDED
@@ -0,0 +1,102 @@
1
+ import '../icon/index.js';
2
+ import '../focus/index.js';
3
+ import { _ as __decorate, a as attr, b as __metadata, h as html, d as designSystem } from '../shared/index.js';
4
+ import { s as styleInject } from '../shared/style-inject.es.js';
5
+ import { A as AffixIconWithTrailing, a as affixIconTemplateFactory } from '../shared/affix.js';
6
+ import { B as Button } from '../shared/button.js';
7
+ import { a as applyMixins } from '../shared/apply-mixins.js';
8
+ import { f as focusTemplateFactory } from '../shared/focus2.js';
9
+ import { r as ref } from '../shared/ref.js';
10
+ import { c as classNames } from '../shared/class-names.js';
11
+ import '../shared/icon.js';
12
+ import '../shared/export.js';
13
+ import '../shared/iterators.js';
14
+ import '../shared/to-string.js';
15
+ import '../shared/_has.js';
16
+ import '../shared/when.js';
17
+ import '../shared/focus.js';
18
+ import '../shared/web.dom-collections.iterator.js';
19
+ import '../shared/object-keys.js';
20
+ import '../shared/form-associated.js';
21
+ import '../shared/aria-global.js';
22
+
23
+ var css_248z = "/**\n * Do not edit directly\n * Generated on Mon, 05 Sep 2022 17:52:00 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-font-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 --_connotation-color-primary: var(--vvd-color-canvas-text);\n --_connotation-color-primary-text: var(--vvd-color-canvas);\n --_connotation-color-primary-increment: var(--vvd-color-neutral-800);\n --_connotation-color-contrast: var(--vvd-color-neutral-800);\n --_connotation-color-fierce: var(--vvd-color-neutral-700);\n --_connotation-color-firm: var(--vvd-color-canvas-text);\n}\n.control.connotation-cta {\n --_connotation-color-primary: var(--vvd-color-cta-500);\n --_connotation-color-primary-text: var(--vvd-color-canvas);\n --_connotation-color-primary-increment: var(--vvd-color-cta-600);\n --_connotation-color-contrast: var(--vvd-color-cta-800);\n --_connotation-color-fierce: var(--vvd-color-cta-700);\n --_connotation-color-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: transaprent;\n}\n.control:where(:hover, .hover):where(:not(:disabled, .disabled)) {\n --_appearance-color-text: var(--_connotation-color-primary-text);\n --_appearance-color-fill: var(--_connotation-color-primary-increment);\n --_appearance-color-outline: transaprent;\n}\n.control:where(:disabled, .disabled) {\n --_appearance-color-text: var(--vvd-color-neutral-400);\n --_appearance-color-fill: var(--vvd-color-neutral-200);\n --_appearance-color-outline: transaprent;\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: transaprent;\n}\n@supports selector(:focus-visible) {\n .control:focus {\n outline: none;\n }\n}\n@supports ((-webkit-user-select: none) or (user-select: none)) {\n .control {\n -webkit-user-select: none;\n user-select: none;\n }\n}\n.control.density-extended {\n --_fab-border-radius: 30px;\n --_fab-block-size: 56px;\n}\n.control:not(.density-extended) {\n --_fab-border-radius: 24px;\n --_fab-block-size: 40px;\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-trailing .icon {\n order: 1;\n}\n.density-extended .icon {\n font-size: 24px;\n}\n.icon:not(.density-extended) .icon {\n font-size: 20px;\n}\n\n:not(:focus-visible) .focus-indicator {\n display: none;\n}";
24
+ styleInject(css_248z);
25
+
26
+ class Fab extends Button {}
27
+
28
+ __decorate([attr, __metadata("design:type", String)], Fab.prototype, "connotation", void 0);
29
+
30
+ __decorate([attr, __metadata("design:type", String)], Fab.prototype, "density", void 0);
31
+
32
+ __decorate([attr, __metadata("design:type", String)], Fab.prototype, "label", void 0);
33
+
34
+ applyMixins(Fab, AffixIconWithTrailing);
35
+
36
+ let _ = t => t,
37
+ _t;
38
+
39
+ const getClasses = ({
40
+ connotation,
41
+ density,
42
+ icon,
43
+ label,
44
+ iconTrailing,
45
+ disabled
46
+ }) => classNames('control', [`connotation-${connotation}`, Boolean(connotation)], [`density-${density}`, Boolean(density)], ['icon-only', !label && !!icon], ['icon-trailing', iconTrailing], ['disabled', disabled]);
47
+
48
+ const FabTemplate = context => {
49
+ const affixIconTemplate = affixIconTemplateFactory(context);
50
+ const focusTemplate = focusTemplateFactory(context);
51
+ return html(_t || (_t = _`
52
+ <button
53
+ class="${0} "
54
+ ?autofocus="${0}"
55
+ ?disabled="${0}"
56
+ form="${0}"
57
+ formaction="${0}"
58
+ formenctype="${0}"
59
+ formmethod="${0}"
60
+ formnovalidate="${0}"
61
+ formtarget="${0}"
62
+ name="${0}"
63
+ type="${0}"
64
+ value="${0}"
65
+ aria-atomic="${0}"
66
+ aria-busy="${0}"
67
+ aria-controls="${0}"
68
+ aria-current="${0}"
69
+ aria-describedby="${0}"
70
+ aria-details="${0}"
71
+ aria-disabled="${0}"
72
+ aria-errormessage="${0}"
73
+ aria-expanded="${0}"
74
+ aria-flowto="${0}"
75
+ aria-haspopup="${0}"
76
+ aria-hidden="${0}"
77
+ aria-invalid="${0}"
78
+ aria-keyshortcuts="${0}"
79
+ aria-label="${0}"
80
+ aria-labelledby="${0}"
81
+ aria-live="${0}"
82
+ aria-owns="${0}"
83
+ aria-pressed="${0}"
84
+ aria-relevant="${0}"
85
+ aria-roledescription="${0}"
86
+ ${0}
87
+ >
88
+ ${0}
89
+ ${0}
90
+ ${0}
91
+ </button>
92
+ `), getClasses, x => x.autofocus, x => x.disabled, x => x.formId, x => x.formaction, x => x.formenctype, x => x.formmethod, x => x.formnovalidate, x => x.formtarget, x => x.name, x => x.type, x => x.value, x => x.ariaAtomic, x => x.ariaBusy, x => x.ariaControls, x => x.ariaCurrent, x => x.ariaDescribedby, x => x.ariaDetails, x => x.ariaDisabled, x => x.ariaErrormessage, x => x.ariaExpanded, x => x.ariaFlowto, x => x.ariaHaspopup, x => x.ariaHidden, x => x.ariaInvalid, x => x.ariaKeyshortcuts, x => x.ariaLabel, x => x.ariaLabelledby, x => x.ariaLive, x => x.ariaOwns, x => x.ariaPressed, x => x.ariaRelevant, x => x.ariaRoledescription, ref('control'), () => focusTemplate, x => affixIconTemplate(x.icon), x => x.label);
93
+ };
94
+
95
+ const vividFab = Fab.compose({
96
+ baseName: 'fab',
97
+ template: FabTemplate,
98
+ styles: css_248z
99
+ });
100
+ designSystem.register(vividFab());
101
+
102
+ export { vividFab };
package/focus/index.js CHANGED
@@ -1,3 +1,20 @@
1
- import '../shared/index.js';
2
- export { V as VIVIDFocus } from '../shared/index2.js';
3
- import '../shared/style-inject.es.js';
1
+ import { h as html, d as designSystem } from '../shared/index.js';
2
+ import { F as Focus } from '../shared/focus.js';
3
+ import { s as styleInject } from '../shared/style-inject.es.js';
4
+
5
+ var css_248z = "/**\n * Do not edit directly\n * Generated on Mon, 05 Sep 2022 17:52:00 GMT\n */\n:host {\n display: contents;\n border-radius: inherit;\n}\n\n.control {\n position: absolute;\n z-index: 1;\n box-sizing: border-box;\n border-radius: inherit;\n box-shadow: inset 0 0 0 3px var(--focus-stroke-gap-color, currentColor);\n inset: var(--focus-inset, 0);\n outline: 2px solid var(--focus-stroke-color, var(--vvd-color-canvas-text));\n outline-offset: -2px;\n}";
6
+ styleInject(css_248z);
7
+
8
+ let _ = t => t,
9
+ _t;
10
+ const focusTemplate = () => html(_t || (_t = _`
11
+ <span class="control"></span>`));
12
+
13
+ const vividFocus = Focus.compose({
14
+ baseName: 'focus',
15
+ template: focusTemplate,
16
+ styles: css_248z
17
+ });
18
+ designSystem.register(vividFocus());
19
+
20
+ export { vividFocus };
@@ -0,0 +1,68 @@
1
+ import { E as Elevation } from '../shared/index2.js';
2
+ import { F as FoundationElement, _ as __decorate, a as attr, b as __metadata, h as html, d as designSystem } from '../shared/index.js';
3
+ import { s as styleInject } from '../shared/style-inject.es.js';
4
+ import '../shared/web.dom-collections.iterator.js';
5
+ import { c as classNames } from '../shared/class-names.js';
6
+ import '../shared/export.js';
7
+ import '../shared/object-keys.js';
8
+ import '../shared/iterators.js';
9
+
10
+ var css_248z = "/**\n * Do not edit directly\n * Generated on Mon, 05 Sep 2022 17:52:00 GMT\n */\n.base {\n z-index: 1;\n block-size: var(--_header-block-size);\n font: var(--vvd-font-heading4);\n inline-size: 100%;\n --_header-block-size: 64px;\n}\n.base .header-content {\n display: inline-flex;\n align-items: center;\n column-gap: 4px;\n}\n\n.container {\n display: flex;\n box-sizing: border-box;\n justify-content: space-between;\n block-size: inherit;\n color: var(--vvd-color-canvas-text);\n column-gap: 12px;\n padding-block: 8px;\n padding-inline: 16px;\n}\n.container[part~=vvd-theme-alternate] {\n background-color: var(--vvd-color-canvas);\n}\n\n.app-content {\n --_header-block-size: 64px;\n}";
11
+ styleInject(css_248z);
12
+
13
+ class Header extends FoundationElement {
14
+ constructor() {
15
+ super(...arguments);
16
+ this.elevationShadow = false;
17
+ this.alternate = false;
18
+ }
19
+
20
+ }
21
+
22
+ __decorate([attr({
23
+ attribute: 'elevation-shadow',
24
+ mode: 'boolean'
25
+ }), __metadata("design:type", Object)], Header.prototype, "elevationShadow", void 0);
26
+
27
+ __decorate([attr({
28
+ mode: 'boolean'
29
+ }), __metadata("design:type", Object)], Header.prototype, "alternate", void 0);
30
+
31
+ let _ = t => t,
32
+ _t;
33
+
34
+ const getPartAlternate = ({
35
+ alternate
36
+ }) => classNames(['vvd-theme-alternate', Boolean(alternate)]);
37
+
38
+ const headerTemplate = context => {
39
+ const elevationTag = context.tagFor(Elevation);
40
+ return html(_t || (_t = _`
41
+ <${0} dp="4" ?no-shadow=${0}>
42
+ <header class="base" part="base">
43
+ <!-- a container is needed to distinguish the surface background color of the
44
+ element from its shadow when applying elevation with alternate -->
45
+ <div class="container" part="${0}">
46
+ <section class="header-content">
47
+ <slot></slot>
48
+ </section>
49
+ <section class="header-content" role="toolbar">
50
+ <slot name="action-items"></slot>
51
+ </section>
52
+ </div>
53
+ </header>
54
+ </${0}>
55
+ <div class="app-content">
56
+ <slot name="app-content"></slot>
57
+ </div>
58
+ `), elevationTag, x => !x.elevationShadow, getPartAlternate, elevationTag);
59
+ };
60
+
61
+ const vividHeader = Header.compose({
62
+ baseName: 'header',
63
+ template: headerTemplate,
64
+ styles: css_248z
65
+ });
66
+ designSystem.register(vividHeader());
67
+
68
+ export { vividHeader };
package/icon/index.js CHANGED
@@ -3,10 +3,12 @@ import { s as styleInject } from '../shared/style-inject.es.js';
3
3
  import { I as Icon } from '../shared/icon.js';
4
4
  import { w as when } from '../shared/when.js';
5
5
  import { c as classNames } from '../shared/class-names.js';
6
- import '../shared/web.dom-collections.iterator.js';
6
+ import '../shared/export.js';
7
+ import '../shared/iterators.js';
8
+ import '../shared/to-string.js';
7
9
  import '../shared/_has.js';
8
10
 
9
- var css_248z = ":host {\n display: inline-block;\n vertical-align: sub;\n}\n\n.control {\n display: flex;\n margin: unset;\n color: currentColor;\n contain: strict;\n}\n.control.connotation-primary {\n --connotation: var(--vvd-color-primary);\n --on-connotation: var(--vvd-color-on-primary);\n}\n\n.control.connotation-announcement {\n --connotation: var(--vvd-color-announcement);\n --on-connotation: var(--vvd-color-on-announcement);\n}\n\n.control.connotation-cta {\n --connotation: var(--vvd-color-cta);\n --on-connotation: var(--vvd-color-on-cta);\n}\n\n.control.connotation-success {\n --connotation: var(--vvd-color-success);\n --on-connotation: var(--vvd-color-on-success);\n}\n\n.control.connotation-alert {\n --connotation: var(--vvd-color-alert);\n --on-connotation: var(--vvd-color-on-alert);\n}\n\n.control.connotation-info {\n --connotation: var(--vvd-color-info);\n --on-connotation: var(--vvd-color-on-info);\n}\n\n.control[class*=connotation] {\n color: var(--connotation);\n}\n\nsvg {\n margin: auto;\n block-size: inherit;\n inline-size: inherit;\n}\n\n/* Size */\n.control:not(.size-base-small):not(.size-base):not(.size-base-large) {\n block-size: 1em;\n inline-size: 1em;\n}\n\n.control.size-base-small {\n block-size: 16px;\n inline-size: 16px;\n}\n\n.control.size-base {\n block-size: 24px;\n inline-size: 24px;\n}\n\n.control.size-base-large {\n block-size: 32px;\n inline-size: 32px;\n}";
11
+ var css_248z = ":host {\n display: inline-block;\n vertical-align: sub;\n}\n\n.control {\n display: flex;\n margin: unset;\n color: currentColor;\n contain: strict;\n}\n.control.connotation-accent {\n --_connotation-color-primary: var(--vvd-color-canvas-text);\n}\n.control.connotation-announcement {\n --_connotation-color-primary: var(--vvd-color-announcement-500);\n}\n.control.connotation-cta {\n --_connotation-color-primary: var(--vvd-color-cta-500);\n}\n.control.connotation-success {\n --_connotation-color-primary: var(--vvd-color-success-500);\n}\n.control.connotation-alert {\n --_connotation-color-primary: var(--vvd-color-alert-500);\n}\n.control.connotation-information {\n --_connotation-color-primary: var(--vvd-color-information-500);\n}\n\n.control[class*=connotation] {\n color: var(--_connotation-color-primary);\n}\n\nsvg {\n margin: auto;\n block-size: inherit;\n inline-size: inherit;\n}\n\n/* Size */\n.control:not(.size-small):not(.size-medium):not(.size-large) {\n block-size: 1em;\n inline-size: 1em;\n}\n\n.control.size-small {\n block-size: 16px;\n inline-size: 16px;\n}\n\n.control.size-medium {\n block-size: 24px;\n inline-size: 24px;\n}\n\n.control.size-large {\n block-size: 32px;\n inline-size: 32px;\n}";
10
12
  styleInject(css_248z);
11
13
 
12
14
  let _ = t => t,
@@ -22,7 +24,11 @@ const iconTemplate = () => html(_t || (_t = _`
22
24
  <figure class="${0}">
23
25
  ${0}
24
26
  </figure>
25
- `), getClasses, when(x => x.svg, x => html(_t2 || (_t2 = _`${0}`), x.svg)));
27
+ `), getClasses, when(x => isValidString(x.svg), x => html(_t2 || (_t2 = _`${0}`), x.svg)));
28
+
29
+ function isValidString(value) {
30
+ return typeof value === 'string' && value.length > 0;
31
+ }
26
32
 
27
33
  const vividIcon = Icon.compose({
28
34
  baseName: 'icon',