@vonage/vivid 3.0.0-next.3 → 3.0.0-next.32

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 (152) hide show
  1. package/README.md +49 -4
  2. package/accordion/index.js +61 -0
  3. package/accordion-item/index.js +133 -0
  4. package/action-group/index.js +49 -0
  5. package/badge/index.js +27 -22
  6. package/banner/index.js +148 -0
  7. package/breadcrumb/index.js +41 -150
  8. package/breadcrumb-item/index.js +18 -8
  9. package/button/index.js +40 -663
  10. package/calendar/index.js +1550 -0
  11. package/calendar-event/index.js +117 -0
  12. package/card/index.js +134 -0
  13. package/checkbox/index.js +176 -0
  14. package/dialog/index.js +277 -0
  15. package/divider/index.js +88 -0
  16. package/elevation/index.js +4 -38
  17. package/fab/index.js +101 -0
  18. package/focus/index.js +20 -3
  19. package/header/index.js +68 -0
  20. package/icon/index.js +40 -5
  21. package/index.d.ts +1 -0
  22. package/index.js +50 -14
  23. package/layout/index.js +5 -5
  24. package/lib/accordion/accordion.d.ts +9 -0
  25. package/lib/accordion/accordion.template.d.ts +4 -0
  26. package/lib/accordion/index.d.ts +2 -0
  27. package/lib/accordion-item/accordion-item.d.ts +13 -0
  28. package/lib/accordion-item/accordion-item.template.d.ts +4 -0
  29. package/lib/accordion-item/index.d.ts +4 -0
  30. package/lib/action-group/action-group.d.ts +10 -0
  31. package/lib/action-group/action-group.template.d.ts +4 -0
  32. package/lib/action-group/index.d.ts +2 -0
  33. package/lib/badge/badge.d.ts +8 -8
  34. package/lib/badge/index.d.ts +1 -1
  35. package/lib/banner/banner.d.ts +20 -0
  36. package/lib/banner/banner.template.d.ts +4 -0
  37. package/lib/banner/index.d.ts +3 -0
  38. package/lib/breadcrumb/breadcrumb.template.d.ts +4 -0
  39. package/lib/breadcrumb-item/breadcrumb-item.d.ts +1 -1
  40. package/lib/breadcrumb-item/breadcrumb-item.template.d.ts +0 -1
  41. package/lib/breadcrumb-item/index.d.ts +2 -0
  42. package/lib/button/button.d.ts +9 -8
  43. package/lib/button/index.d.ts +2 -19
  44. package/lib/calendar/calendar.d.ts +13 -0
  45. package/lib/calendar/calendar.template.d.ts +4 -0
  46. package/lib/calendar/helpers/calendar.date-functions.d.ts +2 -0
  47. package/lib/calendar/helpers/calendar.event-context.d.ts +6 -0
  48. package/lib/calendar/helpers/calendar.keyboard-interactions.d.ts +9 -0
  49. package/lib/calendar/index.d.ts +2 -0
  50. package/lib/calendar-event/calendar-event.d.ts +14 -0
  51. package/lib/calendar-event/calendar-event.template.d.ts +4 -0
  52. package/lib/calendar-event/index.d.ts +2 -0
  53. package/lib/card/card.d.ts +10 -0
  54. package/lib/card/card.template.d.ts +4 -0
  55. package/lib/card/index.d.ts +4 -0
  56. package/lib/checkbox/checkbox.d.ts +5 -0
  57. package/lib/checkbox/checkbox.template.d.ts +4 -0
  58. package/lib/checkbox/index.d.ts +4 -0
  59. package/lib/components.d.ts +23 -5
  60. package/lib/dialog/dialog.d.ts +20 -0
  61. package/lib/dialog/dialog.template.d.ts +4 -0
  62. package/lib/dialog/index.d.ts +5 -0
  63. package/lib/divider/divider.d.ts +3 -0
  64. package/lib/divider/divider.template.d.ts +4 -0
  65. package/lib/divider/index.d.ts +2 -0
  66. package/lib/elevation/elevation.d.ts +2 -1
  67. package/lib/elevation/index.d.ts +1 -1
  68. package/lib/enums.d.ts +14 -7
  69. package/lib/fab/fab.d.ts +13 -0
  70. package/lib/fab/fab.template.d.ts +4 -0
  71. package/lib/fab/index.d.ts +4 -0
  72. package/lib/focus/index.d.ts +1 -1
  73. package/lib/header/header.d.ts +5 -0
  74. package/lib/header/header.template.d.ts +4 -0
  75. package/lib/header/index.d.ts +3 -0
  76. package/lib/icon/icon.d.ts +4 -5
  77. package/lib/layout/index.d.ts +1 -1
  78. package/lib/layout/layout.d.ts +3 -3
  79. package/lib/note/index.d.ts +2 -0
  80. package/lib/note/note.d.ts +10 -0
  81. package/lib/note/note.template.d.ts +5 -0
  82. package/lib/popup/index.d.ts +4 -0
  83. package/lib/popup/popup.d.ts +17 -0
  84. package/lib/popup/popup.template.d.ts +4 -0
  85. package/lib/progress/index.d.ts +2 -0
  86. package/lib/progress/progress.d.ts +9 -0
  87. package/lib/progress/progress.template.d.ts +5 -0
  88. package/lib/progress-ring/index.d.ts +2 -0
  89. package/lib/progress-ring/progress-ring.d.ts +7 -0
  90. package/lib/progress-ring/progress-ring.template.d.ts +4 -0
  91. package/lib/side-drawer/index.d.ts +2 -0
  92. package/lib/side-drawer/side-drawer.d.ts +7 -0
  93. package/lib/side-drawer/side-drawer.template.d.ts +4 -0
  94. package/lib/sidenav/index.d.ts +2 -0
  95. package/lib/sidenav/sidenav.d.ts +3 -0
  96. package/lib/sidenav/sidenav.template.d.ts +4 -0
  97. package/lib/sidenav-item/index.d.ts +1 -0
  98. package/lib/sidenav-item/sidenav-item.d.ts +4 -5
  99. package/lib/text/index.d.ts +2 -0
  100. package/lib/text/text.d.ts +10 -0
  101. package/lib/text/text.template.d.ts +4 -0
  102. package/lib/text-anchor/text-anchor.d.ts +4 -1
  103. package/lib/text-field/index.d.ts +4 -0
  104. package/lib/text-field/text-field.d.ts +23 -0
  105. package/lib/text-field/text-field.template.d.ts +5 -0
  106. package/lib/tooltip/index.d.ts +3 -0
  107. package/lib/tooltip/tooltip.d.ts +8 -0
  108. package/lib/tooltip/tooltip.template.d.ts +4 -0
  109. package/note/index.js +68 -0
  110. package/package.json +39 -6
  111. package/popup/index.js +2118 -0
  112. package/progress/index.js +107 -0
  113. package/progress-ring/index.js +82 -0
  114. package/shared/_has.js +58 -0
  115. package/shared/affix.js +10 -25
  116. package/shared/anchor.js +10 -3
  117. package/shared/aria-global.js +20 -20
  118. package/shared/base-progress.js +70 -0
  119. package/shared/breadcrumb-item.js +2 -2
  120. package/shared/button.js +195 -0
  121. package/shared/calendar-event.js +26 -0
  122. package/shared/dialog-polyfill.esm.js +858 -0
  123. package/shared/enums.js +79 -0
  124. package/shared/es.object.assign.js +69 -0
  125. package/shared/export.js +972 -0
  126. package/shared/focus.js +5 -0
  127. package/shared/focus2.js +11 -0
  128. package/shared/form-associated.js +548 -0
  129. package/shared/icon.js +1389 -0
  130. package/shared/index.js +4940 -1426
  131. package/shared/index2.js +27 -4901
  132. package/shared/iterators.js +61 -0
  133. package/shared/object-keys.js +13 -0
  134. package/shared/patterns/affix.d.ts +3 -4
  135. package/shared/patterns/focus.d.ts +3 -0
  136. package/shared/patterns/index.d.ts +1 -0
  137. package/shared/slotted.js +119 -0
  138. package/shared/text-anchor.js +12 -0
  139. package/shared/text-anchor.template.js +16 -6
  140. package/shared/to-string.js +51 -0
  141. package/shared/web.dom-collections.iterator.js +46 -1059
  142. package/shared/when.js +15 -0
  143. package/side-drawer/index.js +82 -0
  144. package/sidenav/index.js +17 -0
  145. package/sidenav-item/index.js +24 -61
  146. package/styles/themes/dark.css +16 -4
  147. package/styles/themes/light.css +16 -4
  148. package/text/index.js +48 -0
  149. package/text-anchor/index.js +13 -13
  150. package/text-field/index.js +411 -0
  151. package/tooltip/index.js +70 -0
  152. package/shared/index3.js +0 -21
