@vonage/vivid 3.0.0-next.2 → 3.0.0-next.22

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 (133) hide show
  1. package/README.md +49 -4
  2. package/accordion/index.js +61 -0
  3. package/accordion-item/index.js +128 -0
  4. package/action-group/index.js +34 -0
  5. package/badge/index.js +27 -22
  6. package/banner/index.js +149 -0
  7. package/breadcrumb/index.js +103 -0
  8. package/breadcrumb-item/index.js +26 -11
  9. package/button/index.js +41 -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/elevation/index.js +8 -15
  14. package/fab/index.js +99 -0
  15. package/focus/index.js +20 -3
  16. package/icon/index.js +40 -5
  17. package/index.d.ts +1 -0
  18. package/index.js +49 -12
  19. package/layout/index.js +5 -5
  20. package/lib/accordion/accordion.d.ts +9 -0
  21. package/lib/accordion/accordion.template.d.ts +4 -0
  22. package/lib/accordion/index.d.ts +2 -0
  23. package/lib/accordion-item/accordion-item.d.ts +13 -0
  24. package/lib/accordion-item/accordion-item.template.d.ts +4 -0
  25. package/lib/accordion-item/index.d.ts +5 -0
  26. package/lib/action-group/action-group.d.ts +9 -0
  27. package/lib/action-group/action-group.template.d.ts +4 -0
  28. package/lib/action-group/index.d.ts +2 -0
  29. package/lib/badge/badge.d.ts +8 -8
  30. package/lib/badge/index.d.ts +1 -1
  31. package/lib/banner/banner.d.ts +20 -0
  32. package/lib/banner/banner.template.d.ts +4 -0
  33. package/lib/banner/index.d.ts +3 -0
  34. package/lib/breadcrumb/breadcrumb.d.ts +3 -0
  35. package/lib/breadcrumb/index.d.ts +2 -0
  36. package/lib/breadcrumb-item/breadcrumb-item.d.ts +3 -3
  37. package/lib/breadcrumb-item/breadcrumb-item.template.d.ts +0 -1
  38. package/lib/breadcrumb-item/index.d.ts +2 -0
  39. package/lib/button/button.d.ts +9 -8
  40. package/lib/button/index.d.ts +2 -19
  41. package/lib/calendar/calendar.d.ts +13 -0
  42. package/lib/calendar/calendar.template.d.ts +4 -0
  43. package/lib/calendar/helpers/calendar.date-functions.d.ts +2 -0
  44. package/lib/calendar/helpers/calendar.event-context.d.ts +6 -0
  45. package/lib/calendar/helpers/calendar.keyboard-interactions.d.ts +9 -0
  46. package/lib/calendar/index.d.ts +2 -0
  47. package/lib/calendar-event/calendar-event.d.ts +14 -0
  48. package/lib/calendar-event/calendar-event.template.d.ts +4 -0
  49. package/lib/calendar-event/index.d.ts +2 -0
  50. package/lib/card/card.d.ts +10 -0
  51. package/lib/card/card.template.d.ts +4 -0
  52. package/lib/card/index.d.ts +4 -0
  53. package/lib/components.d.ts +20 -3
  54. package/lib/elevation/elevation.d.ts +1 -1
  55. package/lib/elevation/index.d.ts +1 -1
  56. package/lib/enums.d.ts +14 -7
  57. package/lib/fab/fab.d.ts +10 -0
  58. package/lib/fab/fab.template.d.ts +4 -0
  59. package/lib/fab/index.d.ts +4 -0
  60. package/lib/focus/index.d.ts +1 -1
  61. package/lib/icon/icon.d.ts +4 -5
  62. package/lib/layout/index.d.ts +1 -1
  63. package/lib/layout/layout.d.ts +3 -3
  64. package/lib/note/index.d.ts +2 -0
  65. package/lib/note/note.d.ts +10 -0
  66. package/lib/note/note.template.d.ts +5 -0
  67. package/lib/popup/index.d.ts +4 -0
  68. package/lib/popup/popup.d.ts +17 -0
  69. package/lib/popup/popup.template.d.ts +4 -0
  70. package/lib/progress/index.d.ts +2 -0
  71. package/lib/progress/progress.d.ts +9 -0
  72. package/lib/progress/progress.template.d.ts +5 -0
  73. package/lib/progress-ring/index.d.ts +2 -0
  74. package/lib/progress-ring/progress-ring.d.ts +7 -0
  75. package/lib/progress-ring/progress-ring.template.d.ts +4 -0
  76. package/lib/side-drawer/index.d.ts +2 -0
  77. package/lib/side-drawer/side-drawer.d.ts +15 -0
  78. package/lib/side-drawer/side-drawer.template.d.ts +4 -0
  79. package/lib/sidenav-item/index.d.ts +1 -0
  80. package/lib/sidenav-item/sidenav-item.d.ts +4 -5
  81. package/lib/text/index.d.ts +2 -0
  82. package/lib/text/text.d.ts +10 -0
  83. package/lib/text/text.template.d.ts +4 -0
  84. package/lib/text-anchor/text-anchor.d.ts +4 -1
  85. package/lib/text-field/index.d.ts +4 -0
  86. package/lib/text-field/text-field.d.ts +21 -0
  87. package/lib/text-field/text-field.template.d.ts +5 -0
  88. package/lib/tooltip/index.d.ts +3 -0
  89. package/lib/tooltip/tooltip.d.ts +8 -0
  90. package/lib/tooltip/tooltip.template.d.ts +4 -0
  91. package/note/index.js +68 -0
  92. package/package.json +37 -6
  93. package/popup/index.js +2111 -0
  94. package/progress/index.js +101 -0
  95. package/progress-ring/index.js +82 -0
  96. package/shared/_has.js +58 -0
  97. package/shared/affix.js +10 -25
  98. package/shared/anchor.js +11 -4
  99. package/shared/aria-global.js +22 -59
  100. package/shared/base-progress.js +70 -0
  101. package/shared/breadcrumb-item.js +25 -0
  102. package/shared/button.js +195 -0
  103. package/shared/calendar-event.js +26 -0
  104. package/shared/enums.js +79 -0
  105. package/shared/es.object.assign.js +69 -0
  106. package/shared/export.js +972 -0
  107. package/shared/focus.js +5 -0
  108. package/shared/focus2.js +11 -0
  109. package/shared/form-associated.js +460 -0
  110. package/shared/icon.js +1389 -0
  111. package/shared/index.js +4940 -1426
  112. package/shared/iterators.js +61 -0
  113. package/shared/object-keys.js +13 -0
  114. package/shared/patterns/affix.d.ts +3 -4
  115. package/shared/patterns/focus.d.ts +3 -0
  116. package/shared/patterns/index.d.ts +1 -0
  117. package/shared/ref.js +41 -0
  118. package/shared/slotted.js +119 -0
  119. package/shared/text-anchor.js +12 -0
  120. package/shared/text-anchor.template.js +18 -20
  121. package/shared/to-string.js +51 -0
  122. package/shared/web.dom-collections.iterator.js +46 -1059
  123. package/shared/when.js +15 -0
  124. package/side-drawer/index.js +8660 -0
  125. package/sidenav-item/index.js +25 -61
  126. package/styles/themes/dark.css +16 -4
  127. package/styles/themes/light.css +16 -4
  128. package/text/index.js +48 -0
  129. package/text-anchor/index.js +13 -2
  130. package/text-field/index.js +398 -0
  131. package/tooltip/index.js +71 -0
  132. package/shared/index2.js +0 -4911
  133. package/shared/index3.js +0 -21
