@vonage/vivid 3.0.0-next.6 → 3.0.0-next.60

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