@@ -0,0 +1,277 @@
1
+ import { s as styleInject } from '../shared/style-inject.es.js';
2
+ 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';
3
+ import '../icon/index.js';
4
+ import '../button/index.js';
5
+ import '../shared/index2.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/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: 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}";
25
+ styleInject(css_248z$1);
26
+
27
+ var css_248z = "/*\n Do not edit directly\n Generated on Wed, 27 Apr 2022 11:58:36 GMT\n*/\n.base {\n box-sizing: border-box;\n padding: 0;\n border: none;\n background-color: var(--_elevation-fill);\n border-radius: 6px;\n color: var(--vvd-color-on-canvas);\n}\n.base:not(.modal) {\n z-index: var(--dialog-z-index, 1);\n}\n\n.main-wrapper {\n padding: 24px;\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: 500 condensed 20px / 28px SpeziaWebVariable;\n letter-spacing: 0px;\n text-decoration: none;\n text-transform: none;\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: 400 ultra-condensed 14px / 20px SpeziaWebVariable;\n letter-spacing: 0px;\n text-decoration: none;\n text-transform: none;\n margin-top: 8px;\n}";
28
+ styleInject(css_248z);
29
+
30
+ var _Dialog_instances, _Dialog_modal, _Dialog_dialogElement, _Dialog_dialog_get, _Dialog_handleScrimClick, _Dialog_handleInternalFormSubmit, _Dialog_handleModal;
31
+ let dialogPolyfill;
32
+
33
+ (async () => {
34
+ if (!HTMLDialogElement || !HTMLDialogElement.prototype.showModal) {
35
+ delete window.HTMLDialogElement;
36
+ dialogPolyfill = await import('../shared/dialog-polyfill.esm.js');
37
+ }
38
+ })();
39
+
40
+ class Dialog extends FoundationElement {
41
+ constructor() {
42
+ super(...arguments);
43
+
44
+ _Dialog_instances.add(this);
45
+
46
+ this.open = false;
47
+ this.ariaLabelledBy = null;
48
+ this.ariaLabel = null;
49
+ this.ariaDescribedBy = null;
50
+
51
+ _Dialog_modal.set(this, false);
52
+
53
+ _Dialog_dialogElement.set(this, void 0);
54
+
55
+ _Dialog_handleScrimClick.set(this, event => {
56
+ if (event.target !== __classPrivateFieldGet(this, _Dialog_instances, "a", _Dialog_dialog_get)) {
57
+ return;
58
+ }
59
+
60
+ const rect = __classPrivateFieldGet(this, _Dialog_instances, "a", _Dialog_dialog_get).getBoundingClientRect();
61
+
62
+ const clickedInDialog = rect.top <= event.clientY && event.clientY <= rect.top + rect.height && rect.left <= event.clientX && event.clientX <= rect.left + rect.width;
63
+ this.open = clickedInDialog;
64
+ });
65
+
66
+ _Dialog_handleInternalFormSubmit.set(this, event => {
67
+ if (event.target.method !== 'dialog') {
68
+ return;
69
+ }
70
+
71
+ this.open = false;
72
+ });
73
+ }
74
+
75
+ set returnValue(value) {
76
+ __classPrivateFieldGet(this, _Dialog_instances, "a", _Dialog_dialog_get).returnValue = value;
77
+ }
78
+
79
+ get returnValue() {
80
+ var _a;
81
+
82
+ return (_a = __classPrivateFieldGet(this, _Dialog_instances, "a", _Dialog_dialog_get)) === null || _a === void 0 ? void 0 : _a.returnValue;
83
+ }
84
+
85
+ get modal() {
86
+ return __classPrivateFieldGet(this, _Dialog_modal, "f");
87
+ }
88
+
89
+ openChanged(oldValue, newValue) {
90
+ if (oldValue === undefined) {
91
+ return;
92
+ }
93
+
94
+ if (!newValue) {
95
+ this.close();
96
+ } else {
97
+ if (__classPrivateFieldGet(this, _Dialog_instances, "a", _Dialog_dialog_get)) {
98
+ __classPrivateFieldGet(this, _Dialog_instances, "a", _Dialog_dialog_get).open = true;
99
+ }
100
+ }
101
+ }
102
+
103
+ close() {
104
+ if (__classPrivateFieldGet(this, _Dialog_instances, "a", _Dialog_dialog_get).open) {
105
+ __classPrivateFieldGet(this, _Dialog_instances, "a", _Dialog_dialog_get).close();
106
+
107
+ this.dispatchEvent(new CustomEvent('close', {
108
+ bubbles: true,
109
+ composed: true,
110
+ detail: this.returnValue
111
+ }));
112
+ }
113
+
114
+ this.open = false;
115
+
116
+ __classPrivateFieldGet(this, _Dialog_instances, "m", _Dialog_handleModal).call(this, false);
117
+ }
118
+
119
+ show() {
120
+ __classPrivateFieldGet(this, _Dialog_instances, "a", _Dialog_dialog_get).show();
121
+
122
+ this.open = true;
123
+ }
124
+
125
+ showModal() {
126
+ __classPrivateFieldGet(this, _Dialog_instances, "a", _Dialog_dialog_get).showModal();
127
+
128
+ this.open = true;
129
+
130
+ __classPrivateFieldGet(this, _Dialog_instances, "m", _Dialog_handleModal).call(this, true);
131
+ }
132
+
133
+ connectedCallback() {
134
+ super.connectedCallback();
135
+
136
+ __classPrivateFieldGet(this, _Dialog_instances, "a", _Dialog_dialog_get).addEventListener('click', __classPrivateFieldGet(this, _Dialog_handleScrimClick, "f"));
137
+
138
+ __classPrivateFieldGet(this, _Dialog_instances, "a", _Dialog_dialog_get).addEventListener('submit', __classPrivateFieldGet(this, _Dialog_handleInternalFormSubmit, "f"));
139
+ }
140
+
141
+ disconnectedCallback() {
142
+ super.disconnectedCallback();
143
+
144
+ __classPrivateFieldGet(this, _Dialog_instances, "a", _Dialog_dialog_get).removeEventListener('click', __classPrivateFieldGet(this, _Dialog_handleScrimClick, "f"));
145
+
146
+ __classPrivateFieldGet(this, _Dialog_instances, "a", _Dialog_dialog_get).removeEventListener('submit', __classPrivateFieldGet(this, _Dialog_handleInternalFormSubmit, "f"));
147
+ }
148
+
149
+ }
150
+ _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() {
151
+ if (!__classPrivateFieldGet(this, _Dialog_dialogElement, "f")) {
152
+ __classPrivateFieldSet(this, _Dialog_dialogElement, this.shadowRoot.querySelector('dialog'), "f");
153
+
154
+ if (__classPrivateFieldGet(this, _Dialog_dialogElement, "f")) {
155
+ __classPrivateFieldGet(this, _Dialog_dialogElement, "f").open = this.open;
156
+
157
+ if (dialogPolyfill) {
158
+ dialogPolyfill.registerDialog(__classPrivateFieldGet(this, _Dialog_dialogElement, "f"));
159
+ }
160
+ }
161
+ }
162
+
163
+ return __classPrivateFieldGet(this, _Dialog_dialogElement, "f");
164
+ }, _Dialog_handleModal = function _Dialog_handleModal(show) {
165
+ __classPrivateFieldSet(this, _Dialog_modal, show, "f");
166
+
167
+ __classPrivateFieldGet(this, _Dialog_instances, "a", _Dialog_dialog_get).toggleAttribute('aria-modal', show);
168
+
169
+ __classPrivateFieldGet(this, _Dialog_instances, "a", _Dialog_dialog_get).classList.toggle('modal', show);
170
+ };
171
+
172
+ __decorate([attr({
173
+ mode: 'boolean'
174
+ }), __metadata("design:type", Object)], Dialog.prototype, "open", void 0);
175
+
176
+ __decorate([attr, __metadata("design:type", String)], Dialog.prototype, "icon", void 0);
177
+
178
+ __decorate([attr, __metadata("design:type", String)], Dialog.prototype, "text", void 0);
179
+
180
+ __decorate([attr, __metadata("design:type", String)], Dialog.prototype, "headline", void 0);
181
+
182
+ __decorate([attr({
183
+ attribute: 'aria-labelledby'
184
+ }), __metadata("design:type", Object)], Dialog.prototype, "ariaLabelledBy", void 0);
185
+
186
+ __decorate([attr({
187
+ attribute: 'aria-label'
188
+ }), __metadata("design:type", Object)], Dialog.prototype, "ariaLabel", void 0);
189
+
190
+ __decorate([attr({
191
+ attribute: 'aria-describedby'
192
+ }), __metadata("design:type", Object)], Dialog.prototype, "ariaDescribedBy", void 0);
193
+
194
+ let _2 = t => t,
195
+ _t,
196
+ _t2,
197
+ _t3,
198
+ _t4,
199
+ _t5;
200
+
201
+ const getClasses = _ => classNames('base');
202
+
203
+ function icon() {
204
+ return html(_t || (_t = _2`
205
+ <vwc-icon class="icon" size="large" type="${0}"></vwc-icon>
206
+ `), x => x.icon);
207
+ }
208
+
209
+ function headline() {
210
+ return html(_t2 || (_t2 = _2`
211
+ <div class="headline">
212
+ ${0}
213
+ </div>
214
+ `), x => x.headline);
215
+ }
216
+
217
+ function renderDismissButton() {
218
+ return html(_t3 || (_t3 = _2`
219
+ <vwc-button
220
+ density="condensed"
221
+ class="dismiss-button"
222
+ icon="close-line"
223
+ @click="${0}">
224
+ </vwc-button>`), x => {
225
+ x.open = false;
226
+ });
227
+ }
228
+
229
+ function handleEscapeKey(dialog, event) {
230
+ if (event.key === 'Escape' && dialog.modal) {
231
+ dialog.open = false;
232
+ }
233
+ }
234
+
235
+ function content() {
236
+ return html(_t4 || (_t4 = _2`
237
+ <div class="content">
238
+ ${0}
239
+ </div>
240
+ `), x => x.text);
241
+ }
242
+
243
+ const DialogTemplate = () => html(_t5 || (_t5 = _2`
244
+ <vwc-elevation dp="12">
245
+ <dialog class="${0}"
246
+ @keydown="${0}"
247
+ returnValue="${0}"
248
+ aria-labelledby="${0}"
249
+ aria-label="${0}"
250
+ aria-describedby="${0}"
251
+ >
252
+ <slot name="main">
253
+ <div class="main-wrapper">
254
+ <div class="header">
255
+ <div class="headline-wrapper">
256
+ <slot name="graphic">
257
+ ${0}
258
+ </slot>
259
+ ${0}
260
+ </div>
261
+ ${0}
262
+ </div>
263
+ ${0}
264
+ <slot name="footer"></slot>
265
+ </div>
266
+ </slot>
267
+ </dialog>
268
+ </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()));
269
+
270
+ const vividDialog = Dialog.compose({
271
+ baseName: 'dialog',
272
+ template: DialogTemplate,
273
+ styles: [css_248z, css_248z$1]
274
+ });
275
+ designSystem.register(vividDialog());
276
+
277
+ 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 = ":host {\n display: block;\n}\n\n.base {\n display: block;\n background-color: var(--vvd-color-neutral-30);\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,38 +1,4 @@
1
- import { F as FoundationElement, _ as __decorate, a as attr, b as __metadata, h as html, d as designSystem } from '../shared/index2.js';
2
- import '../shared/web.dom-collections.iterator.js';
3
- import { s as styleInject } from '../shared/style-inject.es.js';
4
- import { c as classNames } from '../shared/class-names.js';
5
-
6
- class Elevation extends FoundationElement {
7
- constructor() {
8
- super(...arguments);
9
- this.dp = 2;
10
- }
11
-
12
- }
13
-
14
- __decorate([attr, __metadata("design:type", Object)], Elevation.prototype, "dp", void 0);
15
-
16
- var css_248z = ".dp-0:not(.dp-2):not(.dp-4):not(.dp-8):not(.dp-12):not(.dp-16):not(.dp-24) {\n background-color: var(--vvd-color-surface-0dp);\n filter: var(--vvd-shadow-surface-0dp);\n}\n\n.dp-2:not(.dp-0):not(.dp-4):not(.dp-8):not(.dp-12):not(.dp-16):not(.dp-24) {\n background-color: var(--vvd-color-surface-2dp);\n filter: var(--vvd-shadow-surface-2dp);\n}\n\n.dp-4:not(.dp-0):not(.dp-2):not(.dp-8):not(.dp-12):not(.dp-16):not(.dp-24) {\n background-color: var(--vvd-color-surface-4dp);\n filter: var(--vvd-shadow-surface-4dp);\n}\n\n.dp-8:not(.dp-0):not(.dp-2):not(.dp-4):not(.dp-12):not(.dp-16):not(.dp-24) {\n background-color: var(--vvd-color-surface-8dp);\n filter: var(--vvd-shadow-surface-8dp);\n}\n\n.dp-12:not(.dp-0):not(.dp-2):not(.dp-4):not(.dp-8):not(.dp-16):not(.dp-24) {\n background-color: var(--vvd-color-surface-12dp);\n filter: var(--vvd-shadow-surface-12dp);\n}\n\n.dp-16:not(.dp-0):not(.dp-2):not(.dp-4):not(.dp-8):not(.dp-12):not(.dp-24) {\n background-color: var(--vvd-color-surface-16dp);\n filter: var(--vvd-shadow-surface-16dp);\n}\n\n.dp-24:not(.dp-0):not(.dp-2):not(.dp-4):not(.dp-8):not(.dp-12):not(.dp-16) {\n background-color: var(--vvd-color-surface-24dp);\n filter: var(--vvd-shadow-surface-24dp);\n}\n\n.control {\n --elevation-border-radius: 6px;\n border-radius: var(--elevation-border-radius);\n}";
17
- styleInject(css_248z);
18
-
19
- let _ = t => t,
20
- _t;
21
-
22
- const getClasses = ({
23
- dp
24
- }) => classNames('control', [`dp-${dp}`, Boolean(dp)]);
25
-
26
- const elevationTemplate = () => html(_t || (_t = _`
27
- <div class="${0}">
28
- <slot></slot>
29
- </div>`), getClasses);
30
-
31
- const VIVIDElevation = Elevation.compose({
32
- baseName: 'elevation',
33
- template: elevationTemplate,
34
- styles: css_248z
35
- });
36
- designSystem.register(VIVIDElevation());
37
-
38
- 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,101 @@
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/aria-global.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
+
22
+ var css_248z = "/*\n Do not edit directly\n Generated on Wed, 27 Apr 2022 11:58:36 GMT\n*/\n.control {\n font: 600 ultra-condensed 14px / 20px SpeziaWebVariable;\n letter-spacing: 0px;\n text-decoration: none;\n text-transform: none;\n position: relative;\n display: inline-flex;\n box-sizing: border-box;\n align-items: center;\n border: 0 none;\n background-color: 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-on-canvas));\n column-gap: var(--fab-icon-gap);\n filter: var(--_elevation-shadow);\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-on-canvas);\n --_connotation-color-on-primary: var(--vvd-color-canvas);\n --_connotation-color-primary-increment: var(--vvd-color-neutral-90);\n --_connotation-color-contrast: var(--vvd-color-neutral-90);\n --_connotation-color-fierce: var(--vvd-color-neutral-80);\n --_connotation-color-firm: var(--vvd-color-on-canvas);\n}\n.control.connotation-cta {\n --_connotation-color-primary: var(--vvd-color-cta);\n --_connotation-color-on-primary: var(--vvd-color-on-cta);\n --_connotation-color-primary-increment: var(--vvd-color-cta-70);\n --_connotation-color-contrast: var(--vvd-color-cta-90);\n --_connotation-color-fierce: var(--vvd-color-cta-80);\n --_connotation-color-firm: var(--vvd-color-cta-70);\n}\n.control {\n --_appearance-color-text: var(--_connotation-color-on-primary);\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-on-primary);\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-50);\n --_appearance-color-fill: var(--vvd-color-neutral-30);\n --_appearance-color-outline: transaprent;\n}\n.control:where(:active, .active):where(:not(:disabled, .disabled)) {\n --_appearance-color-text: var(--_connotation-color-on-primary);\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.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 {\n font-size: 20px;\n}\n.icon-trailing .icon {\n order: 1;\n}\n\n:not(:focus-visible) .focus-indicator {\n display: none;\n}";
23
+ styleInject(css_248z);
24
+
25
+ class Fab extends Button {}
26
+
27
+ __decorate([attr, __metadata("design:type", String)], Fab.prototype, "connotation", void 0);
28
+
29
+ __decorate([attr, __metadata("design:type", String)], Fab.prototype, "density", void 0);
30
+
31
+ __decorate([attr, __metadata("design:type", String)], Fab.prototype, "label", void 0);
32
+
33
+ applyMixins(Fab, AffixIconWithTrailing);
34
+
35
+ let _ = t => t,
36
+ _t;
37
+
38
+ const getClasses = ({
39
+ connotation,
40
+ density,
41
+ icon,
42
+ label,
43
+ iconTrailing,
44
+ disabled
45
+ }) => classNames('control', [`connotation-${connotation}`, Boolean(connotation)], [`density-${density}`, Boolean(density)], ['icon-only', !label && !!icon], ['icon-trailing', iconTrailing], ['disabled', disabled]);
46
+
47
+ const FabTemplate = context => {
48
+ const affixIconTemplate = affixIconTemplateFactory(context);
49
+ const focusTemplate = focusTemplateFactory(context);
50
+ return html(_t || (_t = _`
51
+ <button
52
+ class="${0} "
53
+ ?autofocus="${0}"
54
+ ?disabled="${0}"
55
+ form="${0}"
56
+ formaction="${0}"
57
+ formenctype="${0}"
58
+ formmethod="${0}"
59
+ formnovalidate="${0}"
60
+ formtarget="${0}"
61
+ name="${0}"
62
+ type="${0}"
63
+ value="${0}"
64
+ aria-atomic="${0}"
65
+ aria-busy="${0}"
66
+ aria-controls="${0}"
67
+ aria-current="${0}"
68
+ aria-describedby="${0}"
69
+ aria-details="${0}"
70
+ aria-disabled="${0}"
71
+ aria-errormessage="${0}"
72
+ aria-expanded="${0}"
73
+ aria-flowto="${0}"
74
+ aria-haspopup="${0}"
75
+ aria-hidden="${0}"
76
+ aria-invalid="${0}"
77
+ aria-keyshortcuts="${0}"
78
+ aria-label="${0}"
79
+ aria-labelledby="${0}"
80
+ aria-live="${0}"
81
+ aria-owns="${0}"
82
+ aria-pressed="${0}"
83
+ aria-relevant="${0}"
84
+ aria-roledescription="${0}"
85
+ ${0}
86
+ >
87
+ ${0}
88
+ ${0}
89
+ ${0}
90
+ </button>
91
+ `), 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);
92
+ };
93
+
94
+ const vividFab = Fab.compose({
95
+ baseName: 'fab',
96
+ template: FabTemplate,
97
+ styles: css_248z
98
+ });
99
+ designSystem.register(vividFab());
100
+
101
+ export { vividFab };
package/focus/index.js CHANGED
@@ -1,3 +1,20 @@
1
- import '../shared/index2.js';
2
- export { V as VIVIDFocus } from '../shared/index3.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 = ":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-on-canvas));\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 Wed, 27 Apr 2022 11:58:36 GMT\n*/\n.base {\n font: 500 condensed 20px / 28px SpeziaWebVariable;\n letter-spacing: 0px;\n text-decoration: none;\n text-transform: none;\n --_header-block-size: 64px;\n z-index: 1;\n block-size: var(--_header-block-size);\n inline-size: 100%;\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-on-canvas);\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="actionItems"></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
@@ -1,5 +1,40 @@
1
- import '../shared/index2.js';
2
- export { v as vividIcon } from '../shared/index.js';
3
- import '../shared/style-inject.es.js';
4
- import '../shared/web.dom-collections.iterator.js';
5
- import '../shared/class-names.js';
1
+ import { h as html, d as designSystem } from '../shared/index.js';
2
+ import { s as styleInject } from '../shared/style-inject.es.js';
3
+ import { I as Icon } from '../shared/icon.js';
4
+ import { w as when } from '../shared/when.js';
5
+ import { c as classNames } from '../shared/class-names.js';
6
+ import '../shared/export.js';
7
+ import '../shared/iterators.js';
8
+ import '../shared/to-string.js';
9
+ import '../shared/_has.js';
10
+
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-on-canvas);\n}\n.control.connotation-announcement {\n --_connotation-color-primary: var(--vvd-color-announcement);\n}\n.control.connotation-cta {\n --_connotation-color-primary: var(--vvd-color-cta);\n}\n.control.connotation-success {\n --_connotation-color-primary: var(--vvd-color-success);\n}\n.control.connotation-alert {\n --_connotation-color-primary: var(--vvd-color-alert);\n}\n.control.connotation-info {\n --_connotation-color-primary: var(--vvd-color-info);\n}\n\n.control[class*=connotation] {\n color: var(--_connotation-color-basis);\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}";
12
+ styleInject(css_248z);
13
+
14
+ let _ = t => t,
15
+ _t,
16
+ _t2;
17
+
18
+ const getClasses = ({
19
+ connotation,
20
+ size
21
+ }) => classNames('control', [`connotation-${connotation}`, Boolean(connotation)], [`size-${size}`, Boolean(size)]);
22
+
23
+ const iconTemplate = () => html(_t || (_t = _`
24
+ <figure class="${0}">
25
+ ${0}
26
+ </figure>
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
+ }
32
+
33
+ const vividIcon = Icon.compose({
34
+ baseName: 'icon',
35
+ template: iconTemplate,
36
+ styles: css_248z
37
+ });
38
+ designSystem.register(vividIcon());
39
+
40
+ export { vividIcon };
package/index.d.ts CHANGED
@@ -1 +1,2 @@
1
1
  export * from './lib/components';
2
+ export * from './shared/design-system';