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