@@ -0,0 +1,398 @@
1
+ import '../icon/index.js';
2
+ import '../focus/index.js';
3
+ import { F as FoundationElement, D as DOM, _ as __decorate, a as attr, n as nullableNumberConverter, o as observable, b as __metadata, v as volatile, h as html, d as designSystem } from '../shared/index.js';
4
+ import '../shared/web.dom-collections.iterator.js';
5
+ import { b as AffixIcon, a as affixIconTemplateFactory } from '../shared/affix.js';
6
+ import '../shared/focus.js';
7
+ import { a as applyMixins } from '../shared/apply-mixins.js';
8
+ import { F as FormAssociated } from '../shared/form-associated.js';
9
+ import { A as ARIAGlobalStatesAndProperties, S as StartEnd } from '../shared/aria-global.js';
10
+ import { s as styleInject } from '../shared/style-inject.es.js';
11
+ import { f as focusTemplateFactory } from '../shared/focus2.js';
12
+ import { w as when } from '../shared/when.js';
13
+ import { r as ref } from '../shared/ref.js';
14
+ import { c as classNames } from '../shared/class-names.js';
15
+ import '../shared/icon.js';
16
+ import '../shared/export.js';
17
+ import '../shared/iterators.js';
18
+ import '../shared/to-string.js';
19
+ import '../shared/_has.js';
20
+ import '../shared/object-keys.js';
21
+
22
+ class _TextField extends FoundationElement {
23
+ }
24
+ /**
25
+ * A form-associated base class for the {@link @microsoft/fast-foundation#(TextField:class)} component.
26
+ *
27
+ * @internal
28
+ */
29
+ class FormAssociatedTextField extends FormAssociated(_TextField) {
30
+ constructor() {
31
+ super(...arguments);
32
+ this.proxy = document.createElement("input");
33
+ }
34
+ }
35
+
36
+ /**
37
+ * Text field sub-types
38
+ * @public
39
+ */
40
+ const TextFieldType = {
41
+ /**
42
+ * An email TextField
43
+ */
44
+ email: "email",
45
+ /**
46
+ * A password TextField
47
+ */
48
+ password: "password",
49
+ /**
50
+ * A telephone TextField
51
+ */
52
+ tel: "tel",
53
+ /**
54
+ * A text TextField
55
+ */
56
+ text: "text",
57
+ /**
58
+ * A URL TextField
59
+ */
60
+ url: "url",
61
+ };
62
+
63
+ /**
64
+ * A Text Field Custom HTML Element.
65
+ * Based largely on the {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/text | <input type="text" /> element }.
66
+ *
67
+ * @slot start - Content which can be provided before the number field input
68
+ * @slot end - Content which can be provided after the number field input
69
+ * @slot - The default slot for the label
70
+ * @csspart label - The label
71
+ * @csspart root - The element wrapping the control, including start and end slots
72
+ * @csspart control - The text field element
73
+ * @fires change - Fires a custom 'change' event when the value has changed
74
+ *
75
+ * @public
76
+ */
77
+ class TextField$1 extends FormAssociatedTextField {
78
+ constructor() {
79
+ super(...arguments);
80
+ /**
81
+ * Allows setting a type or mode of text.
82
+ * @public
83
+ * @remarks
84
+ * HTML Attribute: type
85
+ */
86
+ this.type = TextFieldType.text;
87
+ }
88
+ readOnlyChanged() {
89
+ if (this.proxy instanceof HTMLInputElement) {
90
+ this.proxy.readOnly = this.readOnly;
91
+ this.validate();
92
+ }
93
+ }
94
+ autofocusChanged() {
95
+ if (this.proxy instanceof HTMLInputElement) {
96
+ this.proxy.autofocus = this.autofocus;
97
+ this.validate();
98
+ }
99
+ }
100
+ placeholderChanged() {
101
+ if (this.proxy instanceof HTMLInputElement) {
102
+ this.proxy.placeholder = this.placeholder;
103
+ }
104
+ }
105
+ typeChanged() {
106
+ if (this.proxy instanceof HTMLInputElement) {
107
+ this.proxy.type = this.type;
108
+ this.validate();
109
+ }
110
+ }
111
+ listChanged() {
112
+ if (this.proxy instanceof HTMLInputElement) {
113
+ this.proxy.setAttribute("list", this.list);
114
+ this.validate();
115
+ }
116
+ }
117
+ maxlengthChanged() {
118
+ if (this.proxy instanceof HTMLInputElement) {
119
+ this.proxy.maxLength = this.maxlength;
120
+ this.validate();
121
+ }
122
+ }
123
+ minlengthChanged() {
124
+ if (this.proxy instanceof HTMLInputElement) {
125
+ this.proxy.minLength = this.minlength;
126
+ this.validate();
127
+ }
128
+ }
129
+ patternChanged() {
130
+ if (this.proxy instanceof HTMLInputElement) {
131
+ this.proxy.pattern = this.pattern;
132
+ this.validate();
133
+ }
134
+ }
135
+ sizeChanged() {
136
+ if (this.proxy instanceof HTMLInputElement) {
137
+ this.proxy.size = this.size;
138
+ }
139
+ }
140
+ spellcheckChanged() {
141
+ if (this.proxy instanceof HTMLInputElement) {
142
+ this.proxy.spellcheck = this.spellcheck;
143
+ }
144
+ }
145
+ /**
146
+ * @internal
147
+ */
148
+ connectedCallback() {
149
+ super.connectedCallback();
150
+ this.proxy.setAttribute("type", this.type);
151
+ this.validate();
152
+ if (this.autofocus) {
153
+ DOM.queueUpdate(() => {
154
+ this.focus();
155
+ });
156
+ }
157
+ }
158
+ /**
159
+ * Selects all the text in the text field
160
+ *
161
+ * @public
162
+ */
163
+ select() {
164
+ this.control.select();
165
+ /**
166
+ * The select event does not permeate the shadow DOM boundary.
167
+ * This fn effectively proxies the select event,
168
+ * emitting a `select` event whenever the internal
169
+ * control emits a `select` event
170
+ */
171
+ this.$emit("select");
172
+ }
173
+ /**
174
+ * Handles the internal control's `input` event
175
+ * @internal
176
+ */
177
+ handleTextInput() {
178
+ this.value = this.control.value;
179
+ }
180
+ /**
181
+ * Change event handler for inner control.
182
+ * @remarks
183
+ * "Change" events are not `composable` so they will not
184
+ * permeate the shadow DOM boundary. This fn effectively proxies
185
+ * the change event, emitting a `change` event whenever the internal
186
+ * control emits a `change` event
187
+ * @internal
188
+ */
189
+ handleChange() {
190
+ this.$emit("change");
191
+ }
192
+ }
193
+ __decorate([
194
+ attr({ attribute: "readonly", mode: "boolean" })
195
+ ], TextField$1.prototype, "readOnly", void 0);
196
+ __decorate([
197
+ attr({ mode: "boolean" })
198
+ ], TextField$1.prototype, "autofocus", void 0);
199
+ __decorate([
200
+ attr
201
+ ], TextField$1.prototype, "placeholder", void 0);
202
+ __decorate([
203
+ attr
204
+ ], TextField$1.prototype, "type", void 0);
205
+ __decorate([
206
+ attr
207
+ ], TextField$1.prototype, "list", void 0);
208
+ __decorate([
209
+ attr({ converter: nullableNumberConverter })
210
+ ], TextField$1.prototype, "maxlength", void 0);
211
+ __decorate([
212
+ attr({ converter: nullableNumberConverter })
213
+ ], TextField$1.prototype, "minlength", void 0);
214
+ __decorate([
215
+ attr
216
+ ], TextField$1.prototype, "pattern", void 0);
217
+ __decorate([
218
+ attr({ converter: nullableNumberConverter })
219
+ ], TextField$1.prototype, "size", void 0);
220
+ __decorate([
221
+ attr({ mode: "boolean" })
222
+ ], TextField$1.prototype, "spellcheck", void 0);
223
+ __decorate([
224
+ observable
225
+ ], TextField$1.prototype, "defaultSlottedNodes", void 0);
226
+ /**
227
+ * Includes ARIA states and properties relating to the ARIA textbox role
228
+ *
229
+ * @public
230
+ */
231
+ class DelegatesARIATextbox {
232
+ }
233
+ applyMixins(DelegatesARIATextbox, ARIAGlobalStatesAndProperties);
234
+ applyMixins(TextField$1, StartEnd, DelegatesARIATextbox);
235
+
236
+ class TextField extends TextField$1 {
237
+ constructor() {
238
+ super(...arguments);
239
+ this.charCount = false;
240
+ this.userValid = true;
241
+ }
242
+
243
+ get errorValidationMessage() {
244
+ return this.userValid ? '' : this.validationMessage;
245
+ }
246
+
247
+ validate() {
248
+ super.validate();
249
+
250
+ if (this.proxy instanceof HTMLElement) {
251
+ this.userValid = this.dirtyValue ? !this.validationMessage : true;
252
+ }
253
+ }
254
+
255
+ }
256
+
257
+ __decorate([attr, __metadata("design:type", String)], TextField.prototype, "label", void 0);
258
+
259
+ __decorate([attr({
260
+ attribute: 'helper-text'
261
+ }), __metadata("design:type", String)], TextField.prototype, "helperText", void 0);
262
+
263
+ __decorate([attr({
264
+ attribute: 'char-count',
265
+ mode: 'boolean'
266
+ }), __metadata("design:type", Object)], TextField.prototype, "charCount", void 0);
267
+
268
+ __decorate([attr, __metadata("design:type", String)], TextField.prototype, "density", void 0);
269
+
270
+ __decorate([attr, __metadata("design:type", String)], TextField.prototype, "appearance", void 0);
271
+
272
+ __decorate([attr, __metadata("design:type", String)], TextField.prototype, "shape", void 0);
273
+
274
+ __decorate([observable, __metadata("design:type", Object)], TextField.prototype, "userValid", void 0);
275
+
276
+ __decorate([attr, __metadata("design:type", String)], TextField.prototype, "autoComplete", void 0);
277
+
278
+ __decorate([volatile, __metadata("design:type", Object), __metadata("design:paramtypes", [])], TextField.prototype, "errorValidationMessage", null);
279
+
280
+ applyMixins(TextField, AffixIcon);
281
+
282
+ var css_248z = "/*\n Do not edit directly\n Generated on Wed, 27 Apr 2022 11:58:36 GMT\n*/\n.base {\n display: grid;\n gap: 4px;\n grid-template-columns: min-content 1fr max-content;\n}\n.base {\n --_appearance-color-text: var(--vvd-color-on-canvas);\n --_appearance-color-fill: var(--vvd-color-canvas);\n --_appearance-color-outline: var(--vvd-color-neutral-50);\n}\n.base.appearance-ghost {\n --_appearance-color-text: var(--_connotation-color-primary);\n --_appearance-color-fill: transaprent;\n --_appearance-color-outline: transaprent;\n}\n.base:where(:hover, .hover):where(:not(:disabled, .disabled)) {\n --_appearance-color-text: var(--vvd-color-on-canvas);\n --_appearance-color-fill: var(--vvd-color-canvas);\n --_appearance-color-outline: var(--vvd-color-on-canvas);\n}\n.base:where(:hover, .hover):where(:not(:disabled, .disabled)).appearance-ghost {\n --_appearance-color-text: var(--_connotation-color-primary);\n --_appearance-color-fill: var(--_connotation-color-faint);\n --_appearance-color-outline: transaprent;\n}\n.base:where(:disabled, .disabled) {\n --_appearance-color-text: var(--vvd-color-neutral-50);\n --_appearance-color-fill: var(--vvd-color-neutral-20);\n --_appearance-color-outline: var(--vvd-color-neutral-50);\n}\n.base:where(:disabled, .disabled).appearance-ghost {\n --_appearance-color-text: var(--vvd-color-neutral-50);\n --_appearance-color-fill: transaprent;\n --_appearance-color-outline: transaprent;\n}\n.base:where(:readonly, .readonly):where(:not(:disabled, .disabled, :hover, .hover, :active, .active)) {\n --_appearance-color-text: var(--vvd-color-on-canvas);\n --_appearance-color-fill: var(--vvd-color-neutral-20);\n --_appearance-color-outline: var(--vvd-color-neutral-50);\n}\n.base:where(:readonly, .readonly):where(:not(:disabled, .disabled, :hover, .hover, :active, .active)).appearance-ghost {\n --_appearance-color-text: var(--vvd-color-neutral-50);\n --_appearance-color-fill: transaprent;\n --_appearance-color-outline: transaprent;\n}\n.base:where(.error):where(:not(:disabled, .disabled)) {\n --_appearance-color-text: var(--vvd-color-alert);\n --_appearance-color-fill: var(--vvd-color-alert-20);\n --_appearance-color-outline: var(--vvd-color-alert);\n}\n.base:where(.error):where(:not(:disabled, .disabled)).appearance-ghost {\n --_appearance-color-text: transparent;\n --_appearance-color-fill: transparent;\n --_appearance-color-outline: transparent;\n}\n.base:not(.disabled) {\n --_low-ink-color: var(--vvd-color-neutral-70);\n}\n.base.disabled {\n --_low-ink-color: var(--vvd-color-neutral-50);\n}\n\n.label {\n font: 400 ultra-condensed 14px / 20px SpeziaWebVariable;\n letter-spacing: 0px;\n text-decoration: none;\n text-transform: none;\n grid-column: 1/4;\n grid-row: 1;\n}\n.char-count + .label {\n grid-column: 1/3;\n}\n.base:not(.disabled) .label {\n color: var(--vvd-color-on-canvas);\n}\n.base.disabled .label {\n color: var(--vvd-color-neutral-50);\n}\n\n.char-count {\n font: 400 ultra-condensed 14px / 20px SpeziaWebVariable;\n letter-spacing: 0px;\n text-decoration: none;\n text-transform: none;\n color: var(--_low-ink-color);\n grid-column: 3/4;\n}\n\n.fieldset {\n position: relative;\n display: flex;\n align-items: center;\n background-color: var(--_appearance-color-fill);\n box-shadow: inset 0 0 0 1px var(--_appearance-color-outline);\n color: var(--_appearance-color-text);\n contain: strict;\n grid-column: 1/4;\n padding-inline: 16px;\n transition: color 0.2s, box-shadow 0.2s, background-color 0.2s;\n /* Size */\n /* Shape */\n}\n.base:not(.density-extended) > .fieldset {\n block-size: 40px;\n}\n.base.density-extended > .fieldset {\n block-size: 48px;\n}\n.base:not(.shape-pill) .fieldset {\n border-radius: 6px;\n}\n.base.shape-pill .fieldset {\n border-radius: 24px;\n}\n\n.control {\n font: 400 ultra-condensed 14px / 20px SpeziaWebVariable;\n letter-spacing: 0px;\n text-decoration: none;\n text-transform: none;\n position: absolute;\n padding: 1px;\n border: 0 none;\n background-color: unset;\n block-size: 100%;\n border-radius: inherit;\n color: inherit;\n inset: 0;\n outline: 0 none;\n padding-inline-start: 16px;\n}\n.control::placeholder {\n color: var(--_low-ink-color);\n}\n\n.icon {\n position: relative;\n z-index: 1;\n color: var(--_low-ink-color);\n}\n.icon + .control {\n padding-inline-start: 44px;\n}\n\n.helper-text {\n font: 400 ultra-condensed 12px / 16px SpeziaWebVariable;\n letter-spacing: 0px;\n text-decoration: none;\n text-transform: none;\n color: var(--_low-ink-color);\n grid-column: 1/4;\n margin-inline-start: 16px;\n}\n\n.error-message {\n font: 400 ultra-condensed 12px / 16px SpeziaWebVariable;\n letter-spacing: 0px;\n text-decoration: none;\n text-transform: none;\n display: flex;\n color: var(--vvd-color-on-canvas);\n grid-column: 2/4;\n}\n.error-message-icon {\n color: var(--vvd-color-alert);\n font-size: 16px;\n grid-column: 1/2;\n}\n\n.focus-indicator {\n --focus-stroke-gap-color: transparent;\n pointer-events: none;\n}\n.fieldset:not(:focus-visible, :focus-within) > .focus-indicator {\n display: none;\n}";
283
+ styleInject(css_248z);
284
+
285
+ let _ = t => t,
286
+ _t,
287
+ _t2,
288
+ _t3,
289
+ _t4,
290
+ _t5;
291
+
292
+ const getStateClasses = ({
293
+ errorValidationMessage,
294
+ disabled,
295
+ value,
296
+ readOnly,
297
+ placeholder,
298
+ density,
299
+ appearance,
300
+ shape,
301
+ label
302
+ }) => classNames(['error', Boolean(errorValidationMessage)], ['disabled', disabled], ['has-value', Boolean(value)], ['readonly', readOnly], ['placeholder', Boolean(placeholder)], [`density-${density}`, Boolean(density)], [`appearance-${appearance}`, Boolean(appearance)], [`shape-${shape}`, Boolean(shape)], ['no-label', !label]);
303
+
304
+ function renderLabel() {
305
+ return html(_t || (_t = _`
306
+ <label for="control" class="label">
307
+ ${0}
308
+ </label>`), x => x.label);
309
+ }
310
+
311
+ function renderHelperText() {
312
+ return html(_t2 || (_t2 = _`<span class="helper-text">${0}</span>`), x => x.helperText);
313
+ }
314
+
315
+ function renderCharCount() {
316
+ return html(_t3 || (_t3 = _`
317
+ <span class="char-count">${0} / ${0}</span>
318
+ `), x => x.value ? x.value.length : 0, x => x.maxlength);
319
+ }
320
+
321
+ function renderErrorMessage() {
322
+ return html(_t4 || (_t4 = _`
323
+ <vwc-icon class="error-message-icon" type="info-negative"></vwc-icon>
324
+ <span class="error-message">${0}</span>
325
+ `), x => x.errorValidationMessage);
326
+ }
327
+
328
+ const TextfieldTemplate = context => {
329
+ const affixIconTemplate = affixIconTemplateFactory(context);
330
+ const focusTemplate = focusTemplateFactory(context);
331
+ return html(_t5 || (_t5 = _`
332
+ <div class="base ${0}">
333
+ ${0}
334
+ ${0}
335
+ <div class="fieldset">
336
+ ${0}
337
+ <input class="control"
338
+ id="control"
339
+ @input="${0}"
340
+ @change="${0}"
341
+ ?autofocus="${0}"
342
+ ?disabled="${0}"
343
+ list="${0}"
344
+ maxlength="${0}"
345
+ minlength="${0}"
346
+ pattern="${0}"
347
+ placeholder="${0}"
348
+ ?readonly="${0}"
349
+ ?required="${0}"
350
+ size="${0}"
351
+ autocomplete="${0}"
352
+ name="${0}"
353
+ ?spellcheck="${0}"
354
+ :value="${0}"
355
+ type="${0}"
356
+ aria-atomic="${0}"
357
+ aria-busy="${0}"
358
+ aria-controls="${0}"
359
+ aria-current="${0}"
360
+ aria-describedby="${0}"
361
+ aria-details="${0}"
362
+ aria-disabled="${0}"
363
+ aria-errormessage="${0}"
364
+ aria-flowto="${0}"
365
+ aria-haspopup="${0}"
366
+ aria-hidden="${0}"
367
+ aria-invalid="${0}"
368
+ aria-keyshortcuts="${0}"
369
+ aria-label="${0}"
370
+ aria-labelledby="${0}"
371
+ aria-live="${0}"
372
+ aria-owns="${0}"
373
+ aria-relevant="${0}"
374
+ aria-roledescription="${0}"
375
+ ${0}
376
+ />
377
+ ${0}
378
+ </div>
379
+ ${0}
380
+ ${0}
381
+ </div>`), getStateClasses, when(x => x.charCount && x.maxlength, renderCharCount()), when(x => x.label, renderLabel()), x => affixIconTemplate(x.icon), x => x.handleTextInput(), x => x.handleChange(), x => x.autofocus, x => x.disabled, x => x.list, x => x.maxlength, x => x.minlength, x => x.pattern, x => x.placeholder, x => x.readOnly, x => x.required, x => x.size, x => x.autoComplete, x => x.name, x => x.spellcheck, x => x.value, x => x.type, 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.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.ariaRelevant, x => x.ariaRoledescription, ref('control'), () => focusTemplate, when(x => {
382
+ var _a;
383
+
384
+ return !x.errorValidationMessage && ((_a = x.helperText) === null || _a === void 0 ? void 0 : _a.length);
385
+ }, renderHelperText()), when(x => x.errorValidationMessage, renderErrorMessage()));
386
+ };
387
+
388
+ const vividTextfield = TextField.compose({
389
+ baseName: 'text-field',
390
+ template: TextfieldTemplate,
391
+ styles: css_248z,
392
+ shadowOptions: {
393
+ delegatesFocus: true
394
+ }
395
+ });
396
+ designSystem.register(vividTextfield());
397
+
398
+ export { vividTextfield };
@@ -0,0 +1,71 @@
1
+ import '../popup/index.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 '../elevation/index.js';
7
+ import '../button/index.js';
8
+ import '../icon/index.js';
9
+ import '../shared/icon.js';
10
+ import '../shared/export.js';
11
+ import '../shared/iterators.js';
12
+ import '../shared/to-string.js';
13
+ import '../shared/_has.js';
14
+ import '../shared/when.js';
15
+ import '../focus/index.js';
16
+ import '../shared/focus.js';
17
+ import '../shared/affix.js';
18
+ import '../shared/button.js';
19
+ import '../shared/apply-mixins.js';
20
+ import '../shared/form-associated.js';
21
+ import '../shared/aria-global.js';
22
+ import '../shared/ref.js';
23
+ import '../shared/focus2.js';
24
+ import '../shared/object-keys.js';
25
+ import '../shared/es.object.assign.js';
26
+
27
+ var css_248z = "/*\n Do not edit directly\n Generated on Wed, 27 Apr 2022 11:58:36 GMT\n*/\n.control {\n pointer-events: none;\n}\n\n.tooltip {\n width: var(--tooltip-inline-size, 240px);\n}\n.tooltip-text {\n font: 600 ultra-condensed 14px / 20px SpeziaWebVariable;\n letter-spacing: 0px;\n text-decoration: none;\n text-transform: none;\n padding: 8px 12px;\n color: var(--vvd-color-on-canvas);\n}";
28
+ styleInject(css_248z);
29
+
30
+ class Tooltip extends FoundationElement {
31
+ constructor() {
32
+ super(...arguments);
33
+ this.open = false;
34
+ }
35
+
36
+ }
37
+
38
+ __decorate([attr, __metadata("design:type", String)], Tooltip.prototype, "text", void 0);
39
+
40
+ __decorate([attr({
41
+ mode: 'boolean'
42
+ }), __metadata("design:type", Object)], Tooltip.prototype, "open", void 0);
43
+
44
+ __decorate([attr, __metadata("design:type", String)], Tooltip.prototype, "corner", void 0);
45
+
46
+ __decorate([attr, __metadata("design:type", String)], Tooltip.prototype, "anchor", void 0);
47
+
48
+ let _2 = t => t,
49
+ _t;
50
+
51
+ const getClasses = _ => classNames('control');
52
+
53
+ const TooltipTemplate = () => html(_t || (_t = _2`
54
+ <vwc-popup class="${0}" arrow alternate="true"
55
+ corner=${0} open=${0} anchor=${0}
56
+ exportparts="vvd-theme-alternate">
57
+ <div class="tooltip">
58
+ <header part="vvd-theme-alternate" class="tooltip-header">
59
+ <div class="tooltip-text">${0}</div>
60
+ </header>
61
+ </div>
62
+ </vwc-popup>`), getClasses, x => x.corner, x => x.open, x => x.anchor, x => x.text);
63
+
64
+ const vividTooltip = Tooltip.compose({
65
+ baseName: 'tooltip',
66
+ template: TooltipTemplate,
67
+ styles: css_248z
68
+ });
69
+ designSystem.register(vividTooltip());
70
+
71
+ export { vividTooltip };